(function(g){var window=this;'use strict';var SU=function(p){var a=p.C(),l=a.j;g.X.call(this,{X:"a",T:"ytp-autonav-suggestion-card",V:{href:"{{url}}",target:l?a.Sl:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},N:[{X:"div",A9:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],V:{style:"{{background}}"},N:[{X:"div",V:{"aria-label":"{{timestamp}}"},A9:["ytp-autonav-timestamp"],yY:"{{duration}}"},{X:"div", A9:["ytp-autonav-live-stamp"],yY:"En directo"},{X:"div",A9:["ytp-autonav-upcoming-stamp"],yY:"Pr\u00f3ximamente"},{X:"div",T:"ytp-autonav-list-overlay",N:[{X:"div",T:"ytp-autonav-mix-text",yY:"Mix"},{X:"div",T:"ytp-autonav-mix-icon"}]}]},{X:"div",A9:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],yY:"{{title}}"},{X:"div",A9:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],yY:"{{author}}"},{X:"div",A9:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"], yY:"{{views_and_publish_time}}"}]});this.B=p;this.suggestion=null;this.L=l;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},nQ=function(p,a){a=a===void 0?!1:a; g.X.call(this,{X:"div",T:"ytp-autonav-endscreen-countdown-overlay"});var l=this;this.G=a;this.cancelCommand=this.W=void 0;this.U=0;this.container=new g.X({X:"div",T:"ytp-autonav-endscreen-countdown-container"});g.E(this,this.container);this.container.lT(this.element);a=p.C();var y=a.j;this.B=p;this.suggestion=null;this.onVideoDataChange("newdata",this.B.getVideoData());this.J(p,"videodatachange",this.onVideoDataChange);this.L=new g.X({X:"div",T:"ytp-autonav-endscreen-upnext-container",V:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},N:[{X:"div",T:"ytp-autonav-endscreen-upnext-header"},{X:"div",T:"ytp-autonav-endscreen-upnext-alternative-header",yY:"{{autoplayAlternativeHeader}}"},{X:"a",T:"ytp-autonav-endscreen-link-container",V:{href:"{{url}}",target:y?a.Sl:""},N:[{X:"div",T:"ytp-autonav-endscreen-upnext-thumbnail",V:{style:"{{background}}"},N:[{X:"div",V:{"aria-label":"{{timestamp}}"},A9:["ytp-autonav-timestamp"], yY:"{{duration}}"},{X:"div",A9:["ytp-autonav-live-stamp"],yY:"En directo"},{X:"div",A9:["ytp-autonav-upcoming-stamp"],yY:"Pr\u00f3ximamente"}]},{X:"div",T:"ytp-autonav-endscreen-video-info",N:[{X:"div",T:"ytp-autonav-endscreen-premium-badge"},{X:"div",T:"ytp-autonav-endscreen-upnext-title",yY:"{{title}}"},{X:"div",T:"ytp-autonav-endscreen-upnext-author",yY:"{{author}}"},{X:"div",T:"ytp-autonav-view-and-date",yY:"{{views_and_publish_time}}"},{X:"div",T:"ytp-autonav-author-and-view",yY:"{{author_and_views}}"}]}]}]}); g.E(this,this.L);this.L.lT(this.container.element);y||this.J(this.L.d7("ytp-autonav-endscreen-link-container"),"click",this.IG);this.B.createClientVe(this.container.element,this,115127);this.B.createClientVe(this.L.d7("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.X({X:"div",T:"ytp-autonav-overlay"});g.E(this,this.overlay);this.overlay.lT(this.container.element);this.S=new g.X({X:"div",T:"ytp-autonav-endscreen-button-container"});g.E(this,this.S);this.S.lT(this.container.element); this.cancelButton=new g.X({X:"button",A9:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",a.D("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],V:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},yY:"Cancelar"});g.E(this,this.cancelButton);this.cancelButton.lT(this.S.element);this.cancelButton.listen("click",this.RW,this);this.B.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.X({X:"a",A9:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",a.D("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],V:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente v\u00eddeo"},yY:"Ver ahora"});g.E(this,this.playButton);this.playButton.lT(this.S.element);this.playButton.listen("click",this.IG,this);this.B.createServerVe(this.playButton.element,this.playButton,!0);(a=this.B.getVideoData())&&$47(this,a);this.j=new g.l_(function(){Pf1(l)},500); g.E(this,this.j);this.pX();this.J(p,"autonavvisibility",this.pX);this.B.D("web_autonav_color_transition")&&(this.J(p,"autonavchange",this.HF),this.J(p,"onAutonavCoundownStarted",this.geu))},VS=function(p){var a=p.bC(); a!==p.W&&(p.W=a,Lf_(p.player),p.W?(p.S!==p.L&&p.S.hide(),p.table.hide()):(p.S!==p.L&&p.S.show(),p.table.show()))},Zy=function(p){var a=p.bC(); a!==p.G&&(p.G=a,Lf_(p.player))},Lf_=function(p){p.publish("autonavvisibility")},X4M=function(p,a){g.X.call(this,{X:"button", A9:["ytp-watch-on-youtube-button","ytp-button"],yY:"{{content}}"});this.B=p;this.buttonType=this.buttonType=a;this.KT();this.buttonType===2&&g.uD(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.KT);this.Kx(!0)},x4U=function(p){if(p.B.isFullscreen()){var a; p=(a=p.B.getVideoData())==null?void 0:a.LP;return p===-1||p===void 0?8E3:p}return p.B.k0()>=0?p.B.k0():g.sW(p.B.C().experiments,"autoplay_time")||1E4},Ff2=function(p){o6.call(this,p,"videowall-endscreen"); var a=this;this.B=p;this.stills=[];this.U=this.videoData=null;this.j=this.G=!1;this.K=null;g.uD(this.element,"modern-videowall-endscreen");this.S=new g.hm(this);g.E(this,this.S);this.W=new g.l_(function(){g.uD(a.element,"ytp-show-tiles")},0); g.E(this,this.W);this.table=new g.RC({X:"div",T:"ytp-modern-endscreen-content"});g.E(this,this.table);this.table.lT(this.element);p.getVideoData().Kt?this.L=new nQ(p,!0):this.L=new zy(p);g.E(this,this.L);g.uW(this.player,this.L.element,4);p.createClientVe(this.element,this,158789);this.hide()},zy=function(p){g.X.call(this,{X:"div", A9:["ytp-upnext","ytp-player-content"],V:{"aria-label":"{{aria_label}}"},N:[{X:"div",T:"ytp-cued-thumbnail-overlay-image",V:{style:"{{background}}"}},{X:"span",T:"ytp-upnext-top",N:[{X:"span",T:"ytp-upnext-header",yY:"Siguiente"},{X:"span",T:"ytp-upnext-title",yY:"{{title}}"},{X:"span",T:"ytp-upnext-author",yY:"{{author}}"}]},{X:"a",T:"ytp-upnext-autoplay-icon",V:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente v\u00eddeo"},N:[{X:"svg",V:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},N:[{X:"circle",T:"ytp-svg-autoplay-circle",V:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{X:"circle",T:"ytp-svg-autoplay-ring",V:{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",T:"ytp-svg-fill",V:{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",T:"ytp-upnext-bottom",N:[{X:"span",T:"ytp-upnext-cancel"},{X:"span",T:"ytp-upnext-paused", yY:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=p;this.cancelButton=null;this.W=this.d7("ytp-svg-autoplay-ring");this.U=this.notification=this.L=this.suggestion=null;this.j=new g.l_(this.LJ,5E3,this);this.S=0;var a=this.d7("ytp-upnext-cancel");this.cancelButton=new g.X({X:"button",A9:["ytp-upnext-cancel-button","ytp-button"],V:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},yY:"Cancelar"});g.E(this,this.cancelButton);this.cancelButton.listen("click", this.vF,this);this.cancelButton.lT(a);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.E(this,this.j);this.api.createClientVe(this.element,this,18788);a=this.d7("ytp-upnext-autoplay-icon");this.J(a,"click",this.tj);this.api.createClientVe(a,this,115130);this.KX();this.J(p,"autonavvisibility",this.KX);this.J(p,"mdxnowautoplaying",this.UEO);this.J(p,"mdxautoplaycanceled",this.j4s);g.JB(this.element,"ytp-upnext-mobile",this.api.C().S)},EDU=function(p,a){a=a===void 0? -1:a; p=p.L.d7("ytp-autonav-endscreen-upnext-header");g.Jh(p);if(a>=0){a=String(a);var l="A continuaci\u00f3n en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],y="A continuaci\u00f3n en $SECONDS".indexOf(l);if(y>=0){p.appendChild(g.kX("A continuaci\u00f3n en $SECONDS".slice(0,y)));var S=g.JI("span");g.CY(S,"ytp-autonav-endscreen-upnext-header-countdown-number");g.Cp(S,a);p.appendChild(S);p.appendChild(g.kX("A continuaci\u00f3n en $SECONDS".slice(y+l.length)));return}}g.Cp(p,"Siguiente")},Cfl=function(p){p.player.lf("endscreen"); var a=p.player.getVideoData();a=new g.nF(Math.max((a.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var l=new g.nF(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});p.player.Kh([a,l])},vDl=function(p){var a; return!((a=p.B.getVideoData())==null||!a.watchToWatchTransitionRenderer)},dL=function(p){var a=p.B.uU(!0,p.B.isFullscreen()); g.JB(p.container.element,"ytp-autonav-endscreen-small-mode",p.Yo(a));g.JB(p.container.element,"ytp-autonav-endscreen-is-premium",!!p.suggestion&&!!p.suggestion.K7O);g.JB(p.B.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!p.B.bC());g.JB(p.B.getRootNode(),"countdown-running",p.Gf());g.JB(p.container.element,"ytp-player-content",p.B.bC());g.B8(p.overlay.element,{width:a.width+"px"});if(!p.Gf()){p.B.bC()?EDU(p,Math.round(x4U(p)/1E3)):EDU(p);a=!!p.suggestion&&!!p.suggestion.UG;var l=p.B.bC()|| !a;g.JB(p.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!l&&a);g.JB(p.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",l&&!a);p.S.Kx(p.B.bC());g.JB(p.element,"ytp-enable-w2w-color-transitions",vDl(p))}},$47=function(p,a){a=a.getWatchNextResponse(); var l,y;a=(l=Kf8(a))==null?void 0:(y=l.nextButton)==null?void 0:y.buttonRenderer;p.W=a==null?void 0:a.navigationEndpoint;l=a==null?void 0:a.trackingParams;p.playButton&&l&&p.B.setTrackingParams(p.playButton.element,l)},Gy=function(p){o6.call(this,p,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.X({X:"div",T:"ytp-suggestion-panel",N:[{X:"div",A9:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],yY:"M\u00e1s v\u00eddeos"}]});this.K=new g.X({X:"div",T:"ytp-suggestions-container"});this.videos=[];this.U=null;this.W=this.G=!1;this.S=new nQ(this.player);g.E(this,this.S);this.S.lT(this.element);p.getVideoData().Kt?this.L=this.S:(this.L=new zy(p),g.uW(this.player,this.L.element,4),g.E(this,this.L));this.overlay=new g.X({X:"div", T:"ytp-autonav-overlay-cancelled-state"});g.E(this,this.overlay);this.overlay.lT(this.element);this.j=new g.hm(this);g.E(this,this.j);g.E(this,this.table);this.table.lT(this.element);this.table.show();g.E(this,this.K);this.K.lT(this.table.element);this.hide()},Kf8=function(p){var a,l,y; return p==null?void 0:(a=p.playerOverlays)==null?void 0:(l=a.playerOverlayRenderer)==null?void 0:(y=l.autoplay)==null?void 0:y.playerOverlayAutoplayRenderer},eOG=function(p,a){if(a)return a; if(p.api.isFullscreen()){var l;p=(l=p.api.getVideoData())==null?void 0:l.LP;return p===-1||p===void 0?8E3:p}return p.api.k0()>=0?p.api.k0():g.sW(p.api.C().experiments,"autoplay_time")||1E4},ukK=function(p){g.N_.call(this,p); var a=this;this.endScreen=null;this.L=this.S=this.U=!1;this.listeners=new g.hm(this);g.E(this,this.listeners);var l=p.C();p.isEmbedsShortsMode()?this.endScreen=new Bm(p):bhl(p)?(this.U=!0,I_W(this),this.L?this.endScreen=new Gy(p):l.D("delhi_modern_endscreen")?this.endScreen=new Ff2(p):this.endScreen=new cm(p)):l.TO?this.endScreen=new ROl(p):this.endScreen=new o6(p);g.E(this,this.endScreen);g.uW(p,this.endScreen.element,4);Cfl(this);this.listeners.J(p,"videodatachange",this.onVideoDataChange,this); this.listeners.J(p,g.I4("endscreen"),function(y){a.onCueRangeEnter(y)}); this.listeners.J(p,g.c4("endscreen"),function(y){a.onCueRangeExit(y)})},bhl=function(p){p=p.C(); return p.vZ&&!p.TO&&!p.disableOrganicUi},rL=function(p){return g.$9(p.player)&&p.S_()&&!p.j},Bm=function(p){o6.call(this,p,"watch-again-on-youtube-endscreen"); this.watchButton=new X4M(p,1);g.E(this,this.watchButton);this.watchButton.lT(this.element);g.Lcc(p)&&(this.L=new g.xT(p),g.E(this,this.L),this.S=new g.X({X:"div",A9:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],V:{tabIndex:"-1"},N:[this.L]}),g.E(this,this.S),this.L.lT(this.S.element),this.S.lT(this.element));p.createClientVe(this.element,this,156914);this.hide()},wL=function(p){var a=p.bC(); a!==p.K&&(p.K=a,Lf_(p.player))},$6=function(p){var a=p.C(),l=g.TE||g.vL?{style:"will-change: opacity"}:void 0,y=a.j,S=["ytp-videowall-still"]; a.S&&S.push("ytp-videowall-show-text");g.X.call(this,{X:"a",A9:S,V:{href:"{{url}}",target:y?a.Sl:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},N:[{X:"div",T:"ytp-videowall-still-image",V:{style:"{{background}}"}},{X:"span",T:"ytp-videowall-still-info",V:{"aria-hidden":"true"},N:[{X:"span",T:"ytp-videowall-still-info-bg",N:[{X:"span",T:"ytp-videowall-still-info-content",V:l,N:[{X:"span",T:"ytp-videowall-still-info-title",yY:"{{title}}"}, {X:"span",T:"ytp-videowall-still-info-author",yY:"{{author_and_views}}"},{X:"span",T:"ytp-videowall-still-info-live",yY:"En directo"},{X:"span",T:"ytp-videowall-still-info-duration",yY:"{{duration}}"}]}]}]},{X:"span",A9:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],V:{"aria-hidden":"true"},N:[{X:"span",T:"ytp-videowall-still-listlabel-icon"},"Lista de reproducci\u00f3n",{X:"span",T:"ytp-videowall-still-listlabel-length",N:[" (",{X:"span",yY:"{{playlist_length}}"},")"]}]}, {X:"span",A9:["ytp-videowall-still-listlabel-mix","ytp-videowall-still-listlabel"],V:{"aria-hidden":"true"},N:[{X:"span",T:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{X:"span",T:"ytp-videowall-still-listlabel-length",yY:" (50+)"}]}]});this.suggestion=null;this.S=y;this.api=p;this.L=new g.hm(this);g.E(this,this.L);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.L.J(p,"videodatachange",this.onVideoDataChange);p.createServerVe(this.element,this);this.onVideoDataChange()}, Pm=function(p){return g.$9(p.player)&&p.S_()&&!p.U},Pf1=function(p){var a=x4U(p),l=Math,y=l.min; var S=p.U?Date.now()-p.U:0;l=y.call(l,S,a);EDU(p,Math.ceil((a-l)/1E3));a-l<=500&&p.Gf()?p.select(!0):p.Gf()&&p.j.start()},cm=function(p){o6.call(this,p,"videowall-endscreen"); var a=this;this.B=p;this.U=0;this.stills=[];this.j=this.videoData=null;this.W=this.K=!1;this.Z=null;this.S=new g.hm(this);g.E(this,this.S);this.G=new g.l_(function(){g.uD(a.element,"ytp-show-tiles")},0); g.E(this,this.G);var l=new g.X({X:"button",A9:["ytp-button","ytp-endscreen-previous"],V:{"aria-label":"Anterior"},N:[g.G7()]});g.E(this,l);l.lT(this.element);l.listen("click",this.rS,this);this.table=new g.RC({X:"div",T:"ytp-endscreen-content"});g.E(this,this.table);this.table.lT(this.element);l=new g.X({X:"button",A9:["ytp-button","ytp-endscreen-next"],V:{"aria-label":"Siguiente"},N:[g.Et()]});g.E(this,l);l.lT(this.element);l.listen("click",this.Mn,this);p.getVideoData().Kt?this.L=new nQ(p,!0):this.L= new zy(p);g.E(this,this.L);g.uW(this.player,this.L.element,4);p.createClientVe(this.element,this,158789);this.hide()},OhG=function(p,a){p.xv("onAutonavCoundownStarted",a)},k1B=function(p,a){a=eOG(p,a); var l=Math,y=l.min;var S=(0,g.Ek)()-p.S;l=y.call(l,S,a);a=a===0?1:Math.min(l/a,1);p.W.setAttribute("stroke-dashoffset",""+-211*(a+1));a>=1&&p.Gf()&&p.api.getPresentingPlayerType()!==3?p.select(!0):p.Gf()&&p.L.start()},o6=function(p,a){g.X.call(this,{X:"div", A9:["html5-endscreen","ytp-player-content",a||"base-endscreen"]});this.created=!1;this.player=p},ROl=function(p){o6.call(this,p,"subscribecard-endscreen"); this.L=new g.X({X:"div",T:"ytp-subscribe-card",N:[{X:"img",T:"ytp-author-image",V:{src:"{{profilePicture}}"}},{X:"div",T:"ytp-subscribe-card-right",N:[{X:"div",T:"ytp-author-name",yY:"{{author}}"},{X:"div",T:"html5-subscribe-button-container"}]}]});g.E(this,this.L);this.L.lT(this.element);var a=p.getVideoData();this.subscribeButton=new g.mw("Suscribirme",null,"Anular suscripci\u00f3n",null,!0,!1,a.mK,a.subscribed,"trailer-endscreen",null,p,!1);g.E(this,this.subscribeButton);this.subscribeButton.lT(this.L.d7("html5-subscribe-button-container")); this.J(p,"videodatachange",this.pz);this.pz();this.hide()},I_W=function(p){var a=p.player.getVideoData(); if(!a||p.L===a.X_&&p.S===a.Kt)return!1;p.L=a.X_;p.S=a.Kt;return!0}; g.dA.prototype.k0=g.vr(6,function(){return this.app.k0()}); g.$T.prototype.k0=g.vr(5,function(){return this.getVideoData().DR}); g.oa.prototype.On=g.vr(4,function(p){this.nC().On(p)}); g.t9.prototype.On=g.vr(3,function(p){this.iI!==p&&(this.iI=p,this.YS())}); g.A(SU,g.X);SU.prototype.select=function(){this.B.FT(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.cC||void 0)&&this.B.logClick(this.element)}; SU.prototype.onClick=function(p){g.dK(p,this.B,this.L,this.suggestion.sessionData||void 0)&&this.select()}; SU.prototype.onKeyPress=function(p){switch(p.keyCode){case 13:case 32:p.defaultPrevented||(this.select(),p.preventDefault())}};g.A(nQ,g.X);g.L=nQ.prototype;g.L.Ju=function(p){this.suggestion!==p&&(this.suggestion=p,g.w2(this.L,p),this.playButton.updateValue("url",this.suggestion.pC()),dL(this))}; g.L.Gf=function(){return this.U>0}; g.L.Yw=function(){this.Gf()||(this.U=Date.now(),Pf1(this),OhG(this.B,x4U(this)),g.JB(this.B.getRootNode(),"countdown-running",this.Gf()))}; g.L.nU=function(){this.Ep();Pf1(this);var p=this.L.d7("ytp-autonav-endscreen-upnext-header");p&&g.Cp(p,"Siguiente")}; g.L.Ep=function(){this.Gf()&&(this.j.stop(),this.U=0)}; g.L.select=function(p){this.B.nextVideo(!1,p===void 0?!1:p);this.Ep()}; g.L.IG=function(p){g.dK(p,this.B)&&(p.currentTarget===this.playButton.element?this.B.logClick(this.playButton.element):p.currentTarget===this.L.d7("ytp-autonav-endscreen-link-container")&&(p=this.L.d7("ytp-autonav-endscreen-link-container"),this.B.logVisibility(p,!0),this.B.logClick(p)),this.W?(this.B.xv("innertubeCommand",this.W),this.Ep()):this.select())}; g.L.RW=function(){this.B.logClick(this.cancelButton.element);g.Xx(this.B,!0);this.cancelCommand&&this.B.xv("innertubeCommand",this.cancelCommand)}; g.L.onVideoDataChange=function(p,a){$47(this,a);p=a.getWatchNextResponse();var l,y;p=(l=Kf8(p))==null?void 0:(y=l.cancelButton)==null?void 0:y.buttonRenderer;this.cancelCommand=p==null?void 0:p.command}; g.L.geu=function(p){if(vDl(this)){var a=this.B.getVideoData().watchToWatchTransitionRenderer,l=a==null?void 0:a.fromColorPaletteDark;a=a==null?void 0:a.toColorPaletteDark;if(l&&a){var y=this.element;y.style.setProperty("--w2w-start-background-color",g.$I(l.surgeColor));y.style.setProperty("--w2w-start-primary-text-color",g.$I(l.primaryTitleColor));y.style.setProperty("--w2w-start-secondary-text-color",g.$I(l.secondaryTitleColor));y.style.setProperty("--w2w-end-background-color",g.$I(a.surgeColor)); y.style.setProperty("--w2w-end-primary-text-color",g.$I(a.primaryTitleColor));y.style.setProperty("--w2w-end-secondary-text-color",g.$I(a.secondaryTitleColor));y.style.setProperty("--w2w-animation-duration",p+"ms")}g.JB(this.element,"ytp-w2w-animate",!0)}}; g.L.HF=function(p){this.B.D("web_autonav_color_transition")&&p!==2&&g.JB(this.element,"ytp-w2w-animate",!1)}; g.L.pX=function(){var p=this.B.bC();this.G&&this.E6!==p&&this.Kx(p);dL(this);this.B.logVisibility(this.container.element,p);this.B.logVisibility(this.cancelButton.element,p);this.B.logVisibility(this.L.d7("ytp-autonav-endscreen-link-container"),p);this.B.logVisibility(this.playButton.element,p)}; g.L.Yo=function(p){return p.width<400||p.height<459};g.A(o6,g.X);g.L=o6.prototype;g.L.create=function(){this.created=!0}; g.L.destroy=function(){this.created=!1}; g.L.S_=function(){return!1}; g.L.bC=function(){return!1}; g.L.EA=function(){return!1};g.A(zy,g.X);g.L=zy.prototype;g.L.LJ=function(){this.notification&&(this.j.stop(),this.ME(this.U),this.U=null,this.notification.close(),this.notification=null)}; g.L.Ju=function(p){this.suggestion=p;g.w2(this,p,"hqdefault.jpg")}; g.L.KX=function(){this.Kx(this.api.bC());this.api.logVisibility(this.element,this.api.bC());this.api.logVisibility(this.d7("ytp-upnext-autoplay-icon"),this.api.bC());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.bC())}; g.L.dEv=function(){window.focus();this.LJ()}; g.L.Yw=function(p){var a=this;this.Gf()||(g.RL("a11y-announce","Siguiente "+this.suggestion.title),this.S=(0,g.Ek)(),this.L=new g.l_(function(){k1B(a,p)},25),k1B(this,p),OhG(this.api,eOG(this,p))); g.b6(this.element,"ytp-upnext-autoplay-paused")}; g.L.hide=function(){g.X.prototype.hide.call(this)}; g.L.Gf=function(){return!!this.L}; g.L.nU=function(){this.Ep();this.S=(0,g.Ek)();k1B(this);g.uD(this.element,"ytp-upnext-autoplay-paused")}; g.L.Ep=function(){this.Gf()&&(this.L.dispose(),this.L=null)}; g.L.select=function(p){p=p===void 0?!1:p;if(this.api.C().D("autonav_notifications")&&p&&window.Notification&&typeof document.hasFocus==="function"){var a=Notification.permission;a==="default"?Notification.requestPermission():a!=="granted"||document.hasFocus()||(this.LJ(),this.notification=new Notification("Siguiente",{body:this.suggestion.title,icon:this.suggestion.Gy()}),this.U=this.J(this.notification,"click",this.dEv),this.j.start())}this.Ep();this.api.nextVideo(!1,p)}; g.L.tj=function(p){!g.oh(this.cancelButton.element,p.target)&&g.dK(p,this.api)&&(this.api.bC()&&this.api.logClick(this.d7("ytp-upnext-autoplay-icon")),this.select())}; g.L.vF=function(){this.api.bC()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.Xx(this.api,!0)}; g.L.UEO=function(p){this.api.getPresentingPlayerType();this.show();this.Yw(p)}; g.L.j4s=function(){this.api.getPresentingPlayerType();this.Ep();this.hide()}; g.L.fz=function(){this.Ep();this.LJ();g.X.prototype.fz.call(this)};g.A(Gy,o6);g.L=Gy.prototype;g.L.create=function(){o6.prototype.create.call(this);this.j.J(this.player,"appresize",this.Kw);this.j.J(this.player,"onVideoAreaChange",this.Kw);this.j.J(this.player,"videodatachange",this.onVideoDataChange);this.j.J(this.player,"autonavchange",this.cq);this.j.J(this.player,"onAutonavCancelled",this.u3);this.onVideoDataChange()}; g.L.show=function(){o6.prototype.show.call(this);(this.G||this.U&&this.U!==this.videoData.clientPlaybackNonce)&&g.Xx(this.player,!1);g.$9(this.player)&&this.S_()&&!this.U?(VS(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.L.select(!0):this.L.Yw():this.videoData.autonavState===3&&this.L.nU()):(g.Xx(this.player,!0),VS(this));this.Kw()}; g.L.hide=function(){o6.prototype.hide.call(this);this.L.nU();VS(this)}; g.L.Kw=function(){var p=this.player.uU(!0,this.player.isFullscreen());VS(this);dL(this.S);g.JB(this.element,"ytp-autonav-cancelled-small-mode",this.Yo(p));g.JB(this.element,"ytp-autonav-cancelled-tiny-mode",this.J8(p));g.JB(this.element,"ytp-autonav-cancelled-mini-mode",p.width<=400||p.height<=360);this.overlay&&g.B8(this.overlay.element,{width:p.width+"px"});if(!this.W)for(p=0;p0&&(p= c*4,w=a<=d-2&&G>=B*4;if((B+1)/c*y/V>V/(B/(c+1)*y)&&w)G-=B*4,a+=2;else if(r)G-=c*4,p+=2;else if(w)G-=B*4,a+=2;else break}y=!1;G>=12&&l*4-G<=6&&(a>=4||p>=4)&&(y=!0);G=p*96;z=a*54;V=G/z=p-2&&B>=a-2?w=1:B%2===0&&d%2===0&&(B<2&&d<2?B===0&&d===0&&(w=2):w=2),c=g.A3(c+this.U,l),w!==0){r=this.stills[V];r||(r=new $6(this.player),this.stills[V]=r,n.appendChild(r.element));var P=Math.floor(z*B/a),F=Math.floor(G*d/p),v=Math.floor(z*(B+w)/a)-P-4,I=Math.floor(G*(d+w)/p)-F-4;g.LL(r.element,F,P);g.Pj(r.element,I,v);g.B8(r.element,"transitionDelay",(B+d)/20+"s");g.JB(r.element,"ytp-videowall-still-mini", w===1);g.JB(r.element,"ytp-videowall-still-large",w>2);w=Math.max(I,v);g.JB(r.element,"ytp-videowall-still-round-large",w>=256);g.JB(r.element,"ytp-videowall-still-round-medium",w>96&&w<256);g.JB(r.element,"ytp-videowall-still-round-small",w<=96);c=S[c];r.suggestion!==c&&(r.suggestion=c,w=r.api.C(),P=g.tr(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.w2(r,c,P),g.wW(w)&&!r.api.D("web_player_log_click_before_generating_ve_conversion_params")&&(w=c.pC(),P={},g.pj(r.api,"addEmbedsConversionTrackingParams", [P]),w=g.C2(w,P),r.updateValue("url",w)),(c=(c=c.sessionData)&&c.itct)&&r.api.setTrackingParams(r.element,c));V++}n.ariaBusy="false";g.JB(this.element,"ytp-endscreen-paginate",V=V;S--)p=this.stills[S],g.wC(p.element),g.p3(p);this.stills.length=V}}; g.L.onVideoDataChange=function(){var p=this.player.getVideoData(1);this.videoData!==p&&(p!=null&&g.oz(p)?(this.U=0,this.videoData=p,this.wN()):this.player.jl("missg",{vid:(p==null?void 0:p.videoId)||"",cpn:(p==null?void 0:p.clientPlaybackNonce)||""}))}; g.L.Mn=function(){this.U+=this.stills.length;this.wN()}; g.L.rS=function(){this.U-=this.stills.length;this.wN()}; g.L.EA=function(){return this.L.Gf()}; g.L.wu=function(p){p===1?(this.W=!1,this.j=this.videoData.clientPlaybackNonce,this.L.Ep(),this.E6&&this.wN()):(this.W=!0,this.E6&&rL(this)&&(p===2?this.L.Yw():p===3&&this.L.nU()))}; g.L.aW=function(p){if(p){for(p=0;p0||p.endSeconds>0||p.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!a)return!0;var l;var y=!!((p==null?0:g.oz(p))||(p==null?0:(l=p.suggestions)==null?0:l.length));y=!bhl(this.player)||y;p=p.V4;l=this.player.rD();return y&&!p&&!l&&!a}; g.L.bC=function(){return this.endScreen.bC()}; g.L.hL=function(){return this.bC()?this.endScreen.EA():!1}; g.L.fz=function(){this.player.lf("endscreen");g.N_.prototype.fz.call(this)}; g.L.load=function(){var p=this.player.getVideoData();var a=p.transitionEndpointAtEndOfStream;if(a&&a.videoId){var l=this.player.DN().mO.get("heartbeat"),y=g.oz(p);!y||a.videoId!==y.videoId||p.PD?(this.player.FT(a.videoId,void 0,void 0,!0,!0,a),l&&l.FO("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),p=!0):p=!1}else p=!1;p||(g.N_.prototype.load.call(this),this.endScreen.show())}; g.L.unload=function(){g.N_.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.L.onCueRangeEnter=function(p){this.oD()&&(this.endScreen.created||this.endScreen.create(),p.getId()==="load"&&this.load())}; g.L.onCueRangeExit=function(p){p.getId()==="load"&&this.loaded&&this.unload()}; g.L.onVideoDataChange=function(){Cfl(this);this.U&&I_W(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.L?this.endScreen=new Gy(this.player):this.endScreen=new cm(this.player),g.E(this,this.endScreen),g.uW(this.player,this.endScreen.element,4))};g.Qg("endscreen",ukK);})(_yt_player);