(function(g){var window=this;'use strict';var Ls_=function(q){G3.call(this,q,"subscribecard-endscreen");this.D=new g.w({Y:"div",W:"ytp-subscribe-card",T:[{Y:"img",W:"ytp-author-image",L:{src:"{{profilePicture}}"}},{Y:"div",W:"ytp-subscribe-card-right",T:[{Y:"div",W:"ytp-author-name",Ka:"{{author}}"},{Y:"div",W:"html5-subscribe-button-container"}]}]});g.y(this,this.D);this.D.R_(this.element);var Z=q.getVideoData();this.subscribeButton=new g.BL("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,Z.Fr,Z.subscribed,"trailer-endscreen", null,q,!1);g.y(this,this.subscribeButton);this.subscribeButton.R_(this.D.cG("html5-subscribe-button-container"));this.N(q,"videodatachange",this.ys);this.ys();this.hide()},Abe=function(q){g.a3.call(this,q); var Z=this;this.endScreen=null;this.D=this.K=this.S=!1;this.listeners=new g.pO(this);g.y(this,this.listeners);var F=q.C();q.isEmbedsShortsMode()?this.endScreen=new z3(q):HP0(q)?(this.S=!0,OPt(this),this.D?this.endScreen=new n2(q):F.U("delhi_modern_endscreen")?this.endScreen=new QXe(q):this.endScreen=new bT(q)):F.hC?this.endScreen=new Ls_(q):this.endScreen=new G3(q);g.y(this,this.endScreen);g.C5(q,this.endScreen.element,4);xCm(this);this.listeners.N(q,"videodatachange",this.onVideoDataChange,this); this.listeners.N(q,g.UK("endscreen"),function(B){Z.onCueRangeEnter(B)}); this.listeners.N(q,g.s2("endscreen"),function(B){Z.onCueRangeExit(B)})},NZ=function(q){var Z=q.pw(); Z!==q.Z&&(q.Z=Z,vT5(q.player),q.Z?(q.K!==q.D&&q.K.hide(),q.table.hide()):(q.K!==q.D&&q.K.show(),q.table.show()))},ETm=function(q,Z){Z=XTt(q,Z); var F=Math,B=F.min;var f=(0,g.Le)()-q.K;F=B.call(F,f,Z);Z=Z===0?1:Math.min(F/Z,1);q.Z.setAttribute("stroke-dashoffset",""+-211*(Z+1));Z>=1&&q.OX()&&q.api.getPresentingPlayerType()!==3?q.select(!0):q.OX()&&q.D.start()},Ks0=function(q,Z){q.a_("onAutonavCoundownStarted",Z)},$CB=function(q){if(q.B.isFullscreen()){var Z; q=(Z=q.B.getVideoData())==null?void 0:Z.gH;return q===-1||q===void 0?8E3:q}return q.B.gr()>=0?q.B.gr():g.Ce(q.B.C().experiments,"autoplay_time")||1E4},g2=function(q){var Z=q.C(),F=g.l2||g.tw?{style:"will-change: opacity"}:void 0,B=Z.G,f=["ytp-videowall-still"]; Z.K&&f.push("ytp-videowall-show-text");g.w.call(this,{Y:"a",rU:f,L:{href:"{{url}}",target:B?Z.PG:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},T:[{Y:"div",W:"ytp-videowall-still-image",L:{style:"{{background}}"}},{Y:"span",W:"ytp-videowall-still-info",L:{"aria-hidden":"true"},T:[{Y:"span",W:"ytp-videowall-still-info-bg",T:[{Y:"span",W:"ytp-videowall-still-info-content",L:F,T:[{Y:"span",W:"ytp-videowall-still-info-title",Ka:"{{title}}"}, {Y:"span",W:"ytp-videowall-still-info-author",Ka:"{{author_and_views}}"},{Y:"span",W:"ytp-videowall-still-info-live",Ka:"En vivo"},{Y:"span",W:"ytp-videowall-still-info-duration",Ka:"{{duration}}"}]}]}]},{Y:"span",rU:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],L:{"aria-hidden":"true"},T:[{Y:"span",W:"ytp-videowall-still-listlabel-icon"},"Playlist",{Y:"span",W:"ytp-videowall-still-listlabel-length",T:[" (",{Y:"span",Ka:"{{playlist_length}}"},")"]}]},{Y:"span",rU:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],L:{"aria-hidden":"true"},T:[{Y:"span",W:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{Y:"span",W:"ytp-videowall-still-listlabel-length",Ka:" (50+)"}]}]});this.suggestion=null;this.K=B;this.api=q;this.D=new g.pO(this);g.y(this,this.D);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.D.N(q,"videodatachange",this.onVideoDataChange);q.createServerVe(this.element,this);this.onVideoDataChange()},mC5=function(q){var Z=$CB(q),F=Math,B=F.min; var f=q.S?Date.now()-q.S:0;F=B.call(F,f,Z);aLe(q,Math.ceil((Z-F)/1E3));Z-F<=500&&q.OX()?q.select(!0):q.OX()&&q.G.start()},iPe=function(q,Z){g.w.call(this,{Y:"button", rU:["ytp-watch-on-youtube-button","ytp-button"],Ka:"{{content}}"});this.B=q;this.buttonType=this.buttonType=Z;this.xv();this.buttonType===2&&g.e$(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.xv);this.hZ(!0)},Sp=function(q,Z){Z=Z===void 0?!1:Z; g.w.call(this,{Y:"div",W:"ytp-autonav-endscreen-countdown-overlay"});var F=this;this.j=Z;this.cancelCommand=this.Z=void 0;this.S=0;this.container=new g.w({Y:"div",W:"ytp-autonav-endscreen-countdown-container"});g.y(this,this.container);this.container.R_(this.element);Z=q.C();var B=Z.G;this.B=q;this.suggestion=null;this.onVideoDataChange("newdata",this.B.getVideoData());this.N(q,"videodatachange",this.onVideoDataChange);this.D=new g.w({Y:"div",W:"ytp-autonav-endscreen-upnext-container",L:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},T:[{Y:"div",W:"ytp-autonav-endscreen-upnext-header"},{Y:"div",W:"ytp-autonav-endscreen-upnext-alternative-header",Ka:"{{autoplayAlternativeHeader}}"},{Y:"a",W:"ytp-autonav-endscreen-link-container",L:{href:"{{url}}",target:B?Z.PG:""},T:[{Y:"div",W:"ytp-autonav-endscreen-upnext-thumbnail",L:{style:"{{background}}"},T:[{Y:"div",L:{"aria-label":"{{timestamp}}"},rU:["ytp-autonav-timestamp"], Ka:"{{duration}}"},{Y:"div",rU:["ytp-autonav-live-stamp"],Ka:"En vivo"},{Y:"div",rU:["ytp-autonav-upcoming-stamp"],Ka:"Pr\u00f3ximamente"}]},{Y:"div",W:"ytp-autonav-endscreen-video-info",T:[{Y:"div",W:"ytp-autonav-endscreen-premium-badge"},{Y:"div",W:"ytp-autonav-endscreen-upnext-title",Ka:"{{title}}"},{Y:"div",W:"ytp-autonav-endscreen-upnext-author",Ka:"{{author}}"},{Y:"div",W:"ytp-autonav-view-and-date",Ka:"{{views_and_publish_time}}"},{Y:"div",W:"ytp-autonav-author-and-view",Ka:"{{author_and_views}}"}]}]}]}); g.y(this,this.D);this.D.R_(this.container.element);B||this.N(this.D.cG("ytp-autonav-endscreen-link-container"),"click",this.ZN);this.B.createClientVe(this.container.element,this,115127);this.B.createClientVe(this.D.cG("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.w({Y:"div",W:"ytp-autonav-overlay"});g.y(this,this.overlay);this.overlay.R_(this.container.element);this.K=new g.w({Y:"div",W:"ytp-autonav-endscreen-button-container"});g.y(this,this.K);this.K.R_(this.container.element); this.cancelButton=new g.w({Y:"button",rU:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",Z.U("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],L:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Ka:"Cancelar"});g.y(this,this.cancelButton);this.cancelButton.R_(this.K.element);this.cancelButton.listen("click",this.jV,this);this.B.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.w({Y:"a",rU:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",Z.U("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],L:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},Ka:"Reproducir ahora"});g.y(this,this.playButton);this.playButton.R_(this.K.element);this.playButton.listen("click",this.ZN,this);this.B.createServerVe(this.playButton.element,this.playButton,!0);(Z=this.B.getVideoData())&&kwj(this,Z);this.G=new g.im(function(){mC5(F)},500); g.y(this,this.G);this.RA();this.N(q,"autonavvisibility",this.RA);this.B.U("web_autonav_color_transition")&&(this.N(q,"autonavchange",this.dN),this.N(q,"onAutonavCoundownStarted",this.ZBs))},sXj=function(q){var Z,F,B; return q==null?void 0:(Z=q.playerOverlays)==null?void 0:(F=Z.playerOverlayRenderer)==null?void 0:(B=F.autoplay)==null?void 0:B.playerOverlayAutoplayRenderer},lT=function(q){var Z=q.B.dA(!0,q.B.isFullscreen()); g.hK(q.container.element,"ytp-autonav-endscreen-small-mode",q.J8(Z));g.hK(q.container.element,"ytp-autonav-endscreen-is-premium",!!q.suggestion&&!!q.suggestion.az_);g.hK(q.B.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!q.B.pw());g.hK(q.B.getRootNode(),"countdown-running",q.OX());g.hK(q.container.element,"ytp-player-content",q.B.pw());g.u$(q.overlay.element,{width:Z.width+"px"});if(!q.OX()){q.B.pw()?aLe(q,Math.round($CB(q)/1E3)):aLe(q);Z=!!q.suggestion&&!!q.suggestion.zo;var F=q.B.pw()|| !Z;g.hK(q.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!F&&Z);g.hK(q.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",F&&!Z);q.K.hZ(q.B.pw());g.hK(q.element,"ytp-enable-w2w-color-transitions",jXE(q))}},UC=function(q){var Z=q.C(),F=Z.G; g.w.call(this,{Y:"a",W:"ytp-autonav-suggestion-card",L:{href:"{{url}}",target:F?Z.PG:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},T:[{Y:"div",rU:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],L:{style:"{{background}}"},T:[{Y:"div",L:{"aria-label":"{{timestamp}}"},rU:["ytp-autonav-timestamp"],Ka:"{{duration}}"},{Y:"div",rU:["ytp-autonav-live-stamp"],Ka:"En vivo"}, {Y:"div",rU:["ytp-autonav-upcoming-stamp"],Ka:"Pr\u00f3ximamente"},{Y:"div",W:"ytp-autonav-list-overlay",T:[{Y:"div",W:"ytp-autonav-mix-text",Ka:"Mix"},{Y:"div",W:"ytp-autonav-mix-icon"}]}]},{Y:"div",rU:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Ka:"{{title}}"},{Y:"div",rU:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Ka:"{{author}}"},{Y:"div",rU:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Ka:"{{views_and_publish_time}}"}]});this.B= q;this.suggestion=null;this.D=F;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},uT=function(q){var Z=q.pw(); Z!==q.j&&(q.j=Z,vT5(q.player))},G3=function(q,Z){g.w.call(this,{Y:"div", rU:["html5-endscreen","ytp-player-content",Z||"base-endscreen"]});this.created=!1;this.player=q},kwj=function(q,Z){Z=Z.getWatchNextResponse(); var F,B;Z=(F=sXj(Z))==null?void 0:(B=F.nextButton)==null?void 0:B.buttonRenderer;q.Z=Z==null?void 0:Z.navigationEndpoint;F=Z==null?void 0:Z.trackingParams;q.playButton&&F&&q.B.setTrackingParams(q.playButton.element,F)},PJ=function(q){return g.lw(q.player)&&q.cP()&&!q.S},z3=function(q){G3.call(this,q,"watch-again-on-youtube-endscreen"); this.watchButton=new iPe(q,1);g.y(this,this.watchButton);this.watchButton.R_(this.element);g.qs6(q)&&(this.D=new g.tn(q),g.y(this,this.D),this.K=new g.w({Y:"div",rU:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],L:{tabIndex:"-1"},T:[this.D]}),g.y(this,this.K),this.D.R_(this.K.element),this.K.R_(this.element));q.createClientVe(this.element,this,156914);this.hide()},QXe=function(q){G3.call(this,q,"videowall-endscreen"); var Z=this;this.B=q;this.stills=[];this.S=this.videoData=null;this.G=this.j=!1;this.X=null;g.e$(this.element,"modern-videowall-endscreen");this.K=new g.pO(this);g.y(this,this.K);this.Z=new g.im(function(){g.e$(Z.element,"ytp-show-tiles")},0); g.y(this,this.Z);this.table=new g.i0({Y:"div",W:"ytp-modern-endscreen-content"});g.y(this,this.table);this.table.R_(this.element);q.getVideoData().bb?this.D=new Sp(q,!0):this.D=new r2(q);g.y(this,this.D);g.C5(this.player,this.D.element,4);q.createClientVe(this.element,this,158789);this.hide()},HP0=function(q){q=q.C(); return q.X3&&!q.hC&&!q.disableOrganicUi},bT=function(q){G3.call(this,q,"videowall-endscreen"); var Z=this;this.B=q;this.S=0;this.stills=[];this.G=this.videoData=null;this.Z=this.X=!1;this.V=null;this.K=new g.pO(this);g.y(this,this.K);this.j=new g.im(function(){g.e$(Z.element,"ytp-show-tiles")},0); g.y(this,this.j);var F=new g.w({Y:"button",rU:["ytp-button","ytp-endscreen-previous"],L:{"aria-label":"Anterior"},T:[g.Jn()]});g.y(this,F);F.R_(this.element);F.listen("click",this.gN,this);this.table=new g.i0({Y:"div",W:"ytp-endscreen-content"});g.y(this,this.table);this.table.R_(this.element);F=new g.w({Y:"button",rU:["ytp-button","ytp-endscreen-next"],L:{"aria-label":"Siguiente"},T:[g.Fc()]});g.y(this,F);F.R_(this.element);F.listen("click",this.yZ,this);q.getVideoData().bb?this.D=new Sp(q,!0):this.D= new r2(q);g.y(this,this.D);g.C5(this.player,this.D.element,4);q.createClientVe(this.element,this,158789);this.hide()},xCm=function(q){q.player.WZ("endscreen"); var Z=q.player.getVideoData();Z=new g.u8(Math.max((Z.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var F=new g.u8(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});q.player.sZ([Z,F])},vT5=function(q){q.publish("autonavvisibility")},IL5=function(q){return q.isBackground()&&q.LD()},OPt=function(q){var Z=q.player.getVideoData(); if(!Z||q.D===Z.KR&&q.K===Z.bb)return!1;q.D=Z.KR;q.K=Z.bb;return!0},w2=function(q){return g.lw(q.player)&&q.cP()&&!q.G},XTt=function(q,Z){if(Z)return Z; if(q.api.isFullscreen()){var F;q=(F=q.api.getVideoData())==null?void 0:F.gH;return q===-1||q===void 0?8E3:q}return q.api.gr()>=0?q.api.gr():g.Ce(q.api.C().experiments,"autoplay_time")||1E4},WJ=function(q){var Z=q.pw(); Z!==q.X&&(q.X=Z,vT5(q.player))},n2=function(q){G3.call(this,q,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.w({Y:"div",W:"ytp-suggestion-panel",T:[{Y:"div",rU:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Ka:"M\u00e1s videos"}]});this.X=new g.w({Y:"div",W:"ytp-suggestions-container"});this.videos=[];this.S=null;this.Z=this.j=!1;this.K=new Sp(this.player);g.y(this,this.K);this.K.R_(this.element);q.getVideoData().bb?this.D=this.K:(this.D=new r2(q),g.C5(this.player,this.D.element,4),g.y(this,this.D));this.overlay=new g.w({Y:"div", W:"ytp-autonav-overlay-cancelled-state"});g.y(this,this.overlay);this.overlay.R_(this.element);this.G=new g.pO(this);g.y(this,this.G);g.y(this,this.table);this.table.R_(this.element);this.table.show();g.y(this,this.X);this.X.R_(this.table.element);this.hide()},r2=function(q){g.w.call(this,{Y:"div", rU:["ytp-upnext","ytp-player-content"],L:{"aria-label":"{{aria_label}}"},T:[{Y:"div",W:"ytp-cued-thumbnail-overlay-image",L:{style:"{{background}}"}},{Y:"span",W:"ytp-upnext-top",T:[{Y:"span",W:"ytp-upnext-header",Ka:"A continuaci\u00f3n"},{Y:"span",W:"ytp-upnext-title",Ka:"{{title}}"},{Y:"span",W:"ytp-upnext-author",Ka:"{{author}}"}]},{Y:"a",W:"ytp-upnext-autoplay-icon",L:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},T:[{Y:"svg",L:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},T:[{Y:"circle",W:"ytp-svg-autoplay-circle",L:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{Y:"circle",W:"ytp-svg-autoplay-ring",L:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{Y:"path",W:"ytp-svg-fill",L:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{Y:"span",W:"ytp-upnext-bottom",T:[{Y:"span",W:"ytp-upnext-cancel"},{Y:"span",W:"ytp-upnext-paused", Ka:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=q;this.cancelButton=null;this.Z=this.cG("ytp-svg-autoplay-ring");this.S=this.notification=this.D=this.suggestion=null;this.G=new g.im(this.yG,5E3,this);this.K=0;var Z=this.cG("ytp-upnext-cancel");this.cancelButton=new g.w({Y:"button",rU:["ytp-upnext-cancel-button","ytp-button"],L:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Ka:"Cancelar"});g.y(this,this.cancelButton);this.cancelButton.listen("click", this.Wj,this);this.cancelButton.R_(Z);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.y(this,this.G);this.api.createClientVe(this.element,this,18788);Z=this.cG("ytp-upnext-autoplay-icon");this.N(Z,"click",this.Xd);this.api.createClientVe(Z,this,115130);this.rl();this.N(q,"autonavvisibility",this.rl);this.N(q,"mdxnowautoplaying",this.G0s);this.N(q,"mdxautoplaycanceled",this.z7U);g.hK(this.element,"ytp-upnext-mobile",this.api.C().K)},jXE=function(q){var Z; return!((Z=q.B.getVideoData())==null||!Z.watchToWatchTransitionRenderer)},aLe=function(q,Z){Z=Z===void 0?-1:Z; q=q.D.cG("ytp-autonav-endscreen-upnext-header");g.kP(q);if(Z>=0){Z=String(Z);var F="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],B="A continuaci\u00f3n, en $SECONDS".indexOf(F);if(B>=0){q.appendChild(g.T$("A continuaci\u00f3n, en $SECONDS".slice(0,B)));var f=g.AV("span");g.xd(f,"ytp-autonav-endscreen-upnext-header-countdown-number");g.Tk(f,Z);q.appendChild(f);q.appendChild(g.T$("A continuaci\u00f3n, en $SECONDS".slice(B+F.length)));return}}g.Tk(q,"A continuaci\u00f3n")}; g.nM.prototype.gr=g.nS(6,function(){return this.app.gr()}); g.LM.prototype.gr=g.nS(5,function(){return this.getVideoData().Tj}); g.so.prototype.LL=g.nS(4,function(q){this.o6().LL(q)}); g.ZI.prototype.LL=g.nS(3,function(q){this.di!==q&&(this.di=q,this.PC())}); g.V(UC,g.w);UC.prototype.select=function(){this.B.TQ(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.HR||void 0)&&this.B.logClick(this.element)}; UC.prototype.onClick=function(q){g.lD(q,this.B,this.D,this.suggestion.sessionData||void 0)&&this.select()}; UC.prototype.onKeyPress=function(q){switch(q.keyCode){case 13:case 32:q.defaultPrevented||(this.select(),q.preventDefault())}};g.V(Sp,g.w);g.r=Sp.prototype;g.r.Lq=function(q){this.suggestion!==q&&(this.suggestion=q,g.JF(this.D,q),this.playButton.updateValue("url",this.suggestion.Le()),lT(this))}; g.r.OX=function(){return this.S>0}; g.r.QU=function(){this.OX()||(this.S=Date.now(),mC5(this),Ks0(this.B,$CB(this)),g.hK(this.B.getRootNode(),"countdown-running",this.OX()))}; g.r.NS=function(){this.Kx();mC5(this);var q=this.D.cG("ytp-autonav-endscreen-upnext-header");q&&g.Tk(q,"A continuaci\u00f3n")}; g.r.Kx=function(){this.OX()&&(this.G.stop(),this.S=0)}; g.r.select=function(q){this.B.nextVideo(!1,q===void 0?!1:q);this.Kx()}; g.r.ZN=function(q){g.lD(q,this.B)&&(q.currentTarget===this.playButton.element?this.B.logClick(this.playButton.element):q.currentTarget===this.D.cG("ytp-autonav-endscreen-link-container")&&(q=this.D.cG("ytp-autonav-endscreen-link-container"),this.B.logVisibility(q,!0),this.B.logClick(q)),this.Z?(this.B.a_("innertubeCommand",this.Z),this.Kx()):this.select())}; g.r.jV=function(){this.B.logClick(this.cancelButton.element);g.d3(this.B,!0);this.cancelCommand&&this.B.a_("innertubeCommand",this.cancelCommand)}; g.r.onVideoDataChange=function(q,Z){kwj(this,Z);q=Z.getWatchNextResponse();var F,B;q=(F=sXj(q))==null?void 0:(B=F.cancelButton)==null?void 0:B.buttonRenderer;this.cancelCommand=q==null?void 0:q.command}; g.r.ZBs=function(q){if(jXE(this)){var Z=this.B.getVideoData().watchToWatchTransitionRenderer,F=Z==null?void 0:Z.fromColorPaletteDark;Z=Z==null?void 0:Z.toColorPaletteDark;if(F&&Z){var B=this.element;B.style.setProperty("--w2w-start-background-color",g.mX(F.surgeColor));B.style.setProperty("--w2w-start-primary-text-color",g.mX(F.primaryTitleColor));B.style.setProperty("--w2w-start-secondary-text-color",g.mX(F.secondaryTitleColor));B.style.setProperty("--w2w-end-background-color",g.mX(Z.surgeColor)); B.style.setProperty("--w2w-end-primary-text-color",g.mX(Z.primaryTitleColor));B.style.setProperty("--w2w-end-secondary-text-color",g.mX(Z.secondaryTitleColor));B.style.setProperty("--w2w-animation-duration",q+"ms")}g.hK(this.element,"ytp-w2w-animate",!0)}}; g.r.dN=function(q){this.B.U("web_autonav_color_transition")&&q!==2&&g.hK(this.element,"ytp-w2w-animate",!1)}; g.r.RA=function(){var q=this.B.pw();this.j&&this.zb!==q&&this.hZ(q);lT(this);this.B.logVisibility(this.container.element,q);this.B.logVisibility(this.cancelButton.element,q);this.B.logVisibility(this.D.cG("ytp-autonav-endscreen-link-container"),q);this.B.logVisibility(this.playButton.element,q)}; g.r.J8=function(q){return q.width<400||q.height<459};g.V(G3,g.w);g.r=G3.prototype;g.r.create=function(){this.created=!0}; g.r.destroy=function(){this.created=!1}; g.r.cP=function(){return!1}; g.r.pw=function(){return!1}; g.r.Ti=function(){return!1};g.V(r2,g.w);g.r=r2.prototype;g.r.yG=function(){this.notification&&(this.G.stop(),this.Op(this.S),this.S=null,this.notification.close(),this.notification=null)}; g.r.Lq=function(q){this.suggestion=q;g.JF(this,q,"hqdefault.jpg")}; g.r.rl=function(){this.hZ(this.api.pw());this.api.logVisibility(this.element,this.api.pw());this.api.logVisibility(this.cG("ytp-upnext-autoplay-icon"),this.api.pw());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.pw())}; g.r.peU=function(){window.focus();this.yG()}; g.r.QU=function(q){var Z=this;this.OX()||(g.k3("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.K=(0,g.Le)(),this.D=new g.im(function(){ETm(Z,q)},25),ETm(this,q),Ks0(this.api,XTt(this,q))); g.vc(this.element,"ytp-upnext-autoplay-paused")}; g.r.hide=function(){g.w.prototype.hide.call(this)}; g.r.OX=function(){return!!this.D}; g.r.NS=function(){this.Kx();this.K=(0,g.Le)();ETm(this);g.e$(this.element,"ytp-upnext-autoplay-paused")}; g.r.Kx=function(){this.OX()&&(this.D.dispose(),this.D=null)}; g.r.select=function(q){q=q===void 0?!1:q;if(this.api.C().U("autonav_notifications")&&q&&window.Notification&&typeof document.hasFocus==="function"){var Z=Notification.permission;Z==="default"?Notification.requestPermission():Z!=="granted"||document.hasFocus()||(this.yG(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.fm()}),this.S=this.N(this.notification,"click",this.peU),this.G.start())}this.Kx();this.api.nextVideo(!1,q)}; g.r.Xd=function(q){!g.yT(this.cancelButton.element,q.target)&&g.lD(q,this.api)&&(this.api.pw()&&this.api.logClick(this.cG("ytp-upnext-autoplay-icon")),this.select())}; g.r.Wj=function(){this.api.pw()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.d3(this.api,!0)}; g.r.G0s=function(q){this.api.getPresentingPlayerType();this.show();this.QU(q)}; g.r.z7U=function(){this.api.getPresentingPlayerType();this.Kx();this.hide()}; g.r.SU=function(){this.Kx();this.yG();g.w.prototype.SU.call(this)};g.V(n2,G3);g.r=n2.prototype;g.r.create=function(){G3.prototype.create.call(this);this.G.N(this.player,"appresize",this.H0);this.G.N(this.player,"onVideoAreaChange",this.H0);this.G.N(this.player,"videodatachange",this.onVideoDataChange);this.G.N(this.player,"autonavchange",this.BU);this.G.N(this.player,"onAutonavCancelled",this.N5);this.onVideoDataChange()}; g.r.show=function(){G3.prototype.show.call(this);(this.j||this.S&&this.S!==this.videoData.clientPlaybackNonce)&&g.d3(this.player,!1);g.lw(this.player)&&this.cP()&&!this.S?(NZ(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3||IL5(this.player.BH())&&this.player.U("web_player_pip_logging_fix")?this.D.select(!0):this.D.QU():this.videoData.autonavState===3&&this.D.NS()):(g.d3(this.player,!0),NZ(this));this.H0()}; g.r.hide=function(){G3.prototype.hide.call(this);this.D.NS();NZ(this)}; g.r.H0=function(){var q=this.player.dA(!0,this.player.isFullscreen());NZ(this);lT(this.K);g.hK(this.element,"ytp-autonav-cancelled-small-mode",this.J8(q));g.hK(this.element,"ytp-autonav-cancelled-tiny-mode",this.ZG(q));g.hK(this.element,"ytp-autonav-cancelled-mini-mode",q.width<=400||q.height<=360);this.overlay&&g.u$(this.overlay.element,{width:q.width+"px"});if(!this.Z)for(q=0;q0&&(q= l*4,u=Z<=b-2&&N>=S*4;if((S+1)/l*B/G>G/(S/(l+1)*B)&&u)N-=S*4,Z+=2;else if(U)N-=l*4,q+=2;else if(u)N-=S*4,Z+=2;else break}B=!1;N>=12&&F*4-N<=6&&(Z>=4||q>=4)&&(B=!0);N=q*96;n=Z*54;G=N/n=q-2&&S>=Z-2?u=1:S%2===0&&b%2===0&&(S<2&&b<2?S===0&&b===0&&(u=2):u=2),l=g.ttK(l+this.S,F),u!==0){U=this.stills[G];U||(U=new g2(this.player),this.stills[G]=U,D.appendChild(U.element));var P=Math.floor(n*S/Z),W=Math.floor(N*b/q),H=Math.floor(n*(S+u)/Z)-P-4,X=Math.floor(N*(b+u)/q)-W-4;g.B7(U.element,W,P);g.TF(U.element,X,H);g.u$(U.element,"transitionDelay",(S+b)/20+"s");g.hK(U.element,"ytp-videowall-still-mini", u===1);g.hK(U.element,"ytp-videowall-still-large",u>2);u=Math.max(X,H);g.hK(U.element,"ytp-videowall-still-round-large",u>=256);g.hK(U.element,"ytp-videowall-still-round-medium",u>96&&u<256);g.hK(U.element,"ytp-videowall-still-round-small",u<=96);l=f[l];U.suggestion!==l&&(U.suggestion=l,u=U.api.C(),P=g.QU(U.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.JF(U,l,P),g.FQ(u)&&!U.api.U("web_player_log_click_before_generating_ve_conversion_params")&&(u=l.Le(),P={},g.ct(U.api,"addEmbedsConversionTrackingParams", [P]),u=g.gJ(u,P),U.updateValue("url",u)),(l=(l=l.sessionData)&&l.itct)&&U.api.setTrackingParams(U.element,l));G++}D.ariaBusy="false";g.hK(this.element,"ytp-endscreen-paginate",G=G;f--)q=this.stills[f],g.X_(q.element),g.dN(q);this.stills.length=G}}; g.r.onVideoDataChange=function(){var q=this.player.getVideoData(1);this.videoData!==q&&(q!=null&&g.rp(q)?(this.S=0,this.videoData=q,this.QR()):this.player.iL("missg",{vid:(q==null?void 0:q.videoId)||"",cpn:(q==null?void 0:q.clientPlaybackNonce)||""}))}; g.r.yZ=function(){this.S+=this.stills.length;this.QR()}; g.r.gN=function(){this.S-=this.stills.length;this.QR()}; g.r.Ti=function(){return this.D.OX()}; g.r.FL=function(q){q===1?(this.Z=!1,this.G=this.videoData.clientPlaybackNonce,this.D.Kx(),this.zb&&this.QR()):(this.Z=!0,this.zb&&w2(this)&&(q===2?this.D.QU():q===3&&this.D.NS()))}; g.r.lf=function(q){if(q){for(q=0;q0||q.endSeconds>0||q.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!Z)return!0;var F;var B=!!((q==null?0:g.rp(q))||(q==null?0:(F=q.suggestions)==null?0:F.length));B=!HP0(this.player)||B;q=q.PX;F=this.player.Nq();return B&&!q&&!F&&!Z}; g.r.pw=function(){return this.endScreen.pw()}; g.r.DpP=function(){return this.pw()?this.endScreen.Ti():!1}; g.r.SU=function(){this.player.WZ("endscreen");g.a3.prototype.SU.call(this)}; g.r.load=function(){var q=this.player.getVideoData();var Z=q.transitionEndpointAtEndOfStream;if(Z&&Z.videoId){var F=this.player.pB().ZE.get("heartbeat"),B=g.rp(q);!B||Z.videoId!==B.videoId||q.xp?(this.player.TQ(Z.videoId,void 0,void 0,!0,!0,Z),F&&F.lN("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),q=!0):q=!1}else q=!1;q||(g.a3.prototype.load.call(this),this.endScreen.show())}; g.r.unload=function(){g.a3.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.r.onCueRangeEnter=function(q){this.Hu()&&(this.endScreen.created||this.endScreen.create(),q.getId()==="load"&&this.load())}; g.r.onCueRangeExit=function(q){q.getId()==="load"&&this.loaded&&this.unload()}; g.r.onVideoDataChange=function(){xCm(this);this.S&&OPt(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.D?this.endScreen=new n2(this.player):this.endScreen=new bT(this.player),g.y(this,this.endScreen),g.C5(this.player,this.endScreen.element,4))};g.Nx("endscreen",Abe);})(_yt_player);