(function(g){var window=this;'use strict';var zMB=function(D){D.publish("autonavvisibility")},kGC=function(D,X){D.ER("onAutonavCoundownStarted",X)},uBh=function(D){return D.isBackground()&&D.MX()},jeW=function(D){var X,M,Q; return D==null?void 0:(X=D.playerOverlays)==null?void 0:(M=X.playerOverlayRenderer)==null?void 0:(Q=M.autoplay)==null?void 0:Q.playerOverlayAutoplayRenderer},HV=function(D){var X=D.W(),M=X.U; g.Y.call(this,{L:"a",C:"ytp-autonav-suggestion-card",Z:{href:"{{url}}",target:M?X.eH:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},V:[{L:"div",gC:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],Z:{style:"{{background}}"},V:[{L:"div",Z:{"aria-label":"{{timestamp}}"},gC:["ytp-autonav-timestamp"],Gs:"{{duration}}"},{L:"div",gC:["ytp-autonav-live-stamp"],Gs:"En vivo"}, {L:"div",gC:["ytp-autonav-upcoming-stamp"],Gs:"Pr\u00f3ximamente"},{L:"div",C:"ytp-autonav-list-overlay",V:[{L:"div",C:"ytp-autonav-mix-text",Gs:"Mix"},{L:"div",C:"ytp-autonav-mix-icon"}]}]},{L:"div",gC:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],Gs:"{{title}}"},{L:"div",gC:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],Gs:"{{author}}"},{L:"div",gC:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],Gs:"{{views_and_publish_time}}"}]});this.B= D;this.suggestion=null;this.S=M;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},tJ=function(D,X){X=X===void 0?!1:X; g.Y.call(this,{L:"div",C:"ytp-autonav-endscreen-countdown-overlay"});var M=this;this.X=X;this.cancelCommand=this.D=void 0;this.Y=0;this.container=new g.Y({L:"div",C:"ytp-autonav-endscreen-countdown-container"});g.p(this,this.container);this.container.rC(this.element);X=D.W();var Q=X.U;this.B=D;this.suggestion=null;this.onVideoDataChange("newdata",this.B.getVideoData());this.N(D,"videodatachange",this.onVideoDataChange);this.S=new g.Y({L:"div",C:"ytp-autonav-endscreen-upnext-container",Z:{"aria-label":"{{aria_label}}", "data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},V:[{L:"div",C:"ytp-autonav-endscreen-upnext-header"},{L:"div",C:"ytp-autonav-endscreen-upnext-alternative-header",Gs:"{{autoplayAlternativeHeader}}"},{L:"a",C:"ytp-autonav-endscreen-link-container",Z:{href:"{{url}}",target:Q?X.eH:""},V:[{L:"div",C:"ytp-autonav-endscreen-upnext-thumbnail",Z:{style:"{{background}}"},V:[{L:"div",Z:{"aria-label":"{{timestamp}}"},gC:["ytp-autonav-timestamp"], Gs:"{{duration}}"},{L:"div",gC:["ytp-autonav-live-stamp"],Gs:"En vivo"},{L:"div",gC:["ytp-autonav-upcoming-stamp"],Gs:"Pr\u00f3ximamente"}]},{L:"div",C:"ytp-autonav-endscreen-video-info",V:[{L:"div",C:"ytp-autonav-endscreen-premium-badge"},{L:"div",C:"ytp-autonav-endscreen-upnext-title",Gs:"{{title}}"},{L:"div",C:"ytp-autonav-endscreen-upnext-author",Gs:"{{author}}"},{L:"div",C:"ytp-autonav-view-and-date",Gs:"{{views_and_publish_time}}"},{L:"div",C:"ytp-autonav-author-and-view",Gs:"{{author_and_views}}"}]}]}]}); g.p(this,this.S);this.S.rC(this.container.element);Q||this.N(this.S.h$("ytp-autonav-endscreen-link-container"),"click",this.Am);this.B.createClientVe(this.container.element,this,115127);this.B.createClientVe(this.S.h$("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.Y({L:"div",C:"ytp-autonav-overlay"});g.p(this,this.overlay);this.overlay.rC(this.container.element);this.G=new g.Y({L:"div",C:"ytp-autonav-endscreen-button-container"});g.p(this,this.G);this.G.rC(this.container.element); this.cancelButton=new g.Y({L:"button",gC:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button","ytp-autonav-endscreen-upnext-button-rounded"],Z:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Gs:"Cancelar"});g.p(this,this.cancelButton);this.cancelButton.rC(this.G.element);this.cancelButton.listen("click",this.JA,this);this.B.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.Y({L:"a",gC:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-play-button", "ytp-autonav-endscreen-upnext-button-rounded"],Z:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},Gs:"Reproducir ahora"});g.p(this,this.playButton);this.playButton.rC(this.G.element);this.playButton.listen("click",this.Am,this);this.B.createServerVe(this.playButton.element,this.playButton,!0);(X=this.B.getVideoData())&&Dxn(this,X);this.U=new g.W5(function(){Xl8(M)},500); g.p(this,this.U);this.cj();this.N(D,"autonavvisibility",this.cj);this.B.T("web_autonav_color_transition")&&(this.N(D,"autonavchange",this.C8),this.N(D,"onAutonavCoundownStarted",this.l1y))},Nw=function(D){var X=D.B.WL(!0,D.B.isFullscreen()); g.qE(D.container.element,"ytp-autonav-endscreen-small-mode",D.cB(X));g.qE(D.container.element,"ytp-autonav-endscreen-is-premium",!!D.suggestion&&!!D.suggestion.uhF);g.qE(D.B.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!D.B.R6());g.qE(D.B.getRootNode(),"countdown-running",D.xc());g.qE(D.container.element,"ytp-player-content",D.B.R6());g.Q_(D.overlay.element,{width:X.width+"px"});if(!D.xc()){D.B.R6()?MFW(D,Math.round(QGZ(D)/1E3)):MFW(D);X=!!D.suggestion&&!!D.suggestion.ZI;var M=D.B.R6()|| !X;g.qE(D.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!M&&X);g.qE(D.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",M&&!X);D.G.Ew(D.B.R6());g.qE(D.element,"ytp-enable-w2w-color-transitions",hTn(D))}},Xl8=function(D){var X=QGZ(D),M=Math,Q=M.min; var h=D.Y?Date.now()-D.Y:0;M=Q.call(M,h,X);MFW(D,Math.ceil((X-M)/1E3));X-M<=500&&D.xc()?D.select(!0):D.xc()&&D.U.start()},QGZ=function(D){if(D.B.isFullscreen()){var X; D=(X=D.B.getVideoData())==null?void 0:X.It;return D===-1||D===void 0?8E3:D}return D.B.bG()>=0?D.B.bG():g.lx(D.B.W().experiments,"autoplay_time")||1E4},Dxn=function(D,X){X=X.getWatchNextResponse(); var M,Q;X=(M=jeW(X))==null?void 0:(Q=M.nextButton)==null?void 0:Q.buttonRenderer;D.D=X==null?void 0:X.navigationEndpoint;M=X==null?void 0:X.trackingParams;D.playButton&&M&&D.B.setTrackingParams(D.playButton.element,M)},hTn=function(D){var X; return!((X=D.B.getVideoData())==null||!X.watchToWatchTransitionRenderer)},MFW=function(D,X){X=X===void 0?-1:X; D=D.S.h$("ytp-autonav-endscreen-upnext-header");g.Ru(D);if(X>=0){X=String(X);var M="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],Q="A continuaci\u00f3n, en $SECONDS".indexOf(M);if(Q>=0){D.appendChild(g.nR("A continuaci\u00f3n, en $SECONDS".slice(0,Q)));var h=g.m7("span");g.ME(h,"ytp-autonav-endscreen-upnext-header-countdown-number");g.dP(h,X);D.appendChild(h);D.appendChild(g.nR("A continuaci\u00f3n, en $SECONDS".slice(Q+M.length)));return}}g.dP(D,"A continuaci\u00f3n")},qw= function(D,X){g.Y.call(this,{L:"div", gC:["html5-endscreen","ytp-player-content",X||"base-endscreen"]});this.created=!1;this.player=D},wG=function(D){g.Y.call(this,{L:"div", gC:["ytp-upnext","ytp-player-content"],Z:{"aria-label":"{{aria_label}}"},V:[{L:"div",C:"ytp-cued-thumbnail-overlay-image",Z:{style:"{{background}}"}},{L:"span",C:"ytp-upnext-top",V:[{L:"span",C:"ytp-upnext-header",Gs:"A continuaci\u00f3n"},{L:"span",C:"ytp-upnext-title",Gs:"{{title}}"},{L:"span",C:"ytp-upnext-author",Gs:"{{author}}"}]},{L:"a",C:"ytp-upnext-autoplay-icon",Z:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},V:[{L:"svg",Z:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},V:[{L:"circle",C:"ytp-svg-autoplay-circle",Z:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{L:"circle",C:"ytp-svg-autoplay-ring",Z:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{L:"path",C:"ytp-svg-fill",Z:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{L:"span",C:"ytp-upnext-bottom",V:[{L:"span",C:"ytp-upnext-cancel"},{L:"span",C:"ytp-upnext-paused", Gs:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=D;this.cancelButton=null;this.D=this.h$("ytp-svg-autoplay-ring");this.Y=this.notification=this.S=this.suggestion=null;this.U=new g.W5(this.Ur,5E3,this);this.G=0;var X=this.h$("ytp-upnext-cancel");this.cancelButton=new g.Y({L:"button",gC:["ytp-upnext-cancel-button","ytp-button"],Z:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},Gs:"Cancelar"});g.p(this,this.cancelButton);this.cancelButton.listen("click", this.dA,this);this.cancelButton.rC(X);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.p(this,this.U);this.api.createClientVe(this.element,this,18788);X=this.h$("ytp-upnext-autoplay-icon");this.N(X,"click",this.cN);this.api.createClientVe(X,this,115130);this.Nv();this.N(D,"autonavvisibility",this.Nv);this.N(D,"mdxnowautoplaying",this.NIf);this.N(D,"mdxautoplaycanceled",this.mxf);g.qE(this.element,"ytp-upnext-mobile",this.api.W().G)},HQ8=function(D,X){if(X)return X; if(D.api.isFullscreen()){var M;D=(M=D.api.getVideoData())==null?void 0:M.It;return D===-1||D===void 0?8E3:D}return D.api.bG()>=0?D.api.bG():g.lx(D.api.W().experiments,"autoplay_time")||1E4},tFW=function(D,X){X=HQ8(D,X); var M=Math,Q=M.min;var h=(0,g.fi)()-D.G;M=Q.call(M,h,X);X=X===0?1:Math.min(M/X,1);D.D.setAttribute("stroke-dashoffset",""+-211*(X+1));X>=1&&D.xc()&&D.api.getPresentingPlayerType()!==3?D.select(!0):D.xc()&&D.S.start()},Ts=function(D){qw.call(this,D,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.Y({L:"div",C:"ytp-suggestion-panel",V:[{L:"div",gC:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],Gs:"M\u00e1s videos"}]});this.J=new g.Y({L:"div",C:"ytp-suggestions-container"});this.videos=[];this.Y=null;this.D=this.X=!1;this.G=new tJ(this.player);g.p(this,this.G);this.G.rC(this.element);D.getVideoData().R2?this.S=this.G:(this.S=new wG(D),g.db(this.player,this.S.element,4),g.p(this,this.S));this.overlay=new g.Y({L:"div", C:"ytp-autonav-overlay-cancelled-state"});g.p(this,this.overlay);this.overlay.rC(this.element);this.U=new g.HE(this);g.p(this,this.U);g.p(this,this.table);this.table.rC(this.element);this.table.show();g.p(this,this.J);this.J.rC(this.table.element);this.hide()},Lh=function(D){var X=D.R6(); X!==D.D&&(D.D=X,zMB(D.player),D.D?(D.G!==D.S&&D.G.hide(),D.table.hide()):(D.G!==D.S&&D.G.show(),D.table.show()))},NTG=function(D){qw.call(this,D,"videowall-endscreen"); var X=this;this.B=D;this.stills=[];this.Y=this.videoData=null;this.U=this.X=!1;this.J=null;g.hN(this.element,"modern-videowall-endscreen");this.G=new g.HE(this);g.p(this,this.G);this.D=new g.W5(function(){g.hN(X.element,"ytp-show-tiles")},0); g.p(this,this.D);this.table=new g.M1({L:"div",C:"ytp-modern-endscreen-content"});g.p(this,this.table);this.table.rC(this.element);D.getVideoData().R2?this.S=new tJ(D,!0):this.S=new wG(D);g.p(this,this.S);g.db(this.player,this.S.element,4);D.createClientVe(this.element,this,158789);this.hide()},sR=function(D){return g.rb(D.player)&&D.O0()&&!D.Y},Kh=function(D){var X=D.R6(); X!==D.X&&(D.X=X,zMB(D.player))},q1b=function(D){qw.call(this,D,"subscribecard-endscreen"); this.S=new g.Y({L:"div",C:"ytp-subscribe-card",V:[{L:"img",C:"ytp-author-image",Z:{src:"{{profilePicture}}"}},{L:"div",C:"ytp-subscribe-card-right",V:[{L:"div",C:"ytp-author-name",Gs:"{{author}}"},{L:"div",C:"html5-subscribe-button-container"}]}]});g.p(this,this.S);this.S.rC(this.element);var X=D.getVideoData();this.subscribeButton=new g.lz("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,X.uI,X.subscribed,"trailer-endscreen",null,D,!1);g.p(this,this.subscribeButton);this.subscribeButton.rC(this.S.h$("html5-subscribe-button-container")); this.N(D,"videodatachange",this.C$);this.C$();this.hide()},aV=function(D){var X=D.W(),M=g.Xu||g.nT?{style:"will-change: opacity"}:void 0,Q=X.U,h=["ytp-videowall-still"]; X.G&&h.push("ytp-videowall-show-text");g.Y.call(this,{L:"a",gC:h,Z:{href:"{{url}}",target:Q?X.eH:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},V:[{L:"div",C:"ytp-videowall-still-image",Z:{style:"{{background}}"}},{L:"span",C:"ytp-videowall-still-info",Z:{"aria-hidden":"true"},V:[{L:"span",C:"ytp-videowall-still-info-bg",V:[{L:"span",C:"ytp-videowall-still-info-content",Z:M,V:[{L:"span",C:"ytp-videowall-still-info-title",Gs:"{{title}}"}, {L:"span",C:"ytp-videowall-still-info-author",Gs:"{{author_and_views}}"},{L:"span",C:"ytp-videowall-still-info-live",Gs:"En vivo"},{L:"span",C:"ytp-videowall-still-info-duration",Gs:"{{duration}}"}]}]}]},{L:"span",gC:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],Z:{"aria-hidden":"true"},V:[{L:"span",C:"ytp-videowall-still-listlabel-icon"},"Playlist",{L:"span",C:"ytp-videowall-still-listlabel-length",V:[" (",{L:"span",Gs:"{{playlist_length}}"},")"]}]},{L:"span",gC:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],Z:{"aria-hidden":"true"},V:[{L:"span",C:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{L:"span",C:"ytp-videowall-still-listlabel-length",Gs:" (50+)"}]}]});this.suggestion=null;this.G=Q;this.api=D;this.S=new g.HE(this);g.p(this,this.S);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.S.N(D,"videodatachange",this.onVideoDataChange);D.createServerVe(this.element,this);this.onVideoDataChange()},Fl=function(D){qw.call(this,D,"videowall-endscreen"); var X=this;this.B=D;this.Y=0;this.stills=[];this.U=this.videoData=null;this.D=this.J=!1;this.K=null;this.G=new g.HE(this);g.p(this,this.G);this.X=new g.W5(function(){g.hN(X.element,"ytp-show-tiles")},0); g.p(this,this.X);var M=new g.Y({L:"button",gC:["ytp-button","ytp-endscreen-previous"],Z:{"aria-label":"Anterior"},V:[g.LO()]});g.p(this,M);M.rC(this.element);M.listen("click",this.I8,this);this.table=new g.M1({L:"div",C:"ytp-endscreen-content"});g.p(this,this.table);this.table.rC(this.element);M=new g.Y({L:"button",gC:["ytp-button","ytp-endscreen-next"],Z:{"aria-label":"Siguiente"},V:[g.sC()]});g.p(this,M);M.rC(this.element);M.listen("click",this.vN,this);D.getVideoData().R2?this.S=new tJ(D,!0):this.S= new wG(D);g.p(this,this.S);g.db(this.player,this.S.element,4);D.createClientVe(this.element,this,158789);this.hide()},VG=function(D){return g.rb(D.player)&&D.O0()&&!D.U},$h=function(D){var X=D.R6(); X!==D.J&&(D.J=X,zMB(D.player))},wlr=function(D,X){g.Y.call(this,{L:"button", gC:["ytp-watch-on-youtube-button","ytp-button"],Gs:"{{content}}"});this.B=D;this.buttonType=this.buttonType=X;this.cz();this.buttonType===2&&g.hN(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.cz);this.Ew(!0)},BV=function(D){qw.call(this,D,"watch-again-on-youtube-endscreen"); this.watchButton=new wlr(D,1);g.p(this,this.watchButton);this.watchButton.rC(this.element);g.O89(D)&&(this.S=new g.JA(D),g.p(this,this.S),this.G=new g.Y({L:"div",gC:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],Z:{tabIndex:"-1"},V:[this.S]}),g.p(this,this.G),this.S.rC(this.G.element),this.G.rC(this.element));D.createClientVe(this.element,this,156914);this.hide()},KSt=function(D){g.Tn.call(this,D); var X=this;this.endScreen=null;this.S=this.G=this.Y=!1;this.listeners=new g.HE(this);g.p(this,this.listeners);var M=D.W();D.isEmbedsShortsMode()?this.endScreen=new BV(D):TTK(D)?(this.Y=!0,LSt(this),this.S?this.endScreen=new Ts(D):M.T("delhi_modern_endscreen")?this.endScreen=new NTG(D):this.endScreen=new Fl(D)):M.WB?this.endScreen=new q1b(D):this.endScreen=new qw(D);g.p(this,this.endScreen);g.db(D,this.endScreen.element,4);sGh(this);this.listeners.N(D,"videodatachange",this.onVideoDataChange,this); this.listeners.N(D,g.rI("endscreen"),function(Q){X.onCueRangeEnter(Q)}); this.listeners.N(D,g.iB("endscreen"),function(Q){X.onCueRangeExit(Q)})},LSt=function(D){var X=D.player.getVideoData(); if(!X||D.S===X.EC&&D.G===X.R2)return!1;D.S=X.EC;D.G=X.R2;return!0},TTK=function(D){D=D.W(); return D.bM&&!D.WB&&!D.disableOrganicUi},sGh=function(D){D.player.HD("endscreen"); var X=D.player.getVideoData();X=new g.v9(Math.max((X.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var M=new g.v9(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});D.player.lH([X,M])}; g.mU.prototype.bG=g.i1(8,function(){return this.app.bG()}); g.TI.prototype.bG=g.i1(7,function(){return this.getVideoData().QQ}); g.cB.prototype.RU=g.i1(6,function(D){this.Qp().RU(D)}); g.oF.prototype.RU=g.i1(5,function(D){this.wg!==D&&(this.wg=D,this.TY())}); g.U(HV,g.Y);HV.prototype.select=function(){this.B.BW(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.K0||void 0)&&this.B.logClick(this.element)}; HV.prototype.onClick=function(D){g.NW(D,this.B,this.S,this.suggestion.sessionData||void 0)&&this.select()}; HV.prototype.onKeyPress=function(D){switch(D.keyCode){case 13:case 32:D.defaultPrevented||(this.select(),D.preventDefault())}};g.U(tJ,g.Y);g.B=tJ.prototype;g.B.iq=function(D){this.suggestion!==D&&(this.suggestion=D,g.kt(this.S,D),this.playButton.updateValue("url",this.suggestion.ML()),Nw(this))}; g.B.xc=function(){return this.Y>0}; g.B.pH=function(){this.xc()||(this.Y=Date.now(),Xl8(this),kGC(this.B,QGZ(this)),g.qE(this.B.getRootNode(),"countdown-running",this.xc()))}; g.B.Vb=function(){this.dV();Xl8(this);var D=this.S.h$("ytp-autonav-endscreen-upnext-header");D&&g.dP(D,"A continuaci\u00f3n")}; g.B.dV=function(){this.xc()&&(this.U.stop(),this.Y=0)}; g.B.select=function(D){this.B.nextVideo(!1,D===void 0?!1:D);this.dV()}; g.B.Am=function(D){g.NW(D,this.B)&&(D.currentTarget===this.playButton.element?this.B.logClick(this.playButton.element):D.currentTarget===this.S.h$("ytp-autonav-endscreen-link-container")&&(D=this.S.h$("ytp-autonav-endscreen-link-container"),this.B.logVisibility(D,!0),this.B.logClick(D)),this.D?(this.B.ER("innertubeCommand",this.D),this.dV()):this.select())}; g.B.JA=function(){this.B.logClick(this.cancelButton.element);g.bR(this.B,!0);this.cancelCommand&&this.B.ER("innertubeCommand",this.cancelCommand)}; g.B.onVideoDataChange=function(D,X){Dxn(this,X);D=X.getWatchNextResponse();var M,Q;D=(M=jeW(D))==null?void 0:(Q=M.cancelButton)==null?void 0:Q.buttonRenderer;this.cancelCommand=D==null?void 0:D.command}; g.B.l1y=function(D){if(hTn(this)){var X=this.B.getVideoData().watchToWatchTransitionRenderer,M=X==null?void 0:X.fromColorPaletteDark;X=X==null?void 0:X.toColorPaletteDark;if(M&&X){var Q=this.element;Q.style.setProperty("--w2w-start-background-color",g.IW(M.surgeColor));Q.style.setProperty("--w2w-start-primary-text-color",g.IW(M.primaryTitleColor));Q.style.setProperty("--w2w-start-secondary-text-color",g.IW(M.secondaryTitleColor));Q.style.setProperty("--w2w-end-background-color",g.IW(X.surgeColor)); Q.style.setProperty("--w2w-end-primary-text-color",g.IW(X.primaryTitleColor));Q.style.setProperty("--w2w-end-secondary-text-color",g.IW(X.secondaryTitleColor));Q.style.setProperty("--w2w-animation-duration",D+"ms")}g.qE(this.element,"ytp-w2w-animate",!0)}}; g.B.C8=function(D){this.B.T("web_autonav_color_transition")&&D!==2&&g.qE(this.element,"ytp-w2w-animate",!1)}; g.B.cj=function(){var D=this.B.R6();this.X&&this.Gm!==D&&this.Ew(D);Nw(this);this.B.logVisibility(this.container.element,D);this.B.logVisibility(this.cancelButton.element,D);this.B.logVisibility(this.S.h$("ytp-autonav-endscreen-link-container"),D);this.B.logVisibility(this.playButton.element,D)}; g.B.cB=function(D){return D.width<400||D.height<459};g.U(qw,g.Y);g.B=qw.prototype;g.B.create=function(){this.created=!0}; g.B.destroy=function(){this.created=!1}; g.B.O0=function(){return!1}; g.B.R6=function(){return!1}; g.B.Ki=function(){return!1};g.U(wG,g.Y);g.B=wG.prototype;g.B.Ur=function(){this.notification&&(this.U.stop(),this.PC(this.Y),this.Y=null,this.notification.close(),this.notification=null)}; g.B.iq=function(D){this.suggestion=D;g.kt(this,D,"hqdefault.jpg")}; g.B.Nv=function(){this.Ew(this.api.R6());this.api.logVisibility(this.element,this.api.R6());this.api.logVisibility(this.h$("ytp-upnext-autoplay-icon"),this.api.R6());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.R6())}; g.B.oR$=function(){window.focus();this.Ur()}; g.B.pH=function(D){var X=this;this.xc()||(g.Dm("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.G=(0,g.fi)(),this.S=new g.W5(function(){tFW(X,D)},25),tFW(this,D),kGC(this.api,HQ8(this,D))); g.tN(this.element,"ytp-upnext-autoplay-paused")}; g.B.hide=function(){g.Y.prototype.hide.call(this)}; g.B.xc=function(){return!!this.S}; g.B.Vb=function(){this.dV();this.G=(0,g.fi)();tFW(this);g.hN(this.element,"ytp-upnext-autoplay-paused")}; g.B.dV=function(){this.xc()&&(this.S.dispose(),this.S=null)}; g.B.select=function(D){D=D===void 0?!1:D;if(this.api.W().T("autonav_notifications")&&D&&window.Notification&&typeof document.hasFocus==="function"){var X=Notification.permission;X==="default"?Notification.requestPermission():X!=="granted"||document.hasFocus()||(this.Ur(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.gM()}),this.Y=this.N(this.notification,"click",this.oR$),this.U.start())}this.dV();this.api.nextVideo(!1,D)}; g.B.cN=function(D){!g.vD(this.cancelButton.element,D.target)&&g.NW(D,this.api)&&(this.api.R6()&&this.api.logClick(this.h$("ytp-upnext-autoplay-icon")),this.select())}; g.B.dA=function(){this.api.R6()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.bR(this.api,!0)}; g.B.NIf=function(D){this.api.getPresentingPlayerType();this.show();this.pH(D)}; g.B.mxf=function(){this.api.getPresentingPlayerType();this.dV();this.hide()}; g.B.Yy=function(){this.dV();this.Ur();g.Y.prototype.Yy.call(this)};g.U(Ts,qw);g.B=Ts.prototype;g.B.create=function(){qw.prototype.create.call(this);this.U.N(this.player,"appresize",this.pJ);this.U.N(this.player,"onVideoAreaChange",this.pJ);this.U.N(this.player,"videodatachange",this.onVideoDataChange);this.U.N(this.player,"autonavchange",this.vj);this.U.N(this.player,"onAutonavCancelled",this.AA);this.onVideoDataChange()}; g.B.show=function(){qw.prototype.show.call(this);(this.X||this.Y&&this.Y!==this.videoData.clientPlaybackNonce)&&g.bR(this.player,!1);g.rb(this.player)&&this.O0()&&!this.Y?(Lh(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3||uBh(this.player.qW())&&this.player.T("web_player_pip_logging_fix")?this.S.select(!0):this.S.pH():this.videoData.autonavState===3&&this.S.Vb()):(g.bR(this.player,!0),Lh(this));this.pJ()}; g.B.hide=function(){qw.prototype.hide.call(this);this.S.Vb();Lh(this)}; g.B.pJ=function(){var D=this.player.WL(!0,this.player.isFullscreen());Lh(this);Nw(this.G);g.qE(this.element,"ytp-autonav-cancelled-small-mode",this.cB(D));g.qE(this.element,"ytp-autonav-cancelled-tiny-mode",this.z8(D));g.qE(this.element,"ytp-autonav-cancelled-mini-mode",D.width<=400||D.height<=360);this.overlay&&g.Q_(this.overlay.element,{width:D.width+"px"});if(!this.D)for(D=0;D0&&(D= K*4,F=X<=w-2&&T>=L*4;if((L+1)/K*Q/t>t/(L/(K+1)*Q)&&F)T-=L*4,X+=2;else if(a)T-=K*4,D+=2;else if(F)T-=L*4,X+=2;else break}Q=!1;T>=12&&M*4-T<=6&&(X>=4||D>=4)&&(Q=!0);T=D*96;q=X*54;t=T/q=D-2&&L>=X-2?F=1:L%2===0&&w%2===0&&(L<2&&w<2?L===0&&w===0&&(F=2):F=2),K=g.Mt(K+this.Y,M),F!==0){a=this.stills[t];a||(a=new aV(this.player),this.stills[t]=a,H.appendChild(a.element));var V=Math.floor(q*L/X),c=Math.floor(T*w/D),S=Math.floor(q*(L+F)/X)-V-4,b=Math.floor(T*(w+F)/D)-c-4;g.TN(a.element,c,V);g.ax(a.element,b,S);g.Q_(a.element,"transitionDelay",(L+w)/20+"s");g.qE(a.element,"ytp-videowall-still-mini", F===1);g.qE(a.element,"ytp-videowall-still-large",F>2);F=Math.max(b,S);g.qE(a.element,"ytp-videowall-still-round-large",F>=256);g.qE(a.element,"ytp-videowall-still-round-medium",F>96&&F<256);g.qE(a.element,"ytp-videowall-still-round-small",F<=96);K=h[K];a.suggestion!==K&&(a.suggestion=K,F=a.api.W(),V=g.QP(a.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",g.kt(a,K,V),g.eO(F)&&!a.api.T("web_player_log_click_before_generating_ve_conversion_params")&&(F=K.ML(),V={},g.LS(a.api,"addEmbedsConversionTrackingParams", [V]),F=g.nJ(F,V),a.updateValue("url",F)),(K=(K=K.sessionData)&&K.itct)&&a.api.setTrackingParams(a.element,K));t++}H.ariaBusy="false";g.qE(this.element,"ytp-endscreen-paginate",t=t;h--)D=this.stills[h],g.gP(D.element),g.Kp(D);this.stills.length=t}}; g.B.onVideoDataChange=function(){var D=this.player.getVideoData(1);this.videoData!==D&&(D!=null&&g.hu(D)?(this.Y=0,this.videoData=D,this.XY()):this.player.SH("missg",{vid:(D==null?void 0:D.videoId)||"",cpn:(D==null?void 0:D.clientPlaybackNonce)||""}))}; g.B.vN=function(){this.Y+=this.stills.length;this.XY()}; g.B.I8=function(){this.Y-=this.stills.length;this.XY()}; g.B.Ki=function(){return this.S.xc()}; g.B.cM=function(D){D===1?(this.D=!1,this.U=this.videoData.clientPlaybackNonce,this.S.dV(),this.Gm&&this.XY()):(this.D=!0,this.Gm&&VG(this)&&(D===2?this.S.pH():D===3&&this.S.Vb()))}; g.B.m_=function(D){if(D){for(D=0;D0||D.endSeconds>0||D.mutedAutoplayDurationMode!==2);if(this.player.isEmbedsShortsMode()&&!X)return!0;var M;var Q=!!((D==null?0:g.hu(D))||(D==null?0:(M=D.suggestions)==null?0:M.length));Q=!TTK(this.player)||Q;D=D.eG;M=this.player.Jk();return Q&&!D&&!M&&!X}; g.B.R6=function(){return this.endScreen.R6()}; g.B.O$5=function(){return this.R6()?this.endScreen.Ki():!1}; g.B.Yy=function(){this.player.HD("endscreen");g.Tn.prototype.Yy.call(this)}; g.B.load=function(){var D=this.player.getVideoData();var X=D.transitionEndpointAtEndOfStream;if(X&&X.videoId){var M=this.player.Qq().YC.get("heartbeat"),Q=g.hu(D);!Q||X.videoId!==Q.videoId||D.OQ?(this.player.BW(X.videoId,void 0,void 0,!0,!0,X),M&&M.Uz("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),D=!0):D=!1}else D=!1;D||(g.Tn.prototype.load.call(this),this.endScreen.show())}; g.B.unload=function(){g.Tn.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.B.onCueRangeEnter=function(D){this.xe()&&(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(){sGh(this);this.Y&&LSt(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.S?this.endScreen=new Ts(this.player):this.endScreen=new Fl(this.player),g.p(this,this.endScreen),g.db(this.player,this.endScreen.element,4))};g.wZ("endscreen",KSt);})(_yt_player);