(function(g){var window=this;'use strict';var Ggb=function(a,b){if(!Number.isFinite(a))return String(a);a=String(a);var c=a.indexOf(".");-1===c&&(c=a.length);var d="-"===a[0]?"-":"";d&&(a=a.substring(1));return d+(0,g.$Ta)("0",Math.max(0,b-c))+a},Hgb=function(){return{G:"svg", X:{fill:"#fff",height:"24px",viewBox:"0 0 24 24",width:"24px"},W:[{G:"path",X:{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}}]}},Igb=function(){return{G:"svg", X:{fill:"#fff",height:"24px",viewBox:"0 0 24 24",width:"24px"},W:[{G:"path",X:{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z"}}]}},Kgb=function(a){"number"===typeof a?(this.date=Jgb(a,0,1),o6(this,1)):g.Ja(a)?(this.date=Jgb(a.getFullYear(),a.getMonth(),a.getDate()),o6(this,a.getDate())):(this.date=new Date(g.Ra()),a=this.date.getDate(), this.date.setHours(0),this.date.setMinutes(0),this.date.setSeconds(0),this.date.setMilliseconds(0),o6(this,a))},Jgb=function(a,b,c){b=new Date(a,b,c); 0<=a&&100>a&&b.setFullYear(b.getFullYear()-1900);return b},o6=function(a,b){a.getDate()!=b&&a.date.setUTCHours(a.date.getUTCHours()+(a.getDate()=h}f?(g.vA("heartbeatActionPlayerHalted",b?{enforcedPolicyToHaltOnNetworkFailure:!0}:khb()),(b=a.getVideoData())&&b.isLivePlayback?a.player.Ng(e,1,"Video playback interrupted. Please try again.",c):a.player.Ng(e,1,"Sorry, there was an error licensing this video.", c)):(d.K("html5_report_non_fatal_heartbeat_error")&&a.player.Tq(e,{msg:c}),u6(a,a.I.getValue()),g.Pi(a.I))}},khb=function(a){var b={enforcedPolicyToHaltOnNetworkFailure:!1}; a&&(b.serializedServerContext=a.additionalLoggingData);return b},w6=function(a){a.V=0; a.u.stop();a.D=!1;a.sequenceNumber=0},$gb=function(a){var b=a.getVideoData(),c=a.player.T(); if(b.isLivePlayback)if(g.oJ(c.D)){a.C=!0;a.J=!0;if(!g.rK(c)||g.DK(c))a.offlineSlate=new Ugb(a.player),g.D(a,a.offlineSlate),g.MS(a.player,a.offlineSlate.element,4);(b=b.getPlayerResponse())&&b.playabilityStatus&&(a.j=b.playabilityStatus);var d;"UNPLAYABLE"!==(null==(d=a.j)?void 0:d.status)&&(a.j?(d=lhb(a.j.liveStreamability&&a.j.liveStreamability.liveStreamabilityRenderer))?u6(a,d):u6(a,7500):u6(a,1E3))}else a.player.Ng("html5.unsupportedlive",2,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK","nolive.1");else g.ob(b.Ja, "heartbeat")&&a.player.fg("heartbeat",a.getPlayerType())},jhb=function(a){return(a=a.player.getProgressState(a.getPlayerType()).ingestionTime)&&isFinite(a)?""+Math.floor(1E3*a):null},fhb=function(a){try{var b=JSON.parse(a); return null!=b?b:void 0}catch(c){}},dhb=["ATTESTATION_ERROR_UNKNOWN", "ATTESTATION_ERROR_VM_NOT_INITIALIZED","ATTESTATION_ERROR_VM_NO_RESPONSE","ATTESTATION_ERROR_VM_TIMEOUT","ATTESTATION_ERROR_VM_INTERNAL_ERROR"],mhb={mpa:["BC","AD"],lpa:["Before Christ","Anno Domini"],AJa:"JFMAMJJASOND".split(""),SVa:"JFMAMJJASOND".split(""),QIa:"January February March April May June July August September October November December".split(" "),RVa:"January February March April May June July August September October November December".split(" "),BSa:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), UVa:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),b5a:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),WVa:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),jTa:"Sun Mon Tue Wed Thu Fri Sat".split(" "),VVa:"Sun Mon Tue Wed Thu Fri Sat".split(" "),BJa:"SMTWTFS".split(""),TVa:"SMTWTFS".split(""),CSa:["Q1","Q2","Q3","Q4"],NQa:["1st quarter","2nd quarter","3rd quarter","4th quarter"],nea:["AM","PM"],gna:["EEEE, MMMM d, y","MMMM d, y","MMM d, y", "M/d/yy"],MYa:["h:mm:ss\u202fa zzzz","h:mm:ss\u202fa z","h:mm:ss\u202fa","h:mm\u202fa"],hna:["{1} 'at' {0}","{1} 'at' {0}","{1}, {0}","{1}, {0}"],gZ:6,c5a:[5,6],hZ:5},nhb=mhb;nhb=mhb;g.k=Kgb.prototype;g.k.gT=nhb.gZ;g.k.hT=nhb.hZ;g.k.clone=function(){var a=new Kgb(this.date);a.gT=this.gT;a.hT=this.hT;return a}; g.k.getFullYear=function(){return this.date.getFullYear()}; g.k.getYear=function(){return this.getFullYear()}; g.k.getMonth=function(){return this.date.getMonth()}; g.k.getDate=function(){return this.date.getDate()}; g.k.getTime=function(){return this.date.getTime()}; g.k.getDay=function(){return this.date.getDay()}; g.k.getUTCFullYear=function(){return this.date.getUTCFullYear()}; g.k.getUTCMonth=function(){return this.date.getUTCMonth()}; g.k.getUTCDate=function(){return this.date.getUTCDate()}; g.k.getUTCDay=function(){return this.date.getDay()}; g.k.getUTCHours=function(){return this.date.getUTCHours()}; g.k.getUTCMinutes=function(){return this.date.getUTCMinutes()}; g.k.getTimezoneOffset=function(){return this.date.getTimezoneOffset()}; g.k.set=function(a){this.date=new Date(a.getFullYear(),a.getMonth(),a.getDate())}; g.k.setFullYear=function(a){this.date.setFullYear(a)}; g.k.setYear=function(a){this.setFullYear(a)}; g.k.setMonth=function(a){this.date.setMonth(a)}; g.k.setDate=function(a){this.date.setDate(a)}; g.k.setTime=function(a){this.date.setTime(a)}; g.k.setUTCFullYear=function(a){this.date.setUTCFullYear(a)}; g.k.setUTCMonth=function(a){this.date.setUTCMonth(a)}; g.k.setUTCDate=function(a){this.date.setUTCDate(a)}; g.k.add=function(a){if(a.u||a.j){var b=this.getMonth()+a.j+12*a.u,c=this.getYear()+Math.floor(b/12);b%=12;0>b&&(b+=12);a:{switch(b){case 1:var d=0!=c%4||0==c%100&&0!=c%400?28:29;break a;case 5:case 8:case 10:case 3:d=30;break a}d=31}d=Math.min(d,this.getDate());this.setDate(1);this.setFullYear(c);this.setMonth(b);this.setDate(d)}a.days&&(c=this.getYear(),b=0<=c&&99>=c?-1900:0,a=new Date((new Date(c,this.getMonth(),this.getDate(),12)).getTime()+864E5*a.days),this.setDate(1),this.setFullYear(a.getFullYear()+ b),this.setMonth(a.getMonth()),this.setDate(a.getDate()),o6(this,a.getDate()))}; g.k.equals=function(a){return!(!a||this.getYear()!=a.getYear()||this.getMonth()!=a.getMonth()||this.getDate()!=a.getDate())}; g.k.toString=function(){var a=this.getFullYear(),b=0>a?"-":1E4<=a?"+":"";return[b+Ggb(Math.abs(a),b?6:4),Ggb(this.getMonth()+1,2),Ggb(this.getDate(),2)].join("")+""}; g.k.valueOf=function(){return this.date.valueOf()};var ohb=new g.Dr("addUpcomingEventReminderEndpoint");var phb=new g.Dr("removeUpcomingEventReminderEndpoint");var qhb=new g.Dr("updateUpcomingEventReminderButtonStateCommand");var Ngb=new g.Dr("upcomingEventReminderButtonRenderer"),Tgb=new g.Dr("upcomingEventReminderButtonStateRenderer");g.w(p6,g.OS);p6.prototype.hide=function(){this.buttonElement&&this.buttonElement.removeAttribute("aria-haspopup");g.OS.prototype.hide.call(this)}; p6.prototype.show=function(){this.buttonElement&&this.buttonElement.setAttribute("aria-haspopup","true");g.OS.prototype.show.call(this)}; p6.prototype.oa=function(){g.Za(this.j);g.OS.prototype.oa.call(this)};g.w(q6,g.T); q6.prototype.D=function(){if(this.toggleButtonRenderer){var a=this.toggleButtonRenderer;a.isToggled?this.B(a.toggledServiceEndpoint):this.B(a.defaultServiceEndpoint);a.isToggled=!a.isToggled;r6(this)}else if(this.upcomingEventReminderButtonRenderer)if(this.j&&this.j.yb)this.j.Eb();else{var b=Qgb(this);b&&this.B(b.serviceEndpoint||b.command);b=(null==(a=g.K(null==b?void 0:b.command,g.SQ))?void 0:a.commands)||[];a:{a=g.t(b);for(var c=a.next();!c.done;c=a.next()){var d=b=void 0;if(c=null==(b=g.K(c.value, g.x$a))?void 0:null==(d=b.popup)?void 0:d.menuPopupRenderer){a=c;break a}}a=void 0}this.j||(this.j=new p6(this.F,this.buttonElement),this.j.Ea(this.element),g.D(this,this.j),this.j.subscribe("reminderMenuItemClicked",this.B,this));b=this.j;b.menuPopupRenderer=a;Mgb(b)}}; q6.prototype.B=function(a){var b=g.K(a,ohb),c=g.K(a,phb);if(a&&(b||c)){if(b){var d=b;var e="notification/add_upcoming_event_reminder"}else c&&(d=c,e="notification/remove_upcoming_event_reminder");if(e&&d&&d.params)for(Sgb(this,e,d.params),a=g.t(d.commands||[]),b=a.next();!b.done;b=a.next())if((b=b.value)&&g.K(b,qhb)){this.u=g.K(b,qhb).state;r6(this);break}}};g.w(Ugb,g.T);g.k=Ugb.prototype;g.k.getPlayerType=function(){if(8===this.api.getPresentingPlayerType())return 1}; g.k.getVideoData=function(){return this.api.getVideoData(this.getPlayerType())}; g.k.Pa=function(a){var b,c,d=null==a?void 0:null==(b=a.liveStreamability)?void 0:null==(c=b.liveStreamabilityRenderer)?void 0:c.offlineSlate;if(d){this.u=a;b=d.liveStreamOfflineSlateRenderer;b.canShowCountdown?this.kY():Vgb(this,b);var e,f,h,l;if(c=null==a?void 0:null==(e=a.liveStreamability)?void 0:null==(f=e.liveStreamabilityRenderer)?void 0:null==(h=f.offlineSlate)?void 0:null==(l=h.liveStreamOfflineSlateRenderer)?void 0:l.thumbnail){e=0;f=null;h=c.thumbnails;for(l=0;l e&&(e=h[l].width||0,f=h[l].url);f&&(this.background.style.backgroundImage="url("+f+")")}else this.background.style.backgroundImage="";b.actionButtons||b.reminderButton?(this.j||(this.j=new q6(this.api),this.j.Ea(this.Da("ytp-offline-slate-buttons")),g.D(this,this.j)),Ogb(this.j,b.actionButtons&&b.actionButtons[0],b.reminderButton)):this.j&&Ogb(this.j,null,null);this.u=a}else this.u=null;this.oY()}; g.k.oY=function(a){if(8===this.api.getPresentingPlayerType())var b=!0;else{var c=this.api.Fb(),d=this.getVideoData();b=d.isLivePlayback&&(g.PO(c)||g.S(c,2)||g.S(c,64));var e=2===d.autonavState&&g.S(c,2);c=c.bd()&&!g.DM(d)&&!this.api.isAtLiveHead(void 0,!0);b=b&&!c&&!e}b&&this.u?this.yb?(null==a?0:g.UN(a,2))&&!this.getVideoData().ql&&(g.Tp(this.element,"ytp-offline-slate-collapsed"),this.C.stop(),g.Tp(this.B,"ytp-offline-slate-bar-fade"),this.D.start()):(this.show(),this.C.start(),this.api.ma("offlineslatestatechange"), this.I&&this.api.Lz()):this.yb&&(this.hide(),this.api.ma("offlineslatestatechange"))}; g.k.kY=function(){var a,b,c,d,e=null==(a=this.u)?void 0:null==(b=a.liveStreamability)?void 0:null==(c=b.liveStreamabilityRenderer)?void 0:null==(d=c.offlineSlate)?void 0:d.liveStreamOfflineSlateRenderer;e&&(a=Math.floor(g.Ra()/1E3),b=e.canShowCountdown&&Number(e.scheduledStartTime),!b||b<=a?(Vgb(this,e),this.countdownTimer.stop()):(Vgb(this,e,g.ZQ(b-a)),g.Kp(this.countdownTimer)))}; g.k.oa=function(){this.countdownTimer.dispose();this.countdownTimer=null;g.T.prototype.oa.call(this)};s6.prototype.u=function(a){return this.trigger&&a.trigger?this.module===a.module&&this.trigger===a.trigger&&this.j===a.j:!1}; s6.prototype.isExpired=function(){return 6E4<(0,g.M)()-this.B}; s6.prototype.toString=function(){return this.module+":"+this.trigger+":"+this.j};g.w(chb,g.xT);g.k=chb.prototype;g.k.oa=function(){w6(this);this.player.Gf("heartbeat");g.xT.prototype.oa.call(this)}; g.k.onCueRangeEnter=function(){this.J=!0;u6(this,2E3)}; g.k.RC=function(a){this.heartbeatParams=a;u6(this,2E3)}; g.k.IZ=function(a){var b;8!==this.player.getPresentingPlayerType()&&"UNPLAYABLE"!==(null==(b=this.j)?void 0:b.status)&&(g.S(a.state,2)||g.S(a.state,64)?(w6(this),this.C&&(this.J=!0,u6(this,1E3))):(g.S(a.state,1)||g.S(a.state,8))&&u6(this,2E3))}; g.k.JZ=function(){3!==this.player.getPresentingPlayerType()&&u6(this,2E3)}; g.k.getPlayerType=function(){if(8===this.player.getPresentingPlayerType())return 1}; g.k.getVideoData=function(){return this.player.getVideoData(this.getPlayerType())}; g.k.Rk=function(a){switch(a){case 4:case 3:return!1}return!0}; g.k.qG=function(a,b,c){a={trigger:a,reason:b};c&&(a.serializedServerContext=c.additionalLoggingData);g.vA("heartbeatActionPlayerTransitioned",a)}; g.k.Bf=function(a){var b="LICENSE",c=fhb(a);if(c)return c.reason||g.VT[b]||"";(a=a.match(ghb))&&(a=Number(a[1]))&&(b=g.pCa(a));return g.VT[b]||""}; g.k.sC=function(){return!!this.offlineSlate&&this.offlineSlate.yb}; var ghb=/^GLS\/1.0 (\d+) (\w+).*?\r\n\r\n([\S\s]*)$/;g.wT("heartbeat",chb);})(_yt_player);