LibreSatCam/docs/Embedded Engineering Making.../dwXs9RB6uD0_data/endscreen.js

138 lines
32 KiB
JavaScript

(function(g){var window=this;'use strict';var xab=function(a,b){a.Oa("onAutonavCoundownStarted",b)},k6=function(a,b,c){g.uo(a.element,"ytp-suggestion-set",!!b.videoId);
var d=b.playlistId;c=b.Mf(c?c:"mqdefault.jpg");var e=null,f=null;b instanceof g.IH&&(b.lengthText?(e=b.lengthText||null,f=b.Nt||null):b.lengthSeconds&&(e=g.eN(b.lengthSeconds),f=g.eN(b.lengthSeconds,!0)));var h=!!d;d=h&&"RD"===g.GH(d).type;var l=b instanceof g.IH?b.isLivePlayback:null,m=b instanceof g.IH?b.isUpcoming:null,n=b.author,p=b.shortViewCount,q=b.publishedTimeText,r=[],w=[];n&&r.push(n);p&&(r.push(p),w.push(p));q&&w.push(q);c={title:b.title,author:n,author_and_views:r.join(" \u2022 "),aria_label:b.ariaLabel||
g.CK("Watch $TITLE",{TITLE:b.title}),duration:e,timestamp:f,url:b.zn(),is_live:l,is_upcoming:m,is_list:h,is_mix:d,background:c?"background-image: url("+c+")":"",views_and_publish_time:w.join(" \u2022 "),autoplayAlternativeHeader:b.fq};b instanceof g.HH&&(c.playlist_length=b.playlistLength);a.update(c)},l6=function(a){var b=a.V(),c=b.u;
g.W.call(this,{F:"a",K:"ytp-autonav-suggestion-card",X:{href:"{{url}}",target:c?b.T:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},W:[{F:"div",Ga:["ytp-autonav-endscreen-upnext-thumbnail","ytp-autonav-thumbnail-small"],X:{style:"{{background}}"},W:[{F:"div",X:{"aria-label":"{{timestamp}}"},Ga:["ytp-autonav-timestamp"],qa:"{{duration}}"},{F:"div",Ga:["ytp-autonav-live-stamp"],qa:"Live"},{F:"div",
Ga:["ytp-autonav-upcoming-stamp"],qa:"Upcoming"},{F:"div",K:"ytp-autonav-list-overlay",W:[{F:"div",K:"ytp-autonav-mix-text",qa:"Mix"},{F:"div",K:"ytp-autonav-mix-icon"}]}]},{F:"div",Ga:["ytp-autonav-endscreen-upnext-title","ytp-autonav-title-card"],qa:"{{title}}"},{F:"div",Ga:["ytp-autonav-endscreen-upnext-author","ytp-autonav-author-card"],qa:"{{author}}"},{F:"div",Ga:["ytp-autonav-endscreen-upnext-author","ytp-autonav-view-and-date-card"],qa:"{{views_and_publish_time}}"}]});this.G=a;this.suggestion=
null;this.j=c;this.Qa("click",this.onClick);this.Qa("keypress",this.onKeyPress)},m6=function(a,b){b=void 0===b?!1:b;
g.W.call(this,{F:"div",K:"ytp-autonav-endscreen-countdown-overlay"});var c=this;this.I=b;this.D=void 0;this.B=0;this.container=new g.W({F:"div",K:"ytp-autonav-endscreen-countdown-container"});g.H(this,this.container);this.container.Ca(this.element);b=a.V();var d=b.u;this.G=a;this.suggestion=null;this.onVideoDataChange("newdata",this.G.getVideoData());this.N(a,"videodatachange",this.onVideoDataChange);var e=["ytp-autonav-endscreen-upnext-thumbnail"];b.S("web_rounded_thumbnails")&&e.push("rounded-thumbnail");
this.j=new g.W({F:"div",K:"ytp-autonav-endscreen-upnext-container",X:{"aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}","data-is-upcoming":"{{is_upcoming}}"},W:[{F:"div",K:"ytp-autonav-endscreen-upnext-header"},{F:"div",K:"ytp-autonav-endscreen-upnext-alternative-header",qa:"{{autoplayAlternativeHeader}}"},{F:"a",K:"ytp-autonav-endscreen-link-container",X:{href:"{{url}}",target:d?b.T:""},W:[{F:"div",Ga:e,X:{style:"{{background}}"},W:[{F:"div",
X:{"aria-label":"{{timestamp}}"},Ga:["ytp-autonav-timestamp"],qa:"{{duration}}"},{F:"div",Ga:["ytp-autonav-live-stamp"],qa:"Live"},{F:"div",Ga:["ytp-autonav-upcoming-stamp"],qa:"Upcoming"}]},{F:"div",K:"ytp-autonav-endscreen-video-info",W:[{F:"div",K:"ytp-autonav-endscreen-premium-badge"},{F:"div",K:"ytp-autonav-endscreen-upnext-title",qa:"{{title}}"},{F:"div",K:"ytp-autonav-endscreen-upnext-author",qa:"{{author}}"},{F:"div",K:"ytp-autonav-view-and-date",qa:"{{views_and_publish_time}}"},{F:"div",
K:"ytp-autonav-author-and-view",qa:"{{author_and_views}}"}]}]}]});g.H(this,this.j);this.j.Ca(this.container.element);d||this.N(this.j.Ea("ytp-autonav-endscreen-link-container"),"click",this.IN);this.G.qb(this.container.element,this,115127);this.G.qb(this.j.Ea("ytp-autonav-endscreen-link-container"),this,115128);this.overlay=new g.W({F:"div",K:"ytp-autonav-overlay"});g.H(this,this.overlay);this.overlay.Ca(this.container.element);this.u=new g.W({F:"div",K:"ytp-autonav-endscreen-button-container"});
g.H(this,this.u);this.u.Ca(this.container.element);this.cancelButton=new g.W({F:"button",Ga:["ytp-autonav-endscreen-upnext-button","ytp-autonav-endscreen-upnext-cancel-button",b.S("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{"aria-label":"Cancel autoplay"},qa:"Cancel"});g.H(this,this.cancelButton);this.cancelButton.Ca(this.u.element);this.cancelButton.Qa("click",this.eW,this);this.G.qb(this.cancelButton.element,this,115129);this.playButton=new g.W({F:"a",Ga:["ytp-autonav-endscreen-upnext-button",
"ytp-autonav-endscreen-upnext-play-button",b.S("web_modern_buttons")?"ytp-autonav-endscreen-upnext-button-rounded":""],X:{href:"{{url}}",role:"button","aria-label":"Play next video"},qa:"Play Now"});g.H(this,this.playButton);this.playButton.Ca(this.u.element);this.playButton.Qa("click",this.IN,this);this.G.qb(this.playButton.element,this,115130);this.C=new g.io(function(){yab(c)},500);
g.H(this,this.C);this.HN();this.N(a,"autonavvisibility",this.HN);this.G.S("web_autonav_color_transition")&&(this.N(a,"autonavchange",this.dW),this.N(a,"onAutonavCoundownStarted",this.g1))},n6=function(a){var b=a.G.Hj(!0,a.G.isFullscreen());
g.uo(a.container.element,"ytp-autonav-endscreen-small-mode",a.Ig(b));g.uo(a.container.element,"ytp-autonav-endscreen-is-premium",!!a.suggestion&&!!a.suggestion.IF);g.uo(a.G.getRootNode(),"ytp-autonav-endscreen-cancelled-state",!a.G.wf());g.uo(a.G.getRootNode(),"countdown-running",a.Mj());g.uo(a.container.element,"ytp-player-content",a.G.wf());g.Kl(a.overlay.element,{width:b.width+"px"});if(!a.Mj()){a.G.wf()?zab(a,Math.round(Aab(a)/1E3)):zab(a);b=!!a.suggestion&&!!a.suggestion.fq;var c=a.G.wf()||!b;
g.uo(a.container.element,"ytp-autonav-endscreen-upnext-alternative-header-only",!c&&b);g.uo(a.container.element,"ytp-autonav-endscreen-upnext-no-alternative-header",c&&!b);g.dM(a.u,a.G.wf());g.uo(a.element,"ytp-enable-w2w-color-transitions",Bab(a))}},yab=function(a){var b=Aab(a),c=Math,d=c.min;
var e=a.B?Date.now()-a.B:0;c=d.call(c,e,b);zab(a,Math.ceil((b-c)/1E3));500>=b-c&&a.Mj()?a.select(!0):a.Mj()&&a.C.start()},Aab=function(a){if(a.G.isFullscreen()){var b;
a=null==(b=a.G.getVideoData())?void 0:b.kN;return-1===a||void 0===a?8E3:a}return 0<=a.G.Cq()?a.G.Cq():g.IF(a.G.V().experiments,"autoplay_time")||1E4},Bab=function(a){var b;
return!(null==(b=a.G.getVideoData())||!b.watchToWatchTransitionRenderer)},zab=function(a,b){b=void 0===b?-1:b;
a=a.j.Ea("ytp-autonav-endscreen-upnext-header");g.Xe(a);if(0<=b){b=String(b);var c="Up next in $SECONDS".match(RegExp("\\$SECONDS","gi"))[0],d="Up next in $SECONDS".indexOf(c);if(0<=d){a.appendChild(g.We("Up next in $SECONDS".slice(0,d)));var e=g.Ve("span");g.oo(e,"ytp-autonav-endscreen-upnext-header-countdown-number");g.df(e,b);a.appendChild(e);a.appendChild(g.We("Up next in $SECONDS".slice(d+c.length)));return}}g.df(a,"Up next")},o6=function(a,b){g.W.call(this,{F:"div",
Ga:["html5-endscreen","ytp-player-content",b||"base-endscreen"]});this.created=!1;this.player=a},p6=function(a){g.W.call(this,{F:"div",
Ga:["ytp-upnext","ytp-player-content"],X:{"aria-label":"{{aria_label}}"},W:[{F:"div",K:"ytp-cued-thumbnail-overlay-image",X:{style:"{{background}}"}},{F:"span",K:"ytp-upnext-top",W:[{F:"span",K:"ytp-upnext-header",qa:"Up Next"},{F:"span",K:"ytp-upnext-title",qa:"{{title}}"},{F:"span",K:"ytp-upnext-author",qa:"{{author}}"}]},{F:"a",K:"ytp-upnext-autoplay-icon",X:{role:"button",href:"{{url}}","aria-label":"Play next video"},W:[{F:"svg",X:{height:"100%",version:"1.1",viewBox:"0 0 72 72",width:"100%"},
W:[{F:"circle",K:"ytp-svg-autoplay-circle",X:{cx:"36",cy:"36",fill:"#fff","fill-opacity":"0.3",r:"31.5"}},{F:"circle",K:"ytp-svg-autoplay-ring",X:{cx:"-36",cy:"36","fill-opacity":"0",r:"33.5",stroke:"#FFFFFF","stroke-dasharray":"211","stroke-dashoffset":"-211","stroke-width":"4",transform:"rotate(-90)"}},{F:"path",K:"ytp-svg-fill",X:{d:"M 24,48 41,36 24,24 V 48 z M 44,24 v 24 h 4 V 24 h -4 z"}}]}]},{F:"span",K:"ytp-upnext-bottom",W:[{F:"span",K:"ytp-upnext-cancel"},{F:"span",K:"ytp-upnext-paused",
qa:"Autoplay is paused"}]}]});this.api=a;this.cancelButton=null;this.D=this.Ea("ytp-svg-autoplay-ring");this.B=this.notification=this.j=this.suggestion=null;this.C=new g.io(this.WC,5E3,this);this.u=0;var b=this.Ea("ytp-upnext-cancel");this.cancelButton=new g.W({F:"button",Ga:["ytp-upnext-cancel-button","ytp-button"],X:{tabindex:"0","aria-label":"Cancel autoplay"},qa:"Cancel"});g.H(this,this.cancelButton);this.cancelButton.Qa("click",this.fW,this);this.cancelButton.Ca(b);this.cancelButton&&this.api.qb(this.cancelButton.element,
this,115129);g.H(this,this.C);this.api.qb(this.element,this,18788);b=this.Ea("ytp-upnext-autoplay-icon");this.N(b,"click",this.gW);this.api.qb(b,this,115130);this.JN();this.N(a,"autonavvisibility",this.JN);this.N(a,"mdxnowautoplaying",this.V1);this.N(a,"mdxautoplaycanceled",this.W1);g.uo(this.element,"ytp-upnext-mobile",this.api.V().isMobile)},Cab=function(a,b){if(b)return b;
if(a.api.isFullscreen()){var c;a=null==(c=a.api.getVideoData())?void 0:c.kN;return-1===a||void 0===a?8E3:a}return 0<=a.api.Cq()?a.api.Cq():g.IF(a.api.V().experiments,"autoplay_time")||1E4},Dab=function(a,b){b=Cab(a,b);
var c=Math,d=c.min;var e=(0,g.R)()-a.u;c=d.call(c,e,b);b=0===b?1:Math.min(c/b,1);a.D.setAttribute("stroke-dashoffset",""+-211*(b+1));1<=b&&a.Mj()&&3!==a.api.getPresentingPlayerType()?a.select(!0):a.Mj()&&a.j.start()},q6=function(a){o6.call(this,a,"autonav-endscreen");
this.overlay=this.videoData=null;this.table=new g.W({F:"div",K:"ytp-suggestion-panel",W:[{F:"div",Ga:["ytp-autonav-endscreen-upnext-header","ytp-autonav-endscreen-more-videos"],qa:"More videos"}]});this.J=new g.W({F:"div",K:"ytp-suggestions-container"});this.videos=[];this.B=null;this.D=this.I=!1;this.u=new m6(this.player);g.H(this,this.u);this.u.Ca(this.element);a.getVideoData().cf?this.j=this.u:(this.j=new p6(a),g.oP(this.player,this.j.element,4),g.H(this,this.j));this.overlay=new g.W({F:"div",
K:"ytp-autonav-overlay-cancelled-state"});g.H(this,this.overlay);this.overlay.Ca(this.element);this.C=new g.yE(this);g.H(this,this.C);g.H(this,this.table);this.table.Ca(this.element);this.table.show();g.H(this,this.J);this.J.Ca(this.table.element);this.hide()},r6=function(a){var b=a.wf();
b!==a.D&&(a.D=b,a.player.ma("autonavvisibility"),a.D?(a.u!==a.j&&a.u.hide(),a.table.hide()):(a.u!==a.j&&a.u.show(),a.table.show()))},s6=function(a,b){g.W.call(this,{F:"button",
Ga:["ytp-watch-on-youtube-button","ytp-button"],qa:"{{content}}"});this.G=a;this.buttonType=this.buttonType=b;switch(this.buttonType){case 1:a="Watch again on YouTube";b=156915;break;case 2:a="Continue watching on YouTube";b=156942;g.qo(this.element,"ytp-continue-watching-button");break;default:a="Continue watching on YouTube",b=156942}this.update({content:a});this.G.qb(this.element,this,b);this.Qa("click",this.onClick);g.dM(this,!0)},t6=function(a,b){o6.call(this,a,"embeds-lite-endscreen");
this.G=a;this.j=b;this.G.qb(this.element,this,156943);this.watchButton=new s6(a,2);g.H(this,this.watchButton);this.watchButton.Ca(this.element);this.hide()},Eab=function(a){o6.call(this,a,"subscribecard-endscreen");
this.j=new g.W({F:"div",K:"ytp-subscribe-card",W:[{F:"img",K:"ytp-author-image",X:{src:"{{profilePicture}}"}},{F:"div",K:"ytp-subscribe-card-right",W:[{F:"div",K:"ytp-author-name",qa:"{{author}}"},{F:"div",K:"html5-subscribe-button-container"}]}]});g.H(this,this.j);this.j.Ca(this.element);var b=a.getVideoData();this.subscribeButton=new g.ZQ("Subscribe",null,"Unsubscribe",null,!0,!1,b.fl,b.subscribed,"trailer-endscreen",null,null,a);g.H(this,this.subscribeButton);this.subscribeButton.Ca(this.j.Ea("html5-subscribe-button-container"));
this.N(a,"videodatachange",this.La);this.La();this.hide()},u6=function(a){var b=a.V(),c=g.LE||g.DG?{style:"will-change: opacity"}:void 0,d=b.u,e=["ytp-videowall-still"];
b.isMobile&&e.push("ytp-videowall-show-text");g.W.call(this,{F:"a",Ga:e,X:{href:"{{url}}",target:d?b.T:"","aria-label":"{{aria_label}}","data-is-live":"{{is_live}}","data-is-list":"{{is_list}}","data-is-mix":"{{is_mix}}"},W:[{F:"div",K:"ytp-videowall-still-image",X:{style:"{{background}}"}},{F:"span",K:"ytp-videowall-still-info",X:{"aria-hidden":"true"},W:[{F:"span",K:"ytp-videowall-still-info-bg",W:[{F:"span",K:"ytp-videowall-still-info-content",X:c,W:[{F:"span",K:"ytp-videowall-still-info-title",
qa:"{{title}}"},{F:"span",K:"ytp-videowall-still-info-author",qa:"{{author_and_views}}"},{F:"span",K:"ytp-videowall-still-info-live",qa:"Live"},{F:"span",K:"ytp-videowall-still-info-duration",qa:"{{duration}}"}]}]}]},{F:"span",Ga:["ytp-videowall-still-listlabel-regular","ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},W:[{F:"span",K:"ytp-videowall-still-listlabel-icon"},"Playlist",{F:"span",K:"ytp-videowall-still-listlabel-length",W:[" (",{F:"span",qa:"{{playlist_length}}"},")"]}]},{F:"span",
Ga:["ytp-videowall-still-listlabel-mix","ytp-videowall-still-listlabel"],X:{"aria-hidden":"true"},W:[{F:"span",K:"ytp-videowall-still-listlabel-mix-icon"},"Mix",{F:"span",K:"ytp-videowall-still-listlabel-length",qa:" (50+)"}]}]});this.suggestion=null;this.u=d;this.api=a;this.j=new g.yE(this);g.H(this,this.j);this.Qa("click",this.onClick);this.Qa("keypress",this.onKeyPress);this.j.N(a,"videodatachange",this.onVideoDataChange);a.Cg(this.element,this);this.onVideoDataChange()},v6=function(a){o6.call(this,
a,"videowall-endscreen");
var b=this;this.G=a;this.B=0;this.stills=[];this.C=this.videoData=null;this.D=this.J=!1;this.T=null;this.u=new g.yE(this);g.H(this,this.u);this.Z=a.S("web_rounded_thumbnails");this.I=new g.io(function(){g.qo(b.element,"ytp-show-tiles")},0);
g.H(this,this.I);var c=new g.W({F:"button",Ga:["ytp-button","ytp-endscreen-previous"],X:{"aria-label":"Previous"},W:[g.iM()]});g.H(this,c);c.Ca(this.element);c.Qa("click",this.kW,this);this.table=new g.aM({F:"div",K:"ytp-endscreen-content"});g.H(this,this.table);this.table.Ca(this.element);c=new g.W({F:"button",Ga:["ytp-button","ytp-endscreen-next"],X:{"aria-label":"Next"},W:[g.jM()]});g.H(this,c);c.Ca(this.element);c.Qa("click",this.jW,this);a.getVideoData().cf?this.j=new m6(a,!0):this.j=new p6(a);
g.H(this,this.j);g.oP(this.player,this.j.element,4);a.qb(this.element,this,158789);this.hide()},w6=function(a){return g.pP(a.player)&&a.Vy()&&!a.C},Fab=function(a){var b,c,d,e;
return(null==(b=a.videoData)?0:null==(c=b.suggestions)?0:c.length)?null==(d=a.videoData)?void 0:d.suggestions:[null==(e=a.videoData)?void 0:g.MI(e)]},x6=function(a){var b=a.wf();
b!==a.J&&(a.J=b,a.player.ma("autonavvisibility"))},y6=function(a){o6.call(this,a,"watch-again-on-youtube-endscreen");
this.watchButton=new s6(a,1);g.H(this,this.watchButton);this.watchButton.Ca(this.element);g.R2a(a)&&(this.j=new g.x2(a,g.HO(a)),g.H(this,this.j),this.u=new g.W({F:"div",Ga:["ytp-watch-again-on-youtube-endscreen-more-videos-container"],X:{tabIndex:"-1"},W:[this.j]}),g.H(this,this.u),this.j.Ca(this.u.element),this.u.Ca(this.element));a.qb(this.element,this,156914);this.hide()},Jab=function(a){g.WP.call(this,a);
var b=this;this.endScreen=null;this.u=this.j=this.B=this.C=!1;this.listeners=new g.yE(this);g.H(this,this.listeners);var c=a.V(),d=a.getVideoData();d=d&&0!==d.endSeconds;if(g.Ov(g.XG(c))&&d&&!g.lP(a))this.u=!0,this.endScreen=new t6(a,g.HO(a));else{var e;(null==(e=g.HO(a))?0:e.Lj())?this.endScreen=new y6(a):Gab(a)?(this.C=!0,Hab(this),this.j?this.endScreen=new q6(a):this.endScreen=new v6(a)):c.Ag?this.endScreen=new Eab(a):this.endScreen=new o6(a)}g.H(this,this.endScreen);g.oP(a,this.endScreen.element,
4);Iab(this);this.listeners.N(a,"videodatachange",this.onVideoDataChange,this);this.listeners.N(a,g.PA("endscreen"),function(f){b.onCueRangeEnter(f)});
this.listeners.N(a,g.QA("endscreen"),function(f){b.onCueRangeExit(f)})},Hab=function(a){var b=a.player.getVideoData();
if(!b||a.j===b.nk&&a.B===b.cf)return!1;a.j=b.nk;a.B=b.cf;return!0},Gab=function(a){a=a.V();
return a.td&&!a.Ag},Iab=function(a){a.player.Ff("endscreen");
var b=a.player.getVideoData();b=new g.NA(Math.max(1E3*(b.lengthSeconds-10),0),0x8000000000000,{id:"preload",namespace:"endscreen"});var c=new g.NA(0x8000000000000,0x8000000000000,{id:"load",priority:8,namespace:"endscreen"});a.player.xe([b,c])};
g.gU.prototype.Dx=g.ca(35,function(a){this.lL!==a&&(this.lL=a,this.jk())});
g.PR.prototype.Lp=g.ca(34,function(a){this.u!==a&&(this.u=a,this.La())});
g.gU.prototype.Lp=g.ca(33,function(a){this.shareButton&&this.shareButton.Lp(a)});
g.LQ.prototype.wB=g.ca(32,function(a){this.mL!==a&&(this.mL=a,this.Yn())});
g.hP.prototype.Cq=g.ca(6,function(){return this.app.Cq()});
g.jZ.prototype.Cq=g.ca(5,function(){return this.getVideoData().BN});g.v(l6,g.W);l6.prototype.select=function(){this.G.zm(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.rz||void 0)&&this.G.rb(this.element)};
l6.prototype.onClick=function(a){g.wQ(a,this.G,this.j,this.suggestion.sessionData||void 0)&&this.select()};
l6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:g.ly(a)||(this.select(),g.ky(a))}};g.v(m6,g.W);g.k=m6.prototype;g.k.eC=function(a){this.suggestion!==a&&(this.suggestion=a,k6(this.j,a),this.playButton.updateValue("url",this.suggestion.zn()),n6(this))};
g.k.Mj=function(){return 0<this.B};
g.k.Jx=function(){this.Mj()||(this.B=Date.now(),yab(this),xab(this.G,Aab(this)),g.uo(this.G.getRootNode(),"countdown-running",this.Mj()))};
g.k.Zt=function(){this.Op();yab(this);var a=this.j.Ea("ytp-autonav-endscreen-upnext-header");a&&g.df(a,"Up next")};
g.k.Op=function(){this.Mj()&&(this.C.stop(),this.B=0)};
g.k.select=function(a){this.G.nextVideo(!1,void 0===a?!1:a);this.Op()};
g.k.IN=function(a){g.wQ(a,this.G)&&(a.currentTarget===this.playButton.element?this.G.rb(this.playButton.element):a.currentTarget===this.j.Ea("ytp-autonav-endscreen-link-container")&&(a=this.j.Ea("ytp-autonav-endscreen-link-container"),this.G.Sa(a,!0),this.G.rb(a)),this.select())};
g.k.eW=function(){this.G.rb(this.cancelButton.element);g.jP(this.G,!0);this.D&&this.G.Oa("innertubeCommand",this.D)};
g.k.onVideoDataChange=function(a,b){var c;this.D=null==(c=b.lY)?void 0:c.command};
g.k.g1=function(a){if(Bab(this)){var b=this.G.getVideoData().watchToWatchTransitionRenderer,c=null==b?void 0:b.fromColorPaletteDark;b=null==b?void 0:b.toColorPaletteDark;if(c&&b){var d=this.element;d.style.setProperty("--w2w-start-background-color",g.pN(c.surgeColor));d.style.setProperty("--w2w-start-primary-text-color",g.pN(c.primaryTitleColor));d.style.setProperty("--w2w-start-secondary-text-color",g.pN(c.secondaryTitleColor));d.style.setProperty("--w2w-end-background-color",g.pN(b.surgeColor));
d.style.setProperty("--w2w-end-primary-text-color",g.pN(b.primaryTitleColor));d.style.setProperty("--w2w-end-secondary-text-color",g.pN(b.secondaryTitleColor));d.style.setProperty("--w2w-animation-duration",a+"ms")}g.uo(this.element,"ytp-w2w-animate",!0)}};
g.k.dW=function(a){this.G.S("web_autonav_color_transition")&&2!==a&&g.uo(this.element,"ytp-w2w-animate",!1)};
g.k.HN=function(){var a=this.G.wf();this.I&&this.tb!==a&&g.dM(this,a);n6(this);this.G.Sa(this.container.element,a);this.G.Sa(this.cancelButton.element,a);this.G.Sa(this.j.Ea("ytp-autonav-endscreen-link-container"),a);this.G.Sa(this.playButton.element,a)};
g.k.Ig=function(a){return 400>a.width||459>a.height};g.v(o6,g.W);g.k=o6.prototype;g.k.create=function(){this.created=!0};
g.k.destroy=function(){this.created=!1};
g.k.Vy=function(){return!1};
g.k.wf=function(){return!1};
g.k.HR=function(){return!1};g.v(p6,g.W);g.k=p6.prototype;g.k.WC=function(){this.notification&&(this.C.stop(),this.Ac(this.B),this.B=null,this.notification.close(),this.notification=null)};
g.k.eC=function(a){this.suggestion=a;k6(this,a,"hqdefault.jpg")};
g.k.JN=function(){g.dM(this,this.api.wf());this.api.Sa(this.element,this.api.wf());this.api.Sa(this.Ea("ytp-upnext-autoplay-icon"),this.api.wf());this.cancelButton&&this.api.Sa(this.cancelButton.element,this.api.wf())};
g.k.g2=function(){window.focus();this.WC()};
g.k.Jx=function(a){var b=this;this.Mj()||(g.By("a11y-announce","Up Next "+this.suggestion.title),this.u=(0,g.R)(),this.j=new g.io(function(){Dab(b,a)},25),Dab(this,a),xab(this.api,Cab(this,a)));
g.so(this.element,"ytp-upnext-autoplay-paused")};
g.k.hide=function(){g.W.prototype.hide.call(this)};
g.k.Mj=function(){return!!this.j};
g.k.Zt=function(){this.Op();this.u=(0,g.R)();Dab(this);g.qo(this.element,"ytp-upnext-autoplay-paused")};
g.k.Op=function(){this.Mj()&&(this.j.dispose(),this.j=null)};
g.k.select=function(a){a=void 0===a?!1:a;if(this.api.V().S("autonav_notifications")&&a&&window.Notification&&"function"===typeof document.hasFocus){var b=Notification.permission;"default"===b?Notification.requestPermission():"granted"!==b||document.hasFocus()||(this.WC(),this.notification=new Notification("Up Next",{body:this.suggestion.title,icon:this.suggestion.Mf()}),this.B=this.N(this.notification,"click",this.g2),this.C.start())}this.Op();this.api.nextVideo(!1,a)};
g.k.gW=function(a){!g.cf(this.cancelButton.element,g.gy(a))&&g.wQ(a,this.api)&&(this.api.wf()&&this.api.rb(this.Ea("ytp-upnext-autoplay-icon")),this.select())};
g.k.fW=function(){this.api.wf()&&this.cancelButton&&this.api.rb(this.cancelButton.element);g.jP(this.api,!0)};
g.k.V1=function(a){this.api.getPresentingPlayerType();this.show();this.Jx(a)};
g.k.W1=function(){this.api.getPresentingPlayerType();this.Op();this.hide()};
g.k.ra=function(){this.Op();this.WC();g.W.prototype.ra.call(this)};g.v(q6,o6);g.k=q6.prototype;g.k.create=function(){o6.prototype.create.call(this);this.C.N(this.player,"appresize",this.zy);this.C.N(this.player,"onVideoAreaChange",this.zy);this.C.N(this.player,"videodatachange",this.onVideoDataChange);this.C.N(this.player,"autonavchange",this.KN);this.C.N(this.player,"autonavcancel",this.hW);this.onVideoDataChange()};
g.k.show=function(){o6.prototype.show.call(this);(this.I||this.B&&this.B!==this.videoData.clientPlaybackNonce)&&g.jP(this.player,!1);g.pP(this.player)&&this.Vy()&&!this.B?(r6(this),2===this.videoData.autonavState?this.player.V().S("fast_autonav_in_background")&&3===this.player.getVisibilityState()?this.j.select(!0):this.j.Jx():3===this.videoData.autonavState&&this.j.Zt()):(g.jP(this.player,!0),r6(this));this.zy()};
g.k.hide=function(){o6.prototype.hide.call(this);this.j.Zt();r6(this)};
g.k.zy=function(){var a=this.player.Hj(!0,this.player.isFullscreen());r6(this);n6(this.u);g.uo(this.element,"ytp-autonav-cancelled-small-mode",this.Ig(a));g.uo(this.element,"ytp-autonav-cancelled-tiny-mode",this.iE(a));g.uo(this.element,"ytp-autonav-cancelled-mini-mode",400>=a.width||360>=a.height);this.overlay&&g.Kl(this.overlay.element,{width:a.width+"px"});if(!this.D){a=g.t(this.videos.entries());for(var b=a.next();!b.done;b=a.next()){var c=g.t(b.value);b=c.next().value;c=c.next().value;g.uo(c.element,
"ytp-suggestion-card-with-margin",1===b%2)}}};
g.k.onVideoDataChange=function(){var a=this.player.getVideoData();if(this.videoData!==a&&a){this.videoData=a;if((a=this.videoData.suggestions)&&a.length){var b=g.MI(this.videoData);b&&(this.j.eC(b),this.j!==this.u&&this.u.eC(b));for(b=0;b<Kab.length;++b){var c=Kab[b];if(a&&a[c]){this.videos[b]=new l6(this.player);var d=this.videos[b];c=a[c];d.suggestion!==c&&(d.suggestion=c,k6(d,c));g.H(this,this.videos[b]);this.videos[b].Ca(this.J.element)}}}this.zy()}};
g.k.KN=function(a){1===a?(this.I=!1,this.B=this.videoData.clientPlaybackNonce,this.j.Op(),this.tb&&this.zy()):(this.I=!0,this.wf()&&(2===a?this.j.Jx():3===a&&this.j.Zt()))};
g.k.hW=function(a){a?this.KN(1):(this.B=null,this.I=!1)};
g.k.Vy=function(){return 1!==this.videoData.autonavState};
g.k.Ig=function(a){return(910>a.width||459>a.height)&&!this.iE(a)&&!(400>=a.width||360>=a.height)};
g.k.iE=function(a){return 800>a.width&&!(400>=a.width||360>=a.height)};
g.k.wf=function(){return this.tb&&g.pP(this.player)&&this.Vy()&&!this.B};
var Kab=[1,3,2,4];g.v(s6,g.W);g.k=s6.prototype;g.k.onClick=function(a){g.xQ(this.getVideoUrl(),this.G,a);this.G.rb(this.element)};
g.k.getVideoUrl=function(){var a=!0;switch(this.buttonType){case 1:a=!0;break;case 2:a=!1}a=this.G.getVideoUrl(a,!1,!1,!0);var b=this.G.V();if(g.FG(b)||g.PG(b)){var c={};b.Ba&&g.FG(b)&&g.uO(c,b.loaderUrl);g.FG(b)&&g.EO(this.G,"addEmbedsConversionTrackingParams",[c]);a:{switch(this.buttonType){case 2:b="emb_ytp_continue_watching";break a}b="emb_ytp_watch_again"}g.tO(c,b);a=g.ni(a,c)}return a};
g.k.Sa=function(){this.G.Sa(this.element,this.tb&&this.ya)};
g.k.show=function(){g.W.prototype.show.call(this);this.Sa()};
g.k.hide=function(){g.W.prototype.hide.call(this);this.Sa()};
g.k.Zb=function(a){g.W.prototype.Zb.call(this,a);this.Sa()};g.v(t6,o6);t6.prototype.show=function(){3!==this.player.getPlayerState()&&(o6.prototype.show.call(this),this.j.Dx(!0),this.j.Lp(!0),this.G.Sa(this.element,!0),this.watchButton.Zb(!0))};
t6.prototype.hide=function(){o6.prototype.hide.call(this);this.j.Dx(!1);this.j.Lp(!1);this.G.Sa(this.element,!1);this.watchButton.Zb(!1)};g.v(Eab,o6);Eab.prototype.La=function(){var a=this.player.getVideoData();this.j.update({profilePicture:a.profilePicture,author:a.author});this.subscribeButton.channelId=a.fl;var b=this.subscribeButton;a.subscribed?b.j():b.u()};g.v(u6,g.W);u6.prototype.select=function(){this.api.zm(this.suggestion.videoId,this.suggestion.sessionData,this.suggestion.playlistId,void 0,void 0,this.suggestion.rz||void 0)&&this.api.rb(this.element)};
u6.prototype.onClick=function(a){g.wQ(a,this.api,this.u,this.suggestion.sessionData||void 0)&&this.select()};
u6.prototype.onKeyPress=function(a){switch(a.keyCode){case 13:case 32:g.ly(a)||(this.select(),g.ky(a))}};
u6.prototype.onVideoDataChange=function(){var a=this.api.getVideoData(),b=this.api.V();this.u=a.D?!1:b.u};g.v(v6,o6);g.k=v6.prototype;g.k.create=function(){o6.prototype.create.call(this);var a=this.player.getVideoData();a&&(this.videoData=a);this.xo();this.u.N(this.player,"appresize",this.xo);this.u.N(this.player,"onVideoAreaChange",this.xo);this.u.N(this.player,"videodatachange",this.onVideoDataChange);this.u.N(this.player,"autonavchange",this.BG);this.u.N(this.player,"autonavcancel",this.iW);a=this.videoData.autonavState;a!==this.T&&this.BG(a);this.u.N(this.element,"transitionend",this.E3)};
g.k.destroy=function(){g.vz(this.u);g.cb(this.stills);this.stills=[];o6.prototype.destroy.call(this);g.so(this.element,"ytp-show-tiles");this.I.stop();this.T=this.videoData.autonavState};
g.k.Vy=function(){return 1!==this.videoData.autonavState};
g.k.show=function(){var a=this.tb;o6.prototype.show.call(this);Fab(this);g.so(this.element,"ytp-show-tiles");this.player.V().isMobile?g.ko(this.I):this.I.start();(this.D||this.C&&this.C!==this.videoData.clientPlaybackNonce)&&g.jP(this.player,!1);w6(this)?(x6(this),2===this.videoData.autonavState?this.player.V().S("fast_autonav_in_background")&&3===this.player.getVisibilityState()?this.j.select(!0):this.j.Jx():3===this.videoData.autonavState&&this.j.Zt()):(g.jP(this.player,!0),x6(this));a!==this.tb&&
this.player.Sa(this.element,!0)};
g.k.hide=function(){var a=this.tb;o6.prototype.hide.call(this);this.j.Zt();x6(this);a!==this.tb&&this.player.Sa(this.element,!1)};
g.k.E3=function(a){g.gy(a)===this.element&&this.xo()};
g.k.xo=function(){var a=Fab(this);if(a.length){g.qo(this.element,"ytp-endscreen-paginate");var b=this.G.Hj(!0,this.G.isFullscreen()),c=g.HO(this.G);c&&(c=c.Of()?48:32,b.width-=2*c);var d=b.width/b.height,e=96/54,f=c=2,h=Math.max(b.width/96,2),l=Math.max(b.height/54,2),m=a.length,n=Math.pow(2,2);var p=m*n+(Math.pow(2,2)-n);p+=Math.pow(2,2)-n;for(p-=n;0<p&&(c<h||f<l);){var q=c/2,r=f/2,w=c<=h-2&&p>=r*n,x=f<=l-2&&p>=q*n;if((q+1)/r*e/d>d/(q/(r+1)*e)&&x)p-=q*n,f+=2;else if(w)p-=r*n,c+=2;else if(x)p-=q*
n,f+=2;else break}e=!1;p>=3*n&&6>=m*n-p&&(4<=f||4<=c)&&(e=!0);n=96*c;p=54*f;d=n/p<d?b.height/p:b.width/n;d=Math.min(d,2);n=Math.floor(Math.min(b.width,n*d));p=Math.floor(Math.min(b.height,p*d));b=this.table.element;b.ariaLive="polite";g.Ul(b,n,p);g.Kl(b,{marginLeft:n/-2+"px",marginTop:p/-2+"px"});this.j.eC(g.MI(this.videoData));this.j instanceof m6&&n6(this.j);g.uo(this.element,"ytp-endscreen-takeover",w6(this));x6(this);n+=4;p+=4;d=0;b.ariaBusy="true";for(h=0;h<c;h++)for(l=0;l<f;l++)if(q=d,w=0,e&&
h>=c-2&&l>=f-2?w=1:0===l%2&&0===h%2&&(2>l&&2>h?0===l&&0===h&&(w=2):w=2),q=g.re(q+this.B,m),0!==w){r=this.stills[d];r||(r=new u6(this.player),this.stills[d]=r,b.appendChild(r.element));x=Math.floor(p*l/f);var z=Math.floor(n*h/c),B=Math.floor(p*(l+w)/f)-x-4,C=Math.floor(n*(h+w)/c)-z-4;g.Ql(r.element,z,x);g.Ul(r.element,C,B);g.Kl(r.element,"transitionDelay",(l+h)/20+"s");g.uo(r.element,"ytp-videowall-still-mini",1===w);g.uo(r.element,"ytp-videowall-still-large",2<w);this.Z&&(w=Math.max(C,B),g.uo(r.element,
"ytp-videowall-still-round-large",256<=w),g.uo(r.element,"ytp-videowall-still-round-medium",96<w&&256>w),g.uo(r.element,"ytp-videowall-still-round-small",96>=w));q=a[q];r.suggestion!==q&&(r.suggestion=q,w=r.api.V(),x=g.po(r.element,"ytp-videowall-still-large")?"hqdefault.jpg":"mqdefault.jpg",k6(r,q,x),g.FG(w)&&(x=q.zn(),z={},w.Ba&&g.uO(z,w.loaderUrl),g.EO(r.api,"addEmbedsConversionTrackingParams",[z]),x=g.ni(x,g.tO(z,"emb_rel_end")),r.updateValue("url",x)),(q=(q=q.sessionData)&&q.itct)&&r.api.Dh(r.element,
q));d++}b.ariaBusy="false";g.uo(this.element,"ytp-endscreen-paginate",d<m);for(a=this.stills.length-1;a>=d;a--)c=this.stills[a],g.af(c.element),g.ab(c);this.stills.length=d}};
g.k.onVideoDataChange=function(){var a=this.player.getVideoData();this.videoData!==a&&(this.B=0,this.videoData=a,this.xo())};
g.k.jW=function(){this.B+=this.stills.length;this.xo()};
g.k.kW=function(){this.B-=this.stills.length;this.xo()};
g.k.HR=function(){return this.j.Mj()};
g.k.BG=function(a){1===a?(this.D=!1,this.C=this.videoData.clientPlaybackNonce,this.j.Op(),this.tb&&this.xo()):(this.D=!0,this.tb&&w6(this)&&(2===a?this.j.Jx():3===a&&this.j.Zt()))};
g.k.iW=function(a){if(a){for(a=0;a<this.stills.length;a++)this.G.Sa(this.stills[a].element,!0);this.BG(1)}else this.C=null,this.D=!1;this.xo()};
g.k.wf=function(){return this.tb&&w6(this)};g.v(y6,o6);y6.prototype.show=function(){if(3!==this.player.getPlayerState()){o6.prototype.show.call(this);var a=this.u;if(a){var b=0<this.j.suggestionData.length;g.uo(this.element,"ytp-shorts-branded-ui",b);b?a.show():a.hide()}var c;null==(c=g.HO(this.player))||c.wB(!0);this.player.Sa(this.element,!0);this.watchButton.Zb(!0)}};
y6.prototype.hide=function(){o6.prototype.hide.call(this);var a;null==(a=g.HO(this.player))||a.wB(!1);this.player.Sa(this.element,!1);this.watchButton.Zb(!1)};g.v(Jab,g.WP);g.k=Jab.prototype;g.k.Du=function(){var a;if((null==(a=g.HO(this.player))?0:a.Lj())||this.u)return!0;a=this.player.getVideoData();var b;var c=!!((null==a?0:g.MI(a))||(null==a?0:null==(b=a.suggestions)?0:b.length));b=!Gab(this.player)||c;c=a.dj||g.PG(a.u);var d=this.player.Dz();a=a.mutedAutoplay;return b&&!c&&!d&&!a};
g.k.wf=function(){return this.endScreen.wf()};
g.k.S_=function(){return this.wf()?this.endScreen.HR():!1};
g.k.ra=function(){this.player.Ff("endscreen");g.WP.prototype.ra.call(this)};
g.k.load=function(){var a=this.player.getVideoData();var b=a.transitionEndpointAtEndOfStream;if(b&&b.videoId){var c=this.player.ub().Ke.get("heartbeat"),d=g.MI(a);!d||b.videoId!==d.videoId||a.eS?(this.player.zm(b.videoId,void 0,void 0,!0,!0,b),c&&c.oE("HEARTBEAT_ACTION_TRIGGER_AT_STREAM_END","HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT"),a=!0):a=!1}else a=!1;a||(g.WP.prototype.load.call(this),this.endScreen.show())};
g.k.unload=function(){g.WP.prototype.unload.call(this);this.endScreen.hide();this.endScreen.destroy()};
g.k.onCueRangeEnter=function(a){this.Du()&&(this.endScreen.created||this.endScreen.create(),"load"===a.getId()&&this.load())};
g.k.onCueRangeExit=function(a){"load"===a.getId()&&this.loaded&&this.unload()};
g.k.onVideoDataChange=function(){Iab(this);this.C&&Hab(this)&&(this.endScreen&&(this.endScreen.hide(),this.endScreen.created&&this.endScreen.destroy(),this.endScreen.dispose()),this.j?this.endScreen=new q6(this.player):this.endScreen=new v6(this.player),g.H(this,this.endScreen),g.oP(this.player,this.endScreen.element,4))};g.VP("endscreen",Jab);})(_yt_player);