(function(g){var window=this;'use strict';var f7W=function(T){T.publish("autonavvisibility")},GJp=function(T,Q){T.tj("onAutonavCoundownStarted",Q)},mV9=function(T){var Q,k,l; return T==null?void 0:(Q=T.playerOverlays)==null?void 0:(k=Q.playerOverlayRenderer)==null?void 0:(l=k.autoplay)==null?void 0:l.playerOverlayAutoplayRenderer},LR=function(T){var Q=T.G(),k=Q.Y; g.p.call(this,{X:"a",J:"ytp-autonav-suggestion-card",K:{href:"{{url}}",target:k?Q.D:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},W:[{X:"div",Rk:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],K:{style:"{{background}}"},W:[{X:"div",K:{"aria-label":"{{timestamp}}"},Rk:["ytp-autonav-timestamp"],S6:"{{duration}}"},{X:"div",Rk:["ytp-autonav-live-stamp"],S6:"En vivo"}, {X:"div",Rk:["ytp-autonav-upcoming-stamp"],S6:"Pr\u00f3ximamente"},{X:"div",J:"ytp-autonav-list-overlay",W:[{X:"div",J:"ytp-autonav-mix-text",S6:"Mix"},{X:"div",J:"ytp-autonav-mix-icon"}]}]},{X:"div",Rk:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],S6:"{{title}}"},{X:"div",Rk:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],S6:"{{author}}"},{X:"div",Rk:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],S6:"{{views_and_publish_time}}"}]});this.U= T;this.suggestion=null;this.T=k;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},qB=function(T,Q){Q=Q===void 0?!1:Q; g.p.call(this,{X:"div",J:"ytp-autonav-endscreen-countdown-overlay"});var k=this;this.C=Q;this.cancelCommand=this.B=void 0;this.L=0;this.container=new g.p({X:"div",J:"ytp-autonav-endscreen-countdown-container"});g.P(this,this.container);this.container.XB(this.element);Q=T.G();var l=Q.Y;this.U=T;this.suggestion=null;this.onVideoDataChange("newdata",this.U.getVideoData());this.Z(T,"videodatachange",this.onVideoDataChange);this.T=new g.p({X:"div",J:"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}}"},W:[{X:"div",J:"ytp-autonav-endscreen-upnext-header"},{X:"div",J:"ytp-autonav-endscreen-upnext-alternative-header",S6:"{{autoplayAlternativeHeader}}"},{X:"a",J:"ytp-autonav-endscreen-link-container",K:{href:"{{url}}",target:l?Q.D:""},W:[{X:"div",J:"ytp-autonav-endscreen-upnext-thumbnail",K:{style:"{{background}}"},W:[{X:"div",K:{"aria-label":"{{timestamp}}"},Rk:["ytp-autonav-timestamp"], S6:"{{duration}}"},{X:"div",Rk:["ytp-autonav-live-stamp"],S6:"En vivo"},{X:"div",Rk:["ytp-autonav-upcoming-stamp"],S6:"Pr\u00f3ximamente"}]},{X:"div",J:"ytp-autonav-endscreen-video-info",W:[{X:"div",J:"ytp-autonav-endscreen-premium-badge"},{X:"div",J:"ytp-autonav-endscreen-upnext-title",S6:"{{title}}"},{X:"div",J:"ytp-autonav-endscreen-upnext-author",S6:"{{author}}"},{X:"div",J:"ytp-autonav-view-and-date",S6:"{{views_and_publish_time}}"},{X:"div",J:"ytp-autonav-author-and-view",S6:"{{author_and_views}}"}]}]}]}); g.P(this,this.T);this.T.XB(this.container.element);l||this.Z(this.T.L_("ytp-autonav-endscreen-link-container"),"click",this.Rv);this.U.createClientVe(this.container.element,this,115127);this.U.createClientVe(this.T.L_("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.p({X:"div",J:"ytp-autonav-overlay"});g.P(this,this.overlay);this.overlay.XB(this.container.element);this.S=new g.p({X:"div",J:"ytp-autonav-endscreen-button-container"});g.P(this,this.S);this.S.XB(this.container.element); this.cancelButton=new g.p({X:"button",Rk:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",Q.V("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},S6:"Cancelar"});g.P(this,this.cancelButton);this.cancelButton.XB(this.S.element);this.cancelButton.listen("click",this.cE,this);this.U.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.p({X:"a",Rk:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",Q.V("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],K:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},S6:"Reproducir ahora"});g.P(this,this.playButton);this.playButton.XB(this.S.element);this.playButton.listen("click",this.Rv,this);this.U.createServerVe(this.playButton.element,this.playButton,!0);(Q=this.U.getVideoData())&&I7E(this,Q);this.Y=new g.FA(function(){hQW(k)},500); g.P(this,this.Y);this.UV();this.Z(T,"autonavvisibility",this.UV);this.U.V("web_autonav_color_transition")&&(this.Z(T,"autonavchange",this.Sc),this.Z(T,"onAutonavCoundownStarted",this.Jjm))},gr=function(T){var Q=T.U.IM(!0,T.U.isFullscreen()); g.gl(T.container.element,"ytp-autonav-endscreen-small-mode",T.tb(Q));g.gl(T.container.element,"ytp-autonav-endscreen-is-premium",!!T.suggestion&&!!T.suggestion.MDq);g.gl(T.U.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!T.U.eD());g.gl(T.U.getRootNode(),"countdown-running",T.p$());g.gl(T.container.element,"ytp-player-content",T.U.eD());g.W2(T.overlay.element,{width:Q.width+"px"});if(!T.p$()){T.U.eD()?sdT(T,Math.round(SBE(T)/1E3)):sdT(T);Q=!!T.suggestion&&!!T.suggestion.o9;var k=T.U.eD()|| !Q;g.gl(T.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!k&&Q);g.gl(T.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",k&&!Q);T.S.o_(T.U.eD());g.gl(T.element,"ytp-enable-w2w-color-transitions",Cl1(T))}},hQW=function(T){var Q=SBE(T),k=Math,l=k.min; var v=T.L?Date.now()-T.L:0;k=l.call(k,v,Q);sdT(T,Math.ceil((Q-k)/1E3));Q-k<=500&&T.p$()?T.select(!0):T.p$()&&T.Y.start()},SBE=function(T){if(T.U.isFullscreen()){var Q; T=(Q=T.U.getVideoData())==null?void 0:Q.UR;return T===-1||T===void 0?8E3:T}return T.U.wS()>=0?T.U.wS():g.jj(T.U.G().experiments,"autoplay_time")||1E4},I7E=function(T,Q){Q=Q.getWatchNextResponse(); var k,l;Q=(k=mV9(Q))==null?void 0:(l=k.nextButton)==null?void 0:l.buttonRenderer;T.B=Q==null?void 0:Q.navigationEndpoint;k=Q==null?void 0:Q.trackingParams;T.playButton&&k&&T.U.setTrackingParams(T.playButton.element,k)},Cl1=function(T){var Q; return!((Q=T.U.getVideoData())==null||!Q.watchToWatchTransitionRenderer)},sdT=function(T,Q){Q=Q===void 0?-1:Q; T=T.T.L_("ytp-autonav-endscreen-upnext-header");g.IO(T);if(Q>=0){Q=String(Q);var k="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],l="A continuaci\u00f3n, en $SECONDS".indexOf(k);if(l>=0){T.appendChild(g.G8("A continuaci\u00f3n, en $SECONDS".slice(0,l)));var v=g.fO("span");g.kh(v,"ytp-autonav-endscreen-upnext-header-countdown-number");g.CO(v,Q);T.appendChild(v);T.appendChild(g.G8("A continuaci\u00f3n, en $SECONDS".slice(l+k.length)));return}}g.CO(T,"A continuaci\u00f3n")},MB= function(T,Q){g.p.call(this,{X:"div", Rk:["html5-endscreen","ytp-player-content",Q||"base-endscreen"]});this.created=!1;this.player=T},YV=function(T){g.p.call(this,{X:"div", Rk:["ytp-upnext","ytp-player-content"],K:{"aria-label":"{{aria_label}}"},W:[{X:"div",J:"ytp-cued-thumbnail-overlay-image",K:{style:"{{background}}"}},{X:"span",J:"ytp-upnext-top",W:[{X:"span",J:"ytp-upnext-header",S6:"A continuaci\u00f3n"},{X:"span",J:"ytp-upnext-title",S6:"{{title}}"},{X:"span",J:"ytp-upnext-author",S6:"{{author}}"}]},{X:"a",J:"ytp-upnext-autoplay-icon",K:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},W:[{X:"svg",K:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},W:[{X:"circle",J:"ytp-svg-autoplay-circle",K:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{X:"circle",J:"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",J:"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",J:"ytp-upnext-bottom",W:[{X:"span",J:"ytp-upnext-cancel"},{X:"span",J:"ytp-upnext-paused", S6:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=T;this.cancelButton=null;this.B=this.L_("ytp-svg-autoplay-ring");this.L=this.notification=this.T=this.suggestion=null;this.Y=new g.FA(this.T$,5E3,this);this.S=0;var Q=this.L_("ytp-upnext-cancel");this.cancelButton=new g.p({X:"button",Rk:["ytp-upnext-cancel-button","ytp-button"],K:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},S6:"Cancelar"});g.P(this,this.cancelButton);this.cancelButton.listen("click", this.ou,this);this.cancelButton.XB(Q);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.P(this,this.Y);this.api.createClientVe(this.element,this,18788);Q=this.L_("ytp-upnext-autoplay-icon");this.Z(Q,"click",this.Ew);this.api.createClientVe(Q,this,115130);this.B_();this.Z(T,"autonavvisibility",this.B_);this.Z(T,"mdxnowautoplaying",this.xY9);this.Z(T,"mdxautoplaycanceled",this.Xx_);g.gl(this.element,"ytp-upnext-mobile",this.api.G().S)},BRp=function(T,Q){if(Q)return Q; if(T.api.isFullscreen()){var k;T=(k=T.api.getVideoData())==null?void 0:k.UR;return T===-1||T===void 0?8E3:T}return T.api.wS()>=0?T.api.wS():g.jj(T.api.G().experiments,"autoplay_time")||1E4},zQ9=function(T,Q){Q=BRp(T,Q); var k=Math,l=k.min;var v=(0,g.XY)()-T.S;k=l.call(k,v,Q);Q=Q===0?1:Math.min(k/Q,1);T.B.setAttribute("stroke-dashoffset",""+-211*(Q+1));Q>=1&&T.p$()&&T.api.getPresentingPlayerType()!==3?T.select(!0):T.p$()&&T.T.start()},UT=function(T){MB.call(this,T,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.p({X:"div",J:"ytp-suggestion-panel",W:[{X:"div",Rk:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],S6:"M\u00e1s videos"}]});this.j=new g.p({X:"div",J:"ytp-suggestions-container"});this.videos=[];this.L=null;this.B=this.C=!1;this.S=new qB(this.player);g.P(this,this.S);this.S.XB(this.element);T.getVideoData().Hn?this.T=this.S:(this.T=new YV(T),g.TQ(this.player,this.T.element,4),g.P(this,this.T));this.overlay=new g.p({X:"div", J:"ytp-autonav-overlay-cancelled-state"});g.P(this,this.overlay);this.overlay.XB(this.element);this.Y=new g.Bj(this);g.P(this,this.Y);g.P(this,this.table);this.table.XB(this.element);this.table.show();g.P(this,this.j);this.j.XB(this.table.element);this.hide()},R9=function(T){var Q=T.eD(); Q!==T.B&&(T.B=Q,f7W(T.player),T.B?(T.S!==T.T&&T.S.hide(),T.table.hide()):(T.S!==T.T&&T.S.show(),T.table.show()))},XU9=function(T){MB.call(this,T,"videowall-endscreen"); var Q=this;this.U=T;this.stills=[];this.L=this.videoData=null;this.Y=this.C=!1;this.j=null;g.oF(this.element,"modern-videowall-endscreen");this.S=new g.Bj(this);g.P(this,this.S);this.B=new g.FA(function(){g.oF(Q.element,"ytp-show-tiles")},0); g.P(this,this.B);this.table=new g.LD({X:"div",J:"ytp-modern-endscreen-content"});g.P(this,this.table);this.table.XB(this.element);T.getVideoData().Hn?this.T=new qB(T,!0):this.T=new YV(T);g.P(this,this.T);g.TQ(this.player,this.T.element,4);T.createClientVe(this.element,this,158789);this.hide()},ZS=function(T){return g.QS(T.player)&&T.Ta()&&!T.L},fR=function(T){var Q=T.eD(); Q!==T.C&&(T.C=Q,f7W(T.player))},wUe=function(T){MB.call(this,T,"subscribecard-endscreen"); this.T=new g.p({X:"div",J:"ytp-subscribe-card",W:[{X:"img",J:"ytp-author-image",K:{src:"{{profilePicture}}"}},{X:"div",J:"ytp-subscribe-card-right",W:[{X:"div",J:"ytp-author-name",S6:"{{author}}"},{X:"div",J:"html5-subscribe-button-container"}]}]});g.P(this,this.T);this.T.XB(this.element);var Q=T.getVideoData();this.subscribeButton=new g.qa("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,Q.hH,Q.subscribed,"trailer-endscreen",null,T,!1);g.P(this,this.subscribeButton);this.subscribeButton.XB(this.T.L_("html5-subscribe-button-container")); this.Z(T,"videodatachange",this.Aj);this.Aj();this.hide()},GY=function(T){var Q=T.G(),k=g.hW||g.Va?{style:"will-change: opacity"}:void 0,l=Q.Y,v=["ytp-videowall-still"]; Q.S&&v.push("ytp-videowall-show-text");g.p.call(this,{X:"a",Rk:v,K:{href:"{{url}}",target:l?Q.D:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},W:[{X:"div",J:"ytp-videowall-still-image",K:{style:"{{background}}"}},{X:"span",J:"ytp-videowall-still-info",K:{"aria-hidden":"true"},W:[{X:"span",J:"ytp-videowall-still-info-bg",W:[{X:"span",J:"ytp-videowall-still-info-content",K:k,W:[{X:"span",J:"ytp-videowall-still-info-title",S6:"{{title}}"}, {X:"span",J:"ytp-videowall-still-info-author",S6:"{{author_and_views}}"},{X:"span",J:"ytp-videowall-still-info-live",S6:"En vivo"},{X:"span",J:"ytp-videowall-still-info-duration",S6:"{{duration}}"}]}]}]},{X:"span",Rk:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},W:[{X:"span",J:"ytp-videowall-still-listlabel-icon"},"Playlist",{X:"span",J:"ytp-videowall-still-listlabel-length",W:[" (",{X:"span",S6:"{{playlist_length}}"},")"]}]},{X:"span",Rk:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],K:{"aria-hidden":"true"},W:[{X:"span",J:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{X:"span",J:"ytp-videowall-still-listlabel-length",S6:" (50+)"}]}]});this.suggestion=null;this.S=l;this.api=T;this.T=new g.Bj(this);g.P(this,this.T);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.T.Z(T,"videodatachange",this.onVideoDataChange);T.createServerVe(this.element,this);this.onVideoDataChange()},mt=function(T){MB.call(this,T,"videowall-endscreen"); var Q=this;this.U=T;this.L=0;this.stills=[];this.Y=this.videoData=null;this.B=this.j=!1;this.D=null;this.S=new g.Bj(this);g.P(this,this.S);this.C=new g.FA(function(){g.oF(Q.element,"ytp-show-tiles")},0); g.P(this,this.C);var k=new g.p({X:"button",Rk:["ytp-button","ytp-endscreen-previous"],K:{"aria-label":"Anterior"},W:[g.GI()]});g.P(this,k);k.XB(this.element);k.listen("click",this.YY,this);this.table=new g.LD({X:"div",J:"ytp-endscreen-content"});g.P(this,this.table);this.table.XB(this.element);k=new g.p({X:"button",Rk:["ytp-button","ytp-endscreen-next"],K:{"aria-label":"Siguiente"},W:[g.mM()]});g.P(this,k);k.XB(this.element);k.listen("click",this.Fp,this);T.getVideoData().Hn?this.T=new qB(T,!0):this.T= new YV(T);g.P(this,this.T);g.TQ(this.player,this.T.element,4);T.createClientVe(this.element,this,158789);this.hide()},I9=function(T){return g.QS(T.player)&&T.Ta()&&!T.Y},hv=function(T){var Q=T.eD(); Q!==T.j&&(T.j=Q,f7W(T.player))},dV9=function(T,Q){g.p.call(this,{X:"button", Rk:["ytp-watch-on-youtube-button","ytp-button"],S6:"{{content}}"});this.U=T;this.buttonType=this.buttonType=Q;this.JP();this.buttonType===2&&g.oF(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.JP);this.o_(!0)},sT=function(T){MB.call(this,T,"watch-again-on-youtube-endscreen"); this.watchButton=new dV9(T,1);g.P(this,this.watchButton);this.watchButton.XB(this.element);g.Red(T)&&(this.T=new g.jU(T),g.P(this,this.T),this.S=new g.p({X:"div",Rk:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],K:{tabIndex:"-1"},W:[this.T]}),g.P(this,this.S),this.T.XB(this.S.element),this.S.XB(this.element));T.createClientVe(this.element,this,156914);this.hide()},ro$=function(T){g.A4.call(this,T); var Q=this;this.endScreen=null;this.T=this.S=this.L=!1;this.listeners=new g.Bj(this);g.P(this,this.listeners);var k=T.G();T.isEmbedsShortsMode()?this.endScreen=new sT(T):NR1(T)?(this.L=!0,AoW(this),this.T?this.endScreen=new UT(T):k.V("delhi_modern_endscreen")?this.endScreen=new XU9(T):this.endScreen=new mt(T)):k.m0?this.endScreen=new wUe(T):this.endScreen=new MB(T);g.P(this,this.endScreen);g.TQ(T,this.endScreen.element,4);bCp(this);this.listeners.Z(T,"videodatachange",this.onVideoDataChange,this); this.listeners.Z(T,g.ej("endscreen"),function(l){Q.onCueRangeEnter(l)}); this.listeners.Z(T,g.Ft("endscreen"),function(l){Q.onCueRangeExit(l)})},AoW=function(T){var Q=T.player.getVideoData(); if(!Q||T.T===Q.dJ&&T.S===Q.Hn)return!1;T.T=Q.dJ;T.S=Q.Hn;return!0},NR1=function(T){T=T.G(); return T.Hn&&!T.m0&&!T.disableOrganicUi},bCp=function(T){T.player.uf("endscreen"); var Q=T.player.getVideoData();Q=new g.$d(Math.max((Q.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var k=new g.$d(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});T.player.fY([Q,k])}; g.Wi.prototype.wS=g.ly(6,function(){return this.app.wS()}); g.S5.prototype.wS=g.ly(5,function(){return this.getVideoData().N4}); g.Hi.prototype.JJ=g.ly(4,function(T){this.nB().JJ(T)}); g.Q7.prototype.JJ=g.ly(3,function(T){this.JG!==T&&(this.JG=T,this.q3())}); g.S(LR,g.p);LR.prototype.select=function(){this.U.mG(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.rN||void 0)&&this.U.logClick(this.element)}; LR.prototype.onClick=function(T){g.wh(T,this.U,this.T,this.suggestion.sessionData||void 0)&&this.select()}; LR.prototype.onKeyPress=function(T){switch(T.keyCode){case 13:case 32:T.defaultPrevented||(this.select(),T.preventDefault())}};g.S(qB,g.p);g.h=qB.prototype;g.h.eI=function(T){this.suggestion!==T&&(this.suggestion=T,g.ZG(this.T,T),this.playButton.updateValue("url",this.suggestion.fB()),gr(this))}; g.h.p$=function(){return this.L>0}; g.h.zt=function(){this.p$()||(this.L=Date.now(),hQW(this),GJp(this.U,SBE(this)),g.gl(this.U.getRootNode(),"countdown-running",this.p$()))}; g.h.rr=function(){this.mf();hQW(this);var T=this.T.L_("ytp-autonav-endscreen-upnext-header");T&&g.CO(T,"A continuaci\u00f3n")}; g.h.mf=function(){this.p$()&&(this.Y.stop(),this.L=0)}; g.h.select=function(T){this.U.nextVideo(!1,T===void 0?!1:T);this.mf()}; g.h.Rv=function(T){g.wh(T,this.U)&&(T.currentTarget===this.playButton.element?this.U.logClick(this.playButton.element):T.currentTarget===this.T.L_("ytp-autonav-endscreen-link-container")&&(T=this.T.L_("ytp-autonav-endscreen-link-container"),this.U.logVisibility(T,!0),this.U.logClick(T)),this.B?(this.U.tj("innertubeCommand",this.B),this.mf()):this.select())}; g.h.cE=function(){this.U.logClick(this.cancelButton.element);g.Jy(this.U,!0);this.cancelCommand&&this.U.tj("innertubeCommand",this.cancelCommand)}; g.h.onVideoDataChange=function(T,Q){I7E(this,Q);T=Q.getWatchNextResponse();var k,l;T=(k=mV9(T))==null?void 0:(l=k.cancelButton)==null?void 0:l.buttonRenderer;this.cancelCommand=T==null?void 0:T.command}; g.h.Jjm=function(T){if(Cl1(this)){var Q=this.U.getVideoData().watchToWatchTransitionRenderer,k=Q==null?void 0:Q.fromColorPaletteDark;Q=Q==null?void 0:Q.toColorPaletteDark;if(k&&Q){var l=this.element;l.style.setProperty("--w2w-start-background-color",g.nN(k.surgeColor));l.style.setProperty("--w2w-start-primary-text-color",g.nN(k.primaryTitleColor));l.style.setProperty("--w2w-start-secondary-text-color",g.nN(k.secondaryTitleColor));l.style.setProperty("--w2w-end-background-color",g.nN(Q.surgeColor)); l.style.setProperty("--w2w-end-primary-text-color",g.nN(Q.primaryTitleColor));l.style.setProperty("--w2w-end-secondary-text-color",g.nN(Q.secondaryTitleColor));l.style.setProperty("--w2w-animation-duration",T+"ms")}g.gl(this.element,"ytp-w2w-animate",!0)}}; g.h.Sc=function(T){this.U.V("web_autonav_color_transition")&&T!==2&&g.gl(this.element,"ytp-w2w-animate",!1)}; g.h.UV=function(){var T=this.U.eD();this.C&&this.Sr!==T&&this.o_(T);gr(this);this.U.logVisibility(this.container.element,T);this.U.logVisibility(this.cancelButton.element,T);this.U.logVisibility(this.T.L_("ytp-autonav-endscreen-link-container"),T);this.U.logVisibility(this.playButton.element,T)}; g.h.tb=function(T){return T.width<400||T.height<459};g.S(MB,g.p);g.h=MB.prototype;g.h.create=function(){this.created=!0}; g.h.destroy=function(){this.created=!1}; g.h.Ta=function(){return!1}; g.h.eD=function(){return!1}; g.h.g3=function(){return!1};g.S(YV,g.p);g.h=YV.prototype;g.h.T$=function(){this.notification&&(this.Y.stop(),this.J6(this.L),this.L=null,this.notification.close(),this.notification=null)}; g.h.eI=function(T){this.suggestion=T;g.ZG(this,T,"hqdefault.jpg")}; g.h.B_=function(){this.o_(this.api.eD());this.api.logVisibility(this.element,this.api.eD());this.api.logVisibility(this.L_("ytp-upnext-autoplay-icon"),this.api.eD());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.eD())}; g.h.wxd=function(){window.focus();this.T$()}; g.h.zt=function(T){var Q=this;this.p$()||(g.vd("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.S=(0,g.XY)(),this.T=new g.FA(function(){zQ9(Q,T)},25),zQ9(this,T),GJp(this.api,BRp(this,T))); g.Lb(this.element,"ytp-upnext-autoplay-paused")}; g.h.hide=function(){g.p.prototype.hide.call(this)}; g.h.p$=function(){return!!this.T}; g.h.rr=function(){this.mf();this.S=(0,g.XY)();zQ9(this);g.oF(this.element,"ytp-upnext-autoplay-paused")}; g.h.mf=function(){this.p$()&&(this.T.dispose(),this.T=null)}; g.h.select=function(T){T=T===void 0?!1:T;if(this.api.G().V("autonav_notifications")&&T&&window.Notification&&typeof document.hasFocus==="function"){var Q=Notification.permission;Q==="default"?Notification.requestPermission():Q!=="granted"||document.hasFocus()||(this.T$(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.rO()}),this.L=this.Z(this.notification,"click",this.wxd),this.Y.start())}this.mf();this.api.nextVideo(!1,T)}; g.h.Ew=function(T){!g.SO(this.cancelButton.element,T.target)&&g.wh(T,this.api)&&(this.api.eD()&&this.api.logClick(this.L_("ytp-upnext-autoplay-icon")),this.select())}; g.h.ou=function(){this.api.eD()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.Jy(this.api,!0)}; g.h.xY9=function(T){this.api.getPresentingPlayerType();this.show();this.zt(T)}; g.h.Xx_=function(){this.api.getPresentingPlayerType();this.mf();this.hide()}; g.h.EK=function(){this.mf();this.T$();g.p.prototype.EK.call(this)};g.S(UT,MB);g.h=UT.prototype;g.h.create=function(){MB.prototype.create.call(this);this.Y.Z(this.player,"appresize",this.wq);this.Y.Z(this.player,"onVideoAreaChange",this.wq);this.Y.Z(this.player,"videodatachange",this.onVideoDataChange);this.Y.Z(this.player,"autonavchange",this.Nx);this.Y.Z(this.player,"onAutonavCancelled",this.QI);this.onVideoDataChange()}; g.h.show=function(){MB.prototype.show.call(this);(this.C||this.L&&this.L!==this.videoData.clientPlaybackNonce)&&g.Jy(this.player,!1);g.QS(this.player)&&this.Ta()&&!this.L?(R9(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.T.select(!0):this.T.zt():this.videoData.autonavState===3&&this.T.rr()):(g.Jy(this.player,!0),R9(this));this.wq()}; g.h.hide=function(){MB.prototype.hide.call(this);this.T.rr();R9(this)}; g.h.wq=function(){var T=this.player.IM(!0,this.player.isFullscreen());R9(this);gr(this.S);g.gl(this.element,"ytp-autonav-cancelled-small-mode",this.tb(T));g.gl(this.element,"ytp-autonav-cancelled-tiny-mode",this.Gv(T));g.gl(this.element,"ytp-autonav-cancelled-mini-mode",T.width<=400||T.height<=360);this.overlay&&g.W2(this.overlay.element,{width:T.width+"px"});if(!this.B)for(T=0;T0&&(T= f*4,m=Q<=U-2&&R>=Z*4;if((Z+1)/f*l/q>q/(Z/(f+1)*l)&&m)R-=Z*4,Q+=2;else if(G)R-=f*4,T+=2;else if(m)R-=Z*4,Q+=2;else break}l=!1;R>=12&&k*4-R<=6&&(Q>=4||T>=4)&&(l=!0);R=T*96;Y=Q*54;q=R/Y=T-2&&Z>=Q-2?m=1:Z%2===0&&U%2===0&&(Z<2&&U<2?Z===0&&U===0&&(m=2):m=2),f=g.Ok(f+this.L,k),m!==0){G=this.stills[q];G||(G=new GY(this.player),this.stills[q]=G,L.appendChild(G.element));var I=Math.floor(Y*Z/Q),z=Math.floor(R*U/T),w=Math.floor(Y*(Z+m)/Q)-I-4,r=Math.floor(R*(U+m)/T)-z-4;g.yf(G.element,z,I);g.QP(G.element,r,w);g.W2(G.element,"transitionDelay",(Z+U)/20+"s");g.gl(G.element,"ytp-videowall-still-mini", m===1);g.gl(G.element,"ytp-videowall-still-large",m>2);m=Math.max(r,w);g.gl(G.element,"ytp-videowall-still-round-large",m>=256);g.gl(G.element,"ytp-videowall-still-round-medium",m>96&&m<256);g.gl(G.element,"ytp-videowall-still-round-small",m<=96);f=v[f];G.suggestion!==f&&(G.suggestion=f,m=G.api.G(),I=g.lw(G.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.ZG(G,f,I),g.Qk(m)&&!G.api.V("web_player_log_click_before_generating_ve_conversion_params")&&(m=f.fB(),I={},g.Ay(G.api,"addEmbedsConversionTrackingParams", [I]),m=g.sD(m,I),G.updateValue("url",m)),(f=(f=f.sessionData)&&f.itct)&&G.api.setTrackingParams(G.element,f));q++}L.ariaBusy="false";g.gl(this.element,"ytp-endscreen-paginate",q=q;v--)T=this.stills[v],g.s$(T.element),g.od(T);this.stills.length=q}}; g.h.onVideoDataChange=function(){var T=this.player.getVideoData(1);this.videoData!==T&&(T!=null&&g.zV(T)?(this.L=0,this.videoData=T,this.LS()):this.player.T9("missg",{vid:(T==null?void 0:T.videoId)||"",cpn:(T==null?void 0:T.clientPlaybackNonce)||""}))}; g.h.Fp=function(){this.L+=this.stills.length;this.LS()}; g.h.YY=function(){this.L-=this.stills.length;this.LS()}; g.h.g3=function(){return this.T.p$()}; g.h.qc=function(T){T===1?(this.B=!1,this.Y=this.videoData.clientPlaybackNonce,this.T.mf(),this.Sr&&this.LS()):(this.B=!0,this.Sr&&I9(this)&&(T===2?this.T.zt():T===3&&this.T.rr()))}; g.h.kY=function(T){if(T){for(T=0;T0||T.endSeconds>0||T.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!Q)return!0;var k;var l=!!((T==null?0:g.zV(T))||(T==null?0:(k=T.suggestions)==null?0:k.length));l=!NR1(this.player)||l;T=T.E4;k=this.player.FS();return l&&!T&&!k&&!Q}; g.h.eD=function(){return this.endScreen.eD()}; g.h.kt=function(){return this.eD()?this.endScreen.g3():!1}; g.h.EK=function(){this.player.uf("endscreen");g.A4.prototype.EK.call(this)}; g.h.load=function(){var T=this.player.getVideoData();var Q=T.transitionEndpointAtEndOfStream;if(Q&&Q.videoId){var k=this.player.Bx().kP.get("heartbeat"),l=g.zV(T);!l||Q.videoId!==l.videoId||T.Q_?(this.player.mG(Q.videoId,void 0,void 0,!0,!0,Q),k&&k.HC("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),T=!0):T=!1}else T=!1;T||(g.A4.prototype.load.call(this),this.endScreen.show())}; g.h.unload=function(){g.A4.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.h.onCueRangeEnter=function(T){this.ox()&&(this.endScreen.created||this.endScreen.create(),T.getId()==="load"&&this.load())}; g.h.onCueRangeExit=function(T){T.getId()==="load"&&this.loaded&&this.unload()}; g.h.onVideoDataChange=function(){bCp(this);this.L&&AoW(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.T?this.endScreen=new UT(this.player):this.endScreen=new mt(this.player),g.P(this,this.endScreen),g.TQ(this.player,this.endScreen.element,4))};g.ND("endscreen",ro$);})(_yt_player);