diff --git a/static/video_js/video-js.css b/static/video_js/video-js.css index da798d32..7d7d2b77 100644 --- a/static/video_js/video-js.css +++ b/static/video_js/video-js.css @@ -1 +1 @@ -html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}@media (hover: none) and (pointer: coarse){.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after,.video-js button.vjs-button:hover span.vjs-control-text,.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip,.vjs-chapter-floating-tooltip,.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-progress-control{bottom:58px!important}.video-js .vjs-progress-holder,.video-js .vjs-seek-bar{touch-action:pan-x!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.video-js .vjs-big-play-button{pointer-events:auto!important;z-index:1!important}.video-js .vjs-progress-control{z-index:10!important;pointer-events:auto!important}.video-js .vjs-autoplay-toggle.touch-active:after{opacity:1!important;visibility:visible!important}}.playlist-items a{text-decoration:none!important}.video-js-root-main .video-js.video-js-rounded-corners,.video-js-root-main .video-js.video-js-rounded-corners.vjs-has-started,.video-js-root-main .video-js.video-js-rounded-corners.vjs-fullscreen,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended,.video-js-root-main .video-js.video-js-rounded-corners.chapters-open{outline:none!important;border-radius:12px!important}.video-js video{outline:none!important}.video-js-root-main .video-js.video-js-rounded-corners .vjs-poster{border-radius:12px!important}.video-js-root-main .video-js.video-js-rounded-corners video{border-radius:12px!important}.video-js div.vjs-control-bar{background:transparent!important;background-color:transparent!important;background-image:none!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;padding:0 12px;height:48px}.video-js .vjs-play-control{order:0!important}.video-js .vjs-play-wrapper{order:0!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-play-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-next-video-wrapper{order:1!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-next-video-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-volume-wrapper{order:2!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:auto!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-volume-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-autoplay-wrapper{order:5!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-autoplay-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-chapters-button.vjs-menu-button{order:6!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-chapters-button.vjs-menu-button:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-subtitles-button.vjs-menu-button{order:7!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-subtitles-button.vjs-menu-button:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-settings-wrapper{order:8!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-settings-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-pip-wrapper{order:9!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-pip-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-pip-wrapper .vjs-picture-in-picture-control{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;position:relative!important}.video-js .vjs-fullscreen-wrapper{order:10!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-fullscreen-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-fullscreen-wrapper .vjs-fullscreen-control{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;position:relative!important}.video-js .vjs-pip-wrapper{margin-right:0!important}.video-js .vjs-fullscreen-wrapper{margin-left:0!important}.video-js .vjs-settings-wrapper .vjs-settings-button{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;position:relative!important;overflow:hidden!important}.video-js .vjs-settings-wrapper .vjs-settings-button svg{width:46px!important;height:46px!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper,.video-js .vjs-autoplay-wrapper,.video-js .vjs-chapters-button.vjs-menu-button,.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-settings-wrapper,.video-js .vjs-pip-wrapper,.video-js .vjs-fullscreen-wrapper{align-items:center!important;justify-content:center!important;vertical-align:middle!important}.video-js .vjs-next-video-control{order:1!important}.video-js .vjs-volume-panel{order:2!important}.video-js .custom-remaining-time{order:3!important}.video-js .vjs-spacer-control{order:4!important}.video-js .vjs-autoplay-toggle{order:5!important}.video-js .vjs-chapters-button{order:6!important}.video-js .vjs-subs-caps-button,.video-js .vjs-subtitles-button{order:7!important}.video-js .vjs-settings-button{order:8!important}.video-js .vjs-picture-in-picture-control{order:9!important}.video-js .vjs-fullscreen-control{order:10!important}.video-js-root-main .video-js.video-js-rounded-corners:after{content:"";position:absolute;bottom:0;left:0;right:0;height:120px;background:linear-gradient(to top,rgba(0,0,0,.8) 0%,rgba(0,0,0,.6) 25%,rgba(0,0,0,.4) 50%,rgba(0,0,0,.2) 75%,transparent 100%);pointer-events:none;opacity:0;transition:opacity .3s ease;z-index:2}.video-js-root-main .video-js.video-js-rounded-corners.vjs-user-active:after,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused:after,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended:after{border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important;opacity:1}.video-js .vjs-control-bar{z-index:6!important}.video-js.vjs-user-active:before,.video-js.vjs-paused:before{content:"";position:absolute;bottom:0;left:0;right:0;height:120px;background:linear-gradient(transparent,rgba(0,0,0,.7));z-index:2;pointer-events:none;transition:opacity .3s ease}.video-js.vjs-user-inactive:not(.vjs-paused):before{opacity:0}.video-js .vjs-progress-control.vjs-control{z-index:7!important}.video-js .vjs-control-bar .vjs-button .vjs-icon-placeholder:before{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.6)!important}.video-js .vjs-control-bar .vjs-time-control{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.6)!important;font-weight:500!important}@media (hover: hover) and (pointer: fine){.vjs-volume-control.vjs-control{top:17px!important}}.video-js .vjs-volume-control .vjs-volume-bar{background:rgba(255,255,255,.3)!important}.video-js .vjs-volume-control .vjs-volume-level{background:#ffffff!important}.video-container{width:100%;max-width:1200px;margin:0 auto;padding:0 20px;box-sizing:border-box;overflow-x:hidden;position:relative}.video-js-root-main{width:100%;max-width:100%;overflow-x:hidden}.video-js.vjs-fluid{width:100%!important;max-width:100%!important}.vjs-play-progress{background-color:#019932!important}.vjs-load-progress,.vjs-progress-holder{background:rgba(255,255,255,.5)!important}.video-js .vjs-progress-control{position:absolute!important;bottom:42px!important;left:0!important;right:0!important;width:100%!important;height:28px!important;z-index:3!important;padding:8px 0!important;margin:0 auto!important}.video-js .vjs-control-bar .vjs-progress-control{display:none!important}.video-js .vjs-progress-control.vjs-control{display:block!important}.video-js .vjs-control-bar .vjs-icon-placeholder,.video-js .vjs-control-bar .vjs-button .vjs-icon-placeholder,.video-js .vjs-control-bar [class*=vjs-icon-]{font-size:1.5em!important}.vjs-mouse-display{z-index:4!important}.vjs-slider-horizontal{top:-5px}.video-js .vjs-spacer-control{flex:1 1 auto!important;flex-grow:1!important;flex-shrink:1!important;min-width:1px!important;height:100%!important}.video-js .vjs-control-bar .vjs-spacer-control{margin-left:auto!important}.video-js .vjs-control-bar .vjs-control{flex:0 0 auto!important;flex-shrink:0!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:6px!important}button{cursor:pointer}.video-js{padding:0;height:100%!important;outline:none}.video-js[tabindex]{outline:none}.video-js .vjs-text-track-display{position:absolute!important;bottom:6em!important;left:0!important;right:0!important;top:0!important;pointer-events:none!important;z-index:10!important}.video-js .vjs-text-track-cue{position:absolute!important;bottom:0!important;left:0!important;right:0!important;text-align:center!important;padding:0!important;background:transparent!important;border:none!important;font-size:1.2em!important;line-height:1.4!important;color:#fff!important;text-shadow:2px 2px 4px rgba(0,0,0,.8)!important;font-family:Arial,sans-serif!important;font-weight:600!important;white-space:pre-line!important;word-wrap:break-word!important;max-width:90%!important;margin:0 auto!important;z-index:11!important}.video-js .vjs-text-track-cue>div{background:rgba(0,0,0,.7)!important;padding:8px 12px!important;border-radius:4px!important;display:inline-block!important;margin:2px 0!important;max-width:100%!important;box-sizing:border-box!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:8em!important}.video-js.vjs-fullscreen .vjs-text-track-cue{font-size:1.4em!important;max-width:85%!important}.video-js.vjs-fullscreen .vjs-text-track-cue>div{padding:10px 16px!important;font-size:1em!important}.video-js .vjs-menu-button:not(.vjs-disabled) .vjs-menu{display:none!important}.video-js .vjs-menu-button:not(.vjs-disabled).vjs-lock-showing .vjs-menu,.video-js .vjs-menu-button:not(.vjs-disabled) .vjs-menu.vjs-lock-showing{display:block!important}.video-js .vjs-menu-button:hover .vjs-menu{display:none!important}.video-js .vjs-menu-button.vjs-lock-showing:hover .vjs-menu{display:block!important}.video-js .vjs-menu.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.video-js.chapters-open .vjs-menu,.video-js.chapters-open .vjs-menu.vjs-lock-showing,.video-js.chapters-open .vjs-hover-display,.video-js.chapters-open .vjs-time-tooltip,.video-js.chapters-open .vjs-progress-holder .vjs-mouse-display{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-volume-panel.vjs-hover{transition:ease-in-out .5s!important;width:auto!important}.video-js span.vjs-control-text{position:absolute!important;bottom:125%;left:50%;transform:translate(-50%);background:rgba(0,0,0,.75);color:#fff;padding:6px 8px!important;border-radius:3px;font-size:13px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .3s ease;z-index:1000;box-shadow:0 0 5px #0000004d;height:auto!important;width:auto!important;overflow:visible!important;clip:initial!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:1}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:none!important}.vjs-volume-panel{gap:5px;z-index:1000!important}.video-js .vjs-play-progress.vjs-slider-bar+.vjs-time-tooltip{padding:0}.video-js div.vjs-control{width:auto}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:36px!important;height:36px!important;display:flex;align-items:center;justify-content:center;padding:0!important}button.vjs-button>.vjs-icon-placeholder:before{line-height:36px;transition:ease-in-out .5s}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{font-size:2.1em!important}.video-js .vjs-volume-panel div.vjs-volume-control{height:100%!important;display:flex;align-items:center;justify-content:center;margin:0;width:0;transition:ease-in-out .5s!important;opacity:0}.video-js .vjs-volume-panel div.vjs-volume-control .vjs-volume-bar{margin:0;top:0}@media (pointer: coarse){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-volume-panel .vjs-mute-control{display:flex!important;opacity:1!important}}@media (max-width: 767px){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-big-play-button{width:60px!important;height:60px!important;font-size:2.5em!important;border-radius:50%!important}.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-size:1.2em!important;line-height:60px!important}.video-js-root-main .video-js.video-js-rounded-corners,.video-js-root-main .video-js.video-js-rounded-corners.vjs-has-started,.video-js-root-main .video-js.video-js-rounded-corners.vjs-fullscreen,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended,.video-js-root-main .video-js.video-js-rounded-corners.chapters-open,.video-js-root-main .video-js.video-js-rounded-corners .vjs-poster{border-radius:0!important}.video-js-root-main .video-js.video-js-rounded-corners video{border-radius:0!important}.video-js .vjs-progress-control{bottom:52px!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper,.video-js .vjs-autoplay-wrapper,.video-js .vjs-chapters-button.vjs-menu-button,.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-settings-wrapper,.video-js .vjs-pip-wrapper,.video-js .vjs-fullscreen-wrapper{padding:0!important;margin:0 1px!important;width:32px!important;height:32px!important;align-items:center!important;justify-content:center!important}.video-js .vjs-play-wrapper .vjs-play-control,.video-js .vjs-next-video-wrapper .vjs-next-video-control,.video-js .vjs-autoplay-wrapper .vjs-autoplay-toggle,.video-js .vjs-chapters-button.vjs-menu-button button,.video-js .vjs-subtitles-button.vjs-menu-button button,.video-js .vjs-settings-wrapper .vjs-settings-button,.video-js .vjs-pip-wrapper .vjs-picture-in-picture-control,.video-js .vjs-fullscreen-wrapper .vjs-fullscreen-control{width:32px!important;height:32px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0!important;padding:0!important}.video-js .vjs-play-wrapper .vjs-play-control .vjs-icon-placeholder{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:100%!important;line-height:1!important;position:absolute!important;top:48%!important;left:50%!important;transform:translate(-50%,-50%)!important}.video-js .vjs-play-wrapper .vjs-play-control .vjs-icon-placeholder:before{position:static!important;top:auto!important;left:auto!important;transform:none!important;vertical-align:middle!important;line-height:1!important;display:flex!important;align-items:center!important;justify-content:center!important}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:32px;height:32px}button.vjs-button>.vjs-icon-placeholder:before{line-height:32px}.video-js div.vjs-control{height:32px}.vjs-button>.vjs-icon-placeholder:before{font-size:1.4em!important}.video-js div.vjs-control-bar{padding:0 2px;display:flex!important;flex-wrap:nowrap!important;gap:2px!important}.video-js .vjs-control-bar .vjs-control{flex:0 0 auto!important}.video-js .vjs-control-bar .custom-remaining-time{flex:0 1 auto!important;min-width:fit-content!important}.video-js .vjs-spacer-control{flex:1 1 auto!important;flex-grow:1!important;min-width:8px!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:6px!important}.video-js .vjs-text-track-display{bottom:8em!important}.video-js .vjs-text-track-cue{font-size:1.1em!important;max-width:95%!important}.video-js .vjs-text-track-cue>div{padding:6px 10px!important;font-size:.9em!important;background:rgba(0,0,0,.8)!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:10em!important}.video-js.vjs-fullscreen .vjs-text-track-cue{font-size:1.3em!important;max-width:90%!important}.video-js.vjs-fullscreen .vjs-text-track-cue>div{padding:8px 12px!important;font-size:.95em!important}.video-container{padding:0 15px}.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-play-control:hover:after,.video-js .vjs-mute-control:hover:after,.video-js .vjs-volume-panel:hover:after,.video-js .vjs-fullscreen-control:hover:after,.video-js .vjs-picture-in-picture-control:hover:after,.video-js .vjs-settings-control:hover:after,.video-js .vjs-chapters-control:hover:after,.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-next-video-control:hover:after,.video-js .vjs-remaining-time:hover:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:0!important;visibility:hidden!important}}@media (max-width: 500px){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-subs-caps-button{display:none!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper{margin:0 .5px!important;padding:0!important}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:26px!important;height:26px!important}button.vjs-button>.vjs-icon-placeholder:before{line-height:26px!important}.video-js div.vjs-control{height:26px!important}.vjs-button>.vjs-icon-placeholder:before{font-size:1.3em!important}.video-js div.vjs-control-bar{padding:0 1px!important;gap:0px!important;height:40px!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-progress-control{bottom:28px!important}.video-js .vjs-picture-in-picture-control,.video-js .vjs-descriptions-button,.video-js .vjs-audio-button{display:none!important}.video-js .custom-remaining-time{display:flex!important;visibility:visible!important;opacity:1!important;flex-shrink:0!important;min-width:fit-content!important}.video-js .custom-remaining-time .vjs-remaining-time-display{display:flex!important;visibility:visible!important;opacity:1!important}}@media (max-width: 480px){.video-js-root-main .video-js.video-js-rounded-corners,.video-js-root-main .video-js.video-js-rounded-corners.vjs-has-started,.video-js-root-main .video-js.video-js-rounded-corners.vjs-fullscreen,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended,.video-js-root-main .video-js.video-js-rounded-corners.chapters-open,.video-js-root-main .video-js.video-js-rounded-corners .vjs-poster{border-radius:0!important}.video-js-root-main .video-js.video-js-rounded-corners video{border-radius:0!important}.video-container{padding:0 10px}.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-play-control:hover:after,.video-js .vjs-mute-control:hover:after,.video-js .vjs-volume-panel:hover:after,.video-js .vjs-fullscreen-control:hover:after,.video-js .vjs-picture-in-picture-control:hover:after,.video-js .vjs-settings-control:hover:after,.video-js .vjs-chapters-control:hover:after,.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-next-video-control:hover:after,.video-js .vjs-remaining-time:hover:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:0!important;visibility:hidden!important}}@media (max-width: 399px){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-subs-caps-button{display:none!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper{margin:0!important;padding:0!important}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:28px;height:28px}button.vjs-button>.vjs-icon-placeholder:before{line-height:28px}.video-js div.vjs-control{height:28px}.video-js div.vjs-control-bar{padding:0 1px;gap:1px!important}.video-js .vjs-control-bar .vjs-control{flex:0 0 auto!important}.video-js .vjs-control-bar .custom-remaining-time{flex:0 1 auto!important;min-width:fit-content!important}.video-js .vjs-spacer-control{flex:1 1 auto!important;flex-grow:1!important;min-width:4px!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:4px!important}.video-js .vjs-text-track-display{bottom:7em!important}.video-js .vjs-text-track-cue{font-size:1em!important;max-width:98%!important}.video-js .vjs-text-track-cue>div{padding:4px 8px!important;font-size:.85em!important;background:rgba(0,0,0,.85)!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:9em!important}.video-js.vjs-fullscreen .vjs-text-track-cue{font-size:1.2em!important;max-width:95%!important}.video-js.vjs-fullscreen .vjs-text-track-cue>div{padding:6px 10px!important;font-size:.9em!important}.vjs-button>.vjs-icon-placeholder:before{font-size:1.4em!important}}@media (min-width: 1025px){.video-js .vjs-text-track-display{bottom:6em!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:12px!important}.video-js .vjs-text-track-cue{font-size:1.2em!important;max-width:90%!important}.video-js .vjs-text-track-cue>div{padding:8px 12px!important;font-size:1em!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:8em!important}}@media (min-width: 768px) and (max-width: 899px){.video-js .vjs-text-track-display{bottom:8em!important}.video-js .vjs-text-track-cue{font-size:1.15em!important;max-width:88%!important}.video-js .vjs-text-track-cue>div{padding:7px 11px!important;font-size:.95em!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:9em!important}.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-play-control:hover:after,.video-js .vjs-mute-control:hover:after,.video-js .vjs-volume-panel:hover:after,.video-js .vjs-fullscreen-control:hover:after,.video-js .vjs-picture-in-picture-control:hover:after,.video-js .vjs-settings-control:hover:after,.video-js .vjs-chapters-control:hover:after,.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-next-video-control:hover:after,.video-js .vjs-remaining-time:hover:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:0!important;visibility:hidden!important}}.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.video-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.video-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js *:before,.video-js *:after{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-1-1{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid white;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(114.9141509434,132.7028301887,159.3858490566,.5)}.video-js .vjs-load-progress div{background:rgba(114.9141509434,132.7028301887,159.3858490566,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.video-js.vjs-touch-enabled:not(.vjs-scrubbing) .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid white}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.video-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-normalise-time-controls:not(.vjs-live) .vjs-time-control{display:flex}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}@supports not (inset: 10px){.video-js .vjs-text-track-display>div{top:0;right:0;bottom:0;left:0}}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,rgb(114.9141509434,132.7028301887,159.3858490566) 100%)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,rgb(114.9141509434,132.7028301887,159.3858490566) 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0%,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:#32323280;cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:#323232e6}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible){outline:none}#page-embed .video-js-root-embed .video-js video{width:100vw!important;height:100vh!important;object-fit:cover!important;border-radius:0!important}#page-embed .video-js-root-embed .video-js .vjs-poster{border-radius:0!important;width:100vw!important;height:100vh!important;object-fit:cover!important}#page-embed .video-js-root-embed .video-container{width:100vw;height:100vh;max-width:none;margin:0;padding:0;box-sizing:border-box;position:fixed;top:0;left:0;z-index:1000}#page-embed .video-js-root-embed .video-js.vjs-fluid{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important}#page-embed .video-js-root-embed .video-js{width:100vw!important;height:100vh!important;border-radius:0;position:relative}#page-embed .video-js-root-embed{position:fixed;top:0}#page-embed .video-js-root-embed .video-js .vjs-control-bar{position:fixed!important;bottom:0!important;left:0!important;right:0!important;width:100vw!important;z-index:1001!important;background:transparent!important;background-color:transparent!important;background-image:none!important;padding:0 12px!important;margin:0!important;border:none!important;box-shadow:none!important}#page-embed .video-js-root-embed .video-js .vjs-progress-control{position:fixed!important;bottom:48px!important;left:0!important;right:0!important;width:100vw!important;z-index:1000!important;margin:0!important;padding:0!important;border:none!important}#page-embed .video-js-root-embed .video-js:after{position:fixed!important;bottom:0!important;left:0!important;right:0!important;width:100vw!important;height:120px!important;z-index:999!important}@media (max-width: 768px){#page-embed .video-js-root-embed .video-js .vjs-control-bar{height:56px!important;padding:0 16px!important;margin:0!important;border:none!important;background:transparent!important;background-color:transparent!important;background-image:none!important}#page-embed .video-js-root-embed .video-js .vjs-progress-control{bottom:44px!important;margin:0!important;padding:0!important}#page-embed .video-js-root-embed .video-js .vjs-control-bar{padding-bottom:env(safe-area-inset-bottom,0)!important}}#page-embed .video-js-root-embed .video-js.vjs-user-active .vjs-control-bar,#page-embed .video-js-root-embed .video-js.vjs-paused .vjs-control-bar,#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-control-bar{opacity:1!important;visibility:visible!important;transform:translateY(0)!important}#page-embed .video-js-root-embed .video-js .vjs-control-bar{transition:opacity .3s ease,transform .3s ease!important}#page-embed .video-js-root-embed .video-js.vjs-user-inactive:not(.vjs-paused):not(.vjs-ended) .vjs-control-bar{opacity:0!important;transform:translateY(100%)!important}#page-embed .video-js-root-embed .video-js.vjs-user-inactive:not(.vjs-paused):not(.vjs-ended) .vjs-progress-control{opacity:0!important}#page-embed .video-js-root-embed .video-js .vjs-seek-indicator{position:fixed!important;top:50vh!important;left:50vw!important;transform:translate(-50%,-50%)!important;z-index:10000!important;pointer-events:none!important;display:none!important;align-items:center!important;justify-content:center!important;opacity:0!important;visibility:hidden!important;transition:opacity .2s ease-in-out!important;width:auto!important;height:auto!important;margin:0!important;padding:0!important}#page-embed .video-js-root-embed .video-js .vjs-big-play-button{position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;z-index:1000!important;pointer-events:auto!important;margin:0!important;padding:0!important}#page-embed .video-js-root-embed .video-js:not(.vjs-has-started) .vjs-control-bar{display:none!important;opacity:0!important;visibility:hidden!important}#page-embed .video-js-root-embed .video-js:not(.vjs-has-started) .vjs-progress-control{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-captions-button,.video-js .vjs-subs-caps-button{display:none!important}.video-js .vjs-subtitles-button .vjs-menu,.video-js .vjs-subtitles-button .vjs-menu.vjs-lock-showing,.video-js .vjs-subtitles-button .vjs-menu.vjs-lock-showing .vjs-menu-content{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}.video-js .vjs-chapters-button .vjs-menu,.video-js .vjs-chapters-button .vjs-menu.vjs-lock-showing,.video-js .vjs-chapters-button .vjs-menu.vjs-lock-showing .vjs-menu-content{display:none!important}.video-js .vjs-chapters-button .vjs-menu{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}.video-js .vjs-subtitles-button{position:relative;cursor:pointer!important;pointer-events:auto!important}.video-js button.vjs-subtitles-button{cursor:pointer!important;pointer-events:auto!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important}.video-js button.vjs-subtitles-button:before{content:"";position:absolute;left:50%;transform:translate(-50%);bottom:6px;height:3px;background:#e1002d;border-radius:2px;width:0;padding:0;transition:none!important;animation:none!important;-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important}.video-js .vjs-subs-active button.vjs-subtitles-button:before{width:24px;transition:none!important;animation:none!important;-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important}.video-js button.vjs-subtitles-button{transition:none!important;animation:none!important;-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important}@media (max-width: 767px){.video-js .vjs-subtitles-button button.vjs-button{min-width:32px!important;min-height:32px!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.video-js .vjs-subs-active button.vjs-subtitles-button:before{width:20px}.video-js button.vjs-subtitles-button:before{bottom:2px}}.vjs-end-screen-overlay{position:absolute;top:0;left:0;width:100%;height:calc(100% - 100px);background:#000000;display:none;flex-direction:column;justify-content:center;align-items:center;padding:20px;box-sizing:border-box;z-index:9999;overflow:hidden}.video-js.vjs-ended .vjs-poster{display:none!important;opacity:0!important;visibility:hidden!important;z-index:-1!important;width:0!important;height:0!important}.video-js.vjs-ended video{display:none!important;opacity:0!important;visibility:hidden!important}.video-js.vjs-ended .vjs-end-screen-overlay{z-index:99999!important;display:flex!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-end-screen-overlay{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:99999!important;display:flex!important;padding-top:80px!important}.video-js.vjs-ended .vjs-control-bar{z-index:100000!important;position:absolute!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;display:flex!important;opacity:1!important;visibility:visible!important}.video-js.vjs-ended .vjs-progress-control{z-index:100000!important;position:absolute!important;bottom:48px!important;left:0!important;right:0!important;width:100%!important;display:block!important;opacity:1!important;visibility:visible!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-control-bar{position:fixed!important;bottom:0!important;left:0!important;right:0!important;width:100vw!important;z-index:100000!important;display:flex!important;opacity:1!important;visibility:visible!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-progress-control{position:fixed!important;bottom:48px!important;left:0!important;right:0!important;width:100vw!important;z-index:100000!important;display:block!important;opacity:1!important;visibility:visible!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-embed-info-overlay{z-index:100001!important;display:flex!important;opacity:1!important;visibility:visible!important}.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-ended .vjs-seek-indicator{display:none!important;opacity:0!important;visibility:hidden!important}.video-js.vjs-ended .vjs-control-bar{background:#000000!important;background-color:#000!important;background-image:none!important}.video-js.vjs-ended .vjs-progress-control{background:#000000!important;background-color:#000!important}.video-js.vjs-ended:after{background:#000000!important;background-image:none!important}.video-js.vjs-ended:before{background:#000000!important;background-image:none!important}.video-js.vjs-ended .vjs-loading-spinner,.video-js.vjs-ended .vjs-mouse-display{background:#000000!important;background-image:none!important}.video-js.vjs-ended .vjs-progress-holder{background:rgba(255,255,255,.3)!important}.video-js.vjs-ended .vjs-tech,.video-js.vjs-ended .vjs-poster-overlay{display:none!important;opacity:0!important;visibility:hidden!important}.vjs-related-videos-title{color:#fff;font-size:24px;line-height:24px;padding:0;margin:0;text-align:center;font-weight:700;flex-shrink:0}.vjs-related-videos-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:2px;width:100%;max-width:100%;margin:0;box-sizing:border-box;justify-items:stretch;align-items:stretch;justify-content:center;align-content:start;overflow:hidden;height:100%;flex:1;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-related-video-item{position:relative;cursor:pointer;overflow:hidden;transition:transform .2s ease,box-shadow .2s ease;background:#1a1a1a;border:1px solid #333;aspect-ratio:16/9;width:100%;min-height:100px;box-shadow:0 2px 8px #0003}.video-js.video-js-rounded-corners .vjs-related-video-item{border-radius:8px}.vjs-related-video-item:hover{transform:translateY(-2px);box-shadow:0 8px 25px #0000004d}.vjs-related-video-thumbnail{width:100%;height:100%;object-fit:cover;display:block;background:#1a1a1a;transition:transform .2s ease}.vjs-related-video-item:hover .vjs-related-video-thumbnail{transform:scale(1.02)}.vjs-related-video-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(transparent,rgba(0,0,0,.9));color:#fff;padding:12px;opacity:0;transition:opacity .3s ease;display:flex;flex-direction:column;justify-content:flex-start;height:100%}.vjs-related-video-item:hover .vjs-related-video-overlay{opacity:1}.vjs-related-video-title{font-size:14px;font-weight:700;line-height:1.3;color:#fff;margin-bottom:4px}.vjs-related-video-meta{display:flex;flex-direction:row;gap:8px;align-items:center}.vjs-related-video-author,.vjs-related-video-views{font-size:12px;color:#fff}.vjs-related-video-author:after{content:"•";margin-left:8px;color:#fff}.vjs-related-video-duration{position:absolute;bottom:8px;right:8px;background:rgba(0,0,0,.8);color:#fff;padding:2px 6px;font-size:11px;font-weight:700;opacity:0;transition:opacity .3s ease}.video-js.video-js-rounded-corners .vjs-related-video-duration{border-radius:2px}.vjs-related-video-item:hover .vjs-related-video-duration{opacity:1}.video-js.vjs-ended .vjs-control-bar{opacity:1!important;pointer-events:auto!important}.video-js.vjs-ended .vjs-control-bar .vjs-control,.video-js.vjs-ended .vjs-control-bar button{opacity:1!important;pointer-events:auto!important;cursor:pointer!important}.video-js.vjs-ended .vjs-control-bar .vjs-control.vjs-volume-control{opacity:0!important}.video-js.vjs-ended .vjs-control-bar .vjs-volume-panel.vjs-hover .vjs-volume-control{opacity:1!important}@media (max-width: 1200px){.vjs-related-videos-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{padding:15px;height:calc(100% - 95px)}}@media (max-width: 900px){.vjs-related-videos-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{padding:10px;height:calc(100% - 90px)}}@media (max-width: 600px){.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{padding:10px 5px 5px;height:calc(100% - 60px);justify-content:flex-start}.vjs-related-video-item{min-height:60px}}@media (max-width: 400px){.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{height:calc(100% - 60px);padding:10px 5px 5px;justify-content:flex-start}.vjs-related-video-item{min-height:50px}}.video-js.vjs-ended .vjs-play-control{opacity:1!important;pointer-events:auto!important;cursor:pointer!important}.video-js.vjs-ended .vjs-progress-control,.video-js.vjs-ended .vjs-volume-panel{opacity:1!important;pointer-events:auto!important}@media (min-width: 1200px){.vjs-related-videos-grid{grid-template-columns:repeat(4,1fr);gap:20px;height:auto;max-height:none}}@media (max-width: 1199px){.vjs-related-video-item:nth-child(n+10){display:none}}@media (max-width: 1100px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:16px}}@media (min-width: 1024px) and (max-width: 1199px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:16px;height:auto;max-height:none}.vjs-related-video-item:nth-child(n+10){display:none}}@media (min-width: 900px) and (max-width: 1024px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:16px;height:auto;max-height:none}.vjs-related-video-item:nth-child(n+10){display:none}}@media (min-width: 768px) and (max-width: 899px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:14px;height:auto;max-height:none}.vjs-end-screen-overlay{padding:20px 16px;justify-content:center}.vjs-related-video-item:nth-child(n+10){display:none}}@media (max-width: 767px){.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:16px!important;grid-gap:16px!important;max-height:70vh}.vjs-end-screen-overlay{padding:20px 12px;justify-content:flex-start}.vjs-related-video-item:nth-child(n+5){display:none}.vjs-related-video-thumbnail{height:100%}}@media (max-width: 574px){.vjs-related-video-item:nth-child(n+5){display:none}.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:14px!important;grid-gap:14px!important;max-height:65vh}.vjs-end-screen-overlay{padding:15px 10px;justify-content:flex-start}}@media (max-width: 439px){.vjs-related-video-item:nth-child(n+5){display:none}.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:12px!important;grid-gap:12px!important;max-height:60vh}.vjs-end-screen-overlay{padding:10px 8px;justify-content:flex-start}}@media (max-width: 480px){.vjs-related-video-thumbnail{height:100%}}.vjs-autoplay-countdown-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.85);display:none;flex-direction:column;justify-content:center;align-items:center;z-index:4;padding:20px;box-sizing:border-box;opacity:0;transition:opacity .2s ease-out}.autoplay-close-button{position:absolute;top:16px;right:16px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.3);border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;transition:all .2s ease;padding:0;z-index:10}.autoplay-close-button:hover{background:rgba(255,255,255,.2);border-color:#ffffff80;transform:scale(1.1)}.autoplay-close-button:active{transform:scale(.95)}.vjs-autoplay-countdown-overlay.autoplay-countdown-show{opacity:1}.autoplay-countdown-content{text-align:center;display:flex;flex-direction:column;align-items:center;gap:12px;max-width:350px;width:100%}.countdown-label{color:#fffc;font-size:14px;font-weight:400;margin:0;text-transform:uppercase;letter-spacing:1px}.next-video-title{color:#fff;font-size:18px;font-weight:600;margin:0 0 12px;line-height:1.3;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-align:center}.next-video-author{color:#ffffffb3;font-size:14px;font-weight:400;margin:-8px 0 0;line-height:1.2}.circular-countdown{position:relative;cursor:pointer;transition:transform .2s ease;margin:10px 0}.circular-countdown:hover{transform:scale(1.05)}.countdown-circle{filter:drop-shadow(0 4px 8px rgba(0,0,0,.3))}.countdown-progress{stroke-linecap:round;stroke-dasharray:282.74;stroke-dashoffset:282.74}.play-icon{cursor:pointer;transition:all .2s ease}.circular-countdown:hover .play-icon circle{fill:#fff}.circular-countdown:hover .play-icon path{fill:#000}.autoplay-cancel-button{background:transparent;border:1px solid rgba(255,255,255,.3);color:#ffffffe6;padding:10px 24px;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .2s ease;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;display:inline-block}.autoplay-cancel-button:hover{background:rgba(255,255,255,.1);border-color:#ffffff80;color:#fff;transform:translateY(-1px)}@media (min-width: 768px){.autoplay-close-button{display:flex!important}.autoplay-cancel-button{display:inline-block!important}}@media (max-width: 767px){.autoplay-close-button{display:flex!important;top:12px;right:12px;width:36px;height:36px}.autoplay-close-button svg{width:20px;height:20px}.autoplay-countdown-content{gap:8px;max-width:280px}.countdown-label{font-size:13px;margin:0}.next-video-title{font-size:16px;margin:0 0 8px}.next-video-author{font-size:13px;margin:-6px 0 0}.circular-countdown{margin:4px 0}.circular-countdown svg{width:80px;height:80px}.autoplay-cancel-button{display:none}}@media (max-width: 480px){.autoplay-close-button{display:flex!important;top:10px;right:10px;width:32px;height:32px}.autoplay-close-button svg{width:18px;height:18px}.autoplay-countdown-content{gap:6px;max-width:260px}.countdown-label{font-size:12px;margin:0}.next-video-title{font-size:15px;margin:0 0 6px}.next-video-author{font-size:12px;margin:-4px 0 0}.circular-countdown{margin:2px 0}.circular-countdown svg{width:70px;height:70px}.autoplay-cancel-button{display:none}}.vjs-embed-info-overlay{position:absolute!important;top:10px!important;left:10px!important;z-index:1000!important;display:flex!important;align-items:center!important;gap:10px!important;padding:8px 12px!important;max-width:calc(100% - 40px)!important;box-sizing:border-box!important;transition:opacity .3s ease-in-out!important;font-family:Arial,sans-serif!important}.vjs-embed-info-overlay .embed-avatar-container{flex-shrink:0!important;width:32px!important;height:32px!important;border-radius:50%!important;overflow:hidden!important;border:1px solid rgba(255,255,255,.2)!important}.vjs-embed-info-overlay .embed-avatar-container a{display:block!important;width:100%!important;height:100%!important;text-decoration:none!important}.vjs-embed-info-overlay .embed-avatar-container img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}.vjs-embed-info-overlay .embed-title-container{flex:1!important;min-width:0!important;overflow:hidden!important}.vjs-embed-info-overlay .embed-title-container a,.vjs-embed-info-overlay .embed-title-container span{color:#fff!important;text-decoration:none!important;font-size:14px!important;font-weight:500!important;line-height:1.3!important;display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;transition:color .2s ease!important}.vjs-embed-info-overlay .embed-title-container a:hover{color:#ccc!important}@media (max-width: 768px){.vjs-embed-info-overlay{top:8px!important;left:8px!important;padding:6px 10px!important;gap:8px!important;max-width:calc(100% - 32px)!important}.vjs-embed-info-overlay .embed-avatar-container{width:28px!important;height:28px!important}.vjs-embed-info-overlay .embed-title-container a,.vjs-embed-info-overlay .embed-title-container span{font-size:13px!important}}@media (max-width: 480px){.vjs-embed-info-overlay{top:6px!important;left:6px!important;padding:5px 8px!important;gap:6px!important;max-width:calc(100% - 24px)!important}.vjs-embed-info-overlay .embed-avatar-container{width:24px!important;height:24px!important}.vjs-embed-info-overlay .embed-title-container a,.vjs-embed-info-overlay .embed-title-container span{font-size:12px!important}}.vjs-chapter-markers-track{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.vjs-chapter-marker{position:absolute;top:0;width:2px;height:100%;background:rgba(255,255,255,.6);pointer-events:auto;cursor:pointer;transition:background .2s ease}.vjs-chapter-marker:hover{background:rgba(255,255,255,.9);width:3px}.vjs-chapter-marker-tooltip{position:absolute;bottom:8px;left:50%;transform:translate(-50%);background:rgba(0,0,0,.8);color:#fff;padding:4px 8px;border-radius:4px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:1001}.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:1}.vjs-chapter-floating-tooltip{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif!important;line-height:1.4!important;animation:fadeIn .2s ease-in-out;text-align:center;width:160px!important;max-width:100%!important;height:auto}.chapter-image-sprite{width:166px!important;max-width:100%!important;height:96px;margin:0 auto 10px;border-radius:6px;border:3px solid #fff}.vjs-chapter-floating-tooltip .chapter-title{font-size:16px;margin:0 0 10px;font-weight:700;word-break:break-all;line-height:20px}.vjs-chapter-floating-tooltip .position-info,.vjs-chapter-floating-tooltip .chapter-info{font-size:15px;display:inline-block;margin:0 0 2px;line-height:normal;vertical-align:top;line-height:20px}@keyframes fadeIn{0%{opacity:0;transform:translate(-50%) translateY(5px)}to{opacity:1;transform:translate(-50%) translateY(0)}}@media (hover: none) and (pointer: coarse){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip,.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (min-width: 768px) and (max-width: 899px){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:0!important;visibility:hidden!important}.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 767px){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:0!important;visibility:hidden!important}.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 480px){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:0!important;visibility:hidden!important}.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}.vjs-sprite-preview-track{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.vjs-sprite-preview-tooltip{text-align:center;width:172px!important;max-width:100%!important;height:auto}.vjs-sprite-preview-tooltip .sprite-image-preview{width:166px!important;max-width:100%!important;height:96px;margin:0 auto;border-radius:6px;border:3px solid #fff}@media (hover: none) and (pointer: coarse){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (min-width: 768px) and (max-width: 899px){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 767px){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 480px){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}.vjs-next-video-control .vjs-icon-placeholder{width:1.2em;height:1.2em;display:flex;align-items:center;justify-content:center;margin:auto;display:none!important}.vjs-next-video-control .vjs-icon-placeholder svg{width:100%;height:100%;display:block}@media (max-width: 767px){.vjs-next-video-control svg{width:32px;height:32px}}@media (max-width: 399px){.vjs-next-video-control svg{width:28px;height:28px}}.vjs-autoplay-toggle .vjs-autoplay-icon svg{width:100%;height:100%;display:block}.video-js .vjs-autoplay-toggle{position:relative}.video-js .vjs-autoplay-toggle .vjs-hover-display,.video-js .vjs-autoplay-toggle .vjs-tooltip,.video-js .vjs-autoplay-toggle .vjs-tooltip-text{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}.video-js .vjs-autoplay-toggle:after{content:attr(title);position:absolute;bottom:100%;left:50%;transform:translate(-50%);background:rgba(0,0,0,.9);color:#fff;padding:6px 10px;border-radius:4px;font-size:12px;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;z-index:1000;margin-bottom:8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;box-shadow:0 2px 8px #0000004d;border:1px solid rgba(255,255,255,.1)}.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-autoplay-toggle:focus:after{opacity:1;visibility:visible}@media (max-width: 767px){.video-js .vjs-autoplay-toggle.touch-active:after{opacity:1;visibility:visible}.video-js .vjs-autoplay-toggle:after{font-size:11px;padding:5px 8px;margin-bottom:6px}}.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:14px!important;font-weight:500;line-height:1;display:flex;align-items:center;justify-content:center;height:100%;color:#fff;white-space:nowrap;padding:0 4px}.vjs-control-bar .custom-remaining-time{flex-shrink:1!important;min-width:0!important}@media (max-width: 767px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:13px!important;padding:0 3px;font-weight:600!important}}@media (max-width: 500px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:12px!important;padding:0 2px;letter-spacing:-.2px;font-weight:600!important}}@media (max-width: 480px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:11px!important;padding:0 2px;letter-spacing:-.2px;font-weight:600!important}}@media (max-width: 399px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:10px!important;padding:0 1px;letter-spacing:-.3px;font-weight:600!important}}.video-chapter{position:absolute;top:auto;bottom:60px;width:min(360px,calc(100% - 20px));border:1px solid rgba(255,255,255,.12);border-radius:8px;height:calc(100% - 80px);background:rgba(18,18,18,.96);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);overflow:hidden;box-shadow:0 12px 30px #00000073;right:10px}.chapter-head{padding:12px 8px 10px 16px;position:sticky;top:0;left:0;background:linear-gradient(180deg,rgba(28,28,28,.95),rgba(18,18,18,.95));border-bottom:1px solid rgba(255,255,255,.08);z-index:2}.playlist-title{display:flex;align-items:center;gap:10px}.chapter-title{width:auto;flex:1;min-width:0}.chapter-title h3{margin:0;padding:0}.chapter-title h3 a{color:#fff;font-size:18px;line-height:26px;font-weight:700;text-decoration:none;white-space:nowrap;text-overflow:ellipsis;height:28px;overflow:hidden;display:block}.chapter-title p{margin:4px 0 0;padding:0;color:#fff;font-size:12px;font-weight:400;line-height:15px}.chapter-title p a{color:#fff;font-size:12px;font-weight:400;line-height:15px;text-decoration:none}.chapter-close{width:40px;margin-left:auto;display:flex;align-items:center;justify-content:flex-end}.chapter-close button{background:transparent;color:#fff;border:0;width:40px;height:40px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:8px}.chapter-close button:hover{background:rgba(255,255,255,.1)}.settings-header{display:flex;align-items:center;justify-content:space-between;position:relative}.settings-close-btn{background:transparent;color:#fff;border:0;width:32px;height:32px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer}.settings-close-btn:hover{background:rgba(255,255,255,.1)}.playlist-action-menu{display:none;justify-content:space-between;gap:10px}.playlist-action-menu button{background:transparent;border:0;width:40px;height:40px;padding:0;display:flex;justify-content:center;align-items:center;border-radius:100px}.playlist-action-menu button:hover{background:rgba(0,0,0,.1)}.start-action{display:flex}.chapter-body{height:calc(100% - 80px);overflow:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain;scroll-behavior:smooth}.chapter-body ul{margin:0;padding:0}.playlist-items a{padding:12px;display:flex;align-items:center;text-decoration:none;gap:12px;width:100%;box-sizing:border-box;color:#fff}.playlist-items a:hover{background:rgba(255,255,255,.06)}.playlist-items.selected a{background:rgba(255,255,255,.14)}.playlist-drag-handle{width:24px;display:flex;justify-content:center;color:#e0e0e0;font-size:12px}.thumbnail-meta{flex:1;min-width:0;padding:0}.thumbnail-meta h4{margin:0 2px 4px 0;font-size:14px;line-height:20px;font-weight:600;overflow:hidden;text-overflow:ellipsis;color:#fff;white-space:normal;max-height:40px;-webkit-line-clamp:2;line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical}.thumbnail-meta .meta-sub{display:flex;gap:8px;align-items:center}.thumbnail-meta .meta-sub .meta-dynamic{color:#bdbdbd;font-size:12px;line-height:18px}.thumbnail-action button{border:0;background:transparent;color:#fff;opacity:0}.playlist-items a:hover .thumbnail-action button{opacity:1}.chapter-body::-webkit-scrollbar{width:10px}.chapter-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:8px}.chapter-body::-webkit-scrollbar-track{background:transparent}@media (max-width: 767px){.chapter-body{-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain;height:calc(100% - 70px)}.chapter-body::-webkit-scrollbar{width:0px}div.chapter-close button{width:30px;height:30px}.video-js-root-main .video-js.video-js-rounded-corners .custom-chapters-overlay{border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important}.custom-chapters-overlay .video-chapter{right:10px;left:auto;width:100%;max-width:280px;height:calc(100% - 40px);max-height:calc(100% - 40px);overflow:hidden;bottom:40px}.chapter-head{padding:10px 15px}.chapter-title h3 a{font-size:15px!important;line-height:20px!important;height:20px!important}.chapter-title p{font-size:11px!important;line-height:14px!important}.playlist-items a{padding:10px 16px!important;min-height:58px!important}.thumbnail-meta h4{font-size:13px!important;line-height:18px!important}.thumbnail-meta .meta-sub .meta-dynamic{font-size:11px!important;line-height:16px!important}}.vjs-settings-button{width:3em;height:3em;display:flex;align-items:center;justify-content:center;padding:0;margin:0}.vjs-icon-cog1{font-size:30px!important;position:relative;top:-8px!important;display:flex;align-items:center;justify-content:center;width:100%;height:100%;line-height:1}.custom-settings-overlay{border:0;position:absolute;bottom:60px;right:20px;width:280px;height:350px;background:rgba(28,28,28,.95);color:#fff;border-radius:7px;box-shadow:0 4px 12px #00000080;display:none;z-index:9999;font-size:14px;overflow:auto}.settings-header{padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.1);font-weight:700}.settings-item{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid rgba(255,255,255,.1);transition:background .2s ease;gap:10px}.settings-item .settings-left span{display:flex}.custom-settings-overlay .settings-left span.vjs-icon-placeholder{transform:inherit!important}.settings-item:last-child{border-bottom:none}.settings-item:hover{background:rgba(255,255,255,.05)}.speed-submenu,.quality-submenu,.subtitles-submenu{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(28,28,28,.95);display:none;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain}.subtitle-option{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s ease}.subtitle-option:hover{background:rgba(255,255,255,.05)}.subtitle-option.active{background:rgba(255,255,255,.1)}.submenu-header{padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.1);display:flex;align-items:center;cursor:pointer;position:sticky;top:0;background:rgba(28,28,28,.95);z-index:1}.submenu-header:hover{background:rgba(28,28,28,1)}.speed-option{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s ease}.speed-option:hover{background:rgba(255,255,255,.05)}.speed-option.active{background:rgba(255,255,255,.1)}.quality-option{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s ease}.quality-option:hover{background:rgba(255,255,255,.05)}.quality-option.active{background:rgba(255,255,255,.1)}.settings-left{display:inline-flex;align-items:center;gap:8px}.settings-right{display:inline-flex;align-items:center;text-align:right}sup.hd-badge{font-size:10px;line-height:1;margin-left:6px;background:#e53935;color:#fff;padding:1px 4px;border-radius:3px}.video-js .vjs-settings-button{cursor:pointer!important;pointer-events:auto!important;position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;min-width:32px!important;height:32px!important;padding:0!important;border:none!important;background:transparent!important;color:inherit!important;font-size:inherit!important;line-height:inherit!important;text-align:center!important;vertical-align:middle!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.video-js .vjs-settings-button:hover{background:none!important}.video-js .vjs-settings-button:focus{outline:none!important}.video-js .vjs-settings-button .vjs-icon-cog{font-size:18px!important;width:18px!important;height:18px!important;display:flex!important;align-items:center!important;justify-content:center!important}.video-js .vjs-control-bar .settings-item-svg{display:flex}.video-js .vjs-control-bar .settings-item-svg svg{width:auto!important;height:auto!important;transform:inherit!important}.vjs-settings-button svg{transition:ease-in-out .3s}.vjs-settings-button.settings-clicked svg{transform:rotate(30deg)}@media (max-width: 1024px){body div.custom-settings-overlay{height:calc(100% - 40px);max-height:300px}}@media (max-width: 767px){.video-js .vjs-settings-button{min-width:44px!important;height:44px!important;padding:0!important;margin:0 2px!important;display:flex!important;align-items:center!important;justify-content:center!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;cursor:pointer!important;z-index:1000!important;pointer-events:auto!important;position:relative!important}.video-js .vjs-settings-button .vjs-icon-cog{font-size:20px!important;width:20px!important;height:20px!important;display:flex!important;align-items:center!important;justify-content:center!important}.video-js .vjs-control-bar .vjs-button{touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.custom-settings-overlay .settings-item{padding:6px 16px;font-size:15px;touch-action:manipulation;line-height:18px}.custom-settings-overlay .settings-header{padding:10px 16px;font-size:18px;line-height:20px}body div.custom-settings-overlay{bottom:40px}}@media (max-width: 480px){.video-js .vjs-settings-button .vjs-icon-cog{font-size:22px!important;width:22px!important;height:22px!important}}.vjs-seek-indicator{position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;z-index:9999!important;pointer-events:none!important;display:none!important;align-items:center!important;justify-content:center!important;opacity:0!important;visibility:hidden!important;transition:opacity .2s ease-in-out!important}.vjs-seek-indicator-content{background:transparent!important;flex-direction:column!important;align-items:center!important;justify-content:center!important}.vjs-seek-indicator-icon{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;margin-bottom:4px!important}.seek-icon-container{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;animation:seekPulse .3s ease-out!important}.youtube-seek-container{display:flex!important;align-items:center!important;justify-content:center!important;animation:youtubeSeekPulse .3s ease-out!important}.youtube-seek-circle{width:80px!important;height:80px!important;border-radius:50%!important;-webkit-border-radius:50%!important;-moz-border-radius:50%!important;background:rgba(0,0,0,.8)!important;backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;padding:0!important;box-shadow:0 4px 20px #0000004d!important;border:1px solid rgba(255,255,255,.15)!important;box-sizing:border-box!important;overflow:hidden!important}@media (max-width: 768px){.vjs-seek-indicator{top:calc(50% - 30px)!important}.youtube-seek-circle{width:60px!important;height:60px!important}.youtube-seek-icon svg{width:24px!important;height:24px!important}}@media (max-width: 480px){.vjs-seek-indicator{top:calc(50% - 40px)!important}.youtube-seek-circle{width:50px!important;height:50px!important}.youtube-seek-icon svg{width:20px!important;height:20px!important}}.youtube-seek-icon{display:flex!important;align-items:center!important;justify-content:center!important;margin-bottom:4px!important}.youtube-seek-icon svg{filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))!important}.youtube-seek-time{color:#fff!important;font-size:10px!important;font-weight:500!important;text-align:center!important;line-height:1.2!important;opacity:.9!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important}@keyframes youtubeSeekPulse{0%{transform:scale(.7);opacity:.5}50%{transform:scale(1.05);opacity:.9}to{transform:scale(1);opacity:1}}.seek-seconds{color:#fff!important;font-size:16px!important;font-weight:700!important;text-shadow:0 2px 4px rgba(0,0,0,.7)!important;line-height:1!important}.vjs-seek-indicator-text{color:#fff!important;font-size:16px!important;font-weight:500!important;text-align:center!important;text-shadow:0 1px 2px rgba(0,0,0,.8)!important} +html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}@media (hover: none) and (pointer: coarse){.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after,.video-js button.vjs-button:hover span.vjs-control-text,.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip,.vjs-chapter-floating-tooltip,.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-progress-control{bottom:58px!important}.video-js .vjs-progress-holder,.video-js .vjs-seek-bar{touch-action:pan-x!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.video-js .vjs-big-play-button{pointer-events:auto!important;z-index:1!important}.video-js .vjs-progress-control{z-index:10!important;pointer-events:auto!important}.video-js .vjs-autoplay-toggle.touch-active:after{opacity:1!important;visibility:visible!important}}.playlist-items a{text-decoration:none!important}.video-js-root-main .video-js.video-js-rounded-corners,.video-js-root-main .video-js.video-js-rounded-corners.vjs-has-started,.video-js-root-main .video-js.video-js-rounded-corners.vjs-fullscreen,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended,.video-js-root-main .video-js.video-js-rounded-corners.chapters-open{outline:none!important;border-radius:12px!important}.video-js video{outline:none!important}.video-js-root-main .video-js.video-js-rounded-corners .vjs-poster{border-radius:12px!important}.video-js-root-main .video-js.video-js-rounded-corners video{border-radius:12px!important}.video-js div.vjs-control-bar{background:transparent!important;background-color:transparent!important;background-image:none!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;padding:0 12px;height:48px}.video-js .vjs-play-control{order:0!important}.video-js .vjs-play-wrapper{order:0!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-play-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-next-video-wrapper{order:1!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-next-video-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-volume-wrapper{order:2!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:auto!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-volume-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-autoplay-wrapper{order:5!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-autoplay-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-chapters-button.vjs-menu-button{order:6!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-chapters-button.vjs-menu-button:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-subtitles-button.vjs-menu-button{order:7!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-subtitles-button.vjs-menu-button:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-settings-wrapper{order:8!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-settings-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-pip-wrapper{order:9!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-pip-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-pip-wrapper .vjs-picture-in-picture-control{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;position:relative!important}.video-js .vjs-fullscreen-wrapper{order:10!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;background:rgba(0,0,0,.1)!important;border-radius:6px!important;padding:2px!important;margin:0 2px!important;transition:background-color .3s ease!important;width:40px!important;height:40px!important;flex-shrink:0!important}.video-js .vjs-fullscreen-wrapper:hover{background:rgba(0,0,0,.2)!important}.video-js .vjs-fullscreen-wrapper .vjs-fullscreen-control{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;position:relative!important}.video-js .vjs-pip-wrapper{margin-right:0!important}.video-js .vjs-fullscreen-wrapper{margin-left:0!important}.video-js .vjs-settings-wrapper .vjs-settings-button{display:flex!important;align-items:center!important;justify-content:center!important;width:36px!important;height:36px!important;margin:0!important;padding:0!important;position:relative!important;overflow:hidden!important}.video-js .vjs-settings-wrapper .vjs-settings-button svg{width:46px!important;height:46px!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper,.video-js .vjs-autoplay-wrapper,.video-js .vjs-chapters-button.vjs-menu-button,.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-settings-wrapper,.video-js .vjs-pip-wrapper,.video-js .vjs-fullscreen-wrapper{align-items:center!important;justify-content:center!important;vertical-align:middle!important}.video-js .vjs-next-video-control{order:1!important}.video-js .vjs-volume-panel{order:2!important}.video-js .custom-remaining-time{order:3!important}.video-js .vjs-spacer-control{order:4!important}.video-js .vjs-autoplay-toggle{order:5!important}.video-js .vjs-chapters-button{order:6!important}.video-js .vjs-subs-caps-button,.video-js .vjs-subtitles-button{order:7!important}.video-js .vjs-settings-button{order:8!important}.video-js .vjs-picture-in-picture-control{order:9!important}.video-js .vjs-fullscreen-control{order:10!important}.video-js-root-main .video-js.video-js-rounded-corners:after{content:"";position:absolute;bottom:0;left:0;right:0;height:120px;background:linear-gradient(to top,rgba(0,0,0,.8) 0%,rgba(0,0,0,.6) 25%,rgba(0,0,0,.4) 50%,rgba(0,0,0,.2) 75%,transparent 100%);pointer-events:none;opacity:0;transition:opacity .3s ease;z-index:2}.video-js-root-main .video-js.video-js-rounded-corners.vjs-user-active:after,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused:after,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended:after{border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important;opacity:1}.video-js .vjs-control-bar{z-index:6!important}.video-js.vjs-user-active:before,.video-js.vjs-paused:before{content:"";position:absolute;bottom:0;left:0;right:0;height:120px;background:linear-gradient(transparent,rgba(0,0,0,.7));z-index:2;pointer-events:none;transition:opacity .3s ease}.video-js.vjs-user-inactive:not(.vjs-paused):before{opacity:0}.video-js .vjs-progress-control.vjs-control{z-index:7!important}.video-js .vjs-control-bar .vjs-button .vjs-icon-placeholder:before{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.6)!important}.video-js .vjs-control-bar .vjs-time-control{color:#fff!important;text-shadow:0 1px 2px rgba(0,0,0,.6)!important;font-weight:500!important}@media (hover: hover) and (pointer: fine){.vjs-volume-control.vjs-control{top:17px!important}}.video-js .vjs-volume-control .vjs-volume-bar{background:rgba(255,255,255,.3)!important}.video-js .vjs-volume-control .vjs-volume-level{background:#ffffff!important}.video-container{width:100%;max-width:1200px;margin:0 auto;padding:0 20px;box-sizing:border-box;overflow-x:hidden;position:relative}.video-js-root-main{width:100%;max-width:100%;overflow-x:hidden}.video-js.vjs-fluid{width:100%!important;max-width:100%!important}.vjs-play-progress{background-color:#019932!important}.vjs-load-progress,.vjs-progress-holder{background:rgba(255,255,255,.5)!important}.vjs-load-progress>div[data-start][data-end]{background:transparent!important;border:none!important;box-shadow:none!important}.video-js .vjs-progress-control{position:absolute!important;bottom:42px!important;left:0!important;right:0!important;width:100%!important;height:28px!important;z-index:3!important;padding:8px 0!important;margin:0 auto!important}.video-js .vjs-control-bar .vjs-progress-control{display:none!important}.video-js .vjs-progress-control.vjs-control{display:block!important}.video-js .vjs-control-bar .vjs-icon-placeholder,.video-js .vjs-control-bar .vjs-button .vjs-icon-placeholder,.video-js .vjs-control-bar [class*=vjs-icon-]{font-size:1.5em!important}.vjs-mouse-display{z-index:4!important}.vjs-slider-horizontal{top:-5px}.video-js .vjs-spacer-control{flex:1 1 auto!important;flex-grow:1!important;flex-shrink:1!important;min-width:1px!important;height:100%!important}.video-js .vjs-control-bar .vjs-spacer-control{margin-left:auto!important}.video-js .vjs-control-bar .vjs-control{flex:0 0 auto!important;flex-shrink:0!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:6px!important}button{cursor:pointer}.video-js{padding:0;height:100%!important;outline:none}.video-js[tabindex]{outline:none}.video-js .vjs-text-track-display{position:absolute!important;bottom:6em!important;left:0!important;right:0!important;top:0!important;pointer-events:none!important;z-index:10!important}.video-js .vjs-text-track-cue{position:absolute!important;bottom:0!important;left:0!important;right:0!important;text-align:center!important;padding:0!important;background:transparent!important;border:none!important;font-size:1.2em!important;line-height:1.4!important;color:#fff!important;text-shadow:2px 2px 4px rgba(0,0,0,.8)!important;font-family:Arial,sans-serif!important;font-weight:600!important;white-space:pre-line!important;word-wrap:break-word!important;max-width:90%!important;margin:0 auto!important;z-index:11!important}.video-js .vjs-text-track-cue>div{background:rgba(0,0,0,.7)!important;padding:8px 12px!important;border-radius:4px!important;display:inline-block!important;margin:2px 0!important;max-width:100%!important;box-sizing:border-box!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:8em!important}.video-js.vjs-fullscreen .vjs-text-track-cue{font-size:1.4em!important;max-width:85%!important}.video-js.vjs-fullscreen .vjs-text-track-cue>div{padding:10px 16px!important;font-size:1em!important}.video-js .vjs-menu-button:not(.vjs-disabled) .vjs-menu{display:none!important}.video-js .vjs-menu-button:not(.vjs-disabled).vjs-lock-showing .vjs-menu,.video-js .vjs-menu-button:not(.vjs-disabled) .vjs-menu.vjs-lock-showing{display:block!important}.video-js .vjs-menu-button:hover .vjs-menu{display:none!important}.video-js .vjs-menu-button.vjs-lock-showing:hover .vjs-menu{display:block!important}.video-js .vjs-menu.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.video-js.chapters-open .vjs-menu,.video-js.chapters-open .vjs-menu.vjs-lock-showing,.video-js.chapters-open .vjs-hover-display,.video-js.chapters-open .vjs-time-tooltip,.video-js.chapters-open .vjs-progress-holder .vjs-mouse-display{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-volume-panel.vjs-hover{transition:ease-in-out .5s!important;width:auto!important}.video-js span.vjs-control-text{position:absolute!important;bottom:125%;left:50%;transform:translate(-50%);background:rgba(0,0,0,.75);color:#fff;padding:6px 8px!important;border-radius:3px;font-size:13px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .3s ease;z-index:1000;box-shadow:0 0 5px #0000004d;height:auto!important;width:auto!important;overflow:visible!important;clip:initial!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:1}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:none!important}.vjs-volume-panel{gap:5px;z-index:1000!important}.video-js .vjs-play-progress.vjs-slider-bar+.vjs-time-tooltip{padding:0}.video-js div.vjs-control{width:auto}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:36px!important;height:36px!important;display:flex;align-items:center;justify-content:center;padding:0!important}button.vjs-button>.vjs-icon-placeholder:before{line-height:36px;transition:ease-in-out .5s}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{font-size:2.1em!important}.video-js .vjs-volume-panel div.vjs-volume-control{height:100%!important;display:flex;align-items:center;justify-content:center;margin:0;width:0;transition:ease-in-out .5s!important;opacity:0}.video-js .vjs-volume-panel div.vjs-volume-control .vjs-volume-bar{margin:0;top:0}@media (pointer: coarse){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-volume-panel .vjs-mute-control{display:flex!important;opacity:1!important}}@media (max-width: 767px){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-big-play-button{width:60px!important;height:60px!important;font-size:2.5em!important;border-radius:50%!important}.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-size:1.2em!important;line-height:60px!important}.video-js-root-main .video-js.video-js-rounded-corners,.video-js-root-main .video-js.video-js-rounded-corners.vjs-has-started,.video-js-root-main .video-js.video-js-rounded-corners.vjs-fullscreen,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended,.video-js-root-main .video-js.video-js-rounded-corners.chapters-open,.video-js-root-main .video-js.video-js-rounded-corners .vjs-poster{border-radius:0!important}.video-js-root-main .video-js.video-js-rounded-corners video{border-radius:0!important}.video-js .vjs-progress-control{bottom:42px!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper,.video-js .vjs-autoplay-wrapper,.video-js .vjs-chapters-button.vjs-menu-button,.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-settings-wrapper,.video-js .vjs-pip-wrapper,.video-js .vjs-fullscreen-wrapper{padding:0!important;margin:0 1px!important;width:32px!important;height:32px!important;align-items:center!important;justify-content:center!important}.video-js .vjs-play-wrapper .vjs-play-control,.video-js .vjs-next-video-wrapper .vjs-next-video-control,.video-js .vjs-autoplay-wrapper .vjs-autoplay-toggle,.video-js .vjs-chapters-button.vjs-menu-button button,.video-js .vjs-subtitles-button.vjs-menu-button button,.video-js .vjs-settings-wrapper .vjs-settings-button,.video-js .vjs-pip-wrapper .vjs-picture-in-picture-control,.video-js .vjs-fullscreen-wrapper .vjs-fullscreen-control{width:32px!important;height:32px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0!important;padding:0!important}.video-js .vjs-play-wrapper .vjs-play-control .vjs-icon-placeholder{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:100%!important;line-height:1!important;position:absolute!important;top:48%!important;left:50%!important;transform:translate(-50%,-50%)!important}.video-js .vjs-play-wrapper .vjs-play-control .vjs-icon-placeholder:before{position:static!important;top:auto!important;left:auto!important;transform:none!important;vertical-align:middle!important;line-height:1!important;display:flex!important;align-items:center!important;justify-content:center!important}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:32px;height:32px}button.vjs-button>.vjs-icon-placeholder:before{line-height:32px}.video-js div.vjs-control{height:32px}.vjs-button>.vjs-icon-placeholder:before{font-size:1.4em!important}.video-js div.vjs-control-bar{padding:0 2px;display:flex!important;flex-wrap:nowrap!important;gap:2px!important}.video-js .vjs-control-bar .vjs-control{flex:0 0 auto!important}.video-js .vjs-control-bar .custom-remaining-time{flex:0 1 auto!important;min-width:fit-content!important}.video-js .vjs-spacer-control{flex:1 1 auto!important;flex-grow:1!important;min-width:8px!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:6px!important}.video-js .vjs-text-track-display{bottom:8em!important}.video-js .vjs-text-track-cue{font-size:1.1em!important;max-width:95%!important}.video-js .vjs-text-track-cue>div{padding:6px 10px!important;font-size:.9em!important;background:rgba(0,0,0,.8)!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:10em!important}.video-js.vjs-fullscreen .vjs-text-track-cue{font-size:1.3em!important;max-width:90%!important}.video-js.vjs-fullscreen .vjs-text-track-cue>div{padding:8px 12px!important;font-size:.95em!important}.video-container{padding:0 15px}.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-play-control:hover:after,.video-js .vjs-mute-control:hover:after,.video-js .vjs-volume-panel:hover:after,.video-js .vjs-fullscreen-control:hover:after,.video-js .vjs-picture-in-picture-control:hover:after,.video-js .vjs-settings-control:hover:after,.video-js .vjs-chapters-control:hover:after,.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-next-video-control:hover:after,.video-js .vjs-remaining-time:hover:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:0!important;visibility:hidden!important}}@media (max-width: 500px){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-subs-caps-button{display:none!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper{margin:0 .5px!important;padding:0!important}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:26px!important;height:26px!important}button.vjs-button>.vjs-icon-placeholder:before{line-height:26px!important}.video-js div.vjs-control{height:26px!important}.vjs-button>.vjs-icon-placeholder:before{font-size:1.3em!important}.video-js div.vjs-control-bar{padding:0 1px!important;gap:0px!important;height:40px!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-progress-control{bottom:28px!important}.video-js .vjs-picture-in-picture-control,.video-js .vjs-descriptions-button,.video-js .vjs-audio-button{display:none!important}.video-js .custom-remaining-time{display:flex!important;visibility:visible!important;opacity:1!important;flex-shrink:0!important;min-width:fit-content!important}.video-js .custom-remaining-time .vjs-remaining-time-display{display:flex!important;visibility:visible!important;opacity:1!important}}@media (max-width: 480px){.video-js-root-main .video-js.video-js-rounded-corners,.video-js-root-main .video-js.video-js-rounded-corners.vjs-has-started,.video-js-root-main .video-js.video-js-rounded-corners.vjs-fullscreen,.video-js-root-main .video-js.video-js-rounded-corners.vjs-paused,.video-js-root-main .video-js.video-js-rounded-corners.vjs-ended,.video-js-root-main .video-js.video-js-rounded-corners.chapters-open,.video-js-root-main .video-js.video-js-rounded-corners .vjs-poster{border-radius:0!important}.video-js-root-main .video-js.video-js-rounded-corners video{border-radius:0!important}.video-container{padding:0 10px}.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-play-control:hover:after,.video-js .vjs-mute-control:hover:after,.video-js .vjs-volume-panel:hover:after,.video-js .vjs-fullscreen-control:hover:after,.video-js .vjs-picture-in-picture-control:hover:after,.video-js .vjs-settings-control:hover:after,.video-js .vjs-chapters-control:hover:after,.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-next-video-control:hover:after,.video-js .vjs-remaining-time:hover:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:0!important;visibility:hidden!important}}@media (max-width: 399px){.video-js .vjs-volume-panel div.vjs-volume-control{width:0!important;opacity:0!important;display:none!important}.video-js .vjs-subtitles-button.vjs-menu-button,.video-js .vjs-subs-caps-button{display:none!important}.video-js .vjs-play-wrapper,.video-js .vjs-next-video-wrapper,.video-js .vjs-volume-wrapper{margin:0!important;padding:0!important}.vjs-chapters-button button.vjs-button,.vjs-subtitles-button button.vjs-button,.video-js button.vjs-control{width:28px;height:28px}button.vjs-button>.vjs-icon-placeholder:before{line-height:28px}.video-js div.vjs-control{height:28px}.video-js div.vjs-control-bar{padding:0 1px;gap:1px!important}.video-js .vjs-control-bar .vjs-control{flex:0 0 auto!important}.video-js .vjs-control-bar .custom-remaining-time{flex:0 1 auto!important;min-width:fit-content!important}.video-js .vjs-spacer-control{flex:1 1 auto!important;flex-grow:1!important;min-width:4px!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:4px!important}.video-js .vjs-text-track-display{bottom:7em!important}.video-js .vjs-text-track-cue{font-size:1em!important;max-width:98%!important}.video-js .vjs-text-track-cue>div{padding:4px 8px!important;font-size:.85em!important;background:rgba(0,0,0,.85)!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:9em!important}.video-js.vjs-fullscreen .vjs-text-track-cue{font-size:1.2em!important;max-width:95%!important}.video-js.vjs-fullscreen .vjs-text-track-cue>div{padding:6px 10px!important;font-size:.9em!important}.vjs-button>.vjs-icon-placeholder:before{font-size:1.4em!important}}@media (min-width: 1025px){.video-js .vjs-text-track-display{bottom:6em!important}.video-js .vjs-autoplay-toggle{margin-right:0!important}.video-js .vjs-picture-in-picture-control{margin-left:12px!important}.video-js .vjs-text-track-cue{font-size:1.2em!important;max-width:90%!important}.video-js .vjs-text-track-cue>div{padding:8px 12px!important;font-size:1em!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:8em!important}}@media (min-width: 768px) and (max-width: 899px){.video-js .vjs-text-track-display{bottom:8em!important}.video-js .vjs-text-track-cue{font-size:1.15em!important;max-width:88%!important}.video-js .vjs-text-track-cue>div{padding:7px 11px!important;font-size:.95em!important}.video-js.vjs-fullscreen .vjs-text-track-display{bottom:9em!important}.video-js .vjs-control:hover:after,.video-js .vjs-control:focus:after,.video-js .vjs-control:active:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-play-control:hover:after,.video-js .vjs-mute-control:hover:after,.video-js .vjs-volume-panel:hover:after,.video-js .vjs-fullscreen-control:hover:after,.video-js .vjs-picture-in-picture-control:hover:after,.video-js .vjs-settings-control:hover:after,.video-js .vjs-chapters-control:hover:after,.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-next-video-control:hover:after,.video-js .vjs-remaining-time:hover:after{display:none!important;opacity:0!important;visibility:hidden!important}.video-js button.vjs-button:hover span.vjs-control-text{opacity:0!important;visibility:hidden!important}}.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.video-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.video-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:none}.video-js *,.video-js *:before,.video-js *:after{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-1-1{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid white;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.video-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(114.9141509434,132.7028301887,159.3858490566,.5)}.video-js .vjs-load-progress div{background:rgba(114.9141509434,132.7028301887,159.3858490566,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.video-js.vjs-touch-enabled:not(.vjs-scrubbing) .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid white}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.video-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-normalise-time-controls:not(.vjs-live) .vjs-time-control{display:flex}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}@supports not (inset: 10px){.video-js .vjs-text-track-display>div{top:0;right:0;bottom:0;left:0}}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,rgb(114.9141509434,132.7028301887,159.3858490566) 100%)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,rgb(114.9141509434,132.7028301887,159.3858490566) 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0%,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:#32323280;cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:#323232e6}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible){outline:none}#page-embed .video-js-root-embed .video-js video{width:100vw!important;height:100vh!important;object-fit:cover!important;border-radius:0!important}#page-embed .video-js-root-embed .video-js .vjs-poster{border-radius:0!important;width:100vw!important;height:100vh!important;object-fit:cover!important}#page-embed .video-js-root-embed .video-container{width:100vw;height:100vh;max-width:none;margin:0;padding:0;box-sizing:border-box;position:fixed;top:0;left:0;z-index:1000}#page-embed .video-js-root-embed .video-js.vjs-fluid{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important}#page-embed .video-js-root-embed .video-js{width:100vw!important;height:100vh!important;border-radius:0;position:relative}#page-embed .video-js-root-embed{position:fixed;top:0}#page-embed .video-js-root-embed .video-js .vjs-control-bar{position:fixed!important;bottom:0!important;left:0!important;right:0!important;width:100vw!important;z-index:1001!important;background:transparent!important;background-color:transparent!important;background-image:none!important;padding:0 12px!important;margin:0!important;border:none!important;box-shadow:none!important}#page-embed .video-js-root-embed .video-js .vjs-progress-control{position:fixed!important;bottom:48px!important;left:0!important;right:0!important;width:100vw!important;z-index:1000!important;margin:0!important;padding:0!important;border:none!important}#page-embed .video-js-root-embed .video-js:after{position:fixed!important;bottom:0!important;left:0!important;right:0!important;width:100vw!important;height:120px!important;z-index:999!important}@media (max-width: 768px){#page-embed .video-js-root-embed .video-js .vjs-control-bar{height:56px!important;padding:0 16px!important;margin:0!important;border:none!important;background:transparent!important;background-color:transparent!important;background-image:none!important}#page-embed .video-js-root-embed .video-js .vjs-progress-control{bottom:44px!important;margin:0!important;padding:0!important}#page-embed .video-js-root-embed .video-js .vjs-control-bar{padding-bottom:env(safe-area-inset-bottom,0)!important}}#page-embed .video-js-root-embed .video-js.vjs-user-active .vjs-control-bar,#page-embed .video-js-root-embed .video-js.vjs-paused .vjs-control-bar,#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-control-bar{opacity:1!important;visibility:visible!important;transform:translateY(0)!important}#page-embed .video-js-root-embed .video-js .vjs-control-bar{transition:opacity .3s ease,transform .3s ease!important}#page-embed .video-js-root-embed .video-js.vjs-user-inactive:not(.vjs-paused):not(.vjs-ended) .vjs-control-bar{opacity:0!important;transform:translateY(100%)!important}#page-embed .video-js-root-embed .video-js.vjs-user-inactive:not(.vjs-paused):not(.vjs-ended) .vjs-progress-control{opacity:0!important}#page-embed .video-js-root-embed .video-js .vjs-seek-indicator{position:fixed!important;top:50vh!important;left:50vw!important;transform:translate(-50%,-50%)!important;z-index:10000!important;pointer-events:none!important;display:none!important;align-items:center!important;justify-content:center!important;opacity:0!important;visibility:hidden!important;transition:opacity .2s ease-in-out!important;width:auto!important;height:auto!important;margin:0!important;padding:0!important}#page-embed .video-js-root-embed .video-js .vjs-big-play-button{position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;z-index:1000!important;pointer-events:auto!important;margin:0!important;padding:0!important}#page-embed .video-js-root-embed .video-js:not(.vjs-has-started) .vjs-control-bar{display:none!important;opacity:0!important;visibility:hidden!important}#page-embed .video-js-root-embed .video-js:not(.vjs-has-started) .vjs-progress-control{display:none!important;opacity:0!important;visibility:hidden!important}.video-js .vjs-captions-button,.video-js .vjs-subs-caps-button{display:none!important}.video-js .vjs-subtitles-button .vjs-menu,.video-js .vjs-subtitles-button .vjs-menu.vjs-lock-showing,.video-js .vjs-subtitles-button .vjs-menu.vjs-lock-showing .vjs-menu-content{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}.video-js .vjs-chapters-button .vjs-menu,.video-js .vjs-chapters-button .vjs-menu.vjs-lock-showing,.video-js .vjs-chapters-button .vjs-menu.vjs-lock-showing .vjs-menu-content{display:none!important}.video-js .vjs-chapters-button .vjs-menu{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}.video-js .vjs-subtitles-button{position:relative;cursor:pointer!important;pointer-events:auto!important}.video-js button.vjs-subtitles-button{cursor:pointer!important;pointer-events:auto!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important}.video-js button.vjs-subtitles-button:before{content:"";position:absolute;left:50%;transform:translate(-50%);bottom:6px;height:3px;background:#e1002d;border-radius:2px;width:0;padding:0;transition:none!important;animation:none!important;-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important}.video-js .vjs-subs-active button.vjs-subtitles-button:before{width:24px;transition:none!important;animation:none!important;-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important}.video-js button.vjs-subtitles-button{transition:none!important;animation:none!important;-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important}@media (max-width: 767px){.video-js .vjs-subtitles-button button.vjs-button{min-width:32px!important;min-height:32px!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.video-js .vjs-subs-active button.vjs-subtitles-button:before{width:20px}.video-js button.vjs-subtitles-button:before{bottom:2px}}.vjs-end-screen-overlay{position:absolute;top:0;left:0;width:100%;height:calc(100% - 100px);background:#000000;display:none;flex-direction:column;justify-content:center;align-items:center;padding:20px;box-sizing:border-box;z-index:9999;overflow:hidden}.video-js.vjs-ended .vjs-poster{display:none!important;opacity:0!important;visibility:hidden!important;z-index:-1!important;width:0!important;height:0!important}.video-js.vjs-ended video{display:none!important;opacity:0!important;visibility:hidden!important}.video-js.vjs-ended .vjs-end-screen-overlay{z-index:99999!important;display:flex!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-end-screen-overlay{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:99999!important;display:flex!important;padding-top:80px!important}.video-js.vjs-ended .vjs-control-bar{z-index:100000!important;position:absolute!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;display:flex!important;opacity:1!important;visibility:visible!important}.video-js.vjs-ended .vjs-progress-control{z-index:0!important;position:absolute!important;left:0!important;right:0!important;width:100%!important;display:block!important;opacity:1!important;visibility:visible!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-control-bar{position:fixed!important;bottom:0!important;left:0!important;right:0!important;width:100vw!important;z-index:100000!important;display:flex!important;opacity:1!important;visibility:visible!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-progress-control{position:fixed!important;bottom:48px!important;left:0!important;right:0!important;width:100vw!important;z-index:100000!important;display:block!important;opacity:1!important;visibility:visible!important}#page-embed .video-js-root-embed .video-js.vjs-ended .vjs-embed-info-overlay{z-index:100001!important;display:flex!important;opacity:1!important;visibility:visible!important}.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-ended .vjs-seek-indicator{display:none!important;opacity:0!important;visibility:hidden!important}.video-js.vjs-ended .vjs-control-bar{background:#000000!important;background-color:#000!important;background-image:none!important}.video-js.vjs-ended .vjs-progress-control{background:#000000!important;background-color:#000!important}.video-js.vjs-ended:after{background:#000000!important;background-image:none!important}.video-js.vjs-ended:before{background:#000000!important;background-image:none!important}.video-js.vjs-ended .vjs-loading-spinner,.video-js.vjs-ended .vjs-mouse-display{background:#000000!important;background-image:none!important}.video-js.vjs-ended .vjs-progress-holder{background:rgba(255,255,255,.3)!important}.video-js.vjs-ended .vjs-tech,.video-js.vjs-ended .vjs-poster-overlay{display:none!important;opacity:0!important;visibility:hidden!important}.vjs-related-videos-title{color:#fff;font-size:24px;line-height:24px;padding:0;margin:0;text-align:center;font-weight:700;flex-shrink:0}.vjs-related-videos-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:2px;width:100%;max-width:100%;margin:0;box-sizing:border-box;justify-items:stretch;align-items:stretch;justify-content:center;align-content:start;overflow:hidden;height:100%;flex:1;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-related-video-item{position:relative;cursor:pointer;overflow:hidden;transition:transform .2s ease,box-shadow .2s ease;background:#1a1a1a;border:1px solid #333;aspect-ratio:16/9;width:100%;min-height:100px;box-shadow:0 2px 8px #0003}.video-js.video-js-rounded-corners .vjs-related-video-item{border-radius:8px}.vjs-related-video-item:hover{transform:translateY(-2px);box-shadow:0 8px 25px #0000004d}.vjs-related-video-thumbnail{width:100%;height:100%;object-fit:cover;display:block;background:#1a1a1a;transition:transform .2s ease}.vjs-related-video-item:hover .vjs-related-video-thumbnail{transform:scale(1.02)}.vjs-related-video-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(transparent,rgba(0,0,0,.9));color:#fff;padding:12px;opacity:0;transition:opacity .3s ease;display:flex;flex-direction:column;justify-content:flex-start;height:100%}.vjs-related-video-item:hover .vjs-related-video-overlay{opacity:1}.vjs-related-video-title{font-size:14px;font-weight:700;line-height:1.3;color:#fff;margin-bottom:4px}.vjs-related-video-meta{display:flex;flex-direction:row;gap:8px;align-items:center}.vjs-related-video-author,.vjs-related-video-views{font-size:12px;color:#fff}.vjs-related-video-author:after{content:"•";margin-left:8px;color:#fff}.vjs-related-video-duration{position:absolute;bottom:8px;right:8px;background:rgba(0,0,0,.8);color:#fff;padding:2px 6px;font-size:11px;font-weight:700;opacity:0;transition:opacity .3s ease}.video-js.video-js-rounded-corners .vjs-related-video-duration{border-radius:2px}.vjs-related-video-item:hover .vjs-related-video-duration{opacity:1}.video-js.vjs-ended .vjs-control-bar{opacity:1!important;pointer-events:auto!important}.video-js.vjs-ended .vjs-control-bar .vjs-control,.video-js.vjs-ended .vjs-control-bar button{opacity:1!important;pointer-events:auto!important;cursor:pointer!important}.video-js.vjs-ended .vjs-control-bar .vjs-control.vjs-volume-control{opacity:0!important}.video-js.vjs-ended .vjs-control-bar .vjs-volume-panel.vjs-hover .vjs-volume-control{opacity:1!important}@media (max-width: 1200px){.vjs-related-videos-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{padding:15px;height:calc(100% - 95px)}}@media (max-width: 900px){.vjs-related-videos-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{padding:10px;height:calc(100% - 90px)}}@media (max-width: 600px){.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{padding:10px 5px 5px;height:calc(100% - 60px);justify-content:flex-start}.vjs-related-video-item{min-height:60px}}@media (max-width: 400px){.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);gap:2px;grid-row-gap:2px;grid-column-gap:2px;grid-auto-rows:1fr}.vjs-end-screen-overlay{height:calc(100% - 60px);padding:10px 5px 5px;justify-content:flex-start}.vjs-related-video-item{min-height:50px}}.video-js.vjs-ended .vjs-play-control{opacity:1!important;pointer-events:auto!important;cursor:pointer!important}.video-js.vjs-ended .vjs-progress-control,.video-js.vjs-ended .vjs-volume-panel{opacity:1!important;pointer-events:auto!important}@media (min-width: 1200px){.vjs-related-videos-grid{grid-template-columns:repeat(4,1fr);gap:20px;height:auto;max-height:none}}@media (max-width: 1199px){.vjs-related-video-item:nth-child(n+10){display:none}}@media (max-width: 1100px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:16px}}@media (min-width: 1024px) and (max-width: 1199px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:16px;height:auto;max-height:none}.vjs-related-video-item:nth-child(n+10){display:none}}@media (min-width: 900px) and (max-width: 1024px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:16px;height:auto;max-height:none}.vjs-related-video-item:nth-child(n+10){display:none}}@media (min-width: 768px) and (max-width: 899px){.vjs-related-videos-grid{grid-template-columns:repeat(3,1fr);gap:14px;height:auto;max-height:none}.vjs-end-screen-overlay{padding:20px 16px;justify-content:center}.vjs-related-video-item:nth-child(n+10){display:none}}@media (max-width: 767px){.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:16px!important;grid-gap:16px!important;max-height:70vh}.vjs-end-screen-overlay{padding:20px 12px;justify-content:flex-start}.vjs-related-video-item:nth-child(n+5){display:none}.vjs-related-video-thumbnail{height:100%}}@media (max-width: 574px){.vjs-related-video-item:nth-child(n+5){display:none}.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:14px!important;grid-gap:14px!important;max-height:65vh}.vjs-end-screen-overlay{padding:15px 10px;justify-content:flex-start}}@media (max-width: 439px){.vjs-related-video-item:nth-child(n+5){display:none}.vjs-related-videos-grid{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:12px!important;grid-gap:12px!important;max-height:60vh}.vjs-end-screen-overlay{padding:10px 8px;justify-content:flex-start}}@media (max-width: 480px){.vjs-related-video-thumbnail{height:100%}}.vjs-autoplay-countdown-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.85);display:none;flex-direction:column;justify-content:center;align-items:center;z-index:4;padding:20px;box-sizing:border-box;opacity:0;transition:opacity .2s ease-out}.autoplay-close-button{position:absolute;top:16px;right:16px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.3);border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;transition:all .2s ease;padding:0;z-index:10}.autoplay-close-button:hover{background:rgba(255,255,255,.2);border-color:#ffffff80;transform:scale(1.1)}.autoplay-close-button:active{transform:scale(.95)}.vjs-autoplay-countdown-overlay.autoplay-countdown-show{opacity:1}.autoplay-countdown-content{text-align:center;display:flex;flex-direction:column;align-items:center;gap:12px;max-width:350px;width:100%}.countdown-label{color:#fffc;font-size:14px;font-weight:400;margin:0;text-transform:uppercase;letter-spacing:1px}.next-video-title{color:#fff;font-size:18px;font-weight:600;margin:0 0 12px;line-height:1.3;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-align:center}.next-video-author{color:#ffffffb3;font-size:14px;font-weight:400;margin:-8px 0 0;line-height:1.2}.circular-countdown{position:relative;cursor:pointer;transition:transform .2s ease;margin:10px 0}.circular-countdown:hover{transform:scale(1.05)}.countdown-circle{filter:drop-shadow(0 4px 8px rgba(0,0,0,.3))}.countdown-progress{stroke-linecap:round;stroke-dasharray:282.74;stroke-dashoffset:282.74}.play-icon{cursor:pointer;transition:all .2s ease}.circular-countdown:hover .play-icon circle{fill:#fff}.circular-countdown:hover .play-icon path{fill:#000}.autoplay-cancel-button{background:transparent;border:1px solid rgba(255,255,255,.3);color:#ffffffe6;padding:10px 24px;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .2s ease;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;display:inline-block}.autoplay-cancel-button:hover{background:rgba(255,255,255,.1);border-color:#ffffff80;color:#fff;transform:translateY(-1px)}@media (min-width: 768px){.autoplay-close-button{display:flex!important}.autoplay-cancel-button{display:inline-block!important}}@media (max-width: 767px){.autoplay-close-button{display:flex!important;top:12px;right:12px;width:36px;height:36px}.autoplay-close-button svg{width:20px;height:20px}.autoplay-countdown-content{gap:8px;max-width:280px}.countdown-label{font-size:13px;margin:0}.next-video-title{font-size:16px;margin:0 0 8px}.next-video-author{font-size:13px;margin:-6px 0 0}.circular-countdown{margin:4px 0}.circular-countdown svg{width:80px;height:80px}.autoplay-cancel-button{display:none}}@media (max-width: 480px){.autoplay-close-button{display:flex!important;top:10px;right:10px;width:32px;height:32px}.autoplay-close-button svg{width:18px;height:18px}.autoplay-countdown-content{gap:6px;max-width:260px}.countdown-label{font-size:12px;margin:0}.next-video-title{font-size:15px;margin:0 0 6px}.next-video-author{font-size:12px;margin:-4px 0 0}.circular-countdown{margin:2px 0}.circular-countdown svg{width:70px;height:70px}.autoplay-cancel-button{display:none}}.vjs-embed-info-overlay{position:absolute!important;top:10px!important;left:10px!important;z-index:1000!important;display:flex!important;align-items:center!important;gap:10px!important;padding:8px 12px!important;max-width:calc(100% - 40px)!important;box-sizing:border-box!important;transition:opacity .3s ease-in-out!important;font-family:Arial,sans-serif!important}.vjs-embed-info-overlay .embed-avatar-container{flex-shrink:0!important;width:32px!important;height:32px!important;border-radius:50%!important;overflow:hidden!important;border:1px solid rgba(255,255,255,.2)!important}.vjs-embed-info-overlay .embed-avatar-container a{display:block!important;width:100%!important;height:100%!important;text-decoration:none!important}.vjs-embed-info-overlay .embed-avatar-container img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}.vjs-embed-info-overlay .embed-title-container{flex:1!important;min-width:0!important;overflow:hidden!important}.vjs-embed-info-overlay .embed-title-container a,.vjs-embed-info-overlay .embed-title-container span{color:#fff!important;text-decoration:none!important;font-size:14px!important;font-weight:500!important;line-height:1.3!important;display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;transition:color .2s ease!important}.vjs-embed-info-overlay .embed-title-container a:hover{color:#ccc!important}@media (max-width: 768px){.vjs-embed-info-overlay{top:8px!important;left:8px!important;padding:6px 10px!important;gap:8px!important;max-width:calc(100% - 32px)!important}.vjs-embed-info-overlay .embed-avatar-container{width:28px!important;height:28px!important}.vjs-embed-info-overlay .embed-title-container a,.vjs-embed-info-overlay .embed-title-container span{font-size:13px!important}}@media (max-width: 480px){.vjs-embed-info-overlay{top:6px!important;left:6px!important;padding:5px 8px!important;gap:6px!important;max-width:calc(100% - 24px)!important}.vjs-embed-info-overlay .embed-avatar-container{width:24px!important;height:24px!important}.vjs-embed-info-overlay .embed-title-container a,.vjs-embed-info-overlay .embed-title-container span{font-size:12px!important}}.vjs-chapter-markers-track{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.vjs-chapter-marker{position:absolute;top:0;width:2px;height:100%;background:rgba(255,193,7,.8);pointer-events:auto;cursor:pointer;transition:background .2s ease}.vjs-chapter-marker:hover{background:rgba(255,193,7,1);width:3px}.vjs-chapter-marker-tooltip{position:absolute;bottom:8px;left:50%;transform:translate(-50%);background:rgba(0,0,0,.8);color:#fff;padding:4px 8px;border-radius:4px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:1001}.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:1}.vjs-chapter-floating-tooltip{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif!important;line-height:1.4!important;animation:fadeIn .2s ease-in-out;text-align:center;width:160px!important;max-width:100%!important;height:auto}.chapter-image-sprite{width:166px!important;max-width:100%!important;height:96px;margin:0 auto 10px;border-radius:6px;border:3px solid #fff}.vjs-chapter-floating-tooltip .chapter-title{font-size:16px;margin:0 0 10px;font-weight:700;word-break:break-all;line-height:20px}.vjs-chapter-floating-tooltip .position-info,.vjs-chapter-floating-tooltip .chapter-info{font-size:15px;display:inline-block;margin:0 0 2px;line-height:normal;vertical-align:top;line-height:20px}@keyframes fadeIn{0%{opacity:0;transform:translate(-50%) translateY(5px)}to{opacity:1;transform:translate(-50%) translateY(0)}}@media (hover: none) and (pointer: coarse){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip,.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (min-width: 768px) and (max-width: 899px){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:0!important;visibility:hidden!important}.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 767px){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:0!important;visibility:hidden!important}.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 480px){.vjs-chapter-marker:hover .vjs-chapter-marker-tooltip{opacity:0!important;visibility:hidden!important}.vjs-chapter-floating-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}.vjs-sprite-preview-track{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.vjs-sprite-preview-tooltip{text-align:center;width:172px!important;max-width:100%!important;height:auto}.vjs-sprite-preview-tooltip .sprite-image-preview{width:166px!important;max-width:100%!important;height:96px;margin:0 auto;border-radius:6px;border:3px solid #fff}@media (hover: none) and (pointer: coarse){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (min-width: 768px) and (max-width: 899px){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 767px){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}@media (max-width: 480px){.vjs-sprite-preview-tooltip{display:none!important;opacity:0!important;visibility:hidden!important}}.vjs-next-video-control .vjs-icon-placeholder{width:1.2em;height:1.2em;display:flex;align-items:center;justify-content:center;margin:auto;display:none!important}.vjs-next-video-control .vjs-icon-placeholder svg{width:100%;height:100%;display:block}@media (max-width: 767px){.vjs-next-video-control svg{width:32px;height:32px}}@media (max-width: 399px){.vjs-next-video-control svg{width:28px;height:28px}}.vjs-autoplay-toggle .vjs-autoplay-icon svg{width:100%;height:100%;display:block}.video-js .vjs-autoplay-toggle{position:relative}.video-js .vjs-autoplay-toggle .vjs-hover-display,.video-js .vjs-autoplay-toggle .vjs-tooltip,.video-js .vjs-autoplay-toggle .vjs-tooltip-text{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}.video-js .vjs-autoplay-toggle:after{content:attr(title);position:absolute;bottom:100%;left:50%;transform:translate(-50%);background:rgba(0,0,0,.9);color:#fff;padding:6px 10px;border-radius:4px;font-size:12px;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;z-index:1000;margin-bottom:8px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;box-shadow:0 2px 8px #0000004d;border:1px solid rgba(255,255,255,.1)}.video-js .vjs-autoplay-toggle:hover:after,.video-js .vjs-autoplay-toggle:focus:after{opacity:1;visibility:visible}@media (max-width: 767px){.video-js .vjs-autoplay-toggle.touch-active:after{opacity:1;visibility:visible}.video-js .vjs-autoplay-toggle:after{font-size:11px;padding:5px 8px;margin-bottom:6px}}.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:14px!important;font-weight:500;line-height:1;display:flex;align-items:center;justify-content:center;height:100%;color:#fff;white-space:nowrap;padding:0 4px}.vjs-control-bar .custom-remaining-time{flex-shrink:1!important;min-width:0!important}@media (max-width: 767px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:13px!important;padding:0 3px;font-weight:600!important}}@media (max-width: 500px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:12px!important;padding:0 2px;letter-spacing:-.2px;font-weight:600!important}}@media (max-width: 480px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:11px!important;padding:0 2px;letter-spacing:-.2px;font-weight:600!important}}@media (max-width: 399px){.vjs-control-bar .custom-remaining-time .vjs-remaining-time-display{font-size:10px!important;padding:0 1px;letter-spacing:-.3px;font-weight:600!important}}.video-chapter{position:absolute;top:auto;bottom:60px;width:min(360px,calc(100% - 20px));border:1px solid rgba(255,255,255,.12);border-radius:8px;height:calc(100% - 80px);background:rgba(18,18,18,.96);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);overflow:hidden;box-shadow:0 12px 30px #00000073;right:10px}.chapter-head{padding:12px 8px 10px 16px;position:sticky;top:0;left:0;background:linear-gradient(180deg,rgba(28,28,28,.95),rgba(18,18,18,.95));border-bottom:1px solid rgba(255,255,255,.08);z-index:2}.playlist-title{display:flex;align-items:center;gap:10px}.chapter-title{width:auto;flex:1;min-width:0}.chapter-title h3{margin:0;padding:0}.chapter-title h3 a{color:#fff;font-size:18px;line-height:26px;font-weight:700;text-decoration:none;white-space:nowrap;text-overflow:ellipsis;height:28px;overflow:hidden;display:block}.chapter-title p{margin:4px 0 0;padding:0;color:#fff;font-size:12px;font-weight:400;line-height:15px}.chapter-title p a{color:#fff;font-size:12px;font-weight:400;line-height:15px;text-decoration:none}.chapter-close{width:40px;margin-left:auto;display:flex;align-items:center;justify-content:flex-end}.chapter-close button{background:transparent;color:#fff;border:0;width:40px;height:40px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:8px}.chapter-close button:hover{background:rgba(255,255,255,.1)}.settings-header{display:flex;align-items:center;justify-content:space-between;position:relative}.settings-close-btn{background:transparent;color:#fff;border:0;width:32px;height:32px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer}.settings-close-btn:hover{background:rgba(255,255,255,.1)}.playlist-action-menu{display:none;justify-content:space-between;gap:10px}.playlist-action-menu button{background:transparent;border:0;width:40px;height:40px;padding:0;display:flex;justify-content:center;align-items:center;border-radius:100px}.playlist-action-menu button:hover{background:rgba(0,0,0,.1)}.start-action{display:flex}.chapter-body{height:calc(100% - 80px);overflow:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain;scroll-behavior:smooth}.chapter-body ul{margin:0;padding:0}.playlist-items a{padding:12px;display:flex;align-items:center;text-decoration:none;gap:12px;width:100%;box-sizing:border-box;color:#fff}.playlist-items a:hover{background:rgba(255,255,255,.06)}.playlist-items.selected a{background:rgba(255,255,255,.14)}.playlist-drag-handle{width:24px;display:flex;justify-content:center;color:#e0e0e0;font-size:12px}.thumbnail-meta{flex:1;min-width:0;padding:0}.thumbnail-meta h4{margin:0 2px 4px 0;font-size:14px;line-height:20px;font-weight:600;overflow:hidden;text-overflow:ellipsis;color:#fff;white-space:normal;max-height:40px;-webkit-line-clamp:2;line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical}.thumbnail-meta .meta-sub{display:flex;gap:8px;align-items:center}.thumbnail-meta .meta-sub .meta-dynamic{color:#bdbdbd;font-size:12px;line-height:18px}.thumbnail-action button{border:0;background:transparent;color:#fff;opacity:0}.playlist-items a:hover .thumbnail-action button{opacity:1}.chapter-body::-webkit-scrollbar{width:10px}.chapter-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:8px}.chapter-body::-webkit-scrollbar-track{background:transparent}@media (max-width: 767px){.chapter-body{-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain;height:calc(100% - 70px)}.chapter-body::-webkit-scrollbar{width:0px}div.chapter-close button{width:30px;height:30px}.video-js-root-main .video-js.video-js-rounded-corners .custom-chapters-overlay{border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important}.custom-chapters-overlay .video-chapter{right:10px;left:auto;width:100%;max-width:280px;height:calc(100% - 40px);max-height:calc(100% - 40px);overflow:hidden;bottom:40px}.chapter-head{padding:10px 15px}.chapter-title h3 a{font-size:15px!important;line-height:20px!important;height:20px!important}.chapter-title p{font-size:11px!important;line-height:14px!important}.playlist-items a{padding:10px 16px!important;min-height:58px!important}.thumbnail-meta h4{font-size:13px!important;line-height:18px!important}.thumbnail-meta .meta-sub .meta-dynamic{font-size:11px!important;line-height:16px!important}}.vjs-settings-button{width:3em;height:3em;display:flex;align-items:center;justify-content:center;padding:0;margin:0}.vjs-icon-cog1{font-size:30px!important;position:relative;top:-8px!important;display:flex;align-items:center;justify-content:center;width:100%;height:100%;line-height:1}.custom-settings-overlay{border:0;position:absolute;bottom:60px;right:20px;width:280px;height:350px;background:rgba(28,28,28,.95);color:#fff;border-radius:7px;box-shadow:0 4px 12px #00000080;display:none;z-index:9999;font-size:14px;overflow:auto}.settings-header{padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.1);font-weight:700}.settings-item{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid rgba(255,255,255,.1);transition:background .2s ease;gap:10px}.settings-item .settings-left span{display:flex}.custom-settings-overlay .settings-left span.vjs-icon-placeholder{transform:inherit!important}.settings-item:last-child{border-bottom:none}.settings-item:hover{background:rgba(255,255,255,.05)}.speed-submenu,.quality-submenu,.subtitles-submenu{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(28,28,28,.95);display:none;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain}.subtitle-option{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s ease}.subtitle-option:hover{background:rgba(255,255,255,.05)}.subtitle-option.active{background:rgba(255,255,255,.1)}.submenu-header{padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.1);display:flex;align-items:center;cursor:pointer;position:sticky;top:0;background:rgba(28,28,28,.95);z-index:1}.submenu-header:hover{background:rgba(28,28,28,1)}.speed-option{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s ease}.speed-option:hover{background:rgba(255,255,255,.05)}.speed-option.active{background:rgba(255,255,255,.1)}.quality-option{padding:12px 16px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s ease}.quality-option:hover{background:rgba(255,255,255,.05)}.quality-option.active{background:rgba(255,255,255,.1)}.settings-left{display:inline-flex;align-items:center;gap:8px}.settings-right{display:inline-flex;align-items:center;text-align:right}sup.hd-badge{font-size:10px;line-height:1;margin-left:6px;background:#e53935;color:#fff;padding:1px 4px;border-radius:3px}.video-js .vjs-settings-button{cursor:pointer!important;pointer-events:auto!important;position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;min-width:32px!important;height:32px!important;padding:0!important;border:none!important;background:transparent!important;color:inherit!important;font-size:inherit!important;line-height:inherit!important;text-align:center!important;vertical-align:middle!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.video-js .vjs-settings-button:hover{background:none!important}.video-js .vjs-settings-button:focus{outline:none!important}.video-js .vjs-settings-button .vjs-icon-cog{font-size:18px!important;width:18px!important;height:18px!important;display:flex!important;align-items:center!important;justify-content:center!important}.video-js .vjs-control-bar .settings-item-svg{display:flex}.video-js .vjs-control-bar .settings-item-svg svg{width:auto!important;height:auto!important;transform:inherit!important}.vjs-settings-button svg{transition:ease-in-out .3s}.vjs-settings-button.settings-clicked svg{transform:rotate(30deg)}@media (max-width: 1024px){body div.custom-settings-overlay{height:calc(100% - 40px);max-height:300px}}@media (max-width: 767px){.video-js .vjs-settings-button{min-width:44px!important;height:44px!important;padding:0!important;margin:0 2px!important;display:flex!important;align-items:center!important;justify-content:center!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;cursor:pointer!important;z-index:1000!important;pointer-events:auto!important;position:relative!important}.video-js .vjs-settings-button .vjs-icon-cog{font-size:20px!important;width:20px!important;height:20px!important;display:flex!important;align-items:center!important;justify-content:center!important}.video-js .vjs-control-bar .vjs-button{touch-action:manipulation!important;-webkit-tap-highlight-color:transparent!important;-webkit-touch-callout:none!important;-webkit-user-select:none!important;user-select:none!important}.custom-settings-overlay .settings-item{padding:6px 16px;font-size:15px;touch-action:manipulation;line-height:18px}.custom-settings-overlay .settings-header{padding:10px 16px;font-size:18px;line-height:20px}body div.custom-settings-overlay{bottom:40px}}@media (max-width: 480px){.video-js .vjs-settings-button .vjs-icon-cog{font-size:22px!important;width:22px!important;height:22px!important}}.vjs-seek-indicator{position:absolute!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;z-index:9999!important;pointer-events:none!important;display:none!important;align-items:center!important;justify-content:center!important;opacity:0!important;visibility:hidden!important;transition:opacity .2s ease-in-out!important}.vjs-seek-indicator-content{background:transparent!important;flex-direction:column!important;align-items:center!important;justify-content:center!important}.vjs-seek-indicator-icon{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;margin-bottom:4px!important}.seek-icon-container{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;animation:seekPulse .3s ease-out!important}.youtube-seek-container{display:flex!important;align-items:center!important;justify-content:center!important;animation:youtubeSeekPulse .3s ease-out!important}.youtube-seek-circle{width:80px!important;height:80px!important;border-radius:50%!important;-webkit-border-radius:50%!important;-moz-border-radius:50%!important;background:rgba(0,0,0,.8)!important;backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;padding:0!important;box-shadow:0 4px 20px #0000004d!important;border:1px solid rgba(255,255,255,.15)!important;box-sizing:border-box!important;overflow:hidden!important}@media (max-width: 768px){.vjs-seek-indicator{top:calc(50% - 30px)!important}.youtube-seek-circle{width:60px!important;height:60px!important}.youtube-seek-icon svg{width:24px!important;height:24px!important}}@media (max-width: 480px){.vjs-seek-indicator{top:calc(50% - 40px)!important}.youtube-seek-circle{width:50px!important;height:50px!important}.youtube-seek-icon svg{width:20px!important;height:20px!important}}.youtube-seek-icon{display:flex!important;align-items:center!important;justify-content:center!important;margin-bottom:4px!important}.youtube-seek-icon svg{filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))!important}.youtube-seek-time{color:#fff!important;font-size:10px!important;font-weight:500!important;text-align:center!important;line-height:1.2!important;opacity:.9!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important}@keyframes youtubeSeekPulse{0%{transform:scale(.7);opacity:.5}50%{transform:scale(1.05);opacity:.9}to{transform:scale(1);opacity:1}}.seek-seconds{color:#fff!important;font-size:16px!important;font-weight:700!important;text-shadow:0 2px 4px rgba(0,0,0,.7)!important;line-height:1!important}.vjs-seek-indicator-text{color:#fff!important;font-size:16px!important;font-weight:500!important;text-align:center!important;text-shadow:0 1px 2px rgba(0,0,0,.8)!important} diff --git a/static/video_js/video-js.js b/static/video_js/video-js.js index de59ab8b..0abfbfac 100644 --- a/static/video_js/video-js.js +++ b/static/video_js/video-js.js @@ -148,7 +148,7 @@ Please update the following component: %s`,d),lC=!0}return(Mt&vn)!==ts?(d=u.pend See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function ph(t,n){if(hf)return!1;if(n===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",ee),!1;t.length!==n.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant. Previous: %s -Incoming: %s`,ee,"["+n.join(", ")+"]","["+t.join(", ")+"]");for(var a=0;a"))),n.memoizedState=null,n.updateQueue=null,n.lanes=0,te.H=t!==null&&t.memoizedState!==null?Yv:xs!==null?hC:$v,Al=m=(n.mode&an)!==$t;var _=Qv(a,u,d);if(Al=!1,Oc&&(_=gh(n,a,u,d)),m){He(!0);try{_=gh(n,a,u,d)}finally{He(!1)}}return um(t,n),_}function um(t,n){n._debugHookTypes=xs,n.dependencies===null?va!==null&&(n.dependencies={lanes:0,firstContext:null,_debugThenableState:va}):n.dependencies._debugThenableState=va,te.H=hg;var a=zt!==null&&zt.next!==null;if(po=0,xs=ee=vi=zt=Ke=null,ba=-1,t!==null&&(t.flags&65011712)!==(n.flags&65011712)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),cg=!1,df=0,va=null,a)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");t===null||ji||(t=t.dependencies,t!==null&&Qn(t)&&(ji=!0)),lg?(lg=!1,t=!0):t=!1,t&&(n=fe(n)||"Unknown",cC.has(n)||Vv.has(n)||(cC.add(n),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function gh(t,n,a,u){Ke=t;var d=0;do{if(Oc&&(va=null),df=0,Oc=!1,d>=_R)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(d+=1,hf=!1,vi=zt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}ba=-1,te.H=fC,m=Qv(n,a,u)}while(Oc);return m}function vr(){var t=te.H,n=t.useState()[0];return n=typeof n.then=="function"?Ga(n):n,t=t.useState()[0],(zt!==null?zt.memoizedState:null)!==t&&(Ke.flags|=1024),n}function yh(){var t=dg!==0;return dg=0,t}function Th(t,n,a){n.updateQueue=t.updateQueue,n.flags=(n.mode&Hs)!==$t?n.flags&-402655237:n.flags&-2053,t.lanes&=~a}function vh(t){if(cg){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}cg=!1}po=0,xs=vi=zt=Ke=null,ba=-1,ee=null,Oc=!1,df=dg=0,va=null}function hn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vi===null?Ke.memoizedState=vi=t:vi=vi.next=t,vi}function _t(){if(zt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=zt.next;var n=vi===null?Ke.memoizedState:vi.next;if(n!==null)vi=n,zt=t;else{if(t===null)throw Ke.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");zt=t,t={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},vi===null?Ke.memoizedState=vi=t:vi=vi.next=t}return vi}function pl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ga(t){var n=df;return df+=1,va===null&&(va=ah()),t=lh(va,t,n),n=Ke,(vi===null?n.memoizedState:vi.next)===null&&(n=n.alternate,te.H=n!==null&&n.memoizedState!==null?Yv:$v),t}function Gn(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ga(t);if(t.$$typeof===Cr)return Vt(t)}throw Error("An unsupported type was passed to use(): "+String(t))}function ds(t){var n=null,a=Ke.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var u=Ke.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=pl(),Ke.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0||hf)for(a=n.data[n.index]=Array(t),u=0;u"))),n.memoizedState=null,n.updateQueue=null,n.lanes=0,te.H=t!==null&&t.memoizedState!==null?Yv:xs!==null?hC:$v,Al=m=(n.mode&an)!==$t;var _=Qv(a,u,d);if(Al=!1,Oc&&(_=gh(n,a,u,d)),m){He(!0);try{_=gh(n,a,u,d)}finally{He(!1)}}return um(t,n),_}function um(t,n){n._debugHookTypes=xs,n.dependencies===null?va!==null&&(n.dependencies={lanes:0,firstContext:null,_debugThenableState:va}):n.dependencies._debugThenableState=va,te.H=hg;var a=zt!==null&&zt.next!==null;if(po=0,xs=ee=vi=zt=Ke=null,ba=-1,t!==null&&(t.flags&65011712)!==(n.flags&65011712)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),cg=!1,df=0,va=null,a)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");t===null||ji||(t=t.dependencies,t!==null&&Qn(t)&&(ji=!0)),lg?(lg=!1,t=!0):t=!1,t&&(n=fe(n)||"Unknown",cC.has(n)||Vv.has(n)||(cC.add(n),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function gh(t,n,a,u){Ke=t;var d=0;do{if(Oc&&(va=null),df=0,Oc=!1,d>=_R)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(d+=1,hf=!1,vi=zt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}ba=-1,te.H=fC,m=Qv(n,a,u)}while(Oc);return m}function vr(){var t=te.H,n=t.useState()[0];return n=typeof n.then=="function"?Ga(n):n,t=t.useState()[0],(zt!==null?zt.memoizedState:null)!==t&&(Ke.flags|=1024),n}function yh(){var t=dg!==0;return dg=0,t}function Th(t,n,a){n.updateQueue=t.updateQueue,n.flags=(n.mode&Hs)!==$t?n.flags&-402655237:n.flags&-2053,t.lanes&=~a}function vh(t){if(cg){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}cg=!1}po=0,xs=vi=zt=Ke=null,ba=-1,ee=null,Oc=!1,df=dg=0,va=null}function hn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vi===null?Ke.memoizedState=vi=t:vi=vi.next=t,vi}function _t(){if(zt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=zt.next;var n=vi===null?Ke.memoizedState:vi.next;if(n!==null)vi=n,zt=t;else{if(t===null)throw Ke.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");zt=t,t={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},vi===null?Ke.memoizedState=vi=t:vi=vi.next=t}return vi}function pl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ga(t){var n=df;return df+=1,va===null&&(va=ah()),t=lh(va,t,n),n=Ke,(vi===null?n.memoizedState:vi.next)===null&&(n=n.alternate,te.H=n!==null&&n.memoizedState!==null?Yv:$v),t}function Gn(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ga(t);if(t.$$typeof===Cr)return Vt(t)}throw Error("An unsupported type was passed to use(): "+String(t))}function ds(t){var n=null,a=Ke.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var u=Ke.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=pl(),Ke.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0||hf)for(a=n.data[n.index]=Array(t),u=0;u from render. Or maybe you meant to call this function rather than return it. @@ -466,9 +466,9 @@ See https://github.com/videojs/video.js/issues/2617 for more info. `)}}A0(1,F),F.VERSION=_0,F.options=Dt.prototype.options_,F.getPlayers=()=>Dt.players,F.getPlayer=s=>{const e=Dt.players;let i;if(typeof s=="string"){const r=uS(s),o=e[r];if(o)return o;i=La("#"+r)}else i=s;if(au(i)){const{player:r,playerId:o}=i;if(r||e[o])return r||e[o]}},F.getAllPlayers=()=>Object.keys(Dt.players).map(s=>Dt.players[s]).filter(Boolean),F.players=Dt.players,F.getComponent=ce.getComponent,F.registerComponent=(s,e)=>(st.isTech(e)&&ct.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),ce.registerComponent.call(ce,s,e)),F.getTech=st.getTech,F.registerTech=st.registerTech,F.use=mk,Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(F.middleware,"TERMINATOR",{value:_p,writeable:!1,enumerable:!0}),F.browser=N_,F.obj=GN,F.mergeOptions=Ns(9,"videojs.mergeOptions","videojs.obj.merge",It),F.defineLazyProperty=Ns(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Jf),F.bind=Ns(9,"videojs.bind","native Function.prototype.bind",Ft),F.registerPlugin=Mn.registerPlugin,F.deregisterPlugin=Mn.deregisterPlugin,F.plugin=(s,e)=>(ct.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Mn.registerPlugin(s,e)),F.getPlugins=Mn.getPlugins,F.getPlugin=Mn.getPlugin,F.getPluginVersion=Mn.getPluginVersion,F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=It(F.options.languages,{[s]:e}),F.options.languages[s]},F.log=ct,F.createLogger=S_,F.time=lk,F.createTimeRange=Ns(9,"videojs.createTimeRange","videojs.time.createTimeRanges",ws),F.createTimeRanges=Ns(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",ws),F.formatTime=Ns(9,"videojs.formatTime","videojs.time.formatTime",Oo),F.setFormatTime=Ns(9,"videojs.setFormatTime","videojs.time.setFormatTime",i2),F.resetFormatTime=Ns(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",n2),F.parseUrl=Ns(9,"videojs.parseUrl","videojs.url.parseUrl",V0),F.isCrossOrigin=Ns(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",vp),F.EventTarget=qn,F.any=k0,F.on=Bn,F.one=mp,F.off=Ji,F.trigger=cu,F.xhr=Vb,F.TrackList=Io,F.TextTrack=Md,F.TextTrackList=F0,F.AudioTrack=d2,F.AudioTrackList=r2,F.VideoTrack=h2,F.VideoTrackList=a2,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return ct.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),V_[s].apply(null,arguments)}}),F.computedStyle=Ns(9,"videojs.computedStyle","videojs.dom.computedStyle",uu),F.dom=V_,F.fn=ik,F.num=jk,F.str=ak,F.url=fk,F.Error=oO;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class lO{constructor(e){let i=this;return i.id=e.id,i.label=i.id,i.width=e.width,i.height=e.height,i.bitrate=e.bandwidth,i.frameRate=e.frameRate,i.enabled_=e.enabled,Object.defineProperty(i,"enabled",{get(){return i.enabled_()},set(r){i.enabled_(r)}}),i}}class kp extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let i=this.getQualityLevelById(e.id);if(i)return i;const r=this.levels_.length;return i=new lO(e),""+r in this||Object.defineProperty(this,r,{get(){return this.levels_[r]}}),this.levels_.push(i),this.trigger({qualityLevel:i,type:"addqualitylevel"}),i}removeQualityLevel(e){let i=null;for(let r=0,o=this.length;rr&&this.selectedIndex_--;break}return i&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),i}getQualityLevelById(e){for(let i=0,r=this.length;ir,s.qualityLevels.VERSION=cS,r},dS=function(s){return uO(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",dS),dS.VERSION=cS;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const Dn=jf,Op=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,ls=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function Ct(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function Ni(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function cO(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: `;for(let i=0;i ${o}. Duration (${o-r}) `}return e}const ir=1/30,nr=ir*3,hS=function(s,e){const i=[];let r;if(s&&s.length)for(r=0;r=e})},Ip=function(s,e){return hS(s,function(i){return i-ir>=e})},dO=function(s){if(s.length<2)return Ni();const e=[];for(let i=1;i{const e=[];if(!s||!s.length)return"";for(let i=0;i "+s.end(i));return e.join(", ")},fO=function(s,e,i=1){return((s.length?s.end(s.length-1):0)-e)/i},zo=s=>{const e=[];for(let i=0;il)){if(e>o&&e<=l){i+=l-e;continue}i+=l-o}}return i},Ty=(s,e)=>{if(!e.preload)return e.duration;let i=0;return(e.parts||[]).forEach(function(r){i+=r.duration}),(e.preloadHints||[]).forEach(function(r){r.type==="PART"&&(i+=s.partTargetDuration)}),i},vy=s=>(s.segments||[]).reduce((e,i,r)=>(i.parts?i.parts.forEach(function(o,l){e.push({duration:o.duration,segmentIndex:r,partIndex:l,part:o,segment:i})}):e.push({duration:i.duration,segmentIndex:r,partIndex:null,segment:i,part:null}),e),[]),pS=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},mS=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:i}=s;let r=(i||[]).reduce((o,l)=>o+(l.type==="PART"?1:0),0);return r+=e&&e.length?e.length:0,r},gS=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const i=pS(e).length>0;return i&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:i&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},mO=function(s,e){let i=0,r=e-s.mediaSequence,o=s.segments[r];if(o){if(typeof o.start<"u")return{result:o.start,precise:!0};if(typeof o.end<"u")return{result:o.end-o.duration,precise:!0}}for(;r--;){if(o=s.segments[r],typeof o.end<"u")return{result:i+o.end,precise:!0};if(i+=Ty(s,o),typeof o.start<"u")return{result:i+o.start,precise:!0}}return{result:i,precise:!1}},gO=function(s,e){let i=0,r,o=e-s.mediaSequence;for(;o"u"&&(e=s.mediaSequence+s.segments.length),e"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return z.Infinity}return yS(s,e,i)},Nd=function({defaultDuration:s,durationList:e,startIndex:i,endIndex:r}){let o=0;if(i>r&&([i,r]=[r,i]),i<0){for(let l=i;l0)for(let v=p-1;v>=0;v--){const S=f[v];if(c+=S.duration,l){if(c<0)continue}else if(c+ir<=0)continue;return{partIndex:S.partIndex,segmentIndex:S.segmentIndex,startTime:o-Nd({defaultDuration:s.targetDuration,durationList:f,startIndex:p,endIndex:v})}}return{partIndex:f[0]&&f[0].partIndex||null,segmentIndex:f[0]&&f[0].segmentIndex||0,startTime:e}}if(p<0){for(let v=p;v<0;v++)if(c-=s.targetDuration,c<0)return{partIndex:f[0]&&f[0].partIndex||null,segmentIndex:f[0]&&f[0].segmentIndex||0,startTime:e};p=0}for(let v=p;vir,D=c===0,k=x&&c+ir>=0;if(!((D||k)&&v!==f.length-1)){if(l){if(c>0)continue}else if(c-ir>=0)continue;return{partIndex:S.partIndex,segmentIndex:S.segmentIndex,startTime:o+Nd({defaultDuration:s.targetDuration,durationList:f,startIndex:p,endIndex:v})}}}return{segmentIndex:f[f.length-1].segmentIndex,partIndex:f[f.length-1].partIndex,startTime:e}},bS=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},by=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Lp=function(s){const e=bS(s);return!s.disabled&&!e},vO=function(s){return s.disabled},bO=function(s){for(let e=0;e{if(s.playlists.length===1)return!0;const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(r=>Lp(r)?(r.attributes.BANDWIDTH||0)!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),SS=function(s,e){const i=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let r=!1;for(const o in i){for(const l in i[o])if(r=e(i[o][l]),r)break;if(r)break}return!!r},kd=s=>{if(!s||!s.playlists||!s.playlists.length)return SS(s,i=>i.playlists&&i.playlists.length||i.uri);for(let e=0;es1(l))||SS(s,l=>Sy(i,l))))return!1}return!0};var Cn={liveEdgeDelay:gS,duration:TS,seekable:yO,getMediaInfoForTime:TO,isEnabled:Lp,isDisabled:vO,isExcluded:bS,isIncompatible:by,playlistEnd:vS,isAes:bO,hasAttribute:_S,estimateSegmentRequestTime:_O,isLowestEnabledRendition:_y,isAudioOnly:kd,playlistMatch:Sy,segmentDurationWithParts:Ty};const{log:xS}=F,vu=(s,e)=>`${s}-${e}`,ES=(s,e,i)=>`placeholder-uri-${s}-${e}-${i}`,SO=({onwarn:s,oninfo:e,manifestString:i,customTagParsers:r=[],customTagMappers:o=[],llhls:l})=>{const c=new Hw;s&&c.on("warn",s),e&&c.on("info",e),r.forEach(v=>c.addParser(v)),o.forEach(v=>c.addTagMapper(v)),c.push(i),c.end();const f=c.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(v){f.hasOwnProperty(v)&&delete f[v]}),f.segments&&f.segments.forEach(function(v){["parts","preloadHints"].forEach(function(S){v.hasOwnProperty(S)&&delete v[S]})})),!f.targetDuration){let v=10;f.segments&&f.segments.length&&(v=f.segments.reduce((S,x)=>Math.max(S,x.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${v}`}),f.targetDuration=v}const p=pS(f);if(p.length&&!f.partTargetDuration){const v=p.reduce((S,x)=>Math.max(S,x.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${v}`}),xS.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),f.partTargetDuration=v}return f},bu=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(s.mediaGroups[i])for(const r in s.mediaGroups[i])for(const o in s.mediaGroups[i][r]){const l=s.mediaGroups[i][r][o];e(l,i,r,o)}})},MS=({playlist:s,uri:e,id:i})=>{s.id=i,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},xO=s=>{let e=s.playlists.length;for(;e--;){const i=s.playlists[e];MS({playlist:i,id:vu(e,i.uri)}),i.resolvedUri=Dn(s.uri,i.uri),s.playlists[i.id]=i,s.playlists[i.uri]=i,i.attributes.BANDWIDTH||xS.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},EO=s=>{bu(s,e=>{e.uri&&(e.resolvedUri=Dn(s.uri,e.uri))})},MO=(s,e)=>{const i=vu(0,e),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:z.location.href,resolvedUri:z.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[e]=r.playlists[0],r},DS=(s,e,i=ES)=>{s.uri=e;for(let o=0;o{if(!o.playlists||!o.playlists.length){if(r&&l==="AUDIO"&&!o.uri)for(let p=0;p(o.set(l.id,l),o),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},i=[];this.pendingDateRanges_.forEach((r,o)=>{if(!this.processedDateRanges_.has(o)&&(r.startTime=r.startDate.getTime()/1e3-this.offset_,r.processDateRange=()=>this.processDateRange(r),i.push(r),!!r.class))if(e[r.class]){const l=e[r.class].push(r);r.classListIndex=l-1}else e[r.class]=[r],r.classListIndex=0});for(const r of i){const o=e[r.class]||[];r.endDate?r.endTime=r.endDate.getTime()/1e3-this.offset_:r.endOnNext&&o[r.classListIndex+1]?r.endTime=o[r.classListIndex+1].startTime:r.duration?r.endTime=r.startTime+r.duration:r.plannedDuration?r.endTime=r.startTime+r.plannedDuration:r.endTime=r.startTime}return i}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((r,o)=>{r.startDate.getTime(){const o=e.status<200||e.status>299,l=e.status>=400&&e.status<=499,c={uri:e.uri,requestType:s},f=o&&!l||r;if(i&&l)c.error=ei({},i),c.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)c.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)c.erroType=F.Error.NetworkRequestTimeout;else if(f){const p=r?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;c.errorType=p,c.status=e.status,c.headers=e.headers}return c},DO=ls("CodecUtils"),wS=function(s){const e=s.attributes||{};if(e.CODECS)return Gs(e.CODECS)},NS=(s,e)=>{const i=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&i.AUDIO&&s.mediaGroups.AUDIO[i.AUDIO]},CO=(s,e)=>{if(!NS(s,e))return!0;const i=e.attributes||{},r=s.mediaGroups.AUDIO[i.AUDIO];for(const o in r)if(!r[o].uri&&!r[o].playlists)return!0;return!1},Od=function(s){const e={};return s.forEach(({mediaType:i,type:r,details:o})=>{e[i]=e[i]||[],e[i].push(n1(`${r}${o}`))}),Object.keys(e).forEach(function(i){if(e[i].length>1){DO(`multiple ${i} codecs found as attributes: ${e[i].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[i]=null;return}e[i]=e[i][0]}),e},kS=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},Id=function(s,e){const i=e.attributes||{},r=Od(wS(e)||[]);if(NS(s,e)&&!r.audio&&!CO(s,e)){const o=Od($w(s,i.AUDIO)||[]);o.audio&&(r.audio=o.audio)}return r},{EventTarget:AO}=F,wO=(s,e)=>{if(e.endList||!e.serverControl)return s;const i={};if(e.serverControl.canBlockReload){const{preloadSegment:r}=e;let o=e.mediaSequence+e.segments.length;if(r){const l=r.parts||[],c=mS(e)-1;c>-1&&c!==l.length-1&&(i._HLS_part=c),(c>-1||l.length)&&o--}i._HLS_msn=o}if(e.serverControl&&e.serverControl.canSkipUntil&&(i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const r=new z.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(o){i.hasOwnProperty(o)&&r.searchParams.set(o,i[o])}),s=r.toString()}return s},NO=(s,e)=>{if(!s)return e;const i=Ct(s,e);if(s.preloadHints&&!e.preloadHints&&delete i.preloadHints,s.parts&&!e.parts)delete i.parts;else if(s.parts&&e.parts)for(let r=0;r{const r=s.slice(),o=e.slice();i=i||0;const l=[];let c;for(let f=0;f{!s.resolvedUri&&s.uri&&(s.resolvedUri=Dn(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=Dn(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=Dn(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=Dn(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(i=>{i.resolvedUri||(i.resolvedUri=Dn(e,i.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(i=>{i.resolvedUri||(i.resolvedUri=Dn(e,i.uri))})},IS=function(s){const e=s.segments||[],i=s.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let r=0;rs===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,xy=(s,e,i=LS)=>{const r=Ct(s,{}),o=r.playlists[e.id];if(!o||i(o,e))return null;e.segments=IS(e);const l=Ct(o,e);if(l.preloadSegment&&!e.preloadSegment&&delete l.preloadSegment,o.segments){if(e.skip){e.segments=e.segments||[];for(let c=0;c{OS(c,l.resolvedUri)});for(let c=0;c{if(c.playlists)for(let S=0;S{const i=s.segments||[],r=i[i.length-1],o=r&&r.parts&&r.parts[r.parts.length-1],l=o&&o.duration||r&&r.duration;return e&&l?l*1e3:(s.partTargetDuration||s.targetDuration||10)*500},RS=(s,e,i)=>{if(!s)return;const r=[];return s.forEach(o=>{if(!o.attributes)return;const{BANDWIDTH:l,RESOLUTION:c,CODECS:f}=o.attributes;r.push({id:o.id,bandwidth:l,resolution:c,codecs:f})}),{type:e,isLive:i,renditions:r}};class _u extends AO{constructor(e,i,r={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=ls("PlaylistLoader");const{withCredentials:o=!1}=r;this.src=e,this.vhs_=i,this.withCredentials=o,this.addDateRangesToTextTrack_=r.addDateRangesToTextTrack;const l=i.options_;this.customTagParsers=l&&l.customTagParsers||[],this.customTagMappers=l&&l.customTagMappers||[],this.llhls=l&&l.llhls,this.dateRangesStorage_=new CS,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const i=this.dateRangesStorage_.getDateRangesToProcess();!i.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(i)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let i=Dn(this.main.uri,e.uri);this.llhls&&(i=wO(i,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials,requestType:"hls-playlist"},(r,o)=>{if(this.request){if(r)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,i,r){const{uri:o,id:l}=i;this.request=null,r&&(this.state=r),this.error={playlist:this.main.playlists[l],status:e.status,message:`HLS playlist request error at URL: ${o}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Uo({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:i}){try{const r=SO({onwarn:({message:o})=>this.logger_(`m3u8-parser warn for ${e}: ${o}`),oninfo:({message:o})=>this.logger_(`m3u8-parser info for ${e}: ${o}`),manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!r.playlists||!r.playlists.length||this.excludeAudioOnlyVariants(r.playlists),r}catch(r){this.error=r,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:r}}}excludeAudioOnlyVariants(e){const i=r=>{const o=r.attributes||{},{width:l,height:c}=o.RESOLUTION||{};if(l&&c)return!0;const f=wS(r)||[];return!!Od(f).video};e.some(i)&&e.forEach(r=>{i(r)||(r.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:i,url:r,id:o}){this.request=null,this.state="HAVE_METADATA";const l={playlistInfo:{type:"media",uri:r}};this.trigger({type:"playlistparsestart",metadata:l});const c=i||this.parseManifest_({url:r,manifestString:e});c.lastRequest=Date.now(),MS({playlist:c,uri:r,id:o});const f=xy(this.main,c);this.targetDuration=c.partTargetDuration||c.targetDuration,this.pendingMedia_=null,f?(this.main=f,this.media_=this.main.playlists[o]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ey(this.media(),!!f)),l.parsedPlaylist=RS(this.main.playlists,l.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:l}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),z.clearTimeout(this.mediaUpdateTimeout),z.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new CS,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,i){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(z.clearTimeout(this.finalRenditionTimeout),i){const f=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=z.setTimeout(this.media.bind(this,e,!1),f);return}const r=this.state,o=!this.media_||e.id!==this.media_.id,l=this.main.playlists[e.id];if(l&&l.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,o&&(this.trigger("mediachanging"),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Ey(e,!0)),!o)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const c={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:c}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(f,p)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Op(e.resolvedUri,p),f)return this.playlistRequestError(this.request,e,r);this.trigger({type:"playlistrequestcomplete",metadata:c}),this.haveMetadata({playlistString:p.responseText,url:e.uri,id:e.id}),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const i=this.media();if(e){const r=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=z.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},r);return}if(!this.started){this.start();return}i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=z.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=z.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(!this.request)return;if(this.request=null,i)return this.error={status:r.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:r.responseText,code:2,metadata:Uo({requestType:r.requestType,request:r,error:i})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Op(this.src,r),this.trigger({type:"playlistparsestart",metadata:e});const o=this.parseManifest_({manifestString:r.responseText,url:this.src});e.parsedPlaylist=RS(o.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(o)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,DS(this.main,this.srcUri()),e.playlists.forEach(r=>{r.segments=IS(r),r.segments.forEach(o=>{OS(o,r.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const i=this.srcUri()||z.location.href;this.main=MO(e,i),this.haveMetadata({playlistObject:e,url:i,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,i){const r=this.main,o=e.ID;let l=r.playlists.length;for(;l--;){const c=r.playlists[l];if(c.attributes["PATHWAY-ID"]===o){const f=c.resolvedUri,p=c.id;if(i){const v=this.createCloneURI_(c.resolvedUri,e),S=vu(o,v),x=this.createCloneAttributes_(o,c.attributes),D=this.createClonePlaylist_(c,S,e,x);r.playlists[l]=D,r.playlists[S]=D,r.playlists[v]=D}else r.playlists.splice(l,1);delete r.playlists[p],delete r.playlists[f]}}this.updateOrDeleteCloneMedia(e,i)}updateOrDeleteCloneMedia(e,i){const r=this.main,o=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(l=>{if(!(!r.mediaGroups[l]||!r.mediaGroups[l][o])){for(const c in r.mediaGroups[l])if(c===o){for(const f in r.mediaGroups[l][c])r.mediaGroups[l][c][f].playlists.forEach((v,S)=>{const x=r.playlists[v.id],D=x.id,k=x.resolvedUri;delete r.playlists[D],delete r.playlists[k]});delete r.mediaGroups[l][c]}}}),i&&this.createClonedMediaGroups_(e)}addClonePathway(e,i={}){const r=this.main,o=r.playlists.length,l=this.createCloneURI_(i.resolvedUri,e),c=vu(e.ID,l),f=this.createCloneAttributes_(e.ID,i.attributes),p=this.createClonePlaylist_(i,c,e,f);r.playlists[o]=p,r.playlists[c]=p,r.playlists[l]=p,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const i=e.ID,r=e["BASE-ID"],o=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(l=>{if(!(!o.mediaGroups[l]||o.mediaGroups[l][i]))for(const c in o.mediaGroups[l]){if(c===r)o.mediaGroups[l][i]={};else continue;for(const f in o.mediaGroups[l][c]){const p=o.mediaGroups[l][c][f];o.mediaGroups[l][i][f]=ei({},p);const v=o.mediaGroups[l][i][f],S=this.createCloneURI_(p.resolvedUri,e);v.resolvedUri=S,v.uri=S,v.playlists=[],p.playlists.forEach((x,D)=>{const k=o.playlists[x.id],I=ES(l,i,f),C=vu(i,I);if(k&&!o.playlists[C]){const P=this.createClonePlaylist_(k,C,e),U=P.resolvedUri;o.playlists[C]=P,o.playlists[U]=P}v.playlists[D]=this.createClonePlaylist_(x,C,e)})}}})}createClonePlaylist_(e,i,r,o){const l=this.createCloneURI_(e.resolvedUri,r),c={resolvedUri:l,uri:l,id:i};return e.segments&&(c.segments=[]),o&&(c.attributes=o),Ct(e,c)}createCloneURI_(e,i){const r=new URL(e);r.hostname=i["URI-REPLACEMENT"].HOST;const o=i["URI-REPLACEMENT"].PARAMS;for(const l of Object.keys(o))r.searchParams.set(l,o[l]);return r.href}createCloneAttributes_(e,i){const r={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(o=>{i[o]&&(r[o]=e)}),r}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const r in e.contentProtection){const o=e.contentProtection[r].attributes.keyId;o&&i.add(o.toLowerCase())}return i}}}const My=function(s,e,i,r){const o=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&o&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=o.byteLength||o.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),i.headers&&(s.responseHeaders=i.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(o||s.responseText)))),r(e,s)},OO=(s,e)=>{if(!s||!s.size)return;let i=e;return s.forEach(r=>{i=r(i)}),i},IO=(s,e,i,r)=>{!s||!s.size||s.forEach(o=>{o(e,i,r)})},jS=function(){const s=function e(i,r){i=Ct({timeout:45e3},i);const o=e.beforeRequest||F.Vhs.xhr.beforeRequest,l=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,c=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;o&&typeof o=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),l.add(o));const f=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,p=OO(l,i);l.delete(o);const v=f(p||i,function(x,D){return IO(c,v,x,D),My(v,x,D,r)}),S=v.abort;return v.abort=function(){return v.aborted=!0,S.apply(v,arguments)},v.uri=i.uri,v.requestType=i.requestType,v.requestTime=Date.now(),v};return s.original=!0,s},LO=function(s){let e;const i=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=z.BigInt(s.offset)+z.BigInt(s.length)-z.BigInt(1):e=s.offset+s.length-1,"bytes="+i+"-"+e},Dy=function(s){const e={};return s.byterange&&(e.Range=LO(s.byterange)),e},RO=function(s,e){return s.start(e)+"-"+s.end(e)},jO=function(s,e){const i=s.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")},zO=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},zS=function(s){const e={};return Object.keys(s).forEach(i=>{const r=s[i];o1(r)?e[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:e[i]=r}),e},Rp=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},US=function(s){return s.resolvedUri},PS=s=>{const e=Array.prototype.slice.call(s),i=16;let r="",o,l;for(let c=0;cPS(s),textRanges:s=>{let e="",i;for(i=0;i{if(!e.dateTimeObject)return null;const i=e.videoTimingInfo.transmuxerPrependedSeconds,o=e.videoTimingInfo.transmuxedPresentationStart+i,l=s-o;return new Date(e.dateTimeObject.getTime()+l*1e3)},BO=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,qO=(s,e)=>{let i;try{i=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let r=e.segments[0];if(if?null:(i>new Date(l)&&(r=o),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Cn.duration(e,e.mediaSequence+e.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},FO=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let i=0,r;for(let l=0;li){if(s>i+o.duration*BS)return null;r=o}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:i-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},HO=(s,e)=>{let i,r;try{i=new Date(s),r=new Date(e)}catch{}const o=i.getTime();return(r.getTime()-o)/1e3},VO=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e{if(!i)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return i({message:"getProgramTime: playlist and time must be provided"});const r=FO(e,s);if(!r)return i({message:"valid programTime was not found"});if(r.type==="estimate")return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const o={mediaSeconds:e},l=PO(e,r.segment);return l&&(o.programDateTime=l.toISOString()),i(null,o)},qS=({programTime:s,playlist:e,retryCount:i=2,seekTo:r,pauseAfterSeek:o=!0,tech:l,callback:c})=>{if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!r)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!VO(e))return c({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const f=qO(s,e);if(!f)return c({message:`${s} was not found in the stream`});const p=f.segment,v=HO(p.dateTimeObject,s);if(f.type==="estimate"){if(i===0)return c({message:`${s} is not buffered yet. Try again`});r(f.estimatedStart+v),l.one("seeked",()=>{qS({programTime:s,playlist:e,retryCount:i-1,seekTo:r,pauseAfterSeek:o,tech:l,callback:c})});return}const S=p.start+v,x=()=>c(null,l.currentTime());l.one("seeked",x),o&&l.pause(),r(S)},Cy=(s,e)=>{if(s.readyState===4)return e()},YO=(s,e,i,r)=>{let o=[],l,c=!1;const f=function(x,D,k,I){return D.abort(),c=!0,i(x,D,k,I)},p=function(x,D){if(c)return;if(x)return x.metadata=Uo({requestType:r,request:D,error:x}),f(x,D,"",o);const k=D.responseText.substring(o&&o.byteLength||0,D.responseText.length);if(o=t4(o,l1(k,!0)),l=l||gd(o),o.length<10||l&&o.lengthf(x,D,"",o));const I=g0(o);return I==="ts"&&o.length<188?Cy(D,()=>f(x,D,"",o)):!I&&o.length<376?Cy(D,()=>f(x,D,"",o)):f(null,D,I,o)},S=e({uri:s,beforeSend(x){x.overrideMimeType("text/plain; charset=x-user-defined"),x.addEventListener("progress",function({total:D,loaded:k}){return My(x,null,{statusCode:x.status},p)})}},function(x,D){return My(S,x,D,p)});return S},{EventTarget:QO}=F,FS=function(s,e){if(!LS(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let i=0;i{const o=r.attributes.NAME||i;return`placeholder-uri-${s}-${e}-${o}`},XO=({mainXml:s,srcUrl:e,clientOffset:i,sidxMapping:r,previousManifest:o})=>{const l=SN(s,{manifestUri:e,clientOffset:i,sidxMapping:r,previousManifest:o});return DS(l,e,GO),l},WO=(s,e)=>{bu(s,(i,r,o,l)=>{(!e.mediaGroups[r][o]||!(l in e.mediaGroups[r][o]))&&delete s.mediaGroups[r][o][l]})},KO=(s,e,i)=>{let r=!0,o=Ct(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let l=0;l{if(l.playlists&&l.playlists.length){const v=l.playlists[0].id,S=xy(o,l.playlists[0],FS);S&&(o=S,p in o.mediaGroups[c][f]||(o.mediaGroups[c][f][p]=l),o.mediaGroups[c][f][p].playlists[0]=o.playlists[v],r=!1)}}),WO(o,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(r=!1),r?null:o},ZO=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,HS=(s,e)=>{const i={};for(const r in s){const l=s[r].sidx;if(l){const c=Yf(l);if(!e[c])break;const f=e[c].sidxInfo;ZO(f,l)&&(i[c]=e[c])}}return i},JO=(s,e)=>{let r=HS(s.playlists,e);return bu(s,(o,l,c,f)=>{if(o.playlists&&o.playlists.length){const p=o.playlists;r=Ct(r,HS(p,e))}}),r};class Ay extends QO{constructor(e,i,r={},o){super(),this.isPaused_=!0,this.mainPlaylistLoader_=o||this,o||(this.isMain_=!0);const{withCredentials:l=!1}=r;if(this.vhs_=i,this.withCredentials=l,this.addMetadataToTextTrack=r.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=ls("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,i,r){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:i.status,message:"DASH request error at URL: "+i.uri,response:i.response,code:2,metadata:e.metadata},r&&(this.state=r),this.trigger("error"),!0}addSidxSegments_(e,i,r){const o=e.sidx&&Yf(e.sidx);if(!e.sidx||!o||this.mainPlaylistLoader_.sidxMapping_[o]){z.clearTimeout(this.mediaRequest_),this.mediaRequest_=z.setTimeout(()=>r(!1),0);return}const l=Op(e.sidx.resolvedUri),c=(p,v)=>{if(this.requestErrored_(p,v,i))return;const S=this.mainPlaylistLoader_.sidxMapping_,{requestType:x}=v;let D;try{D=AN(Ve(v.response).subarray(8))}catch(k){k.metadata=Uo({requestType:x,request:v,parseFailure:!0}),this.requestErrored_(k,v,i);return}return S[o]={sidxInfo:e.sidx,sidx:D},c0(e,D,e.sidx.resolvedUri),r(!0)},f="dash-sidx";this.request=YO(l,this.vhs_.xhr,(p,v,S,x)=>{if(p)return c(p,v);if(!S||S!=="mp4"){const I=S||"unknown";return c({status:v.status,message:`Unsupported ${I} container type for sidx segment at URL: ${l}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},v)}const{offset:D,length:k}=e.sidx.byterange;if(x.length>=k+D)return c(p,{response:x.subarray(D,D+k),status:v.status,uri:v.uri});this.request=this.vhs_.xhr({uri:l,responseType:"arraybuffer",requestType:"dash-sidx",headers:Dy({byterange:e.sidx.byterange})},c)},f)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},z.clearTimeout(this.minimumUpdatePeriodTimeout_),z.clearTimeout(this.mediaRequest_),z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const i=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,o=>{this.haveMetadata({startingState:i,playlist:e})}))}haveMetadata({startingState:e,playlist:i}){this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,z.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(i.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(z.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const i=this.media();if(e){const r=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=z.setTimeout(()=>this.load(),r);return}if(!this.started){this.start();return}i&&!i.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){z.clearTimeout(this.mediaRequest_),this.mediaRequest_=z.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,i)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:i}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(r,o)=>{if(r){const{requestType:c}=o;r.metadata=Uo({requestType:c,request:o,error:r})}if(this.requestErrored_(r,o)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:i});const l=o.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?this.mainLoaded_=Date.parse(o.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Op(this.mainPlaylistLoader_.srcUrl,o),l){this.handleMain_(),this.syncClientServerClock_(()=>e(o,l));return}return e(o,l)})}syncClientServerClock_(e){const i=xN(this.mainPlaylistLoader_.mainXml_);if(i===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(i.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=i.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Dn(this.mainPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(r,o)=>{if(!this.request)return;if(r){const{requestType:c}=o;return this.error.metadata=Uo({requestType:c,request:o,error:r}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let l;i.method==="HEAD"?!o.responseHeaders||!o.responseHeaders.date?l=this.mainLoaded_:l=Date.parse(o.responseHeaders.date):l=Date.parse(o.responseText),this.mainPlaylistLoader_.clientOffset_=l-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){z.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});let r;try{r=XO({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(l){this.error=l,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:l},this.trigger("error")}e&&(r=KO(e,r,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=r||e;const o=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(o&&o!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=o),(!e||r&&r.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(r),r){const{duration:l,endList:c}=r,f=[];r.playlists.forEach(v=>{f.push({id:v.id,bandwidth:v.attributes.BANDWIDTH,resolution:v.attributes.RESOLUTION,codecs:v.attributes.CODECS})});const p={duration:l,isLive:!c,renditions:f};i.parsedManifest=p,this.trigger({type:"manifestparsecomplete",metadata:i})}return!!r}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(z.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let i=e.main&&e.main.minimumUpdatePeriod;if(i===0&&(e.media()?i=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_(`found invalid minimumUpdatePeriod of ${i}, not setting a timeout`);return}this.createMUPTimeout_(i)}createMUPTimeout_(e){const i=this.mainPlaylistLoader_;i.minimumUpdatePeriodTimeout_=z.setTimeout(()=>{i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,i)=>{i&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=JO(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,r=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const i=this.mainPlaylistLoader_.main.playlists,r=!this.media_||this.media_!==i[e];if(r?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const o=()=>{this.media().endList||(this.mediaUpdateTimeout=z.setTimeout(()=>{this.trigger("mediaupdatetimeout"),o()},Ey(this.media(),!!r)))};o()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const i=this.mainPlaylistLoader_.main.eventStream.map(r=>({cueTime:r.start,frames:[{data:r.messageData}]}));this.addMetadataToTextTrack("EventStream",i,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const r in e.contentProtection){const o=e.contentProtection[r].attributes["cenc:default_KID"];o&&i.add(o.replace(/-/g,"").toLowerCase())}return i}}}var ki={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const eI=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let i=0;iPS(s),textRanges:s=>{let e="",i;for(i=0;i{if(!e.dateTimeObject)return null;const i=e.videoTimingInfo.transmuxerPrependedSeconds,o=e.videoTimingInfo.transmuxedPresentationStart+i,l=s-o;return new Date(e.dateTimeObject.getTime()+l*1e3)},BO=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,qO=(s,e)=>{let i;try{i=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let r=e.segments[0];if(if?null:(i>new Date(l)&&(r=o),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Cn.duration(e,e.mediaSequence+e.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},FO=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let i=0,r;for(let l=0;li){if(s>i+o.duration*BS)return null;r=o}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:i-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},HO=(s,e)=>{let i,r;try{i=new Date(s),r=new Date(e)}catch{}const o=i.getTime();return(r.getTime()-o)/1e3},VO=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e{if(!i)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return i({message:"getProgramTime: playlist and time must be provided"});const r=FO(e,s);if(!r)return i({message:"valid programTime was not found"});if(r.type==="estimate")return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const o={mediaSeconds:e},l=PO(e,r.segment);return l&&(o.programDateTime=l.toISOString()),i(null,o)},qS=({programTime:s,playlist:e,retryCount:i=2,seekTo:r,pauseAfterSeek:o=!0,tech:l,callback:c})=>{if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!r)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!VO(e))return c({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const f=qO(s,e);if(!f)return c({message:`${s} was not found in the stream`});const p=f.segment,v=HO(p.dateTimeObject,s);if(f.type==="estimate"){if(i===0)return c({message:`${s} is not buffered yet. Try again`});r(f.estimatedStart+v),l.one("seeked",()=>{qS({programTime:s,playlist:e,retryCount:i-1,seekTo:r,pauseAfterSeek:o,tech:l,callback:c})});return}const S=p.start+v,x=()=>c(null,l.currentTime());l.one("seeked",x),o&&l.pause(),r(S)},Cy=(s,e)=>{if(s.readyState===4)return e()},YO=(s,e,i,r)=>{let o=[],l,c=!1;const f=function(x,D,k,I){return D.abort(),c=!0,i(x,D,k,I)},p=function(x,D){if(c)return;if(x)return x.metadata=Uo({requestType:r,request:D,error:x}),f(x,D,"",o);const k=D.responseText.substring(o&&o.byteLength||0,D.responseText.length);if(o=t4(o,l1(k,!0)),l=l||gd(o),o.length<10||l&&o.lengthf(x,D,"",o));const I=g0(o);return I==="ts"&&o.length<188?Cy(D,()=>f(x,D,"",o)):!I&&o.length<376?Cy(D,()=>f(x,D,"",o)):f(null,D,I,o)},S=e({uri:s,beforeSend(x){x.overrideMimeType("text/plain; charset=x-user-defined"),x.addEventListener("progress",function({total:D,loaded:k}){return My(x,null,{statusCode:x.status},p)})}},function(x,D){return My(S,x,D,p)});return S},{EventTarget:QO}=F,FS=function(s,e){if(!LS(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let i=0;i{const o=r.attributes.NAME||i;return`placeholder-uri-${s}-${e}-${o}`},XO=({mainXml:s,srcUrl:e,clientOffset:i,sidxMapping:r,previousManifest:o})=>{const l=SN(s,{manifestUri:e,clientOffset:i,sidxMapping:r,previousManifest:o});return DS(l,e,GO),l},WO=(s,e)=>{bu(s,(i,r,o,l)=>{(!e.mediaGroups[r][o]||!(l in e.mediaGroups[r][o]))&&delete s.mediaGroups[r][o][l]})},KO=(s,e,i)=>{let r=!0,o=Ct(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let l=0;l{if(l.playlists&&l.playlists.length){const v=l.playlists[0].id,S=xy(o,l.playlists[0],FS);S&&(o=S,p in o.mediaGroups[c][f]||(o.mediaGroups[c][f][p]=l),o.mediaGroups[c][f][p].playlists[0]=o.playlists[v],r=!1)}}),WO(o,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(r=!1),r?null:o},ZO=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,HS=(s,e)=>{const i={};for(const r in s){const l=s[r].sidx;if(l){const c=Yf(l);if(!e[c])break;const f=e[c].sidxInfo;ZO(f,l)&&(i[c]=e[c])}}return i},JO=(s,e)=>{let r=HS(s.playlists,e);return bu(s,(o,l,c,f)=>{if(o.playlists&&o.playlists.length){const p=o.playlists;r=Ct(r,HS(p,e))}}),r};class Ay extends QO{constructor(e,i,r={},o){super(),this.isPaused_=!0,this.mainPlaylistLoader_=o||this,o||(this.isMain_=!0);const{withCredentials:l=!1}=r;if(this.vhs_=i,this.withCredentials=l,this.addMetadataToTextTrack=r.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=ls("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,i,r){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:i.status,message:"DASH request error at URL: "+i.uri,response:i.response,code:2,metadata:e.metadata},r&&(this.state=r),this.trigger("error"),!0}addSidxSegments_(e,i,r){const o=e.sidx&&Yf(e.sidx);if(!e.sidx||!o||this.mainPlaylistLoader_.sidxMapping_[o]){z.clearTimeout(this.mediaRequest_),this.mediaRequest_=z.setTimeout(()=>r(!1),0);return}const l=Op(e.sidx.resolvedUri),c=(p,v)=>{if(this.requestErrored_(p,v,i))return;const S=this.mainPlaylistLoader_.sidxMapping_,{requestType:x}=v;let D;try{D=AN(Ve(v.response).subarray(8))}catch(k){k.metadata=Uo({requestType:x,request:v,parseFailure:!0}),this.requestErrored_(k,v,i);return}return S[o]={sidxInfo:e.sidx,sidx:D},c0(e,D,e.sidx.resolvedUri),r(!0)},f="dash-sidx";this.request=YO(l,this.vhs_.xhr,(p,v,S,x)=>{if(p)return c(p,v);if(!S||S!=="mp4"){const I=S||"unknown";return c({status:v.status,message:`Unsupported ${I} container type for sidx segment at URL: ${l}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},v)}const{offset:D,length:k}=e.sidx.byterange;if(x.length>=k+D)return c(p,{response:x.subarray(D,D+k),status:v.status,uri:v.uri});this.request=this.vhs_.xhr({uri:l,responseType:"arraybuffer",requestType:"dash-sidx",headers:Dy({byterange:e.sidx.byterange})},c)},f)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},z.clearTimeout(this.minimumUpdatePeriodTimeout_),z.clearTimeout(this.mediaRequest_),z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const i=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,o=>{this.haveMetadata({startingState:i,playlist:e})}))}haveMetadata({startingState:e,playlist:i}){this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,z.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(i.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(z.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,z.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const i=this.media();if(e){const r=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=z.setTimeout(()=>this.load(),r);return}if(!this.started){this.start();return}i&&!i.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){z.clearTimeout(this.mediaRequest_),this.mediaRequest_=z.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,i)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:i}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(r,o)=>{if(r){const{requestType:c}=o;r.metadata=Uo({requestType:c,request:o,error:r})}if(this.requestErrored_(r,o)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:i});const l=o.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?this.mainLoaded_=Date.parse(o.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Op(this.mainPlaylistLoader_.srcUrl,o),l){this.handleMain_(),this.syncClientServerClock_(()=>e(o,l));return}return e(o,l)})}syncClientServerClock_(e){const i=xN(this.mainPlaylistLoader_.mainXml_);if(i===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(i.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=i.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Dn(this.mainPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(r,o)=>{if(!this.request)return;if(r){const{requestType:c}=o;return this.error.metadata=Uo({requestType:c,request:o,error:r}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let l;i.method==="HEAD"?!o.responseHeaders||!o.responseHeaders.date?l=this.mainLoaded_:l=Date.parse(o.responseHeaders.date):l=Date.parse(o.responseText),this.mainPlaylistLoader_.clientOffset_=l-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){z.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});let r;try{r=XO({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(l){this.error=l,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:l},this.trigger("error")}e&&(r=KO(e,r,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=r||e;const o=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(o&&o!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=o),(!e||r&&r.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(r),r){const{duration:l,endList:c}=r,f=[];r.playlists.forEach(v=>{f.push({id:v.id,bandwidth:v.attributes.BANDWIDTH,resolution:v.attributes.RESOLUTION,codecs:v.attributes.CODECS})});const p={duration:l,isLive:!c,renditions:f};i.parsedManifest=p,this.trigger({type:"manifestparsecomplete",metadata:i})}return!!r}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(z.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let i=e.main&&e.main.minimumUpdatePeriod;if(i===0&&(e.media()?i=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_(`found invalid minimumUpdatePeriod of ${i}, not setting a timeout`);return}this.createMUPTimeout_(i)}createMUPTimeout_(e){const i=this.mainPlaylistLoader_;i.minimumUpdatePeriodTimeout_=z.setTimeout(()=>{i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,i)=>{i&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=JO(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,r=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const i=this.mainPlaylistLoader_.main.playlists,r=!this.media_||this.media_!==i[e];if(r?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const o=()=>{this.media().endList||(this.mediaUpdateTimeout=z.setTimeout(()=>{this.trigger("mediaupdatetimeout"),o()},Ey(this.media(),!!r)))};o()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const i=this.mainPlaylistLoader_.main.eventStream.map(r=>({cueTime:r.start,frames:[{data:r.messageData}]}));this.addMetadataToTextTrack("EventStream",i,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const r in e.contentProtection){const o=e.contentProtection[r].attributes["cenc:default_KID"];o&&i.add(o.replace(/-/g,"").toLowerCase())}return i}}}var ki={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const e3=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let i=0;i-1):!1},this.trigger=function(g){var y,T,b,E;if(y=h[g],!!y)if(arguments.length===2)for(b=y.length,T=0;T"u")){for(h in he)he.hasOwnProperty(h)&&(he[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);ge=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),ne=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Ae=new Uint8Array([0,0,0,1]),Se=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),pe=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Ue={video:Se,audio:pe},we=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Oe=new Uint8Array([0,0,0,0,0,0,0,0]),qe=new Uint8Array([0,0,0,0,0,0,0,0]),We=qe,Ze=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),He=qe,se=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),f=function(h){var g=[],y=0,T,b,E;for(T=1;T>>1,h.samplingfrequencyindex<<7|h.channelcount<<3,6,1,2]))},S=function(){return f(he.ftyp,ge,Ae,ge,ne)},oe=function(h){return f(he.hdlr,Ue[h])},x=function(h){return f(he.mdat,h)},W=function(h){var g=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,h.duration>>>24&255,h.duration>>>16&255,h.duration>>>8&255,h.duration&255,85,196,0,0]);return h.samplerate&&(g[12]=h.samplerate>>>24&255,g[13]=h.samplerate>>>16&255,g[14]=h.samplerate>>>8&255,g[15]=h.samplerate&255),f(he.mdhd,g)},G=function(h){return f(he.mdia,W(h),oe(h.type),k(h))},D=function(h){return f(he.mfhd,new Uint8Array([0,0,0,0,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255]))},k=function(h){return f(he.minf,h.type==="video"?f(he.vmhd,se):f(he.smhd,Oe),p(),de(h))},I=function(h,g){for(var y=[],T=g.length;T--;)y[T]=me(g[T]);return f.apply(null,[he.moof,D(h)].concat(y))},C=function(h){for(var g=h.length,y=[];g--;)y[g]=Y(h[g]);return f.apply(null,[he.moov,U(4294967295)].concat(y).concat(P(h)))},P=function(h){for(var g=h.length,y=[];g--;)y[g]=le(h[g]);return f.apply(null,[he.mvex].concat(y))},U=function(h){var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return f(he.mvhd,g)},K=function(h){var g=h.samples||[],y=new Uint8Array(4+g.length),T,b;for(b=0;b>>8),E.push(T[O].byteLength&255),E=E.concat(Array.prototype.slice.call(T[O]));for(O=0;O>>8),w.push(b[O].byteLength&255),w=w.concat(Array.prototype.slice.call(b[O]));if(R=[he.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(y.width&65280)>>8,y.width&255,(y.height&65280)>>8,y.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),f(he.avcC,new Uint8Array([1,y.profileIdc,y.profileCompatibility,y.levelIdc,255].concat([T.length],E,[b.length],w))),f(he.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],y.sarRatio){var j=y.sarRatio[0],H=y.sarRatio[1];R.push(f(he.pasp,new Uint8Array([(j&4278190080)>>24,(j&16711680)>>16,(j&65280)>>8,j&255,(H&4278190080)>>24,(H&16711680)>>16,(H&65280)>>8,H&255])))}return f.apply(null,R)},g=function(y){return f(he.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(y.channelcount&65280)>>8,y.channelcount&255,(y.samplesize&65280)>>8,y.samplesize&255,0,0,0,0,(y.samplerate&65280)>>8,y.samplerate&255,0,0]),v(y))}}(),$=function(h){var g=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,0,(h.duration&4278190080)>>24,(h.duration&16711680)>>16,(h.duration&65280)>>8,h.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(h.width&65280)>>8,h.width&255,0,0,(h.height&65280)>>8,h.height&255,0,0]);return f(he.tkhd,g)},me=function(h){var g,y,T,b,E,w,O;return g=f(he.tfhd,new Uint8Array([0,0,0,58,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),w=Math.floor(h.baseMediaDecodeTime/c),O=Math.floor(h.baseMediaDecodeTime%c),y=f(he.tfdt,new Uint8Array([1,0,0,0,w>>>24&255,w>>>16&255,w>>>8&255,w&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255])),E=32+20+8+16+8+8,h.type==="audio"?(T=_e(h,E),f(he.traf,g,y,T)):(b=K(h),T=_e(h,b.length+E),f(he.traf,g,y,T,b))},Y=function(h){return h.duration=h.duration||4294967295,f(he.trak,$(h),G(h))},le=function(h){var g=new Uint8Array([0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return h.type!=="video"&&(g[g.length-1]=0),f(he.trex,g)},function(){var h,g,y;y=function(T,b){var E=0,w=0,O=0,R=0;return T.length&&(T[0].duration!==void 0&&(E=1),T[0].size!==void 0&&(w=2),T[0].flags!==void 0&&(O=4),T[0].compositionTimeOffset!==void 0&&(R=8)),[0,0,E|w|O|R,1,(T.length&4278190080)>>>24,(T.length&16711680)>>>16,(T.length&65280)>>>8,T.length&255,(b&4278190080)>>>24,(b&16711680)>>>16,(b&65280)>>>8,b&255]},g=function(T,b){var E,w,O,R,j,H;for(R=T.samples||[],b+=8+12+16*R.length,O=y(R,b),w=new Uint8Array(O.length+R.length*16),w.set(O),E=O.length,H=0;H>>24,w[E++]=(j.duration&16711680)>>>16,w[E++]=(j.duration&65280)>>>8,w[E++]=j.duration&255,w[E++]=(j.size&4278190080)>>>24,w[E++]=(j.size&16711680)>>>16,w[E++]=(j.size&65280)>>>8,w[E++]=j.size&255,w[E++]=j.flags.isLeading<<2|j.flags.dependsOn,w[E++]=j.flags.isDependedOn<<6|j.flags.hasRedundancy<<4|j.flags.paddingValue<<1|j.flags.isNonSyncSample,w[E++]=j.flags.degradationPriority&61440,w[E++]=j.flags.degradationPriority&15,w[E++]=(j.compositionTimeOffset&4278190080)>>>24,w[E++]=(j.compositionTimeOffset&16711680)>>>16,w[E++]=(j.compositionTimeOffset&65280)>>>8,w[E++]=j.compositionTimeOffset&255;return f(he.trun,w)},h=function(T,b){var E,w,O,R,j,H;for(R=T.samples||[],b+=8+12+8*R.length,O=y(R,b),E=new Uint8Array(O.length+R.length*8),E.set(O),w=O.length,H=0;H>>24,E[w++]=(j.duration&16711680)>>>16,E[w++]=(j.duration&65280)>>>8,E[w++]=j.duration&255,E[w++]=(j.size&4278190080)>>>24,E[w++]=(j.size&16711680)>>>16,E[w++]=(j.size&65280)>>>8,E[w++]=j.size&255;return f(he.trun,E)},_e=function(T,b){return T.type==="audio"?h(T,b):g(T,b)}}();var Fe={ftyp:S,mdat:x,moof:I,moov:C,initSegment:function(h){var g=S(),y=C(h),T;return T=new Uint8Array(g.byteLength+y.byteLength),T.set(g),T.set(y,g.byteLength),T}},dt=function(h){var g,y,T=[],b=[];for(b.byteLength=0,b.nalCount=0,b.duration=0,T.byteLength=0,g=0;g1&&(g=h.shift(),h.byteLength-=g.byteLength,h.nalCount-=g.nalCount,h[0][0].dts=g.dts,h[0][0].pts=g.pts,h[0][0].duration+=g.duration),h},ye=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},xe=function(h,g){var y=ye();return y.dataOffset=g,y.compositionTimeOffset=h.pts-h.dts,y.duration=h.duration,y.size=4*h.length,y.size+=h.byteLength,h.keyFrame&&(y.flags.dependsOn=2,y.flags.isNonSyncSample=0),y},Pe=function(h,g){var y,T,b,E,w,O=g||0,R=[];for(y=0;ytn.ONE_SECOND_IN_TS/2))){for(j=ar()[h.samplerate],j||(j=g[0].data),H=0;H=y?h:(g.minSegmentDts=1/0,h.filter(function(T){return T.dts>=y?(g.minSegmentDts=Math.min(g.minSegmentDts,T.dts),g.minSegmentPts=g.minSegmentDts,!0):!1}))},Q=function(h){var g,y,T=[];for(g=0;g-1):!1},this.trigger=function(g){var y,T,b,E;if(y=h[g],!!y)if(arguments.length===2)for(b=y.length,T=0;T"u")){for(h in he)he.hasOwnProperty(h)&&(he[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);ge=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),ne=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),Ae=new Uint8Array([0,0,0,1]),Se=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),pe=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Ue={video:Se,audio:pe},we=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Oe=new Uint8Array([0,0,0,0,0,0,0,0]),qe=new Uint8Array([0,0,0,0,0,0,0,0]),We=qe,Ze=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),He=qe,se=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),f=function(h){var g=[],y=0,T,b,E;for(T=1;T>>1,h.samplingfrequencyindex<<7|h.channelcount<<3,6,1,2]))},S=function(){return f(he.ftyp,ge,Ae,ge,ne)},oe=function(h){return f(he.hdlr,Ue[h])},x=function(h){return f(he.mdat,h)},W=function(h){var g=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,h.duration>>>24&255,h.duration>>>16&255,h.duration>>>8&255,h.duration&255,85,196,0,0]);return h.samplerate&&(g[12]=h.samplerate>>>24&255,g[13]=h.samplerate>>>16&255,g[14]=h.samplerate>>>8&255,g[15]=h.samplerate&255),f(he.mdhd,g)},G=function(h){return f(he.mdia,W(h),oe(h.type),k(h))},D=function(h){return f(he.mfhd,new Uint8Array([0,0,0,0,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255]))},k=function(h){return f(he.minf,h.type==="video"?f(he.vmhd,se):f(he.smhd,Oe),p(),de(h))},I=function(h,g){for(var y=[],T=g.length;T--;)y[T]=me(g[T]);return f.apply(null,[he.moof,D(h)].concat(y))},C=function(h){for(var g=h.length,y=[];g--;)y[g]=Y(h[g]);return f.apply(null,[he.moov,U(4294967295)].concat(y).concat(P(h)))},P=function(h){for(var g=h.length,y=[];g--;)y[g]=le(h[g]);return f.apply(null,[he.mvex].concat(y))},U=function(h){var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return f(he.mvhd,g)},K=function(h){var g=h.samples||[],y=new Uint8Array(4+g.length),T,b;for(b=0;b>>8),E.push(T[O].byteLength&255),E=E.concat(Array.prototype.slice.call(T[O]));for(O=0;O>>8),w.push(b[O].byteLength&255),w=w.concat(Array.prototype.slice.call(b[O]));if(R=[he.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(y.width&65280)>>8,y.width&255,(y.height&65280)>>8,y.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),f(he.avcC,new Uint8Array([1,y.profileIdc,y.profileCompatibility,y.levelIdc,255].concat([T.length],E,[b.length],w))),f(he.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],y.sarRatio){var j=y.sarRatio[0],H=y.sarRatio[1];R.push(f(he.pasp,new Uint8Array([(j&4278190080)>>24,(j&16711680)>>16,(j&65280)>>8,j&255,(H&4278190080)>>24,(H&16711680)>>16,(H&65280)>>8,H&255])))}return f.apply(null,R)},g=function(y){return f(he.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(y.channelcount&65280)>>8,y.channelcount&255,(y.samplesize&65280)>>8,y.samplesize&255,0,0,0,0,(y.samplerate&65280)>>8,y.samplerate&255,0,0]),v(y))}}(),$=function(h){var g=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,0,(h.duration&4278190080)>>24,(h.duration&16711680)>>16,(h.duration&65280)>>8,h.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(h.width&65280)>>8,h.width&255,0,0,(h.height&65280)>>8,h.height&255,0,0]);return f(he.tkhd,g)},me=function(h){var g,y,T,b,E,w,O;return g=f(he.tfhd,new Uint8Array([0,0,0,58,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),w=Math.floor(h.baseMediaDecodeTime/c),O=Math.floor(h.baseMediaDecodeTime%c),y=f(he.tfdt,new Uint8Array([1,0,0,0,w>>>24&255,w>>>16&255,w>>>8&255,w&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255])),E=32+20+8+16+8+8,h.type==="audio"?(T=_e(h,E),f(he.traf,g,y,T)):(b=K(h),T=_e(h,b.length+E),f(he.traf,g,y,T,b))},Y=function(h){return h.duration=h.duration||4294967295,f(he.trak,$(h),G(h))},le=function(h){var g=new Uint8Array([0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return h.type!=="video"&&(g[g.length-1]=0),f(he.trex,g)},function(){var h,g,y;y=function(T,b){var E=0,w=0,O=0,R=0;return T.length&&(T[0].duration!==void 0&&(E=1),T[0].size!==void 0&&(w=2),T[0].flags!==void 0&&(O=4),T[0].compositionTimeOffset!==void 0&&(R=8)),[0,0,E|w|O|R,1,(T.length&4278190080)>>>24,(T.length&16711680)>>>16,(T.length&65280)>>>8,T.length&255,(b&4278190080)>>>24,(b&16711680)>>>16,(b&65280)>>>8,b&255]},g=function(T,b){var E,w,O,R,j,H;for(R=T.samples||[],b+=8+12+16*R.length,O=y(R,b),w=new Uint8Array(O.length+R.length*16),w.set(O),E=O.length,H=0;H>>24,w[E++]=(j.duration&16711680)>>>16,w[E++]=(j.duration&65280)>>>8,w[E++]=j.duration&255,w[E++]=(j.size&4278190080)>>>24,w[E++]=(j.size&16711680)>>>16,w[E++]=(j.size&65280)>>>8,w[E++]=j.size&255,w[E++]=j.flags.isLeading<<2|j.flags.dependsOn,w[E++]=j.flags.isDependedOn<<6|j.flags.hasRedundancy<<4|j.flags.paddingValue<<1|j.flags.isNonSyncSample,w[E++]=j.flags.degradationPriority&61440,w[E++]=j.flags.degradationPriority&15,w[E++]=(j.compositionTimeOffset&4278190080)>>>24,w[E++]=(j.compositionTimeOffset&16711680)>>>16,w[E++]=(j.compositionTimeOffset&65280)>>>8,w[E++]=j.compositionTimeOffset&255;return f(he.trun,w)},h=function(T,b){var E,w,O,R,j,H;for(R=T.samples||[],b+=8+12+8*R.length,O=y(R,b),E=new Uint8Array(O.length+R.length*8),E.set(O),w=O.length,H=0;H>>24,E[w++]=(j.duration&16711680)>>>16,E[w++]=(j.duration&65280)>>>8,E[w++]=j.duration&255,E[w++]=(j.size&4278190080)>>>24,E[w++]=(j.size&16711680)>>>16,E[w++]=(j.size&65280)>>>8,E[w++]=j.size&255;return f(he.trun,E)},_e=function(T,b){return T.type==="audio"?h(T,b):g(T,b)}}();var Fe={ftyp:S,mdat:x,moof:I,moov:C,initSegment:function(h){var g=S(),y=C(h),T;return T=new Uint8Array(g.byteLength+y.byteLength),T.set(g),T.set(y,g.byteLength),T}},dt=function(h){var g,y,T=[],b=[];for(b.byteLength=0,b.nalCount=0,b.duration=0,T.byteLength=0,g=0;g1&&(g=h.shift(),h.byteLength-=g.byteLength,h.nalCount-=g.nalCount,h[0][0].dts=g.dts,h[0][0].pts=g.pts,h[0][0].duration+=g.duration),h},ye=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},xe=function(h,g){var y=ye();return y.dataOffset=g,y.compositionTimeOffset=h.pts-h.dts,y.duration=h.duration,y.size=4*h.length,y.size+=h.byteLength,h.keyFrame&&(y.flags.dependsOn=2,y.flags.isNonSyncSample=0),y},Pe=function(h,g){var y,T,b,E,w,O=g||0,R=[];for(y=0;ytn.ONE_SECOND_IN_TS/2))){for(j=ar()[h.samplerate],j||(j=g[0].data),H=0;H=y?h:(g.minSegmentDts=1/0,h.filter(function(T){return T.dts>=y?(g.minSegmentDts=Math.min(g.minSegmentDts,T.dts),g.minSegmentPts=g.minSegmentDts,!0):!1}))},Q=function(h){var g,y,T=[];for(g=0;g=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(h),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},$n.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},$n.prototype.addText=function(h){this.rows[this.rowIdx]+=h},$n.prototype.backspace=function(){if(!this.isEmpty()){var h=this.rows[this.rowIdx];this.rows[this.rowIdx]=h.substr(0,h.length-1)}};var Bi=function(h,g,y){this.serviceNum=h,this.text="",this.currentWindow=new $n(-1),this.windows=[],this.stream=y,typeof g=="string"&&this.createTextDecoder(g)};Bi.prototype.init=function(h,g){this.startPts=h;for(var y=0;y<8;y++)this.windows[y]=new $n(y),typeof g=="function"&&(this.windows[y].beforeRowOverflow=g)},Bi.prototype.setCurrentWindow=function(h){this.currentWindow=this.windows[h]},Bi.prototype.createTextDecoder=function(h){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(h)}catch(g){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+h+" encoding. "+g})}};var wt=function(h){h=h||{},wt.prototype.init.call(this);var g=this,y=h.captionServices||{},T={},b;Object.keys(y).forEach(E=>{b=y[E],/^SERVICE/.test(E)&&(T[E]=b.encoding)}),this.serviceEncodings=T,this.current708Packet=null,this.services={},this.push=function(E){E.type===3?(g.new708Packet(),g.add708Bytes(E)):(g.current708Packet===null&&g.new708Packet(),g.add708Bytes(E))}};wt.prototype=new qd,wt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},wt.prototype.add708Bytes=function(h){var g=h.ccData,y=g>>>8,T=g&255;this.current708Packet.ptsVals.push(h.pts),this.current708Packet.data.push(y),this.current708Packet.data.push(T)},wt.prototype.push708Packet=function(){var h=this.current708Packet,g=h.data,y=null,T=null,b=0,E=g[b++];for(h.seq=E>>6,h.sizeCode=E&63;b>5,T=E&31,y===7&&T>0&&(E=g[b++],y=E),this.pushServiceBlock(y,b,T),T>0&&(b+=T-1)},wt.prototype.pushServiceBlock=function(h,g,y){var T,b=g,E=this.current708Packet.data,w=this.services[h];for(w||(w=this.initService(h,b));b("0"+(Be&255).toString(16)).slice(-2)).join("")}if(b?(J=[O,R],h++):J=[O],g.textDecoder_&&!T)H=g.textDecoder_.decode(new Uint8Array(J));else if(b){const ue=Ee(J);H=String.fromCharCode(parseInt(ue,16))}else H=qy(w|O);return j.pendingNewLine&&!j.isEmpty()&&j.newLine(this.getPts(h)),j.pendingNewLine=!1,j.addText(H),h},wt.prototype.multiByteCharacter=function(h,g){var y=this.current708Packet.data,T=y[h+1],b=y[h+2];return Re(T)&&Re(b)&&(h=this.handleText(++h,g,{isMultiByte:!0})),h},wt.prototype.setCurrentWindow=function(h,g){var y=this.current708Packet.data,T=y[h],b=T&7;return g.setCurrentWindow(b),h},wt.prototype.defineWindow=function(h,g){var y=this.current708Packet.data,T=y[h],b=T&7;g.setCurrentWindow(b);var E=g.currentWindow;return T=y[++h],E.visible=(T&32)>>5,E.rowLock=(T&16)>>4,E.columnLock=(T&8)>>3,E.priority=T&7,T=y[++h],E.relativePositioning=(T&128)>>7,E.anchorVertical=T&127,T=y[++h],E.anchorHorizontal=T,T=y[++h],E.anchorPoint=(T&240)>>4,E.rowCount=T&15,T=y[++h],E.columnCount=T&63,T=y[++h],E.windowStyle=(T&56)>>3,E.penStyle=T&7,E.virtualRowCount=E.rowCount+1,h},wt.prototype.setWindowAttributes=function(h,g){var y=this.current708Packet.data,T=y[h],b=g.currentWindow.winAttr;return T=y[++h],b.fillOpacity=(T&192)>>6,b.fillRed=(T&48)>>4,b.fillGreen=(T&12)>>2,b.fillBlue=T&3,T=y[++h],b.borderType=(T&192)>>6,b.borderRed=(T&48)>>4,b.borderGreen=(T&12)>>2,b.borderBlue=T&3,T=y[++h],b.borderType+=(T&128)>>5,b.wordWrap=(T&64)>>6,b.printDirection=(T&48)>>4,b.scrollDirection=(T&12)>>2,b.justify=T&3,T=y[++h],b.effectSpeed=(T&240)>>4,b.effectDirection=(T&12)>>2,b.displayEffect=T&3,h},wt.prototype.flushDisplayed=function(h,g){for(var y=[],T=0;T<8;T++)g.windows[T].visible&&!g.windows[T].isEmpty()&&y.push(g.windows[T].getText());g.endPts=h,g.text=y.join(` `),this.pushCaption(g),g.startPts=h},wt.prototype.pushCaption=function(h){h.text!==""&&(this.trigger("data",{startPts:h.startPts,endPts:h.endPts,text:h.text,stream:"cc708_"+h.serviceNum}),h.text="",h.startPts=h.endPts)},wt.prototype.displayWindows=function(h,g){var y=this.current708Packet.data,T=y[++h],b=this.getPts(h);this.flushDisplayed(b,g);for(var E=0;E<8;E++)T&1<>4,b.offset=(T&12)>>2,b.penSize=T&3,T=y[++h],b.italics=(T&128)>>7,b.underline=(T&64)>>6,b.edgeType=(T&56)>>3,b.fontStyle=T&7,h},wt.prototype.setPenColor=function(h,g){var y=this.current708Packet.data,T=y[h],b=g.currentWindow.penColor;return T=y[++h],b.fgOpacity=(T&192)>>6,b.fgRed=(T&48)>>4,b.fgGreen=(T&12)>>2,b.fgBlue=T&3,T=y[++h],b.bgOpacity=(T&192)>>6,b.bgRed=(T&48)>>4,b.bgGreen=(T&12)>>2,b.bgBlue=T&3,T=y[++h],b.edgeRed=(T&48)>>4,b.edgeGreen=(T&12)>>2,b.edgeBlue=T&3,h},wt.prototype.setPenLocation=function(h,g){var y=this.current708Packet.data,T=y[h],b=g.currentWindow.penLoc;return g.currentWindow.pendingNewLine=!0,T=y[++h],b.row=T&15,T=y[++h],b.column=T&63,h},wt.prototype.reset=function(h,g){var y=this.getPts(h);return this.flushDisplayed(y,g),this.initService(g.serviceNum,h)};var Fy={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Yr=function(h){return h===null?"":(h=Fy[h]||h,String.fromCharCode(h))},qo=14,Au=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],yi=function(){for(var h=[],g=qo+1;g--;)h.push({text:"",indent:0,offset:0});return h},Pt=function(h,g){Pt.prototype.init.call(this),this.field_=h||0,this.dataChannel_=g||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(y){var T,b,E,w,O;if(T=y.ccData&32639,T===this.lastControlCode_){this.lastControlCode_=null;return}if((T&61440)===4096?this.lastControlCode_=T:T!==this.PADDING_&&(this.lastControlCode_=null),E=T>>>8,w=T&255,T!==this.PADDING_)if(T===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(T===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(y.pts),this.flushDisplayed(y.pts),b=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=b,this.startPts_=y.pts;else if(T===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(y.pts);else if(T===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(y.pts);else if(T===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(y.pts);else if(T===this.CARRIAGE_RETURN_)this.clearFormatting(y.pts),this.flushDisplayed(y.pts),this.shiftRowsUp_(),this.startPts_=y.pts;else if(T===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(T===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(y.pts),this.displayed_=yi();else if(T===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=yi();else if(T===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(y.pts),this.displayed_=yi()),this.mode_="paintOn",this.startPts_=y.pts;else if(this.isSpecialCharacter(E,w))E=(E&3)<<8,O=Yr(E|w),this[this.mode_](y.pts,O),this.column_++;else if(this.isExtCharacter(E,w))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),E=(E&3)<<8,O=Yr(E|w),this[this.mode_](y.pts,O),this.column_++;else if(this.isMidRowCode(E,w))this.clearFormatting(y.pts),this[this.mode_](y.pts," "),this.column_++,(w&14)===14&&this.addFormatting(y.pts,["i"]),(w&1)===1&&this.addFormatting(y.pts,["u"]);else if(this.isOffsetControlCode(E,w)){const j=w&3;this.nonDisplayed_[this.row_].offset=j,this.column_+=j}else if(this.isPAC(E,w)){var R=Au.indexOf(T&7968);if(this.mode_==="rollUp"&&(R-this.rollUpRows_+1<0&&(R=this.rollUpRows_-1),this.setRollUp(y.pts,R)),R!==this.row_&&R>=0&&R<=14&&(this.clearFormatting(y.pts),this.row_=R),w&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(y.pts,["u"]),(T&16)===16){const j=(T&14)>>1;this.column_=j*4,this.nonDisplayed_[this.row_].indent+=j}this.isColorPAC(w)&&(w&14)===14&&this.addFormatting(y.pts,["i"])}else this.isNormalChar(E)&&(w===0&&(w=null),O=Yr(E),O+=Yr(w),this[this.mode_](y.pts,O),this.column_+=O.length)}};Pt.prototype=new qd,Pt.prototype.flushDisplayed=function(h){const g=T=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+T+"."})},y=[];this.displayed_.forEach((T,b)=>{if(T&&T.text&&T.text.length){try{T.text=T.text.trim()}catch{g(b)}T.text.length&&y.push({text:T.text,line:b+1,position:10+Math.min(70,T.indent*10)+T.offset*2.5})}else T==null&&g(b)}),y.length&&this.trigger("data",{startPts:this.startPts_,endPts:h,content:y,stream:this.name_})},Pt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=yi(),this.nonDisplayed_=yi(),this.lastControlCode_=null,this.column_=0,this.row_=qo,this.rollUpRows_=2,this.formatting_=[]},Pt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Pt.prototype.isSpecialCharacter=function(h,g){return h===this.EXT_&&g>=48&&g<=63},Pt.prototype.isExtCharacter=function(h,g){return(h===this.EXT_+1||h===this.EXT_+2)&&g>=32&&g<=63},Pt.prototype.isMidRowCode=function(h,g){return h===this.EXT_&&g>=32&&g<=47},Pt.prototype.isOffsetControlCode=function(h,g){return h===this.OFFSET_&&g>=33&&g<=35},Pt.prototype.isPAC=function(h,g){return h>=this.BASE_&&h=64&&g<=127},Pt.prototype.isColorPAC=function(h){return h>=64&&h<=79||h>=96&&h<=127},Pt.prototype.isNormalChar=function(h){return h>=32&&h<=127},Pt.prototype.setRollUp=function(h,g){if(this.mode_!=="rollUp"&&(this.row_=qo,this.mode_="rollUp",this.flushDisplayed(h),this.nonDisplayed_=yi(),this.displayed_=yi()),g!==void 0&&g!==this.row_)for(var y=0;y"},"");this[this.mode_](h,y)},Pt.prototype.clearFormatting=function(h){if(this.formatting_.length){var g=this.formatting_.reverse().reduce(function(y,T){return y+""},"");this.formatting_=[],this[this.mode_](h,g)}},Pt.prototype.popOn=function(h,g){var y=this.nonDisplayed_[this.row_].text;y+=g,this.nonDisplayed_[this.row_].text=y},Pt.prototype.rollUp=function(h,g){var y=this.displayed_[this.row_].text;y+=g,this.displayed_[this.row_].text=y},Pt.prototype.shiftRowsUp_=function(){var h;for(h=0;hg&&(y=-1);Math.abs(g-h)>qp;)h+=y*Bp;return h},ku=function(h){var g,y;ku.prototype.init.call(this),this.type_=h||Qr,this.push=function(T){if(T.type==="metadata"){this.trigger("data",T);return}this.type_!==Qr&&T.type!==this.type_||(y===void 0&&(y=T.dts),T.dts=Nu(T.dts,y),T.pts=Nu(T.pts,y),g=T.dts,this.trigger("data",T))},this.flush=function(){y=g,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){y=void 0,g=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ku.prototype=new Fd;var Hd={TimestampRolloverStream:ku,handleRollover:Nu},Fp=(h,g,y)=>{if(!h)return-1;for(var T=y;T";h.data[0]===Is.Utf8&&(y=Ii(h.data,0,g),!(y<0)&&(h.mimeType=Ls(h.data,g,y),g=y+1,h.pictureType=h.data[g],g++,T=Ii(h.data,0,g),!(T<0)&&(h.description=Pa(h.data,g,T),g=T+1,h.mimeType===b?h.url=Ls(h.data,g,h.data.length):h.pictureData=h.data.subarray(g,h.data.length))))},"T*":function(h){h.data[0]===Is.Utf8&&(h.value=Pa(h.data,1,h.data.length).replace(/\0*$/,""),h.values=h.value.split("\0"))},TXXX:function(h){var g;h.data[0]===Is.Utf8&&(g=Ii(h.data,0,1),g!==-1&&(h.description=Pa(h.data,1,g),h.value=Pa(h.data,g+1,h.data.length).replace(/\0*$/,""),h.data=h.value))},"W*":function(h){h.url=Ls(h.data,0,h.data.length).replace(/\0.*$/,"")},WXXX:function(h){var g;h.data[0]===Is.Utf8&&(g=Ii(h.data,0,1),g!==-1&&(h.description=Pa(h.data,1,g),h.url=Ls(h.data,g+1,h.data.length).replace(/\0.*$/,"")))},PRIV:function(h){var g;for(g=0;g>>2;Be*=4,Be+=ue[7]&3,H.timeStamp=Be,O.pts===void 0&&O.dts===void 0&&(O.pts=H.timeStamp,O.dts=H.timeStamp),this.trigger("timestamp",H)}O.frames.push(H),R+=10,R+=j}while(R>>4>1&&(w+=b[w]+1),E.pid===0)E.type="pat",h(b.subarray(w),E),this.trigger("data",E);else if(E.pid===this.pmtPid)for(E.type="pmt",h(b.subarray(w),E),this.trigger("data",E);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([b,w,E]):this.processPes_(b,w,E)},this.processPes_=function(b,E,w){w.pid===this.programMapTable.video?w.streamType=Nn.H264_STREAM_TYPE:w.pid===this.programMapTable.audio?w.streamType=Nn.ADTS_STREAM_TYPE:w.streamType=this.programMapTable["timed-metadata"][w.pid],w.type="pes",w.data=b.subarray(E),this.trigger("data",w)}},Ba.prototype=new $o,Ba.STREAM_TYPES={h264:27,adts:15},qa=function(){var h=this,g=!1,y={data:[],size:0},T={data:[],size:0},b={data:[],size:0},E,w=function(R,j){var H;const J=R[0]<<16|R[1]<<8|R[2];j.data=new Uint8Array,J===1&&(j.packetLength=6+(R[4]<<8|R[5]),j.dataAlignmentIndicator=(R[6]&4)!==0,H=R[7],H&192&&(j.pts=(R[9]&14)<<27|(R[10]&255)<<20|(R[11]&254)<<12|(R[12]&255)<<5|(R[13]&254)>>>3,j.pts*=4,j.pts+=(R[13]&6)>>>1,j.dts=j.pts,H&64&&(j.dts=(R[14]&14)<<27|(R[15]&255)<<20|(R[16]&254)<<12|(R[17]&255)<<5|(R[18]&254)>>>3,j.dts*=4,j.dts+=(R[18]&6)>>>1)),j.data=R.subarray(9+R[8]))},O=function(R,j,H){var J=new Uint8Array(R.size),Ee={type:j},ue=0,Be=0,Ye=!1,ni;if(!(!R.data.length||R.size<9)){for(Ee.trackId=R.data[0].pid,ue=0;ue>5,R=((g[b+6]&3)+1)*1024,j=R*Qp/Gp[(g[b+2]&60)>>>2],g.byteLength-b>>6&3)+1,channelcount:(g[b+2]&1)<<2|(g[b+3]&192)>>>6,samplerate:Gp[(g[b+2]&60)>>>2],samplingfrequencyindex:(g[b+2]&60)>>>2,samplesize:16,data:g.subarray(b+7+w,b+E)}),y++,b+=E}typeof H=="number"&&(this.skipWarn_(H,b),H=null),g=g.subarray(b)}},this.flush=function(){y=0,this.trigger("done")},this.reset=function(){g=void 0,this.trigger("reset")},this.endTimeline=function(){g=void 0,this.trigger("endedtimeline")}},Ru.prototype=new Yo;var Vy=Ru,Xp;Xp=function(h){var g=h.byteLength,y=0,T=0;this.length=function(){return 8*g},this.bitsAvailable=function(){return 8*g+T},this.loadWord=function(){var b=h.byteLength-g,E=new Uint8Array(4),w=Math.min(4,g);if(w===0)throw new Error("no bytes available");E.set(h.subarray(b,b+w)),y=new DataView(E.buffer).getUint32(0),T=w*8,g-=w},this.skipBits=function(b){var E;T>b?(y<<=b,T-=b):(b-=T,E=Math.floor(b/8),b-=E*8,g-=E,this.loadWord(),y<<=b,T-=b)},this.readBits=function(b){var E=Math.min(T,b),w=y>>>32-E;return T-=E,T>0?y<<=E:g>0&&this.loadWord(),E=b-E,E>0?w<>>b)return y<<=b,T-=b,b;return this.loadWord(),b+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var b=this.skipLeadingZeros();return this.readBits(b+1)-1},this.readExpGolomb=function(){var b=this.readUnsignedExpGolomb();return 1&b?1+b>>>1:-1*(b>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Qo=Xp,ju=i,Wp=Qo,Go,js,Yd;js=function(){var h=0,g,y;js.prototype.init.call(this),this.push=function(T){var b;y?(b=new Uint8Array(y.byteLength+T.data.byteLength),b.set(y),b.set(T.data,y.byteLength),y=b):y=T.data;for(var E=y.byteLength;h3&&this.trigger("data",y.subarray(h+3)),y=null,h=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},js.prototype=new ju,Yd={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Go=function(){var h=new js,g,y,T,b,E,w,O;Go.prototype.init.call(this),g=this,this.push=function(R){R.type==="video"&&(y=R.trackId,T=R.pts,b=R.dts,h.push(R))},h.on("data",function(R){var j={trackId:y,pts:T,dts:b,data:R,nalUnitTypeCode:R[0]&31};switch(j.nalUnitTypeCode){case 5:j.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:j.nalUnitType="sei_rbsp",j.escapedRBSP=E(R.subarray(1));break;case 7:j.nalUnitType="seq_parameter_set_rbsp",j.escapedRBSP=E(R.subarray(1)),j.config=w(j.escapedRBSP);break;case 8:j.nalUnitType="pic_parameter_set_rbsp";break;case 9:j.nalUnitType="access_unit_delimiter_rbsp";break}g.trigger("data",j)}),h.on("done",function(){g.trigger("done")}),h.on("partialdone",function(){g.trigger("partialdone")}),h.on("reset",function(){g.trigger("reset")}),h.on("endedtimeline",function(){g.trigger("endedtimeline")}),this.flush=function(){h.flush()},this.partialFlush=function(){h.partialFlush()},this.reset=function(){h.reset()},this.endTimeline=function(){h.endTimeline()},O=function(R,j){var H=8,J=8,Ee,ue;for(Ee=0;Ee>4;return y=y>=0?y:0,b?y+20:y+10},qi=function(h,g){return h.length-g<10||h[g]!=="I".charCodeAt(0)||h[g+1]!=="D".charCodeAt(0)||h[g+2]!=="3".charCodeAt(0)?g:(g+=Qd(h,g),qi(h,g))},$y=function(h){var g=qi(h,0);return h.length>=g+2&&(h[g]&255)===255&&(h[g+1]&240)===240&&(h[g+1]&22)===16},Pu=function(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]},Kp=function(h,g,y){var T,b="";for(T=g;T>5,T=h[g+4]<<3,b=h[g+3]&6144;return b|T|y},Qy=function(h,g){return h[g]==="I".charCodeAt(0)&&h[g+1]==="D".charCodeAt(0)&&h[g+2]==="3".charCodeAt(0)?"timed-metadata":h[g]&!0&&(h[g+1]&240)===240?"audio":null},Jp=function(h){for(var g=0;g+5>>2]}return null},Gy=function(h){var g,y,T,b;g=10,h[5]&64&&(g+=4,g+=Pu(h.subarray(10,14)));do{if(y=Pu(h.subarray(g+4,g+8)),y<1)return null;if(b=String.fromCharCode(h[g],h[g+1],h[g+2],h[g+3]),b==="PRIV"){T=h.subarray(g+10,g+y+10);for(var E=0;E>>2;return R*=4,R+=O[7]&3,R}break}}g+=10,g+=y}while(g=3;){if(h[b]==="I".charCodeAt(0)&&h[b+1]==="D".charCodeAt(0)&&h[b+2]==="3".charCodeAt(0)){if(h.length-b<10||(T=Xo.parseId3TagSize(h,b),b+T>h.length))break;w={type:"timed-metadata",data:h.subarray(b,b+T)},this.trigger("data",w),b+=T;continue}else if((h[b]&255)===255&&(h[b+1]&240)===240){if(h.length-b<7||(T=Xo.parseAdtsSize(h,b),b+T>h.length))break;O={type:"audio",data:h.subarray(b,b+T),pts:g,dts:g},this.trigger("data",O),b+=T;continue}b++}E=h.length-b,E>0?h=h.subarray(b):h=new Uint8Array},this.reset=function(){h=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){h=new Uint8Array,this.trigger("endedtimeline")}},Wo.prototype=new Xy;var em=Wo,tm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Wy=tm,Ky=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Zy=Ky,qu=i,Ko=Fe,zs=Tt,Zo=Ce,kn=tt,us=Yp,Jo=vt,Fu=Vy,im=zu.H264Stream,Kr=em,Zr=Bu.isLikelyAacData,Yn=vt.ONE_SECOND_IN_TS,Fi=Wy,Fa=Zy,dr,hr,xi,fr,Hu=function(h,g){g.stream=h,this.trigger("log",g)},pr=function(h,g){for(var y=Object.keys(g),T=0;T=-j&&J<=R&&(!Ee||H>J)&&(Ee=Be,H=J)));return Ee?Ee.gop:null},this.alignGopsAtStart_=function(O){var R,j,H,J,Ee,ue,Be,Ye;for(Ee=O.byteLength,ue=O.nalCount,Be=O.duration,R=j=0;RH.pts){R++;continue}j++,Ee-=J.byteLength,ue-=J.nalCount,Be-=J.duration}return j===0?O:j===O.length?null:(Ye=O.slice(j),Ye.byteLength=Ee,Ye.duration=Be,Ye.nalCount=ue,Ye.pts=Ye[0].pts,Ye.dts=Ye[0].dts,Ye)},this.alignGopsAtEnd_=function(O){var R,j,H,J,Ee,ue;for(R=b.length-1,j=O.length-1,Ee=null,ue=!1;R>=0&&j>=0;){if(H=b[R],J=O[j],H.pts===J.pts){ue=!0;break}if(H.pts>J.pts){R--;continue}R===b.length-1&&(Ee=j),j--}if(!ue&&Ee===null)return null;var Be;if(ue?Be=j:Be=Ee,Be===0)return O;var Ye=O.slice(Be),ni=Ye.reduce(function(Li,hs){return Li.byteLength+=hs.byteLength,Li.duration+=hs.duration,Li.nalCount+=hs.nalCount,Li},{byteLength:0,duration:0,nalCount:0});return Ye.byteLength=ni.byteLength,Ye.duration=ni.duration,Ye.nalCount=ni.nalCount,Ye.pts=Ye[0].pts,Ye.dts=Ye[0].dts,Ye},this.alignGopsWith=function(O){b=O}},dr.prototype=new qu,fr=function(h,g){this.numberOfTracks=0,this.metadataStream=g,h=h||{},typeof h.remux<"u"?this.remuxTracks=!!h.remux:this.remuxTracks=!0,typeof h.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=h.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,fr.prototype.init.call(this),this.push=function(y){if(y.content||y.text)return this.pendingCaptions.push(y);if(y.frames)return this.pendingMetadata.push(y);this.pendingTracks.push(y.track),this.pendingBytes+=y.boxes.byteLength,y.track.type==="video"&&(this.videoTrack=y.track,this.pendingBoxes.push(y.boxes)),y.track.type==="audio"&&(this.audioTrack=y.track,this.pendingBoxes.unshift(y.boxes))}},fr.prototype=new qu,fr.prototype.flush=function(h){var g=0,y={captions:[],captionStreams:{},metadata:[],info:{}},T,b,E,w=0,O;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(w=this.videoTrack.timelineStartInfo.pts,Fa.forEach(function(R){y.info[R]=this.videoTrack[R]},this)):this.audioTrack&&(w=this.audioTrack.timelineStartInfo.pts,Fi.forEach(function(R){y.info[R]=this.audioTrack[R]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?y.type=this.pendingTracks[0].type:y.type="combined",this.emittedTracks+=this.pendingTracks.length,E=Ko.initSegment(this.pendingTracks),y.initSegment=new Uint8Array(E.byteLength),y.initSegment.set(E),y.data=new Uint8Array(this.pendingBytes),O=0;O=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},fr.prototype.setRemux=function(h){this.remuxTracks=h},xi=function(h){var g=this,y=!0,T,b;xi.prototype.init.call(this),h=h||{},this.baseMediaDecodeTime=h.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var E={};this.transmuxPipeline_=E,E.type="aac",E.metadataStream=new us.MetadataStream,E.aacStream=new Kr,E.audioTimestampRolloverStream=new us.TimestampRolloverStream("audio"),E.timedMetadataTimestampRolloverStream=new us.TimestampRolloverStream("timed-metadata"),E.adtsStream=new Fu,E.coalesceStream=new fr(h,E.metadataStream),E.headOfPipeline=E.aacStream,E.aacStream.pipe(E.audioTimestampRolloverStream).pipe(E.adtsStream),E.aacStream.pipe(E.timedMetadataTimestampRolloverStream).pipe(E.metadataStream).pipe(E.coalesceStream),E.metadataStream.on("timestamp",function(w){E.aacStream.setTimestamp(w.timeStamp)}),E.aacStream.on("data",function(w){w.type!=="timed-metadata"&&w.type!=="audio"||E.audioSegmentStream||(b=b||{timelineStartInfo:{baseMediaDecodeTime:g.baseMediaDecodeTime},codec:"adts",type:"audio"},E.coalesceStream.numberOfTracks++,E.audioSegmentStream=new hr(b,h),E.audioSegmentStream.on("log",g.getLogTrigger_("audioSegmentStream")),E.audioSegmentStream.on("timingInfo",g.trigger.bind(g,"audioTimingInfo")),E.adtsStream.pipe(E.audioSegmentStream).pipe(E.coalesceStream),g.trigger("trackinfo",{hasAudio:!!b,hasVideo:!!T}))}),E.coalesceStream.on("data",this.trigger.bind(this,"data")),E.coalesceStream.on("done",this.trigger.bind(this,"done")),pr(this,E)},this.setupTsPipeline=function(){var E={};this.transmuxPipeline_=E,E.type="ts",E.metadataStream=new us.MetadataStream,E.packetStream=new us.TransportPacketStream,E.parseStream=new us.TransportParseStream,E.elementaryStream=new us.ElementaryStream,E.timestampRolloverStream=new us.TimestampRolloverStream,E.adtsStream=new Fu,E.h264Stream=new im,E.captionStream=new us.CaptionStream(h),E.coalesceStream=new fr(h,E.metadataStream),E.headOfPipeline=E.packetStream,E.packetStream.pipe(E.parseStream).pipe(E.elementaryStream).pipe(E.timestampRolloverStream),E.timestampRolloverStream.pipe(E.h264Stream),E.timestampRolloverStream.pipe(E.adtsStream),E.timestampRolloverStream.pipe(E.metadataStream).pipe(E.coalesceStream),E.h264Stream.pipe(E.captionStream).pipe(E.coalesceStream),E.elementaryStream.on("data",function(w){var O;if(w.type==="metadata"){for(O=w.tracks.length;O--;)!T&&w.tracks[O].type==="video"?(T=w.tracks[O],T.timelineStartInfo.baseMediaDecodeTime=g.baseMediaDecodeTime):!b&&w.tracks[O].type==="audio"&&(b=w.tracks[O],b.timelineStartInfo.baseMediaDecodeTime=g.baseMediaDecodeTime);T&&!E.videoSegmentStream&&(E.coalesceStream.numberOfTracks++,E.videoSegmentStream=new dr(T,h),E.videoSegmentStream.on("log",g.getLogTrigger_("videoSegmentStream")),E.videoSegmentStream.on("timelineStartInfo",function(R){b&&!h.keepOriginalTimestamps&&(b.timelineStartInfo=R,E.audioSegmentStream.setEarliestDts(R.dts-g.baseMediaDecodeTime))}),E.videoSegmentStream.on("processedGopsInfo",g.trigger.bind(g,"gopInfo")),E.videoSegmentStream.on("segmentTimingInfo",g.trigger.bind(g,"videoSegmentTimingInfo")),E.videoSegmentStream.on("baseMediaDecodeTime",function(R){b&&E.audioSegmentStream.setVideoBaseMediaDecodeTime(R)}),E.videoSegmentStream.on("timingInfo",g.trigger.bind(g,"videoTimingInfo")),E.h264Stream.pipe(E.videoSegmentStream).pipe(E.coalesceStream)),b&&!E.audioSegmentStream&&(E.coalesceStream.numberOfTracks++,E.audioSegmentStream=new hr(b,h),E.audioSegmentStream.on("log",g.getLogTrigger_("audioSegmentStream")),E.audioSegmentStream.on("timingInfo",g.trigger.bind(g,"audioTimingInfo")),E.audioSegmentStream.on("segmentTimingInfo",g.trigger.bind(g,"audioSegmentTimingInfo")),E.adtsStream.pipe(E.audioSegmentStream).pipe(E.coalesceStream)),g.trigger("trackinfo",{hasAudio:!!b,hasVideo:!!T})}}),E.coalesceStream.on("data",this.trigger.bind(this,"data")),E.coalesceStream.on("id3Frame",function(w){w.dispatchType=E.metadataStream.dispatchType,g.trigger("id3Frame",w)}),E.coalesceStream.on("caption",this.trigger.bind(this,"caption")),E.coalesceStream.on("done",this.trigger.bind(this,"done")),pr(this,E)},this.setBaseMediaDecodeTime=function(E){var w=this.transmuxPipeline_;h.keepOriginalTimestamps||(this.baseMediaDecodeTime=E),b&&(b.timelineStartInfo.dts=void 0,b.timelineStartInfo.pts=void 0,kn.clearDtsInfo(b),w.audioTimestampRolloverStream&&w.audioTimestampRolloverStream.discontinuity()),T&&(w.videoSegmentStream&&(w.videoSegmentStream.gopCache_=[]),T.timelineStartInfo.dts=void 0,T.timelineStartInfo.pts=void 0,kn.clearDtsInfo(T),w.captionStream.reset()),w.timestampRolloverStream&&w.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(E){b&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(E)},this.setRemux=function(E){var w=this.transmuxPipeline_;h.remux=E,w&&w.coalesceStream&&w.coalesceStream.setRemux(E)},this.alignGopsWith=function(E){T&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(E)},this.getLogTrigger_=function(E){var w=this;return function(O){O.stream=E,w.trigger("log",O)}},this.push=function(E){if(y){var w=Zr(E);w&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!w&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),y=!1}this.transmuxPipeline_.headOfPipeline.push(E)},this.flush=function(){y=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},xi.prototype=new qu;var nm={Transmuxer:xi,VideoSegmentStream:dr,AudioSegmentStream:hr,AUDIO_PROPERTIES:Fi,VIDEO_PROPERTIES:Fa,generateSegmentTimingInfo:$u},Gd=function(h){return h>>>0},Jy=function(h){return("00"+h.toString(16)).slice(-2)},Ha={toUnsigned:Gd,toHexString:Jy},Us=function(h){var g="";return g+=String.fromCharCode(h[0]),g+=String.fromCharCode(h[1]),g+=String.fromCharCode(h[2]),g+=String.fromCharCode(h[3]),g},Yu=Us,Xd=Ha.toUnsigned,Qu=Yu,mr=function(h,g){var y=[],T,b,E,w,O;if(!g.length)return null;for(T=0;T1?T+b:h.byteLength,E===g[0]&&(g.length===1?y.push(h.subarray(T+8,w)):(O=mr(h.subarray(T+8,w),g.slice(1)),O.length&&(y=y.concat(O)))),T=w;return y},Va=mr,Wd=Ha.toUnsigned,Jr=l.getUint64,sm=function(h){var g={version:h[0],flags:new Uint8Array(h.subarray(1,4))};return g.version===1?g.baseMediaDecodeTime=Jr(h.subarray(4)):g.baseMediaDecodeTime=Wd(h[4]<<24|h[5]<<16|h[6]<<8|h[7]),g},el=sm,Kd=function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={version:h[0],flags:new Uint8Array(h.subarray(1,4)),trackId:g.getUint32(4)},T=y.flags[2]&1,b=y.flags[2]&2,E=y.flags[2]&8,w=y.flags[2]&16,O=y.flags[2]&32,R=y.flags[0]&65536,j=y.flags[0]&131072,H;return H=8,T&&(H+=4,y.baseDataOffset=g.getUint32(12),H+=4),b&&(y.sampleDescriptionIndex=g.getUint32(H),H+=4),E&&(y.defaultSampleDuration=g.getUint32(H),H+=4),w&&(y.defaultSampleSize=g.getUint32(H),H+=4),O&&(y.defaultSampleFlags=g.getUint32(H)),R&&(y.durationIsEmpty=!0),!T&&j&&(y.baseDataOffsetIsMoof=!0),y},Ps=Kd,gr=l.getUint64,Zd=function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={version:h[0],flags:new Uint8Array(h.subarray(1,4)),references:[],referenceId:g.getUint32(4),timescale:g.getUint32(8)},T=12;y.version===0?(y.earliestPresentationTime=g.getUint32(T),y.firstOffset=g.getUint32(T+4),T+=8):(y.earliestPresentationTime=gr(h.subarray(T)),y.firstOffset=gr(h.subarray(T+8)),T+=16),T+=2;var b=g.getUint16(T);for(T+=2;b>0;T+=12,b--)y.references.push({referenceType:(h[T]&128)>>>7,referencedSize:g.getUint32(T)&2147483647,subsegmentDuration:g.getUint32(T+4),startsWithSap:!!(h[T+8]&128),sapType:(h[T+8]&112)>>>4,sapDeltaTime:g.getUint32(T+8)&268435455});return y},ea=Zd,rm=function(h){return{isLeading:(h[0]&12)>>>2,dependsOn:h[0]&3,isDependedOn:(h[1]&192)>>>6,hasRedundancy:(h[1]&48)>>>4,paddingValue:(h[1]&14)>>>1,isNonSyncSample:h[1]&1,degradationPriority:h[2]<<8|h[3]}},am=rm,$a=am,tl=function(h){var g={version:h[0],flags:new Uint8Array(h.subarray(1,4)),samples:[]},y=new DataView(h.buffer,h.byteOffset,h.byteLength),T=g.flags[2]&1,b=g.flags[2]&4,E=g.flags[1]&1,w=g.flags[1]&2,O=g.flags[1]&4,R=g.flags[1]&8,j=y.getUint32(4),H=8,J;for(T&&(g.dataOffset=y.getInt32(H),H+=4),b&&j&&(J={flags:$a(h.subarray(H,H+4))},H+=4,E&&(J.duration=y.getUint32(H),H+=4),w&&(J.size=y.getUint32(H),H+=4),R&&(g.version===1?J.compositionTimeOffset=y.getInt32(H):J.compositionTimeOffset=y.getUint32(H),H+=4),g.samples.push(J),j--);j--;)J={},E&&(J.duration=y.getUint32(H),H+=4),w&&(J.size=y.getUint32(H),H+=4),O&&(J.flags=$a(h.subarray(H,H+4)),H+=4),R&&(g.version===1?J.compositionTimeOffset=y.getInt32(H):J.compositionTimeOffset=y.getUint32(H),H+=4),g.samples.push(J);return g},Jd=tl,il=l,eh=il.getUint64,di,cs,ii=function(h){return new Date(h*1e3-20828448e5)},ta=Yu,th=Va,nl=function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y=[],T,b;for(T=0;T+4MALFORMED DATA");continue}switch(h[T]&31){case 1:y.push("slice_layer_without_partitioning_rbsp");break;case 5:y.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:y.push("sei_rbsp");break;case 7:y.push("seq_parameter_set_rbsp");break;case 8:y.push("pic_parameter_set_rbsp");break;case 9:y.push("access_unit_delimiter_rbsp");break;default:y.push("UNKNOWN NAL - "+h[T]&31);break}}return y},Qn={avc1:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength);return{dataReferenceIndex:g.getUint16(6),width:g.getUint16(24),height:g.getUint16(26),horizresolution:g.getUint16(28)+g.getUint16(30)/16,vertresolution:g.getUint16(32)+g.getUint16(34)/16,frameCount:g.getUint16(40),depth:g.getUint16(74),config:di(h.subarray(78,h.byteLength))}},avcC:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={configurationVersion:h[0],avcProfileIndication:h[1],profileCompatibility:h[2],avcLevelIndication:h[3],lengthSizeMinusOne:h[4]&3,sps:[],pps:[]},T=h[5]&31,b,E,w,O;for(w=6,O=0;O>>2&63,bufferSize:h[13]<<16|h[14]<<8|h[15],maxBitrate:h[16]<<24|h[17]<<16|h[18]<<8|h[19],avgBitrate:h[20]<<24|h[21]<<16|h[22]<<8|h[23],decoderConfigDescriptor:{tag:h[24],length:h[25],audioObjectType:h[26]>>>3&31,samplingFrequencyIndex:(h[26]&7)<<1|h[27]>>>7&1,channelConfiguration:h[27]>>>3&15}}}},ftyp:function(h){for(var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={majorBrand:ta(h.subarray(0,4)),minorVersion:g.getUint32(4),compatibleBrands:[]},T=8;T>10)+96),b.language+=String.fromCharCode(((T&992)>>5)+96),b.language+=String.fromCharCode((T&31)+96),b},mdia:function(h){return{boxes:di(h)}},mfhd:function(h){return{version:h[0],flags:new Uint8Array(h.subarray(1,4)),sequenceNumber:h[4]<<24|h[5]<<16|h[6]<<8|h[7]}},minf:function(h){return{boxes:di(h)}},mp4a:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={dataReferenceIndex:g.getUint16(6),channelcount:g.getUint16(16),samplesize:g.getUint16(18),samplerate:g.getUint16(24)+g.getUint16(26)/65536};return h.byteLength>28&&(y.streamDescriptor=di(h.subarray(28))[0]),y},moof:function(h){return{boxes:di(h)}},moov:function(h){return{boxes:di(h)}},mvex:function(h){return{boxes:di(h)}},mvhd:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y=4,T={version:g.getUint8(0),flags:new Uint8Array(h.subarray(1,4))};return T.version===1?(y+=4,T.creationTime=ii(g.getUint32(y)),y+=8,T.modificationTime=ii(g.getUint32(y)),y+=4,T.timescale=g.getUint32(y),y+=8,T.duration=g.getUint32(y)):(T.creationTime=ii(g.getUint32(y)),y+=4,T.modificationTime=ii(g.getUint32(y)),y+=4,T.timescale=g.getUint32(y),y+=4,T.duration=g.getUint32(y)),y+=4,T.rate=g.getUint16(y)+g.getUint16(y+2)/16,y+=4,T.volume=g.getUint8(y)+g.getUint8(y+1)/8,y+=2,y+=2,y+=2*4,T.matrix=new Uint32Array(h.subarray(y,y+9*4)),y+=9*4,y+=6*4,T.nextTrackId=g.getUint32(y),T},pdin:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength);return{version:g.getUint8(0),flags:new Uint8Array(h.subarray(1,4)),rate:g.getUint32(4),initialDelay:g.getUint32(8)}},sdtp:function(h){var g={version:h[0],flags:new Uint8Array(h.subarray(1,4)),samples:[]},y;for(y=4;y>4,isDependedOn:(h[y]&12)>>2,hasRedundancy:h[y]&3});return g},sidx:ea,smhd:function(h){return{version:h[0],flags:new Uint8Array(h.subarray(1,4)),balance:h[4]+h[5]/256}},stbl:function(h){return{boxes:di(h)}},ctts:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={version:g.getUint8(0),flags:new Uint8Array(h.subarray(1,4)),compositionOffsets:[]},T=g.getUint32(4),b;for(b=8;T;b+=8,T--)y.compositionOffsets.push({sampleCount:g.getUint32(b),sampleOffset:g[y.version===0?"getUint32":"getInt32"](b+4)});return y},stss:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={version:g.getUint8(0),flags:new Uint8Array(h.subarray(1,4)),syncSamples:[]},T=g.getUint32(4),b;for(b=8;T;b+=4,T--)y.syncSamples.push(g.getUint32(b));return y},stco:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={version:h[0],flags:new Uint8Array(h.subarray(1,4)),chunkOffsets:[]},T=g.getUint32(4),b;for(b=8;T;b+=4,T--)y.chunkOffsets.push(g.getUint32(b));return y},stsc:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y=g.getUint32(4),T={version:h[0],flags:new Uint8Array(h.subarray(1,4)),sampleToChunks:[]},b;for(b=8;y;b+=12,y--)T.sampleToChunks.push({firstChunk:g.getUint32(b),samplesPerChunk:g.getUint32(b+4),sampleDescriptionIndex:g.getUint32(b+8)});return T},stsd:function(h){return{version:h[0],flags:new Uint8Array(h.subarray(1,4)),sampleDescriptions:di(h.subarray(8))}},stsz:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength),y={version:h[0],flags:new Uint8Array(h.subarray(1,4)),sampleSize:g.getUint32(4),entries:[]},T;for(T=12;T>6,sampleHasRedundancy:(h[21]&48)>>4,samplePaddingValue:(h[21]&14)>>1,sampleIsDifferenceSample:!!(h[21]&1),sampleDegradationPriority:g.getUint16(22)}},trun:Jd,"url ":function(h){return{version:h[0],flags:new Uint8Array(h.subarray(1,4))}},vmhd:function(h){var g=new DataView(h.buffer,h.byteOffset,h.byteLength);return{version:h[0],flags:new Uint8Array(h.subarray(1,4)),graphicsmode:g.getUint16(4),opcolor:new Uint16Array([g.getUint16(6),g.getUint16(8),g.getUint16(10)])}}};di=function(h){for(var g=0,y=[],T,b,E,w,O,R=new ArrayBuffer(h.length),j=new Uint8Array(R),H=0;H1?g+b:h.byteLength,O=(Qn[E]||function(J){return{data:J}})(h.subarray(g+8,w)),O.size=b,O.type=E,y.push(O),g=w;return y},cs=function(h,g){var y;return g=g||0,y=new Array(g*2+1).join(" "),h.map(function(T,b){return y+T.type+` @@ -480,22 +480,22 @@ browserWorkerPolyFill(self); `)}).join(` `)+(T.boxes?` `+cs(T.boxes,g+1):"")}).join(` -`)};var yr={inspect:di,textify:cs,parseType:ta,findBox:th,parseTraf:Qn.traf,parseTfdt:Qn.tfdt,parseHdlr:Qn.hdlr,parseTfhd:Qn.tfhd,parseTrun:Qn.trun,parseSidx:Qn.sidx},Vt=function(h){for(var g=0,y=String.fromCharCode(h[g]),T="";y!=="\0";)T+=y,g++,y=String.fromCharCode(h[g]);return T+=y,T},Gu={uint8ToCString:Vt},sl=Gu.uint8ToCString,ih=l.getUint64,ia=function(h){var g=4,y=h[0],T,b,E,w,O,R,j,H;if(y===0){T=sl(h.subarray(g)),g+=T.length,b=sl(h.subarray(g)),g+=b.length;var J=new DataView(h.buffer);E=J.getUint32(g),g+=4,O=J.getUint32(g),g+=4,R=J.getUint32(g),g+=4,j=J.getUint32(g),g+=4}else if(y===1){var J=new DataView(h.buffer);E=J.getUint32(g),g+=4,w=ih(h.subarray(g)),g+=8,R=J.getUint32(g),g+=4,j=J.getUint32(g),g+=4,T=sl(h.subarray(g)),g+=T.length,b=sl(h.subarray(g)),g+=b.length}H=new Uint8Array(h.subarray(g,h.byteLength));var Ee={scheme_id_uri:T,value:b,timescale:E||1,presentation_time:w,presentation_time_delta:O,event_duration:R,id:j,message_data:H};return Bs(y,Ee)?Ee:void 0},rl=function(h,g,y,T){return h||h===0?h/g:T+y/g},Bs=function(h,g){var y=g.scheme_id_uri!=="\0",T=h===0&&al(g.presentation_time_delta)&&y,b=h===1&&al(g.presentation_time)&&y;return!(h>1)&&T||b},al=function(h){return h!==void 0||h!==null},ol={parseEmsgBox:ia,scaleTime:rl},na;typeof window<"u"?na=window:typeof s<"u"?na=s:typeof self<"u"?na=self:na={};var Xu=na,ll=Ha.toUnsigned,nn=Ha.toHexString,bt=Va,qs=Yu,nh=ol,om=Ps,eT=Jd,sh=el,Wu=l.getUint64,rh,ah,oh,ul,lh,Ku,uh,cl=Xu,ch=Xr.parseId3Frames;rh=function(h){var g={},y=bt(h,["moov","trak"]);return y.reduce(function(T,b){var E,w,O,R,j;return E=bt(b,["tkhd"])[0],!E||(w=E[0],O=w===0?12:20,R=ll(E[O]<<24|E[O+1]<<16|E[O+2]<<8|E[O+3]),j=bt(b,["mdia","mdhd"])[0],!j)?null:(w=j[0],O=w===0?12:20,T[R]=ll(j[O]<<24|j[O+1]<<16|j[O+2]<<8|j[O+3]),T)},g)},ah=function(h,g){var y;y=bt(g,["moof","traf"]);var T=y.reduce(function(b,E){var w=bt(E,["tfhd"])[0],O=ll(w[4]<<24|w[5]<<16|w[6]<<8|w[7]),R=h[O]||9e4,j=bt(E,["tfdt"])[0],H=new DataView(j.buffer,j.byteOffset,j.byteLength),J;j[0]===1?J=Wu(j.subarray(4,12)):J=H.getUint32(4);let Ee;return typeof J=="bigint"?Ee=J/cl.BigInt(R):typeof J=="number"&&!isNaN(J)&&(Ee=J/R),Ee11?(b.codec+=".",b.codec+=nn(ue[9]),b.codec+=nn(ue[10]),b.codec+=nn(ue[11])):b.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(b.codec)?(ue=Ee.subarray(28),Be=qs(ue.subarray(4,8)),Be==="esds"&&ue.length>20&&ue[19]!==0?(b.codec+="."+nn(ue[19]),b.codec+="."+nn(ue[20]>>>2&63).replace(/^0/,"")):b.codec="mp4a.40.2"):b.codec=b.codec.toLowerCase())}var Ye=bt(T,["mdia","mdhd"])[0];Ye&&(b.timescale=Ku(Ye)),y.push(b)}),y},uh=function(h,g=0){var y=bt(h,["emsg"]);return y.map(T=>{var b=nh.parseEmsgBox(new Uint8Array(T)),E=ch(b.message_data);return{cueTime:nh.scaleTime(b.presentation_time,b.timescale,b.presentation_time_delta,g),duration:nh.scaleTime(b.event_duration,b.timescale),frames:E}})};var On={findBox:bt,parseType:qs,timescale:rh,startTime:ah,compositionStartTime:oh,videoTrackIds:ul,tracks:lh,getTimescaleFromMediaHeader:Ku,getEmsgID3:uh};const{parseTrun:Tr}=yr,{findBox:Ya}=On;var dl=Xu,hl=function(h){var g=Ya(h,["moof","traf"]),y=Ya(h,["mdat"]),T=[];return y.forEach(function(b,E){var w=g[E];T.push({mdat:b,traf:w})}),T},fl=function(h,g,y){var T=g,b=y.defaultSampleDuration||0,E=y.defaultSampleSize||0,w=y.trackId,O=[];return h.forEach(function(R){var j=Tr(R),H=j.samples;H.forEach(function(J){J.duration===void 0&&(J.duration=b),J.size===void 0&&(J.size=E),J.trackId=w,J.dts=T,J.compositionTimeOffset===void 0&&(J.compositionTimeOffset=0),typeof T=="bigint"?(J.pts=T+dl.BigInt(J.compositionTimeOffset),T+=dl.BigInt(J.duration)):(J.pts=T+J.compositionTimeOffset,T+=J.duration)}),O=O.concat(H)}),O},dh={getMdatTrafPairs:hl,parseSamples:fl},tT=Bd.discardEmulationPreventionBytes,lm=wu.CaptionStream,Zu=Va,hh=el,fh=Ps,{getMdatTrafPairs:lt,parseSamples:Te}=dh,Qa=function(h,g){for(var y=h,T=0;T0?hh(H[0]).baseMediaDecodeTime:0,Ee=Zu(w,["trun"]),ue,Be;g===j&&Ee.length>0&&(ue=Te(Ee,J,R),Be=Ju(E,ue,j),y[j]||(y[j]={seiNals:[],logs:[]}),y[j].seiNals=y[j].seiNals.concat(Be.seiNals),y[j].logs=y[j].logs.concat(Be.logs))}),y},ph=function(h,g,y){var T;if(g===null)return null;T=Jt(h,g);var b=T[g]||{};return{seiNals:b.seiNals,logs:b.logs,timescale:y}},mh=function(){var h=!1,g,y,T,b,E,w;this.isInitialized=function(){return h},this.init=function(O){g=new lm,h=!0,w=O?O.isPartial:!1,g.on("data",function(R){R.startTime=R.startPts/b,R.endTime=R.endPts/b,E.captions.push(R),E.captionStreams[R.stream]=!0}),g.on("log",function(R){E.logs.push(R)})},this.isNewInit=function(O,R){return O&&O.length===0||R&&typeof R=="object"&&Object.keys(R).length===0?!1:T!==O[0]||b!==R[T]},this.parse=function(O,R,j){var H;if(this.isInitialized()){if(!R||!j)return null;if(this.isNewInit(R,j))T=R[0],b=j[T];else if(T===null||!b)return y.push(O),null}else return null;for(;y.length>0;){var J=y.shift();this.parse(J,R,j)}return H=ph(O,T,b),H&&H.logs&&(E.logs=E.logs.concat(H.logs)),H===null||!H.seiNals?E.logs.length?{logs:E.logs,captions:[],captionStreams:[]}:null:(this.pushNals(H.seiNals),this.flushStream(),E)},this.pushNals=function(O){if(!this.isInitialized()||!O||O.length===0)return null;O.forEach(function(R){g.push(R)})},this.flushStream=function(){if(!this.isInitialized())return null;w?g.partialFlush():g.flush()},this.clearParsedCaptions=function(){E.captions=[],E.captionStreams={},E.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;g.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){y=[],T=null,b=null,E?this.clearParsedCaptions():E={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},um=mh;const{parseTfdt:gh}=yr,vr=Va,{getTimescaleFromMediaHeader:yh}=On,{parseSamples:Th,getMdatTrafPairs:vh}=dh;var _t=function(){let h=9e4;this.init=function(g){const y=vr(g,["moov","trak","mdia","mdhd"])[0];y&&(h=yh(y))},this.parseSegment=function(g){const y=[],T=vh(g);let b=0;return T.forEach(function(E){const w=E.mdat,O=E.traf,R=vr(O,["tfdt"])[0],j=vr(O,["tfhd"])[0],H=vr(O,["trun"]);if(R&&(b=gh(R).baseMediaDecodeTime),H.length&&j){const J=Th(H,b,j);let Ee=0;J.forEach(function(ue){const Be="utf-8",Ye=new TextDecoder(Be),ni=w.slice(Ee,Ee+ue.size);if(vr(ni,["vtte"])[0]){Ee+=ue.size;return}vr(ni,["vttc"]).forEach(function(_r){const ra=vr(_r,["payl"])[0],Wa=vr(_r,["sttg"])[0],Ka=ue.pts/h,Za=(ue.pts+ue.duration)/h;let Lt,Ja;if(ra)try{Lt=Ye.decode(ra)}catch(fn){console.error(fn)}if(Wa)try{Ja=Ye.decode(Wa)}catch(fn){console.error(fn)}ue.duration&&Lt&&y.push({cueText:Lt,start:Ka,end:Za,settings:Ja})}),Ee+=ue.size})}}),y}},pl=Fo,Ga=function(h){var g=h[1]&31;return g<<=8,g|=h[2],g},Gn=function(h){return!!(h[1]&64)},ds=function(h){var g=0;return(h[3]&48)>>>4>1&&(g+=h[4]+1),g},Xn=function(h,g){var y=Ga(h);return y===0?"pat":y===g?"pmt":g?"pes":null},bh=function(h){var g=Gn(h),y=4+ds(h);return g&&(y+=h[y]+1),(h[y+10]&31)<<8|h[y+11]},Xa=function(h){var g={},y=Gn(h),T=4+ds(h);if(y&&(T+=h[T]+1),!!(h[T+5]&1)){var b,E,w;b=(h[T+1]&15)<<8|h[T+2],E=3+b-4,w=(h[T+10]&15)<<8|h[T+11];for(var O=12+w;O=h.byteLength)return null;var T=null,b;return b=h[y+7],b&192&&(T={},T.pts=(h[y+9]&14)<<27|(h[y+10]&255)<<20|(h[y+11]&254)<<12|(h[y+12]&255)<<5|(h[y+13]&254)>>>3,T.pts*=4,T.pts+=(h[y+13]&6)>>>1,T.dts=T.pts,b&64&&(T.dts=(h[y+14]&14)<<27|(h[y+15]&255)<<20|(h[y+16]&254)<<12|(h[y+17]&255)<<5|(h[y+18]&254)>>>3,T.dts*=4,T.dts+=(h[y+18]&6)>>>1)),T},gl=function(h){switch(h){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},ec=function(h){for(var g=4+ds(h),y=h.subarray(g),T=0,b=0,E=!1,w;b3&&(w=gl(y[b+3]&31),w==="slice_layer_without_partitioning_rbsp_idr"&&(E=!0)),E},cm={parseType:Xn,parsePat:bh,parsePmt:Xa,parsePayloadUnitStartIndicator:Gn,parsePesType:_h,parsePesTime:ml,videoPacketContainsKeyFrame:ec},Sh=Fo,sa=Hd.handleRollover,St={};St.ts=cm,St.aac=Bu;var br=vt.ONE_SECOND_IN_TS,Ei=188,In=71,xh=function(h,g){for(var y=0,T=Ei,b,E;T=0;){if(h[T]===In&&(h[b]===In||b===h.byteLength)){switch(E=h.subarray(T,b),w=St.ts.parseType(E,g.pid),w){case"pes":O=St.ts.parsePesType(E,g.table),R=St.ts.parsePayloadUnitStartIndicator(E),O==="audio"&&R&&(j=St.ts.parsePesTime(E),j&&(j.type="audio",y.audio.push(j),H=!0));break}if(H)break;T-=Ei,b-=Ei;continue}T--,b--}},dm=function(h,g,y){for(var T=0,b=Ei,E,w,O,R,j,H,J,Ee,ue=!1,Be={data:[],size:0};b=0;){if(h[T]===In&&h[b]===In){switch(E=h.subarray(T,b),w=St.ts.parseType(E,g.pid),w){case"pes":O=St.ts.parsePesType(E,g.table),R=St.ts.parsePayloadUnitStartIndicator(E),O==="video"&&R&&(j=St.ts.parsePesTime(E),j&&(j.type="video",y.video.push(j),ue=!0));break}if(ue)break;T-=Ei,b-=Ei;continue}T--,b--}},hm=function(h,g){if(h.audio&&h.audio.length){var y=g;(typeof y>"u"||isNaN(y))&&(y=h.audio[0].dts),h.audio.forEach(function(E){E.dts=sa(E.dts,y),E.pts=sa(E.pts,y),E.dtsTime=E.dts/br,E.ptsTime=E.pts/br})}if(h.video&&h.video.length){var T=g;if((typeof T>"u"||isNaN(T))&&(T=h.video[0].dts),h.video.forEach(function(E){E.dts=sa(E.dts,T),E.pts=sa(E.pts,T),E.dtsTime=E.dts/br,E.ptsTime=E.pts/br}),h.firstKeyFrame){var b=h.firstKeyFrame;b.dts=sa(b.dts,T),b.pts=sa(b.pts,T),b.dtsTime=b.dts/br,b.ptsTime=b.pts/br}}},iT=function(h){for(var g=!1,y=0,T=null,b=null,E=0,w=0,O;h.length-w>=3;){var R=St.aac.parseType(h,w);switch(R){case"timed-metadata":if(h.length-w<10){g=!0;break}if(E=St.aac.parseId3TagSize(h,w),E>h.length){g=!0;break}b===null&&(O=h.subarray(w,w+E),b=St.aac.parseAacTimestamp(O)),w+=E;break;case"audio":if(h.length-w<7){g=!0;break}if(E=St.aac.parseAdtsSize(h,w),E>h.length){g=!0;break}T===null&&(O=h.subarray(w,w+E),T=St.aac.parseSampleRate(O)),y++,w+=E;break;default:w++;break}if(g)return null}if(T===null||b===null)return null;var j=br/T,H={audio:[{type:"audio",dts:b,pts:b},{type:"audio",dts:b+y*1024*j,pts:b+y*1024*j}]};return H},fm=function(h){var g={pid:null,table:null},y={};xh(h,g);for(var T in g.table)if(g.table.hasOwnProperty(T)){var b=g.table[T];switch(b){case Sh.H264_STREAM_TYPE:y.video=[],dm(h,g,y),y.video.length===0&&delete y.video;break;case Sh.ADTS_STREAM_TYPE:y.audio=[],Eh(h,g,y),y.audio.length===0&&delete y.audio;break}}return y},pm=function(h,g){var y=St.aac.isLikelyAacData(h),T;return y?T=iT(h):T=fm(h),!T||!T.audio&&!T.video?null:(hm(T,g),T)},mm={inspect:pm,parseAudioPes_:Eh};const Mh=function(h,g){g.on("data",function(y){const T=y.initSegment;y.initSegment={data:T.buffer,byteOffset:T.byteOffset,byteLength:T.byteLength};const b=y.data;y.data=b.buffer,h.postMessage({action:"data",segment:y,byteOffset:b.byteOffset,byteLength:b.byteLength},[y.data])}),g.on("done",function(y){h.postMessage({action:"done"})}),g.on("gopInfo",function(y){h.postMessage({action:"gopInfo",gopInfo:y})}),g.on("videoSegmentTimingInfo",function(y){const T={start:{decode:vt.videoTsToSeconds(y.start.dts),presentation:vt.videoTsToSeconds(y.start.pts)},end:{decode:vt.videoTsToSeconds(y.end.dts),presentation:vt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:vt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(T.prependedContentDuration=vt.videoTsToSeconds(y.prependedContentDuration)),h.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:T})}),g.on("audioSegmentTimingInfo",function(y){const T={start:{decode:vt.videoTsToSeconds(y.start.dts),presentation:vt.videoTsToSeconds(y.start.pts)},end:{decode:vt.videoTsToSeconds(y.end.dts),presentation:vt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:vt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(T.prependedContentDuration=vt.videoTsToSeconds(y.prependedContentDuration)),h.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:T})}),g.on("id3Frame",function(y){h.postMessage({action:"id3Frame",id3Frame:y})}),g.on("caption",function(y){h.postMessage({action:"caption",caption:y})}),g.on("trackinfo",function(y){h.postMessage({action:"trackinfo",trackInfo:y})}),g.on("audioTimingInfo",function(y){h.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:vt.videoTsToSeconds(y.start),end:vt.videoTsToSeconds(y.end)}})}),g.on("videoTimingInfo",function(y){h.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:vt.videoTsToSeconds(y.start),end:vt.videoTsToSeconds(y.end)}})}),g.on("log",function(y){h.postMessage({action:"log",log:y})})};class Dh{constructor(g,y){this.options=y||{},this.self=g,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new nm.Transmuxer(this.options),Mh(this.self,this.transmuxer)}pushMp4Captions(g){this.captionParser||(this.captionParser=new um,this.captionParser.init());const y=new Uint8Array(g.data,g.byteOffset,g.byteLength),T=this.captionParser.parse(y,g.trackIds,g.timescales);this.self.postMessage({action:"mp4Captions",captions:T&&T.captions||[],logs:T&&T.logs||[],data:y.buffer},[y.buffer])}initMp4WebVttParser(g){this.webVttParser||(this.webVttParser=new _t);const y=new Uint8Array(g.data,g.byteOffset,g.byteLength);this.webVttParser.init(y)}getMp4WebVttText(g){this.webVttParser||(this.webVttParser=new _t);const y=new Uint8Array(g.data,g.byteOffset,g.byteLength),T=this.webVttParser.parseSegment(y);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:T||[],data:y.buffer},[y.buffer])}probeMp4StartTime({timescales:g,data:y}){const T=On.startTime(g,y);this.self.postMessage({action:"probeMp4StartTime",startTime:T,data:y},[y.buffer])}probeMp4Tracks({data:g}){const y=On.tracks(g);this.self.postMessage({action:"probeMp4Tracks",tracks:y,data:g},[g.buffer])}probeEmsgID3({data:g,offset:y}){const T=On.getEmsgID3(g,y);this.self.postMessage({action:"probeEmsgID3",id3Frames:T,emsgData:g},[g.buffer])}probeTs({data:g,baseStartTime:y}){const T=typeof y=="number"&&!isNaN(y)?y*vt.ONE_SECOND_IN_TS:void 0,b=mm.inspect(g,T);let E=null;b&&(E={hasVideo:b.video&&b.video.length===2||!1,hasAudio:b.audio&&b.audio.length===2||!1},E.hasVideo&&(E.videoStart=b.video[0].ptsTime),E.hasAudio&&(E.audioStart=b.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:E,data:g},[g.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(g){const y=new Uint8Array(g.data,g.byteOffset,g.byteLength);this.transmuxer.push(y)}reset(){this.transmuxer.reset()}setTimestampOffset(g){const y=g.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(vt.secondsToVideoTs(y)))}setAudioAppendStart(g){this.transmuxer.setAudioAppendStart(Math.ceil(vt.secondsToVideoTs(g.appendStart)))}setRemux(g){this.transmuxer.setRemux(g.remux)}flush(g){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(g){this.transmuxer.alignGopsWith(g.gopsToAlignWith.slice())}}self.onmessage=function(h){if(h.data.action==="init"&&h.data.options){this.messageHandlers=new Dh(self,h.data.options);return}this.messageHandlers||(this.messageHandlers=new Dh(self)),h.data&&h.data.action&&h.data.action!=="init"&&this.messageHandlers[h.data.action]&&this.messageHandlers[h.data.action](h.data)}}));var nI=$S(iI);const sI=(s,e,i)=>{const{type:r,initSegment:o,captions:l,captionStreams:c,metadata:f,videoFrameDtsTime:p,videoFramePtsTime:v}=s.data.segment;e.buffer.push({captions:l,captionStreams:c,metadata:f});const S=s.data.segment.boxes||{data:s.data.segment.data},x={type:r,data:new Uint8Array(S.data,S.data.byteOffset,S.data.byteLength),initSegment:new Uint8Array(o.data,o.byteOffset,o.byteLength)};typeof p<"u"&&(x.videoFrameDtsTime=p),typeof v<"u"&&(x.videoFramePtsTime=v),i(x)},rI=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},aI=(s,e)=>{e.gopInfo=s.data.gopInfo},GS=s=>{const{transmuxer:e,bytes:i,audioAppendStart:r,gopsToAlignWith:o,remux:l,onData:c,onTrackInfo:f,onAudioTimingInfo:p,onVideoTimingInfo:v,onVideoSegmentTimingInfo:S,onAudioSegmentTimingInfo:x,onId3:D,onCaptions:k,onDone:I,onEndedTimeline:C,onTransmuxerLog:P,isEndOfTimeline:U,segment:Y,triggerSegmentEventFn:$}=s,G={buffer:[]};let W=U;const oe=de=>{e.currentTransmux===s&&(de.data.action==="data"&&sI(de,G,c),de.data.action==="trackinfo"&&f(de.data.trackInfo),de.data.action==="gopInfo"&&aI(de,G),de.data.action==="audioTimingInfo"&&p(de.data.audioTimingInfo),de.data.action==="videoTimingInfo"&&v(de.data.videoTimingInfo),de.data.action==="videoSegmentTimingInfo"&&S(de.data.videoSegmentTimingInfo),de.data.action==="audioSegmentTimingInfo"&&x(de.data.audioSegmentTimingInfo),de.data.action==="id3Frame"&&D([de.data.id3Frame],de.data.id3Frame.dispatchType),de.data.action==="caption"&&k(de.data.caption),de.data.action==="endedtimeline"&&(W=!1,C()),de.data.action==="log"&&P(de.data.log),de.data.type==="transmuxed"&&(W||(e.onmessage=null,rI({transmuxedData:G,callback:I}),XS(e))))},K=()=>{const de={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:Po({segment:Y})}};I(null,de)};if(e.onmessage=oe,e.onerror=K,r&&e.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(o)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:o}),typeof l<"u"&&e.postMessage({action:"setRemux",remux:l}),i.byteLength){const de=i instanceof ArrayBuffer?i:i.buffer,fe=i instanceof ArrayBuffer?0:i.byteOffset;$({type:"segmenttransmuxingstart",segment:Y}),e.postMessage({action:"push",data:de,byteOffset:fe,byteLength:i.byteLength},[de])}U&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},XS=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():GS(s.currentTransmux))},WS=(s,e)=>{s.postMessage({action:e}),XS(s)},KS=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,WS(e,s);return}e.transmuxQueue.push(WS.bind(null,e,s))},oI=s=>{KS("reset",s)},lI=s=>{KS("endTimeline",s)},ZS=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,GS(s);return}s.transmuxer.transmuxQueue.push(s)};var wy={reset:oI,endTimeline:lI,transmux:ZS,createTransmuxer:s=>{const e=new nI;e.currentTransmux=null,e.transmuxQueue=[];const i=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,i.call(e)),e.postMessage({action:"init",options:s}),e}};const Su=function(s){const e=s.transmuxer,i=s.endAction||s.action,r=s.callback,o=ei({},s,{endAction:null,transmuxer:null,callback:null}),l=c=>{c.data.action===i&&(e.removeEventListener("message",l),c.data.data&&(c.data.data=new Uint8Array(c.data.data,s.byteOffset||0,s.byteLength||c.data.data.byteLength),s.data&&(s.data=c.data.data)),r(c.data))};if(e.addEventListener("message",l),s.data){const c=s.data instanceof ArrayBuffer;o.byteOffset=c?0:s.data.byteOffset,o.byteLength=s.data.byteLength;const f=[c?s.data:s.data.buffer];e.postMessage(o,f)}else e.postMessage(o)},sr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},JS="wvtt",Ny=s=>{s.forEach(e=>{e.abort()})},uI=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),cI=s=>{const e=s.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return r.bytesReceived=s.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},ky=(s,e)=>{const{requestType:i}=e,r=Uo({requestType:i,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:sr.TIMEOUT,xhr:e,metadata:r}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:sr.ABORTED,xhr:e,metadata:r}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:sr.FAILURE,xhr:e,metadata:r}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:sr.FAILURE,xhr:e,metadata:r}:null},ex=(s,e,i,r)=>(o,l)=>{const c=l.response,f=ky(o,l);if(f)return i(f,s);if(c.byteLength!==16)return i({status:l.status,message:"Invalid HLS key at URL: "+l.uri,code:sr.FAILURE,xhr:l},s);const p=new DataView(c),v=new Uint32Array([p.getUint32(0),p.getUint32(4),p.getUint32(8),p.getUint32(12)]);for(let x=0;x{e===JS&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},hI=(s,e,i)=>{e===JS&&Su({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:r,mp4VttCues:o})=>{s.bytes=r,i(null,s,{mp4VttCues:o})}})},tx=(s,e)=>{const i=g0(s.map.bytes);if(i!=="mp4"){const r=s.map.resolvedUri||s.map.uri,o=i||"unknown";return e({internal:!0,message:`Found unsupported ${o} container for initialization segment at URL: ${r}`,code:sr.FAILURE,metadata:{mediaType:o}})}Su({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:r,data:o})=>(s.map.bytes=o,r.forEach(function(l){s.map.tracks=s.map.tracks||{},!s.map.tracks[l.type]&&(s.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[l.id]=l.timescale),l.type==="text"&&dI(s,l.codec))}),e(null))})},fI=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:i})=>(r,o)=>{const l=ky(r,o);if(l)return e(l,s);const c=new Uint8Array(o.response);if(i({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=c,e(null,s);s.map.bytes=c,tx(s,function(f){if(f)return f.xhr=o,f.status=o.status,e(f,s);e(null,s)})},pI=({segment:s,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:r})=>(o,l)=>{const c=ky(o,l);if(c)return e(c,s);r({type:"segmentloaded",segment:s});const f=i==="arraybuffer"||!l.responseText?l.response:eI(l.responseText.substring(s.lastReachedChar||0));return s.stats=uI(l),s.key?s.encryptedBytes=new Uint8Array(f):s.bytes=new Uint8Array(f),e(null,s)},mI=({segment:s,bytes:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{const I=s.map&&s.map.tracks||{},C=!!(I.audio&&I.video);let P=r.bind(null,s,"audio","start");const U=r.bind(null,s,"audio","end");let Y=r.bind(null,s,"video","start");const $=r.bind(null,s,"video","end"),G=()=>ZS({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:C,onData:W=>{W.type=W.type==="combined"?"video":W.type,S(s,W)},onTrackInfo:W=>{i&&(C&&(W.isMuxed=!0),i(s,W))},onAudioTimingInfo:W=>{P&&typeof W.start<"u"&&(P(W.start),P=null),U&&typeof W.end<"u"&&U(W.end)},onVideoTimingInfo:W=>{Y&&typeof W.start<"u"&&(Y(W.start),Y=null),$&&typeof W.end<"u"&&$(W.end)},onVideoSegmentTimingInfo:W=>{const oe={pts:{start:W.start.presentation,end:W.end.presentation},dts:{start:W.start.decode,end:W.end.decode}};k({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:oe}),o(W)},onAudioSegmentTimingInfo:W=>{const oe={pts:{start:W.start.pts,end:W.end.pts},dts:{start:W.start.dts,end:W.end.dts}};k({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:oe}),l(W)},onId3:(W,oe)=>{c(s,W,oe)},onCaptions:W=>{f(s,[W])},isEndOfTimeline:p,onEndedTimeline:()=>{v()},onTransmuxerLog:D,onDone:(W,oe)=>{x&&(W.type=W.type==="combined"?"video":W.type,k({type:"segmenttransmuxingcomplete",segment:s}),x(oe,s,W))},segment:s,triggerSegmentEventFn:k});Su({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:W=>{s.bytes=e=W.data;const oe=W.result;oe&&(i(s,{hasAudio:oe.hasAudio,hasVideo:oe.hasVideo,isMuxed:C}),i=null),G()}})},ix=({segment:s,bytes:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{let I=new Uint8Array(e);if(HN(I)){s.isFmp4=!0;const{tracks:C}=s.map;if(C.text&&(!C.audio||!C.video)){S(s,{data:I,type:"text"}),hI(s,C.text.codec,x);return}const U={isFmp4:!0,hasVideo:!!C.video,hasAudio:!!C.audio};C.audio&&C.audio.codec&&C.audio.codec!=="enca"&&(U.audioCodec=C.audio.codec),C.video&&C.video.codec&&C.video.codec!=="encv"&&(U.videoCodec=C.video.codec),C.video&&C.audio&&(U.isMuxed=!0),i(s,U);const Y=($,G)=>{S(s,{data:I,type:U.hasAudio&&!U.isMuxed?"audio":"video"}),G&&G.length&&c(s,G),$&&$.length&&f(s,$),x(null,s,{})};Su({action:"probeMp4StartTime",timescales:s.map.timescales,data:I,transmuxer:s.transmuxer,callback:({data:$,startTime:G})=>{e=$.buffer,s.bytes=I=$,U.hasAudio&&!U.isMuxed&&r(s,"audio","start",G),U.hasVideo&&r(s,"video","start",G),Su({action:"probeEmsgID3",data:I,transmuxer:s.transmuxer,offset:G,callback:({emsgData:W,id3Frames:oe})=>{if(e=W.buffer,s.bytes=I=W,!C.video||!W.byteLength||!s.transmuxer){Y(void 0,oe);return}Su({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:I,timescales:s.map.timescales,trackIds:[C.video.id],callback:K=>{e=K.data.buffer,s.bytes=I=K.data,K.logs.forEach(function(de){D(Ct(de,{stream:"mp4CaptionParser"}))}),Y(K.captions,oe)}})}})}});return}if(!s.transmuxer){x(null,s,{});return}if(typeof s.container>"u"&&(s.container=g0(I)),s.container!=="ts"&&s.container!=="aac"){i(s,{hasAudio:!1,hasVideo:!1}),x(null,s,{});return}mI({segment:s,bytes:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})},nx=function({id:s,key:e,encryptedBytes:i,decryptionWorker:r,segment:o,doneFn:l},c){const f=v=>{if(v.data.source===s){r.removeEventListener("message",f);const S=v.data.decrypted;c(new Uint8Array(S.bytes,S.byteOffset,S.byteLength))}};r.onerror=()=>{const v="An error occurred in the decryption worker",S=Po({segment:o}),x={message:v,metadata:{error:new Error(v),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:S,keyInfo:{uri:o.key.resolvedUri||o.map.key.resolvedUri}}};l(x,o)},r.addEventListener("message",f);let p;e.bytes.slice?p=e.bytes.slice():p=new Uint32Array(Array.prototype.slice.call(e.bytes)),r.postMessage(zS({source:s,encrypted:i,key:p,iv:e.iv}),[i.buffer,p.buffer])},gI=({decryptionWorker:s,segment:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{k({type:"segmentdecryptionstart"}),nx({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:x},I=>{e.bytes=I,k({type:"segmentdecryptioncomplete",segment:e}),ix({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})})},yI=({activeXhrs:s,decryptionWorker:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{let I=0,C=!1;return(P,U)=>{if(!C){if(P)return C=!0,Ny(s),x(P,U);if(I+=1,I===s.length){const Y=function(){if(U.encryptedBytes)return gI({decryptionWorker:e,segment:U,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k});ix({segment:U,bytes:U.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})};if(U.endOfAllRequests=Date.now(),U.map&&U.map.encryptedBytes&&!U.map.bytes)return k({type:"segmentdecryptionstart",segment:U}),nx({decryptionWorker:e,id:U.requestId+"-init",encryptedBytes:U.map.encryptedBytes,key:U.map.key,segment:U,doneFn:x},$=>{U.map.bytes=$,k({type:"segmentdecryptioncomplete",segment:U}),tx(U,G=>{if(G)return Ny(s),x(G,U);Y()})});Y()}}}},TI=({loadendState:s,abortFn:e})=>i=>{i.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},vI=({segment:s,progressFn:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S})=>x=>{if(!x.target.aborted)return s.stats=Ct(s.stats,cI(x)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(x,s)},bI=({xhr:s,xhrOptions:e,decryptionWorker:i,segment:r,abortFn:o,progressFn:l,trackInfoFn:c,timingInfoFn:f,videoSegmentTimingInfoFn:p,audioSegmentTimingInfoFn:v,id3Fn:S,captionsFn:x,isEndOfTimeline:D,endedTimelineFn:k,dataFn:I,doneFn:C,onTransmuxerLog:P,triggerSegmentEventFn:U})=>{const Y=[],$=yI({activeXhrs:Y,decryptionWorker:i,trackInfoFn:c,timingInfoFn:f,videoSegmentTimingInfoFn:p,audioSegmentTimingInfoFn:v,id3Fn:S,captionsFn:x,isEndOfTimeline:D,endedTimelineFn:k,dataFn:I,doneFn:C,onTransmuxerLog:P,triggerSegmentEventFn:U});if(r.key&&!r.key.bytes){const de=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&de.push(r.map.key);const fe=Ct(e,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),me=ex(r,de,$,U),le={uri:r.key.resolvedUri};U({type:"segmentkeyloadstart",segment:r,keyInfo:le});const _e=s(fe,me);Y.push(_e)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const _e=Ct(e,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),he=ex(r,[r.map.key],$,U),ge={uri:r.map.key.resolvedUri};U({type:"segmentkeyloadstart",segment:r,keyInfo:ge});const Ae=s(_e,he);Y.push(Ae)}const fe=Ct(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Dy(r.map),requestType:"segment-media-initialization"}),me=fI({segment:r,finishProcessingFn:$,triggerSegmentEventFn:U});U({type:"segmentloadstart",segment:r});const le=s(fe,me);Y.push(le)}const G=Ct(e,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Dy(r),requestType:"segment"}),W=pI({segment:r,finishProcessingFn:$,responseType:G.responseType,triggerSegmentEventFn:U});U({type:"segmentloadstart",segment:r});const oe=s(G,W);oe.addEventListener("progress",vI({segment:r,progressFn:l,trackInfoFn:c,timingInfoFn:f,videoSegmentTimingInfoFn:p,audioSegmentTimingInfoFn:v,id3Fn:S,captionsFn:x,isEndOfTimeline:D,endedTimelineFn:k,dataFn:I})),Y.push(oe);const K={};return Y.forEach(de=>{de.addEventListener("loadend",TI({loadendState:K,abortFn:o}))}),()=>Ny(Y)},jp=ls("PlaylistSelector"),sx=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},xu=function(s,e){if(!s)return"";const i=z.getComputedStyle(s);return i?i[e]:""},Eu=function(s,e){const i=s.slice();s.sort(function(r,o){const l=e(r,o);return l===0?i.indexOf(r)-i.indexOf(o):l})},Oy=function(s,e){let i,r;return s.attributes.BANDWIDTH&&(i=s.attributes.BANDWIDTH),i=i||z.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||z.Number.MAX_VALUE,i-r},_I=function(s,e){let i,r;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(i=s.attributes.RESOLUTION.width),i=i||z.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||z.Number.MAX_VALUE,i===r&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-r};let rx=function(s){const{main:e,bandwidth:i,playerWidth:r,playerHeight:o,playerObjectFit:l,limitRenditionByPlayerDimensions:c,playlistController:f}=s;if(!e)return;const p={bandwidth:i,width:r,height:o,limitRenditionByPlayerDimensions:c};let v=e.playlists;Cn.isAudioOnly(e)&&(v=f.getAudioTrackPlaylists_(),p.audioOnly=!0);let S=v.map(K=>{let de;const fe=K.attributes&&K.attributes.RESOLUTION&&K.attributes.RESOLUTION.width,me=K.attributes&&K.attributes.RESOLUTION&&K.attributes.RESOLUTION.height;return de=K.attributes&&K.attributes.BANDWIDTH,de=de||z.Number.MAX_VALUE,{bandwidth:de,width:fe,height:me,playlist:K}});Eu(S,(K,de)=>K.bandwidth-de.bandwidth),S=S.filter(K=>!Cn.isIncompatible(K.playlist));let x=S.filter(K=>Cn.isEnabled(K.playlist));x.length||(x=S.filter(K=>!Cn.isDisabled(K.playlist)));const D=x.filter(K=>K.bandwidth*ki.BANDWIDTH_VARIANCEK.bandwidth===k.bandwidth)[0];if(c===!1){const K=I||x[0]||S[0];if(K&&K.playlist){let de="sortedPlaylistReps";return I&&(de="bandwidthBestRep"),x[0]&&(de="enabledPlaylistReps"),jp(`choosing ${sx(K)} using ${de} with options`,p),K.playlist}return jp("could not choose a playlist with options",p),null}const C=D.filter(K=>K.width&&K.height);Eu(C,(K,de)=>K.width-de.width);const P=C.filter(K=>K.width===r&&K.height===o);k=P[P.length-1];const U=P.filter(K=>K.bandwidth===k.bandwidth)[0];let Y,$,G;U||(Y=C.filter(K=>l==="cover"?K.width>r&&K.height>o:K.width>r||K.height>o),$=Y.filter(K=>K.width===Y[0].width&&K.height===Y[0].height),k=$[$.length-1],G=$.filter(K=>K.bandwidth===k.bandwidth)[0]);let W;if(f.leastPixelDiffSelector){const K=C.map(de=>(de.pixelDiff=Math.abs(de.width-r)+Math.abs(de.height-o),de));Eu(K,(de,fe)=>de.pixelDiff===fe.pixelDiff?fe.bandwidth-de.bandwidth:de.pixelDiff-fe.pixelDiff),W=K[0]}const oe=W||G||U||I||x[0]||S[0];if(oe&&oe.playlist){let K="sortedPlaylistReps";return W?K="leastPixelDiffRep":G?K="resolutionPlusOneRep":U?K="resolutionBestRep":I?K="bandwidthBestRep":x[0]&&(K="enabledPlaylistReps"),jp(`choosing ${sx(oe)} using ${K} with options`,p),oe.playlist}return jp("could not choose a playlist with options",p),null};const ax=function(){let s=this.useDevicePixelRatio&&z.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),rx({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(xu(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(xu(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?xu(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},SI=function(s){let e=-1,i=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&z.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),e<0&&(e=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(e=s*this.systemBandwidth+(1-s)*e,i=this.systemBandwidth),rx({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(xu(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(xu(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?xu(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},xI=function(s){const{main:e,currentTime:i,bandwidth:r,duration:o,segmentDuration:l,timeUntilRebuffer:c,currentTimeline:f,syncController:p}=s,v=e.playlists.filter(I=>!Cn.isIncompatible(I));let S=v.filter(Cn.isEnabled);S.length||(S=v.filter(I=>!Cn.isDisabled(I)));const D=S.filter(Cn.hasAttribute.bind(null,"BANDWIDTH")).map(I=>{const P=p.getSyncPoint(I,o,f,i)?1:2,Y=Cn.estimateSegmentRequestTime(l,r,I)*P-c;return{playlist:I,rebufferingImpact:Y}}),k=D.filter(I=>I.rebufferingImpact<=0);return Eu(k,(I,C)=>Oy(C.playlist,I.playlist)),k.length?k[0]:(Eu(D,(I,C)=>I.rebufferingImpact-C.rebufferingImpact),D[0]||null)},EI=function(){const s=this.playlists.main.playlists.filter(Cn.isEnabled);return Eu(s,(i,r)=>Oy(i,r)),s.filter(i=>!!Id(this.playlists.main,i).video)[0]||null},MI=s=>{let e=0,i;return s.bytes&&(i=new Uint8Array(s.bytes),s.segments.forEach(r=>{i.set(r,e),e+=r.byteLength})),i};function ox(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const DI=function(s,e,i){if(!s[i]){e.trigger({type:"usage",name:"vhs-608"});let r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);const o=e.textTracks().getTrackById(r);if(o)s[i]=o;else{const l=e.options_.vhs&&e.options_.vhs.captionServices||{};let c=i,f=i,p=!1;const v=l[r];v&&(c=v.label,f=v.language,p=v.default),s[i]=e.addRemoteTextTrack({kind:"captions",id:r,default:p,label:c,language:f},!1).track}}},CI=function({inbandTextTracks:s,captionArray:e,timestampOffset:i}){if(!e)return;const r=z.WebKitDataCue||z.VTTCue;e.forEach(o=>{const l=o.stream;o.content?o.content.forEach(c=>{const f=new r(o.startTime+i,o.endTime+i,c.text);f.line=c.line,f.align="left",f.position=c.position,f.positionAlign="line-left",s[l].addCue(f)}):s[l].addCue(new r(o.startTime+i,o.endTime+i,o.text))})},AI=function(s){Object.defineProperties(s.frame,{id:{get(){return F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},wI=({inbandTextTracks:s,metadataArray:e,timestampOffset:i,videoDuration:r})=>{if(!e)return;const o=z.WebKitDataCue||z.VTTCue,l=s.metadataTrack_;if(!l||(e.forEach(S=>{const x=S.cueTime+i;typeof x!="number"||z.isNaN(x)||x<0||!(x<1/0)||!S.frames||!S.frames.length||S.frames.forEach(D=>{const k=new o(x,x,D.value||D.url||D.data||"");k.frame=D,k.value=D,AI(k),l.addCue(k)})}),!l.cues||!l.cues.length))return;const c=l.cues,f=[];for(let S=0;S{const D=S[x.startTime]||[];return D.push(x),S[x.startTime]=D,S},{}),v=Object.keys(p).sort((S,x)=>Number(S)-Number(x));v.forEach((S,x)=>{const D=p[S],k=isFinite(r)?r:S,I=Number(v[x+1])||k;D.forEach(C=>{C.endTime=I})})},NI={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},kI=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),OI=({inbandTextTracks:s,dateRanges:e})=>{const i=s.metadataTrack_;if(!i)return;const r=z.WebKitDataCue||z.VTTCue;e.forEach(o=>{for(const l of Object.keys(o)){if(kI.has(l))continue;const c=new r(o.startTime,o.endTime,"");c.id=o.id,c.type="com.apple.quicktime.HLS",c.value={key:NI[l],data:o[l]},(l==="scte35Out"||l==="scte35In")&&(c.value.data=new Uint8Array(c.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(c)}o.processDateRange()})},lx=(s,e,i)=>{s.metadataTrack_||(s.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},Ld=function(s,e,i){let r,o;if(i&&i.cues)for(r=i.cues.length;r--;)o=i.cues[r],o.startTime>=s&&o.endTime<=e&&i.removeCue(o)},II=function(s){const e=s.cues;if(!e)return;const i={};for(let r=e.length-1;r>=0;r--){const o=e[r],l=`${o.startTime}-${o.endTime}-${o.text}`;i[l]?s.removeCue(o):i[l]=o}},LI=(s,e,i)=>{if(typeof e>"u"||e===null||!s.length)return[];const r=Math.ceil((e-i+3)*wo.ONE_SECOND_IN_TS);let o;for(o=0;or);o++);return s.slice(o)},RI=(s,e,i)=>{if(!e.length)return s;if(i)return e.slice();const r=e[0].pts;let o=0;for(o;o=r);o++);return s.slice(0,o).concat(e)},jI=(s,e,i,r)=>{const o=Math.ceil((e-r)*wo.ONE_SECOND_IN_TS),l=Math.ceil((i-r)*wo.ONE_SECOND_IN_TS),c=s.slice();let f=s.length;for(;f--&&!(s[f].pts<=l););if(f===-1)return c;let p=f+1;for(;p--&&!(s[p].pts<=o););return p=Math.max(p,0),c.splice(p,f-p+1),c},zI=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const i=Object.keys(s).sort(),r=Object.keys(e).sort();if(i.length!==r.length)return!1;for(let o=0;oi))return l}return r.length===0?0:r[r.length-1]},Rd=1,PI=500,ux=s=>typeof s=="number"&&isFinite(s),zp=1/60,BI=(s,e,i)=>s!=="main"||!e||!i?null:!i.hasAudio&&!i.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,qI=(s,e,i)=>{let r=e-ki.BACK_BUFFER_LENGTH;s.length&&(r=Math.max(r,s.start(0)));const o=e-i;return Math.min(o,r)},Mu=s=>{const{startOfSegment:e,duration:i,segment:r,part:o,playlist:{mediaSequence:l,id:c,segments:f=[]},mediaIndex:p,partIndex:v,timeline:S}=s,x=f.length-1;let D="mediaIndex/partIndex increment";s.getMediaInfoForTime?D=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(D="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(D+=` with independent ${s.independent}`);const k=typeof v=="number",I=s.segment.uri?"segment":"pre-segment",C=k?mS({preloadSegment:r})-1:0;return`${I} [${l+p}/${l+x}]`+(k?` part [${v}/${C}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(k?` part start/end [${o.start} => ${o.end}]`:"")+` startOfSegment [${e}] duration [${i}] timeline [${S}] selected by [${D}] playlist [${c}]`},cx=s=>`${s}TimingInfo`,FI=({segmentTimeline:s,currentTimeline:e,startOfSegment:i,buffered:r,overrideCheck:o})=>!o&&s===e?null:s{if(e===i)return!1;if(r==="audio"){const l=s.lastTimelineChange({type:"main"});return!l||l.to!==i}if(r==="main"&&o){const l=s.pendingTimelineChange({type:"audio"});return!(l&&l.to===i)}return!1},HI=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),i=s.pendingTimelineChange({type:"main"}),r=e&&i,o=r&&e.to!==i.to;return!!(r&&e.from!==-1&&i.from!==-1&&o)},VI=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&i&&e.to{const e=s.pendingSegment_;if(!e)return;if(Iy({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&HI(s.timelineChangeController_)){if(VI(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},$I=s=>{let e=0;return["video","audio"].forEach(function(i){const r=s[`${i}TimingInfo`];if(!r)return;const{start:o,end:l}=r;let c;typeof o=="bigint"||typeof l=="bigint"?c=z.BigInt(l)-z.BigInt(o):typeof o=="number"&&typeof l=="number"&&(c=l-o),typeof c<"u"&&c>e&&(e=c)}),typeof e=="bigint"&&es?Math.round(s)>e+ir:!1,YI=(s,e)=>{if(e!=="hls")return null;const i=$I({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!i)return null;const r=s.playlist.targetDuration,o=dx({segmentDuration:i,maxDuration:r*2}),l=dx({segmentDuration:i,maxDuration:r}),c=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${i} when the reported duration is ${s.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return o||l?{severity:o?"warn":"info",message:c}:null},Po=({type:s,segment:e})=>{if(!e)return;const i=!!(e.key||e.map&&e.map.ke),r=!!(e.map&&!e.map.bytes),o=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:o,duration:e.duration,isEncrypted:i,isMediaInitialization:r}};class Ly extends F.EventTarget{constructor(e,i={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ls(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(r){r!==this.state_&&(this.logger_(`${this.state_} -> ${r}`),this.state_=r,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ja(this)}),this.sourceUpdater_.on("codecschange",r=>{this.trigger(ei({type:"codecschange"},r))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ja(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",r=>{this.trigger(ei({type:"timelinechange"},r)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():ja(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():ja(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return wy.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&z.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,z.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&wy.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ni();if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:r,isMuxed:o}=e;if(r&&i&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,i=!1){if(!e)return null;const r=Rp(e);let o=this.initSegments_[r];return i&&!o&&e.bytes&&(this.initSegments_[r]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e}segmentKey(e,i=!1){if(!e)return null;const r=US(e);let o=this.keyCache_[r];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[r]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});const l={resolvedUri:(o||e).resolvedUri};return o&&(l.bytes=o.bytes),l}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,i={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const r=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let l=null;if(r&&(r.id?l=r.id:r.uri&&(l=r.uri)),this.logger_(`playlist update [${l} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +`)};var yr={inspect:di,textify:cs,parseType:ta,findBox:th,parseTraf:Qn.traf,parseTfdt:Qn.tfdt,parseHdlr:Qn.hdlr,parseTfhd:Qn.tfhd,parseTrun:Qn.trun,parseSidx:Qn.sidx},Vt=function(h){for(var g=0,y=String.fromCharCode(h[g]),T="";y!=="\0";)T+=y,g++,y=String.fromCharCode(h[g]);return T+=y,T},Gu={uint8ToCString:Vt},sl=Gu.uint8ToCString,ih=l.getUint64,ia=function(h){var g=4,y=h[0],T,b,E,w,O,R,j,H;if(y===0){T=sl(h.subarray(g)),g+=T.length,b=sl(h.subarray(g)),g+=b.length;var J=new DataView(h.buffer);E=J.getUint32(g),g+=4,O=J.getUint32(g),g+=4,R=J.getUint32(g),g+=4,j=J.getUint32(g),g+=4}else if(y===1){var J=new DataView(h.buffer);E=J.getUint32(g),g+=4,w=ih(h.subarray(g)),g+=8,R=J.getUint32(g),g+=4,j=J.getUint32(g),g+=4,T=sl(h.subarray(g)),g+=T.length,b=sl(h.subarray(g)),g+=b.length}H=new Uint8Array(h.subarray(g,h.byteLength));var Ee={scheme_id_uri:T,value:b,timescale:E||1,presentation_time:w,presentation_time_delta:O,event_duration:R,id:j,message_data:H};return Bs(y,Ee)?Ee:void 0},rl=function(h,g,y,T){return h||h===0?h/g:T+y/g},Bs=function(h,g){var y=g.scheme_id_uri!=="\0",T=h===0&&al(g.presentation_time_delta)&&y,b=h===1&&al(g.presentation_time)&&y;return!(h>1)&&T||b},al=function(h){return h!==void 0||h!==null},ol={parseEmsgBox:ia,scaleTime:rl},na;typeof window<"u"?na=window:typeof s<"u"?na=s:typeof self<"u"?na=self:na={};var Xu=na,ll=Ha.toUnsigned,nn=Ha.toHexString,bt=Va,qs=Yu,nh=ol,om=Ps,eT=Jd,sh=el,Wu=l.getUint64,rh,ah,oh,ul,lh,Ku,uh,cl=Xu,ch=Xr.parseId3Frames;rh=function(h){var g={},y=bt(h,["moov","trak"]);return y.reduce(function(T,b){var E,w,O,R,j;return E=bt(b,["tkhd"])[0],!E||(w=E[0],O=w===0?12:20,R=ll(E[O]<<24|E[O+1]<<16|E[O+2]<<8|E[O+3]),j=bt(b,["mdia","mdhd"])[0],!j)?null:(w=j[0],O=w===0?12:20,T[R]=ll(j[O]<<24|j[O+1]<<16|j[O+2]<<8|j[O+3]),T)},g)},ah=function(h,g){var y;y=bt(g,["moof","traf"]);var T=y.reduce(function(b,E){var w=bt(E,["tfhd"])[0],O=ll(w[4]<<24|w[5]<<16|w[6]<<8|w[7]),R=h[O]||9e4,j=bt(E,["tfdt"])[0],H=new DataView(j.buffer,j.byteOffset,j.byteLength),J;j[0]===1?J=Wu(j.subarray(4,12)):J=H.getUint32(4);let Ee;return typeof J=="bigint"?Ee=J/cl.BigInt(R):typeof J=="number"&&!isNaN(J)&&(Ee=J/R),Ee11?(b.codec+=".",b.codec+=nn(ue[9]),b.codec+=nn(ue[10]),b.codec+=nn(ue[11])):b.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(b.codec)?(ue=Ee.subarray(28),Be=qs(ue.subarray(4,8)),Be==="esds"&&ue.length>20&&ue[19]!==0?(b.codec+="."+nn(ue[19]),b.codec+="."+nn(ue[20]>>>2&63).replace(/^0/,"")):b.codec="mp4a.40.2"):b.codec=b.codec.toLowerCase())}var Ye=bt(T,["mdia","mdhd"])[0];Ye&&(b.timescale=Ku(Ye)),y.push(b)}),y},uh=function(h,g=0){var y=bt(h,["emsg"]);return y.map(T=>{var b=nh.parseEmsgBox(new Uint8Array(T)),E=ch(b.message_data);return{cueTime:nh.scaleTime(b.presentation_time,b.timescale,b.presentation_time_delta,g),duration:nh.scaleTime(b.event_duration,b.timescale),frames:E}})};var On={findBox:bt,parseType:qs,timescale:rh,startTime:ah,compositionStartTime:oh,videoTrackIds:ul,tracks:lh,getTimescaleFromMediaHeader:Ku,getEmsgID3:uh};const{parseTrun:Tr}=yr,{findBox:Ya}=On;var dl=Xu,hl=function(h){var g=Ya(h,["moof","traf"]),y=Ya(h,["mdat"]),T=[];return y.forEach(function(b,E){var w=g[E];T.push({mdat:b,traf:w})}),T},fl=function(h,g,y){var T=g,b=y.defaultSampleDuration||0,E=y.defaultSampleSize||0,w=y.trackId,O=[];return h.forEach(function(R){var j=Tr(R),H=j.samples;H.forEach(function(J){J.duration===void 0&&(J.duration=b),J.size===void 0&&(J.size=E),J.trackId=w,J.dts=T,J.compositionTimeOffset===void 0&&(J.compositionTimeOffset=0),typeof T=="bigint"?(J.pts=T+dl.BigInt(J.compositionTimeOffset),T+=dl.BigInt(J.duration)):(J.pts=T+J.compositionTimeOffset,T+=J.duration)}),O=O.concat(H)}),O},dh={getMdatTrafPairs:hl,parseSamples:fl},tT=Bd.discardEmulationPreventionBytes,lm=wu.CaptionStream,Zu=Va,hh=el,fh=Ps,{getMdatTrafPairs:lt,parseSamples:Te}=dh,Qa=function(h,g){for(var y=h,T=0;T0?hh(H[0]).baseMediaDecodeTime:0,Ee=Zu(w,["trun"]),ue,Be;g===j&&Ee.length>0&&(ue=Te(Ee,J,R),Be=Ju(E,ue,j),y[j]||(y[j]={seiNals:[],logs:[]}),y[j].seiNals=y[j].seiNals.concat(Be.seiNals),y[j].logs=y[j].logs.concat(Be.logs))}),y},ph=function(h,g,y){var T;if(g===null)return null;T=Jt(h,g);var b=T[g]||{};return{seiNals:b.seiNals,logs:b.logs,timescale:y}},mh=function(){var h=!1,g,y,T,b,E,w;this.isInitialized=function(){return h},this.init=function(O){g=new lm,h=!0,w=O?O.isPartial:!1,g.on("data",function(R){R.startTime=R.startPts/b,R.endTime=R.endPts/b,E.captions.push(R),E.captionStreams[R.stream]=!0}),g.on("log",function(R){E.logs.push(R)})},this.isNewInit=function(O,R){return O&&O.length===0||R&&typeof R=="object"&&Object.keys(R).length===0?!1:T!==O[0]||b!==R[T]},this.parse=function(O,R,j){var H;if(this.isInitialized()){if(!R||!j)return null;if(this.isNewInit(R,j))T=R[0],b=j[T];else if(T===null||!b)return y.push(O),null}else return null;for(;y.length>0;){var J=y.shift();this.parse(J,R,j)}return H=ph(O,T,b),H&&H.logs&&(E.logs=E.logs.concat(H.logs)),H===null||!H.seiNals?E.logs.length?{logs:E.logs,captions:[],captionStreams:[]}:null:(this.pushNals(H.seiNals),this.flushStream(),E)},this.pushNals=function(O){if(!this.isInitialized()||!O||O.length===0)return null;O.forEach(function(R){g.push(R)})},this.flushStream=function(){if(!this.isInitialized())return null;w?g.partialFlush():g.flush()},this.clearParsedCaptions=function(){E.captions=[],E.captionStreams={},E.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;g.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){y=[],T=null,b=null,E?this.clearParsedCaptions():E={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},um=mh;const{parseTfdt:gh}=yr,vr=Va,{getTimescaleFromMediaHeader:yh}=On,{parseSamples:Th,getMdatTrafPairs:vh}=dh;var _t=function(){let h=9e4;this.init=function(g){const y=vr(g,["moov","trak","mdia","mdhd"])[0];y&&(h=yh(y))},this.parseSegment=function(g){const y=[],T=vh(g);let b=0;return T.forEach(function(E){const w=E.mdat,O=E.traf,R=vr(O,["tfdt"])[0],j=vr(O,["tfhd"])[0],H=vr(O,["trun"]);if(R&&(b=gh(R).baseMediaDecodeTime),H.length&&j){const J=Th(H,b,j);let Ee=0;J.forEach(function(ue){const Be="utf-8",Ye=new TextDecoder(Be),ni=w.slice(Ee,Ee+ue.size);if(vr(ni,["vtte"])[0]){Ee+=ue.size;return}vr(ni,["vttc"]).forEach(function(_r){const ra=vr(_r,["payl"])[0],Wa=vr(_r,["sttg"])[0],Ka=ue.pts/h,Za=(ue.pts+ue.duration)/h;let Lt,Ja;if(ra)try{Lt=Ye.decode(ra)}catch(fn){console.error(fn)}if(Wa)try{Ja=Ye.decode(Wa)}catch(fn){console.error(fn)}ue.duration&&Lt&&y.push({cueText:Lt,start:Ka,end:Za,settings:Ja})}),Ee+=ue.size})}}),y}},pl=Fo,Ga=function(h){var g=h[1]&31;return g<<=8,g|=h[2],g},Gn=function(h){return!!(h[1]&64)},ds=function(h){var g=0;return(h[3]&48)>>>4>1&&(g+=h[4]+1),g},Xn=function(h,g){var y=Ga(h);return y===0?"pat":y===g?"pmt":g?"pes":null},bh=function(h){var g=Gn(h),y=4+ds(h);return g&&(y+=h[y]+1),(h[y+10]&31)<<8|h[y+11]},Xa=function(h){var g={},y=Gn(h),T=4+ds(h);if(y&&(T+=h[T]+1),!!(h[T+5]&1)){var b,E,w;b=(h[T+1]&15)<<8|h[T+2],E=3+b-4,w=(h[T+10]&15)<<8|h[T+11];for(var O=12+w;O=h.byteLength)return null;var T=null,b;return b=h[y+7],b&192&&(T={},T.pts=(h[y+9]&14)<<27|(h[y+10]&255)<<20|(h[y+11]&254)<<12|(h[y+12]&255)<<5|(h[y+13]&254)>>>3,T.pts*=4,T.pts+=(h[y+13]&6)>>>1,T.dts=T.pts,b&64&&(T.dts=(h[y+14]&14)<<27|(h[y+15]&255)<<20|(h[y+16]&254)<<12|(h[y+17]&255)<<5|(h[y+18]&254)>>>3,T.dts*=4,T.dts+=(h[y+18]&6)>>>1)),T},gl=function(h){switch(h){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},ec=function(h){for(var g=4+ds(h),y=h.subarray(g),T=0,b=0,E=!1,w;b3&&(w=gl(y[b+3]&31),w==="slice_layer_without_partitioning_rbsp_idr"&&(E=!0)),E},cm={parseType:Xn,parsePat:bh,parsePmt:Xa,parsePayloadUnitStartIndicator:Gn,parsePesType:_h,parsePesTime:ml,videoPacketContainsKeyFrame:ec},Sh=Fo,sa=Hd.handleRollover,St={};St.ts=cm,St.aac=Bu;var br=vt.ONE_SECOND_IN_TS,Ei=188,In=71,xh=function(h,g){for(var y=0,T=Ei,b,E;T=0;){if(h[T]===In&&(h[b]===In||b===h.byteLength)){switch(E=h.subarray(T,b),w=St.ts.parseType(E,g.pid),w){case"pes":O=St.ts.parsePesType(E,g.table),R=St.ts.parsePayloadUnitStartIndicator(E),O==="audio"&&R&&(j=St.ts.parsePesTime(E),j&&(j.type="audio",y.audio.push(j),H=!0));break}if(H)break;T-=Ei,b-=Ei;continue}T--,b--}},dm=function(h,g,y){for(var T=0,b=Ei,E,w,O,R,j,H,J,Ee,ue=!1,Be={data:[],size:0};b=0;){if(h[T]===In&&h[b]===In){switch(E=h.subarray(T,b),w=St.ts.parseType(E,g.pid),w){case"pes":O=St.ts.parsePesType(E,g.table),R=St.ts.parsePayloadUnitStartIndicator(E),O==="video"&&R&&(j=St.ts.parsePesTime(E),j&&(j.type="video",y.video.push(j),ue=!0));break}if(ue)break;T-=Ei,b-=Ei;continue}T--,b--}},hm=function(h,g){if(h.audio&&h.audio.length){var y=g;(typeof y>"u"||isNaN(y))&&(y=h.audio[0].dts),h.audio.forEach(function(E){E.dts=sa(E.dts,y),E.pts=sa(E.pts,y),E.dtsTime=E.dts/br,E.ptsTime=E.pts/br})}if(h.video&&h.video.length){var T=g;if((typeof T>"u"||isNaN(T))&&(T=h.video[0].dts),h.video.forEach(function(E){E.dts=sa(E.dts,T),E.pts=sa(E.pts,T),E.dtsTime=E.dts/br,E.ptsTime=E.pts/br}),h.firstKeyFrame){var b=h.firstKeyFrame;b.dts=sa(b.dts,T),b.pts=sa(b.pts,T),b.dtsTime=b.dts/br,b.ptsTime=b.pts/br}}},iT=function(h){for(var g=!1,y=0,T=null,b=null,E=0,w=0,O;h.length-w>=3;){var R=St.aac.parseType(h,w);switch(R){case"timed-metadata":if(h.length-w<10){g=!0;break}if(E=St.aac.parseId3TagSize(h,w),E>h.length){g=!0;break}b===null&&(O=h.subarray(w,w+E),b=St.aac.parseAacTimestamp(O)),w+=E;break;case"audio":if(h.length-w<7){g=!0;break}if(E=St.aac.parseAdtsSize(h,w),E>h.length){g=!0;break}T===null&&(O=h.subarray(w,w+E),T=St.aac.parseSampleRate(O)),y++,w+=E;break;default:w++;break}if(g)return null}if(T===null||b===null)return null;var j=br/T,H={audio:[{type:"audio",dts:b,pts:b},{type:"audio",dts:b+y*1024*j,pts:b+y*1024*j}]};return H},fm=function(h){var g={pid:null,table:null},y={};xh(h,g);for(var T in g.table)if(g.table.hasOwnProperty(T)){var b=g.table[T];switch(b){case Sh.H264_STREAM_TYPE:y.video=[],dm(h,g,y),y.video.length===0&&delete y.video;break;case Sh.ADTS_STREAM_TYPE:y.audio=[],Eh(h,g,y),y.audio.length===0&&delete y.audio;break}}return y},pm=function(h,g){var y=St.aac.isLikelyAacData(h),T;return y?T=iT(h):T=fm(h),!T||!T.audio&&!T.video?null:(hm(T,g),T)},mm={inspect:pm,parseAudioPes_:Eh};const Mh=function(h,g){g.on("data",function(y){const T=y.initSegment;y.initSegment={data:T.buffer,byteOffset:T.byteOffset,byteLength:T.byteLength};const b=y.data;y.data=b.buffer,h.postMessage({action:"data",segment:y,byteOffset:b.byteOffset,byteLength:b.byteLength},[y.data])}),g.on("done",function(y){h.postMessage({action:"done"})}),g.on("gopInfo",function(y){h.postMessage({action:"gopInfo",gopInfo:y})}),g.on("videoSegmentTimingInfo",function(y){const T={start:{decode:vt.videoTsToSeconds(y.start.dts),presentation:vt.videoTsToSeconds(y.start.pts)},end:{decode:vt.videoTsToSeconds(y.end.dts),presentation:vt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:vt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(T.prependedContentDuration=vt.videoTsToSeconds(y.prependedContentDuration)),h.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:T})}),g.on("audioSegmentTimingInfo",function(y){const T={start:{decode:vt.videoTsToSeconds(y.start.dts),presentation:vt.videoTsToSeconds(y.start.pts)},end:{decode:vt.videoTsToSeconds(y.end.dts),presentation:vt.videoTsToSeconds(y.end.pts)},baseMediaDecodeTime:vt.videoTsToSeconds(y.baseMediaDecodeTime)};y.prependedContentDuration&&(T.prependedContentDuration=vt.videoTsToSeconds(y.prependedContentDuration)),h.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:T})}),g.on("id3Frame",function(y){h.postMessage({action:"id3Frame",id3Frame:y})}),g.on("caption",function(y){h.postMessage({action:"caption",caption:y})}),g.on("trackinfo",function(y){h.postMessage({action:"trackinfo",trackInfo:y})}),g.on("audioTimingInfo",function(y){h.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:vt.videoTsToSeconds(y.start),end:vt.videoTsToSeconds(y.end)}})}),g.on("videoTimingInfo",function(y){h.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:vt.videoTsToSeconds(y.start),end:vt.videoTsToSeconds(y.end)}})}),g.on("log",function(y){h.postMessage({action:"log",log:y})})};class Dh{constructor(g,y){this.options=y||{},this.self=g,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new nm.Transmuxer(this.options),Mh(this.self,this.transmuxer)}pushMp4Captions(g){this.captionParser||(this.captionParser=new um,this.captionParser.init());const y=new Uint8Array(g.data,g.byteOffset,g.byteLength),T=this.captionParser.parse(y,g.trackIds,g.timescales);this.self.postMessage({action:"mp4Captions",captions:T&&T.captions||[],logs:T&&T.logs||[],data:y.buffer},[y.buffer])}initMp4WebVttParser(g){this.webVttParser||(this.webVttParser=new _t);const y=new Uint8Array(g.data,g.byteOffset,g.byteLength);this.webVttParser.init(y)}getMp4WebVttText(g){this.webVttParser||(this.webVttParser=new _t);const y=new Uint8Array(g.data,g.byteOffset,g.byteLength),T=this.webVttParser.parseSegment(y);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:T||[],data:y.buffer},[y.buffer])}probeMp4StartTime({timescales:g,data:y}){const T=On.startTime(g,y);this.self.postMessage({action:"probeMp4StartTime",startTime:T,data:y},[y.buffer])}probeMp4Tracks({data:g}){const y=On.tracks(g);this.self.postMessage({action:"probeMp4Tracks",tracks:y,data:g},[g.buffer])}probeEmsgID3({data:g,offset:y}){const T=On.getEmsgID3(g,y);this.self.postMessage({action:"probeEmsgID3",id3Frames:T,emsgData:g},[g.buffer])}probeTs({data:g,baseStartTime:y}){const T=typeof y=="number"&&!isNaN(y)?y*vt.ONE_SECOND_IN_TS:void 0,b=mm.inspect(g,T);let E=null;b&&(E={hasVideo:b.video&&b.video.length===2||!1,hasAudio:b.audio&&b.audio.length===2||!1},E.hasVideo&&(E.videoStart=b.video[0].ptsTime),E.hasAudio&&(E.audioStart=b.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:E,data:g},[g.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(g){const y=new Uint8Array(g.data,g.byteOffset,g.byteLength);this.transmuxer.push(y)}reset(){this.transmuxer.reset()}setTimestampOffset(g){const y=g.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(vt.secondsToVideoTs(y)))}setAudioAppendStart(g){this.transmuxer.setAudioAppendStart(Math.ceil(vt.secondsToVideoTs(g.appendStart)))}setRemux(g){this.transmuxer.setRemux(g.remux)}flush(g){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(g){this.transmuxer.alignGopsWith(g.gopsToAlignWith.slice())}}self.onmessage=function(h){if(h.data.action==="init"&&h.data.options){this.messageHandlers=new Dh(self,h.data.options);return}this.messageHandlers||(this.messageHandlers=new Dh(self)),h.data&&h.data.action&&h.data.action!=="init"&&this.messageHandlers[h.data.action]&&this.messageHandlers[h.data.action](h.data)}}));var n3=$S(i3);const s3=(s,e,i)=>{const{type:r,initSegment:o,captions:l,captionStreams:c,metadata:f,videoFrameDtsTime:p,videoFramePtsTime:v}=s.data.segment;e.buffer.push({captions:l,captionStreams:c,metadata:f});const S=s.data.segment.boxes||{data:s.data.segment.data},x={type:r,data:new Uint8Array(S.data,S.data.byteOffset,S.data.byteLength),initSegment:new Uint8Array(o.data,o.byteOffset,o.byteLength)};typeof p<"u"&&(x.videoFrameDtsTime=p),typeof v<"u"&&(x.videoFramePtsTime=v),i(x)},r3=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},a3=(s,e)=>{e.gopInfo=s.data.gopInfo},GS=s=>{const{transmuxer:e,bytes:i,audioAppendStart:r,gopsToAlignWith:o,remux:l,onData:c,onTrackInfo:f,onAudioTimingInfo:p,onVideoTimingInfo:v,onVideoSegmentTimingInfo:S,onAudioSegmentTimingInfo:x,onId3:D,onCaptions:k,onDone:I,onEndedTimeline:C,onTransmuxerLog:P,isEndOfTimeline:U,segment:Y,triggerSegmentEventFn:$}=s,G={buffer:[]};let W=U;const oe=de=>{e.currentTransmux===s&&(de.data.action==="data"&&s3(de,G,c),de.data.action==="trackinfo"&&f(de.data.trackInfo),de.data.action==="gopInfo"&&a3(de,G),de.data.action==="audioTimingInfo"&&p(de.data.audioTimingInfo),de.data.action==="videoTimingInfo"&&v(de.data.videoTimingInfo),de.data.action==="videoSegmentTimingInfo"&&S(de.data.videoSegmentTimingInfo),de.data.action==="audioSegmentTimingInfo"&&x(de.data.audioSegmentTimingInfo),de.data.action==="id3Frame"&&D([de.data.id3Frame],de.data.id3Frame.dispatchType),de.data.action==="caption"&&k(de.data.caption),de.data.action==="endedtimeline"&&(W=!1,C()),de.data.action==="log"&&P(de.data.log),de.data.type==="transmuxed"&&(W||(e.onmessage=null,r3({transmuxedData:G,callback:I}),XS(e))))},K=()=>{const de={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:Po({segment:Y})}};I(null,de)};if(e.onmessage=oe,e.onerror=K,r&&e.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(o)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:o}),typeof l<"u"&&e.postMessage({action:"setRemux",remux:l}),i.byteLength){const de=i instanceof ArrayBuffer?i:i.buffer,fe=i instanceof ArrayBuffer?0:i.byteOffset;$({type:"segmenttransmuxingstart",segment:Y}),e.postMessage({action:"push",data:de,byteOffset:fe,byteLength:i.byteLength},[de])}U&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},XS=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():GS(s.currentTransmux))},WS=(s,e)=>{s.postMessage({action:e}),XS(s)},KS=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,WS(e,s);return}e.transmuxQueue.push(WS.bind(null,e,s))},o3=s=>{KS("reset",s)},l3=s=>{KS("endTimeline",s)},ZS=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,GS(s);return}s.transmuxer.transmuxQueue.push(s)};var wy={reset:o3,endTimeline:l3,transmux:ZS,createTransmuxer:s=>{const e=new n3;e.currentTransmux=null,e.transmuxQueue=[];const i=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,i.call(e)),e.postMessage({action:"init",options:s}),e}};const Su=function(s){const e=s.transmuxer,i=s.endAction||s.action,r=s.callback,o=ei({},s,{endAction:null,transmuxer:null,callback:null}),l=c=>{c.data.action===i&&(e.removeEventListener("message",l),c.data.data&&(c.data.data=new Uint8Array(c.data.data,s.byteOffset||0,s.byteLength||c.data.data.byteLength),s.data&&(s.data=c.data.data)),r(c.data))};if(e.addEventListener("message",l),s.data){const c=s.data instanceof ArrayBuffer;o.byteOffset=c?0:s.data.byteOffset,o.byteLength=s.data.byteLength;const f=[c?s.data:s.data.buffer];e.postMessage(o,f)}else e.postMessage(o)},sr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},JS="wvtt",Ny=s=>{s.forEach(e=>{e.abort()})},u3=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),c3=s=>{const e=s.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return r.bytesReceived=s.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},ky=(s,e)=>{const{requestType:i}=e,r=Uo({requestType:i,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:sr.TIMEOUT,xhr:e,metadata:r}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:sr.ABORTED,xhr:e,metadata:r}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:sr.FAILURE,xhr:e,metadata:r}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:sr.FAILURE,xhr:e,metadata:r}:null},ex=(s,e,i,r)=>(o,l)=>{const c=l.response,f=ky(o,l);if(f)return i(f,s);if(c.byteLength!==16)return i({status:l.status,message:"Invalid HLS key at URL: "+l.uri,code:sr.FAILURE,xhr:l},s);const p=new DataView(c),v=new Uint32Array([p.getUint32(0),p.getUint32(4),p.getUint32(8),p.getUint32(12)]);for(let x=0;x{e===JS&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},h3=(s,e,i)=>{e===JS&&Su({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:r,mp4VttCues:o})=>{s.bytes=r,i(null,s,{mp4VttCues:o})}})},tx=(s,e)=>{const i=g0(s.map.bytes);if(i!=="mp4"){const r=s.map.resolvedUri||s.map.uri,o=i||"unknown";return e({internal:!0,message:`Found unsupported ${o} container for initialization segment at URL: ${r}`,code:sr.FAILURE,metadata:{mediaType:o}})}Su({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:r,data:o})=>(s.map.bytes=o,r.forEach(function(l){s.map.tracks=s.map.tracks||{},!s.map.tracks[l.type]&&(s.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[l.id]=l.timescale),l.type==="text"&&d3(s,l.codec))}),e(null))})},f3=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:i})=>(r,o)=>{const l=ky(r,o);if(l)return e(l,s);const c=new Uint8Array(o.response);if(i({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=c,e(null,s);s.map.bytes=c,tx(s,function(f){if(f)return f.xhr=o,f.status=o.status,e(f,s);e(null,s)})},p3=({segment:s,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:r})=>(o,l)=>{const c=ky(o,l);if(c)return e(c,s);r({type:"segmentloaded",segment:s});const f=i==="arraybuffer"||!l.responseText?l.response:e3(l.responseText.substring(s.lastReachedChar||0));return s.stats=u3(l),s.key?s.encryptedBytes=new Uint8Array(f):s.bytes=new Uint8Array(f),e(null,s)},m3=({segment:s,bytes:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{const I=s.map&&s.map.tracks||{},C=!!(I.audio&&I.video);let P=r.bind(null,s,"audio","start");const U=r.bind(null,s,"audio","end");let Y=r.bind(null,s,"video","start");const $=r.bind(null,s,"video","end"),G=()=>ZS({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:C,onData:W=>{W.type=W.type==="combined"?"video":W.type,S(s,W)},onTrackInfo:W=>{i&&(C&&(W.isMuxed=!0),i(s,W))},onAudioTimingInfo:W=>{P&&typeof W.start<"u"&&(P(W.start),P=null),U&&typeof W.end<"u"&&U(W.end)},onVideoTimingInfo:W=>{Y&&typeof W.start<"u"&&(Y(W.start),Y=null),$&&typeof W.end<"u"&&$(W.end)},onVideoSegmentTimingInfo:W=>{const oe={pts:{start:W.start.presentation,end:W.end.presentation},dts:{start:W.start.decode,end:W.end.decode}};k({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:oe}),o(W)},onAudioSegmentTimingInfo:W=>{const oe={pts:{start:W.start.pts,end:W.end.pts},dts:{start:W.start.dts,end:W.end.dts}};k({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:oe}),l(W)},onId3:(W,oe)=>{c(s,W,oe)},onCaptions:W=>{f(s,[W])},isEndOfTimeline:p,onEndedTimeline:()=>{v()},onTransmuxerLog:D,onDone:(W,oe)=>{x&&(W.type=W.type==="combined"?"video":W.type,k({type:"segmenttransmuxingcomplete",segment:s}),x(oe,s,W))},segment:s,triggerSegmentEventFn:k});Su({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:W=>{s.bytes=e=W.data;const oe=W.result;oe&&(i(s,{hasAudio:oe.hasAudio,hasVideo:oe.hasVideo,isMuxed:C}),i=null),G()}})},ix=({segment:s,bytes:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{let I=new Uint8Array(e);if(HN(I)){s.isFmp4=!0;const{tracks:C}=s.map;if(C.text&&(!C.audio||!C.video)){S(s,{data:I,type:"text"}),h3(s,C.text.codec,x);return}const U={isFmp4:!0,hasVideo:!!C.video,hasAudio:!!C.audio};C.audio&&C.audio.codec&&C.audio.codec!=="enca"&&(U.audioCodec=C.audio.codec),C.video&&C.video.codec&&C.video.codec!=="encv"&&(U.videoCodec=C.video.codec),C.video&&C.audio&&(U.isMuxed=!0),i(s,U);const Y=($,G)=>{S(s,{data:I,type:U.hasAudio&&!U.isMuxed?"audio":"video"}),G&&G.length&&c(s,G),$&&$.length&&f(s,$),x(null,s,{})};Su({action:"probeMp4StartTime",timescales:s.map.timescales,data:I,transmuxer:s.transmuxer,callback:({data:$,startTime:G})=>{e=$.buffer,s.bytes=I=$,U.hasAudio&&!U.isMuxed&&r(s,"audio","start",G),U.hasVideo&&r(s,"video","start",G),Su({action:"probeEmsgID3",data:I,transmuxer:s.transmuxer,offset:G,callback:({emsgData:W,id3Frames:oe})=>{if(e=W.buffer,s.bytes=I=W,!C.video||!W.byteLength||!s.transmuxer){Y(void 0,oe);return}Su({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:I,timescales:s.map.timescales,trackIds:[C.video.id],callback:K=>{e=K.data.buffer,s.bytes=I=K.data,K.logs.forEach(function(de){D(Ct(de,{stream:"mp4CaptionParser"}))}),Y(K.captions,oe)}})}})}});return}if(!s.transmuxer){x(null,s,{});return}if(typeof s.container>"u"&&(s.container=g0(I)),s.container!=="ts"&&s.container!=="aac"){i(s,{hasAudio:!1,hasVideo:!1}),x(null,s,{});return}m3({segment:s,bytes:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})},nx=function({id:s,key:e,encryptedBytes:i,decryptionWorker:r,segment:o,doneFn:l},c){const f=v=>{if(v.data.source===s){r.removeEventListener("message",f);const S=v.data.decrypted;c(new Uint8Array(S.bytes,S.byteOffset,S.byteLength))}};r.onerror=()=>{const v="An error occurred in the decryption worker",S=Po({segment:o}),x={message:v,metadata:{error:new Error(v),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:S,keyInfo:{uri:o.key.resolvedUri||o.map.key.resolvedUri}}};l(x,o)},r.addEventListener("message",f);let p;e.bytes.slice?p=e.bytes.slice():p=new Uint32Array(Array.prototype.slice.call(e.bytes)),r.postMessage(zS({source:s,encrypted:i,key:p,iv:e.iv}),[i.buffer,p.buffer])},g3=({decryptionWorker:s,segment:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{k({type:"segmentdecryptionstart"}),nx({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:x},I=>{e.bytes=I,k({type:"segmentdecryptioncomplete",segment:e}),ix({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})})},y3=({activeXhrs:s,decryptionWorker:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})=>{let I=0,C=!1;return(P,U)=>{if(!C){if(P)return C=!0,Ny(s),x(P,U);if(I+=1,I===s.length){const Y=function(){if(U.encryptedBytes)return g3({decryptionWorker:e,segment:U,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k});ix({segment:U,bytes:U.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S,doneFn:x,onTransmuxerLog:D,triggerSegmentEventFn:k})};if(U.endOfAllRequests=Date.now(),U.map&&U.map.encryptedBytes&&!U.map.bytes)return k({type:"segmentdecryptionstart",segment:U}),nx({decryptionWorker:e,id:U.requestId+"-init",encryptedBytes:U.map.encryptedBytes,key:U.map.key,segment:U,doneFn:x},$=>{U.map.bytes=$,k({type:"segmentdecryptioncomplete",segment:U}),tx(U,G=>{if(G)return Ny(s),x(G,U);Y()})});Y()}}}},T3=({loadendState:s,abortFn:e})=>i=>{i.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},v3=({segment:s,progressFn:e,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:p,endedTimelineFn:v,dataFn:S})=>x=>{if(!x.target.aborted)return s.stats=Ct(s.stats,c3(x)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(x,s)},b3=({xhr:s,xhrOptions:e,decryptionWorker:i,segment:r,abortFn:o,progressFn:l,trackInfoFn:c,timingInfoFn:f,videoSegmentTimingInfoFn:p,audioSegmentTimingInfoFn:v,id3Fn:S,captionsFn:x,isEndOfTimeline:D,endedTimelineFn:k,dataFn:I,doneFn:C,onTransmuxerLog:P,triggerSegmentEventFn:U})=>{const Y=[],$=y3({activeXhrs:Y,decryptionWorker:i,trackInfoFn:c,timingInfoFn:f,videoSegmentTimingInfoFn:p,audioSegmentTimingInfoFn:v,id3Fn:S,captionsFn:x,isEndOfTimeline:D,endedTimelineFn:k,dataFn:I,doneFn:C,onTransmuxerLog:P,triggerSegmentEventFn:U});if(r.key&&!r.key.bytes){const de=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&de.push(r.map.key);const fe=Ct(e,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),me=ex(r,de,$,U),le={uri:r.key.resolvedUri};U({type:"segmentkeyloadstart",segment:r,keyInfo:le});const _e=s(fe,me);Y.push(_e)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const _e=Ct(e,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),he=ex(r,[r.map.key],$,U),ge={uri:r.map.key.resolvedUri};U({type:"segmentkeyloadstart",segment:r,keyInfo:ge});const Ae=s(_e,he);Y.push(Ae)}const fe=Ct(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Dy(r.map),requestType:"segment-media-initialization"}),me=f3({segment:r,finishProcessingFn:$,triggerSegmentEventFn:U});U({type:"segmentloadstart",segment:r});const le=s(fe,me);Y.push(le)}const G=Ct(e,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Dy(r),requestType:"segment"}),W=p3({segment:r,finishProcessingFn:$,responseType:G.responseType,triggerSegmentEventFn:U});U({type:"segmentloadstart",segment:r});const oe=s(G,W);oe.addEventListener("progress",v3({segment:r,progressFn:l,trackInfoFn:c,timingInfoFn:f,videoSegmentTimingInfoFn:p,audioSegmentTimingInfoFn:v,id3Fn:S,captionsFn:x,isEndOfTimeline:D,endedTimelineFn:k,dataFn:I})),Y.push(oe);const K={};return Y.forEach(de=>{de.addEventListener("loadend",T3({loadendState:K,abortFn:o}))}),()=>Ny(Y)},jp=ls("PlaylistSelector"),sx=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},xu=function(s,e){if(!s)return"";const i=z.getComputedStyle(s);return i?i[e]:""},Eu=function(s,e){const i=s.slice();s.sort(function(r,o){const l=e(r,o);return l===0?i.indexOf(r)-i.indexOf(o):l})},Oy=function(s,e){let i,r;return s.attributes.BANDWIDTH&&(i=s.attributes.BANDWIDTH),i=i||z.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||z.Number.MAX_VALUE,i-r},_3=function(s,e){let i,r;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(i=s.attributes.RESOLUTION.width),i=i||z.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||z.Number.MAX_VALUE,i===r&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-r};let rx=function(s){const{main:e,bandwidth:i,playerWidth:r,playerHeight:o,playerObjectFit:l,limitRenditionByPlayerDimensions:c,playlistController:f}=s;if(!e)return;const p={bandwidth:i,width:r,height:o,limitRenditionByPlayerDimensions:c};let v=e.playlists;Cn.isAudioOnly(e)&&(v=f.getAudioTrackPlaylists_(),p.audioOnly=!0);let S=v.map(K=>{let de;const fe=K.attributes&&K.attributes.RESOLUTION&&K.attributes.RESOLUTION.width,me=K.attributes&&K.attributes.RESOLUTION&&K.attributes.RESOLUTION.height;return de=K.attributes&&K.attributes.BANDWIDTH,de=de||z.Number.MAX_VALUE,{bandwidth:de,width:fe,height:me,playlist:K}});Eu(S,(K,de)=>K.bandwidth-de.bandwidth),S=S.filter(K=>!Cn.isIncompatible(K.playlist));let x=S.filter(K=>Cn.isEnabled(K.playlist));x.length||(x=S.filter(K=>!Cn.isDisabled(K.playlist)));const D=x.filter(K=>K.bandwidth*ki.BANDWIDTH_VARIANCEK.bandwidth===k.bandwidth)[0];if(c===!1){const K=I||x[0]||S[0];if(K&&K.playlist){let de="sortedPlaylistReps";return I&&(de="bandwidthBestRep"),x[0]&&(de="enabledPlaylistReps"),jp(`choosing ${sx(K)} using ${de} with options`,p),K.playlist}return jp("could not choose a playlist with options",p),null}const C=D.filter(K=>K.width&&K.height);Eu(C,(K,de)=>K.width-de.width);const P=C.filter(K=>K.width===r&&K.height===o);k=P[P.length-1];const U=P.filter(K=>K.bandwidth===k.bandwidth)[0];let Y,$,G;U||(Y=C.filter(K=>l==="cover"?K.width>r&&K.height>o:K.width>r||K.height>o),$=Y.filter(K=>K.width===Y[0].width&&K.height===Y[0].height),k=$[$.length-1],G=$.filter(K=>K.bandwidth===k.bandwidth)[0]);let W;if(f.leastPixelDiffSelector){const K=C.map(de=>(de.pixelDiff=Math.abs(de.width-r)+Math.abs(de.height-o),de));Eu(K,(de,fe)=>de.pixelDiff===fe.pixelDiff?fe.bandwidth-de.bandwidth:de.pixelDiff-fe.pixelDiff),W=K[0]}const oe=W||G||U||I||x[0]||S[0];if(oe&&oe.playlist){let K="sortedPlaylistReps";return W?K="leastPixelDiffRep":G?K="resolutionPlusOneRep":U?K="resolutionBestRep":I?K="bandwidthBestRep":x[0]&&(K="enabledPlaylistReps"),jp(`choosing ${sx(oe)} using ${K} with options`,p),oe.playlist}return jp("could not choose a playlist with options",p),null};const ax=function(){let s=this.useDevicePixelRatio&&z.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),rx({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(xu(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(xu(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?xu(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},S3=function(s){let e=-1,i=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&z.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),e<0&&(e=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(e=s*this.systemBandwidth+(1-s)*e,i=this.systemBandwidth),rx({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(xu(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(xu(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?xu(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},x3=function(s){const{main:e,currentTime:i,bandwidth:r,duration:o,segmentDuration:l,timeUntilRebuffer:c,currentTimeline:f,syncController:p}=s,v=e.playlists.filter(I=>!Cn.isIncompatible(I));let S=v.filter(Cn.isEnabled);S.length||(S=v.filter(I=>!Cn.isDisabled(I)));const D=S.filter(Cn.hasAttribute.bind(null,"BANDWIDTH")).map(I=>{const P=p.getSyncPoint(I,o,f,i)?1:2,Y=Cn.estimateSegmentRequestTime(l,r,I)*P-c;return{playlist:I,rebufferingImpact:Y}}),k=D.filter(I=>I.rebufferingImpact<=0);return Eu(k,(I,C)=>Oy(C.playlist,I.playlist)),k.length?k[0]:(Eu(D,(I,C)=>I.rebufferingImpact-C.rebufferingImpact),D[0]||null)},E3=function(){const s=this.playlists.main.playlists.filter(Cn.isEnabled);return Eu(s,(i,r)=>Oy(i,r)),s.filter(i=>!!Id(this.playlists.main,i).video)[0]||null},M3=s=>{let e=0,i;return s.bytes&&(i=new Uint8Array(s.bytes),s.segments.forEach(r=>{i.set(r,e),e+=r.byteLength})),i};function ox(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const D3=function(s,e,i){if(!s[i]){e.trigger({type:"usage",name:"vhs-608"});let r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);const o=e.textTracks().getTrackById(r);if(o)s[i]=o;else{const l=e.options_.vhs&&e.options_.vhs.captionServices||{};let c=i,f=i,p=!1;const v=l[r];v&&(c=v.label,f=v.language,p=v.default),s[i]=e.addRemoteTextTrack({kind:"captions",id:r,default:p,label:c,language:f},!1).track}}},C3=function({inbandTextTracks:s,captionArray:e,timestampOffset:i}){if(!e)return;const r=z.WebKitDataCue||z.VTTCue;e.forEach(o=>{const l=o.stream;o.content?o.content.forEach(c=>{const f=new r(o.startTime+i,o.endTime+i,c.text);f.line=c.line,f.align="left",f.position=c.position,f.positionAlign="line-left",s[l].addCue(f)}):s[l].addCue(new r(o.startTime+i,o.endTime+i,o.text))})},A3=function(s){Object.defineProperties(s.frame,{id:{get(){return F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},w3=({inbandTextTracks:s,metadataArray:e,timestampOffset:i,videoDuration:r})=>{if(!e)return;const o=z.WebKitDataCue||z.VTTCue,l=s.metadataTrack_;if(!l||(e.forEach(S=>{const x=S.cueTime+i;typeof x!="number"||z.isNaN(x)||x<0||!(x<1/0)||!S.frames||!S.frames.length||S.frames.forEach(D=>{const k=new o(x,x,D.value||D.url||D.data||"");k.frame=D,k.value=D,A3(k),l.addCue(k)})}),!l.cues||!l.cues.length))return;const c=l.cues,f=[];for(let S=0;S{const D=S[x.startTime]||[];return D.push(x),S[x.startTime]=D,S},{}),v=Object.keys(p).sort((S,x)=>Number(S)-Number(x));v.forEach((S,x)=>{const D=p[S],k=isFinite(r)?r:S,I=Number(v[x+1])||k;D.forEach(C=>{C.endTime=I})})},N3={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},k3=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),O3=({inbandTextTracks:s,dateRanges:e})=>{const i=s.metadataTrack_;if(!i)return;const r=z.WebKitDataCue||z.VTTCue;e.forEach(o=>{for(const l of Object.keys(o)){if(k3.has(l))continue;const c=new r(o.startTime,o.endTime,"");c.id=o.id,c.type="com.apple.quicktime.HLS",c.value={key:N3[l],data:o[l]},(l==="scte35Out"||l==="scte35In")&&(c.value.data=new Uint8Array(c.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(c)}o.processDateRange()})},lx=(s,e,i)=>{s.metadataTrack_||(s.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},Ld=function(s,e,i){let r,o;if(i&&i.cues)for(r=i.cues.length;r--;)o=i.cues[r],o.startTime>=s&&o.endTime<=e&&i.removeCue(o)},I3=function(s){const e=s.cues;if(!e)return;const i={};for(let r=e.length-1;r>=0;r--){const o=e[r],l=`${o.startTime}-${o.endTime}-${o.text}`;i[l]?s.removeCue(o):i[l]=o}},L3=(s,e,i)=>{if(typeof e>"u"||e===null||!s.length)return[];const r=Math.ceil((e-i+3)*wo.ONE_SECOND_IN_TS);let o;for(o=0;or);o++);return s.slice(o)},R3=(s,e,i)=>{if(!e.length)return s;if(i)return e.slice();const r=e[0].pts;let o=0;for(o;o=r);o++);return s.slice(0,o).concat(e)},j3=(s,e,i,r)=>{const o=Math.ceil((e-r)*wo.ONE_SECOND_IN_TS),l=Math.ceil((i-r)*wo.ONE_SECOND_IN_TS),c=s.slice();let f=s.length;for(;f--&&!(s[f].pts<=l););if(f===-1)return c;let p=f+1;for(;p--&&!(s[p].pts<=o););return p=Math.max(p,0),c.splice(p,f-p+1),c},z3=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const i=Object.keys(s).sort(),r=Object.keys(e).sort();if(i.length!==r.length)return!1;for(let o=0;oi))return l}return r.length===0?0:r[r.length-1]},Rd=1,P3=500,ux=s=>typeof s=="number"&&isFinite(s),zp=1/60,B3=(s,e,i)=>s!=="main"||!e||!i?null:!i.hasAudio&&!i.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,q3=(s,e,i)=>{let r=e-ki.BACK_BUFFER_LENGTH;s.length&&(r=Math.max(r,s.start(0)));const o=e-i;return Math.min(o,r)},Mu=s=>{const{startOfSegment:e,duration:i,segment:r,part:o,playlist:{mediaSequence:l,id:c,segments:f=[]},mediaIndex:p,partIndex:v,timeline:S}=s,x=f.length-1;let D="mediaIndex/partIndex increment";s.getMediaInfoForTime?D=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(D="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(D+=` with independent ${s.independent}`);const k=typeof v=="number",I=s.segment.uri?"segment":"pre-segment",C=k?mS({preloadSegment:r})-1:0;return`${I} [${l+p}/${l+x}]`+(k?` part [${v}/${C}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(k?` part start/end [${o.start} => ${o.end}]`:"")+` startOfSegment [${e}] duration [${i}] timeline [${S}] selected by [${D}] playlist [${c}]`},cx=s=>`${s}TimingInfo`,F3=({segmentTimeline:s,currentTimeline:e,startOfSegment:i,buffered:r,overrideCheck:o})=>!o&&s===e?null:s{if(e===i)return!1;if(r==="audio"){const l=s.lastTimelineChange({type:"main"});return!l||l.to!==i}if(r==="main"&&o){const l=s.pendingTimelineChange({type:"audio"});return!(l&&l.to===i)}return!1},H3=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),i=s.pendingTimelineChange({type:"main"}),r=e&&i,o=r&&e.to!==i.to;return!!(r&&e.from!==-1&&i.from!==-1&&o)},V3=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&i&&e.to{const e=s.pendingSegment_;if(!e)return;if(Iy({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&H3(s.timelineChangeController_)){if(V3(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},$3=s=>{let e=0;return["video","audio"].forEach(function(i){const r=s[`${i}TimingInfo`];if(!r)return;const{start:o,end:l}=r;let c;typeof o=="bigint"||typeof l=="bigint"?c=z.BigInt(l)-z.BigInt(o):typeof o=="number"&&typeof l=="number"&&(c=l-o),typeof c<"u"&&c>e&&(e=c)}),typeof e=="bigint"&&es?Math.round(s)>e+ir:!1,Y3=(s,e)=>{if(e!=="hls")return null;const i=$3({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!i)return null;const r=s.playlist.targetDuration,o=dx({segmentDuration:i,maxDuration:r*2}),l=dx({segmentDuration:i,maxDuration:r}),c=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${i} when the reported duration is ${s.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return o||l?{severity:o?"warn":"info",message:c}:null},Po=({type:s,segment:e})=>{if(!e)return;const i=!!(e.key||e.map&&e.map.ke),r=!!(e.map&&!e.map.bytes),o=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:o,duration:e.duration,isEncrypted:i,isMediaInitialization:r}};class Ly extends F.EventTarget{constructor(e,i={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ls(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(r){r!==this.state_&&(this.logger_(`${this.state_} -> ${r}`),this.state_=r,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ja(this)}),this.sourceUpdater_.on("codecschange",r=>{this.trigger(ei({type:"codecschange"},r))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ja(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",r=>{this.trigger(ei({type:"timelinechange"},r)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():ja(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():ja(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return wy.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&z.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,z.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&wy.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ni();if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:r,isMuxed:o}=e;if(r&&i&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,i=!1){if(!e)return null;const r=Rp(e);let o=this.initSegments_[r];return i&&!o&&e.bytes&&(this.initSegments_[r]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e}segmentKey(e,i=!1){if(!e)return null;const r=US(e);let o=this.keyCache_[r];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[r]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});const l={resolvedUri:(o||e).resolvedUri};return o&&(l.bytes=o.bytes),l}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,i={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const r=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let l=null;if(r&&(r.id?l=r.id:r.uri&&(l=r.uri)),this.logger_(`playlist update [${l} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: currentTime: ${this.currentTime_()} bufferedEnd: ${gy(this.buffered_())} -`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const c=e.mediaSequence-r.mediaSequence;if(this.logger_(`live window shift [${c}]`),this.mediaIndex!==null)if(this.mediaIndex-=c,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const f=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!f.parts||!f.parts.length||!f.parts[this.partIndex])){const p=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=p}}o&&(o.mediaIndex-=c,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}pause(){this.checkBufferTimeout_&&(z.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&wy.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,i,r=()=>{},o=!1){if(i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let l=1;const c=()=>{l--,l===0&&r()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,i,c)),(o||this.loaderType_==="main")&&(this.gopBuffer_=jI(this.gopBuffer_,e,i,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,i,c));for(const f in this.inbandTextTracks_)Ld(e,i,this.inbandTextTracks_[f]);Ld(e,i,this.segmentMetadataTrack_),c()}monitorBuffer_(){this.checkBufferTimeout_&&z.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&z.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),PI)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const i={segmentInfo:Po({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:i}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,i=this.playlist_,r=this.partIndex){if(!i||!this.mediaSource_)return!1;const o=typeof e=="number"&&i.segments[e],l=e+1===i.segments.length,c=!o||!o.parts||r+1===o.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&l&&c}chooseNextRequest_(){const e=this.buffered_(),i=gy(e)||0,r=yy(e,this.currentTime_()),o=!this.hasPlayed_()&&r>=1,l=r>=this.goalBufferLength_(),c=this.playlist_.segments;if(!c.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const f={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(f.isSyncRequest)f.mediaIndex=UI(this.currentTimeline_,c,i),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${f.mediaIndex}`);else if(this.mediaIndex!==null){const D=c[this.mediaIndex],k=typeof this.partIndex=="number"?this.partIndex:-1;f.startOfSegment=D.end?D.end:i,D.parts&&D.parts[k+1]?(f.mediaIndex=this.mediaIndex,f.partIndex=k+1):f.mediaIndex=this.mediaIndex+1}else{let D,k,I;const C=this.fetchAtBuffer_?i:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const c=e.mediaSequence-r.mediaSequence;if(this.logger_(`live window shift [${c}]`),this.mediaIndex!==null)if(this.mediaIndex-=c,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const f=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!f.parts||!f.parts.length||!f.parts[this.partIndex])){const p=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=p}}o&&(o.mediaIndex-=c,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}pause(){this.checkBufferTimeout_&&(z.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&wy.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,i,r=()=>{},o=!1){if(i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let l=1;const c=()=>{l--,l===0&&r()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,i,c)),(o||this.loaderType_==="main")&&(this.gopBuffer_=j3(this.gopBuffer_,e,i,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,i,c));for(const f in this.inbandTextTracks_)Ld(e,i,this.inbandTextTracks_[f]);Ld(e,i,this.segmentMetadataTrack_),c()}monitorBuffer_(){this.checkBufferTimeout_&&z.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&z.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),P3)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const i={segmentInfo:Po({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:i}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,i=this.playlist_,r=this.partIndex){if(!i||!this.mediaSource_)return!1;const o=typeof e=="number"&&i.segments[e],l=e+1===i.segments.length,c=!o||!o.parts||r+1===o.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&l&&c}chooseNextRequest_(){const e=this.buffered_(),i=gy(e)||0,r=yy(e,this.currentTime_()),o=!this.hasPlayed_()&&r>=1,l=r>=this.goalBufferLength_(),c=this.playlist_.segments;if(!c.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const f={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(f.isSyncRequest)f.mediaIndex=U3(this.currentTimeline_,c,i),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${f.mediaIndex}`);else if(this.mediaIndex!==null){const D=c[this.mediaIndex],k=typeof this.partIndex=="number"?this.partIndex:-1;f.startOfSegment=D.end?D.end:i,D.parts&&D.parts[k+1]?(f.mediaIndex=this.mediaIndex,f.partIndex=k+1):f.mediaIndex=this.mediaIndex+1}else{let D,k,I;const C=this.fetchAtBuffer_?i:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: For TargetTime: ${C}. CurrentTime: ${this.currentTime_()} BufferedEnd: ${i} Fetch At Buffer: ${this.fetchAtBuffer_} -`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const P=this.getSyncInfoFromMediaSequenceSync_(C);if(!P){const U="No sync info found while using media sequence sync";return this.error({message:U,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(U)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${P.start} --> ${P.end})`),D=P.segmentIndex,k=P.partIndex,I=P.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const P=Cn.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:C,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});D=P.segmentIndex,k=P.partIndex,I=P.startTime}f.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${C}`:`currentTime ${C}`,f.mediaIndex=D,f.startOfSegment=I,f.partIndex=k,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${f.mediaIndex} `)}const p=c[f.mediaIndex];let v=p&&typeof f.partIndex=="number"&&p.parts&&p.parts[f.partIndex];if(!p||typeof f.partIndex=="number"&&!v)return null;typeof f.partIndex!="number"&&p.parts&&(f.partIndex=0,v=p.parts[0]);const S=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!r&&v&&!S&&!v.independent)if(f.partIndex===0){const D=c[f.mediaIndex-1],k=D.parts&&D.parts.length&&D.parts[D.parts.length-1];k&&k.independent&&(f.mediaIndex-=1,f.partIndex=D.parts.length-1,f.independent="previous segment")}else p.parts[f.partIndex-1].independent&&(f.partIndex-=1,f.independent="previous part");const x=this.mediaSource_&&this.mediaSource_.readyState==="ended";return f.mediaIndex>=c.length-1&&x&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,f.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(f))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const i=Math.max(e,this.mediaSequenceSync_.start);e!==i&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${i}`);const r=this.mediaSequenceSync_.getSyncInfoForTime(i);if(!r)return null;if(!r.isAppended)return r;const o=this.mediaSequenceSync_.getSyncInfoForTime(r.end);return o?(o.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),o):null}generateSegmentInfo_(e){const{independent:i,playlist:r,mediaIndex:o,startOfSegment:l,isSyncRequest:c,partIndex:f,forceTimestampOffset:p,getMediaInfoForTime:v}=e,S=r.segments[o],x=typeof f=="number"&&S.parts[f],D={requestId:"segment-loader-"+Math.random(),uri:x&&x.resolvedUri||S.resolvedUri,mediaIndex:o,partIndex:x?f:null,isSyncRequest:c,startOfSegment:l,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:S.timeline,duration:x&&x.duration||S.duration,segment:S,part:x,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:v,independent:i},k=typeof p<"u"?p:this.isPendingTimestampOffset_;D.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:S.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:k});const I=gy(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(D.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(D.gopsToAlignWith=LI(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),D}timestampOffsetForSegment_(e){return FI(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const i=this.currentTime_(),r=e.bandwidth,o=this.pendingSegment_.duration,l=Cn.estimateSegmentRequestTime(o,r,this.playlist_,e.bytesReceived),c=fO(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(l<=c)return;const f=xI({main:this.vhs_.playlists.main,currentTime:i,bandwidth:r,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:c,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!f)return;const v=l-c-f.rebufferingImpact;let S=.5;c<=ir&&(S=1),!(!f.playlist||f.playlist.uri===this.playlist_.uri||v{l[c.stream]=l[c.stream]||{startTime:1/0,captions:[],endTime:0};const f=l[c.stream];f.startTime=Math.min(f.startTime,c.startTime+o),f.endTime=Math.max(f.endTime,c.endTime+o),f.captions.push(c)}),Object.keys(l).forEach(c=>{const{startTime:f,endTime:p,captions:v}=l[c],S=this.inbandTextTracks_;this.logger_(`adding cues from ${f} -> ${p} for ${c}`),DI(S,this.vhs_.tech_,c),Ld(f,p,S[c]),CI({captionArray:v,inbandTextTracks:S,timestampOffset:o})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,r));return}this.addMetadataToTextTrack(r,i,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(i=>i())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(i=>i())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Iy({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;const{hasAudio:r,hasVideo:o,isMuxed:l}=i;return!(o&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!l&&!e.audioTimingInfo||Iy({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){ja(this),this.callQueue_.push(this.handleData_.bind(this,e,i));return}const r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[cx(i.type)].start;else{const o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo;let c;l&&(c=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:c,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,i.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});const o=this.chooseNextRequest_();if(o.mediaIndex!==r.mediaIndex||o.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,i)}}updateAppendInitSegmentStatus(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:i,map:r,playlist:o}){if(r){const l=Rp(r);if(this.activeInitSegmentId_===l)return null;i=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=l}return i&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=o,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,i):null}handleQuotaExceededError_({segmentInfo:e,type:i,bytes:r},o){const l=this.sourceUpdater_.audioBuffered(),c=this.sourceUpdater_.videoBuffered();l.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+zo(l).join(", ")),c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+zo(c).join(", "));const f=l.length?l.start(0):0,p=l.length?l.end(l.length-1):0,v=c.length?c.start(0):0,S=c.length?c.end(c.length-1):0;if(p-f<=Rd&&S-v<=Rd){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${r.byteLength}, audio buffer: ${zo(l).join(", ")}, video buffer: ${zo(c).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:i,bytes:r}));const D=this.currentTime_()-Rd;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${D}`),this.remove(0,D,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Rd}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=z.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Rd*1e3)},!0)}handleAppendError_({segmentInfo:e,type:i,bytes:r},o){if(o){if(o.code===AS){this.handleQuotaExceededError_({segmentInfo:e,type:i,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",o),this.error({message:`${i} append of ${r.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:o,bytes:l}){if(!l){const f=[o];let p=o.byteLength;r&&(f.unshift(r),p+=r.byteLength),l=MI({bytes:p,segments:f})}const c={segmentInfo:Po({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:c}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:i,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:e,type:i,bytes:l}))}handleSegmentTimingInfo_(e,i,r){if(!this.pendingSegment_||i!==this.pendingSegment_.requestId)return;const o=this.pendingSegment_.segment,l=`${e}TimingInfo`;o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=r.prependedContentDuration||0,o[l].transmuxedPresentationStart=r.start.presentation,o[l].transmuxedDecodeStart=r.start.decode,o[l].transmuxedPresentationEnd=r.end.presentation,o[l].transmuxedDecodeEnd=r.end.decode,o[l].baseMediaDecodeTime=r.baseMediaDecodeTime}appendData_(e,i){const{type:r,data:o}=i;if(!o||!o.byteLength||r==="audio"&&this.audioDisabled_)return;const l=this.getInitSegmentAndUpdateState_({type:r,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:l,data:o})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){ja(this),this.loadQueue_.push(()=>{const i=ei({},e,{forceTimestampOffset:!0});ei(e,this.generateSegmentInfo_(i)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const i=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),o=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,c=r||o&&l;this.logger_(`Requesting +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const P=this.getSyncInfoFromMediaSequenceSync_(C);if(!P){const U="No sync info found while using media sequence sync";return this.error({message:U,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(U)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${P.start} --> ${P.end})`),D=P.segmentIndex,k=P.partIndex,I=P.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const P=Cn.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:C,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});D=P.segmentIndex,k=P.partIndex,I=P.startTime}f.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${C}`:`currentTime ${C}`,f.mediaIndex=D,f.startOfSegment=I,f.partIndex=k,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${f.mediaIndex} `)}const p=c[f.mediaIndex];let v=p&&typeof f.partIndex=="number"&&p.parts&&p.parts[f.partIndex];if(!p||typeof f.partIndex=="number"&&!v)return null;typeof f.partIndex!="number"&&p.parts&&(f.partIndex=0,v=p.parts[0]);const S=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!r&&v&&!S&&!v.independent)if(f.partIndex===0){const D=c[f.mediaIndex-1],k=D.parts&&D.parts.length&&D.parts[D.parts.length-1];k&&k.independent&&(f.mediaIndex-=1,f.partIndex=D.parts.length-1,f.independent="previous segment")}else p.parts[f.partIndex-1].independent&&(f.partIndex-=1,f.independent="previous part");const x=this.mediaSource_&&this.mediaSource_.readyState==="ended";return f.mediaIndex>=c.length-1&&x&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,f.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(f))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const i=Math.max(e,this.mediaSequenceSync_.start);e!==i&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${i}`);const r=this.mediaSequenceSync_.getSyncInfoForTime(i);if(!r)return null;if(!r.isAppended)return r;const o=this.mediaSequenceSync_.getSyncInfoForTime(r.end);return o?(o.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),o):null}generateSegmentInfo_(e){const{independent:i,playlist:r,mediaIndex:o,startOfSegment:l,isSyncRequest:c,partIndex:f,forceTimestampOffset:p,getMediaInfoForTime:v}=e,S=r.segments[o],x=typeof f=="number"&&S.parts[f],D={requestId:"segment-loader-"+Math.random(),uri:x&&x.resolvedUri||S.resolvedUri,mediaIndex:o,partIndex:x?f:null,isSyncRequest:c,startOfSegment:l,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:S.timeline,duration:x&&x.duration||S.duration,segment:S,part:x,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:v,independent:i},k=typeof p<"u"?p:this.isPendingTimestampOffset_;D.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:S.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:k});const I=gy(this.sourceUpdater_.audioBuffered());return typeof I=="number"&&(D.audioAppendStart=I-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(D.gopsToAlignWith=L3(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),D}timestampOffsetForSegment_(e){return F3(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const i=this.currentTime_(),r=e.bandwidth,o=this.pendingSegment_.duration,l=Cn.estimateSegmentRequestTime(o,r,this.playlist_,e.bytesReceived),c=fO(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(l<=c)return;const f=x3({main:this.vhs_.playlists.main,currentTime:i,bandwidth:r,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:c,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!f)return;const v=l-c-f.rebufferingImpact;let S=.5;c<=ir&&(S=1),!(!f.playlist||f.playlist.uri===this.playlist_.uri||v{l[c.stream]=l[c.stream]||{startTime:1/0,captions:[],endTime:0};const f=l[c.stream];f.startTime=Math.min(f.startTime,c.startTime+o),f.endTime=Math.max(f.endTime,c.endTime+o),f.captions.push(c)}),Object.keys(l).forEach(c=>{const{startTime:f,endTime:p,captions:v}=l[c],S=this.inbandTextTracks_;this.logger_(`adding cues from ${f} -> ${p} for ${c}`),D3(S,this.vhs_.tech_,c),Ld(f,p,S[c]),C3({captionArray:v,inbandTextTracks:S,timestampOffset:o})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,r));return}this.addMetadataToTextTrack(r,i,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(i=>i())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(i=>i())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Iy({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;const{hasAudio:r,hasVideo:o,isMuxed:l}=i;return!(o&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!l&&!e.audioTimingInfo||Iy({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){ja(this),this.callQueue_.push(this.handleData_.bind(this,e,i));return}const r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[cx(i.type)].start;else{const o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo;let c;l&&(c=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:c,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,i.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});const o=this.chooseNextRequest_();if(o.mediaIndex!==r.mediaIndex||o.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,i)}}updateAppendInitSegmentStatus(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:i,map:r,playlist:o}){if(r){const l=Rp(r);if(this.activeInitSegmentId_===l)return null;i=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=l}return i&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=o,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,i):null}handleQuotaExceededError_({segmentInfo:e,type:i,bytes:r},o){const l=this.sourceUpdater_.audioBuffered(),c=this.sourceUpdater_.videoBuffered();l.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+zo(l).join(", ")),c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+zo(c).join(", "));const f=l.length?l.start(0):0,p=l.length?l.end(l.length-1):0,v=c.length?c.start(0):0,S=c.length?c.end(c.length-1):0;if(p-f<=Rd&&S-v<=Rd){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${r.byteLength}, audio buffer: ${zo(l).join(", ")}, video buffer: ${zo(c).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:i,bytes:r}));const D=this.currentTime_()-Rd;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${D}`),this.remove(0,D,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Rd}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=z.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Rd*1e3)},!0)}handleAppendError_({segmentInfo:e,type:i,bytes:r},o){if(o){if(o.code===AS){this.handleQuotaExceededError_({segmentInfo:e,type:i,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",o),this.error({message:`${i} append of ${r.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:o,bytes:l}){if(!l){const f=[o];let p=o.byteLength;r&&(f.unshift(r),p+=r.byteLength),l=M3({bytes:p,segments:f})}const c={segmentInfo:Po({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:c}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:i,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:e,type:i,bytes:l}))}handleSegmentTimingInfo_(e,i,r){if(!this.pendingSegment_||i!==this.pendingSegment_.requestId)return;const o=this.pendingSegment_.segment,l=`${e}TimingInfo`;o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=r.prependedContentDuration||0,o[l].transmuxedPresentationStart=r.start.presentation,o[l].transmuxedDecodeStart=r.start.decode,o[l].transmuxedPresentationEnd=r.end.presentation,o[l].transmuxedDecodeEnd=r.end.decode,o[l].baseMediaDecodeTime=r.baseMediaDecodeTime}appendData_(e,i){const{type:r,data:o}=i;if(!o||!o.byteLength||r==="audio"&&this.audioDisabled_)return;const l=this.getInitSegmentAndUpdateState_({type:r,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:l,data:o})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){ja(this),this.loadQueue_.push(()=>{const i=ei({},e,{forceTimestampOffset:!0});ei(e,this.generateSegmentInfo_(i)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const i=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),o=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,c=r||o&&l;this.logger_(`Requesting ${ox(e.uri)} -${Mu(e)}`),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=bI({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:f,level:p,stream:v})=>{this.logger_(`${Mu(e)} logged from transmuxer stream ${v} as a ${p}: ${f}`)},triggerSegmentEventFn:({type:f,segment:p,keyInfo:v,trackInfo:S,timingInfo:x})=>{const k={segmentInfo:Po({segment:p})};v&&(k.keyInfo=v),S&&(k.trackInfo=S),x&&(k.timingInfo=x),this.trigger({type:f,metadata:k})}})}trimBackBuffer_(e){const i=qI(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)}createSimplifiedSegmentObj_(e){const i=e.segment,r=e.part,o=e.segment.key||e.segment.map&&e.segment.map.key,l=e.segment.map&&!e.segment.map.bytes,c={resolvedUri:r?r.resolvedUri:i.resolvedUri,byterange:r?r.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:o,isMediaInitialization:l},f=e.playlist.segments[e.mediaIndex-1];if(f&&f.timeline===i.timeline&&(f.videoTimingInfo?c.baseStartTime=f.videoTimingInfo.transmuxedDecodeEnd:f.audioTimingInfo&&(c.baseStartTime=f.audioTimingInfo.transmuxedDecodeEnd)),i.key){const p=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);c.key=this.segmentKey(i.key),c.key.iv=p}return i.map&&(c.map=this.initSegmentForMap(i.map)),c}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e"u"||v.end!==o+l?o:f.start}waitForAppendsToComplete_(e){const i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:r,hasVideo:o,isMuxed:l}=i,c=this.loaderType_==="main"&&o,f=!this.audioDisabled_&&r&&!l;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}c&&e.waitingOnAppends++,f&&e.waitingOnAppends++,c&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),f&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const i=BI(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:i,timingInfo:r}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const i=this.getMediaInfo_(),o=this.loaderType_==="main"&&i&&i.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const p={segmentInfo:Po({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:p})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=YI(e,this.sourceType_);if(i&&(i.severity==="warn"?F.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Mu(e)}`);return}this.logger_(`Appended ${Mu(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const r=e.segment,o=e.part,l=r.end&&this.currentTime_()-r.end>e.playlist.targetDuration*3,c=o&&o.end&&this.currentTime_()-o.end>e.playlist.partTargetDuration*3;if(l||c){this.logger_(`bad ${l?"segment":"part"} ${Mu(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},QI=["video","audio"],Ry=(s,e)=>{const i=e[`${s}Buffer`];return i&&i.updating||e.queuePending[s]},GI=(s,e)=>{for(let i=0;i{if(e.queue.length===0)return;let i=0,r=e.queue[i];if(r.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),r.action(e),r.doneFn&&r.doneFn(),Du("audio",e),Du("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Ry(s,e))){if(r.type!==s){if(i=GI(s,e.queue),i===null)return;r=e.queue[i]}if(e.queue.splice(i,1),e.queuePending[s]=r,r.action(s,e),!r.doneFn){e.queuePending[s]=null,Du(s,e);return}}},fx=(s,e)=>{const i=e[`${s}Buffer`],r=hx(s);i&&(i.removeEventListener("updateend",e[`on${r}UpdateEnd_`]),i.removeEventListener("error",e[`on${r}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},rr=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Fn={appendBuffer:(s,e,i)=>(r,o)=>{const l=o[`${r}Buffer`];if(rr(o.mediaSource,l)){o.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${r}Buffer`);try{l.appendBuffer(s)}catch(c){o.logger_(`Error with code ${c.code} `+(c.code===AS?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${r}Buffer`),o.queuePending[r]=null,i(c)}}},remove:(s,e)=>(i,r)=>{const o=r[`${i}Buffer`];if(rr(r.mediaSource,o)){r.logger_(`Removing ${s} to ${e} from ${i}Buffer`);try{o.remove(s,e)}catch{r.logger_(`Remove ${s} to ${e} from ${i}Buffer failed`)}}},timestampOffset:s=>(e,i)=>{const r=i[`${e}Buffer`];rr(i.mediaSource,r)&&(i.logger_(`Setting ${e}timestampOffset to ${s}`),r.timestampOffset=s)},callback:s=>(e,i)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(i){F.log.warn("Failed to call media source endOfStream",i)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(i){F.log.warn("Failed to set media source duration",i)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const i=e[`${s}Buffer`];if(rr(e.mediaSource,i)){e.logger_(`calling abort on ${s}Buffer`);try{i.abort()}catch(r){F.log.warn(`Failed to abort on ${s}Buffer`,r)}}},addSourceBuffer:(s,e)=>i=>{const r=hx(s),o=Fl(e);i.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const l=i.mediaSource.addSourceBuffer(o);l.addEventListener("updateend",i[`on${r}UpdateEnd_`]),l.addEventListener("error",i[`on${r}Error_`]),i.codecs[s]=e,i[`${s}Buffer`]=l},removeSourceBuffer:s=>e=>{const i=e[`${s}Buffer`];if(fx(s,e),!!rr(e.mediaSource,i)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(r){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,r)}}},changeType:s=>(e,i)=>{const r=i[`${e}Buffer`],o=Fl(s);if(!rr(i.mediaSource,r))return;const l=s.substring(0,s.indexOf(".")),c=i.codecs[e];if(c.substring(0,c.indexOf("."))===l)return;const p={codecsChangeInfo:{from:c,to:s}};i.trigger({type:"codecschange",metadata:p}),i.logger_(`changing ${e}Buffer codec from ${c} to ${s}`);try{r.changeType(o),i.codecs[e]=s}catch(v){p.errorType=F.Error.StreamingCodecsChangeError,p.error=v,v.metadata=p,i.error_=v,i.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,v)}}},Hn=({type:s,sourceUpdater:e,action:i,doneFn:r,name:o})=>{e.queue.push({type:s,action:i,doneFn:r,name:o}),Du(s,e)},px=(s,e)=>i=>{const r=e[`${s}Buffered`](),o=cO(r);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,o),e.queuePending[s]){const l=e.queuePending[s].doneFn;e.queuePending[s]=null,l&&l(e[`${s}Error_`])}Du(s,e)};class mx extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Du("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ls("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=px("video",this),this.onAudioUpdateEnd_=px("audio",this),this.onVideoError_=i=>{this.videoError_=i},this.onAudioError_=i=>{this.audioError_=i},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,i){Hn({type:"mediaSource",sourceUpdater:this,action:Fn.addSourceBuffer(e,i),name:"addSourceBuffer"})}abort(e){Hn({type:e,sourceUpdater:this,action:Fn.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){F.log.error("removeSourceBuffer is not supported!");return}Hn({type:"mediaSource",sourceUpdater:this,action:Fn.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&z.MediaSource&&z.MediaSource.prototype&&typeof z.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return z.SourceBuffer&&z.SourceBuffer.prototype&&typeof z.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,i){if(!this.canChangeType()){F.log.error("changeType is not supported!");return}Hn({type:e,sourceUpdater:this,action:Fn.changeType(i),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(i=>{const r=e[i];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(i,r);this.canChangeType()&&this.changeType(i,r)})}appendBuffer(e,i){const{segmentInfo:r,type:o,bytes:l}=e;if(this.processedAppend_=!0,o==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,i]),this.logger_(`delayed audio append of ${l.length} until video append`);return}const c=i;if(Hn({type:o,sourceUpdater:this,action:Fn.appendBuffer(l,r||{mediaIndex:-1},c),doneFn:i,name:"appendBuffer"}),o==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const f=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${f.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,f.forEach(p=>{this.appendBuffer.apply(this,p)})}}audioBuffered(){return rr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ni()}videoBuffered(){return rr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ni()}buffered(){const e=rr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,i=rr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return i&&!e?this.audioBuffered():e&&!i?this.videoBuffered():hO(this.audioBuffered(),this.videoBuffered())}setDuration(e,i=$r){Hn({type:"mediaSource",sourceUpdater:this,action:Fn.duration(e),name:"duration",doneFn:i})}endOfStream(e=null,i=$r){typeof e!="string"&&(e=void 0),Hn({type:"mediaSource",sourceUpdater:this,action:Fn.endOfStream(e),name:"endOfStream",doneFn:i})}removeAudio(e,i,r=$r){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}Hn({type:"audio",sourceUpdater:this,action:Fn.remove(e,i),doneFn:r,name:"remove"})}removeVideo(e,i,r=$r){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}Hn({type:"video",sourceUpdater:this,action:Fn.remove(e,i),doneFn:r,name:"remove"})}updating(){return!!(Ry("audio",this)||Ry("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Hn({type:"audio",sourceUpdater:this,action:Fn.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Hn({type:"video",sourceUpdater:this,action:Fn.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Hn({type:"audio",sourceUpdater:this,action:Fn.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Hn({type:"video",sourceUpdater:this,action:Fn.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),QI.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>fx(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const gx=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),XI=s=>{const e=new Uint8Array(s);return Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("")},yx=new Uint8Array(` +${Mu(e)}`),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=b3({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:f,level:p,stream:v})=>{this.logger_(`${Mu(e)} logged from transmuxer stream ${v} as a ${p}: ${f}`)},triggerSegmentEventFn:({type:f,segment:p,keyInfo:v,trackInfo:S,timingInfo:x})=>{const k={segmentInfo:Po({segment:p})};v&&(k.keyInfo=v),S&&(k.trackInfo=S),x&&(k.timingInfo=x),this.trigger({type:f,metadata:k})}})}trimBackBuffer_(e){const i=q3(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)}createSimplifiedSegmentObj_(e){const i=e.segment,r=e.part,o=e.segment.key||e.segment.map&&e.segment.map.key,l=e.segment.map&&!e.segment.map.bytes,c={resolvedUri:r?r.resolvedUri:i.resolvedUri,byterange:r?r.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:o,isMediaInitialization:l},f=e.playlist.segments[e.mediaIndex-1];if(f&&f.timeline===i.timeline&&(f.videoTimingInfo?c.baseStartTime=f.videoTimingInfo.transmuxedDecodeEnd:f.audioTimingInfo&&(c.baseStartTime=f.audioTimingInfo.transmuxedDecodeEnd)),i.key){const p=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);c.key=this.segmentKey(i.key),c.key.iv=p}return i.map&&(c.map=this.initSegmentForMap(i.map)),c}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e"u"||v.end!==o+l?o:f.start}waitForAppendsToComplete_(e){const i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:r,hasVideo:o,isMuxed:l}=i,c=this.loaderType_==="main"&&o,f=!this.audioDisabled_&&r&&!l;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}c&&e.waitingOnAppends++,f&&e.waitingOnAppends++,c&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),f&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const i=B3(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:i,timingInfo:r}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const i=this.getMediaInfo_(),o=this.loaderType_==="main"&&i&&i.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const p={segmentInfo:Po({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:p})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=Y3(e,this.sourceType_);if(i&&(i.severity==="warn"?F.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Mu(e)}`);return}this.logger_(`Appended ${Mu(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const r=e.segment,o=e.part,l=r.end&&this.currentTime_()-r.end>e.playlist.targetDuration*3,c=o&&o.end&&this.currentTime_()-o.end>e.playlist.partTargetDuration*3;if(l||c){this.logger_(`bad ${l?"segment":"part"} ${Mu(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},Q3=["video","audio"],Ry=(s,e)=>{const i=e[`${s}Buffer`];return i&&i.updating||e.queuePending[s]},G3=(s,e)=>{for(let i=0;i{if(e.queue.length===0)return;let i=0,r=e.queue[i];if(r.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),r.action(e),r.doneFn&&r.doneFn(),Du("audio",e),Du("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Ry(s,e))){if(r.type!==s){if(i=G3(s,e.queue),i===null)return;r=e.queue[i]}if(e.queue.splice(i,1),e.queuePending[s]=r,r.action(s,e),!r.doneFn){e.queuePending[s]=null,Du(s,e);return}}},fx=(s,e)=>{const i=e[`${s}Buffer`],r=hx(s);i&&(i.removeEventListener("updateend",e[`on${r}UpdateEnd_`]),i.removeEventListener("error",e[`on${r}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},rr=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Fn={appendBuffer:(s,e,i)=>(r,o)=>{const l=o[`${r}Buffer`];if(rr(o.mediaSource,l)){o.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${r}Buffer`);try{l.appendBuffer(s)}catch(c){o.logger_(`Error with code ${c.code} `+(c.code===AS?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${r}Buffer`),o.queuePending[r]=null,i(c)}}},remove:(s,e)=>(i,r)=>{const o=r[`${i}Buffer`];if(rr(r.mediaSource,o)){r.logger_(`Removing ${s} to ${e} from ${i}Buffer`);try{o.remove(s,e)}catch{r.logger_(`Remove ${s} to ${e} from ${i}Buffer failed`)}}},timestampOffset:s=>(e,i)=>{const r=i[`${e}Buffer`];rr(i.mediaSource,r)&&(i.logger_(`Setting ${e}timestampOffset to ${s}`),r.timestampOffset=s)},callback:s=>(e,i)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(i){F.log.warn("Failed to call media source endOfStream",i)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(i){F.log.warn("Failed to set media source duration",i)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const i=e[`${s}Buffer`];if(rr(e.mediaSource,i)){e.logger_(`calling abort on ${s}Buffer`);try{i.abort()}catch(r){F.log.warn(`Failed to abort on ${s}Buffer`,r)}}},addSourceBuffer:(s,e)=>i=>{const r=hx(s),o=Fl(e);i.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const l=i.mediaSource.addSourceBuffer(o);l.addEventListener("updateend",i[`on${r}UpdateEnd_`]),l.addEventListener("error",i[`on${r}Error_`]),i.codecs[s]=e,i[`${s}Buffer`]=l},removeSourceBuffer:s=>e=>{const i=e[`${s}Buffer`];if(fx(s,e),!!rr(e.mediaSource,i)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(r){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,r)}}},changeType:s=>(e,i)=>{const r=i[`${e}Buffer`],o=Fl(s);if(!rr(i.mediaSource,r))return;const l=s.substring(0,s.indexOf(".")),c=i.codecs[e];if(c.substring(0,c.indexOf("."))===l)return;const p={codecsChangeInfo:{from:c,to:s}};i.trigger({type:"codecschange",metadata:p}),i.logger_(`changing ${e}Buffer codec from ${c} to ${s}`);try{r.changeType(o),i.codecs[e]=s}catch(v){p.errorType=F.Error.StreamingCodecsChangeError,p.error=v,v.metadata=p,i.error_=v,i.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,v)}}},Hn=({type:s,sourceUpdater:e,action:i,doneFn:r,name:o})=>{e.queue.push({type:s,action:i,doneFn:r,name:o}),Du(s,e)},px=(s,e)=>i=>{const r=e[`${s}Buffered`](),o=cO(r);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,o),e.queuePending[s]){const l=e.queuePending[s].doneFn;e.queuePending[s]=null,l&&l(e[`${s}Error_`])}Du(s,e)};class mx extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Du("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ls("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=px("video",this),this.onAudioUpdateEnd_=px("audio",this),this.onVideoError_=i=>{this.videoError_=i},this.onAudioError_=i=>{this.audioError_=i},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,i){Hn({type:"mediaSource",sourceUpdater:this,action:Fn.addSourceBuffer(e,i),name:"addSourceBuffer"})}abort(e){Hn({type:e,sourceUpdater:this,action:Fn.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){F.log.error("removeSourceBuffer is not supported!");return}Hn({type:"mediaSource",sourceUpdater:this,action:Fn.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&z.MediaSource&&z.MediaSource.prototype&&typeof z.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return z.SourceBuffer&&z.SourceBuffer.prototype&&typeof z.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,i){if(!this.canChangeType()){F.log.error("changeType is not supported!");return}Hn({type:e,sourceUpdater:this,action:Fn.changeType(i),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(i=>{const r=e[i];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(i,r);this.canChangeType()&&this.changeType(i,r)})}appendBuffer(e,i){const{segmentInfo:r,type:o,bytes:l}=e;if(this.processedAppend_=!0,o==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,i]),this.logger_(`delayed audio append of ${l.length} until video append`);return}const c=i;if(Hn({type:o,sourceUpdater:this,action:Fn.appendBuffer(l,r||{mediaIndex:-1},c),doneFn:i,name:"appendBuffer"}),o==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const f=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${f.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,f.forEach(p=>{this.appendBuffer.apply(this,p)})}}audioBuffered(){return rr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ni()}videoBuffered(){return rr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ni()}buffered(){const e=rr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,i=rr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return i&&!e?this.audioBuffered():e&&!i?this.videoBuffered():hO(this.audioBuffered(),this.videoBuffered())}setDuration(e,i=$r){Hn({type:"mediaSource",sourceUpdater:this,action:Fn.duration(e),name:"duration",doneFn:i})}endOfStream(e=null,i=$r){typeof e!="string"&&(e=void 0),Hn({type:"mediaSource",sourceUpdater:this,action:Fn.endOfStream(e),name:"endOfStream",doneFn:i})}removeAudio(e,i,r=$r){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}Hn({type:"audio",sourceUpdater:this,action:Fn.remove(e,i),doneFn:r,name:"remove"})}removeVideo(e,i,r=$r){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}Hn({type:"video",sourceUpdater:this,action:Fn.remove(e,i),doneFn:r,name:"remove"})}updating(){return!!(Ry("audio",this)||Ry("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Hn({type:"audio",sourceUpdater:this,action:Fn.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Hn({type:"video",sourceUpdater:this,action:Fn.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Hn({type:"audio",sourceUpdater:this,action:Fn.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Hn({type:"video",sourceUpdater:this,action:Fn.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Q3.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>fx(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const gx=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),X3=s=>{const e=new Uint8Array(s);return Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("")},yx=new Uint8Array(` -`.split("").map(s=>s.charCodeAt(0)));class WI extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class KI extends Ly{constructor(e,i={}){super(e,i),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ni();const e=this.subtitlesTrack_.cues,i=e[0].startTime,r=e[e.length-1].startTime;return Ni([[i,r]])}initSegmentForMap(e,i=!1){if(!e)return null;const r=Rp(e);let o=this.initSegments_[r];if(i&&!o&&e.bytes){const l=yx.byteLength+e.bytes.byteLength,c=new Uint8Array(l);c.set(e.bytes),c.set(yx,e.bytes.byteLength),this.initSegments_[r]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:c}}return o||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,i){Ld(e,i,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const i=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",i),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,i,r){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===sr.TIMEOUT&&this.handleTimeout_(),e.code===sr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const o=this.pendingSegment_,l=r.mp4VttCues&&r.mp4VttCues.length;l&&(o.mp4VttCues=r.mp4VttCues),this.saveBandwidthRelatedStats_(o.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");const c=o.segment;if(c.map&&(c.map.bytes=i.map.bytes),o.bytes=i.bytes,typeof z.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,i,r),()=>this.stopForError({message:"Error loading vtt.js"}));return}c.requested=!0;try{this.parseVTTCues_(o)}catch(f){this.stopForError({message:f.message,metadata:{errorType:F.Error.StreamingVttParserError,error:f}});return}if(l||this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=c.duration,o.cues.forEach(f=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new z.VTTCue(f.startTime,f.endTime,f.text):f)}),II(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,i){const r=e&&e.type==="vtt",o=i&&i.type==="text";r&&o&&super.handleData_(e,i)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const i=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(r=>{const o=r.start+i,l=r.end+i,c=new z.VTTCue(o,l,r.cueText);r.settings&&r.settings.split(" ").forEach(f=>{const p=f.split(":"),v=p[0],S=p[1];c[v]=isNaN(S)?S:Number(S)}),e.cues.push(c)})}parseVTTCues_(e){let i,r=!1;if(typeof z.WebVTT!="function")throw new WI;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof z.TextDecoder=="function"?i=new z.TextDecoder("utf8"):(i=z.WebVTT.StringDecoder(),r=!0);const o=new z.WebVTT.Parser(z,z.vttjs,i);if(o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=c=>{e.timestampmap=c},o.onparsingerror=c=>{F.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){let c=e.segment.map.bytes;r&&(c=gx(c)),o.parse(c)}let l=e.bytes;r&&(l=gx(l)),o.parse(l),o.flush()}updateTimeMapping_(e,i,r){const o=e.segment;if(!i)return;if(!e.cues.length){o.empty=!0;return}const{MPEGTS:l,LOCAL:c}=e.timestampmap,p=l/wo.ONE_SECOND_IN_TS-c+i.mapping;if(e.cues.forEach(v=>{const S=v.endTime-v.startTime,x=this.handleRollover_(v.startTime+p,i.time);v.startTime=Math.max(x,0),v.endTime=Math.max(x+S,0)}),!r.syncInfo){const v=e.cues[0].startTime,S=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(v,S-o.duration)}}}handleRollover_(e,i){if(i===null)return e;let r=e*wo.ONE_SECOND_IN_TS;const o=i*wo.ONE_SECOND_IN_TS;let l;for(o4294967296;)r+=l;return r/wo.ONE_SECOND_IN_TS}}const ZI=function(s,e){const i=s.cues;for(let r=0;r=o.adStartTime&&e<=o.adEndTime)return o}return null},JI=function(s,e,i=0){if(!s.segments)return;let r=i,o;for(let l=0;l=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class vx{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,i){const{mediaSequence:r,segments:o}=e;if(this.isReliable_=this.isReliablePlaylist_(r,o),!!this.isReliable_)return this.updateStorage_(o,r,this.calculateBaseTime_(r,o,i))}getSyncInfoForTime(e){for(const{segmentSyncInfo:i,partsSyncInfo:r}of this.storage_.values())if(r.length){for(const o of r)if(o.isInRange(e))return o}else if(i.isInRange(e))return i;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,i,r){const o=new Map;let l=` +`.split("").map(s=>s.charCodeAt(0)));class W3 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class K3 extends Ly{constructor(e,i={}){super(e,i),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ni();const e=this.subtitlesTrack_.cues,i=e[0].startTime,r=e[e.length-1].startTime;return Ni([[i,r]])}initSegmentForMap(e,i=!1){if(!e)return null;const r=Rp(e);let o=this.initSegments_[r];if(i&&!o&&e.bytes){const l=yx.byteLength+e.bytes.byteLength,c=new Uint8Array(l);c.set(e.bytes),c.set(yx,e.bytes.byteLength),this.initSegments_[r]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:c}}return o||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,i){Ld(e,i,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const i=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",i),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,i,r){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===sr.TIMEOUT&&this.handleTimeout_(),e.code===sr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const o=this.pendingSegment_,l=r.mp4VttCues&&r.mp4VttCues.length;l&&(o.mp4VttCues=r.mp4VttCues),this.saveBandwidthRelatedStats_(o.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");const c=o.segment;if(c.map&&(c.map.bytes=i.map.bytes),o.bytes=i.bytes,typeof z.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,i,r),()=>this.stopForError({message:"Error loading vtt.js"}));return}c.requested=!0;try{this.parseVTTCues_(o)}catch(f){this.stopForError({message:f.message,metadata:{errorType:F.Error.StreamingVttParserError,error:f}});return}if(l||this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=c.duration,o.cues.forEach(f=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new z.VTTCue(f.startTime,f.endTime,f.text):f)}),I3(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,i){const r=e&&e.type==="vtt",o=i&&i.type==="text";r&&o&&super.handleData_(e,i)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const i=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(r=>{const o=r.start+i,l=r.end+i,c=new z.VTTCue(o,l,r.cueText);r.settings&&r.settings.split(" ").forEach(f=>{const p=f.split(":"),v=p[0],S=p[1];c[v]=isNaN(S)?S:Number(S)}),e.cues.push(c)})}parseVTTCues_(e){let i,r=!1;if(typeof z.WebVTT!="function")throw new W3;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof z.TextDecoder=="function"?i=new z.TextDecoder("utf8"):(i=z.WebVTT.StringDecoder(),r=!0);const o=new z.WebVTT.Parser(z,z.vttjs,i);if(o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=c=>{e.timestampmap=c},o.onparsingerror=c=>{F.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){let c=e.segment.map.bytes;r&&(c=gx(c)),o.parse(c)}let l=e.bytes;r&&(l=gx(l)),o.parse(l),o.flush()}updateTimeMapping_(e,i,r){const o=e.segment;if(!i)return;if(!e.cues.length){o.empty=!0;return}const{MPEGTS:l,LOCAL:c}=e.timestampmap,p=l/wo.ONE_SECOND_IN_TS-c+i.mapping;if(e.cues.forEach(v=>{const S=v.endTime-v.startTime,x=this.handleRollover_(v.startTime+p,i.time);v.startTime=Math.max(x,0),v.endTime=Math.max(x+S,0)}),!r.syncInfo){const v=e.cues[0].startTime,S=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(v,S-o.duration)}}}handleRollover_(e,i){if(i===null)return e;let r=e*wo.ONE_SECOND_IN_TS;const o=i*wo.ONE_SECOND_IN_TS;let l;for(o4294967296;)r+=l;return r/wo.ONE_SECOND_IN_TS}}const Z3=function(s,e){const i=s.cues;for(let r=0;r=o.adStartTime&&e<=o.adEndTime)return o}return null},J3=function(s,e,i=0){if(!s.segments)return;let r=i,o;for(let l=0;l=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class vx{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,i){const{mediaSequence:r,segments:o}=e;if(this.isReliable_=this.isReliablePlaylist_(r,o),!!this.isReliable_)return this.updateStorage_(o,r,this.calculateBaseTime_(r,o,i))}getSyncInfoForTime(e){for(const{segmentSyncInfo:i,partsSyncInfo:r}of this.storage_.values())if(r.length){for(const o of r)if(o.isInRange(e))return o}else if(i.isInRange(e))return i;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,i,r){const o=new Map;let l=` `,c=r,f=i;this.start_=c,e.forEach((p,v)=>{const S=this.storage_.get(f),x=c,D=x+p.duration,k=!!(S&&S.segmentSyncInfo&&S.segmentSyncInfo.isAppended),I=new Tx({start:x,end:D,appended:k,segmentIndex:v});p.syncInfo=I;let C=c;const P=(p.parts||[]).map((U,Y)=>{const $=C,G=C+U.duration,W=!!(S&&S.partsSyncInfo&&S.partsSyncInfo[Y]&&S.partsSyncInfo[Y].isAppended),oe=new Tx({start:$,end:G,appended:W,segmentIndex:v,partIndex:Y});return C=G,l+=`Media Sequence: ${f}.${Y} | Range: ${$} --> ${G} | Appended: ${W} -`,U.syncInfo=oe,oe});o.set(f,new e3(I,P)),l+=`${ox(p.resolvedUri)} | Media Sequence: ${f} | Range: ${x} --> ${D} | Appended: ${k} -`,f++,c=D}),this.end_=c,this.storage_=o,this.diagnostics_=l}calculateBaseTime_(e,i,r){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const o=Math.min(...this.storage_.keys());if(ei!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,i,r,o,l)=>{const c=s.getMediaSequenceSync(l);if(!c||!c.isReliable)return null;const f=c.getSyncInfoForTime(o);return f?{time:f.start,partIndex:f.partIndex,segmentIndex:f.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,i,r,o)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let l=null,c=null;const f=vy(e);o=o||0;for(let p=0;p{let l=null,c=null;o=o||0;const f=vy(e);for(let p=0;p=k)&&(c=k,l={time:D,segmentIndex:S.segmentIndex,partIndex:S.partIndex})}}return l}},{name:"Discontinuity",run:(s,e,i,r,o)=>{let l=null;if(o=o||0,e.discontinuityStarts&&e.discontinuityStarts.length){let c=null;for(let f=0;f=x)&&(c=x,l={time:S.time,segmentIndex:p,partIndex:null})}}}return l}},{name:"Playlist",run:(s,e,i,r,o)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class i3 extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const i=new vx,r=new bx(i),o=new bx(i);this.mediaSequenceStorage_={main:i,audio:r,vtt:o},this.logger_=ls("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,i,r,o,l){if(i!==1/0)return jy.find(({name:p})=>p==="VOD").run(this,e,i);const c=this.runStrategies_(e,i,r,o,l);if(!c.length)return null;for(const f of c){const{syncPoint:p,strategy:v}=f,{segmentIndex:S,time:x}=p;if(S<0)continue;const D=e.segments[S],k=x,I=k+D.duration;if(this.logger_(`Strategy: ${v}. Current time: ${o}. selected segment: ${S}. Time: [${k} -> ${I}]}`),o>=k&&o0&&(o.time*=-1),Math.abs(o.time+Nd({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))}runStrategies_(e,i,r,o,l){const c=[];for(let f=0;ft3){F.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let o=r-1;o>=0;o--){const l=e.segments[o];if(l&&typeof l.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+o,time:l.start},this.logger_(`playlist refresh sync: [time:${i.syncInfo.time}, mediaSequence: ${i.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const i=e.segments[0],r=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:i}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,i),o=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:o.start}));const l=o.dateTimeObject;o.discontinuity&&i&&l&&(this.timelineToDatetimeMappings[o.timeline]=-(l.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,i,r){const o=e.segment,l=e.part;let c=this.timelines[e.timeline],f,p;if(typeof e.timestampOffset=="number")c={time:e.startOfSegment,mapping:e.startOfSegment-i.start},r&&(this.timelines[e.timeline]=c,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${c.time}] [mapping: ${c.mapping}]`)),f=e.startOfSegment,p=i.end+c.mapping;else if(c)f=i.start+c.mapping,p=i.end+c.mapping;else return!1;return l&&(l.start=f,l.end=p),(!o.start||fp){let v;f<0?v=r.start-Nd({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:l}):v=r.end+Nd({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[c]={time:v,accuracy:p}}}}dispose(){this.trigger("dispose"),this.off()}}class n3 extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:i,to:r}){return typeof i=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:i,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:i,to:r}){if(typeof i=="number"&&typeof r=="number"){this.lastTimelineChanges_[e]={type:e,from:i,to:r},delete this.pendingTimelineChanges_[e];const o={timelineChangeInfo:{from:i,to:r}};this.trigger({type:"timelinechange",metadata:o})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const s3=YS(QS(function(){var s=function(){function C(){this.listeners={}}var P=C.prototype;return P.on=function(Y,$){this.listeners[Y]||(this.listeners[Y]=[]),this.listeners[Y].push($)},P.off=function(Y,$){if(!this.listeners[Y])return!1;var G=this.listeners[Y].indexOf($);return this.listeners[Y]=this.listeners[Y].slice(0),this.listeners[Y].splice(G,1),G>-1},P.trigger=function(Y){var $=this.listeners[Y];if($)if(arguments.length===2)for(var G=$.length,W=0;W>7)*283)^G]=G;for(W=oe=0;!Y[W];W^=fe||1,oe=de[oe]||1)for(_e=oe^oe<<1^oe<<2^oe<<3^oe<<4,_e=_e>>8^_e&255^99,Y[W]=_e,$[_e]=W,le=K[me=K[fe=K[W]]],ge=le*16843009^me*65537^fe*257^W*16843008,he=K[_e]*257^_e*16843008,G=0;G<4;G++)P[G][W]=he=he<<24^he>>>8,U[G][_e]=ge=ge<<24^ge>>>8;for(G=0;G<5;G++)P[G]=P[G].slice(0),U[G]=U[G].slice(0);return C};let r=null;class o{constructor(P){r||(r=i()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let U,Y,$;const G=this._tables[0][4],W=this._tables[1],oe=P.length;let K=1;if(oe!==4&&oe!==6&&oe!==8)throw new Error("Invalid aes key size");const de=P.slice(0),fe=[];for(this._key=[de,fe],U=oe;U<4*oe+28;U++)$=de[U-1],(U%oe===0||oe===8&&U%oe===4)&&($=G[$>>>24]<<24^G[$>>16&255]<<16^G[$>>8&255]<<8^G[$&255],U%oe===0&&($=$<<8^$>>>24^K<<24,K=K<<1^(K>>7)*283)),de[U]=de[U-oe]^$;for(Y=0;U;Y++,U--)$=de[Y&3?U:U-4],U<=4||Y<4?fe[Y]=$:fe[Y]=W[0][G[$>>>24]]^W[1][G[$>>16&255]]^W[2][G[$>>8&255]]^W[3][G[$&255]]}decrypt(P,U,Y,$,G,W){const oe=this._key[1];let K=P^oe[0],de=$^oe[1],fe=Y^oe[2],me=U^oe[3],le,_e,he;const ge=oe.length/4-2;let Ae,ne=4;const Se=this._tables[1],pe=Se[0],Ue=Se[1],se=Se[2],Oe=Se[3],we=Se[4];for(Ae=0;Ae>>24]^Ue[de>>16&255]^se[fe>>8&255]^Oe[me&255]^oe[ne],_e=pe[de>>>24]^Ue[fe>>16&255]^se[me>>8&255]^Oe[K&255]^oe[ne+1],he=pe[fe>>>24]^Ue[me>>16&255]^se[K>>8&255]^Oe[de&255]^oe[ne+2],me=pe[me>>>24]^Ue[K>>16&255]^se[de>>8&255]^Oe[fe&255]^oe[ne+3],ne+=4,K=le,de=_e,fe=he;for(Ae=0;Ae<4;Ae++)G[(3&-Ae)+W]=we[K>>>24]<<24^we[de>>16&255]<<16^we[fe>>8&255]<<8^we[me&255]^oe[ne++],le=K,K=de,de=fe,fe=me,me=le}}class l extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(P){this.jobs.push(P),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const c=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},f=function(C,P,U){const Y=new Int32Array(C.buffer,C.byteOffset,C.byteLength>>2),$=new o(Array.prototype.slice.call(P)),G=new Uint8Array(C.byteLength),W=new Int32Array(G.buffer);let oe,K,de,fe,me,le,_e,he,ge;for(oe=U[0],K=U[1],de=U[2],fe=U[3],ge=0;ge{const Y=C[U];D(Y)?P[U]={bytes:Y.buffer,byteOffset:Y.byteOffset,byteLength:Y.byteLength}:P[U]=Y}),P};self.onmessage=function(C){const P=C.data,U=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),Y=new Uint32Array(P.key.bytes,P.key.byteOffset,P.key.byteLength/4),$=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new p(U,Y,$,function(G,W){self.postMessage(I({source:P.source,decrypted:W}),[W.buffer])})}}));var r3=$S(s3);const a3=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},_x=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},zy=(s,e)=>{e.activePlaylistLoader=s,s.load()},o3=(s,e)=>()=>{const{segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:o}}=e,l=o.activeTrack(),c=o.getActiveGroup(),f=o.activePlaylistLoader,p=o.lastGroup_;if(!(c&&p&&c.id===p.id)&&(o.lastGroup_=c,o.lastTrack_=l,_x(i,o),!(!c||c.isMainPlaylist))){if(!c.playlistLoader){f&&r.resetEverything();return}i.resyncLoader(),zy(c.playlistLoader,o)}},l3=(s,e)=>()=>{const{segmentLoaders:{[s]:i},mediaTypes:{[s]:r}}=e;r.lastGroup_=null,i.abort(),i.pause()},u3=(s,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[s]:r,main:o},mediaTypes:{[s]:l}}=e,c=l.activeTrack(),f=l.getActiveGroup(),p=l.activePlaylistLoader,v=l.lastTrack_;if(!(v&&c&&v.id===c.id)&&(l.lastGroup_=f,l.lastTrack_=c,_x(r,l),!!f)){if(f.isMainPlaylist){if(!c||!v||c.id===v.id)return;const S=e.vhs.playlistController_,x=S.selectPlaylist();if(S.media()===x)return;l.logger_(`track change. Switching main audio from ${v.id} to ${c.id}`),i.pause(),o.resetEverything(),S.fastQualityChange_(x);return}if(s==="AUDIO"){if(!f.playlistLoader){o.setAudio(!0),o.resetEverything();return}r.setAudio(!0),o.setAudio(!1)}if(p===f.playlistLoader){zy(f.playlistLoader,l);return}r.track&&r.track(c),r.resetEverything(),zy(f.playlistLoader,l)}},Up={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:i},excludePlaylist:r}=e,o=i.activeTrack(),l=i.activeGroup(),c=(l.filter(p=>p.default)[0]||l[0]).id,f=i.tracks[c];if(o===f){r({error:{message:"Problem encountered loading the default audio track."}});return}F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const p in i.tracks)i.tracks[p].enabled=i.tracks[p]===f;i.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:i}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}},Sx={AUDIO:(s,e,i)=>{if(!e)return;const{tech:r,requestOptions:o,segmentLoaders:{[s]:l}}=i;e.on("loadedmetadata",()=>{const c=e.media();l.playlist(c,o),(!r.paused()||c.endList&&r.preload()!=="none")&&l.load()}),e.on("loadedplaylist",()=>{l.playlist(e.media(),o),r.paused()||l.load()}),e.on("error",Up[s](s,i))},SUBTITLES:(s,e,i)=>{const{tech:r,requestOptions:o,segmentLoaders:{[s]:l},mediaTypes:{[s]:c}}=i;e.on("loadedmetadata",()=>{const f=e.media();l.playlist(f,o),l.track(c.activeTrack()),(!r.paused()||f.endList&&r.preload()!=="none")&&l.load()}),e.on("loadedplaylist",()=>{l.playlist(e.media(),o),r.paused()||l.load()}),e.on("error",Up[s](s,i))}},c3={AUDIO:(s,e)=>{const{vhs:i,sourceType:r,segmentLoaders:{[s]:o},requestOptions:l,main:{mediaGroups:c},mediaTypes:{[s]:{groups:f,tracks:p,logger_:v}},mainPlaylistLoader:S}=e,x=kd(S.main);(!c[s]||Object.keys(c[s]).length===0)&&(c[s]={main:{default:{default:!0}}},x&&(c[s].main.default.playlists=S.main.playlists));for(const D in c[s]){f[D]||(f[D]=[]);for(const k in c[s][D]){let I=c[s][D][k],C;if(x?(v(`AUDIO group '${D}' label '${k}' is a main playlist`),I.isMainPlaylist=!0,C=null):r==="vhs-json"&&I.playlists?C=new _u(I.playlists[0],i,l):I.resolvedUri?C=new _u(I.resolvedUri,i,l):I.playlists&&r==="dash"?C=new Ay(I.playlists[0],i,l,S):C=null,I=Ct({id:k,playlistLoader:C},I),Sx[s](s,I.playlistLoader,e),f[D].push(I),typeof p[k]>"u"){const P=new F.AudioTrack({id:k,kind:a3(I),enabled:!1,language:I.language,default:I.default,label:k});p[k]=P}}}o.on("error",Up[s](s,e))},SUBTITLES:(s,e)=>{const{tech:i,vhs:r,sourceType:o,segmentLoaders:{[s]:l},requestOptions:c,main:{mediaGroups:f},mediaTypes:{[s]:{groups:p,tracks:v}},mainPlaylistLoader:S}=e;for(const x in f[s]){p[x]||(p[x]=[]);for(const D in f[s][x]){if(!r.options_.useForcedSubtitles&&f[s][x][D].forced)continue;let k=f[s][x][D],I;if(o==="hls")I=new _u(k.resolvedUri,r,c);else if(o==="dash"){if(!k.playlists.filter(P=>P.excludeUntil!==1/0).length)return;I=new Ay(k.playlists[0],r,c,S)}else o==="vhs-json"&&(I=new _u(k.playlists?k.playlists[0]:k.resolvedUri,r,c));if(k=Ct({id:D,playlistLoader:I},k),Sx[s](s,k.playlistLoader,e),p[x].push(k),typeof v[D]>"u"){const C=i.addRemoteTextTrack({id:D,kind:"subtitles",default:k.default&&k.autoselect,language:k.language,label:D},!1).track;v[D]=C}}}l.on("error",Up[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:i,main:{mediaGroups:r},mediaTypes:{[s]:{groups:o,tracks:l}}}=e;for(const c in r[s]){o[c]||(o[c]=[]);for(const f in r[s][c]){const p=r[s][c][f];if(!/^(?:CC|SERVICE)/.test(p.instreamId))continue;const v=i.options_.vhs&&i.options_.vhs.captionServices||{};let S={label:f,language:p.language,instreamId:p.instreamId,default:p.default&&p.autoselect};if(v[S.instreamId]&&(S=Ct(S,v[S.instreamId])),S.default===void 0&&delete S.default,o[c].push(Ct({id:f},p)),typeof l[f]>"u"){const x=i.addRemoteTextTrack({id:S.instreamId,kind:"captions",default:S.default,language:S.language,label:S.label},!1).track;l[f]=x}}}}},xx=(s,e)=>{for(let i=0;ii=>{const{mainPlaylistLoader:r,mediaTypes:{[s]:{groups:o}}}=e,l=r.media();if(!l)return null;let c=null;l.attributes[s]&&(c=o[l.attributes[s]]);const f=Object.keys(o);if(!c)if(s==="AUDIO"&&f.length>1&&kd(e.main))for(let p=0;p"u"?c:i===null||!c?null:c.filter(p=>p.id===i.id)[0]||null},h3={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:i}}}=e;for(const r in i)if(i[r].enabled)return i[r];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:i}}}=e;for(const r in i)if(i[r].mode==="showing"||i[r].mode==="hidden")return i[r];return null}},f3=(s,{mediaTypes:e})=>()=>{const i=e[s].activeTrack();return i?e[s].activeGroup(i):null},p3=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(v=>{c3[v](v,s)});const{mediaTypes:e,mainPlaylistLoader:i,tech:r,vhs:o,segmentLoaders:{["AUDIO"]:l,main:c}}=s;["AUDIO","SUBTITLES"].forEach(v=>{e[v].activeGroup=d3(v,s),e[v].activeTrack=h3[v](v,s),e[v].onGroupChanged=o3(v,s),e[v].onGroupChanging=l3(v,s),e[v].onTrackChanged=u3(v,s),e[v].getActiveGroup=f3(v,s)});const f=e.AUDIO.activeGroup();if(f){const v=(f.filter(x=>x.default)[0]||f[0]).id;e.AUDIO.tracks[v].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(c.setAudio(!1),l.setAudio(!0)):c.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(v=>e[v].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(v=>e[v].onGroupChanging())});const p=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",p),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),o.on("dispose",()=>{r.audioTracks().removeEventListener("change",p),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const v in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[v])},m3=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:$r,activeTrack:$r,getActiveGroup:$r,onGroupChanged:$r,onTrackChanged:$r,lastTrack_:null,logger_:ls(`MediaGroups[${e}]`)}}),s};class Ex{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Dn(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(i=>[i.ID,i])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class g3 extends F.EventTarget{constructor(e,i){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Ex,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ls("Content Steering"),this.xhr_=e,this.getBandwidth_=i}assignTagProperties(e,i){this.manifestType_=i.serverUri?"HLS":"DASH";const r=i.serverUri||i.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=Dn(e,r),this.defaultPathway=i.pathwayId||i.defaultServiceLocation,this.queryBeforeStart=i.queryBeforeStart,this.proxyServerUrl_=i.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const i=this.steeringManifest.reloadUri;if(!i)return;const r=e?i:this.getRequestURI(i);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const o={contentSteeringInfo:{uri:r}};this.trigger({type:"contentsteeringloadstart",metadata:o}),this.request_=this.xhr_({uri:r,requestType:"content-steering-manifest"},(l,c)=>{if(l){if(c.status===410){this.logger_(`manifest request 410 ${l}.`),this.logger_(`There will be no more content steering requests to ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(c.status===429){const v=c.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${l}.`),this.logger_(`content steering will retry in ${v} seconds.`),this.startTTLTimeout_(parseInt(v,10));return}this.logger_(`manifest failed to load ${l}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:o});let f;try{f=JSON.parse(this.request_.responseText)}catch(v){const S={errorType:F.Error.StreamingContentSteeringParserError,error:v};this.trigger({type:"error",metadata:S})}this.assignSteeringProperties_(f);const p={contentSteeringInfo:o.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:p}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const i=new z.URL(e),r=new z.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(i.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){const i=JSON.parse(z.atob(e));this.assignSteeringProperties_(i)}setSteeringParams_(e){const i=new z.URL(e),r=this.getPathway(),o=this.getBandwidth_();if(r){const l=`_${this.manifestType_}_pathway`;i.searchParams.set(l,r)}if(o){const l=`_${this.manifestType_}_throughput`;i.searchParams.set(l,o)}return i.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const r=(o=>{for(const l of o)if(this.availablePathways_.has(l))return l;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const i=o=>this.excludedSteeringManifestURLs.has(o);if(this.proxyServerUrl_){const o=this.setProxyServerUrl_(e);if(!i(o))return o}const r=this.setSteeringParams_(e);return i(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){const i=e*1e3;this.ttlTimeout_=z.setTimeout(()=>{this.requestSteeringManifest()},i)}clearTTLTimeout_(){z.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Ex}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,i){return!i&&this.steeringManifest.reloadUri||i&&(Dn(e,i.serverURL)!==this.steeringManifest.reloadUri||i.defaultServiceLocation!==this.defaultPathway||i.queryBeforeStart!==this.queryBeforeStart||i.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const y3=(s,e)=>{let i=null;return(...r)=>{clearTimeout(i),i=setTimeout(()=>{s.apply(null,r)},e)}},T3=10;let za;const v3=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],b3=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},_3=function({currentPlaylist:s,buffered:e,currentTime:i,nextPlaylist:r,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:c,bufferBasedABR:f,log:p}){if(!r)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const v=`allowing switch ${s&&s.id||"null"} -> ${r.id}`;if(!s)return p(`${v} as current playlist is not set`),!0;if(r.id===s.id)return!1;const S=!!Tu(e,i).length;if(!s.endList)return!S&&typeof s.partTargetDuration=="number"?(p(`not ${v} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(p(`${v} as current playlist is live`),!0);const x=yy(e,i),D=f?ki.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ki.MAX_BUFFER_LOW_WATER_LINE;if(cI)&&x>=o){let C=`${v} as forwardBuffer >= bufferLowWaterLine (${x} >= ${o})`;return f&&(C+=` and next bandwidth > current bandwidth (${k} > ${I})`),p(C),!0}return p(`not ${v} as no switching criteria met`),!1};class S3 extends F.EventTarget{constructor(e){super(),this.fastQualityChange_=y3(this.fastQualityChange_.bind(this),100);const{src:i,withCredentials:r,tech:o,bandwidth:l,externVhs:c,useCueTags:f,playlistExclusionDuration:p,enableLowInitialPlaylist:v,sourceType:S,cacheEncryptionKeys:x,bufferBasedABR:D,leastPixelDiffSelector:k,captionServices:I,experimentalUseMMS:C}=e;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:P}=e;(P===null||typeof P>"u")&&(P=1/0),za=c,this.bufferBasedABR=!!D,this.leastPixelDiffSelector=!!k,this.withCredentials=r,this.tech_=o,this.vhs_=o.vhs,this.player_=e.player_,this.sourceType_=S,this.useCueTags_=f,this.playlistExclusionDuration=p,this.maxPlaylistRetries=P,this.enableLowInitialPlaylist=v,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:P,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=m3(),C&&z.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new z.ManagedMediaSource,this.usingManagedMediaSource_=!0,F.log("Using ManagedMediaSource")):z.MediaSource&&(this.mediaSource=new z.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Ni(),this.hasPlayed_=!1,this.syncController_=new i3(e),this.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new r3,this.sourceUpdater_=new mx(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new n3,this.keyStatusMap_=new Map;const U={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:l,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:x,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Ay(i,this.vhs_,Ct(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new _u(i,this.vhs_,Ct(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Ly(Ct(U,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Ly(Ct(U,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new KI(Ct(U,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((G,W)=>{function oe(){o.off("vttjserror",K),G()}function K(){o.off("vttjsloaded",oe),W()}o.one("vttjsloaded",oe),o.one("vttjserror",K),o.addWebVttScript_()})}),e);const Y=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new g3(this.vhs_.xhr,Y),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),v3.forEach(G=>{this[G+"_"]=b3.bind(this,G)}),this.logger_=ls("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const $=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one($,()=>{const G=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-G,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)}switchMedia_(e,i,r){const o=this.media(),l=o&&(o.id||o.uri),c=e&&(e.id||e.uri);if(l&&l!==c){this.logger_(`switch media ${l} -> ${c} from ${i}`);const f={renditionInfo:{id:c,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:i};this.trigger({type:"renditionselected",metadata:f}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${i}`})}this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const i=this.mediaTypes_[e],r=i?i.activeGroup():null,o=this.contentSteeringController_.getPathway();if(r&&o){const c=(r.length?r[0].playlists:r.playlists).filter(f=>f.attributes.serviceLocation===o);c.length&&this.mediaTypes_[e].activePlaylistLoader.media(c[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=z.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(z.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;const r=e.mediaGroups.AUDIO,o=Object.keys(r);let l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{const f=r.main||o.length&&r[o[0]];for(const p in f)if(f[p].default){l={label:p};break}}if(!l)return i;const c=[];for(const f in r)if(r[f][l.label]){const p=r[f][l.label];if(p.playlists&&p.playlists.length)c.push.apply(c,p.playlists);else if(p.uri)c.push(p);else if(e.playlists.length)for(let v=0;v{const i=this.mainPlaylistLoader_.media(),r=i.targetDuration*1.5*1e3;_y(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,i.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.mainSegmentLoader_.load()),p3({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),i),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let i=this.mainPlaylistLoader_.media();if(!i){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let r;if(this.enableLowInitialPlaylist&&(r=this.selectInitialPlaylist()),r||(r=this.selectPlaylist()),!r||!this.shouldSwitchToMedia_(r)||(this.initialMedia_=r,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;i=this.initialMedia_}this.handleUpdatedMediaPlaylist(i)}),this.mainPlaylistLoader_.on("error",()=>{const i=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const i=this.mainPlaylistLoader_.media(),r=i.targetDuration*1.5*1e3;_y(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const i=this.mainPlaylistLoader_.media();if(i.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(i)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(i=>{this.mainPlaylistLoader_.on(i,r=>{this.player_.trigger(ei({},r))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,i){const r=e.mediaGroups||{};let o=!0;const l=Object.keys(r.AUDIO);for(const c in r.AUDIO)for(const f in r.AUDIO[c])r.AUDIO[c][f].uri||(o=!1);o&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),za.Playlist.isAes(i)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),l.length&&Object.keys(r.AUDIO[l[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const i=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),c=this.tech_.buffered();return _3({buffered:c,currentTime:r,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const r=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:r.playlist,error:r})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const r=this.audioSegmentLoader_.pendingSegment_;if(!r||!r.segment||!r.segment.syncInfo)return;const o=r.segment.syncInfo.end+.01;this.tech_.setCurrentTime(o)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",r=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:T3}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const r=this.getCodecsOrExclude_();r&&this.sourceUpdater_.addOrChangeSourceBuffers(r)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(r=>{this.mainSegmentLoader_.on(r,o=>{this.player_.trigger(ei({},o))}),this.audioSegmentLoader_.on(r,o=>{this.player_.trigger(ei({},o))}),this.subtitleSegmentLoader_.on(r,o=>{this.player_.trigger(ei({},o))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const i=this.duration();e[e.length-1].endTime=isNaN(i)||Math.abs(i)===1/0?Number.MAX_VALUE:i}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const i=this.mainSegmentLoader_.getCurrentMediaInfo_();!i||i.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const o=za.Playlist.playlistEnd(e,r),l=this.tech_.currentTime(),c=this.tech_.buffered();if(!c.length)return o-l<=nr;const f=c.end(c.length-1);return f-l<=nr&&o-f<=nr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:i={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||i.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const o=this.mainPlaylistLoader_.main.playlists,l=o.filter(Lp),c=l.length===1&&l[0]===e;if(o.length===1&&r!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(c);if(c){if(this.main().contentSteering){const I=this.pathwayAttribute_(e),C=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(I),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(I)},C);return}let k=!1;o.forEach(I=>{if(I===e)return;const C=I.excludeUntil;typeof C<"u"&&C!==1/0&&(k=!0,delete I.excludeUntil)}),k&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let f;e.playlistErrors_>this.maxPlaylistRetries?f=1/0:f=Date.now()+r*1e3,e.excludeUntil=f,i.reason&&(e.lastExcludeReason_=i.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const p=this.selectPlaylist();if(!p){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const v=i.internal?this.logger_:F.log.warn,S=i.message?" "+i.message:"";v(`${i.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${S} Switching to playlist ${p.id}.`),p.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),p.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const x=p.targetDuration/2*1e3||5*1e3,D=typeof p.lastRequest=="number"&&Date.now()-p.lastRequest<=x;return this.switchMedia_(p,"exclude",c||D)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,i){const r=[],o=e==="all";(o||e==="main")&&r.push(this.mainPlaylistLoader_);const l=[];(o||e==="audio")&&l.push("AUDIO"),(o||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(c=>{const f=this.mediaTypes_[c]&&this.mediaTypes_[c].activePlaylistLoader;f&&r.push(f)}),["main","audio","subtitle"].forEach(c=>{const f=this[`${c}SegmentLoader_`];f&&(e===c||e==="all")&&r.push(f)}),r.forEach(c=>i.forEach(f=>{typeof c[f]=="function"&&c[f]()}))}setCurrentTime(e){const i=Tu(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:za.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,i){const r=e.media();if(!r)return null;const o=this.syncController_.getMediaSequenceSync(i);if(o&&o.isReliable){const f=o.start,p=o.end;if(!isFinite(f)||!isFinite(p))return null;const v=za.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r),S=Math.max(f,p-v);return Ni([[f,S]])}const l=this.syncController_.getExpiredTime(r,this.duration());if(l===null)return null;const c=za.Playlist.seekable(r,l,za.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r));return c.length?c:null}computeFinalSeekable_(e,i){if(!i)return e;const r=e.start(0),o=e.end(0),l=i.start(0),c=i.end(0);return l>o||r>c?e:Ni([[Math.max(r,l),Math.min(o,c)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let i;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!i))return;const r=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,i),!this.seekable_||r&&r.length&&this.seekable_.length&&r.start(0)===this.seekable_.start(0)&&r.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${fS(this.seekable_)}]`);const o={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:o}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const o=this.seekable();if(!o.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration0&&(r=Math.max(r,i.end(i.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const i=this.mediaTypes_[e].groups;for(const r in i)i[r].forEach(o=>{o.playlistLoader&&o.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=Id(this.main(),i),o={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(o.video=r.video||e.main.videoCodec||Qw),e.main.isMuxed&&(o.video+=`,${r.audio||e.main.audioCodec||r1}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||l)&&(o.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||r1,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!o.audio&&!o.video){this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const c=(v,S)=>v?nd(S,this.usingManagedMediaSource_):Qg(S),f={};let p;if(["video","audio"].forEach(function(v){if(o.hasOwnProperty(v)&&!c(e[v].isFmp4,o[v])){const S=e[v].isFmp4?"browser":"muxer";f[S]=f[S]||[],f[S].push(o[v]),v==="audio"&&(p=S)}}),l&&p&&i.attributes.AUDIO){const v=i.attributes.AUDIO;this.main().playlists.forEach(S=>{(S.attributes&&S.attributes.AUDIO)===v&&S!==i&&(S.excludeUntil=1/0)}),this.logger_(`excluding audio group ${v} as ${p} does not support codec(s): "${o.audio}"`)}if(Object.keys(f).length){const v=Object.keys(f).reduce((S,x)=>(S&&(S+=", "),S+=`${x} does not support codec(s): "${f[x].join(",")}"`,S),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:v},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const v=[];if(["video","audio"].forEach(S=>{const x=(Gs(this.sourceUpdater_.codecs[S]||"")[0]||{}).type,D=(Gs(o[S]||"")[0]||{}).type;x&&D&&x.toLowerCase()!==D.toLowerCase()&&v.push(`"${this.sourceUpdater_.codecs[S]}" -> "${o[S]}"`)}),v.length){this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${v.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return o}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}excludeUnsupportedVariants_(){const e=this.main().playlists,i=[];Object.keys(e).forEach(r=>{const o=e[r];if(i.indexOf(o.id)!==-1)return;i.push(o.id);const l=Id(this.main,o),c=[];l.audio&&!Qg(l.audio)&&!nd(l.audio,this.usingManagedMediaSource_)&&c.push(`audio codec ${l.audio}`),l.video&&!Qg(l.video)&&!nd(l.video,this.usingManagedMediaSource_)&&c.push(`video codec ${l.video}`),l.text&&l.text==="stpp.ttml.im1t"&&c.push(`text codec ${l.text}`),c.length&&(o.excludeUntil=1/0,this.logger_(`excluding ${o.id} for unsupported: ${c.join(", ")}`))})}excludeIncompatibleVariants_(e){const i=[],r=this.main().playlists,o=Od(Gs(e)),l=kS(o),c=o.video&&Gs(o.video)[0]||null,f=o.audio&&Gs(o.audio)[0]||null;Object.keys(r).forEach(p=>{const v=r[p];if(i.indexOf(v.id)!==-1||v.excludeUntil===1/0)return;i.push(v.id);const S=[],x=Id(this.mainPlaylistLoader_.main,v),D=kS(x);if(!(!x.audio&&!x.video)){if(D!==l&&S.push(`codec count "${D}" !== "${l}"`),!this.sourceUpdater_.canChangeType()){const k=x.video&&Gs(x.video)[0]||null,I=x.audio&&Gs(x.audio)[0]||null;k&&c&&k.type.toLowerCase()!==c.type.toLowerCase()&&S.push(`video codec "${k.type}" !== "${c.type}"`),I&&f&&I.type.toLowerCase()!==f.type.toLowerCase()&&S.push(`audio codec "${I.type}" !== "${f.type}"`)}S.length&&(v.excludeUntil=1/0,this.logger_(`excluding ${v.id}: ${S.join(" && ")}`))}})}updateAdCues_(e){let i=0;const r=this.seekable();r.length&&(i=r.start(0)),JI(e,this.cueTagsTrack_,i)}goalBufferLength(){const e=this.tech_.currentTime(),i=ki.GOAL_BUFFER_LENGTH,r=ki.GOAL_BUFFER_LENGTH_RATE,o=Math.max(i,ki.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*r,o)}bufferLowWaterLine(){const e=this.tech_.currentTime(),i=ki.BUFFER_LOW_WATER_LINE,r=ki.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(i,ki.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(i,ki.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*r,this.bufferBasedABR?l:o)}bufferHighWaterLine(){return ki.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){lx(this.inbandTextTracks_,"com.apple.streaming",this.tech_),OI({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,i,r){const o=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();lx(this.inbandTextTracks_,e,this.tech_),wI({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:o,videoDuration:r})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const i of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(i));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(i=>{this.contentSteeringController_.on(i,r=>{this.trigger(ei({},r))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const i=this.main();(this.contentSteeringController_.didDASHTagChange(i.uri,i.contentSteering)||(()=>{const l=this.contentSteeringController_.getAvailablePathways(),c=[];for(const f of i.playlists){const p=f.attributes.serviceLocation;if(p&&(c.push(p),!l.has(p)))return!0}return!!(!c.length&&l.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const r=this.main().playlists,o=new Set;let l=!1;Object.keys(r).forEach(c=>{const f=r[c],p=this.pathwayAttribute_(f),v=p&&e!==p;f.excludeUntil===1/0&&f.lastExcludeReason_==="content-steering"&&!v&&(delete f.excludeUntil,delete f.lastExcludeReason_,l=!0);const x=!f.excludeUntil&&f.excludeUntil!==1/0;!o.has(f.id)&&v&&x&&(o.add(f.id),f.excludeUntil=1/0,f.lastExcludeReason_="content-steering",this.logger_(`excluding ${f.id} for ${f.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(c=>{const f=this.mediaTypes_[c];if(f.activePlaylistLoader){const p=f.activePlaylistLoader.media_;p&&p.attributes.serviceLocation!==e&&(l=!0)}}),l&&this.changeSegmentPathway_()}handlePathwayClones_(){const i=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,o=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||o&&o.size){for(const[c,f]of r.entries())o.get(c)||(this.mainPlaylistLoader_.updateOrDeleteClone(f),this.contentSteeringController_.excludePathway(c));for(const[c,f]of o.entries()){const p=r.get(c);if(!p){i.filter(S=>S.attributes["PATHWAY-ID"]===f["BASE-ID"]).forEach(S=>{this.mainPlaylistLoader_.addClonePathway(f,S)}),this.contentSteeringController_.addAvailablePathway(c);continue}this.equalPathwayClones_(p,f)||(this.mainPlaylistLoader_.updateOrDeleteClone(f,!0),this.contentSteeringController_.addAvailablePathway(c))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...o])))}}equalPathwayClones_(e,i){if(e["BASE-ID"]!==i["BASE-ID"]||e.ID!==i.ID||e["URI-REPLACEMENT"].HOST!==i["URI-REPLACEMENT"].HOST)return!1;const r=e["URI-REPLACEMENT"].PARAMS,o=i["URI-REPLACEMENT"].PARAMS;for(const l in r)if(r[l]!==o[l])return!1;for(const l in o)if(r[l]!==o[l])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const i="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(r=>{const o=this.mainPlaylistLoader_.getKeyIdSet(r);!o||!o.size||o.forEach(l=>{const c="usable",f=this.keyStatusMap_.has(l)&&this.keyStatusMap_.get(l)===c,p=r.lastExcludeReason_===i&&r.excludeUntil===1/0;f?f&&p&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${l} is ${c}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==i&&(r.excludeUntil=1/0,r.lastExcludeReason_=i,this.logger_(`excluding playlist ${r.id} because the key ID ${l} doesn't exist in the keyStatusMap or is not ${c}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(r=>{const o=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,l=r.excludeUntil===1/0&&r.lastExcludeReason_===i;o&&l&&(delete r.excludeUntil,F.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${i} key IDs`))})}addKeyStatus_(e,i){const l=(typeof e=="string"?e:XI(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${i}' with key ID ${l} added to the keyStatusMap`),this.keyStatusMap_.set(l,i)}updatePlaylistByKeyStatus(e,i){this.addKeyStatus_(e,i),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const x3=(s,e,i)=>r=>{const o=s.main.playlists[e],l=by(o),c=Lp(o);if(typeof r>"u")return c;r?delete o.disabled:o.disabled=!0;const f={renditionInfo:{id:e,bandwidth:o.attributes.BANDWIDTH,resolution:o.attributes.RESOLUTION,codecs:o.attributes.CODECS},cause:"fast-quality"};return r!==c&&!l&&(r?(i(o),s.trigger({type:"renditionenabled",metadata:f})):s.trigger({type:"renditiondisabled",metadata:f})),r};class E3{constructor(e,i,r){const{playlistController_:o}=e,l=o.fastQualityChange_.bind(o);if(i.attributes){const c=i.attributes.RESOLUTION;this.width=c&&c.width,this.height=c&&c.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=Id(o.main(),i),this.playlist=i,this.id=r,this.enabled=x3(e.playlists,i.id,l)}}const M3=function(s){s.representations=()=>{const e=s.playlistController_.main(),i=kd(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return i?i.filter(r=>!by(r)).map((r,o)=>new E3(s,r,r.id)):[]}},Mx=["seeking","seeked","pause","playing","error"];class D3 extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=ls("PlaybackWatcher"),this.logger_("initialize");const i=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),o=()=>this.techWaiting_(),l=()=>this.resetTimeUpdate_(),c=this.playlistController_,f=["main","subtitle","audio"],p={};f.forEach(S=>{p[S]={reset:()=>this.resetSegmentDownloads_(S),updateend:()=>this.checkSegmentDownloads_(S)},c[`${S}SegmentLoader_`].on("appendsdone",p[S].updateend),c[`${S}SegmentLoader_`].on("playlistupdate",p[S].reset),this.tech_.on(["seeked","seeking"],p[S].reset)});const v=S=>{["main","audio"].forEach(x=>{c[`${x}SegmentLoader_`][S]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),v("off"))},this.clearSeekingAppendCheck_=()=>v("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),v("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",o),this.tech_.on(Mx,l),this.tech_.on("canplay",r),this.tech_.one("play",i),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",o),this.tech_.off(Mx,l),this.tech_.off("canplay",r),this.tech_.off("play",i),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),f.forEach(S=>{c[`${S}SegmentLoader_`].off("appendsdone",p[S].updateend),c[`${S}SegmentLoader_`].off("playlistupdate",p[S].reset),this.tech_.off(["seeked","seeking"],p[S].reset)}),this.checkCurrentTimeTimeout_&&z.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&z.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=z.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const i=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=i.buffered_()}checkSegmentDownloads_(e){const i=this.playlistController_,r=i[`${e}SegmentLoader_`],o=r.buffered_(),l=pO(this[`${e}Buffered_`],o);if(this[`${e}Buffered_`]=o,l){const c={bufferedRanges:o};i.trigger({type:"bufferedrangeschanged",metadata:c}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:r.playlist_&&r.playlist_.id,buffered:zo(o)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&i.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===e&&(!i.length||e+nr>=i.end(i.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Ni([this.lastRecordedTime,e]));const r={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:r}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const i=this.seekable(),r=this.tech_.currentTime(),o=this.afterSeekableWindow_(i,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let l;if(o&&(l=i.end(i.length-1)),this.beforeSeekableWindow_(i,r)){const I=i.start(0);l=I+(I===i.end(0)?0:nr)}if(typeof l<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${fS(i)}. Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0;const c=this.playlistController_.sourceUpdater_,f=this.tech_.buffered(),p=c.audioBuffer?c.audioBuffered():null,v=c.videoBuffer?c.videoBuffered():null,S=this.media(),x=S.partTargetDuration?S.partTargetDuration:(S.targetDuration-ir)*2,D=[p,v];for(let I=0;I ${r.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,i)){const f=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${i}. Seeking to live point (seekable end) ${f}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(f),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:i}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const c=Ip(o,i);return c.length>0?(this.logger_(`Stopped at ${i} and seeking to ${c.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(i),!0):!1}afterSeekableWindow_(e,i,r,o=!1){if(!e.length)return!1;let l=e.end(e.length-1)+nr;const c=!r.endList,f=typeof r.partTargetDuration=="number";return c&&(f||o)&&(l=e.end(e.length-1)+r.targetDuration*3),i>l}beforeSeekableWindow_(e,i){return!!(e.length&&e.start(0)>0&&i2)return{start:l,end:c}}return null}}const C3={errorInterval:30,getSource(s){const i=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(i)}},Dx=function(s,e){let i=0,r=0;const o=Ct(C3,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){r&&s.currentTime(r)},c=function(S){S!=null&&(r=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",l),s.src(S),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},f=function(){if(Date.now()-i{Object.defineProperty(Kt,s,{get(){return F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),ki[s]},set(e){if(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}ki[s]=e}})});const Ax="videojs-vhs",wx=function(s,e){const i=e.media();let r=-1;for(let o=0;o{s.addQualityLevel(i)}),wx(s,e.playlists)};Kt.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const L3=(s,e,i)=>{if(!s)return s;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=Od(Gs(e.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);const o=Fl(r.video),l=Fl(r.audio),c={};for(const f in s)c[f]={},l&&(c[f].audioContentType=l),o&&(c[f].videoContentType=o),e.contentProtection&&e.contentProtection[f]&&e.contentProtection[f].pssh&&(c[f].pssh=e.contentProtection[f].pssh),typeof s[f]=="string"&&(c[f].url=s[f]);return Ct(s,c)},R3=(s,e)=>s.reduce((i,r)=>{if(!r.contentProtection)return i;const o=e.reduce((l,c)=>{const f=r.contentProtection[c];return f&&f.pssh&&(l[c]={pssh:f.pssh}),l},{});return Object.keys(o).length&&i.push(o),i},[]),j3=({player:s,sourceKeySystems:e,audioMedia:i,mainPlaylists:r})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const o=i?r.concat([i]):r,l=R3(o,Object.keys(e)),c=[],f=[];return l.forEach(p=>{f.push(new Promise((v,S)=>{s.tech_.one("keysessioncreated",v)})),c.push(new Promise((v,S)=>{s.eme.initializeMediaKeys({keySystems:p},x=>{if(x){S(x);return}v()})}))}),Promise.race([Promise.all(c),Promise.race(f)])},z3=({player:s,sourceKeySystems:e,media:i,audioMedia:r})=>{const o=L3(e,i,r);return o?(s.currentSource().keySystems=o,o&&!s.eme?(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Nx=()=>{if(!z.localStorage)return null;const s=z.localStorage.getItem(Ax);if(!s)return null;try{return JSON.parse(s)}catch{return null}},U3=s=>{if(!z.localStorage)return!1;let e=Nx();e=e?Ct(e,s):s;try{z.localStorage.setItem(Ax,JSON.stringify(e))}catch{return!1}return e},P3=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,kx=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Ox=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Ix=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Lx=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Kt.supportsNativeHls=function(){if(!ve||!ve.createElement)return!1;const s=ve.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(s.canPlayType(i))}):!1}(),Kt.supportsNativeDash=function(){return!ve||!ve.createElement||!F.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ve.createElement("video").canPlayType("application/dash+xml"))}(),Kt.supportsTypeNatively=s=>s==="hls"?Kt.supportsNativeHls:s==="dash"?Kt.supportsNativeDash:!1,Kt.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Kt.xhr.onRequest=function(s){kx(Kt.xhr,s)},Kt.xhr.onResponse=function(s){Ox(Kt.xhr,s)},Kt.xhr.offRequest=function(s){Ix(Kt.xhr,s)},Kt.xhr.offResponse=function(s){Lx(Kt.xhr,s)};const B3=F.getComponent("Component");class Rx extends B3{constructor(e,i,r){if(super(i,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=ls("VhsHandler"),i.options_&&i.options_.playerId){const o=F.getPlayer(i.options_.playerId);this.player_=o}if(this.tech_=i,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ve,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],o=>{const l=ve.fullscreenElement||ve.webkitFullscreenElement||ve.mozFullScreenElement||ve.msFullscreenElement;l&&l.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Ct(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const r=Nx();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ki.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ki.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const i=this.options_.customPixelRatio;typeof i=="number"&&i>=0&&(this.customPixelRatio=i)}setOptions(e={}){this.setOptions_(e)}src(e,i){if(!e)return;this.setOptions_(),this.options_.src=P3(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Kt,this.options_.sourceType=a1(i),this.options_.seekTo=l=>{this.tech_.setCurrentTime(l)},this.options_.player_=this.player_,this.playlistController_=new S3(this.options_);const r=Ct({liveRangeSafeTimeDelta:nr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new D3(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const l=F.players[this.tech_.options_.playerId];let c=this.playlistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),l.error(c)});const o=this.options_.bufferBasedABR?Kt.movingAverageBandwidthSelector(.55):Kt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):o.bind(this),this.playlistController_.selectInitialPlaylist=Kt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(l){this.playlistController_.selectPlaylist=l.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(l){this.playlistController_.mainSegmentLoader_.throughput.rate=l,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let l=this.playlistController_.mainSegmentLoader_.bandwidth;const c=z.navigator.connection||z.navigator.mozConnection||z.navigator.webkitConnection,f=1e7;if(this.options_.useNetworkInformationApi&&c){const p=c.downlink*1e3*1e3;p>=f&&l>=f?l=Math.max(l,p):l=p}return l},set(l){this.playlistController_.mainSegmentLoader_.bandwidth=l,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const l=1/(this.bandwidth||1);let c;return this.throughput>0?c=1/this.throughput:c=0,Math.floor(1/(l+c))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>zo(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>zo(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&U3({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{M3(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=z.URL.createObjectURL(this.playlistController_.mediaSource),(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),j3({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(i=>{this.logger_("error while creating EME key session",i),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=z3({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!i){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{I3(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{wx(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Cx,"mux.js":w3,"mpd-parser":N3,"m3u8-parser":k3,"aes-decrypter":O3}}version(){return this.constructor.version()}canChangeType(){return mx.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&z.URL.revokeObjectURL&&(z.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,i){return $O({playlist:this.playlistController_.media(),time:e,callback:i})}seekToProgramTime(e,i,r=!0,o=2){return qS({programTime:e,playlist:this.playlistController_.media(),retryCount:o,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})}setupXhrHooks_(){this.xhr.onRequest=e=>{kx(this.xhr,e)},this.xhr.onResponse=e=>{Ox(this.xhr,e)},this.xhr.offRequest=e=>{Ix(this.xhr,e)},this.xhr.offResponse=e=>{Lx(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],i=["gapjumped","playedrangeschanged"];e.forEach(r=>{this.playlistController_.on(r,o=>{this.player_.trigger(ei({},o))})}),i.forEach(r=>{this.playbackWatcher_.on(r,o=>{this.player_.trigger(ei({},o))})})}}const Pp={name:"videojs-http-streaming",VERSION:Cx,canHandleSource(s,e={}){const i=Ct(F.options,e);return!i.vhs.experimentalUseMMS&&!nd("avc1.4d400d,mp4a.40.2",!1)?!1:Pp.canPlayType(s.type,i)},handleSource(s,e,i={}){const r=Ct(F.options,i);return e.vhs=new Rx(s,e,r),e.vhs.xhr=jS(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const i=a1(s);if(!i)return"";const r=Pp.getOverrideNative(e);return!Kt.supportsTypeNatively(i)||r?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,i=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:r=i}=e;return r}};(()=>nd("avc1.4d400d,mp4a.40.2",!0))()&&F.getTech("Html5").registerSourceHandler(Pp,0),F.VhsHandler=Rx,F.VhsSourceHandler=Pp,F.Vhs=Kt,F.use||F.registerComponent("Vhs",Kt),F.options.vhs=F.options.vhs||{},(!F.getPlugin||!F.getPlugin("reloadSourceOnError"))&&F.registerPlugin("reloadSourceOnError",A3);const r8="",a8="",o8="",l8="",q3=F.getComponent("Component");class jx extends q3{constructor(e,i){i&&i.relatedVideos&&(i._relatedVideos=i.relatedVideos),super(e,i),this.relatedVideos=i&&i.relatedVideos?i.relatedVideos:[]}createEl(){const e=this.options_&&this.options_._relatedVideos?this.options_._relatedVideos:[],i=this.getMaxVideosForScreen(),r=e.slice(0,i),o=super.createEl("div",{className:"vjs-end-screen-overlay"}),l=F.dom.createEl("div",{className:"vjs-related-videos-grid"});return r&&Array.isArray(r)&&r.length>0?r.forEach(c=>{const f=this.createVideoItem(c);l.appendChild(f)}):this.createSampleVideos().slice(0,this.getMaxVideosForScreen()).forEach(f=>{const p=this.createVideoItem(f);l.appendChild(p)}),o.appendChild(l),o}createVideoItem(e){const i=F.dom.createEl("div",{className:"vjs-related-video-item"}),r=e.thumbnail||this.getPlaceholderImage(e.title),o=F.dom.createEl("img",{className:"vjs-related-video-thumbnail",src:r,alt:e.title,loading:"lazy",onerror:()=>{o.src=this.getPlaceholderImage(e.title)}}),l=F.dom.createEl("div",{className:"vjs-related-video-overlay"}),c=F.dom.createEl("div",{className:"vjs-related-video-title"});c.textContent=e.title;const f=F.dom.createEl("div",{className:"vjs-related-video-meta"}),p=F.dom.createEl("div",{className:"vjs-related-video-author"});p.textContent=e.author;const v=F.dom.createEl("div",{className:"vjs-related-video-views"});v.textContent=e.views,f.appendChild(p),f.appendChild(v);const S=F.dom.createEl("div",{className:"vjs-related-video-duration"}),x=D=>{if(!D||D===0)return"";const k=Math.floor(D/60),I=Math.floor(D%60);return`${k}:${I.toString().padStart(2,"0")}`};return S.textContent=x(e.duration),l.appendChild(c),l.appendChild(f),i.appendChild(o),i.appendChild(l),e.duration&&e.duration>0&&i.appendChild(S),i.addEventListener("click",()=>{(this.player().id()||this.player().options_.id)==="video-embed"||window.location.pathname.includes("/embed")||window.location.search.includes("embed")||window.parent!==window?window.open(`/view?m=${e.id}`,"_blank","noopener,noreferrer"):window.location.href=`/view?m=${e.id}`}),i}getPlaceholderImage(e){const i=["#009931","#4ECDC4","#45B7D1","#96CEB4","#FFEAA7","#DDA0DD","#98D8C8","#F7DC6F","#BB8FCE","#85C1E9"];let r=0;for(let v=0;v=1200?12:e>=1024?9:e>=768?6:4}createSampleVideos(){return[{id:"sample1",title:"React Full Course for Beginners",author:"Bro Code",views:"2.1M views",duration:1800,thumbnail:"https://img.youtube.com/vi/dGcsHMXbSOA/maxresdefault.jpg"},{id:"sample2",title:"JavaScript ES6+ Features",author:"Tech Tutorials",views:"850K views",duration:1200,thumbnail:"https://img.youtube.com/vi/WZQc7RUAg18/maxresdefault.jpg"},{id:"sample3",title:"CSS Grid Layout Masterclass",author:"Web Dev Academy",views:"1.2M views",duration:2400,thumbnail:"https://img.youtube.com/vi/0xMQfnTU6oo/maxresdefault.jpg"},{id:"sample4",title:"Node.js Backend Development",author:"Code Master",views:"650K views",duration:3600,thumbnail:"https://img.youtube.com/vi/fBNz6F-Cowg/maxresdefault.jpg"},{id:"sample5",title:"Vue.js Complete Guide",author:"Frontend Pro",views:"980K views",duration:2800,thumbnail:"https://img.youtube.com/vi/qZXt1Aom3Cs/maxresdefault.jpg"},{id:"sample6",title:"Python Data Science",author:"Data Academy",views:"1.5M views",duration:4200,thumbnail:"https://img.youtube.com/vi/ua-CiDNNj30/maxresdefault.jpg"},{id:"sample7",title:"TypeScript Fundamentals",author:"TypeScript Expert",views:"720K views",duration:2100,thumbnail:"https://img.youtube.com/vi/BwuLxPH8IDs/maxresdefault.jpg"},{id:"sample8",title:"MongoDB Database Tutorial",author:"Database Pro",views:"890K views",duration:1800,thumbnail:"https://img.youtube.com/vi/-56x56UppqQ/maxresdefault.jpg"},{id:"sample9",title:"Docker Containerization",author:"DevOps Master",views:"1.1M views",duration:3200,thumbnail:"https://img.youtube.com/vi/pTFZFxd4hOI/maxresdefault.jpg"},{id:"sample10",title:"AWS Cloud Services",author:"Cloud Expert",views:"1.3M views",duration:4500,thumbnail:"https://img.youtube.com/vi/ITcXLS3h2qU/maxresdefault.jpg"},{id:"sample11",title:"GraphQL API Design",author:"API Specialist",views:"680K views",duration:2600,thumbnail:"https://img.youtube.com/vi/ed8SzALpx1Q/maxresdefault.jpg"},{id:"sample12",title:"Machine Learning Basics",author:"AI Academy",views:"2.3M views",duration:5400,thumbnail:"https://img.youtube.com/vi/i_LwzRVP7bg/maxresdefault.jpg"}]}show(){this.el().style.display="flex"}hide(){this.el().style.display="none"}}F.registerComponent("EndScreenOverlay",jx);const u8="",F3=F.getComponent("Component");class zx extends F3{constructor(e,i){super(e,i),this.nextVideoData=i.nextVideoData||null,this.countdownSeconds=i.countdownSeconds||5,this.onPlayNext=i.onPlayNext||(()=>{}),this.onCancel=i.onCancel||(()=>{}),this.currentCountdown=this.countdownSeconds,this.startTime=null,this.isActive=!1,this.startCountdown=this.startCountdown.bind(this),this.stopCountdown=this.stopCountdown.bind(this),this.handlePlayNext=this.handlePlayNext.bind(this),this.handleCancel=this.handleCancel.bind(this),this.updateCountdownDisplay=this.updateCountdownDisplay.bind(this)}createEl(){var c,f;const e=super.createEl("div",{className:"vjs-autoplay-countdown-overlay"}),i=((c=this.nextVideoData)==null?void 0:c.title)||"Next Video";e.innerHTML=` +`,U.syncInfo=oe,oe});o.set(f,new eI(I,P)),l+=`${ox(p.resolvedUri)} | Media Sequence: ${f} | Range: ${x} --> ${D} | Appended: ${k} +`,f++,c=D}),this.end_=c,this.storage_=o,this.diagnostics_=l}calculateBaseTime_(e,i,r){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const o=Math.min(...this.storage_.keys());if(ei!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,i,r,o,l)=>{const c=s.getMediaSequenceSync(l);if(!c||!c.isReliable)return null;const f=c.getSyncInfoForTime(o);return f?{time:f.start,partIndex:f.partIndex,segmentIndex:f.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,i,r,o)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let l=null,c=null;const f=vy(e);o=o||0;for(let p=0;p{let l=null,c=null;o=o||0;const f=vy(e);for(let p=0;p=k)&&(c=k,l={time:D,segmentIndex:S.segmentIndex,partIndex:S.partIndex})}}return l}},{name:"Discontinuity",run:(s,e,i,r,o)=>{let l=null;if(o=o||0,e.discontinuityStarts&&e.discontinuityStarts.length){let c=null;for(let f=0;f=x)&&(c=x,l={time:S.time,segmentIndex:p,partIndex:null})}}}return l}},{name:"Playlist",run:(s,e,i,r,o)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class iI extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const i=new vx,r=new bx(i),o=new bx(i);this.mediaSequenceStorage_={main:i,audio:r,vtt:o},this.logger_=ls("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,i,r,o,l){if(i!==1/0)return jy.find(({name:p})=>p==="VOD").run(this,e,i);const c=this.runStrategies_(e,i,r,o,l);if(!c.length)return null;for(const f of c){const{syncPoint:p,strategy:v}=f,{segmentIndex:S,time:x}=p;if(S<0)continue;const D=e.segments[S],k=x,I=k+D.duration;if(this.logger_(`Strategy: ${v}. Current time: ${o}. selected segment: ${S}. Time: [${k} -> ${I}]}`),o>=k&&o0&&(o.time*=-1),Math.abs(o.time+Nd({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))}runStrategies_(e,i,r,o,l){const c=[];for(let f=0;ftI){F.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let o=r-1;o>=0;o--){const l=e.segments[o];if(l&&typeof l.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+o,time:l.start},this.logger_(`playlist refresh sync: [time:${i.syncInfo.time}, mediaSequence: ${i.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const i=e.segments[0],r=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:i}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,i),o=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:o.start}));const l=o.dateTimeObject;o.discontinuity&&i&&l&&(this.timelineToDatetimeMappings[o.timeline]=-(l.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,i,r){const o=e.segment,l=e.part;let c=this.timelines[e.timeline],f,p;if(typeof e.timestampOffset=="number")c={time:e.startOfSegment,mapping:e.startOfSegment-i.start},r&&(this.timelines[e.timeline]=c,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${c.time}] [mapping: ${c.mapping}]`)),f=e.startOfSegment,p=i.end+c.mapping;else if(c)f=i.start+c.mapping,p=i.end+c.mapping;else return!1;return l&&(l.start=f,l.end=p),(!o.start||fp){let v;f<0?v=r.start-Nd({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:l}):v=r.end+Nd({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[c]={time:v,accuracy:p}}}}dispose(){this.trigger("dispose"),this.off()}}class nI extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:i,to:r}){return typeof i=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:i,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:i,to:r}){if(typeof i=="number"&&typeof r=="number"){this.lastTimelineChanges_[e]={type:e,from:i,to:r},delete this.pendingTimelineChanges_[e];const o={timelineChangeInfo:{from:i,to:r}};this.trigger({type:"timelinechange",metadata:o})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const sI=YS(QS(function(){var s=function(){function C(){this.listeners={}}var P=C.prototype;return P.on=function(Y,$){this.listeners[Y]||(this.listeners[Y]=[]),this.listeners[Y].push($)},P.off=function(Y,$){if(!this.listeners[Y])return!1;var G=this.listeners[Y].indexOf($);return this.listeners[Y]=this.listeners[Y].slice(0),this.listeners[Y].splice(G,1),G>-1},P.trigger=function(Y){var $=this.listeners[Y];if($)if(arguments.length===2)for(var G=$.length,W=0;W>7)*283)^G]=G;for(W=oe=0;!Y[W];W^=fe||1,oe=de[oe]||1)for(_e=oe^oe<<1^oe<<2^oe<<3^oe<<4,_e=_e>>8^_e&255^99,Y[W]=_e,$[_e]=W,le=K[me=K[fe=K[W]]],ge=le*16843009^me*65537^fe*257^W*16843008,he=K[_e]*257^_e*16843008,G=0;G<4;G++)P[G][W]=he=he<<24^he>>>8,U[G][_e]=ge=ge<<24^ge>>>8;for(G=0;G<5;G++)P[G]=P[G].slice(0),U[G]=U[G].slice(0);return C};let r=null;class o{constructor(P){r||(r=i()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let U,Y,$;const G=this._tables[0][4],W=this._tables[1],oe=P.length;let K=1;if(oe!==4&&oe!==6&&oe!==8)throw new Error("Invalid aes key size");const de=P.slice(0),fe=[];for(this._key=[de,fe],U=oe;U<4*oe+28;U++)$=de[U-1],(U%oe===0||oe===8&&U%oe===4)&&($=G[$>>>24]<<24^G[$>>16&255]<<16^G[$>>8&255]<<8^G[$&255],U%oe===0&&($=$<<8^$>>>24^K<<24,K=K<<1^(K>>7)*283)),de[U]=de[U-oe]^$;for(Y=0;U;Y++,U--)$=de[Y&3?U:U-4],U<=4||Y<4?fe[Y]=$:fe[Y]=W[0][G[$>>>24]]^W[1][G[$>>16&255]]^W[2][G[$>>8&255]]^W[3][G[$&255]]}decrypt(P,U,Y,$,G,W){const oe=this._key[1];let K=P^oe[0],de=$^oe[1],fe=Y^oe[2],me=U^oe[3],le,_e,he;const ge=oe.length/4-2;let Ae,ne=4;const Se=this._tables[1],pe=Se[0],Ue=Se[1],se=Se[2],Oe=Se[3],we=Se[4];for(Ae=0;Ae>>24]^Ue[de>>16&255]^se[fe>>8&255]^Oe[me&255]^oe[ne],_e=pe[de>>>24]^Ue[fe>>16&255]^se[me>>8&255]^Oe[K&255]^oe[ne+1],he=pe[fe>>>24]^Ue[me>>16&255]^se[K>>8&255]^Oe[de&255]^oe[ne+2],me=pe[me>>>24]^Ue[K>>16&255]^se[de>>8&255]^Oe[fe&255]^oe[ne+3],ne+=4,K=le,de=_e,fe=he;for(Ae=0;Ae<4;Ae++)G[(3&-Ae)+W]=we[K>>>24]<<24^we[de>>16&255]<<16^we[fe>>8&255]<<8^we[me&255]^oe[ne++],le=K,K=de,de=fe,fe=me,me=le}}class l extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(P){this.jobs.push(P),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const c=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},f=function(C,P,U){const Y=new Int32Array(C.buffer,C.byteOffset,C.byteLength>>2),$=new o(Array.prototype.slice.call(P)),G=new Uint8Array(C.byteLength),W=new Int32Array(G.buffer);let oe,K,de,fe,me,le,_e,he,ge;for(oe=U[0],K=U[1],de=U[2],fe=U[3],ge=0;ge{const Y=C[U];D(Y)?P[U]={bytes:Y.buffer,byteOffset:Y.byteOffset,byteLength:Y.byteLength}:P[U]=Y}),P};self.onmessage=function(C){const P=C.data,U=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),Y=new Uint32Array(P.key.bytes,P.key.byteOffset,P.key.byteLength/4),$=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new p(U,Y,$,function(G,W){self.postMessage(I({source:P.source,decrypted:W}),[W.buffer])})}}));var rI=$S(sI);const aI=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},_x=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},zy=(s,e)=>{e.activePlaylistLoader=s,s.load()},oI=(s,e)=>()=>{const{segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:o}}=e,l=o.activeTrack(),c=o.getActiveGroup(),f=o.activePlaylistLoader,p=o.lastGroup_;if(!(c&&p&&c.id===p.id)&&(o.lastGroup_=c,o.lastTrack_=l,_x(i,o),!(!c||c.isMainPlaylist))){if(!c.playlistLoader){f&&r.resetEverything();return}i.resyncLoader(),zy(c.playlistLoader,o)}},lI=(s,e)=>()=>{const{segmentLoaders:{[s]:i},mediaTypes:{[s]:r}}=e;r.lastGroup_=null,i.abort(),i.pause()},uI=(s,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[s]:r,main:o},mediaTypes:{[s]:l}}=e,c=l.activeTrack(),f=l.getActiveGroup(),p=l.activePlaylistLoader,v=l.lastTrack_;if(!(v&&c&&v.id===c.id)&&(l.lastGroup_=f,l.lastTrack_=c,_x(r,l),!!f)){if(f.isMainPlaylist){if(!c||!v||c.id===v.id)return;const S=e.vhs.playlistController_,x=S.selectPlaylist();if(S.media()===x)return;l.logger_(`track change. Switching main audio from ${v.id} to ${c.id}`),i.pause(),o.resetEverything(),S.fastQualityChange_(x);return}if(s==="AUDIO"){if(!f.playlistLoader){o.setAudio(!0),o.resetEverything();return}r.setAudio(!0),o.setAudio(!1)}if(p===f.playlistLoader){zy(f.playlistLoader,l);return}r.track&&r.track(c),r.resetEverything(),zy(f.playlistLoader,l)}},Up={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:i},excludePlaylist:r}=e,o=i.activeTrack(),l=i.activeGroup(),c=(l.filter(p=>p.default)[0]||l[0]).id,f=i.tracks[c];if(o===f){r({error:{message:"Problem encountered loading the default audio track."}});return}F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const p in i.tracks)i.tracks[p].enabled=i.tracks[p]===f;i.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:i}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}},Sx={AUDIO:(s,e,i)=>{if(!e)return;const{tech:r,requestOptions:o,segmentLoaders:{[s]:l}}=i;e.on("loadedmetadata",()=>{const c=e.media();l.playlist(c,o),(!r.paused()||c.endList&&r.preload()!=="none")&&l.load()}),e.on("loadedplaylist",()=>{l.playlist(e.media(),o),r.paused()||l.load()}),e.on("error",Up[s](s,i))},SUBTITLES:(s,e,i)=>{const{tech:r,requestOptions:o,segmentLoaders:{[s]:l},mediaTypes:{[s]:c}}=i;e.on("loadedmetadata",()=>{const f=e.media();l.playlist(f,o),l.track(c.activeTrack()),(!r.paused()||f.endList&&r.preload()!=="none")&&l.load()}),e.on("loadedplaylist",()=>{l.playlist(e.media(),o),r.paused()||l.load()}),e.on("error",Up[s](s,i))}},cI={AUDIO:(s,e)=>{const{vhs:i,sourceType:r,segmentLoaders:{[s]:o},requestOptions:l,main:{mediaGroups:c},mediaTypes:{[s]:{groups:f,tracks:p,logger_:v}},mainPlaylistLoader:S}=e,x=kd(S.main);(!c[s]||Object.keys(c[s]).length===0)&&(c[s]={main:{default:{default:!0}}},x&&(c[s].main.default.playlists=S.main.playlists));for(const D in c[s]){f[D]||(f[D]=[]);for(const k in c[s][D]){let I=c[s][D][k],C;if(x?(v(`AUDIO group '${D}' label '${k}' is a main playlist`),I.isMainPlaylist=!0,C=null):r==="vhs-json"&&I.playlists?C=new _u(I.playlists[0],i,l):I.resolvedUri?C=new _u(I.resolvedUri,i,l):I.playlists&&r==="dash"?C=new Ay(I.playlists[0],i,l,S):C=null,I=Ct({id:k,playlistLoader:C},I),Sx[s](s,I.playlistLoader,e),f[D].push(I),typeof p[k]>"u"){const P=new F.AudioTrack({id:k,kind:aI(I),enabled:!1,language:I.language,default:I.default,label:k});p[k]=P}}}o.on("error",Up[s](s,e))},SUBTITLES:(s,e)=>{const{tech:i,vhs:r,sourceType:o,segmentLoaders:{[s]:l},requestOptions:c,main:{mediaGroups:f},mediaTypes:{[s]:{groups:p,tracks:v}},mainPlaylistLoader:S}=e;for(const x in f[s]){p[x]||(p[x]=[]);for(const D in f[s][x]){if(!r.options_.useForcedSubtitles&&f[s][x][D].forced)continue;let k=f[s][x][D],I;if(o==="hls")I=new _u(k.resolvedUri,r,c);else if(o==="dash"){if(!k.playlists.filter(P=>P.excludeUntil!==1/0).length)return;I=new Ay(k.playlists[0],r,c,S)}else o==="vhs-json"&&(I=new _u(k.playlists?k.playlists[0]:k.resolvedUri,r,c));if(k=Ct({id:D,playlistLoader:I},k),Sx[s](s,k.playlistLoader,e),p[x].push(k),typeof v[D]>"u"){const C=i.addRemoteTextTrack({id:D,kind:"subtitles",default:k.default&&k.autoselect,language:k.language,label:D},!1).track;v[D]=C}}}l.on("error",Up[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:i,main:{mediaGroups:r},mediaTypes:{[s]:{groups:o,tracks:l}}}=e;for(const c in r[s]){o[c]||(o[c]=[]);for(const f in r[s][c]){const p=r[s][c][f];if(!/^(?:CC|SERVICE)/.test(p.instreamId))continue;const v=i.options_.vhs&&i.options_.vhs.captionServices||{};let S={label:f,language:p.language,instreamId:p.instreamId,default:p.default&&p.autoselect};if(v[S.instreamId]&&(S=Ct(S,v[S.instreamId])),S.default===void 0&&delete S.default,o[c].push(Ct({id:f},p)),typeof l[f]>"u"){const x=i.addRemoteTextTrack({id:S.instreamId,kind:"captions",default:S.default,language:S.language,label:S.label},!1).track;l[f]=x}}}}},xx=(s,e)=>{for(let i=0;ii=>{const{mainPlaylistLoader:r,mediaTypes:{[s]:{groups:o}}}=e,l=r.media();if(!l)return null;let c=null;l.attributes[s]&&(c=o[l.attributes[s]]);const f=Object.keys(o);if(!c)if(s==="AUDIO"&&f.length>1&&kd(e.main))for(let p=0;p"u"?c:i===null||!c?null:c.filter(p=>p.id===i.id)[0]||null},hI={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:i}}}=e;for(const r in i)if(i[r].enabled)return i[r];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:i}}}=e;for(const r in i)if(i[r].mode==="showing"||i[r].mode==="hidden")return i[r];return null}},fI=(s,{mediaTypes:e})=>()=>{const i=e[s].activeTrack();return i?e[s].activeGroup(i):null},pI=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(v=>{cI[v](v,s)});const{mediaTypes:e,mainPlaylistLoader:i,tech:r,vhs:o,segmentLoaders:{["AUDIO"]:l,main:c}}=s;["AUDIO","SUBTITLES"].forEach(v=>{e[v].activeGroup=dI(v,s),e[v].activeTrack=hI[v](v,s),e[v].onGroupChanged=oI(v,s),e[v].onGroupChanging=lI(v,s),e[v].onTrackChanged=uI(v,s),e[v].getActiveGroup=fI(v,s)});const f=e.AUDIO.activeGroup();if(f){const v=(f.filter(x=>x.default)[0]||f[0]).id;e.AUDIO.tracks[v].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(c.setAudio(!1),l.setAudio(!0)):c.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(v=>e[v].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(v=>e[v].onGroupChanging())});const p=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",p),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),o.on("dispose",()=>{r.audioTracks().removeEventListener("change",p),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const v in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[v])},mI=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:$r,activeTrack:$r,getActiveGroup:$r,onGroupChanged:$r,onTrackChanged:$r,lastTrack_:null,logger_:ls(`MediaGroups[${e}]`)}}),s};class Ex{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Dn(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(i=>[i.ID,i])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class gI extends F.EventTarget{constructor(e,i){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Ex,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ls("Content Steering"),this.xhr_=e,this.getBandwidth_=i}assignTagProperties(e,i){this.manifestType_=i.serverUri?"HLS":"DASH";const r=i.serverUri||i.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=Dn(e,r),this.defaultPathway=i.pathwayId||i.defaultServiceLocation,this.queryBeforeStart=i.queryBeforeStart,this.proxyServerUrl_=i.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const i=this.steeringManifest.reloadUri;if(!i)return;const r=e?i:this.getRequestURI(i);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const o={contentSteeringInfo:{uri:r}};this.trigger({type:"contentsteeringloadstart",metadata:o}),this.request_=this.xhr_({uri:r,requestType:"content-steering-manifest"},(l,c)=>{if(l){if(c.status===410){this.logger_(`manifest request 410 ${l}.`),this.logger_(`There will be no more content steering requests to ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(c.status===429){const v=c.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${l}.`),this.logger_(`content steering will retry in ${v} seconds.`),this.startTTLTimeout_(parseInt(v,10));return}this.logger_(`manifest failed to load ${l}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:o});let f;try{f=JSON.parse(this.request_.responseText)}catch(v){const S={errorType:F.Error.StreamingContentSteeringParserError,error:v};this.trigger({type:"error",metadata:S})}this.assignSteeringProperties_(f);const p={contentSteeringInfo:o.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:p}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const i=new z.URL(e),r=new z.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(i.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){const i=JSON.parse(z.atob(e));this.assignSteeringProperties_(i)}setSteeringParams_(e){const i=new z.URL(e),r=this.getPathway(),o=this.getBandwidth_();if(r){const l=`_${this.manifestType_}_pathway`;i.searchParams.set(l,r)}if(o){const l=`_${this.manifestType_}_throughput`;i.searchParams.set(l,o)}return i.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const r=(o=>{for(const l of o)if(this.availablePathways_.has(l))return l;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const i=o=>this.excludedSteeringManifestURLs.has(o);if(this.proxyServerUrl_){const o=this.setProxyServerUrl_(e);if(!i(o))return o}const r=this.setSteeringParams_(e);return i(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){const i=e*1e3;this.ttlTimeout_=z.setTimeout(()=>{this.requestSteeringManifest()},i)}clearTTLTimeout_(){z.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Ex}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,i){return!i&&this.steeringManifest.reloadUri||i&&(Dn(e,i.serverURL)!==this.steeringManifest.reloadUri||i.defaultServiceLocation!==this.defaultPathway||i.queryBeforeStart!==this.queryBeforeStart||i.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const yI=(s,e)=>{let i=null;return(...r)=>{clearTimeout(i),i=setTimeout(()=>{s.apply(null,r)},e)}},TI=10;let za;const vI=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],bI=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},_I=function({currentPlaylist:s,buffered:e,currentTime:i,nextPlaylist:r,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:c,bufferBasedABR:f,log:p}){if(!r)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const v=`allowing switch ${s&&s.id||"null"} -> ${r.id}`;if(!s)return p(`${v} as current playlist is not set`),!0;if(r.id===s.id)return!1;const S=!!Tu(e,i).length;if(!s.endList)return!S&&typeof s.partTargetDuration=="number"?(p(`not ${v} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(p(`${v} as current playlist is live`),!0);const x=yy(e,i),D=f?ki.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ki.MAX_BUFFER_LOW_WATER_LINE;if(cI)&&x>=o){let C=`${v} as forwardBuffer >= bufferLowWaterLine (${x} >= ${o})`;return f&&(C+=` and next bandwidth > current bandwidth (${k} > ${I})`),p(C),!0}return p(`not ${v} as no switching criteria met`),!1};class SI extends F.EventTarget{constructor(e){super(),this.fastQualityChange_=yI(this.fastQualityChange_.bind(this),100);const{src:i,withCredentials:r,tech:o,bandwidth:l,externVhs:c,useCueTags:f,playlistExclusionDuration:p,enableLowInitialPlaylist:v,sourceType:S,cacheEncryptionKeys:x,bufferBasedABR:D,leastPixelDiffSelector:k,captionServices:I,experimentalUseMMS:C}=e;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:P}=e;(P===null||typeof P>"u")&&(P=1/0),za=c,this.bufferBasedABR=!!D,this.leastPixelDiffSelector=!!k,this.withCredentials=r,this.tech_=o,this.vhs_=o.vhs,this.player_=e.player_,this.sourceType_=S,this.useCueTags_=f,this.playlistExclusionDuration=p,this.maxPlaylistRetries=P,this.enableLowInitialPlaylist=v,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:P,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=mI(),C&&z.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new z.ManagedMediaSource,this.usingManagedMediaSource_=!0,F.log("Using ManagedMediaSource")):z.MediaSource&&(this.mediaSource=new z.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Ni(),this.hasPlayed_=!1,this.syncController_=new iI(e),this.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new rI,this.sourceUpdater_=new mx(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new nI,this.keyStatusMap_=new Map;const U={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:l,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:x,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Ay(i,this.vhs_,Ct(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new _u(i,this.vhs_,Ct(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Ly(Ct(U,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Ly(Ct(U,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new K3(Ct(U,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((G,W)=>{function oe(){o.off("vttjserror",K),G()}function K(){o.off("vttjsloaded",oe),W()}o.one("vttjsloaded",oe),o.one("vttjserror",K),o.addWebVttScript_()})}),e);const Y=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new gI(this.vhs_.xhr,Y),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),vI.forEach(G=>{this[G+"_"]=bI.bind(this,G)}),this.logger_=ls("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const $=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one($,()=>{const G=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-G,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)}switchMedia_(e,i,r){const o=this.media(),l=o&&(o.id||o.uri),c=e&&(e.id||e.uri);if(l&&l!==c){this.logger_(`switch media ${l} -> ${c} from ${i}`);const f={renditionInfo:{id:c,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:i};this.trigger({type:"renditionselected",metadata:f}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${i}`})}this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const i=this.mediaTypes_[e],r=i?i.activeGroup():null,o=this.contentSteeringController_.getPathway();if(r&&o){const c=(r.length?r[0].playlists:r.playlists).filter(f=>f.attributes.serviceLocation===o);c.length&&this.mediaTypes_[e].activePlaylistLoader.media(c[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=z.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(z.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;const r=e.mediaGroups.AUDIO,o=Object.keys(r);let l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{const f=r.main||o.length&&r[o[0]];for(const p in f)if(f[p].default){l={label:p};break}}if(!l)return i;const c=[];for(const f in r)if(r[f][l.label]){const p=r[f][l.label];if(p.playlists&&p.playlists.length)c.push.apply(c,p.playlists);else if(p.uri)c.push(p);else if(e.playlists.length)for(let v=0;v{const i=this.mainPlaylistLoader_.media(),r=i.targetDuration*1.5*1e3;_y(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,i.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.mainSegmentLoader_.load()),pI({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),i),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let i=this.mainPlaylistLoader_.media();if(!i){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let r;if(this.enableLowInitialPlaylist&&(r=this.selectInitialPlaylist()),r||(r=this.selectPlaylist()),!r||!this.shouldSwitchToMedia_(r)||(this.initialMedia_=r,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;i=this.initialMedia_}this.handleUpdatedMediaPlaylist(i)}),this.mainPlaylistLoader_.on("error",()=>{const i=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const i=this.mainPlaylistLoader_.media(),r=i.targetDuration*1.5*1e3;_y(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const i=this.mainPlaylistLoader_.media();if(i.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(i)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(i=>{this.mainPlaylistLoader_.on(i,r=>{this.player_.trigger(ei({},r))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,i){const r=e.mediaGroups||{};let o=!0;const l=Object.keys(r.AUDIO);for(const c in r.AUDIO)for(const f in r.AUDIO[c])r.AUDIO[c][f].uri||(o=!1);o&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),za.Playlist.isAes(i)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),l.length&&Object.keys(r.AUDIO[l[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const i=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),c=this.tech_.buffered();return _I({buffered:c,currentTime:r,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const r=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:r.playlist,error:r})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const r=this.audioSegmentLoader_.pendingSegment_;if(!r||!r.segment||!r.segment.syncInfo)return;const o=r.segment.syncInfo.end+.01;this.tech_.setCurrentTime(o)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",r=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:TI}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const r=this.getCodecsOrExclude_();r&&this.sourceUpdater_.addOrChangeSourceBuffers(r)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(r=>{this.mainSegmentLoader_.on(r,o=>{this.player_.trigger(ei({},o))}),this.audioSegmentLoader_.on(r,o=>{this.player_.trigger(ei({},o))}),this.subtitleSegmentLoader_.on(r,o=>{this.player_.trigger(ei({},o))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const i=this.duration();e[e.length-1].endTime=isNaN(i)||Math.abs(i)===1/0?Number.MAX_VALUE:i}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const i=this.mainSegmentLoader_.getCurrentMediaInfo_();!i||i.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const o=za.Playlist.playlistEnd(e,r),l=this.tech_.currentTime(),c=this.tech_.buffered();if(!c.length)return o-l<=nr;const f=c.end(c.length-1);return f-l<=nr&&o-f<=nr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:i={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||i.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const o=this.mainPlaylistLoader_.main.playlists,l=o.filter(Lp),c=l.length===1&&l[0]===e;if(o.length===1&&r!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(c);if(c){if(this.main().contentSteering){const I=this.pathwayAttribute_(e),C=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(I),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(I)},C);return}let k=!1;o.forEach(I=>{if(I===e)return;const C=I.excludeUntil;typeof C<"u"&&C!==1/0&&(k=!0,delete I.excludeUntil)}),k&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let f;e.playlistErrors_>this.maxPlaylistRetries?f=1/0:f=Date.now()+r*1e3,e.excludeUntil=f,i.reason&&(e.lastExcludeReason_=i.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const p=this.selectPlaylist();if(!p){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const v=i.internal?this.logger_:F.log.warn,S=i.message?" "+i.message:"";v(`${i.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${S} Switching to playlist ${p.id}.`),p.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),p.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const x=p.targetDuration/2*1e3||5*1e3,D=typeof p.lastRequest=="number"&&Date.now()-p.lastRequest<=x;return this.switchMedia_(p,"exclude",c||D)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,i){const r=[],o=e==="all";(o||e==="main")&&r.push(this.mainPlaylistLoader_);const l=[];(o||e==="audio")&&l.push("AUDIO"),(o||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(c=>{const f=this.mediaTypes_[c]&&this.mediaTypes_[c].activePlaylistLoader;f&&r.push(f)}),["main","audio","subtitle"].forEach(c=>{const f=this[`${c}SegmentLoader_`];f&&(e===c||e==="all")&&r.push(f)}),r.forEach(c=>i.forEach(f=>{typeof c[f]=="function"&&c[f]()}))}setCurrentTime(e){const i=Tu(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:za.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,i){const r=e.media();if(!r)return null;const o=this.syncController_.getMediaSequenceSync(i);if(o&&o.isReliable){const f=o.start,p=o.end;if(!isFinite(f)||!isFinite(p))return null;const v=za.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r),S=Math.max(f,p-v);return Ni([[f,S]])}const l=this.syncController_.getExpiredTime(r,this.duration());if(l===null)return null;const c=za.Playlist.seekable(r,l,za.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r));return c.length?c:null}computeFinalSeekable_(e,i){if(!i)return e;const r=e.start(0),o=e.end(0),l=i.start(0),c=i.end(0);return l>o||r>c?e:Ni([[Math.max(r,l),Math.min(o,c)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let i;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!i))return;const r=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,i),!this.seekable_||r&&r.length&&this.seekable_.length&&r.start(0)===this.seekable_.start(0)&&r.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${fS(this.seekable_)}]`);const o={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:o}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const o=this.seekable();if(!o.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration0&&(r=Math.max(r,i.end(i.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const i=this.mediaTypes_[e].groups;for(const r in i)i[r].forEach(o=>{o.playlistLoader&&o.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=Id(this.main(),i),o={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(o.video=r.video||e.main.videoCodec||Qw),e.main.isMuxed&&(o.video+=`,${r.audio||e.main.audioCodec||r1}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||l)&&(o.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||r1,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!o.audio&&!o.video){this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const c=(v,S)=>v?nd(S,this.usingManagedMediaSource_):Qg(S),f={};let p;if(["video","audio"].forEach(function(v){if(o.hasOwnProperty(v)&&!c(e[v].isFmp4,o[v])){const S=e[v].isFmp4?"browser":"muxer";f[S]=f[S]||[],f[S].push(o[v]),v==="audio"&&(p=S)}}),l&&p&&i.attributes.AUDIO){const v=i.attributes.AUDIO;this.main().playlists.forEach(S=>{(S.attributes&&S.attributes.AUDIO)===v&&S!==i&&(S.excludeUntil=1/0)}),this.logger_(`excluding audio group ${v} as ${p} does not support codec(s): "${o.audio}"`)}if(Object.keys(f).length){const v=Object.keys(f).reduce((S,x)=>(S&&(S+=", "),S+=`${x} does not support codec(s): "${f[x].join(",")}"`,S),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:v},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const v=[];if(["video","audio"].forEach(S=>{const x=(Gs(this.sourceUpdater_.codecs[S]||"")[0]||{}).type,D=(Gs(o[S]||"")[0]||{}).type;x&&D&&x.toLowerCase()!==D.toLowerCase()&&v.push(`"${this.sourceUpdater_.codecs[S]}" -> "${o[S]}"`)}),v.length){this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${v.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return o}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}excludeUnsupportedVariants_(){const e=this.main().playlists,i=[];Object.keys(e).forEach(r=>{const o=e[r];if(i.indexOf(o.id)!==-1)return;i.push(o.id);const l=Id(this.main,o),c=[];l.audio&&!Qg(l.audio)&&!nd(l.audio,this.usingManagedMediaSource_)&&c.push(`audio codec ${l.audio}`),l.video&&!Qg(l.video)&&!nd(l.video,this.usingManagedMediaSource_)&&c.push(`video codec ${l.video}`),l.text&&l.text==="stpp.ttml.im1t"&&c.push(`text codec ${l.text}`),c.length&&(o.excludeUntil=1/0,this.logger_(`excluding ${o.id} for unsupported: ${c.join(", ")}`))})}excludeIncompatibleVariants_(e){const i=[],r=this.main().playlists,o=Od(Gs(e)),l=kS(o),c=o.video&&Gs(o.video)[0]||null,f=o.audio&&Gs(o.audio)[0]||null;Object.keys(r).forEach(p=>{const v=r[p];if(i.indexOf(v.id)!==-1||v.excludeUntil===1/0)return;i.push(v.id);const S=[],x=Id(this.mainPlaylistLoader_.main,v),D=kS(x);if(!(!x.audio&&!x.video)){if(D!==l&&S.push(`codec count "${D}" !== "${l}"`),!this.sourceUpdater_.canChangeType()){const k=x.video&&Gs(x.video)[0]||null,I=x.audio&&Gs(x.audio)[0]||null;k&&c&&k.type.toLowerCase()!==c.type.toLowerCase()&&S.push(`video codec "${k.type}" !== "${c.type}"`),I&&f&&I.type.toLowerCase()!==f.type.toLowerCase()&&S.push(`audio codec "${I.type}" !== "${f.type}"`)}S.length&&(v.excludeUntil=1/0,this.logger_(`excluding ${v.id}: ${S.join(" && ")}`))}})}updateAdCues_(e){let i=0;const r=this.seekable();r.length&&(i=r.start(0)),J3(e,this.cueTagsTrack_,i)}goalBufferLength(){const e=this.tech_.currentTime(),i=ki.GOAL_BUFFER_LENGTH,r=ki.GOAL_BUFFER_LENGTH_RATE,o=Math.max(i,ki.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*r,o)}bufferLowWaterLine(){const e=this.tech_.currentTime(),i=ki.BUFFER_LOW_WATER_LINE,r=ki.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(i,ki.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(i,ki.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*r,this.bufferBasedABR?l:o)}bufferHighWaterLine(){return ki.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){lx(this.inbandTextTracks_,"com.apple.streaming",this.tech_),O3({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,i,r){const o=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();lx(this.inbandTextTracks_,e,this.tech_),w3({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:o,videoDuration:r})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const i of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(i));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(i=>{this.contentSteeringController_.on(i,r=>{this.trigger(ei({},r))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const i=this.main();(this.contentSteeringController_.didDASHTagChange(i.uri,i.contentSteering)||(()=>{const l=this.contentSteeringController_.getAvailablePathways(),c=[];for(const f of i.playlists){const p=f.attributes.serviceLocation;if(p&&(c.push(p),!l.has(p)))return!0}return!!(!c.length&&l.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const r=this.main().playlists,o=new Set;let l=!1;Object.keys(r).forEach(c=>{const f=r[c],p=this.pathwayAttribute_(f),v=p&&e!==p;f.excludeUntil===1/0&&f.lastExcludeReason_==="content-steering"&&!v&&(delete f.excludeUntil,delete f.lastExcludeReason_,l=!0);const x=!f.excludeUntil&&f.excludeUntil!==1/0;!o.has(f.id)&&v&&x&&(o.add(f.id),f.excludeUntil=1/0,f.lastExcludeReason_="content-steering",this.logger_(`excluding ${f.id} for ${f.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(c=>{const f=this.mediaTypes_[c];if(f.activePlaylistLoader){const p=f.activePlaylistLoader.media_;p&&p.attributes.serviceLocation!==e&&(l=!0)}}),l&&this.changeSegmentPathway_()}handlePathwayClones_(){const i=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,o=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||o&&o.size){for(const[c,f]of r.entries())o.get(c)||(this.mainPlaylistLoader_.updateOrDeleteClone(f),this.contentSteeringController_.excludePathway(c));for(const[c,f]of o.entries()){const p=r.get(c);if(!p){i.filter(S=>S.attributes["PATHWAY-ID"]===f["BASE-ID"]).forEach(S=>{this.mainPlaylistLoader_.addClonePathway(f,S)}),this.contentSteeringController_.addAvailablePathway(c);continue}this.equalPathwayClones_(p,f)||(this.mainPlaylistLoader_.updateOrDeleteClone(f,!0),this.contentSteeringController_.addAvailablePathway(c))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...o])))}}equalPathwayClones_(e,i){if(e["BASE-ID"]!==i["BASE-ID"]||e.ID!==i.ID||e["URI-REPLACEMENT"].HOST!==i["URI-REPLACEMENT"].HOST)return!1;const r=e["URI-REPLACEMENT"].PARAMS,o=i["URI-REPLACEMENT"].PARAMS;for(const l in r)if(r[l]!==o[l])return!1;for(const l in o)if(r[l]!==o[l])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const i="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(r=>{const o=this.mainPlaylistLoader_.getKeyIdSet(r);!o||!o.size||o.forEach(l=>{const c="usable",f=this.keyStatusMap_.has(l)&&this.keyStatusMap_.get(l)===c,p=r.lastExcludeReason_===i&&r.excludeUntil===1/0;f?f&&p&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${l} is ${c}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==i&&(r.excludeUntil=1/0,r.lastExcludeReason_=i,this.logger_(`excluding playlist ${r.id} because the key ID ${l} doesn't exist in the keyStatusMap or is not ${c}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(r=>{const o=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,l=r.excludeUntil===1/0&&r.lastExcludeReason_===i;o&&l&&(delete r.excludeUntil,F.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${i} key IDs`))})}addKeyStatus_(e,i){const l=(typeof e=="string"?e:X3(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${i}' with key ID ${l} added to the keyStatusMap`),this.keyStatusMap_.set(l,i)}updatePlaylistByKeyStatus(e,i){this.addKeyStatus_(e,i),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const xI=(s,e,i)=>r=>{const o=s.main.playlists[e],l=by(o),c=Lp(o);if(typeof r>"u")return c;r?delete o.disabled:o.disabled=!0;const f={renditionInfo:{id:e,bandwidth:o.attributes.BANDWIDTH,resolution:o.attributes.RESOLUTION,codecs:o.attributes.CODECS},cause:"fast-quality"};return r!==c&&!l&&(r?(i(o),s.trigger({type:"renditionenabled",metadata:f})):s.trigger({type:"renditiondisabled",metadata:f})),r};class EI{constructor(e,i,r){const{playlistController_:o}=e,l=o.fastQualityChange_.bind(o);if(i.attributes){const c=i.attributes.RESOLUTION;this.width=c&&c.width,this.height=c&&c.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=Id(o.main(),i),this.playlist=i,this.id=r,this.enabled=xI(e.playlists,i.id,l)}}const MI=function(s){s.representations=()=>{const e=s.playlistController_.main(),i=kd(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return i?i.filter(r=>!by(r)).map((r,o)=>new EI(s,r,r.id)):[]}},Mx=["seeking","seeked","pause","playing","error"];class DI extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=ls("PlaybackWatcher"),this.logger_("initialize");const i=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),o=()=>this.techWaiting_(),l=()=>this.resetTimeUpdate_(),c=this.playlistController_,f=["main","subtitle","audio"],p={};f.forEach(S=>{p[S]={reset:()=>this.resetSegmentDownloads_(S),updateend:()=>this.checkSegmentDownloads_(S)},c[`${S}SegmentLoader_`].on("appendsdone",p[S].updateend),c[`${S}SegmentLoader_`].on("playlistupdate",p[S].reset),this.tech_.on(["seeked","seeking"],p[S].reset)});const v=S=>{["main","audio"].forEach(x=>{c[`${x}SegmentLoader_`][S]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),v("off"))},this.clearSeekingAppendCheck_=()=>v("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),v("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",o),this.tech_.on(Mx,l),this.tech_.on("canplay",r),this.tech_.one("play",i),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",o),this.tech_.off(Mx,l),this.tech_.off("canplay",r),this.tech_.off("play",i),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),f.forEach(S=>{c[`${S}SegmentLoader_`].off("appendsdone",p[S].updateend),c[`${S}SegmentLoader_`].off("playlistupdate",p[S].reset),this.tech_.off(["seeked","seeking"],p[S].reset)}),this.checkCurrentTimeTimeout_&&z.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&z.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=z.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const i=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=i.buffered_()}checkSegmentDownloads_(e){const i=this.playlistController_,r=i[`${e}SegmentLoader_`],o=r.buffered_(),l=pO(this[`${e}Buffered_`],o);if(this[`${e}Buffered_`]=o,l){const c={bufferedRanges:o};i.trigger({type:"bufferedrangeschanged",metadata:c}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:r.playlist_&&r.playlist_.id,buffered:zo(o)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&i.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===e&&(!i.length||e+nr>=i.end(i.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Ni([this.lastRecordedTime,e]));const r={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:r}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const i=this.seekable(),r=this.tech_.currentTime(),o=this.afterSeekableWindow_(i,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let l;if(o&&(l=i.end(i.length-1)),this.beforeSeekableWindow_(i,r)){const I=i.start(0);l=I+(I===i.end(0)?0:nr)}if(typeof l<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${fS(i)}. Seeking to ${l}.`),this.tech_.setCurrentTime(l),!0;const c=this.playlistController_.sourceUpdater_,f=this.tech_.buffered(),p=c.audioBuffer?c.audioBuffered():null,v=c.videoBuffer?c.videoBuffered():null,S=this.media(),x=S.partTargetDuration?S.partTargetDuration:(S.targetDuration-ir)*2,D=[p,v];for(let I=0;I ${r.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,i)){const f=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${i}. Seeking to live point (seekable end) ${f}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(f),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:i}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const c=Ip(o,i);return c.length>0?(this.logger_(`Stopped at ${i} and seeking to ${c.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(i),!0):!1}afterSeekableWindow_(e,i,r,o=!1){if(!e.length)return!1;let l=e.end(e.length-1)+nr;const c=!r.endList,f=typeof r.partTargetDuration=="number";return c&&(f||o)&&(l=e.end(e.length-1)+r.targetDuration*3),i>l}beforeSeekableWindow_(e,i){return!!(e.length&&e.start(0)>0&&i2)return{start:l,end:c}}return null}}const CI={errorInterval:30,getSource(s){const i=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(i)}},Dx=function(s,e){let i=0,r=0;const o=Ct(CI,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){r&&s.currentTime(r)},c=function(S){S!=null&&(r=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",l),s.src(S),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},f=function(){if(Date.now()-i{Object.defineProperty(Kt,s,{get(){return F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),ki[s]},set(e){if(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}ki[s]=e}})});const Ax="videojs-vhs",wx=function(s,e){const i=e.media();let r=-1;for(let o=0;o{s.addQualityLevel(i)}),wx(s,e.playlists)};Kt.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const LI=(s,e,i)=>{if(!s)return s;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=Od(Gs(e.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);const o=Fl(r.video),l=Fl(r.audio),c={};for(const f in s)c[f]={},l&&(c[f].audioContentType=l),o&&(c[f].videoContentType=o),e.contentProtection&&e.contentProtection[f]&&e.contentProtection[f].pssh&&(c[f].pssh=e.contentProtection[f].pssh),typeof s[f]=="string"&&(c[f].url=s[f]);return Ct(s,c)},RI=(s,e)=>s.reduce((i,r)=>{if(!r.contentProtection)return i;const o=e.reduce((l,c)=>{const f=r.contentProtection[c];return f&&f.pssh&&(l[c]={pssh:f.pssh}),l},{});return Object.keys(o).length&&i.push(o),i},[]),jI=({player:s,sourceKeySystems:e,audioMedia:i,mainPlaylists:r})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const o=i?r.concat([i]):r,l=RI(o,Object.keys(e)),c=[],f=[];return l.forEach(p=>{f.push(new Promise((v,S)=>{s.tech_.one("keysessioncreated",v)})),c.push(new Promise((v,S)=>{s.eme.initializeMediaKeys({keySystems:p},x=>{if(x){S(x);return}v()})}))}),Promise.race([Promise.all(c),Promise.race(f)])},zI=({player:s,sourceKeySystems:e,media:i,audioMedia:r})=>{const o=LI(e,i,r);return o?(s.currentSource().keySystems=o,o&&!s.eme?(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Nx=()=>{if(!z.localStorage)return null;const s=z.localStorage.getItem(Ax);if(!s)return null;try{return JSON.parse(s)}catch{return null}},UI=s=>{if(!z.localStorage)return!1;let e=Nx();e=e?Ct(e,s):s;try{z.localStorage.setItem(Ax,JSON.stringify(e))}catch{return!1}return e},PI=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,kx=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},Ox=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},Ix=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Lx=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Kt.supportsNativeHls=function(){if(!ve||!ve.createElement)return!1;const s=ve.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(s.canPlayType(i))}):!1}(),Kt.supportsNativeDash=function(){return!ve||!ve.createElement||!F.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ve.createElement("video").canPlayType("application/dash+xml"))}(),Kt.supportsTypeNatively=s=>s==="hls"?Kt.supportsNativeHls:s==="dash"?Kt.supportsNativeDash:!1,Kt.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Kt.xhr.onRequest=function(s){kx(Kt.xhr,s)},Kt.xhr.onResponse=function(s){Ox(Kt.xhr,s)},Kt.xhr.offRequest=function(s){Ix(Kt.xhr,s)},Kt.xhr.offResponse=function(s){Lx(Kt.xhr,s)};const BI=F.getComponent("Component");class Rx extends BI{constructor(e,i,r){if(super(i,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=ls("VhsHandler"),i.options_&&i.options_.playerId){const o=F.getPlayer(i.options_.playerId);this.player_=o}if(this.tech_=i,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ve,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],o=>{const l=ve.fullscreenElement||ve.webkitFullscreenElement||ve.mozFullScreenElement||ve.msFullscreenElement;l&&l.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Ct(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const r=Nx();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ki.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ki.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const i=this.options_.customPixelRatio;typeof i=="number"&&i>=0&&(this.customPixelRatio=i)}setOptions(e={}){this.setOptions_(e)}src(e,i){if(!e)return;this.setOptions_(),this.options_.src=PI(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Kt,this.options_.sourceType=a1(i),this.options_.seekTo=l=>{this.tech_.setCurrentTime(l)},this.options_.player_=this.player_,this.playlistController_=new SI(this.options_);const r=Ct({liveRangeSafeTimeDelta:nr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new DI(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const l=F.players[this.tech_.options_.playerId];let c=this.playlistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),l.error(c)});const o=this.options_.bufferBasedABR?Kt.movingAverageBandwidthSelector(.55):Kt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):o.bind(this),this.playlistController_.selectInitialPlaylist=Kt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(l){this.playlistController_.selectPlaylist=l.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(l){this.playlistController_.mainSegmentLoader_.throughput.rate=l,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let l=this.playlistController_.mainSegmentLoader_.bandwidth;const c=z.navigator.connection||z.navigator.mozConnection||z.navigator.webkitConnection,f=1e7;if(this.options_.useNetworkInformationApi&&c){const p=c.downlink*1e3*1e3;p>=f&&l>=f?l=Math.max(l,p):l=p}return l},set(l){this.playlistController_.mainSegmentLoader_.bandwidth=l,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const l=1/(this.bandwidth||1);let c;return this.throughput>0?c=1/this.throughput:c=0,Math.floor(1/(l+c))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>zo(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>zo(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&UI({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{MI(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=z.URL.createObjectURL(this.playlistController_.mediaSource),(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),jI({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(i=>{this.logger_("error while creating EME key session",i),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=zI({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!i){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{II(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{wx(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Cx,"mux.js":wI,"mpd-parser":NI,"m3u8-parser":kI,"aes-decrypter":OI}}version(){return this.constructor.version()}canChangeType(){return mx.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&z.URL.revokeObjectURL&&(z.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,i){return $O({playlist:this.playlistController_.media(),time:e,callback:i})}seekToProgramTime(e,i,r=!0,o=2){return qS({programTime:e,playlist:this.playlistController_.media(),retryCount:o,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})}setupXhrHooks_(){this.xhr.onRequest=e=>{kx(this.xhr,e)},this.xhr.onResponse=e=>{Ox(this.xhr,e)},this.xhr.offRequest=e=>{Ix(this.xhr,e)},this.xhr.offResponse=e=>{Lx(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],i=["gapjumped","playedrangeschanged"];e.forEach(r=>{this.playlistController_.on(r,o=>{this.player_.trigger(ei({},o))})}),i.forEach(r=>{this.playbackWatcher_.on(r,o=>{this.player_.trigger(ei({},o))})})}}const Pp={name:"videojs-http-streaming",VERSION:Cx,canHandleSource(s,e={}){const i=Ct(F.options,e);return!i.vhs.experimentalUseMMS&&!nd("avc1.4d400d,mp4a.40.2",!1)?!1:Pp.canPlayType(s.type,i)},handleSource(s,e,i={}){const r=Ct(F.options,i);return e.vhs=new Rx(s,e,r),e.vhs.xhr=jS(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const i=a1(s);if(!i)return"";const r=Pp.getOverrideNative(e);return!Kt.supportsTypeNatively(i)||r?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,i=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:r=i}=e;return r}};(()=>nd("avc1.4d400d,mp4a.40.2",!0))()&&F.getTech("Html5").registerSourceHandler(Pp,0),F.VhsHandler=Rx,F.VhsSourceHandler=Pp,F.Vhs=Kt,F.use||F.registerComponent("Vhs",Kt),F.options.vhs=F.options.vhs||{},(!F.getPlugin||!F.getPlugin("reloadSourceOnError"))&&F.registerPlugin("reloadSourceOnError",AI);const r8="",a8="",o8="",l8="",qI=F.getComponent("Component");class jx extends qI{constructor(e,i){i&&i.relatedVideos&&(i._relatedVideos=i.relatedVideos),super(e,i),this.relatedVideos=i&&i.relatedVideos?i.relatedVideos:[]}createEl(){const e=this.options_&&this.options_._relatedVideos?this.options_._relatedVideos:[],i=this.getMaxVideosForScreen(),r=e.slice(0,i),o=super.createEl("div",{className:"vjs-end-screen-overlay"}),l=F.dom.createEl("div",{className:"vjs-related-videos-grid"});return r&&Array.isArray(r)&&r.length>0?r.forEach(c=>{const f=this.createVideoItem(c);l.appendChild(f)}):this.createSampleVideos().slice(0,this.getMaxVideosForScreen()).forEach(f=>{const p=this.createVideoItem(f);l.appendChild(p)}),o.appendChild(l),o}createVideoItem(e){const i=F.dom.createEl("div",{className:"vjs-related-video-item"}),r=e.thumbnail||this.getPlaceholderImage(e.title),o=F.dom.createEl("img",{className:"vjs-related-video-thumbnail",src:r,alt:e.title,loading:"lazy",onerror:()=>{o.src=this.getPlaceholderImage(e.title)}}),l=F.dom.createEl("div",{className:"vjs-related-video-overlay"}),c=F.dom.createEl("div",{className:"vjs-related-video-title"});c.textContent=e.title;const f=F.dom.createEl("div",{className:"vjs-related-video-meta"}),p=F.dom.createEl("div",{className:"vjs-related-video-author"});p.textContent=e.author;const v=F.dom.createEl("div",{className:"vjs-related-video-views"});v.textContent=e.views,f.appendChild(p),f.appendChild(v);const S=F.dom.createEl("div",{className:"vjs-related-video-duration"}),x=D=>{if(!D||D===0)return"";const k=Math.floor(D/60),I=Math.floor(D%60);return`${k}:${I.toString().padStart(2,"0")}`};return S.textContent=x(e.duration),l.appendChild(c),l.appendChild(f),i.appendChild(o),i.appendChild(l),e.duration&&e.duration>0&&i.appendChild(S),i.addEventListener("click",()=>{(this.player().id()||this.player().options_.id)==="video-embed"||window.location.pathname.includes("/embed")||window.location.search.includes("embed")||window.parent!==window?window.open(`/view?m=${e.id}`,"_blank","noopener,noreferrer"):window.location.href=`/view?m=${e.id}`}),i}getPlaceholderImage(e){const i=["#009931","#4ECDC4","#45B7D1","#96CEB4","#FFEAA7","#DDA0DD","#98D8C8","#F7DC6F","#BB8FCE","#85C1E9"];let r=0;for(let v=0;v=1200?12:e>=1024?9:e>=768?6:4}createSampleVideos(){return[{id:"sample1",title:"React Full Course for Beginners",author:"Bro Code",views:"2.1M views",duration:1800,thumbnail:"https://img.youtube.com/vi/dGcsHMXbSOA/maxresdefault.jpg"},{id:"sample2",title:"JavaScript ES6+ Features",author:"Tech Tutorials",views:"850K views",duration:1200,thumbnail:"https://img.youtube.com/vi/WZQc7RUAg18/maxresdefault.jpg"},{id:"sample3",title:"CSS Grid Layout Masterclass",author:"Web Dev Academy",views:"1.2M views",duration:2400,thumbnail:"https://img.youtube.com/vi/0xMQfnTU6oo/maxresdefault.jpg"},{id:"sample4",title:"Node.js Backend Development",author:"Code Master",views:"650K views",duration:3600,thumbnail:"https://img.youtube.com/vi/fBNz6F-Cowg/maxresdefault.jpg"},{id:"sample5",title:"Vue.js Complete Guide",author:"Frontend Pro",views:"980K views",duration:2800,thumbnail:"https://img.youtube.com/vi/qZXt1Aom3Cs/maxresdefault.jpg"},{id:"sample6",title:"Python Data Science",author:"Data Academy",views:"1.5M views",duration:4200,thumbnail:"https://img.youtube.com/vi/ua-CiDNNj30/maxresdefault.jpg"},{id:"sample7",title:"TypeScript Fundamentals",author:"TypeScript Expert",views:"720K views",duration:2100,thumbnail:"https://img.youtube.com/vi/BwuLxPH8IDs/maxresdefault.jpg"},{id:"sample8",title:"MongoDB Database Tutorial",author:"Database Pro",views:"890K views",duration:1800,thumbnail:"https://img.youtube.com/vi/-56x56UppqQ/maxresdefault.jpg"},{id:"sample9",title:"Docker Containerization",author:"DevOps Master",views:"1.1M views",duration:3200,thumbnail:"https://img.youtube.com/vi/pTFZFxd4hOI/maxresdefault.jpg"},{id:"sample10",title:"AWS Cloud Services",author:"Cloud Expert",views:"1.3M views",duration:4500,thumbnail:"https://img.youtube.com/vi/ITcXLS3h2qU/maxresdefault.jpg"},{id:"sample11",title:"GraphQL API Design",author:"API Specialist",views:"680K views",duration:2600,thumbnail:"https://img.youtube.com/vi/ed8SzALpx1Q/maxresdefault.jpg"},{id:"sample12",title:"Machine Learning Basics",author:"AI Academy",views:"2.3M views",duration:5400,thumbnail:"https://img.youtube.com/vi/i_LwzRVP7bg/maxresdefault.jpg"}]}show(){this.el().style.display="flex"}hide(){this.el().style.display="none"}}F.registerComponent("EndScreenOverlay",jx);const u8="",FI=F.getComponent("Component");class zx extends FI{constructor(e,i){super(e,i),this.nextVideoData=i.nextVideoData||null,this.countdownSeconds=i.countdownSeconds||5,this.onPlayNext=i.onPlayNext||(()=>{}),this.onCancel=i.onCancel||(()=>{}),this.currentCountdown=this.countdownSeconds,this.startTime=null,this.isActive=!1,this.startCountdown=this.startCountdown.bind(this),this.stopCountdown=this.stopCountdown.bind(this),this.handlePlayNext=this.handlePlayNext.bind(this),this.handleCancel=this.handleCancel.bind(this),this.updateCountdownDisplay=this.updateCountdownDisplay.bind(this)}createEl(){var c,f;const e=super.createEl("div",{className:"vjs-autoplay-countdown-overlay"}),i=((c=this.nextVideoData)==null?void 0:c.title)||"Next Video";e.innerHTML=`