!function(){var e={4355:function(e){var t=.1,n="function"===typeof Float32Array;function r(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function a(e){return 3*e}function o(e,t,n){return((r(t,n)*e+i(t,n))*e+a(t))*e}function s(e,t,n){return 3*r(t,n)*e*e+2*i(t,n)*e+a(t)}function l(e){return e}e.exports=function(e,r,i,a){if(!(0<=e&&e<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===r&&i===a)return l;for(var u=n?new Float32Array(11):new Array(11),c=0;c<11;++c)u[c]=o(c*t,e,i);function d(n){for(var r=0,a=1;10!==a&&u[a]<=n;++a)r+=t;--a;var l=r+(n-u[a])/(u[a+1]-u[a])*t,c=s(l,e,i);return c>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var a=s(t,n,r);if(0===a)return t;t-=(o(t,n,r)-e)/a}return t}(n,l,e,i):0===c?l:function(e,t,n,r,i){var a,s,l=0;do{(a=o(s=t+(n-t)/2,r,i)-e)>0?n=s:t=s}while(Math.abs(a)>1e-7&&++l<10);return s}(n,r,r+t,e,i)}return function(e){return 0===e?0:1===e?1:o(d(e),r,a)}}},1040:function(e){self,e.exports=function(){var e={2595:function(e,t){var n;n={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(e,t){var r="string"==typeof e.initial?{state:e.initial}:e.initial,i=e.terminal||e.final,a=t||e.target||{},o=e.events||[],s=e.callbacks||{},l={},u={},c=function(e){var t=Array.isArray(e.from)?e.from:e.from?[e.from]:[n.WILDCARD];l[e.name]=l[e.name]||{};for(var r=0;r=0:this.current===e},a.can=function(e){return!this.transition&&void 0!==l[e]&&(l[e].hasOwnProperty(this.current)||l[e].hasOwnProperty(n.WILDCARD))},a.cannot=function(e){return!this.can(e)},a.transitions=function(){return(u[this.current]||[]).concat(u[n.WILDCARD]||[])},a.isFinished=function(){return this.is(i)},a.error=e.error||function(e,t,n,r,i,a,o){throw o||a},a.states=function(){return Object.keys(u).sort()},r&&!r.defer&&a[r.event](),a},doCallback:function(e,t,r,i,a,o){if(t)try{return t.apply(e,[r,i,a].concat(o))}catch(t){return e.error(r,i,a,o,n.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",t)}},beforeAnyEvent:function(e,t,r,i,a){return n.doCallback(e,e.onbeforeevent,t,r,i,a)},afterAnyEvent:function(e,t,r,i,a){return n.doCallback(e,e.onafterevent||e.onevent,t,r,i,a)},leaveAnyState:function(e,t,r,i,a){return n.doCallback(e,e.onleavestate,t,r,i,a)},enterAnyState:function(e,t,r,i,a){return n.doCallback(e,e.onenterstate||e.onstate,t,r,i,a)},changeState:function(e,t,r,i,a){return n.doCallback(e,e.onchangestate,t,r,i,a)},beforeThisEvent:function(e,t,r,i,a){return n.doCallback(e,e["onbefore"+t],t,r,i,a)},afterThisEvent:function(e,t,r,i,a){return n.doCallback(e,e["onafter"+t]||e["on"+t],t,r,i,a)},leaveThisState:function(e,t,r,i,a){return n.doCallback(e,e["onleave"+r],t,r,i,a)},enterThisState:function(e,t,r,i,a){return n.doCallback(e,e["onenter"+i]||e["on"+i],t,r,i,a)},beforeEvent:function(e,t,r,i,a){if(!1===n.beforeThisEvent(e,t,r,i,a)||!1===n.beforeAnyEvent(e,t,r,i,a))return!1},afterEvent:function(e,t,r,i,a){n.afterThisEvent(e,t,r,i,a),n.afterAnyEvent(e,t,r,i,a)},leaveState:function(e,t,r,i,a){var o=n.leaveThisState(e,t,r,i,a),s=n.leaveAnyState(e,t,r,i,a);return!1!==o&&!1!==s&&(n.ASYNC===o||n.ASYNC===s?n.ASYNC:void 0)},enterState:function(e,t,r,i,a){n.enterThisState(e,t,r,i,a),n.enterAnyState(e,t,r,i,a)},buildEvent:function(e,t){return function(){var r=this.current,i=t[r]||(t[n.WILDCARD]!=n.WILDCARD?t[n.WILDCARD]:r)||r,a=Array.prototype.slice.call(arguments);if(this.transition)return this.error(e,r,i,a,n.Error.PENDING_TRANSITION,"event "+e+" inappropriate because previous transition did not complete");if(this.cannot(e))return this.error(e,r,i,a,n.Error.INVALID_TRANSITION,"event "+e+" inappropriate in current state "+this.current);if(!1===n.beforeEvent(this,e,r,i,a))return n.Result.CANCELLED;if(r===i)return n.afterEvent(this,e,r,i,a),n.Result.NOTRANSITION;var o=this;this.transition=function(){return o.transition=null,o.current=i,n.enterState(o,e,r,i,a),n.changeState(o,e,r,i,a),n.afterEvent(o,e,r,i,a),n.Result.SUCCEEDED},this.transition.cancel=function(){o.transition=null,n.afterEvent(o,e,r,i,a)};var s=n.leaveState(this,e,r,i,a);return!1===s?(this.transition=null,n.Result.CANCELLED):n.ASYNC===s?n.Result.PENDING:this.transition?this.transition():void 0}}},e.exports&&(t=e.exports=n),t.StateMachine=n},6856:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="v2.34.0"},9102:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Adapter=void 0;var r=n(1916),i=function(){function e(){}return e.prototype.getCurrentImpressionId=function(){if(this.guardAgainstNotInitializedAnalytics())return this.analytics.getCurrentImpressionId()},e.prototype.getUserId=function(){if(this.guardAgainstNotInitializedAnalytics())return this.analytics.getUserId()},e.prototype.setCustomData=function(e){this.guardAgainstNotInitializedAnalytics()&&this.internalAdapter.setCustomData(e)},e.prototype.setCustomDataOnce=function(e){this.guardAgainstNotInitializedAnalytics()&&this.analytics.setCustomDataOnce(e)},e.prototype.sourceChange=function(e){this.guardAgainstNotInitializedAnalytics()&&this.analytics.sourceChange(e)},e.prototype.hasPlayerAlreadyBeenAugmented=function(e){return e.__bitmovinAnalyticsHasBeenSetup},e.prototype.markPlayerInstanceAsAugmented=function(e){e.__bitmovinAnalyticsHasBeenSetup=!0},e.prototype.guardAgainstNotInitializedAnalytics=function(){return!!this.analytics||(r.logger.log("Bitmovin Analytics: Adapter hasn't been initialized yet"),!1)},e}();t.Adapter=i},3703:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSAdapter=void 0;var a=n(4350),o=n(1916),s=n(9102),l=n(9876),u=n(2857),c=function(e){function t(t,n,r){var i=e.call(this)||this;if(i.hasPlayerAlreadyBeenAugmented(n))return o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance"),i;var s=new u.SourceUrlProvider;return i.markPlayerInstanceAsAugmented(n),i.internalAdapter=new l.AmazonIVSInternalAdapter(n,s,r),i.analytics=new a.Analytics(t,i.internalAdapter),i.wrapPlayerLoad(n,s),i}return i(t,e),t.prototype.wrapPlayerLoad=function(e,t){var n=e.load;e.load=function(){for(var r=[],i=0;i0){var a=r[0].analytics;t.sourceChange(a)}return n.apply(e,r)}},t}(s.Adapter);t.Bitmovin8Adapter=u},6596:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nA.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD},t.create=function(e,n){var r=new R.SpeedMeterAdapter(e,new l.DownloadSpeedMeter).getDownloadSpeedMeter(),i=new C.SegmentTrackerAdapter(e,new u.SegmentTracker).getSegmentTracker(),a=new I.HttpRequestTrackingAdapter(e);return new t(e,r,i,new d.default,a,new c.SourceInfoFallbackService,n)},t}(T.InternalAdapter);t.Bitmovin8InternalAdapter=k},7543:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestTrackingAdapter=void 0;var r=n(675),i=n(7912),a=n(5063),o=function(){function e(e){var t=this;this.eventDispatcher=new r.EventDispatcher,this.playerExports=e.exports,e.on(this.playerExports.PlayerEvent.DownloadFinished,(function(e){return t.onDownloadFinished(e)}))}return e.prototype.subscribe=function(e){return this.eventDispatcher.subscribe(e)},e.prototype.unsubscribe=function(e){this.eventDispatcher.unsubscribe(e)},e.prototype.onDownloadFinished=function(e){var t,n,r;this.eventDispatcher.dispatch({httpRequest:{downloadTime:null!==(t=(0,a.calculateTimeWithUndefined)(null==e?void 0:e.downloadTime))&&void 0!==t?t:0,httpStatus:null!==(n=null==e?void 0:e.httpStatus)&&void 0!==n?n:0,success:null!==(r=null==e?void 0:e.success)&&void 0!==r&&r,timestamp:(0,a.getCurrentTimestamp)(),url:null==e?void 0:e.url,size:null==e?void 0:e.size,timeToFirstByte:(0,a.calculateTimeWithUndefined)(null==e?void 0:e.timeToFirstByte),type:this.mapHttpRequestType(null==e?void 0:e.downloadType)}})},e.prototype.mapHttpRequestType=function(e){switch(e){case this.playerExports.HttpRequestType.MANIFEST_DASH:return i.HttpRequestType.MANIFEST_DASH;case this.playerExports.HttpRequestType.MANIFEST_HLS_MASTER:return i.HttpRequestType.MANIFEST_HLS_MASTER;case this.playerExports.HttpRequestType.MANIFEST_HLS_VARIANT:return i.HttpRequestType.MANIFEST_HLS_VARIANT;case this.playerExports.HttpRequestType.MANIFEST_SMOOTH:return i.HttpRequestType.MANIFEST_SMOOTH;case this.playerExports.HttpRequestType.MANIFEST_ADS:return i.HttpRequestType.MANIFEST_ADS;case this.playerExports.HttpRequestType.MEDIA_AUDIO:return i.HttpRequestType.MEDIA_AUDIO;case this.playerExports.HttpRequestType.MEDIA_VIDEO:return i.HttpRequestType.MEDIA_VIDEO;case this.playerExports.HttpRequestType.MEDIA_SUBTITLES:return i.HttpRequestType.MEDIA_SUBTITLES;case this.playerExports.HttpRequestType.MEDIA_THUMBNAILS:return i.HttpRequestType.MEDIA_THUMBNAILS;case this.playerExports.HttpRequestType.DRM_LICENSE_WIDEVINE:return i.HttpRequestType.DRM_LICENSE_WIDEVINE;case this.playerExports.HttpRequestType.DRM_LICENSE_PLAYREADY:return i.HttpRequestType.DRM_LICENSE_PLAYREADY;case this.playerExports.HttpRequestType.DRM_LICENSE_FAIRPLAY:return i.HttpRequestType.DRM_LICENSE_FAIRPLAY;case this.playerExports.HttpRequestType.DRM_LICENSE_PRIMETIME:return i.HttpRequestType.DRM_LICENSE_PRIMETIME;case this.playerExports.HttpRequestType.DRM_LICENSE_CLEARKEY:return i.HttpRequestType.DRM_LICENSE_CLEARKEY;case this.playerExports.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY:return i.HttpRequestType.DRM_CERTIFICATE_FAIRPLAY;case this.playerExports.HttpRequestType.KEY_HLS_AES:return i.HttpRequestType.KEY_HLS_AES;case this.playerExports.HttpRequestType.TIME_SYNC:return i.HttpRequestType.TIME_SYNC;default:return i.HttpRequestType.UNKNOWN}},e}();t.HttpRequestTrackingAdapter=o},8676:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTrackerAdapter=void 0;var r=n(5063),i=function(){function e(e,t){var n=this;this.handleSegmentPlaybackEvent=function(e){n.segmentTracker.removeSegment(e.url)},this.segmentTracker=t,e.on(e.exports.PlayerEvent.DownloadFinished,(function(e){return n.handleOnDownloadFinishEvent(e)})),e.on(e.exports.PlayerEvent.SegmentPlayback,(function(e){return n.handleSegmentPlaybackEvent(e)}))}return e.prototype.getSegmentTracker=function(){return this.segmentTracker},e.prototype.handleOnDownloadFinishEvent=function(e){if(0===e.downloadType.indexOf("media/video")){var t=e.url,n={name:r.getURLResourceName(t),url:t,timestamp:e.timestamp};this.segmentTracker.addSegment(n)}},e}();t.SegmentTrackerAdapter=i},665:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeedMeterAdapter=void 0;var n=function(){function e(e,t){var n=this;this.meter=t,e.on(e.exports.PlayerEvent.DownloadFinished,(function(e){return n.handleOnDownloadFinishEvent(e)}))}return e.prototype.getDownloadSpeedMeter=function(){return this.meter},e.prototype.handleOnDownloadFinishEvent=function(e){e.success&&0===e.downloadType.indexOf("media/video")&&this.meter.addMeasurement({duration:e.downloadTime,size:e.size,timeToFirstByte:e.timeToFirstByte,timestamp:new Date,httpStatus:e.httpStatus})},e}();t.SpeedMeterAdapter=n},5127:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3Adapter=void 0;var a=n(4350),o=n(1916),s=n(9102),l=n(3236),u=function(e){function t(t,n,r){var i=e.call(this)||this;return i.hasPlayerAlreadyBeenAugmented(n)?(o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance"),i):(i.markPlayerInstanceAsAugmented(n),i.internalAdapter=new l.CAFv3InternalAdapter(n,r),i.analytics=new a.Analytics(t,i.internalAdapter),i)}return i(t,e),t}(s.Adapter);t.CAFv3Adapter=u},3236:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CAFv3InternalAdapter=void 0;var a=n(3674),o=n(2361),s=n(556),l=n(7614),u=n(9557),c=n(3413),d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.context=t,r.getPlayerName=function(){return s.Player.CHROMECAST_SHAKA},r.getPlayerTech=function(){return"html5"},r.getAutoPlay=function(){return!(!r.currentItem||!r.currentItem.autoplay)&&r.currentItem.autoplay},r.getDrmPerformanceInfo=function(){return r.drmPerformanceInfo},r.stateMachine=new a.HTML5AnalyticsStateMachine(r.stateMachineCallbacks,r.opts),r.playerManager=t.getPlayerManager(),r.isSeeking=!1,r}return i(t,e),t.prototype.initialize=function(e){return this.register(),[new u.ErrorDetailTracking(e.errorDetailTrackingSettingsProvider,new l.ErrorDetailBackend(e.errorDetailTrackingSettingsProvider.collectorConfig),[e.errorDetailSubscribable],void 0)]},t.prototype.getPlayerVersion=function(){return window.cast&&window.cast.framework?window.cast.framework.VERSION:"unknown"},t.prototype.sourceChange=function(e){this.stateMachine.callManualSourceChangeEvent(e,this.playerManager.getCurrentTimeSec())},t.prototype.getCurrentPlaybackInfo=function(){var e=this.playerManager.getStats();return{isLive:this.getIsLive(),playerTech:this.getPlayerTech(),videoDuration:(0,c.normalizeVideoDuration)(this.mediaInformation?this.mediaInformation.duration:0),videoPlaybackHeight:e.height,videoPlaybackWidth:e.width,audioCodec:this.activeAudioTrack?this.activeAudioTrack.trackContentType:void 0,audioLanguage:this.activeAudioTrack?this.activeAudioTrack.language:void 0,subtitleLanguage:this.activeTextTracks?this.activeTextTracks.map((function(e){return e.language})).join(","):void 0,droppedFrames:0}},t.prototype.register=function(){var e=this;this.playerManager.addEventListener("PLAYER_LOADING",(function(t){e.eventCallback(o.Event.SETUP,{})})),this.playerManager.addEventListener("PLAYER_LOAD_COMPLETE",(function(t){var n=e.playerManager.getAudioTracksManager();e.activeAudioTrack=n.getActiveTrack();var r=e.playerManager.getTextTracksManager();e.activeTextTracks=r.getActiveTracks();var i=e.playerManager.getQueueManager();e.currentItem=i.getCurrentItem(),e.mediaInformation=t.media,e.eventCallback(o.Event.READY,{})})),this.playerManager.addEventListener("PLAY",(function(t){e.eventCallback(o.Event.PLAY,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener("PAUSE",(function(t){e.onPaused(e.playerManager.getCurrentTimeSec())})),this.playerManager.addEventListener("ERROR",(function(t){var n=null!=t.error?t.error:void 0;e.eventCallback(o.Event.ERROR,{currentTime:e.playerManager.getCurrentTimeSec(),code:t.detailedErrorCode,message:t.reason,legacyData:n,data:{additionalData:JSON.stringify(n)}})})),this.playerManager.addEventListener("SEEKING",(function(t){e.isSeeking=!0,e.onPaused(t.currentMediaTime),e.eventCallback(o.Event.SEEK,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener("SEEKED",(function(t){e.isSeeking=!1,e.eventCallback(o.Event.SEEKED,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener("STALLED",(function(e){})),this.playerManager.addEventListener("BUFFERING",(function(t){!e.isSeeking&&t.isBuffering&&e.eventCallback(o.Event.START_BUFFERING,{currentTime:e.currentTime})})),this.playerManager.addEventListener("TIME_UPDATE",(function(t){e.isSeeking||e.eventCallback(o.Event.TIMECHANGED,{currentTime:t.currentMediaTime})})),this.playerManager.addEventListener("REQUEST_LOAD",(function(t){e.currentItem&&e.eventCallback(o.Event.PLAYLIST_TRANSITION,{currentTime:e.playerManager.getCurrentTimeSec()})}))},t.prototype.onPaused=function(e){this.eventCallback(o.Event.PAUSE,{currentTime:e})},Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.playerManager.getCurrentTimeSec()},enumerable:!1,configurable:!0}),t.prototype.getIsLive=function(){return!(!this.mediaInformation||"LIVE"!==this.mediaInformation.streamType)||!!this.playerManager.getLiveSeekableRange()||void 0},t}(n(2647).InternalAdapter);t.CAFv3InternalAdapter=d},9999:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.DashjsAdapter=void 0;var a=n(4350),o=n(1916),s=n(9102),l=n(236),u=function(e){function t(t,n,r){var i=e.call(this)||this;return i.hasPlayerAlreadyBeenAugmented(n)?(o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance"),i):(i.markPlayerInstanceAsAugmented(n),i.internalAdapter=new l.DashjsInternalAdapter(n,r),i.analytics=new a.Analytics(t,i.internalAdapter),i)}return i(t,e),t}(s.Adapter);t.DashjsAdapter=u},236:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.DashjsInternalAdapter=void 0;var a=n(2361),o=n(2168),s=n(556),l=n(7614),u=n(9557),c=n(1916),d=function(e){function t(t,n){var r=e.call(this,void 0,n)||this;return r.mediaPlayer=t,r.getPlayerName=function(){return s.Player.DASHJS},r.getPlayerVersion=function(){return r.mediaPlayer.getVersion()},r}return i(t,e),t.prototype.initialize=function(t){var n=this;e.prototype.initialize.call(this,t);var r=null;try{r=this.mediaPlayer.getVideoElement()}catch(e){}return r?(this.setMediaElement(r),this.registerMediaElementEventsForDashJS()):this.mediaPlayer.on("manifestLoaded",(function(){try{r=n.mediaPlayer.getVideoElement(),n.setMediaElement(r),n.registerMediaElementEventsForDashJS()}catch(e){c.logger.errorMessageToUser("Something went wrong while getting underlying HTMLVideoElement. Not possible to attach adapter and initialize Bitmovin Analytics. Error: ",e),n.release()}}),this),[new u.ErrorDetailTracking(t.errorDetailTrackingSettingsProvider,new l.ErrorDetailBackend(t.errorDetailTrackingSettingsProvider.collectorConfig),[t.errorDetailSubscribable],void 0)]},t.prototype.registerMediaElementEventsForDashJS=function(){var e=this,t=this.mediaElement;t&&this.listenToMediaElementEvent("playing",(function(){var n=t.currentTime;e.needsFirstPlayIntent=!1,e.eventCallback(a.Event.TIMECHANGED,{currentTime:n})}))},t.prototype.getMIMEType=function(){return o.MIMETypes.DASH},t.prototype.getStreamURL=function(){if(this.mediaPlayer){var e=this.mediaPlayer.getSource();return e?e.toString():void 0}},t.prototype.getCurrentQualityLevelInfo=function(){if(!this.mediaPlayer)return null;try{var e=this.mediaPlayer.getBitrateInfoListFor("video")[this.mediaPlayer.getQualityFor("video")];return null==e?null:{width:e.width,height:e.height,bitrate:e.bitrate}}catch(e){c.logger.warning("Quality information not available")}return null},t}(n(7124).HTML5InternalAdapter);t.DashjsInternalAdapter=d},9566:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.HlsAdapter=void 0;var a=n(4350),o=n(1916),s=n(9102),l=n(1601),u=function(e){function t(t,n,r){var i=e.call(this)||this;return i.hasPlayerAlreadyBeenAugmented(n)?(o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance"),i):(i.markPlayerInstanceAsAugmented(n),i.internalAdapter=new l.HlsInternalAdapter(n,r),i.analytics=new a.Analytics(t,i.internalAdapter),i)}return i(t,e),t}(s.Adapter);t.HlsAdapter=u},1601:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&!0===this.hls.subtitleDisplay;return{enabled:e,language:e?this.hls.subtitleTracks[this.hls.subtitleTrack].lang:void 0}}var t=this.hls.subtitleTrackController;if(null!=t&&null!=t.media)return this.getSelectedSubtitleFromMediaElement(t.media)},t}(f.HTML5InternalAdapter);t.HlsInternalAdapter=m},4778:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HlsSpeedMeterAdapter=void 0;var n=function(){function e(e,t){var n=this;this.meter=t,e.on(e.constructor.Events.FRAG_LOADED,(function(e,t){return n.handleFragmentLoadedEvent(t)}))}return e.prototype.getDownloadSpeedMeter=function(){return this.meter},e.prototype.handleFragmentLoadedEvent=function(e){if("main"===e.frag.type){var t=null!=e.networkDetails?e.networkDetails.status:void 0;if(null!=t){var n=e.frag.stats,r=(n.loading.end-n.loading.start)/1e3,i=(n.loading.first-n.loading.start)/1e3,a={duration:r,size:n.total,timeToFirstByte:i,timestamp:new Date,httpStatus:t};this.meter.addMeasurement(a)}}},e}();t.HlsSpeedMeterAdapter=n},7124:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0;return{enabled:i,language:i?r.language:void 0}}}return{enabled:!1}}},t.prototype.initializeStateMachine=function(){this.stateMachine=new o.HTML5AnalyticsStateMachine(this.stateMachineCallbacks,this.opts),this.stateMachine.callEvent(l.Event.SETUP,{},0)},t.prototype.wrapMediaElementLoad=function(e){var t=this,n=e.load;e.load=function(){for(var r=[],i=0;in*(this.mediaElement.playbackRate+.5)&&(this.isSeeking=!0,this.onPaused(this.previousMediaTimeInSeconds+n)),this.previousClientTime=Date.now()}},t.BUFFERING_TIMECHANGED_TIMEOUT=1e3,t}(v.InternalAdapter);t.HTML5InternalAdapter=y;var _=function(e){var t=(new Date).toISOString().substring(11),n="".concat(t,"[HTML5InternalAdapter]"),r="".concat(n,": ").concat(e);p.logger.log(r)}},701:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementAdapter=void 0;var a=n(4350),o=n(1916),s=n(9102),l=n(7238),u=function(e){function t(t,n,r,i){var s=e.call(this)||this;return s.hasPlayerAlreadyBeenAugmented(n)?(o.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance"),s):(s.markPlayerInstanceAsAugmented(n),s.internalAdapter=new l.HTMLVideoElementInternalAdapter(n,r,i),s.analytics=new a.Analytics(t,s.internalAdapter),s)}return i(t,e),Object.defineProperty(t.prototype,"sessionMetadata",{get:function(){var e=this.internalAdapter;return{setAudioLanguage:function(t){e.sessionData.audioLanguage=t},setSubtitleEnabled:function(t){e.sessionData.subtitleEnabled=t},setSubtitleLanguage:function(t){e.sessionData.subtitleLanguage=t}}},enumerable:!1,configurable:!0}),t.prototype.sourceChange=function(t,n){if(this.guardAgainstNotInitializedAnalytics()){e.prototype.sourceChange.call(this,t);var r=this.internalAdapter;r.sessionData.streamFormat=null==n?void 0:n.streamFormat,r.sessionData.audioCodec=null==n?void 0:n.audioCodec,r.sessionData.videoCodec=null==n?void 0:n.videoCodec,r.sessionData.audioLanguage=null==n?void 0:n.audioLanguage}},t}(s.Adapter);t.HTMLVideoElementAdapter=u},7238:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLVideoElementInternalAdapter=void 0;var a=n(556),o=n(5063),s=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.sessionData={},i.getPlayerName=function(){return a.Player.HTML5},i.getPlayerVersion=function(){var e=(0,o.getBrowserInfo)();return"".concat(e.name," ").concat(e.version)},i.sessionData.streamFormat=null==r?void 0:r.streamFormat,i.sessionData.audioCodec=null==r?void 0:r.audioCodec,i.sessionData.videoCodec=null==r?void 0:r.videoCodec,i.sessionData.audioLanguage=null==r?void 0:r.audioLanguage,i}return i(t,e),t.prototype.getStreamURL=function(){return this.mediaElement?this.mediaElement.currentSrc:void 0},t.prototype.getCurrentQualityLevelInfo=function(){return{bitrate:void 0,width:this.mediaElement?this.mediaElement.videoWidth:void 0,height:this.mediaElement?this.mediaElement.videoHeight:void 0}},t.prototype.getCurrentPlaybackInfo=function(){var t,n,r,i,a,o,s=e.prototype.getCurrentPlaybackInfo.call(this);s.streamFormat=null!==(t=this.sessionData.streamFormat)&&void 0!==t?t:s.streamFormat,s.audioCodec=null!==(n=this.sessionData.audioCodec)&&void 0!==n?n:s.audioCodec,s.videoCodec=null!==(r=this.sessionData.videoCodec)&&void 0!==r?r:s.videoCodec,s.subtitleEnabled=null!==(i=this.sessionData.subtitleEnabled)&&void 0!==i?i:s.subtitleEnabled;var l=null!==(a=this.sessionData.subtitleLanguage)&&void 0!==a?a:s.subtitleLanguage;return s.subtitleLanguage=!0===s.subtitleEnabled?l:void 0,s.audioLanguage=null!==(o=this.sessionData.audioLanguage)&&void 0!==o?o:s.audioLanguage,s},t.prototype.resetSourceRelatedState=function(){e.prototype.resetSourceRelatedState.call(this),this.sessionData={}},t}(n(7124).HTML5InternalAdapter);t.HTMLVideoElementInternalAdapter=s},8510:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.videoElement=e,this.previousTotalDroppedFrames=0}return e.prototype.getDroppedFrames=function(){if(null==this.videoElement)return 0;if(void 0===this.videoElement.getVideoPlaybackQuality)return 0;var e=this.videoElement.getVideoPlaybackQuality().droppedVideoFrames,t=e-this.previousTotalDroppedFrames;return this.previousTotalDroppedFrames=e,t},e.prototype.reset=function(){this.previousTotalDroppedFrames=0},e}();t.default=n},2647:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&(e=window.devicePixelRatio),{screenHeight:window.screen.height*e,screenWidth:window.screen.width*e}},e.prototype.clearValues=function(){},e.prototype.clearSegments=function(){},e.prototype.resetSourceRelatedState=function(){this.sourceInfoFallbackService.reset(),this.drmPerformanceInfo=void 0},e.prototype.setCustomData=function(e){var t=this.stateMachine.currentState;!this.stateMachine.currentState||"PAUSE"!==this.stateMachine.currentState&&"PLAYING"!==this.stateMachine.currentState?this.stateMachineCallbacks.customdatachange(void 0,void 0,{values:e}):(this.eventCallback(s.Event.CUSTOM_DATA_CHANGE,{currentTime:this.currentTime}),this.eventCallback(s.Event[t],{values:e,currentTime:this.currentTime}))},e.prototype.isAudioMuted=function(e,t){return e||t<.01},e}();t.InternalAdapter=h},5517:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdCallbacks=void 0;var n=function(){this.onAdStarted=function(e){},this.onAdFinished=function(e){},this.onAdBreakStarted=function(e){},this.onAdBreakFinished=function(e){},this.onAdClicked=function(e){},this.onAdError=function(e){},this.onAdManifestLoaded=function(e){},this.onAdQuartile=function(e){},this.onAdSkipped=function(e){},this.onPlay=function(e){},this.onPause=function(e){},this.onBeforeUnload=function(){}};t.AdCallbacks=n},2063:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ShakaAdapter=void 0;var a=n(4350),o=n(2361),s=n(1916),l=n(9102),u=n(2092),c=function(e){function t(t,n,r){var i=e.call(this)||this;return i.hasPlayerAlreadyBeenAugmented(n)?(s.logger.errorMessageToUser("Bitmovin Analytics is already hooked up to this player instance"),i):(i.markPlayerInstanceAsAugmented(n),i.internalAdapter=new u.ShakaInternalAdapter(n,r),i.analytics=new a.Analytics(t,i.internalAdapter),i.wrapPlayerLoad(n),i)}return i(t,e),t.prototype.wrapPlayerLoad=function(e){var t=this,n=e.load;e.load=function(){for(var r=[],i=0;i0||(this.rebufferingTimeoutHandle=window.setTimeout((function(){e.callEvent(a.Event.ERROR,r(r({},i.ErrorCode.BUFFERING_TIMEOUT_REACHED),{data:{additionalData:"StateMachine timed out after ".concat(e.rebufferTimeoutMs," ms of consecutive buffering.")}}),l.getCurrentTimestamp()),e.stateMachineCallbacks.release()}),this.rebufferTimeoutMs))},e.prototype.clearRebufferingTimeoutHandle=function(e){e&&null!=this.rebufferingTimeoutHandle&&(window.clearTimeout(this.rebufferingTimeoutHandle),this.rebufferingTimeoutHandle=void 0)},e.prototype.getVideoStartupFailedEventData=function(e,t,n){return{currentTime:e,reason:this.getReasonForVideoStartFailure(t)}},e.prototype.getReasonForVideoStartFailure=function(e){switch(e){case a.Event.ERROR:return o.VideoStartFailedReason.PLAYER_ERROR;case a.Event.UNLOAD:return o.VideoStartFailedReason.PAGE_CLOSED;case a.Event.VIDEOSTART_TIMEOUT:return o.VideoStartFailedReason.TIMEOUT;default:return o.VideoStartFailedReason.UNKNOWN}},e.prototype.setVideoStartTimeout=function(){var e=this;null!=this.videoStartTimeout&&this.clearVideoStartTimeout(),this.videoStartTimeout=window.setTimeout((function(){e.callEvent(a.Event.VIDEOSTART_TIMEOUT,{},l.getCurrentTimestamp()),e.stateMachineCallbacks.release()}),this.videoStartupTimeoutMs)},e.prototype.clearVideoStartTimeout=function(){window.clearTimeout(this.videoStartTimeout),this.videoStartTimeout=void 0},e}();t.AnalyticsStateMachine=c},2938:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Bitmovin8AnalyticsStateMachine=void 0;var a,o=n(2595),s=n(2361),l=n(1652),u=n(1916),c=n(5063),d=n(7596),h=n(8253);!function(e){e.SETUP="SETUP",e.STARTUP="STARTUP",e.READY="READY",e.PLAYING="PLAYING",e.REBUFFERING="REBUFFERING",e.PAUSE="PAUSE",e.QUALITYCHANGE="QUALITYCHANGE",e.PLAY_SEEKING="PLAY_SEEKING",e.END_PLAY_SEEKING="END_PLAY_SEEKING",e.QUALITYCHANGE_PAUSE="QUALITYCHANGE_PAUSE",e.QUALITYCHANGE_REBUFFERING="QUALITYCHANGE_REBUFFERING",e.END="END",e.ERROR="ERROR",e.AD_STARTUP="AD_STARTUP",e.AD_READY="AD_READY",e.AD_PAUSE="AD_PAUSE",e.AD_PLAYING="AD_PLAYING",e.MUTING_READY="MUTING_READY",e.MUTING_PLAY="MUTING_PLAY",e.MUTING_PAUSE="MUTING_PAUSE",e.CASTING="CASTING",e.SOURCE_CHANGING="SOURCE_CHANGING",e.INITIAL_SOURCE_CHANGE="INITIAL_SOURCE_CHANGE",e.SUBTITLE_CHANGING="SUBTITLE_CHANGING",e.AUDIOTRACK_CHANGING="AUDIOTRACK_CHANGING",e.EXIT_BEFORE_VIDEOSTART="EXIT_BEFORE_VIDEOSTART",e.CUSTOMDATACHANGE="CUSTOMDATACHANGE"}(a||(a={}));var f=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.debuggingStates=[],r.enabledDebugging=!1,r.seekTimestamp=0,r.seekedTimestamp=0,r.seekStarted=!1,r.seekEnded=!1,r}return i(t,e),t.prototype.getAllStatesBut=function(e){return this.getAllStates().filter((function(t){return e.indexOf(t)<0}))},t.prototype.getAllStates=function(){return Object.keys(a).map((function(e){return a[e]}))},t.prototype.createStateMachine=function(e){var t,n=this;return o.create({initial:a.SETUP,error:h.customStateMachineErrorCallback,events:[{name:s.Event.SOURCE_LOADED,from:[a.SETUP,a.ERROR,a.SOURCE_CHANGING,a.INITIAL_SOURCE_CHANGE],to:a.READY},{name:s.Event.PLAY,from:a.READY,to:a.STARTUP},{name:s.Event.PLAYING,from:a.READY,to:a.PLAYING},(0,h.on)(s.Event.READY).stayIn(a.READY),(0,h.on)(s.Event.VIDEO_CHANGE).stayIn(a.READY),(0,h.on)(s.Event.AUDIO_CHANGE).stayIn(a.READY),{name:s.Event.ERROR,from:[a.STARTUP,a.AD_STARTUP],to:a.EXIT_BEFORE_VIDEOSTART},{name:s.Event.UNLOAD,from:[a.STARTUP,a.AD_STARTUP],to:a.EXIT_BEFORE_VIDEOSTART},{name:s.Event.VIDEOSTART_TIMEOUT,from:a.STARTUP,to:a.EXIT_BEFORE_VIDEOSTART},(0,h.on)(s.Event.PLAY).stayIn(a.STARTUP),(0,h.on)(s.Event.PLAYING).stayIn(a.STARTUP),{name:s.Event.TIMECHANGED,from:a.STARTUP,to:a.PLAYING},(0,h.on)(s.Event.START_BUFFERING).stayIn(a.STARTUP),(0,h.on)(s.Event.END_BUFFERING).stayIn(a.STARTUP),(0,h.on)(s.Event.VIDEO_CHANGE).stayIn(a.STARTUP),(0,h.on)(s.Event.AUDIO_CHANGE).stayIn(a.STARTUP),(0,h.on)(s.Event.READY).stayIn(a.STARTUP),{name:s.Event.PAUSE,from:a.STARTUP,to:a.READY},(0,h.on)(s.Event.PLAYING).stayIn(a.PLAYING),(0,h.on)(s.Event.TIMECHANGED).stayIn(a.PLAYING),(0,h.on)(s.Event.END_BUFFERING).stayIn(a.PLAYING),{name:s.Event.START_BUFFERING,from:a.PLAYING,to:a.REBUFFERING},{name:s.Event.END_BUFFERING,from:a.REBUFFERING,to:a.PLAYING},(0,h.on)(s.Event.TIMECHANGED).stayIn(a.REBUFFERING),{name:s.Event.PAUSE,from:a.PLAYING,to:a.PAUSE},{name:s.Event.PAUSE,from:a.REBUFFERING,to:a.PAUSE},{name:s.Event.PLAY,from:a.PAUSE,to:a.PLAYING},{name:s.Event.VIDEO_CHANGE,from:a.PLAYING,to:a.QUALITYCHANGE},{name:s.Event.AUDIO_CHANGE,from:a.PLAYING,to:a.QUALITYCHANGE},(0,h.on)(s.Event.VIDEO_CHANGE).stayIn(a.QUALITYCHANGE),(0,h.on)(s.Event.AUDIO_CHANGE).stayIn(a.QUALITYCHANGE),{name:"FINISH_QUALITYCHANGE",from:a.QUALITYCHANGE,to:a.PLAYING},{name:s.Event.VIDEO_CHANGE,from:a.PAUSE,to:a.QUALITYCHANGE_PAUSE},{name:s.Event.AUDIO_CHANGE,from:a.PAUSE,to:a.QUALITYCHANGE_PAUSE},(0,h.on)(s.Event.VIDEO_CHANGE).stayIn(a.QUALITYCHANGE_PAUSE),(0,h.on)(s.Event.AUDIO_CHANGE).stayIn(a.QUALITYCHANGE_PAUSE),{name:"FINISH_QUALITYCHANGE_PAUSE",from:a.QUALITYCHANGE_PAUSE,to:a.PAUSE},{name:s.Event.SEEK,from:a.PLAYING,to:a.PLAY_SEEKING},{name:s.Event.PLAY,from:a.PLAY_SEEKING,to:a.END_PLAY_SEEKING},{name:s.Event.PLAYING,from:a.PLAY_SEEKING,to:a.END_PLAY_SEEKING},{name:s.Event.SEEKED,from:a.PLAY_SEEKING,to:a.END_PLAY_SEEKING},{name:s.Event.SEEK,from:a.END_PLAY_SEEKING,to:a.PLAY_SEEKING},{name:s.Event.PLAYING,from:a.END_PLAY_SEEKING,to:a.PLAYING},{name:s.Event.TIMECHANGED,from:a.END_PLAY_SEEKING,to:a.PLAYING},(0,h.on)(s.Event.SEEK).stayIn(a.PLAY_SEEKING),(0,h.on)(s.Event.AUDIO_CHANGE).stayIn(a.PLAY_SEEKING),(0,h.on)(s.Event.VIDEO_CHANGE).stayIn(a.PLAY_SEEKING),(0,h.on)(s.Event.START_BUFFERING).stayIn(a.PLAY_SEEKING),(0,h.on)(s.Event.END_BUFFERING).stayIn(a.PLAY_SEEKING),(0,h.on)(s.Event.START_BUFFERING).stayIn(a.END_PLAY_SEEKING),(0,h.on)(s.Event.END_BUFFERING).stayIn(a.END_PLAY_SEEKING),(0,h.on)(s.Event.SEEKED).stayIn(a.END_PLAY_SEEKING),(0,h.on)(s.Event.PLAY).stayIn(a.END_PLAY_SEEKING),(0,h.on)(s.Event.SEEK).stayIn(a.PAUSE),(0,h.on)(s.Event.SEEKED).stayIn(a.PAUSE),(0,h.on)(s.Event.SEEKED).stayIn(a.PLAYING),{name:s.Event.END,from:a.PLAY_SEEKING,to:a.END},{name:s.Event.END,from:a.PLAYING,to:a.END},{name:s.Event.END,from:a.PAUSE,to:a.END},(0,h.on)(s.Event.SEEK).stayIn(a.END),(0,h.on)(s.Event.SEEKED).stayIn(a.END),(0,h.on)(s.Event.TIMECHANGED).stayIn(a.END),(0,h.on)(s.Event.END_BUFFERING).stayIn(a.END),(0,h.on)(s.Event.START_BUFFERING).stayIn(a.END),(0,h.on)(s.Event.END).stayIn(a.END),{name:s.Event.PLAY,from:a.END,to:a.STARTUP},{name:s.Event.ERROR,from:this.getAllStatesBut([a.STARTUP]),to:a.ERROR},{name:s.Event.UNLOAD,from:this.getAllStatesBut([a.STARTUP,a.AD_STARTUP]),to:a.END},{name:s.Event.CUSTOM_DATA_CHANGE,from:[a.PLAYING,a.PAUSE],to:a.CUSTOMDATACHANGE},{name:s.Event.PLAYING,from:a.CUSTOMDATACHANGE,to:a.PLAYING},{name:s.Event.PAUSE,from:a.CUSTOMDATACHANGE,to:a.PAUSE},{name:s.Event.SUBTITLE_CHANGE,from:a.PLAYING,to:a.SUBTITLE_CHANGING},(0,h.on)(s.Event.SUBTITLE_CHANGE).stayIn(a.PAUSE),(0,h.on)(s.Event.SUBTITLE_CHANGE).stayIn(a.REBUFFERING),(0,h.on)(s.Event.SUBTITLE_CHANGE).stayIn(a.END_PLAY_SEEKING),(0,h.on)(s.Event.SUBTITLE_CHANGE).stayIn(a.SUBTITLE_CHANGING),{name:s.Event.TIMECHANGED,from:a.SUBTITLE_CHANGING,to:a.PLAYING},{name:s.Event.AUDIOTRACK_CHANGED,from:a.PLAYING,to:a.AUDIOTRACK_CHANGING},(0,h.on)(s.Event.AUDIOTRACK_CHANGED).stayIn(a.PAUSE),(0,h.on)(s.Event.AUDIOTRACK_CHANGED).stayIn(a.REBUFFERING),(0,h.on)(s.Event.AUDIOTRACK_CHANGED).stayIn(a.END_PLAY_SEEKING),(0,h.on)(s.Event.AUDIOTRACK_CHANGED).stayIn(a.AUDIOTRACK_CHANGING),{name:s.Event.TIMECHANGED,from:a.AUDIOTRACK_CHANGING,to:a.PLAYING},{name:s.Event.START_AD,from:a.STARTUP,to:a.AD_STARTUP},{name:s.Event.END_AD,from:a.AD_STARTUP,to:a.STARTUP},(0,h.on)(s.Event.PLAY).stayIn(a.AD_STARTUP),(0,h.on)(s.Event.PAUSE).stayIn(a.AD_STARTUP),{name:s.Event.START_AD,from:a.READY,to:a.AD_READY},{name:s.Event.END_AD,from:a.AD_READY,to:a.STARTUP},(0,h.on)(s.Event.PLAY).stayIn(a.AD_READY),(0,h.on)(s.Event.PAUSE).stayIn(a.AD_READY),{name:s.Event.START_AD,from:a.PAUSE,to:a.AD_PAUSE},{name:s.Event.END_AD,from:a.AD_PAUSE,to:a.PAUSE},(0,h.on)(s.Event.PLAY).stayIn(a.AD_PAUSE),(0,h.on)(s.Event.PAUSE).stayIn(a.AD_PAUSE),{name:s.Event.START_AD,from:a.PLAYING,to:a.AD_PLAYING},{name:s.Event.END_AD,from:a.AD_PLAYING,to:a.PLAYING},(0,h.on)(s.Event.PLAY).stayIn(a.AD_PLAYING),(0,h.on)(s.Event.PAUSE).stayIn(a.AD_PLAYING),{name:s.Event.END,from:a.AD_PLAYING,to:a.END},(0,h.on)(s.Event.TIMECHANGED).stayIn(a.AD_STARTUP),(0,h.on)(s.Event.TIMECHANGED).stayIn(a.AD_READY),(0,h.on)(s.Event.TIMECHANGED).stayIn(a.AD_PAUSE),(0,h.on)(s.Event.TIMECHANGED).stayIn(a.AD_PLAYING),(0,h.on)(s.Event.END_AD).stayIn(a.PLAYING),(0,h.on)(s.Event.END_AD).stayIn(a.PAUSE),(0,h.on)(s.Event.END_AD).stayIn(a.READY),(0,h.on)(s.Event.END_AD).stayIn(a.STARTUP),{name:s.Event.MUTE,from:a.READY,to:a.MUTING_READY},{name:s.Event.UN_MUTE,from:a.READY,to:a.MUTING_READY},{name:"FINISH_MUTING",from:a.MUTING_READY,to:a.READY},{name:s.Event.MUTE,from:a.PLAYING,to:a.MUTING_PLAY},{name:s.Event.UN_MUTE,from:a.PLAYING,to:a.MUTING_PLAY},{name:"FINISH_MUTING",from:a.MUTING_PLAY,to:a.PLAYING},{name:s.Event.MUTE,from:a.PAUSE,to:a.MUTING_PAUSE},{name:s.Event.UN_MUTE,from:a.PAUSE,to:a.MUTING_PAUSE},{name:"FINISH_MUTING",from:a.MUTING_PAUSE,to:a.PAUSE},{name:s.Event.START_CAST,from:[a.READY,a.PAUSE,a.PLAYING],to:a.CASTING},(0,h.on)(s.Event.PAUSE).stayIn(a.CASTING),(0,h.on)(s.Event.PLAY).stayIn(a.CASTING),(0,h.on)(s.Event.PLAYING).stayIn(a.CASTING),(0,h.on)(s.Event.TIMECHANGED).stayIn(a.CASTING),(0,h.on)(s.Event.MUTE).stayIn(a.CASTING),(0,h.on)(s.Event.UN_MUTE).stayIn(a.CASTING),(0,h.on)(s.Event.SEEK).stayIn(a.CASTING),(0,h.on)(s.Event.SEEKED).stayIn(a.CASTING),{name:s.Event.END_CAST,from:a.CASTING,to:a.READY},(0,h.on)(s.Event.SEEK).stayIn(a.READY),(0,h.on)(s.Event.SEEKED).stayIn(a.READY),(0,h.on)(s.Event.SEEKED).stayIn(a.STARTUP),{name:s.Event.MANUAL_SOURCE_CHANGE,from:this.getAllStatesBut([a.SETUP]),to:a.SOURCE_CHANGING},{name:s.Event.MANUAL_SOURCE_CHANGE,from:a.SETUP,to:a.INITIAL_SOURCE_CHANGE},{name:s.Event.SOURCE_UNLOADED,from:this.getAllStates(),to:a.SOURCE_CHANGING},{name:s.Event.VIDEO_CHANGE,from:a.REBUFFERING,to:a.QUALITYCHANGE_REBUFFERING},{name:s.Event.AUDIO_CHANGE,from:a.REBUFFERING,to:a.QUALITYCHANGE_REBUFFERING},(0,h.on)(s.Event.VIDEO_CHANGE).stayIn(a.QUALITYCHANGE_REBUFFERING),(0,h.on)(s.Event.AUDIO_CHANGE).stayIn(a.QUALITYCHANGE_REBUFFERING),{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:a.QUALITYCHANGE_REBUFFERING,to:a.REBUFFERING}],callbacks:(t={onbeforeevent:function(e,t,n,r,i){if(t===a.REBUFFERING&&n===a.QUALITYCHANGE_REBUFFERING)return!1},onafterevent:function(e,t,r,i,o){r===a.QUALITYCHANGE_PAUSE&&n.stateMachine.FINISH_QUALITYCHANGE_PAUSE(i),r===a.QUALITYCHANGE&&n.stateMachine.FINISH_QUALITYCHANGE(i),r===a.QUALITYCHANGE_REBUFFERING&&n.stateMachine.FINISH_QUALITYCHANGE_REBUFFERING(i),r!==a.MUTING_READY&&r!==a.MUTING_PLAY&&r!==a.MUTING_PAUSE||n.stateMachine.FINISH_MUTING(i)}},t["onenter".concat(a.INITIAL_SOURCE_CHANGE)]=function(e,t,r,i,a){e===s.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.initialSourceChange(a)},t["onenter".concat(a.SOURCE_CHANGING)]=function(e,t,r,i,a){e===s.Event.MANUAL_SOURCE_CHANGE&&n.stateMachineCallbacks.manualSourceChange(a)},t.onenterstate=function(t,r,i,o,l){"none"===r&&e.starttime?n.onEnterStateTimestamp=e.starttime:n.onEnterStateTimestamp=o||(new Date).getTime(),u.logger.log("[ENTER ".concat(o,"] ").concat((0,u.padRight)(i,20)," EVENT: ").concat((0,u.padRight)(t,20)," from: ").concat((0,u.padRight)(r,14))),!l||i===a.END_PLAY_SEEKING||r===a.PLAY_SEEKING||r===a.AD_STARTUP||r===a.AD_READY||r===a.AD_PLAYING||r===a.AD_PAUSE||t===s.Event.SEEK&&r===a.END_PLAY_SEEKING||n.stateMachineCallbacks.setVideoTimeStartFromEvent(l),t===s.Event.START_CAST&&i===a.CASTING&&n.stateMachineCallbacks.startCasting(o,l),i===a.REBUFFERING&&n.startRebufferingHeartbeatInterval()},t.onleavestate=function(e,t,r,i,o){if(t===a.REBUFFERING&&n.resetRebufferingHelpers(),i){u.logger.log("[LEAVE ".concat(i,"] ").concat((0,u.padRight)(t,20)," EVENT: ").concat((0,u.padRight)(e,20)," to: ").concat((0,u.padRight)(r,20))),n.addStatesToLog(e,t,r,i,o);var l=i-n.onEnterStateTimestamp;o&&r!==a.END_PLAY_SEEKING&&n.stateMachineCallbacks.setVideoTimeEndFromEvent(o),o&&e!==s.Event.END_AD&&(n.lastTrackedVideoEndObject=o),t!==a.READY&&t!==a.AD_STARTUP||r!==a.STARTUP?t!==a.STARTUP||r!==a.PLAYING&&r!==a.AD_STARTUP||n.clearVideoStartTimeout():n.setVideoStartTimeout();var d=String(t).toLowerCase();if(r===a.EXIT_BEFORE_VIDEOSTART){n.clearVideoStartTimeout();var f=n.getVideoStartupFailedEventData(i,e,o),p=e!==s.Event.ERROR;n.stateMachineCallbacks.videoStartFailed(f,p)}else if(t===a.END_PLAY_SEEKING){var m=n.seekedTimestamp-n.seekTimestamp;n.seekStarted&&n.seekEnded&&e!==s.Event.SEEK&&(n.seekStarted=n.seekEnded=!1,n.stateMachineCallbacks.end_play_seeking(m,d))}else if(e===s.Event.UNLOAD)n.stateMachineCallbacks.unload(l,d);else if(t===a.AD_PAUSE||t===a.AD_READY||t===a.AD_PLAYING||t===a.AD_STARTUP)n.stateMachineCallbacks.setVideoTimeStartFromEvent(n.lastTrackedVideoEndObject),n.stateMachineCallbacks.setVideoTimeEndFromEvent(n.lastTrackedVideoEndObject),n.stateMachineCallbacks.ad(l,"ad");else if(e===s.Event.START_AD&&t===a.STARTUP)(0,c.noOp)();else if(e===s.Event.SOURCE_LOADED&&t===a.INITIAL_SOURCE_CHANGE)(0,c.noOp)();else if(t===a.SETUP)n.stateMachineCallbacks.setup(1,a.SETUP.toLowerCase());else if(e===s.Event.PAUSE&&t===a.STARTUP&&r===a.READY)n.clearVideoStartTimeout();else if(t!==a.ERROR){var v=n.stateMachineCallbacks[d];if("function"==typeof v)try{v(l,d,o)}catch(e){u.logger.error("Exception occurred in State Machine callback "+d,o,e)}else(0,h.logMissingCallbackWarning)(t,[a.READY,a.SOURCE_CHANGING])}o&&r!==a.END_PLAY_SEEKING&&t!==a.PLAY_SEEKING&&r!==a.PLAY_SEEKING&&t!==a.AD_STARTUP&&t!==a.AD_READY&&t!==a.AD_PLAYING&&t!==a.AD_PAUSE&&n.stateMachineCallbacks.setVideoTimeStartFromEvent(o),e===s.Event.VIDEO_CHANGE?n.stateMachineCallbacks.videoChange(o):e===s.Event.AUDIO_CHANGE?n.stateMachineCallbacks.audioChange(o):e===s.Event.MUTE?n.stateMachineCallbacks.mute():e===s.Event.UN_MUTE&&n.stateMachineCallbacks.unMute()}},t.onseek=function(e,t,r,i){n.seekStarted||(n.seekTimestamp=i,n.seekStarted=!0)},t.onseeked=function(e,t,r,i){n.seekedTimestamp=i,n.seekEnded=!0},t.ontimechanged=function(e,t,r,i,a){if("PLAYING"===n.stateMachine.current){var o=i-n.onEnterStateTimestamp;o>59700&&n.onHeartbeat(i,o,String(t).toLowerCase(),a)}},t.onplayerError=function(e,t,r,i,a){n.stateMachineCallbacks.error(a)},t)})},t.prototype.onHeartbeat=function(e,t,n,r){this.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var i=(0,h.createHeartbeatPayload)(t,n);this.stateMachineCallbacks.heartbeat(t,n,i),this.onEnterStateTimestamp=e,this.stateMachineCallbacks.setVideoTimeStartFromEvent(r)},t.prototype.callEvent=function(e,t,n){var r=this.stateMachine[e];if(r)try{r.call(this.stateMachine,n,t)}catch(n){u.logger.error("Exception occured in State Machine callback "+e,r,t,n)}else u.logger.log("Ignored Event: "+e)},t.prototype.addStatesToLog=function(e,t,n,r,i){this.enabledDebugging&&this.debuggingStates.push(new l.EventDebugging(e,t,n,r,i))},t.prototype.getStates=function(){return this.debuggingStates},t.prototype.setEnabledDebugging=function(e){this.enabledDebugging=e},t}(d.AnalyticsStateMachine);t.Bitmovin8AnalyticsStateMachine=f},3674:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i59700&&n.onHeartbeat(i,o,String(t).toLowerCase(),a)},t.onplayerError=function(e,t,r,i,a){n.stateMachineCallbacks.error(a)},t)})},t.prototype.onHeartbeat=function(e,t,n,r){if(this.currentState==o.PLAYING){this.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var i=(0,h.createHeartbeatPayload)(t,n);this.stateMachineCallbacks.heartbeat(t,n,i),this.onEnterStateTimestamp=e,this.stateMachineCallbacks.setVideoTimeStartFromEvent(r)}},t.prototype.callEvent=function(e,t,n){var r=this.stateMachine[e];r?r.call(this.stateMachine,n,t):u.logger.log("Ignored Event: "+e)},t}(d.AnalyticsStateMachine);t.HTML5AnalyticsStateMachine=f},5182:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i59700&&(t.stateMachineCallbacks.setVideoTimeEndFromEvent(a),t.stateMachineCallbacks.heartbeat(o,String(n).toLowerCase(),{played:o}),t.onEnterStateTimestamp=i,t.stateMachineCallbacks.setVideoTimeStartFromEvent(a))},onplayerError:function(e,n,r,i,a){t.stateMachineCallbacks.error(a)}}})},t.prototype.callEvent=function(e,t,n){var r=this.stateMachine[e];r?r.call(this.stateMachine,n,t):u.logger.log("Ignored Event: "+e)},t}(c.AnalyticsStateMachine);t.VideojsAnalyticsStateMachine=h},5611:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AmazonIVSStateMachine=void 0;var a,o=n(2595),s=n(2361),l=n(1916),u=n(5063),c=n(7596),d=n(8253);!function(e){e.SETUP="SETUP",e.READY="READY",e.STARTUP="STARTUP",e.PLAYING="PLAYING",e.PAUSE="PAUSE",e.REBUFFERING="REBUFFERING",e.EXIT_BEFORE_VIDEOSTART="EXIT_BEFORE_VIDEOSTART",e.ERROR="ERROR",e.UNLOADED="UNLOADED",e.QUALITY_CHANGE="QUALITY_CHANGE",e.SEEKING="SEEKING"}(a||(a={}));var h=function(e){function t(t,n,r){var i=e.call(this,t,r)||this;return i.heartbeatService=n,i.getStateHandler=function(){var e;return(e={})[a.SETUP]={onenterstate:function(){},onleavestate:function(e){i.stateMachineCallbacks.setup(e,a.SETUP.toLowerCase())}},e[a.READY]={onenterstate:function(){},onleavestate:function(){}},e[a.STARTUP]={onenterstate:function(){i.setVideoStartTimeout()},onleavestate:function(e,t){i.clearVideoStartTimeout(),t==a.PLAYING&&i.stateMachineCallbacks.startup(e,a.STARTUP.toLowerCase())}},e[a.PLAYING]={onenterstate:function(){i.heartbeatService.startHeartbeat()},onleavestate:function(e){i.heartbeatService.stopHeartbeat(),i.stateMachineCallbacks.playing(e,a.PLAYING.toLowerCase())}},e[a.PAUSE]={onenterstate:function(){},onleavestate:function(e){i.stateMachineCallbacks.pause(e,a.PAUSE.toLowerCase())}},e[a.REBUFFERING]={onenterstate:function(){i.startRebufferingHeartbeatInterval()},onleavestate:function(e){i.resetRebufferingHelpers(),i.stateMachineCallbacks.rebuffering(e,a.REBUFFERING.toLowerCase())}},e[a.EXIT_BEFORE_VIDEOSTART]={onenterstate:function(e,t){var n={reason:i.getReasonForVideoStartFailure(e)},r=e===s.Event.ERROR,a=!r;i.stateMachineCallbacks.videoStartFailed(n,a),r&&i.stateMachineCallbacks.error(t)},onleavestate:function(){}},e[a.ERROR]={onenterstate:function(e,t){i.stateMachineCallbacks.error(t)},onleavestate:function(){}},e[a.UNLOADED]={onenterstate:function(){i.stateMachineCallbacks.unload(0,a.UNLOADED)},onleavestate:function(){}},e[a.QUALITY_CHANGE]={onenterstate:function(e,t){i.stateMachine.FINISH_QUALITYCHANGE(i.onEnterStateTimestamp,t)},onleavestate:function(){i.stateMachineCallbacks.qualitychange(0,a.QUALITY_CHANGE.toLowerCase())}},e[a.SEEKING]={onenterstate:function(){},onleavestate:function(e){i.stateMachineCallbacks.end_play_seeking(e,a.SEEKING.toLowerCase())}},e},i}return i(t,e),t.prototype.createStateMachine=function(e){var t=this;return this.onEnterStateTimestamp=e.starttime,o.StateMachine.create({initial:a.SETUP,error:d.customStateMachineErrorCallback,events:[{name:s.Event.READY,from:a.SETUP,to:a.READY},{name:s.Event.PLAY,from:a.READY,to:a.STARTUP},{name:s.Event.PLAYING,from:a.STARTUP,to:a.PLAYING},{name:s.Event.PAUSE,from:a.PLAYING,to:a.PAUSE},{name:s.Event.PLAYING,from:a.PAUSE,to:a.PLAYING},{name:s.Event.PLAY,from:a.PAUSE,to:a.PLAYING},{name:s.Event.UNLOAD,from:a.PLAYING,to:a.UNLOADED},{name:s.Event.PLAYING,from:a.ERROR,to:a.PLAYING},{name:s.Event.VIDEO_CHANGE,from:a.PLAYING,to:a.QUALITY_CHANGE},{name:"FINISH_QUALITYCHANGE",from:a.QUALITY_CHANGE,to:a.PLAYING},{name:s.Event.SEEK,from:a.PLAYING,to:a.SEEKING},{name:s.Event.SEEKED,from:a.SEEKING,to:a.PLAYING},{name:s.Event.PAUSE,from:a.SEEKING,to:a.PAUSE},{name:s.Event.START_BUFFERING,from:a.PLAYING,to:a.REBUFFERING},{name:s.Event.PLAYING,from:a.REBUFFERING,to:a.PLAYING},{name:s.Event.VIDEOSTART_TIMEOUT,from:a.STARTUP,to:a.EXIT_BEFORE_VIDEOSTART},{name:s.Event.ERROR,from:a.STARTUP,to:a.EXIT_BEFORE_VIDEOSTART},{name:s.Event.UNLOAD,from:a.STARTUP,to:a.EXIT_BEFORE_VIDEOSTART},{name:s.Event.ERROR,from:f([a.STARTUP,a.EXIT_BEFORE_VIDEOSTART]),to:a.ERROR},(0,d.on)(s.Event.PAUSE).stayIn(a.PAUSE),(0,d.on)(s.Event.PAUSE).stayIn(a.STARTUP),(0,d.on)(s.Event.PAUSE).stayIn(a.REBUFFERING),(0,d.on)(s.Event.PLAY).stayIn(a.PLAYING),(0,d.on)(s.Event.PLAYING).stayIn(a.PLAYING),(0,d.on)(s.Event.START_BUFFERING).stayIn(a.PAUSE),(0,d.on)(s.Event.START_BUFFERING).stayIn(a.REBUFFERING),(0,d.on)(s.Event.VIDEOSTART_TIMEOUT).stayIn(a.PLAYING),(0,d.on)(s.Event.VIDEOSTART_TIMEOUT).stayIn(a.PAUSE),(0,d.on)(s.Event.VIDEOSTART_TIMEOUT).stayIn(a.SEEKING),(0,d.on)(s.Event.UNLOAD).stayIn(a.READY),(0,d.on)(s.Event.UNLOAD).stayIn(a.SEEKING),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.QUALITY_CHANGE),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.STARTUP),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.REBUFFERING),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.PAUSE),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.ERROR),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.EXIT_BEFORE_VIDEOSTART),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.READY),(0,d.on)(s.Event.VIDEO_CHANGE).stayIn(a.SEEKING),(0,d.on)(s.Event.SEEK).stayIn(a.SEEKING),(0,d.on)(s.Event.SEEK).stayIn(a.PAUSE),(0,d.on)(s.Event.SEEK).stayIn(a.QUALITY_CHANGE),(0,d.on)(s.Event.SEEK).stayIn(a.REBUFFERING),(0,d.on)(s.Event.SEEK).stayIn(a.ERROR),(0,d.on)(s.Event.SEEK).stayIn(a.STARTUP),(0,d.on)(s.Event.SEEK).stayIn(a.READY),(0,d.on)(s.Event.SEEK).stayIn(a.EXIT_BEFORE_VIDEOSTART),(0,d.on)(s.Event.SEEKED).stayIn(a.PAUSE),(0,d.on)(s.Event.SEEKED).stayIn(a.QUALITY_CHANGE),(0,d.on)(s.Event.SEEKED).stayIn(a.REBUFFERING),(0,d.on)(s.Event.SEEKED).stayIn(a.ERROR),(0,d.on)(s.Event.SEEKED).stayIn(a.STARTUP),(0,d.on)(s.Event.SEEKED).stayIn(a.READY),(0,d.on)(s.Event.SEEKED).stayIn(a.EXIT_BEFORE_VIDEOSTART)],callbacks:{onenterstate:function(e,n,r,i,a){"none"!=n&&void 0!==r&&void 0!==e&&(a&&t.stateMachineCallbacks.setVideoTimeStartFromEvent(a),l.logger.log("[ENTER ".concat(i,"] EVENT: ").concat(e," \nfrom: ").concat(n,"\t to: ").concat(r)),t.onEnterStateTimestamp=i||u.getCurrentTimestamp(),t.getStateHandler()[r].onenterstate(e,a))},onleavestate:function(e,n,r,i,a){if(i&&"none"!=n&&void 0!==n&&void 0!==r){a&&t.stateMachineCallbacks.setVideoTimeEndFromEvent(a);var o=i-t.onEnterStateTimestamp;t.getStateHandler()[n].onleavestate(o,r)}}}})},t.prototype.callEvent=function(e,t,n){var r=this.stateMachine[e];r?r.call(this.stateMachine,n,t):l.logger.log("Ignored Event: "+e)},t.prototype.onHeartbeat=function(e){this.stateMachineCallbacks.setVideoTimeEndFromEvent(e);var t=u.getCurrentTimestamp(),n=t-this.onEnterStateTimestamp;this.stateMachineCallbacks.heartbeat(n,"playing",{played:n}),this.onEnterStateTimestamp=t,this.stateMachineCallbacks.setVideoTimeStartFromEvent(e)},t}(c.AnalyticsStateMachine);t.AmazonIVSStateMachine=h;var f=function(e){return p().filter((function(t){return e.indexOf(t)<0}))},p=function(){return Object.keys(a).map((function(e){return a[e]}))}},8470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeartbeatService=void 0;var n=function(){function e(e,t){this.heartbeatIntervalMs=e,this.playerContext=t}return e.prototype.setListener=function(e){this.listener=e},e.prototype.startHeartbeat=function(){var e=this;void 0!==this.heartbeatInterval&&this.clearHeartbeat(),this.heartbeatInterval=window.setInterval((function(){var t,n={currentTime:e.playerContext.position};null===(t=e.listener)||void 0===t||t.onHeartbeat(n)}),this.heartbeatIntervalMs)},e.prototype.stopHeartbeat=function(){this.clearHeartbeat()},e.prototype.clearHeartbeat=function(){window.clearTimeout(this.heartbeatInterval),this.heartbeatInterval=void 0},e}();t.HeartbeatService=n},8253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logMissingCallbackWarning=t.createHeartbeatPayload=t.customStateMachineErrorCallback=t.on=void 0;var r=n(1916);t.on=function(e){return{stayIn:function(t){return{name:e,from:t,to:t}}}},t.customStateMachineErrorCallback=function(e,t,n,i,a,o,s){r.logger.error("Error in StateMachine: "+o)},t.createHeartbeatPayload=function(e,t){var n={};switch(t){case"playing":n={played:e};break;case"buffering":n={buffered:e};break;case"paused":n={paused:e}}return n},t.logMissingCallbackWarning=function(e,t){void 0===t&&(t=[]),null!=e&&null==t.find((function(t){return e===t}))&&r.logger.warning("Could not find callback function for "+e)}},8917:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&n.adapter.isLinearAdActive()&&(n.currentTime=c.calculateTime(Math.max(n.adapter.currentTime(),0)))}catch(e){u.logger.log("AdStarted monitoring interval failed and got cleared",e),n.resetActiveAd()}}),e.TIMEOUT_CURRENT_TIME_INTERVAL)},e.prototype.completeAd=function(e,t,n){void 0===t&&(t=new l.AdSample),t.exitPosition=n,t.playPercentage=c.calculatePercentage(t.exitPosition,t.adDuration),this.adStartupTimestamp=c.getCurrentTimestamp(),this.updatePlayingTime(t),this.isPlaying=!1,this.sendAnalyticsRequest(e,t)},e.prototype.resetActiveAd=function(){this.clearCurrentTimeInterval(),this.activeAdSample=void 0},e.prototype.clearCurrentTimeInterval=function(){window.clearInterval(this.currentTimeInterval),delete this.currentTime},e.MODULE_NAME="ads",e.TIMEOUT_CURRENT_TIME_INTERVAL=100,e}();t.AdAnalytics=h},4350:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&(e.startupTime+=t),e.sample.startupTime=e.startupTime,e.autoplay=e.sample.autoplay=e.adapter.getAutoPlay(),e.adapter.qualityChangeService.setStartupHasFinished();var r=e.adapter.getDrmPerformanceInfo();null!=r&&(e.sample.drmType=r.drmType,e.sample.drmLoadTime=r.drmLoadTime),e.sendAnalyticsRequestAndClearValues(),e.sample.autoplay=void 0},this.adapter.stateMachineCallbacks.playing=function(t,n){e.setDuration(t),e.setState(n),e.sample.played=t,e.setCompletionValues(),e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.unload=function(t,n){var r=e.sample.videoTimeStart;"playing"===n&&(e.setDuration(t),e.setState(n),e.sample.played=t,e.setCompletionValues(),e.sendUnloadRequest(),d.isNumber(e.sample.videoTimeEnd)&&(r=e.sample.videoTimeEnd)),e.videoStartupTime>0&&(e.setVideoTimeStart(r),e.setVideoTimeEnd(r),e.clearValues(),e.setState("closed"),e.sendUnloadRequest())},this.adapter.stateMachineCallbacks.heartbeat=function(t,n,i){e.setState(n),e.setDuration(t),e.sample=r(r({},e.sample),i),"playing"===n&&e.setCompletionValues(),e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.qualitychange=function(t,n){e.sendQualityChange(n,t)},this.adapter.stateMachineCallbacks.qualitychange_pause=function(t,n){e.sendQualityChange(n,t)},this.adapter.stateMachineCallbacks.qualitychange_rebuffering=function(t,n){e.sendQualityChange(n,t)},this.adapter.stateMachineCallbacks.videoChange=function(t){e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackVideoPropertiesFromEvent(t)},this.adapter.stateMachineCallbacks.audioChange=function(t){e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackAudioPropertiesFromEvent(t)},this.adapter.stateMachineCallbacks.audiotrack_changing=function(){e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.pause=function(t,n){e.setDuration(t),e.setState(n),e.sample.paused=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.paused_seeking=function(t,n){e.setDuration(t),e.setState(n),e.sample.seeked=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.end_play_seeking=function(t,n){e.setState(n),e.setDuration(t),e.sample.seeked=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.rebuffering=function(t,n){e.setDuration(t),e.setState(n),e.sample.buffered=t,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.videoStartFailed=function(t,n){void 0===n&&(n=!0),e.setState("startup"),e.sample.videoStartFailed=!0,e.sample.videoStartFailedReason=t.reason.reason,null!=t.reason.errorCode&&(e.sample.errorCode=t.reason.errorCode.code,e.sample.errorMessage=t.reason.errorCode.message,n&&e.onErrorDetailEventDispatcher.dispatch(r({},t.reason.errorCode))),n&&e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.error=function(t){e.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setState("error"),e.sample.errorCode=t.code,e.sample.errorMessage=t.message,e.sample.errorData=JSON.stringify(t.legacyData);var n=e.adapter.segments.map((function(e){return e.name}));e.sample.errorSegments=n,e.adapter.onError&&e.adapter.onError(),e.onErrorDetailEventDispatcher.dispatch({code:t.code,message:t.message,errorData:t.data}),e.sendAnalyticsRequestAndClearValues(),delete e.sample.errorCode,delete e.sample.errorMessage,delete e.sample.errorData},this.adapter.stateMachineCallbacks.ad=function(t,n){e.setDuration(t),e.setState(n),e.sample.ad=1,e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.mute=function(){e.sample.isMuted=!0},this.adapter.stateMachineCallbacks.unMute=function(){e.sample.isMuted=!1},this.adapter.stateMachineCallbacks.subtitle_changing=function(){e.sendAnalyticsRequestAndClearValues()},this.adapter.stateMachineCallbacks.setVideoTimeEndFromEvent=function(t){d.isNumber(t.currentTime)&&e.setVideoTimeEnd(d.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.setVideoTimeStartFromEvent=function(t){d.isNumber(t.currentTime)&&e.setVideoTimeStart(d.calculateTime(t.currentTime))},this.adapter.stateMachineCallbacks.manualSourceChange=function(t){e.adapter.resetSourceRelatedState(),e.sample=e.setupSample(),e.startupTime=0,e.config=Object.keys(t.config).length>0?t.config:e.config,e.init()},this.adapter.stateMachineCallbacks.playlistTransition=function(t){e.sample=e.setupSample(),e.startupTime=0,e.init()},this.adapter.stateMachineCallbacks.initialSourceChange=function(t){e.config=t.config,e.setConfigParameters()},this.adapter.stateMachineCallbacks.end=function(){e.sample=e.setupSample(),e.startupTime=0,e.init()},this.adapter.stateMachineCallbacks.release=function(){e.release()},this.adapter.stateMachineCallbacks.customdatachange=function(t,n,r){r&&r.values&&e.changeCustomData(r.values)}},e.prototype.setDuration=function(e){this.sample.duration=e},e.prototype.setState=function(e){this.sample.state=e},e.prototype.setPlaybackVideoPropertiesFromEvent=function(e){d.isNumber(e.width)&&(this.sample.videoPlaybackWidth=e.width),d.isNumber(e.height)&&(this.sample.videoPlaybackHeight=e.height),d.isNumber(e.bitrate)&&(this.sample.videoBitrate=e.bitrate),(0,h.isValidString)(e.codec)&&(this.sample.videoCodec=e.codec)},e.prototype.setPlaybackAudioPropertiesFromEvent=function(e){d.isNumber(e.bitrate)&&(this.sample.audioBitrate=e.bitrate),(0,h.isValidString)(e.codec)&&(this.sample.audioCodec=e.codec)},e.prototype.setPlaybackInfoFromAdapter=function(){var e=this.adapter.getCurrentPlaybackInfo();e&&(this.sample.isLive=this.getIsLiveFromConfigOrPlaybackInfo(this.config,e.isLive),(0,h.isValidString)(e.size)&&(this.sample.size=e.size),(0,h.isValidString)(e.playerTech)&&(this.sample.playerTech=e.playerTech),d.isNumber(e.videoDuration)&&(this.sample.videoDuration=d.calculateTime(e.videoDuration||0)),(0,h.isValidString)(e.streamFormat)&&(this.sample.streamFormat=e.streamFormat),(0,h.isValidString)(e.mpdUrl)&&(this.sample.mpdUrl=e.mpdUrl),(0,h.isValidString)(e.m3u8Url)&&(this.sample.m3u8Url=e.m3u8Url),(0,h.isValidString)(e.progUrl)&&(this.sample.progUrl=e.progUrl),d.isNumber(e.videoWindowWidth)&&(this.sample.videoWindowWidth=e.videoWindowWidth),d.isNumber(e.videoWindowHeight)&&(this.sample.videoWindowHeight=e.videoWindowHeight),d.isNumber(e.screenHeight)&&(this.sample.screenHeight=e.screenHeight),d.isNumber(e.screenWidth)&&(this.sample.screenWidth=e.screenWidth),d.isNumber(e.videoPlaybackHeight)&&(this.sample.videoPlaybackHeight=e.videoPlaybackHeight),d.isNumber(e.videoPlaybackWidth)&&(this.sample.videoPlaybackWidth=e.videoPlaybackWidth),d.isNumber(e.videoBitrate)&&(this.sample.videoBitrate=e.videoBitrate),d.isNumber(e.audioBitrate)&&(this.sample.audioBitrate=e.audioBitrate),d.isBoolean(e.isMuted)&&(this.sample.isMuted=e.isMuted),d.isBoolean(e.isCasting)&&(this.sample.isCasting=e.isCasting),(0,h.isValidString)(e.castTech)&&(this.sample.castTech=e.castTech),(0,h.isValidString)(e.videoTitle)&&!this.config.title&&(this.sample.videoTitle=e.videoTitle),(0,h.isValidString)(e.audioCodec)&&(this.sample.audioCodec=e.audioCodec),(0,h.isValidString)(e.videoCodec)&&(this.sample.videoCodec=e.videoCodec),(0,h.isValidString)(e.audioLanguage)&&(this.sample.audioLanguage=e.audioLanguage),d.isBoolean(e.subtitleEnabled)&&(this.sample.subtitleEnabled=e.subtitleEnabled),(0,h.isValidString)(e.subtitleLanguage)?this.sample.subtitleLanguage=e.subtitleLanguage:this.sample.subtitleLanguage=void 0,d.isNumber(e.droppedFrames)&&(this.sample.droppedFrames=Math.max(e.droppedFrames-this.droppedSampleFrames,0),this.droppedSampleFrames=e.droppedFrames))},e.prototype.setupSample=function(){return this.droppedSampleFrames=0,r({platform:"web",playerStartupTime:0,pageLoadType:d.getPageLoadType(),path:d.sanitizePath(window.location.pathname),language:navigator.language||navigator.userLanguage,userAgent:navigator.userAgent,screenWidth:screen.width,screenHeight:screen.height,isLive:!1,videoDuration:0,size:o.PlayerSize.Window,time:0,videoWindowWidth:0,videoWindowHeight:0,droppedFrames:0,played:0,buffered:0,paused:0,ad:0,seeked:0,videoPlaybackWidth:0,videoPlaybackHeight:0,videoBitrate:0,audioBitrate:0,videoTimeStart:0,videoTimeEnd:0,videoStartupTime:0,duration:0,startupTime:0,analyticsVersion:i.VERSION,pageLoadTime:0,completedTotal:0},this.getPlayerInformationFromAdapter())},e.prototype.sendAnalyticsRequest=function(){this.setPlaybackInfoFromAdapter(),this.sample.time=d.getCurrentTimestamp(),this.sample.downloadSpeedInfo=this.adapter.downloadSpeedInfo;var e=r({},this.sample);this.backend.sendRequest(e)},e.prototype.sendAnalyticsRequestAndClearValues=function(){this.sendAnalyticsRequest(),this.clearValues()},e.prototype.sendUnloadRequest=function(){this.backend.sendUnloadRequest(this.sample)},e.prototype.sendAnalyticsRequestSynchronous=function(){this.backend.sendRequestSynchronous(this.sample)},e.prototype.clearValues=function(){this.sample.ad=0,this.sample.paused=0,this.sample.played=0,this.sample.seeked=0,this.sample.buffered=0,this.sample.playerStartupTime=0,this.sample.videoStartupTime=0,this.sample.startupTime=0,this.sample.castTech=void 0,this.sample.duration=0,this.sample.droppedFrames=0,this.sample.drmLoadTime=void 0,this.sample.videoStartFailed=void 0,this.sample.videoStartFailedReason=void 0,this.sample.completed=void 0,this.adapter.clearValues()},e.prototype.getIsLiveFromConfigOrPlaybackInfo=function(e,t){return null==t?e.isLive||!1:!!d.isBoolean(t)&&t},e.prototype.buildDefaultAnalyticsConfigValues=function(e){return d.isBoolean(e.isLive)||(e.isLive=!1),e},e.prototype.checkForErrorsInConfig=function(e){null!=e.customUserId&&null!=e.userId&&c.logger.warning("Configuration Warning: \nCustomUserId and UserId are set in the config \nValue of UserId will be used in sample \nPlease only use one configuartion field to set your userId")},e.prototype.getDomainFromConfig=function(e){var t=e.config;return null!=t&&null!=t.origin?t.origin:void 0},e.prototype.createBackend=function(e){var t=this.getDomain(e);return this.backendFactory.createBackend(e,{key:e.key,domain:t,version:i.VERSION},this.adapter,this.authenticationCallback)},e.prototype.getDomain=function(e){return this.getDomainFromConfig(e)||d.sanitizePath(window.location.hostname)},e.prototype.setCompletionValues=function(){if(this.adapter.videoCompletionTracker){var e=this.adapter.videoCompletionTracker.addWatched({start:this.sample.videoTimeStart,end:this.sample.videoTimeEnd}),t=this.adapter.videoCompletionTracker.getCompletionPercentage();Number.isNaN(e)||Number.isNaN(t)||(this.sample.completed=e,this.sample.completedTotal=t)}},e.prototype.setVideoTimeStart=function(e){this.sample.videoTimeStart=e},e.prototype.setVideoTimeEnd=function(e){this.sample.videoTimeEnd=e},e.prototype.sendQualityChange=function(e,t){this.adapter.qualityChangeService.startResetInterval(),this.adapter.qualityChangeService.increaseCounter(),this.adapter.qualityChangeService.isQualityChangeEventEnabled()?(this.setDuration(t),this.setState(e),this.sendAnalyticsRequestAndClearValues()):(this.setDuration(t),this.adapter.stateMachineCallbacks.error(r(r({},a.ErrorCode.QUALITY_CHANGE_THRESHOLD_EXCEEDED),{legacyData:void 0,currentTime:void 0,data:{}})))},e.version=i.VERSION,e}();function _(e,t){var n=null!=e?r({},e):{};return null!=t&&(n=r(r(r({},n),{enabled:!0}),t)),n}function E(e,t){var n=_(null==e?void 0:e.config,null==t?void 0:t.config);return r(r(r({},null!=e?e:{}),null!=t?t:{}),{config:n})}t.Analytics=y,t.mergeCollectorConfig=_,t.mergeAnalyticsConfigs=E,t.createDeviceInformationFromConfig=function(e){var t={};if((0,h.isValidString)(e.deviceType)&&!(0,h.isBlank)(e.deviceType)&&(t.model=e.deviceType),(0,h.isValidString)(e.deviceClass)&&!(0,h.isBlank)(e.deviceClass)&&(t.deviceClass=e.deviceClass),0!==Object.keys(t).length)return t}},3054:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackendFactory=void 0;var r=n(5253),i=n(4649),a=n(7540),o=n(3489),s=n(399),l=n(2226),u=n(7390),c=function(){function e(){}return e.prototype.createBackend=function(e,t,n,r){if(!this.isEnabled(e))return new l.NoOpBackend;var i=this.createInnerBackend(e,t,n,r);return this.decorateWithDebuggingBackend(e,i)},e.prototype.decorateWithDebuggingBackend=function(e,t){return e.debug?new a.DebuggingBackend(e,t):t},e.prototype.decorateWithBackendFromConfigIfAvailable=function(e,t){return void 0!==e&&void 0!==e.config&&void 0!==e.config.wrapBackend?e.config.wrapBackend(t):t},e.prototype.isEnabled=function(e){return void 0===e.config||!1!==e.config.enabled},e.prototype.createInnerBackend=function(e,t,n,a){var l=e.config&&e.config.backendUrl||i.ANALYTICS_BACKEND_BASE_URL,c=new o.LicenseCheckingBackend(t,r.LicenseCall,l,n,a);c=this.decorateWithBackendFromConfigIfAvailable(e,c);var d=new u.SequenceNumberBackend(c);return new s.LongPlaytimeFilteringBackend(d)},e}();t.BackendFactory=c},7540:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebuggingBackend=void 0;var r=n(1916),i=function(){function e(e,t){this.underlying=t,e.debug&&e.debug.fields&&(this.debugFields=e.debug.fields)}return e.prototype.sendRequest=function(e){this.printFields(e),this.underlying.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.printFields(e),this.underlying.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.printFields(e),this.underlying.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.underlying.sendAdRequest(e)},e.prototype.printFields=function(e){if(this.debugFields&&this.debugFields.length){var t={};this.debugFields.forEach((function(n){return t[n]=e[n]})),r.logger.logTable([t])}},e}();t.DebuggingBackend=i},9664:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadSpeedMeter=void 0;var r=n(5766),i=n(3786),a=function(){function e(){this.measures=[]}return e.prototype.reset=function(){this.measures=[]},e.prototype.addMeasurement=function(e){if(!(e.httpStatus>=400)){var t=new i.Measure(e),n=r.Converter.bitsToBytes(3e8);t.speed>=n||this.measures.push(t)}},e.prototype.getInfo=function(){return{segmentsDownloadCount:this.measures.length,segmentsDownloadSize:this.measures.map((function(e){return e.size})).reduce(this.add,0),segmentsDownloadTime:Math.ceil(1e3*this.totalTime()),avgDownloadSpeed:this.avgSpeed(),minDownloadSpeed:this.minSpeed(),maxDownloadSpeed:this.maxSpeed(),avgTimeToFirstByte:this.avgTimeToFirstByte()}},e.prototype.add=function(e,t){return e+t},e.prototype.avgSpeed=function(){if(0===this.measures.length)return 0;var e=this.speeds().reduce((function(e,t){return e+t}),0),t=this.measures.length;return this.bytePerSecondToBitPerSecond(e/t)},e.prototype.bytePerSecondToBitPerSecond=function(e){return r.Converter.bytesToBits(e)},e.prototype.minSpeed=function(){return 0===this.measures.length?0:this.bytePerSecondToBitPerSecond(Math.min.apply(Math,this.speeds()))},e.prototype.speeds=function(){return this.measures.map((function(e){return e.speed}))},e.prototype.maxSpeed=function(){return 0===this.measures.length?0:this.bytePerSecondToBitPerSecond(Math.max.apply(Math,this.speeds()))},e.prototype.totalTime=function(){return 0===this.measures.length?0:this.measures.reduce((function(e,t){return e+t.duration}),0)},e.prototype.avgTimeToFirstByte=function(){if(0===this.measures.length)return 0;var e=this.measures.reduce((function(e,t){return e+1e3*t.timeToFirstByte}),0)/this.measures.length;return Math.ceil(e)},e}();t.DownloadSpeedMeter=a},675:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDispatcher=void 0;var n=function(){function e(){this.callbacks=[]}return e.prototype.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){return t.unsubscribe(e)}},e.prototype.dispatch=function(e){this.callbacks.slice(0).forEach((function(t){t(e)}))},e.prototype.unsubscribe=function(e){var t=this.callbacks.indexOf(e);t>-1&&this.callbacks.splice(t,1)},Object.defineProperty(e.prototype,"subscriberCount",{get:function(){return this.callbacks.length},enumerable:!1,configurable:!0}),e}();t.EventDispatcher=n},3489:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=9e4},e}();t.LongPlaytimeFilteringBackend=n},3786:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Measure=void 0;var n=function(){function e(e){this.download=e}return Object.defineProperty(e.prototype,"speed",{get:function(){return this.download.size/this.download.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.download.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.download.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeToFirstByte",{get:function(){return this.download.timeToFirstByte},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestamp",{get:function(){return this.download.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"httpStatus",{get:function(){return this.download.httpStatus},enumerable:!1,configurable:!0}),e}();t.Measure=n},2226:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoOpBackend=void 0;var n=function(){function e(){}return e.prototype.sendRequest=function(e){},e.prototype.sendUnloadRequest=function(e){},e.prototype.sendRequestSynchronous=function(e){},e.prototype.sendAdRequest=function(e){},e}();t.NoOpBackend=n},9796:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4649),i=n(4649),a=function(){function e(e){void 0===e&&(e=r.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD),this.qualityChangeThreshold=e,this.qualityChangeCount=0,this.previousVideoBitrate=0,this.previousAudioBitrate=0,this.startupHasFinished=!1}return e.prototype.resetValues=function(){this.qualityChangeCount=0,this.previousAudioBitrate=0,this.previousVideoBitrate=0,this.startupHasFinished=!1,this.stopResetInterval()},e.prototype.isQualityChangeEventEnabled=function(){return this.qualityChangeCount<=this.qualityChangeThreshold},e.prototype.increaseCounter=function(){this.qualityChangeCount++},e.prototype.shouldAllowVideoQualityChange=function(e){return this.startupHasFinished&&null!=e&&!isNaN(e)&&0!==this.previousVideoBitrate&&this.previousVideoBitrate!==e&&this.isQualityChangeEventEnabled()},e.prototype.setVideoBitrate=function(e){this.startupHasFinished&&(this.previousVideoBitrate=e)},e.prototype.setStartupHasFinished=function(){this.startupHasFinished=!0},e.prototype.shouldAllowAudioQualityChange=function(e){return this.startupHasFinished&&null!=e&&!isNaN(e)&&0!==this.previousAudioBitrate&&this.previousAudioBitrate!==e&&this.isQualityChangeEventEnabled()},e.prototype.setAudioBitrate=function(e){this.startupHasFinished&&(this.previousAudioBitrate=e)},e.prototype.startResetInterval=function(){var e=this;void 0===this.resetIntervalId&&(this.resetIntervalId=window.setInterval((function(){e.resetCounter()}),i.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL))},e.prototype.stopResetInterval=function(){void 0!==this.resetIntervalId&&(window.clearInterval(this.resetIntervalId),delete this.resetIntervalId)},e.prototype.resetCounter=function(){this.qualityChangeCount=0},e}();t.default=a},1125:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueueBackend=void 0;var n=function(){function e(){this.queue=[],this.unloadQueue=[],this.syncQueue=[],this.adQueue=[]}return e.prototype.sendRequest=function(e){this.queue.push(e)},e.prototype.sendUnloadRequest=function(e){this.unloadQueue.push(e)},e.prototype.sendRequestSynchronous=function(e){this.syncQueue.push(e)},e.prototype.sendAdRequest=function(e){this.adQueue.push(e)},e.prototype.flushTo=function(e){this.queue.forEach((function(t){e.sendRequest(t)})),this.unloadQueue.forEach((function(t){e.sendUnloadRequest(t)})),this.syncQueue.forEach((function(t){e.sendRequestSynchronous(t)})),this.adQueue.forEach((function(t){e.sendAdRequest(t)}))},e}();t.QueueBackend=n},2364:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteBackend=void 0;var r=n(5426),i=n(5063),a=function(){function e(e,t,n){this.licenseKey=n,this.hasAdModule=e,this.analyticsCall=new r.AnalyticsCall(t)}return e.prototype.sendRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequest(e,i.noOp)},e.prototype.sendUnloadRequest=function(e){e.key=this.licenseKey,this.analyticsCall.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){e.key=this.licenseKey,this.analyticsCall.sendRequestSynchronous(e,i.noOp)},e.prototype.sendAdRequest=function(e){e.key=this.licenseKey,this.hasAdModule&&this.analyticsCall.sendAdRequest(e)},e}();t.RemoteBackend=a},6235:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentTracker=void 0;var n=function(){function e(){this.segments=[]}return e.prototype.reset=function(){this.segments=[]},e.prototype.addSegment=function(e){this.segments.push(e)},e.prototype.removeSegment=function(e){this.segments=this.segments.filter((function(t){return t.url!==e}))},e.prototype.getSegments=function(){return this.segments},e}();t.SegmentTracker=n},7390:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceNumberBackend=void 0;var n=function(){function e(e){this.sequenceNumber=0,this.underlying=e}return e.prototype.sendRequest=function(e){this.updateSampleBeforeSending(e),this.underlying.sendRequest(e)},e.prototype.sendUnloadRequest=function(e){this.updateSampleBeforeSending(e),this.underlying.sendUnloadRequest(e)},e.prototype.sendRequestSynchronous=function(e){this.updateSampleBeforeSending(e),this.underlying.sendRequestSynchronous(e)},e.prototype.sendAdRequest=function(e){this.underlying.sendAdRequest(e)},e.prototype.updateSampleBeforeSending=function(e){e.sequenceNumber=this.sequenceNumber++},e}();t.SequenceNumberBackend=n},847:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateCookieMaxAgeValue=t.validateCookieDomainValue=t.SessionPersistenceHandler=t.COOKIE_DEFAULT_MAX_AGE=t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID=void 0;var r=n(5063),i=n(5063),a=n(4934),o=n(1820);t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID="bitmovin_analytics_uuid",t.COOKIE_DEFAULT_MAX_AGE=31536e3;var s=function(e){var n=e.config;if(!1===(null==n?void 0:n.cookiesEnabled))return(0,a.deleteCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID),void(this.userId=r.generateUUID());var i=(0,a.getCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID);this.userId=(0,o.isBlank)(i)?r.generateUUID():i;var s=(0,t.validateCookieDomainValue)(null==n?void 0:n.cookiesDomain),l=(0,t.validateCookieMaxAgeValue)(null==n?void 0:n.cookiesMaxAge),u=Date.now(),c=new Date(u+1e3*l).toUTCString();(0,a.setCookie)(t.COOKIE_NAME_BITMOVIN_ANALYTICS_UUID,this.userId,{domain:s,expires:c,maxAge:l})};t.SessionPersistenceHandler=s,t.validateCookieDomainValue=function(e){if(null!=e&&(0,o.isValidString)(e)&&!(0,o.isBlank)(e))return encodeURIComponent(e)},t.validateCookieMaxAgeValue=function(e){return null==e?t.COOKIE_DEFAULT_MAX_AGE:(0,i.isNumber)(e)?e:t.COOKIE_DEFAULT_MAX_AGE}},4916:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceInfoFallbackService=void 0;var r=n(1820),i=function(){function e(e,t,n){this.streamFormat=e,this.videoCodec=t,this.audioCodec=n}return e.prototype.reset=function(){this.streamFormat=void 0,this.audioCodec=void 0,this.videoCodec=void 0},e.prototype.applyStreamFormat=function(e){(0,r.isBlank)(this.streamFormat)||(e.streamFormat=this.streamFormat)},e.prototype.applyVideoCodec=function(e){(0,r.isBlank)(this.videoCodec)||(e.videoCodec=this.videoCodec)},e.prototype.applyAudioCodec=function(e){(0,r.isBlank)(this.audioCodec)||(e.audioCodec=this.audioCodec)},e}();t.SourceInfoFallbackService=i},6743:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Overlapping=1]="Overlapping",e[e.FirstContainedInSecond=2]="FirstContainedInSecond",e[e.SecondContainedInFirst=3]="SecondContainedInFirst"}(n||(n={}));var r=function(){function e(){this.watched=[],this.videoDuration=null}return e.prototype.reset=function(){this.watched=[]},e.prototype.setVideoDuration=function(e){this.videoDuration=1e3*e},e.prototype.addWatched=function(e){if(null==this.videoDuration)throw new Error("no video duration set for completion tracker");this.watched.push(e);var t=this.mergeWatched(this.watched);return(this.getDuration(e)-t)/this.videoDuration},e.prototype.getCompletionPercentage=function(){if(null==this.videoDuration)throw new Error("no video duration set for completion tracker");for(var e=0,t=0,n=this.watched;tt.end?n.Overlapping:this.isMomentInTimespan(e.start,t)&&this.isMomentInTimespan(e.end,t)?n.FirstContainedInSecond:this.isMomentInTimespan(t.start,e)&&this.isMomentInTimespan(t.end,e)?n.SecondContainedInFirst:n.None},e.prototype.isMomentInTimespan=function(e,t){return e>=t.start&&en.end?e.end:n.end,a={start:e.start=t.start?e.start:t.start)},e.prototype.getDuration=function(e){return Math.abs(e.end-e.start)},e}();t.default=r},4355:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CdnProvider=void 0,function(e){e.CLOUDFLARE="cloudflare",e.AKAMAI="akamai",e.FASTLY="fastly",e.MAXCDN="maxcdn",e.CLOUDFRONT="cloudfront",e.CHINACACHE="chinacache",e.BITGRAVITY="bitgravity"}(n||(t.CdnProvider=n={}))},5878:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CastTech=void 0,function(e){e.AirPlay="AirPlay",e.WebSocket="WebSocket",e.GoogleCast="GoogleCast"}(n||(t.CastTech=n={}))},5626:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAudioCodec=t.isVideoCodec=void 0;var n=["avc1","avc3","hvc1","av01","av1","hev1","vp9"],r=["mp4a","ec-3","ac-3","opus","audio/mp4"];t.isVideoCodec=function(e){return!!e&&-1!==n.findIndex((function(t){return e.startsWith(t)}))},t.isAudioCodec=function(e){return!!e&&-1!==r.findIndex((function(t){return e.startsWith(t)}))}},3458:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=void 0;var n=function(){function e(e,t){this.code=e,this.message=t}return e.BITMOVIN_PLAYER_LICENSING_ERROR=new e(1103,""),e.SETUP_MISSING_LICENSE_WHITELIST=new e(1105,""),e.QUALITY_CHANGE_THRESHOLD_EXCEEDED=new e(1e4,"ANALYTICS_QUALITY_CHANGE_THRESHOLD_EXCEEDED"),e.BUFFERING_TIMEOUT_REACHED=new e(10001,"ANALYTICS_BUFFERING_TIMEOUT_REACHED"),e.VIDEO_STARTUP_TIMEOUT_REACHED=new e(10002,"ANALYTICS_VIDEOSTART_TIMEOUT_REACHED"),e}();t.ErrorCode=n},2361:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0,function(e){e.SETUP="setup",e.READY="ready",e.SOURCE_LOADED="sourceLoaded",e.PLAY="play",e.PLAYING="playing",e.PAUSE="pause",e.TIMECHANGED="timechanged",e.SEEK="seek",e.SEEKED="seeked",e.START_CAST="startCasting",e.END_CAST="endCasting",e.START_BUFFERING="startBuffering",e.END_BUFFERING="endBuffering",e.AUDIOTRACK_CHANGED="audioTrackChanged",e.AUDIO_CHANGE="audioChange",e.VIDEO_CHANGE="videoChange",e.START_FULLSCREEN="startFullscreen",e.END_FULLSCREEN="endFullscreen",e.START_AD="adStart",e.SUBTITLE_CHANGE="subtitleChange",e.END_AD="adEnd",e.MUTE="mute",e.UN_MUTE="unMute",e.ERROR="playerError",e.SCREEN_RESIZE="resize",e.UNLOAD="unload",e.END="end",e.SOURCE_UNLOADED="sourceUnloaded",e.MANUAL_SOURCE_CHANGE="manualSourceChangeInitiated",e.VIDEOSTART_TIMEOUT="VIDEOSTART_TIMEOUT",e.CUSTOM_DATA_CHANGE="customDataChange",e.PLAYLIST_TRANSITION="playlistTransition"}(n||(t.Event=n={}))},2168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMIMETypeFromFileExtension=t.MIMETypes=void 0;var r=n(1820),i="video/mp4",a="video/webm",o="application/x-mpegURL",s="application/dash+xml";t.MIMETypes={MP4:i,WEBM:a,HLS:o,DASH:s},t.getMIMETypeFromFileExtension=function(e){return e=e.split(/[?#]/)[0].toLowerCase(),(0,r.endsWith)(e,".m3u8")?o:(0,r.endsWith)(e,".mp4")||(0,r.endsWith)(e,".m4v")||(0,r.endsWith)(e,".m4a")?i:(0,r.endsWith)(e,".webm")?a:(0,r.endsWith)(e,".mpd")?s:void 0}},9946:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PAGE_LOAD_TYPE=void 0,function(e){e[e.FOREGROUND=1]="FOREGROUND",e[e.BACKGROUND=2]="BACKGROUND"}(n||(t.PAGE_LOAD_TYPE=n={}))},556:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Player=void 0,function(e){e.BITMOVIN="bitmovin",e.JW="jw",e.RADIANT="radiant",e.VIDEOJS="videojs",e.HLSJS="hlsjs",e.SHAKA="shaka",e.DASHJS="dashjs",e.HTML5="html5",e.CHROMECAST_SHAKA="chromecast-shaka",e.AMAZON_IVS="amazonivs"}(n||(t.Player=n={}))},8525:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.PlayerSize=void 0,function(e){e.Window="WINDOW",e.Fullscreen="FULLSCREEN"}(n||(t.PlayerSize=n={}))},7224:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.getStreamTypeFromMIMEType=t.StreamTypes=void 0;var i,a=n(2168),o=a.MIMETypes.MP4,s=a.MIMETypes.WEBM,l=a.MIMETypes.HLS,u=a.MIMETypes.DASH,c=((r={})[o]="progressive",r[s]="progressive",r[l]="hls",r[u]="dash",r);!function(e){e.prog="progressive",e.hls="hls",e.dash="dash"}(i||(t.StreamTypes=i={})),t.getStreamTypeFromMIMEType=function(e){return c[e]}},3565:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VideoStartFailedReason=void 0;var r=n(3458),i=function(){function e(e,t){this.reason=e,this.errorCode=t}return e.PAGE_CLOSED=new e("PAGE_CLOSED",null),e.PLAYER_ERROR=new e("PLAYER_ERROR",null),e.TIMEOUT=new e("TIMEOUT",r.ErrorCode.VIDEO_STARTUP_TIMEOUT_REACHED),e.UNKNOWN=new e("UNKNOWN",null),e}();t.VideoStartFailedReason=i},348:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Feature=void 0;var n=function(){function e(){this._config=void 0,this._isEnabled=!0}return Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),e.prototype.disable=function(){this._isEnabled=!1,this.disabled()},e.prototype.configure=function(e,t){return null!=t&&(this._config=this.extractConfig(t)),this.configured(e,this._config),this._config},e}();t.Feature=n},6845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureManager=void 0;var r=n(1916),i=function(){function e(){this.features=[]}return e.prototype.registerFeatures=function(e){this.features=e},e.prototype.unregisterFeatures=function(){this.features.forEach((function(e){return e.disable()})),this.features=[]},e.prototype.resetFeatures=function(){this.features.forEach((function(e){return e.reset()}))},e.prototype.configureFeatures=function(e,t){this.features=this.features.filter((function(n){var i=n.configure(e,t);return!(!e||!0!==(null==i?void 0:i.enabled))||(r.logger.log("Disabling feature ".concat(n.constructor.name," as it isn't enabled according to license callback.")),n.disable(),!1)})),this.features.forEach((function(e){return e.enabled()}))},e}();t.FeatureManager=i},7614:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&this._queue.splice(t,1)},e.MAX_URL_LENGTH=450,e.MAX_STRING_LENGTH=400,e}();t.ErrorDetailBackend=l},9557:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i0&&i.fallbackTags&&i.fallbackTags.length>=this.adFallbackIndex&&(a=i.fallbackTags[this.adFallbackIndex-1]),a&&(this.adTagType=a.type,this.adTagUrl=a.url),this.adTagUrl){var o=r.getHostnameAndPathFromUrl(this.adTagUrl);this.adTagServer=o.hostname,this.adTagPath=o.path}}var s=e;s&&(this.adScheduleTime=r.calculateTimeWithUndefined(s.scheduleTime),this.adIdPlayer=s.id)};t.AdBreakSample=i},4439:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdSample=void 0;var r=n(5063),i=function(){function e(t){if(this.clicked=0,this.closed=0,this.completed=0,this.midpoint=0,this.quartile1=0,this.quartile3=0,this.skipped=0,this.started=0,t){this.adClickthroughUrl=t.clickThroughUrl,this.adId=t.id,this.mediaUrl=t.mediaFileUrl;var n=r.getHostnameAndPathFromUrl(this.mediaUrl||"");this.mediaPath=n.path,this.mediaServer=n.hostname,this.isLinear=t.isLinear,this.adPlaybackHeight=t.height,this.adPlaybackWidth=t.width,t.data&&(this.videoBitrate=void 0===t.data.bitrate?void 0:1e3*t.data.bitrate,this.streamFormat=t.data.mimeType);var i=t.data;i&&(i.adSystem&&(this.adSystem=i.adSystem.name),i.advertiser&&(this.advertiserName=i.advertiser.name),this.apiFramework=i.apiFramework,i.creative&&(this.creativeAdId=i.creative.adId,this.creativeId=i.creative.id,i.creative.universalAdId&&(this.universalAdIdRegistry=i.creative.universalAdId.idRegistry,this.universalAdIdValue=i.creative.universalAdId.value)),this.adDescription=i.adDescription,this.minSuggestedDuration=r.calculateTimeWithUndefined(i.minSuggestedDuration),i.survey&&(this.surveyUrl=i.survey.uri),this.adTitle=i.adTitle,this.wrapperAdsCount=i.wrapperAdIds?i.wrapperAdIds.length:0)}var a=t;a&&(this.adSkippableAfter=e.parseSkipAfter(a.skippableAfter),this.adSkippable=a.skippable||(void 0===this.adSkippableAfter?void 0:this.adSkippableAfter>=0),this.adDuration=r.calculateTime(a.duration))}return e.parseSkipAfter=function(e){if(void 0!==e)return-1===e?e:r.calculateTime(e)},e}();t.AdSample=i},5529:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customDataFieldCount=t.customDataValuesKeys=void 0,t.customDataValuesKeys=["customData1","customData2","customData3","customData4","customData5","customData6","customData7","customData8","customData9","customData10","customData11","customData12","customData13","customData14","customData15","customData16","customData17","customData18","customData19","customData20","customData21","customData22","customData23","customData24","customData25","customData26","customData27","customData28","customData29","customData30","experimentName"],t.customDataFieldCount=t.customDataValuesKeys.filter((function(e){return e.match("customData\\d+")})).length},4501:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LicensingResult=void 0,function(e){e.Granted="granted",e.Denied="denied",e.Skip="skip"}(n||(t.LicensingResult=n={}))},3413:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVideoDuration=void 0,t.normalizeVideoDuration=function(e){return null==e||Number.isNaN(e)||e===1/0?0:e}},4820:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultStateMachineCallbacks=void 0,t.defaultStateMachineCallbacks={setup:function(){},startup:function(){},playing:function(){},heartbeat:function(){},qualitychange:function(){},qualitychange_pause:function(){},qualitychange_rebuffering:function(){},videoChange:function(){},audioChange:function(){},audiotrack_changing:function(){},pause:function(){},paused_seeking:function(){},end_play_seeking:function(){},rebuffering:function(){},error:function(){},end:function(){},unload:function(){},ad:function(){},mute:function(){},unMute:function(){},subtitle_changing:function(){},setVideoTimeEndFromEvent:function(){},setVideoTimeStartFromEvent:function(){},videoStartFailed:function(){},startCasting:function(){},casting:function(){},manualSourceChange:function(){},initialSourceChange:function(){},muting_ready:function(){},customdatachange:function(){},release:function(){},playlistTransition:function(){}}},716:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDifferentSubtitleInfo=void 0,t.isDifferentSubtitleInfo=function(e,t){return(null!=e||null!=t)&&!(null!=e&&null!=t&&e.enabled===t.enabled&&e.language===t.language)}},5426:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsCall=void 0;var r=n(92),i=n(5063),a=function(){function e(e){this.analyticsServerUrl=(0,i.joinUrls)(e,"analytics"),this.adAnalyticsServerUrl=(0,i.joinUrls)(e,"analytics/a")}return e.prototype.sendRequest=function(e,t){(0,r.post)(this.analyticsServerUrl,e,t)},e.prototype.sendUnloadRequest=function(e){var t=this;this.trySendBeacon((function(e){return t.sendRequestSynchronous(e,i.noOp)}),this.getAnalyticsServerUrl(),e)},e.prototype.trySendBeacon=function(e,t,n){void 0===navigator.sendBeacon?e(n):navigator.sendBeacon(t,JSON.stringify(n))||e(n)},e.prototype.sendRequestSynchronous=function(e,t){(0,r.post)(this.analyticsServerUrl,e,t,!1)},e.prototype.sendAdRequest=function(e){var t=this;this.trySendBeacon((function(e){return(0,r.post)(t.getAdAnalyticsServerUrl(),e,i.noOp)}),this.getAdAnalyticsServerUrl(),e)},e.prototype.getAnalyticsServerUrl=function(){return this.analyticsServerUrl},e.prototype.getAdAnalyticsServerUrl=function(){return this.adAnalyticsServerUrl},e}();t.AnalyticsCall=a},5248:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSourceInfoFromBitmovinSourceConfig=void 0,t.getSourceInfoFromBitmovinSourceConfig=function(e,t){if(!e)return{progBitrate:void 0,progUrl:void 0};if("string"==typeof e)return{progBitrate:0,progUrl:e};if(Array.isArray(e)&&e.length>0){var n=t.getPlaybackVideoData(),r=0;return null==n||isNaN(+n.id)||(r=+n.id),{progBitrate:e[r].bitrate||0,progUrl:e[r].url}}return"object"!=typeof e||Array.isArray(e)?{progBitrate:void 0,progUrl:void 0}:{progBitrate:e.bitrate||0,progUrl:e.url}}},404:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodecHelper=void 0;var n={avc:['video/mp4; codecs="avc1.42000a"'],vp9:['video/mp4; codecs="vp09.00.50.08"'],av1:['video/mp4; codecs="av01.0.08M.08"'],hevc:['video/mp4; codecs="hev1.1.6.L93.B0"']},r=function(){function e(){}return Object.defineProperty(e,"supportedVideoFormats",{get:function(){var e=this;if("MediaSource"in window)return Object.getOwnPropertyNames(n).filter((function(t){return n[t].some((function(t){return e.isCodecSupported(t)}))}))},enumerable:!1,configurable:!0}),e.isCodecSupported=function(e){return"MediaSource"in window&&MediaSource.isTypeSupported(e)},e}();t.CodecHelper=r},5766:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;var r=n(5063),i=function(){function e(){}return e.bytesToBits=function(e){return 8*e},e.bitsToBytes=function(e){return Math.round(e/8)},e.bytesToKiloBytes=function(e){return r.calculateTime(1e3*e)},e.kiloBytesToMegaBytes=function(e){return 1e3*e},e}();t.Converter=i},1652:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventDebugging=void 0;var n=function(e,t,n,r,i){this.event=e,this.from=t,this.to=n,this.timestamp=r,this.eventObject=i};t.EventDebugging=n},92:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.post=void 0;var r=n(1916);t.post=function(e,t,n,i){var a;void 0===i&&(i=!0);var o=!1;window.XDomainRequest&&(o=!0),a=o?new window.XDomainRequest:new XMLHttpRequest;var s=function(){if(a.readyState==XMLHttpRequest.DONE){if(a.responseText<=0)return;var e=JSON.parse(a.responseText);n(e)}};o?a.onload=s:a.onreadystatechange=s;try{a.open("POST",e,i),o||a.setRequestHeader("Content-Type","text/plain"),a.send(JSON.stringify(t))}catch(e){r.logger.error("Failed to send POST request.",e)}}},5253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseCall=void 0;var r=n(92),i=n(5063);t.LicenseCall=function(e,t,n,a){var o=(0,i.joinUrls)(a,"/licensing"),s={analyticsVersion:n,domain:t,key:e};return new Promise((function(e){(0,r.post)(o,s,(function(t){e(t)}))}))}},1916:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;ie;)this.poll()},e}();t.Queue=n},4649:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD=t.ANALYTICS_REBUFFER_TIMEOUT=t.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL=t.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD=t.ANALYTICS_VIDEOSTART_TIMEOUT=t.ANALYTICS_LICENSECALL_TIMEOUT=t.ANALYTICS_BACKEND_BASE_URL=t.MESSAGE_NAMESPACE=void 0,t.MESSAGE_NAMESPACE="urn:x-cast:com.bitmovin.analytics.cast",t.ANALYTICS_BACKEND_BASE_URL="https://analytics-ingress-global.bitmovin.com",t.ANALYTICS_LICENSECALL_TIMEOUT=6e4,t.ANALYTICS_VIDEOSTART_TIMEOUT=6e4,t.ANALYTICS_QUALITY_CHANGE_COUNT_THRESHOLD=50,t.ANALYTICS_QUALITY_CHANGE_COUNT_RESET_INTERVAL=36e5,t.ANALYTICS_REBUFFER_TIMEOUT=12e4,t.ANALYTICS_MIN_SEEK_DIFFERENCE_THRESHOLD=3},5063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinUrls=t.getURLResourceName=t.getBrowserInfo=t.calculatePercentage=t.getHostnameAndPathFromUrl=t.getPageLoadType=t.getHiddenProp=t.isVideoInFullscreen=t.getDocumentPropWithPrefix=t.transferCustomDataFields=t.getCustomDataString=t.noOp=t.generateUUID=t.getCurrentTimestamp=t.calculateTime=t.calculateTimeWithUndefined=t.sanitizePath=t.isNumber=t.isBoolean=void 0;var r=n(9946),i=n(5529),a=n(1820);t.isBoolean=function(e){return null!=e&&"boolean"==typeof e},t.isNumber=function(e){return null!=e&&"number"==typeof e},t.sanitizePath=function(e){return e.replace(/\/$/g,"")},t.calculateTimeWithUndefined=function(e){return void 0===e?e:(e*=1e3,Math.round(e))},t.calculateTime=function(e){return e*=1e3,Math.round(e)},t.getCurrentTimestamp=function(){return Date.now()},t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},t.noOp=function(){},t.getCustomDataString=function(e){return"object"==typeof e?JSON.stringify(e):"function"==typeof e?(0,t.getCustomDataString)(e()):void 0===e?e:"string"!=typeof e?String(e):e},t.transferCustomDataFields=function(e,n){for(var r=1;r<=i.customDataFieldCount;r++){var a="customData".concat(r);n[a]=(0,t.getCustomDataString)(e[a])}},t.getDocumentPropWithPrefix=function(e){if(e in document)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0,r=["webkit","moz","ms","o"];n0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,l=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(l[0][o]>l[1][o])return 1;if(l[0][o]===l[1][o]){if(o===s)return 0;o-=1}else if(l[0][o]1?i-1:0),o=1;o0){var o=Object.keys(n),l=s.default.find(o,(function(e){return t.isOS(e)}));if(l){var u=this.satisfies(n[l]);if(void 0!==u)return u}var c=s.default.find(o,(function(e){return t.isPlatform(e)}));if(c){var d=this.satisfies(n[c]);if(void 0!==d)return d}}if(a>0){var h=Object.keys(i),f=s.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},8703:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".AspectRatioSkeleton__wrapper{width:100%}.AspectRatioSkeleton__wrapper,.AspectRatioSkeleton__wrapper:empty{display:block}",""]),o.locals={wrapper:"AspectRatioSkeleton__wrapper"},t.A=o},3523:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".Root__wrapper{font-family:Tahoma,sans-serif;font-style:normal;font-weight:400;height:100%;left:0;letter-spacing:0;line-height:normal;position:absolute;text-shadow:none;top:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none}",""]),o.locals={wrapper:"Root__wrapper"},t.A=o},8691:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,"div.Tech__wrapper{box-sizing:border-box;left:0;overflow:hidden;position:absolute;right:0;top:0;width:100%}.vid_embed--is-fullscreen.vid_embed--is-fullscreen-fallback div.Tech__wrapper{background:#000;border-radius:0!important;bottom:0;left:0;margin:0;position:fixed;right:0;top:0;z-index:10000000}div.Tech__wrapper *{box-sizing:inherit}video.Tech__video{height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}",""]),o.locals={wrapper:"Tech__wrapper",video:"Tech__video"},t.A=o},6380:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".CallToAction__button{border:1px solid transparent;border-radius:2px;cursor:pointer;display:block;font-family:Tahoma,sans-serif;font-size:24px;font-style:normal;font-weight:700;left:50%;line-height:1.2;margin:0;padding:23px 30px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:background-color .15s cubic-bezier(.4,0,.2,1),transform .25s cubic-bezier(.4,0,.2,1);white-space:nowrap}.CallToAction__button,.CallToAction__button:focus,.CallToAction__button:hover{text-decoration:none}.vid_embed--large .CallToAction__button{font-size:18px;padding:18px 30px}.vid_embed--medium .CallToAction__button{font-size:15px;padding:15px 28px}.vid_embed--small .CallToAction__button,.vid_embed--tiny .CallToAction__button,.vid_embed--x-small .CallToAction__button{font-size:12px;padding:12px 20px}.CallToAction__button.CallToAction__on-top{position:absolute;top:0;transform:translate(-50%,calc(-100% - 50px))}.CallToAction__button.CallToAction__has-shadow{box-shadow:4px 4px 10px rgba(0,0,0,.5);text-shadow:1px 1px 1px rgba(0,0,0,.5)}",""]),o.locals={button:"CallToAction__button","on-top":"CallToAction__on-top",onTop:"CallToAction__on-top","has-shadow":"CallToAction__has-shadow",hasShadow:"CallToAction__has-shadow"},t.A=o},1808:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".CallToActionsManager__wrapper{position:relative}.CallToActionsManager__wrapper--fullscreen{left:0;position:absolute;right:0;top:100%}.CallToActionsManager__wrapper--expanded{height:200px}.vid_embed--large .CallToActionsManager__wrapper--expanded{height:125px}.vid_embed--medium .CallToActionsManager__wrapper--expanded{height:110px}.vid_embed--small .CallToActionsManager__wrapper--expanded,.vid_embed--tiny .CallToActionsManager__wrapper--expanded,.vid_embed--x-small .CallToActionsManager__wrapper--expanded{height:70px}",""]),o.locals={wrapper:"CallToActionsManager__wrapper","wrapper--fullscreen":"CallToActionsManager__wrapper--fullscreen",wrapperFullscreen:"CallToActionsManager__wrapper--fullscreen","wrapper--expanded":"CallToActionsManager__wrapper--expanded",wrapperExpanded:"CallToActionsManager__wrapper--expanded"},t.A=o},548:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".Captions__wrapper{bottom:30px;display:flex;font-family:Arial,sans-serif;font-size:23px;justify-content:center;left:0;padding:0 50px;pointer-events:none;position:absolute;right:0;text-align:center;transition:transform .25s cubic-bezier(.4,0,.2,1)}.Captions__wrapper--has-offset{transform:translateY(-20px)}.vid_embed--medium .Captions__wrapper{font-size:16px;padding:0 20px}.vid_embed--small .Captions__wrapper,.vid_embed--x-small .Captions__wrapper{font-size:12px;padding:0 10px}.vid_embed--tiny .Captions__wrapper{font-size:10px;padding:0 10px}.Captions__article{background:rgba(0,0,0,.55);color:#fff;display:inline-block;padding:5px 10px;white-space:pre-wrap}",""]),o.locals={wrapper:"Captions__wrapper","wrapper--has-offset":"Captions__wrapper--has-offset",wrapperHasOffset:"Captions__wrapper--has-offset",article:"Captions__article"},t.A=o},6862:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".Placeholder__wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;height:100%;left:0;margin:0;overflow:hidden;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.Placeholder__wrapper:empty{display:block}.Placeholder__wrapper.fade-enter{opacity:0}.Placeholder__wrapper.fade-enter-active{opacity:1;transition:opacity .1s ease}.Placeholder__wrapper.fade-exit{opacity:1}.Placeholder__wrapper.fade-exit-active{opacity:0;transition:opacity .1s ease}.Placeholder__image{-webkit-filter:blur(5px);filter:blur(5px);height:100%;-o-object-fit:contain;object-fit:contain;width:100%}",""]),o.locals={wrapper:"Placeholder__wrapper",image:"Placeholder__image"},t.A=o},5707:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".PlayToggleBoundary__wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;height:100%;left:0;margin:0;padding:0;position:absolute;top:0;width:100%}.PlayToggleBoundary__wrapper,.PlayToggleBoundary__wrapper:empty{display:flex}",""]),o.locals={wrapper:"PlayToggleBoundary__wrapper"},t.A=o},3364:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".RedirectCountdown__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;background:rgba(0,0,0,.88);border:0;cursor:pointer;cursor:default;display:flex;height:100%;justify-content:center;left:0;margin:0;padding:5%;position:absolute;top:0;width:100%}.RedirectCountdown__wrapper.fade-enter{opacity:0}.RedirectCountdown__wrapper.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.RedirectCountdown__wrapper.fade-exit{opacity:1}.RedirectCountdown__wrapper.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.RedirectCountdown__article{display:flex;justify-content:center}",""]),o.locals={wrapper:"RedirectCountdown__wrapper",article:"RedirectCountdown__article"},t.A=o},3130:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ResumePlay__article{display:flex;justify-content:center}.ResumePlay__title{display:inline-block;font-weight:700;line-height:1;text-align:center;white-space:nowrap}.ResumePlay__controls{align-items:center;display:flex;justify-content:space-between;margin:7.5% 0 0}.ResumePlay__button.ResumePlay__button{align-items:center;border:0;border-radius:0;cursor:pointer;display:flex;flex:none;font-family:Tahoma,sans-serif;font-weight:400;line-height:normal;margin:0;padding:0;text-align:left;text-decoration:none;text-transform:none;width:45%}.ResumePlay__button.ResumePlay__button,.ResumePlay__button.ResumePlay__button:focus,.ResumePlay__button.ResumePlay__button:hover{background-color:transparent;box-shadow:none;color:inherit}.ResumePlay__button.ResumePlay__button:focus,.ResumePlay__button.ResumePlay__button:hover{border-color:transparent;border-radius:0;text-shadow:none}.ResumePlay__button.ResumePlay__button:focus{outline:none}.ResumePlay__button__icon{flex:none;width:22.5%}.ResumePlay__button__title{display:inline-block;flex:auto;font-family:Tahoma,sans-serif;font-weight:700;overflow:hidden;padding:5% 0;white-space:nowrap}.ResumePlay__button__article{margin:0 10% 0 5%}.ResumePlay__button__text{line-height:1;text-align:left}.ResumePlay__wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;background:rgba(0,0,0,.88);border:0;cursor:pointer;cursor:default;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;margin:0;padding:5%;position:absolute;top:0;width:100%}.ResumePlay__wrapper.fade-enter{opacity:0}.ResumePlay__wrapper.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.ResumePlay__wrapper.fade-exit{opacity:1}.ResumePlay__wrapper.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.ResumePlay__wrapper--portrait .ResumePlay__title{line-height:1.2}.ResumePlay__wrapper--portrait .ResumePlay__controls{flex-direction:column;margin:12% 0 0}.ResumePlay__wrapper--portrait .ResumePlay__button{width:62%}.ResumePlay__wrapper--portrait .ResumePlay__button:first-child{padding-bottom:6.5%}.ResumePlay__wrapper--portrait .ResumePlay__button__icon{width:29%}.ResumePlay__wrapper--portrait .ResumePlay__button__article{margin:0 0 0 9%}.ResumePlay__wrapper--portrait .ResumePlay__button__text{line-height:1.15}",""]),o.locals={article:"ResumePlay__article",title:"ResumePlay__title",controls:"ResumePlay__controls",button:"ResumePlay__button",button__icon:"ResumePlay__button__icon",buttonIcon:"ResumePlay__button__icon",button__title:"ResumePlay__button__title",buttonTitle:"ResumePlay__button__title",button__article:"ResumePlay__button__article",buttonArticle:"ResumePlay__button__article",button__text:"ResumePlay__button__text",buttonText:"ResumePlay__button__text",wrapper:"ResumePlay__wrapper","wrapper--portrait":"ResumePlay__wrapper--portrait",wrapperPortrait:"ResumePlay__wrapper--portrait"},t.A=o},6167:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".Thumbnail__wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;height:100%;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.Thumbnail__wrapper.fade-enter{opacity:0}.Thumbnail__wrapper.fade-enter-active{opacity:1;transition:opacity .3s cubic-bezier(.4,0,.2,1)}.Thumbnail__wrapper.fade-exit{opacity:1}.Thumbnail__wrapper.fade-exit-active{opacity:0;transition:opacity .3s cubic-bezier(.4,0,.2,1)}.Thumbnail__video{height:100%;left:0;position:absolute;top:0;transition:opacity .3s cubic-bezier(.4,0,.2,1);width:100%}.Thumbnail__video--stretched{-o-object-fit:fill;object-fit:fill}.Thumbnail__video--hidden{opacity:0}.Thumbnail__poster{background:no-repeat 50% 50%/contain;height:100%;left:0;position:absolute;top:0;width:100%}.Thumbnail__poster:empty{display:block}.Thumbnail__poster--hidden{display:none}.Thumbnail__poster--stretched{background-size:100% 100%}.vid_embed--is-fullscreen .Thumbnail__poster--stretched{background-size:contain}",""]),o.locals={wrapper:"Thumbnail__wrapper",video:"Thumbnail__video","video--stretched":"Thumbnail__video--stretched",videoStretched:"Thumbnail__video--stretched","video--hidden":"Thumbnail__video--hidden",videoHidden:"Thumbnail__video--hidden",poster:"Thumbnail__poster","poster--hidden":"Thumbnail__poster--hidden",posterHidden:"Thumbnail__poster--hidden","poster--stretched":"Thumbnail__poster--stretched",posterStretched:"Thumbnail__poster--stretched"},t.A=o},1354:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ControlBar__wrapper{align-items:center;bottom:0;display:flex;height:40px;justify-content:space-between;left:0;opacity:1;position:absolute;touch-action:manipulation;transition:opacity .25s cubic-bezier(.4,0,.2,1);width:100%}.ControlBar__wrapper--hidden{opacity:0;pointer-events:none}.ControlBar__block{align-items:center;display:flex;flex:none;height:100%;margin:0}.ControlBar__block--stretched{flex:auto}",""]),o.locals={wrapper:"ControlBar__wrapper","wrapper--hidden":"ControlBar__wrapper--hidden",wrapperHidden:"ControlBar__wrapper--hidden",block:"ControlBar__block","block--stretched":"ControlBar__block--stretched",blockStretched:"ControlBar__block--stretched"},t.A=o},2649:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".LoadingIndicator__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;display:flex;height:100%;justify-content:center;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.LoadingIndicator__wrapper.fade-enter{opacity:0}.LoadingIndicator__wrapper.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.LoadingIndicator__wrapper.fade-exit{opacity:1}.LoadingIndicator__wrapper.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}@keyframes LoadingIndicator__rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes LoadingIndicator__dash{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:100px,200px;stroke-dashoffset:-125px}}.LoadingIndicator__progress{width:8%}.LoadingIndicator__circular{animation:LoadingIndicator__rotate 1.5s linear infinite}.LoadingIndicator__circle{stroke-dasharray:80px,200px;stroke-dashoffset:0;animation:LoadingIndicator__dash 1.5s cubic-bezier(.4,0,.2,1) infinite}",""]),o.locals={wrapper:"LoadingIndicator__wrapper",progress:"LoadingIndicator__progress",circular:"LoadingIndicator__circular",rotate:"LoadingIndicator__rotate",circle:"LoadingIndicator__circle",dash:"LoadingIndicator__dash"},t.A=o},8196:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".AutoPlay__wrapper{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;height:100%;left:0;margin:0;overflow:hidden;padding:0;position:absolute;text-align:center;top:0;width:100%}.AutoPlay__wrapper.fade-enter{opacity:0}.AutoPlay__wrapper.fade-enter-active{opacity:1;transition:opacity .3s cubic-bezier(.4,0,.2,1)}.AutoPlay__wrapper.fade-exit{opacity:1}.AutoPlay__wrapper.fade-exit-active{opacity:0;transition:opacity .3s cubic-bezier(.4,0,.2,1)}",""]),o.locals={wrapper:"AutoPlay__wrapper"},t.A=o},1745:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".BigControls__button.BigControls__button{border:0;border-radius:0;cursor:pointer;font-family:Tahoma,sans-serif;font-weight:400;line-height:normal;margin:0;overflow:visible;padding:0;pointer-events:auto;position:relative;text-decoration:none;text-transform:none}.BigControls__button.BigControls__button,.BigControls__button.BigControls__button:focus,.BigControls__button.BigControls__button:hover{background-color:transparent;box-shadow:none;color:inherit}.BigControls__button.BigControls__button:focus,.BigControls__button.BigControls__button:hover{border-color:transparent;border-radius:0;text-shadow:none}.BigControls__button.BigControls__button:focus{outline:none}.BigControls__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;display:flex;height:100%;justify-content:space-evenly;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;touch-action:manipulation;transition:opacity .3s ease-in-out;width:100%}.BigControls__wrapper--disabled{transition:none}.BigControls__wrapper--landscape .BigControls__button{width:12%}.BigControls__wrapper--landscape .BigControls__button--secondary{width:8.5%}.vid_embed--small .BigControls__wrapper--landscape .BigControls__button,.vid_embed--tiny .BigControls__wrapper--landscape .BigControls__button,.vid_embed--x-small .BigControls__wrapper--landscape .BigControls__button{width:16%}.vid_embed--small .BigControls__wrapper--landscape .BigControls__button--secondary,.vid_embed--tiny .BigControls__wrapper--landscape .BigControls__button--secondary,.vid_embed--x-small .BigControls__wrapper--landscape .BigControls__button--secondary{width:12%}.BigControls__wrapper--portrait .BigControls__button,.BigControls__wrapper--square .BigControls__button{width:21%}.BigControls__wrapper--portrait .BigControls__button--secondary,.BigControls__wrapper--square .BigControls__button--secondary{width:15%}.BigControls__wrapper--hidden{opacity:0}.BigControls__wrapper--hidden .BigControls__button{pointer-events:none}.BigControls__icon{display:block;height:auto}.BigControls__icon,.BigControls__pulse{border-radius:50%;width:100%}.BigControls__pulse{animation:BigControls__pulse 2s 1s infinite;box-shadow:0 0 0;height:100%;left:0;opacity:.85;position:absolute;top:0}.BigControls__pulse:empty{display:block}@keyframes BigControls__pulse{0%{box-shadow:0 0 0 0 currentcolor;opacity:.85}70%{box-shadow:0 0 0 20px currentcolor;opacity:0}to{box-shadow:0 0 0 0 currentcolor;opacity:0}}",""]),o.locals={button:"BigControls__button",wrapper:"BigControls__wrapper","wrapper--disabled":"BigControls__wrapper--disabled",wrapperDisabled:"BigControls__wrapper--disabled","wrapper--landscape":"BigControls__wrapper--landscape",wrapperLandscape:"BigControls__wrapper--landscape","button--secondary":"BigControls__button--secondary",buttonSecondary:"BigControls__button--secondary","wrapper--portrait":"BigControls__wrapper--portrait",wrapperPortrait:"BigControls__wrapper--portrait","wrapper--square":"BigControls__wrapper--square",wrapperSquare:"BigControls__wrapper--square","wrapper--hidden":"BigControls__wrapper--hidden",wrapperHidden:"BigControls__wrapper--hidden",icon:"BigControls__icon",pulse:"BigControls__pulse"},t.A=o},3127:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ErrorOverlay__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;cursor:default;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;margin:0;padding:0;position:absolute;text-align:center;top:0;width:100%}.ErrorOverlay__subtitle,.ErrorOverlay__title{pointer-events:none}.ErrorOverlay__title{font-weight:bolder;text-shadow:2px 2px 2px #000;white-space:pre-wrap}.ErrorOverlay__title--lg{font-size:40px;line-height:40px;margin-bottom:32px}.ErrorOverlay__title--md{font-size:36px;line-height:36px;margin-bottom:42px}.vid_embed--huge .ErrorOverlay__title--lg{font-size:107px;line-height:107px;margin-bottom:87px}.vid_embed--huge .ErrorOverlay__title--md{font-size:96px;line-height:96px;margin-bottom:100px}.vid_embed--xx-large .ErrorOverlay__title--lg{font-size:80px;line-height:80px;margin-bottom:65px}.vid_embed--xx-large .ErrorOverlay__title--md{font-size:72px;line-height:72px;margin-bottom:74px}.vid_embed--x-large .ErrorOverlay__title--lg{font-size:53px;line-height:53px;margin-bottom:44px}.vid_embed--x-large .ErrorOverlay__title--md{font-size:48px;line-height:48px;margin-bottom:52px}.vid_embed--medium .ErrorOverlay__title--lg{font-size:27px;line-height:27px;margin-bottom:15px}.vid_embed--medium .ErrorOverlay__title--md{font-size:24px;line-height:24px;margin-bottom:28px}.vid_embed--small .ErrorOverlay__title--lg,.vid_embed--tiny .ErrorOverlay__title--lg,.vid_embed--x-small .ErrorOverlay__title--lg{font-size:22px;line-height:22px;margin-bottom:15px}.vid_embed--small .ErrorOverlay__title--md,.vid_embed--tiny .ErrorOverlay__title--md,.vid_embed--x-small .ErrorOverlay__title--md{font-size:16px;line-height:16px;margin-bottom:18px}.ErrorOverlay__subtitle{font-size:18px;line-height:20px}.vid_embed--huge .ErrorOverlay__subtitle{font-size:48px;line-height:53px}.vid_embed--xx-large .ErrorOverlay__subtitle{font-size:36px;line-height:40px}.vid_embed--x-large .ErrorOverlay__subtitle{font-size:24px;line-height:27px}.vid_embed--medium .ErrorOverlay__subtitle{font-size:14px;line-height:16px}.vid_embed--small .ErrorOverlay__subtitle,.vid_embed--tiny .ErrorOverlay__subtitle,.vid_embed--x-small .ErrorOverlay__subtitle{font-size:12px;line-height:14px}.ErrorOverlay__link{color:inherit;pointer-events:auto;text-decoration:underline}.ErrorOverlay__link:hover{text-decoration:none}.ErrorOverlay__controls{align-items:center;display:flex;justify-content:space-between;max-width:500px;width:100%}.vid_embed--huge .ErrorOverlay__controls{max-width:1335px}.vid_embed--xx-large .ErrorOverlay__controls{max-width:1000px}.vid_embed--x-large .ErrorOverlay__controls{max-width:670px}.vid_embed--medium .ErrorOverlay__controls{max-width:335px}.vid_embed--small .ErrorOverlay__controls,.vid_embed--tiny .ErrorOverlay__controls,.vid_embed--x-small .ErrorOverlay__controls{max-width:260px}.ErrorOverlay__button.ErrorOverlay__button{align-items:center;border:0;border-radius:0;cursor:pointer;display:flex;font-family:Tahoma,sans-serif;font-weight:400;line-height:normal;margin:0;padding:0;text-decoration:none;text-shadow:2px 2px 2px #000;text-transform:none}.ErrorOverlay__button.ErrorOverlay__button,.ErrorOverlay__button.ErrorOverlay__button:focus,.ErrorOverlay__button.ErrorOverlay__button:hover{background-color:transparent;box-shadow:none;color:inherit}.ErrorOverlay__button.ErrorOverlay__button:focus,.ErrorOverlay__button.ErrorOverlay__button:hover{border-color:transparent;border-radius:0;text-shadow:none}.ErrorOverlay__button.ErrorOverlay__button:focus{outline:none}.ErrorOverlay__button__icon-wrapper{height:64px;margin-right:6px;width:64px}.ErrorOverlay__button__icon{display:block;height:100%;width:100%}.ErrorOverlay__button__title{font-family:Tahoma,sans-serif;font-size:21px;font-weight:700;line-height:21px;text-shadow:2px 2px 2px #000;white-space:nowrap}.vid_embed--huge .ErrorOverlay__button__title{font-size:56px;line-height:56px}.vid_embed--huge .ErrorOverlay__button__icon-wrapper{height:172px;margin-right:16px;width:172px}.vid_embed--xx-large .ErrorOverlay__button__title{font-size:42px;line-height:42px}.vid_embed--xx-large .ErrorOverlay__button__icon-wrapper{height:129px;margin-right:12px;width:129px}.vid_embed--x-large .ErrorOverlay__button__title{font-size:28px;line-height:28px}.vid_embed--x-large .ErrorOverlay__button__icon-wrapper{height:86px;margin-right:8px;width:86px}.vid_embed--medium .ErrorOverlay__button__title{font-size:14px;line-height:14px}.vid_embed--medium .ErrorOverlay__button__icon-wrapper{height:43px;margin-right:5px;width:43px}.vid_embed--small .ErrorOverlay__button__title,.vid_embed--tiny .ErrorOverlay__button__title,.vid_embed--x-small .ErrorOverlay__button__title{font-size:12px;line-height:12px}.vid_embed--small .ErrorOverlay__button__icon-wrapper,.vid_embed--tiny .ErrorOverlay__button__icon-wrapper,.vid_embed--x-small .ErrorOverlay__button__icon-wrapper{height:30px;margin-right:3px;width:30px}.ErrorOverlay__message{bottom:5px;font-size:.8em;left:3em;opacity:.5;position:absolute;right:3em;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.vid_embed--small .ErrorOverlay__message,.vid_embed--tiny .ErrorOverlay__message,.vid_embed--x-small .ErrorOverlay__message{font-size:.5em}",""]),o.locals={wrapper:"ErrorOverlay__wrapper",subtitle:"ErrorOverlay__subtitle",title:"ErrorOverlay__title","title--lg":"ErrorOverlay__title--lg",titleLg:"ErrorOverlay__title--lg","title--md":"ErrorOverlay__title--md",titleMd:"ErrorOverlay__title--md",link:"ErrorOverlay__link",controls:"ErrorOverlay__controls",button:"ErrorOverlay__button","button__icon-wrapper":"ErrorOverlay__button__icon-wrapper",buttonIconWrapper:"ErrorOverlay__button__icon-wrapper",button__icon:"ErrorOverlay__button__icon",buttonIcon:"ErrorOverlay__button__icon",button__title:"ErrorOverlay__button__title",buttonTitle:"ErrorOverlay__button__title",message:"ErrorOverlay__message"},t.A=o},6644:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ExpireOverlay__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;background:rgba(0,0,0,.88);border:0;cursor:pointer;cursor:default;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;margin:0;padding:5%;position:absolute;text-align:center;top:0;width:100%}.ExpireOverlay__wrapper--landscape .ExpireOverlay__icon-wrapper{height:auto;width:7.5%}.vid_embed--tiny .ExpireOverlay__wrapper--landscape .ExpireOverlay__icon-wrapper,.vid_embed--x-small .ExpireOverlay__wrapper--landscape .ExpireOverlay__icon-wrapper{width:10%}.ExpireOverlay__wrapper--landscape .ExpireOverlay__text-top{margin-top:5.5%}.ExpireOverlay__wrapper--landscape .ExpireOverlay__text-bottom{margin-top:5%}.ExpireOverlay__wrapper--portrait .ExpireOverlay__icon-wrapper{height:8.5%;width:auto}.ExpireOverlay__wrapper--portrait .ExpireOverlay__text-top{margin-top:14.5%}.ExpireOverlay__wrapper--portrait .ExpireOverlay__text-bottom{margin-top:13.5%}.ExpireOverlay__wrapper--square .ExpireOverlay__icon-wrapper{height:12%;width:auto}.ExpireOverlay__wrapper--square .ExpireOverlay__text-top{margin-top:11%}.ExpireOverlay__wrapper--square .ExpireOverlay__text-bottom{margin-top:10%}.ExpireOverlay__wrapper.fade-enter{opacity:0}.ExpireOverlay__wrapper.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.ExpireOverlay__wrapper.fade-exit{opacity:1}.ExpireOverlay__wrapper.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.ExpireOverlay__icon{height:100%;vertical-align:middle;width:100%}.ExpireOverlay__link.ExpireOverlay__link{color:inherit;text-decoration:underline}.ExpireOverlay__link.ExpireOverlay__link:hover,.ExpireOverlay__link.ExpireOverlay__link:visited{color:inherit;text-decoration:none}",""]),o.locals={wrapper:"ExpireOverlay__wrapper","wrapper--landscape":"ExpireOverlay__wrapper--landscape",wrapperLandscape:"ExpireOverlay__wrapper--landscape","icon-wrapper":"ExpireOverlay__icon-wrapper",iconWrapper:"ExpireOverlay__icon-wrapper","text-top":"ExpireOverlay__text-top",textTop:"ExpireOverlay__text-top","text-bottom":"ExpireOverlay__text-bottom",textBottom:"ExpireOverlay__text-bottom","wrapper--portrait":"ExpireOverlay__wrapper--portrait",wrapperPortrait:"ExpireOverlay__wrapper--portrait","wrapper--square":"ExpireOverlay__wrapper--square",wrapperSquare:"ExpireOverlay__wrapper--square",icon:"ExpireOverlay__icon",link:"ExpireOverlay__link"},t.A=o},4964:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".PlayGate__title{font-weight:700;line-height:1.5;text-align:center}.PlayGate__title__wrapper{display:flex;justify-content:center;margin:0 0 2%;width:100%}.PlayGate__form{display:flex;flex-direction:column;width:43%}input:not([type=button]):not([type=submit]).PlayGate__input{background-color:#fff;border:1px solid #cdcfd2;box-shadow:0 2px 5px 0 rgba(0,89,255,.15);color:#000;font-family:Tahoma,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-height:normal;padding:0 0 0 5%;text-decoration:none;text-transform:none;transition:background-color .2s cubic-bezier(.4,0,.2,1);width:100%}input:not([type=button]):not([type=submit]).PlayGate__input::-webkit-input-placeholder{color:rgba(0,0,0,.5)}input:not([type=button]):not([type=submit]).PlayGate__input::-moz-placeholder{color:rgba(0,0,0,.5)}input:not([type=button]):not([type=submit]).PlayGate__input:-ms-input-placeholder{color:rgba(0,0,0,.5)}input:not([type=button]):not([type=submit]).PlayGate__input::placeholder{color:rgba(0,0,0,.5)}input:not([type=button]):not([type=submit]).PlayGate__input:focus{background-color:#fff;border:none;outline:none}input:not([type=button]):not([type=submit]).PlayGate__input:focus::-webkit-input-placeholder{color:transparent}input:not([type=button]):not([type=submit]).PlayGate__input:focus::-moz-placeholder{color:transparent}input:not([type=button]):not([type=submit]).PlayGate__input:focus:-ms-input-placeholder{color:transparent}input:not([type=button]):not([type=submit]).PlayGate__input:focus::placeholder{color:transparent}input:not([type=button]):not([type=submit]).PlayGate__input:-webkit-autofill{-webkit-background-clip:border-box!important;background-clip:border-box!important}input:not([type=button]):not([type=submit]).PlayGate__input--invalid{background-color:#ffebee;border:2px solid red}input:not([type=button]):not([type=submit]).PlayGate__input--invalid:focus{border:2px solid red}input:not([type=button]):not([type=submit]).PlayGate__input+input:not([type=button]):not([type=submit]).PlayGate__input{margin:3% 0 0}.PlayGate__button.PlayGate__button{align-items:center;background-color:transparent;border:0;border-radius:0;box-shadow:none;box-shadow:0 2px 5px 0 #000,0 2px 5px 0 gray;color:inherit;color:#fff;cursor:pointer;display:flex;font-family:Tahoma,sans-serif;font-weight:400;justify-content:center;line-height:normal;margin:3% 0 0;padding:0 2%;text-decoration:none;text-transform:none;width:100%}.PlayGate__button.PlayGate__button:focus,.PlayGate__button.PlayGate__button:hover{background-color:transparent;border-color:transparent;border-radius:0;box-shadow:none;color:inherit;text-shadow:none}.PlayGate__button.PlayGate__button:focus{outline:none}.PlayGate__note{color:#fff;font-style:italic;font-weight:300;text-align:center}.PlayGate__note__wrapper{display:flex;justify-content:center;margin:2.5% 0 0;padding:0 10%;width:100%}.PlayGate__skip.PlayGate__skip{align-items:center;align-self:flex-end;border:0;border-radius:0;cursor:pointer;display:flex;font-family:Tahoma,sans-serif;font-weight:400;line-height:normal;margin:0;padding:0;text-decoration:none;text-transform:none}.PlayGate__skip.PlayGate__skip,.PlayGate__skip.PlayGate__skip:focus,.PlayGate__skip.PlayGate__skip:hover{background-color:transparent;box-shadow:none;color:inherit}.PlayGate__skip.PlayGate__skip:focus,.PlayGate__skip.PlayGate__skip:hover{border-color:transparent;border-radius:0;text-shadow:none}.PlayGate__skip.PlayGate__skip:focus{outline:none}.PlayGate__skip__title{color:#fff;font-weight:300;white-space:nowrap}.PlayGate__skip__icon{flex:none;margin:0 0 0 5%}.PlayGate__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;background:rgba(0,0,0,.88);border:0;cursor:pointer;cursor:default;display:flex;height:100%;justify-content:center;left:0;margin:0;padding:0;position:absolute;top:0;width:100%}.PlayGate__wrapper.fade-enter{opacity:0}.PlayGate__wrapper.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.PlayGate__wrapper.fade-exit{opacity:1}.PlayGate__wrapper.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.PlayGate__wrapperOuter{flex-direction:column;height:100%;justify-content:space-between;padding:3.5% 5%}.PlayGate__wrapperInner,.PlayGate__wrapperOuter{align-items:center;display:flex;width:100%}.PlayGate__wrapperInner{flex:1 1 auto;flex-direction:column;justify-content:center}.PlayGate__wrapper--portrait .PlayGate__form,.PlayGate__wrapper--square .PlayGate__form{width:100%}.PlayGate__wrapper--portrait .PlayGate__note__wrapper,.PlayGate__wrapper--square .PlayGate__note__wrapper{padding:0}.PlayGate__wrapper--portrait .PlayGate__skip,.PlayGate__wrapper--square .PlayGate__skip{align-self:center}.PlayGate__wrapper--portrait .PlayGate__wrapperOuter{padding:15% 7.5%}.PlayGate__wrapper--portrait .PlayGate__title__wrapper{margin:0 0 15%}.PlayGate__wrapper--portrait .PlayGate__note__wrapper{margin:15% 0 0}.PlayGate__wrapper--portrait.PlayGate__wrapperAspect3x4 .PlayGate__wrapperOuter{padding:7.5%}.PlayGate__wrapper--portrait.PlayGate__wrapperAspect3x4 .PlayGate__title__wrapper{margin:0 0 7.5%}.PlayGate__wrapper--portrait.PlayGate__wrapperAspect3x4 .PlayGate__note__wrapper{margin:7.5% 0 0}.PlayGate__wrapper--portrait.PlayGate__wrapperAspect3x4 .PlayGate__skip{margin:1% 0 0}.PlayGate__wrapper--square .PlayGate__wrapperOuter{padding:7.5%}.PlayGate__wrapper--square .PlayGate__title__wrapper{margin:0 0 7.5%}.PlayGate__wrapper--square .PlayGate__note__wrapper{margin:7.5% 0 0}.PlayGate__wrapperAspect4x3 .PlayGate__wrapperOuter{padding:7.5% 5%}",""]),o.locals={title:"PlayGate__title",title__wrapper:"PlayGate__title__wrapper",titleWrapper:"PlayGate__title__wrapper",form:"PlayGate__form",input:"PlayGate__input","input--invalid":"PlayGate__input--invalid",inputInvalid:"PlayGate__input--invalid",button:"PlayGate__button",note:"PlayGate__note",note__wrapper:"PlayGate__note__wrapper",noteWrapper:"PlayGate__note__wrapper",skip:"PlayGate__skip",skip__title:"PlayGate__skip__title",skipTitle:"PlayGate__skip__title",skip__icon:"PlayGate__skip__icon",skipIcon:"PlayGate__skip__icon",wrapper:"PlayGate__wrapper",wrapperOuter:"PlayGate__wrapperOuter",wrapperInner:"PlayGate__wrapperInner","wrapper--portrait":"PlayGate__wrapper--portrait",wrapperPortrait:"PlayGate__wrapper--portrait","wrapper--square":"PlayGate__wrapper--square",wrapperSquare:"PlayGate__wrapper--square",wrapperAspect3x4:"PlayGate__wrapperAspect3x4",wrapperAspect3X4:"PlayGate__wrapperAspect3x4",wrapperAspect4x3:"PlayGate__wrapperAspect4x3",wrapperAspect4X3:"PlayGate__wrapperAspect4x3"},t.A=o},5358:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".SmartVidsClickableArea__funnel-clickable-area{cursor:pointer;position:absolute;transition:background-color .25s cubic-bezier(.4,0,.2,1)}",""]),o.locals={"funnel-clickable-area":"SmartVidsClickableArea__funnel-clickable-area",funnelClickableArea:"SmartVidsClickableArea__funnel-clickable-area"},t.A=o},5469:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".SmartVidsCountdownTimer__countdown-timer{position:absolute}.SmartVidsCountdownTimer__countdown-timer--progress-bar{animation-name:SmartVidsCountdownTimer__fill-progress-bar;animation-timing-function:ease-in;background-color:hsla(0,0%,100%,.5);height:10px;left:0;top:0}.SmartVidsCountdownTimer__countdown-timer--clock,.SmartVidsCountdownTimer__countdown-timer--seconds{left:60px;top:30px}.SmartVidsCountdownTimer__countdown-timer--seconds{color:#fff;font-size:22px;font-weight:400;line-height:54px}.SmartVidsCountdownTimer__countdown-timer--clock{height:54px;width:54px}.SmartVidsCountdownTimer__countdown-timer--clock svg{border-radius:50%;height:auto;transform:rotate(-90deg);width:100%}.SmartVidsCountdownTimer__countdown-timer--clock circle{fill:transparent;stroke:#fff;stroke-dasharray:0 78;stroke-width:25;animation-name:SmartVidsCountdownTimer__fill-clock;animation-timing-function:ease-in}.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--xx-large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--xx-large .SmartVidsCountdownTimer__countdown-timer--seconds{left:48px;top:24px}.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--progress-bar,.vid_embed--xx-large .SmartVidsCountdownTimer__countdown-timer--progress-bar{height:8px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--xx-large .SmartVidsCountdownTimer__countdown-timer--seconds{font-size:18px;line-height:46px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--xx-large .SmartVidsCountdownTimer__countdown-timer--clock{height:46px;width:46px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{font-size:16px;line-height:40px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock{height:40px;width:40px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--progress-bar,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--progress-bar{height:6px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{left:16px;top:16px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{font-size:14px;line-height:36px}.vid_embed--large .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock{height:36px;width:36px}.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{left:8px;top:8px}.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{font-size:12px;line-height:24px}.vid_embed--medium .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock{height:24px;width:24px}.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--progress-bar,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--progress-bar,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--progress-bar{height:4px}.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{left:6px;top:6px}.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--seconds,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--seconds{font-size:12px;line-height:20px}.vid_embed--small .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--tiny .SmartVidsCountdownTimer__countdown-timer--clock,.vid_embed--x-small .SmartVidsCountdownTimer__countdown-timer--clock{height:20px;width:20px}@keyframes SmartVidsCountdownTimer__fill-progress-bar{0%{width:0}to{width:100%}}@keyframes SmartVidsCountdownTimer__fill-clock{to{stroke-dasharray:78 78}}",""]),o.locals={"countdown-timer":"SmartVidsCountdownTimer__countdown-timer",countdownTimer:"SmartVidsCountdownTimer__countdown-timer","countdown-timer--progress-bar":"SmartVidsCountdownTimer__countdown-timer--progress-bar",countdownTimerProgressBar:"SmartVidsCountdownTimer__countdown-timer--progress-bar","fill-progress-bar":"SmartVidsCountdownTimer__fill-progress-bar",fillProgressBar:"SmartVidsCountdownTimer__fill-progress-bar","countdown-timer--clock":"SmartVidsCountdownTimer__countdown-timer--clock",countdownTimerClock:"SmartVidsCountdownTimer__countdown-timer--clock","countdown-timer--seconds":"SmartVidsCountdownTimer__countdown-timer--seconds",countdownTimerSeconds:"SmartVidsCountdownTimer__countdown-timer--seconds","fill-clock":"SmartVidsCountdownTimer__fill-clock",fillClock:"SmartVidsCountdownTimer__fill-clock"},t.A=o},1468:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".SmartVidsOption__funnel-option{border:0 solid hsla(0,0%,100%,.3);cursor:pointer;line-height:1.35;transition:background-color .25s cubic-bezier(.4,0,.2,1),color .25s cubic-bezier(.4,0,.2,1)}.SmartVidsOption__funnel-option-inner{align-items:center;display:flex;height:100%;justify-content:center}",""]),o.locals={"funnel-option":"SmartVidsOption__funnel-option",funnelOption:"SmartVidsOption__funnel-option","funnel-option-inner":"SmartVidsOption__funnel-option-inner",funnelOptionInner:"SmartVidsOption__funnel-option-inner"},t.A=o},8823:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a),s=n(1468),l=n(5786),u=o()(i());u.i(s.A,"",!0),u.i(l.A,"",!0),u.push([e.id,".SmartVidsOverlay__funnel-headline{color:#fff;line-height:1.21;margin:auto 0}.SmartVidsOverlay__funnel-option-group{display:flex;flex-wrap:wrap;width:100%}.SmartVidsOverlay__wrapper{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;cursor:pointer;display:flex;flex-direction:column;font-weight:700;height:100%;justify-content:flex-end;left:0;margin:0;padding:0;position:absolute;text-align:center;top:0;width:100%}.SmartVidsOverlay__wrapper.SmartVidsOverlay__has-background{background:rgba(0,0,0,.6)}.SmartVidsOverlay__wrapper.fade-enter{opacity:0}.SmartVidsOverlay__wrapper.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.SmartVidsOverlay__wrapper.fade-exit{opacity:1}.SmartVidsOverlay__wrapper.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:68px;padding:20px 8%}.SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:200px;padding:46px}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-1-options ."+s.A.locals["funnel-option"]+"{border-bottom-width:1px;border-top-width:1px;flex:0 0 100%;max-width:100%}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+",.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+"{flex:0 0 50%;max-width:50%}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+":first-of-type,.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+":nth-of-type(2),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+":first-of-type,.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+":nth-of-type(2){border-bottom-width:1px;border-top-width:1px}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+":nth-of-type(3),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+":nth-of-type(4),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+":nth-of-type(3),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+":nth-of-type(4){border-bottom-width:1px}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+":nth-of-type(2),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-2-options ."+s.A.locals["funnel-option"]+":nth-of-type(4),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+":nth-of-type(2),.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-4-options ."+s.A.locals["funnel-option"]+":nth-of-type(4){border-left-width:1px}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+"{border-bottom-width:1px;border-top-width:1px;flex:0 0 33.33%;max-width:33.33%}.SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+":not(:first-of-type){border-left-width:1px}.SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:84px;padding:20px 10%}.SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{flex:0 0 100%;height:160px;max-width:100%;padding:48px}.SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+":first-of-type,.SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+":first-of-type{border-bottom-width:1px;border-top-width:1px}.SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+":not(:first-of-type),.SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+":not(:first-of-type){border-bottom-width:1px}.vid_embed--large .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-large .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--xx-large .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:54px;padding:15px 8%}.vid_embed--large .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-large .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--xx-large .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:140px;padding:37px}.vid_embed--large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--xx-large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline{font-size:76px}.vid_embed--large .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-large .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--xx-large .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+"{height:140px;padding:40px}.vid_embed--large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--xx-large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:70px}.vid_embed--large .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-large .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--xx-large .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{height:130px;padding:38px}.vid_embed--large .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-large .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:35px;padding:5px 8%}.vid_embed--large .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-large .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:95px;padding:22px}.vid_embed--large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline{font-size:68px}.vid_embed--large .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-large .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+"{height:126px;padding:36px 40px}.vid_embed--large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:44px;padding:15px 8%}.vid_embed--large .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-large .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{height:95px;padding:25px}.vid_embed--large .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:26px;line-height:1.15;padding:5px 6%}.vid_embed--large .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:70px;padding:15px}.vid_embed--large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{line-height:1.15;padding:15px 8%}.vid_embed--large .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline{font-size:52px}.vid_embed--large .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+"{height:90px;padding:28px}.vid_embed--large .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:33px}.vid_embed--large .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--medium .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{height:68px;padding:18px}.vid_embed--medium .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:16px;line-height:1.1;padding:5px 20px}.vid_embed--medium .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:50px;line-height:1.3;padding:10px}.vid_embed--medium .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+"{height:75px}.vid_embed--medium .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--medium .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{line-height:1.1;padding:10px 8%}.vid_embed--medium .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline{font-size:36px}.vid_embed--medium .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+"{height:60px;padding:16px}.vid_embed--medium .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:22px}.vid_embed--medium .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--tiny .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{height:50px;padding:10px}.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{line-height:1.1}.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:14px;padding:3px 10px}.vid_embed--small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:42px;padding:7px}.vid_embed--small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+"{height:60px}.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{line-height:1.1;padding:10px 6%}.vid_embed--small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline{font-size:26px}.vid_embed--small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+"{height:50px;padding:10px}.vid_embed--small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline,.vid_embed--x-small .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:17px}.vid_embed--small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+",.vid_embed--x-small .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{height:42px;padding:7px}.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-headline{font-size:10px;line-height:1.05;padding:0 5px}.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape ."+s.A.locals["funnel-option"]+"{height:40px;line-height:1.1;padding:6px}.vid_embed--tiny .SmartVidsOverlay__wrapper--landscape .SmartVidsOverlay__funnel-option-group.SmartVidsOverlay__has-3-options ."+s.A.locals["funnel-option"]+"{height:56px}.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait .SmartVidsOverlay__funnel-headline{font-size:21px;line-height:1.1;padding:10px 5%}.vid_embed--tiny .SmartVidsOverlay__wrapper--portrait ."+s.A.locals["funnel-option"]+"{height:45px;padding:6px}.vid_embed--tiny .SmartVidsOverlay__wrapper--square .SmartVidsOverlay__funnel-headline{font-size:13px;line-height:1.05;padding:0 5px}.vid_embed--tiny .SmartVidsOverlay__wrapper--square ."+s.A.locals["funnel-option"]+"{height:40px;line-height:1.1;padding:5px}."+l.A.locals["funnel-replay-button"]+"{font-size:20px;padding:6px}.SmartVidsOverlay__funnel-replay-button-icon{align-items:center;display:flex;height:25px;margin-right:18px;width:22px}.SmartVidsOverlay__funnel-replay-buttons{align-items:flex-end;display:flex;flex-direction:column;position:absolute;right:25px;top:19px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-large .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--xx-large .SmartVidsOverlay__funnel-replay-buttons{right:21px;top:15px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-large .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--xx-large .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+"{font-size:16px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-large .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--xx-large .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon{height:21px;margin-right:14px;width:18px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-large .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons{right:19px;top:13px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-large .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+"{font-size:14px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-large .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon{height:19px;margin-right:12px;width:16px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons{right:11px;top:9px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+"{font-size:14px;padding:4px}.vid_embed--large .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon{height:16px;margin-right:8px;width:14px}.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons{right:8px;top:6px}.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+"{font-size:12px;padding:2px}.vid_embed--medium .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon{height:14px;margin-right:6px;width:12px}.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons{align-items:normal;display:flex;flex-direction:row;right:4px;top:4px}.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+",.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button"]+"{padding:4px}.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon,.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons .SmartVidsOverlay__funnel-replay-button-icon{height:18px;margin-right:0;width:16px}.vid_embed--small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button-text"]+",.vid_embed--tiny .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button-text"]+",.vid_embed--x-small .SmartVidsOverlay__funnel-replay-buttons ."+l.A.locals["funnel-replay-button-text"]+"{display:none}",""]),u.locals={"funnel-option":""+s.A.locals["funnel-option"],funnelOption:""+s.A.locals["funnel-option"],"funnel-replay-button":""+l.A.locals["funnel-replay-button"],funnelReplayButton:""+l.A.locals["funnel-replay-button"],"funnel-replay-button-text":""+l.A.locals["funnel-replay-button-text"],funnelReplayButtonText:""+l.A.locals["funnel-replay-button-text"],"funnel-headline":"SmartVidsOverlay__funnel-headline",funnelHeadline:"SmartVidsOverlay__funnel-headline","funnel-option-group":"SmartVidsOverlay__funnel-option-group",funnelOptionGroup:"SmartVidsOverlay__funnel-option-group",wrapper:"SmartVidsOverlay__wrapper","has-background":"SmartVidsOverlay__has-background",hasBackground:"SmartVidsOverlay__has-background","wrapper--landscape":"SmartVidsOverlay__wrapper--landscape",wrapperLandscape:"SmartVidsOverlay__wrapper--landscape","has-1-options":"SmartVidsOverlay__has-1-options",has1Options:"SmartVidsOverlay__has-1-options","has-2-options":"SmartVidsOverlay__has-2-options",has2Options:"SmartVidsOverlay__has-2-options","has-4-options":"SmartVidsOverlay__has-4-options",has4Options:"SmartVidsOverlay__has-4-options","has-3-options":"SmartVidsOverlay__has-3-options",has3Options:"SmartVidsOverlay__has-3-options","wrapper--portrait":"SmartVidsOverlay__wrapper--portrait",wrapperPortrait:"SmartVidsOverlay__wrapper--portrait","wrapper--square":"SmartVidsOverlay__wrapper--square",wrapperSquare:"SmartVidsOverlay__wrapper--square","funnel-replay-button-icon":"SmartVidsOverlay__funnel-replay-button-icon",funnelReplayButtonIcon:"SmartVidsOverlay__funnel-replay-button-icon","funnel-replay-buttons":"SmartVidsOverlay__funnel-replay-buttons",funnelReplayButtons:"SmartVidsOverlay__funnel-replay-buttons"},t.A=u},5786:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".SmartVidsReplayButton__funnel-replay-button{align-items:center;cursor:pointer;display:flex;font-weight:400;line-height:1.33}.SmartVidsReplayButton__funnel-replay-button-text{color:inherit}",""]),o.locals={"funnel-replay-button":"SmartVidsReplayButton__funnel-replay-button",funnelReplayButton:"SmartVidsReplayButton__funnel-replay-button","funnel-replay-button-text":"SmartVidsReplayButton__funnel-replay-button-text",funnelReplayButtonText:"SmartVidsReplayButton__funnel-replay-button-text"},t.A=o},588:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".AutoPlayBox__wrapper{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.AutoPlayBox__box{border:2px solid #fff;border-radius:4px;box-shadow:-1px 3px 17px 3px rgba(0,0,0,.75);display:block;position:relative;transition:transform .25s cubic-bezier(.4,0,.2,1)}.vid_embed--no-shadow .AutoPlayBox__box{box-shadow:none!important}.vid_embed--landscape .AutoPlayBox__box--has-offset{transform:translateY(-20px)}.AutoPlayBox__box .AutoPlayBox__content{align-items:center;display:flex;flex-direction:column;justify-content:center;min-height:100%}.AutoPlayBox__box .AutoPlayBox__heading{margin:10% 0 0;padding:0 10%;white-space:pre-wrap;width:100%}.AutoPlayBox__box .AutoPlayBox__icon{display:block;height:auto;width:25%}@keyframes AutoPlayBox__blink{0%{opacity:0}33%{opacity:1}66%{opacity:1}to{opacity:0}}.AutoPlayBox__box .AutoPlayBox__icon__blink{animation:AutoPlayBox__blink 2s infinite;opacity:0}.AutoPlayBox__box .AutoPlayBox__icon__blink:nth-child(2){animation-delay:.3s}.AutoPlayBox__box .AutoPlayBox__icon__blink:nth-child(3){animation-delay:.6s}.AutoPlayBox__box--stretched .AutoPlayBox__icon{width:15%}.AutoPlayBox__box--stretched .AutoPlayBox__heading{margin-top:5%;padding:0 8%}.AutoPlayBox__box--portrait.AutoPlayBox__box--stretched .AutoPlayBox__icon{width:20%}.AutoPlayBox__box--portrait.AutoPlayBox__box--stretched .AutoPlayBox__heading{margin-top:8%}",""]),o.locals={wrapper:"AutoPlayBox__wrapper",box:"AutoPlayBox__box","box--has-offset":"AutoPlayBox__box--has-offset",boxHasOffset:"AutoPlayBox__box--has-offset",content:"AutoPlayBox__content",heading:"AutoPlayBox__heading",icon:"AutoPlayBox__icon",icon__blink:"AutoPlayBox__icon__blink",iconBlink:"AutoPlayBox__icon__blink",blink:"AutoPlayBox__blink","box--stretched":"AutoPlayBox__box--stretched",boxStretched:"AutoPlayBox__box--stretched","box--portrait":"AutoPlayBox__box--portrait",boxPortrait:"AutoPlayBox__box--portrait"},t.A=o},5913:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".AutoPlayButton__wrapper{align-items:flex-start;display:flex;height:100%;justify-content:flex-start;padding:25px;width:100%}.vid_embed--large .AutoPlayButton__wrapper{padding:20px}.vid_embed--medium .AutoPlayButton__wrapper,.vid_embed--small .AutoPlayButton__wrapper{padding:15px}.vid_embed--tiny .AutoPlayButton__wrapper,.vid_embed--x-small .AutoPlayButton__wrapper{padding:10px}.AutoPlayButton__button{border-radius:4px;padding:14px}.vid_embed--small .AutoPlayButton__button{padding:12px}.vid_embed--tiny .AutoPlayButton__button,.vid_embed--x-small .AutoPlayButton__button{padding:10px}.AutoPlayButton__title{display:table-caption;font-size:16px;font-weight:700;line-height:1.21;margin-bottom:12px;text-align:center}.vid_embed--large .AutoPlayButton__title,.vid_embed--medium .AutoPlayButton__title{font-size:14px}.vid_embed--small .AutoPlayButton__title{font-size:12px;margin-bottom:6px}.vid_embed--tiny .AutoPlayButton__title,.vid_embed--x-small .AutoPlayButton__title{font-size:11px;margin-bottom:5px}.AutoPlayButton__icon{display:block;height:24px;margin:0 auto;width:auto}.vid_embed--tiny .AutoPlayButton__icon,.vid_embed--x-small .AutoPlayButton__icon{height:18px}@keyframes AutoPlayButton__blink{0%{opacity:0}33%{opacity:1}66%{opacity:1}to{opacity:0}}.AutoPlayButton__icon__blink{animation:AutoPlayButton__blink 2s infinite;opacity:0}.AutoPlayButton__icon__blink:nth-child(2){animation-delay:.3s}.AutoPlayButton__icon__blink:nth-child(3){animation-delay:.6s}",""]),o.locals={wrapper:"AutoPlayButton__wrapper",button:"AutoPlayButton__button",title:"AutoPlayButton__title",icon:"AutoPlayButton__icon",icon__blink:"AutoPlayButton__icon__blink",iconBlink:"AutoPlayButton__icon__blink",blink:"AutoPlayButton__blink"},t.A=o},7430:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".AutoPlayLabels__article{align-items:center;animation:AutoPlayLabels__breathe 3.2s ease-in-out infinite;display:flex;flex-direction:column;height:100%;justify-content:space-around;width:100%}.vid_embed--no-shadow .AutoPlayLabels__title{text-shadow:none!important}.AutoPlayLabels__icon{height:auto;width:15%}.vid_embed--no-shadow .AutoPlayLabels__icon{-webkit-filter:none!important;filter:none!important}.AutoPlayLabels__wrapper{height:100%;padding:2.5% 2.5% calc(40px + 2.5%);transform:translateY(20px);transition:transform .25s cubic-bezier(.4,0,.2,1);width:100%}.AutoPlayLabels__wrapper--has-offset{transform:translateY(0)}.AutoPlayLabels__wrapper--portrait .AutoPlayLabels__article,.AutoPlayLabels__wrapper--square .AutoPlayLabels__article{justify-content:center}.AutoPlayLabels__wrapper--portrait .AutoPlayLabels__icon{margin:12.5% 0;width:25%}.AutoPlayLabels__wrapper--square .AutoPlayLabels__icon{margin:11% 0;width:15%}@keyframes AutoPlayLabels__breathe{0%{opacity:1;transform:scale(1)}30%{opacity:.1;transform:scale(1.04)}60%{opacity:1;transform:scale(1)}to{opacity:1;transform:scale(1)}}",""]),o.locals={article:"AutoPlayLabels__article",breathe:"AutoPlayLabels__breathe",title:"AutoPlayLabels__title",icon:"AutoPlayLabels__icon",wrapper:"AutoPlayLabels__wrapper","wrapper--has-offset":"AutoPlayLabels__wrapper--has-offset",wrapperHasOffset:"AutoPlayLabels__wrapper--has-offset","wrapper--portrait":"AutoPlayLabels__wrapper--portrait",wrapperPortrait:"AutoPlayLabels__wrapper--portrait","wrapper--square":"AutoPlayLabels__wrapper--square",wrapperSquare:"AutoPlayLabels__wrapper--square"},t.A=o},2786:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ContextMenu__wrapper{border-radius:1px;box-sizing:border-box;opacity:.75;overflow:hidden;position:fixed}.ContextMenu__wrapper--hidden{height:0;left:-9999px;opacity:0;pointer-events:none;top:-9999px;width:0}.ContextMenu__link.ContextMenu__link{background:rgba(0,0,0,.8);box-sizing:border-box;display:block;font-family:Tahoma,sans-serif;font-size:16px;font-style:normal;font-weight:400;height:32px;letter-spacing:normal;line-height:normal;line-height:32px;padding:0 15px;text-align:left;text-shadow:none;text-transform:none;transition:background-color .25s cubic-bezier(.4,0,.2,1);white-space:nowrap}.ContextMenu__link.ContextMenu__link,.ContextMenu__link.ContextMenu__link:hover{color:#fff;text-decoration:none}.ContextMenu__link.ContextMenu__link:hover{background-color:#000}",""]),o.locals={wrapper:"ContextMenu__wrapper","wrapper--hidden":"ContextMenu__wrapper--hidden",wrapperHidden:"ContextMenu__wrapper--hidden",link:"ContextMenu__link"},t.A=o},2071:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".TopWatermarkLink__wrapper{align-items:center;display:flex;height:40px;justify-content:center;position:absolute;right:0;top:0;width:40px}",""]),o.locals={wrapper:"TopWatermarkLink__wrapper"},t.A=o},8576:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ScalableText__scalable-text{display:inline-block;font-weight:700;line-height:1.2;text-align:center;white-space:nowrap}",""]),o.locals={"scalable-text":"ScalableText__scalable-text",scalableText:"ScalableText__scalable-text"},t.A=o},441:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".Slider__wrapper{border-radius:4px;cursor:pointer;height:100%;padding:0 12px;position:relative;touch-action:none;width:4px}.Slider__wrapper div:empty{display:block}.Slider__rail{height:100%}.Slider__rail,.Slider__track{border-radius:inherit;left:50%;position:absolute;transform:translateX(-50%);width:inherit}.Slider__track{bottom:0}.Slider__thumb,.Slider__track{background:currentcolor}.Slider__thumb{border-radius:50%;height:12px;transform:translate(-50%,50%);width:12px}.Slider__input,.Slider__thumb{position:absolute}.Slider__input{height:100%;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:100%;clip:rect(0 0 0 0);border:0}",""]),o.locals={wrapper:"Slider__wrapper",rail:"Slider__rail",track:"Slider__track",thumb:"Slider__thumb",input:"Slider__input"},t.A=o},6848:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".Control__wrapper.Control__wrapper{align-items:center;background-color:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;cursor:pointer;display:flex;font-family:Tahoma,sans-serif;font-weight:400;height:40px;justify-content:center;line-height:normal;margin:0;padding:0;text-align:center;text-decoration:none;text-transform:none;transition:background-color .25s cubic-bezier(.4,0,.2,1)!important;width:40px}.Control__wrapper.Control__wrapper:focus,.Control__wrapper.Control__wrapper:hover{background-color:transparent;border-color:transparent;border-radius:0;box-shadow:none;color:inherit;text-shadow:none}.Control__wrapper.Control__wrapper:focus{box-shadow:none;outline:none}.Control__wrapper.Control__wrapper:focus-visible{border:1px solid #fff}.Control__wrapper.Control__wrapper>svg{display:block;-webkit-filter:drop-shadow(1px 1px 1px var(--vid-colors-primary));filter:drop-shadow(1px 1px 1px var(--vid-colors-primary))}.vid_embed--no-shadow .Control__wrapper.Control__wrapper>svg{-webkit-filter:none!important;filter:none!important}",""]),o.locals={wrapper:"Control__wrapper"},t.A=o},5019:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".PlayToggle__icon{margin:0 0 0 3px}",""]),o.locals={icon:"PlayToggle__icon"},t.A=o},7441:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".ProgressControl__wrapper{flex:auto;margin:0 .5em}.ProgressControl__slider{border-radius:4px;cursor:pointer;height:8px;padding:16px 0;position:relative;touch-action:none;width:100%}.ProgressControl__slider--disabled{cursor:default}.ProgressControl__slider .ProgressControl__rail{border-radius:inherit;height:inherit;position:absolute;top:50%;transform:translateY(-50%);width:100%}.ProgressControl__slider .ProgressControl__track-wrapper{width:100%}.ProgressControl__slider .ProgressControl__track,.ProgressControl__slider .ProgressControl__track-wrapper{border-radius:inherit;height:inherit;left:0;overflow:hidden;position:absolute;top:50%;transform:translateY(-50%)}.ProgressControl__slider .ProgressControl__track{background:currentcolor}.ProgressControl__slider .ProgressControl__thumb{height:16px;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:16px}.ProgressControl__slider .ProgressControl__thumb .ProgressControl__input{height:100%;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:100%;clip:rect(0 0 0 0);border:0}.ProgressControl__slider--dragging .ProgressControl__thumb,.ProgressControl__slider--dragging .ProgressControl__track{transition:none}.ProgressControl__slider div:empty{display:block}",""]),o.locals={wrapper:"ProgressControl__wrapper",slider:"ProgressControl__slider","slider--disabled":"ProgressControl__slider--disabled",sliderDisabled:"ProgressControl__slider--disabled",rail:"ProgressControl__rail","track-wrapper":"ProgressControl__track-wrapper",trackWrapper:"ProgressControl__track-wrapper",track:"ProgressControl__track",thumb:"ProgressControl__thumb",input:"ProgressControl__input","slider--dragging":"ProgressControl__slider--dragging",sliderDragging:"ProgressControl__slider--dragging"},t.A=o},3099:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,'.SettingsControl__wrapper{position:relative}.SettingsControl__popup{border-radius:2px 2px 0 0;bottom:100%;overflow-y:auto;position:absolute;right:-40px;width:170px}.SettingsControl__popup--offset{right:0}.SettingsControl__popup.fade-enter{opacity:0}.SettingsControl__popup.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.SettingsControl__popup.fade-exit{opacity:1}.SettingsControl__popup.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.SettingsControl__header{align-items:center;border:0;border-radius:0;cursor:pointer;display:flex;flex:none;font-family:Tahoma,sans-serif;font-weight:400;height:34px;line-height:normal;font:inherit;font-weight:inherit;margin:0;padding:0 8px;position:relative;text-align:left;text-decoration:none;text-transform:none;width:100%}.SettingsControl__header,.SettingsControl__header:focus,.SettingsControl__header:hover{background-color:transparent;box-shadow:none;color:inherit}.SettingsControl__header:focus,.SettingsControl__header:hover{border-color:transparent;border-radius:0;text-shadow:none}.SettingsControl__header:focus{outline:none}.SettingsControl__header__title{margin:0 auto 0 0}.SettingsControl__header__icon{margin:0 0 0 7px;transition:transform .25s cubic-bezier(.4,0,.2,1)}.SettingsControl__header__icon-active{transform:rotate(90deg)}.SettingsControl__item{align-items:center;border:0;border-radius:0;cursor:pointer;display:flex;font-family:Tahoma,sans-serif;font-weight:400;height:31px;justify-content:space-between;line-height:normal;font:inherit;font-weight:inherit;margin:0;padding:0 8px;position:relative;text-align:left;text-decoration:none;text-transform:none;width:100%}.SettingsControl__item,.SettingsControl__item:focus,.SettingsControl__item:hover{background-color:transparent;box-shadow:none;color:inherit}.SettingsControl__item:focus,.SettingsControl__item:hover{border-color:transparent;border-radius:0;text-shadow:none}.SettingsControl__item:focus{outline:none}.SettingsControl__item:before{background:hsla(0,0%,60%,.3);top:0}.SettingsControl__item:before,.SettingsControl__item:last-child:after{content:"";height:1px;left:8px;position:absolute;width:calc(100% - 16px)}.SettingsControl__item:last-child:after{background-color:hsla(0,0%,60%,.3);bottom:0}.SettingsControl__option{font-size:12px;font-weight:600;line-height:16px}.SettingsControl__option:last-child .SettingsControl__item:last-child:after{background-color:transparent}.SettingsControl__list{overflow:hidden;transition:max-height .25s cubic-bezier(.4,0,.2,1),opacity .25s cubic-bezier(.4,0,.2,1)}',""]),o.locals={wrapper:"SettingsControl__wrapper",popup:"SettingsControl__popup","popup--offset":"SettingsControl__popup--offset",popupOffset:"SettingsControl__popup--offset",header:"SettingsControl__header",header__title:"SettingsControl__header__title",headerTitle:"SettingsControl__header__title",header__icon:"SettingsControl__header__icon",headerIcon:"SettingsControl__header__icon","header__icon-active":"SettingsControl__header__icon-active",headerIconActive:"SettingsControl__header__icon-active",item:"SettingsControl__item",option:"SettingsControl__option",list:"SettingsControl__list"},t.A=o},244:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".TimeDisplay__wrapper{font-size:11px;margin:0 8px;text-shadow:0 1px 1px rgba(0,0,0,.3);text-shadow:0 1px 1px var(--vid-colors-primary-dark,rgba(0,0,0,.3))}.vid_embed--no-shadow .TimeDisplay__wrapper{text-shadow:none!important}",""]),o.locals={wrapper:"TimeDisplay__wrapper"},t.A=o},234:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".VolumeControl__wrapper{position:relative}.VolumeControl__popup{align-items:stretch;border-radius:2px 2px 0 0;bottom:100%;display:flex;height:108px;justify-content:center;left:0;min-width:100%;padding:15px 0;position:absolute}.VolumeControl__popup.fade-enter{opacity:0}.VolumeControl__popup.fade-enter-active{opacity:1;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.VolumeControl__popup.fade-exit{opacity:1}.VolumeControl__popup.fade-exit-active{opacity:0;transition:opacity .25s cubic-bezier(.4,0,.2,1)}.VolumeControl__root{box-sizing:content-box;color:#1976d2;cursor:pointer;display:inline-block;font-family:Arial,sans-serif;font-size:1rem;font-weight:400;height:100%;line-height:1.5;padding:0 13px;position:relative;touch-action:none;width:4px;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;border-radius:12px;color-scheme:light;letter-spacing:0;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}.VolumeControl__rail{border-radius:inherit;color:#2d57ba;color-scheme:light;height:100%}.VolumeControl__rail,.VolumeControl__track{box-sizing:inherit;cursor:pointer;display:block;font-family:Arial,sans-serif;font-size:1rem;font-weight:400;left:50%;line-height:1.5;position:absolute;transform:translateX(-50%);width:inherit;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:currentcolor;letter-spacing:0;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}.VolumeControl__track{border:1px solid;border-radius:inherit;bottom:0;color:#fff;color-scheme:light;height:30%}.VolumeControl__thumb{align-items:center;background-color:#fff;border-radius:50%;box-sizing:border-box;cursor:pointer;display:flex;font-family:Arial,sans-serif;font-size:1rem;font-weight:400;height:12px;justify-content:center;letter-spacing:0;line-height:1.5;outline:0;transform:translate(-50%,50%);width:12px;-webkit-box-align:center;-webkit-box-pack:center}.VolumeControl__input,.VolumeControl__thumb{position:absolute;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color-scheme:light;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}.VolumeControl__input{box-sizing:inherit;direction:ltr;height:100%;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:100%;clip:rect(0,0,0,0);border:0}",""]),o.locals={wrapper:"VolumeControl__wrapper",popup:"VolumeControl__popup",root:"VolumeControl__root",rail:"VolumeControl__rail",track:"VolumeControl__track",thumb:"VolumeControl__thumb",input:"VolumeControl__input"},t.A=o},2475:function(e,t,n){"use strict";var r=n(6369),i=n.n(r),a=n(2350),o=n.n(a)()(i());o.push([e.id,".WatermarkLink__wrapper{align-items:center;color:inherit!important;display:flex;height:40px;justify-content:center;margin:0;padding:0 10px;transition:background-color .25s cubic-bezier(.4,0,.2,1)!important}",""]),o.locals={wrapper:"WatermarkLink__wrapper"},t.A=o},2350:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r="undefined"!==typeof t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,a){"string"===typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},6369:function(e){"use strict";e.exports=function(e){return e[1]}},8240:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i=t||n<0||d&&e-u>=a}function E(){var e=v();if(_(e))return b(e);s=setTimeout(E,function(e){var n=t-(e-l);return d?m(n,a-(e-u)):n}(e))}function b(e){return s=void 0,h&&r?f(e):(r=i=void 0,o)}function S(){var e=v(),n=_(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(E,t),c?f(e):o}(l);if(d)return s=setTimeout(E,t),f(l)}return void 0===s&&(s=setTimeout(E,t)),o}return t=y(t)||0,g(n)&&(c=!!n.leading,a=(d="maxWait"in n)?p(y(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),S.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},S.flush=function(){return void 0===s?o:b(v())},S}},4420:function(e,t,n){var r=1/0,i="[object Symbol]",a=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s="\\ud800-\\udfff",l="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",c="A-Z\\xc0-\\xd6\\xd8-\\xde",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",h="['\u2019]",f="["+d+"]",p="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",m="\\d+",v="["+l+"]",g="["+u+"]",y="[^"+s+d+m+l+u+c+"]",_="(?:\\ud83c[\\udde6-\\uddff]){2}",E="[\\ud800-\\udbff][\\udc00-\\udfff]",b="["+c+"]",S="(?:"+g+"|"+y+")",A="(?:"+b+"|"+y+")",T="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",w="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",I="(?:"+p+"|\\ud83c[\\udffb-\\udfff])"+"?",C="[\\ufe0e\\ufe0f]?",R=C+I+("(?:\\u200d(?:"+["[^"+s+"]",_,E].join("|")+")"+C+I+")*"),k="(?:"+[v,_,E].join("|")+")"+R,P=RegExp(h,"g"),L=RegExp(p,"g"),O=RegExp([b+"?"+g+"+"+T+"(?="+[f,b,"$"].join("|")+")",A+"+"+w+"(?="+[f,b+S,"$"].join("|")+")",b+"?"+S+"+"+T,b+"+"+w,m,k].join("|"),"g"),D=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,x="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,N="object"==typeof self&&self&&self.Object===Object&&self,M=x||N||Function("return this")();var F,U=(F={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"ss"},function(e){return null==F?void 0:F[e]});var B=Object.prototype.toString,V=M.Symbol,G=V?V.prototype:void 0,H=G?G.toString:void 0;function Y(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&B.call(e)==i}(e))return H?H.call(e):"";var t=e+"";return"0"==t&&1/e==-r?"-0":t}function j(e){return null==e?"":Y(e)}var K,$=(K=function(e,t,n){return e+(n?"_":"")+t.toLowerCase()},function(e){return function(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i=t||n<0||h&&e-c>=o}function b(){var e=g();if(y(e))return S(e);l=setTimeout(b,function(e){var n=t-(e-u);return h?v(n,o-(e-c)):n}(e))}function S(e){return l=void 0,f&&i?p(e):(i=a=void 0,s)}function A(){var e=g(),n=y(e);if(i=arguments,a=this,u=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(b,t),d?p(e):s}(u);if(h)return l=setTimeout(b,t),p(u)}return void 0===l&&(l=setTimeout(b,t)),s}return t=E(t)||0,_(n)&&(d=!!n.leading,o=(h="maxWait"in n)?m(E(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),A.cancel=function(){void 0!==l&&clearTimeout(l),c=0,i=u=a=l=void 0},A.flush=function(){return void 0===l?s:S(g())},A}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function E(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&p.call(e)==a}(e))return i;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?i:+e}e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(r);return _(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),y(e,t,{leading:i,maxWait:t,trailing:a})}},2145:function(e){var t=function(e){return e.replace(/^\s+|\s+$/g,"")};e.exports=function(e){if(!e)return{};for(var n,r={},i=t(e).split("\n"),a=0;a=n.__.length&&n.__.push({__V:c}),n.__[e]}function g(e){return l=1,y(N,e)}function y(e,t,n){var a=v(r++,2);if(a.t=e,!a.__c&&(a.__=[n?n(t):N(void 0,t),function(e){var t=a.__N?a.__N[0]:a.__[0],n=a.t(t,e);t!==n&&(a.__N=[n,a.__[1]],a.__c.setState({}))}],a.__c=i,!i.u)){var o=function(e,t,n){if(!a.__c.__H)return!0;var r=a.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var i=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&a.__c.props===e)&&(!s||s.call(this,e,t,n))};i.u=!0;var s=i.shouldComponentUpdate,l=i.componentWillUpdate;i.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,o(e,t,n),s=r}l&&l.call(this,e,t,n)},i.shouldComponentUpdate=o}return a.__N||a.__}function _(e,t){var n=v(r++,3);!s.fF.__s&&x(n.__H,t)&&(n.__=e,n.i=t,i.__H.__h.push(n))}function E(e,t){var n=v(r++,4);!s.fF.__s&&x(n.__H,t)&&(n.__=e,n.i=t,i.__h.push(n))}function b(e){return l=5,A((function(){return{current:e}}),[])}function S(e,t,n){l=6,E((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function A(e,t){var n=v(r++,7);return x(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function T(e,t){return l=8,A((function(){return e}),t)}function w(e){var t=i.context[e.__c],n=v(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function I(e,t){s.fF.useDebugValue&&s.fF.useDebugValue(t?t(e):e)}function C(e){var t=v(r++,10),n=g();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function R(){var e=v(r++,11);if(!e.__){for(var t=i.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function k(){for(var e;e=u.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(D),e.__H.__h=[]}catch(i){e.__H.__h=[],s.fF.__e(i,e.__v)}}s.fF.__b=function(e){i=null,d&&d(e)},s.fF.__r=function(e){h&&h(e),r=0;var t=(i=e.__c).__H;t&&(a===i?(t.__h=[],i.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=c,e.__N=e.i=void 0}))):(t.__h.forEach(O),t.__h.forEach(D),t.__h=[],r=0)),a=i},s.fF.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&o===s.fF.requestAnimationFrame||((o=s.fF.requestAnimationFrame)||L)(k)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==c&&(e.__=e.__V),e.i=void 0,e.__V=c}))),a=i=null},s.fF.__c=function(e,t){t.some((function(e){try{e.__h.forEach(O),e.__h=e.__h.filter((function(e){return!e.__||D(e)}))}catch(a){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.fF.__e(a,e.__v)}})),p&&p(e,t)},s.fF.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{O(e)}catch(e){t=e}})),n.__H=void 0,t&&s.fF.__e(t,n.__v))};var P="function"==typeof requestAnimationFrame;function L(e){var t,n=function(){clearTimeout(r),P&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);P&&(t=requestAnimationFrame(n))}function O(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function D(e){var t=i;e.__c=e.__(),i=t}function x(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function N(e,t){return"function"==typeof t?t(e):t}function M(e,t){for(var n in t)e[n]=t[n];return e}function F(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function U(e){this.props=e}function B(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:F(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,s.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(U.prototype=new s.uA).isPureReactComponent=!0,U.prototype.shouldComponentUpdate=function(e,t){return F(this.props,e)||F(this.state,t)};var V=s.fF.__b;s.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),V&&V(e)};var G="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function H(e){function t(t){var n=M({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=G,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Y=function(e,t){return null==e?null:(0,s.v2)((0,s.v2)(e).map(t))},j={map:Y,forEach:Y,count:function(e){return e?(0,s.v2)(e).length:0},only:function(e){var t=(0,s.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:s.v2},K=s.fF.__e;s.fF.__e=function(e,t,n,r){if(e.then)for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);K(e,t,n,r)};var $=s.fF.unmount;function q(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=M({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return q(e,t,n)}))),e}function z(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return z(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function W(){this.__u=0,this.t=null,this.__b=null}function Q(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function X(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,s.n)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Z(){this.u=null,this.o=null}s.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),$&&$(e)},(W.prototype=new s.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=Q(r.__v),a=!1,o=function(){a||(a=!0,n.__R=null,i?i(s):s())};n.__R=o;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=z(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=q(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&(0,s.n)(s.FK,null,e.fallback);return i&&(i.__u&=-33),[(0,s.n)(s.FK,null,t.__a?null:e.children),i]};var J=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),(0,s.XX)((0,s.n)(ee,{context:t.context},e.__v),t.l)}function ne(e,t){var n=(0,s.n)(te,{__v:e,i:t});return n.containerInfo=t,n}(Z.prototype=new s.uA).__a=function(e){var t=this,n=Q(t.__v),r=t.o.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),J(t,e,r)):i()};n?n(a):a()}},Z.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,s.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Z.prototype.componentDidUpdate=Z.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){J(e,n,t)}))};var re="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ie=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ae=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,oe=/[A-Z0-9]/g,se="undefined"!=typeof document,le=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function ue(e,t,n){return null==t.__k&&(t.textContent=""),(0,s.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function ce(e,t,n){return(0,s.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}s.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(s.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var de=s.fF.event;function he(){}function fe(){return this.cancelBubble}function pe(){return this.defaultPrevented}s.fF.event=function(e){return de&&(e=de(e)),e.persist=he,e.isPropagationStopped=fe,e.isDefaultPrevented=pe,e.nativeEvent=e};var me,ve={enumerable:!1,configurable:!0,get:function(){return this.class}},ge=s.fF.vnode;s.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||se&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var o=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"ondoubleclick"===o?i="ondblclick":"onchange"!==o||"input"!==n&&"textarea"!==n||le(t.type)?"onfocus"===o?i="onfocusin":"onblur"===o?i="onfocusout":ae.test(i)?i=o:-1===n.indexOf("-")&&ie.test(i)?i=i.replace(oe,"-$&").toLowerCase():null===a&&(a=void 0):o=i="oninput","oninput"===o&&r[i=o]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,s.v2)(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=(0,s.v2)(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",ve)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=re,ge&&ge(e)};var ye=s.fF.__r;s.fF.__r=function(e){ye&&ye(e),me=e.__c};var _e=s.fF.diffed;s.fF.diffed=function(e){_e&&_e(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),me=null};var Ee={ReactCurrentDispatcher:{current:{readContext:function(e){return me.__n[e.__c].props.value}}}},be="17.0.2";function Se(e){return s.n.bind(null,e)}function Ae(e){return!!e&&e.$$typeof===re}function Te(e){return Ae(e)&&e.type===s.FK}function we(e){return Ae(e)?s.Ob.apply(null,arguments):e}function Ie(e){return!!e.__k&&((0,s.XX)(null,e),!0)}function Ce(e){return e&&(e.base||1===e.nodeType&&e)||null}var Re=function(e,t){return e(t)},ke=function(e,t){return e(t)},Pe=s.FK;function Le(e){e()}function Oe(e){return e}function De(){return[!1,Le]}var xe=E,Ne=Ae;function Me(e,t){var n=t(),r=g({h:{__:n,v:t}}),i=r[0].h,a=r[1];return E((function(){i.__=n,i.v=t,Fe(i)&&a({h:i})}),[e,n,t]),_((function(){return Fe(i)&&a({h:i}),e((function(){Fe(i)&&a({h:i})}))}),[e]),n}function Fe(e){var t,n,r=e.v,i=e.__;try{var a=r();return!((t=i)===(n=a)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var Ue={useState:g,useId:R,useReducer:y,useEffect:_,useLayoutEffect:E,useInsertionEffect:xe,useTransition:De,useDeferredValue:Oe,useSyncExternalStore:Me,startTransition:Le,useRef:b,useImperativeHandle:S,useMemo:A,useCallback:T,useContext:w,useDebugValue:I,version:"17.0.2",Children:j,render:ue,hydrate:ce,unmountComponentAtNode:Ie,createPortal:ne,createElement:s.n,createContext:s.q6,createFactory:Se,cloneElement:we,createRef:s._3,Fragment:s.FK,isValidElement:Ae,isElement:Ne,isFragment:Te,findDOMNode:Ce,Component:s.uA,PureComponent:U,memo:B,forwardRef:H,flushSync:ke,unstable_batchedUpdates:Re,StrictMode:Pe,Suspense:W,SuspenseList:Z,lazy:X,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ee}},5716:function(e,t,n){"use strict";n.d(t,{FK:function(){return E},Ob:function(){return Y},Qv:function(){return H},XX:function(){return G},_3:function(){return _},fF:function(){return i},n:function(){return g},q6:function(){return j},uA:function(){return b},v2:function(){return k}});var r,i,a,o,s,l,u,c,d={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function m(e,t){for(var n in t)e[n]=t[n];return e}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function g(e,t,n){var i,a,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return y(e,s,i,a,null)}function y(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++a:o,__i:-1,__u:0};return null==o&&null!=i.vnode&&i.vnode(s),s}function _(){return{current:null}}function E(e){return e.children}function b(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;tt&&o.sort(u));w.__r=0}function I(e,t,n,r,i,a,o,s,l,u,c){var f,p,m,v,g,y=r&&r.__k||h,_=t.length;for(n.__d=l,C(n,t,y),l=n.__d,f=0;f<_;f++)null!=(m=n.__k[f])&&"boolean"!=typeof m&&"function"!=typeof m&&(p=-1===m.__i?d:y[m.__i]||d,m.__i=f,N(e,m,p,i,a,o,s,l,u,c),v=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&U(p.ref,null,m),c.push(m.ref,m.__c||v,m)),null==g&&null!=v&&(g=v),65536&m.__u||p.__k===m.__k?l=R(m,l,e):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:v&&(l=v.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=g}function C(e,t,n){var r,i,a,o,s,l=t.length,u=n.length,c=u,d=0;for(e.__k=[],r=0;r0?y(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=P(i,n,o=r+d,c),i.__i=s,a=null,-1!==s&&(c--,(a=n[s])&&(a.__u|=131072)),null==a||null===a.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?c>l-o?d+=s-o:d--:d=s(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||s=0){if((l=t[o])&&0==(131072&l.__u)&&i==l.key&&a===l.type)return o;o--}if(s2&&(l.children=arguments.length>3?r.call(arguments,2):n),y(e.type,l,i||e.key,a||e.ref,null)}function j(e,t){var n={__c:t="__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,T(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=h.slice,i={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&null!=a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},a=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},b.prototype.render=E,o=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},w.__r=0,c=0},8534:function(e,t){"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function i(e){try{return encodeURIComponent(e)}catch(t){return null}}t.stringify=function(e,t){t=t||"";var r,a,o=[];for(a in"string"!==typeof t&&(t="?"),e)if(n.call(e,a)){if((r=e[a])||null!==r&&undefined!==r&&!isNaN(r)||(r=""),a=i(a),r=i(r),null===a||null===r)continue;o.push(a+"="+r)}return o.length?t+o.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,i={};t=n.exec(e);){var a=r(t[1]),o=r(t[2]);null===a||null===o||a in i||(i[a]=o)}return i}},3798:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(i.layer):""," {")),a+=i.css,o&&(a+="}"),i.media&&(a+="}"),i.supports&&(a+="}")}if(e.styleSheet)e.styleSheet.cssText=t(n,a);else{var s=document.createTextNode(a),l=e.childNodes;l[n]&&e.removeChild(l[n]),l.length?e.insertBefore(s,l[n]):e.appendChild(s)}}var r={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"===typeof document)return{update:function(){},remove:function(){}};var t=r.singletonCounter++,i=r.singleton||(r.singleton=e.insertStyleElement(e));return{update:function(e){n(i,t,!1,e)},remove:function(e){n(i,t,!0,e)}}}},8597:function(e,t,n){"use strict";var r=n(3558);var i="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var c="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return s((function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})}),[e,n,t]),o((function(){return u(i)&&c({inst:i}),e((function(){u(i)&&c({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},3740:function(e,t,n){"use strict";var r=n(3558),i=n(6978);var a="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},o=i.useSyncExternalStore,s=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u((function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return s=t}return s=e}if(t=s,a(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,s=n)}var o,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,i]);var f=o(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=f}),[f]),c(f),f}},6978:function(e,t,n){"use strict";e.exports=n(8597)},4632:function(e,t,n){"use strict";e.exports=n(3740)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={id:r,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,function(){"use strict";function e(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,a){var o=t.apply(n,r);function s(t){e(o,i,a,s,l,"next",t)}function l(t){e(o,i,a,s,l,"throw",t)}s(void 0)}))}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n`):Y}(t)}))}const q=K,z=/^(\d+)x(\d+)$/,W=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Q{constructor(e){"string"===typeof e&&(e=Q.parseAttrList(e)),M(this,e)}get clientAttrs(){return Object.keys(this).filter((e=>"X-"===e.substring(0,2)))}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const n=new Uint8Array(t.length/2);for(let e=0;eNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=z.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={};for(W.lastIndex=0;null!==(t=W.exec(e));){let e=t[2];0===e.indexOf('"')&&e.lastIndexOf('"')===e.length-1&&(e=e.slice(1,-1));n[t[1].trim()]=e}return n}}function X(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class Z{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const t in n)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==n[t]){q.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=M(new Q({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);F(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(F(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&F(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class J{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ee="audio",te="video",ne="audiovideo";class re{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[ee]:null,[te]:null,[ne]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let r;r=1===n.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=L.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class ie extends re{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new J,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!F(this.programDateTime))return null;const e=F(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,n,r,i,a=!1){const{elementaryStreams:o}=this,s=o[e];s?(s.startPTS=Math.min(s.startPTS,t),s.endPTS=Math.max(s.endPTS,n),s.startDTS=Math.min(s.startDTS,r),s.endDTS=Math.max(s.endDTS,i)):o[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:a}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ee]=null,e[te]=null,e[ne]=null}}class ae extends re{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new J,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}class oe{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&F(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function se(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function le(e){const t=e.split(":");let n=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),r=e[e.length-1].split(",");if(2===r.length){const t="base64"===r[0],i=r[1];t?(e.splice(-1,1),n=se(i)):n=function(e){const t=ue(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}(i)}}return n}function ue(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}const ce="undefined"!==typeof self?self:void 0;var de={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},he="org.w3.clearkey",fe="com.apple.streamingkeydelivery",pe="com.microsoft.playready",me="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function ve(e){switch(e){case fe:return de.FAIRPLAY;case pe:return de.PLAYREADY;case me:return de.WIDEVINE;case he:return de.CLEARKEY}}var ge="edef8ba979d64acea3c827dcd51d21ed";function ye(e){switch(e){case de.FAIRPLAY:return fe;case de.PLAYREADY:return pe;case de.WIDEVINE:return me;case de.CLEARKEY:return he}}function _e(e){const{drmSystems:t,widevineLicenseUrl:n}=e,r=t?[de.FAIRPLAY,de.WIDEVINE,de.PLAYREADY,de.CLEARKEY].filter((e=>!!t[e])):[];return!r[de.WIDEVINE]&&n&&r.push(de.WIDEVINE),r}const Ee=null!=ce&&null!=(be=ce.navigator)&&be.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var be;function Se(e,t,n){return Uint8Array.prototype.slice?e.slice(t,n):new Uint8Array(Array.prototype.slice.call(e,t,n))}const Ae=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,Te=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,we=(e,t)=>{const n=t;let r=0;for(;Ae(e,t);){r+=10;r+=Ie(e,t+6),Te(e,t+10)&&(r+=10),t+=r}if(r>0)return e.subarray(n,n+r)},Ie=(e,t)=>{let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n},Ce=(e,t)=>Ae(e,t)&&Ie(e,t+6)+10<=e.length-t,Re=e=>{const t=Le(e);for(let n=0;ne&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,Pe=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=Ie(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}},Le=e=>{let t=0;const n=[];for(;Ae(e,t);){const r=Ie(e,t+6);t+=10;const i=t+r;for(;t+8"PRIV"===e.type?De(e):"W"===e.type[0]?Ne(e):xe(e),De=e=>{if(e.size<2)return;const t=Fe(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}},xe=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const n=Fe(e.data.subarray(t),!0);t+=n.length+1;const r=Fe(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=Fe(e.data.subarray(1));return{key:e.type,data:t}},Ne=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const n=Fe(e.data.subarray(t),!0);t+=n.length+1;const r=Fe(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=Fe(e.data);return{key:e.type,data:t}},Me=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),n=1&t[3];let r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}},Fe=(e,t=!1)=>{const n=Be();if(n){const r=n.decode(e);if(t){const e=r.indexOf("\0");return-1!==e?r.substring(0,e):r}return r.replace(/\0/g,"")}const r=e.length;let i,a,o,s="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(i);break;case 12:case 13:a=e[l++],s+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=e[l++],o=e[l++],s+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&o)<<0)}}return s};let Ue;function Be(){if(!navigator.userAgent.includes("PlayStation 4"))return Ue||"undefined"===typeof self.TextDecoder||(Ue=new self.TextDecoder("utf-8")),Ue}const Ve=function(e){let t="";for(let n=0;n>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function Qe(e,t){const n=[];if(!t.length)return n;const r=e.byteLength;for(let i=0;i1?i+a:r;if(je(e.subarray(i+4,i+8))===t[0])if(1===t.length)n.push(e.subarray(i+8,o));else{const r=Qe(e.subarray(i+8,o),t.slice(1));r.length&&He.apply(n,r)}i=o}return n}function Xe(e){const t=[],n=e[0];let r=8;const i=$e(e,r);r+=4;let a=0,o=0;0===n?(a=$e(e,r),o=$e(e,r+4),r+=8):(a=qe(e,r),o=qe(e,r+8),r+=16),r+=2;let s=e.length+o;const l=Ke(e,r);r+=2;for(let u=0;u>>31)return q.warn("SIDX has hierarchical references (not supported)"),null;const l=$e(e,n);n+=4,t.push({referenceSize:o,subsegmentDuration:l,info:{duration:l/i,start:s,end:s+o-1}}),s+=o,n+=4,r=n}return{earliestPresentationTime:a,timescale:i,version:n,referencesCount:l,references:t}}function Ze(e){const t=[],n=Qe(e,["moov","trak"]);for(let r=0;r{const n=$e(e,4),r=t[n];r&&(r.default={duration:$e(e,12),flags:$e(e,20)})})),t}function Je(e){const t=e.subarray(8),n=t.subarray(86),r=je(t.subarray(4,8));let i=r;const a="enca"===r||"encv"===r;if(a){const e=Qe(t,[r])[0];Qe(e.subarray("enca"===r?28:78),["sinf"]).forEach((e=>{const t=Qe(e,["schm"])[0];if(t){const n=je(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=Qe(e,["frma"])[0];t&&(i=je(t))}}}))}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const e=Qe(n,["avcC"])[0];i+="."+tt(e[1])+tt(e[2])+tt(e[3]);break}case"mp4a":{const e=Qe(t,[r])[0],n=Qe(e.subarray(28),["esds"])[0];if(n&&n.length>12){let e=4;if(3!==n[e++])break;e=et(n,e),e+=2;const t=n[e++];if(128&t&&(e+=2),64&t&&(e+=n[e++]),4!==n[e++])break;e=et(n,e);const r=n[e++];if(64!==r)break;if(i+="."+tt(r),e+=12,5!==n[e++])break;e=et(n,e);const a=n[e++];let o=(248&a)>>3;31===o&&(o+=1+((7&a)<<3)+((224&n[e])>>5)),i+="."+o}break}case"hvc1":case"hev1":{const e=Qe(n,["hvcC"])[0],t=e[1],r=["","A","B","C"][t>>6],a=31&t,o=$e(e,2),s=(32&t)>>5?"H":"L",l=e[12],u=e.subarray(6,12);i+="."+r+a,i+="."+o.toString(16).toUpperCase(),i+="."+s+l;let c="";for(let n=u.length;n--;){const e=u[n];if(e||c){c="."+e.toString(16).toUpperCase()+c}}i+=c;break}case"dvh1":case"dvhe":{const e=Qe(n,["dvcC"])[0],t=e[2]>>1&127,r=e[2]<<5&32|e[3]>>3&31;i+="."+nt(t)+"."+nt(r);break}case"vp09":{const e=Qe(n,["vpcC"])[0],t=e[4],r=e[5],a=e[6]>>4&15;i+="."+nt(t)+"."+nt(r)+"."+nt(a);break}case"av01":{const e=Qe(n,["av1C"])[0],t=e[1]>>>5,r=31&e[1],a=e[2]>>>7?"H":"M",o=(64&e[2])>>6,s=(32&e[2])>>5,l=2===t&&o?s?12:10:o?10:8,u=(16&e[2])>>4,c=(8&e[2])>>3,d=(4&e[2])>>2,h=3&e[2],f=1,p=1,m=1,v=0;i+="."+t+"."+nt(r)+a+"."+nt(l)+"."+u+"."+c+d+h+"."+nt(f)+"."+nt(p)+"."+nt(m)+"."+v;break}}return{codec:i,encrypted:a}}function et(e,t){const n=t+5;for(;128&e[t++]&&t{const l=s.byteOffset-8;Qe(s,["traf"]).map((s=>{const u=Qe(s,["tfdt"]).map((e=>{const t=e[0];let n=$e(e,4);return 1===t&&(n*=Math.pow(2,32),n+=$e(e,8)),n/i}))[0];return void 0!==u&&(e=u),Qe(s,["tfhd"]).map((u=>{const c=$e(u,4),d=16777215&$e(u,0);let h=0;const f=0!==(16&d);let p=0;const m=0!==(32&d);let v=8;c===a&&(0!==(1&d)&&(v+=8),0!==(2&d)&&(v+=4),0!==(8&d)&&(h=$e(u,v),v+=4),f&&(p=$e(u,v),v+=4),m&&(v+=4),"video"===t.type&&(o=function(e){if(!e)return!1;const t=e.indexOf("."),n=t<0?e:e.substring(0,t);return"hvc1"===n||"hev1"===n||"dvh1"===n||"dvhe"===n}(t.codec)),Qe(s,["trun"]).map((a=>{const s=a[0],u=16777215&$e(a,0),c=0!==(1&u);let d=0;const f=0!==(4&u),m=0!==(256&u);let v=0;const g=0!==(512&u);let y=0;const _=0!==(1024&u),E=0!==(2048&u);let b=0;const S=$e(a,4);let A=8;c&&(d=$e(a,A),A+=4),f&&(A+=4);let T=d+l;for(let l=0;l>1&63;return 39===e||40===e}return 6===(31&t)}function lt(e,t,n,r){const i=ut(e);let a=0;a+=t;let o=0,s=0,l=0;for(;a=i.length)break;l=i[a++],o+=l}while(255===l);s=0;do{if(a>=i.length)break;l=i[a++],s+=l}while(255===l);const e=i.length-a;let t=a;if(se){q.error(`Malformed SEI payload. ${s} is too small, only ${e} bytes left to parse.`);break}if(4===o){if(181===i[t++]){const e=Ke(i,t);if(t+=2,49===e){const e=$e(i,t);if(t+=4,1195456820===e){const e=i[t++];if(3===e){const a=i[t++],s=64&a,l=s?2+3*(31&a):0,u=new Uint8Array(l);if(s){u[0]=a;for(let e=1;e16){const e=[];for(let n=0;n<16;n++){const r=i[t++].toString(16);e.push(1==r.length?"0"+r:r),3!==n&&5!==n&&7!==n&&9!==n||e.push("-")}const a=s-16,l=new Uint8Array(a);for(let n=0;n0?(a=new Uint8Array(4),t.length>0&&new DataView(a.buffer).setUint32(0,t.length,!1)):a=new Uint8Array;const o=new Uint8Array(4);return n&&n.byteLength>0&&new DataView(o.buffer).setUint32(0,n.byteLength,!1),function(e,...t){const n=t.length;let r=8,i=n;for(;i--;)r+=t[i].byteLength;const a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=255&r,a.set(e,4),i=0,r=8;i>8*(15-n)&255;return t}(e);return new ht(this.method,this.uri,"identity",this.keyFormatVersions,t)}const t=le(this.uri);if(t)switch(this.keyFormat){case me:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case pe:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=ct(e,null,t);const n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(n)),i=r.substring(r.indexOf("<"),r.length),a=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(a){const e=a.childNodes[0]?a.childNodes[0].nodeValue:a.getAttribute("VALUE");if(e){const t=se(e).subarray(0,16);!function(e){const t=function(e,t,n){const r=e[t];e[t]=e[n],e[n]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=dt[this.uri];if(!e){const t=Object.keys(dt).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);new DataView(e.buffer,12,4).setUint32(0,t),dt[this.uri]=e}this.keyId=e}return this}}const ft=/\{\$([a-zA-Z0-9-_]+)\}/g;function pt(e){return ft.test(e)}function mt(e,t,n){if(null!==e.variableList||e.hasVariableRefs)for(let r=n.length;r--;){const i=n[r],a=t[i];a&&(t[i]=vt(e,a))}}function vt(e,t){if(null!==e.variableList||e.hasVariableRefs){const n=e.variableList;return t.replace(ft,(t=>{const r=t.substring(2,t.length-1),i=null==n?void 0:n[r];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),t):i}))}return t}function gt(e,t,n){let r,i,a=e.variableList;if(a||(e.variableList=a={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{const e=new self.URL(n).searchParams;if(!e.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${n}"`);i=e.get(r)}catch(o){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else r=t.NAME,i=t.VALUE;r in a?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):a[r]=i||""}function yt(e,t,n){const r=t.IMPORT;if(n&&r in n){let t=e.variableList;t||(e.variableList=t={}),t[r]=n[r]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}function _t(e=!0){if("undefined"===typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}const Et={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function bt(e,t,n=!0){return!e.split(",").some((e=>!St(e,t,n)))}function St(e,t,n=!0){var r;const i=_t(n);return null!=(r=null==i?void 0:i.isTypeSupported(At(e,t)))&&r}function At(e,t){return`${t}/mp4;codecs="${e}"`}function Tt(e){if(e){const t=e.substring(0,4);return Et.video[t]}return 2}function wt(e){return e.split(",").reduce(((e,t)=>{const n=Et.video[t];return n?(2*n+e)/(e?3:2):(Et.audio[t]+e)/(e?2:1)}),0)}const It={};const Ct=/flac|opus/i;function Rt(e,t=!0){return e.replace(Ct,(e=>function(e,t=!0){if(It[e])return It[e];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[e];for(let r=0;r0&&r.length({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:a.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let s=0;for(Lt.lastIndex=0;null!==(r=Lt.exec(e));){const e=new Q(r[1]),a=e.TYPE;if(a){const r=o[a],l=i[a]||[];i[a]=l,mt(n,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const u=e.LANGUAGE,c=e["ASSOC-LANGUAGE"],d=e.CHANNELS,h=e.CHARACTERISTICS,f=e["INSTREAM-ID"],p={attrs:e,bitrate:0,id:s++,groupId:e["GROUP-ID"]||"",name:e.NAME||u||"",type:a,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:u,url:e.URI?Nt.resolve(e.URI,t):""};if(c&&(p.assocLang=c),d&&(p.channels=d),h&&(p.characteristics=h),f&&(p.instreamId=f),null!=r&&r.length){const e=Nt.findGroup(r,p.groupId)||r[0];Bt(p,e,"audioCodec"),Bt(p,e,"textCodec")}l.push(p)}}return i}static parseLevelPlaylist(e,t,n,r,i,a){const o=new oe(t),s=o.fragments;let l,u,c,d=null,h=0,f=0,p=0,m=0,v=null,g=new ie(r,t),y=-1,_=!1,E=null;for(Dt.lastIndex=0,o.m3u8=e,o.hasVariableRefs=pt(e);null!==(l=Dt.exec(e));){_&&(_=!1,g=new ie(r,t),g.start=p,g.sn=h,g.cc=m,g.level=n,d&&(g.initSegment=d,g.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null,E&&(g.setByteRange(E),E=null)));const e=l[1];if(e){g.duration=parseFloat(e);const t=(" "+l[2]).slice(1);g.title=t||null,g.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(F(g.duration)){g.start=p,c&&Ht(g,c,o),g.sn=h,g.level=n,g.cc=m,s.push(g);const e=(" "+l[3]).slice(1);g.relurl=vt(o,e),Vt(g,v),v=g,p+=g.duration,h++,f=0,_=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);v?g.setByteRange(e,v):g.setByteRange(e)}else if(l[5])g.rawProgramDateTime=(" "+l[5]).slice(1),g.tagList.push(["PROGRAM-DATE-TIME",g.rawProgramDateTime]),-1===y&&(y=s.length);else{if(l=l[0].match(xt),!l){q.warn("No matches on slow regex match for level playlist!");continue}for(u=1;u0&&e.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),o.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new Q(i);o.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=o.partList;e||(e=o.partList=[]);const n=f>0?e[e.length-1]:void 0,r=f++,a=new Q(i);mt(o,a,["BYTERANGE","URI"]);const s=new ae(a,g,t,r,n);e.push(s),g.duration+=s.duration;break}case"PRELOAD-HINT":{const e=new Q(i);mt(o,e,["URI"]),o.preloadHint=e;break}case"RENDITION-REPORT":{const e=new Q(i);mt(o,e,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(e);break}default:q.warn(`line parsed but not handled: ${l}`)}}}v&&!v.relurl?(s.pop(),p-=v.duration,o.partList&&(o.fragmentHint=v)):o.partList&&(Vt(g,v),g.cc=m,o.fragmentHint=g,c&&Ht(g,c,o));const b=s.length,S=s[0],A=s[b-1];if(p+=o.skippedSegments*o.targetduration,p>0&&b&&A){o.averagetargetduration=p/b;const e=A.sn;o.endSN="initSegment"!==e?e:0,o.live||(A.endList=!0),S&&(o.startCC=S.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(p+=o.fragmentHint.duration),o.totalduration=p,o.endCC=m,y>0&&function(e,t){let n=e[t];for(let r=t;r--;){const t=e[r];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(s,y),o}}function Mt(e,t,n){var r,i;const a=new Q(e);mt(n,a,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const o=null!=(r=a.METHOD)?r:"",s=a.URI,l=a.hexadecimalInteger("IV"),u=a.KEYFORMATVERSIONS,c=null!=(i=a.KEYFORMAT)?i:"identity";s&&a.IV&&!l&&q.error(`Invalid IV: ${a.IV}`);const d=s?Nt.resolve(s,t):"",h=(u||"1").split("/").map(Number).filter(Number.isFinite);return new ht(o,d,c,h,l)}function Ft(e){const t=new Q(e).decimalFloatingPoint("TIME-OFFSET");return F(t)?t:null}function Ut(e,t){let n=(e||"").split(/[ ,]+/).filter((e=>e));["video","audio","text"].forEach((e=>{const r=n.filter((t=>function(e,t){const n=Et[t];return!!n&&!!n[e.slice(0,4)]}(t,e)));r.length&&(t[`${e}Codec`]=r.join(","),n=n.filter((e=>-1===r.indexOf(e))))})),t.unknownCodecs=n}function Bt(e,t,n){const r=t[n];r&&(e[n]=r)}function Vt(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),F(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function Gt(e,t,n,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function Ht(e,t,n){e.levelkeys=t;const{encryptedFragments:r}=n;r.length&&r[r.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||r.push(e)}var Yt="manifest",jt="level",Kt="audioTrack",$t="subtitleTrack",qt="main",zt="audio",Wt="subtitle";function Qt(e){const{type:t}=e;switch(t){case Kt:return zt;case $t:return Wt;default:return qt}}function Xt(e,t){let n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}class Zt{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(V.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.LEVEL_LOADING,this.onLevelLoading,this),e.off(V.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(V.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,i=new(n||r)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Yt,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:i,url:a,deliveryDirectives:o}=t;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:jt,url:a,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:a}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:Kt,url:i,deliveryDirectives:a})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:a}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:$t,url:i,deliveryDirectives:a})}load(e){var t;const n=this.hls.config;let r,i=this.getInternalLoader(e);if(i){const t=i.context;if(t&&t.url===e.url&&t.level===e.level)return void q.trace("[playlist-loader]: playlist request ongoing");q.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}if(r=e.type===Yt?n.manifestLoadPolicy.default:M({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),F(null==(t=e.deliveryDirectives)?void 0:t.part)){let t;if(e.type===jt&&null!==e.level?t=this.hls.levels[e.level].details:e.type===Kt&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===$t&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,n=t.targetduration;if(e&&n){const t=1e3*Math.max(3*e,.8*n);r=M({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}const a=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},s={onSuccess:(e,t,n,r)=>{const i=this.getInternalLoader(n);this.resetInternalLoader(n.type);const a=e.data;0===a.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),Nt.isMediaPlaylist(a)?this.handleTrackOrLevelPlaylist(e,t,n,r||null,i):this.handleMasterPlaylist(e,t,n,r)):this.handleManifestParsingError(e,n,new Error("no EXTM3U delimiter"),r||null,t)},onError:(e,t,n,r)=>{this.handleNetworkError(t,n,!1,e,r)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}};i.load(e,o,s)}handleMasterPlaylist(e,t,n,r){const i=this.hls,a=e.data,o=Xt(e,n),s=Nt.parseMasterPlaylist(a,o);if(s.playlistParsingError)return void this.handleManifestParsingError(e,n,s.playlistParsingError,r,t);const{contentSteering:l,levels:u,sessionData:c,sessionKeys:d,startTimeOffset:h,variableList:f}=s;this.variableList=f;const{AUDIO:p=[],SUBTITLES:m,"CLOSED-CAPTIONS":v}=Nt.parseMasterPlaylistMedia(a,o,s);if(p.length){p.some((e=>!e.url))||!u[0].audioCodec||u[0].attrs.AUDIO||(q.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Q({}),bitrate:0,url:""}))}i.trigger(V.MANIFEST_LOADED,{levels:u,audioTracks:p,subtitles:m,captions:v,contentSteering:l,url:o,stats:t,networkDetails:r,sessionData:c,sessionKeys:d,startTimeOffset:h,variableList:f})}handleTrackOrLevelPlaylist(e,t,n,r,i){const a=this.hls,{id:o,level:s,type:l}=n,u=Xt(e,n),c=F(s)?s:F(o)?o:0,d=Qt(n),h=Nt.parseLevelPlaylist(e.data,u,c,d,0,this.variableList);if(l===Yt){const e={attrs:new Q({}),bitrate:0,details:h,name:"",url:u};a.trigger(V.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:u,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=h,this.handlePlaylistLoaded(h,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(V.ERROR,{type:G.NETWORK_ERROR,details:H.MANIFEST_PARSING_ERROR,fatal:t.type===Yt,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let a=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===jt?a+=`: ${e.level} id: ${e.id}`:e.type!==Kt&&e.type!==$t||(a+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(a);q.warn(`[playlist-loader]: ${a}`);let s=H.UNKNOWN,l=!1;const u=this.getInternalLoader(e);switch(e.type){case Yt:s=n?H.MANIFEST_LOAD_TIMEOUT:H.MANIFEST_LOAD_ERROR,l=!0;break;case jt:s=n?H.LEVEL_LOAD_TIMEOUT:H.LEVEL_LOAD_ERROR,l=!1;break;case Kt:s=n?H.AUDIO_TRACK_LOAD_TIMEOUT:H.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case $t:s=n?H.SUBTITLE_TRACK_LOAD_TIMEOUT:H.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(e.type);const c={type:G.NETWORK_ERROR,details:s,fatal:l,url:e.url,loader:u,context:e,error:o,networkDetails:t,stats:i};if(r){const n=(null==t?void 0:t.url)||e.url;c.response=D({url:n,data:void 0},r)}this.hls.trigger(V.ERROR,c)}handlePlaylistLoaded(e,t,n,r,i,a){const o=this.hls,{type:s,level:l,id:u,groupId:c,deliveryDirectives:d}=r,h=Xt(t,r),f=Qt(r),p="number"===typeof r.level&&f===qt?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void o.trigger(V.ERROR,{type:G.NETWORK_ERROR,details:H.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:e,reason:e.message,response:t,context:r,level:p,parent:f,networkDetails:i,stats:n})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const m=e.playlistParsingError;if(m)o.trigger(V.ERROR,{type:G.NETWORK_ERROR,details:H.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:m,reason:m.message,response:t,context:r,level:p,parent:f,networkDetails:i,stats:n});else switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),a.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),s){case Yt:case jt:o.trigger(V.LEVEL_LOADED,{details:e,level:p||0,id:u||0,stats:n,networkDetails:i,deliveryDirectives:d});break;case Kt:o.trigger(V.AUDIO_TRACK_LOADED,{details:e,id:u||0,groupId:c||"",stats:n,networkDetails:i,deliveryDirectives:d});break;case $t:o.trigger(V.SUBTITLE_TRACK_LOADED,{details:e,id:u||0,groupId:c||"",stats:n,networkDetails:i,deliveryDirectives:d})}}}function Jt(e,t){let n;try{n=new Event("addtrack")}catch(r){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function en(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(r){q.debug(`[texttrack-utils]: ${r}`);try{const n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(i){q.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}"disabled"===n&&(e.mode=n)}function tn(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let n=e.cues.length;n--;)e.removeCue(e.cues[n]);"disabled"===t&&(e.mode=t)}function nn(e,t,n,r){const i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0){const i=function(e,t,n){const r=[],i=function(e,t){if(te[n].endTime)return-1;let r=0,i=n;for(;r<=i;){const a=Math.floor((i+r)/2);if(te[a].startTime&&r-1)for(let a=i,o=e.length;a=t&&i.endTime<=n)r.push(i);else if(i.startTime>n)return r}return r}(e.cues,t,n);for(let t=0;t{const e=ln();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function dn(e,t){return e.getTime()/1e3-t}class hn{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(tn(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tcn&&(r=cn);r-n<=0&&(r=n+.25);for(let i=0;ie.type===an&&s:"video"===r?e=>e.type===sn&&o:e=>e.type===an&&s||e.type===sn&&o,nn(i,t,n,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:r}=this,{dateRanges:i}=t,a=Object.keys(i);if(r){const e=Object.keys(n).filter((e=>!a.includes(e)));for(let t=e.length;t--;){const i=e[t];Object.keys(n[i].cues).forEach((e=>{r.removeCue(n[i].cues[e])})),delete n[i]}}const o=t.fragments[t.fragments.length-1];if(0===a.length||!F(null==o?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=o.programDateTime/1e3-o.start,l=ln();for(let d=0;d{if(n!==t.id){const r=i[n];if(r.class===t.class&&r.startDate>t.startDate&&(!e||t.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:a,lowLatencyMode:o}=this.config,s=this.hls.userConfig;let l=o&&n||t;(s.liveSyncDuration||s.liveSyncDurationCount||0===l)&&(l=void 0!==i?i:a*r);const u=r;return l+Math.min(1*this.stallCount,u)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(null===e||null===t||null===n)return null;const r=n.edge,i=e-t-this.edgeStalled,a=r-n.totalduration,o=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,i),o)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(V.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(V.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(V.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(V.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(V.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(V.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===H.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(n=this.levelDetails)&&n.live&&q.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||1===i||!t.live)return;const a=this.targetLatency;if(null===a)return;const o=n-a;if(o.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,i)),n=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,n))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const pn=["NONE","TYPE-0","TYPE-1",null];const mn=["SDR","PQ","HLG"];var vn="",gn="YES",yn="v2";class _n{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class En{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter((e=>!!e)).map((e=>e.substring(0,4))).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return bn(this._audioGroups,e)}hasSubtitleGroup(e){return bn(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t)if("audio"===e){let e=this._audioGroups;e||(e=this._audioGroups=[]),-1===e.indexOf(t)&&e.push(t)}else if("text"===e){let e=this._subtitleGroups;e||(e=this._subtitleGroups=[]),-1===e.indexOf(t)&&e.push(t)}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return null==(e=this.audioGroups)?void 0:e[0]}get textGroupId(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}addFallback(){}}function bn(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function Sn(e,t){const n=t.startPTS;if(F(n)){let r,i=0;t.sn>e.sn?(i=n-e.start,r=e):(i=e.start-n,r=t),r.duration!==i&&(r.duration=i)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration}else t.start=Math.max(e.start-t.duration,0)}function An(e,t,n,r,i,a){r-n<=0&&(q.warn("Fragment should have a positive duration",t),r=n+t.duration,a=i+t.duration);let o=n,s=r;const l=t.startPTS,u=t.endPTS;if(F(l)){const e=Math.abs(l-n);F(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,o=Math.max(n,l),n=Math.min(n,l),i=Math.min(i,t.startDTS),s=Math.min(r,u),r=Math.max(r,u),a=Math.max(a,t.endDTS)}const c=n-t.start;0!==t.start&&(t.start=n),t.duration=r-t.start,t.startPTS=n,t.maxStartPTS=o,t.startDTS=i,t.endPTS=r,t.minEndPTS=s,t.endDTS=a;const d=t.sn;if(!e||de.endSN)return 0;let h;const f=d-e.startSN,p=e.fragments;for(p[f]=t,h=f;h>0;h--)Sn(p[h],p[h-1]);for(h=f;h=0;l--){const e=r[l].initSegment;if(e){n=e;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let i,a=0;if(function(e,t,n){const r=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,a=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,o=t.startSN-e.startSN,s=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let u=i;u<=a;u++){const e=l[o+u];let i=s[u];r&&!i&&u{e.relurl&&(a=e.cc-r.cc),F(e.startPTS)&&F(e.endPTS)&&(r.start=r.startPTS=e.startPTS,r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.duration=e.endPTS-e.startPTS,r.duration&&(i=r),t.PTSKnown=t.alignedSliding=!0),r.elementaryStreams=e.elementaryStreams,r.loader=e.loader,r.stats=e.stats,e.initSegment&&(r.initSegment=e.initSegment,n=e.initSegment)})),n){(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((e=>{var t;!e||e.initSegment&&e.initSegment.relurl!==(null==(t=n)?void 0:t.relurl)||(e.initSegment=n)}))}if(t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((e=>!e)),t.deltaUpdateFailed){q.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,n){const r=M({},e);n&&n.forEach((e=>{delete r[e]}));return Object.keys(t).forEach((e=>{const n=new Z(t[e].attr,r[e]);n.isValid?r[e]=n:q.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)})),r}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const o=t.fragments;if(a){q.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),i?An(t,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):wn(e,t),o.length&&(t.totalduration=t.edge-o[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const s=t.advancedDateTime;if(t.advanced&&s){const e=t.edge;t.driftStart||(t.driftStartTime=s,t.driftStart=e),t.driftEndTime=s,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function wn(e,t){const n=t.startSN+t.skippedSegments-e.startSN,r=e.fragments;n<0||n>=r.length||In(t,r[n].start)}function In(e,t){if(t){const n=e.fragments;for(let r=e.skippedSegments;r{const{details:n}=e;null!=n&&n.fragments&&n.fragments.forEach((e=>{e.level=t}))}))}function Pn(e){switch(e.details){case H.FRAG_LOAD_TIMEOUT:case H.KEY_LOAD_TIMEOUT:case H.LEVEL_LOAD_TIMEOUT:case H.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ln(e,t){const n=Pn(t);return e.default[(n?"timeout":"error")+"Retry"]}function On(e,t){const n="linear"===e.backoff?1:Math.pow(2,t);return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function Dn(e){return D(D({},e),{errorRetry:null,timeoutRetry:null})}function xn(e,t,n,r){if(!e)return!1;const i=null==r?void 0:r.code,a=t499)}(i)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,r,a):a}const Nn=function(e,t){let n=0,r=e.length-1,i=null,a=null;for(;n<=r;){i=(n+r)/2|0,a=e[i];const o=t(a);if(o>0)n=i+1;else{if(!(o<0))return a;r=i-1}}return null};function Mn(e,t,n=0,r=0){let i=null;if(e){i=t[e.sn-t[0].sn+1]||null;const r=e.endDTS-n;r>0&&r<15e-7&&(n+=15e-7)}else 0===n&&0===t[0].start&&(i=t[0]);if(i&&(!e||e.level===i.level)&&0===Fn(n,r,i))return i;const a=Nn(t,Fn.bind(null,n,r));return!a||a===e&&i?i:a}function Fn(e=0,t=0,n){if(n.start<=e&&n.start+n.duration>e)return 0;const r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=e?1:n.start-r>e&&n.start?-1:0}function Un(e,t,n){const r=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>e}var Bn=0,Vn=2,Gn=3,Hn=5,Yn=0,jn=1,Kn=2;class $n{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=q.log.bind(q,`${t}:`),this.warn=q.warn.bind(q,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const n=null==t?void 0:t.renditionReports;if(n){let i=-1;for(let a=0;a=0&&e>t.partTarget&&(a+=1)}return new _n(r,a>=0?a:void 0,vn)}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,n){const{details:r,stats:i}=t,a=self.performance.now(),o=i.loading.first?Math.max(0,a-i.loading.first):0;if(r.advancedDateTime=Date.now()-o,r.live||null!=n&&n.live){if(r.reloaded(n),n&&this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),n&&r.fragments.length>0&&Tn(n,r),!this.canLoad||!r.live)return;let o,s,l;if(r.canBlockReload&&r.endSN&&r.advanced){const e=this.hls.config.lowLatencyMode,i=r.lastPartSn,a=r.endSN,u=r.lastPartIndex,c=i===a;-1!==u?(s=c?a+1:i,l=c?e?0:u:u+1):s=a+1;const d=r.age,h=d+r.ageHeader;let f=Math.min(h-r.partTarget,1.5*r.targetduration);if(f>0){if(n&&f>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${f} with playlist age: ${r.age}`),f=0;else{const e=Math.floor(f/r.targetduration);if(s+=e,void 0!==l){l+=Math.round(f%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${d.toFixed(2)}s goal: ${f} skip sn ${e} to part ${l}`)}r.tuneInGoal=f}if(o=this.getDeliveryDirectives(r,t.deliveryDirectives,s,l),e||!c)return void this.loadPlaylist(o)}else(r.canBlockReload||r.canSkipUntil)&&(o=this.getDeliveryDirectives(r,t.deliveryDirectives,s,l));const u=this.hls.mainForwardBufferInfo,c=u?u.end-u.len:0,d=function(e,t=1/0){let n=1e3*e.targetduration;if(e.updated){const r=e.fragments,i=4;if(r.length&&n*i>t){const e=1e3*r[r.length-1].duration;ethis.requestScheduled+d&&(this.requestScheduled=i.loading.start),void 0!==s&&r.canBlockReload?this.requestScheduled=i.loading.first+d-(1e3*r.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+dthis.loadPlaylist(o)),h)}else this.clearTimer()}getDeliveryDirectives(e,t,n,r){let i=function(e,t){const{canSkipUntil:n,canSkipDateRanges:r,endSN:i}=e;return n&&(void 0!==t?t-i:0)=o.maxNumRetry)return!1;if(n&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=On(o,a);this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${a+1}/${o.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,r.resolved=!0}return s}}class qn{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class zn{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new qn(e),this.fast_=new qn(t),this.defaultTTFB_=r,this.ttfb_=new qn(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new qn(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new qn(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new qn(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){const n=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/n;this.fast_.sample(n,r),this.slow_.sample(n,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Wn={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},Qn={};function Xn(e,t,n,r,i,a){const o=e.audioCodec?e.audioGroups:null,s=null==a?void 0:a.audioCodec,l=null==a?void 0:a.channels,u=l?parseInt(l):s?1/0:2;let c=null;if(null!=o&&o.length)try{c=1===o.length&&o[0]?t.groups[o[0]].channels:o.reduce(((e,n)=>{if(n){const r=t.groups[n];if(!r)throw new Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach((t=>{e[t]=(e[t]||0)+r.channels[t]}))}return e}),{2:0})}catch(d){return!0}return void 0!==e.videoCodec&&(e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||!!c&&F(u)&&Object.keys(c).some((e=>parseInt(e)>u))}function Zn(e,t,n){const r=e.videoCodec,i=e.audioCodec;if(!r||!i||!n)return Promise.resolve(Wn);const a={width:e.width,height:e.height,bitrate:Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)),framerate:e.frameRate||30},o=e.videoRange;"SDR"!==o&&(a.transferFunction=o.toLowerCase());const s=r.split(",").map((e=>({type:"media-source",video:D(D({},a),{},{contentType:At(e,"video")})})));return i&&e.audioGroups&&e.audioGroups.forEach((e=>{var n;e&&(null==(n=t.groups[e])||n.tracks.forEach((t=>{if(t.groupId===e){const e=t.channels||"",n=parseFloat(e);F(n)&&n>2&&s.push.apply(s,i.split(",").map((e=>({type:"media-source",audio:{contentType:At(e,"audio"),channels:""+n}}))))}})))})),Promise.all(s.map((e=>{const t=function(e){const{audio:t,video:n}=e,r=n||t;if(r){const e=r.contentType.split('"')[1];if(n)return`r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${e}_${Math.ceil(n.bitrate/1e5)}`;if(t)return`c${t.channels}${t.spatialRendering?"s":"n"}_${e}`}return""}(e);return Qn[t]||(Qn[t]=n.decodingInfo(e))}))).then((e=>({supported:!e.some((e=>!e.supported)),configurations:s,decodingInfoResults:e}))).catch((e=>({supported:!1,configurations:s,decodingInfoResults:[],error:e})))}function Jn(e,t){let n=!1,r=[];return e&&(n="SDR"!==e,r=[e]),t&&(r=t.allowedVideoRanges||mn.slice(0),n=void 0!==t.preferHDR?t.preferHDR:function(){if("function"===typeof matchMedia){const e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),r=n?r.filter((e=>"SDR"!==e)):["SDR"]),{preferHDR:n,allowedVideoRanges:r}}function er(e,t){q.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function tr(e,t,n){if("attrs"in e){const n=t.indexOf(e);if(-1!==n)return n}for(let r=0;r-1===r.indexOf(e)))}(s,t.characteristics))&&(void 0===n||n(e,t))}function rr(e,t){const{audioCodec:n,channels:r}=e;return(void 0===n||(t.audioCodec||"").substring(0,4)===n.substring(0,4))&&(void 0===r||r===(t.channels||"2"))}function ir(e,t,n){for(let r=t;r;r--)if(n(e[r]))return r;for(let r=t+1;r1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var or="NOT_LOADED",sr="APPENDING",lr="PARTIAL",ur="OK";class cr{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(V.BUFFER_APPENDED,this.onBufferAppended,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this),e.on(V.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(V.BUFFER_APPENDED,this.onBufferAppended,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this),e.off(V.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let r=n.length;r--;){const t=n[r];if(!t)break;const i=t.end;if(t.start<=e&&null!==i&&e<=i)return t}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,r=Object.keys(n);for(let i=r.length;i--;){const a=n[r[i]];if((null==a?void 0:a.body.type)===t&&a.buffered){const t=a.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,n,r){this.timeRanges&&(this.timeRanges[e]=t);const i=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((r=>{const a=this.fragments[r];if(!a)return;if(i>=a.body.sn)return;if(!a.buffered&&!a.loaded)return void(a.body.type===n&&this.removeFragment(a.body));const o=a.range[e];o&&o.time.some((e=>{const n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(a.body),n}))}))}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:r}=e;if(!t||"initSegment"===n.sn)return;const i=hr(n),a=this.fragments[i];if(!a||a.buffered&&n.gap)return;const o=!n.relurl;if(Object.keys(t).forEach((e=>{const i=n.elementaryStreams[e];if(!i)return;const s=t[e],l=o||!0===i.partial;a.range[e]=this.getBufferedTimes(n,r,l,s)})),a.loaded=null,Object.keys(a.range).length){a.buffered=!0;(a.body.endList=n.endList||a.body.endList)&&(this.endListFragments[a.body.type]=a),dr(a)||this.removeParts(n.sn-1,n.type)}else this.removeFragment(a.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter((t=>t.fragment.sn>=e)))}fragBuffered(e,t){const n=hr(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,n,r){const i={time:[],partial:n},a=e.start,o=e.end,s=e.minEndPTS||o,l=e.maxStartPTS||a;for(let u=0;u=e&&s<=t){i.time.push({startPTS:Math.max(a,r.start(u)),endPTS:Math.min(o,r.end(u))});break}if(ae){const e=Math.max(a,r.start(u)),t=Math.min(o,r.end(u));t>e&&(i.partial=!0,i.time.push({startPTS:e,endPTS:t}))}else if(o<=e)break}return i}getPartialFragment(e){let t,n,r,i=null,a=0;const{bufferPadding:o,fragments:s}=this;return Object.keys(s).forEach((l=>{const u=s[l];u&&dr(u)&&(n=u.body.start-o,r=u.body.end+o,e>=n&&e<=r&&(t=Math.min(e-n,r-e),a<=t&&(i=u.body,a=t)))})),i}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||dr(t))}getState(e){const t=hr(e),n=this.fragments[t];return n?n.buffered?dr(n)?lr:ur:sr:or}isTimeBuffered(e,t,n){let r,i;for(let a=0;a=r&&t<=i)return!0;if(t<=r)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:r}=t;if("initSegment"===n.sn||n.bitrateTest)return;const i=r?null:t,a=hr(n);this.fragments[a]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:i}=t;if("initSegment"===n.sn)return;const a=n.type;if(r){let e=this.activePartLists[a];e||(this.activePartLists[a]=e=[]),e.push(r)}this.timeRanges=i,Object.keys(i).forEach((e=>{const t=i[e];this.detectEvictedFragments(e,t,a,r)}))}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=hr(e);return!!this.fragments[t]}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach((a=>{const o=this.fragments[a];if(!o)return;const s=o.body;s.type!==n||r&&!s.gap||s.starte&&(o.buffered||i)&&this.removeFragment(s)}))}removeFragment(e){const t=hr(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const t=e.sn;this.activePartLists[e.type]=n.filter((e=>e.fragment.sn!==t))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function dr(e){var t,n,r;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(n=e.range.audio)?void 0:n.partial)||(null==(r=e.range.audiovideo)?void 0:r.partial))}function hr(e){return`${e.type}_${e.level}_${e.sn}`}const fr={length:0,start:()=>0,end:()=>0};class pr{static isBuffered(e,t){try{if(e){const n=pr.getBuffered(e);for(let e=0;e=n.start(e)&&t<=n.end(e))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const r=pr.getBuffered(e),i=[];let a;for(a=0;ai&&(r[t-1].end=e[l].end):r.push(e[l])}else r.push(e[l])}else r=e;let i,a=0,o=t,s=t;for(let l=0;l=e&&tn.startCC||e&&e.cc{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some((e=>"GAP"===e[0])))return void s(Tr(e));e.gap=!1}const l=this.loader=e.loader=i?new i(r):new a(r),u=Ar(e),c=Dn(r.fragLoadPolicy.default),d={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:br};e.stats=l.stats,l.load(u,d,{onSuccess:(t,n,r,i)=>{this.resetLoader(e,l);let a=t.data;r.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(a.slice(0,16)),a=a.slice(16)),o({frag:e,part:null,payload:a,networkDetails:i})},onError:(t,r,i,a)=>{this.resetLoader(e,l),s(new wr({type:G.NETWORK_ERROR,details:H.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:D({url:n,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:i,stats:a}))},onAbort:(t,n,r)=>{this.resetLoader(e,l),s(new wr({type:G.NETWORK_ERROR,details:H.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:r,stats:t}))},onTimeout:(t,n,r)=>{this.resetLoader(e,l),s(new wr({type:G.NETWORK_ERROR,details:H.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:r,stats:t}))},onProgress:(n,r,i,a)=>{t&&t({frag:e,part:null,payload:i,networkDetails:a})}})}))}loadPart(e,t,n){this.abort();const r=this.config,i=r.fLoader,a=r.loader;return new Promise(((o,s)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void s(Tr(e,t));const l=this.loader=e.loader=i?new i(r):new a(r),u=Ar(e,t),c=Dn(r.fragLoadPolicy.default),d={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:br};t.stats=l.stats,l.load(u,d,{onSuccess:(r,i,a,s)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const u={frag:e,part:t,payload:r.data,networkDetails:s};n(u),o(u)},onError:(n,r,i,a)=>{this.resetLoader(e,l),s(new wr({type:G.NETWORK_ERROR,details:H.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:D({url:u.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:i,stats:a}))},onAbort:(n,r,i)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),s(new wr({type:G.NETWORK_ERROR,details:H.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:i,stats:n}))},onTimeout:(n,r,i)=>{this.resetLoader(e,l),s(new wr({type:G.NETWORK_ERROR,details:H.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:i,stats:n}))}})}))}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){const r=Math.round(e.duration/t.duration),a=Math.min(Math.round(n.loaded/i),r),o=(r-a)*Math.round(n.loaded/a);n.total=n.loaded+o}else n.total=Math.max(n.loaded,n.total);const a=n.loading,o=r.loading;a.start?a.first+=o.first-o.start:(a.start=o.start,a.first=o.first),a.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Ar(e,t=null){const n=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},i=n.byteRangeStartOffset,a=n.byteRangeEndOffset;if(F(i)&&F(a)){var o;let t=i,n=a;if("initSegment"===e.sn&&"AES-128"===(null==(o=e.decryptdata)?void 0:o.method)){const e=a-i;e%16&&(n=a+(16-e%16)),0!==i&&(r.resetIV=!0,t=i-16)}r.rangeStart=t,r.rangeEnd=n}return r}function Tr(e,t){const n=new Error(`GAP ${e.gap?"tag":"attribute"} found`),r={type:G.MEDIA_ERROR,details:H.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new wr(r)}class wr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ir{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class Cr{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}class Rr{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let r=0;r<4;r++)n[r]=t.getUint32(4*r);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],a=n[2],o=n[3],s=this.invSubMix,l=s[0],u=s[1],c=s[2],d=s[3],h=new Uint32Array(256);let f=0,p=0,m=0;for(m=0;m<256;m++)h[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){let n=p^p<<1^p<<2^p<<3^p<<4;n=n>>>8^255&n^99,e[f]=n,t[n]=f;const s=h[f],m=h[s],v=h[m];let g=257*h[n]^16843008*n;r[f]=g<<24|g>>>8,i[f]=g<<16|g>>>16,a[f]=g<<8|g>>>24,o[f]=g,g=16843009*v^65537*m^257*s^16843008*f,l[n]=g<<24|g>>>8,u[n]=g<<16|g>>>16,c[n]=g<<8|g>>>24,d[n]=g,f?(f=s^h[h[h[v^s]]],p^=h[h[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;r{if(!r)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new Ir(r,new Uint8Array(n)).decrypt(e.buffer,t)})).catch((r=>(q.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n))))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%16;return n!==e.length&&(t=Se(e,0,n),this.remainderData=Se(e,n)),t}logOnce(e){this.logEnabled&&(q.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Pr=function(e){let t="";const n=e.length;for(let r=0;ro.end){const e=a>i;(a{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)})).then((t=>{if(!t)return;const n=this.state;this.fragContextChanged(e)?(n===xr||!this.fragCurrent&&n===Fr)&&(this.fragmentTracker.removeFragment(e),this.state=Or):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(V.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))})).catch((t=>{this.state!==Lr&&this.state!==Vr&&(this.warn(t),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===sr){const t=e.type,r=this.getFwdBufferInfo(this.mediaBuffer,t),i=Math.max(e.duration,r?r.len:this.config.maxBufferLength);this.reduceMaxBufferLength(i)&&n.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===lr&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:n};this.hls.trigger(V.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t})).then((t=>{const{hls:n}=this,{payload:r}=t,i=e.decryptdata;if(r&&r.byteLength>0&&null!=i&&i.key&&i.iv&&"AES-128"===i.method){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).catch((t=>{throw n.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((r=>{const i=self.performance.now();return n.trigger(V.FRAG_DECRYPTED,{frag:e,payload:r,stats:{tstart:a,tdecrypt:i}}),t.payload=r,this.completeInitSegmentLoad(t)}))}return this.completeInitSegmentLoad(t)})).catch((t=>{this.state!==Lr&&this.state!==Vr&&(this.warn(t),this.resetFragmentLoading(e))}))}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state=Or,e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var n,r,i,a;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===qt?"level":"track"} ${e.level} (frag:[${(null!=(n=e.startPTS)?n:NaN).toFixed(3)}-${(null!=(r=e.endPTS)?r:NaN).toFixed(3)}] > buffer:${o?Pr(pr.getBuffered(o)):"(detached)"})`),"initSegment"!==e.sn){var s;if(e.type!==Wt){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return void(this.state=Or)}const t=null==(s=this.levels)?void 0:s[e.level];null!=t&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=Or,o&&(!this.loadedmetadata&&e.type==qt&&o.buffered.length&&(null==(i=this.fragCurrent)?void 0:i.sn)===(null==(a=this.fragPrevious)?void 0:a.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:r,partsLoaded:i}=e,a=!i||0===i.length||i.some((e=>!e)),o=new mr(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!a);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;const a=null==t?void 0:t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let o=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&a.encryptedFragments.length&&this.keyLoader.loadClear(e,a.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=Dr,this.fragCurrent=e,o=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(V.KEY_LOADED,e),this.state===Dr&&(this.state=Or),e})),this.hls.trigger(V.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){const i=a.partList;if(i&&r){n>e.end&&a.fragmentHint&&(e=a.fragmentHint);const s=this.getNextPart(i,e,n);if(s>-1){const l=i[s];let u;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${a.startSN}-${a.endSN}] parts [0-${s}-${i.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=xr,u=o?o.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(e,l,t,r))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,l,t,r).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(V.FRAG_LOADING,{frag:e,part:l,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(i,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${a?"of ["+a.startSN+"-"+a.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),F(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=xr;const s=this.config.progressive;let l;return l=s&&o?o.then((t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,r))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,s?r:void 0),o]).then((([e])=>(!s&&e&&r&&r(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(V.FRAG_LOADING,{frag:e,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,n,r){return new Promise(((i,a)=>{var o;const s=[],l=null==(o=n.details)?void 0:o.partList,u=t=>{this.fragmentLoader.loadPart(e,t,r).then((r=>{s[t.index]=r;const a=r.part;this.hls.trigger(V.FRAG_LOADED,r);const o=Cn(n,e.sn,t.index+1)||Rn(l,e.sn,t.index+1);if(!o)return i({frag:e,part:a,partsLoaded:s});u(o)})).catch(a)};u(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===H.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(V.ERROR,t)}else this.hls.trigger(V.ERROR,{type:G.OTHER_ERROR,details:H.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Fr)return void(this.fragCurrent||this.state===Lr||this.state===Vr||(this.state=Or));const{frag:n,part:r,level:i}=t,a=self.performance.now();n.stats.parsing.end=a,r&&(r.stats.parsing.end=a),this.updateLevelTiming(n,r,i,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:a}=e;if(null==t||!t[r])return this.warn(`Levels object was unset while buffering fragment ${i} of level ${r}. The current chunk will not be buffered.`),null;const o=t[r],s=a>-1?Cn(o,i,a):null,l=s?s.fragment:function(e,t,n){if(null==e||!e.details)return null;const r=e.details;let i=r.fragments[t-r.startSN];return i||(i=r.fragmentHint,i&&i.sn===t?i:ta&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return F(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:r}}=this,i=pr.bufferInfo(e,t,r);if(0===i.len&&void 0!==i.nextStart){const a=this.fragmentTracker.getBufferedFrag(t,n);if(a&&i.nextStart=n&&(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0)}getAppendedFrag(e,t=qt){const n=this.fragmentTracker.getAppendedFrag(e,qt);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:i}=this,a=n[0].start;let o;if(t.live){const s=i.initialLiveManifestSize;if(rt}getNextFragmentLoopLoading(e,t,n,r,i){const a=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(null===o)return o;if(e=o,a&&e&&!e.gap&&n.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r);if(null!==t&&n.len+t.len>=i)return this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,n){let r=-1,i=!1,a=!0;for(let o=0,s=e.length;o-1&&nn.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=function(e,t,n){if(null===t||!Array.isArray(e)||!e.length||!F(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;n=n||0;for(let r=0;r=e.startSN&&i<=e.endSN){const a=t[i-e.startSN];n.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=function(e,t){return Nn(e,(e=>e.cct?-1:0))}(t,n.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(r=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:a,endSN:o}=n;const{fragmentHint:s}=n,l=r.maxFragLookUpTolerance,u=n.partList,c=!!(r.lowLatencyMode&&null!=u&&u.length&&s);let d;if(c&&s&&!this.bitrateTest&&(a=a.concat(s),o=s.sn),et-l?0:l)}else d=a[a.length-1];if(d){const e=d.sn-n.startSN,t=this.fragmentTracker.getState(d);if((t===ur||t===lr&&d.gap)&&(i=d),i&&d.sn===i.sn&&(!c||u[0].fragment.sn>d.sn)){if(i&&d.level===i.level){const t=a[e+1];d=d.sn=a-t.maxFragLookUpTolerance&&i<=o;if(null!==r&&n.duration>r&&(i${e.startSN} prev-sn: ${i?i.sn:"na"} fragments: ${r}`),a}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let n=this.startPosition;if(n ${null==(r=this.fragCurrent)?void 0:r.url}`);const i=t.details===H.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(n,!0);const a=t.errorAction,{action:o,retryCount:s=0,retryConfig:l}=a||{};if(a&&o===Hn&&l){this.resetStartWhenNotLoaded(this.levelLastLoaded);const r=On(l,s);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${s+1}/${l.maxNumRetry} in ${r}ms`),a.resolved=!0,this.retryDate=self.performance.now()+r,this.state=Nr}else if(l&&a){if(this.resetFragmentErrors(e),!(s.5;r&&this.reduceMaxBufferLength(n.len);const i=!r;return i&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),i}return!1}resetFragmentErrors(e){e===zt&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Lr&&(this.state=Or)}afterBufferFlushed(e,t,n){if(!e)return;const r=pr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===Br&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Or}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){var i;const a=n.details;if(!a)return void this.warn("level.details undefined");if(!Object.keys(e.elementaryStreams).reduce(((t,i)=>{const o=e.elementaryStreams[i];if(o){const s=o.endPTS-o.startPTS;if(s<=0)return this.warn(`Could not parse fragment ${e.sn} ${i} duration reliably (${s})`),t||!1;const l=r?0:An(a,e,o.startPTS,o.endPTS,o.startDTS,o.endDTS);return this.hls.trigger(V.LEVEL_PTS_UPDATED,{details:a,level:n,drift:l,type:i,frag:e,start:o.startPTS,end:o.endPTS}),!0}return t}),!1)&&null===(null==(i=this.transmuxer)?void 0:i.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(0===n.fragmentError&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(t.message),this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Ur,this.hls.trigger(V.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class jr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;return e.length?(n=1===e.length?e[0]:function(e,t){const n=new Uint8Array(t);let r=0;for(let i=0;i0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:an,duration:Number.POSITIVE_INFINITY});i{if(F(e))return 90*e;return 9e4*t+(n?9e4*n.baseTime/n.timescale:0)};function zr(e,t){return 255===e[t]&&240===(246&e[t+1])}function Wr(e,t){return 1&e[t+1]?7:9}function Qr(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Xr(e,t){return t+1=e.length)return!1;const r=Qr(e,t);if(r<=n)return!1;const i=t+r;return i===e.length||Xr(e,i)}return!1}function Jr(e,t,n,r,i){if(!e.samplerate){const a=function(e,t,n,r){let i,a,o,s;const l=navigator.userAgent.toLowerCase(),u=r,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=1+((192&t[n+2])>>>6);const d=(60&t[n+2])>>>2;if(!(d>c.length-1))return o=(1&t[n+2])<<2,o|=(192&t[n+3])>>>6,q.log(`manifest codec:${r}, ADTS type:${i}, samplingIndex:${d}`),/firefox/i.test(l)?d>=6?(i=5,s=new Array(4),a=d-3):(i=2,s=new Array(2),a=d):-1!==l.indexOf("android")?(i=2,s=new Array(2),a=d):(i=5,s=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&d>=6?a=d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(d>=6&&1===o||/vivaldi/i.test(l))||!r&&1===o)&&(i=2,s=new Array(2)),a=d)),s[0]=i<<3,s[0]|=(14&d)>>1,s[1]|=(1&d)<<7,s[1]|=o<<3,5===i&&(s[1]|=(14&a)>>1,s[2]=(1&a)<<7,s[2]|=8,s[3]=0),{config:s,samplerate:c[d],channelCount:o,codec:"mp4a.40."+i,manifestCodec:u};{const t=new Error(`invalid ADTS sampling index:${d}`);e.emit(V.ERROR,V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message})}}(t,n,r,i);if(!a)return;e.config=a.config,e.samplerate=a.samplerate,e.channelCount=a.channelCount,e.codec=a.codec,e.manifestCodec=a.manifestCodec,q.log(`parsed codec:${e.codec}, rate:${a.samplerate}, channels:${a.channelCount}`)}}function ei(e){return 9216e4/e}function ti(e,t,n,r,i){const a=r+i*ei(e.samplerate),o=function(e,t){const n=Wr(e,t);if(t+n<=e.length){const r=Qr(e,t)-n;if(r>0)return{headerLength:n,frameLength:r}}}(t,n);let s;if(o){const{frameLength:r,headerLength:i}=o,l=i+r,u=Math.max(0,n+l-t.length);u?(s=new Uint8Array(l-i),s.set(t.subarray(n+i,t.length),0)):s=t.subarray(n+i,n+l);const c={unit:s,pts:a};return u||e.samples.push(c),{sample:c,length:l,missing:u}}const l=t.length-n;s=new Uint8Array(l),s.set(t.subarray(n,t.length),0);return{sample:{unit:s,pts:a},length:l,missing:-1}}let ni=null;const ri=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ii=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ai=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],oi=[0,1,1,4];function si(e,t,n,r,i){if(n+24>t.length)return;const a=li(t,n);if(a&&n+a.frameLength<=t.length){const o=r+i*(9e4*a.samplesPerFrame/a.sampleRate),s={unit:t.subarray(n,n+a.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(s),{sample:s,length:a.frameLength,missing:0}}}function li(e,t){const n=e[t+1]>>3&3,r=e[t+1]>>1&3,i=e[t+2]>>4&15,a=e[t+2]>>2&3;if(1!==n&&0!==i&&15!==i&&3!==a){const o=e[t+2]>>1&1,s=e[t+3]>>6,l=1e3*ri[14*(3===n?3-r:3===r?3:4)+i-1],u=ii[3*(3===n?0:2===n?1:2)+a],c=3===s?1:2,d=ai[n][r],h=oi[r],f=8*d*h,p=Math.floor(d*l/u+o)*h;if(null===ni){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ni=e?parseInt(e[1]):0}return!!ni&&ni<=87&&2===r&&l>=224e3&&0===s&&(e[t+3]=128|e[t+3]),{sampleRate:u,channelCount:c,frameLength:p,samplesPerFrame:f}}}function ui(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])}function ci(e,t){return t+1{let n=0,r=5;t+=r;const i=new Uint32Array(1),a=new Uint32Array(1),o=new Uint8Array(1);for(;r>0;){o[0]=e[t];const s=Math.min(r,8),l=8-s;a[0]=4278190080>>>24+l<>l,n=n?n<t.length)return-1;if(11!==t[n]||119!==t[n+1])return-1;const a=t[n+4]>>6;if(a>=3)return-1;const o=[48e3,44100,32e3][a],s=63&t[n+4],l=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*s+a];if(n+l>t.length)return-1;const u=t[n+6]>>5;let c=0;2===u?c+=2:(1&u&&1!==u&&(c+=2),4&u&&(c+=2));const d=(t[n+6]<<8|t[n+7])>>12-c&1,h=[2,1,2,3,3,4,4,5][u]+d,f=t[n+5]>>3,p=7&t[n+5],m=new Uint8Array([a<<6|f<<1|p>>2,(3&p)<<6|u<<3|d<<2|s>>4,s<<4&224]),v=r+i*(1536/o*9e4),g=t.subarray(n,n+l);return e.config=m,e.channelCount=h,e.samplerate=o,e.samples.push({unit:g,pts:v}),l}class vi{constructor(){this.VideoSample=null}createVideoSample(e,t,n,r){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:r,length:0}}getLastNalUnit(e){var t;let n,r=this.VideoSample;if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){const e=r.units;n=e[e.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const n=t.samples,r=n.length;if(!r)return void t.dropped++;{const t=n[r-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&q.log(e.pts+"/"+e.dts+":"+e.debug)}}class gi{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&q.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?n<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,n=8,r=8;for(let i=0;i{var a;switch(r.type){case 1:{let t=!1;o=!0;const i=r.data;if(l&&i.length>4){const e=new gi(i).readSliceType();2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var u;if(t)null!=(u=s)&&u.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null);s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),s.frame=!0,s.key=t;break}case 5:o=!0,null!=(a=s)&&a.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),s.key=!0,s.frame=!0;break;case 6:o=!0,lt(r.data,1,n.pts,t.samples);break;case 7:{var c,d;o=!0,l=!0;const t=r.data,n=new gi(t).readSPS();if(!e.sps||e.width!==n.width||e.height!==n.height||(null==(c=e.pixelRatio)?void 0:c[0])!==n.pixelRatio[0]||(null==(d=e.pixelRatio)?void 0:d[1])!==n.pixelRatio[1]){e.width=n.width,e.height=n.height,e.pixelRatio=n.pixelRatio,e.sps=[t],e.duration=i;const r=t.subarray(1,4);let a="avc1.";for(let e=0;e<3;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),a+=t}e.codec=a}break}case 8:o=!0,e.pps=[r.data];break;case 9:o=!0,e.audFound=!0,s&&this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:o=!0;break;default:o=!1,s&&(s.debug+="unknown NAL "+r.type+" ")}if(s&&o){s.units.push(r)}})),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let r=e.naluState||0;const i=r,a=[];let o,s,l,u=0,c=-1,d=0;for(-1===r&&(c=0,d=31&t[0],r=0,u=1);u=0){const e={data:t.subarray(c,s),type:d};a.push(e)}else{const n=this.getLastNalUnit(e.samples);n&&(i&&u<=4-i&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-i)),s>0&&(n.data=at(n.data,t.subarray(0,s)),n.state=0))}u=0&&r>=0){const e={data:t.subarray(c,n),type:d,state:r};a.push(e)}if(0===a.length){const n=this.getLastNalUnit(e.samples);n&&(n.data=at(n.data,t))}return e.naluState=r,a}}class _i{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new kr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(a).then((i=>{const a=new Uint8Array(i);r.set(a,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}))}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t);let r=0;for(let i=32;i{i.data=this.getAvcDecryptedUnit(a,o),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)}))}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void r();const i=e[t].units;for(;!(n>=i.length);n++){const a=i[n];if(!(a.data.length<=48||1!==a.type&&5!==a.type)&&(this.decryptAvcSample(e,t,n,r,a),!this.decrypter.isSync()))return}}}}const Ei=188;class bi{constructor(e,t,n){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.videoParser=new yi}static probe(e){const t=bi.syncOffset(e);return t>0&&q.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),-1!==t}static syncOffset(e){const t=e.length;let n=Math.min(940,t-Ei)+1,r=0;for(;r1&&(0===a&&o>2||s+Ei>n))return a}r++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Ye[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=bi.createTrack("video"),this._audioTrack=bi.createTrack("audio",r),this._id3Track=bi.createTrack("id3"),this._txtTrack=bi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){let i;n||(this.sampleAes=null);const a=this._videoTrack,o=this._audioTrack,s=this._id3Track,l=this._txtTrack;let u=a.pid,c=a.pesData,d=o.pid,h=s.pid,f=o.pesData,p=s.pesData,m=null,v=this.pmtParsed,g=this._pmtId,y=e.length;if(this.remainderData&&(y=(e=at(this.remainderData,e)).length,this.remainderData=null),y>4>1){if(y=S+5+e[S+4],y===S+Ei)continue}else y=S+4;switch(r){case u:t&&(c&&(i=Ii(c))&&this.videoParser.parseAVCPES(a,l,i,!1,this._duration),c={data:[],size:0}),c&&(c.data.push(e.subarray(y,S+Ei)),c.size+=S+Ei-y);break;case d:if(t){if(f&&(i=Ii(f)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,i);break;case"mp3":this.parseMPEGPES(o,i);break;case"ac3":this.parseAC3PES(o,i)}f={data:[],size:0}}f&&(f.data.push(e.subarray(y,S+Ei)),f.size+=S+Ei-y);break;case h:t&&(p&&(i=Ii(p))&&this.parseID3PES(s,i),p={data:[],size:0}),p&&(p.data.push(e.subarray(y,S+Ei)),p.size+=S+Ei-y);break;case 0:t&&(y+=e[y]+1),g=this._pmtId=Ai(e,y);break;case g:{t&&(y+=e[y]+1);const r=Ti(e,y,this.typeSupported,n);u=r.videoPid,u>0&&(a.pid=u,a.segmentCodec=r.segmentVideoCodec),d=r.audioPid,d>0&&(o.pid=d,o.segmentCodec=r.segmentAudioCodec),h=r.id3Pid,h>0&&(s.pid=h),null===m||v||(q.warn(`MPEG-TS PMT found at ${S} after unknown PID '${m}'. Backtracking to sync byte @${_} to parse all TS packets.`),m=null,S=_-188),v=this.pmtParsed=!0;break}case 17:case 8191:break;default:m=r}}else E++;if(E>0){const e=new Error(`Found ${E} TS packet/s that do not start with 0x47`);this.observer.emit(V.ERROR,V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message})}a.pesData=c,o.pesData=f,s.pesData=p;const b={audioTrack:o,videoTrack:a,id3Track:s,textTrack:l};return r&&this.extractRemainingSamples(b),b}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:r,textTrack:i}=e,a=n.pesData,o=t.pesData,s=r.pesData;let l;if(a&&(l=Ii(a))?(this.videoParser.parseAVCPES(n,i,l,!0,this._duration),n.pesData=null):n.pesData=a,o&&(l=Ii(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l)}t.pesData=null}else null!=o&&o.size&&q.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;s&&(l=Ii(s))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=s}demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new _i(this.observer,this.config,t);return this.decrypt(r,i)}decrypt(e,t){return new Promise((n=>{const{audioTrack:r,videoTrack:i}=e;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,(()=>{n(e)})):n(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(()=>{n(e)}))}))}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const r=this.aacOverFlow;let i,a,o,s=t.data;if(r){this.aacOverFlow=null;const t=r.missing,i=r.sample.unit.byteLength;if(-1===t)s=at(r.sample.unit,s);else{const a=i-t;r.sample.unit.set(s.subarray(0,t),a),e.samples.push(r.sample),n=r.missing}}for(i=n,a=s.length;i0;)s+=a}}parseID3PES(e,t){if(void 0===t.pts)return void q.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=M({},t,{type:this._videoTrack?sn:an,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Si(e,t){return((31&e[t+1])<<8)+e[t+2]}function Ai(e,t){return(31&e[t+10])<<8|e[t+11]}function Ti(e,t,n,r){const i={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},a=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t0){let r=t+5,s=o;for(;s>2;){if(106===e[r])!0!==n.ac3?q.log("AC-3 audio found, not supported in this browser for now"):(i.audioPid=a,i.segmentAudioCodec="ac3");const t=e[r+1]+2;r+=t,s-=t}}break;case 194:case 135:q.warn("Unsupported EC-3 in M2TS found");break;case 36:q.warn("Unsupported HEVC in M2TS found")}t+=o+5}return i}function wi(e){q.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function Ii(e){let t,n,r,i,a,o=0;const s=e.data;if(!e||0===e.size)return null;for(;s[0].length<19&&s.length>1;)s[0]=at(s[0],s[1]),s.splice(1,1);t=s[0];if(1===(t[0]<<16)+(t[1]<<8)+t[2]){if(n=(t[4]<<8)+t[5],n&&n>e.size-6)return null;const l=t[7];192&l&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(a=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,i-a>54e5&&(q.warn(`${Math.round((i-a)/9e4)}s delta between PTS and DTS, align them`),i=a)):a=i),r=t[8];let u=r+9;if(e.size<=u)return null;e.size-=u;const c=new Uint8Array(e.size);for(let e=0,n=s.length;en){u-=n;continue}t=t.subarray(u),n-=u,u=0}c.set(t,o),o+=n}return n&&(n-=r+3),{data:c,pts:i,dts:a,len:n}}return null}class Ci{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const Ri=Math.pow(2,32)-1;class ki{static init(){let e;for(e in ki.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},ki.types)ki.types.hasOwnProperty(e)&&(ki.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),n=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]);ki.HDLR_TYPES={video:t,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);ki.STTS=ki.STSC=ki.STCO=i,ki.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ki.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),ki.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ki.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);ki.FTYP=ki.box(ki.types.ftyp,a,s,a,o),ki.DINF=ki.box(ki.types.dinf,ki.box(ki.types.dref,r))}static box(e,...t){let n=8,r=t.length;const i=r;for(;r--;)n+=t[r].byteLength;const a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=255&n,a.set(e,4),r=0,n=8;r>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(e){return ki.box(ki.types.mdia,ki.mdhd(e.timescale,e.duration),ki.hdlr(e.type),ki.minf(e))}static mfhd(e){return ki.box(ki.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?ki.box(ki.types.minf,ki.box(ki.types.smhd,ki.SMHD),ki.DINF,ki.stbl(e)):ki.box(ki.types.minf,ki.box(ki.types.vmhd,ki.VMHD),ki.DINF,ki.stbl(e))}static moof(e,t,n){return ki.box(ki.types.moof,ki.mfhd(e),ki.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=ki.trak(e[t]);return ki.box.apply(null,[ki.types.moov,ki.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(ki.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=ki.trex(e[t]);return ki.box.apply(null,[ki.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Ri+1)),r=Math.floor(t%(Ri+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,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 ki.box(ki.types.mvhd,i)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,i;for(r=0;r>>8&255),i.push(255&r),i=i.concat(Array.prototype.slice.call(n));for(t=0;t>>8&255),a.push(255&r),a=a.concat(Array.prototype.slice.call(n));const o=ki.box(ki.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(a))),s=e.width,l=e.height,u=e.pixelRatio[0],c=e.pixelRatio[1];return ki.box(ki.types.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,s>>8&255,255&s,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,ki.box(ki.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ki.box(ki.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,c>>24,c>>16&255,c>>8&255,255&c])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0])}static mp4a(e){return ki.box(ki.types.mp4a,ki.audioStsd(e),ki.box(ki.types.esds,ki.esds(e)))}static mp3(e){return ki.box(ki.types[".mp3"],ki.audioStsd(e))}static ac3(e){return ki.box(ki.types["ac-3"],ki.audioStsd(e),ki.box(ki.types.dac3,e.config))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?ki.box(ki.types.stsd,ki.STSD,ki.mp3(e)):"ac3"===e.segmentCodec?ki.box(ki.types.stsd,ki.STSD,ki.ac3(e)):ki.box(ki.types.stsd,ki.STSD,ki.mp4a(e)):ki.box(ki.types.stsd,ki.STSD,ki.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,r=e.width,i=e.height,a=Math.floor(n/(Ri+1)),o=Math.floor(n%(Ri+1));return ki.box(ki.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,255&r,0,0,i>>8&255,255&i,0,0]))}static traf(e,t){const n=ki.sdtp(e),r=e.id,i=Math.floor(t/(Ri+1)),a=Math.floor(t%(Ri+1));return ki.box(ki.types.traf,ki.box(ki.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),ki.box(ki.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a])),ki.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,ki.box(ki.types.trak,ki.tkhd(e),ki.mdia(e))}static trex(e){const t=e.id;return ki.box(ki.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],r=n.length,i=12+16*r,a=new Uint8Array(i);let o,s,l,u,c,d;for(t+=8+i,a.set(["video"===e.type?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),o=0;o>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o);return ki.box(ki.types.trun,a)}static initSegment(e){ki.types||ki.init();const t=ki.moov(e);return at(ki.FTYP,t)}}ki.types=void 0,ki.HDLR_TYPES=void 0,ki.STTS=void 0,ki.STSC=void 0,ki.STCO=void 0,ki.STSZ=void 0,ki.VMHD=void 0,ki.SMHD=void 0,ki.STSD=void 0,ki.FTYP=void 0,ki.DINF=void 0;const Pi=9e4;function Li(e,t,n=1,r=!1){const i=e*t*n;return r?Math.round(i):i}function Oi(e,t=!1){return Li(e,1e3,1/Pi,t)}let Di,xi=null,Ni=null;class Mi{constructor(e,t,n,r=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,null===xi){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);xi=e?parseInt(e[1]):0}if(null===Ni){const e=navigator.userAgent.match(/Safari\/(\d+)/i);Ni=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){q.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){q.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){q.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e.reduce(((e,n)=>{const r=n.pts-e;return r<-4294967296?(t=!0,Fi(e,n.pts)):r>0?e:n.pts}),e[0].pts);return t&&q.debug("PTS rollover detected"),n}remux(e,t,n,r,i,a,o,s){let l,u,c,d,h,f,p=i,m=i;const v=e.pid>-1,g=t.pid>-1,y=t.samples.length,_=e.samples.length>0,E=o&&y>0||y>1;if((!v||_)&&(!g||E)||this.ISGenerated||o){if(this.ISGenerated){var b,S,A,T;const e=this.videoTrackConfig;!e||t.width===e.width&&t.height===e.height&&(null==(b=t.pixelRatio)?void 0:b[0])===(null==(S=e.pixelRatio)?void 0:S[0])&&(null==(A=t.pixelRatio)?void 0:A[1])===(null==(T=e.pixelRatio)?void 0:T[1])||this.resetInitSegment()}else c=this.generateIS(e,t,i,a);const n=this.isVideoContiguous;let r,o=-1;if(E&&(o=function(e){for(let t=0;t0){q.warn(`[mp4-remuxer]: Dropped ${o} out of ${y} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(o),t.dropped+=o,m+=(t.samples[0].pts-e)/t.inputTimeScale,r=m}else-1===o&&(q.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(_&&E){const n=this.getVideoStartPts(t.samples),r=(Fi(e.samples[0].pts,n)-n)/t.inputTimeScale;p+=Math.max(0,r),m+=Math.max(0,-r)}if(_){if(e.samplerate||(q.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(e,t,i,a)),u=this.remuxAudio(e,p,this.isAudioContiguous,a,g||E||s===zt?m:void 0),E){const r=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(q.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(e,t,i,a)),l=this.remuxVideo(t,m,n,r)}}else E&&(l=this.remuxVideo(t,m,n,0));l&&(l.firstKeyFrame=o,l.independent=-1!==o,l.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=Ui(n,i,this._initPTS,this._initDTS)),r.samples.length&&(d=Bi(r,i,this._initPTS))),{audio:u,video:l,initSegment:c,independent:f,text:d,id3:h}}generateIS(e,t,n,r){const i=e.samples,a=t.samples,o=this.typeSupported,s={},l=this._initPTS;let u,c,d,h=!l||r,f="audio/mp4";if(h&&(u=c=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}s.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&o.mpeg?new Uint8Array(0):ki.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(d=e.inputTimeScale,l&&d===l.timescale?h=!1:u=c=i[0].pts-Math.round(d*n))}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,s.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:ki.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(d=t.inputTimeScale,l&&d===l.timescale)h=!1;else{const e=this.getVideoStartPts(a),t=Math.round(d*n);c=Math.min(c,Fi(a[0].dts,e)-t),u=Math.min(u,e-t)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(s).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:u,timescale:d},this._initDTS={baseTime:c,timescale:d}):u=d=void 0,{tracks:s,initPTS:u,timescale:d}}remuxVideo(e,t,n,r){const i=e.inputTimeScale,a=e.samples,o=[],s=a.length,l=this._initPTS;let u,c,d=this.nextAvcDts,h=8,f=this.videoSampleDuration,p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,v=!1;if(!n||null===d){const e=t*i,r=a[0].pts-Fi(a[0].dts,a[0].pts);xi&&null!==d&&Math.abs(e-r-d)<15e3?n=!0:d=e-r}const g=l.baseTime*i/l.timescale;for(let D=0;D0?D-1:D].dts&&(v=!0)}v&&a.sort((function(e,t){const n=e.dts-t.dts,r=e.pts-t.pts;return n||r})),u=a[0].dts,c=a[a.length-1].dts;const y=c-u,_=y?Math.round(y/(s-1)):f||e.inputTimeScale/30;if(n){const e=u-d,n=e>_,r=e<-1;if((n||r)&&(n?q.warn(`AVC: ${Oi(e,!0)} ms (${e}dts) hole between fragments detected at ${t.toFixed(3)}`):q.warn(`AVC: ${Oi(-e,!0)} ms (${e}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!r||d>=a[0].pts||xi)){u=d;const t=a[0].pts-e;if(n)a[0].dts=u,a[0].pts=t;else for(let n=0;nt);n++)a[n].dts-=e,a[n].pts-=e;q.log(`Video: Initial PTS/DTS adjusted: ${Oi(t,!0)}/${Oi(u,!0)}, delta: ${Oi(e,!0)} ms`)}}u=Math.max(0,u);let E=0,b=0,S=u;for(let D=0;D0?e.dts-a[D-1].dts:_;if(n=D>0?e.pts-a[D-1].pts:_,t.stretchShortVideoTrack&&null!==this.nextAudioPts){const n=Math.floor(t.maxBufferHole*i),a=(r?p+r*i:this.nextAudioPts)-e.pts;a>n?(f=a-o,f<0?f=o:I=!0,q.log(`[mp4-remuxer]: It is approximately ${a/90} ms to the next segment; using duration ${f/90} ms for the last video frame.`)):f=o}else f=o}const u=Math.round(e.pts-e.dts);C=Math.min(C,f),k=Math.max(k,f),R=Math.min(R,n),P=Math.max(P,n),o.push(new Vi(e.key,f,l,u))}if(o.length)if(xi){if(xi<70){const e=o[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(Ni&&P-R0&&(r&&Math.abs(v-m)<9e3||Math.abs(Fi(f[0].pts-g,v)-m)<20*l),f.forEach((function(e){e.pts=Fi(e.pts-g,v)})),!n||m<0){if(f=f.filter((e=>e.pts>=0)),!f.length)return;m=0===i?0:r&&!h?Math.max(0,v):f[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let n=0,r=m;n=t*l&&u<1e4&&h){let t=Math.round(s/l);r=o-t*l,r<0&&(t--,r+=l),0===n&&(this.nextAudioPts=m=r),q.warn(`[mp4-remuxer]: Injecting ${t} audio frame @ ${(r/a).toFixed(3)}s due to ${Math.round(1e3*s/a)} ms gap.`);for(let a=0;a0))return;b+=p;try{y=new Uint8Array(b)}catch(k){return void this.observer.emit(V.ERROR,V.ERROR,{type:G.MUX_ERROR,details:H.REMUX_ALLOC_ERROR,fatal:!1,error:k,bytes:b,reason:`fail allocating audio mdat ${b}`})}if(!c){new DataView(y.buffer).setUint32(0,b),y.set(ki.types.mdat,4)}}y.set(r,p);const a=r.byteLength;p+=a,d.push(new Vi(!0,s,a,0)),E=i}const A=d.length;if(!A)return;const T=d[d.length-1];this.nextAudioPts=m=E+o*T.duration;const w=c?new Uint8Array(0):ki.moof(e.sequenceNumber++,_/o,M({},e,{samples:d}));e.samples=[];const I=_/a,C=m/a,R={data1:w,data2:y,startPTS:I,endPTS:C,startDTS:I,endDTS:C,type:"audio",hasAudio:!0,hasVideo:!1,nb:A};return this.isAudioContiguous=!0,R}remuxEmptyAudio(e,t,n,r){const i=e.inputTimeScale,a=i/(e.samplerate?e.samplerate:i),o=this.nextAudioPts,s=this._initDTS,l=9e4*s.baseTime/s.timescale,u=(null!==o?o:r.startDTS*i)+l,c=r.endDTS*i+l,d=1024*a,h=Math.ceil((c-u)/d),f=Ci.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(q.warn("[mp4-remuxer]: remux empty Audio"),!f)return void q.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const p=[];for(let m=0;m4294967296;)e+=n;return e}function Ui(e,t,n,r){const i=e.samples.length;if(!i)return;const a=e.inputTimeScale;for(let s=0;se.pts-t.pts));const a=e.samples;return e.samples=[],{samples:a}}class Vi{constructor(e,t,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=r,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}function Gi(e,t){const n=null==e?void 0:e.codec;if(n&&n.length>4)return n;if(t===ee){if("ec-3"===n||"ac-3"===n||"alac"===n)return n;if("fLaC"===n||"Opus"===n){return Rt(n,!1)}const e="mp4a.40.5";return q.info(`Parsed audio codec "${n}" or audio object type not handled. Using "${e}"`),e}return q.warn(`Unhandled video codec "${n}"`),"hvc1"===n||"hev1"===n?"hvc1.1.6.L120.90":"av01"===n?"av01.0.04M.08":"avc1.42e01e"}try{Di=self.performance.now.bind(self.performance)}catch(wg){q.debug("Unable to use Performance API on this environment"),Di=null==ce?void 0:ce.Date.now}const Hi=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){const i=this.videoTrack=Kr("video",1),a=this.audioTrack=Kr("audio",1),o=this.txtTrack=Kr("text",1);if(this.id3Track=Kr("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const s=Ze(e);if(s.video){const{id:e,timescale:t,codec:n}=s.video;i.id=e,i.timescale=o.timescale=t,i.codec=n}if(s.audio){const{id:e,timescale:t,codec:n}=s.audio;a.id=e,a.timescale=t,a.codec=n}o.id=Ye.text,i.sampleDuration=0,i.duration=a.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return function(e){const t=e.byteLength;for(let n=0;n8&&109===e[n+4]&&111===e[n+5]&&111===e[n+6]&&102===e[n+7])return!0;n=r>1?n+r:t}return!1}(e)}demux(e,t){this.timeOffset=t;let n=e;const r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=at(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},n=Qe(e,["moof"]);if(n.length<2)return t.remainder=e,t;const r=n[n.length-1];return t.valid=Se(e,0,r.byteOffset-8),t.remainder=Se(e,r.byteOffset-8),t}(n);this.remainderData=t.remainder,r.samples=t.valid||new Uint8Array}else r.samples=n;const a=this.extractID3Track(r,t);return i.samples=ot(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return n.samples=ot(e,t),{videoTrack:t,audioTrack:Kr(),id3Track:r,textTrack:Kr()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=Qe(e.samples,["emsg"]);r&&r.forEach((e=>{const r=function(e){const t=e[0];let n="",r="",i=0,a=0,o=0,s=0,l=0,u=0;if(0===t){for(;"\0"!==je(e.subarray(u,u+1));)n+=je(e.subarray(u,u+1)),u+=1;for(n+=je(e.subarray(u,u+1)),u+=1;"\0"!==je(e.subarray(u,u+1));)r+=je(e.subarray(u,u+1)),u+=1;r+=je(e.subarray(u,u+1)),u+=1,i=$e(e,12),a=$e(e,16),s=$e(e,20),l=$e(e,24),u=28}else if(1===t){u+=4,i=$e(e,u),u+=4;const t=$e(e,u);u+=4;const a=$e(e,u);for(u+=4,o=2**32*t+a,U(o)||(o=Number.MAX_SAFE_INTEGER,q.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),s=$e(e,u),u+=4,l=$e(e,u),u+=4;"\0"!==je(e.subarray(u,u+1));)n+=je(e.subarray(u,u+1)),u+=1;for(n+=je(e.subarray(u,u+1)),u+=1;"\0"!==je(e.subarray(u,u+1));)r+=je(e.subarray(u,u+1)),u+=1;r+=je(e.subarray(u,u+1)),u+=1}return{schemeIdUri:n,value:r,timeScale:i,presentationTime:o,presentationTimeDelta:a,eventDuration:s,id:l,payload:e.subarray(u,e.byteLength)}}(e);if(hi.test(r.schemeIdUri)){const e=F(r.presentationTime)?r.presentationTime/r.timeScale:t+r.presentationTimeDelta/r.timeScale;let i=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;i<=.001&&(i=Number.POSITIVE_INFINITY);const a=r.payload;n.samples.push({data:a,len:a.byteLength,dts:e,pts:e,type:sn,duration:i})}}))}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}},remux:class{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(function(e,t){if(!e||!t)return e;const n=t.keyId;n&&t.isCommonEncryption&&Qe(e,["moov","trak"]).forEach((e=>{const t=Qe(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let r=Qe(t,["enca"]);const i=r.length>0;i||(r=Qe(t,["encv"])),r.forEach((e=>{Qe(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=rt(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(q.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${Ve(e)} -> ${Ve(n)}`),t.set(n,8))}}))}))}));return e}(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const r=this.initData=Ze(e);r.audio&&(t=Gi(r.audio,ee)),r.video&&(n=Gi(r.video,te));const i={};r.audio&&r.video?i.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:r.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?i.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:q.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,n,r,i,a){var o,s;let{initPTS:l,lastEndTime:u}=this;const c={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};F(u)||(u=this.lastEndTime=i||0);const d=t.samples;if(null==d||!d.length)return c;const h={initPTS:void 0,timescale:1};let f=this.initData;if(null!=(o=f)&&o.length||(this.generateInitSegment(d),f=this.initData),null==(s=f)||!s.length)return q.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),c;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const p=function(e,t){let n=0,r=0,i=0;const a=Qe(e,["moof","traf"]);for(let o=0;oe+t.info.duration||0),0);n=Math.max(n,e+a.earliestPresentationTime/a.timescale),r=n-t}}if(r&&F(r))return r}return r||i}(d,f),m=function(e,t){return Qe(t,["moof","traf"]).reduce(((t,n)=>{const r=Qe(n,["tfdt"])[0],i=r[0],a=Qe(n,["tfhd"]).reduce(((t,n)=>{const a=$e(n,4),o=e[a];if(o){let e=$e(r,4);if(1===i){if(e===Ge)return q.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;e*=Ge+1,e+=$e(r,8)}const n=e/(o.timescale||9e4);if(F(n)&&(null===t||ni}(l,v,i,p)||h.timescale!==l.timescale&&a)&&(h.initPTS=v-i,l&&1===l.timescale&&q.warn("Adjusting initPTS by "+(h.initPTS-l.baseTime)),this.initPTS=l={baseTime:h.initPTS,timescale:1});const g=e?v-l.baseTime/l.timescale:u,y=g+p;!function(e,t,n){Qe(t,["moof","traf"]).forEach((t=>{Qe(t,["tfhd"]).forEach((r=>{const i=$e(r,4),a=e[i];if(!a)return;const o=a.timescale||9e4;Qe(t,["tfdt"]).forEach((e=>{const t=e[0],r=n*o;if(r){let n=$e(e,4);if(0===t)n-=r,n=Math.max(n,0),We(e,4,n);else{n*=Math.pow(2,32),n+=$e(e,8),n-=r,n=Math.max(n,0);const t=Math.floor(n/(Ge+1)),i=Math.floor(n%(Ge+1));We(e,4,t),We(e,8,i)}}}))}))}))}(f,d,l.baseTime/l.timescale),p>0?this.lastEndTime=y:(q.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const _=!!f.audio,E=!!f.video;let b="";_&&(b+="audio"),E&&(b+="video");const S={data1:d,startPTS:g,startDTS:g,endPTS:y,endDTS:y,type:b,hasAudio:_,hasVideo:E,nb:1,dropped:0};return c.audio="audio"===S.type?S:void 0,c.video="audio"!==S.type?S:void 0,c.initSegment=h,c.id3=Ui(n,i,l,l),r.samples.length&&(c.text=Bi(r,i,l)),c}}},{demux:bi,remux:Mi},{demux:class extends $r{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=we(e,0);let n=(null==t?void 0:t.length)||0;if(di(e,n))return!1;for(let r=e.length;n0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(n=t);return n}(a,t);if(_&&"AES-128"===_.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(a,_.key.buffer,_.iv.buffer).then((e=>{const t=this.push(e,null,n);return this.decryptionPromise=null,t})),this.decryptionPromise;{let t=e.softwareDecrypt(a,_.key.buffer,_.iv.buffer);if(n.part>-1&&(t=e.flush()),!t)return i.executeEnd=Di(),ji(n);a=new Uint8Array(t)}}const E=this.needsProbing(u,c);if(E){const e=this.configureTransmuxer(a);if(e)return q.warn(`[transmuxer] ${e.message}`),this.observer.emit(V.ERROR,V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),i.executeEnd=Di(),ji(n)}(u||c||f||E)&&this.resetInitSegment(y,p,m,g,t),(u||f||E)&&this.resetInitialTimestamp(v),l||this.resetContiguity();const b=this.transmux(a,_,h,d,n),S=this.currentTransmuxState;return S.contiguous=!0,S.discontinuity=!1,S.trackSwitch=!1,i.executeEnd=Di(),b}flush(e){const t=e.transmuxing;t.executeStart=Di();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return i.then((()=>this.flush(e)));const a=[],{timeOffset:o}=r;if(n){const t=n.flush();t&&a.push(this.push(t,null,e))}const{demuxer:s,remuxer:l}=this;if(!s||!l)return t.executeEnd=Di(),[ji(e)];const u=s.flush(o);return Ki(u)?u.then((t=>(this.flushRemux(a,t,e),a))):(this.flushRemux(a,u,e),a)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:i,id3Track:a,textTrack:o}=t,{accurateTimeOffset:s,timeOffset:l}=this.currentTransmuxState;q.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const u=this.remuxer.remux(r,i,a,o,l,s,!0,this.id);e.push({remuxResult:u,chunkMeta:n}),n.transmuxing.executeEnd=Di()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,i){const{demuxer:a,remuxer:o}=this;a&&o&&(a.resetInitSegment(e,t,n,r),o.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,i){let a;return a=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,r,i):this.transmuxUnencrypted(e,n,r,i),a}transmuxUnencrypted(e,t,n,r){const{audioTrack:i,videoTrack:a,id3Track:o,textTrack:s}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,a,o,s,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,this.id),chunkMeta:i})))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r,vendor:i}=this;let a;for(let d=0,h=Hi.length;d({remuxResult:{},chunkMeta:e});function Ki(e){return"then"in e&&e.then instanceof Function}class $i{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class qi{constructor(e,t,n,r,i,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=a}}var zi={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i{(t=t||{}).frag=this.frag,t.id=this.id,e===V.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new Wi,this.observer.on(V.FRAG_DECRYPTED,a),this.observer.on(V.ERROR,a);const o=_t(i.preferManagedMediaSource)||{isTypeSupported:()=>!1},s={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')},l=navigator.vendor;if(this.useWorker&&"undefined"!==typeof Worker){if(i.workerPath||"function"===typeof __HLS_WORKER_BUNDLE__){try{i.workerPath?(q.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=function(e){const t=new self.URL(e,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}(i.workerPath)):(q.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e);return{worker:new self.Worker(t),objectURL:t}}()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const n=new Error(`${e.message} (${e.filename}:${e.lineno})`);i.enableWorker=!1,q.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(V.ERROR,{type:G.OTHER_ERROR,details:H.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:n})},e.postMessage({cmd:"init",typeSupported:s,vendor:l,id:t,config:JSON.stringify(i)})}catch(wg){q.warn(`Error setting up "${t}" Web Worker, fallback to inline`,wg),this.resetWorker(),this.error=null,this.transmuxer=new Yi(this.observer,s,i,l,t)}return}}this.transmuxer=new Yi(this.observer,s,i,l,t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,r,i,a,o,s,l,u){var c,d;l.transmuxing.start=self.performance.now();const{transmuxer:h}=this,f=a?a.start:i.start,p=i.decryptdata,m=this.frag,v=!(m&&i.cc===m.cc),g=!(m&&l.level===m.level),y=m?l.sn-m.sn:-1,_=this.part?l.part-this.part.index:-1,E=0===y&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),b=!g&&(1===y||0===y&&(1===_||E&&_<=0)),S=self.performance.now();(g||y||0===i.stats.parsing.start)&&(i.stats.parsing.start=S),!a||!_&&b||(a.stats.parsing.start=S);const A=!(m&&(null==(c=i.initSegment)?void 0:c.url)===(null==(d=m.initSegment)?void 0:d.url)),T=new qi(v,b,s,g,f,A);if(!b||v||A){q.log(`[transmuxer-interface, ${i.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${v}\n trackSwitch: ${g}\n contiguous: ${b}\n accurateTimeOffset: ${s}\n timeOffset: ${f}\n initSegmentChange: ${A}`);const e=new $i(n,r,t,o,u);this.configureTransmuxer(e)}if(this.frag=i,this.part=a,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:p,chunkMeta:l,state:T},e instanceof ArrayBuffer?[e]:[]);else if(h){const t=h.push(e,p,l,T);Ki(t)?(h.async=!0,t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")}))):(h.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);Ki(n)||t.async?(Ki(n)||(n=Promise.resolve(n)),n.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")}))):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}onWorkerMessage(e){const t=e.data,n=this.hls;switch(t.event){case"init":{var r;const e=null==(r=this.workerContext)?void 0:r.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":q[t.data.logType]&&q[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data)}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Xi(e,t){if(e.length!==t.length)return!1;for(let n=0;ne[n]!==t[n]))}function Ji(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}class ea{constructor(e){this.buffered=void 0;const t=(t,n,r)=>{if((n>>>=0)>r-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${r})`);return e[n][t]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class ta{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const r=this.queues[t];r.push(e),1!==r.length||n||this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise((e=>{t=e})),r={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,e),n}executeNext(e){const t=this.queues[e];if(t.length){const r=t[0];try{r.execute()}catch(n){q.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${n}`),r.onError(n);const t=this.buffers[e];null!=t&&t.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const na=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;function ra(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach((t=>{e.removeChild(t)}))}const ia={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},aa=function(e){let t=e;return ia.hasOwnProperty(e)&&(t=ia[e]),String.fromCharCode(t)},oa=15,sa=100,la={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ua={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ca={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},da={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ha=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class fa{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"===typeof t?t():t;q.log(`${this.time} [${e}] ${n}`)}}}const pa=function(e){const t=[];for(let n=0;nsa&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=sa)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n=144&&this.backSpace();const t=aa(e);this.pos>=sa?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e)));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",r=-1;for(let i=0;i0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}getTextAndFormat(){return this.rows}}class Ea{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new _a(n),this.nonDisplayedMemory=new _a(n),this.lastOutputScreen=new _a(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;nt+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class ba{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const r=this.logger=new fa;this.channels=[null,new Ea(e,t,r),new Ea(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let n,r,i,a=!1;this.logger.time=e;for(let o=0;o ("+pa([r,i])+")"),n=this.parseCmd(r,i),n||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n&&(a=this.parseChars(r,i),a)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(a)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}n||a||this.logger.log(2,"Couldn't parse cleaned data "+pa([r,i])+" orig: "+pa([t[o],t[o+1]]))}}parseCmd(e,t){const{cmdHistory:n}=this;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;if(Aa(e,t,n))return Sa(null,null,n),this.logger.log(3,"Repeated command ("+pa([e,t])+") is dropped"),!0;const r=20===e||21===e||23===e?1:2,i=this.channels[r];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),Sa(e,t,n),this.currentChannel=r,!0}parseMidrow(e,t){let n=0;if((17===e||25===e)&&t>=32&&t<=47){if(n=17===e?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return!!r&&(r.ccMIDROW(t),this.logger.log(3,"MIDROW ("+pa([e,t])+")"),!0)}return!1}parsePAC(e,t){let n;const r=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;if(Aa(e,t,r))return Sa(null,null,r),!0;const i=e<=23?1:2;n=t>=64&&t<=95?1===i?la[e]:ca[e]:1===i?ua[e]:da[e];const a=this.channels[i];return!!a&&(a.setPAC(this.interpretPAC(n,t)),Sa(e,t,r),this.currentChannel=i,!0)}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1===(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let e;e=17===i?t+80:18===i?t+112:t+144,this.logger.log(2,"Special char '"+aa(e)+"' in channel "+n),r=[e]}else e>=32&&e<=127&&(r=0===t?[e]:[e,t]);if(r){const n=pa(r);this.logger.log(3,"Char codes = "+n.join(",")),Sa(e,t,this.cmdHistory)}return r}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let n;const r={};16===e||24===e?(n=Math.floor((t-32)/2),r.background=ha[n],t%2===1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));const i=e<=23?1:2;return this.channels[i].setBkgData(r),Sa(e,t,this.cmdHistory),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var wa=function(){if(null!=ce&&ce.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function n(e,t){if("string"!==typeof t)return!1;if(!Array.isArray(e))return!1;const n=t.toLowerCase();return!!~e.indexOf(n)&&n}function r(e){return n(t,e)}function i(e,...t){let n=1;for(;n100)throw new Error("Position must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},l,{get:function(){return E},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},l,{get:function(){return S},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");S=t,this.hasBeenReset=!0}})),s.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class Ia{decode(e,t){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Ca(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(r||0)}const n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}class Ra{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r=0&&n<=100)return this.set(e,n),!0}return!1}}function ka(e,t,n,r){const i=r?e.split(r):[e];for(const a in i){if("string"!==typeof i[a])continue;const e=i[a].split(n);if(2!==e.length)continue;t(e[0],e[1])}}const Pa=new wa(0,0,""),La="middle"===Pa.align?"middle":"center";function Oa(e,t,n){const r=e;function i(){const t=Ca(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=i(),a(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.slice(3),a(),t.endTime=i(),a(),function(e,t){const r=new Ra;ka(e,(function(e,t){let i;switch(e){case"region":for(let i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),r.integer(e,i[0]),r.percent(e,i[0])&&r.set("snapToLines",!1),r.alt(e,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",La,"end"]);break;case"position":i=t.split(","),r.percent(e,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start",La,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",La,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");let i=r.get("line","auto");"auto"===i&&-1===Pa.line&&(i=-1),t.line=i,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",La);let a=r.get("position","auto");"auto"===a&&50===Pa.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}(e,t)}function Da(e){return e.replace(//gi,"\n")}class xa{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Ia,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function n(){let e=t.buffer,n=0;for(e=Da(e);n>>0).toString()};function Ua(e,t,n){return Fa(e.toString())+Fa(t.toString())+Fa(n)}function Ba(e,t,n,r,i,a,o){const s=new xa,l=Fe(new Uint8Array(e)).trim().replace(Na,"\n").split("\n"),u=[],c=t?function(e,t=1){return Li(e,Pi,1/t)}(t.baseTime,t.timescale):0;let d,h="00:00.000",f=0,p=0,m=!0;s.oncue=function(e){const a=n[r];let o=n.ccOffset;const s=(f-c)/9e4;if(null!=a&&a.new&&(void 0!==p?o=n.ccOffset=a.start:function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!=(a=i)&&a.new;){var a;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n}(n,r,s)),s){if(!t)return void(d=new Error("Missing initPTS for VTT MPEGTS"));o=s-n.presentationOffset}const l=e.endTime-e.startTime,h=Fi(9e4*(e.startTime+o-p),9e4*i)/9e4;e.startTime=Math.max(h,0),e.endTime=Math.max(h+l,0);const m=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(m)),e.id||(e.id=Ua(e.startTime,e.endTime,m)),e.endTime>0&&u.push(e)},s.onparsingerror=function(e){d=e},s.onflush=function(){d?o(d):a(u)},l.forEach((e=>{if(m){if(Ma(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach((e=>{Ma(e,"LOCAL:")?h=e.slice(6):Ma(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))}));try{p=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!F(t)||!F(n)||!F(r)||!F(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=6e4*r,t+=36e5*i,t}(h)/1e3}catch(t){d=t}return}""===e&&(m=!1)}s.parse(e+"\n")})),s.flush()}const Va="stpp.ttml.im1t",Ga=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ha=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Ya={left:"start",center:"center",right:"end",start:"start",end:"end"};function ja(e,t,n,r){const i=Qe(new Uint8Array(e),["mdat"]);if(0===i.length)return void r(new Error("Could not parse IMSC1 mdat"));const a=i.map((e=>Fe(e))),o=function(e,t,n=1,r=!1){return Li(e,t,1/n,r)}(t.baseTime,1,t.timescale);try{a.forEach((e=>n(function(e,t){const n=(new DOMParser).parseFromString(e,"text/xml"),r=n.getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(i).reduce(((e,t)=>(e[t]=r.getAttribute(`ttp:${t}`)||i[t],e)),{}),o="preserve"!==r.getAttribute("xml:space"),s=$a(Ka(r,"styling","style")),l=$a(Ka(r,"layout","region")),u=Ka(r,"body","[begin]");return[].map.call(u,(e=>{const n=qa(e,o);if(!n||!e.hasAttribute("begin"))return null;const r=Qa(e.getAttribute("begin"),a),i=Qa(e.getAttribute("dur"),a);let u=Qa(e.getAttribute("end"),a);if(null===r)throw Wa(e);if(null===u){if(null===i)throw Wa(e);u=r+i}const c=new wa(r-t,u-t,n);c.id=Ua(c.startTime,c.endTime,c.text);const d=function(e,t,n){const r="http://www.w3.org/ns/ttml#styling";let i=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;o&&n.hasOwnProperty(o)&&(i=n[o]);return a.reduce(((n,a)=>{const o=za(t,r,a)||za(e,r,a)||za(i,r,a);return o&&(n[a]=o),n}),{})}(l[e.getAttribute("region")],s[e.getAttribute("style")],s),{textAlign:h}=d;if(h){const e=Ya[h];e&&(c.lineAlign=e),c.align=h}return M(c,d),c})).filter((e=>null!==e))}(e,o))))}catch(s){r(s)}}function Ka(e,t,n){const r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function $a(e){return e.reduce(((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function qa(e,t){return[].slice.call(e.childNodes).reduce(((e,n,r)=>{var i;return"br"===n.nodeName&&r?e+"\n":null!=(i=n.childNodes)&&i.length?qa(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function za(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function Wa(e){return new Error(`Could not parse ttml timestamp ${e}`)}function Qa(e,t){if(!e)return null;let n=Ca(e);return null===n&&(Ga.test(e)?n=function(e,t){const n=Ga.exec(e),r=(0|n[4])+(0|n[5])/t.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/t.frameRate}(e,t):Ha.test(e)&&(n=function(e,t){const n=Ha.exec(e),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),n}function Xa(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function Za(e,t){return!!e&&e.kind===Xa(t)&&Ji(t,e)}class Ja{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(V.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.BUFFER_CODECS,this.onBufferCodecs,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(V.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.BUFFER_CODECS,this.onBufferCodecs,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&F(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&q.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter(((t,n)=>this.isLevelAllowed(t)&&n<=e));return this.clientRect=null,Ja.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,n){if(null==e||!e.length)return-1;let r=e.length-1;const i=Math.max(t,n);for(let s=0;s=i||t.height>=i)&&(a=t,!(o=e[s+1])||a.width!==o.width||a.height!==o.height)){r=s;break}}var a,o;return r}}const eo="[eme]";class to{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=to.CDMCleanupPromise?[to.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=q.debug.bind(q,eo),this.log=q.log.bind(q,eo),this.warn=q.warn.bind(q,eo),this.error=q.error.bind(q,eo),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(V.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(V.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===de.WIDEVINE&&n)return n;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(e,t,n)=>!!e&&n.indexOf(e)===t,r=t.map((e=>e.audioCodec)).filter(n),i=t.map((e=>e.videoCodec)).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise(((t,n)=>{const a=e=>{const o=e.shift();this.getMediaKeysPromise(o,r,i).then((e=>t({keySystem:o,mediaKeys:e}))).catch((t=>{e.length?a(e):n(t instanceof no?t:new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};a(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!==typeof n){let e=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===Ee&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return n(e,t)}getMediaKeysPromise(e,t,n){const r=function(e,t,n,r){let i;switch(e){case de.FAIRPLAY:i=["cenc","sinf"];break;case de.WIDEVINE:case de.PLAYREADY:i=["cenc"];break;case de.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,n,r){return[{initDataTypes:e,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs="${e}"`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:n.map((e=>({contentType:`video/mp4; codecs="${e}"`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(i,t,n,r)}(e,t,n,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let a=null==i?void 0:i.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(r)}`),a=this.requestMediaKeySystemAccess(e,r);const t=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),a.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const r=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=n.createMediaKeys().then((t=>(this.log(`Media-keys created for "${e}"`),r.then((n=>n?this.setMediaKeysServerCertificate(t,e,n):t))))),t.mediaKeys.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),t.mediaKeys}))}return a.then((()=>i.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Ve(e.keyId||[])}`);const r=n.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return Ve(e.keyId)}updateKeySession(e,t){var n;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Ve((null==(n=e.decryptdata)?void 0:n.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise(((t,n)=>{const r=_e(this.config),i=e.map(ve).filter((e=>!!e&&-1!==r.indexOf(e)));return this.getKeySystemSelectionPromise(i).then((({keySystem:e})=>{const r=ye(e);r?t(r):n(new Error(`Unable to find format for key-system "${e}"`))})).catch(n)}))}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let i=this.keyIdToKeySessionPromise[n];return i||(i=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then((({keySystem:n,mediaKeys:i})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(n,i).then((()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:n,mediaKeys:i,decryptdata:t});return this.generateRequestWithPreferredKeySession(e,"cenc",t.pssh,"playlist-key")}))))),i.catch((e=>this.handleError(e)))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof no?this.hls.trigger(V.ERROR,e.data):this.hls.trigger(V.ERROR,{type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const t=ve(e.keyFormat),n=t?[t]:_e(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=_e(this.config)),0===e.length)throw new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:n}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===n)return;let r,i;if("sinf"===t&&this.config.drmSystems[de.FAIRPLAY]){const e=je(new Uint8Array(n));try{const t=se(JSON.parse(e).sinf),n=rt(new Uint8Array(t));if(!n)return;r=n.subarray(8,24),i=de.FAIRPLAY}catch(u){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},n=new DataView(e),r=n.getUint32(0);if(e.byteLength!==r&&r>44)return null;if(1886614376!==n.getUint32(4))return null;if(t.version=n.getUint32(8)>>>24,t.version>1)return null;t.systemId=Ve(new Uint8Array(e,12,16));const i=n.getUint32(28);if(0===t.version){if(r-32this.generateRequestWithPreferredKeySession(e,t,n,"encrypted-event-key-match")));break}}l||(l=o[a]=this.getKeySystemSelectionPromise([i]).then((({keySystem:e,mediaKeys:i})=>{var o;this.throwIfDestroyed();const s=new ht("ISO-23001-7",a,null!=(o=ye(e))?o:"");return s.pssh=new Uint8Array(n),s.keyId=r,this.attemptSetMediaKeys(e,i).then((()=>{this.throwIfDestroyed();const r=this.createMediaKeySessionContext({decryptdata:s,keySystem:e,mediaKeys:i});return this.generateRequestWithPreferredKeySession(r,t,n,"encrypted-event-no-match")}))}))),l.catch((e=>this.handleError(e)))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(n).then((()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===n.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,n,r){var i,a;const o=null==(i=this.config.drmSystems)||null==(a=i[e.keySystem])?void 0:a.generateRequest;if(o)try{const r=o.call(this.hls,t,n,e);if(!r)throw new Error("Invalid response from configured generateRequest filter");t=r.initDataType,n=e.decryptdata.pssh=r.initData?new Uint8Array(r.initData):null}catch(f){var s;if(this.warn(f.message),null!=(s=this.hls)&&s.config.debug)throw f}if(null===n)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${l} (init data type: ${t} length: ${n?n.byteLength:null})`);const u=new Wi,c=e._onmessage=t=>{const n=e.mediaKeysSession;if(!n)return void u.emit("error",new Error("invalid state"));const{messageType:r,message:i}=t;this.log(`"${r}" message event for session "${n.sessionId}" message size: ${i.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(e,i).catch((e=>{this.handleError(e),u.emit("error",e)})):"license-release"===r?e.keySystem===de.FAIRPLAY&&(this.updateKeySession(e,ue("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${r}"`)},d=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void u.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const n=e.keyStatus;u.emit("keyStatus",n),"expired"===n&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",c),e.mediaKeysSession.addEventListener("keystatuseschange",d);const h=new Promise(((e,t)=>{u.on("error",t),u.on("keyStatus",(n=>{n.startsWith("usable")?e():"output-restricted"===n?t(new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===n?t(new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${n}"`)):"expired"===n?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${n}"`)}))}));return e.mediaKeysSession.generateRequest(t,n).then((()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)})).catch((e=>{throw new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>h)).catch((t=>{throw u.removeAllListeners(),this.removeSession(e),t})).then((()=>(u.removeAllListeners(),e)))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach(((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Ve("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Ve(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t}))}fetchServerCertificate(e){const t=this.config,n=new(0,t.loader)(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise(((i,a)=>{const o={responseType:"arraybuffer",url:r},s=t.certLoadPolicy.default,l={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,n,r)=>{i(e.data)},onError:(t,n,i,s)=>{a(new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:D({url:o.url,data:void 0},t)},`"${e}" certificate request failed (${r}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,i)=>{a(new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:o.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(e,t,n)=>{a(new Error("aborted"))}};n.load(o,l,u)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise(((r,i)=>{e.setServerCertificate(n).then((i=>{this.log(`setServerCertificate ${i?"success":"not supported by CDM"} (${null==n?void 0:n.byteLength}) on "${t}"`),r(e)})).catch((e=>{i(new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((e=>{throw new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=(new DOMParser).parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let t;for(let n=0,r=i.length;n in key message");return ue(atob(l))}setupLicenseXHR(e,t,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then((()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,n,r)})).catch((a=>{if(!n.decryptdata)throw a;return e.open("POST",t,!0),i.call(this.hls,e,t,n,r)})).then((n=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:n||r}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise(((r,i)=>{const a=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${a}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(4===o.readyState)if(200===o.status){this._requestLicenseFailureCount=0;let t=o.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const n=this.config.licenseResponseCallback;if(n)try{t=n.call(this.hls,o,a,e)}catch(s){this.error(s)}r(t)}else{const s=n.errorRetry,l=s?s.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||o.status>=400&&o.status<500)i(new no({type:G.KEY_SYSTEM_ERROR,details:H.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:a,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${a}). Status: ${o.status} (${o.statusText})`));else{const n=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,a,e,t).then((({xhr:t,licenseChallenge:n})=>{e.keySystem==de.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(t,n)),t.send(n)}))}))}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},ht.clearKeyUriToKeyIdMap();const n=t.length;to.CDMCleanupPromise=Promise.all(t.map((e=>this.removeSession(e))).concat(null==e?void 0:e.setMediaKeys(null).catch((e=>{this.log(`Could not clear media keys: ${e}`)})))).then((()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)})).catch((e=>{this.log(`Could not close sessions and clear media keys: ${e}`)}))}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);return r>-1&&this.mediaKeySessions.splice(r,1),t.remove().catch((e=>{this.log(`Could not remove session: ${e}`)})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`)}))}}}to.CDMCleanupPromise=void 0;class no extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var ro,io,ao;!function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"}(ro||(ro={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(io||(io={})),function(e){e.OBJECT="CMCD-Object",e.REQUEST="CMCD-Request",e.SESSION="CMCD-Session",e.STATUS="CMCD-Status"}(ao||(ao={}));const oo={[ao.OBJECT]:["br","d","ot","tb"],[ao.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[ao.SESSION]:["cid","pr","sf","sid","st","v"],[ao.STATUS]:["bs","rtp"]};class so{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map((e=>e instanceof so?e:new so(e)))),this.value=e,this.params=t}}class lo{constructor(e){this.description=void 0,this.description=e}}const uo="Dict";function co(e,t,n,r){return new Error(`failed to ${e} "${i=t,Array.isArray(i)?JSON.stringify(i):i instanceof Map?"Map{}":i instanceof Set?"Set{}":"object"===typeof i?JSON.stringify(i):String(i)}" as ${n}`,{cause:r});var i}const ho="Bare Item",fo="Boolean",po="Byte Sequence",mo="Decimal",vo="Integer";const go=/[\x00-\x1f\x7f]+/,yo="Token",_o="Key";function Eo(e,t,n){return co("serialize",e,t,n)}function bo(e){if(!1===ArrayBuffer.isView(e))throw Eo(e,po);return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function So(e){if(function(e){return e<-999999999999999||99999999999999912)throw Eo(e,mo);const n=t.toString();return n.includes(".")?n:`${n}.0`}const wo="String";function Io(e){const t=(n=e).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw Eo(t,yo);return t}function Co(e){switch(typeof e){case"number":if(!F(e))throw Eo(e,ho);return Number.isInteger(e)?So(e):To(e);case"string":return function(e){if(go.test(e))throw Eo(e,wo);return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return Io(e);case"boolean":return function(e){if("boolean"!==typeof e)throw Eo(e,fo);return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${So(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return bo(e);if(e instanceof lo)return Io(e);default:throw Eo(e,ho)}}function Ro(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw Eo(e,_o);return e}function ko(e){return null==e?"":Object.entries(e).map((([e,t])=>!0===t?`;${Ro(e)}`:`;${Ro(e)}=${Co(t)}`)).join("")}function Po(e){return e instanceof so?`${Co(e.value)}${ko(e.params)}`:Co(e)}function Lo(e,t={whitespace:!0}){if("object"!==typeof e)throw Eo(e,uo);const n=e instanceof Map?e.entries():Object.entries(e),r=null!=t&&t.whitespace?" ":"";return Array.from(n).map((([e,t])=>{t instanceof so===!1&&(t=new so(t));let n=Ro(e);var r;return!0===t.value?n+=ko(t.params):(n+="=",Array.isArray(t.value)?n+=`(${(r=t).value.map(Po).join(" ")})${ko(r.params)}`:n+=Po(t)),n})).join(`,${r}`)}const Oo=e=>"ot"===e||"sf"===e||"st"===e,Do=e=>"number"===typeof e?F(e):null!=e&&""!==e&&!1!==e;const xo=e=>Math.round(e),No=e=>100*xo(e/100),Mo={br:xo,d:xo,bl:No,dl:No,mtp:No,nor:(e,t)=>(null!=t&&t.baseUrl&&(e=function(e,t){const n=new URL(e),r=new URL(t);if(n.origin!==r.origin)return e;const i=n.pathname.split("/").slice(1),a=r.pathname.split("/").slice(1,-1);for(;i[0]===a[0];)i.shift(),a.shift();for(;a.length;)a.shift(),i.unshift("..");return i.join("/")}(e,t.baseUrl)),encodeURIComponent(e)),rtp:No,tb:xo};function Fo(e,t={}){return e?function(e,t){return Lo(e,t)}(function(e,t){const n={};if(null==e||"object"!==typeof e)return n;const r=Object.keys(e).sort(),i=M({},Mo,null==t?void 0:t.formatters),a=null==t?void 0:t.filter;return r.forEach((r=>{if(null!=a&&a(r))return;let o=e[r];const s=i[r];s&&(o=s(o,t)),"v"===r&&1===o||"pr"==r&&1===o||Do(o)&&(Oo(r)&&"string"===typeof o&&(o=new lo(o)),n[r]=o)})),n}(e,t),M({whitespace:!1},t)):""}function Uo(e,t,n){return M(e,function(e,t={}){if(!e)return{};const n=Object.entries(e),r=Object.entries(oo).concat(Object.entries((null==t?void 0:t.customHeaderMap)||{})),i=n.reduce(((e,t)=>{var n;const[i,a]=t,o=(null==(n=r.find((e=>e[1].includes(i))))?void 0:n[0])||ao.REQUEST;return null!=e[o]||(e[o]={}),e[o][i]=a,e}),{});return Object.entries(i).reduce(((e,[n,r])=>(e[n]=Fo(r,t),e)),{})}(t,n))}const Bo="CMCD";const Vo=/CMCD=[^&#]+/;function Go(e,t,n){const r=function(e,t={}){if(!e)return"";const n=Fo(e,t);return`${Bo}=${encodeURIComponent(n)}`}(t,n);if(!r)return e;if(Vo.test(e))return e.replace(Vo,r);const i=e.includes("?")?"&":"?";return`${e}${i}${r}`}function Ho(e,t,n,r){e&&Object.keys(t).forEach((i=>{const a=e.filter((e=>e.groupId===i)).map((e=>{const a=M({},e);return a.details=void 0,a.attrs=new Q(a.attrs),a.url=a.attrs.URI=Yo(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),a.groupId=a.attrs["GROUP-ID"]=t[i],a.attrs["PATHWAY-ID"]=r,a}));e.push(...a)}))}function Yo(e,t,n,r){const{HOST:i,PARAMS:a,[n]:o}=r;let s;t&&(s=null==o?void 0:o[t],s&&(e=s));const l=new self.URL(e);return i&&!s&&(l.host=i),a&&Object.keys(a).sort().forEach((e=>{e&&l.searchParams.set(e,a[e])})),l.href}const jo=/^age:\s*[\d.]+\s*$/im;class Ko{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new J,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then((()=>{if(!this.stats.aborted)return i(n,t.url)})).catch((e=>(n.open("GET",t.url,!0),i(n,t.url)))).then((()=>{this.stats.aborted||this.openAndSendXhr(n,t,e)})).catch((e=>{this.callbacks.onError({code:n.status,text:e.message},t,n,r)})):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:a}=n.loadPolicy;if(r)for(const o in r)e.setRequestHeader(o,r[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&F(i)?i:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const r=t.status,a="text"!==t.responseType;if(r>=200&&r<300&&(a&&t.response||null!==t.responseText)){n.loading.end=Math.max(self.performance.now(),n.loading.first);const i=a?t.response:t.responseText,o="arraybuffer"===t.responseType?i.byteLength:i.length;if(n.loaded=n.total=o,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first),!this.callbacks)return;const s=this.callbacks.onProgress;if(s&&s(n,e,i,t),!this.callbacks)return;const l={url:t.responseURL,data:i,code:r};this.callbacks.onSuccess(l,n,e,t)}else{const a=i.loadPolicy.errorRetry;xn(a,n.retry,!1,{url:e.url,data:void 0,code:r})?this.retry(a):(q.error(`${r} while loading ${e.url}`),this.callbacks.onError({code:r,text:t.statusText},e,t,n))}}}loadtimeout(){var e;const t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(xn(t,this.stats.retry,!0))this.retry(t);else{var n;q.warn(`timeout while loading ${null==(n=this.context)?void 0:n.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=On(e,n.retry),n.retry++,q.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==t?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&jo.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const $o=/(\d+)-(\d+)\/(\d+)/;class qo{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||zo,this.controller=new self.AbortController,this.stats=new J}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const i=function(e,t){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(M({},e.headers))};e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return n}(e,this.controller.signal),a=n.onProgress,o="arraybuffer"===e.responseType,s=o?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=l&&F(l)?l:u,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),n.onTimeout(r,e,this.response)}),t.timeout),self.fetch(this.request).then((i=>{this.response=this.loader=i;const s=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),n.onTimeout(r,e,this.response)}),u-(s-r.loading.start)),!i.ok){const{status:e,statusText:t}=i;throw new Wo(t||"fetch, bad network response",e,i)}return r.loading.first=s,r.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=$o.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(F(e))return e}const n=e.get("Content-Length");if(n)return parseInt(n)}(i.headers)||r.total,a&&F(t.highWaterMark)?this.loadProgressively(i,r,e,t.highWaterMark,a):o?i.arrayBuffer():"json"===e.responseType?i.json():i.text()})).then((i=>{const o=this.response;if(!o)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const l=i[s];l&&(r.loaded=r.total=l);const u={url:o.url,data:i,code:o.status};a&&!F(t.highWaterMark)&&a(r,e,i,o),n.onSuccess(u,r,e,o)})).catch((t=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const i=t&&t.code||0,a=t?t.message:null;n.onError({code:i,text:a},e,t?t.details:null,r)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){const a=new jr,o=e.body.getReader(),s=()=>o.read().then((o=>{if(o.done)return a.dataLength&&i(t,n,a.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=o.value,u=l.length;return t.loaded+=u,u=r&&i(t,n,a.flush(),e)):i(t,n,l,e),s()})).catch((()=>Promise.reject()));return s()}}function zo(e,t){return new self.Request(e.url,t)}class Wo extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Qo=/\s/,Xo={newCue(e,t,n,r){const i=[];let a,o,s,l,u;const c=self.VTTCue||self.TextTrackCue;for(let h=0;h=16?l--:l++;const r=Da(u.trim()),f=Ua(t,n,r);null!=e&&null!=(d=e.cues)&&d.getCueById(f)||(o=new c(t,n,r),o.id=f,o.line=h+1,o.align="left",o.position=10+Math.min(80,10*Math.floor(8*l/32)),i.push(o))}return e&&i.length&&(i.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),i.forEach((t=>en(e,t)))),i}},Zo=D(D({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Ko,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:e,partCurrent:t,hls:n}=this,{autoLevelEnabled:r,media:i}=n;if(!e||!i)return;const a=performance.now(),o=t?t.stats:e.stats,s=t?t.duration:e.duration,l=a-o.loading.start,u=n.minAutoLevel;if(o.aborted||o.loaded&&o.loaded===o.total||e.level<=u)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!r||i.paused||!i.playbackRate||!i.readyState)return;const c=n.mainForwardBufferInfo;if(null===c)return;const d=this.bwEstimator.getEstimateTTFB(),h=Math.abs(i.playbackRate);if(l<=Math.max(d,s/(2*h)*1e3))return;const f=c.len/h,p=o.loading.first?o.loading.first-o.loading.start:-1,m=o.loaded&&p>-1,v=this.getBwEstimate(),g=n.levels,y=g[e.level],_=o.total||Math.max(o.loaded,Math.round(s*y.averageBitrate/8));let E=m?l-p:l;E<1&&m&&(E=Math.min(l,8*o.loaded/v));const b=m?1e3*o.loaded/E:0,S=b?(_-o.loaded)/b:8*_/v+d/1e3;if(S<=f)return;const A=b?8*b:v;let T,w=Number.POSITIVE_INFINITY;for(T=e.level-1;T>u;T--){const e=g[T].maxBitrate;if(w=this.getTimeToLoadFrag(d/1e3,A,s*e,!g[T].details),w=S)return;if(w>10*s)return;n.nextLoadLevel=n.nextAutoLevel=T,m?this.bwEstimator.sample(l-Math.min(d,p),o.loaded):this.bwEstimator.sampleTTFB(l);const I=g[T].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>I&&this.resetEstimator(I),this.clearTimer(),q.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${f.toFixed(3)} s\n Estimated load time for current fragment: ${S.toFixed(3)} s\n Estimated load time for down switch fragment: ${w.toFixed(3)} s\n TTFB estimate: ${0|p} ms\n Current BW estimate: ${F(v)?0|v:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${T} @ ${0|I} bps`),n.trigger(V.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:o})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(q.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new zn(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.FRAG_LOADING,this.onFragLoading,this),e.on(V.FRAG_LOADED,this.onFragLoaded,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this),e.on(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.FRAG_LOADING,this.onFragLoading,this),e.off(V.FRAG_LOADED,this.onFragLoaded,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this),e.off(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(V.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){var r;if(!n.bitrateTest)this.fragCurrent=n,this.partCurrent=null!=(r=t.part)?r:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case H.BUFFER_ADD_CODEC_ERROR:case H.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case H.FRAG_LOAD_TIMEOUT:{const e=t.frag,{fragCurrent:n,partCurrent:r}=this;if(e&&n&&e.sn===n.sn&&e.level===n.level){const t=performance.now(),n=r?r.stats:e.stats,i=t-n.loading.start,a=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&a>-1){const e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(i-Math.min(e,a),n.loaded)}else this.bwEstimator.sampleTTFB(i)}break}}}getTimeToLoadFrag(e,t,n,r){return e+n/t+(r?this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,i=r.end-r.start;F(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const r=n?n.stats:t.stats;if(t.type===qt&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const e=n?n.duration:t.duration,i=this.hls.levels[t.level],a=(i.loaded?i.loaded.bytes:0)+r.loaded,o=(i.loaded?i.loaded.duration:0)+e;i.loaded={bytes:a,duration:o},i.realBitrate=Math.round(8*a/o)}if(t.bitrateTest){const e={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(V.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,i=null!=r&&r.stats.loaded?r.stats:n.stats;if(i.aborted)return;if(this.ignoreFragment(n))return;const a=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==qt||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;const a=this.hls.firstLevel,o=Math.min(Math.max(a,t),e);return q.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(-1!==e&&(!t||!n||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:r,config:i,minAutoLevel:a}=n,o=t?t.duration:e?e.duration:0,s=this.getBwEstimate(),l=this.getStarvationDelay();let u=i.abrBandWidthFactor,c=i.abrBandWidthUpFactor;if(l){const e=this.findBestLevel(s,a,r,l,0,u,c);if(e>=0)return e}let d=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay;if(!l){const e=this.bitrateTestDelay;if(e){d=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-e,q.info(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),u=c=1}}const h=this.findBestLevel(s,a,r,l,d,u,c);if(q.info(`[abr] ${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`),h>-1)return h;const f=n.levels[a],p=n.levels[n.loadLevel];return(null==f?void 0:f.bitrate)<(null==p?void 0:p.bitrate)?a:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,a,o){var s;const l=r+i,u=this.lastLoadedFragLevel,c=-1===u?this.hls.firstLevel:u,{fragCurrent:d,partCurrent:h}=this,{levels:f,allAudioTracks:p,loadLevel:m,config:v}=this.hls;if(1===f.length)return 0;const g=f[c],y=!(null==g||null==(s=g.details)||!s.live),_=-1===m||-1===u;let E,b="SDR",S=(null==g?void 0:g.frameRate)||0;const{audioPreference:A,videoPreference:T}=v,w=this.audioTracksByGroup||(this.audioTracksByGroup=function(e){return e.reduce(((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const r=t.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}(p));if(_){if(-1!==this.firstSelection)return this.firstSelection;const r=this.codecTiers||(this.codecTiers=function(e,t,n,r){return e.slice(n,r+1).reduce(((e,n)=>{if(!n.codecSet)return e;const r=n.audioGroups;let i=e[n.codecSet];i||(e[n.codecSet]=i={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),i.minBitrate=Math.min(i.minBitrate,n.bitrate);const a=Math.min(n.height,n.width);return i.minHeight=Math.min(i.minHeight,a),i.minFramerate=Math.min(i.minFramerate,n.frameRate),i.maxScore=Math.max(i.maxScore,n.score),i.fragmentError+=n.fragmentError,i.videoRanges[n.videoRange]=(i.videoRanges[n.videoRange]||0)+1,r&&r.forEach((e=>{if(!e)return;const n=t.groups[e];i.hasDefaultAudio=i.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach((e=>{i.channels[e]=(i.channels[e]||0)+n.channels[e]}))})),e}),{})}(f,w,t,n)),i=function(e,t,n,r,i){const a=Object.keys(e),o=null==r?void 0:r.channels,s=null==r?void 0:r.audioCodec,l=o&&2===parseInt(o);let u=!0,c=!1,d=1/0,h=1/0,f=1/0,p=0,m=[];const{preferHDR:v,allowedVideoRanges:g}=Jn(t,i);for(let b=a.length;b--;){const t=e[a[b]];u=t.channels[2]>0,d=Math.min(d,t.minHeight),h=Math.min(h,t.minFramerate),f=Math.min(f,t.minBitrate);const n=g.filter((e=>t.videoRanges[e]>0));n.length>0&&(c=!0,m=n)}d=F(d)?d:0,h=F(h)?h:0;const y=Math.max(1080,d),_=Math.max(30,h);f=F(f)?f:n,n=Math.max(f,n),c||(t=void 0,m=[]);const E=a.reduce(((t,r)=>{const i=e[r];if(r===t)return t;if(i.minBitrate>n)return er(r,`min bitrate of ${i.minBitrate} > current estimate of ${n}`),t;if(!i.hasDefaultAudio)return er(r,"no renditions with default or auto-select sound found"),t;if(s&&r.indexOf(s.substring(0,4))%5!==0)return er(r,`audio codec preference "${s}" not found`),t;if(o&&!l){if(!i.channels[o])return er(r,`no renditions with ${o} channel sound found (channels options: ${Object.keys(i.channels)})`),t}else if((!s||l)&&u&&0===i.channels[2])return er(r,"no renditions with stereo sound found"),t;return i.minHeight>y?(er(r,`min resolution of ${i.minHeight} > maximum of ${y}`),t):i.minFramerate>_?(er(r,`min framerate of ${i.minFramerate} > maximum of ${_}`),t):m.some((e=>i.videoRanges[e]>0))?i.maxScore=wt(t)||i.fragmentError>e[t].fragmentError)?t:(p=i.maxScore,r):(er(r,`no variants with VIDEO-RANGE of ${JSON.stringify(m)} found`),t)}),void 0);return{codecSet:E,videoRanges:m,preferHDR:v,minFramerate:h,minBitrate:f}}(r,b,e,A,T),{codecSet:a,videoRanges:o,minFramerate:s,minBitrate:l,preferHDR:u}=i;E=a,b=u?o[o.length-1]:o[0],S=s,e=Math.max(e,l),q.log(`[abr] picked start tier ${JSON.stringify(i)}`)}else E=null==g?void 0:g.codecSet,b=null==g?void 0:g.videoRange;const I=h?h.duration:d?d.duration:0,C=this.bwEstimator.getEstimateTTFB()/1e3,R=[];for(let P=n;P>=t;P--){var k;const t=f[P],s=P>c;if(!t)continue;if(v.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const n=navigator.mediaCapabilities;"function"===typeof(null==n?void 0:n.decodingInfo)&&Xn(t,w,b,S,e,A)?(t.supportedPromise=Zn(t,w,n),t.supportedPromise.then((e=>{if(!this.hls)return;t.supportedResult=e;const n=this.hls.levels,r=n.indexOf(t);e.error?q.warn(`[abr] MediaCapabilities decodingInfo error: "${e.error}" for level ${r} ${JSON.stringify(e)}`):e.supported||(q.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${r} ${JSON.stringify(e)}`),r>-1&&n.length>1&&(q.log(`[abr] Removing unsupported level ${r}`),this.hls.removeLevel(r)))}))):t.supportedResult=Wn}if(E&&t.codecSet!==E||b&&t.videoRange!==b||s&&S>t.frameRate||!s&&S>0&&S=2*I&&0===i?f[P].averageBitrate:f[P].maxBitrate,O=this.getTimeToLoadFrag(C,T,L*p,void 0===d);if(T>=L&&(P===u||0===t.loadError&&0===t.fragmentError)&&(O<=C||!F(O)||y&&!this.bitrateTestDelay||O${P} adjustedbw(${Math.round(T)})-bitrate=${Math.round(T-L)} ttfb:${C.toFixed(1)} avgDuration:${p.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${O.toFixed(1)} firstSelection:${_} codecSet:${E} videoRange:${b} hls.loadLevel:${m}`)),_&&(this.firstSelection=P),P}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,r=Math.min(Math.max(e,n),t);this._nextAutoLevel!==r&&(this.nextAutoLevelKey="",this._nextAutoLevel=r)}},bufferController:class{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=e=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;this.log("Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(V.MEDIA_ATTACHED,{media:e,mediaSource:t})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:e,_objectUrl:t}=this;e!==t&&q.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=e.config.preferManagedMediaSource&&"undefined"!==typeof self&&self.ManagedMediaSource,this.log=q.log.bind(q,t),this.warn=q.warn.bind(q,t),this.error=q.error.bind(q,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.BUFFER_RESET,this.onBufferReset,this),e.on(V.BUFFER_APPENDING,this.onBufferAppending,this),e.on(V.BUFFER_CODECS,this.onBufferCodecs,this),e.on(V.BUFFER_EOS,this.onBufferEos,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(V.FRAG_PARSED,this.onFragParsed,this),e.on(V.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.BUFFER_RESET,this.onBufferReset,this),e.off(V.BUFFER_APPENDING,this.onBufferAppending,this),e.off(V.BUFFER_CODECS,this.onBufferCodecs,this),e.off(V.BUFFER_EOS,this.onBufferEos,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(V.FRAG_PARSED,this.onFragParsed,this),e.off(V.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new ta(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,r=_t(this.appendSource);if(n&&r){var i;const e=this.mediaSource=new r;this.log(`created media source: ${null==(i=e.constructor)?void 0:i.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming));const t=this._objectUrl=self.URL.createObjectURL(e);if(this.appendSource)try{n.removeAttribute("src");const r=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||r&&e instanceof r,ra(n),function(e,t){const n=self.document.createElement("source");n.type="video/mp4",n.src=t,e.appendChild(n)}(n,t),n.load()}catch(a){n.src=t}else n.src=t;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(wg){this.warn(`onMediaDetaching: ${wg.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&ra(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(V.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach((e=>{this.resetBuffer(e)})),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{var n;if(t)this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,null!=(n=this.mediaSource)&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}catch(wg){this.warn(`onBufferReset ${e}`,wg)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,r=Object.keys(t);if(r.forEach((e=>{if(n){const n=this.tracks[e];if(n&&"function"===typeof n.buffer.changeType){var r;const{id:i,codec:a,levelCodec:o,container:s,metadata:l}=t[e],u=kt(n.codec,n.levelCodec),c=null==u?void 0:u.replace(na,"$1");let d=kt(a,o);const h=null==(r=d)?void 0:r.replace(na,"$1");if(d&&c!==h){"audio"===e.slice(0,5)&&(d=Rt(d,this.appendSource));const t=`${s};codecs=${d}`;this.appendChangeType(e,t),this.log(`switching codec ${u} to ${d}`),this.tracks[e]={buffer:n.buffer,codec:a,container:s,levelCodec:o,metadata:l,id:i}}}}else this.pendingTracks[e]=t[e]})),n)return;const i=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==i&&(this.log(`${i} bufferCodec event(s) expected ${r.join(",")}`),this.bufferCodecEventsExpected=i),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,r={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};n.append(r,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:r,tracks:i}=this,{data:a,type:o,frag:s,part:l,chunkMeta:u}=t,c=u.buffering[o],d=self.performance.now();c.start=d;const h=s.stats.buffering,f=l?l.stats.buffering:null;0===h.start&&(h.start=d),f&&0===f.start&&(f.start=d);const p=i.audio;let m=!1;"audio"===o&&"audio/mpeg"===(null==p?void 0:p.container)&&(m=!this.lastMpegAudioChunk||1===u.id||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const v=s.start,g={execute:()=>{if(c.executeStart=self.performance.now(),m){const e=this.sourceBuffer[o];if(e){const t=v-e.timestampOffset;Math.abs(t)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${v} (delta: ${t}) sn: ${s.sn})`),e.timestampOffset=v)}}this.appendExecutor(a,o)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();c.executeEnd=c.end=e,0===h.first&&(h.first=e),f&&0===f.first&&(f.first=e);const{sourceBuffer:t}=this,n={};for(const r in t)n[r]=pr.getBuffered(t[r]);this.appendErrors[o]=0,"audio"===o||"video"===o?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(V.BUFFER_APPENDED,{type:o,frag:s,part:l,chunkMeta:u,parent:s.type,timeRanges:n})},onError:e=>{const t={type:G.MEDIA_ERROR,parent:s.type,details:H.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:s,part:l,chunkMeta:u,error:e,err:e,fatal:!1};if(e.code===DOMException.QUOTA_EXCEEDED_ERR)t.details=H.BUFFER_FULL_ERROR;else{const e=++this.appendErrors[o];t.details=H.BUFFER_APPEND_ERROR,this.warn(`Failed ${e}/${n.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),e>=n.config.appendErrorMaxRetry&&(t.fatal=!0)}n.trigger(V.ERROR,t)}};r.append(g,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:n}=this,r=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(V.BUFFER_FLUSHED,{type:e})},onError:t=>{this.warn(`Failed to remove from ${e} SourceBuffer`,t)}});t.type?n.append(r(t.type),t.type):this.getSourceBufferTypes().forEach((e=>{n.append(r(e),e)}))}onFragParsed(e,t){const{frag:n,part:r}=t,i=[],a=r?r.elementaryStreams:n.elementaryStreams;a[ne]?i.push("audiovideo"):(a[ee]&&i.push("audio"),a[te]&&i.push("video"));0===i.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers((()=>{const e=self.performance.now();n.stats.buffering.end=e,r&&(r.stats.buffering.end=e);const t=r?r.stats:n.stats;this.hls.trigger(V.FRAG_BUFFERED,{frag:n,part:r,stats:t,id:n.type})}),i)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce(((e,n)=>{const r=this.sourceBuffer[n];return!r||t.type&&t.type!==n||(r.ending=!0,r.ended||(r.ended=!0,this.log(`${n} sourceBuffer now EOS`))),e&&!(r&&!r.ended)}),!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers((()=>{this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)}));const{mediaSource:e}=this;e&&"open"===e.readyState?(this.log("Calling mediaSource.endOfStream()"),e.endOfStream()):e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)})))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||null===t)return;if(!this.getSourceBufferTypes().length)return;const r=e.config,i=n.currentTime,a=t.levelTargetDuration,o=t.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(F(o)&&o>0){const e=Math.max(o,a),t=Math.floor(i/a)*a-e;this.flushBackBuffer(i,a,t)}if(F(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const e=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),t=Math.max(e,a),n=Math.floor(i/a)*a+t;this.flushFrontBuffer(i,a,n)}}flushBackBuffer(e,t,n){const{details:r,sourceBuffer:i}=this;this.getSourceBufferTypes().forEach((a=>{const o=i[a];if(o){const i=pr.getBuffered(o);if(i.length>0&&n>i.start(0)){if(this.hls.trigger(V.BACK_BUFFER_REACHED,{bufferEnd:n}),null!=r&&r.live)this.hls.trigger(V.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(o.ended&&i.end(i.length-1)-e<2*t)return void this.log(`Cannot flush ${a} back buffer while SourceBuffer is in ended state`);this.hls.trigger(V.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:a})}}}))}flushFrontBuffer(e,t,n){const{sourceBuffer:r}=this;this.getSourceBufferTypes().forEach((i=>{const a=r[i];if(a){const r=pr.getBuffered(a),o=r.length;if(o<2)return;const s=r.start(o-1),l=r.end(o-1);if(n>s||e>=s&&e<=l)return;if(a.ended&&e-l<2*t)return void this.log(`Cannot flush ${i} front buffer while SourceBuffer is in ended state`);this.hls.trigger(V.BUFFER_FLUSHING,{startOffset:s,endOffset:1/0,type:i})}}))}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:n,mediaSource:r}=this,i=e.fragments[0].start+e.totalduration,a=n.duration,o=F(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(r.duration=1/0,this.updateSeekableRange(e)):(i>o&&i>a||!F(a))&&(this.log(`Updating Media Source duration to ${i.toFixed(3)}`),r.duration=i)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&null!=t&&t.setLiveSeekableRange){const r=Math.max(0,n[0].start),i=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${i}.`),t.setLiveSeekableRange(r,i)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,r=Object.keys(n).length;if(r&&(!e||2===r||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(V.BUFFER_CREATED,{tracks:this.tracks}),e.forEach((e=>{t.executeNext(e)}));else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){const i=e[r];if(!i)throw Error(`source buffer exists for track ${r}, however track does not`);let a=i.levelCodec||i.codec;a&&"audio"===r.slice(0,5)&&(a=Rt(a,this.appendSource));const o=`${i.container};codecs=${a}`;this.log(`creating sourceBuffer(${o})`);try{const e=t[r]=n.addSourceBuffer(o),s=r;this.addBufferListener(s,"updatestart",this._onSBUpdateStart),this.addBufferListener(s,"updateend",this._onSBUpdateEnd),this.addBufferListener(s,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(s,"bufferedchange",((e,t)=>{const n=t.removedRanges;null!=n&&n.length&&this.hls.trigger(V.BUFFER_FLUSHED,{type:r})})),this.tracks[r]={buffer:e,codec:a,container:i.container,levelCodec:i.levelCodec,metadata:i.metadata,id:i.id}}catch(wg){this.error(`error while trying to add sourceBuffer: ${wg.message}`),this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:wg,sourceBufferName:r,mimeType:o})}}}get mediaSrc(){var e;const t=(null==(e=this.media)?void 0:e.firstChild)||this.media;return null==t?void 0:t.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const{operationQueue:n}=this;n.current(e).onComplete(),n.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var n;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const i=this.operationQueue.current(e);i&&i.onError(r)}removeExecutor(e,t,n){const{media:r,mediaSource:i,operationQueue:a,sourceBuffer:o}=this,s=o[e];if(!r||!i||!s)return this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void a.shiftAndExecuteNext(e);const l=F(r.duration)?r.duration:1/0,u=F(i.duration)?i.duration:1/0,c=Math.max(0,t),d=Math.min(n,l,u);d>c&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${c},${d}] from the ${e} SourceBuffer`),s.remove(c,d)):a.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(n)n.ended=!1,n.appendBuffer(e);else if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:n}=this,r=t.map((e=>n.appendBlocker(e)));Promise.all(r).then((()=>{e(),t.forEach((e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||n.shiftAndExecuteNext(e)}))}))}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const r=this.sourceBuffer[e];if(!r)return;const i=n.bind(this,e);this.listeners[e].push({event:t,listener:i}),r.addEventListener(t,i)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach((e=>{t.removeEventListener(e.event,e.listener)}))}},capLevelController:Ja,errorController:class{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=q.log.bind(q,"[info]:"),this.warn=q.warn.bind(q,"[warning]:"),this.error=q.error.bind(q,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(V.ERROR,this.onError,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(V.ERROR,this.onError,this),e.off(V.ERROR,this.onErrorOut,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(null==e?void 0:e.type)===qt?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,r;if(t.fatal)return;const i=this.hls,a=t.context;switch(t.details){case H.FRAG_LOAD_ERROR:case H.FRAG_LOAD_TIMEOUT:case H.KEY_LOAD_ERROR:case H.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case H.FRAG_PARSING_ERROR:if(null!=(n=t.frag)&&n.gap)return void(t.errorAction={action:Bn,flags:Yn});case H.FRAG_GAP:case H.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Vn);case H.LEVEL_EMPTY_ERROR:case H.LEVEL_PARSING_ERROR:{var o,s;const e=t.parent===qt?t.level:i.loadLevel;t.details===H.LEVEL_EMPTY_ERROR&&null!=(o=t.context)&&null!=(s=o.levelDetails)&&s.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case H.LEVEL_LOAD_ERROR:case H.LEVEL_LOAD_TIMEOUT:return void("number"===typeof(null==a?void 0:a.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,a.level)));case H.AUDIO_TRACK_LOAD_ERROR:case H.AUDIO_TRACK_LOAD_TIMEOUT:case H.SUBTITLE_LOAD_ERROR:case H.SUBTITLE_TRACK_LOAD_TIMEOUT:if(a){const e=i.levels[i.loadLevel];if(e&&(a.type===Kt&&e.hasAudioGroup(a.groupId)||a.type===$t&&e.hasSubtitleGroup(a.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Vn,void(t.errorAction.flags=jn)}return;case H.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=i.levels[i.loadLevel],n=null==e?void 0:e.attrs["HDCP-LEVEL"];n?t.errorAction={action:Vn,flags:Kn,hdcpLevel:n}:this.keySystemError(t)}return;case H.BUFFER_ADD_CODEC_ERROR:case H.REMUX_ALLOC_ERROR:case H.BUFFER_APPEND_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(r=t.level)?r:i.loadLevel));case H.INTERNAL_EXCEPTION:case H.BUFFER_APPENDING_ERROR:case H.BUFFER_FULL_ERROR:case H.LEVEL_SWITCH_ERROR:case H.BUFFER_STALLED_ERROR:case H.BUFFER_SEEK_OVER_HOLE:case H.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:Bn,flags:Yn})}t.type===G.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=Ln(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++;if(xn(n,r,Pn(e),e.response))return{action:Hn,flags:Yn,retryConfig:n,retryCount:r};const i=this.getLevelSwitchAction(e,t);return n&&(i.retryConfig=n,i.retryCount=r),i}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:a}=t.config,o=Ln(e.details.startsWith("key")?a:i,e),s=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(r){e.details!==H.FRAG_GAP&&r.fragmentError++;if(xn(o,s,Pn(e),e.response))return{action:Hn,flags:Yn,retryConfig:o,retryCount:s}}const l=this.getLevelSwitchAction(e,n);return o&&(l.retryConfig=o,l.retryCount=s),l}getLevelSwitchAction(e,t){const n=this.hls;null!==t&&void 0!==t||(t=n.loadLevel);const r=this.hls.levels[t];if(r){var i,a;const t=e.details;r.loadError++,t===H.BUFFER_APPEND_ERROR&&r.fragmentError++;let l=-1;const{levels:u,loadLevel:c,minAutoLevel:d,maxAutoLevel:h}=n;n.autoLevelEnabled||(n.loadLevel=-1);const f=null==(i=e.frag)?void 0:i.type,p=(f===zt&&t===H.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(t===H.BUFFER_ADD_CODEC_ERROR||t===H.BUFFER_APPEND_ERROR))&&u.some((({audioCodec:e})=>r.audioCodec!==e)),m="video"===e.sourceBufferName&&(t===H.BUFFER_ADD_CODEC_ERROR||t===H.BUFFER_APPEND_ERROR)&&u.some((({codecSet:e,audioCodec:t})=>r.codecSet!==e&&r.audioCodec===t)),{type:v,groupId:g}=null!=(a=e.context)?a:{};for(let n=u.length;n--;){const i=(n+c)%u.length;if(i!==c&&i>=d&&i<=h&&0===u[i].loadError){var o,s;const n=u[i];if(t===H.FRAG_GAP&&e.frag){const t=u[i].details;if(t){const n=Mn(e.frag,t.fragments,e.frag.start);if(null!=n&&n.gap)continue}}else{if(v===Kt&&n.hasAudioGroup(g)||v===$t&&n.hasSubtitleGroup(g))continue;if(f===zt&&null!=(o=r.audioGroups)&&o.some((e=>n.hasAudioGroup(e)))||f===Wt&&null!=(s=r.subtitleGroups)&&s.some((e=>n.hasSubtitleGroup(e)))||p&&r.audioCodec===n.audioCodec||!p&&r.audioCodec!==n.audioCodec||m&&r.codecSet===n.codecSet)continue}l=i;break}}if(l>-1&&n.loadLevel!==l)return e.levelRetry=!0,this.playlistError=0,{action:Vn,flags:Yn,nextAutoLevel:l}}return{action:Vn,flags:jn}}onErrorOut(e,t){var n;switch(null==(n=t.errorAction)?void 0:n.action){case Bn:break;case Vn:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===H.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r,hdcpLevel:i,nextAutoLevel:a}=n;switch(r){case Yn:this.switchLevel(e,a);break;case Kn:i&&(t.maxHdcpLevel=pn[pn.indexOf(i)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)}n.resolved||this.switchLevel(e,a)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(V.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"===typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,n){const r=performance.now();if(t){if(this.lastTime){const e=r-this.lastTime,i=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,o=1e3*i/e,s=this.hls;if(s.trigger(V.FPS_DROP,{currentDropped:i,currentDecoded:a,totalDroppedFrames:n}),o>0&&i>s.config.fpsDroppedMonitoringThreshold*a){let e=s.currentLevel;q.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===s.autoLevelCapping||s.autoLevelCapping>=e)&&(e-=1,s.trigger(V.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:s.currentLevel}),s.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Ee,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:Xo,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Yr{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",Wt),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.ERROR,this.onError,this),e.on(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(V.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(V.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.ERROR,this.onError,this),e.off(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(V.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(V.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Or,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:r}=t;if(this.fragPrevious=n,this.state=Or,!r)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let a;const o=n.start;for(let l=0;l=i[l].start&&o<=i[l].end){a=i[l];break}const s=n.start+n.duration;a?a.end=s:(a={start:o,end:s},i.push(a)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(0===n&&r!==Number.POSITIVE_INFINITY){const e=r-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach((t=>{for(let n=0;nnew En(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new En(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Wt),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,null==(n=this.levels)||!n.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:i}=this,{details:a,id:o}=t;if(!i)return void this.warn(`Subtitle tracks were reset while loading level ${o}`);const s=i[r];if(o>=i.length||o!==r||!s)return;this.log(`Subtitle track ${o} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(a.live||null!=(n=s.details)&&n.live){const e=this.mainDetails;if(a.deltaUpdateFailed||!e)return;const t=e.fragments[0];var u;if(s.details)l=this.alignPlaylists(a,s.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===l&&t&&(l=t.start,In(a,l));else a.hasProgramDateTime&&e.hasProgramDateTime?(Er(a,e),l=a.fragments[0].start):t&&(l=t.start,In(a,l))}if(s.details=a,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(this.mainDetails||a,l),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===Or){Mn(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),s.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&null!=r&&r.key&&r.iv&&"AES-128"===r.method){const e=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer).catch((e=>{throw i.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((n=>{const r=performance.now();i.trigger(V.FRAG_DECRYPTED,{frag:t,payload:n,stats:{tstart:e,tdecrypt:r}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=Or}))}}doTick(){if(this.media){if(this.state===Or){const{currentTrackId:e,levels:t}=this,n=null==t?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:r}=this,i=this.getLoadPosition(),a=pr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:o,len:s}=a,l=this.getFwdBufferInfo(this.media,qt),u=n.details;if(s>this.getMaxBufferLength(null==l?void 0:l.len)+u.levelTargetDuration)return;const c=u.fragments,d=c.length,h=u.edge;let f=null;const p=this.fragPrevious;if(oh-e?0:e;f=Mn(p,c,Math.max(c[0].start,o),t),!f&&p&&p.startthis.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const t=rn(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVEL_LOADING,this.onLevelLoading,this),e.off(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(V.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);rn(this.media.textTracks).forEach((e=>{tn(e)})),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==r)return void this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${null==a?void 0:a.groupId}`);const o=a.details;a.details=t.details,this.log(`Subtitle track ${n} "${a.name}" lang:${a.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==r?void 0:r.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.subtitlePreference;if(!i&&t){this.selectDefaultTrack=!1;const n=tr(t,e);if(n>-1)i=e[n];else{const e=tr(t,this.tracks);i=this.tracks[e]}}let r=this.findTrackId(i);-1===r&&i&&(r=this.findTrackId(null));const a={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(V.SUBTITLE_TRACKS_UPDATED,a),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r-1){const e=this.tracksInGroup[r];return this.setSubtitleTrack(r),e}if(n)return null;{const n=tr(e,t);if(n>-1)return t[n]}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const r=t.id,i=t.groupId;let a=t.url;if(e)try{a=e.addDirectives(a)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}this.log(`Loading subtitle playlist for id ${r}`),this.hls.trigger(V.SUBTITLE_TRACK_LOADING,{url:a,id:r,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=rn(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter((e=>Ji(n,e)))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach((e=>{"disabled"!==e.mode&&e!==r&&(e.mode="disabled")})),r){const e=this.subtitleDisplay?"showing":"hidden";r.mode!==e&&(r.mode=e)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(e<-1||e>=t.length||!F(e))return void this.warn(`Invalid subtitle track id: ${e}`);this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r)return void this.hls.trigger(V.SUBTITLE_TRACK_SWITCH,{id:e});const i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:a,groupId:o="",name:s,type:l,url:u}=r;this.hls.trigger(V.SUBTITLE_TRACK_SWITCH,{id:a,groupId:o,name:s,type:l,url:u});const c=this.switchParams(r.url,null==n?void 0:n.details);this.loadPlaylist(c)}},timelineController:class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(V.FRAG_LOADING,this.onFragLoading,this),e.on(V.FRAG_LOADED,this.onFragLoaded,this),e.on(V.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(V.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(V.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(V.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(V.FRAG_LOADING,this.onFragLoading,this),e.off(V.FRAG_LOADED,this.onFragLoaded,this),e.off(V.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(V.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(V.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(V.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Ta(this,"textTrack1"),t=new Ta(this,"textTrack2"),n=new Ta(this,"textTrack3"),r=new Ta(this,"textTrack4");this.cea608Parser1=new ba(1,e,t),this.cea608Parser2=new ba(3,n,r)}}addCues(e,t,n,r,i){let a=!1;for(let c=i.length;c--;){const e=i[c],r=(o=e[0],s=e[1],l=t,u=n,Math.min(s,u)-Math.max(o,l));if(r>=0&&(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],n),a=!0,r/(n-t)>.5))return}var o,s,l,u;if(a||i.push([t,n]),this.config.renderTextTracksNatively){const i=this.captionsTracks[e];this.Cues.newCue(i,t,n,r)}else{const i=this.Cues.newCue(null,t,n,r);this.hls.trigger(V.CUES_PARSED,{type:"captions",cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){const{unparsedVttFrags:a}=this;"main"===n&&(this.initPTS[t.cc]={baseTime:r,timescale:i}),a.length&&(this.unparsedVttFrags=[],a.forEach((e=>{this.onFragLoaded(V.FRAG_LOADED,e)})))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r{tn(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;ne.textCodec===Va));if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(Xi(this.tracks,n))return void(this.tracks=n);if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const e=this.media,t=e?rn(e.textTracks):null;if(this.tracks.forEach(((e,n)=>{let r;if(t){let n=null;for(let r=0;rnull!==e)).map((e=>e.label));e.length&&q.warn(`Media element contains unused subtitle tracks: ${e.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(V.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const n=`textTrack${t[1]}`,r=this.captionsProperties[n];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:r,lastCc:i,lastSn:a,lastPartIndex:o}=this;if(this.enabled&&n&&r&&t.frag.type===qt){var s,l;const{cc:e,sn:u}=t.frag,c=null!=(s=null==t||null==(l=t.part)?void 0:l.index)?s:-1;u===a+1||u===a&&c===o+1||e===i||(n.reset(),r.reset()),this.lastCc=e,this.lastSn=u,this.lastPartIndex=c}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===Wt)if(r.byteLength){const e=n.decryptdata,i="stats"in t;if(null==e||!e.encrypted||i){const e=this.tracks[n.level],i=this.vttCCs;i[n.cc]||(i[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===Va?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;ja(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),n.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{q.log(`Failed to parse IMSC1: ${t}`),n.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:a}=this,o=i.length-1;if(!i[n.cc]&&-1===o)return void a.push(e);const s=this.hls;Ba(null!=(t=n.initSegment)&&t.data?at(n.initSegment.data,new Uint8Array(r)):r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,(e=>{this._appendCues(e,n.level),s.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})}),(t=>{const i="Missing initPTS for VTT MPEGTS"===t.message;i?a.push(e):this._fallbackToIMSC1(n,r),q.log(`Failed to parse VTT cue: ${t}`),i&&o>n.cc||s.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})}))}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||ja(t,this.initPTS[e.cc],(()=>{n.textCodec=Va,this._parseIMSC1(e,t)}),(()=>{n.textCodec="wvtt"}))}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach((e=>en(n,e)))}else{const r=this.tracks[t];if(!r)return;const i=r.default?"default":"subtitles"+t;n.trigger(V.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===Wt&&this.onFragLoaded(V.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:r}=this;if(!this.enabled||!n||!r)return;const{frag:i,samples:a}=t;if(i.type!==qt||"NONE"!==this.closedCaptionsForLevel(i))for(let o=0;onn(e[r],t,n)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==r){const{textTracks:e}=this;Object.keys(e).forEach((n=>nn(e[n],t,r)))}}}extractCea608Data(e){const t=[[],[]],n=31&e[0];let r=2;for(let i=0;i0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=Or):(this.loadedmetadata=!1,this.state=Mr),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Or:this.doTickIdle();break;case Mr:{var e;const{levels:t,trackId:n}=this,r=null==t||null==(e=t[n])?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=Gr}break}case Nr:{var t;const e=performance.now(),n=this.retryDate;if(!n||e>=n||null!=(t=this.media)&&t.seeking){const{levels:e,trackId:t}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((null==e?void 0:e[t])||null),this.state=Or}break}case Gr:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:r,complete:i}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=xr;const e={frag:t,part:n,payload:r.flush(),networkDetails:null};this._handleFragmentLoadProgress(e),i&&super._handleFragmentLoadComplete(e)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),n=pr.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole);Fn(n.end,this.config.maxFragLookUpTolerance,t)<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${n.end} is needed`),this.clearWaitingFragment())}}else this.state=Or}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Or)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:r}=this,i=e.config;if(!n&&(this.startFragRequested||!i.startFragPrefetch)||null==t||!t[r])return;const a=t[r],o=a.details;if(!o||o.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(o))return void(this.state=Mr);const s=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&s&&(this.bufferFlushed=!1,this.afterBufferFlushed(s,ee,zt));const l=this.getFwdBufferInfo(s,zt);if(null===l)return;const{bufferedTrack:u,switchingTrack:c}=this;if(!c&&this._streamEnded(l,o))return e.trigger(V.BUFFER_EOS,{type:"audio"}),void(this.state=Br);const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,qt),h=l.len,f=this.getMaxBufferLength(null==d?void 0:d.len),p=o.fragments,m=p[0].start;let v=this.flushing?this.getLoadPosition():l.end;if(c&&n){const e=this.getLoadPosition();u&&!Zi(c.attrs,u.attrs)&&(v=e),o.PTSKnown&&em||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=m+.05)}if(h>=f&&!c&&vd.end+o.targetduration;if(_||(null==d||!d.len)&&l.len){const e=this.getAppendedFrag(g.start,qt);if(null===e)return;if(y||(y=!!e.gap||!!_&&0===d.len),_&&!y||y&&l.nextStart&&l.nextStartnew En(e)))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?this.setInterval(100):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=Or,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Lr),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(V.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:r}=this,{details:i,id:a}=t;if(!r)return void this.warn(`Audio tracks were reset while loading level ${a}`);this.log(`Audio track ${a} loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const o=r[a];let s=0;if(i.live||null!=(n=o.details)&&n.live){this.checkLiveUpdate(i);const e=this.mainDetails;if(i.deltaUpdateFailed||!e)return;var l;if(!o.details&&i.hasProgramDateTime&&e.hasProgramDateTime)Er(i,e),s=i.fragments[0].start;else s=this.alignPlaylists(i,o.details,null==(l=this.levelLastLoaded)?void 0:l.details)}o.details=i,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(this.mainDetails||i,s),this.state!==Mr||this.waitForCdnTuneIn(i)||(this.state=Or),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:r,payload:i}=e,{config:a,trackId:o,levels:s}=this;if(!s)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const l=s[o];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const u=l.details;if(!u)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);const c=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Qi(this.hls,zt,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],f=null==(t=n.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=r?r.index:-1,a=-1!==t,o=new mr(n.level,n.sn,n.stats.chunkCount,i.byteLength,t,a);d.push(i,f,c,"",n,r,u.totalduration,e,o,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${u.startSN} ,${u.endSN}],track ${o}`);const{cache:e}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new jr,complete:!1};e.push(new Uint8Array(i)),this.waitingVideoCC=this.videoTrackCC,this.state=Gr}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type===zt)if(this.fragContextChanged(n))this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==n.sn){this.fragPrevious=n;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(V.AUDIO_TRACK_SWITCHED,D({},e)))}this.fragBufferedComplete(n,r)}else if(!this.loadedmetadata&&n.type===qt){const e=this.videoBuffer||this.media;if(e){pr.getBuffered(e).length&&(this.loadedmetadata=!0)}}}onError(e,t){var n;if(t.fatal)this.state=Vr;else switch(t.details){case H.FRAG_GAP:case H.FRAG_PARSING_ERROR:case H.FRAG_DECRYPT_ERROR:case H.FRAG_LOAD_ERROR:case H.FRAG_LOAD_TIMEOUT:case H.KEY_LOAD_ERROR:case H.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(zt,t);break;case H.AUDIO_TRACK_LOAD_ERROR:case H.AUDIO_TRACK_LOAD_TIMEOUT:case H.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Mr||(null==(n=t.context)?void 0:n.type)!==Kt||(this.state=Or);break;case H.BUFFER_APPEND_ERROR:case H.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;if(t.details===H.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case H.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushing(e,{type:t}){t!==te&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==te){this.flushing=!1,this.bufferFlushed=!0,this.state===Br&&(this.state=Or);const e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,zt),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:a}=e,o=this.getCurrentContext(a);if(!o)return void this.resetWhenMissingContext(a);const{frag:s,part:l,level:u}=o,{details:c}=u,{audio:d,text:h,id3:f,initSegment:p}=i;if(!this.fragContextChanged(s)&&c){if(this.state=Fr,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=p&&p.tracks){const e=s.initSegment||s;this._bufferInitSegment(u,p.tracks,e,a),r.trigger(V.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:p.tracks})}if(d){const{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=d;l&&(l.elementaryStreams[ee]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),s.setElementaryStreamInfo(ee,e,t,n,r),this.bufferFragmentData(d,s,l,a)}if(null!=f&&null!=(t=f.samples)&&t.length){const e=M({id:n,frag:s,details:c},f);r.trigger(V.FRAG_PARSING_METADATA,e)}if(h){const e=M({id:n,frag:s,details:c},h);r.trigger(V.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(s)}_bufferInitSegment(e,t,n,r){if(this.state!==Fr)return;t.video&&delete t.video;const i=t.audio;if(!i)return;i.id="audio";const a=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${a}/${i.codec}]`),a&&1===a.split(",").length&&(i.levelCodec=a),this.hls.trigger(V.BUFFER_CODECS,t);const o=i.initSegment;if(null!=o&&o.byteLength){const e={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:o};this.hls.trigger(V.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);var i;if(this.fragCurrent=e,this.switchingTrack||r===or||r===lr)if("initSegment"===e.sn)this._loadInitSegment(e,t);else if(null!=(i=t.details)&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=Gr;const n=this.mainDetails;n&&n.fragments[0].start!==t.details.fragments[0].start&&Er(t.details,n)}else this.startFragRequested=!0,super.loadFragment(e,t,n);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:n}=this,r=null==n?void 0:n.attrs,i=e.attrs;t&&r&&(r.CHANNELS!==i.CHANNELS||n.name!==e.name||n.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(V.AUDIO_TRACK_SWITCHED,D({},e))}},audioTrackController:class extends $n{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(V.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVEL_LOADING,this.onLevelLoading,this),e.off(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(V.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(V.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==r)return void this.warn(`Audio track with id:${n} and group:${r} not found in active group ${null==a?void 0:a.groupId}`);const o=a.details;a.details=t.details,this.log(`Audio track ${n} "${a.name}" lang:${a.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==r?void 0:r.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.audioPreference;if(!i&&t){const n=tr(t,e,rr);if(n>-1)i=e[n];else{const e=tr(t,this.tracks);i=this.tracks[e]}}let r=this.findTrackId(i);-1===r&&i&&(r=this.findTrackId(null));const o={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(V.AUDIO_TRACKS_UPDATED,o);const s=this.trackId;if(-1!==r&&-1===s)this.setAudioTrack(r);else if(e.length&&-1===s){var a;const t=new Error(`No audio track selected for current audio group-ID(s): ${null==(a=this.groupIds)?void 0:a.join(",")} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}else this.shouldReloadPlaylist(i)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&(t.context.type!==Kt||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||(this.requestScheduled=-1,this.checkRetry(t)))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&nr(e,r,rr))return r;const i=tr(e,this.tracksInGroup,rr);if(i>-1){const e=this.tracksInGroup[i];return this.setAudioTrack(i),e}if(r){let r=t.loadLevel;-1===r&&(r=t.firstAutoLevel);const i=function(e,t,n,r,i){const a=t[r],o=t.reduce(((e,t,n)=>{const r=t.uri;return(e[r]||(e[r]=[])).push(n),e}),{}),s=o[a.uri];s.length>1&&(r=Math.max.apply(Math,s));const l=a.videoRange,u=a.frameRate,c=a.codecSet.substring(0,4),d=ir(t,r,(t=>{if(t.videoRange!==l||t.frameRate!==u||t.codecSet.substring(0,4)!==c)return!1;const r=t.audioGroups,a=n.filter((e=>!r||-1!==r.indexOf(e.groupId)));return tr(e,a,i)>-1}));return d>-1?d:ir(t,r,(t=>{const r=t.audioGroups,a=n.filter((e=>!r||-1!==r.indexOf(e.groupId)));return tr(e,a,i)>-1}))}(e,t.levels,n,r,rr);if(-1===i)return null;t.nextLoadLevel=i}if(e.channels||e.audioCodec){const t=tr(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn(`Invalid audio track id: ${e}`);this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;if(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(V.AUDIO_TRACK_SWITCHING,D({},r)),i)return;const a=this.switchParams(r.url,null==n?void 0:n.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:ro.MANIFEST,su:!this.initialized})}catch(t){q.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=e=>{try{const t=e.frag,n=this.hls.levels[t.level],r=this.getObjectType(t),i={d:1e3*t.duration,ot:r};r!==ro.VIDEO&&r!==ro.AUDIO&&r!=ro.MUXED||(i.br=n.bitrate/1e3,i.tb=this.getTopBandwidth(r)/1e3,i.bl=this.getBufferLength(r)),this.apply(e,i)}catch(t){q.warn("Could not generate segment CMCD data.",t)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;null!=n&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||function(){try{return crypto.randomUUID()}catch(e){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}));return n}}}(),this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHED,this.onMediaDetached,this),e.on(V.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHED,this.onMediaDetached,this),e.off(V.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,r;this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(r=t.tracks.video)?void 0:r.buffer}createData(){var e;return{v:1,sf:io.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){M(t,this.createData());const n=t.ot===ro.INIT||t.ot===ro.VIDEO||t.ot===ro.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce(((e,n)=>(r.includes(n)&&(e[n]=t[n]),e)),{})),this.useHeaders?(e.headers||(e.headers={}),Uo(e.headers,t)):e.url=Go(e.url,t)}getObjectType(e){const{type:t}=e;return"subtitle"===t?ro.TIMED_TEXT:"initSegment"===e.sn?ro.INIT:"audio"===t?ro.AUDIO:"main"===t?this.hls.audioTracks.length?ro.VIDEO:ro.MUXED:void 0}getTopBandwidth(e){let t,n=0;const r=this.hls;if(e===ro.AUDIO)t=r.audioTracks;else{const e=r.maxAutoLevel,n=e>-1?e+1:r.levels.length;t=r.levels.slice(0,n)}for(const i of t)i.bitrate>n&&(n=i.bitrate);return n>0?n:NaN}getBufferLength(e){const t=this.hls.media,n=e===ro.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!t)return NaN;return 1e3*pr.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}},contentSteeringController:class{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=q.log.bind(q,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((null==n?void 0:n.action)===Vn&&n.flags===jn){const e=this.levels;let r=this.pathwayPriority,i=this.pathwayId;if(t.context){const{groupId:n,pathwayId:r,type:a}=t.context;n&&e?i=this.getPathwayForGroupId(n,a,i):r&&(i=r)}i in this.penalizedPathways||(this.penalizedPathways[i]=performance.now()),!r&&e&&(r=e.reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==i),n.resolved||q.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${i} levels: ${e?e.length:e} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this.pathwayPriority=e;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach((e=>{r-n[e]>3e5&&delete n[e]}));for(let i=0;i0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,kn(t),this.hls.trigger(V.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[a];o&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==o.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==o.bitrate&&this.log(`Unstable Pathways change from bitrate ${o.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i{const{ID:i,"BASE-ID":a,"URI-REPLACEMENT":o}=e;if(t.some((e=>e.pathwayId===i)))return;const s=this.getLevelsForPathway(a).map((e=>{const t=new Q(e.attrs);t["PATHWAY-ID"]=i;const a=t.AUDIO&&`${t.AUDIO}_clone_${i}`,s=t.SUBTITLES&&`${t.SUBTITLES}_clone_${i}`;a&&(n[t.AUDIO]=a,t.AUDIO=a),s&&(r[t.SUBTITLES]=s,t.SUBTITLES=s);const l=Yo(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",o),u=new En({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:l,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let n=1;n{this.log(`Loaded steering manifest: "${r}"`);const a=e.data;if(1!==a.VERSION)return void this.log(`Steering VERSION ${a.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=a.TTL;const{"RELOAD-URI":o,"PATHWAY-CLONES":s,"PATHWAY-PRIORITY":l}=a;if(o)try{this.uri=new self.URL(o,r).href}catch(u){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${o}`)}this.scheduleRefresh(this.uri||n.url),s&&this.clonePathways(s);const c={steeringManifest:a,url:r.toString()};this.hls.trigger(V.STEERING_MANIFEST_LOADED,c),l&&this.updatePathwayPriority(l)},onError:(e,t,n,r)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let i=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,i);else{const e=this.loader;if("function"===typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(i=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,s,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var t;const n=null==(t=this.hls)?void 0:t.media;!n||n.ended?this.scheduleRefresh(e,1e3*this.timeToLoad):this.loadSteeringManifest(e)}),t)}}});function Jo(e){return e&&"object"===typeof e?Array.isArray(e)?e.map(Jo):Object.keys(e).reduce(((t,n)=>(t[n]=Jo(e[n]),t)),{}):e}function es(e){const t=e.loader;if(t!==qo&&t!==Ko)q.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1})()&&(e.loader=qo,e.progressive=!0,e.enableSoftwareAES=!0,q.log("[config]: Progressive streaming enabled, using FetchLoader"))}}let ts;class ns extends $n{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this),e.on(V.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this),e.off(V.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],i={},a={};let o=!1,s=!1,l=!1;t.levels.forEach((e=>{var t,u;const c=e.attrs;let{audioCodec:d,videoCodec:h}=e;-1!==(null==(t=d)?void 0:t.indexOf("mp4a.40.34"))&&(ts||(ts=/chrome|firefox/i.test(navigator.userAgent)),ts&&(e.audioCodec=d=void 0)),d&&(e.audioCodec=d=Rt(d,n)),0===(null==(u=h)?void 0:u.indexOf("avc1"))&&(h=e.videoCodec=function(e){const t=e.split(".");if(t.length>2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}(h));const{width:f,height:p,unknownCodecs:m}=e;if(o||(o=!(!f||!p)),s||(s=!!h),l||(l=!!d),null!=m&&m.length||d&&!bt(d,"audio",n)||h&&!bt(h,"video",n))return;const{CODECS:v,"FRAME-RATE":g,"HDCP-LEVEL":y,"PATHWAY-ID":_,RESOLUTION:E,"VIDEO-RANGE":b}=c,S=`${`${_||"."}-`}${e.bitrate}-${E}-${g}-${v}-${b}-${y}`;if(i[S])if(i[S].uri===e.url||e.attrs["PATHWAY-ID"])i[S].addGroupId("audio",c.AUDIO),i[S].addGroupId("text",c.SUBTITLES);else{const t=a[S]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const n=new En(e);i[S]=n,r.push(n)}else{const t=new En(e);i[S]=t,a[S]=1,r.push(t)}})),this.filterAndSortMediaOptions(r,t,o,s,l)}filterAndSortMediaOptions(e,t,n,r,i){let a=[],o=[],s=e;if((n||r)&&i&&(s=s.filter((({videoCodec:e,videoRange:t,width:n,height:r})=>{return(!!e||!(!n||!r))&&(!!(i=t)&&mn.indexOf(i)>-1);var i}))),0===s.length)return void Promise.resolve().then((()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}));if(t.audioTracks){const{preferManagedMediaSource:e}=this.hls.config;a=t.audioTracks.filter((t=>!t.audioCodec||bt(t.audioCodec,"audio",e))),rs(a)}t.subtitles&&(o=t.subtitles,rs(o));const l=s.slice(0);s.sort(((e,t)=>{if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return mn.indexOf(e.videoRange)-mn.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const n=Tt(e.videoCodec),r=Tt(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const n=wt(e.codecSet),r=wt(t.codecSet);if(n!==r)return r-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));let u=l[0];if(this.steering&&(s=this.steering.filterParsedLevels(s),s.length!==l.length))for(let f=0;ft&&t===Zo.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=n)}break}const d=i&&!r,h={levels:s,audioTracks:a,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:!d&&a.some((e=>!!e.url))};this.hls.trigger(V.MANIFEST_PARSED,h),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const n=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(V.ERROR,{type:G.OTHER_ERROR,details:H.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,a=t[e],o=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,n===e&&a.details&&r&&i===o)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${o?" with Pathway "+o:""} from level ${n}${i?" with Pathway "+i:""}`);const s={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(V.LEVEL_SWITCHING,s);const l=a.details;if(!l||l.live){const e=this.switchParams(a.uri,null==r?void 0:r.details);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===jt&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(void 0!==t&&t.type===qt){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return;const n=this._levels[t.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:i}=t,a=this._levels[r];var o;if(!a)return this.warn(`Invalid level index ${r}`),void(null!=(o=t.deliveryDirectives)&&o.skip&&(i.deltaUpdateFailed=!0));r===this.currentLevelIndex?(0===a.fragmentError&&(a.loadError=0),this.playlistLoaded(r,t,a.details)):null!=(n=t.deliveryDirectives)&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}const a=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""} with${a?" Pathway "+a:""} ${i}`),this.clearTimer(),this.hls.trigger(V.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const n=this._levels.filter(((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach((e=>e.level=-1))),!1)));kn(n),this._levels=n,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(V.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(V.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function rs(e){const t={};e.forEach((e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}class is{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[n].loader;if(r){var t;if(e&&e!==(null==(t=r.context)?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=H.KEY_LOAD_ERROR,n,r,i){return new wr({type:G.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:r}=e;for(let e=0;e{i.setKeyFormat(e)}));break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const n=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,H.KEY_LOAD_ERROR,n))}const a=i.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,H.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let o=this.keyUriToKeyInfo[a];if(null!=(n=o)&&n.decryptdata.key)return i.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});var s;if(null!=(r=o)&&r.keyLoadPromise)switch(null==(s=o.mediaKeySessionContext)?void 0:s.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then((t=>(i.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:o})))}switch(o=this.keyUriToKeyInfo[a]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===i.keyFormat?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,H.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(n);if(t)return(e.keyLoadPromise=t.then((t=>(e.mediaKeySessionContext=t,n)))).catch((t=>{throw e.keyLoadPromise=null,t}))}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=new(0,n.loader)(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise(((i,a)=>{const o={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},s=n.keyLoadPolicy.default,l={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,n,r)=>{const{frag:o,keyInfo:s,url:l}=n;if(!o.decryptdata||s!==this.keyUriToKeyInfo[l])return a(this.createKeyLoadError(o,H.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));s.decryptdata.key=o.decryptdata.key=new Uint8Array(e.data),o.keyLoader=null,s.loader=null,i({frag:o,keyInfo:s})},onError:(e,n,r,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,H.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),r,D({url:o.url,data:void 0},e)))},onTimeout:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,H.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,H.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(o,l,u)}))}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[r],i&&i.destroy()}}function as(){return self.SourceBuffer||self.WebKitSourceBuffer}function os(){if(!_t())return!1;const e=as();return!e||e.prototype&&"function"===typeof e.prototype.appendBuffer&&"function"===typeof e.prototype.remove}class ss{constructor(e,t,n,r){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=n,this.hls=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:r,stalled:i}=this;if(null===r)return;const{currentTime:a,seeking:o}=r,s=this.seeking&&!o,l=!this.seeking&&o;if(this.seeking=o,a!==e){if(this.moved=!0,o||(this.nudgeRetry=0),null!==i){if(this.stallReported){const e=self.performance.now()-i;q.warn(`playback not stuck anymore @${a}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null}return}if(l||s)return void(this.stalled=null);if(r.paused&&!o||r.ended||0===r.playbackRate||!pr.getBuffered(r).length)return void(this.nudgeRetry=0);const u=pr.bufferInfo(r,a,0),c=u.nextStart||0;if(o){const e=u.len>2,n=!c||t&&t.start<=a||c-a>2&&!this.fragmentTracker.getPartialFragment(a);if(e||n)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var d;if(!(u.len>0)&&!c)return;const e=Math.max(c,u.start||0)-a,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,n=(null==t||null==(d=t.details)?void 0:d.live)?2*t.details.targetduration:2,i=this.fragmentTracker.getPartialFragment(a);if(e>0&&(e<=n||i))return void(r.paused||this._trySkipBufferHole(i))}const h=self.performance.now();if(null===i)return void(this.stalled=h);const f=h-i;if(!o&&f>=250&&(this._reportStall(u),!this.media))return;const p=pr.bufferInfo(r,a,n.maxBufferHole);this._tryFixBufferStall(p,f)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:r,media:i}=this;if(null===i)return;const a=i.currentTime,o=r.getPartialFragment(a);if(o){if(this._trySkipBufferHole(o)||!this.media)return}(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-a1e3*n.highBufferWatchdogPeriod&&(q.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:r}=this;if(!r&&n){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);q.warn(r.message),t.trigger(V.ERROR,{type:G.MEDIA_ERROR,details:H.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:r}=this;if(null===r)return 0;const i=r.currentTime,a=pr.bufferInfo(r,i,0),o=i0&&a.len<1&&r.readyState<3,u=o-i;if(u>0&&(s||l)){if(u>t.maxBufferHole){const{fragmentTracker:t}=this;let n=!1;if(0===i){const e=t.getAppendedFrag(0,qt);e&&o1?(e=0,this.bitrateTest=!0):e=n.firstAutoLevel),n.nextLoadLevel=e,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&-1===e&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=Or,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Lr}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Hr:{const{levels:e,level:t}=this,n=null==e?void 0:e[t],r=null==n?void 0:n.details;if(r&&(!r.live||this.levelLastLoaded===n)){if(this.waitForCdnTuneIn(r))break;this.state=Or;break}if(this.hls.nextLoadLevel!==this.level){this.state=Or;break}break}case Nr:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||null!=(e=this.media)&&e.seeking){const{levels:e,level:t}=this,n=null==e?void 0:e[t];this.resetStartWhenNotLoaded(n||null),this.state=Or}}}this.state===Or&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(null===t||!r&&(this.startFragRequested||!e.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const i=e.nextLoadLevel;if(null==n||!n[i])return;const a=n[i],o=this.getMainFwdBufferInfo();if(null===o)return;const s=this.getLevelDetails();if(s&&this._streamEnded(o,s)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(V.BUFFER_EOS,e),void(this.state=Br)}e.loadLevel!==i&&-1===e.manualLevel&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const l=a.details;if(!l||this.state===Hr||l.live&&this.levelLastLoaded!==a)return this.level=i,void(this.state=Hr);const u=o.len,c=this.getMaxBufferLength(a.maxBitrate);if(u>=c)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:o.end;let h=this.getNextFragment(d,l);if(this.couldBacktrack&&!this.fragPrevious&&h&&"initSegment"!==h.sn&&this.fragmentTracker.getState(h)!==ur){var f;const e=(null!=(f=this.backtrackFragment)?f:h).sn-l.startSN,t=l.fragments[e-1];t&&h.cc===t.cc&&(h=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(h&&this.isLoopLoading(h,d)){if(!h.gap){const e=this.audioOnly&&!this.altAudio?ee:te,t=(e===te?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,qt)}h=this.getNextFragmentLoopLoading(h,l,o,qt,c)}h&&(!h.initSegment||h.initSegment.data||this.bitrateTest||(h=h.initSegment),this.loadFragment(h,a,d))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);this.fragCurrent=e,r===or||r===lr?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,qt)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let n;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(null!=i&&i.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*i.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else n=0;const a=this.getBufferedFrag(t.currentTime+n);if(a){const e=this.followingBufferedFrag(a);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,r=Math.max(a.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Dr:case xr:case Nr:case Fr:case Ur:this.state=Or}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new ss(this.config,n,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;F(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const n=this.getMainFwdBufferInfo();null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${n?n.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(V.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,r=!1;t.levels.forEach((e=>{const t=e.audioCodec;t&&(n=n||-1!==t.indexOf("mp4a.40.2"),r=r||-1!==t.indexOf("mp4a.40.5"))})),this.audioCodecSwitch=n&&r&&!function(){var e;const t=as();return"function"===typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==Or)return;const r=n[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(r.details))&&(this.state=Hr)}onLevelLoaded(e,t){var n;const{levels:r}=this,i=t.level,a=t.details,o=a.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${i}`);this.log(`Level ${i} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${o}`);const s=r[i],l=this.fragCurrent;!l||this.state!==xr&&this.state!==Nr||l.level!==t.level&&l.loader&&this.abortCurrentFrag();let u=0;if(a.live||null!=(n=s.details)&&n.live){var c;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;u=this.alignPlaylists(a,s.details,null==(c=this.levelLastLoaded)?void 0:c.details)}if(s.details=a,this.levelLastLoaded=s,this.hls.trigger(V.LEVEL_UPDATED,{details:a,level:i}),this.state===Hr){if(this.waitForCdnTuneIn(a))return;this.state=Or}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,u),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:r,payload:i}=e,{levels:a}=this;if(!a)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const o=a[n.level],s=o.details;if(!s)return this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),void this.fragmentTracker.removeFragment(n);const l=o.videoCodec,u=s.PTSKnown||!s.live,c=null==(t=n.initSegment)?void 0:t.data,d=this._getAudioCodec(o),h=this.transmuxer=this.transmuxer||new Qi(this.hls,qt,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,p=-1!==f,m=new mr(n.level,n.sn,n.stats.chunkCount,i.byteLength,f,p),v=this.initPTS[n.cc];h.push(i,c,d,l,n,r,s.totalduration,u,m,v)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;n&&(e.trigger(V.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(V.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,r=!!this.hls.audioTracks[n].url;if(r){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=r,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,i,a=!1;for(const o in n){const e=n[o];if("main"===e.id){if(i=o,r=e,"video"===o){const e=n[o];e&&(this.videoBuffer=e.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n&&n.type!==qt)return;if(this.fragContextChanged(n))return this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Ur&&(this.state=Or));const i=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),"initSegment"!==n.sn&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}onError(e,t){var n;if(t.fatal)this.state=Vr;else switch(t.details){case H.FRAG_GAP:case H.FRAG_PARSING_ERROR:case H.FRAG_DECRYPT_ERROR:case H.FRAG_LOAD_ERROR:case H.FRAG_LOAD_TIMEOUT:case H.KEY_LOAD_ERROR:case H.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(qt,t);break;case H.LEVEL_LOAD_ERROR:case H.LEVEL_LOAD_TIMEOUT:case H.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Hr||(null==(n=t.context)?void 0:n.type)!==jt||(this.state=Or);break;case H.BUFFER_APPEND_ERROR:case H.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;if(t.details===H.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case H.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!pr.getBuffered(e).length){const e=this.state!==Or?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Or,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ee||this.audioOnly&&!this.altAudio){const e=(t===te?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,qt),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t0&&(i{const{hls:r}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Or,this.startFragRequested=!1,this.bitrateTest=!1;const i=e.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),r.trigger(V.FRAG_LOADED,n),e.bitrateTest=!1}))}_handleTransmuxComplete(e){var t;const n="main",{hls:r}=this,{remuxResult:i,chunkMeta:a}=e,o=this.getCurrentContext(a);if(!o)return void this.resetWhenMissingContext(a);const{frag:s,part:l,level:u}=o,{video:c,text:d,id3:h,initSegment:f}=i,{details:p}=u,m=this.altAudio?void 0:i.audio;if(this.fragContextChanged(s))this.fragmentTracker.removeFragment(s);else{if(this.state=Fr,f){if(null!=f&&f.tracks){const e=s.initSegment||s;this._bufferInitSegment(u,f.tracks,e,a),r.trigger(V.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:f.tracks})}const e=f.initPTS,t=f.timescale;F(e)&&(this.initPTS[s.cc]={baseTime:e,timescale:t},r.trigger(V.INIT_PTS_FOUND,{frag:s,id:n,initPTS:e,timescale:t}))}if(c&&p&&"initSegment"!==s.sn){const e=p.fragments[s.sn-1-p.startSN],t=s.sn===p.startSN,n=!e||s.cc>e.cc;if(!1!==i.independent){const{startPTS:e,endPTS:r,startDTS:i,endDTS:o}=c;if(l)l.elementaryStreams[c.type]={startPTS:e,endPTS:r,startDTS:i,endDTS:o};else if(c.firstKeyFrame&&c.independent&&1===a.id&&!n&&(this.couldBacktrack=!0),c.dropped&&c.independent){const i=this.getMainFwdBufferInfo(),a=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,l=c.firstKeyFramePTS?c.firstKeyFramePTS:e;if(!t&&a2&&(s.gap=!0);s.setElementaryStreamInfo(c.type,e,r,i,o),this.backtrackFragment&&(this.backtrackFragment=s),this.bufferFragmentData(c,s,l,a,t||n)}else{if(!t&&!n)return void this.backtrack(s);s.gap=!0}}if(m){const{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=m;l&&(l.elementaryStreams[ee]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),s.setElementaryStreamInfo(ee,e,t,n,r),this.bufferFragmentData(m,s,l,a)}if(p&&null!=h&&null!=(t=h.samples)&&t.length){const e={id:n,frag:s,details:p,samples:h.samples};r.trigger(V.FRAG_PARSING_METADATA,e)}if(p&&d){const e={id:n,frag:s,details:p,samples:d.samples};r.trigger(V.FRAG_PARSING_USERDATA,e)}}}_bufferInitSegment(e,t,n,r){if(this.state!==Fr)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:i,video:a,audiovideo:o}=t;if(i){let t=e.audioCodec;const n=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==i.metadata.channelCount&&-1===n.indexOf("firefox")&&(t="mp4a.40.5")),t&&-1!==t.indexOf("mp4a.40.5")&&-1!==n.indexOf("android")&&"audio/mpeg"!==i.container&&(t="mp4a.40.2",this.log(`Android: force audio codec to ${t}`)),e.audioCodec&&e.audioCodec!==t&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${t}"`),i.levelCodec=t,i.id="main",this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${t||""}/${e.audioCodec||""}/${i.codec}]`)}a&&(a.levelCodec=e.videoCodec,a.id="main",this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${a.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(V.BUFFER_CODECS,t),Object.keys(t).forEach((e=>{const i=t[e].initSegment;null!=i&&i.byteLength&&this.hls.trigger(V.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,qt)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Or}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const n=e.currentTime;if(pr.isBuffered(e,n)?t=this.getAppendedFrag(n):pr.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,n=t.level;e&&t.sn===e.sn&&e.level===n||(this.fragPlaying=t,this.hls.trigger(V.FRAG_CHANGED,{frag:t}),e&&e.level===n||this.hls.trigger(V.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,n=this.currentFrag;if(n&&F(t)&&F(n.programDateTime)){const e=n.programDateTime+1e3*(t-n.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class us{static get version(){return"1.5.7"}static isMSESupported(){return os()}static isSupported(){return function(){if(!os())return!1;const e=_t();return"function"===typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((t=>e.isTypeSupported(At(t,"video"))))||["mp4a.40.2","fLaC"].some((t=>e.isTypeSupported(At(t,"audio")))))}()}static getMediaSource(){return _t()}static get Events(){return V}static get ErrorTypes(){return G}static get ErrorDetails(){return H}static get DefaultConfig(){return us.defaultConfig?us.defaultConfig:Zo}static set DefaultConfig(e){us.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Wi,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,function(e,t){if("object"===typeof console&&!0===e||"object"===typeof e){$(e,"debug","log","info","warn","error");try{K.log(`Debug logs enabled for "${t}" in hls.js version 1.5.7`)}catch(n){K=j}}else K=j}(e.debug||!1,"Hls instance");const t=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=Jo(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const i=`${"level"===e?"playlist":e}LoadPolicy`,a=void 0===t[i],o=[];r.forEach((r=>{const s=`${e}Loading${r}`,l=t[s];if(void 0!==l&&a){o.push(s);const e=n[i].default;switch(t[i]={default:e},r){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),o.length&&q.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${i}": ${JSON.stringify(t[i])}`)})),D(D({},n),t)}(us.DefaultConfig,e);this.userConfig=e,t.progressive&&es(t);const{abrController:n,bufferController:r,capLevelController:i,errorController:a,fpsController:o}=t,s=new a(this),l=this.abrController=new n(this),u=this.bufferController=new r(this),c=this.capLevelController=new i(this),d=new o(this),h=new Zt(this),f=new hn(this),p=t.contentSteeringController,m=p?new p(this):null,v=this.levelController=new ns(this,m),g=new cr(this),y=new is(this.config),_=this.streamController=new ls(this,g,y);c.setStreamController(_),d.setStreamController(_);const E=[h,v,_];m&&E.splice(1,0,m),this.networkControllers=E;const b=[l,u,c,d,f,g];this.audioTrackController=this.createController(t.audioTrackController,E);const S=t.audioStreamController;S&&E.push(new S(this,g,y)),this.subtitleTrackController=this.createController(t.subtitleTrackController,E);const A=t.subtitleStreamController;A&&E.push(new A(this,g,y)),this.createController(t.timelineController,b),y.emeController=this.emeController=this.createController(t.emeController,b),this.cmcdController=this.createController(t.cmcdController,b),this.latencyController=this.createController(fn,b),this.coreComponents=b,E.push(s);const T=s.onErrorOut;"function"===typeof T&&this.on(V.ERROR,T,s)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(q.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const t=e===V.ERROR;this.trigger(V.ERROR,{type:G.OTHER_ERROR,details:H.INTERNAL_EXCEPTION,fatal:t,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){q.log("destroy"),this.trigger(V.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){q.log("attachMedia"),this._media=e,this.trigger(V.MEDIA_ATTACHING,{media:e})}detachMedia(){q.log("detachMedia"),this.trigger(V.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,r=this.url=L.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,q.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(V.MANIFEST_LOADING,{url:e})}startLoad(e=-1){q.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach((t=>{t.startLoad(e)}))}stopLoad(){q.log("stopLoad"),this.started=!1,this.networkControllers.forEach((e=>{e.stopLoad()}))}resumeBuffering(){this.started&&this.networkControllers.forEach((e=>{"fragmentLoader"in e&&e.startLoad(-1)}))}pauseBuffering(){this.networkControllers.forEach((e=>{"fragmentLoader"in e&&e.stopLoad()}))}swapAudioCodec(){q.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){q.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){q.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){q.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){q.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){q.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){q.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(q.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){(function(e){return pn.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let r=0;r=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(r=-1===t&&null!=e&&e.length?e.length-1:t,n)for(let i=r;i--;){const t=e[i].attrs["HDCP-LEVEL"];if(t&&t<=n)return i}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return null==(t=this.audioTrackController)?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return null==(t=this.subtitleTrackController)||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}us.defaultConfig=void 0;var cs=n(8240),ds=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){hs&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),vs?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){hs&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;ms.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),ys=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),Ps="undefined"!==typeof WeakMap?new WeakMap:new ds,Ls=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=gs.getInstance(),r=new ks(t,n,this);Ps.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Ls.prototype[e]=function(){var t;return(t=Ps.get(this))[e].apply(t,arguments)}}));var Os="undefined"!==typeof fs.ResizeObserver?fs.ResizeObserver:Ls,Ds=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],xs=function(){if("undefined"===typeof document)return!1;var e=Ds[0],t={},n=!0,r=!1,i=void 0;try{for(var a,o=Ds[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var s=a.value;if((null===s||void 0===s?void 0:s[1])in document){var l=!0,u=!1,c=void 0;try{for(var d,h=s.entries()[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var f=I(d.value,2),p=f[0],m=f[1];t[e[p]]=m}}catch(wg){u=!0,c=wg}finally{try{l||null==h.return||h.return()}finally{if(u)throw c}}return t}}}catch(wg){r=!0,i=wg}finally{try{n||null==o.return||o.return()}finally{if(r)throw i}}return!1}(),Ns={change:xs.fullscreenchange,error:xs.fullscreenerror},Ms={request:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.documentElement,t=arguments.length>1?arguments[1]:void 0;return new Promise((function(n,r){var i=function(){Ms.off("change",i),n()};Ms.on("change",i);var a=e[xs.requestFullscreen](t);a instanceof Promise&&a.then(i).catch(r)}))},exit:function(){return new Promise((function(e,t){if(Ms.isFullscreen){var n=function(){Ms.off("change",n),e()};Ms.on("change",n);var r=document[xs.exitFullscreen]();r instanceof Promise&&r.then(n).catch(t)}else e()}))},toggle:function(e,t){return Ms.isFullscreen?Ms.exit():Ms.request(e,t)},onchange:function(e){Ms.on("change",e)},onerror:function(e){Ms.on("error",e)},on:function(e,t){var n=Ns[e];n&&document.addEventListener(n,t,!1)},off:function(e,t){var n=Ns[e];n&&document.removeEventListener(n,t,!1)},raw:xs};Object.defineProperties(Ms,{isFullscreen:{get:function(){return Boolean(document[xs.fullscreenElement])}},element:{enumerable:!0,get:function(){var e;return null!==(e=document[xs.fullscreenElement])&&void 0!==e?e:void 0}},isEnabled:{enumerable:!0,get:function(){return Boolean(document[xs.fullscreenEnabled])}}}),xs||(Ms={isEnabled:!1});var Fs=Ms;var Us=function(e,t){var n=Object.keys(e);if(t<=e[n[0]])return n[0];if(t>=e[n[n.length-2]])return n[n.length-1];var r=n.findIndex((function(r,i){var a=e[r],o=e[n[i+1]];return!o||t>=a&&tt?"landscape":"portrait"}function Ys(e,t){return e>t?e/t:t/e}var js=function(e,t,n){return null==e?t:Math.min(Math.max(t,e),n)},Ks=n(4420),$s=n.n(Ks),qs={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"};function zs(e){if(!e)return"";if("media"===e.type){var t,n=(null===(t=e.data)||void 0===t?void 0:t.code)?qs[e.data.code]:"MEDIA_DATA_IS_NOT_AVAILABLE";return"MEDIA: ".concat(n)}return"hls"===e.type?"HLS: ".concat((r=e.data.details,$s()(r).toUpperCase())):"";var r}function Ws(e,t,n){return!!e&&(!n&&!(e.maxNumRetry<=t))}var Qs={development:{PLAYER_API_URL:"https://player-api.dev.vidalytics.com",CDN_FALLBACK_URL:"https://fast-dev.vidalytics.com",ANALYTICS_LICENSE_KEY:"c4834298-0629-4334-9a7d-201b35bc92ab"},production:{PLAYER_API_URL:"https://player-api.prod.vidalytics.com",CDN_FALLBACK_URL:"https://fast-prod.vidalytics.com",ANALYTICS_LICENSE_KEY:"d4c2598d-2c00-4d64-89ef-2dc2239df17d"}},Xs="hls",Zs="https://vidalytics.com/?utm_source=Logo&utm_medium=Player&utm_content=",Js=[2,1.5,1.25,1,.75,.5],el={enabled:!0,mobile:!0,onlyMuted:!1},tl={fullscreen:{show:!1,customFullscreen:{default:{enabled:!1},mobile:{enabled:!1}}},play:{show:!1},rewind:{show:!1},seekBar:{show:!1,showToReturningViewers:!1},smartSeekBar:{show:!1},speedControl:{show:!1},qualityControl:{show:!1},volume:{show:!1},alwaysShow:!1},nl={manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:1e4,timeoutRetry:{maxNumRetry:3,retryDelayMs:0,maxRetryDelayMs:0,shouldRetry:Ws},errorRetry:{maxNumRetry:3,retryDelayMs:500,maxRetryDelayMs:5e3,shouldRetry:Ws}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:5e3,maxLoadTimeMs:1e4,timeoutRetry:{maxNumRetry:3,retryDelayMs:0,maxRetryDelayMs:0,shouldRetry:Ws},errorRetry:{maxNumRetry:4,retryDelayMs:500,maxRetryDelayMs:5e3,shouldRetry:Ws}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:1e5,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0,shouldRetry:Ws},errorRetry:{maxNumRetry:6,retryDelayMs:500,maxRetryDelayMs:5e3,shouldRetry:Ws}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:3,retryDelayMs:0,maxRetryDelayMs:0,shouldRetry:Ws},errorRetry:{maxNumRetry:3,retryDelayMs:1e3,maxRetryDelayMs:8e3,shouldRetry:Ws}}}},rl=["canplay","canplaythrough","complete","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","addtrack","removetrack","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],il=function(){function e(t,n,i){var a,s,l=this,u=this;r(this,e),o(this,"__bodyStyleBackground",void 0),o(this,"__bodyStyleOverflow",void 0),o(this,"parentElementsZIndex",new Map),o(this,"mediaElement",void 0),o(this,"rootElement",void 0),o(this,"containerElement",void 0),o(this,"data",void 0),o(this,"options",void 0),o(this,"config",void 0),o(this,"hls",void 0),o(this,"hlsConfig",void 0),o(this,"eventEmitter",void 0),o(this,"resizeObserver",void 0),o(this,"handleSourceNotSupportedError",(function(e){var t,n=/\.m3u8/gi.test(l.src());"media"===e.type&&4===(null===(t=e.data)||void 0===t?void 0:t.code)&&n&&(l.options.forceNativeHls=!1,l.hlsConfig&&(l.hlsConfig.preferManagedMediaSource=!0),l.trigger("destroy:playback"),l.once("canplay",(function(){return l.isStarted(!0)})),l.initPlaybackSource())})),o(this,"handleParentsZIndexReset",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&e.parentElement){if(t){var n=e.parentElement.style;"auto"!==getComputedStyle(e.parentElement).zIndex&&(u.parentElementsZIndex.set(e.parentElement,n.zIndex),e.parentElement.style.setProperty("z-index","auto"))}else{var r=u.parentElementsZIndex.get(e.parentElement);r?(e.parentElement.style.setProperty("z-index",r),u.parentElementsZIndex.delete(e.parentElement)):e.parentElement.style.removeProperty("z-index")}u.handleParentsZIndexReset(e.parentElement,t)}})),o(this,"handleScreenfullChange",(function(){l.handleFullscreenChange(Fs.isFullscreen)})),o(this,"handleFullscreenChange",(function(e,t){var n=l.options.hasFocusedFullscreen;if(l.isFullscreen()!==e){if(!t){var r=e?"1:0":l.options.aspectRatio;l.aspectRatio(r)}n&&(l.handleChangeViewportFit(!!e),l.handleParentsZIndexReset(l.rootElement,!!e)),l.isFullscreen(e),l.trigger("fullscreenchange"),l.trigger(e?"enterfullscreen":"exitfullscreen")}})),o(this,"handleFullscreenEscape",(function(e){l.isFullscreen()&&"Escape"===e.key&&l.exitFullscreen()})),this.mediaElement=t,this.rootElement=n.rootElement,this.containerElement=n.containerElement,this.options=n,this.config=n.config,this.hlsConfig=i,this.eventEmitter=new cs,this.data={containerHeight:0,containerWidth:0,lastTime:0,currentBreakpoint:"large",isFullscreen:!1,prevTime:0,autoPlayState:"pristine",hasCaptions:!1,isTouched:!1,hasErrorFatal:!1,error:null,hasTimeUpdate:!1,aspectRatio:null!==(a=n.aspectRatio)&&void 0!==a?a:"16:9",playbackRates:null!==(s=n.playbackRates)&&void 0!==s?s:Js,isStarted:!1},this.initMediaAttributes(),this.proxyNativeMediaEvents(),this.initContainerAspectRatio(this.data.aspectRatio),setTimeout((function(){return l.initContainerAspectRatio(l.data.aspectRatio)}),0),this.initFullscreenObserver(),this.initPlaybackSource(),this.initErrorListeners(),this.resizeObserver=this.initResizeObserver(),this.initContainerDimensions(),this.on("timeupdate",(function(){l.hasTimeUpdate(!0),l.lastTime(l.currentTime())})),this.containerElement.addEventListener("click",(function(){return l.isTouched(!0)})),this.isHlsSupported?this.once("canplay",(function(){return l.isStarted(!0)})):this.once("loadedmetadata",(function(){l.isStarted(!0),l.mediaElement.removeAttribute("autoplay")})),this.on("error",this.handleSourceNotSupportedError)}return a(e,[{key:"initStartLevel",value:function(){if(this.hls){var e;switch(this.options.initialLevel){case"low":e=0;break;case"high":e=this.hls.levels.length-1;break;default:e=Math.round(this.hls.levels.length/2)}this.hls.startLevel=e}}},{key:"handleManifestParsed",value:function(e,t){var n=this;if(this.hls){if(this.hls.levels.length>1)for(var r=this.hls.levels.some((function(e){var t;return null===(t=e.videoCodec)||void 0===t?void 0:t.startsWith("hvc1")})),i=this.hls.levels.length-1;i>=0;i--){var a,o,s=this.hls.levels[i],l=null===(a=s.videoCodec)||void 0===a?void 0:a.startsWith("hvc1"),u=null===(o=s.videoCodec)||void 0===o?void 0:o.startsWith("avc1"),c=Ys(s.width,s.height)<1.01?960:1300,d=s.width>=c||s.height>=c;(r&&u&&!e||e&&l||d&&t)&&this.hls.removeLevel(i)}this.initStartLevel(),this.hls.on(us.Events.ERROR,(function(e,t){n.hls&&(t.details===us.ErrorDetails.BUFFER_ADD_CODEC_ERROR&&(n.hls.destroy(),n.trigger("destroy:playback"),n.initPlaybackSource(!0)))})),this.hls.startLoad()}}},{key:"isErrorFatal",value:function(e){if(!this.hls)return!0;switch(e.type){case"license":return!0;case"hls":return e.data.details!==us.ErrorDetails.BUFFER_STALLED_ERROR&&e.data.fatal;default:return!1}}},{key:"initErrorListeners",value:function(){var e,t=this;this.on("error:fatal",(function(e){t.error(e),t.hasErrorFatal(!0)})),this.on("error:internal",(function(e){t.trigger("error",e),t.isErrorFatal(e)&&t.trigger("error:fatal",e)})),this.mediaElement.addEventListener("error",(function(){t.trigger("error:internal",{type:"media",data:t.mediaElement.error})})),null===(e=this.hls)||void 0===e||e.on(us.Events.ERROR,(function(e,n){t.trigger("error:internal",{type:"hls",data:n})}))}},{key:"initPlaybackSource",value:function(e){var t=this,n=this.options,r=n.src,i=n.srcFallback,a=n.disableHevc,o=n.disableHighestResolution,s=n.forceNativeHls;if(!this.isHlsSupported){var l=r;return this.isNativeHlsSupported||s||(l=i),this.src(l),void setTimeout((function(){return t.trigger("ready")}))}this.hls=new us(this.hlsConfig),this.hls.attachMedia(this.mediaElement),this.hls.on(us.Events.MEDIA_ATTACHED,(function(){return t.trigger("ready")})),this.hls.on(us.Events.MANIFEST_PARSED,(function(){return t.handleManifestParsed(!(!e&&!a),!!o)})),this.hls.loadSource(this.options.src)}},{key:"initContainerAspectRatio",value:function(e){var t=I(e.split(":").map(Number),2),n=t[0],r=t[1],i=Math.round(r/n*1e4)/100;this.rootElement.style.setProperty("position","relative"),this.rootElement.style.setProperty("width","100%"),this.rootElement.style.setProperty("padding-top","".concat(i,"%")),this.trigger("resize")}},{key:"initMediaAttributes",value:function(){var e=this.options,t=e.autoplay,n=e.playsInline,r=e.crossOrigin;"undefined"!==typeof t&&this.autoplay(t),"undefined"!==typeof n&&this.playsInline(n),"undefined"!==typeof r&&this.crossOrigin(r)}},{key:"initContainerDimensions",value:function(){var e=this.options.breakpoints,t=this.containerElement.getBoundingClientRect(),n=t.width,r=t.height;this.data.containerHeight=r,this.data.containerWidth=n,this.data.currentBreakpoint=Us(e,n),this.trigger("resize")}},{key:"initResizeObserver",value:function(){var e=this,t=this.options.breakpoints,n=new Os((function(n){var r=n[0].contentRect,i=r.width,a=r.height,o=r.top,s=r.left;e.data.containerHeight=a+o,e.data.containerWidth=i+s,e.data.currentBreakpoint=Us(t,i+s),e.trigger("resize")}));return n.observe(this.containerElement),n}},{key:"proxyNativeMediaEvents",value:function(){var e=this;rl.forEach((function(t){e.mediaElement.addEventListener(t,(function(n){e.trigger(t,n)}))}))}},{key:"destroy",value:function(){var e;this.trigger("destroy"),null===(e=this.hls)||void 0===e||e.destroy(),this.resizeObserver.disconnect(),this.eventEmitter.removeAllListeners()}},{key:"src",value:function(e){return"string"===typeof e?(this.hls?this.hls.loadSource(e):this.mediaElement.src=e,e):this.hls?this.hls.url:this.mediaElement.src}},{key:"on",value:function(e,t){this.eventEmitter.on(e,t)}},{key:"off",value:function(e,t){this.eventEmitter.off(e,t)}},{key:"once",value:function(e,t){this.eventEmitter.once(e,t)}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]&&arguments[0];"undefined"===typeof this.__bodyStyleBackground&&(this.__bodyStyleBackground=document.body.style.background),"undefined"===typeof this.__bodyStyleOverflow&&(this.__bodyStyleOverflow=document.body.style.overflow),e?(document.body.style.overflow="hidden",document.body.style.background="black"):(document.body.style.overflow=this.__bodyStyleOverflow,document.body.style.background=this.__bodyStyleBackground)}},{key:"requestFullscreen",value:function(){var e=this;return t((function(){var t,n,r,i;return u(this,(function(a){switch(a.label){case 0:t=e.options.hasFocusedFullscreen,a.label=1;case 1:return a.trys.push([1,7,,8]),n=!1,r=!1,!Fs.isEnabled||t?[3,3]:[4,Fs.request(e.containerElement)];case 2:return a.sent(),[3,6];case 3:return t?(e.requestFullscreenFallback(),r=!0,[3,6]):[3,4];case 4:return e.mediaElement.webkitSupportsFullscreen?[4,e.mediaElement.webkitEnterFullscreen()]:[3,6];case 5:a.sent(),n=!0,a.label=6;case 6:return e.handleFullscreenChange(!r||"fallback",n),[3,8];case 7:return i=a.sent(),console.error(i),[3,8];case 8:return[2]}}))}))()}},{key:"exitFullscreen",value:function(){var e=this;return t((function(){var t,n;return u(this,(function(r){switch(r.label){case 0:t=e.options.hasFocusedFullscreen,r.label=1;case 1:return r.trys.push([1,7,,8]),!Fs.isEnabled||t?[3,3]:[4,Fs.exit()];case 2:return r.sent(),[3,6];case 3:return t?(e.exitFullscreenFallback(),[3,6]):[3,4];case 4:return e.mediaElement.webkitSupportsFullscreen?[4,e.mediaElement.webkitExitFullscreen()]:[3,6];case 5:r.sent(),r.label=6;case 6:return e.handleFullscreenChange(!1),[3,8];case 7:return n=r.sent(),console.error(n),[3,8];case 8:return[2]}}))}))()}},{key:"currentHeight",value:function(e){return"number"===typeof e&&(this.data.containerHeight=e),this.data.containerHeight}},{key:"currentWidth",value:function(e){return"number"===typeof e&&(this.data.containerWidth=e),this.data.containerWidth}},{key:"levels",value:function(){return this.hls?this.hls.levels:[]}},{key:"videoHeight",value:function(){return this.mediaElement.videoHeight}},{key:"videoWidth",value:function(){return this.mediaElement.videoWidth}},{key:"ended",value:function(){return this.mediaElement.ended}},{key:"playsInline",value:function(e){return"boolean"===typeof e&&(this.mediaElement.playsInline=e),this.mediaElement.playsInline}},{key:"autoplay",value:function(e){return"boolean"===typeof e&&(this.mediaElement.autoplay=e),this.mediaElement.autoplay}},{key:"crossOrigin",value:function(e){return"string"!==typeof e&&null!==e||(this.mediaElement.crossOrigin=e),this.mediaElement.crossOrigin}},{key:"controls",value:function(e){return"boolean"===typeof e&&(this.mediaElement.controls=e),this.mediaElement.controls}},{key:"hasCaptions",value:function(e){return"boolean"===typeof e&&(this.data.hasCaptions=e,this.trigger("captionschange")),this.data.hasCaptions}},{key:"isStarted",value:function(e){return"boolean"===typeof e&&(this.data.isStarted=e),this.data.isStarted}},{key:"isTouched",value:function(e){return"boolean"===typeof e&&(this.data.isTouched=e),this.data.isTouched}},{key:"hasErrorFatal",value:function(e){return"boolean"===typeof e&&(this.data.hasErrorFatal=e),this.data.hasErrorFatal}},{key:"error",value:function(e){return"undefined"!==typeof e&&(this.data.error=e),this.data.error}},{key:"hasTimeUpdate",value:function(e){return"boolean"===typeof e&&(this.data.hasTimeUpdate=e),this.data.hasTimeUpdate}},{key:"lastTime",value:function(e){return"number"===typeof e&&e>0&&(this.data.lastTime=e),this.data.lastTime}},{key:"autoPlayState",value:function(e){return"undefined"!==typeof e&&(this.data.autoPlayState=e),this.data.autoPlayState}},{key:"isInitialized",get:function(){return this.isStarted()}},{key:"isNativeHlsSupported",get:function(){return"function"===typeof this.mediaElement.canPlayType&&this.mediaElement.canPlayType("application/vnd.apple.mpegurl")}},{key:"embed",get:function(){var e,t,n=this.options.embedId;if(n)return null===(t=window._vidalytics)||void 0===t||null===(e=t.embeds)||void 0===e?void 0:e[n]}},{key:"isHlsSupported",get:function(){var e=!1,t=this.options.forceNativeHls;try{e=new URLSearchParams(window.location.search).has("vidalytics_skip_force_native_hls")}catch(n){}return!(t&&!e)&&(e?(this.hlsConfig&&(this.hlsConfig.preferManagedMediaSource=!0),us.isSupported()):function(){if(!Vs())return!1;var e=Bs();return"function"===typeof(null===e||void 0===e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((function(t){return e.isTypeSupported('video/mp4;codecs="'.concat(t,'"'))}))||["mp4a.40.2","fLaC"].some((function(t){return e.isTypeSupported('audio/mp4;codecs="'.concat(t,'"'))})))}())}}]),e}();o(il,"wrapperHashLength",8);var al=il;function ol(e,t,n){return ol="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=y(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},ol(e,t,n||e)}function sl(e,t,n){return sl=_()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},sl.apply(null,arguments)}function ll(e){var t="function"===typeof Map?new Map:void 0;return ll=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return sl(e,arguments,y(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,e)},ll(e)}var ul=n(8534);function cl(e){return!!e&&("object"===typeof e||"function"===typeof e)&&"function"===typeof e.then}function dl(e){cl(e)&&e.then(null,(function(){}))}function hl(e){return new Promise((function(t){return setTimeout(t,e)}))}var fl=n(2145),pl=n.n(fl);var ml=["delete","get","head","options"],vl=["post","put","patch"],gl=function(e){g(n,e);var t=b(n);function n(e,i,a,s){var l;return r(this,n),o(m(l=t.call(this,e)),"status",void 0),o(m(l),"options",void 0),o(m(l),"result",void 0),l.name="RequestError",i&&(l.status=i),a&&(l.options=a),s&&(l.result=s),Error.captureStackTrace?Error.captureStackTrace(m(l),l.constructor):l.stack=(new Error).stack,l}return n}(ll(Error));o(gl,"isRequestError",!0);var yl={headers:{},retryDelay:function(e){var t=1e3*Math.pow(2,e);return t+.2*t*Math.random()},responseType:"text",shouldRetry:function(){return!0},isStatusValid:function(e){return e>=200&&e<300}};var _l,El=function e(){var t=s({},yl,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});function n(e,r,i,a,o){var l,u=e,c=s({},t,r),d=!1,h=new XMLHttpRequest,f={requestStart:Date.now()};if("string"!==typeof e&&(u=e.url,c=s({},t,e)),c.baseUrl&&(u="".concat(c.baseUrl).concat(u)),c.params){var p=I(u.split("?"),1)[0],m=ul.stringify(c.params,"?");u="".concat(p).concat(m)}var v,g=null!==(l=c.method)&&void 0!==l?l:i;g=null===g||void 0===g?void 0:g.toUpperCase();var y,_=null!==(v=c.data)&&void 0!==v?v:a;return"object"===typeof _&&(_=JSON.stringify(_),c.headers&&!c.headers["Content-Type"]&&(c.headers["Content-Type"]="application/json; charset=utf-8")),c.withCredentials&&(h.withCredentials=!0),c.responseType&&(h.responseType=c.responseType),c.timeout&&(y=window.setTimeout((function(){d=!0,h.abort()}),c.timeout)),new Promise((function(e,t){for(var n in h.open(g,u,!0),c.headers)h.setRequestHeader(n,c.headers[n]);h.onreadystatechange=function(){if(d)return e(new gl("Request was aborted due to exceeded timeout",h.status,c));if(2===h.readyState&&(f.lookupTime=Date.now()-f.requestStart),4===h.readyState){y&&clearTimeout(y),f.requestEnd=Date.now(),f.totalTime=f.requestEnd-f.requestStart,f.responseLength=h.response.length;var t=h.response;"text"===c.responseType&&(t=function(e){try{return JSON.parse(e)}catch(t){return e}}(h.responseText));var n=pl()(h.getAllResponseHeaders()),r={options:c,data:t,headers:n,timing:f,status:h.status,statusText:h.statusText,xhr:h};c.isStatusValid(h.status)||e(new gl("Request failed with status code ".concat(h.status),h.status,c,r)),e(r)}},h.onerror=t,h.send(_)})).then((function(t){if(t instanceof Error){var s=null!==o&&void 0!==o?o:c.retries;if(c.shouldRetry(t)&&"number"===typeof s&&s>0){var l=Promise.resolve();if(c.retryDelay){var u=c.retries-s,d=c.retryDelay;"function"===typeof d&&(d=d(u)),l=hl(d)}return l.then((function(){return n(e,r,i,a,s-1)}))}return Promise.reject(t)}return Promise.resolve(t)}))}var r=n;return r.createInstance=e,ml.forEach((function(e){r[e]=function(t,r){return n(t,r,e)}})),vl.forEach((function(e){r[e]=function(t,r,i){return n(t,i,e,r)}})),r}();function bl(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:Cl,i=arguments.length>2?arguments[2]:void 0;r(this,e),o(this,"config",void 0),o(this,"options",void 0),o(this,"sessionId",void 0),o(this,"userId",void 0),o(this,"isReturningViewerKey",void 0),o(this,"messageQueue",[]),o(this,"request",void 0),o(this,"isPending",!1),o(this,"isDisconnected",!1),o(this,"isInitialized",!1),o(this,"localStorageEnabled",Tl("localStorage")),o(this,"sessionStorageEnabled",Tl("sessionStorage")),this.config=t,this.options=s({},Cl,n),i&&(this.isReturningViewerKey="vidalytics_video_".concat(i,"_is_returning"));var a={baseUrl:this.config.url,retries:this.options.retriesLimit};this.request=El.createInstance(a),this.initSession(),this.initUser()}return a(e,[{key:"getDefaultMessage",value:function(){var e=this.config;return{customerId:e.customerId,videoId:e.videoId,timestamp:this.getTimestamp(),sessionId:this.sessionId,userId:this.userId,player:Xs}}},{key:"enqueueMessage",value:function(e){var t=this.options.onEnqueue,n=s({},this.getDefaultMessage(),e);this.messageQueue.push(n),null===t||void 0===t||t(n),this.dequeueMessage()}},{key:"dequeueMessage",value:function(){var e=this;return t((function(){var t,n,r,i,a;return u(this,(function(o){switch(o.label){case 0:if(!e.isInitialized||!e.userId)return[2];if(e.isPending)return[2];if(e.isDisconnected)return[2];if(e.isMessageQueueEmpty)return[2];t=e.options.onDequeue,o.label=1;case 1:return o.trys.push([1,3,,4]),n=I(e.messageQueue,1),r=n[0],i=l(s({},r),{userId:e.userId}),null===t||void 0===t||t(i),e.isPending=!0,[4,e.dispatchMessage(i)];case 2:return o.sent(),e.messageQueue.shift(),[3,4];case 3:return a=o.sent(),console.error(a),e.handleDisconnect(),[3,4];case 4:return e.isPending=!1,e.dequeueMessage(),[2]}}))}))()}},{key:"dispatchMessage",value:function(e){var n=this;return t((function(){var t,r;return u(this,(function(i){switch(i.label){case 0:return t=n.options.onDispatch,r={"Content-Type":"text/plain; charset=utf-8"},[4,n.request.post("/scribe",e,{headers:r})];case 1:return i.sent(),null===t||void 0===t||t(e),[2]}}))}))()}},{key:"handleConnect",value:function(){this.isDisconnected=!1,this.dequeueMessage()}},{key:"handleInit",value:function(){this.isInitialized=!0,this.dequeueMessage()}},{key:"handleDisconnect",value:function(){this.isDisconnected=!0,this.initHealthCheck()}},{key:"initHealthCheck",value:function(){var e=this;return t((function(){var t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.request.get("/ping")];case 1:return n.sent(),e.isInitialized?(e.handleConnect(),[3,3]):(e.initUser(),[2]);case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}))}))()}},{key:"initSession",value:function(){var e=this.options,t=e.sessionIdKey,n=e.sessionIdLength,r=this.getSessionId();if(r)return this.sessionId=r,void this.saveSessionId(r);var i=((e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t})(n);this.sessionId=i,sessionStorage.setItem(t,i)}},{key:"initUser",value:function(){var e=this;return t((function(){var t,n,r,i,a,o,s,l,c,d,h;return u(this,(function(u){switch(u.label){case 0:if(t=e.options,n=t.userIdKey,r=t.cookieDomain,i=t.cookieExpires,a=e.config.customerId,o=e.getUserId())return e.userId=o,e.saveUserId(o),e.isReturningViewerKey&&!localStorage.getItem(e.isReturningViewerKey)&&localStorage.setItem(e.isReturningViewerKey,_l.FIRST),e.handleInit(),[2];u.label=1;case 1:return u.trys.push([1,3,,4]),s={cid:a},[4,e.request.get("/awesome-log",{params:s})];case 2:return l=u.sent(),(c=l.headers.etag)&&(d=e.getUserIdFromEntityTag(c),e.userId=d,localStorage.setItem(n,d),Al.set(n,d,{expires:i,domain:r}),e.isReturningViewerKey&&localStorage.setItem(e.isReturningViewerKey,_l.FIRST),e.handleInit()),[3,4];case 3:return h=u.sent(),console.error(h),e.initHealthCheck(),[3,4];case 4:return[2]}}))}))()}},{key:"getUserIdFromEntityTag",value:function(e){return I(/^"(.+)\/(.+)"$/.exec(e),3)[2]}},{key:"parseSearchParamUserIds",value:function(e){if(!e)return{};var t=I(e.split(","),2);return{userId:t[0],sessionId:t[1]}}},{key:"getUserId",value:function(){var e,t=this.options,n=t.userIdKey,r=t.searchParamsKey,i=new URLSearchParams(window.location.search).get(r);i&&(e=this.parseSearchParamUserIds(i).userId);return e||this.localStorageEnabled&&(e=localStorage.getItem(n)),e||(e=Al.get(n)),e}},{key:"saveUserId",value:function(e){var t=this.options,n=t.userIdKey,r=t.cookieExpires,i=t.cookieDomain;this.localStorageEnabled&&localStorage.setItem(n,e),Al.set(n,e,{expires:r,domain:i})}},{key:"getSessionId",value:function(){var e,t=this.options,n=t.sessionIdKey,r=t.searchParamsKey,i=new URLSearchParams(window.location.search).get(r);i&&(e=this.parseSearchParamUserIds(i).sessionId);return e||this.sessionStorageEnabled&&(e=sessionStorage.getItem(n)),e}},{key:"saveSessionId",value:function(e){var t=this.options.sessionIdKey;this.sessionStorageEnabled&&sessionStorage.setItem(t,e)}},{key:"cleanupSearchParams",value:function(){var e=this.options.searchParamsKey,t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState({},"",t.toString()))}},{key:"getTimestamp",value:function(){return Math.floor(Date.now()/1e3)}},{key:"isMessageQueueEmpty",get:function(){return 0===this.messageQueue.length}}]),e}(),kl=Rl,Pl={onDestroy:"destroy",onDownloadFinished:"canplaythrough",onError:"error",onFullscreenEnter:"enterfullscreen",onFullscreenExit:"exitfullscreen",onMetadata:"loadedmetadata",onMetadataParsed:"loadedmetadata",onMuted:"mute",onPaused:"pause",onPictureInPictureEnter:"enterpictureinpicture",onPictureInPictureExit:"leavepictureinpicture",onPlay:"play",onPlaybackFinished:"ended",onPlaybackSpeedChanged:"ratechange",onPlayerResize:"resize",onPlaying:"playing",onReady:"ready",onSeek:"seeked",onSeeked:"seeked",onSourceLoaded:"loadeddata",onSourceUnloaded:"emptied",onStallStarted:"waiting",onTimeChanged:"timeupdate",onTimeShift:"timeupdate",onTimeShifted:"timeupdate",onUnmuted:"unmute",onVolumeChanged:"volumechange",onWarning:"error"};var Ll=n(3798),Ol=n.n(Ll),Dl=n(2294),xl=n.n(Dl),Nl=n(6291),Ml=n.n(Nl),Fl=n(974),Ul=n.n(Fl),Bl=n(8658),Vl=n.n(Bl),Gl=n(8691),Hl={};Hl.setAttributes=Ul(),Hl.insert=Ml().bind(null,"head"),Hl.domAPI=xl(),Hl.insertStyleElement=Vl();Ol()(Gl.A,Hl);var Yl=Gl.A&&Gl.A.locals?Gl.A.locals:void 0,jl=function(e){g(n,e);var t=b(n);function n(){var e;return r(this,n),o(m(e=t.apply(this,arguments)),"player",null),o(m(e),"videoRef",(0,c.createRef)()),o(m(e),"containerRef",(0,c.createRef)()),e}return a(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.options,i=t.settings,l=t.hasAutoplay,u=t.embedId,c=t.rootElement,d=t.onReady,h=t.onDestroy;if(this.videoRef.current&&this.containerRef.current){var f,p=s({rootElement:c,embedId:u,config:i,containerElement:this.containerRef.current},n),v=s({autoStartLoad:!1,maxMaxBufferLength:l?30:15,preferManagedMediaSource:!1,debug:!!(null===(f=i.tweak)||void 0===f?void 0:f.debug)},nl),_=function(e){var t=function(e){g(n,e);var t=b(n);function n(e,i,a){var s;return r(this,n),o(m(s=t.call(this,e,i,a)),"wrappedEventHandlers",void 0),o(m(s),"proxyBitmovinEvents",(function(){Object.entries(Pl).forEach((function(e){var t=I(e,2),n=t[0],r=t[1];s.on(r,(function(){for(var e=arguments.length,t=new Array(e),r=0;r=0||(i[n]=e[n]);return i}function zl(e,t){return zl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zl(e,t)}function Wl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,zl(e,t)}function Ql(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Xl=!1,Zl=c.default.createContext(null),Jl=function(e){return e.scrollTop},eu="unmounted",tu="exited",nu="entering",ru="entered",iu="exiting",au=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(i=tu,r.appearStatus=nu):i=ru:i=t.unmountOnExit||t.mountOnEnter?eu:tu,r.state={status:i},r.nextCallback=null,r}Wl(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===eu?{status:tu}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==nu&&n!==ru&&(t=nu):n!==nu&&n!==ru||(t=iu)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===nu){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:c.default.findDOMNode(this);n&&Jl(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===tu&&this.setState({status:eu})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[c.default.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||Xl?this.safeSetState({status:ru},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:nu},(function(){t.props.onEntering(a,o),t.onTransitionEnd(l,(function(){t.safeSetState({status:ru},(function(){t.props.onEntered(a,o)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:c.default.findDOMNode(this);t&&!Xl?(this.props.onExit(r),this.safeSetState({status:iu},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:tu},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:tu},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:c.default.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===eu)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,ql(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return c.default.createElement(Zl.Provider,{value:null},"function"===typeof n?n(e,r):c.default.cloneElement(c.default.Children.only(n),r))},t}(c.default.Component);function ou(){}au.contextType=Zl,au.propTypes={},au.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ou,onEntering:ou,onEntered:ou,onExit:ou,onExiting:ou,onExited:ou},au.UNMOUNTED=eu,au.EXITED=tu,au.ENTERING=nu,au.ENTERED=ru,au.EXITING=iu;var su=au,lu=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"===typeof n.className?n.className=Ql(n.className,r):n.setAttribute("class",Ql(n.className&&n.className.baseVal||"",r)));var n,r}))},uu=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var hu=function(e){if(e){var t=function(e){return[].slice.call(e)},n=3,r=[],i=null,a="requestAnimationFrame"in e?function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{sync:!1};e.cancelAnimationFrame(i);var n=function(){return s(r.filter((function(e){return e.dirty&&e.active})))};if(t.sync)return n();i=e.requestAnimationFrame(n)}:function(){},o=function(e){return function(t){r.forEach((function(t){return t.dirty=e})),a(t)}},s=function(e){e.filter((function(e){return!e.styleComputed})).forEach((function(e){e.styleComputed=d(e)})),e.filter(h).forEach(f);var t=e.filter(c);t.forEach(u),t.forEach((function(e){f(e),l(e)})),t.forEach(p)},l=function(e){return e.dirty=0},u=function(e){e.availableWidth=e.element.parentNode.clientWidth,e.currentWidth=e.element.scrollWidth,e.previousFontSize=e.currentFontSize,e.currentFontSize=Math.min(Math.max(e.minSize,e.availableWidth/e.currentWidth*e.previousFontSize),e.maxSize),e.whiteSpace=e.multiLine&&e.currentFontSize===e.minSize?"normal":"nowrap"},c=function(e){return 2!==e.dirty||2===e.dirty&&e.element.parentNode.clientWidth!==e.availableWidth},d=function(t){var n=e.getComputedStyle(t.element,null);return t.currentFontSize=parseFloat(n.getPropertyValue("font-size")),t.display=n.getPropertyValue("display"),t.whiteSpace=n.getPropertyValue("white-space"),!0},h=function(e){var t=!1;return!e.preStyleTestCompleted&&(/inline-/.test(e.display)||(t=!0,e.display="inline-block"),"nowrap"!==e.whiteSpace&&(t=!0,e.whiteSpace="nowrap"),e.preStyleTestCompleted=!0,t)},f=function(e){e.element.style.whiteSpace=e.whiteSpace,e.element.style.display=e.display,e.element.style.fontSize=e.currentFontSize+"px"},p=function(e){e.element.dispatchEvent(new CustomEvent("fit",{detail:{oldValue:e.previousFontSize,newValue:e.currentFontSize,scaleFactor:e.currentFontSize/e.previousFontSize}}))},m=function(e,t){return function(n){e.dirty=t,e.active&&a(n)}},v=function(e){return function(){r=r.filter((function(t){return t.element!==e.element})),e.observeMutations&&e.observer.disconnect(),e.element.style.whiteSpace=e.originalStyle.whiteSpace,e.element.style.display=e.originalStyle.display,e.element.style.fontSize=e.originalStyle.fontSize}},g=function(e){return function(){e.active||(e.active=!0,a())}},y=function(e){return function(){return e.active=!1}},_=function(e){e.observeMutations&&(e.observer=new MutationObserver(m(e,1)),e.observer.observe(e.element,e.observeMutations))},E={minSize:16,maxSize:512,multiLine:!0,observeMutations:"MutationObserver"in e&&{subtree:!0,childList:!0,characterData:!0}},b=null,S=function(){e.clearTimeout(b),b=e.setTimeout(o(2),w.observeWindowDelay)},A=["resize","orientationchange"];return Object.defineProperty(w,"observeWindow",{set:function(t){var n="".concat(t?"add":"remove","EventListener");A.forEach((function(t){e[n](t,S)}))}}),w.observeWindow=!0,w.observeWindowDelay=100,w.fitAll=o(n),w}function T(e,t){var i=Object.assign({},E,t),o=e.map((function(e){var t=Object.assign({},i,{element:e,active:!0});return function(e){e.originalStyle={whiteSpace:e.element.style.whiteSpace,display:e.element.style.display,fontSize:e.element.style.fontSize},_(e),e.newbie=!0,e.dirty=!0,r.push(e)}(t),{element:e,fit:m(t,n),unfreeze:g(t),freeze:y(t),unsubscribe:v(t)}}));return a(),o}function w(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e?T(t(document.querySelectorAll(e)),n):T([e],n)[0]}}("undefined"==typeof window?null:window),fu=hu,pu=function(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?pu(t):t)}),[])},mu=n(8576),vu={};vu.setAttributes=Ul(),vu.insert=Ml().bind(null,"head"),vu.domAPI=xl(),vu.insertStyleElement=Vl();Ol()(mu.A,vu);var gu=mu.A&&mu.A.locals?mu.A.locals:void 0,yu="
",_u="";function Eu(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var n=(Array.isArray(e)?e:[e]).filter(Boolean);if(t){var r=//gi,i=n.map((function(e){return e.trim().replace(r,yu).split(yu)}));n=pu(i)}var a=n.map((function(e){if(e.includes(_u)){var t=new RegExp(_u,"gi");return[f("i",{children:e.replace(t,"")}),f("br",{})]}return[e,f("br",{})]}));return pu(a).slice(0,-1)}}var bu=function(e){var t=e.value,n=e.minSize,r=void 0===n?0:n,i=e.maxSize,a=void 0===i?512:i,o=e.multiLine,u=void 0!==o&&o,d=e.decodeLineBreaks,h=void 0===d||d,p=e.wrapperStyle,m=void 0===p?{}:p,v=e.wrapperClassName,g=e.as,y=void 0===g?"div":g,_=e.className,E=void 0===_?"":_,b=du(e,["value","minSize","maxSize","multiLine","decodeLineBreaks","wrapperStyle","wrapperClassName","as","className"]),S=(0,c.useRef)(null);(0,c.useLayoutEffect)((function(){if(a){var e=S.current,t=fu(e,{minSize:r,maxSize:a,multiLine:u,observeMutations:{subtree:!0,childList:!0,characterData:!0,attributeFilter:["class"]}});return setTimeout((function(){return t.fit()}),250),function(){fu(e).unsubscribe()}}}),[a,r,u]);var T=Eu(t,h);return f("div",{style:l(s({},m),{width:"100%"}),className:v,children:f(y,l(s({className:A(gu.scalableText,E),ref:S},b),{children:T}))})};function Su(){for(var e=arguments.length,t=new Array(e),n=0;n{let t;const n=new Set,r=(e,r)=>{const i="function"===typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!==typeof i||null===i)?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},o=t=e(r,i,a);return a},Cu=e=>e?Iu(e):Iu;var Ru=n(4632);const{useDebugValue:ku}=c.default,{useSyncExternalStoreWithSelector:Pu}=Ru,Lu=e=>e;function Ou(e,t=Lu,n){const r=Pu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ku(r),r}function Du(e,t){if(Object.is(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r(t,n,r)=>{const i=r.subscribe;r.subscribe=(e,t,n)=>{let a=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let o=e(r.getState());a=n=>{const r=e(n);if(!i(o,r)){const e=o;t(o=r,e)}},(null==n?void 0:n.fireImmediately)&&t(o,o)}return i(a)};return e(t,n,r)};var Nu=function(e,t,n){window._vidalytics||(window._vidalytics={}),window._vidalytics.embeds||(window._vidalytics.embeds={}),window._vidalytics.embeds[t]||(window._vidalytics.embeds[t]={}),window._vidalytics.embeds[t].store||(window._vidalytics.embeds[t].store={}),window._vidalytics.embeds[t].store[e]=n},Mu=(0,c.createContext)(null);function Fu(e){var t=e.player,n=e.children;return f(Mu.Provider,{value:t,children:n})}function Uu(){return(0,c.useContext)(Mu)}var Bu={volume:{events:["volumechange"],getValue:function(e){return e.volume()}},muted:{events:["volumechange"],getValue:function(e){return e.muted()}},currentTime:{events:["timeupdate"],getValue:function(e){return e.currentTime()}},duration:{events:["durationchange"],getValue:function(e){return Math.round(10*e.duration())/10}},paused:{events:["pause","play"],getValue:function(e){return e.paused()}},fullscreen:{events:["fullscreenchange"],getValue:function(e){return e.isFullscreen()}},currentBreakpoint:{events:["resize","playerresize"],getValue:function(e){return e.currentBreakpoint()}},playbackRate:{events:["ratechange"],getValue:function(e){return e.playbackRate()}},playbackRates:{events:["playbackrateschange"],getValue:function(e){return e.playbackRates()}},levels:{events:[],getValue:function(e){return e.levels()||[]}},currentLevel:{events:[],getValue:function(e){var t;return e.levels()[null===(t=e.hls)||void 0===t?void 0:t.currentLevel]}},aspectRatio:{events:["resize","playerresize","fullscreenchange"],getValue:function(e){return e.aspectRatio()}},currentHeight:{events:["resize","playerresize"],getValue:function(e){return e.currentHeight()}},currentWidth:{events:["resize","playerresize"],getValue:function(e){return e.currentWidth()}},ended:{events:["ended","play","pause","seeked:internal"],getValue:function(e){return e.ended()}},isStarted:{events:["play","pause","canplay","loadedmetadata"],getValue:function(e){return e.isStarted()}},hasCaptions:{events:["captionschange"],getValue:function(e){return e.hasCaptions()}},isTouched:{events:["play","pause","timeupdate"],getValue:function(e){return e.isTouched()}},hasErrorFatal:{events:["error","error:fatal","error:internal"],getValue:function(e){return e.hasErrorFatal()}},error:{events:["error","error:fatal","error:internal"],getValue:function(e){return e.error()}},hasTimeUpdate:{events:["timeupdate"],getValue:function(e){return e.hasTimeUpdate()}},waiting:{events:[],getValue:function(){return!1}}};var Vu=(0,c.createContext)({});function Gu(e){var t=e.embedId,n=e.initialState,r=void 0===n?{}:n,i=e.children,a=Uu(),u=(0,c.useRef)(),d=Object.keys(Bu),h=d.reduce((function(e,t){var n=Bu[t].getValue(a);return Number.isNaN(n)?l(s({},e),o({},t,0)):l(s({},e),o({},t,n))}),r);if(!u.current){var p=function(e){return Cu()(xu((function(t){return s({rootEmbedElement:document.createElement("div"),embedId:"",embedEnv:"production",updateState:function(e,n){return t((function(t){return l(s({},t),o({},e,n))}))}},e)})))}(h);u.current=p,Nu("player",t,p)}var m=u.current.getState().updateState;return(0,c.useEffect)((function(){var e=d.reduce((function(e,t){var n=Bu[t];return n.events.forEach((function(r){e[r]?e[r][t]=Bu[t]:e[r]=o({},t,n)})),e}),{}),t=Object.keys(e).reduce((function(t,n){function r(){Object.keys(e[n]).forEach((function(t){var r=e[n][t].getValue(a);Number.isNaN(r)||m(t,r)}))}return a.on(n,r),r(),t[n]=r,t}),{});function n(){m("levels",a.levels())}function r(){var e,t=a.levels()[null===(e=a.hls)||void 0===e?void 0:e.currentLevel];m("currentLevel",t)}function i(){m("waiting",!0),a.on("timeupdate",(function e(){m("waiting",!1),a.off("timeupdate",e)}))}return a.hls&&(a.hls.on(us.Events.MANIFEST_PARSED,n),a.hls.on(us.Events.LEVELS_UPDATED,n),a.hls.on(us.Events.LEVEL_LOADED,n),a.hls.on(us.Events.LEVEL_SWITCHED,r)),a.on("waiting",i),function(){Object.keys(t).forEach((function(e){a.off(e,t[e])})),a.hls&&(a.hls.off(us.Events.MANIFEST_PARSED,n),a.hls.off(us.Events.LEVELS_UPDATED,n),a.hls.off(us.Events.LEVEL_LOADED,n),a.hls.off(us.Events.LEVEL_SWITCHED,r)),a.off("waiting",i)}}),[a]),f(Vu.Provider,{value:u.current,children:i})}function Hu(){return(0,c.useContext)(Vu)}function Yu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;return Ou((0,c.useContext)(Vu),e,t)}function ju(e){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ju(e)}function Ku(e,t,n){return Ku=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&zl(i,n.prototype),i},Ku.apply(null,arguments)}function $u(e){var t="function"===typeof Map?new Map:void 0;return $u=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"===typeof e}}(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ku(e,arguments,ju(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),zl(n,e)},$u(e)}var qu=function(e){function t(t){return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this)}return Wl(t,e),t}($u(Error));function zu(e,t){return e.substr(-t.length)===t}var Wu=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function Qu(e){return"string"!==typeof e?e:e.match(Wu)?parseFloat(e):e}var Xu=function(e){return function(t,n){void 0===n&&(n="16px");var r=t,i=n;if("string"===typeof t){if(!zu(t,"px"))throw new qu(69,e,t);r=Qu(t)}if("string"===typeof n){if(!zu(n,"px"))throw new qu(70,e,n);i=Qu(n)}if("string"===typeof r)throw new qu(71,t,e);if("string"===typeof i)throw new qu(72,n,e);return""+r/i+e}};Xu("em");Xu("rem");function Zu(e){return Math.round(255*e)}function Ju(e,t,n){return Zu(e)+","+Zu(t)+","+Zu(n)}function ec(e,t,n,r){if(void 0===r&&(r=Ju),0===t)return r(n,n,n);var i=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,o=a*(1-Math.abs(i%2-1)),s=0,l=0,u=0;i>=0&&i<1?(s=a,l=o):i>=1&&i<2?(s=o,l=a):i>=2&&i<3?(l=a,u=o):i>=3&&i<4?(l=o,u=a):i>=4&&i<5?(s=o,u=a):i>=5&&i<6&&(s=a,u=o);var c=n-a/2;return r(s+c,l+c,u+c)}var tc={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var nc=/^#[a-fA-F0-9]{6}$/,rc=/^#[a-fA-F0-9]{8}$/,ic=/^#[a-fA-F0-9]{3}$/,ac=/^#[a-fA-F0-9]{4}$/,oc=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,sc=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,lc=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,uc=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function cc(e){if("string"!==typeof e)throw new qu(3);var t=function(e){if("string"!==typeof e)return e;var t=e.toLowerCase();return tc[t]?"#"+tc[t]:e}(e);if(t.match(nc))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(rc)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(ic))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(ac)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=oc.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var a=sc.exec(t.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])>1?parseFloat(""+a[4])/100:parseFloat(""+a[4])};var o=lc.exec(t);if(o){var s="rgb("+ec(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",l=oc.exec(s);if(!l)throw new qu(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=uc.exec(t.substring(0,50));if(u){var c="rgb("+ec(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",d=oc.exec(c);if(!d)throw new qu(4,t,c);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new qu(5)}function dc(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=a-o,u=s>.5?l/(2-a-o):l/(a+o);switch(a){case n:t=(r-i)/l+(r=1?vc(e,t,n):"rgba("+ec(e,t,n)+","+r+")";if("object"===typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?vc(e.hue,e.saturation,e.lightness):"rgba("+ec(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new qu(2)}function _c(e,t,n){if("number"===typeof e&&"number"===typeof t&&"number"===typeof n)return hc("#"+fc(e)+fc(t)+fc(n));if("object"===typeof e&&void 0===t&&void 0===n)return hc("#"+fc(e.red)+fc(e.green)+fc(e.blue));throw new qu(6)}function Ec(e,t,n,r){if("string"===typeof e&&"number"===typeof t){var i=cc(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"===typeof e&&"number"===typeof t&&"number"===typeof n&&"number"===typeof r)return r>=1?_c(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"===typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?_c(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new qu(7)}var bc=function(e){return"number"===typeof e.red&&"number"===typeof e.green&&"number"===typeof e.blue&&("number"!==typeof e.alpha||"undefined"===typeof e.alpha)},Sc=function(e){return"number"===typeof e.red&&"number"===typeof e.green&&"number"===typeof e.blue&&"number"===typeof e.alpha},Ac=function(e){return"number"===typeof e.hue&&"number"===typeof e.saturation&&"number"===typeof e.lightness&&("number"!==typeof e.alpha||"undefined"===typeof e.alpha)},Tc=function(e){return"number"===typeof e.hue&&"number"===typeof e.saturation&&"number"===typeof e.lightness&&"number"===typeof e.alpha};function wc(e){if("object"!==typeof e)throw new qu(8);if(Sc(e))return Ec(e);if(bc(e))return _c(e);if(Tc(e))return yc(e);if(Ac(e))return gc(e);throw new qu(8)}function Ic(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):Ic(e,t,r)}}function Cc(e){return Ic(e,e.length,[])}Cc((function(e,t){if("transparent"===t)return t;var n=dc(t);return wc($l({},n,{hue:n.hue+parseFloat(e)}))}));function Rc(e,t,n){return Math.max(e,Math.min(t,n))}Cc((function(e,t){if("transparent"===t)return t;var n=dc(t);return wc($l({},n,{lightness:Rc(0,1,n.lightness-parseFloat(e))}))}));Cc((function(e,t){if("transparent"===t)return t;var n=dc(t);return wc($l({},n,{saturation:Rc(0,1,n.saturation-parseFloat(e))}))}));Cc((function(e,t){if("transparent"===t)return t;var n=dc(t);return wc($l({},n,{lightness:Rc(0,1,n.lightness+parseFloat(e))}))}));var kc=Cc((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=cc(t),i=$l({},r,{alpha:"number"===typeof r.alpha?r.alpha:1}),a=cc(n),o=$l({},a,{alpha:"number"===typeof a.alpha?a.alpha:1}),s=i.alpha-o.alpha,l=2*parseFloat(e)-1,u=((l*s===-1?l:l+s)/(1+l*s)+1)/2,c=1-u;return Ec({red:Math.floor(i.red*u+o.red*c),green:Math.floor(i.green*u+o.green*c),blue:Math.floor(i.blue*u+o.blue*c),alpha:i.alpha*parseFloat(e)+o.alpha*(1-parseFloat(e))})}));Cc((function(e,t){if("transparent"===t)return t;var n=cc(t);return Ec($l({},n,{alpha:Rc(0,1,(100*("number"===typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))}));Cc((function(e,t){if("transparent"===t)return t;var n=dc(t);return wc($l({},n,{saturation:Rc(0,1,n.saturation+parseFloat(e))}))}));Cc((function(e,t){return"transparent"===t?t:wc($l({},dc(t),{hue:parseFloat(e)}))}));Cc((function(e,t){return"transparent"===t?t:wc($l({},dc(t),{lightness:parseFloat(e)}))}));Cc((function(e,t){return"transparent"===t?t:wc($l({},dc(t),{saturation:parseFloat(e)}))}));Cc((function(e,t){return"transparent"===t?t:kc(parseFloat(e),"rgb(0, 0, 0)",t)}));Cc((function(e,t){return"transparent"===t?t:kc(parseFloat(e),"rgb(255, 255, 255)",t)}));var Pc=Cc((function(e,t){if("transparent"===t)return t;var n=cc(t);return Ec($l({},n,{alpha:Rc(0,1,+(100*("number"===typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));function Lc(e){return window.matchMedia(e).matches}var Oc=function(e){var t=I((0,c.useState)(Lc(e)),2),n=t[0],r=t[1],i=(0,c.useCallback)((function(){r(Lc(e))}),[e]);return(0,c.useEffect)((function(){var t=window.matchMedia(e);return"function"===typeof t.addListener?t.addListener(i):t.addEventListener("change",i),function(){"function"===typeof t.removeListener?t.removeListener(i):t.removeEventListener("change",i)}}),[e,i]),n},Dc=n(8354),xc=n.n(Dc);function Nc(){var e=xc().getParser(window.navigator.userAgent),t=e.getResult(),n="iOS"===t.os.name,r="Safari"===t.browser.name,i="desktop"===t.platform.type,a="mobile"===t.platform.type,o="tablet"===t.platform.type;return{parser:e,isiOS:n,isSafari:r,isPlatformDesktop:i,isPlatformMobile:a,isPlatformTablet:o,isPlatformMobileLike:a||o}}var Mc=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;function Fc(e){var t=cc(e),n=dc(e),r=n.hue,i=n.saturation,a=n.lightness;if(a>.5){var o=Math.round(100*a/2),s=100*i;return"hsl(".concat(r,", ").concat(s,"%, ").concat(o,"%)")}return function(e,t){var n=Math.round(e.red*t+255*(1-t)),r=Math.round(e.green*t+255*(1-t)),i=Math.round(e.blue*t+255*(1-t));return"rgb(".concat(n,", ").concat(r,", ").concat(i,")")}(t,.4)}var Uc="vid_embed--",Bc="--vid-",Vc={tiny:315,xsmall:380,small:400,medium:600,large:800,xlarge:1200,xxlarge:1600,huge:1/0},Gc=["tiny","xsmall","small","medium","large","xlarge","xxlarge","huge"];function Hc(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uc;if(e)return t=/^xx.*$/.test(e)?"xx-".concat(e.slice(2)):/^x[^x].*$/.test(e)?"x-".concat(e.slice(1)):e,"".concat(n).concat(t)}function Yc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bc,r=e.replace(Mc,(function(e){return"-".concat(e.toLowerCase())})),i=t&&"".concat(t,"-");return"".concat(n).concat(i).concat(r)}function jc(e,t){return Object.keys(e).reduce((function(n,r){var i=e[r],a=t?"".concat(t).concat(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(r)):r;("string"===typeof i&&(n[a]=i),"object"===typeof i)&&(n=s({},n,jc(i,r)));return n}),{})}var Kc=(0,c.createContext)({});function $c(e){var t=e.embedId,n=e.theme,r=e.children,i=wu(),a=Yu((function(e){return e.rootEmbedElement})),o=Yu((function(e){return e.currentBreakpoint})),l=function(){var e=Yu((function(e){return e.currentWidth})),t=Yu((function(e){return e.currentHeight}));return{isAnyHoverNone:Oc("(any-hover: none)"),orientation:Hs(e,t),aspectRatio:Ys(e,t)}}(),u=(0,c.useMemo)((function(){return function(e){var t=Gc.indexOf(e);return{only:function(e){return Gc.indexOf(e)===t},down:function(e){return Gc.indexOf(e)>=t},up:function(e){return Gc.indexOf(e)<=t},between:function(e,n){var r=Gc.indexOf(e),i=Gc.indexOf(n);return r<=t&&i>=t}}}(o)}),[o]),d=(0,c.useMemo)((function(){return function(e){var t,n,r,i,a,o,l,u,c,d,h,f,p,m,v,g,y=e.ui.color.background,_=e.ui.color.foreground,E=!!e.ui.color.force,b=!!e.ui.shadow,S=null===(n=e.ui.overlay.unmute)||void 0===n||null===(t=n.color)||void 0===t?void 0:t.background,A=null===(i=e.ui.overlay.unmute)||void 0===i||null===(r=i.color)||void 0===r?void 0:r.foreground,T=null===(o=e.ui.overlay.resume)||void 0===o||null===(a=o.color)||void 0===a?void 0:a.background,w=null===(u=e.ui.overlay.resume)||void 0===u||null===(l=u.color)||void 0===l?void 0:l.foreground,I=null===(d=e.ui.overlay.redirect)||void 0===d||null===(c=d.color)||void 0===c?void 0:c.background,C=null===(f=e.ui.overlay.redirect)||void 0===f||null===(h=f.color)||void 0===h?void 0:h.foreground,R=null===(m=e.ui.overlay.expire)||void 0===m||null===(p=m.color)||void 0===p?void 0:p.background,k=null===(g=e.ui.overlay.expire)||void 0===g||null===(v=g.color)||void 0===v?void 0:v.foreground;function P(e,t){return E?t:e}return s({isForced:E,hasShadow:b,primary:y,primaryTransparent:Pc(.2,y),primaryDark:Fc(y),secondary:_,autoPlay:{primary:P(S,y),primaryTransparent:Pc(.25,P(S,y)),secondary:P(A,_)},resume:{primary:P(T,y),secondary:P(w,_)}},I&&C&&{redirect:{primary:P(I,y),secondary:P(C,_)}},R&&k&&{expire:{primary:P(R,y),secondary:P(k,_)}})}(i)}),[i]),h=(0,c.useMemo)((function(){return Nc()}),[]),p={breakpoints:u,media:l,colors:d,browser:h};(0,c.useEffect)((function(){var e=jc(d),t=Object.entries(e);return t.forEach((function(e){var t=I(e,2),n=t[0],r=t[1],i=Yc(n,"colors");a.style.setProperty(i,r)})),function(){t.forEach((function(e){var t=I(e,2),n=t[0],r=(t[1],Yc(n,"colors"));a.style.removeProperty(r)}))}}),[a,d]);var m=null!==n&&void 0!==n?n:p;return(0,c.useEffect)((function(){Nu("theme",t,m)}),[t,m]),f(Kc.Provider,{value:m,children:r})}function qc(){return(0,c.useContext)(Kc)}var zc=(0,c.createContext)({});function Wc(e){var t=e.embedId,n=e.children,r=e.initialState,i=void 0===r?{}:r,a=(0,c.useRef)();if(!a.current){var o=function(e){return Cu()(xu((function(t){return s({isUserActive:!0,isControlBarActive:!1,isControlBarDisabled:!1,isPlayGateActive:!1,isSmartVidsOverlayActive:!1,isActivityObserverDisabled:!1,isDocumentActive:!0,isManuallyPaused:!1,isSeeking:!1,isVolumeControlHovered:!1,hasThumbnail:!1,activeCueHeight:0,isFirstSession:!0,lastDuration:0,isThumbnailVisible:!1,seekTime:0,lastSeekTime:0,hasLicenseError:!1,hasAutoPlayOverlay:!1,isBigPlayButtonDisabled:!1,hasControlBar:!0,autoPlayStatus:"pristine",currentBitrate:-1,isTouchedInPristineState:!1,setIsUserActive:function(e){return t((function(t){return l(s({},t),{isUserActive:e})}))},setHasLicenseError:function(e){return t((function(t){return l(s({},t),{hasLicenseError:e})}))},setLastDuration:function(e){return t((function(t){return l(s({},t),{lastDuration:e})}))},setIsControlBarActive:function(e){return t((function(t){return l(s({},t),{isControlBarActive:e})}))},setActiveCueHeight:function(e){return t((function(t){return l(s({},t),{activeCueHeight:e})}))},setIsPlayGateActive:function(e){return t((function(t){return l(s({},t),{isPlayGateActive:e})}))},setIsSmartVidsOverlayActive:function(e){return t((function(t){return l(s({},t),{isSmartVidsOverlayActive:e})}))},setIsControlBarDisabled:function(e){return t((function(t){return l(s({},t),{isControlBarDisabled:e})}))},setIsBigPlayButtonDisabled:function(e){return t((function(t){return l(s({},t),{isBigPlayButtonDisabled:e})}))},setHasThumbnail:function(e){return t((function(t){return l(s({},t),{hasThumbnail:e})}))},setIsThumbnailVisible:function(e){return t((function(t){return l(s({},t),{isThumbnailVisible:e})}))},setIsDocumentActive:function(e){return t((function(t){return l(s({},t),{isDocumentActive:e})}))},setIsManuallyPaused:function(e){return t((function(t){return l(s({},t),{isManuallyPaused:e})}))},setIsSeeking:function(e){return t((function(t){return l(s({},t),{isSeeking:e})}))},setIsVolumeControlHovered:function(e){return t((function(t){return l(s({},t),{isVolumeControlHovered:e})}))},setHasControlBar:function(e){return t((function(t){return l(s({},t),{hasControlBar:e})}))},setIsFirstSession:function(e){return t((function(t){return l(s({},t),{isFirstSession:e})}))},setSeekTime:function(e){return t((function(t){return l(s({},t),{seekTime:e})}))},setLastSeekTime:function(e){return t((function(t){return l(s({},t),{lastSeekTime:e})}))},setHasAutoPlayOverlay:function(e){return t((function(t){return l(s({},t),{hasAutoPlayOverlay:e})}))},setAutoPlayStatus:function(e){return t((function(t){return l(s({},t),{autoPlayStatus:e})}))},setCurrentBitrate:function(e){return t((function(t){return l(s({},t),{currentBitrate:e})}))},setIsActivityObserverDisabled:function(e){return t((function(t){return l(s({},t),{isActivityObserverDisabled:e})}))},setIsTouchedInPristineState:function(e){return t((function(t){return l(s({},t),{isTouchedInPristineState:e})}))}},e)})))}(i);a.current=o,Nu("playerState",t,o)}return f(zc.Provider,{value:a.current,children:n})}function Qc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;return Ou((0,c.useContext)(zc),e,t)}var Xc=n(7430),Zc={};Zc.setAttributes=Ul(),Zc.insert=Ml().bind(null,"head"),Zc.domAPI=xl(),Zc.insertStyleElement=Vl();Ol()(Xc.A,Zc);var Jc=Xc.A&&Xc.A.locals?Xc.A.locals:void 0;function ed(e){return f("svg",l(s({viewBox:"0 0 122 116"},e),{children:[f("path",{fill:"currentColor",fillRule:"evenodd",d:"M62.65 12.63a2.5 2.5 0 0 0-4.09-1.94L27.72 36c-.56.04-1.07.26-1.47.6H6.38c-1.68 0-3.23.74-4.32 1.88a6.29 6.29 0 0 0-1.77 4.4v30.27c0 1.58.59 3.18 1.75 4.38a5.9 5.9 0 0 0 4.34 1.9h20.61l31.57 25.9a2.5 2.5 0 0 0 4.09-1.93V12.63ZM25.39 41.6H6.38a1.02 1.02 0 0 0-.75.38c-.2.2-.34.51-.34.9v30.27a1.29 1.29 0 0 0 .41.98c.18.2.43.3.68.3h19V41.6Zm5 34.15 27.26 22.37v-80.2L30.39 40.28v35.46Z"}),f("g",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"5",fill:"none",children:[f("path",{d:"M99.1 11.42c27.7 31.22 25.72 62.27.6 93.16"}),f("path",{d:"M87.05 26.33c19.7 23.73 17.18 44.49-.09 63.3"}),f("path",{d:"M73.71 41.1c10.64 10.29 11.65 21.45 0 33.8"}),f("path",{d:"M113.38 2.73 8.61 113.27"})]})]}))}var td=function(e){var t,n=e.title,r=e.subtitle,i=qc(),a=wu(),u=Yu((function(e){return e.currentWidth})),c=Qc((function(e){return e.isUserActive})),d=a.ui.controlBar.alwaysShow,h="landscape"===i.media.orientation,p=1===i.media.aspectRatio,m="portrait"===i.media.orientation&&1!==i.media.aspectRatio,v=u*(p?.09:h?.065:.18),g=A(Jc.wrapper,(o(t={},Jc.wrapperPortrait,m),o(t,Jc.wrapperSquare,p),o(t,Jc.wrapperHasOffset,h&&(c||!c&&d)),t)),y={textShadow:"".concat(i.colors.autoPlay.primary," 2px 2px 2px"),color:i.colors.autoPlay.secondary},_={color:i.colors.autoPlay.secondary,filter:"drop-shadow(1px 1px 1px ".concat(i.colors.autoPlay.primary,")")},E={minSize:12,maxSize:v,style:y,className:Jc.title};return f("div",{className:g,children:f("div",{className:Jc.article,children:[n?f(bu,l(s({},E),{value:n,multiLine:!0})):f("div",{}),f(ed,{style:_,className:Jc.icon}),r?f(bu,l(s({},E),{value:r,multiLine:!0})):f("div",{})]})})},nd=n(588),rd={};rd.setAttributes=Ul(),rd.insert=Ml().bind(null,"head"),rd.domAPI=xl(),rd.insertStyleElement=Vl();Ol()(nd.A,rd);var id=nd.A&&nd.A.locals?nd.A.locals:void 0;function ad(){return f("svg",{width:"86",height:"78",viewBox:"0 0 86 78",className:id.icon,children:[f("path",{fill:"currentColor",fillRule:"evenodd",d:"M44.28 9.05a2 2 0 0 0-3.23-1.58L19.74 24.05a1.9 1.9 0 0 0-1.01.39H5.03a4.5 4.5 0 0 0-4.5 4.48V48.8c0 1.17.46 2.32 1.33 3.17.85.86 2 1.32 3.16 1.32h14.22l21.81 16.96a2 2 0 0 0 3.23-1.58V9.05ZM17.93 28.44H5.03a.5.5 0 0 0-.34.15l-.03.03a.42.42 0 0 0-.12.3V48.8c0 .14.05.24.12.3l.06.07c.06.06.17.12.3.12h12.9V28.44Zm4 21.86 18.35 14.28V13.14L21.93 27.4v22.9Z"}),f("g",{fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",children:[f("path",{d:"M51.68 27.75c7.37 6.75 8.07 14.09 0 22.2",className:id.iconBlink}),f("path",{d:"M60.92 18.05c13.65 15.58 11.9 29.21-.06 41.57",className:id.iconBlink}),f("path",{d:"M69.27 8.25c19.2 20.51 17.82 40.9.41 61.19",className:id.iconBlink}),f("path",{d:"m79.17 2.55-72.6 72.6"})]})]})}var od=function(e){var t,n=e.title,r=e.subtitle,i=qc(),a=wu(),u=Yu((function(e){return e.currentWidth})),c=Qc((function(e){return e.isUserActive})),d=Qc((function(e){return e.hasControlBar})),h=a.ui.controlBar.alwaysShow,p="portrait"===i.media.orientation,m=i.media.aspectRatio,v=i.breakpoints.down("small"),g=!!n||!!r,y=v?18:.05*u,_=A(id.box,(o(t={},id.boxPortrait,p),o(t,id.boxHasOffset,d&&(c||!c&&h)),o(t,id.boxStretched,!!v),t)),E=l(s({},function(){var e,t="calc(".concat(90,"% - ").concat(40,"px)"),n="calc(".concat(90/m,"% - ").concat(40,"px)");return p&&(n=(e=[t,n])[0],t=e[1]),v&&(n="calc(".concat(90,"% - ").concat(40,"px)")),{width:n,height:t}}()),{backgroundColor:i.colors.autoPlay.primaryTransparent,borderColor:i.colors.autoPlay.secondary,color:i.colors.autoPlay.secondary});return f("div",{className:id.wrapper,children:f("div",{className:_,style:E,children:f("div",{className:id.content,children:[f(ad,{}),g&&f("div",{className:id.heading,children:f(bu,{value:[n,r],minSize:v?p?15:9:u*(p?.0425:.025),maxSize:y,multiLine:!0})})]})})})},sd=n(5913),ld={};ld.setAttributes=Ul(),ld.insert=Ml().bind(null,"head"),ld.domAPI=xl(),ld.insertStyleElement=Vl();Ol()(sd.A,ld);var ud=sd.A&&sd.A.locals?sd.A.locals:void 0;function cd(){return f("svg",{width:"25",height:"22",viewBox:"0 0 25 22",className:ud.icon,children:[f("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.09 2.87a.75.75 0 0 0-1.21-.59L6.1 6.77a.75.75 0 0 0-.26.1H2.18A1.43 1.43 0 0 0 .75 8.29v5.42c0 .37.14.74.42 1.01.27.28.64.42 1 .42h3.81l5.9 4.58a.75.75 0 0 0 1.2-.59V2.87Zm-7.6 5.5H2.25v5.27h3.24V8.37ZM7 14.02l4.6 3.58V4.4L7 7.98v6.04Z"}),f("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",children:[f("path",{d:"M14.9 7.97c2.01 1.85 2.2 3.85 0 6.06",className:ud.iconBlink}),f("path",{d:"M17.42 5.33c3.73 4.25 3.25 7.97-.01 11.34",className:ud.iconBlink}),f("path",{d:"M19.7 2.66c5.23 5.59 4.86 11.15.11 16.68",className:ud.iconBlink}),f("path",{d:"M22.4 1.1 2.6 20.9"})]})]})}var dd=function(e){var t=e.title,n=qc(),r=Eu(t),i={backgroundColor:n.colors.autoPlay.primaryTransparent,color:n.colors.autoPlay.secondary};return f("div",{className:ud.wrapper,children:f("div",{className:A(ud.button,"bmpui-ui-vidalytics-unmute-button"),style:i,children:[!!t&&f("div",{className:ud.title,children:r}),f(cd,{})]})})};var hd=function(e){var t=(0,c.useRef)();return(0,c.useEffect)((function(){t.current=e})),t.current},fd=n(8196),pd={};pd.setAttributes=Ul(),pd.insert=Ml().bind(null,"head"),pd.domAPI=xl(),pd.insertStyleElement=Vl();Ol()(fd.A,pd);var md=fd.A&&fd.A.locals?fd.A.locals:void 0;var vd=function(e){var n,r,i,a,o=e.config,s=e.hasMobileMessage,l=e.hasReplay,d=e.isOnlyMuted,h=qc(),p=Uu(),m=Yu((function(e){return e.embedId})).replace("vidalytics_embed_",""),v=Yu((function(e){return e.volume})),g=hd(v),y=Yu((function(e){return e.ended})),_=hd(y),E=Yu((function(e){return e.muted})),b=hd(E),S=Yu((function(e){return e.fullscreen})),T=hd(S),w=Qc((function(e){return e.isManuallyPaused})),C=hd(w),R=Qc((function(e){return e.setIsManuallyPaused})),k=Qc((function(e){return e.isTouchedInPristineState})),P=Qc((function(e){return e.hasAutoPlayOverlay})),L=Qc((function(e){return e.setHasAutoPlayOverlay})),O=Qc((function(e){return e.setAutoPlayStatus})),D=I((0,c.useState)(!1),2),x=D[0],N=D[1],M=Tl("localStorage"),F=!1!==o.show,U=h.browser.isPlatformMobileLike,B=!!o.doReplay&&l,V=U?!!(null===(r=o.goFullscreen)||void 0===r||null===(n=r.mobile)||void 0===n?void 0:n.enabled):!!(null===(a=o.goFullscreen)||void 0===a||null===(i=a.default)||void 0===i?void 0:i.enabled);function G(){N(!0)}var H=(0,c.useCallback)(t((function(){var e,t,n,r=arguments;return u(this,(function(i){switch(i.label){case 0:if(e=!(r.length>0&&void 0!==r[0])||r[0],t=p.muted(),p.muted(!0),!cl(n=p.play()))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),G(),F&&L(!0),O("muted"),[3,4];case 3:return i.sent(),e?[2,H(!1)]:(p.muted(t),O("fail"),[3,4]);case 4:return[2]}}))})),[p,F,O,L]),Y=(0,c.useCallback)(t((function(){var e;return u(this,(function(t){switch(t.label){case 0:if(p.muted()&&p.muted(!1),!cl(e=p.play()))return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e];case 2:return t.sent(),G(),O("success"),k&&(L(!1),M&&localStorage.setItem("vidalytics_video_".concat(m,"_unmuted"),"true")),[3,4];case 3:return t.sent(),H(),[3,4];case 4:return[2]}}))})),[m,p,O,k,L,H,M]);function j(e){var t,n,r={top:"textTop",bottom:"textBottom"}[e];return U&&s?null===(n=o.mobile)||void 0===n?void 0:n[r].text:null===(t=o[r])||void 0===t?void 0:t.text}(0,c.useEffect)((function(){var e,t=null===(e=window._vidalytics)||void 0===e?void 0:e.hasAutoPlayWithSoundAttempt;d&&!k||t?H():(Y(),window._vidalytics||(window._vidalytics={}),window._vidalytics.hasAutoPlayWithSoundAttempt||(window._vidalytics.hasAutoPlayWithSoundAttempt=!0))}),[p,d,k,H,Y]),(0,c.useEffect)((function(){x&&(P&&[v!==g,E!==b,y!==_,w!==C,S!==T].some(Boolean)&&(L(!1),M&&localStorage.setItem("vidalytics_video_".concat(m,"_unmuted"),"true")))}),[p,m,x,v,E,y,w,S,P,M]);var K=j("top"),$=j("bottom");return f(cu,{in:P,timeout:300,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:A(md.wrapper,"bmpui-ui-vidalytics-unmute-overlay","bmpui-ui-vidalytics-unmute-box"),onClick:function(){p.muted(!1),V&&p.requestFullscreen(),B&&(p.currentTime(0),p.trigger("timeupdate")),dl(p.play()),R(!1),p.trigger("play:manual"),L(!1),M&&localStorage.setItem("vidalytics_video_".concat(m,"_unmuted"),"true")},children:["box"===o.type&&f(od,{title:K,subtitle:$}),"button"===o.type&&f(dd,{title:K}),"overlay"===o.type&&f(td,{title:K,subtitle:$})]})})};let gd,yd="key",_d=yd,Ed=!1,bd=!1,Sd=!1;const Ad=e=>{Ed=!0,yd="touch",window.clearTimeout(gd),gd=window.setTimeout((()=>{Ed=!1}),e)};let Td;const wd=()=>{bd=!0,yd="mouse",window.clearTimeout(Td),Td=window.setTimeout((()=>{bd=!1}),200)},Id=e=>()=>Ad(e),Cd=e=>t=>{switch(t.pointerType){case"mouse":wd();break;case"pen":case"touch":Ad(e)}},Rd=()=>{Ed||wd()},kd=()=>{yd="key"};let Pd;const Ld=e=>{e.target!==window&&e.target!==document||(Sd=!0,window.clearTimeout(Pd),Pd=window.setTimeout((()=>{Sd=!1}),300))},Od={capture:!0,passive:!0},Dd=[["touchstart",Id(750)],["touchend",Id(300)],["touchcancel",Id(300)],["pointerenter",Cd(300)],["pointerover",Cd(300)],["pointerout",Cd(300)],["pointerleave",Cd(300)],["pointerdown",Cd(750)],["pointerup",Cd(300)],["pointercancel",Cd(300)],["mouseenter",Rd],["mouseover",Rd],["mouseout",Rd],["mouseleave",Rd],["mousedown",Rd],["mouseup",Rd],["keydown",kd],["keyup",kd],["focus",()=>{(!Sd||bd||Ed)&&(_d=yd)}]];"undefined"!==typeof window&&"undefined"!==typeof document&&(Dd.forEach((([e,t])=>{document.addEventListener(e,t,Od)})),window.addEventListener("focus",Ld,Od));const xd=e=>{switch(e.pointerType){case"mouse":wd();break;case"pen":case"touch":Ed?yd="touch":Ad(300)}return/mouse/.test(e.type)&&!Ed&&wd(),/touch/.test(e.type)&&(Ed?yd="touch":Ad(300)),/focus/.test(e.type)?_d:yd};var Nd=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isDisabled,n=e.isStrict,r=e.ref,i=e.initialValue,a=void 0!==i&&i,o=e.hasOutsideTrigger,s=void 0===o?n:o,l=e.onChange,u=e.onMouseDown,d=e.onMouseUp,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],f=I((0,c.useState)(a),2),p=f[0],m=f[1],v=(0,c.useRef)(!1),g=(0,c.useRef)(null),y=null!==r&&void 0!==r?r:g,_=(0,c.useCallback)((function(e){m(e),null===l||void 0===l||l(e)}),[l]),E=(0,c.useCallback)((function(e){"mouse"===xd(e)&&(v.current||_(!0))}),[_]),b=(0,c.useCallback)((function(e){"mouse"===xd(e)&&(v.current||_(!1))}),[_]),S=(0,c.useCallback)((function(e){if(v.current){v.current=!1,document.removeEventListener("mouseup",S),document.removeEventListener("touchend",S);var t=!y.current.contains(e.target);s&&t&&_(!1),null===d||void 0===d||d()}}),[y,s,_,d]),A=(0,c.useCallback)((function(){v.current||(v.current=!0,document.addEventListener("touchend",S),document.addEventListener("mouseup",S),null===u||void 0===u||u())}),[S,u]);return(0,c.useEffect)((function(){if(!t){var e=y.current;if(e)return e.addEventListener("mouseenter",E),e.addEventListener("mouseleave",b),n&&(e.addEventListener("touchstart",A),e.addEventListener("mousedown",A)),function(){e.removeEventListener("mouseenter",E),e.removeEventListener("mouseleave",b),n&&(e.removeEventListener("touchstart",A),e.removeEventListener("mousedown",A))}}}),[y,t,n,E,b,A].concat(C(h))),[p,y,{isFingerDown:v}]},Md=n(6848),Fd={};Fd.setAttributes=Ul(),Fd.insert=Ml().bind(null,"head"),Fd.domAPI=xl(),Fd.insertStyleElement=Vl();Ol()(Md.A,Fd);var Ud=Md.A&&Md.A.locals?Md.A.locals:void 0;var Bd,Vd=function(e){var t=e.children,n=e.isActive,r=du(e,["children","isActive"]),i=qc(),a=(0,c.useRef)(null);return f("button",l(s({ref:a,type:"button",style:I(Nd({ref:a,isStrict:!0}),1)[0]||n?{backgroundColor:i.colors.primaryDark}:{},className:Ud.wrapper},r),{children:t}))};function Gd(){return Gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=t.frameLimit,r=void 0===n?60:n,i=t.isDisabled,a=1e3/r,o=(0,c.useRef)(),s=(0,c.useRef)(),l=(0,c.useRef)(),u=(0,c.useRef)(performance.now()),d=(0,c.useRef)();(0,c.useEffect)((function(){o.current=e}),[e]),(0,c.useEffect)((function(){if(!i)return function e(){var t;s.current=requestAnimationFrame(e),l.current=performance.now(),d.current=l.current-u.current,d.current>a&&(u.current=l.current-d.current%a,null===(t=o.current)||void 0===t||t.call(o))}(),function(){s.current&&cancelAnimationFrame(s.current)}}),[a,e,i])};function _h(e){return e<10?"0".concat(e):"".concat(e)}function Eh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;(Number.isNaN(e)||e<0)&&(e=0),(Number.isNaN(t)||t<0)&&(t=0);var n=[],r=Math.floor(e%60),i=Math.floor(e/60%60),a=Math.floor(e/3600),o=Math.floor(t/3600);return(a>0||o>0)&&n.push(_h(a)),n.push(_h(i)),n.push(_h(r)),n.join(":")}function bh(e,t){return Math.floor(e)===Math.floor(t)}function Sh(e,t){return e>=t&&e<=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0)}var Ah=n(244),Th={};Th.setAttributes=Ul(),Th.insert=Ml().bind(null,"head"),Th.domAPI=xl(),Th.insertStyleElement=Vl();Ol()(Ah.A,Th);var wh=Ah.A&&Ah.A.locals?Ah.A.locals:void 0;function Ih(e){var t=this,n=(0,c.useRef)(e);return(0,c.useLayoutEffect)((function(){n.current=e})),(0,c.useCallback)((function(){for(var e=arguments.length,r=new Array(e),i=0;i1?"-":"",l=Eh(a,r),c="".concat(o).concat(l),h=v.current!==p,f=!bh(r,y.current),m=!bh(t,g.current);g.current=t,y.current=r,v.current=p,(m||f||h)&&(n.current.innerText=c)}}),[i,s,u,d,p,_]);return yh(b,{frameLimit:15,isDisabled:!E}),(0,c.useLayoutEffect)((function(){if(!E)return a.subscribe((function(e){return e.seekTime}),b,{fireImmediately:t})}),[E,b,a,t]),(0,c.useEffect)((function(){if(!l&&!u)return o.subscribe((function(e){return e.duration}),(function(){return b()}))}),[l,u,b,o]),(0,c.useLayoutEffect)((function(){u||b()}),[b]),(0,c.useLayoutEffect)((function(){if(s&&!u)return i.on("timeupdate",e),function(){i.off("timeupdate",e)};function e(){b()}}),[b]),f("div",{className:wh.wrapper,onClick:function(){m((function(e){return v.current=e,!e}))},"data-vid-testid":"controls:time-display",children:f("span",{ref:n})})},kh=n(4355),Ph=n.n(kh);var Lh=function(e){if(Math.abs(e)<1){var t=e.toExponential().split("e-"),n=t[0].split(".")[1];return(n?n.length:0)+parseInt(t[1],10)}var r=e.toString().split(".")[1];return r?r.length:0};function Oh(e,t,n){return(e-t)*(arguments.length>3&&void 0!==arguments[3]?arguments[3]:100)/(n-t)}function Dh(e,t){if(void 0!==t.current&&e.changedTouches){for(var n=e,r=0;r2&&(T(!0),null===g||void 0===g||g(!0)),m&&n!==p&&m(n)}else L(e)})),D=Ih((function(e){if(!n&&void 0===E.current){Fh()||e.preventDefault(),null===y||void 0===y||y();var t=e.changedTouches[0];t&&(E.current=t.identifier);var r=Dh(e,E);if(!1!==r){var i=P(r);xh(b),m(i)}w.current=0,document.addEventListener("touchmove",O),document.addEventListener("touchend",L)}})),x=(0,c.useCallback)((function(){document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",L),document.removeEventListener("touchmove",O),document.removeEventListener("touchend",L)}),[L,O]);function N(e){if(!n&&!e.defaultPrevented&&0===e.button&&void 0===E.current&&"mouse"===xd(e)){e.preventDefault(),null===y||void 0===y||y();var t=Dh(e,E);if(!1!==t){var r=P(t);xh(b),m(r)}w.current=0,document.addEventListener("mousemove",O),document.addEventListener("mouseup",L)}}return(0,c.useEffect)((function(){var e=b.current,t={passive:Fh()};return e.addEventListener("touchstart",D,t),function(){e.removeEventListener("touchstart",D,t),x()}}),[x,D]),(0,c.useEffect)((function(){n&&x()}),[n,x]),{axis:R,axisProps:Mh,isDragging:A,getHiddenInputProps:function(){return{type:"range",tabIndex:f,name:s,min:o,max:i,step:h,value:C,disabled:n,onChange:k}},getRootProps:function(){return{ref:b,onMouseDown:N}},getTrackProps:function(){var e=Oh(C,o,i);return{style:Mh[R].leap(e)}},getThumbProps:function(){var e=Oh(C,o,i);return{style:Mh[R].offset(e)}},value:C}},Bh=n(7441),Vh={};Vh.setAttributes=Ul(),Vh.insert=Ml().bind(null,"head"),Vh.domAPI=xl(),Vh.insertStyleElement=Vl();Ol()(Bh.A,Vh);var Gh=Bh.A&&Bh.A.locals?Bh.A.locals:void 0,Hh=Ph()(0,.75,.75,1);var Yh=function(e){var t=e.hasEasing,n=e.isDisabled,r=Uu(),i=qc(),a=Hu(),u=Yu((function(e){return e.paused})),d=Yu((function(e){return e.ended})),h=Yu((function(e){return e.waiting})),p=Yu((function(e){return e.duration})),m=(0,c.useRef)(null),v=Qc((function(e){return e.isSeeking})),g=Qc((function(e){return e.seekTime})),y=Qc((function(e){return e.lastDuration})),_=Qc((function(e){return e.setIsSeeking})),E=Qc((function(e){return e.setSeekTime})),b=Qc((function(e){return e.setLastSeekTime})),S=I((0,c.useState)(0),2),T=S[0],w=S[1],C=(0,c.useRef)(0),R=!u&&!v&&!h,k=Uh({min:0,max:p||y,step:.1,value:g,disabled:n,onChange:function(e){r.currentTime(e),r.trigger("timeupdate"),E(e),b(e)},onTouchStart:function(){w(r.currentTime()),_(!0)},onTouchEnd:function(){return _(!1)},onChangeCommitted:function(e){r.currentTime()!==e&&r.currentTime(e),r.trigger("timeupdate"),r.trigger("seeked:internal",T),E(e),b(e)}}),P=k.getHiddenInputProps,L=k.getRootProps,O=k.getTrackProps,D=k.getThumbProps,x=k.isDragging,N=function(){if(m.current){var e=+(r.currentTime()/r.duration()*100).toFixed(2),n=e!==C.current;if(C.current=e,n&&!Number.isNaN(e)){var i=e;t&&(i=+(100*Hh(i/100)).toFixed(2)),m.current.style.width="".concat(i,"%")}}};yh(N,{isDisabled:!R}),(0,c.useEffect)((function(){if(u)return a.subscribe((function(e){return e.currentTime}),N)}),[u]),(0,c.useEffect)((function(){d&&m.current&&(m.current.style.width="100%")}),[d]);var M,F={backgroundColor:i.colors.primaryDark},U=A(Gh.slider,(o(M={},Gh.sliderDisabled,n),o(M,Gh.sliderDragging,x),M));return f("div",{className:Gh.wrapper,children:f("div",l(s({},L()),{className:U,children:[f("div",{className:Gh.rail,style:F}),f("div",{className:Gh.trackWrapper,children:f("div",l(s({},O()),{className:Gh.track,ref:m}))}),f("div",l(s({},D()),{className:Gh.thumb,children:f("input",l(s({},P()),{className:Gh.input}))}))]}))})},jh=n(441),Kh={};Kh.setAttributes=Ul(),Kh.insert=Ml().bind(null,"head"),Kh.domAPI=xl(),Kh.insertStyleElement=Vl();Ol()(jh.A,Kh);var $h=jh.A&&jh.A.locals?jh.A.locals:void 0;var qh=function(e){var t=qc(),n=Uh(e),r=n.getHiddenInputProps,i=n.getRootProps,a=n.getTrackProps,o=n.getThumbProps,u={backgroundColor:t.colors.primaryDark};return f("div",l(s({},i()),{className:$h.wrapper,children:[f("div",{className:$h.rail,style:u}),f("div",l(s({},a()),{className:$h.track})),f("div",l(s({},o()),{className:$h.thumb,children:f("input",l(s({},r()),{className:$h.input}))}))]}))},zh=n(234),Wh={};Wh.setAttributes=Ul(),Wh.insert=Ml().bind(null,"head"),Wh.domAPI=xl(),Wh.insertStyleElement=Vl();Ol()(zh.A,Wh);var Qh=zh.A&&zh.A.locals?zh.A.locals:void 0;function Xh(e){var t=e.volume,n=e.isMuted||0===t;return f("svg",{viewBox:"0 0 24 22",width:24,height:22,children:f("g",{fill:"none",fillRule:"evenodd",children:[f("path",{fill:"currentColor",d:"M12.59 2.87a.75.75 0 0 0-1.21-.59L5.6 6.77a.75.75 0 0 0-.26.1H1.68C.89 6.87.26 7.5.25 8.29v5.42c0 .37.14.74.42 1 .27.29.64.43 1 .43h3.81l5.9 4.58a.75.75 0 0 0 1.2-.59V2.87h.01Zm-7.6 5.5H1.75v5.27h3.24V8.37Zm1.5 5.65 4.6 3.58V4.4l-4.6 3.58v6.04Z"}),f("g",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",children:[(t>.66||n)&&f("path",{d:"M19.2 2.66c5.23 5.59 4.86 11.15.11 16.68"}),(t>.33||n)&&f("path",{d:"M16.92 5.33c3.73 4.25 3.25 7.96-.01 11.34"}),f("path",{d:"M14.4 7.97c2.01 1.85 2.2 3.85 0 6.06"}),n&&f("path",{d:"M21.9 1.1 2.1 20.9"})]})]})})}var Zh,Jh=function(){var e=Uu(),t=qc(),n=Qc((function(e){return e.isSeeking})),r=Qc((function(e){return e.setIsVolumeControlHovered})),i=Yu((function(e){return e.muted})),a=Yu((function(e){return e.volume})),o=I((0,c.useState)(!1),2),s=o[0],l=o[1],u=(0,c.useRef)(a),d=(0,c.useRef)(null),h=s||n||t.browser.isiOS,p=I(Nd({ref:d,isDisabled:h,isStrict:!0}),1)[0],m=i||0===a,v=(0,c.useCallback)((function(t){t&&e.volume(u.current)}),[e]);(0,c.useEffect)((function(){r(p)}),[p,r]),(0,c.useEffect)((function(){return e.on("unmute",v),function(){e.off("unmute",v)}}),[e,v]);var g={backgroundColor:t.colors.primaryTransparent};return f("div",{className:Qh.wrapper,ref:d,children:[f(cu,{in:p,timeout:250,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:Qh.popup,style:g,children:f(qh,{min:0,max:1,step:.01,orientation:"vertical",value:i?0:a,onChange:function(t){e.volume(t),i&&e.muted(!1)},onDrag:l})})}),f(Vd,{onClick:function(){m?(e.volume(u.current),e.muted(!1)):(u.current=a,e.volume(0),e.muted(!0))},"data-vid-testid":m?"controls:unmute":"controls:mute",children:f(Xh,{volume:a,isMuted:i})})]})};function ef(){return ef=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1],n=this.searchParams.get(e);if(!n)return null;var r=t?n.replace(/\+/g," "):n;return decodeURIComponent(r)}},{key:"setQueryParam",value:function(e,t){this.searchParams.set(e,t),this.replaceState()}},{key:"removeQueryParam",value:function(e){this.searchParams.delete(e),this.replaceState()}},{key:"appendUTMParams",value:function(e){var t=this,n=new URL(e),r=new URLSearchParams(n.search);return this.searchParams.forEach((function(e,n){n.startsWith(t.utmParamPrefix)&&!r.has(n)&&r.append(n,e)})),n.search=r.toString(),n.toString()}},{key:"replaceState",value:function(){var e=window.location,t=e.pathname,n=e.hash,r=this.searchParams.toString().length?"?".concat(this.searchParams):"";window.history.replaceState({},"","".concat(t).concat(r).concat(n))}}]),e}();function ff(e){return"true"===e||"false"===e}function pf(e,t){var n,r;if(e){if(t||(t=null===(n=window._vidalytics)||void 0===n?void 0:n.hostPrefix),!t)return e;var i=new URL(e),a=/^([a-z0-9-]+)(?!\.dev)\.vidalytics\.com$/i,o=a.test(i.hostname),s=null===(r=a.exec(i.hostname))||void 0===r?void 0:r[1];if(s&&function(e,t){return e.includes(t)||t.includes(e)}(s,t))return e;if(!o)return e;var l="".concat(t,".vidalytics.com");return i.hostname=l,i.toString()}}function mf(){return mf=Object.assign?Object.assign.bind():function(e){for(var t=1;tn?n:t}(e),n=10*Math.floor(t/10),r=!0,i=!1,a=void 0;try{for(var o,s=[144,240,360,480,720,1080,1440,2160][Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;if(n<=l)return"".concat(l,"p")}}catch(wg){i=!0,a=wg}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return""}function Ef(e){var t=e.onClick,n=e.isActive,r=e.onChange,i=du(e,["onClick","isActive","onChange"]),a=Uu(),o=Yu((function(e){return e.levels})),u=Qc((function(e){return e.currentBitrate})),d=Qc((function(e){return e.setCurrentBitrate}));var h=(0,c.useMemo)((function(){return function(e){var t=C(e.map((function(e){return{label:_f(e),value:e.bitrate}})).sort((function(e,t){return t.value-e.value}))),n=t.map((function(e){return e.label})),r=n.find((function(e,t){return n.indexOf(e)!==t})),i={label:yf,value:gf};if(!r)return[i].concat(C(t));var a=t.filter((function(e){return e.label===r})).map((function(e,t){var n=0===t?"hi-res":"low-res";return l(s({},e),{label:"".concat(e.label," (").concat(n,")")})})),o=t.map((function(e){var t=a.find((function(t){return t.value===e.value}));return t?l(s({},e),{label:t.label}):e})).sort((function(e,t){return t.value-e.value}));return[i].concat(C(o))}(o)}),[o]);return 1===h.length?null:f(uf,l(s({},i),{name:"Quality",items:h,value:u,onClick:t,onChange:function(e){if(a.hls){if(e===gf)d(gf),a.hls.nextLevel=-1;else{d(e);var t=o.findIndex((function(t){return t.bitrate===e}));a.hls.nextLevel=t}null===r||void 0===r||r(e)}},isActive:n,isItemActive:function(e){return e===u}}))}function bf(e){var t=e.onClick,n=e.isActive,r=e.onChange,i=du(e,["onClick","isActive","onChange"]),a=Uu(),o=Yu((function(e){return e.playbackRate})),u=Yu((function(e){return e.playbackRates})),d=(0,c.useMemo)((function(){return new hf}),[]);var h=(0,c.useMemo)((function(){return C(u.map((function(e){return{label:"".concat(e,"x"),value:e}})))}),[u]);function p(e){return e===o}return f(uf,l(s({},i),{name:"Speed",items:h,value:o,onClick:t,onChange:function(e){null===r||void 0===r||r(e),p(e)||(a.playbackRate(e),function(e,t){if(!d.getQueryParam(e))return;d.setQueryParam(e,"".concat(t,"x"))}("speed",e))},isActive:n,isItemActive:p}))}var Sf,Af=function(e){var t=e.isActive,n=e.hasSpeedOption,r=e.hasQualityOption,i=e.hasPopupOffset,a=qc(),s=(0,c.useRef)(null),l=I((0,c.useState)(),2),u=l[0],d=l[1],h=I((0,c.useState)(!1),2),p=h[0],m=h[1],v=Yu((function(e){return e.currentHeight})),g=Qc((function(e){return e.setIsActivityObserverDisabled})),y=Qc((function(e){return e.isVolumeControlHovered}));function _(e){return e===u}function E(e){_(e)?d(void 0):d(e)}function b(){g(!p),m((function(e){return!e}))}df(s,b,{isDisabled:!p}),(0,c.useEffect)((function(){y&&(g(!1),m(!1))}),[y,g]),(0,c.useEffect)((function(){!t&&p&&m(!1)}),[t,p]);var S=v-40,T={backgroundColor:a.colors.primaryTransparent,maxHeight:S},w=A(lf.popup,o({},lf.popupOffset,i));return f("div",{ref:s,className:lf.wrapper,children:[f(cu,{in:p,timeout:250,classNames:"fade",onExited:function(){d(void 0)},unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:w,style:T,children:[r&&f(Ef,{onClick:E,onChange:b,isActive:_}),n&&f(bf,{onClick:E,onChange:b,isActive:_})]})}),f(Vd,{onClick:b,"data-vid-testid":"controls:settings",children:f(vf,{width:18,height:18})})]})};function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t0,P=R||k,L=s.ui.controlBar.fullscreen.show,O="free"===s.subscription.plan.tier&&i.breakpoints.up("xsmall"),D=s.ui.controlBar.seekBar.show,x=s.ui.controlBar.seekBar.showToReturningViewers,N=s.ui.controlBar.smartSeekBar.show,M=(D||N||x)&&!(x&&p),F=s.ui.controlBar.rewind.show&&(i.breakpoints.up("xsmall")||i.breakpoints.only("tiny")&&!M),U=!N&&i.breakpoints.up("large"),B=Tl("localStorage"),V=[w,F,M,I,C,P,L,O].some(Boolean);(0,c.useEffect)((function(){E(V)}),[V,E]);var G=i.breakpoints.down("medium")?"small":"large",H=A(Of.wrapper,"bmpui-ui-controlbar",o({},Of.wrapperHidden,n)),Y={backgroundColor:i.colors.primaryTransparent,color:i.colors.secondary};return V?f("div",{ref:l,className:H,onClick:function(){!g&&"pristine"===v||S&&!g&&"pristine"!==v&&("fail"!==v||m)&&!u||("pristine"===v&&_(!0),a.muted(!1,"ui"),y(!1),B&&"muted"===v&&localStorage.setItem("vidalytics_video_".concat(h,"_unmuted"),"true"))},children:[f("div",{className:Of.block,style:Y,children:[w&&f(th,{isPauseDisabled:T}),F&&f(sh,{value:10})]}),M&&f("div",{className:A(Of.block,Of.blockStretched),style:Y,children:[U&&f(Rh,{fireImmediately:r}),f(Yh,{hasEasing:N,isDisabled:N})]}),f("div",{className:Of.block,style:Y,children:[I&&f(Jh,{}),C&&f(kf,{}),P&&f(Af,{isActive:!n,hasSpeedOption:R,hasQualityOption:k,hasPopupOffset:!L}),L&&f(jd,{}),O&&f(gh,{variant:G})]})]}):null},xf=n(2071),Nf={};Nf.setAttributes=Ul(),Nf.insert=Ml().bind(null,"head"),Nf.domAPI=xl(),Nf.insertStyleElement=Vl();Ol()(xf.A,Nf);var Mf=xf.A&&xf.A.locals?xf.A.locals:void 0;var Ff=function(e){var t=e.customerId,n=qc(),r="".concat(Zs).concat(t),i={color:n.colors.secondary};return f("a",{className:Mf.wrapper,style:i,href:r,target:"_blank",rel:"noopener noreferrer",draggable:!1,"data-vid-testid":"controls:watermark",children:f(hh,{width:26,height:20})})},Uf=n(1040);var Bf=function(e){var t=e.licenseKey,n=du(e,["licenseKey"]),r=Uu(),i=(0,c.useRef)();return(0,c.useEffect)((function(){if(!i.current){var e=s({key:t},n);if(r.hls){if("undefined"===typeof Uf.HlsAdapter)return;i.current=new Uf.HlsAdapter(e,r.hls)}else{if("undefined"===typeof Uf.HTMLVideoElementAdapter)return;i.current=new Uf.HTMLVideoElementAdapter(e,r.mediaElement)}}}),[]),null},Vf=n(7942),Gf=n.n(Vf);var Hf=function(e){var t=e.targetRef,n=e.timeout,r=void 0===n?3e3:n,i=e.initialValue,a=void 0!==i&&i,o=e.hasTimeout,s=void 0===o||o,l=e.hasInitialTimeout,u=e.isDisabled,d=e.onChange,h=e.onChangeDocument,f=(0,c.useRef)(a),p=(0,c.useRef)(),m=(0,c.useCallback)((function(){var e="visible"===document.visibilityState;null===h||void 0===h||h(e)}),[h]);(0,c.useEffect)((function(){return document.addEventListener("visibilitychange",m),function(){document.removeEventListener("visibilitychange",m)}}),[m]);var v=(0,c.useCallback)((function(e){f.current!==e&&(null===d||void 0===d||d(e)),f.current=e}),[d]),g=(0,c.useCallback)((function(){s&&p.current&&window.clearTimeout(p.current)}),[s]),y=(0,c.useCallback)((function(){v(!1),g()}),[v,g]),_=(0,c.useCallback)((function(){s&&(g(),p.current=window.setTimeout(y,r))}),[r,s,y,g]),E=(0,c.useCallback)((function(){_()}),[_]),b=(0,c.useCallback)((function(){g()}),[g]),S=I(Nd({ref:t,isDisabled:u,initialValue:a,isStrict:!0,hasOutsideTrigger:!1,onMouseDown:b,onMouseUp:E},[r,s]),3),A=S[0],T=S[2].isFingerDown,w=Ih((function(){v(!0),T.current||_()})),C=Gf()(w,100,{trailing:!1,leading:!0});return(0,c.useEffect)((function(){u&&!f.current&&v(!0)}),[u,v]),(0,c.useEffect)((function(){T.current||(u?g():(v(A),A||g()))}),[u,A,v,g,T]),(0,c.useEffect)((function(){if(!u){var e=t.current;if(e)return e.addEventListener("click",w),e.addEventListener("mousemove",n),l&&_(),function(){e.removeEventListener("click",w),e.removeEventListener("mousemove",n),l&&g()}}function n(e){"mouse"===xd(e)&&C()}}),[r,t,u,s,l,w,_,g,C]),null},Yf=n(8703),jf={};jf.setAttributes=Ul(),jf.insert=Ml().bind(null,"head"),jf.domAPI=xl(),jf.insertStyleElement=Vl();Ol()(Yf.A,jf);var Kf=Yf.A&&Yf.A.locals?Yf.A.locals:void 0;var $f=function(){var e=I(Yu((function(e){return e.aspectRatio})).split(":").map(Number),2),t=e[0],n=e[1],r=Math.round(n/t*1e4)/100;return f("div",{className:Kf.wrapper,style:{paddingTop:"".concat(r,"%")}})};var qf=function(){var e=(0,c.useRef)(!0);return e.current?(e.current=!1,!0):e.current};var zf=function(e){var t=e.isDocumentActive,n=e.shouldResume,r=Uu(),i=qf(),a=(0,c.useRef)(!1),o=Qc((function(e){return e.autoPlayStatus})),s=Yu((function(e){return e.ended})),l=Qc((function(e){return e.isPlayGateActive})),u=Qc((function(e){return e.setIsManuallyPaused}));return(0,c.useEffect)((function(){var e;if(!i&&((r.isTouched()||"success"===o)&&!s&&!l))if(n||(e="ui"),t){if(!a.current)return;n?(dl(r.play()),setTimeout((function(){return dl(r.play())}),100),u(!1),a.current=!1):(r.pause(e),setTimeout((function(){return r.pause(e)}),100),a.current=!0)}else{if(r.paused())return;r.pause(e),a.current=!0}}),[r,t,l,s,o]),null};var Wf=function(){var e=Uu(),t=Yu((function(e){return e.embedId}));return(0,c.useEffect)((function(){function n(){var e,n=(null===(e=window._vidalytics)||void 0===e?void 0:e.embeds)||{};for(var r in n)if(r!==t){var i=n[r].player;if(i){var a=i.playing(),o=i.muted();a&&!o&&i.pause()}}}return e.on("play:manual",n),function(){e.off("play:manual",n)}}),[e,t]),null},Qf=n(5707),Xf={};Xf.setAttributes=Ul(),Xf.insert=Ml().bind(null,"head"),Xf.domAPI=xl(),Xf.insertStyleElement=Vl();Ol()(Qf.A,Xf);var Zf=Qf.A&&Qf.A.locals?Qf.A.locals:void 0;var Jf=function(){var e=wu(),t=Uu(),n=Qc((function(e){return e.autoPlayStatus})),r=Yu((function(e){return e.hasTimeUpdate})),i=Yu((function(e){return e.ended})),a=Yu((function(e){return e.paused})),o=Qc((function(e){return e.isUserActive})),s=(0,c.useRef)(o),l=Qc((function(e){return e.setIsUserActive})),u=Qc((function(e){return e.setIsManuallyPaused}));(0,c.useEffect)((function(){s.current=o}),[o]);var d=e.playback.noPause;return f("div",{className:Zf.wrapper,onClick:function(){var e=t.muted();if(a)(i||"fail"===n&&!r)&&e&&t.muted(!1,"ui"),dl(t.play()),u(!1),t.trigger("play:manual");else{if(!s.current)return void l(!0);if(d)return;t.pause(),u(!0)}}})},ep=n(6380),tp={};tp.setAttributes=Ul(),tp.insert=Ml().bind(null,"head"),tp.domAPI=xl(),tp.insertStyleElement=Vl();Ol()(ep.A,tp);var np=ep.A&&ep.A.locals?ep.A.locals:void 0;var rp=function(e){var t,n,r,i,a,u,d=e.config,h=e.guid,p=e.triggerEntry,m=Uu(),v=wu(),g=(0,c.useRef)(null),y=Qc((function(e){return e.isUserActive})),_=Qc((function(e){return e.setIsUserActive})),E=Qc((function(e){return e.activeCueHeight})),b=I(Nd({isStrict:!0,ref:g}),1)[0],S=(0,c.useMemo)((function(){return new hf}),[]),T=v.ui.controlBar.alwaysShow,w="vidalytics_cta_clicked";(0,c.useEffect)((function(){"onTop"===d.displayMode&&b&&!y&&_(!0)}),[b,d,y,_]),(0,c.useEffect)((function(){if("customHTML"===d.displayMode&&d.htmlSelector&&d.htmlSelectorType){var e=cp(d.htmlSelector,d.htmlSelectorType),t=Array.from(document.querySelectorAll(e));return fp(t,!0),function(){fp(t,!1)}}}),[d]);var C=(0,c.useCallback)((function(){var e,t=s({guid:h},d);p&&Il(w,h)&&(t.triggerData=p.triggerData,wl(w,h)),m.trigger("cta:click",t,!!(null===(e=d.link)||void 0===e?void 0:e.blank))}),[m,d,h,p]);if((0,c.useEffect)((function(){return m.trigger("cta:show",s({guid:h},d)),function(){m.trigger("cta:hide",s({guid:h},d))}}),[m]),"customHTML"===d.displayMode)return null;var R,k="onTop"===d.displayMode&&!y&&!T,P={backgroundColor:b?null===(t=d.colorHover)||void 0===t?void 0:t.background:null===(n=d.color)||void 0===n?void 0:n.background,color:b?null===(r=d.colorHover)||void 0===r?void 0:r.foreground:null===(i=d.color)||void 0===i?void 0:i.foreground};if("onTop"===d.displayMode){var L=(k?30:50)+(E?E+5:0);P.transform="translate(-50%, calc(-100% - ".concat(L,"px))")}return f("a",l(s({className:A(np.button,"vidalytics-cta-button",(o(R={},np.onTop,"onTop"===d.displayMode),o(R,np.hasShadow,!!d.shadow),R)),ref:g,onClick:C,rel:"noopener noreferrer",style:P},{id:"vid_cta-".concat(h),href:(null===(a=d.link)||void 0===a?void 0:a.href)?S.appendUTMParams(d.link.href):void 0,target:(null===(u=d.link)||void 0===u?void 0:u.blank)?"_blank":void 0}),{children:d.title}))},ip=n(1808),ap={};ap.setAttributes=Ul(),ap.insert=Ml().bind(null,"head"),ap.domAPI=xl(),ap.insertStyleElement=Vl();Ol()(ip.A,ap);var op=ip.A&&ip.A.locals?ip.A.locals:void 0;var sp=function(e,t,n,r){return e?(0,c.createPortal)(t,n,r):t},lp={reserveSpace:0,expandContainer:0,onTop:1,customHTML:2},up={class:".",id:"#"};function cp(e,t){var n=up[t];return"".concat(n).concat(e)}var dp={display:"none",visibility:"hidden",opacity:"0"},hp={display:"block",visibility:"visible",opacity:"1"};function fp(e,t,n){var r=Object.entries(t?hp:dp);e.forEach((function(e){var i,a,o,s,l=getComputedStyle(e),u={display:l.display,visibility:l.visibility,opacity:l.opacity},c=null===(a=window._vidalytics)||void 0===a||null===(i=a.__ctaComputedStyles__)||void 0===i?void 0:i.get(e);n&&(r.every((function(e){var t=I(e,2),n=t[0],r=t[1];return u[n]!==r}))&&(null===(s=window._vidalytics)||void 0===s||null===(o=s.__ctaComputedStyles__)||void 0===o||o.set(e,u)));t&&c&&(r=Object.entries(c)),r.forEach((function(t){var n=I(t,2),r=n[0],i=n[1];e.style.setProperty(r,i,"important")}))}))}var pp={exit:0,time:1};var mp=function(e){var t=e.config,n=e.triggerEntry,r=Uu(),i=Hu(),a=Qc((function(e){return e.isManuallyPaused})),u=Yu((function(e){return e.rootEmbedElement})),d=Yu((function(e){return e.fullscreen})),h=Qc((function(e){return e.isFirstSession})),p=Qc((function(e){return e.isPlayGateActive})),m=I((0,c.useState)(0),2),v=m[0],g=m[1],y=(0,c.useRef)(0),_=I((0,c.useState)([]),2),E=_[0],b=_[1],S="vidalytics_cta_shown",T=Object.keys(t),w=(0,c.useMemo)((function(){return function(e){var t=Object.entries(e).map((function(e){var t=I(e,2),n=t[0];return l(s({},t[1]),{guid:n})})).sort((function(e,t){var n=pp[e.type],r=pp[t.type];return e.type!==t.type?n-r:e.time.from-t.time.from}));return t}(t)}),[t]);(0,c.useEffect)((function(){w.filter((function(e){return"customHTML"===e.displayMode})).forEach((function(e){if(e.htmlSelector&&e.htmlSelectorType){var t=cp(e.htmlSelector,e.htmlSelectorType);fp(Array.from(document.querySelectorAll(t)),!1,!0)}}))}),[w]),(0,c.useEffect)((function(){var e=!h&&w.some((function(e){return e.showToReturningViewers||e.showOnlyWhenTriggeredBefore})),t=w.reduce((function(t,n){if("customHTML"!==n.displayMode)return t;var r=n.showToReturningViewers||n.showOnlyWhenTriggeredBefore&&!Il(S,n.guid),i=Sh(v,n.time.from,n.time.to);if("exit"===n.type&&(a&&i||r&&!h))return t.push(n),t;if("time"===n.type){if(r&&!h)return t.push(n),t;if(i&&(!e||n.showOnlyWhenTriggeredBefore&&Il(S,n.guid)&&!h))return t.push(n),t}return t}),[]),n=w.reduce((function(t,n){if("customHTML"===n.displayMode)return t;if("time"===n.type&&"onTop"===n.displayMode&&p)return t;var r=lp[n.displayMode],i=t[r],o=n.showToReturningViewers||n.showOnlyWhenTriggeredBefore&&!Il(S,n.guid),s=Sh(v,n.time.from,n.time.to);if("exit"===n.type&&(a&&s||o&&!h)&&(!i||n.time.from>=i.time.from))return t[r]=n,t;if("time"===n.type){if("exit"===(null===i||void 0===i?void 0:i.type)&&(!i.showToReturningViewers||!i.showOnlyWhenTriggeredBefore||a))return t;if(o&&!h&&(!i||"exit"!==i.type&&v>=i.time.to))return t[r]=n,t;if(s&&(!e||n.showOnlyWhenTriggeredBefore&&Il(S,n.guid)&&!h)&&(!i||n.time.from>=i.time.from))return t[r]=n,t}return t}),{}),r=Object.values(n);b(C(r).concat(C(t)))}),[t,p,a,v,h,w]);var R=(0,c.useCallback)((function(e){var t=Math.floor(e),n=t!==y.current;y.current=t,n&&g(t)}),[g]);(0,c.useEffect)((function(){return i.subscribe((function(e){return e.currentTime}),R)}),[i,R]);var k=(0,c.useCallback)((function(e){var t=e.guid;Il(S,t)&&wl(S,t)}),[]);(0,c.useEffect)((function(){return r.on("cta:show",k),function(){r.off("cta:show",k)}}),[r,k]);var P,L=T.some((function(e){return"reserveSpace"===t[e].displayMode})),O=E.some((function(e){return"expandContainer"===e.displayMode})),D=A(op.wrapper,"vidalytics-cta-button-container",(o(P={},op.wrapperExpanded,L||O),o(P,op.wrapperFullscreen,d),P));return sp(!d,f("div",{className:D,children:E.map((function(e){return f(rp,{guid:e.guid,config:e,triggerEntry:n},e.guid)}))}),u)},vp=".".charCodeAt(0),gp=/\\(\\)?/g,yp=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),_p={},Ep=/[.[\]]+/,bp=function(e){if(null===e||void 0===e||!e.length)return[];if("string"!==typeof e)throw new Error("toPath() expects a string");return null==_p[e]&&(e.endsWith("[]")?_p[e]=e.split(Ep).filter(Boolean):_p[e]=function(e){var t=[];return e.charCodeAt(0)===vp&&t.push(""),e.replace(yp,(function(e,n,r,i){var a=e;r?a=i.replace(gp,"$1"):n&&(a=n.trim()),t.push(a)})),t}(e)),_p[e]},Sp=function(e,t){for(var n=bp(t),r=e,i=0;i=r.length)return i;var o=r[n];if(isNaN(o)){var s;if(void 0===t||null===t){var l,u=e(void 0,n+1,r,i,a);return void 0===u?void 0:((l={})[o]=u,l)}if(Array.isArray(t))throw new Error("Cannot set a non-numeric property on an array");var c=e(t[o],n+1,r,i,a);if(void 0===c){var d=Object.keys(t).length;if(void 0===t[o]&&0===d)return;return void 0!==t[o]&&d<=1?isNaN(r[n-1])||a?void 0:{}:(t[o],ql(t,[o].map(Ap)))}return $l({},t,((s={})[o]=c,s))}var h=Number(o);if(void 0===t||null===t){var f=e(void 0,n+1,r,i,a);if(void 0===f)return;var p=[];return p[h]=f,p}if(!Array.isArray(t))throw new Error("Cannot set a numeric property on an object");var m=e(t[h],n+1,r,i,a),v=[].concat(t);if(a&&void 0===m){if(v.splice(h,1),0===v.length)return}else v[h]=m;return v},wp=function(e,t,n,r){if(void 0===r&&(r=!1),void 0===e||null===e)throw new Error("Cannot call setIn() with "+String(e)+" state");if(void 0===t||null===t)throw new Error("Cannot call setIn() with "+String(t)+" key");return Tp(e,0,bp(t),n,r)},Ip="FINAL_FORM/form-error",Cp="FINAL_FORM/array-error";function Rp(e,t){var n=e.errors,r=e.initialValues,i=e.lastSubmittedValues,a=e.submitErrors,o=e.submitFailed,s=e.submitSucceeded,l=e.submitting,u=e.values,c=t.active,d=t.blur,h=t.change,f=t.data,p=t.focus,m=t.modified,v=t.modifiedSinceLastSubmit,g=t.name,y=t.touched,_=t.validating,E=t.visited,b=Sp(u,g),S=Sp(n,g);S&&S[Cp]&&(S=S[Cp]);var A=a&&Sp(a,g),T=r&&Sp(r,g),w=t.isEqual(T,b),I=!S&&!A;return{active:c,blur:d,change:h,data:f,dirty:!w,dirtySinceLastSubmit:!(!i||t.isEqual(Sp(i,g),b)),error:S,focus:p,initial:T,invalid:!I,length:Array.isArray(b)?b.length:void 0,modified:m,modifiedSinceLastSubmit:v,name:g,pristine:w,submitError:A,submitFailed:o,submitSucceeded:s,submitting:l,touched:y,valid:I,value:b,visited:E,validating:_}}var kp=["active","data","dirty","dirtySinceLastSubmit","error","initial","invalid","length","modified","modifiedSinceLastSubmit","pristine","submitError","submitFailed","submitSucceeded","submitting","touched","valid","value","visited","validating"],Pp=function(e,t){if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),a=0;a0,S=++p,A=Promise.all(_).then((f=S,function(e){return delete m[f],e}));b&&(m[S]=A);var T=function(e){var t=$l({},o?r.errors:{},v,e?g:r.asyncErrors),l=function(e){a.forEach((function(r){if(n[r]){var a=Sp(v,r),l=Sp(t,r),u=E(i[r]).length,c=y[r];e(r,u&&c||s&&a||(a||o?void 0:l))}}))};l((function(e,n){t=wp(t,e,n)||{}})),l((function(e,n){if(n&&n[Cp]){var r=Sp(t,e),i=[].concat(r);i[Cp]=n[Cp],t=wp(t,e,i)}})),Pp(r.errors,t)||(r.errors=t),e&&(r.asyncErrors=g),r.error=v[Ip]};if(b&&(u.formState.validating++,t()),T(!1),t(),b){var w=function(){u.formState.validating--,t(),0===u.formState.validating&&u.lastFormState.validating&&C()};A.then((function(){p>S||T(!0)})).then(w,w)}}else t()},S=function(e){if(!c){var t=u.fields,n=u.fieldSubscribers,r=u.formState,i=$l({},t),a=function(e){var t=i[e],a=Rp(r,t),o=t.lastFieldState;t.lastFieldState=a;var s=n[e];s&&Hp(s,a,o,Dp,void 0===o)};e?a(e):Object.keys(i).forEach(a)}},A=function(){Object.keys(u.fields).forEach((function(e){u.fields[e].touched=!0}))},T=function(){var e=u.fields,t=u.formState,n=u.lastFormState,r=$l({},e),i=Object.keys(r),a=!1,o=i.reduce((function(e,n){return!r[n].isEqual(Sp(t.values,n),Sp(t.initialValues||{},n))&&(a=!0,e[n]=!0),e}),{}),s=i.reduce((function(e,n){var i=t.lastSubmittedValues||{};return r[n].isEqual(Sp(t.values,n),Sp(i,n))||(e[n]=!0),e}),{});t.pristine=!a,t.dirtySinceLastSubmit=!(!t.lastSubmittedValues||!Object.values(s).some((function(e){return e}))),t.modifiedSinceLastSubmit=!(!t.lastSubmittedValues||!Object.keys(r).some((function(e){return r[e].modifiedSinceLastSubmit}))),t.valid=!t.error&&!t.submitError&&!Vp(t.errors)&&!(t.submitErrors&&Vp(t.submitErrors));var l=function(e){var t=e.active,n=e.dirtySinceLastSubmit,r=e.modifiedSinceLastSubmit,i=e.error,a=e.errors,o=e.initialValues,s=e.pristine,l=e.submitting,u=e.submitFailed,c=e.submitSucceeded,d=e.submitError,h=e.submitErrors,f=e.valid,p=e.validating,m=e.values;return{active:t,dirty:!s,dirtySinceLastSubmit:n,modifiedSinceLastSubmit:r,error:i,errors:a,hasSubmitErrors:!!(d||h&&Vp(h)),hasValidationErrors:!(!i&&!Vp(a)),invalid:!f,initialValues:o,pristine:s,submitting:l,submitFailed:u,submitSucceeded:c,submitError:d,submitErrors:h,valid:f,validating:p>0,values:m}}(t),c=i.reduce((function(e,t){return e.modified[t]=r[t].modified,e.touched[t]=r[t].touched,e.visited[t]=r[t].visited,e}),{modified:{},touched:{},visited:{}}),d=c.modified,h=c.touched,f=c.visited;return l.dirtyFields=n&&Pp(n.dirtyFields,o)?n.dirtyFields:o,l.dirtyFieldsSinceLastSubmit=n&&Pp(n.dirtyFieldsSinceLastSubmit,s)?n.dirtyFieldsSinceLastSubmit:s,l.modified=n&&Pp(n.modified,d)?n.modified:d,l.touched=n&&Pp(n.touched,h)?n.touched:h,l.visited=n&&Pp(n.visited,f)?n.visited:f,n&&Pp(n,l)?n:l},w=!1,I=!1,C=function e(){if(w)I=!0;else{if(w=!0,t&&t(T(),Object.keys(u.fields).reduce((function(e,t){return e[t]=u.fields[t],e}),{})),!c&&(!d||!f)){var n=u.lastFormState,r=T();r!==n&&(u.lastFormState=r,Hp(u.subscribers,r,n,Mp))}w=!1,I&&(I=!1,e())}},R=function(){return Object.keys(u.fields).forEach((function(e){return u.fields[e].modifiedSinceLastSubmit=!1}))};b(void 0,(function(){C()}));var k={batch:function(e){c++,e(),c--,S(),C()},blur:function(e){var t=u.fields,n=u.formState,r=t[e];r&&(delete n.active,t[e]=$l({},r,{active:!1,touched:!0}),l?b(e,(function(){S(),C()})):(S(),C()))},change:function(e,t){var n=u.fields,r=u.formState;if(Sp(r.values,e)!==t){v(u,e,(function(){return t}));var i=n[e];i&&(n[e]=$l({},i,{modified:!0,modifiedSinceLastSubmit:!!r.lastSubmittedValues})),l?(S(),C()):b(e,(function(){S(),C()}))}},get destroyOnUnregister(){return!!n},set destroyOnUnregister(e){n=e},focus:function(e){var t=u.fields[e];t&&!t.active&&(u.formState.active=e,t.active=!0,t.visited=!0,S(),C())},mutators:_,getFieldState:function(e){var t=u.fields[e];return t&&t.lastFieldState},getRegisteredFields:function(){return Object.keys(u.fields)},getState:function(){return T()},initialize:function(e){var t=u.fields,n=u.formState,i=$l({},t),a="function"===typeof e?e(n.values):e;r||(n.values=a);var o=r?Object.keys(i).reduce((function(e,t){return i[t].isEqual(Sp(n.values,t),Sp(n.initialValues||{},t))||(e[t]=Sp(n.values,t)),e}),{}):{};n.initialValues=a,n.values=a,Object.keys(o).forEach((function(e){n.values=wp(n.values,e,o[e])||{}})),b(void 0,(function(){S(),C()}))},isValidationPaused:function(){return d},pauseValidation:function(e){void 0===e&&(e=!0),d=!0,f=e},registerField:function(e,t,r,i){void 0===r&&(r={}),u.fieldSubscribers[e]||(u.fieldSubscribers[e]={index:0,entries:{}});var a=u.fieldSubscribers[e].index++;u.fieldSubscribers[e].entries[a]={subscriber:Fp(t),subscription:r,notified:!1};var o=u.fields[e]||{active:!1,afterSubmit:i&&i.afterSubmit,beforeSubmit:i&&i.beforeSubmit,data:i&&i.data||{},isEqual:i&&i.isEqual||Bp,lastFieldState:void 0,modified:!1,modifiedSinceLastSubmit:!1,name:e,touched:!1,valid:!0,validateFields:i&&i.validateFields,validators:{},validating:!1,visited:!1};o.blur=o.blur||function(){return k.blur(e)},o.change=o.change||function(t){return k.change(e,t)},o.focus=o.focus||function(){return k.focus(e)},u.fields[e]=o;var s=!1,l=i&&i.silent,c=function(){l&&u.fields[e]?S(e):(C(),S())};if(i){s=!(!i.getValidator||!i.getValidator()),i.getValidator&&(u.fields[e].validators[a]=i.getValidator);var d=void 0===Sp(u.formState.values,e);void 0===i.initialValue||!d&&Sp(u.formState.values,e)!==Sp(u.formState.initialValues,e)||(u.formState.initialValues=wp(u.formState.initialValues||{},e,i.initialValue),u.formState.values=wp(u.formState.values,e,i.initialValue),b(void 0,c)),void 0!==i.defaultValue&&void 0===i.initialValue&&void 0===Sp(u.formState.initialValues,e)&&d&&(u.formState.values=wp(u.formState.values,e,i.defaultValue))}return s?b(void 0,c):c(),function(){var t=!1;u.fields[e]&&(t=!(!u.fields[e].validators[a]||!u.fields[e].validators[a]()),delete u.fields[e].validators[a]);var r=!!u.fieldSubscribers[e];r&&delete u.fieldSubscribers[e].entries[a];var i=r&&!Object.keys(u.fieldSubscribers[e].entries).length;i&&(delete u.fieldSubscribers[e],delete u.fields[e],t&&(u.formState.errors=wp(u.formState.errors,e,void 0)||{}),n&&(u.formState.values=wp(u.formState.values,e,void 0,!0)||{})),l||(t?b(void 0,(function(){C(),S()})):i&&C())}},reset:function(e){void 0===e&&(e=u.formState.initialValues),u.formState.submitting&&(u.formState.resetWhileSubmitting=!0),u.formState.submitFailed=!1,u.formState.submitSucceeded=!1,delete u.formState.submitError,delete u.formState.submitErrors,delete u.formState.lastSubmittedValues,k.initialize(e||{})},resetFieldState:function(e){u.fields[e]=$l({},u.fields[e],{active:!1,lastFieldState:void 0,modified:!1,touched:!1,valid:!0,validating:!1,visited:!1}),b(void 0,(function(){S(),C()}))},restart:function(e){void 0===e&&(e=u.formState.initialValues),k.batch((function(){for(var t in u.fields)k.resetFieldState(t),u.fields[t]=$l({},u.fields[t],{active:!1,lastFieldState:void 0,modified:!1,modifiedSinceLastSubmit:!1,touched:!1,valid:!0,validating:!1,visited:!1});k.reset(e)}))},resumeValidation:function(){d=!1,f=!1,h&&b(void 0,(function(){S(),C()})),h=!1},setConfig:function(e,i){switch(e){case"debug":t=i;break;case"destroyOnUnregister":n=i;break;case"initialValues":k.initialize(i);break;case"keepDirtyOnReinitialize":r=i;break;case"mutators":a=i,i?(Object.keys(_).forEach((function(e){e in i||delete _[e]})),Object.keys(i).forEach((function(e){_[e]=y(e)}))):Object.keys(_).forEach((function(e){delete _[e]}));break;case"onSubmit":o=i;break;case"validate":s=i,b(void 0,(function(){S(),C()}));break;case"validateOnBlur":l=i;break;default:throw new Error("Unrecognised option "+e)}},submit:function(){var e=u.formState;if(!e.submitting){if(delete e.submitErrors,delete e.submitError,e.lastSubmittedValues=$l({},e.values),u.formState.error||Vp(u.formState.errors))return A(),R(),u.formState.submitFailed=!0,C(),void S();var t=Object.keys(m);if(t.length)Promise.all(t.map((function(e){return m[Number(e)]}))).then(k.submit,console.error);else if(!Object.keys(u.fields).some((function(e){return u.fields[e].beforeSubmit&&!1===u.fields[e].beforeSubmit()}))){var n,r=!1,i=function(t){e.submitting=!1;var i=e.resetWhileSubmitting;return i&&(e.resetWhileSubmitting=!1),t&&Vp(t)?(e.submitFailed=!0,e.submitSucceeded=!1,e.submitErrors=t,e.submitError=t[Ip],A()):(i||(e.submitFailed=!1,e.submitSucceeded=!0),Object.keys(u.fields).forEach((function(e){return u.fields[e].afterSubmit&&u.fields[e].afterSubmit()}))),C(),S(),r=!0,n&&n(t),t};e.submitting=!0,e.submitFailed=!1,e.submitSucceeded=!1,e.lastSubmittedValues=$l({},e.values),R();var a=o(e.values,k,i);if(!r){if(a&&Up(a))return C(),S(),a.then(i,(function(e){throw i(),e}));if(o.length>=3)return C(),S(),new Promise((function(e){n=e}));i(a)}}}},subscribe:function(e,t){if(!e)throw new Error("No callback given.");if(!t)throw new Error("No subscription provided. What values do you want to listen to?");var n=Fp(e),r=u.subscribers,i=r.index++;r.entries[i]={subscriber:n,subscription:t,notified:!1};var a=T();return Gp(n,t,a,a,Mp,!0),function(){delete r.entries[i]}}};return k}var jp=["render","children","component"];function Kp(e,t,n){var r=e.render,i=e.children,a=e.component,o=ql(e,jp);if(a)return c.createElement(a,Object.assign(t,o,{children:i,render:r}));if(r)return r(void 0===i?Object.assign(t,o):Object.assign(t,o,{children:i}));if("function"!==typeof i)throw new Error("Must specify either a render prop, a render function as children, or a component prop to "+n);return i(Object.assign(t,o))}function $p(e,t,n){void 0===n&&(n=function(e,t){return e===t});var r=c.default.useRef(e);c.default.useEffect((function(){n(e,r.current)||(t(),r.current=e)}))}var qp=function(e,t){if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),a=0;a component");return t}var im="undefined"!==typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product;function am(e){var t=c.useRef(e);return c.useEffect((function(){t.current=e})),c.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r component");return Kp($l({children:a,component:o,ref:t},S),A,"Field("+m+")")}));function pm(){return pm=Object.assign?Object.assign.bind():function(e){for(var t=1;t()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]+))$/.test(String(e).toLowerCase())}function Sm(e){return!/^([0-9]{1,2}|[+]?[0-9]{1,2}[-.\s]?)?[-.\s(]?[0-9]{3}[-.\s)]?[\s]?[0-9]{3}[-.\s]?[0-9]{2}[-.\s]?[0-9]{2}$/.test(String(e).toLowerCase())}function Am(){for(var e=arguments.length,t=new Array(e),n=0;n1&&k<1.35,D=L&&O,x=!L&&O,N=null===(n=d.button)||void 0===n||null===(t=n.color)||void 0===t?void 0:t.background,M=null===(r=d.color)||void 0===r?void 0:r.foreground;function F(){return P?.0799:x?.0625:L?.1425:.05625}function U(){return P?.008:x?.007:L?.0141:.0056}function B(){return P?.0486:D?.07:L?.11:.033}(0,c.useEffect)((function(){var e,t,n;"portrait"===R&&v>=g/k?(t=g,n=Math.round(y/_*1e4)/1e4,e=Math.floor(t*n*100)/100):(e=v,n=Math.round(_/y*1e4)/1e4,t=Math.floor(e*n*100)/100),S(e),C(t)}),[R,v,g,y,_,k]);var V,G={width:b,height:w},H={borderRadius:b*U(),height:b*F(),fontSize:b*(P?.0257:x?.02:L?.0453:.018)},Y={borderRadius:b*U(),height:b*F(),fontSize:b*(P?.0338:L?.0595:.023),backgroundColor:N,color:M},j=.05*b*.5,K=.05*b,$=b*(P?.025:x?.02:L?.035:.018),q={color:"#FFFFFF",fontSize:b*(P?.0306:L?.0387:.021)},z={width:b*B(),height:b*B()},W=null===(i=d.textTop)||void 0===i?void 0:i.text,Q=null===(a=d.textBottom)||void 0===a?void 0:a.text,X=null===(s=d.textSkip)||void 0===s?void 0:s.text,Z=null===(u=d.button)||void 0===u||null===(l=u.text)||void 0===l?void 0:l.text,J=!!d.skippable,ee=!!d.name.show,te=!!d.email.show,ne=!!d.phone.show;return f("div",{className:A(ym.wrapper,(o(V={},ym.wrapperPortrait,L&&!P),o(V,ym.wrapperSquare,P),o(V,ym.wrapperAspect4x3,x),o(V,ym.wrapperAspect3x4,D),V)),children:f("div",{style:G,children:f("div",{className:ym.wrapperOuter,children:[f("div",{className:ym.wrapperInner,children:[f(bu,{style:{color:"#FFFFFF"},minSize:j,maxSize:K,className:ym.title,wrapperClassName:ym.titleWrapper,value:W,multiLine:!0}),f(nm,{onSubmit:function(e){null===p||void 0===p||p(d,e)},children:function(e){var t=e.handleSubmit;return f("form",{className:ym.form,onSubmit:t,children:[ee&&f(fm,{name:"name",type:"text",style:H,placeholder:"Name",component:_m,validate:Am(Em)}),te&&f(fm,{name:"email",type:"text",style:H,placeholder:"Email",component:_m,validate:Am(Em,bm)}),ne&&f(fm,{name:"phone",type:"text",style:H,placeholder:"Phone",component:_m,validate:Am(Em,Sm)}),f("button",{type:"submit",className:ym.button,style:Y,children:Z})]})}}),f(bu,{minSize:$,maxSize:$,className:ym.note,wrapperClassName:ym.noteWrapper,value:Q,multiLine:!0})]}),J&&f("button",{type:"button",className:ym.skip,onClick:function(){null===h||void 0===h||h(d)},children:[f("div",{className:ym.skipTitle,style:q,children:X}),f(mm,{className:ym.skipIcon,style:z})]})]})})})},wm=(0,c.createContext)(new cs);function Im(e){var t=e.children,n=(0,c.useRef)();if(!n.current){var r,i=null===(r=window._vidalytics)||void 0===r?void 0:r.eventManager;i||(i=new cs,window._vidalytics||(window._vidalytics={}),window._vidalytics.eventManager=i),n.current=i}return f(wm.Provider,{value:n.current,children:t})}wm.Consumer;var Cm="vidalytics_playGates";var Rm=function(e){var t=e.config,n=e.isGlobal,r=void 0!==n&&n,i=Hu(),a=Uu(),o=(0,c.useContext)(wm),u=Yu((function(e){return e.ended})),h=Qc((function(e){return e.hasAutoPlayOverlay})),p=Qc((function(e){return e.isManuallyPaused})),m=Qc((function(e){return e.setIsPlayGateActive})),v=Qc((function(e){return e.setIsManuallyPaused})),g=Qc((function(e){return e.setHasThumbnail})),y=Qc((function(e){return e.setIsControlBarDisabled})),_=Qc((function(e){return e.setIsBigPlayButtonDisabled})),E=Qc((function(e){return e.isFirstSession})),b=I((0,c.useState)(0),2),S=b[0],A=b[1],T=(0,c.useRef)(0),w=I((0,c.useState)(),2),C=w[0],R=w[1],k=I((0,c.useState)(function(){var e=Tl("localStorage")?localStorage.getItem(Cm):null;if(!e)return!1;try{var t=JSON.parse(e);return!!Array.isArray(t)&&t.length>0}catch(n){return!1}}()),2),P=k[0],L=k[1],O=(0,c.useMemo)((function(){return function(e){var t=Object.entries(e),n={from:-1/0,to:1/0},r=t.map((function(e){var t=I(e,2),r=t[0],i=t[1];return"exit"===i.type?l(s({},i),{id:r,time:n}):l(s({},i),{id:r})})).sort((function(e,t){return e.time-t.time}));return r}(t)}),[t]),D=(r||function(){var e,t=null===(e=window._vidalytics)||void 0===e?void 0:e.embeds;if(!t)return!1;for(var n in t){var r,i,a=t[n];if(a&&(null===(i=a.options)||void 0===i||null===(r=i.globalSettings)||void 0===r?void 0:r.playGate))return!0}return!1}())&&P;(0,c.useEffect)((function(){function e(){L(!0)}return o.on("playgate:submit",e),function(){o.off("playgate:submit",e)}}),[o,r]),(0,c.useEffect)((function(){D&&(m(!1),g(!1),y(!1),_(!1))}),[D,g,_,y,m]),(0,c.useEffect)((function(){if(!(h||u||D)){var e=O.reduce((function(e,t){if("exit"===t.type&&p)return t;if("time"===t.type){var n=t.skippable?bh(S,t.time):Math.floor(S)>=t.time,r=e&&t.time=d[e].time&&!d[e].hasTriggered&&A(d[e])}),[d,r,o,g,A]);var T=(0,c.useCallback)((function(e,t){m((function(e){return s({},e,t)}))}),[]),w=(0,c.useCallback)((function(){r&&"pristine"===o||E.current||(i.muted()||(E.current=!0))}),[r,o,i]);(0,c.useEffect)((function(){return i.on("volumechange",w),i.on("playgate:submit",T),function(){i.off("volumechange",w),i.off("playgate:submit",T)}}),[i,w,T]);var R=(0,c.useCallback)((function(e){var t=!bh(e,_.current);_.current=e,t&&y(e)}),[y]);return(0,c.useEffect)((function(){return a.subscribe((function(e){return e.currentTime}),R)}),[a,R]),null};function Pm(e,t,n){var r,i=null===(r=window.Vidalytics)||void 0===r?void 0:r.Embed;i&&(new i).mount(e,t,n)}var Lm=function(){var e=wu(),t=Yu((function(e){return e.rootEmbedElement})),n=Yu((function(e){return e.embedId})),r=(0,c.useCallback)((function(r){if(r.persisted){var i,a,o=null===(a=window._vidalytics)||void 0===a||null===(i=a.embeds)||void 0===i?void 0:i[n].destroy;"function"===typeof o&&(o(),Pm(t,n,e))}}),[e,t,n]);return(0,c.useEffect)((function(){return window.addEventListener("pageshow",r),function(){window.removeEventListener("pageshow",r)}}),[r]),null};var Om=function(){var e=qc(),t=hd(e),n=Yu((function(e){return e.currentBreakpoint})),r=Yu((function(e){return e.fullscreen})),i=hd(r),a=hd(n),o=Yu((function(e){return e.rootEmbedElement}));return(0,c.useEffect)((function(){var s=e.media.orientation,l=null===t||void 0===t?void 0:t.media.orientation,u=e.colors.hasShadow,c=null===t||void 0===t?void 0:t.colors.hasShadow;if(r!==i&&"undefined"!==typeof i){var d=Hc("is-fullscreen"),h=Hc("is-fullscreen-fallback");r?(o.classList.add(d),"fallback"===r&&o.classList.add(h)):(o.classList.remove(d),o.classList.remove(h))}if(u!==c){var f=Hc("shadow"),p=Hc("no-shadow");u?(o.classList.remove(p),o.classList.add(f)):(o.classList.remove(f),o.classList.add(p))}if(l!==s){var m=Hc(s),v=Hc(l);v&&o.classList.remove(v),m&&o.classList.add(m)}if(n!==a){var g=Hc(n),y=Hc(a);a&&y&&o.classList.remove(y),g&&o.classList.add(g)}}),[n,o,e,r]),null},Dm=n(2649),xm={};xm.setAttributes=Ul(),xm.insert=Ml().bind(null,"head"),xm.domAPI=xl(),xm.insertStyleElement=Vl();Ol()(Dm.A,xm);var Nm=Dm.A&&Dm.A.locals?Dm.A.locals:void 0;var Mm=function(e){var t=e.size,n=void 0===t?44:t,r=e.thickness,i=void 0===r?4:r,a=e.delay,o=void 0===a?500:a,u=qc(),d=I((0,c.useState)(!1),2),h=d[0],p=d[1],m=Yu((function(e){return e.paused})),v=Yu((function(e){return e.waiting})),g=Yu((function(e){return e.isStarted}));(0,c.useEffect)((function(){if(!m&&v&&g){var e=window.setTimeout((function(){return p(!0)}),o);return function(){window.clearTimeout(e)}}p(!1)}),[m,v,g,o]);var y="".concat(n/2," ").concat(n/2," ").concat(n," ").concat(n),_={cx:n,cy:n,r:(n-i)/2,fill:"none",stroke:u.colors.primary,strokeLinecap:"round",strokeWidth:i};return f(cu,{in:h,timeout:100,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:Nm.wrapper,children:f("div",{className:Nm.progress,children:f("svg",{viewBox:y,className:Nm.circular,children:[f("circle",l(s({},_),{stroke:u.colors.secondary,strokeOpacity:.33})),f("circle",l(s({},_),{stroke:u.colors.primary,className:Nm.circle}))]})})})})},Fm=n(2786),Um={};Um.setAttributes=Ul(),Um.insert=Ml().bind(null,"head"),Um.domAPI=xl(),Um.insertStyleElement=Vl();Ol()(Fm.A,Um);var Bm=Fm.A&&Fm.A.locals?Fm.A.locals:void 0,Vm=[{title:"Powered by Vidalytics",href:function(e){return"https://vidalytics.com/powered-by?utm_source=Powered%20By&utm_medium=Player&utm_content=".concat(e.customerId,"&utm_term=").concat(e.videoId)}},{title:"Report an issue",href:function(e){return"https://vidalytics.com/contact?utm_source=Report%20an%20issue&utm_medium=Player&utm_content=".concat(e.customerId)}}];var Gm=function(e){var t=e.targetRef,n=wu(),r=Yu((function(e){return e.rootEmbedElement})),i=Qc((function(e){return e.setIsActivityObserverDisabled})),a=I((0,c.useState)(!1),2),s=a[0],l=a[1],u=(0,c.useRef)(null);function d(e,t){var n=u.current;n&&(n.style.top="".concat(t,"px"),n.style.left="".concat(e,"px"))}var h=(0,c.useCallback)((function(){d(-9999,-9999)}),[]),p=(0,c.useCallback)((function(){h(),l(!1),i(!1),s||document.removeEventListener("scroll",p)}),[s,i,h]);df(u,p,{isDisabled:!s}),(0,c.useEffect)((function(){var e=t.current;if(e)return e.addEventListener("contextmenu",n),function(){e.removeEventListener("contextmenu",n)};function n(e){e.preventDefault(),l(!0),i(!0),d(e.clientX,e.clientY),s||document.addEventListener("scroll",p)}}),[t,s,p,i,h]);var m=A(Bm.wrapper,o({},Bm.wrapperHidden,!s));return(0,c.createPortal)(f("div",{className:m,ref:u,children:Vm.map((function(e){return f("a",{target:"_blank",href:e.href(n.tracking),rel:"noreferrer",className:Bm.link,tabIndex:-1,onClick:p,children:e.title})}))}),r)};var Hm=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).isDisabled,r=(0,c.useRef)();(0,c.useEffect)((function(){r.current=e}),[e]),(0,c.useEffect)((function(){if(!n){var e=setInterval((function(){var e;null===(e=r.current)||void 0===e||e.call(r)}),t);return function(){clearInterval(e)}}}),[t,n])};var Ym=function(e){var t,n,r=e.config,i=e.hasAutoPlay,a=Uu(),o=Hu(),u=wu(),d=Yu((function(e){return e.levels})),h=Qc((function(e){return e.autoPlayStatus})),f=Qc((function(e){return e.hasLicenseError})),p=Yu((function(e){return e.embedId})),m=Yu((function(e){return e.paused})),v=Yu((function(e){return e.waiting})),g=Yu((function(e){return e.hasErrorFatal})),y=(0,c.useRef)(0),_=(0,c.useRef)(!1),E=(0,c.useRef)(!1),b=(0,c.useRef)(!1),S=(0,c.useRef)(!1),A=(0,c.useRef)(!1),T=(0,c.useRef)(),w=u.ui.overlay.interactiveVideos,I=(null===(t=window._vidalytics)||void 0===t?void 0:t.cdnProvider)||null,C=null===(n=window._vidalytics)||void 0===n?void 0:n.performanceData,R=p.replace("vidalytics_embed_","");if(!T.current){T.current=new kl(r,{onEnqueue:function(e){a.trigger(e.event,e)}},R)}var k=(0,c.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=T.current,o=s({},{event:e,videoTime:Math.floor(a.currentTime()),referer:document.referrer,site:window.location.href},t);if(n){if(!navigator.sendBeacon)return;var l=JSON.stringify(s({},i.getDefaultMessage(),o));navigator.sendBeacon("".concat(r.url,"/scribe"),l)}else i.enqueueMessage(o)}),[a,r]),P=(0,c.useCallback)((function(){if(!_.current){var e=u.playerVersion,t=u.transcoder,n=u.transcoderVersion,r=(u.bitmovin,u._forceResume,du(u,["bitmovin","_forceResume"])),i=l(s({referer:document.referrer,site:window.location.href,cdnProvider:I,dimensions:{viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen.width,height:window.screen.height}},performance:{performanceData:s({player:Xs,playerVersion:e,transcoder:t,transcoderVersion:n},C)}},!!w&&{funnelId:"".concat(w.funnelId)}),{videoSettings:r});k(Sl.INITIALIZED,i),_.current=!0}}),[u,I,C,w,k]),L=(0,c.useCallback)((function(){k(Sl.PLAYING)}),[k]),O=(0,c.useCallback)((function(){a.duration()-a.currentTime()>.1&&k(Sl.PAUSE)}),[a,k]),D=(0,c.useCallback)((function(){if(!f){var e={cdnProvider:I,isFirstPlay:!E.current};k(Sl.PLAY,e),E.current||(E.current=!0)}}),[I,f,k]),x=(0,c.useCallback)((function(){k(Sl.PLAYED)}),[k]),N=(0,c.useCallback)((function(){var e=a.isFullscreen();k(e?Sl.VIDEO_FULLSCREEN:Sl.VIDEO_FULLSCREEN_CLOSE)}),[a,k]),M=(0,c.useCallback)((function(){!i||i&&"muted"!==h||b.current||(a.muted()||(b.current=!0,k(Sl.UNMUTE)))}),[i,h,a,k]),F=(0,c.useCallback)((function(e){e=null!==e&&void 0!==e?e:a.prevTime();var t=a.currentTime(),n=e||y.current,r={videoTimeFrom:Math.floor(n)};bh(t,n)||k(Sl.SEEK_TO,r)}),[a,k]),U=(0,c.useCallback)((function(e){var t={playGateId:e};k(Sl.PLAY_GATE_SKIPPED,t)}),[k]),B=(0,c.useCallback)((function(e){var t={playGateId:e};k(Sl.PLAY_GATE_SHOW,t)}),[k]),V=(0,c.useCallback)((function(e,t){var n={playGateId:e,playGateData:t,data:t};k(Sl.PLAY_GATE,n)}),[k]),G=(0,c.useCallback)((function(e){k(Sl.TRIGGER,e)}),[k]),H=(0,c.useCallback)((function(e){k(Sl.CTA_DISPLAYED,{data:e})}),[k]),Y=(0,c.useCallback)((function(e,t){var n=e.guid,r=e.triggerData;k(Sl.CTA_CLICKED,{guid:n,triggerData:r},!t)}),[k]),j=(0,c.useCallback)((function(e){k(Sl.CTA_HIDDEN,{data:e})}),[k]),K=(0,c.useCallback)((function(e){k(Sl.FUNNEL_CHOICE_SELECTED,e)}),[k]),$=(0,c.useCallback)((function(){S.current||(k(Sl.RESTART,{cdnProvider:I}),S.current=!0)}),[I,k]),q=(0,c.useCallback)((function(){A.current||(k(Sl.RESUME,{cdnProvider:I}),A.current=!0)}),[I,k]),z=(0,c.useCallback)((function(e,t){var n=d[t.level];if(n){var r={resolution:{height:n.height,width:n.width}};k(Sl.RESOLUTION_CHANGED,r)}}),[k,d]),W=(0,c.useCallback)((function(e){var t,n,r="hls"===e.type?e.data.details:null===(t=e.data)||void 0===t?void 0:t.message,i="hls"===e.type?e.data.type:null===(n=e.data)||void 0===n?void 0:n.code;k(Sl.ERROR,{errorCategory:"hls"===e.type?e.data.type:null,errorType:"critical",errorCode:"".concat(i),errorMessage:r,referer:document.referrer,site:window.location.href,cdnProvider:I,performance:{performanceData:C}})}),[I,k,C]),Q=(0,c.useCallback)((function(){var e=0;return function(t){var n=a.seeking(),r=a.paused();n&&!r||(y.current=e,e=t)}}),[a]);return(0,c.useEffect)((function(){return o.subscribe((function(e){return e.currentTime}),Q())}),[o,Q]),Hm(L,5e3,{isDisabled:m||v||g}),(0,c.useEffect)((function(){var e;return P(),a.on("pause",O),a.on("play",D),a.on("fullscreenchange",N),a.on("volumechange",M),a.on("ended",x),a.on("error:fatal",W),a.on("seeked:internal",F),a.on("cta:click",Y),a.on("cta:show",H),a.on("cta:hide",j),a.on("restart",$),a.on("resume",q),a.on("playgate:submit",V),a.on("playgate:show",B),a.on("playgate:skip",U),a.on("trigger",G),a.on("funnel:choiceselected",K),null===(e=a.hls)||void 0===e||e.on(us.Events.LEVEL_SWITCHED,z),function(){var e;a.off("pause",O),a.off("play",D),a.off("fullscreenchange",N),a.off("volumechange",M),a.off("ended",x),a.off("error:fatal",W),a.off("seeked:internal",F),a.off("cta:click",Y),a.off("cta:show",H),a.off("cta:hide",j),a.off("restart",$),a.off("resume",q),a.off("playgate:submit",V),a.off("playgate:show",B),a.off("playgate:skip",U),a.off("trigger",G),a.off("funnel:choiceselected",K),null===(e=a.hls)||void 0===e||e.off(us.Events.LEVEL_SWITCHED,z)}}),[a,P,O,F,x,D,M,N,H,j,$,q,V,B,U,Y,W,G,K,z]),null};var jm=function(e,t,n){return Array.from({length:(t-e)/n+1},(function(t,r){return e+r*n}))},Km={sendPlay:"Play",sendPause:"Pause",sendPausePercentage:"Pause Percentage",sendRestart:"Restart",sendResume:"Resume",sendPlayGateSubmit:"Play Gate Submit"};var $m=function(e){var t=e.config,n=e.videoTitle,r=Uu(),i=Hu(),a=Yu((function(e){return e.duration})),o=I((0,c.useState)(0),2),u=o[0],d=o[1],h=(0,c.useRef)(0),f=(0,c.useRef)(!1),p=I((0,c.useState)(null),2),m=p[0],v=p[1],g=I((0,c.useState)(null),2),y=g[0],_=g[1],E=(0,c.useMemo)((function(){return["sendRestart","sendResume"]}),[]),b=Object.entries(t).map((function(e){var t=I(e,2),n=t[0];return l(s({},t[1]),{platform:n})})),S=(0,c.useCallback)((function(e){if(!(null===e||void 0===e?void 0:e.sendWatchedPercent))return null;var t;switch(e.sendWatchedPercent){case"everyPercent":t=jm(1,100,1);break;case"everyFivePercents":t=jm(5,100,5);break;case"basicPercents":t=[5,10,25,50,75,99]}return t.map((function(e){return{percent:e,second:Math.round(a*e/100)}}))}),[a]);(0,c.useEffect)((function(){if(a){var e=t.googleAnalytics,n=t.facebookPixel,r=S(e),i=S(n);v(r),_(i)}}),[a,t,S]);var A=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;switch(e){case"googleAnalytics":"undefined"!==typeof gtag?gtag("event",t,{event_category:"video",event_label:n,value:r}):"undefined"!==typeof window.dataLayer?window.dataLayer.push({event:t,videoTitle:n,value:r}):"undefined"!==typeof ga&&ga("send","event",{eventCategory:"video",eventAction:t,eventLabel:n,eventValue:r});break;case"facebookPixel":"undefined"!==typeof fbq&&fbq("trackCustom",t,{videoTitle:n,value:r})}},T=(0,c.useCallback)((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;b.forEach((function(r){(E.includes(e)&&r.sendResumePlay||r[e])&&A(r.platform,Km[e],t,n)}))}),[b,E]),w=(0,c.useCallback)((function(){if(m)for(var e=m.length-1;e>=0;e--)m[e].second<=u&&(A("googleAnalytics","".concat(m[e].percent,"% watched"),n),m.splice(e,1));if(y)for(var t=y.length-1;t>=0;t--)y[t].second<=u&&(A("facebookPixel","".concat(y[t].percent,"% watched"),n),y.splice(t,1))}),[m,y,n,u]),C=(0,c.useCallback)((function(){f.current||(f.current=!0,T("sendPlay",n))}),[T,n]),R=(0,c.useCallback)((function(){var e=Math.ceil(100*u/a);T("sendPause",n),T("sendPausePercentage",n,e)}),[T,n,u,a]),k=(0,c.useCallback)((function(){T("sendPlayGateSubmit",n)}),[T,n]),P=(0,c.useCallback)((function(){T("sendRestart",n),f.current||(f.current=!0)}),[T,n]),L=(0,c.useCallback)((function(){T("sendResume",n),f.current||(f.current=!0)}),[T,n]);(0,c.useEffect)((function(){(m||y)&&w()}),[m,y,u,w]);var O=(0,c.useCallback)((function(e){var t=!bh(e,h.current);h.current=e,t&&d(e)}),[d]);return(0,c.useEffect)((function(){return i.subscribe((function(e){return e.currentTime}),O)}),[i,O]),(0,c.useEffect)((function(){return r.on("play",C),r.on("pause",R),r.on("playgate:submit",k),r.on("restart",P),r.on("resume",L),function(){r.off("play",C),r.off("pause",R),r.off("playgate:submit",k),r.off("restart",P),r.off("resume",L)}}),[r,C,R,k,P,L]),null},qm=n(6862),zm={};zm.setAttributes=Ul(),zm.insert=Ml().bind(null,"head"),zm.domAPI=xl(),zm.insertStyleElement=Vl();Ol()(qm.A,zm);var Wm=qm.A&&qm.A.locals?qm.A.locals:void 0;var Qm=function(e){var t=e.source,n=e.isVisible,r=e.disableTransition,i=f("div",{className:A(Wm.wrapper,"vidalytics-placeholder-image"),children:f("img",{className:Wm.image,src:t,alt:""})});return r?n?i:null:f(cu,{in:!!n,timeout:100,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:i})},Xm=n(6167),Zm={};Zm.setAttributes=Ul(),Zm.insert=Ml().bind(null,"head"),Zm.domAPI=xl(),Zm.insertStyleElement=Vl();Ol()(Xm.A,Zm);var Jm=Xm.A&&Xm.A.locals?Xm.A.locals:void 0;var ev=function(e){var n=e.config,r=e.isStretched,i=(0,c.useRef)(null),a=I((0,c.useState)(),2),s=a[0],l=a[1],d=I((0,c.useState)(!0),2),h=d[0],p=d[1],m=!1===s,v=!!n.webm||!!n.mp4,g=!!n.source&&(!v||!s);(0,c.useLayoutEffect)((function(){if(v){var e=setTimeout((function(){return p(!1)}),150);return function(){return clearTimeout(e)}}}),[v]),(0,c.useLayoutEffect)((function(){function e(){return(e=t((function(){var e,t;return u(this,(function(n){switch(n.label){case 0:if(!(e=i.current))return[2];if(void 0!==s)return[2];if(e.muted=!0,!cl(t=e.play()))return[2,l(!0)];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t];case 2:return n.sent(),l(!0),[3,4];case 3:return n.sent(),l(!1),[3,4];case 4:return[2]}}))}))).apply(this,arguments)}v&&function(){e.apply(this,arguments)}()}),[s,v]);var y,_,E={backgroundImage:"url(".concat(pf(n.source),")")},b=A(Jm.poster,(o(y={},Jm.posterHidden,v&&!1!==s&&h),o(y,Jm.posterStretched,!!r),y)),S=A(Jm.video,(o(_={},Jm.videoHidden,void 0===s),o(_,Jm.videoStretched,!!r),_));return f("div",{className:Jm.wrapper,children:[v&&!m&&f("video",{ref:i,className:S,preload:"auto",playsInline:!0,muted:!0,loop:!0,children:[!!n.webm&&f("source",{src:pf(n.webm),type:"video/webm"}),!!n.mp4&&f("source",{src:pf(n.mp4),type:"video/mp4"})]}),g&&f("div",{className:b,style:E})]})};function tv(e){return new Promise((function(t,n){var r=new Image;r.onload=t,r.onerror=n,r.src=e}))}var nv=function(e){var n=e.config,r=e.mobileConfig,i=e.exitConfig,a=e.isStretched,o=void 0!==a&&a,s=e.hasEndedEvent,l=void 0!==s&&s,d=Uu(),h=qc(),p=Hu(),m=qf(),v=Yu((function(e){return e.paused})),g=Yu((function(e){return e.ended})),y=Yu((function(e){return e.isTouched})),_=Qc((function(e){return e.isManuallyPaused})),E=Qc((function(e){return e.hasThumbnail})),b=Qc((function(e){return e.setIsThumbnailVisible})),S=Qc((function(e){return e.setIsBigPlayButtonDisabled})),A=Qc((function(e){return e.setIsManuallyPaused})),T=l&&g,w=_&&!!i,C=h.browser.isPlatformMobileLike?r:n,R=I((0,c.useState)(C),2),k=R[0],P=R[1],L=I((0,c.useState)(!1),2),O=L[0],D=L[1];(0,c.useEffect)((function(){T&&P(C)}),[C,T]),(0,c.useEffect)((function(){function e(){return(e=t((function(){return u(this,(function(e){switch(e.label){case 0:return i?[4,tv(pf(i.source))]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[i]),(0,c.useEffect)((function(){m||w&&_&&P(i)}),[i,_,w]);var x=v&&!_&&O&&!y||w||T||E,N=(0,c.useCallback)((function(e){var t=I(e,2),n=t[0],r=t[1];D(r-n>.5)}),[]);return(0,c.useEffect)((function(){return p.subscribe((function(e){return[e.currentTime,e.duration]}),N)}),[p,N]),(0,c.useEffect)((function(){b(x)}),[x,b]),(0,c.useEffect)((function(){if(w)return S(!0),function(){return S(!1)}}),[w,x,S]),(0,c.useEffect)((function(){function e(){A(!0)}return d.on("pause:manual",e),function(){return d.off("pause:manual",e)}}),[d,A]),k?f(cu,{in:x,timeout:300,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f(ev,{config:k,isStretched:o})}):null},rv=n(3364),iv={};iv.setAttributes=Ul(),iv.insert=Ml().bind(null,"head"),iv.domAPI=xl(),iv.insertStyleElement=Vl();Ol()(rv.A,iv);var av=rv.A&&rv.A.locals?rv.A.locals:void 0;var ov=function(){var e,t,n,r,i,a,o=qc(),s=wu(),l=Yu((function(e){return e.ended})),u=Yu((function(e){return e.currentWidth})),d=I((0,c.useState)(!1),2),h=d[0],p=d[1],m=I((0,c.useState)(0),2),v=m[0],g=m[1],y=Qc((function(e){return e.setIsBigPlayButtonDisabled})),_=(0,c.useMemo)((function(){return new hf}),[]),E=null===(e=s.ui.overlay.redirect)||void 0===e?void 0:e.timeout,b=(null===(t=s.ui.overlay.redirect)||void 0===t?void 0:t.text)||"",S=null===(n=s.ui.overlay.redirect)||void 0===n?void 0:n.url,A=!!(null===(r=s.ui.overlay.redirect)||void 0===r?void 0:r.show),T=null===(i=o.colors.redirect)||void 0===i?void 0:i.primary,w=null===(a=o.colors.redirect)||void 0===a?void 0:a.secondary,C=(0,c.useCallback)((function(){S&&(window.location.href=_.appendUTMParams(S))}),[S,_]);(0,c.useEffect)((function(){l?(p(!0),y(!0),E>0?g(E):C()):p(!1)}),[y,E,l,C]),(0,c.useEffect)((function(){h&&(v>0||(p(!1),C()))}),[h,v,C]),Hm((function(){g((function(e){return e-1}))}),1e3,{isDisabled:!h});var R=function(e,t){return e.replace(/%d/gi,"
".concat(t,"
"))}(b,v),k=.065*u,P=l&&A&&E>0,L={textShadow:"".concat(T," 2px 2px 2px"),color:w};return f(cu,{in:P,timeout:250,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:av.wrapper,children:f(bu,{maxSize:k,style:L,wrapperClassName:av.article,value:R,multiLine:!0})})})};var sv=function(){var e=Uu(),t=Yu((function(e){return e.isStarted})),n=Qc((function(e){return e.setSeekTime})),r=Qc((function(e){return e.setLastSeekTime})),i=Qc((function(e){return e.setIsSeeking})),a=(0,c.useMemo)((function(){return new hf}),[]);return(0,c.useEffect)((function(){var t=a.getQueryParam("speed");if(t){if(/^(0|[1-9]+)(?:.[0-9]+)?x$/.test(t)){var n=+t.replace("x","");Js.includes(n)?e.playbackRate(n):a.removeQueryParam("speed")}else a.removeQueryParam("speed")}}),[e,a]),(0,c.useEffect)((function(){if(t){var o=a.getQueryParam("fromTime");if(o)if(/^([1-9]\d*)$/.test(o)){var s=e.duration(),l=+o0),2),R=C[0],k=C[1],P=p.tracking.enabled,L=p.playback.resume,O=!!(null===(t=p.ui.overlay.resume)||void 0===t?void 0:t.show)&&d,D=null===(n=p.ui.overlay.resume)||void 0===n?void 0:n.text,x=null===(i=p.ui.overlay.resume)||void 0===i||null===(r=i.button)||void 0===r?void 0:r.resume.text,N=null===(s=p.ui.overlay.resume)||void 0===s||null===(a=s.button)||void 0===a?void 0:a.replay.text,M=p.tracking.videoId,F=m.colors.resume.primary,U=m.colors.resume.secondary,B="portrait"===m.media.orientation&&1!==m.media.aspectRatio;(0,c.useEffect)((function(){L&&d&&O&&(R?(h.pause(),T(!0),w(!0)):(T(!1),w(!1)))}),[h,O,R,L,d,w,T]),(0,c.useEffect)((function(){if(P&&L&&!E)try{var e="vidalytics_video_".concat(M,"_time"),t=Number(localStorage.getItem(e)),n="vidalytics_video_".concat(M,"_duration"),r=Math.floor(v);r>0&&r!==t&&(bh(r,y)&&(r=0),localStorage.setItem(e,String(r)),localStorage.setItem(n,String(y)))}catch(i){console.error(i)}}),[P,v,E,L,M,y]);var V=(0,c.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="vidalytics_video_".concat(M,"_time"),n=Number(localStorage.getItem(t));h.currentTime(n),h.trigger("timeupdate"),h.once("timeupdate",(function(){return S(!1)})),e&&(h.trigger("resume"),h.muted(!1),dl(h.play()),h.trigger("play:manual")),k(!1)}),[h,S,M]);(0,c.useEffect)((function(){_&&L&&d&&(O||V(!1))}),[L,d,O,V,_]);var G=.1*g,H=g*((B?.134:.1)/2),Y=!b&&O&&R,j=A(hv.wrapper,o({},hv.wrapperPortrait,B)),K={textShadow:"".concat(m.colors.resume.primary," 2px 2px 2px"),color:m.colors.resume.secondary};return f(cu,{in:Y,timeout:250,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:j,children:[f(bu,{style:K,className:hv.title,maxSize:G,wrapperClassName:hv.article,value:D}),f("div",{className:hv.controls,children:[f("button",{type:"button",className:hv.button,onClick:function(){return V()},children:[f(fv,{className:hv.buttonIcon,primaryColor:F,secondaryColor:U}),f("div",{className:hv.buttonTitle,children:f("div",{className:hv.buttonArticle,children:f(bu,{style:K,maxSize:H,className:hv.buttonText,value:x})})})]}),f("button",{type:"button",className:hv.button,onClick:function(){return S(!1),h.currentTime(0),h.trigger("timeupdate"),h.muted(!1),h.trigger("restart"),dl(h.play()),h.trigger("play:manual"),void k(!1)},children:[f(pv,{className:hv.buttonIcon,primaryColor:F,secondaryColor:U}),f("div",{className:hv.buttonTitle,children:f("div",{className:hv.buttonArticle,children:f(bu,{style:K,maxSize:H,className:hv.buttonText,value:N})})})]})]})]})})};function gv(){return gv=Object.assign?Object.assign.bind():function(e){for(var t=1;tVc.tiny&&l<=Vc.small:t=10,e=16;break;case l>Vc.small&&l<=Vc.medium:t=12,e=18;break;case l>Vc.medium&&l<=Vc.large:t=16,e=26;break;case l>Vc.large&&l<=Vc.xlarge:t=22,e=36;break;case l>Vc.xlarge&&l<=Vc.xxlarge:t=28,e=48;break;default:t=34,e=60}m(t),y(e)}),[l]);var _={backgroundColor:Pc(.2,d?a:i),color:d?s:o};return f("div",{className:wv.funnelOption,style:_,ref:u,onClick:n,children:f("div",{className:wv.funnelOptionInner,children:f(bu,{value:r,minSize:p,maxSize:g,multiLine:!0})})})},Cv=n(5358),Rv={};Rv.setAttributes=Ul(),Rv.insert=Ml().bind(null,"head"),Rv.domAPI=xl(),Rv.insertStyleElement=Vl();Ol()(Cv.A,Rv);var kv=Cv.A&&Cv.A.locals?Cv.A.locals:void 0;var Pv=function(e){var t=e.config,n=e.handleClick,r=t.positionX,i=t.positionY,a=t.width,o=t.height,u=t.borderRadius,d=t.buttonColor,h=t.buttonHover,p=(0,c.useRef)(null),m=I(Nd({ref:p,isStrict:!0}),1)[0],v=l(s({},d?{backgroundColor:Pc(.8,d)}:{backgroundColor:"transparent"},m&&(h?{backgroundColor:Pc(.8,h)}:{backgroundColor:"transparent"})),{borderRadius:"".concat(u,"px"),width:"".concat(a,"%"),height:"".concat(o,"%"),left:"".concat(r,"%"),top:"".concat(i,"%")});return f("div",{className:kv.funnelClickableArea,style:v,ref:p,onClick:n})},Lv=n(5469),Ov={};Ov.setAttributes=Ul(),Ov.insert=Ml().bind(null,"head"),Ov.domAPI=xl(),Ov.insertStyleElement=Vl();Ol()(Lv.A,Ov);var Dv=Lv.A&&Lv.A.locals?Lv.A.locals:void 0;var xv=function(e){var t,n=e.timerType,r=e.countdownLabel,i=e.autoplayTime,a=A(Dv.countdownTimer,(o(t={},Dv.countdownTimerProgressBar,"progressBar"===n),o(t,Dv.countdownTimerSeconds,"seconds"===n),o(t,Dv.countdownTimerClock,"clock"===n),t)),u={animationDuration:"".concat(i,"s")};return"none"===n?null:f("div",l(s({className:a},"progressBar"===n&&{style:u}),{children:["seconds"===n&&f("span",{children:r}),"clock"===n&&f("svg",{width:"100%",height:"100%",viewBox:"0 0 50 50",children:f("circle",{r:"12.5",cx:"25",cy:"25",style:u})})]}))},Nv=n(5786),Mv={};Mv.setAttributes=Ul(),Mv.insert=Ml().bind(null,"head"),Mv.domAPI=xl(),Mv.insertStyleElement=Vl();Ol()(Nv.A,Mv);var Fv=Nv.A&&Nv.A.locals?Nv.A.locals:void 0;var Uv,Bv=function(e){var t=e.config,n=e.handleClick,r=e.icon,i=t.text,a={color:t.color};return f("div",{className:Fv.funnelReplayButton,style:a,onClick:n,children:[r,f("div",{className:Fv.funnelReplayButtonText,children:i})]})};function Vv(){return Vv=Object.assign?Object.assign.bind():function(e){for(var t=1;t=G&&!j&&!_e&&He(),se.current&&"time"===Ae){var e=E.branch,t=e.timeFrom,n=e.timeTo;n&&re>=t&&re<=n||!n&&re>=t?Ye():je()}}),[E,T,re,O,Re,b,C,Le,Te,we,_e,G,j,He,Ae,Ye,je]);var qe=(0,c.useCallback)((function(e){var t=!bh(e,ae.current);ae.current=e,t&&ie(e)}),[ie]);(0,c.useEffect)((function(){return w.subscribe((function(e){return e.currentTime}),qe)}),[w,qe]),(0,c.useEffect)((function(){xe&&Ye()}),[xe,Ye]),(0,c.useEffect)((function(){return T.on("play",$e),T.on("volumechange",Ke),function(){T.off("play",$e),T.off("volumechange",Ke)}}),[T,$e,Ke]);var ze,We=(0,c.useCallback)((function(e,t,n,r,i){var a={funnelId:e,embedId:t,choiceText:n,autoSelected:r,triggerId:i.guid,triggerData:i.triggerData};wl(B,t),T.trigger("funnel:choiceselected",a)}),[T]),Qe=(0,c.useCallback)((function(e){var t,n,r,i,a,o,l,u,c,d,h,f,p,m,v,g=e.nextEmbedKey,y=e.option,_=e.autoSelected,E=void 0!==_&&_,b=e.shouldBeLogged,A=void 0===b||b,T=e.direction,w=void 0===T?"forward":T;if(!_e&&g){var C=M.replace("vidalytics_embed_",""),R="vidalytics_embed_".concat(g),k=q.find((function(e){return e.init.elementId.includes(R)}));if(k){var P,L;if(null===(n=window._vidalytics)||void 0===n||null===(t=n.funnels)||void 0===t?void 0:t[Se])if("forward"===w)if(null===(P=k.ui.overlay.interactiveVideos)||void 0===P?void 0:P.isRoot)window._vidalytics.funnels[Se].navigationStack=[];else null===(L=window._vidalytics.funnels[Se].navigationStack)||void 0===L||L.push(C);else if("goBack"===w){var O;null===(O=window._vidalytics.funnels[Se].navigationStack)||void 0===O||O.pop()}else window._vidalytics.funnels[Se].navigationStack=[];var D=null===(o=window._vidalytics)||void 0===o||null===(a=o.embeds)||void 0===a||null===(i=a[M])||void 0===i||null===(r=i.options)||void 0===r?void 0:r.ui;if(Ee&&(null===(u=window._vidalytics)||void 0===u||null===(l=u.funnels)||void 0===l?void 0:l[Se])&&D&&(window._vidalytics.funnels[Se].stylesToInherit=Object.fromEntries(Object.entries(D).filter((function(e){var t=I(e,2),n=t[0];t[1];return be.includes(n)})))),(null===(h=window._vidalytics)||void 0===h||null===(d=h.funnels)||void 0===d||null===(c=d[Se])||void 0===c?void 0:c.stylesToInherit)&&!(null===(p=k.ui.overlay.interactiveVideos)||void 0===p||null===(f=p.branch)||void 0===f?void 0:f.inheritStyles)){var N=s({},k.ui,window._vidalytics.funnels[Se].stylesToInherit);k.ui=N}var F=s({},k.playback.autoplay,el);k.playback.autoplay=F;var U=null===(v=window._vidalytics)||void 0===v||null===(m=v.embeds)||void 0===m?void 0:m[M].destroy;A&&S&&Il(B,g)&&We("".concat(Se),g,null===y||void 0===y?void 0:y.buttonText,E,S),k&&"function"===typeof U&&(!function(e,t){var n,r=null===(n=window.VidalyticsL)||void 0===n?void 0:n.Loader;r&&r.setSettings(e,t)}(R,k),U(),Pm(x,R,k))}}}),[_e,M,Se,Ee,be,x,q,We,S]);(0,c.useEffect)((function(){ue&&(me>0||(ce(!1),setTimeout((function(){Qe({nextEmbedKey:Fe,option:De[Fe],autoSelected:!0})}),0)))}),[ue,me,Qe,De,Fe]),Hm((function(){ve((function(e){return e-1}))}),1e3,{isDisabled:!ue});var Xe=A(qv.wrapper,(o(ze={},qv.hasBackground,E.enableBackground),o(ze,qv.wrapperLandscape,"landscape"===U.media.orientation),o(ze,qv.wrapperPortrait,"portrait"===U.media.orientation&&1!==U.media.aspectRatio),o(ze,qv.wrapperSquare,1===U.media.aspectRatio),ze)),Ze=A(qv.funnelOptionGroup,o({},qv["has".concat(te,"Options")],te)),Je=Te?{color:E.goBack.button.color}:{},et=we?{color:E.startOver.button.color}:{};return f(cu,{in:J,timeout:250,classNames:"fade",unmountOnExit:!0,mountOnEnter:!0,children:f("div",{className:Xe,children:f(d.FK,{children:[Le&&f(d.FK,{children:f(d.FK,"buttons"===Oe?{children:[(null===(_=E.branch)||void 0===_?void 0:_.headline)&&f("div",{className:qv.funnelHeadline,children:E.branch.headline}),Q.length&&f("div",{className:Ze,children:Q.map((function(e){var t=I(e,2),n=t[0],r=t[1];return f(Iv,{config:r,handleClick:function(){return Qe({nextEmbedKey:n,option:r})}},n)}))})]}:{children:Q.length&&Q.map((function(e){var t=I(e,2),n=t[0],r=t[1];return f(Pv,{config:r,handleClick:function(){return Qe({nextEmbedKey:n,option:r})}},n)}))})}),ue&&Fe&&!Ve&&f(xv,{timerType:Be,countdownLabel:Eh(me),autoplayTime:he}),(Ne||Me)&&f("div",{className:qv.funnelReplayButtons,children:[Ne&&f(Bv,{config:E.goBack.button,handleClick:function(){return Qe({nextEmbedKey:Pe,shouldBeLogged:!1,direction:"goBack"})},icon:f(Hv,{className:qv.funnelReplayButtonIcon,style:Je})}),Me&&f(Bv,{config:E.startOver.button,handleClick:function(){return Qe({nextEmbedKey:ke,shouldBeLogged:!1,direction:"startOver"})},icon:f(jv,{className:qv.funnelReplayButtonIcon,style:et})})]})]})})})},Wv=n(1745),Qv={};Qv.setAttributes=Ul(),Qv.insert=Ml().bind(null,"head"),Qv.domAPI=xl(),Qv.insertStyleElement=Vl();Ol()(Wv.A,Qv);var Xv=Wv.A&&Wv.A.locals?Wv.A.locals:void 0;var Zv=function(e){var t=e.hasAutoPlay,n=e.hasSeekButtons,r=e.hasPlayButton,i=qc(),a=wu(),s=Uu(),l=Hu(),u=Yu((function(e){return e.paused})),d=Qc((function(e){return e.autoPlayStatus})),h=Yu((function(e){return e.hasTimeUpdate})),p=Yu((function(e){return e.isStarted})),m=Yu((function(e){return e.isTouched})),v=Qc((function(e){return e.isBigPlayButtonDisabled})),g=Qc((function(e){return e.isSmartVidsOverlayActive})),y=Qc((function(e){return e.isUserActive})),_=hd(y),E=Qc((function(e){return e.setIsUserActive})),b=Qc((function(e){return e.setIsManuallyPaused})),S=Qc((function(e){return e.setSeekTime})),T=Qc((function(e){return e.setLastSeekTime})),w=Qc((function(e){return e.setIsSeeking})),C=Qc((function(e){return e.isSeeking})),R=Qc((function(e){return e.hasAutoPlayOverlay})),k=Qc((function(e){return e.seekTime})),P=I((0,c.useState)(!1),2),L=P[0],O=P[1],D=(0,c.useMemo)((function(){return rh()((function(e){s.currentTime(e),s.trigger("timeupdate"),s.trigger("seeked:internal"),setTimeout((function(){return w(!1)}),0)}),500,{leading:!0})}),[s,w]);function x(e){var t=C?k:s.currentTime(),n=e>0?Math.min(s.duration(),t+e):Math.max(1e-6,t+e);w(!0),S(n),T(n),D(n)}var N=a.playback.noPause,M=(0,c.useCallback)((function(e){var t=I(e,2),n=t[0],r=t[1];O(r-n>.5)}),[]);(0,c.useEffect)((function(){return l.subscribe((function(e){return[e.currentTime,e.duration]}),M)}),[l,M]);var F,U=!v&&!R&&!g&&L&&(u&&p||y||!m),B=t&&"fail"!==d&&!h,V=A(Xv.wrapper,(o(F={},Xv.wrapperLandscape,"landscape"===i.media.orientation),o(F,Xv.wrapperPortrait,"portrait"===i.media.orientation&&1!==i.media.aspectRatio),o(F,Xv.wrapperSquare,1===i.media.aspectRatio),o(F,Xv.wrapperHidden,B||!U),o(F,Xv.wrapperDisabled,v),F)),G={backgroundColor:Pc(.15,i.colors.primary)},H={color:i.colors.primary};return f("div",{className:V,children:[n&&!u&&f("button",{type:"button",className:A(Xv.button,Xv.buttonSecondary),onClick:function(){return x(-10)},"data-vid-testid":"controls:big-rewind-button",children:f("svg",{fill:"none",viewBox:"0 0 160 160",className:Xv.icon,children:[f("circle",{cx:"80",cy:"80",r:"80",fill:i.colors.primary,opacity:"0.85"}),f("path",{fill:i.colors.secondary,d:"M79.94 40.84v-15.6a2.77 2.77 0 0 0-4.75-1.96l-21.2 21.2a2.77 2.77 0 0 0 0 3.97l21.2 21.2a2.8 2.8 0 0 0 4.75-1.96V52.03a33.58 33.58 0 0 1 32.78 40.78 33.34 33.34 0 0 1-25.56 25.56 33.64 33.64 0 0 1-40.44-28.02 5.5 5.5 0 0 0-5.49-4.76 5.63 5.63 0 0 0-5.59 6.32 44.82 44.82 0 0 0 53.31 37.6 44.63 44.63 0 0 0 34.9-34.91 44.82 44.82 0 0 0-43.9-53.76Zm-6.15 61.53h-4.75V84.14l-5.65 1.73v-3.86l9.9-3.52h.5v23.89Zm23.94-9.84c0 1.79-.17 3.36-.56 4.59s-.95 2.35-1.62 3.19a6.27 6.27 0 0 1-2.52 1.84 8.7 8.7 0 0 1-3.3.56 8.9 8.9 0 0 1-3.3-.56c-1-.4-1.84-1-2.57-1.84a8.64 8.64 0 0 1-1.68-3.2 15.7 15.7 0 0 1-.61-4.58v-4.14c0-1.79.16-3.36.56-4.59.39-1.23.95-2.35 1.62-3.19a6.27 6.27 0 0 1 2.52-1.84 8.7 8.7 0 0 1 3.3-.56c1.23 0 2.29.17 3.3.56 1 .39 1.84 1 2.57 1.84.73.84 1.29 1.9 1.68 3.2.39 1.28.61 2.79.61 4.58v4.14Zm-4.75-4.81c0-1.06-.06-1.96-.23-2.69a5.6 5.6 0 0 0-.67-1.73 2.17 2.17 0 0 0-1.06-.95 3.66 3.66 0 0 0-2.8 0c-.39.17-.78.5-1.06.95-.28.45-.5 1-.67 1.73-.17.73-.22 1.63-.22 2.69v5.42c0 1.07.05 1.96.22 2.69a6 6 0 0 0 .67 1.79c.28.45.62.78 1.06.95a3.66 3.66 0 0 0 2.8 0c.4-.17.78-.5 1.06-.95.28-.45.5-1.06.62-1.79.11-.73.22-1.62.22-2.69v-5.42h.06Z"})]})}),f("button",{type:"button",className:Xv.button,onClick:function(){var e=s.muted();if(u)"fail"===d&&!h&&e&&s.muted(!1),dl(s.play()),b(!1),s.trigger("play:manual");else{if(!_)return void E(!0);if(N)return;s.pause(),b(!0)}},"data-vid-testid":"controls:big-".concat(u?"play":"pause","-button"),children:[u&&r&&f("svg",{viewBox:"0 0 102 102",className:Xv.icon,style:G,children:f("path",{fill:i.colors.secondary,fillRule:"nonzero",d:"M37.92 29.24c-.57.33-.92.94-.92 1.6v40.43c0 1.01.81 1.84 1.82 1.84 1 0 1.82-.83 1.82-1.84V34.08l26.93 16.24-19.8 12.92a1.86 1.86 0 0 0-.55 2.54 1.8 1.8 0 0 0 2.51.56L72 51.8a1.85 1.85 0 0 0-.05-3.13l-32.2-19.41a1.8 1.8 0 0 0-1.83-.02Z"})}),!u&&n&&f("svg",{viewBox:"0 0 102 102",className:Xv.icon,children:f("g",{fill:i.colors.secondary,"fill-rule":"nonzero",children:[f("path",{d:"M47 51.7v19c0 1.3-.3 1.7-1.6 1.7h-6.8c-1.1 0-1.6-.4-1.6-1.6V32.6c0-1 .5-1.6 1.6-1.6h7c1 0 1.5.5 1.5 1.6v19.1Z"}),f("path",{d:"M55 51.7v-19c0-1.2.4-1.7 1.5-1.7h7c1 0 1.5.5 1.5 1.6v38.3c0 1-.5 1.5-1.5 1.5h-7c-1.2 0-1.6-.4-1.6-1.7v-19Z"})]})}),u&&r&&f("div",{className:Xv.pulse,style:H})]}),n&&!u&&f("button",{type:"button",className:A(Xv.button,Xv.buttonSecondary),onClick:function(){return x(10)},"data-vid-testid":"controls:big-forward-button",children:f("svg",{fill:"none",viewBox:"0 0 160 160",className:Xv.icon,children:[f("circle",{cx:"80",cy:"80",r:"80",fill:i.colors.primary,opacity:"0.85"}),f("path",{fill:i.colors.secondary,d:"M118.71 85.6c-2.8 0-5.1 2.06-5.48 4.8a33.6 33.6 0 0 1-41.5 27.75A32.65 32.65 0 0 1 47.15 92.8 33.64 33.64 0 0 1 80 52.03v15.6a2.77 2.77 0 0 0 4.76 1.96l21.2-21.2a2.77 2.77 0 0 0 0-3.97l-21.2-21.2A2.8 2.8 0 0 0 80 25.23v15.61a44.76 44.76 0 0 0-43.86 53.7c3.36 17.4 16.23 30.77 33.51 34.63a44.8 44.8 0 0 0 54.65-37.31c.5-3.3-2.23-6.27-5.59-6.27Zm-44.86 16.77V78.5h-.5L63.44 82v3.86l5.64-1.73v18.23h4.76Zm19.13-23.6c-1-.4-2.07-.56-3.3-.56s-2.3.17-3.3.56c-1.01.39-1.85 1-2.52 1.84a8.57 8.57 0 0 0-1.62 3.2 17.74 17.74 0 0 0-.56 4.58v4.14c0 1.79.22 3.36.61 4.59a9.1 9.1 0 0 0 1.68 3.19 6.45 6.45 0 0 0 2.58 1.84c1 .4 2.06.56 3.3.56a8.9 8.9 0 0 0 3.3-.56c1-.4 1.84-1 2.51-1.84a9.5 9.5 0 0 0 1.63-3.2c.39-1.28.55-2.8.55-4.58v-4.14c0-1.79-.22-3.36-.61-4.59a9.1 9.1 0 0 0-1.68-3.19 6.86 6.86 0 0 0-2.57-1.84Zm.05 14.37c0 1.07-.05 1.96-.22 2.69a6.06 6.06 0 0 1-.62 1.79c-.27.45-.61.78-1.06.95a3.66 3.66 0 0 1-2.8 0c-.39-.17-.78-.5-1.06-.95a6 6 0 0 1-.67-1.8 12.1 12.1 0 0 1-.22-2.68v-5.42c0-1.06.05-1.96.22-2.69a4.5 4.5 0 0 1 .67-1.73c.34-.45.62-.78 1.07-.95a3.67 3.67 0 0 1 2.8 0c.38.17.78.5 1.05.95.28.45.5 1 .68 1.73.16.73.22 1.63.22 2.69v5.42h-.06Z"})]})})]})};var Jv=function(e){var t,n,r=e.hasRedirectCountdown,i=Uu(),a=wu(),o=Yu((function(e){return e.ended})),s=Qc((function(e){return e.setSeekTime})),l=Qc((function(e){return e.setLastSeekTime})),u=Qc((function(e){return e.setIsSeeking})),d=Qc((function(e){return e.isSeeking})),h=Qc((function(e){return e.seekTime})),f=Qc((function(e){return e.isControlBarDisabled})),p=null===(t=a.ui.overlay.redirect)||void 0===t?void 0:t.timeout,m=!!(null===(n=a.ui.overlay.redirect)||void 0===n?void 0:n.show),v=r&&o&&m&&p>0,g=(0,c.useMemo)((function(){return rh()((function(e){i.currentTime(e),i.trigger("timeupdate"),i.trigger("seeked:internal"),setTimeout((function(){return u(!1)}),0)}),500,{leading:!0})}),[i,u]),y=(0,c.useCallback)((function(e){var t=d?h:i.currentTime(),n=e>0?Math.min(i.duration(),t+e):Math.max(1e-6,t+e);n!==t&&(u(!0),s(n),l(n),g(n))}),[d,i,h,g,u,l,s]);return(0,c.useEffect)((function(){if(!f&&!v)return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)};function e(e){"ArrowLeft"===e.code&&y(-10),"ArrowRight"===e.code&&y(10)}}),[f,v,y]),null},eg=n(3127),tg={};tg.setAttributes=Ul(),tg.insert=Ml().bind(null,"head"),tg.domAPI=xl(),tg.insertStyleElement=Vl();Ol()(eg.A,tg);var ng=eg.A&&eg.A.locals?eg.A.locals:void 0;var rg=function(e){var t=e.customerId,n=qc(),r=wu(),i=Uu(),a=Yu((function(e){return e.hasErrorFatal})),u=Yu((function(e){return e.error})),h=Yu((function(e){return e.rootEmbedElement})),p=Yu((function(e){return e.embedId})),m=Qc((function(e){return e.hasLicenseError})),v=n.colors.primary,g=n.colors.secondary,y=Tl("localStorage"),_=Tl("sessionStorage"),E=y&&r.tracking.enabled,b=y?localStorage.getItem("vidalytics_uid"):null,S=_?sessionStorage.getItem("vidalytics_sid"):null,T=zs(u),w="https://www.vidalytics.com/?utm_source=Player%20Error%20Message&utm_medium=Player&utm_content=".concat(t);function I(e){var t,n,a=null===(n=window._vidalytics)||void 0===n||null===(t=n.embeds)||void 0===t?void 0:t[p].destroy;if("function"===typeof a){var o=r;if(E&&e){var u=i.lastTime(),c=r.tracking.videoId,d="vidalytics_video_".concat(c,"_time");localStorage.setItem(d,String(u)),o=l(s({_forceResume:!0},r),{playback:l(s({},r.playback),{resume:!0}),ui:l(s({},r.ui),{overlay:l(s({},r.ui.overlay),{resume:l(s({},r.ui.overlay.resume),{show:!1})})})})}a(),Pm(h,p,o)}}(0,c.useEffect)((function(){a&&i.pause()}),[i,a]);var C,R={backgroundColor:v,color:g},k={color:Pc(.5,n.colors.secondary)},P=A(ng.title,(o(C={},ng.titleLg,!m),o(C,ng.titleMd,m),C));return a||m?f("div",{className:ng.wrapper,style:R,children:[f("div",{className:P,children:m?"This video can't be played\nright now...":"Something happened\nto this video"}),m?f("div",{className:ng.subtitle,style:k,children:["If this is your video, log into your ",f("br",{}),f("a",{className:ng.link,href:w,target:"_blank",rel:"noreferrer",children:"Vidalytics.com"})," ","account to fix it"]}):f(d.FK,{children:[f("div",{className:ng.controls,children:[f("button",{type:"button",className:ng.button,onClick:function(){return I()},children:[f("div",{className:ng.buttonIconWrapper,children:f("svg",{className:ng.buttonIcon,viewBox:"210 396 50 50",children:[f("path",{fill:v,d:"M234.417 399.941c11.291 0 20.476 9.185 20.476 20.476 0 11.292-9.185 20.475-20.476 20.475-11.29 0-20.474-9.185-20.474-20.475 0-11.292 9.184-20.476 20.474-20.476zm0-2.275c-12.563 0-22.75 10.187-22.75 22.75 0 12.564 10.188 22.75 22.75 22.75 12.564 0 22.751-10.186 22.751-22.75s-10.187-22.75-22.751-22.75z"}),f("path",{fill:g,d:"M247.641 410.691a1.14 1.14 0 0 1-1.224 1.043l-1.61-.129c4.596 5.538 4.117 13.787-1.229 18.727-5.526 5.104-14.173 4.761-19.276-.769-5.104-5.526-4.759-14.176.768-19.281a13.668 13.668 0 0 1 8.412-3.594 1.134 1.134 0 0 1 1.203 1.063 1.135 1.135 0 0 1-1.061 1.205h-.004a11.396 11.396 0 0 0-7.009 2.995c-4.606 4.254-4.893 11.461-.638 16.069 4.251 4.605 11.456 4.895 16.063.638 4.404-4.066 4.847-10.835 1.154-15.447l-.001 1.503a1.135 1.135 0 1 1-2.271.041v-4.512a1.137 1.137 0 0 1 1.227-1.134l4.452.354a1.144 1.144 0 0 1 1.044 1.228z"})]})}),f("div",{className:ng.buttonTitle,children:"Start Over"})]}),f("button",{type:"button",className:ng.button,onClick:function(){return I(!0)},children:[f("div",{className:ng.buttonIconWrapper,children:f("svg",{className:ng.buttonIcon,viewBox:"223 395 50 50",children:[f("path",{fill:v,d:"M247.75 399.941c11.29 0 20.475 9.185 20.475 20.475s-9.185 20.476-20.475 20.476c-11.291 0-20.475-9.186-20.475-20.476s9.184-20.475 20.475-20.475zm0-2.274c-12.563 0-22.75 10.187-22.75 22.75 0 12.564 10.187 22.751 22.75 22.751s22.75-10.187 22.75-22.751c0-12.564-10.187-22.75-22.75-22.75z"}),f("path",{fill:g,d:"m253.498 420.203-11.063-7.637a.381.381 0 1 0-.598.313v15.272a.382.382 0 0 0 .598.316l11.063-7.637a.383.383 0 0 0 0-.627z"})]})}),f("div",{className:ng.buttonTitle,children:"Continue Watching"})]})]}),f("div",{className:ng.message,children:[T," ",b," ",S&&"/ ".concat(S)]})]})]}):null},ig=["vidalytics.com","wf.vidalytics.com","go.vidalytics.com","preview.vidalytics.com","preview.dev.vidalytics.com","apps.vidalytics.com","apps.dev.vidalytics.com","app.local.vidalytics.com","localhost","127.0.0.1"];function ag(e,t,n){return og.apply(this,arguments)}function og(){return(og=t((function(e,t,n){var r,i;return u(this,(function(a){switch(a.label){case 0:return r=n.embedEnv,i=Qs[r].PLAYER_API_URL,[4,El.post("/license",{domain:t,embed:e},{retries:2,baseUrl:i})];case 1:return[2,a.sent().data]}}))}))).apply(this,arguments)}var sg=function(){var e=Uu(),n=wu(),r=Yu((function(e){return e.embedId})),i=Yu((function(e){return e.embedEnv})),a=I((0,c.useState)(n.licenseStatus),2),o=a[0],s=a[1],l=Qc((function(e){return e.hasLicenseError})),d=Qc((function(e){return e.setHasLicenseError})),h=Qc((function(e){return e.setIsControlBarDisabled})),f=new URL(window.location.href).hostname.replace("www.",""),p=(0,c.useCallback)(t((function(){var e,t;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,ag(r.replace(/vid(alytics)?_embed_/gi,""),f,{embedEnv:i})];case 1:return e=n.sent(),s(e),[3,3];case 2:return t=n.sent(),console.error("Failed to check license status for embed id `".concat(r,"`"),t),[3,3];case 3:return[2]}}))})),[f,i,r]);return(0,c.useLayoutEffect)((function(){o||ig.includes(f)||p()}),[f,p,o]),(0,c.useLayoutEffect)((function(){var e=null===o||void 0===o?void 0:o.code,t="OK"===e,n=function(e){var t=new URL(window.location.href).hostname.replace("www.","");return!(ig.includes(t)||!(null===e||void 0===e?void 0:e.length))&&!e.map((function(e){return{name:e.replace("*.","").replace("www.",""),hasWildcard:/\*./.test(e)}})).some((function(e){var n=e.hasWildcard?e.name:"^".concat(e.name,"$");return new RegExp(n).test(t)}))}(null===o||void 0===o?void 0:o.allowedDomains);d(!!e&&(!t||t&&n))}),[o,d]),(0,c.useLayoutEffect)((function(){var t;l&&(setTimeout((function(){e.trigger("error:internal",{type:"license",data:o})}),0),null===(t=e.hls)||void 0===t||t.stopLoad(),h(!0))}),[e,l,h,o]),null},lg=n(548),ug={};ug.setAttributes=Ul(),ug.insert=Ml().bind(null,"head"),ug.domAPI=xl(),ug.insertStyleElement=Vl();Ol()(lg.A,ug);var cg=lg.A&&lg.A.locals?lg.A.locals:void 0;var dg=function(e){var t,n=e.isVisible,r=e.isHidden,i=Uu(),a=wu(),s=qc(),l=Yu((function(e){return e.fullscreen})),u=Qc((function(e){return e.hasControlBar})),h=Qc((function(e){return e.isUserActive})),p=Qc((function(e){return e.setActiveCueHeight})),m=(0,c.useRef)(null),v=(0,c.useRef)(null),g=I((0,c.useState)(),2),y=g[0],_=g[1],E=(0,c.useCallback)((function(){var e;if(m.current){var t=m.current.track;if(!0===i.isFullscreen()&&s.browser.isiOS||(t.mode="hidden"),t){var n=null===(e=t.activeCues)||void 0===e?void 0:e[0];_(n)}}}),[i,s.browser.isiOS]);(0,c.useLayoutEffect)((function(){var e=m.current;if(e)return e.track.mode="hidden",e.addEventListener("cuechange",E),function(){e.removeEventListener("cuechange",E)}}),[E]);var b=(0,c.useCallback)((function(){if(m.current){var e=m.current.track,t="showing"===e.mode;!0===l&&s.browser.isiOS?i.hasCaptions(t):e.mode="hidden"}}),[l,i,s.browser.isiOS]);(0,c.useLayoutEffect)((function(){var e=i.textTracks();return e.addEventListener("change",b),function(){e.removeEventListener("change",b)}}),[i,b]);var S=(0,c.useCallback)((function(){var e=!0===i.isFullscreen()&&s.browser.isiOS,t=m.current;if(t){var r=n&&e?"showing":"hidden";t.track.mode=r}}),[n,i,s.browser.isiOS]);(0,c.useLayoutEffect)((function(){return i.on("fullscreenchange",S),function(){i.off("fullscreenchange",S)}}),[S,i]),(0,c.useEffect)((function(){if(v.current){var e=v.current.getBoundingClientRect();p(e.height)}else p(0)}),[y,n,r,p]);var T=pf(null===(t=a.ui.closedCaptions)||void 0===t?void 0:t.source),w=y&&function(e){if(!e.getCueAsHTML)return e.text;var t=document.createElement("div");return t.appendChild(e.getCueAsHTML().cloneNode(!0)),t.innerHTML}(y),C=a.ui.controlBar.alwaysShow,R=A(cg.wrapper,o({},cg.wrapperHasOffset,u&&(h||!h&&C)));return f(d.FK,{children:[n&&!r&&w&&f("div",{className:R,children:f("div",{ref:v,className:cg.article,dangerouslySetInnerHTML:{__html:w}})}),(0,c.createPortal)(f("track",{ref:m,kind:"captions",label:"Closed Captions",srcLang:"en",src:T,default:!0}),i.mediaElement)]})};var hg=n(3523),fg={};fg.setAttributes=Ul(),fg.insert=Ml().bind(null,"head"),fg.domAPI=xl(),fg.insertStyleElement=Vl();Ol()(hg.A,fg);var pg=hg.A&&hg.A.locals?hg.A.locals:void 0;var mg=function(){var e,t,n,r,i,a,o,u,h,p,m,v,g,y,_,E,b,S,A,T,w,C,R,k,P=(0,c.useRef)(null),L=qc(),O=wu(),D=Uu(),x=Yu((function(e){return e.embedEnv})),N=Yu((function(e){return e.embedId})).replace("vidalytics_embed_",""),M=Yu((function(e){return e.hasCaptions})),F=Qc((function(e){return e.autoPlayStatus})),U=Qc((function(e){return e.isUserActive})),B=Qc((function(e){return e.isFirstSession})),V=Yu((function(e){return e.isStarted})),G=Qc((function(e){return e.isDocumentActive})),H=Qc((function(e){return e.setIsUserActive})),Y=Qc((function(e){return e.isControlBarActive})),j=Qc((function(e){return e.isThumbnailVisible})),K=Qc((function(e){return e.isControlBarDisabled})),$=Qc((function(e){return e.setIsDocumentActive})),q=Qc((function(e){return e.isActivityObserverDisabled})),z=(0,c.useMemo)((function(){return new hf}),[]),W=function(e){var t=O.triggers;if(!(null===t||void 0===t?void 0:t.items))return null;var n=Object.entries(t.items).map((function(e){var t=I(e,2),n=t[0];return l(s({},t[1]),{guid:n})})).filter((function(t){return t.type===e}));if(!n.length)return null;var r={email:z.getQueryParam("email",!1),user_id:z.getQueryParam("user_id")};if(null===t||void 0===t?void 0:t.params)for(var i in t.params){var a=t.params[i],o=z.getQueryParam(i,!1);r[i]=o||a}var u=n[0];if(null===u||void 0===u?void 0:u.params)for(var c in u.params){var d=u.params[c],h=z.getQueryParam(c,!1);r[c]=h||d}return{guid:u.guid,triggerData:r}},Q=Tl("localStorage"),X=L.browser,Z=X.isPlatformDesktop,J=X.isPlatformMobileLike,ee=O.tracking.customerId,te=!!(null===(e=O.ui.overlay.expire)||void 0===e?void 0:e.enabled)&&Date.now()>Date.parse(null===(t=O.ui.overlay.expire)||void 0===t?void 0:t.dateExpire),ne=O.ui.overlay.interactiveVideos,re=J?O.playback.autoplay.mobile:O.playback.autoplay.enabled,ie=O.tracking.videoId,ae="vidalytics_video_".concat(ie,"_time"),oe=(0,c.useMemo)((function(){return Q?Number(localStorage.getItem(ae)):0}),[Q,ae]),se="vidalytics_video_".concat(N,"_unmuted"),le=(0,c.useMemo)((function(){return Q?localStorage.getItem(se):null}),[Q,se]),ue=!B&&(re&&("success"===F||"fail"===F||!!le)||!re),ce=ue&&O.playback.resume&&oe>0,de=!!(null===(n=O.ui.overlay.resume)||void 0===n?void 0:n.show),he=!(ce&&de)&&re,fe=!!(null===(r=O.ui.thumbnail.placeholder)||void 0===r?void 0:r.source),pe=pf(null===(i=O.ui.thumbnail.placeholder)||void 0===i?void 0:i.source),me=!(null===(a=O.tweak)||void 0===a?void 0:a.disableKeyboardEvents)&&O.playback.skipAndRewindWithKeyboard&&!O.ui.controlBar.smartSeekBar.show,ve=!!O.playback.smartPause,ge=!!O.playback.smartPauseResume,ye=!!(null===(u=O.ui.overlay.play)||void 0===u||null===(o=u.button)||void 0===o?void 0:o.show),_e=!!(null===(p=O.ui.overlay.play)||void 0===p||null===(h=p.seekButtons)||void 0===h?void 0:h.show),Ee=ye||_e,be="free"===O.subscription.plan.tier&&L.breakpoints.only("tiny"),Se=!!O.ui.callToActions&&Object.keys(O.ui.callToActions).length>0,Ae=!!(null===(m=O.globalSettings)||void 0===m?void 0:m.playGate),Te=Q&&!!O.ui.overlay.playGate&&Object.keys(O.ui.overlay.playGate).length>0,we=!!O.playback.autoplay.onlyMuted||!!O.playback.autoplay.keepMutedAfterDomainInteraction,Ie=!!(null===(g=O.ui.overlay.unmute)||void 0===g||null===(v=g.mobile)||void 0===v?void 0:v.enabled),Ce=q,Re=K||!U&&!O.ui.controlBar.alwaysShow;k=!(!Q||(null===(y=window._vidalytics)||void 0===y?void 0:y.disableTracking))&&O.tracking.enabled;var ke=null===(_=O.tweak)||void 0===_?void 0:_.disableAnalytics,Pe=!((null===(E=window._vidalytics)||void 0===E?void 0:E.disableAnalytics)||"boolean"===typeof ke&&ke),Le=null===(b=O.tweak)||void 0===b?void 0:b.disableContextMenu,Oe=!("boolean"===typeof Le&&Le),De=(0,c.useMemo)((function(){return function(e){if(!e)return{};var t=Object.entries(e.items).filter((function(e){var t=I(e,2);return t[0],"time"===t[1].type}));return{items:s({},Object.fromEntries(t)),params:e.params}}(O.triggers)}),[O]),xe=k&&!!De.items&&Object.keys(De.items).length>0,Ne=!!O.integrations,Me="redirect"===O.playback.onEnd&&(null===(S=O.ui.overlay.redirect)||void 0===S?void 0:S.url)&&!ne,Fe="replay"===O.playback.onEnd&&!ne,Ue=O.ui.controlBar.fullscreen,Be=Ue.show&&(Z&&(null===(T=Ue.customFullscreen)||void 0===T||null===(A=T.default)||void 0===A?void 0:A.enabled)||!Z&&(null===(C=Ue.customFullscreen)||void 0===C||null===(w=C.mobile)||void 0===w?void 0:w.enabled)),Ve=(0,c.useCallback)((function(e){var t=O.ui.closedCaptions;return"muted"===e?Z&&t.default.displayWhenMuted||J&&t.mobile.displayWhenMuted:Z&&!t.default.displayWhenMuted&&t.default.enabled||J&&!t.mobile.displayWhenMuted&&t.mobile.enabled}),[Z,J,O.ui.closedCaptions]),Ge=!!(null===(R=O.ui.closedCaptions)||void 0===R?void 0:R.source),He=j,Ye=Ve("muted"),je=Ve("default"),Ke=(0,c.useCallback)((function(){if(Ge&&Ye){var e=D.muted();D.hasCaptions(e)}}),[D,Ge,Ye]);(0,c.useEffect)((function(){return D.on("volumechange",Ke),function(){D.off("volumechange",Ke)}}),[D,Ke]),(0,c.useEffect)((function(){Ge&&!Ye&&setTimeout((function(){return D.hasCaptions(je)}),0)}),[D,Ge,Ye,je]),(0,c.useEffect)((function(){var e=F;"pristine"===e&&(e=he?"enabled":"disabled"),we&&he&&(e="muted"),!we&&he&&(e="enabled"),D.autoPlayState(e)}),[D,F,he,we]);var $e=l(s({},function(e){var t,n=e.video.title,r=e.tracking,i=r.videoId,a=r.customerId,o=null===(t=window._vidalytics)||void 0===t?void 0:t.cdnProvider,s=e.playerVersion,l=e.transcoder,u=e.transcoderVersion;return{title:n,videoId:i,customUserId:a,customData1:a,customData2:e.transcoderFlags,customData3:s,customData4:l,customData5:u,cdnProvider:o,customData7:Xs}}(O)),{customData6:!B});return f(d.FK,{children:[f($f,{}),f("div",{ref:P,className:pg.wrapper,children:[f(Lm,{}),f(Om,{}),f(Hf,{targetRef:P,initialValue:U,hasTimeout:!Y,onChange:H,onChangeDocument:$,isDisabled:Ce,hasInitialTimeout:!0}),f(sg,{}),k&&f(Ym,{config:O.tracking,hasAutoPlay:he}),xe&&f(km,{config:De,plugins:O.plugins,hasAutoPlay:he}),Ne&&f($m,{config:O.integrations,videoTitle:O.video.title}),me&&f(Jv,{hasRedirectCountdown:!!Me}),Pe&&f(Bf,s({licenseKey:Qs[x].ANALYTICS_LICENSE_KEY},$e)),fe&&f(Qm,{isVisible:!V,source:pe}),f(nv,{config:O.ui.thumbnail.default,mobileConfig:O.ui.thumbnail.mobile,exitConfig:O.ui.overlay.pause,isStretched:!!O.ui.thumbnail.fullSize,hasEndedEvent:"display_thumbnail"===O.playback.onEnd}),te?f(Sv,{config:O.ui.overlay.expire}):f(d.FK,{children:[f(Mm,{}),f(sv,{}),Be&&f(lv,{}),Fe&&f(uv,{}),f(Wf,{}),ve&&f(zf,{isDocumentActive:G,hasAutoPlay:he,shouldResume:ge}),Ge&&f(dg,{isVisible:M,isHidden:He}),f(Jf,{}),Ee&&f(Zv,{hasAutoPlay:he,hasPlayButton:ye,hasSeekButtons:_e}),he&&f(vd,{config:O.ui.overlay.unmute,hasMobileMessage:Ie,hasReplay:!ce,isOnlyMuted:we}),be&&f(Ff,{customerId:ee}),f(Df,{isHidden:Re,hasResumePlay:ce}),!!ne&&f(zv,{config:ne,triggerEntry:W("interactive"),hasAutoPlay:he}),Te&&f(Rm,{config:O.ui.overlay.playGate,isGlobal:Ae}),Q&&f(vv,{time:oe,hasResumeAfterUnmute:ue}),Me&&f(ov,{}),Se&&f(mp,{config:O.ui.callToActions,triggerEntry:W("callToAction")})]}),f(rg,{customerId:ee}),Oe&&f(Gm,{targetRef:P})]})]})};function vg(e){return/[.-]dev\.?/gi.test(e.tracking.url)?"development":"production"}var gg,yg=function(e){g(n,e);var t=b(n);function n(e){var i;r(this,n),o(m(i=t.call(this,e)),"state",{player:null}),o(m(i),"uri",new hf),o(m(i),"isIgnoredDomain",void 0),o(m(i),"handleTechReady",(function(e){i.setState({player:e})})),o(m(i),"handleTechDestroy",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];i.setState({player:null}),e&&i.handleDestroyEmbed()})),o(m(i),"getPersistedPlayerState",(function(){var e,t=i.state.player,n=i.props.settings,r=Nc().isPlatformMobileLike,a={};if(!t)return a;var o,s=Tl("localStorage"),l=n.init.elementId.replace("#vidalytics_embed_","");if(s){var u="vidalytics_video_".concat(l,"_is_returning");localStorage.getItem(u)===_l.FIRST&&localStorage.setItem(u,_l.RETURNING),o=!(localStorage.getItem(u)===_l.RETURNING)}else o=!0;a.isFirstSession=o;var c=r?n.playback.autoplay.mobile:n.playback.autoplay.enabled;i.isIgnoredDomain||(window._vidalytics||(window._vidalytics={}),window._vidalytics.disableTracking=!1,n.tracking.enabled=!0);var d=n.tracking.enabled,h=n.tracking.videoId;if(s){var f="vidalytics_video_".concat(h,"_duration"),p=Number(localStorage.getItem(f));p&&(a.lastDuration=p)}var m,v,g=i.uri.getQueryParam("fromTime"),y=g&&/^([1-9]\d*)$/.test(g),_="vidalytics_video_".concat(h,"_time");if(s?d&&y?(m=+g,localStorage.setItem(_,g)):m=Number(localStorage.getItem(_)):m=0,s){var E="vidalytics_video_".concat(l,"_unmuted");v=!!localStorage.getItem(E)}else v=!1;var b=!!(null===(e=n.ui.overlay.resume)||void 0===e?void 0:e.show),S=(c&&v||!c)&&n.playback.resume&&!o&&m>0;return S&&(a.isSeeking=!0,a.seekTime=m),a.isUserActive=S&&b||c,a})),o(m(i),"injectInstanceToGlobalScope",(function(e,t){window._vidalytics||(window._vidalytics={}),window._vidalytics.embeds||(window._vidalytics.embeds={}),window._vidalytics.embeds[e]||(window._vidalytics.embeds[e]={}),window._vidalytics.embeds[e].player=t}));var a=new URL(window.location.href).hostname.replace("www.","");return i.isIgnoredDomain=ig.includes(a),i}return a(n,[{key:"componentDidUpdate",value:function(e,t){var n=this.props.embedId,r=this.state.player;if(r){if(t.player===r)return;this.injectInstanceToGlobalScope(n,r)}}},{key:"handleDestroyEmbed",value:function(){var e,t,n,r=this.props.embedId,i=null===(t=window._vidalytics)||void 0===t||null===(e=t.embeds)||void 0===e?void 0:e[r];i&&(null===(n=i.destroy)||void 0===n||n.call(i))}},{key:"render",value:function(){var e,t,n,r,i,a,o,u,c,h,p,m,v,g,y,_=this.state.player,E=this.props,b=E.settings,S=E.embedId,A=E.rootElement,T=Nc(),w=T.isPlatformDesktop,I=T.isPlatformMobileLike,C=T.isiOS,R=T.isSafari,k={rootEmbedElement:A,embedEnv:vg(b),embedId:S},P=this.getPersistedPlayerState(),L=function(e,t){var n=Gs(e,t);return"".concat(e/n,":").concat(t/n)}(b.player.width,b.player.height),O=b.ui.overlay.interactiveVideos,D=!!b._forceResume;O&&!D&&(b.ui.controlBar.fullscreen.show=!1,(null===(h=b.ui.controlBar.fullscreen.customFullscreen)||void 0===h?void 0:h.default)&&(b.ui.controlBar.fullscreen.customFullscreen.default.enabled=!1),(null===(p=b.ui.controlBar.fullscreen.customFullscreen)||void 0===p?void 0:p.mobile)&&(b.ui.controlBar.fullscreen.customFullscreen.mobile.enabled=!1),(null===(v=b.ui.overlay.unmute)||void 0===v||null===(m=v.goFullscreen)||void 0===m?void 0:m.default)&&(b.ui.overlay.unmute.goFullscreen.default.enabled=!1),(null===(y=b.ui.overlay.unmute)||void 0===y||null===(g=y.goFullscreen)||void 0===g?void 0:g.mobile)&&(b.ui.overlay.unmute.goFullscreen.mobile.enabled=!1),b.playback.resume=!1);var x=b.ui.enabled;"boolean"!==typeof x||x||(b.ui.overlay.play.button.show=!1,b.ui.overlay.play.seekButtons&&(b.ui.overlay.play.seekButtons.show=!1),b.ui.controlBar=tl),this.isIgnoredDomain||(b.tracking.enabled=!0);var N=I?b.playback.autoplay.mobile:b.playback.autoplay.enabled,M=pf(null===(t=b.player.media)||void 0===t||null===(e=t.hls)||void 0===e?void 0:e.source),F=pf(null===(r=b.player.media)||void 0===r||null===(n=r.mp4)||void 0===n?void 0:n.source),U=b.player.startupQuality,B=b.ui.controlBar.fullscreen,V=B.show&&(w&&(null===(a=B.customFullscreen)||void 0===a||null===(i=a.default)||void 0===i?void 0:i.enabled)||!w&&(null===(u=B.customFullscreen)||void 0===u||null===(o=u.mobile)||void 0===o?void 0:o.enabled)),G=b.player.lowerBandwidthUsage,H=pf(null===(c=b.ui.thumbnail.placeholder)||void 0===c?void 0:c.source),Y=l(s({src:M,srcFallback:F,controls:!1,initialLevel:U},C&&{autoplay:!0}),{playsInline:!0,crossOrigin:"anonymous",disableHevc:!0,disableHighestResolution:!!G,forceNativeHls:R||C,hasFocusedFullscreen:V,playbackRates:Js,preload:"auto",aspectRatio:L,breakpoints:Vc});return f(d.FK,{children:[!_&&H&&f(Qm,{source:H,isVisible:!0,disableTransition:!0}),f(Kl,{embedId:S,options:Y,settings:b,rootElement:A,hasAutoplay:N,onReady:this.handleTechReady,onDestroy:this.handleTechDestroy,children:!!_&&f(Fu,{player:_,children:f(Gu,{initialState:k,embedId:S,children:f(Wc,{initialState:P,embedId:S,children:f(Tu,{settings:b,embedId:S,children:f($c,{embedId:S,children:f(Im,{children:f(mg,{})})})})})})})})]})}}]),n}(c.PureComponent),_g=yg;!function(e){e.RETURNING_VIEWER="RETURNING_VIEWER",e.MEDIA_QUERY="MEDIA_QUERY"}(gg||(gg={}));var Eg={hasObserver:!1,hasPreload:!0},bg=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),o(this,"isInitialized",void 0),o(this,"embedId",void 0),o(this,"config",void 0),o(this,"isReturningViewer",void 0),o(this,"settings",void 0),o(this,"customSettings",void 0),o(this,"segmentsList",void 0),o(this,"activeSegment",void 0),o(this,"resizeObserver",void 0),this.embedId=t,this.config=Su(Eg,n.targeted),this.settings=n,this.customSettings=i,this.segmentsList=this.getSegmentsList(this.config.segments),this.isReturningViewer=this.getIsReturningViewer(this.segmentsList),this.isInitialized=!0}return a(e,[{key:"formatIsReturningViewerKey",value:function(e){return e=e.replace(/^vidalytics_embed_/,""),"vidalytics_video_".concat(e,"_is_returning")}},{key:"getIsReturningViewer",value:function(e){if("undefined"===typeof localStorage)return!1;for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{retryLimit:10,retryDelay:Ag},i=this;return t((function(){var t,a,o,c,d,h,f,p,m,v,g,y,_,E,b,S;return u(this,(function(u){switch(u.label){case 0:return"string"===typeof e?(o=document.getElementById(e))&&(a=o):a=e,a?[3,2]:(d=null!==(c=r.retryCount)&&void 0!==c?c:r.retryLimit,0!==d?("function"===typeof(h=r.retryDelay)&&(h=h(r.retryLimit-d)),[4,hl(h)]):[2]);case 1:return u.sent(),f=l(s({},r),{retryCount:d-1}),[2,i.run(e,n,f)];case 2:if(!(p=null===(t=window.VidalyticsL)||void 0===t?void 0:t.Loader))return[2];u.label=3;case 3:return u.trys.push([3,6,,7]),m=p.parseContainerIds(a),v=m.customerId,g=m.videoId,y=m.embedId,_=m.baseUrl,[4,p.fetchSettings(y,{baseUrl:_},n,g,v,!1)];case 4:return E=u.sent(),!!E.targeted?((b=new Sg(y,E,n)).run(),window._vidalytics||(window._vidalytics={}),window._vidalytics.targeted||(window._vidalytics.targeted={}),window._vidalytics.targeted[y]||(window._vidalytics.targeted[y]=b),[2]):[4,i.mount(a,y,E)];case 5:return u.sent(),[3,7];case 6:return S=u.sent(),console.error(S),[3,7];case 7:return[2]}}))}))()}},{key:"populateSettingsFromQuery",value:function(e){var t=this.uri.getQueryParam("autoplay");ff(t)&&(e.playback.autoplay.enabled="true"===t,e.playback.autoplay.mobile="true"===t);var n=this.uri.getQueryParam("mobileautoplay");ff(n)&&(e.playback.autoplay.mobile="true"===n);var r=this.uri.getQueryParam("unmuteoverlay");ff(r)&&(e.ui.overlay.unmute.show="true"===r);var i=this.uri.getQueryParam("pause");ff(i)&&(e.playback.noPause=!("true"===i));var a=this.uri.getQueryParam("seekbar");ff(a)&&("true"===a?e.ui.controlBar.seekBar.show||e.ui.controlBar.smartSeekBar.show||(e.ui.controlBar.seekBar.show=!0,e.ui.controlBar.seekBar.showToReturningViewers&&(e.ui.controlBar.seekBar.showToReturningViewers=!1)):(e.ui.controlBar.seekBar.show=!1,e.ui.controlBar.seekBar.showToReturningViewers=!1,e.ui.controlBar.smartSeekBar.show=!1));var o=this.uri.getQueryParam("fromTime");o&&/^([1-9]\d*)$/.test(o)&&(e.ui.overlay.unmute.doReplay=!1);var s=this.uri.getQueryParam("noautoplay");null!==s&&(e.playback.autoplay.enabled=!("true"===s),e.playback.autoplay.mobile=!("true"===s));var l=this.uri.getQueryParam("nomobileautoplay");null!==l&&("false"===l?(e.playback.autoplay.mobile=!0,e.playback.autoplay.enabled=!0):e.playback.autoplay.mobile=!1);var u=this.uri.getQueryParam("nopause");null!==u&&(e.playback.noPause="true"===u);var c=this.uri.getQueryParam("seek");null!==c&&(e.ui.controlBar.seekBar.show="true"===c)}},{key:"loadCss",value:function(){}}],[{key:"injectToGlobal",value:function(){var t,n,r=!!(null===(n=window.Vidalytics)||void 0===n||null===(t=n.Embed)||void 0===t?void 0:t.isMock);window.Vidalytics||(window.Vidalytics={}),window.Vidalytics.Embed&&!r||(window.Vidalytics.Embed=e)}}]),e}();o(Tg,"isMock",!1),Tg.injectToGlobal()}()}();