(function(g){var window=this;'use strict';var PwZ=function(x,u){x.Xt("onAutonavCoundownStarted",u)},NXS=function(x){var u,k,U; return x==null?void 0:(u=x.playerOverlays)==null?void 0:(k=u.playerOverlayRenderer)==null?void 0:(U=k.autoplay)==null?void 0:U.playerOverlayAutoplayRenderer},mL=function(x,u,k){g.pb(x.element,"ytp-suggestion-set",!!u.videoId); var U=u.playlistId;k=u.g9(k?k:"mqdefault.jpg");var m=null,F=null;u instanceof g.W5&&(u.lengthText?(m=u.lengthText||null,F=u.ZM||null):u.lengthSeconds&&(m=g.nD(u.lengthSeconds),F=g.nD(u.lengthSeconds,!0)));var f=!!U;U=f&&g.GU(U).type==="RD";var V=u instanceof g.W5?u.isLivePlayback:null,h=u instanceof g.W5?u.isUpcoming:null,X=u.author,q=u.shortViewCount,H=u.publishedTimeText,R=[],p=[];X&&R.push(X);q&&(R.push(q),p.push(q));H&&p.push(H);k={title:u.title,author:X,author_and_views:R.join(" \u2022 "),aria_label:u.ariaLabel|| g.tK("Assistir a $TITLE",{TITLE:u.title}),duration:m,timestamp:F,url:u.Qd(),is_live:V,is_upcoming:h,is_list:f,is_mix:U,background:k?"background-image: url("+k+")":"",views_and_publish_time:p.join(" \u2022 "),autoplayAlternativeHeader:u.qc};u instanceof g.zU&&(k.playlist_length=u.playlistLength);x.update(k)},Fo=function(x){var u=x.X(),k=u.K; g.T.call(this,{T:"a",Z:"ytp-autonav-suggestion-card",C:{href:"{{url}}",target:k?u.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}}"},L:[{T:"div",W$:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],C:{style:"{{background}}"},L:[{T:"div",C:{"aria-label":"{{timestamp}}"},W$:["ytp-autonav-timestamp"],VX:"{{duration}}"},{T:"div",W$:["ytp-autonav-live-stamp"],VX:"Ao vivo"}, {T:"div",W$:["ytp-autonav-upcoming-stamp"],VX:"Em breve"},{T:"div",Z:"ytp-autonav-list-overlay",L:[{T:"div",Z:"ytp-autonav-mix-text",VX:"Mix"},{T:"div",Z:"ytp-autonav-mix-icon"}]}]},{T:"div",W$:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],VX:"{{title}}"},{T:"div",W$:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],VX:"{{author}}"},{T:"div",W$:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],VX:"{{views_and_publish_time}}"}]});this.W=x;this.suggestion= null;this.S=k;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},fs=function(x,u){u=u===void 0?!1:u; g.T.call(this,{T:"div",Z:"ytp-autonav-endscreen-countdown-overlay"});var k=this;this.D=u;this.cancelCommand=this.j=void 0;this.J=0;this.container=new g.T({T:"div",Z:"ytp-autonav-endscreen-countdown-container"});g.P(this,this.container);this.container.pm(this.element);u=x.X();var U=u.K;this.W=x;this.suggestion=null;this.onVideoDataChange("newdata",this.W.getVideoData());this.Y(x,"videodatachange",this.onVideoDataChange);this.S=new g.T({T:"div",Z:"ytp-autonav-endscreen-upnext-container",C:{"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:[{T:"div",Z:"ytp-autonav-endscreen-upnext-header"},{T:"div",Z:"ytp-autonav-endscreen-upnext-alternative-header",VX:"{{autoplayAlternativeHeader}}"},{T:"a",Z:"ytp-autonav-endscreen-link-container",C:{href:"{{url}}",target:U?u.U:""},L:[{T:"div",Z:"ytp-autonav-endscreen-upnext-thumbnail",C:{style:"{{background}}"},L:[{T:"div",C:{"aria-label":"{{timestamp}}"},W$:["ytp-autonav-timestamp"], VX:"{{duration}}"},{T:"div",W$:["ytp-autonav-live-stamp"],VX:"Ao vivo"},{T:"div",W$:["ytp-autonav-upcoming-stamp"],VX:"Em breve"}]},{T:"div",Z:"ytp-autonav-endscreen-video-info",L:[{T:"div",Z:"ytp-autonav-endscreen-premium-badge"},{T:"div",Z:"ytp-autonav-endscreen-upnext-title",VX:"{{title}}"},{T:"div",Z:"ytp-autonav-endscreen-upnext-author",VX:"{{author}}"},{T:"div",Z:"ytp-autonav-view-and-date",VX:"{{views_and_publish_time}}"},{T:"div",Z:"ytp-autonav-author-and-view",VX:"{{author_and_views}}"}]}]}]}); g.P(this,this.S);this.S.pm(this.container.element);U||this.Y(this.S.k$("ytp-autonav-endscreen-link-container"),"click",this.Ys);this.W.createClientVe(this.container.element,this,115127);this.W.createClientVe(this.S.k$("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.T({T:"div",Z:"ytp-autonav-overlay"});g.P(this,this.overlay);this.overlay.pm(this.container.element);this.V=new g.T({T:"div",Z:"ytp-autonav-endscreen-button-container"});g.P(this,this.V);this.V.pm(this.container.element); this.cancelButton=new g.T({T:"button",W$:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",u.G("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],C:{"aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},VX:"Cancelar"});g.P(this,this.cancelButton);this.cancelButton.pm(this.V.element);this.cancelButton.listen("click",this.wq,this);this.W.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.T({T:"a",W$:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",u.G("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],C:{href:"{{url}}",role:"button","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},VX:"Assista agora"});g.P(this,this.playButton);this.playButton.pm(this.V.element);this.playButton.listen("click",this.Ys,this);this.W.createServerVe(this.playButton.element,this.playButton,!0);(u=this.W.getVideoData())&&dHG(this,u);this.K=new g.gl(function(){KcS(k)},500); g.P(this,this.K);this.Zj();this.Y(x,"autonavvisibility",this.Zj);this.W.G("web_autonav_color_transition")&&(this.Y(x,"autonavchange",this.Bi),this.Y(x,"onAutonavCoundownStarted",this.ks$))},bc=function(x){var u=x.W.QL(!0,x.W.isFullscreen()); g.pb(x.container.element,"ytp-autonav-endscreen-small-mode",x.Oe(u));g.pb(x.container.element,"ytp-autonav-endscreen-is-premium",!!x.suggestion&&!!x.suggestion.jTX);g.pb(x.W.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!x.W.xR());g.pb(x.W.getRootNode(),"countdown-running",x.Lr());g.pb(x.container.element,"ytp-player-content",x.W.xR());g.Rd(x.overlay.element,{width:u.width+"px"});if(!x.Lr()){x.W.xR()?vpG(x,Math.round(TX9(x)/1E3)):vpG(x);u=!!x.suggestion&&!!x.suggestion.qc;var k=x.W.xR()|| !u;g.pb(x.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!k&&u);g.pb(x.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",k&&!u);x.V.J9(x.W.xR());g.pb(x.element,"ytp-enable-w2w-color-transitions",ASZ(x))}},KcS=function(x){var u=TX9(x),k=Math,U=k.min; var m=x.J?Date.now()-x.J:0;k=U.call(k,m,u);vpG(x,Math.ceil((u-k)/1E3));u-k<=500&&x.Lr()?x.select(!0):x.Lr()&&x.K.start()},TX9=function(x){if(x.W.isFullscreen()){var u; x=(u=x.W.getVideoData())==null?void 0:u.Pw;return x===-1||x===void 0?8E3:x}return x.W.Xc()>=0?x.W.Xc():g.MT(x.W.X().experiments,"autoplay_time")||1E4},dHG=function(x,u){u=u.getWatchNextResponse(); var k,U;u=(k=NXS(u))==null?void 0:(U=k.nextButton)==null?void 0:U.buttonRenderer;x.j=u==null?void 0:u.navigationEndpoint;k=u==null?void 0:u.trackingParams;x.playButton&&k&&x.W.setTrackingParams(x.playButton.element,k)},ASZ=function(x){var u; return!((u=x.W.getVideoData())==null||!u.watchToWatchTransitionRenderer)},vpG=function(x,u){u=u===void 0?-1:u; x=x.S.k$("ytp-autonav-endscreen-upnext-header");g.m6(x);if(u>=0){u=String(u);var k="Pr\u00f3ximo v\u00eddeo em $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],U="Pr\u00f3ximo v\u00eddeo em $SECONDS".indexOf(k);if(U>=0){x.appendChild(g.ka("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(0,U)));var m=g.gF("span");g.hW(m,"ytp-autonav-endscreen-upnext-header-countdown-number");g.VU(m,u);x.appendChild(m);x.appendChild(g.ka("Pr\u00f3ximo v\u00eddeo em $SECONDS".slice(U+k.length)));return}}g.VU(x,"Pr\u00f3ximo")}, VE=function(x,u){g.T.call(this,{T:"div", W$:["html5-endscreen","ytp-player-content",u||"base-endscreen"]});this.created=!1;this.player=x},h4=function(x){g.T.call(this,{T:"div", W$:["ytp-upnext","ytp-player-content"],C:{"aria-label":"{{aria_label}}"},L:[{T:"div",Z:"ytp-cued-thumbnail-overlay-image",C:{style:"{{background}}"}},{T:"span",Z:"ytp-upnext-top",L:[{T:"span",Z:"ytp-upnext-header",VX:"Pr\u00f3ximo"},{T:"span",Z:"ytp-upnext-title",VX:"{{title}}"},{T:"span",Z:"ytp-upnext-author",VX:"{{author}}"}]},{T:"a",Z:"ytp-upnext-autoplay-icon",C:{role:"button",href:"{{url}}","aria-label":"Reproduzir pr\u00f3ximo v\u00eddeo"},L:[{T:"svg",C:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},L:[{T:"circle",Z:"ytp-svg-autoplay-circle",C:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{T:"circle",Z:"ytp-svg-autoplay-ring",C:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{T:"path",Z:"ytp-svg-fill",C:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{T:"span",Z:"ytp-upnext-bottom",L:[{T:"span",Z:"ytp-upnext-cancel"},{T:"span",Z:"ytp-upnext-paused", VX:"Reprodu\u00e7\u00e3o autom\u00e1tica pausada"}]}]});this.api=x;this.cancelButton=null;this.j=this.k$("ytp-svg-autoplay-ring");this.J=this.notification=this.S=this.suggestion=null;this.K=new g.gl(this.SD,5E3,this);this.V=0;var u=this.k$("ytp-upnext-cancel");this.cancelButton=new g.T({T:"button",W$:["ytp-upnext-cancel-button","ytp-button"],C:{tabindex:"0","aria-label":"Cancelar reprodu\u00e7\u00e3o autom\u00e1tica"},VX:"Cancelar"});g.P(this,this.cancelButton);this.cancelButton.listen("click",this.Hi, this);this.cancelButton.pm(u);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.P(this,this.K);this.api.createClientVe(this.element,this,18788);u=this.k$("ytp-upnext-autoplay-icon");this.Y(u,"click",this.XR);this.api.createClientVe(u,this,115130);this.rP();this.Y(x,"autonavvisibility",this.rP);this.Y(x,"mdxnowautoplaying",this.UVS);this.Y(x,"mdxautoplaycanceled",this.oV$);g.pb(this.element,"ytp-upnext-mobile",this.api.X().V)},CwB=function(x,u){if(u)return u; if(x.api.isFullscreen()){var k;x=(k=x.api.getVideoData())==null?void 0:k.Pw;return x===-1||x===void 0?8E3:x}return x.api.Xc()>=0?x.api.Xc():g.MT(x.api.X().experiments,"autoplay_time")||1E4},Lcm=function(x,u){u=CwB(x,u); var k=Math,U=k.min;var m=(0,g.j4)()-x.V;k=U.call(k,m,u);u=u===0?1:Math.min(k/u,1);x.j.setAttribute("stroke-dashoffset",""+-211*(u+1));u>=1&&x.Lr()&&x.api.getPresentingPlayerType()!==3?x.select(!0):x.Lr()&&x.S.start()},Xo=function(x){VE.call(this,x,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.T({T:"div",Z:"ytp-suggestion-panel",L:[{T:"div",W$:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],VX:"Mais v\u00eddeos"}]});this.B=new g.T({T:"div",Z:"ytp-suggestions-container"});this.videos=[];this.J=null;this.j=this.D=!1;this.V=new fs(this.player);g.P(this,this.V);this.V.pm(this.element);x.getVideoData().HZ?this.S=this.V:(this.S=new h4(x),g.QD(this.player,this.S.element,4),g.P(this,this.S));this.overlay=new g.T({T:"div", Z:"ytp-autonav-overlay-cancelled-state"});g.P(this,this.overlay);this.overlay.pm(this.element);this.K=new g.Pr(this);g.P(this,this.K);g.P(this,this.table);this.table.pm(this.element);this.table.show();g.P(this,this.B);this.B.pm(this.table.element);this.hide()},qZ=function(x){var u=x.xR(); u!==x.j&&(x.j=u,x.player.publish("autonavvisibility"),x.j?(x.V!==x.S&&x.V.hide(),x.table.hide()):(x.V!==x.S&&x.V.show(),x.table.show()))},sa=function(x,u){g.T.call(this,{T:"button", W$:["ytp-watch-on-youtube-button","ytp-button"],VX:"{{content}}"});this.W=x;this.buttonType=this.buttonType=u;this.n9();this.buttonType===2&&g.qN(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.n9);this.J9(!0)},Hx=function(x,u){VE.call(this,x,"embeds-lite-endscreen"); this.W=x;this.S=u;this.W.createClientVe(this.element,this,156943);this.watchButton=new sa(x,2);g.P(this,this.watchButton);this.watchButton.pm(this.element);this.hide()},DHm=function(x){VE.call(this,x,"subscribecard-endscreen"); this.S=new g.T({T:"div",Z:"ytp-subscribe-card",L:[{T:"img",Z:"ytp-author-image",C:{src:"{{profilePicture}}"}},{T:"div",Z:"ytp-subscribe-card-right",L:[{T:"div",Z:"ytp-author-name",VX:"{{author}}"},{T:"div",Z:"html5-subscribe-button-container"}]}]});g.P(this,this.S);this.S.pm(this.element);var u=x.getVideoData();this.subscribeButton=new g.ou("Inscreva-se",null,"Cancelar assinatura",null,!0,!1,u.k9,u.subscribed,"trailer-endscreen",null,x,!1);g.P(this,this.subscribeButton);this.subscribeButton.pm(this.S.k$("html5-subscribe-button-container")); this.Y(x,"videodatachange",this.aS);this.aS();this.hide()},R8=function(x){var u=x.X(),k=g.QM||g.i8?{style:"will-change: opacity"}:void 0,U=u.K,m=["ytp-videowall-still"]; u.V&&m.push("ytp-videowall-show-text");g.T.call(this,{T:"a",W$:m,C:{href:"{{url}}",target:U?u.U:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},L:[{T:"div",Z:"ytp-videowall-still-image",C:{style:"{{background}}"}},{T:"span",Z:"ytp-videowall-still-info",C:{"aria-hidden":"true"},L:[{T:"span",Z:"ytp-videowall-still-info-bg",L:[{T:"span",Z:"ytp-videowall-still-info-content",C:k,L:[{T:"span",Z:"ytp-videowall-still-info-title",VX:"{{title}}"}, {T:"span",Z:"ytp-videowall-still-info-author",VX:"{{author_and_views}}"},{T:"span",Z:"ytp-videowall-still-info-live",VX:"Ao vivo"},{T:"span",Z:"ytp-videowall-still-info-duration",VX:"{{duration}}"}]}]}]},{T:"span",W$:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],C:{"aria-hidden":"true"},L:[{T:"span",Z:"ytp-videowall-still-listlabel-icon"},"Playlist",{T:"span",Z:"ytp-videowall-still-listlabel-length",L:[" (",{T:"span",VX:"{{playlist_length}}"},")"]}]},{T:"span",W$:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],C:{"aria-hidden":"true"},L:[{T:"span",Z:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{T:"span",Z:"ytp-videowall-still-listlabel-length",VX:" (50+)"}]}]});this.suggestion=null;this.V=U;this.api=x;this.S=new g.Pr(this);g.P(this,this.S);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.S.Y(x,"videodatachange",this.onVideoDataChange);x.createServerVe(this.element,this);this.onVideoDataChange()},ps=function(x){VE.call(this,x,"videowall-endscreen"); var u=this;this.W=x;this.J=0;this.stills=[];this.K=this.videoData=null;this.j=this.B=!1;this.U=null;this.V=new g.Pr(this);g.P(this,this.V);this.D=new g.gl(function(){g.qN(u.element,"ytp-show-tiles")},0); g.P(this,this.D);var k=new g.T({T:"button",W$:["ytp-button","ytp-endscreen-previous"],C:{"aria-label":"Anterior"},L:[g.z0()]});g.P(this,k);k.pm(this.element);k.listen("click",this.Ce,this);this.table=new g.pg({T:"div",Z:"ytp-endscreen-content"});g.P(this,this.table);this.table.pm(this.element);k=new g.T({T:"button",W$:["ytp-button","ytp-endscreen-next"],C:{"aria-label":"Pr\u00f3ximo"},L:[g.Wm()]});g.P(this,k);k.pm(this.element);k.listen("click",this.zE,this);x.getVideoData().HZ?this.S=new fs(x,!0): this.S=new h4(x);g.P(this,this.S);g.QD(this.player,this.S.element,4);x.createClientVe(this.element,this,158789);this.hide()},cx=function(x){return g.I7(x.player)&&x.gw()&&!x.K},MZ=function(x){var u=x.xR(); u!==x.B&&(x.B=u,x.player.publish("autonavvisibility"))},w1=function(x){VE.call(this,x,"watch-again-on-youtube-endscreen"); this.watchButton=new sa(x,1);g.P(this,this.watchButton);this.watchButton.pm(this.element);g.D1R(x)&&(this.S=new g.S5(x),g.P(this,this.S),this.V=new g.T({T:"div",W$:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],C:{tabIndex:"-1"},L:[this.S]}),g.P(this,this.V),this.S.pm(this.V.element),this.V.pm(this.element));x.createClientVe(this.element,this,156914);this.hide()},x3W=function(x){g.wj.call(this,x); var u=this;this.endScreen=null;this.V=this.S=this.J=this.K=!1;this.listeners=new g.Pr(this);g.P(this,this.listeners);var k=x.X(),U=x.getVideoData();U=U&&U.limitedPlaybackDurationInSeconds!==0;g.Rm(g.JU(k))&&U&&!g.rM(x)?(this.V=!0,this.endScreen=new Hx(x,g.cl(x))):x.isEmbedsShortsMode()?this.endScreen=new w1(x):S7G(x)?(this.K=!0,BXm(this),this.S?this.endScreen=new Xo(x):this.endScreen=new ps(x)):k.HZ?this.endScreen=new DHm(x):this.endScreen=new VE(x);g.P(this,this.endScreen);g.QD(x,this.endScreen.element, 4);obZ(this);this.listeners.Y(x,"videodatachange",this.onVideoDataChange,this);this.listeners.Y(x,g.X0("endscreen"),function(m){u.onCueRangeEnter(m)}); this.listeners.Y(x,g.qY("endscreen"),function(m){u.onCueRangeExit(m)})},BXm=function(x){var u=x.player.getVideoData(); if(!u||x.S===u.Fu&&x.J===u.HZ)return!1;x.S=u.Fu;x.J=u.HZ;return!0},S7G=function(x){x=x.X(); return x.QH&&!x.HZ&&!x.disableOrganicUi},obZ=function(x){x.player.Gw("endscreen"); var u=x.player.getVideoData();u=new g.V5(Math.max((u.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var k=new g.V5(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});x.player.tO([u,k])}; g.Oh.prototype.Xc=g.gQ(14,function(){return this.app.Xc()}); g.Mn.prototype.Xc=g.gQ(13,function(){return this.getVideoData().s9}); g.Eh.prototype.CQ=g.gQ(12,function(x){this.Z_().CQ(x)}); g.Mw.prototype.CQ=g.gQ(11,function(x){this.S!==x&&(this.S=x,this.aS())}); g.ni.prototype.CQ=g.gQ(10,function(x){this.overflowButton&&this.overflowButton.CQ(x)}); g.Eh.prototype.Uq=g.gQ(9,function(x){this.Z_().Uq(x)}); g.Ec.prototype.Uq=g.gQ(8,function(x){this.V!==x&&(this.V=x,this.aS())}); g.ni.prototype.Uq=g.gQ(7,function(x){this.shareButton&&this.shareButton.Uq(x)}); g.Eh.prototype.JJ=g.gQ(6,function(x){this.Z_().JJ(x)}); g.TV.prototype.JJ=g.gQ(5,function(x){this.nT!==x&&(this.nT=x,this.g5())}); g.Eh.prototype.VA=g.gQ(4,function(x){this.Z_().VA(x)}); g.ni.prototype.VA=g.gQ(3,function(x){this.kc!==x&&(this.kc=x,this.i$())});g.M(Fo,g.T);Fo.prototype.select=function(){this.W.ZR(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.Vv||void 0)&&this.W.logClick(this.element)}; Fo.prototype.onClick=function(x){g.Vc(x,this.W,this.S,this.suggestion.sessionData||void 0)&&this.select()}; Fo.prototype.onKeyPress=function(x){switch(x.keyCode){case 13:case 32:x.defaultPrevented||(this.select(),x.preventDefault())}};g.M(fs,g.T);g.b=fs.prototype;g.b.T2=function(x){this.suggestion!==x&&(this.suggestion=x,mL(this.S,x),this.playButton.updateValue("url",this.suggestion.Qd()),bc(this))}; g.b.Lr=function(){return this.J>0}; g.b.iq=function(){this.Lr()||(this.J=Date.now(),KcS(this),PwZ(this.W,TX9(this)),g.pb(this.W.getRootNode(),"countdown-running",this.Lr()))}; g.b.p4=function(){this.nk();KcS(this);var x=this.S.k$("ytp-autonav-endscreen-upnext-header");x&&g.VU(x,"Pr\u00f3ximo")}; g.b.nk=function(){this.Lr()&&(this.K.stop(),this.J=0)}; g.b.select=function(x){this.W.nextVideo(!1,x===void 0?!1:x);this.nk()}; g.b.Ys=function(x){g.Vc(x,this.W)&&(x.currentTarget===this.playButton.element?this.W.logClick(this.playButton.element):x.currentTarget===this.S.k$("ytp-autonav-endscreen-link-container")&&(x=this.S.k$("ytp-autonav-endscreen-link-container"),this.W.logVisibility(x,!0),this.W.logClick(x)),this.j?(this.W.Xt("innertubeCommand",this.j),this.nk()):this.select())}; g.b.wq=function(){this.W.logClick(this.cancelButton.element);g.nN(this.W,!0);this.cancelCommand&&this.W.Xt("innertubeCommand",this.cancelCommand)}; g.b.onVideoDataChange=function(x,u){dHG(this,u);x=u.getWatchNextResponse();var k,U;x=(k=NXS(x))==null?void 0:(U=k.cancelButton)==null?void 0:U.buttonRenderer;this.cancelCommand=x==null?void 0:x.command}; g.b.ks$=function(x){if(ASZ(this)){var u=this.W.getVideoData().watchToWatchTransitionRenderer,k=u==null?void 0:u.fromColorPaletteDark;u=u==null?void 0:u.toColorPaletteDark;if(k&&u){var U=this.element;U.style.setProperty("--w2w-start-background-color",g.TR(k.surgeColor));U.style.setProperty("--w2w-start-primary-text-color",g.TR(k.primaryTitleColor));U.style.setProperty("--w2w-start-secondary-text-color",g.TR(k.secondaryTitleColor));U.style.setProperty("--w2w-end-background-color",g.TR(u.surgeColor)); U.style.setProperty("--w2w-end-primary-text-color",g.TR(u.primaryTitleColor));U.style.setProperty("--w2w-end-secondary-text-color",g.TR(u.secondaryTitleColor));U.style.setProperty("--w2w-animation-duration",x+"ms")}g.pb(this.element,"ytp-w2w-animate",!0)}}; g.b.Bi=function(x){this.W.G("web_autonav_color_transition")&&x!==2&&g.pb(this.element,"ytp-w2w-animate",!1)}; g.b.Zj=function(){var x=this.W.xR();this.D&&this.Tx!==x&&this.J9(x);bc(this);this.W.logVisibility(this.container.element,x);this.W.logVisibility(this.cancelButton.element,x);this.W.logVisibility(this.S.k$("ytp-autonav-endscreen-link-container"),x);this.W.logVisibility(this.playButton.element,x)}; g.b.Oe=function(x){return x.width<400||x.height<459};g.M(VE,g.T);g.b=VE.prototype;g.b.create=function(){this.created=!0}; g.b.destroy=function(){this.created=!1}; g.b.gw=function(){return!1}; g.b.xR=function(){return!1}; g.b.ze=function(){return!1};g.M(h4,g.T);g.b=h4.prototype;g.b.SD=function(){this.notification&&(this.K.stop(),this.Fv(this.J),this.J=null,this.notification.close(),this.notification=null)}; g.b.T2=function(x){this.suggestion=x;mL(this,x,"hqdefault.jpg")}; g.b.rP=function(){this.J9(this.api.xR());this.api.logVisibility(this.element,this.api.xR());this.api.logVisibility(this.k$("ytp-upnext-autoplay-icon"),this.api.xR());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.xR())}; g.b.M$$=function(){window.focus();this.SD()}; g.b.iq=function(x){var u=this;this.Lr()||(g.s3("a11y-announce","Pr\u00f3ximo "+this.suggestion.title),this.V=(0,g.j4)(),this.S=new g.gl(function(){Lcm(u,x)},25),Lcm(this,x),PwZ(this.api,CwB(this,x))); g.HN(this.element,"ytp-upnext-autoplay-paused")}; g.b.hide=function(){g.T.prototype.hide.call(this)}; g.b.Lr=function(){return!!this.S}; g.b.p4=function(){this.nk();this.V=(0,g.j4)();Lcm(this);g.qN(this.element,"ytp-upnext-autoplay-paused")}; g.b.nk=function(){this.Lr()&&(this.S.dispose(),this.S=null)}; g.b.select=function(x){x=x===void 0?!1:x;if(this.api.X().G("autonav_notifications")&&x&&window.Notification&&typeof document.hasFocus==="function"){var u=Notification.permission;u==="default"?Notification.requestPermission():u!=="granted"||document.hasFocus()||(this.SD(),this.notification=new Notification("Pr\u00f3ximo",{body:this.suggestion.title,icon:this.suggestion.g9()}),this.J=this.Y(this.notification,"click",this.M$$),this.K.start())}this.nk();this.api.nextVideo(!1,x)}; g.b.XR=function(x){!g.br(this.cancelButton.element,x.target)&&g.Vc(x,this.api)&&(this.api.xR()&&this.api.logClick(this.k$("ytp-upnext-autoplay-icon")),this.select())}; g.b.Hi=function(){this.api.xR()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.nN(this.api,!0)}; g.b.UVS=function(x){this.api.getPresentingPlayerType();this.show();this.iq(x)}; g.b.oV$=function(){this.api.getPresentingPlayerType();this.nk();this.hide()}; g.b.SJ=function(){this.nk();this.SD();g.T.prototype.SJ.call(this)};g.M(Xo,VE);g.b=Xo.prototype;g.b.create=function(){VE.prototype.create.call(this);this.K.Y(this.player,"appresize",this.SN);this.K.Y(this.player,"onVideoAreaChange",this.SN);this.K.Y(this.player,"videodatachange",this.onVideoDataChange);this.K.Y(this.player,"autonavchange",this.QU);this.K.Y(this.player,"onAutonavCancelled",this.Le);this.onVideoDataChange()}; g.b.show=function(){VE.prototype.show.call(this);(this.D||this.J&&this.J!==this.videoData.clientPlaybackNonce)&&g.nN(this.player,!1);g.I7(this.player)&&this.gw()&&!this.J?(qZ(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.S.select(!0):this.S.iq():this.videoData.autonavState===3&&this.S.p4()):(g.nN(this.player,!0),qZ(this));this.SN()}; g.b.hide=function(){VE.prototype.hide.call(this);this.S.p4();qZ(this)}; g.b.SN=function(){var x=this.player.QL(!0,this.player.isFullscreen());qZ(this);bc(this.V);g.pb(this.element,"ytp-autonav-cancelled-small-mode",this.Oe(x));g.pb(this.element,"ytp-autonav-cancelled-tiny-mode",this.Q6(x));g.pb(this.element,"ytp-autonav-cancelled-mini-mode",x.width<=400||x.height<=360);this.overlay&&g.Rd(this.overlay.element,{width:x.width+"px"});if(!this.j)for(x=0;x0&&(x= H*4,p=u<=h-2&&X>=q*4;if((q+1)/H*U/f>f/(q/(H+1)*U)&&p)X-=q*4,u+=2;else if(R)X-=H*4,x+=2;else if(p)X-=q*4,u+=2;else break}U=!1;X>=12&&k*4-X<=6&&(u>=4||x>=4)&&(U=!0);X=x*96;V=u*54;f=X/V=x-2&&q>=u-2?p=1:q%2===0&&h%2===0&&(q<2&&h<2?q===0&&h===0&&(p=2):p=2),H=g.He(H+this.J,k),p!==0){R=this.stills[f];R||(R=new R8(this.player),this.stills[f]=R,F.appendChild(R.element));var c=Math.floor(V*q/u),Y=Math.floor(X*h/x),E=Math.floor(V*(q+p)/u)-c-4,z=Math.floor(X*(h+p)/x)-Y-4;g.YS(R.element,Y,c);g.lM(R.element,z,E);g.Rd(R.element,"transitionDelay",(q+h)/20+"s");g.pb(R.element,"ytp-videowall-still-mini", p===1);g.pb(R.element,"ytp-videowall-still-large",p>2);p=Math.max(z,E);g.pb(R.element,"ytp-videowall-still-round-large",p>=256);g.pb(R.element,"ytp-videowall-still-round-medium",p>96&&p<256);g.pb(R.element,"ytp-videowall-still-round-small",p<=96);H=m[H];R.suggestion!==H&&(R.suggestion=H,p=R.api.X(),c=g.XH(R.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",mL(R,H,c),g.n0(p)&&!R.api.G("web_player_log_click_before_generating_ve_conversion_params")&&(p=H.Qd(),c={},g.qK(R.api,"addEmbedsConversionTrackingParams", [c]),p=g.AS(p,c),R.updateValue("url",p)),(H=(H=H.sessionData)&&H.itct)&&R.api.setTrackingParams(R.element,H));f++}F.ariaBusy="false";g.pb(this.element,"ytp-endscreen-paginate",f=f;m--)x=this.stills[m],g.fk(x.element),g.bZ(x);this.stills.length=f}}; g.b.onVideoDataChange=function(){var x=this.player.getVideoData(1);this.videoData!==x&&(x!=null&&g.u_(x)?(this.J=0,this.videoData=x,this.Dx()):this.player.A5("missg",{vid:(x==null?void 0:x.videoId)||"",cpn:(x==null?void 0:x.clientPlaybackNonce)||""}))}; g.b.zE=function(){this.J+=this.stills.length;this.Dx()}; g.b.Ce=function(){this.J-=this.stills.length;this.Dx()}; g.b.ze=function(){return this.S.Lr()}; g.b.u3=function(x){x===1?(this.j=!1,this.K=this.videoData.clientPlaybackNonce,this.S.nk(),this.Tx&&this.Dx()):(this.j=!0,this.Tx&&cx(this)&&(x===2?this.S.iq():x===3&&this.S.p4()))}; g.b.Pi=function(x){if(x){for(x=0;x0||x.endSeconds>0||x.mutedAutoplayDurationMode!==2);if((this.player.isEmbedsShortsMode()||this.V)&&!u)return!0;var k;var U=!!((x==null?0:g.u_(x))||(x==null?0:(k=x.suggestions)==null?0:k.length));U=!S7G(this.player)||U;x=x.Je;k=this.player.q4();return U&&!x&&!k&&!u}; g.b.xR=function(){return this.endScreen.xR()}; g.b.xjX=function(){return this.xR()?this.endScreen.ze():!1}; g.b.SJ=function(){this.player.Gw("endscreen");g.wj.prototype.SJ.call(this)}; g.b.load=function(){var x=this.player.getVideoData();var u=x.transitionEndpointAtEndOfStream;if(u&&u.videoId){var k=this.player.VI().V8.get("heartbeat"),U=g.u_(x);!U||u.videoId!==U.videoId||x.hU?(this.player.ZR(u.videoId,void 0,void 0,!0,!0,u),k&&k.AY("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),x=!0):x=!1}else x=!1;x||(g.wj.prototype.load.call(this),this.endScreen.show())}; g.b.unload=function(){g.wj.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.b.onCueRangeEnter=function(x){this.n1()&&(this.endScreen.created||this.endScreen.create(),x.getId()==="load"&&this.load())}; g.b.onCueRangeExit=function(x){x.getId()==="load"&&this.loaded&&this.unload()}; g.b.onVideoDataChange=function(){obZ(this);this.K&&BXm(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.S?this.endScreen=new Xo(this.player):this.endScreen=new ps(this.player),g.P(this,this.endScreen),g.QD(this.player,this.endScreen.element,4))};g.M2("endscreen",x3W);})(_yt_player);