(function(g){var window=this;'use strict';var T90=function(f){f.publish("autonavvisibility")},b4o=function(f,D){f.wY("onAutonavCoundownStarted",D)},MfC=function(f){return f.isBackground()&&f.ob()},tfC=function(f){var D,F,Z; return f==null?void 0:(D=f.playerOverlays)==null?void 0:(F=D.playerOverlayRenderer)==null?void 0:(Z=F.autoplay)==null?void 0:Z.playerOverlayAutoplayRenderer},zO=function(f){var D=f.j(),F=D.G; g.x.call(this,{K:"a",C:"ytp-autonav-suggestion-card",W:{href:"{{url}}",target:F?D.Jb:"","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:[{K:"div",ST:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],W:{style:"{{background}}"},L:[{K:"div",W:{"aria-label":"{{timestamp}}"},ST:["ytp-autonav-timestamp"],nQ:"{{duration}}"},{K:"div",ST:["ytp-autonav-live-stamp"],nQ:"En directo"}, {K:"div",ST:["ytp-autonav-upcoming-stamp"],nQ:"Pr\u00f3ximamente"},{K:"div",C:"ytp-autonav-list-overlay",L:[{K:"div",C:"ytp-autonav-mix-text",nQ:"Mix"},{K:"div",C:"ytp-autonav-mix-icon"}]}]},{K:"div",ST:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],nQ:"{{title}}"},{K:"div",ST:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],nQ:"{{author}}"},{K:"div",ST:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],nQ:"{{views_and_publish_time}}"}]});this.U= f;this.suggestion=null;this.Y=F;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},sZ=function(f,D){D=D===void 0?!1:D; g.x.call(this,{K:"div",C:"ytp-autonav-endscreen-countdown-overlay"});var F=this;this.T=D;this.cancelCommand=this.X=void 0;this.B=0;this.container=new g.x({K:"div",C:"ytp-autonav-endscreen-countdown-container"});g.N(this,this.container);this.container.CQ(this.element);D=f.j();var Z=D.G;this.U=f;this.suggestion=null;this.onVideoDataChange("newdata",this.U.getVideoData());this.D(f,"videodatachange",this.onVideoDataChange);this.Y=new g.x({K:"div",C:"ytp-autonav-endscreen-upnext-container",W:{"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:[{K:"div",C:"ytp-autonav-endscreen-upnext-header"},{K:"div",C:"ytp-autonav-endscreen-upnext-alternative-header",nQ:"{{autoplayAlternativeHeader}}"},{K:"a",C:"ytp-autonav-endscreen-link-container",W:{href:"{{url}}",target:Z?D.Jb:""},L:[{K:"div",C:"ytp-autonav-endscreen-upnext-thumbnail",W:{style:"{{background}}"},L:[{K:"div",W:{"aria-label":"{{timestamp}}"},ST:["ytp-autonav-timestamp"], nQ:"{{duration}}"},{K:"div",ST:["ytp-autonav-live-stamp"],nQ:"En directo"},{K:"div",ST:["ytp-autonav-upcoming-stamp"],nQ:"Pr\u00f3ximamente"}]},{K:"div",C:"ytp-autonav-endscreen-video-info",L:[{K:"div",C:"ytp-autonav-endscreen-premium-badge"},{K:"div",C:"ytp-autonav-endscreen-upnext-title",nQ:"{{title}}"},{K:"div",C:"ytp-autonav-endscreen-upnext-author",nQ:"{{author}}"},{K:"div",C:"ytp-autonav-view-and-date",nQ:"{{views_and_publish_time}}"},{K:"div",C:"ytp-autonav-author-and-view",nQ:"{{author_and_views}}"}]}]}]}); g.N(this,this.Y);this.Y.CQ(this.container.element);Z||this.D(this.Y.fQ("ytp-autonav-endscreen-link-container"),"click",this.A5);this.U.createClientVe(this.container.element,this,115127);this.U.createClientVe(this.Y.fQ("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.x({K:"div",C:"ytp-autonav-overlay"});g.N(this,this.overlay);this.overlay.CQ(this.container.element);this.J=new g.x({K:"div",C:"ytp-autonav-endscreen-button-container"});g.N(this,this.J);this.J.CQ(this.container.element); this.cancelButton=new g.x({K:"button",ST:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button","ytp-autonav-endscreen-upnext-button-rounded"],W:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},nQ:"Cancelar"});g.N(this,this.cancelButton);this.cancelButton.CQ(this.J.element);this.cancelButton.listen("click",this.Yv,this);this.U.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.x({K:"a",ST:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", "ytp-autonav-endscreen-upnext-button-rounded"],W:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente v\u00eddeo"},nQ:"Ver ahora"});g.N(this,this.playButton);this.playButton.CQ(this.J.element);this.playButton.listen("click",this.A5,this);this.U.createServerVe(this.playButton.element,this.playButton,!0);(D=this.U.getVideoData())&&S8C(this,D);this.G=new g.xX(function(){czX(F)},500); g.N(this,this.G);this.Hd();this.D(f,"autonavvisibility",this.Hd);this.U.Z("web_autonav_color_transition")&&(this.D(f,"autonavchange",this.tB),this.D(f,"onAutonavCoundownStarted",this.jcb))},q8=function(f){var D=f.U.Zi(!0,f.U.isFullscreen()); g.qI(f.container.element,"ytp-autonav-endscreen-small-mode",f.AS(D));g.qI(f.container.element,"ytp-autonav-endscreen-is-premium",!!f.suggestion&&!!f.suggestion.YGo);g.qI(f.U.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!f.U.T8());g.qI(f.U.getRootNode(),"countdown-running",f.dN());g.qI(f.container.element,"ytp-player-content",f.U.T8());g.Dx(f.overlay.element,{width:D.width+"px"});if(!f.dN()){f.U.T8()?UoC(f,Math.round(v0b(f)/1E3)):UoC(f);D=!!f.suggestion&&!!f.suggestion.Cl;var F=f.U.T8()|| !D;g.qI(f.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!F&&D);g.qI(f.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",F&&!D);f.J.VL(f.U.T8());g.qI(f.element,"ytp-enable-w2w-color-transitions",aH0(f))}},czX=function(f){var D=v0b(f),F=Math,Z=F.min; var I=f.B?Date.now()-f.B:0;F=Z.call(F,I,D);UoC(f,Math.ceil((D-F)/1E3));D-F<=500&&f.dN()?f.select(!0):f.dN()&&f.G.start()},v0b=function(f){if(f.U.isFullscreen()){var D; f=(D=f.U.getVideoData())==null?void 0:D.lC;return f===-1||f===void 0?8E3:f}return f.U.Ll()>=0?f.U.Ll():g.Pf(f.U.j().experiments,"autoplay_time")||1E4},S8C=function(f,D){D=D.getWatchNextResponse(); var F,Z;D=(F=tfC(D))==null?void 0:(Z=F.nextButton)==null?void 0:Z.buttonRenderer;f.X=D==null?void 0:D.navigationEndpoint;F=D==null?void 0:D.trackingParams;f.playButton&&F&&f.U.setTrackingParams(f.playButton.element,F)},aH0=function(f){var D; return!((D=f.U.getVideoData())==null||!D.watchToWatchTransitionRenderer)},UoC=function(f,D){D=D===void 0?-1:D; f=f.Y.fQ("ytp-autonav-endscreen-upnext-header");g.tB(f);if(D>=0){D=String(D);var F="A continuaci\u00f3n en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],Z="A continuaci\u00f3n en $SECONDS".indexOf(F);if(Z>=0){f.appendChild(g.b5("A continuaci\u00f3n en $SECONDS".slice(0,Z)));var I=g.TR("span");g.Fs(I,"ytp-autonav-endscreen-upnext-header-countdown-number");g.aG(I,D);f.appendChild(I);f.appendChild(g.b5("A continuaci\u00f3n en $SECONDS".slice(Z+F.length)));return}}g.aG(f,"Siguiente")},HS=function(f,D){g.x.call(this, {K:"div", ST:["html5-endscreen","ytp-player-content",D||"base-endscreen"]});this.created=!1;this.player=f},ow=function(f){g.x.call(this,{K:"div", ST:["ytp-upnext","ytp-player-content"],W:{"aria-label":"{{aria_label}}"},L:[{K:"div",C:"ytp-cued-thumbnail-overlay-image",W:{style:"{{background}}"}},{K:"span",C:"ytp-upnext-top",L:[{K:"span",C:"ytp-upnext-header",nQ:"Siguiente"},{K:"span",C:"ytp-upnext-title",nQ:"{{title}}"},{K:"span",C:"ytp-upnext-author",nQ:"{{author}}"}]},{K:"a",C:"ytp-upnext-autoplay-icon",W:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente v\u00eddeo"},L:[{K:"svg",W:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},L:[{K:"circle",C:"ytp-svg-autoplay-circle",W:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{K:"circle",C:"ytp-svg-autoplay-ring",W:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{K:"path",C:"ytp-svg-fill",W:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{K:"span",C:"ytp-upnext-bottom",L:[{K:"span",C:"ytp-upnext-cancel"},{K:"span",C:"ytp-upnext-paused", nQ:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=f;this.cancelButton=null;this.X=this.fQ("ytp-svg-autoplay-ring");this.B=this.notification=this.Y=this.suggestion=null;this.G=new g.xX(this.wC,5E3,this);this.J=0;var D=this.fQ("ytp-upnext-cancel");this.cancelButton=new g.x({K:"button",ST:["ytp-upnext-cancel-button","ytp-button"],W:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},nQ:"Cancelar"});g.N(this,this.cancelButton);this.cancelButton.listen("click", this.Ja,this);this.cancelButton.CQ(D);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.N(this,this.G);this.api.createClientVe(this.element,this,18788);D=this.fQ("ytp-upnext-autoplay-icon");this.D(D,"click",this.Bi);this.api.createClientVe(D,this,115130);this.eW();this.D(f,"autonavvisibility",this.eW);this.D(f,"mdxnowautoplaying",this.TUT);this.D(f,"mdxautoplaycanceled",this.C4y);g.qI(this.element,"ytp-upnext-mobile",this.api.j().J)},G70=function(f,D){if(D)return D; if(f.api.isFullscreen()){var F;f=(F=f.api.getVideoData())==null?void 0:F.lC;return f===-1||f===void 0?8E3:f}return f.api.Ll()>=0?f.api.Ll():g.Pf(f.api.j().experiments,"autoplay_time")||1E4},w3C=function(f,D){D=G70(f,D); var F=Math,Z=F.min;var I=(0,g.m5)()-f.J;F=Z.call(F,I,D);D=D===0?1:Math.min(F/D,1);f.X.setAttribute("stroke-dashoffset",""+-211*(D+1));D>=1&&f.dN()&&f.api.getPresentingPlayerType()!==3?f.select(!0):f.dN()&&f.Y.start()},KU=function(f){HS.call(this,f,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.x({K:"div",C:"ytp-suggestion-panel",L:[{K:"div",ST:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],nQ:"M\u00e1s v\u00eddeos"}]});this.S=new g.x({K:"div",C:"ytp-suggestions-container"});this.videos=[];this.B=null;this.X=this.T=!1;this.J=new sZ(this.player);g.N(this,this.J);this.J.CQ(this.element);f.getVideoData().Uq?this.Y=this.J:(this.Y=new ow(f),g.uC(this.player,this.Y.element,4),g.N(this,this.Y));this.overlay=new g.x({K:"div", C:"ytp-autonav-overlay-cancelled-state"});g.N(this,this.overlay);this.overlay.CQ(this.element);this.G=new g.ia(this);g.N(this,this.G);g.N(this,this.table);this.table.CQ(this.element);this.table.show();g.N(this,this.S);this.S.CQ(this.table.element);this.hide()},k5=function(f){var D=f.T8(); D!==f.X&&(f.X=D,T90(f.player),f.X?(f.J!==f.Y&&f.J.hide(),f.table.hide()):(f.J!==f.Y&&f.J.show(),f.table.show()))},WvE=function(f){HS.call(this,f,"videowall-endscreen"); var D=this;this.U=f;this.stills=[];this.B=this.videoData=null;this.G=this.T=!1;this.S=null;g.IC(this.element,"modern-videowall-endscreen");this.J=new g.ia(this);g.N(this,this.J);this.X=new g.xX(function(){g.IC(D.element,"ytp-show-tiles")},0); g.N(this,this.X);this.table=new g.qs({K:"div",C:"ytp-modern-endscreen-content"});g.N(this,this.table);this.table.CQ(this.element);f.getVideoData().Uq?this.Y=new sZ(f,!0):this.Y=new ow(f);g.N(this,this.Y);g.uC(this.player,this.Y.element,4);f.createClientVe(this.element,this,158789);this.hide()},jm=function(f){return g.NV(f.player)&&f.B2()&&!f.B},ho=function(f){var D=f.T8(); D!==f.T&&(f.T=D,T90(f.player))},B9c=function(f){HS.call(this,f,"subscribecard-endscreen"); this.Y=new g.x({K:"div",C:"ytp-subscribe-card",L:[{K:"img",C:"ytp-author-image",W:{src:"{{profilePicture}}"}},{K:"div",C:"ytp-subscribe-card-right",L:[{K:"div",C:"ytp-author-name",nQ:"{{author}}"},{K:"div",C:"html5-subscribe-button-container"}]}]});g.N(this,this.Y);this.Y.CQ(this.element);var D=f.getVideoData();this.subscribeButton=new g.gR("Suscribirme",null,"Anular suscripci\u00f3n",null,!0,!1,D.HR,D.subscribed,"trailer-endscreen",null,f,!1);g.N(this,this.subscribeButton);this.subscribeButton.CQ(this.Y.fQ("html5-subscribe-button-container")); this.D(f,"videodatachange",this.u3);this.u3();this.hide()},yc=function(f){var D=f.j(),F=g.op||g.BL?{style:"will-change: opacity"}:void 0,Z=D.G,I=["ytp-videowall-still"]; D.J&&I.push("ytp-videowall-show-text");g.x.call(this,{K:"a",ST:I,W:{href:"{{url}}",target:Z?D.Jb:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},L:[{K:"div",C:"ytp-videowall-still-image",W:{style:"{{background}}"}},{K:"span",C:"ytp-videowall-still-info",W:{"aria-hidden":"true"},L:[{K:"span",C:"ytp-videowall-still-info-bg",L:[{K:"span",C:"ytp-videowall-still-info-content",W:F,L:[{K:"span",C:"ytp-videowall-still-info-title",nQ:"{{title}}"}, {K:"span",C:"ytp-videowall-still-info-author",nQ:"{{author_and_views}}"},{K:"span",C:"ytp-videowall-still-info-live",nQ:"En directo"},{K:"span",C:"ytp-videowall-still-info-duration",nQ:"{{duration}}"}]}]}]},{K:"span",ST:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],W:{"aria-hidden":"true"},L:[{K:"span",C:"ytp-videowall-still-listlabel-icon"},"Lista de reproducci\u00f3n",{K:"span",C:"ytp-videowall-still-listlabel-length",L:[" (",{K:"span",nQ:"{{playlist_length}}"},")"]}]}, {K:"span",ST:["ytp-videowall-still-listlabel-mix","ytp-videowall-still-listlabel"],W:{"aria-hidden":"true"},L:[{K:"span",C:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{K:"span",C:"ytp-videowall-still-listlabel-length",nQ:" (50+)"}]}]});this.suggestion=null;this.J=Z;this.api=f;this.Y=new g.ia(this);g.N(this,this.Y);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.Y.D(f,"videodatachange",this.onVideoDataChange);f.createServerVe(this.element,this);this.onVideoDataChange()}, Ao=function(f){HS.call(this,f,"videowall-endscreen"); var D=this;this.U=f;this.B=0;this.stills=[];this.G=this.videoData=null;this.X=this.S=!1;this.N=null;this.J=new g.ia(this);g.N(this,this.J);this.T=new g.xX(function(){g.IC(D.element,"ytp-show-tiles")},0); g.N(this,this.T);var F=new g.x({K:"button",ST:["ytp-button","ytp-endscreen-previous"],W:{"aria-label":"Anterior"},L:[g.An()]});g.N(this,F);F.CQ(this.element);F.listen("click",this.f_,this);this.table=new g.qs({K:"div",C:"ytp-endscreen-content"});g.N(this,this.table);this.table.CQ(this.element);F=new g.x({K:"button",ST:["ytp-button","ytp-endscreen-next"],W:{"aria-label":"Siguiente"},L:[g.$g()]});g.N(this,F);F.CQ(this.element);F.listen("click",this.xv,this);f.getVideoData().Uq?this.Y=new sZ(f,!0):this.Y= new ow(f);g.N(this,this.Y);g.uC(this.player,this.Y.element,4);f.createClientVe(this.element,this,158789);this.hide()},$5=function(f){return g.NV(f.player)&&f.B2()&&!f.G},Vc=function(f){var D=f.T8(); D!==f.S&&(f.S=D,T90(f.player))},rz0=function(f,D){g.x.call(this,{K:"button", ST:["ytp-watch-on-youtube-button","ytp-button"],nQ:"{{content}}"});this.U=f;this.buttonType=this.buttonType=D;this.Gr();this.buttonType===2&&g.IC(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.Gr);this.VL(!0)},Rw=function(f){HS.call(this,f,"watch-again-on-youtube-endscreen"); this.watchButton=new rz0(f,1);g.N(this,this.watchButton);this.watchButton.CQ(this.element);g.iwE(f)&&(this.Y=new g.XX(f),g.N(this,this.Y),this.J=new g.x({K:"div",ST:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],W:{tabIndex:"-1"},L:[this.Y]}),g.N(this,this.J),this.Y.CQ(this.J.element),this.J.CQ(this.element));f.createClientVe(this.element,this,156914);this.hide()},JzU=function(f){g.KS.call(this,f); var D=this;this.endScreen=null;this.Y=this.J=this.B=!1;this.listeners=new g.ia(this);g.N(this,this.listeners);var F=f.j();f.isEmbedsShortsMode()?this.endScreen=new Rw(f):LvV(f)?(this.B=!0,lHL(this),this.Y?this.endScreen=new KU(f):F.Z("delhi_modern_endscreen")?this.endScreen=new WvE(f):this.endScreen=new Ao(f)):F.Tm?this.endScreen=new B9c(f):this.endScreen=new HS(f);g.N(this,this.endScreen);g.uC(f,this.endScreen.element,4);E0L(this);this.listeners.D(f,"videodatachange",this.onVideoDataChange,this); this.listeners.D(f,g.Nh("endscreen"),function(Z){D.onCueRangeEnter(Z)}); this.listeners.D(f,g.gA("endscreen"),function(Z){D.onCueRangeExit(Z)})},lHL=function(f){var D=f.player.getVideoData(); if(!D||f.Y===D.Gm&&f.J===D.Uq)return!1;f.Y=D.Gm;f.J=D.Uq;return!0},LvV=function(f){f=f.j(); return f.Xt&&!f.Tm&&!f.disableOrganicUi},E0L=function(f){f.player.WD("endscreen"); var D=f.player.getVideoData();D=new g.Jm(Math.max((D.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var F=new g.Jm(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});f.player.Bw([D,F])}; g.wW.prototype.Ll=g.BD(8,function(){return this.app.Ll()}); g.iH.prototype.Ll=g.BD(7,function(){return this.getVideoData().fP}); g.SK.prototype.RO=g.BD(6,function(f){this.L7().RO(f)}); g.LS.prototype.RO=g.BD(5,function(f){this.q8!==f&&(this.q8=f,this.KG())}); g.C(zO,g.x);zO.prototype.select=function(){this.U.As(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.QX||void 0)&&this.U.logClick(this.element)}; zO.prototype.onClick=function(f){g.hA(f,this.U,this.Y,this.suggestion.sessionData||void 0)&&this.select()}; zO.prototype.onKeyPress=function(f){switch(f.keyCode){case 13:case 32:f.defaultPrevented||(this.select(),f.preventDefault())}};g.C(sZ,g.x);g.d=sZ.prototype;g.d.oH=function(f){this.suggestion!==f&&(this.suggestion=f,g.YK(this.Y,f),this.playButton.updateValue("url",this.suggestion.wQ()),q8(this))}; g.d.dN=function(){return this.B>0}; g.d.Z6=function(){this.dN()||(this.B=Date.now(),czX(this),b4o(this.U,v0b(this)),g.qI(this.U.getRootNode(),"countdown-running",this.dN()))}; g.d.QN=function(){this.ZS();czX(this);var f=this.Y.fQ("ytp-autonav-endscreen-upnext-header");f&&g.aG(f,"Siguiente")}; g.d.ZS=function(){this.dN()&&(this.G.stop(),this.B=0)}; g.d.select=function(f){this.U.nextVideo(!1,f===void 0?!1:f);this.ZS()}; g.d.A5=function(f){g.hA(f,this.U)&&(f.currentTarget===this.playButton.element?this.U.logClick(this.playButton.element):f.currentTarget===this.Y.fQ("ytp-autonav-endscreen-link-container")&&(f=this.Y.fQ("ytp-autonav-endscreen-link-container"),this.U.logVisibility(f,!0),this.U.logClick(f)),this.X?(this.U.wY("innertubeCommand",this.X),this.ZS()):this.select())}; g.d.Yv=function(){this.U.logClick(this.cancelButton.element);g.Bv(this.U,!0);this.cancelCommand&&this.U.wY("innertubeCommand",this.cancelCommand)}; g.d.onVideoDataChange=function(f,D){S8C(this,D);f=D.getWatchNextResponse();var F,Z;f=(F=tfC(f))==null?void 0:(Z=F.cancelButton)==null?void 0:Z.buttonRenderer;this.cancelCommand=f==null?void 0:f.command}; g.d.jcb=function(f){if(aH0(this)){var D=this.U.getVideoData().watchToWatchTransitionRenderer,F=D==null?void 0:D.fromColorPaletteDark;D=D==null?void 0:D.toColorPaletteDark;if(F&&D){var Z=this.element;Z.style.setProperty("--w2w-start-background-color",g.Lb(F.surgeColor));Z.style.setProperty("--w2w-start-primary-text-color",g.Lb(F.primaryTitleColor));Z.style.setProperty("--w2w-start-secondary-text-color",g.Lb(F.secondaryTitleColor));Z.style.setProperty("--w2w-end-background-color",g.Lb(D.surgeColor)); Z.style.setProperty("--w2w-end-primary-text-color",g.Lb(D.primaryTitleColor));Z.style.setProperty("--w2w-end-secondary-text-color",g.Lb(D.secondaryTitleColor));Z.style.setProperty("--w2w-animation-duration",f+"ms")}g.qI(this.element,"ytp-w2w-animate",!0)}}; g.d.tB=function(f){this.U.Z("web_autonav_color_transition")&&f!==2&&g.qI(this.element,"ytp-w2w-animate",!1)}; g.d.Hd=function(){var f=this.U.T8();this.T&&this.hN!==f&&this.VL(f);q8(this);this.U.logVisibility(this.container.element,f);this.U.logVisibility(this.cancelButton.element,f);this.U.logVisibility(this.Y.fQ("ytp-autonav-endscreen-link-container"),f);this.U.logVisibility(this.playButton.element,f)}; g.d.AS=function(f){return f.width<400||f.height<459};g.C(HS,g.x);g.d=HS.prototype;g.d.create=function(){this.created=!0}; g.d.destroy=function(){this.created=!1}; g.d.B2=function(){return!1}; g.d.T8=function(){return!1}; g.d.xO=function(){return!1};g.C(ow,g.x);g.d=ow.prototype;g.d.wC=function(){this.notification&&(this.G.stop(),this.DK(this.B),this.B=null,this.notification.close(),this.notification=null)}; g.d.oH=function(f){this.suggestion=f;g.YK(this,f,"hqdefault.jpg")}; g.d.eW=function(){this.VL(this.api.T8());this.api.logVisibility(this.element,this.api.T8());this.api.logVisibility(this.fQ("ytp-upnext-autoplay-icon"),this.api.T8());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.T8())}; g.d.rzy=function(){window.focus();this.wC()}; g.d.Z6=function(f){var D=this;this.dN()||(g.FJ("a11y-announce","Siguiente "+this.suggestion.title),this.J=(0,g.m5)(),this.Y=new g.xX(function(){w3C(D,f)},25),w3C(this,f),b4o(this.api,G70(this,f))); g.zP(this.element,"ytp-upnext-autoplay-paused")}; g.d.hide=function(){g.x.prototype.hide.call(this)}; g.d.dN=function(){return!!this.Y}; g.d.QN=function(){this.ZS();this.J=(0,g.m5)();w3C(this);g.IC(this.element,"ytp-upnext-autoplay-paused")}; g.d.ZS=function(){this.dN()&&(this.Y.dispose(),this.Y=null)}; g.d.select=function(f){f=f===void 0?!1:f;if(this.api.j().Z("autonav_notifications")&&f&&window.Notification&&typeof document.hasFocus==="function"){var D=Notification.permission;D==="default"?Notification.requestPermission():D!=="granted"||document.hasFocus()||(this.wC(),this.notification=new Notification("Siguiente",{body:this.suggestion.title,icon:this.suggestion.ut()}),this.B=this.D(this.notification,"click",this.rzy),this.G.start())}this.ZS();this.api.nextVideo(!1,f)}; g.d.Bi=function(f){!g.Ua(this.cancelButton.element,f.target)&&g.hA(f,this.api)&&(this.api.T8()&&this.api.logClick(this.fQ("ytp-upnext-autoplay-icon")),this.select())}; g.d.Ja=function(){this.api.T8()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.Bv(this.api,!0)}; g.d.TUT=function(f){this.api.getPresentingPlayerType();this.show();this.Z6(f)}; g.d.C4y=function(){this.api.getPresentingPlayerType();this.ZS();this.hide()}; g.d.Ey=function(){this.ZS();this.wC();g.x.prototype.Ey.call(this)};g.C(KU,HS);g.d=KU.prototype;g.d.create=function(){HS.prototype.create.call(this);this.G.D(this.player,"appresize",this.Oi);this.G.D(this.player,"onVideoAreaChange",this.Oi);this.G.D(this.player,"videodatachange",this.onVideoDataChange);this.G.D(this.player,"autonavchange",this.aY);this.G.D(this.player,"onAutonavCancelled",this.GZ);this.onVideoDataChange()}; g.d.show=function(){HS.prototype.show.call(this);(this.T||this.B&&this.B!==this.videoData.clientPlaybackNonce)&&g.Bv(this.player,!1);g.NV(this.player)&&this.B2()&&!this.B?(k5(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3||MfC(this.player.EG())&&this.player.Z("web_player_pip_logging_fix")?this.Y.select(!0):this.Y.Z6():this.videoData.autonavState===3&&this.Y.QN()):(g.Bv(this.player,!0),k5(this));this.Oi()}; g.d.hide=function(){HS.prototype.hide.call(this);this.Y.QN();k5(this)}; g.d.Oi=function(){var f=this.player.Zi(!0,this.player.isFullscreen());k5(this);q8(this.J);g.qI(this.element,"ytp-autonav-cancelled-small-mode",this.AS(f));g.qI(this.element,"ytp-autonav-cancelled-tiny-mode",this.g_(f));g.qI(this.element,"ytp-autonav-cancelled-mini-mode",f.width<=400||f.height<=360);this.overlay&&g.Dx(this.overlay.element,{width:f.width+"px"});if(!this.X)for(f=0;f0&&(f= y*4,V=D<=K-2&&k>=h*4;if((h+1)/y*Z/z>z/(h/(y+1)*Z)&&V)k-=h*4,D+=2;else if(A)k-=y*4,f+=2;else if(V)k-=h*4,D+=2;else break}Z=!1;k>=12&&F*4-k<=6&&(D>=4||f>=4)&&(Z=!0);k=f*96;H=D*54;z=k/H=f-2&&h>=D-2?V=1:h%2===0&&K%2===0&&(h<2&&K<2?h===0&&K===0&&(V=2):V=2),y=g.fG(y+this.B,F),V!==0){A=this.stills[z];A||(A=new yc(this.player),this.stills[z]=A,p.appendChild(A.element));var R=Math.floor(H*h/D),m=Math.floor(k*K/f),b=Math.floor(H*(h+V)/D)-R-4,U=Math.floor(k*(K+V)/f)-m-4;g.q2(A.element,m,R);g.kH(A.element,U,b);g.Dx(A.element,"transitionDelay",(h+K)/20+"s");g.qI(A.element,"ytp-videowall-still-mini", V===1);g.qI(A.element,"ytp-videowall-still-large",V>2);V=Math.max(U,b);g.qI(A.element,"ytp-videowall-still-round-large",V>=256);g.qI(A.element,"ytp-videowall-still-round-medium",V>96&&V<256);g.qI(A.element,"ytp-videowall-still-round-small",V<=96);y=I[y];A.suggestion!==y&&(A.suggestion=y,V=A.api.j(),R=g.Zy(A.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.YK(A,y,R),g.LM(V)&&!A.api.Z("web_player_log_click_before_generating_ve_conversion_params")&&(V=y.wQ(),R={},g.$u(A.api,"addEmbedsConversionTrackingParams", [R]),V=g.tL(V,R),A.updateValue("url",V)),(y=(y=y.sessionData)&&y.itct)&&A.api.setTrackingParams(A.element,y));z++}p.ariaBusy="false";g.qI(this.element,"ytp-endscreen-paginate",z=z;I--)f=this.stills[I],g.cE(f.element),g.jg(f);this.stills.length=z}}; g.d.onVideoDataChange=function(){var f=this.player.getVideoData(1);this.videoData!==f&&(f!=null&&g.jb(f)?(this.B=0,this.videoData=f,this.xu()):this.player.Gx("missg",{vid:(f==null?void 0:f.videoId)||"",cpn:(f==null?void 0:f.clientPlaybackNonce)||""}))}; g.d.xv=function(){this.B+=this.stills.length;this.xu()}; g.d.f_=function(){this.B-=this.stills.length;this.xu()}; g.d.xO=function(){return this.Y.dN()}; g.d.hL=function(f){f===1?(this.X=!1,this.G=this.videoData.clientPlaybackNonce,this.Y.ZS(),this.hN&&this.xu()):(this.X=!0,this.hN&&$5(this)&&(f===2?this.Y.Z6():f===3&&this.Y.QN()))}; g.d.EC=function(f){if(f){for(f=0;f0||f.endSeconds>0||f.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!D)return!0;var F;var Z=!!((f==null?0:g.jb(f))||(f==null?0:(F=f.suggestions)==null?0:F.length));Z=!LvV(this.player)||Z;f=f.Qu;F=this.player.IZ();return Z&&!f&&!F&&!D}; g.d.T8=function(){return this.endScreen.T8()}; g.d.cNx=function(){return this.T8()?this.endScreen.xO():!1}; g.d.Ey=function(){this.player.WD("endscreen");g.KS.prototype.Ey.call(this)}; g.d.load=function(){var f=this.player.getVideoData();var D=f.transitionEndpointAtEndOfStream;if(D&&D.videoId){var F=this.player.I_().z8.get("heartbeat"),Z=g.jb(f);!Z||D.videoId!==Z.videoId||f.W1?(this.player.As(D.videoId,void 0,void 0,!0,!0,D),F&&F.yb("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),f=!0):f=!1}else f=!1;f||(g.KS.prototype.load.call(this),this.endScreen.show())}; g.d.unload=function(){g.KS.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.d.onCueRangeEnter=function(f){this.L1()&&(this.endScreen.created||this.endScreen.create(),f.getId()==="load"&&this.load())}; g.d.onCueRangeExit=function(f){f.getId()==="load"&&this.loaded&&this.unload()}; g.d.onVideoDataChange=function(){E0L(this);this.B&&lHL(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.Y?this.endScreen=new KU(this.player):this.endScreen=new Ao(this.player),g.N(this,this.endScreen),g.uC(this.player,this.endScreen.element,4))};g.o2("endscreen",JzU);})(_yt_player);