(function(g){var window=this;'use strict';var PF8=function(D,O){D.F1("onAutonavCoundownStarted",O)},g08=function(D){var O,h,V; return D==null?void 0:(O=D.playerOverlays)==null?void 0:(h=O.playerOverlayRenderer)==null?void 0:(V=h.autoplay)==null?void 0:V.playerOverlayAutoplayRenderer},ba=function(D,O,h){g.eX(D.element,"ytp-suggestion-set",!!O.videoId); var V=O.playlistId;h=O.cM(h?h:"mqdefault.jpg");var k=null,C=null;O instanceof g.am&&(O.lengthText?(k=O.lengthText||null,C=O.sC||null):O.lengthSeconds&&(k=g.vi(O.lengthSeconds),C=g.vi(O.lengthSeconds,!0)));var M=!!V;V=M&&g.gS(V).type==="RD";var c=O instanceof g.am?O.isLivePlayback:null,S=O instanceof g.am?O.isUpcoming:null,Y=O.author,J=O.shortViewCount,q=O.publishedTimeText,u=[],H=[];Y&&u.push(Y);J&&(u.push(J),H.push(J));q&&H.push(q);h={title:O.title,author:Y,author_and_views:u.join(" \u2022 "),aria_label:O.ariaLabel|| g.fF("Ver $TITLE",{TITLE:O.title}),duration:k,timestamp:C,url:O.gL(),is_live:c,is_upcoming:S,is_list:M,is_mix:V,background:h?"background-image: url("+h+")":"",views_and_publish_time:H.join(" \u2022 "),autoplayAlternativeHeader:O.Jj};O instanceof g.Rm&&(h.playlist_length=O.playlistLength);D.update(h)},cv=function(D){var O=D.V(),h=O.W; g.N.call(this,{X:"a",Y:"ytp-autonav-suggestion-card",B:{href:"{{url}}",target:h?O.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},N:[{X:"div",eT:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],B:{style:"{{background}}"},N:[{X:"div",B:{"aria-label":"{{timestamp}}"},eT:["ytp-autonav-timestamp"],W3:"{{duration}}"},{X:"div",eT:["ytp-autonav-live-stamp"],W3:"En directo"}, {X:"div",eT:["ytp-autonav-upcoming-stamp"],W3:"Pr\u00f3ximamente"},{X:"div",Y:"ytp-autonav-list-overlay",N:[{X:"div",Y:"ytp-autonav-mix-text",W3:"Mix"},{X:"div",Y:"ytp-autonav-mix-icon"}]}]},{X:"div",eT:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],W3:"{{title}}"},{X:"div",eT:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],W3:"{{author}}"},{X:"div",eT:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],W3:"{{views_and_publish_time}}"}]});this.C= D;this.suggestion=null;this.D=h;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},Ss=function(D,O){O=O===void 0?!1:O; g.N.call(this,{X:"div",Y:"ytp-autonav-endscreen-countdown-overlay"});var h=this;this.L=O;this.cancelCommand=this.J=void 0;this.j=0;this.container=new g.N({X:"div",Y:"ytp-autonav-endscreen-countdown-container"});g.F(this,this.container);this.container.CF(this.element);O=D.V();var V=O.W;this.C=D;this.suggestion=null;this.onVideoDataChange("newdata",this.C.getVideoData());this.G(D,"videodatachange",this.onVideoDataChange);this.D=new g.N({X:"div",Y:"ytp-autonav-endscreen-upnext-container",B:{"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",Y:"ytp-autonav-endscreen-upnext-header"},{X:"div",Y:"ytp-autonav-endscreen-upnext-alternative-header",W3:"{{autoplayAlternativeHeader}}"},{X:"a",Y:"ytp-autonav-endscreen-link-container",B:{href:"{{url}}",target:V?O.U:""},N:[{X:"div",Y:"ytp-autonav-endscreen-upnext-thumbnail",B:{style:"{{background}}"},N:[{X:"div",B:{"aria-label":"{{timestamp}}"},eT:["ytp-autonav-timestamp"], W3:"{{duration}}"},{X:"div",eT:["ytp-autonav-live-stamp"],W3:"En directo"},{X:"div",eT:["ytp-autonav-upcoming-stamp"],W3:"Pr\u00f3ximamente"}]},{X:"div",Y:"ytp-autonav-endscreen-video-info",N:[{X:"div",Y:"ytp-autonav-endscreen-premium-badge"},{X:"div",Y:"ytp-autonav-endscreen-upnext-title",W3:"{{title}}"},{X:"div",Y:"ytp-autonav-endscreen-upnext-author",W3:"{{author}}"},{X:"div",Y:"ytp-autonav-view-and-date",W3:"{{views_and_publish_time}}"},{X:"div",Y:"ytp-autonav-author-and-view",W3:"{{author_and_views}}"}]}]}]}); g.F(this,this.D);this.D.CF(this.container.element);V||this.G(this.D.z2("ytp-autonav-endscreen-link-container"),"click",this.rN);this.C.createClientVe(this.container.element,this,115127);this.C.createClientVe(this.D.z2("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.N({X:"div",Y:"ytp-autonav-overlay"});g.F(this,this.overlay);this.overlay.CF(this.container.element);this.K=new g.N({X:"div",Y:"ytp-autonav-endscreen-button-container"});g.F(this,this.K);this.K.CF(this.container.element); this.cancelButton=new g.N({X:"button",eT:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",O.S("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],B:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},W3:"Cancelar"});g.F(this,this.cancelButton);this.cancelButton.CF(this.K.element);this.cancelButton.listen("click",this.wM,this);this.C.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.N({X:"a",eT:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",O.S("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],B:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente v\u00eddeo"},W3:"Ver ahora"});g.F(this,this.playButton);this.playButton.CF(this.K.element);this.playButton.listen("click",this.rN,this);this.C.createServerVe(this.playButton.element,this.playButton,!0);(O=this.C.getVideoData())&&R_0(this,O);this.W=new g.kF(function(){a4c(h)},500); g.F(this,this.W);this.Fy();this.G(D,"autonavvisibility",this.Fy);this.C.S("web_autonav_color_transition")&&(this.G(D,"autonavchange",this.e6),this.G(D,"onAutonavCoundownStarted",this.aT7))},YD=function(D){var O=D.C.sY(!0,D.C.isFullscreen()); g.eX(D.container.element,"ytp-autonav-endscreen-small-mode",D.n2(O));g.eX(D.container.element,"ytp-autonav-endscreen-is-premium",!!D.suggestion&&!!D.suggestion.a9a);g.eX(D.C.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!D.C.FP());g.eX(D.C.getRootNode(),"countdown-running",D.k0());g.eX(D.container.element,"ytp-player-content",D.C.FP());g.Ks(D.overlay.element,{width:O.width+"px"});if(!D.k0()){D.C.FP()?f4C(D,Math.round(Kpx(D)/1E3)):f4C(D);O=!!D.suggestion&&!!D.suggestion.Jj;var h=D.C.FP()|| !O;g.eX(D.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!h&&O);g.eX(D.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",h&&!O);D.K.Dn(D.C.FP());g.eX(D.element,"ytp-enable-w2w-color-transitions",E08(D))}},a4c=function(D){var O=Kpx(D),h=Math,V=h.min; var k=D.j?Date.now()-D.j:0;h=V.call(h,k,O);f4C(D,Math.ceil((O-h)/1E3));O-h<=500&&D.k0()?D.select(!0):D.k0()&&D.W.start()},Kpx=function(D){if(D.C.isFullscreen()){var O; D=(O=D.C.getVideoData())==null?void 0:O.i9;return D===-1||D===void 0?8E3:D}return D.C.aO()>=0?D.C.aO():g.P5(D.C.V().experiments,"autoplay_time")||1E4},R_0=function(D,O){O=O.getWatchNextResponse(); var h,V;O=(h=g08(O))==null?void 0:(V=h.nextButton)==null?void 0:V.buttonRenderer;D.J=O==null?void 0:O.navigationEndpoint;h=O==null?void 0:O.trackingParams;D.playButton&&h&&D.C.setTrackingParams(D.playButton.element,h)},E08=function(D){var O; return!((O=D.C.getVideoData())==null||!O.watchToWatchTransitionRenderer)},f4C=function(D,O){O=O===void 0?-1:O; D=D.D.z2("ytp-autonav-endscreen-upnext-header");g.cj(D);if(O>=0){O=String(O);var h="A continuaci\u00f3n en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],V="A continuaci\u00f3n en $SECONDS".indexOf(h);if(V>=0){D.appendChild(g.Mf("A continuaci\u00f3n en $SECONDS".slice(0,V)));var k=g.CZ("span");g.YF(k,"ytp-autonav-endscreen-upnext-header-countdown-number");g.qf(k,O);D.appendChild(k);D.appendChild(g.Mf("A continuaci\u00f3n en $SECONDS".slice(V+h.length)));return}}g.qf(D,"Siguiente")},Jo=function(D,O){g.N.call(this, {X:"div", eT:["html5-endscreen","ytp-player-content",O||"base-endscreen"]});this.created=!1;this.player=D},qN=function(D){g.N.call(this,{X:"div", eT:["ytp-upnext","ytp-player-content"],B:{"aria-label":"{{aria_label}}"},N:[{X:"div",Y:"ytp-cued-thumbnail-overlay-image",B:{style:"{{background}}"}},{X:"span",Y:"ytp-upnext-top",N:[{X:"span",Y:"ytp-upnext-header",W3:"Siguiente"},{X:"span",Y:"ytp-upnext-title",W3:"{{title}}"},{X:"span",Y:"ytp-upnext-author",W3:"{{author}}"}]},{X:"a",Y:"ytp-upnext-autoplay-icon",B:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente v\u00eddeo"},N:[{X:"svg",B:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},N:[{X:"circle",Y:"ytp-svg-autoplay-circle",B:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{X:"circle",Y:"ytp-svg-autoplay-ring",B:{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",Y:"ytp-svg-fill",B:{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",Y:"ytp-upnext-bottom",N:[{X:"span",Y:"ytp-upnext-cancel"},{X:"span",Y:"ytp-upnext-paused", W3:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=D;this.cancelButton=null;this.J=this.z2("ytp-svg-autoplay-ring");this.j=this.notification=this.D=this.suggestion=null;this.W=new g.kF(this.nR,5E3,this);this.K=0;var O=this.z2("ytp-upnext-cancel");this.cancelButton=new g.N({X:"button",eT:["ytp-upnext-cancel-button","ytp-button"],B:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},W3:"Cancelar"});g.F(this,this.cancelButton);this.cancelButton.listen("click", this.ZG,this);this.cancelButton.CF(O);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.F(this,this.W);this.api.createClientVe(this.element,this,18788);O=this.z2("ytp-upnext-autoplay-icon");this.G(O,"click",this.yg);this.api.createClientVe(O,this,115130);this.Qe();this.G(D,"autonavvisibility",this.Qe);this.G(D,"mdxnowautoplaying",this.Hpx);this.G(D,"mdxautoplaycanceled",this.SW1);g.eX(this.element,"ytp-upnext-mobile",this.api.V().K)},j59=function(D,O){if(O)return O; if(D.api.isFullscreen()){var h;D=(h=D.api.getVideoData())==null?void 0:h.i9;return D===-1||D===void 0?8E3:D}return D.api.aO()>=0?D.api.aO():g.P5(D.api.V().experiments,"autoplay_time")||1E4},U4_=function(D,O){O=j59(D,O); var h=Math,V=h.min;var k=(0,g.Ws)()-D.K;h=V.call(h,k,O);O=O===0?1:Math.min(h/O,1);D.J.setAttribute("stroke-dashoffset",""+-211*(O+1));O>=1&&D.k0()&&D.api.getPresentingPlayerType()!==3?D.select(!0):D.k0()&&D.D.start()},ua=function(D){Jo.call(this,D,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.N({X:"div",Y:"ytp-suggestion-panel",N:[{X:"div",eT:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],W3:"M\u00e1s v\u00eddeos"}]});this.T=new g.N({X:"div",Y:"ytp-suggestions-container"});this.videos=[];this.j=null;this.J=this.L=!1;this.K=new Ss(this.player);g.F(this,this.K);this.K.CF(this.element);D.getVideoData().j4?this.D=this.K:(this.D=new qN(D),g.BR(this.player,this.D.element,4),g.F(this,this.D));this.overlay=new g.N({X:"div", Y:"ytp-autonav-overlay-cancelled-state"});g.F(this,this.overlay);this.overlay.CF(this.element);this.W=new g.yp(this);g.F(this,this.W);g.F(this,this.table);this.table.CF(this.element);this.table.show();g.F(this,this.T);this.T.CF(this.table.element);this.hide()},Hv=function(D){var O=D.FP(); O!==D.J&&(D.J=O,D.player.publish("autonavvisibility"),D.J?(D.K!==D.D&&D.K.hide(),D.table.hide()):(D.K!==D.D&&D.K.show(),D.table.show()))},mL=function(D,O){g.N.call(this,{X:"button", eT:["ytp-watch-on-youtube-button","ytp-button"],W3:"{{content}}"});this.C=D;this.buttonType=this.buttonType=O;this.ES();this.buttonType===2&&g.qZ(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.ES);this.Dn(!0)},es=function(D,O){Jo.call(this,D,"embeds-lite-endscreen"); this.C=D;this.D=O;this.C.createClientVe(this.element,this,156943);this.watchButton=new mL(D,2);g.F(this,this.watchButton);this.watchButton.CF(this.element);this.hide()},Aqm=function(D){Jo.call(this,D,"subscribecard-endscreen"); this.D=new g.N({X:"div",Y:"ytp-subscribe-card",N:[{X:"img",Y:"ytp-author-image",B:{src:"{{profilePicture}}"}},{X:"div",Y:"ytp-subscribe-card-right",N:[{X:"div",Y:"ytp-author-name",W3:"{{author}}"},{X:"div",Y:"html5-subscribe-button-container"}]}]});g.F(this,this.D);this.D.CF(this.element);var O=D.getVideoData();this.subscribeButton=new g.eu("Suscribirme",null,"Anular suscripci\u00f3n",null,!0,!1,O.K$,O.subscribed,"trailer-endscreen",null,D,!1);g.F(this,this.subscribeButton);this.subscribeButton.CF(this.D.z2("html5-subscribe-button-container")); this.G(D,"videodatachange",this.x7);this.x7();this.hide()},LC=function(D){var O=D.V(),h=g.d5||g.Kh?{style:"will-change: opacity"}:void 0,V=O.W,k=["ytp-videowall-still"]; O.K&&k.push("ytp-videowall-show-text");g.N.call(this,{X:"a",eT:k,B:{href:"{{url}}",target:V?O.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},N:[{X:"div",Y:"ytp-videowall-still-image",B:{style:"{{background}}"}},{X:"span",Y:"ytp-videowall-still-info",B:{"aria-hidden":"true"},N:[{X:"span",Y:"ytp-videowall-still-info-bg",N:[{X:"span",Y:"ytp-videowall-still-info-content",B:h,N:[{X:"span",Y:"ytp-videowall-still-info-title",W3:"{{title}}"}, {X:"span",Y:"ytp-videowall-still-info-author",W3:"{{author_and_views}}"},{X:"span",Y:"ytp-videowall-still-info-live",W3:"En directo"},{X:"span",Y:"ytp-videowall-still-info-duration",W3:"{{duration}}"}]}]}]},{X:"span",eT:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],B:{"aria-hidden":"true"},N:[{X:"span",Y:"ytp-videowall-still-listlabel-icon"},"Lista de reproducci\u00f3n",{X:"span",Y:"ytp-videowall-still-listlabel-length",N:[" (",{X:"span",W3:"{{playlist_length}}"},")"]}]}, {X:"span",eT:["ytp-videowall-still-listlabel-mix","ytp-videowall-still-listlabel"],B:{"aria-hidden":"true"},N:[{X:"span",Y:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{X:"span",Y:"ytp-videowall-still-listlabel-length",W3:" (50+)"}]}]});this.suggestion=null;this.K=V;this.api=D;this.D=new g.yp(this);g.F(this,this.D);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.D.G(D,"videodatachange",this.onVideoDataChange);D.createServerVe(this.element,this);this.onVideoDataChange()}, Pv=function(D){Jo.call(this,D,"videowall-endscreen"); var O=this;this.C=D;this.j=0;this.stills=[];this.W=this.videoData=null;this.J=this.T=!1;this.U=null;this.K=new g.yp(this);g.F(this,this.K);this.L=new g.kF(function(){g.qZ(O.element,"ytp-show-tiles")},0); g.F(this,this.L);var h=new g.N({X:"button",eT:["ytp-button","ytp-endscreen-previous"],B:{"aria-label":"Anterior"},N:[g.jg()]});g.F(this,h);h.CF(this.element);h.listen("click",this.dM,this);this.table=new g.eg({X:"div",Y:"ytp-endscreen-content"});g.F(this,this.table);this.table.CF(this.element);h=new g.N({X:"button",eT:["ytp-button","ytp-endscreen-next"],B:{"aria-label":"Siguiente"},N:[g.U1()]});g.F(this,h);h.CF(this.element);h.listen("click",this.gM,this);D.getVideoData().j4?this.D=new Ss(D,!0):this.D= new qN(D);g.F(this,this.D);g.BR(this.player,this.D.element,4);D.createClientVe(this.element,this,158789);this.hide()},gf=function(D){return g.lA(D.player)&&D.yD()&&!D.W},RN=function(D){var O=D.FP(); O!==D.T&&(D.T=O,D.player.publish("autonavvisibility"))},aN=function(D){Jo.call(this,D,"watch-again-on-youtube-endscreen"); this.watchButton=new mL(D,1);g.F(this,this.watchButton);this.watchButton.CF(this.element);g.PPy(D)&&(this.D=new g.IW(D),g.F(this,this.D),this.K=new g.N({X:"div",eT:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],B:{tabIndex:"-1"},N:[this.D]}),g.F(this,this.K),this.D.CF(this.K.element),this.K.CF(this.element));D.createClientVe(this.element,this,156914);this.hide()},Q5U=function(D){g.dX.call(this,D); var O=this;this.endScreen=null;this.K=this.D=this.j=this.W=!1;this.listeners=new g.yp(this);g.F(this,this.listeners);var h=D.V(),V=D.getVideoData();V=V&&V.limitedPlaybackDurationInSeconds!==0;g.eI(g.W_(h))&&V&&!g.NJ(D)?(this.K=!0,this.endScreen=new es(D,g.ty(D))):D.isEmbedsShortsMode()?this.endScreen=new aN(D):GnS(D)?(this.W=!0,tf9(this),this.D?this.endScreen=new ua(D):this.endScreen=new Pv(D)):h.lW?this.endScreen=new Aqm(D):this.endScreen=new Jo(D);g.F(this,this.endScreen);g.BR(D,this.endScreen.element, 4);v0m(this);this.listeners.G(D,"videodatachange",this.onVideoDataChange,this);this.listeners.G(D,g.J6("endscreen"),function(k){O.onCueRangeEnter(k)}); this.listeners.G(D,g.q1("endscreen"),function(k){O.onCueRangeExit(k)})},tf9=function(D){var O=D.player.getVideoData(); if(!O||D.D===O.fd&&D.j===O.j4)return!1;D.D=O.fd;D.j=O.j4;return!0},GnS=function(D){D=D.V(); return D.oM&&!D.lW&&!D.disableOrganicUi},v0m=function(D){D.player.Y8("endscreen"); var O=D.player.getVideoData();O=new g.S4(Math.max((O.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var h=new g.S4(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});D.player.nW([O,h])}; g.yD.prototype.aO=g.V_(14,function(){return this.app.aO()}); g.Kx.prototype.aO=g.V_(13,function(){return this.getVideoData().Ur}); g.dL.prototype.kx=g.V_(12,function(D){this.y8().kx(D)}); g.wF.prototype.kx=g.V_(11,function(D){this.D!==D&&(this.D=D,this.x7())}); g.F9.prototype.kx=g.V_(10,function(D){this.overflowButton&&this.overflowButton.kx(D)}); g.dL.prototype.aJ=g.V_(9,function(D){this.y8().aJ(D)}); g.zU.prototype.aJ=g.V_(8,function(D){this.K!==D&&(this.K=D,this.x7())}); g.F9.prototype.aJ=g.V_(7,function(D){this.shareButton&&this.shareButton.aJ(D)}); g.dL.prototype.zR=g.V_(6,function(D){this.y8().zR(D)}); g.Su.prototype.zR=g.V_(5,function(D){this.Jh!==D&&(this.Jh=D,this.lN())}); g.dL.prototype.qq=g.V_(4,function(D){this.y8().qq(D)}); g.F9.prototype.qq=g.V_(3,function(D){this.lw!==D&&(this.lw=D,this.uN())});g.e(cv,g.N);cv.prototype.select=function(){this.C.d5(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.Ex||void 0)&&this.C.logClick(this.element)}; cv.prototype.onClick=function(D){g.gx(D,this.C,this.D,this.suggestion.sessionData||void 0)&&this.select()}; cv.prototype.onKeyPress=function(D){switch(D.keyCode){case 13:case 32:D.defaultPrevented||(this.select(),D.preventDefault())}};g.e(Ss,g.N);g.b=Ss.prototype;g.b.UI=function(D){this.suggestion!==D&&(this.suggestion=D,ba(this.D,D),this.playButton.updateValue("url",this.suggestion.gL()),YD(this))}; g.b.k0=function(){return this.j>0}; g.b.wB=function(){this.k0()||(this.j=Date.now(),a4c(this),PF8(this.C,Kpx(this)),g.eX(this.C.getRootNode(),"countdown-running",this.k0()))}; g.b.Ix=function(){this.UJ();a4c(this);var D=this.D.z2("ytp-autonav-endscreen-upnext-header");D&&g.qf(D,"Siguiente")}; g.b.UJ=function(){this.k0()&&(this.W.stop(),this.j=0)}; g.b.select=function(D){this.C.nextVideo(!1,D===void 0?!1:D);this.UJ()}; g.b.rN=function(D){g.gx(D,this.C)&&(D.currentTarget===this.playButton.element?this.C.logClick(this.playButton.element):D.currentTarget===this.D.z2("ytp-autonav-endscreen-link-container")&&(D=this.D.z2("ytp-autonav-endscreen-link-container"),this.C.logVisibility(D,!0),this.C.logClick(D)),this.J?(this.C.F1("innertubeCommand",this.J),this.UJ()):this.select())}; g.b.wM=function(){this.C.logClick(this.cancelButton.element);g.rL(this.C,!0);this.cancelCommand&&this.C.F1("innertubeCommand",this.cancelCommand)}; g.b.onVideoDataChange=function(D,O){R_0(this,O);D=O.getWatchNextResponse();var h,V;D=(h=g08(D))==null?void 0:(V=h.cancelButton)==null?void 0:V.buttonRenderer;this.cancelCommand=D==null?void 0:D.command}; g.b.aT7=function(D){if(E08(this)){var O=this.C.getVideoData().watchToWatchTransitionRenderer,h=O==null?void 0:O.fromColorPaletteDark;O=O==null?void 0:O.toColorPaletteDark;if(h&&O){var V=this.element;V.style.setProperty("--w2w-start-background-color",g.os(h.surgeColor));V.style.setProperty("--w2w-start-primary-text-color",g.os(h.primaryTitleColor));V.style.setProperty("--w2w-start-secondary-text-color",g.os(h.secondaryTitleColor));V.style.setProperty("--w2w-end-background-color",g.os(O.surgeColor)); V.style.setProperty("--w2w-end-primary-text-color",g.os(O.primaryTitleColor));V.style.setProperty("--w2w-end-secondary-text-color",g.os(O.secondaryTitleColor));V.style.setProperty("--w2w-animation-duration",D+"ms")}g.eX(this.element,"ytp-w2w-animate",!0)}}; g.b.e6=function(D){this.C.S("web_autonav_color_transition")&&D!==2&&g.eX(this.element,"ytp-w2w-animate",!1)}; g.b.Fy=function(){var D=this.C.FP();this.L&&this.WQ!==D&&this.Dn(D);YD(this);this.C.logVisibility(this.container.element,D);this.C.logVisibility(this.cancelButton.element,D);this.C.logVisibility(this.D.z2("ytp-autonav-endscreen-link-container"),D);this.C.logVisibility(this.playButton.element,D)}; g.b.n2=function(D){return D.width<400||D.height<459};g.e(Jo,g.N);g.b=Jo.prototype;g.b.create=function(){this.created=!0}; g.b.destroy=function(){this.created=!1}; g.b.yD=function(){return!1}; g.b.FP=function(){return!1}; g.b.uB=function(){return!1};g.e(qN,g.N);g.b=qN.prototype;g.b.nR=function(){this.notification&&(this.W.stop(),this.Cp(this.j),this.j=null,this.notification.close(),this.notification=null)}; g.b.UI=function(D){this.suggestion=D;ba(this,D,"hqdefault.jpg")}; g.b.Qe=function(){this.Dn(this.api.FP());this.api.logVisibility(this.element,this.api.FP());this.api.logVisibility(this.z2("ytp-upnext-autoplay-icon"),this.api.FP());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.FP())}; g.b.dA1=function(){window.focus();this.nR()}; g.b.wB=function(D){var O=this;this.k0()||(g.gY("a11y-announce","Siguiente "+this.suggestion.title),this.K=(0,g.Ws)(),this.D=new g.kF(function(){U4_(O,D)},25),U4_(this,D),PF8(this.api,j59(this,D))); g.Hk(this.element,"ytp-upnext-autoplay-paused")}; g.b.hide=function(){g.N.prototype.hide.call(this)}; g.b.k0=function(){return!!this.D}; g.b.Ix=function(){this.UJ();this.K=(0,g.Ws)();U4_(this);g.qZ(this.element,"ytp-upnext-autoplay-paused")}; g.b.UJ=function(){this.k0()&&(this.D.dispose(),this.D=null)}; g.b.select=function(D){D=D===void 0?!1:D;if(this.api.V().S("autonav_notifications")&&D&&window.Notification&&typeof document.hasFocus==="function"){var O=Notification.permission;O==="default"?Notification.requestPermission():O!=="granted"||document.hasFocus()||(this.nR(),this.notification=new Notification("Siguiente",{body:this.suggestion.title,icon:this.suggestion.cM()}),this.j=this.G(this.notification,"click",this.dA1),this.W.start())}this.UJ();this.api.nextVideo(!1,D)}; g.b.yg=function(D){!g.JJ(this.cancelButton.element,D.target)&&g.gx(D,this.api)&&(this.api.FP()&&this.api.logClick(this.z2("ytp-upnext-autoplay-icon")),this.select())}; g.b.ZG=function(){this.api.FP()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.rL(this.api,!0)}; g.b.Hpx=function(D){this.api.getPresentingPlayerType();this.show();this.wB(D)}; g.b.SW1=function(){this.api.getPresentingPlayerType();this.UJ();this.hide()}; g.b.fF=function(){this.UJ();this.nR();g.N.prototype.fF.call(this)};g.e(ua,Jo);g.b=ua.prototype;g.b.create=function(){Jo.prototype.create.call(this);this.W.G(this.player,"appresize",this.WO);this.W.G(this.player,"onVideoAreaChange",this.WO);this.W.G(this.player,"videodatachange",this.onVideoDataChange);this.W.G(this.player,"autonavchange",this.Bg);this.W.G(this.player,"onAutonavCancelled",this.M$);this.onVideoDataChange()}; g.b.show=function(){Jo.prototype.show.call(this);(this.L||this.j&&this.j!==this.videoData.clientPlaybackNonce)&&g.rL(this.player,!1);g.lA(this.player)&&this.yD()&&!this.j?(Hv(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.D.select(!0):this.D.wB():this.videoData.autonavState===3&&this.D.Ix()):(g.rL(this.player,!0),Hv(this));this.WO()}; g.b.hide=function(){Jo.prototype.hide.call(this);this.D.Ix();Hv(this)}; g.b.WO=function(){var D=this.player.sY(!0,this.player.isFullscreen());Hv(this);YD(this.K);g.eX(this.element,"ytp-autonav-cancelled-small-mode",this.n2(D));g.eX(this.element,"ytp-autonav-cancelled-tiny-mode",this.xS(D));g.eX(this.element,"ytp-autonav-cancelled-mini-mode",D.width<=400||D.height<=360);this.overlay&&g.Ks(this.overlay.element,{width:D.width+"px"});if(!this.J)for(D=0;D0&&(D= q*4,H=O<=S-2&&Y>=J*4;if((J+1)/q*V/M>M/(J/(q+1)*V)&&H)Y-=J*4,O+=2;else if(u)Y-=q*4,D+=2;else if(H)Y-=J*4,O+=2;else break}V=!1;Y>=12&&h*4-Y<=6&&(O>=4||D>=4)&&(V=!0);Y=D*96;c=O*54;M=Y/c=D-2&&J>=O-2?H=1:J%2===0&&S%2===0&&(J<2&&S<2?J===0&&S===0&&(H=2):H=2),q=g.er(q+this.j,h),H!==0){u=this.stills[M];u||(u=new LC(this.player),this.stills[M]=u,C.appendChild(u.element));var m=Math.floor(c*J/O),R=Math.floor(Y*S/D),f=Math.floor(c*(J+H)/O)-m-4,E=Math.floor(Y*(S+H)/D)-R-4;g.tu(u.element,R,m);g.sy(u.element,E,f);g.Ks(u.element,"transitionDelay",(J+S)/20+"s");g.eX(u.element,"ytp-videowall-still-mini", H===1);g.eX(u.element,"ytp-videowall-still-large",H>2);H=Math.max(E,f);g.eX(u.element,"ytp-videowall-still-round-large",H>=256);g.eX(u.element,"ytp-videowall-still-round-medium",H>96&&H<256);g.eX(u.element,"ytp-videowall-still-round-small",H<=96);q=k[q];u.suggestion!==q&&(u.suggestion=q,H=u.api.V(),m=g.JX(u.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",ba(u,q,m),g.jM(H)&&!u.api.S("web_player_log_click_before_generating_ve_conversion_params")&&(H=q.gL(),m={},g.E5(u.api,"addEmbedsConversionTrackingParams", [m]),H=g.lF(H,m),u.updateValue("url",H)),(q=(q=q.sessionData)&&q.itct)&&u.api.setTrackingParams(u.element,q));M++}C.ariaBusy="false";g.eX(this.element,"ytp-endscreen-paginate",M=M;k--)D=this.stills[k],g.Ye(D.element),g.SR(D);this.stills.length=M}}; g.b.onVideoDataChange=function(){var D=this.player.getVideoData(1);this.videoData!==D&&(D!=null&&g.Mo(D)?(this.j=0,this.videoData=D,this.H$()):this.player.KF("missg",{vid:(D==null?void 0:D.videoId)||"",cpn:(D==null?void 0:D.clientPlaybackNonce)||""}))}; g.b.gM=function(){this.j+=this.stills.length;this.H$()}; g.b.dM=function(){this.j-=this.stills.length;this.H$()}; g.b.uB=function(){return this.D.k0()}; g.b.lO=function(D){D===1?(this.J=!1,this.W=this.videoData.clientPlaybackNonce,this.D.UJ(),this.WQ&&this.H$()):(this.J=!0,this.WQ&&gf(this)&&(D===2?this.D.wB():D===3&&this.D.Ix()))}; g.b.sO=function(D){if(D){for(D=0;D0||D.endSeconds>0):D.mutedAutoplay;if((this.player.isEmbedsShortsMode()||this.K)&&!O)return!0;var h;var V=!!((D==null?0:g.Mo(D))||(D==null?0:(h=D.suggestions)==null?0:h.length));V=!GnS(this.player)||V;D=D.Pp;h=this.player.HK();return V&&!D&&!h&&!O}; g.b.FP=function(){return this.endScreen.FP()}; g.b.ZFF=function(){return this.FP()?this.endScreen.uB():!1}; g.b.fF=function(){this.player.Y8("endscreen");g.dX.prototype.fF.call(this)}; g.b.load=function(){var D=this.player.getVideoData();var O=D.transitionEndpointAtEndOfStream;if(O&&O.videoId){var h=this.player.Ev().FM.get("heartbeat"),V=g.Mo(D);!V||O.videoId!==V.videoId||D.b3?(this.player.d5(O.videoId,void 0,void 0,!0,!0,O),h&&h.B1("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),D=!0):D=!1}else D=!1;D||(g.dX.prototype.load.call(this),this.endScreen.show())}; g.b.unload=function(){g.dX.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.b.onCueRangeEnter=function(D){this.Bz()&&(this.endScreen.created||this.endScreen.create(),D.getId()==="load"&&this.load())}; g.b.onCueRangeExit=function(D){D.getId()==="load"&&this.loaded&&this.unload()}; g.b.onVideoDataChange=function(){v0m(this);this.W&&tf9(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.D?this.endScreen=new ua(this.player):this.endScreen=new Pv(this.player),g.F(this,this.endScreen),g.BR(this.player,this.endScreen.element,4))};g.TP("endscreen",Q5U);})(_yt_player);