(function(g){var window=this;'use strict';var y9=function(a,b){if(!Number.isFinite(a))return String(a);a=String(a);var c=a.indexOf(".");c===-1&&(c=a.length);var d=a[0]==="-"?"-":"";d&&(a=a.substring(1));b="0".repeat(Math.max(0,b-c));return d+b+a},A9=function(a){typeof a==="number"?(this.date=Hfb(a,0,1),z9(this,1)):g.La(a)?(this.date=Hfb(a.getFullYear(),a.getMonth(),a.getDate()),z9(this,a.getDate())):(this.date=new Date(g.Sa()),a=this.date.getDate(),this.date.setHours(0),this.date.setMinutes(0),this.date.setSeconds(0),this.date.setMilliseconds(0), z9(this,a))},Hfb=function(a,b,c){b=new Date(a,b,c); a>=0&&a<100&&b.setFullYear(b.getFullYear()-1900);return b},z9=function(a,b){a.getDate()!=b&&a.date.setUTCHours(a.date.getUTCHours()+(a.getDate(){Ofb(a)}, onTimeout:()=>{Ofb(a)}}; d.Ca().j.va(g.iNa)&&(c.onSuccess=f=>{if(f=f.actions)for(let h of f)g.iN(a.Y,"innertubeCommand",h)}); g.rv(a.A,b,e,c)},Ofb=function(a){a.toggleButtonRenderer&&(a.toggleButtonRenderer.isToggled=!a.toggleButtonRenderer.isToggled,B9(a))},C9=function(a,b,c){if(b){var d=b.subtitleText!=null?g.pE(b.subtitleText):""; c=c?c:b.mainText!=null?g.pE(b.mainText):"";a.update({mainText:c,subtitleText:d,label:b.mainText?.accessibility?.accessibilityData?.label??c});g.Fo(a.element,"ytp-offline-slate-single-text-line",!d);g.Fo(a.D,"ytp-offline-slate-bar-hidden",!c&&!d)}},Pfb=function(a){try{let b=JSON.parse(a); return b!=null?b:void 0}catch(b){}},Ufb=async function(a){var b=a.player.V(),c=a.getVideoData(); D9(a)&&(Qfb(a)?Rfb(a,b,c):(Sfb(a),await Tfb(a,b,c)))},Sfb=function(a){var b=a.getVideoData(); if(b.gB)if(b.K("use_rta_for_player"))a.attestationResponse=Vfb(a);else{let f=new g.fKa(b);if(g.TE.isInitialized()||a.sequenceNumber>=3){b=Promise;var c=b.resolve;let h=null;if(f.videoData.zn){var d=g.WE(f);if(d){h={};let k={};d=d.split("&");for(e of d)d=e.split("="),d.length===2&&(k[d[0]]=d[1]);var e=k;e.r1a&&(h.webResponse=e.r1a);e.r1c&&(h.error=Wfb[Number(e.r1c)]);h.challenge=f.videoData.zn}}a.attestationResponse=c.call(b,h||void 0)}}},Yfb=function(a){var b=a.getVideoData(),c=a.player.V(); if(b.isLivePlayback)if(g.MK(c.B)){a.C=!0;a.J=!0;if(!g.rL(c)||g.yL(c))a.offlineSlate=new Xfb(a.player),g.O(a,a.offlineSlate),g.yN(a.player,a.offlineSlate.element,4);(b=b.getPlayerResponse())&&b.playabilityStatus&&(a.j=b.playabilityStatus);a.j?.status!=="UNPLAYABLE"&&(a.j?(b=E9(void 0,a.j.liveStreamability&&a.j.liveStreamability.liveStreamabilityRenderer))?F9(a,b):F9(a,7500):F9(a,G9(a,1E3)))}else a.player.ue("html5.unsupportedlive",2,"HTML5_NO_AVAILABLE_FORMATS_FALLBACK","nolive.1");else g.cc(b.Bk, "heartbeat")&&a.player.Yi("heartbeat",a.getPlayerType())},agb=function(a,b,c){var d=c.liveStreamability&&c.liveStreamability.liveStreamabilityRenderer,e=!(!d||!(d.switchStreamsImmediately||d.transitionTiming&&d.transitionTiming==="STREAM_TRANSITION_TIMING_IMMEDIATELY")); b=E9(b,d);var f=a.getVideoData(),h=a.player.getPlayerStateObject(a.getPlayerType()),k=h.isPlaying()&&!g.HM(f)&&!a.player.isAtLiveHead(a.getPlayerType());if(f.V().ob()){var l=a.player.Ic()?.Lc()||{};l.status=c.status||"";l.dvr=`${+k}`;l["switch"]=`${+e}`;l.ended=`${+!(!d||!d.displayEndscreen)}`;a.player.U("heartbeat",l)}l=d&&d.broadcastId;var m=a.j&&a.j.liveStreamability&&a.j.liveStreamability.liveStreamabilityRenderer&&a.j.liveStreamability.liveStreamabilityRenderer.broadcastId,q=l!==m&&l!=null;q&& a.player.U("lbidh",{broadcastId:l},!0);if(g.rL(f.V())&&d&&d.streamTransitionEndpoint){var r=g.P(d.streamTransitionEndpoint,g.XY)?.commands||[];for(var u of r)if(g.P(u,g.PL)?.signal==="RELOAD_PLAYER"){a.player.ue("qoe.restart",0,void 0,"sa.reload","7");break}}if(u=q)k?(u=a.player.getProgressState(a.getPlayerType()),u=u.seekableEnd-u.current,u=isFinite(u)&&u<=30):u=!0;e=k&&!e&&!u;u=a.player.K("always_cache_redirect_endpoint");if(e&&!u)return b;r=d&&d.streamTransitionEndpoint&&g.P(d.streamTransitionEndpoint, g.eM);if((d&&d.transitionTiming)==="STREAM_TRANSITION_TIMING_AT_STREAM_END")a.getVideoData().transitionEndpointAtEndOfStream=r,a.player.V().Ca().j.va(g.gOa)&&(a.getVideoData().VD=r?d?.streamTransitionEndpoint?.clickTrackingParams:void 0);else{if(r&&!k&&Zfb(a,r,c))return b;u&&!r&&a.getVideoData().transitionEndpointAtEndOfStream&&(a.getVideoData().transitionEndpointAtEndOfStream=void 0,a.getVideoData().VD=void 0)}if(e&&u)return b;if(c.status.toUpperCase()==="OK"){if(!g.bM(f)||q)return d={video_id:f.videoId}, (h=a.player.V().experiments.Ca().j.va(g.IEa))&&f.isLivePlayback&&(d.live_playback="1"),f.Oq&&(d.is_live_destination="1"),d.disable_watch_next=!0,d.raw_watch_next_response=f.getWatchNextResponse(),d.autonav_state=f.autonavState,d.oauth_token=f.oauthToken,d.Qm=f.Qm,f.Tf&&(d.vss_credentials_token=f.Tf,d.vss_credentials_token_type=f.vn),f.za&&(d.vvt=f.za),k=void 0,g.bM(f)?q&&(k=new $fb("broadcastIdChanged",`${m},${l}`),H9("HEARTBEAT_ACTION_TRANSITION_REASON_BROADCAST_ID_CHANGED",c)):(l&&(k=new $fb("formatsReceived", `${l}`)),H9("HEARTBEAT_ACTION_TRANSITION_REASON_LIVE_STREAM_WENT_ONLINE",c)),q&&a.player.U("lbidr",{broadcastId:l}),h&&(a.j=c),a.player.loadVideoByPlayerVars(d,void 0,void 0,void 0,k),b;a.player.Yi("heartbeat",a.getPlayerType())}d&&d.displayEndscreen&&(a.offlineSlate?(a=a.offlineSlate,a.X=!0,a.C&&a.api.ny()):h.isBuffering()&&(f=a.player.Ic()?.Lc()||{},a.player.U("hbse",f,!0),a.player.ny(!0,"h"),g.iN(a.player,"onLiveMediaEnded",c)));return b},bgb=function(a){var b=a.getVideoData(); !b.K("use_rta_for_player")&&b.gB&&(b=b.botguardData)&&g.VE(b,a.player.V())},I9=function(a){a.L=0; a.A.stop();a.G=!1;a.sequenceNumber=0},Vfb=async function(a){if(await g.dD())return a=a.getVideoData(),g.cD("ENGAGEMENT_TYPE_PLAYBACK",{cpn:a.clientPlaybackNonce, encryptedVideoId:a.videoId||""},1500);if(a.sequenceNumber>=3)return{error:"ATTESTATION_ERROR_VM_INTERNAL_ERROR"}},F9=function(a,b){if(!a.A.isActive()&&a.J){var c=a.getVideoData(); if(J9(a)||c.isLivePlayback)b===void 0&&(b=a.G?a.C?7500:a.heartbeatParams?.interval?a.heartbeatParams.interval*1E3:a.getVideoData().nI||6E4:1E3),a.A.start(b)}},G9=function(a,b=2E3){if(!a.player.V().experiments.Ca().j.va(g.bOa))return b; var c=a.getVideoData();if(a.heartbeatParams?.interval&&a.heartbeatParams.interval>0)return a.heartbeatParams.interval*1E3;if(c.nI>0)return c.nI;a=a.j??c.getPlayerResponse()?.playabilityStatus;a=E9(void 0,a?.liveStreamability?.liveStreamabilityRenderer);return a>0?a:b},Qfb=function(a){var b=a.getVideoData(); if(!g.CM(a.getVideoData())||b.DU)return!1;if(b.G){a=b.G.flavor==="playready";let c=b.G.flavor==="widevine"&&b.K("html5_innertube_heartbeats_for_widevine");b=g.EK(b.G)&&b.K("html5_innertube_heartbeats_for_fairplay");return!(a||c||b)}return!0},J9=function(a){if(Qfb(a))return!!a.heartbeatParams; var b=a.getVideoData();return!g.CM(a.getVideoData())||b.Ut||b.Jq?!!b.heartbeatToken:!1},egb=function(a,b,c){b.Nq&&(c=g.Vc(c,{internalipoverride:b.Nq})); var d={cpn:b.clientPlaybackNonce};b.contextParams&&(d.context_params=b.contextParams);b.lc&&(d.kpt=b.lc);c=g.Vc(c,d);g.jr(c,{format:"RAW",method:"GET",timeout:3E4,onSuccess:e=>{if(!a.A.isActive()&&D9(a)){a.D.reset();a.sequenceNumber++;e=e.responseText;var f=Pfb(e);if(f){g.iN(a.player,"onHeartbeat",f);var h=f.status==="ok"?f.stop_heartbeat?2:0:f.status==="stop"?1:f.status==="live_stream_offline"?0:-1}else h=(h=e.match(cgb))?h[1]==="0"?0:1:-1;dgb(a,void 0,f,e,h)}}, onError:e=>{D9(a)&&K9(a,!0,`net-${e.status}`)}, onTimeout:()=>{D9(a)&&K9(a,!0,"timeout")}, withCredentials:!0})},D9=function(a){var b=a.getVideoData(); return a.player.getPresentingPlayerType()===3||!a.player.V().experiments.Ca().j.va(g.jOa)&&a.player.getPlayerStateObject(a.getPlayerType()).pa(4)?!1:J9(a)||b.isLivePlayback?!0:(I9(a),!1)},Rfb=function(a,b,c){if(a.heartbeatParams?.url){var d=g.Vc(a.heartbeatParams.url,{request_id:g.Yx()}); c.za&&(d=g.Vc(d,{vvt:c.za}),c.mdxEnvironment&&(d=g.Vc(d,{mdx_environment:c.mdxEnvironment})));g.FL(b,c.oauthToken).then(e=>{e&&(d=g.Vc(d,{access_token:e}));egb(a,c,d)})}},Tfb=async function(a,b,c){var d={videoId:c.videoId, sequenceNumber:a.sequenceNumber,heartbeatServerData:c.K("html5_use_reloaded_heartbeat_server_data")?c.heartbeatServerData:a.ea??c.heartbeatServerData};a.X=a.attestationResponse;c.gB&&(d.attestationResponse=await a.X);var e=g.aN(c),f=e.client??{};f.utcOffsetMinutes=a.utcOffsetMinutes;d.context=e;d.cpn=c.clientPlaybackNonce;if(e=typeof Intl!=="undefined"?(new Intl.DateTimeFormat).resolvedOptions().timeZone:null)f.timeZone=e;f={heartbeatChecks:[]};if(e=c.getPlayerResponse())c.heartbeatToken&&(d.heartbeatToken= c.heartbeatToken),(e=e.playabilityStatus)&&(e=e.liveStreamability)&&e.liveStreamabilityRenderer&&f.heartbeatChecks.push("HEARTBEAT_CHECK_TYPE_LIVE_STREAM_STATUS");c.heartbeatToken&&f.heartbeatChecks.push("HEARTBEAT_CHECK_TYPE_YPC");if(g.yL(b)){f.heartbeatChecks.push("HEARTBEAT_CHECK_TYPE_UNPLUGGED");var h=fgb(a);e={};h!==null&&(e.clientPlayerPositionUtcMillis=h);h=a.player.Vc()?.eI()?.uba()||0;h>0&&(e.freePreviewWatchedDuration={seconds:`${h}`});f.unpluggedParams=e}d.heartbeatRequestParams=f;c.isLivePlayback? (f=fgb(a),f!==null&&(d.playbackState||(d.playbackState={}),d.playbackState.playbackPosition={utcTimeMillis:f})):b.K("enable_heartbeat_vod_playback_position")&&(f=ggb(a),f!==null&&(d.playbackState||(d.playbackState={}),d.playbackState.playbackPosition={streamTimeMillis:f}));a.player.publish("heartbeatRequest",d);var k={timeout:3E4,onSuccess:l=>{if(!a.A.isActive()&&D9(a)){var m=a.getVideoData(),q=m.gB&&a.X==null;m.gB=!!l.heartbeatAttestationConfig?.requiresAttestation||q;q=l.playabilityStatus;var r= JSON.stringify(q)||"{}";l.authenticationMismatch&&a.player.U("authshear",{});var u=-1;var w=l.playabilityStatus;w&&(g.iN(a.player,"onHeartbeat",w),w.status==="OK"?u=l.stopHeartbeat?2:0:w.status==="UNPLAYABLE"?u=1:w.status==="LIVE_STREAM_OFFLINE"&&(u=0));a.sequenceNumber&&u===-1||a.D.reset();a.sequenceNumber++;!m.K("html5_use_reloaded_heartbeat_server_data")&&l.heartbeatServerData&&(a.ea=l.heartbeatServerData);m.Lq=l;(w=l.playerCueRangeSet)&&g.fM(m,w);l.playerCueRanges&&l.playerCueRanges.length>0&& (m.cueRanges=l.playerCueRanges);l.progressBarConfig?.progressBarStartPosition&&l.progressBarConfig?.progressBarEndPosition&&(m.progressBarStartPosition=l.progressBarConfig.progressBarStartPosition,m.progressBarEndPosition=l.progressBarConfig.progressBarEndPosition);m.compositeLiveIngestionOffsetToken=l.compositeLiveIngestionOffsetToken;l.compositeLiveStatusToken!==m.compositeLiveStatusToken&&(m.compositeLiveStatusToken=l.compositeLiveStatusToken);m.heartbeatLoggingToken=l.heartbeatLoggingToken;m.K("html5_use_reloaded_heartbeat_server_data")&& l.heartbeatServerData&&(m.heartbeatServerData=l.heartbeatServerData);m.publish("dataupdated");dgb(a,l,q,r,u)}}, onError:l=>{D9(a)&&K9(a,!0,`net-${l.status}`)}, onTimeout:()=>{D9(a)&&K9(a,!0,"timeout")}}; if(f=g.zq("SERIALIZED_LAVA_DEVICE_CONTEXT"))k.headers={["X-YouTube-Lava-Device-Context"]:f};g.FL(b,g.QM(c)).then(l=>{l&&(k.qS=`Bearer ${l}`);g.rv(a.Z,"player/heartbeat",d,k)})},fgb=function(a){return(a=a.player.getProgressState(a.getPlayerType()).ingestionTime)&&isFinite(a)?`${Math.floor(a*1E3)}`:null},ggb=function(a){return(a=a.player.getCurrentTime({playerType:a.getPlayerType()}))&&isFinite(a)?`${Math.floor(a*1E3)}`:null},dgb=function(a,b,c,d,e){e===-1?(c=`decode ${g.Hd(d,3)}`,K9(a,!1,c)):e===2? (I9(a),a.G=!0):(a.L=0,a.A.stop(),e===1?(a.G=!1,c&&c.errorCode==="PLAYABILITY_ERROR_CODE_EMBARGOED"&&a.player.Pj(!0),e=`pe.${c?.errorCode};ps.${c?.status}`,a.player.ue("heartbeat.stop",2,a.If(d),e,void 0,c?.errorScreen?.playerErrorMessageRenderer),g.Dx("heartbeatActionPlayerHalted",hgb(c)),b?.videoTransitionEndpoint&&c&&(b=b.videoTransitionEndpoint,(d=g.P(b,g.eM))&&Zfb(a,d,c,{itct:b?.clickTrackingParams}))):(a.G=!0,a.C&&c?(b=agb(a,b,c),a.player.publish("livestatedata",c)):b=E9(b),b?F9(a,b):F9(a)))}, K9=function(a,b,c){if(!a.A.isActive()){a.A.stop(); a.L++;var d=b?"heartbeat.net":"heartbeat.servererror";{let f=a.getVideoData();if(f.vU||b&&!g.CM(a.getVideoData())&&!J9(a)&&f.isLivePlayback)var e=!1;else a.heartbeatParams?.retries?e=a.heartbeatParams.retries:e=f.uU||5,e=a.L>=e}e?(g.Dx("heartbeatActionPlayerHalted",b?{enforcedPolicyToHaltOnNetworkFailure:!0}:hgb()),(b=a.getVideoData())&&b.isLivePlayback?a.player.ue(d,1,"Reprodu\u00e7\u00e3o de v\u00eddeo interrompida. Tente novamente.",c):a.player.ue(d,1,"Ocorreu um erro ao licenciar este v\u00eddeo.", c)):(F9(a,a.D.getValue()),g.Vj(a.D))}},hgb=function(a){var b={enforcedPolicyToHaltOnNetworkFailure:!1}; a&&(b.serializedServerContext=a.additionalLoggingData);return b},E9=function(a,b){return(a=Number(a?.pollDelayMs))?a:(b=Number(b?.pollDelayMs))?b:0},Zfb=function(a,b,c,d){var e=b&&b.videoId; return e?(a.player.MB(e,{autonav:"1",...(d||{})},void 0,!0,!0,b,g.QM(a.getVideoData())),H9("HEARTBEAT_ACTION_TRANSITION_REASON_HAS_NEW_STREAM_TRANSITION_ENDPOINT",c),!0):!1},H9=function(a,b){a={trigger:"HEARTBEAT_ACTION_TRIGGER_IMMEDIATE", reason:a};b&&(a.serializedServerContext=b.additionalLoggingData);g.Dx("heartbeatActionPlayerTransitioned",a)}; g.MZ.prototype.ny=g.da(15,function(a,b){this.app.ny(a,1,b)}); g.p_.prototype.ny=g.da(14,function(a,b=1,c){this.Hb({playerType:b}).Vs(a,void 0,c)}); var L9={ERAS:["BC","AD"],ERANAMES:["Before Christ","Anno Domini"],NARROWMONTHS:"JFMAMJJASOND".split(""),STANDALONENARROWMONTHS:"JFMAMJJASOND".split(""),MONTHS:"January February March April May June July August September October November December".split(" "),STANDALONEMONTHS:"January February March April May June July August September October November December".split(" "),SHORTMONTHS:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONESHORTMONTHS:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), WEEKDAYS:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),STANDALONEWEEKDAYS:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTWEEKDAYS:"Sun Mon Tue Wed Thu Fri Sat".split(" "),STANDALONESHORTWEEKDAYS:"Sun Mon Tue Wed Thu Fri Sat".split(" "),NARROWWEEKDAYS:"SMTWTFS".split(""),STANDALONENARROWWEEKDAYS:"SMTWTFS".split(""),SHORTQUARTERS:["Q1","Q2","Q3","Q4"],QUARTERS:["1st quarter","2nd quarter","3rd quarter","4th quarter"],AMPMS:["AM","PM"],DATEFORMATS:["EEEE, MMMM d, y", "MMMM d, y","MMM d, y","M/d/yy"],TIMEFORMATS:["h:mm:ss\u202fa zzzz","h:mm:ss\u202fa z","h:mm:ss\u202fa","h:mm\u202fa"],DATETIMEFORMATS:["{1} 'at' {0}","{1} 'at' {0}","{1}, {0}","{1}, {0}"],FIRSTDAYOFWEEK:6,WEEKENDRANGE:[5,6],FIRSTWEEKCUTOFFDAY:5}; L9={ERAS:["a.C.","d.C."],ERANAMES:["antes de Cristo","depois de Cristo"],NARROWMONTHS:"JFMAMJJASOND".split(""),STANDALONENARROWMONTHS:"JFMAMJJASOND".split(""),MONTHS:"janeiro fevereiro mar\u00e7o abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),STANDALONEMONTHS:"janeiro fevereiro mar\u00e7o abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),SHORTMONTHS:"jan. fev. mar. abr. mai. jun. jul. ago. set. out. nov. dez.".split(" "),STANDALONESHORTMONTHS:"jan. fev. mar. abr. mai. jun. jul. ago. set. out. nov. dez.".split(" "), WEEKDAYS:"domingo segunda-feira ter\u00e7a-feira quarta-feira quinta-feira sexta-feira s\u00e1bado".split(" "),STANDALONEWEEKDAYS:"domingo segunda-feira ter\u00e7a-feira quarta-feira quinta-feira sexta-feira s\u00e1bado".split(" "),SHORTWEEKDAYS:"dom. seg. ter. qua. qui. sex. s\u00e1b.".split(" "),STANDALONESHORTWEEKDAYS:"dom. seg. ter. qua. qui. sex. s\u00e1b.".split(" "),NARROWWEEKDAYS:"DSTQQSS".split(""),STANDALONENARROWWEEKDAYS:"DSTQQSS".split(""),SHORTQUARTERS:["T1","T2","T3","T4"],QUARTERS:["1\u00ba trimestre", "2\u00ba trimestre","3\u00ba trimestre","4\u00ba trimestre"],AMPMS:["AM","PM"],DATEFORMATS:["EEEE, d 'de' MMMM 'de' y","d 'de' MMMM 'de' y","d 'de' MMM 'de' y","dd/MM/y"],TIMEFORMATS:["HH:mm:ss zzzz","HH:mm:ss z","HH:mm:ss","HH:mm"],DATETIMEFORMATS:["{1} '\u00e0s' {0}","{1} '\u00e0s' {0}","{1}, {0}","{1}, {0}"],FIRSTDAYOFWEEK:6,WEEKENDRANGE:[5,6],FIRSTWEEKCUTOFFDAY:5}; var Wfb=["ATTESTATION_ERROR_UNKNOWN","ATTESTATION_ERROR_VM_NOT_INITIALIZED","ATTESTATION_ERROR_VM_NO_RESPONSE","ATTESTATION_ERROR_VM_TIMEOUT","ATTESTATION_ERROR_VM_INTERNAL_ERROR"],igb={300:"STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",301:"ALREADY_PINNED_ON_A_DEVICE",303:"STOPPED_BY_ANOTHER_PLAYBACK",304:"TOO_MANY_STREAMS_PER_USER",305:"TOO_MANY_STREAMS_PER_ENTITLEMENT",400:"VIDEO_NOT_FOUND",401:"GEO_FAILURE",402:"STREAMING_NOT_ALLOWED",403:"UNSUPPORTED_DEVICE",405:"VIDEO_FORBIDDEN",500:"PURCHASE_NOT_FOUND", 501:"RENTAL_EXPIRED",502:"PURCHASE_REFUNDED",5E3:"BAD_REQUEST",5001:"CGI_PARAMS_MISSING",5002:"CGI_PARAMS_MALFORMED",5100:"AUTHENTICATION_MISSING",5101:"AUTHENTICATION_MALFORMED",5102:"AUTHENTICATION_EXPIRED",5200:"CAST_TOKEN_MALFORMED",5201:"CAST_TOKEN_EXPIRED",5202:"CAST_TOKEN_FAILED",5203:"CAST_SESSION_VIDEO_MISMATCHED",5204:"CAST_SESSION_DEVICE_MISMATCHED",6E3:"INVALID_DRM_MESSAGE",7E3:"SERVER_ERROR",8E3:"RETRYABLE_ERROR"};g.J=A9.prototype;g.J.GT=L9.FIRSTDAYOFWEEK;g.J.HT=L9.FIRSTWEEKCUTOFFDAY; g.J.clone=function(){var a=new A9(this.date);a.GT=this.GT;a.HT=this.HT;return a}; g.J.getFullYear=function(){return this.date.getFullYear()}; g.J.getYear=function(){return this.getFullYear()}; g.J.getMonth=function(){return this.date.getMonth()}; g.J.getDate=function(){return this.date.getDate()}; g.J.getTime=function(){return this.date.getTime()}; g.J.getDay=function(){return this.date.getDay()}; g.J.getUTCFullYear=function(){return this.date.getUTCFullYear()}; g.J.getUTCMonth=function(){return this.date.getUTCMonth()}; g.J.getUTCDate=function(){return this.date.getUTCDate()}; g.J.getUTCDay=function(){return this.date.getDay()}; g.J.getUTCHours=function(){return this.date.getUTCHours()}; g.J.getUTCMinutes=function(){return this.date.getUTCMinutes()}; g.J.getTimezoneOffset=function(){return this.date.getTimezoneOffset()}; g.J.set=function(a){this.date=new Date(a.getFullYear(),a.getMonth(),a.getDate())}; g.J.setFullYear=function(a){this.date.setFullYear(a)}; g.J.setYear=function(a){this.setFullYear(a)}; g.J.setMonth=function(a){this.date.setMonth(a)}; g.J.setDate=function(a){this.date.setDate(a)}; g.J.setTime=function(a){this.date.setTime(a)}; g.J.setUTCFullYear=function(a){this.date.setUTCFullYear(a)}; g.J.setUTCMonth=function(a){this.date.setUTCMonth(a)}; g.J.setUTCDate=function(a){this.date.setUTCDate(a)}; g.J.add=function(a){if(a.years||a.months){var b=this.getMonth()+a.months+a.years*12,c=this.getYear()+Math.floor(b/12);b%=12;b<0&&(b+=12);a:{switch(b){case 1:var d=c%4!=0||c%100==0&&c%400!=0?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=c>=0&&c<=99?-1900:0,a=new Date((new Date(c,this.getMonth(),this.getDate(),12)).getTime()+a.days*864E5),this.setDate(1),this.setFullYear(a.getFullYear()+ b),this.setMonth(a.getMonth()),this.setDate(a.getDate()),z9(this,a.getDate()))}; g.J.equals=function(a){return!(!a||this.getYear()!=a.getYear()||this.getMonth()!=a.getMonth()||this.getDate()!=a.getDate())}; g.J.toString=function(){var a=this.getFullYear(),b=a<0?"-":a>=1E4?"+":"";return[b+y9(Math.abs(a),b?6:4),y9(this.getMonth()+1,2),y9(this.getDate(),2)].join("")+""}; g.J.valueOf=function(){return this.date.valueOf()};var Kfb=new g.RY("addUpcomingEventReminderEndpoint");var Lfb=new g.RY("removeUpcomingEventReminderEndpoint");new g.xm;new g.xm;var jgb=class extends g.XX{constructor(a){super({S:"div",wa:[{S:"button",Ib:["ytp-offline-slate-button","ytp-button"],wa:[{S:"div",fa:"ytp-offline-slate-button-icon",Va:"{{icon}}"},{S:"div",fa:"ytp-offline-slate-button-text",Va:"{{text}}"}]}]});this.Y=a;this.A=this.toggleButtonRenderer=null;(this.B=this.Ja("ytp-offline-slate-button"))&&this.ba(this.B,"click",this.D);this.hide()}D(){if(this.toggleButtonRenderer){let a=this.toggleButtonRenderer;a.isToggled?Nfb(this,a.toggledServiceEndpoint):Nfb(this, a.defaultServiceEndpoint);a.isToggled=!a.isToggled;B9(this)}}};var Xfb=class extends g.XX{constructor(a){super({S:"div",fa:"ytp-offline-slate",wa:[{S:"div",fa:"ytp-offline-slate-background"},{S:"div",fa:"ytp-offline-slate-bar",wa:[{S:"span",fa:"ytp-offline-slate-icon",wa:[{S:"svg",Aa:{fill:"#fff",height:"100%",viewBox:"0 0 24 24",width:"100%"},wa:[{S:"path",Aa:{d:"M16.94 6.91l-1.41 1.45c.9.94 1.46 2.22 1.46 3.64s-.56 2.71-1.46 3.64l1.41 1.45c1.27-1.31 2.05-3.11 2.05-5.09s-.78-3.79-2.05-5.09zM19.77 4l-1.41 1.45C19.98 7.13 21 9.44 21 12.01c0 2.57-1.01 4.88-2.64 6.54l1.4 1.45c2.01-2.04 3.24-4.87 3.24-7.99 0-3.13-1.23-5.96-3.23-8.01zM7.06 6.91c-1.27 1.3-2.05 3.1-2.05 5.09s.78 3.79 2.05 5.09l1.41-1.45c-.9-.94-1.46-2.22-1.46-3.64s.56-2.71 1.46-3.64L7.06 6.91zM5.64 5.45L4.24 4C2.23 6.04 1 8.87 1 11.99c0 3.13 1.23 5.96 3.23 8.01l1.41-1.45C4.02 16.87 3 14.56 3 11.99s1.01-4.88 2.64-6.54z"}}, {S:"circle",Aa:{cx:"12",cy:"12",r:"3"}}]}]},{S:"span",fa:"ytp-offline-slate-messages",wa:[{S:"div",fa:"ytp-offline-slate-main-text",Aa:{"aria-label":"{{label}}"},Va:"{{mainText}}"},{S:"div",fa:"ytp-offline-slate-subtitle-text",Va:"{{subtitleText}}"}]},{S:"span",fa:"ytp-offline-slate-buttons"}]},{S:"button",Ib:["ytp-offline-slate-close-button","ytp-button"],wa:[g.VN()]},{S:"button",Ib:["ytp-offline-slate-open-button","ytp-button"],wa:[g.UN()]}]});this.api=a;this.A=this.B=null;this.background=this.Ja("ytp-offline-slate-background"); this.D=this.Ja("ytp-offline-slate-bar");this.L=new g.wo(()=>{g.Co(this.D,"ytp-offline-slate-bar-fade")},15E3); this.X=!1;this.J=new g.wo(()=>{g.Co(this.element,"ytp-offline-slate-collapsed")},15E3); g.O(this,this.J);g.O(this,this.L);this.countdownTimer=new g.wo(this.W,1E3,this);this.ba(a,"presentingplayerstatechange",this.Z);this.ba(a,"livestatedata",this.Gf);this.ba(this.Ja("ytp-offline-slate-close-button"),"click",()=>{g.Co(this.element,"ytp-offline-slate-collapsed")}); this.ba(this.Ja("ytp-offline-slate-open-button"),"click",()=>{g.Eo(this.element,"ytp-offline-slate-collapsed")}); this.hide();a=this.getVideoData();a.getPlayerResponse()&&(a=a.getPlayerResponse().playabilityStatus)&&this.Gf(a);a=this.api.getPresentingPlayerType()===8&&!this.getVideoData().QB;var b=this.api.getPresentingPlayerType()===8;g.Fo(this.element,"ytp-offline-slate-premiere-trailer",a);g.Fo(this.element,"ytp-offline-slate-hide-background",b)}getPlayerType(){if(this.api.getPresentingPlayerType()===8)return 1}getVideoData(){return this.api.getVideoData({playerType:this.getPlayerType()})}Gf(a){var b=a?.liveStreamability?.liveStreamabilityRenderer?.offlineSlate; if(b){this.B=a;b=b.liveStreamOfflineSlateRenderer;b.canShowCountdown?this.W():C9(this,b);var c=a?.liveStreamability?.liveStreamabilityRenderer?.offlineSlate?.liveStreamOfflineSlateRenderer?.thumbnail;if(c){let d=0,e=null;c=c.thumbnails;for(let f=0;fd&&(d=c[f].width||0,e=c[f].url);e&&(this.background.style.backgroundImage=`url(${e})`)}else this.background.style.backgroundImage="";b.actionButtons?(this.A||(this.A=new jgb(this.api),this.A.j(this.Ja("ytp-offline-slate-buttons")), g.O(this,this.A)),Jfb(this.A,b.actionButtons&&b.actionButtons[0])):this.A&&Jfb(this.A,null);this.B=a}else this.B=null;this.Z()}Z(a){if(this.api.getPresentingPlayerType()===8)var b=!0;else{var c=this.api.getPlayerStateObject(),d=this.getVideoData();b=d.isLivePlayback&&(c.isBuffering()||c.pa(2)||c.pa(64));var e=d.autonavState===2&&c.pa(2);c=c.isPlaying()&&!g.HM(d)&&!this.api.isAtLiveHead(void 0,!0);b=b&&!c&&!e}b&&this.B?this.C?a?.qd(2)&&!this.getVideoData().QB&&(g.Eo(this.element,"ytp-offline-slate-collapsed"), this.J.stop(),g.Eo(this.D,"ytp-offline-slate-bar-fade"),this.L.start()):(this.show(),this.J.start(),this.api.publish("offlineslatestatechange"),this.X&&this.api.ny()):this.C&&(this.hide(),this.api.publish("offlineslatestatechange"))}W(){var a=this.B?.liveStreamability?.liveStreamabilityRenderer?.offlineSlate?.liveStreamOfflineSlateRenderer;if(a){var b=Math.floor(g.Sa()/1E3),c=a.canShowCountdown&&Number(a.scheduledStartTime);!c||c<=b?(C9(this,a),this.countdownTimer.stop()):(C9(this,a,g.ON(c-b)),this.countdownTimer.rd())}}oa(){this.countdownTimer.dispose(); this.countdownTimer=null;super.oa()}};var $fb=class{constructor(a,b){var c=(0,g.T)();this.module="heartbeat";this.trigger=a;this.j=b;this.B=c}A(a){return this.trigger&&a.trigger?this.module===a.module&&this.trigger===a.trigger&&this.j===a.j:!1}isExpired(){return(0,g.T)()-this.B>6E4}toString(){return`${this.module}:${this.trigger}:${this.j}`}};var cgb=/^GLS\/1.0 (\d+) (\w+).*?\r\n\r\n([\S\s]*)$/;g.LU("heartbeat",class extends g.h_{constructor(a){super(a);this.J=!1;this.L=0;this.G=!1;this.A=new g.wo(()=>{Ufb(this)},0); this.j=this.heartbeatParams=null;this.C=!1;this.D=new g.Uj(1E3,6E4,1);this.sequenceNumber=0;this.offlineSlate=null;this.Z=new g.Cx(void 0);this.attestationResponse=Promise.resolve(void 0);this.X=Promise.resolve(void 0);this.utcOffsetMinutes=-(new A9).getTimezoneOffset();this.B=new g.BZ(this);g.O(this,this.A);g.O(this,this.B);Sfb(this);Yfb(this);this.B.ba(a,"heartbeatparams",this.tP);this.B.ba(a,"presentingplayerstatechange",this.ma);this.B.ba(a,"videoplayerreset",this.W);this.B.ba(a,g.bO("heartbeat"), this.onCueRangeEnter);this.C&&this.j&&agb(this,void 0,this.j);var b=new g.eO(1E3,0x7ffffffffffff,{priority:1,namespace:"heartbeat"}),c=new g.eO(0x8000000000000,0x8000000000000,{id:"stream_end",priority:1,namespace:"heartbeat"});a.aj([b,c]);bgb(this)}oa(){I9(this);this.player.ti("heartbeat");super.oa()}onCueRangeEnter(){this.J=!0;F9(this,G9(this))}tP(a){this.heartbeatParams=a;F9(this,G9(this))}ma(a){if(this.player.getPresentingPlayerType()!==8&&this.j?.status!=="UNPLAYABLE")if(a.state.pa(2)||a.state.pa(64))I9(this), this.C&&(this.J=!0,F9(this,G9(this,1E3)));else{let b=this.player.V().experiments.Ca().j.va(g.jOa);(a.state.pa(1)||a.state.pa(8)||b&&a.state.pa(4))&&F9(this,G9(this))}}W(){this.player.getPresentingPlayerType()!==3&&F9(this,G9(this))}getPlayerType(){if(this.player.getPresentingPlayerType()===8)return 1}getVideoData(){return this.player.getVideoData({playerType:this.getPlayerType()})}qB(a){switch(a){case 4:case 3:return!1}return!0}If(a){var b="LICENSE",c=Pfb(a);if(c)return c.reason||g.cV[b]||"";if(a= a.match(cgb))if(a=Number(a[1]))b=(b=igb[a.toString()])?b:"LICENSE";return g.cV[b]||""}DI(){return!!this.offlineSlate&&this.offlineSlate.C}});})(_yt_player);