@flowplayer/player
Version:
video player for the future
1 lines • 613 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).flowplayer=e()}(this,(function(){"use strict";const t=[],e=[];function s(){const t="undefined"!=typeof document&&"undefined"!=typeof window,e=t?navigator.userAgent:"",s=/iP(hone|od)/i.test(e)&&!/iPad/.test(e)&&!/IEMobile/i.test(e),r=/Android/.test(e)&&!/Firefox/.test(e),i=/^((?!chrome|android).)*safari/i.test(e),n=/chrome|crios/i.test(e)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(e),a=/firefox|fxios/i.test(e)&&!/seamonkey/i.test(e),o=/edg/i.test(e),l=/opr|opera/i.test(e),d=/SamsungBrowser/.test(e),c=d&&/SMART-TV/.test(e);return{controls:!s,video:function(e){return t&&document.createElement("video").canPlayType(e)},lang:t&&window.navigator.language,android:r,iphone:s,safari:i,edge:o,opera:l,chrome:n,firefox:a,ios:t&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:d,samsung_tv:d&&c,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const r="click",i="dblclick",n="mouseleave",a="mousemove",o="touchmove",l="fullscreenenter",d="fullscreenexit",c="loadedmetadata",u="loadeddata",h="progress",f="loadstart",g="pause",p="playing",m="waiting",y="canplay",v="ended",E="seeked",T="seeking",S="reap",A="landscape",_="portrait",L="config",b="content:loadstart",R="flowplayer:error";var w=Object.freeze({__proto__:null,MOUNT:"mount",RETRY:"retry",ERROR:"error",CONTEXT_MENU:"contextmenu",CLICK:r,DBL_CLICK:i,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:n,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:a,TOUCH_START:"touchstart",TOUCH_MOVE:o,TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:l,FULLSCREEN_EXIT:d,FULLSCREEN_CHANGE:"fullscreenchange",METADATA:c,DATA:u,PROGRESS:h,TIME_UPDATE:"timeupdate",LOAD_START:f,VOLUME_CHANGE:"volumechange",PAUSE:g,PLAYING:p,PLAY:"play",WAITING:m,CAN_PLAY:y,ENDED:v,SEEKED:E,SEEKING:T,DURATION_CHANGE:"durationchange",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",REAP:S,QUALITIES:"qualities",QUALITY_CHANGE:"qualitychange",VIDEO_TRACKS:"videoTracks",SET_QUALITY:"quality:set",VIDEO_TRACK_SELECT:"tracks:video:select",RECOMMENDATIONS_READY:"recommendationsready",LANDSCAPE:A,PORTRAIT:_,DVR:"dvr",LIVE:"live",RECOVER:"recover",SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange",WEBKIT_NEEDKEY:"webkitneedkey",RENDER_PLUGIN:"renderplugin",AUDIO_ONLY_SOURCE:"audioonlysource",NON_RECOVERABLE_ERROR:"error:fatal",CONFIG:L,STATE:"state",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",CONTENT_REAL_LOAD_START:b,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",STANDARD_ERROR:R});const k="flowplayer-ui",D="flowplayer-logo",I="flowplayer-control",C="flowplayer-live-status",P="flowplayer-elapsed-time",M="flowplayer-timeline-bar",O="flowplayer-volume-bar",x="flowplayer-header",F="flowplayer-middle",N="flowplayer-middle-zone",U="flowplayer-wait",B="flowplayer-small-play-icon",G="flowplayer-small-pause-icon",$="flowplayer-play-icon",H="flowplayer-pause-icon",K="flowplayer-rewind-icon",V="flowplayer-volume-icon",q="flowplayer-live-countdown";var j=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",VIDEO_MENU:"flowplayer-video-menu",UI:k,LOGO:D,CONTROL:I,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:C,ELAPSED:P,TIMELINE:M,CHAPTERS_TIMELINE:"flowplayer-chapters-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:O,HEADER:x,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:F,MIDDLE_ZONE:N,WAIT:U,MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:B,SMALL_PAUSE_ICON:G,PLAY_ICON:$,PAUSE_ICON:H,FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:K,SHARE_ICON:"flowplayer-share-icon",SUBTITLES_MENU_ICON:"flowplayer-subs-menu-icon",MENU_BACK_ICON:"flowplayer-menu-back",VOLUME_ICON:V,MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:q,PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue",SSAI_UI:"flowplayer-ssai-ui",SSAI_CONTROLS:"flowplayer-ssai-controls",SSAI_TIMELINE:"flowplayer-ssai-timeline",SSAI_INDICATOR:"flowplayer-ssai-indicator"});const W="is-playing",Y="is-paused",z="is-loaded",Q="is-loading",X="is-starting",J="is-seeking",Z="is-ended",tt="is-live",et="is-waiting",st="is-autoplay",rt="is-live-seeked",it="no-timeline",nt="will-play",at="will-pause",ot="is-touched",lt="is-hovered",dt="is-in-viewport",ct="is-source-processing";var ut=Object.freeze({__proto__:null,PLAYING:W,FULLSCREEN:"is-fullscreen",PAUSED:Y,MUTED:"is-muted",LOADED:z,LOADING:Q,STARTING:X,SEEKING:J,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",TV:"is-tv",ENDED:Z,LIVE:tt,ERRORED:"is-error",WAITING:et,AUTOPLAY:st,SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:rt,NO_DVR:it,HAS_POSTER:"has-poster",WILL_PLAY:nt,WILL_PAUSE:at,MENU_OPENED:"has-menu-opened",TOUCHED:ot,HOVERED:lt,TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:dt,NO_CONTROLS:"no-controls",DESTROYED:"is-destroyed",IS_SOURCE_PROCESSING:ct});function ht(t){this.message=t}ht.prototype=new Error,ht.prototype.name="InvalidCharacterError";var ft="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new ht("'atob' failed: The string to be decoded is not correctly encoded.");for(var s,r,i=0,n=0,a="";r=e.charAt(n++);~r&&(s=i%4?64*s+r:r,i++%4)?a+=String.fromCharCode(255&s>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};var gt=function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(ft(t).replace(/(.)/g,(function(t,e){var s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(e)}catch(t){return ft(e)}};function pt(t){this.message=t}pt.prototype=new Error,pt.prototype.name="InvalidTokenError";var mt=function(t,e){if("string"!=typeof t)throw new pt("Invalid token specified");var s=!0===(e=e||{}).header?0:1;try{return JSON.parse(gt(t.split(".")[s]))}catch(t){throw new pt("Invalid token specified: "+t.message)}};mt.InvalidTokenError=pt;const yt=new Map,vt=(t,e)=>new(((t,e)=>{const s=t.get(e);if(!s)throw new Error(`no flowplayer component with the name ${e} exists`);const r=window.customElements.get(e);if(!r)throw new Error(`no default flowplayer component with the name ${e} exists`);const i=window.customElements.get(s);return"function"!=typeof i?r:i})(t._customElements,e))(t),Et=(t,e,s)=>{window.customElements.get(e)||window.customElements.define(e,s),t.customElements.get(e)||t.customElements.set(e,e)};var Tt,St;function At(t){return!0===t?St.ON:!1===t?St.OFF:t}!function(t){t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=4]="HIGH"}(Tt||(Tt={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON",t[t.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(St||(St={}));const _t={Unknown:"00-00",MediaUnknown:"01-00",MediaUnavailable:"01-01",MediaUnsupportedVideoFormat:"01-02",MediaUnsupportedAudioFormat:"01-03",MediaBitrateExceeded:"01-04",MediaBufferOverread:"01-05",MediaIntegerOverflow:"01-06",MediaQuotaExceeded:"01-07",MediaInvalidCompositionDuration:"01-08",MediaInvalidCompositionSourceDuration:"01-09",MediaInvalidCompositionSourceStartTime:"01-10",MediaMalformedDepth:"01-11",PlaybackUnknown:"02-00",PlaybackVideoBufferUnderRun:"02-01",PlaybackAudioBufferUnderRun:"02-02",PlaybackVideoBufferingTimeout:"02-03",PlaybackAudioBufferingTimeout:"02-04",PlaybackManifestParseError:"02-05",PlaybackVideoDecodeError:"02-06",PlaybackAudioDecodeError:"02-07",PlaybackDroppedFramesExceeded:"02-08",PlaybackPlayheadExceedsDuration:"02-09",PlaybackUnsupportedDevice:"02-10",PlaybackManifestLoadError:"02-11",PlaybackManifestLoadTimeout:"02-12",PlaybackManifestParsingError:"02-13",PlaybackManifestIncompatibleCodecs:"02-14",PlaybackLevelEmptyError:"02-15",PlaybackLevelLoadError:"02-16",PlaybackLevelLoadTimeout:"02-17",PlaybackLevelSwitchError:"02-18",PlaybackAudioTrackLoadError:"02-19",PlaybackAudioTrackLoadTimeout:"02-20",PlaybackFragLoadError:"02-21",PlaybackFragLoadTimeout:"02-22",PlaybackFragDecryptError:"02-23",PlaybackFragParsingError:"02-24",PlaybackFragGap:"02-25",PlaybackRemuxAllocError:"02-26",PlaybackBufferAddCodecError:"02-27",PlaybackBufferIncompatibleCodecs:"02-28",PlaybackBufferAppendError:"02-29",PlaybackBufferStalledError:"02-30",PlaybackBufferFullError:"02-31",PlaybackBufferSeekOverHole:"02-32",PlaybackBufferNudgeOnStall:"02-33",PlaybackInternalException:"02-34",PlaybackInternalAborted:"02-35",PlaybackManifestLoaderFailure:"02-36",PlaybackSegmentBaseLoaderError:"02-37",PlaybackTimeSyncFailed:"02-38",PlaybackFragmentLoaderFailure:"02-39",PlaybackAppendError:"02-40",PlaybackRemoveError:"02-41",PlaybackDataUpdateFailed:"02-42",PlaybackManifestNoStreams:"02-43",PlaybackUnknownManifestType:"02-44",PlaybackDashInsufficientSegmentInfo:"02-45",PlaybackDashNoRepresentations:"02-46",PlaybackDashNoAdaptationSets:"02-47",PlaybackDashNoInitSegment:"02-48",PlaybackDashUnsupportedContainerFormat:"02-49",PlaybackDashKeySystemMismatch:"02-50",PlaybackMultipleKeyIDs:"02-51",PlaybackDashConflictingKeyIDs:"02-52",PlaybackRestrictedStreams:"02-53",PlaybackHlsMasterAndMediaTags:"02-54",PlaybackRepresentationIdConflict:"02-55",PlaybackHlsUnsupportedKeyFormats:"02-56",PlaybackManifestNoVariants:"02-57",PlaybackHlsUndeclaredVariables:"02-58",PlaybackAes128InvalidKeyLength:"02-59",PlaybackDashConflictingAes128Keys:"02-60",PlaybackDashUnsupportedAes128Encryption:"02-61",PlaybackManifestPatchMismatch:"02-62",PlaybackEmptyMediaPlaylist:"02-63",PlaybackNonContiguousCompositionTrack:"02-64",PlaybackDecoderNotFound:"02-65",PlaybackDecoderTemporarilyUnavailable:"02-66",PlaybackIncompatibleAsset:"02-67",PlaybackNoCompatibleExternalDisplay:"02-69",PlaybackOutOfMemory:"02-70",PlaybackToneMappingFailed:"02-71",PlaybackVideoCompositorFailed:"02-72",NetworkUnknown:"03-00",NetworkNoInternet:"03-01",NetworkRequestTimeout:"03-02",NetworkUnableToResolveHost:"03-03",NetworkResourceNotFound:"03-04",NetworkExpiredUrl:"03-05",NetworkUrlResolutionFailed:"03-06",NetworkDownloadErrorIdManifest:"03-07",NetworkDownloadErrorIdSidx:"03-08",NetworkDownloadErrorIdContent:"03-09",NetworkDownloadErrorIdInitialization:"03-10",NetworkDownloadErrorIdXlink:"03-11",NetworkHttpRequestFailed:"03-12",NetworkMaxRetriesExceeded:"03-13",NetworkSegmentMissing:"03-14",NetworkHttp400BadRequest:"03-400",NetworkHttp401Unauthorized:"03-401",NetworkHttp402PaymentRequired:"03-402",NetworkHttp403Forbidden:"03-403",NetworkHttp404NotFound:"03-404",NetworkHttp405MethodNotAllowed:"03-405",NetworkHttp406NotAcceptable:"03-406",NetworkHttp407ProxyAuthenticationRequired:"03-407",NetworkHttp408RequestTimeout:"03-408",NetworkHttp409Conflict:"03-409",NetworkHttp410Gone:"03-410",NetworkHttp411LengthRequired:"03-411",NetworkHttp412PreconditionFailed:"03-412",NetworkHttp413PayloadTooLarge:"03-413",NetworkHttp414URITooLong:"03-414",NetworkHttp415UnsupportedMediaType:"03-415",NetworkHttp416RangeNotSatisfiable:"03-416",NetworkHttp417ExpectationFailed:"03-417",NetworkHttp418ImATeapot:"03-418",NetworkHttp421MisdirectedRequest:"03-421",NetworkHttp422UnprocessableEntity:"03-422",NetworkHttp423Locked:"03-423",NetworkHttp424FailedDependency:"03-424",NetworkHttp425TooEarly:"03-425",NetworkHttp426UpgradeRequired:"03-426",NetworkHttp428PreconditionRequired:"03-428",NetworkHttp429TooManyRequests:"03-429",NetworkHttp431RequestHeaderFieldsTooLarge:"03-431",NetworkHttp451UnavailableForLegalReasons:"03-451",NetworkHttp500InternalServerError:"03-500",NetworkHttp501NotImplemented:"03-501",NetworkHttp502BadGateway:"03-502",NetworkHttp503ServiceUnavailable:"03-503",NetworkHttp504GatewayTimeout:"03-504",NetworkHttp505HTTPVersionNotSupported:"03-505",NetworkHttp506VariantAlsoNegotiates:"03-506",NetworkHttp507InsufficientStorage:"03-507",NetworkHttp508LoopDetected:"03-508",NetworkHttp510NotExtended:"03-510",NetworkHttp511NetworkAuthenticationRequired:"03-511",ContentProtectionUnknown:"04-00",ContentProtectionConcurrentStreamLimitExceeded:"04-01",ContentProtectionEntitlementRefused:"04-02",ContentProtectionLicenseExpired:"04-03",ContentProtectionBadLicenseRequest:"04-04",ContentProtectionLicenseServerTimeout:"04-05",ContentProtectionInsufficientHDCPSupport:"04-06",ContentProtectionGeoRestricted:"04-07",ContentProtectionParentalControlRestricted:"04-08",ContentProtectionCDNUnauthorized:"04-09",ContentProtectionInvalidAccessToken:"04-10",ContentProtectionKeySystemNoKeys:"04-11",ContentProtectionKeySystemNoAccess:"04-12",ContentProtectionKeySystemNoSession:"04-13",ContentProtectionKeySystemNoConfiguredLicense:"04-14",ContentProtectionKeySystemCertificateRequestFailed:"04-15",ContentProtectionKeySystemCertificateUpdateFailed:"04-16",ContentProtectionKeySystemSessionUpdateFailed:"04-17",ContentProtectionKeySystemStatusOutputRestricted:"04-18",ContentProtectionKeySystemStatusInternalError:"04-19",ContentProtectionKeyLoadError:"04-20",ContentProtectionKeyLoadTimeout:"04-21",ContentProtectionCapabilityMediaKeysError:"04-22",ContentProtectionManifestKeySystemUnknown:"04-23",ContentProtectionKeySystemUnavailable:"04-24",ContentProtectionCDMCreationFailed:"04-25",ContentProtectionCDMAttachFailed:"04-26",ContentProtectionCDMServerCertificateRejected:"04-27",ContentProtectionCDMSessionCreationFailed:"04-28",ContentProtectionCDMLicenseRequestFailed:"04-29",ContentProtectionCDMLicenseResponseRejected:"04-30",ContentProtectionManifestMissingDRMInfo:"04-31",ContentProtectionLicenseServerMissing:"04-32",ContentProtectionOfflineSessionRemoved:"04-33",ContentProtectionInitDataTransformationError:"04-34",ContentProtectionServerCertificateRequestFailed:"04-35",ContentProtectionInsufficientHDCPVersion:"04-36",ContentProtectionHDCPVersionCheckFailed:"04-37",AdsUnknown:"08-00",AdsVastParseError:"08-100",AdsInvalidVastSchema:"08-101",AdsVastVersionNotSupported:"08-102",AdsUnexpectedAdType:"08-200",AdsCreativeLinearityMismatch:"08-201",AdsCreativeDurationMismatch:"08-202",AdsCreativeSizeMismatch:"08-203",AdsWrapperVastError:"08-300",AdsVastResponseRedirectTimeout:"08-301",AdsWrapperLimitReached:"08-302",AdsVastResponseEmpty:"08-303",AdsLinearAdDisplayError:"08-400",AdsMediaFileNotFound:"08-401",AdsMediaFileUnavailable:"08-402",AdsUnsupportedMimeType:"08-403",AdsUnableToDisplayMediaFile:"08-405",AdsMezzanineFileMissing:"08-406",AdsMezzanineFileDownloaded:"08-407",AdsRejectedAd:"08-408",AdsInteractiveCreativeError:"08-409",AdsVerificationNodeExecutionError:"08-410",AdsNonLinearAdDisplayError:"08-500",AdsNonLinearAdSizeMismatch:"08-501",AdsNonLinearAdFetchError:"08-502",AdsNonLinearUnsupportedType:"08-503",AdsCompanionAdDisplayError:"08-600",AdsCompanionAdSizeMismatch:"08-601",AdsRequiredCompanionAdError:"08-602",AdsCompanionAdFetchError:"08-603",AdsUndefinedVastError:"08-900",AdsUnknownVpaidError:"08-901",AdsVastDocumentEmpty:"08-999"},Lt=Object.fromEntries(Object.entries(_t).map(([t,e])=>[e,t]));function bt(t,e,s){const r="boolean"==typeof s;if("boolean"!=typeof s&&(s=!!t.hasState(at)||t.paused),function(t,e,s){const r=t.poll(e?"beforeplay":"beforepause",{forced:s});return r&&r.defaultPrevented}(t,s,r))return Promise.resolve();if(!s)return t.hasState(nt)?(t.setState(at,!0),t.setState(nt,!1),Promise.resolve()):Promise.resolve(t.pause());if(0==t.reaper)return Promise.resolve();const i=t.reaper.get("__pending_play");return t.paused||i?i?(i.src!==wt(t.original_src)&&Rt(t),i):(function(t){return(0==t.networkState||0==t.readyState)&&t.currentSrc==wt(t.original_src)}(t)&&Rt(t),function(t){const e=t.hasState(st),s=e&&(t=>t.autoplay&&St.AUDIO_REQUIRED&At(t.autoplay))(t.opts);s&&(t.muted&&t.toggleMute(!1),0==t.volume&&(t.volume=1));e&&t.setState(st,!1);return t.play().then(()=>{t.hasState(at)&&t.togglePlay(!1)}).catch(r=>{if(console.warn(e?s?"[flowplayer/play] autoplay audio required\n%s":"[flowplayer/play] attempting muted autoplay\n%s":"",r.message,"\ninstance:",t),e&&!s)return t.muted=!0,t.play()})}(t)):(t.setState(at,!1),!t.hasState(W)&&t.setState(nt,!0),Promise.resolve())}function Rt(t){t.opts.is_native&&(t.hasState(z)||(t.hasState(Q)||t.emit(b),t.setState(Q,!0),t.load()))}function wt(t){const e=document.createElement("a");return e.href=t,e.href}function kt(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(s[r[i]]=t[r[i]])}return s}function Dt(t){const e=document.createElement("a");e.href=t;const s=e.pathname&&e.pathname.split(".");return s.length>1&&s[s.length-1]}function It(t){switch(t){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return t}}const Ct=t=>{var{src:e}=t,s=kt(t,["src"]);return[Object.assign({src:e,type:e?It("video/"+Dt(e)):""},s)]};function Pt(t){return Ct({src:t})}function Mt(t){var{src:e,type:s}=t,r=kt(t,["src","type"]);return e&&s?[Object.assign({src:e,type:s},r)]:s&&!e?[Object.assign({type:s},r)]:Ct(Object.assign({src:e},r))}var Ot;function xt(t,e,s,r={safari:!1}){const i=Ft(s);return function(t){[J,at,nt,W,Y,Q,z,rt].forEach(e=>t.setState(e,!1)),t.setState(X,!0)}(t),Array(...Array(i.length)).map((t,e)=>e).some(s=>{const n=i[s];if(Ot.Ok==function(t,e,s){t.emit("src",s),e.playback_token&&"string"==typeof s.src&&s.src.startsWith("https://")&&(s.src=function(t,e){const s=new URL(t);return s.pathname=`/pt:${e}${s.pathname}`,s.toString()}(s.src,e.playback_token));"string"==typeof s.src&&(t.original_src=s.src);const r=function(t,e,s){return t.plugins.filter(t=>{return(e=t)&&"wants"in e;var e}).find(t=>t.wants(s.src||"",s,e))}(t,e,s);return t.setOpts({is_native:!r}),r?(r.onload(e,t.root,t,s),Ot.Ok):Ot.Err}(t,e,n)||Ot.Ok==function(t,e,s,r={safari:!1}){var i;/^audio\//.test(s.type||"")&&t.emit("audioonlysource");e.start_time&&(s.src=s.src+"#t="+e.start_time);if(""==t.canPlayType(s.type||""))return Ot.Err;if(s.drm&&(!s.drm["com.apple.fps.1_0"]||!r.safari))return Ot.Err;"string"==typeof s.src&&(t.preload=null!==(i=e.preload)&&void 0!==i?i:"auto",t.src=s.src);return Ot.Ok}(t,e,n,r))return!0;s==i.length-1&&"string"==typeof n.src&&(t.src=n.src)}),t}function Ft(t){return"string"==typeof t?Pt(t):Array.isArray(t)||"object"!=typeof t?t.reduce((function(t,e){return"string"==typeof e&&(e=Pt(e)),"object"!=typeof e||Array.isArray(e)||(e=Mt(e)),t.concat(e)}),[]):Mt(t)}!function(t){t[t.Err=0]="Err",t[t.Ok=1]="Ok"}(Ot||(Ot={}));const Nt=[S,T,"src","seek:cancel"];var Ut;function Bt(t,e,s){return isNaN(t.duration)||isNaN(t.currentTime)?{}:(e.offset+=s,0==e.offset?Gt(t,e):(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){0!=t.reaper&&(t.currentTime=function(t,e,s=0){return Math.max(Math.min(e,t),s)}(t.currentTime+e.offset,t.duration),e.timer=0,Gt(t,e))}),1e3),function(t,e){t.setState("will-seek",!0),t.setState(Ut.BACKWARD,e.offset<0),t.setState(Ut.FORWARD,e.offset>0)}(t,e),t.emit("seek:queued",e),e))}function Gt(t,e){e.timer&&clearTimeout(e.timer),e.timer=e.offset=0,function(t){t.setState(Ut.FORWARD,!1),t.setState(Ut.BACKWARD,!1),t.setState("will-seek",!1)}(t)}function $t(t,e){const s=t._customElements.get(e);return s&&t.root.querySelector(s)||void 0}function Ht(){if("undefined"==typeof document)return!1;const t=document.documentElement;return t&&"rtl"==t.getAttribute("dir")}function Kt(...t){const e=document.createElement("div");return 0==t.length||e.classList.add(...t),e}function Vt(t,e,s){const r=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(e);for(;r.length;){if(null==t)return s;const e=r.shift();if("string"!=typeof e)return s;t=t[e]}return null==t?s:t}function qt(t){const e="number"==typeof t?t:parseInt(t,10);return(e>9?"":"0")+e}function jt(t){if(isNaN(t)||t>=Number.MAX_SAFE_INTEGER)return"";const e=t<0?"-":"";t=Math.round(Math.abs(t));const s=Math.floor(t/3600);let r=Math.floor(t/60);return t-=60*r,s>=1?(r-=60*s,e+s+":"+qt(r)+":"+qt(t)):e+qt(r)+":"+qt(t)}!function(t){t.FORWARD="forward",t.BACKWARD="backward"}(Ut||(Ut={}));const Wt=navigator.languages||[navigator.language];function Yt(t,e,s){const r={};return s=e.lang||s,t[s]&&(r[s]=t[s]),function(){try{return Wt.reduce((t,e)=>~e.indexOf("-")?t.concat(e,e.split("-")[0]):t.concat(e),[])}catch(t){return[]}}().forEach((function(e){t[e]&&!r[e]&&(r[e]=t[e])})),Object.values(r)}const zt=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Qt=()=>"undefined"==typeof crypto?"":zt.replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16));let Xt="";!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}}();const Jt=["touchstart","touchmove"];function Zt(t,e){const s=new CustomEvent(t,{detail:e,cancelable:!0});return e&&Object.defineProperty(s,"data",{get:()=>e}),s}function te(t,e,s){const r=Zt(e,s);return t.dispatchEvent(r),t}function ee(t,e,s){const r=Zt(e,s);return t.dispatchEvent(r),r}function se(t,e,s,r){Array.isArray(e)?e.forEach(e=>re(t,e,s,r)):re(t,e,s,r)}function re(t,e,s,r){if(i=e,!~Jt.indexOf(i))return t.addEventListener(e,s,r),t;var i;const n=Object.assign(r||{},{passive:!0});return t.addEventListener(e,s,n),t}function ie(t,e,s,r){return se(t,e,s,Object.assign(r||{},{once:!0}))}class PlayerStorage{constructor(t,e){this.implementation=t,e&&e.keys().forEach(t=>{"string"==typeof e.implementation[t]&&this.implementation.setItem(t,e.implementation[t])})}keys(){var t;const e=[];for(var s=0;s<this.implementation.length;s++)(null===(t=this.implementation.key(s))||void 0===t?void 0:t.startsWith("flowplayer/"))&&e.push(this.implementation.key(s));return e}removeItem(t){try{this.implementation.removeItem("flowplayer/"+t)}catch(t){}}getItem(t){try{return this.implementation.getItem("flowplayer/"+t)}catch(t){return null}}setItem(t,e){try{this.implementation.setItem("flowplayer/"+t,e)}catch(t){}}clear(){try{this.keys().forEach(t=>this.implementation.removeItem(t))}catch(t){}}get length(){try{return this.keys().length}catch(t){return 0}}key(t){try{return this.implementation.key(t)}catch(t){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(t){var e;return(null===(e=this.pairs.find(e=>e[0]===t))||void 0===e?void 0:e[1])||null}key(t){return this.pairs[t][0]||null}removeItem(t){this.pairs=this.pairs.filter(e=>e[0]!==t)}setItem(t,e){this.removeItem(t),this.pairs.push([t,e])}}const ne={preload:"auto",rtl:!1,controls:!0},ae=["muted","preload"];function oe(t,r,i){let n;i.live_state={dvr_window:void 0,get dvr(){return n},set dvr(e){n=e;const s=!(!t.live||e);i.hasState(it)!=s&&i.setState(it,s)}},i._storage=new PlayerStorage(["localStorage","sessionStorage"].map(t=>{try{const e=window[t];return e.getItem(""),e}catch(e){return console.debug(`Access to window.${t} denied, trying next option`),null}}).find(t=>!!t)||new InMemoryStorage),i.toJSON=function(){return{duration:i.duration,volume:i.volume,currentTime:i.currentTime,states:i.root.className}},i.setSrc=function(e){return xt(i,t,e,s())},i.playerState=i.playerState||{},i.setState=function(t,e){if(i.playerState[t]===!!e)return i;const s=Object.assign({},i.playerState,{[t]:e});return i.playerState=s,te(i,"state",i.playerState),i},i.createComponents=function(...t){return Array.from({length:t.length}).map((e,s)=>vt(this,t[s]))},i.hasState=function(t){return!!i.playerState[t]},i.transitionState=function(t,e,s){!i.hasState(t)&&i.hasState(e)||(s=0),s&&i.setState("is-toggling",!0),i.setState(e,!1),i.setState(t,!0),s&&setTimeout((function(){i.setState("is-toggling",!1)}),s)},i.emit=(t,e)=>(te(i,t,e),i),i.on=(t,e)=>(se(i,t,e),i),i.once=(t,e)=>(ie(i,t,e),i),i.off=(t,e)=>{var s,r;return s=t,r=e,i.removeEventListener(s,r),i},i.poll=(t,e)=>ee(i,t,e),i.togglePlay=function(t){return i.hasState("is-error")?Promise.reject():bt(i,0,t)},i.toggleMute=function(t){t=null==t?!i.muted:!!t,i.muted=t,i.muted||i.volume||(i.volume=1),te(i,"volumechange")},i.toggleDisable=function(t){t=null==t?!i.disabled:!!t,i.setState("is-disabled",t),i.disabled=t},i.destroy=function(){i.pause();const t=e.indexOf(i);~t&&e.splice(t,1),setTimeout((function(){i.setSrc([]),i.reaper&&i.reaper.clear(),te(i,S),i.setState("is-destroyed",!0)}),0)},i.setAttrs=function(t){return ae.forEach(e=>{if(!(e in t))return;const s=t[e];s?i.setAttribute(e,s.toString()):i.removeAttribute(e)}),i},i.opt=function(e,s){return s=void 0===s?Vt(ne,e):s,Vt(t,e,s)},i.i18n=function(t,e){if(!i.reaper)return"";const s=i.reaper.get("translations");return s?function t(e,s,r,i){return(i=i||0)>=e.length?r:Vt(e[i],s,t(e,s,r,i+1))}(s,t,e||""):e||""},i.setOpts=function(e){Object.assign(t,e),t.live&&!i.hasState(tt)&&(i.setState(it,!0),te(i,"live")),"disabled"in e&&void 0!==e.disabled&&i.toggleDisable(e.disabled),"muted"in e&&void 0!==e.muted&&i.toggleMute(e.muted),"dvr"in t&&(i.live_state.dvr=i.opt("dvr")),i.setState("is-rtl",i.opt("rtl",function(t){if(!t)return Ht();const e=t.getAttribute("dir");return e?"rtl"==e:Ht()}(r))),i.setState(tt,!!t.live),i.setState("has-poster","string"==typeof t.poster&&t.poster.length>0),i.setState("is-seekable",!!t.seekable),i.setState("no-controls",0==t.controls),r.style.backgroundImage=i.hasState("has-poster")?"url('"+t.poster+"')":"",te(i,L,t)},i.renderPlugin=function(t){ee(i,"renderplugin",t).defaultPrevented||i.root.appendChild(t)};const a={offset:0,timer:0};var o,l;l=a,(o=i).on(Nt,(function(){Gt(o,l)})),i.enqueueSeek=function(t){if(0!=i.opts.seekable&&!(1==i.opts.disabled&&t>0))return Bt(i,a,t)},i.deviceId=function(){return function(t){if(Xt)return Xt;try{const e=t.getItem("flowplayer/uuid");if(e)return e;const s=Qt();return t.setItem("flowplayer/uuid",s),s}catch(t){return Xt=Qt()}}(i._storage)}}function le(t,e){const s=e.querySelector("video"),r=s||(t._video_element_callback?t._video_element_callback(t):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,s||e.append(r),r}var de="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ce(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const s=t.flowplayer;return"function"==typeof s?(s(e),e):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(e)||s.extensions.push(e),e)}function ue(){return"undefined"!=typeof window?window:void 0!==de?de:{}}const he=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function fe(t,e){return!!~he.indexOf(t)||t.indexOf(e)===t.length-e.length}fe.check_whitelist=function(t){return!!~he.indexOf(t)};const ge="production";function pe(t,e){const s={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};e=e||{};try{r=mt(t),s.valid_jwt=!0}catch(t){}return s.raw=t,s.data=JSON.parse(r.c),s.exp=r.exp,e.require_valid_token&&pe.validate(s),s}function me(t){try{return pe.validate(t),{success:!0,message:""}}catch(t){return{success:!1,message:t.message}}}var ye;function ve(t){return{grant:t,is_granted:e=>(t&e)===e}}function Ee({root:t,video:e,data:s}){e&&e.destroy(),console.error(new Error(s.details||s.reason)),t.innerHTML="",t.classList.remove("flowplayer"),t.classList.add("flowplayer-fatal"),t.style.removeProperty("background-image");const r=document.createElement("h2");r.textContent="Playback Error";const i=document.createElement("p");i.textContent="Are you the site owner?";const n=document.createElement("a");n.classList.add("troubleshoot"),n.target="_blank",n.href="https://docs.flowplayer.com/troubleshooting/player#"+s.reason,n.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",t.append(r,i,n,a)}function Te(t){return e=>{setTimeout((function(){if(!e.defaultPrevented&&!e.prevented)return t(e)}),0)}}pe.validate=function(t){if("string"==typeof t&&(t=pe(t)),!t||!t.raw){if(fe.check_whitelist(window.location.hostname)||"dev"===ge.toString())return!0;throw new Error("No token provided in configuration")}if(!t.valid_jwt)throw new Error("Invalid token provided");const e=window.location.hostname,s=fe.bind(null,e);if("dev"!==ge.toString()&&t.data.domain&&t.data.domain.length&&!t.data.domain.some(s))throw new Error("Domain not allowed");if("dev"!==ge.toString()&&1e3*t.exp-Date.now()<0)throw new Error("Expired token");return!0},pe.id=function(t){if(t)return"string"==typeof t&&(t=pe(t)),t.data.id},function(t){t[t.ADS=2]="ADS",t[t.ANALYTICS=4]="ANALYTICS",t[t.NO_METERING=8]="NO_METERING",t[t.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",t[t.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(ye||(ye={})),ve.of=ve,ve.from_token=function(t){const e=pe(t,{require_valid_token:!0});return ve.of(e.data.acl)},ve.permissions=ye;function Se(t,e){if(!t.parentElement)return;const s=t.clientWidth/t.parentElement.clientWidth*100/2;t.style.left=e-s+"%",t.style.display="block"}function Ae(t,e){if(isNaN(t.duration))return;const s=t.buffered;s.length&&(e.style.width=Math.min(s.end(s.length-1)/t.duration*100,100)+"%")}function _e(t,e){t.style.width="0",e.style.display="none"}function Le(t,e){const s=t.seekable;if("object"!=typeof t.opts||0==s.length)return{head:0,tail:0};const r=we(t),i=e||t.live_state.dvr_window;return{head:r,tail:"number"!=typeof i||r-i<0?s.start(0):r-i}}function be(t){return t.opt("live",!1)||t.duration>=Number.MAX_SAFE_INTEGER}function Re(t){return isFinite(t.duration)?t.duration:0==t.seekable.length?0:Le(t).head}function we(t){var e;const s=t.seekable;return s.length?t.hasState("is-chromecast-playing")||!(null===(e=t.hls)||void 0===e?void 0:e.liveSyncPosition)?s.end(s.length-1):t.hls.liveSyncPosition:0}function ke(t){const e=t.currentTime,s=Le(t);return{progress:Math.min(100,Math.max(0,(e-s.tail)/(s.head-s.tail)*100)),is_live:e-s.head>=-10}}function De(t,e,s){if(!e.seekable||0==e.seekable.length)return;Se(s,t);const r=Le(e),i=(100-Math.max(0,Math.min(t,100)))/100*(r.head-r.tail);s.innerText="-"+jt(i)}function Ie(t){t.currentTime=Le(t).tail}function Ce(t){try{t.dvr_offset=0,t.currentTime=we(t)}catch(t){console.warn("failed to seek to now: %j",t)}}function Pe(t,e){t/=100,e.currentTime=function(t,e){if(e>1||e<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const s=Le(t);return s.tail+e*(s.head-s.tail)}(e,t)}function Me(t,e){t.style.width="0",e.style.display="none"}function Oe(t,e){const s=e.clientWidth;e.classList.toggle("is-small",s<600),e.classList.toggle("is-tiny",s<400)}function xe(t,e,s){let r=!0;e.classList.add("flowplayer"),Oe(0,e),se(s,f,()=>{if(!s.hasState(Q)&&!s.hasState(z)&&t.is_native&&"none"!==t.preload)return"metadata"===t.preload?(s.setState(Q,!0),s.emit(b)):void Rt(s)}),se(s,c,()=>{t.is_native&&"metadata"===t.preload&&s.paused&&s.emit(y)}),se(s,[f,"resize"],(function(){Oe(0,e)})),se(s,"state",(function(){Object.entries(s.playerState).forEach((function([t,s]){e.classList.toggle(t,s)}))})),se(s,"timeupdate",(function(){s.setState(et,!s.hasState("is-casting")&&!s.hasState(X)&&s.readyState<3)})),se(s,v,(function(e){const r=s.original_src;Te(()=>{if(r===s.original_src){if(s.setState(Z,!0),ie(s,"timeupdate",(function(){s.setState(Z,!1),r===s.original_src&&s.setState(X,!t.loop&&!!t.rewind&&s.paused)})),t.loop)return s.togglePlay(!0);t.rewind&&(s.currentTime=0)}})(e)})),se(s,[T,E],(function(t){s.setState(J,t.type==T)})),se(s,"remotesession:ended",(function(t){setTimeout(()=>{t.defaultPrevented||(s.currentTime=t.detail.currentTime)},0)})),se(s,v,(function(){s.setState(W,!1),r=!0})),se(s,h,()=>{if(!s.opts.live||!s.opts.is_native)return;const t=s.seekable;0!=t.length&&s.emit("dvr/window",t.end(t.length-1)-t.start(0))}),se(s,u,(function(){s.setState(z,!0),s.setState(Q,!1)})),se(s,"play",()=>{s.setState(nt,!0)}),se(s,[m,y,f],(function(e){if(!s.hasState(J)&&(e.type!=y||t.autoplay||s.setState(et,!1),e.type!=f||"none"!=s.opt("preload")||t.autoplay)){if(e.type==f&&t.autoplay)return ie(s,p,(function(){s.setState(et,!1)}));e.type!=m||s.hasState(z)||s.setState(Q,!0),s.setState(Z,!1),s.setState(et,e.type==m)}})),se(s,[p,g],(function(e){setTimeout(()=>{const t=new CustomEvent("flowplayer/"+e.type,{detail:s});document.dispatchEvent(t)},0);const i=e.type==p,n=s.currentTime==s.duration,a=i&&r&&t.autoplay||s.hasState(et);if(i&&(s.started=!0,r=!1),s.setState(et,!1).setState(nt,!1),!i&&s.setState(at,!1),n)return;const o=i?W:Y,l=i?Y:W;s.transitionState(o,l,a?0:300),!s.hasState(X)||s.root.classList.contains("ad-hide-first-frame")||s.root.classList.contains("preroll-ios")||Fe(s,t.start_time)}))}function Fe(t,e){if(!t.hasState(tt)||![void 0,0,-1].includes(e)||!t.seekable.length||t.hasState("has-casted"))return t.setState(X,!1);t.once(E,()=>t.setState(X,!1)),0===e?Ie(t):Ce(t)}const Ne=[0].concat(Array.from({length:100}).map((t,e)=>(e+1)/100));function Ue(t,e,s){if(!window.IntersectionObserver)return;const r={should_resume:!!t.autoplay,locked:!1};se(s,"play",(function(){r.locked||(r.should_resume=!0)}));const i=()=>{if(!t.autoplay)return;if(s.hasState(dt)&&r.should_resume)return s.togglePlay(!0);const e=s.currentSrc;t.autopause||s.hasState(dt)||!r.should_resume||ie(s,"viewenter",()=>{t.autoplay&&r.should_resume&&e===s.currentSrc&&s.togglePlay(!0)})},n=()=>{if(!t.autoplay)return;if(!t.is_native)return;if("auto"===t.preload)return;if(s.hasState(dt))return Rt(s);const e=s.currentSrc;ie(s,"viewenter",()=>{e!==s.currentSrc||s.readyState>1||!s.paused||Rt(s)})};se(s,"src",(function(){r.should_resume=!!t.autoplay,s.off(f,n),s.once(f,n),s.off(y,i),s.once(y,i)})),se(s,g,(function(){r.locked||(r.should_resume=!1)}));const a=new IntersectionObserver(t=>{t.forEach(t=>{setTimeout(()=>{const e=t.intersectionRatio,r=s.hasState(dt);if(s.setState(dt,e>=.2),s.emit("intersectionchange",{ratio:e}),r===s.hasState(dt))return;const i=s.hasState(dt)?"viewenter":"viewleave";s.emit(i)},0)})},{threshold:Ne});a.observe(e),s.on(S,()=>a.disconnect()),se(s,"viewenter",(function(){!r.should_resume||!t.autopause||Be()||s.opts.autoplay&&!s.readyState||s.togglePlay(!0)})),se(s,"viewleave",(function(){if(!t.autopause||Be())return;const e=!s.paused;r.locked=!0,s.pause(),setTimeout((function(){r.should_resume=e,r.locked=!1}),0)}))}function Be(){return e.find(t=>t.hasState("is-casting"))}function Ge(t,e){if(!window.ResizeObserver)return;const s=new ResizeObserver(t=>{const s=t[t.length-1];e.emit("resize",s)});s.observe(t),e.on(S,()=>s.disconnect())}function $e(t){if("number"==typeof t&&!isNaN(t))return Number(t);if("string"==typeof t){const e=t.split(":");return Number(e[1])/Number(e[0])}return t}function He(t,e,s){const r=!!t.ratio,i=document.createElement("div");i.classList.add("fp-ratio"),e.append(i);let n=$e(t.ratio||.5625);i.style.paddingTop=100*n+"%";const a=[u,c];s.on(a,(function(){if(r)return;const t=s.videoHeight&&s.videoWidth&&s.videoHeight/s.videoWidth;t&&s.setOpts({ratio:t})})),s.on(L,(function(){const e=s.videoHeight&&s.videoWidth&&s.videoHeight/s.videoWidth,r=$e((null==t?void 0:t.ratio)||e||.5625);n!==r&&(n=r,i.style.paddingTop=100*r+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(t,e,s){this.root=e,this.player=s,this.wireUp()}wireUp(){var t,e;this.cleanUp(),null===(t=this.player)||void 0===t||t.once(p,this.render),null===(e=this.player)||void 0===e||e.once(v,this.wireUp)}cleanUp(){var t,e,s,r;null===(e=null===(t=this._logo)||void 0===t?void 0:t.parentElement)||void 0===e||e.removeChild(this._logo),null===(s=this.player)||void 0===s||s.off(p,this.render),null===(r=this.player)||void 0===r||r.off(v,this.wireUp)}render(){var t,e,s;null===(e=null===(t=this._logo)||void 0===t?void 0:t.parentElement)||void 0===e||e.removeChild(this._logo);const r=(null===(s=this.root)||void 0===s?void 0:s.querySelector(".fp-ui"))||this.root;if(!r)return;const i=this._logo=document.createElement("a");i.href="https://explorer.flowplayer.com",i.target="_blank",Object.entries(Ke).forEach(([t,e])=>{i.style.setProperty(t,e,"important")}),r.appendChild(i)}}ExplorerPlan.pluginName="explorer-plan";const Ke={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Ve="flowplayer/"+p;function qe(t){const e=e=>{e.detail!==t&&!1===t.opt("multiplay")&&t.togglePlay(!1)};t.on(S,()=>document.removeEventListener(Ve,e)),document.addEventListener(Ve,e)}function je(t,e){const s=[];t.addEventListener("contextmenu",r=>{const i=r.timeStamp;for(s.push(i);s.length>3;)s.shift();s.length>=3&&s.every(t=>t-i<3e3)&&(console.debug("flowplayer/debug rendering info"),function(t,e){var s;!function(t){const e=t.querySelector(".debug-info");null==e||e.remove()}(t);const r=document.createElement("div");r.classList.add("debug-info");const i=We("flowplayer.version","3.28.2");r.append(i);const n=null===(s=null==e?void 0:e.hls)||void 0===s?void 0:s.constructor;if(n&&n.version){const t=We("hls.version",n.version);r.append(t)}t.appendChild(r)}(t,e))})}const We=(t,e)=>{const s=document.createElement("div");s.classList.add("row",t);const r=document.createElement("span");r.classList.add("attr"),r.textContent=t;const i=document.createElement("span");return i.textContent=e,i.classList.add("value"),s.append(r,i),s};function Ye(t,e){const s=function(){try{return localStorage.getItem("flowplayer/debug")}catch(t){return""}}(),r=(r,...i)=>{try{const n=(null==e?void 0:e.debug)||s;n&&t.match(n)&&console.log(`flowplayer/${t} -- ${r}`,...i)}catch(t){console.warn(t)}};return r.log=r,r}const ze="on",Qe="without_recovery",Xe="off";class FlowplayerError extends Error{static getErrorKey(t){return t in Lt?Lt[t]:Lt["00-00"]}constructor(t,e,s={}){super(t),this.message=t,this.flowplayerErrorCode=e,this.config=s,this.id=Qt(),this.isFatal=!!s.isFatal,this.errorKey=FlowplayerError.getErrorKey(this.flowplayerErrorCode)||"unknown"}toJSON(){return{message:this.message,flowplayer_error_code:this.flowplayerErrorCode,id:this.id,root_error_id:this.config.rootErrorId,resource:this.config.resource,is_fatal:this.isFatal,is_retry:!!this.config.isRetry}}}const Je=Ye("core/retry");function Ze(t,e){const s={pending:void 0,count:0};t.on(R,r=>{var i,n,a,o,l;const d=null===(i=r.detail)||void 0===i?void 0:i.error;d.config.isRetry=!!s.count,void 0===s.pending&&(null===(a=null===(n=d.config)||void 0===n?void 0:n.retryOpts)||void 0===a?void 0:a.retry)!==Xe&&(e.retry||(null===(l=null===(o=d.config)||void 0===o?void 0:o.retryOpts)||void 0===l?void 0:l.retry))&&(++s.count,s.pending=function(t,e,s){var r,i;return setTimeout(()=>{var r;t.hasState("is-destroyed")||(e.pending=void 0,(null===(r=s.config.retryOpts)||void 0===r?void 0:r.retry)!==Qe&&t.emit("recover"),t.emit("retry",{error:s}),Je("%s try",e.count))},null!==(i=null===(r=s.config.retryOpts)||void 0===r?void 0:r.retryTimeout)&&void 0!==i?i:3e3*e.count)}(t,s,d))}),t.on(p,()=>{s.count=0}),t.on(["src","recover"],t=>{"src"===t.type&&(s.count=0),clearTimeout(s.pending),s.pending=void 0}),t.on("retry",Te(()=>{t.load()}))}const ts="health:record",es="rebuffer",ss="rebuffer:ended",rs="insights:ttff",is="insights:time_to_first_frag_loaded",ns="insights:watched_interval";var as=Object.freeze({__proto__:null,RECORD:ts,REBUFFER:es,REBUFFER_ENDED:ss,DISPLAY:"display",TIME_TO_FIRST_FRAME:rs,TIME_TO_FIRST_FRAGMENT_LOADED:is,WATCHED_INTERVAL:ns});const os=[b,"error","src"];function ls(t){const e=document.createElement("a");return e.href=t,e}function ds(t){try{return!!new URL(t)}catch(t){return!1}}function cs(){try{return window.location.hostname!==window.parent.location.hostname?ls(document.referrer).hostname:document.location.hostname}catch(t){return window.location.hostname}}const us=navigator;function hs(t){var e,s;const r=null===(e=t.hls)||void 0===e?void 0:e.bandwidthEstimate;return r?1e-6*r:(null===(s=us.connection)||void 0===s?void 0:s.downlink)||-1}function fs(t,e){return async function(t,e){try{await fetch(t,{body:e,method:"POST",mode:"no-cors"})}catch(t){}}(t,JSON.stringify({events:e}))}const gs=t=>{switch(t){case!0:return St.ON;case!1:return St.OFF;default:return t}};function ps(){try{const t=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof t&&t.slice(0,200)}catch(t){return!1}}const ms=[],ys="https://ihi.flowplayer.com/v1/health/events";function vs(t){if(t.suspended)return;const e=ms.slice(0);ms.length=0,0!=e.length&&(t.logger.log(`:dispatch events={${e.length}}`),fs(function(){try{return"undefined"==typeof window?ys:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:ys}catch(t){return ys}}(),e))}async function Es(t,e,s){const r=await Ss();ms.push(Object.assign(e,r)),t.logger.log(":enqueue",e.event,e),ms.length<10&&!s||vs(t)}const Ts=()=>{var t,e;try{const s=window;return null===(e=null===(t=null==s?void 0:s.google)||void 0===t?void 0:t.ima)||void 0===e?void 0:e.VERSION}catch(t){return}},Ss=async()=>({client_time:Date.now()}),As=(t,e)=>Object.assign(t,{detail:e}),_s=(t,{event:e,media_session_id:s,session_id:r,play_range_id:i})=>({event:e,media_session_id:s,session_id:r,play_range_id:i,device_id:t.deviceId(),version:"3.28.2",commit:"4a1bfbd8cc190b9064b5dbb5e786f1b1229b7b94",ima_sdk_version:Ts(),preload:t.opt("preload"),autoplay:gs(t.opt("autoplay")),live:t.opt("live"),dvr:!!t.live_state.dvr,source:t.original_src,downlink_mbs:hs(t),page_url:ps(),player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id")||t.opt("metadata.stream_target_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token,plugins:t.plugins.map(t=>t.constructor.name).sort((t,e)=>t.localeCompare(e)),current_time:t.currentTime,external_media_id:t.opt("external_media_id")}),Ls=t=>({bitrate:null==t?void 0:t.bitrate,resolution:null==t?void 0:t.attrs.RESOLUTION,frame_rate:null==t?void 0:t.attrs["FRAME-RATE"]});function bs(t,e,s,r){const i=_s(e,t.eventInfo(s)),{before:n,after:a}=r;Es(t,((t,e,s)=>Object.assign(t,{state:{before:e,after:s}}))(i,Ls(n),Ls(a)))}const Rs=(t,e)=>{let s=null;return(...r)=>{null!==s&&(clearTimeout(s),s=null),s=setTimeout(()=>e(...r),t)}};const ws="ad-initialized";var ks,Ds=Object.freeze({__proto__:null,AD_INIT:ws,AD_PLAYBACK_ERROR:"ad-playback-error",AD_TEARDOWN:"ad-teardown",AD_VIDEOTAG_ATTACHED:"ad-videotag-attached",AD_BLOCKED:"ad-blocked",AD_REQUEST_ERROR:"ad-request-error",AD_REQUESTED:"ad-requested",AD_REQUEST_COMPLETED:"ad-request-completed",AD_PAUSE_CONTENT:"ad-pause-content",AD_STARTED:"ad-started",AD_COMPLETED:"ad-completed",AD_PAUSED:"ad-paused",AD_RESUMED:"ad-resumed",AD_WAITING:"ad-waiting",AD_PROGRESS:"ad-progress",AD_SKIPPED:"ad-skipped",AD_MUTED:"ad-muted",AD_VOLUME_CHANGED:"ad-volume-changed",AD_FULLSCREEN:"ad-fullscreen",AD_TIMEOUT:"ad-timeout",AD_BREAK_COMPLETED:"ad-break-completed",AD_POSTROLL_FINISHED:"ad-postroll-finished",AD_PREROLL_FINSIHED:"ad-preroll-finished",AD_MIDROLL_FINISHED:"ad-midroll-finished",VPAID_INIT:"vpaid-init",IMA_ADAPTER_INIT:"ad-ima-adapter-init",IMA_BEFORE_ADS_REQUEST:"ad-ima-before-ads-request",IMA_ADS_RENDERING_SETTINGS:"ad-ima-rendering-settings",ADAPTER_INIT_FAILED:"ad-adapter-init-failed",AD_PLAY_REQUESTED:"ad-play-requested",RELOAD_AD_REQUESTED:"reload-ad-requested",AD_ERROR:"ad-error",REQUEST_AD_PAUSE:"request/ad/pause",REQUEST_AD_PLAY:"request/ad/play",REQUEST_AD_MUTE_UNMUTE:"request/ad/muteunmute",AD_SHOW_FIRST_FRAME:"ad/show-first-frame",AD_RESIZE:"ad/resize",AD_SET_UI_FLAGS:"ad/set-ui-flags",PBJS_AVAILABLE:"ad/pbjs"});!function(t){t[t.Starting=0]="Starting",t[t.ConfigFinalized=1]="ConfigFinalized",t[t.TimerStartedWithAutoplay=2]="TimerStartedWithAutoplay",t[t.TimerStartedWithUserGesture=3]="TimerStartedWithUserGesture",t[t.MetricReported=4]="MetricReported"}(ks||(ks={}));const Is=[r,"touchend"];class TimeToFirstFrame{constructor(t=ks.Starting,e=!1){this.state=t,this.loadedAd=e}reset(){this.state=ks.Starting,this.loadedAd=!1,this.start=void 0,this.end=void 0,this.adDetails=void 0}adInfo(){const{ad_tag_id:t,vast_ad_id:e}=this.adDetails||{};return{ad_tag_id:t,vast_ad_id:e}}toJSON(){return Object.assign({ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round(this.end&&this.start?this.end-this.start:-1)},this.adInfo())}startTimer(t){this.state==ks.ConfigFinalized&&(this.state=t,this.start=performance.now())}hasStarted(){return[ks.TimerStartedWithAutoplay,ks.TimerStartedWithUserGesture].includes(this.state)}stopTimer(t){this.hasStarted()&&(this.end||(this.end=performance.now()),this.state=ks.MetricReported,t())}}function Cs(t){return Math.round(1e3*t)/1e3}class EWMA$1{constructor(t){this.tickInterval=t,this.ewma=0,this.startTime=Date.now()}decay(){const t=Date.now()-this.startTime;return Math.pow(2,-t/(4*this.tickInterval))}update(t){const e=this.decay();return this.ewma=e*this.ewma+(1-e)*t,this.ewma}toJSON(){return this.ewma}}const Ps={skipUnreliableSegments:!0};class WatchedState{constructor(t){this.player=t,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0,this.ewmaTickWatched=new EWMA$1(WatchedState.AccuracyMilliseconds)}reset(){this.onNotWatching(),this.watchedSum=0,this.lastReportedSum=0,this.lastWatchedPoint=void 0}onNotWatching(){this.marchingInterval&&(this.updateWatched(),this.marchingInterval=clearInterval(this.marchingInterval))}onWatching(){this.marchingInterval||(this.lastWatchedPoint=this.createWatchedPoint(),this.marchingInterval=setInterval(()=>{this.updateWatched()},WatchedState.AccuracyMilliseconds))}createWatchedPoint(){return{currentTime:this.player.currentTime,paused:this.player.paused}}updateWatched(){const t=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,t),this.lastWatchedPoint=t}calculateTimeWatched(t,e){var s,r;const i=e.currentTime-t.currentTime,n=this.ewmaTickWatched.update(i);if(!(i<0)&&!(!1!==(null===(r=null===(s=this.player.opts)||void 0===s?void 0:s.health)||void 0===r?void 0:r.skipUnreliableSegments)&&1e3*i>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=i,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const t=Cs(n),e={total_watched_seconds:Cs(this.watchedSum),tick_watched_seconds:t,batch_watched_seconds:Cs(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(ns,e)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const Ms=Qt();class Health{constructor(t,e){let s;this.session_id=Ms,this.suspended=!1,this.logger=Ye("health",e.opts),this.media_session_id=Qt(),this.play_range_id=Qt(),this.analyticsLoop=setInterval(()=>vs(this),2e3),e.on(S,()=>clearInterval(this.analyticsLoop)),e.on(p,()=>{s!==this.media_session_id&&(s=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=Qt()});let r=Date.now()-1e3;e.on("timeupdate",t=>{if(s!==this.media_session_id)return;const i=Date.now();if(i<r)return;r=Date.now()+5e3;const n=_s(e,this.eventInfo(t.type)),a=As(n,{duration:(o=e.duration,Number.isFinite(o)?o:o===1/0?-1:void 0)});var o;this.first_playing_event_timestamp&&(Object.assign(a,{ms_since_first_playing:i-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),Es(this,a)});const i=this;if(e.health={get media_session_id(){return i.media_session_id},set media_session_id(t){i.media_session_id=t},get session_id(){return i.session_id},set session_id(t){i.session_id=t},toggle(t){t?i.resume():i.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const e=e=>t.instances.forEach(t=>t.emit(e.type));document.addEventListener("visibilitychange",t=>{"hidden"==document.visibilityState&&e(t)}),window.addEventListener("pagehide",e)}}eventInfo(t){return{event:t,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>vs(this),2e3)}init(t,e,s){if(ps().toString().startsWith("data:"))return this.suspend();!function(t){let e=null;const s=()=>{e=null};t.on(m,(function(e){t.seeking||t.networkState===t.NETWORK_LOADING&&(t.readyState<HTMLMedi