(function(g){var window=this;/* Copyright 2017 Google LLC SPDX-License-Identifier: BSD-3-Clause */ /* SPDX-License-Identifier: Apache-2.0 */ 'use strict';var cWE=function(k){k.mutedAutoplay=!1;k.endSeconds=NaN;k.limitedPlaybackDurationInSeconds=NaN;g.NY(k)},uKe=function(k){g.Zd(k); for(var y=0;y0;){N=q.pop();try{N.run()}finally{k.delete(N)}}}fjq.delete(k)},voE=function(){var k; g.B(function(y){if(y.Z==1)return k=PiT,PiT=new Set,g.b(y,Promise.resolve(),2);OXN(k);g.XZ(y)})},CiF=function(){return Array.from(fjq).map(function(k){return Array.from(k)})},EoG=function(k){var y=k.component; var q=k.debugInstance;k=k.a_;var N,D=(N=y.zA)!=null?N:y.name;MX.push({name:q?D+" ("+q+")":D,pz:!0});y=k();MX.pop();return y},FY=function(k,y){y=y===void 0?{}:y; var q=MX.length;y.stack&&(MX=[].concat(g.m(y.stack)));try{return k()}catch(n){k=n;bX1(k);if(k!==VgG){BNF=MX.slice();y=[];for(var N=U1;N;){var D=void 0;y.push((D=N.zA)!=null?D:"[context]");D=void 0;N=(D=N.parent)!=null?D:null}UxE=y.reverse()}VgG=k;throw k;}finally{q=MX.length-q,q>0&&MX.splice(-q)}},bX1=function(k){var y=MX; if(y.length!==0&&!k.Jq){var q=y.slice(-20).reverse().map(function(N){return N.name}).join(" > "); q=k.message+"\n\nComponent stack: "+q;try{k.Jq=y.slice(),g.yB.xM&&(k.stack&&(k.stack=k.stack.replace(k.message,q)),k.message=q)}catch(N){}}},QSO=function(){g.Zd(this); if(g.eT(this))for(var k=0;ky;)k.pop()},JWG=function(k){k=Array(k); LE(k,0);return k},tgq=function(k,y,q){if(q==null)k.removeAttribute(y); else{var N=y.lastIndexOf("xml:",0)===0?"http://www.w3.org/XML/1998/namespace":y.lastIndexOf("xlink:",0)===0?"http://www.w3.org/1999/xlink":null;N?k.setAttributeNS(N,y,q):k.setAttribute(y,q)}},ybb=function(k,y,q){k=k.style; if(typeof q==="string")k.cssText=q;else{k.cssText="";for(var N in q)if(kYE.call(q,N)){y=k;var D=N,n=q[N];D.indexOf("-")>=0?y.setProperty(D,n):y[D]=n}}},qsB=function(k,y,q){var N=typeof q; N==="object"||N==="function"?k[y]=q:tgq(k,y,q)},NyT=function(){var k=new sSb; k.__default=qsB;k.style=ybb;return k},DsE=function(k,y,q,N){(N[y]||N.__default)(k,y,q)},n1g=function(k){this.created=[]; this.Z=[];this.node=k},Tyb=function(k,y){this.Z=null; this.N=k;this.key=y;this.text=void 0},waw=function(k,y,q){y=new Tyb(y,q); return k.__incrementalDOMData=y},dA=function(k,y){if(k.__incrementalDOMData)return k.__incrementalDOMData; var q=k.nodeType===1?k.localName:k.nodeName,N=k.nodeType===1?k.getAttribute("key"):null;y=waw(k,q,k.nodeType===1?N||y:null);if(k.nodeType===1&&(k=k.attributes,q=k.length)){N=y.Z||(y.Z=JWG(q*2));for(var D=0,n=0;D=0)for(y=gA,q=k.nextSibling, N=ey;N!==null&&N!==k;)D=N.nextSibling,y.insertBefore(N,q),N=D;else gA.insertBefore(k,ey);ey=k}},KB$=function(k,y){HCN(k,y); gA=ey;ey=null;return gA},cbg=function(k,y){y=y===void 0?{}:y; var q=y.matches===void 0?IfB:y.matches;return function(N,D,n){var T=hA,I=Zi,H=lN,K=s1,A=ey,c=gA,u=W7;Zi=N.ownerDocument;hA=new n1g(N);W7=q;s1=[];ey=null;var a=gA=N.parentNode,x,r=Abw.call(N);if((x=r.nodeType===11||r.nodeType===9?r.activeElement:null)&&N.contains(x)){for(r=[];x!==a;)r.push(x),x=x.parentNode||(a?x.host:null);a=r}else a=[];lN=a;try{return k(N,D,n)}finally{N=hA,JA&&N.Z.length>0&&JA(N.Z),Zi=I,hA=T,W7=u,s1=K,ey=A,gA=c,lN=H}}},um1=function(k,y,q,N){tA.push(DsE); tA.push(k);tA.push(y);tA.push(q);tA.push(N)},af1=function(k){HCN("#text",null); var y=ey;var q=dA(y);if(q.text!==k){q=q.text=k;for(var N=1;N=0;N--)q.removeChild(k[N])}else q.textContent="",q.appendChild(y);return y},ffB=function(k,y){if(k[0].parentElement)for(var q=k[0].parentElement,N=y.length,D=k.length,n=N,T=0,I=0,H=k[D-1].nextSibling,K=null;TA-I)for(c=k[T];I1)throw Error("Script tags can contain at most 1 child. Got "+q.length+": ["+q.map(iCx).join(", ")+"]");q=q[0]}if(q!=null){if(!(q instanceof g.Zh)){var n,T;if((n=window)==null?0:(T=n.trustedTypes)==null?0:T.isScript(q))throw Error("Do not use a TrustedScript instance in a script tag directly. Use a SafeScript instead.");if(String(q).trim().length=== 0)break a;throw Error("Script tags must only contain SafeScript or LegacyScript instances. Got: "+iCx(q));}y.textContent=g.lC(q);g.sl(y)}}else{T8(k)&&(k=nb(k),N&&q&&(N[D]=k));wU(k)&&(k=nb(k.toString()),N&&q&&(N[D]=k));if(Kb(k))return Usw(y,k);if(Array.isArray(k)){for(n=0;n0&&(y.children=q.length===1?q[0]:q);return Qo$(k,y)}}); var N=document.createElement(k),D;for(D in y)ki(N,D,y[D]);Ys$(N,y,!1);c_(q,N);$sL(N,y,{pz:!0});return N},dsE=function(k){LBB.push(k)===1&&requestAnimationFrame(function(){setTimeout(function(){var y=[].concat(g.m(LBB)); LBB=[];y=g.p(y);for(var q=y.next();!q.done;q=y.next()){q=q.value;try{for(var N=0;N0&&(k.props.children=k.children);var N;(N=k.props).idomKey||(N.idomKey=y);if(q){var D=KB$(q,k.props.idomKey);k.U8=!0;var n=D.__instance}n||(n=INw(y,k.props),n.props=null,D&&(D.__instance=n,n.el=D));var T;q=((T=n.Uf)!=null?T:{MC:n.state,Cz:!1}).MC;n.Uf=void 0;y.R4&&(q=y.R4(k.props,q));n.props=k.props;n.state=q;T=function(){var I=n;aR.Fx(I);var H=I.us(I.props);H?(I.props.idomKey&&(H.props.idomKey=I.props.idomKey),I=H):I=void 0; if(H=I)if(H.U8=k.U8,I=z8(H),k.U8=H.U8,!y.ZX)if(I)y.ZX=I.tagName.toLowerCase(),I.__instance=n,n.el=I;else{var K;if((K=n.q_)==null?0:K.length){var A;(A=g.yB.handleError)==null||A.call.apply(A,[g.yB].concat(g.m(G_(Error("A component used hooks, but failed to return a host element")))))}}n.qU();aR.qU(n)}; (q=n.Z)?EoG({component:q,debugInstance:n.props.debugInstance,a_:T}):T()}},nJe=function(k){var y=k.type; if(!wPT(y)||y===soF)return!1;k.props.children=k.children.length>1?k.children:k.children[0];var q,N=(q=k.props.idomKey)!=null?q:k.type,D;if(oZ()&&((D=oZ()[H3L])==null?void 0:D.key)===N){y=oZ();q=y[H3L];if(!q)throw Error("Reactive data has been lost on node. Tag name: "+y.tagName);var n;(n=q.SOj)==null||n.call(q,k.props);Kn1(q);return!0}if(AvE.has(y.name))throw Error(y.name+" can not be called from a IDOM component. See go/cow-errors#control-flow-component-called-from-Idom-Component");k.props.g2M=!0; (n=EoG({component:k.type,debugInstance:k.props.debugInstance,a_:function(){return Qo$(k.type,k.props)}}))&&cvq(n); return!0},uRx=function(k){for(var y=0;y=0);g.fD(k.element,"ytp-scroll-max",y<=q)},CfT=function(k){for(var y=0;y