-
Notifications
You must be signed in to change notification settings - Fork 2
/
cast_receiver.js
297 lines (297 loc) · 181 KB
/
cast_receiver.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
// Copyright Google Inc. All Rights Reserved.
(function(){'use strict';var g,aa="function"==typeof Object.create?Object.create:function(a){var b=function(){};b.prototype=a;return new b},ba;if("function"==typeof Object.setPrototypeOf)ba=Object.setPrototypeOf;else{var ca;a:{var da={Pe:!0},ea={};try{ea.__proto__=da;ca=ea.Pe;break a}catch(a){}ca=!1}ba=ca?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}
var fa=ba,k=function(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(fa)fa(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Ya=b.prototype},ha="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ia="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:
this,ja=function(){ja=function(){};ia.Symbol||(ia.Symbol=la)},la=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}(),na=function(){ja();var a=ia.Symbol.iterator;a||(a=ia.Symbol.iterator=ia.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&ha(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ma(this)}});na=function(){}},ma=function(a){var b=0;return oa(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})},oa=function(a){na();a={next:a};
a[ia.Symbol.iterator]=function(){return this};return a},l=function(a){na();var b=a[Symbol.iterator];return b?b.call(a):ma(a)},m=this,n=function(a){return void 0!==a},pa=function(a){return"string"==typeof a},p=function(a){return"number"==typeof a},q=function(){},qa=function(a){a.pc=void 0;a.H=function(){return a.pc?a.pc:a.pc=new a}},ra=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==
c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},sa=function(a){return"array"==ra(a)},ta=function(a){return"function"==
ra(a)},ua=function(a){var b=typeof a;return"object"==b&&null!=a||"function"==b},va=function(a,b,c){return a.call.apply(a.bind,arguments)},wa=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},r=function(a,b,c){r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?
va:wa;return r.apply(null,arguments)},xa=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}},ya=Date.now||function(){return+new Date},t=function(a,b){a=a.split(".");var c=m;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&n(b)?c[d]=b:c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}},za=function(a,b){function c(){}c.prototype=b.prototype;a.Ya=
b.prototype;a.prototype=new c;a.prototype.constructor=a;a.lh=function(a,c,f){for(var d=Array(arguments.length-2),e=2;e<arguments.length;e++)d[e-2]=arguments[e];return b.prototype[c].apply(a,d)}};var cast=m.cast||{};var Aa=function(){return!(!cast.__platform__||!cast.__platform__.metrics)},Ba=function(a,b){Aa()&&cast.__platform__.metrics.logIntToUma(a,b)};t("cast.receiver.analytics.logEvent",function(a){Aa()&&cast.__platform__.metrics.logEventToUma(a)});t("cast.receiver.analytics.logBool",function(a,b){Aa()&&cast.__platform__.metrics.logBoolToUma(a,b)});t("cast.receiver.analytics.logInt",Ba);t("cast.receiver.analytics.logHistogramValue",function(a,b,c,d,e){Aa()&&cast.__platform__.metrics.logHistogramValueToUma(a,b,c,d,e)});t("cast.receiver.VERSION","2.0.0");var Ca=function(a,b){a=a.toLowerCase();b=b.toLowerCase();return 0==a.indexOf(b)||0==b.indexOf(a)};var Da=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,Da);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))};za(Da,Error);Da.prototype.name="CustomError";var Ea=function(a,b){a=a.split("%s");for(var c="",d=a.length-1,e=0;e<d;e++)c+=a[e]+(e<b.length?b[e]:"%s");Da.call(this,c+a[d])};za(Ea,Da);Ea.prototype.name="AssertionError";
var Fa=function(a,b,c,d){var e="Assertion failed";if(c){e+=": "+c;var f=d}else a&&(e+=": "+a,f=b);throw new Ea(""+e,f||[]);},v=function(a,b,c){a||Fa("",null,b,Array.prototype.slice.call(arguments,2));return a},Ga=function(a,b){throw new Ea("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));},Ha=function(a,b,c){p(a)||Fa("Expected number but got %s: %s.",[ra(a),a],b,Array.prototype.slice.call(arguments,2));return a},Ia=function(a,b,c){ta(a)||Fa("Expected function but got %s: %s.",[ra(a),
a],b,Array.prototype.slice.call(arguments,2))};var Ja=Array.prototype.indexOf?function(a,b){v(null!=a.length);return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(pa(a))return pa(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},Ka=Array.prototype.lastIndexOf?function(a,b){v(null!=a.length);return Array.prototype.lastIndexOf.call(a,b,a.length-1)}:function(a,b){var c=a.length-1;0>c&&(c=Math.max(0,a.length+c));if(pa(a))return pa(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in
a&&a[c]===b)return c;return-1},Ma=function(a,b){b=Ja(a,b);var c;(c=0<=b)&&La(a,b);return c},La=function(a,b){v(null!=a.length);Array.prototype.splice.call(a,b,1)},Oa=function(a,b,c,d){v(null!=a.length);return Array.prototype.splice.apply(a,Na(arguments,1))},Na=function(a,b,c){v(null!=a.length);return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Qa=function(a,b){return 0==Pa(b,a.substr(0,b.length))},Ra=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},Pa=function(a,b){a=String(a).toLowerCase();b=String(b).toLowerCase();return a<b?-1:a==b?0:1},Sa=String.prototype.repeat?function(a,b){return a.repeat(b)}:function(a,b){return Array(b+1).join(a)},Ta=function(a,b){a=n(void 0)?a.toFixed(void 0):String(a);var c=a.indexOf(".");-1==c&&(c=a.length);return Sa("0",Math.max(0,b-c))+a},
Ua=function(a,b){return a<b?-1:a>b?1:0};var Va;a:{var Wa=m.navigator;if(Wa){var Xa=Wa.userAgent;if(Xa){Va=Xa;break a}}Va=""}var w=function(a){return-1!=Va.indexOf(a)};var Ya=function(a,b,c){for(var d in a)b.call(c,a[d],d,a)},Za=function(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return!0;return!1},$a=function(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b},ab=function(a,b){return null!==a&&b in a},bb=function(a){var b={},c;for(c in a)b[c]=a[c];return b},cb=function(a){var b=ra(a);if("object"==b||"array"==b){if(ta(a.clone))return a.clone();b="array"==b?[]:{};for(var c in a)b[c]=cb(a[c]);return b}return a},db="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),
eb=function(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<db.length;f++)c=db[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var fb=function(a){fb[" "](a);return a};fb[" "]=q;var gb=w("Opera"),hb=w("Trident")||w("MSIE"),ib=w("Edge"),jb=w("Gecko")&&!(-1!=Va.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),kb=-1!=Va.toLowerCase().indexOf("webkit")&&!w("Edge"),lb=function(){var a=m.document;return a?a.documentMode:void 0},mb;
a:{var nb="",ob=function(){var a=Va;if(jb)return/rv:([^\);]+)(\)|;)/.exec(a);if(ib)return/Edge\/([\d\.]+)/.exec(a);if(hb)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(kb)return/WebKit\/(\S+)/.exec(a);if(gb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();ob&&(nb=ob?ob[1]:"");if(hb){var pb=lb();if(null!=pb&&pb>parseFloat(nb)){mb=String(pb);break a}}mb=nb}var qb=mb,rb={},sb;var tb=m.document;sb=tb&&hb?lb()||("CSS1Compat"==tb.compatMode?parseInt(qb,10):5):void 0;var ub=Object.freeze||function(a){return a};var vb=function(a,b,c){this.reset(a,b,c,void 0,void 0)};vb.prototype.Ua=0;vb.prototype.Yc=null;var wb=0;vb.prototype.reset=function(a,b,c,d,e){this.Ua="number"==typeof e?e:wb++;this.Je=d||ya();this.Ja=a;this.mg=b;this.ae=c;delete this.Yc};vb.prototype.zd=function(a){this.Ja=a};var xb=function(a){this.ee=a;this.Kb=this.Rc=this.Ja=this.Y=null},yb=function(a,b){this.name=a;this.value=b};yb.prototype.toString=function(){return this.name};
var zb=new yb("SHOUT",1200),Ab=new yb("SEVERE",1E3),Bb=new yb("WARNING",900),Cb=new yb("INFO",800),Db=new yb("CONFIG",700),Eb=new yb("FINE",500),x=new yb("FINER",400),Fb=[new yb("OFF",Infinity),zb,Ab,Bb,Cb,Db,Eb,x,new yb("FINEST",300),new yb("ALL",0)],Gb=null,Hb=function(a){if(!Gb){Gb={};for(var b=0,c;c=Fb[b];b++)Gb[c.value]=c,Gb[c.name]=c}if(a in Gb)return Gb[a];for(b=0;b<Fb.length;++b)if(c=Fb[b],c.value<=a)return c;return null};xb.prototype.getName=function(){return this.ee};
xb.prototype.getParent=function(){return this.Y};xb.prototype.zd=function(a){this.Ja=a};var Ib=function(a){if(a.Ja)return a.Ja;if(a.Y)return Ib(a.Y);Ga("Root logger has no level set.");return null};xb.prototype.log=function(a,b,c){if(a.value>=Ib(this).value)for(ta(b)&&(b=b()),a=new vb(a,String(b),this.ee),c&&(a.Yc=c),c=this;c;){var d=c,e=a;if(d.Kb)for(var f=0;b=d.Kb[f];f++)b(e);c=c.getParent()}};xb.prototype.info=function(a,b){this.log(Cb,a,b)};
var Jb={},Kb=null,Lb=function(){Kb||(Kb=new xb(""),Jb[""]=Kb,Kb.zd(Db))},y=function(a){Lb();var b;if(!(b=Jb[a])){b=new xb(a);var c=a.lastIndexOf("."),d=a.substr(c+1);c=y(a.substr(0,c));c.Rc||(c.Rc={});c.Rc[d]=b;b.Y=c;Jb[a]=b}return b};var z=function(){this.Eb=this.Eb;this.La=this.La};z.prototype.Eb=!1;z.prototype.Z=function(){this.Eb||(this.Eb=!0,this.O())};var Mb=function(a,b){a.Eb?n(void 0)?b.call(void 0):b():(a.La||(a.La=[]),a.La.push(n(void 0)?r(b,void 0):b))};z.prototype.O=function(){if(this.La)for(;this.La.length;)this.La.shift()()};var Nb=function(a){a&&"function"==typeof a.Z&&a.Z()};var A=function(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.Ra=!1;this.ue=!0};A.prototype.stopPropagation=function(){this.Ra=!0};A.prototype.preventDefault=function(){this.defaultPrevented=!0;this.ue=!1};var Ob;(Ob=!hb)||(Ob=9<=Number(sb));var Pb=Ob,Qb;
if(Qb=hb){var Rb;if(Object.prototype.hasOwnProperty.call(rb,"9"))Rb=rb["9"];else{for(var Sb=0,Tb=Ra(String(qb)).split("."),Ub=Ra("9").split("."),Vb=Math.max(Tb.length,Ub.length),Wb=0;0==Sb&&Wb<Vb;Wb++){var Xb=Tb[Wb]||"",Yb=Ub[Wb]||"";do{var Zb=/(\d*)(\D*)(.*)/.exec(Xb)||["","","",""],$b=/(\d*)(\D*)(.*)/.exec(Yb)||["","","",""];if(0==Zb[0].length&&0==$b[0].length)break;Sb=Ua(0==Zb[1].length?0:parseInt(Zb[1],10),0==$b[1].length?0:parseInt($b[1],10))||Ua(0==Zb[2].length,0==$b[2].length)||Ua(Zb[2],$b[2]);
Xb=Zb[3];Yb=$b[3]}while(0==Sb)}Rb=rb["9"]=0<=Sb}Qb=!Rb}var ac=Qb,bc=function(){if(!m.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});m.addEventListener("test",q,b);m.removeEventListener("test",q,b);return a}();var dc=function(a,b){A.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.key="";this.charCode=this.keyCode=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.state=null;this.pointerId=0;this.pointerType="";this.hb=null;if(a){var c=this.type=a.type,d=a.changedTouches?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.currentTarget=b;if(b=a.relatedTarget){if(jb){a:{try{fb(b.nodeName);
var e=!0;break a}catch(f){}e=!1}e||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;null===d?(this.offsetX=kb||void 0!==a.offsetX?a.offsetX:a.layerX,this.offsetY=kb||void 0!==a.offsetY?a.offsetY:a.layerY,this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0):(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,
this.screenX=d.screenX||0,this.screenY=d.screenY||0);this.button=a.button;this.keyCode=a.keyCode||0;this.key=a.key||"";this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType=pa(a.pointerType)?a.pointerType:cc[a.pointerType]||"";this.state=a.state;this.hb=a;a.defaultPrevented&&this.preventDefault()}};za(dc,A);var cc=ub({2:"touch",3:"pen",4:"mouse"});
dc.prototype.stopPropagation=function(){dc.Ya.stopPropagation.call(this);this.hb.stopPropagation?this.hb.stopPropagation():this.hb.cancelBubble=!0};dc.prototype.preventDefault=function(){dc.Ya.preventDefault.call(this);var a=this.hb;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,ac)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var ec="closure_listenable_"+(1E6*Math.random()|0),fc=function(a){return!(!a||!a[ec])},gc=0;var hc=function(a,b,c,d,e){this.listener=a;this.Bc=null;this.src=b;this.type=c;this.capture=!!d;this.nc=e;this.key=++gc;this.ub=this.gc=!1},ic=function(a){a.ub=!0;a.listener=null;a.Bc=null;a.src=null;a.nc=null};var jc=function(a){this.src=a;this.I={};this.Zb=0};jc.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.I[f];a||(a=this.I[f]=[],this.Zb++);var h=kc(a,b,d,e);-1<h?(b=a[h],c||(b.gc=!1)):(b=new hc(b,this.src,f,!!d,e),b.gc=c,a.push(b));return b};jc.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.I))return!1;var e=this.I[a];b=kc(e,b,c,d);return-1<b?(ic(e[b]),La(e,b),0==e.length&&(delete this.I[a],this.Zb--),!0):!1};
var lc=function(a,b){var c=b.type;c in a.I&&Ma(a.I[c],b)&&(ic(b),0==a.I[c].length&&(delete a.I[c],a.Zb--))};jc.prototype.vd=function(a){a=a&&a.toString();var b=0,c;for(c in this.I)if(!a||c==a){for(var d=this.I[c],e=0;e<d.length;e++)++b,ic(d[e]);delete this.I[c];this.Zb--}};jc.prototype.Jb=function(a,b,c,d){a=this.I[a.toString()];var e=-1;a&&(e=kc(a,b,c,d));return-1<e?a[e]:null};
jc.prototype.hasListener=function(a,b){var c=n(a),d=c?a.toString():"",e=n(b);return Za(this.I,function(a){for(var f=0;f<a.length;++f)if(!(c&&a[f].type!=d||e&&a[f].capture!=b))return!0;return!1})};var kc=function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.ub&&f.listener==b&&f.capture==!!c&&f.nc==d)return e}return-1};var mc="closure_lm_"+(1E6*Math.random()|0),nc={},oc=0,B=function(a,b,c,d,e){if(d&&d.once)return pc(a,b,c,d,e);if(sa(b)){for(var f=0;f<b.length;f++)B(a,b[f],c,d,e);return null}c=qc(c);return fc(a)?a.ob(b,c,ua(d)?!!d.capture:!!d,e):rc(a,b,c,!1,d,e)},rc=function(a,b,c,d,e,f){if(!b)throw Error("Invalid event type");var h=ua(e)?!!e.capture:!!e,u=sc(a);u||(a[mc]=u=new jc(a));c=u.add(b,c,d,h,f);if(c.Bc)return c;d=tc();c.Bc=d;d.src=a;d.listener=c;if(a.addEventListener)bc||(e=h),void 0===e&&(e=!1),a.addEventListener(b.toString(),
d,e);else if(a.attachEvent)a.attachEvent(uc(b.toString()),d);else if(a.addListener&&a.removeListener)v("change"===b,"MediaQueryList only has a change event"),a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");oc++;return c},tc=function(){var a=vc,b=Pb?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b},pc=function(a,b,c,d,e){if(sa(b)){for(var f=0;f<b.length;f++)pc(a,b[f],c,d,e);return null}c=qc(c);return fc(a)?
a.$d(b,c,ua(d)?!!d.capture:!!d,e):rc(a,b,c,!0,d,e)},wc=function(a,b,c,d,e){if(sa(b))for(var f=0;f<b.length;f++)wc(a,b[f],c,d,e);else d=ua(d)?!!d.capture:!!d,c=qc(c),fc(a)?a.$b(b,c,d,e):a&&(a=sc(a))&&(b=a.Jb(b,c,d,e))&&xc(b)},xc=function(a){if(!p(a)&&a&&!a.ub){var b=a.src;if(fc(b))lc(b.$,a);else{var c=a.type,d=a.Bc;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(uc(c),d):b.addListener&&b.removeListener&&b.removeListener(d);oc--;(c=sc(b))?(lc(c,a),0==c.Zb&&(c.src=
null,b[mc]=null)):ic(a)}}},uc=function(a){return a in nc?nc[a]:nc[a]="on"+a},zc=function(a,b,c,d){var e=!0;if(a=sc(a))if(b=a.I[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.capture==c&&!f.ub&&(f=yc(f,d),e=e&&!1!==f)}return e},yc=function(a,b){var c=a.listener,d=a.nc||a.src;a.gc&&xc(a);return c.call(d,b)},Ac=function(a,b){v(fc(a),"Can not use goog.events.dispatchEvent with non-goog.events.Listenable instance.");return a.dispatchEvent(b)},vc=function(a,b){if(a.ub)return!0;if(!Pb){if(!b)a:{b=
["window","event"];for(var c=m,d=0;d<b.length;d++)if(c=c[b[d]],null==c){b=null;break a}b=c}d=b;b=new dc(d,this);c=!0;if(!(0>d.keyCode||void 0!=d.returnValue)){a:{var e=!1;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(h){e=!0}if(e||void 0==d.returnValue)d.returnValue=!0}d=[];for(e=b.currentTarget;e;e=e.parentNode)d.push(e);a=a.type;for(e=d.length-1;!b.Ra&&0<=e;e--){b.currentTarget=d[e];var f=zc(d[e],a,!0,b);c=c&&f}for(e=0;!b.Ra&&e<d.length;e++)b.currentTarget=d[e],f=zc(d[e],a,!1,b),c=c&&f}return c}return yc(a,
new dc(b,this))},sc=function(a){a=a[mc];return a instanceof jc?a:null},Bc="__closure_events_fn_"+(1E9*Math.random()>>>0),qc=function(a){v(a,"Listener can not be null.");if(ta(a))return a;v(a.handleEvent,"An object listener must have handleEvent method.");a[Bc]||(a[Bc]=function(b){return a.handleEvent(b)});return a[Bc]};var C=function(){z.call(this);this.$=new jc(this);this.Qe=this;this.ud=null};za(C,z);C.prototype[ec]=!0;g=C.prototype;g.addEventListener=function(a,b,c,d){B(this,a,b,c,d)};g.removeEventListener=function(a,b,c,d){wc(this,a,b,c,d)};
g.dispatchEvent=function(a){Cc(this);var b=this.ud;if(b){var c=[];for(var d=1;b;b=b.ud)c.push(b),v(1E3>++d,"infinite loop")}b=this.Qe;d=a.type||a;if(pa(a))a=new A(a,b);else if(a instanceof A)a.target=a.target||b;else{var e=a;a=new A(d,b);eb(a,e)}e=!0;if(c)for(var f=c.length-1;!a.Ra&&0<=f;f--){var h=a.currentTarget=c[f];e=Dc(h,d,!0,a)&&e}a.Ra||(h=a.currentTarget=b,e=Dc(h,d,!0,a)&&e,a.Ra||(e=Dc(h,d,!1,a)&&e));if(c)for(f=0;!a.Ra&&f<c.length;f++)h=a.currentTarget=c[f],e=Dc(h,d,!1,a)&&e;return e};
g.O=function(){C.Ya.O.call(this);this.$&&this.$.vd(void 0);this.ud=null};g.ob=function(a,b,c,d){Cc(this);return this.$.add(String(a),b,!1,c,d)};g.$d=function(a,b,c,d){return this.$.add(String(a),b,!0,c,d)};g.$b=function(a,b,c,d){this.$.remove(String(a),b,c,d)};var Dc=function(a,b,c,d){b=a.$.I[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.ub&&h.capture==c){var u=h.listener,Z=h.nc||h.src;h.gc&&lc(a.$,h);e=!1!==u.call(Z,d)&&e}}return e&&0!=d.ue};
C.prototype.Jb=function(a,b,c,d){return this.$.Jb(String(a),b,c,d)};C.prototype.hasListener=function(a,b){return this.$.hasListener(n(a)?String(a):void 0,b)};var Cc=function(a){v(a.$,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};var D=function(a,b,c){a&&a.log(b,c,void 0)},E=function(a,b){a&&a.log(Ab,b,void 0)},F=function(a,b){a&&a.log(Bb,b,void 0)},G=function(a,b){a&&a.info(b,void 0)},Ec=function(a,b){a&&a.log(Eb,b,void 0)};var H=function(a,b){this.Ta=b;this.ed=!0;this.gb=a;this.onClose=this.onMessage=null;this.l=new C;this.gb.addEventListener(this.Ta,this.yc.bind(this))};t("cast.receiver.CastChannel",H);H.prototype.sa=function(){return"CastChannel["+this.Ta+" "+this.gb.Ga()+"]"};H.prototype.Ga=function(){return this.gb.Ga()};H.prototype.getNamespace=H.prototype.Ga;H.prototype.Yf=function(){return this.Ta};H.prototype.getSenderId=H.prototype.Yf;
H.prototype.yc=function(a){D(Fc,x,"Dispatching CastChannel message ["+this.gb.Ga()+", "+this.Ta+"]: "+a.data);a=new Gc("message",a.data);if(this.onMessage)this.onMessage(a);this.g(a)};H.prototype.close=function(){if(this.ed){this.ed=!1;G(Fc,"Closing CastChannel ["+this.gb.Ga()+", "+this.Ta+"]");var a=new Gc("close",this.Ta);if(this.onClose)this.onClose(a);this.g(a);this.l.Z();D(Fc,x,"Disposed "+this.sa())}};
H.prototype.send=function(a){if(!this.ed)throw Error("Invalid state, socket not open");this.gb.send(this.Ta,a)};H.prototype.send=H.prototype.send;H.prototype.addEventListener=function(a,b){B(this.l,a,b)};H.prototype.addEventListener=H.prototype.addEventListener;H.prototype.removeEventListener=function(a,b){wc(this.l,a,b)};H.prototype.removeEventListener=H.prototype.removeEventListener;H.prototype.g=function(a){a.target=this;return Ac(this.l,a)};H.prototype.dispatchEvent=function(a){return this.g(a)};
H.prototype.dispatchEvent=H.prototype.dispatchEvent;H.EventType={MESSAGE:"message",CLOSE:"close"};var Gc=function(a,b){A.call(this,a);this.message=b};k(Gc,A);H.Event=Gc;var Fc=y("cast.receiver.CastChannel");var Hc=function(a,b){this.hg=100;this.cf=a;this.Bg=b;this.wc=0;this.oc=null};Hc.prototype.get=function(){if(0<this.wc){this.wc--;var a=this.oc;this.oc=a.next;a.next=null}else a=this.cf();return a};Hc.prototype.put=function(a){this.Bg(a);this.wc<this.hg&&(this.wc++,a.next=this.oc,this.oc=a)};var Ic=function(a){m.setTimeout(function(){throw a;},0)},Jc,Kc=function(){var a=m.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!w("Presto")&&(a=function(){var a=document.createElement("IFRAME");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow;a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host;
a=r(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!w("Trident")&&!w("MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(n(c.next)){c=c.next;var a=c.Md;c.Md=null;a()}};return function(a){d.next={Md:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?
function(a){var b=document.createElement("SCRIPT");b.onreadystatechange=function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){m.setTimeout(a,0)}};var Lc=function(){this.Mc=this.bb=null},Nc=new Hc(function(){return new Mc},function(a){a.reset()});Lc.prototype.add=function(a,b){var c=Nc.get();c.set(a,b);this.Mc?this.Mc.next=c:(v(!this.bb),this.bb=c);this.Mc=c};Lc.prototype.remove=function(){var a=null;this.bb&&(a=this.bb,this.bb=this.bb.next,this.bb||(this.Mc=null),a.next=null);return a};var Mc=function(){this.next=this.scope=this.$c=null};Mc.prototype.set=function(a,b){this.$c=a;this.scope=b;this.next=null};
Mc.prototype.reset=function(){this.next=this.scope=this.$c=null};var Sc=function(a,b){Oc||Pc();Qc||(Oc(),Qc=!0);Rc.add(a,b)},Oc,Pc=function(){if(m.Promise&&m.Promise.resolve){var a=m.Promise.resolve(void 0);Oc=function(){a.then(Tc)}}else Oc=function(){var a=Tc;!ta(m.setImmediate)||m.Window&&m.Window.prototype&&!w("Edge")&&m.Window.prototype.setImmediate==m.setImmediate?(Jc||(Jc=Kc()),Jc(a)):m.setImmediate(a)}},Qc=!1,Rc=new Lc,Tc=function(){for(var a;a=Rc.remove();){try{a.$c.call(a.scope)}catch(b){Ic(b)}Nc.put(a)}Qc=!1};var Wc=function(a){this.T=0;this.se=void 0;this.fb=this.la=this.Y=null;this.mc=this.Zc=!1;if(a!=q)try{var b=this;a.call(void 0,function(a){Uc(b,2,a)},function(a){if(!(a instanceof Vc))try{if(a instanceof Error)throw a;throw Error("Promise rejected.");}catch(d){}Uc(b,3,a)})}catch(c){Uc(this,3,c)}},Xc=function(){this.next=this.context=this.pb=this.Ma=this.Ea=null;this.dc=!1};Xc.prototype.reset=function(){this.context=this.pb=this.Ma=this.Ea=null;this.dc=!1};
var Yc=new Hc(function(){return new Xc},function(a){a.reset()}),Zc=function(a,b,c){var d=Yc.get();d.Ma=a;d.pb=b;d.context=c;return d},$c=function(){var a=new Wc(q);Uc(a,2,void 0);return a},bd=function(){var a,b,c=new Wc(function(c,e){a=c;b=e});return new ad(c,a,b)};
Wc.prototype.then=function(a,b,c){null!=a&&Ia(a,"opt_onFulfilled should be a function.");null!=b&&Ia(b,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");return cd(this,ta(a)?a:null,ta(b)?b:null,c)};Wc.prototype.then=Wc.prototype.then;Wc.prototype.$goog_Thenable=!0;Wc.prototype.cancel=function(a){0==this.T&&Sc(function(){var b=new Vc(a);dd(this,b)},this)};
var dd=function(a,b){if(0==a.T)if(a.Y){var c=a.Y;if(c.la){for(var d=0,e=null,f=null,h=c.la;h&&(h.dc||(d++,h.Ea==a&&(e=h),!(e&&1<d)));h=h.next)e||(f=h);e&&(0==c.T&&1==d?dd(c,b):(f?(d=f,v(c.la),v(null!=d),d.next==c.fb&&(c.fb=d),d.next=d.next.next):ed(c),fd(c,e,3,b)))}a.Y=null}else Uc(a,3,b)},hd=function(a,b){a.la||2!=a.T&&3!=a.T||gd(a);v(null!=b.Ma);a.fb?a.fb.next=b:a.la=b;a.fb=b},cd=function(a,b,c,d){var e=Zc(null,null,null);e.Ea=new Wc(function(a,h){e.Ma=b?function(c){try{var e=b.call(d,c);a(e)}catch(ka){h(ka)}}:
a;e.pb=c?function(b){try{var e=c.call(d,b);!n(e)&&b instanceof Vc?h(b):a(e)}catch(ka){h(ka)}}:h});e.Ea.Y=a;hd(a,e);return e.Ea};Wc.prototype.Wg=function(a){v(1==this.T);this.T=0;Uc(this,2,a)};Wc.prototype.Xg=function(a){v(1==this.T);this.T=0;Uc(this,3,a)};
var Uc=function(a,b,c){if(0==a.T){a===c&&(b=3,c=new TypeError("Promise cannot resolve to itself"));a.T=1;a:{var d=c,e=a.Wg,f=a.Xg;if(d instanceof Wc){null!=e&&Ia(e,"opt_onFulfilled should be a function.");null!=f&&Ia(f,"opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?");hd(d,Zc(e||q,f||null,a));var h=!0}else{if(d)try{var u=!!d.$goog_Thenable}catch(ka){u=!1}else u=!1;if(u)d.then(e,f,a),h=!0;else{if(ua(d))try{var Z=d.then;if(ta(Z)){id(d,Z,e,
f,a);h=!0;break a}}catch(ka){f.call(a,ka);h=!0;break a}h=!1}}}h||(a.se=c,a.T=b,a.Y=null,gd(a),3!=b||c instanceof Vc||jd(a,c))}},id=function(a,b,c,d,e){var f=!1,h=function(a){f||(f=!0,c.call(e,a))},u=function(a){f||(f=!0,d.call(e,a))};try{b.call(a,h,u)}catch(Z){u(Z)}},gd=function(a){a.Zc||(a.Zc=!0,Sc(a.Kf,a))},ed=function(a){var b=null;a.la&&(b=a.la,a.la=b.next,b.next=null);a.la||(a.fb=null);null!=b&&v(null!=b.Ma);return b};
Wc.prototype.Kf=function(){for(var a;a=ed(this);)fd(this,a,this.T,this.se);this.Zc=!1};var fd=function(a,b,c,d){if(3==c&&b.pb&&!b.dc)for(;a&&a.mc;a=a.Y)a.mc=!1;if(b.Ea)b.Ea.Y=null,kd(b,c,d);else try{b.dc?b.Ma.call(b.context):kd(b,c,d)}catch(e){ld.call(null,e)}Yc.put(b)},kd=function(a,b,c){2==b?a.Ma.call(a.context,c):a.pb&&a.pb.call(a.context,c)},jd=function(a,b){a.mc=!0;Sc(function(){a.mc&&ld.call(null,b)})},ld=Ic,Vc=function(a){Da.call(this,a)};za(Vc,Da);Vc.prototype.name="cancel";
var ad=function(a,b,c){this.Ub=a;this.resolve=b;this.reject=c};var md=function(a,b,c){if(ta(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:m.setTimeout(a,b||0)};var od=function(a,b){C.call(this);"object"!=typeof a&&(a={Ue:a,Uf:b});this.Ve=0!=a.Ue;this.ad=a.Uf||nd;this.We=a.binaryType||"blob";this.vc=this.ad(this.Vb)};za(od,C);g=od.prototype;g.R=null;g.qa=null;g.sb=void 0;g.Tc=!1;g.Vb=0;g.Sa=null;var pd=od.prototype,qd=y("goog.net.WebSocket");pd.V=qd;var nd=function(a){return Math.min(1E3*Math.pow(2,a),6E4)};g=od.prototype;
g.open=function(a,b){v(m.WebSocket,"This browser does not support WebSocket");v(!this.Lb(),"The WebSocket is already open");null!=this.Sa&&m.clearTimeout(this.Sa);this.Sa=null;this.qa=a;(this.sb=b)?(G(this.V,"Opening the WebSocket on "+this.qa+" with protocol "+this.sb),this.R=new WebSocket(this.qa,this.sb)):(G(this.V,"Opening the WebSocket on "+this.qa),this.R=new WebSocket(this.qa));this.R.binaryType=this.We;this.R.onopen=r(this.qg,this);this.R.onclose=r(this.og,this);this.R.onmessage=r(this.S,
this);this.R.onerror=r(this.nd,this)};g.close=function(){null!=this.Sa&&m.clearTimeout(this.Sa);this.Sa=null;this.R&&(G(this.V,"Closing the WebSocket."),this.Tc=!0,this.R.close(),this.R=null)};g.send=function(a){v(this.Lb(),"Cannot send without an open socket");this.R.send(a)};g.Lb=function(){return!!this.R&&1==this.R.readyState};g.qg=function(){G(this.V,"WebSocket opened on "+this.qa);this.dispatchEvent("d");this.Vb=0;this.vc=this.ad(this.Vb)};
g.og=function(a){G(this.V,"The WebSocket on "+this.qa+" closed.");this.dispatchEvent("a");this.R=null;this.Tc?(G(this.V,"The WebSocket closed normally."),this.qa=null,this.sb=void 0):(E(this.V,"The WebSocket disconnected unexpectedly: "+a.data),this.Ve&&(G(this.V,"Seconds until next reconnect attempt: "+Math.floor(this.vc/1E3)),this.Sa=md(r(this.open,this,this.qa,this.sb),this.vc,this),this.Vb++,this.vc=this.ad(this.Vb)));this.Tc=!1};g.S=function(a){this.dispatchEvent(new rd(a.data))};
g.nd=function(a){a=a.data;E(this.V,"An error occurred: "+a);this.dispatchEvent(new sd(a))};g.O=function(){od.Ya.O.call(this);this.close()};var rd=function(a){A.call(this,"c");this.message=a};za(rd,A);var sd=function(a){A.call(this,"b");this.data=a};za(sd,A);t("cast.receiver.platform.PlatformValueKey",{fh:"port-for-web-server",ah:"log-level-cast-receiver",bh:"max-video-resolution-vpx",$g:"device-model",Yg:"cast-receiver-version",jh:"system-version",kh:"volume-controllable"});var td={"port-for-web-server":"8008"},ud=function(a){return cast.__platform__.canDisplayType(a)};t("cast.receiver.platform.canDisplayType",ud);
var vd=function(a){return ta(cast.__platform__.setTouchInputSupport)?new Promise(function(b){cast.__platform__.setTouchInputSupport(a).then(function(){b(!0)},function(){b(!1)})}):Promise.resolve(a)};cast.__platform__&&cast.__platform__.canDisplayType||delete window.cast.receiver.platform.canDisplayType;t("cast.receiver.platform.VideoResolution",function(){});var wd=function(a){if(cast.__platform__&&cast.__platform__.queryPlatformValue)return cast.__platform__.queryPlatformValue(a);if(a in td)return td[a]};
t("cast.receiver.platform.getValue",wd);t("cast.receiver.platform.getHdcpVersion",function(){return cast.__platform__&&cast.__platform__.display&&cast.__platform__.display.getHdcpVersion?cast.__platform__.display.getHdcpVersion():Promise.reject(Error("getHdcpVersion is not available"))});var xd=function(){this.l=new C;this.Oa=!1};g=xd.prototype;g.Hb=function(){return"PlatformChannel"};
g.open=function(){this.Oa?E(yd,this.Hb()+" Already open"):cast.__platform__.channel.open(r(this.rd,this),r(this.S,this))};g.close=function(){this.Oa?cast.__platform__.channel.close(r(this.ld,this)):E(yd,this.Hb()+" Cannot close unopened channel")};g.Lb=function(){return this.Oa};g.send=function(a){v(this.Oa,"Cannot send until channel is openned");cast.__platform__.channel.send(a)};g.rd=function(a){this.Oa=a;this.g(a?"d":"b")};g.ld=function(){this.Oa&&(this.Oa=!1,this.g("a"))};g.S=function(a){this.g(new rd(a))};
g.addEventListener=function(a,b){this.l.ob(a,b)};g.removeEventListener=function(a,b){this.l.$b(a,b)};g.g=function(a){a=pa(a)?new A(a):a;a.target=this;this.l.dispatchEvent(a)};var yd=y("cast.receiver.platform.WebSocket");t("cast.receiver.system.NAMESPACE_PREFIX","urn:x-cast:");t("cast.receiver.system.ApplicationData",function(){this.iconUrl=this.name=this.id="";this.sessionId=0;this.namespaces=[];this.launchingSenderId=""});t("cast.receiver.system.SystemVolumeData",function(){this.level=1;this.muted=!1});t("cast.receiver.system.Sender",function(){this.userAgent=this.id="";this.largeMessageSupported=void 0});t("cast.receiver.system.VisibilityState",{VISIBLE:"visible",NOT_VISIBLE:"notvisible",UNKNOWN:"unknown"});
t("cast.receiver.system.StandbyState",{STANDBY:"standby",NOT_STANDBY:"notstandby",UNKNOWN:"unknown"});t("cast.receiver.system.SystemState",{NOT_STARTED:"notstarted",STARTING_IN_BACKGROUND:"startinginbackground",STARTING:"starting",READY:"ready",STOPPING_IN_BACKGROUND:"stoppinginbackground",STOPPING:"stopping"});var Bd=function(){this.ca=null;cast.__platform__&&cast.__platform__.channel?(G(zd,"Opening platform websocket"),Ad(this,new xd)):(G(zd,"Opening net websocket"),Ad(this,new od(!0)));this.l=new C};t("cast.receiver.IpcChannel",Bd);Bd.prototype.Hb=function(){return"IpcChannel"};
var Ad=function(a,b){a.ca&&a.ca.Z();a.ca=b;a.ca.addEventListener("d",a.rd.bind(a));a.ca.addEventListener("a",a.ld.bind(a));a.ca.addEventListener("b",a.nd.bind(a));a.ca.addEventListener("c",a.S.bind(a))},Dd=function(a,b){Ec(zd,a.Hb()+" "+b);a.g(new Cd("urn:x-cast:com.google.cast.system","SystemSender",JSON.stringify({type:b})))};g=Bd.prototype;g.rd=function(){Dd(this,"opened")};g.ld=function(){Dd(this,"closed")};g.nd=function(){Dd(this,"error")};
g.S=function(a){Ec(zd,"Received message: "+a.message);var b=(a=JSON.parse(a.message))&&a.namespace;a&&b&&a.senderId&&a.data?this.g(new Cd(b,a.senderId,a.data)):E(zd,this.Hb()+" Message received is invalid")};g.open=function(){G(zd,"Opening message bus websocket");this.ca.open("ws://localhost:"+wd("port-for-web-server")+"/v2/ipc")};g.close=function(){G(zd,"Closing message bus websocket");this.ca.close()};g.Lb=function(){return this.ca.Lb()};
g.send=function(a,b,c){a=JSON.stringify({namespace:a,senderId:b,data:c});Ec(zd,"IPC message sent: "+a);this.ca.send(a)};g.addEventListener=function(a,b){this.l.ob(a,b)};g.removeEventListener=function(a,b){this.l.$b(a,b)};g.g=function(a){a.target=this;this.l.dispatchEvent(a)};var zd=y("cast.receiver.IpcChannel"),Cd=function(a,b,c){A.call(this,a);this.senderId=b;this.data=c};k(Cd,A);var Ed=/dv(he|av).[s|d|p][e|t|w][n|r|h|b][a|h]?[e|t|w]?/;t("cast.receiver.media.MEDIA_NAMESPACE","urn:x-cast:com.google.cast.media");t("cast.receiver.media.HlsSegmentFormat",{AAC:"aac",AC3:"ac3",MP3:"mp3",TS:"ts",TS_AAC:"ts_aac",E_AC3:"e_ac3",FMP4:"fmp4"});t("cast.receiver.media.HlsVideoSegmentFormat",{MPEG2_TS:"mpeg2_ts",FMP4:"fmp4"});t("cast.receiver.media.StreamType",{BUFFERED:"BUFFERED",LIVE:"LIVE",NONE:"NONE"});
t("cast.receiver.media.MessageType",{dh:"MEDIA_STATUS",Zg:"CLOUD_STATUS",gh:"QUEUE_CHANGE",hh:"QUEUE_ITEMS",ih:"QUEUE_ITEM_IDS",GET_STATUS:"GET_STATUS",LOAD:"LOAD",PAUSE:"PAUSE",STOP:"STOP",SKIP_AD:"SKIP_AD",PLAY:"PLAY",PLAY_AGAIN:"PLAY_AGAIN",SEEK:"SEEK",SET_PLAYBACK_RATE:"SET_PLAYBACK_RATE",SET_VOLUME:"SET_VOLUME",EDIT_TRACKS_INFO:"EDIT_TRACKS_INFO",EDIT_AUDIO_TRACKS:"EDIT_AUDIO_TRACKS",PRELOAD:"PRELOAD",CANCEL_PRELOAD:"CANCEL_PRELOAD",PRECACHE:"PRECACHE",QUEUE_LOAD:"QUEUE_LOAD",QUEUE_INSERT:"QUEUE_INSERT",
QUEUE_UPDATE:"QUEUE_UPDATE",QUEUE_REMOVE:"QUEUE_REMOVE",QUEUE_REORDER:"QUEUE_REORDER",QUEUE_NEXT:"QUEUE_NEXT",QUEUE_PREV:"QUEUE_PREV",QUEUE_GET_ITEM_RANGE:"QUEUE_GET_ITEM_RANGE",QUEUE_GET_ITEMS:"QUEUE_GET_ITEMS",QUEUE_GET_ITEM_IDS:"QUEUE_GET_ITEM_IDS",QUEUE_SHUFFLE:"QUEUE_SHUFFLE"});t("cast.receiver.media.HdrType",{SDR:"sdr",HDR:"hdr",DV:"dv"});
t("cast.receiver.media.ErrorType",{INVALID_PLAYER_STATE:"INVALID_PLAYER_STATE",LOAD_FAILED:"LOAD_FAILED",LOAD_CANCELLED:"LOAD_CANCELLED",INVALID_REQUEST:"INVALID_REQUEST",ERROR:"ERROR"});t("cast.receiver.media.ErrorReason",{INVALID_COMMAND:"INVALID_COMMAND",INVALID_PARAMS:"INVALID_PARAMS",INVALID_MEDIA_SESSION_ID:"INVALID_MEDIA_SESSION_ID",SKIP_LIMIT_REACHED:"SKIP_LIMIT_REACHED",NOT_SUPPORTED:"NOT_SUPPORTED",LANGUAGE_NOT_SUPPORTED:"LANGUAGE_NOT_SUPPORTED",END_OF_QUEUE:"END_OF_QUEUE",DUPLICATE_REQUEST_ID:"DUPLICATE_REQUEST_ID"});
t("cast.receiver.media.IdleReason",{CANCELLED:"CANCELLED",INTERRUPTED:"INTERRUPTED",FINISHED:"FINISHED",ERROR:"ERROR"});t("cast.receiver.media.SeekResumeState",{PLAYBACK_START:"PLAYBACK_START",PLAYBACK_PAUSE:"PLAYBACK_PAUSE"});t("cast.receiver.media.PlayerState",{IDLE:"IDLE",PLAYING:"PLAYING",PAUSED:"PAUSED",BUFFERING:"BUFFERING"});t("cast.receiver.media.ExtendedPlayerState",{LOADING:"LOADING"});
var Fd=function(){this.contentId="";this.contentUrl=void 0;this.streamType="NONE";this.contentType="";this.vmapAdsRequest=this.hlsVideoSegmentFormat=this.hlsSegmentFormat=this.breakClips=this.breaks=this.customData=this.textTrackStyle=this.tracks=this.startAbsoluteTime=this.duration=this.entity=this.metadata=void 0};t("cast.receiver.media.MediaInformation",Fd);var Gd=function(a,b){this.start=a;this.end=b};t("cast.receiver.media.SeekableRange",Gd);
var Hd=function(a,b,c,d){Gd.call(this,a,b);this.isMovingWindow=c;this.isLiveDone=d};k(Hd,Gd);t("cast.receiver.media.LiveSeekableRange",Hd);var Id=function(a,b,c,d,e,f,h){this.id=a;this.queueType=this.entity=void 0;this.name=b;this.description=c;this.repeatMode=d;this.shuffle=!1;this.items=e;this.startIndex=f;this.startTime=h;this.containerMetadata=void 0};t("cast.receiver.media.QueueData",Id);
t("cast.receiver.media.QueueType",{ALBUM:"ALBUM",PLAYLIST:"PLAYLIST",AUDIOBOOK:"AUDIOBOOK",RADIO_STATION:"RADIO_STATION",PODCAST_SERIES:"PODCAST_SERIES",TV_SERIES:"TV_SERIES",VIDEO_PLAYLIST:"VIDEO_PLAYLIST",LIVE_TV:"LIVE_TV",MOVIE:"MOVIE"});t("cast.receiver.media.ContainerType",{GENERIC_CONTAINER:0,AUDIOBOOK_CONTAINER:1});var Jd=function(a){this.containerType=void 0===a?0:a;this.containerDuration=this.containerImages=this.sections=this.title=void 0};t("cast.receiver.media.ContainerMetadata",Jd);
t("cast.receiver.media.StreamingProtocolType",{UNKNOWN:0,MPEG_DASH:1,HLS:2,SMOOTH_STREAMING:3});t("cast.receiver.media.MetadataType",{GENERIC:0,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4,AUDIOBOOK_CHAPTER:5});var I=function(a){this.metadataType=a;this.queueItemId=this.sectionStartTimeInContainer=this.sectionStartAbsoluteTime=this.sectionStartTimeInMedia=this.sectionDuration=void 0};t("cast.receiver.media.MediaMetadata",I);
var Kd=function(){I.call(this,0);this.releaseDate=this.releaseYear=this.images=this.subtitle=this.title=void 0};k(Kd,I);t("cast.receiver.media.GenericMediaMetadata",Kd);var Ld=function(){I.call(this,1);this.releaseDate=this.releaseYear=this.images=this.subtitle=this.studio=this.title=void 0};k(Ld,I);t("cast.receiver.media.MovieMediaMetadata",Ld);
var Md=function(){I.call(this,2);this.originalAirdate=this.releaseYear=this.images=this.episode=this.episodeNumber=this.season=this.seasonNumber=this.episodeTitle=this.title=this.seriesTitle=void 0};k(Md,I);t("cast.receiver.media.TvShowMediaMetadata",Md);var Nd=function(){I.call(this,3);this.releaseDate=this.releaseYear=this.images=this.discNumber=this.trackNumber=this.artistName=this.songName=this.composer=this.artist=this.albumArtist=this.title=this.albumName=void 0};k(Nd,I);
t("cast.receiver.media.MusicTrackMediaMetadata",Nd);var Od=function(){I.call(this,4);this.creationDateTime=this.height=this.width=this.longitude=this.latitude=this.images=this.location=this.artist=this.title=void 0};k(Od,I);t("cast.receiver.media.PhotoMediaMetadata",Od);var Pd=function(){Jd.call(this,1);this.releaseDate=this.publisher=this.narrators=this.authors=void 0};k(Pd,Jd);t("cast.receiver.media.AudiobookContainerMetadata",Pd);
var Qd=function(){I.call(this,5);this.images=this.subtitle=this.bookTitle=this.title=this.chapterTitle=void 0};k(Qd,I);t("cast.receiver.media.AudiobookChapterMediaMetadata",Qd);t("cast.receiver.media.Image",function(a){this.url=a;this.width=this.height=void 0});var Rd=function(){this.muted=this.level=void 0};t("cast.receiver.media.Volume",Rd);var Sd=function(a,b,c){this.width=a;this.height=b;this.hdrType=c};t("cast.receiver.media.VideoInformation",Sd);
var Td=function(){this.type="MEDIA_STATUS";this.mediaSessionId=0;this.videoInfo=this.queueData=this.media=void 0;this.playbackRate=1;this.playerState="IDLE";this.idleReason=void 0;this.supportedMediaCommands=this.currentTime=0;this.volume=new Rd;this.liveSeekableRange=this.extendedStatus=this.breakStatus=this.repeatMode=this.items=this.customData=this.preloadedItemId=this.loadingItemId=this.currentItemId=this.activeTrackIds=void 0};t("cast.receiver.media.MediaStatus",Td);
var Ud=function(a,b){this.playerState=a;this.media=b};t("cast.receiver.media.ExtendedMediaStatus",Ud);var Vd=function(){Td.call(this)};k(Vd,Td);t("cast.receiver.media.CloudMediaStatus",Vd);t("cast.receiver.media.Command",{PAUSE:1,SEEK:2,STREAM_VOLUME:4,STREAM_MUTE:8,ALL_BASIC_MEDIA:15,QUEUE_NEXT:64,QUEUE_PREV:128,QUEUE_SHUFFLE:256,SKIP_AD:512});t("cast.receiver.media.TrackType",{TEXT:"TEXT",AUDIO:"AUDIO",VIDEO:"VIDEO"});
t("cast.receiver.media.CaptionMimeType",{CEA608:"text/cea608",TTML:"application/ttml+xml",VTT:"text/vtt",TTML_MP4:"application/mp4"});t("cast.receiver.media.TextTrackType",{SUBTITLES:"SUBTITLES",CAPTIONS:"CAPTIONS",DESCRIPTIONS:"DESCRIPTIONS",CHAPTERS:"CHAPTERS",METADATA:"METADATA"});t("cast.receiver.media.TextTrackEdgeType",{NONE:"NONE",OUTLINE:"OUTLINE",DROP_SHADOW:"DROP_SHADOW",RAISED:"RAISED",DEPRESSED:"DEPRESSED"});t("cast.receiver.media.TextTrackWindowType",{NONE:"NONE",NORMAL:"NORMAL",ROUNDED_CORNERS:"ROUNDED_CORNERS"});
t("cast.receiver.media.TextTrackFontGenericFamily",{SANS_SERIF:"SANS_SERIF",MONOSPACED_SANS_SERIF:"MONOSPACED_SANS_SERIF",SERIF:"SERIF",MONOSPACED_SERIF:"MONOSPACED_SERIF",CASUAL:"CASUAL",CURSIVE:"CURSIVE",SMALL_CAPITALS:"SMALL_CAPITALS"});t("cast.receiver.media.TextTrackFontStyle",{NORMAL:"NORMAL",BOLD:"BOLD",BOLD_ITALIC:"BOLD_ITALIC",ITALIC:"ITALIC"});
t("cast.receiver.media.Track",function(a,b){this.trackId=a;this.trackContentType=this.trackContentId=void 0;this.type=b;this.customData=this.subtype=this.language=this.name=void 0});t("cast.receiver.media.TextTrackStyle",function(){this.customData=this.fontStyle=this.fontGenericFamily=this.fontFamily=this.windowRoundedCornerRadius=this.windowColor=this.windowType=this.edgeColor=this.edgeType=this.backgroundColor=this.foregroundColor=this.fontScale=void 0});
t("cast.receiver.media.TracksInfo",function(){this.textTrackStyle=this.language=this.activeTrackIds=this.tracks=void 0});var Wd={REPEAT_OFF:"REPEAT_OFF",REPEAT_ALL:"REPEAT_ALL",REPEAT_SINGLE:"REPEAT_SINGLE",REPEAT_ALL_AND_SHUFFLE:"REPEAT_ALL_AND_SHUFFLE"};t("cast.receiver.media.RepeatMode",Wd);t("cast.receiver.media.QueueChangeType",{INSERT:"INSERT",REMOVE:"REMOVE",ITEMS_CHANGE:"ITEMS_CHANGE",UPDATE:"UPDATE",NO_CHANGE:"NO_CHANGE"});
var Xd=function(){this.type="QUEUE_CHANGE";this.sequenceNumber=this.insertBefore=this.itemIds=this.changeType=this.requestId=void 0};t("cast.receiver.media.QueueChange",Xd);var Yd=function(){this.type="QUEUE_ITEMS";this.items=this.requestId=void 0};t("cast.receiver.media.ItemsInfo",Yd);var Zd=function(){this.type="QUEUE_ITEM_IDS";this.itemIds=this.requestId=void 0};t("cast.receiver.media.QueueIds",Zd);t("cast.receiver.media.repeatMode",Wd);
var $d=function(a){return"REPEAT_OFF"==a||"REPEAT_ALL"==a||"REPEAT_SINGLE"==a||"REPEAT_ALL_AND_SHUFFLE"==a};t("cast.receiver.media.GetStatusOptions",{NO_METADATA:1,NO_QUEUE_ITEMS:2});t("cast.receiver.media.Break",function(a,b,c){this.id=a;this.breakClipIds=b;this.position=c;this.duration=void 0;this.isWatched=!1;this.isEmbedded=void 0});
t("cast.receiver.media.BreakClip",function(a){this.id=a;this.vastAdsRequest=this.customData=this.hlsSegmentFormat=this.clickThroughUrl=this.posterUrl=this.whenSkippable=this.duration=this.title=this.contentType=this.contentUrl=this.contentId=void 0});t("cast.receiver.media.VastAdsRequest",function(){this.adsResponse=this.adTagUrl=void 0});t("cast.receiver.media.BreakStatus",function(a,b){this.currentBreakTime=a;this.currentBreakClipTime=b;this.whenSkippable=this.breakClipId=this.breakId=void 0});var J=function(a,b,c,d){z.call(this);this.X=a;this.ma=b;this.gd=!1;this.Ae=[];this.Ka=d||"STRING";this.l=new C;this.onMessage=null;this.serializeMessage=this.Hf;this.deserializeMessage=this.gf;this.L={};a=l(c);for(b=a.next();!b.done;b=a.next())this.L[b.value]=null;this.de=this.yc.bind(this);this.ma.addEventListener(this.X,this.de)};k(J,z);t("cast.receiver.CastMessageBus",J);J.prototype.sa=function(){return"CastMessageBus["+this.X+"]"};J.prototype.Ga=function(){return this.X};
J.prototype.getNamespace=J.prototype.Ga;J.prototype.Tf=function(){return this.Ka};J.prototype.getMessageType=J.prototype.Tf;var ae=function(a,b,c,d){a.yc(new Cd(b,c,d))};J.prototype.yc=function(a){D(be,x,"Dispatching CastMessageBus message");var b="STRING"==this.Ka?a.data:this.deserializeMessage(a.data);this.g(new ce(a.senderId,a.senderId,b));a=new ce("message",a.senderId,b);if(this.onMessage)this.onMessage(a);this.g(a)};
J.prototype.send=function(a,b){this.gd||"urn:x-cast:com.google.cast.system"==this.X||F(be,"Application should not send requests before the system is ready (they will be ignored)");this.g(new ce("send",a,b));for(var c=l(this.Ae),d=c.next();!d.done;d=c.next())if(d=d.value,d(a,this.X,b))return;if("STRING"==this.Ka){if(!pa(b))throw Error("Wrong argument, CastMessageBus type is STRING");this.ma.send(this.X,a,b)}else this.ma.send(this.X,a,this.serializeMessage(b))};J.prototype.send=J.prototype.send;
J.prototype.fc=function(a){this.send("*:*",a)};J.prototype.broadcast=J.prototype.fc;J.prototype.Of=function(a){if(ab(this.L,a))return this.L[a]||(this.L[a]=new H(this,a)),this.L[a];throw Error("Requested a socket for a disconnected sender: "+a);};J.prototype.getCastChannel=J.prototype.Of;
J.prototype.Hf=function(a){if("JSON"!=this.Ka)throw Error("Unexpected message type for JSON serialization");return"urn:x-cast:com.google.cast.media"===this.X?JSON.stringify(a,function(a,c){return null===c?void 0:c}):JSON.stringify(a)};J.prototype.gf=function(a){if("JSON"!=this.Ka)throw Error("Unexpected message type for JSON serialization");return JSON.parse(a)};
J.prototype.O=function(){z.prototype.O.call(this);this.ma.removeEventListener(this.X,this.de);this.l.Z();for(var a in this.L)this.L[a]&&this.L[a].close();this.L={};D(be,x,"Disposed "+this.sa())};var de=function(a,b){a.Ae.push(b)};J.prototype.addEventListener=function(a,b){B(this.l,a,b)};J.prototype.addEventListener=J.prototype.addEventListener;J.prototype.removeEventListener=function(a,b){wc(this.l,a,b)};J.prototype.removeEventListener=J.prototype.removeEventListener;
J.prototype.g=function(a){a.target=this;return Ac(this.l,a)};J.prototype.dispatchEvent=function(a){return this.g(a)};J.prototype.dispatchEvent=J.prototype.dispatchEvent;J.MessageType={STRING:"STRING",JSON:"JSON",CUSTOM:"CUSTOM"};J.EventType={MESSAGE:"message",SEND:"send"};var be=y("cast.receiver.CastMessageBus"),ce=function(a,b,c){A.call(this,a);this.senderId=b;this.data=c};k(ce,A);J.Event=ce;var ee="StopIteration"in m?m.StopIteration:{message:"StopIteration",stack:""},fe=function(){};fe.prototype.next=function(){throw ee;};fe.prototype.Oe=function(){return this};var ge=function(a,b){this.fa={};this.s=[];this.ac=this.Fa=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&this.addAll(a)},ie=function(a){he(a);return a.s.concat()};ge.prototype.dd=function(){return 0==this.Fa};ge.prototype.clear=function(){this.fa={};this.ac=this.Fa=this.s.length=0};
ge.prototype.remove=function(a){return je(this.fa,a)?(delete this.fa[a],this.Fa--,this.ac++,this.s.length>2*this.Fa&&he(this),!0):!1};var he=function(a){if(a.Fa!=a.s.length){for(var b=0,c=0;b<a.s.length;){var d=a.s[b];je(a.fa,d)&&(a.s[c++]=d);b++}a.s.length=c}if(a.Fa!=a.s.length){var e={};for(c=b=0;b<a.s.length;)d=a.s[b],je(e,d)||(a.s[c++]=d,e[d]=1),b++;a.s.length=c}};g=ge.prototype;g.get=function(a,b){return je(this.fa,a)?this.fa[a]:b};
g.set=function(a,b){je(this.fa,a)||(this.Fa++,this.s.push(a),this.ac++);this.fa[a]=b};g.addAll=function(a){if(a instanceof ge)for(var b=ie(a),c=0;c<b.length;c++)this.set(b[c],a.get(b[c]));else for(b in a)this.set(b,a[b])};g.forEach=function(a,b){for(var c=ie(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};g.clone=function(){return new ge(this)};
g.Oe=function(a){he(this);var b=0,c=this.ac,d=this,e=new fe;e.next=function(){if(c!=d.ac)throw Error("The map has changed since the iterator was created");if(b>=d.s.length)throw ee;var e=d.s[b++];return a?e:d.fa[e]};return e};var je=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var ke=function(){this.M=K.H();this.be=0;this.cc=null;this.vb=new ge;this.Eg=this.Fg.bind(this);this.W=this.M.ib("urn:x-cast:com.google.cast.inject","JSON");this.W.onMessage=this.S.bind(this);for(var a=l(["urn:x-cast:com.google.cast.cac","urn:x-cast:com.google.cast.media"]),b=a.next();!b.done;b=a.next())(b=this.M.u[b.value]||null)&&de(b,this.Eg)};
ke.prototype.S=function(a){var b=this,c=a.data,d=c.requestId,e=a.senderId;if("WRAPPED"!=c.type)this.ba("Unsupported message type "+c.type,e,d);else{a=JSON.parse(c.data);c=a.namespace;var f=this.M.u[c]||null;if(f){var h=!1;if("urn:x-cast:com.google.cast.cac"==c)a.data.requestId=d,h=!0;else if("urn:x-cast:com.google.cast.media"==c){var u=a.data;u.requestId=d;u.mediaSessionId=this.be}else{this.ba("Unsupported namespace "+c,e,d);return}this.vb.set(d,e);try{this.cc=null,ae(f,c,"__inject__",JSON.stringify(a.data))}catch(ka){throw this.vb.remove(d),
this.ba("Injecting "+a.data+" failed with "+ka,e,d),ka;}if(!h){var Z=function(){return b.cc?(b.vb.remove(d),b.ba("Error "+JSON.stringify(b.cc),e,d,"WRAPPED_ERROR",b.cc),!0):!1};Z()||setTimeout(function(){Z()||(b.vb.remove(d),le(b,e,d))},5)}}else this.ba("Unregistered namespace "+c,e,d,"WRAPPED_ERROR",{type:"ERROR",code:"UNREGISTERED_NAMESPACE"})}};
ke.prototype.Fg=function(a,b,c){if("urn:x-cast:com.google.cast.media"==b&&"STRING"==(this.M.u[b]||null).Ka)try{c=JSON.parse(c)}catch(e){return E(me,"Parse failed: "+c),!1}var d=c.type;"urn:x-cast:com.google.cast.media"==b&&"MEDIA_STATUS"==d&&c.status&&c.status[0]&&(this.be=c.status[0].mediaSessionId);if("__inject__"!=a)return!1;a=c.requestId;if(!n(a))return F(me,"No requestId in "+c),!0;if("urn:x-cast:com.google.cast.media"==b){switch(d){case "INVALID_REQUEST":case "INVALID_PLAYER_STATE":b=c.reason,
this.cc={type:"ERROR",code:b?b:d}}return!0}d=this.vb.get(a);if(!d)return E(me,"Request not found "+a),!0;this.vb.remove(a);if("urn:x-cast:com.google.cast.cac"!=b)return E(me,"Unsupported namespace "+b),!0;b=c;switch(b.type){case "SUCCESS":le(this,d,a,Object.getOwnPropertyNames(c).some(function(a){return"type"!=a&&"requestId"!=a&&n(c[a])})?JSON.stringify(c):void 0);break;case "ERROR":this.ba("Wrapped error",d,a,"WRAPPED_ERROR",b);break;default:this.ba("Unknown message type "+c,d,a)}return!0};
ke.prototype.ba=function(a,b,c,d,e){E(me,a);this.W.send(b,new ne(c,d||"INJECT_ERROR",n(e)?JSON.stringify(e):void 0))};var le=function(a,b,c,d){a.W.send(b,new oe(c,d))};qa(ke);var me=y("cast.receiver.InjectManager"),pe=function(a,b,c){this.type=a;this.requestId=b;this.data=c},oe=function(a,b){pe.call(this,"SUCCESS",a,b)};k(oe,pe);var ne=function(a,b,c){pe.call(this,"ERROR",a,c);this.code=b};k(ne,pe);var qe=function(){this.oe=ya()},re=null;qe.prototype.set=function(a){this.oe=a};qe.prototype.reset=function(){this.set(ya())};qe.prototype.get=function(){return this.oe};var se=function(a){this.ug=a||"";re||(re=new qe);this.Rg=re};g=se.prototype;g.Jd=!0;g.Fe=!0;g.Pg=!0;g.Og=!0;g.Ge=!1;g.Qg=!1;var te=function(a){return 10>a?"0"+a:String(a)},ue=function(a,b){a=(a.Je-b)/1E3;b=a.toFixed(3);var c=0;if(1>a)c=2;else for(;100>a;)c++,a*=10;for(;0<c--;)b=" "+b;return b},ve=function(a){se.call(this,a)};za(ve,se);var we=function(){this.vg=r(this.Re,this);this.lc=new ve;this.lc.Fe=!1;this.lc.Ge=!1;this.Vd=this.lc.Jd=!1;this.Lf={}};
we.prototype.Re=function(a){if(!this.Lf[a.ae]){var b=this.lc;var c=[];c.push(b.ug," ");if(b.Fe){var d=new Date(a.Je);c.push("[",te(d.getFullYear()-2E3)+te(d.getMonth()+1)+te(d.getDate())+" "+te(d.getHours())+":"+te(d.getMinutes())+":"+te(d.getSeconds())+"."+te(Math.floor(d.getMilliseconds()/10)),"] ")}b.Pg&&c.push("[",ue(a,b.Rg.get()),"s] ");b.Og&&c.push("[",a.ae,"] ");b.Qg&&c.push("[",a.Ja.name,"] ");c.push(a.mg);b.Ge&&(d=a.Yc)&&c.push("\n",d instanceof Error?d.message:d.toString());b.Jd&&c.push("\n");
b=c.join("");if(c=xe)switch(a.Ja){case zb:ye(c,"info",b);break;case Ab:ye(c,"error",b);break;case Bb:ye(c,"warn",b);break;default:ye(c,"log",b)}}};var ze=null,xe=m.console,ye=function(a,b,c){if(a[b])a[b](c);else a.log(c)};var K=function(){z.call(this);ze||(ze=new we);if(ze){var a=ze;if(1!=a.Vd){Lb();var b=Kb;var c=a.vg;b.Kb||(b.Kb=[]);b.Kb.push(c);a.Vd=!0}}this.B=bb(Ae);this.Sb=!1;this.ma=new Bd;this.ia={};this.l=new C;this.Ba=new J("urn:x-cast:com.google.cast.system",this.ma,$a(this.ia),"JSON");Mb(this,xa(Nb,this.Ba));this.da=this.ec=null;this.Ud=!1;this.Mb=this.Ob=null;this.Cc=!0;this.gg="1.11";this.Za="notstarted";this.Ne=null;this.u={};this.od=this.onMaxVideoResolutionChanged=this.onFeedbackStarted=this.onStandbyChanged=
this.onVisibilityChanged=this.onSystemVolumeChanged=this.onSenderDisconnected=this.onSenderConnected=this.onShutdown=this.onReady=null;this.Yd=!1;this.Ba.addEventListener("SystemSender",this.rg.bind(this));B(window,"unload",this.sd,!1,this);B(document,"visibilitychange",this.ge,!1,this);D(L,zb,"Version: 2.0.0.0063");Be&&Be(this);this.me=bd();this.Ke=bd()};k(K,z);t("cast.receiver.CastReceiverManager",K);var Ce=function(a){var b=a.toLocaleLowerCase();return["com.vizio.vue","com.vizio.smartcast"].some(function(a){return b.includes(a)})};
K.prototype.sa=function(){return"CastReceiverManager"};
K.prototype.start=function(a){if(a){if(!a)throw Error("Cannot validate undefined config.");if(void 0!=a.maxInactivity&&5>a.maxInactivity)throw Error("config.maxInactivity must be greater than or equal to 5 seconds.");eb(this.B,a||{})}this.B.versionCode&&0<=this.B.versionCode&&(Number.isInteger(this.B.versionCode)?(Ba("Cast.Receiver.VersionCode",this.B.versionCode),G(L,"App Version "+this.B.versionCode)):E(L,"Receiver versionCode needs to be an integer"));ke.H();this.Yd||De(this,!1);this.Ud=!0;this.ma.open()};
K.prototype.start=K.prototype.start;K.prototype.stop=function(){this.Z();window.close()};K.prototype.stop=K.prototype.stop;K.prototype.Nb=function(){return"ready"==this.Za};K.prototype.isSystemReady=K.prototype.Nb;K.prototype.getSenders=function(){return $a(this.ia)};K.prototype.getSenders=K.prototype.getSenders;K.prototype.Xf=function(a){return this.ia[a]?bb(this.ia[a]):null};K.prototype.getSender=K.prototype.Xf;
K.prototype.bg=function(){return null==this.Ob?this.Mb?"notvisible":"unknown":this.Ob?"visible":"notvisible"};K.prototype.getVisibilityState=K.prototype.bg;K.prototype.Zf=function(){return null==this.Mb?this.Ob?"notstandby":"unknown":this.Mb?"standby":"notstandby"};K.prototype.getStandbyState=K.prototype.Zf;K.prototype.Sd=function(){"notstarted"==this.Za&&(this.Za=/[&?]google_cast_bg=true(&|$)/.test(window.location.search)?"startinginbackground":"starting");return this.Za};
K.prototype.getSystemState=K.prototype.Sd;K.prototype.Nf=function(){return this.ec};K.prototype.getApplicationData=K.prototype.Nf;K.prototype.Qf=function(){return this.da};K.prototype.getDeviceCapabilities=K.prototype.Qf;K.prototype.Gg=function(a){this.Nb()?Ee(this,a):this.B.statusText!=a&&(this.B.statusText=a,this.Sb=!0)};K.prototype.setApplicationState=K.prototype.Gg;
K.prototype.Ig=function(a,b){this.Nb()?Ee(this,a,b):(void 0!=a&&a!=this.B.statusText&&(this.B.statusText=a,this.Sb=!0),void 0!=b&&b!=this.B.dialData&&(this.B.dialData=b,this.Sb=!0))};K.prototype.setLegacyApplicationState=K.prototype.Ig;K.prototype.Lg=function(a){if(0>a||1<a)throw Error("Invalid level value");this.Ba.send("SystemSender",{type:"setvolume",level:a})};K.prototype.setSystemVolumeLevel=K.prototype.Lg;K.prototype.Mg=function(a){this.Ba.send("SystemSender",{type:"setvolume",muted:a})};
K.prototype.setSystemVolumeMuted=K.prototype.Mg;K.prototype.ag=function(){return this.Ne};K.prototype.getSystemVolume=K.prototype.ag;var Ee=function(a,b,c){var d={type:"setappstate"};void 0!=b&&(d.statusText=b);void 0!=c&&(d.dialData=c);a.Ba.send("SystemSender",d)};K.prototype.Ce=function(a){this.Ba.send("SystemSender",{type:"startheartbeat",maxInactivity:a})};K.prototype.setInactivityTimeout=K.prototype.Ce;
K.prototype.ib=function(a,b){if("urn:x-cast:com.google.cast.system"==a)throw Error("Protected namespace");if(0!=a.lastIndexOf("urn:x-cast:",0))throw Error("Invalid namespace prefix");if(!this.u[a]){if(this.Ud)throw Error("New namespaces can not be requested after start has been called");this.u[a]=new J(a,this.ma,$a(this.ia),b);Mb(this,xa(Nb,this.u[a]))}if(b&&this.u[a].Ka!=b)throw Error("Invalid messageType for the namespace");return this.u[a]};K.prototype.getCastMessageBus=K.prototype.ib;
K.prototype.ze=function(a){this.Ba.send("SystemSender",{type:"sendfeedbackmessage",message:a})};K.prototype.sendFeedbackMessage=K.prototype.ze;
K.prototype.rg=function(a){a=a.data;switch(a.type){case "opened":G(L,"Underlying message bus is open");var b=$a(this.u),c=this.B.statusText;a=this.B.dialData;var d={type:"ready"};c&&(d.statusText=c);a&&(d.dialData=a);d.activeNamespaces=b;d.version="2.0.0";d.messagesVersion="1.0";this.Ba.send("SystemSender",d);this.B.maxInactivity&&this.Ce(this.B.maxInactivity);break;case "closed":this.sd();break;case "error":this.g(new M("error",null));break;case "ready":b=a.launchingSenderId;c=$a(this.u);this.Jc=
a.version;this.Cc=!Fe(this,this.gg);var e=a.deviceCapabilities;this.da=e?bb(e):{};cast.__platform__&&cast.__platform__.canDisplayType&&(this.da.hasOwnProperty("is_hdr_supported")||(this.da.is_hdr_supported=ud("video/mp4; codecs=hev1.2.4.L153.B0; eotf=smpte2084")),this.da.hasOwnProperty("is_dv_supported")||(this.da.is_dv_supported=ud("video/mp4; codecs=dvhe.04.06")));this.ec={id:a.applicationId,name:a.applicationName,iconUrl:a.iconUrl,sessionId:a.sessionId,namespaces:c,launchingSenderId:b};this.Za=
"ready";for(d in this.u)this.u[d].gd=!0;this.me.resolve();this.Sb&&(this.Sb=!1,Ee(this,this.B.statusText,this.B.dialData));G(L,"Dispatching CastReceiverManager system ready event");b=new Ge(this.ec);if(this.onReady)this.onReady(b);this.g(b);break;case "senderconnected":b={id:a.senderId,userAgent:a.userAgent};if(Ce(b.id))G(L,"Ignored connection from "+b.id);else{G(L,"Dispatching CastReceiverManager sender connected event ["+b.id+"]");ab(this.ia,b.id)&&E(L,"Unexpected connected message for already connected sender: "+
b.id);this.ia[b.id]=b;a=new He(b.id,b.userAgent);for(c in this.u)d=this.u[c],e=b.id,ab(d.L,e)?E(be,"Unexpected sender already registered ["+d.X+", "+e+"]"):(G(be,"Registering sender ["+d.X+", "+e+"]"),d.L[e]=null);if(this.onSenderConnected)this.onSenderConnected(a);this.g(a)}break;case "senderdisconnected":c=a.senderId;a=a.reason;if(Ce(c))G(L,"Ignored disconnection from "+c);else{switch(a){case "closed_by_peer":a="requested_by_sender";break;case "transport_invalid_message":a="error";break;default:a=
"unknown"}G(L,"Dispatching sender disconnected event ["+c+"] Reason: "+a);if(ab(this.ia,c)){d=this.ia[c].userAgent;delete this.ia[c];a=new Ie(c,d,a);for(b in this.u)d=this.u[b],e=c,ab(d.L,e)&&(G(be,"Unregistering sender ["+d.X+", "+e+"]"),d.L[e]&&d.L[e].close(),delete d.L[e]);this.g(bb(a));if(this.onSenderDisconnected)this.onSenderDisconnected(a)}else E(L,"Unknown sender disconnected: "+c)}break;case "volumechanged":this.Ne=b={level:a.level,muted:a.muted};G(L,"Dispatching system volume changed event ["+
b.level+", "+b.muted+"]");b=new Je(b);if(this.onSystemVolumeChanged)this.onSystemVolumeChanged(b);this.g(b);break;case "visibilitychanged":this.Cc||(b=a.visible,Ke(this,n(b)?b:null));break;case "standbychanged":if(!this.Cc&&(b=a.standby,b=n(b)?b:null,b!=this.Mb)){G(L,"Dispatching standby changed event "+b);this.Mb=b;b=new Le(1==b);if(this.onStandbyChanged)this.onStandbyChanged(b);this.g(b)}break;case "maxvideoresolutionchanged":b=a.height;G(L,"Dispatching maxvideoresolutionchanged "+b);b=new Me(b);
if(this.onMaxVideoResolutionChanged)this.onMaxVideoResolutionChanged(b);this.g(b);break;case "hdroutputtypechanged":this.od&&this.od(a.hdrType);break;case "screenresolutionchanged":break;case "feedbackstarted":G(L,"Dispatching feedback started event");b=new Ne;if(this.onFeedbackStarted)this.onFeedbackStarted(b);else this.ze("");break;default:throw Error("Unexpected message type: "+a.type);}};
K.prototype.canDisplayType=function(a,b,c,d,e){if(!cast.__platform__||!cast.__platform__.canDisplayType)return!0;if(!Qa(a,"video/")&&!Qa(a,"audio/"))throw Error("Not video or audio types.");b&&(a+="; codecs="+b);c&&d&&(a+="; width="+c+"; height="+d);e&&(a+="; framerate="+e);if(c=b)a:for(c=!1,b=b.split(","),d=0;d<b.length;d++){if(b[d].match(Ed)){c=!1;break a}0===b[d].indexOf("hev1.2")&&(c=!0)}c&&(a+="; eotf=smpte2084");return ud(a)};K.prototype.canDisplayType=K.prototype.canDisplayType;
var Ke=function(a,b){if(b==a.Ob)G(L,"Ignoring visibility changed event, state is already "+b);else{G(L,"Dispatching visibility changed event "+b);a.Ob=b;b=new Oe(0!=b);if(a.onVisibilityChanged)a.onVisibilityChanged(b);a.g(b)}};K.prototype.ge=function(){this.Cc&&Ke(this,"visible"==document.visibilityState)};
K.prototype.sd=function(){G(L,"Dispatching shutdown event");this.Sd();this.Za="startinginbackground"==this.Za?"stoppinginbackground":"stopping";for(var a in this.u)this.u[a].gd=!1;a=new Pe;if(this.onShutdown)this.onShutdown(a);this.g(a)};K.prototype.Ed=function(a){this.Nb()?E(L,"initTouchScreenOptimizedApp() method cannot be called after CastReceiverManager.start() has been called"):(n(a)||E(L,"setTouchScreenOptimizedApp() has to be called with 1 required argument"),De(this,a))};
var De=function(a,b){vd(b).then(function(c){a.Ke.resolve(c&&b)});a.Yd=!0},Qe=function(a){var b=bd();a.me.Ub.then(function(){a.da&&a.da.touch_input_supported?b.resolve(!0):b.resolve(!1)});return b.Ub},Re=function(a){var b=bd();Qe(a).then(function(c){a.Ke.Ub.then(function(a){b.resolve(c&&a)})});return b.Ub},Fe=function(a,b){if(!b)return E(L,"Version not provided"),!1;if(!a.Jc)return E(L,"No System Version"),!1;var c=b.split(".");if(!c.length)return E(L,"Version provided is not valid: "+b),!1;var d=
a.Jc.split(".");if(!d.length)return E(L,"System Version format is not valid "+a.Jc),!1;for(var e=0;e<c.length;e++){var f=parseInt(c[e],10);if(isNaN(f))return E(L,"Version is not numeric: "+b),!1;var h=d.length>e?parseInt(d[e],10):0;if(isNaN(h))return E(L,"System Version is not numeric: "+a.Jc),!1;if(f>h)return!1}return!0};
K.prototype.O=function(){this.ma.close();z.prototype.O.call(this);window&&wc(window,"unload",this.sd,!1,this);document&&wc(document,"visibilitychange",this.ge,!1,this);this.l.Z();delete K.pc;Ec(L,"Disposed "+this.sa())};K.prototype.addEventListener=function(a,b){B(this.l,a,b)};K.prototype.addEventListener=K.prototype.addEventListener;K.prototype.removeEventListener=function(a,b){wc(this.l,a,b)};K.prototype.removeEventListener=K.prototype.removeEventListener;
K.prototype.g=function(a){a.target=this;var b=!1;try{b=Ac(this.l,a)}catch(c){window.setTimeout(function(){throw c;},0)}return b};K.prototype.dispatchEvent=function(a){return this.g(a)};K.prototype.dispatchEvent=K.prototype.dispatchEvent;qa(K);K.getInstance=K.H;var Be=null,L=y("cast.receiver.CastReceiverManager");
K.DeviceCapabilities={AUDIO_ASSISTANT:"audio_assistant",BLUETOOTH_SUPPORTED:"bluetooth_supported",DISPLAY_SUPPORTED:"display_supported",HI_RES_AUDIO_SUPPORTED:"hi_res_audio_supported",IS_DV_SUPPORTED:"is_dv_supported",IS_HDR_SUPPORTED:"is_hdr_supported",TOUCH_INPUT_SUPPORTED:"touch_input_supported"};
K.EventType={READY:"ready",SHUTDOWN:"shutdown",SENDER_CONNECTED:"senderconnected",SENDER_DISCONNECTED:"senderdisconnected",ERROR:"error",SYSTEM_VOLUME_CHANGED:"systemvolumechanged",VISIBILITY_CHANGED:"visibilitychanged",STANDBY_CHANGED:"standbychanged",MAX_VIDEO_RESOLUTION_CHANGED:"maxvideoresolutionchanged",FEEDBACK_STARTED:"feedbackstarted"};var M=function(a,b){A.call(this,a);this.data=b};k(M,A);K.Event=M;
t("cast.receiver.system.DisconnectReason",{REQUESTED_BY_SENDER:"requested_by_sender",ERROR:"error",UNKNOWN:"unknown"});var Ie=function(a,b,c){M.call(this,"senderdisconnected",a);this.senderId=a;this.userAgent=b;this.reason=c};k(Ie,M);K.SenderDisconnectedEvent=Ie;var He=function(a,b){M.call(this,"senderconnected",a);this.senderId=a;this.userAgent=b};k(He,M);K.SenderConnectedEvent=He;var Oe=function(a){M.call(this,"visibilitychanged",a);this.isVisible=a};k(Oe,M);K.VisibilityChangedEvent=Oe;
var Le=function(a){M.call(this,"standbychanged",null);this.isStandby=a};k(Le,M);K.StandbyChangedEvent=Le;var Je=function(a){M.call(this,"systemvolumechanged",a);this.data=a};k(Je,M);K.SystemVolumeChangedEvent=Je;var Ge=function(a){M.call(this,"ready",a);this.data=a};k(Ge,M);K.ReadyEvent=Ge;var Pe=function(){M.call(this,"shutdown",null)};k(Pe,M);K.ShutdownEvent=Pe;var Ne=function(){M.call(this,"feedbackstarted",null)};k(Ne,M);K.FeedbackStartedEvent=Ne;
var Me=function(a){M.call(this,"maxvideoresolutionchanged",null);this.height=a};k(Me,M);K.MaxVideoResolutionChangedEvent=Me;K.Config=function(){this.dialData=this.versionCode=this.maxInactivity=this.statusText=void 0};var Ae={maxInactivity:10};var Se=function(){this.M=K.H();this.W=this.M.ib("urn:x-cast:com.google.cast.broadcast","JSON");this.W.onMessage=this.S.bind(this)};
Se.prototype.S=function(a){if(this.M.Nb())F(Te,"Ignoring broadcast request, system is ready.");else{a=a.data;var b=a.type;if("APPLICATION_BROADCAST"!=b)E(Te,"Ignoring message type: "+b);else if(b=a.namespace){var c=this.M.u[b]||null;if(c)switch(b){case "urn:x-cast:com.google.cast.media":var d=JSON.parse(a.message);if("PRECACHE"!=d.type){E(Te,"Unsupported type for media namespace: "+d.type);break}ae(c,b,"__broadcast__",a.message);break;default:E(Te,"Unsupported namespace: "+a.namespace)}else E(Te,
"Invalid message bus for namespace: "+b)}else E(Te,"Missing namespace: "+b)}};qa(Se);var Te=y("cast.receiver.BroadcastManager");t("cast.receiver.BroadcastManager.NAMESPACE_PREFIX","urn:x-cast:");t("cast.receiver.BroadcastManager.BroadcastRequest",function(){});var N=function(){this.Na=this.onFocusState=this.onCustomCommand=this.onDisplayStatus=this.onUserAction=this.onLoadByEntity=this.onSetCredentials=null;this.M=K.H();this.W=this.M.ib("urn:x-cast:com.google.cast.cac","JSON");this.W.onMessage=this.S.bind(this);this.wb=new ge};t("cast.receiver.CommandAndControlManager",N);
N.prototype.S=function(a){var b=a.data,c=b.type;a=a.senderId;switch(c){case "SET_CREDENTIALS":Ue(this,b.forRequestId,b);var d=this.onSetCredentials;break;case "LOAD_BY_ENTITY":d=this.onLoadByEntity;break;case "USER_ACTION":d=this.onUserAction;break;case "DISPLAY_STATUS":d=this.onDisplayStatus;break;case "CUSTOM_COMMAND":d=this.onCustomCommand;break;case "FOCUS_STATE":(d=this.onFocusState)&&this.M.da.focus_state_supported&&d(b);return;case "SUCCESS":case "ERROR":Ue(this,b.requestId,b);return;default:this.ba("Unsupported event "+
c,a,b,"INVALID_REQUEST");return}d?Ve(this,a,b,d):this.ba("Handler for "+c+" not implemented",a,b,"INVALID_COMMAND")};
var Ve=function(a,b,c,d){$c().then(function(){return d(c)}).then(function(d){a:if(d){switch(d.type){case "SUCCESS":case "ERROR":d.requestId=c.requestId;break a}d=We("Invalid response data "+JSON.stringify(d),c,"APP_ERROR")}else d=We("No response data",c,"APP_ERROR");"ERROR"===d.type&&a.Na&&a.Na(d);a.W.send(b,d)},function(d){a.ba("Got a rejected promise "+JSON.stringify(d),b,c,"APP_ERROR")})},We=function(a,b,c){E(Xe,a);a=new Ye(c);a.requestId=b.requestId;return a};
N.prototype.ba=function(a,b,c,d){var e=We(a,c,d);this.Na&&this.Na(e);this.W.send(b,We(a,c,d))};
N.prototype.Kg=function(a,b){if(null!==b&&!ta(b))throw E(Xe,"Given handler is not a function or null"),Error("Given handler is not a function or null");switch(a){case "SET_CREDENTIALS":this.onSetCredentials=b;break;case "LOAD_BY_ENTITY":this.onLoadByEntity=b;break;case "USER_ACTION":this.onUserAction=b;break;case "DISPLAY_STATUS":this.onDisplayStatus=b;break;case "CUSTOM_COMMAND":this.onCustomCommand=b;break;case "FOCUS_STATE":this.onFocusState=b;break;default:throw a="Cannot set handler for "+a,
E(Xe,a),Error(a);}};N.prototype.setMessageHandler=N.prototype.Kg;N.prototype.tg=function(a,b){var c=this,d=this.M.da;if(d&&!0===d.display_supported)return Promise.resolve(new Ye("NOT_SUPPORTED"));d=ya();if(je(this.wb.fa,d))return Promise.reject(Error("Duplicate request"));var e=new Ze(a,b);e.requestId=d;return new Promise(function(a){c.wb.set(e.requestId,a);c.W.send("system-0",e)})};N.prototype.playString=N.prototype.tg;
N.prototype.xg=function(){var a=this,b=ya(),c=new $e;c.requestId=b;return new Promise(function(b){a.wb.set(c.requestId,b);a.W.send("system-0",c)})};N.prototype.refreshCredentials=N.prototype.xg;N.prototype.Jf=function(a){var b=this,c=ya(),d=new af(a);d.requestId=c;return new Promise(function(a){b.wb.set(d.requestId,a);b.W.send("system-0",d)})};N.prototype.executeActionScript=N.prototype.Jf;
var Ue=function(a,b,c){if(b){var d=a.wb.get(b);d?(a.wb.remove(b),d(c)):F(Xe,"No matching request for response "+JSON.stringify(c))}};qa(N);N.getInstance=N.H;N.NAMESPACE="urn:x-cast:com.google.cast.cac";var Xe=y("cast.receiver.CommandAndControlManager");
N.MessageType={SET_CREDENTIALS:"SET_CREDENTIALS",LOAD_BY_ENTITY:"LOAD_BY_ENTITY",USER_ACTION:"USER_ACTION",DISPLAY_STATUS:"DISPLAY_STATUS",PLAY_STRING:"PLAY_STRING",EXECUTE_ACTION_SCRIPT:"EXECUTE_ACTION_SCRIPT",CUSTOM_COMMAND:"CUSTOM_COMMAND",FOCUS_STATE:"FOCUS_STATE",REFRESH_CREDENTIALS:"REFRESH_CREDENTIALS",SUCCESS:"SUCCESS",ERROR:"ERROR"};N.PlayStringId={FREE_TRIAL_ABOUT_TO_EXPIRE:"FREE_TRIAL_ABOUT_TO_EXPIRE",SUBSCRIPTION_ABOUT_TO_EXPIRE:"SUBSCRIPTION_ABOUT_TO_EXPIRE",STREAM_HIJACKED:"STREAM_HIJACKED"};
var bf=function(a){this.type=a};N.RequestData=bf;var cf=function(){this.type="SET_CREDENTIALS"};k(cf,bf);N.SetCredentialsRequestData=cf;var df=function(){this.type="LOAD_BY_ENTITY"};k(df,bf);N.LoadByEntityRequestData=df;var ef=function(){this.type="CUSTOM_COMMAND"};k(ef,bf);N.CustomCommandRequestData=ef;var $e=function(){this.type="REFRESH_CREDENTIALS"};k($e,bf);N.RefreshCredentialsRequestData=$e;var Ze=function(a,b){this.type="PLAY_STRING";this.stringId=a;this.arguments=b};k(Ze,bf);
N.PlayStringRequestData=Ze;var af=function(a){this.type="EXECUTE_ACTION_SCRIPT";this.actionScript=JSON.stringify(a)};k(af,bf);N.ExecuteActionScriptRequestData=af;N.ScriptAction=function(a,b){this.app_id=a;this.action=b;this.custom_data=void 0};N.UserAction={LIKE:"LIKE",DISLIKE:"DISLIKE",FOLLOW:"FOLLOW",UNFOLLOW:"UNFOLLOW",FLAG:"FLAG",SKIP_AD:"SKIP_AD"};
N.UserActionContext={UNKNOWN_CONTEXT:"UNKNOWN_CONTEXT",TRACK:"TRACK",ALBUM:"ALBUM",ARTIST:"ARTIST",PLAYLIST:"PLAYLIST",EPISODE:"EPISODE",SERIES:"SERIES",MOVIE:"MOVIE",CHANNEL:"CHANNEL",TEAM:"TEAM",PLAYER:"PLAYER",COACH:"COACH"};var ff=function(){this.type="USER_ACTION"};k(ff,bf);N.UserActionRequestData=ff;var gf=function(){this.type="DISPLAY_STATUS"};k(gf,bf);N.DisplayStatusRequestData=gf;var hf=function(){this.type="FOCUS_STATE"};k(hf,bf);N.FocusStateRequestData=hf;
N.FocusState={IN_FOCUS:"IN_FOCUS",NOT_IN_FOCUS:"NOT_IN_FOCUS"};
N.ErrorCode={APP_ERROR:"APP_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",AUTHENTICATION_EXPIRED:"AUTHENTICATION_EXPIRED",PREMIUM_ACCOUNT_REQUIRED:"PREMIUM_ACCOUNT_REQUIRED",CONCURRENT_STREAM_LIMIT:"CONCURRENT_STREAM_LIMIT",PARENTAL_CONTROL_RESTRICTED:"PARENTAL_CONTROL_RESTRICTED",NOT_AVAILABLE_IN_REGION:"NOT_AVAILABLE_IN_REGION",CONTENT_ALREADY_PLAYING:"CONTENT_ALREADY_PLAYING",INVALID_COMMAND:"INVALID_COMMAND",INVALID_REQUEST:"INVALID_REQUEST",GENERIC_LOAD_ERROR:"GENERIC_LOAD_ERROR"};
var jf=function(a){this.type=a};k(jf,bf);N.ResponseData=jf;var kf=function(a){this.type="SUCCESS";this.status=a};k(kf,jf);N.SuccessResponseData=kf;var Ye=function(a,b){this.type="ERROR";this.code=a;this.reason=b};k(Ye,jf);N.ErrorResponseData=Ye;var lf=!(!cast.__platform__||!cast.__platform__.crypto);t("cast.receiver.cryptokeys.getKeyByName",cast.__platform__&&cast.__platform__.cryptokeys?cast.__platform__.cryptokeys.getKeyByName:window.cryptokeys&&window.cryptokeys.getKeyByName);t("cast.receiver.crypto.decrypt",lf?cast.__platform__.crypto.decrypt:window.crypto.subtle.decrypt);t("cast.receiver.crypto.encrypt",lf?cast.__platform__.crypto.encrypt:window.crypto.subtle.encrypt);t("cast.receiver.crypto.sign",lf?cast.__platform__.crypto.sign:window.crypto.subtle.sign);
t("cast.receiver.crypto.unwrapKey",lf?cast.__platform__.crypto.unwrapKey:window.crypto.subtle.unwrapKey);t("cast.receiver.crypto.verify",lf?cast.__platform__.crypto.verify:window.crypto.subtle.verify);t("cast.receiver.crypto.wrapKey",lf?cast.__platform__.crypto.wrapKey:window.crypto.subtle.wrapKey);var mf=function(a){this.af=a.ib("urn:x-cast:com.google.cast.debugoverlay","JSON");this.af.onMessage=this.S.bind(this);this.ka=this.v=this.kc=this.Fb=null;this.xa=[];this.ya=[]};mf.prototype.S=function(a){G(nf,"DebugOverlay: "+JSON.stringify(a.data));switch(a.data.type){case "SHOW":of(this);break;case "HIDE":pf(this)}};
var of=function(a){a.v||a.ka||(a.xa.length=0,a.ya.length=0,a.ye(),a.v||(a.ka=window.setInterval(a.ye.bind(a),1E3)))},pf=function(a){if(a.v||a.ka)a.Fb&&(document.body.removeChild(a.Fb.parentElement),a.Fb=null),a.kc&&(window.clearInterval(a.kc),a.kc=null),a.v&&(wc(a.v,"seeking",a.ke,!1,a),a.v=null),a.ka&&(window.clearInterval(a.ka),a.ka=null)},qf=function(a,b){G(nf,"found active video");a.v=b;b=document.createElement("div");b.style.cssText="position:absolute;top:0;left:0;width:100%;height:100%;z-index:9001;-webkit-text-fill-color:black;-webkit-text-stroke-color:red;-webkit-text-stroke-width:1px;padding-left:5vw;padding-top:5vh;margin:0;font-size:24pt";
var c=document.createTextNode("");b.appendChild(c);b.id="__CAST_DEBUG_OVERLAY__";document.body.appendChild(b);a.Fb=c;a.he();a.kc=window.setInterval(a.he.bind(a),1E3);B(a.v,"seeking",a.ke,!1,a);a.ka&&(window.clearInterval(a.ka),a.ka=null)};
mf.prototype.he=function(){var a=this.v;if(a&&a.src&&!a.error&&!a.ended&&1<=a.readyState){var b=a.videoWidth,c=a.videoHeight;if(0>=b||0>=c)Ec(nf,"canceling draw because video not initialized");else{var d=0;if(a.paused||a.seeking)Ec(nf,"not calculating fps because paused or seeking");else{d=a.webkitDecodedFrameCount;a=a.currentTime;var e=0;if(0<this.xa.length&&0<this.ya.length){var f=this.xa[0],h=this.ya[0];a>f&&d>h&&(e=(d-h)/(a-f))}this.xa.push(a);this.ya.push(d);5<=this.xa.length&&5<=this.ya.length&&
(this.xa.splice(0,this.xa.length-5),this.ya.splice(0,this.ya.length-5));d=e}b=b+"x"+c+"("+(0<d?Math.round(d).toString():"?")+")";Ec(nf,"video is "+b);this.Fb.textContent=b}}else if(Ec(nf,"video is no longer active, restarting search procedure"),this.v||this.ka)pf(this),of(this)};mf.prototype.ke=function(){G(nf,"onSeeking");this.xa=[this.v.currentTime];this.ya=[this.v.webkitDecodedFrameCount]};
mf.prototype.ye=function(){var a=function(b){for(var c=l(b.document.getElementsByTagName("video")),e=c.next();!e.done;e=c.next())if(e=e.value,e.src&&!e.error&&!e.ended&&1<=e.readyState)return e;for(c=0;c<b.frames.length;++c)try{var f=a(b.frames[c]);if(f)return f}catch(h){}return null},b=a(window);b&&qf(this,b)};var nf=y("cast.receiver.DebugOverlay");Be=function(a){new mf(a)};var rf=/#(.)(.)(.)(.)/,tf=function(a){if(!sf.test(a))throw Error("'"+a+"' is not a valid alpha hex color");5==a.length&&(a=a.replace(rf,"#$1$1$2$2$3$3$4$4"));a=a.toLowerCase();return[parseInt(a.substr(1,2),16),parseInt(a.substr(3,2),16),parseInt(a.substr(5,2),16),parseInt(a.substr(7,2),16)/255]},sf=/^#(?:[0-9a-f]{4}){1,2}$/i,uf=function(a){var b=a.slice(0);b[3]=Math.round(1E3*a[3])/1E3;return"rgba("+b.join(",")+")"};var yf=function(a,b,c,d){z.call(this);this.c=a;this.hc=this.Ic=null;for(a=this.c;a.parentNode;)a=a.parentNode;this.ve=0>a.toString().toLowerCase().indexOf("shadow")?document.head:a;this.Ca=[];this.Vc=!1;this.Qc="cast-captions-"+Math.floor(1E6*Math.random()).toString();this.df="["+this.Qc+'="true"]::cue ';this.ef=new RegExp(/^[\.'":%,;\s\-0-9a-z]+$/i);b=l(b);for(a=b.next();!a.done;a=b.next()){a=a.value;var e=a.trackContentId;if("TEXT"==a.type&&e){var f=a.trackContentType;if(0==Pa("vtt",e.substr(e.length-
3,3))||n(f)&&0==Pa(f,"text/vtt"))e=document.createElement("track"),e.src=a.trackContentId,e.id=a.trackId,e.label=a.name,e.srclang=a.language,e.kind=(a.subtype||"CAPTIONS").toLowerCase(),this.Ca.push(e)}}vf(this);b=l(this.Ca);for(a=b.next();!a.done;a=b.next())a=a.value,this.c.contains(a)||this.c.appendChild(a);d&&wf(this,d);xf(this,c)};k(yf,z);yf.prototype.sa=function(){return"TextTracksManager"};
var zf=function(a,b){a=l(a.Ca);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=c.track;b(c)?d.mode="showing":(d.mode="showing",d.mode="disabled")}},Af=function(a){return a.Ca.map(function(a){return parseInt(a.id,10)})},xf=function(a,b){zf(a,function(a){return 0<=Ja(b,parseInt(a.id,10))})},Bf=function(a,b){zf(a,function(a){return Ca(b,a.srclang)})},Cf=function(a){var b=[];a=l(a.Ca);for(var c=a.next();!c.done;c=a.next())c=c.value,"showing"==c.track.mode&&b.push(parseInt(c.id,10));return b},Df=
function(a){a.hc&&(a.c.removeAttribute(a.Qc),a.ve.removeChild(a.hc),a.Ic=null)},Ef=function(a){a.Vc&&(a.c.removeAttribute("crossorigin"),a.Vc=!1)},Gf=function(a,b,c){1==c||a.ef.test(b)?a.Ic.insertRule(a.df+"{ "+b+" }",a.Ic.cssRules.length):F(Ff,"Invalid css cue: "+b)},vf=function(a){Df(a);Ef(a);var b=document.createElement("style");b.type="text/css";a.ve.appendChild(b);b.appendChild(document.createTextNode(""));a.hc=b;a.Ic=a.hc.sheet;Gf(a,"font-size: 4.1vh;");Gf(a,"font-family: monospace;");Gf(a,
"font-style: normal;");Gf(a,"font-weight: normal;");Gf(a,"background-color: black;");Gf(a,"color: white;");a.c.setAttribute(a.Qc,!0);0<a.Ca.length&&!a.c.getAttribute("crossorigin")&&(a.c.setAttribute("crossorigin","anonymous"),a.Vc=!0)},Hf=function(a,b){try{var c=uf(tf(a))}catch(d){F(Ff,"Invalid color: "+a)}if(c)switch(a="rgba(204, 204, 204, "+parseInt(a.substring(7,9),16)+")",b){case "OUTLINE":return"text-shadow: 0 0 4px "+c+", 0 0 4px "+c+", 0 0 4px "+c+", 0 0 4px "+c+";";case "DROP_SHADOW":return"text-shadow: 0px 2px 3px "+
c+", 0px 2px 4px "+c+", 0px 2px 5px "+c+";";case "RAISED":return"text-shadow: 1px 1px "+c+", 2px 2px "+c+", 3px 3px "+c+";";case "DEPRESSED":return"text-shadow: 1px 1px "+a+", 0 1px "+a+", -1px -1px "+c+", 0 -1px "+c+";"}return""},If=function(a){switch(a){case "BOLD":return"font-weight: bold;";case "BOLD_ITALIC":return"font-style: italic; font-weight: bold;";case "ITALIC":return"font-style: italic;"}return"font-style: normal;"},wf=function(a,b){if(n(b.foregroundColor))try{var c=uf(tf(b.foregroundColor));
Gf(a,"color: "+c+";",!0)}catch(u){F(Ff,"Invalid color: "+b.foregroundColor)}if(n(b.backgroundColor))try{var d=uf(tf(b.backgroundColor));Gf(a,"background-color: "+d+";",!0)}catch(u){F(Ff,"Invalid color: "+b.backgroundColor)}n(b.fontScale)&&Gf(a,"font-size: "+100*b.fontScale+"%;");if(n(b.fontFamily)||n(b.fontGenericFamily)){c=b.fontFamily;d=b.fontGenericFamily;var e="font-family: ",f="";n(c)&&(e+='"'+c+'"',f=", ");if(n(d)){switch(d){case "SANS_SERIF":var h='"Droid Sans", sans-serif';break;case "MONOSPACED_SANS_SERIF":h=
'"Droid Sans Mono", monospace';break;case "SERIF":h='"Droid Serif", serif';break;case "MONOSPACED_SERIF":h='"Cutive Mono", serif-monospace';break;case "CASUAL":h='"Short Stack", casual';break;case "CURSIVE":h="Quintessential, cursive";break;case "SMALL_CAPITALS":h='"Alegreya Sans SC", sans-serif-smallcaps'}e+=f+h}Gf(a,e+";")}n(b.fontStyle)&&Gf(a,If(b.fontStyle));n(b.edgeType)&&(h=n(b.foregroundColor)?b.foregroundColor:"#FFFFFFFF",b=n(b.edgeColor)?Hf(b.edgeColor,b.edgeType):Hf(h,b.edgeType),Gf(a,b,
!0))};yf.prototype.O=function(){z.prototype.O.call(this);for(var a=l(this.Ca),b=a.next();!b.done;b=a.next())this.c.removeChild(b.value);this.Ca.length=0;Df(this);Ef(this);D(Ff,x,"Disposed "+this.sa())};var Ff=y("cast.receiver.TextTracksManager");var Jf=function(a){this.V=O;this.c=a;this.jd=this.Wc=this.Xc=q;this.lb=0;this.pa=this.Gb=null;this.ne=0;this.U=this.A=null;this.ea=!1;this.rc=!0;B(this.c,"error",this.md,!1,this);B(this.c,"ended",this.xc,!1,this);B(this.c,"loadedmetadata",this.qd,!1,this);G(this.V,"Using default Player")};g=Jf.prototype;g.preload=function(a,b,c,d){Kf(this);this.rc=a;this.lb=b;this.ne=d||0;this.pa=c||null};g.md=function(a){Kf(this);this.Xc(a)};g.xc=function(){Kf(this);this.Wc()};
g.qd=function(){this.A&&this.U&&xf(this.A,this.U);this.jd()};g.registerErrorCallback=function(a){this.Xc=a};g.registerEndedCallback=function(a){this.Wc=a};g.registerLoadCallback=function(a){this.jd=a};g.unregisterErrorCallback=function(){this.Xc=q};g.unregisterEndedCallback=function(){this.Wc=q};g.unregisterLoadCallback=function(){this.jd=q};
var Lf=function(a){var b=a.c.duration;if(isNaN(b)||null==a.pa)return b;if(null!=a.Gb)return a.Gb;a.Gb=0<=a.pa?Math.min(a.ne+a.pa,b):Math.max(b+a.pa,a.lb);return a.Gb},Kf=function(a){null!=a.pa&&(wc(a.c,"timeupdate",a.ie,!1,a),a.Gb=null,a.pa=null)};Jf.prototype.ie=function(){Mf(this)};var Mf=function(a){if(null==a.pa)return!1;var b=Lf(a);return isNaN(b)?!1:a.c.currentTime>=b?(a.xc(),!0):!1};g=Jf.prototype;
g.load=function(a,b,c,d,e,f){this.A&&(this.A.Z(),this.A=null);this.ea=!1;d&&d.tracks&&this.c&&(this.A&&this.A.Z(),this.A=new yf(this.c,d.tracks,d.activeTrackIds||[],d.textTrackStyle||null),d.language&&Bf(this.A,d.language));null!=this.pa&&B(this.c,"timeupdate",this.ie,!1,this);e||(this.lb=c&&0<c?c:0,G(this.V,"Load - contentId: "+a+" autoplay: "+b+" time: "+this.lb),this.c.autoplay=!1,a&&(this.c.src=a),this.c.autoplay=b,this.c.load(),n(f)&&(this.c.playbackRate=f))};
g.reset=function(){this.ea=!1;this.A&&(this.A.Z(),this.A=null);this.U=null;this.c.removeAttribute("src");this.lb=0;this.c.load();Kf(this)};g.play=function(){this.ea=!1;this.c.play()};g.seek=function(a,b){this.c.currentTime!=a&&(this.c.currentTime=a);Mf(this)||("PLAYBACK_START"==b&&this.c.paused?this.c.play():"PLAYBACK_PAUSE"!=b||this.c.paused||this.c.pause())};g.Ee=function(a){return this.c.playbackRate=a};g.pause=function(){this.ea=!0;this.c.pause()};
g.getState=function(){null==this.rc&&(this.rc=this.c.autoplay);return this.c.paused||isNaN(this.c.duration)?this.c.duration&&(this.c.currentTime||0==this.c.currentTime)&&this.c.currentTime<Lf(this)?this.c.currentTime==this.lb&&this.rc&&!this.ea?"BUFFERING":"PAUSED":"IDLE":"PLAYING"};g.getCurrentTimeSec=function(){var a=Lf(this);return isNaN(a)?this.c.currentTime:this.c.currentTime<a?this.c.currentTime:a};g.getDurationSec=function(){return Lf(this)};
g.getVolume=function(){return{level:this.c.volume,muted:this.c.muted}};g.setVolume=function(a){n(a.level)&&(this.c.volume=a.level);n(a.muted)&&(this.c.muted=a.muted)};g.editTracksInfo=function(a){if(this.A){if(a.textTrackStyle){var b=this.A,c=a.textTrackStyle;vf(b);wf(b,c)}a.language?Bf(this.A,a.language):a.activeTrackIds&&xf(this.A,a.activeTrackIds)}this.Hd(a.activeTrackIds);return this.U};
g.Hd=function(a){this.U=(this.U=a?a.slice(0):this.U)||[];if(this.A){var b=Af(this.A);this.U=this.U.filter(function(a){return!b.includes(a)}).concat(Cf(this.A))}0==this.U.length&&(this.U=null)};var Nf=function(a){z.call(this);this.kb=a;this.s={}};za(Nf,z);var Of=[];Nf.prototype.ob=function(a,b,c,d){sa(b)||(b&&(Of[0]=b.toString()),b=Of);for(var e=0;e<b.length;e++){var f=B(a,b[e],c||this.handleEvent,d||!1,this.kb||this);if(!f)break;this.s[f.key]=f}return this};Nf.prototype.$d=function(a,b,c,d){return Pf(this,a,b,c,d)};var Pf=function(a,b,c,d,e,f){if(sa(c))for(var h=0;h<c.length;h++)Pf(a,b,c[h],d,e,f);else{b=pc(b,c,d||a.handleEvent,e,f||a.kb||a);if(!b)return a;a.s[b.key]=b}return a};
Nf.prototype.$b=function(a,b,c,d,e){if(sa(b))for(var f=0;f<b.length;f++)this.$b(a,b[f],c,d,e);else c=c||this.handleEvent,d=ua(d)?!!d.capture:!!d,e=e||this.kb||this,c=qc(c),d=!!d,b=fc(a)?a.Jb(b,c,d,e):a?(a=sc(a))?a.Jb(b,c,d,e):null:null,b&&(xc(b),delete this.s[b.key])};Nf.prototype.vd=function(){Ya(this.s,function(a,b){this.s.hasOwnProperty(b)&&xc(a)},this);this.s={}};Nf.prototype.O=function(){Nf.Ya.O.call(this);this.vd()};
Nf.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};var Qf={eh:"persistent-release-message"};t("cast.receiver.eme.KeySessionType",Qf);var Rf=new Uint8Array([43,248,102,128,198,229,78,36,190,35,15,129,90,96,110,178]),P=function(a,b){this.l=new C;this.fg=b;this.aa=a.createSession("persistent-license");this.sessionId="";this.expiration=this.aa.expiration;this.closed=this.aa.closed;this.keyStatuses=this.aa.keyStatuses;this.kb=new Nf(this);Mb(this.l,xa(Nb,this.kb))};t("cast.receiver.eme.KeySession",P);
P.createSession=function(a,b){a:{for(var c in Qf)if(Qf[c]==b)break a;throw Error("Unknown key session type: "+b);}a=new P(a,b);a.kb.ob(a.aa,"message",a.te).ob(a.aa,"keystatuseschange",a.te);return a};
P.prototype.generateRequest=function(a,b){if("persistent-release-message"==this.fg){if("cenc"!=a)throw Error("Only cenc initDataType is supported for persistent-release-message session type.");var c=new Uint8Array([0,0,0,0,112,115,115,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2]);c.set(Rf,12);(new DataView(c.buffer)).setUint32(0,c.length);var d=new Uint8Array(b.byteLength+c.byteLength);d.set(new Uint8Array(b),0);d.set(c,b.byteLength);b=d}return this.aa.generateRequest(a,b).then(r(function(){this.sessionId=
this.aa.sessionId},this))};P.prototype.generateRequest=P.prototype.generateRequest;P.prototype.load=function(a){return this.aa.load(a)};P.prototype.load=P.prototype.load;P.prototype.update=function(a){return this.aa.update(a)};P.prototype.update=P.prototype.update;P.prototype.close=function(){this.l.Z();return this.aa.close()};P.prototype.close=P.prototype.close;P.prototype.remove=function(){return this.aa.remove()};P.prototype.remove=P.prototype.remove;
P.prototype.te=function(a){var b=new A(a.type);eb(b,a.hb);b.target=this;this.l.dispatchEvent(b)};P.prototype.addEventListener=function(a,b){B(this.l,a,b)};P.prototype.addEventListener=P.prototype.addEventListener;P.prototype.removeEventListener=function(a,b){wc(this.l,a,b)};P.prototype.removeEventListener=P.prototype.removeEventListener;P.prototype.dispatchEvent=function(a){a.target=this;return this.l.dispatchEvent(a)};P.prototype.dispatchEvent=P.prototype.dispatchEvent;var Sf=y("cast");t("cast.receiver.logger",Sf);t("cast.receiver.LoggerLevel",{DEBUG:0,VERBOSE:500,INFO:800,WARNING:900,ERROR:1E3,NONE:1500});Sf.De=function(a){Sf&&Sf.zd(Hb(a))};Sf.setLevelValue=Sf.De;if(Sf){var Tf=parseInt(wd("log-level-cast-receiver"),10);Sf.De(Tf||1E3)};var Q=function(){};t("cast.receiver.QueueBase",Q);Q.prototype.initialize=function(){return null};Q.prototype.initialize=Q.prototype.initialize;Q.prototype.onCurrentItemIdChanged=function(){};Q.prototype.onCurrentItemIdChanged=Q.prototype.onCurrentItemIdChanged;Q.prototype.nextItems=function(){return[]};Q.prototype.nextItems=Q.prototype.nextItems;Q.prototype.prevItems=function(){return[]};Q.prototype.prevItems=Q.prototype.prevItems;Q.prototype.fetchItems=function(){return[]};
Q.prototype.fetchItems=Q.prototype.fetchItems;Q.prototype.onItemsInserted=function(){};Q.prototype.onItemsInserted=Q.prototype.onItemsInserted;Q.prototype.onItemsRemoved=function(){};Q.prototype.onItemsRemoved=Q.prototype.onItemsRemoved;Q.prototype.shuffle=function(){return null};Q.prototype.shuffle=Q.prototype.shuffle;var Uf=function(a){this.itemId=a;this.customData=this.activeTrackIds=this.preloadTime=this.playbackDuration=this.startTime=this.autoplay=this.media=void 0};t("cast.receiver.media.QueueItem",Uf);
var Vf=function(a,b){var c=new Uf(a.itemId);c.autoplay=a.autoplay;c.startTime=a.startTime;c.playbackDuration=a.playbackDuration;c.preloadTime=a.preloadTime;c.activeTrackIds=a.activeTrackIds;c.customData=a.customData;if(void 0===b||b)c.media=a.media;return c},R=function(a){this.a=void 0;this.D="REPEAT_OFF";this.Hc=this.j=0;this.tb=this.b=void 0;this.cd=a;this.Ua=1};t("cast.receiver.MediaQueue",R);
var Yf=function(a,b){if(a.b)return Promise.resolve(a.b.initialize(b)).then(function(c){c?Wf(a,c,!0,!0):Xf(a,b)});Xf(a,b)},Xf=function(a,b){var c=b.queueData;c&&c.items?Wf(a,c):(c=new Uf(a.cd()),c.media=b.media,c.autoplay=b.autoplay,c.activeTrackIds=b.activeTrackIds,c.customData=b.customData,a.a=[c])},Wf=function(a,b,c,d){d=void 0===d?!1:d;Zf(a,b,void 0===c?!1:c)||F($f,"The passed in queueData is not completely valid: "+b);a.tb=b;d&&b.items&&ag(b.items);a.a=b.items;a.D=b.repeatMode||a.D;a.j=b.startIndex||
0;a.Hc=b.startTime||0},ag=function(a){a=l(a);for(var b=a.next();!b.done;b=a.next())b=b.value,b.preloadTime=null!=b.preloadTime?b.preloadTime:0};
R.prototype.fetchItems=function(a,b,c,d){var e=this,f=void 0,h=bg(this,b);this.b?0<c&&0<d?f="Queue operations only support expanding the front or back.":0>h&&(f="Reference item id is not in current queue."):f="Fetch items is only supported with an external queue.";if(f)return F($f,f),Promise.reject(f);0<c?(f=this.a.length-1,c-=f-h,b=Ha(this.a[f].itemId)):0<d&&(d-=h,b=Ha(this.a[0].itemId));var u=new Xd;u.requestId=a;return 0>=c&&0>=d?(u.changeType="NO_CHANGE",u.sequenceNumber=this.Ua-1,Promise.resolve(u)):
Promise.resolve(this.b.fetchItems(b,c,d)).then(function(a){if(a&&0!=a.length){var d=0<c?void 0:b;cg(e,a,d);u.changeType="INSERT";u.itemIds=a.map(function(a){return a.itemId});u.insertBefore=d;u.sequenceNumber=e.Ua++}else u.changeType="NO_CHANGE",u.sequenceNumber=e.Ua-1;return u})};
var dg=function(a,b,c){var d=new Yd;d.requestId=b;d.items=[];if(a.a)for(b=l(c),c=b.next();!c.done;c=b.next()){c=c.value;for(var e=l(a.a),f=e.next();!f.done;f=e.next())if(f=f.value,f.itemId==c){d.items.push(f);break}F($f,"Unknown item id: "+c)}return d},eg=function(a,b){var c=new Zd;c.requestId=b;c.itemIds=a.Ib().map(function(a){return a.itemId});return c},fg=function(a,b){return new Promise(function(c,d){v(a.b);var e=void 0,f=a.j+b;0<=f&&f<a.a.length?(e=new Xd,e.changeType="NO_CHANGE",c(e)):(f=a.Qd(),
Ha(f),1==b?e=a.b.nextItems.bind(a.b,f):-1==b?e=a.b.prevItems.bind(a.b,f):1<b?e=a.b.fetchItems.bind(a.b,f,b,0):-1>b?e=a.b.fetchItems.bind(a.b,f,0,-b):d("Should not be requesting more items on the current item"),Promise.resolve(e()).then(function(d){ag(v(d));var e=new Xd;if(0<d.length){G($f,"Fetched more items "+d);var f=0<=b?void 0:a.a[0].itemId;cg(a,d,f);e.changeType="INSERT";e.itemIds=d.map(function(a){return a.itemId});e.insertBefore=f;e.sequenceNumber=a.Ua++}else e.changeType="NO_CHANGE",e.sequenceNumber=
a.Ua-1;c(e)},function(){return d("Failed to get more items from the queue.")}))})};R.prototype.clear=function(){this.a=void 0;this.D="REPEAT_OFF";this.Hc=this.j=0};R.prototype.Ib=function(a,b){a=void 0===a?!0:a;b=void 0===b?!1:b;var c=[],d=this.a.length;d=b&&this.j<d-1?this.j+1:d-1;for(b=b&&0<this.j?this.j-1:0;b<=d;b++)c.push(a?this.a[b]:Vf(this.a[b],a));return c};R.prototype.getItems=R.prototype.Ib;R.prototype.Rf=function(){return this.a.length};R.prototype.getLength=R.prototype.Rf;
R.prototype.Vf=function(){return this.D};R.prototype.getRepeatMode=R.prototype.Vf;R.prototype.Qd=function(){if(!(0>this.j)){var a=this.a[this.j].itemId;Ha(a);return a}};R.prototype.getCurrentItemId=R.prototype.Qd;R.prototype.jb=function(){return!this.a||0>this.j?null:this.a[this.j]};R.prototype.getCurrentItem=R.prototype.jb;R.prototype.Pf=function(){return this.j};R.prototype.getCurrentItemIndex=R.prototype.Pf;R.prototype.Xb=function(a){this.D=a;this.tb&&(this.tb.repeatMode=a)};
var gg=function(a,b){for(var c=0;c<b.length;c++)for(var d=0;d<a.a.length;d++)b[c].itemId==a.a[d].itemId&&(a.a[d]=b[c])},hg=function(a,b){for(var c=[],d=0;d<b.length;d++)for(var e=0;e<a.a.length;e++)if(b[d]==a.a[e].itemId){c.push(b[d]);break}return c},ig=function(a){return"REPEAT_ALL_AND_SHUFFLE"==a.D},bg=function(a,b){for(var c=0;c<a.a.length;c++)if(b==a.a[c].itemId)return c;return-1},jg=function(a){return"REPEAT_ALL_AND_SHUFFLE"==a.D||"REPEAT_ALL"==a.D};R.prototype.reset=function(){this.j=-1};
var lg=function(a,b){b=bg(a,b);if(-1==b||a.j==b)return!1;kg(a,b);return!0},ng=function(a,b,c){if(!mg(a,"reorderItems")&&b&&0!=b.length){var d=a.a[a.j].itemId,e=n(c)?c:-1;c=a.a.length-b.length;for(var f=[],h=-1==e?!0:!1,u=0;u<a.a.length;u++)0<=Ja(b,a.a[u].itemId)?h||a.a[u].itemId!=b[0]||(c=f.length):(f.push(a.a[u]),e==a.a[u].itemId&&(c=f.length-1,h=!0));e=[];for(h=0;h<b.length;h++){a:{for(u=0;u<a.a.length;u++)if(b[h]==a.a[u].itemId){u=a.a[u];break a}u=null}e.push(u)}xa(Oa,f,c,0).apply(null,e);a.a=
f;n(d)&&lg(a,d)}},cg=function(a,b,c,d){v(a.a);for(var e=l(b),f=e.next();!f.done;f=e.next())f=f.value,p(f.itemId)||(f.itemId=a.cd());e=p(c)?bg(a,c):a.a.length;e=-1==e?a.a.length:e;xa(Oa,a.a,e,0).apply(null,b);n(d)?a.j=e+d:a.j>=e&&(a.j+=b.length);if(a.b)a.b.onItemsInserted(b,c);return b.map(function(a){return a.itemId})},mg=function(a,b){return a.b?(b&&F($f,b+" not supported when external queue is provided."),!0):!1},pg=function(a,b,c){if(0>a.j)return"QUEUE_ENDED";b=a.j+b;var d=!1;b>=a.a.length?(b=
jg(a)?b%a.a.length:-1,d=!0):0>b&&(b=jg(a)?a.a.length+(b+1)%a.a.length-1:0,d=!0);c&&kg(a,b);return-1==b?"QUEUE_ENDED":d?ig(a)?(og(a),"QUEUE_SHUFFLED"):"QUEUE_LOOP":"QUEUE_ACTIVE"};R.prototype.shuffle=function(){var a=this;if(this.b)return Promise.resolve(this.b.shuffle()).then(function(b){b&&(a.a=b)});og(this);return Promise.resolve()};
var og=function(a){var b=a.a.length;if(!(3>a.a.length))for(a.tb&&(a.tb.shuffle=!0);0<b;){var c=Math.floor(Math.random()*b);--b;var d=a.a[c];a.a[c]=a.a[b];a.a[b]=d}},Zf=function(a,b,c){c=void 0===c?!1:c;if(n(b.startIndex)&&(!p(b.startIndex)||0>b.startIndex))return E($f,"Invalid startIndex "+b.startIndex),!1;var d=(b.startIndex||0)+1;if(!b.items||b.items.length<d)return E($f,"Invalid number of items"),!1;if(b.repeatMode&&!$d(b.repeatMode))return E($f,"Invalid repeatMode"),!1;for(d=0;d<b.items.length;d++)if(b.items[d].media){if(!c&&
n(b.items[d].itemId))return E($f,"ItemId should not be defined, element at index: "+d),!1;b.items[d].itemId=p(b.items[d].itemId)?b.items[d].itemId:a.cd()}else return E($f,"Media is mandatory, missing in element at index: "+d),!1;return!0},kg=function(a,b){a.j=b;if(a.b&&0<=b&&b<a.a.length)a.b.onCurrentItemIdChanged(Ha(a.a[b].itemId))},qg=function(a){return a.b&&a.a&&0<a.a.length&&a.j==a.a.length-1?fg(a,1):Promise.reject("No need to prefetch more for now.")},$f=y("cast.receiver.MediaQueue");var S={},rg=(S.LOAD="Cast.Receiver.Message.LOAD",S.GET_STATUS="Cast.Receiver.Message.GET_STATUS",S.LOAD="Cast.Receiver.Message.LOAD",S.PAUSE="Cast.Receiver.Message.PAUSE",S.STOP="Cast.Receiver.Message.STOP",S.SKIP_AD="Cast.Receiver.Message.SKIP_AD",S.PLAY="Cast.Receiver.Message.PLAY",S.PLAY_AGAIN="Cast.Receiver.Message.PLAY_AGAIN",S.SEEK="Cast.Receiver.Message.SEEK",S.SET_PLAYBACK_RATE="Cast.Receiver.Message.SET_PLAYBACK_RATE",S.SET_VOLUME="Cast.Receiver.Message.SET_VOLUME",S.EDIT_TRACKS_INFO="Cast.Receiver.Message.EDIT_TRACKS_INFO",
S.EDIT_AUDIO_TRACKS="Cast.Receiver.Message.EDIT_AUDIO_TRACKS",S.PRELOAD="Cast.Receiver.Message.PRELOAD",S.CANCEL_PRELOAD="Cast.Receiver.Message.CANCEL_PRELOAD",S.PRECACHE="Cast.Receiver.Message.PRECACHE",S.QUEUE_LOAD="Cast.Receiver.Message.QUEUE_LOAD",S.QUEUE_INSERT="Cast.Receiver.Message.QUEUE_INSERT",S.QUEUE_UPDATE="Cast.Receiver.Message.QUEUE_UPDATE",S.QUEUE_REMOVE="Cast.Receiver.Message.QUEUE_REMOVE",S.QUEUE_REORDER="Cast.Receiver.Message.QUEUE_REORDER",S.QUEUE_NEXT="Cast.Receiver.Message.QUEUE_NEXT",
S.QUEUE_PREV="Cast.Receiver.Message.QUEUE_PREV",S.QUEUE_GET_ITEM_RANGE="Cast.Receiver.Message.QUEUE_GET_ITEM_RANGE",S.QUEUE_GET_ITEMS="Cast.Receiver.Message.QUEUE_GET_ITEMS",S.QUEUE_GET_ITEM_IDS="Cast.Receiver.Message.QUEUE_GET_ITEM_IDS",S.QUEUE_SHUFFLE="Cast.Receiver.Message.QUEUE_SHUFFLE",S.SET_CREDENTIALS="Cast.Receiver.Message.SET_CREDENTIALS",S.LOAD_BY_ENTITY="Cast.Receiver.Message.LOAD_BY_ENTITY",S.USER_ACTION="Cast.Receiver.Message.USER_ACTION",S.DISPLAY_STATUS="Cast.Receiver.Message.DISPLAY_STATUS",
S.CUSTOM_COMMAND="Cast.Receiver.Message.CUSTOM_COMMAND",S),sg="local",tg=function(a,b){a=rg[a];b=b==sg?2:"__touch_controls__"==b?3:"__inject__"==b?4:1;a&&Ba(a,b)};K.H().addEventListener("ready",function(){var a=K.H(),b=a.u["urn:x-cast:com.google.cast.media"]||null;b&&b.addEventListener("message",function(a){a.data&&a.data.type&&tg(a.data.type,a.senderId)});(a=a.u["urn:x-cast:com.google.cast.cac"]||null)&&a.addEventListener("message",function(a){a.data&&a.data.type&&tg(a.data.type,a.senderId)})});var ug=function(a){var b=this;this.fe=a;this.v=null;this.Td="sdr";this.re=function(){b.fe()}},vg=function(a){return a.v?a.v.videoWidth:0},wg=function(a){return a.v?a.v.videoHeight:0};var xg=function(a){return!!a&&"function"===typeof a.then};var yg=function(){this.ra=[];this.Da=[]};yg.prototype.enqueue=function(a){this.Da.push(a)};var zg=function(a){0==a.ra.length&&(a.ra=a.Da,a.ra.reverse(),a.Da=[]);return a.ra.pop()};yg.prototype.dd=function(){return 0==this.ra.length&&0==this.Da.length};yg.prototype.clear=function(){this.ra=[];this.Da=[]};yg.prototype.contains=function(a){return 0<=Ja(this.ra,a)||0<=Ja(this.Da,a)};yg.prototype.remove=function(a){var b=this.ra;var c=Ka(b,a);0<=c?(La(b,c),b=!0):b=!1;return b||Ma(this.Da,a)};var T=function(a,b,c){var d=this,e=K.H();Se.H();sg=this.wa=c||"local";this.C=e.ib("urn:x-cast:com.google.cast.media","JSON");this.va=0;this.Pb=this.Ia=null;this.ga=1;this.Yb=b||15;this.He=this.ce=this.nb=this.Ha=this.f=this.h=null;this.ua=!1;this.ta=this.w=null;this.sc=!0;this.Bb=null;this.Pc=this.Xe.bind(this);this.b=new R(this.Pd.bind(this));this.zb=!1;this.Pa=null;this.ng=1;this.Dc=-1;this.uc=new yg;this.mb=!1;this.Qa=[];this.customizedStatusCallback=this.ff;this.customizedCloudStatusCallback=
null;this.onLoad=this.sf;this.onPlay=this.wf;this.onPlayAgain=this.vf;this.onSeek=this.Cf;this.onSkipAd=null;this.onSetPlaybackRate=this.Df;this.onPause=this.uf;this.onStop=this.Gf;this.onSetVolume=this.Ef;this.onEditTracksInfo=this.jf;this.onEditAudioTracks=this.hf;this.onQueueLoad=this.zf;this.onQueueInsert=this.yf;this.onQueueUpdate=this.Nd;this.onQueueRemove=this.Af;this.onQueueReorder=this.Bf;this.onMetadataLoaded=this.tf;this.onLoadMetadataError=this.rf;this.onEnded=this.kf;this.onQueueEnded=
this.xf;this.onAbort=q;this.onError=this.lf;this.onMediaStatus=this.onLocalRequestError=q;this.onPreload=this.onPrecache=null;this.onFetchItems=this.mf;this.onGetItemsInfo=this.nf;this.onGetQueueIds=this.pf;this.onShuffle=this.Ff;this.Na=this.onCancelPreload=null;this.onGetStatus=this.qf;this.bc=new ug(this.m.bind(this,!1));e.od=function(a){var b=d.bc;b.Td=a;b.fe()};this.l=new C;this.Wd=this.Le=this.limitQueueItemsInStatus=!1;this.za(a);this.C.onMessage=this.pd.bind(this);this.Bb=md(this.Pc,1E3)};
t("cast.receiver.MediaManager",T);T.prototype.sa=function(){return"MediaManager"};T.prototype.Pd=function(){return this.ng++};T.prototype.Rd=function(){return this.f?this.f.media||null:null};T.prototype.getMediaInformation=T.prototype.Rd;T.prototype.Sf=function(){return n(this.b.a)?this.b:null};T.prototype.getMediaQueue=T.prototype.Sf;
T.prototype.cg=function(a,b,c,d,e){a=new Ag(a);a.insertBefore=null!=b?b:void 0;a.currentItemIndex=null!=c?c:void 0;a.currentItemId=null!=d?d:void 0;a.currentTime=null!=e?e:void 0;a.type="QUEUE_INSERT";Bg(this,this.wa,a)};T.prototype.insertQueueItems=T.prototype.cg;T.prototype.yg=function(a,b,c){a=new Cg(a);a.currentItemId=null!=b?b:void 0;a.currentTime=null!=c?c:void 0;a.type="QUEUE_REMOVE";Bg(this,this.wa,a)};T.prototype.removeQueueItems=T.prototype.yg;
T.prototype.Jg=function(a,b,c){b=!n(b)||b;if(c&&!b)throw Error("No broadcast call but status customData has been provided");this.f&&(this.f.media=a);b&&this.m(!0,null,c)};T.prototype.setMediaInformation=T.prototype.Jg;T.prototype.$f=function(){return this.Yb};T.prototype.getSupportedMediaCommands=T.prototype.$f;T.prototype.Dd=function(a,b){this.Yb=a;(void 0===b||b)&&this.m(!1)};T.prototype.setSupportedMediaCommands=T.prototype.Dd;T.prototype.Se=function(a){this.Dd(a|this.Yb)};
T.prototype.addSupportedMediaCommands=T.prototype.Se;T.prototype.zg=function(a){this.Dd(~a&this.Yb)};T.prototype.removeSupportedMediaCommands=T.prototype.zg;
var Dg=function(a){for(var b=0;b<a.length;b++)if(!n(a[b].trackId)||!n(a[b].type))return!1;return!0},Eg=function(a,b){if(!b||0==b.length)return!0;if(!a||b.length>a.length)return E(O,"Too many track IDs"),!1;for(var c=0,d=0,e=0;e<b.length;e++){for(var f=!1,h=0;h<a.length;h++)if(b[e]==a[h].trackId){f=!0;break}if(!f)return E(O,"Track ID does not exist: "+b[e]),!1;"AUDIO"==a[h].type?d++:"VIDEO"==a[h].type&&c++;if(1<d||1<c)return E(O,"Maximum one active video and one active audio track supported"),!1}return!0},
Bg=function(a,b,c){c.mediaSessionId=a.va;tg(c.type,b);a.pd(new ce("message",b,c))};
T.prototype.pd=function(a){var b=a.data,c=b.type;if(!this.mb||this.uc.dd()&&"LOAD"==c){a=a.senderId;var d=b.type;var e=b.requestId;if(p(e)&&e==Math.floor(e)){var f=!1;void 0!=b.mediaSessionId&&b.mediaSessionId!=this.va?(E(O,"Invalid media session ID: "+b.mediaSessionId+" does not match the expected ID: "+this.va),f=!0):"LOAD"!=d&&"PLAY_AGAIN"!=d&&"GET_STATUS"!=d&&"QUEUE_LOAD"!=d&&"PRECACHE"!=d&&(n(b.mediaSessionId)?"IDLE"==Fg(this)&&(E(O,"Unexpected command, player is in IDLE state so the media session ID is not valid yet"),
f=!0):(E(O,"Invalid media session ID, it is undefined"),f=!0));f?(this.ha(a,e,"INVALID_REQUEST","INVALID_MEDIA_SESSION_ID"),d=!1):(D(O,x,"MediaManager message received"),d=!0)}else E(O,"Ignoring request, requestId is not an integer: "+e),d=!1;if(d){d=b.requestId;e=null;switch(c){case "LOAD":this.zb=!1;e=Gg(this,a,b,!0);break;case "GET_STATUS":G(O,"Dispatching MediaManager getStatus event");b=new U("getstatus",b,a);if(this.onGetStatus)this.onGetStatus(b);this.g(b);e=null;break;case "PLAY":G(O,"Dispatching MediaManager play event");
b=new U("play",b,a);if(this.onPlay)this.onPlay(b);this.g(b);e=null;break;case "PLAY_AGAIN":G(O,"Dispatching MediaManager play again event");b=new U("playagain",b,a);if(this.onPlayAgain)this.onPlayAgain(b);this.g(b);e=null;break;case "SEEK":if(n(b.currentTime)||n(b.relativeTime)){G(O,"Dispatching MediaManager seek event");b=new U("seek",b,a);if(this.onSeek)this.onSeek(b);this.g(b);e=null}else E(O,"currentTime or relativeTime is required"),e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};break;case "SET_PLAYBACK_RATE":(e=
b.playbackRate)||(e=b.relativePlaybackRate*this.ga);if(!p(e)||.5>e||2<e)E(O,"Bad value for playback rate "+e),e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};else{G(O,"Dispatching MediaManager playback rate event");b=new U("setplaybackrate",b,a);if(this.onSetPlaybackRate)this.onSetPlaybackRate(b);this.g(b);e=null}break;case "STOP":G(O,"Dispatching MediaManager stop event");b=new U("stop",b,a);if(this.onStop)this.onStop(b);this.g(b);e=null;break;case "PAUSE":G(O,"Dispatching MediaManager pause event");
b=new U("pause",b,a);if(this.onPause)this.onPause(b);this.g(b);e=null;break;case "SKIP_AD":G(O,"Dispatching MediaManager skip ad event");e=new U("skipad",b,a);if(this.onSkipAd)this.onSkipAd(e);else this.ha(a,b.requestId,"INVALID_REQUEST","NOT_SUPPORTED");this.g(e);e=null;break;case "SET_VOLUME":if(b.volume&&(n(b.volume.level)||n(b.volume.muted)))if(void 0!=b.volume.level&&0>b.volume.level||1<b.volume.level)E(O,"volume level is invalid"),e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};else{G(O,
"Dispatching MediaManager setvolume event");b=new U("setvolume",b,a);if(this.onSetVolume)this.onSetVolume(b);this.g(b);e=null}else E(O,"volume is invalid"),e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};break;case "EDIT_TRACKS_INFO":G(O,"Dispatching MediaManager editTracksInfo event");if(Eg(this.f.media.tracks,b.activeTrackIds)){e=new U("edittracksinfo",b,a);b.textTrackStyle&&(this.f.media.textTrackStyle=b.textTrackStyle);b.activeTrackIds&&(this.f.activeTrackIds=b.activeTrackIds);if(this.onEditTracksInfo)this.onEditTracksInfo(e);
this.g(e);e=null}else E(O,"Invalid track info"),e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};break;case "EDIT_AUDIO_TRACKS":G(O,"Dispatching MediaManager editAudioTracks event");b=new U("editaudiotracks",b,a);if(this.onEditAudioTracks)this.onEditAudioTracks(b);this.g(b);e=null;break;case "QUEUE_LOAD":this.zb=!0;G(O,"Dispatching MediaManager queueLoad event");if(Zf(this.b,b)){b.items=Hg(b.items);b=new U("queueload",b,a);if(this.onQueueLoad)this.onQueueLoad(b);this.g(b);e=null}else e={type:"INVALID_REQUEST",
reason:"INVALID_PARAMS"};break;case "QUEUE_INSERT":this.zb=!0;G(O,"Dispatching MediaManager queueInsert event");e=!1;if(n(this.b.a))if(b.items&&0!=b.items.length)if(n(b.currentItemId)&&n(b.currentItemIndex))E(O,"Maximum one currentItem must be provided"),e=!0;else if(n(b.currentItemIndex)&&(!p(b.currentItemIndex)||0>b.currentItemIndex||b.currentItemIndex>=b.items.length))E(O,"Invalid currentItemIndex"),e=!0;else if(n(b.currentItemId)&&(!p(b.currentItemId)||0>b.currentItemId))E(O,"Invalid currentItemId"),
e=!0;else for(c=0;c<b.items.length;c++)if(p(b.items[c].itemId)){E(O,"Item contains an itemId at index: "+c);e=!0;break}else b.items[c].itemId=this.Pd();else E(O,"No items to insert"),e=!0;else E(O,"Queue does not exist"),e=!0;if(e)e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};else{b.items=Hg(b.items);b=new U("queueinsert",b,a);if(this.onQueueInsert)this.onQueueInsert(b);this.g(b);e=null}break;case "QUEUE_UPDATE":e=Ig(this,a,b);break;case "QUEUE_REMOVE":G(O,"Dispatching MediaManager queueRemove event");
e=!1;n(this.b.a)?b.itemIds&&0!=b.itemIds.length?Jg(b.itemIds)||(e=!0):(E(O,"No itemIds to remove"),e=!0):(E(O,"Queue does not exist"),e=!0);if(e)e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};else{b.itemIds&&(b.itemIds=hg(this.b,b.itemIds));b=new U("queueremove",b,a);if(this.onQueueRemove)this.onQueueRemove(b);this.g(b);e=null}break;case "QUEUE_REORDER":G(O,"Dispatching MediaManager queueReorder event");e=!1;n(this.b.a)?b.itemIds&&0!=b.itemIds.length?Jg(b.itemIds)?n(b.insertBefore)&&0<=Ja(b.itemIds,
b.insertBefore)&&(E(O,"insertBefore can not be one of the reordered items"),e=!0):e=!0:(E(O,"No itemIds to reorder"),e=!0):(E(O,"Queue does not exist"),e=!0);if(e)e={type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};else{b.itemIds&&(b.itemIds=hg(this.b,b.itemIds));b=new U("queuereorder",b,a);if(this.onQueueReorder)this.onQueueReorder(b);this.g(b);e=null}break;case "PRECACHE":b=new U("precache",b,"__broadcast__");if(this.onPrecache)this.onPrecache(b);this.g(b);break;case "QUEUE_NEXT":c=new Kg;c.jump=
1;c.requestId=b.requestId;Ig(this,a,c);break;case "QUEUE_PREV":c=new Kg;c.jump=-1;c.requestId=b.requestId;Ig(this,a,c);break;case "QUEUE_GET_ITEM_RANGE":b=new U("getitemsrange",b,a);if(this.onFetchItems)this.onFetchItems(b);this.g(b);break;case "QUEUE_GET_ITEMS":b=new U("getitemsinfo",b,a);if(this.onGetItemsInfo)this.onGetItemsInfo(b);this.g(b);break;case "QUEUE_GET_ITEM_IDS":b=new U("getqueueids",b,a);if(this.onGetQueueIds)this.onGetQueueIds(b);this.g(b);break;case "QUEUE_SHUFFLE":b=new U("shuffle",
b,a);if(this.onShuffle)this.onShuffle(b);this.g(b);break;default:E(O,"Unexpected message type: "+c),e={type:"INVALID_REQUEST",reason:"INVALID_COMMAND"}}Lg(this,e,a,d)}}else F(O,"Load is in progress, media command is being queued."),this.uc.enqueue(a)};
var Lg=function(a,b,c,d){b&&(E(O,"Sending error: "+b.type+" "+b.reason),a.onLocalRequestError&&c==a.wa?(b.requestId=d,a.onLocalRequestError(b)):a.ha(c,d,b.type,b.reason))},Fg=function(a){if(!a.f)return"IDLE";var b=a.h.getState();return"PLAYING"==b&&a.ua?"BUFFERING":b},Mg=function(a,b,c,d){var e={type:"MEDIA_STATUS"},f=a.w&&a.w.message.media||null;if(!a.f&&!a.Ha&&!f)return e.status=[],e;var h={mediaSessionId:a.va,playbackRate:a.ga,playerState:Fg(a),currentTime:a.h.getCurrentTimeSec(),supportedMediaCommands:a.Yb,
volume:a.h.getVolume()};a.Pa&&(h.preloadedItemId=a.Pa);var u=vg(a.bc),Z=wg(a.bc);0<u&&0<Z&&(h.videoInfo=new Sd(u,Z,a.bc.Td));if(a.f)h.activeTrackIds=a.f.activeTrackIds,b&&(h.media=a.Rd()||void 0,u=a.b.tb)&&(h.queueData=bb(u),h.queueData.items=void 0),h.currentItemId=a.f.itemId;else if(a.Ha&&(b&&(h.media=a.Ha.media||void 0),h.currentItemId=a.Ha.itemId,a.Ha=null),n(a.b.a)&&(u=a.b.jb()))h.loadingItemId=u.itemId;"IDLE"==h.playerState?(a.ta&&(h.idleReason=a.ta),f&&(h.extendedStatus=new Ud("LOADING",f))):
a.ta=null;void 0!=c&&(h.customData=c);n(a.b.a)&&(d&&(h.items=a.b.Ib(b,a.limitQueueItemsInStatus)),h.repeatMode=a.b.D);if(a.customizedStatusCallback)return b=function(a){a?e.status=[a]:e=null;return e},c=a.customizedStatusCallback(h),a.Wd=!!h.breakStatus,xg(c)?c.then(b):b(c);e.status=[h];return e},Ng=function(a){null!=a.Pb&&(m.clearTimeout(a.Pb),a.Pb=null)},Og=function(a){var b=a.h.getCurrentTimeSec();a.nb=b;a.ce=b;a.He=Date.now();null!=a.Bb&&m.clearTimeout(a.Bb);a.Bb=md(a.Pc,1E3)};
T.prototype.Xe=function(){this.Bb=md(this.Pc,1E3);var a=Fg(this);if("IDLE"!=a&&"PAUSED"!=a){this.mb&&"PLAYING"==a&&(F(O,"Triggering load complete, since media is playing."),this.wd());a=this.nb;this.nb=this.h.getCurrentTimeSec();var b=this.ua;this.ua=this.Le?"BUFFERING"===this.h.getState():100>1E3*(this.nb-a);b!=this.ua?(D(O,x,"Buffering state changed, isPlayerBuffering: "+this.ua+" old time: "+a+" current time: "+this.nb),this.m(!1)):this.ua||this.Wd||(a=1E3*(this.nb-this.ce)-this.ga*(Date.now()-
this.He),1E3<a||-1E3>a?(D(O,x,"Time drifted: "+a),this.m(!1)):this.f&&n(this.b.a)&&(a=this.b,(a=0>a.j?null:"REPEAT_SINGLE"==a.D?a.a[a.j]:a.j+1>=a.a.length&&(ig(a)||"REPEAT_OFF"==a.D)?null:a.a[(a.j+1)%a.a.length])&&p(a.preloadTime)&&this.f.media&&!this.w&&"LIVE"!=this.f.media.streamType&&Pg(this,a.preloadTime)&&this.Pa!=a.itemId&&(this.onPreload?(Ha(a.itemId),b=new Qg(a.itemId),b.requestId=0,b.mediaSessionId=this.va,b.autoplay=a.autoplay,b.currentTime=a.startTime,b.customData=a.customData||void 0,
b.activeTrackIds=a.activeTrackIds,b.media=a.media,b=new U("preload",b,""),Ha(a.itemId),this.Pa=a.itemId,G(O,"Sending preload event: "+JSON.stringify(b)),this.onPreload(b)&&this.m(!1)):G(O,"Not sending preload event"))))}};
T.prototype.m=function(a,b,c,d){var e=this;if(this.h){D(O,x,"Sending broadcast status message");var f=function(a){if(null!=a){if(e.onMediaStatus&&a.status)e.onMediaStatus(a.status[0]||null);a.requestId=b||0;e.C.fc(a);Og(e);Rg(e,a)}};a=Mg(this,a,c,d);xg(a)?a.then(f):f(a)}else E(O,"Not sending broadcast status message, state is invalid")};T.prototype.broadcastStatus=T.prototype.m;T.prototype.Hg=function(a){D(O,x,"Setting IDLE reason: "+a);this.ta=a};T.prototype.setIdleReason=T.prototype.Hg;
T.prototype.ha=function(a,b,c,d,e){G(O,"Sending error message to "+a);var f={};f.requestId=b;f.type=c;d&&(f.reason=d);e&&(f.customData=e);this.Na&&this.Na(f);this.C.send(a,f)};T.prototype.sendError=T.prototype.ha;
T.prototype.Be=function(a,b,c,d,e){var f=this;if(this.h){D(O,x,"Sending status message to "+a);var h=function(c){if(null!=c){if(f.onMediaStatus&&c.status)f.onMediaStatus(c.status[0]||null);c.requestId=b;f.C.send(a,c);Og(f)}};c=Mg(this,c,d,e);xg(c)?c.then(h):h(c)}else E(O,"State is invalid"),this.ha(a,b,"INVALID_PLAYER_STATE",null,d)};T.prototype.sendStatus=T.prototype.Be;
var Rg=function(a,b){if(a.customizedCloudStatusCallback){b=cb(b);b.type="CLOUD_STATUS";try{b=a.customizedCloudStatusCallback(b)}catch(c){E(O,"Cloud status handler failed. "+c);return}xg(b)?b.then(function(b){a.C.send("__cloud__",b)}):a.C.send("__cloud__",b)}};T.prototype.ff=function(a){return a};var Sg=function(a){a.w=null;if(a.mb)for(a.mb=!1;!a.uc.dd()&&!a.mb;)a.pd(zg(a.uc))};T.prototype.load=function(a){a.type="LOAD";Bg(this,this.wa,a)};T.prototype.load=T.prototype.load;
T.prototype.wg=function(a){a.type="QUEUE_LOAD";Bg(this,this.wa,a)};T.prototype.queueLoad=T.prototype.wg;
var Gg=function(a,b,c,d,e){G(O,"Dispatching MediaManager load event");G(O,"Load message received:"+JSON.stringify(c));var f=!1,h=e;c.media||c.queueData?c.media&&c.media.tracks&&!Dg(c.media.tracks)?(E(O,"Invalid tracks information"),f=!0):c.activeTrackIds&&c.media&&!Eg(c.media.tracks,c.activeTrackIds)&&(f=!0):(E(O,"Media or QueueData is mandatory"),f=!0);e=c.playbackRate;if(n(e)&&(!p(e)||.5>e||2<e))return E(O,"Bad value for playback rate "+e),{type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};if(f)return h&&
h(),{type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};a.w?a.Ec("LOAD_CANCELLED"):a.f&&(a.Wb("INTERRUPTED",!1),h=a.m.bind(a,!0));a.w={senderId:b,message:c};h&&h();a.mb=!0;if(d&&(a.va++,a.ta=null,a.zb=n(c.queueData),d=Yf(a.b,c),xg(d)))return d.then(function(){a.zb=!0;var d=a.b.jb();!d||!d.media||c.media&&d.media.contentId==c.media.contentId||(c.media&&G(O,"Implementation of queueing has provided "+d.media.contentId+" as the first item whilethe original media portion of the LOAD provided "+c.media.contentId),
c.media=d.media,c.autoplay=c.autoplay||d.autoplay,c.currentTime=c.currentTime||d.startTime||a.b.Hc);Tg(a,b,c,h)},function(){a.Ec("LOAD_FAILED")}),null;Tg(a,b,c,h);return null},Tg=function(a,b,c,d){a.f=cb(a.b.jb());a.Qa=[];c.media=a.f.media||c.media;a.f.activeTrackIds=c.activeTrackIds;Ng(a);a.Ia=c;if(a.sc&&a.h.preload){var e=a.b.Hc;a.h.preload(n(c.autoplay)?c.autoplay:!0,0<c.currentTime?c.currentTime:0<e?e:0,a.f.playbackDuration,a.f.startTime)}e=new U("load",c,b);a.onLoad&&(a.ga=c.playbackRate?c.playbackRate:
1,a.onLoad(e));a.g(e);d||a.m(!0);a.Pa=null;qg(a.b).then(function(d){Ug(a,d,b,c)},function(a){G(O,a)})};T.prototype.sf=function(a){a=a.data;if(a.media&&(a.media.contentUrl||a.media.contentId)){var b=n(a.autoplay)?a.autoplay:!0,c=a.media.contentUrl||a.media.contentId;a.media.tracks?this.h.load(c,b,a.currentTime,{tracks:a.media.tracks,activeTrackIds:a.activeTrackIds,textTrackStyle:a.media.textTrackStyle},void 0,a.playbackRate):this.h.load(c,b,a.currentTime,void 0,void 0,a.playbackRate)}};
T.prototype.lg=function(a){if(!this.w)return!1;a.tracks=a.tracks||void 0;if(a.tracks&&!Dg(a.tracks))return E(O,"Invalid tracks information"),!1;if(a.activeTrackIds&&!Eg(a.tracks,a.activeTrackIds))return E(O,"Invalid active tracks"),!1;this.f&&this.f.media&&(this.f.activeTrackIds=a.activeTrackIds,this.f.media.tracks=a.tracks,this.f.media.textTrackStyle=a.textTrackStyle);this.h.load("",!1,void 0,a,!0);return!0};T.prototype.loadTracksInfo=T.prototype.lg;
T.prototype.za=function(a){if(a!=this.h){this.h&&(this.h.unregisterErrorCallback(),this.h.unregisterEndedCallback(),this.h.unregisterLoadCallback());this.h=(this.sc=a.getState?!1:!0)?new Jf(a):a;this.h.registerErrorCallback(this.md.bind(this));this.h.registerEndedCallback(this.xc.bind(this));this.h.registerLoadCallback(this.qd.bind(this));var b=this.bc;b.v&&b.v.removeEventListener("resize",b.re);var c=null;a.tagName&&"video"==a.tagName.toLowerCase()?c=a:(a=document.getElementsByTagName("video"),1==
a.length&&(c=a[0]));b.v=c;b.v&&b.v.addEventListener("resize",b.re)}};T.prototype.setMediaElement=T.prototype.za;
T.prototype.qd=function(){if(this.w){G(O,"Metadata loaded");if(this.f&&this.f.media){var a=this.h.getDurationSec();-1!=a&&Infinity!=a||this.f.media.streamType&&"NONE"!=this.f.media.streamType?-1==a||Infinity==a||this.f.media.streamType&&"NONE"!=this.f.media.streamType||(F(O,"Media streamType is initially set wrong, changed to buffered."),this.f.media.streamType="BUFFERED"):(F(O,"Media streamType is initially set wrong, changed to live."),this.f.media.streamType="LIVE");this.f.media.duration=a;this.b.jb().media.duration=
a}this.ua=!0;if(this.onMetadataLoaded)this.onMetadataLoaded(this.w);else Sg(this)}};T.prototype.tf=function(a){this.sc&&a.message&&void 0!=a.message.currentTime&&a.message.currentTime!=this.h.getCurrentTimeSec()&&this.h.seek(a.message.currentTime);this.wd()};T.prototype.md=function(a){if(this.w)if(E(O,"Load metadata error: "+a),this.onLoadMetadataError)this.onLoadMetadataError(this.w);else Sg(this);else if(this.onError)this.onError(a)};
T.prototype.Ec=function(a,b){if(this.w){a=a||"LOAD_FAILED";if(this.w.senderId==this.wa){if(this.onLocalRequestError)this.onLocalRequestError({type:a})}else this.ha(this.w.senderId,this.w.message.requestId,a,null,b);Sg(this)}else E(O,"Not sending LOAD error as there is no on going LOAD request")};T.prototype.sendLoadError=T.prototype.Ec;T.prototype.wd=function(a){if(this.w){var b=this.w.message.requestId;this.m(!0,b,a,0!=b||this.limitQueueItemsInStatus);Sg(this)}else E(O,"Not sending status as there is no on going LOAD request")};
T.prototype.sendLoadComplete=T.prototype.wd;T.prototype.lf=function(){Vg(this)};var Vg=function(a,b,c){b=void 0===b?!1:b;c=void 0===c?!1:c;var d=a.b.j;if(n(a.b.a)&&-1!=d&&d<a.b.a.length-1)a.onEnded("ERROR");else a.Wb("ERROR",b),c&&a.Ec("LOAD_FAILED")};T.prototype.rf=function(){this.w&&""==this.w.senderId&&this.w.message&&0==this.w.message.requestId?Vg(this,!0):Vg(this,!1,!0)};T.prototype.xc=function(){if(this.onEnded)this.onEnded()};
T.prototype.kf=function(a){if(n(this.b.a)){var b=-1!=this.Dc?this.Dc:void 0;this.Dc=-1;Wg(this,"REPEAT_SINGLE"==this.b.D?0:1,!1,b,void 0,void 0,void 0,void 0===a?"FINISHED":a)}};T.prototype.xf=function(a,b){this.Wb(a,!0,b)};var Wg=function(a,b,c,d,e,f,h,u){c=a.kg.bind(a,b,c,d,e,f,h,u);mg(a.b)?fg(a.b,b).then(c,c):c()};g=T.prototype;
g.kg=function(a,b,c,d,e,f,h){h=h||"INTERRUPTED";if(n(this.b.a)&&"QUEUE_ENDED"!=pg(this.b,a,!1)){var u=pg(this.b,a,!0);G(O,"After "+a+" jump, transition is: "+u);if(a=Xg(this,this.b.jb(),void 0,f)){if(this.f&&(this.ta=h,this.Ha=this.f,this.f=null,this.Qa=[],"QUEUE_SHUFFLED"==u&&(e=!0),"INTERRUPTED"==this.ta))this.onAbort();Gg(this,"",a,!1,this.m.bind(this,b,c,d,e))}else if(this.onQueueEnded)this.onQueueEnded(h,c)}else if(this.onQueueEnded)this.onQueueEnded(h,c)};
g.qf=function(a){D(O,x,"onGetStatus");var b=a.data;D(O,x,"onGetStatus: "+JSON.stringify(b));var c=!0,d=!0;b.options&&(b.options&1&&(c=!1),b.options&1&&(d=!1));this.Be(a.senderId,a.data.requestId,c,null,d)};g.wf=function(a){D(O,x,"onPlay");this.h.play();this.m(!1,a.data.requestId)};g.vf=function(a){D(O,x,"onPlayAgain");this.f?(this.h.seek(0),this.h.play(),this.m(!1,a.data.requestId)):this.Ia&&(this.Ia.type="LOAD",this.Ia.autoplay=!0,Bg(this,this.wa,this.Ia))};
g.Cf=function(a){a=a.data;D(O,x,"onSeek: "+JSON.stringify(a));var b=n(a.relativeTime)?this.h.getCurrentTimeSec()+a.relativeTime:a.currentTime;Ha(b);this.h.seek(b,a.resumeState);"PAUSED"!=this.h.getState()&&(this.ua=!0);this.h.getCurrentTimeSec()<this.h.getDurationSec()?this.m(!1,a.requestId):this.Dc=a.requestId};
g.Df=function(a){a=a.data;D(O,x,"onSetPlaybackRate: "+JSON.stringify(a));this.h.Ee?this.Me(this.h.Ee(Number(a.playbackRate?a.playbackRate:this.ga*a.relativePlaybackRate))):F(O,"setPlaybackRate is not supported");this.m(!1,a.requestId)};g.Me=function(a){this.ga=a};T.prototype.updatePlaybackRate=T.prototype.Me;T.prototype.Gf=function(a){this.Wb("CANCELLED",!0,a.data.requestId)};
T.prototype.Wb=function(a,b,c,d){var e=this;b=!n(b)||b;if((d||c)&&!b)throw Error("customData and requestId should only be provided in broadcast mode");this.f?(this.b.clear(),this.h.reset(a),a&&(this.ta=a),this.Ha=this.f,this.f=null,this.Qa=[],b&&this.m(!1,c,d,void 0)):G(O,"Nothing to reset, Media is already null");this.Ia&&(Ng(this),this.Pb=md(function(){e.Ia=null;e.Pb=null},9E5));if(a&&"INTERRUPTED"==a)this.onAbort()};T.prototype.resetMediaElement=T.prototype.Wb;g=T.prototype;
g.uf=function(a){this.h.pause();this.m(!1,a.data.requestId)};g.Ef=function(a){a=a.data;this.h.setVolume(a.volume);this.m(!1,a.requestId)};
g.jf=function(a){var b=a.data,c;a:{var d=this.f.media.tracks;if(c=b.language){if(d){d=l(d);for(var e=d.next();!e.done;e=d.next())if(e=e.value,"TEXT"==e.type&&n(e.language)&&Ca(e.language,c)){c=!0;break a}}c=!1}else c=!0}if(c){if(!b.activeTrackIds&&!b.language&&n(b.enableTextTracks))if(c=this.Hd(b))b.activeTrackIds=c;else{this.ha(a.senderId,b.requestId,"INVALID_REQUEST","INVALID_PARAMS");return}a={activeTrackIds:b.activeTrackIds,language:b.language,textTrackStyle:b.textTrackStyle};this.h.editTracksInfo&&
(this.f.activeTrackIds=this.h.editTracksInfo(a)||void 0);this.m(b.textTrackStyle?!0:!1,b.requestId)}else E(O,"Invalid track language"),this.ha(a.senderId,b.requestId,"INVALID_REQUEST","LANGUAGE_NOT_SUPPORTED")};
g.Hd=function(a){var b=this.f&&this.f.media&&this.f.media.tracks;if(!b||0==b.length)return E(O,"No tracks available"),null;b=b.filter(function(a){return"TEXT"==a.type}).map(function(a){return a.trackId});if(0==b.length)return E(O,"No text tracks available"),null;var c=this.f.activeTrackIds||[],d=b.filter(function(a){return 0<=c.indexOf(a)});if(!a.enableTextTracks){if(0<d.length)return this.Qa=d,c.filter(function(a){return 0>d.indexOf(a)})}else if(0==d.length)return a=c.concat(0<this.Qa.length?this.Qa:
[b[0]]),this.Qa=[],a;return c};g.hf=function(a){var b=a.data,c;a:{var d=this.f.media.tracks;if(c=b.language){if(d){d=l(d);for(var e=d.next();!e.done;e=d.next())if(e=e.value,"AUDIO"==e.type&&n(e.language)&&Ca(e.language,c)){c=!0;break a}}c=!1}else c=!0}c?(this.h.If&&(this.f.activeTrackIds=this.h.If(b)),this.m(!1,b.requestId)):(E(O,"Invalid audio track language"),this.ha(a.senderId,b.requestId,"INVALID_REQUEST","LANGUAGE_NOT_SUPPORTED"))};
var Jg=function(a){if(2>a.length)return!0;for(var b=0;b<a.length;b++)for(var c=b+1;c<a.length;c++)if(a[b]==a[c])return E(O,"Duplicate itemId: "+a[b]+"at positions:"+b+" "+c),!1;return!0},Yg=function(a){for(var b=0;b<a.length;b++){if(!p(a[b].itemId))return E(O,"Invalid itemId at position: "+b),!1;for(var c=b+1;c<a.length;c++){if(!p(a[c].itemId))return E(O,"Invalid itemId at position: "+c),!1;if(a[b].itemId==a[c].itemId)return E(O,"Duplicate itemId: "+a[b].itemId+"at positions:"+b+" "+c),!1}}return!0},
Hg=function(a){for(var b=[],c=0;c<a.length;c++){var d=new Uf(a[c].itemId);d.media=a[c].media;d.autoplay=a[c].autoplay;d.startTime=a[c].startTime;d.playbackDuration=a[c].playbackDuration;d.preloadTime=a[c].preloadTime;d.activeTrackIds=a[c].activeTrackIds;d.customData=a[c].customData;b.push(d)}return b},Xg=function(a,b,c,d){if(!b)return null;var e=new Zg;e.requestId=c||0;e.mediaSessionId=a.va;e.type="LOAD";e.autoplay=b.autoplay;e.currentTime=n(d)?d:b.startTime;e.activeTrackIds=b.activeTrackIds;e.customData=
b.customData||void 0;e.media=b.media;return e},Pg=function(a,b){if(a.f.media.duration-a.h.getCurrentTimeSec()<=b||0==b&&a.h.eg&&a.h.eg())return!0;if(null==a.Pa)return!1;a.Pa=null;if(!a.onCancelPreload)return!1;b=new V("CANCEL_PRELOAD");b.requestId=0;b.mediaSessionId=a.va;b=new U("cancelpreload",b,"");G(O,"Sending cancel preload event: "+JSON.stringify(b));a.onCancelPreload(b)&&a.m(!1);return!1};
T.prototype.zf=function(a){var b=a.data,c=Xg(this,b.items?b.items[b.startIndex||0]:null,b.requestId,b.currentTime),d=new Id;d.items=b.items;d.startIndex=b.startIndex||0;d.startTime=b.currentTime;d.repeatMode=b.repeatMode||"REPEAT_OFF";c.queueData=d;c?Gg(this,a.senderId,c,!0):E(O,"Queue Load request is invalid")};
T.prototype.yf=function(a){a=a.data;G(O,"Queue insert data: "+JSON.stringify(a));var b=!1;n(a.currentItemId)&&(b=lg(this.b,a.currentItemId));n(a.currentItemIndex)&&(b=!0);var c=cg(this.b,a.items,a.insertBefore,a.currentItemIndex);$g(this,"INSERT",c,a.insertBefore);b?Wg(this,0,!0,a.requestId,a.customData,!0,a.currentTime):this.m(!0,a.requestId,a.customData,!0)};
var Ig=function(a,b,c){G(O,"Dispatching MediaManager queueUpdate event");var d=!1;n(a.b.a)?c.items&&!Yg(c.items)?d=!0:c.repeatMode&&!$d(c.repeatMode)&&(E(O,"Invalid repeatMode"),d=!0):(E(O,"Queue does not exist"),d=!0);if(d)return{type:"INVALID_REQUEST",reason:"INVALID_PARAMS"};if(c.items&&0<c.items.length){d=a.b;for(var e=c.items,f=[],h=0;h<e.length;h++)for(var u=0;u<d.a.length;u++)if(e[h].itemId==d.a[u].itemId){f.push(e[h]);break}c.items=Hg(f)}b=new U("queueupdate",c,b);if(a.onQueueUpdate)a.onQueueUpdate(b);
a.g(b);return null};T.prototype.mf=function(a){var b=this,c=a.data;this.b.fetchItems(c.requestId,c.itemId,c.nextCount,c.prevCount).then(function(d){Ug(b,d,a.senderId,c)},function(){Lg(b,{type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},a.senderId,c.requestId)})};var Ug=function(a,b,c,d){"NO_CHANGE"==b.changeType&&n(c)?a.C.send(c,b):(a.C.fc(b),a.limitQueueItemsInStatus&&a.m(!0,d.requestId,d.customData,!0))},$g=function(a,b,c,d){var e=new Xd;e.changeType=b;e.itemIds=c;null!=d&&(e.insertBefore=d);a.C.fc(e)};
g=T.prototype;g.nf=function(a){var b=a.data;this.C.send(a.senderId,dg(this.b,b.requestId,b.itemIds))};g.pf=function(a){this.C.send(a.senderId,eg(this.b,a.data.requestId))};g.Ff=function(a){var b=this,c=a.data;this.b.shuffle().then(function(){b.m(!1,c.requestId,c.customData,!0)})};
g.Nd=function(a){var b=a.data;if(this.zb){G(O,"Queue update data: "+JSON.stringify(b));var c=a=!1;p(b.currentItemId)&&(c=lg(this.b,b.currentItemId));p(b.jump)&&(c=!0,this.limitQueueItemsInStatus&&(a=!0));b.repeatMode&&this.b.Xb(b.repeatMode);b.items&&0<b.items.length&&(gg(this.b,b.items),a=!0);b.shuffle&&(og(this.b),c=!0);var d=this.b.Ib().map(function(a){return a.itemId});$g(this,"UPDATE",d);c?Wg(this,b.jump||0,a,b.requestId,b.customData,a,b.currentTime):this.m(a,b.requestId,b.customData,a)}else a=
a.senderId,"__inject__"==a&&this.onQueueUpdate==this.Nd?this.ha(a,b.requestId,"INVALID_REQUEST","INVALID_COMMAND"):(G(O,"QUEUE_UPDATE request ignored"),this.m(!1,b.requestId))};
g.Af=function(a){a=a.data;G(O,"Queue remove data: "+JSON.stringify(a));var b=!1;p(a.currentItemId)&&(b=lg(this.b,a.currentItemId));if(a.itemIds&&0!=a.itemIds.length){if(!b){b=this.b;for(var c=a.itemIds,d=!1,e=0;e<c.length;e++)for(var f=0;f<b.a.length;f++)if(c[e]==b.a[f].itemId){b.a.splice(f,1);b.j==f?d=!0:b.j>f&&b.j--;break}b.j>=b.a.length&&(b.j=jg(b)?0:-1,ig(b)&&0==b.j&&og(b));if(b.b)b.b.onItemsRemoved(c);b=d}$g(this,"REMOVE",a.itemIds);b?Wg(this,0,!1,a.requestId,a.customData,!0,a.currentTime):this.m(!1,
a.requestId,a.customData,!0)}else E(O,"No itemIds to remove")};g.Bf=function(a){a=a.data;G(O,"Queue reorder data: "+JSON.stringify(a));var b=!1,c=!1;p(a.currentItemId)&&(c=lg(this.b,a.currentItemId));a.itemIds&&0<a.itemIds.length&&(ng(this.b,a.itemIds,a.insertBefore),b=!0);var d=this.b.Ib().map(function(a){return a.itemId});$g(this,"UPDATE",d,a.insertBefore);c?Wg(this,0,!1,a.requestId,a.customData,b,a.currentTime):this.m(!1,a.requestId,a.customData,b)};
g.addEventListener=function(a,b){B(this.l,a,b)};T.prototype.addEventListener=T.prototype.addEventListener;T.prototype.removeEventListener=function(a,b){wc(this.l,a,b)};T.prototype.removeEventListener=T.prototype.removeEventListener;T.prototype.g=function(a){a.target=this;return Ac(this.l,a)};T.prototype.dispatchEvent=function(a){return this.g(a)};T.prototype.dispatchEvent=T.prototype.dispatchEvent;T.prototype.Ng=function(a){this.Le=a};T.prototype.setTrustPlayerBufferingState=T.prototype.Ng;
var O=y("cast.receiver.MediaManager");
T.EventType={LOAD:"load",STOP:"stop",PAUSE:"pause",SKIP_AD:"skipad",PLAY:"play",PLAY_AGAIN:"playagain",SEEK:"seek",SET_PLAYBACK_RATE:"setplaybackrate",SET_VOLUME:"setvolume",GET_STATUS:"getstatus",EDIT_TRACKS_INFO:"edittracksinfo",EDIT_AUDIO_TRACKS:"editaudiotracks",QUEUE_LOAD:"queueload",QUEUE_INSERT:"queueinsert",QUEUE_UPDATE:"queueupdate",QUEUE_REMOVE:"queueremove",QUEUE_REORDER:"queuereorder",PRECACHE:"precache",PRELOAD:"preload",CANCEL_PRELOAD:"cancelpreload",QUEUE_GET_ITEM_RANGE:"getitemsrange",
QUEUE_GET_ITEMS:"getitemsinfo",QUEUE_GET_ITEM_IDS:"getqueueids",QUEUE_SHUFFLE:"shuffle"};var U=function(a,b,c){A.call(this,a);this.data=b;this.senderId=c};k(U,A);T.Event=U;var V=function(a){this.type=a;this.requestId=0;this.customData=this.mediaSessionId=void 0};T.RequestData=V;var Zg=function(){V.call(this,"LOAD");this.media=new Fd;this.autoplay=!1;this.credentialsType=this.credentials=this.queueData=this.activeTrackIds=this.playbackRate=this.currentTime=void 0};k(Zg,V);T.LoadRequestData=Zg;
var Qg=function(a){Zg.call(this);this.type="PRELOAD";this.itemId=a};k(Qg,Zg);T.PreloadRequestData=Qg;var ah=function(a){Zg.call(this);this.type="PRECACHE";this.precacheData=a};k(ah,Zg);T.PrecacheRequestData=ah;var bh=function(){V.call(this,"SET_VOLUME");this.volume=new Rd};k(bh,V);T.VolumeRequestData=bh;var ch=function(){V.call(this,"EDIT_TRACKS_INFO");this.enableTextTracks=this.isSuggestedLanguage=this.textTrackStyle=this.language=this.activeTrackIds=void 0};k(ch,V);T.EditTracksInfoData=ch;
var dh=function(){V.call(this,"EDIT_AUDIO_TRACKS");this.isSuggestedLanguage=this.language=void 0};k(dh,V);T.EditAudioTracksData=dh;var eh=function(){V.call(this,"SEEK");this.resumeState=void 0;this.currentTime=0;this.relativeTime=void 0};k(eh,V);T.SeekRequestData=eh;var fh=function(){V.call(this,"SET_PLAYBACK_RATE");this.relativePlaybackRate=this.playbackRate=void 0};k(fh,V);T.SetPlaybackRateRequestData=fh;var gh=function(){V.call(this,"GET_STATUS");this.options=void 0};k(gh,V);
T.GetStatusRequestData=gh;var hh=function(a){V.call(this,"QUEUE_LOAD");this.repeatMode=void 0;this.items=a;this.currentTime=this.startIndex=void 0};k(hh,V);T.QueueLoadRequestData=hh;var Ag=function(a){V.call(this,"QUEUE_INSERT");this.currentTime=this.currentItemId=this.currentItemIndex=this.insertBefore=void 0;this.items=a};k(Ag,V);T.QueueInsertRequestData=Ag;var Kg=function(){V.call(this,"QUEUE_UPDATE");this.shuffle=this.repeatMode=this.items=this.jump=this.currentTime=this.currentItemId=void 0};
k(Kg,V);T.QueueUpdateRequestData=Kg;var Cg=function(a){V.call(this,"QUEUE_REMOVE");this.currentTime=this.currentItemId=void 0;this.itemIds=a};k(Cg,V);T.QueueRemoveRequestData=Cg;var ih=function(a){V.call(this,"QUEUE_REORDER");this.insertBefore=this.currentTime=this.currentItemId=void 0;this.itemIds=a};k(ih,V);T.QueueReorderRequestData=ih;T.LoadInfo=function(a,b){this.message=a;this.senderId=b};
var jh=function(a,b,c){V.call(this,"QUEUE_GET_ITEM_RANGE");this.itemId=a;this.nextCount=b;this.prevCount=c};k(jh,V);T.FetchItemsRequestData=jh;var kh=function(a){V.call(this,"QUEUE_GET_ITEMS");this.itemIds=a};k(kh,V);T.GetItemsInfoRequestData=kh;var lh=function(a){this.element=a};lh.prototype.K=function(a){this.element.setAttribute("aria-disabled",String(a))};var mh=function(a,b,c){c=void 0===c?null:c;var d=document.createElement("img");d.className="btn";c&&d.classList.add(c);d.src="";d.alt=b;d.setAttribute("role","button");d.addEventListener("click",a);return d};var nh=function(a){this.N=a},ph=function(a,b){var c=new eh;c.relativeTime=b;oh(a.N,c)};var qh={QUEUE_NEXT:"queue-next",QUEUE_PREV:"queue-prev",SEEK_FORWARD_10:"seek-forward-10",SEEK_FORWARD_15:"seek-forward-15",SEEK_FORWARD_30:"seek-forward-30",SEEK_BACKWARD_10:"seek-backward-10",SEEK_BACKWARD_15:"seek-backward-15",SEEK_BACKWARD_30:"seek-backward-30",CAPTIONS:"captions",REPEAT:"repeat",SHUFFLE:"shuffle",LIKE:"like",DISLIKE:"dislike",NO_BUTTON:"no-button"};t("cast.receiver.ui.ControlsButton",qh);var sh=function(){var a=this;this.eb=this.C=null;this.je=this.onMediaStatus=q;var b=K.H();Qe(b).then(function(){rh(a,b)})},oh=function(a,b){if(!a.C)throw Error("Media channel is not set");if(!a.hd)throw Error("Invalid Media Session Id");b.mediaSessionId=a.hd;ae(a.C,"urn:x-cast:com.google.cast.media","__touch_controls__",a.C.serializeMessage(b))},th=function(a,b){if(!a.eb)throw Error("Command and control channel is not set");ae(a.eb,"urn:x-cast:com.google.cast.cac","__touch_controls__",a.eb.serializeMessage(b))},
rh=function(a,b){a.C=b.u["urn:x-cast:com.google.cast.media"]||null;if(!a.C)throw Error("CastMessageBus with type cast.receiver.media.MEDIA_NAMESPACE is not set up.");de(a.C,function(b,d,e){if(e&&"MEDIA_STATUS"===e.type){if(d=e.status[0])a.hd!=d.mediaSessionId&&a.je(),a.hd=d.mediaSessionId;a.onMediaStatus(d)}return"__touch_controls__"===b});a.eb=b.u["urn:x-cast:com.google.cast.cac"]||null;a.eb&&de(a.eb,function(a){return"__touch_controls__"===a})};var W={SLOT_1:"slot-1",SLOT_2:"slot-2",SLOT_3:"slot-3",SLOT_4:"slot-4"};t("cast.receiver.ui.ControlsSlot",W);var uh={},vh=(uh.REPEAT_OFF={state:"off",Nc:"Repeat. State: Off."},uh.REPEAT_ALL={state:"all",Nc:"Repeat. State: All."},uh.REPEAT_SINGLE={state:"single",Nc:"Repeat. State: One."},uh),xh=function(a){var b=mh(function(){c.bd()},"","btn-repeat");this.element=b;var c=this;this.pe=b;this.Ag=a;this.Tg=!0;this.D="REPEAT_OFF";wh(this,this.D)};k(xh,lh);xh.prototype.Xb=function(a){this.D=a;"REPEAT_ALL_AND_SHUFFLE"===this.D?wh(this,"REPEAT_ALL"):wh(this,this.D)};
xh.prototype.bd=function(){a:{switch(this.D){case "REPEAT_OFF":var a="REPEAT_ALL";break a;case "REPEAT_ALL":case "REPEAT_ALL_AND_SHUFFLE":a=this.Tg?"REPEAT_SINGLE":"REPEAT_OFF";break a}a="REPEAT_OFF"}this.Ag(a);this.Xb(a)};var wh=function(a,b){a.pe.dataset.state=vh[b].state;a.pe.alt=vh[b].Nc};var yh=function(a,b,c){this.element=mh(a,b,c)};k(yh,lh);var zh=function(a,b,c){this.element=mh(function(){d.bd()},b,c);var d=this;this.qc=!1;this.$e=a;this.element.setAttribute("aria-pressed",String(this.qc))};k(zh,lh);zh.prototype.bd=function(){this.$e(!this.qc)};var Ah=function(a,b){b!=a.qc&&(a.qc=b,a.element.setAttribute("aria-pressed",String(b)))};var Bh={AUDIO:"audio",VIDEO:"video",PHOTO:"photo"};var Ch={Te:function(a){a.innerHTML='<div class=scrim></div><div class=buffering-scrim></div><div class=controls-layer><div class=video-metadata><div alt=logo class=logo id=logo src=""></div><div class=subtitle-container><h2 class=subtitle id=subtitle></h2></div><h1 class=title id=title></h1></div><div class=controls id=controls><div class=timeline><div class=live-indicator id=live-indicator><div class=live-label id=live-label></div></div><div class=scrubber-layer id=scrubber-layer><div class=progress-bar><div class=progress-fill id=progress-fill></div><div class="progress-loading loading-bar" id=progress-loading><div class="rect rect-primary"><span class=rect-inner></span></div><div class="rect rect-auxiliary"><span class=rect-inner></span></div></div></div><input class=scrubber id=scrubber max=300 min=0 step=any type=range></div><div class=time-numbers><div class="time-indicator left" id=current-time>0:00</div><div class="time-indicator right" id=total-time>0:00</div></div></div><div class=buttons id=buttons><div class="slot slot-1"></div><div class="slot slot-2"></div><div class="slot center"><img alt="" class=btn-play id=play role=button src=""><img alt="" class=btn-pause id=pause role=button src=""></div><div class="slot slot-3"></div><div class="slot slot-4"></div></div></div></div>'}};var Dh=function(a,b){var c=this;this.onPause=this.onPlay=q;this.zc=a;this.qb=b;this.na=!1;this.Ld=!0;this.zc.addEventListener("click",function(){c.onPlay()});this.qb.addEventListener("click",function(){c.onPause()});this.zc.alt="Play";this.qb.alt="Pause";this.Fc()};Dh.prototype.Bd=function(){this.zc.classList.add("hidden");this.Ld&&this.qb.classList.remove("hidden");this.na=!0};Dh.prototype.Fc=function(){this.zc.classList.remove("hidden");this.qb.classList.add("hidden");this.na=!1};
Dh.prototype.xd=function(a){(this.Ld=a)?this.na&&this.qb.classList.remove("hidden"):this.qb.classList.add("hidden")};var Eh=function(a,b,c){z.call(this);this.ig=null!=c?r(a,c):a;this.dg=b;this.Ye=r(this.sg,this);this.Oc=[]};za(Eh,z);g=Eh.prototype;g.yb=!1;g.Tb=0;g.$a=null;g.Mf=function(a){this.Oc=arguments;this.$a||this.Tb?this.yb=!0:Fh(this)};g.stop=function(){this.$a&&(m.clearTimeout(this.$a),this.$a=null,this.yb=!1,this.Oc=[])};g.pause=function(){this.Tb++};g.resume=function(){this.Tb--;this.Tb||!this.yb||this.$a||(this.yb=!1,Fh(this))};g.O=function(){Eh.Ya.O.call(this);this.stop()};
g.sg=function(){this.$a=null;this.yb&&!this.Tb&&(this.yb=!1,Fh(this))};var Fh=function(a){a.$a=md(a.Ye,a.dg);a.ig.apply(null,a.Oc)};var Ih=function(a,b,c,d){var e=this;this.jg=a;this.Cg=b;this.J=b.querySelector("#scrubber");this.le=b.querySelector("#progress-fill");this.kd=b.querySelector("#progress-loading");this.jc=c;this.Kc=d;this.xe=parseFloat(this.J.min);this.we=parseFloat(this.J.max);this.Od=0;this.Xd=this.Zd=this.tc=!1;this.onSeek=q;this.Ug=new Eh(function(a){e.jc.textContent=Gh(parseInt(a,10))},100);this.J.addEventListener("input",function(){e.tc=!0;var a=e.J.value;Hh(e,a);e.Ug.Mf(a)});this.J.addEventListener("change",
function(){e.tc=!1;e.onSeek(parseFloat(e.J.value))})},Hh=function(a,b){var c=a.we-a.xe;b-=a.xe;c=c?b/c:0;b=(.5-c)/200;0<c&&(c+=b);a.le.style.transform="scaleX("+c+")";a.kd.style.transform="scaleX("+(1-c)+")"};g=Ih.prototype;g.Ad=function(a){this.jg.classList.toggle("invisible",!a);this.jc.classList.toggle("invisible",a);this.Kc.classList.toggle("invisible",a)};g.Cd=function(a){this.le.classList.toggle("break",a);this.Xd=a;Jh(this)};
g.Xa=function(a){this.Cg.classList.toggle("hidden",!a);this.jc.classList.toggle("hidden",!a);this.Kc.classList.toggle("hidden",!a)};g.Va=function(a){this.tc||(this.J.value=a,this.jc.textContent=Gh(a),Hh(this,this.J.value))};g.Wa=function(a){a!==this.Od&&(this.Od=a,0>a?(this.J.max=0,this.Kc.textContent=""):(this.J.max=a,this.Kc.textContent=Gh(a)),Jh(this,0>=a),this.we=parseFloat(this.J.max))};g.yd=function(a){a||(this.tc=!1);this.Zd=a;Jh(this)};
var Jh=function(a,b){a.J.disabled=(void 0===b?!1:b)||!a.Zd||a.Xd};function Gh(a){if(isNaN(a)||!isFinite(a))return"";a=Math.floor(a);var b=Math.floor(a/3600),c=Math.floor(a/60)%60;a%=60;return b?Ta(b,1)+":"+Ta(c,2)+":"+Ta(a,2):Ta(c,1)+":"+Ta(a,2)};var Nh=function(a){var b=this;this.F=a;this.J=a.querySelector("#scrubber");this.bf=a.querySelector("#controls");this.Rb=a.querySelector("#logo");this.Vg=a.querySelector("#title");this.Sg=a.querySelector("#subtitle");this.fd=this.ea=!1;this.bf.addEventListener("touchstart",function(a){b.F.classList.contains("active")&&(a.stopPropagation(),Kh(b))});this.F.addEventListener("touchstart",function(a){a.target!==b.J&&(b.F.classList.contains("active")?(Lh(b,!1),clearTimeout(b.Id),b.F.classList.remove("active"),
b.F.classList.remove("scrubbing-ending")):(Mh(b),Kh(b),a.preventDefault()))});this.J.addEventListener("input",function(){Lh(b,!0)});this.J.addEventListener("change",function(){Lh(b,!1);Kh(b)})},Oh=function(a,b){if(!a.F.classList.contains(b)){for(var c in Bh)Bh.hasOwnProperty(c)&&a.F.classList.remove(Bh[c]);a.F.classList.add(b)}};g=Nh.prototype;g.K=function(a){this.F.classList.toggle("disabled",a)};g.Bd=function(){this.ea=!1;Kh(this)};g.Fc=function(){this.ea||Mh(this);this.ea=!0};
g.Aa=function(a){this.Vg.innerText=a||""};g.xb=function(a){this.Sg.innerText=a||""};
var Ph=function(a,b,c){if("none"===window.getComputedStyle(a.Rb,null).backgroundImage)if(c){var d=new Image;d.src=c;d.decode().then(function(){a.Rb.style.backgroundImage="url('"+c+"')";a.Rb.classList.add("app-icon")},function(){a.Rb.textContent=b})}else a.Rb.textContent=b},Mh=function(a){clearTimeout(a.Id);a.F.classList.add("active")},Kh=function(a){clearTimeout(a.Id);a.Id=setTimeout(function(){a.fd||a.ea||(a.F.classList.remove("active"),a.F.classList.remove("scrubbing-ending"))},8E3)},Lh=function(a,
b){a.fd!==b&&(a.fd=b,clearTimeout(a.Dg),a.F.classList.toggle("scrubbing",b),b||(a.F.classList.add("scrubbing-ending"),a.Dg=setTimeout(function(){a.F.classList.remove("scrubbing-ending")},4E3)))};var Qh=function(){var a=HTMLDivElement.call(this)||this;a.ab=null;a.Kd=null;a.rb=null;a.ja=null;a.P=null;a.Gc={};a.onPause=q;a.onPlay=q;a.onSeek=q;return a};k(Qh,HTMLDivElement);g=Qh.prototype;
g.createdCallback=function(){var a=this;this.Gc={};this.onSeek=this.onPlay=this.onPause=q;var b=this.createShadowRoot(),c=document.createElement("style");c.innerHTML='.loading-bar{height:100%;overflow:hidden;position:relative;transform:translateZ(0);transition:opacity 250ms linear;width:100%}.loading-bar .rect,.loading-bar .rect-inner{height:100%;position:absolute;width:100%;animation:none}.loading-bar .rect{transform-origin:top left}.loading-bar .rect-primary{transform:scaleX(0)}.loading-bar .rect-auxiliary{visibility:hidden}.loading-bar .rect-inner{background-color:#9aa0a6;display:inline-block}.loading-bar .rect-primary{animation:primary-indeterminate-translate 2s infinite linear}.loading-bar .rect-primary>.rect-inner{animation:primary-indeterminate-scale 2s infinite linear}.loading-bar .rect-auxiliary{animation:auxiliary-indeterminate-translate 2s infinite linear;visibility:visible}.loading-bar .rect-auxiliary>.rect-inner{animation:auxiliary-indeterminate-scale 2s infinite linear}@keyframes primary-indeterminate-translate{0%{transform:translateX(-145.166611%)}20%{animation-timing-function:cubic-bezier(.5, 0, .701732, .495819);transform:translateX(-145.166611%)}59.15%{animation-timing-function:cubic-bezier(.302435, .381352, .55, .956352);transform:translateX(-61.495191%)}100%{transform:translateX(55.444446%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(.08)}36.65%{animation-timing-function:cubic-bezier(.334731, .12482, .785844, 1);transform:scaleX(.08)}69.15%{animation-timing-function:cubic-bezier(.06, .11, .6, 1);transform:scaleX(.661479)}100%{transform:scaleX(.08)}}@keyframes auxiliary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(.15, 0, .515058, .409685);transform:translateX(-54.888891%)}25%{animation-timing-function:cubic-bezier(.31033, .284058, .8, .733712);transform:translateX(-17.236978%)}48.35%{animation-timing-function:cubic-bezier(.4, .627035, .6, .902026);transform:translateX(29.497274%)}100%{transform:translateX(105.388891%)}}@keyframes auxiliary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(.205028, .057051, .57661, .453971);transform:scaleX(.08)}19.15%{animation-timing-function:cubic-bezier(.152313, .196432, .648374, 1.004315);transform:scaleX(.457104)}44.15%{animation-timing-function:cubic-bezier(.257759, .003163, .211762, 1.38179);transform:scaleX(.72796)}100%{transform:scaleX(.08)}}:host{bottom:0;color:#fff;font-family:\'Google Sans\',\'Roboto\',Arial,sans-serif;left:0;position:fixed;right:0;top:0;z-index:1000000}.controls-layer{display:flex;flex-direction:column;justify-content:flex-start;height:100%}.controls{box-sizing:border-box;flex:none;display:flex;flex-direction:column;justify-content:flex-end;height:192px;padding:0 56px 22px}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){.controls{height:240px;padding:0 112px 38px}}.scrim,.buffering-scrim{bottom:0;height:100vh;left:0;position:absolute;width:100vw;z-index:-1}.buffering-scrim{background-color:rgba(0,0,0,0.6);visibility:hidden}.video-metadata{display:none}.hidden{display:none !important}.invisible{visibility:hidden}.touch-layer{height:100%;touch-action:manipulation;user-select:none;width:100%}.touch-layer.video .scrim{background:linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.5) 42.5%, rgba(0,0,0,0.92))}.touch-layer.video .video-metadata{align-items:flex-start;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;text-align:left;padding:44px 56px 0}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){.touch-layer.video .video-metadata{padding:112px 112px 0}}.touch-layer.video .logo{background-image:var(--playback-logo-image);background-position-x:left;background-repeat:no-repeat;background-size:contain;color:rgba(255,255,255,0.7);font-family:\'Roboto\',Arial,sans-serif;font-size:36px;font-weight:500;height:40px;line-height:40px;width:100%}.touch-layer.video .logo.app-icon{height:68px}.touch-layer.video .title{-webkit-line-clamp:2;-webkit-box-orient:vertical;-webkit-box-pack:end;display:-webkit-box;font-weight:normal;overflow:hidden;width:auto;margin-top:0;margin-bottom:0;font-size:56px;line-height:76px}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){.touch-layer.video .title{margin-bottom:4px;font-size:68px;line-height:80px}}.touch-layer.video.active .title,.touch-layer.video.buffering .title{width:100%}.touch-layer.video .subtitle{font-weight:normal;margin:0;opacity:.7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:1.6;line-height:30px;font-size:28px}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){.touch-layer.video .subtitle{letter-spacing:1.4;line-height:40px;font-size:32px}}.touch-layer.video .subtitle-container{margin-top:auto;margin-bottom:16px;max-width:100%}.touch-layer.video .scrim{opacity:0;transition:visibility 0s 150ms,opacity 150ms cubic-bezier(0, 0, 1, 1);visibility:hidden}.touch-layer.video .logo{opacity:0;transform:translateY(32px);transition:transform 350ms cubic-bezier(.2, 0, 0, 1),visibility 0s 150ms,opacity 150ms cubic-bezier(0, 0, 1, 1);visibility:hidden}.touch-layer.video .subtitle-container,.touch-layer.video .title{opacity:0;transform:translateY(44px);transition:transform 350ms cubic-bezier(.2, 0, 0, 1),visibility 0s 150ms,opacity 150ms cubic-bezier(0, 0, 1, 1);visibility:hidden}.touch-layer.video .controls{transform:translateY(56px);transition:transform 350ms cubic-bezier(.2, 0, 0, 1)}.touch-layer.video .live-indicator,.touch-layer.video .scrubber-layer,.touch-layer.video .time-numbers,.touch-layer.video .slot{opacity:0;transition:visibility 0s 150ms,opacity 150ms cubic-bezier(0, 0, 1, 1);visibility:hidden}.touch-layer.video.active .scrim{opacity:1;transition:opacity 200ms cubic-bezier(0, 0, 1, 1);visibility:visible}.touch-layer.video.active .logo,.touch-layer.video.active .subtitle-container,.touch-layer.video.active .title{opacity:1;transform:translateY(0);transition:transform 400ms cubic-bezier(.2, 0, 0, 1),opacity 150ms cubic-bezier(0, 0, 1, 1);visibility:visible}.touch-layer.video.active .controls{transform:translateY(0);transition:transform 400ms cubic-bezier(.2, 0, 0, 1)}.touch-layer.video.active .live-indicator,.touch-layer.video.active .scrubber-layer,.touch-layer.video.active .time-numbers,.touch-layer.video.active .slot{opacity:1;transition:opacity 200ms cubic-bezier(0, 0, 1, 1);visibility:visible}.touch-layer.video.active .slot-2,.touch-layer.video.active .slot-3{transition-delay:50ms}.touch-layer.video.active .slot-1,.touch-layer.video.active .slot-4{transition-delay:100ms}.touch-layer.video.buffering .buffering-scrim{visibility:visible}.touch-layer.video.buffering .scrim,.touch-layer.video.buffering .logo,.touch-layer.video.buffering .subtitle-container,.touch-layer.video.buffering .title,.touch-layer.video.buffering .controls,.touch-layer.video.buffering .live-indicator,.touch-layer.video.buffering .scrubber-layer,.touch-layer.video.buffering .time-numbers,.touch-layer.video.buffering .slot{opacity:1;visibility:visible;transition:none;transform:none}.touch-layer.audio .controls{margin-top:auto}.touch-layer.audio .btn-play,.touch-layer.audio .btn-pause{width:124px;height:124px}.touch-layer.audio .scrim{background:linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.92));height:192px}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){.touch-layer.audio .scrim{height:240px}}.touch-layer.audio .time-numbers,.touch-layer.audio .slot{opacity:0;transition:visibility 0s 100ms,opacity 100ms cubic-bezier(0, 0, 1, 1);visibility:hidden}.touch-layer.audio .scrubber::-webkit-slider-thumb{transform:scaleY(.2);transition:transform 350ms cubic-bezier(.2, 0, 0, 1),visibility 0s 350ms;visibility:hidden}.touch-layer.audio .controls{transform:translateY(56px);transition:transform 350ms cubic-bezier(.2, 0, 0, 1)}.touch-layer.audio.active .time-numbers,.touch-layer.audio.active .slot{opacity:1;transition:opacity 200ms cubic-bezier(0, 0, 1, 1);visibility:visible}.touch-layer.audio.active .slot-2,.touch-layer.audio.active .slot-3{transition-delay:50ms}.touch-layer.audio.active .slot-1,.touch-layer.audio.active .slot-4{transition-delay:100ms}.touch-layer.audio.active .scrubber::-webkit-slider-thumb{transform:scaleY(1);transition:transform 400ms cubic-bezier(.2, 0, 0, 1);visibility:visible}.touch-layer.audio.active .controls{transform:translateY(0);transition:transform 400ms cubic-bezier(.2, 0, 0, 1)}.touch-layer.audio.scrubbing .scrubber::-webkit-slider-thumb{transform:scaleY(1);transition:transform 400ms cubic-bezier(.2, 0, 0, 1);visibility:visible}.touch-layer.audio.scrubbing .time-numbers{opacity:1;transition:opacity 200ms cubic-bezier(0, 0, 1, 1);visibility:visible}.touch-layer.audio.scrubbing-ending .time-numbers{opacity:1;transition:opacity 200ms cubic-bezier(0, 0, 1, 1);visibility:visible}.touch-layer.audio.hidden-audio-scrim .scrim{display:none}.touch-layer.photo .scrim,.touch-layer.disabled .scrim,.touch-layer.photo .video-metadata,.touch-layer.disabled .video-metadata,.touch-layer.photo .controls,.touch-layer.disabled .controls{display:none}.buttons{align-items:center;display:flex;flex:none;height:112px;justify-content:center}.buttons.break .slot:not(.center) .btn{display:none}.btn[aria-disabled=true]{pointer-events:none;opacity:.5}.slot{align-items:center;display:flex;height:56px;justify-content:center;margin:0 28px;width:56px}.slot.center{height:112px;width:112px}.slot.slot-1{margin-left:0;margin-right:auto}.slot.slot-4{margin-left:auto;margin-right:0}.btn{height:56px;width:56px}.btn-pause{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%20d=%27M30.5%2C9.5v29%27%20fill=%27none%27%20stroke=%27%23fff%27%20stroke-linecap=%27round%27%0A%20%20%20%20%20%20stroke-linejoin=%27round%27%20vector-effect=%27non-scaling-stroke%27%0A%20%20%20%20%20%20stroke-width=%274%27/%3E%0A%20%20%3Cpath%20d=%27M17.5%2C9.5v29%27%20fill=%27none%27%20stroke=%27%23fff%27%20stroke-linecap=%27round%27%0A%20%20%20%20%20%20stroke-linejoin=%27round%27%20vector-effect=%27non-scaling-stroke%27%0A%20%20%20%20%20%20stroke-width=%274%27/%3E%0A%3C/svg%3E%0A");height:112px;width:112px}.btn-play{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpolygon%20points=%2738.5%2024%2015.5%2038.5%2015.5%209.5%2038.5%2024%27%20fill=%27none%27%0A%20%20%20%20%20%20stroke=%27%23fff%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%0A%20%20%20%20%20%20stroke-width=%274%27%20vector-effect=%27non-scaling-stroke%27/%3E%0A%3C/svg%3E%0A");height:112px;width:112px}.btn-next{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%20d=%27M37%2C9.5a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v29a1.5%2C1.5%2C0%2C0%2C1-3%2C0Z%27%20fill=%27%23fff%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M11%2C12.22V35.78L29.69%2C24ZM33.3%2C25.27l-23%2C14.5A1.5%2C1.5%2C0%2C0%2C1%2C8%2C38.5V9.5a1.5%2C1.5%2C0%2C0%2C1%2C2.3-1.27l23%2C14.5a1.5%2C1.5%2C0%2C0%2C1%2C0%2C2.54Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%3C/svg%3E%0A")}.btn-back{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%20d=%27M8%2C9.5a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v29a1.5%2C1.5%2C0%2C0%2C1-3%2C0Z%27%20fill=%27%23fff%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M14.7%2C25.27a1.5%2C1.5%2C0%2C0%2C1%2C0-2.54l23-14.5A1.5%2C1.5%2C0%2C0%2C1%2C40%2C9.5v29a1.5%2C1.5%2C0%2C0%2C1-2.3%2C1.27ZM37%2C35.78V12.22L18.31%2C24Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%3C/svg%3E%0A")}.btn-seek-forward-10{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M41%2024a1.5%201.5%200%200%201%203%200c0%2011.046-8.954%2020-20%2020S4%2035.046%204%2024%2012.954%204%2024%204h3.5a1.5%201.5%200%200%201%200%203H24C14.611%207%207%2014.611%207%2024s7.611%2017%2017%2017%2017-7.611%2017-17z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M24.44%202.56A1.5%201.5%200%200%201%2026.56.44l4%204a1.5%201.5%200%200%201%200%202.12l-4%204a1.5%201.5%200%200%201-2.12-2.12l2.939-2.94-2.94-2.94zM17.82%2030v-8.67l-2%20.82-.89-2.15%203.42-1.6h2V30zM27.65%2030.27A4.48%204.48%200%200%201%2024%2028.54a5.91%205.91%200%200%201-1-1.93%208.59%208.59%200%200%201%200-4.84%205.92%205.92%200%200%201%201-1.93%204.64%204.64%200%200%201%207.28%200%205.93%205.93%200%200%201%201%201.93%208.59%208.59%200%200%201%200%204.84%205.92%205.92%200%200%201-1%201.93%204.51%204.51%200%200%201-3.64%201.73h.01zm0-2.38a1.91%201.91%200%200%200%201-.28%202.44%202.44%200%200%200%20.76-.77%203.78%203.78%200%200%200%20.48-1.17%206.83%206.83%200%200%200%200-3%203.78%203.78%200%200%200-.48-1.17%202.44%202.44%200%200%200-.76-.77%202%202%200%200%200-2.06%200%202.44%202.44%200%200%200-.76.77%203.78%203.78%200%200%200-.48%201.17%206.87%206.87%200%200%200%200%203c.093.414.255.81.48%201.17.193.31.452.573.76.77a1.91%201.91%200%200%200%201.06.28z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-seek-forward-15{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M41%2024a1.5%201.5%200%200%201%203%200c0%2011.046-8.954%2020-20%2020S4%2035.046%204%2024%2012.954%204%2024%204h3.5a1.5%201.5%200%200%201%200%203H24C14.611%207%207%2014.611%207%2024s7.611%2017%2017%2017%2017-7.611%2017-17z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M24.44%202.56A1.5%201.5%200%200%201%2026.56.44l4%204a1.5%201.5%200%200%201%200%202.12l-4%204a1.5%201.5%200%200%201-2.12-2.12l2.939-2.94-2.94-2.94zM18.51%2030v-8.67l-2%20.82-.89-2.15L19%2018.37h2V30zM27.69%2030.27a5.17%205.17%200%200%201-1.38-.19%204%204%200%200%201-2.25-1.58%203.9%203.9%200%200%201-.61-1.39l2.33-.9c.083.474.31.91.65%201.25a1.75%201.75%200%200%200%201.26.45%201.57%201.57%200%200%200%201.16-.48%201.74%201.74%200%200%200%200-2.38%201.59%201.59%200%200%200-1.18-.48%201.81%201.81%200%200%200-.85.19%202.12%202.12%200%200%200-.61.48l-2.45-1.12.63-5.76h6.78v2.18h-4.65L26.08%2023l.17.05a3.94%203.94%200%200%201%20.81-.48%202.84%202.84%200%200%201%201.18-.22%203.44%203.44%200%200%201%201.37.28c.435.184.83.453%201.16.79.347.358.622.779.81%201.24a4.19%204.19%200%200%201%20.31%201.63%204.25%204.25%200%200%201-.31%201.64%203.6%203.6%200%200%201-.87%201.27%203.94%203.94%200%200%201-1.33.82%204.72%204.72%200%200%201-1.69.25z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-seek-forward-30{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M41%2024a1.5%201.5%200%200%201%203%200c0%2011.046-8.954%2020-20%2020S4%2035.046%204%2024%2012.954%204%2024%204h3.5a1.5%201.5%200%200%201%200%203H24C14.611%207%207%2014.611%207%2024s7.611%2017%2017%2017%2017-7.611%2017-17z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M24.44%202.56A1.5%201.5%200%200%201%2026.56.44l4%204a1.5%201.5%200%200%201%200%202.12l-4%204a1.5%201.5%200%200%201-2.12-2.12l2.939-2.94-2.94-2.94zM18.31%2030.27a4.67%204.67%200%200%201-2.76-.8A4.15%204.15%200%200%201%2014%2027.14l2.43-1c.1.96.936%201.673%201.9%201.62a1.7%201.7%200%200%200%201.07-.36%201.15%201.15%200%200%200%20.46-1c0-.92-.667-1.38-2-1.38h-1v-2.23h.94c.199%200%20.397-.024.59-.07.184-.04.36-.112.52-.21a1.07%201.07%200%200%200%20.37-.38%201.19%201.19%200%200%200%20.14-.59c0-.294-.12-.575-.33-.78a1.23%201.23%200%200%200-.93-.34%201.45%201.45%200%200%200-1%20.36%201.79%201.79%200%200%200-.52.85l-2.33-1a4.21%204.21%200%200%201%20.48-.92c.22-.315.49-.592.8-.82a4.17%204.17%200%200%201%201.14-.59%204.47%204.47%200%200%201%201.49-.23%204.9%204.9%200%200%201%201.57.24A3.74%203.74%200%200%201%2021%2019c.324.273.583.615.76%201%20.164.364.246.76.24%201.16a3.25%203.25%200%200%201-.46%201.7%202.54%202.54%200%200%201-.46.56%202.11%202.11%200%200%201-.51.35v.17a3%203%200%200%201%201.34%201%203%203%200%200%201%20.53%201.82%203.32%203.32%200%200%201-.29%201.39%203.21%203.21%200%200%201-.82%201.1A3.85%203.85%200%200%201%2020%2030a5.31%205.31%200%200%201-1.69.27zM29%2030.27a4.49%204.49%200%200%201-3.64-1.73%205.9%205.9%200%200%201-1-1.93%208.59%208.59%200%200%201%200-4.84%205.91%205.91%200%200%201%201-1.93%204.64%204.64%200%200%201%207.28%200%205.91%205.91%200%200%201%201%201.93%208.57%208.57%200%200%201%200%204.84%205.9%205.9%200%200%201-1%201.93A4.51%204.51%200%200%201%2029%2030.27zm0-2.38a1.91%201.91%200%200%200%201-.28%202.44%202.44%200%200%200%20.77-.77%203.8%203.8%200%200%200%20.47-1.17%206.83%206.83%200%200%200%200-3%203.81%203.81%200%200%200-.47-1.17%202.44%202.44%200%200%200-.77-.77%202%202%200%200%200-2.06%200%202.44%202.44%200%200%200-.77.77%203.81%203.81%200%200%200-.47%201.17%206.83%206.83%200%200%200%200%203c.09.413.25.809.47%201.17.195.311.459.575.77.77a1.9%201.9%200%200%200%201.06.28z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-seek-backward-10{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M4%2024a1.5%201.5%200%200%201%203%200c0%209.389%207.611%2017%2017%2017s17-7.611%2017-17S33.389%207%2024%207h-3.5a1.5%201.5%200%200%201%200-3H24c11.046%200%2020%208.954%2020%2020s-8.954%2020-20%2020S4%2035.046%204%2024z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M20.621%205.5l2.94%202.94a1.5%201.5%200%200%201-2.122%202.12l-4-4a1.5%201.5%200%200%201%200-2.12l4-4a1.5%201.5%200%200%201%202.122%202.12L20.62%205.5zM17.82%2030v-8.67l-2%20.82-.89-2.15%203.42-1.6h2V30zm9.83.27A4.48%204.48%200%200%201%2024%2028.54a5.91%205.91%200%200%201-1-1.93%208.59%208.59%200%200%201%200-4.84%205.92%205.92%200%200%201%201-1.93%204.64%204.64%200%200%201%207.28%200%205.93%205.93%200%200%201%201%201.93%208.59%208.59%200%200%201%200%204.84%205.92%205.92%200%200%201-1%201.93%204.51%204.51%200%200%201-3.64%201.73h.01zm0-2.38a1.91%201.91%200%200%200%201-.28%202.44%202.44%200%200%200%20.76-.77%203.78%203.78%200%200%200%20.48-1.17%206.83%206.83%200%200%200%200-3%203.78%203.78%200%200%200-.48-1.17%202.44%202.44%200%200%200-.76-.77%202%202%200%200%200-2.06%200%202.44%202.44%200%200%200-.76.77%203.78%203.78%200%200%200-.48%201.17%206.87%206.87%200%200%200%200%203c.093.414.255.81.48%201.17.193.31.452.573.76.77a1.91%201.91%200%200%200%201.06.28z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-seek-backward-15{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M4%2024a1.5%201.5%200%200%201%203%200c0%209.389%207.611%2017%2017%2017s17-7.611%2017-17S33.389%207%2024%207h-3.5a1.5%201.5%200%200%201%200-3H24c11.046%200%2020%208.954%2020%2020s-8.954%2020-20%2020S4%2035.046%204%2024z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M20.621%205.5l2.94%202.94a1.5%201.5%200%200%201-2.122%202.12l-4-4a1.5%201.5%200%200%201%200-2.12l4-4a1.5%201.5%200%200%201%202.122%202.12L20.62%205.5zM18.51%2030v-8.67l-2%20.82-.89-2.15L19%2018.37h2V30zM27.69%2030.27a5.17%205.17%200%200%201-1.38-.19%204%204%200%200%201-2.25-1.58%203.9%203.9%200%200%201-.61-1.39l2.33-.9c.083.474.31.91.65%201.25a1.75%201.75%200%200%200%201.26.45%201.57%201.57%200%200%200%201.16-.48%201.74%201.74%200%200%200%200-2.38%201.59%201.59%200%200%200-1.18-.48%201.81%201.81%200%200%200-.85.19%202.12%202.12%200%200%200-.61.48l-2.45-1.12.63-5.76h6.78v2.18h-4.65L26.08%2023l.17.05a3.94%203.94%200%200%201%20.81-.48%202.84%202.84%200%200%201%201.18-.22%203.44%203.44%200%200%201%201.37.28c.435.184.83.453%201.16.79.347.358.622.779.81%201.24a4.19%204.19%200%200%201%20.31%201.63%204.25%204.25%200%200%201-.31%201.64%203.6%203.6%200%200%201-.87%201.27%203.94%203.94%200%200%201-1.33.82%204.72%204.72%200%200%201-1.69.25z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-seek-backward-30{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M4%2024a1.5%201.5%200%200%201%203%200c0%209.389%207.611%2017%2017%2017s17-7.611%2017-17S33.389%207%2024%207h-3.5a1.5%201.5%200%200%201%200-3H24c11.046%200%2020%208.954%2020%2020s-8.954%2020-20%2020S4%2035.046%204%2024z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M20.621%205.5l2.94%202.94a1.5%201.5%200%200%201-2.122%202.12l-4-4a1.5%201.5%200%200%201%200-2.12l4-4a1.5%201.5%200%200%201%202.122%202.12L20.62%205.5zM18.31%2030.27a4.67%204.67%200%200%201-2.76-.8A4.15%204.15%200%200%201%2014%2027.14l2.43-1c.1.96.936%201.673%201.9%201.62a1.7%201.7%200%200%200%201.07-.36%201.15%201.15%200%200%200%20.46-1c0-.92-.667-1.38-2-1.38h-1v-2.23h.94c.199%200%20.397-.024.59-.07.184-.04.36-.112.52-.21a1.07%201.07%200%200%200%20.37-.38%201.19%201.19%200%200%200%20.14-.59c0-.294-.12-.575-.33-.78a1.23%201.23%200%200%200-.93-.34%201.45%201.45%200%200%200-1%20.36%201.79%201.79%200%200%200-.52.85l-2.33-1a4.21%204.21%200%200%201%20.48-.92c.22-.315.49-.592.8-.82a4.17%204.17%200%200%201%201.14-.59%204.47%204.47%200%200%201%201.49-.23%204.9%204.9%200%200%201%201.57.24A3.74%203.74%200%200%201%2021%2019c.324.273.583.615.76%201%20.164.364.246.76.24%201.16a3.25%203.25%200%200%201-.46%201.7%202.54%202.54%200%200%201-.46.56%202.11%202.11%200%200%201-.51.35v.17a3%203%200%200%201%201.34%201%203%203%200%200%201%20.53%201.82%203.32%203.32%200%200%201-.29%201.39%203.21%203.21%200%200%201-.82%201.1A3.85%203.85%200%200%201%2020%2030a5.31%205.31%200%200%201-1.69.27zM29%2030.27a4.49%204.49%200%200%201-3.64-1.73%205.9%205.9%200%200%201-1-1.93%208.59%208.59%200%200%201%200-4.84%205.91%205.91%200%200%201%201-1.93%204.64%204.64%200%200%201%207.28%200%205.91%205.91%200%200%201%201%201.93%208.57%208.57%200%200%201%200%204.84%205.9%205.9%200%200%201-1%201.93A4.51%204.51%200%200%201%2029%2030.27zm0-2.38a1.91%201.91%200%200%200%201-.28%202.44%202.44%200%200%200%20.77-.77%203.8%203.8%200%200%200%20.47-1.17%206.83%206.83%200%200%200%200-3%203.81%203.81%200%200%200-.47-1.17%202.44%202.44%200%200%200-.77-.77%202%202%200%200%200-2.06%200%202.44%202.44%200%200%200-.77.77%203.81%203.81%200%200%200-.47%201.17%206.83%206.83%200%200%200%200%203c.09.413.25.809.47%201.17.195.311.459.575.77.77a1.9%201.9%200%200%200%201.06.28z%27%0A%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-repeat[data-state=\'off\']{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M39%2C32H33.5a1.5%2C1.5%2C0%2C0%2C1%2C0-3h9A1.5%2C1.5%2C0%2C0%2C1%2C44%2C30.5h0v9a1.5%2C1.5%2C0%2C0%2C1-3%2C0v-5A20%2C20%2C0%2C0%2C1%2C5.27%2C31a1.5%2C1.5%2C0%2C1%2C1%2C2.8-1A17%2C17%2C0%2C0%2C0%2C39%2C32ZM9%2C16h5.5a1.5%2C1.5%2C0%2C0%2C1%2C0%2C3h-9A1.5%2C1.5%2C0%2C0%2C1%2C4%2C17.5v-9a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v5A20%2C20%2C0%2C0%2C1%2C42.73%2C17a1.5%2C1.5%2C0%2C0%2C1-2.8%2C1A17%2C17%2C0%2C0%2C0%2C9%2C16Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%3C/svg%3E%0A")}.btn-repeat[data-state=\'all\']{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M39%2C32H33.5a1.5%2C1.5%2C0%2C0%2C1%2C0-3h9A1.5%2C1.5%2C0%2C0%2C1%2C44%2C30.5h0v9a1.5%2C1.5%2C0%2C0%2C1-3%2C0v-5A20%2C20%2C0%2C0%2C1%2C5.27%2C31a1.5%2C1.5%2C0%2C1%2C1%2C2.8-1A17%2C17%2C0%2C0%2C0%2C39%2C32ZM9%2C16h5.5a1.5%2C1.5%2C0%2C0%2C1%2C0%2C3h-9A1.5%2C1.5%2C0%2C0%2C1%2C4%2C17.5v-9a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v5A20%2C20%2C0%2C0%2C1%2C42.73%2C17a1.5%2C1.5%2C0%2C0%2C1-2.8%2C1A17%2C17%2C0%2C0%2C0%2C9%2C16Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%3C/svg%3E%0A")}.btn-repeat[data-state=\'single\']{content:url("data:image/svg+xml,%3Csvg%20viewBox=%270%200%2048%2048%27%20version=%271.1%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M39%2C32H33.5a1.5%2C1.5%2C0%2C0%2C1%2C0-3h9A1.5%2C1.5%2C0%2C0%2C1%2C44%2C30.5h0v9a1.5%2C1.5%2C0%2C0%2C1-3%2C0v-5A20%2C20%2C0%2C0%2C1%2C5.27%2C31a1.5%2C1.5%2C0%2C1%2C1%2C2.8-1A17%2C17%2C0%2C0%2C0%2C39%2C32ZM9%2C16h5.5a1.5%2C1.5%2C0%2C0%2C1%2C0%2C3h-9A1.5%2C1.5%2C0%2C0%2C1%2C4%2C17.5v-9a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v5A20%2C20%2C0%2C0%2C1%2C42.73%2C17a1.5%2C1.5%2C0%2C0%2C1-2.8%2C1A17%2C17%2C0%2C0%2C0%2C9%2C16Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%20%20%3Cpolygon%20fill=%27%234285F4%27%20fill-rule=%27nonzero%27%0A%20%20%20%20%20%20points=%2723.8%2029.92%2023.8%2021.25%2021.8%2022.07%2020.87%2019.89%2024.28%2018.29%2026.28%2018.29%2026.28%2029.92%27%3E%3C/polygon%3E%0A%3C/svg%3E%0A")}.btn-shuffle{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M37%2C11H29.5a1.5%2C1.5%2C0%2C0%2C1%2C0-3h9A1.5%2C1.5%2C0%2C0%2C1%2C40%2C9.5v9a1.5%2C1.5%2C0%2C0%2C1-3%2C0Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M8.44%2C10.56a1.5%2C1.5%2C0%2C0%2C1%2C2.12-2.12l27%2C27a1.5%2C1.5%2C0%2C0%2C1-2.12%2C2.12Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M35.44%2C10.44a1.5%2C1.5%2C0%2C0%2C1%2C2.12%2C2.12l-27%2C27a1.5%2C1.5%2C0%2C0%2C1-2.12-2.12Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M37%2C37V29.5a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v9A1.5%2C1.5%2C0%2C0%2C1%2C38.5%2C40h-9a1.5%2C1.5%2C0%2C0%2C1%2C0-3Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%3C/svg%3E%0A")}.btn-shuffle[aria-pressed=\'true\']{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M37%2C11H29.5a1.5%2C1.5%2C0%2C0%2C1%2C0-3h9A1.5%2C1.5%2C0%2C0%2C1%2C40%2C9.5v9a1.5%2C1.5%2C0%2C0%2C1-3%2C0Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M8.44%2C10.56a1.5%2C1.5%2C0%2C0%2C1%2C2.12-2.12l27%2C27a1.5%2C1.5%2C0%2C0%2C1-2.12%2C2.12Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M35.44%2C10.44a1.5%2C1.5%2C0%2C0%2C1%2C2.12%2C2.12l-27%2C27a1.5%2C1.5%2C0%2C0%2C1-2.12-2.12Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M37%2C37V29.5a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v9A1.5%2C1.5%2C0%2C0%2C1%2C38.5%2C40h-9a1.5%2C1.5%2C0%2C0%2C1%2C0-3Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%3C/svg%3E%0A")}.btn-captions{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%20%20%3Cpath%0A%20%20%20%20%20%20%20%20d=%27M7%2011v26h34V11H7zm-.75-3h35.5A2.25%202.25%200%200%201%2044%2010.25v27.5A2.25%202.25%200%200%201%2041.75%2040H6.25A2.25%202.25%200%200%201%204%2037.75v-27.5A2.25%202.25%200%200%201%206.25%208z%27%0A%20%20%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%20%20%3Cpath%0A%20%20%20%20%20%20%20%20d=%27M23.38%2028a6%206%200%200%201-4.88%202.24A6.35%206.35%200%200%201%2016%2018a6.47%206.47%200%200%201%202.53-.49%206.1%206.1%200%200%201%202.59.51%206.42%206.42%200%200%201%202%201.48l-1.85%201.8a4.18%204.18%200%200%200-1.14-.91%203.23%203.23%200%200%200-1.58-.37%204%204%200%200%200-1.49.27%203.48%203.48%200%200%200-1.2.78%203.66%203.66%200%200%200-.8%201.22%204.42%204.42%200%200%200%200%203.15c.182.456.454.871.8%201.22.342.34.75.606%201.2.78a4%204%200%200%200%201.49.27%203.45%203.45%200%200%200%201.68-.39%204.27%204.27%200%200%200%201.29-1.12l1.86%201.8zM36%2028a6%206%200%200%201-4.88%202.24%206.48%206.48%200%200%201-2.53-.49%206.35%206.35%200%200%201%200-11.73%206.48%206.48%200%200%201%202.53-.49%206.11%206.11%200%200%201%202.59.51%206.41%206.41%200%200%201%202%201.48l-1.85%201.8a4.18%204.18%200%200%200-1.14-.91%203.22%203.22%200%200%200-1.58-.37%204%204%200%200%200-1.49.27%203.48%203.48%200%200%200-1.2.78%203.64%203.64%200%200%200-.8%201.22%204.42%204.42%200%200%200%200%203.15c.182.456.454.871.8%201.22.342.34.75.606%201.2.78a4%204%200%200%200%201.49.27%203.45%203.45%200%200%200%201.68-.39c.5-.283.94-.664%201.29-1.12L36%2028z%27%0A%20%20%20%20%20%20%20%20fill=%27%23FFF%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-captions[aria-pressed=\'true\']{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M7%2011v26h34V11H7zm-.75-3h35.5A2.25%202.25%200%200%201%2044%2010.25v27.5A2.25%202.25%200%200%201%2041.75%2040H6.25A2.25%202.25%200%200%201%204%2037.75v-27.5A2.25%202.25%200%200%201%206.25%208z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27%20fill-rule=%27nonzero%27/%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M23.38%2028a6%206%200%200%201-4.88%202.24A6.35%206.35%200%200%201%2016%2018a6.47%206.47%200%200%201%202.53-.49%206.1%206.1%200%200%201%202.59.51%206.42%206.42%200%200%201%202%201.48l-1.85%201.8a4.18%204.18%200%200%200-1.14-.91%203.23%203.23%200%200%200-1.58-.37%204%204%200%200%200-1.49.27%203.48%203.48%200%200%200-1.2.78%203.66%203.66%200%200%200-.8%201.22%204.42%204.42%200%200%200%200%203.15c.182.456.454.871.8%201.22.342.34.75.606%201.2.78a4%204%200%200%200%201.49.27%203.45%203.45%200%200%200%201.68-.39%204.27%204.27%200%200%200%201.29-1.12l1.86%201.8zM36%2028a6%206%200%200%201-4.88%202.24%206.48%206.48%200%200%201-2.53-.49%206.35%206.35%200%200%201%200-11.73%206.48%206.48%200%200%201%202.53-.49%206.11%206.11%200%200%201%202.59.51%206.41%206.41%200%200%201%202%201.48l-1.85%201.8a4.18%204.18%200%200%200-1.14-.91%203.22%203.22%200%200%200-1.58-.37%204%204%200%200%200-1.49.27%203.48%203.48%200%200%200-1.2.78%203.64%203.64%200%200%200-.8%201.22%204.42%204.42%200%200%200%200%203.15c.182.456.454.871.8%201.22.342.34.75.606%201.2.78a4%204%200%200%200%201.49.27%203.45%203.45%200%200%200%201.68-.39c.5-.283.94-.664%201.29-1.12L36%2028z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27%20fill-rule=%27nonzero%27/%3E%0A%3C/svg%3E%0A")}.btn-like{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M7%2C41.5a1.5%2C1.5%2C0%2C0%2C1-3%2C0v-21a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0Zm29.82.21A2.59%2C2.59%2C0%2C0%2C1%2C34.31%2C43H11.5A1.5%2C1.5%2C0%2C0%2C1%2C10%2C41.5v-22a1.5%2C1.5%2C0%2C0%2C1%2C.44-1.06l11-11A11%2C11%2C0%2C0%2C1%2C22.8%2C6.28a7.15%2C7.15%2C0%2C0%2C1%2C2.15-1.12%2C3.31%2C3.31%2C0%2C0%2C1%2C2.89.35%2C5%2C5%2C0%2C0%2C1%2C2%2C2.89%2C7.94%2C7.94%2C0%2C0%2C1%2C.2%2C3c0%2C.18%2C0%2C.33-.06.42a1.5%2C1.5%2C0%2C0%2C1-.07.25l-2.24%2C6H39c2.81%2C0%2C5%2C2.63%2C5%2C5.5v2.94a3.36%2C3.36%2C0%2C0%2C1-.42%2C1.43ZM33.5%2C40h.83L40.9%2C26.5l.05-.1s0-1%2C0-2.9A2.39%2C2.39%2C0%2C0%2C0%2C39%2C21H25.5a1.5%2C1.5%2C0%2C0%2C1-1.4-2L27%2C11.12a5.21%2C5.21%2C0%2C0%2C0-.1-1.93A2%2C2%2C0%2C0%2C0%2C26.16%2C8S26%2C8%2C25.8%2C8a4.37%2C4.37%2C0%2C0%2C0-1.23.67%2C8.89%2C8.89%2C0%2C0%2C0-.73.59l-.28.26L13%2C20.12V40Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%3C/svg%3E%0A")}.btn-like[aria-pressed=\'true\']{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M7%2C41.5a1.5%2C1.5%2C0%2C0%2C1-3%2C0v-21a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0Zm29.82.21A2.59%2C2.59%2C0%2C0%2C1%2C34.31%2C43H11.5A1.5%2C1.5%2C0%2C0%2C1%2C10%2C41.5v-22a1.5%2C1.5%2C0%2C0%2C1%2C.44-1.06l11-11A11%2C11%2C0%2C0%2C1%2C22.8%2C6.28a7.15%2C7.15%2C0%2C0%2C1%2C2.15-1.12%2C3.31%2C3.31%2C0%2C0%2C1%2C2.89.35%2C5%2C5%2C0%2C0%2C1%2C2%2C2.89%2C7.94%2C7.94%2C0%2C0%2C1%2C.2%2C3c0%2C.18%2C0%2C.33-.06.42a1.5%2C1.5%2C0%2C0%2C1-.07.25l-2.24%2C6H39c2.81%2C0%2C5%2C2.63%2C5%2C5.5v2.94a3.36%2C3.36%2C0%2C0%2C1-.42%2C1.43ZM33.5%2C40h.83L40.9%2C26.5l.05-.1s0-1%2C0-2.9A2.39%2C2.39%2C0%2C0%2C0%2C39%2C21H25.5a1.5%2C1.5%2C0%2C0%2C1-1.4-2L27%2C11.12a5.21%2C5.21%2C0%2C0%2C0-.1-1.93A2%2C2%2C0%2C0%2C0%2C26.16%2C8S26%2C8%2C25.8%2C8a4.37%2C4.37%2C0%2C0%2C0-1.23.67%2C8.89%2C8.89%2C0%2C0%2C0-.73.59l-.28.26L13%2C20.12V40Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%3C/svg%3E%0A")}.btn-dislike{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M41%2C6.5a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v21a1.5%2C1.5%2C0%2C0%2C1-3%2C0ZM11.18%2C6.29A2.59%2C2.59%2C0%2C0%2C1%2C13.69%2C5H36.5A1.5%2C1.5%2C0%2C0%2C1%2C38%2C6.5v22a1.5%2C1.5%2C0%2C0%2C1-.44%2C1.06l-11%2C11a11%2C11%2C0%2C0%2C1-1.38%2C1.18%2C7.15%2C7.15%2C0%2C0%2C1-2.15%2C1.12%2C3.31%2C3.31%2C0%2C0%2C1-2.89-.35%2C5%2C5%2C0%2C0%2C1-2-2.89%2C7.94%2C7.94%2C0%2C0%2C1-.2-3c0-.18%2C0-.33.06-.42A1.5%2C1.5%2C0%2C0%2C1%2C18.1%2C36l2.24-6H9c-2.81%2C0-5-2.63-5-5.5V21.56a3.36%2C3.36%2C0%2C0%2C1%2C.42-1.43ZM35%2C8H13.67L7.1%2C21.5%2C7%2C21.6s0%2C1%2C0%2C2.9A2.39%2C2.39%2C0%2C0%2C0%2C9%2C27H22.5a1.5%2C1.5%2C0%2C0%2C1%2C1.4%2C2L21%2C36.88a5.21%2C5.21%2C0%2C0%2C0%2C.1%2C1.93%2C2%2C2%2C0%2C0%2C0%2C.78%2C1.2s.12%2C0%2C.36%2C0a4.37%2C4.37%2C0%2C0%2C0%2C1.23-.67%2C8.89%2C8.89%2C0%2C0%2C0%2C.73-.59l.28-.26L35%2C27.88Z%27%0A%20%20%20%20%20%20fill=%27%23fff%27/%3E%0A%3C/svg%3E%0A")}.btn-dislike[aria-pressed=\'true\']{content:url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2048%2048%27%3E%0A%20%20%3Cpath%0A%20%20%20%20%20%20d=%27M41%2C6.5a1.5%2C1.5%2C0%2C0%2C1%2C3%2C0v21a1.5%2C1.5%2C0%2C0%2C1-3%2C0ZM11.18%2C6.29A2.59%2C2.59%2C0%2C0%2C1%2C13.69%2C5H36.5A1.5%2C1.5%2C0%2C0%2C1%2C38%2C6.5v22a1.5%2C1.5%2C0%2C0%2C1-.44%2C1.06l-11%2C11a11%2C11%2C0%2C0%2C1-1.38%2C1.18%2C7.15%2C7.15%2C0%2C0%2C1-2.15%2C1.12%2C3.31%2C3.31%2C0%2C0%2C1-2.89-.35%2C5%2C5%2C0%2C0%2C1-2-2.89%2C7.94%2C7.94%2C0%2C0%2C1-.2-3c0-.18%2C0-.33.06-.42A1.5%2C1.5%2C0%2C0%2C1%2C18.1%2C36l2.24-6H9c-2.81%2C0-5-2.63-5-5.5V21.56a3.36%2C3.36%2C0%2C0%2C1%2C.42-1.43ZM35%2C8H13.67L7.1%2C21.5%2C7%2C21.6s0%2C1%2C0%2C2.9A2.39%2C2.39%2C0%2C0%2C0%2C9%2C27H22.5a1.5%2C1.5%2C0%2C0%2C1%2C1.4%2C2L21%2C36.88a5.21%2C5.21%2C0%2C0%2C0%2C.1%2C1.93%2C2%2C2%2C0%2C0%2C0%2C.78%2C1.2s.12%2C0%2C.36%2C0a4.37%2C4.37%2C0%2C0%2C0%2C1.23-.67%2C8.89%2C8.89%2C0%2C0%2C0%2C.73-.59l.28-.26L35%2C27.88Z%27%0A%20%20%20%20%20%20fill=%27%234285F4%27/%3E%0A%3C/svg%3E%0A")}.timeline{flex:none;margin-bottom:-13px}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){.timeline{margin-bottom:1px}}.live-indicator{font-size:24px;line-height:24px;text-align:right}.time-numbers:after{clear:both;content:"";display:table}.time-indicator{font-size:24px;line-height:24px;opacity:.5}.time-indicator.left{float:left}.time-indicator.right{float:right}.scrubber-layer{margin:-15px 0;height:60px;position:relative}.progress-bar{background-color:rgba(255,255,255,0.4);border-radius:2px;height:4px;left:0;overflow:hidden;position:absolute;top:28px;width:100%}.progress-fill{background-color:#fff;height:100%;left:0;position:absolute;top:0;transform:scaleX(0);transform-origin:left center;width:100%;will-change:transform}.progress-fill.break{background-color:#fbbc04}.progress-loading{height:100%;left:0;position:absolute;top:0;transform:scaleX(1);transform-origin:right center;width:100%;will-change:transform}input[type=range].scrubber{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-focus-ring-color:rgba(255,255,255,0);-webkit-appearance:none;background-color:transparent;height:60px;left:0;margin:0;outline:none;position:absolute;top:0;width:100%;will-change:transform}input[type=range].scrubber::-webkit-slider-thumb{-webkit-appearance:none;background:#fff;border-radius:2px;cursor:pointer;height:24px;margin-top:18px;width:4px}input[type=range].scrubber::-webkit-slider-runnable-track{background:transparent;cursor:pointer;height:60px;width:100%}input[type=range].scrubber[disabled]::-webkit-slider-thumb{display:none}';this.ab=
document.createElement("div");this.ab.classList.add("touch-layer");this.ab.innerHTML=Ch;Ch.Te(this.ab);b.appendChild(c);b.appendChild(this.ab);b.getElementById("live-label").innerText="LIVE";this.P=new Nh(this.ab);this.Kd=b.getElementById("buttons");this.rb=new Dh(b.getElementById("play"),b.getElementById("pause"));this.ja=new Ih(b.getElementById("live-label"),b.getElementById("scrubber-layer"),b.getElementById("current-time"),b.getElementById("total-time"));for(var d in W)W.hasOwnProperty(d)&&(b=
W[d],this.Gc[b]=this.ab.querySelector(".slot."+b));this.rb.onPause=function(){a.onPause()};this.rb.onPlay=function(){a.onPlay()};this.ja.onSeek=function(b){a.onSeek(b)}};g.cb=function(a,b){if(!this.Gc.hasOwnProperty(a))throw Error("Invalid controls slot name. - "+a);for(a=this.Gc[a];a.firstChild;)a.removeChild(a.firstChild);b&&a.appendChild(b.element)};g.Xa=function(a){this.ja.Xa(a)};g.Va=function(a){this.ja.Va(a)};g.Wa=function(a){this.ja.Wa(a)};g.yd=function(a){this.ja.yd(a)};g.xd=function(a){this.rb.xd(a)};
g.Aa=function(a){this.P.Aa(a)};g.xb=function(a){this.P.xb(a)};var Rh=function(a,b){"IDLE"===b?a.P.K(!0):a.P.K(!1);"PLAYING"===b&&(a.rb.Bd(),a.P.Bd());"PAUSED"===b&&(a.rb.Fc(),a.P.Fc());"BUFFERING"===b||"LOADING"===b?(a.P.F.classList.toggle("buffering",!0),a.ja.kd.classList.toggle("hidden",!1)):(a.P.F.classList.toggle("buffering",!1),a.ja.kd.classList.toggle("hidden",!0))};Qh.prototype.Ad=function(a){this.ja.Ad(a)};Qh.prototype.Cd=function(a){this.ja.Cd(a);this.Kd.classList.toggle("break",a)};
document.registerElement("touch-controls",{prototype:Qh.prototype});var Uh=function(){var a=this;this.Lc=!0;this.o={};this.N=new sh;this.G=new nh(this.N);this.i=this.Ab=this.oa=null;Sh(this);var b=document.createElement("touch-controls");b.id="player-controls";document.body.appendChild(b);this.i=b;Th();this.i.onPause=function(){oh(a.G.N,new V("PAUSE"))};this.i.onPlay=function(){oh(a.G.N,new V("PLAY"))};this.i.onSeek=function(b){var c=a.G,e=new eh;e.currentTime=b;oh(c.N,e)};Oh(this.i.P,Bh.VIDEO);Rh(this.i,"IDLE");this.i.Wa(0);this.i.Va(0);this.N.onMediaStatus=this.onMediaStatus.bind(this);
this.N.je=this.pg.bind(this);b=K.H().ec;Ph(this.i.P,b.name,b.iconUrl)},X=function(a,b,c){if(!Object.values(qh).includes(c))throw Error("Invalid controls button name. - "+c);"no-button"!==c?a.i.cb(b,a.o[c]):a.i.cb(b,null)};Uh.prototype.Sc=function(){X(this,W.SLOT_1,"no-button");X(this,W.SLOT_2,"no-button");X(this,W.SLOT_3,"no-button");X(this,W.SLOT_4,"no-button");this.Lc=!1};Uh.prototype.Xa=function(a){this.i.Xa(a)};
var Sh=function(a){a.o["queue-next"]=new yh(function(){var b=a.G,c=new Kg;c.jump=1;oh(b.N,c)},"Next item","btn-next");a.o["queue-prev"]=new yh(function(){var b=a.G,c=new Kg;c.jump=-1;oh(b.N,c)},"Previous item","btn-back");a.o["seek-forward-10"]=new yh(function(){ph(a.G,10)},"Seek forward 10 seconds","btn-seek-forward-10");a.o["seek-forward-15"]=new yh(function(){ph(a.G,15)},"Seek forward 15 seconds","btn-seek-forward-15");a.o["seek-forward-30"]=new yh(function(){ph(a.G,30)},"Seek forward 30 seconds",
"btn-seek-forward-30");a.o["seek-backward-10"]=new yh(function(){ph(a.G,-10)},"Seek backward 10 seconds","btn-seek-backward-10");a.o["seek-backward-15"]=new yh(function(){ph(a.G,-15)},"Seek backward 15 seconds","btn-seek-backward-15");a.o["seek-backward-30"]=new yh(function(){ph(a.G,-30)},"Seek backward 30 seconds","btn-seek-backward-30");a.o.repeat=a.qe=new xh(function(b){var c=a.G,d=new Kg;d.repeatMode=b;oh(c.N,d)});a.o.shuffle=a.Fd=new zh(function(b){var c=a.G,d=new Kg;d.shuffle=b;oh(c.N,d);Ah(a.Fd,
b)},"Shuffle","btn-shuffle");a.o.captions=a.Ze=new zh(function(b){var c=a.G,d=new ch;d.enableTextTracks=b;oh(c.N,d)},"Captions","btn-captions");a.o.like=a.Qb=new zh(function(b){if(b){var c=a.G,d=new ff;d.userAction="LIKE";th(c.N,d);Ah(a.Qb,b);a.Qb.K(!0);Ah(a.Db,!1);a.Db.K(!1)}},"Thumbs up","btn-like");a.o.dislike=a.Db=new zh(function(b){if(b){var c=a.G,d=new ff;d.userAction="DISLIKE";th(c.N,d);Ah(a.Db,b);a.Db.K(!0);Ah(a.Qb,!1);a.Qb.K(!1)}},"Thumbs down","btn-dislike")},Vh=function(a,b){a.o["queue-next"].K(!(b&
64));a.o["queue-prev"].K(!(b&128));a.o.shuffle.K(!(b&256));b=!(b&2);a.o["seek-forward-10"].K(b);a.o["seek-forward-15"].K(b);a.o["seek-forward-30"].K(b);a.o["seek-backward-10"].K(b);a.o["seek-backward-15"].K(b);a.o["seek-backward-30"].K(b)},Wh=function(a,b,c,d){Oh(a.i.P,Bh.VIDEO);if(a.Lc){d=!!(b&2)&&!d;var e=!!(b&128);b=!!(b&64);c?X(a,W.SLOT_1,"captions"):e&&d?X(a,W.SLOT_1,"queue-prev"):X(a,W.SLOT_1,"no-button");d?X(a,W.SLOT_2,"seek-backward-30"):e?X(a,W.SLOT_2,"queue-prev"):X(a,W.SLOT_2,"no-button");
d?X(a,W.SLOT_3,"seek-forward-30"):b?X(a,W.SLOT_3,"queue-next"):X(a,W.SLOT_3,"no-button");d&&b?X(a,W.SLOT_4,"queue-next"):X(a,W.SLOT_4,"no-button")}},Xh=function(a,b){Oh(a.i.P,Bh.AUDIO);a.Lc&&(b&128?X(a,W.SLOT_2,"queue-prev"):X(a,W.SLOT_2,"no-button"),b&64?X(a,W.SLOT_3,"queue-next"):X(a,W.SLOT_3,"no-button"))},Yh=function(a){Oh(a.i.P,Bh.PHOTO);a.Lc&&(X(a,W.SLOT_1,"no-button"),X(a,W.SLOT_2,"no-button"),X(a,W.SLOT_3,"no-button"),X(a,W.SLOT_4,"no-button"))},ai=function(a,b,c){var d="LIVE"==b.streamType;
a.i.yd(!!(c&2)&&!d);a.i.xd(!!(c&1));a.i.Ad(d);if(b.metadata)switch(b.metadata.metadataType){case 1:Wh(a,c,Zh(b),d);return;case 2:Wh(a,c,Zh(b),d);return;case 3:Xh(a,c);return;case 4:Yh(a);return}var e=$h(b.contentType);"audio"===e?Xh(a,c):"image"===e?Yh(a):Wh(a,c,Zh(b),d)},ci=function(a,b){a.i.Aa("");a.i.xb("");if(b)switch(b.metadataType){case 3:break;case 4:break;case 2:a.i.Aa(b.seriesTitle||b.title||"");break;case 1:a.i.Aa(b.title||"");a.i.xb(b.subtitle||"");break;case 0:a.i.Aa(b.title||"");a.i.xb(b.subtitle||
"");break;default:E(bi,"Unexpected metadata type: "+b.metadataType)}},di=function(a,b,c){a.i.Aa("");a.i.xb("");b?(a.i.Aa(b.title||""),a.i.Wa(b.duration||0),a.i.Va(c)):E(bi,"Unknown break clip in media status")};
Uh.prototype.onMediaStatus=function(a){a&&(this.i.Cd(!!a.breakStatus),Vh(this,a.supportedMediaCommands),a.media&&ei(this,a.media),a.breakStatus?(this.Ab=(this.oa&&this.oa.breakClips||[]).find(function(b){return b.id==a.breakStatus.breakClipId})||this.Ab,di(this,this.Ab,a.breakStatus.currentBreakClipTime)):(this.Ab&&(this.Ab=null,this.i.Wa(this.oa.duration||0),ci(this,this.oa.metadata)),a.media&&(a.media.duration&&this.i.Wa(a.media.duration),ai(this,a.media,a.supportedMediaCommands)),p(a.currentTime)&&
isFinite(a.currentTime)&&!isNaN(a.currentTime)&&this.i.Va(a.currentTime),a.queueData&&n(a.queueData.repeatMode)&&this.qe.Xb(a.queueData.repeatMode),a.queueData&&Ah(this.Fd,!!a.queueData.shuffle)),a.playerState&&"IDLE"===a.playerState&&a.extendedStatus&&"LOADING"===a.extendedStatus.playerState&&(this.i.Wa(0),this.i.Va(0),ai(this,a.extendedStatus.media,a.supportedMediaCommands),ei(this,a.extendedStatus.media||null)),Ah(this.Ze,fi(this,a)))};
var ei=function(a,b){a.oa&&b&&a.oa.contentId==b.contentId||(Ah(a.Qb,!1),Ah(a.Db,!1));a.oa=b},fi=function(a,b){if(b.activeTrackIds&&a.oa.tracks){b=l(b.activeTrackIds);for(var c=b.next();!c.done;c=b.next()){c=c.value;for(var d=l(a.oa.tracks),e=d.next();!e.done;e=d.next())if(e=e.value,e.trackId==c&&"TEXT"==e.type)return!0}}return!1},Zh=function(a){return a&&a.tracks&&a.tracks.some(function(a){return"TEXT"==a.type})||!1};Uh.prototype.pg=function(){this.qe.Xb("REPEAT_OFF");Ah(this.Fd,!1)};
function $h(a){switch(a.toLowerCase().split("/")[0]){case "image":return"image";case "audio":return"audio";case "video":return"video";default:return"video"}}
function Th(){var a=window.document.createElement("style");a.innerHTML="@import url(//fonts.googleapis.com/css?family=Google+Sans:400,500);html{--cast-controls-horizontal-padding:56px;--cast-controls-safe-area-height:calc(100vh - 192px)}@media (orientation:landscape) and (min-width: 1200px),(orientation:portrait) and (min-height: 1200px){html{--cast-controls-horizontal-padding:112px;--cast-controls-safe-area-height:calc(100vh - 240px)}}";window.document.body.appendChild(a)}var bi=y("cast.receiver.ui.ControlsBaseImplementation");var gi=y("cast.receiver.ui.PlaybackTimeTracker"),hi=function(){var a=this;this.ga=1;this.na=!1;this.ontimeupdate=q;this.td=function(){if(a.na)a.ontimeupdate()}};hi.prototype.za=function(a){a!==this.c&&(this.c&&(this.c.removeEventListener("timeupdate",this.td),this.c=null),a&&(this.c=a,this.c.addEventListener("timeupdate",this.td)))};
hi.prototype.onMediaStatus=function(a){ii(a.currentTime)?(this.ic=a.currentTime,this.Gd=(new Date).getTime()):this.na&&(this.ic+=((new Date).getTime()-this.Gd)/1E3*this.ga,this.Gd=(new Date).getTime(),"IDLE"!==a.playerState&&(this.c||F(gi,"currentTime was not synchronized from Media Status. Possible incorrect progress bar position")));"PLAYING"===a.playerState?ji(this):(this.na=!1,clearInterval(this.Ie));this.ga=!a.breakStatus&&ii(a.playbackRate)?a.playbackRate:1};
var ji=function(a){a.na=!0;clearInterval(a.Ie);a.Ie=setInterval(function(){a.c||a.td()},200)};function ii(a){return p(a)&&isFinite(a)&&!isNaN(a)};var ki=function(){Uh.call(this);var a=this;this.Ac=new hi;this.Ac.ontimeupdate=function(){var b=a.Ac;a.i.Va(b.c?b.c.currentTime:b.na?b.ic+((new Date).getTime()-b.Gd)/1E3*b.ga:b.ic||0)}};k(ki,Uh);ki.prototype.cb=function(a,b){X(this,a,b)};ki.prototype.za=function(a){this.Ac.za(a)};
ki.prototype.onMediaStatus=function(a){a&&(Uh.prototype.onMediaStatus.call(this,a),a.media&&!a.breakStatus&&ci(this,a.media.metadata),a.playerState&&("IDLE"===a.playerState&&a.extendedStatus&&"LOADING"===a.extendedStatus.playerState?(Rh(this.i,a.extendedStatus.playerState),ci(this,a.extendedStatus.media&&a.extendedStatus.media.metadata)):Rh(this.i,a.playerState)),this.Ac.onMediaStatus(a))};qa(ki);var Y=function(){var a=this;this.M=K.H();this.Cb=null;this.Uc=bd();Re(this.M).then(function(b){b?(a.Cb=ki.H(),a.Uc.resolve(!0)):a.Uc.resolve(!1)})};t("cast.receiver.ui.Controls",Y);Y.prototype.cb=function(a,b){var c=this;li(this,function(){c.Cb.cb(a,b)})};Y.prototype.assignButton=Y.prototype.cb;Y.prototype.Sc=function(){var a=this;li(this,function(){a.Cb.Sc()})};Y.prototype.clearDefaultSlotAssignments=Y.prototype.Sc;Y.prototype.Xa=function(a){var b=this;li(this,function(){b.Cb.Xa(a)})};
Y.prototype.setScrubberVisibility=Y.prototype.Xa;Y.prototype.za=function(a){var b=this;li(this,function(){b.Cb.za(a)})};Y.prototype.setMediaElement=Y.prototype.za;Y.prototype.Ed=function(a){this.M.Ed(a)};Y.prototype.setTouchScreenOptimizedApp=Y.prototype.Ed;var li=function(a,b){a.Uc.Ub.then(function(c){c&&b.call(a)})};
Y.prototype.Wf=function(){var a=window.document.createElement("div");a.style.position="absolute";a.style.visibility="hidden";a.style.left="-1000px";a.style.setProperty("height","var(--cast-controls-safe-area-height)");window.document.body.appendChild(a);var b=parseInt(window.getComputedStyle(a,null).height,10);a.remove();return b};Y.prototype.getSafeAreaHeight=Y.prototype.Wf;y("cast.receiver.ui.Controls");qa(Y);Y.getInstance=Y.H;window.document.addEventListener("DOMContentLoaded",function(){Y.H()});}).call(window);