(function(g){var window=this;'use strict';var nTE=function(C,b,h){g.R(function(N){C.j=g.mt(b,h);g.SV(N)})},cB=function(C){C.isActive()||C.start()},t90=function(C,b){return b?C.captionsInitialState:"CAPTIONS_INITIAL_STATE_UNKNOWN"},T2D=function(C){return g.Oa(C)||C.D("web_enable_caption_language_preference_stickiness")},B2j=function(C,b){var h=new g.gF; h.languageCode=C.languageCode;h.languageName=C.languageName;h.name=C.name;h.displayName=C.displayName;h.kind=C.kind;h.isDefault=!1;h.j=C.j;h.isTranslateable=C.isTranslateable;h.vssId=C.vssId;h.url=C.url;h.translationLanguage=b;C.xtags&&(h.xtags=C.xtags);C.captionId&&(h.captionId=C.captionId);return h},Iqj=function(C,b){var h,N,p; return g.R(function(P){if(P.j==1)return h=C+"|"+b,g.J(P,g.wm(),2);if(P.j!=3){N=P.K;if(!N)throw g.zn("gct");return g.J(P,g.H7(N),3)}p=P.K;return P.return(p.get("captions",h))})},xNd=function(C,b,h){Iqj(C,b).then(function(N){N&&h(N.trackData,new g.gF(N.metadata))})},bRE=function(C){if(!whD.test(C))throw Error("'"+C+"' is not a valid hex color"); C.length==4&&(C=C.replace(CF$,"#$1$1$2$2$3$3"));C=C.toLowerCase();C=parseInt(C.slice(1),16);return[C>>16,C>>8&255,C&255]},h4j=function(){var C=void 0; C=C===void 0?{}:C;var b="suggest_correction"in g.MoE?g.MoE.suggest_correction:"Edit caption";b=b||"";var h={},N;for(N in C){h={OD:h.OD};h.OD=N;var p=function(P){return function(){return String(C[P.OD])}}(h); b=b.replace(new RegExp("\\$\\{"+h.OD+"\\}","gi"),p);b=b.replace(new RegExp("\\$"+h.OD,"gi"),p)}return b},Nkh=function(){return g.R1("yt-player-caption-display-settings")},kx=function(){this.segments=[]},gvE=function(C,b){var h=g.c5(C.segments,b); h>=0||h<0&&(-h-1)%2===1||(h=-h-1,h>0&&b-C.segments[h-1]===1&&h0&&b-C.segments[h-1]===1?C.segments[h-1]=b:h0?N.postBody=g.pY(p,g.Dp):N.postBody=(0,g.e4)([120,0])}C.G&&(N.responseType="arraybuffer");var P=++C.N2,c=(0,g.fB)();C.N=g.rJ(h,N,3,100).then(function(e){if(C.policy.Y5&&P%100===1){var L=(0,g.fB)();C.player.jp("caprsp",{rn:P,ms:L-c,kb:(e.xhr.responseText.length/1024).toFixed()})}a:{e=e.xhr;C.HE();if(C.K){var Z=!(C.G?e.response: e.responseText)||e.status>=400;if(L=g.m8W(e)){e=g.i0(C.K,C.policy,{});C.K.p5(e,L);jVU(C,C.K);break a}Z?C.player.jp("capfail",{status:e.status}):(C.player.FX().Jy("fcb_r"),L=C.K.UX[0].yz,C.L!=null&&C.W!==L&&(Z=C.K.UX[0],C.G?C.L(e.response,(Z.startTime+C.player.Z9())*1E3):C.L(e.responseText,(Z.startTime+C.player.Z9())*1E3),C.W=L))}C.K=null;C.N=null}}).jX(function(e){C.K=null; C.N=null;var L;C.player.jp("capfail",{rn:P,status:(L=e.xhr)==null?void 0:L.status})}); C.K=b;gvE(C.X,C.K.UX[0].yz)},ey=function(C,b){g.fP.call(this,b); this.j=C;this.Z=b;this.N=null;this.W=!1;this.logger=new g.ty("caps");this.J=g.Va(this.Z.Y())&&!this.j.isManifestless},kAD=function(C,b){var h=[],N; for(N in C.j.j)if(C.j.j.hasOwnProperty(N)){var p=C.j.j[N];if(g.yi(p,b||null)){var P=p.info.id,c=P,e="."+P,L="",Z="";if(p=p.info.captionTrack)P=p.languageCode,c=p.displayName,e=p.vssId,L=p.kind,Z=p.id;else{p=P;var Y=g.tH0.get(p);Y==null&&(Y=c8h[p]||c8h[p.replace(/-/g,"_")],g.tH0.set(p,Y));p=Y;c=p||c}h.push(new g.gF({id:N,languageCode:P,languageName:c,is_servable:!0,is_default:!0,is_translateable:!1,vss_id:e,kind:L,captionId:Z}))}}return h},e4E=function(C,b){return b!=null&&b in C.j.j?C.j.j[b]:null}, LgE=function(C,b,h){var N=[],p; for(p in C.j.j)if(C.j.j.hasOwnProperty(p)){var P=C.j.j[p];if(g.yi(P,h||null)){var c=P.info.captionTrack;c&&c.languageCode===b&&N.push(P)}}return N.length?N[0]:null},Lq=function(C,b,h,N,p,P,c,e,L,Z){var Y=Z.isInline()&&!0,a={}; Object.assign(a,b);Object.assign(a,C.params);Object.assign(a,h);var l={};Object.assign(l,b.nK);C.params.nK&&Object.assign(l,C.params.nK);Object.assign(l,h.nK);Y&&(a.windowOpacity=.6,l.backgroundOpacity=0);a.nK=l;var F=a.P2===1,G=[{B:"span",C:"captions-text",T:{style:"word-wrap: normal; display: block;"}}],V,q,f;(e=e.Fo("caption_edit_on_hover")&&((V=Z.getVideoData().getPlayerResponse())==null?void 0:(q=V.captions)==null?void 0:(f=q.playerCaptionsTracklistRenderer)==null?void 0:f.openTranscriptCommand))&& G.unshift({B:"button",C:"caption-edit",T:{tabindex:"0","aria-label":h4j()},U:[{B:"svg",T:{fill:"#e3e3e3",height:"100%",viewBox:"5 5 38 38",width:"100%"},U:[{B:"path",T:{d:"M9 39h2.2l24.25-24.25-1.1-1.1-1.1-1.1L9 36.8Zm-3 3v-6.4L35.4 6.2q.85-.85 2.12-.82 1.27.02 2.12.87L41.8 8.4q.85.85.85 2.1t-.85 2.1L12.4 42Zm33.5-31.55L37.45 8.4Zm-4.05 4.3-1.1-1.1-1.1-1.1 2.2 2.2Z"}}]}]});g.n.call(this,{B:"div",C:"caption-window",T:{id:"caption-window-"+C.id,dir:F?"rtl":"ltr",tabindex:"0",lang:a.lang},U:G});var y= this;this.J=[];this.sX=!1;this.K=C;this.Df=this.Qz=null;this.playerWidth=P;this.playerHeight=c;this.L=null;this.maxWidth=P*.96;this.maxHeight=c*.96;this.j=a;this.IV=h;this.N2=b;this.X=this.dO("captions-text");this.SC=this.X.style.getPropertyValue("box-decoration-break")!==""||this.X.style.getPropertyValue("-webkit-box-decoration-break")!=="";this.t4=ZRC(N,p,P,c);this.AZ=L;e&&(this.W=this.dO("caption-edit"),this.S(this.W,"click",function(){y.AZ()})); this.type=0;this.m6=this.t4*Yij(l);this.G$=Y;C=new g.IY(this.element,!0);g.D(this,C);C.subscribe("dragstart",this.rd,this);C.subscribe("dragmove",this.MA,this);C.subscribe("dragend",this.yN,this);this.kh=this.Yh=this.Vz=this.zi=0;C="";this.j.windowOpacity&&(C=bRE(this.j.windowColor),C="rgba("+C[0]+","+C[1]+","+C[2]+","+this.j.windowOpacity+")");b={"background-color":C,display:this.j.isVisible===!1?"none":"","text-align":aZC[this.j.textAlign]};this.SC&&(b["border-radius"]=C?this.m6/8+"px":"");(this.N= this.K.params.P2===2||this.K.params.P2===3)&&lZo(this,this.element);g.LV(this.element,b);if(Y){var u;(u=this.element.parentElement)==null||u.style.setProperty("--caption-window-color",C)}switch(this.j.W5){case 0:case 1:case 2:g.j6(this.element,"ytp-caption-window-top");break;case 6:case 7:case 8:g.j6(this.element,"ytp-caption-window-bottom")}},lZo=function(C,b){var h="vertical-rl"; C.j.lw===1&&(h="vertical-lr");g.le&&(h=h==="vertical-lr"?"tb-lr":"tb-rl");g.LV(b,"-o-writing-mode",h);g.LV(b,"-webkit-writing-mode",h);g.LV(b,"writing-mode",h);g.LV(b,"text-orientation","upright");g.j6(b,"ytp-vertical-caption");C.K.params.P2===3&&(g.LV(b,"text-orientation",""),g.LV(b,"transform","rotate(180deg)"))},Yij=function(C){var b=1+.25*(C.fontSizeIncrement||0); if(C.offset===0||C.offset===2)b*=.8;return b},ovd=function(C,b){var h={},N=b.background?b.background:C.j.nK.background; if(b.backgroundOpacity!=null||b.background){var p=b.backgroundOpacity!=null?b.backgroundOpacity:C.j.nK.backgroundOpacity;N=bRE(N);h.background="rgba("+N[0]+","+N[1]+","+N[2]+","+p+")";C.SC&&(h["box-decoration-break"]="clone",h["border-radius"]=C.m6/8+"px")}if(b.fontSizeIncrement!=null||b.offset!=null)h["font-size"]=C.t4*Yij(b)+"px";N=1;p=b.color||C.j.nK.color;if(b.color||b.textOpacity!=null)p=bRE(p),N=b.textOpacity==null?C.j.nK.textOpacity:b.textOpacity,p="rgba("+p[0]+","+p[1]+","+p[2]+","+N+")", h.color=p,h.fill=p;var P=b.charEdgeStyle;P===0&&(P=void 0);if(P){p="rgba(34, 34, 34, "+N+")";var c="rgba(204, 204, 204, "+N+")";b.vJ&&(c=p=b.vJ);var e=C.t4/16/2,L=Math.max(e,1),Z=Math.max(2*e,1),Y=Math.max(3*e,1),a=Math.max(5*e,1);N=[];switch(P){case 4:for(;Y<=a;Y+=e)N.push(Z+"px "+Z+"px "+Y+"px "+p);break;case 1:Z=window.devicePixelRatio>=2?.5:1;for(P=L;P<=Y;P+=Z)N.push(P+"px "+P+"px "+p);break;case 2:N.push(L+"px "+L+"px "+c);N.push("-"+L+"px -"+L+"px "+p);break;case 3:for(Y=0;Y<5;Y++)N.push("0 0 "+ Z+"px "+p)}h["text-shadow"]=N.join(", ")}p="";switch(b.fontFamily){case 1:p='"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace';break;case 2:p='"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif';break;case 3:p='"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace';break;case 5:p='"Comic Sans MS", Impact, Handlee, fantasy';break;case 6:p='"Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive';break;case 7:p=g.WQ()? '"Carrois Gothic SC", sans-serif-smallcaps':'Arial, Helvetica, Verdana, "Marcellus SC", sans-serif';break;case 0:case 4:p='"YouTube Noto", Roboto, Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif'}p&&(h["font-family"]=p);p=b.offset;p==null&&(p=C.j.nK.offset);switch(p){case 0:h["vertical-align"]="sub";break;case 2:h["vertical-align"]="super"}b.fontFamily===7&&(h["font-variant"]="small-caps");b.bold&&(h["font-weight"]="bold");b.italic&&(h["font-style"]="italic");b.underline&&(h["text-decoration"]= "underline");b.r4h&&(h.visibility="hidden");b.Hv===1&&C.N&&(h["text-combine-upright"]="all",h["text-orientation"]="mixed",p=g.d_||g.Sn,C.K.params.P2===3?h.transform=p?"rotate(90deg)":"rotate(180deg)":p&&(h.transform="rotate(-90deg)"));if(b.Ea===1||b.Ea===2||b.Ea===3||b.Ea===4||b.Ea===5)if(g.d_)h["font-weight"]="bold";else switch(h["text-emphasis-style"]="filled circle",h["text-emphasis-color"]="currentcolor",h["webkit-text-emphasis"]="filled circle",b.Ea){case 4:case 3:h["text-emphasis-position"]= "under left";h["webkit-text-emphasis-position"]="under left";break;case 5:case 2:h["text-emphasis-position"]="over right",h["webkit-text-emphasis-position"]="over right"}return h},Z3=function(C){C=C.split("px"); return C.length>0?(C=Number(C[0]))?C:0:0},Fge=function(C){C.L=g.wk("SPAN"); g.LV(C.L,{display:"block"});g.j6(C.L,"caption-visual-line");C.X.appendChild(C.L)},GAh=function(C,b){var h=g.wk("SPAN"); g.LV(h,{display:"inline-block","white-space":"pre-wrap"});g.LV(h,ovd(C,b));h.classList.add("ytp-caption-segment");C.L.appendChild(h);h.previousElementSibling&&(g.LV(h.previousElementSibling,{"border-top-right-radius":"0","border-bottom-right-radius":"0"}),g.LV(h,{"border-top-left-radius":"0","border-bottom-left-radius":"0"}));return h},Si0=function(C,b,h){C.sX=C.sX||!!h; var N={};Object.assign(N,C.j.nK);Object.assign(N,h||b.j);Object.assign(N,C.IV.nK);(h=!C.L)&&Fge(C);for(var p=C.Qz&&C.Df&&g.rk(N,C.Df)?C.Qz:GAh(C,N),P=typeof b.text==="string",c=P?b.text.split("\n"):[b.text],e=0;e0||!b.append,Z=c[e];L&&!h?(Fge(C),p=GAh(C,N)):L&&h&&(h=!1);Z&&(p.appendChild(P?g.CM(Z):Z),P||Z.tagName!=="RUBY"||Z.childElementCount!==4||g.d_||!g.YX(Z.children[2],"text-emphasis")||(L=C.N?"padding-right":"padding-top",g.YX(Z.children[2],"text-emphasis-position")&&(L= C.N?"padding-left":"padding-bottom"),g.TA?g.LV(p,L,"1em"):g.LV(p,L,"0.5em")))}C.Df=N;C.Qz=p;C.J.push(b)},ZRC=function(C,b,h,N){var p=b/360*16; b>=C&&(C=640,N>h*1.3&&(C=480),p=h/C*16);return p},z4E=function(){this.N=this.time=this.mode=this.K=0; this.X=new $eD(this);this.G=new $eD(this);this.j=[];this.clear()},VeE=function(C,b,h){if(C===255&&b===255||!C&&!b)return{eP:C, RT:b,result:0};C=HRD[C];b=HRD[b];if(C&128){var N;if(N=!(b&128))N=b,N=h.bF()&&h.RT===N;if(N)return{eP:C,RT:b,result:1}}else if(b&128&&1<=C&&C<=31)return{eP:C,RT:b,result:2};return{eP:C,RT:b,result:3}},qiC=function(C,b,h,N){b===255&&h===255||!b&&!h?(++C.N===45&&C.reset(),C.X.K.clear(),C.G.K.clear()):(C.N=0,MeD(C.X,b,h,N))},meD=function(C,b){C.j.sort(function(p,P){var c=p.time-P.time; return c===0?p.order-P.order:c}); for(var h=g.z(C.j),N=h.next();!N.done;N=h.next())N=N.value,C.time=N.time,N.type===0?qiC(C,N.Xf,N.wR,b):N.type===1&&C.K&496&&MeD(C.G,N.Xf,N.wR,b);C.j.length=0},Yx=function(){this.type=0},aB=function(){this.state=this.RT=this.eP=0},fZe=function(){this.timestamp=this.j=0},l5=function(C){this.G=C; this.N=[];this.j=this.K=this.row=0;this.style=new Yx;for(C=this.X=0;C<=15;C++){this.N[C]=[];for(var b=0;b<=32;b++)this.N[C][b]=new fZe}},oB=function(C,b){if(C.style.type===3){for(var h=0,N=0,p=C.G.time+0,P="",c="",e=p,L=1;L<=15;++L){for(var Z=!1,Y=N?N:1;Y<=32;++Y){var a=C.N[L][Y]; if(a.j!==0){h===0&&(h=L,N=Y);Z=String.fromCharCode(a.j);var l=a.timestamp;l=2&&C.K>1&&(--C.K,Fa(C).j=0); var N=Fa(C);N.timestamp=C.G.time+0;N.j=J8j(b,h);C.K<32&&C.K++},ud$=function(C,b,h,N){for(var p=0;p0?C.j:1; C.K=1;Sy(C,0,15)},QV0=function(C){this.N=C; this.G=0;this.style=new Yx;this.W=new l5(this.N);this.J=new l5(this.N);this.text=new l5(this.N);this.K=this.W;this.X=this.J;this.j=this.K},Uej=function(C,b,h){var N=C.K,p=!1; switch(C.style.get()){case 4:case 1:case 2:C.style.get()===4&&N.j>0||(oB(N,h),R4p(C.K),R4p(C.X),N.row=15,N.j=b,p=!0)}C.style.set(3);C.j=N;C.j.style=C.style;C.N.mode=1<b?(oB(N,h),Sy(N,N.row-N.j,b)):N.row>5&1]; C=h&16?((h&14)>>1)*4:0;h=b.j;switch(b.style.get()){case 4:N=h.row;break;case 3:if(N!==h.row){if(N0&&(b+=P,p-=P)):(P=P+p-c,P>0&&(p-=P));Sy(h,b,p)}}h.row=N;h.K=C+1}else switch(p&7){case 1:switch(h&112){case 32:GJ(b.j,0,32);break a;case 48:h===57?(N=b.j,Fa(N).j=0,N.K<32&&N.K++):GJ(b.j,1,h&15)}break;case 2:h&32&&GJ(b.j,2,h&31);break;case 3:h&32&&GJ(b.j,3,h&31);break;case 4:case 5:if(32<=h&&h<=47)switch(h){case 32:XEe(b); break;case 33:N=b.j;N.K>1&&(--N.K,Fa(N).j=0);break;case 36:N=b.j;b=Fa(N);for(C=0;C<=15;C++)for(h=0;h<=32;h++)if(N.N[C][h]===b){for(;h<=32;h++)N.N[C][h].reset();break}break;case 37:Uej(b,2,N);break;case 38:Uej(b,3,N);break;case 39:Uej(b,4,N);break;case 40:GJ(b.j,0,32);break;case 41:b.style.set(2);b.j=b.K;b.j.j=0;b.j.style=b.style;b.N.mode=1<32&&(N.K=32)}}},sV$=function(){},$x=function(C,b,h,N,p,P,c){P=P===void 0?!1:P; c=c===void 0?null:c;g.hk.call(this,C,C+b,{priority:h,namespace:"captions"});this.windowId=N;this.text=p;this.append=P;this.j=c},vvo=function(C,b,h,N,p,P,c){var e=P[0],L=c[e.getAttribute("p")]; if(L.Dv===1){var Z=P[1],Y=P[2];P=P[3];e.getAttribute("t");Z.getAttribute("t");Y.getAttribute("t");P.getAttribute("t");e.getAttribute("p");Z.getAttribute("p");P.getAttribute("p");c=c[Y.getAttribute("p")];e=ORD(e.textContent,Z.textContent,Y.textContent,P.textContent,c);return new $x(C,b,p,h,e,N,L)}switch(L.Dv){case 9:case 10:L.Ea=1;break;case 11:L.Ea=2;break;case 12:L.Ea=3;break;case 13:L.Ea=4;break;case 14:L.Ea=5}return new $x(C,b,p,h,e.textContent||"",N,L)},ORD=function(C,b,h,N,p){var P=g.WQ(),c= P?g.wk("DIV"):g.wk("RUBY"),e=g.wk("SPAN"); e.textContent=C;c.appendChild(e);C=P?g.wk("DIV"):g.wk("RP");C.textContent=b;c.appendChild(C);b=P?g.wk("DIV"):g.wk("RT");b.textContent=h;c.appendChild(b);h=p.Dv;if(h===10||h===11||h===12||h===13||h===14)if(g.LV(b,"text-emphasis-style","filled circle"),g.LV(b,"text-emphasis-color","currentcolor"),g.LV(b,"webkit-text-emphasis","filled circle"),p.Dv===11||p.Dv===13)g.LV(b,"webkit-text-emphasis-position","under left"),g.LV(b,"text-emphasis-position","under left");h=!0;if(p.Dv===4||p.Dv===7||p.Dv===12|| p.Dv===14)g.LV(c,"ruby-position","over"),g.LV(c,"-webkit-ruby-position","before");else if(p.Dv===5||p.Dv===6||p.Dv===11||p.Dv===13)g.LV(c,"ruby-position","under"),g.LV(c,"-webkit-ruby-position","after"),h=!1;p=P?g.wk("DIV"):g.wk("RP");p.textContent=N;c.appendChild(p);P&&(N=h,g.LV(c,{display:"inline-block",position:"relative"}),P=c.firstElementChild.nextElementSibling,g.LV(P,"display","none"),P=P.nextElementSibling,g.LV(P,{"font-size":"0.5em","line-height":"1.2em","text-align":"center",position:"absolute", left:"50%",transform:"translateX(-50%)",width:"400%"}),g.LV(c.lastElementChild,"display","none"),N?(g.LV(c,"padding-top","0.6em"),g.LV(P,"top","0")):(g.LV(c,"padding-bottom","0.6em"),g.LV(P,"bottom","0")));return c},zJ=function(){g.O.apply(this,arguments)},HB=function(C,b,h,N,p){g.hk.call(this,C,C+b,{priority:h, namespace:"captions"});this.id=N;this.params=p;this.j=[]},Dee=function(C){var b="_"+V5++; return new HB(0,0x8000000000000,0,b,C)},Mk=function(C){zJ.call(this); this.N=C;this.pens={};this.J={};this.L={};this.X="_"+V5++;this.W={};this.K=this.j=null;this.G=!0},qk=function(C,b){C=C.getAttribute(b); if(C!=null)return Number(C)},m4=function(C,b){C=C.getAttribute(b); if(C!=null)return C==="1"},fq=function(C,b){C=qk(C,b); return C!==void 0?C:null},y5=function(C,b){C=C.getAttribute(b); if(C!=null)return As.test(C),C},deC=function(C,b){var h={},N=b.getAttribute("ws"); Object.assign(h,N?C.L[N]:C.N);C=fq(b,"mh");C!=null&&(h.nG=C);C=fq(b,"ju");C!=null&&(h.textAlign=C);C=fq(b,"pd");C!=null&&(h.P2=C);C=fq(b,"sd");C!=null&&(h.lw=C);C=y5(b,"wfc");C!=null&&(h.windowColor=C);b=qk(b,"wfo");b!==void 0&&(h.windowOpacity=b/255);return h},WgI=function(C,b){var h={},N=b.getAttribute("wp"); N&&Object.assign(h,C.J[N]);C=fq(b,"ap");C!=null&&(h.W5=C);C=qk(b,"cc");C!=null&&(h.qk=C);C=qk(b,"ah");C!=null&&(h.uY=C);C=qk(b,"rc");C!=null&&(h.h$=C);b=qk(b,"av");b!=null&&(h.Dm=b);return h},Evd=function(C,b,h,N){var p={}; Object.assign(p,WgI(C,b));Object.assign(p,deC(C,b));N?g.rk(p,C.N)?(N=C.X,p=C.N):N="_"+V5++:N=b.getAttribute("id")||"_"+V5++;C=qk(b,"t")+h;b=qk(b,"d")||0x8000000000000;if(p.P2===2||p.P2===3)h=p.h$,p.h$=p.qk,p.qk=h;return new HB(C,b,0,N,p)},r5=function(C){zJ.call(this); this.G=C;this.j=new Map;this.N=new Map;this.X=new Map;this.K=new Map},i5=function(C){C=g.cE(Math.round(C),0,16777215).toString(16).toUpperCase(); return"#000000".substring(0,7-C.length)+C},nvI=function(C,b,h,N,p){N===0&&(N=0x8000000000000); var P={};b.wpWinPosId&&Object.assign(P,C.N.get(b.wpWinPosId));b.wsWinStyleId&&Object.assign(P,C.X.get(b.wsWinStyleId));C=b.rcRowCount;C!==void 0&&(P.h$=C);b=b.ccColCount;b!==void 0&&(P.qk=b);if(P.P2===2||P.P2===3)b=P.h$,P.h$=P.qk,P.qk=b;return new HB(h,N,0,p,P)},Js=function(C,b,h){g.fP.call(this,C); this.videoData=b;this.audioTrack=h;this.G=b.i6},u5=function(C,b,h,N,p,P,c,e,L,Z){Lq.call(this,C,b,h,N,p,P,c,e,L,Z); this.type=1},RB=function(C,b,h){this.trackData=C; this.W=h;this.version=this.G=this.N=this.byteOffset=0;this.K=[];this.j=new DataView(this.trackData)},Q5=function(C){var b=C.byteOffset; C.byteOffset+=1;return C.j.getUint8(b)},U6=function(C){var b=C.byteOffset; C.byteOffset+=4;return C.j.getUint32(b)},Xa=function(C,b){zJ.call(this); this.K=C;this.N=b;this.track=this.N.languageName==="CC3"?4:0;this.j=new z4E;this.j.K=1<1)return!1;Q5(C);Q5(C);Q5(C);return!0},Kq=function(C,b,h,N,p,P,c,e,L,Z){Lq.call(this,C,b,h,N,p,P,c,e,L,Z); var Y=this;this.type=2;this.nO=[];this.KO=this.V=this.rO=0;this.q2=NaN;this.ob=0;this.Yg=null;this.CO=new g.wl(this.c86,433,this);this.W&&(Z.createClientVe(this.W,this,167342),this.S(this.W,"click",function(){Z.logClick(Y.W)}),C=new g.IY(this.element,!0),g.D(this,C),C.subscribe("hoverstart",function(){Z.logVisibility(Y.W,!0)},this)); g.j6(this.element,"ytp-caption-window-rollup");g.D(this,this.CO);g.LV(this.element,"overflow","hidden")},BkE=function(C,b){if(!b)return""; C.N&&C.K.params.lw!==1&&(b*=-1);return"translate"+(C.N?"X":"Y")+"("+b+"px)"},IZe=function(C){C.nO=Array.from(document.getElementsByClassName("caption-visual-line")); for(var b=C.K.params.h$,h=0,N=0,p=C.nO.length-1;h-1;){var P=C.nO[p];N+=C.N?P.offsetWidth:P.offsetHeight;h++;p--}C.V=N;b=Math;h=b.max;isNaN(C.q2)&&((N=C.j.qk)?(p=g.wk("SPAN"),g.PP(p,"\u2013".repeat(N)),g.LV(p,ovd(C,C.j.nK)),C.X.appendChild(p),C.q2=p.offsetWidth,C.X.removeChild(p)):C.q2=0);N=C.X;C.KO=h.call(b,C.q2,C.ob,(C.N?N.offsetHeight:N.offsetWidth)+1)},xeD=function(C,b){IZe(C); var h=C.nO.reduce(function(P,c){return(C.N?c.offsetWidth:c.offsetHeight)+P},0); h=C.V-h;if(h!==C.rO){var N=h>0&&C.rO===0,p=h0?C:10},hXE=function(C,b){C.QO=function(h,N){if(h.info.X){var p=h; if(C.L2.length>0){for(p=C.L2.shift();C.L2.length>0;)p=g.dd(p,C.L2.shift());p=g.dd(p,h)}if(p){h=p;try{var P=g.Ww(h)*1E3}catch(Z){P=h.info.startTime*1E3}try{var c=g.oeW(h)*1E3}catch(Z){c=h.info.duration*1E3}if(P<0||c<0)P<0&&(P=h.info.startTime*1E3),c<0&&(c=h.info.duration*1E3);h.info.startTime=P/1E3;h.info.c7=P/1E3;h.info.duration=c/1E3;h.info.W=c/1E3;P=C.xW(p);c=P.yz;P={formatId:P.formatId,startTimeMs:P.startTimeMs,durationMs:P.durationMs,vT:c,KX:c};c=Cnp(C.Pb,P.startTimeMs);var e=(h=c>=0?C.Pb[c]: null)?h.startTimeMs+h.durationMs:0,L=P.startTimeMs+P.durationMs;!h||P.startTimeMs-e>C.j?C.Pb.splice(c+1,0,P):(h.durationMs=Math.max(e,L)-h.startTimeMs,h.KX=Math.max(h.KX,P.KX));N(C.Pb);N=p.W7();bMD(C.K,N.buffer.slice(N.byteOffset,N.byteLength+N.byteOffset),b,p.info.c7)}else C.logger.j(350058965,"Empty slice")}else C.L2.push(h)}; C.Z.addEventListener("sabrCaptionsDataLoaded",C.QO)},Cnp=function(C,b){C=g.c5(C,{startTimeMs:b},function(h,N){return h.startTimeMs-N.startTimeMs}); return C>=0?C:-C-2},NQo=function(C,b){g.fP.call(this,b); this.j=C;this.Z=b;this.logger=new g.ty("caps");this.N=this.W=null;this.J=new wEE(this.Z,this,this.logger,this.j.yV)},bMD=function(C,b,h,N){C.logger.debug(function(){return"SABR captions data received for "+N}); C.W?C.N==null?C.logger.j(350058965,"Null loaded track meta data at captions data received"):h.rL(b,C.N,N*1E3):C.logger.j(350058965,"Null Representation at captions data received")},g9o=function(C,b){var h=[],N; for(N in C.j.j)if(C.j.j.hasOwnProperty(N)){var p=C.j.j[N];if(g.yi(p,b||null)){var P=p.info.id,c=P,e="."+P,L="",Z="";if(p=p.info.captionTrack)P=p.languageCode,c=p.displayName,e=p.vssId,L=p.kind,Z=p.id;h.push(new g.gF({id:N,languageCode:P,languageName:c,is_servable:!0,is_default:!0,is_translateable:!1,vss_id:e,kind:L,captionId:Z}))}}return h},pPj=function(C,b,h){var N=[],p; for(p in C.j.j)if(C.j.j.hasOwnProperty(p)){var P=C.j.j[p];if(g.yi(P,h||null)){var c=P.info.captionTrack;c&&c.languageCode===b&&N.push(P)}}return N.length?N[0]:null},PnU=function(C,b){if(!g.POW(C)||C.j!=null&&g.Va(b.Y())&&!C.j.isManifestless&&C.j.j.rawcc!=null)return!1; b=!!C.j&&C.j.isManifestless&&Object.values(C.j.j).some(function(h){return g.yi(h,"386")}); C=!!C.j&&!C.j.isManifestless&&g.rA6(C.j);return b||C},s6=function(){zJ.call(this)},j4$=function(C,b,h,N,p,P,c,e,L){switch(c.tagName){case "b":e.bold=!0; break;case "i":e.italic=!0;break;case "u":e.underline=!0}for(var Z=0;Z0,g.A8(e)?void 0:e),L.push(Y),p.j.push(Y);else{var a={};Object.assign(a,e);j4$(C,b,h,N,p,!0,Y,a,L)}}},cWj=function(C){var b=C.split(":"); C=0;b=g.z(b);for(var h=b.next();!h.done;h=b.next())C=C*60+Number(h.value);return C*1E3},kzo=function(C,b,h,N){N=Object.assign({nG:0},N); return new HB(C,b,h,"_"+V5++,N)},O6=function(C,b){g.O.call(this); this.Z=C;this.If=b;this.j=null;this.K=this.Z.ST();this.logger=new g.ty("caps")},Lkd=function(C,b,h){if(typeof b==="string"||TkE(b))return[{trackData:b, MV:h}];var N=new DataView(b);if(N.byteLength<=8||N.getUint32(4)!==1718909296)return[];var p=g.MZx(N);if(C.K&&p){var P=g.o2H(p),c=g.Flc(p);p=p.oF;P&&p&&C.K.Ng(p,P,c)}C=g.dE(N,1835295092);if(!C||!C.length||!C[0].size)return[];P=[];for(c=0;c1?1:0){case 1:return new u5(b,C.N,C.W,h.width,h.height,p,N,C.If.experiments,C.Y_.bind(C),C.Z);case 2:return new Kq(b,C.N,C.W,h.width,h.height,p,N,C.If.experiments,C.Y_.bind(C),C.Z);default:return new Lq(b,C.N,C.W,h.width,h.height, p,N,C.If.experiments,C.Y_.bind(C),C.Z)}},a6E=function(C,b,h){h=h===void 0?!1:h; var N=BB.nK;C.N={};Object.assign(C.N,BB);C.N.nK={};Object.assign(C.N.nK,N);C.W={nK:{}};var p=b.backgroundOverride?C.W:C.N,P=b.background||N.background;As.test(P);p.nK.background=P;p=b.colorOverride?C.W:C.N;P=b.color||N.color;As.test(P);p.nK.color=P;p=b.windowColorOverride?C.W:C.N;P=b.windowColor||BB.windowColor;As.test(P);p.windowColor=P;p=b.backgroundOpacityOverride?C.W:C.N;P=b.backgroundOpacity;P==null&&(P=N.backgroundOpacity);p.nK.backgroundOpacity=P;p=b.fontSizeIncrementOverride?C.W:C.N;P=b.fontSizeIncrement; P==null&&(P=N.fontSizeIncrement);p.nK.fontSizeIncrement=P;P=b.fontStyleOverride?C.W:C.N;p=b.fontStyle;p==null&&(p=N.bold&&N.italic?3:N.bold?1:N.italic?2:0);P=P.nK;switch(p){case 1:P.bold=!0;delete P.italic;break;case 2:delete P.bold;P.italic=!0;break;case 3:P.bold=!0;P.italic=!0;break;default:delete P.bold,delete P.italic}p=b.textOpacityOverride?C.W:C.N;P=b.textOpacity;P==null&&(P=N.textOpacity);p.nK.textOpacity=P;p=b.windowOpacityOverride?C.W:C.N;P=b.windowOpacity;P==null&&(P=BB.windowOpacity);p.windowOpacity= P;p=b.charEdgeStyleOverride?C.W:C.N;P=b.charEdgeStyle;P==null&&(P=N.charEdgeStyle);p.nK.charEdgeStyle=P;p=b.fontFamilyOverride?C.W:C.N;P=b.fontFamily;P==null&&(P=N.fontFamily);p.nK.fontFamily=P;C.loaded&&C.e0();h&&g.uU("yt-player-caption-display-settings",b,2592E3)},q0e=function(C,b){if(!C.j)return{}; if(b){C.If.D("html5_report_caption_format_intent")&&!g.A8(b)&&C.ke(b.vss_id,"m");if(C.G||!g.tl(b))return;if(g.A8(b)){TJ(C,null,!0);return}for(var h,N=g.Zw(C.j.K,!0),p=0;p=0||C<0&&(-C-1)%2===1}; kx.prototype.length=function(){return this.segments.length/2}; g.S(pEd,g.O);g.k=pEd.prototype;g.k.wO=function(){g.O.prototype.wO.call(this);this.N&&this.N.cancel()}; g.k.HQ=function(){this.seekTo(this.player.getCurrentTime())}; g.k.seekTo=function(C){C-=this.player.Z9();var b=this.j;this.j=g.nd(this.KO.gh(C).UX);b!==this.j&&this.V&&this.V()}; g.k.reset=function(){this.X=new kx;this.W=-1;this.N&&(this.N.cancel(),this.N=null)}; g.k.dc=function(){this.HE();var C;if(C=this.j!=null)C=this.j,C=C.j.KB(C);if(C&&!this.N&&!(this.j&&this.j.startTime-this.player.getCurrentTime()>30)){C=this.j;C=C.j.A1(C);var b=C.UX[0],h;if((h=this.player.getVideoData())==null?0:h.enableServerStitchedDai)if(h=this.player.ST()){var N=b.j.info.id,p=b.yz,P=C.UX[0].c7;if(this.policy.Qz){if(h=h.PR(P,p,N,3))C.X=h}else if(N=h.Vu(P,p,N,3))if(h=h.Ks(p),h===0)N&&(C.j=new g.Zl(N));else if(h===2){this.J.start();PF0(this)&&this.seekTo(this.player.getCurrentTime()); return}}b.j.index.C2(b.yz)?(this.X.contains(C.UX[0].yz)||jVU(this,C),this.j=g.nd(C.UX)):PF0(this)&&this.seekTo(this.player.getCurrentTime())}this.J.start()}; g.S(ey,g.fP);g.k=ey.prototype;g.k.j4=function(C,b,h){var N=this;this.HK();b=e4E(this,C.getId());b||(b=C.languageCode,b=this.j.isManifestless?LgE(this,b,"386"):LgE(this,b));if(b){var p=(b.index.Lq(b.index.SJ())-b.index.getStartTime(b.index.SJ()))*1E3,P=this.Z.Y(),c=new g.OAH(P),e=function(){N.N&&N.N.reset();N.W=!0}; P.D("html5_keep_caption_data_after_seek")&&(e=null);this.N=new pEd(c,this.Z,b,function(L,Z){h.rL(L,C,Z,p)},this.J||g.nE(b.info),e)}}; g.k.jG=function(){var C=this.W;this.W=!1;return C}; g.k.aX=function(C){var b=this.Z.Y().D("html5_fallback_if_rawcc_missing");var h=this.j.j.rawcc!=null;if(!this.J||!h&&b)b=this.j.isManifestless?kAD(this,"386"):kAD(this);else{if(!h){this.logger.j(386248249,"rawcc used but unavailable");return}b=[new g.gF({id:"rawcc",languageCode:"rawcc",languageName:"CC1",is_servable:!0,is_default:!0,is_translateable:!1,vss_id:".en"}),new g.gF({id:"rawcc",languageCode:"rawcc",languageName:"CC3",is_servable:!0,is_default:!0,is_translateable:!1,vss_id:".en"})]}b=g.z(b); for(h=b.next();!h.done;h=b.next())g.m2(this.K,h.value);C.F8()}; g.k.HK=function(){this.N&&(this.N.dispose(),this.N=null)}; g.k.YU=function(){return""}; g.k.d4=function(){this.N&&(this.N.reset(),this.Z.Sh("captions"))}; var As=/^#(?:[0-9a-f]{3}){1,2}$/i;var aZC=["left","right","center","justify"];g.S(Lq,g.n);g.k=Lq.prototype;g.k.rd=function(C,b){this.Yh=C;this.kh=b;var h=g.$X(this.element,this.element.parentElement);this.zi=C-h.x;this.Vz=b-h.y}; g.k.MA=function(C,b){if(C!==this.Yh||b!==this.kh){g.P4(this.element,"ytp-dragging")||g.j6(this.element,"ytp-dragging");var h=g.Hc(this.element);C=C-this.zi-.02*this.playerWidth;var N=b-this.Vz-.02*this.playerHeight,p=(C+h.width/2)/this.maxWidth*3;p=Math.floor(g.cE(p,0,2));var P=(N+h.height/2)/this.maxHeight*3;P=Math.floor(g.cE(P,0,2));b=p+P*3;C=(C+p/2*h.width)/this.maxWidth;C=g.cE(C,0,1)*100;h=(N+P/2*h.height)/this.maxHeight;h=g.cE(h,0,1)*100;this.K.params.W5=b;this.K.params.Dm=h;this.K.params.uY= C;this.K.params.isDefault=!1;this.j.W5=b;this.j.Dm=h;this.j.uY=C;this.j.isDefault=!1;this.N2.W5=b;this.N2.Dm=h;this.N2.uY=C;this.N2.isDefault=!1;this.un()}}; g.k.yN=function(){g.kb(this.element,"ytp-dragging")}; g.k.un=function(){this.vg(this.J)}; g.k.getType=function(){return this.type}; g.k.vg=function(C){var b=this.G$?0:Math.min(this.E3(),this.maxWidth),h=this.Gh(),N=this.G$;if(N){var p=getComputedStyle(this.X.parentNode);p=Z3(p.borderLeftWidth)+Z3(p.borderRightWidth)+Z3(p.paddingLeft)+Z3(p.paddingRight)}else p=0;var P=p;p="";this.K.params.P2===3&&(p="rotate(180deg)");var c=N?"calc(96% - "+P+"px)":"96%";g.LV(this.element,{top:0,left:0,right:"",bottom:"",width:b?b+"px":"",height:h?h+"px":"","max-width":c,"max-height":c,margin:"",transform:""});this.iA(C);p={transform:p,top:"",left:"", width:b?b+"px":"",height:h?h+"px":"","max-width":"","max-height":""};var e=this.j.uY*.96+2;c=this.j.W5;switch(c){case 0:case 3:case 6:(N=this.j.nK.fontSizeIncrement)&&N>0&&this.j.P2!==2&&this.j.P2!==3&&(e=Math.max(e/(1+N*2),2));p.left=e+"%";break;case 1:case 4:case 7:p.left=e+"%";e=this.X.offsetWidth;b||e?(b=b||e+1,p.width=b+"px",p["margin-left"]=N?b/-2-P/2+"px":b/-2+"px"):p.transform+=" translateX(-50%)";break;case 2:case 5:case 8:p.right=100-e+"%"}N=this.j.Dm*.96+2;switch(c){case 0:case 1:case 2:p.top= N+"%";break;case 3:case 4:case 5:p.top=N+"%";(h=h||this.element.clientHeight)?(p.height=h+"px",p["margin-top"]=h/-2+"px"):p.transform+=" translateY(-50%)";break;case 6:case 7:case 8:p.bottom=100-N+"%"}g.LV(this.element,p);if(this.W){h=this.X.offsetHeight;N=1;for(b=0;bb)b=0,this.sX=!1,this.J=[],this.L=this.Df=this.Qz=null,g.hW(this.X);for(;b10?e-1:e);C=fq(C,"hg");C!=null&&(c.Hv=C);P[h]=c;break;case "ws":h=C.getAttribute("id");this.L[h]=deC(this,C);break;case "wp":h=C.getAttribute("id"),this.J[h]=WgI(this,C)}if(p){N=[];p=Array.from(p.childNodes);p=g.z(p);for(C=p.next();!C.done;C=p.next())if(C=C.value,C.nodeType===1)switch(C.tagName){case "w":this.j=Evd(this,C,b,!1);(C=this.W[this.j.id])&&C.end>this.j.start&&(C.end=this.j.start);this.W[this.j.id]=this.j;N.push(this.j);break;case "p":var L=C;e=b;h=[];P=L.getAttribute("w")|| this.X;c=!!m4(L,"a");e=(qk(L,"t")||0)+e;var Z=qk(L,"d")||5E3;c||(!this.G&&this.K&&this.K.windowId===P&&this.K.end>e&&(this.K.end=e),this.K&&this.K.text==="\n"&&(this.K.text=""));var Y=c?6:5,a=L.getAttribute("p");a=a?this.pens[a]:null;var l=Array.from(L.childNodes);l.length&&(this.G=L.getAttribute("d")!=null);for(L=0;L0&&(c=!0);var V=void 0;F.nodeType===1&&(V=F);if(V&&V.tagName==="s"){if((F=(F=V.getAttribute("p"))?this.pens[F]:null)&&F.Dv&&(F.Dv===1?(F=l.slice(L, L+4),F.length===4&&(G=vvo(e,Z,P,c,Y,F,this.pens),L+=3)):G=vvo(e,Z,P,c,Y,[V],this.pens)),!G){var q=V;G=e;V=Z;F=P;var f=c,y=Y,u=q.textContent?q.textContent:"",K=q.getAttribute("p");K=K?this.pens[K]:null;q=qk(q,"t")||0;G=new $x(G+q,V-q,y,F,u,f,K)}}else G=new $x(e,Z,Y,P,F.textContent||"",c,a);h.push(G);this.K=G}if(h.length>0)for(h[0].windowId===this.X&&(this.j=Evd(this,C,b,!0),N.push(this.j)),C=g.z(h),h=C.next();!h.done;h=C.next())h=h.value,h.windowId=this.j.id,this.j.j.push(h),N.push(h)}b=N}else b=[]; return b};var AW0=new Map([[9,1],[10,1],[11,2],[12,3],[13,4],[14,5]]);g.S(r5,zJ);r5.prototype.reset=function(){this.K.clear()}; r5.prototype.wA=function(C,b){var h=JSON.parse(C);if(!h)return[];if(h.pens){C=0;for(var N=g.z(h.pens),p=N.next();!p.done;p=N.next()){p=p.value;var P={},c=p.pParentId;c&&Object.assign(P,this.j.get(c));p.bAttr&&(P.bold=!0);p.iAttr&&(P.italic=!0);p.uAttr&&(P.underline=!0);c=p.ofOffset;c!=null&&(P.offset=c);p.szPenSize!==void 0&&(P.fontSizeIncrement=p.szPenSize/100-1);c=p.etEdgeType;c!=null&&(P.charEdgeStyle=c);p.ecEdgeColor!==void 0&&(P.vJ=i5(p.ecEdgeColor));c=p.fsFontStyle;c!=null&&c!==0&&(P.fontFamily= c);p.fcForeColor!==void 0&&(P.color=i5(p.fcForeColor));p.foForeAlpha!==void 0&&(P.textOpacity=p.foForeAlpha/255);p.bcBackColor!==void 0&&(P.background=i5(p.bcBackColor));p.boBackAlpha!==void 0&&(P.backgroundOpacity=p.boBackAlpha/255);(c=p.rbRuby)&&c!==10&&(P.Dv=c>10?c-1:c,P.Ea=AW0.get(P.Dv));p.hgHorizGroup&&(P.Hv=p.hgHorizGroup);this.j.set(C++,P)}}if(h.wsWinStyles)for(C=0,N=g.z(h.wsWinStyles),p=N.next();!p.done;p=N.next())p=p.value,P={},(c=p.wsParentId)?Object.assign(P,this.X.get(c)):Object.assign(P, this.G),p.mhModeHint!==void 0&&(P.nG=p.mhModeHint),p.juJustifCode!==void 0&&(P.textAlign=p.juJustifCode),p.pdPrintDir!==void 0&&(P.P2=p.pdPrintDir),p.sdScrollDir!==void 0&&(P.lw=p.sdScrollDir),p.wfcWinFillColor!==void 0&&(P.windowColor=i5(p.wfcWinFillColor)),p.wfoWinFillAlpha!==void 0&&(P.windowOpacity=p.wfoWinFillAlpha/255),this.X.set(C++,P);if(h.wpWinPositions)for(C=0,N=g.z(h.wpWinPositions),p=N.next();!p.done;p=N.next())p=p.value,P={},(c=p.wpParentId)&&Object.assign(P,this.N.get(c)),p.ahHorPos!== void 0&&(P.uY=p.ahHorPos),p.apPoint!==void 0&&(P.W5=p.apPoint),p.avVerPos!==void 0&&(P.Dm=p.avVerPos),p.ccCols!==void 0&&(P.qk=p.ccCols),p.rcRows!==void 0&&(P.h$=p.rcRows),this.N.set(C++,P);if(h.events){C=[];h=g.z(h.events);for(N=h.next();!N.done;N=h.next()){var e=N.value;p=(e.tStartMs||0)+b;P=e.dDurationMs||0;if(e.id)c=String(e.id),N=nvI(this,e,p,P,c),C.push(N),this.K.set(c,N);else{e.wWinId?c=e.wWinId.toString():(c="_"+V5++,N=nvI(this,e,p,P,c),C.push(N),this.K.set(c,N));N=C;var L=e;P===0&&(P=5E3); e=this.K.get(c);var Z=!!L.aAppend,Y=Z?6:5,a=L.segs,l=null;L.pPenId&&(l=this.j.get(L.pPenId));for(L=0;L1?1:0)===2&&Z&&G==="\n")continue;F=null;var f=[],y;if(y=q&&q.Dv===1){y=a;var u=L;if(u+3>=y.length||!y[u+1].pPenId||!y[u+2].pPenId||!y[u+3].pPenId)y=!1;else{var K=y[u+1].pPenId;(K=this.j.get(K))&&K.Dv&&K.Dv===2?(K=y[u+2].pPenId,K=this.j.get(K),!K||!K.Dv|| K.Dv<3?y=!1:(K=y[u+3].pPenId,y=(K=this.j.get(K))&&K.Dv&&K.Dv===2?!0:!1)):y=!1}}if(y)V=a[L+1].utf8,F=a[L+3].utf8,y=a[L+2].utf8,u=this.j.get(a[L+2].pPenId),G=ORD(G,V,y,F,u),F=new $x(p,P,Y,c,G,Z,q),L+=3;else{if(G.indexOf("<")>-1){var v=void 0;f=q;y=l;u=p;K=P;var T=V,t=Y,go=Z,jV=[],CW=g.Tr(""+G+"");if(!CW.getElementsByTagName("parsererror").length&&((v=CW.firstChild)==null?0:v.childNodes.length))for(v=g.z(CW.firstChild.childNodes),CW=v.next();!CW.done;CW=v.next()){CW=CW.value;var W=void 0, w=void 0,H=(w=(W=CW.textContent)==null?void 0:W.replace(/\n/g,""))!=null?w:"";if(CW.nodeType!==3||H&&H.match(/^ *$/)==null){W={};Object.assign(W,f||y);w=void 0;switch((w=CW)==null?void 0:w.tagName){case "b":W.bold=!0;break;case "i":W.italic=!0;break;case "u":W.underline=!0}jV.push(new $x(u+T,K-T,t,e.id,H,go,W))}}f=jV}f.length||(f=[new $x(p+V,P-V,Y,e.id,G,Z,q||l)])}if(f.length)for(Z=g.z(f),q=Z.next();!q.done;q=Z.next())q=q.value,N.push(q),e.j.push(q);else F&&(N.push(F),e.j.push(F))}Z=!0}}}b=C}else b= [];return b};g.S(Js,g.fP);Js.prototype.j4=function(C,b,h){xNd(this.videoData.videoId,C.vssId,h.rL)}; Js.prototype.aX=function(C){if(this.audioTrack)for(var b=g.z(this.audioTrack.captionTracks),h=b.next();!h.done;h=b.next())g.m2(this.K,h.value);C.F8()};g.S(u5,Lq);u5.prototype.iA=function(C){var b=this.K.j;Lq.prototype.iA.call(this,C);for(C=C.length;C0;C.G--){var b=Q5(C),h=Q5(C),N=Q5(C);b&4&&(b&3)===this.track&&(this.track===0||this.track===1)&&(b=this.j,b.j.push({time:C.N,type:this.track,Xf:h,wR:N,order:b.j.length}))}meD(this.j,C);return C.K}return[]}; Xa.prototype.reset=function(){this.j.clear()};g.S(Kq,Lq);g.k=Kq.prototype;g.k.un=function(){g.be(this.CO)}; g.k.c86=function(){g.kb(this.element,"ytp-rollup-mode");this.vg(this.Yg,!0)}; g.k.Gh=function(){return this.N?this.KO:this.V}; g.k.E3=function(){return this.N?this.V:this.KO}; g.k.vg=function(C,b){this.Yg=C;if(this.K.params.h$){for(var h=0,N=0;N0&&h=4){var e=cWj(c[1]),L=cWj(c[2])-e;e+=P;var Z=(c=c[3])?c.split(" "):[];c={};var Y=null;var a="";var l=null,F="";Z=g.z(Z);for(var G=Z.next();!G.done;G=Z.next())if(G=G.value.split(":"),G.length===2){var V=G[1];switch(G[0]){case "line":G=V.split(",");G[0].endsWith("%")&&(Y=G[0],c.Dm=Number.parseInt(Y,10),G.length===2&&(a=G[1].trim()));break;case "position":G= V.split(",");l=G[0];c.uY=Number.parseInt(l,10);G.length===2&&(F=G[1].trim());break;case "align":switch(V){case "start":c.textAlign=0;break;case "middle":c.textAlign=2;break;case "end":c.textAlign=1}}}Y||a||(a="end");if(!l)switch(c.textAlign){case 0:c.uY=0;break;case 1:c.uY=100;break;case 2:c.uY=50}if(c.textAlign!=null){Y=0;switch(a){case "center":Y+=3;break;case "end":Y+=6;break;default:Y+=0}switch(F){case "line-left":Y+=0;break;case "center":Y+=1;break;case "line-right":Y+=2;break;default:switch(c.textAlign){case 0:Y+= 0;break;case 2:Y+=1;break;case 1:Y+=2}}a=Y<0||Y>8?7:Y;c.W5=a}p=p.substring(JWp.lastIndex).replace(/[\x01-\x09\x0b-\x1f]/g,"");F=c;c=p;p={};if(c.indexOf("<")<0&&c.indexOf("&")<0)P=kzo(e,L,5,F),L=new $x(e,L,5,P.id,c,!1,g.A8(p)?void 0:p),h.push(P),h.push(L),P.j.push(L);else for(a=c.split(uld),a.length===1?(c=5,F=kzo(e,L,c,F)):(Y=c=6,F=Object.assign({qk:32},F),F=new HB(e,L,Y,"_"+V5++,F)),h.push(F),Y=e,l=0;l"+Z+""),G.getElementsByTagName("parsererror").length? (V=G.createElement("span"),V.appendChild(G.createTextNode(Z))):V=G.firstChild,j4$(this,Y,L-(Y-e),c,F,l>0,V,p,h)):Y=cWj(Z)+P}JWp.lastIndex=0}}return h}; var iMC=/^NOTE/,rWh=/(?:\r\n|\r|\n){2,}/,JWp=RegExp("^((?:[\\d]{2}:)?[\\d]{2}:[\\d]{2}\\.[\\d]{3})[\\t ]+--\x3e[\\t ]+((?:[\\d]{2}:)?[\\d]{2}:[\\d]{2}\\.[\\d]{3})(?:[\\t ]*)(.*)(?:\\r\\n|\\r|\\n)","gm"),uld=RegExp("<((?:[\\d]{2}:)?[\\d]{2}:[\\d]{2}\\.[\\d]{3})>");g.sb.sM(s6,{wA:"wvppt"});g.S(O6,g.O); O6.prototype.wA=function(C,b,h,N){N=N||0;h=Lkd(this,C,h||0);C=[];try{for(var p=g.z(h),P=p.next();!P.done;P=p.next()){var c=P.value,e=c.trackData,L=c.MV;if(typeof e!=="string"){h=C;var Z=h.concat,Y=b,a=e,l=L,F=N;if(!TkE(a))throw Error("Invalid binary caption track data");this.j||(this.j=new Xa(F,Y));var G=this.j.wA(a,l);var V=Z.call(h,G)}else{if(e.substring(0,6)==="WEBVTT"){h=C;var q=h.concat;this.j||(this.j=new s6);var f=this.j.wA(e,L);Math.random()<.01&&g.Ri(Error("Deprecated subtitles format in web player: WebVTT"));var y= q.call(h,f)}else{h=C;var u=h.concat;a:{Y=b;if(e[0]==="{")try{this.j||(this.j=new r5(ZMj(Y)));var K=this.j.wA(e,L);break a}catch(CW){g.ux(CW);K=[];break a}var v=g.Tr(e);if(!v||!v.firstChild){var T=Error("Invalid caption track data");T.params=e;throw T;}if(v.firstChild.tagName==="timedtext"){if(Number(v.firstChild.getAttribute("format"))===3){a=v;this.j||(this.j=new Mk(ZMj(Y),this.If));K=this.j.wA(a,L);break a}var t=Error("Unsupported subtitles format in web player (Format2)");t.params=e;throw t;}if(v.firstChild.tagName=== "transcript"){var go=Error("Unsupported subtitles format in web player (Format1)");go.params=e;throw go;}var jV=Error("Invalid caption track data");jV.params=e;throw jV;}y=u.call(h,K)}V=y}C=V}return C}catch(CW){return this.logger.j(187101178,"Captions parsing failed: "+CW.message+". "),this.clear(),[]}}; O6.prototype.clear=function(){this.j&&this.j.dispose();this.j=null}; O6.prototype.reset=function(){this.j&&this.j.reset()}; O6.prototype.wO=function(){g.O.prototype.wO.call(this);this.clear()};var BB={windowColor:"#080808",windowOpacity:0,textAlign:2,W5:7,uY:50,Dm:100,isDefault:!0,nK:{background:"#080808",backgroundOpacity:.75,charEdgeStyle:0,color:"#fff",fontFamily:4,fontSizeIncrement:0,textOpacity:1,offset:1}};g.S(vB,g.qK);g.k=vB.prototype;g.k.wO=function(){if(this.G||this.sX){var C=this.Z.Q_();C&&!C.HE()&&C.rl()}else f60(this,!1);g.qK.prototype.wO.call(this)}; g.k.nQ=function(){return this.If.D("html5_honor_caption_availabilities_in_audio_track")&&this.X!=="LIVE"&&this.X!=="SABR_LIVE"}; g.k.Fa=function(){if(this.m6)return this.G||this.sX;var C=this.getAudioTrack();if(this.nQ()){if(!C.captionTracks.length)return!1;if(!this.j)return!0}C=t90(C,g.Oa(this.If));return C==="CAPTIONS_INITIAL_STATE_ON_REQUIRED"?!0:C==="CAPTIONS_INITIAL_STATE_OFF_REQUIRED"?D3(this):o9j(this)||D3(this)?!0:Fkj(this)}; g.k.load=function(){g.qK.prototype.load.call(this);this.V=this.getAudioTrack();if(this.j)this.K&&(this.Yh.clear(),this.G?S0E(this,!0):this.player.getPresentingPlayerType()!==3&&this.j.j4(this.K,"json3",this.ob),this.G||this.sX||E6(this)||this.player.IL("captionschanged",g.P7(this.K)));else{var C;this.X==="OFFLINE"?C=new Js(this.player,this.videoData,this.getAudioTrack()):this.X==="SABR_LIVE"?C=new NQo(this.videoData.j,this.player):this.X==="LIVE"?C=new ey(this.videoData.j,this.player):this.X==="INNERTUBE"? C=new g.AO(this.player,this.videoData,this.getAudioTrack()):C=new g.rO(this.player,this.videoData.pK,this.videoData.videoId,g.LxW(this.videoData),this.videoData.BM,this.videoData.eventId);this.j=C;g.D(this,this.j);this.j.aX(this.ob)}}; g.k.unload=function(){this.G&&this.K?S0E(this,!1):(this.rO&&g.hZ(this.rO),this.player.Sh("captions"),this.Qz=[],this.j&&this.j.HK(),this.Yh.clear(),this.KO&&this.player.A8(this.KO),this.e0());g.qK.prototype.unload.call(this);this.player.rA();this.player.IL("captionschanged",{})}; g.k.create=function(){this.Fa()&&this.load();var C;a:{var b,h,N;if(this.If.D("web_player_nitrate_promo_tooltip")&&((b=this.videoData.getPlayerResponse())==null?0:(h=b.captions)==null?0:(N=h.playerCaptionsTracklistRenderer)==null?0:N.enableTouchCaptionsNitrate)){var p,P;if(b=(C=this.videoData.getPlayerResponse())==null?void 0:(p=C.captions)==null?void 0:(P=p.playerCaptionsTracklistRenderer)==null?void 0:P.captionTracks)for(C=g.z(b),p=C.next();!p.done;p=C.next())if(p=p.value,p.kind==="asr"&&p.languageCode=== "en"){C=!0;break a}}C=!1}C&&this.Z.publish("showpromotooltip",this.J.element)}; g.k.F8=function(){var C=t90(this.player.getAudioTrack(),g.Oa(this.If));var b=C==="CAPTIONS_INITIAL_STATE_ON_REQUIRED"?WB(this,this.L):C==="CAPTIONS_INITIAL_STATE_OFF_REQUIRED"&&D3(this)?d5(this):o9j(this)||this.L||Fkj(this)?WB(this,this.L):D3(this)?d5(this):null;if(this.G||this.sX){var h=g.Zw(this.j.K,!0);C=[];for(var N=0;N0&&this.Z.ke(C,b)}; g.k.d4=function(){this.j&&this.j.d4()}; g.sb.sM(vB,{z4:"smucd"});g.MK("captions",vB);})(_yt_player);