import{cG as en,cE as ya,cF as ry,d as Zh,bg as ay,be as Vo,L as tp,r as ep,cd as sy,m as oy,M as Wo,a0 as Go,aA as uy,bU as np,o as ip,c as ly,h as rp,g as ap,w as cy,a as zo,x as dy,R as hy,Q as py,k as fy,az as my,_ as gy,__tla as vy}from"./index-12a7743c.js";let sp,yy=Promise.all([(()=>{try{return vy}catch{}})()]).then(async()=>{var Ki=typeof window<"u"?window:ya!==void 0?ya:typeof self<"u"?self:{};const D=en(Ki);var Yi,Xo=ya!==void 0?ya:typeof window<"u"?window:{},op=ry;typeof document<"u"?Yi=document:(Yi=Xo["__GLOBAL_DOCUMENT_CACHE@4"])||(Yi=Xo["__GLOBAL_DOCUMENT_CACHE@4"]=op);var Ko=Yi;const H=en(Ko);function he(){return he=Object.assign?Object.assign.bind():function(e){for(var i=1;i=400&&t.statusCode<=599){var a=n;if(i)if(hp.TextDecoder){var s=function(o){return o===void 0&&(o=""),o.toLowerCase().split(";").reduce(function(u,c){var d=c.split("="),m=d[0],f=d[1];return m.trim()==="charset"?f.trim():u},"utf-8")}(t.headers&&t.headers["content-type"]);try{a=new TextDecoder(s).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a})}else e(null,n)}},Qo=Ki,fp=lp,mp=cp;_e.httpHandler=pp;var gp=function(e){var i={};return e&&e.trim().split(` `).forEach(function(r){var t=r.indexOf(":"),n=r.slice(0,t).trim().toLowerCase(),a=r.slice(t+1).trim();i[n]===void 0?i[n]=a:Array.isArray(i[n])?i[n].push(a):i[n]=[i[n],a]}),i};function $o(e,i,r){var t=e;return mp(i)?(r=i,typeof e=="string"&&(t={uri:e})):t=fp({},i,{uri:e}),t.callback=r,t}function _e(e,i,r){return Jo(i=$o(e,i,r))}function Jo(e){if(e.callback===void 0)throw new Error("callback argument missing");var i=!1,r=function(w,k,I){i||(i=!0,e.callback(w,k,I))};function t(){var w=void 0;if(w=u.response?u.response:u.responseText||function(k){try{if(k.responseType==="document")return k.responseXML;var I=k.responseXML&&k.responseXML.documentElement.nodeName==="parsererror";if(k.responseType===""&&!I)return k.responseXML}catch{}return null}(u),y)try{w=JSON.parse(w)}catch{}return w}function n(w){return clearTimeout(c),w instanceof Error||(w=new Error(""+(w||"Unknown XMLHttpRequest Error"))),w.statusCode=0,r(w,E)}function a(){if(!o){var w;clearTimeout(c),w=e.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var k=E,I=null;return w!==0?(k={body:t(),statusCode:w,method:m,headers:{},url:d,rawRequest:u},u.getAllResponseHeaders&&(k.headers=gp(u.getAllResponseHeaders()))):I=new Error("Internal XMLHttpRequest Error"),r(I,k,k.body)}}var s,o,u=e.xhr||null;u||(u=e.cors||e.useXDR?new _e.XDomainRequest:new _e.XMLHttpRequest);var c,d=u.url=e.uri||e.url,m=u.method=e.method||"GET",f=e.body||e.data,_=u.headers=e.headers||{},b=!!e.sync,y=!1,E={body:void 0,headers:{},statusCode:0,method:m,url:d,rawRequest:u};if("json"in e&&e.json!==!1&&(y=!0,_.accept||_.Accept||(_.Accept="application/json"),m!=="GET"&&m!=="HEAD"&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),f=JSON.stringify(e.json===!0?f:e.json))),u.onreadystatechange=function(){u.readyState===4&&setTimeout(a,0)},u.onload=a,u.onerror=n,u.onprogress=function(){},u.onabort=function(){o=!0},u.ontimeout=n,u.open(m,d,!b,e.username,e.password),b||(u.withCredentials=!!e.withCredentials),!b&&e.timeout>0&&(c=setTimeout(function(){if(!o){o=!0,u.abort("timeout");var w=new Error("XMLHttpRequest timeout");w.code="ETIMEDOUT",n(w)}},e.timeout)),u.setRequestHeader)for(s in _)_.hasOwnProperty(s)&&u.setRequestHeader(s,_[s]);else if(e.headers&&!function(w){for(var k in w)if(w.hasOwnProperty(k))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(u),u.send(f||null),u}ba.exports=_e,ba.exports.default=_e,_e.XMLHttpRequest=Qo.XMLHttpRequest||function(){},_e.XDomainRequest="withCredentials"in new _e.XMLHttpRequest?_e.XMLHttpRequest:Qo.XDomainRequest,function(e,i){for(var r=0;r59?i(r[1],r[2],0,r[4]):i(0,r[1],r[2],r[4]):null}function ri(){this.values=Ta(null)}function ai(e,i,r,t){var n=t?e.split(t):[e];for(var a in n)if(typeof n[a]=="string"){var s=n[a].split(r);s.length===2&&i(s[0].trim(),s[1].trim())}}function vp(e,i,r){var t=e;function n(){var s=Sa(e);if(s===null)throw new ie(ie.Errors.BadTimeStamp,"Malformed timestamp: "+t);return e=e.replace(/^[^\sa-zA-Z-]+/,""),s}function a(){e=e.replace(/^\s+/,"")}if(a(),i.startTime=n(),a(),e.substr(0,3)!=="-->")throw new ie(ie.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+t);e=e.substr(3),a(),i.endTime=n(),a(),function(s,o){var u=new ri;ai(s,function(c,d){switch(c){case"region":for(var m=r.length-1;m>=0;m--)if(r[m].id===d){u.set(c,r[m].region);break}break;case"vertical":u.alt(c,d,["rl","lr"]);break;case"line":var f=d.split(","),_=f[0];u.integer(c,_),u.percent(c,_)&&u.set("snapToLines",!1),u.alt(c,_,["auto"]),f.length===2&&u.alt("lineAlign",f[1],["start","center","end"]);break;case"position":f=d.split(","),u.percent(c,f[0]),f.length===2&&u.alt("positionAlign",f[1],["start","center","end"]);break;case"size":u.percent(c,d);break;case"align":u.alt(c,d,["start","center","end","left","right"])}},/:/,/\s/),o.region=u.get("region",null),o.vertical=u.get("vertical","");try{o.line=u.get("line","auto")}catch{}o.lineAlign=u.get("lineAlign","start"),o.snapToLines=u.get("snapToLines",!0),o.size=u.get("size",100);try{o.align=u.get("align","center")}catch{o.align=u.get("align","middle")}try{o.position=u.get("position","auto")}catch{o.position=u.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},o.align)}o.positionAlign=u.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},o.align)}(e,i)}ie.prototype=Ta(Error.prototype),ie.prototype.constructor=ie,ie.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ri.prototype={set:function(e,i){this.get(e)||i===""||(this.values[e]=i)},get:function(e,i,r){return r?this.has(e)?this.values[e]:i[r]:this.has(e)?this.values[e]:i},has:function(e){return e in this.values},alt:function(e,i,r){for(var t=0;t=0&&i<=100)&&(this.set(e,i),!0)}};var Ea=eu.createElement&&eu.createElement("textarea"),yp={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},nu={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},_p={v:"title",lang:"lang"},iu={rt:"ruby"};function ru(e,i){function r(){if(!i)return null;var b,y=i.match(/^([^<]*)(<[^>]*>?)?/);return b=y[1]?y[1]:y[2],i=i.substr(b.length),b}function t(b,y){return!iu[y.localName]||iu[y.localName]===b.localName}function n(b,y){var E=yp[b];if(!E)return null;var w=e.document.createElement(E),k=_p[b];return k&&y&&(w[k]=y.trim()),w}for(var a,s,o=e.document.createElement("div"),u=o,c=[];(a=r())!==null;)if(a[0]!=="<")u.appendChild(e.document.createTextNode((s=a,Ea.innerHTML=s,s=Ea.textContent,Ea.textContent="",s)));else{if(a[1]==="/"){c.length&&c[c.length-1]===a.substr(2).replace(">","")&&(c.pop(),u=u.parentNode);continue}var d,m=Sa(a.substr(1,a.length-2));if(m){d=e.document.createProcessingInstruction("timestamp",m),u.appendChild(d);continue}var f=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!f||!(d=n(f[1],f[3]))||!t(u,d))continue;if(f[2]){var _=f[2].split(".");_.forEach(function(b){var y=/^bg_/.test(b),E=y?b.slice(3):b;if(nu.hasOwnProperty(E)){var w=y?"background-color":"color",k=nu[E];d.style[w]=k}}),d.className=_.join(" ")}c.push(f[1]),u.appendChild(d),u=d}return o}var au=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function bp(e){for(var i=0;i=r[0]&&e<=r[1])return!0}return!1}function Tp(e){var i=[],r="";if(!e||!e.childNodes)return"ltr";function t(s,o){for(var u=o.childNodes.length-1;u>=0;u--)s.push(o.childNodes[u])}function n(s){if(!s||!s.length)return null;var o=s.pop(),u=o.textContent||o.innerText;if(u){var c=u.match(/^.*(\n|\r)/);return c?(s.length=0,c[0]):u}return o.tagName==="ruby"?n(s):o.childNodes?(t(s,o),n(s)):void 0}for(t(i,e);r=n(i);)for(var a=0;a=0&&y.line<=100))return y.line;if(!y.track||!y.track.textTrackList||!y.track.textTrackList.mediaElement)return-1;for(var E=y.track,w=E.textTrackList,k=0,I=0;Im&&(d=d<0?-1:1,d*=Math.ceil(m/c)*c),s<0&&(d+=a.vertical===""?r.height:r.width,o=o.reverse()),n.move(f,d)}else{var _=n.lineHeight/r.height*100;switch(a.lineAlign){case"center":s-=_/2;break;case"end":s-=_}switch(a.vertical){case"":i.applyStyles({top:i.formatStyle(s,"%")});break;case"rl":i.applyStyles({left:i.formatStyle(s,"%")});break;case"lr":i.applyStyles({right:i.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],n=new qt(i)}var b=function(y,E){for(var w,k=new qt(y),I=1,P=0;PN&&(w=new qt(y),I=N),y=new qt(k)}return w||k}(n,o);i.move(b.toCSSCompatValues(r))}function bn(){}Qi.prototype.applyStyles=function(e,i){for(var r in i=i||this.div,e)e.hasOwnProperty(r)&&(i.style[r]=e[r])},Qi.prototype.formatStyle=function(e,i){return e===0?0:e+i},$i.prototype=Ta(Qi.prototype),$i.prototype.constructor=$i,qt.prototype.move=function(e,i){switch(i=i!==void 0?i:this.lineHeight,e){case"+x":this.left+=i,this.right+=i;break;case"-x":this.left-=i,this.right-=i;break;case"+y":this.top+=i,this.bottom+=i;break;case"-y":this.top-=i,this.bottom-=i}},qt.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},qt.prototype.overlapsAny=function(e){for(var i=0;i=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},qt.prototype.overlapsOppositeAxis=function(e,i){switch(i){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},qt.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},qt.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},qt.getSimpleBoxPosition=function(e){var i=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,r=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,t=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||t,height:e.height||i,bottom:e.bottom||t+(e.height||i),width:e.width||r}},bn.StringDecoder=function(){return{decode:function(e){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},bn.convertCueToDOMTree=function(e,i){return e&&i?ru(e,i):null},bn.processCues=function(e,i,r){if(!e||!i||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var t=e.document.createElement("div");if(t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",r.appendChild(t),function(u){for(var c=0;c")===-1){i.cue.id=n;continue}case"CUE":try{vp(n,i.cue,i.regionList)}catch(u){i.reportOrThrowError(u),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=n.indexOf("-->")!==-1;if(!n||o&&(s=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=` `),i.cue.text+=n.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":n||(i.state="ID");continue}}}catch(u){i.reportOrThrowError(u),i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||e.state==="HEADER")&&(e.buffer+=` `,e.parse()),e.state==="INITIAL")throw new ie(ie.Errors.BadSignature)}catch(i){e.reportOrThrowError(i)}return e.onflush&&e.onflush(),this}};var Ep=bn,wp={"":1,lr:1,rl:1},kp={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function wa(e){return typeof e=="string"&&!!kp[e.toLowerCase()]&&e.toLowerCase()}function su(e,i,r){this.hasBeenReset=!1;var t="",n=!1,a=e,s=i,o=r,u=null,c="",d=!0,m="auto",f="start",_="auto",b="auto",y=100,E="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return t},set:function(w){t=""+w}},pauseOnExit:{enumerable:!0,get:function(){return n},set:function(w){n=!!w}},startTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");a=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");s=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(w){u=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(w){var k=function(I){return typeof I=="string"&&!!wp[I.toLowerCase()]&&I.toLowerCase()}(w);if(k===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");c=k,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(w){d=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return m},set:function(w){if(typeof w!="number"&&w!=="auto")throw new SyntaxError("Line: an invalid number or illegal string was specified.");m=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(w){var k=wa(w);k?(f=k,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return _},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");_=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(w){var k=wa(w);k?(b=k,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");y=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return E},set:function(w){var k=wa(w);if(!k)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");E=k,this.hasBeenReset=!0}}}),this.displayState=void 0}su.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Cp=su,xp={"":!0,up:!0};function si(e){return typeof e=="number"&&e>=0&&e<=100}var Dp=function(){var e=100,i=3,r=0,t=100,n=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(o){if(!si(o))throw new Error("Width must be between 0 and 100.");e=o}},lines:{enumerable:!0,get:function(){return i},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");i=o}},regionAnchorY:{enumerable:!0,get:function(){return t},set:function(o){if(!si(o))throw new Error("RegionAnchorX must be between 0 and 100.");t=o}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!si(o))throw new Error("RegionAnchorY must be between 0 and 100.");r=o}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(o){if(!si(o))throw new Error("ViewportAnchorY must be between 0 and 100.");a=o}},viewportAnchorX:{enumerable:!0,get:function(){return n},set:function(o){if(!si(o))throw new Error("ViewportAnchorX must be between 0 and 100.");n=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=function(c){return typeof c=="string"&&!!xp[c.toLowerCase()]&&c.toLowerCase()}(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):s=u}}})},Ie=Ki,nn=tu.exports={WebVTT:Ep,VTTCue:Cp,VTTRegion:Dp};Ie.vttjs=nn,Ie.WebVTT=nn.WebVTT;var Ip=nn.VTTCue,Ap=nn.VTTRegion,Pp=Ie.VTTCue,Lp=Ie.VTTRegion;nn.shim=function(){Ie.VTTCue=Ip,Ie.VTTRegion=Ap},nn.restore=function(){Ie.VTTCue=Pp,Ie.VTTRegion=Lp},Ie.VTTCue||nn.shim();const ou=en(tu.exports);function uu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uu=function(){return!!e})()}function lu(e,i,r){if(uu())return Reflect.construct.apply(null,arguments);var t=[null];t.push.apply(t,i);var n=new(e.bind.apply(e,t));return r&&_n(n,r.prototype),n}var cu,du={exports:{}};cu=du,function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,t=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(s,o,u){if(u=u||{},s=s.trim(),!(o=o.trim())){if(!u.alwaysNormalize)return s;var c=a.parseURL(s);if(!c)throw new Error("Error trying to parse base URL.");return c.path=a.normalizePath(c.path),a.buildURLFromParts(c)}var d=a.parseURL(o);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return u.alwaysNormalize?(d.path=a.normalizePath(d.path),a.buildURLFromParts(d)):o;var m=a.parseURL(s);if(!m)throw new Error("Error trying to parse base URL.");if(!m.netLoc&&m.path&&m.path[0]!=="/"){var f=r.exec(m.path);m.netLoc=f[1],m.path=f[2]}m.netLoc&&!m.path&&(m.path="/");var _={scheme:m.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(_.netLoc=m.netLoc,d.path[0]!=="/"))if(d.path){var b=m.path,y=b.substring(0,b.lastIndexOf("/")+1)+d.path;_.path=a.normalizePath(y)}else _.path=m.path,d.params||(_.params=m.params,d.query||(_.query=m.query));return _.path===null&&(_.path=u.alwaysNormalize?a.normalizePath(d.path):d.path),a.buildURLFromParts(_)},parseURL:function(s){var o=i.exec(s);return o?{scheme:o[1]||"",netLoc:o[2]||"",path:o[3]||"",params:o[4]||"",query:o[5]||"",fragment:o[6]||""}:null},normalizePath:function(s){for(s=s.split("").reverse().join("").replace(t,"");s.length!==(s=s.replace(n,"")).length;);return s.split("").reverse().join("")},buildURLFromParts:function(s){return s.scheme+s.netLoc+s.path+s.params+s.query+s.fragment}};cu.exports=a}();const hu=en(du.exports);var Op="http://example.com",Ji=function(e,i){if(/^[a-z]+:/i.test(i))return i;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var r=typeof D.URL=="function",t=/^\/\//.test(e),n=!D.location&&!/\/\//i.test(e);if(r?e=new D.URL(e,D.location||Op):/\/\//i.test(e)||(e=hu.buildAbsoluteURL(D.location&&D.location.href||"",e)),r){var a=new URL(i,e);return n?a.href.slice(18):t?a.href.slice(a.protocol.length):a.href}return hu.buildAbsoluteURL(e,i)},ka=function(){function e(){this.listeners={}}var i=e.prototype;return i.on=function(r,t){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(t)},i.off=function(r,t){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(t);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},i.trigger=function(r){var t=this.listeners[r];if(t)if(arguments.length===2)for(var n=t.length,a=0;a-1;t=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},i}(ka),Np=String.fromCharCode(9),Ca=function(e){var i=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),r={};return i[1]&&(r.length=parseInt(i[1],10)),i[2]&&(r.offset=parseInt(i[2],10)),r},pe=function(e){for(var i,r=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),t={},n=r.length;n--;)r[n]!==""&&((i=/([^=]*)=(.*)/.exec(r[n]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),t[i[0]]=i[1]);return t},Mp=function(e){function i(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}V(i,e);var r=i.prototype;return r.push=function(t){var n,a,s=this;(t=t.trim()).length!==0&&(t[0]==="#"?this.tagMappers.reduce(function(o,u){var c=u(t);return c===t?o:o.concat([c])},[t]).forEach(function(o){for(var u=0;u0&&(u.duration=y.duration),y.duration===0&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(y.attributes)if(y.attributes.METHOD!=="NONE")if(y.attributes.URI){if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes});if(y.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI});if(y.attributes.KEYFORMAT==="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):y.attributes.KEYID&&y.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:pu(y.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},y.attributes.IV!==void 0&&(a.iv=y.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else a=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(y.number)?this.manifest.mediaSequence=y.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number})},"discontinuity-sequence":function(){isFinite(y.number)?(this.manifest.discontinuitySequence=y.number,f=y.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number})},"playlist-type":function(){/VOD|EVENT/.test(y.playlistType)?this.manifest.playlistType=y.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist})},map:function(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||m,y.attributes?(u.attributes||(u.attributes={}),he(u.attributes,y.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||m,y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME){var k=this.manifest.mediaGroups[y.attributes.TYPE];k[y.attributes["GROUP-ID"]]=k[y.attributes["GROUP-ID"]]||{},E=k[y.attributes["GROUP-ID"]],(w={default:/yes/i.test(y.attributes.DEFAULT)}).default?w.autoselect=!0:w.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(w.language=y.attributes.LANGUAGE),y.attributes.URI&&(w.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(w.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(w.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(w.forced=/yes/i.test(y.attributes.FORCED)),E[y.attributes.NAME]=w}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){f+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),u.dateTimeString=y.dateTimeString,u.dateTimeObject=y.dateTimeObject},targetduration:function(){!isFinite(y.duration)||y.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration}):(this.manifest.targetDuration=y.duration,xa.call(this,this.manifest))},start:function(){y.attributes&&!isNaN(y.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){u.cueOut=y.data},"cue-out-cont":function(){u.cueOutCont=y.data},"cue-in":function(){u.cueIn=y.data},skip:function(){this.manifest.skip=Tn(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part:function(){var k=this;c=!0;var I=this.manifest.segments.length,P=Tn(y.attributes);u.parts=u.parts||[],u.parts.push(P),P.byterange&&(P.byterange.hasOwnProperty("offset")||(P.byterange.offset=b),b=P.byterange.offset+P.byterange.length);var N=u.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+N+" for segment #"+I,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(A,U){A.hasOwnProperty("lastPart")||k.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+U+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var k=this.manifest.serverControl=Tn(y.attributes);k.hasOwnProperty("canBlockReload")||(k.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),xa.call(this,this.manifest),k.canSkipDateranges&&!k.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var k=this.manifest.segments.length,I=Tn(y.attributes),P=I.type&&I.type==="PART";u.preloadHints=u.preloadHints||[],u.preloadHints.push(I),I.byterange&&(I.byterange.hasOwnProperty("offset")||(I.byterange.offset=P?b:0,P&&(b=I.byterange.offset+I.byterange.length)));var N=u.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+N+" for segment #"+k,y.attributes,["TYPE","URI"]),I.type)for(var A=0;Ac&&(u-=c,u-=c,u-=Rt(2))}return Number(u)},Hp=function(e,i){var r=(i===void 0?{}:i).le,t=r!==void 0&&r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!=e)&&(e=0),e=Rt(e);for(var n,a=(n=e,Math.ceil(function(c){return c.toString(2).length}(n)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o=i.length&&u.call(i,function(c,d){return c===(o[d]?o[d]&e[a+d]:e[a+d])})},Ye={},Ae={};function Aa(e,i){return i===void 0&&(i=Object),i&&typeof i.freeze=="function"?i.freeze(e):e}var Tu=Aa({HTML:"text/html",isHTML:function(e){return e===Tu.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Su=Aa({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Su.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ae.assign=function(e,i){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e},Ae.find=function(e,i,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,i);for(var t=0;t=0))throw new St(Pu,new Error(e.tagName+"@"+r));for(var n=i.length-1;t"&&">")||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}function ci(e,i){if(i(e))return!0;if(e=e.firstChild)do if(ci(e,i))return!0;while(e=e.nextSibling)}function di(){this.ownerDocument=this}function Bu(e,i,r,t){e&&e._inc++,r.namespaceURI===ui.XMLNS&&delete i._nsMap[r.prefix?r.localName:""]}function La(e,i,r){if(e&&e._inc){e._inc++;var t=i.childNodes;if(r)t[t.length++]=r;else{for(var n=i.firstChild,a=0;n;)t[a++]=n,n=n.nextSibling;t.length=a,delete t[t.length]}}}function Fu(e,i){var r=i.previousSibling,t=i.nextSibling;return r?r.nextSibling=t:e.firstChild=t,t?t.previousSibling=r:e.lastChild=r,i.parentNode=null,i.previousSibling=null,i.nextSibling=null,La(e.ownerDocument,e),i}function Oe(e){return e&&e.nodeType===dt.DOCUMENT_TYPE_NODE}function Se(e){return e&&e.nodeType===dt.ELEMENT_NODE}function Oa(e){return e&&e.nodeType===dt.TEXT_NODE}function ju(e,i){var r=e.childNodes||[];if(Te(r,Se)||Oe(i))return!1;var t=Te(r,Oe);return!(i&&t&&r.indexOf(t)>r.indexOf(i))}function qu(e,i){var r=e.childNodes||[];if(Te(r,function(n){return Se(n)&&n!==i}))return!1;var t=Te(r,Oe);return!(i&&t&&r.indexOf(t)>r.indexOf(i))}function Xp(e,i,r){if(!function(t){return t&&(t.nodeType===dt.DOCUMENT_NODE||t.nodeType===dt.DOCUMENT_FRAGMENT_NODE||t.nodeType===dt.ELEMENT_NODE)}(e))throw new St(Zt,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new St(Pu,"child not in parent");if(!function(t){return t&&(Se(t)||Oa(t)||Oe(t)||t.nodeType===dt.DOCUMENT_FRAGMENT_NODE||t.nodeType===dt.COMMENT_NODE||t.nodeType===dt.PROCESSING_INSTRUCTION_NODE)}(i)||Oe(i)&&e.nodeType!==dt.DOCUMENT_NODE)throw new St(Zt,"Unexpected node type "+i.nodeType+" for parent node type "+e.nodeType)}function Kp(e,i,r){var t=e.childNodes||[],n=i.childNodes||[];if(i.nodeType===dt.DOCUMENT_FRAGMENT_NODE){var a=n.filter(Se);if(a.length>1||Te(n,Oa))throw new St(Zt,"More than one element or text in fragment");if(a.length===1&&!ju(e,r))throw new St(Zt,"Element in fragment can not be inserted before doctype")}if(Se(i)&&!ju(e,r))throw new St(Zt,"Only one element can be added and only after doctype");if(Oe(i)){if(Te(t,Oe))throw new St(Zt,"Only one doctype is allowed");var s=Te(t,Se);if(r&&t.indexOf(s)1||Te(n,Oa))throw new St(Zt,"More than one element or text in fragment");if(a.length===1&&!qu(e,r))throw new St(Zt,"Element in fragment can not be inserted before doctype")}if(Se(i)&&!qu(e,r))throw new St(Zt,"Only one element can be added and only after doctype");if(Oe(i)){if(Te(t,function(u){return Oe(u)&&u!==r}))throw new St(Zt,"Only one doctype is allowed");var s=Te(t,Se);if(r&&t.indexOf(s)=0;f--)if((_=n[f]).prefix===""&&_.namespace===e.namespaceURI){d=_.namespace;break}}if(d!==e.namespaceURI)for(f=n.length-1;f>=0;f--){var _;if((_=n[f]).namespace===e.namespaceURI){_.prefix&&(c=_.prefix+":"+u);break}}}i.push("<",c);for(var b=0;b"),r&&/^script$/i.test(u))for(;o;)o.data?i.push(o.data):wn(o,i,r,t,n.slice()),o=o.nextSibling;else for(;o;)wn(o,i,r,t,n.slice()),o=o.nextSibling;i.push("")}else i.push("/>");return;case Iu:case Pe:for(o=e.firstChild;o;)wn(o,i,r,t,n.slice()),o=o.nextSibling;return;case Sn:return Fa(i,e.name,e.value);case tr:return i.push(e.data.replace(/[<&>]/g,Uu));case ku:return i.push("");case Du:return i.push("");case Au:var k=e.publicId,I=e.systemId;if(i.push("");else if(I&&I!=".")i.push(" SYSTEM ",I,">");else{var P=e.internalSubset;P&&i.push(" [",P,"]"),i.push(">")}return;case xu:return i.push("");case Cu:return i.push("&",e.nodeName,";");default:i.push("??",e.nodeName)}}function Ku(e,i,r){var t;switch(i.nodeType){case fe:(t=i.cloneNode(!1)).ownerDocument=e;case Pe:break;case Sn:r=!0}if(t||(t=i.cloneNode(!1)),t.ownerDocument=e,t.parentNode=null,r)for(var n=i.firstChild;n;)t.appendChild(Ku(e,n,r)),n=n.nextSibling;return t}function ja(e,i,r){var t=new i.constructor;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var a=i[n];typeof a!="object"&&a!=t[n]&&(t[n]=a)}switch(i.childNodes&&(t.childNodes=new Le),t.ownerDocument=e,t.nodeType){case fe:var s=i.attributes,o=t.attributes=new er,u=s.length;o._ownerElement=t;for(var c=0;c=0&&e0},lookupPrefix:function(e){for(var i=this;i;){var r=i._nsMap;if(r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&r[t]===e)return t}i=i.nodeType==Sn?i.ownerDocument:i.parentNode}return null},lookupNamespaceURI:function(e){for(var i=this;i;){var r=i._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];i=i.nodeType==Sn?i.ownerDocument:i.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}},li(Jt,dt),li(Jt,dt.prototype),di.prototype={nodeName:"#document",nodeType:Iu,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,i){if(e.nodeType==Pe){for(var r=e.firstChild;r;){var t=r.nextSibling;this.insertBefore(r,i),r=t}return e}return nr(this,e,i),e.ownerDocument=this,this.documentElement===null&&e.nodeType===fe&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Fu(this,e)},replaceChild:function(e,i){nr(this,e,i,Hu),e.ownerDocument=this,i&&this.removeChild(i),Se(e)&&(this.documentElement=e)},importNode:function(e,i){return Ku(this,e,i)},getElementById:function(e){var i=null;return ci(this.documentElement,function(r){if(r.nodeType==fe&&r.getAttribute("id")==e)return i=r,!0}),i},getElementsByClassName:function(e){var i=wu(e);return new En(this,function(r){var t=[];return i.length>0&&ci(r.documentElement,function(n){if(n!==r&&n.nodeType===fe){var a=n.getAttribute("class");if(a){var s=e===a;if(!s){var o=wu(a);s=i.every((u=o,function(c){return u&&u.indexOf(c)!==-1}))}s&&t.push(n)}}var u}),t})},createElement:function(e){var i=new an;return i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.localName=e,i.childNodes=new Le,(i.attributes=new er)._ownerElement=i,i},createDocumentFragment:function(){var e=new ar;return e.ownerDocument=this,e.childNodes=new Le,e},createTextNode:function(e){var i=new Ra;return i.ownerDocument=this,i.appendData(e),i},createComment:function(e){var i=new Na;return i.ownerDocument=this,i.appendData(e),i},createCDATASection:function(e){var i=new Ma;return i.ownerDocument=this,i.appendData(e),i},createProcessingInstruction:function(e,i){var r=new Ba;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=i,r},createAttribute:function(e){var i=new ir;return i.ownerDocument=this,i.name=e,i.nodeName=e,i.localName=e,i.specified=!0,i},createEntityReference:function(e){var i=new Ua;return i.ownerDocument=this,i.nodeName=e,i},createElementNS:function(e,i){var r=new an,t=i.split(":"),n=r.attributes=new er;return r.childNodes=new Le,r.ownerDocument=this,r.nodeName=i,r.tagName=i,r.namespaceURI=e,t.length==2?(r.prefix=t[0],r.localName=t[1]):r.localName=i,n._ownerElement=r,r},createAttributeNS:function(e,i){var r=new ir,t=i.split(":");return r.ownerDocument=this,r.nodeName=i,r.name=i,r.namespaceURI=e,r.specified=!0,t.length==2?(r.prefix=t[0],r.localName=t[1]):r.localName=i,r}},$t(di,dt),an.prototype={nodeType:fe,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var i=this.getAttributeNode(e);return i&&i.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,i){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+i,this.setAttributeNode(r)},removeAttribute:function(e){var i=this.getAttributeNode(e);i&&this.removeAttributeNode(i)},appendChild:function(e){return e.nodeType===Pe?this.insertBefore(e,null):function(i,r){return r.parentNode&&r.parentNode.removeChild(r),r.parentNode=i,r.previousSibling=i.lastChild,r.nextSibling=null,r.previousSibling?r.previousSibling.nextSibling=r:i.firstChild=r,i.lastChild=r,La(i.ownerDocument,i,r),r}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,i){var r=this.getAttributeNodeNS(e,i);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,i){return this.getAttributeNodeNS(e,i)!=null},getAttributeNS:function(e,i){var r=this.getAttributeNodeNS(e,i);return r&&r.value||""},setAttributeNS:function(e,i,r){var t=this.ownerDocument.createAttributeNS(e,i);t.value=t.nodeValue=""+r,this.setAttributeNode(t)},getAttributeNodeNS:function(e,i){return this.attributes.getNamedItemNS(e,i)},getElementsByTagName:function(e){return new En(this,function(i){var r=[];return ci(i,function(t){t===i||t.nodeType!=fe||e!=="*"&&t.tagName!=e||r.push(t)}),r})},getElementsByTagNameNS:function(e,i){return new En(this,function(r){var t=[];return ci(r,function(n){n===r||n.nodeType!==fe||e!=="*"&&n.namespaceURI!==e||i!=="*"&&n.localName!=i||t.push(n)}),t})}},di.prototype.getElementsByTagName=an.prototype.getElementsByTagName,di.prototype.getElementsByTagNameNS=an.prototype.getElementsByTagNameNS,$t(an,dt),ir.prototype.nodeType=Sn,$t(ir,dt),hi.prototype={data:"",substringData:function(e,i){return this.data.substring(e,e+i)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,i){this.replaceData(e,0,i)},appendChild:function(e){throw new Error(At[Zt])},deleteData:function(e,i){this.replaceData(e,i,"")},replaceData:function(e,i,r){r=this.data.substring(0,e)+r+this.data.substring(e+i),this.nodeValue=this.data=r,this.length=r.length}},$t(hi,dt),Ra.prototype={nodeName:"#text",nodeType:tr,splitText:function(e){var i=this.data,r=i.substring(e);i=i.substring(0,e),this.data=this.nodeValue=i,this.length=i.length;var t=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling),t}},$t(Ra,hi),Na.prototype={nodeName:"#comment",nodeType:Du},$t(Na,hi),Ma.prototype={nodeName:"#cdata-section",nodeType:ku},$t(Ma,hi),rr.prototype.nodeType=Au,$t(rr,dt),Vu.prototype.nodeType=zp,$t(Vu,dt),Wu.prototype.nodeType=Gp,$t(Wu,dt),Ua.prototype.nodeType=Cu,$t(Ua,dt),ar.prototype.nodeName="#document-fragment",ar.prototype.nodeType=Pe,$t(ar,dt),Ba.prototype.nodeType=xu,$t(Ba,dt),Gu.prototype.serializeToString=function(e,i,r){return zu.call(e,i,r)},dt.prototype.toString=zu;try{if(Object.defineProperty){let e=function(i){switch(i.nodeType){case fe:case Pe:var r=[];for(i=i.firstChild;i;)i.nodeType!==7&&i.nodeType!==8&&r.push(e(i)),i=i.nextSibling;return r.join("");default:return i.nodeValue}};Object.defineProperty(En.prototype,"length",{get:function(){return Pa(this),this.$$length}}),Object.defineProperty(dt.prototype,"textContent",{get:function(){return e(this)},set:function(i){switch(this.nodeType){case fe:case Pe:for(;this.firstChild;)this.removeChild(this.firstChild);(i||String(i))&&this.appendChild(this.ownerDocument.createTextNode(i));break;default:this.data=i,this.value=i,this.nodeValue=i}}}),Yu=function(i,r,t){i["$$"+r]=t}}}catch{}Ye.DocumentType=rr,Ye.DOMException=St,Ye.DOMImplementation=Mu,Ye.Element=an,Ye.Node=dt,Ye.NodeList=Le,Ye.XMLSerializer=Gu;var sr={},Qu={};(function(e){var i=Ae.freeze;e.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=i({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}),e.entityMap=e.HTML_ENTITIES})(Qu);var qa={},pi=Ae.NAMESPACE,Ha=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,$u=new RegExp("[\\-\\.0-9"+Ha.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Ju=new RegExp("^"+Ha.source+$u.source+"*(?::"+Ha.source+$u.source+"*)?$"),fi=0,Qe=1,kn=2,mi=3,Cn=4,xn=5,gi=6,or=7;function Dn(e,i){this.message=e,this.locator=i,Error.captureStackTrace&&Error.captureStackTrace(this,Dn)}function Zu(){}function tl(e,i){return i.lineNumber=e.lineNumber,i.columnNumber=e.columnNumber,i}function Yp(e,i,r,t,n,a){function s(f,_,b){r.attributeNames.hasOwnProperty(f)&&a.fatalError("Attribute "+f+" redefined"),r.addValue(f,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),b)}for(var o,u=++i,c=fi;;){var d=e.charAt(u);switch(d){case"=":if(c===Qe)o=e.slice(i,u),c=mi;else{if(c!==kn)throw new Error("attribute equal must after attrName");c=mi}break;case"'":case'"':if(c===mi||c===Qe){if(c===Qe&&(a.warning('attribute value must after "="'),o=e.slice(i,u)),i=u+1,!((u=e.indexOf(d,i))>0))throw new Error("attribute value no end '"+d+"' match");s(o,m=e.slice(i,u),i-1),c=xn}else{if(c!=Cn)throw new Error('attribute value must after "="');s(o,m=e.slice(i,u),i),a.warning('attribute "'+o+'" missed start quot('+d+")!!"),i=u+1,c=xn}break;case"/":switch(c){case fi:r.setTagName(e.slice(i,u));case xn:case gi:case or:c=or,r.closed=!0;case Cn:case Qe:break;case kn:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),c==fi&&r.setTagName(e.slice(i,u)),u;case">":switch(c){case fi:r.setTagName(e.slice(i,u));case xn:case gi:case or:break;case Cn:case Qe:(m=e.slice(i,u)).slice(-1)==="/"&&(r.closed=!0,m=m.slice(0,-1));case kn:c===kn&&(m=o),c==Cn?(a.warning('attribute "'+m+'" missed quot(")!'),s(o,m,i)):(pi.isHTML(t[""])&&m.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+m+'" missed value!! "'+m+'" instead!!'),s(m,m,i));break;case mi:throw new Error("attribute value missed!!")}return u;case"\x80":d=" ";default:if(d<=" ")switch(c){case fi:r.setTagName(e.slice(i,u)),c=gi;break;case Qe:o=e.slice(i,u),c=kn;break;case Cn:var m=e.slice(i,u);a.warning('attribute "'+m+'" missed quot(")!!'),s(o,m,i);case xn:c=gi}else switch(c){case kn:r.tagName,pi.isHTML(t[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,i),i=u,c=Qe;break;case xn:a.warning('attribute space is required"'+o+'"!!');case gi:c=Qe,i=u;break;case mi:c=Cn,i=u;break;case or:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function el(e,i,r){for(var t=e.tagName,n=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((f=o.indexOf(":"))>0)var c=s.prefix=o.slice(0,f),d=o.slice(f+1),m=c==="xmlns"&&d;else d=o,c=null,m=o==="xmlns"&&"";s.localName=d,m!==!1&&(n==null&&(n={},nl(r,r={})),r[m]=n[m]=u,s.uri=pi.XMLNS,i.startPrefixMapping(m,u))}for(a=e.length;a--;)(c=(s=e[a]).prefix)&&(c==="xml"&&(s.uri=pi.XML),c!=="xmlns"&&(s.uri=r[c||""]));var f;(f=t.indexOf(":"))>0?(c=e.prefix=t.slice(0,f),d=e.localName=t.slice(f+1)):(c=null,d=e.localName=t);var _=e.uri=r[c||""];if(i.startElement(_,d,t,e),!e.closed)return e.currentNSMap=r,e.localNSMap=n,!0;if(i.endElement(_,d,t),n)for(c in n)Object.prototype.hasOwnProperty.call(n,c)&&i.endPrefixMapping(c)}function Qp(e,i,r,t,n){if(/^(?:script|textarea)$/i.test(r)){var a=e.indexOf("",i),s=e.substring(i+1,a);if(/[&<]/.test(s))return/^script$/i.test(r)?(n.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,t),n.characters(s,0,s.length),a)}return i+1}function $p(e,i,r,t){var n=t[r];return n==null&&((n=e.lastIndexOf(""))",i+4))>i?(r.comment(e,i+4,n-i-4),n+3):(t.error("Unclosed comment"),-1):-1;if(e.substr(i+3,6)=="CDATA["){var n=e.indexOf("]]>",i+9);return r.startCDATA(),r.characters(e,i+9,n-i-9),r.endCDATA(),n+3}var a=function(m,f){var _,b=[],y=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(y.lastIndex=f,y.exec(m);_=y.exec(m);)if(b.push(_),_[1])return b}(e,i),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,c=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],c=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(c=a[3][0]));var d=a[s-1];return r.startDTD(o,u,c),r.endDTD(),d.index+d[0].length}return-1}function Zp(e,i,r){var t=e.indexOf("?>",i);if(t){var n=e.substring(i,t).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return n?(n[0].length,r.processingInstruction(n[1],n[2]),t+2):-1}return-1}function il(){this.attributeNames={}}Dn.prototype=new Error,Dn.prototype.name=Dn.name,Zu.prototype={parse:function(e,i,r){var t=this.domBuilder;t.startDocument(),nl(i,i={}),function(n,a,s,o,u){function c(J){if(J>65535){var rt=55296+((J-=65536)>>10),se=56320+(1023&J);return String.fromCharCode(rt,se)}return String.fromCharCode(J)}function d(J){var rt=J.slice(1,-1);return Object.hasOwnProperty.call(s,rt)?s[rt]:rt.charAt(0)==="#"?c(parseInt(rt.substr(1).replace("x","0x"))):(u.error("entity not found:"+J),J)}function m(J){if(J>I){var rt=n.substring(I,J).replace(/&#?\w+;/g,d);E&&f(I),o.characters(rt,0,J-I),I=J}}function f(J,rt){for(;J>=b&&(rt=y.exec(n));)_=rt.index,b=_+rt[0].length,E.lineNumber++;E.columnNumber=J-_+1}for(var _=0,b=0,y=/.*(?:\r\n?|\n)|.*$/g,E=o.locator,w=[{currentNSMap:a}],k={},I=0;;){try{var P=n.indexOf("<",I);if(P<0){if(!n.substr(I).match(/^\s*$/)){var N=o.doc,A=N.createTextNode(n.substr(I));N.appendChild(A),o.currentElement=A}return}switch(P>I&&m(P),n.charAt(P+1)){case"/":var U=n.indexOf(">",P+3),B=n.substring(P+2,U).replace(/[ \t\n\r]+$/g,""),R=w.pop();U<0?(B=n.substring(P+2).replace(/[\s<].*/,""),u.error("end tag name: "+B+" is not complete:"+R.tagName),U=P+1+B.length):B.match(/\sI?I=U:m(Math.max(P,I)+1)}}(e,i,r,t,this.errorHandler),t.endDocument()}},il.prototype={setTagName:function(e){if(!Ju.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,i,r){if(!Ju.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:i,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},qa.XMLReader=Zu,qa.ParseError=Dn;var tf=Ae,rl=Qu,al=qa,ef=Ye.DOMImplementation,sl=tf.NAMESPACE,nf=al.ParseError,rf=al.XMLReader;function ol(e){return e.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function ul(e){this.options=e||{locator:{}}}function vi(){this.cdata=!1}function In(e,i){i.lineNumber=e.lineNumber,i.columnNumber=e.columnNumber}function Va(e){if(e)return` @`+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function ll(e,i,r){return typeof e=="string"?e.substr(i,r):e.length>=i+r||i?new java.lang.String(e,i,r)+"":e}function ur(e,i){e.currentElement?e.currentElement.appendChild(i):e.doc.appendChild(i)}ul.prototype.parseFromString=function(e,i){var r=this.options,t=new rf,n=r.domBuilder||new vi,a=r.errorHandler,s=r.locator,o=r.xmlns||{},u=/\/x?html?$/.test(i),c=u?rl.HTML_ENTITIES:rl.XML_ENTITIES;s&&n.setDocumentLocator(s),t.errorHandler=function(m,f,_){if(!m){if(f instanceof vi)return f;m=f}var b={},y=m instanceof Function;function E(w){var k=m[w];!k&&y&&(k=m.length==2?function(I){m(w,I)}:m),b[w]=k&&function(I){k("[xmldom "+w+"] "+I+Va(_))}||function(){}}return _=_||{},E("warning"),E("error"),E("fatalError"),b}(a,n,s),t.domBuilder=r.domBuilder||n,u&&(o[""]=sl.HTML),o.xml=o.xml||sl.XML;var d=r.normalizeLineEndings||ol;return e&&typeof e=="string"?t.parse(d(e),o,c):t.errorHandler.error("invalid doc source"),n.doc},vi.prototype={startDocument:function(){this.doc=new ef().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,i,r,t){var n=this.doc,a=n.createElementNS(e,r||i),s=t.length;ur(this,a),this.currentElement=a,this.locator&&In(this.locator,a);for(var o=0;on.timeline?1:-1});var i,r},gl=function(e){var i,r,t=[];return i=e,r=function(n,a,s,o){t=t.concat(n.playlists||[])},pf.forEach(function(n){for(var a in i.mediaGroups[n])for(var s in i.mediaGroups[n][a]){var o=i.mediaGroups[n][a][s];r(o,n,a,s)}}),t},vl=function(e){var i=e.playlist,r=e.mediaSequence;i.mediaSequence=r,i.segments.forEach(function(t,n){t.number=i.mediaSequence+n})},ff=function(e){var i=e.oldManifest,r=e.newManifest,t=i.playlists.concat(gl(i)),n=r.playlists.concat(gl(r));return r.timelineStarts=ml([i.timelineStarts,r.timelineStarts]),function(a){var s=a.oldPlaylists,o=a.newPlaylists,u=a.timelineStarts;o.forEach(function(c){c.discontinuitySequence=Wa(u,function(_){return _.timeline===c.timeline});var d=function(_,b){for(var y=0;y<_.length;y++)if(_[y].attributes.NAME===b)return _[y];return null}(s,c.attributes.NAME);if(d&&!c.sidx){var m=c.segments[0],f=Wa(d.segments,function(_){return Math.abs(_.presentationTime-m.presentationTime)<.016666666666666666});if(f===-1)return vl({playlist:c,mediaSequence:d.mediaSequence+d.segments.length}),c.segments[0].discontinuity=!0,c.discontinuityStarts.unshift(0),void((!d.segments.length&&c.timeline>d.timeline||d.segments.length&&c.timeline>d.segments[d.segments.length-1].timeline)&&c.discontinuitySequence--);d.segments[f].discontinuity&&!m.discontinuity&&(m.discontinuity=!0,c.discontinuityStarts.unshift(0),c.discontinuitySequence--),vl({playlist:c,mediaSequence:d.segments[f].number})}})}({oldPlaylists:t,newPlaylists:n,timelineStarts:r.timelineStarts}),r},cr=function(e){return e&&e.uri+"-"+(i=e.byterange,r=typeof i.offset=="bigint"||typeof i.length=="bigint"?D.BigInt(i.offset)+D.BigInt(i.length)-D.BigInt(1):i.offset+i.length-1,i.offset+"-"+r);var i,r},Xa=function(e){return dl(e.reduce(function(i,r){var t=r.attributes.id+(r.attributes.lang||"");if(i[t]){var n;r.segments&&(r.segments[0]&&(r.segments[0].discontinuity=!0),(n=i[t].segments).push.apply(n,r.segments)),r.attributes.contentProtection&&(i[t].attributes.contentProtection=r.attributes.contentProtection)}else i[t]=r,i[t].attributes.timelineStarts=[];return i[t].attributes.timelineStarts.push({start:r.attributes.periodStart,timeline:r.attributes.periodStart}),i},{})).map(function(i){var r,t;return i.discontinuityStarts=(r=i.segments||[],t="discontinuity",r.reduce(function(n,a,s){return a[t]&&n.push(s),n},[])),i})},Ka=function(e,i){var r=cr(e.sidx),t=r&&i[r]&&i[r].sidx;return t&&za(e,t,e.sidx.resolvedUri),e},mf=function(e,i){if(i===void 0&&(i={}),!Object.keys(i).length)return e;for(var r in e)e[r]=Ka(e[r],i);return e},gf=function(e){var i,r=e.attributes,t=e.segments,n=e.sidx,a=e.discontinuityStarts,s={attributes:(i={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:t};return r.frameRate&&(s.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(s.contentProtection=r.contentProtection),n&&(s.sidx=n),s},vf=function(e){var i=e.attributes;return i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video"},yf=function(e){var i=e.attributes;return i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio"},_f=function(e){var i=e.attributes;return i.mimeType==="text/vtt"||i.contentType==="text"},yl=function(e){return e?Object.keys(e).reduce(function(i,r){var t=e[r];return i.concat(t.playlists)},[]):[]},bf=function(e){var i,r=e.dashPlaylists,t=e.locations,n=e.sidxMapping,a=n===void 0?{}:n,s=e.previousManifest;if(!r.length)return{};var o=r[0].attributes,u=o.sourceDuration,c=o.type,d=o.suggestedPresentationDelay,m=o.minimumUpdatePeriod,f=Xa(r.filter(vf)).map(gf),_=Xa(r.filter(yf)),b=Xa(r.filter(_f)),y=r.map(function(B){return B.attributes.captionServices}).filter(Boolean),E={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:u,playlists:mf(f,a)};m>=0&&(E.minimumUpdatePeriod=1e3*m),t&&(E.locations=t),c==="dynamic"&&(E.suggestedPresentationDelay=d);var w,k,I=E.playlists.length===0,P=_.length?function(B,R,q){var $;R===void 0&&(R={}),q===void 0&&(q=!1);var Y=B.reduce(function(K,Q){var X=Q.attributes.role&&Q.attributes.role.value||"",nt=Q.attributes.lang||"",at=Q.attributes.label||"main";if(nt&&!Q.attributes.label){var ht=X?" ("+X+")":"";at=""+Q.attributes.lang+ht}K[at]||(K[at]={language:nt,autoselect:!0,default:X==="main",playlists:[],uri:""});var J=Ka(function(rt,se){var le,Kt=rt.attributes,ji=rt.segments,Dt=rt.sidx,na=rt.mediaSequence,qi=rt.discontinuitySequence,ia=rt.discontinuityStarts,Ge={attributes:(le={NAME:Kt.id,BANDWIDTH:Kt.bandwidth,CODECS:Kt.codecs},le["PROGRAM-ID"]=1,le),uri:"",endList:Kt.type==="static",timeline:Kt.periodStart,resolvedUri:"",targetDuration:Kt.duration,discontinuitySequence:qi,discontinuityStarts:ia,timelineStarts:Kt.timelineStarts,mediaSequence:na,segments:ji};return Kt.contentProtection&&(Ge.contentProtection=Kt.contentProtection),Dt&&(Ge.sidx=Dt),se&&(Ge.attributes.AUDIO="audio",Ge.attributes.SUBTITLES="subs"),Ge}(Q,q),R);return K[at].playlists.push(J),$===void 0&&X==="main"&&(($=Q).default=!0),K},{});return $||(Y[Object.keys(Y)[0]].default=!0),Y}(_,a,I):null,N=b.length?function(B,R){return R===void 0&&(R={}),B.reduce(function(q,$){var Y=$.attributes.lang||"text";return q[Y]||(q[Y]={language:Y,default:!1,autoselect:!1,playlists:[],uri:""}),q[Y].playlists.push(Ka(function(K){var Q,X=K.attributes,nt=K.segments,at=K.mediaSequence,ht=K.discontinuityStarts,J=K.discontinuitySequence;nt===void 0&&(nt=[{uri:X.baseUrl,timeline:X.periodStart,resolvedUri:X.baseUrl||"",duration:X.sourceDuration,number:0}],X.duration=X.sourceDuration);var rt=((Q={NAME:X.id,BANDWIDTH:X.bandwidth})["PROGRAM-ID"]=1,Q);return X.codecs&&(rt.CODECS=X.codecs),{attributes:rt,uri:"",endList:X.type==="static",timeline:X.periodStart,resolvedUri:X.baseUrl||"",targetDuration:X.duration,timelineStarts:X.timelineStarts,discontinuityStarts:ht,discontinuitySequence:J,mediaSequence:at,segments:nt}}($),R)),q},{})}(b,a):null,A=f.concat(yl(P),yl(N)),U=A.map(function(B){return B.timelineStarts});return E.timelineStarts=ml(U),w=A,k=E.timelineStarts,w.forEach(function(B){B.mediaSequence=0,B.discontinuitySequence=Wa(k,function(R){return R.timeline===B.timeline}),B.segments&&B.segments.forEach(function(R,q){R.number=q})}),P&&(E.mediaGroups.AUDIO.audio=P),N&&(E.mediaGroups.SUBTITLES.subs=N),y.length&&(E.mediaGroups["CLOSED-CAPTIONS"].cc=y.reduce(function(B,R){return R&&R.forEach(function(q){var $=q.channel,Y=q.language;B[Y]={autoselect:!1,default:!1,instreamId:$,language:Y},q.hasOwnProperty("aspectRatio")&&(B[Y].aspectRatio=q.aspectRatio),q.hasOwnProperty("easyReader")&&(B[Y].easyReader=q.easyReader),q.hasOwnProperty("3D")&&(B[Y]["3D"]=q["3D"])}),B},{})),s?ff({oldManifest:s,newManifest:E}):E},Tf=function(e,i,r){var t=e.NOW,n=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=s===void 0?1:s,u=e.periodStart,c=u===void 0?0:u,d=e.minimumUpdatePeriod,m=(t+n)/1e3+(d===void 0?0:d)-(a+c);return Math.ceil((m*o-i)/r)},_l=function(e,i){for(var r=e.type,t=e.minimumUpdatePeriod,n=t===void 0?0:t,a=e.media,s=a===void 0?"":a,o=e.sourceDuration,u=e.timescale,c=u===void 0?1:u,d=e.startNumber,m=d===void 0?1:d,f=e.periodStart,_=[],b=-1,y=0;yb&&(b=I);var P=void 0;if(k<0){var N=y+1;P=N===i.length?r==="dynamic"&&n>0&&s.indexOf("$Number$")>0?Tf(e,b,w):(o*c-b)/w:(i[N].t-b)/w}else P=k+1;for(var A=m+_.length+P,U=m+_.length;U=s?o:""+new Array(s-o.length+1).join("0")+o)}}(i))},Ef=function(e,i){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},t=e.initialization,n=t===void 0?{sourceURL:"",range:""}:t,a=yi({baseUrl:e.baseUrl,source:bl(n.sourceURL,r),range:n.range}),s=function(o,u){return o.duration||u?o.duration?Ga(o):_l(o,u):[{number:o.startNumber||1,duration:o.sourceDuration,time:0,timeline:o.periodStart}]}(e,i);return s.map(function(o){r.Number=o.number,r.Time=o.time;var u=bl(e.media||"",r),c=e.timescale||1,d=e.presentationTimeOffset||0,m=e.periodStart+(o.time-d)/c;return{uri:u,timeline:o.timeline,duration:o.duration,resolvedUri:Ji(e.baseUrl||"",u),map:a,number:o.number,presentationTime:m}})},wf=function(e,i){var r=e.duration,t=e.segmentUrls,n=t===void 0?[]:t,a=e.periodStart;if(!r&&!i||r&&i)throw new Error(cf);var s,o=n.map(function(u){return function(c,d){var m=c.baseUrl,f=c.initialization,_=f===void 0?{}:f,b=yi({baseUrl:m,source:_.sourceURL,range:_.range}),y=yi({baseUrl:m,source:d.media,range:d.mediaRange});return y.map=b,y}(e,u)});return r&&(s=Ga(e)),i&&(s=_l(e,i)),s.map(function(u,c){if(o[c]){var d=o[c],m=e.timescale||1,f=e.presentationTimeOffset||0;return d.timeline=u.timeline,d.duration=u.duration,d.number=u.number,d.presentationTime=a+(u.time-f)/m,d}}).filter(function(u){return u})},kf=function(e){var i,r,t=e.attributes,n=e.segmentInfo;n.template?(r=Ef,i=Ht(t,n.template)):n.base?(r=fl,i=Ht(t,n.base)):n.list&&(r=wf,i=Ht(t,n.list));var a={attributes:t};if(!r)return a;var s=r(i,n.segmentTimeline);if(i.duration){var o=i,u=o.duration,c=o.timescale,d=c===void 0?1:c;i.duration=u/d}else s.length?i.duration=s.reduce(function(m,f){return Math.max(m,Math.ceil(f.duration))},0):i.duration=0;return a.attributes=i,a.segments=s,n.base&&i.indexRange&&(a.sidx=s[0],a.segments=[]),a},Et=function(e,i){return hl(e.childNodes).filter(function(r){return r.tagName===i})},Ya=function(e){return e.textContent.trim()},An=function(e){var i=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!i)return 0;var r=i.slice(1),t=r[0],n=r[1],a=r[2],s=r[3],o=r[4],u=r[5];return 31536e3*parseFloat(t||0)+2592e3*parseFloat(n||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},Tl={mediaPresentationDuration:function(e){return An(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i=e)&&(i+="Z"),Date.parse(i)/1e3;var i},minimumUpdatePeriod:function(e){return An(e)},suggestedPresentationDelay:function(e){return An(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return An(e)},start:function(e){return An(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return function(i){return parseFloat(i.split("/").reduce(function(r,t){return r/t}))}(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var i=parseInt(e,10);return isNaN(i)?An(e):i},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Bt=function(e){return e&&e.attributes?hl(e.attributes).reduce(function(i,r){var t=Tl[r.name]||Tl.DEFAULT;return i[r.name]=t(r.value),i},{}):{}},Cf={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},dr=function(e,i){return i.length?lr(e.map(function(r){return i.map(function(t){return Ji(r,Ya(t))})})):e},Qa=function(e){var i=Et(e,"SegmentTemplate")[0],r=Et(e,"SegmentList")[0],t=r&&Et(r,"SegmentURL").map(function(m){return Ht({tag:"SegmentURL"},Bt(m))}),n=Et(e,"SegmentBase")[0],a=r||i,s=a&&Et(a,"SegmentTimeline")[0],o=r||n||i,u=o&&Et(o,"Initialization")[0],c=i&&Bt(i);c&&u?c.initialization=u&&Bt(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var d={template:c,segmentTimeline:s&&Et(s,"S").map(function(m){return Bt(m)}),list:r&&Ht(Bt(r),{segmentUrls:t,initialization:Bt(u)}),base:n&&Ht(Bt(n),{initialization:Bt(u)})};return Object.keys(d).forEach(function(m){d[m]||delete d[m]}),d},xf=function(e,i,r){return function(t){var n,a=Bt(t),s=dr(i,Et(t,"BaseURL")),o=Et(t,"Role")[0],u={role:Bt(o)},c=Ht(e,a,u),d=Et(t,"Accessibility")[0],m=(n=Bt(d)).schemeIdUri==="urn:scte:dash:cc:cea-608:2015"?(typeof n.value!="string"?[]:n.value.split(";")).map(function(k){var I,P;if(P=k,/^CC\d=/.test(k)){var N=k.split("=");I=N[0],P=N[1]}else/^CC\d$/.test(k)&&(I=k);return{channel:I,language:P}}):n.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"?(typeof n.value!="string"?[]:n.value.split(";")).map(function(k){var I={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(k)){var P=k.split("="),N=P[0],A=P[1],U=A===void 0?"":A;I.channel=N,I.language=k,U.split(",").forEach(function(B){var R=B.split(":"),q=R[0],$=R[1];q==="lang"?I.language=$:q==="er"?I.easyReader=Number($):q==="war"?I.aspectRatio=Number($):q==="3D"&&(I["3D"]=Number($))})}else I.language=k;return I.channel&&(I.channel="SERVICE"+I.channel),I}):void 0;m&&(c=Ht(c,{captionServices:m}));var f=Et(t,"Label")[0];if(f&&f.childNodes.length){var _=f.childNodes[0].nodeValue.trim();c=Ht(c,{label:_})}var b=Et(t,"ContentProtection").reduce(function(k,I){var P=Bt(I);P.schemeIdUri&&(P.schemeIdUri=P.schemeIdUri.toLowerCase());var N=Cf[P.schemeIdUri];if(N){k[N]={attributes:P};var A=Et(I,"cenc:pssh")[0];if(A){var U=Ya(A);k[N].pssh=U&&pu(U)}}return k},{});Object.keys(b).length&&(c=Ht(c,{contentProtection:b}));var y=Qa(t),E=Et(t,"Representation"),w=Ht(r,y);return lr(E.map(function(k,I,P){return function(N){var A=Et(N,"BaseURL"),U=dr(I,A),B=Ht(k,Bt(N)),R=Qa(N);return U.map(function(q){return{segmentInfo:Ht(P,R),attributes:Ht(B,{baseUrl:q})}})}}(c,s,w)))}},Df=function(e,i){return function(r,t){var n=dr(i,Et(r.node,"BaseURL")),a=Ht(e,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var s=Et(r.node,"AdaptationSet"),o=Qa(r.node);return lr(s.map(xf(a,n,o)))}},Sl=function(e){if(e==="")throw new Error(of);var i,r,t=new af;try{r=(i=t.parseFromString(e,"application/xml"))&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(uf);return r},If=function(e,i){i===void 0&&(i={});var r=function(n,a){a===void 0&&(a={});var s=a,o=s.manifestUri,u=o===void 0?"":o,c=s.NOW,d=c===void 0?Date.now():c,m=s.clientOffset,f=m===void 0?0:m,_=Et(n,"Period");if(!_.length)throw new Error(sf);var b=Et(n,"Location"),y=Bt(n),E=dr([u],Et(n,"BaseURL"));y.type=y.type||"static",y.sourceDuration=y.mediaPresentationDuration||0,y.NOW=d,y.clientOffset=f,b.length&&(y.locations=b.map(Ya));var w=[];return _.forEach(function(k,I){var P=Bt(k),N=w[I-1];P.start=function(A){var U=A.attributes,B=A.priorPeriodAttributes,R=A.mpdType;return typeof U.start=="number"?U.start:B&&typeof B.start=="number"&&typeof B.duration=="number"?B.start+B.duration:B||R!=="static"?null:0}({attributes:P,priorPeriodAttributes:N?N.attributes:null,mpdType:y.type}),w.push({node:k,attributes:P})}),{locations:y.locations,representationInfo:lr(w.map(Df(y,E)))}}(Sl(e),i),t=r.representationInfo.map(kf);return bf({dashPlaylists:t,locations:r.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest})},Af=function(e){return function(i){var r=Et(i,"UTCTiming")[0];if(!r)return null;var t=Bt(r);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(df)}return t}(Sl(e))},Pf=Math.pow(2,32),El=function(e){var i,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(i=r.getBigUint64(0))0;t+=12,n--)r.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return r};const Of=en(Lf);var Rf=Z([73,68,51]),_i=function e(i,r){return r===void 0&&(r=0),(i=Z(i)).length-r<10||!bt(i,Rf,{offset:r})?r:(r+=function(t,n){n===void 0&&(n=0);var a=(t=Z(t))[n+5],s=t[n+6]<<21|t[n+7]<<14|t[n+8]<<7|t[n+9];return(16&a)>>4?s+20:s+10}(i,r),e(i,r))},wl=function(e){return typeof e=="string"?bu(e):e},Nf=function e(i,r,t){t===void 0&&(t=!1),r=function(d){return Array.isArray(d)?d.map(function(m){return wl(m)}):[wl(d)]}(r),i=Z(i);var n=[];if(!r.length)return n;for(var a=0;a>>0,o=i.subarray(a+4,a+8);if(s===0)break;var u=a+s;if(u>i.length){if(t)break;u=i.length}var c=i.subarray(a+8,u);bt(o,r[0])&&(r.length===1?n.push(c):n.push.apply(n,e(c,r.slice(1),t))),a=u}return n},hr={EBML:Z([26,69,223,163]),DocType:Z([66,130]),Segment:Z([24,83,128,103]),SegmentInfo:Z([21,73,169,102]),Tracks:Z([22,84,174,107]),Track:Z([174]),TrackNumber:Z([215]),DefaultDuration:Z([35,227,131]),TrackEntry:Z([174]),TrackType:Z([131]),FlagDefault:Z([136]),CodecID:Z([134]),CodecPrivate:Z([99,162]),VideoTrack:Z([224]),AudioTrack:Z([225]),Cluster:Z([31,67,182,117]),Timestamp:Z([231]),TimestampScale:Z([42,215,177]),BlockGroup:Z([160]),BlockDuration:Z([155]),Block:Z([161]),SimpleBlock:Z([163])},$a=[128,64,32,16,8,4,2,1],pr=function(e,i,r,t){r===void 0&&(r=!0),t===void 0&&(t=!1);var n=function(s){for(var o=1,u=0;u<$a.length&&!(s&$a[u]);u++)o++;return o}(e[i]),a=e.subarray(i,i+n);return r&&((a=Array.prototype.slice.call(e,i,i+n))[0]^=$a[n-1]),{length:n,value:qp(a,{signed:t}),bytes:a}},kl=function e(i){return typeof i=="string"?i.match(/.{1,2}/g).map(function(r){return e(r)}):typeof i=="number"?Hp(i):i},Mf=function e(i,r,t){if(t>=r.length)return r.length;var n=pr(r,t,!1);if(bt(i.bytes,n.bytes))return t;var a=pr(r,t+n.length);return e(i,r,t+a.length+a.value+n.length)},Cl=function e(i,r){r=function(d){return Array.isArray(d)?d.map(function(m){return kl(m)}):[kl(d)]}(r),i=Z(i);var t=[];if(!r.length)return t;for(var n=0;ni.length?i.length:o+s.value,c=i.subarray(o,u);bt(r[0],a.bytes)&&(r.length===1?t.push(c):t=t.concat(e(c,r.slice(1)))),n+=a.length+s.length+c.length}return t},Uf=Z([0,0,0,1]),Bf=Z([0,0,1]),Ff=Z([0,0,3]),jf=function(e){for(var i=[],r=1;r>1&63),r.indexOf(u)!==-1&&(n=a+o),a+=o+(i==="h264"?1:2)}else a++}return e.subarray(0,0)},Vt={webm:Z([119,101,98,109]),matroska:Z([109,97,116,114,111,115,107,97]),flac:Z([102,76,97,67]),ogg:Z([79,103,103,83]),ac3:Z([11,119]),riff:Z([82,73,70,70]),avi:Z([65,86,73]),wav:Z([87,65,86,69]),"3gp":Z([102,116,121,112,51,103]),mp4:Z([102,116,121,112]),fmp4:Z([115,116,121,112]),mov:Z([102,116,121,112,113,116]),moov:Z([109,111,111,118]),moof:Z([109,111,111,102])},Pn={aac:function(e){var i=_i(e);return bt(e,[255,16],{offset:i,mask:[255,22]})},mp3:function(e){var i=_i(e);return bt(e,[255,2],{offset:i,mask:[255,6]})},webm:function(e){var i=Cl(e,[hr.EBML,hr.DocType])[0];return bt(i,Vt.webm)},mkv:function(e){var i=Cl(e,[hr.EBML,hr.DocType])[0];return bt(i,Vt.matroska)},mp4:function(e){return!Pn["3gp"](e)&&!Pn.mov(e)&&(!(!bt(e,Vt.mp4,{offset:4})&&!bt(e,Vt.fmp4,{offset:4}))||!(!bt(e,Vt.moof,{offset:4})&&!bt(e,Vt.moov,{offset:4}))||void 0)},mov:function(e){return bt(e,Vt.mov,{offset:4})},"3gp":function(e){return bt(e,Vt["3gp"],{offset:4})},ac3:function(e){var i=_i(e);return bt(e,Vt.ac3,{offset:i})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var i=0;i+1880?f:0)}if(D.console){var _=D.console[o];_||o!=="debug"||(_=D.console.info||D.console.log),_&&d&&m.test(o)&&_[Array.isArray(c)?"apply":"call"](D.console,c)}}}(i,n),n.createLogger=function(a){return e(i+": "+a)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(a){if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error('"'+a+'" in not a valid log level');t=a}return t},(n.history=function(){return te?[].concat(te):[]}).filter=function(a){return(te||[]).filter(function(s){return new RegExp(".*"+a+".*").test(s[0])})},n.history.clear=function(){te&&(te.length=0)},n.history.disable=function(){te!==null&&(te.length=0,te=null)},n.history.enable=function(){te===null&&(te=[])},n.error=function(){for(var a=arguments.length,s=new Array(a),o=0;o1?i-1:0),t=1;t=0)throw new Error("class has illegal whitespace characters")}function Rn(){return H===D.document}function Nn(e){return Ne(e)&&e.nodeType===1}function ql(){try{return D.parent!==D.self}catch{return!0}}function Hl(e){return function(i,r){if(!Fl(i))return H[e](null);Fl(r)&&(r=H.querySelector(r));var t=Nn(r)?r:H;return t[e]&&t[e](i)}}function ot(e,i,r,t){e===void 0&&(e="div"),i===void 0&&(i={}),r===void 0&&(r={});var n=H.createElement(e);return Object.getOwnPropertyNames(i).forEach(function(a){var s=i[a];a.indexOf("aria-")!==-1||a==="role"||a==="type"?(it.warn(`Setting attributes in the second argument of createEl() has been deprecated. Use the third argument instead. createEl(type, properties, attributes). Attempting to set `+a+" to "+s+"."),n.setAttribute(a,s)):a==="textContent"?sn(n,s):n[a]===s&&a!=="tabIndex"||(n[a]=s)}),Object.getOwnPropertyNames(r).forEach(function(a){n.setAttribute(a,r[a])}),t&&cs(n,t),n}function sn(e,i){return e.textContent===void 0?e.innerText=i:e.textContent=i,e}function us(e,i){i.firstChild?i.insertBefore(e,i.firstChild):i.appendChild(e)}function on(e,i){return jl(i),e.classList?e.classList.contains(i):(r=i,new RegExp("(^|\\s)"+r+"($|\\s)")).test(e.className);var r}function Be(e,i){return e.classList?e.classList.add(i):on(e,i)||(e.className=(e.className+" "+i).trim()),e}function ki(e,i){return e?(e.classList?e.classList.remove(i):(jl(i),e.className=e.className.split(/\s+/).filter(function(r){return r!==i}).join(" ")),e):(it.warn("removeClass was called with an element that doesn't exist"),null)}function Vl(e,i,r){var t=on(e,i);if(typeof r=="function"&&(r=r(e,i)),typeof r!="boolean"&&(r=!t),r!==t)return r?Be(e,i):ki(e,i),e}function Wl(e,i){Object.getOwnPropertyNames(i).forEach(function(r){var t=i[r];t==null||t===!1?e.removeAttribute(r):e.setAttribute(r,t===!0?"":t)})}function Fe(e){var i={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var t=e.attributes,n=t.length-1;n>=0;n--){var a=t[n].name,s=t[n].value;typeof e[a]!="boolean"&&r.indexOf(","+a+",")===-1||(s=s!==null),i[a]=s}return i}function Gl(e,i){return e.getAttribute(i)}function Mn(e,i,r){e.setAttribute(i,r)}function br(e,i){e.removeAttribute(i)}function zl(){H.body.focus(),H.onselectstart=function(){return!1}}function Xl(){H.onselectstart=function(){return!0}}function Un(e){if(e&&e.getBoundingClientRect&&e.parentNode){var i=e.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(t){i[t]!==void 0&&(r[t]=i[t])}),r.height||(r.height=parseFloat(Si(e,"height"))),r.width||(r.width=parseFloat(Si(e,"width"))),r}}function Ci(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var i=e.offsetWidth,r=e.offsetHeight,t=0,n=0;e.offsetParent&&e!==H[mr.fullscreenElement];)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n,width:i,height:r}}function Tr(e,i){var r={x:0,y:0};if(Wt)for(var t=e;t&&t.nodeName.toLowerCase()!=="html";){var n=Si(t,"transform");if(/^matrix/.test(n)){var a=n.slice(7,-1).split(/,\s/).map(Number);r.x+=a[4],r.y+=a[5]}else if(/^matrix3d/.test(n)){var s=n.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}t=t.parentNode}var o={},u=Ci(i.target),c=Ci(e),d=c.width,m=c.height,f=i.offsetY-(c.top-u.top),_=i.offsetX-(c.left-u.left);return i.changedTouches&&(_=i.changedTouches[0].pageX-c.left,f=i.changedTouches[0].pageY+c.top,Wt&&(_-=r.x,f-=r.y)),o.y=1-Math.max(0,Math.min(1,f/m)),o.x=Math.max(0,Math.min(1,_/d)),o}function Kl(e){return Ne(e)&&e.nodeType===3}function ls(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Yl(e){return typeof e=="function"&&(e=e()),(Array.isArray(e)?e:[e]).map(function(i){return typeof i=="function"&&(i=i()),Nn(i)||Kl(i)?i:typeof i=="string"&&/\S/.test(i)?H.createTextNode(i):void 0}).filter(function(i){return i})}function cs(e,i){return Yl(i).forEach(function(r){return e.appendChild(r)}),e}function Ql(e,i){return cs(ls(e),i)}function xi(e){return e.button===void 0&&e.buttons===void 0||e.button===0&&e.buttons===void 0||e.type==="mouseup"&&e.button===0&&e.buttons===0||e.button===0&&e.buttons===1}var ds,Je=Hl("querySelector"),$l=Hl("querySelectorAll"),Jl=Object.freeze({__proto__:null,isReal:Rn,isEl:Nn,isInFrame:ql,createEl:ot,textContent:sn,prependTo:us,hasClass:on,addClass:Be,removeClass:ki,toggleClass:Vl,setAttributes:Wl,getAttributes:Fe,getAttribute:Gl,setAttribute:Mn,removeAttribute:br,blockTextSelection:zl,unblockTextSelection:Xl,getBoundingClientRect:Un,findPosition:Ci,getPointerPosition:Tr,isTextNode:Kl,emptyEl:ls,normalizeContent:Yl,appendContent:cs,insertContent:Ql,isSingleLeftClick:xi,$:Je,$$:$l}),Zl=!1,Qf=function(){if(ds.options.autoSetup!==!1){var e=Array.prototype.slice.call(H.getElementsByTagName("video")),i=Array.prototype.slice.call(H.getElementsByTagName("audio")),r=Array.prototype.slice.call(H.getElementsByTagName("video-js")),t=e.concat(i,r);if(t&&t.length>0)for(var n=0,a=t.length;n-1&&(n={passive:!0}),e.addEventListener(i,t.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+i,t.dispatcher)}function Ft(e,i,r){if(Gt.has(e)){var t=Gt.get(e);if(t.handlers){if(Array.isArray(i))return fs(Ft,e,i,r);var n=function(u,c){t.handlers[c]=[],ic(u,c)};if(i!==void 0){var a=t.handlers[i];if(a)if(r){if(r.guid)for(var s=0;s=i&&(e.apply(void 0,arguments),r=t)}},Lt=function(){};Lt.prototype.allowedEvents_={},Lt.prototype.on=function(e,i){var r=this.addEventListener;this.addEventListener=function(){},re(this,e,i),this.addEventListener=r},Lt.prototype.addEventListener=Lt.prototype.on,Lt.prototype.off=function(e,i){Ft(this,e,i)},Lt.prototype.removeEventListener=Lt.prototype.off,Lt.prototype.one=function(e,i){var r=this.addEventListener;this.addEventListener=function(){},wr(this,e,i),this.addEventListener=r},Lt.prototype.any=function(e,i){var r=this.addEventListener;this.addEventListener=function(){},rc(this,e,i),this.addEventListener=r},Lt.prototype.trigger=function(e){var i=e.type||e;typeof e=="string"&&(e={type:i}),e=Er(e),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](e),Bn(this,e)},Lt.prototype.dispatchEvent=Lt.prototype.trigger,Lt.prototype.queueTrigger=function(e){var i=this;Di||(Di=new Map);var r=e.type||e,t=Di.get(this);t||(t=new Map,Di.set(this,t));var n=t.get(r);t.delete(r),D.clearTimeout(n);var a=D.setTimeout(function(){t.delete(r),t.size===0&&(t=null,Di.delete(i)),i.trigger(e)},0);t.set(r,a)};var kr=function(e){return typeof e.name=="function"?e.name():typeof e.name=="string"?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},He=function(e){return e instanceof Lt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(i){return typeof e[i]=="function"})},ms=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Cr=function(e,i,r){if(!e||!e.nodeName&&!He(e))throw new Error("Invalid target for "+kr(i)+"#"+r+"; must be a DOM node or evented object.")},ac=function(e,i,r){if(!ms(e))throw new Error("Invalid event type for "+kr(i)+"#"+r+"; must be a non-empty string or array.")},sc=function(e,i,r){if(typeof e!="function")throw new Error("Invalid listener for "+kr(i)+"#"+r+"; must be a function.")},gs=function(e,i,r){var t,n,a,s=i.length<3||i[0]===e||i[0]===e.eventBusEl_;return s?(t=e.eventBusEl_,i.length>=3&&i.shift(),n=i[0],a=i[1]):(t=i[0],n=i[1],a=i[2]),Cr(t,e,r),ac(n,e,r),sc(a,e,r),{isTargetingSelf:s,target:t,type:n,listener:a=yt(e,a)}},un=function(e,i,r,t){Cr(e,e,i),e.nodeName?tm[i](e,r,t):e[i](r,t)},em={on:function(){for(var e=this,i=arguments.length,r=new Array(i),t=0;t=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},i.isDisposed=function(){return!!this.isDisposed_},i.player=function(){return this.player_},i.options=function(r){return r?(this.options_=_t(this.options_,r),this.options_):this.options_},i.el=function(){return this.el_},i.createEl=function(r,t,n){return ot(r,t,n)},i.localize=function(r,t,n){n===void 0&&(n=r);var a=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[a],u=a&&a.split("-")[0],c=s&&s[u],d=n;return o&&o[r]?d=o[r]:c&&c[r]&&(d=c[r]),t&&(d=d.replace(/\{(\d+)\}/g,function(m,f){var _=t[f-1],b=_;return _===void 0&&(b=m),b})),d},i.handleLanguagechange=function(){},i.contentEl=function(){return this.contentEl_||this.el_},i.id=function(){return this.id_},i.name=function(){return this.name_},i.children=function(){return this.children_},i.getChildById=function(r){return this.childIndex_[r]},i.getChild=function(r){if(r)return this.childNameIndex_[r]},i.getDescendant=function(){for(var r=arguments.length,t=new Array(r),n=0;n=0;n--)if(this.children_[n]===r){t=!0,this.children_.splice(n,1);break}if(t){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[kt(r.name())]=null,this.childNameIndex_[xr(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},i.initChildren=function(){var r=this,t=this.options_.children;if(t){var n,a=this.options_,s=e.getComponent("Tech");(n=Array.isArray(t)?t:Object.keys(t)).concat(Object.keys(this.options_).filter(function(o){return!n.some(function(u){return typeof u=="string"?o===u:o===u.name})})).map(function(o){var u,c;return typeof o=="string"?c=t[u=o]||r.options_[u]||{}:(u=o.name,c=o),{name:u,opts:c}}).filter(function(o){var u=e.getComponent(o.opts.componentClass||kt(o.name));return u&&!s.isTech(u)}).forEach(function(o){var u=o.name,c=o.opts;if(a[u]!==void 0&&(c=a[u]),c!==!1){c===!0&&(c={}),c.playerOptions=r.options_.playerOptions;var d=r.addChild(u,c);d&&(r[u]=d)}})}},i.buildCSSClass=function(){return""},i.ready=function(r,t){if(t===void 0&&(t=!1),r)return this.isReady_?void(t?r.call(this):this.setTimeout(r,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(r))},i.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)},i.$=function(r,t){return Je(r,t||this.contentEl())},i.$$=function(r,t){return $l(r,t||this.contentEl())},i.hasClass=function(r){return on(this.el_,r)},i.addClass=function(r){Be(this.el_,r)},i.removeClass=function(r){ki(this.el_,r)},i.toggleClass=function(r,t){Vl(this.el_,r,t)},i.show=function(){this.removeClass("vjs-hidden")},i.hide=function(){this.addClass("vjs-hidden")},i.lockShowing=function(){this.addClass("vjs-lock-showing")},i.unlockShowing=function(){this.removeClass("vjs-lock-showing")},i.getAttribute=function(r){return Gl(this.el_,r)},i.setAttribute=function(r,t){Mn(this.el_,r,t)},i.removeAttribute=function(r){br(this.el_,r)},i.width=function(r,t){return this.dimension("width",r,t)},i.height=function(r,t){return this.dimension("height",r,t)},i.dimensions=function(r,t){this.width(r,!0),this.height(t)},i.dimension=function(r,t,n){if(t!==void 0)return t!==null&&t==t||(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[r]=t:this.el_.style[r]=t==="auto"?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[r],s=a.indexOf("px");return parseInt(s!==-1?a.slice(0,s):this.el_["offset"+kt(r)],10)},i.currentDimension=function(r){var t=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Si(this.el_,r),(t=parseFloat(t))===0||isNaN(t)){var n="offset"+kt(r);t=this.el_[n]}return t},i.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},i.currentWidth=function(){return this.currentDimension("width")},i.currentHeight=function(){return this.currentDimension("height")},i.focus=function(){this.el_.focus()},i.blur=function(){this.el_.blur()},i.handleKeyDown=function(r){this.player_&&(et.isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},i.handleKeyPress=function(r){this.handleKeyDown(r)},i.emitTapEvents=function(){var r,t=0,n=null;this.on("touchstart",function(s){s.touches.length===1&&(n={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},t=D.performance.now(),r=!0)}),this.on("touchmove",function(s){if(s.touches.length>1)r=!1;else if(n){var o=s.touches[0].pageX-n.pageX,u=s.touches[0].pageY-n.pageY;Math.sqrt(o*o+u*u)>10&&(r=!1)}});var a=function(){r=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(s){n=null,r===!0&&D.performance.now()-t<200&&(s.preventDefault(),this.trigger("tap"))})},i.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var r,t=yt(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(r),r=this.setInterval(t,250)});var n=function(a){t(),this.clearInterval(r)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},i.setTimeout=function(r,t){var n,a=this;return r=yt(this,r),this.clearTimersOnDispose_(),n=D.setTimeout(function(){a.setTimeoutIds_.has(n)&&a.setTimeoutIds_.delete(n),r()},t),this.setTimeoutIds_.add(n),n},i.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),D.clearTimeout(r)),r},i.setInterval=function(r,t){r=yt(this,r),this.clearTimersOnDispose_();var n=D.setInterval(r,t);return this.setIntervalIds_.add(n),n},i.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),D.clearInterval(r)),r},i.requestAnimationFrame=function(r){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),r=yt(this,r),t=D.requestAnimationFrame(function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),r()}),this.rafIds_.add(t),t):this.setTimeout(r,1e3/60)},i.requestNamedAnimationFrame=function(r,t){var n=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),t=yt(this,t);var a=this.requestAnimationFrame(function(){t(),n.namedRafs_.has(r)&&n.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},i.cancelNamedAnimationFrame=function(r){this.namedRafs_.has(r)&&(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},i.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),D.cancelAnimationFrame(r)),r):this.clearTimeout(r)},i.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var n=t[0],a=t[1];r[n].forEach(function(s,o){return r[a](o)})}),r.clearingTimersOnDispose_=!1}))},e.registerComponent=function(r,t){if(typeof r!="string"||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var n,a=e.getComponent("Tech"),s=a&&a.isTech(t),o=e===t||e.prototype.isPrototypeOf(t.prototype);if(s||!o)throw n=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+r+'"; '+n+".");r=kt(r),e.components_||(e.components_={});var u=e.getComponent("Player");if(r==="Player"&&u&&u.players){var c=u.players,d=Object.keys(c);if(c&&d.length>0&&d.map(function(m){return c[m]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[r]=t,e.components_[xr(r)]=t,t},e.getComponent=function(r){if(r&&e.components_)return e.components_[r]},e}();function uc(e,i,r,t){return function(n,a,s){if(typeof a!="number"||a<0||a>s)throw new Error("Failed to execute '"+n+"' on 'TimeRanges': The index provided ("+a+") is non-numeric or out of bounds (0-"+s+").")}(e,t,r.length-1),r[t][i]}function _s(e){var i;return i=e===void 0||e.length===0?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:uc.bind(null,"start",0,e),end:uc.bind(null,"end",1,e)},D.Symbol&&D.Symbol.iterator&&(i[D.Symbol.iterator]=function(){return(e||[]).values()}),i}function ln(e,i){return Array.isArray(e)?_s(e):e===void 0||i===void 0?_s():_s([[e,i]])}function lc(e,i){var r,t,n=0;if(!i)return 0;e&&e.length||(e=ln(0,0));for(var a=0;ai&&(t=i),n+=t-r;return n/i}function zt(e){if(e instanceof zt)return e;typeof e=="number"?this.code=e:typeof e=="string"?this.message=e:Ne(e)&&(typeof e.code=="number"&&(this.code=e.code),wt(this,e)),this.message||(this.message=zt.defaultMessages[this.code]||"")}F.prototype.supportsRaf_=typeof D.requestAnimationFrame=="function"&&typeof D.cancelAnimationFrame=="function",F.registerComponent("Component",F),zt.prototype.code=0,zt.prototype.message="",zt.prototype.status=null,zt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],zt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Fn=0;Fn=0;a--)if(t[a].enabled){Ts(t,t[a]);break}return(n=e.call(this,t)||this).changing_=!1,n}V(i,e);var r=i.prototype;return r.addTrack=function(t){var n=this;t.enabled&&Ts(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,Ts(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},r.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},i}(qn),Ss=function(e,i){for(var r=0;r=0;a--)if(t[a].selected){Ss(t,t[a]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(tt(n),"selectedIndex",{get:function(){for(var s=0;s0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed("Text Track parsing errors for "+i.src),t.forEach(function(n){return it.error(n)}),D.console&&D.console.groupEnd&&D.console.groupEnd()),r.flush()},gc=function(e,i){var r={uri:e},t=Dr(e);t&&(r.cors=t);var n=i.tech_.crossOrigin()==="use-credentials";n&&(r.withCredentials=n),Zo(r,yt(this,function(a,s,o){if(a)return it.error(a,s);i.loaded_=!0,typeof D.WebVTT!="function"?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type!=="vttjserror")return mc(o,i);it.error("vttjs failed to load, stopping trying to process "+i.src)}):mc(o,i)}))},Ai=function(e){function i(t){var n;if(t===void 0&&(t={}),!t.tech)throw new Error("A tech was not provided.");var a=_t(t,{kind:fm[t.kind]||"subtitles",language:t.language||t.srclang||""}),s=pc[a.mode]||"disabled",o=a.default;a.kind!=="metadata"&&a.kind!=="chapters"||(s="hidden"),(n=e.call(this,a)||this).tech_=a.tech,n.cues_=[],n.activeCues_=[],n.preload_=n.tech_.preloadTextTracks!==!1;var u=new hc(n.cues_),c=new hc(n.activeCues_),d=!1;return n.timeupdateHandler=yt(tt(n),function(m){m===void 0&&(m={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),n.tech_.one("dispose",function(){n.stopTracking()}),s!=="disabled"&&n.startTracking(),Object.defineProperties(tt(n),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(m){pc[m]&&s!==m&&(s=m,this.preload_||s==="disabled"||this.cues.length!==0||gc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?u:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return c;for(var m=this.tech_.currentTime(),f=[],_=0,b=this.cues.length;_=m||y.startTime===y.endTime&&y.startTime<=m&&y.startTime+.5>=m)&&f.push(y)}if(d=!1,f.length!==this.activeCues_.length)d=!0;else for(var E=0;E0)return void this.trigger("vttjsloaded");var n=H.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){t.trigger("vttjsloaded")},n.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var t=this,n=this.textTracks(),a=this.remoteTextTracks(),s=function(d){return n.addTrack(d.track)},o=function(d){return n.removeTrack(d.track)};a.on("addtrack",s),a.on("removetrack",o),this.addWebVttScript_();var u=function(){return t.trigger("texttrackchange")},c=function(){u();for(var d=0;d=0;f--){var _=u[f];_[c]&&_[c](m,d)}}(e,r,o,s),o}var vm={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ym={setCurrentTime:1,setMuted:1,setVolume:1},bc={play:1,pause:1};function xs(e){return function(i,r){return i===Ir?Ir:r[e]?r[e](i):i}}function dn(e,i,r,t,n,a){e===void 0&&(e={}),i===void 0&&(i=[]),n===void 0&&(n=[]),a===void 0&&(a=!1);var s=i,o=s[0],u=s.slice(1);if(typeof o=="string")dn(e,cn[o],r,t,n,a);else if(o){var c=function(d,m){var f=Cs[d.id()],_=null;if(f==null)return _=m(d),Cs[d.id()]=[[m,_]],_;for(var b=0;b0;!this.player_.tech(!0)||(wi||Ei)&&n||this.player_.tech(!0).focus(),this.player_.paused()?Ee(this.player_.play()):this.player_.pause()}},i}(Pr);F.registerComponent("PosterImage",Sm);var Lr="#222",Em={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ds(e,i){var r;if(e.length===4)r=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(e.length!==7)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");r=e.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+i+")"}function Is(e,i,r){try{e.style[i]=r}catch{return}}var wm=function(e){function i(t,n,a){var s;s=e.call(this,t,n,a)||this;var o=function(u){return s.updateDisplay(u)};return t.on("loadstart",function(u){return s.toggleDisplay(u)}),t.on("texttrackchange",o),t.on("loadedmetadata",function(u){return s.preselectTrack(u)}),t.ready(yt(tt(s),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",o),t.on("playerresize",o),D.addEventListener("orientationchange",o),t.on("dispose",function(){return D.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],c=0;c0;return Ee(n),void(!this.player_.tech(!0)||(wi||Ei)&&a||this.player_.tech(!0).focus())}var s=this.player_.getChild("controlBar"),o=s&&s.getChild("playToggle");if(o){var u=function(){return o.focus()};Ii(n)?n.then(u,function(){}):this.setTimeout(u,1)}else this.player_.tech(!0).focus()},r.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},r.handleMouseDown=function(t){this.mouseused_=!0},i}(ge);Sc.prototype.controlText_="Play Video",F.registerComponent("BigPlayButton",Sc);var Cm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).controlText(n&&n.controlText||a.localize("Close")),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(t){et.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},i}(ge);F.registerComponent("CloseButton",Cm);var Ec=function(e){function i(t,n){var a;return n===void 0&&(n={}),a=e.call(this,t,n)||this,n.replay=n.replay===void 0||n.replay,a.on(t,"play",function(s){return a.handlePlay(s)}),a.on(t,"pause",function(s){return a.handlePause(s)}),n.replay&&a.on(t,"ended",function(s){return a.handleEnded(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(t){this.player_.paused()?Ee(this.player_.play()):this.player_.pause()},r.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},r.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(t){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},i}(ge);Ec.prototype.controlText_="Play",F.registerComponent("PlayToggle",Ec);var wc=function(e,i){e=e<0?0:e;var r=Math.floor(e%60),t=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(i/60%60),s=Math.floor(i/3600);return(isNaN(e)||e===1/0)&&(n=t=r="-"),(n=n>0||s>0?n+":":"")+(t=((n||a>=10)&&t<10?"0"+t:t)+":")+(r=r<10?"0"+r:r)},As=wc;function Wn(e,i){return i===void 0&&(i=e),As(e,i)}var Gn=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,["timeupdate","ended"],function(s){return a.updateContent(s)}),a.updateTextNode_(),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),a=ot("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xA0"},{role:"presentation"});return n.appendChild(a),this.contentEl_=ot("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},r.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},r.updateTextNode_=function(t){var n=this;t===void 0&&(t=0),t=Wn(t),this.formattedTime_!==t&&(this.formattedTime_=t,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,it.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=H.createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},r.updateContent=function(t){},i}(F);Gn.prototype.labelText_="Time",Gn.prototype.controlText_="Time",F.registerComponent("TimeDisplay",Gn);var Ps=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(t){var n;n=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},i}(Gn);Ps.prototype.labelText_="Current Time",Ps.prototype.controlText_="Current Time",F.registerComponent("CurrentTimeDisplay",Ps);var Ls=function(e){function i(t,n){var a,s=function(o){return a.updateContent(o)};return(a=e.call(this,t,n)||this).on(t,"durationchange",s),a.on(t,"loadstart",s),a.on(t,"loadedmetadata",s),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(t){var n=this.player_.duration();this.updateTextNode_(n)},i}(Gn);Ls.prototype.labelText_="Duration",Ls.prototype.controlText_="Duration",F.registerComponent("DurationDisplay",Ls);var xm=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){var r=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return t.appendChild(n),r.appendChild(t),r},i}(F);F.registerComponent("TimeDivider",xm);var Os=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,"durationchange",function(s){return a.updateContent(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var t=e.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&t.insertBefore(ot("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},r.updateContent=function(t){var n;typeof this.player_.duration()=="number"&&(n=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(n))},i}(Gn);Os.prototype.labelText_="Remaining Time",Os.prototype.controlText_="Remaining Time",F.registerComponent("RemainingTimeDisplay",Os);var Dm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).updateShowing(),a.on(a.player(),"durationchange",function(s){return a.updateShowing(s)}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ot("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ot("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xA0"})),this.contentEl_.appendChild(H.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},r.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},r.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},i}(F);F.registerComponent("LiveDisplay",Dm);var kc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).updateLiveEdgeStatus(),a.player_.liveTracker&&(a.updateLiveEdgeStatusHandler_=function(s){return a.updateLiveEdgeStatus(s)},a.on(a.player_.liveTracker,"liveedgechange",a.updateLiveEdgeStatusHandler_)),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=ot("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},i}(ge);kc.prototype.controlText_="Seek to live, currently playing live",F.registerComponent("SeekToLive",kc);var Or=function(e,i,r){return e=Number(e),Math.min(r,Math.max(i,isNaN(e)?i:e))},Rs=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).handleMouseDown_=function(s){return a.handleMouseDown(s)},a.handleMouseUp_=function(s){return a.handleMouseUp(s)},a.handleKeyDown_=function(s){return a.handleKeyDown(s)},a.handleClick_=function(s){return a.handleClick(s)},a.handleMouseMove_=function(s){return a.handleMouseMove(s)},a.update_=function(s){return a.update(s)},a.bar=a.getChild(a.options_.barName),a.vertical(!!a.options_.vertical),a.enable(),a}V(i,e);var r=i.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(this.enabled()){var t=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(t,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=wt({tabIndex:0},n),a=wt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),e.prototype.createEl.call(this,t,n,a)},r.handleMouseDown=function(t){var n=this.bar.el_.ownerDocument;t.type==="mousedown"&&t.preventDefault(),t.type!=="touchstart"||Ue||t.preventDefault(),zl(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(t,!0)},r.handleMouseMove=function(t){},r.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;Xl(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()},r.update=function(){var t=this;if(this.el_&&this.bar){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=t.vertical()?"height":"width";t.bar.el().style[a]=(100*n).toFixed(2)+"%"})),n}},r.getProgress=function(){return Number(Or(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(t){var n=Tr(this.el_,t);return this.vertical()?n.y:n.x},r.handleKeyDown=function(t){et.isEventKey(t,"Left")||et.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):et.isEventKey(t,"Right")||et.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},r.handleClick=function(t){t.stopPropagation(),t.preventDefault()},r.vertical=function(t){if(t===void 0)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},i}(F);F.registerComponent("Slider",Rs);var Ns=function(e,i){return Or(e/i*100,0,100).toFixed(2)+"%"},Im=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).partEls_=[],a.on(t,"progress",function(s){return a.update(s)}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=ot("span",{className:"vjs-control-text"}),a=ot("span",{textContent:this.localize("Loaded")}),s=H.createTextNode(": ");return this.percentageEl_=ot("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(a),n.appendChild(s),n.appendChild(this.percentageEl_),t},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},r.update=function(t){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,s=n.player_.buffered(),o=a&&a.isLive()?a.seekableEnd():n.player_.duration(),u=n.player_.bufferedEnd(),c=n.partEls_,d=Ns(u,o);n.percent_!==d&&(n.el_.style.width=d,sn(n.percentageEl_,d),n.percent_=d);for(var m=0;ms.length;y--)n.el_.removeChild(c[y-1]);c.length=s.length})},i}(F);F.registerComponent("LoadProgressBar",Im);var Am=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(t,n,a){var s=Ci(this.el_),o=Un(this.player_.el()),u=t.width*n;if(o&&s){var c=t.left-o.left+u,d=t.width-u+(o.right-t.right),m=s.width/2;cs.width&&(m=s.width),m=Math.round(m),this.el_.style.right="-"+m+"px",this.write(a)}},r.write=function(t){sn(this.el_,t)},r.updateTime=function(t,n,a,s){var o=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=o.player_.duration();if(o.player_.liveTracker&&o.player_.liveTracker.isLive()){var d=o.player_.liveTracker.liveWindow(),m=d-n*d;u=(m<1?"":"-")+Wn(m,d)}else u=Wn(a,c);o.update(t,n,u),s&&s()})},i}(F);F.registerComponent("TimeTooltip",Am);var Ms=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(t,n){var a=this.getChild("timeTooltip");if(a){var s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(t,n,s)}},i}(F);Ms.prototype.options_={children:[]},Wt||Me||Ms.prototype.options_.children.push("timeTooltip"),F.registerComponent("PlayProgressBar",Ms);var Cc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(t,n){var a=this,s=n*this.player_.duration();this.getChild("timeTooltip").updateTime(t,n,s,function(){a.el_.style.left=t.width*n+"px"})},i}(F);Cc.prototype.options_={children:["timeTooltip"]},F.registerComponent("MouseTimeDisplay",Cc);var Us=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).setEventHandlers_(),a}V(i,e);var r=i.prototype;return r.setEventHandlers_=function(){var t=this;this.update_=yt(this,this.update),this.update=qe(this.update_,me),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return t.enableInterval_(n)},this.disableIntervalHandler_=function(n){return t.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in H&&"visibilityState"in H&&this.on(H,"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(t){H.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(t)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,me))},r.disableInterval_=function(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t&&t.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(t){var n=this;if(H.visibilityState!=="hidden"){var a=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var s=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),o=n.player_.liveTracker,u=n.player_.duration();o&&o.isLive()&&(u=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),n.percent_=a),n.currentTime_===s&&n.duration_===u||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Wn(s,u),Wn(u,u)],"{1} of {2}")),n.currentTime_=s,n.duration_=u),n.bar&&n.bar.update(Un(n.el()),n.getProgress())}),a}},r.userSeek_=function(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(t)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var t,n=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(t=(n-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(t=1)):t=n/this.player_.duration(),t},r.handleMouseDown=function(t){xi(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},r.handleMouseMove=function(t,n){if(n===void 0&&(n=!1),xi(t)){var a;n||this.player_.scrubbing()||this.player_.scrubbing(!0);var s=this.calculateDistance(t),o=this.player_.liveTracker;if(o&&o.isLive()){if(s>=.99)return void o.seekToLiveEdge();var u=o.seekableStart(),c=o.liveCurrentTime();if((a=u+s*o.liveWindow())>=c&&(a=c),a<=u&&(a=u+.1),a===1/0)return}else(a=s*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},r.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},r.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},r.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Ee(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},r.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(t){var n=this.player_.liveTracker;if(et.isEventKey(t,"Space")||et.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(et.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(et.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(et(t))){t.preventDefault(),t.stopPropagation();var a=10*(et.codes[et(t)]-et.codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else et.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):et.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in H&&"visibilityState"in H&&this.off(H,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},i}(Rs);Us.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Wt||Me||Us.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),F.registerComponent("SeekBar",Us);var xc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).handleMouseMove=qe(yt(tt(a),a.handleMouseMove),me),a.throttledHandleMouseSeek=qe(yt(tt(a),a.handleMouseSeek),me),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.handleMouseDownHandler_=function(s){return a.handleMouseDown(s)},a.enable(),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(t){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),s=n.getChild("mouseTimeDisplay");if(a||s){var o=n.el(),u=Ci(o),c=Tr(o,t).x;c=Or(c,0,1),s&&s.update(u,c),a&&a.update(u,n.getProgress())}}},r.handleMouseSeek=function(t){var n=this.getChild("seekBar");n&&n.handleMouseMove(t)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var t=this.getChild("seekBar");this.player_.scrubbing(!1),t.videoWasPlaying&&Ee(this.player_.play())}},r.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(t){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(t),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(t){var n=this.getChild("seekBar");n&&n.handleMouseUp(t),this.removeListenersAddedOnMousedownAndTouchstart()},i}(F);xc.prototype.options_={children:["seekBar"]},F.registerComponent("ProgressControl",xc);var Dc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(s){return a.handlePictureInPictureChange(s)}),a.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(s){return a.handlePictureInPictureEnabledChange(s)}),a.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){t.currentType().substring(0,5)==="audio"||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),a.hide()):a.show()}),a.disable(),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){H.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(t){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(t){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},i}(ge);Dc.prototype.controlText_="Picture-in-Picture",F.registerComponent("PictureInPictureToggle",Dc);var Ic=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,"fullscreenchange",function(s){return a.handleFullscreenChange(s)}),H[t.fsApi_.fullscreenEnabled]===!1&&a.disable(),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},i}(ge);Ic.prototype.controlText_="Fullscreen",F.registerComponent("FullscreenToggle",Ic);var Pm=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){var r=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return r.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),r},i}(F);F.registerComponent("VolumeLevel",Pm);var Lm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(t,n,a,s){if(!a){var o=Un(this.el_),u=Un(this.player_.el()),c=t.width*n;if(!u||!o)return;var d=t.left-u.left+c,m=t.width-c+(u.right-t.right),f=o.width/2;do.width&&(f=o.width),this.el_.style.right="-"+f+"px"}this.write(s+"%")},r.write=function(t){sn(this.el_,t)},r.updateVolume=function(t,n,a,s,o){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(t,n,a,s.toFixed(0)),o&&o()})},i}(F);F.registerComponent("VolumeLevelTooltip",Lm);var Ac=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(t,n,a){var s=this,o=100*n;this.getChild("volumeLevelTooltip").updateVolume(t,n,a,o,function(){a?s.el_.style.bottom=t.height*n+"px":s.el_.style.left=t.width*n+"px"})},i}(F);Ac.prototype.options_={children:["volumeLevelTooltip"]},F.registerComponent("MouseVolumeLevelDisplay",Ac);var Rr=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on("slideractive",function(s){return a.updateLastVolume_(s)}),a.on(t,"volumechange",function(s){return a.updateARIAAttributes(s)}),t.ready(function(){return a.updateARIAAttributes()}),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(t){xi(t)&&e.prototype.handleMouseDown.call(this,t)},r.handleMouseMove=function(t){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),s=Un(a),o=this.vertical(),u=Tr(a,t);u=o?u.y:u.x,u=Or(u,0,1),n.update(s,u,o)}xi(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(t){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},r.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},r.updateLastVolume_=function(){var t=this,n=this.player_.volume();this.one("sliderinactive",function(){t.player_.volume()===0&&t.player_.lastVolume_(n)})},i}(Rs);Rr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Wt||Me||Rr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Rr.prototype.playerEvent="volumechange",F.registerComponent("VolumeBar",Rr);var Pc=function(e){function i(t,n){var a;return n===void 0&&(n={}),n.vertical=n.vertical||!1,(n.volumeBar===void 0||Ti(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),function(s,o){o.tech_&&!o.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(o,"loadstart",function(){o.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})}(tt(a=e.call(this,t,n)||this),t),a.throttledHandleMouseMove=qe(yt(tt(a),a.handleMouseMove),me),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.on("mousedown",function(s){return a.handleMouseDown(s)}),a.on("touchstart",function(s){return a.handleMouseDown(s)}),a.on("mousemove",function(s){return a.handleMouseMove(s)}),a.on(a.volumeBar,["focus","slideractive"],function(){a.volumeBar.addClass("vjs-slider-active"),a.addClass("vjs-slider-active"),a.trigger("slideractive")}),a.on(a.volumeBar,["blur","sliderinactive"],function(){a.volumeBar.removeClass("vjs-slider-active"),a.removeClass("vjs-slider-active"),a.trigger("sliderinactive")}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},r.handleMouseDown=function(t){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(t){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},i}(F);Pc.prototype.options_={children:["volumeBar"]},F.registerComponent("VolumeControl",Pc);var Lc=function(e){function i(t,n){var a;return function(s,o){o.tech_&&!o.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(o,"loadstart",function(){o.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})}(tt(a=e.call(this,t,n)||this),t),a.on(t,["loadstart","volumechange"],function(s){return a.update(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(t){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var s=a<.1?.1:a;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(t){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var t=this.player_.volume(),n=3;Wt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),t===0||this.player_.muted()?n=0:t<.33?n=1:t<.67&&(n=2);for(var a=0;a<4;a++)ki(this.el_,"vjs-vol-"+a);Be(this.el_,"vjs-vol-"+n)},r.updateControlText_=function(){var t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},i}(ge);Lc.prototype.controlText_="Mute",F.registerComponent("MuteToggle",Lc);var Oc=function(e){function i(t,n){var a;return n===void 0&&(n={}),n.inline!==void 0?n.inline=n.inline:n.inline=!0,(n.volumeControl===void 0||Ti(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(a=e.call(this,t,n)||this).handleKeyPressHandler_=function(s){return a.handleKeyPress(s)},a.on(t,["loadstart"],function(s){return a.volumePanelState_(s)}),a.on(a.muteToggle,"keyup",function(s){return a.handleKeyPress(s)}),a.on(a.volumeControl,"keyup",function(s){return a.handleVolumeControlKeyUp(s)}),a.on("keydown",function(s){return a.handleKeyPress(s)}),a.on("mouseover",function(s){return a.handleMouseOver(s)}),a.on("mouseout",function(s){return a.handleMouseOut(s)}),a.on(a.volumeControl,["slideractive"],a.sliderActive_),a.on(a.volumeControl,["sliderinactive"],a.sliderInactive_),a}V(i,e);var r=i.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},r.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(t){et.isEventKey(t,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(t){this.addClass("vjs-hover"),re(H,"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(t){this.removeClass("vjs-hover"),Ft(H,"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(t){et.isEventKey(t,"Esc")&&this.handleMouseOut()},i}(F);Oc.prototype.options_={children:["muteToggle","volumeControl"]},F.registerComponent("VolumePanel",Oc);var Rc=function(e){function i(t,n){var a;return a=e.call(this,t,n)||this,n&&(a.menuButton_=n.menuButton),a.focusedChild_=-1,a.on("keydown",function(s){return a.handleKeyDown(s)}),a.boundHandleBlur_=function(s){return a.handleBlur(s)},a.boundHandleTapClick_=function(s){return a.handleTapClick(s)},a}V(i,e);var r=i.prototype;return r.addEventListenerForItem=function(t){t instanceof F&&(this.on(t,"blur",this.boundHandleBlur_),this.on(t,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(t){t instanceof F&&(this.off(t,"blur",this.boundHandleBlur_),this.off(t,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(t){typeof t=="string"&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},r.addItem=function(t){var n=this.addChild(t);n&&this.addEventListenerForItem(n)},r.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=ot(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),re(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},r.handleBlur=function(t){var n=t.relatedTarget||H.activeElement;if(!this.children().some(function(s){return s.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},r.handleTapClick=function(t){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(s){return s.el()===t.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(t){et.isEventKey(t,"Left")||et.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):(et.isEventKey(t,"Right")||et.isEventKey(t,"Up"))&&(t.preventDefault(),t.stopPropagation(),this.stepBack())},r.stepForward=function(){var t=0;this.focusedChild_!==void 0&&(t=this.focusedChild_+1),this.focus(t)},r.stepBack=function(){var t=0;this.focusedChild_!==void 0&&(t=this.focusedChild_-1),this.focus(t)},r.focus=function(t){t===void 0&&(t=0);var n=this.children().slice();n.length&&n[0].hasClass("vjs-menu-title")&&n.shift(),n.length>0&&(t<0?t=0:t>=n.length&&(t=n.length-1),this.focusedChild_=t,n[t].el_.focus())},i}(F);F.registerComponent("Menu",Rc);var Bs=function(e){function i(t,n){var a;n===void 0&&(n={}),(a=e.call(this,t,n)||this).menuButton_=new ge(t,n),a.menuButton_.controlText(a.controlText_),a.menuButton_.el_.setAttribute("aria-haspopup","true");var s=ge.prototype.buildCSSClass();a.menuButton_.el_.className=a.buildCSSClass()+" "+s,a.menuButton_.removeClass("vjs-control"),a.addChild(a.menuButton_),a.update(),a.enabled_=!0;var o=function(u){return a.handleClick(u)};return a.handleMenuKeyUp_=function(u){return a.handleMenuKeyUp(u)},a.on(a.menuButton_,"tap",o),a.on(a.menuButton_,"click",o),a.on(a.menuButton_,"keydown",function(u){return a.handleKeyDown(u)}),a.on(a.menuButton_,"mouseenter",function(){a.addClass("vjs-hover"),a.menu.show(),re(H,"keyup",a.handleMenuKeyUp_)}),a.on("mouseleave",function(u){return a.handleMouseLeave(u)}),a.on("keydown",function(u){return a.handleSubmenuKeyDown(u)}),a}V(i,e);var r=i.prototype;return r.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},r.createMenu=function(){var t=new Rc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=ot("li",{className:"vjs-menu-title",textContent:kt(this.options_.title),tabIndex:-1}),a=new F(this.player_,{el:n});t.addItem(a)}if(this.items=this.createItems(),this.items)for(var s=0;s-1&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},r.handleSelectedLanguageChange=function(t){for(var n=this.player().textTracks(),a=!0,s=0,o=n.length;s-1&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},i}(Li);F.registerComponent("OffTextTrackMenuItem",Nc);var zn=function(e){function i(r,t){return t===void 0&&(t={}),t.tracks=r.textTracks(),e.call(this,r,t)||this}return V(i,e),i.prototype.createItems=function(r,t){var n;r===void 0&&(r=[]),t===void 0&&(t=Li),this.label_&&(n=this.label_+" off"),r.push(new Nc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var a=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var s=0;s-1){var u=new t(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass("vjs-"+o.kind+"-menu-item"),r.push(u)}}return r},i}(Fs);F.registerComponent("TextTrackButton",zn);var Mc=function(e){function i(r,t){var n,a=t.track,s=t.cue,o=r.currentTime();return t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=o&&o=0;n--){var a=t[n];if(a.kind===this.kind_)return a}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(kt(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},r.createItems=function(){var t=[];if(!this.track_)return t;var n=this.track_.cues;if(!n)return t;for(var a=0,s=n.length;a-1&&(a.label_="captions"),a.menuButton_.controlText(kt(a.label_)),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Vs(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Uc)},i}(zn);Gs.prototype.kinds_=["captions","subtitles"],Gs.prototype.controlText_="Subtitles",F.registerComponent("SubsCapsButton",Gs);var Bc=function(e){function i(t,n){var a,s=n.track,o=t.audioTracks();n.label=s.label||s.language||"Unknown",n.selected=s.enabled,(a=e.call(this,t,n)||this).track=s,a.addClass("vjs-"+s.kind+"-menu-item");var u=function(){for(var c=arguments.length,d=new Array(c),m=0;m=0;a--)n.push(new zs(this.player(),{rate:t[a]+"x"}));return n},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(t){var n=this.player().playbackRate(),a=this.playbackRates(),s=(a.indexOf(n)+1)%a.length;this.player().playbackRate(a[s])},r.handlePlaybackRateschange=function(t){this.update()},r.playbackRates=function(){var t=this.player();return t.playbackRates&&t.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(t){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},i}(Bs);jc.prototype.controlText_="Playback Rate",F.registerComponent("PlaybackRateMenuButton",jc);var qc=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},r.createEl=function(t,n,a){return t===void 0&&(t="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,a)},i}(F);F.registerComponent("Spacer",qc);var Rm=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xA0"})},i}(qc);F.registerComponent("CustomControlSpacer",Rm);var Nr=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},i}(F);Nr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in H&&Nr.prototype.options_.children.splice(Nr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),F.registerComponent("ControlBar",Nr);var Hc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,"error",function(s){return a.open(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},r.content=function(){var t=this.player().error();return t?this.localize(t.message):""},i}(jn);Hc.prototype.options_=he({},jn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),F.registerComponent("ErrorDisplay",Hc);var Xs="vjs-text-track-settings",Vc=["#000","Black"],Wc=["#00F","Blue"],Gc=["#0FF","Cyan"],zc=["#0F0","Green"],Xc=["#F0F","Magenta"],Kc=["#F00","Red"],Yc=["#FFF","White"],Qc=["#FF0","Yellow"],Ks=["1","Opaque"],Ys=["0.5","Semi-Transparent"],$c=["0","Transparent"],hn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vc,Yc,Kc,zc,Wc,Qc,Xc,Gc]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ks,Ys,$c]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Yc,Vc,Kc,zc,Wc,Qc,Xc,Gc]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return e==="1.00"?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ks,Ys]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[$c,Ys,Ks]}};function Jc(e,i){if(i&&(e=i(e)),e&&e!=="none")return e}hn.windowColor.options=hn.backgroundColor.options;var Nm=function(e){function i(t,n){var a;return n.temporary=!1,(a=e.call(this,t,n)||this).updateDisplay=a.updateDisplay.bind(tt(a)),a.fill(),a.hasBeenOpened_=a.hasBeenFilled_=!0,a.endDialog=ot("p",{className:"vjs-control-text",textContent:a.localize("End of dialog window.")}),a.el().appendChild(a.endDialog),a.setDefaults(),n.persistTextTrackSettings===void 0&&(a.options_.persistTextTrackSettings=a.options_.playerOptions.persistTextTrackSettings),a.on(a.$(".vjs-done-button"),"click",function(){a.saveSettings(),a.close()}),a.on(a.$(".vjs-default-button"),"click",function(){a.setDefaults(),a.updateDisplay()}),Ln(hn,function(s){a.on(a.$(s.selector),"change",a.updateDisplay)}),a.options_.persistTextTrackSettings&&a.restoreSettings(),a}V(i,e);var r=i.prototype;return r.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},r.createElSelect_=function(t,n,a){var s=this;n===void 0&&(n=""),a===void 0&&(a="label");var o=hn[t],u=o.id.replace("%s",this.id_),c=[n,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(o.label),"",'").join("")},r.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",t),'',this.createElSelect_("textOpacity",t),"","
"].join("")},r.createElBgColor_=function(){var t="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",t),'',this.createElSelect_("backgroundOpacity",t),"","
"].join("")},r.createElWinColor_=function(){var t="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",t),'',this.createElSelect_("windowOpacity",t),"","
"].join("")},r.createElColors_=function(){return ot("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return ot("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},r.createElControls_=function(){var t=this.localize("restore all settings to the default values");return ot("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},r.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},r.label=function(){return this.localize("Caption Settings Dialog")},r.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},r.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var t,n,a,s=this;return n=function(o,u,c){var d,m,f=(d=s.$(u.selector),m=u.parser,Jc(d.options[d.options.selectedIndex].value,m));return f!==void 0&&(o[c]=f),o},(a={})===void 0&&(a=0),Ll(t=hn).reduce(function(o,u){return n(o,t[u],u)},a)},r.setValues=function(t){var n=this;Ln(hn,function(a,s){(function(o,u,c){if(u){for(var d=0;dthis.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,me),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var t=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&t>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var t=this.player_.seekable(),n=[],a=t?t.length:0;a--;)n.push(t.end(a));return n.length?n.sort()[n.length-1]:1/0},r.seekableStart=function(){for(var t=this.player_.seekable(),n=[],a=t?t.length:0;a--;)n.push(t.start(a));return n.length?n.sort()[0]:0},r.liveWindow=function(){var t=this.liveCurrentTime();return t===1/0?0:t-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var t=this.seekableEnd();return this.lastSeekEnd_!==-1&&t!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=t,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(H,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},i}(F);F.registerComponent("LiveTracker",Bm);var Mr,Qs=function(e){var i=e.el();if(i.hasAttribute("src"))return e.triggerSourceset(i.src),!0;var r=e.$$("source"),t=[],n="";if(!r.length)return!1;for(var a=0;a=2&&o.push("loadeddata"),t.readyState>=3&&o.push("canplay"),t.readyState>=4&&o.push("canplaythrough"),this.ready(function(){o.forEach(function(u){this.trigger(u)},this)})}},r.setScrubbing=function(t){this.isScrubbing_=t},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(t){try{this.isScrubbing_&&this.el_.fastSeek&&_r?this.el_.fastSeek(t):this.el_.currentTime=t}catch(n){it(n,"Video is not ready. (Video.js)")}},r.duration=function(){var t=this;return this.el_.duration===1/0&&Me&&Ue&&this.el_.currentTime===0?(this.on("timeupdate",function n(){t.el_.currentTime>0&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",n))}),NaN):this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var t=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){t.off("webkitbeginfullscreen",a),t.off("webkitendfullscreen",n)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var t=D.navigator&&D.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},r.enterFullScreen=function(){var t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA)Ee(this.el_.play()),this.setTimeout(function(){t.pause();try{t.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{t.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},r.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},r.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},r.src=function(t){if(t===void 0)return this.el_.src;this.setSrc(t)},r.reset=function(){i.resetMediaElement(this.el_)},r.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(t){this.el_.controls=!!t},r.addTextTrack=function(t,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,a):e.prototype.addTextTrack.call(this,t,n,a)},r.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=H.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},r.addRemoteTextTrack=function(t,n){var a=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},r.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)t!==n[a]&&t!==n[a].track||this.el().removeChild(n[a])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var t={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&typeof D.performance.now=="function"?t.creationTime=D.performance.now():D.performance&&D.performance.timing&&typeof D.performance.timing.navigationStart=="number"&&(t.creationTime=D.Date.now()-D.performance.timing.navigationStart),t},i}(mt);$s(G,"TEST_VID",function(){if(Rn()){var e=H.createElement("video"),i=H.createElement("track");return i.kind="captions",i.srclang="en",i.label="English",e.appendChild(i),e}}),G.isSupported=function(){try{G.TEST_VID.volume=.5}catch{return!1}return!(!G.TEST_VID||!G.TEST_VID.canPlayType)},G.canPlayType=function(e){return G.TEST_VID.canPlayType(e)},G.canPlaySource=function(e,i){return G.canPlayType(e.type)},G.canControlVolume=function(){try{var e=G.TEST_VID.volume;G.TEST_VID.volume=e/2+.1;var i=e!==G.TEST_VID.volume;return i&&Wt?(D.setTimeout(function(){G&&G.prototype&&(G.prototype.featuresVolumeControl=e!==G.TEST_VID.volume)}),!1):i}catch{return!1}},G.canMuteVolume=function(){try{var e=G.TEST_VID.muted;return G.TEST_VID.muted=!e,G.TEST_VID.muted?Mn(G.TEST_VID,"muted","muted"):br(G.TEST_VID,"muted"),e!==G.TEST_VID.muted}catch{return!1}},G.canControlPlaybackRate=function(){if(Me&&Ue&&Ul<58)return!1;try{var e=G.TEST_VID.playbackRate;return G.TEST_VID.playbackRate=e/2+.1,e!==G.TEST_VID.playbackRate}catch{return!1}},G.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(H.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(H.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(H.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(H.createElement("audio"),"innerHTML",{get:e,set:e})}catch{return!1}return!0},G.supportsNativeTextTracks=function(){return _r||Wt&&Ue},G.supportsNativeVideoTracks=function(){return!(!G.TEST_VID||!G.TEST_VID.videoTracks)},G.supportsNativeAudioTracks=function(){return!(!G.TEST_VID||!G.TEST_VID.audioTracks)},G.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var i=e[0],r=e[1];$s(G.prototype,i,function(){return G[r]()},!0)}),G.prototype.featuresVolumeControl=G.canControlVolume(),G.prototype.movingMediaElementInDOM=!Wt,G.prototype.featuresFullscreenResize=!0,G.prototype.featuresProgressEvents=!0,G.prototype.featuresTimeupdateEvents=!0,G.prototype.featuresVideoFrameCallback=!(!G.TEST_VID||!G.TEST_VID.requestVideoFrameCallback),G.patchCanPlayType=function(){rs>=4&&!Ml&&!Ue&&(Mr=G.TEST_VID&&G.TEST_VID.constructor.prototype.canPlayType,G.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Mr.call(this,e)})},G.unpatchCanPlayType=function(){var e=G.TEST_VID.constructor.prototype.canPlayType;return Mr&&(G.TEST_VID.constructor.prototype.canPlayType=Mr),e},G.patchCanPlayType(),G.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),typeof e.load=="function"&&function(){try{e.load()}catch{}}()}},G.resetMediaElement=function(e){if(e){for(var i=e.querySelectorAll("source"),r=i.length;r--;)e.removeChild(i[r]);e.removeAttribute("src"),typeof e.load=="function"&&function(){try{e.load()}catch{}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){G.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){G.prototype["set"+kt(e)]=function(i){this.el_[e]=i,i?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){G.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){G.prototype["set"+kt(e)]=function(i){this.el_[e]=i}}),["pause","load","play"].forEach(function(e){G.prototype[e]=function(){return this.el_[e]()}}),mt.withSourceHandlers(G),G.nativeSourceHandler={},G.nativeSourceHandler.canPlayType=function(e){try{return G.TEST_VID.canPlayType(e)}catch{return""}},G.nativeSourceHandler.canHandleSource=function(e,i){if(e.type)return G.nativeSourceHandler.canPlayType(e.type);if(e.src){var r=ks(e.src);return G.nativeSourceHandler.canPlayType("video/"+r)}return""},G.nativeSourceHandler.handleSource=function(e,i,r){i.setSrc(e.src)},G.nativeSourceHandler.dispose=function(){},G.registerSourceHandler(G.nativeSourceHandler),mt.registerTech("Html5",G);var ed=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Js={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Zs=["tiny","xsmall","small","medium","large","xlarge","huge"],Ur={};Zs.forEach(function(e){var i=e.charAt(0)==="x"?"x-"+e.substring(1):e;Ur[e]="vjs-layout-"+i});var Hm={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},xt=function(e){function i(t,n,a){var s;if(t.id=t.id||n.id||"vjs_video_"+je(),(n=wt(i.getTagSettings(t),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if(typeof t.closest=="function"){var o=t.closest("[lang]");o&&o.getAttribute&&(n.language=o.getAttribute("lang"))}else for(var u=t;u&&u.nodeType===1;){if(Fe(u).hasOwnProperty("lang")){n.language=u.getAttribute("lang");break}u=u.parentNode}if((s=e.call(this,null,n,a)||this).boundDocumentFullscreenChange_=function(f){return s.documentFullscreenChange_(f)},s.boundFullWindowOnEscKey_=function(f){return s.fullWindowOnEscKey(f)},s.boundUpdateStyleEl_=function(f){return s.updateStyleEl_(f)},s.boundApplyInitTime_=function(f){return s.applyInitTime_(f)},s.boundUpdateCurrentBreakpoint_=function(f){return s.updateCurrentBreakpoint_(f)},s.boundHandleTechClick_=function(f){return s.handleTechClick_(f)},s.boundHandleTechDoubleClick_=function(f){return s.handleTechDoubleClick_(f)},s.boundHandleTechTouchStart_=function(f){return s.handleTechTouchStart_(f)},s.boundHandleTechTouchMove_=function(f){return s.handleTechTouchMove_(f)},s.boundHandleTechTouchEnd_=function(f){return s.handleTechTouchEnd_(f)},s.boundHandleTechTap_=function(f){return s.handleTechTap_(f)},s.isFullscreen_=!1,s.log=Pl(s.id_),s.fsApi_=mr,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!1,s.audioOnlyMode_=!1,s.audioPosterMode_=!1,s.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!s.options_||!s.options_.techOrder||!s.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(s.tag=t,s.tagAttributes=t&&Fe(t),s.language(s.options_.language),n.languages){var c={};Object.getOwnPropertyNames(n.languages).forEach(function(f){c[f.toLowerCase()]=n.languages[f]}),s.languages_=c}else s.languages_=i.prototype.options_.languages;s.resetCache_(),s.poster_=n.poster||"",s.controls_=!!n.controls,t.controls=!1,t.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],t.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(f){if(typeof s[f]!="function")throw new Error('plugin "'+f+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),vs(tt(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(re(H,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var d=_t(s.options_);n.plugins&&Object.keys(n.plugins).forEach(function(f){s[f](n.plugins[f])}),n.debug&&s.debug(!0),s.options_.playerOptions=d,s.middleware_=[],s.playbackRates(n.playbackRates),s.initChildren(),s.isAudio(t.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),On&&s.addClass("vjs-touch-enabled"),Wt||s.addClass("vjs-workinghover"),i.players[s.id_]=tt(s);var m=Dl.split(".")[0];return s.addClass("vjs-v"+m),s.userActive(!0),s.reportUserActivity(),s.one("play",function(f){return s.listenForUserActivity_(f)}),s.on("stageclick",function(f){return s.handleStageClick_(f)}),s.on("keydown",function(f){return s.handleKeyDown(f)}),s.on("languagechange",function(f){return s.handleLanguagechange(f)}),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s.on("ready",function(){s.audioPosterMode(s.options_.audioPosterMode),s.audioOnlyMode(s.options_.audioOnlyMode)}),s}V(i,e);var r=i.prototype;return r.dispose=function(){var t=this;this.trigger("dispose"),this.off("dispose"),Ft(H,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ft(H,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Cs[this.id()]=null,Xt.names.forEach(function(n){var a=Xt[n],s=t[a.getterName]();s&&s.off&&s.off()}),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var t,n=this.tag,a=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";a?t=this.el_=n.parentNode:s||(t=this.el_=e.prototype.createEl.call(this,"div"));var o=Fe(n);if(s){for(t=this.el_=n,n=this.tag=H.createElement("video");t.children.length;)n.appendChild(t.firstChild);on(t,"video-js")||Be(t,"video-js"),t.appendChild(n),a=this.playerElIngest_=t,Object.keys(t).forEach(function(_){try{n[_]=t[_]}catch{}})}if(n.setAttribute("tabindex","-1"),o.tabindex="-1",(wi||Ue&&Bl)&&(n.setAttribute("role","application"),o.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach(function(_){s&&_==="class"||t.setAttribute(_,o[_]),s&&n.setAttribute(_,o[_])}),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=ec("vjs-styles-dimensions");var u=Je(".vjs-styles-defaults"),c=Je("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var d=n.getElementsByTagName("a"),m=0;m0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];t=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/o:this.videoWidth()||300,n=this.height_!==void 0?this.height_:t*o,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),nc(this.styleEl_,` .`+a+` { width: `+t+`px; height: `+n+`px; } .`+a+`.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: `+100*o+`%; } `)}else{var u=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(u>=0&&(d.width=u),c>=0&&(d.height=c))}},r.loadTech_=function(t,n){var a=this;this.tech_&&this.unloadTech_();var s=kt(t),o=t.charAt(0).toLowerCase()+t.slice(1);s!=="Html5"&&this.tag&&(mt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:n,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+o+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Xt.names.forEach(function(m){var f=Xt[m];c[f.getterName]=a[f.privateName]}),wt(c,this.options_[s]),wt(c,this.options_[o]),wt(c,this.options_[t.toLowerCase()]),this.tag&&(c.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var d=mt.getTech(t);if(!d)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new d(c),this.tech_.ready(yt(this,this.handleTechReady_),!0),om(this.textTracksJson_||[],this.tech_),ed.forEach(function(m){a.on(a.tech_,m,function(f){return a["handleTech"+kt(m)+"_"](f)})}),Object.keys(Js).forEach(function(m){a.on(a.tech_,m,function(f){a.tech_.playbackRate()===0&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+Js[m]+"_"].bind(a),event:f}):a["handleTech"+Js[m]+"_"](f)})}),this.on(this.tech_,"loadstart",function(m){return a.handleTechLoadStart_(m)}),this.on(this.tech_,"sourceset",function(m){return a.handleTechSourceset_(m)}),this.on(this.tech_,"waiting",function(m){return a.handleTechWaiting_(m)}),this.on(this.tech_,"ended",function(m){return a.handleTechEnded_(m)}),this.on(this.tech_,"seeking",function(m){return a.handleTechSeeking_(m)}),this.on(this.tech_,"play",function(m){return a.handleTechPlay_(m)}),this.on(this.tech_,"firstplay",function(m){return a.handleTechFirstPlay_(m)}),this.on(this.tech_,"pause",function(m){return a.handleTechPause_(m)}),this.on(this.tech_,"durationchange",function(m){return a.handleTechDurationChange_(m)}),this.on(this.tech_,"fullscreenchange",function(m,f){return a.handleTechFullscreenChange_(m,f)}),this.on(this.tech_,"fullscreenerror",function(m,f){return a.handleTechFullscreenError_(m,f)}),this.on(this.tech_,"enterpictureinpicture",function(m){return a.handleTechEnterPictureInPicture_(m)}),this.on(this.tech_,"leavepictureinpicture",function(m){return a.handleTechLeavePictureInPicture_(m)}),this.on(this.tech_,"error",function(m){return a.handleTechError_(m)}),this.on(this.tech_,"posterchange",function(m){return a.handleTechPosterChange_(m)}),this.on(this.tech_,"textdata",function(m){return a.handleTechTextData_(m)}),this.on(this.tech_,"ratechange",function(m){return a.handleTechRateChange_(m)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||s==="Html5"&&this.tag||us(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var t=this;Xt.names.forEach(function(n){var a=Xt[n];t[a.privateName]=t[a.getterName]()}),this.textTracksJson_=sm(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(t){return t===void 0&&it.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(t){var n=this;if(this.tech_&&typeof t=="string"){var a,s=function(){var o=n.muted();n.muted(!0);var u=function(){n.muted(o)};n.playTerminatedQueue_.push(u);var c=n.play();if(Ii(c))return c.catch(function(d){throw u(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(d||""))})};if(t!=="any"||this.muted()?a=t!=="muted"||this.muted()?this.play():s():Ii(a=this.play())&&(a=a.catch(s)),Ii(a))return a.then(function(){n.trigger({type:"autoplay-success",autoplay:t})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:t})})}},r.updateSourceCaches_=function(t){t===void 0&&(t="");var n=t,a="";typeof n!="string"&&(n=t.src,a=t.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=function(f,_){if(!_)return"";if(f.cache_.source.src===_&&f.cache_.source.type)return f.cache_.source.type;var b=f.cache_.sources.filter(function(k){return k.src===_});if(b.length)return b[0].type;for(var y=f.$$("source"),E=0;E0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(t){return t.callback(t.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime();this.on("timeupdate",function a(){n!==t.currentTime()&&(t.removeClass("vjs-waiting"),t.off("timeupdate",a))})},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(it.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(t){this.controls_&&(this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.click!==void 0&&this.options_.userActions.click===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,t):this.paused()?Ee(this.play()):this.pause()))},r.handleTechDoubleClick_=function(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(n){return n.contains(t.target)})||this.options_!==void 0&&this.options_.userActions!==void 0&&this.options_.userActions.doubleClick!==void 0&&this.options_.userActions.doubleClick===!1||(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,t):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(t){t.cancelable&&t.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(t){var n=t.target.player;if(!n||n===this){var a=this.el(),s=H[this.fsApi_.fullscreenElement]===a;!s&&a.matches?s=a.matches(":"+this.fsApi_.fullscreen):!s&&a.msMatchesSelector&&(s=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}},r.handleTechFullscreenChange_=function(t,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},r.handleTechFullscreenError_=function(t,n){this.trigger("fullscreenerror",n)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(t){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(t){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var t=this.tech_.error();this.error(t)},r.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(t,n){this.ready(function(){if(t in ym)return function(a,s,o,u){return s[o](a.reduce(xs(o),u))}(this.middleware_,this.tech_,t,n);if(t in bc)return _c(this.middleware_,this.tech_,t,n);try{this.tech_&&this.tech_[t](n)}catch(a){throw it(a),a}},!0)},r.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in vm)return function(n,a,s){return n.reduceRight(xs(s),a[s]())}(this.middleware_,this.tech_,t);if(t in bc)return _c(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(n){throw this.tech_[t]===void 0?(it("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(it("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(it(n),n)}}},r.play=function(){var t=this,n=this.options_.Promise||D.Promise;return n?new n(function(a){t.play_(a)}):this.play_()},r.play_=function(t){var n=this;t===void 0&&(t=Ee),this.playCallbacks_.push(t);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(_r||Wt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(u){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&s&&this.load());var o=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),o===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},r.runPlayTerminatedQueue_=function(){var t=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],t.forEach(function(n){n()})},r.runPlayCallbacks_=function(t){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(t)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||ln(0,0)},r.scrubbing=function(t){if(t===void 0)return this.scrubbing_;this.scrubbing_=!!t,this.techCall_("setScrubbing",this.scrubbing_),t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(t){return t!==void 0?(t<0&&(t=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",t),void(this.cache_.initTime=0)):(this.cache_.initTime=t,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(t){if(t===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&(this.cache_.duration=t,t===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(t)||this.trigger("durationchange"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=ln(0,0)),t},r.bufferedPercent=function(){return lc(this.buffered(),this.duration())},r.bufferedEnd=function(){var t=this.buffered(),n=this.duration(),a=t.end(t.length-1);return a>n&&(a=n),a},r.volume=function(t){var n;return t!==void 0?(n=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=n,this.techCall_("setVolume",n),void(n>0&&this.lastVolume_(n))):(n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n)},r.muted=function(t){if(t===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)},r.defaultMuted=function(t){return t!==void 0?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(t){if(t===void 0||t===0)return this.cache_.lastVolume;this.cache_.lastVolume=t},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(t){if(t!==void 0){var n=this.isFullscreen_;return this.isFullscreen_=!!t,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},r.requestFullscreen=function(t){var n=this.options_.Promise||D.Promise;if(n){var a=this;return new n(function(s,o){function u(){a.off("fullscreenerror",d),a.off("fullscreenchange",c)}function c(){u(),s()}function d(f,_){u(),o(_)}a.one("fullscreenchange",c),a.one("fullscreenerror",d);var m=a.requestFullscreenHelper_(t);m&&(m.then(u,u),m.then(s,o))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(t){var n,a=this;if(this.fsApi_.prefixed||(n=this.options_.fullscreen&&this.options_.fullscreen.options||{},t!==void 0&&(n=t)),this.fsApi_.requestFullscreen){var s=this.el_[this.fsApi_.requestFullscreen](n);return s&&s.then(function(){return a.isFullscreen(!0)},function(){return a.isFullscreen(!1)}),s}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var t=this.options_.Promise||D.Promise;if(t){var n=this;return new t(function(a,s){function o(){n.off("fullscreenerror",c),n.off("fullscreenchange",u)}function u(){o(),a()}function c(m,f){o(),s(f)}n.one("fullscreenchange",u),n.one("fullscreenerror",c);var d=n.exitFullscreenHelper_();d&&(d.then(o,o),d.then(a,s))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var t=this;if(this.fsApi_.requestFullscreen){var n=H[this.fsApi_.exitFullscreen]();return n&&Ee(n.then(function(){return t.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=H.documentElement.style.overflow,re(H,"keydown",this.boundFullWindowOnEscKey_),H.documentElement.style.overflow="hidden",Be(H.body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(t){et.isEventKey(t,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ft(H,"keydown",this.boundFullWindowOnEscKey_),H.documentElement.style.overflow=this.docOrigOverflow,ki(H.body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(t){if(t===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",t),this.options_.disablePictureInPicture=t,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(t){return t!==void 0?(this.isInPictureInPicture_=!!t,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in H&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in H)return H.exitPictureInPicture()},r.handleKeyDown=function(t){var n=this.options_.userActions;n&&n.hotkeys&&(function(a){var s=a.tagName.toLowerCase();return a.isContentEditable?!0:s==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(a.type)===-1:["textarea"].indexOf(s)!==-1}(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,t):this.handleHotkeys(t)))},r.handleHotkeys=function(t){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,s=a===void 0?function(f){return et.isEventKey(f,"f")}:a,o=n.muteKey,u=o===void 0?function(f){return et.isEventKey(f,"m")}:o,c=n.playPauseKey,d=c===void 0?function(f){return et.isEventKey(f,"k")||et.isEventKey(f,"Space")}:c;if(s.call(this,t)){t.preventDefault(),t.stopPropagation();var m=F.getComponent("FullscreenToggle");H[this.fsApi_.fullscreenEnabled]!==!1&&m.prototype.handleClick.call(this,t)}else u.call(this,t)?(t.preventDefault(),t.stopPropagation(),F.getComponent("MuteToggle").prototype.handleClick.call(this,t)):d.call(this,t)&&(t.preventDefault(),t.stopPropagation(),F.getComponent("PlayToggle").prototype.handleClick.call(this,t))},r.canPlayType=function(t){for(var n,a=0,s=this.options_.techOrder;a1?a.handleSrc_(s.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void a.triggerReady());m=d,f=a.tech_,m.forEach(function(_){return _.setTech&&_.setTech(f)})}),this.options_.retryOnError&&s.length>1){var o=function(){a.error(null),a.handleSrc_(s.slice(1),!0)},u=function(){a.off("error",o)};this.one("error",o),this.one("playing",u),this.resetRetryOnError_=function(){a.off("error",o),a.off("playing",u)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)},r.src=function(t){return this.handleSrc_(t,!1)},r.src_=function(t){var n,a,s=this,o=this.selectSource([t]);return!o||(n=o.tech,a=this.techName_,kt(n)!==kt(a)?(this.changingSrc_=!0,this.loadTech_(o.tech,o.source),this.tech_.ready(function(){s.changingSrc_=!1}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),this.changingSrc_=!1},!0),!1))},r.load=function(){this.techCall_("load")},r.reset=function(){var t=this,n=this.options_.Promise||D.Promise;this.paused()||!n?this.doReset_():Ee(this.play().then(function(){return t.doReset_()}))},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),He(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var t=this.controlBar||{},n=t.durationDisplay,a=t.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var t=this.currentSource(),n=[];return Object.keys(t).length!==0&&n.push(t),this.cache_.sources||n},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(t){return t!==void 0?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},r.autoplay=function(t){if(t===void 0)return this.options_.autoplay||!1;var n;typeof t=="string"&&/(any|play|muted)/.test(t)||t===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=t,this.manualAutoplay_(typeof t=="string"?t:"play"),n=!1):this.options_.autoplay=!!t,n=n===void 0?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},r.playsinline=function(t){return t!==void 0?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},r.loop=function(t){return t!==void 0?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},r.poster=function(t){if(t===void 0)return this.poster_;t||(t=""),t!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var t=this.tech_.poster()||"";t!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(t){if(t===void 0)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},r.usingNativeControls=function(t){if(t===void 0)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},r.error=function(t){var n=this;if(t===void 0)return this.error_||null;if($e("beforeerror").forEach(function(s){var o=s(n,t);Ne(o)&&!Array.isArray(o)||typeof o=="string"||typeof o=="number"||o===null?t=o:n.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&t&&t.code===4){var a=function(){this.error(t)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(t===null)return this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new zt(t),this.addClass("vjs-error"),it.error("(CODE:"+this.error_.code+" "+zt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),$e("error").forEach(function(s){return s(n,n.error_)})},r.reportUserActivity=function(t){this.userActivity_=!0},r.userActive=function(t){if(t===void 0)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var t,n,a,s=yt(this,this.reportUserActivity),o=function(d){s(),this.clearInterval(t)};this.on("mousedown",function(){s(),this.clearInterval(t),t=this.setInterval(s,250)}),this.on("mousemove",function(d){d.screenX===n&&d.screenY===a||(n=d.screenX,a=d.screenY,s())}),this.on("mouseup",o),this.on("mouseleave",o);var u,c=this.getChild("controlBar");!c||Wt||Me||(c.on("mouseenter",function(d){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(d){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);var d=this.options_.inactivityTimeout;d<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},d))}},250)},r.playbackRate=function(t){if(t===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)},r.defaultPlaybackRate=function(t){return t!==void 0?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(t){if(t===void 0)return!!this.isAudio_;this.isAudio_=!!t},r.enableAudioOnlyUI_=function(){var t=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),s=a&&a.currentHeight();n.forEach(function(o){o!==a&&o.el_&&!o.hasClass("vjs-hidden")&&(o.hide(),t.audioOnlyCache_.hiddenChildren.push(o))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(s),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(t){return t.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(t){var n=this;if(typeof t!="boolean"||t===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=t;var a=this.options_.Promise||D.Promise;if(a){if(t){var s=[];return this.isInPictureInPicture()&&s.push(this.exitPictureInPicture()),this.isFullscreen()&&s.push(this.exitFullscreen()),this.audioPosterMode()&&s.push(this.audioPosterMode(!1)),a.all(s).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}t?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(t){var n=this;if(typeof t!="boolean"||t===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=t;var a=this.options_.Promise||D.Promise;return a?t?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.disablePosterModeUI_()}):t?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},r.addTextTrack=function(t,n,a){if(this.tech_)return this.tech_.addTextTrack(t,n,a)},r.addRemoteTextTrack=function(t,n){if(this.tech_)return this.tech_.addRemoteTextTrack(t,n)},r.removeRemoteTextTrack=function(t){t===void 0&&(t={});var n=t.track;if(n||(n=t),this.tech_)return this.tech_.removeRemoteTextTrack(n)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(t){if(t===void 0)return this.language_;this.language_!==String(t).toLowerCase()&&(this.language_=String(t).toLowerCase(),He(this)&&this.trigger("languagechange"))},r.languages=function(){return _t(i.prototype.options_.languages,this.languages_)},r.toJSON=function(){var t=_t(this.options_),n=t.tracks;t.tracks=[];for(var a=0;a"):function(){}},pn=1/30,ke=.1,sd=function(e,i){var r,t=[];if(e&&e.length)for(r=0;r=i})},Wr=function(e,i){return sd(e,function(r){return r-pn>=i})},od=function(e){var i=[];if(!e||!e.length)return"";for(var r=0;r "+e.end(r));return i.join(", ")},fn=function(e){for(var i=[],r=0;ra||(r+=i>n&&i<=a?a-i:a-n)}return r},ld=O.createTimeRange,no=function(e,i){if(!i.preload)return i.duration;var r=0;return(i.parts||[]).forEach(function(t){r+=t.duration}),(i.preloadHints||[]).forEach(function(t){t.type==="PART"&&(r+=e.partTargetDuration)}),r},io=function(e){return(e.segments||[]).reduce(function(i,r,t){return r.parts?r.parts.forEach(function(n,a){i.push({duration:n.duration,segmentIndex:t,partIndex:a,part:n,segment:r})}):i.push({duration:r.duration,segmentIndex:t,partIndex:null,segment:r,part:null}),i},[])},cd=function(e){var i=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return i&&i.parts||[]},dd=function(e){var i=e.preloadSegment;if(i){var r=i.parts,t=(i.preloadHints||[]).reduce(function(n,a){return n+(a.type==="PART"?1:0)},0);return t+=r&&r.length?r.length:0}},hd=function(e,i){if(i.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var r=cd(i).length>0;return r&&i.serverControl&&i.serverControl.partHoldBack?i.serverControl.partHoldBack:r&&i.partTargetDuration?3*i.partTargetDuration:i.serverControl&&i.serverControl.holdBack?i.serverControl.holdBack:i.targetDuration?3*i.targetDuration:0},pd=function(e,i,r){if(i===void 0&&(i=e.mediaSequence+e.segments.length),in){var s=[n,t];t=s[0],n=s[1]}if(t<0){for(var o=t;oDate.now()},ro=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Gr=function(e){var i=gd(e);return!e.disabled&&!i},vd=function(e,i){return i.attributes&&i.attributes[e]},ao=function(e,i){if(e.playlists.length===1)return!0;var r=i.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(function(t){return!!Gr(t)&&(t.attributes.BANDWIDTH||0)0)for(var f=c-1;f>=0;f--){var _=u[f];if(o+=_.duration,s){if(o<0)continue}else if(o+pn<=0)continue;return{partIndex:_.partIndex,segmentIndex:_.segmentIndex,startTime:a-Ri({defaultDuration:i.targetDuration,durationList:u,startIndex:c,endIndex:f})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r}}if(c<0){for(var b=c;b<0;b++)if((o-=i.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r};c=0}for(var y=c;y0)continue}else if(o-pn>=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a+Ri({defaultDuration:i.targetDuration,durationList:u,startIndex:c,endIndex:y})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:r}},isEnabled:Gr,isDisabled:function(e){return e.disabled},isBlacklisted:gd,isIncompatible:ro,playlistEnd:md,isAes:function(e){for(var i=0;i-1&&f!==m.length-1&&(u._HLS_part=f),(f>-1||m.length)&&d--}u._HLS_msn=d}if(o.serverControl&&o.serverControl.canSkipUntil&&(u._HLS_skip=o.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(u).length){var _=new D.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(b){u.hasOwnProperty(b)&&_.searchParams.set(b,u[b])}),s=_.toString()}return s}(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(s,o){if(t.request)return s?t.playlistRequestError(t.request,t.media(),"HAVE_METADATA"):void t.haveMetadata({playlistString:t.request.responseText,url:t.media().uri,id:t.media().id})})}},r.playlistRequestError=function(t,n,a){var s=n.uri,o=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[o],status:t.status,message:"HLS playlist request error at URL: "+s+".",responseText:t.responseText,code:t.status>=500?4:2},this.trigger("error")},r.parseManifest_=function(t){var n=this,a=t.url;return function(s){var o=s.onwarn,u=s.oninfo,c=s.manifestString,d=s.customTagParsers,m=d===void 0?[]:d,f=s.customTagMappers,_=f===void 0?[]:f,b=s.experimentalLLHLS,y=new Up;o&&y.on("warn",o),u&&y.on("info",u),m.forEach(function(P){return y.addParser(P)}),_.forEach(function(P){return y.addTagMapper(P)}),y.push(c),y.end();var E=y.manifest;if(b||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(P){E.hasOwnProperty(P)&&delete E[P]}),E.segments&&E.segments.forEach(function(P){["parts","preloadHints"].forEach(function(N){P.hasOwnProperty(N)&&delete P[N]})})),!E.targetDuration){var w=10;E.segments&&E.segments.length&&(w=E.segments.reduce(function(P,N){return Math.max(P,N.duration)},0)),o&&o("manifest has no targetDuration defaulting to "+w),E.targetDuration=w}var k=cd(E);if(k.length&&!E.partTargetDuration){var I=k.reduce(function(P,N){return Math.max(P,N.duration)},0);o&&(o("manifest has no partTargetDuration defaulting to "+I),_d.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),E.partTargetDuration=I}return E}({onwarn:function(s){var o=s.message;return n.logger_("m3u8-parser warn for "+a+": "+o)},oninfo:function(s){var o=s.message;return n.logger_("m3u8-parser info for "+a+": "+o)},manifestString:t.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(t){var n=t.playlistString,a=t.playlistObject,s=t.url,o=t.id;this.request=null,this.state="HAVE_METADATA";var u=a||this.parseManifest_({url:s,manifestString:n});u.lastRequest=Date.now(),bd({playlist:u,uri:s,id:o});var c=uo(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[o]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(lo(this.media(),!!c)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}},r.media=function(t,n){var a=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof t=="string"){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}if(D.clearTimeout(this.finalRenditionTimeout),n){var s=(t.partTargetDuration||t.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,t,!1),s)}else{var o=this.state,u=!this.media_||t.id!==this.media_.id,c=this.master.playlists[t.id];if(c&&c.endList||t.endList&&t.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(u&&(this.trigger("mediachanging"),o==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(lo(t,!0)),u){if(this.state="SWITCHING_MEDIA",this.request){if(t.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=t,this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},function(d,m){if(a.request){if(t.lastRequest=Date.now(),t.resolvedUri=Vr(a.handleManifestRedirects,t.resolvedUri,m),d)return a.playlistRequestError(a.request,t,o);a.haveMetadata({playlistString:m.responseText,url:t.uri,id:t.id}),o==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}}},r.pause=function(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(t){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(t){var s=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},s)}else this.started?a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},r.updateMediaUpdateTimeout_=function(t){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(t)},t))},r.start=function(){var t=this;if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){t.setupInitialPlaylist(t.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(t.request){if(t.request=null,n)return t.error={status:a.status,message:"HLS playlist request error at URL: "+t.src+".",responseText:a.responseText,code:2},t.state==="HAVE_NOTHING"&&(t.started=!1),t.trigger("error");t.src=Vr(t.handleManifestRedirects,t.src,a);var s=t.parseManifest_({manifestString:a.responseText,url:t.src});t.setupInitialPlaylist(s)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(t){if(this.state="HAVE_MASTER",t.playlists)return this.master=t,Td(this.master,this.srcUri()),t.playlists.forEach(function(a){a.segments=Ed(a),a.segments.forEach(function(s){Sd(s,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var n=this.srcUri()||D.location.href;this.master=function(a,s){var o=oo(0,s),u={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:s,id:o,resolvedUri:s,attributes:{}}]};return u.playlists[o]=u.playlists[0],u.playlists[s]=u.playlists[0],u}(0,n),this.haveMetadata({playlistObject:t,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},i}(Wm),zm=O.xhr,Xm=O.mergeOptions,co=function(e,i,r,t){var n=e.responseType==="arraybuffer"?e.response:e.responseText;!i&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),r.headers&&(e.responseHeaders=r.headers),i&&i.code==="ETIMEDOUT"&&(e.timedout=!0),i||e.aborted||r.statusCode===200||r.statusCode===206||r.statusCode===0||(i=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),t(i,e)},kd=function(){var e=function i(r,t){r=Xm({timeout:45e3},r);var n=i.beforeRequest||O.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(r);a&&(r=a)}var s=(O.Vhs.xhr.original===!0?zm:O.Vhs.xhr)(r,function(u,c){return co(s,u,c,t)}),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=r.uri,s.requestTime=Date.now(),s};return e.original=!0,e},ho=function(e){var i,r={};return e.byterange&&(r.Range="bytes="+(i=e.byterange).offset+"-"+(typeof i.offset=="bigint"||typeof i.length=="bigint"?D.BigInt(i.offset)+D.BigInt(i.length)-D.BigInt(1):i.offset+i.length-1)),r},Km=function(e,i){return e.start(i)+"-"+e.end(i)},Ym=function(e,i){var r=e.toString(16);return"00".substring(0,2-r.length)+r+(i%2?" ":"")},Qm=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Cd=function(e){var i={};return Object.keys(e).forEach(function(r){var t=e[r];_u(t)?i[r]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:i[r]=t}),i},Xr=function(e){var i=e.byterange||{length:1/0,offset:0};return[i.length,i.offset,e.resolvedUri].join(",")},xd=function(e){return e.resolvedUri},Dd=function(e){for(var i=Array.prototype.slice.call(e),r=16,t="",n=0;nm){if(u>m+.25*_.duration)return null;d=_}return{segment:d,estimatedStart:d.videoTimingInfo?d.videoTimingInfo.transmuxedPresentationStart:m-d.duration,type:d.videoTimingInfo?"accurate":"estimate"}}(t,i);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:t},o=function(u,c){if(!c.dateTimeObject)return null;var d=c.videoTimingInfo.transmuxerPrependedSeconds,m=u-(c.videoTimingInfo.transmuxedPresentationStart+d);return new Date(c.dateTimeObject.getTime()+1e3*m)}(t,a.segment);return o&&(s.programDateTime=o.toISOString()),n(null,s)},Zm=function e(i){var r=i.programTime,t=i.playlist,n=i.retryCount,a=n===void 0?2:n,s=i.seekTo,o=i.pauseAfterSeek,u=o===void 0||o,c=i.tech,d=i.callback;if(!d)throw new Error("seekToProgramTime: callback must be provided");if(r===void 0||!t||!s)return d({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!c.hasStarted_)return d({message:"player must be playing a live stream to start buffering"});if(!function(y){if(!y.segments||y.segments.length===0)return!1;for(var E=0;Enew Date(A.getTime()+1e3*U)?null:(w>A&&(k=N),{segment:k,estimatedStart:k.videoTimingInfo?k.videoTimingInfo.transmuxedPresentationStart:ee.duration(E,E.mediaSequence+E.segments.indexOf(k)),type:k.videoTimingInfo?"accurate":"estimate"})}(r,t);if(!m)return d({message:r+" was not found in the stream"});var f=m.segment,_=function(y,E){var w,k;try{w=new Date(y),k=new Date(E)}catch{}var I=w.getTime();return(k.getTime()-I)/1e3}(f.dateTimeObject,r);if(m.type==="estimate")return a===0?d({message:r+" is not buffered yet. Try again"}):(s(m.estimatedStart+_),void c.one("seeked",function(){e({programTime:r,playlist:t,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:c,callback:d})}));var b=f.start+_;c.one("seeked",function(){return d(null,c.currentTime())}),u&&c.pause(),s(b)},Id=function(e,i){if(e.readyState===4)return i()},tg=function(e,i,r){var t,n=[],a=!1,s=function(d,m,f,_){return m.abort(),a=!0,r(d,m,f,_)},o=function(d,m){if(!a){if(d)return s(d,m,"",n);var f=m.responseText.substring(n&&n.byteLength||0,m.responseText.length);if(n=function(){for(var b=arguments.length,y=new Array(b),E=0;E=E+y)return c(d,{response:_.subarray(y,y+E),status:m.status,uri:m.uri});s.request=s.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:ho({byterange:t.sidx.byterange})},c)})}else this.mediaRequest_=D.setTimeout(function(){return a(!1)},0)},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},r.hasPendingRequest=function(){return this.request||this.mediaRequest_},r.stopRequest=function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}},r.media=function(t){var n=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof t=="string"){if(!this.masterPlaylistLoader_.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.masterPlaylistLoader_.master.playlists[t]}var s=!this.media_||t.id!==this.media_.id;if(s&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList)return this.state="HAVE_METADATA",this.media_=t,void(s&&(this.trigger("mediachanging"),this.trigger("mediachange")));s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(t,a,function(o){n.haveMetadata({startingState:a,playlist:t})}))},r.haveMetadata=function(t){var n=t.startingState,a=t.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},r.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(D.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},r.load=function(t){var n=this;D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(t){var s=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){return n.load()},s)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},r.start=function(){var t=this;this.started=!0,this.isMaster_?this.requestMaster_(function(n,a){t.haveMaster_(),t.hasPendingRequest()||t.media_||t.media(t.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=D.setTimeout(function(){return t.haveMaster_()},0)},r.requestMaster_=function(t){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,s){if(!n.requestErrored_(a,s)){var o=s.responseText!==n.masterPlaylistLoader_.masterXml_;return n.masterPlaylistLoader_.masterXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?n.masterLoaded_=Date.parse(s.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=Vr(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,s),o?(n.handleMaster_(),void n.syncClientServerClock_(function(){return t(s,o)})):t(s,o)}n.state==="HAVE_NOTHING"&&(n.started=!1)})},r.syncClientServerClock_=function(t){var n=this,a=Af(this.masterPlaylistLoader_.masterXml_);return a===null?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),t()):a.method==="DIRECT"?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),t()):void(this.request=this.vhs_.xhr({uri:ve(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(s,o){if(n.request){if(s)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),t();var u;u=a.method==="HEAD"?o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):n.masterLoaded_:Date.parse(o.responseText),n.masterPlaylistLoader_.clientOffset_=u-Date.now(),t()}}))},r.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},r.handleMaster_=function(){this.mediaRequest_=null;var t,n,a,s,o,u,c,d=this.masterPlaylistLoader_.master,m=(t={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:d},n=t.masterXml,a=t.srcUrl,s=t.clientOffset,o=t.sidxMapping,u=t.previousManifest,c=If(n,{manifestUri:a,clientOffset:s,sidxMapping:o,previousManifest:u}),Td(c,a,ng),c);d&&(m=ig(d,m,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=m||d;var f=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return f&&f!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=f),(!d||m&&m.minimumUpdatePeriod!==d.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!m},r.updateMinimumUpdatePeriodTimeout_=function(){var t=this.masterPlaylistLoader_;t.createMupOnMedia_&&(t.off("loadedmetadata",t.createMupOnMedia_),t.createMupOnMedia_=null),t.minimumUpdatePeriodTimeout_&&(D.clearTimeout(t.minimumUpdatePeriodTimeout_),t.minimumUpdatePeriodTimeout_=null);var n=t.master&&t.master.minimumUpdatePeriod;n===0&&(t.media()?n=1e3*t.media().targetDuration:(t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_,t.one("loadedmetadata",t.createMupOnMedia_))),typeof n!="number"||n<=0?n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout"):this.createMUPTimeout_(n)},r.createMUPTimeout_=function(t){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=D.setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(t)},t)},r.refreshXml_=function(){var t=this;this.requestMaster_(function(n,a){var s,o,u;a&&(t.media_&&(t.media_=t.masterPlaylistLoader_.master.playlists[t.media_.id]),t.masterPlaylistLoader_.sidxMapping_=(s=t.masterPlaylistLoader_.master,o=t.masterPlaylistLoader_.sidxMapping_,u=Ld(s.playlists,o),Qn(s,function(c,d,m,f){if(c.playlists&&c.playlists.length){var _=c.playlists;u=Ad(u,Ld(_,o))}}),u),t.addSidxSegments_(t.media(),t.state,function(c){t.refreshMedia_(t.media().id)}))})},r.refreshMedia_=function(t){var n=this;if(!t)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,s=!this.media_||this.media_!==a[t];s?this.media_=a[t]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout&&function o(){n.media().endList||(n.mediaUpdateTimeout=D.setTimeout(function(){n.trigger("mediaupdatetimeout"),o()},lo(n.media(),!!s)))}(),this.trigger("loadedplaylist")},i}(eg),Ot={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},Od=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Rd=function(e){return function(){var i=function(n){try{return URL.createObjectURL(new Blob([n],{type:"application/javascript"}))}catch{var a=new BlobBuilder;return a.append(n),URL.createObjectURL(a.getBlob())}}(e),r=Od(new Worker(i));r.objURL=i;var t=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(i),t.call(this)},r}},Nd=function(e){return"var browserWorkerPolyFill = "+Od.toString()+`; browserWorkerPolyFill(self); `+e},Md=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},ag=Nd(Md(function(){var e=function(){this.init=function(){var l={};this.on=function(h,g){l[h]||(l[h]=[]),l[h]=l[h].concat(g)},this.off=function(h,g){var p;return!!l[h]&&(p=l[h].indexOf(g),l[h]=l[h].slice(),l[h].splice(p,1),p>-1)},this.trigger=function(h){var g,p,v,T;if(g=l[h])if(arguments.length===2)for(v=g.length,p=0;p>>1,l.samplingfrequencyindex<<7|l.channelcount<<3,6,1,2]))},y=function(l){return i(A.hdlr,Y[l])},b=function(l){var h=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,l.duration>>>24&255,l.duration>>>16&255,l.duration>>>8&255,255&l.duration,85,196,0,0]);return l.samplerate&&(h[12]=l.samplerate>>>24&255,h[13]=l.samplerate>>>16&255,h[14]=l.samplerate>>>8&255,h[15]=255&l.samplerate),i(A.mdhd,h)},_=function(l){return i(A.mdia,b(l),y(l.type),s(l))},a=function(l){return i(A.mfhd,new Uint8Array([0,0,0,0,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l]))},s=function(l){return i(A.minf,l.type==="video"?i(A.vmhd,K):i(A.smhd,Q),r(),w(l))},o=function(l,h){for(var g=[],p=h.length;p--;)g[p]=I(h[p]);return i.apply(null,[A.moof,a(l)].concat(g))},u=function(l){for(var h=l.length,g=[];h--;)g[h]=m(l[h]);return i.apply(null,[A.moov,d(4294967295)].concat(g).concat(c(l)))},c=function(l){for(var h=l.length,g=[];h--;)g[h]=P(l[h]);return i.apply(null,[A.mvex].concat(g))},d=function(l){var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(A.mvhd,h)},E=function(l){var h,g,p=l.samples||[],v=new Uint8Array(4+p.length);for(g=0;g>>8),T.push(255&p[h].byteLength),T=T.concat(Array.prototype.slice.call(p[h]));for(h=0;h>>8),S.push(255&v[h].byteLength),S=S.concat(Array.prototype.slice.call(v[h]));if(g=[A.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&l.width)>>8,255&l.width,(65280&l.height)>>8,255&l.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(A.avcC,new Uint8Array([1,l.profileIdc,l.profileCompatibility,l.levelIdc,255].concat([p.length],T,[v.length],S))),i(A.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],l.sarRatio){var C=l.sarRatio[0],x=l.sarRatio[1];g.push(i(A.pasp,new Uint8Array([(4278190080&C)>>24,(16711680&C)>>16,(65280&C)>>8,255&C,(4278190080&x)>>24,(16711680&x)>>16,(65280&x)>>8,255&x])))}return i.apply(null,g)},se=function(l){return i(A.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&l.channelcount)>>8,255&l.channelcount,(65280&l.samplesize)>>8,255&l.samplesize,0,0,0,0,(65280&l.samplerate)>>8,255&l.samplerate,0,0]),t(l))},f=function(l){var h=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,0,(4278190080&l.duration)>>24,(16711680&l.duration)>>16,(65280&l.duration)>>8,255&l.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&l.width)>>8,255&l.width,0,0,(65280&l.height)>>8,255&l.height,0,0]);return i(A.tkhd,h)},I=function(l){var h,g,p,v,T,S;return h=i(A.tfhd,new Uint8Array([0,0,0,58,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),T=Math.floor(l.baseMediaDecodeTime/ia),S=Math.floor(l.baseMediaDecodeTime%ia),g=i(A.tfdt,new Uint8Array([1,0,0,0,T>>>24&255,T>>>16&255,T>>>8&255,255&T,S>>>24&255,S>>>16&255,S>>>8&255,255&S])),l.type==="audio"?(p=N(l,92),i(A.traf,h,g,p)):(v=E(l),p=N(l,v.length+92),i(A.traf,h,g,p,v))},m=function(l){return l.duration=l.duration||4294967295,i(A.trak,f(l),_(l))},P=function(l){var h=new Uint8Array([0,0,0,0,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return l.type!=="video"&&(h[h.length-1]=0),i(A.trex,h)},ji=function(l,h){var g=0,p=0,v=0,T=0;return l.length&&(l[0].duration!==void 0&&(g=1),l[0].size!==void 0&&(p=2),l[0].flags!==void 0&&(v=4),l[0].compositionTimeOffset!==void 0&&(T=8)),[0,0,g|p|v|T,1,(4278190080&l.length)>>>24,(16711680&l.length)>>>16,(65280&l.length)>>>8,255&l.length,(4278190080&h)>>>24,(16711680&h)>>>16,(65280&h)>>>8,255&h]},Kt=function(l,h){var g,p,v,T,S,C;for(h+=20+16*(T=l.samples||[]).length,v=ji(T,h),(p=new Uint8Array(v.length+16*T.length)).set(v),g=v.length,C=0;C>>24,p[g++]=(16711680&S.duration)>>>16,p[g++]=(65280&S.duration)>>>8,p[g++]=255&S.duration,p[g++]=(4278190080&S.size)>>>24,p[g++]=(16711680&S.size)>>>16,p[g++]=(65280&S.size)>>>8,p[g++]=255&S.size,p[g++]=S.flags.isLeading<<2|S.flags.dependsOn,p[g++]=S.flags.isDependedOn<<6|S.flags.hasRedundancy<<4|S.flags.paddingValue<<1|S.flags.isNonSyncSample,p[g++]=61440&S.flags.degradationPriority,p[g++]=15&S.flags.degradationPriority,p[g++]=(4278190080&S.compositionTimeOffset)>>>24,p[g++]=(16711680&S.compositionTimeOffset)>>>16,p[g++]=(65280&S.compositionTimeOffset)>>>8,p[g++]=255&S.compositionTimeOffset;return i(A.trun,p)},le=function(l,h){var g,p,v,T,S,C;for(h+=20+8*(T=l.samples||[]).length,v=ji(T,h),(g=new Uint8Array(v.length+8*T.length)).set(v),p=v.length,C=0;C>>24,g[p++]=(16711680&S.duration)>>>16,g[p++]=(65280&S.duration)>>>8,g[p++]=255&S.duration,g[p++]=(4278190080&S.size)>>>24,g[p++]=(16711680&S.size)>>>16,g[p++]=(65280&S.size)>>>8,g[p++]=255&S.size;return i(A.trun,g)},N=function(l,h){return l.type==="audio"?le(l,h):Kt(l,h)},n=function(){return i(A.ftyp,U,B,U,R)};var Ge,Th,Sh,Do,Eh,wh,kh,Ch,xh=function(l){return i(A.mdat,l)},Dh=o,nv=function(l){var h,g=n(),p=u(l);return(h=new Uint8Array(g.byteLength+p.byteLength)).set(g),h.set(p,g.byteLength),h},iv=function(l,h){var g={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return g.dataOffset=h,g.compositionTimeOffset=l.pts-l.dts,g.duration=l.duration,g.size=4*l.length,g.size+=l.byteLength,l.keyFrame&&(g.flags.dependsOn=2,g.flags.isNonSyncSample=0),g},rv=function(l){var h,g,p=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,p.byteLength=0,h=0;h1&&(h=l.shift(),l.byteLength-=h.byteLength,l.nalCount-=h.nalCount,l[0][0].dts=h.dts,l[0][0].pts=h.pts,l[0][0].duration+=h.duration),l},ov=function(l,h){var g,p,v,T,S,C=h||0,x=[];for(g=0;gmn/2))){for((S=lv()[l.samplerate])||(S=h[0].data),C=0;C=g?l:(h.minSegmentDts=1/0,l.filter(function(p){return p.dts>=g&&(h.minSegmentDts=Math.min(h.minSegmentDts,p.dts),h.minSegmentPts=h.minSegmentDts,!0)}))},pv=function(l){var h,g,p=[];for(h=0;h=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(l),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ze.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},ze.prototype.addText=function(l){this.rows[this.rowIdx]+=l},ze.prototype.backspace=function(){if(!this.isEmpty()){var l=this.rows[this.rowIdx];this.rows[this.rowIdx]=l.substr(0,l.length-1)}};var aa=function(l,h,g){this.serviceNum=l,this.text="",this.currentWindow=new ze(-1),this.windows=[],this.stream=g,typeof h=="string"&&this.createTextDecoder(h)};aa.prototype.init=function(l,h){this.startPts=l;for(var g=0;g<8;g++)this.windows[g]=new ze(g),typeof h=="function"&&(this.windows[g].beforeRowOverflow=h)},aa.prototype.setCurrentWindow=function(l){this.currentWindow=this.windows[l]},aa.prototype.createTextDecoder=function(l){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(l)}catch(h){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+l+" encoding. "+h})}};var vt=function l(h){h=h||{},l.prototype.init.call(this);var g,p=this,v=h.captionServices||{},T={};Object.keys(v).forEach(function(S){g=v[S],/^SERVICE/.test(S)&&(T[S]=g.encoding)}),this.serviceEncodings=T,this.current708Packet=null,this.services={},this.push=function(S){S.type===3?(p.new708Packet(),p.add708Bytes(S)):(p.current708Packet===null&&p.new708Packet(),p.add708Bytes(S))}};vt.prototype=new Dt,vt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},vt.prototype.add708Bytes=function(l){var h=l.ccData,g=h>>>8,p=255&h;this.current708Packet.ptsVals.push(l.pts),this.current708Packet.data.push(g),this.current708Packet.data.push(p)},vt.prototype.push708Packet=function(){var l=this.current708Packet,h=l.data,g=null,p=null,v=0,T=h[v++];for(l.seq=T>>6,l.sizeCode=63&T;v>5)===7&&p>0&&(g=T=h[v++]),this.pushServiceBlock(g,v,p),p>0&&(v+=p-1)},vt.prototype.pushServiceBlock=function(l,h,g){var p,v=h,T=this.current708Packet.data,S=this.services[l];for(S||(S=this.initService(l,v));v>5,T.rowLock=(16&p)>>4,T.columnLock=(8&p)>>3,T.priority=7&p,p=g[++l],T.relativePositioning=(128&p)>>7,T.anchorVertical=127&p,p=g[++l],T.anchorHorizontal=p,p=g[++l],T.anchorPoint=(240&p)>>4,T.rowCount=15&p,p=g[++l],T.columnCount=63&p,p=g[++l],T.windowStyle=(56&p)>>3,T.penStyle=7&p,T.virtualRowCount=T.rowCount+1,l},vt.prototype.setWindowAttributes=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.winAttr;return p=g[++l],v.fillOpacity=(192&p)>>6,v.fillRed=(48&p)>>4,v.fillGreen=(12&p)>>2,v.fillBlue=3&p,p=g[++l],v.borderType=(192&p)>>6,v.borderRed=(48&p)>>4,v.borderGreen=(12&p)>>2,v.borderBlue=3&p,p=g[++l],v.borderType+=(128&p)>>5,v.wordWrap=(64&p)>>6,v.printDirection=(48&p)>>4,v.scrollDirection=(12&p)>>2,v.justify=3&p,p=g[++l],v.effectSpeed=(240&p)>>4,v.effectDirection=(12&p)>>2,v.displayEffect=3&p,l},vt.prototype.flushDisplayed=function(l,h){for(var g=[],p=0;p<8;p++)h.windows[p].visible&&!h.windows[p].isEmpty()&&g.push(h.windows[p].getText());h.endPts=l,h.text=g.join(` `),this.pushCaption(h),h.startPts=l},vt.prototype.pushCaption=function(l){l.text!==""&&(this.trigger("data",{startPts:l.startPts,endPts:l.endPts,text:l.text,stream:"cc708_"+l.serviceNum}),l.text="",l.startPts=l.endPts)},vt.prototype.displayWindows=function(l,h){var g=this.current708Packet.data[++l],p=this.getPts(l);this.flushDisplayed(p,h);for(var v=0;v<8;v++)g&1<>4,v.offset=(12&p)>>2,v.penSize=3&p,p=g[++l],v.italics=(128&p)>>7,v.underline=(64&p)>>6,v.edgeType=(56&p)>>3,v.fontStyle=7&p,l},vt.prototype.setPenColor=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.penColor;return p=g[++l],v.fgOpacity=(192&p)>>6,v.fgRed=(48&p)>>4,v.fgGreen=(12&p)>>2,v.fgBlue=3&p,p=g[++l],v.bgOpacity=(192&p)>>6,v.bgRed=(48&p)>>4,v.bgGreen=(12&p)>>2,v.bgBlue=3&p,p=g[++l],v.edgeRed=(48&p)>>4,v.edgeGreen=(12&p)>>2,v.edgeBlue=3&p,l},vt.prototype.setPenLocation=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.penLoc;return h.currentWindow.pendingNewLine=!0,p=g[++l],v.row=15&p,p=g[++l],v.column=63&p,l},vt.prototype.reset=function(l,h){var g=this.getPts(l);return this.flushDisplayed(g,h),this.initService(h.serviceNum,l)};var Sv={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},sa=function(l){return l===null?"":(l=Sv[l]||l,String.fromCharCode(l))},Ev=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],gn=function(){for(var l=[],h=15;h--;)l.push("");return l},Tt=function l(h,g){l.prototype.init.call(this),this.field_=h||0,this.dataChannel_=g||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(p){var v,T,S,C,x;if((v=32639&p.ccData)!==this.lastControlCode_){if((61440&v)==4096?this.lastControlCode_=v:v!==this.PADDING_&&(this.lastControlCode_=null),S=v>>>8,C=255&v,v!==this.PADDING_)if(v===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(v===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(p.pts),this.flushDisplayed(p.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=p.pts;else if(v===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(p.pts);else if(v===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(p.pts);else if(v===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(p.pts);else if(v===this.CARRIAGE_RETURN_)this.clearFormatting(p.pts),this.flushDisplayed(p.pts),this.shiftRowsUp_(),this.startPts_=p.pts;else if(v===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(v===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(p.pts),this.displayed_=gn();else if(v===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=gn();else if(v===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(p.pts),this.displayed_=gn()),this.mode_="paintOn",this.startPts_=p.pts;else if(this.isSpecialCharacter(S,C))x=sa((S=(3&S)<<8)|C),this[this.mode_](p.pts,x),this.column_++;else if(this.isExtCharacter(S,C))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),x=sa((S=(3&S)<<8)|C),this[this.mode_](p.pts,x),this.column_++;else if(this.isMidRowCode(S,C))this.clearFormatting(p.pts),this[this.mode_](p.pts," "),this.column_++,(14&C)==14&&this.addFormatting(p.pts,["i"]),(1&C)==1&&this.addFormatting(p.pts,["u"]);else if(this.isOffsetControlCode(S,C))this.column_+=3&C;else if(this.isPAC(S,C)){var L=Ev.indexOf(7968&v);this.mode_==="rollUp"&&(L-this.rollUpRows_+1<0&&(L=this.rollUpRows_-1),this.setRollUp(p.pts,L)),L!==this.row_&&(this.clearFormatting(p.pts),this.row_=L),1&C&&this.formatting_.indexOf("u")===-1&&this.addFormatting(p.pts,["u"]),(16&v)==16&&(this.column_=4*((14&v)>>1)),this.isColorPAC(C)&&(14&C)==14&&this.addFormatting(p.pts,["i"])}else this.isNormalChar(S)&&(C===0&&(C=null),x=sa(S),x+=sa(C),this[this.mode_](p.pts,x),this.column_+=x.length)}else this.lastControlCode_=null}};Tt.prototype=new Dt,Tt.prototype.flushDisplayed=function(l){var h=this.displayed_.map(function(g,p){try{return g.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+p+"."}),""}},this).join(` `).replace(/^\n+|\n+$/g,"");h.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,text:h,stream:this.name_})},Tt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=gn(),this.nonDisplayed_=gn(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Tt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Tt.prototype.isSpecialCharacter=function(l,h){return l===this.EXT_&&h>=48&&h<=63},Tt.prototype.isExtCharacter=function(l,h){return(l===this.EXT_+1||l===this.EXT_+2)&&h>=32&&h<=63},Tt.prototype.isMidRowCode=function(l,h){return l===this.EXT_&&h>=32&&h<=47},Tt.prototype.isOffsetControlCode=function(l,h){return l===this.OFFSET_&&h>=33&&h<=35},Tt.prototype.isPAC=function(l,h){return l>=this.BASE_&&l=64&&h<=127},Tt.prototype.isColorPAC=function(l){return l>=64&&l<=79||l>=96&&l<=127},Tt.prototype.isNormalChar=function(l){return l>=32&&l<=127},Tt.prototype.setRollUp=function(l,h){if(this.mode_!=="rollUp"&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=gn(),this.displayed_=gn()),h!==void 0&&h!==this.row_)for(var g=0;g"},"");this[this.mode_](l,g)},Tt.prototype.clearFormatting=function(l){if(this.formatting_.length){var h=this.formatting_.reverse().reduce(function(g,p){return g+""},"");this.formatting_=[],this[this.mode_](l,h)}},Tt.prototype.popOn=function(l,h){var g=this.nonDisplayed_[this.row_];g+=h,this.nonDisplayed_[this.row_]=g},Tt.prototype.rollUp=function(l,h){var g=this.displayed_[this.row_];g+=h,this.displayed_[this.row_]=g},Tt.prototype.shiftRowsUp_=function(){var l;for(l=0;lh&&(g=-1);Math.abs(h-l)>4294967296;)l+=8589934592*g;return l},Oh=function l(h){var g,p;l.prototype.init.call(this),this.type_=h||Lh,this.push=function(v){this.type_!==Lh&&v.type!==this.type_||(p===void 0&&(p=v.dts),v.dts=Oo(v.dts,p),v.pts=Oo(v.pts,p),g=v.dts,this.trigger("data",v))},this.flush=function(){p=g,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){p=void 0,g=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Oh.prototype=new Dt;var ua,wv=Oh,kv=Oo,Rh=function(l,h,g){var p,v="";for(p=h;p>>2;z*=4,z+=3&W[7],M.timeStamp=z,C.pts===void 0&&C.dts===void 0&&(C.pts=M.timeStamp,C.dts=M.timeStamp),this.trigger("timestamp",M)}C.frames.push(M),x+=10,x+=L}while(x>>4>1&&(S+=v[S]+1),T.pid===0)T.type="pat",l(v.subarray(S),T),this.trigger("data",T);else if(T.pid===this.pmtPid)for(T.type="pmt",l(v.subarray(S),T),this.trigger("data",T);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,S,T]):this.processPes_(v,S,T)},this.processPes_=function(v,T,S){S.pid===this.programMapTable.video?S.streamType=Mt.H264_STREAM_TYPE:S.pid===this.programMapTable.audio?S.streamType=Mt.ADTS_STREAM_TYPE:S.streamType=this.programMapTable["timed-metadata"][S.pid],S.type="pes",S.data=v.subarray(T),this.trigger("data",S)}},Hi.prototype=new Dt,Hi.STREAM_TYPES={h264:27,adts:15},da=function(){var l,h=this,g=!1,p={data:[],size:0},v={data:[],size:0},T={data:[],size:0},S=function(C,x,L){var M,j,W=new Uint8Array(C.size),z={type:x},st=0,ct=0;if(C.data.length&&!(C.size<9)){for(z.trackId=C.data[0].pid,st=0;st>>3,lt.pts*=4,lt.pts+=(6&ut[13])>>>1,lt.dts=lt.pts,64&oe&&(lt.dts=(14&ut[14])<<27|(255&ut[15])<<20|(254&ut[16])<<12|(255&ut[17])<<5|(254&ut[18])>>>3,lt.dts*=4,lt.dts+=(6&ut[18])>>>1)),lt.data=ut.subarray(9+ut[8])),M=x==="video"||z.packetLength<=C.size,(L||M)&&(C.size=0,C.data.length=0),M&&h.trigger("data",z)}};da.prototype.init.call(this),this.push=function(C){({pat:function(){},pes:function(){var x,L;switch(C.streamType){case Mt.H264_STREAM_TYPE:x=p,L="video";break;case Mt.ADTS_STREAM_TYPE:x=v,L="audio";break;case Mt.METADATA_STREAM_TYPE:x=T,L="timed-metadata";break;default:return}C.payloadUnitStartIndicator&&S(x,L,!0),x.data.push(C),x.size+=C.data.byteLength},pmt:function(){var x={type:"metadata",tracks:[]};(l=C.programMapTable).video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.video,codec:"avc",type:"video"}),l.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.audio,codec:"adts",type:"audio"}),g=!0,h.trigger("data",x)}})[C.type]()},this.reset=function(){p.size=0,p.data.length=0,v.size=0,v.data.length=0,this.trigger("reset")},this.flushStreams_=function(){S(p,"video"),S(v,"audio"),S(T,"timed-metadata")},this.flush=function(){if(!g&&l){var C={type:"metadata",tracks:[]};l.video!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.video,codec:"avc",type:"video"}),l.audio!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.audio,codec:"adts",type:"audio"}),h.trigger("data",C)}g=!1,this.flushStreams_(),this.trigger("done")}},da.prototype=new Dt;var Mh={PAT_PID:0,MP2T_PACKET_LENGTH:ei,TransportPacketStream:Ro,TransportParseStream:Hi,ElementaryStream:da,TimestampRolloverStream:xv,CaptionStream:oa.CaptionStream,Cea608Stream:oa.Cea608Stream,Cea708Stream:oa.Cea708Stream,MetadataStream:Cv};for(var No in Mt)Mt.hasOwnProperty(No)&&(Mh[No]=Mt[No]);var ha,Xe=Mh,Dv=mn,Uh=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ha=function(l){var h,g=0;ha.prototype.init.call(this),this.skipWarn_=function(p,v){this.trigger("log",{level:"warn",message:"adts skiping bytes "+p+" to "+v+" in frame "+g+" outside syncword"})},this.push=function(p){var v,T,S,C,x,L=0;if(l||(g=0),p.type==="audio"){var M;for(h&&h.length?(S=h,(h=new Uint8Array(S.byteLength+p.data.byteLength)).set(S),h.set(p.data,S.byteLength)):h=p.data;L+7>5,x=(C=1024*(1+(3&h[L+6])))*Dv/Uh[(60&h[L+2])>>>2],h.byteLength-L>>6&3),channelcount:(1&h[L+2])<<2|(192&h[L+3])>>>6,samplerate:Uh[(60&h[L+2])>>>2],samplingfrequencyindex:(60&h[L+2])>>>2,samplesize:16,data:h.subarray(L+7+T,L+v)}),g++,L+=v}else typeof M!="number"&&(M=L),L++;typeof M=="number"&&(this.skipWarn_(M,L),M=null),h=h.subarray(L)}},this.flush=function(){g=0,this.trigger("done")},this.reset=function(){h=void 0,this.trigger("reset")},this.endTimeline=function(){h=void 0,this.trigger("endedtimeline")}},ha.prototype=new Dt;var Bh,Fh=ha;Bh=function(l){var h=l.byteLength,g=0,p=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+p},this.loadWord=function(){var v=l.byteLength-h,T=new Uint8Array(4),S=Math.min(4,h);if(S===0)throw new Error("no bytes available");T.set(l.subarray(v,v+S)),g=new DataView(T.buffer).getUint32(0),p=8*S,h-=S},this.skipBits=function(v){var T;p>v?(g<<=v,p-=v):(v-=p,v-=8*(T=Math.floor(v/8)),h-=T,this.loadWord(),g<<=v,p-=v)},this.readBits=function(v){var T=Math.min(p,v),S=g>>>32-T;return(p-=T)>0?g<<=T:h>0&&this.loadWord(),(T=v-T)>0?S<>>v)return g<<=v,p-=v,v;return this.loadWord(),v+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1},this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var pa,Vi,jh,Iv=Bh;Vi=function(){var l,h,g=0;Vi.prototype.init.call(this),this.push=function(p){var v;h?((v=new Uint8Array(h.byteLength+p.data.byteLength)).set(h),v.set(p.data,h.byteLength),h=v):h=p.data;for(var T=h.byteLength;g3&&this.trigger("data",h.subarray(g+3)),h=null,g=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Vi.prototype=new Dt,jh={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},pa=function(){var l,h,g,p,v,T,S,C=new Vi;pa.prototype.init.call(this),l=this,this.push=function(x){x.type==="video"&&(h=x.trackId,g=x.pts,p=x.dts,C.push(x))},C.on("data",function(x){var L={trackId:h,pts:g,dts:p,data:x,nalUnitTypeCode:31&x[0]};switch(L.nalUnitTypeCode){case 5:L.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:L.nalUnitType="sei_rbsp",L.escapedRBSP=v(x.subarray(1));break;case 7:L.nalUnitType="seq_parameter_set_rbsp",L.escapedRBSP=v(x.subarray(1)),L.config=T(L.escapedRBSP);break;case 8:L.nalUnitType="pic_parameter_set_rbsp";break;case 9:L.nalUnitType="access_unit_delimiter_rbsp"}l.trigger("data",L)}),C.on("done",function(){l.trigger("done")}),C.on("partialdone",function(){l.trigger("partialdone")}),C.on("reset",function(){l.trigger("reset")}),C.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){C.flush()},this.partialFlush=function(){C.partialFlush()},this.reset=function(){C.reset()},this.endTimeline=function(){C.endTimeline()},S=function(x,L){var M,j=8,W=8;for(M=0;M=0?g:0,(16&l[h+5])>>4?g+20:g+10},Lv=function l(h,g){return h.length-g<10||h[g]!=="I".charCodeAt(0)||h[g+1]!=="D".charCodeAt(0)||h[g+2]!=="3".charCodeAt(0)?g:l(h,g+=qh(h,g))},Hh=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},fa={isLikelyAacData:function(l){var h=Lv(l,0);return l.length>=h+2&&(255&l[h])==255&&(240&l[h+1])==240&&(22&l[h+1])==16},parseId3TagSize:qh,parseAdtsSize:function(l,h){var g=(224&l[h+5])>>5,p=l[h+4]<<3;return 6144&l[h+3]|p|g},parseType:function(l,h){return l[h]==="I".charCodeAt(0)&&l[h+1]==="D".charCodeAt(0)&&l[h+2]==="3".charCodeAt(0)?"timed-metadata":!0&l[h]&&(240&l[h+1])==240?"audio":null},parseSampleRate:function(l){for(var h=0;h+5>>2];h++}return null},parseAacTimestamp:function(l){var h,g,p;h=10,64&l[5]&&(h+=4,h+=Hh(l.subarray(10,14)));do{if((g=Hh(l.subarray(h+4,h+8)))<1)return null;if(String.fromCharCode(l[h],l[h+1],l[h+2],l[h+3])==="PRIV"){p=l.subarray(h+10,h+g+10);for(var v=0;v>>2;return C*=4,C+=3&S[7]}break}}h+=10,h+=g}while(h=3;)if(l[x]!=="I".charCodeAt(0)||l[x+1]!=="D".charCodeAt(0)||l[x+2]!=="3".charCodeAt(0))if((255&l[x])!=255||(240&l[x+1])!=240)x++;else{if(l.length-x<7||x+(C=fa.parseAdtsSize(l,x))>l.length)break;T={type:"audio",data:l.subarray(x,x+C),pts:h,dts:h},this.trigger("data",T),x+=C}else{if(l.length-x<10||x+(C=fa.parseId3TagSize(l,x))>l.length)break;v={type:"timed-metadata",data:l.subarray(x,x+C)},this.trigger("data",v),x+=C}p=l.length-x,l=p>0?l.subarray(x):new Uint8Array},this.reset=function(){l=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){l=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Dt;var Wi,ni,ma,vn,Ov=Mo,Uo=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Bo=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Rv=Av.H264Stream,Nv=fa.isLikelyAacData,Mv=mn,Uv=function(l,h){h.stream=l,this.trigger("log",h)},Vh=function(l,h){for(var g=Object.keys(h),p=0;p=-1e4&&x<=45e3&&(!L||z>x)&&(L=j,z=x));return L?L.gop:null},this.alignGopsAtStart_=function(C){var x,L,M,j,W,z,st,ct;for(W=C.byteLength,z=C.nalCount,st=C.duration,x=L=0;xM.pts?x++:(L++,W-=j.byteLength,z-=j.nalCount,st-=j.duration);return L===0?C:L===C.length?null:((ct=C.slice(L)).byteLength=W,ct.duration=st,ct.nalCount=z,ct.pts=ct[0].pts,ct.dts=ct[0].dts,ct)},this.alignGopsAtEnd_=function(C){var x,L,M,j,W,z,st;for(x=S.length-1,L=C.length-1,W=null,z=!1;x>=0&&L>=0;){if(M=S[x],j=C[L],M.pts===j.pts){z=!0;break}M.pts>j.pts?x--:(x===S.length-1&&(W=L),L--)}if(!z&&W===null)return null;if((st=z?L:W)===0)return C;var ct=C.slice(st),ut=ct.reduce(function(lt,oe){return lt.byteLength+=oe.byteLength,lt.duration+=oe.duration,lt.nalCount+=oe.nalCount,lt},{byteLength:0,duration:0,nalCount:0});return ct.byteLength=ut.byteLength,ct.duration=ut.duration,ct.nalCount=ut.nalCount,ct.pts=ct[0].pts,ct.dts=ct[0].dts,ct},this.alignGopsWith=function(C){S=C}},Wi.prototype=new Dt,vn=function(l,h){this.numberOfTracks=0,this.metadataStream=h,(l=l||{}).remux!==void 0?this.remuxTracks=!!l.remux:this.remuxTracks=!0,typeof l.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=l.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vn.prototype.init.call(this),this.push=function(g){return g.text?this.pendingCaptions.push(g):g.frames?this.pendingMetadata.push(g):(this.pendingTracks.push(g.track),this.pendingBytes+=g.boxes.byteLength,g.track.type==="video"&&(this.videoTrack=g.track,this.pendingBoxes.push(g.boxes)),void(g.track.type==="audio"&&(this.audioTrack=g.track,this.pendingBoxes.unshift(g.boxes))))}},vn.prototype=new Dt,vn.prototype.flush=function(l){var h,g,p,v,T=0,S={captions:[],captionStreams:{},metadata:[],info:{}},C=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(C=this.videoTrack.timelineStartInfo.pts,Bo.forEach(function(x){S.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(C=this.audioTrack.timelineStartInfo.pts,Uo.forEach(function(x){S.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?S.type=this.pendingTracks[0].type:S.type="combined",this.emittedTracks+=this.pendingTracks.length,p=nv(this.pendingTracks),S.initSegment=new Uint8Array(p.byteLength),S.initSegment.set(p),S.data=new Uint8Array(this.pendingBytes),v=0;v=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vn.prototype.setRemux=function(l){this.remuxTracks=l},ma=function(l){var h,g,p=this,v=!0;ma.prototype.init.call(this),l=l||{},this.baseMediaDecodeTime=l.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="aac",T.metadataStream=new Xe.MetadataStream,T.aacStream=new Ov,T.audioTimestampRolloverStream=new Xe.TimestampRolloverStream("audio"),T.timedMetadataTimestampRolloverStream=new Xe.TimestampRolloverStream("timed-metadata"),T.adtsStream=new Fh,T.coalesceStream=new vn(l,T.metadataStream),T.headOfPipeline=T.aacStream,T.aacStream.pipe(T.audioTimestampRolloverStream).pipe(T.adtsStream),T.aacStream.pipe(T.timedMetadataTimestampRolloverStream).pipe(T.metadataStream).pipe(T.coalesceStream),T.metadataStream.on("timestamp",function(S){T.aacStream.setTimestamp(S.timeStamp)}),T.aacStream.on("data",function(S){S.type!=="timed-metadata"&&S.type!=="audio"||T.audioSegmentStream||(g=g||{timelineStartInfo:{baseMediaDecodeTime:p.baseMediaDecodeTime},codec:"adts",type:"audio"},T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new ni(g,l),T.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream),p.trigger("trackinfo",{hasAudio:!!g,hasVideo:!!h}))}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),Vh(this,T)},this.setupTsPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="ts",T.metadataStream=new Xe.MetadataStream,T.packetStream=new Xe.TransportPacketStream,T.parseStream=new Xe.TransportParseStream,T.elementaryStream=new Xe.ElementaryStream,T.timestampRolloverStream=new Xe.TimestampRolloverStream,T.adtsStream=new Fh,T.h264Stream=new Rv,T.captionStream=new Xe.CaptionStream(l),T.coalesceStream=new vn(l,T.metadataStream),T.headOfPipeline=T.packetStream,T.packetStream.pipe(T.parseStream).pipe(T.elementaryStream).pipe(T.timestampRolloverStream),T.timestampRolloverStream.pipe(T.h264Stream),T.timestampRolloverStream.pipe(T.adtsStream),T.timestampRolloverStream.pipe(T.metadataStream).pipe(T.coalesceStream),T.h264Stream.pipe(T.captionStream).pipe(T.coalesceStream),T.elementaryStream.on("data",function(S){var C;if(S.type==="metadata"){for(C=S.tracks.length;C--;)h||S.tracks[C].type!=="video"?g||S.tracks[C].type!=="audio"||((g=S.tracks[C]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime):(h=S.tracks[C]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime;h&&!T.videoSegmentStream&&(T.coalesceStream.numberOfTracks++,T.videoSegmentStream=new Wi(h,l),T.videoSegmentStream.on("log",p.getLogTrigger_("videoSegmentStream")),T.videoSegmentStream.on("timelineStartInfo",function(x){g&&!l.keepOriginalTimestamps&&(g.timelineStartInfo=x,T.audioSegmentStream.setEarliestDts(x.dts-p.baseMediaDecodeTime))}),T.videoSegmentStream.on("processedGopsInfo",p.trigger.bind(p,"gopInfo")),T.videoSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"videoSegmentTimingInfo")),T.videoSegmentStream.on("baseMediaDecodeTime",function(x){g&&T.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),T.videoSegmentStream.on("timingInfo",p.trigger.bind(p,"videoTimingInfo")),T.h264Stream.pipe(T.videoSegmentStream).pipe(T.coalesceStream)),g&&!T.audioSegmentStream&&(T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new ni(g,l),T.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),T.audioSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"audioSegmentTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream)),p.trigger("trackinfo",{hasAudio:!!g,hasVideo:!!h})}}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("id3Frame",function(S){S.dispatchType=T.metadataStream.dispatchType,p.trigger("id3Frame",S)}),T.coalesceStream.on("caption",this.trigger.bind(this,"caption")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),Vh(this,T)},this.setBaseMediaDecodeTime=function(T){var S=this.transmuxPipeline_;l.keepOriginalTimestamps||(this.baseMediaDecodeTime=T),g&&(g.timelineStartInfo.dts=void 0,g.timelineStartInfo.pts=void 0,ti(g),S.audioTimestampRolloverStream&&S.audioTimestampRolloverStream.discontinuity()),h&&(S.videoSegmentStream&&(S.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,ti(h),S.captionStream.reset()),S.timestampRolloverStream&&S.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(T){g&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(T)},this.setRemux=function(T){var S=this.transmuxPipeline_;l.remux=T,S&&S.coalesceStream&&S.coalesceStream.setRemux(T)},this.alignGopsWith=function(T){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(T)},this.getLogTrigger_=function(T){var S=this;return function(C){C.stream=T,S.trigger("log",C)}},this.push=function(T){if(v){var S=Nv(T);S&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():S||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),v=!1}this.transmuxPipeline_.headOfPipeline.push(T)},this.flush=function(){v=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},ma.prototype=new Dt;var Gh,zh,Xh,Bv={Transmuxer:ma,VideoSegmentStream:Wi,AudioSegmentStream:ni,AUDIO_PROPERTIES:Uo,VIDEO_PROPERTIES:Bo,generateSegmentTimingInfo:Fo},jo=function(l){return l>>>0},Gi=function(l){var h="";return h+=String.fromCharCode(l[0]),h+=String.fromCharCode(l[1]),h+=String.fromCharCode(l[2]),h+=String.fromCharCode(l[3])},Fv=jo,ne=function l(h,g){var p,v,T,S,C,x=[];if(!g.length)return null;for(p=0;p1?p+v:h.byteLength,T===g[0]&&(g.length===1?x.push(h.subarray(p+8,S)):(C=l(h.subarray(p+8,S),g.slice(1))).length&&(x=x.concat(C))),p=S;return x},jv=jo,qv=qi.getUint64,Hv=function(l){var h={version:l[0],flags:new Uint8Array(l.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=qv(l.subarray(4)):h.baseMediaDecodeTime=jv(l[4]<<24|l[5]<<16|l[6]<<8|l[7]),h},Kh=function(l){return{isLeading:(12&l[0])>>>2,dependsOn:3&l[0],isDependedOn:(192&l[1])>>>6,hasRedundancy:(48&l[1])>>>4,paddingValue:(14&l[1])>>>1,isNonSyncSample:1&l[1],degradationPriority:l[2]<<8|l[3]}},Vv=function(l){var h,g={version:l[0],flags:new Uint8Array(l.subarray(1,4)),samples:[]},p=new DataView(l.buffer,l.byteOffset,l.byteLength),v=1&g.flags[2],T=4&g.flags[2],S=1&g.flags[1],C=2&g.flags[1],x=4&g.flags[1],L=8&g.flags[1],M=p.getUint32(4),j=8;for(v&&(g.dataOffset=p.getInt32(j),j+=4),T&&M&&(h={flags:Kh(l.subarray(j,j+4))},j+=4,S&&(h.duration=p.getUint32(j),j+=4),C&&(h.size=p.getUint32(j),j+=4),L&&(g.version===1?h.compositionTimeOffset=p.getInt32(j):h.compositionTimeOffset=p.getUint32(j),j+=4),g.samples.push(h),M--);M--;)h={},S&&(h.duration=p.getUint32(j),j+=4),C&&(h.size=p.getUint32(j),j+=4),x&&(h.flags=Kh(l.subarray(j,j+4)),j+=4),L&&(g.version===1?h.compositionTimeOffset=p.getInt32(j):h.compositionTimeOffset=p.getUint32(j),j+=4),g.samples.push(h);return g},Wv=function(l){var h,g=new DataView(l.buffer,l.byteOffset,l.byteLength),p={version:l[0],flags:new Uint8Array(l.subarray(1,4)),trackId:g.getUint32(4)},v=1&p.flags[2],T=2&p.flags[2],S=8&p.flags[2],C=16&p.flags[2],x=32&p.flags[2],L=65536&p.flags[0],M=131072&p.flags[0];return h=8,v&&(h+=4,p.baseDataOffset=g.getUint32(12),h+=4),T&&(p.sampleDescriptionIndex=g.getUint32(h),h+=4),S&&(p.defaultSampleDuration=g.getUint32(h),h+=4),C&&(p.defaultSampleSize=g.getUint32(h),h+=4),x&&(p.defaultSampleFlags=g.getUint32(h)),L&&(p.durationIsEmpty=!0),!v&&M&&(p.baseDataOffsetIsMoof=!0),p},Yh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qo=typeof window<"u"?window:Yh!==void 0?Yh:typeof self<"u"?self:{},Gv=_v,zv=oa.CaptionStream,Xv=function(l,h){for(var g=l,p=0;p0?Hv(st[0]).baseMediaDecodeTime:0,ut=ne(M,["trun"]);h===z&&ut.length>0&&(C=function(lt,oe,de){var Ct=oe,Qt=de.defaultSampleDuration||0,De=de.defaultSampleSize||0,Ke=de.trackId,tn=[];return lt.forEach(function(gt){var Xi=Vv(gt).samples;Xi.forEach(function(It){It.duration===void 0&&(It.duration=Qt),It.size===void 0&&(It.size=De),It.trackId=Ke,It.dts=Ct,It.compositionTimeOffset===void 0&&(It.compositionTimeOffset=0),typeof Ct=="bigint"?(It.pts=Ct+qo.BigInt(It.compositionTimeOffset),Ct+=qo.BigInt(It.duration)):(It.pts=Ct+It.compositionTimeOffset,Ct+=It.duration)}),tn=tn.concat(Xi)}),tn}(ut,ct,W),x=function(lt,oe,de){var Ct,Qt,De,Ke,tn=new DataView(lt.buffer,lt.byteOffset,lt.byteLength),gt={logs:[],seiNals:[]};for(Qt=0;Qt+40;){var j=h.shift();this.parse(j,x,L)}return M=function(W,z,st){if(z===null)return null;var ct=Kv(W,z)[z]||{};return{seiNals:ct.seiNals,logs:ct.logs,timescale:st}}(C,g,p),M&&M.logs&&(v.logs=v.logs.concat(M.logs)),M!==null&&M.seiNals?(this.pushNals(M.seiNals),this.flushStream(),v):v.logs.length?{logs:v.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(C){if(!this.isInitialized()||!C||C.length===0)return null;C.forEach(function(x){l.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;T?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){v.captions=[],v.captionStreams={},v.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],g=null,p=null,v?this.clearParsedCaptions():v={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Qh=jo,zi=function(l){return("00"+l.toString(16)).slice(-2)},Qv=qi.getUint64;Gh=function(l,h){var g=ne(h,["moof","traf"]).reduce(function(p,v){var T,S,C=ne(v,["tfhd"])[0],x=Qh(C[4]<<24|C[5]<<16|C[6]<<8|C[7]),L=l[x]||9e4,M=ne(v,["tfdt"])[0],j=new DataView(M.buffer,M.byteOffset,M.byteLength);return typeof(T=M[0]===1?Qv(M.subarray(4,12)):j.getUint32(4))=="bigint"?S=T/qo.BigInt(L):typeof T!="number"||isNaN(T)||(S=T/L),S11?(S.codec+=".",S.codec+=zi(W[9]),S.codec+=zi(W[10]),S.codec+=zi(W[11])):S.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(S.codec)?(W=z.subarray(28),Gi(W.subarray(4,8))==="esds"&&W.length>20&&W[19]!==0?(S.codec+="."+zi(W[19]),S.codec+="."+zi(W[20]>>>2&63).replace(/^0/,"")):S.codec="mp4a.40.2"):S.codec=S.codec.toLowerCase())}var st=ne(p,["mdia","mdhd"])[0];st&&(S.timescale=Xh(st)),g.push(S)}),g};var $v=Gh,Jv=zh,$h=function(l){var h=31&l[1];return h<<=8,h|=l[2]},ga=function(l){return!!(64&l[1])},va=function(l){var h=0;return(48&l[3])>>>4>1&&(h+=l[4]+1),h},Ho=function(l){switch(l){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Zv={parseType:function(l,h){var g=$h(l);return g===0?"pat":g===h?"pmt":h?"pes":null},parsePat:function(l){var h=ga(l),g=4+va(l);return h&&(g+=l[g]+1),(31&l[g+10])<<8|l[g+11]},parsePmt:function(l){var h={},g=ga(l),p=4+va(l);if(g&&(p+=l[p]+1),1&l[p+5]){var v;v=3+((15&l[p+1])<<8|l[p+2])-4;for(var T=12+((15&l[p+10])<<8|l[p+11]);T=l.byteLength)return null;var g,p=null;return 192&(g=l[h+7])&&((p={}).pts=(14&l[h+9])<<27|(255&l[h+10])<<20|(254&l[h+11])<<12|(255&l[h+12])<<5|(254&l[h+13])>>>3,p.pts*=4,p.pts+=(6&l[h+13])>>>1,p.dts=p.pts,64&g&&(p.dts=(14&l[h+14])<<27|(255&l[h+15])<<20|(254&l[h+16])<<12|(255&l[h+17])<<5|(254&l[h+18])>>>3,p.dts*=4,p.dts+=(6&l[h+18])>>>1)),p},videoPacketContainsKeyFrame:function(l){for(var h=4+va(l),g=l.subarray(h),p=0,v=0,T=!1;v3&&Ho(31&g[v+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0),T}},ii=kv,ft={};ft.ts=Zv,ft.aac=fa;var yn=mn,Yt=188,xe=71,ty=function(l,h,g){for(var p,v,T,S,C=0,x=Yt,L=!1;x<=l.byteLength;)if(l[C]!==xe||l[x]!==xe&&x!==l.byteLength)C++,x++;else{if(p=l.subarray(C,x),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="audio"&&T&&(S=ft.ts.parsePesTime(p))&&(S.type="audio",g.audio.push(S),L=!0)),L)break;C+=Yt,x+=Yt}for(C=(x=l.byteLength)-Yt,L=!1;C>=0;)if(l[C]!==xe||l[x]!==xe&&x!==l.byteLength)C--,x--;else{if(p=l.subarray(C,x),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="audio"&&T&&(S=ft.ts.parsePesTime(p))&&(S.type="audio",g.audio.push(S),L=!0)),L)break;C-=Yt,x-=Yt}},ey=function(l,h,g){for(var p,v,T,S,C,x,L,M=0,j=Yt,W=!1,z={data:[],size:0};j=0;)if(l[M]!==xe||l[j]!==xe)M--,j--;else{if(p=l.subarray(M,j),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="video"&&T&&(S=ft.ts.parsePesTime(p))&&(S.type="video",g.video.push(S),W=!0)),W)break;M-=Yt,j-=Yt}},ny=function(l){var h={pid:null,table:null},g={};for(var p in function(v,T){for(var S,C=0,x=Yt;x=3;){switch(ft.aac.parseType(p,M)){case"timed-metadata":if(p.length-M<10){T=!0;break}if((L=ft.aac.parseId3TagSize(p,M))>p.length){T=!0;break}x===null&&(v=p.subarray(M,M+L),x=ft.aac.parseAacTimestamp(v)),M+=L;break;case"audio":if(p.length-M<7){T=!0;break}if((L=ft.aac.parseAdtsSize(p,M))>p.length){T=!0;break}C===null&&(v=p.subarray(M,M+L),C=ft.aac.parseSampleRate(v)),S++,M+=L;break;default:M++}if(T)return null}if(C===null||x===null)return null;var j=yn/C;return{audio:[{type:"audio",dts:x,pts:x},{type:"audio",dts:x+1024*S*j,pts:x+1024*S*j}]}}(l):ny(l),g&&(g.audio||g.video)?(function(p,v){if(p.audio&&p.audio.length){var T=v;(T===void 0||isNaN(T))&&(T=p.audio[0].dts),p.audio.forEach(function(x){x.dts=ii(x.dts,T),x.pts=ii(x.pts,T),x.dtsTime=x.dts/yn,x.ptsTime=x.pts/yn})}if(p.video&&p.video.length){var S=v;if((S===void 0||isNaN(S))&&(S=p.video[0].dts),p.video.forEach(function(x){x.dts=ii(x.dts,S),x.pts=ii(x.pts,S),x.dtsTime=x.dts/yn,x.ptsTime=x.pts/yn}),p.firstKeyFrame){var C=p.firstKeyFrame;C.dts=ii(C.dts,S),C.pts=ii(C.pts,S),C.dtsTime=C.dts/yn,C.ptsTime=C.pts/yn}}}(g,h),g):null},Jh=function(){function l(g,p){this.options=p||{},this.self=g,this.init()}var h=l.prototype;return h.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Bv.Transmuxer(this.options),function(g,p){p.on("data",function(v){var T=v.initSegment;v.initSegment={data:T.buffer,byteOffset:T.byteOffset,byteLength:T.byteLength};var S=v.data;v.data=S.buffer,g.postMessage({action:"data",segment:v,byteOffset:S.byteOffset,byteLength:S.byteLength},[v.data])}),p.on("done",function(v){g.postMessage({action:"done"})}),p.on("gopInfo",function(v){g.postMessage({action:"gopInfo",gopInfo:v})}),p.on("videoSegmentTimingInfo",function(v){var T={start:{decode:jt(v.start.dts),presentation:jt(v.start.pts)},end:{decode:jt(v.end.dts),presentation:jt(v.end.pts)},baseMediaDecodeTime:jt(v.baseMediaDecodeTime)};v.prependedContentDuration&&(T.prependedContentDuration=jt(v.prependedContentDuration)),g.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:T})}),p.on("audioSegmentTimingInfo",function(v){var T={start:{decode:jt(v.start.dts),presentation:jt(v.start.pts)},end:{decode:jt(v.end.dts),presentation:jt(v.end.pts)},baseMediaDecodeTime:jt(v.baseMediaDecodeTime)};v.prependedContentDuration&&(T.prependedContentDuration=jt(v.prependedContentDuration)),g.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:T})}),p.on("id3Frame",function(v){g.postMessage({action:"id3Frame",id3Frame:v})}),p.on("caption",function(v){g.postMessage({action:"caption",caption:v})}),p.on("trackinfo",function(v){g.postMessage({action:"trackinfo",trackInfo:v})}),p.on("audioTimingInfo",function(v){g.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:jt(v.start),end:jt(v.end)}})}),p.on("videoTimingInfo",function(v){g.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:jt(v.start),end:jt(v.end)}})}),p.on("log",function(v){g.postMessage({action:"log",log:v})})}(this.self,this.transmuxer)},h.pushMp4Captions=function(g){this.captionParser||(this.captionParser=new Yv,this.captionParser.init());var p=new Uint8Array(g.data,g.byteOffset,g.byteLength),v=this.captionParser.parse(p,g.trackIds,g.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:p.buffer},[p.buffer])},h.probeMp4StartTime=function(g){var p=g.timescales,v=g.data,T=$v(p,v);this.self.postMessage({action:"probeMp4StartTime",startTime:T,data:v},[v.buffer])},h.probeMp4Tracks=function(g){var p=g.data,v=Jv(p);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:p},[p.buffer])},h.probeTs=function(g){var p=g.data,v=g.baseStartTime,T=typeof v!="number"||isNaN(v)?void 0:v*mn,S=iy(p,T),C=null;S&&((C={hasVideo:S.video&&S.video.length===2||!1,hasAudio:S.audio&&S.audio.length===2||!1}).hasVideo&&(C.videoStart=S.video[0].ptsTime),C.hasAudio&&(C.audioStart=S.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:C,data:p},[p.buffer])},h.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},h.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},h.push=function(g){var p=new Uint8Array(g.data,g.byteOffset,g.byteLength);this.transmuxer.push(p)},h.reset=function(){this.transmuxer.reset()},h.setTimestampOffset=function(g){var p=g.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Ih(p)))},h.setAudioAppendStart=function(g){this.transmuxer.setAudioAppendStart(Math.ceil(Ih(g.appendStart)))},h.setRemux=function(g){this.transmuxer.setRemux(g.remux)},h.flush=function(g){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},h.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},h.alignGopsWith=function(g){this.transmuxer.alignGopsWith(g.gopsToAlignWith.slice())},l}();self.onmessage=function(l){l.data.action==="init"&&l.data.options?this.messageHandlers=new Jh(self,l.data.options):(this.messageHandlers||(this.messageHandlers=new Jh(self)),l.data&&l.data.action&&l.data.action!=="init"&&this.messageHandlers[l.data.action]&&this.messageHandlers[l.data.action](l.data))}})),sg=Rd(ag),Ud=function(e){var i=e.transmuxer,r=e.bytes,t=e.audioAppendStart,n=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,c=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,m=e.onAudioSegmentTimingInfo,f=e.onId3,_=e.onCaptions,b=e.onDone,y=e.onEndedTimeline,E=e.onTransmuxerLog,w=e.isEndOfTimeline,k={buffer:[]},I=w;if(i.onmessage=function(A){i.currentTransmux===e&&(A.data.action==="data"&&function(U,B,R){var q=U.data.segment,$=q.type,Y=q.initSegment,K=q.captions,Q=q.captionStreams,X=q.metadata,nt=q.videoFrameDtsTime,at=q.videoFramePtsTime;B.buffer.push({captions:K,captionStreams:Q,metadata:X});var ht=U.data.segment.boxes||{data:U.data.segment.data},J={type:$,data:new Uint8Array(ht.data,ht.data.byteOffset,ht.data.byteLength),initSegment:new Uint8Array(Y.data,Y.byteOffset,Y.byteLength)};nt!==void 0&&(J.videoFrameDtsTime=nt),at!==void 0&&(J.videoFramePtsTime=at),R(J)}(A,k,s),A.data.action==="trackinfo"&&o(A.data.trackInfo),A.data.action==="gopInfo"&&function(U,B){B.gopInfo=U.data.gopInfo}(A,k),A.data.action==="audioTimingInfo"&&u(A.data.audioTimingInfo),A.data.action==="videoTimingInfo"&&c(A.data.videoTimingInfo),A.data.action==="videoSegmentTimingInfo"&&d(A.data.videoSegmentTimingInfo),A.data.action==="audioSegmentTimingInfo"&&m(A.data.audioSegmentTimingInfo),A.data.action==="id3Frame"&&f([A.data.id3Frame],A.data.id3Frame.dispatchType),A.data.action==="caption"&&_(A.data.caption),A.data.action==="endedtimeline"&&(I=!1,y()),A.data.action==="log"&&E(A.data.log),A.data.type==="transmuxed"&&(I||(i.onmessage=null,function(U){var B=U.transmuxedData,R=U.callback;B.buffer=[],R(B)}({transmuxedData:k,callback:b}),Bd(i))))},t&&i.postMessage({action:"setAudioAppendStart",appendStart:t}),Array.isArray(n)&&i.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),a!==void 0&&i.postMessage({action:"setRemux",remux:a}),r.byteLength){var P=r instanceof ArrayBuffer?r:r.buffer,N=r instanceof ArrayBuffer?0:r.byteOffset;i.postMessage({action:"push",data:P,byteOffset:N,byteLength:r.byteLength},[P])}w&&i.postMessage({action:"endTimeline"}),i.postMessage({action:"flush"})},Bd=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():Ud(e.currentTransmux))},Fd=function(e,i){e.postMessage({action:i}),Bd(e)},og=function(e,i){if(!i.currentTransmux)return i.currentTransmux=e,void Fd(i,e);i.transmuxQueue.push(Fd.bind(null,i,e))},ug=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ud(e);e.transmuxer.transmuxQueue.push(e)},jd=function(e){og("reset",e)},lg=function(e){var i=new sg;i.currentTransmux=null,i.transmuxQueue=[];var r=i.terminate;return i.terminate=function(){return i.currentTransmux=null,i.transmuxQueue.length=0,r.call(i)},i.postMessage({action:"init",options:e}),i},Kr=function(e){var i=e.transmuxer,r=e.endAction||e.action,t=e.callback,n=he({},e,{endAction:null,transmuxer:null,callback:null});if(i.addEventListener("message",function o(u){u.data.action===r&&(i.removeEventListener("message",o),u.data.data&&(u.data.data=new Uint8Array(u.data.data,e.byteOffset||0,e.byteLength||u.data.data.byteLength),e.data&&(e.data=u.data.data)),t(u.data))}),e.data){var a=e.data instanceof ArrayBuffer;n.byteOffset=a?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];i.postMessage(n,s)}else i.postMessage(n)},Yr=2,fo=-101,mo=-102,go=function(e){e.forEach(function(i){i.abort()})},vo=function(e,i){return i.timedout?{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:fo,xhr:i}:i.aborted?{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:mo,xhr:i}:e?{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Yr,xhr:i}:i.responseType==="arraybuffer"&&i.response.byteLength===0?{status:i.status,message:"Empty HLS response at URL: "+i.uri,code:Yr,xhr:i}:null},qd=function(e,i,r){return function(t,n){var a=n.response,s=vo(t,n);if(s)return r(s,e);if(a.byteLength!==16)return r({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yr,xhr:n},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),c=0;c0}(b)){i.isFmp4=!0;var y=i.map.tracks,E={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(E.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(E.videoCodec=y.video.codec),y.video&&y.audio&&(E.isMuxed=!0),t(i,E);var w=function(k){m(i,{data:b,type:E.hasAudio&&!E.isMuxed?"audio":"video"}),k&&k.length&&u(i,k),f(null,i,{})};Kr({action:"probeMp4StartTime",timescales:i.map.timescales,data:b,transmuxer:i.transmuxer,callback:function(k){var I=k.data,P=k.startTime;r=I.buffer,i.bytes=b=I,E.hasAudio&&!E.isMuxed&&n(i,"audio","start",P),E.hasVideo&&n(i,"video","start",P),y.video&&I.byteLength&&i.transmuxer?Kr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:b,timescales:i.map.timescales,trackIds:[y.video.id],callback:function(N){r=N.data.buffer,i.bytes=b=N.data,N.logs.forEach(function(A){_(O.mergeOptions(A,{stream:"mp4CaptionParser"}))}),w(N.captions)}}):w()}})}else if(i.transmuxer){if(i.container===void 0&&(i.container=Za(b)),i.container!=="ts"&&i.container!=="aac")return t(i,{hasAudio:!1,hasVideo:!1}),void f(null,i,{});dg({segment:i,bytes:r,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:m,doneFn:f,onTransmuxerLog:_})}else f(null,i,{})},Wd=function(e,i){var r,t=e.id,n=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",function o(u){if(u.data.source===t){s.removeEventListener("message",o);var c=u.data.decrypted;i(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}}),r=n.bytes.slice?n.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.bytes)),s.postMessage(Cd({source:t,encrypted:a,key:r,iv:n.iv}),[a.buffer,r.buffer])},hg=function(e){var i=e.activeXhrs,r=e.decryptionWorker,t=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,m=e.dataFn,f=e.doneFn,_=e.onTransmuxerLog,b=0,y=!1;return function(E,w){if(!y){if(E)return y=!0,go(i),f(E,w);if((b+=1)===i.length){var k=function(){if(w.encryptedBytes)return function(I){var P=I.decryptionWorker,N=I.segment,A=I.trackInfoFn,U=I.timingInfoFn,B=I.videoSegmentTimingInfoFn,R=I.audioSegmentTimingInfoFn,q=I.id3Fn,$=I.captionsFn,Y=I.isEndOfTimeline,K=I.endedTimelineFn,Q=I.dataFn,X=I.doneFn,nt=I.onTransmuxerLog;Wd({id:N.requestId,key:N.key,encryptedBytes:N.encryptedBytes,decryptionWorker:P},function(at){N.bytes=at,Vd({segment:N,bytes:N.bytes,trackInfoFn:A,timingInfoFn:U,videoSegmentTimingInfoFn:B,audioSegmentTimingInfoFn:R,id3Fn:q,captionsFn:$,isEndOfTimeline:Y,endedTimelineFn:K,dataFn:Q,doneFn:X,onTransmuxerLog:nt})})}({decryptionWorker:r,segment:w,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:m,doneFn:f,onTransmuxerLog:_});Vd({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:m,doneFn:f,onTransmuxerLog:_})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return Wd({decryptionWorker:r,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key},function(I){w.map.bytes=I,Hd(w,function(P){if(P)return go(i),f(P,w);k()})});k()}}}},pg=function(e){var i=e.segment,r=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(t){if(!t.target.aborted)return i.stats=O.mergeOptions(i.stats,function(n){var a=n.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-a.requestTime||0};return s.bytesReceived=n.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s}(t)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),r(t,i)}},fg=function(e){var i=e.xhr,r=e.xhrOptions,t=e.decryptionWorker,n=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,c=e.videoSegmentTimingInfoFn,d=e.audioSegmentTimingInfoFn,m=e.id3Fn,f=e.captionsFn,_=e.isEndOfTimeline,b=e.endedTimelineFn,y=e.dataFn,E=e.doneFn,w=e.onTransmuxerLog,k=[],I=hg({activeXhrs:k,decryptionWorker:t,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:f,isEndOfTimeline:_,endedTimelineFn:b,dataFn:y,doneFn:E,onTransmuxerLog:w});if(n.key&&!n.key.bytes){var P=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&P.push(n.map.key);var N=i(O.mergeOptions(r,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),qd(n,P,I));k.push(N)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){var A=i(O.mergeOptions(r,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),qd(n,[n.map.key],I));k.push(A)}var U=O.mergeOptions(r,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:ho(n.map)}),B=function(K){var Q=K.segment,X=K.finishProcessingFn;return function(nt,at){var ht=vo(nt,at);if(ht)return X(ht,Q);var J=new Uint8Array(at.response);if(Q.map.key)return Q.map.encryptedBytes=J,X(null,Q);Q.map.bytes=J,Hd(Q,function(rt){if(rt)return rt.xhr=at,rt.status=at.status,X(rt,Q);X(null,Q)})}}({segment:n,finishProcessingFn:I}),R=i(U,B);k.push(R)}var q=O.mergeOptions(r,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:ho(n)}),$=i(q,cg({segment:n,finishProcessingFn:I,responseType:q.responseType}));$.addEventListener("progress",pg({segment:n,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:f,isEndOfTimeline:_,endedTimelineFn:b,dataFn:y})),k.push($);var Y={};return k.forEach(function(K){K.addEventListener("loadend",function(Q){var X=Q.loadendState,nt=Q.abortFn;return function(at){at.target.aborted&&nt&&!X.calledAbortFn&&(nt(),X.calledAbortFn=!0)}}({loadendState:Y,abortFn:a}))}),function(){return go(k)}},mg=ye("CodecUtils"),Gd=function(e,i){var r=i.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&r.AUDIO&&e.mediaGroups.AUDIO[r.AUDIO]},Qr=function(e){var i={};return e.forEach(function(r){var t=r.mediaType,n=r.type,a=r.details;i[t]=i[t]||[],i[t].push(mu(""+n+a))}),Object.keys(i).forEach(function(r){if(i[r].length>1)return mg("multiple "+r+" codecs found as attributes: "+i[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(i[r]=null);i[r]=i[r][0]}),i},zd=function(e){var i=0;return e.audio&&i++,e.video&&i++,i},Mi=function(e,i){var r=i.attributes||{},t=Qr(function(a){var s=a.attributes||{};if(s.CODECS)return be(s.CODECS)}(i)||[]);if(Gd(e,i)&&!t.audio&&!function(a,s){if(!Gd(a,s))return!0;var o=s.attributes||{},u=a.mediaGroups.AUDIO[o.AUDIO];for(var c in u)if(!u[c].uri&&!u[c].playlists)return!0;return!1}(e,i)){var n=Qr(function(a,s){if(!a.mediaGroups.AUDIO||!s)return null;var o=a.mediaGroups.AUDIO[s];if(!o)return null;for(var u in o){var c=o[u];if(c.default&&c.playlists)return be(c.playlists[0].attributes.CODECS)}return null}(e,r.AUDIO)||[]);n.audio&&(t.audio=n.audio)}return t},$r=ye("PlaylistSelector"),Xd=function(e){if(e&&e.playlist){var i=e.playlist;return JSON.stringify({id:i.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:i.attributes&&i.attributes.CODECS||""})}},Jr=function(e,i){if(!e)return"";var r=D.getComputedStyle(e);return r?r[i]:""},Jn=function(e,i){var r=e.slice();e.sort(function(t,n){var a=i(t,n);return a===0?r.indexOf(t)-r.indexOf(n):a})},yo=function(e,i){var r,t;return e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||D.Number.MAX_VALUE,i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),r-(t=t||D.Number.MAX_VALUE)},Kd=function(e,i,r,t,n,a){if(e){var s={bandwidth:i,width:r,height:t,limitRenditionByPlayerDimensions:n},o=e.playlists;ee.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(R){var q=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,$=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return{bandwidth:R.attributes&&R.attributes.BANDWIDTH||D.Number.MAX_VALUE,width:q,height:$,playlist:R}});Jn(u,function(R,q){return R.bandwidth-q.bandwidth});var c=(u=u.filter(function(R){return!ee.isIncompatible(R.playlist)})).filter(function(R){return ee.isEnabled(R.playlist)});c.length||(c=u.filter(function(R){return!ee.isDisabled(R.playlist)}));var d=c.filter(function(R){return R.bandwidth*Ot.BANDWIDTH_VARIANCEr||R.height>t})).filter(function(R){return R.width===w[0].width&&R.height===w[0].height}),m=k[k.length-1],I=k.filter(function(R){return R.bandwidth===m.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var A=y.map(function(R){return R.pixelDiff=Math.abs(R.width-r)+Math.abs(R.height-t),R});Jn(A,function(R,q){return R.pixelDiff===q.pixelDiff?q.bandwidth-R.bandwidth:R.pixelDiff-q.pixelDiff}),P=A[0]}var U=P||I||N||f||c[0]||u[0];if(U&&U.playlist){var B="sortedPlaylistReps";return P?B="leastPixelDiffRep":I?B="resolutionPlusOneRep":N?B="resolutionBestRep":f?B="bandwidthBestRep":c[0]&&(B="enabledPlaylistReps"),$r("choosing "+Xd(U)+" using "+B+" with options",s),U.playlist}return $r("could not choose a playlist with options",s),null}},Yd=function(){var e=this.useDevicePixelRatio&&D.devicePixelRatio||1;return Kd(this.playlists.master,this.systemBandwidth,parseInt(Jr(this.tech_.el(),"width"),10)*e,parseInt(Jr(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},gg=function(e){var i=e.inbandTextTracks,r=e.metadataArray,t=e.timestampOffset,n=e.videoDuration;if(r){var a=D.WebKitDataCue||D.VTTCue,s=i.metadataTrack_;if(s&&(r.forEach(function(f){var _=f.cueTime+t;!(typeof _!="number"||D.isNaN(_)||_<0)&&_<1/0&&f.frames.forEach(function(b){var y=new a(_,_,b.value||b.url||b.data||"");y.frame=b,y.value=b,function(E){Object.defineProperties(E.frame,{id:{get:function(){return O.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),E.value.key}},value:{get:function(){return O.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),E.value.data}},privateData:{get:function(){return O.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),E.value.data}}})}(y),s.addCue(y)})}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],c=0;c=e&&n.endTime<=i&&r.removeCue(n)},Qd=function(e){return typeof e=="number"&&isFinite(e)},Zr=1/60,Zn=function(e){var i=e.startOfSegment,r=e.duration,t=e.segment,n=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,c=u===void 0?[]:u,d=e.mediaIndex,m=e.partIndex,f=e.timeline,_=c.length-1,b="mediaIndex/partIndex increment";e.getMediaInfoForTime?b="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(b="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(b+=" with independent "+e.independent);var y=typeof m=="number",E=e.segment.uri?"segment":"pre-segment",w=y?dd({preloadSegment:t})-1:0;return E+" ["+(s+d)+"/"+(s+_)+"]"+(y?" part ["+m+"/"+w+"]":"")+" segment start/end ["+t.start+" => "+t.end+"]"+(y?" part start/end ["+n.start+" => "+n.end+"]":"")+" startOfSegment ["+i+"] duration ["+r+"] timeline ["+f+"] selected by ["+b+"] playlist ["+o+"]"},$d=function(e){return e+"TimingInfo"},Jd=function(e){var i=e.timelineChangeController,r=e.currentTimeline,t=e.segmentTimeline,n=e.loaderType,a=e.audioDisabled;if(r===t)return!1;if(n==="audio"){var s=i.lastTimelineChange({type:"main"});return!s||s.to!==t}if(n==="main"&&a){var o=i.pendingTimelineChange({type:"audio"});return!o||o.to!==t}return!1},Zd=function(e){var i=e.segmentDuration,r=e.maxDuration;return!!i&&Math.round(i)>r+pn},vg=function(e,i){if(i!=="hls")return null;var r,t,n=(r={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},t=0,["video","audio"].forEach(function(c){var d=r[c+"TimingInfo"];if(d){var m,f=d.start,_=d.end;typeof f=="bigint"||typeof _=="bigint"?m=D.BigInt(_)-D.BigInt(f):typeof f=="number"&&typeof _=="number"&&(m=_-f),m!==void 0&&m>t&&(t=m)}}),typeof t=="bigint"&&t=11,a.appendInitSegment_={audio:!0,video:!0},a.playlistOfLastInitSegment_={audio:null,video:null},a.callQueue_=[],a.loadQueue_=[],a.metadataQueue_={id3:[],caption:[]},a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=null,a.activeInitSegmentId_=null,a.initSegments_={},a.cacheEncryptionKeys_=t.cacheEncryptionKeys,a.keyCache_={},a.decrypter_=t.decrypter,a.syncController_=t.syncController,a.syncPoint_={segmentIndex:0,time:0},a.transmuxer_=a.createTransmuxer_(),a.triggerSyncInfoUpdate_=function(){return a.trigger("syncinfoupdate")},a.syncController_.on("syncinfoupdate",a.triggerSyncInfoUpdate_),a.mediaSource_.addEventListener("sourceopen",function(){a.isEndOfStream_()||(a.ended_=!1)}),a.fetchAtBuffer_=!1,a.logger_=ye("SegmentLoader["+a.loaderType_+"]"),Object.defineProperty(tt(a),"state",{get:function(){return this.state_},set:function(s){s!==this.state_&&(this.logger_(this.state_+" -> "+s),this.state_=s,this.trigger("statechange"))}}),a.sourceUpdater_.on("ready",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="main"&&a.timelineChangeController_.on("pendingtimelinechange",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="audio"&&a.timelineChangeController_.on("timelinechange",function(){a.hasEnoughInfoToLoad_()&&a.processLoadQueue_(),a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a}V(i,e);var r=i.prototype;return r.createTransmuxer_=function(){return lg({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(t){this.audioDisabled_=!t,t?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},r.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,D.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(t){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==t:(this.state="READY",!0)},r.error=function(t){return t!==void 0&&(this.logger_("error occurred:",t),this.error_=t),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&jd(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var t=this.getMediaInfo_();if(!this.sourceUpdater_||!t)return O.createTimeRanges();if(this.loaderType_==="main"){var n=t.hasAudio,a=t.hasVideo,s=t.isMuxed;if(a&&n&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(t,n){if(n===void 0&&(n=!1),!t)return null;var a=Xr(t),s=this.initSegments_[a];return n&&!s&&t.bytes&&(this.initSegments_[a]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}),s||t},r.segmentKey=function(t,n){if(n===void 0&&(n=!1),!t)return null;var a=xd(t),s=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!s&&t.bytes&&(this.keyCache_[a]=s={resolvedUri:t.resolvedUri,bytes:t.bytes});var o={resolvedUri:(s||t).resolvedUri};return s&&(o.bytes=s.bytes),o},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),this.playlist_)return this.state==="INIT"&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY"))},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(t,n){if(n===void 0&&(n={}),t){var a=this.playlist_,s=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=n,this.state==="INIT"&&(t.syncInfo={mediaSequence:t.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(t));var o=null;if(a&&(a.id?o=a.id:a.uri&&(o=a.uri)),this.logger_("playlist update ["+o+" => "+(t.id||t.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==t.uri)return this.mediaIndex!==null&&(t.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var u=t.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+u+"]"),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var d=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=d}}s&&(s.mediaIndex-=u,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=t.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,t)}},r.pause=function(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(t){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,t),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&jd(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(t,n,a,s){if(a===void 0&&(a=function(){}),s===void 0&&(s=!1),n===1/0&&(n=this.duration_()),n<=t)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var o=1,u=function(){--o===0&&a()};for(var c in!s&&this.audioDisabled_||(o++,this.sourceUpdater_.removeAudio(t,n,u)),(s||this.loaderType_==="main")&&(this.gopBuffer_=function(d,m,f,_){for(var b=Math.ceil((m-_)*fr),y=Math.ceil((f-_)*fr),E=d.slice(),w=d.length;w--&&!(d[w].pts<=y););if(w===-1)return E;for(var k=w+1;k--&&!(d[k].pts<=b););return k=Math.max(k,0),E.splice(k,w-k+1),E}(this.gopBuffer_,t,n,this.timeMapping_),o++,this.sourceUpdater_.removeVideo(t,n,u)),this.inbandTextTracks_)Ui(t,n,this.inbandTextTracks_[c]);Ui(t,n,this.segmentMetadataTrack_),u()}else this.logger_("skipping remove because no source updater or starting media info")},r.monitorBuffer_=function(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),500)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var t=this.chooseNextRequest_();t&&(typeof t.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline})),this.loadSegment_(t))}},r.isEndOfStream_=function(t,n,a){if(t===void 0&&(t=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var s=typeof t=="number"&&n.segments[t],o=t+1===n.segments.length,u=!s||!s.parts||a+1===s.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&o&&u},r.chooseNextRequest_=function(){var t=this.buffered_(),n=ud(t)||0,a=eo(t,this.currentTime_()),s=!this.hasPlayed_()&&a>=1,o=a>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||s||o)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=function(N,A,U){A=A||[];for(var B=[],R=0,q=0;qU))return q}return B.length===0?0:B[B.length-1]}(this.currentTimeline_,u,n);else if(this.mediaIndex!==null){var d=u[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=d.end?d.end:n,d.parts&&d.parts[m+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=m+1):c.mediaIndex=this.mediaIndex+1}else{var f=ee.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),_=f.segmentIndex,b=f.startTime,y=f.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),c.mediaIndex=_,c.startOfSegment=b,c.partIndex=y}var E=u[c.mediaIndex],w=E&&typeof c.partIndex=="number"&&E.parts&&E.parts[c.partIndex];if(!E||typeof c.partIndex=="number"&&!w)return null;if(typeof c.partIndex!="number"&&E.parts&&(c.partIndex=0,w=E.parts[0]),!a&&w&&!w.independent)if(c.partIndex===0){var k=u[c.mediaIndex-1],I=k.parts&&k.parts.length&&k.parts[k.parts.length-1];I&&I.independent&&(c.mediaIndex-=1,c.partIndex=k.parts.length-1,c.independent="previous segment")}else E.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var P=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&P&&!this.seeking_()?null:this.generateSegmentInfo_(c)},r.generateSegmentInfo_=function(t){var n=t.independent,a=t.playlist,s=t.mediaIndex,o=t.startOfSegment,u=t.isSyncRequest,c=t.partIndex,d=t.forceTimestampOffset,m=t.getMediaInfoForTime,f=a.segments[s],_=typeof c=="number"&&f.parts[c],b={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||f.resolvedUri,mediaIndex:s,partIndex:_?c:null,isSyncRequest:u,startOfSegment:o,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:f.timeline,duration:_&&_.duration||f.duration,segment:f,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:n},y=d!==void 0?d:this.isPendingTimestampOffset_;b.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:f.timeline,currentTimeline:this.currentTimeline_,startOfSegment:o,buffered:this.buffered_(),overrideCheck:y});var E=ud(this.sourceUpdater_.audioBuffered());return typeof E=="number"&&(b.audioAppendStart=E-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(b.gopsToAlignWith=function(w,k,I){if(k==null||!w.length)return[];var P,N=Math.ceil((k-I+3)*fr);for(P=0;PN);P++);return w.slice(P)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),b},r.timestampOffsetForSegment_=function(t){return a=(n=t).segmentTimeline,s=n.currentTimeline,o=n.startOfSegment,u=n.buffered,n.overrideCheck||a!==s?a "+m+" for "+u),function(b,y,E){if(!b[E]){y.trigger({type:"usage",name:"vhs-608"}),y.trigger({type:"usage",name:"hls-608"});var w=E;/^cc708_/.test(E)&&(w="SERVICE"+E.split("_")[1]);var k=y.textTracks().getTrackById(w);if(k)b[E]=k;else{var I=E,P=E,N=!1,A=(y.options_.vhs&&y.options_.vhs.captionServices||{})[w];A&&(I=A.label,P=A.language,N=A.default),b[E]=y.addRemoteTextTrack({kind:"captions",id:w,default:N,label:I,language:P},!1).track}}}(_,a.vhs_.tech_,u),Ui(d,m,_[u]),function(b){var y=b.inbandTextTracks,E=b.captionArray,w=b.timestampOffset;if(E){var k=D.WebKitDataCue||D.VTTCue;E.forEach(function(I){var P=I.stream;y[P].addCue(new k(I.startTime+w,I.endTime+w,I.text))})}}({captionArray:f,inbandTextTracks:_,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,t,n));else this.logger_("SegmentLoader received no captions from a caption event")},r.handleId3_=function(t,n,a){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(this.pendingSegment_.hasAppendedData_){var s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();(function(o,u,c){o.metadataTrack_||(o.metadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,o.metadataTrack_.inBandMetadataTrackDispatchType=u)})(this.inbandTextTracks_,a,this.vhs_.tech_),gg({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:s,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,n,a))},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(t){return t()}),this.metadataQueue_.caption.forEach(function(t){return t()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var t=this.callQueue_;this.callQueue_=[],t.forEach(function(n){return n()})},r.processLoadQueue_=function(){var t=this.loadQueue_;this.loadQueue_=[],t.forEach(function(n){return n()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var t=this.pendingSegment_;return!!t&&(!this.getCurrentMediaInfo_()||!Jd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.getCurrentMediaInfo_=function(t){return t===void 0&&(t=this.pendingSegment_),t&&t.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(t){return t===void 0&&(t=this.pendingSegment_),this.getCurrentMediaInfo_(t)||this.startingMediaInfo_},r.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var t=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!t||!n)return!1;var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed;return!(s&&!t.videoTimingInfo)&&!(a&&!this.audioDisabled_&&!o&&!t.audioTimingInfo)&&!Jd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})},r.handleData_=function(t,n){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(t.map&&(t.map=this.initSegmentForMap(t.map,!0),a.segment.map=t.map),t.key&&this.segmentKey(t.key,!0),a.isFmp4=t.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[$d(n.type)].start;else{var s,o=this.getCurrentMediaInfo_(),u=this.loaderType_==="main"&&o&&o.hasVideo;u&&(s=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:u,firstVideoFrameTimeForData:s,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}else this.callQueue_.push(this.handleData_.bind(this,t,n))},r.updateAppendInitSegmentStatus=function(t,n){this.loaderType_!=="main"||typeof t.timestampOffset!="number"||t.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==t.playlist&&(this.appendInitSegment_[n]=!0)},r.getInitSegmentAndUpdateState_=function(t){var n=t.type,a=t.initSegment,s=t.map,o=t.playlist;if(s){var u=Xr(s);if(this.activeInitSegmentId_===u)return null;a=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=u}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=o,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},r.handleQuotaExceededError_=function(t,n){var a=this,s=t.segmentInfo,o=t.type,u=t.bytes,c=this.sourceUpdater_.audioBuffered(),d=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+fn(c).join(", ")),d.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+fn(d).join(", "));var m=c.length?c.start(0):0,f=c.length?c.end(c.length-1):0,_=d.length?d.start(0):0,b=d.length?d.end(d.length-1):0;if(f-m<=1&&b-_<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+u.byteLength+", audio buffer: "+fn(c).join(", ")+", video buffer: "+fn(d).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:s,type:o,bytes:u}));var y=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+y),this.remove(0,y,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=D.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3)},!0)},r.handleAppendError_=function(t,n){var a=t.segmentInfo,s=t.type,o=t.bytes;n&&(n.code!==22?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(s+" append of "+o.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:a,type:s,bytes:o}))},r.appendToSourceBuffer_=function(t){var n,a,s,o=t.segmentInfo,u=t.type,c=t.initSegment,d=t.data,m=t.bytes;if(!m){var f=[d],_=d.byteLength;c&&(f.unshift(c),_+=c.byteLength),s=0,(n={bytes:_,segments:f}).bytes&&(a=new Uint8Array(n.bytes),n.segments.forEach(function(b){a.set(b,s),s+=b.byteLength})),m=a}this.sourceUpdater_.appendBuffer({segmentInfo:o,type:u,bytes:m},this.handleAppendError_.bind(this,{segmentInfo:o,type:u,bytes:m}))},r.handleSegmentTimingInfo_=function(t,n,a){if(this.pendingSegment_&&n===this.pendingSegment_.requestId){var s=this.pendingSegment_.segment,o=t+"TimingInfo";s[o]||(s[o]={}),s[o].transmuxerPrependedSeconds=a.prependedContentDuration||0,s[o].transmuxedPresentationStart=a.start.presentation,s[o].transmuxedDecodeStart=a.start.decode,s[o].transmuxedPresentationEnd=a.end.presentation,s[o].transmuxedDecodeEnd=a.end.decode,s[o].baseMediaDecodeTime=a.baseMediaDecodeTime}},r.appendData_=function(t,n){var a=n.type,s=n.data;if(s&&s.byteLength&&(a!=="audio"||!this.audioDisabled_)){var o=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:t.playlist,map:t.isFmp4?t.segment.map:null});this.appendToSourceBuffer_({segmentInfo:t,type:a,initSegment:o,data:s})}},r.loadSegment_=function(t){var n=this;this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),typeof t.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(t):this.loadQueue_.push(function(){var a=he({},t,{forceTimestampOffset:!0});he(t,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(t)})},r.updateTransmuxerAndRequestSegment_=function(t){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(t.timestampOffset)&&(this.gopBuffer_.length=0,t.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t.timestampOffset}));var a=this.createSimplifiedSegmentObj_(t),s=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex),o=this.mediaIndex!==null,u=t.timeline!==this.currentTimeline_&&t.timeline>0,c=s||o&&u;this.logger_("Requesting "+Zn(t)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),t.abortRequests=fg({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,t),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",t.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",t.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(d){var m=d.message,f=d.level,_=d.stream;n.logger_(Zn(t)+" logged from transmuxer stream "+_+" as a "+f+": "+m)}})},r.trimBackBuffer_=function(t){var n=function(a,s,o){var u=s-Ot.BACK_BUFFER_LENGTH;a.length&&(u=Math.max(u,a.start(0)));var c=s-o;return Math.min(c,u)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},r.createSimplifiedSegmentObj_=function(t){var n=t.segment,a=t.part,s={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:t.requestId,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,part:t.part},o=t.playlist.segments[t.mediaIndex-1];if(o&&o.timeline===n.timeline&&(o.videoTimingInfo?s.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(s.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),n.key){var u=n.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);s.key=this.segmentKey(n.key),s.key.iv=u}return n.map&&(s.map=this.initSegmentForMap(n.map)),s},r.saveTransferStats_=function(t){this.mediaRequests+=1,t&&(this.mediaBytesTransferred+=t.bytesReceived,this.mediaTransferDuration+=t.roundTripTime)},r.saveBandwidthRelatedStats_=function(t,n){this.pendingSegment_.byteLength=n.bytesReceived,t=d);m++);return o.slice(0,m).concat(u)}(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}},r.setTimeMapping_=function(t){var n=this.syncController_.mappingForTimeline(t);n!==null&&(this.timeMapping_=n)},r.updateMediaSecondsLoaded_=function(t){typeof t.start=="number"&&typeof t.end=="number"?this.mediaSecondsLoaded+=t.end-t.start:this.mediaSecondsLoaded+=t.duration},r.shouldUpdateTransmuxerTimestampOffset_=function(t){return t!==null&&(this.loaderType_==="main"&&t!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset())},r.trueSegmentStart_=function(t){var n=t.currentStart,a=t.playlist,s=t.mediaIndex,o=t.firstVideoFrameTimeForData,u=t.currentVideoTimestampOffset,c=t.useVideoTimingInfo,d=t.videoTimingInfo,m=t.audioTimingInfo;if(n!==void 0)return n;if(!c)return m.start;var f=a.segments[s-1];return s!==0&&f&&f.start!==void 0&&f.end===o+u?d.start:o},r.waitForAppendsToComplete_=function(t){var n=this.getCurrentMediaInfo_(t);if(!n)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed,u=this.loaderType_==="main"&&s,c=!this.audioDisabled_&&a&&!o;if(t.waitingOnAppends=0,!t.hasAppendedData_)return t.timingInfo||typeof t.timestampOffset!="number"||(this.isPendingTimestampOffset_=!0),t.timingInfo={start:0},t.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(t),this.processMetadataQueue_()),void this.checkAppendsDone_(t);u&&t.waitingOnAppends++,c&&t.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))},r.checkAppendsDone_=function(t){this.checkForAbort_(t.requestId)||(t.waitingOnAppends--,t.waitingOnAppends===0&&this.handleAppendsDone_())},r.checkForIllegalMediaSwitch=function(t){var n=function(a,s,o){return a==="main"&&s&&o?o.hasAudio||o.hasVideo?s.hasVideo&&!o.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!s.hasVideo&&o.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),t);return!!n&&(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0)},r.updateSourceBufferTimestampOffset_=function(t){if(t.timestampOffset!==null&&typeof t.timingInfo.start=="number"&&!t.changedTimestampOffset&&this.loaderType_==="main"){var n=!1;t.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t.segment.videoTimingInfo,audioTimingInfo:t.segment.audioTimingInfo,timingInfo:t.timingInfo}),t.changedTimestampOffset=!0,t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(t.timestampOffset),n=!0),t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(t.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},r.getSegmentStartTimeForTimestampOffsetCalculation_=function(t){var n=t.videoTimingInfo,a=t.audioTimingInfo,s=t.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:s.start:s.start},r.updateTimingInfoEnd_=function(t){t.timingInfo=t.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;a&&(t.timingInfo.end=typeof a.end=="number"?a.end:a.start+t.duration)},r.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_;this.updateTimingInfoEnd_(t),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=vg(t,this.sourceType_);if(n&&(n.severity==="warn"?O.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(t),this.pendingSegment_=null,this.state="READY",!t.isSyncRequest||(this.trigger("syncinfoupdate"),t.hasAppendedData_)){this.logger_("Appended "+Zn(t)),this.addSegmentMetadataCue_(t),this.fetchAtBuffer_=!0,this.currentTimeline_!==t.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline}),this.loaderType_!=="main"||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})),this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate");var a=t.segment,s=t.part,o=a.end&&this.currentTime_()-a.end>3*t.playlist.targetDuration,u=s&&s.end&&this.currentTime_()-s.end>3*t.playlist.partTargetDuration;if(o||u)return this.logger_("bad "+(o?"segment":"part")+" "+Zn(t)),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=t.mediaIndex,this.partIndex=t.partIndex,this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)&&this.endOfStream(),this.trigger("appended"),t.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Zn(t))},r.recordThroughput_=function(t){if(t.duration=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t},r.stopForError=function(t){this.error(t),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(t,n,a){var s=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(n.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(t)return t.code===fo&&this.handleTimeout_(),t.code===mo?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(t);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var u=o.segment;if(u.map&&(u.map.bytes=n.map.bytes),o.bytes=n.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(function(){return s.segmentRequestFinished_(t,n,a)},function(){return s.stopForError({message:"Error loading vtt.js"})});u.requested=!0;try{this.parseVTTCues_(o)}catch(c){return void this.stopForError({message:c.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,o.cues.forEach(function(c){s.subtitlesTrack_.addCue(s.featuresNativeTextTracks_?new D.VTTCue(c.startTime,c.endTime,c.text):c)}),function(c){var d=c.cues;if(d)for(var m=0;m1&&f.push(d[b]);f.length&&f.forEach(function(y){return c.removeCue(y)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(t){var n,a=!1;if(typeof D.WebVTT!="function")throw new Cg;typeof D.TextDecoder=="function"?n=new D.TextDecoder("utf8"):(n=D.WebVTT.StringDecoder(),a=!0);var s=new D.WebVTT.Parser(D,D.vttjs,n);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=t.cues.push.bind(t.cues),s.ontimestampmap=function(c){t.timestampmap=c},s.onparsingerror=function(c){O.log.warn("Error encountered when parsing cues: "+c.message)},t.segment.map){var o=t.segment.map.bytes;a&&(o=oh(o)),s.parse(o)}var u=t.bytes;a&&(u=oh(u)),s.parse(u),s.flush()},r.updateTimeMapping_=function(t,n,a){var s=t.segment;if(n)if(t.cues.length){var o=t.timestampmap,u=o.MPEGTS/fr-o.LOCAL+n.mapping;if(t.cues.forEach(function(m){m.startTime+=u,m.endTime+=u}),!a.syncInfo){var c=t.cues[0].startTime,d=t.cues[t.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+t.mediaIndex,time:Math.min(c,d-s.duration)}}}else s.empty=!0},i}(_o),Dg=function(e,i){for(var r=e.cues,t=0;t=n.adStartTime&&i<=n.adEndTime)return n}return null},lh=[{name:"VOD",run:function(e,i,r,t,n){return r!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(e,i,r,t,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=io(i);n=n||0;for(var u=0;u=f)&&(s=f,a={time:m,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,i,r,t,n){var a=null;if(n=n||0,i.discontinuityStarts&&i.discontinuityStarts.length)for(var s=null,o=0;o=m)&&(s=m,a={time:d.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,i,r,t,n){return i.syncInfo?{time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence,partIndex:null}:null}}],Ig=function(e){function i(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=ye("SyncController"),n}V(i,e);var r=i.prototype;return r.getSyncPoint=function(t,n,a,s){var o=this.runStrategies_(t,n,a,s);return o.length?this.selectSyncPoint_(o,{key:"time",value:s}):null},r.getExpiredTime=function(t,n){if(!t||!t.segments)return null;var a=this.runStrategies_(t,n,t.discontinuitySequence,0);if(!a.length)return null;var s=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+Ri({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:s.segmentIndex,endIndex:0}))},r.runStrategies_=function(t,n,a,s){for(var o=[],u=0;u86400)O.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var s=a-1;s>=0;s--){var o=t.segments[s];if(o&&o.start!==void 0){n.syncInfo={mediaSequence:t.mediaSequence+s,time:o.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+", mediaSequence: "+n.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){var n=t.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},r.saveSegmentTimingInfo=function(t){var n=t.segmentInfo,a=t.shouldSaveTimelineMapping,s=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),o=n.segment;s&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:o.start}));var u=o.dateTimeObject;o.discontinuity&&a&&u&&(this.timelineToDatetimeMappings[o.timeline]=-u.getTime()/1e3)},r.timestampOffsetForTimeline=function(t){return this.timelines[t]===void 0?null:this.timelines[t].time},r.mappingForTimeline=function(t){return this.timelines[t]===void 0?null:this.timelines[t].mapping},r.calculateSegmentTimeMapping_=function(t,n,a){var s,o,u=t.segment,c=t.part,d=this.timelines[t.timeline];if(typeof t.timestampOffset=="number")d={time:t.startOfSegment,mapping:t.startOfSegment-n.start},a&&(this.timelines[t.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+t.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),s=t.startOfSegment,o=n.end+d.mapping;else{if(!d)return!1;s=n.start+d.mapping,o=n.end+d.mapping}return c&&(c.start=s,c.end=o),(!u.start||sd){var m=void 0;m=c<0?a.start-Ri({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:t.mediaIndex,endIndex:o}):a.end+Ri({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:t.mediaIndex+1,endIndex:o}),this.discontinuities[u]={time:m,accuracy:d}}}},r.dispose=function(){this.trigger("dispose"),this.off()},i}(O.EventTarget),Ag=function(e){function i(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}V(i,e);var r=i.prototype;return r.clearPendingTimelineChange=function(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(t){var n=t.type,a=t.from,s=t.to;return typeof a=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},r.lastTimelineChange=function(t){var n=t.type,a=t.from,s=t.to;return typeof a=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:s},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},i}(O.EventTarget),Pg=Nd(Md(function(){var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i(b,y,E){return b(E={path:y,exports:{},require:function(w,k){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(k==null&&E.path)}},E.exports),E.exports}var r=i(function(b){function y(E,w){for(var k=0;k-1},y.trigger=function(E){var w=this.listeners[E];if(w)if(arguments.length===2)for(var k=w.length,I=0;I>7))^R]=R;for(q=$=0;!rt[q];q^=Y||1,$=Kt[$]||1)for(Q=(Q=$^$<<1^$<<2^$<<3^$<<4)>>8^255&Q^99,rt[q]=Q,se[Q]=q,nt=16843009*le[K=le[Y=le[q]]]^65537*K^257*Y^16843008*q,X=257*le[Q]^16843008*Q,R=0;R<4;R++)ht[R][q]=X=X<<24^X>>>8,J[R][Q]=nt=nt<<24^nt>>>8;for(R=0;R<5;R++)ht[R]=ht[R].slice(0),J[R]=J[R].slice(0);return at}()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var I=this._tables[0][4],P=this._tables[1],N=y.length,A=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");var U=y.slice(0),B=[];for(this._key=[U,B],E=N;E<4*N+28;E++)k=U[E-1],(E%N==0||N===8&&E%N==4)&&(k=I[k>>>24]<<24^I[k>>16&255]<<16^I[k>>8&255]<<8^I[255&k],E%N==0&&(k=k<<8^k>>>24^A<<24,A=A<<1^283*(A>>7))),U[E]=U[E-N]^k;for(w=0;E;w++,E--)k=U[3&w?E:E-4],B[w]=E<=4||w<4?k:P[0][I[k>>>24]]^P[1][I[k>>16&255]]^P[2][I[k>>8&255]]^P[3][I[255&k]]}return b.prototype.decrypt=function(y,E,w,k,I,P){var N,A,U,B,R=this._key[1],q=y^R[0],$=k^R[1],Y=w^R[2],K=E^R[3],Q=R.length/4-2,X=4,nt=this._tables[1],at=nt[0],ht=nt[1],J=nt[2],rt=nt[3],se=nt[4];for(B=0;B>>24]^ht[$>>16&255]^J[Y>>8&255]^rt[255&K]^R[X],A=at[$>>>24]^ht[Y>>16&255]^J[K>>8&255]^rt[255&q]^R[X+1],U=at[Y>>>24]^ht[K>>16&255]^J[q>>8&255]^rt[255&$]^R[X+2],K=at[K>>>24]^ht[q>>16&255]^J[$>>8&255]^rt[255&Y]^R[X+3],X+=4,q=N,$=A,Y=U;for(B=0;B<4;B++)I[(3&-B)+P]=se[q>>>24]<<24^se[$>>16&255]<<16^se[Y>>8&255]<<8^se[255&K]^R[X++],N=q,q=$,$=Y,Y=K,K=N},b}(),c=function(b){function y(){var w;return(w=b.call(this,a)||this).jobs=[],w.delay=1,w.timeout_=null,w}n(y,b);var E=y.prototype;return E.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},E.push=function(w){this.jobs.push(w),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},y}(a),d=function(b){return b<<24|(65280&b)<<8|(16711680&b)>>8|b>>>24},m=function(){function b(y,E,w,k){var I=b.STEP,P=new Int32Array(y.buffer),N=new Uint8Array(y.byteLength),A=0;for(this.asyncStream_=new c,this.asyncStream_.push(this.decryptChunk_(P.subarray(A,A+I),E,w,N)),A=I;A>2),at=new u(Array.prototype.slice.call(N)),ht=new Uint8Array(P.byteLength),J=new Int32Array(ht.buffer);for(U=A[0],B=A[1],R=A[2],q=A[3],X=0;X=0&&(i="main-desc"),i},ta=function(e,i){e.abort(),e.pause(),i&&i.activePlaylistLoader&&(i.activePlaylistLoader.pause(),i.activePlaylistLoader=null)},So=function(e,i){i.activePlaylistLoader=e,e.load()},ea={AUDIO:function(e,i){return function(){var r=i.segmentLoaders[e],t=i.mediaTypes[e],n=i.blacklistCurrentPlaylist;ta(r,t);var a=t.activeTrack(),s=t.activeGroup(),o=(s.filter(function(d){return d.default})[0]||s[0]).id,u=t.tracks[o];if(a!==u){for(var c in O.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),t.tracks)t.tracks[c].enabled=t.tracks[c]===u;t.onTrackChanged()}else n({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,i){return function(){var r=i.segmentLoaders[e],t=i.mediaTypes[e];O.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),ta(r,t);var n=t.activeTrack();n&&(n.mode="disabled"),t.onTrackChanged()}}},ch={AUDIO:function(e,i,r){if(i){var t=r.tech,n=r.requestOptions,a=r.segmentLoaders[e];i.on("loadedmetadata",function(){var s=i.media();a.playlist(s,n),(!t.paused()||s.endList&&t.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),t.paused()||a.load()}),i.on("error",ea[e](e,r))}},SUBTITLES:function(e,i,r){var t=r.tech,n=r.requestOptions,a=r.segmentLoaders[e],s=r.mediaTypes[e];i.on("loadedmetadata",function(){var o=i.media();a.playlist(o,n),a.track(s.activeTrack()),(!t.paused()||o.endList&&t.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),t.paused()||a.load()}),i.on("error",ea[e](e,r))}},Rg={AUDIO:function(e,i){var r=i.vhs,t=i.sourceType,n=i.segmentLoaders[e],a=i.requestOptions,s=i.master.mediaGroups,o=i.mediaTypes[e],u=o.groups,c=o.tracks,d=o.logger_,m=i.masterPlaylistLoader,f=Ni(m.master);for(var _ in s[e]&&Object.keys(s[e]).length!==0||(s[e]={main:{default:{default:!0}}},f&&(s[e].main.default.playlists=m.master.playlists)),s[e])for(var b in u[_]||(u[_]=[]),s[e][_]){var y=s[e][_][b],E=void 0;if(f?(d("AUDIO group '"+_+"' label '"+b+"' is a master playlist"),y.isMasterPlaylist=!0,E=null):E=t==="vhs-json"&&y.playlists?new $n(y.playlists[0],r,a):y.resolvedUri?new $n(y.resolvedUri,r,a):y.playlists&&t==="dash"?new po(y.playlists[0],r,a,m):null,y=O.mergeOptions({id:b,playlistLoader:E},y),ch[e](e,y.playlistLoader,i),u[_].push(y),c[b]===void 0){var w=new O.AudioTrack({id:b,kind:Og(y),enabled:!1,language:y.language,default:y.default,label:b});c[b]=w}}n.on("error",ea[e](e,i))},SUBTITLES:function(e,i){var r=i.tech,t=i.vhs,n=i.sourceType,a=i.segmentLoaders[e],s=i.requestOptions,o=i.master.mediaGroups,u=i.mediaTypes[e],c=u.groups,d=u.tracks,m=i.masterPlaylistLoader;for(var f in o[e])for(var _ in c[f]||(c[f]=[]),o[e][f])if(!o[e][f][_].forced){var b=o[e][f][_],y=void 0;if(n==="hls")y=new $n(b.resolvedUri,t,s);else if(n==="dash"){if(!b.playlists.filter(function(w){return w.excludeUntil!==1/0}).length)return;y=new po(b.playlists[0],t,s,m)}else n==="vhs-json"&&(y=new $n(b.playlists?b.playlists[0]:b.resolvedUri,t,s));if(b=O.mergeOptions({id:_,playlistLoader:y},b),ch[e](e,b.playlistLoader,i),c[f].push(b),d[_]===void 0){var E=r.addRemoteTextTrack({id:_,kind:"subtitles",default:b.default&&b.autoselect,language:b.language,label:_},!1).track;d[_]=E}}a.on("error",ea[e](e,i))},"CLOSED-CAPTIONS":function(e,i){var r=i.tech,t=i.master.mediaGroups,n=i.mediaTypes[e],a=n.groups,s=n.tracks;for(var o in t[e])for(var u in a[o]||(a[o]=[]),t[e][o]){var c=t[e][o][u];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var d=r.options_.vhs&&r.options_.vhs.captionServices||{},m={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(d[m.instreamId]&&(m=O.mergeOptions(m,d[m.instreamId])),m.default===void 0&&delete m.default,a[o].push(O.mergeOptions({id:u},c)),s[u]===void 0){var f=r.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;s[u]=f}}}}},Ng=function e(i,r){for(var t=0;t1&&Ni(b.master))for(var N=0;N "+u+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(t,a)},r.startABRTimer_=function(){var t=this;this.stopABRTimer_(),this.abrTimer_=D.setInterval(function(){return t.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var t=this.master(),n=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return n;var a,s=t.mediaGroups.AUDIO,o=Object.keys(s);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{var u=s.main||o.length&&s[o[0]];for(var c in u)if(u[c].default){a={label:c};break}}if(!a)return n;var d=[];for(var m in s)if(s[m][a.label]){var f=s[m][a.label];if(f.playlists&&f.playlists.length)d.push.apply(d,f.playlists);else if(f.uri)d.push(f);else if(t.playlists.length)for(var _=0;_1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(t){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),s=this.bufferLowWaterLine(),o=this.bufferHighWaterLine();return function(u){var c=u.currentPlaylist,d=u.buffered,m=u.currentTime,f=u.nextPlaylist,_=u.bufferLowWaterLine,b=u.bufferHighWaterLine,y=u.duration,E=u.experimentalBufferBasedABR,w=u.log;if(!f)return O.log.warn("We received no playlist to switch to. Please check your stream."),!1;var k="allowing switch "+(c&&c.id||"null")+" -> "+f.id;if(!c)return w(k+" as current playlist is not set"),!0;if(f.id===c.id)return!1;var I=!!Yn(d,m).length;if(!c.endList)return I||typeof c.partTargetDuration!="number"?(w(k+" as current playlist is live"),!0):(w("not "+k+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var P=eo(d,m),N=E?Ot.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ot.MAX_BUFFER_LOW_WATER_LINE;if(yU)&&P>=_){var R=k+" as forwardBuffer >= bufferLowWaterLine ("+P+" >= "+_+")";return E&&(R+=" and next bandwidth > current bandwidth ("+A+" > "+U+")"),w(R),!0}return w("not "+k+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:a,currentPlaylist:n,nextPlaylist:t,bufferLowWaterLine:s,bufferHighWaterLine:o,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var t=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){t.checkABR_("bandwidthupdate"),t.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){t.experimentalBufferBasedABR&&t.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){t.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){t.error=t.mainSegmentLoader_.error_,t.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){t.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){t.error=t.audioSegmentLoader_.error_,t.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){t.logger_("main segment loader ended"),t.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){t.experimentalBufferBasedABR||(t.delegateLoaders_("all",["abort"]),t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var n=function(){if(!t.sourceUpdater_.hasCreatedSourceBuffers())return t.tryToCreateSourceBuffers_();var a=t.getCodecsOrExclude_();a&&t.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){t.logger_("audioSegmentLoader ended"),t.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(t){t===void 0&&(t=this.selectPlaylist()),this.fastQualityChange_(t)},r.fastQualityChange_=function(t){var n=this;t===void 0&&(t=this.selectPlaylist()),t!==this.masterPlaylistLoader_.media()?(this.switchMedia_(t,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){O.browser.IE_VERSION||O.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*n,a.excludeUntil=s,t.reason&&(a.lastExcludeReason_=t.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var m=this.selectPlaylist();if(!m)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var f=t.internal?this.logger_:O.log.warn,_=t.message?" "+t.message:"";f((t.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+_+" Switching to playlist "+m.id+"."),m.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),m.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var b=m.targetDuration/2*1e3||5e3,y=typeof m.lastRequest=="number"&&Date.now()-m.lastRequest<=b;return this.switchMedia_(m,"exclude",c||y)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(t,n){var a=this,s=[],o=t==="all";(o||t==="main")&&s.push(this.masterPlaylistLoader_);var u=[];(o||t==="audio")&&u.push("AUDIO"),(o||t==="subtitle")&&(u.push("CLOSED-CAPTIONS"),u.push("SUBTITLES")),u.forEach(function(c){var d=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;d&&s.push(d)}),["main","audio","subtitle"].forEach(function(c){var d=a[c+"SegmentLoader_"];!d||t!==c&&t!=="all"||s.push(d)}),s.forEach(function(c){return n.forEach(function(d){typeof c[d]=="function"&&c[d]()})})},r.setCurrentTime=function(t){var n=Yn(this.tech_.buffered(),t);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?n&&n.length?t:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var t=this.masterPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:We.Playlist.duration(t):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var t;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var s=this.masterPlaylistLoader_.master,o=We.Playlist.seekable(n,a,We.Playlist.liveEdgeDelay(s,n));if(o.length!==0){if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),(a=this.syncController_.getExpiredTime(n,this.duration()))===null||(t=We.Playlist.seekable(n,a,We.Playlist.liveEdgeDelay(s,n))).length===0))return;var u,c;this.seekable_&&this.seekable_.length&&(u=this.seekable_.end(0),c=this.seekable_.start(0)),t?t.start(0)>o.end(0)||o.start(0)>t.end(0)?this.seekable_=o:this.seekable_=O.createTimeRanges([[t.start(0)>o.start(0)?t.start(0):o.start(0),t.end(0)0&&(s=Math.max(s,a.end(a.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}},r.dispose=function(){var t=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=t.mediaTypes_[n].groups;for(var s in a)a[s].forEach(function(o){o.playlistLoader&&o.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!t||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!n||!a)},r.getCodecsOrExclude_=function(){var t=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var s=Mi(this.master(),a),o={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(o.video=s.video||n.main.videoCodec||"avc1.4d400d"),n.main.isMuxed&&(o.video+=","+(s.audio||n.main.audioCodec||vu)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(o.audio=s.audio||n.main.audioCodec||n.audio.audioCodec||vu,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),o.audio||o.video){var c,d={};if(["video","audio"].forEach(function(b){if(o.hasOwnProperty(b)&&(E=n[b].isFmp4,w=o[b],!(E?Zi(w):Da(w)))){var y=n[b].isFmp4?"browser":"muxer";d[y]=d[y]||[],d[y].push(o[b]),b==="audio"&&(c=y)}var E,w}),u&&c&&a.attributes.AUDIO){var m=a.attributes.AUDIO;this.master().playlists.forEach(function(b){(b.attributes&&b.attributes.AUDIO)===m&&b!==a&&(b.excludeUntil=1/0)}),this.logger_("excluding audio group "+m+" as "+c+' does not support codec(s): "'+o.audio+'"')}if(!Object.keys(d).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var f=[];if(["video","audio"].forEach(function(b){var y=(be(t.sourceUpdater_.codecs[b]||"")[0]||{}).type,E=(be(o[b]||"")[0]||{}).type;y&&E&&y.toLowerCase()!==E.toLowerCase()&&f.push('"'+t.sourceUpdater_.codecs[b]+'" -> "'+o[b]+'"')}),f.length)return void this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+f.join(", ")+".",blacklistDuration:1/0,internal:!0})}return o}var _=Object.keys(d).reduce(function(b,y){return b&&(b+=", "),b+=y+' does not support codec(s): "'+d[y].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:_,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},r.tryToCreateSourceBuffers_=function(){if(this.mediaSource.readyState==="open"&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var t=this.getCodecsOrExclude_();if(t){this.sourceUpdater_.createSourceBuffers(t);var n=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},r.excludeUnsupportedVariants_=function(){var t=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(s){var o=n[s];if(a.indexOf(o.id)===-1){a.push(o.id);var u=Mi(t.master,o),c=[];!u.audio||Da(u.audio)||Zi(u.audio)||c.push("audio codec "+u.audio),!u.video||Da(u.video)||Zi(u.video)||c.push("video codec "+u.video),u.text&&u.text==="stpp.ttml.im1t"&&c.push("text codec "+u.text),c.length&&(o.excludeUntil=1/0,t.logger_("excluding "+o.id+" for unsupported: "+c.join(", ")))}})},r.excludeIncompatibleVariants_=function(t){var n=this,a=[],s=this.master().playlists,o=Qr(be(t)),u=zd(o),c=o.video&&be(o.video)[0]||null,d=o.audio&&be(o.audio)[0]||null;Object.keys(s).forEach(function(m){var f=s[m];if(a.indexOf(f.id)===-1&&f.excludeUntil!==1/0){a.push(f.id);var _=[],b=Mi(n.masterPlaylistLoader_.master,f),y=zd(b);if(b.audio||b.video){if(y!==u&&_.push('codec count "'+y+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var E=b.video&&be(b.video)[0]||null,w=b.audio&&be(b.audio)[0]||null;E&&c&&E.type.toLowerCase()!==c.type.toLowerCase()&&_.push('video codec "'+E.type+'" !== "'+c.type+'"'),w&&d&&w.type.toLowerCase()!==d.type.toLowerCase()&&_.push('audio codec "'+w.type+'" !== "'+d.type+'"')}_.length&&(f.excludeUntil=1/0,n.logger_("blacklisting "+f.id+": "+_.join(" && ")))}}})},r.updateAdCues_=function(t){var n=0,a=this.seekable();a.length&&(n=a.start(0)),function(s,o,u){if(u===void 0&&(u=0),s.segments)for(var c,d=u,m=0;m0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=t.buffered_()},i.checkSegmentDownloads_=function(r){var t=this.masterPlaylistController_,n=t[r+"SegmentLoader_"],a=n.buffered_(),s=function(o,u){if(o===u)return!1;if(!o&&u||!u&&o||o.length!==u.length)return!0;for(var c=0;c=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},i.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},i.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var r,t=this.seekable(),n=this.tech_.currentTime();if(this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(r=t.end(t.length-1)),this.beforeSeekableWindow_(t,n)){var a=t.start(0);r=a+(a===t.end(0)?0:ke)}if(r!==void 0)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+od(t)+". Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0;for(var s=this.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),u=s.audioBuffer?s.audioBuffered():null,c=s.videoBuffer?s.videoBuffered():null,d=this.media(),m=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-pn),f=[u,c],_=0;_ "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},i.techWaiting_=function(){var r=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(r,t)){var n=r.end(r.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var o=Wr(s,t);if(o.length>0){var u=o.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+u+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*u,t),!0}return!1},i.afterSeekableWindow_=function(r,t,n,a){if(a===void 0&&(a=!1),!r.length)return!1;var s=r.end(r.length-1)+ke;return!n.endList&&a&&(s=r.end(r.length-1)+3*n.targetDuration),t>s},i.beforeSeekableWindow_=function(r,t){return!!(r.length&&r.start(0)>0&&t2)return{start:s,end:o}}return null},e}(),Vg={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Wg=function e(i,r){var t=0,n=0,a=O.mergeOptions(Vg,r);i.ready(function(){i.trigger({type:"usage",name:"vhs-error-reload-initialized"}),i.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){n&&i.currentTime(n)},o=function(d){d!=null&&(n=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",s),i.src(d),i.trigger({type:"usage",name:"vhs-error-reload"}),i.trigger({type:"usage",name:"hls-error-reload"}),i.play())},u=function(){return Date.now()-t<1e3*a.errorInterval?(i.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void i.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&typeof a.getSource=="function"?(t=Date.now(),a.getSource.call(i,o)):void O.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},c=function d(){i.off("loadedmetadata",s),i.off("error",u),i.off("dispose",d)};i.on("error",u),i.on("dispose",c),i.reloadSourceOnError=function(d){c(),e(i,d)}},hh="2.16.2",Nt={PlaylistLoader:$n,Playlist:ee,utils:$m,STANDARD_PLAYLIST_SELECTOR:Yd,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,i=this.playlists.master.playlists.filter(ee.isEnabled);return Jn(i,function(r,t){return yo(r,t)}),i.filter(function(r){return!!Mi(e.playlists.master,r).video})[0]||null},lastBandwidthSelector:Yd,movingAverageBandwidthSelector:function(e){var i=-1,r=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var t=this.useDevicePixelRatio&&D.devicePixelRatio||1;return i<0&&(i=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(i=e*this.systemBandwidth+(1-e)*i,r=this.systemBandwidth),Kd(this.playlists.master,i,parseInt(Jr(this.tech_.el(),"width"),10)*t,parseInt(Jr(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:yo,comparePlaylistResolution:function(e,i){var r,t;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||D.Number.MAX_VALUE,i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),r===(t=t||D.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&i.attributes.BANDWIDTH?e.attributes.BANDWIDTH-i.attributes.BANDWIDTH:r-t},xhr:kd()};Object.keys(Ot).forEach(function(e){Object.defineProperty(Nt,e,{get:function(){return O.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Ot[e]},set:function(i){O.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),typeof i!="number"||i<0?O.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Ot[e]=i}})});var ph="videojs-vhs",fh=function(e,i){for(var r=i.media(),t=-1,n=0;n=m&&c>=m?Math.max(c,f):f}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c,d=1/(this.bandwidth||1);return c=this.throughput>0?1/this.throughput:0,Math.floor(1/(d+c))},set:function(){O.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return fn(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return fn(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&function(c){if(!D.localStorage)return!1;var d=mh();d=d?O.mergeOptions(d,c):c;try{D.localStorage.setItem(ph,JSON.stringify(d))}catch{return!1}}({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var c;(c=a).representations=function(){var d=c.masterPlaylistController_.master(),m=Ni(d)?c.masterPlaylistController_.getAudioTrackPlaylists_():d.playlists;return m?m.filter(function(f){return!ro(f)}).map(function(f,_){return new qg(c,f,f.id)}):[]}}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var t=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Gg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){t.logger_("created EME key session"),t.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){t.logger_("error while creating EME key session",a),t.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var t=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=zg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});this.player_.tech_.on("keystatuschange",function(s){if(s.status==="output-restricted"){var o=t.masterPlaylistController_.master();if(o&&o.playlists){var u,c=[];o.playlists.forEach(function(d){d&&d.attributes&&d.attributes.RESOLUTION&&d.attributes.RESOLUTION.height>=720&&(!d.excludeUntil||d.excludeUntil<1/0)&&(d.excludeUntil=1/0,c.push(d))}),c.length&&((u=O.log).warn.apply(u,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(c)),t.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),O.browser.IE_VERSION!==11&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},r.setupQualityLevels_=function(){var t=this,n=O.players[this.tech_.options_.playerId];n&&n.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var a,s;a=t.qualityLevels_,(s=t).representations().forEach(function(o){a.addQualityLevel(o)}),fh(a,s.playlists)}),this.playlists.on("mediachange",function(){fh(t.qualityLevels_,t.playlists)}))},i.version=function(){return{"@videojs/http-streaming":hh,"mux.js":"6.0.1","mpd-parser":"0.22.1","m3u8-parser":"4.8.0","aes-decrypter":"3.1.3"}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return sh.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(t){this.masterPlaylistController_.setCurrentTime(t)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},r.convertToProgramTime=function(t,n){return Jm({playlist:this.masterPlaylistController_.media(),time:t,callback:n})},r.seekToProgramTime=function(t,n,a,s){return a===void 0&&(a=!0),s===void 0&&(s=2),Zm({programTime:t,playlist:this.masterPlaylistController_.media(),retryCount:s,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},i}(O.getComponent("Component")),Bi={name:"videojs-http-streaming",VERSION:hh,canHandleSource:function(e,i){i===void 0&&(i={});var r=O.mergeOptions(O.options,i);return Bi.canPlayType(e.type,r)},handleSource:function(e,i,r){r===void 0&&(r={});var t=O.mergeOptions(O.options,r);return i.vhs=new Eo(e,i,t),O.hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return O.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),i.vhs},configurable:!0}),i.vhs.xhr=kd(),i.vhs.src(e.src,e.type),i.vhs},canPlayType:function(e,i){var r=yu(e);if(!r)return"";var t=Bi.getOverrideNative(i);return!Nt.supportsTypeNatively(r)||t?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var i=e,r=i.vhs,t=r===void 0?{}:r,n=i.hls,a=n===void 0?{}:n,s=!(O.browser.IS_ANY_SAFARI||O.browser.IS_IOS),o=t.overrideNative,u=o===void 0?s:o,c=a.overrideNative;return c!==void 0&&c||u}};Zi("avc1.4d400d,mp4a.40.2")&&O.getTech("Html5").registerSourceHandler(Bi,0),O.VhsHandler=Eo,Object.defineProperty(O,"HlsHandler",{get:function(){return O.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Eo},configurable:!0}),O.VhsSourceHandler=Bi,Object.defineProperty(O,"HlsSourceHandler",{get:function(){return O.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Bi},configurable:!0}),O.Vhs=Nt,Object.defineProperty(O,"Hls",{get:function(){return O.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Nt},configurable:!0}),O.use||(O.registerComponent("Hls",Nt),O.registerComponent("Vhs",Nt)),O.options.vhs=O.options.vhs||{},O.options.hls=O.options.hls||{},O.getPlugin&&O.getPlugin("reloadSourceOnError")||(O.registerPlugin||O.plugin)("reloadSourceOnError",function(e){Wg(this,e)});function wo(e,i){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(t=Object.getOwnPropertySymbols(e);n{const a=fy,s=my;return ip(),ly("div",{onClick:n[1]||(n[1]=o=>{r.value=!0})},[rp("div",null,[ap(a,{icon:"ep:video-play",size:32,class:"mr-5px"}),bh]),ap(s,{modelValue:zo(r),"onUpdate:modelValue":n[0]||(n[0]=o=>py(r)?r.value=o:null),title:"\u89C6\u9891\u64AD\u653E","append-to-body":""},{default:cy(()=>[zo(r)?(ip(),dy(zo(ev),{key:0,class:"video-player vjs-big-play-centered",src:i.url,poster:"",crossorigin:"anonymous",controls:"",playsinline:"",volume:.6,width:800,"playback-rates":[.7,1,1.5,2]},null,8,["src"])):hy("",!0)]),_:1},8,["modelValue"])])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mp/components/wx-video-play/main.vue"]])});export{yy as __tla,sp as default};