@castlabs/prestoplay 6.33.0 → 6.34.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +19 -19
  5. package/cjs/cl.cast.js +129 -129
  6. package/cjs/cl.conviva.js +32 -32
  7. package/cjs/cl.core.js +633 -624
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +101 -101
  10. package/cjs/cl.externs.js +48 -72
  11. package/cjs/cl.freewheel.js +26 -26
  12. package/cjs/cl.hls.js +76 -76
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +30 -30
  15. package/cjs/cl.ima.js +26 -26
  16. package/cjs/cl.mediatailor.js +3 -3
  17. package/cjs/cl.mse.js +357 -353
  18. package/cjs/cl.muxdata.js +14 -14
  19. package/cjs/cl.onboard.js +4 -5
  20. package/cjs/cl.persistent.js +14 -14
  21. package/cjs/cl.playlist.js +6 -6
  22. package/cjs/cl.simid.js +16 -16
  23. package/cjs/cl.smooth.js +71 -71
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +73 -73
  26. package/cjs/cl.ttml.js +29 -29
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +12 -12
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.yospace.js +4 -4
  32. package/cjs/cl.youbora.js +36 -36
  33. package/cl.adobe.js +3 -3
  34. package/cl.airplay.js +3 -3
  35. package/cl.broadpeak.js +14 -14
  36. package/cl.cast.js +100 -100
  37. package/cl.conviva.js +27 -27
  38. package/cl.core.js +510 -502
  39. package/cl.crypto.js +9 -9
  40. package/cl.dash.js +90 -90
  41. package/cl.externs.js +51 -63
  42. package/cl.freewheel.js +20 -20
  43. package/cl.hls.js +82 -82
  44. package/cl.hlssmpte.js +5 -5
  45. package/cl.htmlcue.js +26 -26
  46. package/cl.ima.js +20 -20
  47. package/cl.mediatailor.js +2 -2
  48. package/cl.mse.js +308 -306
  49. package/cl.muxdata.js +13 -13
  50. package/cl.onboard.js +5 -5
  51. package/cl.persistent.js +10 -10
  52. package/cl.playlist.js +5 -5
  53. package/cl.simid.js +14 -14
  54. package/cl.smooth.js +61 -61
  55. package/cl.thumbnails.js +19 -19
  56. package/cl.tizen.js +57 -57
  57. package/cl.ttml.js +22 -22
  58. package/cl.verimatrix.js +4 -4
  59. package/cl.vimond.js +8 -8
  60. package/cl.vr.js +14 -14
  61. package/cl.vtt.js +12 -12
  62. package/cl.yospace.js +3 -3
  63. package/cl.youbora.js +31 -31
  64. package/package.json +1 -1
  65. package/typings.d.ts +33 -46
package/cl.cast.js CHANGED
@@ -1,103 +1,103 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var RU="Cannot seek during ads playout.",SU="Cannot switch track",TU="Media session does not exist.",UU="No receivers available",VU="QUEUE_ITEM_CHANGED",WU="Reset ABR functionality not available on cast.",XU="SDK not yet ready",YU="Sender is destroyed.",ZU="clpp.cast.CastProxy",$U="clpp.cast.Player",aV="clpp.cast.Receiver",bV="urn:x-cast:castlabs",cV="urn:x-cast:castlabs:int",dV="urn:x-cast:com.google.cast.media",eV="volume control is not supported",fV=function(a){return _.v(function*(){yield _.Qn(a,
2
- _.Ie);yield _.Qn(a,_.He)})},gV=function(a){return JSON.stringify(a,(b,c)=>{if("license"!==b&&typeof c!==_.Xd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.De?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.r?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},hV=function(a){if(typeof a!==_.Pf)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},iV=function(a,b){const c=
3
- new Set(b);return Object.keys(a).reduce((d,e)=>{c.has(e)&&(d[e]=a[e]);return d},{})},jV=function(a,b,c,d){return _.v(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.Fr(d,a.mimeType,g);f&&g&&(h=_.sk(a.url),(h=yield c.fetch(h).V)&&h.data&&(e=f.a(_.G(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},kV=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=
4
- chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.sg:return d.FMP4;case _.rg:return b===_.R?d.MPEG2_TS:c.TS;case _.Bc:return c.AAC;case _.Cc:return c.AC3;case _.Dc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Ec:return c.FMP4}},mV=function(a){a=void 0===a?lV:a;var b=cast.framework.messages||
5
- chrome.cast.media;if(!b)throw new _.I(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},nV=function(){return Math.round(1E3*Math.random())},oV=function(a,b){return a.h.filter(c=>
6
- c.type===b)},qV=function(a,b){const c=pV(a);return oV(a,b).find(d=>c.includes(d.id))||null},sV=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.P){const e=a.ua();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,()=>{a.f[b]=null;rV(a,b)},e=>{a.f[b]=null;a.g.debug(SU,e)})}else b===_.P&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{rV(a,b)},e=>{a.g.debug(SU,e)}))},pV=function(a){a=a.a?a.a.a:null;return(a?
7
- a.activeTrackIds||[]:[]).map(b=>b.toString())},rV=function(a,b){b===_.Q?a.a.trigger(new _.H(_.Hc)):b===_.P&&a.a.trigger(new _.H(_.Xf))},xV=function(a){if(a){for(const b of tV)uV(b);vV=!0;for(const b of wV)b()}},uV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.S.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.F.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,
8
- a.Aa.bind(a));a.F.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Kb.bind(a));a.f=!0;a.L.resolve();a.w.Hf();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);yV&&a.w.la(.02)}},zV=function(a){return _.v(function*(){a.F.release();
9
- tV.delete(a);if(a.f){a.f=!1;var b=cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}b=[];a.h&&(b.push(a.h.destroy()),a.h=null);a.l&&(b.push(a.l.destroy()),a.l=null);yield Promise.all(b);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.R=null;a.Z=null})},AV=function(a){return _.v(function*(){a.ya()||(yield cast.framework.CastContext.getInstance().requestSession())})},
10
- CV=function(a,b,c){c=void 0===c?0:c;return _.v(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield BV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),qf:a.getPresentationStartTime(),autoplay:b,Fa:a.j})})},BV=function(a,b){return _.v(function*(){if(a.f){var c=chrome.cast.media.StreamType;yield AV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
11
- b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.nb;e.hlsVideoSegmentFormat=kV(b.jc,_.R);e.hlsSegmentFormat=kV(c,_.Q);b.Fa&&(a.J&&(c=yield Promise.resolve(a.J(b.Fa)))&&(b.Fa=c),a.j=b.Fa,a.C=_.$m(a.j),a.B=a.C.findIndex(k=>k.url===b.source.url),b.Fa.remoteTextTracks&&(c=yield Promise.all(b.Fa.remoteTextTracks.map(a.ab.bind(a))),e.tracks=c.filter(k=>k),b.Fa.remoteTextTracks=void 0),delete b.Fa.autoplay,b.Fa.startTime=null,e.customData={playerConfiguration:gV(b.Fa)});c=a.Mb()||{};var f=DV(c.metadataType),
12
- g;typeof b.qf===_.r&&(g={metadataType:f,sectionStartAbsoluteTime:b.qf});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=EV(c);if(g=FV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);(g=b.queueData)&&g.items&&0<g.items.length&&(h=new chrome.cast.media.QueueData,h.items=g.items,h.startIndex=g.startIndex,e.queueData=h);typeof b.autoplay===_.Kc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.r&&(e.currentTime=b.currentTime);yield d.loadMedia(e);null!=b.Fa.muted&&
13
- a.setMuted(b.Fa.muted);null!=b.Fa.volume&&a.setVolume(b.Fa.volume)}}})},FV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(GV);for(const d of c){const [e,f]=d;if(f===b){b=e;break a}}b=null}if(!b)return null;b=mV(GV[b]);return Object.assign(b,a)},DV=function(a){var b=void 0===b?lV:b;return Object.values(GV).includes(a)?a:b},EV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},IV=function(a,b){HV(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,
14
- a.W);b.addMessageListener(bV,a.P);b.addMessageListener(cV,a.U)},JV=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.r?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},HV=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.H(_.ne)))},MV=function(a){return new KV(a.h,()=>{a.trigger(new _.H(_.Qc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&
15
- (d.ima.playAdsAfterTime=d.startTime);c.Vf&&(d.preferredAudioLanguage=c.Vf);c.ah&&(d.preferredTextLanguage=c.ah);_.Sn(a.f,null);a.trigger(new _.H("castingended"));a.j(b,d)}},()=>LV(a))},LV=function(a){return _.v(function*(){a.trigger(new _.H(_.Pc));if(a.f.a!==a.a&&a.a){var b=null!=a.f.Qa();yield a.f.release();_.Sn(a.f,a.a);b&&(_.ao(a.f),(b=a.f.getAdsManager())&&(yield b.load()))}})},NV=function(a){a.trigger(new _.H(_.ef))},PV=function(a){OV(a);const b=Math.min(a.a.Hd().length-1,a.a.getPosition()+1);
16
- a.a.setPosition(b)},OV=function(a){a.j||(a.a.on(_.df,a.o),a.j=!0)},QV=function(a){return a.map(b=>{const c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},UV=function(a,b,c){return _.v(function*(){var d=b.adTagUrl;if(d)try{RV=!1;const e=_.sk(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.ii(f.data),h=(new DOMParser).parseFromString(g,_.Wf);if(h.getElementsByTagName("vmap:VMAP").length)SV.warn("VMAP detected."),a.vmapAdsRequest=TV(g);else if(h.getElementsByTagName("VAST").length){SV.warn("VAST detected.");
17
- {d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=TV(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else SV.warn("Unsupported schema."),RV=!0}}catch(e){SV.warn("Failed to fetch an ad",e),RV=!0}})},TV=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},VV=function(a,b){b=new _.I(1,10,10003,{errorType:b});a.m.onError(b)},WV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},
18
- YV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=XV(a,c))&&(d={ad:c});a.m.trigger(new _.H(b,d))}},XV=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Pf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Pf&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,
19
- h)=>g.position-h.position).findIndex(g=>g===e)));c=new Y(d,e,b.index,b.total,f)}return c},ZV=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},$V=function(a){const b=a.dashTimedMetadata;let c=_.kg;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.jg)?_.Cf:_.hg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,
20
- value:b&&b.value||"",eventElement:b?b.eventElement:null}},aW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},cW=function(a){a.a=aW().getTextTracksManager();const b=a.a.getTracks();a.j=bW(_.P,b)},bW=function(a,b){const c=[];for(const d of b)b=new _.or(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||null,b.language=d.language||null,b.originalLanguage=d.language||null,b.label=d.name||null,b.src=d.trackContentId||null,b.mimeType=d.trackContentType||
21
- null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.sr(b.id,b)),c.push(b);return c},dW=function(a,b,c,d){c=_.Uh(c).filter(g=>g);var e=!1;let f=[];b===_.Q?f=a.getAudioTracks():b===_.P&&(f=a.sa());if(c=c.find(g=>{const h=_.Bn(g);return f.some(k=>{k=_.Bn(k.language||"");return _.Cn(h,k)})})){const g=_.Bn(c);c=f.filter(h=>{h=_.Bn(h.language||"");return _.Cn(g,h)});f=c.length?c:f;e=e||!!c.length}_.ri(d)&&(c=f.filter(g=>g.roles.includes(d)),
22
- f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.Q?a.za(e):b===_.P&&a.Za(e))},eW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},hW=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.fn(d);if(e){var f=[_.qd];_.$m(a)[0].type!==_.zc&&f.unshift(_.sd);d.preferredDrmSystem===_.qd&&f.reverse();
23
- for(var g,h;f.length&&!h;)g=f.shift(),h=e.Ka[g];h?(c=g===_.sd?cast.framework.ContentProtection.WIDEVINE:g===_.qd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},fW(b,h,a,c),gW(b,h,a,c)):c()}else c()}else c()},iW=function(a,b){b=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:b})},fW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=e=>{const f=_.sk({method:_.ab,uris:[e.url]});
24
- e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},gW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.v(function*(){const g=_.wk(Object.assign({},f.headers),e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.G(g.data)}):a.licenseHandler=void 0},lW=function(){return jW||
25
- (jW=new kW)},mW=function(){return cast.framework.CastReceiverContext.getInstance()},nW=function(){const a=mW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},oW=function(a,b){const c=mW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,mW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},qW=function(a,b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;
26
- a=mW();var {hlsVideoSegmentFormat:d}=mW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.sg:_.rg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");b=b.split(/\n+/m);d=[];let e=0;for(;e<b.length;){const f=b[e].trim();if(b[e].startsWith("#EXT-X-STREAM-INF")){const g=pW(f,_.pa),h=pW(f,_.hb);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},pW=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),
27
- c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},rW=function(a){for(const b of a)a={},b.customData&&_.bh(b.customData)&&(a=b.customData),b.roles&&(a.roles=b.roles),b.audioTrackInfo&&(a.audioTrackInfo=b.audioTrackInfo),_.bh(a)&&(b.customData=a)},sW=function(a){_.v(function*(){yield a.l.L;a.a=a.l.o;a.B.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,a.C.bind(a))})},tW=function(a,b,c){let d=null;c&&(d={ad:c});
28
- a.l.trigger(new _.H(b,d))},uW=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks;const c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,h=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=h&&d))return null;const k=b.find(l=>l.id===e)||null;a=0;k&&(a=0>=k.position?k.position:b.filter(l=>0<=l.position).sort((l,m)=>l.position-m.position).findIndex(l=>l===k));b=c.find(l=>l.id===h)||null;return new Y(b,k,
29
- f,g,a)},vW;_.w("clpp.cast.CastUtils",class{});var lV=0,GV={GENERIC:lV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},wW="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),xW="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");var yW=class{constructor(a,b){this.log=new _.T(b);this.player=a;this.l=null;this.o=this.h=_.zo;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(_.zo)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.D&&this.a(_.qo)}a(a){if(a!==this.h)if(this.h===_.qo&&a!==_.zo)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;2===this.h?(this.B=b,this.player.trigger(new _.H(_.Mc,{detail:{bufferedTimeMS:-1,
30
- reason:this.j}}))):2===this.o&&this.player.trigger(new _.H(_.Lc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.gs(this.l,this.h);this.player.trigger(new _.H(_.Mf,{detail:a}))}}};var zW=class extends yW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.dc.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.o)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.o;b&&b.isPlayingBreak||super.a(a)}dc(){if(this.f&&
31
- this.w&&!this.w.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.a(5);break;case chrome.cast.media.IdleReason.ERROR:this.a(_.qo);break;default:this.a(_.zo)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(3);break;case chrome.cast.media.PlayerState.PAUSED:this.a(4);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(2)}}};var AW=class extends _.V{constructor(){super();this.g=new _.T("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}}initialize(a){this.a=a}release(){this.h=[];this.f={}}load(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(b=>{switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.R;break;case chrome.cast.media.TrackType.AUDIO:c=_.Q;break;case chrome.cast.media.TrackType.TEXT:c=_.P}c=new _.or(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
32
- c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customData){c.src=b.customData.url||c.src;c.mimeType=b.customData.mimeType||c.mimeType;const d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.sr(c.id,c));return c}):[],this.a.trigger(new _.H(_.cg)))}destroy(){this.a=null}getVideoTracks(){return oV(this,_.R)}getAudioTracks(){return oV(this,
33
- _.Q)}sa(){return oV(this,_.P)}ta(){const a=this.Ha();return a?a.renditions[0]:null}Oa(){const a=this.ra();return a?a.renditions[0]:null}Va(){const a=this.ua();return a?a.renditions[0]:null}xb(){return this.f[_.R]||null}Ob(){return this.f[_.Q]||null}Pb(){return this.f[_.P]||null}Ha(){return qV(this,_.R)}ra(){return qV(this,_.Q)}ua(){return qV(this,_.P)}Gb(a){sV(this,_.R,a)}za(a){sV(this,_.Q,a)}Za(a){sV(this,_.P,a)}sb(a){this.Gb(a&&a.track)}Eb(a){this.za(a&&a.track)}Fb(a){this.Za(a&&a.track)}addTextTrack(){return _.v(function*(){})}va(){return!0}};
34
- AW.prototype.isAbrEnabled=AW.prototype.va;AW.prototype.addTextTrack=AW.prototype.addTextTrack;AW.prototype.setTextRendition=AW.prototype.Fb;AW.prototype.setAudioRendition=AW.prototype.Eb;AW.prototype.setVideoRendition=AW.prototype.sb;AW.prototype.setTextTrack=AW.prototype.Za;AW.prototype.setAudioTrack=AW.prototype.za;AW.prototype.setVideoTrack=AW.prototype.Gb;AW.prototype.getTextTrack=AW.prototype.ua;AW.prototype.getAudioTrack=AW.prototype.ra;AW.prototype.getVideoTrack=AW.prototype.Ha;
35
- AW.prototype.getLoadingTextRendition=AW.prototype.Pb;AW.prototype.getLoadingAudioRendition=AW.prototype.Ob;AW.prototype.getLoadingVideoRendition=AW.prototype.xb;AW.prototype.getTextRendition=AW.prototype.Va;AW.prototype.getAudioRendition=AW.prototype.Oa;AW.prototype.getVideoRendition=AW.prototype.ta;AW.prototype.getTextTracks=AW.prototype.sa;AW.prototype.getAudioTracks=AW.prototype.getAudioTracks;AW.prototype.getVideoTracks=AW.prototype.getVideoTracks;var KV=class extends _.Lt{constructor(a,b,c,d){super();this.g=new _.T(_.ed);this.S=a;this.w=new _.Hi(b);this.R=c;this.Z=d;this.j=this.G=_.Um();this.C=[];this.B=0;this.I=new _.yn;this.a=null;this.f=!1;this.L=new _.Cl;this.A=!1;this.ca="";this.ia=1E6;this.h=new AW;this.h.initialize(this);this.l=new zW(this);this.F=new _.It;this.H=null;this.K=new Set;this.M=this.bb.bind(this);this.da=this.Ub.bind(this);this.W=this.Ib.bind(this);this.P=this.Jb.bind(this);this.U=this.lb.bind(this);this.o=this.J=null;window.cast||
36
- Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{xV(!0)},0)}});uV(this);tV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Wa)}appendLoad(){return Promise.reject(_.Wa)}seekWith(){return Promise.reject(_.Wa)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.v(function*(){})}Zd(a){this.J=
37
- a}gd(){return this.f}ya(){return this.A}Ze(){return this.ca}sendMessage(a,b){const c=this;return _.v(function*(){if(c.f){var d=cast.framework.CastContext.getInstance().getCurrentSession();if(d)try{yield d.sendMessage(a,b)}catch(f){var e=new _.I(1,8,8E3,{detailedErrorCode:f})}else e=new _.I(1,8,8004,void 0);if(e)c.onError(e)}})}cast(){const a=this;return _.v(function*(){if(!a.gd())throw a.g.warn(XU),new _.I(1,8,8001,void 0);if(!yV)throw a.g.warn(UU),new _.I(1,8,8002,void 0);if(a.ya())throw a.g.warn("Already casting"),
38
- new _.I(1,8,8003,void 0);try{yield AV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.I(1,8,8E3,c);}})}re(){this.f&&this.ya()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Xd&&this.K.add(a)}removeMessageListener(a){typeof a===_.Xd&&this.K.delete(a)}play(){return this.f?this.isEnded()?CV(this,!0):new Promise((a,b)=>{if(!this.a)return b(TU);
39
- this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(TU);this.a.pause(null,a,b)}):Promise.resolve()}isPaused(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1}isEnded(){return this.f?5===this.getState():!1}seek(a){return this.f?this.isEnded()?CV(this,!1,a):new Promise((b,c)=>{this.a||c(TU);this.o.isPlayingBreak&&c(RU);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.H(_.mg));
40
- this.a.seek(d,()=>{this.trigger(new _.H(_.lg));b()},c)}):Promise.resolve()}getPosition(){return this.f?this.getMediaPosition():0}getMediaPosition(){return this.f?this.a&&this.a.getEstimatedTime()||0:0}getDuration(){return this.f?this.getMediaDuration():0}getMediaDuration(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.r?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.f?this.a&&
41
- this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(dV,{type:"SET_PLAYBACK_RATE",requestId:nV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.f?this.a&&this.a.volume.level:0}setVolume(a){this.f&&this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.f?this.a&&this.a.volume.muted:!1}setMuted(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var QU="Cannot seek during ads playout.",RU="Cannot switch track",SU="Media session does not exist.",TU="No receivers available",UU="QUEUE_ITEM_CHANGED",VU="Reset ABR functionality not available on cast.",WU="SDK not yet ready",XU="Sender is destroyed.",YU="clpp.cast.CastProxy",ZU="clpp.cast.Player",$U="clpp.cast.Receiver",aV="urn:x-cast:castlabs",bV="urn:x-cast:castlabs:int",cV="urn:x-cast:com.google.cast.media",dV="volume control is not supported",eV=function(a){return _.v(function*(){yield _.Tr(a,
2
+ _.Ge);yield _.Tr(a,_.Fe)})},fV=function(a){return JSON.stringify(a,(b,c)=>{if("license"!==b&&typeof c!==_.Wd){if(c instanceof Event){b={};for(const d in c){const e=c[d];typeof e===_.Be?"detail"===d&&(b[d]=e):d in Event||(b[d]=e)}return b}return typeof c===_.r?isNaN(c)?"NaN":isFinite(c)?c:0>c?"-Infinity":"Infinity":c}})},gV=function(a){if(typeof a!==_.Nf)return a;try{return JSON.parse(a,(b,c)=>"NaN"===c?NaN:"-Infinity"===c?-Infinity:"Infinity"===c?Infinity:c)}catch(b){return a}},hV=function(a,b){const c=
3
+ new Set(b);return Object.keys(a).reduce((d,e)=>{c.has(e)&&(d[e]=a[e]);return d},{})},iV=function(a,b,c,d){return _.v(function*(){if(b.includes(a.mimeType))return a;var e=null;let f=null,g=null;for(var h=0;h<b.length&&!f;)g=b[h++],f=_.Kl(d,a.mimeType,g);f&&g&&(h=_.ck(a.url),(h=yield c.fetch(h).V)&&h.data&&(e=f.a(_.E(h.data)),e={url:URL.createObjectURL(new Blob([e])),kind:a.kind,language:a.language,label:a.label,mimeType:g}));return e})},jV=function(a,b){let c,d;if(window.chrome&&chrome.cast&&chrome.cast.media)c=
4
+ chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;else if(window.cast&&cast.framework&&cast.framework.messages)c=cast.framework.messages.HlsSegmentFormat,d=cast.framework.messages.HlsVideoSegmentFormat;else return;switch(a){case _.qg:return d.FMP4;case _.pg:return b===_.N?d.MPEG2_TS:c.TS;case _.Dc:return c.AAC;case _.Ec:return c.AC3;case _.Fc:return c.E_AC3;case "audio/mpeg":return c.MP3;case _.Gc:return c.FMP4}},lV=function(a){a=void 0===a?kV:a;var b=cast.framework.messages||
5
+ chrome.cast.media;if(!b)throw new _.J(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},mV=function(){return Math.round(1E3*Math.random())},nV=function(a,b){return a.h.filter(c=>
6
+ c.type===b)},pV=function(a,b){const c=oV(a);return nV(a,b).find(d=>c.includes(d.id))||null},rV=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.L){const e=a.ua();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,()=>{a.f[b]=null;qV(a,b)},e=>{a.f[b]=null;a.g.debug(RU,e)})}else b===_.L&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{qV(a,b)},e=>{a.g.debug(RU,e)}))},oV=function(a){a=a.a?a.a.a:null;return(a?
7
+ a.activeTrackIds||[]:[]).map(b=>b.toString())},qV=function(a,b){b===_.M?a.a.trigger(new _.H(_.Jc)):b===_.L&&a.a.trigger(new _.H(_.Vf))},wV=function(a){if(a){for(const b of sV)tV(b);uV=!0;for(const b of vV)b()}},tV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.S.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.F.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,
8
+ a.Aa.bind(a));a.F.on(b,cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Jb.bind(a));a.f=!0;a.L.resolve();a.w.Ef();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);xV&&a.w.la(.02)}},yV=function(a){return _.v(function*(){a.F.release();
9
+ sV.delete(a);if(a.f){a.f=!1;var b=cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}b=[];a.h&&(b.push(a.h.destroy()),a.h=null);a.l&&(b.push(a.l.destroy()),a.l=null);yield Promise.all(b);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.R=null;a.Z=null})},zV=function(a){return _.v(function*(){a.ya()||(yield cast.framework.CastContext.getInstance().requestSession())})},
10
+ BV=function(a,b,c){c=void 0===c?0:c;return _.v(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield AV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),mf:a.getPresentationStartTime(),autoplay:b,Fa:a.j})})},AV=function(a,b){return _.v(function*(){if(a.f){var c=chrome.cast.media.StreamType;yield zV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
11
+ b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.audioMimeType;e.hlsVideoSegmentFormat=jV(b.videoMimeType,_.N);e.hlsSegmentFormat=jV(c,_.M);b.Fa&&(a.J&&(c=yield Promise.resolve(a.J(b.Fa)))&&(b.Fa=c),a.j=b.Fa,a.C=_.gp(a.j),a.B=a.C.findIndex(k=>k.url===b.source.url),b.Fa.remoteTextTracks&&(c=yield Promise.all(b.Fa.remoteTextTracks.map(a.bb.bind(a))),e.tracks=c.filter(k=>k),b.Fa.remoteTextTracks=void 0),delete b.Fa.autoplay,b.Fa.startTime=null,e.customData={playerConfiguration:fV(b.Fa)});c=
12
+ a.Lb()||{};var f=CV(c.metadataType),g;typeof b.mf===_.r&&(g={metadataType:f,sectionStartAbsoluteTime:b.mf});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=DV(c);if(g=EV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);(g=b.queueData)&&g.items&&0<g.items.length&&(h=new chrome.cast.media.QueueData,h.items=g.items,h.startIndex=g.startIndex,e.queueData=h);typeof b.autoplay===_.Mc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.r&&(e.currentTime=b.currentTime);
13
+ yield d.loadMedia(e);null!=b.Fa.muted&&a.setMuted(b.Fa.muted);null!=b.Fa.volume&&a.setVolume(b.Fa.volume)}}})},EV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(FV);for(const d of c){const [e,f]=d;if(f===b){b=e;break a}}b=null}if(!b)return null;b=lV(FV[b]);return Object.assign(b,a)},CV=function(a){var b=void 0===b?kV:b;return Object.values(FV).includes(a)?a:b},DV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},HV=function(a,b){GV(a,b.getMediaSession());
14
+ b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,a.W);b.addMessageListener(aV,a.P);b.addMessageListener(bV,a.U)},IV=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.r?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},GV=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.H(_.le)))},LV=function(a){return new JV(a.h,()=>{a.trigger(new _.H(_.Sc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=
15
+ c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&(d.ima.playAdsAfterTime=d.startTime);c.Tf&&(d.preferredAudioLanguage=c.Tf);c.Zg&&(d.preferredTextLanguage=c.Zg);_.Rr(a.f,null);a.trigger(new _.H("castingended"));a.j(b,d)}},()=>KV(a))},KV=function(a){return _.v(function*(){a.trigger(new _.H(_.Rc));if(a.f.a!==a.a&&a.a){var b=null!=a.f.Ra();yield a.f.release();_.Rr(a.f,a.a);b&&(_.as(a.f),(b=a.f.getAdsManager())&&(yield b.load()))}})},MV=function(a){a.trigger(new _.H(_.df))},OV=function(a){NV(a);
16
+ const b=Math.min(a.a.Fd().length-1,a.a.getPosition()+1);a.a.setPosition(b)},NV=function(a){a.j||(a.a.on(_.cf,a.o),a.j=!0)},PV=function(a){return a.map(b=>{const c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},TV=function(a,b,c){return _.v(function*(){var d=b.adTagUrl;if(d)try{QV=!1;const e=_.ck(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.vi(f.data),h=(new DOMParser).parseFromString(g,_.Uf);if(h.getElementsByTagName("vmap:VMAP").length)RV.warn("VMAP detected."),
17
+ a.vmapAdsRequest=SV(g);else if(h.getElementsByTagName("VAST").length){RV.warn("VAST detected.");{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=SV(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else RV.warn("Unsupported schema."),QV=!0}}catch(e){RV.warn("Failed to fetch an ad",e),QV=!0}})},SV=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},UV=function(a,b){b=new _.J(1,10,10003,{errorType:b});
18
+ a.m.onError(b)},VV=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},XV=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=WV(a,c))&&(d={ad:c});a.m.trigger(new _.H(b,d))}},WV=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Nf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Nf&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>
19
+ g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,h)=>g.position-h.position).findIndex(g=>g===e)));c=new Y(d,e,b.index,b.total,f)}return c},YV=function(){return[cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,cast.framework.events.EventType.TIMED_METADATA_CHANGED,cast.framework.events.EventType.TIMED_METADATA_ENTER,cast.framework.events.EventType.TIMED_METADATA_EXIT]},ZV=function(a){const b=a.dashTimedMetadata;let c=_.ig;b&&(c=b.schemeIdUri);return{type:c.startsWith(_.hg)?
20
+ _.bj:_.fg,schemeIdUri:c,id:a.id||"",startTime:a.startTime,endTime:a.endTime,value:b&&b.value||"",eventElement:b?b.eventElement:null}},$V=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},bW=function(a){a.a=$V().getTextTracksManager();const b=a.a.getTracks();a.j=aW(_.L,b)},aW=function(a,b){const c=[];for(const d of b)b=new _.jl(d.trackId.toString(),a),b.roles=d.roles||[],b.kind=d.subtype||null,b.language=d.language||null,b.originalLanguage=d.language||null,b.label=
21
+ d.name||null,b.src=d.trackContentId||null,b.mimeType=d.trackContentType||null,d.customData&&(b.mimeType=d.customData.mimeType||b.mimeType,b.src=d.customData.url||b.src),b.renditions.push(new _.nl(b.id,b)),c.push(b);return c},cW=function(a,b,c,d){c=_.kj(c).filter(g=>g);var e=!1;let f=[];b===_.M?f=a.getAudioTracks():b===_.L&&(f=a.sa());if(c=c.find(g=>{const h=_.Tj(g);return f.some(k=>{k=_.Tj(k.language||"");return _.Uj(h,k)})})){const g=_.Tj(c);c=f.filter(h=>{h=_.Tj(h.language||"");return _.Uj(g,h)});
22
+ f=c.length?c:f;e=e||!!c.length}_.Ei(d)&&(c=f.filter(g=>g.roles.includes(d)),f=c.length?c:f,e=e||!!c.length);e&&f[0]&&(e=f[0],a.g.info("Will select track",e),b===_.M?a.za(e):b===_.L&&a.$a(e))},dW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},gW=function(a,b){var c=()=>{b.protectionSystem=cast.framework.ContentProtection.NONE;b.licenseUrl=void 0;b.licenseRequestHandler=void 0;b.licenseHandler=void 0};if(a&&a.drm){var d=a.drm,e=_.mk(d);if(e){var f=[_.rd];_.gp(a)[0].type!==
23
+ _.Bc&&f.unshift(_.td);d.preferredDrmSystem===_.rd&&f.reverse();for(var g,h;f.length&&!h;)g=f.shift(),h=e.La[g];h?(c=g===_.td?cast.framework.ContentProtection.WIDEVINE:g===_.rd?cast.framework.ContentProtection.PLAYREADY:void 0,b.protectionSystem=c,b.licenseUrl=h.licenseUrl,c={ldlDelay:0,customData:{}},eW(b,h,a,c),fW(b,h,a,c)):c()}else c()}else c()},hW=function(a,b){b=Object.assign({},a.shakaConfig,b);return Object.assign({},a,{shakaConfig:b})},eW=function(a,b,c,d){b.modifiers.licenseRequest?a.licenseRequestHandler=
24
+ e=>{const f=_.ck({method:_.bb,uris:[e.url]});e.headers&&(f.headers=e.headers);f.body=e.content;f.allowCrossSiteCredentials=e.withCredentials;b.modifiers.licenseRequest(c,f,d);e.url=f.uris[0];e.headers=f.headers;e.content=f.body;e.withCredentials=f.allowCrossSiteCredentials}:a.licenseRequestHandler=void 0},fW=function(a,b,c,d){b.modifiers.licenseResponse?a.licenseHandler=(e,f)=>_.v(function*(){const g=_.gk(Object.assign({},f.headers),e.buffer,200,"");yield b.modifiers.licenseResponse(c,g,d);return _.E(g.data)}):
25
+ a.licenseHandler=void 0},kW=function(){return iW||(iW=new jW)},lW=function(){return cast.framework.CastReceiverContext.getInstance()},mW=function(){const a=lW().getPlayerManager().getMediaInformation();return a&&a.metadata?a.metadata:null},nW=function(a,b){const c=lW().getPlayerManager().getMediaInformation();c?(b?c.metadata=b:delete c.metadata,a=!0,a=void 0===a?!1:a,lW().getPlayerManager().setMediaInformation(c,a)):a.g.warn("No mediaInformation is present. Skipping metadata update.")},pW=function(a,
26
+ b){a.g.debug("Detected HLS, parsing");var c=cast.framework.messages.HlsVideoSegmentFormat;a=lW();var {hlsVideoSegmentFormat:d}=lW().getPlayerManager().getMediaInformation()||{};c=d===c.FMP4?_.qg:_.pg;b=b.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");b=b.split(/\n+/m);d=[];let e=0;for(;e<b.length;){const f=b[e].trim();if(b[e].startsWith("#EXT-X-STREAM-INF")){const g=oW(f,_.qa),h=oW(f,_.ib);let [k,l]=[];h&&([k,l]=h.split("x").map(m=>+m));if(!a.canDisplayType(c,g,k,l)){e+=2;continue}}d.push(f);++e}return d.join("\n")},
27
+ oW=function(a,b){let c;b+="\x3d";let d=a.indexOf(b);0<=d&&(c=a.substring(d+b.length),c.startsWith('"')?(c=c.substring(1),c=c.substring(0,c.indexOf('"'))):(d=c.indexOf(","),0<=d&&(c=c.substring(0,d))));return c},qW=function(a){for(const b of a)a={},b.customData&&_.$g(b.customData)&&(a=b.customData),b.roles&&(a.roles=b.roles),b.audioTrackInfo&&(a.audioTrackInfo=b.audioTrackInfo),_.$g(a)&&(b.customData=a)},rW=function(a){_.v(function*(){yield a.l.L;a.a=a.l.o;a.B.on(a.a.controller,cast.framework.RemotePlayerEventType.ANY_CHANGE,
28
+ a.C.bind(a))})},sW=function(a,b,c){let d=null;c&&(d={ad:c});a.l.trigger(new _.H(b,d))},tW=function(a){if(!a.a||!a.a.mediaInfo)return null;var b=a.a.mediaInfo.breaks;const c=a.a.mediaInfo.breakClips,d=a.a.isPlayingBreak,e=a.a.breakId,f=a.a.currentBreakClipNumber,g=a.a.numberBreakClips,h=a.a.breakClipId;if(!(b&&c&&null!=e&&null!=f&&null!=g&&null!=h&&d))return null;const k=b.find(l=>l.id===e)||null;a=0;k&&(a=0>=k.position?k.position:b.filter(l=>0<=l.position).sort((l,m)=>l.position-m.position).findIndex(l=>
29
+ l===k));b=c.find(l=>l.id===h)||null;return new Y(b,k,f,g,a)},uW,kV=0,FV={GENERIC:kV,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5},vW="addMissingTimelineCues alwaysStreamText bufferBehind bufferingGoal durationBackoff gapDetectionThreshold ignoreTextStreamFailures lowLatencyMode rebufferingGoal retryParameters safeSeekOffset stallEnabled stallSkip stallThreshold startAtSegmentBoundary".split(" "),wW="bandwidthDowngradeTarget bandwidthUpgradeTarget defaultBandwidthEstimate enabled initialRestrictions restrictions switchInterval".split(" ");var xW=class{constructor(a,b){this.log=new _.S(b);this.player=a;this.l=null;this.o=this.h=0;this.j=2;this.C=Date.now();this.B=-1}release(){this.a(0)}destroy(){this.l=this.player=null;return Promise.resolve()}getState(){return this.h}onError(a){a.severity===_.C&&this.a(3)}a(a){if(a!==this.h)if(3===this.h&&0!==a)this.log.debug("Player is in ERROR state and can not switch to",a);else{var b=Date.now();this.o=this.h;this.h=a;6===this.h?(this.B=b,this.player.trigger(new _.H(_.Oc,{detail:{bufferedTimeMS:-1,
30
+ reason:this.j}}))):6===this.o&&this.player.trigger(new _.H(_.Nc,{detail:{bufferedTimeMS:b-this.B,reason:this.j}}));a={currentState:this.h,previousState:this.o,timeSinceLastStateChangeMS:b-this.C};this.C=b;this.l&&_.$o(this.l,this.h);this.player.trigger(new _.H(_.af,{detail:a}))}}};var yW=class extends xW{constructor(a){super(a,"clpp.cast.SenderStateManager");this.w=this.f=null;this.A=this.dc.bind(this)}init(){const a=this.player,b=a.a;b&&(this.f&&this.f.removeUpdateListener(this.A),this.f=b,this.f.addUpdateListener(this.A),this.w=a.o)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){a.f&&(a.f.removeUpdateListener(a.A),a.f=null);yield b().call(a)})}a(a){const b=this.player.o;b&&b.isPlayingBreak||super.a(a)}dc(){if(this.f&&
31
+ this.w&&!this.w.isPlayingBreak)switch(this.f.playerState){case chrome.cast.media.PlayerState.IDLE:switch(this.f.idleReason){case chrome.cast.media.IdleReason.FINISHED:this.a(11);break;case chrome.cast.media.IdleReason.ERROR:this.a(3);break;default:this.a(0)}break;case chrome.cast.media.PlayerState.PLAYING:this.a(8);break;case chrome.cast.media.PlayerState.PAUSED:this.a(10);break;case chrome.cast.media.PlayerState.BUFFERING:this.a(6)}}};var zW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.SenderTrackManager");this.a=null;this.h=[];this.f={}}initialize(a){this.a=a}release(){this.h=[];this.f={}}load(){this.release();var a=this.a.a;a&&(a=a.media)&&(this.h=(a=a.tracks)?a.map(b=>{switch(b.type){case chrome.cast.media.TrackType.VIDEO:var c=_.N;break;case chrome.cast.media.TrackType.AUDIO:c=_.M;break;case chrome.cast.media.TrackType.TEXT:c=_.L}c=new _.jl(b.trackId.toString(),c);c.kind=b.subtype;c.language=b.language;
32
+ c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customData){c.src=b.customData.url||c.src;c.mimeType=b.customData.mimeType||c.mimeType;const d=b.customData.roles;d&&(c.roles=d);if(b=b.customData.audioTrackInfo)void 0!==b.numAudioChannels&&(c.channelsCount=b.numAudioChannels),void 0!==b.spatialAudio&&(c.spatialAudio=b.spatialAudio)}c.renditions.push(new _.nl(c.id,c));return c}):[],this.a.trigger(new _.H(_.ag)))}destroy(){this.a=null}getVideoTracks(){return nV(this,_.N)}getAudioTracks(){return nV(this,
33
+ _.M)}sa(){return nV(this,_.L)}ta(){const a=this.Ha();return a?a.renditions[0]:null}Pa(){const a=this.ra();return a?a.renditions[0]:null}Wa(){const a=this.ua();return a?a.renditions[0]:null}wb(){return this.f[_.N]||null}Nb(){return this.f[_.M]||null}Ob(){return this.f[_.L]||null}Ha(){return pV(this,_.N)}ra(){return pV(this,_.M)}ua(){return pV(this,_.L)}Fb(a){rV(this,_.N,a)}za(a){rV(this,_.M,a)}$a(a){rV(this,_.L,a)}rb(a){this.Fb(a&&a.track)}Db(a){this.za(a&&a.track)}Eb(a){this.$a(a&&a.track)}addTextTrack(){return _.v(function*(){})}va(){return!0}};
34
+ zW.prototype.isAbrEnabled=zW.prototype.va;zW.prototype.addTextTrack=zW.prototype.addTextTrack;zW.prototype.setTextRendition=zW.prototype.Eb;zW.prototype.setAudioRendition=zW.prototype.Db;zW.prototype.setVideoRendition=zW.prototype.rb;zW.prototype.setTextTrack=zW.prototype.$a;zW.prototype.setAudioTrack=zW.prototype.za;zW.prototype.setVideoTrack=zW.prototype.Fb;zW.prototype.getTextTrack=zW.prototype.ua;zW.prototype.getAudioTrack=zW.prototype.ra;zW.prototype.getVideoTrack=zW.prototype.Ha;
35
+ zW.prototype.getLoadingTextRendition=zW.prototype.Ob;zW.prototype.getLoadingAudioRendition=zW.prototype.Nb;zW.prototype.getLoadingVideoRendition=zW.prototype.wb;zW.prototype.getTextRendition=zW.prototype.Wa;zW.prototype.getAudioRendition=zW.prototype.Pa;zW.prototype.getVideoRendition=zW.prototype.ta;zW.prototype.getTextTracks=zW.prototype.sa;zW.prototype.getAudioTracks=zW.prototype.getAudioTracks;zW.prototype.getVideoTracks=zW.prototype.getVideoTracks;var JV=class extends _.lu{constructor(a,b,c,d){super();this.g=new _.S(_.gd);this.S=a;this.w=new _.Jh(b);this.R=c;this.Z=d;this.j=this.G=_.lm();this.C=[];this.B=0;this.I=new _.Cr;this.a=null;this.f=!1;this.L=new _.uk;this.A=!1;this.ca="";this.ja=1E6;this.h=new zW;this.h.initialize(this);this.l=new yW(this);this.F=new _.Et;this.H=null;this.K=new Set;this.M=this.cb.bind(this);this.da=this.Ub.bind(this);this.W=this.Hb.bind(this);this.P=this.Ib.bind(this);this.U=this.lb.bind(this);this.o=this.J=null;window.cast||
36
+ Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{wV(!0)},0)}});tV(this);sV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.v(function*(){})}Xd(a){this.J=
37
+ a}ed(){return this.f}ya(){return this.A}We(){return this.ca}sendMessage(a,b){const c=this;return _.v(function*(){if(c.f){var d=cast.framework.CastContext.getInstance().getCurrentSession();if(d)try{yield d.sendMessage(a,b)}catch(f){var e=new _.J(1,8,8E3,{detailedErrorCode:f})}else e=new _.J(1,8,8004,void 0);if(e)c.onError(e)}})}cast(){const a=this;return _.v(function*(){if(!a.ed())throw a.g.warn(WU),new _.J(1,8,8001,void 0);if(!xV)throw a.g.warn(TU),new _.J(1,8,8002,void 0);if(a.ya())throw a.g.warn("Already casting"),
38
+ new _.J(1,8,8003,void 0);try{yield zV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.J(1,8,8E3,c);}})}oe(){this.f&&this.ya()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.Wd&&this.K.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.K.delete(a)}play(){return this.f?this.isEnded()?BV(this,!0):new Promise((a,b)=>{if(!this.a)return b(SU);
39
+ this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(SU);this.a.pause(null,a,b)}):Promise.resolve()}isPaused(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1}isEnded(){return this.f?11===this.getState():!1}seek(a){return this.f?this.isEnded()?BV(this,!1,a):new Promise((b,c)=>{this.a||c(SU);this.o.isPlayingBreak&&c(QU);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.H(_.kg));
40
+ this.a.seek(d,()=>{this.trigger(new _.H(_.jg));b()},c)}):Promise.resolve()}getPosition(){return this.f?this.getMediaPosition():0}getMediaPosition(){return this.f?this.a&&this.a.getEstimatedTime()||0:0}getDuration(){return this.f?this.getMediaDuration():0}getMediaDuration(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.r?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.f?this.a&&
41
+ this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(cV,{type:"SET_PLAYBACK_RATE",requestId:mV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.f?this.a&&this.a.volume.level:0}setVolume(a){this.f&&this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.f?this.a&&this.a.volume.muted:!1}setMuted(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,
42
42
  a)),this.a.setVolume(a))}getPresentationStartTime(){if(!this.f)return 0;if(!this.a||!this.a.media||!this.a.media.metadata)return null;const a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.r?null:1E-8===a?0:a}getSeekRange(){if(!this.f)return{start:0,end:0};let a={start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.f?this.l?this.l.getState():
43
- _.zo:_.zo}getStats(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?hV(this.a.customData.stats):_.ks():_.ks()}isLive(){return this.f?Infinity===this.getDuration():!1}load(a){const b=this;return _.v(function*(){if(b.gd())if(yV){b.C=_.$m(a);b.j=_.Wm([b.G,a]);var c=b.C[b.B];yield BV(b,{source:c,isLive:c.isLive,autoplay:b.j.autoplay,Fa:b.j,jc:c.jc,nb:c.nb})}else b.g.warn(UU);else b.g.warn(XU)})}getBufferInfo(){return new _.Ft}getTrackManager(){return this.h}getConfiguration(){return this.j}getSurface(){return null}setNetworkEngine(a){this.I=
44
- a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(WU)}onError(a){if(a&&(this.trigger(new _.H(_.Td,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.ed}canPlay(){return this.gd()?2:0}Mb(){return this.H}gc(a){this.H=FV(a)}Ve(){this.H=null}Cf(a){if(this.f){var b=this.Mb()||
45
- {};a={metadataType:DV(b.metadataType),title:a};this.gc(Object.assign({},b,a))}}Af(a){if(this.f){var b=this.Mb()||{},c=DV(b.metadataType);a=new chrome.cast.Image(a);this.gc(Object.assign({},b,{metadataType:c,images:[a]}))}}zf(a){if(this.f){var b=this.Mb()||{};this.gc(Object.assign({},b,{metadataType:3,artist:a}))}}Bf(a){if(this.f){var b=this.Mb()||{};a={metadataType:DV(b.metadataType),releaseDate:a};this.gc(Object.assign({},b,a))}}bb(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===
46
- cast.framework.CastState.CONNECTED;yV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Hf()}Ub(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;IV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ya()||(this.A=!0,IV(this,a.session),this.Z());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ya()&&
47
- this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:JV(this),ah:c,Vf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.W);a.session.removeMessageListener(bV,this.P);a.session.removeMessageListener(cV,this.U);this.A=!1;this.a=null}}Ib(a){this.g.debug("New media session",a.mediaSession);HV(this,a.mediaSession)}Kb(a){a.value&&
48
- a.value.tracks&&this.h&&this.h.load()}Jb(a,b){const c=hV(b);this.K.forEach(d=>d(c))}lb(a,b){a=hV(b);"event"===a.type&&a.name===_.zg&&this.trigger(new _.H(_.Rc,{visible:!!a.visible}))}Aa(){this.trigger(new _.H(_.bg))}ab(a){const b=this;return _.v(function*(){let c=null;const d=yield jV(a,[_.Vf,_.yc],b.I,b.j);d&&(c=new chrome.cast.media.Track(b.ia++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,
49
- url:a.url});return c})}getTextDisplayer(){return null}},yV=!1,tV=new Set,vV=!1,wV=[];window.__onGCastApiAvailable=xV;_.w("clpp.cast.onReady",function(a){vV?a():wV.push(a)});var BW=class extends _.Lt{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.Xd?c:this.l;this.a=MV(this);this.g=new _.T(ZU);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.v(function*(){a.a&&(yield zV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){5!==a&&a!==_.zo&&(delete b.license,this.f.open(b))}Sc(){return!!this.a&&this.a.gd()&&yV}ya(){return!!this.a&&this.a.ya()}Ze(){return this.a?this.a.Ze():""}Zd(a){this.a&&this.a.Zd(a)}cast(a,b){const c=this;return _.v(function*(){if(c.a)try{if(yield c.a.cast(),
50
- c.a){{let e=null;const f=c.f.Qa();if(f){const g=c.f.getTrackManager(),h=g.getVideoTracks()[0];let k,l;h&&h.mimeType&&(k=h.mimeType);const m=c.f.getConfiguration(),n=g.ra();n&&(n.mimeType&&(l=n.mimeType),n.language&&(m.preferredAudioLanguage=n.language),n.roles.length&&(m.preferredAudioRole=n.roles[0]));const p=g.ua();p&&(p.language&&(m.preferredTextLanguage=p.language),p.roles.length&&(m.preferredTextRole=p.roles[0]));const u=f&&typeof f.isLive===_.Kc?f.isLive:c.f.isLive();e={source:f,isLive:u,autoplay:!c.f.isPaused(),
51
- currentTime:Math.max(c.f.getPosition()-1,0),qf:c.f.getPresentationStartTime(),jc:k,nb:l,Fa:m}}var d=e}b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});yield LV(c);c.a&&(d&&(d.autoplay=!c.f.isPaused()),a?yield c.f.open(a):c.a.a||(yield BV(c.a,d)))}}catch(e){c.g.error("Error while trying to cast",e),d=new _.H(_.Td,{detail:e}),c.trigger(d)}})}re(){this.a&&this.a.re()}Gh(a){const b=this;return _.v(function*(){a!==b.h&&(b.h=a,b.a&&(yield zV(b.a)),b.a=MV(b))})}sendMessage(a){const b=this;return _.v(function*(){b.a?
52
- yield b.a.sendMessage(bV,a):b.g.warn(YU)})}Sg(){const a=this;return _.v(function*(){yield a.a.sendMessage(dV,{type:"QUEUE_NEXT",requestId:nV(),mediaSessionId:a.a.a.mediaSessionId})})}Tg(){const a=this;return _.v(function*(){yield a.a.sendMessage(dV,{type:"QUEUE_PREV",requestId:nV(),mediaSessionId:a.a.a.mediaSessionId})})}Rg(a){const b=this;return _.v(function*(){yield b.a.sendMessage(dV,{type:"QUEUE_INSERT",requestId:nV(),mediaSessionId:b.a.a.mediaSessionId,items:a})})}addMessageListener(a){this.a?
53
- this.a.addMessageListener(a):this.g.warn(YU)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(YU)}Mb(){return this.a&&this.a.Mb()}gc(a){this.a&&this.a.gc(a)}Ve(){this.a&&this.a.Ve()}Cf(a){this.a&&this.a.Cf(a)}Af(a){this.a&&this.a.Af(a)}zf(a){this.a&&this.a.zf(a)}Bf(a){this.a&&this.a.Bf(a)}};_.w(ZU,BW);BW.prototype.setContentReleaseDate=BW.prototype.Bf;BW.prototype.setContentArtist=BW.prototype.zf;BW.prototype.setContentImage=BW.prototype.Af;
54
- BW.prototype.setContentTitle=BW.prototype.Cf;BW.prototype.clearContentMetadata=BW.prototype.Ve;BW.prototype.setContentMetadata=BW.prototype.gc;BW.prototype.getContentMetadata=BW.prototype.Mb;BW.prototype.removeMessageListener=BW.prototype.removeMessageListener;BW.prototype.addMessageListener=BW.prototype.addMessageListener;BW.prototype.queueAddItems=BW.prototype.Rg;BW.prototype.queuePreviousItem=BW.prototype.Tg;BW.prototype.queueNextItem=BW.prototype.Sg;BW.prototype.sendMessage=BW.prototype.sendMessage;
55
- BW.prototype.changeReceiverId=BW.prototype.Gh;BW.prototype.forceDisconnect=BW.prototype.re;BW.prototype.cast=BW.prototype.cast;BW.prototype.setPlayerConfigInterceptor=BW.prototype.Zd;BW.prototype.getReceiverName=BW.prototype.Ze;BW.prototype.isCasting=BW.prototype.ya;BW.prototype.canCast=BW.prototype.Sc;BW.prototype.destroy=BW.prototype.destroy;var CW=class extends yW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.ca.bind(this);this.w=this.Z.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ia.bind(this);this.G=this.da.bind(this);this.F=this.P.bind(this);this.f=this.M.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
43
+ 0:0}getStats(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?gV(this.a.customData.stats):_.dp():_.dp()}isLive(){return this.f?Infinity===this.getDuration():!1}load(a){const b=this;return _.v(function*(){if(b.ed())if(xV){b.C=_.gp(a);b.j=_.nm([b.G,a]);var c=b.C[b.B];yield AV(b,{source:c,isLive:c.isLive,autoplay:b.j.autoplay,Fa:b.j,videoMimeType:c.videoMimeType,audioMimeType:c.audioMimeType})}else b.g.warn(TU);else b.g.warn(WU)})}getBufferInfo(){return new _.iu}getTrackManager(){return this.h}getConfiguration(){return this.j}getSurface(){return null}setNetworkEngine(a){this.I=
44
+ a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(VU)}onError(a){if(a&&(this.trigger(new _.H(_.Sd,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.gd}canPlay(){return this.ed()?2:0}Lb(){return this.H}fc(a){this.H=EV(a)}Se(){this.H=null}zf(a){if(this.f){var b=this.Lb()||
45
+ {};a={metadataType:CV(b.metadataType),title:a};this.fc(Object.assign({},b,a))}}xf(a){if(this.f){var b=this.Lb()||{},c=CV(b.metadataType);a=new chrome.cast.Image(a);this.fc(Object.assign({},b,{metadataType:c,images:[a]}))}}wf(a){if(this.f){var b=this.Lb()||{};this.fc(Object.assign({},b,{metadataType:3,artist:a}))}}yf(a){if(this.f){var b=this.Lb()||{};a={metadataType:CV(b.metadataType),releaseDate:a};this.fc(Object.assign({},b,a))}}cb(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===
46
+ cast.framework.CastState.CONNECTED;xV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Ef()}Ub(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;HV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ya()||(this.A=!0,HV(this,a.session),this.Z());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ya()&&
47
+ this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:IV(this),Zg:c,Tf:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.W);a.session.removeMessageListener(aV,this.P);a.session.removeMessageListener(bV,this.U);this.A=!1;this.a=null}}Hb(a){this.g.debug("New media session",a.mediaSession);GV(this,a.mediaSession)}Jb(a){a.value&&
48
+ a.value.tracks&&this.h&&this.h.load()}Ib(a,b){const c=gV(b);this.K.forEach(d=>d(c))}lb(a,b){a=gV(b);"event"===a.type&&a.name===_.ug&&this.trigger(new _.H(_.Tc,{visible:!!a.visible}))}Aa(){this.trigger(new _.H(_.$f))}bb(a){const b=this;return _.v(function*(){let c=null;const d=yield iV(a,[_.Tf,_.Ac],b.I,b.j);d&&(c=new chrome.cast.media.Track(b.ja++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,
49
+ url:a.url});return c})}getTextDisplayer(){return null}},xV=!1,sV=new Set,uV=!1,vV=[];window.__onGCastApiAvailable=wV;_.w("clpp.cast.onReady",function(a){uV?a():vV.push(a)});var AW=class extends _.lu{constructor(a,b,c){super();this.f=a;this.h=b;this.j=this.l;typeof c===_.Wd&&(this.j=(d,e)=>c(_.Zo(d),e));this.a=LV(this);this.g=new _.S(YU);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.v(function*(){a.a&&(yield yV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){11!==a&&0!==a&&(delete b.license,this.f.open(b))}Qc(){return!!this.a&&this.a.ed()&&xV}ya(){return!!this.a&&this.a.ya()}We(){return this.a?this.a.We():""}Xd(a){this.a&&this.a.Xd(a)}cast(a,b){const c=
50
+ this;return _.v(function*(){if(c.a)try{if(yield c.a.cast(),c.a){{let e=null;const f=c.f.Ra();if(f){const g=c.f.getTrackManager(),h=g.getVideoTracks()[0];let k,l;h&&h.mimeType&&(k=h.mimeType);const m=c.f.getConfiguration(),n=g.ra();n&&(n.mimeType&&(l=n.mimeType),n.language&&(m.preferredAudioLanguage=n.language),n.roles.length&&(m.preferredAudioRole=n.roles[0]));const p=g.ua();p&&(p.language&&(m.preferredTextLanguage=p.language),p.roles.length&&(m.preferredTextRole=p.roles[0]));const u=f&&typeof f.isLive===
51
+ _.Mc?f.isLive:c.f.isLive();e={source:f,isLive:u,autoplay:!c.f.isPaused(),currentTime:Math.max(c.f.getPosition()-1,0),mf:c.f.getPresentationStartTime(),videoMimeType:k,audioMimeType:l,Fa:m}}var d=e}b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});yield KV(c);c.a&&(d&&(d.autoplay=!c.f.isPaused()),a?yield c.f.open(a):c.a.a||(yield AV(c.a,d)))}}catch(e){c.g.error("Error while trying to cast",e),d=new _.H(_.Sd,{detail:e}),c.trigger(d)}})}oe(){this.a&&this.a.oe()}Eh(a){const b=this;return _.v(function*(){a!==
52
+ b.h&&(b.h=a,b.a&&(yield yV(b.a)),b.a=LV(b))})}sendMessage(a){const b=this;return _.v(function*(){b.a?yield b.a.sendMessage(aV,a):b.g.warn(XU)})}Qg(){const a=this;return _.v(function*(){yield a.a.sendMessage(cV,{type:"QUEUE_NEXT",requestId:mV(),mediaSessionId:a.a.a.mediaSessionId})})}Rg(){const a=this;return _.v(function*(){yield a.a.sendMessage(cV,{type:"QUEUE_PREV",requestId:mV(),mediaSessionId:a.a.a.mediaSessionId})})}Pg(a){const b=this;return _.v(function*(){yield b.a.sendMessage(cV,{type:"QUEUE_INSERT",
53
+ requestId:mV(),mediaSessionId:b.a.a.mediaSessionId,items:a})})}addMessageListener(a){this.a?this.a.addMessageListener(a):this.g.warn(XU)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(XU)}Lb(){return this.a&&this.a.Lb()}fc(a){this.a&&this.a.fc(a)}Se(){this.a&&this.a.Se()}zf(a){this.a&&this.a.zf(a)}xf(a){this.a&&this.a.xf(a)}wf(a){this.a&&this.a.wf(a)}yf(a){this.a&&this.a.yf(a)}};_.w(YU,AW);AW.prototype.setContentReleaseDate=AW.prototype.yf;
54
+ AW.prototype.setContentArtist=AW.prototype.wf;AW.prototype.setContentImage=AW.prototype.xf;AW.prototype.setContentTitle=AW.prototype.zf;AW.prototype.clearContentMetadata=AW.prototype.Se;AW.prototype.setContentMetadata=AW.prototype.fc;AW.prototype.getContentMetadata=AW.prototype.Lb;AW.prototype.removeMessageListener=AW.prototype.removeMessageListener;AW.prototype.addMessageListener=AW.prototype.addMessageListener;AW.prototype.queueAddItems=AW.prototype.Pg;AW.prototype.queuePreviousItem=AW.prototype.Rg;
55
+ AW.prototype.queueNextItem=AW.prototype.Qg;AW.prototype.sendMessage=AW.prototype.sendMessage;AW.prototype.changeReceiverId=AW.prototype.Eh;AW.prototype.forceDisconnect=AW.prototype.oe;AW.prototype.cast=AW.prototype.cast;AW.prototype.setPlayerConfigInterceptor=AW.prototype.Xd;AW.prototype.getReceiverName=AW.prototype.We;AW.prototype.isCasting=AW.prototype.ya;AW.prototype.canCast=AW.prototype.Qc;AW.prototype.destroy=AW.prototype.destroy;var BW=class extends xW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.ca.bind(this);this.w=this.Z.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ja.bind(this);this.G=this.da.bind(this);this.F=this.P.bind(this);this.f=this.M.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
56
56
  this.H);b.addEventListener(a.MEDIA_FINISHED,this.A);b.addEventListener(a.BUFFERING,this.w);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.f)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.v(function*(){const c=cast.framework.events.EventType,d=cast.framework.CastReceiverContext.getInstance().getPlayerManager();
57
- d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.L);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.H(_.Se));this.a(3)}R(){this.a(4)}ca(){this.a(5)}Z(a){a.isBuffering?
58
- this.a(2):(a=this.player.isPaused()?4:3,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.mg))}U(){this.player.trigger(new _.H(_.lg))}ia(){this.j=2}da(){this.a(1)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Jc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.I(_.D,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Td,{detail:a}));this.a(_.qo)}};var DW=class extends _.Lt{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}Hd(){return this.a}getPosition(){return this.f}Nb(){return this.a[this.f]||null}vg(){return this.a[this.f+1]||null}setPosition(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.H(_.df,{item:this.Nb()})))}append(a){this.a.push(a);NV(this)}zg(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),NV(this))}remove(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,NV(this))}clear(){this.a=[];this.f=
59
- 0;NV(this)}};var EW=class extends _.Lt{constructor(a,b,c){c=void 0===c?()=>Promise.resolve():c;super();this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=()=>{const d=this;return _.v(function*(){if(!d.f){var e=d.a.Nb();if(e){d.f=!0;try{yield d.w(e),yield d.m.open(Object.assign({},e.configuration,{autoplay:!0}))}catch(f){throw f;}finally{d.f=!1}}}})};this.l=()=>{PV(this)}}start(){this.h||this.f||(this.h=!0,this.m.on(_.Sd,this.l),OV(this),this.a.setPosition(this.a.getPosition()))}next(){const a=this.a.Nb();
60
- a&&!1===a.skippable||PV(this)}Wd(){var a=this.a.Nb();a&&!1===a.skippable||(OV(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))}ed(a){const b=this;return _.v(function*(){b.a.setPosition(a)})}stop(){this.h=!1;this.m.off(_.Sd,this.l);this.a.off(_.df,this.o);this.j=!1}};var FW=class{constructor(a,b,c){this.player=a;this.Sb=new DW(c);this.sd=new EW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Sb,()=>_.v(function*(){}));this.a=new BW(this.player,b,(d,e)=>{const f=this;return _.v(function*(){const g=f.Sb.getPosition();f.sd.ed(g);e.autoplay=!0;delete e.license;yield f.player.open(e);typeof e.currentTime===_.r&&(yield f.player.setPosition(Math.max(e.currentTime-1,0)));f.player.play()})});this.f=
61
- d=>{d&&d.type===VU&&typeof d.index===_.r&&this.Sb.setPosition(d.index)};this.a.addMessageListener(this.f)}Bi(a){return this.Sb.on(_.df,a)}Ci(a){return this.Sb.on(_.ef,a)}yi(a){return this.player.on(_.Qc,a)}Sc(){return this.a.Sc()}ci(){return this.Sb.Hd()}ya(){return this.a.ya()}append(a){const b=this;return _.v(function*(){b.Sb.append(a);b.a.ya()&&(yield b.a.Rg(QV([a])))})}Xh(){return this.Sb.getPosition()}start(){this.sd.start()}play(){this.player.play()}pause(){this.player.pause()}destroy(){this.sd.stop();
62
- this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}gj(){const a=this;return _.v(function*(){if(a.a.ya())a.a.re();else{a.sd.stop();var b=QV(a.Sb.Hd()),c=a.Sb.getPosition();yield a.a.cast(void 0,{items:b,startIndex:c})}})}next(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Sg():yield a.sd.next()})}Wd(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Tg():yield a.sd.Wd()})}};_.w("clpp.cast.playlist.CastPlaylist",FW);FW.prototype.previous=FW.prototype.Wd;
63
- FW.prototype.next=FW.prototype.next;FW.prototype.toggleCast=FW.prototype.gj;FW.prototype.destroy=FW.prototype.destroy;FW.prototype.pause=FW.prototype.pause;FW.prototype.play=FW.prototype.play;FW.prototype.start=FW.prototype.start;FW.prototype.getCurrentIndex=FW.prototype.Xh;FW.prototype.append=FW.prototype.append;FW.prototype.isCasting=FW.prototype.ya;FW.prototype.getPlaylistItems=FW.prototype.ci;FW.prototype.canCast=FW.prototype.Sc;FW.prototype.onCastStatusChanged=FW.prototype.yi;
64
- FW.prototype.onPlaylistModified=FW.prototype.Ci;FW.prototype.onPlaylistItemChange=FW.prototype.Bi;var Y=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.r?c:1;this.h=typeof d===_.r?d:1;this.j=typeof e===_.r?e:0}cb(){return"Google Cast Framework"}eb(){return cast.framework.VERSION}gb(){return 0}getId(){return this.a.id}getCreativeId(){return""}zb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||
65
- 0}Bb(){return!1}Pa(){return this.a.clickThroughUrl||null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Ta(){return 0}Sa(){return 0}Ba(){return 0}Ca(){switch(this.pb()){case 0:return 0;case -1:return 2;default:return 1}}getPodIndex(){return this.j}pb(){return this.f.position}fb(){return this.l}Ua(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return null}};Y.prototype.getVideoElement=Y.prototype.Ab;
66
- Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Ua;Y.prototype.getPositionInSequence=Y.prototype.fb;Y.prototype.getPodTimeOffset=Y.prototype.pb;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ca;Y.prototype.getMediaBitrate=Y.prototype.Ba;
67
- Y.prototype.getMediaHeight=Y.prototype.Sa;Y.prototype.getMediaWidth=Y.prototype.Ta;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Pa;Y.prototype.isBumper=Y.prototype.Bb;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
68
- Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.zb;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.gb;Y.prototype.getAdManagerVersion=Y.prototype.eb;Y.prototype.getAdManagerName=Y.prototype.cb;var GW=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Rb(){return!!this.a.find(a=>0===a.position)}Qb(){return!!this.a.find(a=>-1===a.position)}};GW.prototype.hasPostroll=GW.prototype.Qb;GW.prototype.hasPreroll=GW.prototype.Rb;GW.prototype.getCuePoints=GW.prototype.getCuePoints;var HW=class{constructor(a){this.m=a;this.a=null;this.B=this.C.bind(this);this.l=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];this.f=!1;
69
- WV().addEventListener(this.l,this.B)}load(){const a=this;return _.v(function*(){RV&&(RV=!1,VV(a,0))})}j(){return!0}A(){}ib(){-1!==this.getPosition()&&WV().pause()}skip(){}getAdVolume(){SV.warn(eV);return 0}h(){SV.warn(eV)}setMuted(){}isMuted(){return!1}qb(){return-1!==this.getPosition()}isPaused(){return this.f}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.r?a:-1}w(){return!0}o(){const a=this;return _.v(function*(){WV().removeEventListener(a.l,a.B)})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.ib()}resume(){this.j()}C(a){const b=
70
- cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=WV().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.H(_.mc,{adsTimeline:new GW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:YV(this,_.$b,a);break;case cast.framework.events.EventType.BREAK_STARTED:YV(this,_.Qb,a);break;case cast.framework.events.EventType.BREAK_ENDED:YV(this,_.Rb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:YV(this,
71
- _.hc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(YV(this,_.ec,a),YV(this,_.jc,a)):a.endedReason===b.STOPPED?YV(this,_.jc,a):a.endedReason===b.END_OF_STREAM?(YV(this,_.Ub,a),YV(this,_.jc,a)):a.endedReason===b.ERROR&&VV(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;YV(this,_.dc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;YV(this,_.bc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?YV(this,_.Sb,
72
- a):(this.f=!1,YV(this,_.dc,a))}}};HW.prototype.resume=HW.prototype.resume;HW.prototype.pause=HW.prototype.pause;HW.prototype.getVolume=HW.prototype.getVolume;HW.prototype.setVolume=HW.prototype.setVolume;HW.prototype.getPosition=HW.prototype.getPosition;HW.prototype.skip=HW.prototype.skip;var RV=!1,SV=new _.T("clpp.cast.ads.AdsManager");var IW=class{constructor(a){this.a=a;this.f=this.h.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(ZV(),this.f)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(ZV(),this.f)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>$V(a))}h(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
73
- _.Yf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Zf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.$f}b&&this.a(new _.H(b,{detail:$V(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.a(new _.H(_.Yf,{detail:b}))}};var JW=class extends _.V{constructor(){super();this.g=new _.T("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;aW().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;aW().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}sa(){return this.j}ta(){return null}Oa(){const a=
74
- this.ra();return a&&a.renditions[0]}Va(){const a=this.ua();return a&&a.renditions[0]}xb(){return null}Ob(){return null}Pb(){return null}Ha(){return null}ra(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.r&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}ua(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.r&&(b=b.toString(),a=this.sa().find(c=>c.id===b)||null)}return a}Gb(){this.g.warn("Video tracks unavailable on Cast")}za(a){a&&this.f&&
75
- this.f.setActiveById(+a.id)}Za(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}sb(){this.g.warn("Video renditions unavailable on Cast")}Eb(a){this.za(a&&a.track)}Fb(a){this.Za(a&&a.track)}addTextTrack(a){const b=this;return _.v(function*(){var c=b.m.getConfiguration();if((c=yield jV(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c))&&b.a){const d=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);d.isInband=!1;d.language=
76
- c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),cW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}va(){return!0}w(){this.f=aW().getAudioTracksManager();var a=this.f.getTracks();this.h=bW(_.Q,a);cW(this);a=this.m.getConfiguration();dW(this,_.Q,a.preferredAudioLanguage,a.preferredAudioRole);dW(this,_.P,a.preferredTextLanguage,a.preferredTextRole)}};JW.prototype.isAbrEnabled=JW.prototype.va;
77
- JW.prototype.addTextTrack=JW.prototype.addTextTrack;JW.prototype.setTextRendition=JW.prototype.Fb;JW.prototype.setAudioRendition=JW.prototype.Eb;JW.prototype.setVideoRendition=JW.prototype.sb;JW.prototype.setTextTrack=JW.prototype.Za;JW.prototype.setAudioTrack=JW.prototype.za;JW.prototype.setVideoTrack=JW.prototype.Gb;JW.prototype.getTextTrack=JW.prototype.ua;JW.prototype.getAudioTrack=JW.prototype.ra;JW.prototype.getVideoTrack=JW.prototype.Ha;JW.prototype.getLoadingTextRendition=JW.prototype.Pb;
78
- JW.prototype.getLoadingAudioRendition=JW.prototype.Ob;JW.prototype.getLoadingVideoRendition=JW.prototype.xb;JW.prototype.getTextRendition=JW.prototype.Va;JW.prototype.getAudioRendition=JW.prototype.Oa;JW.prototype.getVideoRendition=JW.prototype.ta;JW.prototype.getTextTracks=JW.prototype.sa;JW.prototype.getAudioTracks=JW.prototype.getAudioTracks;JW.prototype.getVideoTracks=JW.prototype.getVideoTracks;var KW=class extends _.Lt{constructor(){super();this.g=new _.T($U);this.h=this.w=_.Um();this.A=null;this.l=-1;this.F=new _.yn;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=eW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new CW(this);this.a.init();this.j=new JW;this.j.initialize(this);this.o=new IW(c=>this.trigger(c));this.o.init()}unload(){const a=
79
- cast.framework.messages.PlayerState,b=eW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.v(function*(){a.B=null;a.w=_.Um();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){eW().play();return Promise.resolve()}pause(){eW().pause();return Promise.resolve()}isPaused(){return eW().getPlayerState()===
80
- cast.framework.messages.PlayerState.PAUSED}isEnded(){return eW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=eW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(RU);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return eW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
81
- eW().getDurationSec();return typeof a===_.r?-1===a?Infinity:a:-1}getPlaybackRate(){return eW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;eW().sendLocalMediaRequest(b)}}getVolume(){this.g.warn(eV);return null}setVolume(){this.g.warn(eV)}setMuted(){this.g.warn(eV)}isMuted(){this.g.warn(eV);return!1}getLoadedSource(){const a=eW().getMediaInformation();if(a){var b=eW().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;
82
- var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,Bj:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return eW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=eW().getLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():_.zo}getStats(){var a=
83
- _.ks();if(this.f){a=eW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.r?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.r?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.v(function*(){b.f=new _.kv;b.a.l=b.f.a;b.A=_.$m(a);b.h=_.Wm([b.w,a]);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;
84
- d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:gV(b.h),local:!0};yield eW().load(d)}})}getBufferInfo(){this.g.warn(_.qa);return new _.Ft}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Wa)}appendLoad(){return Promise.reject(_.Wa)}seekWith(){return Promise.reject(_.Wa)}setNetworkEngine(a){this.F=
85
- a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return $U}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(WU)}onError(a){a=new _.H(_.Td,{detail:a});this.trigger(a)}canPlay(){return _.Ti()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=gV(this.getStats());var b=eW(),c=a.media||b.getMediaInformation();b=
86
- b.getStartAbsoluteTime();c&&typeof b===_.r&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime."+`Old value: ${c.startAbsoluteTime}, `+`new value: ${b}`),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));{c=cast.framework.messages.StreamType;b=a.media;var d=!!b;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=eW().getStartAbsoluteTime();if(typeof d===_.r){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;
87
- h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=hV(a.media.customData.playerConfiguration));var d=null;var e=null;a.media.customData&&(d=hV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),e=hV(a.media.customData.playerConfiguration));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;d=!(!d||!d.lowLatencyMode);b=(e=null!=e&&e.lowLatencyMode||a||d)?iW(b,{streaming:{lowLatencyMode:!0}}):
88
- b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandwidthEstimate===_.r?d.initialBandwidth=a.defaultBandwidthEstimate:d.initialBandwidth=void 0;hW(c,b);a={};d=c.streaming||null;e&&e.useSenderStreamingConfig&&d&&(a.streaming=iV(d,wW));c=c.abr||null;e&&e.useSenderAbrConfig&&c&&(a.abr=iV(c,xW));_.bh(a)&&(b=iW(b,a));return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var kW=class{constructor(){this.a=!1;this.g=new _.T(aV);this.f=this.m=null;this.w=new Set;this.C=this.K.bind(this);this.B=this.F.bind(this);this.o=null;this.l=new _.It;this.j=this.h=this.A=null}init(a){a&&(this.f=new KW,_.Sn(a,this.f),this.m=a,this.l.on(window,"unload",()=>{const b=this;return _.v(function*(){b.m&&b.m.getState()!==_.zo&&(yield fV(b.m))})}))}start(a){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var b=mW(),c=mW().getPlayerManager(),d=new cast.framework.CastReceiverOptions;
89
- a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[bV]=cast.framework.system.MessageType.JSON;d.customNamespaces[cV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.I.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};a.enableSmoothLiveRefresh=!0;d.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())d.mediaElement=a;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&
57
+ d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.L);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.H(_.Qe));this.a(8)}R(){this.a(10)}ca(){this.a(11)}Z(a){a.isBuffering?
58
+ this.a(6):(a=this.player.isPaused()?10:8,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.kg))}U(){this.player.trigger(new _.H(_.jg))}ja(){this.j=2}da(){this.a(2)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Lc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.J(_.C,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Sd,{detail:a}));this.a(3)}};var CW=class extends _.lu{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}Fd(){return this.a}getPosition(){return this.f}Mb(){return this.a[this.f]||null}tg(){return this.a[this.f+1]||null}setPosition(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.H(_.cf,{item:this.Mb()})))}append(a){this.a.push(a);MV(this)}xg(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),MV(this))}remove(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,MV(this))}clear(){this.a=[];this.f=
59
+ 0;MV(this)}};var DW=class extends _.lu{constructor(a,b,c){c=void 0===c?()=>Promise.resolve():c;super();this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=()=>{const d=this;return _.v(function*(){if(!d.f){var e=d.a.Mb();if(e){d.f=!0;try{yield d.w(e),yield d.m.open(Object.assign({},e.configuration,{autoplay:!0}))}catch(f){throw f;}finally{d.f=!1}}}})};this.l=()=>{OV(this)}}start(){this.h||this.f||(this.h=!0,this.m.on(_.Rd,this.l),NV(this),this.a.setPosition(this.a.getPosition()))}next(){const a=this.a.Mb();
60
+ a&&!1===a.skippable||OV(this)}Ud(){var a=this.a.Mb();a&&!1===a.skippable||(NV(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))}cd(a){const b=this;return _.v(function*(){b.a.setPosition(a)})}stop(){this.h=!1;this.m.off(_.Rd,this.l);this.a.off(_.cf,this.o);this.j=!1}};var EW=class{constructor(a,b,c){this.player=a;this.Sb=new CW(c);this.pd=new DW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Sb,()=>_.v(function*(){}));this.a=new AW(this.player,b,(d,e)=>{const f=this;return _.v(function*(){const g=f.Sb.getPosition();f.pd.cd(g);e.autoplay=!0;delete e.license;yield f.player.open(e);typeof e.currentTime===_.r&&(yield f.player.setPosition(Math.max(e.currentTime-1,0)));f.player.play()})});this.f=
61
+ d=>{d&&d.type===UU&&typeof d.index===_.r&&this.Sb.setPosition(d.index)};this.a.addMessageListener(this.f)}zi(a){return this.Sb.on(_.cf,a)}Ai(a){return this.Sb.on(_.df,a)}wi(a){return this.player.on(_.Sc,a)}Qc(){return this.a.Qc()}ai(){return this.Sb.Fd()}ya(){return this.a.ya()}append(a){const b=this;return _.v(function*(){b.Sb.append(a);b.a.ya()&&(yield b.a.Pg(PV([a])))})}Vh(){return this.Sb.getPosition()}start(){this.pd.start()}play(){this.player.play()}pause(){this.player.pause()}destroy(){this.pd.stop();
62
+ this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}fj(){const a=this;return _.v(function*(){if(a.a.ya())a.a.oe();else{a.pd.stop();var b=PV(a.Sb.Fd()),c=a.Sb.getPosition();yield a.a.cast(void 0,{items:b,startIndex:c})}})}next(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Qg():yield a.pd.next()})}Ud(){const a=this;return _.v(function*(){a.a.ya()?yield a.a.Rg():yield a.pd.Ud()})}};_.w("clpp.cast.playlist.CastPlaylist",EW);EW.prototype.previous=EW.prototype.Ud;
63
+ EW.prototype.next=EW.prototype.next;EW.prototype.toggleCast=EW.prototype.fj;EW.prototype.destroy=EW.prototype.destroy;EW.prototype.pause=EW.prototype.pause;EW.prototype.play=EW.prototype.play;EW.prototype.start=EW.prototype.start;EW.prototype.getCurrentIndex=EW.prototype.Vh;EW.prototype.append=EW.prototype.append;EW.prototype.isCasting=EW.prototype.ya;EW.prototype.getPlaylistItems=EW.prototype.ai;EW.prototype.canCast=EW.prototype.Qc;EW.prototype.onCastStatusChanged=EW.prototype.wi;
64
+ EW.prototype.onPlaylistModified=EW.prototype.Ai;EW.prototype.onPlaylistItemChange=EW.prototype.zi;var Y=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.r?c:1;this.h=typeof d===_.r?d:1;this.j=typeof e===_.r?e:0}eb(){return"Google Cast Framework"}fb(){return cast.framework.VERSION}hb(){return 0}getId(){return this.a.id}getCreativeId(){return""}yb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||
65
+ 0}Ab(){return!1}Qa(){return this.a.clickThroughUrl||null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Ua(){return 0}Ta(){return 0}Ba(){return 0}Ca(){switch(this.ob()){case 0:return 0;case -1:return _.Mj;default:return _.Pj}}getPodIndex(){return this.j}ob(){return this.f.position}gb(){return this.l}Va(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}zb(){return null}};Y.prototype.getVideoElement=Y.prototype.zb;
66
+ Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Va;Y.prototype.getPositionInSequence=Y.prototype.gb;Y.prototype.getPodTimeOffset=Y.prototype.ob;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ca;Y.prototype.getMediaBitrate=Y.prototype.Ba;
67
+ Y.prototype.getMediaHeight=Y.prototype.Ta;Y.prototype.getMediaWidth=Y.prototype.Ua;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Qa;Y.prototype.isBumper=Y.prototype.Ab;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
68
+ Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getSourceId=Y.prototype.yb;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.hb;Y.prototype.getAdManagerVersion=Y.prototype.fb;Y.prototype.getAdManagerName=Y.prototype.eb;var FW=class{constructor(a){this.a=a}getCuePoints(){return this.a.map(a=>a.position)}Qb(){return!!this.a.find(a=>0===a.position)}Pb(){return!!this.a.find(a=>-1===a.position)}};FW.prototype.hasPostroll=FW.prototype.Pb;FW.prototype.hasPreroll=FW.prototype.Qb;FW.prototype.getCuePoints=FW.prototype.getCuePoints;var GW=class{constructor(a){this.m=a;this.a=null;this.B=this.C.bind(this);this.l=[cast.framework.events.EventType.PLAYER_LOADING,cast.framework.events.EventType.BREAK_CLIP_LOADING,cast.framework.events.EventType.BREAK_STARTED,cast.framework.events.EventType.BREAK_ENDED,cast.framework.events.EventType.BREAK_CLIP_STARTED,cast.framework.events.EventType.BREAK_CLIP_ENDED,cast.framework.events.EventType.PLAYING,cast.framework.events.EventType.PAUSE,cast.framework.events.EventType.BUFFERING];this.f=!1;
69
+ VV().addEventListener(this.l,this.B)}load(){const a=this;return _.v(function*(){QV&&(QV=!1,UV(a,0))})}j(){return!0}A(){}Ia(){-1!==this.getPosition()&&VV().pause()}skip(){}getAdVolume(){RV.warn(dV);return 0}h(){RV.warn(dV)}setMuted(){}isMuted(){return!1}pb(){return-1!==this.getPosition()}isPaused(){return this.f}getPosition(){const a=this.a&&this.a.getBreakClipCurrentTimeSec();return typeof a===_.r?a:-1}w(){return!0}o(){const a=this;return _.v(function*(){VV().removeEventListener(a.l,a.B)})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ia()}resume(){this.j()}C(a){const b=
70
+ cast.framework.events.EndedReason;switch(a.type){case cast.framework.events.EventType.PLAYER_LOADING:this.a=VV().getBreakManager();this.a.setPlayWatchedBreak(!0);a=this.a.getBreaks();this.m.trigger(new _.H(_.oc,{adsTimeline:new FW(a)}));break;case cast.framework.events.EventType.BREAK_CLIP_LOADING:XV(this,_.bc,a);break;case cast.framework.events.EventType.BREAK_STARTED:XV(this,_.Sb,a);break;case cast.framework.events.EventType.BREAK_ENDED:XV(this,_.Tb,a);break;case cast.framework.events.EventType.BREAK_CLIP_STARTED:XV(this,
71
+ _.kc,a);break;case cast.framework.events.EventType.BREAK_CLIP_ENDED:a.endedReason===b.SKIPPED?(XV(this,_.ic,a),XV(this,_.lc,a)):a.endedReason===b.STOPPED?XV(this,_.lc,a):a.endedReason===b.END_OF_STREAM?(XV(this,_.Wb,a),XV(this,_.lc,a)):a.endedReason===b.ERROR&&UV(this,1);break;case cast.framework.events.EventType.PLAYING:this.f=!1;XV(this,_.fc,a);break;case cast.framework.events.EventType.PAUSE:this.f=!0;XV(this,_.dc,a);break;case cast.framework.events.EventType.BUFFERING:a.isBuffering?XV(this,_.Ub,
72
+ a):(this.f=!1,XV(this,_.fc,a))}}};GW.prototype.resume=GW.prototype.resume;GW.prototype.pause=GW.prototype.pause;GW.prototype.getVolume=GW.prototype.getVolume;GW.prototype.setVolume=GW.prototype.setVolume;GW.prototype.getPosition=GW.prototype.getPosition;GW.prototype.skip=GW.prototype.skip;var QV=!1,RV=new _.S("clpp.cast.ads.AdsManager");var HW=class{constructor(a){this.a=a;this.f=this.h.bind(this)}init(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().addEventListener(YV(),this.f)}release(){cast.framework.CastReceiverContext.getInstance().getPlayerManager().removeEventListener(YV(),this.f)}getTimelineCues(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager().getTimedMetadata().map(a=>ZV(a))}h(a){if(a instanceof cast.framework.events.TimedMetadataEvent){var b=null;switch(a.type){case cast.framework.events.EventType.TIMED_METADATA_CHANGED:b=
73
+ _.Wf;break;case cast.framework.events.EventType.TIMED_METADATA_ENTER:b=_.Xf;break;case cast.framework.events.EventType.TIMED_METADATA_EXIT:b=_.Yf}b&&this.a(new _.H(b,{detail:ZV(a.timedMetadataInfo)}))}else for(b of this.getTimelineCues())this.a(new _.H(_.Wf,{detail:b}))}};var IW=class extends _.U{constructor(){super();this.g=new _.S("clpp.cast.TrackManager");this.m=null;this.o=1E9;this.h=[];this.j=[];this.l=this.w.bind(this);this.a=this.f=null}initialize(a){this.m=a;$V().addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}release(){this.h=[];this.j=[];this.a=this.f=null}load(){}destroy(){this.m=null;$V().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.l)}getVideoTracks(){return[]}getAudioTracks(){return this.h}sa(){return this.j}ta(){return null}Pa(){const a=
74
+ this.ra();return a&&a.renditions[0]}Wa(){const a=this.ua();return a&&a.renditions[0]}wb(){return null}Nb(){return null}Ob(){return null}Ha(){return null}ra(){let a=null;if(this.f){let b=this.f.getActiveId();typeof b===_.r&&(b=b.toString(),a=this.getAudioTracks().find(c=>c.id===b)||null)}return a}ua(){let a=null;if(this.a){let b=this.a.getActiveIds()[0];typeof b===_.r&&(b=b.toString(),a=this.sa().find(c=>c.id===b)||null)}return a}Fb(){this.g.warn("Video tracks unavailable on Cast")}za(a){a&&this.f&&
75
+ this.f.setActiveById(+a.id)}$a(a){this.a&&(a?this.a.setActiveByIds([+a.id]):this.a.setActiveByIds([]))}rb(){this.g.warn("Video renditions unavailable on Cast")}Db(a){this.za(a&&a.track)}Eb(a){this.$a(a&&a.track)}addTextTrack(a){const b=this;return _.v(function*(){var c=b.m.getConfiguration();if((c=yield iV(a,Object.values(cast.framework.messages.CaptionMimeType),b.m.getNetworkEngine(),c))&&b.a){const d=new cast.framework.messages.Track(b.o++,cast.framework.messages.TrackType.TEXT);d.isInband=!1;d.language=
76
+ c.language;d.name=c.label;d.subtype=c.kind;d.trackContentId=c.url;d.trackContentType=c.mimeType;d.customData={mimeType:a.mimeType,url:a.url};try{b.a.addTracks([d]),bW(b)}catch(e){throw b.g.warn("failed on track",a),e;}}})}va(){return!0}w(){this.f=$V().getAudioTracksManager();var a=this.f.getTracks();this.h=aW(_.M,a);bW(this);a=this.m.getConfiguration();cW(this,_.M,a.preferredAudioLanguage,a.preferredAudioRole);cW(this,_.L,a.preferredTextLanguage,a.preferredTextRole)}};IW.prototype.isAbrEnabled=IW.prototype.va;
77
+ IW.prototype.addTextTrack=IW.prototype.addTextTrack;IW.prototype.setTextRendition=IW.prototype.Eb;IW.prototype.setAudioRendition=IW.prototype.Db;IW.prototype.setVideoRendition=IW.prototype.rb;IW.prototype.setTextTrack=IW.prototype.$a;IW.prototype.setAudioTrack=IW.prototype.za;IW.prototype.setVideoTrack=IW.prototype.Fb;IW.prototype.getTextTrack=IW.prototype.ua;IW.prototype.getAudioTrack=IW.prototype.ra;IW.prototype.getVideoTrack=IW.prototype.Ha;IW.prototype.getLoadingTextRendition=IW.prototype.Ob;
78
+ IW.prototype.getLoadingAudioRendition=IW.prototype.Nb;IW.prototype.getLoadingVideoRendition=IW.prototype.wb;IW.prototype.getTextRendition=IW.prototype.Wa;IW.prototype.getAudioRendition=IW.prototype.Pa;IW.prototype.getVideoRendition=IW.prototype.ta;IW.prototype.getTextTracks=IW.prototype.sa;IW.prototype.getAudioTracks=IW.prototype.getAudioTracks;IW.prototype.getVideoTracks=IW.prototype.getVideoTracks;var JW=class extends _.lu{constructor(){super();this.g=new _.S(ZU);this.h=this.w=_.lm();this.A=null;this.l=-1;this.F=new _.Cr;this.f=this.o=this.j=this.a=this.B=null;this.C=!1}init(a,b){this.B=a;b&&(this.h=this.w=b);a=dW();a.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.H.bind(this));a.setMediaPlaybackInfoHandler(this.G.bind(this));this.a=new BW(this);this.a.init();this.j=new IW;this.j.initialize(this);this.o=new HW(c=>this.trigger(c));this.o.init()}unload(){const a=
79
+ cast.framework.messages.PlayerState,b=dW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.v(function*(){a.B=null;a.w=_.lm();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){dW().play();return Promise.resolve()}pause(){dW().pause();return Promise.resolve()}isPaused(){return dW().getPlayerState()===
80
+ cast.framework.messages.PlayerState.PAUSED}isEnded(){return dW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=dW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(QU);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return dW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
81
+ dW().getDurationSec();return typeof a===_.r?-1===a?Infinity:a:-1}getPlaybackRate(){return dW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;dW().sendLocalMediaRequest(b)}}getVolume(){this.g.warn(dV);return null}setVolume(){this.g.warn(dV)}setMuted(){this.g.warn(dV)}isMuted(){this.g.warn(dV);return!1}getLoadedSource(){const a=dW().getMediaInformation();if(a){var b=dW().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;
82
+ var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,drmProtected:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return dW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=dW().getLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():0}getStats(){var a=
83
+ _.dp();if(this.f){a=dW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.r?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.r?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.v(function*(){b.f=new _.Uu;b.a.l=b.f.a;b.A=_.gp(a);b.h=_.nm([b.w,a]);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;
84
+ d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:fV(b.h),local:!0};yield dW().load(d)}})}getBufferInfo(){this.g.warn(_.ra);return new _.iu}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.Ya)}appendLoad(){return Promise.reject(_.Ya)}seekWith(){return Promise.reject(_.Ya)}setNetworkEngine(a){this.F=
85
+ a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return ZU}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(VU)}onError(a){a=new _.H(_.Sd,{detail:a});this.trigger(a)}canPlay(){return _.Xh()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=fV(this.getStats());var b=dW(),c=a.media||b.getMediaInformation();b=
86
+ b.getStartAbsoluteTime();c&&typeof b===_.r&&c.startAbsoluteTime!==b&&(this.g.info("Syncing startAbsoluteTime."+`Old value: ${c.startAbsoluteTime}, `+`new value: ${b}`),c.startAbsoluteTime=b,a=Object.assign({},a,{media:c}));{c=cast.framework.messages.StreamType;b=a.media;var d=!!b;const e=this.isLive(),f=d&&!b.metadata,g=!!a.liveSeekableRange;if(d&&g&&(!e||e&&f)){d=dW().getStartAbsoluteTime();if(typeof d===_.r){b.startAbsoluteTime=d;let h;f?h=new cast.framework.messages.GenericMediaMetadata:h=b.metadata;
87
+ h.sectionStartAbsoluteTime=d;b.metadata=h}b.streamType=c.LIVE;a=Object.assign({},a,{media:b})}}return a}G(a,b){var c=null;a.media.customData&&(c=gV(a.media.customData.playerConfiguration));var d=null;var e=null;a.media.customData&&(d=gV(a.media.customData["com.castlabs.reactnative.PlayerConfiguration"]),e=gV(a.media.customData.playerConfiguration));a=(a=d&&d.LiveConfiguration)?0===a.liveEdgeLatencyMs:!1;d=!(!d||!d.lowLatencyMode);b=(e=null!=e&&e.lowLatencyMode||a||d)?hW(b,{streaming:{lowLatencyMode:!0}}):
88
+ b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandwidthEstimate===_.r?d.initialBandwidth=a.defaultBandwidthEstimate:d.initialBandwidth=void 0;gW(c,b);a={};d=c.streaming||null;e&&e.useSenderStreamingConfig&&d&&(a.streaming=hV(d,vW));c=c.abr||null;e&&e.useSenderAbrConfig&&c&&(a.abr=hV(c,wW));_.$g(a)&&(b=hW(b,a));return b}getTextDisplayer(){return null}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}};var jW=class{constructor(){this.a=!1;this.g=new _.S($U);this.f=this.m=null;this.w=new Set;this.C=this.K.bind(this);this.B=this.F.bind(this);this.o=null;this.l=new _.Et;this.j=this.h=this.A=null}init(a){a&&(this.f=new JW,_.Rr(a,this.f),this.m=a,this.l.on(window,"unload",()=>{const b=this;return _.v(function*(){b.m&&0!==b.m.getPlayerState()&&(yield eV(b.m))})}))}start(a){if(!this.a&&window.cast&&cast.framework&&cast.framework.CastReceiverContext){this.a=!0;var b=lW(),c=lW().getPlayerManager(),d=new cast.framework.CastReceiverOptions;
89
+ a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[aV]=cast.framework.system.MessageType.JSON;d.customNamespaces[bV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.I.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};a.enableSmoothLiveRefresh=!0;d.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())d.mediaElement=a;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&
90
90
  (d.queue=this.h);c.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,e=>{this.g.info("QUEUE_UPDATE message received",e);var f=this.getQueueManager();if(!f)return e;f=f.getCurrentItem();return f?(f=f.customData)&&!1===f.skippable?null:e:e});c.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.H.bind(this));c.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.J.bind(this));c.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
91
- this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(bV,this.B);this.l.on(document,_.zg,()=>{var e={type:"event",name:_.zg,visible:!document.hidden};mW().sendCustomMessage(cV,void 0,e)})}}stop(){if(this.a){this.a=!1;this.l.release();const a=mW();mW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.C);a.removeCustomMessageListener(bV,this.B);a.stop();this.j=this.h=this.m=this.f=
92
- null}}Zd(a){this.o=a}Xi(a){this.A=a}on(a,b){mW().addEventListener(a,b)}off(a,b){mW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Xd&&this.w.add(a)}removeMessageListener(a){typeof a===_.Xd&&this.w.delete(a)}sendMessage(a,b){mW().sendCustomMessage(bV,b,a)}gd(){return this.a}cf(){return this.a}Mb(){return nW()}gc(a){oW(this,a)}nj(a){const b=nW();let c=null;a?c=Object.assign({},b,a):c=b;oW(this,c)}Zi(a){this.h=a;this.j=null}getQueueManager(){return mW().getPlayerManager().getQueueManager()}G(){var a=
93
- this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,mW().sendCustomMessage(bV,void 0,{type:VU,index:a})))}I(a){a=a.trim();if(a.startsWith("#EXTM3U"))return qW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Wf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=mW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.fa);for(var f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");
94
- if(g===_.t||g===_.q){g=e[f].getAttribute(_.ue);var h=e[f].getElementsByTagName(_.ib);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.ue)||g,m=h[k].getAttribute(_.ld);let n=h[k].getAttribute(_.Ig)||void 0,p=h[k].getAttribute(_.Yd)||void 0;void 0!==n&&(n=+n);void 0!==p&&(p=+p);b.canDisplayType(l,m,n,p)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.ib).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return a=(new XMLSerializer).serializeToString(a)}if(c=
95
- b.getElementsByTagName(_.ob)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=mW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.t){e=c[d].getElementsByTagName(_.gb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Oa)||void 0,h=e[f].getAttribute(_.Na)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.sg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.gb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a}H(a){const b=
96
- this;return _.v(function*(){let c=a;var d;c.media.customData&&(d=hV(c.media.customData.playerConfiguration));if(b.m&&d){b.o&&(d=(yield Promise.resolve(b.o(d)))||d);d.ima&&(yield UV(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.r&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.co(b.m,d),yield _.eo(b.m),d=b.m.Qa(),c.media.contentId=d.url,c.media.contentType=d.type,d.jc&&(c.media.hlsVideoSegmentFormat=
97
- kV(d.jc,_.R)),d.nb&&(c.media.hlsSegmentFormat=kV(d.nb,_.Q)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.r&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.A&&(d=yield Promise.resolve(b.A(c)))&&(c=d);return c})}J(a){var b=a.media;b&&b.tracks&&b.tracks.length&&rW(b.tracks);if((b=a.items)&&b.length)for(const c of b)(b=c&&c.media)&&b.tracks&&b.tracks.length&&rW(b.tracks);return a}K(a){if(this.m&&
98
- (!a.media.customData||!a.media.customData.local)){var b=mW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.go(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.w(aV,kW);kW.prototype.getQueueManager=kW.prototype.getQueueManager;kW.prototype.setQueue=kW.prototype.Zi;
99
- kW.prototype.updateContentMetadata=kW.prototype.nj;kW.prototype.setContentMetadata=kW.prototype.gc;kW.prototype.getContentMetadata=kW.prototype.Mb;kW.prototype.isApiReady=kW.prototype.gd;kW.prototype.sendMessage=kW.prototype.sendMessage;kW.prototype.removeMessageListener=kW.prototype.removeMessageListener;kW.prototype.addMessageListener=kW.prototype.addMessageListener;kW.prototype.off=kW.prototype.off;kW.prototype.on=kW.prototype.on;kW.prototype.setLoadRequestDataInterceptor=kW.prototype.Xi;
100
- kW.prototype.setPlayerConfigInterceptor=kW.prototype.Zd;kW.prototype.stop=kW.prototype.stop;kW.prototype.start=kW.prototype.start;kW.prototype.init=kW.prototype.init;kW.getInstance=lW;var jW=null;var LW=class{constructor(a){this.l=a;this.a=null;this.B=new _.It;this.f=null;sW(this)}load(){return _.v(function*(){})}j(){return!0}A(){}ib(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.l.a;a&&this.l.sendMessage(dV,{type:"SKIP_AD",requestId:nV(),mediaSessionId:a.mediaSessionId})}getAdVolume(){return this.l.getVolume()||0}h(a){this.l.setVolume(a)}setMuted(a){this.l.setMuted(a)}isMuted(){return!!this.l.isMuted()}qb(){return this.a?this.a.isPlayingBreak:
101
- !1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.v(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.ib()}resume(){this.j()}C(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.l.trigger(new _.H(_.mc,{adsTimeline:new GW(a.breaks)})));break;case "isPlayingBreak":a.value?
102
- tW(this,_.Qb):(tW(this,_.Ub,this.f),tW(this,_.jc,this.f),this.f=null,tW(this,_.Rb));break;case "isPaused":this.f&&(a.value?tW(this,_.bc):tW(this,_.dc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(tW(this,_.Ub,this.f),tW(this,_.jc,this.f),this.f=uW(this),tW(this,_.hc,this.f)));break;default:this.f||(this.f=uW(this))&&tW(this,_.hc,this.f)}}};LW.prototype.resume=LW.prototype.resume;LW.prototype.pause=LW.prototype.pause;LW.prototype.getVolume=LW.prototype.getVolume;
103
- LW.prototype.setVolume=LW.prototype.setVolume;LW.prototype.getPosition=LW.prototype.getPosition;LW.prototype.skip=LW.prototype.skip;var MW=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.ed?!1:!(!b||!b.ima)}create(a){return new LW(a.a)}};var NW=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return lW().cf()?!(!b||!b.ima):!1}create(a){return new HW(a)}};_.w("clpp.cast.createCastQueue",function(){vW=class extends cast.framework.QueueBase{initialize(a){let b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b}};return new vW});_.Bh(new MW);_.Bh(new NW);};f.call(g, window);
91
+ this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(aV,this.B);this.l.on(document,_.ug,()=>{var e={type:"event",name:_.ug,visible:!document.hidden};lW().sendCustomMessage(bV,void 0,e)})}}stop(){if(this.a){this.a=!1;this.l.release();const a=lW();lW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.C);a.removeCustomMessageListener(aV,this.B);a.stop();this.j=this.h=this.m=this.f=
92
+ null}}Xd(a){this.o=a}Vi(a){this.A=a}on(a,b){lW().addEventListener(a,b)}off(a,b){lW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.Wd&&this.w.add(a)}removeMessageListener(a){typeof a===_.Wd&&this.w.delete(a)}sendMessage(a,b){lW().sendCustomMessage(aV,b,a)}ed(){return this.a}$e(){return this.a}Lb(){return mW()}fc(a){nW(this,a)}mj(a){const b=mW();let c=null;a?c=Object.assign({},b,a):c=b;nW(this,c)}Xi(a){this.h=a;this.j=null}getQueueManager(){return lW().getPlayerManager().getQueueManager()}G(){var a=
93
+ this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,lW().sendCustomMessage(aV,void 0,{type:UU,index:a})))}I(a){a=a.trim();if(a.startsWith("#EXTM3U"))return pW(this,a);try{var b=(new DOMParser).parseFromString(a,_.Uf)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=lW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.ha);for(var f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");
94
+ if(g===_.t||g===_.q){g=e[f].getAttribute(_.se);var h=e[f].getElementsByTagName(_.kb);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.se)||g,m=h[k].getAttribute(_.md);let n=h[k].getAttribute(_.Gg)||void 0,p=h[k].getAttribute(_.Xd)||void 0;void 0!==n&&(n=+n);void 0!==p&&(p=+p);b.canDisplayType(l,m,n,p)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.kb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.ha).length||a.removeChild(c[d])}return a=(new XMLSerializer).serializeToString(a)}if(c=
95
+ b.getElementsByTagName(_.qb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=lW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.t){e=c[d].getElementsByTagName(_.hb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Pa)||void 0,h=e[f].getAttribute(_.Oa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.qg,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.hb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a}H(a){const b=
96
+ this;return _.v(function*(){let c=a;var d;c.media.customData&&(d=gV(c.media.customData.playerConfiguration));if(b.m&&d){b.o&&(d=(yield Promise.resolve(b.o(d)))||d);d.ima&&(yield TV(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.r&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.cs(b.m,d),yield _.ds(b.m),d=b.m.Ra(),c.media.contentId=d.url,c.media.contentType=d.type,d.videoMimeType&&(c.media.hlsVideoSegmentFormat=
97
+ jV(d.videoMimeType,_.N)),d.audioMimeType&&(c.media.hlsSegmentFormat=jV(d.audioMimeType,_.M)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.r&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.A&&(d=yield Promise.resolve(b.A(c)))&&(c=d);return c})}J(a){var b=a.media;b&&b.tracks&&b.tracks.length&&qW(b.tracks);if((b=a.items)&&b.length)for(const c of b)(b=c&&c.media)&&b.tracks&&b.tracks.length&&
98
+ qW(b.tracks);return a}K(a){if(this.m&&(!a.media.customData||!a.media.customData.local)){var b=lW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.fs(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.w($U,jW);jW.prototype.getQueueManager=jW.prototype.getQueueManager;jW.prototype.setQueue=jW.prototype.Xi;
99
+ jW.prototype.updateContentMetadata=jW.prototype.mj;jW.prototype.setContentMetadata=jW.prototype.fc;jW.prototype.getContentMetadata=jW.prototype.Lb;jW.prototype.isApiReady=jW.prototype.ed;jW.prototype.sendMessage=jW.prototype.sendMessage;jW.prototype.removeMessageListener=jW.prototype.removeMessageListener;jW.prototype.addMessageListener=jW.prototype.addMessageListener;jW.prototype.off=jW.prototype.off;jW.prototype.on=jW.prototype.on;jW.prototype.setLoadRequestDataInterceptor=jW.prototype.Vi;
100
+ jW.prototype.setPlayerConfigInterceptor=jW.prototype.Xd;jW.prototype.stop=jW.prototype.stop;jW.prototype.start=jW.prototype.start;jW.prototype.init=jW.prototype.init;jW.getInstance=kW;var iW=null;var KW=class{constructor(a){this.l=a;this.a=null;this.B=new _.Et;this.f=null;rW(this)}load(){return _.v(function*(){})}j(){return!0}A(){}Ia(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.l.a;a&&this.l.sendMessage(cV,{type:"SKIP_AD",requestId:mV(),mediaSessionId:a.mediaSessionId})}getAdVolume(){return this.l.getVolume()||0}h(a){this.l.setVolume(a)}setMuted(a){this.l.setMuted(a)}isMuted(){return!!this.l.isMuted()}pb(){return this.a?this.a.isPlayingBreak:
101
+ !1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.v(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.Ia()}resume(){this.j()}C(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.l.trigger(new _.H(_.oc,{adsTimeline:new FW(a.breaks)})));break;case "isPlayingBreak":a.value?
102
+ sW(this,_.Sb):(sW(this,_.Wb,this.f),sW(this,_.lc,this.f),this.f=null,sW(this,_.Tb));break;case "isPaused":this.f&&(a.value?sW(this,_.dc):sW(this,_.fc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(sW(this,_.Wb,this.f),sW(this,_.lc,this.f),this.f=tW(this),sW(this,_.kc,this.f)));break;default:this.f||(this.f=tW(this))&&sW(this,_.kc,this.f)}}};KW.prototype.resume=KW.prototype.resume;KW.prototype.pause=KW.prototype.pause;KW.prototype.getVolume=KW.prototype.getVolume;
103
+ KW.prototype.setVolume=KW.prototype.setVolume;KW.prototype.getPosition=KW.prototype.getPosition;KW.prototype.skip=KW.prototype.skip;var LW=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.gd?!1:!(!b||!b.ima)}create(a){return new KW(a.a)}};var MW=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return kW().$e()?!(!b||!b.ima):!1}create(a){return new GW(a)}};_.w("clpp.cast.createCastQueue",function(){uW=class extends cast.framework.QueueBase{initialize(a){let b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b}};return new uW});_.up(new LW);_.up(new MW);};f.call(g, window);