diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2cd58a3e..50463460 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+#### Version 2.1.2
+
+* Fixed playback of some protected videos. (#122)
+* Fixed playback of some age restricted videos. (#137)
+
#### Version 2.1.1
* Adaptation to YouTube API change. (#116)
diff --git a/README.md b/README.md
index 558e7736..4fef28f4 100644
--- a/README.md
+++ b/README.md
@@ -30,12 +30,12 @@ XCDYouTubeKit is available through CocoaPods and Carthage.
CocoaPods:
```ruby
-pod "XCDYouTubeKit", "~> 2.1.1"
+pod "XCDYouTubeKit", "~> 2.1.2"
```
Carthage:
```objc
-github "0xced/XCDYouTubeKit" ~> 2.1.1
+github "0xced/XCDYouTubeKit" ~> 2.1.2
```
Alternatively, you can manually use the provided static library on iOS or dynamic framework on OS X. In order to use the iOS static library, you must:
diff --git a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj
index 0d438f71..556e4eab 100644
--- a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj
+++ b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj
@@ -444,7 +444,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 2.1.1;
+ CURRENT_PROJECT_VERSION = 2.1.2;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -478,7 +478,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 2.1.1;
+ CURRENT_PROJECT_VERSION = 2.1.2;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = "NS_BLOCK_ASSERTIONS=1";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
diff --git a/XCDYouTubeKit Demo/iOS Demo/DemoInlineViewController.m b/XCDYouTubeKit Demo/iOS Demo/DemoInlineViewController.m
index 771263f0..fb6f5a37 100644
--- a/XCDYouTubeKit Demo/iOS Demo/DemoInlineViewController.m
+++ b/XCDYouTubeKit Demo/iOS Demo/DemoInlineViewController.m
@@ -25,7 +25,8 @@ - (IBAction) load:(id)sender
{
[self.videoContainerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
- self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"VpZmIiIXuZ0"];
+ NSString *videoIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"VideoIdentifier"];
+ self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:videoIdentifier];
self.videoPlayerViewController.moviePlayer.backgroundPlaybackEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"PlayVideoInBackground"];
[self.videoPlayerViewController presentInView:self.videoContainerView];
diff --git a/XCDYouTubeKit Demo/iOS Demo/DemoThumbnailViewController.m b/XCDYouTubeKit Demo/iOS Demo/DemoThumbnailViewController.m
index dad824f5..ae5b1249 100644
--- a/XCDYouTubeKit Demo/iOS Demo/DemoThumbnailViewController.m
+++ b/XCDYouTubeKit Demo/iOS Demo/DemoThumbnailViewController.m
@@ -14,7 +14,8 @@ @implementation DemoThumbnailViewController
- (IBAction) loadThumbnail:(id)sender
{
- self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"VpZmIiIXuZ0"];
+ NSString *videoIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"VideoIdentifier"];
+ self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:videoIdentifier];
self.videoPlayerViewController.moviePlayer.backgroundPlaybackEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"PlayVideoInBackground"];
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
diff --git a/XCDYouTubeKit Demo/iOS Demo/PlayerEventLogger.m b/XCDYouTubeKit Demo/iOS Demo/PlayerEventLogger.m
index 9757d058..f98b47c4 100644
--- a/XCDYouTubeKit Demo/iOS Demo/PlayerEventLogger.m
+++ b/XCDYouTubeKit Demo/iOS Demo/PlayerEventLogger.m
@@ -30,6 +30,7 @@ - (void) setEnabled:(BOOL)enabled
[defaultCenter addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[defaultCenter addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil];
[defaultCenter addObserver:self selector:@selector(moviePlayerLoadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
+ [defaultCenter addObserver:self selector:@selector(moviePlayerNowPlayingMovieDidChange:) name:MPMoviePlayerNowPlayingMovieDidChangeNotification object:nil];
}
else
{
@@ -37,6 +38,7 @@ - (void) setEnabled:(BOOL)enabled
[defaultCenter removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[defaultCenter removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil];
[defaultCenter removeObserver:self name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
+ [defaultCenter removeObserver:self name:MPMoviePlayerNowPlayingMovieDidChangeNotification object:nil];
}
}
@@ -104,6 +106,12 @@ - (void) moviePlayerLoadStateDidChange:(NSNotification *)notification
NSLog(@"Load State: %@", loadState.length > 0 ? [loadState substringFromIndex:3] : @"N/A");
}
+- (void) moviePlayerNowPlayingMovieDidChange:(NSNotification *)notification
+{
+ MPMoviePlayerController *moviePlayerController = notification.object;
+ NSLog(@"Now Playing %@", moviePlayerController.contentURL);
+}
+
- (void) videoPlayerViewControllerDidReceiveVideo:(NSNotification *)notification
{
NSLog(@"Video: %@", notification.userInfo[XCDYouTubeVideoUserInfoKey]);
diff --git a/XCDYouTubeKit Demo/iOS Demo/Supporting Files/XCDYouTubeKit iOS Demo-Info.plist b/XCDYouTubeKit Demo/iOS Demo/Supporting Files/XCDYouTubeKit iOS Demo-Info.plist
index ee8da605..e761c8c7 100644
--- a/XCDYouTubeKit Demo/iOS Demo/Supporting Files/XCDYouTubeKit iOS Demo-Info.plist
+++ b/XCDYouTubeKit Demo/iOS Demo/Supporting Files/XCDYouTubeKit iOS Demo-Info.plist
@@ -58,9 +58,13 @@
EdeVaT-zZt4
- VEVO
+ VEVO (Mumford & Sons)
rId6PKlDXeU
+
+ VEVO (Rihanna)
+ tg00YEETFzg
+
Age Restricted
zKovmts2KSk
diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testInvalidVideoIdentifier.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testInvalidVideoIdentifier.json
index c1f2642c..8c3e8804 100644
--- a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testInvalidVideoIdentifier.json
+++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testInvalidVideoIdentifier.json
@@ -37,7 +37,7 @@
"uri" : "https:\/\/www.youtube.com\/get_video_info?el=embedded&hl=en&ps=default&video_id=tooShort"
},
{
- "body" : "errorcode=2&status=fail&reason=invalid+or+missing+video+id",
+ "body" : "errorcode=2&status=fail&reason=Invalid+parameters.",
"headers" : {
"x-content-type-options" : "nosniff",
"Content-Type" : "application\/x-www-form-urlencoded",
diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testNilVideoIdentifier.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testNilVideoIdentifier.json
index f4c74d74..2070e7f9 100644
--- a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testNilVideoIdentifier.json
+++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testNilVideoIdentifier.json
@@ -58,7 +58,7 @@
"uri" : "https:\/\/s.ytimg.com\/yts\/jsbin\/html5player-en_US-vflKjOTVq\/html5player.js"
},
{
- "body" : "status=fail&errorcode=2&reason=invalid+or+missing+video+id",
+ "body" : "status=fail&errorcode=2&reason=Invalid+parameters.",
"headers" : {
"x-content-type-options" : "nosniff",
"Content-Type" : "application\/x-www-form-urlencoded",
diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json
index c39dde03..7f6fe63f 100644
--- a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json
+++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json
@@ -1,32 +1,31 @@
[
{
- "body" : "errorcode=150&reason=This+video+is+currently+unavailable.+We+are+working+to+bring+it+back.&enablecsi=1&csi_page_type=embed&eventid=64_kVMOWDYT2cJingVA&status=fail&c=WEB&errordetail=0",
+ "body" : "reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&eventid=JA8DVdHqCqnZiQbD8IHQCg&errorcode=150&errordetail=0&c=WEB&csi_page_type=embed&enablecsi=1&status=fail",
"headers" : {
"x-content-type-options" : "nosniff",
"Content-Type" : "application\/x-www-form-urlencoded",
"Server" : "gwiseguy\/2.0",
- "Date" : "Wed, 18 Feb 2015 13:13:15 GMT",
+ "Date" : "Fri, 13 Mar 2015 16:24:04 GMT",
"x-frame-options" : "SAMEORIGIN",
"x-xss-protection" : "1; mode=block; report=https:\/\/www.google.com\/appserve\/security-bugs\/log\/youtube",
- "alternate-protocol" : "443:quic,p=0.08",
+ "alternate-protocol" : "443:quic,p=0.5",
"Expires" : "Tue, 27 Apr 1971 19:44:06 EST",
"Cache-Control" : "no-store"
},
"method" : "GET",
"status" : 200,
- "uri" : "https:\/\/www.youtube.com\/get_video_info?eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2F1kIsylLeHHU&hl=en&sts=16475&video_id=1kIsylLeHHU"
+ "uri" : "https:\/\/www.youtube.com\/get_video_info?eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2F1kIsylLeHHU&hl=en&sts=16503&video_id=1kIsylLeHHU"
},
{
- "body" : "reason=This+video+is+currently+unavailable.+We+are+working+to+bring+it+back.&errorcode=150&errordetail=0&status=fail",
+ "body" : "errordetail=0&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&status=fail&errorcode=150",
"headers" : {
"x-content-type-options" : "nosniff",
"Content-Type" : "application\/x-www-form-urlencoded",
"Server" : "gwiseguy\/2.0",
- "Date" : "Wed, 18 Feb 2015 13:13:14 GMT",
+ "Date" : "Fri, 13 Mar 2015 16:24:03 GMT",
"x-frame-options" : "SAMEORIGIN",
"x-xss-protection" : "1; mode=block; report=https:\/\/www.google.com\/appserve\/security-bugs\/log\/youtube",
- "alternate-protocol" : "443:quic,p=0.08",
- "Content-Length" : "116",
+ "alternate-protocol" : "443:quic,p=0.5",
"Expires" : "Tue, 27 Apr 1971 19:44:06 EST",
"Cache-Control" : "no-store"
},
@@ -35,15 +34,17 @@
"uri" : "https:\/\/www.youtube.com\/get_video_info?el=detailpage&hl=en&ps=default&video_id=1kIsylLeHHU"
},
{
- "body" : "reason=This+video+is+currently+unavailable.+We+are+working+to+bring+it+back.&c=WEB&status=fail&errordetail=0&eventid=6Y_kVPj9NYPzcKPlgPgM&atc=a%3D3%26b%3DaTTn_ha3V0dTuCNr76Bg3vnFGw0%26c%3D1424265193%26d%3D1%26e%3D1kIsylLeHHU%26c3a%3D12%26hh%3DjU-pHgsjXU2wwL_P-2p7-_rFwwA&csi_page_type=embed&enablecsi=1&errorcode=150",
+ "body" : "atc=a%3D3%26b%3D0R83M7G9Hh4ysVrRq9ZFacuL_Ts%26c%3D1426263843%26d%3D1%26e%3D1kIsylLeHHU%26c3a%3D13%26hh%3DeiyChXJGTKdMuKUlIHDb4aGsPNY&errordetail=0&csi_page_type=embed&status=fail&eventid=Iw8DVZCwBLOZiQam84DgAg&enablecsi=1&c=WEB&errorcode=150&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.",
"headers" : {
"x-content-type-options" : "nosniff",
"Content-Type" : "application\/x-www-form-urlencoded",
"Server" : "gwiseguy\/2.0",
- "Date" : "Wed, 18 Feb 2015 13:13:13 GMT",
+ "Set-Cookie" : "YSC=ST1WYZsxGmI; path=\/; domain=.youtube.com; HttpOnly",
+ "p3p" : "CP=\"This is not a P3P policy! See http:\/\/support.google.com\/accounts\/answer\/151657?hl=en for more info.\"",
+ "Date" : "Fri, 13 Mar 2015 16:24:03 GMT",
"x-frame-options" : "SAMEORIGIN",
"x-xss-protection" : "1; mode=block; report=https:\/\/www.google.com\/appserve\/security-bugs\/log\/youtube",
- "alternate-protocol" : "443:quic,p=0.08",
+ "alternate-protocol" : "443:quic,p=0.5",
"Expires" : "Tue, 27 Apr 1971 19:44:06 EST",
"Cache-Control" : "no-store"
},
@@ -52,37 +53,37 @@
"uri" : "https:\/\/www.youtube.com\/get_video_info?el=embedded&hl=en&ps=default&video_id=1kIsylLeHHU"
},
{
- "body" : "(function(){var f,aa=aa||{},m=this;function n(a){return void 0!==a}function q(a,b,c){a=a.split(\".\");c=c||m;a[0]in c||!c.execScript||c.execScript(\"var \"+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&n(b)?c[d]=b:c[d]?c=c[d]:c=c[d]={}}function t(a,b){for(var c=a.split(\".\"),d=b||m,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function v(){}function ba(a){a.getInstance=function(){return a.Cb?a.Cb:a.Cb=new a}}\nfunction ca(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\";\nelse if(\"function\"==b&&\"undefined\"==typeof a.call)return\"object\";return b}function da(a){return null===a}function fa(a){return\"array\"==ca(a)}function ga(a){var b=ca(a);return\"array\"==b||\"object\"==b&&\"number\"==typeof a.length}function w(a){return\"string\"==typeof a}function ha(a){return\"number\"==typeof a}function ia(a){return\"function\"==ca(a)}function ja(a){var b=typeof a;return\"object\"==b&&null!=a||\"function\"==b}function ka(a){return a[la]||(a[la]=++ma)}\nvar la=\"closure_uid_\"+(1E9*Math.random()>>>0),ma=0;function na(a,b,c){return a.call.apply(a.bind,arguments)}function oa(a,b,c){if(!a)throw Error();if(2\")&&(a=a.replace(Ea,\">\"));-1!=a.indexOf('\"')&&(a=a.replace(Fa,\""\"));-1!=a.indexOf(\"'\")&&(a=a.replace(Ga,\"'\"));-1!=a.indexOf(\"\\x00\")&&(a=a.replace(Ha,\"\"));return a}var Ca=\/&\/g,Da=\/<\/g,Ea=\/>\/g,Fa=\/\"\/g,Ga=\/'\/g,Ha=\/\\x00\/g,Ba=\/[\\x00&<>\"']\/;function Ia(a){return-1!=a.indexOf(\"&\")?\"document\"in m?Ja(a):Ka(a):a}\nfunction Ja(a){var b={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\""\":'\"'},c;c=m.document.createElement(\"div\");return a.replace(La,function(a,e){var g=b[a];if(g)return g;if(\"#\"==e.charAt(0)){var h=Number(\"0\"+e.substr(1));isNaN(h)||(g=String.fromCharCode(h))}g||(c.innerHTML=a+\" \",g=c.firstChild.nodeValue.slice(0,-1));return b[a]=g})}\nfunction Ka(a){return a.replace(\/&([^;]+);\/g,function(a,c){switch(c){case \"amp\":return\"&\";case \"lt\":return\"<\";case \"gt\":return\">\";case \"quot\":return'\"';default:if(\"#\"==c.charAt(0)){var d=Number(\"0\"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})}var La=\/&([^;\\s<&]+);?\/g;function Ma(a,b){a.length>b&&(a=a.substring(0,b-3)+\"...\");return a}function Na(a,b){return-1!=a.toLowerCase().indexOf(b.toLowerCase())}\nfunction Oa(a){return String(a).replace(\/([-()\\[\\]{}+?*.$\\^|,:#b?1:0}\nvar Ua=2147483648*Math.random()|0;function Va(){return\"goog_\"+Ua++}function Wa(a){var b=Number(a);return 0==b&&A(a)?NaN:b}function Xa(a){return String(a).replace(\/\\-([a-z])\/g,function(a,c){return c.toUpperCase()})}function Ya(a){var b=w(void 0)?Oa(void 0):\"\\\\s\";return a.replace(new RegExp(\"(^\"+(b?\"|[\"+b+\"]+\":\"\")+\")([a-z])\",\"g\"),function(a,b,e){return b+e.toUpperCase()})}function Za(a){isFinite(a)&&(a=String(a));return w(a)?\/^\\s*-?0x\/i.test(a)?parseInt(a,16):parseInt(a,10):NaN}\nfunction $a(a,b,c){a=a.split(b);for(var d=[];0c?Math.max(0,a.length+c):c;if(w(a))return w(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc&&(c=Math.max(0,a.length+c));if(w(a))return w(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;\nreturn-1},D=cb.forEach?function(a,b,c){cb.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=w(a)?a.split(\"\"):a,g=0;gb?null:w(a)?a.charAt(b):a[b]}function jb(a,b,c){for(var d=a.length,e=w(a)?a.split(\"\"):a,g=0;gc?null:w(a)?a.charAt(c):a[c]}function lb(a,b,c){for(var d=w(a)?a.split(\"\"):a,e=a.length-1;0<=e;e--)if(e in d&&b.call(c,d[e],e,a))return e;return-1}function G(a,b){return 0<=db(a,b)}function mb(a){return 0==a.length}\nfunction nb(a){if(!fa(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function ob(a,b){G(a,b)||a.push(b)}function pb(a,b){var c=db(a,b),d;(d=0<=c)&&qb(a,c);return d}function qb(a,b){cb.splice.call(a,b,1)}function rb(a,b){var c=jb(a,b,void 0);0<=c&&qb(a,c)}function sb(a){return cb.concat.apply(cb,arguments)}function tb(a){var b=a.length;if(0=arguments.length?cb.slice.call(a,b):cb.slice.call(a,b,c)}\nfunction xb(a,b,c){b=b||a;c=c||function(){return ja(h)?\"o\"+ka(h):(typeof h).charAt(0)+h};for(var d={},e=0,g=0;g>1,k;k=c(b,a[h]);0b?1:ac&&vb(a,-(c+1),0,b)}function Gb(a){for(var b=[],c=0;c]*>|&[^;]+;\/g;function hc(a,b){return b?a.replace(gc,\"\"):a}\nvar ic=RegExp(\"[\\u0591-\\u07ff\\u200f\\ufb1d-\\ufdff\\ufe70-\\ufefc]\"),jc=RegExp(\"[A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0800-\\u1fff\\u200e\\u2c00-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff]\"),kc=RegExp(\"^[^A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0800-\\u1fff\\u200e\\u2c00-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff]*[\\u0591-\\u07ff\\u200f\\ufb1d-\\ufdff\\ufe70-\\ufefc]\"),lc=\/^http:\\\/\\\/.*\/,mc=\/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)\/i,nc=\n\/\\s+\/,oc=\/\\d\/;function pc(){this.j=\"\";this.k=qc}pc.prototype.Fe=!0;pc.prototype.we=function(){return this.j};pc.prototype.toString=function(){return\"Const{\"+this.j+\"}\"};function rc(a){return a instanceof pc&&a.constructor===pc&&a.k===qc?a.j:\"type_error:Const\"}function sc(){var a=new pc;a.j=\"HTML that is escaped and sanitized server-side and passed through yt.net.ajax\";return a}var qc={};function tc(){this.j=\"\";this.k=uc}tc.prototype.Fe=!0;var uc={};tc.prototype.we=function(){return this.j};function vc(a){return a instanceof tc&&a.constructor===tc&&a.k===uc?a.j:\"type_error:SafeStyle\"}function wc(a){var b=new tc;b.j=a;return b}var xc=wc(\"\"),yc=\/^[-,.\"'%_!# a-zA-Z0-9]+$\/;function zc(){this.j=\"\";this.k=Ac}zc.prototype.Fe=!0;zc.prototype.we=function(){return this.j};zc.prototype.Rl=!0;zc.prototype.nf=function(){return 1};function Bc(a){return a instanceof zc&&a.constructor===zc&&a.k===Ac?a.j:\"type_error:SafeUrl\"}var Cc=\/^(?:(?:https?|mailto|ftp):|[^&:\/?#]*(?:[\/?#]|$))\/i;function Dc(a){try{var b=encodeURI(a)}catch(c){return\"about:invalid#zClosurez\"}return b.replace(Ec,function(a){return Fc[a]})}\nvar Ec=\/[()']|%5B|%5D|%25\/g,Fc={\"'\":\"%27\",\"(\":\"%28\",\")\":\"%29\",\"%5B\":\"[\",\"%5D\":\"]\",\"%25\":\"%\"},Ac={};function Gc(){this.j=Hc}Gc.prototype.Fe=!0;Gc.prototype.we=function(){return\"\"};Gc.prototype.Rl=!0;Gc.prototype.nf=function(){return 1};var Hc={};function Ic(){this.j=\"\";this.o=Jc;this.k=null}Ic.prototype.Rl=!0;Ic.prototype.nf=function(){return this.k};Ic.prototype.Fe=!0;Ic.prototype.we=function(){return this.j};function Kc(a){return a instanceof Ic&&a.constructor===Ic&&a.o===Jc?a.j:\"type_error:SafeHtml\"}var Lc=\/^[a-zA-Z0-9-]+$\/,Mc=ec(\"action\",\"cite\",\"data\",\"formaction\",\"href\",\"manifest\",\"poster\",\"src\"),Nc=ec(\"embed\",\"iframe\",\"link\",\"object\",\"script\",\"style\",\"template\");\nfunction Oc(a){function b(a){if(fa(a))D(a,b);else{var g;a instanceof Ic?g=a:(g=null,a.Rl&&(g=a.nf()),a=Aa(a.Fe?a.we():String(a)),g=Pc(a,g));d+=Kc(g);g=g.nf();0==c?c=g:0!=g&&c!=g&&(c=null)}}var c=0,d=\"\";D(arguments,b);return Pc(d,c)}var Jc={};function Pc(a,b){var c=new Ic;c.j=a;c.k=b;return c}Pc(\"\",0);function Qc(a,b,c){return Math.min(Math.max(a,b),c)};function Rc(a,b){this.x=n(a)?a:0;this.y=n(b)?b:0}f=Rc.prototype;f.clone=function(){return new Rc(this.x,this.y)};function Sc(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1}function Tc(a,b){return new Rc(a.x-b.x,a.y-b.y)}f.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};f.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};f.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};\nf.scale=function(a,b){var c=ha(b)?b:a;this.x*=a;this.y*=c;return this};function H(a,b){this.width=a;this.height=b}function Uc(a,b){return a==b?!0:a&&b?a.width==b.width&&a.height==b.height:!1}f=H.prototype;f.clone=function(){return new H(this.width,this.height)};f.isEmpty=function(){return!(this.width*this.height)};f.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};\nf.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ha(b)?b:a;this.width*=a;this.height*=c;return this};var Vc;t:{var Wc=m.navigator;if(Wc){var Xc=Wc.userAgent;if(Xc){Vc=Xc;break t}}Vc=\"\"}function Yc(a){return-1!=Vc.indexOf(a)};function Zc(){return Yc(\"Opera\")||Yc(\"OPR\")}function $c(){return(Yc(\"Chrome\")||Yc(\"CriOS\"))&&!Zc()};function ad(){return Yc(\"iPhone\")&&!Yc(\"iPod\")&&!Yc(\"iPad\")};var bd=Zc(),cd=Yc(\"Trident\")||Yc(\"MSIE\"),dd=Yc(\"Gecko\")&&!Na(Vc,\"WebKit\")&&!(Yc(\"Trident\")||Yc(\"MSIE\")),ed=Na(Vc,\"WebKit\"),fd=ed&&Yc(\"Mobile\"),gd=Yc(\"Macintosh\"),hd=Yc(\"Windows\"),id=Yc(\"Linux\")||Yc(\"CrOS\"),jd=Yc(\"Android\"),kd=ad(),ld=Yc(\"iPad\");function md(){var a=m.document;return a?a.documentMode:void 0}\nvar nd=function(){var a=\"\",b;if(bd&&m.opera)return a=m.opera.version,ia(a)?a():a;dd?b=\/rv\\:([^\\);]+)(\\)|;)\/:cd?b=\/\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)\/:ed&&(b=\/WebKit\\\/(\\S+)\/);b&&(a=(a=b.exec(Vc))?a[1]:\"\");return cd&&(b=md(),b>parseFloat(a))?String(b):a}(),od={};function pd(a){return od[a]||(od[a]=0<=Sa(nd,a))}function rd(a){return cd&&sd>=a}var td=m.document,sd=td&&cd?md()||(\"CSS1Compat\"==td.compatMode?parseInt(nd,10):5):void 0;var ud=!cd||rd(9),vd=!dd&&!cd||cd&&rd(9)||dd&&pd(\"1.9.1\"),wd=cd&&!pd(\"9\"),xd=cd||bd||ed;function yd(a){return a?new zd(Ad(a)):ua||(ua=new zd)}function Bd(a){return w(a)?document.getElementById(a):a}function Cd(a,b){var c=b||document;return c.querySelectorAll&&c.querySelector?c.querySelectorAll(\".\"+a):Dd(\"*\",a,b)}function Ed(a,b){var c=b||document,d=null;c.querySelectorAll&&c.querySelector?d=c.querySelector(\".\"+a):d=Dd(\"*\",a,b)[0];return d||null}\nfunction Dd(a,b,c){var d=document;c=c||d;a=a&&\"*\"!=a?a.toUpperCase():\"\";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?\".\"+b:\"\"));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,g=0,h;h=c[g];g++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||\"*\");if(b){d={};for(g=e=0;h=c[g];g++)a=h.className,\"function\"==typeof a.split&&G(a.split(\/\\s+\/),b)&&(d[e++]=h);d.length=e;return d}return c}\nfunction Fd(a,b){Ib(b,function(b,d){\"style\"==d?a.style.cssText=b:\"class\"==d?a.className=b:\"for\"==d?a.htmlFor=b:d in Gd?a.setAttribute(Gd[d],b):va(d,\"aria-\")||va(d,\"data-\")?a.setAttribute(d,b):a[d]=b})}var Gd={cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",colspan:\"colSpan\",frameborder:\"frameBorder\",height:\"height\",maxlength:\"maxLength\",role:\"role\",rowspan:\"rowSpan\",type:\"type\",usemap:\"useMap\",valign:\"vAlign\",width:\"width\"};\nfunction Hd(a){a=a.document;a=\"CSS1Compat\"==a.compatMode?a.documentElement:a.body;return new H(a.clientWidth,a.clientHeight)}function Id(a){var b=Jd(a);a=a.parentWindow||a.defaultView;return cd&&pd(\"10\")&&a.pageYOffset!=b.scrollTop?new Rc(b.scrollLeft,b.scrollTop):new Rc(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)}function Jd(a){return ed||\"CSS1Compat\"!=a.compatMode?a.body||a.documentElement:a.documentElement}function Kd(a){return a?a.parentWindow||a.defaultView:window}\nfunction I(a,b,c){return Ld(document,arguments)}function Ld(a,b){var c=b[0],d=b[1];if(!ud&&d&&(d.name||d.type)){c=[\"<\",c];d.name&&c.push(' name=\"',Aa(d.name),'\"');if(d.type){c.push(' type=\"',Aa(d.type),'\"');var e={};cc(e,d);delete e.type;d=e}c.push(\">\");c=c.join(\"\")}c=a.createElement(c);d&&(w(d)?c.className=d:fa(d)?c.className=d.join(\" \"):Fd(c,d));2a}\nfunction ke(a,b,c){if(!(a.nodeName in ee))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(\/(\\r\\n|\\r|\\n)\/g,\"\")):b.push(a.nodeValue);else if(a.nodeName in fe)b.push(fe[a.nodeName]);else for(a=a.firstChild;a;)ke(a,b,c),a=a.nextSibling}function Nd(a){if(a&&\"number\"==typeof a.length){if(ja(a))return\"function\"==typeof a.item||\"string\"==typeof a.item;if(ia(a))return\"function\"==typeof a.item}return!1}\nfunction le(a,b){return b?me(a,function(a){return!b||w(a.className)&&G(a.className.split(\/\\s+\/),b)},!0,void 0):null}function me(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null}function zd(a){this.j=a||m.document||document}f=zd.prototype;f.N=function(a){return w(a)?this.j.getElementById(a):a};f.setProperties=Fd;f.Yw=function(a,b,c){return Ld(this.j,arguments)};f.createElement=function(a){return this.j.createElement(a)};\nfunction ne(a){return\"CSS1Compat\"==a.j.compatMode}function oe(a){a=a.j;return a.parentWindow||a.defaultView}function pe(a){return Id(a.j)}f.appendChild=Qd;f.append=Rd;f.contains=$d;var qe=\"StopIteration\"in m?m.StopIteration:Error(\"StopIteration\");function re(){}re.prototype.next=function(){throw qe;};re.prototype.Yb=function(){return this};function se(a){if(a instanceof re)return a;if(\"function\"==typeof a.Yb)return a.Yb(!1);if(ga(a)){var b=0,c=new re;c.next=function(){for(;;){if(b>=a.length)throw qe;if(b in a)return a[b++];b++}};return c}throw Error(\"Not implemented\");}\nfunction te(a,b,c){if(ga(a))try{D(a,b,c)}catch(d){if(d!==qe)throw d;}else{a=se(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==qe)throw e;}}}function ue(a){if(ga(a))return tb(a);a=se(a);var b=[];te(a,function(a){b.push(a)});return b};function ve(a,b){this.k={};this.j=[];this.$d=this.ma=0;var c=arguments.length;if(12*this.ma&&we(this),!0):!1};function we(a){if(a.ma!=a.j.length){for(var b=0,c=0;b=c.length)throw qe;var h=c[b++];return a?h:d[h]}};return h};function ye(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Ae(a){return\"function\"==typeof a.Oa?a.Oa():ga(a)||w(a)?a.length:Mb(a)}function Be(a){if(\"function\"==typeof a.Ka)return a.Ka();if(w(a))return a.split(\"\");if(ga(a)){for(var b=[],c=a.length,d=0;dc?a[1]=\"?\":c==b.length-1&&(a[1]=void 0)}return a.join(\"\")}function Me(a,b,c){if(fa(b))for(var d=0;dd)return null;var e=a.indexOf(\"&\",d);if(0>e||e>c)e=c;d+=b.length+1;return za(a.substr(d,e-d))}var Xe=\/[?&]($|#)\/;\nfunction Ye(a,b,c){for(var d=a.search(Ve),e=0,g,h=[];0<=(g=Te(a,e,b,d));)h.push(a.substring(e,g)),e=Math.min(a.indexOf(\"&\",g)+1||d,d);h.push(a.substr(e));a=[h.join(\"\").replace(Xe,\"$1\"),\"&\",b];null!=c&&a.push(\"=\",ya(c));return Le(a)};function J(a,b){var c;a instanceof J?(this.xe=n(b)?b:a.xe,Ze(this,a.Jb),this.Re=a.Re,$e(this,a.mb),af(this,a.qd),bf(this,a.Ib),cf(this,a.j.clone()),this.kf=a.pf()):a&&(c=Ge(String(a)))?(this.xe=!!b,Ze(this,c[1]||\"\",!0),this.Re=df(c[2]||\"\"),$e(this,c[3]||\"\",!0),af(this,c[4]),bf(this,c[5]||\"\",!0),cf(this,c[6]||\"\",!0),this.kf=df(c[7]||\"\")):(this.xe=!!b,this.j=new ef(null,0,this.xe))}f=J.prototype;f.Jb=\"\";f.Re=\"\";f.mb=\"\";f.qd=null;f.Ib=\"\";f.kf=\"\";f.xe=!1;\nf.toString=function(){var a=[],b=this.Jb;b&&a.push(ff(b,gf,!0),\":\");if(b=this.mb){a.push(\"\/\/\");var c=this.Re;c&&a.push(ff(c,gf,!0),\"@\");a.push(ya(b).replace(\/%25([0-9a-fA-F]{2})\/g,\"%$1\"));b=this.qd;null!=b&&a.push(\":\",String(b))}if(b=this.Ib)this.mb&&\"\/\"!=b.charAt(0)&&a.push(\"\/\"),a.push(ff(b,\"\/\"==b.charAt(0)?hf:jf,!0));(b=this.j.toString())&&a.push(\"?\",b);(b=this.pf())&&a.push(\"#\",ff(b,kf));return a.join(\"\")};\nf.resolve=function(a){var b=this.clone(),c=!!a.Jb;c?Ze(b,a.Jb):c=!!a.Re;c?b.Re=a.Re:c=!!a.mb;c?$e(b,a.mb):c=null!=a.qd;var d=a.Ib;if(c)af(b,a.qd);else if(c=!!a.Ib){if(\"\/\"!=d.charAt(0))if(this.mb&&!this.Ib)d=\"\/\"+d;else{var e=b.Ib.lastIndexOf(\"\/\");-1!=e&&(d=b.Ib.substr(0,e+1)+d)}e=d;if(\"..\"==e||\".\"==e)d=\"\";else if(-1!=e.indexOf(\".\/\")||-1!=e.indexOf(\"\/.\")){for(var d=va(e,\"\/\"),e=e.split(\"\/\"),g=[],h=0;hb)throw Error(\"Bad port number \"+b);a.qd=b}else a.qd=null;return a}\nfunction bf(a,b,c){a.Ib=c?df(b,!0):b}function cf(a,b,c){b instanceof ef?(a.j=b,mf(a.j,a.xe)):(c||(b=ff(b,nf)),a.j=new ef(b,0,a.xe));return a}function of(a){return a.j}f.gp=function(){return this.j.toString()};function K(a,b,c){a.j.set(b,c);return a}function pf(a,b,c){fa(c)||(c=[String(c)]);qf(a.j,b,c)}function rf(a,b){return a.j.get(b)}f.pf=function(){return this.kf};\nfunction sf(a){K(a,\"zx\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^y()).toString(36));return a}function tf(a){return a instanceof J?a.clone():new J(a,void 0)}function uf(a,b,c,d){var e=new J(null,void 0);a&&Ze(e,a);b&&$e(e,b);c&&af(e,c);d&&bf(e,d);return e}function df(a,b){return a?b?decodeURI(a):decodeURIComponent(a):\"\"}function ff(a,b,c){return w(a)?(a=encodeURI(a).replace(b,vf),c&&(a=a.replace(\/%25([0-9a-fA-F]{2})\/g,\"%$1\")),a):null}\nfunction vf(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}var gf=\/[#\\\/\\?@]\/g,jf=\/[\\#\\?:]\/g,hf=\/[\\#\\?]\/g,nf=\/[\\#\\?@]\/g,kf=\/#\/g;function ef(a,b,c){this.j=a||null;this.k=!!c}function wf(a){a.bb||(a.bb=new ve,a.ma=0,a.j&&Ke(a.j,function(b,c){a.add(za(b),c)}))}f=ef.prototype;f.bb=null;f.ma=null;f.Oa=function(){wf(this);return this.ma};f.add=function(a,b){wf(this);this.j=null;a=xf(this,a);var c=this.bb.get(a);c||this.bb.set(a,c=[]);c.push(b);this.ma++;return this};\nf.remove=function(a){wf(this);a=xf(this,a);return xe(this.bb,a)?(this.j=null,this.ma-=this.bb.get(a).length,this.bb.remove(a)):!1};f.clear=function(){this.bb=this.j=null;this.ma=0};f.isEmpty=function(){wf(this);return 0==this.ma};function yf(a,b){wf(a);b=xf(a,b);return xe(a.bb,b)}f.ff=function(a){var b=this.Ka();return G(b,a)};f.Ia=function(){wf(this);for(var a=this.bb.Ka(),b=this.bb.Ia(),c=[],d=0;dMath.random())&&Tf(b,\"WARNING\"));return c}function cg(a){return!!a&&-1!=a.search(Df)}function dg(a){return!!a&&-1!=a.search(If)}\nfunction $f(a,b){return(new RegExp(\"^(https?:)?\/\/([a-z0-9-]{1,63}\\\\.)*(\"+b.join(\"|\").replace(\/\\.\/g,\".\")+\")(:[0-9]+)?([\/?#]|$)\",\"i\")).test(a)}function eg(a){a=new J(a);Ze(a,document.location.protocol);$e(a,document.location.hostname);document.location.port&&af(a,document.location.port);return a.toString()}function fg(a){a=new J(a);Ze(a,document.location.protocol);return a.toString()};var gg={},hg=0,ig=t(\"yt.net.ping.workerUrl_\")||null;q(\"yt.net.ping.workerUrl_\",ig,void 0);function jg(a,b,c){a&&(c?a&&(a=I(\"iframe\",{src:'javascript:\"data:text\/html,<\/body>\"',style:\"display:none\"}),Ad(a).body.appendChild(a)):kg(a,b))}function kg(a,b){var c=new Image,d=\"\"+hg++;gg[d]=c;c.onload=c.onerror=function(){b&&gg[d]&&b();delete gg[d]};c.src=a;c=eval(\"null\")};function lg(a){a=String(a);if(\/^\\s*$\/.test(a)?0:\/^[\\],:{}\\s\\u2028\\u2029]*$\/.test(a.replace(\/\\\\[\"\\\\\\\/bfnrtu]\/g,\"@\").replace(\/\"[^\"\\\\\\n\\r\\u2028\\u2029\\x00-\\x08\\x0a-\\x1f]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?\/g,\"]\").replace(\/(?:^|:|,)(?:[\\s\\u2028\\u2029]*\\[)+\/g,\"\")))try{return eval(\"(\"+a+\")\")}catch(b){}throw Error(\"Invalid JSON string: \"+a);}function mg(a){return eval(\"(\"+a+\")\")}function ng(a){return(new og(void 0)).D(a)}function og(a){this.j=a}\nog.prototype.D=function(a){var b=[];pg(this,a,b);return b.join(\"\")};\nfunction pg(a,b,c){switch(typeof b){case \"string\":qg(b,c);break;case \"number\":c.push(isFinite(b)&&!isNaN(b)?b:\"null\");break;case \"boolean\":c.push(b);break;case \"undefined\":c.push(\"null\");break;case \"object\":if(null==b){c.push(\"null\");break}if(fa(b)){var d=b.length;c.push(\"[\");for(var e=\"\",g=0;gb?e+=\"000\":256>b?e+=\"00\":4096>b&&(e+=\"0\");return rg[a]=e+b.toString(16)}),'\"')};function tg(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}f=tg.prototype;f.getHeight=function(){return this.bottom-this.top};f.clone=function(){return new tg(this.top,this.right,this.bottom,this.left)};f.contains=function(a){return this&&a?a instanceof tg?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};\nf.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};f.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};f.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};\nf.scale=function(a,b){var c=ha(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function ug(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}f=ug.prototype;f.clone=function(){return new ug(this.left,this.top,this.width,this.height)};function vg(a){return new tg(a.top,a.left+a.width,a.top+a.height,a.left)}function wg(a){return new ug(a.left,a.top,a.right-a.left,a.bottom-a.top)}function xg(a,b){return a==b?!0:a&&b?a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height:!1}\nfunction yg(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),g=Math.min(a.top+a.height,b.top+b.height);if(e<=g)return a.left=c,a.top=e,a.width=d-c,a.height=g-e,!0}return!1}f.contains=function(a){return a instanceof ug?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};\nfunction zg(a){return new H(a.width,a.height)}f.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};\nf.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ha(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Ag(a){Ag[\" \"](a);return a}Ag[\" \"]=v;function Bg(a,b){try{return Ag(a[b]),!0}catch(c){}return!1};function Cg(){return ed?\"Webkit\":dd?\"Moz\":cd?\"ms\":bd?\"O\":null};function Dg(a,b,c){if(w(b))(b=Eg(a,b))&&(a.style[b]=c);else for(var d in b){c=a;var e=b[d],g=Eg(c,d);g&&(c.style[g]=e)}}var Fg={};function Eg(a,b){var c=Fg[b];if(!c){var d=Xa(b),c=d;void 0===a.style[d]&&(d=Cg()+Ya(d),void 0!==a.style[d]&&(c=d));Fg[b]=c}return c}function Gg(a,b){var c=a.style[Xa(b)];return\"undefined\"!==typeof c?c:a.style[Eg(a,b)]||\"\"}\nfunction Hg(a,b){var c=Ad(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||\"\":\"\"}function Ig(a,b){return Hg(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}function Jg(a,b,c){var d;b instanceof Rc?(d=b.x,b=b.y):(d=b,b=c);a.style.left=Kg(d,!1);a.style.top=Kg(b,!1)}function Lg(a){return new Rc(a.offsetLeft,a.offsetTop)}\nfunction Mg(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}cd&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}\nfunction Ng(a){if(cd&&!rd(8))return a.offsetParent;var b=Ad(a),c=Ig(a,\"position\"),d=\"fixed\"==c||\"absolute\"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(11==a.nodeType&&a.host&&(a=a.host),c=Ig(a,\"position\"),d=d&&\"static\"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||\"fixed\"==c||\"absolute\"==c||\"relative\"==c))return a;return null}\nfunction Og(a){for(var b=new tg(0,Infinity,Infinity,0),c=yd(a),d=c.j.body,e=c.j.documentElement,g=Jd(c.j);a=Ng(a);)if(!(cd&&0==a.clientWidth||ed&&0==a.clientHeight&&a==d)&&a!=d&&a!=e&&\"visible\"!=Ig(a,\"overflow\")){var h=Pg(a),k=new Rc(a.clientLeft,a.clientTop);h.x+=k.x;h.y+=k.y;b.top=Math.max(b.top,h.y);b.right=Math.min(b.right,h.x+a.clientWidth);b.bottom=Math.min(b.bottom,h.y+a.clientHeight);b.left=Math.max(b.left,h.x)}d=g.scrollLeft;g=g.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,g);\nc=Hd(oe(c)||window);b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,g+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null}function Pg(a){var b=Ad(a);Ig(a,\"position\");var c=new Rc(0,0),d;d=b?Ad(b):document;d=!cd||rd(9)||ne(yd(d))?d.documentElement:d.body;if(a==d)return c;a=Mg(a);b=pe(yd(b));c.x=a.left+b.x;c.y=a.top+b.y;return c}\nfunction Qg(a,b){var c=new Rc(0,0),d=Kd(Ad(a)),e=a;do{var g=d==b?Pg(e):Rg(e);c.x+=g.x;c.y+=g.y}while(d&&d!=b&&d!=d.parent&&(e=d.frameElement)&&(d=d.parent));return c}function Rg(a){a=Mg(a);return new Rc(a.left,a.top)}function Sg(a){if(1==a.nodeType)return Rg(a);var b=ia(a.D),c=a;a.targetTouches&&a.targetTouches.length?c=a.targetTouches[0]:b&&a.j.targetTouches&&a.j.targetTouches.length&&(c=a.j.targetTouches[0]);return new Rc(c.clientX,c.clientY)}\nfunction Tg(a,b,c){if(b instanceof H)c=b.height,b=b.width;else if(void 0==c)throw Error(\"missing height argument\");Ug(a,b);a.style.height=Kg(c,!0)}function Kg(a,b){\"number\"==typeof a&&(a=(b?Math.round(a):a)+\"px\");return a}function Ug(a,b){a.style.width=Kg(b,!0)}function Vg(a){return Wg(a)}\nfunction Wg(a){var b=Xg;if(\"none\"!=Ig(a,\"display\"))return b(a);var c=a.style,d=c.display,e=c.visibility,g=c.position;c.visibility=\"hidden\";c.position=\"absolute\";c.display=\"inline\";a=b(a);c.display=d;c.position=g;c.visibility=e;return a}function Xg(a){var b=a.offsetWidth,c=a.offsetHeight,d=ed&&!b&&!c;return n(b)&&!d||!a.getBoundingClientRect?new H(b,c):(a=Mg(a),new H(a.right-a.left,a.bottom-a.top))}function Yg(a){var b=Pg(a);a=Wg(a);return new ug(b.x,b.y,a.width,a.height)}\nfunction Zg(a,b){var c=a.style;\"opacity\"in c?c.opacity=b:\"MozOpacity\"in c?c.MozOpacity=b:\"filter\"in c&&(c.filter=\"\"===b?\"\":\"alpha(opacity=\"+100*b+\")\")}function $g(a,b){a.style.display=b?\"\":\"none\"}function ah(a){return\"rtl\"==Ig(a,\"direction\")}function bh(a,b){if(\/^\\d+px?$\/.test(b))return parseInt(b,10);var c=a.style.left,d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var e=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return e}\nfunction ch(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?bh(a,c):0}var dh={thin:2,medium:4,thick:6};function eh(a,b){if(\"none\"==(a.currentStyle?a.currentStyle[b+\"Style\"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+\"Width\"]:null;return c in dh?dh[c]:bh(a,c)}\nfunction fh(a){if(cd&&!rd(9)){var b=eh(a,\"borderLeft\"),c=eh(a,\"borderRight\"),d=eh(a,\"borderTop\");a=eh(a,\"borderBottom\");return new tg(d,c,a,b)}b=Hg(a,\"borderLeftWidth\");c=Hg(a,\"borderRightWidth\");d=Hg(a,\"borderTopWidth\");a=Hg(a,\"borderBottomWidth\");return new tg(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var gh=\/[^\\d]+$\/,hh={cm:1,\"in\":1,mm:1,pc:1,pt:1},ih={em:1,ex:1};\nfunction jh(a){var b=Ig(a,\"fontSize\"),c;c=(c=b.match(gh))&&c[0]||null;if(b&&\"px\"==c)return parseInt(b,10);if(cd){if(c in hh)return bh(a,b);if(a.parentNode&&1==a.parentNode.nodeType&&c in ih)return a=a.parentNode,c=Ig(a,\"fontSize\"),bh(a,b==c?\"1em\":b)}c=I(\"span\",{style:\"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;\"});a.appendChild(c);b=c.offsetHeight;Td(c);return b};function kh(a){if(a.classList)return a.classList;a=a.className;return w(a)&&a.match(\/\\S+\/g)||[]}function lh(a,b){return a.classList?a.classList.contains(b):G(kh(a),b)}function N(a,b){a.classList?a.classList.add(b):lh(a,b)||(a.className+=0=c.length)throw qe;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!w(d))throw\"Storage mechanism: Invalid value was encountered\";return d};return d};f.clear=function(){this.j.clear()};f.key=function(a){return this.j.key(a)};function Mi(){var a=null;try{a=window.localStorage||null}catch(b){}this.j=a}z(Mi,Li);function Ni(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.j=a}z(Ni,Li);function Oi(a){this.j=a}Oi.prototype.set=function(a,b){n(b)?this.j.set(a,ng(b)):this.j.remove(a)};Oi.prototype.get=function(a){var b;try{b=this.j.get(a)}catch(c){return}if(null!==b)try{return lg(b)}catch(d){throw\"Storage: Invalid value was encountered\";}};Oi.prototype.remove=function(a){this.j.remove(a)};function Pi(a){this.j=a}z(Pi,Oi);function Qi(a){this.data=a}function Ri(a){return!n(a)||a instanceof Qi?a:new Qi(a)}Pi.prototype.set=function(a,b){Pi.J.set.call(this,a,Ri(b))};Pi.prototype.k=function(a){a=Pi.J.get.call(this,a);if(!n(a)||a instanceof Object)return a;throw\"Storage: Invalid value was encountered\";};Pi.prototype.get=function(a){if(a=this.k(a)){if(a=a.data,!n(a))throw\"Storage: Invalid value was encountered\";}else a=void 0;return a};function Si(a){this.j=a}z(Si,Pi);function Ti(a){var b=a.creation;a=a.expiration;return!!a&&ay()}Si.prototype.set=function(a,b,c){if(b=Ri(b)){if(c){if(ca.status)e=Ej(c,a,b.GK);if(d)t:{switch(c){case \"XML\":d=0==parseInt(e&&\ne.return_code,10);break t;case \"RAW\":d=!0;break t}d=!!e}var e=e||{},g=b.context||m;d?b.cb&&b.cb.call(g,a,e):b.onError&&b.onError.call(g,a,e);b.bc&&b.bc.call(g,a,e)}},b.method,h,b.headers,b.responseType,b.withCredentials);b.Je&&0Sa(a,\"10.0\")&&(this.k=!1))}function Lj(a,b,c,d){var e=a.j;if(n(d)?d:a.k)e=\"https:\/\/\"+a.o+a.port+a.j;return Se(e+b,c||{})}\nKj.prototype.sendRequest=function(a,b,c,d,e,g,h){a={format:g?\"RAW\":\"JSON\",method:a,context:this,timeout:5E3,withCredentials:!!h,cb:pa(this.B,d,!g),onError:pa(this.A,e),Je:pa(this.C,e)};c&&(a.Eb=c,a.headers={\"Content-Type\":\"application\/x-www-form-urlencoded\"});return Dj(b,a)};Kj.prototype.B=function(a,b,c,d){b?a(d):a({text:c.responseText})};Kj.prototype.A=function(a,b){a(Error(\"Request error: \"+b.status))};Kj.prototype.C=function(a){a(Error(\"request timed out\"))};function Mj(a){a&&(this.id=a.id||\"\",this.name=a.name||\"\",this.activityId=a.activityId||\"\",this.status=a.status||\"UNKNOWN\")}Mj.prototype.id=\"\";Mj.prototype.name=\"\";Mj.prototype.activityId=\"\";Mj.prototype.status=\"UNKNOWN\";Mj.prototype.toString=function(){return\"{id:\"+this.id+\",name:\"+this.name+\",activityId:\"+this.activityId+\",status:\"+this.status+\"}\"};function Nj(){return\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(\/[xy]\/g,function(a){var b=16*Math.random()|0;return(\"x\"==a?b:b&3|8).toString(16)})}function Oj(a){return E(a,function(a){return{key:a.id,name:a.name}})}function Pj(a){return E(a,function(a){return new Mj(a)})}function Qj(a,b){return F(a,function(a){return a.id==b})}function Rj(a,b){return F(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})}function Sj(a,b){return F(a,function(a){return ji(a,b)})};function T(){R.call(this);this.R=new yi;S(this,this.R)}z(T,R);T.prototype.subscribe=function(a,b,c){return this.ha()?0:this.R.subscribe(a,b,c)};T.prototype.unsubscribe=function(a,b,c){return this.ha()?!1:this.R.unsubscribe(a,b,c)};T.prototype.Mb=function(a){return this.ha()?!1:this.R.Mb(a)};T.prototype.publish=function(a,b){return this.ha()?!1:this.R.publish.apply(this.R,arguments)};function Tj(a){T.call(this);this.C=a;this.screens=[]}z(Tj,T);f=Tj.prototype;f.$b=function(){return this.screens};f.contains=function(a){return!!Rj(this.screens,a)};f.get=function(a){return a?Sj(this.screens,a):null};function Uj(a,b){var c=a.get(b.uuid)||a.get(b.id);if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.screens.push(b);return!0}\nfunction Vj(a,b){var c=a.screens.length!=b.length;a.screens=fb(a.screens,function(a){return!!Rj(b,a)});for(var d=0,e=b.length;d=Yj.length?this.publish(\"pairingFailed\",Error(\"DIAL polling timed out\")):(a=Yj[this.o],this.k=L(x(this.Js,this),a),this.o++):this.publish(\"pairingFailed\",Error(\"Server error \"+a.status))};f.ID=function(){this.j=null;this.publish(\"pairingFailed\",Error(\"Server not responding\"))};function Zj(a,b){this.Ef=a;this.Be=b+\"::\"}z(Zj,Ki);f=Zj.prototype;f.Ef=null;f.Be=\"\";f.set=function(a,b){this.Ef.set(this.Be+a,b)};f.get=function(a){return this.Ef.get(this.Be+a)};f.remove=function(a){this.Ef.remove(this.Be+a)};f.Yb=function(a){var b=this.Ef.Yb(!0),c=this,d=new re;d.next=function(){for(var d=b.next();d.substr(0,c.Be.length)!=c.Be;)d=b.next();return a?d.substr(c.Be.length):c.Ef.get(d)};return d};function ak(a){var b=new Mi;return b.isAvailable()?a?new Zj(b,a):b:null};function bk(a){this.j=new ve;if(a){a=Be(a);for(var b=a.length,c=0;cc)return!1;!(b instanceof bk)&&5c?\"\":0==c?\";expires=\"+(new Date(1970,1,1)).toUTCString():\";expires=\"+(new Date(y()+1E3*c)).toUTCString();this.j.cookie=a+\"=\"+b+e+d+c+g};\nf.get=function(a,b){for(var c=a+\"=\",d=(this.j.cookie||\"\").split(gk),e=0,g;g=d[e];e++){if(0==g.lastIndexOf(c,0))return g.substr(c.length);if(g==a)return\"\"}return b};f.remove=function(a,b,c){var d=n(this.get(a));this.set(a,\"\",0,b,c);return d};f.Ia=function(){return hk(this).keys};f.Ka=function(){return hk(this).values};f.isEmpty=function(){return!this.j.cookie};f.Oa=function(){return this.j.cookie?(this.j.cookie||\"\").split(gk).length:0};\nf.ff=function(a){for(var b=hk(this).values,c=0;c \"+b);if(this.j){var c=this.j.o;if(!a||c&&c.id!=a)hl(\"Unsetting old screen status: \"+this.j.k.friendlyName),vi(this.j),this.j=null}if(a&&b){if(!this.j){c=Sj(this.k.$b(),a);if(!c){hl(\"setConnectedScreenStatus: Unknown screen.\");return}var d=il(this,c);d||(hl(\"setConnectedScreenStatus: Connected receiver not custom...\"),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.o.push(d),chrome.cast.setCustomReceivers(this.o,\nv,x(function(a){this.Qa(\"Failed to set initial custom receivers: \"+ng(a))},this)));hl(\"setConnectedScreenStatus: new active receiver: \"+d.friendlyName);jl(this,new cl(this.k,d),!0)}this.j.Nm(b)}else hl(\"setConnectedScreenStatus: no screen.\")};function il(a,b){return b?F(a.o,function(a){return ji(b,a.label)},a):null}f.UC=function(a){this.ha()?this.Qa(\"Setting connection data on disposed cast v2\"):this.j?this.j.Bf(a):this.Qa(\"Setting connection data without a session\")};\nf.stopSession=function(){this.ha()?this.Qa(\"Stopping session on disposed cast v2\"):this.j?(this.j.stop(),vi(this.j),this.j=null):hl(\"Stopping non-existing session\")};f.requestSession=function(){chrome.cast.requestSession(x(this.fr,this),x(this.AB,this))};f.L=function(){this.k.unsubscribe(\"onlineScreenChange\",x(this.Ms,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);ei(el);vi(this.j);dl.J.L.call(this)};function hl(a){fi(\"Controller\",a)}\nf.Qa=function(a){fi(\"Controller\",a)};function el(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)}function gl(a){return a.B||!!a.o.length||!!a.j}function jl(a,b,c){vi(a.j);(a.j=b)?(c?a.publish(\"yt-remote-cast2-receiver-resumed\",b.k):a.publish(\"yt-remote-cast2-receiver-selected\",b.k),b.subscribe(\"sessionScreen\",x(a.gr,a,b)),b.o?a.publish(\"yt-remote-cast2-session-change\",b.o):c&&a.j.Bf(null)):a.publish(\"yt-remote-cast2-session-change\",null)}\nf.gr=function(a,b){this.j==a&&(b||jl(this,null),this.publish(\"yt-remote-cast2-session-change\",b))};\nf.oB=function(a,b){if(!this.ha())if(a)switch(hl(\"onReceiverAction_ \"+a.label+\" \/ \"+a.friendlyName+\"-- \"+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.k.label!=a.label)hl(\"onReceiverAction_: Stopping active receiver: \"+this.j.k.friendlyName),this.j.stop();else{hl(\"onReceiverAction_: Casting to active receiver.\");this.j.o&&this.publish(\"yt-remote-cast2-session-change\",this.j.o);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:jl(this,new cl(this.k,a));break;case chrome.cast.ReceiverType.DIAL:jl(this,\nnew $k(this.k,a));break;case chrome.cast.ReceiverType.CAST:jl(this,new Wk(this.k,a));break;default:this.Qa(\"Unknown receiver type: \"+a.receiverType);return}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.k.label==a.label?this.j.stop():this.Qa(\"Stopping receiver w\/o session: \"+a.friendlyName)}else this.Qa(\"onReceiverAction_ called without receiver.\")};\nf.sA=function(a){if(this.ha())return Promise.reject(Error(\"disposed\"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Qa(\"Not DIAL receiver: \"+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.k:null;if(!c||c.label!=b.label)return this.Qa(\"Receiving DIAL launch request for non-clicked DIAL receiver: \"+b.friendlyName),Promise.reject(Error(\"illegal DIAL launch\"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.j.o)return hl(\"Reselecting dial screen.\"),\nthis.publish(\"yt-remote-cast2-session-change\",this.j.o),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Qa('Changing CAST intent from \"'+c.receiverType+'\" to \"dial\" for '+b.friendlyName);jl(this,new $k(this.k,b))}b=this.j;b.F=a;return b.F.appState==chrome.cast.DialAppState.RUNNING?new Promise(x(b.$y,b,(b.F.extraData||{}).screenId||null)):new Promise(x(b.Sl,b))};\nf.fr=function(a){if(!this.ha()){hl(\"New cast session ID: \"+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(b.receiverType==chrome.cast.ReceiverType.CAST)hl(\"Got resumed cast session before resumed mdx connection.\"),jl(this,new Wk(this.k,b),!0);else{this.Qa(\"Got non-cast session without previous mdx receiver event, or mdx resume.\");return}var c=this.j.k,d=Sj(this.k.$b(),c.label);d&&ji(d,b.label)&&c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==\nchrome.cast.ReceiverType.CAST&&(hl(\"onSessionEstablished_: manual to cast session change \"+b.friendlyName),vi(this.j),this.j=new Wk(this.k,b),this.j.subscribe(\"sessionScreen\",x(this.gr,this,this.j)),this.j.Bf(null));this.j.Mm(a)}}};f.MD=function(){return this.j?this.j.Ns():null};f.AB=function(a){this.ha()||(this.Qa(\"Failed to estabilish a session: \"+ng(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&jl(this,null))};\nf.rB=function(a){hl(\"Receiver availability updated: \"+a);if(!this.ha()){var b=gl(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;gl(this)!=b&&this.publish(\"yt-remote-cast2-availability-change\",gl(this))}};\nfunction fl(a){var b=a.k.Ks(),c=a.j&&a.j.k;a=E(b,function(a){c&&ji(a,c.label)&&(c=null);var b=a.uuid?a.uuid:a.id,g=il(this,a);g?(g.label=b,g.friendlyName=a.name):(g=new chrome.cast.Receiver(b,a.name),g.receiverType=chrome.cast.ReceiverType.CUSTOM);return g},a);c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a}\nf.Ms=function(){if(!this.ha()){var a=gl(this);this.o=fl(this);hl(\"Updating custom receivers: \"+ng(this.o));chrome.cast.setCustomReceivers(this.o,v,x(function(){this.Qa(\"Failed to set custom receivers.\")},this));var b=gl(this);b!=a&&this.publish(\"yt-remote-cast2-availability-change\",b)}};dl.prototype.setLaunchParams=dl.prototype.UC;dl.prototype.setConnectedScreenStatus=dl.prototype.TC;dl.prototype.stopSession=dl.prototype.stopSession;dl.prototype.getCastSession=dl.prototype.MD;\ndl.prototype.requestSession=dl.prototype.requestSession;dl.prototype.init=dl.prototype.init;dl.prototype.dispose=dl.prototype.dispose;function kl(a,b,c){ll()?nl(b)&&(ol(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?pl(a,c):ij(function(b,e){b?pl(a,c):(ql(\"Failed to load cast API: \"+e),rl(!1),ol(!1),bj(\"yt-remote-cast-available\"),bj(\"yt-remote-cast-receiver\"),sl(),c(!1))})):ml(\"Cannot initialize because not running Chrome\")}function sl(){ml(\"dispose\");kj();var a=tl();a&&a.dispose();ul=null;q(\"yt.mdx.remote.cloudview.instance_\",null,void 0);vl(!1);Gi(wl);wl.length=0}function xl(){return!!aj(\"yt-remote-cast-installed\")}\nfunction yl(){var a=aj(\"yt-remote-cast-receiver\");return a?a.friendlyName:null}function zl(){return xl()?tl()?ul.getCastSession():(ql(\"getCastSelector: Cast is not initialized.\"),null):(ql(\"getCastSelector: Cast API is not installed!\"),null)}\nfunction Al(){xl()?tl()?Bl()?(ml(\"Requesting cast selector.\"),ul.requestSession()):(ml(\"Wait for cast API to be ready to request the session.\"),wl.push(Ei(\"yt-remote-cast2-api-ready\",Al))):ql(\"requestCastSelector: Cast is not initialized.\"):ql(\"requestCastSelector: Cast API is not installed!\")}function Cl(a){Bl()?tl().setLaunchParams(a):ql(\"setLaunchParams called before ready.\")}\nfunction Dl(){var a=El();Bl()?tl().setConnectedScreenStatus(a,\"YouTube TV\"):ql(\"setConnectedScreenStatus called before ready.\")}var ul=null;function ll(){var a;a=0<=Vc.search(\/\\ (CrMo|Chrome|CriOS)\\\/\/);return Vh||a}function Fl(a,b){ul.init(a,b)}\nfunction nl(a){var b=!1;if(!ul){var c=t(\"yt.mdx.remote.cloudview.instance_\");c||(c=new dl(a),c.subscribe(\"yt-remote-cast2-availability-change\",function(a){Zi(\"yt-remote-cast-available\",a);Hi(\"yt-remote-cast2-availability-change\",a)}),c.subscribe(\"yt-remote-cast2-receiver-selected\",function(a){ml(\"onReceiverSelected: \"+a.friendlyName);Zi(\"yt-remote-cast-receiver\",a);Hi(\"yt-remote-cast2-receiver-selected\",a)}),c.subscribe(\"yt-remote-cast2-receiver-resumed\",function(a){ml(\"onReceiverResumed: \"+a.friendlyName);\nZi(\"yt-remote-cast-receiver\",a)}),c.subscribe(\"yt-remote-cast2-session-change\",function(a){ml(\"onSessionChange: \"+oi(a));a||bj(\"yt-remote-cast-receiver\");Hi(\"yt-remote-cast2-session-change\",a)}),q(\"yt.mdx.remote.cloudview.instance_\",c,void 0),b=!0);ul=c}ml(\"cloudview.createSingleton_: \"+b);return b}function tl(){ul||(ul=t(\"yt.mdx.remote.cloudview.instance_\"));return ul}\nfunction pl(a,b){rl(!0);ol(!1);Fl(a,function(a){a?(vl(!0),Hi(\"yt-remote-cast2-api-ready\")):(ql(\"Failed to initialize cast API.\"),rl(!1),bj(\"yt-remote-cast-available\"),bj(\"yt-remote-cast-receiver\"),sl());b(a)})}function ml(a){fi(\"cloudview\",a)}function ql(a){fi(\"cloudview\",a)}function rl(a){ml(\"setCastInstalled_ \"+a);Zi(\"yt-remote-cast-installed\",a)}function Bl(){return!!t(\"yt.mdx.remote.cloudview.apiReady_\")}function vl(a){ml(\"setApiReady_ \"+a);q(\"yt.mdx.remote.cloudview.apiReady_\",a,void 0)}\nfunction ol(a){q(\"yt.mdx.remote.cloudview.initializing_\",a,void 0)}var wl=[];function Gl(a,b){this.action=a;this.params=b||null};function Hl(){if(!(\"cast\"in window))return!1;var a=window.cast||{};return\"ActivityStatus\"in a&&\"Api\"in a&&\"LaunchRequest\"in a&&\"Receiver\"in a}function Il(a){fi(\"CAST\",a)}function Jl(a){var b=Kl();b&&b.logMessage&&b.logMessage(a)}function Ll(a){if(a.source==window&&a.data&&\"CastApi\"==a.data.source&&\"Hello\"==a.data.event)for(;Ml.length;)Ml.shift()()}\nfunction Nl(){if(!t(\"yt.mdx.remote.castv2_\")&&!Ol&&(mb(Pl)&&ub(Pl,xk()),Hl())){var a=Kl();a?(a.removeReceiverListener(\"YouTube\",Ql),a.addReceiverListener(\"YouTube\",Ql),Il(\"API initialized in the other binary\")):(a=new cast.Api,Rl(a),a.addReceiverListener(\"YouTube\",Ql),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(function(){L(function(){window.location.reload(!0)},1E3)}),bi(Jl),Il(\"API initialized\"));Ol=!0}}\nfunction Sl(){var a=Kl();a&&(Il(\"API disposed\"),ei(Jl),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(v),a.removeReceiverListener(\"YouTube\",Ql),Rl(null));Ol=!1;Ml=null;(a=Eh(window,\"message\",Ll,!1))&&Gh(a)}function Tl(a){var b=jb(Pl,function(b){return b.id==a.id});0<=b&&(Pl[b]={id:a.id,name:a.name,activityId:a.activityId,status:a.status})}\nfunction Ql(a){a.length&&Il(\"Updating receivers: \"+ng(a));Ul(a);Hi(\"yt-remote-cast-device-list-update\");D(Vl(),function(a){Wl(a.id)});D(a,function(a){if(a.isTabProjected){var c=Xl(a.id);Il(\"Detected device: \"+c.id+\" is tab projected. Firing DEVICE_TAB_PROJECTED event.\");L(function(){Hi(\"yt-remote-cast-device-tab-projected\",c.id)},1E3)}})}\nfunction Yl(a,b){Il(\"Updating \"+a+\" activity status: \"+ng(b));var c=Xl(a);c?(b.activityId&&(c.activityId=b.activityId),c.status=\"running\"==b.status?\"RUNNING\":\"stopped\"==b.status?\"STOPPED\":\"error\"==b.status?\"ERROR\":\"UNKNOWN\",\"RUNNING\"!=c.status&&(c.activityId=\"\"),Tl(c),Hi(\"yt-remote-cast-device-status-update\",c)):Il(\"Device not found\")}function Vl(){Nl();return Pj(Pl)}\nfunction Ul(a){a=E(a,function(a){var c={id:a.id,name:Ia(a.name)};if(a=Xl(a.id))c.activityId=a.activityId,c.status=a.status;return c});nb(Pl);ub(Pl,a)}function Xl(a){var b=Vl();return F(b,function(b){return b.id==a})||null}function Wl(a){var b=Xl(a),c=Kl();c&&b&&b.activityId&&c.getActivityStatus(b.activityId,function(b){\"error\"==b.status&&(b.status=\"stopped\");Yl(a,b)})}\nfunction Zl(a){Nl();var b=Xl(a),c=Kl();c&&b&&b.activityId?(Il(\"Stopping cast activity\"),c.stopActivity(b.activityId,pa(Yl,a))):Il(\"Dropping cast activity stop\")}function Kl(){return t(\"yt.mdx.remote.castapi.api_\")}function Rl(a){q(\"yt.mdx.remote.castapi.api_\",a,void 0)}var Ol=!1,Ml=null,Pl=t(\"yt.mdx.remote.castapi.devices_\")||[];q(\"yt.mdx.remote.castapi.devices_\",Pl,void 0);function $l(){};function am(){this.j=y()}new am;am.prototype.set=function(a){this.j=a};am.prototype.get=function(){return this.j};function bm(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.k=!1;this.Ir=!0}bm.prototype.stopPropagation=function(){this.k=!0};bm.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Ir=!1};function cm(a){a.stopPropagation()};var dm=!cd||rd(9),em=cd&&!pd(\"9\");!ed||pd(\"528\");dd&&pd(\"1.9b\")||cd&&pd(\"8\")||bd&&pd(\"9.5\")||ed&&pd(\"528\");dd&&!pd(\"8\")||cd&&pd(\"9\");var fm=\"ontouchstart\"in m||!!(m.document&&document.documentElement&&\"ontouchstart\"in document.documentElement)||!(!m.navigator||!m.navigator.msMaxTouchPoints);function gm(a,b){bm.call(this,a?a.type:\"\");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.j=this.state=null;a&&this.init(a,b)}z(gm,bm);\ngm.prototype.init=function(a,b){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;d?dd&&(Bg(d,\"nodeName\")||(d=null)):\"mouseover\"==c?d=a.fromElement:\"mouseout\"==c&&(d=a.toElement);this.relatedTarget=d;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.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(\"keypress\"==c?a.keyCode:\n0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.j=a;a.defaultPrevented&&this.preventDefault()};gm.prototype.stopPropagation=function(){gm.J.stopPropagation.call(this);this.j.stopPropagation?this.j.stopPropagation():this.j.cancelBubble=!0};\ngm.prototype.preventDefault=function(){gm.J.preventDefault.call(this);var a=this.j;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,em)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};gm.prototype.D=function(){return this.j};var hm=\"closure_listenable_\"+(1E6*Math.random()|0);function im(a){return!(!a||!a[hm])}var jm=0;function km(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.cf=!!d;this.Oc=e;this.key=++jm;this.removed=this.Uh=!1}function lm(a){a.removed=!0;a.listener=null;a.proxy=null;a.src=null;a.Oc=null};function mm(a){this.src=a;this.j={};this.k=0}mm.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.j[g];a||(a=this.j[g]=[],this.k++);var h=nm(a,b,d,e);-1c.keyCode||void 0!=c.returnValue)){t:{var g=!1;if(0==c.keyCode)try{c.keyCode=-1;break t}catch(h){g=!0}if(g||void 0==c.returnValue)c.returnValue=!0}c=[];for(g=d.currentTarget;g;g=g.parentNode)c.push(g);for(var g=a.type,k=c.length-1;!d.k&&0<=k;k--){d.currentTarget=c[k];var l=Dm(c[k],g,!0,d),e=e&&l}for(k=0;!d.k&&k>>0);function um(a){if(ia(a))return a;a[Fm]||(a[Fm]=function(b){return a.handleEvent(b)});return a[Fm]};function U(){R.call(this);this.$c=new mm(this);this.na=this;this.X=null}z(U,R);U.prototype[hm]=!0;f=U.prototype;f.tj=function(a){this.X=a};f.addEventListener=function(a,b,c,d){tm(this,a,b,c,d)};f.removeEventListener=function(a,b,c,d){Bm(this,a,b,c,d)};\nf.U=function(a){var b,c=this.X;if(c){b=[];for(var d=1;c;c=c.X)b.push(c),++d}c=this.na;d=a.type||a;if(w(a))a=new bm(a,c);else if(a instanceof bm)a.target=a.target||c;else{var e=a;a=new bm(d,c);cc(a,e)}var e=!0,g;if(b)for(var h=b.length-1;!a.k&&0<=h;h--)g=a.currentTarget=b[h],e=Gm(g,d,!0,a)&&e;a.k||(g=a.currentTarget=c,e=Gm(g,d,!0,a)&&e,a.k||(e=Gm(g,d,!1,a)&&e));if(b)for(h=0;!a.k&&h=a.j.length)throw Error(\"Out of bounds exception\");return a.j.lengthb)break t}else if(3>b||3==b&&!bd&&!Ln(this.qb))break t;this.qe||4!=b||7==c||(8==c||0>=d?this.j.Ac(3):this.j.Ac(2));Mn(this);var e=this.qb.getStatus();this.xg=e;var g=Ln(this.qb);(this.Ec=200==e)?(4==b&&Nn(this),this.B?(On(this,b,g),bd&&this.Ec&&3==b&&(this.A.listen(this.k,\"tick\",this.DC),this.k.start())):Pn(this,g),this.Ec&&!this.qe&&(4==b?this.j.aj(this):(this.Ec=!1,Jn(this)))):\n(this.Ae=400==e&&0b.length)return Fn;var e=b.substr(d,c);a.eh=d+c;return e}\nfunction Tn(a,b){a.Qg=y();Jn(a);var c=b?window.location.hostname:\"\";a.Sd=a.zd.clone();K(a.Sd,\"DOMAIN\",c);K(a.Sd,\"t\",a.C);try{a.Hc=new ActiveXObject(\"htmlfile\")}catch(d){Nn(a);a.Ae=7;Qn();Rn(a);return}var e=\"\";b&&(e+='