(function(g){var window=this;'use strict';var k5g=function(k,y){k.Sb("onAutonavCoundownStarted",y)},UM=function(k,y,q){g.fD(k.element,"ytp-suggestion-set",!!y.videoId); var N=y.playlistId;q=y.eU(q?q:"mqdefault.jpg");var D=null,n=null;y instanceof g.UE&&(y.lengthText?(D=y.lengthText||null,n=y.qe||null):y.lengthSeconds&&(D=g.g7(y.lengthSeconds),n=g.g7(y.lengthSeconds,!0)));var T=!!N;N=T&&g.Vw(N).type==="RD";var I=y instanceof g.UE?y.isLivePlayback:null,H=y instanceof g.UE?y.isUpcoming:null,K=y.author,A=y.shortViewCount,c=y.publishedTimeText,u=[],a=[];K&&u.push(K);A&&(u.push(A),a.push(A));c&&a.push(c);q={title:y.title,author:K,author_and_views:u.join(" \u2022 "),aria_label:y.ariaLabel|| g.Qo("Watch $TITLE",{TITLE:y.title}),duration:D,timestamp:n,url:y.gV(),is_live:I,is_upcoming:H,is_list:T,is_mix:N,background:q?"background-image: url("+q+")":"",views_and_publish_time:a.join(" \u2022 "),autoplayAlternativeHeader:y.fJ};y instanceof g.Bt&&(q.playlist_length=y.playlistLength);k.update(q)},QJ=function(k){var y=k.S(),q=y.V; g.R.call(this,{X:"a",D:"ytp-autonav-suggestion-card",K:{href:"{{url}}",target:q?y.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},L:[{X:"div",jb:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],K:{style:"{{background}}"},L:[{X:"div",K:{"aria-label":"{{timestamp}}"},jb:["ytp-autonav-timestamp"],oO:"{{duration}}"},{X:"div",jb:["ytp-autonav-live-stamp"],oO:"Live"},{X:"div", jb:["ytp-autonav-upcoming-stamp"],oO:"Upcoming"},{X:"div",D:"ytp-autonav-list-overlay",L:[{X:"div",D:"ytp-autonav-mix-text",oO:"Mix"},{X:"div",D:"ytp-autonav-mix-icon"}]}]},{X:"div",jb:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],oO:"{{title}}"},{X:"div",jb:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],oO:"{{author}}"},{X:"div",jb:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],oO:"{{views_and_publish_time}}"}]});this.G=k;this.suggestion= null;this.Z=q;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},Mh=function(k,y){y=y===void 0?!1:y; g.R.call(this,{X:"div",D:"ytp-autonav-endscreen-countdown-overlay"});var q=this;this.B=y;this.cancelCommand=this.j=void 0;this.C=0;this.container=new g.R({X:"div",D:"ytp-autonav-endscreen-countdown-container"});g.G(this,this.container);this.container.FH(this.element);y=k.S();var N=y.V;this.G=k;this.suggestion=null;this.onVideoDataChange("newdata",this.G.getVideoData());this.T(k,"videodatachange",this.onVideoDataChange);this.Z=new g.R({X:"div",D:"ytp-autonav-endscreen-upnext-container",K:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},L:[{X:"div",D:"ytp-autonav-endscreen-upnext-header"},{X:"div",D:"ytp-autonav-endscreen-upnext-alternative-header",oO:"{{autoplayAlternativeHeader}}"},{X:"a",D:"ytp-autonav-endscreen-link-container",K:{href:"{{url}}",target:N?y.U:""},L:[{X:"div",D:"ytp-autonav-endscreen-upnext-thumbnail",K:{style:"{{background}}"},L:[{X:"div",K:{"aria-label":"{{timestamp}}"},jb:["ytp-autonav-timestamp"], oO:"{{duration}}"},{X:"div",jb:["ytp-autonav-live-stamp"],oO:"Live"},{X:"div",jb:["ytp-autonav-upcoming-stamp"],oO:"Upcoming"}]},{X:"div",D:"ytp-autonav-endscreen-video-info",L:[{X:"div",D:"ytp-autonav-endscreen-premium-badge"},{X:"div",D:"ytp-autonav-endscreen-upnext-title",oO:"{{title}}"},{X:"div",D:"ytp-autonav-endscreen-upnext-author",oO:"{{author}}"},{X:"div",D:"ytp-autonav-view-and-date",oO:"{{views_and_publish_time}}"},{X:"div",D:"ytp-autonav-author-and-view",oO:"{{author_and_views}}"}]}]}]}); g.G(this,this.Z);this.Z.FH(this.container.element);N||this.T(this.Z.nS("ytp-autonav-endscreen-link-container"),"click",this.Jt);this.G.createClientVe(this.container.element,this,115127);this.G.createClientVe(this.Z.nS("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.R({X:"div",D:"ytp-autonav-overlay"});g.G(this,this.overlay);this.overlay.FH(this.container.element);this.N=new g.R({X:"div",D:"ytp-autonav-endscreen-button-container"});g.G(this,this.N);this.N.FH(this.container.element); this.cancelButton=new g.R({X:"button",jb:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",y.W("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{"aria-label":"Cancel autoplay"},oO:"Cancel"});g.G(this,this.cancelButton);this.cancelButton.FH(this.N.element);this.cancelButton.listen("click",this.Jx,this);this.G.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.R({X:"a",jb:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", y.W("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{href:"{{url}}",role:"button","aria-label":"Play next video"},oO:"Play Now"});g.G(this,this.playButton);this.playButton.FH(this.N.element);this.playButton.listen("click",this.Jt,this);this.G.W("web_player_autonav_next_button_renderer")?(this.G.createServerVe(this.playButton.element,this.playButton,!0),(y=this.G.getVideoData())&&y4N(this,y)):this.G.createClientVe(this.playButton.element,this,115130);this.V=new g.c3(function(){q2L(q)}, 500); g.G(this,this.V);this.Sh();this.T(k,"autonavvisibility",this.Sh);this.G.W("web_autonav_color_transition")&&(this.T(k,"autonavchange",this.S_),this.T(k,"onAutonavCoundownStarted",this.C2x))},FB=function(k){var y=k.G.No(!0,k.G.isFullscreen()); g.fD(k.container.element,"ytp-autonav-endscreen-small-mode",k.uO(y));g.fD(k.container.element,"ytp-autonav-endscreen-is-premium",!!k.suggestion&&!!k.suggestion.EgS);g.fD(k.G.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!k.G.xR());g.fD(k.G.getRootNode(),"countdown-running",k.nH());g.fD(k.container.element,"ytp-player-content",k.G.xR());g.fW(k.overlay.element,{width:y.width+"px"});if(!k.nH()){k.G.xR()?N1F(k,Math.round(DOG(k)/1E3)):N1F(k);y=!!k.suggestion&&!!k.suggestion.fJ;var q=k.G.xR()|| !y;g.fD(k.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!q&&y);g.fD(k.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",q&&!y);k.N.xz(k.G.xR());g.fD(k.element,"ytp-enable-w2w-color-transitions",nVx(k))}},q2L=function(k){var y=DOG(k),q=Math,N=q.min; var D=k.C?Date.now()-k.C:0;q=N.call(q,D,y);N1F(k,Math.ceil((y-q)/1E3));y-q<=500&&k.nH()?k.select(!0):k.nH()&&k.V.start()},DOG=function(k){if(k.G.isFullscreen()){var y; k=(y=k.G.getVideoData())==null?void 0:y.Ml;return k===-1||k===void 0?8E3:k}return k.G.uM()>=0?k.G.uM():g.bD(k.G.S().experiments,"autoplay_time")||1E4},y4N=function(k,y){k.G.W("web_player_autonav_next_button_renderer"); y=y.vT;k.j=y==null?void 0:y.navigationEndpoint;y=y==null?void 0:y.trackingParams;k.playButton&&y&&k.G.setTrackingParams(k.playButton.element,y)},nVx=function(k){var y; return!((y=k.G.getVideoData())==null||!y.watchToWatchTransitionRenderer)},N1F=function(k,y){y=y===void 0?-1:y; k=k.Z.nS("ytp-autonav-endscreen-upnext-header");g.HG(k);if(y>=0){y=String(y);var q="Up next in $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],N="Up next in $SECONDS".indexOf(q);if(N>=0){k.appendChild(g.wC("Up next in $SECONDS".slice(0,N)));var D=g.T3("span");g.$D(D,"ytp-autonav-endscreen-upnext-header-countdown-number");g.ux(D,y);k.appendChild(D);k.appendChild(g.wC("Up next in $SECONDS".slice(N+q.length)));return}}g.ux(k,"Up next")},Yi=function(k,y){g.R.call(this,{X:"div", jb:["html5-endscreen","ytp-player-content",y||"base-endscreen"]});this.created=!1;this.player=k},Ss=function(k){g.R.call(this,{X:"div", jb:["ytp-upnext","ytp-player-content"],K:{"aria-label":"{{aria_label}}"},L:[{X:"div",D:"ytp-cued-thumbnail-overlay-image",K:{style:"{{background}}"}},{X:"span",D:"ytp-upnext-top",L:[{X:"span",D:"ytp-upnext-header",oO:"Up Next"},{X:"span",D:"ytp-upnext-title",oO:"{{title}}"},{X:"span",D:"ytp-upnext-author",oO:"{{author}}"}]},{X:"a",D:"ytp-upnext-autoplay-icon",K:{role:"button",href:"{{url}}","aria-label":"Play next video"},L:[{X:"svg",K:{height:"100%",version:"1.1",viewBox:"0 0 72 72",width:"100%"}, L:[{X:"circle",D:"ytp-svg-autoplay-circle",K:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{X:"circle",D:"ytp-svg-autoplay-ring",K:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{X:"path",D:"ytp-svg-fill",K:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{X:"span",D:"ytp-upnext-bottom",L:[{X:"span",D:"ytp-upnext-cancel"},{X:"span",D:"ytp-upnext-paused", oO:"Autoplay is paused"}]}]});this.api=k;this.cancelButton=null;this.j=this.nS("ytp-svg-autoplay-ring");this.C=this.notification=this.Z=this.suggestion=null;this.V=new g.c3(this.Hm,5E3,this);this.N=0;var y=this.nS("ytp-upnext-cancel");this.cancelButton=new g.R({X:"button",jb:["ytp-upnext-cancel-button","ytp-button"],K:{tabindex:"0","aria-label":"Cancel autoplay"},oO:"Cancel"});g.G(this,this.cancelButton);this.cancelButton.listen("click",this.Lv,this);this.cancelButton.FH(y);this.cancelButton&&this.api.createClientVe(this.cancelButton.element, this,115129);g.G(this,this.V);this.api.createClientVe(this.element,this,18788);y=this.nS("ytp-upnext-autoplay-icon");this.T(y,"click",this.Kv);this.api.createClientVe(y,this,115130);this.Le();this.T(k,"autonavvisibility",this.Le);this.T(k,"mdxnowautoplaying",this.MHl);this.T(k,"mdxautoplaycanceled",this.UYH);g.fD(this.element,"ytp-upnext-mobile",this.api.S().N)},T1g=function(k,y){if(y)return y; if(k.api.isFullscreen()){var q;k=(q=k.api.getVideoData())==null?void 0:q.Ml;return k===-1||k===void 0?8E3:k}return k.api.uM()>=0?k.api.uM():g.bD(k.api.S().experiments,"autoplay_time")||1E4},wse=function(k,y){y=T1g(k,y); var q=Math,N=q.min;var D=(0,g.om)()-k.N;q=N.call(q,D,y);y=y===0?1:Math.min(q/y,1);k.j.setAttribute("stroke-dashoffset",""+-211*(y+1));y>=1&&k.nH()&&k.api.getPresentingPlayerType()!==3?k.select(!0):k.nH()&&k.Z.start()},G8=function(k){Yi.call(this,k,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.R({X:"div",D:"ytp-suggestion-panel",L:[{X:"div",jb:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],oO:"More videos"}]});this.J=new g.R({X:"div",D:"ytp-suggestions-container"});this.videos=[];this.C=null;this.j=this.B=!1;this.N=new Mh(this.player);g.G(this,this.N);this.N.FH(this.element);k.getVideoData().cO?this.Z=this.N:(this.Z=new Ss(k),g.pa(this.player,this.Z.element,4),g.G(this,this.Z));this.overlay=new g.R({X:"div", D:"ytp-autonav-overlay-cancelled-state"});g.G(this,this.overlay);this.overlay.FH(this.element);this.V=new g.to(this);g.G(this,this.V);g.G(this,this.table);this.table.FH(this.element);this.table.show();g.G(this,this.J);this.J.FH(this.table.element);this.hide()},Lb=function(k){var y=k.xR(); y!==k.j&&(k.j=y,k.player.publish("autonavvisibility"),k.j?(k.N!==k.Z&&k.N.hide(),k.table.hide()):(k.N!==k.Z&&k.N.show(),k.table.show()))},dU=function(k,y){g.R.call(this,{X:"button", jb:["ytp-watch-on-youtube-button","ytp-button"],oO:"{{content}}"});this.G=k;this.buttonType=this.buttonType=y;this.k5();this.buttonType===2&&g.pD(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.k5);this.xz(!0)},gU=function(k,y){Yi.call(this,k,"embeds-lite-endscreen"); this.G=k;this.Ep=y;this.G.createClientVe(this.element,this,156943);this.watchButton=new dU(k,2);g.G(this,this.watchButton);this.watchButton.FH(this.element);this.hide()},IrF=function(k){Yi.call(this,k,"subscribecard-endscreen"); this.Z=new g.R({X:"div",D:"ytp-subscribe-card",L:[{X:"img",D:"ytp-author-image",K:{src:"{{profilePicture}}"}},{X:"div",D:"ytp-subscribe-card-right",L:[{X:"div",D:"ytp-author-name",oO:"{{author}}"},{X:"div",D:"html5-subscribe-button-container"}]}]});g.G(this,this.Z);this.Z.FH(this.element);var y=k.getVideoData();this.subscribeButton=new g.tD("Subscribe",null,"Unsubscribe",null,!0,!1,y.qz,y.subscribed,"trailer-endscreen",null,k,!1);g.G(this,this.subscribeButton);this.subscribeButton.FH(this.Z.nS("html5-subscribe-button-container")); this.T(k,"videodatachange",this.OT);this.OT();this.hide()},oR=function(k){var y=k.S(),q=g.Zl||g.MU?{style:"will-change: opacity"}:void 0,N=y.V,D=["ytp-videowall-still"]; y.N&&D.push("ytp-videowall-show-text");g.R.call(this,{X:"a",jb:D,K:{href:"{{url}}",target:N?y.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},L:[{X:"div",D:"ytp-videowall-still-image",K:{style:"{{background}}"}},{X:"span",D:"ytp-videowall-still-info",K:{"aria-hidden":"true"},L:[{X:"span",D:"ytp-videowall-still-info-bg",L:[{X:"span",D:"ytp-videowall-still-info-content",K:q,L:[{X:"span",D:"ytp-videowall-still-info-title",oO:"{{title}}"}, {X:"span",D:"ytp-videowall-still-info-author",oO:"{{author_and_views}}"},{X:"span",D:"ytp-videowall-still-info-live",oO:"Live"},{X:"span",D:"ytp-videowall-still-info-duration",oO:"{{duration}}"}]}]}]},{X:"span",jb:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},L:[{X:"span",D:"ytp-videowall-still-listlabel-icon"},"Playlist",{X:"span",D:"ytp-videowall-still-listlabel-length",L:[" (",{X:"span",oO:"{{playlist_length}}"},")"]}]},{X:"span",jb:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},L:[{X:"span",D:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{X:"span",D:"ytp-videowall-still-listlabel-length",oO:" (50+)"}]}]});this.suggestion=null;this.N=N;this.api=k;this.Z=new g.to(this);g.G(this,this.Z);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.Z.T(k,"videodatachange",this.onVideoDataChange);k.createServerVe(this.element,this);this.onVideoDataChange()},hM=function(k){Yi.call(this,k,"videowall-endscreen"); var y=this;this.G=k;this.C=0;this.stills=[];this.V=this.videoData=null;this.j=this.J=!1;this.U=null;this.N=new g.to(this);g.G(this,this.N);this.B=new g.c3(function(){g.pD(y.element,"ytp-show-tiles")},0); g.G(this,this.B);var q=new g.R({X:"button",jb:["ytp-button","ytp-endscreen-previous"],K:{"aria-label":"Previous"},L:[g.Yl()]});g.G(this,q);q.FH(this.element);q.listen("click",this.yc,this);this.table=new g.Cr({X:"div",D:"ytp-endscreen-content"});g.G(this,this.table);this.table.FH(this.element);q=new g.R({X:"button",jb:["ytp-button","ytp-endscreen-next"],K:{"aria-label":"Next"},L:[g.S4()]});g.G(this,q);q.FH(this.element);q.listen("click",this.UM,this);k.getVideoData().cO?this.Z=new Mh(k,!0):this.Z= new Ss(k);g.G(this,this.Z);g.pa(this.player,this.Z.element,4);k.createClientVe(this.element,this,158789);this.hide()},RR=function(k){return g.rl(k.player)&&k.hq()&&!k.V},es=function(k){var y=k.xR(); y!==k.J&&(k.J=y,k.player.publish("autonavvisibility"))},W_=function(k){Yi.call(this,k,"watch-again-on-youtube-endscreen"); this.watchButton=new dU(k,1);g.G(this,this.watchButton);this.watchButton.FH(this.element);g.dDF(k)&&(this.Z=new g.Qr(k),g.G(this,this.Z),this.N=new g.R({X:"div",jb:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],K:{tabIndex:"-1"},L:[this.Z]}),g.G(this,this.N),this.Z.FH(this.N.element),this.N.FH(this.element));k.createClientVe(this.element,this,156914);this.hide()},c4B=function(k){g.pi.call(this,k); var y=this;this.endScreen=null;this.N=this.Z=this.C=this.V=!1;this.listeners=new g.to(this);g.G(this,this.listeners);var q=k.S(),N=k.getVideoData();N=N&&N.limitedPlaybackDurationInSeconds!==0;g.P2(g.eY(q))&&N&&!g.Xh(k)?(this.N=!0,this.endScreen=new gU(k,g.na(k))):k.qS()?this.endScreen=new W_(k):HW1(k)?(this.V=!0,KZb(this),this.Z?this.endScreen=new G8(k):this.endScreen=new hM(k)):q.oU?this.endScreen=new IrF(k):this.endScreen=new Yi(k);g.G(this,this.endScreen);g.pa(k,this.endScreen.element,4);A4O(this); this.listeners.T(k,"videodatachange",this.onVideoDataChange,this);this.listeners.T(k,g.ib("endscreen"),function(D){y.onCueRangeEnter(D)}); this.listeners.T(k,g.fh("endscreen"),function(D){y.onCueRangeExit(D)})},KZb=function(k){var y=k.player.getVideoData(); if(!y||k.Z===y.Ts&&k.C===y.cO)return!1;k.Z=y.Ts;k.C=y.cO;return!0},HW1=function(k){k=k.S(); return k.MS&&!k.oU},A4O=function(k){k.player.F7("endscreen"); var y=k.player.getVideoData();y=new g.rG(Math.max((y.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var q=new g.rG(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});k.player.ZW([y,q])}; g.u4.prototype.uM=g.ND(14,function(){return this.app.uM()}); g.np.prototype.uM=g.ND(13,function(){return this.getVideoData().g3}); g.HO.prototype.lR=g.ND(12,function(k){this.VW().lR(k)}); g.xZ.prototype.lR=g.ND(11,function(k){this.Z!==k&&(this.Z=k,this.OT())}); g.m5.prototype.lR=g.ND(10,function(k){this.overflowButton&&this.overflowButton.lR(k)}); g.HO.prototype.sO=g.ND(9,function(k){this.VW().sO(k)}); g.pT.prototype.sO=g.ND(8,function(k){this.Z!==k&&(this.Z=k,this.OT())}); g.m5.prototype.sO=g.ND(7,function(k){this.shareButton&&this.shareButton.sO(k)}); g.HO.prototype.Iy=g.ND(6,function(k){this.VW().Iy(k)}); g.R3.prototype.Iy=g.ND(5,function(k){this.zE!==k&&(this.zE=k,this.By())}); g.HO.prototype.wm=g.ND(4,function(k){this.VW().wm(k)}); g.m5.prototype.wm=g.ND(3,function(k){this.NA!==k&&(this.NA=k,this.fh())});g.z(QJ,g.R);QJ.prototype.select=function(){this.G.C6(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.QR||void 0)&&this.G.logClick(this.element)}; QJ.prototype.onClick=function(k){g.Ig(k,this.G,this.Z,this.suggestion.sessionData||void 0)&&this.select()}; QJ.prototype.onKeyPress=function(k){switch(k.keyCode){case 13:case 32:k.defaultPrevented||(this.select(),k.preventDefault())}};g.z(Mh,g.R);g.w=Mh.prototype;g.w.bS=function(k){this.suggestion!==k&&(this.suggestion=k,UM(this.Z,k),this.playButton.updateValue("url",this.suggestion.gV()),FB(this))}; g.w.nH=function(){return this.C>0}; g.w.Ol=function(){this.nH()||(this.C=Date.now(),q2L(this),k5g(this.G,DOG(this)),g.fD(this.G.getRootNode(),"countdown-running",this.nH()))}; g.w.AE=function(){this.Gp();q2L(this);var k=this.Z.nS("ytp-autonav-endscreen-upnext-header");k&&g.ux(k,"Up next")}; g.w.Gp=function(){this.nH()&&(this.V.stop(),this.C=0)}; g.w.select=function(k){this.G.nextVideo(!1,k===void 0?!1:k);this.Gp()}; g.w.Jt=function(k){g.Ig(k,this.G)&&(k.currentTarget===this.playButton.element?this.G.logClick(this.playButton.element):k.currentTarget===this.Z.nS("ytp-autonav-endscreen-link-container")&&(k=this.Z.nS("ytp-autonav-endscreen-link-container"),this.G.logVisibility(k,!0),this.G.logClick(k)),this.G.W("web_player_autonav_next_button_renderer")&&this.j?(this.G.Sb("innertubeCommand",this.j),this.Gp()):this.select())}; g.w.Jx=function(){this.G.logClick(this.cancelButton.element);g.x9(this.G,!0);this.cancelCommand&&this.G.Sb("innertubeCommand",this.cancelCommand)}; g.w.onVideoDataChange=function(k,y){this.G.W("web_player_autonav_next_button_renderer")&&y4N(this,y);var q;this.cancelCommand=(q=y.Ys)==null?void 0:q.command}; g.w.C2x=function(k){if(nVx(this)){var y=this.G.getVideoData().watchToWatchTransitionRenderer,q=y==null?void 0:y.fromColorPaletteDark;y=y==null?void 0:y.toColorPaletteDark;if(q&&y){var N=this.element;N.style.setProperty("--w2w-start-background-color",g.nN(q.surgeColor));N.style.setProperty("--w2w-start-primary-text-color",g.nN(q.primaryTitleColor));N.style.setProperty("--w2w-start-secondary-text-color",g.nN(q.secondaryTitleColor));N.style.setProperty("--w2w-end-background-color",g.nN(y.surgeColor)); N.style.setProperty("--w2w-end-primary-text-color",g.nN(y.primaryTitleColor));N.style.setProperty("--w2w-end-secondary-text-color",g.nN(y.secondaryTitleColor));N.style.setProperty("--w2w-animation-duration",k+"ms")}g.fD(this.element,"ytp-w2w-animate",!0)}}; g.w.S_=function(k){this.G.W("web_autonav_color_transition")&&k!==2&&g.fD(this.element,"ytp-w2w-animate",!1)}; g.w.Sh=function(){var k=this.G.xR();this.B&&this.Az!==k&&this.xz(k);FB(this);this.G.logVisibility(this.container.element,k);this.G.logVisibility(this.cancelButton.element,k);this.G.logVisibility(this.Z.nS("ytp-autonav-endscreen-link-container"),k);this.G.logVisibility(this.playButton.element,k)}; g.w.uO=function(k){return k.width<400||k.height<459};g.z(Yi,g.R);g.w=Yi.prototype;g.w.create=function(){this.created=!0}; g.w.destroy=function(){this.created=!1}; g.w.hq=function(){return!1}; g.w.xR=function(){return!1}; g.w.VU=function(){return!1};g.z(Ss,g.R);g.w=Ss.prototype;g.w.Hm=function(){this.notification&&(this.V.stop(),this.HZ(this.C),this.C=null,this.notification.close(),this.notification=null)}; g.w.bS=function(k){this.suggestion=k;UM(this,k,"hqdefault.jpg")}; g.w.Le=function(){this.xz(this.api.xR());this.api.logVisibility(this.element,this.api.xR());this.api.logVisibility(this.nS("ytp-upnext-autoplay-icon"),this.api.xR());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.xR())}; g.w.glH=function(){window.focus();this.Hm()}; g.w.Ol=function(k){var y=this;this.nH()||(g.vT("a11y-announce","Up Next "+this.suggestion.title),this.N=(0,g.om)(),this.Z=new g.c3(function(){wse(y,k)},25),wse(this,k),k5g(this.api,T1g(this,k))); g.mW(this.element,"ytp-upnext-autoplay-paused")}; g.w.hide=function(){g.R.prototype.hide.call(this)}; g.w.nH=function(){return!!this.Z}; g.w.AE=function(){this.Gp();this.N=(0,g.om)();wse(this);g.pD(this.element,"ytp-upnext-autoplay-paused")}; g.w.Gp=function(){this.nH()&&(this.Z.dispose(),this.Z=null)}; g.w.select=function(k){k=k===void 0?!1:k;if(this.api.S().W("autonav_notifications")&&k&&window.Notification&&typeof document.hasFocus==="function"){var y=Notification.permission;y==="default"?Notification.requestPermission():y!=="granted"||document.hasFocus()||(this.Hm(),this.notification=new Notification("Up Next",{body:this.suggestion.title,icon:this.suggestion.eU()}),this.C=this.T(this.notification,"click",this.glH),this.V.start())}this.Gp();this.api.nextVideo(!1,k)}; g.w.Kv=function(k){!g.cG(this.cancelButton.element,k.target)&&g.Ig(k,this.api)&&(this.api.xR()&&this.api.logClick(this.nS("ytp-upnext-autoplay-icon")),this.select())}; g.w.Lv=function(){this.api.xR()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.x9(this.api,!0)}; g.w.MHl=function(k){this.api.getPresentingPlayerType();this.show();this.Ol(k)}; g.w.UYH=function(){this.api.getPresentingPlayerType();this.Gp();this.hide()}; g.w.gF=function(){this.Gp();this.Hm();g.R.prototype.gF.call(this)};g.z(G8,Yi);g.w=G8.prototype;g.w.create=function(){Yi.prototype.create.call(this);this.V.T(this.player,"appresize",this.Hq);this.V.T(this.player,"onVideoAreaChange",this.Hq);this.V.T(this.player,"videodatachange",this.onVideoDataChange);this.V.T(this.player,"autonavchange",this.Ke);this.V.T(this.player,"onAutonavCancelled",this.xs);this.onVideoDataChange()}; g.w.show=function(){Yi.prototype.show.call(this);(this.B||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.x9(this.player,!1);g.rl(this.player)&&this.hq()&&!this.C?(Lb(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.Z.select(!0):this.Z.Ol():this.videoData.autonavState===3&&this.Z.AE()):(g.x9(this.player,!0),Lb(this));this.Hq()}; g.w.hide=function(){Yi.prototype.hide.call(this);this.Z.AE();Lb(this)}; g.w.Hq=function(){var k=this.player.No(!0,this.player.isFullscreen());Lb(this);FB(this.N);g.fD(this.element,"ytp-autonav-cancelled-small-mode",this.uO(k));g.fD(this.element,"ytp-autonav-cancelled-tiny-mode",this.ZG(k));g.fD(this.element,"ytp-autonav-cancelled-mini-mode",k.width<=400||k.height<=360);this.overlay&&g.fW(this.overlay.element,{width:k.width+"px"});if(!this.j)for(k=0;k0&&(k= c*4,a=y<=H-2&&K>=A*4;if((A+1)/c*N/T>T/(A/(c+1)*N)&&a)K-=A*4,y+=2;else if(u)K-=c*4,k+=2;else if(a)K-=A*4,y+=2;else break}N=!1;K>=12&&q*4-K<=6&&(y>=4||k>=4)&&(N=!0);K=k*96;I=y*54;T=K/I=k-2&&A>=y-2?a=1:A%2===0&&H%2===0&&(A<2&&H<2?A===0&&H===0&&(a=2):a=2),c=g.$2(c+this.C,q),a!==0){u=this.stills[T];u||(u=new oR(this.player),this.stills[T]=u,n.appendChild(u.element));var x=Math.floor(I*A/y),r=Math.floor(K*H/k),f=Math.floor(I*(A+a)/y)-x-4,P=Math.floor(K*(H+a)/k)-r-4;g.b6(u.element,r,x);g.Q$(u.element,P,f);g.fW(u.element,"transitionDelay",(A+H)/20+"s");g.fD(u.element,"ytp-videowall-still-mini", a===1);g.fD(u.element,"ytp-videowall-still-large",a>2);a=Math.max(P,f);g.fD(u.element,"ytp-videowall-still-round-large",a>=256);g.fD(u.element,"ytp-videowall-still-round-medium",a>96&&a<256);g.fD(u.element,"ytp-videowall-still-round-small",a<=96);c=D[c];u.suggestion!==c&&(u.suggestion=c,a=u.api.S(),x=g.zh(u.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",UM(u,c,x),g.YM(a)&&!u.api.W("web_player_log_click_before_generating_ve_conversion_params")&&(a=c.gV(),x={},g.yQ(u.api,"addEmbedsConversionTrackingParams", [x]),a=g.lG(a,x),u.updateValue("url",a)),(c=(c=c.sessionData)&&c.itct)&&u.api.setTrackingParams(u.element,c));T++}n.ariaBusy="false";g.fD(this.element,"ytp-endscreen-paginate",T=T;D--)k=this.stills[D],g.Au(k.element),g.n1(k);this.stills.length=T}}; g.w.onVideoDataChange=function(){var k=this.player.getVideoData(1);this.videoData!==k&&(k!=null&&g.xF(k)?(this.C=0,this.videoData=k,this.Je()):this.player.lw("missg",{vid:(k==null?void 0:k.videoId)||"",cpn:(k==null?void 0:k.clientPlaybackNonce)||""}))}; g.w.UM=function(){this.C+=this.stills.length;this.Je()}; g.w.yc=function(){this.C-=this.stills.length;this.Je()}; g.w.VU=function(){return this.Z.nH()}; g.w.FP=function(k){k===1?(this.j=!1,this.V=this.videoData.clientPlaybackNonce,this.Z.Gp(),this.Az&&this.Je()):(this.j=!0,this.Az&&RR(this)&&(k===2?this.Z.Ol():k===3&&this.Z.AE()))}; g.w.Mx=function(k){if(k){for(k=0;k