UNPKG

@flowplayer/player

Version:
1 lines 87.4 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=t()}(this,(function(){"use strict";const e=[],t=[];function n(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),o=/^((?!chrome|android).)*safari/i.test(t),i=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),s=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),a=/edg/i.test(t),l=/opr|opera/i.test(t),c=/SamsungBrowser/.test(t),u=c&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:o,edge:a,opera:l,chrome:i,firefox:s,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:c,samsung_tv:c&&u,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const r="click",o="dblclick",i="mouseleave",s="mousemove",a="touchmove",l="fullscreenenter",c="fullscreenexit",u="loadedmetadata",d="loadeddata",p="progress",f="loadstart",h="pause",m="playing",y="waiting",g="canplay",v="ended",E="seeked",w="seeking",_="reap",S="landscape",b="portrait",k="config",N="content:loadstart";var T=Object.freeze({__proto__:null,MOUNT:"mount",RETRY:"retry",ERROR:"error",CONTEXT_MENU:"contextmenu",CLICK:r,DBL_CLICK:o,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:i,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:s,TOUCH_START:"touchstart",TOUCH_MOVE:a,TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:l,FULLSCREEN_EXIT:c,FULLSCREEN_CHANGE:"fullscreenchange",METADATA:u,DATA:d,PROGRESS:p,TIME_UPDATE:"timeupdate",LOAD_START:f,VOLUME_CHANGE:"volumechange",PAUSE:h,PLAYING:m,PLAY:"play",WAITING:y,CAN_PLAY:g,ENDED:v,SEEKED:E,SEEKING:w,DURATION_CHANGE:"durationchange",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",REAP:_,QUALITIES:"qualities",QUALITY_CHANGE:"qualitychange",VIDEO_TRACKS:"videoTracks",SET_QUALITY:"quality:set",VIDEO_TRACK_SELECT:"tracks:video:select",RECOMMENDATIONS_READY:"recommendationsready",LANDSCAPE:S,PORTRAIT:b,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:k,STATE:"state",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",CONTENT_REAL_LOAD_START:N,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",STANDARD_ERROR:"flowplayer:error"});const A="flowplayer-ui",O="flowplayer-logo",I="flowplayer-control",L="flowplayer-live-status",R="flowplayer-elapsed-time",C="flowplayer-timeline-bar",P="flowplayer-volume-bar",F="flowplayer-header",M="flowplayer-middle",D="flowplayer-middle-zone",U="flowplayer-wait",x="flowplayer-play-icon",H="flowplayer-pause-icon",q="flowplayer-rewind-icon",W="flowplayer-volume-icon";var G=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:A,LOGO:O,CONTROL:I,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:L,ELAPSED:R,TIMELINE:C,CHAPTERS_TIMELINE:"flowplayer-chapters-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:P,HEADER:F,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:M,MIDDLE_ZONE:D,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:"flowplayer-small-play-icon",SMALL_PAUSE_ICON:"flowplayer-small-pause-icon",PLAY_ICON:x,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:q,SHARE_ICON:"flowplayer-share-icon",SUBTITLES_MENU_ICON:"flowplayer-subs-menu-icon",MENU_BACK_ICON:"flowplayer-menu-back",VOLUME_ICON:W,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:"flowplayer-live-countdown",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 B="is-playing",V="is-paused",j="is-loaded",K="is-loading",z="is-starting",Q="is-seeking",Y="is-ended",X="is-live",Z="is-waiting",J="is-live-seeked",$="no-timeline",ee="will-play",te="will-pause",ne="is-touched",re="is-hovered",oe="is-in-viewport",ie="is-source-processing";var se=Object.freeze({__proto__:null,PLAYING:B,FULLSCREEN:"is-fullscreen",PAUSED:V,MUTED:"is-muted",LOADED:j,LOADING:K,STARTING:z,SEEKING:Q,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",TV:"is-tv",ENDED:Y,LIVE:X,ERRORED:"is-error",WAITING:Z,AUTOPLAY:"is-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:J,NO_DVR:$,HAS_POSTER:"has-poster",WILL_PLAY:ee,WILL_PAUSE:te,MENU_OPENED:"has-menu-opened",TOUCHED:ne,HOVERED:re,TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:oe,NO_CONTROLS:"no-controls",DESTROYED:"is-destroyed",IS_SOURCE_PROCESSING:ie});function ae(e){this.message=e}ae.prototype=new Error,ae.prototype.name="InvalidCharacterError";var le="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new ae("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,s="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?s+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};var ce=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(le(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return le(t)}};function ue(e){this.message=e}ue.prototype=new Error,ue.prototype.name="InvalidTokenError";var de=function(e,t){if("string"!=typeof e)throw new ue("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(ce(e.split(".")[n]))}catch(e){throw new ue("Invalid token specified: "+e.message)}};de.InvalidTokenError=ue;const pe=new Map,fe=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const r=window.customElements.get(t);if(!r)throw new Error(`no default flowplayer component with the name ${t} exists`);const o=window.customElements.get(n);return"function"!=typeof o?r:o})(e._customElements,t))(e),he=(e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)};var me,ye;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(me||(me={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(ye||(ye={}));const ge={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"},ve=Object.fromEntries(Object.entries(ge).map(([e,t])=>[t,e]));const Ee=e=>{return e.autoplay&&ye.AUDIO_REQUIRED&(!0===(t=e.autoplay)?ye.ON:!1===t?ye.OFF:t);var t};function we(e,t,n){const r="boolean"==typeof n;if("boolean"!=typeof n&&(n=!!e.hasState(te)||e.paused),function(e,t,n){const r=e.poll(t?"beforeplay":"beforepause",{forced:n});return r&&r.defaultPrevented}(e,n,r))return Promise.resolve();if(!n)return e.hasState(ee)?(e.setState(te,!0),e.setState(ee,!1),Promise.resolve()):Promise.resolve(e.pause());if(0==e.reaper)return Promise.resolve();const o=e.reaper.get("__pending_play");return e.paused||o?o?(o.src!==Se(e.original_src)&&_e(e),o):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==Se(e.original_src)}(e)&&_e(e),function(e){const t=e.hasState("is-autoplay"),n=t&&Ee(e.opts);n&&(e.muted&&e.toggleMute(!1),0==e.volume&&(e.volume=1));t&&e.setState("is-autoplay",!1);return e.play().then(()=>{e.hasState(te)&&e.togglePlay(!1)}).catch(r=>{if(console.warn(t?n?"[flowplayer/play] autoplay audio required\n%s":"[flowplayer/play] attempting muted autoplay\n%s":"",r.message,"\ninstance:",e),t&&!n)return e.muted=!0,e.play()})}(e)):(e.setState(te,!1),!e.hasState(B)&&e.setState(ee,!0),Promise.resolve())}function _e(e){e.opts.is_native&&(e.hasState(j)||(e.hasState(K)||e.emit(N),e.setState(K,!0),e.load()))}function Se(e){const t=document.createElement("a");return t.href=e,t.href}function be(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function ke(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function Ne(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const Te=e=>{var{src:t}=e,n=be(e,["src"]);return[Object.assign({src:t,type:t?Ne("video/"+ke(t)):""},n)]};function Ae(e){return Te({src:e})}function Oe(e){var{src:t,type:n}=e,r=be(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:Te(Object.assign({src:t},r))}var Ie;function Le(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?Ae(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=Ae(t)),"object"!=typeof t||Array.isArray(t)||(t=Oe(t)),e.concat(t)}),[]):Oe(e)}(n);return function(e){[Q,te,ee,B,V,K,j,J].forEach(t=>e.setState(t,!1)),e.setState(z,!0)}(e),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(Ie.Ok==function(e,t,n){e.emit("src",n),t.playback_token&&"string"==typeof n.src&&n.src.startsWith("https://")&&(n.src=function(e,t){const n=new URL(e);return n.pathname=`/pt:${t}${n.pathname}`,n.toString()}(n.src,t.playback_token));"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return e.setOpts({is_native:!r}),r?(r.onload(t,e.root,e,n),Ie.Ok):Ie.Err}(e,t,i)||Ie.Ok==function(e,t,n,r={safari:!1}){var o;/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return Ie.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return Ie.Err;"string"==typeof n.src&&(e.preload=null!==(o=t.preload)&&void 0!==o?o:"auto",e.src=n.src);return Ie.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Ie||(Ie={}));const Re=[_,w,"src","seek:cancel"];var Ce;function Pe(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?Fe(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,Fe(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Ce.BACKWARD,t.offset<0),e.setState(Ce.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Fe(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Ce.FORWARD,!1),e.setState(Ce.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Me(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function De(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Ue(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function xe(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function He(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+xe(r)+":"+xe(e)):t+xe(r)+":"+xe(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Ce||(Ce={}));const qe=navigator.languages||[navigator.language];function We(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return qe.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const Ge=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Be=()=>"undefined"==typeof crypto?"":Ge.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Ve="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const je=["touchstart","touchmove"];function Ke(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function ze(e,t,n){const r=Ke(t,n);return e.dispatchEvent(r),e}function Qe(e,t,n){const r=Ke(t,n);return e.dispatchEvent(r),r}function Ye(e,t,n,r){Array.isArray(t)?t.forEach(t=>Xe(e,t,n,r)):Xe(e,t,n,r)}function Xe(e,t,n,r){if(o=t,!~je.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function Ze(e,t,n,r){return Ye(e,t,n,Object.assign(r||{},{once:!0}))}class PlayerStorage{constructor(e,t){this.implementation=e,t&&t.keys().forEach(e=>{"string"==typeof t.implementation[e]&&this.implementation.setItem(e,t.implementation[e])})}keys(){var e;const t=[];for(var n=0;n<this.implementation.length;n++)(null===(e=this.implementation.key(n))||void 0===e?void 0:e.startsWith("flowplayer/"))&&t.push(this.implementation.key(n));return t}removeItem(e){try{this.implementation.removeItem("flowplayer/"+e)}catch(e){}}getItem(e){try{return this.implementation.getItem("flowplayer/"+e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem("flowplayer/"+e,t)}catch(e){}}clear(){try{this.keys().forEach(e=>this.implementation.removeItem(e))}catch(e){}}get length(){try{return this.keys().length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(e){var t;return(null===(t=this.pairs.find(t=>t[0]===e))||void 0===t?void 0:t[1])||null}key(e){return this.pairs[e][0]||null}removeItem(e){this.pairs=this.pairs.filter(t=>t[0]!==e)}setItem(e,t){this.removeItem(e),this.pairs.push([e,t])}}const Je={preload:"auto",rtl:!1,controls:!0},$e=["muted","preload"];function et(e,r,o){let i;o.live_state={dvr_window:void 0,get dvr(){return i},set dvr(t){i=t;const n=!(!e.live||t);o.hasState($)!=n&&o.setState($,n)}},o._storage=new PlayerStorage(["localStorage","sessionStorage"].map(e=>{try{const t=window[e];return t.getItem(""),t}catch(t){return console.debug(`Access to window.${e} denied, trying next option`),null}}).find(e=>!!e)||new InMemoryStorage),o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return Le(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return o.playerState=n,ze(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>fe(this,e[n]))},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){!o.hasState(e)&&o.hasState(t)||(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.emit=(e,t)=>(ze(o,e,t),o),o.on=(e,t)=>(Ye(o,e,t),o),o.once=(e,t)=>(Ze(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>Qe(o,e,t),o.togglePlay=function(e){return o.hasState("is-error")?Promise.reject():we(o,0,e)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),ze(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),ze(o,_),o.setState("is-destroyed",!0)}),0)},o.setAttrs=function(e){return $e.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?Ue(Je,t):n,Ue(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:Ue(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),e.live&&!o.hasState(X)&&(o.setState($,!0),ze(o,"live")),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted),"dvr"in e&&(o.live_state.dvr=o.opt("dvr")),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Me();const t=e.getAttribute("dir");return t?"rtl"==t:Me()}(r))),o.setState(X,!!e.live),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),o.setState("no-controls",0==e.controls),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",ze(o,k,e)},o.renderPlugin=function(e){Qe(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const s={offset:0,timer:0};var a,l;l=s,(a=o).on(Re,(function(){Fe(a,l)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return Pe(o,s,e)},o.deviceId=function(){return function(e){if(Ve)return Ve;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=Be();return e.setItem("flowplayer/uuid",n),n}catch(e){return Ve=Be()}}(o._storage)}}function tt(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}var nt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function rt(){return"undefined"!=typeof window?window:void 0!==nt?nt:{}}const ot=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function it(e,t){return!!~ot.indexOf(e)||e.indexOf(t)===e.length-t.length}it.check_whitelist=function(e){return!!~ot.indexOf(e)};const st="production";function at(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=de(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&at.validate(n),n}function lt(e){try{return at.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var ct;function ut(e){return{grant:e,is_granted:t=>(e&t)===t}}function dt({root:e,video:t,data:n}){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const r=document.createElement("h2");r.textContent="Playback Error";const o=document.createElement("p");o.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://docs.flowplayer.com/troubleshooting/player#"+n.reason,i.textContent="Troubleshoot?";const s=document.createElement("img");s.src="https://flowplayer.com/user/pages/images/logo-white.png",e.append(r,o,i,s)}function pt(e){return t=>{setTimeout((function(){if(!t.defaultPrevented&&!t.prevented)return e(t)}),0)}}at.validate=function(e){if("string"==typeof e&&(e=at(e)),!e||!e.raw){if(it.check_whitelist(window.location.hostname)||"dev"===st.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=it.bind(null,t);if("dev"!==st.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==st.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},at.id=function(e){if(e)return"string"==typeof e&&(e=at(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(ct||(ct={})),ut.of=ut,ut.from_token=function(e){const t=at(e,{require_valid_token:!0});return ut.of(t.data.acl)},ut.permissions=ct;function ft(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function ht(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function mt(e,t){e.style.width="0",t.style.display="none"}function yt(e,t){const n=e.seekable;if("object"!=typeof e.opts||0==n.length)return{head:0,tail:0};const r=Et(e),o=t||e.live_state.dvr_window;return{head:r,tail:"number"!=typeof o||r-o<0?n.start(0):r-o}}function gt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function vt(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:yt(e).head}function Et(e){var t;const n=e.seekable;return n.length?e.hasState("is-chromecast-playing")||!(null===(t=e.hls)||void 0===t?void 0:t.liveSyncPosition)?n.end(n.length-1):e.hls.liveSyncPosition:0}function wt(e,t,n){if(!t.seekable||0==t.seekable.length)return;ft(n,e);const r=yt(t),o=(100-Math.max(0,Math.min(e,100)))/100*(r.head-r.tail);n.innerText="-"+He(o)}function _t(e){e.currentTime=yt(e).tail}function St(e){try{e.dvr_offset=0,e.currentTime=Et(e)}catch(e){console.warn("failed to seek to now: %j",e)}}function bt(e,t){e/=100,t.currentTime=function(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const n=yt(e);return n.tail+t*(n.head-n.tail)}(t,e)}function kt(e,t){e.style.width="0",t.style.display="none"}function Nt(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Tt(e,t,n){let r=!0;t.classList.add("flowplayer"),Nt(0,t),Ye(n,f,()=>{if(!n.hasState(K)&&!n.hasState(j)&&e.is_native&&"none"!==e.preload)return"metadata"===e.preload?(n.setState(K,!0),n.emit(N)):void _e(n)}),Ye(n,u,()=>{e.is_native&&"metadata"===e.preload&&n.paused&&n.emit(g)}),Ye(n,[f,"resize"],(function(){Nt(0,t)})),Ye(n,"state",(function(){Object.entries(n.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),Ye(n,"timeupdate",(function(){n.setState(Z,!n.hasState("is-casting")&&!n.hasState(z)&&n.readyState<3)})),Ye(n,v,(function(t){const r=n.original_src;pt(()=>{if(r===n.original_src){if(n.setState(Y,!0),Ze(n,"timeupdate",(function(){n.setState(Y,!1),r===n.original_src&&n.setState(z,!e.loop&&!!e.rewind&&n.paused)})),e.loop)return n.togglePlay(!0);e.rewind&&(n.currentTime=0)}})(t)})),Ye(n,[w,E],(function(e){n.setState(Q,e.type==w)})),Ye(n,"remotesession:ended",(function(e){setTimeout(()=>{e.defaultPrevented||(n.currentTime=e.detail.currentTime)},0)})),Ye(n,v,(function(){n.setState(B,!1),r=!0})),Ye(n,p,()=>{if(!n.opts.live||!n.opts.is_native)return;const e=n.seekable;0!=e.length&&n.emit("dvr/window",e.end(e.length-1)-e.start(0))}),Ye(n,d,(function(){n.setState(j,!0),n.setState(K,!1)})),Ye(n,"play",()=>{n.setState(ee,!0)}),Ye(n,[y,g,f],(function(t){if(!n.hasState(Q)&&(t.type!=g||e.autoplay||n.setState(Z,!1),t.type!=f||"none"!=n.opt("preload")||e.autoplay)){if(t.type==f&&e.autoplay)return Ze(n,m,(function(){n.setState(Z,!1)}));t.type!=y||n.hasState(j)||n.setState(K,!0),n.setState(Y,!1),n.setState(Z,t.type==y)}})),Ye(n,[m,h],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const o=t.type==m,i=n.currentTime==n.duration,s=o&&r&&e.autoplay||n.hasState(Z);if(o&&(n.started=!0,r=!1),n.setState(Z,!1).setState(ee,!1),!o&&n.setState(te,!1),i)return;const a=o?B:V,l=o?V:B;n.transitionState(a,l,s?0:300),!n.hasState(z)||n.root.classList.contains("ad-hide-first-frame")||n.root.classList.contains("preroll-ios")||function(e,t){if(!e.hasState(X)||![void 0,0,-1].includes(t)||!e.seekable.length||e.hasState("has-casted"))return e.setState(z,!1);e.once(E,()=>e.setState(z,!1)),0===t?_t(e):St(e)}(n,e.start_time)}))}const At=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function Ot(e,t,n){if(!window.IntersectionObserver)return;const r={should_resume:!!e.autoplay,locked:!1};Ye(n,"play",(function(){r.locked||(r.should_resume=!0)}));const o=()=>{if(!e.autoplay)return;if(n.hasState(oe)&&r.should_resume)return n.togglePlay(!0);const t=n.currentSrc;e.autopause||n.hasState(oe)||!r.should_resume||Ze(n,"viewenter",()=>{e.autoplay&&r.should_resume&&t===n.currentSrc&&n.togglePlay(!0)})},i=()=>{if(!e.autoplay)return;if(!e.is_native)return;if("auto"===e.preload)return;if(n.hasState(oe))return _e(n);const t=n.currentSrc;Ze(n,"viewenter",()=>{t!==n.currentSrc||n.readyState>1||!n.paused||_e(n)})};Ye(n,"src",(function(){r.should_resume=!!e.autoplay,n.off(f,i),n.once(f,i),n.off(g,o),n.once(g,o)})),Ye(n,h,(function(){r.locked||(r.should_resume=!1)}));const s=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,r=n.hasState(oe);if(n.setState(oe,t>=.2),n.emit("intersectionchange",{ratio:t}),r===n.hasState(oe))return;const o=n.hasState(oe)?"viewenter":"viewleave";n.emit(o)},0)})},{threshold:At});s.observe(t),n.on(_,()=>s.disconnect()),Ye(n,"viewenter",(function(){!r.should_resume||!e.autopause||It()||n.opts.autoplay&&!n.readyState||n.togglePlay(!0)})),Ye(n,"viewleave",(function(){if(!e.autopause||It())return;const t=!n.paused;r.locked=!0,n.pause(),setTimeout((function(){r.should_resume=t,r.locked=!1}),0)}))}function It(){return t.find(e=>e.hasState("is-casting"))}function Lt(e,t){if(!window.ResizeObserver)return;const n=new ResizeObserver(e=>{const n=e[e.length-1];t.emit("resize",n)});n.observe(e),t.on(_,()=>n.disconnect())}function Rt(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function Ct(e,t,n){const r=!!e.ratio,o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let i=Rt(e.ratio||.5625);o.style.paddingTop=100*i+"%";const s=[d,u];n.on(s,(function(){if(r)return;const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(k,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,r=Rt((null==e?void 0:e.ratio)||t||.5625);i!==r&&(i=r,o.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(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(m,this.render),null===(t=this.player)||void 0===t||t.once(v,this.wireUp)}cleanUp(){var e,t,n,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(m,this.render),null===(r=this.player)||void 0===r||r.off(v,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const r=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!r)return;const o=this._logo=document.createElement("a");o.href="https://explorer.flowplayer.com",o.target="_blank",Object.entries(Pt).forEach(([e,t])=>{o.style.setProperty(e,t,"important")}),r.appendChild(o)}}ExplorerPlan.pluginName="explorer-plan";const Pt={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)"},Ft="flowplayer/"+m;function Mt(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(_,()=>document.removeEventListener(Ft,t)),document.addEventListener(Ft,t)}function Dt(e,t){const n=[];e.addEventListener("contextmenu",r=>{const o=r.timeStamp;for(n.push(o);n.length>3;)n.shift();n.length>=3&&n.every(e=>e-o<3e3)&&(console.debug("flowplayer/debug rendering info"),function(e,t){var n;!function(e){const t=e.querySelector(".debug-info");null==t||t.remove()}(e);const r=document.createElement("div");r.classList.add("debug-info");const o=Ut("flowplayer.version","3.28.2");r.append(o);const i=null===(n=null==t?void 0:t.hls)||void 0===n?void 0:n.constructor;if(i&&i.version){const e=Ut("hls.version",i.version);r.append(e)}e.appendChild(r)}(e,t))})}const Ut=(e,t)=>{const n=document.createElement("div");n.classList.add("row",e);const r=document.createElement("span");r.classList.add("attr"),r.textContent=e;const o=document.createElement("span");return o.textContent=t,o.classList.add("value"),n.append(r,o),n};function xt(e,t){const n=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),r=(r,...o)=>{try{const i=(null==t?void 0:t.debug)||n;i&&e.match(i)&&console.log(`flowplayer/${e} -- ${r}`,...o)}catch(e){console.warn(e)}};return r.log=r,r}const Ht="without_recovery",qt="off";class FlowplayerError extends Error{static getErrorKey(e){return e in ve?ve[e]:ve["00-00"]}constructor(e,t,n={}){super(e),this.message=e,this.flowplayerErrorCode=t,this.config=n,this.id=Be(),this.isFatal=!!n.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 Wt=xt("core/retry");function Gt(e,t){const n={pending:void 0,count:0};e.on("flowplayer:error",r=>{var o,i,s,a,l;const c=null===(o=r.detail)||void 0===o?void 0:o.error;c.config.isRetry=!!n.count,void 0===n.pending&&(null===(s=null===(i=c.config)||void 0===i?void 0:i.retryOpts)||void 0===s?void 0:s.retry)!==qt&&(t.retry||(null===(l=null===(a=c.config)||void 0===a?void 0:a.retryOpts)||void 0===l?void 0:l.retry))&&(++n.count,n.pending=function(e,t,n){var r,o;return setTimeout(()=>{var r;e.hasState("is-destroyed")||(t.pending=void 0,(null===(r=n.config.retryOpts)||void 0===r?void 0:r.retry)!==Ht&&e.emit("recover"),e.emit("retry",{error:n}),Wt("%s try",t.count))},null!==(o=null===(r=n.config.retryOpts)||void 0===r?void 0:r.retryTimeout)&&void 0!==o?o:3e3*t.count)}(e,n,c))}),e.on(m,()=>{n.count=0}),e.on(["src","recover"],e=>{"src"===e.type&&(n.count=0),clearTimeout(n.pending),n.pending=void 0}),e.on("retry",pt(()=>{e.load()}))}const Bt="rebuffer",Vt="rebuffer:ended",jt="insights:ttff",Kt="insights:time_to_first_frag_loaded",zt="insights:watched_interval";var Qt=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:Bt,REBUFFER_ENDED:Vt,DISPLAY:"display",TIME_TO_FIRST_FRAME:jt,TIME_TO_FIRST_FRAGMENT_LOADED:Kt,WATCHED_INTERVAL:zt});const Yt=[N,"error","src"];function Xt(e){try{return!!new URL(e)}catch(e){return!1}}const Zt=navigator;function Jt(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=Zt.connection)||void 0===n?void 0:n.downlink)||-1}function $t(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}const en=e=>{switch(e){case!0:return ye.ON;case!1:return ye.OFF;default:return e}};function tn(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const nn=[],rn="https://ihi.flowplayer.com/v1/health/events";function on(e){if(e.suspended)return;const t=nn.slice(0);nn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),$t(function(){try{return"undefined"==typeof window?rn:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:rn}catch(e){return rn}}(),t))}async function sn(e,t,n){const r=await ln();nn.push(Object.assign(t,r)),e.logger.log(":enqueue",t.event,t),nn.length<10&&!n||on(e)}const an=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},ln=async()=>({client_time:Date.now()}),cn=(e,t)=>Object.assign(e,{detail:t}),un=(e,{event:t,media_session_id:n,session_id:r,play_range_id:o})=>({event:t,media_session_id:n,session_id:r,play_range_id:o,device_id:e.deviceId(),version:"3.28.2",commit:"4a1bfbd8cc190b9064b5dbb5e786f1b1229b7b94",ima_sdk_version:an(),preload:e.opt("preload"),autoplay:en(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:Jt(e),page_url:tn(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id")||e.opt("metadata.stream_target_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),dn=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function pn(e,t,n,r){const o=un(t,e.eventInfo(n)),{before:i,after:s}=r;sn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,dn(i),dn(s)))}const fn=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}};var hn;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAutoplay=2]="TimerStartedWithAutoplay",e[e.TimerStartedWithUserGesture=3]="TimerStartedWithUserGesture",e[e.MetricReported=4]="MetricReported"}(hn||(hn={}));const mn=[r,"touchend"];class TimeToFirstFrame{constructor(e=hn.Starting,t=!1){this.state=e,this.loadedAd=t}reset(){this.state=hn.Starting,this.loadedAd=!1,this.start=void 0,this.end=void 0,this.adDetails=void 0}adInfo(){const{ad_tag_id:e,vast_ad_id:t}=this.adDetails||{};return{ad_tag_id:e,vast_ad_id:t}}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(e){this.state==hn.ConfigFinalized&&(this.state=e,this.start=performance.now())}hasStarted(){return[hn.TimerStartedWithAutoplay,hn.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){this.hasStarted()&&(this.end||(this.end=performance.now()),this.state=hn.MetricReported,e())}}function yn(e){return Math.round(1e3*e)/1e3}class EWMA{constructor(e){this.tickInterval=e,this.ewma=0,this.startTime=Date.now()}decay(){const e=Date.now()-this.startTime;return Math.pow(2,-e/(4*this.tickInterval))}update(e){const t=this.decay();return this.ewma=t*this.ewma+(1-t)*e,this.ewma}toJSON(){return this.ewma}}const gn={skipUnreliableSegments:!0};class WatchedState{constructor(e){this.player=e,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0,this.ewmaTickWatched=new EWMA(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 e=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,e),this.lastWatchedPoint=e}calculateTimeWatched(e,t){var n,r;const o=t.currentTime-e.currentTime,i=this.ewmaTickWatched.update(o);if(!(o<0)&&!(!1!==(null===(r=null===(n=this.player.opts)||void 0===n?void 0:n.health)||void 0===r?void 0:r.skipUnreliableSegments)&&1e3*o>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=o,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const e=yn(i),t={total_watched_seconds:yn(this.watchedSum),tick_watched_seconds:e,batch_watched_seconds:yn(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(zt,t)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const vn=Be();class Health{constructor(e,t){let n;this.session_id=vn,this.suspended=!1,this.logger=xt("health",t.opts),this.media_session_id=Be(),this.play_range_id=Be(),this.analyticsLoop=setInterval(()=>on(this),2e3),t.on(_,()=>clearInterval(this.analyticsLoop)),t.on(m,()=>{n!==this.media_session_id&&(n=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=Be()});let r=Date.now()-1e3;t.on("timeupdate",e=>{if(n!==this.media_session_id)return;const o=Date.now();if(o<r)return;r=Date.now()+5e3;const i=un(t,this.eventInfo(e.type)),s=cn(i,{duration:(a=t.duration,Number.isFinite(a)?a:a===1/0?-1:void 0)});var a;this.first_playing_event_timestamp&&(Object.assign(s,{ms_since_first_playing:o-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),sn(this,s)});const o=this;if(t.health={get media_session_id(){return o.media_session_id},set media_session_id(e){o.media_session_id=e},get session_id(){return o.session_id},set session_id(e){o.session_id=e},toggle(e){e?o.resume():o.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,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(()=>on(this),2e3)}init(e,t,n){if(tn().toString().startsWith("data:"))return this.suspend();!function(e){let t=null;const n=()=>{t=null};e.on(y,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e.emit(Bt))})),e.on(Bt,e=>{t=e}),e.on(g,r=>{if(t){const o=r.timeStamp-t.timeStamp;if(n(),o<31)return;if(o>3e5)return;e.emit(Vt,{rebuffer_duration:o/1e3})}}),Yt.forEach(t=>e.on(t,n))}(n),function(e){let t;[g,N].forEach(n=>{e.on(n,n=>{const r=Date.now();switch(n.type){case N:return t=r;case g:if(t)return e.emit(Kt,{ms_since_loading_started:r-t}),t=null}})})}(n),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on("src",()=>{if(!e.opt("metadata.media_id"))return t.reset();t.reset(),t.state=hn.ConfigFinalized}),e.on(N,()=>{(e.root.classList.contains("ad-hide-first-frame")||e.opt("autoplay"))&&t.startTimer(hn.TimerStartedWithAutoplay)}),mn.forEach(n=>{e.on(n,()=>{e.opt("autoplay")||t.startTimer(hn.TimerStartedWithUserGesture)})}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on("timeupdate",()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA)){if(e.root.classList.contains("ad-hide-first-frame"))return!t.end&&(t.end=performance.now());switch(t.state){case hn.TimerStartedWithAutoplay:case hn.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(jt,t.toJSON()))}}}),e.on("ad-started",n=>{switch(t.end=void 0,t.adDetails=n.detail,t.state){case hn.TimerStartedWithAutoplay:case hn.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(jt,t.toJSON()))}})}(n),function(e){const t=new WatchedState(e);e.on(N,()=>t.reset()),e.on(m,()=>t.onWatching()),e.on(Vt,()=>!e.paused&&t.onWatching()),e.on(Bt,()=>t.onNotWatching()),e.on(h,()=>t.onNotWatching()),e.on(w,()=>t.onNotWatching()),e.on(v,()=>t.updateWatched()),e.on("visibilitychange",()=>t.updateWatched())}(n),n.on("display",e=>{sn(this,un(n,this.eventInfo(e.type)),!0)}),n.on("health:record",({detail:e})=>{const t=un(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),sn(this,t)}),[f,u,d,p,y,Bt].forEach(e=>{n.on(e,e=>{sn(this,un(n,this.eventInfo(e.type)))})}),[Vt,jt,Kt,zt].forEach(e=>{n.on(e,e=>{const t=un(n,this.eventInfo(e.type));sn(this,Object.assign(t,e.detail))})}),[m,h,w,E,v,l,c,g,N].forEach(e=>{n.on(e,e=>{sn(this,un(n,this.eventInfo(e.type)))})}),n.on("volumechange",fn(800,e=>{const t=un(n,this.eventInfo(e.type));sn(this,cn(t,{volume:parseFloat(n.vol