(function(g){var window=this;'use strict';var aK6=function(O){O.publish("autonavvisibility")},vlC=function(O,R){O.tR("onAutonavCoundownStarted",R)},XqM=function(O){var R,J,l; return O==null?void 0:(R=O.playerOverlays)==null?void 0:(J=R.playerOverlayRenderer)==null?void 0:(l=J.autoplay)==null?void 0:l.playerOverlayAutoplayRenderer},lg=function(O,R,J){g.wI(O.element,"ytp-suggestion-set",!!R.videoId); var l=R.playlistId;J=R.h1(J?J:"mqdefault.jpg");var u=null,F=null;R instanceof g.aQ&&(R.lengthText?(u=R.lengthText||null,F=R.lF||null):R.lengthSeconds&&(u=g.vI(R.lengthSeconds),F=g.vI(R.lengthSeconds,!0)));var G=!!l;l=G&&g.EE(l).type==="RD";var y=R instanceof g.aQ?R.isLivePlayback:null,w=R instanceof g.aQ?R.isUpcoming:null,I=R.author,C=R.shortViewCount,r=R.publishedTimeText,t=[],Z=[];I&&t.push(I);C&&(t.push(C),Z.push(C));r&&Z.push(r);J={title:R.title,author:I,author_and_views:t.join(" \u2022 "),aria_label:R.ariaLabel|| g.fR("Ver $TITLE",{TITLE:R.title}),duration:u,timestamp:F,url:R.DQ(),is_live:y,is_upcoming:w,is_list:G,is_mix:l,background:J?"background-image: url("+J+")":"",views_and_publish_time:Z.join(" \u2022 "),autoplayAlternativeHeader:R.Yn};R instanceof g.Dc&&(J.playlist_length=R.playlistLength);O.update(J)},ug=function(O){var R=O.T(),J=R.N; g.L.call(this,{Y:"a",G:"ytp-autonav-suggestion-card",C:{href:"{{url}}",target:J?R.W:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},K:[{Y:"div",q1:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],C:{style:"{{background}}"},K:[{Y:"div",C:{"aria-label":"{{timestamp}}"},q1:["ytp-autonav-timestamp"],FQ:"{{duration}}"},{Y:"div",q1:["ytp-autonav-live-stamp"],FQ:"En vivo"}, {Y:"div",q1:["ytp-autonav-upcoming-stamp"],FQ:"Pr\u00f3ximamente"},{Y:"div",G:"ytp-autonav-list-overlay",K:[{Y:"div",G:"ytp-autonav-mix-text",FQ:"Mix"},{Y:"div",G:"ytp-autonav-mix-icon"}]}]},{Y:"div",q1:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],FQ:"{{title}}"},{Y:"div",q1:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],FQ:"{{author}}"},{Y:"div",q1:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],FQ:"{{views_and_publish_time}}"}]});this.X= O;this.suggestion=null;this.L=J;this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress)},FW=function(O,R){R=R===void 0?!1:R; g.L.call(this,{Y:"div",G:"ytp-autonav-endscreen-countdown-overlay"});var J=this;this.J=R;this.cancelCommand=this.j=void 0;this.B=0;this.container=new g.L({Y:"div",G:"ytp-autonav-endscreen-countdown-container"});g.H(this,this.container);this.container.hR(this.element);R=O.T();var l=R.N;this.X=O;this.suggestion=null;this.onVideoDataChange("newdata",g.e(this.X.getVideoData()));this.U(O,"videodatachange",this.onVideoDataChange);this.L=new g.L({Y:"div",G:"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}}"},K:[{Y:"div",G:"ytp-autonav-endscreen-upnext-header"},{Y:"div",G:"ytp-autonav-endscreen-upnext-alternative-header",FQ:"{{autoplayAlternativeHeader}}"},{Y:"a",G:"ytp-autonav-endscreen-link-container",C:{href:"{{url}}",target:l?R.W:""},K:[{Y:"div",G:"ytp-autonav-endscreen-upnext-thumbnail",C:{style:"{{background}}"},K:[{Y:"div",C:{"aria-label":"{{timestamp}}"},q1:["ytp-autonav-timestamp"], FQ:"{{duration}}"},{Y:"div",q1:["ytp-autonav-live-stamp"],FQ:"En vivo"},{Y:"div",q1:["ytp-autonav-upcoming-stamp"],FQ:"Pr\u00f3ximamente"}]},{Y:"div",G:"ytp-autonav-endscreen-video-info",K:[{Y:"div",G:"ytp-autonav-endscreen-premium-badge"},{Y:"div",G:"ytp-autonav-endscreen-upnext-title",FQ:"{{title}}"},{Y:"div",G:"ytp-autonav-endscreen-upnext-author",FQ:"{{author}}"},{Y:"div",G:"ytp-autonav-view-and-date",FQ:"{{views_and_publish_time}}"},{Y:"div",G:"ytp-autonav-author-and-view",FQ:"{{author_and_views}}"}]}]}]}); g.H(this,this.L);this.L.hR(this.container.element);l||this.U(this.L.Bq("ytp-autonav-endscreen-link-container"),"click",this.d3);this.X.createClientVe(this.container.element,this,115127);this.X.createClientVe(this.L.Bq("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.L({Y:"div",G:"ytp-autonav-overlay"});g.H(this,this.overlay);this.overlay.hR(this.container.element);this.S=new g.L({Y:"div",G:"ytp-autonav-endscreen-button-container"});g.H(this,this.S);this.S.hR(this.container.element); this.cancelButton=new g.L({Y:"button",q1:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",R.Z("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],C:{"aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},FQ:"Cancelar"});g.H(this,this.cancelButton);this.cancelButton.hR(this.S.element);this.cancelButton.listen("click",this.e4,this);this.X.createClientVe(this.cancelButton.element,this,115129);this.playButton=new g.L({Y:"a",q1:["ytp-autonav-endscreen-upnext-button", "ytp-autonav-endscreen-upnext-play-button",R.Z("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],C:{href:"{{url}}",role:"button","aria-label":"Reproducir siguiente video"},FQ:"Reproducir ahora"});g.H(this,this.playButton);this.playButton.hR(this.S.element);this.playButton.listen("click",this.d3,this);this.X.createServerVe(this.playButton.element,this.playButton,!0);(R=this.X.getVideoData())&&Td6(this,R);this.N=new g.zR(function(){$3Q(J)},500); g.H(this,this.N);this.Z$();this.U(O,"autonavvisibility",this.Z$);this.X.Z("web_autonav_color_transition")&&(this.U(O,"autonavchange",this.Fs),this.U(O,"onAutonavCoundownStarted",this.JTz))},Gn=function(O){var R=O.X.xV(!0,O.X.isFullscreen()); g.wI(O.container.element,"ytp-autonav-endscreen-small-mode",O.LW(R));g.wI(O.container.element,"ytp-autonav-endscreen-is-premium",!!O.suggestion&&!!O.suggestion.CcQ);g.wI(O.X.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!O.X.h3());g.wI(O.X.getRootNode(),"countdown-running",O.x7());g.wI(O.container.element,"ytp-player-content",O.X.h3());g.pS(O.overlay.element,{width:R.width+"px"});if(!O.x7()){O.X.h3()?MEC(O,Math.round(q16(O)/1E3)):MEC(O);R=!!O.suggestion&&!!O.suggestion.Yn;var J=O.X.h3()|| !R;g.wI(O.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!J&&R);g.wI(O.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",J&&!R);O.S.M9(O.X.h3());g.wI(O.element,"ytp-enable-w2w-color-transitions",kiC(O))}},$3Q=function(O){var R=q16(O),J=Math,l=J.min; var u=O.B?Date.now()-O.B:0;J=l.call(J,u,R);MEC(O,Math.ceil((R-J)/1E3));R-J<=500&&O.x7()?O.select(!0):O.x7()&&O.N.start()},q16=function(O){if(O.X.isFullscreen()){var R; O=(R=O.X.getVideoData())==null?void 0:R.e1;return O===-1||O===void 0?8E3:O}return O.X.AY()>=0?O.X.AY():g.tB(O.X.T().experiments,"autoplay_time")||1E4},Td6=function(O,R){R=R.getWatchNextResponse(); var J,l;R=(J=XqM(R))==null?void 0:(l=J.nextButton)==null?void 0:l.buttonRenderer;O.j=R==null?void 0:R.navigationEndpoint;J=R==null?void 0:R.trackingParams;O.playButton&&J&&O.X.setTrackingParams(O.playButton.element,J)},kiC=function(O){var R; return!((R=O.X.getVideoData())==null||!R.watchToWatchTransitionRenderer)},MEC=function(O,R){R=R===void 0?-1:R; O=O.L.Bq("ytp-autonav-endscreen-upnext-header");g.Jh(O);if(R>=0){R=String(R);var J="A continuaci\u00f3n, en $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],l="A continuaci\u00f3n, en $SECONDS".indexOf(J);if(l>=0){O.appendChild(g.O9("A continuaci\u00f3n, en $SECONDS".slice(0,l)));var u=g.cE("span");g.lI(u,"ytp-autonav-endscreen-upnext-header-countdown-number");g.uu(u,R);O.appendChild(u);O.appendChild(g.O9("A continuaci\u00f3n, en $SECONDS".slice(l+J.length)));return}}g.uu(O,"A continuaci\u00f3n")},KU= function(O,R){g.L.call(this,{Y:"div", q1:["html5-endscreen","ytp-player-content",R||"base-endscreen"]});this.created=!1;this.player=O},yk=function(O){g.L.call(this,{Y:"div", q1:["ytp-upnext","ytp-player-content"],C:{"aria-label":"{{aria_label}}"},K:[{Y:"div",G:"ytp-cued-thumbnail-overlay-image",C:{style:"{{background}}"}},{Y:"span",G:"ytp-upnext-top",K:[{Y:"span",G:"ytp-upnext-header",FQ:"A continuaci\u00f3n"},{Y:"span",G:"ytp-upnext-title",FQ:"{{title}}"},{Y:"span",G:"ytp-upnext-author",FQ:"{{author}}"}]},{Y:"a",G:"ytp-upnext-autoplay-icon",C:{role:"button",href:"{{url}}","aria-label":"Reproducir siguiente video"},K:[{Y:"svg",C:{height:"100%",version:"1.1",viewBox:"0 0 72 72", width:"100%"},K:[{Y:"circle",G:"ytp-svg-autoplay-circle",C:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{Y:"circle",G:"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)"}},{Y:"path",G:"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"}}]}]},{Y:"span",G:"ytp-upnext-bottom",K:[{Y:"span",G:"ytp-upnext-cancel"},{Y:"span",G:"ytp-upnext-paused", FQ:"La reproducci\u00f3n autom\u00e1tica est\u00e1 en pausa"}]}]});this.api=O;this.cancelButton=null;this.j=this.Bq("ytp-svg-autoplay-ring");this.B=this.notification=this.L=this.suggestion=null;this.N=new g.zR(this.HK,5E3,this);this.S=0;var R=this.Bq("ytp-upnext-cancel");this.cancelButton=new g.L({Y:"button",q1:["ytp-upnext-cancel-button","ytp-button"],C:{tabindex:"0","aria-label":"Cancelar reproducci\u00f3n autom\u00e1tica"},FQ:"Cancelar"});g.H(this,this.cancelButton);this.cancelButton.listen("click", this.wx,this);this.cancelButton.hR(R);this.cancelButton&&this.api.createClientVe(this.cancelButton.element,this,115129);g.H(this,this.N);this.api.createClientVe(this.element,this,18788);R=this.Bq("ytp-upnext-autoplay-icon");this.U(R,"click",this.ON);this.api.createClientVe(R,this,115130);this.Jn();this.U(O,"autonavvisibility",this.Jn);this.U(O,"mdxnowautoplaying",this.Nzd);this.U(O,"mdxautoplaycanceled",this.YZg);g.wI(this.element,"ytp-upnext-mobile",this.api.T().S)},sT_=function(O,R){if(R)return R; if(O.api.isFullscreen()){var J;O=(J=O.api.getVideoData())==null?void 0:J.e1;return O===-1||O===void 0?8E3:O}return O.api.AY()>=0?O.api.AY():g.tB(O.api.T().experiments,"autoplay_time")||1E4},bDb=function(O,R){R=sT_(O,R); var J=Math,l=J.min;var u=(0,g.Q)()-O.S;J=l.call(J,u,R);R=R===0?1:Math.min(J/R,1);O.j.setAttribute("stroke-dashoffset",""+-211*(R+1));R>=1&&O.x7()&&O.api.getPresentingPlayerType()!==3?O.select(!0):O.x7()&&O.L.start()},we=function(O){KU.call(this,O,"autonav-endscreen"); this.overlay=this.videoData=null;this.table=new g.L({Y:"div",G:"ytp-suggestion-panel",K:[{Y:"div",q1:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],FQ:"M\u00e1s videos"}]});this.V=new g.L({Y:"div",G:"ytp-suggestions-container"});this.videos=[];this.B=null;this.j=this.J=!1;this.S=new FW(this.player);g.H(this,this.S);this.S.hR(this.element);O.getVideoData().CG?this.L=this.S:(this.L=new yk(O),g.bR(this.player,this.L.element,4),g.H(this,this.L));this.overlay=new g.L({Y:"div", G:"ytp-autonav-overlay-cancelled-state"});g.H(this,this.overlay);this.overlay.hR(this.element);this.N=new g.p8(this);g.H(this,this.N);g.H(this,this.table);this.table.hR(this.element);this.table.show();g.H(this,this.V);this.V.hR(this.table.element);this.hide()},IS=function(O){var R=O.h3(); R!==O.j&&(O.j=R,aK6(O.player),O.j?(O.S!==O.L&&O.S.hide(),O.table.hide()):(O.S!==O.L&&O.S.show(),O.table.show()))},CU=function(O,R){g.L.call(this,{Y:"button", q1:["ytp-watch-on-youtube-button","ytp-button"],FQ:"{{content}}"});this.X=O;this.buttonType=this.buttonType=R;this.o_();this.buttonType===2&&g.F8(this.element,"ytp-continue-watching-button");this.listen("click",this.onClick);this.listen("videodatachange",this.o_);this.M9(!0)},re=function(O,R){KU.call(this,O,"embeds-lite-endscreen"); this.X=O;this.L=R;this.X.createClientVe(this.element,this,156943);this.watchButton=new CU(O,2);g.H(this,this.watchButton);this.watchButton.hR(this.element);this.hide()},tn=function(O){var R=O.T(),J=g.Wd||g.Xd?{style:"will-change: opacity"}:void 0,l=R.N,u=["ytp-modern-videowall-still"]; R.S&&u.push("ytp-videowall-show-text");g.L.call(this,{Y:"a",q1:u,C:{href:"{{url}}",target:l?R.W:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},K:[{Y:"div",G:"ytp-modern-videowall-still-image",C:{style:"{{background}}"},K:[{Y:"span",G:"ytp-modern-videowall-still-info-duration",FQ:"{{duration}}"}]},{Y:"span",G:"ytp-modern-videowall-still-info",C:{"aria-hidden":"true"},K:[{Y:"span",G:"ytp-modern-videowall-still-info-bg",K:[{Y:"span", G:"ytp-modern-videowall-still-info-content",C:J,K:[{Y:"span",G:"ytp-modern-videowall-still-info-title",FQ:"{{title}}"},{Y:"span",G:"ytp-modern-videowall-still-info-author",FQ:"{{author_and_views}}"},{Y:"span",G:"ytp-modern-videowall-still-info-live",FQ:"En vivo"}]}]}]},{Y:"span",q1:["ytp-modern-videowall-still-listlabel-regular","ytp-modern-videowall-still-listlabel"],C:{"aria-hidden":"true"},K:[{Y:"span",G:"ytp-modern-videowall-still-listlabel-icon"},"Playlist",{Y:"span",G:"ytp-modern-videowall-still-listlabel-length", K:[" (",{Y:"span",FQ:"{{playlist_length}}"},")"]}]},{Y:"span",q1:["ytp-modern-videowall-still-listlabel-mix","ytp-modern-videowall-still-listlabel"],C:{"aria-hidden":"true"},K:[{Y:"span",G:"ytp-modern-videowall-still-listlabel-mix-icon"},"Mix",{Y:"span",G:"ytp-modern-videowall-still-listlabel-length",FQ:" (50+)"}]}]});this.suggestion=null;this.S=l;this.api=O;this.L=new g.p8(this);g.H(this,this.L);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.L.U(O,"videodatachange", this.onVideoDataChange);O.createServerVe(this.element,this);this.onVideoDataChange()},Wxk=function(O){KU.call(this,O,"videowall-endscreen"); var R=this;this.X=O;this.stills=[];this.B=this.videoData=null;this.N=this.J=!1;this.V=null;g.F8(this.element,"modern-videowall-endscreen");this.S=new g.p8(this);g.H(this,this.S);this.j=new g.zR(function(){g.F8(R.element,"ytp-show-tiles")},0); g.H(this,this.j);this.table=new g.Ih({Y:"div",G:"ytp-modern-endscreen-content"});g.H(this,this.table);this.table.hR(this.element);O.getVideoData().CG?this.L=new FW(O,!0):this.L=new yk(O);g.H(this,this.L);g.bR(this.player,this.L.element,4);O.createClientVe(this.element,this,158789);this.hide()},oS=function(O){return g.WD(O.player)&&O.IG()&&!O.B},ZB=function(O){var R=O.h3(); R!==O.J&&(O.J=R,aK6(O.player))},AiC=function(O){KU.call(this,O,"subscribecard-endscreen"); this.L=new g.L({Y:"div",G:"ytp-subscribe-card",K:[{Y:"img",G:"ytp-author-image",C:{src:"{{profilePicture}}"}},{Y:"div",G:"ytp-subscribe-card-right",K:[{Y:"div",G:"ytp-author-name",FQ:"{{author}}"},{Y:"div",G:"html5-subscribe-button-container"}]}]});g.H(this,this.L);this.L.hR(this.element);var R=O.getVideoData();this.subscribeButton=new g.d5("Suscribirse",null,"Anular suscripci\u00f3n",null,!0,!1,R.oU,R.subscribed,"trailer-endscreen",null,O,!1);g.H(this,this.subscribeButton);this.subscribeButton.hR(this.L.Bq("html5-subscribe-button-container")); this.U(O,"videodatachange",this.au);this.au();this.hide()},Vk=function(O){var R=O.T(),J=g.Wd||g.Xd?{style:"will-change: opacity"}:void 0,l=R.N,u=["ytp-videowall-still"]; R.S&&u.push("ytp-videowall-show-text");g.L.call(this,{Y:"a",q1:u,C:{href:"{{url}}",target:l?R.W:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},K:[{Y:"div",G:"ytp-videowall-still-image",C:{style:"{{background}}"}},{Y:"span",G:"ytp-videowall-still-info",C:{"aria-hidden":"true"},K:[{Y:"span",G:"ytp-videowall-still-info-bg",K:[{Y:"span",G:"ytp-videowall-still-info-content",C:J,K:[{Y:"span",G:"ytp-videowall-still-info-title",FQ:"{{title}}"}, {Y:"span",G:"ytp-videowall-still-info-author",FQ:"{{author_and_views}}"},{Y:"span",G:"ytp-videowall-still-info-live",FQ:"En vivo"},{Y:"span",G:"ytp-videowall-still-info-duration",FQ:"{{duration}}"}]}]}]},{Y:"span",q1:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],C:{"aria-hidden":"true"},K:[{Y:"span",G:"ytp-videowall-still-listlabel-icon"},"Playlist",{Y:"span",G:"ytp-videowall-still-listlabel-length",K:[" (",{Y:"span",FQ:"{{playlist_length}}"},")"]}]},{Y:"span",q1:["ytp-videowall-still-listlabel-mix", "ytp-videowall-still-listlabel"],C:{"aria-hidden":"true"},K:[{Y:"span",G:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{Y:"span",G:"ytp-videowall-still-listlabel-length",FQ:" (50+)"}]}]});this.suggestion=null;this.S=l;this.api=O;this.L=new g.p8(this);g.H(this,this.L);this.listen("click",this.onClick);this.listen("keypress",this.onKeyPress);this.L.U(O,"videodatachange",this.onVideoDataChange);O.createServerVe(this.element,this);this.onVideoDataChange()},fU=function(O){KU.call(this,O,"videowall-endscreen"); var R=this;this.X=O;this.B=0;this.stills=[];this.N=this.videoData=null;this.j=this.V=!1;this.W=null;this.S=new g.p8(this);g.H(this,this.S);this.J=new g.zR(function(){g.F8(R.element,"ytp-show-tiles")},0); g.H(this,this.J);var J=new g.L({Y:"button",q1:["ytp-button","ytp-endscreen-previous"],C:{"aria-label":"Anterior"},K:[g.NI()]});g.H(this,J);J.hR(this.element);J.listen("click",this.pO,this);this.table=new g.Ih({Y:"div",G:"ytp-endscreen-content"});g.H(this,this.table);this.table.hR(this.element);J=new g.L({Y:"button",q1:["ytp-button","ytp-endscreen-next"],C:{"aria-label":"Siguiente"},K:[g.my()]});g.H(this,J);J.hR(this.element);J.listen("click",this.hg,this);O.getVideoData().CG?this.L=new FW(O,!0):this.L= new yk(O);g.H(this,this.L);g.bR(this.player,this.L.element,4);O.createClientVe(this.element,this,158789);this.hide()},SG=function(O){return g.WD(O.player)&&O.IG()&&!O.N},No=function(O){var R=O.h3(); R!==O.V&&(O.V=R,aK6(O.player))},m_=function(O){KU.call(this,O,"watch-again-on-youtube-endscreen"); this.watchButton=new CU(O,1);g.H(this,this.watchButton);this.watchButton.hR(this.element);g.WH4(O)&&(this.L=new g.cj(O),g.H(this,this.L),this.S=new g.L({Y:"div",q1:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],C:{tabIndex:"-1"},K:[this.L]}),g.H(this,this.S),this.L.hR(this.S.element),this.S.hR(this.element));O.createClientVe(this.element,this,156914);this.hide()},Bdt=function(O){g.tN.call(this,O); var R=this;this.endScreen=null;this.S=this.L=this.B=this.N=!1;this.listeners=new g.p8(this);g.H(this,this.listeners);var J=O.T(),l=O.getVideoData();l=l&&l.limitedPlaybackDurationInSeconds!==0;g.wZ(g.Pv(J))&&l&&!g.MB(O)?(this.S=!0,this.endScreen=new re(O,g.oI(O))):O.isEmbedsShortsMode()?this.endScreen=new m_(O):eKI(O)?(this.N=!0,PFk(this),this.L?this.endScreen=new we(O):J.Z("delhi_modern_endscreen")?this.endScreen=new Wxk(O):this.endScreen=new fU(O)):J.lc?this.endScreen=new AiC(O):this.endScreen=new KU(O); g.H(this,this.endScreen);g.bR(O,this.endScreen.element,4);pqt(this);this.listeners.U(O,"videodatachange",this.onVideoDataChange,this);this.listeners.U(O,g.Gh("endscreen"),function(u){R.onCueRangeEnter(u)}); this.listeners.U(O,g.KR("endscreen"),function(u){R.onCueRangeExit(u)})},PFk=function(O){var R=O.player.getVideoData(); if(!R||O.L===R.RU&&O.B===R.CG)return!1;O.L=R.RU;O.B=R.CG;return!0},eKI=function(O){O=O.T(); return O.Y9&&!O.lc&&!O.disableOrganicUi},pqt=function(O){O.player.XK("endscreen"); var R=O.player.getVideoData();R=new g.uN(Math.max((R.lengthSeconds-10)*1E3,0),0x8000000000000,{id:"preload",namespace:"endscreen"});var J=new g.uN(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});O.player.zy([R,J])}; g.vD.prototype.AY=g.u2(14,function(){return this.app.AY()}); g.Vq.prototype.AY=g.u2(13,function(){return this.getVideoData().IK}); g.mk.prototype.tP=g.u2(12,function(O){this.dK().tP(O)}); g.yw.prototype.tP=g.u2(11,function(O){this.L!==O&&(this.L=O,this.au())}); g.T2.prototype.tP=g.u2(10,function(O){this.overflowButton&&this.overflowButton.tP(O)}); g.mk.prototype.Cd=g.u2(9,function(O){this.dK().Cd(O)}); g.oO.prototype.Cd=g.u2(8,function(O){this.S!==O&&(this.S=O,this.au())}); g.T2.prototype.Cd=g.u2(7,function(O){this.shareButton&&this.shareButton.Cd(O)}); g.mk.prototype.NE=g.u2(6,function(O){this.dK().NE(O)}); g.Hr.prototype.NE=g.u2(5,function(O){this.s4!==O&&(this.s4=O,this.qb())}); g.mk.prototype.pR=g.u2(4,function(O){this.dK().pR(O)}); g.T2.prototype.pR=g.u2(3,function(O){this.c$!==O&&(this.c$=O,this.pS())});g.S(ug,g.L);ug.prototype.select=function(){this.X.HM(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.gr||void 0)&&this.X.logClick(this.element)}; ug.prototype.onClick=function(O){g.uY(O,this.X,this.L,this.suggestion.sessionData||void 0)&&this.select()}; ug.prototype.onKeyPress=function(O){switch(O.keyCode){case 13:case 32:O.defaultPrevented||(this.select(),O.preventDefault())}};g.S(FW,g.L);g.f=FW.prototype;g.f.Nh=function(O){this.suggestion!==O&&(this.suggestion=O,lg(this.L,O),this.playButton.updateValue("url",this.suggestion.DQ()),Gn(this))}; g.f.x7=function(){return this.B>0}; g.f.Xk=function(){this.x7()||(this.B=Date.now(),$3Q(this),vlC(this.X,q16(this)),g.wI(this.X.getRootNode(),"countdown-running",this.x7()))}; g.f.zg=function(){this.XJ();$3Q(this);var O=this.L.Bq("ytp-autonav-endscreen-upnext-header");O&&g.uu(O,"A continuaci\u00f3n")}; g.f.XJ=function(){this.x7()&&(this.N.stop(),this.B=0)}; g.f.select=function(O){this.X.nextVideo(!1,O===void 0?!1:O);this.XJ()}; g.f.d3=function(O){g.uY(O,this.X)&&(O.currentTarget===this.playButton.element?this.X.logClick(this.playButton.element):O.currentTarget===this.L.Bq("ytp-autonav-endscreen-link-container")&&(O=this.L.Bq("ytp-autonav-endscreen-link-container"),this.X.logVisibility(O,!0),this.X.logClick(O)),this.j?(this.X.tR("innertubeCommand",this.j),this.XJ()):this.select())}; g.f.e4=function(){this.X.logClick(this.cancelButton.element);g.Te(this.X,!0);this.cancelCommand&&this.X.tR("innertubeCommand",this.cancelCommand)}; g.f.onVideoDataChange=function(O,R){Td6(this,R);O=R.getWatchNextResponse();var J,l;O=(J=XqM(O))==null?void 0:(l=J.cancelButton)==null?void 0:l.buttonRenderer;this.cancelCommand=O==null?void 0:O.command}; g.f.JTz=function(O){if(kiC(this)){var R=this.X.getVideoData().watchToWatchTransitionRenderer,J=R==null?void 0:R.fromColorPaletteDark;R=R==null?void 0:R.toColorPaletteDark;if(J&&R){var l=this.element;l.style.setProperty("--w2w-start-background-color",g.HI(J.surgeColor));l.style.setProperty("--w2w-start-primary-text-color",g.HI(J.primaryTitleColor));l.style.setProperty("--w2w-start-secondary-text-color",g.HI(J.secondaryTitleColor));l.style.setProperty("--w2w-end-background-color",g.HI(R.surgeColor)); l.style.setProperty("--w2w-end-primary-text-color",g.HI(R.primaryTitleColor));l.style.setProperty("--w2w-end-secondary-text-color",g.HI(R.secondaryTitleColor));l.style.setProperty("--w2w-animation-duration",O+"ms")}g.wI(this.element,"ytp-w2w-animate",!0)}}; g.f.Fs=function(O){this.X.Z("web_autonav_color_transition")&&O!==2&&g.wI(this.element,"ytp-w2w-animate",!1)}; g.f.Z$=function(){var O=this.X.h3();this.J&&this.ou!==O&&this.M9(O);Gn(this);this.X.logVisibility(this.container.element,O);this.X.logVisibility(this.cancelButton.element,O);this.X.logVisibility(this.L.Bq("ytp-autonav-endscreen-link-container"),O);this.X.logVisibility(this.playButton.element,O)}; g.f.LW=function(O){return O.width<400||O.height<459};g.S(KU,g.L);g.f=KU.prototype;g.f.create=function(){this.created=!0}; g.f.destroy=function(){this.created=!1}; g.f.IG=function(){return!1}; g.f.h3=function(){return!1}; g.f.Xc=function(){return!1};g.S(yk,g.L);g.f=yk.prototype;g.f.HK=function(){this.notification&&(this.N.stop(),this.uK(this.B),this.B=null,this.notification.close(),this.notification=null)}; g.f.Nh=function(O){this.suggestion=O;lg(this,O,"hqdefault.jpg")}; g.f.Jn=function(){this.M9(this.api.h3());this.api.logVisibility(this.element,this.api.h3());this.api.logVisibility(this.Bq("ytp-upnext-autoplay-icon"),this.api.h3());this.cancelButton&&this.api.logVisibility(this.cancelButton.element,this.api.h3())}; g.f.yoJ=function(){window.focus();this.HK()}; g.f.Xk=function(O){var R=this;this.x7()||(g.GT("a11y-announce","A continuaci\u00f3n "+this.suggestion.title),this.S=(0,g.Q)(),this.L=new g.zR(function(){bDb(R,O)},25),bDb(this,O),vlC(this.api,sT_(this,O))); g.KM(this.element,"ytp-upnext-autoplay-paused")}; g.f.hide=function(){g.L.prototype.hide.call(this)}; g.f.x7=function(){return!!this.L}; g.f.zg=function(){this.XJ();this.S=(0,g.Q)();bDb(this);g.F8(this.element,"ytp-upnext-autoplay-paused")}; g.f.XJ=function(){this.x7()&&(this.L.dispose(),this.L=null)}; g.f.select=function(O){O=O===void 0?!1:O;if(this.api.T().Z("autonav_notifications")&&O&&window.Notification&&typeof document.hasFocus==="function"){var R=Notification.permission;R==="default"?Notification.requestPermission():R!=="granted"||document.hasFocus()||(this.HK(),this.notification=new Notification("A continuaci\u00f3n",{body:this.suggestion.title,icon:this.suggestion.h1()}),this.B=this.U(this.notification,"click",this.yoJ),this.N.start())}this.XJ();this.api.nextVideo(!1,O)}; g.f.ON=function(O){!g.lu(this.cancelButton.element,O.target)&&g.uY(O,this.api)&&(this.api.h3()&&this.api.logClick(this.Bq("ytp-upnext-autoplay-icon")),this.select())}; g.f.wx=function(){this.api.h3()&&this.cancelButton&&this.api.logClick(this.cancelButton.element);g.Te(this.api,!0)}; g.f.Nzd=function(O){this.api.getPresentingPlayerType();this.show();this.Xk(O)}; g.f.YZg=function(){this.api.getPresentingPlayerType();this.XJ();this.hide()}; g.f.eN=function(){this.XJ();this.HK();g.L.prototype.eN.call(this)};g.S(we,KU);g.f=we.prototype;g.f.create=function(){KU.prototype.create.call(this);this.N.U(this.player,"appresize",this.pI);this.N.U(this.player,"onVideoAreaChange",this.pI);this.N.U(this.player,"videodatachange",this.onVideoDataChange);this.N.U(this.player,"autonavchange",this.aZ);this.N.U(this.player,"onAutonavCancelled",this.bG);this.onVideoDataChange()}; g.f.show=function(){KU.prototype.show.call(this);(this.J||this.B&&this.B!==this.videoData.clientPlaybackNonce)&&g.Te(this.player,!1);g.WD(this.player)&&this.IG()&&!this.B?(IS(this),this.videoData.autonavState===2?this.player.getVisibilityState()===3?this.L.select(!0):this.L.Xk():this.videoData.autonavState===3&&this.L.zg()):(g.Te(this.player,!0),IS(this));this.pI()}; g.f.hide=function(){KU.prototype.hide.call(this);this.L.zg();IS(this)}; g.f.pI=function(){var O=this.player.xV(!0,this.player.isFullscreen());IS(this);Gn(this.S);g.wI(this.element,"ytp-autonav-cancelled-small-mode",this.LW(O));g.wI(this.element,"ytp-autonav-cancelled-tiny-mode",this.l1(O));g.wI(this.element,"ytp-autonav-cancelled-mini-mode",O.width<=400||O.height<=360);this.overlay&&g.pS(this.overlay.element,{width:O.width+"px"});if(!this.j)for(O=0;O0&&(O= r*4,Z=R<=w-2&&I>=C*4;if((C+1)/r*l/G>G/(C/(r+1)*l)&&Z)I-=C*4,R+=2;else if(t)I-=r*4,O+=2;else if(Z)I-=C*4,R+=2;else break}l=!1;I>=12&&J*4-I<=6&&(R>=4||O>=4)&&(l=!0);I=O*96;y=R*54;G=I/y=O-2&&C>=R-2?Z=1:C%2===0&&w%2===0&&(C<2&&w<2?C===0&&w===0&&(Z=2):Z=2),r=g.$C(r+this.B,J),Z!==0){t=this.stills[G];t||(t=new Vk(this.player),this.stills[G]=t,F.appendChild(t.element));var V=Math.floor(y*C/R),m=Math.floor(I*w/O),E=Math.floor(y*(C+Z)/R)-V-4,a=Math.floor(I*(w+Z)/O)-m-4;g.QH(t.element,m,V);g.hH(t.element,a,E);g.pS(t.element,"transitionDelay",(C+w)/20+"s");g.wI(t.element,"ytp-videowall-still-mini", Z===1);g.wI(t.element,"ytp-videowall-still-large",Z>2);Z=Math.max(a,E);g.wI(t.element,"ytp-videowall-still-round-large",Z>=256);g.wI(t.element,"ytp-videowall-still-round-medium",Z>96&&Z<256);g.wI(t.element,"ytp-videowall-still-round-small",Z<=96);r=u[r];t.suggestion!==r&&(t.suggestion=r,Z=t.api.T(),V=g.uI(t.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",lg(t,r,V),g.$X(Z)&&!t.api.Z("web_player_log_click_before_generating_ve_conversion_params")&&(Z=r.DQ(),V={},g.wL(t.api,"addEmbedsConversionTrackingParams", [V]),Z=g.s9(Z,V),t.updateValue("url",Z)),(r=(r=r.sessionData)&&r.itct)&&t.api.setTrackingParams(t.element,r));G++}F.ariaBusy="false";g.wI(this.element,"ytp-endscreen-paginate",G=G;u--)O=this.stills[u],g.iu(O.element),g.rd(O);this.stills.length=G}}; g.f.onVideoDataChange=function(){var O=this.player.getVideoData(1);this.videoData!==O&&(O!=null&&g.OI(O)?(this.B=0,this.videoData=O,this.a7()):this.player.nJ("missg",{vid:(O==null?void 0:O.videoId)||"",cpn:(O==null?void 0:O.clientPlaybackNonce)||""}))}; g.f.hg=function(){this.B+=this.stills.length;this.a7()}; g.f.pO=function(){this.B-=this.stills.length;this.a7()}; g.f.Xc=function(){return this.L.x7()}; g.f.il=function(O){O===1?(this.j=!1,this.N=this.videoData.clientPlaybackNonce,this.L.XJ(),this.ou&&this.a7()):(this.j=!0,this.ou&&SG(this)&&(O===2?this.L.Xk():O===3&&this.L.zg()))}; g.f.iG=function(O){if(O){for(O=0;O0||O.endSeconds>0||O.mutedAutoplayDurationMode!==2);if((this.player.isEmbedsShortsMode()||this.S)&&!R)return!0;var J;var l=!!((O==null?0:g.OI(O))||(O==null?0:(J=O.suggestions)==null?0:J.length));l=!eKI(this.player)||l;O=O.Wn;J=this.player.BO();return l&&!O&&!J&&!R}; g.f.h3=function(){return this.endScreen.h3()}; g.f.qQh=function(){return this.h3()?this.endScreen.Xc():!1}; g.f.eN=function(){this.player.XK("endscreen");g.tN.prototype.eN.call(this)}; g.f.load=function(){var O=this.player.getVideoData();var R=O.transitionEndpointAtEndOfStream;if(R&&R.videoId){var J=this.player.eG().tp.get("heartbeat"),l=g.OI(O);!l||R.videoId!==l.videoId||O.yf?(this.player.HM(R.videoId,void 0,void 0,!0,!0,R),J&&J.nj("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),O=!0):O=!1}else O=!1;O||(g.tN.prototype.load.call(this),this.endScreen.show())}; g.f.unload=function(){g.tN.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()}; g.f.onCueRangeEnter=function(O){this.ph()&&(this.endScreen.created||this.endScreen.create(),O.getId()==="load"&&this.load())}; g.f.onCueRangeExit=function(O){O.getId()==="load"&&this.loaded&&this.unload()}; g.f.onVideoDataChange=function(){pqt(this);this.N&&PFk(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.L?this.endScreen=new we(this.player):this.endScreen=new fU(this.player),g.H(this,this.endScreen),g.bR(this.player,this.endScreen.element,4))};g.r5("endscreen",Bdt);})(_yt_player);