(function(g){var window=this;'use strict';var Krb=function(a,b){a.ob("onAutonavCoundownStarted",b)},l6=function(a,b,c){g.bv(a.element,"ytp-suggestion-set",!!b.videoId); var d=b.playlistId;c=b.ih(c?c:"mqdefault.jpg");var e=null,f=null;b instanceof g.SS&&(b.lengthText?(e=b.lengthText||null,f=b.lw||null):b.lengthSeconds&&(e=g.dH(b.lengthSeconds),f=g.dH(b.lengthSeconds,!0)));var h=!!d;d=h&&"RD"===g.JRa(d).type;var l=b instanceof g.SS?b.isLivePlayback:null,m=b instanceof g.SS?b.isUpcoming:null,n=b.author,p=b.shortViewCount,q=b.publishedTimeText,r=[],t=[];n&&r.push(n);p&&(r.push(p),t.push(p));q&&t.push(q);c={title:b.title,author:n,author_and_views:r.join(" \u2022 "),aria_label:b.ariaLabel|| g.lK("Watch $TITLE",{TITLE:b.title}),duration:e,timestamp:f,url:b.Tk(),is_live:l,is_upcoming:m,is_list:h,is_mix:d,background:c?"background-image: url("+c+")":"",views_and_publish_time:t.join(" \u2022 "),autoplayAlternativeHeader:b.qs};b instanceof g.RS&&(c.playlist_length=b.playlistLength);a.update(c)},m6=function(a){var b=a.U(),c=b.D; g.U.call(this,{I:"a",S:"ytp-autonav-suggestion-card",X:{href:"{{url}}",target:c?b.Y:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},V:[{I:"div",La:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],X:{style:"{{background}}"},V:[{I:"div",X:{"aria-label":"{{timestamp}}"},La:["ytp-autonav-timestamp"],ya:"{{duration}}"},{I:"div",La:["ytp-autonav-live-stamp"],ya:"Live"},{I:"div", La:["ytp-autonav-upcoming-stamp"],ya:"Upcoming"},{I:"div",S:"ytp-autonav-list-overlay",V:[{I:"div",S:"ytp-autonav-mix-text",ya:"Mix"},{I:"div",S:"ytp-autonav-mix-icon"}]}]},{I:"div",La:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],ya:"{{title}}"},{I:"div",La:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],ya:"{{author}}"},{I:"div",La:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],ya:"{{views_and_publish_time}}"}]});this.J=a;this.suggestion= null;this.j=c;this.Ta("click",this.onClick);this.Ta("keypress",this.onKeyPress)},n6=function(a,b){b=void 0===b?!1:b; g.U.call(this,{I:"div",S:"ytp-autonav-endscreen-countdown-overlay"});var c=this;this.N=b;this.G=this.K=void 0;this.C=0;this.container=new g.U({I:"div",S:"ytp-autonav-endscreen-countdown-container"});g.I(this,this.container);this.container.Ja(this.element);b=a.U();var d=b.D;this.J=a;this.suggestion=null;this.onVideoDataChange("newdata",this.J.getVideoData());this.T(a,"videodatachange",this.onVideoDataChange);this.j=new g.U({I:"div",S:"ytp-autonav-endscreen-upnext-container",X:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},V:[{I:"div",S:"ytp-autonav-endscreen-upnext-header"},{I:"div",S:"ytp-autonav-endscreen-upnext-alternative-header",ya:"{{autoplayAlternativeHeader}}"},{I:"a",S:"ytp-autonav-endscreen-link-container",X:{href:"{{url}}",target:d?b.Y:""},V:[{I:"div",S:"ytp-autonav-endscreen-upnext-thumbnail",X:{style:"{{background}}"},V:[{I:"div",X:{"aria-label":"{{timestamp}}"},La:["ytp-autonav-timestamp"], ya:"{{duration}}"},{I:"div",La:["ytp-autonav-live-stamp"],ya:"Live"},{I:"div",La:["ytp-autonav-upcoming-stamp"],ya:"Upcoming"}]},{I:"div",S:"ytp-autonav-endscreen-video-info",V:[{I:"div",S:"ytp-autonav-endscreen-premium-badge"},{I:"div",S:"ytp-autonav-endscreen-upnext-title",ya:"{{title}}"},{I:"div",S:"ytp-autonav-endscreen-upnext-author",ya:"{{author}}"},{I:"div",S:"ytp-autonav-view-and-date",ya:"{{views_and_publish_time}}"},{I:"div",S:"ytp-autonav-author-and-view",ya:"{{author_and_views}}"}]}]}]}); g.I(this,this.j);this.j.Ja(this.container.element);d||this.T(this.j.Fa("ytp-autonav-endscreen-link-container"),"click",this.eT);this.J.createClientVe(this.container.element,this,115127);this.J.createClientVe(this.j.Fa("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.U({I:"div",S:"ytp-autonav-overlay"});g.I(this,this.overlay);this.overlay.Ja(this.container.element);this.B=new g.U({I:"div",S:"ytp-autonav-endscreen-button-container"});g.I(this,this.B);this.B.Ja(this.container.element); this.cancelButton=new g.U({I:"button",La:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",b.L("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{"aria-label":"Cancel autoplay"},ya:"Cancel"});g.I(this,this.cancelButton);this.cancelButton.Ja(this.B.element);this.cancelButton.Ta("click",this.D2,this);this.J.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.U({I:"a",La:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", b.L("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{href:"{{url}}",role:"button","aria-label":"Play next video"},ya:"Play Now"});g.I(this,this.playButton);this.playButton.Ja(this.B.element);this.playButton.Ta("click",this.eT,this);this.J.L("web_player_autonav_next_button_renderer")?(this.J.createServerVe(this.playButton.element,this.playButton,!0),(b=this.J.getVideoData())&&Lrb(this,b)):this.J.createClientVe(this.playButton.element,this,115130);this.D=new g.Qu(function(){Mrb(c)}, 500); g.I(this,this.D);this.dT();this.T(a,"autonavvisibility",this.dT);this.J.L("web_autonav_color_transition")&&(this.T(a,"autonavchange",this.C2),this.T(a,"onAutonavCoundownStarted",this.G9))},o6=function(a){var b=a.J.An(!0,a.J.isFullscreen()); g.bv(a.container.element,"ytp-autonav-endscreen-small-mode",a.Wg(b));g.bv(a.container.element,"ytp-autonav-endscreen-is-premium",!!a.suggestion&&!!a.suggestion.IK);g.bv(a.J.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!a.J.Nf());g.bv(a.J.getRootNode(),"countdown-running",a.Xk());g.bv(a.container.element,"ytp-player-content",a.J.Nf());g.ks(a.overlay.element,{width:b.width+"px"});if(!a.Xk()){a.J.Nf()?Nrb(a,Math.round(Orb(a)/1E3)):Nrb(a);b=!!a.suggestion&&!!a.suggestion.qs;var c=a.J.Nf()||!b; g.bv(a.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!c&&b);g.bv(a.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",c&&!b);g.kG(a.B,a.J.Nf());g.bv(a.element,"ytp-enable-w2w-color-transitions",Prb(a))}},Mrb=function(a){var b=Orb(a),c=Math,d=c.min; var e=a.C?Date.now()-a.C:0;c=d.call(c,e,b);Nrb(a,Math.ceil((b-c)/1E3));500>=b-c&&a.Xk()?a.select(!0):a.Xk()&&a.D.start()},Orb=function(a){if(a.J.isFullscreen()){var b; a=null==(b=a.J.getVideoData())?void 0:b.PB;return-1===a||void 0===a?8E3:a}return 0<=a.J.Ns()?a.J.Ns():g.wJ(a.J.U().experiments,"autoplay_time")||1E4},Lrb=function(a,b){a.J.L("web_player_autonav_next_button_renderer"); b=b.I6;a.K=null==b?void 0:b.navigationEndpoint;b=null==b?void 0:b.trackingParams;a.playButton&&b&&a.J.setTrackingParams(a.playButton.element,b)},Prb=function(a){var b; return!(null==(b=a.J.getVideoData())||!b.watchToWatchTransitionRenderer)},Nrb=function(a,b){b=void 0===b?-1:b; a=a.j.Fa("ytp-autonav-endscreen-upnext-header");g.xf(a);if(0<=b){b=String(b);var c="Up next in $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],d="Up next in $SECONDS".indexOf(c);if(0<=d){a.appendChild(g.vf("Up next in $SECONDS".slice(0,d)));var e=g.mf("span");g.Wu(e,"ytp-autonav-endscreen-upnext-header-countdown-number");g.Cf(e,b);a.appendChild(e);a.appendChild(g.vf("Up next in $SECONDS".slice(d+c.length)));return}}g.Cf(a,"Up next")},p6=function(a,b){g.U.call(this,{I:"div", La:["html5-endscreen","ytp-player-content",b||"base-endscreen"]});this.created=!1;this.player=a},q6=function(a){g.U.call(this,{I:"div", La:["ytp-upnext","ytp-player-content"],X:{"aria-label":"{{aria_label}}"},V:[{I:"div",S:"ytp-cued-thumbnail-overlay-image",X:{style:"{{background}}"}},{I:"span",S:"ytp-upnext-top",V:[{I:"span",S:"ytp-upnext-header",ya:"Up Next"},{I:"span",S:"ytp-upnext-title",ya:"{{title}}"},{I:"span",S:"ytp-upnext-author",ya:"{{author}}"}]},{I:"a",S:"ytp-upnext-autoplay-icon",X:{role:"button",href:"{{url}}","aria-label":"Play next video"},V:[{I:"svg",X:{height:"100%",version:"1.1",viewBox:"0 0 72 72",width:"100%"}, V:[{I:"circle",S:"ytp-svg-autoplay-circle",X:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{I:"circle",S:"ytp-svg-autoplay-ring",X:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{I:"path",S:"ytp-svg-fill",X:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{I:"span",S:"ytp-upnext-bottom",V:[{I:"span",S:"ytp-upnext-cancel"},{I:"span",S:"ytp-upnext-paused", ya:"Autoplay is paused"}]}]});this.api=a;this.cancelButton=null;this.G=this.Fa("ytp-svg-autoplay-ring");this.C=this.notification=this.j=this.suggestion=null;this.D=new g.Qu(this.kH,5E3,this);this.B=0;var b=this.Fa("ytp-upnext-cancel");this.cancelButton=new g.U({I:"button",La:["ytp-upnext-cancel-button","ytp-button"],X:{tabindex:"0","aria-label":"Cancel autoplay"},ya:"Cancel"});g.I(this,this.cancelButton);this.cancelButton.Ta("click",this.E2,this);this.cancelButton.Ja(b);this.cancelButton&&this.api.createClientVe(this.cancelButton.element, this,115129);g.I(this,this.D);this.api.createClientVe(this.element,this,18788);b=this.Fa("ytp-upnext-autoplay-icon");this.T(b,"click",this.F2);this.api.createClientVe(b,this,115130);this.fT();this.T(a,"autonavvisibility",this.fT);this.T(a,"mdxnowautoplaying",this.r$);this.T(a,"mdxautoplaycanceled",this.s$);g.bv(this.element,"ytp-upnext-mobile",this.api.U().B)},Qrb=function(a,b){if(b)return b; if(a.api.isFullscreen()){var c;a=null==(c=a.api.getVideoData())?void 0:c.PB;return-1===a||void 0===a?8E3:a}return 0<=a.api.Ns()?a.api.Ns():g.wJ(a.api.U().experiments,"autoplay_time")||1E4},Rrb=function(a,b){b=Qrb(a,b); var c=Math,d=c.min;var e=(0,g.AD)()-a.B;c=d.call(c,e,b);b=0===b?1:Math.min(c/b,1);a.G.setAttribute("stroke-dashoffset",""+-211*(b+1));1<=b&&a.Xk()&&3!==a.api.getPresentingPlayerType()?a.select(!0):a.Xk()&&a.j.start()},r6=function(a){p6.call(this,a,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.U({I:"div",S:"ytp-suggestion-panel",V:[{I:"div",La:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],ya:"More videos"}]});this.N=new g.U({I:"div",S:"ytp-suggestions-container"});this.videos=[];this.C=null;this.G=this.K=!1;this.B=new n6(this.player);g.I(this,this.B);this.B.Ja(this.element);a.getVideoData().Xf?this.j=this.B:(this.j=new q6(a),g.yU(this.player,this.j.element,4),g.I(this,this.j));this.overlay=new g.U({I:"div", S:"ytp-autonav-overlay-cancelled-state"});g.I(this,this.overlay);this.overlay.Ja(this.element);this.D=new g.TK(this);g.I(this,this.D);g.I(this,this.table);this.table.Ja(this.element);this.table.show();g.I(this,this.N);this.N.Ja(this.table.element);this.hide()},s6=function(a){var b=a.Nf(); b!==a.G&&(a.G=b,a.player.ra("autonavvisibility"),a.G?(a.B!==a.j&&a.B.hide(),a.table.hide()):(a.B!==a.j&&a.B.show(),a.table.show()))},t6=function(a,b){g.U.call(this,{I:"button", La:["ytp-watch-on-youtube-button","ytp-button"],ya:"{{content}}"});this.J=a;this.buttonType=this.buttonType=b;this.T_();2===this.buttonType&&g.Yu(this.element,"ytp-continue-watching-button");this.Ta("click",this.onClick);this.Ta("videodatachange",this.T_);g.kG(this,!0)},u6=function(a,b){p6.call(this,a,"embeds-lite-endscreen"); this.J=a;this.bf=b;this.J.createClientVe(this.element,this,156943);this.watchButton=new t6(a,2);g.I(this,this.watchButton);this.watchButton.Ja(this.element);this.hide()},Srb=function(a){p6.call(this,a,"subscribecard-endscreen"); this.j=new g.U({I:"div",S:"ytp-subscribe-card",V:[{I:"img",S:"ytp-author-image",X:{src:"{{profilePicture}}"}},{I:"div",S:"ytp-subscribe-card-right",V:[{I:"div",S:"ytp-author-name",ya:"{{author}}"},{I:"div",S:"html5-subscribe-button-container"}]}]});g.I(this,this.j);this.j.Ja(this.element);var b=a.getVideoData();this.subscribeButton=new g.IW("Subscribe",null,"Unsubscribe",null,!0,!1,b.Gl,b.subscribed,"trailer-endscreen",null,a,!1);g.I(this,this.subscribeButton);this.subscribeButton.Ja(this.j.Fa("html5-subscribe-button-container")); this.T(a,"videodatachange",this.Sa);this.Sa();this.hide()},v6=function(a){var b=a.U(),c=g.RK||g.dS?{style:"will-change: opacity"}:void 0,d=b.D,e=["ytp-videowall-still"]; b.B&&e.push("ytp-videowall-show-text");g.U.call(this,{I:"a",La:e,X:{href:"{{url}}",target:d?b.Y:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},V:[{I:"div",S:"ytp-videowall-still-image",X:{style:"{{background}}"}},{I:"span",S:"ytp-videowall-still-info",X:{"aria-hidden":"true"},V:[{I:"span",S:"ytp-videowall-still-info-bg",V:[{I:"span",S:"ytp-videowall-still-info-content",X:c,V:[{I:"span",S:"ytp-videowall-still-info-title",ya:"{{title}}"}, {I:"span",S:"ytp-videowall-still-info-author",ya:"{{author_and_views}}"},{I:"span",S:"ytp-videowall-still-info-live",ya:"Live"},{I:"span",S:"ytp-videowall-still-info-duration",ya:"{{duration}}"}]}]}]},{I:"span",La:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},V:[{I:"span",S:"ytp-videowall-still-listlabel-icon"},"Playlist",{I:"span",S:"ytp-videowall-still-listlabel-length",V:[" (",{I:"span",ya:"{{playlist_length}}"},")"]}]},{I:"span",La:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},V:[{I:"span",S:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{I:"span",S:"ytp-videowall-still-listlabel-length",ya:" (50+)"}]}]});this.suggestion=null;this.B=d;this.api=a;this.j=new g.TK(this);g.I(this,this.j);this.Ta("click",this.onClick);this.Ta("keypress",this.onKeyPress);this.j.T(a,"videodatachange",this.onVideoDataChange);a.createServerVe(this.element,this);this.onVideoDataChange()},w6=function(a){p6.call(this,a,"videowall-endscreen"); var b=this;this.J=a;this.C=0;this.stills=[];this.D=this.videoData=null;this.G=this.N=!1;this.Y=null;this.B=new g.TK(this);g.I(this,this.B);this.K=new g.Qu(function(){g.Yu(b.element,"ytp-show-tiles")},0); g.I(this,this.K);var c=new g.U({I:"button",La:["ytp-button","ytp-endscreen-previous"],X:{"aria-label":"Previous"},V:[g.qG()]});g.I(this,c);c.Ja(this.element);c.Ta("click",this.J2,this);this.table=new g.bG({I:"div",S:"ytp-endscreen-content"});g.I(this,this.table);this.table.Ja(this.element);c=new g.U({I:"button",La:["ytp-button","ytp-endscreen-next"],X:{"aria-label":"Next"},V:[g.rG()]});g.I(this,c);c.Ja(this.element);c.Ta("click",this.I2,this);a.getVideoData().Xf?this.j=new n6(a,!0):this.j=new q6(a); g.I(this,this.j);g.yU(this.player,this.j.element,4);a.createClientVe(this.element,this,158789);this.hide()},x6=function(a){return g.zU(a.player)&&a.KC()&&!a.D},y6=function(a){var b=a.Nf(); b!==a.N&&(a.N=b,a.player.ra("autonavvisibility"))},z6=function(a){p6.call(this,a,"watch-again-on-youtube-endscreen"); this.watchButton=new t6(a,1);g.I(this,this.watchButton);this.watchButton.Ja(this.element);g.egb(a)&&(this.j=new g.y2(a),g.I(this,this.j),this.B=new g.U({I:"div",La:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],X:{tabIndex:"-1"},V:[this.j]}),g.I(this,this.B),this.j.Ja(this.B.element),this.B.Ja(this.element));a.createClientVe(this.element,this,156914);this.hide()},Wrb=function(a){g.aW.call(this,a); var b=this;this.endScreen=null;this.B=this.j=this.C=this.D=!1;this.listeners=new g.TK(this);g.I(this,this.listeners);var c=a.U(),d=a.getVideoData();d=d&&0!==d.limitedPlaybackDurationInSeconds;g.BC(g.mS(c))&&d&&!g.vU(a)?(this.B=!0,this.endScreen=new u6(a,g.mU(a))):a.md()?this.endScreen=new z6(a):Trb(a)?(this.D=!0,Urb(this),this.j?this.endScreen=new r6(a):this.endScreen=new w6(a)):c.Zg?this.endScreen=new Srb(a):this.endScreen=new p6(a);g.I(this,this.endScreen);g.yU(a,this.endScreen.element,4);Vrb(this); this.listeners.T(a,"videodatachange",this.onVideoDataChange,this);this.listeners.T(a,g.fK("endscreen"),function(e){b.onCueRangeEnter(e)}); this.listeners.T(a,g.gK("endscreen"),function(e){b.onCueRangeExit(e)})},Urb=function(a){var b=a.player.getVideoData(); if(!b||a.j===b.Ll&&a.C===b.Xf)return!1;a.j=b.Ll;a.C=b.Xf;return!0},Trb=function(a){a=a.U(); return a.me&&!a.Zg},Vrb=function(a){a.player.Cf("endscreen"); var b=a.player.getVideoData();b=new g.eK(Math.max(1E3*(b.lengthSeconds-10),0),0x8000000000000,{id:"preload",namespace:"endscreen"});var c=new g.eK(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});a.player.yf([b,c])}; g.rU.prototype.Ns=g.da(16,function(){return this.app.Ns()}); g.b1.prototype.Ns=g.da(15,function(){return this.getVideoData().XU}); g.nU.prototype.Dr=g.da(14,function(a){this.Fi().Dr(a)}); g.iX.prototype.Dr=g.da(13,function(a){this.j!==a&&(this.j=a,this.Sa())}); g.pY.prototype.Dr=g.da(12,function(a){this.overflowButton&&this.overflowButton.Dr(a)}); g.nU.prototype.Er=g.da(11,function(a){this.Fi().Er(a)}); g.nX.prototype.Er=g.da(10,function(a){this.j!==a&&(this.j=a,this.Sa())}); g.pY.prototype.Er=g.da(9,function(a){this.shareButton&&this.shareButton.Er(a)}); g.nU.prototype.nB=g.da(8,function(a){this.Fi().nB(a)}); g.BW.prototype.nB=g.da(7,function(a){this.MQ!==a&&(this.MQ=a,this.eq())}); g.nU.prototype.mB=g.da(6,function(a){this.Fi().mB(a)}); g.pY.prototype.mB=g.da(5,function(a){this.LQ!==a&&(this.LQ=a,this.cq())});g.w(m6,g.U);m6.prototype.select=function(){this.J.Ko(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.fD||void 0)&&this.J.logClick(this.element)}; m6.prototype.onClick=function(a){g.jV(a,this.J,this.j,this.suggestion.sessionData||void 0)&&this.select()}; m6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:a.defaultPrevented||(this.select(),a.preventDefault())}};g.w(n6,g.U);g.k=n6.prototype;g.k.xG=function(a){this.suggestion!==a&&(this.suggestion=a,l6(this.j,a),this.playButton.updateValue("url",this.suggestion.Tk()),o6(this))}; g.k.Xk=function(){return 0a.width||459>a.height};g.w(p6,g.U);g.k=p6.prototype;g.k.create=function(){this.created=!0}; g.k.destroy=function(){this.created=!1}; g.k.KC=function(){return!1}; g.k.Nf=function(){return!1}; g.k.hY=function(){return!1};g.w(q6,g.U);g.k=q6.prototype;g.k.kH=function(){this.notification&&(this.D.stop(),this.Uc(this.C),this.C=null,this.notification.close(),this.notification=null)}; g.k.xG=function(a){this.suggestion=a;l6(this,a,"hqdefault.jpg")}; g.k.fT=function(){g.kG(this,this.api.Nf());this.api.logVisibility(this.element,this.api.Nf());this.api.logVisibility(this.Fa("ytp-upnext-autoplay-icon"),this.api.Nf());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.Nf())}; g.k.A$=function(){window.focus();this.kH()}; g.k.vB=function(a){var b=this;this.Xk()||(g.KE("a11y-announce","Up Next "+this.suggestion.title),this.B=(0,g.AD)(),this.j=new g.Qu(function(){Rrb(b,a)},25),Rrb(this,a),Krb(this.api,Qrb(this,a))); g.$u(this.element,"ytp-upnext-autoplay-paused")}; g.k.hide=function(){g.U.prototype.hide.call(this)}; g.k.Xk=function(){return!!this.j}; g.k.Uw=function(){this.Yp();this.B=(0,g.AD)();Rrb(this);g.Yu(this.element,"ytp-upnext-autoplay-paused")}; g.k.Yp=function(){this.Xk()&&(this.j.dispose(),this.j=null)}; g.k.select=function(a){a=void 0===a?!1:a;if(this.api.U().L("autonav_notifications")&&a&&window.Notification&&"function"===typeof document.hasFocus){var b=Notification.permission;"default"===b?Notification.requestPermission():"granted"!==b||document.hasFocus()||(this.kH(),this.notification=new Notification("Up Next",{body:this.suggestion.title,icon:this.suggestion.ih()}),this.C=this.T(this.notification,"click",this.A$),this.D.start())}this.Yp();this.api.nextVideo(!1,a)}; g.k.F2=function(a){!g.Bf(this.cancelButton.element,a.target)&&g.jV(a,this.api)&&(this.api.Nf()&&this.api.logClick(this.Fa("ytp-upnext-autoplay-icon")),this.select())}; g.k.E2=function(){this.api.Nf()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.tU(this.api,!0)}; g.k.r$=function(a){this.api.getPresentingPlayerType();this.show();this.vB(a)}; g.k.s$=function(){this.api.getPresentingPlayerType();this.Yp();this.hide()}; g.k.xa=function(){this.Yp();this.kH();g.U.prototype.xa.call(this)};g.w(r6,p6);g.k=r6.prototype;g.k.create=function(){p6.prototype.create.call(this);this.D.T(this.player,"appresize",this.WB);this.D.T(this.player,"onVideoAreaChange",this.WB);this.D.T(this.player,"videodatachange",this.onVideoDataChange);this.D.T(this.player,"autonavchange",this.gT);this.D.T(this.player,"onAutonavCancelled",this.G2);this.onVideoDataChange()}; g.k.show=function(){p6.prototype.show.call(this);(this.K||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.tU(this.player,!1);g.zU(this.player)&&this.KC()&&!this.C?(s6(this),2===this.videoData.autonavState?3===this.player.getVisibilityState()?this.j.select(!0):this.j.vB():3===this.videoData.autonavState&&this.j.Uw()):(g.tU(this.player,!0),s6(this));this.WB()}; g.k.hide=function(){p6.prototype.hide.call(this);this.j.Uw();s6(this)}; g.k.WB=function(){var a=this.player.An(!0,this.player.isFullscreen());s6(this);o6(this.B);g.bv(this.element,"ytp-autonav-cancelled-small-mode",this.Wg(a));g.bv(this.element,"ytp-autonav-cancelled-tiny-mode",this.KI(a));g.bv(this.element,"ytp-autonav-cancelled-mini-mode",400>=a.width||360>=a.height);this.overlay&&g.ks(this.overlay.element,{width:a.width+"px"});if(!this.G)for(a=0;aa.width||459>a.height)&&!this.KI(a)&&!(400>=a.width||360>=a.height)}; g.k.KI=function(a){return 800>a.width&&!(400>=a.width||360>=a.height)}; g.k.Nf=function(){return this.Kb&&g.zU(this.player)&&this.KC()&&!this.C}; var Xrb=[1,3,2,4];g.w(t6,g.U);g.k=t6.prototype;g.k.T_=function(){switch(this.buttonType){case 1:var a="Watch again on YouTube";var b=156915;break;case 2:a="Continue watching on YouTube";b=156942;break;default:a="Continue watching on YouTube",b=156942}this.update({content:a});this.J.hasVe(this.element)&&this.J.destroyVe(this.element);this.J.createClientVe(this.element,this,b)}; g.k.onClick=function(a){this.J.L("web_player_log_click_before_generating_ve_conversion_params")&&this.J.logClick(this.element);g.kV(this.getVideoUrl(),this.J,a);this.J.L("web_player_log_click_before_generating_ve_conversion_params")||this.J.logClick(this.element)}; g.k.getVideoUrl=function(){var a=!0;switch(this.buttonType){case 1:a=!0;break;case 2:a=!1}a=this.J.getVideoUrl(a,!1,!1,!0);var b=this.J.U();if(g.eS(b)){var c={};g.eS(b)&&g.gU(this.J,"addEmbedsConversionTrackingParams",[c]);a:{switch(this.buttonType){case 2:b="emb_ytp_continue_watching";break a}b="emb_ytp_watch_again"}g.zP(c,b);a=g.Pm(a,c)}return a}; g.k.logVisibility=function(){this.J.logVisibility(this.element,this.Kb&&this.Z)}; g.k.show=function(){g.U.prototype.show.call(this);this.logVisibility()}; g.k.hide=function(){g.U.prototype.hide.call(this);this.logVisibility()}; g.k.Oc=function(a){g.U.prototype.Oc.call(this,a);this.logVisibility()};g.w(u6,p6);u6.prototype.show=function(){3!==this.player.getPlayerState()&&(p6.prototype.show.call(this),this.bf.mB(!0),this.bf.Er(!0),this.J.U().Fe||this.bf.Dr(!0),this.J.logVisibility(this.element,!0),this.watchButton.Oc(!0))}; u6.prototype.hide=function(){p6.prototype.hide.call(this);this.bf.mB(!1);this.bf.Er(!1);this.bf.Dr(!1);this.J.logVisibility(this.element,!1);this.watchButton.Oc(!1)};g.w(Srb,p6);Srb.prototype.Sa=function(){var a=this.player.getVideoData();this.j.update({profilePicture:a.profilePicture,author:a.author});this.subscribeButton.channelId=a.Gl;var b=this.subscribeButton;a.subscribed?b.j():b.B()};g.w(v6,g.U);v6.prototype.select=function(){this.api.Ko(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.fD||void 0)&&this.api.logClick(this.element)}; v6.prototype.onClick=function(a){if(g.eS(this.api.U())&&this.api.L("web_player_log_click_before_generating_ve_conversion_params")){this.api.logClick(this.element);var b=this.suggestion.Tk(),c={};g.cUa(this.api,c,"emb_rel_end");b=g.Pm(b,c);g.kV(b,this.api,a)}else g.jV(a,this.api,this.B,this.suggestion.sessionData||void 0)&&this.select()}; v6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:a.defaultPrevented||(this.select(),a.preventDefault())}}; v6.prototype.onVideoDataChange=function(){var a=this.api.getVideoData(),b=this.api.U();this.B=a.Pf?!1:b.D};g.w(w6,p6);g.k=w6.prototype;g.k.create=function(){p6.prototype.create.call(this);var a=this.player.getVideoData();a&&(this.videoData=a);this.iq();this.B.T(this.player,"appresize",this.iq);this.B.T(this.player,"onVideoAreaChange",this.iq);this.B.T(this.player,"videodatachange",this.onVideoDataChange);this.B.T(this.player,"autonavchange",this.CL);this.B.T(this.player,"onAutonavCancelled",this.H2);a=this.videoData.autonavState;a!==this.Y&&this.CL(a);this.B.T(this.element,"transitionend",this.Saa)}; g.k.destroy=function(){g.QC(this.B);g.xb(this.stills);this.stills=[];p6.prototype.destroy.call(this);g.$u(this.element,"ytp-show-tiles");this.K.stop();this.Y=this.videoData.autonavState}; g.k.KC=function(){return 1!==this.videoData.autonavState}; g.k.show=function(){var a=this.Kb;p6.prototype.show.call(this);g.$u(this.element,"ytp-show-tiles");this.player.U().B?g.Su(this.K):this.K.start();(this.G||this.D&&this.D!==this.videoData.clientPlaybackNonce)&&g.tU(this.player,!1);x6(this)?(y6(this),2===this.videoData.autonavState?3===this.player.getVisibilityState()?this.j.select(!0):this.j.vB():3===this.videoData.autonavState&&this.j.Uw()):(g.tU(this.player,!0),y6(this));a!==this.Kb&&this.player.logVisibility(this.element,!0)}; g.k.hide=function(){var a=this.Kb;p6.prototype.hide.call(this);this.j.Uw();y6(this);a!==this.Kb&&this.player.logVisibility(this.element,!1)}; g.k.Saa=function(a){a.target===this.element&&this.iq()}; g.k.iq=function(){var a,b,c,d;var e=(null==(a=this.videoData)?0:null==(b=a.suggestions)?0:b.length)?null==(c=this.videoData)?void 0:c.suggestions:[null==(d=this.videoData)?void 0:g.sT(d)];if(e.length){g.Yu(this.element,"ytp-endscreen-paginate");var f=this.J.An(!0,this.J.isFullscreen());if(a=g.mU(this.J))a=a.Dh()?48:32,f.width-=2*a;var h=f.width/f.height;d=96/54;b=a=2;var l=Math.max(f.width/96,2),m=Math.max(f.height/54,2);c=e.length;var n=Math.pow(2,2);var p=c*n+(Math.pow(2,2)-n);p+=Math.pow(2,2)- n;for(p-=n;0=r*n,v=b<=m-2&&p>=q*n;if((q+1)/r*d/h>h/(q/(r+1)*d)&&v)p-=q*n,b+=2;else if(t)p-=r*n,a+=2;else if(v)p-=q*n,b+=2;else break}d=!1;p>=3*n&&6>=c*n-p&&(4<=b||4<=a)&&(d=!0);n=96*a;p=54*b;h=n/p=a-2&&m>=b-2?t=1:0===m%2&&0===l%2&&(2>m&&2>l?0===m&&0===l&&(t=2):t=2),q=g.xe(q+this.C,c),0!==t){r=this.stills[h];r||(r=new v6(this.player),this.stills[h]=r,f.appendChild(r.element));v=Math.floor(p*m/b);var x=Math.floor(n*l/a),A=Math.floor(p*(m+t)/b)-v-4,E=Math.floor(n*(l+t)/a)-x-4;g.qs(r.element,x,v);g.vs(r.element,E,A);g.ks(r.element,"transitionDelay", (m+l)/20+"s");g.bv(r.element,"ytp-videowall-still-mini",1===t);g.bv(r.element,"ytp-videowall-still-large",2t);g.bv(r.element,"ytp-videowall-still-round-small",96>=t);q=e[q];r.suggestion!==q&&(r.suggestion=q,t=r.api.U(),v=g.Xu(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",l6(r,q,v),g.eS(t)&&!r.api.L("web_player_log_click_before_generating_ve_conversion_params")&& (t=q.Tk(),v={},g.gU(r.api,"addEmbedsConversionTrackingParams",[v]),t=g.Pm(t,g.zP(v,"emb_rel_end")),r.updateValue("url",t)),(q=(q=q.sessionData)&&q.itct)&&r.api.setTrackingParams(r.element,q));h++}f.ariaBusy="false";g.bv(this.element,"ytp-endscreen-paginate",h=h;e--)a=this.stills[e],g.zf(a.element),g.vb(a);this.stills.length=h}}; g.k.onVideoDataChange=function(){var a=this.player.getVideoData();this.videoData!==a&&(this.C=0,this.videoData=a,this.iq())}; g.k.I2=function(){this.C+=this.stills.length;this.iq()}; g.k.J2=function(){this.C-=this.stills.length;this.iq()}; g.k.hY=function(){return this.j.Xk()}; g.k.CL=function(a){1===a?(this.G=!1,this.D=this.videoData.clientPlaybackNonce,this.j.Yp(),this.Kb&&this.iq()):(this.G=!0,this.Kb&&x6(this)&&(2===a?this.j.vB():3===a&&this.j.Uw()))}; g.k.H2=function(a){if(a){for(a=0;a