(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-24f92ccb"],{11:function(e,t){},12:function(e,t){},13:function(e,t){},14:function(e,t){},15:function(e,t){},16:function(e,t){},17:function(e,t){},18:function(e,t){},19:function(e,t){},20:function(e,t){},21:function(e,t){},22:function(e,t){},"33e3":function(t,r,a){(function(n,o){var s,l,c,u=a("6b58").default,d=a("4082").default,h=a("278c").default,p=a("9523").default,f=a("63748").default,m=a("3c96").default,g=a("448a").default,y=a("a128").default,v=a("7ec2").default,A=a("c973").default,b=a("3740").default,_=a("61e5").default,k=a("ed6d").default,w=a("ded3b").default,S=a("970b").default,T=a("5bc3").default,E=a("7037").default,C=["retry","retryDelay","onRetryError","transformError"];a("a4d3"),a("e01a"),a("8172"),a("d9e2"),a("99af"),a("a874"),a("cb29"),a("4de4"),a("7db0"),a("c740"),a("a630"),a("caad"),a("a15b"),a("d81d"),a("14d9"),a("13d5"),a("fb6a"),a("4e82"),a("a434"),a("c19f"),a("82da"),a("ace4"),a("efec"),a("b0c0"),a("6c57"),a("e9c4"),a("4ec9"),a("4057"),a("a9e3"),a("35b3"),a("f00c"),a("8ba4"),a("9129"),a("583b"),a("aff5"),a("b680"),a("4fadc"),a("e439"),a("dbb4"),a("3410"),a("b64b"),a("1f68"),a("d3b7"),a("4d63"),a("c607"),a("ac1f"),a("5377"),a("2c3e"),a("00b4"),a("25f0"),a("6062"),a("f5b2"),a("8a79"),a("f6d6"),a("2532"),a("3ca3"),a("466d"),a("4d90"),a("38cf"),a("5319"),a("841c"),a("1276"),a("2ca0"),a("498a"),a("c7cd"),a("cfc3"),a("4a9b"),a("fd87"),a("8b09"),a("143c"),a("5cc6"),a("8a59"),a("84c3"),a("fb2c"),a("907a"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("986a"),a("1d02"),a("d5d6"),a("20bf"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ec97"),a("ca91"),a("25a1"),a("cd26"),a("3c5d"),a("2954"),a("649e"),a("219c"),a("170b"),a("b39a"),a("72f7"),a("1b3b"),a("3d71"),a("c6e3"),a("81b2"),a("313d"),a("159b"),a("ddb0"),a("0eb6"),a("b7ef"),a("8bd4"),a("2b3d"),a("bf19"),a("9861"),function(e,i){"object"==E(r)&&"undefined"!=typeof t?t.exports=i(a("1c46")):(l=[a("1c46")],s=i,c="function"===typeof s?s.apply(r,l):s,void 0===c||(t.exports=c))}(0,(function(t){"use strict";function r(e){return e&&"object"==E(e)&&"default"in e?e:{default:e}}var a=r(t),s=function(){function e(){S(this,e)}return T(e,[{key:"on",value:function(e,t,i){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:i}),this}},{key:"once",value:function(e,t,i){var r=this;function a(){r.off(e,a);for(var n=arguments.length,o=new Array(n),s=0;s1?i-1:0),a=1;a1?a-1:0),o=1;o1?a-1:0),o=1;o1?a-1:0),o=1;o32&&console.error("ExpGolomb: readBits() bits exceeded max 32bits!"),e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var a=Math.min(r,this._current_word_bits_left),n=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,i=i<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}])}(),cn=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,-1,-1,-1],un=cn,dn=cn;function hn(e){var t=e.profile,i=e.sampleRate,r=e.channel;return new Uint8Array([175,0,t<<3|(14&i)>>1,(1&i)<<7|r<<3])}function pn(e){return fn(e)&&e[1]===Gr}function fn(e){return e[0]>>4===Vt}function mn(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}function gn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return 1024*t/e}var yn=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],vn=function(){function e(t){S(this,e),this.buffer=t,this.buflen=t.length,this.bufpos=0,this.bufoff=0,this.iserro=!1}return T(e,[{key:"read",value:function(e){for(var t=0,i=0;e;){if(e<0||this.bufpos>=this.buflen)return this.iserro=!0,0;this.iserro=!1,i=this.bufoff+e>8?8-this.bufoff:e,t<<=i,t+=this.buffer[this.bufpos]>>8-this.bufoff-i&255>>8-i,this.bufoff+=i,e-=i,8==this.bufoff&&(this.bufpos++,this.bufoff=0)}return t}},{key:"look",value:function(e){var t=this.bufpos,i=this.bufoff,r=this.read(e);return this.bufpos=t,this.bufoff=i,r}},{key:"read_golomb",value:function(){var e;for(e=0;0==this.read(1)&&!this.iserro;e++);return(1<=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095===(i[t+0]<<8|i[t+1])>>>4)return t;t++}}},{key:"readNextAACFrame",value:function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,r=(8&e[i+1])>>>3,a=(6&e[i+1])>>>1,n=1&e[i+1],o=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,l=(1&e[i+2])<<2|(192&e[i+3])>>>6,c=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+c>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var u=1===n?7:9,d=c-u;i+=u;var h=this.findNextSyncwordOffset(i+d);if(this.current_syncword_offset_=h,(0===r||1===r)&&0===a){var p=e.subarray(i,i+d);t={},t.audio_object_type=o+1,t.sampling_freq_index=s,t.sampling_frequency=un[s],t.channel_config=l,t.data=p}}return t}},{key:"hasIncompleteData",value:function(){return this.has_last_incomplete_data}},{key:"getIncompleteData",value:function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null}}])}(),Sn=function(){function e(t){S(this,e),this.data_=t,this.eof_flag_=!1,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&console.error("Could not found ADTS syncword until payload end")}return T(e,[{key:"findNextSyncwordOffset",value:function(e){for(var t=e,i=this.data_;;){if(t+1>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(695===(i[t+0]<<3|i[t+1]>>>5))return t;t++}}},{key:"getLATMValue",value:function(e){for(var t=e.readBits(2),i=0,r=0;r<=t;r++)i<<=8,i|=e.readByte();return i}},{key:"readNextAACFrame",value:function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var r=this.current_syncword_offset_,a=(31&t[r+1])<<8|t[r+2];if(r+3+a>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var n=new ln(t.subarray(r+3,r+3+a)),o=null;if(n.readBool()){if(null==e){console.warn("StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(r+3+a),n.destroy();continue}o=e}else{var s=n.readBool();if(s&&n.readBool()){console.error("audioMuxVersionA is Not Supported"),n.destroy();break}if(s&&this.getLATMValue(n),!n.readBool()){console.error("allStreamsSameTimeFraming zero is Not Supported"),n.destroy();break}if(0!==n.readBits(6)){console.error("more than 2 numSubFrames Not Supported"),n.destroy();break}if(0!==n.readBits(4)){console.error("more than 2 numProgram Not Supported"),n.destroy();break}if(0!==n.readBits(3)){console.error("more than 2 numLayer Not Supported"),n.destroy();break}var l=s?this.getLATMValue(n):0,c=n.readBits(5);l-=5;var u=n.readBits(4);l-=4;var d=n.readBits(4);l-=4,n.readBits(3),l-=3,l>0&&n.readBits(l);var h=n.readBits(3);if(0!==h){console.error("frameLengthType = ".concat(h,". Only frameLengthType = 0 Supported")),n.destroy();break}n.readByte();var p=n.readBool();if(p)if(s)this.getLATMValue(n);else{for(var f=0;;){f<<=8;var m=n.readBool();if(f+=n.readByte(),!m)break}console.log(f)}n.readBool()&&n.readByte(),o={},o.audio_object_type=c,o.sampling_freq_index=u,o.sampling_frequency=un[o.sampling_freq_index],o.channel_config=d,o.other_data_present=p}for(var g=0;;){var y=n.readByte();if(g+=y,255!==y)break}for(var v=new Uint8Array(g),A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function En(e){var t=e.byteLength,i=new Uint8Array(4);i[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t;var r=new Uint8Array(t+4);return r.set(i,0),r.set(e,4),r}function Cn(){}function xn(e){for(var t=null,i=["webgl","experimental-webgl","moz-webgl","webkit-3d"],r=0;!t&&r0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(","),i=atob(t[1]),r=t[0].replace("data:","").replace(";base64",""),a=i.length,n=new Uint8Array(a);a--;)n[a]=i.charCodeAt(a);return new File([n],"file",{type:r})}function Ln(){return(new Date).getTime()}function In(e,t,i){return Math.max(Math.min(e,Math.max(t,i)),Math.min(t,i))}function Pn(e,t,i){if(e)return"object"==E(t)&&Object.keys(t).forEach((function(i){Pn(e,i,t[i])})),e.style[t]=i,e}function Bn(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return 0;var r=getComputedStyle(e,null).getPropertyValue(t);return i?parseFloat(r):r}function Mn(){return performance&&"function"==typeof performance.now?performance.now():Date.now()}function Un(e){var t=0,i=Mn();return function(r){if(Xn(r)){t+=r;var a=Mn(),n=a-i;n>=1e3&&(e(t/n*1e3),i=a,t=0)}}}(function(){try{if("object"==("undefined"===typeof WebAssembly?"undefined":E(WebAssembly))&&"function"==typeof WebAssembly.instantiate){var t=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(t instanceof WebAssembly.Module)new WebAssembly.Instance(t),WebAssembly.Instance}}catch(e){}})();var Fn='"4-1-2024"';function On(){return/iphone|ipod|android.*mobile|windows.*phone|blackberry.*mobile/i.test(window.navigator.userAgent.toLowerCase())}function Nn(){return!(On()||/ipad|android(?!.*mobile)|tablet|kindle|silk/i.test(window.navigator.userAgent.toLowerCase()))}function jn(){var e=window.navigator.userAgent.toLowerCase();return/android/i.test(e)}function Gn(){var e=window.navigator.userAgent.toLowerCase();return/firefox/i.test(e)}function zn(){var e=window.navigator.userAgent.toLowerCase()||"",t={type:"",version:""},i={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var r in i)if(i[r]){var a="";if("IE"===r){var n=e.match(/(msie\s|trident.*rv:)([\w.]+)/);n&&n.length>2&&(a=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2])}else if("Chrome"===r){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(r="360");var s=e.match(/chrome\/([\d.]+)/);s&&s.length>1&&(a=s[1])}else if("Firefox"===r){var l=e.match(/firefox\/([\d.]+)/);l&&l.length>1&&(a=l[1])}else if("Opera"===r){var c=e.match(/opera\/([\d.]+)/);c&&c.length>1&&(a=c[1])}else if("Safari"===r){var u=e.match(/version\/([\d.]+)/);u&&u.length>1&&(a=u[1])}else if("Edge"===r){var d=e.match(/edge\/([\d.]+)/);d&&d.length>1&&(a=d[1])}else if("QQBrowser"===r){var h=e.match(/qqbrowser\/([\d.]+)/);h&&h.length>1&&(a=h[1])}t.type=r,t.version=parseInt(a)}return t}function Hn(){var e=window.navigator.userAgent.toLowerCase();return e&&/iphone|ipad|ipod|ios/.test(e)}function Wn(){var e=window.navigator.userAgent;return!e.match(/Chrome/gi)&&!!e.match(/Safari/gi)}function Vn(e,t){if(0===arguments.length)return null;var i,r=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"==E(e)?i=e:(10===(""+e).length&&(e=1e3*parseInt(e)),e=+e,i=new Date(e));var a={y:i.getFullYear(),m:i.getMonth()+1,d:i.getDate(),h:i.getHours(),i:i.getMinutes(),s:i.getSeconds(),a:i.getDay()},n=r.replace(/{(y|m|d|h|i|s|a)+}/g,(function(e,t){var i=a[t];return"a"===t?["一","二","三","四","五","六","日"][i-1]:(e.length>0&&i<10&&(i="0"+i),i||0)}));return n}function Jn(){return"VideoFrame"in window}function qn(e){if("string"!=typeof e)return e;var t=Number(e);return isNaN(t)?e:t}function Kn(){return"xxxxxxxxxxxx4xxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}function Yn(e,t){var i,r,a=!1;return function n(){for(var o=arguments.length,s=new Array(o),l=0;l=107}function eo(){var e=!1;return"MediaStreamTrackGenerator"in window&&(e=!0),e}function to(){var e=!1;return"MediaStream"in window&&(e=!0),e}function io(e,t){var i=window.URL.createObjectURL(t),r=window.document.createElement("a");r.download=e,r.href=i;var a=window.document.createEvent("MouseEvents");a.initEvent("click",!0,!0),r.dispatchEvent(a),setTimeout((function(){window.URL.revokeObjectURL(i)}),Hn()?1e3:0)}function ro(e){return null==e}function ao(e){return!0===e||!1===e}function no(e){return!ro(e)}function oo(e){var t={left:"",right:"",top:"",bottom:"",opacity:1,backgroundColor:"",image:{src:"",width:"100",height:"60"},text:{content:"",fontSize:"14",color:"#000",width:"",height:""},rect:{color:"green",lineWidth:2,width:"",height:"",fill:"",fillOpacity:.2},line:{x1:"",y1:"",x2:"",y2:"",color:"green",lineWidth:2},polygon:{color:"green",lineWidth:2,list:[],fill:"",fillOpacity:.2},html:""},i=Object.assign(t.image,e.image||{}),r=Object.assign(t.text,e.text||{}),a=Object.assign(t.rect,e.rect||{}),n=Object.assign(t.line,e.line||{});return t=Object.assign(t,e,{image:i,text:r,rect:a,line:n}),t}function so(e,t){var i={container:e||"",text:"",opacity:"",angle:"",color:"",fontSize:"",fontFamily:""};return i=Object.assign(i,t),{watermark_parent_node:i.container,watermark_alpha:i.opacity,watermark_angle:i.angle,watermark_fontsize:i.fontSize,watermark_color:i.color,watermark_font:i.fontFamily,watermark_txt:i.text}}function lo(e,t){return new Promise((function(i,r){var a=oo(t);if(!a.image.src&&!a.text.content)return i(e);var n=document.createElement("canvas");n.width=t.width,n.height=t.height;var o=n.getContext("2d"),s=0,l=0;Xn(a.left)?s=a.left:Xn(a.right)&&(s=n.width-a.right),Xn(a.top)?l=a.top:Xn(a.bottom)&&(l=n.height-a.bottom);var c=new Image;c.src=e,c.onload=function(){if(o.drawImage(c,0,0),a.image&&a.image.src){var e=new Image;e.src=a.image.src,e.setAttribute("crossOrigin","Anonymous"),e.onload=function(){s-=a.image.width,o.drawImage(e,s,l,a.image.width,a.image.height),i(n.toDataURL(t.format,t.quality))},e.onerror=function(e){r()}}else a.text&&a.text.content&&(o.font=a.text.fontSize+"px 宋体",o.fillStyle=a.text.color,o.textAlign="right",o.fillText(a.text.content,s,l),i(n.toDataURL(t.format,t.quality)))},c.onerror=function(e){r(e)}}))}function co(e){var t;if(e>-1){var i=Math.floor(e/3600),r=Math.floor(e/60)%60,a=e%60;t=i<10?"0"+i+":":i+":",r<10&&(t+="0"),t+=r+":",(a=Math.round(a))<10&&(t+="0"),t+=a.toFixed(0)}return t}function uo(e,t){var i="";if(e>-1){var r=Math.floor(e/60)%60,a=e%60;a=Math.round(a),i=r<10?"0"+r+":":r+":",a<10&&(i+="0"),i+=a,ro(t)||(t<10&&(t="0"+t),i+=":"+t)}return i}function ho(e){var t="";if(e>-1){var i=Math.floor(e/60/60)%60,r=Math.floor(e/60)%60,a=e%60;r=Math.round(r),t=i<10?"0"+i+":":i+":",r<10&&(t+="0"),t+=r+":",a<10&&(t+="0"),t+=a}return t}function po(e,t){var i=Math.floor(t/60)%60,r=Math.floor(t%60);return new Date(e).setHours(i,r,0,0)}function fo(e,t){var i=Math.floor(t/60/60)%60,r=Math.floor(t/60)%60,a=t%60;return new Date(e).setHours(i,r,a,0)}function mo(e){return(""+e).length}function go(e){return e&&0===Object.keys(e).length}function yo(e){return!go(e)}function vo(e){return"string"==typeof e}var Ao=function(){var e=window.navigator.userAgent;return/MicroMessenger/i.test(e)},bo=function(){var e=window.navigator.userAgent;return/Chrome/i.test(e)};function _o(e){var t=e||window.event;return t.target||t.srcElement}function ko(){return Gn()&&function(){var e=navigator.userAgent.toLowerCase();return/macintosh|mac os x/i.test(e)}()}function wo(e){return"function"==typeof e}function So(e){if(On()){var t=0,i=0;if(1===e.touches.length){var r=e.touches[0];t=r.clientX,i=r.clientY}return{posX:t,posY:i}}var a=0,n=0,o=e||window.event;return o.pageX||o.pageY?(a=o.pageX,n=o.pageY):(o.clientX||o.clientY)&&(a=e.clientX+document.documentElement.scrollLeft+document.body.scrollLeft,n=e.clientY+document.documentElement.scrollTop+document.body.scrollTop),{posX:a,posY:n}}function To(){var e=document.createElement("video"),t=e.canPlayType("application/vnd.apple.mpegurl");return e=null,t}function Eo(e){var t=No(e.hasAudio)&&(e.useMSE||e.useWCS&&!e.useOffscreen)&&No(e.demuxUseWorker);return!!(No(t)&&e.useMSE&&e.mseDecodeAudio&&No(e.demuxUseWorker))||t}function Co(e){var t=e.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],i=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(i)}function xo(e){e.close()}function Ro(){return"https:"===window.location.protocol||"localhost"===window.location.hostname}function Do(e){var t=Object.prototype.toString;return function(e){switch(t.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:try{return e instanceof Error}catch(e){return!1}}}(e)?e.message:null==e?"":"object"==E(e)?JSON.stringify(e,null,2):String(e)}function Lo(e,t){t&&(e=e.filter((function(e){return e.type&&e.type===t})));var i=e[0],r=null,a=1;if(e.length>0){var n=e[1];n&&n.ts-i.ts>1e5&&(i=n,a=2)}if(i)for(var o=a;o=1e3&&e[o-1].ts-i.ts<1e3&&(r=o+1)}return r}function Io(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),r=new Uint8Array(i.length),a=0;a>4===zr&&e[1]===Gr}function Oo(e){return!0===e||"true"===e}function No(e){return!0!==e&&"true"!==e}function jo(e,t,i){e&&(e.dataset?e.dataset[t]=i:e.setAttribute("data-"+t,i))}function Go(e,t){return e?e.dataset?e.dataset[t]:e.getAttribute("data-"+t):""}function zo(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function Ho(){return/iphone/i.test(navigator.userAgent)}function Wo(){return window.performance&&window.performance.memory?window.performance.memory:null}function Vo(){try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(e){return!1}}function Jo(e){return e.trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1]}function qo(){var e=!1;return"requestVideoFrameCallback"in HTMLVideoElement.prototype&&(e=!0),e}function Ko(){var e=!1;return"PressureObserver"in window&&(e=!0),e}var Yo=function(){function e(t){S(this,e),this.destroys=[],this.proxy=this.proxy.bind(this),this.master=t}return T(e,[{key:"proxy",value:function(e,t,i){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e){if(Array.isArray(t))return t.map((function(t){return r.proxy(e,t,i,a)}));e.addEventListener(t,i,a);var n=function(){wo(e.removeEventListener)&&e.removeEventListener(t,i,a)};return this.destroys.push(n),n}}},{key:"destroy",value:function(){this.master.debug&&this.master.debug.log("Events","destroy"),this.destroys.forEach((function(e){return e()})),this.destroys=[]}}])}(),Qo=1e-6,Xo="undefined"!=typeof Float32Array?Float32Array:Array;function Zo(){var e=new Xo(16);return Xo!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function $o(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var es,ts=function(e,t,i,r,a,n,o){var s=1/(t-i),l=1/(r-a),c=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*s,e[13]=(a+r)*l,e[14]=(o+n)*c,e[15]=1,e};function is(e,t,i){var r=new Xo(3);return r[0]=e,r[1]=t,r[2]=i,r}es=new Xo(3),Xo!=Float32Array&&(es[0]=0,es[1]=0,es[2]=0);var rs=function(){function e(t,i){S(this,e),this.gl=t,i&&this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1);var r=this._initShaderProgram();this._programInfo={program:r,attribLocations:{vertexPosition:t.getAttribLocation(r,"aVertexPosition"),texturePosition:t.getAttribLocation(r,"aTexturePosition")},uniformLocations:{projectionMatrix:t.getUniformLocation(r,"uProjectionMatrix"),modelMatrix:t.getUniformLocation(r,"uModelMatrix"),viewMatrix:t.getUniformLocation(r,"uViewMatrix"),rgbatexture:t.getUniformLocation(r,"rgbaTexture"),ytexture:t.getUniformLocation(r,"yTexture"),utexture:t.getUniformLocation(r,"uTexture"),vtexture:t.getUniformLocation(r,"vTexture"),isyuv:t.getUniformLocation(r,"isyuv")}},this._buffers=this._initBuffers(),this._rgbatexture=this._createTexture(),this._ytexture=this._createTexture(),this._utexture=this._createTexture(),this._vtexture=this._createTexture()}return T(e,[{key:"destroy",value:function(){this.gl.deleteProgram(this._programInfo.program),this.gl.deleteBuffer(this._buffers.position),this.gl.deleteBuffer(this._buffers.texPosition),this.gl.deleteBuffer(this._buffers.indices),this.gl.deleteTexture(this._rgbatexture),this.gl.deleteTexture(this._ytexture),this.gl.deleteTexture(this._utexture),this.gl.deleteTexture(this._vtexture),this._programInfo=null,this._buffers=null,this._rgbatexture=null,this._ytexture=null,this._utexture=null,this._vtexture=null}},{key:"_initShaderProgram",value:function(){var e=this._loadShader(this.gl.VERTEX_SHADER,"\n attribute vec4 aVertexPosition;\n attribute vec2 aTexturePosition;\n varying lowp vec2 vTexturePosition;\n void main(void) {\n gl_Position = aVertexPosition;\n vTexturePosition = aTexturePosition;\n }\n "),t=this._loadShader(this.gl.FRAGMENT_SHADER,"\n precision highp float;\n varying highp vec2 vTexturePosition;\n uniform int isyuv;\n uniform sampler2D rgbaTexture;\n uniform sampler2D yTexture;\n uniform sampler2D uTexture;\n uniform sampler2D vTexture;\n\n const mat4 YUV2RGB = mat4( 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1);\n\n\n void main(void) {\n\n if (isyuv>0) {\n\n highp float y = texture2D(yTexture, vTexturePosition).r;\n highp float u = texture2D(uTexture, vTexturePosition).r;\n highp float v = texture2D(vTexture, vTexturePosition).r;\n gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;\n\n } else {\n gl_FragColor = texture2D(rgbaTexture, vTexturePosition);\n }\n }\n "),i=this.gl.createProgram();return this.gl.attachShader(i,e),this.gl.attachShader(i,t),this.gl.linkProgram(i),this.gl.getProgramParameter(i,this.gl.LINK_STATUS)?i:(console.log("Unable to initialize the shader program: "+this.gl.getProgramInfoLog(i)),null)}},{key:"_loadShader",value:function(e,t){var i=this.gl,r=i.createShader(e);return i.shaderSource(r,t),i.compileShader(r),i.getShaderParameter(r,i.COMPILE_STATUS)?r:(console.log("An error occurred compiling the shaders: "+i.getShaderInfoLog(r)),i.deleteShader(r),null)}},{key:"_initBuffers",value:function(){var e=this.gl,t=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,t);var i=[-1,-1,1,-1,1,1,-1,1];e.bufferData(e.ARRAY_BUFFER,new Float32Array(i),e.STATIC_DRAW);var r=[];r=r.concat([0,1],[1,1],[1,0],[0,0]);var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,new Float32Array(r),e.STATIC_DRAW);var n=e.createBuffer();return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n),e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),e.STATIC_DRAW),{positions:i,position:t,texPosition:a,indices:n}}},{key:"_createTexture",value:function(){var e=this.gl.createTexture();return this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),e}},{key:"_drawScene",value:function(e,t,i){this.gl.viewport(0,0,e,t),this.gl.enable(this.gl.BLEND),this.gl.blendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this._buffers.position),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(this._buffers.positions),this.gl.STATIC_DRAW),this.gl.vertexAttribPointer(this._programInfo.attribLocations.vertexPosition,2,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(this._programInfo.attribLocations.vertexPosition),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this._buffers.texPosition),this.gl.vertexAttribPointer(this._programInfo.attribLocations.texturePosition,2,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(this._programInfo.attribLocations.texturePosition),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this._buffers.indices),i?(this.gl.activeTexture(this.gl.TEXTURE0+3),this.gl.bindTexture(this.gl.TEXTURE_2D,this._ytexture),this.gl.activeTexture(this.gl.TEXTURE0+4),this.gl.bindTexture(this.gl.TEXTURE_2D,this._utexture),this.gl.activeTexture(this.gl.TEXTURE0+5),this.gl.bindTexture(this.gl.TEXTURE_2D,this._vtexture)):(this.gl.activeTexture(this.gl.TEXTURE0+2),this.gl.bindTexture(this.gl.TEXTURE_2D,this._rgbatexture)),this.gl.useProgram(this._programInfo.program),this.gl.uniform1i(this._programInfo.uniformLocations.rgbatexture,2),this.gl.uniform1i(this._programInfo.uniformLocations.ytexture,3),this.gl.uniform1i(this._programInfo.uniformLocations.utexture,4),this.gl.uniform1i(this._programInfo.uniformLocations.vtexture,5),this.gl.uniform1i(this._programInfo.uniformLocations.isyuv,i?1:0),this.gl.drawElements(this.gl.TRIANGLES,6,this.gl.UNSIGNED_SHORT,0)}},{key:"_calRect",value:function(e,t,i,r,a,n){var o=2*e/a-1,s=2*(n-t-r)/n-1,l=2*(e+i)/a-1,c=2*(n-t)/n-1;return[o,s,l,s,l,c,o,c]}},{key:"_clear",value:function(){this.gl.clearColor(0,0,0,1),this.gl.clearDepth(1),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},{key:"render",value:function(e,t,i,r,a){var n=this.gl;this._clear(),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this._ytexture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e,t,0,n.LUMINANCE,n.UNSIGNED_BYTE,i),n.activeTexture(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,this._utexture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e/2,t/2,0,n.LUMINANCE,n.UNSIGNED_BYTE,r),n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,this._vtexture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e/2,t/2,0,n.LUMINANCE,n.UNSIGNED_BYTE,a),this._buffers.positions=[-1,-1,1,-1,1,1,-1,1],this._drawScene(e,t,!0)}},{key:"renderYUV",value:function(e,t,i){var r=i.slice(0,e*t),a=i.slice(e*t,e*t*5/4),n=i.slice(e*t*5/4,e*t*3/2),o=this.gl;this._clear(),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this._ytexture),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,e,t,0,o.LUMINANCE,o.UNSIGNED_BYTE,r),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,this._utexture),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,e/2,t/2,0,o.LUMINANCE,o.UNSIGNED_BYTE,a),o.activeTexture(o.TEXTURE2),o.bindTexture(o.TEXTURE_2D,this._vtexture),o.texImage2D(o.TEXTURE_2D,0,o.LUMINANCE,e/2,t/2,0,o.LUMINANCE,o.UNSIGNED_BYTE,n),this._buffers.positions=[-1,-1,1,-1,1,1,-1,1],this._drawScene(e,t,!0)}},{key:"drawDom",value:function(e,t,i,r,a){var n=this.gl;n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this._rgbatexture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,a),this._buffers.positions=this._calRect(i,r,a.width,a.height,e,t),this._drawScene(e,t,!1)}}])}(),as=function(){function e(t){var i=this;S(this,e),this.gpu=t,this.pipeline=null,this.matrixGroupInfo=null,this.depthTexture=null,this.textureGroupInfo=null,this.hasInited=!1,this.buffers=this._initBuffer(),this._initPipeline().then((function(e){i.pipeline=e,i.matrixGroupInfo=i._initMatrixGroupInfo(),i.hasInited=!0}))}return T(e,[{key:"destroy",value:function(){this.gpu&&(this.gpu.device.destroy(),this.gpu=null),this.hasInited=!1,this.pipeline=null,this.matrixGroupInfo=null,this.depthTexture=null,this.textureGroupInfo=null}},{key:"_initBuffer",value:function(){var e=this.gpu.device,t=new Float32Array([-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1]),i=e.createBuffer({size:t.byteLength,usage:window.GPUBufferUsage.VERTEX|window.GPUBufferUsage.COPY_DST});e.queue.writeBuffer(i,0,t);var r=new Float32Array([0,1,1,1,1,0,0,0]),a=e.createBuffer({size:r.byteLength,usage:window.GPUBufferUsage.VERTEX|window.GPUBufferUsage.COPY_DST});e.queue.writeBuffer(a,0,r);var n=new Uint16Array([0,1,2,0,2,3]),o=e.createBuffer({size:n.byteLength,usage:window.GPUBufferUsage.INDEX|window.GPUBufferUsage.COPY_DST});return e.queue.writeBuffer(o,0,n),{positionBuffer:i,texpositionBuffer:a,indexBuffer:o}}},{key:"_initPipeline",value:function(){var e=this;return new Promise((function(t,i){var r=e.gpu.device,a=e.gpu.format,n={layout:"auto",vertex:{module:r.createShaderModule({code:"\n\n @binding(0) @group(0) var uModelMatrix : mat4x4;\n @binding(1) @group(0) var uViewMatrix : mat4x4;\n @binding(2) @group(0) var uProjectionMatrix : mat4x4;\n\n struct VertexOutput {\n @builtin(position) Position : vec4,\n @location(0) vTexturePosition : vec2,\n }\n\n @vertex\n fn main(\n @location(0) aVertexPosition : vec4,\n @location(1) aTexturePosition : vec2\n ) -> VertexOutput {\n var output : VertexOutput;\n var tmppos : vec4 = uProjectionMatrix * uViewMatrix * uModelMatrix * aVertexPosition;\n output.Position = vec4(tmppos.x, tmppos.y, (tmppos.z+1.)/2., tmppos.w); // webgl z [-1, 1], webgpu z [0, 1], 这里z做下调整 z-webgpu = (z-webgl+1)/2\n output.vTexturePosition = aTexturePosition;\n return output;\n }\n\n "}),entryPoint:"main",buffers:[{arrayStride:12,attributes:[{shaderLocation:0,offset:0,format:"float32x3"}]},{arrayStride:8,attributes:[{shaderLocation:1,offset:0,format:"float32x2"}]}]},primitive:{topology:"triangle-list"},fragment:{module:r.createShaderModule({code:"\n @group(1) @binding(0) var mySampler: sampler;\n @group(1) @binding(1) var yTexture: texture_2d;\n @group(1) @binding(2) var uTexture: texture_2d;\n @group(1) @binding(3) var vTexture: texture_2d;\n\n const YUV2RGB : mat4x4 = mat4x4( 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1);\n\n @fragment\n fn main(\n @location(0) vTexturePosition: vec2\n ) -> @location(0) vec4 {\n\n var y : f32= textureSample(yTexture, mySampler, vTexturePosition).r;\n var u : f32 = textureSample(uTexture, mySampler, vTexturePosition).r;\n var v : f32 = textureSample(vTexture, mySampler, vTexturePosition).r;\n\n return vec4(y, u, v, 1.0)*YUV2RGB;\n }\n\n "}),entryPoint:"main",targets:[{format:a}]},depthStencil:{depthWriteEnabled:!0,depthCompare:"less",format:"depth24plus"}};r.createRenderPipelineAsync(n).then((function(e){t(e)})).catch((function(e){i(e)}))}))}},{key:"_initMatrixGroupInfo",value:function(){var e=this.gpu.device,t=this.pipeline,i=Zo();ts(i,-1,1,-1,1,.1,100);var r=Zo();$o(r);var a=Zo();!function(e,t,i,r){var a,n,o,s,l,c,u,d,h,p,f=t[0],m=t[1],g=t[2],y=r[0],v=r[1],A=r[2],b=i[0],_=i[1],k=i[2];Math.abs(f-b)0&&i.width>0){var r=i.width,a=i.height,n=this.player._opt,o=t,s=e;if(n.hasControl&&!n.controlAutoHide){var l=n.playType===z?yi:gi;On()&&this.player.fullscreen&&n.useWebFullScreen?s-=l:o-=l}var c=n.rotate,u=(s-r)/2,d=(o-a)/2;270!==c&&90!==c||(r=i.height,a=i.width);var h=s/r,p=o/a,f=h>p?p:h;n.isResize||h!==p&&(f=h+","+p),n.isFullResize&&(f=h>p?h:p);var m="scale("+f+")";"none"===n.mirrorRotate&&c&&(m+=" rotate("+c+"deg)"),"level"===n.mirrorRotate?m+=" rotateY(180deg)":"vertical"===n.mirrorRotate&&(m+=" rotateX(180deg)"),this.scale=-1!==(""+f).indexOf(",")?h:f,this.shadowRootInnerDom.style.transform=m,this.shadowRootInnerDom.style.left=u+"px",this.shadowRootInnerDom.style.top=d+"px",this.shadowRootInnerDom.style.width=i.width+"px",this.shadowRootInnerDom.style.height=i.height+"px",this.shadowRootInnerDom.style.display="block"}}},{key:"_resizeDomForCanvas",value:function(){var e=this.player.getVideoInfo();if(e&&e.height>0&&e.width>0){var t=this.player._opt,i=this.player.width,r=this.player.height;if(t.hasControl&&!t.controlAutoHide){var a=t.playType===z?yi:gi;On()&&this.player.fullscreen&&t.useWebFullScreen?i-=a:r-=a}var n=e.width,o=e.height,s=t.rotate,l=(i-n)/2,c=(r-o)/2;270!==s&&90!==s||(n=e.height,o=e.width);var u=i/n,d=r/o,h=u>d?d:u;t.isResize||u!==d&&(h=u+","+d),t.isFullResize&&(h=u>d?u:d);var p="scale("+h+")";"none"===t.mirrorRotate&&s&&(p+=" rotate("+s+"deg)"),"level"===t.mirrorRotate?p+=" rotateY(180deg)":"vertical"===t.mirrorRotate&&(p+=" rotateX(180deg)"),this.shadowRootInnerDom.style.height=e.height+"px",this.shadowRootInnerDom.style.width=e.width+"px",this.shadowRootInnerDom.style.padding="0",this.shadowRootInnerDom.style.transform=p,this.shadowRootInnerDom.style.left=l+"px",this.shadowRootInnerDom.style.top=c+"px",this.shadowRootInnerDom.style.display="block"}}},{key:"_resizeDomRatio",value:function(){var e=this.player.getVideoInfo();if(e&&e.height>0&&e.width>0){var t=this.player._opt.aspectRatio.split(":").map(Number),i=this.player.width,r=this.player.height,a=this.player._opt,n=0;a.hasControl&&!a.controlAutoHide&&(n=a.playType===z?yi:gi,r-=n);var o=e.width/e.height,s=t[0]/t[1];if(o>s){var l=s*e.height/e.width;this.shadowRootInnerDom.style.width=100*l+"%",this.shadowRootInnerDom.style.height="calc(100% - ".concat(n,"px)"),this.shadowRootInnerDom.style.padding="0 ".concat((i-i*l)/2,"px")}else{var c=e.width/s/e.height;this.shadowRootInnerDom.style.width="100%",this.shadowRootInnerDom.style.height="calc(".concat(100*c,"% - ").concat(n,"px)"),this.shadowRootInnerDom.style.padding=(r-r*c)/2+"px 0"}this.shadowRootInnerDom.style.display="block"}}},{key:"_updateDom",value:function(){var e=this;this.shadowRoot&&this.configList.forEach((function(t){var i=document.createElement("div"),r=null;if(t.image&&t.image.src?(r=document.createElement("img"),r.style.height="100%",r.style.width="100%",r.style.objectFit="contain",r.src=t.image.src):t.text&&t.text.content?r=document.createTextNode(t.text.content):(t.rect&&t.rect.color&&t.rect.width||t.html||t.line&&t.line.x1&&t.line.y1&&t.line.x2&&t.line.y2||t.polygon&&t.polygon.list&&t.polygon.list.length>=3)&&(r=document.createElement("div")),r){if(i.appendChild(r),i.style.visibility="",i.style.position="absolute",i.style.display="block",i.style["-ms-user-select"]="none",i.style["-moz-user-select"]="none",i.style["-webkit-user-select"]="none",i.style["-o-user-select"]="none",i.style["user-select"]="none",i.style["-webkit-touch-callout"]="none",i.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",i.style["-webkit-text-size-adjust"]="none",i.style["-webkit-touch-callout"]="none",i.style.opacity=t.opacity,no(t.left)&&(Xn(t.left)?i.style.left=t.left+"px":i.style.left=t.left),no(t.right)&&(Xn(t.right)?i.style.right=t.right+"px":i.style.right=t.right),no(t.top)&&(Xn(t.top)?i.style.top=t.top+"px":i.style.top=t.top),no(t.bottom)&&(Xn(t.bottom)?i.style.bottom=t.bottom+"px":i.style.bottom=t.bottom),t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor),i.style.overflow="hidden",i.style.zIndex="9999999",t.image&&t.image.src)i.style.width=t.image.width+"px",i.style.height=t.image.height+"px";else if(t.text&&t.text.content)i.style.fontSize=t.text.fontSize+"px",i.style.color=t.text.color,t.text.width&&(i.style.width=t.text.width+"px"),t.text.height&&(i.style.height=t.text.height+"px");else if(t.rect&&t.rect.color&&t.rect.width){if(i.style.width=t.rect.width+"px",i.style.height=t.rect.height+"px",i.style.borderWidth=t.rect.lineWidth+"px",i.style.borderStyle="solid",i.style.borderColor=t.rect.color,t.rect.fill){var a=document.createElement("div");a.style.position="absolute",a.style.width="100%",a.style.height="100%",a.style.backgroundColor=t.rect.fill,t.rect.fillOpacity&&(a.style.opacity=t.rect.fillOpacity),i.appendChild(a)}}else if(t.html)i.style.width="100%",i.style.height="100%",i.innerHTML=t.html;else if(t.line&&t.line.x1&&t.line.y1&&t.line.x2&&t.line.y2)e.settingLine(i,t.line);else if(t.polygon&&t.polygon.list&&t.polygon.list.length>=3){i.style.width="100%",i.style.height="100%";var n=t.polygon.list,o=t.polygon.color,s=t.polygon.lineWidth;if(n=n.sort((function(e,t){return(e.index||0)-(t.index||0)})),t.polygon.fill){var l=document.createElement("div");l.style.position="absolute",l.style.width="100%",l.style.height="100%";var c="polygon("+n.map((function(e){return"".concat(e.x,"px ").concat(e.y,"px")})).join(", ")+")";l.style.clipPath=c,l.style.backgroundColor=t.polygon.fill,t.polygon.fillOpacity&&(l.style.opacity=t.polygon.fillOpacity),i.appendChild(l)}n.forEach((function(t,r){var a=document.createElement("div");if(r===n.length-1){var l=n[0],c={x1:t.x,y1:t.y,x2:l.x,y2:l.y,color:o,lineWidth:s};return e.settingLine(a,c),void i.appendChild(a)}var u=n[r+1],d={x1:t.x,y1:t.y,x2:u.x,y2:u.y,color:o,lineWidth:s};e.settingLine(a,d),i.appendChild(a)}))}e.isDynamic&&(e.shadowRootDynamicDom=i),e.shadowRootInnerDom.appendChild(i)}}))}},{key:"settingLine",value:function(e,t){var i=t.x1,r=t.y1,a=t.x2,n=t.y2,o=Math.sqrt(Math.pow(i-a,2)+Math.pow(r-n,2)),s=180*Math.atan2(n-r,a-i)/Math.PI;e.style.backgroundColor=t.color,e.style.width=o+"px",e.style.height=t.lineWidth+"px",e.style.position="absolute",e.style.top=r+"px",e.style.left=i+"px",e.style.transform="rotate("+s+"deg)",e.style.transformOrigin="0 0"}},{key:"remove",value:function(){this._removeDom()}},{key:"_removeDom",value:function(){this.shadowRootInnerDom&&(this.shadowRootInnerDom.innerHTML="")}}])}(),os=function(e){function t(){var e;return S(this,t),e=_(this,t),e.videoInfo={width:null,height:null,encType:null,encTypeCode:null},e.init=!1,e.prevAiFaceDetectTime=null,e.prevAiObjectDetectTime=null,e.prevOcclusionDetectTime=null,e.contentWatermark=null,e.aiContentWatermark=null,e.tempContentList=[],e.tempAiContentList=[],e.streamFps=0,e}return k(t,e),T(t,[{key:"destroy",value:function(){this.resetInit(),this.contentWatermark&&(this.contentWatermark.destroy(),this.contentWatermark=null),this.tempContentList=[],this.aiContentWatermark&&(this.aiContentWatermark.destroy(),this.aiContentWatermark=null),this.tempAiContentList=[],this.prevAiFaceDetectTime=null,this.prevAiObjectDetectTime=null,this.streamFps=0,this.off()}},{key:"resetInit",value:function(){this.videoInfo={width:null,height:null,encType:null,encTypeCode:null},this.init=!1}},{key:"getHasInit",value:function(){return this.init}},{key:"updateVideoInfo",value:function(e){no(e.encTypeCode)&&(this.videoInfo.encType=jt[e.encTypeCode],this.videoInfo.encTypeCode=e.encTypeCode),no(e.encType)&&(this.videoInfo.encType=e.encType),no(e.width)&&(this.videoInfo.width=e.width),no(e.height)&&(this.videoInfo.height=e.height),no(this.videoInfo.encType)&&no(this.videoInfo.height)&&no(this.videoInfo.width)&&!this.init&&(this.player.emit(xt.videoInfo,this.videoInfo),this.init=!0)}},{key:"getVideoInfo",value:function(){return this.videoInfo}},{key:"clearView",value:function(){this.tempContentList=[],this.tempAiContentList=[]}},{key:"resize",value:function(){if(this.player.debug.log("CommonVideo","resize()"),"default"===this.player._opt.aspectRatio||On()?this._resize():this._resizeRatio(),this.contentWatermark&&this.contentWatermark.resize(),this.aiContentWatermark&&this.aiContentWatermark.resize(),this.player.singleWatermark&&this.player.singleWatermark.resize(),this.player.ghostWatermark&&this.player.ghostWatermark.resize(),this.player.dynamicWatermark&&this.player.dynamicWatermark.resize(),this.player.zoom&&this.player.zooming){var e=this._getStyleScale();this.player.zoom.updatePrevVideoElementStyleScale(e),this.player.zoom.updateVideoElementScale()}}},{key:"_resizeRatio",value:function(){this.player.debug.log("CommonVideo","_resizeRatio()");var e=this.player._opt.aspectRatio.split(":").map(Number),t=this.player.width,i=this.player.height,r=this.player._opt,a=0;r.hasControl&&!r.controlAutoHide&&(a=r.playType===z?yi:gi,i-=a);var n=this.videoInfo,o=n.width/n.height,s=e[0]/e[1];if(this.getType()===he&&(this.$videoElement.style.left="0",this.$videoElement.style.top="0",this.$videoElement.style.transform="none"),this.getType()===pe&&this.player._opt.videoRenderSupportScale&&(this.$videoElement.style.objectFit="fill"),o>s){var l=s*n.height/n.width;this.$videoElement.style.width=100*l+"%",this.$videoElement.style.height="calc(100% - ".concat(a,"px)"),this.$videoElement.style.padding="0 ".concat((t-t*l)/2,"px")}else{var c=n.width/s/n.height;this.$videoElement.style.width="100%",this.$videoElement.style.height="calc(".concat(100*c,"% - ").concat(a,"px)"),this.$videoElement.style.padding=(i-i*c)/2+"px 0"}}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"setRate",value:function(e){}},{key:"getType",value:function(){return""}},{key:"getCanvasType",value:function(){return""}},{key:"getCurrentTime",value:function(){return 0}},{key:"getStreamFps",value:function(){return this.streamFps}},{key:"isPlaying",value:function(){return!0}},{key:"getPlaybackQuality",value:function(){return null}},{key:"setStreamFps",value:function(e){this.player.debug.log("CommonVideo","setStreamFps",e),this.streamFps=e}},{key:"addContentToCanvas",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.tempContentList=e}},{key:"addAiContentToCanvas",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.tempAiContentList=e}},{key:"doAddContentToWatermark",value:function(){if(this.tempContentList.length>0){this.contentWatermark||(this.contentWatermark=new ns(this.player),this.contentWatermark.resize());var e=[];this.tempContentList.forEach((function(t){var i={left:t.x||0,top:t.y||0};"text"===t.type?i.text={content:t.text,fontSize:t.fontSize||"14",color:t.color||"#000"}:"rect"===t.type?i.rect={width:t.width,height:t.height,color:t.color||"green",lineWidth:t.lineWidth||2,fill:t.fill||"",fillOpacity:t.fillOpacity||.2}:"polygon"===t.type?i.polygon={list:t.list,color:t.color||"green",lineWidth:t.lineWidth||2,fill:t.fill,fillOpacity:t.fillOpacity||.2}:"line"===t.type&&(i.line={color:t.color||"green",lineWidth:t.lineWidth||2,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}),e.push(i)})),this.contentWatermark.update(e)}else this.contentWatermark&&this.contentWatermark.remove()}},{key:"doAddAiContentToWatermark",value:function(){if(this.tempAiContentList.length>0){this.aiContentWatermark||(this.aiContentWatermark=new ns(this.player),this.aiContentWatermark.resize());var e=this.tempAiContentList.map((function(e){var t={left:e.x,top:e.y};return"text"===e.type?t.text={content:e.text,fontSize:e.fontSize,color:e.color}:"rect"===e.type&&(t.rect={width:e.width,height:e.height,color:e.color,lineWidth:e.lineWidth}),t}));this.aiContentWatermark.update(e)}else this.aiContentWatermark&&this.aiContentWatermark.remove()}},{key:"_getStyleScale",value:function(){var e=this.$videoElement.style.transform.match(/scale\([0-9., ]*\)/g),t="";return e&&e[0]&&(t=e[0].replace("scale(","").replace(")","").split(",")),t}},{key:"getReadyStateInited",value:function(){return!0}}])}(s),ss="object"==("undefined"===typeof window?"undefined":E(window))&&window.window===window?window:"object"==("undefined"===typeof self?"undefined":E(self))&&self.self===self?self:"object"==("undefined"===typeof n?"undefined":E(n))&&n.global===n?n:void 0;function ls(e,t,i){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){hs(r.response,t,i)},r.onerror=function(){console.error("could not download file")},r.send()}function cs(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function us(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(i){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var ds=ss.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),hs="object"!=("undefined"===typeof window?"undefined":E(window))||window!==ss?function(){}:"download"in HTMLAnchorElement.prototype&&!ds?function(e,t,i){var r=ss.URL||ss.webkitURL,a=document.createElementNS("http://www.w3.org/1999/xhtml","a");t=t||e.name||"download",a.download=t,a.rel="noopener","string"==typeof e?(a.href=e,a.origin!==location.origin?cs(a.href)?ls(e,t,i):us(a,a.target="_blank"):us(a)):(a.href=r.createObjectURL(e),setTimeout((function(){r.revokeObjectURL(a.href)}),4e4),setTimeout((function(){us(a)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"==typeof e)if(cs(e))ls(e,t,i);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout((function(){us(r)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=E(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,i),t)}:function(e,t,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return ls(e,t,i);var a="application/octet-stream"===e.type,n=/constructor/i.test(ss.HTMLElement)||ss.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&n||ds)&&"undefined"!=typeof FileReader){var s=new FileReader;s.onloadend=function(){var e=s.result;e=o?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},s.readAsDataURL(e)}else{var l=ss.URL||ss.webkitURL,c=l.createObjectURL(e);r?r.location=c:location.href=c,r=null,setTimeout((function(){l.revokeObjectURL(c)}),4e4)}},ps=function(){function e(t,i){S(this,e),this.canvas=t,this.gl=i;var r=i.createShader(i.VERTEX_SHADER);if(i.shaderSource(r,"\n attribute vec2 xy;\n varying highp vec2 uv;\n void main(void) {\n gl_Position = vec4(xy, 0.0, 1.0);\n // Map vertex coordinates (-1 to +1) to UV coordinates (0 to 1).\n // UV coordinates are Y-flipped relative to vertex coordinates.\n uv = vec2((1.0 + xy.x) / 2.0, (1.0 - xy.y) / 2.0);\n }\n "),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw i.getShaderInfoLog(r);var a=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(a,"\n varying highp vec2 uv;\n uniform sampler2D texture;\n void main(void) {\n gl_FragColor = texture2D(texture, uv);\n }\n "),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))throw i.getShaderInfoLog(a);var n=i.createProgram();if(i.attachShader(n,r),i.attachShader(n,a),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw i.getProgramInfoLog(n);i.useProgram(n);var o=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);var s=i.getAttribLocation(n,"xy");i.vertexAttribPointer(s,2,i.FLOAT,!1,0,0),i.enableVertexAttribArray(s);var l=i.createTexture();i.bindTexture(i.TEXTURE_2D,l),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),this.program=n,this.buffer=o,this.vertexShader=r,this.fragmentShader=a,this.texture=l}return T(e,[{key:"destroy",value:function(){this.gl.deleteProgram(this.program),this.gl.deleteBuffer(this.buffer),this.gl.deleteTexture(this.texture),this.gl.deleteShader(this.vertexShader),this.gl.deleteShader(this.fragmentShader),this.program=null,this.buffer=null,this.vertexShader=null,this.fragmentShader=null,this.texture=null}},{key:"render",value:function(e){this.canvas.width=e.displayWidth,this.canvas.height=e.displayHeight;var t=this.gl;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),t.clearColor(1,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4)}}])}(),fs=function(t){function i(e){var t;S(this,i),t=_(this,i),t.player=e;var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,t.$videoElement=r,e.$container.appendChild(t.$videoElement),t.context2D=null,t.contextGl=null,t.webglRender=null,t.webglRectRender=null,t.webGPURender=null,t.isWebglContextLost=!1,t.isWcsWebgl2=!1,t.bitmaprenderer=null,t.renderType=null,t.controlHeight=0,t.proxyDestroyList=[],t._initCanvasRender(),t}return k(i,t),T(i,[{key:"destroy",value:function(){b(i,"destroy",this,3)([]),this.proxyDestroyList.length>0&&(this.proxyDestroyList.forEach((function(e){e&&e()})),this.proxyDestroyList=[]),this.contextGl&&(this.contextGl=null),this.context2D&&(this.context2D=null),this.webglRender&&(this.webglRender.destroy(),this.webglRender=null),this.webglRectRender&&(this.webglRectRender.destroy(),this.webglRectRender=null),this.webGPURender&&(this.webGPURender.destroy(),this.webGPURender=null),this.bitmaprenderer&&(this.bitmaprenderer=null),this.renderType=null,this.isWebglContextLost=!1,this.videoInfo={width:"",height:"",encType:""},this.player.$container.removeChild(this.$videoElement),this.init=!1,this.off()}},{key:"_initContext2D",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.context2D=this.$videoElement.getContext("2d",e)}},{key:"_initContextGl",value:function(){if(this.player.events,this.contextGl=xn(this.$videoElement),!this.contextGl)throw this.player.debug.error("CommonCanvasLoader","_initContextGl() createContextGL error"),new Error("CommonCanvasLoader and _initContextGl createContextGL error");this._bindContextGlEvents(),this.webglRender=new rs(this.contextGl,this.player._opt.openWebglAlignment)}},{key:"_initContextGl2",value:function(){if(this.contextGl=Rn(this.$videoElement),this.contextGl){this._bindContextGlEvents(2);try{this.webglRender=new ps(this.$videoElement,this.contextGl)}catch(e){this.player.debug.error("CommonCanvasLoader","create webgl2Render error is ".concat(e," and next use context2d.draw render")),this.contextGl=null,this.webglRender=null,this._initContext2D()}}else this.player.debug.error("CommonCanvasLoader","_initContextGl2() createContextGL2 error")}},{key:"_bindContextGlEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=this.player.events.proxy,r=i(this.$videoElement,"webglcontextlost",(function(i){i.preventDefault(),e.player.debug.error("canvasVideo","webglcontextlost error",i),e.isWebglContextLost=!0,e.webglRender&&(e.player.debug.log("CommonCanvasLoader","webglcontextlost error and destroy webglRender"),e.webglRender.destroy(),e.webglRender=null),e.webglRectRender&&(e.player.debug.log("CommonCanvasLoader","webglcontextlost error and destroy webglRectRender"),e.webglRectRender.destroy(),e.webglRectRender=null),e.contextGl=null,setTimeout((function(){if(e.player.debug.log("CommonCanvasLoader","createContextGL() version ".concat(t)),1===t?e.contextGl=xn(e.$videoElement):2===t&&(e.contextGl=Rn(e.$videoElement)),e.player.debug.log("CommonCanvasLoader","createContextGL success"),e.contextGl&&e.contextGl.getContextAttributes){var i=e.contextGl.getContextAttributes();i&&i.stencil?(1===t?e.webglRender=new rs(e.contextGl,e.player._opt.openWebglAlignment):2===t&&(e.webglRender=new ps(e.$videoElement,e.contextGl)),e.isWebglContextLost=!1,e.player.debug.log("CommonCanvasLoader","webglcontextlost error reset and getContextAttributes().stencil is true")):(e.player.debug.error("CommonCanvasLoader","webglcontextlost error, getContextAttributes().stencil is false"),e.player.emitError(It.webglContextLostError))}else e.player.debug.error("CommonCanvasLoader","webglcontextlost error, getContextAttributes().stencil is false"),e.player.emitError(It.webglContextLostError)}),500)})),a=i(this.$videoElement,"webglcontextrestored",(function(t){t.preventDefault(),e.player.debug.log("CommonCanvasLoader","webglcontextrestored ",t)}));this.proxyDestroyList.push(r,a)}},{key:"_initContextGPU",value:function(){var t,i=this;(t=this.$videoElement,new Promise((function(e,i){navigator.gpu?navigator.gpu.requestAdapter().then((function(r){r?r.requestDevice().then((function(a){if(a){var n=t.getContext("webgpu");if(n){var o=navigator.gpu.getPreferredCanvasFormat();n.configure({device:a,format:o,alphaMode:"opaque"}),e({adapter:r,device:a,context:n,format:o})}else i('WebGPU "context" create fail')}else i('WebGPU "device" request fail')})).catch((function(e){i('WebGPU "adapter.requestDevice()" fail')})):i('WebGPU "adapter" request fail is empty')})).catch((function(e){i('WebGPU "navigator.gpu.requestAdapter()" fail')})):i("WebGPU not support!!")}))).then((function(t){t?(i.webGPURender=new as(t),i.player.debug.log("CommonCanvasLoader","webGPURender init success")):(i.player.debug.warn("CommonCanvasLoader","createWebGPUContext error is ".concat(e," and next use webgl render")),i.renderType=ki,i._initContextGl())})).catch((function(e){i.player.debug.warn("CommonCanvasLoader","createWebGPUContext error is ".concat(e," and next use webgl render")),i.renderType=ki,i._initContextGl()}))}},{key:"initCanvasViewSize",value:function(){this.$videoElement.width=this.videoInfo.width,this.$videoElement.height=this.videoInfo.height,this.resize()}},{key:"screenshot",value:function(e,t,i,r){e=e||Ln(),r=r||Ft.download;var a=.92;!fr[t]&&Ft[t]&&(r=t,t="png",i=void 0),"string"==typeof i&&(r=i,i=void 0),void 0!==i&&(a=Number(i));var n=fr[t]||fr.png,o=this.$videoElement.toDataURL(n,a);if(r===Ft.base64)return o;var s=Dn(o);if(r===Ft.blob)return s;if(r===Ft.download){var l=n.split("/")[1];hs(s,e+"."+l)}}},{key:"screenshotWatermark",value:function(e){var t=this;return new Promise((function(i,r){vo(e)&&(e={filename:e}),(e=e||{}).width=t.videoInfo.width,e.height=t.videoInfo.height,e.filename=e.filename||Ln(),e.format=e.format?fr[e.format]:fr.png,e.quality=Number(e.quality)||.92,e.type=e.type||Ft.download;var a=t.$videoElement.toDataURL(e.format,e.quality);lo(a,e).then((function(t){if(e.type===Ft.base64)i(a);else{var r=Dn(t);if(e.type===Ft.blob)i(r);else if(e.type===Ft.download){i();var n=e.format.split("/")[1];hs(r,e.filename+"."+n)}}})).catch((function(e){r(e)}))}))}},{key:"render",value:function(){}},{key:"clearView",value:function(){b(i,"clearView",this,3)([])}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"_resize",value:function(){this.player.debug.log("canvasVideo","_resize()");var e=this.player._opt,t=this.player.width,i=this.player.height;if(e.hasControl&&!e.controlAutoHide){var r=this.controlHeight;On()&&this.player.fullscreen&&e.useWebFullScreen?t-=r:i-=r}var a=this.$videoElement.width,n=this.$videoElement.height,o=e.rotate,s=(t-a)/2,l=(i-n)/2;270!==o&&90!==o||(a=this.$videoElement.height,n=this.$videoElement.width);var c=t/a,u=i/n,d=c>u?u:c;No(e.isResize)&&c!==u&&(d=c+","+u),e.isFullResize&&(d=c>u?c:u);var h="scale("+d+")";"none"===e.mirrorRotate&&o&&(h+=" rotate("+o+"deg)"),"level"===e.mirrorRotate?h+=" rotateY(180deg)":"vertical"===e.mirrorRotate&&(h+=" rotateX(180deg)"),this.$videoElement.style.height=this.videoInfo.height+"px",this.$videoElement.style.width=this.videoInfo.width+"px",this.$videoElement.style.padding="0",this.$videoElement.style.transform=h,this.$videoElement.style.left=s+"px",this.$videoElement.style.top=l+"px"}},{key:"initFps",value:function(){}},{key:"setStreamFps",value:function(e){}},{key:"getStreamFps",value:function(){return 25}},{key:"getType",value:function(){return he}},{key:"getCanvasType",value:function(){var e=this.renderType===Si?Si:ki;return this.isWcsWebgl2&&(e=wi),e}}])}(os),ms=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.yuvList=[],i.controlHeight=gi,i.tempTextCanvas=null,i.tempTextCanvasCtx=null,i.player.debug.log("CanvasVideo","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:b(t,"destroy",this,3)([]),this.yuvList=[],this.tempTextCanvas&&(this.tempTextCanvasCtx.clearRect(0,0,this.tempTextCanvas.width,this.tempTextCanvas.height),this.tempTextCanvas.width=0,this.tempTextCanvas.height=0,this.tempTextCanvas=null),this.player.debug.log("CanvasVideoLoader","destroy");case 1:case"end":return e.stop()}}),e,this)})));function i(){return e.apply(this,arguments)}return i}()},{key:"_initCanvasRender",value:function(){this.player._opt.useWCS&&!this._supportOffscreen()?(this.renderType=_i,Vo()&&this.player._opt.wcsUseWebgl2Render?(this._initContextGl2(),this.webglRender&&(this.isWcsWebgl2=!0)):this._initContext2D()):this.player._opt.useMSE&&this.player._opt.mseUseCanvasRender?(this.renderType=Ei,this._initContext2D()):this.player.isOldHls()&&this.player._opt.useCanvasRender?(this.renderType=Ci,this._initContext2D()):this.player.isWebrtcH264()&&this.player._opt.webrtcUseCanvasRender?(this.renderType=xi,this._initContext2D()):this._supportOffscreen()?(this.renderType=Ti,this._bindOffscreen()):this.player._opt.useWebGPU?(this.renderType=Si,this._initContextGPU()):(this.renderType=ki,this._initContextGl())}},{key:"_supportOffscreen",value:function(){return"function"==typeof this.$videoElement.transferControlToOffscreen&&this.player._opt.useOffscreen}},{key:"_bindOffscreen",value:function(){this.bitmaprenderer=this.$videoElement.getContext("bitmaprenderer")}},{key:"render",value:function(e){this.yuvList.push(e),this.startRender()}},{key:"startRender",value:function(){for(;!(this.yuvList.length<=0);){var e=this.yuvList.shift();this.doRender(e)}}},{key:"doRender",value:function(e){var t=this;if(this.renderType!==Ei){var i={ts:e.ts||0,fps:!0};this.player.updateStats(i)}switch(this.renderType){case Ti:this.bitmaprenderer.transferFromImageBitmap(e.buffer);break;case ki:case Si:if(this.isWebglContextLost)return void this.player.debug.warn("CanvasVideoLoader","doRender() and webgl context is lost");var r=e.output;if(this.player.faceDetectActive&&this.player.ai&&this.player.ai.faceDetector){null===this.prevAiFaceDetectTime&&(this.prevAiFaceDetectTime=Ln());var a=Ln();a-this.prevAiFaceDetectTime>=this.player._opt.aiFaceDetectInterval&&(r=this.player.ai.faceDetector.detect({width:this.$videoElement.width,height:this.$videoElement.height,data:e.output,ts:e.ts||0}),this.prevAiFaceDetectTime=a)}if(this.player.objectDetectActive&&this.player.ai&&this.player.ai.objectDetector){null===this.prevAiObjectDetectTime&&(this.prevAiObjectDetectTime=Ln());var n=Ln();n-this.prevAiObjectDetectTime>=this.player._opt.aiObjectDetectInterval&&(r=this.player.ai.objectDetector.detect({width:this.$videoElement.width,height:this.$videoElement.height,data:e.output,ts:e.ts||0}),this.prevAiObjectDetectTime=n)}if(this.player.occlusionDetectActive&&this.player.ai&&this.player.ai.occlusionDetector){null===this.prevAiOcclusionDetectTime&&(this.prevAiOcclusionDetectTime=Ln());var o=Ln();if(o-this.prevAiOcclusionDetectTime>=this.player._opt.aiOcclusionDetectInterval){var s=this.player.ai.occlusionDetector.check({width:this.$videoElement.width,height:this.$videoElement.height,data:e.output});this.prevAiOcclusionDetectTime=o,s&&this.player.emit(xt.aiOcclusionDetectResult,{ts:e.ts||0})}}if(this.player.imageDetectActive&&this.player.ai&&this.player.ai.imageDetector){var l=this.player.ai.imageDetector.check({width:this.$videoElement.width,height:this.$videoElement.height,data:e.output});if(l&&l.data&&(this.player.emit(xt.aiOcclusionDetectResult,{type:l.type,ts:e.ts||0}),this.player._opt.aiImageDetectDrop))return void this.player.debug.log("CanvasVideoLoader","doRender() and ai image detect result type is ".concat(l.type," and drop"))}if(this.renderType===Si)try{if(!this.webGPURender)return void this.player.debug.warn("CanvasVideoLoader","doRender webgpu render is not init");this.webGPURender.renderYUV(this.$videoElement.width,this.$videoElement.height,r)}catch(e){this.player.debug.error("CanvasVideoLoader","doRender webgpu render and error: ".concat(e.toString()))}else if(this.renderType===ki)try{this.webglRender.renderYUV(this.$videoElement.width,this.$videoElement.height,r)}catch(e){this.player.debug.error("CanvasVideoLoader","doRender webgl render context is lost ".concat(this.contextGl&&this.contextGl.isContextLost()," and error: ").concat(e.toString()))}break;case _i:if(this.webglRender)this.webglRender.render(e.videoFrame),xo(e.videoFrame);else if(this.context2D)if(wo(e.videoFrame.createImageBitmap))try{e.videoFrame.createImageBitmap().then((function(i){t.context2D.drawImage(i,0,0,t.$videoElement.width,t.$videoElement.height),xo(e.videoFrame)}))}catch(e){}else this.context2D.drawImage(e.videoFrame,0,0,this.$videoElement.width,this.$videoElement.height),xo(e.videoFrame);else this.player.debug.warn("CanvasVideoLoader","doRender() and webcodecs context is lost");break;case Ei:case Ci:case xi:this.context2D.drawImage(e.$video,0,0,this.$videoElement.width,this.$videoElement.height)}var c=e.ts||0;this.renderType===Ei&&(c=parseInt(1e3*e.$video.currentTime,10)+(this.player.mseDecoder.firstRenderTime||0)),this.player.updateCurrentPts(c),this.doAddContentToWatermark(),this.doAddAiContentToWatermark()}},{key:"clearView",value:function(){var e=this;switch(b(t,"clearView",this,3)([]),this.renderType){case Ti:(function(e,t){var i=document.createElement("canvas");i.width=e,i.height=t;var r=window.createImageBitmap(i,0,0,e,t);return i.width=0,i.height=0,r})(this.$videoElement.width,this.$videoElement.height).then((function(t){e.bitmaprenderer.transferFromImageBitmap(t)}));break;case ki:this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT);break;case Si:this.webGPURender.clear();break;case _i:this.contextGl?this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT):this.context2D&&this.context2D.clearRect(0,0,this.$videoElement.width,this.$videoElement.height);break;case Ei:case Ci:case xi:this.context2D.clearRect(0,0,this.$videoElement.width,this.$videoElement.height)}}},{key:"_initTempTextCanvas",value:function(){this.tempTextCanvas=document.createElement("canvas"),this.tempTextCanvasCtx=this.tempTextCanvas.getContext("2d"),this.tempTextCanvas.width=600,this.tempTextCanvas.height=20}},{key:"doAddContentToCanvas",value:function(){this.tempContentList.length>0&&this.context2D&&function(e){var t=e.ctx,i=e.list;t.save(),(i||[]).forEach((function(e){"text"===e.type?(t.font="".concat(e.fontSize||12,"px Arial"),t.fillStyle=e.color||"green",t.fillText(e.text,e.x,e.y)):"rect"===e.type&&(t.strokeStyle=e.color||"green",t.lineWidth=e.lineWidth||2,t.strokeRect(e.x,e.y,e.width,e.height))})),t.restore()}({ctx:this.context2D,list:this.tempContentList})}},{key:"doAddContentToWebGlCanvas",value:function(){var e=this;this.tempContentList.length>0&&this.contextGl&&this.webglRectRender&&this.tempContentList.forEach((function(t){var i,r=t.x,a=t.y;if("rect"===t.type){var n=t.width,o=t.height,s=(i=t.color||"#008000",[parseInt(i.substring(1,3),16)/255,parseInt(i.substring(3,5),16)/255,parseInt(i.substring(5,7),16)/255,1]),l=t.lineWidth||4;if(!n||!o)return;e.webglRectRender.drawBox({x:r,y:a,width:n,height:o,lineColor:s,lineWidth:l,canvasWidth:e.$videoElement.width,canvasHeight:e.$videoElement.height})}else if("text"===t.type){var c=t.text||"";if(!c)return;var u=t.fontSize||20,d=t.color||"#008000";e.tempTextCanvas||e._initTempTextCanvas(),e.tempTextCanvasCtx.clearRect(0,0,e.tempTextCanvas.width,e.tempTextCanvas.height),e.tempTextCanvasCtx.font="".concat(u,"px Arial"),e.tempTextCanvasCtx.fillStyle=d,e.tempTextCanvasCtx.textBaseline="top",e.tempTextCanvasCtx.fillText(c,0,0),e.webglRender.drawDom(e.$videoElement.width,e.$videoElement.height,r,a,e.tempTextCanvas)}}))}}])}(fs),gs=function(t){function i(e){var t;S(this,i),t=_(this,i),t.player=e,t.TAG_NAME="Video";var r=document.createElement("video"),a=document.createElement("canvas");r.muted=!0,r.style.position="absolute",r.style.top=0,r.style.left=0,t._delayPlay=!1,e.$container.appendChild(r),t.$videoElement=r,t.$canvasElement=a,t.canvasContext=a.getContext("2d"),t.mediaStream=null,t.vwriter=null,e.canVideoTrackWritter()&&eo()&&to()&&(t.trackGenerator=new MediaStreamTrackGenerator({kind:"video"}),t.mediaStream=new MediaStream([t.trackGenerator]),r.srcObject=t.mediaStream,t.vwriter=t.trackGenerator.writable.getWriter()),t.fixChromeVideoFlashBug(),t.fixMobileAutoFullscreen(),t.resize(),t.eventListenList=[],t.isRenderRetryPlaying=!1,t.isRenderRetryPlayingTimes=0,t.isRetryPlaying=!1,t.isRetryPlayingTimes=0,t.canplayReceived=!1,t.progressProxyDestroy=null,t.checkVideoCanplayTimeout=null;var n=qo();t.supportVideoFrameCallbackHandle=null;var o=t.player.events.proxy,s=o(t.$videoElement,"canplay",(function(){t.player.debug.log("Video","canplay"),t.player.isDestroyedOrClosed()||(t.canplayReceived=!0,t._delayPlay?(t.clearCheckVideoCanplayTimeout(),t._play(),qo()?t.supportVideoFrameCallbackHandle||(t.supportVideoFrameCallbackHandle=t.$videoElement.requestVideoFrameCallback(t.videoFrameCallback.bind(t))):t.player.debug.warn("Video","not support requestVideoFrameCallback and use timeupdate event to update stats")):t.$videoElement.paused&&t.player.isMSEPlaybackRateChangePause&&(t.player.debug.log("Video","canplay and video is paused and isMSEPlaybackRateChangePause is ".concat(t.player.isMSEPlaybackRateChangePause," so next try to play")),t.player.isMSEPlaybackRateChangePause=!1,t.$videoElement.play()))})),l=o(t.$videoElement,"waiting",(function(){t.player.debug.log("Video","waiting")})),c=o(t.$videoElement,"loadedmetadata",(function(){t.player.debug.log("Video","loadedmetadata")})),u=o(t.$videoElement,"timeupdate",(function(i){if(!t.player.isDestroyedOrClosed()){if(No(n)){var r=parseInt(1e3*t.getCurrentTime(),10);(e.isWebrtcH264()||t.player.isOldHls()||t.player.isAliyunRtc())&&(t.player.emit(xt.timeUpdate,r),e.handleRender(),e.updateStats({fps:!0,ts:r,dts:r}))}t.player.isMseDecoderUseWorker()&&(t.player.decoderWorker.updateVideoTimestamp(t.getCurrentTime()),t._handleUpdatePlaybackRate())}})),d=o(t.$videoElement,"error",(function(){var e={};if(t.player.isUseMSE()&&(e=t.player.getMseMineType()),t.player.debug.error("Video","Error Code "+t.$videoElement.error.code+" "+Fa[t.$videoElement.error.code]+"; Details: "+t.$videoElement.error.message+"; Video Info: "+JSON.stringify(t.videoInfo)+"; Mse Mine Type: "+e.video+"; "),t.player.isUseMSE()){t.$videoElement.error.code;var i=t.$videoElement.error.message;-1!==i.indexOf(Oa)&&(t.player.isMSEVideoDecoderInitializationFailedNotSupportHevc=!0),-1!==i.indexOf(Na)&&(t.player.isMSEAudioDecoderError=!0)}t.player.isHlsCanVideoPlay()})),h=o(t.$videoElement,"stalled",(function(){t._detectAndFixStuckPlayback(!0)}));if(t.progressProxyDestroy=o(t.$videoElement,"progress",(function(){t._detectAndFixStuckPlayback()})),t.eventListenList.push(s,l,u,d,c,h),t.player.isUseMSE()){var p=o(t.$videoElement,Sr,(function(){t.player.debug.log(t.TAG_NAME,"video playback Rate change",t.$videoElement&&t.$videoElement.playbackRate),t.$videoElement&&t.$videoElement.paused&&(t.player.debug.warn(t.TAG_NAME,"ratechange and video is paused and sent isMSEPlaybackRateChangePause true"),t.player.isMSEPlaybackRateChangePause=!0)}));t.eventListenList.push(p),t.player.on(xt.visibilityChange,(function(e){e&&setTimeout((function(){if(t.player.isPlaying()&&t.$videoElement){var e=t.getVideoBufferLastTime();e-t.$videoElement.currentTime>t.getBufferMaxDelayTime()&&(t.player.debug.log(t.TAG_NAME,"visibilityChange is true and lastTime is ".concat(e," and currentTime is ").concat(t.$videoElement.currentTime," so set currentTime to lastTime")),t.$videoElement.currentTime=e)}}),300)}))}return t.player.debug.log("Video","init"),t}return k(i,t),T(i,[{key:"destroy",value:function(){var t=A(v().mark((function t(){var r;return v().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(b(i,"destroy",this,3)([]),this.clearCheckVideoCanplayTimeout(),this._cancelVideoFrameCallback(),this._removeProgressProxyDestroy(),this.eventListenList.length&&(this.eventListenList.forEach((function(e){e()})),this.eventListenList=[]),this.isRenderRetryPlaying=!1,this.isRenderRetryPlayingTimes=0,this.isRetryPlaying=!1,this.isRetryPlayingTimes=0,this.canplayReceived=!1,this.player._opt.videoRenderSupportScale&&this._isNeedAddBackDropFilter()&&(r=this.player.$container,r.style.backdropFilter="none",r.style.transform="none"),this.$canvasElement.height=0,this.$canvasElement.width=0,this.$canvasElement=null,this.canvasContext=null,this.$videoElement){this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.srcObject&&(this.$videoElement.srcObject=null,this.$videoElement.removeAttribute("srcObject")),this.$videoElement.src&&(this.$videoElement.src="",this.$videoElement.removeAttribute("src"));try{this.$videoElement.load()}catch(e){}this.player.$container.removeChild(this.$videoElement),this.$videoElement=null}if(this.trackGenerator&&(this.trackGenerator.stop(),this.trackGenerator=null),t.t0=this.vwriter,!t.t0){t.next=8;break}return t.next=7,this.vwriter.close();case 7:this.vwriter=null;case 8:this._delayPlay=!1,this.mediaStream&&(this.mediaStream.getTracks().forEach((function(e){return e.stop()})),this.mediaStream=null),this.off(),this.player.debug.log("Video","destroy");case 12:case"end":return t.stop()}}),t,this)})));function r(){return t.apply(this,arguments)}return r}()},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.player.isDestroyedOrClosed())this.player.debug.log("Video","videoFrameCallback() and isDestroyedOrClosed and return");else{this.player.handleRender();var i=parseInt(1e3*Math.max(t.mediaTime,this.getCurrentTime()),10)||0;if(this.player.isUseHls265UseMse())this.player.updateStats({fps:!0,ts:i});else if(this.player.isMseDecoderUseWorker()){this.player._times.videoStart||(this.player._times.videoStart=Ln(),this.player.handlePlayToRenderTimes());var r=i+(this.player._mseWorkerData.firstRenderTime||0);if(this.player.updateStats({fps:!0,dfps:!0,ts:r,mseTs:i}),this.player.emit(xt.timeUpdate,r),No(this.getHasInit())&&t.width&&t.height){var a={width:t.width,height:t.height};this.updateVideoInfo(a),this.initCanvasViewSize()}}if(this.player.isWebrtcH264()||this.player.isOldHls()||this.player.isAliyunRtc()){if(this.player.emit(xt.timeUpdate,i),No(this.getHasInit())&&t.width&&t.height){var n={width:t.width,height:t.height};this.videoInfo.encTypeCode||this.player.isOldHls()||(n.encTypeCode=Gt),this.updateVideoInfo(n)}this.player.updateStats({fps:!0,ts:i,dts:i}),this.player.updateCurrentPts(i),this.doAddContentToWatermark()}else if(Oo(this.player._opt.useMSE)&&No(this.player._opt.mseUseCanvasRender)){if(this.player.mseDecoder){var o=parseInt(1e3*Math.max(t.mediaTime,this.getCurrentTime()),10)+(this.player.mseDecoder.firstRenderTime||0);this.player.updateCurrentPts(o)}else if(this.player._opt.mseDecoderUseWorker){var s=parseInt(1e3*Math.max(t.mediaTime,this.getCurrentTime()),10)+(this.player._mseWorkerData.firstRenderTime||0);this.player.updateCurrentPts(s)}this.doAddContentToWatermark()}this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this))}}},{key:"fixChromeVideoFlashBug",value:function(){if(this.player._opt.videoRenderSupportScale&&this._isNeedAddBackDropFilter()){var e=this.player.$container;e.style.backdropFilter="blur(0px)",e.style.transform="translateZ(0)"}}},{key:"fixMobileAutoFullscreen",value:function(){var e=Hn(),t=jn();(e||t)&&(this.player.debug.log("Video","fixMobileAutoFullscreen and isIOS ".concat(e," and isAndroid ").concat(t)),this.$videoElement.setAttribute("webkit-playsinline","true"),this.$videoElement.setAttribute("playsinline","true"),this.$videoElement.setAttribute("x5-video-player-type","h5-page"))}},{key:"_detectAndFixStuckPlayback",value:function(e){var t=this.$videoElement,i=t.buffered,r=t.readyState;this.player.debug.log(this.TAG_NAME,"_detectAndFixStuckPlayback() and isStalled is ".concat(e," ,canplayReceived is ").concat(this.canplayReceived," ,videoReadyState is ").concat(r)),e||No(this.canplayReceived)||r<2?i.length>0&&t.currentTime=3)return void(this.player.isWebrtcH264()?(this.player.debug.error("Video","_replay(webrtc H264) then but not playing and retry play times is ".concat(this.isRetryPlayingTimes," and emit error")),this.player.emitError(It.videoElementPlayingFailedForWebrtc)):(this.player.debug.error("Video","_replay then but not playing and retry play times is ".concat(this.isRetryPlayingTimes," and emit error to use canvas render")),this.player.emitError(It.videoElementPlayingFailed)));this.player.debug.warn("Video","_play then but not playing and retry play and isRetryPlayingTimes is ".concat(this.isRetryPlayingTimes)),this._play(),this.isRetryPlayingTimes++}else this.player.debug.log("Video","_replay() and isPlaying is ".concat(this.isPlaying()," and isRetryPlaying is ").concat(this.isRetryPlaying," and isDestroyedOrClosed is ").concat(this.player.isDestroyedOrClosed()," and return;"))}},{key:"pause",value:function(e){var t=this;this.player.debug.log(this.TAG_NAME,"pause and isNow is "+e),this.isPlaying()&&(e?(this.$videoElement&&this.$videoElement.pause(),this._cancelVideoFrameCallback()):setTimeout((function(){t.$videoElement&&t.$videoElement.pause(),t._cancelVideoFrameCallback()}),100))}},{key:"clearView",value:function(){b(i,"clearView",this,3)([]),this.$videoElement&&(this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.src&&(this.$videoElement.src="",this.$videoElement.removeAttribute("src")),this.$videoElement.srcObject&&(this.$videoElement.srcObject=null,this.$videoElement.removeAttribute("srcObject")))}},{key:"screenshot",value:function(e,t,i,r){if(!this._canScreenshot())return this.player.debug.warn("Video","screenshot failed, video is not ready and stats is ".concat(this._getVideoReadyState())),null;e=e||Ln(),r=r||Ft.download;var a=.92;!fr[t]&&Ft[t]&&(r=t,t="png",i=void 0),"string"==typeof i&&(r=i,i=void 0),void 0!==i&&(a=Number(i));var n=this.$videoElement,o=this.$canvasElement;o.width=n.videoWidth,o.height=n.videoHeight,this.canvasContext.drawImage(n,0,0,o.width,o.height);var s=fr[t]||fr.png,l=o.toDataURL(s,a);if(this.canvasContext.clearRect(0,0,o.width,o.height),o.width=0,o.height=0,r===Ft.base64)return l;var c=Dn(l);if(r===Ft.blob)return c;if(r===Ft.download){var u=s.split("/")[1];hs(c,e+"."+u)}}},{key:"screenshotWatermark",value:function(e){var t=this;return new Promise((function(i,r){if(vo(e)&&(e={filename:e}),!t._canScreenshot())return t.player.debug.warn("Video","screenshot failed, video is not ready"),r("screenshot failed, video is not ready");var a=t.$videoElement;(e=e||{}).width=a.videoWidth,e.height=a.videoHeight,e.filename=e.filename||Ln(),e.format=e.format?fr[e.format]:fr.png,e.quality=Number(e.quality)||.92,e.type=e.type||Ft.download;var n=t.$canvasElement;n.width=a.videoWidth,n.height=a.videoHeight,t.canvasContext.drawImage(a,0,0,n.width,n.height);var o=n.toDataURL(e.format,e.quality);t.canvasContext.clearRect(0,0,n.width,n.height),n.width=0,n.height=0,lo(o,e).then((function(t){if(e.type===Ft.base64)i(o);else{var r=Dn(t);if(e.type===Ft.blob)i(r);else if(e.type===Ft.download){i();var a=e.format.split("/")[1];hs(r,e.filename+"."+a)}}})).catch((function(e){r(e)}))}))}},{key:"initCanvasViewSize",value:function(){this.resize()}},{key:"clear",value:function(){var e=this.$videoElement,t=e.buffered,i=t.length?t.end(t.length-1):0;e.currentTime=i}},{key:"render",value:function(e){var t,i,r=this;if(this.vwriter){if(this.$videoElement.srcObject||(this.$videoElement.srcObject=this.mediaStream),this.isPaused()){var a=this._getVideoReadyState();if(this.player.debug.warn("Video","render() error, video is paused and readyState is "+a),4===a&&No(this.isRenderRetryPlaying)){if(this.isRenderRetryPlaying=!0,this.isRenderRetryPlayingTimes>3)return this.player.debug.error("Video","render() error, video is paused and readyState is "+a+", retry times is "+this.isRenderRetryPlayingTimes+", emit error and use canvas render"),void this.player.emitError(It.videoElementPlayingFailed);this.$videoElement.play().then((function(){r.isRenderRetryPlayingTimes=0,r.isRenderRetryPlaying=!1,r.player.debug.log("Video","render() video is paused and replay success")})).catch((function(e){r.isRenderRetryPlaying=!1,r.isRenderRetryPlayingTimes++,r.player.debug.warn("Video","render() error, video is paused and replay error ",e)}))}}if(this.player.updateStats({fps:!0,ts:e.ts||0}),e.videoFrame)this.vwriter.write(e.videoFrame),xo(e.videoFrame);else if(e.output){var n=e.output;if(this.player.faceDetectActive&&this.player.ai&&this.player.ai.faceDetector){null===this.prevAiFaceDetectTime&&(this.prevAiFaceDetectTime=Ln());var o=Ln();o-this.prevAiFaceDetectTime>this.player._opt.aiFaceDetectInterval&&(n=this.player.ai.faceDetector.detect({width:this.videoInfo.width,height:this.videoInfo.height,data:e.output,ts:e.ts||0}),this.prevAiFaceDetectTime=o)}if(this.player.objectDetectActive&&this.player.ai&&this.player.ai.objectDetector){null===this.prevAiObjectDetectTime&&(this.prevAiObjectDetectTime=Ln());var s=Ln();s-this.prevAiObjectDetectTime>this.player._opt.aiObjectDetectInterval&&(n=this.player.ai.objectDetector.detect({width:this.videoInfo.width,height:this.videoInfo.height,data:e.output,ts:e.ts||0}),this.prevAiObjectDetectTime=s)}if(this.player.occlusionDetectActive&&this.player.ai&&this.player.ai.occlusionDetector){null===this.prevAiOcclusionDetectTime&&(this.prevAiOcclusionDetectTime=Ln());var l=Ln();if(l-this.prevAiOcclusionDetectTime>=this.player._opt.aiOcclusionDetectInterval){var c=this.player.ai.occlusionDetector.check({width:this.videoInfo.width,height:this.videoInfo.height,data:e.output,ts:e.ts||0});this.prevAiOcclusionDetectTime=l,c&&(this.player.debug.log("Video","render() and ai occlusion detect result is true"),this.player.emit(xt.aiOcclusionDetectResult,{ts:e.ts||0}))}}if(this.player.imageDetectActive&&this.player.ai&&this.player.ai.imageDetector){var u=this.player.ai.imageDetector.check({width:this.videoInfo.width,height:this.videoInfo.height,data:e.output,ts:e.ts||0});if(u&&u.data&&(this.player.emit(xt.aiOcclusionDetectResult,{type:u.type,ts:e.ts||0}),this.player._opt.aiImageDetectDrop))return void this.player.debug.log("Video","render() and ai image detect result type is ".concat(u.type," and drop"))}try{var d=(t=n,i={format:"I420",codedWidth:this.videoInfo.width,codedHeight:this.videoInfo.height,timestamp:e.ts},new VideoFrame(t,i));this.vwriter.write(d),xo(d)}catch(e){this.player.debug.error("Video","render error",e),this.player.emitError(It.wasmUseVideoRenderError,e)}}this.player.updateCurrentPts(e.ts||0),this.doAddContentToWatermark(),this.doAddAiContentToWatermark()}else this.player.debug.warn("Video","render and this.vwriter is null")}},{key:"_resize",value:function(){this.player.debug.log("Video","_resize()");var e=this.player.width,t=this.player.height,i=this.player._opt,r=i.rotate;if(i.hasControl&&!i.controlAutoHide){var a=i.playType===z?yi:gi;On()&&this.player.fullscreen&&i.useWebFullScreen?e-=a:t-=a}this.$videoElement.width=e,this.$videoElement.height=t,this.$videoElement.style.width=e+"px",this.$videoElement.style.height=t+"px",270!==r&&90!==r||(this.$videoElement.width=t,this.$videoElement.height=e,this.$videoElement.style.width=t+"px",this.$videoElement.style.height=e+"px");var n=(e-this.$videoElement.width)/2,o=(t-this.$videoElement.height)/2,s="contain";No(i.isResize)&&(s="fill"),i.isFullResize&&(s="none");var l="";"none"===i.mirrorRotate&&r&&(l+=" rotate("+r+"deg)"),"level"===i.mirrorRotate?l+=" rotateY(180deg)":"vertical"===i.mirrorRotate&&(l+=" rotateX(180deg)"),this.player._opt.videoRenderSupportScale&&(this.$videoElement.style.objectFit=s),this.$videoElement.style.transform=l,this.$videoElement.style.padding="0",this.$videoElement.style.left=n+"px",this.$videoElement.style.top=o+"px"}},{key:"getType",value:function(){return pe}},{key:"getCurrentTime",value:function(){return this.$videoElement.currentTime}},{key:"isPlaying",value:function(){return this.$videoElement&&No(this.$videoElement.paused)&&No(this.$videoElement.ended)&&0!==this.$videoElement.playbackRate&&0!==this.$videoElement.readyState}},{key:"_canScreenshot",value:function(){return this.$videoElement&&this.$videoElement.readyState>=1}},{key:"getPlaybackQuality",value:function(){var e=null;if(this.$videoElement){if(wo(this.$videoElement.getVideoPlaybackQuality)){var t=this.$videoElement.getVideoPlaybackQuality();e={droppedVideoFrames:t.droppedVideoFrames||t.corruptedVideoFrames,totalVideoFrames:t.totalVideoFrames,creationTime:t.creationTime}}else e={droppedVideoFrames:this.$videoElement.webkitDroppedFrameCount,totalVideoFrames:this.$videoElement.webkitDecodedFrameCount,creationTime:Ln()};e&&(e.renderedVideoFrames=e.totalVideoFrames-e.droppedVideoFrames)}return e}},{key:"setRate",value:function(e){this.$videoElement&&(this.$videoElement.playbackRate=e)}},{key:"rate",get:function(){var e=1;return this.$videoElement&&(e=this.$videoElement.playbackRate),e}},{key:"clearCheckVideoCanplayTimeout",value:function(){this.checkVideoCanplayTimeout&&(clearTimeout(this.checkVideoCanplayTimeout),this.checkVideoCanplayTimeout=null)}},{key:"_cancelVideoFrameCallback",value:function(){this.supportVideoFrameCallbackHandle&&this.$videoElement&&(this.$videoElement.cancelVideoFrameCallback(this.supportVideoFrameCallbackHandle),this.supportVideoFrameCallbackHandle=null)}},{key:"_getBufferStore",value:function(){var e=this.$videoElement,t=0;return e.buffered.length>0&&(t=e.buffered.start(0)),t}},{key:"_handleUpdatePlaybackRate",value:function(){var e=this.$videoElement,t=e.buffered;t.length&&t.start(0);var i=t.length?t.end(t.length-1):0,r=e.currentTime,a=i-r,n=this.getBufferMaxDelayTime();if(this.player.updateStats({mseVideoBufferDelayTime:a}),a>n)this.player.debug.log(this.TAG_NAME,"handleUpdatePlaybackRate and buffered is ".concat(i," and current is ").concat(r," , delay buffer is more than ").concat(n," is ").concat(a," and new time is ").concat(i)),e.currentTime=i,r=e.currentTime;else if(a<0){if(this.player.debug.warn(this.TAG_NAME,"handleUpdatePlaybackRate and delay buffer is ".concat(i," - current is ").concat(r," = ").concat(a," < 0 and check video is paused : ").concat(e.paused," ")),0===i)return void this.player.emit(It.mediaSourceBufferedIsZeroError,"video.buffered is empty");e.paused&&e.play()}var o=this._getPlaybackRate(i-r);e.playbackRate!==o&&(this.player.debug.log(this.TAG_NAME,"handleUpdatePlaybackRate and buffered is ".concat(i," and current time is ").concat(r," and delay is ").concat(i-r," set playbackRate is ").concat(o," ")),e.playbackRate=o)}},{key:"_getPlaybackRate",value:function(e){var t=this.$videoElement,i=this.player._opt.videoBufferDelay+this.player._opt.videoBuffer,r=Math.max(i,1e3),a=r/2;return e*=1e3,1===t.playbackRate?e>r?1.2:1:e<=a?1:t.playbackRate}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.currentTime),e}},{key:"getVideoBufferLastTime",value:function(){var e=this.$videoElement,t=0;if(e){var i=e.buffered;i.length&&i.start(0),t=i.length?i.end(i.length-1):0}return t}},{key:"getVideoBufferDelayTime",value:function(){var e=this.$videoElement,t=this.getVideoBufferLastTime()-e.currentTime;return t>0?t:0}},{key:"checkSourceBufferDelay",value:function(){var e=this.$videoElement,t=0,i=0;return e.buffered.length>0&&(i=e.buffered.end(e.buffered.length-1),t=i-e.currentTime),t<0&&(this.player.debug.warn(this.TAG_NAME,"checkVideoSourceBufferDelay ".concat(t," < 0, and buffered is ").concat(i," ,currentTime is ").concat(e.currentTime," , try to seek ").concat(e.currentTime," to ").concat(i)),e.currentTime=i,t=0),t}},{key:"checkSourceBufferStore",value:function(){var e=this.$videoElement,t=0;return e.buffered.length>0&&(t=e.currentTime-e.buffered.start(0)),t}},{key:"getDecodePlaybackRate",value:function(){var e=0,t=this.$videoElement;return t&&(e=t.playbackRate),e}},{key:"getBufferMaxDelayTime",value:function(){var e=(this.player._opt.videoBuffer+this.player._opt.videoBufferDelay)/1e3;return Math.max(5,e+3)}},{key:"getReadyStateInited",value:function(){return this._getVideoReadyState()>=1}}])}(os),ys=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.controlHeight=yi,i.bufferList=[],i.playing=!1,i.playInterval=null,i.fps=1,i.preFps=1,i.streamFps=0,i.playbackRate=1,i._firstTimestamp=null,i._renderFps=0,i._startfpsTime=null,i._startFpsTimestamp=null,i._hasCalcFps=!1,i.player.on(xt.playbackPause,(function(e){e?(i.pause(),i.player.playback.isPlaybackPauseClearCache&&i.clear()):i.resume()})),i.player.debug.log("CanvasPlaybackLoader","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._stopSync(),this._firstTimestamp=null,this.playing=!1,this.playbackRate=1,this.fps=1,this.preFps=1,this.bufferList=[],this._renderFps=0,this._startfpsTime=null,this._startFpsTimestamp=null,this._hasCalcFps=!1,b(t,"destroy",this,3)([]),this.player.debug.log("CanvasPlaybackLoader","destroy");case 1:case"end":return e.stop()}}),e,this)})));function i(){return e.apply(this,arguments)}return i}()},{key:"_initCanvasRender",value:function(){this.player._opt.useWCS?(this.renderType=_i,Vo()&&this.player._opt.wcsUseWebgl2Render?(this._initContextGl2(),this.webglRender&&(this.isWcsWebgl2=!0)):this._initContext2D()):this.player._opt.useWebGPU?(this.renderType=Si,this._initContextGPU()):(this.renderType=ki,this._initContextGl())}},{key:"_sync",value:function(){var e=this;this._stopSync(),this._doPlay(),this.playInterval=setInterval((function(){e._doPlay()}),this.fragDuration)}},{key:"_doPlay",value:function(){if(this.bufferList.length>0&&!this.player.seeking){var e=this.bufferList.shift();e&&e.buffer&&(this._doRender(e.buffer),this.player.handleRender(),this.player.playback.updateStats({ts:e.ts,tfTs:e.tfTs}))}}},{key:"_stopSync",value:function(){this.playInterval&&(clearInterval(this.playInterval),this.playInterval=null)}},{key:"_doRender",value:function(e){var t=this;if(this.player._opt.useWCS)if(this.webglRender)this.webglRender.render(e),xo(e);else if(wo(e.createImageBitmap))try{e.createImageBitmap().then((function(i){t.context2D.drawImage(i,0,0,t.$videoElement.width,t.$videoElement.height),xo(e)}))}catch(e){}else this.context2D.drawImage(e,0,0,this.$videoElement.width,this.$videoElement.height),xo(e);else if(this.getCanvasType()===ki)try{this.webglRender.renderYUV(this.$videoElement.width,this.$videoElement.height,e)}catch(e){this.player.debug.error("CanvasPlaybackLoader","doRender webgl render context is lost ".concat(this.contextGl&&this.contextGl.isContextLost()," and error: ").concat(e.toString()))}else if(this.getCanvasType()===Si)try{if(!this.webGPURender)return void this.player.debug.warn("CanvasVideoLoader","doRender webgpu render is not init");this.webGPURender.renderYUV(this.$videoElement.width,this.$videoElement.height,e)}catch(e){this.player.debug.error("CanvasPlaybackLoader","doRender webgpu render and error: ".concat(e.toString()))}}},{key:"rate",get:function(){return this.playbackRate}},{key:"fragDuration",get:function(){return Math.ceil(1e3/(this.fps*this.playbackRate))}},{key:"bufferSize",get:function(){return this.bufferList.length}},{key:"getStreamFps",value:function(){return this.streamFps}},{key:"initFps",value:function(){this._hasCalcFps?this.player.debug.log("CanvasPlaybackLoader","initFps, has calc fps"):(this.preFps=In(this.player.playback.fps,1,100),this.fps=this.preFps)}},{key:"setFps",value:function(e){e!==this.fps?(e>100&&this.player.debug.warn("CanvasPlaybackLoader","setFps max",e),e<0&&this.player.debug.warn("CanvasPlaybackLoader","setFps min",e),this.fps=In(e,1,100),this.player.debug.log("CanvasPlaybackLoader","setFps ".concat(this.preFps," -> ").concat(this.fps)),this.player.playback.isUseFpsRender&&this._sync()):this.player.debug.log("CanvasPlaybackLoader","setFps, same fps ".concat(e))}},{key:"setStreamFps",value:function(e){this.player.debug.log("CanvasPlaybackLoader","setStreamFps",e),this._hasCalcFps=!0,this.streamFps=e,this.preFps=e,this.setFps(e)}},{key:"setRate",value:function(e){e!==this.playbackRate&&(this.playbackRate=e,this.player.playback.isUseFpsRender&&this._sync())}},{key:"render$2",value:function(e){null===this._firstTimestamp&&(this._firstTimestamp=e.ts);var t={tfTs:e.ts-this._firstTimestamp,ts:e.ts};e.videoFrame?t.buffer=e.videoFrame:t.buffer=e.output,this.bufferList.push(t),this.startRender(),this.player.handleRender(),this.player.playback.updateStats({ts:e.ts,tfTs:t.tfTs})}},{key:"startRender",value:function(){for(;!(this.bufferList.length<=0);){var e=this.bufferList.shift();this._doRender(e.buffer)}}},{key:"pushData",value:function(e){null===this._firstTimestamp&&(this._firstTimestamp=e.ts);var t={tfTs:e.ts-this._firstTimestamp,ts:e.ts};e.videoFrame?t.buffer=e.videoFrame:t.buffer=e.output;var i=this.player._opt.playbackConfig.isCacheBeforeDecodeForFpsRender;if(i||this.bufferSize>this.fps*this.playbackRate*2&&(this.player.debug.warn("CanvasPlaybackLoader","buffer size is ".concat(this.bufferSize)),this._doPlay()),this.bufferList.push(t),!this._hasCalcFps){var r=Lo(this.bufferList);null!==r&&r!==this.preFps&&(this.player.debug.log("CanvasPlaybackLoader","calc fps is ".concat(r," pre fps is ").concat(this.preFps," and updatePreFps")),this.setStreamFps(r))}if(!i){var a=this.bufferList.length,n=a/(this.fps*this.playbackRate);this.player.debug.log("CanvasPlaybackLoader","rate is",n),n<=1?this.setFps(this.preFps):(this.setFps(this.fps+Math.floor(n*this.playbackRate)),this.player.debug.warn("CanvasPlaybackLoader","rate is",n,"fps is",this.fps,"bufferListLength is",a))}}},{key:"initVideo",value:function(){this.player.playback&&this.player.playback.isUseFpsRender&&this._sync(),this.playing=!0}},{key:"initVideoDelay",value:function(){var e=this,t=this.player._opt.playbackDelayTime;t>0?this.delayTimeout=setTimeout((function(){e.initVideo()}),t):this.initVideo()}},{key:"clearView",value:function(){b(t,"clearView",this,3)([]),this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT)}},{key:"clear",value:function(){this.player._opt.useWCS&&this.bufferList.forEach((function(e){e.buffer&&xo(e.buffer)})),this.bufferList=[]}},{key:"resume",value:function(){this.player.playback.isUseFpsRender&&this._sync(),this.playing=!0}},{key:"pause",value:function(){this.player.playback.isUseFpsRender&&this._stopSync(),this.playing=!1}}])}(fs),vs=function(){function e(t){return S(this,e),new(e.getLoaderFactory(t._opt))(t)}return T(e,null,[{key:"getLoaderFactory",value:function(e){return e.useMSE?e.mseUseCanvasRender?ms:gs:e.isHls&&No(e.supportHls265)||e.isWebrtc&&No(e.isWebrtcH265)?e.useCanvasRender?ms:gs:e.isAliyunRtc?gs:e.useWCS?e.playType===z?ys:!e.useOffscreen&&e.wcsUseVideoRender?gs:ms:e.playType===z?ys:e.wasmUseVideoRender&&!e.useOffscreen?gs:ms}}])}(),As=function(e){function t(e){var i;S(this,t),i=_(this,t),i.bufferList=[],i.player=e,i.$audio=null,i.scriptNode=null,i.workletProcessorNode=null,i.workletWorkerCloseTimeout=null,i.hasInitScriptNode=!1,i.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:48e3}),i.gainNode=i.audioContext.createGain();var r=i.audioContext.createBufferSource();return r.buffer=i.audioContext.createBuffer(1,1,22050),r.connect(i.audioContext.destination),r.noteOn?r.noteOn(0):r.start(0),i.audioBufferSourceNode=r,i.mediaStreamAudioDestinationNode=i.audioContext.createMediaStreamDestination(),i.gainNode.gain.value=0,i._prevVolume=null,i.playing=!1,i.audioInfo={encTypeCode:"",encType:"",channels:"",sampleRate:"",depth:""},i.init=!1,i.hasAudio=!1,i.audioResumeStateTimeout=null,i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.closeAudio(),this.resetInit(),this.clearAudioResumeStateTimeout(),e.t0=this.audioContext,!e.t0){e.next=8;break}return e.next=7,this.audioContext.close();case 7:this.audioContext=null;case 8:return this.gainNode&&(this.gainNode.disconnect(),this.gainNode=null),this.hasAudio=!1,this.playing=!1,this.scriptNode&&(this.scriptNode.disconnect(),this.scriptNode.onaudioprocess=Cn,this.scriptNode=null),e.next=14,this._destroyWorklet();case 14:return this.workletProcessorNode&&(this.workletProcessorNode.disconnect(),this.workletProcessorNode.port.onmessage=Cn,this.workletProcessorNode=null),this.audioBufferSourceNode&&(this.audioBufferSourceNode.stop(),this.audioBufferSourceNode=null),this.mediaStreamAudioDestinationNode&&(this.mediaStreamAudioDestinationNode.disconnect(),this.mediaStreamAudioDestinationNode=null),this.hasInitScriptNode=!1,this._prevVolume=null,this.off(),e.abrupt("return",!0);case 21:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_destroyWorklet",value:function(){var e=this;return new Promise((function(t,i){e.workletProcessorNode?(e.workletProcessorNode.port.postMessage({type:"destroy"}),e.workletWorkerCloseTimeout=setTimeout((function(){e.player.debug.log(e.TAG_NAME,"send close and wait 10ms destroy directly"),e.workletWorkerCloseTimeout&&(clearTimeout(e.workletWorkerCloseTimeout),e.workletWorkerCloseTimeout=null),t()}),10)):t()}))}},{key:"resetInit",value:function(){this.audioInfo={encTypeCode:"",encType:"",channels:"",sampleRate:"",depth:""},this.init=!1}},{key:"getAudioInfo",value:function(){return this.audioInfo}},{key:"updateAudioInfo",value:function(e){e.encTypeCode&&(this.audioInfo.encTypeCode=e.encTypeCode,this.audioInfo.encType=Kt[e.encTypeCode]),e.channels&&(this.audioInfo.channels=e.channels),e.sampleRate&&(this.audioInfo.sampleRate=e.sampleRate),e.depth&&(this.audioInfo.depth=e.depth),this.audioInfo.sampleRate&&this.audioInfo.channels&&this.audioInfo.encType&&!this.init&&(this.player.emit(xt.audioInfo,this.audioInfo),this.init=!0)}},{key:"isPlaying",get:function(){return this.playing}},{key:"isMute",get:function(){return 0===this.gainNode.gain.value}},{key:"volume",get:function(){return this.gainNode.gain.value}},{key:"bufferSize",get:function(){return this.bufferList.length}},{key:"audioContextState",get:function(){var e=null;return this.audioContext&&(e=this.audioContext.state),e}},{key:"initScriptNode",value:function(){}},{key:"initMobileScriptNode",value:function(){}},{key:"initWorkletScriptNode",value:function(){}},{key:"getEngineType",value:function(){return""}},{key:"mute",value:function(e){e?(this.setVolume(0),this.clear()):this.setVolume(this.player.lastVolume||.5)}},{key:"setVolume",value:function(e){e=parseFloat(e).toFixed(2),isNaN(e)||(this.audioEnabled(!0),e=In(e,0,1),null===this._prevVolume?this.player.emit(xt.mute,0===e):0===this._prevVolume&&e>0?this.player.emit(xt.mute,!1):this._prevVolume>0&&0===e&&this.player.emit(xt.mute,!0),this.gainNode.gain.value=e,this.player.emit(xt.volumechange,this.player.volume),this.player.emit(xt.volume,this.player.volume),this._prevVolume=e)}},{key:"closeAudio",value:function(){this.hasInitScriptNode&&(this.scriptNode&&this.scriptNode.disconnect(this.gainNode),this.workletProcessorNode&&this.workletProcessorNode.disconnect(this.gainNode),this.gainNode&&(this.gainNode.disconnect(this.mediaStreamAudioDestinationNode),this.$audio||this.gainNode.disconnect(this.audioContext.destination))),this.clear()}},{key:"audioEnabled",value:function(e){var t=this;e?this.isStateSuspended()&&(this.audioContext.resume().then((function(){t.player.emit(xt.audioResumeState,{state:t.audioContextState,isRunning:t.isStateRunning()})})),this.audioResumeStateTimeout=setTimeout((function(){t.clearAudioResumeStateTimeout(),t.isStateSuspended()&&t.player.emit(xt.audioResumeState,{state:t.audioContextState,isRunning:t.isStateRunning()})}),1e3)):this.isStateRunning()&&this.audioContext.suspend()}},{key:"isStateRunning",value:function(){return"running"===this.audioContextState}},{key:"isStateSuspended",value:function(){return"suspended"===this.audioContextState}},{key:"clearAudioResumeStateTimeout",value:function(){this.audioResumeStateTimeout&&(clearTimeout(this.audioResumeStateTimeout),this.audioResumeStateTimeout=null)}},{key:"clear",value:function(){this.bufferList=[]}},{key:"play",value:function(e,t){}},{key:"pause",value:function(){this.playing=!1}},{key:"resume",value:function(){this.playing=!0}},{key:"setRate",value:function(e){}},{key:"getAudioBufferSize",value:function(){return 0}}])}(s),bs=function(){function e(t,i,r,a){S(this,e),this.player=t,this.audio=i,this.channel=r,this.bufferSize=a}return T(e,[{key:"destroy",value:function(){this.buffer=null,this.channel=null}},{key:"extract",value:function(e,t){for(var i=this.provide(t),r=0;r=o){try{for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:0,r=2*(t=t||0);i>=0||(i=(e.length-r)/2);var a=2*i;this.ensureCapacity(i+this._frameCount);var n=this.endIndex;this.vector.set(e.subarray(r,r+a),n),this._frameCount+=i}},{key:"putBuffer",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=t||0,i>=0||(i=e.frameCount-t),this.putSamples(e.vector,e.position+t,i)}},{key:"receive",value:function(e){e>=0&&!(e>this._frameCount)||(e=this.frameCount),this._frameCount-=e,this._position+=e}},{key:"receiveSamples",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=2*t,r=this.startIndex;e.set(this._vector.subarray(r,r+i)),this.receive(t)}},{key:"extract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.startIndex+2*t,a=2*i;e.set(this._vector.subarray(r,r+a))}},{key:"ensureCapacity",value:function(){var e=parseInt(2*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0));if(this._vector.length0&&void 0!==arguments[0]?arguments[0]:0;this.ensureCapacity(this._frameCount+e)}},{key:"rewind",value:function(){this._position>0&&(this._vector.set(this._vector.subarray(this.startIndex,this.endIndex)),this._position=0)}}])}(),ks=function(){function e(t){S(this,e),t?(this._inputBuffer=new _s,this._outputBuffer=new _s):this._inputBuffer=this._outputBuffer=null}return T(e,[{key:"destroy",value:function(){this.clear(),this._outputBuffer&&(this._outputBuffer.destroy(),this._outputBuffer=null),this._inputBuffer&&(this._inputBuffer.destroy(),this._inputBuffer=null)}},{key:"inputBuffer",get:function(){return this._inputBuffer},set:function(e){this._inputBuffer=e}},{key:"outputBuffer",get:function(){return this._outputBuffer},set:function(e){this._outputBuffer=e}},{key:"clear",value:function(){this._inputBuffer.clear(),this._outputBuffer.clear()}}])}(),ws=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.reset(),i._rate=1,i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([])}},{key:"rate",set:function(e){this._rate=e}},{key:"reset",value:function(){this.slopeCount=0,this.prevSampleL=0,this.prevSampleR=0}},{key:"clone",value:function(){var e=new t;return e.rate=this._rate,e}},{key:"process",value:function(){var e=this._inputBuffer.frameCount;this._outputBuffer.ensureAdditionalCapacity(e/this._rate+1);var t=this.transpose(e);this._inputBuffer.receive(),this._outputBuffer.put(t)}},{key:"transpose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e)return 0;for(var t=this._inputBuffer.vector,i=this._inputBuffer.startIndex,r=this._outputBuffer.vector,a=this._outputBuffer.endIndex,n=0,o=0;this.slopeCount<1;)r[a+2*o]=(1-this.slopeCount)*this.prevSampleL+this.slopeCount*t[i],r[a+2*o+1]=(1-this.slopeCount)*this.prevSampleR+this.slopeCount*t[i+1],o+=1,this.slopeCount+=this._rate;if(this.slopeCount-=1,1!==e)e:for(;;){for(;this.slopeCount>1;)if(this.slopeCount-=1,n+=1,n>=e-1)break e;var s=i+2*n;r[a+2*o]=(1-this.slopeCount)*t[s]+this.slopeCount*t[s+2],r[a+2*o+1]=(1-this.slopeCount)*t[s+1]+this.slopeCount*t[s+3],o+=1,this.slopeCount+=this._rate}return this.prevSampleL=t[i+2*e-2],this.prevSampleR=t[i+2*e-1],o}}])}(ks),Ss=function(){function e(t){S(this,e),this._pipe=t}return T(e,[{key:"destroy",value:function(){}},{key:"pipe",get:function(){return this._pipe}},{key:"inputBuffer",get:function(){return this._pipe.inputBuffer}},{key:"outputBuffer",get:function(){return this._pipe.outputBuffer}},{key:"fillInputBuffer",value:function(){throw new Error("fillInputBuffer() not overridden")}},{key:"fillOutputBuffer",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.outputBuffer.frameCount2&&void 0!==arguments[2]?arguments[2]:Ts;return r=_(this,t,[i]),r.callback=a,r.sourceSound=e,r.historyBufferSize=22050,r._sourcePosition=0,r.outputBufferPosition=0,r._position=0,r}return k(t,e),T(t,[{key:"destroy",value:function(){this.clear(),this.sourceSound.destroy(),this.sourceSound=null,this._sourcePosition=0,this.outputBufferPosition=0,this._position=0}},{key:"position",get:function(){return this._position},set:function(e){if(e>this._position)throw new RangeError("New position may not be greater than current position");var t=this.outputBufferPosition-(this._position-e);if(t<0)throw new RangeError("New position falls outside of history buffer");this.outputBufferPosition=t,this._position=e}},{key:"sourcePosition",get:function(){return this._sourcePosition},set:function(e){this.clear(),this._sourcePosition=e}},{key:"onEnd",value:function(){this.callback()}},{key:"fillInputBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=new Float32Array(2*e),i=this.sourceSound.extract(t,e,this._sourcePosition);this._sourcePosition+=i,this.inputBuffer.putSamples(t,0,i)}},{key:"extract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillOutputBuffer(this.outputBufferPosition+t);var i=Math.min(t,this.outputBuffer.frameCount-this.outputBufferPosition);this.outputBuffer.extract(e,this.outputBufferPosition,i);var r=this.outputBufferPosition+i;return this.outputBufferPosition=Math.min(this.historyBufferSize,r),this.outputBuffer.receive(Math.max(r-this.historyBufferSize,0)),this._position+=i,i}},{key:"handleSampleData",value:function(e){this.extract(e.data,4096)}},{key:"clear",value:function(){b(t,"clear",this,3)([]),this.outputBufferPosition=0}}])}(Ss),Cs=[[124,186,248,310,372,434,496,558,620,682,744,806,868,930,992,1054,1116,1178,1240,1302,1364,1426,1488,0],[-100,-75,-50,-25,25,50,75,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-20,-15,-10,-5,5,10,15,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-4,-3,-2,-1,1,2,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],xs=-10/1.5,Rs=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i._quickSeek=!0,i.midBufferDirty=!1,i.midBuffer=null,i.refMidBuffer=null,i.overlapLength=0,i.autoSeqSetting=!0,i.autoSeekSetting=!0,i._tempo=1,i.setParameters(44100,0,0,8),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.clear(),b(t,"destroy",this,3)([])}},{key:"clear",value:function(){b(t,"clear",this,3)([]),this.clearMidBuffer(),this.refMidBuffer=null}},{key:"clearMidBuffer",value:function(){this.midBufferDirty&&(this.midBufferDirty=!1),this.midBuffer=null}},{key:"setParameters",value:function(e,t,i,r){e>0&&(this.sampleRate=e),r>0&&(this.overlapMs=r),t>0?(this.sequenceMs=t,this.autoSeqSetting=!1):this.autoSeqSetting=!0,i>0?(this.seekWindowMs=i,this.autoSeekSetting=!1):this.autoSeekSetting=!0,this.calculateSequenceParameters(),this.calculateOverlapLength(this.overlapMs),this.tempo=this._tempo}},{key:"tempo",get:function(){return this._tempo},set:function(e){var t;this._tempo=e,this.calculateSequenceParameters(),this.nominalSkip=this._tempo*(this.seekWindowLength-this.overlapLength),this.skipFract=0,t=Math.floor(this.nominalSkip+.5),this.sampleReq=Math.max(t+this.overlapLength,this.seekWindowLength)+this.seekLength}},{key:"inputChunkSize",get:function(){return this.sampleReq}},{key:"outputChunkSize",get:function(){return this.overlapLength+Math.max(0,this.seekWindowLength-2*this.overlapLength)}},{key:"calculateOverlapLength",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e=this.sampleRate*t/1e3,e=e<16?16:e,e-=e%8,this.overlapLength=e,this.refMidBuffer=new Float32Array(2*this.overlapLength),this.midBuffer=new Float32Array(2*this.overlapLength)}},{key:"checkLimits",value:function(e,t,i){return ei?i:e}},{key:"calculateSequenceParameters",value:function(){var e,t;this.autoSeqSetting&&(e=150+-50*this._tempo,e=this.checkLimits(e,50,125),this.sequenceMs=Math.floor(e+.5)),this.autoSeekSetting&&(t=28.333333333333332+xs*this._tempo,t=this.checkLimits(t,15,25),this.seekWindowMs=Math.floor(t+.5)),this.seekWindowLength=Math.floor(this.sampleRate*this.sequenceMs/1e3),this.seekLength=Math.floor(this.sampleRate*this.seekWindowMs/1e3)}},{key:"quickSeek",set:function(e){this._quickSeek=e}},{key:"clone",value:function(){var e=new t;return e.tempo=this._tempo,e.setParameters(this.sampleRate,this.sequenceMs,this.seekWindowMs,this.overlapMs),e}},{key:"seekBestOverlapPosition",value:function(){return this._quickSeek?this.seekBestOverlapPositionStereoQuick():this.seekBestOverlapPositionStereo()}},{key:"seekBestOverlapPositionStereo",value:function(){var e,t,i,r=0;for(this.preCalculateCorrelationReferenceStereo(),e=0,t=Number.MIN_VALUE;rt&&(t=i,e=r);return e}},{key:"seekBestOverlapPositionStereoQuick",value:function(){var e,t,i,r,a,n=0;for(this.preCalculateCorrelationReferenceStereo(),t=Number.MIN_VALUE,e=0,r=0,a=0;n<4;n+=1){for(var o=0;Cs[n][o]&&(a=r+Cs[n][o],!(a>=this.seekLength));)i=this.calculateCrossCorrelationStereo(2*a,this.refMidBuffer),i>t&&(t=i,e=a),o+=1;r=e}return e}},{key:"preCalculateCorrelationReferenceStereo",value:function(){for(var e,t,i=0;i=this.sampleReq;){e=this.seekBestOverlapPosition(),this._outputBuffer.ensureAdditionalCapacity(this.overlapLength),this.overlap(Math.floor(e)),this._outputBuffer.put(this.overlapLength),t=this.seekWindowLength-2*this.overlapLength,t>0&&this._outputBuffer.putBuffer(this._inputBuffer,e+this.overlapLength,t);var r=this._inputBuffer.startIndex+2*(e+this.seekWindowLength-this.overlapLength);this.midBuffer.set(this._inputBuffer.vector.subarray(r,r+2*this.overlapLength)),this.skipFract+=this.nominalSkip,i=Math.floor(this.skipFract),this.skipFract-=i,this._inputBuffer.receive(i)}}}])}(ks),Ds=function(e,t){return(e>t?e-t:t-e)>1e-10},Ls=function(){function e(){S(this,e),this.transposer=new ws(!1),this.stretch=new Rs(!1),this._inputBuffer=new _s,this._intermediateBuffer=new _s,this._outputBuffer=new _s,this._rate=0,this._tempo=0,this.virtualPitch=1,this.virtualRate=1,this.virtualTempo=1,this.calculateEffectiveRateAndTempo()}return T(e,[{key:"destroy",value:function(){this.clear(),this._inputBuffer.destroy(),this._intermediateBuffer.destroy(),this._outputBuffer.destroy(),this._inputBuffer=null,this._intermediateBuffer=null,this._outputBuffer=null}},{key:"clear",value:function(){this.transposer.clear(),this.stretch.clear()}},{key:"clone",value:function(){var t=new e;return t.rate=this.rate,t.tempo=this.tempo,t}},{key:"rate",get:function(){return this._rate},set:function(e){this.virtualRate=e,this.calculateEffectiveRateAndTempo()}},{key:"rateChange",set:function(e){this._rate=1+.01*e}},{key:"tempo",get:function(){return this._tempo},set:function(e){this.virtualTempo=e,this.calculateEffectiveRateAndTempo()}},{key:"tempoChange",set:function(e){this.tempo=1+.01*e}},{key:"pitch",set:function(e){this.virtualPitch=e,this.calculateEffectiveRateAndTempo()}},{key:"pitchOctaves",set:function(e){this.pitch=Math.exp(.69314718056*e),this.calculateEffectiveRateAndTempo()}},{key:"pitchSemitones",set:function(e){this.pitchOctaves=e/12}},{key:"inputBuffer",get:function(){return this._inputBuffer}},{key:"outputBuffer",get:function(){return this._outputBuffer}},{key:"calculateEffectiveRateAndTempo",value:function(){var e=this._tempo,t=this._rate;this._tempo=this.virtualTempo/this.virtualPitch,this._rate=this.virtualRate*this.virtualPitch,Ds(this._tempo,e)&&(this.stretch.tempo=this._tempo),Ds(this._rate,t)&&(this.transposer.rate=this._rate),this._rate>1?this._outputBuffer!=this.transposer.outputBuffer&&(this.stretch.inputBuffer=this._inputBuffer,this.stretch.outputBuffer=this._intermediateBuffer,this.transposer.inputBuffer=this._intermediateBuffer,this.transposer.outputBuffer=this._outputBuffer):this._outputBuffer!=this.stretch.outputBuffer&&(this.transposer.inputBuffer=this._inputBuffer,this.transposer.outputBuffer=this._intermediateBuffer,this.stretch.inputBuffer=this._intermediateBuffer,this.stretch.outputBuffer=this._outputBuffer)}},{key:"process",value:function(){this._rate>1?(this.stretch.process(),this.transposer.process()):(this.transposer.process(),this.stretch.process())}}])}(),Is=function(){function e(t,i,r){S(this,e),this.player=t,this.audio=i,this.soundTouch=new Ls,this.soundTouch.tempo=1,this.soundTouch.rate=1,this.filter=new Es(r,this.soundTouch)}return T(e,[{key:"destroy",value:function(){this.filter&&(this.filter.destroy(),this.filter=null),this.soundTouch&&(this.soundTouch.destroy(),this.soundTouch=null)}},{key:"setRate",value:function(e){e!==this.soundTouch.rate&&(this.soundTouch.tempo=e)}},{key:"provide",value:function(e){for(var t=new Float32Array(2*e),i=this.filter.extract(t,e),r=new Float32Array(i),a=new Float32Array(i),n=0;n=100*this.playbackRate}},{key:"initProcessor",value:function(){this.processor=new bs(this.player,this,this.audioInfo.channels,this.audioBufferSize),this.rateProcessor=new Is(this.player,this,this.processor)}},{key:"getAutoAudioEngineType",value:function(){var e=this,t=this.player._opt.audioEngine||ra,i=function(){t=Ao()&&jn()?aa:(Hn()&&e.player._opt.supportLockScreenPlayAudio||Ro()&&e.supportAudioWorklet(),ra)};return this.player._opt.audioEngine?this.player._opt.audioEngine===ia&&Ro()&&this.supportAudioWorklet()?t=ia:this.player._opt.audioEngine===aa?t=aa:this.player._opt.audioEngine===ra?t=ra:i():i(),t}},{key:"getAudioBufferSizeByType",value:function(){var e=this.engineType;this.player._opt.hasVideo;var t=this.player._opt.weiXinInAndroidAudioBufferSize;return e===ia?1024:e===aa?t||4800:1024}},{key:"supportAudioWorklet",value:function(){return this.audioContext&&this.audioContext.audioWorklet}},{key:"initScriptNode",value:function(){this.playing=!0,this.hasInitScriptNode||(this.initProcessor(),this.engineType===ia?this.initWorkletScriptNode():this.engineType===aa?this.initIntervalScriptNode():this.engineType===ra&&this.initProcessScriptNode(),this.audioElementPlay())}},{key:"getEngineType",value:function(){return this.engineType}},{key:"isPlaybackRateSpeed",value:function(){return this.playbackRate>this.defaultPlaybackRate}},{key:"initProcessScriptNode",value:function(){var e=this,t=this.audioContext.createScriptProcessor(this.audioBufferSize,0,this.audioInfo.channels);t.onaudioprocess=function(t){var i=t.outputBuffer;e.handleScriptNodeCallback(i)},t.connect(this.gainNode),this.scriptNode=t,this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.$audio?this.$audio.srcObject=this.mediaStreamAudioDestinationNode.stream:this.gainNode.connect(this.audioContext.destination),this.hasInitScriptNode=!0}},{key:"initIntervalScriptNode",value:function(){var e=this;this.scriptStartTime=0;var t=1e3*this.audioBufferSize/this.audioContext.sampleRate;this.scriptNodeInterval=setInterval((function(){if(0===e.bufferList.length||No(e.playing)||e.isMute)e.playing&&No(e.isMute)&&e.player.debug.log("AudioContext","interval script node and bufferList is ".concat(e.bufferList.length," or playing is ").concat(e.playing));else{var t=e.audioContext.createBufferSource(),i=e.audioContext.createBuffer(e.audioInfo.channels,e.audioBufferSize,e.audioContext.sampleRate);e.handleScriptNodeCallback(i,(function(){e.scriptStartTime=4)this.state=2;else if(2===this.state)for(var n=this.samplesArray[0],o=0;o2&&void 0!==arguments[2]&&arguments[2];t=t||Cn;var a=e.length;r&&(i=e,a=this.audioBufferSize);var n=this.audioInfo.channels;if(this.playing&&this.isMoreThanMinBufferDuration()){if(this.player._opt,this.player.openSyncAudioAndVideo()&&Oo(this.player.visibility)){this.calcPlaybackRateBySync();var o=this.player.getAudioSyncVideoDiff();if(o>this.player._opt.syncAudioAndVideoDiff)return this.player.debug.warn("AudioContext","audioSyncVideoOption more than diff :".concat(o,", waiting and bufferList is ").concat(this.bufferList.length)),r?i.port.postMessage({message:"zero"}):this.fillScriptNodeOutputBuffer(e,n),void t()}var s=this._provide(a);if(0===s.size)return No(this.player.isPlaybackOnlyDecodeIFrame())&&this.player.debug.warn("AudioContext","bufferList size is ".concat(this.bufferList.length," outputBufferLength is ").concat(a,",and bufferItem.size is 0")),r?i.port.postMessage({message:"zero"}):this.fillScriptNodeOutputBuffer(e,n),void t();s&&s.ts&&(this.player.audioTimestamp=s.ts),r?i.port.postMessage({message:"data",buffer:s}):this.fillScriptNodeOutputBuffer(e,n,s),t()}else 0===this.bufferList.length&&this.playing&&No(this.isMute)&&No(this.player.isPlaybackOnlyDecodeIFrame())&&this.player.debug.warn("AudioContext","bufferList size is 0 and outputBufferLength is ".concat(a)),r?i.port.postMessage({message:"zero"}):this.fillScriptNodeOutputBuffer(e,n),t()}},{key:"fillScriptNodeOutputBuffer",value:function(e,t,i){if(1===t){var r=e.getChannelData(0);i?0===i.size?r.fill(0):r.set(i.left):r.fill(0)}else if(2===t){var a=e.getChannelData(0),n=e.getChannelData(1);i?0===i.size?(a.fill(0),n.fill(0)):(a.set(i.left),n.set(i.right)):(a.fill(0),n.fill(0))}}},{key:"play",value:function(e,t){this.isMute||(this.hasInitScriptNode?(this.hasAudio=!0,this.player.latestAudioTimestamp=t,this.bufferList.push({buffer:e,ts:t}),No(this.player.openSyncAudioAndVideo())&&this.calcPlaybackRateByBuffer()):this.player.debug.warn("AudioContext","play has not init script node"))}},{key:"calcPlaybackRateBySync",value:function(){if(!this.isMute&&this.playing){var e=Math.floor(2e3/this.oneBufferDuration);if(this.bufferList.length>e)return this.player.debug.warn("AudioContext","bufferList length ".concat(this.bufferList.length," more than ").concat(e,", and drop")),void this.clear();var t=this.player.getAudioSyncVideoDiff();if(this.getEngineType()===aa){if(t<-this.player._opt.syncAudioAndVideoDiff){this.player.debug.warn("AudioContext","engine active , audioSyncVideoOption ".concat(-this.player._opt.syncAudioAndVideoDiff," less than diff :").concat(t,",\n and bufferlist is ").concat(this.bufferList.length));for(var i=this.player.getRenderCurrentPts();this.bufferList.length>0;){var r=this.bufferList[0],a=r.ts-i;if(a>-this.player._opt.syncAudioAndVideoDiff/2){this.player.audioTimestamp=r.ts,this.player.debug.log("AudioContext","engine active , audioSyncVideoOption\n item.ts is ".concat(r.ts," and currentVideoTimestamp is ").concat(i,", diff is ").concat(a," > -").concat(this.player._opt.syncAudioAndVideoDiff/2," and end"));break}this.bufferList.shift(),this.player.audioTimestamp=r.ts}}}else{var n=this.playbackRate;t<-this.player._opt.syncAudioAndVideoDiff?n===this.defaultPlaybackRate&&(this.player.debug.log("AudioContext","audioSyncVideoOption ".concat(-this.player._opt.syncAudioAndVideoDiff," less than diff :").concat(t,",\n speed up, playbackRate is ").concat(n,",\n and bufferList is ").concat(this.bufferList.length)),n=this.defaultPlaybackRate+.2):t>-this.player._opt.syncAudioAndVideoDiff/2&&n!==this.defaultPlaybackRate&&(this.player.debug.log("AudioContext","diff is ".concat(t," > -").concat(this.player._opt.syncAudioAndVideoDiff/2," and speed to 1")),n=this.defaultPlaybackRate),this.updatePlaybackRate(n)}}}},{key:"calcPlaybackRateByBuffer",value:function(){if(!this.isMute&&this.playing){var e=this.playbackRate,t=1e3,i=5e3;this.isAudioPlayer&&(t=this.player._opt.videoBufferDelay,i=this.player._opt.videoBufferMax);var r=Math.floor(t/this.oneBufferDuration),a=Math.floor(i/this.oneBufferDuration);if(this.bufferList.length>a)return this.player.debug.warn("AudioContext","bufferList length ".concat(this.bufferList.length," more than ").concat(a,", and drop")),void this.clear();this.getEngineType()!==aa&&(this.bufferList.length>r?(e=this.defaultPlaybackRate+.2,this.player.debug.log("AudioContext","bufferList length ".concat(this.bufferList.length," more than ").concat(r,", speed up, playbackRate is ").concat(e))):this.bufferList.length0?this.player.emit(xt.mute,!1):this._prevVolume>0&&0===e&&this.player.emit(xt.mute,!0),this.$video.volume=e,this.player.emit(xt.volumechange,this.player.volume),this.player.emit(xt.volume,this.player.volume),this._prevVolume=e)}},{key:"clear",value:function(){}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"resume",value:function(){}},{key:"getEngineType",value:function(){return"audio"}},{key:"isPlaybackRateSpeed",value:function(){return!1}},{key:"getAudioBufferSize",value:function(){return 0}},{key:"setRate",value:function(){}},{key:"initScriptNode",value:function(){}},{key:"initScriptNodeDelay",value:function(){}},{key:"audioEnabled",value:function(){this.mute(!1)}}])}(s),Ms=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.delayTimeout=null,i.player.on(xt.playbackPause,(function(e){i.listenPlaybackPause(e)})),i.player.debug.log("AudioPlaybackContext","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null),e.next=3,b(t,"destroy",this,3)([]);case 3:return this.player.debug.log("AudioPlaybackLoader","destroy"),e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,this)})));function i(){return e.apply(this,arguments)}return i}()},{key:"listenPlaybackPause",value:function(e){e?(this.pause(),this.player.playback.isPlaybackPauseClearCache&&this.clear()):this.resume()}},{key:"initScriptNodeDelay",value:function(){var e=this,t=this.player._opt.playbackDelayTime;t>0?this.delayTimeout=setTimeout((function(){e.initScriptNode()}),t):this.initScriptNode()}},{key:"setRate",value:function(e){e!==this.defaultPlaybackRate&&this.rateProcessor&&(this.player.debug.log("AudioPlaybackContext","setRate",e),this.defaultPlaybackRate=e,this.updatePlaybackRate(e))}}])}(Ps),Us=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="AudioPlayerLoader",i.isAudioPlayer=!0,i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,b(t,"destroy",this,3)([]);case 2:return this.player.debug.log(this.TAG_NAME,"destroy"),e.abrupt("return",!0);case 4:case"end":return e.stop()}}),e,this)})));function i(){return e.apply(this,arguments)}return i}()},{key:"play",value:function(e,i){No(this.playing)||b(t,"play",this,3)([e,i])}},{key:"pause",value:function(){this.player.debug.log(this.TAG_NAME,"pause"),this.playing=!1,this.clear()}},{key:"resume",value:function(){this.player.debug.log(this.TAG_NAME,"resume"),this.playing=!0}}])}(Ps),Fs=function(){function e(t){return S(this,e),new(e.getLoaderFactory(t._opt))(t)}return T(e,null,[{key:"getLoaderFactory",value:function(e){return e.playType===z?e.useMSE&&e.mseDecodeAudio?Bs:Ms:e.playType===G?Us:e.isHls&&No(e.supportHls265)||e.isWebrtc&&No(e.isWebrtcH265)||e.useMSE&&e.mseDecodeAudio||e.isAliyunRtc?Bs:Ps}}])}(),Os=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.playing=!1,i._requestAbort=!1,i._status=Ba,i.writableStream=null,i.abortController=new AbortController,i.streamRate=Un((function(t){e.emit(xt.kBps,(t/1024).toFixed(2))})),i.streamRateInterval=null,e.debug.log("FetchStream","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){var t=this;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.abort(),this.writableStream&&No(this.writableStream.locked)&&this.writableStream.close().catch((function(e){t.player.debug.log("FetchStream","destroy and writableStream.close()",e)})),this.writableStream=null,this.off(),this._status=Ba,this.streamRate=null,this.stopStreamRateInterval(),this.player.debug.log("FetchStream","destroy"),!0));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"fetchStream",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.player.demux;this.player._times.streamStart=Ln();var a=Object.assign({signal:this.abortController.signal},{headers:i.headers||{}});fetch(e,a).then((function(e){if(t._requestAbort)return t._status=Ba,void e.body.cancel();if(!function(e){return e.ok&&e.status>=200&&e.status<=299}(e))return t.player.debug.error("FetchStream","fetch response status is ".concat(e.status," and ok is ").concat(e.ok," and emit error and next abort()")),t.abort(),void t.emit(It.fetchError,"fetch response status is ".concat(e.status," and ok is ").concat(e.ok));if(t.emit(xt.streamSuccess),t.startStreamRateInterval(),"undefined"!=typeof WritableStream)t.player.debug.log("FetchStream","use WritableStream() to read stream"),t.writableStream=new WritableStream({write:function(e){return t.abortController&&t.abortController.signal&&t.abortController.signal.aborted?(t.player.debug.log("FetchStream","writableStream.write() and this.abortController.signal.aborted so return"),void(t._status=Ua)):Oo(t._requestAbort)?(t.player.debug.log("FetchStream","writableStream.write() and this._requestAbort is true so return"),void(t._status=Ua)):"string"!=typeof e?(t._status=Ma,t.streamRate&&t.streamRate(e.byteLength),r.dispatch(e)):void t.player.debug.warn("FetchStream",'writableStream.write() and value is "'.concat(e,'" string so return'))},close:function(){t._status=Ua,r.close(),t.emit(xt.streamEnd,"fetch done")},abort:function(e){if(t.abortController&&t.abortController.signal&&t.abortController.signal.aborted)return t.player.debug.log("FetchStream","writableStream.abort() and this.abortController.signal.aborted so return"),void(t._status=Ua);r.close();var i=e.toString();-1===i.indexOf(Br)&&-1===i.indexOf(Mr)&&e.name!==Ur&&(t.abort(),t.emit(It.fetchError,e))}}),e.body.pipeTo(t.writableStream);else{t.player.debug.log("FetchStream","not support WritableStream and use getReader() to read stream");var i=e.body.getReader(),a=function(){i.read().then((function(e){var i=e.done,n=e.value;return i?(t._status=Ua,r.close(),void t.emit(xt.streamEnd,"fetch done")):t.abortController&&t.abortController.signal&&t.abortController.signal.aborted?(t.player.debug.log("FetchStream","reader.read() and this.abortController.signal.aborted so return"),void(t._status=Ua)):Oo(t._requestAbort)?(t.player.debug.log("FetchStream","reader.read() and this._requestAbort is true so return"),void(t._status=Ua)):void("string"!=typeof n?(t._status=Ma,t.streamRate&&t.streamRate(n.byteLength),r.dispatch(n),a()):t.player.debug.warn("FetchStream",'reader.read() and value is "'.concat(n,'" string so return')))})).catch((function(e){if(t.abortController&&t.abortController.signal&&t.abortController.signal.aborted)return t.player.debug.log("FetchStream","reader.read().catch() and this.abortController.signal.aborted so return"),void(t._status=Ua);r.close();var i=e.toString();-1===i.indexOf(Br)&&-1===i.indexOf(Mr)&&e.name!==Ur&&(t.abort(),t.emit(It.fetchError,e))}))};a()}})).catch((function(e){t.abortController&&t.abortController.signal&&t.abortController.signal.aborted||"AbortError"!==e.name&&(r.close(),t.abort(),t.emit(It.fetchError,e))}))}},{key:"abort",value:function(){this._requestAbort=!0;var e=bo();if(this._status!==Ma||No(e)){if(this.abortController){try{this.abortController.abort()}catch(e){}this.abortController=null}}else this.abortController=null,this.player.debug.log("FetchStream","abort() and not abortController.abort() _status is ".concat(this._status," and _isChrome is ").concat(e))}},{key:"getStreamType",value:function(){return P}}])}(s),Ns=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.TAG_NAME="FetchWorkerLoader",i.player=e,i.playing=!1,i.fetchWorker=null,i.workerClearTimeout=null,i.workerUrl=null,i.destroyResolve=null,i.decoderWorkerCloseTimeout=null,i.abortController=new AbortController,i.streamRate=Un((function(t){e.emit(xt.kBps,(t/1024).toFixed(2))})),i.streamRateInterval=null,i._initFetchWorker(),e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){e.fetchWorker?(e.player.debug.log(e.TAG_NAME,"send destroy"),e.fetchWorker.postMessage({cmd:kt}),e.destroyResolve=t,e.decoderWorkerCloseTimeout=setTimeout((function(){e.player.debug.warn(e.TAG_NAME,"send close but not response and destroy directly"),e.decoderWorkerCloseTimeout&&(clearTimeout(e.decoderWorkerCloseTimeout),e.decoderWorkerCloseTimeout=null),e._destroy(),setTimeout((function(){t()}),0)}),2e3)):(e._destroy(),setTimeout((function(){t()}),0))}))}},{key:"_destroy",value:function(){this.off(),this.decoderWorkerCloseTimeout&&(clearTimeout(this.decoderWorkerCloseTimeout),this.decoderWorkerCloseTimeout=null),this.workerUrl&&(window.URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this._stopStreamRateInterval(),this.streamRate=null,this.fetchWorker&&(this.fetchWorker.terminate(),this.fetchWorker.onmessage=null,this.fetchWorker=null),this.destroyResolve&&(this.destroyResolve(),this.destroyResolve=null),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_initFetchWorker",value:function(){var e=this,t=Jo(function(){function e(e){return!0===e||"true"===e}function t(e){return!1===e||"false"===e}var i="The user aborted a request",r="AbortError",a="AbortError",n="fetch",o="destroy",s="destroyEnd",l="buffer",c="fetchError",u="fetchClose",d="fetchSuccess",h="idle",p="buffering",f="complete",m=new(function(){function n(){S(this,n),this._requestAbort=!1,this._status=h,this.writableStream=null,this.isChrome=!1,this.abortController=new AbortController}return T(n,[{key:"destroy",value:function(){this.abort(),this.writableStream&&t(this.writableStream.locked)&&this.writableStream.close().catch((function(e){})),this.writableStream=null,this._status=h}},{key:"fetchStream",value:function(t){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=Object.assign({signal:this.abortController.signal},{headers:o.headers||{}});fetch(t,s).then((function(t){if(n._requestAbort)return n._status=h,void t.body.cancel();if(!function(e){return e.ok&&e.status>=200&&e.status<=299}(t))return n.abort(),void postMessage({cmd:c,message:"fetch response status is ".concat(t.status," and ok is ").concat(t.ok)});if(postMessage({cmd:d}),"undefined"!=typeof WritableStream)n.writableStream=new WritableStream({write:function(t){n.abortController&&n.abortController.signal&&n.abortController.signal.aborted||e(n._requestAbort)?n._status=f:"string"!=typeof t&&(n._status=p,postMessage({cmd:l,buffer:t},[t.buffer]))},close:function(){n._status=f,postMessage({cmd:u})},abort:function(e){if(n.abortController&&n.abortController.signal&&n.abortController.signal.aborted)n._status=f;else{var t=e.toString();-1===t.indexOf(i)&&-1===t.indexOf(r)&&e.name!==a&&(n.abort(),postMessage({cmd:c,message:e.toString()}))}}}),t.body.pipeTo(n.writableStream);else{var o=t.body.getReader(),s=function(){o.read().then((function(t){var i=t.done,r=t.value;if(i)return n._status=f,void postMessage({cmd:u});n.abortController&&n.abortController.signal&&n.abortController.signal.aborted||e(n._requestAbort)?n._status=f:"string"!=typeof r&&(n._status=p,postMessage({cmd:l,buffer:r},[r.buffer]),s())})).catch((function(e){if(n.abortController&&n.abortController.signal&&n.abortController.signal.aborted)n._status=f;else{var t=e.toString();-1===t.indexOf(i)&&-1===t.indexOf(r)&&e.name!==a&&(n.abort(),postMessage({cmd:c,message:e.toString()}))}}))};s()}})).catch((function(e){n.abortController&&n.abortController.signal&&n.abortController.signal.aborted||"AbortError"!==e.name&&(n.abort(),postMessage({cmd:c,message:e.toString()}))}))}},{key:"abort",value:function(){if(this._requestAbort=!0,this._status!==p||t(m.isChrome)){if(this.abortController){try{this.abortController.abort()}catch(e){}this.abortController=null}}else this.abortController=null}}])}());self.onmessage=function(t){var i=t.data;switch(i.cmd){case n:m.isChrome=e(i.isChrome),m.fetchStream(i.url,JSON.parse(i.options));break;case o:m.destroy(),m=null,postMessage({cmd:s})}}}.toString()),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),a=new Worker(r);this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(e.workerUrl),e.workerUrl=null,e.workerClearTimeout=null}),ke),a.onmessage=function(t){var i=e.player.demux,r=t.data;switch(r.cmd){case St:e.streamRate&&e.streamRate(r.buffer.byteLength),i.dispatch(r.buffer);break;case Ct:e.emit(xt.streamSuccess),e._startStreamRateInterval();break;case Et:i.close(),e.emit(xt.streamEnd,"fetch done");break;case Tt:i.close(),e.emit(It.fetchError,r.message);break;case wt:e._destroy()}},this.fetchWorker=a}},{key:"_startStreamRateInterval",value:function(){var e=this;this._stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"_stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"fetchStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player._times.streamStart=Ln(),this.fetchWorker.postMessage({cmd:_t,url:e,isChrome:bo(),options:JSON.stringify(t)})}},{key:"getStreamType",value:function(){return P}}])}(s),js=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.socket=null,i.socketStatus=Pt,i.wsUrl=null,i.requestAbort=!1,i.socketDestroyFnList=[],i.streamRate=Un((function(t){e.emit(xt.kBps,(t/1024).toFixed(2))})),i.streamRateInterval=null,e.debug.log("WebsocketStream","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._closeWebSocket(),this.stopStreamRateInterval(),this.wsUrl=null,this.off(),this.player.debug.log("WebsocketStream","destroy");case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"_createWebSocket",value:function(){var e=this,t=this.player,i=t.debug,r=t.events.proxy,a=t.demux;this.socket=new WebSocket(this.wsUrl),this.socket.binaryType="arraybuffer";var n=r(this.socket,"open",(function(){i.log("WebsocketStream","socket open"),e.socketStatus=Bt,e.emit(xt.streamSuccess),e.player.emit(xt.websocketOpen),e.startStreamRateInterval()})),o=r(this.socket,"message",(function(t){"string"!=typeof t.data?(e.streamRate&&e.streamRate(t.data.byteLength),e._handleMessage(t.data)):e.player.debug.warn("WebsocketStream",'websocket handle message message is "'.concat(t.data,'" string so return'))})),s=r(this.socket,"close",(function(t){if(e.socketStatus!==Ut){if(i.log("WebsocketStream","socket close and code is ".concat(t.code)),1006===t.code&&i.error("WebsocketStream","socket close abnormally and code is ".concat(t.code)),Oo(e.requestAbort))return e.requestAbort=!1,void i.log("WebsocketStream","socket close and requestAbort is true");a.close(),e.socketStatus=Mt,e.player.emit(xt.websocketClose,t.code),e.emit(xt.streamEnd,t.code)}else i.log("WebsocketStream","socket close and status is error, so return")})),l=r(this.socket,"error",(function(t){i.error("WebsocketStream","socket error",t),e.socketStatus=Ut,e.emit(It.websocketError,t),a.close(),i.log("WebsocketStream","socket error:",t.isTrusted?"websocket user aborted":"websocket error")}));this.socketDestroyFnList.push(n,o,s,l)}},{key:"_closeWebSocket",value:function(){this.socketDestroyFnList.forEach((function(e){return e()})),!this.socket||0!==this.socket.readyState&&1!==this.socket.readyState?this.socket&&this.player.debug.log("WebsocketStream","_closeWebSocket() socket is null or socket status is ".concat(this.socket&&this.socket.readyState)):(this.requestAbort=!0,this.socket.close(1e3,"Client disconnecting")),this.socket=null,this.socketStatus=Pt,this.streamRate=null}},{key:"_handleMessage",value:function(e){var t=this.player.demux;t?t.dispatch(e):this.player.debug.warn("WebsocketStream","websocket handle message demux is null so return")}},{key:"fetchStream",value:function(e,t){this.player._times.streamStart=Ln(),this.wsUrl=e,this._createWebSocket()}},{key:"sendMessage",value:function(e){this.socket?this.socketStatus===Bt?this.socket.send(e):this.player.debug.error("WebsocketStream","websocket send message error and socket status is ".concat(this.socketStatus)):this.player.debug.error("WebsocketStream","websocket send message socket is null")}},{key:"resetFetchStream",value:function(){this._closeWebSocket(),this._createWebSocket()}},{key:"getStreamType",value:function(){return M}}])}(s),Gs=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,e.debug.log("HlsStream","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.off(),this.player.debug.log("HlsStream","destroy"),!0));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"fetchStream",value:function(e){var t=this,i=this.player,r=i.hlsDecoder;i.debug;this.player._times.streamStart=Ln(),r.loadSource(e).then((function(){t.player.debug.log("HlsStream","loadSource success"),t.emit(xt.streamSuccess)})).catch((function(e){t.emit(It.hlsError,e)}))}},{key:"getStreamType",value:function(){return B}}])}(s),zs=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.webrctUrl=null,e.debug.log("WebrtcStream","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.webrctUrl=null,this.off(),this.player.debug.log("WebrtcStream","destroy"),!0));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"fetchStream",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.player,a=r.webrtc;r.debug;if(this.player._times.streamStart=Ln(),this.webrctUrl=e.replace("webrtc:",window.location.protocol),-1===this.webrctUrl.indexOf("/webrtc/play")&&this.player.isWebrtcForM7S()){var n=new URL(this.webrctUrl),o="/webrtc/play"+n.pathname;this.webrctUrl=n.origin+o+n.search,this.player.debug.log("WebrtcStream","original url is ".concat(e,", and new url is: ").concat(this.webrctUrl))}a.loadSource(this.webrctUrl,i).then((function(){t.player.debug.log("WebrtcStream","loadSource success"),t.emit(xt.streamSuccess)})).catch((function(e){t.player.debug.error("WebrtcStream","loadSource error",e),t.emit(It.webrtcError,e)}))}},{key:"getStreamType",value:function(){return U}}])}(s),Hs=function(t){function i(e){var t;return S(this,i),t=_(this,i),t.player=e,t.transport=null,t.wtUrl=null,t.streamRate=Un((function(t){e.emit(xt.kBps,(t/1024).toFixed(2))})),t.streamRateInterval=null,e.debug.log("WebTransportLoader","init"),t}return k(i,t),T(i,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.abort(),this.off(),this.player.debug.log("WebTransportLoader","destroy"),!0));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"_createWebTransport",value:function(){var e=this,t=this.player,i=(t.debug,t.events.proxy,t.demux);try{this.transport=new WebTransport(this.wtUrl),this.transport.ready.then((function(){e.emit(xt.streamSuccess),e.startStreamRateInterval(),e.transport.createBidirectionalStream().then((function(e){e.readable.pipeTo(new WritableStream(i.input))}))})).catch((function(t){e.player.debug.warn("WebTransportLoader","_createWebTransport-ready",t)}))}catch(t){this.player.debug.warn("WebTransportLoader","_createWebTransport",t)}}},{key:"fetchStream",value:function(e){this.player._times.streamStart=Ln(),this.wtUrl=e.replace(/^wt:/,"https:"),this._createWebTransport()}},{key:"abort",value:function(){if(this.transport)try{this.transport.close(),this.transport=null}catch(e){this.transport=null}}},{key:"getStreamType",value:function(){return F}}])}(s),Ws=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.workUrl=null,e.debug.log("WorkerStream","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.workUrl=null,this.off(),this.player.debug.log("WorkerStream","destroy"),!0));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"sendMessage",value:function(e){this.player.decoderWorker.workerSendMessage(e)}},{key:"fetchStream",value:function(e){this.workUrl=e,this.player._times.streamStart=Ln(),this.player.decoderWorker.workerFetchStream(e)}},{key:"getStreamType",value:function(){var e=this.player._opt.protocol;return O+" "+(e===c?P:M)}}])}(s),Vs=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.TAG_NAME="AliyunRtcLoader",i.player=e,e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(this.off(),this.player.debug.log(this.TAG_NAME,"destroy"),!0));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"fetchStream",value:function(e){var t=this,i=this.player.aliyunRtcDecoder;this.player._times.streamStart=Ln(),i.loadSource(e).then((function(){t.player.debug.log(t.TAG_NAME,"loadSource success"),t.emit(xt.streamSuccess)})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource error",e),t.emit(It.aliyunRtcError,e)}))}},{key:"getStreamType",value:function(){return N}}])}(s),Js=function(){function e(t){return S(this,e),new(e.getLoaderFactory(t._opt))(t)}return T(e,null,[{key:"getLoaderFactory",value:function(e){var t=e.protocol,i=e.useWasm,r=e.playType,a=e.useWCS,n=e.useMSE,o=e.demuxUseWorker,s=e.mainThreadFetchUseWorker;return t===c?r===G?Ws:r===j?i&&!Eo(e)||o?Ws:s?Ns:Os:a||n?o?Ws:s?Ns:Os:Ws:t===l?r===G?Ws:r===j?i&&!Eo(e)||o?Ws:js:a||n?o?Ws:js:Ws:t===x?Gs:t===R?zs:t===D?Hs:t===L?Vs:void 0}}])}(),qs=on((function(e){function t(e,a){if(!e)throw"First parameter is required.";a=new i(e,a=a||{type:"video"});var n=this;function o(t){t&&(a.initCallback=function(){t(),t=a.initCallback=null});var i=new r(e,a);(p=new i(e,a)).record(),h("recording"),a.disableLogs||console.log("Initialized recorderType:",p.constructor.name,"for output-type:",a.type)}function s(e){if(e=e||function(){},p){if("paused"===n.state)return n.resumeRecording(),void setTimeout((function(){s(e)}),1);"recording"===n.state||a.disableLogs||console.warn('Recording state should be: "recording", however current state is: ',n.state),a.disableLogs||console.log("Stopped recording "+a.type+" stream."),"gif"!==a.type?p.stop(t):(p.stop(),t()),h("stopped")}else m();function t(t){if(p){Object.keys(p).forEach((function(e){"function"!=typeof p[e]&&(n[e]=p[e])}));var i=p.blob;if(!i){if(!t)throw"Recording failed.";p.blob=i=t}if(i&&!a.disableLogs&&console.log(i.type,"->",v(i.size)),e){var r;try{r=d.createObjectURL(i)}catch(e){}"function"==typeof e.call?e.call(n,r):e(r)}a.autoWriteToDisk&&c((function(e){var t={};t[a.type+"Blob"]=e,L.Store(t)}))}else"function"==typeof e.call?e.call(n,""):e("")}}function l(e){postMessage((new FileReaderSync).readAsDataURL(e))}function c(e,t){if(!e)throw"Pass a callback function over getDataURL.";var i=t?t.blob:(p||{}).blob;if(!i)return a.disableLogs||console.warn("Blob encoder did not finish its job yet."),void setTimeout((function(){c(e,t)}),1e3);if("undefined"==typeof Worker||navigator.mozGetUserMedia){var r=new FileReader;r.readAsDataURL(i),r.onload=function(t){e(t.target.result)}}else{var n=function(e){try{var t=d.createObjectURL(new Blob([e.toString(),"this.onmessage = function (eee) {"+e.name+"(eee.data);}"],{type:"application/javascript"})),i=new Worker(t);return d.revokeObjectURL(t),i}catch(e){}}(l);n.onmessage=function(t){e(t.data)},n.postMessage(i)}}function u(e){e=e||0,"paused"!==n.state?"stopped"!==n.state&&(e>=n.recordingDuration?s(n.onRecordingStopped):(e+=1e3,setTimeout((function(){u(e)}),1e3))):setTimeout((function(){u(e)}),1e3)}function h(e){n&&(n.state=e,"function"==typeof n.onStateChanged.call?n.onStateChanged.call(n,e):n.onStateChanged(e))}var p,f='It seems that recorder is destroyed or "startRecording" is not invoked for '+a.type+" recorder.";function m(){!0!==a.disableLogs&&console.warn(f)}var g={startRecording:function(t){return a.disableLogs||console.log("RecordRTC version: ",n.version),t&&(a=new i(e,t)),a.disableLogs||console.log("started recording "+a.type+" stream."),p?(p.clearRecordedData(),p.record(),h("recording"),n.recordingDuration&&u(),n):(o((function(){n.recordingDuration&&u()})),n)},stopRecording:s,pauseRecording:function(){p?"recording"===n.state?(h("paused"),p.pause(),a.disableLogs||console.log("Paused recording.")):a.disableLogs||console.warn("Unable to pause the recording. Recording state: ",n.state):m()},resumeRecording:function(){p?"paused"===n.state?(h("recording"),p.resume(),a.disableLogs||console.log("Resumed recording.")):a.disableLogs||console.warn("Unable to resume the recording. Recording state: ",n.state):m()},initRecorder:o,setRecordingDuration:function(e,t){if(void 0===e)throw"recordingDuration is required.";if("number"!=typeof e)throw"recordingDuration must be a number.";return n.recordingDuration=e,n.onRecordingStopped=t||function(){},{onRecordingStopped:function(e){n.onRecordingStopped=e}}},clearRecordedData:function(){p?(p.clearRecordedData(),a.disableLogs||console.log("Cleared old recorded data.")):m()},getBlob:function(){if(p)return p.blob;m()},getDataURL:c,toURL:function(){if(p)return d.createObjectURL(p.blob);m()},getInternalRecorder:function(){return p},save:function(e){p?A(p.blob,e):m()},getFromDisk:function(e){p?t.getFromDisk(a.type,e):m()},setAdvertisementArray:function(e){a.advertisement=[];for(var t=e.length,i=0;i-1&&"netscape"in window&&/ rv:/.test(navigator.userAgent),m=!p&&!h&&!!navigator.webkitGetUserMedia||b()||-1!==navigator.userAgent.toLowerCase().indexOf("chrome/"),g=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);g&&!m&&-1!==navigator.userAgent.indexOf("CriOS")&&(g=!1,m=!0);var y=window.MediaStream;function v(e){if(0===e)return"0 Bytes";var t=parseInt(Math.floor(Math.log(e)/Math.log(1e3)),10);return(e/Math.pow(1e3,t)).toPrecision(3)+" "+["Bytes","KB","MB","GB","TB"][t]}function A(e,t){if(!e)throw"Blob object is required.";if(!e.type)try{e.type="video/webm"}catch(e){}var i=(e.type||"video/webm").split("/")[1];if(-1!==i.indexOf(";")&&(i=i.split(";")[0]),t&&-1!==t.indexOf(".")){var r=t.split(".");t=r[0],i=r[1]}var a=(t||Math.round(9999999999*Math.random())+888888888)+"."+i;if(void 0!==navigator.msSaveOrOpenBlob)return navigator.msSaveOrOpenBlob(e,a);if(void 0!==navigator.msSaveBlob)return navigator.msSaveBlob(e,a);var n=document.createElement("a");n.href=d.createObjectURL(e),n.download=a,n.style="display:none;opacity:0;color:transparent;",(document.body||document.documentElement).appendChild(n),"function"==typeof n.click?n.click():(n.target="_blank",n.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))),d.revokeObjectURL(n.href)}function b(){return"undefined"!=typeof window&&"object"==E(window.process)&&"renderer"===window.process.type||!("undefined"==typeof o||"object"!=E(o.versions)||!o.versions.electron)||"object"==("undefined"===typeof navigator?"undefined":E(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}function _(e,t){return e&&e.getTracks?e.getTracks().filter((function(e){return e.kind===(t||"audio")})):[]}function k(e,t){"srcObject"in t?t.srcObject=e:"mozSrcObject"in t?t.mozSrcObject=e:t.srcObject=e}void 0===y&&"undefined"!=typeof webkitMediaStream&&(y=webkitMediaStream),void 0!==y&&void 0===y.prototype.stop&&(y.prototype.stop=function(){this.getTracks().forEach((function(e){e.stop()}))}),t.invokeSaveAsDialog=A,t.getTracks=_,t.getSeekableBlob=function(e,t){if("undefined"==typeof EBML)throw new Error("Please link: https://www.webrtc-experiment.com/EBML.js");var i=new EBML.Reader,r=new EBML.Decoder,a=EBML.tools,n=new FileReader;n.onload=function(e){r.decode(this.result).forEach((function(e){i.read(e)})),i.stop();var n=a.makeMetadataSeekable(i.metadatas,i.duration,i.cues),o=this.result.slice(i.metadataSize),s=new Blob([n,o],{type:"video/webm"});t(s)},n.readAsArrayBuffer(e)},t.bytesToSize=v,t.isElectron=b;var w={};function S(){if(f||g||h)return!0;var e,t,i=navigator.userAgent,r=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10);return(m||p)&&(e=i.indexOf("Chrome"),r=i.substring(e+7)),-1!==(t=r.indexOf(";"))&&(r=r.substring(0,t)),-1!==(t=r.indexOf(" "))&&(r=r.substring(0,t)),a=parseInt(""+r,10),isNaN(a)&&(r=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10)),a>=49}function T(e,t){var i,r=this;if(void 0===e)throw'First argument "MediaStream" is required.';if("undefined"==typeof MediaRecorder)throw"Your browser does not support the Media Recorder API. Please try other modules e.g. WhammyRecorder or StereoAudioRecorder.";"audio"===(t=t||{mimeType:"video/webm"}).type&&(_(e,"video").length&&_(e,"audio").length&&(navigator.mozGetUserMedia?(i=new y).addTrack(_(e,"audio")[0]):i=new y(_(e,"audio")),e=i),t.mimeType&&-1!==t.mimeType.toString().toLowerCase().indexOf("audio")||(t.mimeType=m?"audio/webm":"audio/ogg"),t.mimeType&&"audio/ogg"!==t.mimeType.toString().toLowerCase()&&navigator.mozGetUserMedia&&(t.mimeType="audio/ogg"));var a,n=[];function o(){r.timestamps.push((new Date).getTime()),"function"==typeof t.onTimeStamp&&t.onTimeStamp(r.timestamps[r.timestamps.length-1],r.timestamps)}function s(e){return a&&a.mimeType?a.mimeType:e.mimeType||"video/webm"}function l(){n=[],a=null,r.timestamps=[]}this.getArrayOfBlobs=function(){return n},this.record=function(){r.blob=null,r.clearRecordedData(),r.timestamps=[],c=[],n=[];var i=t;t.disableLogs||console.log("Passing following config over MediaRecorder API.",i),a&&(a=null),m&&!S()&&(i="video/vp8"),"function"==typeof MediaRecorder.isTypeSupported&&i.mimeType&&(MediaRecorder.isTypeSupported(i.mimeType)||(t.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",i.mimeType),i.mimeType="audio"===t.type?"audio/webm":"video/webm"));try{a=new MediaRecorder(e,i),t.mimeType=i.mimeType}catch(t){a=new MediaRecorder(e)}i.mimeType&&!MediaRecorder.isTypeSupported&&"canRecordMimeType"in a&&!1===a.canRecordMimeType(i.mimeType)&&(t.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",i.mimeType)),a.ondataavailable=function(e){if(e.data&&c.push("ondataavailable: "+v(e.data.size)),"number"!=typeof t.timeSlice)!e.data||!e.data.size||e.data.size<100||r.blob?r.recordingCallback&&(r.recordingCallback(new Blob([],{type:s(i)})),r.recordingCallback=null):(r.blob=t.getNativeBlob?e.data:new Blob([e.data],{type:s(i)}),r.recordingCallback&&(r.recordingCallback(r.blob),r.recordingCallback=null));else if(e.data&&e.data.size&&(n.push(e.data),o(),"function"==typeof t.ondataavailable)){var a=t.getNativeBlob?e.data:new Blob([e.data],{type:s(i)});t.ondataavailable(a)}},a.onstart=function(){c.push("started")},a.onpause=function(){c.push("paused")},a.onresume=function(){c.push("resumed")},a.onstop=function(){c.push("stopped")},a.onerror=function(e){e&&(e.name||(e.name="UnknownError"),c.push("error: "+e),t.disableLogs||(-1!==e.name.toString().toLowerCase().indexOf("invalidstate")?console.error("The MediaRecorder is not in a state in which the proposed operation is allowed to be executed.",e):-1!==e.name.toString().toLowerCase().indexOf("notsupported")?console.error("MIME type (",i.mimeType,") is not supported.",e):-1!==e.name.toString().toLowerCase().indexOf("security")?console.error("MediaRecorder security error",e):"OutOfMemory"===e.name?console.error("The UA has exhaused the available memory. User agents SHOULD provide as much additional information as possible in the message attribute.",e):"IllegalStreamModification"===e.name?console.error("A modification to the stream has occurred that makes it impossible to continue recording. An example would be the addition of a Track while recording is occurring. User agents SHOULD provide as much additional information as possible in the message attribute.",e):"OtherRecordingError"===e.name?console.error("Used for an fatal error other than those listed above. User agents SHOULD provide as much additional information as possible in the message attribute.",e):"GenericError"===e.name?console.error("The UA cannot provide the codec or recording option that has been requested.",e):console.error("MediaRecorder Error",e)),function(e){if(!r.manuallyStopped&&a&&"inactive"===a.state)return delete t.timeslice,void a.start(6e5);setTimeout(void 0,1e3)}(),"inactive"!==a.state&&"stopped"!==a.state&&a.stop())},"number"==typeof t.timeSlice?(o(),a.start(t.timeSlice)):a.start(36e5),t.initCallback&&t.initCallback()},this.timestamps=[],this.stop=function(e){e=e||function(){},r.manuallyStopped=!0,a&&(this.recordingCallback=e,"recording"===a.state&&a.stop(),"number"==typeof t.timeSlice&&setTimeout((function(){r.blob=new Blob(n,{type:s(t)}),r.recordingCallback(r.blob)}),100))},this.pause=function(){a&&"recording"===a.state&&a.pause()},this.resume=function(){a&&"paused"===a.state&&a.resume()},this.clearRecordedData=function(){a&&"recording"===a.state&&r.stop(l),l()},this.getInternalRecorder=function(){return a},this.blob=null,this.getState=function(){return a&&a.state||"inactive"};var c=[];this.getAllStates=function(){return c},void 0===t.checkForInactiveTracks&&(t.checkForInactiveTracks=!1),r=this,function i(){if(a&&!1!==t.checkForInactiveTracks)return!1===function(){if("active"in e){if(!e.active)return!1}else if("ended"in e&&e.ended)return!1;return!0}()?(t.disableLogs||console.log("MediaStream seems stopped."),void r.stop()):void setTimeout(i,1e3)}(),this.name="MediaStreamRecorder",this.toString=function(){return this.name}}function C(e,i){if(!_(e,"audio").length)throw"Your stream has no audio tracks.";var r,a=this,n=[],o=[],s=!1,l=0,c=2,u=(i=i||{}).desiredSampRate;function h(){if(!1===i.checkForInactiveTracks)return!0;if("active"in e){if(!e.active)return!1}else if("ended"in e&&e.ended)return!1;return!0}function p(e,t){function i(e,t){var i,r=e.numberOfAudioChannels,a=e.leftBuffers.slice(0),n=e.rightBuffers.slice(0),o=e.sampleRate,s=e.internalInterleavedLength,l=e.desiredSampRate;function c(e,t,i){var r=Math.round(e.length*(t/i)),a=[],n=Number((e.length-1)/(r-1));a[0]=e[0];for(var o=1;o96e3)&&(i.disableLogs||console.log("sample-rate must be under range 22050 and 96000.")),i.disableLogs||i.desiredSampRate&&console.log("Desired sample-rate: "+i.desiredSampRate);var A=!1;function b(){n=[],o=[],l=0,w=!1,s=!1,A=!1,f=null,a.leftchannel=n,a.rightchannel=o,a.numberOfAudioChannels=c,a.desiredSampRate=u,a.sampleRate=v,a.recordingLength=l,S={left:[],right:[],recordingLength:0}}function k(){r&&(r.onaudioprocess=null,r.disconnect(),r=null),m&&(m.disconnect(),m=null),b()}this.pause=function(){A=!0},this.resume=function(){if(!1===h())throw"Please make sure MediaStream is active.";if(!s)return i.disableLogs||console.log("Seems recording has been restarted."),void this.record();A=!1},this.clearRecordedData=function(){i.checkForInactiveTracks=!1,s&&this.stop(k),k()},this.name="StereoAudioRecorder",this.toString=function(){return this.name};var w=!1;r.onaudioprocess=function(e){if(!A)if(!1===h()&&(i.disableLogs||console.log("MediaStream seems stopped."),r.disconnect(),s=!1),s){w||(w=!0,i.onAudioProcessStarted&&i.onAudioProcessStarted(),i.initCallback&&i.initCallback());var t=e.inputBuffer.getChannelData(0),u=new Float32Array(t);if(n.push(u),2===c){var d=e.inputBuffer.getChannelData(1),p=new Float32Array(d);o.push(p)}l+=y,a.recordingLength=l,void 0!==i.timeSlice&&(S.recordingLength+=y,S.left.push(u),2===c&&S.right.push(p))}else m&&(m.disconnect(),m=null)},f.createMediaStreamDestination?r.connect(f.createMediaStreamDestination()):r.connect(f.destination),this.leftchannel=n,this.rightchannel=o,this.numberOfAudioChannels=c,this.desiredSampRate=u,this.sampleRate=v,a.recordingLength=l;var S={left:[],right:[],recordingLength:0};function T(){s&&"function"==typeof i.ondataavailable&&void 0!==i.timeSlice&&(S.left.length?(p({desiredSampRate:u,sampleRate:v,numberOfAudioChannels:c,internalInterleavedLength:S.recordingLength,leftBuffers:S.left,rightBuffers:1===c?[]:S.right},(function(e,t){var r=new Blob([t],{type:"audio/wav"});i.ondataavailable(r),setTimeout(T,i.timeSlice)})),S={left:[],right:[],recordingLength:0}):setTimeout(T,i.timeSlice))}}function x(e,t){if("undefined"==typeof html2canvas)throw"Please link: https://www.webrtc-experiment.com/screenshot.js";(t=t||{}).frameInterval||(t.frameInterval=10);var i=!1;["captureStream","mozCaptureStream","webkitCaptureStream"].forEach((function(e){e in document.createElement("canvas")&&(i=!0)}));var r,a,n,o=!(!window.webkitRTCPeerConnection&&!window.webkitGetUserMedia||!window.chrome),s=50,l=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);if(o&&l&&l[2]&&(s=parseInt(l[2],10)),o&&s<52&&(i=!1),t.useWhammyRecorder&&(i=!1),i)if(t.disableLogs||console.log("Your browser supports both MediRecorder API and canvas.captureStream!"),e instanceof HTMLCanvasElement)r=e;else{if(!(e instanceof CanvasRenderingContext2D))throw"Please pass either HTMLCanvasElement or CanvasRenderingContext2D.";r=e.canvas}else navigator.mozGetUserMedia&&(t.disableLogs||console.error("Canvas recording is NOT supported in Firefox."));this.record=function(){if(n=!0,i&&!t.useWhammyRecorder){var e;"captureStream"in r?e=r.captureStream(25):"mozCaptureStream"in r?e=r.mozCaptureStream(25):"webkitCaptureStream"in r&&(e=r.webkitCaptureStream(25));try{var o=new y;o.addTrack(_(e,"video")[0]),e=o}catch(e){}if(!e)throw"captureStream API are NOT available.";(a=new T(e,{mimeType:t.mimeType||"video/webm"})).record()}else p.frames=[],h=(new Date).getTime(),d();t.initCallback&&t.initCallback()},this.getWebPImages=function(i){if("canvas"===e.nodeName.toLowerCase()){var r=p.frames.length;p.frames.forEach((function(e,i){var a=r-i;t.disableLogs||console.log(a+"/"+r+" frames remaining"),t.onEncodingCallback&&t.onEncodingCallback(a,r);var n=e.image.toDataURL("image/webp",1);p.frames[i].image=n})),t.disableLogs||console.log("Generating WebM"),i()}else i()},this.stop=function(e){n=!1;var r=this;i&&a?a.stop(e):this.getWebPImages((function(){p.compile((function(i){t.disableLogs||console.log("Recording finished!"),r.blob=i,r.blob.forEach&&(r.blob=new Blob([],{type:"video/webm"})),e&&e(r.blob),p.frames=[]}))}))};var c=!1;function u(){p.frames=[],n=!1,c=!1}function d(){if(c)return h=(new Date).getTime(),setTimeout(d,500);if("canvas"===e.nodeName.toLowerCase()){var i=(new Date).getTime()-h;return h=(new Date).getTime(),p.frames.push({image:(r=document.createElement("canvas"),a=r.getContext("2d"),r.width=e.width,r.height=e.height,a.drawImage(e,0,0),r),duration:i}),void(n&&setTimeout(d,t.frameInterval))}var r,a;html2canvas(e,{grabMouse:void 0===t.showMousePointer||t.showMousePointer,onrendered:function(e){var i=(new Date).getTime()-h;if(!i)return setTimeout(d,t.frameInterval);h=(new Date).getTime(),p.frames.push({image:e.toDataURL("image/webp",1),duration:i}),n&&setTimeout(d,t.frameInterval)}})}this.pause=function(){c=!0,a instanceof T&&a.pause()},this.resume=function(){c=!1,a instanceof T?a.resume():n||this.record()},this.clearRecordedData=function(){n&&this.stop(u),u()},this.name="CanvasRecorder",this.toString=function(){return this.name};var h=(new Date).getTime(),p=new D.Video(100)}function R(e,t){function i(e){e=void 0!==e?e:10;var t=(new Date).getTime()-l;return t?n?(l=(new Date).getTime(),setTimeout(i,100)):(l=(new Date).getTime(),s.paused&&s.play(),d.drawImage(s,0,0,u.width,u.height),c.frames.push({duration:t,image:u.toDataURL("image/webp")}),void(a||setTimeout(i,e,e))):setTimeout(i,e,e)}function r(e,t,i,r,a){var n=document.createElement("canvas");n.width=u.width,n.height=u.height;var o=n.getContext("2d"),s=[],l=-1===t,c=t&&t>0&&t<=e.length?t:e.length,d=0,h=0,p=0,f=Math.sqrt(Math.pow(255,2)+Math.pow(255,2)+Math.pow(255,2)),m=i&&i>=0&&i<=1?i:0,g=r&&r>=0&&r<=1?r:0,y=!1;!function(e){var t=-1,i=e.length;!function r(){++t!==i?setTimeout((function(){e.functionToLoop(r,t)}),1):e.callback()}()}({length:c,functionToLoop:function(t,i){var r,a,n,c=function(){!y&&n-r<=n*g||(l&&(y=!0),s.push(e[i])),t()};if(y)c();else{var v=new Image;v.onload=function(){o.drawImage(v,0,0,u.width,u.height);var e=o.getImageData(0,0,u.width,u.height);r=0,a=e.data.length,n=e.data.length/4;for(var t=0;t127)throw"TrackNumber > 127 not supported";return[128|e.trackNum,e.timecode>>8,255&e.timecode,t].map((function(e){return String.fromCharCode(e)})).join("")+e.frame}({discardable:0,frame:e.data.slice(4),invisible:0,keyframe:1,lacing:0,trackNum:1,timecode:Math.round(t)});return t+=e.duration,{data:i,id:163}})))}function i(e){for(var t=[];e>0;)t.push(255&e),e>>=8;return new Uint8Array(t.reverse())}function r(e){var t=[];e=(e.length%8?new Array(9-e.length%8).join("0"):"")+e;for(var i=0;i1?2*n[0].width:n[0].width;var s=1;3!==e&&4!==e||(s=2),5!==e&&6!==e||(s=3),7!==e&&8!==e||(s=4),9!==e&&10!==e||(s=5),a.height=n[0].height*s}else a.width=o.width||360,a.height=o.height||240;t&&t instanceof HTMLVideoElement&&h(t),n.forEach((function(e,t){h(e,t)})),setTimeout(d,o.frameInterval)}}function h(e,t){if(!r){var i=0,a=0,o=e.width,s=e.height;1===t&&(i=e.width),2===t&&(a=e.height),3===t&&(i=e.width,a=e.height),4===t&&(a=2*e.height),5===t&&(i=e.width,a=2*e.height),6===t&&(a=3*e.height),7===t&&(i=e.width,a=3*e.height),void 0!==e.stream.left&&(i=e.stream.left),void 0!==e.stream.top&&(a=e.stream.top),void 0!==e.stream.width&&(o=e.stream.width),void 0!==e.stream.height&&(s=e.stream.height),n.drawImage(e,i,a,o,s),"function"==typeof e.stream.onRender&&e.stream.onRender(n,i,a,o,s,t)}}function p(e){var i=document.createElement("video");return function(e,t){"srcObject"in t?t.srcObject=e:"mozSrcObject"in t?t.mozSrcObject=e:t.srcObject=e}(e,i),i.className=t,i.muted=!0,i.volume=0,i.width=e.width||o.width||360,i.height=e.height||o.height||240,i.play(),i}function f(t){i=[],(t=t||e).forEach((function(e){if(e.getTracks().filter((function(e){return"video"===e.kind})).length){var t=p(e);t.stream=e,i.push(t)}}))}void 0!==s?u.AudioContext=s:"undefined"!=typeof webkitAudioContext&&(u.AudioContext=webkitAudioContext),this.startDrawingFrames=function(){d()},this.appendStreams=function(t){if(!t)throw"First parameter is required.";t instanceof Array||(t=[t]),t.forEach((function(t){var r=new c;if(t.getTracks().filter((function(e){return"video"===e.kind})).length){var a=p(t);a.stream=t,i.push(a),r.addTrack(t.getTracks().filter((function(e){return"video"===e.kind}))[0])}if(t.getTracks().filter((function(e){return"audio"===e.kind})).length){var n=o.audioContext.createMediaStreamSource(t);o.audioDestination=o.audioContext.createMediaStreamDestination(),n.connect(o.audioDestination),r.addTrack(o.audioDestination.stream.getTracks().filter((function(e){return"audio"===e.kind}))[0])}e.push(r)}))},this.releaseStreams=function(){i=[],r=!0,o.gainNode&&(o.gainNode.disconnect(),o.gainNode=null),o.audioSources.length&&(o.audioSources.forEach((function(e){e.disconnect()})),o.audioSources=[]),o.audioDestination&&(o.audioDestination.disconnect(),o.audioDestination=null),o.audioContext&&o.audioContext.close(),o.audioContext=null,n.clearRect(0,0,a.width,a.height),a.stream&&(a.stream.stop(),a.stream=null)},this.resetVideoStreams=function(e){!e||e instanceof Array||(e=[e]),f(e)},this.name="MultiStreamsMixer",this.toString=function(){return this.name},this.getMixedStream=function(){r=!1;var t=function(){var e;f(),"captureStream"in a?e=a.captureStream():"mozCaptureStream"in a?e=a.mozCaptureStream():o.disableLogs||console.error("Upgrade to latest Chrome or otherwise enable this flag: chrome://flags/#enable-experimental-web-platform-features");var t=new c;return e.getTracks().filter((function(e){return"video"===e.kind})).forEach((function(e){t.addTrack(e)})),a.stream=t,t}(),i=function(){u.AudioContextConstructor||(u.AudioContextConstructor=new u.AudioContext),o.audioContext=u.AudioContextConstructor,o.audioSources=[],!0===o.useGainNode&&(o.gainNode=o.audioContext.createGain(),o.gainNode.connect(o.audioContext.destination),o.gainNode.gain.value=0);var t=0;if(e.forEach((function(e){if(e.getTracks().filter((function(e){return"audio"===e.kind})).length){t++;var i=o.audioContext.createMediaStreamSource(e);!0===o.useGainNode&&i.connect(o.gainNode),o.audioSources.push(i)}})),t)return o.audioDestination=o.audioContext.createMediaStreamDestination(),o.audioSources.forEach((function(e){e.connect(o.audioDestination)})),o.audioDestination.stream}();return i&&i.getTracks().filter((function(e){return"audio"===e.kind})).forEach((function(e){t.addTrack(e)})),e.forEach((function(e){e.fullcanvas})),t}}function B(e,t){e=e||[];var i,r,a=this;(t=t||{elementClass:"multi-streams-mixer",mimeType:"video/webm",video:{width:360,height:240}}).frameInterval||(t.frameInterval=10),t.video||(t.video={}),t.video.width||(t.video.width=360),t.video.height||(t.video.height=240),this.record=function(){var a;i=new P(e,t.elementClass||"multi-streams-mixer"),(a=[],e.forEach((function(e){_(e,"video").forEach((function(e){a.push(e)}))})),a).length&&(i.frameInterval=t.frameInterval||10,i.width=t.video.width||360,i.height=t.video.height||240,i.startDrawingFrames()),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(i.getMixedStream()),(r=new T(i.getMixedStream(),t)).record()},this.stop=function(e){r&&r.stop((function(t){a.blob=t,e(t),a.clearRecordedData()}))},this.pause=function(){r&&r.pause()},this.resume=function(){r&&r.resume()},this.clearRecordedData=function(){r&&(r.clearRecordedData(),r=null),i&&(i.releaseStreams(),i=null)},this.addStreams=function(a){if(!a)throw"First parameter is required.";a instanceof Array||(a=[a]),e.concat(a),r&&i&&(i.appendStreams(a),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(i.getMixedStream()))},this.resetVideoStreams=function(e){i&&(!e||e instanceof Array||(e=[e]),i.resetVideoStreams(e))},this.getMixer=function(){return i},this.name="MultiStreamRecorder",this.toString=function(){return this.name}}function M(e,t){var i,r,a;function n(){return new ReadableStream({start:function(r){var a=document.createElement("canvas"),n=document.createElement("video"),o=!0;n.srcObject=e,n.muted=!0,n.height=t.height,n.width=t.width,n.volume=0,n.onplaying=function(){a.width=t.width,a.height=t.height;var e=a.getContext("2d"),s=1e3/t.frameRate,l=setInterval((function(){if(i&&(clearInterval(l),r.close()),o&&(o=!1,t.onVideoProcessStarted&&t.onVideoProcessStarted()),e.drawImage(n,0,0),"closed"!==r._controlledReadableStream.state)try{r.enqueue(e.getImageData(0,0,t.width,t.height))}catch(e){}}),s)},n.play()}})}function o(e,l){if(!t.workerPath&&!l)return i=!1,void fetch("https://unpkg.com/webm-wasm@latest/dist/webm-worker.js").then((function(t){t.arrayBuffer().then((function(t){o(e,t)}))}));if(!t.workerPath&&l instanceof ArrayBuffer){var c=new Blob([l],{type:"text/javascript"});t.workerPath=d.createObjectURL(c)}t.workerPath||console.error("workerPath parameter is missing."),(r=new Worker(t.workerPath)).postMessage(t.webAssemblyPath||"https://unpkg.com/webm-wasm@latest/dist/webm-wasm.wasm"),r.addEventListener("message",(function(e){"READY"===e.data?(r.postMessage({width:t.width,height:t.height,bitrate:t.bitrate||1200,timebaseDen:t.frameRate||30,realtime:t.realtime}),n().pipeTo(new WritableStream({write:function(e){i?console.error("Got image, but recorder is finished!"):r.postMessage(e.data.buffer,[e.data.buffer])}}))):e.data&&(a||s.push(e.data))}))}"undefined"!=typeof ReadableStream&&"undefined"!=typeof WritableStream||console.error("Following polyfill is strongly recommended: https://unpkg.com/@mattiasbuelens/web-streams-polyfill/dist/polyfill.min.js"),(t=t||{}).width=t.width||640,t.height=t.height||480,t.frameRate=t.frameRate||30,t.bitrate=t.bitrate||1200,t.realtime=t.realtime||!0,this.record=function(){s=[],a=!1,this.blob=null,o(e),"function"==typeof t.initCallback&&t.initCallback()},this.pause=function(){a=!0},this.resume=function(){a=!1};var s=[];this.stop=function(e){i=!0;var t=this;!function(e){r?(r.addEventListener("message",(function(t){null===t.data&&(r.terminate(),r=null,e&&e())})),r.postMessage(null)):e&&e()}((function(){t.blob=new Blob(s,{type:"video/webm"}),e(t.blob)}))},this.name="WebAssemblyRecorder",this.toString=function(){return this.name},this.clearRecordedData=function(){s=[],a=!1,this.blob=null},this.blob=null}t.DiskStorage=L,t.GifRecorder=I,t.MultiStreamRecorder=B,t.RecordRTCPromisesHandler=function(e,i){if(!this)throw'Use "new RecordRTCPromisesHandler()"';if(void 0===e)throw'First argument "MediaStream" is required.';var r=this;r.recordRTC=new t(e,i),this.startRecording=function(){return new Promise((function(e,t){try{r.recordRTC.startRecording(),e()}catch(e){t(e)}}))},this.stopRecording=function(){return new Promise((function(e,t){try{r.recordRTC.stopRecording((function(i){r.blob=r.recordRTC.getBlob(),r.blob&&r.blob.size?e(i):t("Empty blob.",r.blob)}))}catch(e){t(e)}}))},this.pauseRecording=function(){return new Promise((function(e,t){try{r.recordRTC.pauseRecording(),e()}catch(e){t(e)}}))},this.resumeRecording=function(){return new Promise((function(e,t){try{r.recordRTC.resumeRecording(),e()}catch(e){t(e)}}))},this.getDataURL=function(e){return new Promise((function(e,t){try{r.recordRTC.getDataURL((function(t){e(t)}))}catch(e){t(e)}}))},this.getBlob=function(){return new Promise((function(e,t){try{e(r.recordRTC.getBlob())}catch(e){t(e)}}))},this.getInternalRecorder=function(){return new Promise((function(e,t){try{e(r.recordRTC.getInternalRecorder())}catch(e){t(e)}}))},this.reset=function(){return new Promise((function(e,t){try{e(r.recordRTC.reset())}catch(e){t(e)}}))},this.destroy=function(){return new Promise((function(e,t){try{e(r.recordRTC.destroy())}catch(e){t(e)}}))},this.getState=function(){return new Promise((function(e,t){try{e(r.recordRTC.getState())}catch(e){t(e)}}))},this.blob=null,this.version="5.6.2"},t.WebAssemblyRecorder=M})),Ks=function(){function e(){S(this,e)}return T(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),a=0,n=0;n=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(r[a]=t[n],a++);return new Uint8Array(r.buffer,0,a)}},{key:"parseSPS",value:function(t){var i=e._ebsp2rbsp(t),r=new ln(i);r.readByte();var a=r.readByte();r.readByte();var n=r.readByte();r.readUEG();var o=e.getProfileString(a),s=e.getLevelString(n),l=1,c=420,u=[0,420,422,444],d=8;if((100===a||110===a||122===a||244===a||44===a||83===a||86===a||118===a||128===a||138===a||144===a)&&(l=r.readUEG(),3===l&&r.readBits(1),l<=3&&(c=u[l]),d=r.readUEG()+8,r.readUEG(),r.readBits(1),r.readBool()))for(var h=3!==l?8:12,p=0;p0&&L<16?(T=I[L-1],E=P[L-1]):255===L&&(T=r.readByte()<<8|r.readByte(),E=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var B=r.readBits(32),M=r.readBits(32);x=r.readBool(),R=M,D=2*B,C=R/D}}var U=1;1===T&&1===E||(U=T/E);var F=0,O=0;0===l?(F=1,O=2-b):(F=3===l?1:2,O=(1===l?2:1)*(2-b));var N=16*(v+1),j=16*(A+1)*(2-b);N-=(_+k)*F,j-=(w+S)*O;var G=Math.ceil(N*U);return r.destroy(),r=null,{profile_string:o,level_string:s,bit_depth:d,ref_frames:y,chroma_format:c,chroma_format_string:e.getChromaFormatString(c),frame_rate:{fixed:x,fps:C,fps_den:D,fps_num:R},sar_ratio:{width:T,height:E},codec_size:{width:N,height:j},present_size:{width:G,height:j}}}},{key:"parseSPS$2",value:function(t){for(var i=t.subarray(1,4),r="avc1.",a=0;a<3;a++){var n=i[a].toString(16);n.length<2&&(n="0"+n),r+=n}var o=e._ebsp2rbsp(t),s=new ln(o);s.readByte();var l=s.readByte();s.readByte();var c=s.readByte();s.readUEG();var u=e.getProfileString(l),d=e.getLevelString(c),h=1,p=420,f=[0,420,422,444],m=8,g=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(h=s.readUEG(),3===h&&s.readBits(1),h<=3&&(p=f[h]),m=s.readUEG()+8,g=s.readUEG()+8,s.readBits(1),s.readBool()))for(var y=3!==h?8:12,v=0;v0&&U<16?(D=F[U-1],L=O[U-1]):255===U&&(D=s.readByte()<<8|s.readByte(),L=s.readByte()<<8|s.readByte())}if(s.readBool()&&s.readBool(),s.readBool()&&(s.readBits(4),s.readBool()&&s.readBits(24)),s.readBool()&&(s.readUEG(),s.readUEG()),s.readBool()){var N=s.readBits(32),j=s.readBits(32);P=s.readBool(),B=j,M=2*N,I=B/M}}var G=1;1===D&&1===L||(G=D/L);var z=0,H=0;0===h?(z=1,H=2-T):(z=3===h?1:2,H=(1===h?2:1)*(2-T));var W=16*(w+1),V=16*(S+1)*(2-T);W-=(E+C)*z,V-=(x+R)*H;var J=Math.ceil(W*G);return s.destroy(),s=null,{codec_mimetype:r,profile_idc:l,level_idc:c,profile_string:u,level_string:d,chroma_format_idc:h,bit_depth:m,bit_depth_luma:m,bit_depth_chroma:g,ref_frames:k,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:P,fps:I,fps_den:M,fps_num:B},sar_ratio:{width:D,height:L},codec_size:{width:W,height:V},present_size:{width:J,height:V}}}},{key:"_skipScalingList",value:function(e,t){for(var i=8,r=8,a=0,n=0;n=this.buflen)return this.iserro=!0,0;this.iserro=!1,i=this.bufoff+e>8?8-this.bufoff:e,t<<=i,t+=this.buffer[this.bufpos]>>8-this.bufoff-i&255>>8-i,this.bufoff+=i,e-=i,8==this.bufoff&&(this.bufpos++,this.bufoff=0)}return t}},{key:"look",value:function(e){var t=this.bufpos,i=this.bufoff,r=this.read(e);return this.bufpos=t,this.bufoff=i,r}},{key:"read_golomb",value:function(){var e;for(e=0;0===this.read(1)&&!this.iserro;e++);return(1<>>24&255,w>>>16&255,w>>>8&255,255&w]),T=new Uint8Array(w+4);T.set(S,0),T.set(t.sps,4),t.sps=T}if(t.pps){var E=t.pps.byteLength,C=new Uint8Array([E>>>24&255,E>>>16&255,E>>>8&255,255&E]),x=new Uint8Array(E+4);x.set(C,0),x.set(t.pps,4),t.pps=x}return t}function Xs(e){var t=e.sps,i=e.pps,r=8+t.byteLength+1+2+i.byteLength,a=!1,n=Ks.parseSPS$2(t);66!==t[3]&&77!==t[3]&&88!==t[3]&&(a=!0,r+=4);var o=new Uint8Array(r);o[0]=1,o[1]=t[1],o[2]=t[2],o[3]=t[3],o[4]=255,o[5]=225;var s=t.byteLength;o[6]=s>>>8,o[7]=255&s;var l=8;o.set(t,8),l+=s,o[l]=1;var c=i.byteLength;o[l+1]=c>>>8,o[l+2]=255&c,o.set(i,l+3),l+=3+c,a&&(o[l]=252|n.chroma_format_idc,o[l+1]=248|n.bit_depth_luma-8,o[l+2]=248|n.bit_depth_chroma-8,o[l+3]=0,l+=4);var u=[23,0,0,0,0],d=new Uint8Array(u.length+o.byteLength);return d.set(u,0),d.set(o,u.length),d}function Zs(e,t){var i=[];i[0]=t?23:39,i[1]=1,i[2]=0,i[3]=0,i[4]=0;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}function $s(e){return 31&e[0]}function el(e){return e===ei}function tl(e){return!function(e){return e===Yt||e===Qt}(e)&&!el(e)}function il(e){return e===Xt}var rl=function(){function e(t){S(this,e),this.data=t,this.eofFlag=!1,this.currentStartcodeOffset=this.findNextStartCodeOffset(0),this.eofFlag&&console.error("Could not find H264 startcode until payload end!")}return T(e,[{key:"findNextStartCodeOffset",value:function(e){for(var t=e,i=this.data;;){if(t+3>=i.byteLength)return this.eofFlag=!0,i.byteLength;var r=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],a=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===r||1===a)return t;t++}}},{key:"readNextNaluPayload",value:function(){for(var e=this.data,t=null;null==t&&!this.eofFlag;){var i=this.currentStartcodeOffset;i+=1===(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3;var r=31&e[i],a=(128&e[i])>>>7,n=this.findNextStartCodeOffset(i);this.currentStartcodeOffset=n,r>=ri||0===a&&(t={type:r,data:e.subarray(i,n)})}return t}}])}(),al=T((function e(t){S(this,e);var i=t.data.byteLength;this.type=t.type,this.data=new Uint8Array(4+i),new DataView(this.data.buffer).setUint32(0,i),this.data.set(t.data,4)})),nl=function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),a=0,n=0;n=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(r[a]=t[n],a++);return new Uint8Array(r.buffer,0,a)},ol=function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}},sl=function(){function e(){S(this,e)}return T(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),a=0,n=0;n=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(r[a]=t[n],a++);return new Uint8Array(r.buffer,0,a)}},{key:"parseVPS",value:function(t){var i=e._ebsp2rbsp(t),r=new ln(i);return r.readByte(),r.readByte(),r.readBits(4),r.readBits(2),r.readBits(6),{num_temporal_layers:r.readBits(3)+1,temporal_id_nested:r.readBool()}}},{key:"parseSPS",value:function(t){var i=e._ebsp2rbsp(t),r=new ln(i);r.readByte(),r.readByte();var a=0,n=0,o=0,s=0;r.readBits(4);var l=r.readBits(3);r.readBool();for(var c=r.readBits(2),u=r.readBool(),d=r.readBits(5),h=r.readByte(),p=r.readByte(),f=r.readByte(),m=r.readByte(),g=r.readByte(),y=r.readByte(),v=r.readByte(),A=r.readByte(),b=r.readByte(),_=r.readByte(),k=r.readByte(),w=[],S=[],T=0;T0)for(var E=l;E<8;E++)r.readBits(2);for(var C=0;C1&&r.readSEG();for(var O=0;O0&&se<=16?(ie=le[se-1],re=ce[se-1]):255===se&&(ie=r.readBits(16),re=r.readBits(16))}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(3),r.readBool(),r.readBool()&&(r.readByte(),r.readByte(),r.readByte())),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool(),r.readBool(),r.readBool(),ee=r.readBool(),ee&&(r.readUEG(),r.readUEG(),r.readUEG(),r.readUEG()),r.readBool()&&(ne=r.readBits(32),oe=r.readBits(32),r.readBool()&&r.readUEG(),r.readBool())){var ue=!1,de=!1,he=!1;ue=r.readBool(),de=r.readBool(),(ue||de)&&(he=r.readBool(),he&&(r.readByte(),r.readBits(5),r.readBool(),r.readBits(5)),r.readBits(4),r.readBits(4),he&&r.readBits(4),r.readBits(5),r.readBits(5),r.readBits(5));for(var pe=0;pe<=l;pe++){var fe=r.readBool();ae=fe;var me=!0,ge=1;fe||(me=r.readBool());var ye=!1;if(me?r.readUEG():ye=r.readBool(),ye||(ge=r.readUEG()+1),ue){for(var ve=0;ve>6&3,i.general_tier_flag=e[1]>>5&1,i.general_profile_idc=31&e[1],i.general_profile_compatibility_flags=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i.general_constraint_indicator_flags=e[6]<<24|e[7]<<16|e[8]<<8|e[9],i.general_constraint_indicator_flags=i.general_constraint_indicator_flags<<16|e[10]<<8|e[11],i.general_level_idc=e[12],i.min_spatial_segmentation_idc=(15&e[13])<<8|e[14],i.parallelismType=3&e[15],i.chromaFormat=3&e[16],i.bitDepthLumaMinus8=7&e[17],i.bitDepthChromaMinus8=7&e[18],i.avgFrameRate=e[19]<<8|e[20],i.constantFrameRate=e[21]>>6&3,i.numTemporalLayers=e[21]>>3&7,i.temporalIdNested=e[21]>>2&1,i.lengthSizeMinusOne=3&e[21];for(var r=e[22],a=e.slice(23),n=0;n0)for(var n=i;n<8;n++)e.read(2);r.sub_layer_profile_space=[],r.sub_layer_tier_flag=[],r.sub_layer_profile_idc=[],r.sub_layer_profile_compatibility_flag=[],r.sub_layer_progressive_source_flag=[],r.sub_layer_interlaced_source_flag=[],r.sub_layer_non_packed_constraint_flag=[],r.sub_layer_frame_only_constraint_flag=[],r.sub_layer_level_idc=[];for(var o=0;o0)for(var _=r;_<8;_++)i.readBits(2);for(var k=0;k1&&i.readSEG();for(var P=0;P0&&ie<16?(X=re[ie-1],Z=ae[ie-1]):255===ie&&(X=i.readBits(16),Z=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),Y=i.readBool(),Y&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(ee=i.readBits(32),te=i.readBits(32),i.readBool()&&(i.readUEG(),i.readBool()))){var ne=!1,oe=!1,se=!1;ne=i.readBool(),oe=i.readBool(),(ne||oe)&&(se=i.readBool(),se&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),se&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(var le=0;le<=r;le++){var ce=i.readBool();$=ce;var ue=!1,de=1;ce||(ue=i.readBool());var he=!1;if(ue?i.readSEG():he=i.readBool(),he||(cpbcnt=i.readUEG()+1),ne)for(var pe=0;pe>8,c[14]=255&a.min_spatial_segmentation_idc,c[15]=252|3&a.parallelismType,c[16]=252|3&a.chroma_format_idc,c[17]=248|7&a.bit_depth_luma_minus8,c[18]=248|7&a.bit_depth_chroma_minus8,c[19]=0,c[20]=0,c[21]=(3&a.constant_frame_rate)<<6|(7&a.num_temporal_layers)<<3|(a.temporal_id_nested?1:0)<<2|3,c[22]=3,c[23]=128|si,c[24]=0,c[25]=1,c[26]=(65280&t.byteLength)>>8,c[27]=(255&t.byteLength)>>0,c.set(t,28),c[23+(5+t.byteLength)+0]=128|ci,c[23+(5+t.byteLength)+1]=0,c[23+(5+t.byteLength)+2]=1,c[23+(5+t.byteLength)+3]=(65280&r.byteLength)>>8,c[23+(5+t.byteLength)+4]=(255&r.byteLength)>>0,c.set(r,23+(5+t.byteLength)+5),c[23+(5+t.byteLength+5+r.byteLength)+0]=128|di,c[23+(5+t.byteLength+5+r.byteLength)+1]=0,c[23+(5+t.byteLength+5+r.byteLength)+2]=1,c[23+(5+t.byteLength+5+r.byteLength)+3]=(65280&i.byteLength)>>8,c[23+(5+t.byteLength+5+r.byteLength)+4]=(255&i.byteLength)>>0,c.set(i,23+(5+t.byteLength+5+r.byteLength)+5);var u=[28,0,0,0,0],d=new Uint8Array(u.length+c.byteLength);return d.set(u,0),d.set(c,u.length),d}function hl(e,t){var i=[];i[0]=t?28:44,i[1]=1,i[2]=0,i[3]=0,i[4]=0;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}function pl(e){return(126&e[0])>>1}function fl(e){return!function(e){return e>=32&&e<=40}(e)}function ml(e){return e>=16&&e<=21}var gl=function(){function e(t){S(this,e),this.data=t,this.eofFlag=!1,this.currentStartcodeOffset=this.findNextStartCodeOffset(0),this.eofFlag&&console.error("Could not find H265 startcode until payload end!")}return T(e,[{key:"findNextStartCodeOffset",value:function(e){for(var t=e,i=this.data;;){if(t+3>=i.byteLength)return this.eofFlag=!0,i.byteLength;var r=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],a=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===r||1===a)return t;t++}}},{key:"readNextNaluPayload",value:function(){for(var e=this.data,t=null;null==t&&!this.eofFlag;){var i=this.currentStartcodeOffset;i+=1===(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3;var r=e[i]>>1&63,a=(128&e[i])>>>7,n=this.findNextStartCodeOffset(i);this.currentStartcodeOffset=n,0===a&&(t={type:r,data:e.subarray(i,n)})}return t}}])}(),yl=T((function e(t){S(this,e);var i=t.data.byteLength;this.type=t.type,this.data=new Uint8Array(4+i),new DataView(this.data.buffer).setUint32(0,i),this.data.set(t.data,4)})),vl=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.TAG_NAME="recorderCommon",i.player=e,i.fileName="",i._isRecording=!1,i._recordingTimestamp=0,i.recordingInterval=null,i.sps=null,i.pps=null,i.vps=null,i.codecId=null,i.audioCodeId=null,i.metaInfo={codecWidth:0,codecHeight:0,presentWidth:0,presentHeight:0,refSampleDuration:0,timescale:1e3,avcc:null,videoType:""},i.audioMetaInfo={timescale:1e3,sampleRate:0,refSampleDuration:0,channelCount:0,codec:"",originalCodec:"",audioType:"",extraData:new Uint8Array(0)},i}return k(t,e),T(t,[{key:"destroy",value:function(){this._reset(),this.sps=null,this.pps=null,this.vps=null,this.codecId=null,this.audioCodeId=null,this.metaInfo=null,this.audioMetaInfo=null}},{key:"isH264",get:function(){return this.codecId===Gt}},{key:"isH265",get:function(){return this.codecId===zt}},{key:"setFileName",value:function(e){this.fileName=e}},{key:"isRecording",get:function(){return this._isRecording}},{key:"recording",get:function(){return this._isRecording}},{key:"recordTime",get:function(){return this._recordingTimestamp}},{key:"startRecord",value:function(){}},{key:"handleAddNaluTrack",value:function(e,t,i,r){}},{key:"handleAddAudioTrack",value:function(e,t){}},{key:"handleAddTrack",value:function(e){}},{key:"stopRecordAndSave",value:function(){}},{key:"startRecordingInterval",value:function(){}},{key:"isWasmMp4",value:function(){return!1}},{key:"stopRecordingInterval",value:function(){this.recordingInterval&&clearInterval(this.recordingInterval),this.recordingInterval=null}},{key:"getToTalByteLength",value:function(){return 0}},{key:"_reset",value:function(){this.fileName="",this._isRecording=!1,this._recordingTimestamp=0,this.stopRecordingInterval()}},{key:"initMetaData",value:function(e,t){var i,r=e.slice(5);if(this.codecId=t,this.metaInfo.avcc=r,t===Gt)i=Qs(r);else if(t===zt){i=function(e){var t=23,i=e[t];if((63&i)!==si)return console.warn("parseHEVCDecoderVPSAndSPSAndPPS and vpsTag is ".concat(i)),{};t+=2,t+=1;var r=e[t+1]|e[t]<<8;t+=2;var a=e.slice(t,t+r);t+=r;var n=e[t];if((63&n)!==ci)return console.warn("parseHEVCDecoderVPSAndSPSAndPPS and sps tag is ".concat(n)),{};t+=2,t+=1;var o=e[t+1]|e[t]<<8;t+=2;var s=e.slice(t,t+o);t+=o;var l=e[t];if((63&l)!==di)return console.warn("parseHEVCDecoderVPSAndSPSAndPPS and pps tag is ".concat(l)),{};t+=2,t+=1;var c=e[t+1]|e[t]<<8;t+=2;var u=e.slice(t,t+c),d=new Uint8Array([o>>>24&255,o>>>16&255,o>>>8&255,255&o]),h=new Uint8Array([c>>>24&255,c>>>16&255,c>>>8&255,255&c]),p=new Uint8Array([r>>>24&255,r>>>16&255,r>>>8&255,255&r]),f=new Uint8Array(o+4);f.set(d,0),f.set(s,4);var m=new Uint8Array(c+4);m.set(h,0),m.set(u,4);var g=new Uint8Array(r+4);return g.set(p,0),g.set(a,4),{sps:f,pps:m,vps:g}}(r);var a=ll(e);i=Object.assign(i,a)}i&&(i.vps&&(this.vps=i.vps),i.pps&&(this.pps=i.pps),i.sps&&(this.sps=i.sps),i.presentWidth&&(this.metaInfo.presentWidth=i.presentWidth),i.presentHeight&&(this.metaInfo.presentHeight=i.presentHeight),i.codecWidth&&(this.metaInfo.codecWidth=i.codecWidth),i.codecHeight&&(this.metaInfo.codecHeight=i.codecHeight),i.timescale&&(this.metaInfo.timescale=i.timescale),i.refSampleDuration&&(this.metaInfo.refSampleDuration=i.refSampleDuration),i.videoType&&(this.metaInfo.videoType=i.videoType))}},{key:"initAudioMetaData",value:function(e,t){this.audioCodeId=t;var i=e[0]>>1&1,r=null;t===Vt?(r=function(e){var t={},i=new vn(e);return i.read(16),t.object_type=An(i),t.sample_rate=bn(i,t),t.chan_config=i.read(4),t.chan_config0){var n=a.getAudioTracks()[0];n&&n.enabled&&r.addTrack(n)}}this.recorder=qs(r,i)}catch(i){return t.error("RecorderRTC","startRecord error",i),void this.player.emitError(xt.recordCreateError,i)}this.recorder&&(this._isRecording=!0,this.player.emit(xt.recording,!0),this.recorder.startRecording(),t.log("RecorderRTC","start recording"),this.player.emit(xt.recordStart),this.startRecordingInterval())}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(xt.recordingTimestamp,e._recordingTimestamp)}),1e3)}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ot,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){e.recorder&&e._isRecording||a("recorder is not ready"),i&&e.setFileName(i),e.recorder.stopRecording((function(){e.player.debug.log("RecorderRTC","stop recording");var i=(e.fileName||Ln())+"."+W;if(e.recorder.getBlob(),t===Nt){var a=e.recorder.getBlob();r(a),e.player.emit(xt.recordBlob,a)}else r(),e.recorder.save(i);e.player.emit(xt.recordEnd),e._reset(),e.player.emit(xt.recording,!1)}))}))}},{key:"getToTalByteLength",value:function(){return this.totalByteLength}},{key:"getTotalDuration",value:function(){return this.recordTime}},{key:"getType",value:function(){return W}},{key:"initMetaData",value:function(){}}])}(vl),bl=function(){function e(){S(this,e)}return T(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],free:[],edts:[],elst:[],stss:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,97,118,99,49,109,112,52,49,0,0,0,0]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,i=null,r=Array.prototype.slice.call(arguments,1),a=r.length,n=0;n>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);for(var o=8,s=0;s=Math.pow(2,32)-1?(o=16,s=new Uint8Array(r+o),s.set(new Uint8Array([0,0,0,1]),0),s.set(e.types.mdat,4),s.set(new Uint8Array([r+8>>>56&255,r+8>>>48&255,r+8>>>40&255,r+8>>>32&255,r+8>>>24&255,r+8>>>16&255,r+8>>>8&255,r+8&255]),8)):(s=new Uint8Array(r+o),s[0]=r+8>>>24&255,s[1]=r+8>>>16&255,s[2]=r+8>>>8&255,s[3]=r+8&255,s.set(e.types.mdat,4));for(var l=0;l>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,0,0,0,3]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var i=t.id,r=t.duration,a=t.presentWidth,n=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,15,206,186,253,168,206,186,253,168,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>>8&255,255&a,0,0,n>>>8&255,255&n,0,0]))}},{key:"edts",value:function(t,i){return e.box(e.types.edts,e.elst(t,i))}},{key:"elst",value:function(t,i){for(var r=0,a=0;a>>24&255,r>>>16&255,r>>>8&255,255&r,255,255,255,255,0,1,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,0,1,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var i=t.timescale/t.refSampleDuration,r=i*t.duration/t.timescale;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,206,186,253,168,206,186,253,168,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))}},{key:"hdlr",value:function(t){var i=null;return i=e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)}},{key:"minf",value:function(t){var i=null;return i=e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){for(var i=t.samples,r=[{No:1,num:0,sampleDelte:1,chunkNo:1,duration:i[0].duration}],a=[i[0].duration],n=i.length,o=0;o>>24&255,i>>>16&255,i>>>8&255,255&i]),a=r.byteLength,n=new Uint8Array(a+8*i);n.set(r,0);for(var o=0;o>>24&255,t[o].num>>>16&255,t[o].num>>>8&255,255&t[o].num,t[o].sampleDelte>>>24&255,t[o].sampleDelte>>>16&255,t[o].sampleDelte>>>8&255,255&t[o].sampleDelte]),a),a+=8;return e.box(e.types.stts,n)}},{key:"stss",value:function(t){for(var i=[],r=t.length,a=0;a>>24&255,n>>>16&255,n>>>8&255,255&n]),s=o.byteLength,l=new Uint8Array(s+4*n);l.set(o,0);for(var c=0;c>>24&255,i[c]>>>16&255,i[c]>>>8&255,255&i[c]]),s),s+=4;return e.box(e.types.stss,l)}},{key:"stsc",value:function(t){var i=t.length,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]),a=r.byteLength,n=new Uint8Array(a+12*i);n.set(r,0);for(var o=0;o>>24&255,s>>>16&255,s>>>8&255,255&s,l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c]),a),a+=12}return e.box(e.types.stsc,n)}},{key:"stsz",value:function(t){var i=t.length,r=new Uint8Array([0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]),a=r.byteLength,n=new Uint8Array(a+4*i);n.set(r,0);for(var o=0;o>>24&255,s>>>16&255,s>>>8&255,255&s]),a),a+=4}return e.box(e.types.stsz,n)}},{key:"stco",value:function(t,i){var r=i[0].chunkOffset;return e.box(e.types.stco,new Uint8Array([0,0,0,0,0,0,0,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r]))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"avc"===t.videoType?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t))}},{key:"mp3",value:function(t){var i=t.channelCount,r=t.sampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],a)}},{key:"mp4a",value:function(t){var i=t.channelCount,r=t.sampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,a,e.esds(t))}},{key:"esds",value:function(t){var i=t.config||[],r=i.length,a=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(i).concat([6,1,2]));return e.box(e.types.esds,a)}},{key:"avc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,13,106,101,115,115,105,98,117,99,97,45,112,114,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,n,e.box(e.types.avcC,i))}},{key:"hvc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,13,106,101,115,115,105,98,117,99,97,45,112,114,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,n,e.box(e.types.hvcC,i))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var i=t.id,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)}},{key:"moof",value:function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))}},{key:"mfhd",value:function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)}},{key:"traf",value:function(t,i){var r=t.id,a=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),n=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),o=e.sdtp(t),s=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,a,n,s,o)}},{key:"sdtp",value:function(t){for(var i=t.samples||[],r=i.length,a=new Uint8Array(4+r),n=0;n>>24&255,a>>>16&255,a>>>8&255,255&a,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*s)}return e.box(e.types.trun,o)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}])}();bl.init();var _l=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="recorderMP4",i._reset(),e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this._reset(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_reset",value:function(){b(t,"_reset",this,3)([]),this.totalDuration=0,this.totalAudioDuration=0,this.totalByteLength=0,this.totalAudioByteLength=0,this.bufferList=[],this.audioBufferList=[],this.cacheTrack={},this.audioCacheTrack={},this.sequenceNumber=0,this.audioSequenceNumber=0}},{key:"startRecord",value:function(){var e=this.player.debug;this._isRecording=!0,this.player.emit(xt.recording,!0),e.log(this.TAG_NAME,"start recording"),this.player.emit(xt.recordStart),this.startRecordingInterval()}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(xt.recordingTimestamp,e.getTotalDuration())}),1e3)}},{key:"formatFmp4Track",value:function(e,t,i,r){return{id:1,sequenceNumber:++this.sequenceNumber,size:e.byteLength,dts:i,cts:r,isKeyframe:t,data:e,duration:0,flags:{isLeading:0,dependsOn:t?2:1,isDependedOn:t?1:0,hasRedundancy:0,isNonSync:t?0:1}}}},{key:"formatAudioFmp4Track",value:function(e,t){return{id:2,sequenceNumber:++this.audioSequenceNumber,size:e.byteLength,dts:t,pts:t,cts:0,data:new Uint8Array(e),duration:0,originalDts:t,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}}},{key:"handleAddNaluTrack",value:function(e,t,i,r){this.cacheTrack.id&&i>=this.cacheTrack.dts?(this.cacheTrack.duration=i-this.cacheTrack.dts,this.handleAddFmp4Track(this.cacheTrack)):this.cacheTrack={},this.cacheTrack=this.formatFmp4Track(e,t,i,r)}},{key:"handleAddAudioTrack",value:function(e,t){}},{key:"handleAddFmp4Track",value:function(e){if(this.isRecording)if(null!==this.sps&&null!==this.pps||!this.isH264)if(null!==this.sps&&null!==this.pps&&null!==this.vps||!this.isH265){var t=Object.assign({},e);t.pts=t.dts+t.cts;var i=t.data;if(t.isKeyframe)if(this.isH264){var r=new Uint8Array(this.sps.byteLength+this.pps.byteLength);r.set(this.sps,0),r.set(this.pps,this.sps.byteLength);var a=new Uint8Array(r.byteLength+i.byteLength);a.set(r,0),a.set(i,r.byteLength),t.data=a}else if(this.isH265){var n=new Uint8Array(this.sps.byteLength+this.pps.byteLength+this.vps.byteLength);n.set(this.vps,0),n.set(this.sps,this.vps.byteLength),n.set(this.pps,this.vps.byteLength+this.sps.byteLength);var o=new Uint8Array(n.byteLength+i.byteLength);o.set(n,0),o.set(i,n.byteLength),t.data=o}t.size=t.data.byteLength,this.totalDuration+=t.duration,this.totalByteLength+=t.data.byteLength,t.duration=0,t.originalDts=t.dts,delete t.id,delete t.sequenceNumber,this.bufferList.push(t)}else this.player.debug.error(this.TAG_NAME,"handleAddFmp4Track, is h265 and this.sps or this.pps or this.vps is null ");else this.player.debug.error(this.TAG_NAME,"handleAddFmp4Track, is h264 and this.sps or this.pps is null ");else this.player.debug.error(this.TAG_NAME,"handleAddFmp4Track, isRecording is false ")}},{key:"handleAddFmp4AudioTrack",value:function(e){var t=Object.assign({},e);t.pts=t.dts+t.cts,t.size=t.data.byteLength,this.totalAudioDuration+=t.duration,this.totalAudioByteLength+=t.data.byteLength,t.duration=0,t.originalDts=t.dts,delete t.id,delete t.sequenceNumber,this.audioBufferList.push(t)}},{key:"getTotalDuration",value:function(){return this.totalDuration/1e3}},{key:"getType",value:function(){return H}},{key:"getToTalByteLength",value:function(){return this.totalByteLength+this.totalAudioByteLength}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ot,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){if(!e.isRecording)return e.player.debug.error(e.TAG_NAME,"stop recording fail, isRecording is false "),a("stop recording fail, isRecording is false ");if(0===e.bufferList.length)return e.player.debug.error(e.TAG_NAME,"stop recording fail, this.bufferList.length is 0 "),a("stop recording fail, this.bufferList.length is 0 ");i&&e.setFileName(i);var n=w({id:1,type:"video",sps:e.sps,pps:e.pps,samples:e.bufferList,sequenceNumber:e.bufferList.length,length:0,addSampleNum:1,duration:0},e.metaInfo),o=w({id:2,type:"audio",sequenceNumber:e.audioBufferList.length,samples:e.audioBufferList},e.audioMetaInfo),s=[n];o.samples.length>0&&s.push(o),e.player.debug.log(e.TAG_NAME,"trackList length is ".concat(s.length));var l=bl.generateInitSegment({timescale:1e3,duration:e.totalDuration},s,e.totalByteLength+e.totalAudioByteLength);e.player.debug.log(e.TAG_NAME,"stop recording");var c=new Blob([l],{type:"application/octet-stream"});t===Nt?(r(c),e.player.emit(xt.recordBlob,c)):(r(),io((e.fileName||Ln())+"."+H,c)),e._reset(),e.player.emit(xt.recording,!1)}))}}])}(vl),kl=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="FlvRecorderLoader",i.player=e,i._init(),i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this._init(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_init",value:function(){this.hasAudio=!1,this.hasVideo=!1,this.startTime=null,this.currentTime=0,this.prevTimestamp=0,this.totalByteLength=0,this.totalDuration=0,this.flvMetaData=null,this.aacSequenceHeader=null,this.videoSequenceHeader=null,this.bufferList=[]}},{key:"_reset",value:function(){b(t,"_reset",this,3)([]),this._init()}},{key:"startRecord",value:function(){var e=this.player.debug;this._isRecording=!0,this.player.emit(xt.recording,!0),e.log(this.TAG_NAME,"start recording"),this.player.emit(xt.recordStart),this.startRecordingInterval()}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(xt.recordingTimestamp,e.getTotalDuration())}),1e3)}},{key:"addMetaData",value:function(e){this.flvMetaData=e}},{key:"addAACSequenceHeader",value:function(e){this.aacSequenceHeader=e}},{key:"addVideoSequenceHeader",value:function(e){this.videoSequenceHeader=e}},{key:"addVideo",value:function(e,t){this._setStartTime(t);var i=this._getBufferTs(t);this.hasVideo=!0,this._createBufferItem(e,ct,i)}},{key:"addAudio",value:function(e,t){this._setStartTime(t);var i=this._getBufferTs(t);this.hasAudio=!0,this._createBufferItem(e,lt,i)}},{key:"_setStartTime",value:function(e){null===this.startTime&&this._isRecording&&(this.startTime=e,this.player.debug.log(this.TAG_NAME,"_setStartTime is ".concat(e)))}},{key:"_getBufferTs",value:function(e){e>this.currentTime&&(this.currentTime=e);var t=0;return this.startTime&&e>=this.startTime&&(t=e-this.startTime),t>this.prevTimestamp?this.prevTimestamp=t:t=this.prevTimestamp,t}},{key:"_createBufferItem",value:function(e,t,i){var r=this._createFlvPacket(e,t,i),a=this._createFlvTag(r);this.totalByteLength+=a.byteLength,this.bufferList.push(a)}},{key:"_createFlvTag",value:function(e){var t=11+e.header.length,i=new Uint8Array(t+4);i[0]=e.header.type;var r=new DataView(i.buffer);return i[1]=e.header.length>>16&255,i[2]=e.header.length>>8&255,i[3]=255&e.header.length,i[4]=e.header.timestamp>>16&255,i[5]=e.header.timestamp>>8&255,i[6]=255&e.header.timestamp,i[7]=e.header.timestamp>>24&255,i[8]=0,i[9]=0,i[10]=0,r.setUint32(t,t),i.set(e.payload.subarray(0,e.header.length),11),i}},{key:"_createFlvPacket",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{header:{length:e?e.length:0,timestamp:i,type:t},payload:e}}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ot,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){if(!e.isRecording)return e.player.debug.error(e.TAG_NAME,"stop recording fail, isRecording is false "),a("stop recording fail, isRecording is false ");if(0===e.bufferList.length)return e.player.debug.error(e.TAG_NAME,"stop recording fail, this.bufferList.length is 0 "),a("stop recording fail, this.bufferList.length is 0 ");i&&e.setFileName(i);var n=new Uint8Array([70,76,86,1,0,0,0,0,9,0,0,0,0]);e.hasVideo&&(n[4]|=1),e.hasAudio&&(n[4]|=4);var o=[n];if(e.flvMetaData){var s=e._createFlvPacket(e.flvMetaData,ut),l=e._createFlvTag(s);o.push(l)}if(e.videoSequenceHeader){var c=e._createFlvPacket(e.videoSequenceHeader,ct),u=e._createFlvTag(c);o.push(u)}if(e.aacSequenceHeader){var d=e._createFlvPacket(e.aacSequenceHeader,lt),h=e._createFlvTag(d);o.push(h)}var p=function(e){var t=e[0].constructor;return e.reduce((function(e,i){var r=new t((0|e.byteLength)+(0|i.byteLength));return r.set(e,0),r.set(i,0|e.byteLength),r}),new t)}(o.concat(e.bufferList));e.player.debug.log(e.TAG_NAME,"stop recording");var f=new Blob([p],{type:"application/octet-stream"});t===Nt?(r(f),e.player.emit(xt.recordBlob,f)):(r(),io((e.fileName||Ln())+"."+V,f)),e._reset(),e.player.emit(xt.recording,!1)}))}},{key:"getTotalDuration",value:function(){var e=0;return null!==this.startTime&&null!==this.currentTime&&(e=this.currentTime-this.startTime),Math.round(e/1e3)}},{key:"getType",value:function(){return V}},{key:"getToTalByteLength",value:function(){return this.totalByteLength}}])}(vl),wl={init:0,findFirstStartCode:1,findSecondStartCode:2},Sl=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.isDestroyed=!1,i.reset(),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.isDestroyed=!1,this.off(),this.reset()}},{key:"reset",value:function(){this.stats=wl.init,this.tempBuffer=new Uint8Array(0),this.parsedOffset=0,this.versionLayer=0}},{key:"dispatch",value:function(e,t){var i=new Uint8Array(this.tempBuffer.length+e.length);for(i.set(this.tempBuffer,0),i.set(e,this.tempBuffer.length),this.tempBuffer=i;!this.isDestroyed;){if(this.state==wl.Init){for(var r=!1;this.tempBuffer.length-this.parsedOffset>=2&&!this.isDestroyed;)if(255==this.tempBuffer[this.parsedOffset]){if(!(!1&this.tempBuffer[this.parsedOffset+1])){this.versionLayer=this.tempBuffer[this.parsedOffset+1],this.state=wl.findFirstStartCode,this.fisrtStartCodeOffset=this.parsedOffset,this.parsedOffset+=2,r=!0;break}this.parsedOffset++}else this.parsedOffset++;if(r)continue;break}if(this.state==wl.findFirstStartCode){for(var a=!1;this.tempBuffer.length-this.parsedOffset>=2&&!this.isDestroyed;)if(255==this.tempBuffer[this.parsedOffset]){if(this.tempBuffer[this.parsedOffset+1]==this.versionLayer){this.state=wl.findSecondStartCode,this.secondStartCodeOffset=this.parsedOffset,this.parsedOffset+=2,a=!0;break}this.parsedOffset++}else this.parsedOffset++;if(a)continue;break}if(this.state==wl.findSecondStartCode){var n=this.tempBuffer.slice(this.fisrtStartCodeOffset,this.secondStartCodeOffset);this.emit("data",n,t),this.tempBuffer=this.tempBuffer.slice(this.secondStartCodeOffset),this.fisrtStartCodeOffset=0,this.parsedOffset=2,this.state=wl.findFirstStartCode}}}}])}(s),Tl=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="recorderWasmMP4",i._reset(),i.wasmMp4Recorder=new window.JessibucaProMp4Recorder({debug:e._opt.debug,debugLevel:e._opt.debugLevel,debugUuid:e._opt.debugUuid,decoder:e._opt.wasmMp4RecorderDecoder}),i.wasmMp4Recorder.on("recordingTimestamp",(function(e){i._recordingTimestamp=e/1e3})),i.mp3Demuxer=null,e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.mp3Demuxer&&(this.mp3Demuxer.destroy(),this.mp3Demuxer=null),this._reset(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_reset",value:function(){b(t,"_reset",this,3)([]),this.cacheTrack={},this.audioCacheTrack={},this.totalDuration=0,this.totalAudioDuration=0,this.totalByteLength=0,this.totalAudioByteLength=0,this.hasAudio=!1,this.hasVideo=!1}},{key:"getType",value:function(){return H}},{key:"isWasmMp4",value:function(){return!0}},{key:"getTotalDuration",value:function(){return this.totalDuration/1e3}},{key:"getToTalByteLength",value:function(){return this.totalByteLength+this.totalAudioByteLength}},{key:"startRecord",value:function(){var e=this,t=this.player.debug,i=this.player.getAudioInfo(),r=this.player.getVideoInfo(),a={};if(this.codecId){var n={type:this.codecId,width:r.width,height:r.height,extraData:this.metaInfo.avcc};a.video=n,this.hasVideo=!0}if(i.encTypeCode){var o={type:i.encTypeCode,sampleRate:i.sampleRate,channels:i.channels,extraData:this.audioMetaInfo.extraData,depth:i.depth};this.audioCodeId=i.encTypeCode,a.audio=o,this.hasAudio=!0}this.wasmMp4Recorder.startRecord(a).then((function(){e._isRecording=!0,e.player.emit(xt.recording,!0),t.log(e.TAG_NAME,"start recording"),e.player.emit(xt.recordStart),e.startRecordingInterval()})).catch((function(i){t.error(e.TAG_NAME,"startRecord error",i),e.player.emitError(xt.recordCreateError,i)}))}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(xt.recordingTimestamp,e.recordTime)}),1e3)}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ot,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){return e.isRecording?0===e.totalDuration?(e.player.debug.error(e.TAG_NAME,"stop recording fail, totalDuration is 0 "),a("stop recording fail, totalDuration is 0 ")):(i&&e.setFileName(i),void e.wasmMp4Recorder.stopRecord().then((function(i){t===Nt?(r(i),e.player.emit(xt.recordBlob,i)):(r(),io((e.fileName||Ln())+"."+H,i))})).catch((function(t){e.player.debug.error(e.TAG_NAME,"stopRecord error",t),a(t)})).finally((function(){e._reset(),e.player.emit(xt.recording,!1)}))):(e.player.debug.error(e.TAG_NAME,"stop recording fail, isRecording is false "),a("stop recording fail, isRecording is false "))}))}},{key:"handleAddAudioTrack",value:function(e,t){var i=this;this.audioCodeId===Jt?(this.mp3Demuxer||(this.mp3Demuxer=new Sl(this.player),this.mp3Demuxer.on("data",(function(e,t){i._handleAddAudioTrack(e,t)}))),this.mp3Demuxer.dispatch(e,t)):this._handleAddAudioTrack(e,t)}},{key:"_handleAddAudioTrack",value:function(e,t){No(this.hasAudio)||(this.audioCacheTrack.id&&t>=this.audioCacheTrack.dts?(this.audioCacheTrack.duration=t-this.audioCacheTrack.dts,this.totalAudioDuration+=this.audioCacheTrack.duration,this.totalAudioByteLength+=this.audioCacheTrack.payload.byteLength,this.wasmMp4Recorder.sendAudioFrame(this.audioCacheTrack.payload,this.audioCacheTrack.dts)):this.audioCacheTrack={},this.audioCacheTrack={id:2,payload:e,dts:t})}},{key:"handleAddNaluTrack",value:function(e,t,i,r){No(this.hasVideo)||(this.cacheTrack.id&&i>=this.cacheTrack.dts?(this.cacheTrack.duration=i-this.cacheTrack.dts,this.totalDuration+=this.cacheTrack.duration,this.totalByteLength+=this.cacheTrack.payload.byteLength,this.wasmMp4Recorder.sendVideoFrame(this.cacheTrack.payload,this.cacheTrack.isIFrame,this.cacheTrack.dts,this.cacheTrack.cts)):this.cacheTrack={},this.cacheTrack={id:1,payload:e,isIFrame:t,dts:i,cts:r})}}])}(vl),El=function(){function e(t){return S(this,e),new(e.getLoaderFactory(t._opt))(t)}return T(e,null,[{key:"getLoaderFactory",value:function(e){if(e.recordType===H){if(e.useWasm||e.useMSE||e.useWCS)return window.JessibucaProMp4Recorder&&e.mp4RecordUseWasm?Tl:_l}else if(e.recordType===V)return kl;return Al}}])}();function Cl(e,t,i){var r=e;if(t+i=128){t.push(String.fromCharCode(65535&n)),r+=2;continue}}}else if(i[r]<240){if(Cl(i,r,2)){var o=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2];if(o>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),r+=3;continue}}}else if(i[r]<248&&Cl(i,r,3)){var s=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3];if(s>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}var Rl=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),Dl=function(){function e(){S(this,e)}return T(e,null,[{key:"parseScriptData",value:function(t,i,r){var a={};try{var n=e.parseValue(t,i,r),o=e.parseValue(t,i+n.size,r-n.size);a[n.data]=o.data}catch(t){console.error("AMF",t.toString())}return a}},{key:"parseObject",value:function(t,i,r){var a=e.parseString(t,i,r),n=e.parseValue(t,i+a.size,r-a.size),o=n.objectEnd;return{data:{name:a.data,value:n.data},size:a.size+n.size,objectEnd:o}}},{key:"parseVariable",value:function(t,i,r){return e.parseObject(t,i,r)}},{key:"parseString",value:function(e,t,i){var r,a=new DataView(e,t,i).getUint16(0,!Rl);return r=a>0?xl(new Uint8Array(e,t+2,a)):"",{data:r,size:2+a}}},{key:"parseLongString",value:function(e,t,i){var r,a=new DataView(e,t,i).getUint32(0,!Rl);return r=a>0?xl(new Uint8Array(e,t+4,a)):"",{data:r,size:4+a}}},{key:"parseDate",value:function(e,t,i){var r=new DataView(e,t,i),a=r.getFloat64(0,!Rl);return a+=60*r.getInt16(8,!Rl)*1e3,{data:new Date(a),size:10}}},{key:"parseValue",value:function(t,i,r){var a,n=new DataView(t,i,r),o=1,s=n.getUint8(0),l=!1;try{switch(s){case 0:a=n.getFloat64(1,!Rl),o+=8;break;case 1:a=!!n.getUint8(1),o+=1;break;case 2:var c=e.parseString(t,i+1,r-1);a=c.data,o+=c.size;break;case 3:a={};var u=0;for(9==(16777215&n.getUint32(r-4,!Rl))&&(u=3);o2)return void e.player.emitError(It.audioChannelError,"audio channel is ".concat(r.channels,", max is 2"));e.player.audio&&(e.player.audio.updateAudioInfo(r),e.player._opt.playType===j?e.player.audio.initScriptNode():e.player._opt.playType===z&&e.player.audio.initScriptNodeDelay());break;case Ce:if(!e.player.video)return void i.warn("decoderWorker","onmessage render but video is null");if(e.player.isPlayer()){if(No(e.player.video.getHasInit()))return void i.warn("decoderWorker","onmessage render but video has not init");e.player.video.render(r),e.player.handleRender(),e.player.emit(xt.timeUpdate,r.ts),e.player.updateStats({dfps:!0,buf:r.delay}),e.player._times.videoStart||(e.player._times.videoStart=Ln(),e.player.handlePlayToRenderTimes())}else e.player.isPlayback()&&(e.player.updateStats({dfps:!0}),No(e.player.playbackPause)?(e.player.playback.isUseLocalCalculateTime&&e.player.playback.increaseLocalTimestamp(),e.player.playback.isUseFpsRender?e.player.video.pushData(r):e.player.video.render$2(r)):!e.player.playback.isPlaybackPauseClearCache&&e.player.playback.isCacheBeforeDecodeForFpsRender&&e.player.playback.isUseFpsRender&&e.player.video.pushData(r));break;case Me:e.player.recorder&&e.player.recorder.isRecording&&e.player._opt.recordType===H&&e.player.recorder.handleAddNaluTrack(r.buffer,r.isIFrame,r.ts,r.cts);break;case Le:e.player.recorder&&e.player.recorder.isRecording&&e.player._opt.recordType===H&&e.player.recorder.isWasmMp4()&&e.player.recorder.handleAddAudioTrack(r.buffer,r.ts);break;case Ue:var a=e.player,n=a.webcodecsDecoder,o=a.mseDecoder;e.player.updateStats({buf:r.delay});var s=new Uint8Array(r.payload);e.player._opt.useWCS&&!e.player._opt.useOffscreen?n.decodeVideo(s,r.ts,r.isIFrame,r.cts):e.player._opt.useMSE&&o.decodeVideo(s,r.ts,r.isIFrame,r.cts);break;case Fe:if(e.player._opt.useMSE){var l=new Uint8Array(r.payload);e.player.mseDecoder.decodeAudio(l,r.ts,r.cts)}break;case xe:if(!e.player.audio)return void i.warn("decoderWorker","onmessage playAudio but audio is null");(e.player.playing&&e.player.audio||!e.player.video)&&(e.player._opt.hasVideo||e.player.handleRender(),(e.player._opt.playType===j||e.player._opt.playType===z&&(No(e.player.playbackPause)||!e.player.playback.isPlaybackPauseClearCache&&e.player.playback.isCacheBeforeDecodeForFpsRender&&e.player.playback.isUseFpsRender))&&e.player.audio.play(r.buffer,r.ts));break;case Ne:if(r.type===xt.streamSuccess)e.player.stream?e.player.stream.emit(xt.streamSuccess):i.warn("decoderWorker","onmessage and workerFetch response stream success but stream is null");else if(r.type===xt.streamRate)e.player.emit(xt.kBps,(r.value/1024).toFixed(2));else if(r.type===xt.streamEnd)e.player?(r.value===M&&e.player.emit(xt.websocketClose,r.msg),e.player.stream?e.player.stream.emit(xt.streamEnd,r.msg):i&&i.warn("decoderWorker","onmessage and workerFetch response stream end but player.stream is null")):i&&i.warn("decoderWorker","onmessage and workerFetch response stream end but player is null");else if(r.type===It.websocketError)e.player&&e.player.stream?e.player.stream.emit(It.websocketError,r.value):i&&i.warn("decoderWorker","onmessage and workerFetch response websocket error but stream is null");else if(r.type===It.fetchError)e.player&&e.player.stream?e.player.stream.emit(It.fetchError,r.value):i&&i.warn("decoderWorker","onmessage and workerFetch response fetch error but stream is null");else if(r.type===xt.streamAbps)e.player.updateStats({abps:r.value});else if(r.type===xt.streamVbps)e.player._times.demuxStart||(e.player._times.demuxStart=Ln()),e.player.updateStats({vbps:r.value});else if(r.type===xt.streamDts)e.player.updateStats({dts:r.value});else if(r.type===xt.netBuf)e.player.updateStats({netBuf:r.value});else if(r.type===xt.networkDelayTimeout)e.player.emit(xt.networkDelayTimeout,r.value);else if(r.type===xt.streamStats){var c=JSON.parse(r.value);e.player.updateStats({workerStats:c})}else r.type===xt.websocketOpen&&e.player.emit(xt.websocketOpen);break;case je:e.player&&(e.player.videoIframeIntervalTs=r.value);break;case Ge:e.player&&e.player.updateStats({isDropping:!0});break;case tt:e.player.decoderCheckFirstIFrame();break;case He:e.player&&e.player.video&&e.player.video.setStreamFps(r.value);break;case Oe:r.message&&-1!==r.message.indexOf(nt)&&e.player.emitError(It.wasmDecodeError,"");break;case We:e.player.emitError(It.wasmDecodeVideoNoResponseError);break;case qe:e.player.emitError(It.simdH264DecodeVideoWidthIsTooLarge);break;case Ve:e.player.emitError(It.wasmWidthOrHeightChange);break;case Je:e.player.emitError(It.simdDecodeError);break;case ze:i.log("decoderWorker","onmessage:",ze);break;case Ke:i.log("decoderWorker","onmessage:",Ke),e._destroy();break;case Ye:e.player&&e.player.pushTempStream(r.buffer);break;case Qe:e.player&&e.player.emit(xt.videoSEI,{ts:r.ts,data:new Uint8Array(r.buffer)});break;case Xe:if(e.player){if(e.player.isRecordTypeFlv()){var u=new Uint8Array(r.buffer);e.player.recorder.addMetaData(u)}var d=Ll(new Uint8Array(r.buffer));d&&d.onMetaData&&e.player.updateMetaData(d.onMetaData)}break;case Ze:if(e.player&&e.player.isRecordTypeFlv()){var h=new Uint8Array(r.buffer);e.player.recorder.addAACSequenceHeader(h,r.ts)}break;case $e:if(e.player&&e.player.isRecordTypeFlv()){var p=new Uint8Array(r.buffer);e.player.recorder.addVideoSequenceHeader(p,r.ts)}break;case et:if(e.player&&e.player.isRecordTypeFlv()&&e.player.recording){var f=new Uint8Array(r.buffer);r.type===st?e.player.recorder.addVideo(f,r.ts):r.type===ot&&e.player.recorder.addAudio(f,r.ts)}break;case it:e.player&&(e.player.debug.log("decoderWorker","onmessage:",it),e.player.video.$videoElement.srcObject=r.mseHandle);break;case rt:e.player&&(e.player.debug.log("decoderWorker","onmessage:",rt,r.value),e.player._mseWorkerData.firstRenderTime=Number(r.value));break;case at:e.player&&(e.player.debug.log("decoderWorker","onmessage:",at,r.value,r.msg),e.player.emitError(r.value,r.msg));break;default:e.player[r.cmd]&&e.player[r.cmd](r)}}}},{key:"_initWork",value:function(){var e={debug:this.player._opt.debug,debugLevel:this.player._opt.debugLevel,debugUuid:this.player._opt.debugUuid,useOffscreen:this.player._opt.useOffscreen,useWCS:this.player._opt.useWCS,useMSE:this.player._opt.useMSE,videoBuffer:this.player._opt.videoBuffer,videoBufferDelay:this.player._opt.videoBufferDelay,openWebglAlignment:this.player._opt.openWebglAlignment,playType:this.player._opt.playType,hasAudio:this.player._opt.hasAudio,hasVideo:this.player._opt.hasVideo,playbackRate:1,playbackForwardMaxRateDecodeIFrame:this.player._opt.playbackForwardMaxRateDecodeIFrame,playbackIsCacheBeforeDecodeForFpsRender:this.player._opt.playbackConfig.isCacheBeforeDecodeForFpsRender,sampleRate:this.player.audio&&this.player.audio.audioContext&&this.player.audio.audioContext.sampleRate||0,audioBufferSize:this.player.audio&&this.player.audio.getAudioBufferSize()||1024,networkDelay:this.player._opt.networkDelay,visibility:this.player.visibility,useSIMD:this.player._opt.useSIMD,recordType:this.player._opt.recordType,checkFirstIFrame:this.player._opt.checkFirstIFrame,isM7sCrypto:this.player._opt.isM7sCrypto,isXorCrypto:this.player._opt.isXorCrypto,isSm4Crypto:this.player._opt.isSm4Crypto,sm4CryptoKey:this.player._opt.sm4CryptoKey,m7sCryptoAudio:this.player._opt.m7sCryptoAudio,isFlv:this.player._opt.isFlv,isFmp4:this.player._opt.isFmp4,isMpeg4:this.player._opt.isMpeg4,isTs:this.player._opt.isTs,isNakedFlow:this.player._opt.isNakedFlow,isHls265:this.player.isUseHls265(),isFmp4Private:this.player._opt.isFmp4Private,isEmitSEI:this.player._opt.isEmitSEI,isRecordTypeFlv:this.player.isRecordTypeFlv(),isWasmMp4:this.player.recorder&&this.player.recorder.isWasmMp4()||!1,isChrome:bo(),isDropSameTimestampGop:this.player._opt.isDropSameTimestampGop,mseDecodeAudio:this.player._opt.mseDecodeAudio,nakedFlowH265DemuxUseNew:this.player._opt.nakedFlowH265DemuxUseNew,mseDecoderUseWorker:this.player._opt.mseDecoderUseWorker,mseAutoCleanupMinBackwardDuration:this.player._opt.mseAutoCleanupMinBackwardDuration,mseAutoCleanupMaxBackwardDuration:this.player._opt.mseAutoCleanupMaxBackwardDuration,mseCorrectTimeDuration:this.player._opt.mseCorrectTimeDuration,mseCorrectAudioTimeDuration:this.player._opt.mseCorrectAudioTimeDuration};this.decoderWorker.postMessage({cmd:dt,opt:JSON.stringify(e)}),this.player._opt.isM7sCrypto&&(this.updateWorkConfig({key:"cryptoKey",value:this.player._opt.cryptoKey}),this.updateWorkConfig({key:"cryptoIV",value:this.player._opt.cryptoIV}))}},{key:"decodeVideo",value:function(e,t,i){this.player._opt.playType===j?this.player.isUseHls265()?this._decodeVideoNoDelay(e,t,i):this._decodeVideo(e,t,i):this.player._opt.playType===z&&(this.player.video.rate>=this.player._opt.playbackForwardMaxRateDecodeIFrame?i&&(this.player.debug.log("decoderWorker","current rate is ".concat(this.player.video.rate,",only decode i frame")),this._decodeVideoNoDelay(e,t,i)):1===this.player.video.rate?this._decodeVideo(e,t,i):this._decodeVideoNoDelay(e,t,i))}},{key:"_decodeVideo",value:function(e,t,i){var r={type:st,ts:Math.max(t,0),isIFrame:i};this.decoderWorker.postMessage({cmd:ht,buffer:e,options:r},[e.buffer])}},{key:"_decodeVideoNoDelay",value:function(e,t,i){this.decoderWorker.postMessage({cmd:ft,buffer:e,ts:Math.max(t,0),isIFrame:i},[e.buffer])}},{key:"decodeAudio",value:function(e,t){this.player._opt.playType===j?this.player._opt.useWCS||this.player._opt.useMSE||this.player.isUseHls265()?this._decodeAudioNoDelay(e,t):this._decodeAudio(e,t):this.player._opt.playType===z&&(1===this.player.video.rate?this._decodeAudio(e,t):this._decodeAudioNoDelay(e,t))}},{key:"_decodeAudio",value:function(e,t){var i={type:ot,ts:Math.max(t,0)};this.decoderWorker.postMessage({cmd:ht,buffer:e,options:i},[e.buffer])}},{key:"_decodeAudioNoDelay",value:function(e,t){this.decoderWorker.postMessage({cmd:pt,buffer:e,ts:Math.max(t,0)},[e.buffer])}},{key:"updateWorkConfig",value:function(e){this.decoderWorker&&this.decoderWorker.postMessage({cmd:gt,key:e.key,value:e.value})}},{key:"workerFetchStream",value:function(e){var t=this.player._opt,i={protocol:t.protocol,isFlv:t.isFlv,isFmp4:t.isFmp4,isMpeg4:t.isMpeg4,isNakedFlow:t.isNakedFlow,isTs:t.isTs};this.decoderWorker.postMessage({cmd:vt,url:e,opt:JSON.stringify(i)})}},{key:"clearWorkBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.decoderWorker.postMessage({cmd:yt,needClear:e})}},{key:"workerSendMessage",value:function(e){this.decoderWorker.postMessage({cmd:At,message:e})}},{key:"updateVideoTimestamp",value:function(e){this.decoderWorker.postMessage({cmd:bt,message:e})}}])}(),Bl="application/json, text/javascript",Ml="text/html",Ul=/^(?:text|application)\/xml/i,Fl=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ol=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nl=/^\s*$/,jl={},Gl={},zl="",Hl={type:"GET",beforeSend:Wl,success:Wl,error:Wl,complete:Wl,context:null,xhr:function(){return new window.XMLHttpRequest},accepts:{json:Bl,xml:"application/xml, text/xml",html:Ml,text:"text/plain","*":"*/".concat("*")},crossDomain:!1,timeout:0,username:null,password:null,processData:!0,promise:Wl,contentType:"application/x-www-form-urlencoded; charset=UTF-8"};function Wl(){}var Vl=function(e,t){"object"==E(e)&&(t=e,e=void 0);var i=$l({},t=t||{});for(var r in Hl)void 0===i[r]&&(i[r]=Hl[r]);try{var a={},n=new Promise((function(e,t){a.resolve=e,a.reject=t}));n.resolve=a.resolve,n.reject=a.reject,i.promise=n}catch(e){i.promise={resolve:Wl,reject:Wl}}var o=Ol.exec(window.location.href.toLowerCase())||[];i.url=((e||i.url||window.location.href)+"").replace(/#.*$/,"").replace(/^\/\//,o[1]+"//");var s=i.url;i.crossDomain||(i.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(i.url)&&RegExp.$2!==window.location.href);var l=i.dataType;if("jsonp"===l){if(!/=\?/.test(i.url)){var c=(i.jsonp||"callback")+"=?";i.url=Ql(i.url,c)}return function(e){var t,i=e.jsonpCallback||"jsonp"+ic(),r=window.document.createElement("script"),a={abort:function(){i in window&&(window[i]=Wl)}},n=window.document.getElementsByTagName("head")[0]||window.document.documentElement;function o(i){window.clearTimeout(t),a.abort(),Kl(i.type,a,i.type,e),s()}function s(){r.clearAttributes?r.clearAttributes():r.onload=r.onreadystatechange=r.onerror=null,r.parentNode&&r.parentNode.removeChild(r),r=null,delete window[i]}return r.onerror=function(e){o(e)},window[i]=function(i){window.clearTimeout(t),Jl(i,a,e),s()},Xl(e),r.src=e.url.replace(/=\?/,"="+i),r.src=Ql(r.src,"_="+(new Date).getTime()),r.async=!0,e.scriptCharset&&(r.charset=e.scriptCharset),n.insertBefore(r,n.firstChild),e.timeout>0&&(t=window.setTimeout((function(){a.abort(),Kl("timeout",a,"timeout",e),s()}),e.timeout)),e.promise.abort=function(){a.abort()},e.promise.xhr=a,e.promise}(i)}Xl(i);var u=i.accepts[l]||i.accepts["*"],d={};/^([\w-]+:)\/\//.test(i.url)?RegExp.$1:window.location.protocol;var h,p=Hl.xhr();i.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest"),i.ifModified&&(jl[s]&&(d["If-Modified-Since"]=jl[s]),Gl[s]&&(d["If-None-Match"]=Gl[s])),u&&(d.Accept=u,u.indexOf(",")>-1&&(u=u.split(",",2)[0]),p.overrideMimeType&&p.overrideMimeType(u));var f=!/^(?:GET|HEAD)$/.test(i.type.toUpperCase());if((i.data&&f&&!1!==i.contentType||t.contentType)&&(d["Content-Type"]=i.contentType),!1===i.cache&&!f){var m=/([?&])_=[^&]*/;i.url=m.test(s)?s.replace(m,"$1_="+ic()):s+(/\?/.test(s)?"&":"?")+"_="+ic()}i.headers=$l(d,i.headers||{}),p.onreadystatechange=function(){if(4===p.readyState){var e;clearTimeout(h);var t=!1;if(p.status>=200&&p.status<300||304===p.status){if(zl=p.getAllResponseHeaders(),i.ifModified){var r=Yl("Last-Modified");r&&(jl[s]=r),(r=Yl("etag"))&&(Gl[s]=r)}l=l||function(e){return e&&(e===Ml?"html":e===Bl?"json":Ul.test(e)&&"xml")||"text"}(p.getResponseHeader("content-type")),e=p.responseText;try{"xml"===l?e=p.responseXML:"json"===l&&(e=Nl.test(e)?null:JSON.parse(e))}catch(e){t=e}t?Kl(t,"parseerror",p,i):Jl(e,p,i)}else Kl(null,"error",p,i)}};var g=!("async"in i)||i.async;if(p.open(i.type,i.url,g,i.username,i.password),i.xhrFields)for(var y in i.xhrFields)p[y]=i.xhrFields[y];for(var y in i.mimeType&&p.overrideMimeType&&p.overrideMimeType(i.mimeType),i.headers)void 0!==i.headers[y]&&p.setRequestHeader(y,i.headers[y]+"");return!1===function(e,t){var i=t.context;if(!1===t.beforeSend.call(i,e,t))return!1}(p,i)?(p.abort(),!1):(i.timeout>0&&(h=window.setTimeout((function(){p.onreadystatechange=Wl,p.abort(),Kl(null,"timeout",p,i)}),i.timeout)),p.send(i.data?i.data:null),i.promise.abort=function(){p.abort()},i.promise)};function Jl(e,t,i){var r=i.context,a="success";i.success.call(r,e,a,t),i.promise.resolve(e,a,t),ql(a,t,i)}function ql(e,t,i){var r=i.context;i.complete.call(r,t,e)}function Kl(e,t,i,r){var a=r.context;r.error.call(a,i,t,e),r.promise.reject(i,t,e),ql(t,i,r)}function Yl(e){var t;if(!Il){for(Il={};t=Fl.exec(zl);)Il[t[1].toLowerCase()]=t[2];t=Il[e.toLowerCase()]}return null===t?null:t}function Ql(e,t){return(e+"&"+t).replace(/[&?]{1,2}/,"?")}function Xl(e){!ec(e)||e.data instanceof FormData||!e.processData||(e.data=function(e,t){var i=[];return i.add=function(e,t){this.push(encodeURIComponent(e)+"="+encodeURIComponent(t))},Zl(i,e,t),i.join("&").replace("%20","+")}(e.data)),!e.data||e.type&&"GET"!==e.type.toUpperCase()||(e.url=Ql(e.url,e.data))}function Zl(e,t,i,r){var a=function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t);for(var n in t){var o=t[n];r&&(n=i?r:r+"["+(a?"":n)+"]"),!r&&a?e.add(o.name,o.value):(i?a(o):ec(o))?Zl(e,o,i,n):e.add(n,o)}}function $l(e){for(var t=Array.prototype.slice,i=t.call(arguments,1),r=0,a=i.length;r255)return!1;return!0}function nc(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!ac(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(rc(e.length)&&ac(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function oc(e){return new Uint8Array(e)}function sc(e,t,i,r,a){null==r&&null==a||(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,i)}Vl.get=function(e,t,i,r){return tc(t)&&(r=r||i,i=t,t=void 0),Vl({url:e,data:t,success:i,dataType:r})},Vl.post=function(e,t,i,r){return tc(t)&&(r=r||i,i=t,t=void 0),Vl({type:"POST",url:e,data:t,success:i,dataType:r})},Vl.getJSON=function(e,t,i){return tc(t)&&(i=t,t=void 0),Vl({url:e,data:t,success:i,dataType:"json"})},Vl.ajaxSetup=function(e,t){return t?$l($l(e,Hl),t):$l(Hl,e)};var lc={toBytes:function(e){var t=[],i=0;for(e=encodeURI(e);i191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[i+1])),i+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[i+1])<<6|63&e[i+2])),i+=3)}return t.join("")}},cc=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],i=0;i>4]+e[15&a])}return i.join("")}}}(),uc={16:10,24:12,32:14},dc=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],hc=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],pc=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],fc=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],mc=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],gc=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],yc=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],vc=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Ac=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],bc=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_c=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],kc=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],wc=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Sc=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Tc=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Ec(e){for(var t=[],i=0;i>2,this._Ke[i][t%4]=n[t],this._Kd[e-i][t%4]=n[t];for(var o,s=0,l=a;l>16&255]<<24^hc[o>>8&255]<<16^hc[255&o]<<8^hc[o>>24&255]^dc[s]<<24,s+=1,8!=a)for(t=1;t>8&255]<<8^hc[o>>16&255]<<16^hc[o>>24&255]<<24,t=a/2+1;t>2,u=l%4,this._Ke[c][u]=n[t],this._Kd[e-c][u]=n[t++],l++}for(var c=1;c>24&255]^wc[o>>16&255]^Sc[o>>8&255]^Tc[255&o]},Cc.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,i=[0,0,0,0],r=Ec(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var n=1;n>24&255]^mc[r[(a+1)%4]>>16&255]^gc[r[(a+2)%4]>>8&255]^yc[255&r[(a+3)%4]]^this._Ke[n][a];r=i.slice()}var o,s=oc(16);for(a=0;a<4;a++)o=this._Ke[t][a],s[4*a]=255&(hc[r[a]>>24&255]^o>>24),s[4*a+1]=255&(hc[r[(a+1)%4]>>16&255]^o>>16),s[4*a+2]=255&(hc[r[(a+2)%4]>>8&255]^o>>8),s[4*a+3]=255&(hc[255&r[(a+3)%4]]^o);return s},Cc.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,i=[0,0,0,0],r=Ec(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var n=1;n>24&255]^Ac[r[(a+3)%4]>>16&255]^bc[r[(a+2)%4]>>8&255]^_c[255&r[(a+1)%4]]^this._Kd[n][a];r=i.slice()}var o,s=oc(16);for(a=0;a<4;a++)o=this._Kd[t][a],s[4*a]=255&(pc[r[a]>>24&255]^o>>24),s[4*a+1]=255&(pc[r[(a+3)%4]>>16&255]^o>>16),s[4*a+2]=255&(pc[r[(a+2)%4]>>8&255]^o>>8),s[4*a+3]=255&(pc[255&r[(a+1)%4]]^o);return s};var xc=function(e){if(!(this instanceof xc))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Cc(e)};xc.prototype.encrypt=function(e){if((e=nc(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=oc(e.length),i=oc(16),r=0;rNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},Ic.prototype.setBytes=function(e){if(16!=(e=nc(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},Ic.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var Pc=function(e,t){if(!(this instanceof Pc))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof Ic||(t=new Ic(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Cc(e)};Pc.prototype.encrypt=function(e){for(var t=nc(e,!0),i=0;i16)throw new Error("PKCS#7 padding byte out of range");for(var i=e.length-t,r=0;r>>2]>>>24-n%4*8&255;t[r+n>>>2]|=o<<24-(r+n)%4*8}else for(var s=0;s>>2]=i[s>>>2];return this.sigBytes+=a,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i>>2]>>>24-a%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,i=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(i,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,r=[],a=0;a>>2]>>>24-a%4*8&255;r.push(String.fromCharCode(n))}return r.join("")},parse:function(e){for(var t=e.length,i=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(i,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=s.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,r=this._data,a=r.words,n=r.sigBytes,o=this.blockSize,s=n/(4*o),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,u=e.min(4*l,n);if(l){for(var d=0;d>>2]|=e[a]<<24-a%4*8;t.call(this,r,i)}else t.apply(this,arguments)};r.prototype=e}}(),i.lib.WordArray)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.WordArray,r=e.enc;function a(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,i=e.sigBytes,r=[],a=0;a>>2]>>>16-a%4*8&65535;r.push(String.fromCharCode(n))}return r.join("")},parse:function(e){for(var i=e.length,r=[],a=0;a>>1]|=e.charCodeAt(a)<<16-a%2*16;return t.create(r,2*i)}},r.Utf16LE={stringify:function(e){for(var t=e.words,i=e.sigBytes,r=[],n=0;n>>2]>>>16-n%4*8&65535);r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var i=e.length,r=[],n=0;n>>1]|=a(e.charCodeAt(n)<<16-n%2*16);return t.create(r,2*i)}}}(),i.enc.Utf16)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.WordArray;function r(e,i,r){for(var a=[],n=0,o=0;o>>6-o%4*2;a[n>>>2]|=s<<24-n%4*8,n++}return t.create(a,n)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,r=this._map;e.clamp();for(var a=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;s<4&&n+.75*s>>6*(3-s)&63));var l=r.charAt(64);if(l)for(;a.length%4;)a.push(l);return a.join("")},parse:function(e){var t=e.length,i=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var n=0;n>>6-o%4*2;a[n>>>2]|=s<<24-n%4*8,n++}return t.create(a,n)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var i=e.words,r=e.sigBytes,a=t?this._safe_map:this._map;e.clamp();for(var n=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(i[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|i[o+2>>>2]>>>24-(o+2)%4*8&255,l=0;l<4&&o+.75*l>>6*(3-l)&63));var c=a.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e,t){void 0===t&&(t=!0);var i=e.length,a=t?this._safe_map:this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>24)|4278255360&(a<<24|a>>>8)}var n=this._hash.words,o=e[t+0],l=e[t+1],p=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],y=e[t+6],v=e[t+7],A=e[t+8],b=e[t+9],_=e[t+10],k=e[t+11],w=e[t+12],S=e[t+13],T=e[t+14],E=e[t+15],C=n[0],x=n[1],R=n[2],D=n[3];C=c(C,x,R,D,o,7,s[0]),D=c(D,C,x,R,l,12,s[1]),R=c(R,D,C,x,p,17,s[2]),x=c(x,R,D,C,f,22,s[3]),C=c(C,x,R,D,m,7,s[4]),D=c(D,C,x,R,g,12,s[5]),R=c(R,D,C,x,y,17,s[6]),x=c(x,R,D,C,v,22,s[7]),C=c(C,x,R,D,A,7,s[8]),D=c(D,C,x,R,b,12,s[9]),R=c(R,D,C,x,_,17,s[10]),x=c(x,R,D,C,k,22,s[11]),C=c(C,x,R,D,w,7,s[12]),D=c(D,C,x,R,S,12,s[13]),R=c(R,D,C,x,T,17,s[14]),C=u(C,x=c(x,R,D,C,E,22,s[15]),R,D,l,5,s[16]),D=u(D,C,x,R,y,9,s[17]),R=u(R,D,C,x,k,14,s[18]),x=u(x,R,D,C,o,20,s[19]),C=u(C,x,R,D,g,5,s[20]),D=u(D,C,x,R,_,9,s[21]),R=u(R,D,C,x,E,14,s[22]),x=u(x,R,D,C,m,20,s[23]),C=u(C,x,R,D,b,5,s[24]),D=u(D,C,x,R,T,9,s[25]),R=u(R,D,C,x,f,14,s[26]),x=u(x,R,D,C,A,20,s[27]),C=u(C,x,R,D,S,5,s[28]),D=u(D,C,x,R,p,9,s[29]),R=u(R,D,C,x,v,14,s[30]),C=d(C,x=u(x,R,D,C,w,20,s[31]),R,D,g,4,s[32]),D=d(D,C,x,R,A,11,s[33]),R=d(R,D,C,x,k,16,s[34]),x=d(x,R,D,C,T,23,s[35]),C=d(C,x,R,D,l,4,s[36]),D=d(D,C,x,R,m,11,s[37]),R=d(R,D,C,x,v,16,s[38]),x=d(x,R,D,C,_,23,s[39]),C=d(C,x,R,D,S,4,s[40]),D=d(D,C,x,R,o,11,s[41]),R=d(R,D,C,x,f,16,s[42]),x=d(x,R,D,C,y,23,s[43]),C=d(C,x,R,D,b,4,s[44]),D=d(D,C,x,R,w,11,s[45]),R=d(R,D,C,x,E,16,s[46]),C=h(C,x=d(x,R,D,C,p,23,s[47]),R,D,o,6,s[48]),D=h(D,C,x,R,v,10,s[49]),R=h(R,D,C,x,T,15,s[50]),x=h(x,R,D,C,g,21,s[51]),C=h(C,x,R,D,w,6,s[52]),D=h(D,C,x,R,f,10,s[53]),R=h(R,D,C,x,_,15,s[54]),x=h(x,R,D,C,l,21,s[55]),C=h(C,x,R,D,A,6,s[56]),D=h(D,C,x,R,E,10,s[57]),R=h(R,D,C,x,y,15,s[58]),x=h(x,R,D,C,S,21,s[59]),C=h(C,x,R,D,m,6,s[60]),D=h(D,C,x,R,k,10,s[61]),R=h(R,D,C,x,p,15,s[62]),x=h(x,R,D,C,b,21,s[63]),n[0]=n[0]+C|0,n[1]=n[1]+x|0,n[2]=n[2]+R|0,n[3]=n[3]+D|0},_doFinalize:function(){var t=this._data,i=t.words,r=8*this._nDataBytes,a=8*t.sigBytes;i[a>>>5]|=128<<24-a%32;var n=e.floor(r/4294967296),o=r;i[15+(a+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,i,r,a,n,o){var s=e+(t&i|~t&r)+a+o;return(s<>>32-n)+t}function u(e,t,i,r,a,n,o){var s=e+(t&r|i&~r)+a+o;return(s<>>32-n)+t}function d(e,t,i,r,a,n,o){var s=e+(t^i^r)+a+o;return(s<>>32-n)+t}function h(e,t,i,r,a,n,o){var s=e+(i^(t|~r))+a+o;return(s<>>32-n)+t}t.MD5=n._createHelper(l),t.HmacMD5=n._createHmacHelper(l)}(Math),i.MD5)})),on((function(e,t){var i,r,a,n,o,s,l,c;e.exports=(r=(i=c=Mc).lib,a=r.WordArray,n=r.Hasher,o=i.algo,s=[],l=o.SHA1=n.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=this._hash.words,r=i[0],a=i[1],n=i[2],o=i[3],l=i[4],c=0;c<80;c++){if(c<16)s[c]=0|e[t+c];else{var u=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=u<<1|u>>>31}var d=(r<<5|r>>>27)+l+s[c];d+=c<20?1518500249+(a&n|~a&o):c<40?1859775393+(a^n^o):c<60?(a&n|a&o|n&o)-1894007588:(a^n^o)-899497514,l=o,o=n,n=a<<30|a>>>2,a=r,r=d}i[0]=i[0]+r|0,i[1]=i[1]+a|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+l|0},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(i/4294967296),t[15+(r+64>>>9<<4)]=i,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),i.SHA1=n._createHelper(l),i.HmacSHA1=n._createHmacHelper(l),c.SHA1)})),on((function(e,t){var i;e.exports=(i=Mc,function(e){var t=i,r=t.lib,a=r.WordArray,n=r.Hasher,o=t.algo,s=[],l=[];!function(){function t(t){for(var i=e.sqrt(t),r=2;r<=i;r++)if(!(t%r))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var r=2,a=0;a<64;)t(r)&&(a<8&&(s[a]=i(e.pow(r,.5))),l[a]=i(e.pow(r,1/3)),a++),r++}();var c=[],u=o.SHA256=n.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,r=i[0],a=i[1],n=i[2],o=i[3],s=i[4],u=i[5],d=i[6],h=i[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var f=c[p-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=c[p-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[p]=m+c[p-7]+y+c[p-16]}var v=r&a^r&n^a&n,A=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&d)+l[p]+c[p];h=d,d=u,u=s,s=o+b|0,o=n,n=a,a=r,r=b+(A+v)|0}i[0]=i[0]+r|0,i[1]=i[1]+a|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+s|0,i[5]=i[5]+u|0,i[6]=i[6]+d|0,i[7]=i[7]+h|0},_doFinalize:function(){var t=this._data,i=t.words,r=8*this._nDataBytes,a=8*t.sigBytes;return i[a>>>5]|=128<<24-a%32,i[14+(a+64>>>9<<4)]=e.floor(r/4294967296),i[15+(a+64>>>9<<4)]=r,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(u),t.HmacSHA256=n._createHmacHelper(u)}(Math),i.SHA256)})),on((function(e,t){var i,r,a,n,o,s;e.exports=(r=(i=s=Mc).lib.WordArray,a=i.algo,n=a.SHA256,o=a.SHA224=n.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}}),i.SHA224=n._createHelper(o),i.HmacSHA224=n._createHmacHelper(o),s.SHA224)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.Hasher,r=e.x64,a=r.Word,n=r.WordArray,o=e.algo;function s(){return a.create.apply(a,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var u=o.SHA512=t.extend({_doReset:function(){this._hash=new n.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var i=this._hash.words,r=i[0],a=i[1],n=i[2],o=i[3],s=i[4],u=i[5],d=i[6],h=i[7],p=r.high,f=r.low,m=a.high,g=a.low,y=n.high,v=n.low,A=o.high,b=o.low,_=s.high,k=s.low,w=u.high,S=u.low,T=d.high,E=d.low,C=h.high,x=h.low,R=p,D=f,L=m,I=g,P=y,B=v,M=A,U=b,F=_,O=k,N=w,j=S,G=T,z=E,H=C,W=x,V=0;V<80;V++){var J,q,K=c[V];if(V<16)q=K.high=0|e[t+2*V],J=K.low=0|e[t+2*V+1];else{var Y=c[V-15],Q=Y.high,X=Y.low,Z=(Q>>>1|X<<31)^(Q>>>8|X<<24)^Q>>>7,$=(X>>>1|Q<<31)^(X>>>8|Q<<24)^(X>>>7|Q<<25),ee=c[V-2],te=ee.high,ie=ee.low,re=(te>>>19|ie<<13)^(te<<3|ie>>>29)^te>>>6,ae=(ie>>>19|te<<13)^(ie<<3|te>>>29)^(ie>>>6|te<<26),ne=c[V-7],oe=ne.high,se=ne.low,le=c[V-16],ce=le.high,ue=le.low;q=(q=(q=Z+oe+((J=$+se)>>>0<$>>>0?1:0))+re+((J+=ae)>>>0>>0?1:0))+ce+((J+=ue)>>>0>>0?1:0),K.high=q,K.low=J}var de,he=F&N^~F&G,pe=O&j^~O&z,fe=R&L^R&P^L&P,me=D&I^D&B^I&B,ge=(R>>>28|D<<4)^(R<<30|D>>>2)^(R<<25|D>>>7),ye=(D>>>28|R<<4)^(D<<30|R>>>2)^(D<<25|R>>>7),ve=(F>>>14|O<<18)^(F>>>18|O<<14)^(F<<23|O>>>9),Ae=(O>>>14|F<<18)^(O>>>18|F<<14)^(O<<23|F>>>9),be=l[V],_e=be.high,ke=be.low,we=H+ve+((de=W+Ae)>>>0>>0?1:0),Se=ye+me;H=G,W=z,G=N,z=j,N=F,j=O,F=M+(we=(we=(we=we+he+((de+=pe)>>>0>>0?1:0))+_e+((de+=ke)>>>0>>0?1:0))+q+((de+=J)>>>0>>0?1:0))+((O=U+de|0)>>>0>>0?1:0)|0,M=P,U=B,P=L,B=I,L=R,I=D,R=we+(ge+fe+(Se>>>0>>0?1:0))+((D=de+Se|0)>>>0>>0?1:0)|0}f=r.low=f+D,r.high=p+R+(f>>>0>>0?1:0),g=a.low=g+I,a.high=m+L+(g>>>0>>0?1:0),v=n.low=v+B,n.high=y+P+(v>>>0>>0?1:0),b=o.low=b+U,o.high=A+M+(b>>>0>>0?1:0),k=s.low=k+O,s.high=_+F+(k>>>0>>0?1:0),S=u.low=S+j,u.high=w+N+(S>>>0>>0?1:0),E=d.low=E+z,d.high=T+G+(E>>>0>>0?1:0),x=h.low=x+W,h.high=C+H+(x>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(i/4294967296),t[31+(r+128>>>10<<5)]=i,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),i.SHA512)})),on((function(e,t){var i,r,a,n,o,s,l,c;e.exports=(r=(i=c=Mc).x64,a=r.Word,n=r.WordArray,o=i.algo,s=o.SHA512,l=o.SHA384=s.extend({_doReset:function(){this._hash=new n.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),i.SHA384=s._createHelper(l),i.HmacSHA384=s._createHmacHelper(l),c.SHA384)})),on((function(e,t){var i;e.exports=(i=Mc,function(e){var t=i,r=t.lib,a=r.WordArray,n=r.Hasher,o=t.x64.Word,s=t.algo,l=[],c=[],u=[];!function(){for(var e=1,t=0,i=0;i<24;i++){l[e+5*t]=(i+1)*(i+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,n=0;n<24;n++){for(var s=0,d=0,h=0;h<7;h++){if(1&a){var p=(1<>>24)|4278255360&(n<<24|n>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(x=i[a]).high^=o,x.low^=n}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var p=0,f=0,m=0;m<5;m++)p^=(x=i[h+5*m]).high,f^=x.low;var g=d[h];g.high=p,g.low=f}for(h=0;h<5;h++){var y=d[(h+4)%5],v=d[(h+1)%5],A=v.high,b=v.low;for(p=y.high^(A<<1|b>>>31),f=y.low^(b<<1|A>>>31),m=0;m<5;m++)(x=i[h+5*m]).high^=p,x.low^=f}for(var _=1;_<25;_++){var k=(x=i[_]).high,w=x.low,S=l[_];S<32?(p=k<>>32-S,f=w<>>32-S):(p=w<>>64-S,f=k<>>64-S);var T=d[c[_]];T.high=p,T.low=f}var E=d[0],C=i[0];for(E.high=C.high,E.low=C.low,h=0;h<5;h++)for(m=0;m<5;m++){var x=i[_=h+5*m],R=d[_],D=d[(h+1)%5+5*m],L=d[(h+2)%5+5*m];x.high=R.high^~D.high&L.high,x.low=R.low^~D.low&L.low}x=i[0];var I=u[s];x.high^=I.high,x.low^=I.low}},_doFinalize:function(){var t=this._data,i=t.words;this._nDataBytes;var r=8*t.sigBytes,n=32*this.blockSize;i[r>>>5]|=1<<24-r%32,i[(e.ceil((r+1)/n)*n>>>5)-1]|=128,t.sigBytes=4*i.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(h)}return new a.init(c,s)},clone:function(){for(var e=n.clone.call(this),t=e._state=this._state.slice(0),i=0;i<25;i++)t[i]=t[i].clone();return e}});t.SHA3=n._createHelper(h),t.HmacSHA3=n._createHmacHelper(h)}(Math),i.SHA3)})),on((function(e,t){var i;e.exports=(i=Mc,function(e){var t=i,r=t.lib,a=r.WordArray,n=r.Hasher,o=t.algo,s=a.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=a.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=a.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=a.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=a.create([0,1518500249,1859775393,2400959708,2840853838]),h=a.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=n.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var r=t+i,a=e[r];e[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var n,o,p,b,_,k,w,S,T,E,C,x=this._hash.words,R=d.words,D=h.words,L=s.words,I=l.words,P=c.words,B=u.words;for(k=n=x[0],w=o=x[1],S=p=x[2],T=b=x[3],E=_=x[4],i=0;i<80;i+=1)C=n+e[t+L[i]]|0,C+=i<16?f(o,p,b)+R[0]:i<32?m(o,p,b)+R[1]:i<48?g(o,p,b)+R[2]:i<64?y(o,p,b)+R[3]:v(o,p,b)+R[4],C=(C=A(C|=0,P[i]))+_|0,n=_,_=b,b=A(p,10),p=o,o=C,C=k+e[t+I[i]]|0,C+=i<16?v(w,S,T)+D[0]:i<32?y(w,S,T)+D[1]:i<48?g(w,S,T)+D[2]:i<64?m(w,S,T)+D[3]:f(w,S,T)+D[4],C=(C=A(C|=0,B[i]))+E|0,k=E,E=T,T=A(S,10),S=w,w=C;C=x[1]+p+T|0,x[1]=x[2]+b+E|0,x[2]=x[3]+_+k|0,x[3]=x[4]+n+w|0,x[4]=x[0]+o+S|0,x[0]=C},_doFinalize:function(){var e=this._data,t=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(t.length+1),this._process();for(var a=this._hash,n=a.words,o=0;o<5;o++){var s=n[o];n[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return a},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,i){return e^t^i}function m(e,t,i){return e&t|~e&i}function g(e,t,i){return(e|~t)^i}function y(e,t,i){return e&i|t&~i}function v(e,t,i){return e^(t|~i)}function A(e,t){return e<>>32-t}t.RIPEMD160=n._createHelper(p),t.HmacRIPEMD160=n._createHmacHelper(p)}(),i.RIPEMD160)})),on((function(e,t){var i,r,a;e.exports=(r=(i=Mc).lib.Base,a=i.enc.Utf8,void(i.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var i=e.blockSize,r=4*i;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),o=this._iKey=t.clone(),s=n.words,l=o.words,c=0;c>>2];e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:f}),reset:function(){var e;u.reset.call(this);var t=this.cfg,i=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,i&&i.words):(this._mode=e.call(r,this,i&&i.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var m=r.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,i=e.salt;return(i?n.create([1398893684,1701076831]).concat(i).concat(t):t).toString(l)},parse:function(e){var t,i=l.parse(e),r=i.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=n.create(r.slice(2,4)),r.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:t})}},y=r.SerializableCipher=a.extend({cfg:a.extend({format:g}),encrypt:function(e,t,i,r){r=this.cfg.extend(r);var a=e.createEncryptor(i,r),n=a.finalize(t),o=a.cfg;return m.create({ciphertext:n,key:i,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,i,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(i,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,i,r,a){if(r||(r=n.random(8)),a)o=c.create({keySize:t+i,hasher:a}).compute(e,r);else var o=c.create({keySize:t+i}).compute(e,r);var s=n.create(o.words.slice(t),4*i);return o.sigBytes=4*t,m.create({key:o,iv:s,salt:r})}},A=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:v}),encrypt:function(e,t,i,r){var a=(r=this.cfg.extend(r)).kdf.execute(i,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=a.iv;var n=y.encrypt.call(this,e,t,a.key,r);return n.mixIn(a),n},decrypt:function(e,t,i,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var a=r.kdf.execute(i,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=a.iv,y.decrypt.call(this,e,t,a.key,r)}})}())})),on((function(e,t){var i;e.exports=((i=Mc).mode.CFB=function(){var e=i.lib.BlockCipherMode.extend();function t(e,t,i,r){var a,n=this._iv;n?(a=n.slice(0),this._iv=void 0):a=this._prevBlock,r.encryptBlock(a,0);for(var o=0;o>24&255)){var t=e>>16&255,i=e>>8&255,r=255&e;255===t?(t=0,255===i?(i=0,255===r?r=0:++r):++i):++t,e=0,e+=t<<16,e+=i<<8,e+=r}else e+=1<<24;return e}function r(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var a=e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,a=i.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0),r(o);var s=o.slice(0);i.encryptBlock(s,0);for(var l=0;l>>2]|=a<<24-n%4*8,e.sigBytes+=a},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.pad.Ansix923)})),on((function(e,t){var i;e.exports=((i=Mc).pad.Iso10126={pad:function(e,t){var r=4*t,a=r-e.sigBytes%r;e.concat(i.lib.WordArray.random(a-1)).concat(i.lib.WordArray.create([a<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.pad.Iso10126)})),on((function(e,t){var i;e.exports=((i=Mc).pad.Iso97971={pad:function(e,t){e.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(e,t)},unpad:function(e){i.pad.ZeroPadding.unpad(e),e.sigBytes--}},i.pad.Iso97971)})),on((function(e,t){var i;e.exports=((i=Mc).pad.ZeroPadding={pad:function(e,t){var i=4*t;e.clamp(),e.sigBytes+=i-(e.sigBytes%i||i)},unpad:function(e){var t=e.words,i=e.sigBytes-1;for(i=e.sigBytes-1;i>=0;i--)if(t[i>>>2]>>>24-i%4*8&255){e.sigBytes=i+1;break}}},i.pad.ZeroPadding)})),on((function(e,t){var i;e.exports=((i=Mc).pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding)})),on((function(e,t){var i;e.exports=(i=Mc,function(e){var t=i,r=t.lib.CipherParams,a=t.enc.Hex;t.format.Hex={stringify:function(e){return e.ciphertext.toString(a)},parse:function(e){var t=a.parse(e);return r.create({ciphertext:t})}}}(),i.format.Hex)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.BlockCipher,r=e.algo,a=[],n=[],o=[],s=[],l=[],c=[],u=[],d=[],h=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var i=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,a[i]=f,n[f]=i;var m=e[i],g=e[m],y=e[g],v=257*e[f]^16843008*f;o[i]=v<<24|v>>>8,s[i]=v<<16|v>>>16,l[i]=v<<8|v>>>24,c[i]=v,v=16843009*y^65537*g^257*m^16843008*i,u[f]=v<<24|v>>>8,d[f]=v<<16|v>>>16,h[f]=v<<8|v>>>24,p[f]=v,i?(i=m^e[e[e[y^m]]],r^=e[e[r]]):i=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],m=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,i=e.sigBytes/4,r=4*((this._nRounds=i+6)+1),n=this._keySchedule=[],o=0;o6&&o%i==4&&(c=a[c>>>24]<<24|a[c>>>16&255]<<16|a[c>>>8&255]<<8|a[255&c]):(c=a[(c=c<<8|c>>>24)>>>24]<<24|a[c>>>16&255]<<16|a[c>>>8&255]<<8|a[255&c],c^=f[o/i|0]<<24),n[o]=n[o-i]^c);for(var s=this._invKeySchedule=[],l=0;l>>24]]^d[a[c>>>16&255]]^h[a[c>>>8&255]]^p[a[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,l,c,a)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,u,d,h,p,n),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,r,a,n,o,s){for(var l=this._nRounds,c=e[t]^i[0],u=e[t+1]^i[1],d=e[t+2]^i[2],h=e[t+3]^i[3],p=4,f=1;f>>24]^a[u>>>16&255]^n[d>>>8&255]^o[255&h]^i[p++],g=r[u>>>24]^a[d>>>16&255]^n[h>>>8&255]^o[255&c]^i[p++],y=r[d>>>24]^a[h>>>16&255]^n[c>>>8&255]^o[255&u]^i[p++],v=r[h>>>24]^a[c>>>16&255]^n[u>>>8&255]^o[255&d]^i[p++];c=m,u=g,d=y,h=v}m=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[255&h])^i[p++],g=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^i[p++],y=(s[d>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^i[p++],v=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&d])^i[p++],e[t]=m,e[t+1]=g,e[t+2]=y,e[t+3]=v},keySize:8});e.AES=t._createHelper(m)}(),i.AES)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib,r=t.WordArray,a=t.BlockCipher,n=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=n.DES=a.extend({_doReset:function(){for(var e=this._key.words,t=[],i=0;i<56;i++){var r=o[i]-1;t[i]=e[r>>>5]>>>31-r%32&1}for(var a=this._subKeys=[],n=0;n<16;n++){var c=a[n]=[],u=l[n];for(i=0;i<24;i++)c[i/6|0]|=t[(s[i]-1+u)%28]<<31-i%6,c[4+(i/6|0)]|=t[28+(s[i+24]-1+u)%28]<<31-i%6;for(c[0]=c[0]<<1|c[0]>>>31,i=1;i<7;i++)c[i]=c[i]>>>4*(i-1)+3;c[7]=c[7]<<5|c[7]>>>27}var d=this._invSubKeys=[];for(i=0;i<16;i++)d[i]=a[15-i]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,i){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var a=i[r],n=this._lBlock,o=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((o^a[l])&u[l])>>>0];this._lBlock=o,this._rBlock=n^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var i=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=i,this._lBlock^=i<>>e^this._lBlock)&t;this._lBlock^=i,this._rBlock^=i<192.");var t=e.slice(0,2),i=e.length<4?e.slice(0,2):e.slice(2,4),a=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(r.create(t)),this._des2=d.createEncryptor(r.create(i)),this._des3=d.createEncryptor(r.create(a))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=a._createHelper(f)}(),i.TripleDES)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.StreamCipher,r=e.algo,a=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,i=e.sigBytes,r=this._S=[],a=0;a<256;a++)r[a]=a;a=0;for(var n=0;a<256;a++){var o=a%i,s=t[o>>>2]>>>24-o%4*8&255;n=(n+r[a]+s)%256;var l=r[a];r[a]=r[n],r[n]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=n.call(this)},keySize:8,ivSize:0});function n(){for(var e=this._S,t=this._i,i=this._j,r=0,a=0;a<4;a++){i=(i+e[t=(t+1)%256])%256;var n=e[t];e[t]=e[i],e[i]=n,r|=e[(e[t]+e[i])%256]<<24-8*a}return this._i=t,this._j=i,r}e.RC4=t._createHelper(a);var o=r.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)n.call(this)}});e.RC4Drop=t._createHelper(o)}(),i.RC4)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.StreamCipher,r=e.algo,a=[],n=[],o=[],s=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,i=0;i<4;i++)e[i]=16711935&(e[i]<<8|e[i]>>>24)|4278255360&(e[i]<<24|e[i]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],a=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,i=0;i<4;i++)l.call(this);for(i=0;i<8;i++)a[i]^=r[i+4&7];if(t){var n=t.words,o=n[0],s=n[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=c>>>16|4294901760&u,h=u<<16|65535&c;for(a[0]^=c,a[1]^=d,a[2]^=u,a[3]^=h,a[4]^=c,a[5]^=d,a[6]^=u,a[7]^=h,i=0;i<4;i++)l.call(this)}},_doProcessBlock:function(e,t){var i=this._X;l.call(this),a[0]=i[0]^i[5]>>>16^i[3]<<16,a[1]=i[2]^i[7]>>>16^i[5]<<16,a[2]=i[4]^i[1]>>>16^i[7]<<16,a[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)a[r]=16711935&(a[r]<<8|a[r]>>>24)|4278255360&(a[r]<<24|a[r]>>>8),e[t+r]^=a[r]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,i=0;i<8;i++)n[i]=t[i];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,i=0;i<8;i++){var r=e[i]+t[i],a=65535&r,s=r>>>16,l=((a*a>>>17)+a*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);o[i]=l^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(s)}(),i.Rabbit)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.StreamCipher,r=e.algo,a=[],n=[],o=[],s=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var a=0;a<4;a++)l.call(this);for(a=0;a<8;a++)r[a]^=i[a+4&7];if(t){var n=t.words,o=n[0],s=n[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=c>>>16|4294901760&u,h=u<<16|65535&c;for(r[0]^=c,r[1]^=d,r[2]^=u,r[3]^=h,r[4]^=c,r[5]^=d,r[6]^=u,r[7]^=h,a=0;a<4;a++)l.call(this)}},_doProcessBlock:function(e,t){var i=this._X;l.call(this),a[0]=i[0]^i[5]>>>16^i[3]<<16,a[1]=i[2]^i[7]>>>16^i[5]<<16,a[2]=i[4]^i[1]>>>16^i[7]<<16,a[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)a[r]=16711935&(a[r]<<8|a[r]>>>24)|4278255360&(a[r]<<24|a[r]>>>8),e[t+r]^=a[r]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,i=0;i<8;i++)n[i]=t[i];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,i=0;i<8;i++){var r=e[i]+t[i],a=65535&r,s=r>>>16,l=((a*a>>>17)+a*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);o[i]=l^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(s)}(),i.RabbitLegacy)})),on((function(e,t){var i;e.exports=(i=Mc,function(){var e=i,t=e.lib.BlockCipher,r=e.algo,a=16,n=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],o=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],s={pbox:[],sbox:[]};function l(e,t){var i=t>>24&255,r=t>>16&255,a=t>>8&255,n=255&t,o=e.sbox[0][i]+e.sbox[1][r];return o^=e.sbox[2][a],o+=e.sbox[3][n],o}function c(e,t,i){for(var r,n=t,o=i,s=0;s1;--s)n^=e.pbox[s],o=l(e,n)^o,r=n,n=o,o=r;return r=n,n=o,o=r,o^=e.pbox[1],n^=e.pbox[0],{left:n,right:o}}function d(e,t,i){for(var r=0;r<4;r++){e.sbox[r]=[];for(var s=0;s<256;s++)e.sbox[r][s]=o[r][s]}for(var l=0,u=0;u=i&&(l=0);for(var d=0,h=0,p=0,f=0;f>>2]|=e[i]<<24-i%4*8;return Uc.lib.WordArray.create(t,e.length)}var Nc=16,jc=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],Gc=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function zc(e){for(var t=[],i=0,r=e.length;i>>6),t.push(128|63&a);else if(a<=55295||a>=57344&&a<=65535)t.push(224|a>>>12),t.push(128|a>>>6&63),t.push(128|63&a);else{if(!(a>=65536&&a<=1114111))throw t.push(a),new Error("input is not supported");i++,t.push(240|a>>>18&28),t.push(128|a>>>12&63),t.push(128|a>>>6&63),t.push(128|63&a)}}return t}function Vc(e){for(var t=[],i=0,r=e.length;i=240&&e[i]<=247?(t.push(String.fromCodePoint(((7&e[i])<<18)+((63&e[i+1])<<12)+((63&e[i+2])<<6)+(63&e[i+3]))),i+=3):e[i]>=224&&e[i]<=239?(t.push(String.fromCodePoint(((15&e[i])<<12)+((63&e[i+1])<<6)+(63&e[i+2]))),i+=2):e[i]>=192&&e[i]<=223?(t.push(String.fromCodePoint(((31&e[i])<<6)+(63&e[i+1]))),i++):t.push(String.fromCodePoint(e[i]));return t.join("")}function Jc(e,t){var i=31&t;return e<>>32-i}function qc(e){return(255&jc[e>>>24&255])<<24|(255&jc[e>>>16&255])<<16|(255&jc[e>>>8&255])<<8|255&jc[255&e]}function Kc(e){return e^Jc(e,2)^Jc(e,10)^Jc(e,18)^Jc(e,24)}function Yc(e){return e^Jc(e,13)^Jc(e,23)}function Qc(e,t,i){for(var r=new Array(4),a=new Array(4),n=0;n<4;n++)a[0]=255&e[4*n],a[1]=255&e[4*n+1],a[2]=255&e[4*n+2],a[3]=255&e[4*n+3],r[n]=a[0]<<24|a[1]<<16|a[2]<<8|a[3];for(var o,s=0;s<32;s+=4)o=r[1]^r[2]^r[3]^i[s+0],r[0]^=Kc(qc(o)),o=r[2]^r[3]^r[0]^i[s+1],r[1]^=Kc(qc(o)),o=r[3]^r[0]^r[1]^i[s+2],r[2]^=Kc(qc(o)),o=r[0]^r[1]^r[2]^i[s+3],r[3]^=Kc(qc(o));for(var l=0;l<16;l+=4)t[l]=r[3-l/4]>>>24&255,t[l+1]=r[3-l/4]>>>16&255,t[l+2]=r[3-l/4]>>>8&255,t[l+3]=255&r[3-l/4]}function Xc(e,t,i){for(var r=new Array(4),a=new Array(4),n=0;n<4;n++)a[0]=255&e[0+4*n],a[1]=255&e[1+4*n],a[2]=255&e[2+4*n],a[3]=255&e[3+4*n],r[n]=a[0]<<24|a[1]<<16|a[2]<<8|a[3];r[0]^=2746333894,r[1]^=1453994832,r[2]^=1736282519,r[3]^=2993693404;for(var o,s=0;s<32;s+=4)o=r[1]^r[2]^r[3]^Gc[s+0],t[s+0]=r[0]^=Yc(qc(o)),o=r[2]^r[3]^r[0]^Gc[s+1],t[s+1]=r[1]^=Yc(qc(o)),o=r[3]^r[0]^r[1]^Gc[s+2],t[s+2]=r[2]^=Yc(qc(o)),o=r[0]^r[1]^r[2]^Gc[s+3],t[s+3]=r[3]^=Yc(qc(o));if(0===i)for(var l,c=0;c<16;c++)l=t[c],t[c]=t[31-c],t[31-c]=l}function Zc(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=r.padding,n=void 0===a?"pkcs#7":a,o=r.mode,s=r.iv,l=void 0===s?[]:s,c=r.output,u=void 0===c?"string":c;if("cbc"===o&&("string"==typeof l&&(l=zc(l)),16!==l.length))throw new Error("iv is invalid");if("string"==typeof t&&(t=zc(t)),16!==t.length)throw new Error("key is invalid");if(e="string"==typeof e?0!==i?Wc(e):zc(e):g(e),("pkcs#5"===n||"pkcs#7"===n)&&0!==i)for(var d=Nc-e.length%Nc,h=0;h=Nc;){var A=e.slice(v,v+16),b=new Array(16);if("cbc"===o)for(var _=0;_e)return this.preDelayTimestamp-e>1e3&&this.player.debug.warn("CommonDemux","getDelay() and preDelayTimestamp is ".concat(this.preDelayTimestamp," > timestamp is ").concat(e," more than ").concat(this.preDelayTimestamp-e,"ms and return ").concat(this.delay)),this.preDelayTimestamp=e,this.delay;if(this.firstTimestamp){if(e){var i=Date.now()-this.startTimestamp,r=e-this.firstTimestamp;i>=r?(this.isStreamTsMoreThanLocal=!1,this.delay=i-r):(this.isStreamTsMoreThanLocal=!0,this.delay=r-i)}}else this.firstTimestamp=e,this.startTimestamp=Date.now(),this.delay=-1;return this.preDelayTimestamp=e,this.delay}},{key:"getDelayNotUpdateDelay",value:function(e,t){if(!e||!this.player.isDemuxDecodeFirstIIframeInit())return-1;if(t===ot)return this.pushLatestDelay;if(this.preDelayTimestamp&&this.preDelayTimestamp-e>1e3)return this.player.debug.warn("CommonDemux","getDelayNotUpdateDelay() and preDelayTimestamp is ".concat(this.preDelayTimestamp," > timestamp is ").concat(e," more than ").concat(this.preDelayTimestamp-e,"ms and return -1")),-1;if(this.firstTimestamp){var i=-1;if(e){var r=Date.now()-this.startTimestamp,a=e-this.firstTimestamp;i=r>=a?r-a:a-r}return i}return-1}},{key:"resetDelay",value:function(){this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.dropping=!1}},{key:"resetAllDelay",value:function(){this.resetDelay(),this.preDelayTimestamp=null}},{key:"initInterval",value:function(){var e=this;this.player.isUseHls265()?this.player.debug.log("CommonDemux","initInterval() and is hls and support hls265 so return"):-1===this.player.getStreamType().indexOf(O)?this.player.isPlaybackCacheBeforeDecodeForFpsRender()?this.player.debug.log("CommonDemux","initInterval() and playback and playbackIsCacheBeforeDecodeForFpsRender is true so return"):(this.player.debug.log("CommonDemux","setInterval()"),this._loop(),this.stopId=setInterval((function(){var t=(new Date).getTime();e.preLoopTimestamp||(e.preLoopTimestamp=t);var i=t-e.preLoopTimestamp;e.updateHistoryIntervalDiffTimeList(i),i>100&&e.player.debug.warn("CommonDemux","loop demux diff time is ".concat(i)),e._loop(),e.preLoopTimestamp=(new Date).getTime()}),20)):this.player.debug.log("CommonDemux","initInterval() and is worker stream so return")}},{key:"clearStopInterval",value:function(){this.stopId&&(clearInterval(this.stopId),this.stopId=null)}},{key:"updateHistoryIntervalDiffTimeList",value:function(e){this.historyIntervalDiffTimeList.length>5&&this.historyIntervalDiffTimeList.shift(),this.historyIntervalDiffTimeList.push(e)}},{key:"isHistoryIntervalDiffTimeAllLarge",value:function(){if(this.historyIntervalDiffTimeList.length<5)return!1;for(var e=0;ei+t&&r)this.hasIframeInBufferList()?(this.player.debug.warn("CommonDemux","_loop delay is ".concat(this.delay,", set dropping is true")),this.resetAllDelay(),this.dropping=!0,this.player.updateStats({isDropping:!0})):(this.bufferList.shift(),this._doDecoderDecode(e),this._decodeNext(e));else for(;this.bufferList.length;){if(e=this.bufferList[0],!(this.getDelay(e.ts,e.type)>t)){this.delay<0&&this.player.debug.warn("CommonDemux","_loop delay is ".concat(this.delay," bufferList is ").concat(this.bufferList));break}this.bufferList.shift(),this._doDecoderDecode(e)}}else-1!==this.delay&&this.player.debug.log("CommonDemux","loop() bufferList is empty and reset delay"),this.resetAllDelay()}},{key:"_doDecode",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=this.player,o={ts:i,cts:a,type:t,isIFrame:!1};this.player.isPlayer()?(t===st&&n._opt.playType===j&&this.calcNetworkDelay(i),n._opt.useWCS&&!n._opt.useOffscreen||n._opt.useMSE?(t===st&&(o.isIFrame=r),this.pushBuffer(e,o)):t===st?n.decoderWorker&&n.decoderWorker.decodeVideo(e,i,r):t===ot&&n._opt.hasAudio&&n.decoderWorker&&n.decoderWorker.decodeAudio(e,i)):this.player.isPlayback()&&(t===st&&(o.isIFrame=r),this.player.isPlaybackOnlyDecodeIFrame()?t===st&&r&&this.pushBuffer(e,o):this.player.isPlaybackCacheBeforeDecodeForFpsRender()||1===this.player.getPlaybackRate()?this.pushBuffer(e,o):this.pushBuffer(e,o,!1))}},{key:"_doDecodeByHls",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=!1;if(t===ot&&pn(e)&&(this.player.debug.log("CommonDemux","hls pushBuffer audio ts is ".concat(i,", isAacCodecPacket is true")),n=!0,this.player.isRecordTypeFlv())){var o=new Uint8Array(e);this.player.recorder.addAACSequenceHeader(o,i)}var s=!1;if(t===st&&r&&Fo(e)&&(this.player.debug.log("CommonDemux","hls pushBuffer video ts is ".concat(i,", isVideoSequenceHeader is true")),s=!0,this.player.isRecordTypeFlv())){var l=new Uint8Array(e);this.player.recorder.addVideoSequenceHeader(l,i)}this.player.recording&&No(s)&&No(n)&&this.handleRecording(e,t,i,r,a),t===st?this._doDecoderDecode({ts:i,cts:a,payload:e,type:st,isIFrame:r}):t===ot&&this._doDecoderDecode({ts:i,payload:e,type:ot})}},{key:"_doDecodeByFmp4",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;this._doDecode(e,t,i,r,a)}},{key:"_doDecodeByTs",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;this._doDecode(e,t,i,r,a)}},{key:"_doDecodeByPs",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;this._doDecode(e,t,i,r,a)}},{key:"_decodeNext",value:function(e){var t=e.ts;if(0!==this.bufferList.length){var i=this.bufferList[0],r=i.ts-t,a=e.type===st&&i.type===ot,n=e.type===st&&Fo(e.payload);(r<=20||a||n)&&(this.player.debug.log("CommonDemux","decode data type is ".concat(e.type," and\n ts is ").concat(t," next data type is ").concat(i.type," ts is ").concat(i.ts,"\n diff is ").concat(r," and isVideoAndNextAudio is ").concat(a," and isVideoSqeHeader is ").concat(n)),this.bufferList.shift(),this._doDecoderDecode(i))}}},{key:"_doDecoderDecode",value:function(e){var t=this.player,i=t.webcodecsDecoder,r=t.mseDecoder;this.player.isPlayer()&&this.player.updateStats({buf:this.delay}),e.type===ot?t._opt.hasAudio&&(t._opt.useMSE&&t._opt.mseDecodeAudio?r.decodeAudio(e.payload,e.ts):t.decoderWorker&&t.decoderWorker.decodeAudio(e.payload,e.ts)):e.type===st&&(t._opt.isEmitSEI&&this.findSei(e.payload,e.ts),t._opt.useWCS&&!t._opt.useOffscreen?i.decodeVideo(e.payload,e.ts,e.isIFrame,e.cts):t._opt.useMSE?r.decodeVideo(e.payload,e.ts,e.isIFrame,e.cts):t.decoderWorker&&t.decoderWorker.decodeVideo(e.payload,e.ts,e.isIFrame))}},{key:"pushBuffer",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.player._opt.videoBuffer,a=this.player._opt.videoBufferDelay,n=this.player.isPlayer();if(t.type===ot&&pn(e)){if(this.player.debug.log("CommonDemux","pushBuffer() audio ts is ".concat(t.ts,", isAacCodecPacket is true")),this.player.isRecordTypeFlv()){var o=new Uint8Array(e);this.player.recorder.addAACSequenceHeader(o,t.ts)}this._doDecoderDecode({ts:t.ts,payload:e,type:ot})}else if(t.type===st&&t.isIFrame&&Fo(e)){if(this.player.debug.log("CommonDemux","pushBuffer() video ts is ".concat(t.ts,", isVideoSequenceHeader is true")),this.player.isRecordTypeFlv()){var s=new Uint8Array(e);this.player.recorder.addVideoSequenceHeader(s,t.ts)}this._doDecoderDecode({ts:t.ts,payload:e,type:st,isIFrame:t.isIFrame,cts:t.cts})}else{if(this.player.recording&&this.handleRecording(e,t.type,t.ts,t.isIFrame,t.cts),n){if(this.preTimestampDuration>0&&this.preTimestamp>0&&t.type===st){var l=t.ts-this.preTimestamp,c=this.preTimestampDuration+this.preTimestampDuration/2;l>=c&&this.player.debug.log("CommonDemux","pushBuffer() video\n ts is ".concat(t.ts,", preTimestamp is ").concat(this.preTimestamp,",\n diff is ").concat(l," and preTimestampDuration is ").concat(this.preTimestampDuration," and maxDiff is ").concat(c,"\n maybe trigger black screen or flower screen"))}if(this.preTimestamp>0&&t.tsAe&&(this.player.debug.warn("CommonDemux","pushBuffer() video\n ts is ".concat(t.ts,", preTimestamp is ").concat(this.preTimestamp,",\n diff is ").concat(this.preTimestamp-t.ts," more than 3600000\n and resetAllDelay()")),this.resetAllDelay()),t.ts<=this.preTimestamp&&this.preTimestamp>0&&t.type===st&&(this.player.debug.warn("CommonDemux","pushBuffer() video and isIFrame is ".concat(t.isIFrame," and\n ts is ").concat(t.ts," less than (or equal) preTimestamp is ").concat(this.preTimestamp," and\n payloadBufferSize is ").concat(e.byteLength," and prevPayloadBufferSize is ").concat(this.prevPayloadBufferSize)),this.player._opt.isDropSameTimestampGop&&No(t.isIFrame)&&this.player.isDemuxDecodeFirstIIframeInit())){var u=this.hasIframeInBufferList(),d=No(this.isPushDropping);return this.player.debug.log("CommonDemux","pushBuffer(), isDropSameTimestampGop is true and\n hasIframe is ".concat(u," and isNotPushDropping is ").concat(d," and next drop buffer")),void(u&&d?this.dropBuffer$2():this.clearBuffer(!0))}if(this.player.isDemuxDecodeFirstIIframeInit()){var h=this.getDelayNotUpdateDelay(t.ts,t.type);this.pushLatestDelay=h;var p=a+r;this.player._opt.useMSE?h>p&&this.delay0&&this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useMSE, pushLatestDelay is ".concat(h," > ").concat(a+r,", bufferList is ").concat(this.bufferList.length,", delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()):h>p&&this.delay0&&this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useWCS, pushLatestDelay is ".concat(h," > ").concat(a+r,",bufferList is ").concat(this.bufferList.length,", delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()),this.isHistoryIntervalDiffTimeAllLarge()&&No(this.player.visibility)&&(this.player._opt.useMSE?this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useMSE, page visibility is false and\n history interval diff is ".concat(this.historyIntervalDiffTimeList.join(",")," and\n bufferList is ").concat(this.bufferList.length,",\n delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()):this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useWCS, page visibility is false and\n history interval diff is ".concat(this.historyIntervalDiffTimeList.join(",")," and\n bufferList is ").concat(this.bufferList.length,",\n delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()))}t.type===st&&(this.preTimestamp>0&&(this.preTimestampDuration=t.ts-this.preTimestamp),this.prevPayloadBufferSize=e.byteLength,this.preTimestamp=t.ts)}if(i?t.type===ot?this.bufferList.push({ts:t.ts,payload:e,type:ot}):t.type===st&&this.bufferList.push({ts:t.ts,cts:t.cts,payload:e,type:st,isIFrame:t.isIFrame}):t.type===st?this._doDecoderDecode({ts:t.ts,cts:t.cts,payload:e,type:st,isIFrame:t.isIFrame}):t.type===ot&&this._doDecoderDecode({ts:t.ts,payload:e,type:ot}),this.player.isPlaybackCacheBeforeDecodeForFpsRender()&&(ro(this.playbackStreamVideoFps)||ro(this.playbackStreamAudioFps))){var f=this.playbackStreamVideoFps,m=this.playbackStreamAudioFps;if(ro(this.playbackStreamVideoFps)&&(f=Lo(this.bufferList,st),f>0&&(this.playbackStreamVideoFps=f,this.player.video&&this.player.video.setStreamFps(this.playbackStreamVideoFps),this.playbackStreamFps=m?f+m:f,No(this.player._opt.hasAudio)&&(this.player.debug.log(this.TAG_NAME,"playbackCacheBeforeDecodeForFpsRender,_opt.hasAudio is false and set streamAudioFps is 0"),this.playbackStreamAudioFps=0),this.initPlaybackCacheLoop())),ro(this.playbackStreamAudioFps)&&(m=Lo(this.bufferList,ot),m>0&&(this.playbackStreamAudioFps=m,this.playbackStreamFps=f?f+m:m,this.initPlaybackCacheLoop())),ro(this.playbackStreamVideoFps)&&ro(this.playbackStreamAudioFps)){var g=this.bufferList.map((function(e){return{type:e.type,ts:e.ts}}));this.player.debug.log("CommonDemux","playbackCacheBeforeDecodeForFpsRender, calc streamAudioFps is ".concat(m,", streamVideoFps is ").concat(f,", bufferListLength is ").concat(this.bufferList.length," and ts list is ").concat(JSON.stringify(g)))}var y=this.getAudioBufferLength()>0,v=y?60:40;this.bufferList.length>=v&&(this.debug.warn("CommonDemux","playbackCacheBeforeDecodeForFpsRender, bufferListLength is ".concat(this.bufferList.length," more than ").concat(v,", and hasAudio is ").concat(y," an set streamFps is 25")),this.playbackStreamVideoFps=f,this.player.video&&this.player.video.setStreamFps(this.playbackStreamVideoFps),y?(this.playbackStreamAudioFps=25,this.playbackStreamFps=this.playbackStreamVideoFps+this.playbackStreamAudioFps):this.playbackStreamFps=this.playbackStreamVideoFps,this.initPlaybackCacheLoop())}}}},{key:"dropBuffer$2",value:function(){if(this.bufferList.length>0){var e=this.bufferList.findIndex((function(e){return Oo(e.isIFrame)&&e.type===st}));if(this.isAllIframeInBufferList())for(var t=0;t=this.getNotDroppingDelayTs()){this.player.debug.log("CommonDemux","dropBuffer$2() isAllIframeInBufferList() is true, and index is ".concat(t," and tempDelay is ").concat(r," and notDroppingDelayTs is ").concat(this.getNotDroppingDelayTs())),e=t;break}}if(e>=0){this.isPushDropping=!0,this.player.updateStats({isDropping:!0});var a=this.bufferList.length;this.bufferList=this.bufferList.slice(e);var n=this.bufferList.shift();this.resetAllDelay(),this.getDelay(n.ts,n.type),this._doDecoderDecode(n),this.isPushDropping=!1,this.player.debug.log("CommonDemux","dropBuffer$2() iFrameIndex is ".concat(e,",and old bufferList length is ").concat(a," ,and new bufferList length is ").concat(this.bufferList.length," and new delay is ").concat(this.delay," "))}else this.isPushDropping=!1}0===this.bufferList.length&&(this.isPushDropping=!1)}},{key:"clearBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.player.debug.log("CommonDemux","clearBuffer,buffer length is ".concat(this.bufferList.length,", need clear is ").concat(e," and _opt.checkFirstIFrame is ").concat(this.player._opt.checkFirstIFrame)),e&&(this.bufferList=[]),this.player.isPlayer()&&(this.resetAllDelay(),Oo(this.player._opt.checkFirstIFrame)&&(this.dropping=!0,this.player.updateStats({isDropping:!0}))),this.player.decoderCheckFirstIFrame()}},{key:"calcNetworkDelay",value:function(e){if(this.player.isDemuxDecodeFirstIIframeInit()&&e>0){null===this.bufferStartDts?(this.bufferStartDts=e,this.bufferStartLocalTs=Ln()):et?i-t:0;r>this.player._opt.networkDelay&&this.player._opt.playType===j&&(this.player.debug.warn("CommonDemux","delay is more than networkDelay and now dts:".concat(e,",start dts is ").concat(this.bufferStartDts,", vs start is ").concat(t,",local diff is ").concat(i," ,delay is ").concat(r,", _opt.networkDelay is ").concat(this.player._opt.networkDelay)),this.player.emit(xt.networkDelayTimeout,r)),this.player.updateStats({netBuf:r})}}},{key:"calcIframeIntervalTimestamp",value:function(e){if(null===this.preIframeTs)this.preIframeTs=e;else if(this.preIframeTs2&&void 0!==arguments[2]&&arguments[2],a=4;no(this.nalUnitSize)&&(a=this.nalUnitSize);var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var i,r=e.length,a=[],n=0;n+t>>=8),n+=t,i){if(n+i>r)break;a.push(e.subarray(n,n+i)),n+=i}return a}}(e.slice(5),a);if(No(r)){var o=this.player.getVideoInfo();o&&o.encType&&(r=o.encType===Wt)}n.forEach((function(e){var a=r?e[0]>>>1&63:31&e[0];(r&&(a===mi||a===fi)||No(r)&&a===ei)&&i.player.emit(xt.videoSEI,{ts:t,data:e})}))}},{key:"handleRecording",value:function(e,t,i,r,a){if(this.player.isRecordTypeFlv()){var n=new Uint8Array(e);t===st?this.player.recorder.addVideo(n,i):t===ot&&this.player.recorder.addAudio(n,i)}else if(this.player.isRecordTypeMp4()){var o=new Uint8Array(e);if(this.player.recorder.isWasmMp4()){if(t===st)this.player.recorder.handleAddNaluTrack(o.slice(5),r,i,a);else if(t===ot){var s=new Uint8Array(e);this.player.recorder.handleAddAudioTrack(fn(s)?s.slice(2):s.slice(1),i)}}else t===st&&this.player.recorder.handleAddNaluTrack(o.slice(5),r,i,a)}}},{key:"updateNalUnitSize",value:function(e){var t=15&e[0];this.player.video.updateVideoInfo({encTypeCode:t});var i=t===zt;this.nalUnitSize=function(e,t){var i=null;return t?e.length>=28&&(i=1+(3&e[26])):e.length>=12&&(i=1+(3&e[9])),i}(e,i),this.player.debug.log(this.TAG_NAME,"demux() isVideoSequenceHeader is true and isHevc is ".concat(i," and nalUnitSize is ").concat(this.nalUnitSize))}},{key:"cryptoPayload",value:function(e,t){var i=e,r=this.player;if(r._opt.isM7sCrypto)if(r._opt.cryptoKey&&r._opt.cryptoKey.byteLength>0&&r._opt.cryptoIV&&r._opt.cryptoIV.byteLength>0){var a=this.player.video.getVideoInfo();a.encTypeCode?i=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t=new Uint8Array(t),i=new Uint8Array(i);for(var a=e.byteLength,n=5;na)break;var s=e[n+4],l=!1;if(r?(s=s>>>1&63,l=[0,1,2,3,4,5,6,7,8,9,16,17,18,19,20,21].includes(s)):(s&=31,l=1===s||5===s),l){var c=e.slice(n+4+2,n+4+o),u=new Bc.ModeOfOperation.ctr(t,new Bc.Counter(i)),d=u.decrypt(c);u=null,e.set(d,n+4+2)}n=n+4+o}return e}(e,r._opt.cryptoKey,r._opt.cryptoIV,a.encTypeCode===zt):r.debug.warn(this.TAG_NAME,"videoInfo.encTypeCode is ".concat(a.encTypeCode))}else r.debug.error(this.TAG_NAME,"isM7sCrypto cryptoKey.length is ".concat(r._opt.cryptoKey&&r._opt.cryptoKey.byteLength," or cryptoIV.length is ").concat(r._opt.cryptoIV&&r._opt.cryptoIV.byteLength," null"));else if(r._opt.isSm4Crypto)r._opt.sm4CryptoKey&&t?i=function(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.byteLength,a=5;ar)break;var o=e[a+4],s=!1;if(i?(o=o>>>1&63,s=[0,1,2,3,4,5,6,7,8,9,16,17,18,19,20,21].includes(o)):(o&=31,s=1===o||5===o),s){var l=Zc(e.slice(a+4+2,a+4+n),t,0,{padding:"none",output:"array"});e.set(l,a+4+2)}a=a+4+n}return e}(e,r._opt.sm4CryptoKey):r._opt.sm4CryptoKey||r.debug.error(this.TAG_NAME,"isSm4Crypto opt.sm4CryptoKey is null");else if(r._opt.isXorCrypto)if(r._opt.cryptoKey&&r._opt.cryptoKey.byteLength>0&&r._opt.cryptoIV&&r._opt.cryptoIV.byteLength>0){var n=this.player.video.getVideoInfo();i=function(e,t,i){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.byteLength,n=5;na)break;var s=e[n+4],l=!1;if(r?(s=s>>>1&63,l=[0,1,2,3,4,5,6,7,8,9,16,17,18,19,20,21].includes(s)):(s&=31,l=1===s||5===s),l){var c=eu(e.slice(n+4,n+4+o),t,i);e.set(c,n+4)}n=n+4+o}return e}(e,r._opt.cryptoKey,r._opt.cryptoIV,n.encTypeCode===zt)}else r.debug.error(this.TAG_NAME,"isXorCrypto opt.xorCryptoKey is null");return i}},{key:"cryptoPayloadAudio",value:function(e){var t=e,i=this.player;return i._opt.isM7sCrypto&&(i._opt.cryptoKey&&i._opt.cryptoKey.byteLength>0&&i._opt.cryptoIV&&i._opt.cryptoIV.byteLength>0?e[0]>>4===Vt&&(t=function(e,t,i){if(e.byteLength<=30)return e;var r=e.slice(32),a=new Bc.ModeOfOperation.ctr(t,new Bc.Counter(i)),n=a.decrypt(r);return a=null,e.set(n,32),e}(e,i._opt.cryptoKey,i._opt.cryptoIV)):i.debug.error(this.TAG_NAME,"isM7sCrypto cryptoKey.length is ".concat(i._opt.cryptoKey&&i._opt.cryptoKey.byteLength," or cryptoIV.length is ").concat(i._opt.cryptoIV&&i._opt.cryptoIV.byteLength," null"))),t}},{key:"_decodeEnhancedH265Video",value:function(e,t){var i=e[0],r=48&i,a=15&i,n=e.slice(1,5),o=new ArrayBuffer(4),s=new Uint32Array(o),l="a"==String.fromCharCode(n[0]);if(a===za){if(r===Va){var c=e.slice(5);if(l);else{var u=new Uint8Array(5+c.length);u.set([28,0,0,0,0],0),u.set(c,5),this.updateNalUnitSize(u),this.player.debug.log(this.TAG_NAME,"demux() isVideoSequenceHeader(enhancedH265) is true and nalUnitSize is ".concat(this.nalUnitSize)),this._doDecode(u,st,0,!0,0)}}}else if(a===Ha){var d=e,h=0,p=r===Va;p&&this.calcIframeIntervalTimestamp(t),l||(s[0]=e[4],s[1]=e[3],s[2]=e[2],s[3]=0,h=s[0],d=hl(e.slice(8),p),d=this.cryptoPayload(d,p),this._doDecode(d,st,t,p,h))}else if(a===Wa){var f=r===Va,m=e.slice(5);f&&this.calcIframeIntervalTimestamp(t);var g=hl(m,f);g=this.cryptoPayload(g,f),this._doDecode(g,st,t,f,0)}}},{key:"_isEnhancedH265Header",value:function(e){return 128==(128&e)}}])}(s),ru=function(e,t,i,r){return new(i||(i=Promise))((function(a,n){function o(e){try{l(r.next(e))}catch(e){n(e)}}function s(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))},au=Symbol(32),nu=Symbol(16),ou=Symbol(8),su=function(){function e(t){S(this,e),this.g=t,this.consumed=0,t&&(this.need=t.next().value)}return T(e,[{key:"setG",value:function(e){this.g=e,this.demand(e.next().value,!0)}},{key:"consume",value:function(){this.buffer&&this.consumed&&(this.buffer.copyWithin(0,this.consumed),this.buffer=this.buffer.subarray(0,this.buffer.length-this.consumed),this.consumed=0)}},{key:"demand",value:function(e,t){return t&&this.consume(),this.need=e,this.flush()}},{key:"read",value:function(e){return ru(this,void 0,void 0,v().mark((function t(){var i=this;return v().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.t0=this.lastReadPromise,!t.t0){t.next=4;break}return t.next=4,this.lastReadPromise;case 4:return t.abrupt("return",this.lastReadPromise=new Promise((function(t,r){var a;i.reject=r,i.resolve=function(e){delete i.lastReadPromise,delete i.resolve,delete i.need,t(e)},i.demand(e,!0)||null===(a=i.pull)||void 0===a||a.call(i,e)})));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"readU32",value:function(){return this.read(au)}},{key:"readU16",value:function(){return this.read(nu)}},{key:"readU8",value:function(){return this.read(ou)}},{key:"close",value:function(){var e;this.g&&this.g.return(),this.buffer&&this.buffer.subarray(0,0),null===(e=this.reject)||void 0===e||e.call(this,new Error("EOF")),delete this.lastReadPromise}},{key:"flush",value:function(){if(this.buffer&&this.need){var e=null,t=this.buffer.subarray(this.consumed),i=0,r=function(e){return t.length<(i=e)};if("number"==typeof this.need){if(r(this.need))return;e=t.subarray(0,i)}else if(this.need===au){if(r(4))return;e=t[0]<<24|t[1]<<16|t[2]<<8|t[3]}else if(this.need===nu){if(r(2))return;e=t[0]<<8|t[1]}else if(this.need===ou){if(r(1))return;e=t[0]}else if("buffer"in this.need){if("byteOffset"in this.need){if(r(this.need.byteLength-this.need.byteOffset))return;new Uint8Array(this.need.buffer,this.need.byteOffset).set(t.subarray(0,i)),e=this.need}else if(this.g)return void this.g.throw(new Error("Unsupported type"))}else{if(r(this.need.byteLength))return;new Uint8Array(this.need).set(t.subarray(0,i)),e=this.need}return this.consumed+=i,this.g?this.demand(this.g.next(e).value,!0):this.resolve&&this.resolve(e),e}}},{key:"write",value:function(e){var t=this;if(e instanceof Uint8Array?this.malloc(e.length).set(e):"buffer"in e?this.malloc(e.byteLength).set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):this.malloc(e.byteLength).set(new Uint8Array(e)),!this.g&&!this.resolve)return new Promise((function(e){return t.pull=e}));this.flush()}},{key:"writeU32",value:function(e){this.malloc(4).set([e>>24&255,e>>16&255,e>>8&255,255&e]),this.flush()}},{key:"writeU16",value:function(e){this.malloc(2).set([e>>8&255,255&e]),this.flush()}},{key:"writeU8",value:function(e){this.malloc(1)[0]=e,this.flush()}},{key:"malloc",value:function(e){if(this.buffer){var t=this.buffer.length,i=t+e;if(i<=this.buffer.buffer.byteLength-this.buffer.byteOffset)this.buffer=new Uint8Array(this.buffer.buffer,this.buffer.byteOffset,i);else{var r=new Uint8Array(i);r.set(this.buffer),this.buffer=r}return this.buffer.subarray(t,i)}return this.buffer=new Uint8Array(e),this.buffer}}])}();su.U32=au,su.U16=nu,su.U8=ou;var lu,cu=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="FlvDemux",i.input=new su(i.demux()),e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.input=null,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"dispatch",value:function(e){this.input?this.input.write(e):this.player&&this.player.debug.warn(this.TAG_NAME,"dispatch() this.input is null")}},{key:"demux",value:v().mark((function e(){var t,i,r,a,n,o,s,l,c,u,d,h,p,f,m,g,y,A,b;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,9;case 2:t=new ArrayBuffer(4),i=new Uint8Array(t),r=new Uint32Array(t),a=this.player;case 3:if(this.input){e.next=5;break}return e.abrupt("return");case 5:return i[3]=0,e.next=8,15;case 8:return n=e.sent,o=n[4],i[0]=n[7],i[1]=n[6],i[2]=n[5],s=r[0],i[0]=n[10],i[1]=n[9],i[2]=n[8],i[3]=n[11],l=r[0],e.next=16,s;case 16:if(c=e.sent.slice(),a){e.next=19;break}return e.abrupt("return");case 19:e.t0=o,e.next=e.t0===lt?22:e.t0===ct?24:e.t0===ut?44:48;break;case 22:return a._opt.hasAudio&&(a.updateStats({abps:c.byteLength}),c.byteLength>0)&&(u=c,Oo(this.player._opt.m7sCryptoAudio)&&(u=this.cryptoPayloadAudio(c)),this._doDecode(u,ot,l)),e.abrupt("break",49);case 24:if(!(a._opt.hasVideo&&c.length>=6)){e.next=42;break}if(d=l,a.updateStats({vbps:c.byteLength,dts:d}),a._times.demuxStart||(a._times.demuxStart=Ln()),h=c[0],!this._isEnhancedH265Header(h)){e.next=32;break}this._decodeEnhancedH265Video(c,d),e.next=40;break;case 32:if(p=15&h,f=(h>>4&15)===da,m=p===Gt,!No(p===zt||m)){e.next=37;break}return e.abrupt("return",void this.player.debug.warn(this.TAG_NAME,"demux() codecId is ".concat(p," and ignore")));case 37:f&&(this.calcIframeIntervalTimestamp(l),null===this.nalUnitSize&&Fo(c)&&this.updateNalUnitSize(c)),r[0]=c[4],r[1]=c[3],r[2]=c[2],r[3]=0,g=r[0],y=this.cryptoPayload(c,f),this._doDecode(y,st,l,f,g);case 40:e.next=43;break;case 42:c.length<6&&a.debug.warn(this.TAG_NAME,"payload.length is ".concat(c.length," less than 6 and ignore"));case 43:return e.abrupt("break",49);case 44:return this.player.isRecordTypeFlv()&&(A=new Uint8Array(c),this.player.recorder.addMetaData(A)),b=Ll(c),b&&b.onMetaData&&a.updateMetaData(b.onMetaData),e.abrupt("break",49);case 48:a.debug.log(this.TAG_NAME,"demux() type is ".concat(o));case 49:e.next=3;break;case 51:case"end":return e.stop()}}),e,this)}))},{key:"close",value:function(){this.input=null}},{key:"getInputByteLength",value:function(){var e=0;return this.input&&this.input.buffer&&(e=this.input.buffer.byteLength),e}}])}(iu),uu=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="M7sDemux",e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"dispatch",value:function(e){var t=this.player,i=new DataView(e),r=i.getUint8(0),a=i.getUint32(1,!1),n=new ArrayBuffer(4),o=new Uint32Array(n);switch(r){case ot:if(t._opt.hasAudio){var s=new Uint8Array(e,5);t.updateStats({abps:s.byteLength}),s.byteLength>0&&this._doDecode(s,r,a)}break;case st:if(t._opt.hasVideo)if(t._times.demuxStart||(t._times.demuxStart=Ln()),i.byteLength>=11){var l=new Uint8Array(e,5),c=a;t.updateStats({vbps:l.byteLength,dts:c});var u=l[0];if(this._isEnhancedH265Header(u))this._decodeEnhancedH265Video(l,a);else{var d=i.getUint8(5)>>4==1;d&&this.calcIframeIntervalTimestamp(a),o[0]=l[4],o[1]=l[3],o[2]=l[2],o[3]=0;var h=o[0],p=this.cryptoPayload(l,d);this._doDecode(p,r,a,d,h)}}else this.player.debug.warn(this.TAG_NAME,"dispatch","dv byteLength is",i.byteLength,"and return")}}}])}(iu),du=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),e.debug.log("WebTransportDemux","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.player.debug.log("WebTransportDemux","destroy"),b(t,"destroy",this,3)([])}}])}(cu),hu=on((function(e){e.exports=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.__esModule=!0,e.exports.default=e.exports})),pu=(lu=hu)&&lu.__esModule&&Object.prototype.hasOwnProperty.call(lu,"default")?lu.default:lu,fu=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),pu(m(i),"TAG_NAME","NakedFlowDemux"),i.lastBuf=null,i.vps=null,i.sps=null,i.pps=null,i.streamVideoType=null,i.streamAudioType=null,i.tempNaluBufferList=new Uint8Array(0),i.localDts=0,i.isSendSeqHeader=!1,i.isSendAACSeqHeader=!1,e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.lastBuf=null,this.vps=null,this.sps=null,this.pps=null,this.streamVideoType=null,this.streamAudioType=null,this.tempNaluBufferList=new Uint8Array(0),this.localDts=0,this.localAudioDts=0,this.isSendSeqHeader=!1,this.isSendAACSeqHeader=!1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"dispatch",value:function(e){this.player;var t=new Uint8Array(e);this.extractNALu$2(t)}},{key:"addNaluToBuffer",value:function(e){var t=e.byteLength+this.tempNaluBufferList.byteLength,i=new Uint8Array(t);i.set(this.tempNaluBufferList,0),i.set(e,this.tempNaluBufferList.byteLength),this.tempNaluBufferList=i}},{key:"downloadNakedFlowFile",value:function(){var e=new Blob([this.tempNaluBufferList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+".h264",t.click(),window.URL.revokeObjectURL(t.href)}catch(e){console.error("downloadTempNalu",e)}}},{key:"getNaluDts",value:function(){var e=this.player._opt.nakedFlowFps;return this.localDts=this.localDts+parseInt(1e3/e),this.localDts}},{key:"getNaluAudioDts",value:function(){var e=this.player.audio.audioContext.sampleRate,t=this.player.audio.audioBufferSize;return this.localDts+parseInt(t/e*1e3)}},{key:"extractNALu",value:function(e){for(var t,i,r=0,a=e.byteLength,n=0,o=[];r1)for(var c=0;c>1,i!==si&&i!==ci&&i!==di||(t=Wt)),t}(i)),this.streamVideoType===Ht){var r=this.handleAddNaluStartCode(i),a=this.extractNALu(r);if(0===a.length)return void this.player.debug.warn(this.TAG_NAME,"handleVideoNalu","naluList.length === 0");var n=[];if(a.forEach((function(e){var i=$s(e);i===Qt||i===Yt?t.handleVideoH264Nalu(e):tl(i)&&n.push(e)})),1===n.length)this.handleVideoH264Nalu(n[0]);else{var o=function(e){if(0===e.length)return!1;for(var t=$s(e[0]),i=1;i>6,a=(60&i[2])>>2,n=(1&i[2])<<2|(192&i[3])>>6,o=new Uint8Array([175,0,r<<3|(14&a)>>1,(1&a)<<7|n<<3]);this.isSendAACSeqHeader=!0,this._doDecode(o,ot,0,!1,0)}var s=this.getNaluAudioDts(),l=new Uint8Array(t.length+2);l.set([175,1],0),l.set(t,2),this._doDecode(l,ot,s,!1,0)}}},{key:"handleAudioG711ANalu",value:function(e){if(e&&!(e.byteLength<1)){this.streamAudioType||(this.streamAudioType=qt.ALAW);var t=new Uint8Array(e),i=this.getNaluAudioDts(),r=new Uint8Array(t.length+1);r.set([114],0),r.set(t,1),this._doDecode(r,ot,i,!1,0)}}},{key:"handleAudioG711UNalu",value:function(e){if(e&&!(e.byteLength<1)){this.streamAudioType||(this.streamAudioType=qt.MULAW);var t=new Uint8Array(e),i=this.getNaluAudioDts(),r=new Uint8Array(t.length+1);r.set([130],0),r.set(t,1),this._doDecode(r,ot,i,!1,0)}}},{key:"handleVideoH264Nalu",value:function(e){var t=$s(e);switch(t){case Yt:this.sps=e;break;case Qt:this.pps=e}if(this.isSendSeqHeader){if(this.sps&&this.pps){var i=Xs({sps:this.sps,pps:this.pps}),r=this.getNaluDts();this._doDecode(i,st,r,!0,0),this.sps=null,this.pps=null}if(tl(t)){this.player._times.demuxStart||(this.player._times.demuxStart=Ln());var a=il(t),n=this.getNaluDts(),o=function(e,t){var i=[];i[0]=t?23:39,i[1]=1,i[2]=0,i[3]=0,i[4]=0,i[5]=e.byteLength>>24&255,i[6]=e.byteLength>>16&255,i[7]=e.byteLength>>8&255,i[8]=255&e.byteLength;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}(e,a);this._preDoDecode(o,st,n,a,0)}else this.player.debug.warn(this.TAG_NAME,"handleVideoH264Nalu is avc seq head nalType is ".concat(t))}else if(this.sps&&this.pps){this.isSendSeqHeader=!0;var s=Xs({sps:this.sps,pps:this.pps});this._doDecode(s,st,0,!0,0),this.sps=null,this.pps=null}}},{key:"handleVideoH264NaluList",value:function(e,t,i){if(this.isSendSeqHeader){this.player._times.demuxStart||(this.player._times.demuxStart=Ln());var r=this.getNaluDts(),a=Zs(e.reduce((function(e,t){var i=En(e),r=En(t),a=new Uint8Array(i.byteLength+r.byteLength);return a.set(i,0),a.set(r,i.byteLength),a})),t);this._preDoDecode(a,st,r,t,0)}else this.player.debug.warn(this.TAG_NAME,"handleVideoH264NaluList isSendSeqHeader is false")}},{key:"handleVideoH265Nalu",value:function(e){var t=pl(e);switch(t){case si:this.vps=e;break;case ci:this.sps=e;break;case di:this.pps=e}if(this.isSendSeqHeader){if(this.vps&&this.sps&&this.pps){var i=dl({vps:this.vps,sps:this.sps,pps:this.pps}),r=this.getNaluDts();this._doDecode(i,st,r,!0,0),this.vps=null,this.sps=null,this.pps=null}if(fl(t)){this.player._times.demuxStart||(this.player._times.demuxStart=Ln());var a=ml(t),n=this.getNaluDts(),o=function(e,t){var i=[];i[0]=t?28:44,i[1]=1,i[2]=0,i[3]=0,i[4]=0,i[5]=e.byteLength>>24&255,i[6]=e.byteLength>>16&255,i[7]=e.byteLength>>8&255,i[8]=255&e.byteLength;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}(e,a);this._preDoDecode(o,st,n,a,0)}}else if(this.vps&&this.sps&&this.pps){this.isSendSeqHeader=!0;var s=dl({vps:this.vps,sps:this.sps,pps:this.pps});this._doDecode(s,st,0,!0,0),this.vps=null,this.sps=null,this.pps=null}}},{key:"handleVideoH265NaluList",value:function(e,t,i){if(this.isSendSeqHeader){this.player._times.demuxStart||(this.player._times.demuxStart=Ln());var r=this.getNaluDts(),a=hl(e.reduce((function(e,t){var i=En(e),r=En(t),a=new Uint8Array(i.byteLength+r.byteLength);return a.set(i,0),a.set(r,i.byteLength),a})),t);this._preDoDecode(a,st,r,t,0)}else this.player.debug.warn(this.TAG_NAME,"handleVideoH265NaluList isSendSeqHeader is false")}},{key:"_preDoDecode",value:function(e,t,i,r,a){this.player.updateStats({vbps:e.byteLength,dts:i}),r&&this.calcIframeIntervalTimestamp(i),this._doDecode(e,st,i,r,a)}},{key:"getInputByteLength",value:function(){var e=0;return this.lastBuf&&(e=this.lastBuf.byteLength),e}}])}(iu),mu=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.player=e,e.debug.log("EmptyDemux","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.player.debug.log("EmptyDemux","destroy")}}])}(iu),gu=on((function(e,t){var r,a,n,o=(r=new Date,a=4,n={setLogLevel:function(e){a=e==this.debug?1:e==this.info?2:e==this.warn?3:(this.error,4)},debug:function(e,t){void 0===console.debug&&(console.debug=console.log),1>=a&&console.debug("["+o.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)},log:function(e,t){this.debug(e.msg)},info:function(e,t){2>=a&&console.info("["+o.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)},warn:function(e,t){3>=a&&console.warn("["+o.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)},error:function(e,t){4>=a&&console.error("["+o.getDurationString(new Date-r,1e3)+"]","["+e+"]",t)}},n);o.getDurationString=function(e,t){var i;function r(e,t){for(var i=(""+e).split(".");i[0].length0){for(var i="",r=0;r0&&(i+=","),i+="["+o.getDurationString(e.start(r))+","+o.getDurationString(e.end(r))+"]";return i}return"(empty)"},t.Log=o;var s=function(e){if(!(e instanceof ArrayBuffer))throw"Needs an array buffer";this.buffer=e,this.dataview=new DataView(e),this.position=0};s.prototype.getPosition=function(){return this.position},s.prototype.getEndPosition=function(){return this.buffer.byteLength},s.prototype.getLength=function(){return this.buffer.byteLength},s.prototype.seek=function(e){var t=Math.max(0,Math.min(this.buffer.byteLength,e));return this.position=isNaN(t)||!isFinite(t)?0:t,!0},s.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},s.prototype.readAnyInt=function(e,t){var i=0;if(this.position+e<=this.buffer.byteLength){switch(e){case 1:i=t?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:i=t?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(t)throw"No method for reading signed 24 bits values";i=this.dataview.getUint8(this.position)<<16,i|=this.dataview.getUint8(this.position+1)<<8,i|=this.dataview.getUint8(this.position+2);break;case 4:i=t?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(t)throw"No method for reading signed 64 bits values";i=this.dataview.getUint32(this.position)<<32,i|=this.dataview.getUint32(this.position+4);break;default:throw"readInt method not implemented for size: "+e}return this.position+=e,i}throw"Not enough bytes in buffer"},s.prototype.readUint8=function(){return this.readAnyInt(1,!1)},s.prototype.readUint16=function(){return this.readAnyInt(2,!1)},s.prototype.readUint24=function(){return this.readAnyInt(3,!1)},s.prototype.readUint32=function(){return this.readAnyInt(4,!1)},s.prototype.readUint64=function(){return this.readAnyInt(8,!1)},s.prototype.readString=function(e){if(this.position+e<=this.buffer.byteLength){for(var t="",i=0;ithis._byteLength&&(this._byteLength=t);else{for(i<1&&(i=1);t>i;)i*=2;var r=new ArrayBuffer(i),a=new Uint8Array(this._buffer);new Uint8Array(r,0,a.length).set(a),this.buffer=r,this._byteLength=t}}},l.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var e=new ArrayBuffer(this._byteLength),t=new Uint8Array(e),i=new Uint8Array(this._buffer,0,t.length);t.set(i),this.buffer=e}},l.BIG_ENDIAN=!1,l.LITTLE_ENDIAN=!0,l.prototype._byteLength=0,Object.defineProperty(l.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(l.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(e){this._buffer=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(l.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(l.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset,this._buffer=e.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+e.byteLength}}),l.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t},l.prototype.isEof=function(){return this.position>=this._byteLength},l.prototype.mapUint8Array=function(e){this._realloc(1*e);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},l.prototype.readInt32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var i=new Int32Array(e);return l.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),l.arrayToNative(i,null==t?this.endianness:t),this.position+=i.byteLength,i},l.prototype.readInt16Array=function(e,t){e=null==e?this.byteLength-this.position/2:e;var i=new Int16Array(e);return l.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),l.arrayToNative(i,null==t?this.endianness:t),this.position+=i.byteLength,i},l.prototype.readInt8Array=function(e){e=null==e?this.byteLength-this.position:e;var t=new Int8Array(e);return l.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},l.prototype.readUint32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var i=new Uint32Array(e);return l.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),l.arrayToNative(i,null==t?this.endianness:t),this.position+=i.byteLength,i},l.prototype.readUint16Array=function(e,t){e=null==e?this.byteLength-this.position/2:e;var i=new Uint16Array(e);return l.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),l.arrayToNative(i,null==t?this.endianness:t),this.position+=i.byteLength,i},l.prototype.readUint8Array=function(e){e=null==e?this.byteLength-this.position:e;var t=new Uint8Array(e);return l.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},l.prototype.readFloat64Array=function(e,t){e=null==e?this.byteLength-this.position/8:e;var i=new Float64Array(e);return l.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),l.arrayToNative(i,null==t?this.endianness:t),this.position+=i.byteLength,i},l.prototype.readFloat32Array=function(e,t){e=null==e?this.byteLength-this.position/4:e;var i=new Float32Array(e);return l.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),l.arrayToNative(i,null==t?this.endianness:t),this.position+=i.byteLength,i},l.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,null==e?this.endianness:e);return this.position+=4,t},l.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,null==e?this.endianness:e);return this.position+=2,t},l.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);return this.position+=1,e},l.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,null==e?this.endianness:e);return this.position+=4,t},l.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,null==e?this.endianness:e);return this.position+=2,t},l.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);return this.position+=1,e},l.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,null==e?this.endianness:e);return this.position+=4,t},l.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,null==e?this.endianness:e);return this.position+=8,t},l.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,l.memcpy=function(e,t,i,r,a){var n=new Uint8Array(e,t,a),o=new Uint8Array(i,r,a);n.set(o)},l.arrayToNative=function(e,t){return t==this.endianness?e:this.flipArrayEndianness(e)},l.nativeToEndian=function(e,t){return this.endianness==t?e:this.flipArrayEndianness(e)},l.flipArrayEndianness=function(e){for(var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=0;ia;r--,a++){var n=t[a];t[a]=t[r],t[r]=n}return e},l.prototype.failurePosition=0,String.fromCharCodeUint8=function(e){for(var t=[],i=0;i>16),this.writeUint8((65280&e)>>8),this.writeUint8(255&e)},l.prototype.adjustUint32=function(e,t){var i=this.position;this.seek(e),this.writeUint32(t),this.seek(i)},l.prototype.mapInt32Array=function(e,t){this._realloc(4*e);var i=new Int32Array(this._buffer,this.byteOffset+this.position,e);return l.arrayToNative(i,null==t?this.endianness:t),this.position+=4*e,i},l.prototype.mapInt16Array=function(e,t){this._realloc(2*e);var i=new Int16Array(this._buffer,this.byteOffset+this.position,e);return l.arrayToNative(i,null==t?this.endianness:t),this.position+=2*e,i},l.prototype.mapInt8Array=function(e){this._realloc(1*e);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},l.prototype.mapUint32Array=function(e,t){this._realloc(4*e);var i=new Uint32Array(this._buffer,this.byteOffset+this.position,e);return l.arrayToNative(i,null==t?this.endianness:t),this.position+=4*e,i},l.prototype.mapUint16Array=function(e,t){this._realloc(2*e);var i=new Uint16Array(this._buffer,this.byteOffset+this.position,e);return l.arrayToNative(i,null==t?this.endianness:t),this.position+=2*e,i},l.prototype.mapFloat64Array=function(e,t){this._realloc(8*e);var i=new Float64Array(this._buffer,this.byteOffset+this.position,e);return l.arrayToNative(i,null==t?this.endianness:t),this.position+=8*e,i},l.prototype.mapFloat32Array=function(e,t){this._realloc(4*e);var i=new Float32Array(this._buffer,this.byteOffset+this.position,e);return l.arrayToNative(i,null==t?this.endianness:t),this.position+=4*e,i};var u=function(e){this.buffers=[],this.bufferIndex=-1,e&&(this.insertBuffer(e),this.bufferIndex=0)};(u.prototype=new l(new ArrayBuffer,0,l.BIG_ENDIAN)).initialized=function(){var e;return this.bufferIndex>-1||(this.buffers.length>0?0===(e=this.buffers[0]).fileStart?(this.buffer=e,this.bufferIndex=0,o.debug("MultiBufferStream","Stream ready for parsing"),!0):(o.warn("MultiBufferStream","The first buffer should have a fileStart of 0"),this.logBufferLevel(),!1):(o.warn("MultiBufferStream","No buffer to start parsing from"),this.logBufferLevel(),!1))},ArrayBuffer.concat=function(e,t){o.debug("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer},u.prototype.reduceBuffer=function(e,t,i){var r;return(r=new Uint8Array(i)).set(new Uint8Array(e,t,i)),r.buffer.fileStart=e.fileStart+t,r.buffer.usedBytes=0,r.buffer},u.prototype.insertBuffer=function(e){for(var t=!0,i=0;ir.byteLength){this.buffers.splice(i,1),i--;continue}o.warn("MultiBufferStream","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}else e.fileStart+e.byteLength<=r.fileStart||(e=this.reduceBuffer(e,0,r.fileStart-e.fileStart)),o.debug("MultiBufferStream","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")"),this.buffers.splice(i,0,e),0===i&&(this.buffer=e);t=!1;break}if(e.fileStart0)){t=!1;break}e=this.reduceBuffer(e,a,n)}}t&&(o.debug("MultiBufferStream","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")"),this.buffers.push(e),0===i&&(this.buffer=e))},u.prototype.logBufferLevel=function(e){var t,i,r,a,n,s=[],l="";for(r=0,a=0,t=0;t0&&(l+=n.end-1+"]");var c=e?o.info:o.debug;0===this.buffers.length?c("MultiBufferStream","No more buffer in memory"):c("MultiBufferStream",this.buffers.length+" stored buffer(s) ("+r+"/"+a+" bytes), continuous ranges: "+l)},u.prototype.cleanBuffers=function(){var e,t;for(e=0;e"+this.buffer.byteLength+")"),!0}return!1}return!1},u.prototype.findPosition=function(e,t,i){var r,a=null,n=-1;for(r=!0===e?0:this.bufferIndex;r=t?(o.debug("MultiBufferStream","Found position in existing buffer #"+n),n):-1},u.prototype.findEndContiguousBuf=function(e){var t,i,r,a=void 0!==e?e:this.bufferIndex;if(i=this.buffers[a],this.buffers.length>a+1)for(t=a+1;t>3;return 31===r&&i.data.length>=2&&(r=32+((7&i.data[0])<<3)+((224&i.data[1])>>5)),r}return null},i.DecoderConfigDescriptor=function(e){i.Descriptor.call(this,4,e)},i.DecoderConfigDescriptor.prototype=new i.Descriptor,i.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8(),this.streamType=e.readUint8(),this.upStream=0!=(this.streamType>>1&1),this.streamType=this.streamType>>>2,this.bufferSize=e.readUint24(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32(),this.size-=13,this.parseRemainingDescriptors(e)},i.DecoderSpecificInfo=function(e){i.Descriptor.call(this,5,e)},i.DecoderSpecificInfo.prototype=new i.Descriptor,i.SLConfigDescriptor=function(e){i.Descriptor.call(this,6,e)},i.SLConfigDescriptor.prototype=new i.Descriptor,this};t.MPEG4DescriptorParser=d;var h={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:["mdat","idat","free","skip","meco","strk"],FULL_BOXES:["hmhd","nmhd","iods","xml ","bxml","ipro","mere"],CONTAINER_BOXES:[["moov",["trak","pssh"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl",["sgpd","sbgp"]],["mvex",["trex"]],["moof",["traf"]],["traf",["trun","sgpd","sbgp"]],["vttc"],["tref"],["iref"],["mfra",["tfra"]],["meco"],["hnti"],["hinf"],["strk"],["strd"],["sinf"],["rinf"],["schi"],["trgr"],["udta",["kind"]],["iprp",["ipma"]],["ipco"],["grpl"],["j2kH"],["etyp",["tyco"]]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){h.FullBox.prototype=new h.Box,h.ContainerBox.prototype=new h.Box,h.SampleEntry.prototype=new h.Box,h.TrackGroupTypeBox.prototype=new h.FullBox,h.BASIC_BOXES.forEach((function(e){h.createBoxCtor(e)})),h.FULL_BOXES.forEach((function(e){h.createFullBoxCtor(e)})),h.CONTAINER_BOXES.forEach((function(e){h.createContainerBoxCtor(e[0],null,e[1])}))},Box:function(e,t,i){this.type=e,this.size=t,this.uuid=i},FullBox:function(e,t,i){h.Box.call(this,e,t,i),this.flags=0,this.version=0},ContainerBox:function(e,t,i){h.Box.call(this,e,t,i),this.boxes=[]},SampleEntry:function(e,t,i,r){h.ContainerBox.call(this,e,t),this.hdr_size=i,this.start=r},SampleGroupEntry:function(e){this.grouping_type=e},TrackGroupTypeBox:function(e,t){h.FullBox.call(this,e,t)},createBoxCtor:function(e,t){h.boxCodes.push(e),h[e+"Box"]=function(t){h.Box.call(this,e,t)},h[e+"Box"].prototype=new h.Box,t&&(h[e+"Box"].prototype.parse=t)},createFullBoxCtor:function(e,t){h[e+"Box"]=function(t){h.FullBox.call(this,e,t)},h[e+"Box"].prototype=new h.FullBox,h[e+"Box"].prototype.parse=function(e){this.parseFullHeader(e),t&&t.call(this,e)}},addSubBoxArrays:function(e){if(e){this.subBoxNames=e;for(var t=e.length,i=0;ii?(o.error("BoxParser","Box of type '"+u+"' has a size "+c+" greater than its container size "+i),{code:h.ERR_NOT_ENOUGH_DATA,type:u,size:c,hdr_size:l,start:s}):0!==c&&s+c>e.getEndPosition()?(e.seek(s),o.info("BoxParser","Not enough data in stream to parse the entire '"+u+"' box"),{code:h.ERR_NOT_ENOUGH_DATA,type:u,size:c,hdr_size:l,start:s}):t?{code:h.OK,type:u,size:c,hdr_size:l,start:s}:(h[u+"Box"]?r=new h[u+"Box"](c):"uuid"!==u?(o.warn("BoxParser","Unknown box type: '"+u+"'"),(r=new h.Box(u,c)).has_unparsed_data=!0):h.UUIDBoxes[n]?r=new h.UUIDBoxes[n](c):(o.warn("BoxParser","Unknown uuid type: '"+n+"'"),(r=new h.Box(u,c)).uuid=n,r.has_unparsed_data=!0),r.hdr_size=l,r.start=s,r.write===h.Box.prototype.write&&"mdat"!==r.type&&(o.info("BoxParser","'"+d+"' box writing not yet implemented, keeping unparsed data in memory for later write"),r.parseDataAndRewind(e)),r.parse(e),(a=e.getPosition()-(r.start+r.size))<0?(o.warn("BoxParser","Parsing of box '"+d+"' did not read the entire indicated box data size (missing "+-a+" bytes), seeking forward"),e.seek(r.start+r.size)):a>0&&(o.error("BoxParser","Parsing of box '"+d+"' read "+a+" more bytes than the indicated box data size, seeking backwards"),0!==r.size&&e.seek(r.start+r.size)),{code:h.OK,box:r,size:r.size})},h.Box.prototype.parse=function(e){"mdat"!=this.type?this.data=e.readUint8Array(this.size-this.hdr_size):0===this.size?e.seek(e.getEndPosition()):e.seek(this.start+this.size)},h.Box.prototype.parseDataAndRewind=function(e){this.data=e.readUint8Array(this.size-this.hdr_size),e.position-=this.size-this.hdr_size},h.FullBox.prototype.parseDataAndRewind=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=4,e.position-=this.size-this.hdr_size},h.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8(),this.flags=e.readUint24(),this.hdr_size+=4},h.FullBox.prototype.parse=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},h.ContainerBox.prototype.parse=function(e){for(var t,i;e.getPosition()>10&31,t[1]=this.language>>5&31,t[2]=31&this.language,this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96)},h.SAMPLE_ENTRY_TYPE_VISUAL="Visual",h.SAMPLE_ENTRY_TYPE_AUDIO="Audio",h.SAMPLE_ENTRY_TYPE_HINT="Hint",h.SAMPLE_ENTRY_TYPE_METADATA="Metadata",h.SAMPLE_ENTRY_TYPE_SUBTITLE="Subtitle",h.SAMPLE_ENTRY_TYPE_SYSTEM="System",h.SAMPLE_ENTRY_TYPE_TEXT="Text",h.SampleEntry.prototype.parseHeader=function(e){e.readUint8Array(6),this.data_reference_index=e.readUint16(),this.hdr_size+=8},h.SampleEntry.prototype.parse=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},h.SampleEntry.prototype.parseDataAndRewind=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=8,e.position-=this.size-this.hdr_size},h.SampleEntry.prototype.parseFooter=function(e){h.ContainerBox.prototype.parse.call(this,e)},h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_HINT),h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_METADATA),h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_SUBTITLE),h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_SYSTEM),h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_TEXT),h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,(function(e){var t;this.parseHeader(e),e.readUint16(),e.readUint16(),e.readUint32Array(3),this.width=e.readUint16(),this.height=e.readUint16(),this.horizresolution=e.readUint32(),this.vertresolution=e.readUint32(),e.readUint32(),this.frame_count=e.readUint16(),t=Math.min(31,e.readUint8()),this.compressorname=e.readString(t),t<31&&e.readString(31-t),this.depth=e.readUint16(),e.readUint16(),this.parseFooter(e)})),h.createMediaSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,(function(e){this.parseHeader(e),e.readUint32Array(2),this.channel_count=e.readUint16(),this.samplesize=e.readUint16(),e.readUint16(),e.readUint16(),this.samplerate=e.readUint32()/65536,this.parseFooter(e)})),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"avc1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"avc2"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"avc3"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"avc4"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"av01"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"dav1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"hvc1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"hev1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"hvt1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"lhe1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"dvh1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"dvhe"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"vvc1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"vvi1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"vvs1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"vvcN"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"vp08"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"vp09"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"avs3"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"j2ki"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"mjp2"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"mjpg"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"uncv"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"mp4a"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"ac-3"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"ac-4"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"ec-3"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"Opus"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"mha1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"mha2"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"mhm1"),h.createSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"mhm2"),h.createEncryptedSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_VISUAL,"encv"),h.createEncryptedSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_AUDIO,"enca"),h.createEncryptedSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_SUBTITLE,"encu"),h.createEncryptedSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_SYSTEM,"encs"),h.createEncryptedSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_TEXT,"enct"),h.createEncryptedSampleEntryCtor(h.SAMPLE_ENTRY_TYPE_METADATA,"encm"),h.createBoxCtor("a1lx",(function(e){var t=16*(1+(1&e.readUint8()));this.layer_size=[];for(var i=0;i<3;i++)this.layer_size[i]=16==t?e.readUint16():e.readUint32()})),h.createBoxCtor("a1op",(function(e){this.op_index=e.readUint8()})),h.createFullBoxCtor("auxC",(function(e){this.aux_type=e.readCString();var t=this.size-this.hdr_size-(this.aux_type.length+1);this.aux_subtype=e.readUint8Array(t)})),h.createBoxCtor("av1C",(function(e){var t=e.readUint8();if(t>>7&!1)o.error("av1C marker problem");else if(this.version=127&t,1===this.version)if(t=e.readUint8(),this.seq_profile=t>>5&7,this.seq_level_idx_0=31&t,t=e.readUint8(),this.seq_tier_0=t>>7&1,this.high_bitdepth=t>>6&1,this.twelve_bit=t>>5&1,this.monochrome=t>>4&1,this.chroma_subsampling_x=t>>3&1,this.chroma_subsampling_y=t>>2&1,this.chroma_sample_position=3&t,t=e.readUint8(),this.reserved_1=t>>5&7,0===this.reserved_1){if(this.initial_presentation_delay_present=t>>4&1,1===this.initial_presentation_delay_present)this.initial_presentation_delay_minus_one=15&t;else if(this.reserved_2=15&t,0!==this.reserved_2)return void o.error("av1C reserved_2 parsing problem");var i=this.size-this.hdr_size-4;this.configOBUs=e.readUint8Array(i)}else o.error("av1C reserved_1 parsing problem");else o.error("av1C version "+this.version+" not supported")})),h.createBoxCtor("avcC",(function(e){var t,i;for(this.configurationVersion=e.readUint8(),this.AVCProfileIndication=e.readUint8(),this.profile_compatibility=e.readUint8(),this.AVCLevelIndication=e.readUint8(),this.lengthSizeMinusOne=3&e.readUint8(),this.nb_SPS_nalus=31&e.readUint8(),i=this.size-this.hdr_size-6,this.SPS=[],t=0;t0&&(this.ext=e.readUint8Array(i))})),h.createBoxCtor("btrt",(function(e){this.bufferSizeDB=e.readUint32(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32()})),h.createFullBoxCtor("ccst",(function(e){var t=e.readUint8();this.all_ref_pics_intra=128==(128&t),this.intra_pred_used=64==(64&t),this.max_ref_per_pic=(63&t)>>2,e.readUint24()})),h.createBoxCtor("cdef",(function(e){var t;for(this.channel_count=e.readUint16(),this.channel_indexes=[],this.channel_types=[],this.channel_associations=[],t=0;t=32768&&this.component_type_urls.push(e.readCString())}})),h.createFullBoxCtor("co64",(function(e){var t,i;if(t=e.readUint32(),this.chunk_offsets=[],0===this.version)for(i=0;i>7}else("rICC"===this.colour_type||"prof"===this.colour_type)&&(this.ICC_profile=e.readUint8Array(this.size-4))})),h.createFullBoxCtor("cprt",(function(e){this.parseLanguage(e),this.notice=e.readCString()})),h.createFullBoxCtor("cslg",(function(e){0===this.version&&(this.compositionToDTSShift=e.readInt32(),this.leastDecodeToDisplayDelta=e.readInt32(),this.greatestDecodeToDisplayDelta=e.readInt32(),this.compositionStartTime=e.readInt32(),this.compositionEndTime=e.readInt32())})),h.createFullBoxCtor("ctts",(function(e){var t,i;if(t=e.readUint32(),this.sample_counts=[],this.sample_offsets=[],0===this.version)for(i=0;i>6,this.bsid=t>>1&31,this.bsmod=(1&t)<<2|i>>6&3,this.acmod=i>>3&7,this.lfeon=i>>2&1,this.bit_rate_code=3&i|r>>5&7})),h.createBoxCtor("dec3",(function(e){var t=e.readUint16();this.data_rate=t>>3,this.num_ind_sub=7&t,this.ind_subs=[];for(var i=0;i>6,r.bsid=a>>1&31,r.bsmod=(1&a)<<4|n>>4&15,r.acmod=n>>1&7,r.lfeon=1&n,r.num_dep_sub=o>>1&15,r.num_dep_sub>0&&(r.chan_loc=(1&o)<<8|e.readUint8())}})),h.createFullBoxCtor("dfLa",(function(e){var t=[],i=["STREAMINFO","PADDING","APPLICATION","SEEKTABLE","VORBIS_COMMENT","CUESHEET","PICTURE","RESERVED"];for(this.parseFullHeader(e);;){var r=e.readUint8(),a=Math.min(127&r,i.length-1);if(a?e.readUint8Array(e.readUint24()):(e.readUint8Array(13),this.samplerate=e.readUint32()>>12,e.readUint8Array(20)),t.push(i[a]),128&r)break}this.numMetadataBlocks=t.length+" ("+t.join(", ")+")"})),h.createBoxCtor("dimm",(function(e){this.bytessent=e.readUint64()})),h.createBoxCtor("dmax",(function(e){this.time=e.readUint32()})),h.createBoxCtor("dmed",(function(e){this.bytessent=e.readUint64()})),h.createBoxCtor("dOps",(function(e){if(this.Version=e.readUint8(),this.OutputChannelCount=e.readUint8(),this.PreSkip=e.readUint16(),this.InputSampleRate=e.readUint32(),this.OutputGain=e.readInt16(),this.ChannelMappingFamily=e.readUint8(),0!==this.ChannelMappingFamily){this.StreamCount=e.readUint8(),this.CoupledCount=e.readUint8(),this.ChannelMapping=[];for(var t=0;t=4;)this.compatible_brands[i]=e.readString(4),t-=4,i++})),h.createFullBoxCtor("hdlr",(function(e){0===this.version&&(e.readUint32(),this.handler=e.readString(4),e.readUint32Array(3),this.name=e.readString(this.size-this.hdr_size-20),"\0"===this.name[this.name.length-1]&&(this.name=this.name.slice(0,-1)))})),h.createBoxCtor("hvcC",(function(e){var t,i,r,a;this.configurationVersion=e.readUint8(),a=e.readUint8(),this.general_profile_space=a>>6,this.general_tier_flag=(32&a)>>5,this.general_profile_idc=31&a,this.general_profile_compatibility=e.readUint32(),this.general_constraint_indicator=e.readUint8Array(6),this.general_level_idc=e.readUint8(),this.min_spatial_segmentation_idc=4095&e.readUint16(),this.parallelismType=3&e.readUint8(),this.chroma_format_idc=3&e.readUint8(),this.bit_depth_luma_minus8=7&e.readUint8(),this.bit_depth_chroma_minus8=7&e.readUint8(),this.avgFrameRate=e.readUint16(),a=e.readUint8(),this.constantFrameRate=a>>6,this.numTemporalLayers=(13&a)>>3,this.temporalIdNested=(4&a)>>2,this.lengthSizeMinusOne=3&a,this.nalu_arrays=[];var n=e.readUint8();for(t=0;t>7,o.nalu_type=63&a;var s=e.readUint16();for(i=0;i>4&15,this.length_size=15&t,t=e.readUint8(),this.base_offset_size=t>>4&15,1===this.version||2===this.version?this.index_size=15&t:this.index_size=0,this.items=[];var i=0;if(this.version<2)i=e.readUint16();else{if(2!==this.version)throw"version of iloc box not supported";i=e.readUint32()}for(var r=0;r>7,this.axis=1&t})),h.createFullBoxCtor("infe",(function(e){if(0!==this.version&&1!==this.version||(this.item_ID=e.readUint16(),this.item_protection_index=e.readUint16(),this.item_name=e.readCString(),this.content_type=e.readCString(),this.content_encoding=e.readCString()),1===this.version)return this.extension_type=e.readString(4),o.warn("BoxParser","Cannot parse extension type"),void e.seek(this.start+this.size);this.version>=2&&(2===this.version?this.item_ID=e.readUint16():3===this.version&&(this.item_ID=e.readUint32()),this.item_protection_index=e.readUint16(),this.item_type=e.readString(4),this.item_name=e.readCString(),"mime"===this.item_type?(this.content_type=e.readCString(),this.content_encoding=e.readCString()):"uri "===this.item_type&&(this.item_uri_type=e.readCString()))})),h.createFullBoxCtor("ipma",(function(e){var t,i;for(entry_count=e.readUint32(),this.associations=[],t=0;t>7==1,1&this.flags?o.property_index=(127&n)<<8|e.readUint8():o.property_index=127&n}}})),h.createFullBoxCtor("iref",(function(e){var t,i;for(this.references=[];e.getPosition()>7,r.assignment_type=127&a,r.assignment_type){case 0:r.grouping_type=e.readString(4);break;case 1:r.grouping_type=e.readString(4),r.grouping_type_parameter=e.readUint32();break;case 2:case 3:break;case 4:r.sub_track_id=e.readUint32();break;default:o.warn("BoxParser","Unknown leva assignement type")}}})),h.createBoxCtor("lsel",(function(e){this.layer_id=e.readUint16()})),h.createBoxCtor("maxr",(function(e){this.period=e.readUint32(),this.bytes=e.readUint32()})),p.prototype.toString=function(){return"("+this.x+","+this.y+")"},h.createBoxCtor("mdcv",(function(e){this.display_primaries=[],this.display_primaries[0]=new p(e.readUint16(),e.readUint16()),this.display_primaries[1]=new p(e.readUint16(),e.readUint16()),this.display_primaries[2]=new p(e.readUint16(),e.readUint16()),this.white_point=new p(e.readUint16(),e.readUint16()),this.max_display_mastering_luminance=e.readUint32(),this.min_display_mastering_luminance=e.readUint32()})),h.createFullBoxCtor("mdhd",(function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.parseLanguage(e),e.readUint16()})),h.createFullBoxCtor("mehd",(function(e){1&this.flags&&(o.warn("BoxParser","mehd box incorrectly uses flags set to 1, converting version to 1"),this.version=1),1==this.version?this.fragment_duration=e.readUint64():this.fragment_duration=e.readUint32()})),h.createFullBoxCtor("meta",(function(e){this.boxes=[],h.ContainerBox.prototype.parse.call(this,e)})),h.createFullBoxCtor("mfhd",(function(e){this.sequence_number=e.readUint32()})),h.createFullBoxCtor("mfro",(function(e){this._size=e.readUint32()})),h.createFullBoxCtor("mskC",(function(e){this.bits_per_pixel=e.readUint8()})),h.createFullBoxCtor("mvhd",(function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.rate=e.readUint32(),this.volume=e.readUint16()>>8,e.readUint16(),e.readUint32Array(2),this.matrix=e.readUint32Array(9),e.readUint32Array(6),this.next_track_id=e.readUint32()})),h.createBoxCtor("npck",(function(e){this.packetssent=e.readUint32()})),h.createBoxCtor("nump",(function(e){this.packetssent=e.readUint64()})),h.createFullBoxCtor("padb",(function(e){var t=e.readUint32();this.padbits=[];for(var i=0;i0){var t=e.readUint32();this.kid=[];for(var i=0;i0&&(this.data=e.readUint8Array(r))})),h.createFullBoxCtor("clef",(function(e){this.width=e.readUint32(),this.height=e.readUint32()})),h.createFullBoxCtor("enof",(function(e){this.width=e.readUint32(),this.height=e.readUint32()})),h.createFullBoxCtor("prof",(function(e){this.width=e.readUint32(),this.height=e.readUint32()})),h.createContainerBoxCtor("tapt",null,["clef","prof","enof"]),h.createBoxCtor("rtp ",(function(e){this.descriptionformat=e.readString(4),this.sdptext=e.readString(this.size-this.hdr_size-4)})),h.createFullBoxCtor("saio",(function(e){1&this.flags&&(this.aux_info_type=e.readUint32(),this.aux_info_type_parameter=e.readUint32());var t=e.readUint32();this.offset=[];for(var i=0;i>7,this.avgRateFlag=t>>6&1,this.durationFlag&&(this.duration=e.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()),this.dependency=[];for(var i=e.readUint8(),r=0;r>7,this.num_leading_samples=127&t})),h.createSampleGroupCtor("rash",(function(e){if(this.operation_point_count=e.readUint16(),this.description_length!==2+(1===this.operation_point_count?2:6*this.operation_point_count)+9)o.warn("BoxParser","Mismatch in "+this.grouping_type+" sample group length"),this.data=e.readUint8Array(this.description_length-2);else{if(1===this.operation_point_count)this.target_rate_share=e.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var t=0;t>4,this.skip_byte_block=15&t,this.isProtected=e.readUint8(),this.Per_Sample_IV_Size=e.readUint8(),this.KID=h.parseHex16(e),this.constant_IV_size=0,this.constant_IV=0,1===this.isProtected&&0===this.Per_Sample_IV_Size&&(this.constant_IV_size=e.readUint8(),this.constant_IV=e.readUint8Array(this.constant_IV_size))})),h.createSampleGroupCtor("stsa",(function(e){o.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),h.createSampleGroupCtor("sync",(function(e){var t=e.readUint8();this.NAL_unit_type=63&t})),h.createSampleGroupCtor("tele",(function(e){var t=e.readUint8();this.level_independently_decodable=t>>7})),h.createSampleGroupCtor("tsas",(function(e){o.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),h.createSampleGroupCtor("tscl",(function(e){o.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),h.createSampleGroupCtor("vipr",(function(e){o.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),h.createFullBoxCtor("sbgp",(function(e){this.grouping_type=e.readString(4),1===this.version?this.grouping_type_parameter=e.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var t=e.readUint32(),i=0;i>6,this.sample_depends_on[r]=t>>4&3,this.sample_is_depended_on[r]=t>>2&3,this.sample_has_redundancy[r]=3&t})),h.createFullBoxCtor("senc"),h.createFullBoxCtor("sgpd",(function(e){this.grouping_type=e.readString(4),o.debug("BoxParser","Found Sample Groups of type "+this.grouping_type),1===this.version?this.default_length=e.readUint32():this.default_length=0,this.version>=2&&(this.default_group_description_index=e.readUint32()),this.entries=[];for(var t=e.readUint32(),i=0;i>31&1,r.referenced_size=2147483647&a,r.subsegment_duration=e.readUint32(),a=e.readUint32(),r.starts_with_SAP=a>>31&1,r.SAP_type=a>>28&7,r.SAP_delta_time=268435455&a}})),h.SingleItemTypeReferenceBox=function(e,t,i,r){h.Box.call(this,e,t),this.hdr_size=i,this.start=r},h.SingleItemTypeReferenceBox.prototype=new h.Box,h.SingleItemTypeReferenceBox.prototype.parse=function(e){this.from_item_ID=e.readUint16();var t=e.readUint16();this.references=[];for(var i=0;i>4&15,this.sample_sizes[t+1]=15&r}else if(8===this.field_size)for(t=0;t0)for(i=0;i>4&15,this.default_skip_byte_block=15&t}this.default_isProtected=e.readUint8(),this.default_Per_Sample_IV_Size=e.readUint8(),this.default_KID=h.parseHex16(e),1===this.default_isProtected&&0===this.default_Per_Sample_IV_Size&&(this.default_constant_IV_size=e.readUint8(),this.default_constant_IV=e.readUint8Array(this.default_constant_IV_size))})),h.createFullBoxCtor("tfdt",(function(e){1==this.version?this.baseMediaDecodeTime=e.readUint64():this.baseMediaDecodeTime=e.readUint32()})),h.createFullBoxCtor("tfhd",(function(e){var t=0;this.track_id=e.readUint32(),this.size-this.hdr_size>t&&this.flags&h.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=e.readUint64(),t+=8):this.base_data_offset=0,this.size-this.hdr_size>t&&this.flags&h.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=e.readUint32(),t+=4):this.default_sample_description_index=0,this.size-this.hdr_size>t&&this.flags&h.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=e.readUint32(),t+=4):this.default_sample_duration=0,this.size-this.hdr_size>t&&this.flags&h.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=e.readUint32(),t+=4):this.default_sample_size=0,this.size-this.hdr_size>t&&this.flags&h.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=e.readUint32(),t+=4):this.default_sample_flags=0})),h.createFullBoxCtor("tfra",(function(e){this.track_ID=e.readUint32(),e.readUint24();var t=e.readUint8();this.length_size_of_traf_num=t>>4&3,this.length_size_of_trun_num=t>>2&3,this.length_size_of_sample_num=3&t,this.entries=[];for(var i=e.readUint32(),r=0;r>8,e.readUint16(),this.matrix=e.readInt32Array(9),this.width=e.readUint32(),this.height=e.readUint32()})),h.createBoxCtor("tmax",(function(e){this.time=e.readUint32()})),h.createBoxCtor("tmin",(function(e){this.time=e.readUint32()})),h.createBoxCtor("totl",(function(e){this.bytessent=e.readUint32()})),h.createBoxCtor("tpay",(function(e){this.bytessent=e.readUint32()})),h.createBoxCtor("tpyl",(function(e){this.bytessent=e.readUint64()})),h.TrackGroupTypeBox.prototype.parse=function(e){this.parseFullHeader(e),this.track_group_id=e.readUint32()},h.createTrackGroupCtor("msrc"),h.TrackReferenceTypeBox=function(e,t,i,r){h.Box.call(this,e,t),this.hdr_size=i,this.start=r},h.TrackReferenceTypeBox.prototype=new h.Box,h.TrackReferenceTypeBox.prototype.parse=function(e){this.track_ids=e.readUint32Array((this.size-this.hdr_size)/4)},h.trefBox.prototype.parse=function(e){for(var t,i;e.getPosition()t&&this.flags&h.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=e.readInt32(),t+=4):this.data_offset=0,this.size-this.hdr_size>t&&this.flags&h.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=e.readUint32(),t+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>t)for(var i=0;i>7&1,this.block_pad_lsb=i>>6&1,this.block_little_endian=i>>5&1,this.block_reversed=i>>4&1,this.pad_unknown=i>>3&1,this.pixel_size=e.readUint32(),this.row_align_size=e.readUint32(),this.tile_align_size=e.readUint32(),this.num_tile_cols_minus_one=e.readUint32(),this.num_tile_rows_minus_one=e.readUint32()}})),h.createFullBoxCtor("url ",(function(e){1!==this.flags&&(this.location=e.readCString())})),h.createFullBoxCtor("urn ",(function(e){this.name=e.readCString(),this.size-this.hdr_size-this.name.length-1>0&&(this.location=e.readCString())})),h.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66",!0,!1,(function(e){this.LiveServerManifest=e.readString(this.size-this.hdr_size).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")})),h.createUUIDBox("d08a4f1810f34a82b6c832d8aba183d3",!0,!1,(function(e){this.system_id=h.parseHex16(e);var t=e.readUint32();t>0&&(this.data=e.readUint8Array(t))})),h.createUUIDBox("a2394f525a9b4f14a2446c427c648df4",!0,!1),h.createUUIDBox("8974dbce7be74c5184f97148f9882554",!0,!1,(function(e){this.default_AlgorithmID=e.readUint24(),this.default_IV_size=e.readUint8(),this.default_KID=h.parseHex16(e)})),h.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f",!0,!1,(function(e){this.fragment_count=e.readUint8(),this.entries=[];for(var t=0;t>4,this.chromaSubsampling=t>>1&7,this.videoFullRangeFlag=1&t,this.colourPrimaries=e.readUint8(),this.transferCharacteristics=e.readUint8(),this.matrixCoefficients=e.readUint8(),this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize)):(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4&15,this.colorSpace=15&t,t=e.readUint8(),this.chromaSubsampling=t>>4&15,this.transferFunction=t>>1&7,this.videoFullRangeFlag=1&t,this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize))})),h.createBoxCtor("vttC",(function(e){this.text=e.readString(this.size-this.hdr_size)})),h.createFullBoxCtor("vvcC",(function(e){var t,i,r={held_bits:void 0,num_held_bits:0,stream_read_1_bytes:function(e){this.held_bits=e.readUint8(),this.num_held_bits=8},stream_read_2_bytes:function(e){this.held_bits=e.readUint16(),this.num_held_bits=16},extract_bits:function(e){var t=this.held_bits>>this.num_held_bits-e&(1<1){for(r.stream_read_1_bytes(e),this.ptl_sublayer_present_mask=0,i=this.num_sublayers-2;i>=0;--i){var o=r.extract_bits(1);this.ptl_sublayer_present_mask|=o<1;++i)r.extract_bits(1);for(this.sublayer_level_idc=[],i=this.num_sublayers-2;i>=0;--i)this.ptl_sublayer_present_mask&1<>=1;t+=h.decimalToHex(r,0),t+=".",0===this.hvcC.general_tier_flag?t+="L":t+="H",t+=this.hvcC.general_level_idc;var a=!1,n="";for(e=5;e>=0;e--)(this.hvcC.general_constraint_indicator[e]||a)&&(n="."+h.decimalToHex(this.hvcC.general_constraint_indicator[e],0)+n,a=!0);t+=n}return t},h.vvc1SampleEntry.prototype.getCodec=h.vvi1SampleEntry.prototype.getCodec=function(){var e,t=h.SampleEntry.prototype.getCodec.call(this);if(this.vvcC){t+="."+this.vvcC.general_profile_idc,this.vvcC.general_tier_flag?t+=".H":t+=".L",t+=this.vvcC.general_level_idc;var i="";if(this.vvcC.general_constraint_info){var r,a=[],n=0;for(n|=this.vvcC.ptl_frame_only_constraint<<7,n|=this.vvcC.ptl_multilayer_enabled<<6,e=0;e>2&63,a.push(n),n&&(r=e),n=this.vvcC.general_constraint_info[e]>>2&3;if(void 0===r)i=".CA";else{i=".C";var o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",s=0,l=0;for(e=0;e<=r;++e)for(s=s<<8|a[e],l+=8;l>=5;)i+=o[s>>l-5&31],s&=(1<<(l-=5))-1;l&&(i+=o[31&(s<<=5-l)])}}t+=i}return t},h.mp4aSampleEntry.prototype.getCodec=function(){var e=h.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI(),i=this.esds.esd.getAudioConfig();return e+"."+h.decimalToHex(t)+(i?"."+i:"")}return e},h.stxtSampleEntry.prototype.getCodec=function(){var e=h.SampleEntry.prototype.getCodec.call(this);return this.mime_format?e+"."+this.mime_format:e},h.vp08SampleEntry.prototype.getCodec=h.vp09SampleEntry.prototype.getCodec=function(){var e=h.SampleEntry.prototype.getCodec.call(this),t=this.vpcC.level;0==t&&(t="00");var i=this.vpcC.bitDepth;return 8==i&&(i="08"),e+".0"+this.vpcC.profile+"."+t+"."+i},h.av01SampleEntry.prototype.getCodec=function(){var e,t=h.SampleEntry.prototype.getCodec.call(this),i=this.av1C.seq_level_idx_0;return i<10&&(i="0"+i),2===this.av1C.seq_profile&&1===this.av1C.high_bitdepth?e=1===this.av1C.twelve_bit?"12":"10":this.av1C.seq_profile<=2&&(e=1===this.av1C.high_bitdepth?"10":"08"),t+"."+this.av1C.seq_profile+"."+i+(this.av1C.seq_tier_0?"H":"M")+"."+e},h.Box.prototype.writeHeader=function(e,t){this.size+=8,this.size>c&&(this.size+=8),"uuid"===this.type&&(this.size+=16),o.debug("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.getPosition()+(t||"")),this.size>c?e.writeUint32(1):(this.sizePosition=e.getPosition(),e.writeUint32(this.size)),e.writeString(this.type,null,4),"uuid"===this.type&&e.writeUint8Array(this.uuid),this.size>c&&e.writeUint64(this.size)},h.FullBox.prototype.writeHeader=function(e){this.size+=4,h.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags),e.writeUint8(this.version),e.writeUint24(this.flags)},h.Box.prototype.write=function(e){"mdat"===this.type?this.data&&(this.size=this.data.length,this.writeHeader(e),e.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(e),this.data&&e.writeUint8Array(this.data))},h.ContainerBox.prototype.write=function(e){this.size=0,this.writeHeader(e);for(var t=0;t=2&&e.writeUint32(this.default_sample_description_index),e.writeUint32(this.entries.length),t=0;t0)for(t=0;t+1t?1:0,this.flags=0,this.size=4,1===this.version&&(this.size+=4),this.writeHeader(e),1===this.version?e.writeUint64(this.baseMediaDecodeTime):e.writeUint32(this.baseMediaDecodeTime)},h.tfhdBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&h.TFHD_FLAG_BASE_DATA_OFFSET&&(this.size+=8),this.flags&h.TFHD_FLAG_SAMPLE_DESC&&(this.size+=4),this.flags&h.TFHD_FLAG_SAMPLE_DUR&&(this.size+=4),this.flags&h.TFHD_FLAG_SAMPLE_SIZE&&(this.size+=4),this.flags&h.TFHD_FLAG_SAMPLE_FLAGS&&(this.size+=4),this.writeHeader(e),e.writeUint32(this.track_id),this.flags&h.TFHD_FLAG_BASE_DATA_OFFSET&&e.writeUint64(this.base_data_offset),this.flags&h.TFHD_FLAG_SAMPLE_DESC&&e.writeUint32(this.default_sample_description_index),this.flags&h.TFHD_FLAG_SAMPLE_DUR&&e.writeUint32(this.default_sample_duration),this.flags&h.TFHD_FLAG_SAMPLE_SIZE&&e.writeUint32(this.default_sample_size),this.flags&h.TFHD_FLAG_SAMPLE_FLAGS&&e.writeUint32(this.default_sample_flags)},h.tkhdBox.prototype.write=function(e){this.version=0,this.size=80,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.track_id),e.writeUint32(0),e.writeUint32(this.duration),e.writeUint32(0),e.writeUint32(0),e.writeInt16(this.layer),e.writeInt16(this.alternate_group),e.writeInt16(this.volume<<8),e.writeUint16(0),e.writeInt32Array(this.matrix),e.writeUint32(this.width),e.writeUint32(this.height)},h.trexBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeUint32(this.track_id),e.writeUint32(this.default_sample_description_index),e.writeUint32(this.default_sample_duration),e.writeUint32(this.default_sample_size),e.writeUint32(this.default_sample_flags)},h.trunBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&h.TRUN_FLAGS_DATA_OFFSET&&(this.size+=4),this.flags&h.TRUN_FLAGS_FIRST_FLAG&&(this.size+=4),this.flags&h.TRUN_FLAGS_DURATION&&(this.size+=4*this.sample_duration.length),this.flags&h.TRUN_FLAGS_SIZE&&(this.size+=4*this.sample_size.length),this.flags&h.TRUN_FLAGS_FLAGS&&(this.size+=4*this.sample_flags.length),this.flags&h.TRUN_FLAGS_CTS_OFFSET&&(this.size+=4*this.sample_composition_time_offset.length),this.writeHeader(e),e.writeUint32(this.sample_count),this.flags&h.TRUN_FLAGS_DATA_OFFSET&&(this.data_offset_position=e.getPosition(),e.writeInt32(this.data_offset)),this.flags&h.TRUN_FLAGS_FIRST_FLAG&&e.writeUint32(this.first_sample_flags);for(var t=0;t-1||e[i]instanceof h.Box||t[i]instanceof h.Box||void 0===e[i]||void 0===t[i]||"function"==typeof e[i]||"function"==typeof t[i]||e.subBoxNames&&e.subBoxNames.indexOf(i.slice(0,4))>-1||t.subBoxNames&&t.subBoxNames.indexOf(i.slice(0,4))>-1||"data"===i||"start"===i||"size"===i||"creation_time"===i||"modification_time"===i||h.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(i)>-1||e[i]===t[i]))return!1;return!0},h.boxEqual=function(e,t){if(!h.boxEqualFields(e,t))return!1;for(var i=0;i1)for(t=1;t-1&&this.fragmentedTracks.splice(t,1)},y.prototype.setExtractionOptions=function(e,t,i){var r=this.getTrackById(e);if(r){var a={};this.extractedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.nb_samples=1e3,a.samples=[],i&&i.nbSamples&&(a.nb_samples=i.nbSamples)}},y.prototype.unsetExtractionOptions=function(e){for(var t=-1,i=0;i-1&&this.extractedTracks.splice(t,1)},y.prototype.parse=function(){var e,t;if(!this.restoreParsePosition||this.restoreParsePosition())for(;;){if(this.hasIncompleteMdat&&this.hasIncompleteMdat()){if(this.processIncompleteMdat())continue;return}if(this.saveParsePosition&&this.saveParsePosition(),(e=h.parseOneBox(this.stream,!1)).code===h.ERR_NOT_ENOUGH_DATA){if(this.processIncompleteBox){if(this.processIncompleteBox(e))continue;return}return}var i;switch(i="uuid"!==(t=e.box).type?t.type:t.uuid,this.boxes.push(t),i){case"mdat":this.mdats.push(t);break;case"moof":this.moofs.push(t);break;case"moov":this.moovStartFound=!0,0===this.mdats.length&&(this.isProgressive=!0);default:void 0!==this[i]&&o.warn("ISOFile","Duplicate Box of type: "+i+", overriding previous occurrence"),this[i]=t}this.updateUsedBytes&&this.updateUsedBytes(t,e)}},y.prototype.checkBuffer=function(e){if(null==e)throw"Buffer must be defined and non empty";if(void 0===e.fileStart)throw"Buffer must have a fileStart property";return 0===e.byteLength?(o.warn("ISOFile","Ignoring empty buffer (fileStart: "+e.fileStart+")"),this.stream.logBufferLevel(),!1):(o.info("ISOFile","Processing buffer (fileStart: "+e.fileStart+")"),e.usedBytes=0,this.stream.insertBuffer(e),this.stream.logBufferLevel(),!!this.stream.initialized()||(o.warn("ISOFile","Not ready to start parsing"),!1))},y.prototype.appendBuffer=function(e,t){var i;if(this.checkBuffer(e))return this.parse(),this.moovStartFound&&!this.moovStartSent&&(this.moovStartSent=!0,this.onMoovStart&&this.onMoovStart()),this.moov?(this.sampleListBuilt||(this.buildSampleLists(),this.sampleListBuilt=!0),this.updateSampleLists(),this.onReady&&!this.readySent&&(this.readySent=!0,this.onReady(this.getInfo())),this.processSamples(t),this.nextSeekPosition?(i=this.nextSeekPosition,this.nextSeekPosition=void 0):i=this.nextParsePosition,this.stream.getEndFilePositionAfter&&(i=this.stream.getEndFilePositionAfter(i))):i=this.nextParsePosition?this.nextParsePosition:0,this.sidx&&this.onSidx&&!this.sidxSent&&(this.onSidx(this.sidx),this.sidxSent=!0),this.meta&&(this.flattenItemInfo&&!this.itemListBuilt&&(this.flattenItemInfo(),this.itemListBuilt=!0),this.processItems&&this.processItems(this.onItem)),this.stream.cleanBuffers&&(o.info("ISOFile","Done processing buffer (fileStart: "+e.fileStart+") - next buffer to fetch should have a fileStart position of "+i),this.stream.logBufferLevel(),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0),o.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize())),i},y.prototype.getInfo=function(){var e,t,i,r,a,n,o={},s=new Date("1904-01-01T00:00:00Z").getTime();if(this.moov)for(o.hasMoov=!0,o.duration=this.moov.mvhd.duration,o.timescale=this.moov.mvhd.timescale,o.isFragmented=null!=this.moov.mvex,o.isFragmented&&this.moov.mvex.mehd&&(o.fragment_duration=this.moov.mvex.mehd.fragment_duration),o.isProgressive=this.isProgressive,o.hasIOD=null!=this.moov.iods,o.brands=[],o.brands.push(this.ftyp.major_brand),o.brands=o.brands.concat(this.ftyp.compatible_brands),o.created=new Date(s+1e3*this.moov.mvhd.creation_time),o.modified=new Date(s+1e3*this.moov.mvhd.modification_time),o.tracks=[],o.audioTracks=[],o.videoTracks=[],o.subtitleTracks=[],o.metadataTracks=[],o.hintTracks=[],o.otherTracks=[],e=0;e0?o.mime+='video/mp4; codecs="':o.audioTracks&&o.audioTracks.length>0?o.mime+='audio/mp4; codecs="':o.mime+='application/mp4; codecs="',e=0;e=i.samples.length)&&(o.info("ISOFile","Sending fragmented data on track #"+r.id+" for samples ["+Math.max(0,i.nextSample-r.nb_samples)+","+(i.nextSample-1)+"]"),o.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize()),this.onSegment&&this.onSegment(r.id,r.user,r.segmentStream.buffer,i.nextSample,e||i.nextSample>=i.samples.length),r.segmentStream=null,r!==this.fragmentedTracks[t]))break}}if(null!==this.onSamples)for(t=0;t=i.samples.length)&&(o.debug("ISOFile","Sending samples on track #"+n.id+" for sample "+i.nextSample),this.onSamples&&this.onSamples(n.id,n.user,n.samples),n.samples=[],n!==this.extractedTracks[t]))break}}}},y.prototype.getBox=function(e){var t=this.getBoxes(e,!0);return t.length?t[0]:null},y.prototype.getBoxes=function(e,t){var i=[];return y._sweep.call(this,e,i,t),i},y._sweep=function(e,t,i){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&i)return;y._sweep.call(this.boxes[r],e,t,i)}},y.prototype.getTrackSamplesInfo=function(e){var t=this.getTrackById(e);return t?t.samples:void 0},y.prototype.getTrackSample=function(e,t){var i=this.getTrackById(e);return this.getSample(i,t)},y.prototype.releaseUsedSamples=function(e,t){var i=0,r=this.getTrackById(e);r.lastValidSample||(r.lastValidSample=0);for(var a=r.lastValidSample;ae*a.timescale){c=r-1;break}t&&a.is_sync&&(l=r)}for(t&&(c=l),e=i.samples[c].cts,i.nextSample=c;i.samples[c].alreadyRead===i.samples[c].size&&i.samples[c+1];)c++;return n=i.samples[c].offset+i.samples[c].alreadyRead,o.info("ISOFile","Seeking to "+(t?"RAP":"")+" sample #"+i.nextSample+" on track "+i.tkhd.track_id+", time "+o.getDurationString(e,s)+" and offset: "+n),{offset:n,time:e/s}},y.prototype.getTrackDuration=function(e){var t;return e.samples?((t=e.samples[e.samples.length-1]).cts+t.duration)/t.timescale:1/0},y.prototype.seek=function(e,t){var i,r,a,n=this.moov,s={offset:1/0,time:1/0};if(this.moov){for(a=0;athis.getTrackDuration(i)||((r=this.seekTrack(e,t,i)).offset-1){o=l;break}switch(o){case"Visual":if(a.add("vmhd").set("graphicsmode",0).set("opcolor",[0,0,0]),n.set("width",t.width).set("height",t.height).set("horizresolution",72<<16).set("vertresolution",72<<16).set("frame_count",1).set("compressorname",t.type+" Compressor").set("depth",24),t.avcDecoderConfigRecord){var d=new h.avcCBox;d.parse(new s(t.avcDecoderConfigRecord)),n.addBox(d)}else if(t.hevcDecoderConfigRecord){var p=new h.hvcCBox;p.parse(new s(t.hevcDecoderConfigRecord)),n.addBox(p)}break;case"Audio":a.add("smhd").set("balance",t.balance||0),n.set("channel_count",t.channel_count||2).set("samplesize",t.samplesize||16).set("samplerate",t.samplerate||65536);break;case"Hint":a.add("hmhd");break;case"Subtitle":a.add("sthd"),"stpp"===t.type&&n.set("namespace",t.namespace||"nonamespace").set("schema_location",t.schema_location||"").set("auxiliary_mime_types",t.auxiliary_mime_types||"");break;default:a.add("nmhd")}t.description&&n.addBox(t.description),t.description_boxes&&t.description_boxes.forEach((function(e){n.addBox(e)})),a.add("dinf").add("dref").addEntry((new h["url Box"]).set("flags",1));var f=a.add("stbl");return f.add("stsd").addEntry(n),f.add("stts").set("sample_counts",[]).set("sample_deltas",[]),f.add("stsc").set("first_chunk",[]).set("samples_per_chunk",[]).set("sample_description_index",[]),f.add("stco").set("chunk_offsets",[]),f.add("stsz").set("sample_sizes",[]),this.moov.mvex.add("trex").set("track_id",t.id).set("default_sample_description_index",t.default_sample_description_index||1).set("default_sample_duration",t.default_sample_duration||0).set("default_sample_size",t.default_sample_size||0).set("default_sample_flags",t.default_sample_flags||0),this.buildTrakSampleLists(i),t.id}},h.Box.prototype.computeSize=function(e){var t=e||new l;t.endianness=l.BIG_ENDIAN,this.write(t)},y.prototype.addSample=function(e,t,i){var r=i||{},a={},n=this.getTrackById(e);if(null!==n){a.number=n.samples.length,a.track_id=n.tkhd.track_id,a.timescale=n.mdia.mdhd.timescale,a.description_index=r.sample_description_index?r.sample_description_index-1:0,a.description=n.mdia.minf.stbl.stsd.entries[a.description_index],a.data=t,a.size=t.byteLength,a.alreadyRead=a.size,a.duration=r.duration||1,a.cts=r.cts||0,a.dts=r.dts||0,a.is_sync=r.is_sync||!1,a.is_leading=r.is_leading||0,a.depends_on=r.depends_on||0,a.is_depended_on=r.is_depended_on||0,a.has_redundancy=r.has_redundancy||0,a.degradation_priority=r.degradation_priority||0,a.offset=0,a.subsamples=r.subsamples,n.samples.push(a),n.samples_size+=a.size,n.samples_duration+=a.duration,void 0===n.first_dts&&(n.first_dts=r.dts),this.processSamples();var o=this.createSingleSampleMoof(a);return this.addBox(o),o.computeSize(),o.trafs[0].truns[0].data_offset=o.size+8,this.add("mdat").data=new Uint8Array(t),a}},y.prototype.createSingleSampleMoof=function(e){var t=0;t=e.is_sync?1<<25:65536;var i=new h.moofBox;i.add("mfhd").set("sequence_number",this.nextMoofNumber),this.nextMoofNumber++;var r=i.add("traf"),a=this.getTrackById(e.track_id);return r.add("tfhd").set("track_id",e.track_id).set("flags",h.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),r.add("tfdt").set("baseMediaDecodeTime",e.dts-(a.first_dts||0)),r.add("trun").set("flags",h.TRUN_FLAGS_DATA_OFFSET|h.TRUN_FLAGS_DURATION|h.TRUN_FLAGS_SIZE|h.TRUN_FLAGS_FLAGS|h.TRUN_FLAGS_CTS_OFFSET).set("data_offset",0).set("first_sample_flags",0).set("sample_count",1).set("sample_duration",[e.duration]).set("sample_size",[e.size]).set("sample_flags",[t]).set("sample_composition_time_offset",[e.cts-e.dts]),i},y.prototype.lastMoofIndex=0,y.prototype.samplesDataSize=0,y.prototype.resetTables=function(){var e,t,i,r,a,n;for(this.initial_duration=this.moov.mvhd.duration,this.moov.mvhd.duration=0,e=0;e=2&&(l=a[o].grouping_type+"/0",(s=new c(a[o].grouping_type,0)).is_fragment=!0,t.sample_groups_info[l]||(t.sample_groups_info[l]=s))}else for(o=0;o=2&&(l=r[o].grouping_type+"/0",s=new c(r[o].grouping_type,0),e.sample_groups_info[l]||(e.sample_groups_info[l]=s))},y.setSampleGroupProperties=function(e,t,i,r){var a,n;for(a in t.sample_groups=[],r){var o;t.sample_groups[a]={},t.sample_groups[a].grouping_type=r[a].grouping_type,t.sample_groups[a].grouping_type_parameter=r[a].grouping_type_parameter,i>=r[a].last_sample_in_run&&(r[a].last_sample_in_run<0&&(r[a].last_sample_in_run=0),r[a].entry_index++,r[a].entry_index<=r[a].sbgp.entries.length-1&&(r[a].last_sample_in_run+=r[a].sbgp.entries[r[a].entry_index].sample_count)),r[a].entry_index<=r[a].sbgp.entries.length-1?t.sample_groups[a].group_description_index=r[a].sbgp.entries[r[a].entry_index].group_description_index:t.sample_groups[a].group_description_index=-1,0!==t.sample_groups[a].group_description_index&&(o=r[a].fragment_description?r[a].fragment_description:r[a].description,t.sample_groups[a].group_description_index>0?(n=t.sample_groups[a].group_description_index>65535?(t.sample_groups[a].group_description_index>>16)-1:t.sample_groups[a].group_description_index-1,o&&n>=0&&(t.sample_groups[a].description=o.entries[n])):o&&o.version>=2&&o.default_group_description_index>0&&(t.sample_groups[a].description=o.entries[o.default_group_description_index-1]))}},y.process_sdtp=function(e,t,i){t&&(e?(t.is_leading=e.is_leading[i],t.depends_on=e.sample_depends_on[i],t.is_depended_on=e.sample_is_depended_on[i],t.has_redundancy=e.sample_has_redundancy[i]):(t.is_leading=0,t.depends_on=0,t.is_depended_on=0,t.has_redundancy=0))},y.prototype.buildSampleLists=function(){var e,t;for(e=0;eA&&(b++,A<0&&(A=0),A+=n.sample_counts[b]),t>0?(e.samples[t-1].duration=n.sample_deltas[b],e.samples_duration+=e.samples[t-1].duration,E.dts=e.samples[t-1].dts+e.samples[t-1].duration):E.dts=0,o?(t>=_&&(k++,_<0&&(_=0),_+=o.sample_counts[k]),E.cts=e.samples[t].dts+o.sample_offsets[k]):E.cts=E.dts,s?(t==s.sample_numbers[w]-1?(E.is_sync=!0,w++):(E.is_sync=!1,E.degradation_priority=0),c&&c.entries[S].sample_delta+T==t+1&&(E.subsamples=c.entries[S].subsamples,T+=c.entries[S].sample_delta,S++)):E.is_sync=!0,y.process_sdtp(e.mdia.minf.stbl.sdtp,E,E.number),E.degradation_priority=h?h.priority[t]:0,c&&c.entries[S].sample_delta+T==t&&(E.subsamples=c.entries[S].subsamples,T+=c.entries[S].sample_delta),(u.length>0||d.length>0)&&y.setSampleGroupProperties(e,E,t,e.sample_groups_info)}t>0&&(e.samples[t-1].duration=Math.max(e.mdia.mdhd.duration-e.samples[t-1].dts,0),e.samples_duration+=e.samples[t-1].duration)}},y.prototype.updateSampleLists=function(){var e,t,i,r,a,n,o,s,l,c,u,d,p,f,m;if(void 0!==this.moov)for(;this.lastMoofIndex0&&y.initSampleGroups(d,u,u.sbgps,d.mdia.minf.stbl.sgpds,u.sgpds),t=0;t0?f.dts=d.samples[d.samples.length-2].dts+d.samples[d.samples.length-2].duration:(u.tfdt?f.dts=u.tfdt.baseMediaDecodeTime:f.dts=0,d.first_traf_merged=!0),f.cts=f.dts,g.flags&h.TRUN_FLAGS_CTS_OFFSET&&(f.cts=f.dts+g.sample_composition_time_offset[i]),m=o,g.flags&h.TRUN_FLAGS_FLAGS?m=g.sample_flags[i]:0===i&&g.flags&h.TRUN_FLAGS_FIRST_FLAG&&(m=g.first_sample_flags),f.is_sync=!(m>>16&1),f.is_leading=m>>26&3,f.depends_on=m>>24&3,f.is_depended_on=m>>22&3,f.has_redundancy=m>>20&3,f.degradation_priority=65535&m;var v=!!(u.tfhd.flags&h.TFHD_FLAG_BASE_DATA_OFFSET),A=!!(u.tfhd.flags&h.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),b=!!(g.flags&h.TRUN_FLAGS_DATA_OFFSET),_=0;_=v?u.tfhd.base_data_offset:A||0===t?c.start:s,f.offset=0===t&&0===i?b?_+g.data_offset:_:s,s=f.offset+f.size,(u.sbgps.length>0||u.sgpds.length>0||d.mdia.minf.stbl.sbgps.length>0||d.mdia.minf.stbl.sgpds.length>0)&&y.setSampleGroupProperties(d,f,f.number_in_traf,u.sample_groups_info)}}if(u.subs){d.has_fragment_subsamples=!0;var k=u.first_sample_index;for(t=0;t-1))return null;var n=(i=this.stream.buffers[a]).byteLength-(r.offset+r.alreadyRead-i.fileStart);if(r.size-r.alreadyRead<=n)return o.debug("ISOFile","Getting sample #"+t+" data (alreadyRead: "+r.alreadyRead+" offset: "+(r.offset+r.alreadyRead-i.fileStart)+" read size: "+(r.size-r.alreadyRead)+" full size: "+r.size+")"),l.memcpy(r.data.buffer,r.alreadyRead,i,r.offset+r.alreadyRead-i.fileStart,r.size-r.alreadyRead),i.usedBytes+=r.size-r.alreadyRead,this.stream.logBufferLevel(),r.alreadyRead=r.size,r;if(0===n)return null;o.debug("ISOFile","Getting sample #"+t+" partial data (alreadyRead: "+r.alreadyRead+" offset: "+(r.offset+r.alreadyRead-i.fileStart)+" read size: "+n+" full size: "+r.size+")"),l.memcpy(r.data.buffer,r.alreadyRead,i,r.offset+r.alreadyRead-i.fileStart,n),r.alreadyRead+=n,i.usedBytes+=n,this.stream.logBufferLevel()}},y.prototype.releaseSample=function(e,t){var i=e.samples[t];return i.data?(this.samplesDataSize-=i.size,i.data=null,i.alreadyRead=0,i.size):0},y.prototype.getAllocatedSampleDataSize=function(){return this.samplesDataSize},y.prototype.getCodecs=function(){var e,t="";for(e=0;e0&&(t+=","),t+=this.moov.traks[e].mdia.minf.stbl.stsd.entries[0].getCodec();return t},y.prototype.getTrexById=function(e){var t;if(!this.moov||!this.moov.mvex)return null;for(t=0;t0&&(i.protection=n.ipro.protections[n.iinf.item_infos[e].protection_index-1]),n.iinf.item_infos[e].item_type?i.type=n.iinf.item_infos[e].item_type:i.type="mime",i.content_type=n.iinf.item_infos[e].content_type,i.content_encoding=n.iinf.item_infos[e].content_encoding;if(n.grpl)for(e=0;e0&&h.property_index-1-1))return null;var s=(t=this.stream.buffers[n]).byteLength-(a.offset+a.alreadyRead-t.fileStart);if(!(a.length-a.alreadyRead<=s))return o.debug("ISOFile","Getting item #"+e+" extent #"+r+" partial data (alreadyRead: "+a.alreadyRead+" offset: "+(a.offset+a.alreadyRead-t.fileStart)+" read size: "+s+" full extent size: "+a.length+" full item size: "+i.size+")"),l.memcpy(i.data.buffer,i.alreadyRead,t,a.offset+a.alreadyRead-t.fileStart,s),a.alreadyRead+=s,i.alreadyRead+=s,t.usedBytes+=s,this.stream.logBufferLevel(),null;o.debug("ISOFile","Getting item #"+e+" extent #"+r+" data (alreadyRead: "+a.alreadyRead+" offset: "+(a.offset+a.alreadyRead-t.fileStart)+" read size: "+(a.length-a.alreadyRead)+" full extent size: "+a.length+" full item size: "+i.size+")"),l.memcpy(i.data.buffer,i.alreadyRead,t,a.offset+a.alreadyRead-t.fileStart,a.length-a.alreadyRead),t.usedBytes+=a.length-a.alreadyRead,this.stream.logBufferLevel(),i.alreadyRead+=a.length-a.alreadyRead,a.alreadyRead=a.length}}return i.alreadyRead===i.size?i:null},y.prototype.releaseItem=function(e){var t=this.items[e];if(t.data){this.itemsDataSize-=t.size,t.data=null,t.alreadyRead=0;for(var i=0;i0?this.moov.traks[e].samples[0].duration:0),t.push(r)}return t},h.Box.prototype.printHeader=function(e){this.size+=8,this.size>c&&(this.size+=8),"uuid"===this.type&&(this.size+=16),e.log(e.indent+"size:"+this.size),e.log(e.indent+"type:"+this.type)},h.FullBox.prototype.printHeader=function(e){this.size+=4,h.Box.prototype.printHeader.call(this,e),e.log(e.indent+"version:"+this.version),e.log(e.indent+"flags:"+this.flags)},h.Box.prototype.print=function(e){this.printHeader(e)},h.ContainerBox.prototype.print=function(e){this.printHeader(e);for(var t=0;t>8)),e.log(e.indent+"matrix: "+this.matrix.join(", ")),e.log(e.indent+"next_track_id: "+this.next_track_id)},h.tkhdBox.prototype.print=function(e){h.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+"creation_time: "+this.creation_time),e.log(e.indent+"modification_time: "+this.modification_time),e.log(e.indent+"track_id: "+this.track_id),e.log(e.indent+"duration: "+this.duration),e.log(e.indent+"volume: "+(this.volume>>8)),e.log(e.indent+"matrix: "+this.matrix.join(", ")),e.log(e.indent+"layer: "+this.layer),e.log(e.indent+"alternate_group: "+this.alternate_group),e.log(e.indent+"width: "+this.width),e.log(e.indent+"height: "+this.height)};var v={createFile:function(e,t){var i=void 0===e||e,r=new y(t);return r.discardMdatData=!i,r}};t.createFile=v.createFile}));function yu(e){return e.reduce((function(e,t){return 256*e+t}))}function vu(e){var t=[101,103,119,99],i=e.length-28,r=e.slice(i,i+t.length);return t.every((function(e,t){return e===r[t]}))}gu.Log,gu.MP4BoxStream,gu.DataStream,gu.MultiBufferStream,gu.MPEG4DescriptorParser,gu.BoxParser,gu.XMLSubtitlein4Parser,gu.Textin4Parser,gu.ISOFile,gu.createFile;var Au=function(){function e(){S(this,e),this.s=null,this.a=null,this.l=0,this.c=0,this.u=1/0,this.A=!1,this.d=!1,this.r=4194304,this.n=new Uint8Array([30,158,90,33,244,57,83,165,2,70,35,87,215,231,226,108]),this.t=this.n.slice().reverse()}return T(e,[{key:"destroy",value:function(){this.s=null,this.a=null,this.l=0,this.c=0,this.u=1/0,this.A=!1,this.d=!1,this.r=4194304,this.n=null,this.t=null}},{key:"transport",value:function(e){var t=this;if(!this.s&&this.l>50)return e;if(this.l++,this.d)return e;var i=new Uint8Array(e);if(this.A){if(!(this.c=e[a]&&t=6?(a=5,i=new Array(4),s=n-3):(a=2,i=new Array(2),s=n):-1!==l.indexOf("android")?(a=2,i=new Array(2),s=n):(a=5,s=n,i=new Array(4),n>=6?s=n-3:1===o&&(a=2,i=new Array(2),s=n)),i[0]=a<<3,i[0]|=(15&n)>>>1,i[1]=(15&n)<<7,i[1]|=(15&o)<<3,5===a&&(i[1]|=(15&s)>>>1,i[2]=(1&s)<<7,i[2]|=8,i[3]=0),this.config=i,this.sampling_rate=Fu[n],this.sampling_index=n,this.channel_count=o,this.object_type=a,this.original_object_type=r,this.codec_mimetype="mp4a.40."+a,this.original_codec_mimetype="mp4a.40."+r})),ju=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.player=e,i.TAG_NAME="TsLoaderV2",i.first_parse_=!0,i.tsPacketSize=0,i.syncOffset=0,i.pmt_=null,i.config_=null,i.media_info_=new Ou,i.timescale_=90,i.duration_=0,i.pat_={version_number:0,network_pid:0,program_map_pid:{}},i.current_program_=null,i.current_pmt_pid_=-1,i.program_pmt_map_={},i.pes_slice_queues_={},i.section_slice_queues_={},i.video_metadata_={vps:null,sps:null,pps:null,details:null},i.audio_metadata_={codec:null,audio_object_type:null,sampling_freq_index:null,sampling_frequency:null,channel_config:null},i.last_pcr_=null,i.audio_last_sample_pts_=void 0,i.aac_last_incomplete_data_=null,i.has_video_=!1,i.has_audio_=!1,i.video_init_segment_dispatched_=!1,i.audio_init_segment_dispatched_=!1,i.video_metadata_changed_=!1,i.audio_metadata_changed_=!1,i.loas_previous_frame=null,i.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},i.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},i._remainingPacketData=null,i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.media_info_=null,this.pes_slice_queues_=null,this.section_slice_queues_=null,this.video_metadata_=null,this.audio_metadata_=null,this.aac_last_incomplete_data_=null,this.video_track_=null,this.audio_track_=null,this._remainingPacketData=null,b(t,"destroy",this,3)([])}},{key:"probe",value:function(e){var t=new Uint8Array(e),i=-1,r=188;if(t.byteLength<=3*r)return{needMoreData:!0};for(;-1===i;){for(var a=Math.min(1e3,t.byteLength-3*r),n=0;n=4&&(i-=4),{match:!0,consumed:0,ts_packet_size:r,sync_offset:i})}},{key:"_initPmt",value:function(){return{program_number:0,version_number:0,pcr_pid:0,pid_stream_type:{},common_pids:{h264:void 0,h265:void 0,adts_aac:void 0,loas_aac:void 0,opus:void 0,ac3:void 0,eac3:void 0,mp3:void 0},pes_private_data_pids:{},timed_id3_pids:{},synchronous_klv_pids:{},asynchronous_klv_pids:{},scte_35_pids:{},smpte2038_pids:{}}}},{key:"dispatch",value:function(e){var t=new Uint8Array(e);this._remainingPacketData&&(t=ku(this._remainingPacketData,t),this._remainingPacketData=null);var i=t.buffer,r=this.parseChunks(i);r?this._remainingPacketData=t.subarray(r):t.length>>6;r[1];var o=(31&r[1])<<8|r[2],s=(48&r[3])>>>4,l=15&r[3],c=!(!this.pmt_||this.pmt_.pcr_pid!==o),u={},d=4;if(2==s||3==s){var h=r[4];if(h>0&&(c||3==s)&&(u.discontinuity_indicator=(128&r[5])>>>7,u.random_access_indicator=(64&r[5])>>>6,u.elementary_stream_priority_indicator=(32&r[5])>>>5,(16&r[5])>>>4)){var p=300*(r[6]<<25|r[7]<<17|r[8]<<9|r[9]<<1|r[10]>>>7)+((1&r[10])<<8|r[11]);this.last_pcr_=p}if(2==s||5+h===188){t+=188,204===this.tsPacketSize&&(t+=16);continue}d=5+h}if(1==s||3==s)if(0===o||o===this.current_pmt_pid_||null!=this.pmt_&&this.pmt_.pid_stream_type[o]===Lu){var f=188-d;this.handleSectionSlice(e,t+d,f,{pid:o,payload_unit_start_indicator:n,continuity_conunter:l,random_access_indicator:u.random_access_indicator})}else if(null!=this.pmt_&&null!=this.pmt_.pid_stream_type[o]){var m=188-d,g=this.pmt_.pid_stream_type[o];o!==this.pmt_.common_pids.h264&&o!==this.pmt_.common_pids.h265&&o!==this.pmt_.common_pids.adts_aac&&o!==this.pmt_.common_pids.loas_aac&&o!==this.pmt_.common_pids.ac3&&o!==this.pmt_.common_pids.eac3&&o!==this.pmt_.common_pids.opus&&o!==this.pmt_.common_pids.mp3&&!0!==this.pmt_.pes_private_data_pids[o]&&!0!==this.pmt_.timed_id3_pids[o]&&!0!==this.pmt_.synchronous_klv_pids[o]&&!0!==this.pmt_.asynchronous_klv_pids[o]||this.handlePESSlice(e,t+d,m,{pid:o,stream_type:g,payload_unit_start_indicator:n,continuity_conunter:l,random_access_indicator:u.random_access_indicator})}t+=188,204===this.tsPacketSize&&(t+=16)}return this.dispatchAudioVideoMediaSegment(),t}},{key:"handleSectionSlice",value:function(e,t,i,r){var a=new Uint8Array(e,t,i),n=this.section_slice_queues_[r.pid];if(r.payload_unit_start_indicator){var o=a[0];if(null!=n&&0!==n.total_length){var s=new Uint8Array(e,t+1,Math.min(i,o));n.slices.push(s),n.total_length+=s.byteLength,n.total_length===n.expected_length?this.emitSectionSlices(n,r):this.clearSlices(n,r)}for(var l=1+o;l=n.expected_length&&this.clearSlices(n,r),l+=u.byteLength}}else if(null!=n&&0!==n.total_length){var d=new Uint8Array(e,t,Math.min(i,n.expected_length-n.total_length));n.slices.push(d),n.total_length+=d.byteLength,n.total_length===n.expected_length?this.emitSectionSlices(n,r):n.total_length>=n.expected_length&&this.clearSlices(n,r)}}},{key:"handlePESSlice",value:function(e,t,i,r){var a=new Uint8Array(e,t,i),n=a[0]<<16|a[1]<<8|a[2];a[3];var o=a[4]<<8|a[5];if(r.payload_unit_start_indicator){if(1!==n)return void this.player.debug.warn(this.TAG_NAME,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(n));var s=this.pes_slice_queues_[r.pid];s&&(0===s.expected_length||s.expected_length===s.total_length?this.emitPESSlices(s,r):this.clearSlices(s,r)),this.pes_slice_queues_[r.pid]=new Bu,this.pes_slice_queues_[r.pid].random_access_indicator=r.random_access_indicator}if(null!=this.pes_slice_queues_[r.pid]){var l=this.pes_slice_queues_[r.pid];l.slices.push(a),r.payload_unit_start_indicator&&(l.expected_length=0===o?0:o+6),l.total_length+=a.byteLength,l.expected_length>0&&l.expected_length===l.total_length?this.emitPESSlices(l,r):l.expected_length>0&&l.expected_length>>6,l=t[8];2!==s&&3!==s||(n=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,o=3===s?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:n);var c,u=9+l;if(0!==a){if(a<3+l)return void this.player.debug.warn(this.TAG_NAME,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");c=a-3-l}else c=t.byteLength-u;var d=t.subarray(u,u+c);switch(e.stream_type){case wu:case Su:this.parseMP3Payload(d,n);break;case Tu:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(d,n):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(d,n):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(d,n):this.pmt_.asynchronous_klv_pids[e.pid]?this.parseAsynchronousKLVMetadataPayload(d,e.pid,r):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(d,n,o,e.pid,r):this.parsePESPrivateDataPayload(d,n,o,e.pid,r);break;case Eu:this.parseADTSAACPayload(d,n);break;case Cu:this.parseLOASAACPayload(d,n);break;case xu:this.parseAC3Payload(d,n);break;case Ru:this.parseEAC3Payload(d,n);break;case Du:this.pmt_.timed_id3_pids[e.pid]?this.parseTimedID3MetadataPayload(d,n,o,e.pid,r):this.pmt_.synchronous_klv_pids[e.pid]&&this.parseSynchronousKLVMetadataPayload(d,n,o,e.pid,r);break;case Iu:this.parseH264Payload(d,n,o,e.random_access_indicator);break;case Pu:this.parseH265Payload(d,n,o,e.random_access_indicator)}}else if((188===r||191===r||240===r||241===r||255===r||242===r||248===r)&&e.stream_type===Tu){var h,p=6;h=0!==a?a:t.byteLength-p;var f=t.subarray(p,p+h);this.parsePESPrivateDataPayload(f,void 0,void 0,e.pid,r)}}else this.player.debug.error(this.TAG_NAME,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))}},{key:"parsePAT",value:function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2];e[3],e[4];var r=(62&e[5])>>>1,a=1&e[5],n=e[6];e[7];var o=null;if(1===a&&0===n)o={version_number:0,network_pid:0,program_pmt_pid:{}},o.version_number=r;else if(o=this.pat_,null==o)return;for(var s=i-5-4,l=-1,c=-1,u=8;u<8+s;u+=4){var d=e[u]<<8|e[u+1],h=(31&e[u+2])<<8|e[u+3];0===d?o.network_pid=h:(o.program_pmt_pid[d]=h,-1===l&&(l=d),-1===c&&(c=h))}1===a&&0===n&&(null==this.pat_&&this.player.debug.log(this.TAG_NAME,"Parsed first PAT: ".concat(JSON.stringify(o))),this.pat_=o,this.current_program_=l,this.current_pmt_pid_=c)}else Log.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))}},{key:"parsePMT",value:function(e){var t=e[0];if(2===t){var i,r=(15&e[1])<<8|e[2],a=e[3]<<8|e[4],n=(62&e[5])>>>1,o=1&e[5],s=e[6];if(e[7],1===o&&0===s)i=this._initPmt(),i.program_number=a,i.version_number=n,this.program_pmt_map_[a]=i;else if(i=this.program_pmt_map_[a],null==i)return;i.pcr_pid=(31&e[8])<<8|e[9];for(var l=(15&e[10])<<8|e[11],c=12+l,u=r-9-l-4,d=c;d0){for(var v=d+5;v0)for(var E=d+5;E1&&(this.player.debug.warn(this.TAG_NAME,"AAC: Detected pts overlapped, expected: ".concat(n,"ms, PES pts: ").concat(a,"ms")),a=n)}}for(var o,s=new wn(e),l=null,c=a;null!=(l=s.readNextAACFrame());){r=1024/l.sampling_frequency*1e3;var u={codec:"aac",data:l};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(u)):this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)),o=c;var d=Math.floor(c),h=new Uint8Array(l.data.length+2);h.set([175,1],0),h.set(l.data,2);var p={payload:h,length:h.byteLength,pts:d,dts:d,type:ot};this.audio_track_.samples.push(p),this.audio_track_.length+=h.byteLength,c+=r}s.hasIncompleteData()&&(this.aac_last_incomplete_data_=s.getIncompleteData()),o&&(this.audio_last_sample_pts_=o)}}},{key:"parseLOASAACPayload",value:function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var i=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);i.set(this.aac_last_incomplete_data_,0),i.set(e,this.aac_last_incomplete_data_.byteLength),e=i}var r,a;if(null!=t&&(a=t/this.timescale_),"aac"===this.audio_metadata_.codec){if(null==t&&null!=this.audio_last_sample_pts_)r=1024/this.audio_metadata_.sampling_frequency*1e3,a=this.audio_last_sample_pts_+r;else if(null==t)return void this.player.debug.warn(this.TAG_NAME,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.audio_last_sample_pts_){r=1024/this.audio_metadata_.sampling_frequency*1e3;var n=this.audio_last_sample_pts_+r;Math.abs(n-a)>1&&(this.player.debug.warn(this.TAG,"AAC: Detected pts overlapped, expected: ".concat(n,"ms, PES pts: ").concat(a,"ms")),a=n)}}for(var o,s=new Sn(e),l=null,c=a;null!=(l=s.readNextAACFrame(ro(this.loas_previous_frame)?void 0:this.loas_previous_frame));){this.loas_previous_frame=l,r=1024/l.sampling_frequency*1e3;var u={codec:"aac",data:l};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"aac",audio_object_type:l.audio_object_type,sampling_freq_index:l.sampling_freq_index,sampling_frequency:l.sampling_frequency,channel_config:l.channel_config},this.dispatchAudioInitSegment(u)):this.detectAudioMetadataChange(u)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(u)),o=c;var d=Math.floor(c),h=new Uint8Array(l.data.length+2);h.set([175,1],0),h.set(l.data,2);var p={payload:h,length:h.byteLength,pts:d,dts:d,type:ot};this.audio_track_.samples.push(p),this.audio_track_.length+=h.byteLength,c+=r}s.hasIncompleteData()&&(this.aac_last_incomplete_data_=s.getIncompleteData()),o&&(this.audio_last_sample_pts_=o)}}},{key:"parseAC3Payload",value:function(e,t){}},{key:"parseEAC3Payload",value:function(e,t){}},{key:"parseOpusPayload",value:function(e,t){}},{key:"parseMP3Payload",value:function(e,t){if(!this.has_video_||this.video_init_segment_dispatched_){var i=[44100,48e3,32e3,0],r=[22050,24e3,16e3,0],a=[11025,12e3,8e3,0],n=e[1]>>>3&3,o=(6&e[1])>>1;e[2];var s=(12&e[2])>>>2,l=3!==(e[3]>>>6&3)?2:1,c=0,u=34;switch(n){case 0:c=a[s];break;case 2:c=r[s];break;case 3:c=i[s]}switch(o){case 1:u=34;break;case 2:u=33;break;case 3:u=32}var d={};d.object_type=u,d.sample_rate=c,d.channel_count=l,d.data=e;var h={codec:"mp3",data:d};0==this.audio_init_segment_dispatched_?(this.audio_metadata_={codec:"mp3",object_type:u,sample_rate:c,channel_count:l},this.dispatchAudioInitSegment(h)):this.detectAudioMetadataChange(h)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(h));var p={payload:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_,type:ot};this.audio_track_.samples.push(p),this.audio_track_.length+=e.byteLength}}},{key:"detectAudioMetadataChange",value:function(e){if(e.codec!==this.audio_metadata_.codec)return this.player.debug.log(this.TAG_NAME,"Audio: Audio Codecs changed from ".concat(this.audio_metadata_.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){var t=e.data;if(t.audio_object_type!==this.audio_metadata_.audio_object_type)return this.player.debug.log(this.TAG_NAME,"AAC: AudioObjectType changed from ".concat(this.audio_metadata_.audio_object_type," to ").concat(t.audio_object_type)),!0;if(t.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return this.player.debug.log(this.TAG_NAME,"AAC: SamplingFrequencyIndex changed from ".concat(this.audio_metadata_.sampling_freq_index," to ").concat(t.sampling_freq_index)),!0;if(t.channel_config!==this.audio_metadata_.channel_config)return this.player.debug.log(this.TAG_NAME,"AAC: Channel configuration changed from ".concat(this.audio_metadata_.channel_config," to ").concat(t.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var i=e.data;if(i.sampling_frequency!==this.audio_metadata_.sampling_frequency)return this.player.debug.log(this.TAG_NAME,"AC3: Sampling Frequency changed from ".concat(this.audio_metadata_.sampling_frequency," to ").concat(i.sampling_frequency)),!0;if(i.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return this.player.debug.log(this.TAG_NAME,"AC3: Bit Stream Identification changed from ".concat(this.audio_metadata_.bit_stream_identification," to ").concat(i.bit_stream_identification)),!0;if(i.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return this.player.debug.log(this.TAG_NAME,"AC3: BitStream Mode changed from ".concat(this.audio_metadata_.bit_stream_mode," to ").concat(i.bit_stream_mode)),!0;if(i.channel_mode!==this.audio_metadata_.channel_mode)return this.player.debug.log(this.TAG_NAME,"AC3: Channel Mode changed from ".concat(this.audio_metadata_.channel_mode," to ").concat(i.channel_mode)),!0;if(i.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return this.player.debug.log(this.TAG_NAME,"AC3: Low Frequency Effects Channel On changed from ".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(i.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){var r=e.meta;if(r.sample_rate!==this.audio_metadata_.sample_rate)return this.player.debug.log(this.TAG_NAME,"Opus: SamplingFrequencyIndex changed from ".concat(this.audio_metadata_.sample_rate," to ").concat(r.sample_rate)),!0;if(r.channel_count!==this.audio_metadata_.channel_count)return this.player.debug.log(this.TAG_NAME,"Opus: Channel count changed from ".concat(this.audio_metadata_.channel_count," to ").concat(r.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var a=e.data;if(a.object_type!==this.audio_metadata_.object_type)return this.player.debug.log(this.TAG_NAME,"MP3: AudioObjectType changed from ".concat(this.audio_metadata_.object_type," to ").concat(a.object_type)),!0;if(a.sample_rate!==this.audio_metadata_.sample_rate)return this.player.debug.log(this.TAG_NAME,"MP3: SamplingFrequencyIndex changed from ".concat(this.audio_metadata_.sample_rate," to ").concat(a.sample_rate)),!0;if(a.channel_count!==this.audio_metadata_.channel_count)return this.player.debug.log(this.TAG_NAME,"MP3: Channel count changed from ".concat(this.audio_metadata_.channel_count," to ").concat(a.channel_count)),!0}return!1}},{key:"dispatchAudioInitSegment",value:function(e){var t={type:"audio"};t.id=this.audio_track_.id,t.timescale=1e3,t.duration=this.duration_;var i="";if("aac"===this.audio_metadata_.codec){var r="aac"===e.codec?e.data:null,a=new Nu(r);t.audioSampleRate=a.sampling_rate,t.audioSampleRateIndex=a.sampling_index,t.channelCount=a.channel_count,t.codec=a.codec_mimetype,t.originalCodec=a.original_codec_mimetype,t.config=a.config,t.refSampleDuration=1024/t.audioSampleRate*t.timescale,i=Vt;var n=hn({profile:this.player._opt.mseDecodeAudio?a.object_type:a.original_object_type,sampleRate:t.audioSampleRateIndex,channel:t.channelCount});console.error("aacADTSHeader","profile: ".concat(a.object_type,", sampleRate: ").concat(t.audioSampleRateIndex,", channel: ").concat(t.channelCount)),this._doDecodeByTs(n,ot,0,!1,0)}else"ac-3"===this.audio_metadata_.codec||"ec-3"===this.audio_metadata_.codec||"opus"===this.audio_metadata_.codec||"mp3"===this.audio_metadata_.codec&&(t.audioSampleRate=this.audio_metadata_.sample_rate,t.channelCount=this.audio_metadata_.channel_count,t.codec="mp3",t.originalCodec="mp3",t.config=void 0,i=Jt);0==this.audio_init_segment_dispatched_&&this.player.debug.log(this.TAG_NAME,"Generated first AudioSpecificConfig for mimeType: ".concat(t.codec)),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var o=this.media_info_;o.hasAudio=!0,o.audioCodec=t.originalCodec,o.audioSampleRate=t.audioSampleRate,o.audioChannelCount=t.channelCount,o.hasVideo&&o.videoCodec?o.mimeType='video/mp2t; codecs="'.concat(o.videoCodec,",").concat(o.audioCodec,'"'):o.mimeType='video/mp2t; codecs="'.concat(o.audioCodec,'"'),i&&this.player.audio.updateAudioInfo({encTypeCode:i,channels:t.channelCount,sampleRate:t.audioSampleRate})}},{key:"dispatchPESPrivateDataDescriptor",value:function(e,t,i){}},{key:"parsePESPrivateDataPayload",value:function(e,t,i,r,a){var n=new Uu;if(n.pid=r,n.stream_id=a,n.len=e.byteLength,n.data=e,null!=t){var o=Math.floor(t/this.timescale_);n.pts=o}else n.nearest_pts=this.getNearestTimestampMilliseconds();if(null!=i){var s=Math.floor(i/this.timescale_);n.dts=s}}},{key:"parseTimedID3MetadataPayload",value:function(e,t,i,r,a){this.player.debug.log(this.TAG_NAME,"Timed ID3 Metadata: pid=".concat(r,", pts=").concat(t,", dts=").concat(i,", stream_id=").concat(a))}},{key:"parseSynchronousKLVMetadataPayload",value:function(e,t,i,r,a){this.player.debug.log(this.TAG_NAME,"Synchronous KLV Metadata: pid=".concat(r,", pts=").concat(t,", dts=").concat(i,", stream_id=").concat(a))}},{key:"parseAsynchronousKLVMetadataPayload",value:function(e,t,i){this.player.debug.log(this.TAG_NAME,"Asynchronous KLV Metadata: pid=".concat(t,", stream_id=").concat(i))}},{key:"parseSMPTE2038MetadataPayload",value:function(e,t,i,r,a){this.player.debug.log(this.TAG_NAME,"SMPTE 2038 Metadata: pid=".concat(r,", pts=").concat(t,", dts=").concat(i,", stream_id=").concat(a))}},{key:"getNearestTimestampMilliseconds",value:function(){return null!=this.audio_last_sample_pts_?Math.floor(this.audio_last_sample_pts_):null!=this.last_pcr_?Math.floor(this.last_pcr_/300/this.timescale_):void 0}},{key:"_preDoDecode",value:function(){var e=this,t=this.video_track_,i=this.audio_track_,r=t.samples;i.samples.length>0&&(r=t.samples.concat(i.samples),r=r.sort((function(e,t){return e.dts-t.dts}))),r.forEach((function(t){var i=new Uint8Array(t.payload);delete t.payload,t.type===st?e._doDecodeVideo(w(w({},t),{},{payload:i})):t.type===ot&&e._doDecodeAudio(w(w({},t),{},{payload:i}))})),t.samples=[],t.length=0,i.samples=[],i.length=0}},{key:"_doDecodeVideo",value:function(e){var t=new Uint8Array(e.payload),i=null;i=e.isHevc?hl(t,e.isIFrame):Zs(t,e.isIFrame),this.player.updateStats({dts:e.dts,vbps:i.byteLength}),e.isIFrame&&this.calcIframeIntervalTimestamp(e.dts);var r=this.cryptoPayload(i,e.isIFrame);this._doDecodeByTs(r,st,e.dts,e.isIFrame,e.cts)}},{key:"_doDecodeAudio",value:function(e){var t=new Uint8Array(e.payload);this.player.updateStats({abps:t.byteLength});var i=t;Oo(this.player._opt.m7sCryptoAudio)&&(i=this.cryptoPayloadAudio(t)),this._doDecodeByTs(i,ot,e.dts,!1,0)}},{key:"getInputByteLength",value:function(){return this._remainingPacketData&&this._remainingPacketData.byteLength||0}}])}(iu),Gu=function(){function e(t){return S(this,e),new(e.getLoaderFactory(t))(t)}return T(e,null,[{key:"getLoaderFactory",value:function(e){var t=e._opt.demuxType;return t===q?uu:t===J||e.isWebrtcH265()?cu:t===Q?du:t===X?fu:t===Z?bu:t===$?_u:t===te?ju:mu}}])}(),zu=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.TAG_NAME="Webcodecs",i.hasInit=!1,i.isDecodeFirstIIframe=!!No(e._opt.checkFirstIFrame),i.isInitInfo=!1,i.prevTimestamp=null,i.decodeDiffTimestamp=null,i.prevDts=null,i.decoder=null,i.isWidthOrHeightChanged=!1,i.initDecoder(),e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.decoder&&(No(this.isDecodeStateClosed())&&this.decoder.close(),this.decoder=null),this.prevTimestamp=null,this.decodeDiffTimestamp=null,this.prevDts=null,this.hasInit=!1,this.isInitInfo=!1,this.isDecodeFirstIIframe=!1,this.isWidthOrHeightChanged=!1,this.off(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"initDecoder",value:function(){var e=this;this.decoder=new VideoDecoder({output:function(t){e.handleDecode(t)},error:function(t){e.handleError(t)}})}},{key:"handleDecode",value:function(e){this.isInitInfo||(this.player.video.updateVideoInfo({width:e.codedWidth,height:e.codedHeight}),this.player.video.initCanvasViewSize(),this.isInitInfo=!0),this.player.isPlayer()?(this.player.updateStats({dfps:!0}),this.player._times.videoStart||(this.player._times.videoStart=Ln(),this.player.handlePlayToRenderTimes()),this.player.video.render({videoFrame:e,ts:e.timestamp}),this.player.handleRender()):this.player.isPlayback()&&(this.player.updateStats({dfps:!0}),No(this.player.playbackPause)?(this.player.playback.isUseLocalCalculateTime&&this.player.playback.increaseLocalTimestamp(),this.player.playback.isUseFpsRender?this.player.video.pushData({videoFrame:e,ts:e.timestamp}):this.player.video.render$2({videoFrame:e,ts:e.timestamp})):No(this.player.playback.isPlaybackPauseClearCache)&&this.player.playback.isCacheBeforeDecodeForFpsRender&&this.player.playback.isUseFpsRender&&this.player.video.pushData({videoFrame:e,ts:e.timestamp}))}},{key:"handleError",value:function(e){this.player.debug.error(this.TAG_NAME,"VideoDecoder handleError:",e.code,e);var t=e.toString();-1!==t.indexOf(Rr)?this.player.emitError(It.webcodecsUnsupportedConfigurationError,t):-1!==t.indexOf(Dr)||-1!==t.indexOf(Lr)||-1!==t.indexOf(Ir)?this.player.emitError(It.webcodecsDecodeError,t):-1!==t.indexOf(Pr)&&this.player.emitError(It.webcodecsH265NotSupport)}},{key:"decodeVideo",value:function(e,t,i,r){if(this.player)if(this.player.isDestroyedOrClosed())this.player.debug.warn(this.TAG_NAME,"decodeVideo() player is destroyed");else if(this.hasInit)if(!this.isDecodeFirstIIframe&&i&&(this.isDecodeFirstIIframe=!0),this.isDecodeFirstIIframe){if(this.isDecodeStateClosed())return void this.player.debug.warn(this.TAG_NAME,"VideoDecoder isDecodeStateClosed true");if(i&&0===e[1]){var a=15&e[0],n={};a===Gt?n=Qs(e.slice(5)):a===zt&&(n=ll(e));var o=this.player.video.videoInfo;o&&o.width&&o.height&&n&&n.codecWidth&&n.codecHeight&&(n.codecWidth!==o.width||n.codecHeight!==o.height)&&(this.player.debug.warn(this.TAG_NAME,"decodeVideo: video width or height is changed,\n old width is ".concat(o.width,", old height is ").concat(o.height,",\n new width is ").concat(n.codecWidth,", new height is ").concat(n.codecHeight,",\n and emit change event")),this.isWidthOrHeightChanged=!0,this.player.emitError(It.wcsWidthOrHeightChange))}if(this.isWidthOrHeightChanged)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo: video width or height is changed, and return");if(Fo(e))return void this.player.debug.warn(this.TAG_NAME,"decodeVideo and payload is video sequence header so drop this frame");if(e.byteLength<12)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo and payload is too small , payload length is ".concat(e.byteLength));var s=!1,l=(new Date).getTime();this.prevTimestamp||(this.prevTimestamp=l,s=!0);var c=l-this.prevTimestamp;this.decodeDiffTimestamp=c,c>500&&!s&&this.player.isPlayer()&&this.player.debug.warn(this.TAG_NAME,"decodeVideo diff time is ",c);var u=e.slice(5),d=new EncodedVideoChunk({data:u,timestamp:t,type:i?Ri:Di});this.player.emit(xt.timeUpdate,t);try{this.decoder.decode(d)}catch(e){this.player.debug.error(this.TAG_NAME,"VideoDecoder",e);var h=e.toString();(-1!==h.indexOf(Cr)||-1!==h.indexOf(xr))&&this.player.emitError(It.webcodecsDecodeError)}this.prevTimestamp=(new Date).getTime()}else this.player.debug.log(this.TAG_NAME,"VideoDecoder first frame is not iFrame");else if(i&&e[1]===Gr){var p=15&e[0];if(this.player.video.updateVideoInfo({encTypeCode:p}),p===zt&&!$n()){var f=zn();return this.player.debug.warn(this.TAG_NAME,"WebcodecsDecoder not support hevc decode",f.type,f.version),void this.player.emitError(It.webcodecsH265NotSupport)}this.player._times.decodeStart||(this.player._times.decodeStart=Ln());var m=null,g=null,y=e.slice(5);if(p===Gt?(g=Qs(y),m={codec:g.codec,description:y}):p===zt&&(g=cl(y),m={codec:g.codec,description:y}),!m||m&&!m.codec)return this.player.debug.warn(this.TAG_NAME,"decodeVideo and webcodecs configure is",JSON.stringify(m)),void this.player.emitError(It.webcodecsDecodeConfigureError);g&&g.codecWidth&&g.codecHeight&&(m.codedHeight=g.codecHeight,m.codedWidth=g.codecWidth),this.player.recorder&&this.player._opt.recordType===H&&this.player.recorder.initMetaData(e,p),this.player.debug.log(this.TAG_NAME,"decoder.configure() and codec is ".concat(m.codec));try{this.decoder.configure(m),this.hasInit=!0}catch(e){this.player.debug.log(this.TAG_NAME,"configure error",e.code,e),-1!==e.toString().indexOf(Pr)?this.player.emitError(It.webcodecsH265NotSupport):this.player.emitError(It.webcodecsDecodeConfigureError)}}}},{key:"getDecodeDiffTimes",value:function(){return this.decodeDiffTimestamp}},{key:"isDecodeStateClosed",value:function(){return"closed"===this.decoder.state}},{key:"isDecodeStateConfigured",value:function(){return"configured"===this.decoder.state}},{key:"isDecodeStateUnConfigured",value:function(){return"unconfigured"===this.decoder.state}}])}(s),Hu={play:"播放",pause:"暂停",audio:"",mute:"",screenshot:"截图",loading:"",fullscreen:"全屏",fullscreenExit:"退出全屏",record:"录制",recordStop:"停止录制",narrow:"缩小",expand:"放大",ptz:"操作盘",ptzActive:"操作盘激活",zoom:"电子放大",zoomStop:"关闭电子放大",close:"关闭",performance:"性能面板",performanceActive:"性能面板激活",face:"人脸识别",faceActive:"人脸识别激活",object:"物品识别",objectActive:"物品识别激活",occlusion:"遮挡物检查",occlusionActive:"遮挡物检查激活",logSave:"保存日志"},Wu=Object.keys(Hu).reduce((function(e,t){return e[t]='\n \n ').concat(Hu[t]?''.concat(Hu[t],""):"","\n"),e}),{});function Vu(e,t){var i=!1;return e.forEach((function(e){i||e.startTimestamp<=t&&e.endTimestamp>t&&(i=!0)})),i}function Ju(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=e.length,a=t.length,n=Math.max(r,a),o=2e3,s=Math.ceil(n/o),l=0,c=0;function u(){for(var a="",n="",d=0;d\n ').concat(h.title,"\n \n "));var p=t[c];p&&(n+='\n
').concat(p.title,"
\n ")),c+=1}a&&i.$playbackTimeListOne.insertAdjacentHTML("beforeend",a),n&&i.$playbackTimeListSecond.insertAdjacentHTML("beforeend",n),l+=1,l0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<1440;r++){var a=r%60==0,n=!1;i&&(n=Vu(e,po(i,r))),t.push({title:uo(r),timestamp:r,dataType:"min",hasRecord:n,isStart:a})}return t}(e);Ju(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00";t<10&&(i="0"+i),e.push({title:i,hour:t,min:0,second:0})}return e}(),t)}function Ku(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<1440;r++){var a=60*r,n=a%1800==0,o=!1;i&&(o=Vu(e,fo(i,a))),t.push({title:ho(a),timestamp:a,dataType:"second",hasRecord:o,isStart:n});var s=60*r+30;n=s%1800==0,i&&(o=Vu(e,fo(i,s))),t.push({title:ho(s),timestamp:s,dataType:"second",hasRecord:o,isStart:n})}return t}(e);Ju(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00",r=t+":30";t<10&&(i="0"+i,r="0"+r),e.push({title:i,hour:t,min:0,second:0}),e.push({title:r,hour:t,min:30,second:0})}return e}(),t)}function Yu(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<144;r++)for(var a=0;a<60;a++){var n=10*a+600*r,o=n%600==0,s=!1;i&&(s=Vu(e,fo(i,n))),t.push({title:ho(n),timestamp:n,dataType:"second",isStart:o,hasRecord:s})}return t}(e);Ju(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00";t<10&&(i="0"+i),e.push({title:i,hour:t,min:0,second:0});for(var r=1;r<6;r++){var a=r+"0";e.push({title:i.replace(":00",":"+a),hour:t,min:10*r,second:0})}}return e}(),t)}function Qu(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<288;r++)for(var a=0;a<60;a++){var n=5*a+300*r,o=n%300==0,s=!1;i&&(s=Vu(e,fo(i,n))),t.push({title:ho(n),timestamp:n,dataType:"second",isStart:o,hasRecord:s})}return t}(e);Ju(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00";t<10&&(i="0"+i),e.push({title:i,hour:t,min:0,second:0}),e.push({title:i.replace(":00",":05"),hour:t,min:5,second:0});for(var r=1;r<6;r++){var a=r+"0",n=r+"5";e.push({title:i.replace(":00",":"+a),hour:t,min:10*r,second:0}),e.push({title:i.replace(":00",":"+n),hour:t,min:10*r+5,second:0})}}return e}(),t)}function Xu(e){var t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),r=Math.floor(e-3600*t-60*i);return(t>0?[t,i,r]:[i,r]).map((function(e){return e<10?"0".concat(e):String(e)})).join(":")}function Zu(e,t,i){var r=e.$playbackProgress,a=r.getBoundingClientRect(),n=a.left,o=In((On()?i.touches[0].clientX:i.pageX)-n,0,r.clientWidth),s=parseInt(o/r.clientWidth*t,10);return{second:s,time:Xu(s),width:o,percentage:In(o/r.clientWidth,0,1)}}function $u(e,t){return e.classList.add(t)}function ed(e,t){return t instanceof Element?e.appendChild(t):e.insertAdjacentHTML("beforeend",String(t)),e.lastElementChild||e.lastChild}function td(e,t,i){return e&&e.style&&no(t)&&(e.style[t]=i),e}function id(e,t){return e.composedPath&&e.composedPath().indexOf(t)>-1}function rd(e){var t=!1;return e&&e.parentNode&&(e.parentNode.removeChild(e),t=!0),t}var ad=function(e,t){var i=e.events.proxy,r=document.createElement("object");r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex",-1),r.type="text/html",r.data="about:blank",Pn(r,{display:"block",position:"absolute",top:"0",left:"0",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:"-1"});var a=e.width,n=e.height,o=Yn((function(){e.width===a&&e.height===n||(a=e.width,n=e.height,e.emit(xt.resize),d())}),500);i(r,"load",(function(){i(r.contentDocument.defaultView,"resize",(function(){o()}))})),e.$container.appendChild(r),e.on(xt.destroy,(function(){e.$container.removeChild(r)})),e.on(xt.volumechange,(function(){!function(e){if(0===e)Pn(t.$volumeOn,"display","none"),Pn(t.$volumeOff,"display","flex"),Pn(t.$volumeHandle,"top","48px");else if(t.$volumeHandle&&t.$volumePanel){var i=Bn(t.$volumePanel,"height")||60,r=Bn(t.$volumeHandle,"height"),a=i-(i-r)*e-r;Pn(t.$volumeHandle,"top","".concat(a,"px")),Pn(t.$volumeOn,"display","flex"),Pn(t.$volumeOff,"display","none")}t.$volumePanelText&&(t.$volumePanelText.innerHTML=parseInt(100*e))}(e.volume)})),e.on(xt.loading,(function(i){Pn(t.$loading,"display",i?"flex":"none"),(No(e._opt.backgroundLoadingShow)&&Oo(i)||No(i))&&Pn(t.$poster,"display","none"),i&&(Pn(t.$playBig,"display","none"),Pn(t.$tipsMessage,"display","none")),i||e._opt.extendDomConfig.showAfterLoading&&t.$extendDom&&Pn(t.$extendDom,"display","block"),i||e.getRenderType()===he&&No(e._opt.useMSE)&&s()})),e.on(xt.removeLoadingBgImage,(function(){s()}));var s=function(){t.$loadingBgImage&&t.$loadingBg&&t.$loadingBgImage.src&&(e.debug&&e.debug.log("Control","remove loading bg image"),t.$loadingBgImage.width=0,t.$loadingBgImage.height=0,t.$loadingBgImage.src="",Pn(t.$loadingBg,"display","none"))},l=function(t){e.fullscreen?_o(t)===e.$container&&c():c()},c=function(i){var r=ao(i)?i:e.fullscreen;Pn(t.$fullscreenExit,"display",r?"flex":"none"),Pn(t.$fullscreen,"display",r?"none":"flex")},u=function(){return e._opt.playType===z&&e._opt.playbackConfig.showControl},d=function(i){On()&&t.$controls&&e._opt.useWebFullScreen&&setTimeout((function(){if(e.fullscreen){var r=u()?yi:gi,a=e.height/2-e.width+r/2,n=e.height/2-r/2;if(t.$controls.style.transform="translateX(".concat(-a,"px) translateY(-").concat(n,"px) rotate(-90deg)"),t.$zoomControls){var o=156,s=30,l=e.width/2+o/2-s/2;t.$zoomControls.style.transform="translateX(".concat(-l,"px) translateY(").concat(e.height/2,"px) rotate(-90deg)")}if(t.$recording){var c=101,d=20,h=e.width/2+c/2-d/2;t.$recording.style.transform="translateX(".concat(-h,"px) translateY(").concat(e.height/2,"px) rotate(-90deg)")}}else t.$controls.style.transform="translateX(0) translateY(0) rotate(0)",t.$zoomControls&&(t.$zoomControls.style.transform="translateX(-50%) translateY(0) rotate(0)"),t.$recording&&(t.$recording.style.transform="translateX(-50%) translateY(0) rotate(0)");i&&i()}),10)};try{sn.on("change",l),e.events.destroys.push((function(){sn.off("change",l)}))}catch(e){}e.on(xt.webFullscreen,(function(e){On()&&(c(e),d((function(){p()})))})),e.on(xt.recording,(function(){e.playing&&(Pn(t.$record,"display",e.recording?"none":"flex"),Pn(t.$recordStop,"display",e.recording?"flex":"none"),(e._opt.hasControl||e._opt.isShowRecordingUI)&&(Pn(t.$recording,"display",e.recording?"flex":"none"),No(e.recording)&&t.$recordingTime&&(t.$recordingTime.innerHTML=co(0))))})),e.on(xt.recordingTimestamp,(function(e){t.$recordingTime&&(t.$recordingTime.innerHTML=co(e))})),e.on(xt.zooming,(function(){e.playing&&(Pn(t.$zoom,"display",e.zooming?"none":"flex"),Pn(t.$zoomStop,"display",e.zooming?"flex":"none"),(e._opt.hasControl||e._opt.isShowZoomingUI)&&Pn(t.$zoomControls,"display",e.zooming?"flex":"none"))})),e.on(xt.playing,(function(e){h(e)}));var h=function(i){i||e.isPlayFailedAndPaused&&No(e._opt.playFailedAndPausedShowPlayBtn)?(Pn(t.$play,"display","none"),Pn(t.$playBig,"display","none")):(Pn(t.$play,"display","flex"),Pn(t.$playBig,"display","block")),Pn(t.$pause,"display",i?"flex":"none"),Pn(t.$screenshot,"display",i?"flex":"none"),Pn(t.$record,"display",i?"flex":"none"),Pn(t.$qualityMenu,"display",i?"flex":"none"),Pn(t.$volume,"display",i?"flex":"none"),Pn(t.$ptz,"display",i?"flex":"none"),Pn(t.$zoom,"display",i?"flex":"none"),Pn(t.$scaleMenu,"display",i?"flex":"none"),Pn(t.$faceDetect,"display",i?"flex":"none"),Pn(t.$objectDetect,"display",i?"flex":"none"),Pn(t.$occlusionDetect,"display",i?"flex":"none"),Pn(t.$controlHtml,"display",i?"flex":"none"),e.isPlayback()&&Pn(t.$speedMenu,"display",i?"flex":"none"),c(),t.extendBtnList.forEach((function(e){e.$iconWrap&&Pn(e.$iconWrap,"display",i?"flex":"none"),e.$activeIconWrap&&Pn(e.$activeIconWrap,"display","none")})),e._opt.showPerformance?Pn(t.$performanceActive,"display",i?"flex":"none"):(Pn(t.$performance,"display",i?"flex":"none"),Pn(t.$performanceActive,"display","none")),Pn(t.$poster,"display","none"),Pn(t.$ptzActive,"display","none"),Pn(t.$recordStop,"display","none"),Pn(t.$zoomStop,"display","none"),Pn(t.$faceDetectActive,"display","none"),Pn(t.$objectDetectActive,"display","none"),i||(t.$speed&&(t.$speed.innerHTML=function(e){if(null==e||""===e)return"0 KB/s";var t=parseFloat(e);return t=t.toFixed(2),t+"KB/s"}("")),Pn(t.$zoomControls,"display","none"),Pn(t.$recording,"display","none"),t.$ptzControl&&t.$ptzControl.classList.remove("jb-pro-ptz-controls-show")),p(),i&&f()};e.on(xt.playbackPause,(function(e){h(!e)})),e.on(xt.kBps,(function(i){var r=function(e){if(null==e||""===e||0===parseFloat(e)||"NaN"===e)return"0 KB/s";var t=["KB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"],i=0,r=parseFloat(e);i=Math.floor(Math.log(r)/Math.log(1024));var a=r/Math.pow(1024,i);return a=a.toFixed(2),a+(t[i]||t[0])}(i);t.kbpsShow=r,e._opt.showBandwidth&&(t.$speed&&(t.$speed.innerHTML=r),p())}));var p=function(){if(u()&&e._opt.playbackConfig.controlType===ve.normal){var i=t.controlsInnerRect.width-t.controlsLeftRect.width-t.controlsRightRect.width-t.controlsPlaybackBtnsRect.width;On()&&e.webFullscreen&&(i=t.controlsInnerRect.height-t.controlsLeftRect.height-t.controlsRightRect.height-t.controlsPlaybackBtnsRect.height),t.$playbackTimeInner.style.width=i+"px"}},f=function(){if(u()&&e._opt.playbackConfig.controlType===ve.normal){var i=t.$playbackCurrentTime.style.left,r=parseInt(i,10),a=t.controlsPlaybackTimeInner.width;r=r-a/2>0?parseInt(r-a/2,10):0,t.$playbackTimeInner.scrollLeft=r}};if(u()){var m=function(){if(u()){var i=0,r=e.playback&&e.playback.playingTimestamp;if(r){var a=new Date(r),n=a.getHours(),o=a.getMinutes(),s=a.getSeconds();e.playback.is60Min?i=60*n+o:e.playback.is30Min?i=2*(60*n+o)+parseInt(s/30,10):e.playback.is10Min?i=6*(60*n+o)+parseInt(s/10,10):e.playback.is5Min?i=12*(60*n+o)+parseInt(s/5,10):e.playback.is1Min&&(i=60*(60*n+o)+parseInt(s,10)),t.$playbackCurrentTime.style.left=i+"px"}}},g=function(e){t.$playbackNarrow.classList.remove("disabled"),t.$playbackExpand.classList.remove("disabled"),e===Hi&&t.$playbackNarrow.classList.add("disabled"),e===Ji&&t.$playbackExpand.classList.add("disabled")};e.on(xt.playbackTime,(function(i){if(e._opt.playbackConfig.controlType===ve.normal)t.$playbackCurrentTimeText&&(t.$playbackCurrentTimeText.innerText=Vn(i,"{h}:{i}:{s}")),m();else if(e._opt.playbackConfig.controlType===ve.simple){var r=(a=i,n=e.playback.totalDuration,In(a/n,0,1));t.$playbackProgressPlayed.style.width=100*r+"%",t.$playbackProgressIndicator.style.left="calc(".concat(100*r,"% - 7px)"),t.$playbackProgressTime.innerText="".concat(Xu(i)," / ").concat(Xu(e.playback.totalDuration))}var a,n})),e.on(xt.playbackPrecision,(function(i,r){u()&&e._opt.playbackConfig.controlType===ve.normal&&(t.$playbackTimeScroll.classList.remove(qi.oneHour,qi.halfHour,qi.fiveMin,qi.tenMin),t.$playbackTimeScroll.classList.add(qi[i]),t.rafId&&(window.cancelAnimationFrame(t.rafId),t.rafId=null),t.changePercisitionInterval&&(clearTimeout(t.changePercisitionInterval),t.changePercisitionInterval=null),t.$playbackTimeListOne.innerHTML="",t.$playbackTimeListSecond.innerHTML="",t.changePercisitionInterval=setTimeout((function(){switch(t.$playbackTimeListOne.innerHTML="",t.$playbackTimeListSecond.innerHTML="",i){case Hi:qu(r,t);break;case Wi:Ku(r,t);break;case Vi:Yu(r,t);break;case Ji:Qu(r,t)}m(),e._opt.playbackConfig.showPrecisionBtn&&g(i),f()}),16))})),e.on(xt.resize,(function(){p()})),e.on(xt.playbackTimeScroll,(function(){f()})),p()}if(e._opt.operateBtns.quality&&e._opt.qualityConfig.length>0){e.on(xt.streamQualityChange,(function(e){y(e)}));var y=function(e){t.$qualityText.innerText=e,t.$qualityMenuItems.forEach((function(t){var i=t.dataset.quality;t.classList.remove("jb-pro-quality-menu-item-active"),i===e&&t.classList.add("jb-pro-quality-menu-item-active")}))};(function(){var i=e._opt.qualityConfig||[],r="";i.forEach((function(e){r+='\n
').concat(e,"
\n ")})),r&&(t.$qualityMenuList.insertAdjacentHTML("beforeend",r),Object.defineProperty(t,"$qualityMenuItems",{value:e.$container.querySelectorAll(".jb-pro-quality-menu-item")}))})(),e.streamQuality&&y(e.streamQuality)}if(e._opt.operateBtns.scale&&e._opt.scaleConfig.length>0){e.on(xt.viewResizeChange,(function(e){v(e)}));var v=function(i){var r=e._opt.scaleConfig[i];t.$scaleText.innerText=r,t.$scaleMenuItems.forEach((function(e){var t=e.dataset.scale;e.classList.remove("jb-pro-scale-menu-item-active"),qn(t)===qn(i)&&e.classList.add("jb-pro-scale-menu-item-active")}))};(function(){var i=e._opt.scaleConfig||[],r="";i.forEach((function(e,t){r+='\n
').concat(e,"
\n ")})),r&&(t.$scaleMenuList.insertAdjacentHTML("beforeend",r),Object.defineProperty(t,"$scaleMenuItems",{value:e.$container.querySelectorAll(".jb-pro-scale-menu-item")}))})(),v(e.scaleType)}if(e.isPlayback()&&e._opt.playbackConfig.showRateBtn&&e._opt.playbackConfig.rateConfig.length>0){e.on(xt.playbackRateChange,(function(e){A(e)}));var A=function(i){var r=e._opt.playbackConfig.rateConfig.find((function(e){return qn(e.value)===qn(i)}));r&&(t.$speedText.innerText=r.label,t.$speedMenuItems.forEach((function(e){var t=e.dataset.speed;e.classList.remove("jb-pro-speed-menu-item-active"),qn(t)===qn(i)&&e.classList.add("jb-pro-speed-menu-item-active")})))};(function(){var i=e._opt.playbackConfig.rateConfig,r="";i.forEach((function(e,t){r+='\n
').concat(e.label,"
\n ")})),r&&(t.$speedMenuList.insertAdjacentHTML("beforeend",r),Object.defineProperty(t,"$speedMenuItems",{value:e.$container.querySelectorAll(".jb-pro-speed-menu-item")}))})();var b=e.playback?e.playback.playbackRate:1;A(b)}e.on(xt.stats,(function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e._opt.showPerformance){Pn(t.$performancePanel,"display","block"),t.$performancePanel.innerHTML="";var r=Fn,a=Wo(),n=e.getCpuLevel(),o=no(n)&&-1!==n?"".concat(Pa[n]):"",s=e.video&&e.video.videoInfo||{},l=e.audio&&e.audio.audioInfo||{},c=e._times||{},u=e.getRenderType(),d=e.getCanvasRenderType(),h=e.getDecodeType(),p=e.getDemuxType(),f=e.getStreamType(),m=e.getAudioEngineType(),g=e.getRecordingDuration(),y=e.getRecordingByteLength(),v=e.isAudioPlaybackRateSpeed(),A=e.videoIframeIntervalTs;g=co(g),y=Qn(y);var b=e.isPlayback()?"录播":"直播",_=i.isDropping,k=e._opt.useMSE&&e._opt.mseDecodeAudio,w=e.control?e.control.kbpsShow:"0 KB/s",S=e.getVideoPlaybackQuality(),T='\n
\n 版本 '.concat(r,"\n
\n ").concat(e._opt.isMulti?'\n
\n UUid '.concat(e._opt.debugUuid,"\n
\n "):"","\n ").concat(e.isInMulti()?'\n
\n 窗口下标 '.concat(e._opt.multiIndex,"\n
\n "):"","\n ").concat(a?'\n
\n 内存大小限制 '.concat(Qn(a.jsHeapSizeLimit),'\n
\n
\n 可使用的内存 ').concat(Qn(a.totalJSHeapSize),'\n
\n
\n 已使用的内存 ').concat(Qn(a.usedJSHeapSize),"\n
\n "):"","\n ").concat(o?'\n
\n CPU压力情况 '.concat(o,"\n
\n "):"","\n\n ").concat(a&&a.usedJSHeapSize>a.totalJSHeapSize?'\n
\n 可能内存泄漏 是}\n
\n ':"",'\n
\n 播放模式 ').concat(b,"\n
\n ").concat(e.isPlayback()?'\n
\n 播放倍率 '.concat(e.playback.rate,'倍\n
\n
\n 播放模式 ').concat(e.playback.isUseFpsRender?"固定FPS":"动态FPS","\n
\n ").concat(e.playback.isUseFpsRender?'\n
\n 固定FPS '.concat(e.video.getStreamFps(),"\n
\n "):"","\n "):"",'\n
\n 解封装模式 ').concat(ie[p],'\n
\n
\n 解码模式 ').concat(h,'\n
\n
\n 渲染组件 ').concat(u,"\n
\n ").concat(u===he?'\n
\n 渲染引擎 '.concat(d,"\n
\n "):"",'\n
\n 网络请求组件 ').concat(f,'\n
\n
\n 视频格式 ').concat(s.encType||"-",'\n
\n
\n 视频(宽x高) ').concat(s.width||"-","x").concat(s.height||"-","\n
\n ").concat(e.isPlayer()?'\n
\n 视频GOP(ms) '.concat(A||"-","\n
\n "):"",'\n
\n 音频格式 ').concat(qt[l.encType]||"-",'\n
\n
\n 音频引擎 ').concat(m||"-",'\n
\n
\n 音频通道 ').concat(l.channels||"-",'\n
\n
\n 音频采样率 ').concat(l.sampleRate||"-","\n
\n ").concat(e.isPlayer()?'\n
\n 播放器初始化(ms) '.concat(c.playTimestamp,'\n
\n
\n 开始请求地址(ms) ').concat(c.streamTimestamp,'\n
\n
\n 请求响应(ms) ').concat(c.streamResponseTimestamp,'\n
\n
\n 解封装(ms) ').concat(c.demuxTimestamp,'\n
\n
\n 解码(ms) ').concat(c.decodeTimestamp,'\n
\n
\n 页面开始渲染(ms) ').concat(c.videoTimestamp,'\n
\n
\n 初始化到页面渲染(ms) ').concat(c.allTimestamp,"\n
\n ").concat(e.recording?'\n
\n 视频录制时间 '.concat(g,'\n
\n
\n 视频录制大小 ').concat(y,"\n
\n "):"","\n "):"",'\n
\n 音频码率(bit) ').concat(i.abps,'\n
\n
\n 视频码率(bit) ').concat(i.vbps,'\n
\n
\n 视频帧率(fps) ').concat(i.fps,'\n
\n
\n 视频峰值帧率(fps) ').concat(i.maxFps,'\n
\n
\n 解码帧率(fps) ').concat(i.dfps,'\n
\n
\n 音频缓冲帧 ').concat(i.audioBuffer,'\n
\n
\n 音频缓冲时长(ms) ').concat(i.audioBufferDelayTs,"\n
\n ").concat(e.isPlayer()?'\n
\n 视频待解码帧 '.concat(i.demuxBuffer,"\n
\n "):'\n
\n 缓存时长(ms) '.concat(i.playbackCacheDataDuration,'\n
\n
\n 视频待渲染帧 ').concat(i.playbackVideoBuffer,'\n
\n
\n 视频待解码帧 ').concat(i.demuxBuffer,'\n
\n
\n 音频待解码帧 ').concat(i.audioDemuxBuffer,"\n
\n "),'\n
\n 待解封装数据(byte) ').concat(i.streamBuffer,"\n
\n ").concat(e._opt.useMSE?'\n
\n MSE缓冲时长(ms) '.concat(i.mseDelay,'\n
\n
\n MSE待解码帧 ').concat(i.msePendingBuffer,'\n
\n
\n MSE缓存时长(s) ').concat(i.mseStore,'\n
\n
\n MSE解码间隔(ms) ').concat(i.mseDecodeDiffTimes,'\n
\n
\n MSE解码时间(ms) ').concat(i.mseTs,'\n
\n
\n MSE播放模式 ').concat(i.mseDecodePlaybackRate>1?"加速":"正常","\n
\n "):"","\n ").concat(e._opt.useWCS?'\n
\n WCS解码间隔(ms) '.concat(i.wcsDecodeDiffTimes,"\n
\n "):"","\n ").concat(e.isOldHls()?'
\n HLS缓冲时长(ms) '.concat(i.hlsDelay,"\n
\n "):"","\n ").concat(e.isUseHls265()?'
\n HLS缓冲时长(ms) '.concat(i.hlsDelay,'\n
\n
\n HLS待解码帧 ').concat(i.hlsDemuxLength,'\n
\n
\n HLS待解码视频帧 ').concat(i.hlsDemuxVideoLength,'\n
\n
\n HLS待解码音频帧 ').concat(i.hlsDemuxAudioLength,"\n
\n "):"","\n ").concat(e.isPlayer()&&S?'\n
\n Video已渲染帧 '.concat(S.renderedVideoFrames,'\n
\n
\n Video已丢弃帧 ').concat(S.droppedVideoFrames,"\n
\n "):"","\n ").concat(e.isPlayer()?'\n
\n 网络延迟(ms) '.concat(i.netBuf,'\n
\n
\n 缓冲时长(ms) ').concat(i.buf,'\n
\n
\n 最新缓冲时长(ms) ').concat(i.pushLatestDelay,"\n
\n "):"","\n ").concat(e._opt.useMSE||e.isWebrtcH264()||e.isAliyunRtc()?'\n
\n video显示时间(s) '.concat(i.videoCurrentTime,'\n
\n
\n video间隔时间(s) ').concat(i.videoCurrentTimeDiff,'\n
\n
\n videoBuffer缓存时间(ms) ').concat(i.mseVideoBufferDelayTime,"\n
\n "):"",'\n
\n 视频显示时间(ms) ').concat(i.currentPts||i.ts,"\n
\n ").concat(e._opt.hasAudio&&e.isAudioNotMute()&&No(k)?'\n
\n 音频显示时间(ms) '.concat(i.audioTs,"\n
\n ").concat(e._opt.hasVideo?'\n
\n 音视频同步时间戳(ms) '.concat(i.audioSyncVideo,"\n
\n "):"",'\n
\n 音频播放模式 ').concat(v?"加速":"正常","\n
\n "):"",'\n
\n 视频解码时间(ms) ').concat(i.dts,"\n
\n ").concat(e.isPlayer()?'\n
\n 解码前-解码后延迟(ms) '.concat(i.delayTs,'\n
\n
\n 总延迟(网络+解码)(ms) ').concat(i.totalDelayTs,"\n
\n "):"","\n ").concat(e.isPlayer()&&i.isStreamTsMoreThanLocal?'
\n 是否超过一倍率推流 是\n
\n ':"","\n ").concat(e.isPlayer()?'\n
\n 是否播放流畅 '.concat(i.videoSmooth,"\n
\n "):"","\n ").concat(e.isPlayer()?'\n
\n 是否在丢帧 '.concat(_,"\n
\n "):"",'\n
\n 网速 ').concat(w,'\n
\n
\n 播放时长(s) ').concat(co(i.pTs),'\n
\n
\n ');t.$performancePanel.insertAdjacentHTML("beforeend",T)}else t.$performancePanel.innerHTML="",Pn(t.$performancePanel,"display","none")})),e.on(xt.togglePerformancePanel,(function(e){Pn(t.$performance,"display",e?"none":"flex"),Pn(t.$performanceActive,"display",e?"flex":"none")})),e.on(xt.faceDetectActive,(function(e){Pn(t.$faceDetect,"display",e?"none":"flex"),Pn(t.$faceDetectActive,"display",e?"flex":"none")})),e.on(xt.objectDetectActive,(function(e){Pn(t.$objectDetect,"display",e?"none":"flex"),Pn(t.$objectDetectActive,"display",e?"flex":"none")})),e.on(xt.occlusionDetectActive,(function(e){Pn(t.$occlusionDetect,"display",e?"none":"flex"),Pn(t.$occlusionDetectActive,"display",e?"flex":"none")}))};function nd(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}nd('@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes magentaPulse{0%{background-color:#630030;-webkit-box-shadow:0 0 9px #333}50%{background-color:#a9014b;-webkit-box-shadow:0 0 18px #a9014b}to{background-color:#630030;-webkit-box-shadow:0 0 9px #333}}.jb-pro-container video::-webkit-media-controls{display:none!important}.jb-pro-container .jb-pro-icon{cursor:pointer;width:16px;height:16px;display:inline-block}.jb-pro-container .jb-pro-ptz-controls{position:absolute;width:156px;height:156px;visibility:hidden;opacity:0;border-radius:78px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE4BAMAAAA9UfJZAAAAMFBMVEUAAABHcEy0tLRZWVmysrKoqKi1tbWvr6+2traBgYG1tbWWlpa1tbW1tbVUVFS1tbVGCHqkAAAAD3RSTlMzAO9U3LSWySp3aZcVRDUDw823AAAJYUlEQVR42u3d32sbVxYH8EPHxgg/lBsa7SBkukmpSbwLI2KbEPpgZ5MQtwmM0wRMmgdhP6RgEuwlSVnYlmGMYaEvMU1KKX4QNq0pocVmm7CYfRBaQguFpbgPKRSC/4V2LGliO+bulWKrkvVrftyZ+WbxeTRG+nDnnnNmRjP3EpMR6tMH18du/0Xj1tGz5+9cf/DUlPKx5PsTkr8s3eZ1cX7ym1zkuI/f1wTFunNt9fP+FIno7/98/tFY+Y8ffBUlLrmkl2Cr96guTv27BMxP5iLCqUvi68+tpqhJKPNXBH3SjACnfimm/7Wmsl3fI/FP75lh457oPH+1Da3M+1T8481QcT0T7UetevR618LDPdH4hTlyHLGH3LoZEk6d4PlvyVW8pfNeMwzcDwa/kCKXoTzk9tfB455o1mXyEIOa+0PrFvcFt+fIU8QM/k6guOQifzNFHkN5l/flgsOJVHibfMR9l2nhBqem+VXyFZ/xghkMTp3il8lnDPKiGQROhs2lzjEuKcVW1uWk4ybk2Eq63pxk3CK/RZLiJO+Ti/vZXw3ZX1E+kon7jv+JJMY/+Q15uIRWIKmRthZk4VTDTsnFKYZtSsItWiskObq1Pjm4f8gqIrUF5W8ycAl+nAKIT/iCf1zSKFAgkW4/7drifrLmgsHF2k87alvhblFAcbJttWuDU/VtCiyyedMXbjGfCg6n6H1+cHE+TQFGFx/3jksa2xRoZO2cZ9xsUJn6e8aOeMX1aGco4Biw1jzilm0KPNJb3nBxvhI8rrtVTlCLK5ptCiEyBS+474POhr2c+NA9Lqm/QaHEiXzONW42yN5Q2ydG3OLU4MvI7+XEdImbCWvgSkN3zB1O1YYptOhoNnRNcDM2hRjGMTc4VZsOE9fVZOioyYyjUKPJrKPGNW44XFxX41rXEPc4vFTdS9iLTnFJ4wyFHAO2U1zcSoWNU7RLDnFTb1DocaLoDJfgc+HjYo3uTjTArW9TBJHdcYJTtdEocJ0NCnE97nGBIon0RQc4YzgaXIfdHhdBHdmrJuNtceubFFFkdtrhVG0lKlx3XUrsxz22KbIwLrbBTQ1Hhxsotsb18FR0OIWvtcT9Z5sijOyfW+KM6ShxXXYrXMJKRYlTtIUWuLubFGlknrXAGaPR4jrt5riERRFH7XGtwc1sRo3LHGuKi/qo7j+uhJOr9flKMBW4QR2uxk1NR4/rKjbGRdpXG/bXKtxrAEdVHNfTDXHLf0TAvbLVCJfU5hBwMSvXABfPE0To4w1wP25i4DLPG+CmRjFwncV6nIpQSF4UE7MOd7hAIJG+VIe7u4GCG3pWh0uPouA6C/txMFOuetIR3JSrmnQEN+WqJh2BVbmaSreLS+JMudKky9Xg4jYBRXq8BndoEwmXOVKDWx5GwnVs1eD0OSRcLF+N67EIKrS1Klx8GwuXHa/C/biBhRt6XoVbnsbCdW1V4bDyoZIRZZwKlg8iI8wKLl5Aw73oEWXcoQ003NCRCm59GA3XsVPBTa2g4bqLFZyWQsMp1h6uJ09woa/t4tCaV6WBEWSy7qYrQSbrbroS2MVNzUUOAXbWSnel0sU+AUbpsl/gEjYizlgo4w5vI+Kyl8o4xEryopYI3N1hRFzHszJueRQR17lVxqXnEHGxQhmHd06yd15CgBcQlcsIYokCJi69IHDxbUycOGki9toGJm7otMC9/ism7tXfBA6zBperMIHW4HIVJsDrwsrVIYE2CNEibIHDbBDlFkFJ0AYhWkSOemxUnLFGqN2r1L8ItXuV+hfFN1FxmXH6wwYqbuivdAgXd4RQ+36p8xNq3y91flqfRsV17dD6KCquc4eWcXFbtLyCiusu0hQ0bg4VFytSGhdXICOFilNs0nFx+QOcZ5xGsGEd4DzjOC6OH+A847QD3P9jtuJ2CGjcQeP3gYM+2YQ+TYe+wMG+NETGQd+OgL6RA30LDPrm4eu/ouJe/Q37hjX0rX7oH0mgf16C/mEO+idN6B+DoX9Gx34AAfrRDeiHXqAfF0Lt/OUHrVAfUcucRn+4D/qxSOgHSqEfxcV+iBn68W/EV3AqD85Dv3IA/bIG9GsumC8IaSb+q1XYL6VBv84H/SIk9Cuk0C/fQr+2jP3CN/Sr8tCLDEAvzwC9sAX0kiDYi6lAL0MDvYAP9NJH0ItGYS+3Bb1QGVaP2LfEG/TieNDLCmIvyAi9lCX0IqDQy6diLzwLvWQv9GLH0MtER76rRqWxPgdemtwYf9kWdYdeDh97IwHoLRigN6/A3vYDesMU6K1msDfpgd7eiOmjSEf1ZdpSC3ozMuht3LA3wIPeOjDSTRdfKb7M21VCb/QJvUUq9uay0NvyYm9oHFFKdDvaChp6E23s7cehN25nh5G3vE8aZ8LGDdjMIY49zoc9dPpFx7ikHnIh7sjnHOPYTMj36oxjzDlO1UI9Xe9oUICb49iMDTBwzXCqFuKsG2gycM1wYtaFlrCK3mTgmuJU7UzkA9cUx2bDGjpFH2FucUk9pA57onGNa4lj31uhnJzEtA+ZexxLh3KpkykwL7g4D+GUuJuPe8Kx5RCuJtJbzBuuJ/hyMmCtecSx2aBzIqaNMK+4pBHwtU7WznnGiZwI9Oykq1U2tMWxxSD7hKL3MT84VQ/wwGbzpi8c+47fCsp2kt9g/nDsp6AyNqb1Mb+4pBFQKU7bpm8cS/DjQdg+aXT/wTWOzfLL8m2DfITJwLFFS/oZQHf7CecQpxq25GqnGO0nnEMcS2iSq13WWmCycKLaHZebDDeYPBz7mb8tz3aff8Rk4tiivJQd5H1MLo5NyNIN8t6cbJw6ZV2WYys6tTnHCZ2MsRM2k8nHSdG5srnBMTXNr/qzfcYLLmyucEyd8FdR7vNeNzZ3OJZc5G967mTKu7wvx4LDMfYFtz2efMYM/o7LL3OLY080byVlULNusqBx7AeDX3B9aJWH3P6aBY8rpUX+W3e2t3SXqeAZVzq0/JyLmRe7wt0fUs849t8Jzv/u8Ngq/+K8d42FhxODp/P8VQc85VPxjzc9folXHFO/1Lh1rc3BjT0S//SeycLGCd6Sxvm51abDp8xf4dyaNL1/gw+caBhLuvj6O6v36mWn5scEPe+H5hMn4uP3hUEAr63e6y+PYX//qflHY+U/fvCVzw/3ixPD98vSbV4X5ye/yfn+aP+4MvDpg+tjZ4+K8bKOnr1z/cFTU8rH/g92biFxn2S73AAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%;transition:visibility .3s,opacity .3s;right:43px;bottom:135px}.jb-pro-container .jb-pro-ptz-controls.show-vertical{right:43px}.jb-pro-container .jb-pro-ptz-controls.show-vertical .jb-pro-ptz-btns{left:0;top:156px}.jb-pro-container .jb-pro-ptz-controls.show-level{right:163px}.jb-pro-container .jb-pro-ptz-controls.show-level .jb-pro-ptz-btns{min-height:156px;left:144px;top:0;display:flex;flex-direction:column;justify-content:center}.jb-pro-container .jb-pro-ptz-controls.jb-pro-ptz-controls-show{visibility:visible;opacity:1}.jb-pro-container .jb-pro-ptz-bg-active{visibility:hidden;opacity:0;width:156px;height:156px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE4CAMAAAD4oR9YAAAAM1BMVEX///////////////////////////9HcEz///////////////////////////////////85yRS0AAAAEXRSTlO5DCgVgZBxAK2fQDRkBR5XTPLKM/gAABnnSURBVHja7F0Jkqs6DGQPO9z/tD8Jq6WWbCCvIjKfzAGmulrW3ooedr6ui+M4TdP++SXPr1l/SdL3aRrHhv7ZyA5qb9xe0L3Am+DrkzeCL/BeX908MezTuPsfOArdgl3KsZuhq99fk/Tx3waum+ByAHua5QbYilkzY1aP728YhrH5InrfBa57OLAtVjpRbYaumex04dq4APeC7vnVSfo/45bXLe33jGscMx3f0A1vyg3t69e2dRL/NeA6wrgdcCvjyPM2U25mXDt9xVD3f/qN0yi3Mm6P20S54vlXtGPS/R3GPSbYOsC4ZAvmJtiaGiL3Zlzx/Ht+Y/KXTJXbqmaqe9za1VYn3N7YpX/OVGev2qduOLIiB7xqOzGuWCiXFVmWtU3368A5lkqeOJI21I5XXaORxVRnxmUTdNnY/4U3riNvHMJts9XRtdXVUttipdzrK/4x7UyY6sK4Gbo+nU21T1zKcd9AGJetlMvyLKvj3zXVfeqQElMljINx3MK4xVQ3xj2Ry7N/6CiMOIfYyVUXWxUyBx7HuZRbcHt9bf/Lb9zsHlzKzabauJaK47iVcC7jJujS33/joKkmxDnM4QiJ4xDjZuT+DXQW3jgxV012qcPuiePhCGfchlv1/P0D6Czmqmuq2gPGkbIS8Q4ZsNU3dGP3Y2+cW1RyKpkrbAnwqhi3iXHFHrU3bFVV5c3vBsCsOALjkXErAW85F3rjFvBm5Kos+TngCOXYG7fA1ojFER7GPUHbmer0tfGPANeROM6pjvDMQSkrsWQ1d564Fbr61964TvSqDa6O0ELmAtvGuc2rrpQrn/aa/qCpYq+6mSpOVhnjWBy38u2JXFl9yL8acg6CV3Ur5yxVZfW4AsRxG+XKssz6n3njVMYR4Eg8sj1yi3tgtroxrpyhG38gc+h8PYddPQ551dVQW5jju2/cG7kXdB946Uy9cbDnQOpxuCCHcq5dHDcht8D2/K67VxPNGtLJd7qDTcgb1zLGbXEcY9z0Fd39GReTzIH1B/2lcxrGTYxjXnXyqxNyef8zpipVlfDsyCCmDkuumhGvWq6W+vyisqxvDJwwOxJQO6fNmjaQcRt0ZdR2dwWOFZViuculNWtgBZjk+DNq1cq45y+Lf5NxE25B3oEyLueFJWqtT+Ciqr8r48jsCAyAG+2Na53MAdQxX16VhHEL4Z7Ilc2dGad28pskaULiEdDlyijjdqa6gBeNtwSu63AnP3V6NUnAG9cu1RHOuL2hVi5qr6+9Za4qV0dCGcfCEfDIufWRFbsZvKy7KeNgW7XHvRqxWfOGLhO6XCrjoiiPb/rGdZ75uGRfj9u3B1sWAEtdLuxVF/Cq9HaMe4A4TptkZYwLqI44rmGDbUe5E8hZcg54zquRbHXu5NN6HKuO7N84YqwbdGV/Q8YF5arUN7CJTNLkgplD5T5xG+OOI2ehAhxv00ocOlpWwhHwljns5uNg6bxCb9wbueSupip6VTnj2jGudSvnOeqrVo6h7vl2nHM2K8AkV1WyfDYDvHUcWF+1VBl3EDlLKdc2dQ6aNbhXw2eAt14Nf+MqFse5rDuS8tucHUmhqaJppYF6B8440h7E8cjhqMTiLtcaAL+ga9jWZb35hpbHceyNI9WRSmHcE7n4jqbqTp2D2nnzgm154mB1hJQy1cwBIpd3twCOrjnEoDsoTZ2jepybb2VKrhpx3zB92Z29Khpl1ZN8MHWzJV1CdYQHJEeqTMbqcfEMW+obLBwES83w7AgvY0YlMNT3N96GcXEHGQdxG2t3CQ5kDkoFeO8esHd4fc193jinAtxvXhUN3Ywz5VAFGM3cENfgVM4x5YICYRumqu5yIVMdJuhaLXMAFWBKOIhbWFBiO44Dg4Usxx/cCrDyxqESMIYuu4lX1fYcGnVaaVmtKXZxHOzW5Bvfqtk3iLAFuVaLew4HluDUzIH1VYMZF+AgLMZxcAYY1uNYBTgrwPDIaqxOQ1p540IchBFTJW9c2ofNAO99Q+sYaugbJ35Vd4sKsPbGqVM33KsWmdpXLeXqufsVNwhH8FyhOh8n74foKb5WVDr0zFky1Rgt+iaJZyJTWErKMynpqsqgVy4q0xv0VTvZq0pJPq5jzn41zzzVET0aCYjmTO05OLaaBEwWqhvSenUkKtVw5P0N96mOpNr2YCPuh4AJCGEAoioDver7628Sx8WAcU2i1eM259AWhZBzuQEJieN07JR6sCHgXoSLnepI7yo9NqgCLE5A6K4hjHGKsVqK49JYEGyBg4XIq2b7FREUx5Xu2LkXOtmz2pJBW5sOqdjJF3sOjHG5fz7OT7n8DtURwjjPtBKtx7VLOa6Q4zh5Wkn8xhvU4xbG9al/s2bAbxwYkJO7XCGME43VIuMc56Dnqi7hpPE4cVopBLnibozTp5X4DHAQ49iwfsCX3IhxYFoJB8C0y7Xr1iwBSZXDulIUjF11G6+qr5aPALlCmTrfyWfQzCEK49xoPMnnjFMaq3QlX9tzQPuq0QFbLeNbMU6cHRn3Sb60HwJ6NXAhKQi61nzpPAbtQaY8jUUgQnRHSodxZSjjoig161W7HePIRGZDJzJHQXiEzE4DpRtSjotCHzkUkhj2qqJi4V54T1S6cWwVp/nhjAP1JQuDhbs4TtFW0spKTgW4UHJVFv4GQpcZA64jkt1xDNS8lDEv9Y3z5KpRGY4biIINMC7e2lxKNFJDqUfQquGZA2yrHoINUM7G6ZX1iVM2RKDUI08dssVUfduDRyI5QDkbFWCnscrWVWV1/RZ2uaRc9UyKL1LO0r7q1qwBm761WsmEUjdge9ApAB9iHHWslq4kMalHTbHQieO0zXKljHmIc4XdOE695yCpsg7eOE7t5B/4Uqv1uDSGKhDYq0r6yQWYj5NnRw5BNxjOHJAKRJB+nJqr4jcuOki4qOzs5qrgulSDJzJHUcyrCNMdOc44ty5nel815KDZ4HTypeoILAEfZJxbCjYkSpVKgZx/IpOfXgnarDkKXWIrHAm7kiTqxw1er+oQzg2Bj32FTcYJ2kpCIx9PK2XMq1ZCz+EM46LYZK4qaCsdmo+TqiOV5FWPITdYLZ2jOqYa/6LN8kJSZT1dxkSTJEYKmZ2/OuI5aIYYh+UzKn3TN9A9mLjL1cl6LexKkqof575xVJWVx3HRefdgUbGQNGs2U2Ul4HYQ60o+HeBzjCtt9VXVqXMpc3DEzh2NzEJSnr7OuG35wUTpPGjqXN3lQgdE0AWRA2sOHls1eO2yh/uqWM1LbUgvQzeatOhR5NZM39QIBNyQbviBVajYItbOYa56knCbrRrUj0vxTn5QVQlOnUtdrjKKztuqpbMEJ27WtCG3BzX9uMPfYqsmlW7SPnRfFeSqwTrAp9641VZtXi1PlX1VN44THzlvPe4k45aZLys9h+7cvuqsAqEpBAm6I9HJN24pZ9oIRzp5XzVUsVCZOnd0Ry4zbu52GdMBDn7j+NVyYXaEneW6+sbNrQcjtwdJCTh4WmlrSLcF3axRZ4AvMC6zxjj9annty1X9M8BoefBMQGKudB5UjnMnMltQV1JuD5JK5jnGTUU52zeke+4cfMJ7ygxwSZuDJ6EbzDEuZF+VNLnczCETlPdkdf3Tj5yhAHhNVdV9VXgJGV9JyqWjjRdS1fWRs6vmRctK1KuiLD/b22q2KyvlWJT1HOPeo3IWqyNwlwtrxJNrlwW69ZNr0qKnoBsfNrWVcH+w9gzIFXxDeisr5cxSrzCusFVWkpVukH7coF/0zQRt0a2QGZ1HLrfAuIfDOL/uiLOTz9UMMiTmtXMOVXmxW/P+OqM6wPBKEmLcbuiGMw4lq9cmIPbewa5iIb3LdYxxKHMouYDcSeRqcxd9+dS5VFWCGZd3e9DtR5+21dbYRd/1EAaagUC6IzDLV7YHj4pSKbmDkZRLnmRNcHeQ3azZdvLJ9qCUOVyhXGVmQUSpx9GWAzNW6Y0DmYMzrbTeHjzxxTeI41zktugXtQezAsRxon7caUt9VZZMMQ7pAPMnjnTyB5lxJHPgU+enGTeajONUHWB46wfW41jmAE79nHerNiYyFeXpBu/keycyM8983CWv+sxWLe2rsgpwH7qRxPuqb7pl6IKe61RPYpcbvefQy3e58LSSbwY4B071CuNKk31VtswlTyuJ+6oZuss1h3HVCTEDluZb7Ks6prqrjijlOLTLxRlXUhng85RLo+77por7qp5c1fUN8I1Tbw9eqce9ArkvA6eqxOOr5UQGgrdVC1l5GszHnYSuNsC4OKgeF6au73S5Mt983IU3bvwqcN3jAe9y9VgkvvHPskp7DuI9h7PfYOGNw3EcH7rx91XRPbNPT2TOEbCNNw7uJOGhG+naD8+5PG/cJcI9gYu/CxuYVuqd+6reHbgBWqrvavlV5LLvAqfdc6AFYElcyW1IS0eScqg7ch65/MvABXW5ElWvZXDiOL2Tz3VHzn7Vt4F7iNuDobMjwp7DUh3hfKs+EQCbAs43O9KgG9KDrK6vMe5qIPdd4NS7XFLi4NxzADf0eEPa8aqX1lV35REjb5zac1geuYVwtfjGbTmXsJH0qf7g14Hz9xzE9iD0qigewTv5F71qaeKNwz0HXI+jb5zLODABQWaAP+MbXA2SbxdH9KlzMjw9jvAUMr72o6363hQ4VyQ+lU+vkH70ALVFM2cnP8f1uOojhLPgVZnWI7y9Enjtcr+TT/qDJdj0LW9tqlgFQtUdYQfNQupxnHE3dw5aripmDgOcOt90gHOpOvKRF85EOCJKPSrVEa/y9D9QLDQEXKco3UiqVPtdrjZIIxNuSEeX+qomc9U+3S/WUIUgvD2o7nJ9UnfECnAPWQUiSOu8HYKERz6oO2IDuE7THcHOATIO9xzQhnT1IcblVhjnagRp8QjZVw1gHOFb9ZnSuY1OvutVe3/86w4Be7XOc6GvetsuF47jAq5dElFWn9a5oJF5YUDOBHCdds9BzRw2xrWy1jl946qrC6tfb0i7uWoKZ0eaoJs1e8LR+6pQPy66GMiNhqaV4ljbc/DqjrTC1fL8n/RVa0ummiI1r0a/yyUPT2dcXBR08s9Cl9gVpdKvEvgO00LB7qta585g4eP7jIuDxEXdaSV87TID91WdiUx67uf011lkHBTea/R6HN1XhTdr0AmROw9Pd1h5euurJvxKEh2e9uyrfnYn38q4vnp7cLchXXuVbtxdLoFx1UVtpWnv0uLNGudquTCROXj2HHI6riRK791zJakjIxDKRGatMI5fu8z81y4vzU5bE2yJmYLyFsc1jaythPcc+CW4j2grGVi71GTQgnLV1tFrQduDUj3uWvwb27p2Sefjel/PAXXy+QywoFh4IZKrTF67lC6I1H6NTHEGOBeWB88LoVm6dimoGaxO1a+RiafOpX3V8r7yGayOuZfPgGsOQhy3V4Fgew7wSlJ5hXG1aY1Msj2IK8B0BAK8cYIIxBXG9bZuD6ZUlCqk5zC0x/Yczh9YtSVK9ZA3pAN6Dqq6vnAo9ANx3Ndl0LazXPK0kq/n4J06F+45XMkc7Ajv0Sy/VzZrpAsiLUnyhZ38fQX4vOqIOXX9o9cutRlgfZfrSuZgTVxU9KrKPQdQOgd3CZB7OO9VzcnZ4pYDHddnkoVSrprlAXe5ynN5gxF1/Vi7ocenp7XdcueJyxSt8wtjhRYku2EcB3Hb1LxqHMb9192VJTmuw7DxSsfxdv/Tvn7TSceiAEpylqYnH/lWsWBRXABMVLHQ8B4cjvWUfN1xTYU6wJEqqy7y1ynBEIGt8ycqBxe2BGh3JEt3hO3HtXjm0KFJ/kHIOTDCmEUM2RFMH9ygn8N+WoNmDpcLZEgfFuz2pQPMKof7eHBME0RsxAVX3OFS1Y/Zj77jtGQ34nLRWjVeHtFF/pOIc2EvRdf1m/2UKy11s+8qtXzmAKQMhiNNTDefqiWtFIlkQqEbNJFuO7g6oqr84p8PC710IxN0R0bK5VIFV2svTx9CnCPTxspm1iiGiBKeptmh26tAYOXpp+y3HSGuqUwnONzIZN7bRAdYp4bDZpee5qq5OsAKcdTQISjykUjmM/aq3lRZK3rH6a5SOMmPZw5BQ47yQ05rvm3NVVXhkLCs0YqF2EN60A4iw8Ev1dtcNXvmsGK+qukh/QIRtEHE06cK1fXtKRfLqoTLRadcw8Ev1ZkTXBXzVdkdt5k1PvtQo/24I604520lvq0EFAvxXLXlytPHpjUXcRU4tTuiJvkx4EbugxHojrRJTn4p5jY3gcspucLQKW0lVnNhFQhF5ir+VhsvgZsN/Tji9cOcVybD6wcOuQ5MuXpxirhyt0tTea9NTPKLEVf7CdzMaZdZbpd0Pw6LZ1wiN7PhWGpwk1Uz/BzQDsSEnOB6vXT+cLscntoB3sQZ4qiaV/qOixjSJYgrBNwwu0OcSYKzzbe1ExwYrF6InFdpVp3EG+IIJSlsnWv9uEQ/DrMH497IcOgt4hNxC9vXv2b5ElhU32fuuF78IQ4r3XyreV3NST5V86K16uG6YRF3iIt1gJscxRbgE9oG88E2oa5fdMu14h9x5pZX2I9DuaGn+nGXmOdw6PHrvh+X9OWagGdNbzCkI5uk7NhpwHliSDf2sIY4wQHl6ZysWvoaqcUz4hLyGUrsfF85QIZIvASsh1zZsYsA54qTDyuHSAViM7wH+x6NarDWeRHiFpHT3HE1g5zldsk6wEDOdiiwJejFJeKYvaqtWEhFqShfFSkWHikaPHZH0qJUxEOvnK9a4CE9ibvACVQsbMLKwWTWGP6qMeKOAW6o3AWOXHHZ/TiD55BGXHZW3UScfqqPVdbGMjSLa1VVcRG+KmRI53fOOxGnn2piedpgSK9GB5h0MssBVzsM3AwdfXPuuFh3ZGLaonBUk3/J9eIfcXDmcC1RLEwotgTvuDzIDY3LwM1z0kMam/1gjcyWjQePq7VscjrE2YuFxNHMLFWB1vlwKDO4rlX1tj7ROidZNc1XzZJPZh/q73O5BPBVo90R5PaTyKqYPVhcdK3iGXHxJB8RRLT14KZYl1FW7RJa5zkf6uw2cJJ8x5kbmcDsx+yO6NglQreInO+Oy9oBNry348qh2M5hFTkH4sysihA3WXNVvAIciQSVtH2d745kdZUYQ9pa1o8QNxzLqO4m+eFcNRk6BLmWiHZ3gK+a+FZH8Y444q9qbuuTmcMLlad7Ee+Iq9gOcNJ7cFqZDjCXOs98AV9m8Y84OFitI7fLK0VcwHPoqZ+Dks+wPtRhEf+IS4kZ1ElqOZrW3CBH+ar2O24U34GT8rmqntWsif24jjFrrCtuEjkD4qC2kpqrjrQ9cpDLZXlIt+I+cEl/VernsB7Zj9PTQZIYKjkX4iCz5go7mYpZY2qdI77qH+M9MtRyGsQZXC5rrzBWnt77OQCNzKB2YIi7ipwDcZXJ5YJS54p32UM/h84WAmZZdZMTBE435LLt3sm2foajbyqtTnKCwCkVCFMlHnKSpkhev4UdYHDHke5IK2cIXKACYbuWm7UqVp7uzDsOI66bzxE4ogKBZg5ZtWqCIR2+4wDiLtl2s84m+VW8ra+YNXZ3BHaA4VwVvn8vjcipEJezr8/UDOgOMDeYYv24ZGXvtzuS0Y9jO8AT3QHmnPzhz9G4OZs5QKIvFgJW40FYqraAWRP4OQSRK4qbM55Dxpeqd4B/uiNTmj1oVg5ZhZbvKZdi1mBHMyIuanPydXdk97GW4U28GZqFSjdL8h2nkgN+x7E7bo+40rj50AHOkTq3NYIQ4tpolRXKi36/Q0rj5m2uWkV81ZS6/hRvK/XRyIHRHIby95v/d1y9WEk1lmW1uVx4XekWua4SOSHiKuZnZu3HYXV9yh6EPIc74NojBuQe9uMqUz+ujp4jI+2dt6w7Qp3ghuw+krNaNctBrwYqaNB7MHgAdyk/h5K+pdfx4GzusoafKujHRR3gDu/HhfpxfxF3lTMGbrZtCdB+XIi4KDegmQPagbh1zsufIY4QV2ltJcVXDTn5EeKKuFyqcmgrOWng9g05pZG5RFvnd8SNtDuiPKRbw9H3/ztumkVOjrg5ra2kEIe7IxBx4e7IA3DjMwf3eMfhh9xovH/73dZ5n9cBHrpFzhs4hbhgB5iqeaH5IGDWtCazZuhnOXHg5jmdVX9mDte0u9TjAQz9HB6Iu4zPHt2v7kgNe+cb3FbqeVa9qBfw39C1jZw9cMBDmr7jwqHDylzL+5Sfw2V9wcn9Iy5qZFoTaZRV9b7+k1nB55Sr2gEOaysFiFO+tCSrhqsj2yzyjyAu3lYCHnojyap85gAdfV9wu3l+x2V0R36INSvWAUbvuMvzydRprWogTmfVO+AI4uB+XF/JvxK4UHekMZRucHdkQhsQvdqPuwGurV95cl+LhUR3hPfjTN5lkFa78bUH97StdEdcOJC277h0bvgO24ty6RkQV5OtG5Pn0GIy19S8/OCeKofojlu47gjVT+4/EjZvdu9grnq1uVxAB1il1beEzRtBJJQICv1VMeKU93a0OzItbzq5k90RgLhl+XGCqy3ERdYrO0fftXnb2T3VqjfE5aigMbf3YANirN54co93XMjJT20rhWteP5Hrr/NbT+7xjoPMctOzJkqq6/Luk3u84+7vuGUBSzeBweoE3yPTm8Hm444LiA5gyMXuuJU56G3NR07uAXHVwwo5fgBTf1Xo2rjVnzq7r6yK1LwSr5HHHTdt9fy5k5/R7XLcJdX7FbeOy2dP7trPweQ57FRZx7r6+Mndq3ldEzrAY938ysl9uiQ1cJNVa2SO16X6tZP/dj8uDqJW2VfM/O/ftf7FmPkK3OMZ3MAu8G3T6ytiTTU7OK8jxMlfuN1idg/X91/9VUZ81WOVo8P+Bw+0DogP6NDPAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-up{transform:rotate(-90deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-left{transform:rotate(180deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-down{transform:rotate(90deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-left-up{transform:rotate(-135deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-right-up{transform:rotate(-45deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-left-down{transform:rotate(135deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-right-down{transform:rotate(45deg)}.jb-pro-container .jb-pro-ptz-bg-active.jb-pro-ptz-bg-active-show{visibility:visible;opacity:1}.jb-pro-container .jb-pro-ptz-control{position:absolute;left:53px;top:53px;width:50px;height:50px;background:#fff;border-radius:50%;transition:left .3s,top .3s}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-left{left:33px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-up{top:33px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-right{left:73px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-down{top:73px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-left-up{top:39px;left:39px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-left-down{left:39px;top:67px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-right-up{top:39px;left:67px}.jb-pro-container .jb-pro-ptz-control.jb-pro-ptz-control-right-down{top:67px;left:67px}.jb-pro-container .jb-pro-ptz-icon{position:relative}.jb-pro-container .jb-pro-ptz-icon:hover .icon-title-tips{visibility:visible;opacity:1}.jb-pro-container .jb-pro-ptz-btns{display:block;position:absolute;left:0;top:156px;width:156px;box-sizing:border-box;padding:0 30px}.jb-pro-container .jb-pro-ptz-btns .jb-pro-ptz-btn{display:flex;justify-content:space-between}.jb-pro-container .jb-pro-ptz-expand .jb-pro-ptz-expand-icon{display:inline-block;width:28px;height:28px;cursor:pointer;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAANlBMVEVfX19fX19fX19fX19fX19fX19fX19HcExfX19fX19fX1/////Pz8+oqKjCwsKhoaHn5+eWlpaOqTaDAAAAC3RSTlP/3CaKxwJiAELtp4ri/s4AAACuSURBVCjPfZPREoUgCERXBdPRyv7/Z6/Z1aQp9oWJMyYLiKUrOIpAJBdGCldgbzBkPM/QEoTI3jBEPBRDhwEvChe08Q1Ge0ImvIq4Qj8ljrLdH77CyQPWlCdHC0Q1e9rmmuC+oQN9Q4LwcQg40L6eyqm0uEpXSUqe3fKpkkqL+Y/o+07SrahNEO0T0LBsvOitf4xsLqiNTB32wtqaVKosGLO2mhUrS93+PZ4D99wPqzMJVcbEyA8AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-expand:hover .jb-pro-ptz-expand-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn////i4uLZ2dnIyMjExMS8vLy+iXNeAAAACnRSTlMAYomLxwEm9+NCLo6DKwAAALNJREFUKM99k9kWgyAMRIMmEMLm/39tKaVKFJkXl3sYJ4sAXeQ3ZOcYd0+gRYblFBuFLYoS2ot5lpvYn8zJQ65TO2GVNmdCmQq/qczw4gjpejD14BgmhziEIvCjVRlPioftHW6A7xBB1a8CCUMvsuSqEkPM7eZX6h8GrQ67bYpNIbRL6rb4/k2EfVXKsgmqfQrW9qnGq96a28jGQG1ky2HXpVysyYyeDIhWq7le6ua9P36HD6+2GRi8iBZBAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-narrow .jb-pro-ptz-narrow-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1/9/f2/v7/y8vLUObqxAAAADXRSTlMA3IrE6SZi9wI+y0gNXAn3CgAAAI5JREFUKM+Fk1kOwyAMBQ04bJHT3P+0JVUMNMWv8zvSk1cipfjAKXHwhR7k6KTjYp7dVuWLug1XWB5wz96T/JD2O3Phmv0k5ypL6lVVFIPYpLOka5WKSSFvS0/BloHYlkza5HkMzrvVLo8ZlRr7mtFYWBBsBQ4BjC//GTxcGVw2PpOVHQ6fJj7qS4936OoN2K4e5yE6N1UAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-narrow:hover .jb-pro-ptz-narrow-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcBAMAAACAI8KnAAAAJ1BMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn+/v7X19ckk9ihAAAACnRSTlMA9+NCAsuKJsRiPv/2GwAAAJlJREFUGNNjYAAC5gxFoTYDBijw1FoFBIumQHjsUavAYGkBmGu0CgqUwRqlYNyFIO2Fq+BAnIGBJQrBXerAwLkKCUxgYELmKjBYIXMXM2Qhc5cxdCFzVzBoIXMXMYAcsRsMdgEdgs4FKT4DBqdAitGMQrMIzRkojlRB9wKaB9G8z+CMGjgshjCuMCjoWNxRAxYt2KGRYgJiAQAnZcjElaB/xwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-aperture-far .jb-pro-ptz-aperture-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAASFBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1////9fX1+kpKRzc3ODg4PFxcW1tbXW1tbk5OT29vaVlZVmZmZ8vCMFAAAADHRSTlMAxGJ5Mssm9+NCiYtiH91SAAABAklEQVQoz41T7Q6DIAyEJQooUL55/zddhVazzZjdHyqXXo8DhWCYTWqltNyN+MZLuxP69UGti/vAsl6c0e4L+tQ2yv1AEbvecMhO5cXdYhk+6aO3WGrNAMwentlMz/ZAKIlNoRsqY2wtFWu9t8wasc0iYVN0LkQfrG1zbxNyrIBcntOQrH1Ukkb60QcxYF1xMA2dh8zWj6ZDsLCsIrL4Ds5Hm9FMbCEROWUB0COaLXEIZJKV7CKybGO7UuxjxY2C/TkMbxboKBQCxgMN6MCJQ6Ch/QjOZg/B13LGx8FDTe3IFvl+Bc9XBi3UWoex68qeL/vxmdyxyvz3NJ8f9dDef36HN7koIK2LjxB0AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-aperture-far:hover .jb-pro-ptz-aperture-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAOVBMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn+/v6cnJzr6+u/v7+xsbGlpaXNzc3b29vqh7uRAAAAC3RSTlMAyRjKA59J/3PzPhe1wxwAAAD2SURBVCjPjZPrssMgCIR1mkYtisD7P+zBCyZpM5mzv5hs0M8VnZvaok9BlXzc3FXbO5z0vtifFC5Kn8OL4UfxwVvuHm61d5Z0b6ZGZZwZpQAUosWsjVZntVS1sH3ZFo1IRVYfGXgx+VGwNkkIVbhq9/jm3cAhaNv1Uk3IA8mNn7D3kbQeWK3TLH2jCthrDFcTMwUWaKiClc9mJtJWhS3SF5BpJqMQW1b3xwnkDahMoHYomkeJRgSENA/MFsKML7fgoCBVbGvM+Cx4JcKWbWHKK/h1ZYS1Jy/nK3u8bB3KhzG5deMxtfv3aO7/Heq+9ms8h9fxHP4AHzAWU9zlWNgAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-aperture-near .jb-pro-ptz-aperture-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAQlBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX1////9fX1+FhYWbm5vz8/Nzc3OwsLDi4uLDw8PW1tZmZmYgm6a+AAAAC3RSTlMAYmOLx4kn9+NCIVJiPGAAAAD+SURBVCjPjVPttoMgDMOJAqOU8uH7v+qKFN2c597lF5LTJg1VqQG3aGuM1bNTV0wWDtjpg3pq+IB+npyzcIE9ejsDXzDCrjccs+tOariF3n2OLyw5xko0vh9MDjNb9Q0hp2GK3cixlIApe4/JD9appR8SFxWAUFLg6n63iB1irnY1Jv0mlrok7nUdcZRa1YeshxBA9iijChlxI6iZEaBgSEL2tkRcymPGGJpqlbZ6uDg0WR/F0DwuMpxDkYwiIXA8hO2uMJdGCCK6teB8RQoY8xGfevQjxYQt25qoRwDT25MRBjZ7GtP/P/afa3LHmrflXa+ruf661Hvv+et3eAF6Fh3v+sSUGgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-aperture-near:hover .jb-pro-ptz-aperture-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEWZmZmZmZmZmZmZmZmZmZmZmZmZmZlHcEyZmZmZmZn///+qqqq9vb3z8/PMzMzo6Oja2tpXGg+mAAAACnRSTlP/JomLxwJiAONCr+rW2wAAAOtJREFUKM99U9sWhCAInEpLBS///7WLEWy7p9O8qEzCMBIOQ15DAlLYsoegS9yFMKQ93skl4Adh+ZI54Q8pG5nxgKzkgkcsk4zhmQxRyN1OPHqtncjOu5AuppcJ6s1EHTA1YzC3Wgq3YmzGqpsmlwZAo7F8oLEVKoeE6+TbSxK0JJ/3FLOwFnUxzXuoltYDDMLoAlmYXLAWIrkqbdZKs+q4KBfkNV1uwGaBim9TdLWS3R7iGRvCNTPB7JvGlc5EXK8cKbrxooint73RzXh7Msl6Oj/uT/b62O9j8sj6gMXX0Xwf6jP3Zr9DtNAHTYMMXrXSK0YAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-focus-far .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAPFBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX1////92dnbs7OyFhYWjo6Pe3t7Ly8uxsbG8vLyG+Q0EAAAAC3RSTlMAiWJjx9wm/0Lti7mfpe0AAADaSURBVCjPfVMJDoQgDERFC/bg8P9/XUSO6CqTqA0TptNDpSrMpC2A1btRT8wrNKzzjdo03KC3zhkLD9imbeAFhd3sG2kvZQ2v0NknfGBJZKkhBM9MxOxDKBV1N4iHi0TRHYjN01Qi7/kK2PtyNDU7DAEJgDAAN0u1jsQEFEkcVVmrqjeXrkWRmC67eqbgG7bJyvkQSQkvUvec7szpek6t9ubWJSK/uJVSm+APzHKCh++DWWuH4plQKNYOpfappcjy2VvJn9744cjGwx6uyXjBxqs5Xuqsvf/9Dj8rLhRg+bQ5VAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-focus-far:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAOVBMVEWZmZmZmZmZmZmZmZmZmZmZmZmZmZlHcEyZmZmZmZmZmZn///+xsbGoqKjt7e309PTExMTQ0NDe3t774OlGAAAAC3RSTlP/itxixwImAELtp8B2gZgAAADmSURBVCjPjZMLjsUgCEVpq60G8Lf/xQ62gvNeOmZuUiWeKHC1cKnC5iJAdFuwJXgmf+xg2g//G54OPuTOCUOEL8WgMMCLwgPP+Abj2aF38CrnBR7whw6Bo4fWUk7MMrQ2OrpAq0GspTLLgKg1wTailNITZA0EaTkZGjIAY5NwlATah5CGRMJYj50tFtlWiapsLvAPRdtL/WOmET7QzZyl5ywzp7NWsjBJ1odsragJqeJ9HGFNZoLaJw71hMTm0O7NeDE1Z6YsU5rGL69sedmXXz0ToW8PzA/oV09T8OJR32fb7+B17Qe3WwtC9PVbHAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-focus-near .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAARVBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1/////t7e2dnZ3W1tbGxsa3t7eDg4Oqqqri4uKTk5NImu/5AAAADXRSTlMAYieJ3MvE/0Lti4oh87zNagAAAOtJREFUKM+NU1sOwyAMY30FtoWS8Lj/UZe2gWpVh2aJH1wcO0mNqbDj4gDc8rLmiscEDdPji3rP8IX5fXLWwQWuaVu4gbKDuyPdsJMz3GLefcIPbJ6PDCEAFDlUAJiORM3NigQFAXAFlqOeRhWJyFFIHxNGvRrN0mp470U++3axGM2RAmXcXqKnkDSN0a9WIk5Sa01MpDXBQAdVtrA8lBhFnnKpsmoo5VBrhszV0KuJ5N2tP92O50iQjpzcctravoihdoi0Q1NrfN56m0VWzFBoje+OrD/s7pr0F0yUr6s5/LvUu/bz+B2ep+IHdMIV2SUZfCsAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-focus-near:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAQlBMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn////c3Nz09PTp6enR0dHFxcW7u7uwsLAUKT0cAAAADXRSTlMA3IrE6WIm9wI+y0gNQZpqdwAAAOdJREFUKM99U9GShCAMQ8BF3Cmlpfz/r15dAe88l8zwQiQkoRrTEa3zIXhno7lhWxcYWNbtN/fa4Q/218VFDzf4of0O8A/h3TQfOGU/ytsOj9gPVyt8warkmYEQQAgABYDxTKROz88koS6AVIB1fRCNbSI1cVUy15Jq27LGjTtyzipPeWw40/IXQkrHyZSRmqw3LaQgctFNKYzYyGACfEXossLMojFEj7J0WfdwJ3dD9uY2X25tL0Hj45mTR87Y66u9IQFsDS1bL57o7JbUDNIofvpk08eej8kTe3Hz0ZwP9UFfv8OgfgBUByCEUZhYtAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-cruise-play .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJWSURBVHgBtZe/b9pAFMefbSYWMjCjdOtmYEYqXVC3umMlBFRiT7qxkexITcdKSDUSYna2iqX+E/DG6LCQgcETUiR+5Pv8I3Kc+McF5ysZ3x2++9x79/zuLFEG9Xq9s/1+r8my/AnVJq4z/2LZfB0Oh1tFUQxd1+208aQ0GAa7kCTpMgRJk4kJXk+nU5NEoe12W8PM/wrAotIx2Z+w3MkE7XQ6Q3S4otNlY5zPUZdL7wiMBUsRIK/fDeWvhQ92XS0HrQia83cCsqoIyMug8gQ9Ho/DpF7FYpEajQa9VTBoyIZxWeEfv6IndSqVSjQYDKhcLtNqtaLtdkuigmGSZVn/XKiqqr9wqyZ1YEtbrRZVKhX3zvX1ei0Eh7Ufa7Xan8C9VRIUg9lyQZfzO19VOOugkBpAgaXRtnq97oLZ5ZvNJm0YQkBZ8m63E7YyKl5ntrrf77vlJCF/qzLlKLZ4NBqRpmmuF2LBlLOyBFYBchDKlIeWyyWNx+PUtS2Qtx+eJA6i2WzmQtMEA+8KnA+73a6N+jkJil1pGAbN5/PMfRBIZsGn3+LFvSABMYiBgpnJgZEeFHQD4EzQrOsWI4N/nrY2uPg/eeefV8WvAKfALOsWJ3jzA++rcqjhB25OXAd244nA62AjV4LGxWLhIBk/oPiF8pc9mUy+BZVnyQEzueEZUb5yjyvhBiX6BCw2YTGvdZNyAkYPZsprT/rgO/K2vDcdQQH7jes7gPcv/kvqyCcKbEVX6PxVAG76QWPGPZAIDcEZqGECTQyokpe9wp8VfNqzyA2L9M+KRzm19l1i6ZQBAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-cruise-play:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ5SURBVHgBtZe7buJAFIYPjsVFAok3wBUlYcUDLNvQISUSDVVCA0IUYZ8gmzcgBeIiJLwdFau8QToaQKygovI20CJBARKX/Y/jICPAF3B+yRpjZvzNOWfOzLGLLKrZbAaXy+WdKIq32+1WcrlcQe0vZb1e/8XvQT6ff7fyLpdZh0qlEr+5uXne7XZxMpciCIKMSfzGBBSyCwVMAqxpEXYEhzdeAJYtQ2u12h2aJq4gXadSLpf7aQptNBoPm81GJofEsc5ms9/0zwT9j3K5HHUSyEJ4ovV6vXkSyjHEyvxDXyCAHxGy4hEUq+4JjWQ02O/30xV65rTbQ9lKNEWjEYFAgFKpFMViMbpQnOfFPRSKWxnldrtVaDqdpnA4THalefMDinx8sDOYrY7H45RIJOy6PMibjch3F24AJEmSeo3HY+p2u7RYLEzHwNqogOUcpSvFrk4mk5Zcjry9FZCX1+46qj5dzvEOhUKGfQVyWAyPRCLqojsnEYtohpiSE5rP59TpdEhRFMN+Itw7Q3DpGq1WKxqNRurF90YC75+gnXszulBsVbvdpl6vZwpkwasDNWVw9r3BWlu5Op1OVdBkMrEzTD11RO1exmUJytb0+30aDodkV7DyjT2rBpNrG8zg3WwQW9ZqtS4CatASt/sVhAC/GA3glWk1bqcEo+TPwm0P5QeYySt9jRS9UQe54vF4fqEZkMNCdXivrw4PoJlMZoad5IeDYE7F+0KhcPC+syVotVotIQ5PdLm4CD8CGkJZfAIhzlw3SWRdM+T9q9frLbHnTnUwrfBZfPCiecQG8v3MBHj/HvAm4/P55HMwW1C9tG8a/RmsGH1CnNJ/17UakVMOx7kAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-cruise-pause .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHySURBVHgBxZc7bsJAEIbHdprQJAU1ckln3FM4J4jTIkSMRB9uQDhBlBPECIk2yQ1MSeeIxg0KZQoKKpSCR/4xtsXTNmA7v2ThHe/ut7M7O7sIFEOGYdzO5/OSJEn3KGp4ZDy33ucxP6vVqo86H71ez47qT4iCLZfLJ0EQmhuQKNlo89rtdk06FVqtVjV49kZrr86RicG2TdMcx4LWarUWGjzT5Rqjn7tdsJAi8Ch4C4op1TGl75S8GKwCPOWC6FsRNDKAL5SOZER30HcAhbFFEUFTLBapXC5v2fL5/J7tiOCXofHLlVfikRhRrSqVChUKBXIchyaTiWtrNBruYLjM9jB5jlmup4vFQqMYyuVydKE03vsuVBTFR8pIcFD317REGQlRXBJ5PSl+iktCskgZC57eZA5l/Q/Uy4lTykjYq1++p5EHb1LC9rRdKA7dT8pO64yERG/SmVM8m81OqW7yckr8Ztv2r6Io1whnLawF59fhcLiVY0ejkWsfDAYUJfRfB+snOE85J2KRvym9RGF2Op06vwRbhg9YHgmlIz7E235B2vwC1x1VVdl7jZLT3nVF2q0BsJUg+ODFTDpU0wP3PfC5a2wB+BD7CuqLgws/TQQYn7cyxYfxfdc6ViEUujMAHUlER4cKHfhbATvPjBUG8/UH1xXJDxHoYGQAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-cruise-pause:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH/SURBVHgBxVY7bsJAEJ01CAkJKUhUULmiDSnpoKYINyBuQIgi3AA4QZQKIQq4QaChhhuQCxAXSERUSDSIb944axSS+CPA5kn27o7X+2Z2dz6CXKDT6URXq1UqGAw+Hg6HDB4V4qj8rAsh9N1uN9rv971KpTJ2Wk84kW2322csVv1BYr+gEGMo8Foul7uWc6w+NJvNjKIoHXRVOgMg74K8AXLdFWm73a7BujpdDh3rZH8TCw8JLYlPSFutVh7NG10feigUetA0bcEDxZTiDFU0L+QN1M1mc1z7SBoIBGrkcGkSiQQlk8kTWSQS+SP7D3CzJ76c3A/yi61kodOP6XSaYrEYzWYzWi6XhiybzVI8HjfGLLeDNGxoWpohF8C50CXgwMK+r0gNCuQTENnyitQgRT4BQSOlyFvrKsRdCapC/uPuFqR0G1IZExfkH94NSzkHkk+Ap4wNUiTqPvmH74gUDoe7dOYWr9dr13M5sfNxBnjQ7/dXuVwuDGHG7ieOr9Pp9CTGzudzQz6ZTMgJ2FFtMBh8HvMpx0Ro/UEeBQq2slgsatw/uoxMsBp5A64WG+bgxE9LpVIPpUWDrgv7csUE4nEdlWCNPCC0JJXEF5Wg8MchHs11CWpCVvZVkBfckksyrneHVnMEuQRXitiqPBS4lwpEJYmORkc7Qju0IzPxBZ2t+3mW/JtqAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-fog-open .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKgSURBVHgBtZe/jtpAEMYH28WJioIa+URDF8MTkAalO6cH4YIiFbk8QXS8QO6oUlCAkGjDtTRHJBoa4nQ0KBZdJApoEAV/Mp9jkAF7bXPcJ5ndtdf725nZWdYxiijDMBKr1SqhKIqKNpdms9mcRxkjFqZTsVjMy7J8x1WdL9WjC6D97Xb73G63m0HjxULAvnI1T+FlMfxBBPeEwoW73Q6we7pcViwWe8+utwKhDFQZ+IOrGr1eAH9ksOkLdSz8Rd5xu1RzBmfdFkvupwz8dmUgBENeYNAZtFQqGVwY9DZSnTVi6+Decrn8h0JYWSgUKJfLHdrL5ZKm0ykNBgOazWbCd9nNt3CzgoZjpUohlEqlKJPJHN3DJHRdp16vR51Ox/ddTiVkw70NlSTp7rRDMpmkWq1G4/HYvmANSpHghXg8To1Gw/M5W1oGVEZD07TvXNy4O8Btw+GQFouFbV06nabRaGRbhbaf8AzvTiYTr8c32Wz2p8KrSuMgJ7x6IEa4AIuivau9tNlsNGm9XqsBY9gxhOvCCi728wa7OCHhRzQAZl2pVGyXRZEoBAoFCDGs1+v2QooiUfpIHE+LBEL+VatVezVfDcp/whYJhAWBVHFvCEFCfz8op6cpORuxJRokajz98tSRae+97OJnUS/RanQLkwNQ4FrzsA2yyU0Gf/br2e12A90LlwYAkS5Pdrm/wRs+/rh1ChAshuV7wTqAQoTAarVat6gorll8YWvzXBXmbdTUcY3/sK/L+4ppmnPeF/9SCGsvAXIsH8+gDthkMFyepyuJgS0GHh3w5NNOzO0zeMHVD/R64BMDP53d93vBORW+0GVnpvmpS0NBXXDDSacwR9K5kxaPok+NUJ8VDlzlQucJvKNj63G2/U3/E78fZqx/rk0w4ggu8jUAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-fog-open:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK2SURBVHgBtVa9jtpAEB58/EqArqCBBqehorgTVDQxPVJOiD5QAEJUeYLjniBcgRACKeQJQsQDBBoqkIigookraC1BwT+ZcQBBsNd7Ovgk2LV3vd/M7PyZgBPlclnc7XZPFovFv91uRZPJdL9fktfr9W987udyuRbPWSajDUgm3d3dPSOhBMaQUaAXu93eSKVSCryVtFQqPaBWXznJNMlR8zo3aa1W+7zZbIo4vYd3QBCEQjqdfjEkrVarzyhlAa4EvOt6JpNJ6ZJWKpUnHH7A9VHMZrNfLkjJO9Ecv3Aqwg2A1osevFs4vCQP5SF0Op3g9XrPflar1egzut9vCNVHzPS3j8EkcCAcDkMgELh4PxqNoNvtwmw20/tUXC6XSRyLqqZ7LS80CgaDqiY8IEESiQSIoqi7B53qE40qqVYsolTgdrshEokAeh9IkgRGIDPTPhJYC8SD4eg3k52RQNQi7XQ66txms+kepEUcjUah2Wxqrq9Wq6h5Pp8/4CUzD1osFuqPFwfnIsE1IBKbyDqANIzFYhCPx+EtYPmCGQxAppJlGQaDAVwLaFlBgRtAx7T/SNGNZWCg1WqpoeP3+4EX0+kUJpOJNiEqKWA49HGusA6gwPd4PMCLXq+nu4bpsK+6LVV9YMDlcqnkPKD7JyF1oFD+PSSHV9ZB4/EYQqEQGGE4HEK73dZdR+Ua6nh4gWXtD3AkfCL3+XzHZ4pfyrekIQnHApr2A2oqn4YM1TvDWkr3xbozPVAxJ0KaH1MRFllSvQG3gYztz7FtOct/mLqorZDhulD2BVzWJKW2kTZckVjBnviM8IKUQBtQ40ck/w7vAIUhnvGYz+cvwpHZbGNHkcQMwtXGnICs9YrCF/Q2GHb4e3IJBxLgo44ACsY6afbT4XDUWd09N+kpqOhTDT55Jf9/Z0b4C/UJLQCcLGi1AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-fog-close .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIjSURBVHgBtZe9UsJAEMc3l1Q0WvAA2NEp1MyInVbGnoE8AVrSqW+gT2CY4QGwpTEFNcaOEqksKKiYcYYP/xsSJoRwx8f5n7nRu9u73+7lbu8waAc5jnM6m81sIcQlqhcoOZTTsHvAZT6fv5um2XZdd6Caz1DBMNm9YRgPMYhKHhx8brVaHu0LrVQqNjx/2wOWlAtnn9MiT4VWq9VHDHii4zXAPFdJsPGPwK1gIwHk7/dC+sXgAsBjroioFZsmpznCuHKLxeIxqqwirdVqvGmcbaOy2SyVSqW1tuFwGJTRaES7CEGd8TJbXOEo4YkjG8BQ27ZT+7rdLrXbbSUcx4+P3oOIVQ4Wr0Cj0aBMJiO1Q6Q1PvsirFzSkeKVqNfrKjM+8xeCybRMbUcrn88HRSasqs2R5kijisWitB+reiKm0+mhaS5VvMwqCdIs1WYKoJZljUmj+NwqobS8D7Wp1+tJ+5EPvkWYD33SIE4S/X5faoOHgCdC+jsdKc5GnJUUGiNIzwrpbjwh76tOpxMAJ5OJyjTwKp7wP/CnvM06LeFzdPwNd4AFihL+Chom/U86/HmiAr4CGOR4M2r0fX9cKBR+8e816deg2WzeRJW15ABPXvgxRXoVPFfiDWbSAhF7iJiXvUyagMmHmZlmGYK/aXn7HPSNAWui3AH4s9EnG8ibiy94DL6l3W8jL3zvetsMpNCEAw4cKGPCc9r8WeGj/YuBMlikP+yn3EGZYjlWAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-fog-close:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAI5SURBVHgBxZZLjtpAEIbLjUFih8QFnBUrJCIOEHOCROIACStALBhOMMwJMlkgBCyYnCDMCUJWrJCQYB+zBwkJFiBe+QvZyEz86IEezSc1dj/w76pyV5dGEnS73cR6vf4SiUQ+HY9HE0MJu5GmaSNcFrvd7hn3vXK5bIU9TwsTw8Oqh8PhzhGRoIf1tSBxX9F2u12FVfVXiL3ksVgs1khWtNVqfcfljm7HgtW5l1Zrbyh4Fo7FYh8LhcLCGRDu2U6nc69YkDG22+0v98DZ0mazaQgh/tLbUUOMHy9E8eH8treDJ8lkkgzDuBibz+c0m81otVqRBAu4+QO7WecerDSDBB3RbDbrOTcej2kwGFAIvNc5dPVTTLHpv9INpNNpyufzBEsC1yF81dOVf8KslCHIEy4SjUYjIxDLDDoGKYAtDrNW13VT7Pf7azOOJ6lUKnAeySLB7jVIIezmMAS9A/igxIIUwns3VBQ+HpFCLMsKnGcjhX0CKLF2MpnQcrkMXIPzuX+KKax9phthtw6Hw7BlVqVSGel25wntqqy02WxOFnLj+xB6/HNTwmdXTqdTGTHmfKA7lhKSxAOCbPr9g90n82X6AcGfTgVxUTngtKlD+J4UAw/2S6VSzulfJAe8SZ3fiNRiQbTgHvgvI0H4Gxb9IAVwTexVmHmmQbiCD1suHy26En7xaDSa86p/A4ttrpuIT3ohpLcTxw/tAWJ9vzUaSWCLm3DXZzS+z7hELFzYjX/i8fiTu9T04x9LgQk+PbvDKQAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-wiper-open .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALxSURBVHgBtVYrrBpBFJ0FFAqBqCIrUXRBk5QaUleewBBIlwSDoW1CUlzz0CSlaJJHA8FgqMBg4CWIKkpRuEfQCDAYAvSeYYfsLgss6fYkk5ndmXvP/c1HYjaQTqdjbrf7PQ0VarLWgBW1Cdput3tutVrdW7qka5OZTEZ1uVwfaBhj9jDf7/ePzWazwe4hVFVVPhwOT3cQnRFLkvS20WjMzRMuCzKFyH7/AxkAg18oQp/ME24LsgENfcwBkJfvQqHQejqd/jr905HJGpnMHIYW3iHGp5AS2df/QabpfiKHfCdCVCN1qh1hv9/PIpEIi0ajLBgMskAgcDZfKBTMYjJVL8+nh7MeS/8ioFiQbDYbtlgseA/lXq+Xt9lsxrrdLkulUmw8Hp/poLB+JC+rkpa7FysiKEokEpyo3+/zBiIrr2EU1kKmWCxariMvsy46IRJWZFBSLpf5GApgvZUSYLlcstFoxMfwHnKQN4Mi+cYdDoe/IGpmslKpxJV0Oh223W7ZLcTjcb6uVqtxLxFayJtkfSga2Sycy+X4YnhlBzAQhGI9euTRqnhAaNjkKA5Unl0yALlD0SC0Au12m/fIvx5nRxsEYV2lUrHMgxmiYMwGwmiE1qzDrSiKSv0r8QMxF2Wdz+fZer3mhXAJCP9gMOCGAiBJJpM8h6jqXq9nWO+hLfGH9ohiVoTFIEbxwFqECMoQInwLy4V3mEMe0SB7YWtMJJzoVK7fLnkgKg65BVBM8Bj5gjHwDORoGNfrdUMu9SDnfl7d+HqAEArFCYNQYoxtAODfJSIBimTWpV2Swxt8PLwiRAgjGrwXuEVGmBNXw6MxP5KXMWYTCKs4U+2COH6g59tCu6uG7A7AYxteCcypVU+EmgVZbcJxkO4HcmplIEQuMcGOTz8nyT6T7on4Npw0mMBzgDnkqUZWNfyzWujQM/FB79lVQh2xeudbZ0VE36mvipzdRagjjtFtnSBlr9nxuS9uGCidk1HPdFp1xcvsGv4CcbeEIeSIw9MAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-wiper-open:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAM0SURBVHgBtVa/SyNREJ7dBLVQELU4bdwrtFJOUCxsXEG0Ue4OK6tLKhEb/QsO/4LzChVtvGvE0sPOxtiYJuFyJBBICtOlSSAQCEnIj5tvyC676ybZYPLB4y373ptv5puZt6uQB1xeXup+v/9zs9lc4qHxK621VFAUJYbRaDSeDw4O7rvZUroQBXw+3zcm0ckbMkx8enh4+It6IWQijYlueiByI95g4oxzQXW+OD8/X1JV9e87yACNbbxeXV0dOxcUJxnn6okfx6l/OOHcnr0hhIzsFcg06jNa8obwbErKOfs+CDIhUdUbxrhJiGrknAW8HB4bGyNN02h+fp6mp6dpcnLStj46OkpbW1vOY1q5XJZ8iqTX19dPnYpkZmZGSObm5qharVI+n5cZ5ENDQzKy2SxFIhFaW1ujTCZDqVTKaabA+z4qrdy9uhHB0PLyskSTSCRkVCoV16gRLfYODw/T7e2tOOQE5zKocmRf3Mggzd7eHvEtQnd3dxSNRl3JgGKxaEaE6HEO553gOllXuQ3W3ch2d3fFyMvLS1siKxYXF0XWh4cHOYfzUMgKpE1t3Y026LouhxCVF8DBhYUFcz9m5HF7e9u5VUOV2pp8dnaWpqamPJMBKysrEh2kNRAOh2VG/q14c7XhILzb3993zYMT2IOCcTo4MTEhkqKgrPCx1gGePxgv6vW6EKJYNjc3qVQqSSG0A+RPJpPiKACS1dVVaQ9UdSwWs+33c6n+47ZYchqKx+NCvLOzI80NiWAMEkFyeM75lx5FdFhD4SCXIEJluxRbTLm4uDjmcv3RLgIYgrfILZBOpymXy0m+UImIDLLCATyHQiFbLq1gB/90bHwrcNPAILwGAaREcz8+Pso6CNsRGZDGx0eS8xXqRgh5DYkgIwZuFQPdyGACfwJ+PHGhnHKUOnkEetS4U72Co/uNWdoC3yovUVqBiD1EZW4fGRk5MwkBjjKIBRoAarXa12AwWLARIpdY4McC9RcnR0dHZjPabhosMOkG9S9S2/8MMLDfRKhljawjoYU4wNXby79OgavxJwrEyFlPhBZinasYH+pPPOMaNL4wMJphJZ553Bt/Zp3wHwTYnvHjbDCuAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-wiper-close .jb-pro-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANOSURBVHgBtVc9TCJBFB52r7jYyCXWnhcbO1aru8RErjGXWBxX2BijGG1svNhJo56VhQU2ViQsgdDQYEFDc5rQ0BDoaMgRGhoKaMhdCHDve+6QZVhgMfglm9mdn/e9v3kz6xEusL+/79c0bcvj8fjpc8V6gCY9VXqK3W73MZFIpN3I80wj03X9il79wh2q/X7fJAXvTdNszkQaDAZXaHF0BrIRcvLKERE/OQ3qYwh/06shXg8vRPl8PlEqlZ4nktoIV8QcgBxwItbfitBOvL6+XioWi2XZp8kXIryaN6FNdpSM8spvthRWUmPaJ25vb4vV1VVRqVSGBCwtLYm1tTUeW1hY4KfVak2hFe+J+B+5+QkfnL2Hh4fI1KAq/OLiQlxeXorl5WWxsbEhNjc3RbvdFrVajVvMkcTlclmk02nRaDTGETfJ1Z+wlTxWLP84zQoEAkwEodlslh+QqZDWY36hUGByp3m9Xu88Ho+HNaokfidCCAIh2kgkMlYQAOtyuZy4vb1lBW9ubnidCioa37klkw0nQrgWgpLJJMfXDUAOBbEO66GAAkOS+tSRk5MTXgjr4FIAMXULrIObz87O1CHv8fHxR03thXAkDhbahezt7TlpzkA8sc7uUngIQIhUgNRr70AWQsu7u7uBEPTBdaqboQTcCIUgXL4DUBzjTrHVDcP4BmVlR6fTYVLg9PSU9yC2CIghEG7HHIC2GluJOGYyGR6DYiDCGEKD/iErNS2sU238QnH9rGqDopDP5zm+EIJ3aL6zs8NEUAKCQSiVwxp4BFaHQqGRwkJoRqPRkEZ7tCjGAAJQHED28PDAVkirsX1kUcAc7FEXWc5c7+iQTltnpyMgHNYgUSSZBL5BhqTBHkVMAZnxKsijMbQ6Vf+/FFe/mFLs6/X6IJZ20t3dXXb34uIihwFuTqVSI3Mt0nPia3LtpVLot461V0FWLiiBZwzMWCx2xOSy5+DgIEya/BRvA1xfvlKxr+JjUBwola/Fy81u7iDCX5JwiJSPHNJm3sQWoTnUp06a57XFIrxW+0dug8guutM8EvEHpxPIJRDDH6qFA2UmrSSrg0SO5HJLjhDdUxue+bLtQG7QqR8ggVvC4beCFHumRMSxVJxEJvEfnFm91YrgD/sAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jb-pro-container .jb-pro-ptz-wiper-close:hover .jb-pro-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANwSURBVHgBtZa/SyNBFMffboJaKAS10SZ7hXqFegGbCyjmUPTAH3eHlZWmULG6u/Kqi/9BLEQRIdoKigf2l1Q2ChGtBLmtFAQloPgL1HvfRyZuJhuzBvOFzezOj/eZee/NZAzyoMXFxYjf7+99enqK8GNxlZVtyhiGYXOZ5vo/MzMzW17sGaVgPp/vN2DkTbZpmqs8wfloNJqh10AZZjEs8QpYAfzx8TE6Ozub9AQFkGf7l55dWLbYTmxqamruRehbAl8CG5UEOvTNmWSmekHCVAgIJVgB9eHHD1bJSTPp7NXe3k68Hejg4CBvdF1dHTU0NFBVVRVdXl7S/f09nZ+fl2BS4Pb29geXMXyIe5eXlxM6FMaHh4dpY2ODGhsbybIsamlpyUFQog/geE5PT2l3d5eurq6KgTPc7x22kpGN5T+3Xl1dXdTa2ipGDw8P5bm7uyvoB3hTU5P0t22b9vb2ZFIu+smxjSOmEbfW2tpaAcJgMpkUQ25ACG4+Ojqi7e1tqq6uprGxMRmvi8P1BaXJLyE34MjIiBja2dmhzs5O8iLAMUGMw3h4yCkOobDYs+YHfXAkEpGBWJ1KJMTUqzAObh4cHNSbAisrK0FTrw0Gg5I4GKiEBAmHwwUzV2pubpZJOV0KD0EIkS6TlxxwViALMcvx8fGcEdQhKzs6OvIGYxLIcEwIxuFSvEP19fXSjpzQ5RsdHf3M5XtV8fDwIFDs0f7+frq+vpYtAjAMwu3oA/X09MgqEcf9/X1pQ/wBQhuyPZ1O56/SNOO+oaGhMAM+6rM5Ozuj4+NjiS+M4B2ZGQqFBHRyckLd3d2USqWor6+Pbm5uZAySqa2tjdbX1+VbU2Z6evoX3JumIoIBHA6ATUxMyCl1cXEhQOxD1ON9c3NT9qjufl2K5a+pqdliA4liHWEc7kOiwMXOvYpvwJA02KOILwS3FoGuoTTlWDKMJJUQ4qwfDmoyAwMDkkiYIBIOsS2iJH7k7MW1JPu3VpbUyYWVw91u4oWtcjyjOSi0tLQU54bvVBnh+vKJry82PnKHAydFDI1UATFwTgHzoIgtZvPW4Cxw1VlX0YtZFhjT6wvOXrgBK+ZnjcqXimHMrbHUZXuSV43kCpE3IUTzvPfjr75s61pYWAgx/Ctndy9/WlxaCsKPzZs+xc8Ww9IvwZT+A8hTw5fcMmXrAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-ptz-arrow{cursor:pointer;position:absolute;width:0;height:0}.jb-pro-container .jb-pro-ptz-arrow-up{left:71px;top:15px;border:7px solid transparent;border-bottom:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-right{top:71px;right:15px;border:7px solid transparent;border-left:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-left{left:15px;top:71px;border:7px solid transparent;border-right:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-down{left:71px;bottom:15px;border:7px solid transparent;border-top:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-left-up{transform:rotate(45deg);left:32px;top:33px;border:7px solid transparent;border-right:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-right-up{transform:rotate(-45deg);right:32px;top:33px;border:7px solid transparent;border-left:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-left-down{transform:rotate(45deg);left:32px;bottom:33px;border:7px solid transparent;border-top:10px solid #fff}.jb-pro-container .jb-pro-ptz-arrow-right-down{transform:rotate(-45deg);right:32px;bottom:33px;border:7px solid transparent;border-top:10px solid #fff}.jb-pro-container .jb-pro-loading-bg{display:none}.jb-pro-container .jb-pro-loading-bg,.jb-pro-container .jb-pro-poster{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:100%;background-position:50%;background-repeat:no-repeat;background-size:contain;pointer-events:none}.jb-pro-container .jb-pro-play-big{position:absolute;display:none;height:100%;width:100%;z-index:1;background:rgba(0,0,0,.4)}.jb-pro-container .jb-pro-play-big:after{cursor:pointer;content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;width:48px;height:48px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVHcEzMzMzMzMzNzc3MzMzPz8/Nzc3MzMzMzMzMzMzMzMzLVn6fAAAACnRSTlMA+duduRUwSGSD8toSsAAAAI9JREFUOMvV07ENgzAQhWG3lLSp6MwCViYIRSpG8AiM4FWMaPymDBKESMF/cQ0S136F353vnLuo3gp1kOYEoCXW4LFKIZAnqAXYICeASoAdzgG+cApwgF4EfwF+oDkCqIwA6gnyAKA8AaizQhsBAjzuqUHofInGIQbjRxXjMrTJuHDestR4Bng4eGrN0929PqNfzC6h06weAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-position:50%}.jb-pro-container .jb-pro-play-big:hover:after{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEz///////////////////////////////////////////8Uel1nAAAAC3RSTlMA+rbVFUecgC7rYhEEz+4AAACbSURBVDjL1dMhDsJAEIXhdeiGpKYWQVKDWc8ReojFc4ReAlPFFQazad7lIGkb0jK/WEPSsZ+YN5mZEP5UrZIP0vgE0Kv3oPlIJlAk8AJM4ASYwAkww2+ABfQg0ImgugPYsfNBVl99kA0AsjOArAPQpRTGHiBB8whxM0y+3skXNltsvMYriIWrpWPA80mFJ5qL3gAfB1/tcAt7rzdiV+HEgs1oBgAAAABJRU5ErkJggg==")}.jb-pro-container .jb-pro-recording{display:none;position:absolute;box-sizing:border-box;left:50%;top:0;padding:0 3px;transform:translateX(-50%);justify-content:space-around;align-items:center;width:101px;height:20px;background:#000;opacity:1;border-radius:0 0 8px 8px;z-index:1}.jb-pro-container .jb-pro-recording .jb-pro-recording-red-point{width:8px;height:8px;background:#ff1f1f;border-radius:50%;animation:magentaPulse 1s linear infinite}.jb-pro-container .jb-pro-recording .jb-pro-recording-time{font-size:14px;font-weight:500;color:#ddd}.jb-pro-container .jb-pro-recording .jb-pro-recording-stop{height:100%}.jb-pro-container .jb-pro-recording .jb-pro-icon-recordStop{width:16px;height:16px;cursor:pointer}.jb-pro-container .jb-pro-zoom-controls{display:none;position:absolute;box-sizing:border-box;left:50%;top:0;padding:0 3px;transform:translateX(-50%);justify-content:space-around;align-items:center;width:156px;height:30px;background:#000;opacity:1;border-radius:0 0 8px 8px;z-index:1}.jb-pro-container .jb-pro-zoom-controls .jb-pro-icon{vertical-align:top}.jb-pro-container .jb-pro-zoom-controls .jb-pro-zoom-narrow{width:16px;height:16px;cursor:pointer}.jb-pro-container .jb-pro-zoom-controls .jb-pro-zoom-tips{font-size:14px;font-weight:500;color:#ddd}.jb-pro-container .jb-pro-zoom-controls .jb-pro-zoom-expand,.jb-pro-container .jb-pro-zoom-controls .jb-pro-zoom-stop2{width:16px;height:16px;cursor:pointer}.jb-pro-container .jb-pro-loading{display:none;flex-direction:column;justify-content:center;align-items:center;position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;width:100%;height:100%;pointer-events:none}.jb-pro-container .jb-pro-loading-text{line-height:20px;font-size:13px;color:#fff;margin-top:10px}.jb-pro-container .jb-pro-controls{background-color:#161616;box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;position:absolute;z-index:40;left:0;right:0;bottom:0;height:38px;width:100%;padding-left:13px;padding-right:13px;font-size:14px;color:#fff;opacity:0;visibility:hidden;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:width .5s ease-in}.jb-pro-container .jb-pro-controls .jb-pro-controls-item{position:relative;display:flex;justify-content:center;padding:0 8px}.jb-pro-container .jb-pro-controls .jb-pro-controls-item:hover .icon-title-tips{visibility:visible;opacity:1}.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-face,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-face-active,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-fullscreen,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-fullscreen-exit,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-icon-audio,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-microphone-close,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-object,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-object-active,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-occlusion,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-occlusion-active,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-pause,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-performance,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-performance-active,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-play,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-ptz,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-ptz-active,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-quality-menu,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-record,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-record-stop,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-scale-menu,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-screenshot,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-speed-menu,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-template-menu,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-volume,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-zoom,.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-zoom-stop{display:none}.jb-pro-container .jb-pro-controls .jb-pro-controls-item.jb-pro-speed{padding:0}.jb-pro-container .jb-pro-controls .jb-pro-controls-item-html{position:relative;display:none;justify-content:center}.jb-pro-container .jb-pro-controls .jb-pro-playback-control-time{position:relative;justify-content:center;padding:0 8px}.jb-pro-container .jb-pro-controls .jb-pro-icon-audio,.jb-pro-container .jb-pro-controls .jb-pro-icon-mute{z-index:1}.jb-pro-container .jb-pro-controls .jb-pro-controls-bottom{display:flex;justify-content:space-between;height:100%}.jb-pro-container .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-left,.jb-pro-container .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-right{display:flex;align-items:center}.jb-pro-container.jb-pro-controls-show .jb-pro-controls{opacity:1;visibility:visible}.jb-pro-container.jb-pro-controls-show-auto-hide .jb-pro-controls{opacity:.8;visibility:visible;display:none}.jb-pro-container.jb-pro-hide-cursor *{cursor:none!important}.jb-pro-container .jb-pro-icon-loading{width:50px;height:50px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8BAMAAADI0sRBAAAAIVBMVEVHcEx4eHh4eHh4eHh4eHh3d3d4eHh4eHh4eHh4eHh4eHiqaCaRAAAACnRSTlMAikwX3CxpwZ7zIGi5xgAAAZ9JREFUOMt9lb9Lw0AUx2Njqm4iGEqmEnBxslKUdhJctFMVcW5wKZ0CLpJJQRw6iVqQbg3FtPdX+l5+XHJ3796bQj557773fe8ujtOI+6jz5p84dHjTkYD4+RhT9CIRZWRPJr1bChnbY532GhT4oUpbI6HEuqvgIH9544dh9J4/rpr0Ms8oV3zMNT7X1MXSmaznzfHjM4n72moe5n8ryYrW9rKRvgf0S93JA7yKa9lbzUg3keJb8OVCtwkrFmoO4MnsAuj5rGqnZg+GZXUXkl9NjEui9n3YA9XgpMgakLXz6ujMTIgrCkPVv0Jil8KgKQN/wRN69hLcb1vrbR2nQkxwiZTGQ5Teb7TO8PUaS8Q03sE+zkjP8qbjzgJtEhRbV4gnlkOFeM7hDYNdxPbiYFvKSHN6L2NmY5WzMYPtplZdTxncRvn2sI+DHIoug22jWMaA12Y7BrXzrG8BX32XPMDKWVzw1bdMOnH1KNqNi8toqn7JGumZnStXLi0e4tcP6R3I635Nc/mzsMxl9aux9b78UVmn2pve8u6eR50j9c0/ywzyVl5+z84AAAAASUVORK5CYII=");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;animation-name:rotation;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite}.jb-pro-container .jb-pro-icon-screenshot{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEzMzMzMzMzMzMzMzMzNzc3MzMzMzMzNzc3Nzc3MzMzMzMwv5ahDAAAAC3RSTlMAW+8S2UGVwyyZnOTRhEMAAAEfSURBVDjLzZKxbsJADIYdBQpsSCyVMlXAdEuQYGKpWFk6dWHJgsQ7sMDSpUv3PgITAQT0f7ly57ucQ45KXRAZot+/89k+X4ju9KzL4XOhlm3pR0enYrWViSRPXQIQSASkRSkIJEFRimYCuQAHSW89IOv6SH5TCsuAj68Ab1wDzqkAzqoC7AUAPtgsABgkBBgkCJiNHehGok//KRVsHqd+3Dj1/vukt3AH/Jj05s5/AmyZhFVWXDls44iVvfQWkCvgxU6g9ZdJfCLvjJbYaT3GvjOY4mQSG3SJGjhr/Y1Xohp+TGKqqzexZ/1GVGdNCitt6R8zVvb9d+JmKdl8o5sPWbtxT6zFuJcDQtk92MNmYiXHquYlZlVt1j4P6cd7fgHFW7Nhqu29TwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-screenshot:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEVHcEz////////////////////////////////////////////////////////NXt0CAAAADnRSTlMAWe+X2TINXUYZvctoYyuS2NgAAAEVSURBVDjLzZKhDsJADIZLCAsEg8WgEGCWGSwCgZxB4MgEAonB8wQEXoBH4BEWXgPJgEBG0mdgR3u77raRYAgnlq+9+/t3TQF+dKbZcJXSYSnzlViT457lRScKmBqILSFA3GoO8S4E+Ex5JiSJ4CbVdyOQdZNomX9D4dl+ko3NC8vFFmhPy8FIsi0ZlwLBW/LY5BxYYreUSgoFAEmhB5Rc9OCbUoXmTmDadQKTn4y6A/XTaoSKdb6KyGU6RJ7eHgpb3ABinAoil303xB6vQnRahNhXvMdre+fzOgxVrokX4jHAnBh8PALU8Eq8BqgTg/vePF8tpuPy9/NFaalSc273RizarYqfkswjifNMQ/TyTGMv4v87L+ks5gqDbc9OAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-play{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVHcEzMzMzMzMzNzc3MzMzPz8/Nzc3MzMzMzMzMzMzMzMzLVn6fAAAACnRSTlMA+duduRUwSGSD8toSsAAAAI9JREFUOMvV07ENgzAQhWG3lLSp6MwCViYIRSpG8AiM4FWMaPymDBKESMF/cQ0S136F353vnLuo3gp1kOYEoCXW4LFKIZAnqAXYICeASoAdzgG+cApwgF4EfwF+oDkCqIwA6gnyAKA8AaizQhsBAjzuqUHofInGIQbjRxXjMrTJuHDestR4Bng4eGrN0929PqNfzC6h06weAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-play:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEz///////////////////////////////////////////8Uel1nAAAAC3RSTlMA+rbVFUecgC7rYhEEz+4AAACbSURBVDjL1dMhDsJAEIXhdeiGpKYWQVKDWc8ReojFc4ReAlPFFQazad7lIGkb0jK/WEPSsZ+YN5mZEP5UrZIP0vgE0Kv3oPlIJlAk8AJM4ASYwAkww2+ABfQg0ImgugPYsfNBVl99kA0AsjOArAPQpRTGHiBB8whxM0y+3skXNltsvMYriIWrpWPA80mFJ5qL3gAfB1/tcAt7rzdiV+HEgs1oBgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-pause{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVHcEzMzMzHx8fMzMzMzMzOzs7MzMz4IlKVAAAABnRSTlMA6xIU1hVqIuOVAAAAMUlEQVQ4y2NgGFYgLS3RAEQziQFZoxKjEqMSaBJpEAkgIw1ZQlBQRAEs4QhkDeIMDgAWx1gMHyIL4wAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-pause:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVHcEz///////////////////////+3ygHaAAAABnRSTlMA7OgSFBXMmAA4AAAAM0lEQVQ4y2NgGFYgLS3JAUQzi6WlJY5KjEqMSqBJpEEkgIw0ZAklJSUDsISikpLQIM7gAJjhWp6XcaOxAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-record{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEVHcEzGxsbMzMzMzMzLy8vMzMzMzMzNzc3MzMzMzMxEZ/aQAAAACXRSTlMADPKKKeBxlV6neZ4mAAAArUlEQVQ4y2NgGDZgJhpowCURAJeYpIQENJEkCgWRgCeShAGyjfgl2EqwS7BFToZJiLg4ICTEImdOh0pwRM6cDJcIjpw5E6aDFeh8B5gECBCUYAkKCoMbNXNSOlyCgUEQ4apJJmxIEkjOVWFgxi4RgEsikGQJnEYp4pLA6VxUDyJLIAUJcRLIwY7qXKSIQvOHWCQODzKIleBPPjgTHM4kijNR48oGkajiYUMykwMAAfmZhUjBISQAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-record:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEVHcEz///////////////////////////////////////////////8NopmKAAAADHRSTlMA8gyMLeRw1x2DBpWGN2QDAAAAt0lEQVQ4y2NgGDbgDBpIwCVRAJc4KIgEZM4EwCU2KSEBHySJCcg29iBJGCBLgHUs24FdYlnNYZiESksDXKJALebMaagES8yZw3CJypgzZ2A6WIHOd4BJgABMgh2XBEtpaBjcqDMHs+ESDFyLEK46aMGGkEB2rgQDJ3aJAFwSUSRL4DQKp+VHcTkXxYMoEkhBQpwEcrCjSCBHFJo/1GIO408MOJMPzgSHM4niTNS4skENqnjYkMzkAEgzyFpeX6L3AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-recordStop{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAOVBMVEVHcEz///////////////////////////////////////////////////////////////////////99PJZNAAAAEnRSTlMAMPndsnZj1CSYPcmL6wsdoU80pOJLAAABu0lEQVRIx5VV26KEIAhMA++p9f8fezatFDPr8LSrjMxwiWlqzRuMYKW0ENH46c3WuGyVLXEduuO83UyK59fl1jX5EEUXD9DOaSh43XEP5zUIdZ4pAecTofVnWSt3ip4rx7N61vjnY1D30CpH4QQR8vsP+RA5Rs3KpjfMU/pMim/LgbvH7DF2F8sU0owqapKLqgnhuGWwImUagn2zhUX6WQQoYkXG9WxSAJd700/ygsCpAoliaDsPiG48GM1X5Ft/06sfp8DrDE+3DpekWjxM6366fgEcnklC+AIIWYQmPEeAaUmjFOnhCLDfxZRH+w1gU5b/DYjfNcyJ0p7dxX8B+FwxQVtvAGB5ig0d5gFA5KbzS91hI8CenvlHflfN/XvzJQnxbBEko1gbvVnPii+FadSVRUEaYylQfJtpLB+aRG4LY/80yKdUbCraM0lozGR4ewZ0Wtnj1iC7hjWKNnjYmR62W15cLlL3+2pyMR09jccyuyUrHKsvthc5xsY1iWJ0Xk3t+2XP7AnWwrAQmBH6asXubmL1Z5Lz6o992jWiu9lnMSiQsK27FS9NxhCumZgB2fTBPFsFolhZr5B/D3o9sJAI6skAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-recordStop:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEVHcEwimP0imPwimP8imPwimP0imPsimP0imfsimPwimP0imPwimf8imPwimPwimPxLmg1rAAAAD3RSTlMA15sisGUvdz3szYwMT8H+hDJEAAABx0lEQVQ4y3WUO08CQRCADxBQchBiMDE24KswFlw0Wtig/oHzUWglJBZWio3GDjUxlhhrEzT+ABMrO2iptLLVRluDggI+xtmdXW73LkxxNzvfzuzszNwZhhDzdOxqaPGgYrgkOgFczh90ezAJQmpL2v6OHYnqk2aWxOTtAnu/O/Y5XNZXmTZjo3ot7aESwLdFeqAM0MoJkMf9ltwVQJ9PcQN0UFIJogvdJgLQVFMsAlxyBaPmVBDCE8W7qd+2SDsx0q4OwhSrCG134W54jDfKLjDNxaL8/9AAMM/solptRnoALBbwEPWYrOEzLnrZsTGoMW+fBHG2SiLPUNI6KMOH8QS/XsCMBYQekIEv7NGZF/Rht2yqmA4i3UG9O0iTqgMfhirDhRdU8XJZqqEO8tDAqje8IIt1r+I5HmBjfD9AxQ1MgJQRpc6GJRALHOAS1WRlhMs4VaSFzwIWzCUF3op71kdNsNs/FDCuA58YqCQl7IhN3WbDnlLtfjnuON515WM17c7w41QPOuBIzDT5wqi0T4ESGV3gjtTjkuPATwHoX9+cPRlmmvJ57YAir2qKy459QL/UhrS/uAu3xf8KiX3DI+b22t6jc9F/qfaum9E1pJ4AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-fullscreen{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEVHcEzMzMzOzs7Pz8/MzMzMzMzNzc3MzMzMzMzMzMzMzMzMzMzNzc3MzMzMzMxdHBitAAAADnRSTlMA8AwGYt0aUcg+til5kgmZywUAAAGWSURBVDjL1VM9SwNBEB12IcGkMagxNktQSZFCYimIJAqKpZ3Vco3YBYs0NkKQgBg4ECtLFSFVCGgQrERBsLayPE0Ip7n5De73BdKLTrE3ezPvze6+GYDfsAQKy/Rz0i/OZJjY9XREuohTKulS+ZFGiADfyZXU5uHktI44VH5apDx554aXwJqloiIwiEsStAjCAsRNF1jCmGqa4Vc+BvS4JkjwzyPE6xiwzsxxeTbZxqjkANSWZFkoIj5bQBl4aBDfkPDNpeRRialB+SRAFz8UU1sAaEUjSCDoJ7iukZJ1V+c01bFczM1pWaa+a0Rp7MHn4V8Z1R9vLLCv9WjKdVFfk77JP+bZdz35YAfKXx6KhKp93abUYVbrj49g9aAYSuFCLbPUwzdCsYEWTloXgw1oGwQbENeuKwxzXhxwAADRMFd+zzRc6AAASY6RH8VjUHaXTrlOpDgCUP3gelc01e2d+f16cWbnQ46BGCRNVsWAWQJVw2xGfUXVv2k1OsLfazXqblzS99u1FwKFvBJioXBY2+r82U75Ab7O0ypVV0wKAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-fullscreen:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEz///////////////////////////////////////////////////////////////////+GUsxbAAAAEXRSTlMA3clDHfdfDQbsVG00u4Cqkr04dRsAAAGaSURBVEjH7VXLdsQgCPUBAROdjP//s1UTDUxsz3TRTc+wC94bHsLVmP9hkE8LIdvgupt2tFhcpy2CMZyVxNePEoqDp4hwEGz5PTqWoZNzLrmD9riltBEYzzpZQ8bweXy56Qy6Tivsp5JQYtawuMH3eJlSxIJtdSSa4xer4lMB89pK23mKrwjZVpsRzLq35vEE3+r26h6w5EKppcp3fP2lIpTPWJvoXoobeNI1sM3haHvx56tu2sdElJ54GbnPQ7RZ1sCpl8qPEMXBNQ8vN82jNbzLCPzGSDOZj/2Bqd19R1rELIEbDFrUJfKYdlALbDuDMko/hz7t8DqtCfr8h1Vt4rn7eh/6Ph37ch20aW8McsfGCOXzcr+GOlQG1rJ2HSHUDO/4Mu01qVAqTCpCJfgZ3phTS2pKm5aZOMUbs7Q6nk6L8UzRh6W78jH+gD/VRxHokPuNgUGTaPPR+zDR1mrlvcGgwkAVacSbeoN4Z0rb5/6XLrW/2GTLk2NhXHRKzrqAt9cD4rr4ddvae0NAYgOICdZyvPj4UYRf2BdfbB8iWvnTUwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-fullscreenExit{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEVHcEzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxi4XDRAAAACHRSTlMAf3WqJmy+7azWNnMAAADNSURBVDjLxZQ9E4IwDIaLfMzCOTDSOz07OjLir5CR0dmJFVHIzzZtnMzbOzcyZHnuaXpJWmO2ji4GhpAzzZeQzw8FKCj1pMHss9OgpwsGOS0YGOcVUMPsfBVkmJoVCBJW0FFB6SFIaMKAlRGDnEiDkuM00lP3SmL6H5QSh+iIr9ZWVWntUV9Z4qWbHAWrhcUYNLC4Wwm3xb1r2mOQYoVn2EKFAVb81KHiQQq6L3vSUoMBUmSzgCKbVeiL3eTp3Odf8H1sxRAZZNZt/Vt8AHcPQbiQQVF+AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-fullscreenExit:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEVHcEz///////////////////////////////////////////////8NopmKAAAADHRSTlMAe4Fzh7MZbKPtN8gpX19xAAAA3klEQVQ4y8XUIQ7CQBAF0CWhKQHDGtQKQFcURUgqEARBED0Aoqp3IKnoATAEW8MNOACmhQYKcyi6uyjmr+aLqXj56bSbVoh/J3HBxcw0ZfA2c3FiQLGeQcWh1lOVDDJTAeCbCgAR6QqCDj0xCEU5Bl2BIALKMwhdKjGILRUYfCIOEynlvABANk64M5jabJxHfJY2I76yzYu/ZCc0s1WbNYAQ3jxqwMoGHoqWGHpUQajEgcYYcKWFtjLE4FGJQewoxODRDQOqKPPcHl9sfzSXa/0L349tEDsOsp/8+2/xAY+BZBY9KhM5AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-audio{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVHcEzKysrMzMzMzMzMzMzMzMzMzMzMzMzMzMzNzc3MzMz8gU00AAAACnRSTlMAL0jMZKt96hGJsSKv1QAAAJ9JREFUOMvN078KQFAYBfCbJEw2q6SUyWxTnsJT2JTJ6D38Gb6n5PpT6BwbuaNfTnz3fEp9fZwAP7czD0MsGCzBYJcEYsGwBEHQQRB0EII1CMAWdAOzyJUvJ4jyDVyZVHKGpj9guEI2IuhaDFadYnCkIm9I+kPgn8t+kI7kOsT72HcwQnJR9Gofy8DrwwtHK8pLzdeALg5fNb6cdJ1fOjOGYrl5CLFcggAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-audio:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEVHcEz///////////////////////////////////////////////8NopmKAAAADHRSTlMAL0TQf2frEaZYt8E+idL4AAAAnUlEQVQ4y2NgoDdgUcAuzr4Hh4TaGQHsBp3BLsG+BoeE2hnsEkCDsEqADMIqATIImwTYICwSEIPQJFhnBjKInUGSUA2CSPCcOcIwB1ki5xRM4iiDDrKEzQlsEuUF2CVY0jbgkDhjMLQkEkj0IM4gQQ1EHMHOOXMiakRpTiQQtXgTA+7kgzvB4UyiuBM17myAM+Pgzmq4MyfO7EwjAAAEf+BAxqI/agAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-mute{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEVHcEzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMztXryaAAAAD3RSTlMAHd4P7ztyiy1OnKhdx7uY2gyAAAAB8ElEQVQ4y72Uu0vDQBzHE45C3SJFaSGjUEiRpJRCBifXokkpSv0DfOBrEKxUUSoFH9ClFAUfU7c4OARRCs5WjThIsJuDlLo4ldvPe8SYxGyCt1zgw+dev+8vHPcvYybvfCR2OgUv2CoLdI62bUn3gq5UJxOomZofXPUNrIChJRklfcDSiKK2bYQ6PiCaREk0EQoYPFYa3F73F+DGsBJLmAjBAMBKakG15KAxqIhd2KuK5reRccBDNbqGJhfSlnNc/kBh4OY+vaoR5QrRC0afKgxMrKdXNKI8yxRENpyd+i0VA6wMm5IOBmORCwfAFjGwolofevbuPrvpGhRgpVaqiJflrLuUQQFRToS9l894EMDe7q6yL7/G5wMATc5mQCiAvQo3HAbwLtyYHQZgTxhohgGUa/CP12EA16W2/Ou4ZEj1dNG9oPMkZGiwJWQ8j+huPoJy9Z/XHTfUFSbAURveCtE5px5vs7hQDKS25FSDn2KR5Up1/lRmIHne7BvKd82LMRJbSjr5M40lmaYZ5/PRpiCpizjJyk+CwOGOzACLpSdz02QxkiuRhd8dNOwkV7zl2YX1mcySKJrQiPkXY9klSt6rkJPRwIlmzrcWSGyzHuTb11V/N0y/S6SdwdCR4m/47OIN7XOQCfwJwHGp8IcfyRdBLEZK4Uxp6wAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-mute:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAP1BMVEVHcEz///////////////////////////////////////////////////////////////////////////////9KjZoYAAAAFHRSTlMAbk2o8o0P5TsGnVojFi/XHcV9urLaq0oAAAIQSURBVEjH3ZZZkqswDEXxLM8T+1/rkw0BuwM0f131+IvDyZVk6SrL8p88QCHp8UAnWmoWoG8AwQRN4/vOiqwUuwWqiob646MMhEW+KnMLMIXffgiZoODBusb7kCzjByF7OOszkOyp4amJ7fWVPwCN6BpyWRypvANPCvi7u4aTXe13YI+KkYA5bMRTSMlLnSyGwisSH40B0FJOrKVB6iAw2U7sGgPgQ/DTPQjitCOZT4Q6gWCtGwGFbSM34ENUNSpAKTACmC31rnRgJwjDdkFAJpfkAsZcAJvCSVQB2FaWWKdB/ATMAHwIUYL21lRBZRDiC5AnsBHBUqxEyaraFMoz0AnvHNa6xDWS34FGgNf6PYAEZoCt+BroUWFVbeb5HbCqSvB2cToyca+Adjlycdawt0C/HeyScl1W/w3gsU3aAd7JF8AuAN6isr7NAogXAFeq59Ec7ifAm49hF8wCMWfVNXAeCAkjEGuBr6R5ZGJzBrl4gGniBME+w8aMMyCsNZtfaemnmYaAQ6I3Rz0fnDhHJxc93Vrr7sHWjP3XRtTba2L3EkdFVaPC6YmXxKI9DGF1YPLdiwfD2r37cL5nDVw+uKzU5K27hsXCXPtyC2uyyl0D0p2TY7VaIvFYWU0Dm8TdOXmrVp52HG4lU4K/N38PpS/Kw70dbmb/sC0WCcQwNNzzjrzUj7veUyIIyL/4m/EP8V829O8zh5EAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-ptz{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAM1BMVEVHcEzMzMzMzMzMzMzMzMzMzMzNzc3MzMzNzc3MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxDm1AzAAAAEXRSTlMAHqw+E8It/gjxc03jhGDTlgAjE2kAAAI6SURBVEjHpVbZkoQgDBwg3Of/f+12gtfMbK1Yy4NampCju4Ov1y8ruNyyo9fyCibVlNW6vUu29GpWQwTVdPTernqwffHex0WP4Nro3k+PrMKCvew/PcZ95aoNsY9yua+cGxTZsnf2K7ch4CAdGnWwYx/5LgKZCgxGdrhH3BeqNmnwviFXPZbQJmcM25HJ5n7/Pczr2QqksMJfO7BJOHLKLWFdMiL1QXYRwFagMklb4GB1zS7s8Le3fqH7Q28tVLkKdIzeaOJB2OKtY8KfTQCUa4++dNsLbrqpTR7xguHGt8hfg8P+seuaEkNdBjahzOD7g1cHP21SL2LtMNBKMdTRJjffTX1wVgrsEb1ITJU6QknwYJAcQky2cE02NbzPp70KyKggtpu9xM7Ik+CBIqY+8FrYyRUkrs+MEm1TG6tG9LZxNDNFGDue63TYGgIHqUUcuNhvhyZtn5LnlDq3Juxa4noCuX0scErOpNMDCrVcHPCS5rFGuQR9KZpxnB6CQ0ZO+AIBcTPk3UdbTx1L7jLEEHsMW7ZYm8NlIFyxn8+xdL7MURYEhzd5k2N2TabxIAORwC2r00QQfNSgrnqTJfh7cDmDu9ggtV0EZFr7kGu4KAxtNDln406TLwF9iZCIwn9EfjPuncRHYm5x3NfK3cFAS5kWxljSnTFlPHBAUFg5HsCCVOd9cdwXq+027un2QJlMjqISJutCDceRtTTuT4+1Q3HWHR8cu0fh9sGvADTYH9iLah/9nPz5+/MDJnQfoIVoAnQAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-ptz:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAQlBMVEVHcEz////////////////////////////////////////////////////////////////////////////////////1bZCPAAAAFXRSTlMAeVoYDS1pBiPv4/g6lkzO2qSxvoixscijAAACi0lEQVRIx51W2ZLcIAwcLnPf+P9/NS2wp5xkq0ziF3ZRC3R0i/l8fvi04oxx89n+RBi1sqB38TKw7lw7lNzDa3U0e57bHhJ4d567HlqGC08eLAj9Gv8XD4/OwtsdhlfCW2s9LfWtuNrMhG1uLWP17Xh14LF4m8dx1OJ9jkm85YCYch5JzDVy81on3MFYkpTNYGmHHloYI+aqlNhlh5ZSvmH1AyBUwPcMX+u/clW3XYvA2YgRGXyZIZX6PXv0l3GlV9Jp9FKcK7mytJIg8xEeBdaBtV4P8tAixexnp73tY7ZBkrk9WEL8t7ZUDqtIA3jXa8sODSeUVqw5aztT+g4QeNAgM0PGTA0+EmfVeUvU0CEW4hX+lt/zseE7jJKDSmi0EUKBhr7EAMKPvNjOA9Fz4Yk/CFgcGRSdkYOHCLRxQfzKRN5SB/b5Ot8SzzQiKqcb6ipFdCfi1JI84OBdxzarhJ8RkpxHOQszl7bpn0GpmnXq6R4OfTkwwlyUWzeQg7rSLNhNUzEUEqJF3DMHeeXgqRIaYwHimLKipK8hMZOYVfJ5oKtIFSgXk5z4KcNx3GOIPGYfPigh9YGHBNQKVKbZhxMnqq+OHfWBHARZfWm1dnfSXfJuXInplse8wy39zkisdQ5kuLY+Bpc5hwGiH8Mx1rE24DFaLqXkfrNVkjk+8JPTPF0bUw+R9MCVuA8ks/xDyF/9orMqpBQeiob5RbIbmv7/TxvoX1Oqa914TsYg7QUWx8Y7R89JQY8mY6Dat1G5GARuMOgYHY9cbL1vNvc++fk67olLk4nrQSl7457OPqdeKn+vEwm4LPzW87DyXvqIyei9znHS+cZz9SxV+Qf8nNbjn37NkDx4+PmCXzHOLUMtjgmUAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-ptzActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwgmv8imPwimPwhmP8imP8imPwimPwmmf8imPwimPwhmP0imPwimPwimPwimPsimP0imPoLqfILAAAAEnRSTlMADprCJBnU/gXwh3LiUKxAXjJ/ELXKAAACbklEQVRIx5VW2bbjIAwLa1jM9v8/O7Iht+09MwPlpS2VwLZkJ9f1lxVG1joPdZ0u1ZIxurhv8DH6dMpQI5t439GAEc7xYPgTRnAtV7plReRhd5kDP8+fd+wzt70yPhIJzWT7/6DCJCAYLReZPMIuJC4pClSktHqbNpJO1aTmmAme3cvtWs9NSfq52CPhnJNjlbVHwgmWSWGHeQHcKFjj7fygwidf2fa4mbVOuladcnsoDn9/CKKAWf6HEtpANiJvUp9Fgr0SvocPP/sqjOCK9ktpyCAo4Kt/d4n4/6baseNKAt5XrauPN1A4ZLAd30RUI4kNfELVx+yd3lrXYIg1Bp/B/dGs5N8mPsJoVyiwkofQSlm+K9aiwmoQMDoI4wefoK/rhkESrSuV+BR2i6HZH9juLzxCtBmn6rFmB66gNJQwBOSxncT/N3FAlxAoLQfJDy2+6rMLI3aznl9fhOcGSdZzoNhex2K3TXJEVe3M4Zb6QhHuJc5BWakYIqqietcPw6FK+EHofUHRqtLEQ5X8dKVENXXgEpLOpcjwkFI30YFVHE8fyx2ShZJ/ydTKlZwZ4BCOv/af9uMi0DILe4kieynScgPbhai+DRDckTT6N6zJpI3HMghM3BMg+q9pHmwrbR0Q0D5wc0JHPy0E5Ur7Nf3Rk68LnR0NHfO28/T5P4cNr+uLFR7eEdiNxvMRbd5Onlqsis4iIVdme4di3akWOz+3T0aUnFWHa8QZrO51NO69MeLPafrNuBenxel/3d21j8k/jyxf+75OQabFxOtuT94G3Lpjzb0zBn2Dl0ep/waPidQ/p/XB60Dp7e8F/QO7WSJg4zEzdwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-ptzActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcExru/9ru/9qu/9ru/9ru/9ru/9ru/9svP9ruv9ru/9ru/9ru/9ru/9ru/9ru/9ru/9ru/+3uxEqAAAAEnRSTlMA5q0cR/PC/ggSKtN5OIhaa5izIOiAAAACV0lEQVRIx5VW2ZLjMAiMToNu/f/PboNsJ5PaKWv8kKRkWkDTQF6v/zyUfO+JX9sP1dKKd/v2acQcm992kbo1R4il7iHIif0BRNtCUOozH4cikAdt2YfjRLTnzN15/8I85wFCI2xDzlnyMLO7R0aFoTzbFGB+jIkYLkyePvmW8d2fs2ZfZuv8It9s6zvV5uSr2LmKb9oVh37QvpjYOcf8fcO3Cb1jGqOU0SvTTd6X2KUBLgKdLzaiDtE2n+isTh8/+AX7E6/Vh/NNSyfVm10RXIe1nxXRapmsDQB7SMnkmE0IxgqvUn0jteEf1T2CHXgr0gjZllGk1HoJL7lD7fRpD20CgJcwQ6EdSh3lLK0zVfuqz2WvPlPJh7HqnCQ4MysxoAYQE0vHub/toRuqzRy5pEUvbg62MzlJQn1MHBe1x7WSAddpNDSN1c9wRMhKfi2jrICwAIsQvHkD7Al41bOrBNC1Y7QdmSg15LDokGETJB/imxYJKfmFMDqI3FjUkDS3NSEDjBaxknRYSb+4nj4kC43W2OKrkqGB8jV2Fq03YiWbhHQTpUV1mMHXWYf8HlNX7ZUQRC6iwBAIK0r0ILr1UxqKsPattAkhwSIiMl76bT/Ft/TbTy2jHQoM7Cz9isHVMb6GILl0H4DGivbw7xNc8rAtiJn3O/qvD6JT/wgs7Y370ZSdWmbZWEKiG1lXImldW7Q1jGMbZW9tUVKZmGjjGvf+EXAqzWiX5OfFSHVp/zjbfGPc3whdcbTF67V2N1e79qYMru2/AnzVYFsdWFt/+nOypv8vQvoHou4gOtSrG5EAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-performance{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTM7OzszMzM3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3NzW8hQDoAAAAMdFJOUwC/gO8ra6tUQNmVEKtAA1gAAAE4SURBVDjLzZMhT8RAEIWnpS3tXcWdQ6wgOJIKfFdUICv6AyruB5w4EuSJCwRXgUBWkGArLsEi6JVuaZkfxawguSWz/p7azLdtdt97C3ASagp+PpeXPDjHVx7McMWDCBc8qPCZB4m44YFIeOBh+ckCf9z+sCCYqi8WvA/5Nwu26cfA+JRBs4h7WmX/tr9AXcQHAPdgzEPZh5idTQBOZ3zyiModISKQGxZ7dd85E0SKfMGjM7vXeI/5AE5LvrwpcK9IOrQYB5BlCsFIvjzgrkaSjsBZbmC9XsGsAxfn8gKXpL9sSlnQFBwFTTuaKWXgI5Ar+sfHTrW6DUDO+2jEEtCNQ9wL6gNujMvvdFS3eugxGT51fBXxTvF1wLLngbT0BGphKalAy0MQ3Z4Ha2V7UoMFJKkFVAWcvH4B0OJfd9YsTl0AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-performance:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAzUExURUdwTP///////////////////////////////////////////////////////////////8/RimEAAAAQdFJOUwD2qdfrViyAwW2XORBGtSCsD6SyAAABN0lEQVRIx+2VzQ7DIAyDYfxToH7/p10CbQ+T2s33Rb1MijM3/qDG/EurolD9zSNRggBU0hFelMABmenfADhGkJDhGUFGgiX6I1AAQlDgZK/td8ELtQORiTmIq42I2bYdCD8NjzPmYQxO+rbn2S5qzEUF6YjkgcJude56X3s0SoL7LRAeylyaVPiFq0Jyx230mpeXmXVOHssRbhackhCq25Sny++xcBW1n6Snqw6BTgrqRP6kzfDcgmRLGonDWSf2OecwB491dOrEVZpNsxiyiHzWJ0Z+BbBwzaoWVb49HrqVfSkxHen7WNznLhzl8xpQlT3E9oHUtYaufB+7NY9g9ctbjFfj/h1DwXUrzDltMn1Ql9M814EQWPLmEBg4R7JSzpFQxTmSBMkLvJKOhFHfKEEnv3L/+qw3DuMPzAFH9pIAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-performanceActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUdwTBGW2xKV2hKW3BKW2xGW3BKW2xGW3BGW2xKW2xKV3RGW2xGW2xGW3BKW2+P2IvgAAAAOdFJOUwC/gCvzq1RAleURc9VmrA9rXAAAAT9JREFUOMvNkzFLw1AUhU+SxtTahnZyC+IsIeAenDuE/oJQcS/FTYTi6hKcHYpDZ/EXBME95BeURpM0Me39Db4Mgk/u23umcL8kvHfOucBBKEr5eW95xoMjeuBBlyY86NOQBwt654HrPPHAca/YuUHrDQsG9eybBWa1+GLBqvS3LJiNX0vGJw/R0N6LJ+/f6x9I3uwG0D+luRU0FnmdCtBy6ZM7KvQdjgXwJYuNZVNrFfqF8IX+nFm/oBvyS2iZ8OWxgH4u1IZmU4kgfoa5E77c0jwhoTYCbTRFGE7QrXFCveCURkK/2cRBCp2gFYiyWk7Jw4AgXOmQZMAqa9uAeCP+JsViihtb9OKIPtBUuvy8jeqyHRpMhvc5X0W6Lvg60HrPg0DREySOoqQJKRbByRWbExaqlSoVwB0rwCLFwesHquttxhcsa64AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-performanceActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTH3G63zE6n3G7H3F633G7H3F633G633F7H3F7HvG7H3G7H3F6xOzy+EAAAAMdFJOUwC/hKbvK0BT2XURZct0z00AAAE3SURBVDjLzZMhU8NAEIX3LiSUNqI1qBMMChFRgYxAd07E4CI6HQwzEUXgKjC4CH5ABAKJyA+oaHqBJO3+KPaYYSZh9nyfyuyXu7l77x3ASSgu+flYX/HgHOc8kC4wwikPMnzhQaTueKAiHvi43bFg0m4OLPBM9sWCjyb9ZsHm8NkwPiUQT8MjfSX/fn+F/C3syJf9YB7oLsDkjIaiHix5QCNbGBmAFPve+3lXi/0viLB3ZnmDz5g2ICry5daAvCbZhSE2oIsFeC35ssJljiQbgZitIY7nIGu4wLG+xBnpL5tClxQhCANR1Q5TSmCCQK7YjftOVbYNUOxot0EsHl0uwHdFfcD14PJLG9W9HfpMho81X0V8MnwdcHvkgS4cBcqVo6QKHQ9B1a6XY1zAcSiIFg6QlXDy+gEd714RcAqEowAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-face{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTL+/v76+vsDAwL+/v7+/v7+/v8DAwL+/v7+/v96T4QgAAAAJdFJOUwBAgSCbs9hZap+hQJoAAADvSURBVDjLY2AYRkAJCAygbEZBQUEBKJtpJhDAOJpA9kSYxESgKphuIaBuhASqyYzESjC2hDRilQBZ64BFgm2qMLPYNCwSkQpAwlMBWYIRzJsKYrKCxZSRncKSDFYzBSNY2MD2MqRhSFgqgClPAwwJBxwSbAk4jGKZDCKZp2JIsEOcOx0ztjQDYL5ENwsYJKrTsMSvGSgepzVg2pE5qSikPRPT8sopBuDod0ATZ54JsbZyBrJgAVAp1Ax2oPXMykjxYQaLA2CMoERUZQDMrgBUCc8CKIdzAvHJhyQJpLQLSu0TCaV2lPwBSu0KQy+LAwBuJj5UbruNggAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-face:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTP///////////////////////////////////////////////w2imYoAAAAMdFJOUwBAgBvfrFmcw4wrbtGliFoAAAD2SURBVDjLY2AYRkAJCAygbEZBQUEBKJvpDBDAODpA9kGYxEGgKphuIaBuhASqyYzESjBu79yIVWIP0NoCLBIsR4WZJY5gkYiZACRqFJAlGMG8EyAmK1hMGdkp7M4gkus4RrCwBIApFwwJmwlgqsYAQ6IAIrEAwygHHEaxngJbfhRDgg0sxHoMM7Z0AmC+RAPsJ4S5NE5gid8VoHg8sgHTDh/PzM60HkzLc44bgKMf3RKuMwoQ+dNIgswJDAycUDPYjhgwMCsjxYcJLA6AMYISUTkBMLsaUCVqEqAcngPEJx+SJJDSLii1HySU2lHyByi1Kwy9LA4AqflRBKNSA88AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-faceActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAhUExURUdwTBCT2xKV2hGY2hKW2xGW2xGW2xGW2xKX3BGX3BKW23povfoAAAAKdFJOUwBAgRybs9hZLG6hrV9tAAAA80lEQVQ4y2NgGEZACQgMoGxGQUFBASibaRUQwDhaQPZCmMRCoCqYbiGgboQEqsmMxEowTgmZiFViFtBaBywSbEuFmcWWYZGIUgASXgrIEoxg3lIQkxUspozsFJZkEMmxBCNY2MD2MqRhSFgpgCkvAwwJBxwSbAk4jGJZAbZ8KYYEO8S5yzFjSysA5kt0s5YKc6guwxK/baB4XDYB045Vi4pCyrMwLa9aYgCOfgc0cY5VEGurViIJMhcAlULNYF9mwMCsjBQfZrA4AMYISkRVBcDsCkCV8CqAcrgWEJ98SJJASrug1L6QUGpHyR+g1K4w9LI4ALk0RHtSETFcAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-faceActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAhUExURUdwTHzD63zE6n7H7H3F7H3F633G63zF7H3G7H3F7H3F68TinBIAAAAKdFJOUwBAgR+Z31ipwW4yAjb9AAAA+UlEQVQ4y2NgGEZACQgMoGxGQUFBASibaRUQwDhaQPZCmMRCoCqYbiGgboQEqsmMxEowTmmZiFViFtBaBywSrMuFmSWWYpGoUgASXgrIEowgHtsKEJMDLKaM7BSWYLCaJRjBwloAploxJKwUwJSXAYYE2KUMVRgSrAFgKhTDKPbFIJJ5OYYEG1iIfRlmbGkVwHyJBlhWCDNrrMASvxageFw6AdOOqKCklrQuTMuzlhiAo98BTZx5FcTarJXIgglApVBr2ZYaMDArI8WHKSwOgDGCElFZBTC7GlAlvBKgHK4FxCcfkiSQ0i4otS8klNpR8gcotSsMvSwOAIs+RIlIrewIAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-object{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA51JREFUaEPtmT1oFEEUx9/bnRALGxE70btkZjcR7QMiRisRbCzEQvxCLGyEhCDRBC/RoNaWFgYLFUSwUBAUDKKFFqIQ3OzNJpfCyspS8HaejNyG87J7t7N3l03gttydefP/vbcz8+YNwhZ/cIvrhx5A3hFMjEAQBDwMwzOmAi3LWhBCLDTr5/t+ycSubdtLnPOncX1iAfQAlmXdNBmkru2RVgBSSspg+5kQ4lRjv1iAIAgqRFTIMIju0i2AWNvrAKSUowDwLqP4tACm9rWmbABCiFxXKimlhu0BtPFHtdc19wj4vn/Wtu3XnPOfWVByA5BSngCAuwCwryb8Hud8EhGNltANB/B9/5BlWXcA4GCMx/8g4jjn/H7aaGwYgOd5BxhjcwCgPd/0QcRVAJhM2l3rO3cdQEq5GxFvEdH5VsLX7aKIH8MwLLmu+zapb9cAFhcXt/f3988AwJip8Jj2L2zbLg0MDHxr/NY1gCAIpohIJ2V2BwC0iUd9fX2lQqFQ6cQvtJbICSGOxHhlVOdKjuPMl8vlqzrxI6IdWUAQ8Um1Wp0ZGhryiYghYrUtgDQionxJT0al1IwGkVJeBAANvieNDQB4joglzvmilHIXAIwrpX67rmuUamfKcxoTvnoQ3/dP27Z9g4j2J4C81KBCiC9LS0suY2yMiC7rttoZuQBEQhsiopfT6wAwUvv+hjE2XSwWP0kpRxBxgohO1kPmDhAHEgTBUaVU1XGc98vLy8eVUhoqbpPLPwIx6/wqEV2ovX8AALzZ/Ng0EWgQGa1iLQ8xPYCUyx8YHjt7EWjm2I7sAy0it7ERqNWEDkeiklIJg8pFWwC1ZC6SM9NYc1oXgcaiVlxVYmVlZW8YhlMAcCnFvOkEQPqqRBqASLTneTsZY3pjapZSpwF4Y1nW7ODg4Ie202kTgGiwSqWyrVqtXgOA6Zj0OhGAiF4R0azrup87dqDJAlA/eLlcnkDESQCI0us4gOdEdNtxnK+tfkHjA027AJEgKeUVANBROVd7p3fixwAwJ4T43kp4nR2zylynAOoE/JuAiPiDcx6kFb5pAEwF5zKJ2xXZrH9uc6BTUD0AAGh639Xo6bjUI+G/NglS+p3Y87wCY+y/2ozJSGkuRDLekQFjbEexWPxVryfpjuxhllKhNtwtAESc55xHx9M1hsR0WlcOlFLHTLyv26Ypi5hesyql5oeHh3VBeN2T6TxgCtXN9j2Abno3je0tH4G/KbtRT7VUKs8AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-object:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAwdJREFUaEPtmTuIFTEUhv8fLSxsFrET3UIQRHtBRNdKBBsLsRBfiIWNoIisD1xfqLWlhYuFCiJYKAgKLqKFFqIgoiBoYWVlKbjwy4HMJXs3M5Nk7tzZCzfdvZPk/F9OHicnxIgXjrh+jAG69mCpByStB3AgQ+AcybmqdpJmEvv9SvJhqE0QwBm4lGikqD4VAaCMvh+R3NffrgzgB4DJDCPWpC2AYN+LACTtAPAqU3wsQGr/pikPgGSnO5Ukgx0DNJhRzZp27gFJBwE8J/k7B6UzAEl7ANwEsNEJvwVgmmTSFjp0AEnbANwAsDUw4v8AnCZ5O9YbQwOQtBnAdQA28nXlp/NG8HT1G7cOIGkNgKsADtepDnx/C2CG5Muytq0BSFoJ4DKAUxnC+5s8cSCf+j+0CXDBjAJYNgAA6+Keg7AwpldyAXqBHMmpwKjYyThJclbSSQBWfyIT5IF5kuQ3SctJzjcCiBHhxUu2GM24gRx1IGtj+gDw2I34Z0mrbXcC8JdkUqidFecEAj4fZD+A8wA2lYA8NVCSHyRtcGvouKtrg9EJQKHVB7Ht9ByALe7jCwAXSb6TZP+dAbC3D7JzgBDITgDzJF9L2u2gQoectV0yAD7IEffjDgC7plaVJQdgYotdLOYSMwaI2gETr51jD1SN6qDOgSobw/WAywltLxRVhBIxi7LxInaxUCHHFvmCpFkorWInoR8LheqsA2DB3LGIRdPIAznBXC1AIVrSKncwVYXUMQB2Sl8h+SYQOCanVaIBPJAVAM5aqBAIr6sAnjnh78s82aoHQkYlWYwz7YXXIQCLRK+R/Fg3BYcO4HnlhPPKIfefTYX7dm8m+aVOuNdP+1OoSow79KzKL5LfY4UvGYBUwZ0s4qYiazzY7RRqCtfZIm4qfGBrAEDle1e/0FDoUTKvUxiT3gfsaWlBbibFUsyDiKSkBK9nf4LkH19P2RvZ3cxUIVoEmCVZXE97DFXPrJY52JUy+lY3Ji2S8cxq4i3jsahk3QdSodqsPwZoc3Rj+h55D/wH5CHfQHNA9EUAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-objectActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA9JJREFUaEPtmU+IE1ccx7+/N7O0BwUn24UeRKOd7LalvS+I6HoSwYsH8SCtLf1jEqWoyLJVMfEP6nlNIgi6eFChCB4UChaU0h7aQ1GQrnFSdw9e/JNs9LTFzPvJZI27m8xk5k02m13I3sK+33vfz/u9N+/7fo+wzP9ometHF6DTGfTMQF+mYNqwd6sKlFLcK++P3WsWF8nkUyr9stAeTcXN624xrgDVAUgcVxmk1lbaGPIFyFocou9fSonYzvo4d4BsYQLgaIhB0EYA174bAFaNWpuFhrthxDsxQQCMrKXUPwGbvfr2BSglYh39UjmwXYCwy2kh4jqegd5M/itdaL8+i5vPwwB1DMDIWNuJcBbA545wAs4V4+YIiJQ+oYsOYGTzGwniDIANLjP+hkCHiglzNGg2Fg3AGB3/Ugj9NBO2+4ujSSaMeJ2uc+PbDhC5aK1GhU6CeY+/8IZz9E+CnSomBn7zim0bQF/m4QqbPkgDOKgufH4EAzdZaKny3vUP6vtqG0BvtnCUwY4p01oFcOIZuCJ7elKvvo9OtLyESMN7IzeViA3VC3TshiY4Wkz2j0Uyj3+aMX5shAIhuia4kn6Z+DSPu6xjiCotAQQRMeuXaJJYpqsgOetbcBV8TZA+ANxgotRU3Hz48SWr7800DjHL6VJyQMlqh/I5jYZvFsTI5XcRa0cA/sLDv98iieMv98X++Sj7aEBCPwjwD9W2LNMdAqhJnQMyc5D9DGBwRhzukK4fK/647q9I1hoE6DDAO+ZBdh6gEaQ3V9hi27JS3tf/u3Hhv20kpQPldsgthQw0fOcnpc3fVK2EhosEmE33x9LJwKxM54Lj/Ap0SeoCBPz+qVw7uxnwmdQFOge8R1n0DDg1ISaxqSbJy0oE2pTvqhStbOK5FQy2ka6vOTVkoL6o5VaVWHX+yVoh7KMAvvPbNq1mQNmNBgGoiV55fry3R+jOweRpqQMBMO4wxImp5Cd/tGynVQBqg0UvT3z4eroyDMaxenvdHIBvE/GJYnzgb69MtjUDboMa2ceHCTQCoGqvPQBuSOZT5WT/fb8luOgANUFGxkoQYVja+Lq2iQm4ygKnS3tj//oJf9+PamUuzBJqJsY59Jz/9wh6+iJpFoIKXzIAqoI7solbFdksvmN7YKGgugAMNH3vqp9pN+vhtq5VMqT2PpAbjwrW59VmVAYL8iASCfdGBvm/bpQPrCvP1eP+RpYrXA5XKgTaBkA0Voqb1eupL4DToFo5YLlVZfadtkHKIqrPrFLIsXL8s0k3LaHuA6pQ7WzfBWjn7Abpe9ln4C11Qo9Pmb2aMgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-objectActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA8hJREFUaEPtmU1oU1kUx//nvthx4cJqX3RgGLsQBNG1tq8Z7axkwM0sxIX4hbhwIygibfPMeyapunY5iymzGAURZjEDAwoVm8SPhSiIKAjtQtAmiooLiyb3yEtNm76+5L37kjQp5C2Te879/+65H+eeS1jlH61y/egCtDuCNSOQyH3cWirNHVIXKO6kYvqdenbxqVlLxS8J8Txp6Ne9bDwBnA5IiIRKJ5W2LDHsB2BmC6zqmxk3UkP6AbedJ4CZfTsNcL9qJ077VgHU8r0MID5V2EsCk2HEBwbIFdT8M/aGBkgaelt3KtOB7QKEnU9NsGt7BMyp2cOa4P8tY3M+DE/bAC7cK+xnxmUwtjvCCXzFHtRHiEhpC11xADOTjwG4BCLDY8S/MvhsyoheDRqNFQMwc292QmppEPb7i6MZgEdqna7V9i0HSNx/95MscRLgo/7CXS0IWS6VrFRs8+1ati0DSEzm18kesgGcURa+3OAfSGklY5ueuP9qGYCZzceZySKC1gQAgPkvXtNjpXatn258CmlYSOSSg/qwW+B8usH9SSM6Ec/lTxM7iR/3hgEh4Jpk2Kkh/UVikiP2MBUbAggiYjFfchajtB0QM/fuOFg64D8H8QHQTQ3CsowNT8cffdLnPn8+KyXPpWKb1FLtYJ0tbbU84asCyRYOEmiMwTtq+P63JJAYH9AfxTOFbUTlNXRyPlmTdpsAKlIXQZyDDJJGGbx7/l++BSHM5EDfg7HMm91CRM6B+fdqyA4AWA5iZd/++hWymDaid+OZ/G8EGgXB65DrhAi4Jw3NsORj5VRC4A8AW+tN2Q6KwKJM54b2HcD3EtMFCLojqVw7uxHwGdVQ992OjkC5JqSJPRXw2qlEsMpFo1OonMx9/7gE211z8iirLC1qeVUlxrLvtwgU4wBO+K2bpgCoVSX8ASqiRx682hgp/jBaL6UOBsC3pMTFdCyaaUI6HRyg0llicnptqWfdeTBMd3pdH4D/kyQupgf7HtaKZIj7gDpAdefxzOw5IjECoJxeewEQ6CZBpmwj+thvCq44QEWQmZ09BYjzLHFk4SQm/C2KIm3/svGZn/AFP+qVucYi4BbmbLnOb5rGr+zB6MugwjsGQFVwWxZxoyLr2bdtDTQLqgsAQt33LvdIe6UenvNaJUQqJ3Hi3ut+KSNLajMqfQV5EAnzRuZoEF8ivfZw74dqPbXeyP4MVSoE0DoAmkgafeXrqS+A08CpHBDTPpXRd9oGKYuoPrNqETlhD/w446Ul1H1AFaqV7bsArRzdIL5XfQS+AaeCtE+rbksUAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-occlusion{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAACCVJREFUaEO9Wn2MXFUVP+e96X5oa9UoYpUszrzzZlqLKDYhgAFaaKU2+M2W9Q8TNUQSQEsiRUjFVaHGNmoBMTUmaPwD2iIhqKR8WEBFGkLFUjbtzDtvpjYrVhpCXAtm1867x5zxvnXm9c28mR13b7LpdO65557fveeez0GYp1Gr1d4VRdF7lL3rui/n8/lX5mMr/H8wDcPwIgC4QkQuAwAVWv9eA4BJy/8sAHg7ALysf4i4DwAe9Tzvj/3uP2cA5XL5CsdxNiLi5QBwUkQeQcRHrNB/JaKZZuGYeRAA3gsAZ4nIBkTcAABLROS3xpjdpVLp0bmA6RlApVI5FxE3OY4zGkXRdkTc6/v+c3PZPAiC80Vkveu6Nxlj9ojIjmKx+GIvvLoGcODAgTctXbp0CwBsEpGHEXEbEf25l83a0TLzh0RkMyJ+AgB2TE1N3b5q1ap/dcO7KwC6AQDsRMQhAPiu53m7umHeK00YhlcDwC0iMg0A13ZzQJkAlKmI3A8ADyDi9Z7nnehVsF7owzA8Q0R+BABXIeJY1mF1BMDM3wSAcRHZ5Pv+nb0I0i9tEARfRcQdxphvFYvF8Xb82gJg5gsA4FkiyrylfoQVEScIgttyudxLhULhwSQvZhYAuJCI9qftkyrckSNHzs7lckdFZJ3v+0/0I2CntRMTEwNDQ0P3i8inAeCUPmLP8/Y2rwmCYC0iPl6v19+3fPnyvyT5nQZAmQ4ODv5aRF70fX/zfAk/OTk5PD09rcbg4/EeiPgPEfkUET2dALENEc+dmZm5cuXKlf9unjsNADNvBYD1AHAJEf1zPgCUy+UljuPsQsSPpfD/m95Is29h5rcAwO8AYC8R3doWgDopx3H2I+IXs17/XIEdOnTobcPDw3ry6zrwCKMo+kypVDoU01hreK8x5oJmZ9dyA0EQ/AwAhnzfH5urgJ3WVSqVd7iuu8vGTB23SLM+QRCoOZ/2ff8Ls2oXf9DYJpfLPSgiH+nGgfQKcGJi4szBwUE9+Uuy1orIQREZKxaL5WZadaiI+Ey9XtfbacROszfAzL8wxtQ62dysjdvNM7MGcSq8Rq1ZY/+pU6fGVqxYcSyNsFKpjDuOkyeizycBHBeRjb7v/z5rh17ma7XaSBRFuwHg/C7WPYWIV3fy9kEQXIyIu4no3bMAqtXqZcaYnUREXWzSNQkzFwBAhf9wF4v2RlG0sVQqncyiZWZ2HOfaQqGwr6FCYRhuE5E3E9F1WYuT83qluVzu74VCYWfzXLlcLuqDBYAPZvEUkYeIaBQR61m0Os/M9yDiG57nbW4AYOZnAeDWpAPJYsbMNwLAD5TOdd2L8/n8Hyy/FfbkV2bxaKgB4s89z5u1LFlrmPlSANhKRBfGAPTBrCGiatbieN7GSpoaDut3IvLa4sWLi8uWLXvVbvBUFi+NchFR00/V6+16ollr7AGpaj5JRCMxAL06VaGWNLATM2ZW4dc00yDinZ7nbdLvrLXQaDZ1iMi9vu9/ySb/BwHgTAC4kYh2ZIGw6ekbRJRDy+AlIjoja2E8X6vVilEUtdhoOzdBROdY4fcYY0Ydx0kDcQ8RXd90m+qVH9P/qwPTf9WcK5+YJmnemfmE67rnIDOfBwA/JaJuLEWDHzNrAPZwGmCNGnO53HYAWA4Aoykgvk9EX0uuDcPwBhG5KwahAjOzqqHqewNYMwhm/hMAXDMnAEEQaP76vTY39v4oiiZd1/0VALyzGYSI3OH7vubVqYOZ9fE3NEENin1LDdqkgZkFMBcVqlarG4wxv0mR4nUiWqLfHz58eGTRokXfdl33tnw+n+pVu1XZNLpZFbIq0fKIm6yIOhX10K8g4t1E9IDSa84wMDBwHBG1WNU8NIObDReY+RYA0EqDhhJqbQ4SkRYI+hotj9gCaDGj1Wp1lTHm+ZRdvk5EDdVh5h9qiaWZBhHXe57XCLKYWVXoygSPk0SksX1fw3r4FjPa4shsVqanP5DcyRhzebFY3Hf06NG31ut1fWQNT4uIWzzPu0M/d3gjTxPR6r6k/+/htDqyMAy/Y4zRPOCmmLn1zprYJ8eriLja87yJSqXyScdxHtKSi4YCVvgxRLyvjZCpFqhXQEEQbHccZ9rzvG/EsdBFIqKmVK1AYzQJl8Z/NH4PzHxV/NkCuAsRb0hb1C4x7xUAMx9GxGu0ONycD0yKyGcTuegLAJD26K4joh+nbczMe7QolZwTkZt939/Wq7BJeq2nIuIviUgr3v9LaDSdFJFjKR7vtMcYOxXVRWPMpY7jCBE1PGiz84k3F5G7fd//Sr/CW80YR8SROK2cvYFOKSUzr0PED2hGZYw5ISLHrafUx9QI2uICmFY1RORsx3FmEPE5EXne8zz1mn2Pjiml1d+ekvrmqHO+K3hWvvZJvb2ensoqCwmgq7KK1eGttnuyNqsSvVAAtGINAE9oF6hjYUsB2EaG6vWx2La3U96FAmAt28jU1NTqZOMjtbhrGxovZJXVFwJAXGYHgPPS6lVtS+dxY6PT41wIAFpe79To6Fj7j9PCdmX2TvF6vzYzLqtrgyX2MWk8M5sXcaNDRLQjeft8Vaxj4bQSLSJbEFHjsraNjZg+E4AS2obHTzRb0kxsvirXVm1vBoAT9Xr9y2kNjeQtdAVAF9kQW5PseW+zzszMjCcbGe1UsmsAMYOURveTc62nap1TRNYsSKM7eQIaO7mu+zkAWAsArwPA45oXdPNTAxutaillsTqoKIruW7CfGqRdpRaHReSj2lvo8scezyDiY1qc7dda9axC3W64UD+3+Q/fZENVhTDr2gAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-occlusion:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABphJREFUaEO9WmnIVVUUXSuiuahopOLLIqTBBgtCC01Ty8JmS/sRVESBNgiVJVZaaag0WBlGYNEPrSyiQdTKskEjpNKSCBqlzAqJSAsbYMV67vt13/3uffe+93pvw+Mb7rn77HXOPntY5xEdEkkHAjgk1G8k+VMnpuL/oVTSaQDOBnBmGG3DfwHwXeg/DMC+ADbGZwWAZSRXtTt/ywAk2eDLAIwAsAXAkvjY6O9J/pk2TtLOAA4FYDDnxmdPAG8AeJbkslbANA1A0gkAbgJwKYA5AJaS/KCVySWdCmA0gFsAPAfgIZLrmtFVGYCk3QBMDeNfAjCb5MfNTFY0VtJJAG4FcL5BALiX5B9VdFcCEBPMB7ALgPtIPlNFebNjJI0DcDuAbQCuq7JApQBC6SIAiwFMJPlzs4Y1M17SAQAeBTAWwPiyxWoIQNJdAKbZbUjObcaQdsdKujHcaTpJ25ArhQAkDQKwmmTpLrVjrKQdANwJ4FOSL2R1SRKAwSTfz5sn1zhJhwP4BsAokq+3Y2CjdyXtBMDueRGAv32ISS7NhN+RAF4D0I/kt1l9fQCE0lcArCPpyNARkbQrAAeD81IT/ArgQpIrMyBmA3D4HkPyr/SzPAAzIzYPJflbJ6yX5ARm48/J0f+DdySdWyTtBeDtyDlTCgFEkrKvXVV2+lsFJmmfMH5UAx1fAriY5CfJmIiGCwAMSie7uh2Q9KRjPcnxrRpY4vP7hfGumcqkT/SR5POyjeSVycu9AKK2cRQ4vUoCKZs9J5ocFMYPrfDu2sgBn2fOgjP2e7E7tdopDeBpAF83irkVJs4dIslFnH3eVWuZ2IWdwDbkDZTknHAEySuyADa5uiT5TtkMzTyX1ONqE4ALtzJ5C8C4Rtle0pCoXg/uBSDJPjmf5FFlMzTzXNKRYfzJFd5z/PcCujRvKJK+iFppRc2FJDnO7k5yQtnLOb7tLf2RpIu9XpHUP9zmxAo6X3R5TvKfCmNt7zwAvztPJQBWA5iSTSBlyiRNAvBAjBtC8t1YkGNi5Y8r0xHPn0pHlrJ3JJ0BYCbJwQkAH5jhJL8qezl5HrWSW0NnVItbyP4kN8cE9ucycVh0+2m/nlM184drvkmyJwHgrbML1bWBjWaXZOOHZ8bMJeluzdts13I1WyQLSF4dzb/DpsPsJJJuaBpKtKd2oR0ZClwJug6vJOHfdTE6XlxPckAY7xbRbWceiHkkJ6Z201l5efw93T8dzkNP7d/Z8C7JfckAAxgI4AmSVSJFTZkkF2BuK/OkX/TKRweALIj7Sd6cfVHS9QAeTkAEALuh/d1Sl5klfQjgmlYBuEqdVQDg2KBTXgawfwbEDJLuq3NFkg9/zRMcUOIsJTuQrVB7AZiAataFTIu8mmPFVpKuNL1LTmB3u1kpyqqV/LUY7HYXisnqDnEqijipOEObVXuEpPtiG+dGxP83WZUWd3C95YIkN+hmGlxKONqsJel6pi2pO8RhUF0YlXQKgDU5s9xGsuY6kh4MiiU9bHRCUEmyC43J6NhC0rV9W5IXRusSWaywV98rnZURJFdI2huAD1mSaaeSnBHgis7ISpLD2rJ+++L1SWT3RB9ghqwmkgzKjX1WNgMYRnK9pAsAuAxYTNLRxu+5l1hYYGRuBGoWkCQzgu4L7kjOgP3WodRRIAGQGJen33VLch7GJr8HAIdCh8Q8yW3MWwDwWS2EkqvS/YBJ2UsyvehHAPIO3QSSj+VNLMkJzKRUViaTdNHYlgSf+jxJk8R1DY3byQ05GS/vMNaSSvii/VEkaxlUUjr5JMY6gt3QluX/eYZLlJ6k+KvUUkpyqj8+OirH300pALWiLSHAJJnVMK/kusqs9RqSTjptS3C0+S1lrF5TTX266uw0gxf2FTf1McDkUWVapZsAKtEqAcIu4FJhZBkT3S0AwVib4lxCspjYCgC+yLBf+0DXYnuRdBGAI5trK+efuouPInLXodMhtCGt3g0AKZp9YB5f1Yhe923JokaHs0sATK8XXnSUXXAkbWEuzd6oXm83ZkpKaPVpSY7J01l6eZFcdESX5cu3jjDWiXHBRLvpcV1WeLGRjC8FEAfbienx6JZmdZC5tttOBuBkeW3ehUZ2FyoBCBAurWv3ZdEPd/Ka1W5Td5FR5JKVAaS2OHvRbX6mJT41eE5TM52/6M6uQNDxlzvhAdga91gusat81cDVquurPQA4QS3s2lcN8rYyyOGzfLdQ8cseLsiWu7NrN1o17UJVJ+zW123+BfogD+TkdLQFAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-occlusionActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAACItJREFUaEO9Wn+MVNUV/s59+wOqyM7bFaxAsDBvFqnWak0MYhBQUEqUVssi/aNJawg7bxaKScFqqKyt0gip4sK8XUKqjX/IL43RlqBSxLZWYqwWdWNh3oIlFClkebMUaXfZefc0983MMjv7Zt7MLrvvn93MPec753v33HPuPfcRhukZt+3YeCndCQpeCO3kmWVTTg+HKbocoKHWjpnEuBfMd4GgnJ7ADAcCJzx8iUlE0AGcBOMkiPYz4c1kNPzXodofNAE9fvheQCyBoLvBOA/wHunSHq7CiXM9+BdWGj39nGuxq8dWYyJdxCSh8UKAFoIwBpL/CMidTmzam4MhUzaBmpYjNwmNVoFEA9jdSEx7zzZFPhiM8dotiduYeAFIWw2Wu6TLm7pW1n9SDlbJBK7d+rev/c8du5aAVQC/Lok2dEWNv5djrJBsTat9s2BeA9AiBjaN1s499eXyW/9bCnZJBNIG0AbQKCb8OhkN7ygFvFyZUGvHQ8R4DOBuSWgs5QUFEkiD8nYAuyuJmk5Hw2fKdawc+fGtHeN6mbcAWMxES4NeVlECequ9DoxmMK9yYpHny3FkqLJ6PPFTEG0CyyedWH1zIbyCBPQ2ewYk3ndMI3CWhuTsOhb6uMQTEBWfOdGpr+Zj6ZbNELjdaTQO+tnxda6m9R/XCa74AoLnO42RfUNysJjyuvYqffyo7QA/AKCXQYuSZnhvrorelpgHSW9LSn2jK3r9P/PhBhLY1V6ld1b/HuBPHDOyZricn/jsidEXRnXvIOD+SzaoS7r8/a4Vxrv9SFiJDQDd5NT13IeGGy7mjg0gELLs9QQsQAp3OiuN/wwHgbrfHh4ju8UOEH3XB/9LkvxAbm3RW+yrUIE/MbA3aRqPFyTgFakKcZCJfhK0+gdLbKz1aUjDaJWG5xfCYKADcB9MmtM+zcpksuELMiVn5Ba7fjOgxxMvgjDKMSNLB+tgMb0xW4/UVUpth7dnCnp8so9uJbaD0e3EIj/OqvcR8PY2VPGqJL6jlAISZD9//Op4+zWSqncwcGewLh8il5eeXVF/OFc2XVDpPXDqwezeqY9AyLJfIpbHiuXcYMP+EnqLPREVUGEzMxCDcFC6vUu7mqYf95PV40eamcSUpGn8SI1fmgHLPiUFL+lqjPw50EgZAjVbjk0Wwt0J4LYgNQYOVBE9VKza17QlZglJOx3T+Hofgdq2o3dJKduSpmEEGSlnfOxWe6pwsZOA75Sgt1dUu0s6H552Pkg2ZNm2EKLxbOPU/d4M6FbHBma+IhkzYkHK+ePpKa34d9Kc2pY7VmcdrpfQVNh8OxCT+TVnutGAOZQKlAUQittxIrrgmOE1aQJx+30p8Xh+AQkC01vtR8B4VskxtFlJc8pfPLw2ezokVNjcEIThjRP9zomG+zJLkE7NZnu2EFjvxIzbMzNgH3c1zD233DgapJwd17fYM0DYD8Lo9G/s9GpX1p9ffm2nZ0DDgUAstcsVNAGMWQBtVG80UAeACk3NxTuOaUzOEkg5KVwx4BhYBE237P0A5vYTIXreiYZXpWf1SDNIrCsIwfyCE4s8rA7/qV73EIBrADzimMamQBItdrVegQuOaVSQAui96H6WjBnjAhUzAnXWsXoJt1+Ozgy1O6Zxo+e8JnbBlQ1+JBiIJ02jqW824/Z8EN5KT6R8Uv1R6dzDyTz56T0Ut89UVmk3Ut1W+xZXYlsyapSSKTy4Osu+XwKv+xFWu0aBio1gXA+BhgEkGL9xYsbP8nVrrY4VDG7JklAOhyz7AAGzc3/L6oVa7Y80gWWDIhCKJ9YQ0TO+MybwTVHpnnB7tDcIuDqXBDM/nYxF1haaabX4ZS+8SFAJRa2lrGx+gukjMJgQCllHFxLkH3wc+coxjTHq95otn08mUflLltoTXU1TfKtqqSHrJ9cXQt6Cs+x+izgni6iicgrg0wBtdkxjtwfmHUSqTgGkmlW5jzrB9W0Xai37MQYWAZioml0ADjmmcfNQHPd0cxdxhkC/NFrXdvRWKeWH+YYY+HnSNLzQ0S37OXgtlpyHaYETC3sNqlrLfoOB+/IwzjumcdVQCQxMo/mFzHvD1ertV+UbIynvPttUv7/muS9qRHVK5Xqv0hLT2rOx8NPq/0JrhIF3k6YxZ6gEfApZx68Aqc4Bq7PgqjqDMMPHWCcTzUlGw+211pHvMcRrquXimEZDxvmlRPSyr5MFMlC5hHQrsREQ3Y4Z/oVXyNLNWd7mmMb0LFiOc374Ddn1oFv24r61obCsRAuBVvgpFTqYl0/A/pyJlqnm8KXtdKt9glz+Qe5ZtNayP2ZgwKJjRiwZMyw/w7pl71JNqQHrh/nRZCyyoVxn8+W9fqpGrzhRY5IXupdCJvEiwMfzK57vYswc99KxKGdDCHaihldB+xWfDDiDNyfNyMqhOu8lD6860+TssbKkI6WuSj3oW0yYSZBnwHxKEc3dtGUbYF5Xg/k6CNHDTB9o4A87zfBHl8P5okfKNLvyDvV+BC6Ho4Uwih7qlVK5bZWRJFBSWyUTw+sJtLCSMC+oEz1SBNIda+xj8J6ijS1FQF1kdLtjVYE6ns3thaZ0pAhkMtvkUdq5OfkXHwWau96FxsdBbfWRIJBts0vCLX79qoKt8+zFRrH2+ogQsGwudtFR/IIjeyws0GYvtl8fajbKttVBaM7WGD/MwMuL7EUHwBuRoqeGq2PdV1C9TjSvBWh1sYuNrHwgAS+9pi88tgIYx0TPDFfnOhO2jwI4Iym13O9CI38WSiLgKe1qrwp1VjePxDVrsq6nOf8io1BIlk4gg5B/0S01emew/VSvz+ny3BG56M5/A6odz6T9kIB5DHwFxtsssbuUTw1IYDEI8wm4koF9xO7LI/apgd9UquYwS74HzHeU+LHHeyToLdWcHWq2KjuESjU4Up/b/B9u0kgtWdqPkwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-occlusionActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAACJpJREFUaEO9WntsW9UZ/33HaZJCX7S5TmhalQ1NaAzGYJUgvk7pe5QKusGa0v0xaZvQkKBbK60BWl/b8XWKaLWtUJg6IcG0P+hrCMHWlcdK2OLrFPFYGdU0ac+q9BHfFPoC2sQ+33SufVPXvfa1kyaWolg+3+t3zznfd87vu4Qx+nQfONc8yF+0KvP1NPHoxjsm9Y+FK7oSRo2+fh0I3AUpFwHUyoxWIv6EiI4o+8w8m5mmE+EowEchxH4g95rZ1myN1v+IAUR6M3eRwCqAFgM4C8ZeZuyFmHDk9OmpH2+7my4UB7fmj9wwderpWZBDs4mwHOoPmAzwn1hiV7I9+NpIwNQMwOjtvwWC1gLUwVJuIfA+s73lnZE4N3pP3M6gZSTEeoB3Q/JWs735w1psVQ0g/t6xq+T5uogkrCXQKyDebIaCf63FWTlZI525FUydDF4hGFtFYzYZnzvz82psVwVAOSCI7QA3MuMJU9d2VmO8VhnDsh8gwuMAnWfIh6p5QL4AlFEAO5ixp45yj8T1lkytgdUiH7dOBLMceIYIKwGs9ntYFQFELDtGQJyJ1yZDwadqCWS0spF05qfEtJWl7Eq2N8fL2SsLwLBOtgEybeqa7yyNJthYjEVucSYqRN1HCX3GS6W2DMtmQIRMfUaflx/P4GJ9x6+Tsu6/xGJpIjzjzdEEWEk3tvtQvZzVsgPM9zEwJJhXJMLBfcU60dTJJUzyDSGyX+pqu/Z/pfYuAxA7xPXytP17YvowEdY6xyr4dekjEydxo0oG9170QadY8neS7drbl4KwNzPxLWKqdk/XTTRYPHYZgGgqs0kSLQsExJ1dd8w4MxYAOlP25AaCCv5uD/vHIHP3FdeW2IGTU3I5+WfBvC8RDm4oC0AVKRbUR6Af+u3+kQJ7rPfwNXVi4k4CLS1vg/+Vy/H9m+Y1/82VUdmQwc+T5LbiYnfJDBhW5gWAGk1dWz3SACvpxd8705QbHNwJ5kV+9r2yj2HZOwA+b+rBH7j6wwDyZxt6CcThagqIXwCl47GeTIusJ7Vs7vTTZfDBHGVXPxGa+Y9i2ULFTrHk+92z00UAlv1bSPmfSjnXz3G58c6ej2c1TGjYCYLub4P6JAZXd+szD3vJRnr74xDiy0ld+74aHwZgpOzjknhVtx78i7+T6iU2Wp/OEZzdBcLtVWj1BJB7oFK132hl5gmmXWZYu3YYQDQ9sIiZt5u69pUqnFQtErH6rycWKvhv+ioR9l2QWLU5rJ31kzUs+59E9FAi1LTfmYFo2t7MzFebevBhP+XScTWlVCdOmG3a9uKxSMq+QRB2MvANX5vML4shraNrAWV9ZQEYVuZZIvosEdI6HQCGlUmzpA2lBcTPWLTPXscSv3DkmOeZ4WCv+ho7cPLGXC63i0A3+dnIj9NvTL1pOLP46UR67fkkeJOpB0MFAPZhxoSFSX3av/2U3XHD6m9j0H4CTSz89kmgoeGG+NwpA3kH6PGzxcAOAbQyMI8IW9QT9dNR4xHr1PWEobdMXZvjAIik7OzpM01Xl14DKxkzLHs/gIXFMgR6KqE3rXVsqqUlRKy8DX7e1IM/2nCgvzmQFQdBaAFjnRnWtvqBcK6nUwY+S4a1OlLswfnc5x+ZejDop+iOq/VNhEtytLOKwIeSevBmFXxgQt3u3FC2wwsEMT+bCAcfGbZn9S8liNcdG1J2qf8qnTsps/ApTe+Glck0Bq66mWJ99m3MeC4R0vwzRcFYpM++lyRe8QKsTo1STtgC4KsiQB2lIAj4eULXflaqG7UG1jD4aReECthI2z1gzC/+zdWLpu33ifDgiAAYVn8nIJ70BBAQX/siK480CLwKJq0YBIG7E3owUm6mnc0/JJ2VoBKK2ksXZ6DkhOoCGMkSilr2cgb+4BHIOVPXJqvfN1rH5giqT0gORLv1azyrarVL1ktueAl5beKiLKL4nuMg9BPxtkQouEfJOxeR1ubjAKaXbOJ0Qm8aPi5E0gOPE7ACzLMAtBJwMKFrt44mcKV7ySZWPxjWpWk0lrLnSsK7pY4Y9FhSb3KWjpG2fwmGk3HcD5NYlgzNcAgqI22/CsY9JTbOmro2ZbQALkujpYWs8IRVSa8vdUa53OLEvJb9sZ5Pp3F9tsettAyKJPWm7vwDKbNHCG+bIW3BqAFcVsj6BkzkuNEMa+td4woUQG0ezgYCCCyI69MPRdL93yYWLyvKJRnWOpy1n7ZXC8aLXkGWy0C1AjJS9hYE6LzZ1mTkK7EiZ6V4ztS1G11jbnCegRB3uPshms6sdL87+8nKPE2gNV565S7mNQOw7L9DyAcVOXzxOG3ZRyBz3y2+ixqW/QEAj01HD5t606+8HEdS9u4CKVUyLB819ebNtQZbKq/4VIjA70xdm63GigBkXmDJhy+reB6b0b3u5fO0nA8hOKlrTgUtLj7Dmxu8LakHfzLa4J0Zdo4oNMe9VlZ1pYyoUk/i62DSAc6wlMfzpf7ioc0lwAqsxnUEugDB7yCLd8127f0rEXzFK2U+e9R2qfcCcCUCLWej4qXeAVAjrTKeAKqiVRQItQQgaLng3BI/Jnq8ACjGWlLgTUjeW5HYUgCcRsZgfY9UG7qQ28tN6XgBUJlNCJoj6gcXlDY+PMndwmb5wI9WHw8ALs0O4tu8+KoK9Hq+sVGJXh8PAHl6vXyjo3KDo3AtLEezVzqvjzYbubQ6A3G3xpQ5nlR25TY6iLGF6kRyrBhrNwrFRHNWRpiwvlJjw5WvqvuSb3gEfs2gIAFPjhVznU+VeJTAGSFyP/ZqaJQ+7qoAKCXV+OBTdnw82qw0TYuXNjLKrZOqAbgGShvdLOitkfKpiuckyQvHpdFd+gQUHQ9B3yPGEhDOAfwGS9pT1asGgldCNTgYk5igCtSL4/aqgddUKnIY4G8xc7ialz2IKAXQ64qcHW22qnkJVetwvF63+T9nAHfjRfzL0gAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-logSave{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA1RJREFUaEPtmT1oFEEUx9/bFLFKJzG2WiknZObFxlO8RtFC8SuFWlrYGBtRRNCghV9YmFQWgoVaaAS1ULRRRKvbmYBBQezVYBOIGFMkT0ZuYXPufOxdspuDO7jibmfe/H/z3sy8eYvQ4R/scP3QBSjbg8EemJyc3La4uHgUETcx82YAWNum+N8A8IWZrxLR41ZtBQForUeY+Xarg/j6MfMVIrroa5f13AuglOJWDLfQ56aU8mzefk4ApdR9ADiW12ir7RFxXAgxkqe/FUBrvYeZXzQbY+bh3t7ed5VKZTrPQM2eNHYQ8VGGjTtSypOhtq0AcRyPIeKptCEppTfkbAM3AxhbcRwfyYJg5nEiCvKEVZBS6hUA7EoEIeJ+IcTz0JlpbpcFYNrYIBDxlhDijG88lwd+IGJ/YoCZ1xPRd5/BUA/Mzc31VavVWRcEM18jovOuMV0eWLL7tBM+RoBS6isAbEzERFFUHRwc/JD8dnjishDikg2iSIAJADiU8uhdIjqRFuZYEweI6Gmuc8AWs6EhVK/XR3t6eg4zMyKiEQ/MvOSwQsS3iHhhZmbmY61W++UIp/dSyu2FAmit3zDzTjMoItaFEFuVUt8AYCB0ElLtZqWUfYUCZHlQKXUQAJ60AAC2Nbhia8AWglprAoB7jYQwmGXVACSKzRqJomgLAJjvBh/JqgPwCQ7dRAoPIZ/w5HkXIHQGQlOHvCd56PjdEOpoD6TShT/MfD19OXeFQCPnOYeIaxYWFiaGhoZGQ9Pv5nZthVA6XWjkOsMJRGj+b/IhIURtVQCkIUJvYKUCONLf/+67tjuw+T+rLlTYLmSDCDmwbOIbF6CgC1Vba8B3m3JBuMQXDuC4iGQy+MSXAhAKESK+NAAfRKj4UgFsEHnElw5gBGit9wFAUqy9kbco1vY2Gsfxsha2QrbV1K42gIimAPDvw8zTRLQuy0ZhpcU8AMZ7zPws1ee1lHJ3LoDlLu7mAcioZFuLvYWV130AU1NT/fPz8zuyqtWIuFcI8TKXBxo7QaEvOCyQD6SUx20T4K33F/iKKVOj7yrqBWhsiSv6ki8zNBBPCyHGfKEXBGCMrMBr1mZtPxHxEzN/jqLoYbr07oIIBvDNRFnPuwBlzXwybsd74C95KWhPrxIhsgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-logSave:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAthJREFUaEPtmTuMTUEYx3//TrWdeLRUJCrReISGUBCvLVAqNGiEiASh8IoClUKyBQqPBAWhsREqnYRE9NgoV0T3yci5m9mzc2bmnHvvOXuTO8ktbs7MN//ffPP45hsx4kUjrp8xQNcezPaAmW0EDgFrgLXA0j7F/wG+AlckPW5qKwvAzE4At5p2ktHusqTzGfUWVEkCmJk1MdygzQ1Jp+u2iwKY2X3gcF2jfdS/I8l5O7tUApjZTuBlwNIk8E7STHYvQMCTzs6jgI27ko7l2o4B3AaO+4YkJadcVcdlAGfLzA5WQGR7IgbwGtjuCdoj6UXuyJTrhQBcnQjETUmnUv3FAH4CyzwDKyX9SBnM9QAwIWk2AXFV0tlYnzGAebtPP9OnEPkNWO2J2STpQ+9/xBOXJF2ogmgT4Amw3xNyT9JRX1gEYq+kZyGIoQGY2UXgAPyPt5x4V8qH1TRwDvgk6XdkOr2XtLltgLfA1qLTj5I2mNl3YEWDdTQraaJtgAVryMz2AU8bAFC1Boc5hYKbgJmtB6aKgDCbZdEAeLuOWyPrit+qFMmiA0gJrjr4yu1an0Ip4Z6Hss6hMUBu6FD3JB9PodwRGGkPeOHCX+CafzmPDUAR85wBlrgwQ5LbUueV3AHsaxGbmR8uOAGTPYga8f+0pG2LBWAOosYNrFOAqith6L5bdQee81optG7nHIjE8DlnVlB8EVa3AxCJ4VMAleJbB2gAERXfCUANiKT4zgAyILLEdwoQgcgW3zlAIWA30EvWXq+bFBvESTzQxFZqSyqdAe7i7xIAvTIjaXnIRmupxZoAznvPvTZvJO2oCzDQ5G5NgPKbRGWyt7X0egrAzFwedktFtnqXpFe1PFAsxLYfOEIaH0g6UjUAyXx/i09MQY2pq2gSoPDEsB/5QuJPSnLrMFqyAAqIQT+zloX9Aj4DX4CHfuo9RpANkBqJrr6PAboa+V6/I++Bf0in3kCazcMZAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-zoom{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAkUExURUdwTMDAwL+/v7+/v7+/v76+vr+/v7+/v7+/v7+/v7+/v7+/vxtcv/AAAAALdFJOUwBVdZCpGdZE7C3B0wnY6AAAAV9JREFUOMt1lDtPwzAQx20ghGwVsHVJhQRDlsywWKqEULsw8FhRJ2iWiglGGJvFCw8xIVVCSEwkKU25L4ftpOHs2Cclsu7v370smxCLecRh+xOH8Ja5kGEs/6dtYf1XONcWZurbwwRCQjYZ9l7uHAPAOBHpI1QC/QSY9g84ldmnAn7Z3htwsfZnvSe54eJd5hlcC7gccxTwSETZEr5+714vLRdfkFraVNtetXLpR7ha+mkHCV1Y/q8ZOW8AgDkecsIaAEIcGbIGyLUq4KcBYl0o7QAB4FZACBMrQKpaJOCZQqyAIhgayYEpgD1DZghXCvBTNJFKmCvgzmhcCEsBwMjSRx6BslYftRX0JLYKrAsLqzDC54EFMwvy58QhMM8hFNq0UpwET+sLC9/4BmEBTytyRCIbDoAEiR1Qp1dbRxfoyv9g3ogaKVuXhVZZbtqX6Ez6H23PxG4CM259QDwt/h8ABfK8nDqSAAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-zoom:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAzUExURUdwTP///////////////////////////////////////////////////////////////8/RimEAAAAQdFJOUwCCyreU7KZVRCDaZnETLwj6WaYVAAABUUlEQVRIx5WV2Q6EIAxFoVBWxf7/184AOnGUsvTBqDmXrqRCzNou1kwGtyZIQNuiD0P6evWTURFUMtIoPO+iVoGIZPkMqkdKA0jZgoJ6suQc2EoiGBldOoQ9HSDk5+GTs1Fqo9IlcEpvNv3qv0MBhSalIFSv3+MCJCY8fUaCxasycrMu9dp5VTUhubXZ6CqsAvn66ZAsx+e8fON37oT3bZ4aiRU0kDlavGSrQI95HPBZACt8FuCL16IruBVkzBeBW+CLYHvyfiDQd96IpHpOMqP++fAq9VMQ7rwrM5+6gjwG/3y/D/m8ylPYpvpAeqO7DfvwMPO9D6jnBabG56YFZx77fEjD+9AyLdYEhp8nxoNh5wmJtfY8AS+wzIZZrJNcC4h3wV8IH1p87Iyfnc6XVaAd7ICHAsebw97zgDSxZ/yvViiPuYUfTe650knM2+7Ywz9yOCklzohLOwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-zoomStop{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAzUExURUdwTP///////////////////////////////////////////////////////////////8/RimEAAAAQdFJOUwDjmTC6Y0KBVakX8s8iC3JYR1wyAAABVUlEQVRIx62V2baFIAiGcwJRS97/aU/Zbtht0VzrcJOuvl/AAabpXy1RF0F/m2h2PX5mzucEuO9gMon1MY7KlG8w4LImC1XFQmxDGVkm1DYpXi0qS1gXTEGzKoqNS1ajAxPqJDikFLcFS+aukYJffRfXnAj9kYUXFVi86wzzPjuCFRXBwS3KaC/Pt02Ww7uf1jz3BVYtX/OsyDQFDn7yswPXb+Ovs39eJJWwxrOXV4thgC+//QBf/uMAXwAa4AuRBvgdWR58CB2B+eaRG5e8QO7Jn2sIAvzhbdsDnXzev8q0BengGXv8EciH3y1CY5++yI/BRNx82g/La7lc7b0Am/tUC6n3HoZ4SbDyy5BgzSNivV6wbPXeIPOpHlOU+CjkTQKvQOpXdRdJvn+5xttWQa4EZUOzluonT6+q72X6Zb0+T/lNhQd7hg9vm8LWUhW5gT4iN7c/0ZUo8Q3AttYAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-zoomStop:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAqUExURUdwTBKV2hGW2xKW2xKW2xKW2xGV3BGW2xGW3BGX2xKW3BKW2xCX2xKW2yDN61kAAAANdFJOUwCAVKxm3T/DmhrxKw97YQBGAAABaklEQVQ4y2NgIA6wGqCLMCqAqV4HdIm9F0Ek22UMM9hiG4AkVzQDA+cmx+YyJJnDlw8wMNQaNpfevbu0QgxJgrN3JQPD3VvhjU57kESnOZqvvXuJgcEXxVFMEkDt1w11gZYwoVgue3d5SzaQSgCydZG1TMkBU8vBuq9guBcqNBNDgj0GQrMEb0CVYEmA2ViANRQZ795tQPZduADciXcVUNSthGu4hGrAJawagBIXsWoAClzGqgEocRWrBqDIrQNQDTPRXZ8A0cB41wBNQgGiQfbubTQJAagGDB0GIA0OsnevbkCTCADiu4J374ahW34JqAEIbiXMRJOAgkvMKJYgJBx6717AKiF4F4eOu+jxgQCXGHBIKPDgkBC8JYCURJDtQHYWN4oEcvpZiyR+C9lZtkgSKKG1CyGOGrxItleixjrcLFBWRAYcMIkG9NQMiY67N7AlcxAQwMwA6SBxM2xZQ3jtVRPsRQ83sg8ACMIUxzzE8wsAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-close{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTM3Nzc7Ozs7Ozs3Nzc3NzcrKys3Nzc3Nzc3NzePZJxkAAAAJdFJOUwCtKdPBGAmNTt3jdDcAAADfSURBVDjL1dOxDoIwEADQgwR07GTCZtI/IGHgAzBhM9EPkMTB0Y3V0ZXIcn/rtRR6pefgSKeSu3ellyvA9lZ/5F9p/3K7PZY8oPG5BD6MpPUSgIITzdIStifAshjRQV1PCFT8TxaicTzzwEwINOEdHVmDmcTAkRhMhMAp7iQRjcMtDhCp8SA1v0ARGIIK/gnkv0p1OBTS4QRUIpE7DiYYXTBrzcld3JIrAarXrps4AVNwRSZgExoJmIyAaAdsShUMn/JF2fh4YEkpAcgvnuwYCIb6EbbbP4PsDfLD2dD6Av1qTvAQlzUTAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-close:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTP///////////////////////////////////8kBMKEAAAAJdFJOUwCt0igUwJdJePGbgLgAAADcSURBVDjL1ZMxEoIwFESTCaOWFDapqeicnAALTiANnaWlnVewDTMW/7b+aCAb8jkAVIHN2/lsNkrt73lf8M08nnF1pAYFR/dFmAAx7SIoi4iDbRrWDMAuQFzmmxAGbjjJgjj6dCjMCAND/o8RWQMzUgIRKYE/wsC5TJIRR74rBUZaqqXwLZEXT0WTDGwLW1aavJWQir9qadw++NgykWoMNtcykh8Q5EECgr5C+jjpGjHjPGhPU5eVzyfPJitfnUyhPg6ywMKZ7BygcYcsPCj1Kc8uXYPqpeSLs6PnC4w8S+8OJ9MLAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-narrow{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABm1JREFUaEPVWWuIVVUUXmvfYRosHzUZUUqKjkSXSe5Z+5qJhfawLELCR5ohPhKjjB4EWgkpkopRSWEPS1Mqy7Gkd0iPGaKy6ey9Z3z0opwEQytSMiS5NZ4Ve7j3dubMOfecO96buf/cx17rW+vba52919oH4RQfeIr7DxUjoLW+BhHHAsAAZh5gPwGghpl/TKVSHZ7n7T9+/Ph+ANg/atQo+1mRcUIEtNYzAWAiM09ExLPK8KgNADYw8wYp5Z9l6PUQ7RWBvON3AMClJ2Kcmb9DxAKR33qDVRYBrfUNzLwQESf0xliUDjPvR8T1RLSsXNzEBIwxc5l5fYSBnxGxxfO8bQCwN5VKHc7lcofr6+tzR44cGcTMg4UQgxDRfp8IAJdH4KwlooXlkEhEQGv9EAAsDQF+GwDWEdE75Rg1xlwFADcx83QAOCOg29SvX79ZDQ0NuSSYsQS01h8BwBUBsF45HnTIGHMBM9uFmR2Ya0bEWxzHORBHoiQBY8xmZp4RAFlNRIvigMuZN8asYOb7Azq7hBCTMpnMvlJYkQSMMUuYeblf2fO8ZdlsNiyVyvE3VNZ13XFCiGb/JCK+6DjOrLIJ2N0GAN4KKG4hIpuzVRtKqf6I+HvAwAIiWhdlNDQCSqntga3yUyK6rGqe+4Db2tqu8zzv3cJfiPiLfQYdx/k6zH4PAvlD6iWf8B7P8yZls9mO/4KAtaG1fhgAHvCReN1xnClJCXweOGFLhrAapJqamlLDhg372H9eMPNMKeXmoL1uEVBKTUXEJp+QJiJZDSfjMIOZgIibHMcJbrfdq1Gt9WMAcI8P/D9f/YJtpVQfW7n6isSDRHReyQhorXcCwMV5oWN1dXWD0un04bjVqta81to+i7bi7RpCiAmZTOYDv71iCu3cuXNQZ2env07fRkSTq+VcEtyQ7XwNEfkz5N8Ucl13khDiDR/b+ZlM5vkkhqopo5Q65Euj74loRGgElFJ3IuIThUnP8xqz2eyeajqXBFtrvR0AiuU7EXXbeIo/tNaPAMB9BVBmrpVS/l3KiDFmBjNPKbMbK0A+6zjOq3EktNavAUAxlUsR2AIA0ywgM3dIKYfFgRtjmph5apxc2Dwz/ySlHBynq7V+wV+tliLwPgBcmwdsJaLRceDGmD3MnI6Ti5j/g4j6x+lqrZ8EgGKTE0nAGPM0M9+Wj8BhKWV9HLjrukuFEPMBoMf+HKdrm3oimhcnFyy1IwkopRYj4soCYF1dXf3JPAMKfiilNiFisaSOJOC67nQhxCu+h3i0lLI1boWqPW+M6WDmoXk7+4io8L3rr+IuZIwZycztPocWEdHqajtYCl8pdSEifuOT2UhEc/w63fZUrfWvADCwixlii+M4408mAa31AgB4xufDHCLaGElAKbUZEf09cAMR/XCySGit7TXO3IJ9IcTQYI8cLKfvQsQ1BYVq9sBxi9La2jqipqbmMwA4Oy8bWtoHCTiIaBua0/JKB5hZSikPxhms9LxSah0i2i26MHoUct0eYt+2tRIRF5/MKGit7YFqD9auYU9tRBwfls49emJjzEBm3gEAxVKCmadJKbdWepWj8LTWHwLAlb75hUS0Nkw+6lbidkTspoCI6aibgUoSU0otR8QlBUxE3Oo4TleNlpiAFQwWUfa/XC7XZ8yYMccq6bAfS2v9OADcHUidqUT0RdkE8iS+BIBsQHkkEe2qNAml1HOIeGsA914isqQiR5LL3aMAcHoAYTIR2av0Ex7t7e3ne563mplvDoIh4le2xC+VurEE8pGwh1m3/sBec3ie96iUcndvWLS3t4/o7OycK4SYw8znRKZIDIlEBPIk7IrfGDB01JIAgJZsNtuShIjruplUKmWdtidsMLK2lFmFiPP8fUapSCQmYJ2L6cDsNfh7iLiXme1VjG3GOwFguOd5DYg4HAAa7O/Q3QTRXiavchxnhzHmIgCw3V6xWYoiURYBa9h13atTqdTssJxNEoEImQeJaIV/LimJsgkUjCilLrGXToho33mFrmoMod2I+LLneW9KKb8Nk01CotcE/AaVUmOFENcz8zgAGAIA54Y4dAgADiCifejtjcQnSSIWRgIAniIi+5q3cm/q/c40NzfX9e3bd4gQ4kxEPFhbW3sgnU7/lcThJJHwV8kViUBvHStHz0aCme2qe7W1tasbGxu7rkFPGQKR50Q5q/B/lP0HjgOoT/ydvaYAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-narrow:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABS1JREFUaEPVmgmoVVUUhr+fosKC5ogGSsqIpKQwMqjIBpsICdMGQ7ISo4wGApugJCoxLClssElpNEuaI5okKjOI5onKhEQrSiKiaKA/Vu3zOu+8c88593qvj7fgcO99e6/h33udtdda+4khThri9tM1ALaPAQ4Btso9GwNfAyuBb7JHUnzvCq0XANuTgePSs00bFr0L3BuPpF/b4BswtSMAyfDzgYPXRznweQ7ID53IaguA7ROBGcC4TpRV8IRL3SNpVrtyGwOwfVYoaaHgW2AZsBT4CliXnt+BXYBd02d8D5c7rIWc+ZJigRpTIwC2rwauKZH6NLBA0jONNQK2jwJOAU4FtijwPgpMkRTga6kWgO2XgSMKkjoyvGiN7d3SwpxZGHsVOEPSmjoElQBsPwScVhAyR9LMOsHtjNu+Hri8wPMBMF7SqipZLQHYvgq4tsA8S1KZK7Vjb+lc24cDsfJ5ul/SlLYBpGjzVIFxsaTw2Z6R7S2BnwoKpkta0Epp6Q7YfqEQKl+XdGjPLM8Jtn088GzuT9/FOyjpkzL9AwCkQ+qB3OSPki9GOrBByPZ1wBU5ZY9LOrkpgDcLJ2zlFvYCke2NgFcK58VkSRFU+lG/HbA9EYg4nNE7kkb3wsg6mSWesEhSMdz2z0Zt3wRcnBO+wVc/0217WMpesyRxraSd6nbgfWC/NOm3OP4lRVowKGQ73sXIeDMaJ+nFvDF9LmQ78pR8nr5U0oRBsTwpLQnn8yTlPeR/F7I9HngiZ/A0SXcPJoDQbftHIHOjLyTt1WoHLgBuyQ3uKylC6KBS8UyS1C/w5F3oRuDSnLWbSPqzynrbkSdFfG6nGstE3inpkbrVsf0Y0OfKVQAWA5OSwJWS9mggPEJuhN5OaLWkqBMqyfZ9QF/4rALwPHBskrZC0pgGwsPFRtbNazH+s6TIfeoA3JqqwH/nVQG4HTg3SVsnadsGwiMznQYMiM91vKmgP7tuXjHVrgJwGXBDTuC2g3kGZHbYXhQVWva7CkCkyg/nAIyRtKJuhXo9bjuSyOFJzypJ2ff/XCqHdBTwXs6gmZLm9NrAKvm29wY+zc1ZKGlqnqeYzH0PbJ8mLJM0dpABTAfuyNkwVdLCKgDFGniEpC8HC4TtaONEOyej4cUaubgDFwLzcgw9q4HrFsV2pAxvANuluaWpfRHAAUAUNJsmpmhrjJa0tk5ht8dtRx0cITqjAYlcv5c49zJHKI2QmtEG3wXbcaDGwZrRamBsmTuX1cTxEi8H8qnEJElLur3KreTZfgk4Mjc+Q9L8svmtuhLnAUWGka06A90EZjt6UdGTymiJpCxHG6CqqrHVL4lKnMMkRaXWE7J9M3BRwXUmSnqrlcK61uLbwIEF5lGSou3XVbJ9F3BOQeglkgJUS2rS3P0F2LwgYYKkaKWvN9neGYgT//QSYR9Hil/lurUAQqjtOMyK9UEkWXMlfdgJihTn45CK1GCHChmVIBoBSCBixU8qKIrdmRuXG5LigqOWbO+fjA7jizsbqcxsINLsfJ3REkRjAAlEVQUWbfDncjc0UYz/BewJjCh8lgGNZvJsSctt75MabLUg2gKQQBydSrwyn63dgRYTrpQUdwR91BRE2wAyDbYPSk2nuPOKVW6X4t15EHhS0mdlzE1AdAygsFpxwX0CEJcUuwM7lhgULhW5VRgeHYnXmiBuAeI2SXHN272b+gKgzRKQrYFIBNdI+qOJwQ13oi8/68oOdGpYO3xpJ2LV/45zI/t3hSEDoBXYIQ/gH99H3EBePlczAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-expand{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABvJJREFUaEPVWWmIXEUQrnqzZseYxGM9QBNF4hrJEDfzqieuAY/gFRXPyMYbzUHwQBQUzx+KeBAJKhrRqEhEQWMU75AYXREPlunu3bjxIDGraIwiuJpFkL26pMK84eXtm3lvZieGFAzsTtf1VVd3V9Ug7OOE+7j/0BAAnZ2d2UmTJl2cyWTaAOBA+TDzgYjYDAB/y4eZ5fNjc3Pze7NmzfqlUYEbFwBr7TUAcAEzXwAA2bROIeKnzrkNALBeKWXTysXx1QXAGHMVANwEACePxzgzjyLi057nrczn81vr0VUTAGOMRPtmRDy7HmOVZBDxL+fcyr6+vgc7OjqGatGdGoC19hZmfrKC8t9LafEWAGzLZDL9g4OD/S0tLYM7d+6cyszTPM+biojy97kAcGoFPV8ODw8vbG9v354WRCoAxpiXAUDyPUrvAcAqIno/rUHhs9aeCQALmflyAJgUlkXEf5xzp6U9G4kAjDHcKMejeqy1xzDz/QBwXYyNViL6ISkwVQEYY74AgLkRJcuJ6M4kxbWsW2sfZua7ozJNTU1HtLW1/VFNV0UAxpjlAHBHWNg590ChUJCINZyKxeLpnud1RhSvmzJlyiWtra2DFS+AuAW5bQDg3cja60QkObvHSGstj588fGVi5heVUktqAqC1Xh+5Kj8nolP2mOchxd3d3ec55z6I2JpPROvj7I9JodIj9UqIebNz7qJCodD3fwAQG8aYhwDgnpC99UQ0Py2ALyMv7DIiWvV/OS921qxZk5k+ffon4fcCEZf4vv9i1I/ddkBrfSUivhpiMkSkanXeWnsFAFwCADNHR0fX1nPwYzJhAxGdkwTgJUQM38l1Rd8Y8yYAXFoytoOIjqo1CFrriQDwCyIeEsh6nndsPp//KayrvANbt25tHhgY+AsA9i8x/JvNZqfmcrn+Wo1bazuZ+fRAjogSH8w4G8YYOYtSOAZ0GxE9EQvAGCMRk8gF9BYRLajVeeFvIIDdrnOpt3zfnxcLwFr7CDPfFdqupfl8/oW9CUBsa63/DKXRz0R0TCUAzzDzDcGic25WoVDYvLcBGGPk/i+X7wMDA/vNmzdvJPCrnJvW2leZ+cpggZknKKWGqwGw1l7IzOcg4swoX/gMyNbH6HnO9/3XkgJkjFkLAOVUzmQyM2bPnr1lDABjjJTE58sCM/cppaanUK4BgJL44taZebtSalqSrDHmpXC1ysynKKU+j9uBj5hZ6nShLiJqT1Jurd3MzLkkvgrrfxPRwUmyxpinAODmSqkdTqE3mPmy0g70K6VakpQXi8X7Pc9bCgBHJvHGrEsjtCxJLlpqDw8PTwt3bGEAzzNzuerLZrMt9bwB4lCjrtHSLbQaEa8NgGaz2cm5XO6fuDPwGADcHjrE7UqprqQIxa03EoC1to+Zjy3ZGZN25R3QWt+IiCtDDt1JRNLU1EyNAqC1PgERvws58DYRSY1VpjKA3t7eaUNDQz+Xtybm1UuLpFEAjDFyRp4N2a1cSsTlLgCkaqyjwBoIQMrnRYH+0dHR/Jw5c3pid6B0YO5GxIdDV1ZdPbC19nLn3GOIOAUA1hLR4rS7F/B1dXUd39TUJEOFQ+U7RNzo+/5ZUT3RfsBHRGloZCgrtIOZlVLqt1odGC+/1noVIsoVHdAiIpJHbTcaU+ZqrR9BxHJRtycnEZVAGmOkfVwXOo9bJk+efGLcdGIMAGvtYcz8FQCUSwlm7lBKvTHeqKaVN8ZsBIAz0qRybKMRc6VKDuZ83/82rRP18mmtH0TE+0LyHxNRUOKMUVuxU7LWlkuLQGpwcHDi3Llz/63XuSQ5Y8zjAHBrwMfM/cy8oFAoxFWzu9iSRou/xtQ5bUT0dZIzta5rrZ+XyUNYDhFv931/RTVdVQF0d3e3OufKtXdI0QIiklH6uKmnp+co59zycC8SOrzfAEBHtdRNbLaLxeIMz/O+H3N9Ia52zq1QSvXWg6Knp+f4kZGRRZ7nXc/Mh1fSgYhVQSQCEMW9vb1HDA0NyS0UHS/KLF+2+NNqeRp2rlgs5jOZjDgtL+wBEcdlEv0oIi4O9xnVQKQCIEZkTuN53uqgZ4iJmMxrPkTEbXL4AECaceldj3POtSLicVKayP9x0UZEGSY/6vv+V9ZaaVHXpAGRGkBgtFgsnpXJZK6Ly9l6Uqkkcy8RlUsY+S4tiJoBBE5qrU9CxKvlZ1YA2G3UkRJIr4wxnXPvKKXGnLG0IOoGEHZSnn5EvIiZTwKAowEgrh39U2orRJRDLxOJz9IAjdsJAHiGiORn3sb8Uh91ZNOmTQeMjIwcjYgHIeJvEyZM2JHL5Wr6+TSsMwoCEVf4vr+re2zIDqSJ5Hh5BAQzS9R/IiJpf3fRPgOg4jsx3sjsbfn/AH37LF5g3/BiAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-icon-expand:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABYZJREFUaEPVmXmoVVUUxn8f0WRzVkJlIWVGUmIJWWADTVaUldFclCnSQBQYNv1RSCWGVFRSlkRh0GBS2YBmJWGJUBHNNJiYWQSZfwTRxBfrce5jv/3Ovefc++4z3oKLD/fea61v7bXXdMQQJw1x/ekKANs7AOcA44Ddkt/2wJbk9z2wTNIP3TLcgADYvhw4q/gFiLq0ClgBLJf0Ud1DZfs6AmD7UuA64JiBCAf+BR4GHpH0TSe82gJgO6x9PXBqJ8JanPktQABzJP3VDu/aAGzfADzYhPnPQLjFUuA7YHPx+xPYHxhZ/Bt/nw4c14TP+8CFkjbWBVELgO2ngfD3nJYBCyW9Wldg7LN9cigKXATsnJ39HTi+7tuoBGDb3VI852P7QOBO4MoSGaMlfVtlmJYAbL8HHJsxmSdpdhXjdtZt3wPcWnJmhKRfWvFqCsD2PODm7PBdksJiXSfbJwDvZIzfAM6VFG+plEoBFNHmlezEc5LCZweNbEcSjMSX0iJJ09sFsDwLlaslTRo0zRPGts8AXstkTZYUOvWjfjdQJKnFyc7PgCmS1m0NACHD9t3AbYm8yNiT6wKIWJxm2JmSFm4t5QsA2wBvZ/liuqRFuR59bsD2JcAzyaYPJU1oV3nbF8fjAw4DlnTy8Es8YYWk06oAPJnF5I6sb/tF4LxC2CZJ+3VghGFAVK17JmdHSVqf8uq9AdtR+kZNsmOx4Y9I/5KiLGiLbEc4jLDYQ5IqE2aZANvxFqNwbNBNkh5oBiAsFpZr0FJJU9vSvNjcRQBRPKbhfJWkE5sBuBe4JVmcIemJ/xNAyLb9a+JGGyRF+dFLqQstAK5J1g6XFCG0berWDRQA8py0raR/et2z8YftiD4RhRq0naS/W2lv+2wgIkNEm5x630BRaufrj0l6tso6tpcAqSuPkfR1GYAoic8sFtZJOqgG8w+Ao6r2NVnfKCn6hJZkO4+MkyStLgPwJhB1etBaSRNrMA8XG1u1r8n6Fkl7VJ21/VDRBTa29nHt9A28AJxf7NosaXgN5lGZzgD2rdpbsh6N0MyqcyWl9si0Y0sBPA6kVd/wTnJAKNTlR/wUcEUCdBdJ0bX1UArgPmBWsnGipLVVFipb7zKAKCJHFXL6uV0K4NpiMtDQabakaGrapm4BsH0o8GWiwEuSosbqpRRARIQNyVq/rFcXSRcBxBt5NJHbvJQo812gVmOdA+sigCifpyX8x0v6uPQGCgDRWEeD3aCOemDb0XrGm9q1KKevrnt7jX22DwFiqLBX8X8rJZ2S88n7gSOBaGiiMg3aBEyQ9FO7Cgx0v+1ooiJEN2iapEhqfaispcyLuo5uYSAAbEf7GBOJBkXpcETZdKIMwN7AGiAtJS6QFIluq5DtlcBJdVy52VglD6nBa6ykLwYbge05wB2JnLckNUqcfuJbDbbS0qJxcJik6NQGhWzfD9yYMI9ucKqkGByXUtVo8ceSOmecpE+6jcB2XsqEiFmS5reSVQVgNNBbeyeMwioxSh8w2Y6GPzJ+2os0+H4OxPtr6rqVzbbtMcBXJZpGkTVf0qedoCjifCSpq4B9WvBoCaISQDC2PQKIN5GPF6MqjCuOsqOpn6bK2R5fKB3K75QpHpPouUAkvrTPaAqiFoACRMxpwuqNniE3WsxrXk++0EQzHr3rwVGSZP+WGTymD3MlrbEdLerzdUDUBtCQaDvSeXyQKPPZTrwpztwuKS1h4tZrgWgbQALkaOCy4hNrn1FHTRTxdmKQ8LKksjdWC0THADK/jtQ/BQhQBwBl7Wi4VNRWoXhMJN6tA7TJTSyQFJ95u/OlPlfEdjzOALI7EIVgzEfb+nyaGSh3p4h+Pd1jV26gjiUHuqe4ibD6eklRqvfQkAHQzABDHsB/7aMVT352GH8AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jb-pro-container .jb-pro-menu-icon-text,.jb-pro-container .jb-pro-quality-icon-text,.jb-pro-container .jb-pro-scale-icon-text,.jb-pro-container .jb-pro-speed-icon-text{font-size:14px;min-width:30px;height:20px;line-height:20px;cursor:pointer;text-align:center}.jb-pro-container .jb-pro-speed{box-sizing:border-box;text-align:center;font-size:14px;color:#fff;width:90px}.jb-pro-container .jb-pro-menu-list,.jb-pro-container .jb-pro-quality-menu-list,.jb-pro-container .jb-pro-scale-menu-list,.jb-pro-container .jb-pro-speed-menu-list{position:absolute;left:50%;bottom:100%;visibility:hidden;opacity:0;transform:translateX(-50%);transition:visibility .3s,opacity .3s;background-color:rgba(0,0,0,.5);border-radius:4px;overflow:hidden;width:-moz-max-content;width:max-content}.jb-pro-container .jb-pro-menu-list.jb-pro-menu-shown,.jb-pro-container .jb-pro-menu-list.jb-pro-quality-menu-shown,.jb-pro-container .jb-pro-menu-list.jb-pro-scale-menu-shown,.jb-pro-container .jb-pro-menu-list.jb-pro-speed-menu-shown,.jb-pro-container .jb-pro-quality-menu-list.jb-pro-menu-shown,.jb-pro-container .jb-pro-quality-menu-list.jb-pro-quality-menu-shown,.jb-pro-container .jb-pro-quality-menu-list.jb-pro-scale-menu-shown,.jb-pro-container .jb-pro-quality-menu-list.jb-pro-speed-menu-shown,.jb-pro-container .jb-pro-scale-menu-list.jb-pro-menu-shown,.jb-pro-container .jb-pro-scale-menu-list.jb-pro-quality-menu-shown,.jb-pro-container .jb-pro-scale-menu-list.jb-pro-scale-menu-shown,.jb-pro-container .jb-pro-scale-menu-list.jb-pro-speed-menu-shown,.jb-pro-container .jb-pro-speed-menu-list.jb-pro-menu-shown,.jb-pro-container .jb-pro-speed-menu-list.jb-pro-quality-menu-shown,.jb-pro-container .jb-pro-speed-menu-list.jb-pro-scale-menu-shown,.jb-pro-container .jb-pro-speed-menu-list.jb-pro-speed-menu-shown{visibility:visible;opacity:1}.jb-pro-container .icon-title-tips{pointer-events:none;position:absolute;left:50%;bottom:100%;visibility:hidden;opacity:0;transform:translateX(-50%);transition:visibility .3s ease 0s,opacity .3s ease 0s;background-color:rgba(0,0,0,.5);border-radius:4px}.jb-pro-container .icon-title{display:inline-block;padding:5px 10px;font-size:12px;white-space:nowrap;color:#fff}.jb-pro-container .jb-pro-quality-menu{padding:8px 0}.jb-pro-container .jb-pro-menu-item,.jb-pro-container .jb-pro-quality-menu-item,.jb-pro-container .jb-pro-scale-menu-item,.jb-pro-container .jb-pro-speed-menu-item{display:block;height:25px;line-height:25px;margin:0;padding:0 10px;cursor:pointer;font-size:14px;text-align:center;width:50px;color:hsla(0,0%,100%,.5);transition:color .3s,background-color .3s}.jb-pro-container .jb-pro-menu-item:hover,.jb-pro-container .jb-pro-quality-menu-item:hover,.jb-pro-container .jb-pro-scale-menu-item:hover,.jb-pro-container .jb-pro-speed-menu-item:hover{background-color:hsla(0,0%,100%,.2)}.jb-pro-container .jb-pro-menu-item:focus,.jb-pro-container .jb-pro-quality-menu-item:focus,.jb-pro-container .jb-pro-scale-menu-item:focus,.jb-pro-container .jb-pro-speed-menu-item:focus{outline:none}.jb-pro-container .jb-pro-menu-item.jb-pro-menu-item-active,.jb-pro-container .jb-pro-menu-item.jb-pro-quality-menu-item-active,.jb-pro-container .jb-pro-menu-item.jb-pro-scale-menu-item-active,.jb-pro-container .jb-pro-menu-item.jb-pro-speed-menu-item-active,.jb-pro-container .jb-pro-quality-menu-item.jb-pro-menu-item-active,.jb-pro-container .jb-pro-quality-menu-item.jb-pro-quality-menu-item-active,.jb-pro-container .jb-pro-quality-menu-item.jb-pro-scale-menu-item-active,.jb-pro-container .jb-pro-quality-menu-item.jb-pro-speed-menu-item-active,.jb-pro-container .jb-pro-scale-menu-item.jb-pro-menu-item-active,.jb-pro-container .jb-pro-scale-menu-item.jb-pro-quality-menu-item-active,.jb-pro-container .jb-pro-scale-menu-item.jb-pro-scale-menu-item-active,.jb-pro-container .jb-pro-scale-menu-item.jb-pro-speed-menu-item-active,.jb-pro-container .jb-pro-speed-menu-item.jb-pro-menu-item-active,.jb-pro-container .jb-pro-speed-menu-item.jb-pro-quality-menu-item-active,.jb-pro-container .jb-pro-speed-menu-item.jb-pro-scale-menu-item-active,.jb-pro-container .jb-pro-speed-menu-item.jb-pro-speed-menu-item-active{color:#2298fc}.jb-pro-container .jb-pro-volume-panel-wrap{position:absolute;left:50%;bottom:100%;visibility:hidden;opacity:0;transform:translateX(-50%) translateY(22%);transition:visibility .3s,opacity .3s;background-color:rgba(0,0,0,.5);border-radius:4px;height:120px;width:50px;overflow:hidden}.jb-pro-container .jb-pro-volume-panel-wrap.jb-pro-volume-panel-wrap-show{visibility:visible;opacity:1}.jb-pro-container .jb-pro-volume-panel{cursor:pointer;position:absolute;top:21px;height:60px;width:50px;overflow:hidden}.jb-pro-container .jb-pro-volume-panel-text{position:absolute;left:0;top:0;width:50px;height:20px;line-height:20px;text-align:center;color:#fff;font-size:12px}.jb-pro-container .jb-pro-volume-panel-handle{position:absolute;top:48px;left:50%;width:12px;height:12px;border-radius:12px;margin-left:-6px;background:#fff}.jb-pro-container .jb-pro-volume-panel-handle:before{bottom:-54px;background:#fff}.jb-pro-container .jb-pro-volume-panel-handle:after{bottom:6px;background:hsla(0,0%,100%,.2)}.jb-pro-container .jb-pro-volume-panel-handle:after,.jb-pro-container .jb-pro-volume-panel-handle:before{content:"";position:absolute;display:block;left:50%;width:3px;margin-left:-1px;height:60px}.jb-pro-container.jb-pro-fullscreen-web .jb-pro-controls{width:100vh}.jb-pro-container.jb-pro-fullscreen-web .jb-pro-play-big:after{transform:translate(-50%,-50%) rotate(270deg)}.jb-pro-container.jb-pro-fullscreen-web .jb-pro-loading{flex-direction:row}.jb-pro-container.jb-pro-fullscreen-web .jb-pro-loading-text{transform:rotate(270deg)}.jb-pro-container .jb-pro-contextmenus{display:none;flex-direction:column;position:absolute;z-index:120;left:10px;top:10px;min-width:200px;padding:5px 0;background-color:rgba(0,0,0,.9);border-radius:3px}.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu{cursor:pointer;font-size:12px;display:block;color:#fff;padding:10px 15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu a{color:#fff;text-decoration:none}.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu span{display:inline-block;padding:0 7px}.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu span.art-current,.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu span:hover{color:var(--theme)}.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.jb-pro-container .jb-pro-contextmenus .jb-pro-contextmenu:last-child{border-bottom:none}.jb-pro-container.jb-pro-contextmenus-show .jb-pro-contextmenus{display:flex}.jb-pro-container .jb-pro-extend-dom{display:block;position:relative;width:100%;height:100%;display:none}.jb-pro-container-playback .jb-pro-controls{height:48px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center{flex:1;display:flex;box-sizing:border-box;justify-content:space-between;font-size:12px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time{box-sizing:border-box;flex:1;position:relative;height:100%}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-inner{width:300px;height:100%;overflow-y:hidden;overflow-x:auto}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-current-time{position:absolute;left:0;top:0;height:15px;width:1px;background-color:red;text-align:center;z-index:1}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-current-time-text{position:absolute;box-sizing:border-box;padding:0 5px;width:60px;left:-25px;top:15px;border:1px solid red;height:15px;line-height:15px;cursor:move;background-color:#fff;color:#000;-webkit-user-select:none;-moz-user-select:none;user-select:none}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-scroll{position:relative;width:1440px;margin:0 auto}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-scroll.one-hour{width:1440px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-scroll.half-hour{width:2880px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-scroll.ten-min{width:8640px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-scroll.five-min{width:17280px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-scroll.one-min{width:86400px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-time-list{position:relative;background-color:#ccc;height:48px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-day{height:100%;overflow:hidden}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-one-wrap{height:8px;z-index:1}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-second-wrap{height:25px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-controls-playback-btns{display:flex;align-items:center}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute-one,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-second-one{float:left;width:1px;height:8px;margin:0;cursor:default;position:relative;z-index:1}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute-one.active,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-second-one.active{background-color:orange;cursor:pointer}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute-one.start,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-second-one.start{background-color:#999}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute-one:hover .jb-pro-playback-time-title-tips,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-second-one:hover .jb-pro-playback-time-title-tips{visibility:visible;opacity:1}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-title-tips{pointer-events:none;position:absolute;left:0;top:100%;visibility:hidden;opacity:0;transform:translateX(13%);transition:visibility .3s ease 0s,opacity .3s ease 0s;background-color:#000;border-radius:4px;z-index:1}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-title-tips.jb-pro-playback-time-title-tips-left{transform:translateX(-100%)}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-title-tips .jb-pro-playback-time-title{display:inline-block;padding:2px 5px;font-size:12px;white-space:nowrap;color:#fff}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-hour,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute{float:left;position:relative;width:60px;box-sizing:border-box;border-top:1px solid #999;-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:left;height:25px;line-height:25px}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-hour:first-child,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute:first-child{border-left:0}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-hour:first-child .jb-pro-playback-time-hour-text,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute:first-child .jb-pro-playback-time-hour-text{left:0}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-hour:after,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute:after{content:"";position:absolute;left:0;top:-8px;width:1px;height:14px;background-color:#999}.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-hour-text,.jb-pro-container-playback .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-center .jb-pro-playback-time-minute-text{position:absolute;left:-13px}.jb-pro-container-playback .jb-pro-playback-expand.disabled .jb-pro-icon-expand,.jb-pro-container-playback .jb-pro-playback-narrow.disabled .jb-pro-icon-narrow{cursor:no-drop}.jb-pro-container-playback .jb-pro-control-progress-simple{position:absolute;box-sizing:border-box;left:0;top:-2px;width:100%;display:flex;flex-direction:row;align-items:center;height:8px;cursor:pointer}.jb-pro-container-playback .jb-pro-control-progress-simple:hover{top:0;align-items:flex-start}.jb-pro-container-playback .jb-pro-control-progress-simple:hover .jb-pro-control-progress-inner{height:100%}.jb-pro-container-playback .jb-pro-control-progress-simple:hover .jb-pro-control-progress-inner .jb-pro-progress-indicator{transform:scale(1);visibility:visible}.jb-pro-container-playback .jb-pro-control-progress-inner{display:flex;align-items:center;position:relative;height:50%;width:100%;transition:all .2s ease;background:hsla(0,0%,100%,.5)}.jb-pro-container-playback .jb-pro-progress-hover{display:none;width:0}.jb-pro-container-playback .jb-pro-progress-played{position:absolute;left:0;top:0;right:0;bottom:0;height:100%;width:0;background-color:orange}.jb-pro-container-playback .jb-pro-progress-indicator{visibility:hidden;align-items:center;justify-content:center;position:absolute;z-index:40;border-radius:50%;transform:scale(.1);transition:transform .1s ease-in-out}.jb-pro-container-playback .jb-pro-progress-indicator .jb-pro-icon{width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.jb-pro-container-playback .jb-pro-progress-indicator:hover{transform:scale(1.2)!important}.jb-pro-container-playback .jb-pro-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700;white-space:nowrap}.jb-pro-container-playback.jb-pro-fullscreen-web .jb-pro-controls .jb-pro-controls-bottom .jb-pro-controls-playback-time-inner{overflow-y:auto}.jb-pro-zoom-control{cursor:grab}.jb-pro-performance-panel{position:absolute;box-sizing:border-box;z-index:10000;left:0;top:0;padding:5px;font-size:10px;background:rgba(0,0,0,.2);color:#fff;max-height:100%;overflow-y:auto;display:none}.jb-pro-performance-panel .jb-pro-performance-item{display:flex;align-items:center;margin-top:3px;color:#fff}.jb-pro-performance-panel .jb-pro-performance-item-block{height:10px}.jb-pro-tips-message{position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(180deg,rgba(0,0,0,.8),hsla(0,0%,100%,0));overflow:auto;box-sizing:content-box;display:none}.jb-pro-tips-message:before{color:hsla(0,0%,100%,.3);content:"X";font-family:Arial,Helvetica,sans-serif;font-size:40px;left:0;line-height:1;margin-top:-20px;position:absolute;text-shadow:2em 2em 4em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.jb-pro-tips-message .jb-pro-tips-message-close{position:absolute;z-index:99999;right:0;top:0;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.jb-pro-tips-message .jb-pro-tips-message-close .jb-pro-tips-message-close-icon{width:20px;height:20px;border-radius:10px;cursor:pointer;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTM3Nzc7Ozs7Ozs3Nzc3NzcrKys3Nzc3Nzc3NzePZJxkAAAAJdFJOUwCtKdPBGAmNTt3jdDcAAADfSURBVDjL1dOxDoIwEADQgwR07GTCZtI/IGHgAzBhM9EPkMTB0Y3V0ZXIcn/rtRR6pefgSKeSu3ellyvA9lZ/5F9p/3K7PZY8oPG5BD6MpPUSgIITzdIStifAshjRQV1PCFT8TxaicTzzwEwINOEdHVmDmcTAkRhMhMAp7iQRjcMtDhCp8SA1v0ARGIIK/gnkv0p1OBTS4QRUIpE7DiYYXTBrzcld3JIrAarXrps4AVNwRSZgExoJmIyAaAdsShUMn/JF2fh4YEkpAcgvnuwYCIb6EbbbP4PsDfLD2dD6Av1qTvAQlzUTAAAAAElFTkSuQmCC") no-repeat 50%;background-color:#fff;background-size:100% 100%}.jb-pro-tips-message .jb-pro-tips-message-content{overflow:auto;padding:35px;box-sizing:border-box;width:100%;height:100%}.jb-pro-tips-message .jb-pro-tips-message-content .jb-pro-tips-message-content-item{font-size:14px;color:#fff;text-align:center;line-height:1.5}');var od=function(){function e(t){var i,r=this;S(this,e),this.player=t,this.TAG_NAME="Control",this.extendBtnList=[],function(e,t){e._opt.hasControl&&e._opt.controlAutoHide?e.$container.classList.add("jb-pro-controls-show-auto-hide"):e.$container.classList.add("jb-pro-controls-show");var i=e._opt,r=i.operateBtns,a='\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
00:00:00
\n
\n
\n
\n
\n '.concat(i.playbackConfig.showPrecisionBtn?'\n
\n
'.concat(Wu.narrow,'
\n
').concat(Wu.expand,"
\n
\n "):"","\n
\n ");e.$container.insertAdjacentHTML("beforeend","\n ".concat(i.background?'
'):"",'\n
\n \n
\n ').concat(i.loadingIcon?'\n
\n '.concat(Wu.loading,'\n
').concat(i.loadingText,"
\n
\n "):"","\n ").concat(i.hasControl&&r.play?'
':"","\n ").concat(i.hasControl&&r.ptz?'\n
\n
\n
\n
\n
\n
\n ').concat(i.ptzMoreArrowShow?'\n
\n
\n
\n
\n ':"",'\n
\n
\n ').concat(i.ptzZoomShow?'\n
\n
\n \n \n 缩放+\n \n
\n
\n \n \n 缩放-\n \n
\n
\n ':"","\n ").concat(i.ptzApertureShow?'\n
\n
\n \n \n 光圈+\n \n
\n
\n \n \n 光圈-\n \n
\n
\n ':"","\n ").concat(i.ptzFocusShow?'\n
\n
\n \n \n 聚焦+\n \n
\n
\n \n \n 聚焦-\n \n
\n
\n ':"","\n ").concat(i.ptzCruiseShow?'\n
\n
\n \n \n 巡航开\n \n
\n
\n \n \n 巡航关\n \n
\n
\n ':"","\n ").concat(i.ptzFogShow?'\n
\n
\n \n \n 透雾开\n \n
\n
\n \n \n 透雾关\n \n
\n
\n ':"","\n\n ").concat(i.ptzWiperShow?'\n
\n
\n \n \n 雨刷开\n \n
\n
\n \n \n 雨刷关\n \n
\n
\n ':"","\n
\n
\n "):"","\n ").concat(i.hasVideo?'\n
\n
'.concat(Wu.narrow,'
\n
电子放大
\n
').concat(Wu.expand,'
\n
').concat(Wu.zoomStop,'
\n
\n
\n
\n
00:00:00
\n
').concat(Wu.recordStop,"
\n
\n "):"","\n\n ").concat(i.hasControl?'\n
\n
\n
\n '.concat(i.showBandwidth?'
':"",'\n
\n
').concat(i.controlHtml,"
\n
\n ").concat(i.playType===z&&i.playbackConfig.showControl&&i.playbackConfig.controlType===ve.normal?a:"","\n ").concat(i.playType===z&&i.playbackConfig.showControl&&i.playbackConfig.controlType===ve.simple?'\n
\n
\n
\n
\n
\n
00:00
\n
\n
\n ':"",'\n
\n ').concat(i.playType===z&&i.playbackConfig.showRateBtn?'\n
\n
\n
\n
\n
\n
\n ':"","\n ").concat(r.close?'
'.concat(Wu.close,"
"):"","\n ").concat(r.logSave?'
'.concat(Wu.logSave,"
"):"","\n ").concat(r.performance?'
'.concat(Wu.performance,'
').concat(Wu.performanceActive,"
"):"","\n ").concat(r.aiFace?'
'.concat(Wu.face,'
').concat(Wu.faceActive,"
"):"","\n ").concat(r.aiObject?'
'.concat(Wu.object,'
').concat(Wu.objectActive,"
"):"","\n ").concat(r.aiOcclusion?'
'.concat(Wu.occlusion,'
').concat(Wu.occlusionActive,"
"):"","\n ").concat(r.quality?'\n
\n
\n
\n
\n
\n
\n ':"","\n ").concat(r.scale?'\n
\n
\n
\n
\n
\n
\n ':"","\n ").concat(r.audio?'\n
\n
\n '.concat(Wu.audio,"\n ").concat(Wu.mute,'\n
\n
\n
\n
\n
\n
\n
\n
\n '):"","\n ").concat(r.play?'
'.concat(Wu.play,'
').concat(Wu.pause,"
"):"","\n ").concat(r.screenshot?'
'.concat(Wu.screenshot,"
"):"","\n ").concat(r.record?'
'.concat(Wu.record,'
').concat(Wu.recordStop,"
"):"","\n ").concat(r.ptz?'
'.concat(Wu.ptz,'
').concat(Wu.ptzActive,"
"):"","\n ").concat(r.zoom?'
'.concat(Wu.zoom,'
').concat(Wu.zoomStop,"
"):"","\n ").concat(r.fullscreen?'
'.concat(Wu.fullscreen,'
').concat(Wu.fullscreenExit,"
"):"","\n
\n
\n
\n "):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n ')),Object.defineProperty(t,"$poster",{value:e.$container.querySelector(".jb-pro-poster")}),Object.defineProperty(t,"$loadingBg",{value:e.$container.querySelector(".jb-pro-loading-bg")}),Object.defineProperty(t,"$loadingBgImage",{value:e.$container.querySelector(".jb-pro-loading-bg-image")}),Object.defineProperty(t,"$loading",{value:e.$container.querySelector(".jb-pro-loading")}),Object.defineProperty(t,"$loadingText",{value:e.$container.querySelector(".jb-pro-loading-text")}),Object.defineProperty(t,"$play",{value:e.$container.querySelector(".jb-pro-play")}),Object.defineProperty(t,"$playBig",{value:e.$container.querySelector(".jb-pro-play-big")}),Object.defineProperty(t,"$recording",{value:e.$container.querySelector(".jb-pro-recording")}),Object.defineProperty(t,"$recordingTime",{value:e.$container.querySelector(".jb-pro-recording-time")}),Object.defineProperty(t,"$recordingStop",{value:e.$container.querySelector(".jb-pro-recording-stop")}),Object.defineProperty(t,"$pause",{value:e.$container.querySelector(".jb-pro-pause")}),Object.defineProperty(t,"$controls",{value:e.$container.querySelector(".jb-pro-controls")}),Object.defineProperty(t,"$controlsInner",{value:e.$container.querySelector(".jb-pro-controls-bottom")}),Object.defineProperty(t,"$controlsLeft",{value:e.$container.querySelector(".jb-pro-controls-left")}),Object.defineProperty(t,"$controlsRight",{value:e.$container.querySelector(".jb-pro-controls-right")}),Object.defineProperty(t,"$volume",{value:e.$container.querySelector(".jb-pro-volume")}),Object.defineProperty(t,"$volumePanelWrap",{value:e.$container.querySelector(".jb-pro-volume-panel-wrap")}),Object.defineProperty(t,"$volumePanelText",{value:e.$container.querySelector(".jb-pro-volume-panel-text")}),Object.defineProperty(t,"$volumePanel",{value:e.$container.querySelector(".jb-pro-volume-panel")}),Object.defineProperty(t,"$volumeHandle",{value:e.$container.querySelector(".jb-pro-volume-panel-handle")}),Object.defineProperty(t,"$volumeOn",{value:e.$container.querySelector(".jb-pro-icon-audio")}),Object.defineProperty(t,"$volumeOff",{value:e.$container.querySelector(".jb-pro-icon-mute")}),Object.defineProperty(t,"$fullscreen",{value:e.$container.querySelector(".jb-pro-fullscreen")}),Object.defineProperty(t,"$fullscreenExit",{value:e.$container.querySelector(".jb-pro-fullscreen-exit")}),Object.defineProperty(t,"$record",{value:e.$container.querySelector(".jb-pro-record")}),Object.defineProperty(t,"$recordStop",{value:e.$container.querySelector(".jb-pro-record-stop")}),Object.defineProperty(t,"$screenshot",{value:e.$container.querySelector(".jb-pro-screenshot")}),Object.defineProperty(t,"$speed",{value:e.$container.querySelector(".jb-pro-speed")}),Object.defineProperty(t,"$controlHtml",{value:e.$container.querySelector(".jb-pro-controls-item-html")}),Object.defineProperty(t,"$playbackTime",{value:e.$container.querySelector(".jb-pro-controls-playback-time")}),Object.defineProperty(t,"$playbackTimeInner",{value:e.$container.querySelector(".jb-pro-controls-playback-time-inner")}),Object.defineProperty(t,"$playbackTimeScroll",{value:e.$container.querySelector(".jb-pro-controls-playback-time-scroll")}),Object.defineProperty(t,"$playbackTimeList",{value:e.$container.querySelector(".jb-pro-controls-playback-time-list")}),Object.defineProperty(t,"$playbackTimeListOne",{value:e.$container.querySelector(".jb-pro-playback-time-one-wrap")}),Object.defineProperty(t,"$playbackTimeListSecond",{value:e.$container.querySelector(".jb-pro-playback-time-second-wrap")}),Object.defineProperty(t,"$playbackCurrentTime",{value:e.$container.querySelector(".jb-pro-controls-playback-current-time")}),Object.defineProperty(t,"$playbackCurrentTimeText",{value:e.$container.querySelector(".jb-pro-controls-playback-current-time-text")}),Object.defineProperty(t,"$controlsPlaybackBtns",{value:e.$container.querySelector(".jb-pro-controls-playback-btns")}),Object.defineProperty(t,"$playbackNarrow",{value:e.$container.querySelector(".jb-pro-playback-narrow")}),Object.defineProperty(t,"$playbackExpand",{value:e.$container.querySelector(".jb-pro-playback-expand")}),Object.defineProperty(t,"$ptz",{value:e.$container.querySelector(".jb-pro-ptz")}),Object.defineProperty(t,"$ptzActive",{value:e.$container.querySelector(".jb-pro-ptz-active")}),Object.defineProperty(t,"$ptzControl",{value:e.$container.querySelector(".jb-pro-ptz-controls")}),Object.defineProperty(t,"$ptzBgActive",{value:e.$container.querySelector(".jb-pro-ptz-bg-active")}),Object.defineProperty(t,"$ptzControlCircular",{value:e.$container.querySelector(".jb-pro-ptz-control")}),Object.defineProperty(t,"$ptzArrows",{value:e.$container.querySelectorAll(".jb-pro-ptz-arrow")}),Object.defineProperty(t,"$ptzExpand",{value:e.$container.querySelector(".jb-pro-ptz-expand")}),Object.defineProperty(t,"$ptzNarrow",{value:e.$container.querySelector(".jb-pro-ptz-narrow")}),Object.defineProperty(t,"$ptzApertureFar",{value:e.$container.querySelector(".jb-pro-ptz-aperture-far")}),Object.defineProperty(t,"$ptzApertureNear",{value:e.$container.querySelector(".jb-pro-ptz-aperture-near")}),Object.defineProperty(t,"$ptzFocusFar",{value:e.$container.querySelector(".jb-pro-ptz-focus-far")}),Object.defineProperty(t,"$ptzFocusNear",{value:e.$container.querySelector(".jb-pro-ptz-focus-near")}),Object.defineProperty(t,"$ptzCruisePlay",{value:e.$container.querySelector(".jb-pro-ptz-cruise-play")}),Object.defineProperty(t,"$ptzCruisePause",{value:e.$container.querySelector(".jb-pro-ptz-cruise-pause")}),Object.defineProperty(t,"$ptzFogOpen",{value:e.$container.querySelector(".jb-pro-ptz-fog-open")}),Object.defineProperty(t,"$ptzFogClose",{value:e.$container.querySelector(".jb-pro-ptz-fog-close")}),Object.defineProperty(t,"$ptzWiperOpen",{value:e.$container.querySelector(".jb-pro-ptz-wiper-open")}),Object.defineProperty(t,"$ptzWiperClose",{value:e.$container.querySelector(".jb-pro-ptz-wiper-close")}),Object.defineProperty(t,"$qualityText",{value:e.$container.querySelector(".jb-pro-quality-icon-text")}),Object.defineProperty(t,"$qualityMenu",{value:e.$container.querySelector(".jb-pro-quality-menu")}),Object.defineProperty(t,"$qualityMenuList",{value:e.$container.querySelector(".jb-pro-quality-menu-list")}),Object.defineProperty(t,"$scaleText",{value:e.$container.querySelector(".jb-pro-scale-icon-text")}),Object.defineProperty(t,"$scaleMenu",{value:e.$container.querySelector(".jb-pro-scale-menu")}),Object.defineProperty(t,"$scaleMenuList",{value:e.$container.querySelector(".jb-pro-scale-menu-list")}),Object.defineProperty(t,"$zoom",{value:e.$container.querySelector(".jb-pro-zoom")}),Object.defineProperty(t,"$zoomStop",{value:e.$container.querySelector(".jb-pro-zoom-stop")}),Object.defineProperty(t,"$zoomNarrow",{value:e.$container.querySelector(".jb-pro-zoom-narrow")}),Object.defineProperty(t,"$zoomExpand",{value:e.$container.querySelector(".jb-pro-zoom-expand")}),Object.defineProperty(t,"$zoomStop2",{value:e.$container.querySelector(".jb-pro-zoom-stop2")}),Object.defineProperty(t,"$close",{value:e.$container.querySelector(".jb-pro-close")}),Object.defineProperty(t,"$zoomControls",{value:e.$container.querySelector(".jb-pro-zoom-controls")}),Object.defineProperty(t,"$performancePanel",{value:e.$container.querySelector(".jb-pro-performance-panel")}),Object.defineProperty(t,"$performance",{value:e.$container.querySelector(".jb-pro-performance")}),Object.defineProperty(t,"$performanceActive",{value:e.$container.querySelector(".jb-pro-performance-active")}),Object.defineProperty(t,"$faceDetect",{value:e.$container.querySelector(".jb-pro-face")}),Object.defineProperty(t,"$faceDetectActive",{value:e.$container.querySelector(".jb-pro-face-active")}),Object.defineProperty(t,"$objectDetect",{value:e.$container.querySelector(".jb-pro-object")}),Object.defineProperty(t,"$objectDetectActive",{value:e.$container.querySelector(".jb-pro-object-active")}),Object.defineProperty(t,"$occlusionDetect",{value:e.$container.querySelector(".jb-pro-occlusion")}),Object.defineProperty(t,"$occlusionDetectActive",{value:e.$container.querySelector(".jb-pro-occlusion-active")}),Object.defineProperty(t,"$contextmenus",{value:e.$container.querySelector(".jb-pro-contextmenus")}),Object.defineProperty(t,"$speedText",{value:e.$container.querySelector(".jb-pro-speed-icon-text")}),Object.defineProperty(t,"$speedMenu",{value:e.$container.querySelector(".jb-pro-speed-menu")}),Object.defineProperty(t,"$speedMenuList",{value:e.$container.querySelector(".jb-pro-speed-menu-list")}),Object.defineProperty(t,"$logSave",{value:e.$container.querySelector(".jb-pro-logSave")}),Object.defineProperty(t,"$playbackProgress",{value:e.$container.querySelector(".jb-pro-control-progress-simple")}),Object.defineProperty(t,"$playbackProgressTip",{value:e.$container.querySelector(".jb-pro-progress-tip")}),Object.defineProperty(t,"$playbackProgressHover",{value:e.$container.querySelector(".jb-pro-progress-hover")}),Object.defineProperty(t,"$playbackProgressPlayed",{value:e.$container.querySelector(".jb-pro-progress-played")}),Object.defineProperty(t,"$playbackProgressIndicator",{value:e.$container.querySelector(".jb-pro-progress-indicator")}),Object.defineProperty(t,"$playbackProgressTime",{value:e.$container.querySelector(".jb-pro-playback-control-time")}),Object.defineProperty(t,"$tipsMessage",{value:e.$container.querySelector(".jb-pro-tips-message")}),Object.defineProperty(t,"$tipsMessageClose",{value:e.$container.querySelector(".jb-pro-tips-message-close")}),Object.defineProperty(t,"$tipsMessageContent",{value:e.$container.querySelector(".jb-pro-tips-message-content")})}(t,this),t._opt.extendOperateBtns.length>0&&t._opt.extendOperateBtns.forEach((function(e){r.addExtendBtn(e)})),t._opt.extendDomConfig&&t._opt.extendDomConfig.html&&this.addExtendDom(t._opt.extendDomConfig),i=this,Object.defineProperty(i,"controlsRect",{get:function(){return i.$controls.getBoundingClientRect()}}),Object.defineProperty(i,"controlsInnerRect",{get:function(){return i.$controlsInner.getBoundingClientRect()}}),Object.defineProperty(i,"controlsLeftRect",{get:function(){return i.$controlsLeft.getBoundingClientRect()}}),Object.defineProperty(i,"controlsRightRect",{get:function(){return i.$controlsRight.getBoundingClientRect()}}),Object.defineProperty(i,"controlsPlaybackTimeInner",{get:function(){return i.$playbackTimeInner&&i.$playbackTimeInner.getBoundingClientRect()||{}}}),Object.defineProperty(i,"controlsPlaybackBtnsRect",{get:function(){return i.$controlsPlaybackBtns&&i.$controlsPlaybackBtns.getBoundingClientRect()||{width:0}}}),ad(t,this),function(e,t){var i=e.events.proxy,r=(e.debug,e._opt),a=r.operateBtns;function n(e){var i=t.$volumePanel.getBoundingClientRect(),r=i.bottom,a=i.height,n=t.$volumeHandle.getBoundingClientRect(),o=n.height;return In(r-e.y-o/2,0,a-o/2)/(a-o)}if(Nn()&&i(window,["click","contextmenu"],(function(i){i.composedPath().indexOf(e.$container)>-1?t.isFocus=!0:t.isFocus=!1})),i(t.$controls,"click",(function(e){e.stopPropagation()})),a.play&&(i(t.$pause,"click",(function(t){r.playType===z&&r.playbackConfig.uiUsePlaybackPause?e.playbackPause=!0:wo(a.pauseFn)?a.pauseFn():e.pauseForControl()})),i(t.$play,"click",(function(t){r.playType===z&&e.playbackPause?e.playbackPause=!1:wo(a.playFn)?a.playFn():e.playForControl().then((function(){e.resumeAudioAfterPause()}))}))),i(t.$playBig,"click",(function(t){r.playType===z&&e.playbackPause?e.playbackPause=!1:wo(a.playFn)?a.playFn():e.playForControl().then((function(){e.resumeAudioAfterPause()}))})),a.screenshot&&i(t.$screenshot,"click",(function(t){t.stopPropagation(),wo(a.screenshotFn)?a.screenshotFn():e.video.screenshot()})),a.audio&&(Nn()&&(i(t.$volume,"mouseover",(function(){t.$volumePanelWrap.classList.add("jb-pro-volume-panel-wrap-show")})),i(t.$volume,"mouseout",(function(){t.$volumePanelWrap.classList.remove("jb-pro-volume-panel-wrap-show")})),i(t.$volumePanel,"click",(function(t){t.stopPropagation(),e.volume=n(t)})),i(t.$volumeHandle,"mousedown",(function(e){e.stopPropagation(),t.isVolumeDroging=!0})),i(t.$volumeHandle,"mousemove",(function(i){t.isVolumeDroging&&(e.volume=n(i))})),i(document,"mouseup",(function(){t.isVolumeDroging&&(t.isVolumeDroging=!1)}))),i(t.$volumeOn,"click",(function(i){i.stopPropagation(),Pn(t.$volumeOn,"display","none"),Pn(t.$volumeOff,"display","block");var r=e.volume;e.volume=0,e._lastVolume=Nn()?r:1})),i(t.$volumeOff,"click",(function(i){i.stopPropagation(),Pn(t.$volumeOn,"display","block"),Pn(t.$volumeOff,"display","none"),e.volume=Nn()?e.lastVolume||.5:1}))),a.record&&(i(t.$record,"click",(function(t){t.stopPropagation(),wo(a.recordFn)?a.recordFn():e.recording=!0})),i(t.$recordStop,"click",(function(t){t.stopPropagation(),wo(a.recordStopFn)?a.recordStopFn():e.recording=!1}))),i(t.$recordingStop,"click",(function(t){t.stopPropagation(),wo(a.recordStopFn)?a.recordStopFn():e.recording=!1})),a.fullscreen&&(i(t.$fullscreen,"click",(function(t){t.stopPropagation(),wo(a.fullscreenFn)?a.fullscreenFn():e.fullscreen=!0})),i(t.$fullscreenExit,"click",(function(t){t.stopPropagation(),wo(a.fullscreenExitFn)?a.fullscreenExitFn():e.fullscreen=!1}))),a.ptz){if(i(t.$ptz,"click",(function(e){e.stopPropagation(),Pn(t.$ptzActive,"display","flex"),Pn(t.$ptz,"display","none"),t.$ptzControl.classList.add("jb-pro-ptz-controls-show")})),i(t.$ptzActive,"click",(function(e){e.stopPropagation(),Pn(t.$ptz,"display","flex"),Pn(t.$ptzActive,"display","none"),t.$ptzControl.classList.remove("jb-pro-ptz-controls-show")})),t.$ptzArrows.forEach((function(a){if(r.ptzClickType===ge)i(a,"click",(function(i){i.stopPropagation();var a=i.currentTarget.dataset.arrow;t.$ptzBgActive.classList.add("jb-pro-ptz-bg-active-show"),t.$ptzBgActive.classList.add("jb-pro-ptz-bg-active-".concat(a)),t.$ptzControlCircular.classList.add("jb-pro-ptz-control-".concat(a)),e.emit(xt.ptz,zo(a)),setTimeout((function(){t.$ptzBgActive.classList.remove("jb-pro-ptz-bg-active-show"),Yi.forEach((function(e){t.$ptzBgActive.classList.remove("jb-pro-ptz-bg-active-".concat(e)),t.$ptzControlCircular.classList.remove("jb-pro-ptz-control-".concat(e))})),e.emit(xt.ptz,Qi)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===ye){var n=!1;i(a,"mousedown",(function(i){i.stopPropagation(),n=!0;var r=i.currentTarget.dataset.arrow;t.$ptzBgActive.classList.add("jb-pro-ptz-bg-active-show"),t.$ptzBgActive.classList.add("jb-pro-ptz-bg-active-".concat(r)),t.$ptzControlCircular.classList.add("jb-pro-ptz-control-".concat(r)),e.emit(xt.ptz,zo(r))}));var o=function(){n=!1,t.$ptzBgActive.classList.remove("jb-pro-ptz-bg-active-show"),Yi.forEach((function(e){t.$ptzBgActive.classList.remove("jb-pro-ptz-bg-active-".concat(e)),t.$ptzControlCircular.classList.remove("jb-pro-ptz-control-".concat(e))})),e.emit(xt.ptz,Qi)};i(a,"mouseup",(function(e){e.stopPropagation(),n&&o()})),i(window,"mouseup",(function(e){e.stopPropagation(),n&&o()}))}})),r.ptzZoomShow)if(r.ptzClickType===ge)i(t.$ptzExpand,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,Zi),setTimeout((function(){e.emit(xt.ptz,Qi)}),1e3*r.ptzStopEmitDelay)})),i(t.$ptzNarrow,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,$i),setTimeout((function(){e.emit(xt.ptz,Qi)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===ye){var o=!1,s=!1;i(t.$ptzExpand,"mousedown",(function(t){t.stopPropagation(),o=!0,e.emit(xt.ptz,Zi)})),i(t.$ptzNarrow,"mousedown",(function(t){t.stopPropagation(),s=!0,e.emit(xt.ptz,$i)}));var l=function(){o=!1,s=!1,e.emit(xt.ptz,Qi)};i(t.$ptzExpand,"mouseup",(function(e){e.stopPropagation(),o&&l()})),i(t.$ptzNarrow,"mouseup",(function(e){e.stopPropagation(),s&&l()})),i(window,"mouseup",(function(e){e.stopPropagation(),(o||s)&&l()}))}if(r.ptzApertureShow)if(r.ptzClickType===ge)i(t.$ptzApertureFar,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,er),setTimeout((function(){e.emit(xt.ptz,Xi)}),1e3*r.ptzStopEmitDelay)})),i(t.$ptzApertureNear,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,tr),setTimeout((function(){e.emit(xt.ptz,Xi)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===ye){var c=!1,u=!1;i(t.$ptzApertureFar,"mousedown",(function(t){t.stopPropagation(),c=!0,e.emit(xt.ptz,er)})),i(t.$ptzApertureNear,"mousedown",(function(t){t.stopPropagation(),u=!0,e.emit(xt.ptz,tr)}));var d=function(){c=!1,u=!1,e.emit(xt.ptz,Xi)};i(t.$ptzApertureFar,"mouseup",(function(e){e.stopPropagation(),c&&d()})),i(t.$ptzApertureNear,"mouseup",(function(e){e.stopPropagation(),u&&d()})),i(window,"mouseup",(function(e){e.stopPropagation(),(c||u)&&d()}))}if(r.ptzFocusShow)if(r.ptzClickType===ge)i(t.$ptzFocusFar,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,ir),setTimeout((function(){e.emit(xt.ptz,Xi)}),1e3*r.ptzStopEmitDelay)})),i(t.$ptzFocusNear,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,rr),setTimeout((function(){e.emit(xt.ptz,Xi)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===ye){var h=!1,p=!1;i(t.$ptzFocusFar,"mousedown",(function(t){t.stopPropagation(),h=!0,e.emit(xt.ptz,ir)})),i(t.$ptzFocusNear,"mousedown",(function(t){t.stopPropagation(),p=!0,e.emit(xt.ptz,rr)}));var f=function(){h=!1,p=!1,e.emit(xt.ptz,Xi)};i(t.$ptzFocusFar,"mouseup",(function(e){e.stopPropagation(),h&&f()})),i(t.$ptzFocusNear,"mouseup",(function(e){e.stopPropagation(),p&&f()})),i(window,"mouseup",(function(e){e.stopPropagation(),(h||p)&&f()}))}if(r.ptzCruiseShow&&(i(t.$ptzCruisePlay,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,ar)})),i(t.$ptzCruisePause,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,nr)}))),r.ptzFogShow&&(i(t.$ptzFogOpen,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,or)})),i(t.$ptzFogClose,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,sr)}))),r.ptzWiperShow&&(i(t.$ptzWiperOpen,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,lr)})),i(t.$ptzWiperClose,"click",(function(t){t.stopPropagation(),e.emit(xt.ptz,cr)}))),r.ptzSupportDraggable){var m=function(){t.isPtzControlDroging&&(t.isPtzControlDroging=!1,t.$ptzControl.style.cursor="grab",t.tempPtzPosition={x:0,y:0})};t.isPtzControlDroging=!1,t.tempPtzPosition={x:0,y:0},i(t.$ptzControl,On()?"touchstart":"mousedown",(function(e){e.stopPropagation(),t.isPtzControlDroging=!0,t.$ptzControl.style.cursor="grabbing";var i=So(e),r=i.posX,a=i.posY;t.tempPtzPosition={x:r,y:a}})),i(t.$ptzControl,On()?"touchmove":"mousemove",(function(e){if(t.isPtzControlDroging){e.stopPropagation();var i=So(e),r=i.posX,a=i.posY,n=t.tempPtzPosition.x-r,o=t.tempPtzPosition.y-a;t.$ptzControl.style.left=t.$ptzControl.offsetLeft-n+"px",t.$ptzControl.style.top=t.$ptzControl.offsetTop-o+"px",t.tempPtzPosition={x:r,y:a}}})),i(t.$ptzControl,On()?"touchend":"mouseup",(function(e){e.stopPropagation(),m()})),i(window,On()?"touchend":"mouseup",(function(e){e.stopPropagation(),m()}))}}if(a.performance&&(i(t.$performance,"click",(function(t){t.stopPropagation(),e.togglePerformancePanel(!0)})),i(t.$performanceActive,"click",(function(t){t.stopPropagation(),e.togglePerformancePanel(!1)}))),a.logSave&&i(t.$logSave,"click",(function(t){t.stopPropagation(),e.downloadMemoryLog()})),a.aiFace&&(i(t.$faceDetect,"click",(function(t){t.stopPropagation(),e.faceDetect(!0)})),i(t.$faceDetectActive,"click",(function(t){t.stopPropagation(),e.faceDetect(!1)}))),a.aiObject&&(i(t.$objectDetect,"click",(function(t){t.stopPropagation(),e.objectDetect(!0)})),i(t.$objectDetectActive,"click",(function(t){t.stopPropagation(),e.objectDetect(!1)}))),a.aiOcclusion&&(i(t.$occlusionDetect,"click",(function(t){t.stopPropagation(),e.occlusionDetect(!0)})),i(t.$occlusionDetectActive,"click",(function(t){t.stopPropagation(),e.occlusionDetect(!1)}))),e._opt.hasControl&&e._opt.controlAutoHide){i(e.$container,"mouseover",(function(){e.fullscreen||(Pn(t.$controls,"display","block"),y())})),i(e.$container,"mousemove",(function(){e.$container&&t.$controls&&(e.fullscreen,"none"===t.$controls.style.display&&(Pn(t.$controls,"display","block"),y()))})),i(e.$container,"mouseout",(function(){v(),Pn(t.$controls,"display","none")}));var g=null,y=function(){v(),g=setTimeout((function(){Pn(t.$controls,"display","none")}),5e3)},v=function(){g&&(clearTimeout(g),g=null)}}if(e._opt.playType===z){var A=e._opt.playbackConfig.controlType;e._opt.playbackConfig.showRateBtn&&(i(t.$speedMenu,"mouseover",(function(){t.$speedMenuList.classList.add("jb-pro-speed-menu-shown")})),i(t.$speedMenu,"mouseout",(function(){t.$speedMenuList.classList.remove("jb-pro-speed-menu-shown")})),i(t.$speedMenuList,"click",(function(t){var i=_o(t);if(i.matches("div.jb-pro-speed-menu-item")){var r=i.dataset;e.emit(xt.playbackPreRateChange,r.speed)}}))),A===ve.normal?(i(t.$playbackNarrow,"click",(function(t){t.stopPropagation(),e.playback&&e.playback.narrowPrecision()})),i(t.$playbackExpand,"click",(function(t){t.stopPropagation(),e.playback&&e.playback.expandPrecision()})),i(t.$playbackTimeList,"click",(function(t){var i=_o(t);i.matches("div.jb-pro-playback-time-minute-one")&&e.playback&&e.playback.seek(i.dataset)})),e._opt.playbackConfig.supportWheel&&i(t.$playbackTimeInner,"wheel",(function(t){t.preventDefault(),(t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3)>0?e.playback&&e.playback.expandPrecision():e.playback&&e.playback.narrowPrecision()}))):A===ve.simple&&(t.isDroging=!1,i(t.$playbackProgress,"click",(function(i){if(i.target!==t.$playbackProgressIndicator){var r=0,a=0;if(e.isInWebFullscreen())r=i.touches[0].clientY/e.height,a=r*e.playback.totalDuration;else{var n=Zu(t,e.playback.totalDuration,i);r=n.percentage,a=n.second}e.playback&&e.playback.seek({time:a})}})),i(t.$playbackProgress,"mousemove",(function(i){Pn(t.$playbackProgressTip,"display","block");var r=Zu(t,e.playback.totalDuration,i),a=r.width,n=r.time;t.$playbackProgressTip.innerHTML=n;var o=t.$playbackProgressTip.clientWidth;a<=o/2?Pn(t.$playbackProgressTip,"left",0):a>t.$playbackProgress.clientWidth-o/2?Pn(t.$playbackProgressTip,"left",t.$playbackProgress-o+"px"):Pn(t.$playbackProgressTip,"left",a-o/2+"px")})),i(t.$playbackProgress,"mouseout",(function(){Pn(t.$playbackProgressTip,"display","none")})),i(t.$playbackProgressIndicator,"mousedown",(function(e){t.isDroging=!0})),i(t.$playbackProgress,"mousemove",(function(i){if(t.isDroging){var r=Zu(t,e.playback.totalDuration,i),a=r.second;r.percentage;e.playback&&e.playback.seek({time:a})}})),i(t.$playbackProgress,"mouseup",(function(e){t.isDroging&&(t.isDroging=!1)})))}a.quality&&(i(t.$qualityMenu,"mouseover",(function(){t.$qualityMenuList.classList.add("jb-pro-quality-menu-shown")})),i(t.$qualityMenu,"mouseout",(function(){t.$qualityMenuList.classList.remove("jb-pro-quality-menu-shown")})),i(t.$qualityMenuList,"click",(function(t){var i=_o(t);if(i.matches("div.jb-pro-quality-menu-item")){var r=i.dataset;e.streamQuality=r.quality}}))),a.scale&&(i(t.$scaleMenu,"mouseover",(function(){t.$scaleMenuList.classList.add("jb-pro-scale-menu-shown")})),i(t.$scaleMenu,"mouseout",(function(){t.$scaleMenuList.classList.remove("jb-pro-scale-menu-shown")})),i(t.$scaleMenuList,"click",(function(t){var i=_o(t);if(i.matches("div.jb-pro-scale-menu-item")){var r=i.dataset;e.setScaleMode(r.scale)}}))),a.zoom&&(i(t.$zoom,"click",(function(t){t.stopPropagation(),e.zooming=!0})),i(t.$zoomStop,"click",(function(t){t.stopPropagation(),e.zooming=!1}))),i(t.$zoomExpand,"click",(function(t){t.stopPropagation(),e.zoom&&e.zoom.expandPrecision()})),i(t.$zoomNarrow,"click",(function(t){t.stopPropagation(),e.zoom&&e.zoom.narrowPrecision()})),i(t.$zoomStop2,"click",(function(t){t.stopPropagation(),e.zooming=!1})),a.close&&i(t.$close,"click",(function(t){t.stopPropagation(),e.doDestroy()})),i(t.$tipsMessageClose,"click",(function(e){e.stopPropagation(),t.$tipsMessageContent.innerHTML="",Pn(t.$tipsMessage,"display","none")}))}(t,this),t._opt.hotKey&&function(e,t){var i=e.events.proxy,r={};function a(e,t){r[e]?r[e].push(t):r[e]=[t]}a(ji,(function(){e.fullscreen&&(e.fullscreen=!1)})),a(Gi,(function(){e.volume+=.05})),a(zi,(function(){e.volume-=.05})),i(window,"keydown",(function(e){if(t.isFocus){var i=document.activeElement.tagName.toUpperCase(),a=document.activeElement.getAttribute("contenteditable");if("INPUT"!==i&&"TEXTAREA"!==i&&""!==a&&"true"!==a){var n=r[e.keyCode];n&&(e.preventDefault(),n.forEach((function(e){return e()})))}}}))}(t,this),this.btnIndex=0,this.initLoadingBackground(),yo(t._opt.loadingIconStyle)&&this.initLoadingIconStyle(t._opt.loadingIconStyle),yo(t._opt.ptzPositionConfig)&&this.updatePtzPosition(t._opt.ptzPositionConfig),this.kbpsShow="0 KB/s",this.player.debug.log("Control","init")}return T(e,[{key:"destroy",value:function(){if(this.$performancePanel&&(this.$performancePanel.innerHTML="",!rd(this.$performancePanel))){var e=this.player.$container.querySelector(".jb-pro-performance-panel");e&&this.player.$container&&this.player.$container.removeChild(e)}if(this.$poster&&!rd(this.$poster)){var t=this.player.$container.querySelector(".jb-pro-poster");t&&this.player.$container&&this.player.$container.removeChild(t)}if(this.$loading&&!rd(this.$loading)){var i=this.player.$container.querySelector(".jb-pro-loading");i&&this.player.$container&&this.player.$container.removeChild(i)}if(this.$loadingBg&&!rd(this.$loadingBg)){var r=this.player.$container.querySelector(".jb-pro-loading-bg");r&&this.player.$container&&this.player.$container.removeChild(r)}if(this.$controls&&!rd(this.$controls)){var a=this.player.$container.querySelector(".jb-pro-controls");a&&this.player.$container&&this.player.$container.removeChild(a)}if(this.$playBig&&!rd(this.$playBig)){var n=this.player.$container.querySelector(".jb-pro-play-big");n&&this.player.$container&&this.player.$container.removeChild(n)}if(this.$recording&&!rd(this.$recording)){var o=this.player.$container.querySelector(".jb-pro-recording");o&&this.player.$container&&this.player.$container.removeChild(o)}if(this.$ptzControl&&!rd(this.$ptzControl)){var s=this.player.$container.querySelector(".jb-pro-ptz-controls");s&&this.player.$container&&this.player.$container.removeChild(s)}if(this.$zoomControls&&!rd(this.$zoomControls)){var l=this.player.$container.querySelector(".jb-pro-zoom-controls");l&&this.player.$container&&this.player.$container.removeChild(l)}if(this.$contextmenus&&(this.$contextmenus.innerHTML="",!rd(this.$contextmenus))){var c=this.player.$container.querySelector(".jb-pro-contextmenus");c&&this.player.$container&&this.player.$container.removeChild(c)}if(this.$tipsMessage&&!rd(this.$tipsMessage)){var u=this.player.$container.querySelector(".jb-pro-tips-message");u&&this.player.$container&&this.player.$container.removeChild(u)}if(this.$extendDom&&!rd(this.$extendDom)){var d=this.player.$container.querySelector(".jb-pro-extend-dom");d&&this.player.$container&&this.player.$container.removeChild(d)}this.btnIndex=0,this.extendBtnList=[],this.kbpsShow="0 KB/s",this.player.$container&&(this.player.$container.classList.remove("jb-pro-controls-show-auto-hide"),this.player.$container.classList.remove("jb-pro-controls-show")),this.player.debug.log("Control","destroy")}},{key:"getBtnIndex",value:function(){return this.btnIndex++}},{key:"autoSize",value:function(){var e=this.player;e.$container.style.padding="0 0";var t=e.width,i=e.height,r=t/i,a=e.video.$videoElement.width/e.video.$videoElement.height;if(r>a){var n=(t-i*a)/2;e.$container.style.padding="0 ".concat(n,"px")}else{var o=(i-t/a)/2;e.$container.style.padding="".concat(o,"px 0")}}},{key:"initLoadingBackground",value:function(){var e=this.player;e._opt.loadingBackground&&e._opt.loadingBackgroundWidth&&e._opt.loadingBackgroundHeight&&(e.debug.log("Control","initLoadingBackground()"),"default"===this.player._opt.aspectRatio||On()?(e.getRenderType()===he||e.getRenderType()===pe)&&this._initLoadingBackground():this._initLoadingBackgroundForRatio(),td(this.$loadingBg,"display","block"),e._opt.loadingBackground="",e._opt.loadingBackgroundWidth=0,e._opt.loadingBackgroundHeight=0)}},{key:"initLoadingIconStyle",value:function(e){var t=this.player.$container.querySelector(".jb-pro-icon-loading");t&&(e.width&&td(t,"width","".concat(e.width,"px")),e.height&&td(t,"height","".concat(e.height,"px")),e.background&&td(t,"backgroundImage",'url("'.concat(e.background,'")')),!1===e.hasAnimation&&(td(t,"animationName","none"),td(t,"animationDuration",0),td(t,"animationTimingFunction","ease"),td(t,"animationIterationCount",1)))}},{key:"_initLoadingBackgroundForRatio",value:function(){var e=this.player._opt.aspectRatio.split(":").map(Number),t=this.player.width,i=this.player.height,r=this.player._opt,a=0;r.hasControl&&!r.controlAutoHide&&(a=r.playType===z?yi:gi,i-=a);var n=this.player._opt.loadingBackgroundWidth,o=this.player._opt.loadingBackgroundHeight,s=n/o,l=e[0]/e[1];if(this.$loadingBgImage.src=this.player._opt.loadingBackground,s>l){var c=l*o/n;this.$loadingBgImage.style.width=100*c+"%",this.$loadingBgImage.style.height="calc(100% - ".concat(a,"px)"),this.$loadingBgImage.style.padding="0 ".concat((t-t*c)/2,"px")}else{var u=n/l/o;this.$loadingBgImage.style.width="100%",this.$loadingBgImage.style.height="calc(".concat(100*u,"% - ").concat(a,"px)"),this.$loadingBgImage.style.padding=(i-i*u)/2+"px 0"}}},{key:"_initLoadingBackground",value:function(){var e=this.player,t=e.height,i=e._opt;i.hasControl&&!i.controlAutoHide&&(t-=i.playType===z?yi:gi);var r=e.width,a=t,n=i.rotate;270!==n&&90!==n||(r=t,a=e.width),this.$loadingBgImage.width=r,this.$loadingBgImage.height=a,this.$loadingBgImage.src=e._opt.loadingBackground;var o=(e.width-r)/2,s=(t-a)/2,l="contain";i.isResize||(l="fill"),i.isFullResize&&(l="none");var c="";"none"===i.mirrorRotate&&n&&(c+=" rotate("+n+"deg)"),"level"===i.mirrorRotate?c+=" rotateY(180deg)":"vertical"===i.mirrorRotate&&(c+=" rotateX(180deg)"),this.player._opt.videoRenderSupportScale&&(this.$loadingBgImage.style.objectFit=l),this.$loadingBgImage.style.transform=c,this.$loadingBgImage.style.padding="0",this.$loadingBgImage.style.left=o+"px",this.$loadingBgImage.style.top=s+"px"}},{key:"_validateExtendBtn",value:function(e){var t=!0;return e.name||(this.player.debug.warn("Control","extend button name is required"),t=!1),t&&-1!==this.extendBtnList.findIndex((function(t){return t.name===e.name}))&&(this.player.debug.warn("Control","extend button name: ".concat(e.name," is already exist")),t=!1),t&&(e.icon||(this.player.debug.warn("Control","extend button icon is required"),t=!1)),t}},{key:"addExtendBtn",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=Bo(na);if(t=Object.assign({},i,t),this._validateExtendBtn(t)){var r=t.name||"",a=this.$controlsRight,n=t.activeIcon&&t.activeClick,o='\n
\n ').concat(t.icon?'
\n \n ').concat(t.iconTitle?'\n '.concat(t.iconTitle,"\n "):"","\n
"):"","\n ").concat(t.activeIcon?'
\n \n ').concat(t.activeIconTitle?'\n '.concat(t.activeIconTitle,"\n "):"","\n
"):"","\n
\n "),s=Array.from(a.children)[t.index];s?s.insertAdjacentHTML("beforebegin",o):ed(a,o);var l=a.querySelector(".jb-pro-controls-item-wrap-".concat(r)),c=t.icon?a.querySelector(".jb-pro-icon-extend-".concat(r)):null,u=t.icon?a.querySelector(".jb-pro-control-extend-".concat(r)):null,d=t.activeIcon?a.querySelector(".jb-pro-icon-extend-".concat(r,"-active")):null,h=t.activeIcon?a.querySelector(".jb-pro-control-extend-".concat(r,"-active")):null,p=this.player,f=p.events.proxy;p.debug;t.icon&&(td(c,"background","url(".concat(t.icon,") no-repeat center")),td(c,"background-size","100% 100%"),td(u,"display","none"),t.iconHover&&(f(c,"mouseover",(function(){td(c,"background","url(".concat(t.iconHover,") no-repeat center")),td(c,"background-size","100% 100%")})),f(c,"mouseout",(function(){td(c,"background","url(".concat(t.icon,") no-repeat center")),td(c,"background-size","100% 100%")})))),t.activeIcon&&(td(d,"background","url(".concat(t.activeIcon,") no-repeat center")),td(d,"background-size","100% 100%"),td(h,"display","none"),t.activeIconHover&&(f(d,"mouseover",(function(){td(d,"background","url(".concat(t.activeIconHover,") no-repeat center")),td(d,"background-size","100% 100%")})),f(d,"mouseout",(function(){td(d,"background","url(".concat(t.activeIcon,") no-repeat center")),td(d,"background-size","100% 100%")})))),t.click&&c&&f(c,"click",(function(i){i.preventDefault(),n&&(td(u,"display","none"),td(h,"display","flex")),e.player.isInMulti()?t.click.call(e.player,i,e.player._opt.multiIndex):t.click.call(e.player,i)})),t.activeClick&&d&&f(d,"click",(function(i){i.preventDefault(),td(u,"display","flex"),td(h,"display","none"),e.player.isInMulti()?t.activeClick.call(e.player,i,e.player._opt.multiIndex):t.activeClick.call(e.player,i)})),this.extendBtnList.push({name:r,$iconContainer:l,$iconWrap:u,$activeIconWrap:h})}}},{key:"addExtendDom",value:function(e){if(this.player.debug.log(this.TAG_NAME,"addExtendDom"),e.html){var t='\n
\n '.concat(e.html,"\n
\n ");this.player.$container.insertAdjacentHTML("beforeend",t),Object.defineProperty(this,"$extendDom",{value:this.player.$container.querySelector(".jb-pro-extend-dom")}),e.showBeforePlay&&td(this.$extendDom,"display","block")}}},{key:"toggleExtendDom",value:function(e){this.$extendDom&&(ao(e)||(e="none"===this.$extendDom.style.display),td(this.$extendDom,"display",e?"block":"none"))}},{key:"updateExtendDom",value:function(e){this.player.debug.log(this.TAG_NAME,"updateExtendDom"),this.$extendDom&&(this.$extendDom.innerHTML=e)}},{key:"removeExtendDom",value:function(){this.player.debug.log(this.TAG_NAME,"removeExtendDom"),this.$extendDom&&(this.$extendDom.innerHTML="")}},{key:"updateLoadingText",value:function(e){this.$loadingText&&(this.$loadingText.innerText=e)}},{key:"getExtendBtnList",value:function(){return this.extendBtnList}},{key:"showTipsMessage",value:function(e,t){var i=this.$tipsMessage,r=this.$tipsMessageContent;if(i){var a='\n
'.concat(e,"
\n ").concat(t?'
Error Type:'.concat(t,"
"):"","\n ");r.innerHTML=a,td(i,"display","block")}}},{key:"hideTipsMessage",value:function(){var e=this.$tipsMessage;e&&($tipsMessageContent.innerHTML="",td(e,"display","none"))}},{key:"updatePtzPosition",value:function(e){var t=this.$ptzControl;if(yo(e)&&t){var i="auto";e.left&&(i=Number(e.left)===e.left?e.left+"px":e.left),td(t,"left",i);var r="auto";e.top&&(r=Number(e.top)===e.top?e.top+"px":e.top),td(t,"top",r);var a="auto";e.bottom&&(a=Number(e.bottom)===e.bottom?e.bottom+"px":e.bottom),td(t,"bottom",a);var n="auto";e.right&&(n=Number(e.right)===e.right?e.right+"px":e.right),td(t,"right",n)}}}])}();nd(".jb-pro-container{position:relative;width:100%;height:100%;overflow:hidden}.jb-pro-container.jb-pro-fullscreen-web{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;width:100vw!important;height:100vh!important;background:#000}.jb-pro-container .jb-pro-loading-bg-for-ios{position:absolute;z-index:100;left:0;top:0;right:0;bottom:0;height:100%;width:100%;opacity:0;visibility:hidden;background-position:50%;background-repeat:no-repeat;background-size:contain;pointer-events:none}.jb-pro-container .jb-pro-loading-bg-for-ios.show{opacity:1;visibility:visible}");var sd=function(e){var t=e._opt,i=e.debug,r=e.events.proxy;if(t.supportDblclickFullscreen&&r(e.$container,"dblclick",(function(t){var i=_o(t).nodeName.toLowerCase();"canvas"!==i&&"video"!==i||(e.fullscreen=!e.fullscreen)})),r(document,"visibilitychange",(function(){e.visibility="visible"===document.visibilityState,i.log("visibilitychange",document.visibilityState),t.hiddenAutoPause&&(i.log("visibilitychange","hiddenAutoPause is true ",document.visibilityState,e._isPlayingBeforePageHidden),"visible"===document.visibilityState?e._isPlayingBeforePageHidden&&e.play():(e._isPlayingBeforePageHidden=e.playing,e.playing&&e.pause()))})),Nn()&&r(document,["click","contextmenu"],(function(t){id(t,e.$container)?(Oo(e._opt.disableContextmenu)&&"contextmenu"===t.type&&t.preventDefault(),e.isInput="INPUT"===t.target.tagName,e.isFocus=!0,e.emit(xt.focus)):(e.isInput=!1,e.isFocus=!1,e.emit(xt.blur))})),t.isCheckInView){var a=Yn((function(){e.emit(xt.inView,function(e){var t=e.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,a=t.top<=i&&t.top+t.height>=0,n=t.left<=r&&t.left+t.width>=0;return a&&n}(e.$container))}),200);r(window,"scroll",(function(){return a()}))}if(t.autoResize){var n=Yn((function(){e.resize()}),500);r(window,["resize","orientationchange"],(function(){n()})),screen&&screen.orientation&&screen.orientation.onchange&&r(screen.orientation,"change",(function(){n()}))}},ld=function(){function e(){S(this,e)}return T(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],av01:[],av1C:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],Opus:[],dOps:[],"ac-3":[],dac3:[],"ec-3":[],dec3:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,i=null,r=Array.prototype.slice.call(arguments,1),a=r.length,n=0;n>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);for(var o=8,s=0;s>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var i=t.id,r=t.duration,a=t.presentWidth,n=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>>8&255,255&a,0,0,n>>>8&255,255&n,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var i=t.timescale,r=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))}},{key:"hdlr",value:function(t){var i=null;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)}},{key:"minf",value:function(t){var i=null;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.audioType?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"avc"===t.videoType?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t))}},{key:"mp3",value:function(t){var i=t.channelCount,r=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],a)}},{key:"mp4a",value:function(t){var i=t.channelCount,r=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,a,e.esds(t))}},{key:"esds",value:function(t){var i=t.config||[],r=i.length,a=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(i).concat([6,1,2]));return e.box(e.types.esds,a)}},{key:"avc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,n,e.box(e.types.avcC,i))}},{key:"hvc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,n,e.box(e.types.hvcC,i))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var i=t.id,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)}},{key:"moof",value:function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))}},{key:"mfhd",value:function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)}},{key:"traf",value:function(t,i){var r=t.id,a=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),n=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),o=e.sdtp(t),s=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,a,n,s,o)}},{key:"sdtp",value:function(t){var i=new Uint8Array(5),r=t.flags;return i[4]=r.isLeading<<6|r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy,e.box(e.types.sdtp,i)}},{key:"trun",value:function(t,i){var r=new Uint8Array(28);i+=36,r.set([0,0,15,1,0,0,0,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);var a=t.duration,n=t.size,o=t.flags,s=t.cts;return r.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.isNonSync,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s],12),e.box(e.types.trun,r)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}])}();ld.init();var cd=[44100,48e3,32e3,0],ud=[22050,24e3,16e3,0],dd=[11025,12e3,8e3,0],hd=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],pd=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],fd=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],md=function(t){function i(e){var t;return S(this,i),t=_(this,i),t.TAG_NAME="MediaSource",t.player=e,t._resetInIt(),t._useManagedMediaSource="ManagedMediaSource"in self&&!("MediaSource"in self),t.mediaSource=t._useManagedMediaSource?new self.ManagedMediaSource:new self.MediaSource,t.isDecodeFirstIIframe=!!No(e._opt.checkFirstIFrame),t.mediaSourceObjectURL=null,t._useManagedMediaSource||(t.mediaSourceObjectURL=window.URL.createObjectURL(t.mediaSource)),t.isSupportVideoFrameCallback=qo(),t.canvasRenderInterval=null,e._opt.mseUseCanvasRender?(t.$videoElement=document.createElement("video"),t._useManagedMediaSource?(t.$videoElement.disableRemotePlayback=!0,t.$videoElement.srcObject=t.mediaSource):t.$videoElement.src=t.mediaSourceObjectURL,t.initVideoEvents()):(t._useManagedMediaSource?(t.player.video.$videoElement.disableRemotePlayback=!0,t.player.video.$videoElement.srcObject=t.mediaSource):t.player.video.$videoElement.src=t.mediaSourceObjectURL,t.$videoElement=t.player.video.$videoElement),t._bindMediaSourceEvents(),t.audioSourceBufferCheckTimeout=null,t.audioSourceNoDataCheckTimeout=null,t.hasPendingEos=!1,t.player.isPlayback()&&t.player.on(xt.playbackPause,(function(i){No(i)?(Oo(e._opt.checkFirstIFrame)&&(t.player.debug.log(t.TAG_NAME,"playbackPause is false and _opt.checkFirstIFrame is true so set isDecodeFirstIIframe = false"),t.isDecodeFirstIIframe=!1),t.clearUpAllSourceBuffer(),t.$videoElement.play()):(t.$videoElement.pause(),t.cacheTrack={})})),t._useManagedMediaSource?t.player.debug.log(t.TAG_NAME,"init and using ManagedMediaSource"):t.player.debug.log(t.TAG_NAME,"init"),t}return k(i,t),T(i,[{key:"destroy",value:function(){this.stop(),this._clearAudioSourceBufferCheckTimeout(),this._clearAudioNoDataCheckTimeout(),this._stopCanvasRender(),this.eventListenList.length&&(this.eventListenList.forEach((function(e){return e()})),this.eventListenList=[]),this.supportVideoFrameCallbackHandle&&this.$videoElement&&(this.$videoElement.cancelVideoFrameCallback(this.supportVideoFrameCallbackHandle),this.supportVideoFrameCallbackHandle=null),this.$videoElement&&(this.player._opt.mseUseCanvasRender&&this.$videoElement.src&&(this.$videoElement.src="",this.$videoElement.removeAttribute("src")),this.$videoElement=null),this.mediaSourceObjectURL&&(window.URL.revokeObjectURL(this.mediaSourceObjectURL),this.mediaSourceObjectURL=null),this._resetInIt(),this.mediaSource=null,this.off(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"needInitAudio",value:function(){return this.player._opt.hasAudio&&this.player._opt.mseDecodeAudio}},{key:"_resetInIt",value:function(){this.isAvc=null,this.isAAC=null,this.videoMeta={},this.audioMeta={},this.sourceBuffer=null,this.audioSourceBuffer=null,this.hasInit=!1,this.hasAudioInit=!1,this.isInitInfo=!1,this.isAudioInitInfo=!1,this.audioMimeType="",this.videoMimeType="",this.cacheTrack={},this.cacheAudioTrack={},this.sequenceNumber=0,this.audioSequenceNumber=0,this.firstRenderTime=null,this.firstAudioTime=null,this.$videoElement=null,this.mediaSourceAppendBufferFull=!1,this.mediaSourceAppendBufferError=!1,this.mediaSourceAddSourceBufferError=!1,this.mediaSourceBufferError=!1,this.mediaSourceError=!1,this.prevTimestamp=null,this.decodeDiffTimestamp=null,this.prevDts=null,this.prevAudioDts=null,this.prevPayloadBufferSize=0,this.isWidthOrHeightChanged=!1,this.prevTs=null,this.prevAudioTs=null,this.eventListenList=[],this.pendingRemoveRanges=[],this.pendingSegments=[],this.pendingAudioRemoveRanges=[],this.pendingAudioSegments=[],this.supportVideoFrameCallbackHandle=null}},{key:"state",get:function(){return this.mediaSource&&this.mediaSource.readyState}},{key:"isStateOpen",get:function(){return this.state===Oi}},{key:"isStateClosed",get:function(){return this.state===Ni}},{key:"isStateEnded",get:function(){return this.state===Fi}},{key:"duration",get:function(){return this.mediaSource&&this.mediaSource.duration||-1},set:function(e){this.mediaSource.duration=e}},{key:"_bindMediaSourceEvents",value:function(){var e=this,t=this.player,i=(t.debug,t.events.proxy),r=i(this.mediaSource,gr,(function(){e.player.debug.log(e.TAG_NAME,"sourceOpen"),e._onMediaSourceSourceOpen(),e.player.emit(xt.mseSourceOpen)})),a=i(this.mediaSource,mr,(function(){e.player.debug.log(e.TAG_NAME,"sourceClose"),e.player.emit(xt.mseSourceClose)})),n=i(this.mediaSource,yr,(function(){e.player.debug.log(e.TAG_NAME,"sourceended"),e.player.emit(xt.mseSourceended)}));this.eventListenList.push(r,a,n);var o=i(this.$videoElement,wr,(function(t){if(No(e.isSupportVideoFrameCallback))if(e.player.checkIsInRender())e.player.handleRender();else{var i=parseInt(t.timeStamp,10);e.player.debug.log(e.TAG_NAME,"mseUseCanvasRender is ".concat(e.player._opt.mseUseCanvasRender," and\n $videoElement ts is ").concat(i,", but not in render and vbps is ").concat(e.player._stats.vbps," and fps is ").concat(e.player._stats.fps))}}));if(this.eventListenList.push(o),this._useManagedMediaSource){var s=i(this.mediaSource,vr,(function(){e.player.debug.log(e.TAG_NAME,"ManagedMediaSource startstreaming"),e.player.emit(xt.mseSourceStartStreaming)})),l=i(this.mediaSource,Ar,(function(){e.player.debug.log(e.TAG_NAME,"ManagedMediaSource endstreaming"),e.player.emit(xt.mseSourceEndStreaming)})),c=i(this.mediaSource,br,(function(){e.player.debug.log(e.TAG_NAME,"ManagedMediaSource qualitychange")}));this.eventListenList.push(s,l,c)}}},{key:"_onMediaSourceSourceOpen",value:function(){this.sourceBuffer||(this.player.debug.log("MediaSource","onMediaSourceSourceOpen() sourceBuffer is null and next init"),this._initSourceBuffer()),this.audioSourceBuffer||(this.player.debug.log("MediaSource","onMediaSourceSourceOpen() audioSourceBuffer is null and next init"),this._initAudioSourceBuffer()),this._hasPendingSegments()&&this._doAppendSegments()}},{key:"initVideoEvents",value:function(){var e=this,t=this.player.events.proxy;this.player.on(xt.visibilityChange,(function(t){t&&setTimeout((function(){if(e.player.isPlaying()&&e.$videoElement){var t=e.getVideoBufferLastTime();t-e.$videoElement.currentTime>e.getMseBufferMaxDelayTime()&&(e.player.debug.log(e.TAG_NAME,"visibilityChange is true and lastTime is ".concat(t," and currentTime is ").concat(e.$videoElement.currentTime," so set currentTime to lastTime")),e.$videoElement.currentTime=t)}}),300)}));var i=t(this.$videoElement,_r,(function(){e.player.debug.log(e.TAG_NAME,"video canplay"),e.$videoElement.play().then((function(){e.player.emit(xt.removeLoadingBgImage),qo()?e.supportVideoFrameCallbackHandle||(e.supportVideoFrameCallbackHandle=e.$videoElement.requestVideoFrameCallback(e.videoFrameCallback.bind(e))):e.player.isUseHls265()&&(e._stopCanvasRender(),e.canvasRenderInterval=setInterval((function(){e.player.video.render({$video:e.$videoElement,ts:parseInt(1e3*e.$videoElement.currentTime,10)||0})}),40)),e.player.debug.log(e.TAG_NAME,"video play")})).catch((function(t){e.player.debug.error(e.TAG_NAME,"video play error ",t),e.player.emitError(It.mediaSourceUseCanvasRenderPlayFailed,t)}))})),r=t(this.$videoElement,kr,(function(){e.player.debug.log(e.TAG_NAME,"video waiting")})),a=t(this.$videoElement,wr,(function(t){parseInt(t.timeStamp,10),e.$videoElement.paused&&(e.player.debug.warn(e.TAG_NAME,"video is paused and next try to replay"),e.$videoElement.play().then((function(){e.player.debug.log(e.TAG_NAME,"video is paused and replay success")})).catch((function(t){e.player.debug.warn(e.TAG_NAME,"video is paused and replay error ",t)})))})),n=t(this.$videoElement,Sr,(function(){e.player.debug.log(e.TAG_NAME,"video playback Rate change",e.$videoElement&&e.$videoElement.playbackRate),e.$videoElement&&e.$videoElement.paused&&e.player.debug.warn(e.TAG_NAME,"ratechange and video is paused")}));this.eventListenList.push(i,r,a,n)}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.player.isDestroyedOrClosed())this.player.debug.log(this.TAG_NAME,"videoFrameCallback() player is destroyed");else{var i=parseInt(1e3*Math.max(t.mediaTime,this.$videoElement.currentTime),10)||0;this.player.handleRender(),this.player.video.render({$video:this.$videoElement,ts:i}),this.player.isUseHls265()&&this.player.updateStats({fps:!0,ts:i}),this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this))}}},{key:"decodeVideo",value:function(e,t,i,r){var a=this.player;if(a)if(this.player.isDestroyedOrClosed())this.player.debug.warn(this.TAG_NAME,"decodeVideo() player is destroyed");else if(this.hasInit)if(!this.isDecodeFirstIIframe&&i&&(this.isDecodeFirstIIframe=!0),this.isDecodeFirstIIframe){if(i&&0===e[1]){var n=15&e[0],o={};n===Gt?o=Qs(e.slice(5)):n===zt&&(o=ll(e));var s=this.player.video.videoInfo;s&&s.width&&s.height&&o&&o.codecWidth&&o.codecHeight&&(o.codecWidth!==s.width||o.codecHeight!==s.height)&&(this.player.debug.warn(this.TAG_NAME,"\n decodeVideo: video width or height is changed,\n old width is ".concat(s.width,", old height is ").concat(s.height,",\n new width is ").concat(o.codecWidth,", new height is ").concat(o.codecHeight,",\n and emit change event")),this.isWidthOrHeightChanged=!0,this.player.emitError(It.mseWidthOrHeightChange))}if(this.isWidthOrHeightChanged)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo: video width or height is changed, and return");if(Fo(e))return void this.player.debug.warn(this.TAG_NAME,"decodeVideo and payload is video sequence header so drop this frame");if(e.byteLength<12)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo and payload is too small , payload length is ".concat(e.byteLength));var l=t;if(this.player.isPlayer()){if(null===this.firstRenderTime&&(this.firstRenderTime=t),l=t-this.firstRenderTime,l<0&&(this.player.debug.warn(this.TAG_NAME,"decodeVideo\n local dts is < 0 , ts is ".concat(t," and prevTs is ").concat(this.prevTs,",\n firstRenderTime is ").concat(this.firstRenderTime," and mseCorrectTimeDuration is ").concat(this.player._opt.mseCorrectTimeDuration)),l=null===this.prevDts?0:this.prevDts+this.player._opt.mseCorrectTimeDuration,this._checkTsIsMaxDiff(t)))return this.player.debug.warn(this.TAG_NAME,"decodeVideo is max diff , ts is ".concat(t," and prevTs is ").concat(this.prevTs,", diff is ").concat(this.prevTs-t," and emit replay")),void this.player.emitError(It.mediaSourceTsIsMaxDiff,"decodeVideo is max diff, prevTs is ".concat(this.prevTs," and ts is ").concat(t));if(null!==this.prevDts&&l<=this.prevDts){if(this.player.debug.warn(this.TAG_NAME,"\n decodeVideo dts is less than(or equal) prev dts ,\n dts is ".concat(l," and prev dts is ").concat(this.prevDts," ,\n and now ts is ").concat(t," and prev ts is ").concat(this.prevTs," ,\n and diff is ").concat(t-this.prevTs," and firstRenderTime is ").concat(this.firstRenderTime," and isIframe is ").concat(i,",\n and mseCorrectTimeDuration is ").concat(this.player._opt.mseCorrectTimeDuration,",\n and prevPayloadBufferSize is ").concat(this.prevPayloadBufferSize," and payload size is ").concat(e.byteLength)),l===this.prevDts&&this.prevPayloadBufferSize===e.byteLength)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo dts is equal to prev dts and payload size is equal to prev payload size so drop this frame");if(l=this.prevDts+this.player._opt.mseCorrectTimeDuration,this._checkTsIsMaxDiff(t))return this.player.debug.warn(this.TAG_NAME,"decodeVideo is max diff , ts is ".concat(t," and prevTs is ").concat(this.prevTs,", diff is ").concat(this.prevTs-t," and emit replay")),void this.emit(It.mediaSourceTsIsMaxDiff,"decodeVideo is max diff, prevTs is ".concat(this.prevTs," and ts is ").concat(t))}}this.player.isPlayer()?this._decodeVideo(e,l,i,r,t):this.player.isPlayback()&&No(this.player.playbackPause)&&(this.player.playback.isUseLocalCalculateTime&&this.player.playback.increaseLocalTimestamp(),this._decodeVideo(e,l,i,r,t)),this.prevDts=l,this.prevPayloadBufferSize=e.byteLength,this.prevTs=t}else this.player.debug.log(this.TAG_NAME,"decodeVideo first frame is not iFrame");else if(i&&e[1]===Gr){var c=15&e[0];if(a.video.updateVideoInfo({encTypeCode:c}),c===zt&&No(Zn()))return void this.player.emitError(It.mediaSourceH265NotSupport);a._times.decodeStart||(a._times.decodeStart=Ln()),this.hasInit=this._decodeConfigurationRecord(e,t,i,c)}else this.player.debug.warn(this.TAG_NAME,"decodeVideo has not init , isIframe is ".concat(i," , payload is ").concat(e[1]))}},{key:"decodeAudio",value:function(e,t){if(this.player)if(this.player.isDestroyedOrClosed())this.player.debug.warn(this.TAG_NAME,"decodeAudio() player is destroyed");else if(No(this.hasAudioInit))this.hasAudioInit=this._decodeAudioConfigurationRecord(e,t);else{var i=t;if(pn(e))return void this.player.debug.log(this.TAG_NAME,"decodeAudio and has already initialized and payload is aac codec packet so drop this frame");if(this._clearAudioNoDataCheckTimeout(),this.isDecodeFirstIIframe){if(this.player.isPlayer()){if(null===this.firstAudioTime&&(this.firstAudioTime=t,null!==this.firstRenderTime&&null!==this.prevTs)){var r=Math.abs(this.firstRenderTime-this.prevTs);r>300&&(this.firstAudioTime-=r,this.player.debug.warn(this.TAG_NAME,"video\n firstAudioTime is ".concat(this.firstRenderTime," and current time is ").concat(this.prevTs,"\n play time is ").concat(r," and firstAudioTime ").concat(t," - ").concat(r," = ").concat(this.firstAudioTime)))}if(i=t-this.firstAudioTime,i<0&&(this.player.debug.warn(this.TAG_NAME,"decodeAudio\n local dts is < 0 , ts is ".concat(t," and prevTs is ").concat(this.prevAudioTs,",\n firstAudioTime is ").concat(this.firstAudioTime)),i=null===this.prevAudioDts?0:this.prevAudioDts+this.player._opt.mseCorrectAudioTimeDuration,this._checkAudioTsIsMaxDiff(t)))return this.player.debug.warn(this.TAG_NAME,"decodeAudio is max diff , ts is ".concat(t," and prevTs is ").concat(this.prevAudioDts,", diff is ").concat(this.prevAudioDts-t," and emit replay")),void this.player.emitError(It.mediaSourceTsIsMaxDiff,"decodeAudio is max diff, prevTs is ".concat(this.prevAudioDts," and ts is ").concat(t));null!==this.prevAudioTs&&i<=this.prevAudioDts&&(this.player.debug.warn(this.TAG_NAME,"\n decodeAudio dts is less than(or equal) prev dts ,\n dts is ".concat(i," and prev dts is ").concat(this.prevAudioDts," ,\n and now ts is ").concat(t," and prev ts is ").concat(this.prevAudioTs," ,\n and diff is ").concat(t-this.prevAudioTs)),i=this.prevAudioDts+this.player._opt.mseCorrectAudioTimeDuration)}(this.player.isPlayer()||this.player.isPlayback()&&No(this.player.playbackPause))&&this._decodeAudio(e,i,t),this.prevAudioTs=t,this.prevAudioDts=i}else this.player.debug.log(this.TAG_NAME,"decodeAudio first frame is not iFrame")}}},{key:"_checkTsIsMaxDiff",value:function(e){return this.prevTs>0&&eAe}},{key:"_checkAudioTsIsMaxDiff",value:function(e){return this.prevAudioTs>0&&eAe}},{key:"_decodeConfigurationRecord",value:function(e,t,i,r){var a=e.slice(5),n={};if(r===Gt?n=Qs(a):r===zt&&(n=cl(a)),go(n)||0===n.codecWidth&&0===n.codecHeight)return this.player.debug.warn(this.TAG_NAME,"_decodeConfigurationRecord",n),this.player.emitError(It.mediaSourceDecoderConfigurationError),!1;this.player.recorder&&this.player._opt.recordType===H&&this.player.recorder.initMetaData(e,r);var o={id:ja,type:"video",timescale:1e3,duration:0,avcc:a,codecWidth:n.codecWidth,codecHeight:n.codecHeight,videoType:n.videoType},s=ld.generateInitSegment(o);this.isAvc=r===Gt;var l=n.codec;return this.videoMimeType=l?'video/mp4; codecs="'.concat(n.codec,'"'):this.isAvc?Li:Ii,this._initSourceBuffer(),this.appendBuffer(s.buffer),this.sequenceNumber=0,this.cacheTrack={},!0}},{key:"_decodeAudioConfigurationRecord",value:function(e,t){var i=e[0]>>4,r=i===Jt,a=i===Vt;if(No(a||r))return this.player.debug.warn(this.TAG_NAME,"_decodeAudioConfigurationRecord audio codec is not support , codecId is ".concat(i," ant auto wasm decode")),this.player.emit(It.mediaSourceAudioG711NotSupport),!1;var n={id:Ga,type:"audio",timescale:1e3},o={};if(pn(e)){if(o=function(e){var t=new Uint8Array(e),i=null,r=0,a=0,n=0,o=null;if(r=a=t[0]>>>3,n=(7&t[0])<<1|t[1]>>>7,n<0||n>=yn.length)console.error("Flv: AAC invalid sampling frequency index!");else{var s=yn[n],l=(120&t[1])>>>3;if(!(l<0||l>=8)){5===r&&(o=(7&t[1])<<1|t[2]>>>7,t[2]);var c=self.navigator.userAgent.toLowerCase();return-1!==c.indexOf("firefox")?n>=6?(r=5,i=new Array(4),o=n-3):(r=2,i=new Array(2),o=n):-1!==c.indexOf("android")?(r=2,i=new Array(2),o=n):(r=5,o=n,i=new Array(4),n>=6?o=n-3:1===l&&(r=2,i=new Array(2),o=n)),i[0]=r<<3,i[0]|=(15&n)>>>1,i[1]=(15&n)<<7,i[1]|=(15&l)<<3,5===r&&(i[1]|=(15&o)>>>1,i[2]=(1&o)<<7,i[2]|=8,i[3]=0),{audioType:"aac",config:i,sampleRate:s,channelCount:l,objectType:r,codec:"mp4a.40."+r,originalCodec:"mp4a.40."+a}}console.log("Flv: AAC invalid channel configuration")}}(e.slice(2)),!o)return!1;n.audioSampleRate=o.sampleRate,n.channelCount=o.channelCount,n.config=o.config,n.refSampleDuration=1024/n.audioSampleRate*n.timescale}else{if(!r)return!1;if(o=function(e){if(e.length<4)console.error("Invalid MP3 packet, header missing!");else{var t=new Uint8Array(e.buffer),i=null;if(255===t[0]){var r=t[1]>>>3&3,a=(6&t[1])>>1,n=(240&t[2])>>>4,o=(12&t[2])>>>2,s=3!=(t[3]>>>6&3)?2:1,l=0,c=0;switch(r){case 0:l=dd[o];break;case 2:l=ud[o];break;case 3:l=cd[o]}switch(a){case 1:n0&&(u+=";codecs=".concat(l)),No(this.isAudioInitInfo)&&(this.player.audio.updateAudioInfo({encTypeCode:i,channels:n.channelCount,sampleRate:n.audioSampleRate}),this.isAudioInitInfo=!0),this.audioMimeType=u,this.isAAC=a,this._initAudioSourceBuffer(),this.appendAudioBuffer(c.buffer),!0}},{key:"_initSourceBuffer",value:function(){var e=this,t=this.player,i=t.debug,r=t.events.proxy;if(null===this.sourceBuffer&&null!==this.mediaSource&&this.isStateOpen&&this.videoMimeType){try{this.sourceBuffer=this.mediaSource.addSourceBuffer(this.videoMimeType),i.log(this.TAG_NAME,"_initSourceBuffer() this.mediaSource.addSourceBuffer()",this.videoMimeType)}catch(r){return i.error(this.TAG_NAME,"appendBuffer() this.mediaSource.addSourceBuffer()",r.code,r),this.player.emitError(It.mseAddSourceBufferError,r),void(this.mediaSourceAddSourceBufferError=!0)}if(this.sourceBuffer){var a=r(this.sourceBuffer,"error",(function(t){e.mediaSourceBufferError=!0,i.error(e.TAG_NAME,"mseSourceBufferError this.sourceBuffer",t),e.player.emitError(It.mseSourceBufferError,t)})),n=r(this.sourceBuffer,"updateend",(function(){e._hasPendingRemoveRanges()?e._doRemoveRanges():e._hasPendingSegments()?e._doAppendSegments():e.hasPendingEos&&(e.player.debug.log(e.TAG_NAME,"videoSourceBuffer updateend and hasPendingEos is true, next endOfStream()"),e.endOfStream())}));this.eventListenList.push(a,n)}}else i.log(this.TAG_NAME,"_initSourceBuffer and this.isStateOpen is ".concat(this.isStateOpen," and this.isAvc === null is ").concat(null===this.isAvc))}},{key:"_initAudioSourceBuffer",value:function(){var e=this,t=this.player,i=t.debug,r=t.events.proxy;if(null===this.audioSourceBuffer&&null!==this.mediaSource&&this.isStateOpen&&this.audioMimeType){try{this.audioSourceBuffer=this.mediaSource.addSourceBuffer(this.audioMimeType),this._clearAudioSourceBufferCheckTimeout(),i.log(this.TAG_NAME,"_initAudioSourceBuffer() this.mediaSource.addSourceBuffer()",this.audioMimeType)}catch(r){return i.error(this.TAG_NAME,"appendAudioBuffer() this.mediaSource.addSourceBuffer()",r.code,r),this.player.emitError(It.mseAddSourceBufferError,r),void(this.mediaSourceAddSourceBufferError=!0)}if(this.audioSourceBuffer){var a=r(this.audioSourceBuffer,"error",(function(t){e.mediaSourceBufferError=!0,i.error(e.TAG_NAME,"mseSourceBufferError this.audioSourceBuffer",t),e.player.emitError(It.mseSourceBufferError,t)})),n=r(this.audioSourceBuffer,"updateend",(function(){e._hasPendingRemoveRanges()?e._doRemoveRanges():e._hasPendingSegments()?e._doAppendSegments():e.hasPendingEos&&(e.player.debug.log(e.TAG_NAME,"audioSourceBuffer updateend and hasPendingEos is true, next endOfStream()"),e.endOfStream())}));this.eventListenList.push(a,n),null===this.audioSourceNoDataCheckTimeout&&(this.audioSourceNoDataCheckTimeout=setTimeout((function(){e._clearAudioNoDataCheckTimeout(),e.player.emit(It.mediaSourceAudioNoDataTimeout)}),1e3))}}else i.log(this.TAG_NAME,"_initAudioSourceBuffer and this.isStateOpen is ".concat(this.isStateOpen," and this.audioMimeType is ").concat(this.audioMimeType))}},{key:"_decodeVideo",value:function(e,t,i,r,a){var n=this.player,o=e.slice(5),s=o.byteLength;if(0!==s){var l=(new Date).getTime(),c=!1;this.prevTimestamp||(this.prevTimestamp=l,c=!0);var u=l-this.prevTimestamp;this.decodeDiffTimestamp=u,u>500&&!c&&this.player.isPlayer()&&n.debug.warn(this.TAG_NAME,"_decodeVideo now time is ".concat(l," and prev time is ").concat(this.prevTimestamp,", diff time is ").concat(u," ms"));var d=this.$videoElement;if(this.cacheTrack.id&&t>=this.cacheTrack.dts){var h=8+this.cacheTrack.size,p=new Uint8Array(h);p[0]=h>>>24&255,p[1]=h>>>16&255,p[2]=h>>>8&255,p[3]=255&h,p.set(ld.types.mdat,4),p.set(this.cacheTrack.data,8),this.cacheTrack.duration=t-this.cacheTrack.dts;var f=ld.moof(this.cacheTrack,this.cacheTrack.dts);this.cacheTrack={};var m=new Uint8Array(f.byteLength+p.byteLength);m.set(f,0),m.set(p,f.byteLength),this.appendBuffer(m.buffer),n.emit(xt.timeUpdate,a),n.isPlayer()?n.isUseHls265()?n.updateStats({dfps:!0,mseTs:t}):n.updateStats({fps:!0,dfps:!0,ts:a,mseTs:t}):n.isPlayback()&&n.playback.updateStats({ts:a}),n._times.videoStart||(n._times.videoStart=Ln(),n.handlePlayToRenderTimes())}else n.debug.log(this.TAG_NAME,"cacheTrack = {} now dts is ".concat(t,", and ts is ").concat(a," cacheTrack dts is ").concat(this.cacheTrack&&this.cacheTrack.dts)),this.cacheTrack={};this.cacheTrack||(this.cacheTrack={}),this.cacheTrack.id=ja,this.cacheTrack.sequenceNumber=++this.sequenceNumber,this.cacheTrack.size=s,this.cacheTrack.dts=t,this.cacheTrack.cts=r,this.cacheTrack.isKeyframe=i,this.cacheTrack.data=o,this.cacheTrack.flags={isLeading:0,dependsOn:i?2:1,isDependedOn:i?1:0,hasRedundancy:0,isNonSync:i?0:1},!this.isInitInfo&&d.videoWidth>0&&d.videoHeight>0&&(n.debug.log(this.TAG_NAME,"updateVideoInfo: ".concat(d.videoWidth,",").concat(d.videoHeight)),n.video.updateVideoInfo({width:d.videoWidth,height:d.videoHeight}),n.video.initCanvasViewSize(),this.isInitInfo=!0),n._opt.mseUseCanvasRender&&No(this.isSupportVideoFrameCallback)&&No(n.isUseHls265())&&n.video.render({$video:d,ts:t}),this.prevTimestamp=(new Date).getTime()}else n.debug.warn(this.TAG_NAME,"_decodeVideo payload bytes is 0 and return")}},{key:"_stopCanvasRender",value:function(){this.canvasRenderInterval&&(clearInterval(this.canvasRenderInterval),this.canvasRenderInterval=null)}},{key:"_decodeAudio",value:function(e,t,i){var r=this.player,a=this.isAAC?e.slice(2):e.slice(1),n=a.byteLength;if(this.cacheAudioTrack.id&&t>=this.cacheAudioTrack.dts){var o=8+this.cacheAudioTrack.size,s=new Uint8Array(o);s[0]=o>>>24&255,s[1]=o>>>16&255,s[2]=o>>>8&255,s[3]=255&o,s.set(ld.types.mdat,4),s.set(this.cacheAudioTrack.data,8),this.cacheAudioTrack.duration=t-this.cacheAudioTrack.dts;var l=ld.moof(this.cacheAudioTrack,this.cacheAudioTrack.dts);this.cacheAudioTrack={};var c=new Uint8Array(l.byteLength+s.byteLength);c.set(l,0),c.set(s,l.byteLength),this.appendAudioBuffer(c.buffer)}else r.debug.log(this.TAG_NAME,"cacheAudioTrack = {} now dts is ".concat(t," cacheAudioTrack dts is ").concat(this.cacheAudioTrack&&this.cacheAudioTrack.dts)),this.cacheAudioTrack={};this.cacheAudioTrack||(this.cacheAudioTrack={}),this.cacheAudioTrack.id=Ga,this.cacheAudioTrack.sequenceNumber=++this.audioSequenceNumber,this.cacheAudioTrack.size=n,this.cacheAudioTrack.dts=t,this.cacheAudioTrack.cts=0,this.cacheAudioTrack.data=a,this.cacheAudioTrack.flags={isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}},{key:"appendBuffer",value:function(e){if(this.player.isDestroyedOrClosed())this.player.debug.warn(this.TAG_NAME,"appendBuffer() player is destroyed");else{var t=this.player,i=t.debug;t.events.proxy;this.mediaSourceAddSourceBufferError?i.warn(this.TAG_NAME,"appendBuffer() this.mediaSourceAddSourceBufferError is true"):this.mediaSourceAppendBufferFull?i.warn(this.TAG_NAME,"appendBuffer() this.mediaSourceAppendBufferFull is true"):this.mediaSourceAppendBufferError?i.warn(this.TAG_NAME,"appendBuffer() this.mediaSourceAppendBufferError is true"):this.mediaSourceBufferError?i.warn(this.TAG_NAME,"appendBuffer() this.mediaSourceBufferError is true"):(this.pendingSegments.push(e),this.sourceBuffer&&(this.player.isPlayer()&&this._handleUpdatePlaybackRate(),this.player.isPlayback()&&(this._handleUpdateBufferDelayTime(),this._checkVideoPlayCurrentTime()),this.player._opt.mseAutoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanUpSourceBuffer(),No(this.getSourceBufferUpdating())&&this.isStateOpen&&No(this._hasPendingRemoveRanges()))?this._doAppendSegments():this.isStateClosed?(this.mediaSourceBufferError=!0,this.player.emitError(It.mseSourceBufferError,"mediaSource is not attached to video or mediaSource is closed")):this.isStateEnded?(this.mediaSourceBufferError=!0,this.player.emitError(It.mseSourceBufferError,"mediaSource is end")):this._hasPendingRemoveRanges()&&i.log(this.TAG_NAME,"video has pending remove ranges and video length is ".concat(this.pendingRemoveRanges.length,", audio length is ").concat(this.pendingAudioRemoveRanges.length)))}}},{key:"appendAudioBuffer",value:function(e){if(this.player.isDestroyedOrClosed())this.player.debug.warn(this.TAG_NAME,"appendAudioBuffer() player is destroyed");else{var t=this.player,i=t.debug;t.events.proxy;this.mediaSourceAddSourceBufferError?i.warn(this.TAG_NAME,"appendAudioBuffer() this.mediaSourceAddSourceBufferError is true"):this.mediaSourceAppendBufferFull?i.warn(this.TAG_NAME,"appendAudioBuffer() this.mediaSourceAppendBufferFull is true"):this.mediaSourceAppendBufferError?i.warn(this.TAG_NAME,"appendAudioBuffer() this.mediaSourceAppendBufferError is true"):this.mediaSourceBufferError?i.warn(this.TAG_NAME,"appendAudioBuffer() this.mediaSourceBufferError is true"):(this.pendingAudioSegments.push(e),this.audioSourceBuffer&&(this.player.isPlayer()&&this._handleUpdatePlaybackRate(),this.player.isPlayback()&&(this._handleUpdateBufferDelayTime(),this._checkVideoPlayCurrentTime()),this.player._opt.mseAutoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanUpSourceBuffer(),No(this.getAudioSourceBufferUpdating())&&this.isStateOpen&&No(this._hasPendingRemoveRanges()))?this._doAppendSegments():this.isStateClosed?(this.mediaSourceBufferError=!0,this.player.emitError(It.mseSourceBufferError,"mediaSource is not attached to video or mediaSource is closed")):this.isStateEnded?(this.mediaSourceBufferError=!0,this.player.emitError(It.mseSourceBufferError,"mediaSource is end")):this._hasPendingRemoveRanges()&&i.log(this.TAG_NAME,"audio has pending remove ranges and video length is ".concat(this.pendingRemoveRanges.length,", audio length is ").concat(this.pendingAudioRemoveRanges.length)))}}},{key:"getSourceBufferUpdating",value:function(){return this.sourceBuffer&&this.sourceBuffer.updating}},{key:"getAudioSourceBufferUpdating",value:function(){return this.audioSourceBuffer&&this.audioSourceBuffer.updating}},{key:"stop",value:function(){this.abortSourceBuffer(),this.removeSourceBuffer(),this.endOfStream()}},{key:"checkSourceBufferDelay",value:function(){var e=this.$videoElement,t=0,i=0;return e.buffered.length>0&&(i=e.buffered.end(e.buffered.length-1),t=i-e.currentTime),t<0&&(this.player.debug.warn(this.TAG_NAME,"checkMSESourceBufferDelay ".concat(t," < 0, and buffered is ").concat(i," ,currentTime is ").concat(e.currentTime," , try to seek ").concat(e.currentTime," to ").concat(i)),e.currentTime=i,t=0),t}},{key:"checkSourceBufferStore",value:function(){var e=this.$videoElement,t=0;return e.buffered.length>0&&(t=e.currentTime-e.buffered.start(0)),t}},{key:"getDecodeDiffTimes",value:function(){return this.decodeDiffTimestamp}},{key:"removeBuffer",value:function(e,t){var i=ko();if(this.player.debug.log(this.TAG_NAME,"removeBuffer() start is ".concat(e," and end is ").concat(t," and _isMacOsFirefox is ").concat(i)),this.isStateOpen&&No(i)){if(No(this.getSourceBufferUpdating()))try{this.sourceBuffer.remove(e,t)}catch(e){this.player.debug.warn(this.TAG_NAME,"removeBuffer() sourceBuffer error",e)}if(No(this.getAudioSourceBufferUpdating()))try{this.audioSourceBuffer.remove(e,t)}catch(e){this.player.debug.warn(this.TAG_NAME,"removeBuffer() audioSourceBuffer error",e)}}}},{key:"clearUpAllSourceBuffer",value:function(){if(this.sourceBuffer){for(var e=this.sourceBuffer.buffered,t=0;t=1)if(this.getSourceBufferUpdating()||this.getAudioSourceBufferUpdating())this.hasPendingEos=!0;else{this.hasPendingEos=!1;try{this.player.debug.log(this.TAG_NAME,"endOfStream()"),this.mediaSource.endOfStream()}catch(e){this.player.debug.warn(this.TAG_NAME,"endOfStream() error",e)}}}},{key:"abortSourceBuffer",value:function(){if(this.isStateOpen){if(this.sourceBuffer){try{this.player.debug.log(this.TAG_NAME,"abortSourceBuffer() abort sourceBuffer"),this.sourceBuffer.abort()}catch(e){}No(this.getSourceBufferUpdating())&&this._doRemoveRanges()}if(this.audioSourceBuffer){try{this.player.debug.log(this.TAG_NAME,"abortSourceBuffer() abort audioSourceBuffer"),this.audioSourceBuffer.abort()}catch(e){}No(this.getAudioSourceBufferUpdating())&&this._doRemoveRanges()}}this.sourceBuffer=null,this.audioSourceBuffer=null}},{key:"removeSourceBuffer",value:function(){if(!this.isStateClosed&&this.mediaSource){if(this.sourceBuffer)try{this.player.debug.log(this.TAG_NAME,"removeSourceBuffer() sourceBuffer"),this.mediaSource.removeSourceBuffer(this.sourceBuffer)}catch(e){this.player.debug.error(this.TAG_NAME,"removeSourceBuffer() sourceBuffer error",e)}if(this.audioSourceBuffer)try{this.player.debug.log(this.TAG_NAME,"removeSourceBuffer() audioSourceBuffer"),this.mediaSource.removeSourceBuffer(this.audioSourceBuffer)}catch(e){this.player.debug.error(this.TAG_NAME,"removeSourceBuffer() audioSourceBuffer error",e)}}}},{key:"_hasPendingSegments",value:function(){return this.pendingSegments.length>0||this.pendingAudioSegments.length>0}},{key:"getPendingSegmentsLength",value:function(){return this.pendingSegments.length}},{key:"_handleUpdatePlaybackRate",value:function(){if(this.$videoElement){var e=this.$videoElement;this.player._opt.videoBuffer,this.player._opt.videoBufferDelay;var t=e.buffered;t.length&&t.start(0);var i=t.length?t.end(t.length-1):0,r=e.currentTime,a=i-r,n=this.getMseBufferMaxDelayTime();if(this.player.updateStats({mseVideoBufferDelayTime:a}),a>n)this.player.debug.log(this.TAG_NAME,"handleUpdatePlaybackRate and buffered is ".concat(i," and current is ").concat(r," , delay buffer is more than ").concat(n," is ").concat(a," and new time is ").concat(i)),e.currentTime=i,r=e.currentTime;else if(a<0){if(this.player.debug.warn(this.TAG_NAME,"handleUpdatePlaybackRate and delay buffer is ".concat(i," - current is ").concat(r," = ").concat(a," < 0 and check video is paused : ").concat(e.paused," ")),0===i)return void this.player.emit(It.mediaSourceBufferedIsZeroError,"video.buffered is empty");e.paused&&e.play()}var o=this._getPlaybackRate(i-r);e.playbackRate!==o&&(this.player.debug.log(this.TAG_NAME,"handleUpdatePlaybackRate and buffered is ".concat(i," and current time is ").concat(r," and delay is ").concat(i-r," set playbackRate is ").concat(o," ")),e.playbackRate=o)}}},{key:"_handleUpdateBufferDelayTime",value:function(){var e=this.getVideoBufferDelayTime();this.player.updateStats({mseVideoBufferDelayTime:e})}},{key:"_checkVideoPlayCurrentTime",value:function(){var e=this.checkSourceBufferStore();if(e<0){var t=this.getVideoBufferStartTime();this.player.debug.warn(this.TAG_NAME,"checkVideoPlayCurrentTime store is ".concat(e," < 0 and set currentTime ").concat(this.$videoElement.currentTime," to ").concat(t)),this.$videoElement.currentTime=t}}},{key:"_doAppendSegments",value:function(){var t=this;if(this.isStateClosed||this.isStateEnded)this.player.debug.log(this.TAG_NAME,"_doAppendSegments() mediaSource is closed or ended and return");else if(null!==this.sourceBuffer){if(this.needInitAudio()&&null===this.audioSourceBuffer)return this.player.debug.log(this.TAG_NAME,"_doAppendSegments() audioSourceBuffer is null and need init audio source buffer"),void(null===this.audioSourceBufferCheckTimeout&&(this.audioSourceBufferCheckTimeout=setTimeout((function(){t._clearAudioSourceBufferCheckTimeout(),t.player.emit(It.mediaSourceAudioInitTimeout)}),1e3)));if(No(this.getSourceBufferUpdating())&&this.pendingSegments.length>0){var i=this.pendingSegments.shift();try{this.sourceBuffer.appendBuffer(i)}catch(e){this.player.debug.error(this.TAG_NAME,"this.sourceBuffer.appendBuffer()",e.code,e),22===e.code?(this.stop(),this.mediaSourceAppendBufferFull=!0,this.player.emitError(It.mediaSourceFull)):11===e.code?(this.stop(),this.mediaSourceAppendBufferError=!0,this.player.emitError(It.mediaSourceAppendBufferError)):(this.stop(),this.mediaSourceBufferError=!0,this.player.emitError(xt.mseSourceBufferError,e))}}if(No(this.getAudioSourceBufferUpdating())&&this.pendingAudioSegments.length>0){var r=this.pendingAudioSegments.shift();try{this.audioSourceBuffer.appendBuffer(r)}catch(e){this.player.debug.error(this.TAG_NAME,"this.audioSourceBuffer.appendBuffer()",e.code,e),22===e.code?(this.stop(),this.mediaSourceAppendBufferFull=!0,this.player.emitError(It.mediaSourceFull)):11===e.code?(this.stop(),this.mediaSourceAppendBufferError=!0,this.player.emitError(It.mediaSourceAppendBufferError)):(this.stop(),this.mediaSourceBufferError=!0,this.player.emitError(xt.mseSourceBufferError,e))}}}else this.player.debug.log(this.TAG_NAME,"_doAppendSegments() sourceBuffer is null and wait init and return")}},{key:"_doCleanUpSourceBuffer",value:function(){if(this.$videoElement){var e=this.$videoElement.currentTime;if(this.sourceBuffer){for(var t=this.sourceBuffer.buffered,i=!1,r=0;r=this.player._opt.mseAutoCleanupMaxBackwardDuration){i=!0;var o=e-this.player._opt.mseAutoCleanupMinBackwardDuration;this.pendingRemoveRanges.push({start:a,end:o})}}else n=this.player._opt.mseAutoCleanupMaxBackwardDuration){l=!0;var h=e-this.player._opt.mseAutoCleanupMinBackwardDuration;this.pendingAudioRemoveRanges.push({start:u,end:h})}}else d0||this.pendingAudioRemoveRanges.length>0}},{key:"_doRemoveRanges",value:function(){if(this.sourceBuffer&&No(this.getSourceBufferUpdating()))for(var t=this.pendingRemoveRanges;t.length&&No(this.getSourceBufferUpdating());){var i=t.shift();try{this.sourceBuffer.remove(i.start,i.end)}catch(e){this.player.debug.warn(this.TAG_NAME,"_doRemoveRanges() sourceBuffer error",e)}}if(this.audioSourceBuffer&&No(this.getAudioSourceBufferUpdating()))for(var r=this.pendingAudioRemoveRanges;r.length&&No(this.getAudioSourceBufferUpdating());){var a=r.shift();try{this.audioSourceBuffer.remove(a.start,a.end)}catch(e){this.player.debug.warn(this.TAG_NAME,"_doRemoveRanges() audioSourceBuffer error",e)}}}},{key:"getDecodePlaybackRate",value:function(){var e=0,t=this.$videoElement;return t&&(e=t.playbackRate),e}},{key:"_getPlaybackRate",value:function(e){var t=this.$videoElement,i=this.player._opt.videoBufferDelay+this.player._opt.videoBuffer,r=Math.max(i,1e3),a=r/2;return e*=1e3,1===t.playbackRate?e>r?1.2:1:e<=a?1:t.playbackRate}},{key:"_needCleanupSourceBuffer",value:function(){if(No(this.player._opt.mseAutoCleanupSourceBuffer)||!this.$videoElement)return!1;var e=this.$videoElement,t=e.buffered,i=e.currentTime;return t.length>=1&&i-t.start(0)>=this.player._opt.mseAutoCleanupMaxBackwardDuration}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.currentTime),e}},{key:"getVideoBufferLastTime",value:function(){var e=this.$videoElement,t=0;if(e){var i=e.buffered;i.length&&i.start(0),t=i.length?i.end(i.length-1):0}return t}},{key:"getVideoBufferStartTime",value:function(){var e=this.$videoElement,t=0;if(e){var i=e.buffered;t=i.length?i.start(0):0}return t}},{key:"getVideoBufferDelayTime",value:function(){var e=this.$videoElement,t=this.getVideoBufferLastTime()-e.currentTime;return t>0?t:0}},{key:"_clearAudioSourceBufferCheckTimeout",value:function(){this.audioSourceBufferCheckTimeout&&(clearTimeout(this.audioSourceBufferCheckTimeout),this.audioSourceBufferCheckTimeout=null)}},{key:"_clearAudioNoDataCheckTimeout",value:function(){this.audioSourceNoDataCheckTimeout&&(clearTimeout(this.audioSourceNoDataCheckTimeout),this.audioSourceNoDataCheckTimeout=null)}},{key:"getMimeType",value:function(){return{video:this.videoMimeType,audio:this.audioMimeType}}},{key:"getMseBufferMaxDelayTime",value:function(){var e=(this.player._opt.videoBuffer+this.player._opt.videoBufferDelay)/1e3;return Math.max(5,e+3)}}])}(s),gd=function(){return"wakeLock"in navigator&&-1===window.navigator.userAgent.indexOf("Samsung")&&No(Hn())},yd=function(){function t(e){var i=this;S(this,t),this.player=e,this.enabled=!1,gd()?(this.player.debug.log("NoSleep","Native Wake Lock API supported."),this._wakeLock=null,this.handleVisibilityChange=function(){null!==i._wakeLock&&"visible"===document.visibilityState&&i.enable()},document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("fullscreenchange",this.handleVisibilityChange)):(this.player.debug.log("NoSleep","Native Wake Lock API not supported. so use video element."),this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm","data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAABLfEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHYTbuMU6uEElTDZ1OsggGXTbuMU6uEHFO7a1OsghLJ7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsirXsYMPQkBNgI1MYXZmNTguNDUuMTAwV0GNTGF2ZjU4LjQ1LjEwMESJiECzmgAAAAAAFlSua0C5rgEAAAAAAABO14EBc8WI9UhIq9EDJPCcgQAitZyDdW5khoVWX1ZQOIOBASPjg4QF9eEA4AEAAAAAAAAbsIIBQLqB8FSwggElVLqB8FWwiFW3gQFVuIECrgEAAAAAAABZ14ECc8WIUEWPA9J/iJ6cgQAitZyDdW5khoZBX09QVVNWqoNjLqBWu4QExLQAg4EC4ZGfgQG1iEDncAAAAAAAYmSBIGOik09wdXNIZWFkAQE4AYC7AAAAAAASVMNnQcJzcwEAAAAAAACXY8CAZ8gBAAAAAAAAFUWji01BSk9SX0JSQU5ERIeEaXNvbWfIAQAAAAAAABZFo41NSU5PUl9WRVJTSU9ORIeDNTEyZ8gBAAAAAAAAJ0WjkUNPTVBBVElCTEVfQlJBTkRTRIeQaXNvbWlzbzJhdmMxbXA0MWfIAQAAAAAAABpFo4dFTkNPREVSRIeNTGF2ZjU4LjQ1LjEwMHNzAQAAAAAAAIZjwItjxYj1SEir0QMk8GfIAQAAAAAAAB5Fo4xIQU5ETEVSX05BTUVEh4xWaWRlb0hhbmRsZXJnyAEAAAAAAAAhRaOHRU5DT0RFUkSHlExhdmM1OC45MS4xMDAgbGlidnB4Z8iiRaOIRFVSQVRJT05Eh5QwMDowMDowNS4wMDcwMDAwMDAAAHNzAQAAAAAAAIdjwItjxYhQRY8D0n+InmfIAQAAAAAAAB5Fo4xIQU5ETEVSX05BTUVEh4xTb3VuZEhhbmRsZXJnyAEAAAAAAAAiRaOHRU5DT0RFUkSHlUxhdmM1OC45MS4xMDAgbGlib3B1c2fIokWjiERVUkFUSU9ORIeUMDA6MDA6MDUuMDE4MDAwMDAwAAAfQ7Z1T2TngQCjh4IAAID4//6jQKSBAAeAMBIAnQEqQAHwAABHCIWFiIWEiAICAAYWBPcGgWSfa9ubJzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh69AD+/6tQgKOHggAVgPj//qOHggApgPj//qOHggA9gPj//qOHggBRgPj//qOHggBlgPj//qOegQBrANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCAHmA+P/+o4eCAI2A+P/+o4eCAKGA+P/+o4eCALWA+P/+o4eCAMmA+P/+o56BAM8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IA3YD4//6jh4IA8YD4//6jh4IBBYD4//6jh4IBGYD4//6jh4IBLYD4//6jnoEBMwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggFBgPj//qOHggFVgPj//qOHggFpgPj//qOHggF9gPj//qOHggGRgPj//qOegQGXANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCAaWA+P/+o4eCAbmA+P/+o4eCAc2A+P/+o4eCAeGA+P/+o4eCAfWA+P/+o56BAfsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4ICCYD4//6jh4ICHYD4//6jh4ICMYD4//6jh4ICRYD4//6jh4ICWYD4//6jnoECXwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggJtgPj//qOHggKBgPj//qOHggKVgPj//qOHggKpgPj//qOHggK9gPj//qOegQLDANECAAUQEBRgAGFgv9AAIgAQzX61yT5xzAAAo4eCAtGA+P/+o4eCAuWA+P/+o4eCAvmA+P/+o4eCAw2A+P/+o4eCAyGA+P/+o56BAycA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IDNYD4//6jh4IDSYD4//6jh4IDXYD4//6jh4IDcYD4//6jh4IDhYD4//6jnoEDiwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggOZgPj//qOHggOtgPj//qOHggPBgPj//qOHggPVgPj//qOHggPpgPj//qOegQPvANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCA/2A+P/+o4eCBBGA+P/+o4eCBCWA+P/+o4eCBDmA+P/+o4eCBE2A+P/+o56BBFMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IEiID4//6jh4IEnID4//6jh4IEsID4//6jnoEEtwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggTEgPj//qOHggTYgPj//qOHggTsgPj//qOHggUAgPj//qOHggUUgPj//qOegQUbANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCBSiA+P/+o4eCBTyA+P/+o4eCBVCA+P/+o4eCBWSA+P/+o4eCBXiA+P/+o56BBX8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IFjID4//6jh4IFoID4//6jh4IFtID4//6jh4IFyID4//6jh4IF3ID4//6jnoEF4wDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggXwgPj//qOHggYEgPj//qOHggYYgPj//qOHggYsgPj//qOHggZAgPj//qOegQZHANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCBlSA+P/+o4eCBmiA+P/+o4eCBnyA+P/+o4eCBpCA+P/+o4eCBqSA+P/+o56BBqsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IGuID4//6jh4IGzID4//6jh4IG4ID4//6jh4IG9ID4//6jh4IHCID4//6jnoEHDwDRAgAFEBAUYABhYL/QACIAEM1+tck+ccwAAKOHggccgPj//qOHggcwgPj//qOHggdEgPj//qOHggdYgPj//qOHggdsgPj//qOegQdzANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCB4CA+P/+o4eCB5SA+P/+o4eCB6iA+P/+o4eCB7yA+P/+o4eCB9CA+P/+o56BB9cA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IH5ID4//6jh4IH+ID4//6jh4IIDID4//6jh4IIIID4//6jh4IINID4//6jnoEIOwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgghIgPj//qOHgghcgPj//qOHgghwgPj//qOHggiEgPj//qOegQifANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCMCA+P/+o4eCCNSA+P/+o4eCCOiA+P/+o4eCCPyA+P/+o56BCQMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IJEID4//6jh4IJJID4//6jh4IJOID4//6jh4IJTID4//6jh4IJYID4//6jnoEJZwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggl0gPj//qOHggmIgPj//qOHggmcgPj//qOHggmwgPj//qOHggnEgPj//qOegQnLANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCdiA+P/+o4eCCeyA+P/+o4eCCgCA+P/+o4eCChSA+P/+o4eCCiiA+P/+o56BCi8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IKPID4//6jh4IKUID4//6jh4IKZID4//6jh4IKeID4//6jh4IKjID4//6jnoEKkwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggqggPj//qOHggq0gPj//qOHggrIgPj//qOHggrcgPj//qOHggrwgPj//qOegQr3ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCwSA+P/+o4eCCxiA+P/+o4eCCyyA+P/+o4eCC0CA+P/+o4eCC1SA+P/+o56BC1sA0QIABRAQFGAAYWC/0AAiABDNfrXJPnHMAACjh4ILaID4//6jh4ILfID4//6jh4ILkID4//6jh4ILpID4//6jh4ILuID4//6jnoELvwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggvMgPj//qOHggvggPj//qOHggv0gPj//qOHggwIgPj//qOHggwcgPj//qOegQwjANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDDCA+P/+o4eCDESA+P/+o4eCDFiA+P/+o4eCDGyA+P/+o4eCDICA+P/+o56BDIcA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IMlID4//6jh4IMqID4//6jh4IMvID4//6jh4IM0ID4//6jnoEM6wDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg0MgPj//qOHgg0ggPj//qOHgg00gPj//qOHgg1IgPj//qOegQ1PANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDVyA+P/+o4eCDXCA+P/+o4eCDYSA+P/+o4eCDZiA+P/+o4eCDayA+P/+o56BDbMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4INwID4//6jh4IN1ID4//6jh4IN6ID4//6jh4IN/ID4//6jh4IOEID4//6jnoEOFwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg4kgPj//qOHgg44gPj//qOHgg5MgPj//qOHgg5ggPj//qOHgg50gPj//qOegQ57ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDoiA+P/+o4eCDpyA+P/+o4eCDrCA+P/+o4eCDsSA+P/+o4eCDtiA+P/+o56BDt8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IO7ID4//6jh4IPAID4//6jh4IPFID4//6jh4IPKID4//6jh4IPPID4//6jnoEPQwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg9QgPj//qOHgg9kgPj//qOHgg94gPj//qOHgg+MgPj//qOHgg+ggPj//qOegQ+nANECAAUQEBRgAGFgv9AAIgAQzX61yT5xzAAAo4eCD7SA+P/+o4eCD8iA+P/+o4eCD9yA+P/+o4eCD/CA+P/+o4eCEASA+P/+o56BEAsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IQGID4//6jh4IQLID4//6jh4IQQID4//6jh4IQVID4//6jh4IQaID4//6jnoEQbwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghB8gPj//qOHghCQgPj//qOHghCkgPj//qOHghC4gPj//qOHghDMgPj//qOegRDTANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEOCA+P/+o4eCEPSA+P/+o4eCEQiA+P/+o56BETcA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IRQ4D4//6jh4IRV4D4//6jh4IRa4D4//6jh4IRf4D4//6jh4IRk4D4//6jnoERmwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghGngPj//qOHghG7gPj//qOHghHPgPj//qOHghHjgPj//qOHghH3gPj//qOegRH/ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEguA+P/+o4eCEh+A+P/+o4eCEjOA+P/+o4eCEkeA+P/+o4eCEluA+P/+o56BEmMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4ISb4D4//6jh4ISg4D4//6jh4ISl4D4//6jh4ISq4D4//6jh4ISv4D4//6jnoESxwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghLTgPj//qOHghLngPj//qOHghL7gPj//qOHghMPgPj//qOHghMjgPj//qOegRMrANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEzeA+P/+o4eCE0uA+P/+o4eCE1+A+P/+o4eCE3OA+P/+oAEAAAAAAAAPoYeCE4cA+P/+daKDB/KBHFO7a5G7j7OBB7eK94EB8YIDX/CBDA=="),this._addSourceToVideo(this.noSleepVideo,"mp4","data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACORtZGF03gIATGF2YzU4LjM1LjEwMAACMEAOAAACcQYF//9t3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2MSByMzAyNyA0MTIxMjc3IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTAgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0wIHdlaWdodHA9MCBrZXlpbnQ9MjUwIGtleWludF9taW49MTAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD00MCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIzLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAADvZYiED/JigADD7JycnJycnJycnJycnJycnJycnJ11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114BGCAHARggBwEYIAcBGCAHARggBwAAAAdBmjgf4BLYARggBwEYIAcBGCAHARggBwAAAAdBmlQH+AS2ARggBwEYIAcBGCAHARggBwAAAAdBmmA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZqAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZrAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0Ga4D/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbAD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbID/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBm0A/wCWwARggBwEYIAcBGCAHAAAAB0GbYD/AJbABGCAHARggBwEYIAcAAAAHQZuAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GboD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbwD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0Gb4D/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBmgA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmiA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmkA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZpgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqgP8AlsAEYIAcBGCAHARggBwAAAAdBmsA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmuA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmwA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZsgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtgP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GbgD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GboD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbwD/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBm+A/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmgA/wCWwARggBwEYIAcAAAAHQZogP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GaQD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GaYD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GagD/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBmqA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmsA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmuA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZsAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZsgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GbYD/AJbABGCAHARggBwAAAAdBm4A/wCWwARggBwEYIAcBGCAHARggBwAAAAdBm6A/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZvAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZvgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZoAO8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GaIDfAJbABGCAHARggBwEYIAcBGCAHAAAMxm1vb3YAAABsbXZoZAAAAAAAAAAAAAAAAAAAA+gAABOgAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAPLdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAQAAAAAAABOIAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAElVVUA8AAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAATiAAAAAAAAQAAAAADQ21kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAKAAAAMgAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAu5taW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAKuc3RibAAAAKpzdHNkAAAAAAAAAAEAAACaYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAFAAPAASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADRhdmNDAULAC//hABxnQsAL2QFB+/8ACwAMEAAAAwAQAAADAUDxQqSAAQAFaMuDyyAAAAAQcGFzcAAAAAsAAAAMAAAAGHN0dHMAAAAAAAAAAQAAADIAAAQAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAA3HN0c3oAAAAAAAAAAAAAADIAAANoAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAANhzdGNvAAAAAAAAADIAAABFAAADwQAAA9wAAAP3AAAEFgAABDEAAARMAAAEawAABIYAAAShAAAEwAAABNcAAATuAAAFDQAABSgAAAVDAAAFYgAABX0AAAWYAAAFtwAABdIAAAXtAAAGBAAABh8AAAY6AAAGWQAABnQAAAaPAAAGrgAABskAAAbkAAAHAwAABx4AAAcxAAAHUAAAB2sAAAeGAAAHpQAAB8AAAAfbAAAH+gAACBUAAAgwAAAITwAACGIAAAh9AAAInAAACLcAAAjSAAAI8QAACCV0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAAE6AAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAABOIAAAEAAABAAAAAAedbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAACsRAADYVRVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAAHSG1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAHDHN0YmwAAABqc3RzZAAAAAAAAAABAAAAWm1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAACsRAAAAAAANmVzZHMAAAAAA4CAgCUAAgAEgICAF0AVAAAAAAENiAAABVQFgICABRIIVuUABoCAgAECAAAAYHN0dHMAAAAAAAAACgAAAC8AAAQAAAAAAQAACtUAAAAsAAAEAAAAAAEAAArWAAAALAAABAAAAAABAAAK1QAAACwAAAQAAAAAAQAACtUAAAAaAAAEAAAAAAEAAAH/AAABzHN0c2MAAAAAAAAAJQAAAAEAAAABAAAAAQAAAAIAAAAFAAAAAQAAAAMAAAAEAAAAAQAAAAUAAAAFAAAAAQAAAAYAAAAEAAAAAQAAAAgAAAAFAAAAAQAAAAkAAAAEAAAAAQAAAAsAAAAFAAAAAQAAAAwAAAADAAAAAQAAAA4AAAAFAAAAAQAAAA8AAAAEAAAAAQAAABEAAAAFAAAAAQAAABIAAAAEAAAAAQAAABQAAAAFAAAAAQAAABUAAAAEAAAAAQAAABcAAAADAAAAAQAAABgAAAAEAAAAAQAAABoAAAAFAAAAAQAAABsAAAAEAAAAAQAAAB0AAAAFAAAAAQAAAB4AAAAEAAAAAQAAACAAAAAFAAAAAQAAACEAAAAEAAAAAQAAACIAAAACAAAAAQAAACMAAAAFAAAAAQAAACQAAAAEAAAAAQAAACYAAAAFAAAAAQAAACcAAAAEAAAAAQAAACkAAAAFAAAAAQAAACoAAAAEAAAAAQAAACwAAAAFAAAAAQAAAC0AAAACAAAAAQAAAC4AAAAEAAAAAQAAAC8AAAAFAAAAAQAAADAAAAAEAAAAAQAAADIAAAAFAAAAAQAAADMAAAAEAAAAAQAAA1xzdHN6AAAAAAAAAAAAAADSAAAAFQAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAA3HN0Y28AAAAAAAAAMwAAADAAAAOtAAADzAAAA+cAAAQCAAAEIQAABDwAAARXAAAEdgAABJEAAASsAAAEywAABOIAAAT5AAAFGAAABTMAAAVOAAAFbQAABYgAAAWjAAAFwgAABd0AAAX4AAAGDwAABioAAAZFAAAGZAAABn8AAAaaAAAGuQAABtQAAAbvAAAHDgAABykAAAc8AAAHWwAAB3YAAAeRAAAHsAAAB8sAAAfmAAAIBQAACCAAAAg7AAAIWgAACG0AAAiIAAAIpwAACMIAAAjdAAAI/AAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAADSAAAAAQAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTguMjAuMTAw"),Object.assign(this.noSleepVideo.style,{position:"absolute",left:"-100%",top:"-100%"}),document.querySelector("body").append(this.noSleepVideo),this.handleNoSleepVideoTimeUpdate=function(){i.noSleepVideo&&i.noSleepVideo.currentTime>4&&(i.noSleepVideo.currentTime=1)},this.noSleepVideo.addEventListener("timeupdate",this.handleNoSleepVideoTimeUpdate))}return T(t,[{key:"destroy",value:function(){if(this._wakeLock&&(this._wakeLock.release(),this._wakeLock=null),this.noSleepVideo){this.handleNoSleepVideoTimeUpdate&&this.noSleepVideo.removeEventListener("timeupdate",this.handleNoSleepVideoTimeUpdate);try{this.noSleepVideo.parentNode&&this.noSleepVideo.parentNode.removeChild(this.noSleepVideo)}catch(e){this.player.debug.warn("NoSleep","Failed to remove noSleepVideo element.")}this.noSleepVideo=null}this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("fullscreenchange",this.handleVisibilityChange))}},{key:"_addSourceToVideo",value:function(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/".concat(t),e.appendChild(r)}},{key:"isEnabled",get:function(){return this.enabled}},{key:"enable",value:function(){var e=this,t=this.player.debug;return gd()?navigator.wakeLock.request("screen").then((function(i){e._wakeLock=i,e.enabled=!0,t.log("wakeLock","Wake Lock active."),e._wakeLock.addEventListener("release",(function(){t.log("wakeLock","Wake Lock released.")}))})).catch((function(i){throw e.enabled=!1,t.warn("wakeLock","".concat(i.name,", ").concat(i.message)),i})):this.noSleepVideo.play().then((function(i){return t.log("wakeLock","noSleepVideo Wake Lock active."),e.enabled=!0,i})).catch((function(i){throw t.warn("wakeLock","noSleepVideo ".concat(i.name,", ").concat(i.message)),e.enabled=!1,i}))}},{key:"disable",value:function(){gd()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):this.noSleepVideo&&this.noSleepVideo.pause(),this.enabled=!1,this.player.debug.log("wakeLock","Disabling wake lock.")}}])}();function vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ad={exports:{}};!function(e,t){var i,r,a,n,o;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");return a.path=o.normalizePath(a.path),o.buildURLFromParts(a)}var n=o.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=o.normalizePath(n.path),o.buildURLFromParts(n)):t;var s=o.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=r.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var c={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(c.netLoc=s.netLoc,"/"!==n.path[0]))if(n.path){var u=s.path,d=u.substring(0,u.lastIndexOf("/")+1)+n.path;c.path=o.normalizePath(d)}else c.path=s.path,n.params||(c.params=s.params,n.query||(c.query=s.query));return null===c.path&&(c.path=i.alwaysNormalize?o.normalizePath(n.path):n.path),o.buildURLFromParts(c)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(a,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=o}(Ad);var bd=Ad.exports;function _d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function kd(e){for(var t=1;t1?t-1:0),r=1;r")):Id}(t)}))}var Ud=Bd,Fd=/^(\d+)x(\d+)$/,Od=/(.+?)=(".*?"|.*?)(?:,|$)/g,Nd=function(){function e(t){S(this,e),"string"==typeof t&&(t=e.parseAttrList(t)),Td(this,t)}return T(e,[{key:"clientAttrs",get:function(){return Object.keys(this).filter((function(e){return"X-"===e.substring(0,2)}))}},{key:"decimalInteger",value:function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var i=new Uint8Array(t.length/2),r=0;rNumber.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"optionalFloat",value:function(e,t){var i=this[e];return i?parseFloat(i):t}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"bool",value:function(e){return"YES"===this[e]}},{key:"decimalResolution",value:function(e){var t=Fd.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,i={};for(Od.lastIndex=0;null!==(t=Od.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),i[t[1].trim()]=r}return i}}])}();function jd(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}var Gd=function(){function e(t,i){if(S(this,e),this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,i){var r=i.attr;for(var a in r)if(Object.prototype.hasOwnProperty.call(t,a)&&t[a]!==r[a]){Ud.warn('DATERANGE tag attribute: "'.concat(a,'" does not match for tags with ID: "').concat(t.ID,'"')),this._badValueForSameId=a;break}t=Td(new Nd({}),r,t)}if(this.attr=t,this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){var n=new Date(this.attr["END-DATE"]);Ed(n.getTime())&&(this._endDate=n)}}return T(e,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}},{key:"duration",get:function(){if("DURATION"in this.attr){var e=this.attr.decimalFloatingPoint("DURATION");if(Ed(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}},{key:"endOnNext",get:function(){return this.attr.bool("END-ON-NEXT")}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Ed(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}])}(),zd=T((function e(){S(this,e),this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}})),Hd="audio",Wd="video",Vd="audiovideo",Jd=function(){function e(t){S(this,e),this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=p(p(p({},Hd,null),Wd,null),Vd,null),this.baseurl=t}return T(e,[{key:"setByteRange",value:function(e,t){var i,r=e.split("@",2);i=1===r.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(r[1]),this._byteRange=[i,parseInt(r[0])+i]}},{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=bd.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}])}(),qd=function(e){function t(e,i){var r;return S(this,t),r=_(this,t,[i]),r._decryptdata=null,r.rawProgramDateTime=null,r.programDateTime=null,r.tagList=[],r.duration=0,r.sn=0,r.levelkeys=void 0,r.type=void 0,r.loader=null,r.keyLoader=null,r.level=-1,r.cc=0,r.startPTS=void 0,r.endPTS=void 0,r.startDTS=void 0,r.endDTS=void 0,r.start=0,r.deltaPTS=void 0,r.maxStartPTS=void 0,r.minEndPTS=void 0,r.stats=new zd,r.data=void 0,r.bitrateTest=!1,r.title=null,r.initSegment=null,r.endList=void 0,r.gap=void 0,r.urlId=0,r.type=e,r}return k(t,e),T(t,[{key:"decryptdata",get:function(){var e=this.levelkeys;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{var i=Object.keys(this.levelkeys);if(1===i.length)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Ed(this.programDateTime))return null;var e=Ed(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var t=Object.keys(this.levelkeys),i=t.length;if(i>1||1===i&&this.levelkeys[t[0]].encrypted)return!0}return!1}},{key:"setKeyFormat",value:function(e){if(this.levelkeys){var t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}},{key:"abortRequests",value:function(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}},{key:"setElementaryStreamInfo",value:function(e,t,i,r,a){var n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=this.elementaryStreams,s=o[e];s?(s.startPTS=Math.min(s.startPTS,t),s.endPTS=Math.max(s.endPTS,i),s.startDTS=Math.min(s.startDTS,r),s.endDTS=Math.max(s.endDTS,a)):o[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:a,partial:n}}},{key:"clearElementaryStreamInfo",value:function(){var e=this.elementaryStreams;e[Hd]=null,e[Wd]=null,e[Vd]=null}}])}(Jd),Kd=function(e){function t(e,i,r,a,n){var o;S(this,t),o=_(this,t,[r]),o.fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new zd,o.duration=e.decimalFloatingPoint("DURATION"),o.gap=e.bool("GAP"),o.independent=e.bool("INDEPENDENT"),o.relurl=e.enumeratedString("URI"),o.fragment=i,o.index=a;var s=e.enumeratedString("BYTERANGE");return s&&o.setByteRange(s,n),n&&(o.fragOffset=n.fragOffset+n.duration),o}return k(t,e),T(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}])}(Jd),Yd=function(){function e(t){S(this,e),this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}return T(e,[{key:"reloaded",value:function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}},{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Ed(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])}();function Qd(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)}))}function Xd(e){var t=e.split(":"),i=null;if("data"===t[0]&&2===t.length){var r=t[1].split(";"),a=r[r.length-1].split(",");if(2===a.length){var n="base64"===a[0],o=a[1];n?(r.splice(-1,1),i=Qd(o)):i=function(e){var t=Zd(e).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}(o)}}return i}function Zd(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(function(e){return e.charCodeAt(0)}))}var $d="undefined"!=typeof self?self:void 0,eh={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},th="org.w3.clearkey",ih="com.apple.streamingkeydelivery",rh="com.microsoft.playready",ah="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function nh(e){switch(e){case ih:return eh.FAIRPLAY;case rh:return eh.PLAYREADY;case ah:return eh.WIDEVINE;case th:return eh.CLEARKEY}}var oh="edef8ba979d64acea3c827dcd51d21ed";function sh(e){switch(e){case eh.FAIRPLAY:return ih;case eh.PLAYREADY:return rh;case eh.WIDEVINE:return ah;case eh.CLEARKEY:return th}}function lh(e){var t=e.drmSystems,i=e.widevineLicenseUrl,r=t?[eh.FAIRPLAY,eh.WIDEVINE,eh.PLAYREADY,eh.CLEARKEY].filter((function(e){return!!t[e]})):[];return!r[eh.WIDEVINE]&&i&&r.push(eh.WIDEVINE),r}var ch,uh=null!=$d&&null!=(ch=$d.navigator)&&ch.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function dh(e,t,i){return Uint8Array.prototype.slice?e.slice(t,i):new Uint8Array(Array.prototype.slice.call(e,t,i))}var hh,ph=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},fh=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},mh=function(e,t){for(var i=t,r=0;ph(e,t);)r+=10,r+=gh(e,t+6),fh(e,t+10)&&(r+=10),t+=r;if(r>0)return e.subarray(i,i+r)},gh=function(e,t){var i=0;return i=(127&e[t])<<21,i|=(127&e[t+1])<<14,i|=(127&e[t+2])<<7,i|=127&e[t+3],i},yh=function(e,t){return ph(e,t)&&gh(e,t+6)+10<=e.length-t},vh=function(e){for(var t=_h(e),i=0;i1&&void 0!==arguments[1]&&arguments[1],i=xh();if(i){var r=i.decode(e);if(t){var a=r.indexOf("\0");return-1!==a?r.substring(0,a):r}return r.replace(/\0/g,"")}for(var n,o,s,l=e.length,c="",u=0;u>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(n);break;case 12:case 13:o=e[u++],c+=String.fromCharCode((31&n)<<6|63&o);break;case 14:o=e[u++],s=e[u++],c+=String.fromCharCode((15&n)<<12|(63&o)<<6|(63&s)<<0)}}return c};function xh(){if(!navigator.userAgent.includes("PlayStation 4"))return hh||void 0===self.TextDecoder||(hh=new self.TextDecoder("utf-8")),hh}var Rh=function(e){for(var t="",i=0;i>24,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}function Nh(e,t){var i=[];if(!t.length)return i;for(var r=e.byteLength,a=0;a1?a+n:r;if(Ph(e.subarray(a+4,a+8))===t[0])if(1===t.length)i.push(e.subarray(a+8,o));else{var s=Nh(e.subarray(a+8,o),t.slice(1));s.length&&Lh.apply(i,s)}a=o}return i}function jh(e){var t=[],i=e[0],r=8,a=Mh(e,r);r+=4;var n=0,o=0;0===i?(n=Mh(e,r),o=Mh(e,r+4),r+=8):(n=Uh(e,r),o=Uh(e,r+8),r+=16),r+=2;var s=e.length+o,l=Bh(e,r);r+=2;for(var c=0;c>>31)return Ud.warn("SIDX has hierarchical references (not supported)"),null;var p=Mh(e,u);u+=4,t.push({referenceSize:h,subsegmentDuration:p,info:{duration:p/a,start:s,end:s+h-1}}),s+=h,u+=4,r=u}return{earliestPresentationTime:n,timescale:a,version:i,referencesCount:l,references:t}}function Gh(e){for(var t=[],i=Nh(e,["moov","trak"]),r=0;r12){var u=4;if(3!==c[u++])break;u=Hh(c,u),u+=2;var d=c[u++];if(128&d&&(u+=2),64&d&&(u+=c[u++]),4!==c[u++])break;u=Hh(c,u);var h=c[u++];if(64!==h)break;if(a+="."+Wh(h),u+=12,5!==c[u++])break;u=Hh(c,u);var p=c[u++],f=(248&p)>>3;31===f&&(f+=1+((7&p)<<3)+((224&c[u])>>5)),a+="."+f}break;case"hvc1":case"hev1":var m=Nh(i,["hvcC"])[0],g=m[1],y=["","A","B","C"][g>>6],v=31&g,A=Mh(m,2),b=(32&g)>>5?"H":"L",_=m[12],k=m.subarray(6,12);a+="."+y+v,a+="."+A.toString(16).toUpperCase(),a+="."+b+_;for(var w="",S=k.length;S--;){var T=k[S];(T||w)&&(w="."+T.toString(16).toUpperCase()+w)}a+=w;break;case"dvh1":case"dvhe":var E=Nh(i,["dvcC"])[0],C=E[2]>>1&127,x=E[2]<<5&32|E[3]>>3&31;a+="."+Vh(C)+"."+Vh(x);break;case"vp09":var R=Nh(i,["vpcC"])[0],D=R[4],L=R[5],I=R[6]>>4&15;a+="."+Vh(D)+"."+Vh(L)+"."+Vh(I);break;case"av01":var P=Nh(i,["av1C"])[0],B=P[1]>>>5,M=31&P[1],U=P[2]>>>7?"H":"M",F=(64&P[2])>>6,O=(32&P[2])>>5,N=2===B&&F?O?12:10:F?10:8,j=(16&P[2])>>4,G=(8&P[2])>>3,z=(4&P[2])>>2,H=3&P[2],W=1,V=1,J=1,q=0;a+="."+B+"."+Vh(M)+U+"."+Vh(N)+"."+j+"."+G+z+H+"."+Vh(W)+"."+Vh(V)+"."+Vh(J)+"."+q;break}return{codec:a,encrypted:n}}function Hh(e,t){for(var i=t+5;128&e[t++]&&t>1&63;return 39===i||40===i}return 6===(31&t)}function Xh(e,t,i,r){var a=Zh(e),n=0;n+=t;for(var o=0,s=0,l=0;n=a.length)break;l=a[n++],o+=l}while(255===l);s=0;do{if(n>=a.length)break;l=a[n++],s+=l}while(255===l);var c=a.length-n,u=n;if(sc){Ud.error("Malformed SEI payload. ".concat(s," is too small, only ").concat(c," bytes left to parse."));break}if(4===o){if(181===a[u++]){var d=Bh(a,u);if(u+=2,49===d){var h=Mh(a,u);if(u+=4,1195456820===h){var p=a[u++];if(3===p){var f=a[u++],m=31&f,g=64&f,y=g?2+3*m:0,v=new Uint8Array(y);if(g){v[0]=f;for(var A=1;A16){for(var b=[],_=0;_<16;_++){var k=a[u++].toString(16);b.push(1==k.length?"0"+k:k),3!==_&&5!==_&&7!==_&&9!==_||b.push("-")}for(var w=s-16,S=new Uint8Array(w),T=0;T0?(n=new Uint8Array(4),t.length>0&&new DataView(n.buffer).setUint32(0,t.length,!1)):n=new Uint8Array;var l=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(l.buffer).setUint32(0,i.byteLength,!1),function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=255&n,s.set(e,4),o=0,n=8;o3&&void 0!==arguments[3]?arguments[3]:[1],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;S(this,e),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=i,this.keyFormat=r,this.keyFormatVersions=a,this.iv=n,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&"AES-128"!==t}return T(e,[{key:"isSupported",value:function(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case ih:case ah:case rh:case th:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}},{key:"getDecryptData",value:function(t){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof t&&("AES-128"!==this.method||this.iv||Ud.warn('missing IV for initialization segment with method="'.concat(this.method,'" - compliance issue')),t=0);var i=function(e){for(var t=new Uint8Array(16),i=12;i<16;i++)t[i]=e>>8*(15-i)&255;return t}(t);return new e(this.method,this.uri,"identity",this.keyFormatVersions,i)}var r=Xd(this.uri);if(r)switch(this.keyFormat){case ah:this.pssh=r,r.length>=22&&(this.keyId=r.subarray(r.length-22,r.length-6));break;case rh:var a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=$h(a,null,r);var n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),o=String.fromCharCode.apply(null,Array.from(n)),s=o.substring(o.indexOf("<"),o.length),l=(new DOMParser).parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(l){var c=l.childNodes[0]?l.childNodes[0].nodeValue:l.getAttribute("VALUE");if(c){var u=Qd(c).subarray(0,16);!function(e){var t=function(e,t,i){var r=e[t];e[t]=e[i],e[i]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(u),this.keyId=u}}break;default:var d=r.subarray(0,16);if(16!==d.length){var h=new Uint8Array(16);h.set(d,16-d.length),d=h}this.keyId=d;break}if(!this.keyId||16!==this.keyId.byteLength){var p=ep[this.uri];if(!p){var f=Object.keys(ep).length%Number.MAX_SAFE_INTEGER;p=new Uint8Array(16),new DataView(p.buffer,12,4).setUint32(0,f),ep[this.uri]=p}this.keyId=p}return this}}],[{key:"clearKeyUriToKeyIdMap",value:function(){ep={}}}])}(),ip=/\{\$([a-zA-Z0-9-_]+)\}/g;function rp(e){return ip.test(e)}function ap(e,t,i){if(null!==e.variableList||e.hasVariableRefs)for(var r=i.length;r--;){var a=i[r],n=t[a];n&&(t[a]=np(e,n))}}function np(e,t){if(null!==e.variableList||e.hasVariableRefs){var i=e.variableList;return t.replace(ip,(function(t){var r=t.substring(2,t.length-1),a=null==i?void 0:i[r];return void 0===a?(e.playlistParsingError||(e.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'.concat(r,'"'))),t):a}))}return t}function op(e,t,i){var r,a,n=e.variableList;if(n||(e.variableList=n={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{var o=new self.URL(i).searchParams;if(!o.has(r))throw new Error('"'.concat(r,'" does not match any query parameter in URI: "').concat(i,'"'));a=o.get(r)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: ".concat(t.message)))}}else r=t.NAME,a=t.VALUE;r in n?e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'.concat(r,'"'))):n[r]=a||""}function sp(e,t,i){var r=t.IMPORT;if(i&&r in i){var a=e.variableList;a||(e.variableList=a={}),a[r]=i[r]}else e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'.concat(r,'"')))}function lp(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if("undefined"!=typeof self)return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}var cp={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function up(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!e.split(",").some((function(e){return!dp(e,t,i)}))}function dp(e,t){var i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=lp(r);return null!=(i=null==a?void 0:a.isTypeSupported(hp(e,t)))&&i}function hp(e,t){return"".concat(t,'/mp4;codecs="').concat(e,'"')}function pp(e){if(e){var t=e.substring(0,4);return cp.video[t]}return 2}function fp(e){return e.split(",").reduce((function(e,t){var i=cp.video[t];return i?(2*i+e)/(e?3:2):(cp.audio[t]+e)/(e?2:1)}),0)}var mp={},gp=/flac|opus/i;function yp(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.replace(gp,(function(e){return function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(mp[e])return mp[e];for(var i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[e],r=0;r0&&n.length0&&j.bool("CAN-SKIP-DATERANGES"),c.partHoldBack=j.optionalFloat("PART-HOLD-BACK",0),c.holdBack=j.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var G=new Nd(E);c.partTarget=G.decimalFloatingPoint("PART-TARGET");break;case"PART":var z=c.partList;z||(z=c.partList=[]);var H=p>0?z[z.length-1]:void 0,W=p++,V=new Nd(E);ap(c,V,["BYTERANGE","URI"]);var J=new Kd(V,y,t,W,H);z.push(J),y.duration+=J.duration;break;case"PRELOAD-HINT":var q=new Nd(E);ap(c,q,["URI"]),c.preloadHint=q;break;case"RENDITION-REPORT":var K=new Nd(E);ap(c,K,["URI"]),c.renditionReports=c.renditionReports||[],c.renditionReports.push(K);break;default:Ud.warn("line parsed but not handled: ".concat(o))}}}g&&!g.relurl?(u.pop(),f-=g.duration,c.partList&&(c.fragmentHint=g)):c.partList&&(Rp(y,g),y.cc=m,c.fragmentHint=y,l&&Lp(y,l,c));var Y=u.length,Q=u[0],X=u[Y-1];if(f+=c.skippedSegments*c.targetduration,f>0&&Y&&X){c.averagetargetduration=f/Y;var Z=X.sn;c.endSN="initSegment"!==Z?Z:0,c.live||(X.endList=!0),Q&&(c.startCC=Q.cc)}else c.endSN=0,c.startCC=0;return c.fragmentHint&&(f+=c.fragmentHint.duration),c.totalduration=f,c.endCC=m,v>0&&function(e,t){for(var i=e[t],r=t;r--;){var a=e[r];if(!a)return;a.programDateTime=i.programDateTime-1e3*a.duration,i=a}}(u,v),c}}])}();function Tp(e,t,i){var r,a,n=new Nd(e);ap(i,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);var o=null!=(r=n.METHOD)?r:"",s=n.URI,l=n.hexadecimalInteger("IV"),c=n.KEYFORMATVERSIONS,u=null!=(a=n.KEYFORMAT)?a:"identity";s&&n.IV&&!l&&Ud.error("Invalid IV: ".concat(n.IV));var d=s?Sp.resolve(s,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new tp(o,d,u,h,l)}function Ep(e){var t=new Nd(e).decimalFloatingPoint("TIME-OFFSET");return Ed(t)?t:null}function Cp(e,t){var i=(e||"").split(/[ ,]+/).filter((function(e){return e}));["video","audio","text"].forEach((function(e){var r=i.filter((function(t){return function(e,t){var i=cp[t];return!!i&&!!i[e.slice(0,4)]}(t,e)}));r.length&&(t["".concat(e,"Codec")]=r.join(","),i=i.filter((function(e){return-1===r.indexOf(e)})))})),t.unknownCodecs=i}function xp(e,t,i){var r=t[i];r&&(e[i]=r)}function Rp(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Ed(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function Dp(e,t,i,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=i,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function Lp(e,t,i){e.levelkeys=t;var r=i.encryptedFragments;r.length&&r[r.length-1].levelkeys===t||!Object.keys(t).some((function(e){return t[e].isCommonEncryption}))||r.push(e)}var Ip="manifest",Pp="level",Bp="audioTrack",Mp="subtitleTrack",Up="main",Fp="audio",Op="subtitle";function Np(e){var t=e.type;switch(t){case Bp:return Fp;case Mp:return Op;default:return Up}}function jp(e,t){var i=e.url;return void 0!==i&&0!==i.indexOf("data:")||(i=t.url),i}var Gp=function(){function e(t){S(this,e),this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=t,this.registerListeners()}return T(e,[{key:"startLoad",value:function(e){}},{key:"stopLoad",value:function(){this.destroyInternalLoaders()}},{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.LEVEL_LOADING,this.onLevelLoading,this),e.on(Rd.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(Rd.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.LEVEL_LOADING,this.onLevelLoading,this),e.off(Rd.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(Rd.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}},{key:"createInternalLoader",value:function(e){var t=this.hls.config,i=t.pLoader,r=t.loader,a=new(i||r)(t);return this.loaders[e.type]=a,a}},{key:"getInternalLoader",value:function(e){return this.loaders[e.type]}},{key:"resetInternalLoader",value:function(e){this.loaders[e]&&delete this.loaders[e]}},{key:"destroyInternalLoaders",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}},{key:"destroy",value:function(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}},{key:"onManifestLoading",value:function(e,t){var i=t.url;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Ip,url:i,deliveryDirectives:null})}},{key:"onLevelLoading",value:function(e,t){var i=t.id,r=t.level,a=t.pathwayId,n=t.url,o=t.deliveryDirectives;this.load({id:i,level:r,pathwayId:a,responseType:"text",type:Pp,url:n,deliveryDirectives:o})}},{key:"onAudioTrackLoading",value:function(e,t){var i=t.id,r=t.groupId,a=t.url,n=t.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:Bp,url:a,deliveryDirectives:n})}},{key:"onSubtitleTrackLoading",value:function(e,t){var i=t.id,r=t.groupId,a=t.url,n=t.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:Mp,url:a,deliveryDirectives:n})}},{key:"load",value:function(e){var t,i,r,a=this,n=this.hls.config,o=this.getInternalLoader(e);if(o){var s=o.context;if(s&&s.url===e.url&&s.level===e.level)return void Ud.trace("[playlist-loader]: playlist request ongoing");Ud.log("[playlist-loader]: aborting previous loader for type: ".concat(e.type)),o.abort()}if((i=e.type===Ip?n.manifestLoadPolicy.default:Td({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),o=this.createInternalLoader(e),Ed(null==(t=e.deliveryDirectives)?void 0:t.part))&&(e.type===Pp&&null!==e.level?r=this.hls.levels[e.level].details:e.type===Bp&&null!==e.id?r=this.hls.audioTracks[e.id].details:e.type===Mp&&null!==e.id&&(r=this.hls.subtitleTracks[e.id].details),r)){var l=r.partTarget,c=r.targetduration;if(l&&c){var u=1e3*Math.max(3*l,.8*c);i=Td({},i,{maxTimeToFirstByteMs:Math.min(u,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(u,i.maxTimeToFirstByteMs)})}}var d=i.errorRetry||i.timeoutRetry||{},h={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:d.maxNumRetry||0,retryDelay:d.retryDelayMs||0,maxRetryDelay:d.maxRetryDelayMs||0},p={onSuccess:function(e,t,i,r){var n=a.getInternalLoader(i);a.resetInternalLoader(i.type);var o=e.data;0===o.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),Sp.isMediaPlaylist(o)?a.handleTrackOrLevelPlaylist(e,t,i,r||null,n):a.handleMasterPlaylist(e,t,i,r)):a.handleManifestParsingError(e,i,new Error("no EXTM3U delimiter"),r||null,t)},onError:function(e,t,i,r){a.handleNetworkError(t,i,!1,e,r)},onTimeout:function(e,t,i){a.handleNetworkError(t,i,!0,void 0,e)}};o.load(e,h,p)}},{key:"handleMasterPlaylist",value:function(e,t,i,r){var a=this.hls,n=e.data,o=jp(e,i),s=Sp.parseMasterPlaylist(n,o);if(s.playlistParsingError)this.handleManifestParsingError(e,i,s.playlistParsingError,r,t);else{var l=s.contentSteering,c=s.levels,u=s.sessionData,d=s.sessionKeys,h=s.startTimeOffset,p=s.variableList;this.variableList=p;var f=Sp.parseMasterPlaylistMedia(n,o,s),m=f.AUDIO,g=void 0===m?[]:m,y=f.SUBTITLES,v=f["CLOSED-CAPTIONS"];g.length&&(g.some((function(e){return!e.url}))||!c[0].audioCodec||c[0].attrs.AUDIO||(Ud.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Nd({}),bitrate:0,url:""}))),a.trigger(Rd.MANIFEST_LOADED,{levels:c,audioTracks:g,subtitles:y,captions:v,contentSteering:l,url:o,stats:t,networkDetails:r,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:p})}}},{key:"handleTrackOrLevelPlaylist",value:function(e,t,i,r,a){var n=this.hls,o=i.id,s=i.level,l=i.type,c=jp(e,i),u=Ed(s)?s:Ed(o)?o:0,d=Np(i),h=Sp.parseLevelPlaylist(e.data,c,u,d,0,this.variableList);if(l===Ip){var p={attrs:new Nd({}),bitrate:0,details:h,name:"",url:c};n.trigger(Rd.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:c,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=h,this.handlePlaylistLoaded(h,e,t,i,r,a)}},{key:"handleManifestParsingError",value:function(e,t,i,r,a){this.hls.trigger(Rd.ERROR,{type:Dd.NETWORK_ERROR,details:Ld.MANIFEST_PARSING_ERROR,fatal:t.type===Ip,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:a})}},{key:"handleNetworkError",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,n="A network ".concat(i?"timeout":"error"+(r?" (status "+r.code+")":"")," occurred while loading ").concat(e.type);e.type===Pp?n+=": ".concat(e.level," id: ").concat(e.id):e.type!==Bp&&e.type!==Mp||(n+=" id: ".concat(e.id,' group-id: "').concat(e.groupId,'"'));var o=new Error(n);Ud.warn("[playlist-loader]: ".concat(n));var s=Ld.UNKNOWN,l=!1,c=this.getInternalLoader(e);switch(e.type){case Ip:s=i?Ld.MANIFEST_LOAD_TIMEOUT:Ld.MANIFEST_LOAD_ERROR,l=!0;break;case Pp:s=i?Ld.LEVEL_LOAD_TIMEOUT:Ld.LEVEL_LOAD_ERROR,l=!1;break;case Bp:s=i?Ld.AUDIO_TRACK_LOAD_TIMEOUT:Ld.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Mp:s=i?Ld.SUBTITLE_TRACK_LOAD_TIMEOUT:Ld.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(e.type);var u={type:Dd.NETWORK_ERROR,details:s,fatal:l,url:e.url,loader:c,context:e,error:o,networkDetails:t,stats:a};if(r){var d=(null==t?void 0:t.url)||e.url;u.response=kd({url:d,data:void 0},r)}this.hls.trigger(Rd.ERROR,u)}},{key:"handlePlaylistLoaded",value:function(e,t,i,r,a,n){var o=this.hls,s=r.type,l=r.level,c=r.id,u=r.groupId,d=r.deliveryDirectives,h=jp(t,r),p=Np(r),f="number"==typeof r.level&&p===Up?l:void 0;if(e.fragments.length){e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));var m=e.playlistParsingError;if(m)o.trigger(Rd.ERROR,{type:Dd.NETWORK_ERROR,details:Ld.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:m,reason:m.message,response:t,context:r,level:f,parent:p,networkDetails:a,stats:i});else switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),n.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),s){case Ip:case Pp:o.trigger(Rd.LEVEL_LOADED,{details:e,level:f||0,id:c||0,stats:i,networkDetails:a,deliveryDirectives:d});break;case Bp:o.trigger(Rd.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:i,networkDetails:a,deliveryDirectives:d});break;case Mp:o.trigger(Rd.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:i,networkDetails:a,deliveryDirectives:d})}}else{var g=new Error("No Segments found in Playlist");o.trigger(Rd.ERROR,{type:Dd.NETWORK_ERROR,details:Ld.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:r,level:f,parent:p,networkDetails:a,stats:i})}}}])}();function zp(e,t){var i;try{i=new Event("addtrack")}catch(e){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=e,t.dispatchEvent(i)}function Hp(e,t){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: ".concat(t))}catch(i){Ud.debug("[texttrack-utils]: ".concat(i));try{var r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}catch(e){Ud.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: ".concat(e))}}"disabled"===i&&(e.mode=i)}function Wp(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var i=e.cues.length;i--;)e.removeCue(e.cues[i]);"disabled"===t&&(e.mode=t)}function Vp(e,t,i,r){var a=e.mode;if("disabled"===a&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var n=function(e,t,i){var r=[],a=function(e,t){if(te[i].endTime)return-1;for(var r=0,a=i;r<=a;){var n=Math.floor((a+r)/2);if(te[n].startTime&&r-1)for(var n=a,o=e.length;n=t&&s.endTime<=i)r.push(s);else if(s.startTime>i)return r}return r}(e.cues,t,i),o=0;oZp&&(d=Zp),d-u<=0&&(d=u+.25);for(var h=0;ht.startDate&&(!e||t.startDate.05&&this.forwardBufferLength>1){var l=Math.min(2,Math.max(1,n)),c=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;e.playbackRate=Math.min(l,Math.max(1,c))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}}},{key:"estimateLiveEdge",value:function(){var e=this.levelDetails;return null===e?null:e.edge+e.age}},{key:"computeLatency",value:function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}])}(),rf=["NONE","TYPE-0","TYPE-1",null],af=["SDR","PQ","HLG"],nf="",of="YES",sf="v2",lf=function(){function e(t,i,r){S(this,e),this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=i,this.skip=r}return T(e,[{key:"addDirectives",value:function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}])}(),cf=function(){function e(t){S(this,e),this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(e){return!!e})).map((function(e){return e.substring(0,4)})).join(","),this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.attrs.SUBTITLES)}return T(e,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"averageBitrate",get:function(){return this._avgBitrate||this.realBitrate||this.bitrate}},{key:"attrs",get:function(){return this._attrs[0]}},{key:"codecs",get:function(){return this.attrs.CODECS||""}},{key:"pathwayId",get:function(){return this.attrs["PATHWAY-ID"]||"."}},{key:"videoRange",get:function(){return this.attrs["VIDEO-RANGE"]||"SDR"}},{key:"score",get:function(){return this.attrs.optionalFloat("SCORE",0)}},{key:"uri",get:function(){return this.url[0]||""}},{key:"hasAudioGroup",value:function(e){return uf(this._audioGroups,e)}},{key:"hasSubtitleGroup",value:function(e){return uf(this._subtitleGroups,e)}},{key:"audioGroups",get:function(){return this._audioGroups}},{key:"subtitleGroups",get:function(){return this._subtitleGroups}},{key:"addGroupId",value:function(e,t){if(t)if("audio"===e){var i=this._audioGroups;i||(i=this._audioGroups=[]),-1===i.indexOf(t)&&i.push(t)}else if("text"===e){var r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),-1===r.indexOf(t)&&r.push(t)}}},{key:"urlId",get:function(){return 0},set:function(e){}},{key:"audioGroupIds",get:function(){return this.audioGroups?[this.audioGroupId]:void 0}},{key:"textGroupIds",get:function(){return this.subtitleGroups?[this.textGroupId]:void 0}},{key:"audioGroupId",get:function(){var e;return null==(e=this.audioGroups)?void 0:e[0]}},{key:"textGroupId",get:function(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}},{key:"addFallback",value:function(){}}])}();function uf(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function df(e,t){var i=t.startPTS;if(Ed(i)){var r,a=0;t.sn>e.sn?(a=i-e.start,r=e):(a=e.start-i,r=t),r.duration!==a&&(r.duration=a)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function hf(e,t,i,r,a,n){r-i<=0&&(Ud.warn("Fragment should have a positive duration",t),r=i+t.duration,n=a+t.duration);var o=i,s=r,l=t.startPTS,c=t.endPTS;if(Ed(l)){var u=Math.abs(l-i);Ed(t.deltaPTS)?t.deltaPTS=Math.max(u,t.deltaPTS):t.deltaPTS=u,o=Math.max(i,l),i=Math.min(i,l),a=Math.min(a,t.startDTS),s=Math.min(r,c),r=Math.max(r,c),n=Math.max(n,t.endDTS)}var d=i-t.start;0!==t.start&&(t.start=i),t.duration=r-t.start,t.startPTS=i,t.maxStartPTS=o,t.startDTS=a,t.endPTS=r,t.minEndPTS=s,t.endDTS=n;var h,p=t.sn;if(!e||pe.endSN)return 0;var f=p-e.startSN,m=e.fragments;for(m[f]=t,h=f;h>0;h--)df(m[h],m[h-1]);for(h=f;h=0;a--){var n=r[a].initSegment;if(n){i=n;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var o,s=0;if(function(e,t,i){for(var r=t.skippedSegments,a=Math.max(e.startSN,t.startSN)-t.startSN,n=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,o=t.startSN-e.startSN,s=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a;c<=n;c++){var u=l[o+c],d=s[c];r&&!d&&c=r.length||mf(t,r[i].start)}function mf(e,t){if(t){for(var i=e.fragments,r=e.skippedSegments;r499)}(a)||!!i);return e.shouldRetry?e.shouldRetry(e,t,i,r,n):n}var Sf=function(e,t){for(var i=0,r=e.length-1,a=null,n=null;i<=r;){a=(i+r)/2|0,n=e[a];var o=t(n);if(o>0)i=a+1;else{if(!(o<0))return n;r=a-1}}return null};function Tf(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=null;if(e){a=t[e.sn-t[0].sn+1]||null;var n=e.endDTS-i;n>0&&n<15e-7&&(i+=15e-7)}else 0===i&&0===t[0].start&&(a=t[0]);if(a&&(!e||e.level===a.level)&&0===Ef(i,r,a))return a;var o=Sf(t,Ef.bind(null,i,r));return!o||o===e&&a?a:o}function Ef(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0;if(i.start<=e&&i.start+i.duration>e)return 0;var r=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=e?1:i.start-r>e&&i.start?-1:0}function Cf(e,t,i){var r=1e3*Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>e}var xf=0,Rf=2,Df=3,Lf=5,If=0,Pf=1,Bf=2,Mf=function(){function e(t,i){S(this,e),this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=Ud.log.bind(Ud,"".concat(i,":")),this.warn=Ud.warn.bind(Ud,"".concat(i,":")),this.hls=t}return T(e,[{key:"destroy",value:function(){this.clearTimer(),this.hls=this.log=this.warn=null}},{key:"clearTimer",value:function(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}},{key:"startLoad",value:function(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}},{key:"stopLoad",value:function(){this.canLoad=!1,this.clearTimer()}},{key:"switchParams",value:function(e,t){var i=null==t?void 0:t.renditionReports;if(i){for(var r=-1,a=0;a=0&&u>t.partTarget&&(c+=1)}return new lf(l,c>=0?c:void 0,nf)}}}},{key:"loadPlaylist",value:function(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}},{key:"shouldLoadPlaylist",value:function(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}},{key:"shouldReloadPlaylist",value:function(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}},{key:"playlistLoaded",value:function(e,t,i){var r=this,a=t.details,n=t.stats,o=self.performance.now(),s=n.loading.first?Math.max(0,o-n.loading.first):0;if(a.advancedDateTime=Date.now()-s,a.live||null!=i&&i.live){if(a.reloaded(i),i&&this.log("live playlist ".concat(e," ").concat(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:a.updated?"UPDATED":"MISSED")),i&&a.fragments.length>0&&pf(i,a),!this.canLoad||!a.live)return;var l,c,u;if(a.canBlockReload&&a.endSN&&a.advanced){var d=this.hls.config.lowLatencyMode,h=a.lastPartSn,p=a.endSN,f=a.lastPartIndex,m=h===p,g=d?0:f;-1!==f?(c=m?p+1:h,u=m?g:f+1):c=p+1;var y=a.age,v=y+a.ageHeader,A=Math.min(v-a.partTarget,1.5*a.targetduration);if(A>0){if(i&&A>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: ".concat(i.tuneInGoal," to: ").concat(A," with playlist age: ").concat(a.age)),A=0;else{var b=Math.floor(A/a.targetduration);c+=b,void 0!==u&&(u+=Math.round(A%a.targetduration/a.partTarget)),this.log("CDN Tune-in age: ".concat(a.ageHeader,"s last advanced ").concat(y.toFixed(2),"s goal: ").concat(A," skip sn ").concat(b," to part ").concat(u))}a.tuneInGoal=A}if(l=this.getDeliveryDirectives(a,t.deliveryDirectives,c,u),d||!m)return void this.loadPlaylist(l)}else(a.canBlockReload||a.canSkipUntil)&&(l=this.getDeliveryDirectives(a,t.deliveryDirectives,c,u));var _=this.hls.mainForwardBufferInfo,k=_?_.end-_.len:0,w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,i=1e3*e.targetduration;if(e.updated){var r=e.fragments,a=4;if(r.length&&i*a>t){var n=1e3*r[r.length-1].duration;nthis.requestScheduled+w&&(this.requestScheduled=n.loading.start),void 0!==c&&a.canBlockReload?this.requestScheduled=n.loading.first+w-(1e3*a.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+w=c.maxNumRetry)return!1;if(r&&null!=(d=e.context)&&d.deliveryDirectives)this.warn("Retrying playlist loading ".concat(l+1,"/").concat(c.maxNumRetry,' after "').concat(i,'" without delivery-directives')),this.loadPlaylist();else{var h=_f(c,l);this.timer=self.setTimeout((function(){return t.loadPlaylist()}),h),this.warn("Retrying playlist loading ".concat(l+1,"/").concat(c.maxNumRetry,' after "').concat(i,'" in ').concat(h,"ms"))}e.levelRetry=!0,a.resolved=!0}return u}}])}(),Uf=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;S(this,e),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=i,this.totalWeight_=r}return T(e,[{key:"sample",value:function(e,t){var i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}},{key:"getTotalWeight",value:function(){return this.totalWeight_}},{key:"getEstimate",value:function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}])}(),Ff=function(){function e(t,i,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;S(this,e),this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Uf(t),this.fast_=new Uf(i),this.defaultTTFB_=a,this.ttfb_=new Uf(t)}return T(e,[{key:"update",value:function(e,t){var i=this.slow_,r=this.fast_,a=this.ttfb_;i.halfLife!==e&&(this.slow_=new Uf(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new Uf(t,r.getEstimate(),r.getTotalWeight())),a.halfLife!==e&&(this.ttfb_=new Uf(e,a.getEstimate(),a.getTotalWeight()))}},{key:"sample",value:function(e,t){var i=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}},{key:"sampleTTFB",value:function(e){var t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}},{key:"canEstimate",value:function(){return this.fast_.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"getEstimateTTFB",value:function(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}},{key:"destroy",value:function(){}}])}(),Of={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},Nf={};function jf(e,t,i,r,a,n){var o=e.audioCodec?e.audioGroups:null,s=null==n?void 0:n.audioCodec,l=null==n?void 0:n.channels,c=l?parseInt(l):s?1/0:2,u=null;if(null!=o&&o.length)try{u=1===o.length&&o[0]?t.groups[o[0]].channels:o.reduce((function(e,i){if(i){var r=t.groups[i];if(!r)throw new Error("Audio track group ".concat(i," not found"));Object.keys(r.channels).forEach((function(t){e[t]=(e[t]||0)+r.channels[t]}))}return e}),{2:0})}catch(e){return!0}return void 0!==e.videoCodec&&(e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==i||e.bitrate>Math.max(a,8e6))||!!u&&Ed(c)&&Object.keys(u).some((function(e){return parseInt(e)>c}))}function Gf(e,t,i){var r=e.videoCodec,a=e.audioCodec;if(!r||!a||!i)return Promise.resolve(Of);var n={width:e.width,height:e.height,bitrate:Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)),framerate:e.frameRate||30},o=e.videoRange;"SDR"!==o&&(n.transferFunction=o.toLowerCase());var s=r.split(",").map((function(e){return{type:"media-source",video:kd(kd({},n),{},{contentType:hp(e,"video")})}}));return a&&e.audioGroups&&e.audioGroups.forEach((function(e){var i;e&&(null==(i=t.groups[e])||i.tracks.forEach((function(t){if(t.groupId===e){var i=t.channels||"",r=parseFloat(i);Ed(r)&&r>2&&s.push.apply(s,a.split(",").map((function(e){return{type:"media-source",audio:{contentType:hp(e,"audio"),channels:""+r}}})))}})))})),Promise.all(s.map((function(e){var t=function(e){var t=e.audio,i=e.video,r=i||t;if(r){var a=r.contentType.split('"')[1];if(i)return"r".concat(i.height,"x").concat(i.width,"f").concat(Math.ceil(i.framerate)).concat(i.transferFunction||"sd","_").concat(a,"_").concat(Math.ceil(i.bitrate/1e5));if(t)return"c".concat(t.channels).concat(t.spatialRendering?"s":"n","_").concat(a)}return""}(e);return Nf[t]||(Nf[t]=i.decodingInfo(e))}))).then((function(e){return{supported:!e.some((function(e){return!e.supported})),configurations:s,decodingInfoResults:e}})).catch((function(e){return{supported:!1,configurations:s,decodingInfoResults:[],error:e}}))}function zf(e,t){var i=!1,r=[];return e&&(i="SDR"!==e,r=[e]),t&&(r=t.allowedVideoRanges||af.slice(0),i=void 0!==t.preferHDR?t.preferHDR:function(){if("function"==typeof matchMedia){var e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),r=i?r.filter((function(e){return"SDR"!==e})):["SDR"]),{preferHDR:i,allowedVideoRanges:r}}function Hf(e,t){Ud.log('[abr] start candidates with "'.concat(e,'" ignored because ').concat(t))}function Wf(e,t,i){if("attrs"in e){var r=t.indexOf(e);if(-1!==r)return r}for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:"",i=e.split(","),r=t.split(",");return i.length===r.length&&!i.some((function(e){return-1===r.indexOf(e)}))}(s,t.characteristics))&&(void 0===i||i(e,t))}function Jf(e,t){var i=e.audioCodec,r=e.channels;return!(void 0!==i&&(t.audioCodec||"").substring(0,4)!==i.substring(0,4)||void 0!==r&&r!==(t.channels||"2"))}function qf(e,t,i){for(var r=t;r;r--)if(i(e[r]))return r;for(var a=t+1;a1&&this.tickImmediate(),this._tickCallCount=0)}},{key:"tickImmediate",value:function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}},{key:"doTick",value:function(){}}])}(),Yf="NOT_LOADED",Qf="APPENDING",Xf="PARTIAL",Zf="OK",$f=function(){function e(t){S(this,e),this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}return T(e,[{key:"_registerListeners",value:function(){var e=this.hls;e.on(Rd.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Rd.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Rd.FRAG_LOADED,this.onFragLoaded,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(Rd.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Rd.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Rd.FRAG_LOADED,this.onFragLoaded,this)}},{key:"destroy",value:function(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}},{key:"getAppendedFrag",value:function(e,t){var i=this.activePartLists[t];if(i)for(var r=i.length;r--;){var a=i[r];if(!a)break;var n=a.end;if(a.start<=e&&null!==n&&e<=n)return a}return this.getBufferedFrag(e,t)}},{key:"getBufferedFrag",value:function(e,t){for(var i=this.fragments,r=Object.keys(i),a=r.length;a--;){var n=i[r[a]];if((null==n?void 0:n.body.type)===t&&n.buffered){var o=n.body;if(o.start<=e&&e<=o.end)return o}}return null}},{key:"detectEvictedFragments",value:function(e,t,i,r){var a=this;this.timeRanges&&(this.timeRanges[e]=t);var n=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((function(r){var o=a.fragments[r];if(o&&!(n>=o.body.sn))if(o.buffered||o.loaded){var s=o.range[e];s&&s.time.some((function(e){var i=!a.isTimeBuffered(e.startPTS,e.endPTS,t);return i&&a.removeFragment(o.body),i}))}else o.body.type===i&&a.removeFragment(o.body)}))}},{key:"detectPartialFragments",value:function(e){var t=this,i=this.timeRanges,r=e.frag,a=e.part;if(i&&"initSegment"!==r.sn){var n=tm(r),o=this.fragments[n];if(!(!o||o.buffered&&r.gap)){var s=!r.relurl;Object.keys(i).forEach((function(e){var n=r.elementaryStreams[e];if(n){var l=i[e],c=s||!0===n.partial;o.range[e]=t.getBufferedTimes(r,a,c,l)}})),o.loaded=null,Object.keys(o.range).length?(o.buffered=!0,(o.body.endList=r.endList||o.body.endList)&&(this.endListFragments[o.body.type]=o),em(o)||this.removeParts(r.sn-1,r.type)):this.removeFragment(o.body)}}}},{key:"removeParts",value:function(e,t){var i=this.activePartLists[t];i&&(this.activePartLists[t]=i.filter((function(t){return t.fragment.sn>=e})))}},{key:"fragBuffered",value:function(e,t){var i=tm(e),r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}},{key:"getBufferedTimes",value:function(e,t,i,r){for(var a={time:[],partial:i},n=e.start,o=e.end,s=e.minEndPTS||o,l=e.maxStartPTS||n,c=0;c=u&&s<=d){a.time.push({startPTS:Math.max(n,r.start(c)),endPTS:Math.min(o,r.end(c))});break}if(nu){var h=Math.max(n,r.start(c)),p=Math.min(o,r.end(c));p>h&&(a.partial=!0,a.time.push({startPTS:h,endPTS:p}))}else if(o<=u)break}return a}},{key:"getPartialFragment",value:function(e){var t,i,r,a=null,n=0,o=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach((function(l){var c=s[l];c&&em(c)&&(i=c.body.start-o,r=c.body.end+o,e>=i&&e<=r&&(t=Math.min(e-i,r-e),n<=t&&(a=c.body,n=t)))})),a}},{key:"isEndListAppended",value:function(e){var t=this.endListFragments[e];return void 0!==t&&(t.buffered||em(t))}},{key:"getState",value:function(e){var t=tm(e),i=this.fragments[t];return i?i.buffered?em(i)?Xf:Zf:Qf:Yf}},{key:"isTimeBuffered",value:function(e,t,i){for(var r,a,n=0;n=r&&t<=a)return!0;if(t<=r)return!1}return!1}},{key:"onFragLoaded",value:function(e,t){var i=t.frag,r=t.part;if("initSegment"!==i.sn&&!i.bitrateTest){var a=r?null:t,n=tm(i);this.fragments[n]={body:i,appendedPTS:null,loaded:a,buffered:!1,range:Object.create(null)}}}},{key:"onBufferAppended",value:function(e,t){var i=this,r=t.frag,a=t.part,n=t.timeRanges;if("initSegment"!==r.sn){var o=r.type;if(a){var s=this.activePartLists[o];s||(this.activePartLists[o]=s=[]),s.push(a)}this.timeRanges=n,Object.keys(n).forEach((function(e){var t=n[e];i.detectEvictedFragments(e,t,o,a)}))}}},{key:"onFragBuffered",value:function(e,t){this.detectPartialFragments(t)}},{key:"hasFragment",value:function(e){var t=tm(e);return!!this.fragments[t]}},{key:"hasParts",value:function(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}},{key:"removeFragmentsInRange",value:function(e,t,i,r,a){var n=this;r&&!this.hasGaps||Object.keys(this.fragments).forEach((function(o){var s=n.fragments[o];if(s){var l=s.body;l.type!==i||r&&!l.gap||l.starte&&(s.buffered||a)&&n.removeFragment(l)}}))}},{key:"removeFragment",value:function(e){var t=tm(e);e.stats.loaded=0,e.clearElementaryStreamInfo();var i=this.activePartLists[e.type];if(i){var r=e.sn;this.activePartLists[e.type]=i.filter((function(e){return e.fragment.sn!==r}))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}},{key:"removeAllFragments",value:function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}])}();function em(e){var t,i,r;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(i=e.range.audio)?void 0:i.partial)||(null==(r=e.range.audiovideo)?void 0:r.partial))}function tm(e){return"".concat(e.type,"_").concat(e.level,"_").concat(e.sn)}var im={length:0,start:function(){return 0},end:function(){return 0}},rm=function(){function e(){S(this,e)}return T(e,null,[{key:"isBuffered",value:function(t,i){try{if(t)for(var r=e.getBuffered(t),a=0;a=r.start(a)&&i<=r.end(a))return!0}catch(t){}return!1}},{key:"bufferInfo",value:function(t,i,r){try{if(t){var a,n=e.getBuffered(t),o=[];for(a=0;ao&&(r[n-1].end=e[a].end):r.push(e[a])}else r.push(e[a])}else r=e;for(var s,l=0,c=t,u=t,d=0;d=h&&t3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];S(this,e),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=i,this.id=r,this.size=a,this.part=n,this.partial=o}));function nm(e,t){for(var i=0,r=e.length;ii.startCC||e&&e.cc1&&void 0!==arguments[1]?arguments[1]:null,i=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},a=i.byteRangeStartOffset,n=i.byteRangeEndOffset;if(Ed(a)&&Ed(n)){var o,s=a,l=n;if("initSegment"===e.sn&&"AES-128"===(null==(o=e.decryptdata)?void 0:o.method)){var c=n-a;c%16&&(l=n+(16-c%16)),0!==a&&(r.resetIV=!0,s=a-16)}r.rangeStart=s,r.rangeEnd=l}return r}function pm(e,t){var i=new Error("GAP ".concat(e.gap?"tag":"attribute"," found")),r={type:Dd.MEDIA_ERROR,details:Ld.FRAG_GAP,fatal:!1,frag:e,error:i,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new fm(r)}var fm=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e.error.message]),i.data=void 0,i.data=e,i}return k(t,e),T(t)}(y(Error)),mm=function(){function e(t,i){S(this,e),this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=i}return T(e,[{key:"decrypt",value:function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}])}(),gm=function(){function e(t,i){S(this,e),this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=i}return T(e,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}])}(),ym=function(){function e(){S(this,e),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}return T(e,[{key:"uint8ArrayToUint32Array_",value:function(e){for(var t=new DataView(e),i=new Uint32Array(4),r=0;r<4;r++)i[r]=t.getUint32(4*r);return i}},{key:"initTable",value:function(){var e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],a=i[1],n=i[2],o=i[3],s=this.invSubMix,l=s[0],c=s[1],u=s[2],d=s[3],h=new Uint32Array(256),p=0,f=0,m=0;for(m=0;m<256;m++)h[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){var g=f^f<<1^f<<2^f<<3^f<<4;g=g>>>8^255&g^99,e[p]=g,t[g]=p;var y=h[p],v=h[y],A=h[v],b=257*h[g]^16843008*g;r[p]=b<<24|b>>>8,a[p]=b<<16|b>>>16,n[p]=b<<8|b>>>24,o[p]=b,b=16843009*A^65537*v^257*y^16843008*p,l[g]=b<<24|b>>>8,c[g]=b<<16|b>>>16,u[g]=b<<8|b>>>24,d[g]=b,p?(p=y^h[h[h[A^y]]],f^=h[h[f]]):p=f=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),i=!0,r=0;r>8|e>>>24}},{key:"decrypt",value:function(e,t,i){for(var r,a,n,o,s,l,c,u,d,h,p,f,m,g,y=this.keySize+6,v=this.invKeySchedule,A=this.invSBox,b=this.invSubMix,_=b[0],k=b[1],w=b[2],S=b[3],T=this.uint8ArrayToUint32Array_(i),E=T[0],C=T[1],x=T[2],R=T[3],D=new Int32Array(e),L=new Int32Array(D.length),I=this.networkToHostOrderSwap;t>>24]^k[l>>16&255]^w[c>>8&255]^S[255&u]^v[m],a=_[l>>>24]^k[c>>16&255]^w[u>>8&255]^S[255&s]^v[m+1],n=_[c>>>24]^k[u>>16&255]^w[s>>8&255]^S[255&l]^v[m+2],o=_[u>>>24]^k[s>>16&255]^w[l>>8&255]^S[255&c]^v[m+3],s=r,l=a,c=n,u=o,m+=4;r=A[s>>>24]<<24^A[l>>16&255]<<16^A[c>>8&255]<<8^A[255&u]^v[m],a=A[l>>>24]<<24^A[c>>16&255]<<16^A[u>>8&255]<<8^A[255&s]^v[m+1],n=A[c>>>24]<<24^A[u>>16&255]<<16^A[s>>8&255]<<8^A[255&l]^v[m+2],o=A[u>>>24]<<24^A[s>>16&255]<<16^A[l>>8&255]<<8^A[255&c]^v[m+3],L[t]=I(r^E),L[t+1]=I(o^C),L[t+2]=I(n^x),L[t+3]=I(a^R),E=d,C=h,x=p,R=f,t+=4}return L.buffer}}])}(),vm=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.removePKCS7Padding,a=void 0===r||r;if(S(this,e),this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=t.enableSoftwareAES,this.removePKCS7Padding=a,a)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(t){}null===this.subtle&&(this.useSoftware=!0)}return T(e,[{key:"destroy",value:function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}},{key:"isSync",value:function(){return this.useSoftware}},{key:"flush",value:function(){var e=this.currentResult,t=this.remainderData;if(!e||t)return this.reset(),null;var i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){var t=e.byteLength,i=t&&new DataView(e.buffer).getUint8(t-1);return i?dh(e,0,t-i):e}(i):i}},{key:"reset",value:function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}},{key:"decrypt",value:function(e,t,i){var r=this;return this.useSoftware?new Promise((function(a,n){r.softwareDecrypt(new Uint8Array(e),t,i);var o=r.flush();o?a(o.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,i)}},{key:"softwareDecrypt",value:function(e,t,i){var r=this.currentIV,a=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(e=Kh(n,e),this.remainderData=null);var o=this.getValidChunk(e);if(!o.length)return null;r&&(i=r);var s=this.softwareDecrypter;s||(s=this.softwareDecrypter=new ym),s.expandKey(t);var l=a;return this.currentResult=s.decrypt(o.buffer,0,i),this.currentIV=dh(o,-16).buffer,l||null}},{key:"webCryptoDecrypt",value:function(e,t,i){var r=this,a=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new gm(a,t)),this.fastAesKey.expandKey().then((function(t){return a?(r.logOnce("WebCrypto AES decrypt"),new mm(a,new Uint8Array(i)).decrypt(e.buffer,t)):Promise.reject(new Error("web crypto not initialized"))})).catch((function(a){return Ud.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, ".concat(a.name,": ").concat(a.message)),r.onWebCryptoError(e,t,i)}))}},{key:"onWebCryptoError",value:function(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);var r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}},{key:"getValidChunk",value:function(e){var t=e,i=e.length-e.length%16;return i!==e.length&&(t=dh(e,0,i),this.remainderData=dh(e,i)),t}},{key:"logOnce",value:function(e){this.logEnabled&&(Ud.log("[decrypter]: ".concat(e)),this.logEnabled=!1)}}])}(),Am=function(e){for(var t="",i=e.length,r=0;ro.end){var u=n>c;(n2&&void 0!==arguments[2]?arguments[2]:null;if(e-t){var r={startOffset:e,endOffset:t,type:i};this.hls.trigger(Rd.BUFFER_FLUSHING,r)}}},{key:"_loadInitSegment",value:function(e,t){var i=this;this._doFragLoad(e,t).then((function(t){if(!t||i.fragContextChanged(e)||!i.levels)throw new Error("init load aborted");return t})).then((function(t){var r=i.hls,a=t.payload,n=e.decryptdata;if(a&&a.byteLength>0&&null!=n&&n.key&&n.iv&&"AES-128"===n.method){var o=self.performance.now();return i.decrypter.decrypt(new Uint8Array(a),n.key.buffer,n.iv.buffer).catch((function(t){throw r.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((function(a){var n=self.performance.now();return r.trigger(Rd.FRAG_DECRYPTED,{frag:e,payload:a,stats:{tstart:o,tdecrypt:n}}),t.payload=a,i.completeInitSegmentLoad(t)}))}return i.completeInitSegmentLoad(t)})).catch((function(t){i.state!==bm&&i.state!==Rm&&(i.warn(t),i.resetFragmentLoading(e))}))}},{key:"completeInitSegmentLoad",value:function(e){var t=this.levels;if(!t)throw new Error("init load aborted, missing levels");var i=e.frag.stats;this.state=_m,e.frag.data=new Uint8Array(e.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.buffering.end=self.performance.now(),this.tick()}},{key:"fragContextChanged",value:function(e){var t=this.fragCurrent;return!e||!t||e.sn!==t.sn||e.level!==t.level}},{key:"fragBufferedComplete",value:function(e,t){var i,r,a,n,o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log("Buffered ".concat(e.type," sn: ").concat(e.sn).concat(t?" part: "+t.index:""," of ").concat(this.playlistType===Up?"level":"track"," ").concat(e.level," (frag:[").concat((null!=(i=e.startPTS)?i:NaN).toFixed(3),"-").concat((null!=(r=e.endPTS)?r:NaN).toFixed(3),"] > buffer:").concat(o?Am(rm.getBuffered(o)):"(detached)",")")),"initSegment"!==e.sn){var s;if(e.type!==Op){var l=e.elementaryStreams;if(!Object.keys(l).some((function(e){return!!l[e]})))return void(this.state=_m)}var c=null==(s=this.levels)?void 0:s[e.level];null!=c&&c.fragmentError&&(this.log("Resetting level fragment error count of ".concat(c.fragmentError," on frag buffered")),c.fragmentError=0)}this.state=_m,o&&(!this.loadedmetadata&&e.type==Up&&o.buffered.length&&(null==(a=this.fragCurrent)?void 0:a.sn)===(null==(n=this.fragPrevious)?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}},{key:"seekToStartPos",value:function(){}},{key:"_handleFragmentLoadComplete",value:function(e){var t=this.transmuxer;if(t){var i=e.frag,r=e.part,a=e.partsLoaded,n=!a||0===a.length||a.some((function(e){return!e})),o=new am(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!n);t.flush(o)}}},{key:"_handleFragmentLoadProgress",value:function(e){}},{key:"_doFragLoad",value:function(e,t){var i,r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0,o=null==t?void 0:t.details;if(!this.levels||!o)throw new Error("frag load aborted, missing level".concat(o?"":" detail","s"));var s=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&o.encryptedFragments.length&&this.keyLoader.loadClear(e,o.encryptedFragments):(this.log("Loading key for ".concat(e.sn," of [").concat(o.startSN,"-").concat(o.endSN,"], ").concat("[stream-controller]"===this.logPrefix?"level":"track"," ").concat(e.level)),this.state=km,this.fragCurrent=e,s=this.keyLoader.load(e).then((function(e){if(!r.fragContextChanged(e.frag))return r.hls.trigger(Rd.KEY_LOADED,e),r.state===km&&(r.state=_m),e})),this.hls.trigger(Rd.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(s=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),a=Math.max(e.start,a||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){var l=o.partList;if(l&&n){a>e.end&&o.fragmentHint&&(e=o.fragmentHint);var c=this.getNextPart(l,e,a);if(c>-1){var u,d=l[c];return this.log("Loading part sn: ".concat(e.sn," p: ").concat(d.index," cc: ").concat(e.cc," of playlist [").concat(o.startSN,"-").concat(o.endSN,"] parts [0-").concat(c,"-").concat(l.length-1,"] ").concat("[stream-controller]"===this.logPrefix?"level":"track",": ").concat(e.level,", target: ").concat(parseFloat(a.toFixed(3)))),this.nextLoadPosition=d.start+d.duration,this.state=wm,u=s?s.then((function(i){return!i||r.fragContextChanged(i.frag)?null:r.doFragPartsLoad(e,d,t,n)})).catch((function(e){return r.handleFragLoadError(e)})):this.doFragPartsLoad(e,d,t,n).catch((function(e){return r.handleFragLoadError(e)})),this.hls.trigger(Rd.FRAG_LOADING,{frag:e,part:d,targetBufferTime:a}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(l,a))return Promise.resolve(null)}}this.log("Loading fragment ".concat(e.sn," cc: ").concat(e.cc," ").concat(o?"of ["+o.startSN+"-"+o.endSN+"] ":"").concat("[stream-controller]"===this.logPrefix?"level":"track",": ").concat(e.level,", target: ").concat(parseFloat(a.toFixed(3)))),Ed(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=wm;var p,f=this.config.progressive;return p=f&&s?s.then((function(t){return!t||r.fragContextChanged(null==t?void 0:t.frag)?null:r.fragmentLoader.load(e,n)})).catch((function(e){return r.handleFragLoadError(e)})):Promise.all([this.fragmentLoader.load(e,f?n:void 0),s]).then((function(e){var t=h(e,1),i=t[0];return!f&&i&&n&&n(i),i})).catch((function(e){return r.handleFragLoadError(e)})),this.hls.trigger(Rd.FRAG_LOADING,{frag:e,targetBufferTime:a}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):p}},{key:"doFragPartsLoad",value:function(e,t,i,r){var a=this;return new Promise((function(n,o){var s,l=[],c=null==(s=i.details)?void 0:s.partList,u=function(t){a.fragmentLoader.loadPart(e,t,r).then((function(r){l[t.index]=r;var o=r.part;a.hls.trigger(Rd.FRAG_LOADED,r);var s=gf(i,e.sn,t.index+1)||yf(c,e.sn,t.index+1);if(!s)return n({frag:e,part:o,partsLoaded:l});u(s)})).catch(o)};u(t)}))}},{key:"handleFragLoadError",value:function(e){if("data"in e){var t=e.data;e.data&&t.details===Ld.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(Rd.ERROR,t)}else this.hls.trigger(Rd.ERROR,{type:Dd.OTHER_ERROR,details:Ld.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}},{key:"_handleTransmuxerFlush",value:function(e){var t=this.getCurrentContext(e);if(t&&this.state===Em){var i=t.frag,r=t.part,a=t.level,n=self.performance.now();i.stats.parsing.end=n,r&&(r.stats.parsing.end=n),this.updateLevelTiming(i,r,a,e.partial)}else this.fragCurrent||this.state===bm||this.state===Rm||(this.state=_m)}},{key:"getCurrentContext",value:function(e){var t=this.levels,i=this.fragCurrent,r=e.level,a=e.sn,n=e.part;if(null==t||!t[r])return this.warn("Levels object was unset while buffering fragment ".concat(a," of level ").concat(r,". The current chunk will not be buffered.")),null;var o=t[r],s=n>-1?gf(o,a,n):null,l=s?s.fragment:function(e,t,i){if(null==e||!e.details)return null;var r=e.details,a=r.fragments[t-r.startSN];return a||(a=r.fragmentHint,a&&a.sn===t?a:tn&&this.flushMainBuffer(o,e.start)}else this.flushMainBuffer(0,e.start)}},{key:"getFwdBufferInfo",value:function(e,t){var i=this.getLoadPosition();return Ed(i)?this.getFwdBufferInfoAtPos(e,i,t):null}},{key:"getFwdBufferInfoAtPos",value:function(e,t,i){var r=this.config.maxBufferHole,a=rm.bufferInfo(e,t,r);if(0===a.len&&void 0!==a.nextStart){var n=this.fragmentTracker.getBufferedFrag(t,i);if(n&&a.nextStart=i&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to ".concat(t.maxMaxBufferLength,"s")),!0)}},{key:"getAppendedFrag",value:function(e){var t=this.fragmentTracker.getAppendedFrag(e,Up);return t&&"fragment"in t?t.fragment:t}},{key:"getNextFragment",value:function(e,t){var i=t.fragments,r=i.length;if(!r)return null;var a,n=this.config,o=i[0].start;if(t.live){var s=n.initialLiveManifestSize;if(rt}},{key:"getNextFragmentLoopLoading",value:function(e,t,i,r,a){var n=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(null===o)return o;if(e=o,n&&e&&!e.gap&&i.nextStart){var s=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r);if(null!==s&&i.len+s.len>=a)return this.log('buffer full after gaps in "'.concat(r,'" playlist starting at sn: ').concat(e.sn)),null}return e}},{key:"mapToInitFragWhenRequired",value:function(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}},{key:"getNextPart",value:function(e,t,i){for(var r=-1,a=!1,n=!0,o=0,s=e.length;o-1&&ii.start&&i.loaded}},{key:"getInitialLiveFragment",value:function(e,t){var i=this.fragPrevious,r=null;if(i){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: ".concat(i.programDateTime)),r=function(e,t,i){if(null===t||!Array.isArray(e)||!e.length||!Ed(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;i=i||0;for(var r=0;r=e.startSN&&a<=e.endSN){var n=t[a-e.startSN];i.cc===n.cc&&(r=n,this.log("Live playlist, switching playlist, load frag with next SN: ".concat(r.sn)))}r||(r=function(e,t){return Sf(e,(function(e){return e.cct?-1:0}))}(t,i.cc),r&&this.log("Live playlist, switching playlist, load frag with same CC: ".concat(r.sn)))}}else{var o=this.hls.liveSyncPosition;null!==o&&(r=this.getFragmentAtPosition(o,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}},{key:"getFragmentAtPosition",value:function(e,t,i){var r,a=this.config,n=this.fragPrevious,o=i.fragments,s=i.endSN,l=i.fragmentHint,c=a.maxFragLookUpTolerance,u=i.partList,d=!!(a.lowLatencyMode&&null!=u&&u.length&&l);if(d&&l&&!this.bitrateTest&&(o=o.concat(l),s=l.sn),r=et-c?0:c):o[o.length-1],r){var h=r.sn-i.startSN,p=this.fragmentTracker.getState(r);if((p===Zf||p===Xf&&r.gap)&&(n=r),n&&r.sn===n.sn&&(!d||u[0].fragment.sn>r.sn)&&n&&r.level===n.level){var f=o[h+1];r=r.sn=n-t.maxFragLookUpTolerance&&a<=o;if(null!==r&&i.duration>r&&(a").concat(e.startSN," prev-sn: ").concat(s?s.sn:"na"," fragments: ").concat(r)),l}return a}},{key:"waitForCdnTuneIn",value:function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}},{key:"setStartPosition",value:function(e,t){var i=this.startPosition;if(i ").concat(null==(r=this.fragCurrent)?void 0:r.url));else{var n=t.details===Ld.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(a,!0);var o=t.errorAction,s=o||{},l=s.action,c=s.retryCount,u=void 0===c?0:c,d=s.retryConfig;if(o&&l===Lf&&d){this.resetStartWhenNotLoaded(this.levelLastLoaded);var h=_f(d,u);this.warn("Fragment ".concat(a.sn," of ").concat(e," ").concat(a.level," errored with ").concat(t.details,", retrying loading ").concat(u+1,"/").concat(d.maxNumRetry," in ").concat(h,"ms")),o.resolved=!0,this.retryDate=self.performance.now()+h,this.state=Sm}else if(d&&o){if(this.resetFragmentErrors(e),!(u.5;r&&this.reduceMaxBufferLength(i.len);var a=!r;return a&&this.warn("Buffer full error while media.currentTime is not buffered, flush ".concat(t," buffer")),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),a}return!1}},{key:"resetFragmentErrors",value:function(e){e===Fp&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==bm&&(this.state=_m)}},{key:"afterBufferFlushed",value:function(e,t,i){if(e){var r=rm.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===xm&&this.resetLoadingState()}}},{key:"resetLoadingState",value:function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=_m}},{key:"resetStartWhenNotLoaded",value:function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=e?e.details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}},{key:"resetWhenMissingContext",value:function(e){this.warn("The loading context changed while buffering fragment ".concat(e.sn," of level ").concat(e.level,". This chunk will not be buffered.")),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}},{key:"removeUnbufferedFrags",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}},{key:"updateLevelTiming",value:function(e,t,i,r){var a,n=this,o=i.details;if(o){if(!Object.keys(e.elementaryStreams).reduce((function(t,a){var s=e.elementaryStreams[a];if(s){var l=s.endPTS-s.startPTS;if(l<=0)return n.warn("Could not parse fragment ".concat(e.sn," ").concat(a," duration reliably (").concat(l,")")),t||!1;var c=r?0:hf(o,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return n.hls.trigger(Rd.LEVEL_PTS_UPDATED,{details:o,level:i,drift:c,type:a,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}),!1)&&null===(null==(a=this.transmuxer)?void 0:a.error)){var s=new Error("Found no media in fragment ".concat(e.sn," of level ").concat(e.level," resetting transmuxer to fallback to playlist timing"));if(0===i.fragmentError&&(i.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(s.message),this.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!1,error:s,frag:e,reason:"Found no media in msn ".concat(e.sn,' of level "').concat(i.url,'"')}),!this.hls)return;this.resetTransmuxer()}this.state=Cm,this.hls.trigger(Rd.FRAG_PARSED,{frag:e,part:t})}else this.warn("level.details undefined")}},{key:"resetTransmuxer",value:function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}},{key:"recoverWorkerError",value:function(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}},{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log("".concat(t,"->").concat(e)))}}])}(Kf),Pm=function(){function e(){S(this,e),this.chunks=[],this.dataLength=0}return T(e,[{key:"push",value:function(e){this.chunks.push(e),this.dataLength+=e.length}},{key:"flush",value:function(){var e,t=this.chunks,i=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var i=new Uint8Array(t),r=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}var Mm=function(){function e(){S(this,e),this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}return T(e,[{key:"resetInitSegment",value:function(e,t,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}},{key:"resetTimeStamp",value:function(e){this.initPTS=e,this.resetContiguity()}},{key:"resetContiguity",value:function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}},{key:"canParse",value:function(e,t){return!1}},{key:"appendFrame",value:function(e,t,i){}},{key:"demux",value:function(e,t){this.cachedData&&(e=Kh(this.cachedData,e),this.cachedData=null);var i,r=mh(e,0),a=r?r.length:0,n=this._audioTrack,o=this._id3Track,s=r?vh(r):void 0,l=e.length;for((null===this.basePTS||0===this.frameIndex&&Ed(s))&&(this.basePTS=Um(s,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:qp,duration:Number.POSITIVE_INFINITY});a>>5}function jm(e,t){return t+1=e.length)return!1;var r=Nm(e,t);if(r<=i)return!1;var a=t+r;return a===e.length||jm(e,a)}return!1}function zm(e,t,i,r,a){if(!e.samplerate){var n=function(e,t,i,r){var a,n,o,s,l=navigator.userAgent.toLowerCase(),c=r,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];a=1+((192&t[i+2])>>>6);var d=(60&t[i+2])>>>2;if(!(d>u.length-1))return o=(1&t[i+2])<<2,o|=(192&t[i+3])>>>6,Ud.log("manifest codec:".concat(r,", ADTS type:").concat(a,", samplingIndex:").concat(d)),/firefox/i.test(l)?d>=6?(a=5,s=new Array(4),n=d-3):(a=2,s=new Array(2),n=d):-1!==l.indexOf("android")?(a=2,s=new Array(2),n=d):(a=5,s=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&d>=6?n=d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(d>=6&&1===o||/vivaldi/i.test(l))||!r&&1===o)&&(a=2,s=new Array(2)),n=d)),s[0]=a<<3,s[0]|=(14&d)>>1,s[1]|=(1&d)<<7,s[1]|=o<<3,5===a&&(s[1]|=(14&n)>>1,s[2]=(1&n)<<7,s[2]|=8,s[3]=0),{config:s,samplerate:u[d],channelCount:o,codec:"mp4a.40."+a,manifestCodec:c};var h=new Error("invalid ADTS sampling index:".concat(d));e.emit(Rd.ERROR,Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!0,error:h,reason:h.message})}(t,i,r,a);if(!n)return;e.config=n.config,e.samplerate=n.samplerate,e.channelCount=n.channelCount,e.codec=n.codec,e.manifestCodec=n.manifestCodec,Ud.log("parsed codec:".concat(e.codec,", rate:").concat(n.samplerate,", channels:").concat(n.channelCount))}}function Hm(e){return 9216e4/e}function Wm(e,t,i,r,a){var n,o=r+a*Hm(e.samplerate),s=function(e,t){var i=Om(e,t);if(t+i<=e.length){var r=Nm(e,t)-i;if(r>0)return{headerLength:i,frameLength:r}}}(t,i);if(s){var l=s.frameLength,c=s.headerLength,u=c+l,d=Math.max(0,i+u-t.length);d?(n=new Uint8Array(u-c),n.set(t.subarray(i+c,t.length),0)):n=t.subarray(i+c,i+u);var h={unit:n,pts:o};return d||e.samples.push(h),{sample:h,length:u,missing:d}}var p=t.length-i;return n=new Uint8Array(p),n.set(t.subarray(i,t.length),0),{sample:{unit:n,pts:o},length:p,missing:-1}}var Vm=null,Jm=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],qm=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Km=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ym=[0,1,1,4];function Qm(e,t,i,r,a){if(!(i+24>t.length)){var n=Xm(t,i);if(n&&i+n.frameLength<=t.length){var o=r+a*(9e4*n.samplesPerFrame/n.sampleRate),s={unit:t.subarray(i,i+n.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=n.channelCount,e.samplerate=n.sampleRate,e.samples.push(s),{sample:s,length:n.frameLength,missing:0}}}}function Xm(e,t){var i=e[t+1]>>3&3,r=e[t+1]>>1&3,a=e[t+2]>>4&15,n=e[t+2]>>2&3;if(1!==i&&0!==a&&15!==a&&3!==n){var o=e[t+2]>>1&1,s=e[t+3]>>6,l=1e3*Jm[14*(3===i?3-r:3===r?3:4)+a-1],c=qm[3*(3===i?0:2===i?1:2)+n],u=3===s?1:2,d=Km[i][r],h=Ym[r],p=8*d*h,f=Math.floor(d*l/c+o)*h;if(null===Vm){var m=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Vm=m?parseInt(m[1]):0}return!!Vm&&Vm<=87&&2===r&&l>=224e3&&0===s&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:f,samplesPerFrame:p}}}function Zm(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function $m(e,t){return t+10;){o[0]=e[t];var s=Math.min(r,8),l=8-s;n[0]=4278190080>>>24+l<>l,i=i?i<t.length)return-1;if(11!==t[i]||119!==t[i+1])return-1;var n=t[i+4]>>6;if(n>=3)return-1;var o=[48e3,44100,32e3][n],s=63&t[i+4],l=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*s+n];if(i+l>t.length)return-1;var c=t[i+6]>>5,u=0;2===c?u+=2:(1&c&&1!==c&&(u+=2),4&c&&(u+=2));var d=(t[i+6]<<8|t[i+7])>>12-u&1,h=[2,1,2,3,3,4,4,5][c]+d,p=t[i+5]>>3,f=7&t[i+5],m=new Uint8Array([n<<6|p<<1|f>>2,(3&f)<<6|c<<3|d<<2|s>>4,s<<4&224]),g=r+a*(1536/o*9e4),y=t.subarray(i,i+l);return e.config=m,e.channelCount=h,e.samplerate=o,e.samples.push({unit:y,pts:g}),l}var ng=function(){function e(){S(this,e),this.VideoSample=null}return T(e,[{key:"createVideoSample",value:function(e,t,i,r){return{key:e,frame:!1,pts:t,dts:i,units:[],debug:r,length:0}}},{key:"getLastNalUnit",value:function(e){var t,i,r=this.VideoSample;if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){var a=r.units;i=a[a.length-1]}return i}},{key:"pushAccessUnit",value:function(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var i=t.samples,r=i.length;if(!r)return void t.dropped++;var a=i[r-1];e.pts=a.pts,e.dts=a.dts}t.samples.push(e)}e.debug.length&&Ud.log(e.pts+"/"+e.dts+":"+e.debug)}}])}(),og=function(){function e(t){S(this,e),this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return T(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");r.set(e.subarray(i,i+a)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a}},{key:"skipBits",value:function(e){var t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),i=this.word>>>32-t;if(e>32&&Ud.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?i<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){for(var t,i=8,r=8,a=0;a4){var p=new og(h).readSliceType();2!==p&&4!==p&&7!==p&&9!==p||(u=!0)}u&&null!=(d=l)&&d.frame&&!l.key&&(o.pushAccessUnit(l,e),l=o.VideoSample=null),l||(l=o.VideoSample=o.createVideoSample(!0,i.pts,i.dts,"")),l.frame=!0,l.key=u;break;case 5:n=!0,null!=(s=l)&&s.frame&&!l.key&&(o.pushAccessUnit(l,e),l=o.VideoSample=null),l||(l=o.VideoSample=o.createVideoSample(!0,i.pts,i.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0,Xh(r.data,1,i.pts,t.samples);break;case 7:var f,m;n=!0,c=!0;var g=r.data,y=new og(g).readSPS();if(!e.sps||e.width!==y.width||e.height!==y.height||(null==(f=e.pixelRatio)?void 0:f[0])!==y.pixelRatio[0]||(null==(m=e.pixelRatio)?void 0:m[1])!==y.pixelRatio[1]){e.width=y.width,e.height=y.height,e.pixelRatio=y.pixelRatio,e.sps=[g],e.duration=a;for(var v=g.subarray(1,4),A="avc1.",b=0;b<3;b++){var _=v[b].toString(16);_.length<2&&(_="0"+_),A+=_}e.codec=A}break;case 8:n=!0,e.pps=[r.data];break;case 9:n=!0,e.audFound=!0,l&&o.pushAccessUnit(l,e),l=o.VideoSample=o.createVideoSample(!1,i.pts,i.dts,"");break;case 12:n=!0;break;default:n=!1,l&&(l.debug+="unknown NAL "+r.type+" ")}l&&n&&l.units.push(r)})),r&&l&&(this.pushAccessUnit(l,e),this.VideoSample=null)}},{key:"parseAVCNALu",value:function(e,t){var i,r,a,n=t.byteLength,o=e.naluState||0,s=o,l=[],c=0,u=-1,d=0;for(-1===o&&(u=0,d=31&t[0],o=0,c=1);c=0){var h={data:t.subarray(u,r),type:d};l.push(h)}else{var p=this.getLastNalUnit(e.samples);p&&(s&&c<=4-s&&p.state&&(p.data=p.data.subarray(0,p.data.byteLength-s)),r>0&&(p.data=Kh(p.data,t.subarray(0,r)),p.state=0))}c=0&&o>=0){var f={data:t.subarray(u,n),type:d,state:o};l.push(f)}if(0===l.length){var m=this.getLastNalUnit(e.samples);m&&(m.data=Kh(m.data,t))}return e.naluState=o,l}}])}(ng),lg=function(){function e(t,i,r){S(this,e),this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new vm(i,{removePKCS7Padding:!1})}return T(e,[{key:"decryptBuffer",value:function(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}},{key:"decryptAacSample",value:function(e,t,i){var r=this,a=e[t].unit;if(!(a.length<=16)){var n=a.subarray(16,a.length-a.length%16),o=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(o).then((function(n){var o=new Uint8Array(n);a.set(o,16),r.decrypter.isSync()||r.decryptAacSamples(e,t+1,i)}))}}},{key:"decryptAacSamples",value:function(e,t,i){for(;;t++){if(t>=e.length)return void i();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,i=new Int8Array(t),r=0,a=32;a=e.length)return void r();for(var a=e[t].units;!(i>=a.length);i++){var n=a[i];if(!(n.data.length<=48||1!==n.type&&5!==n.type||(this.decryptAvcSample(e,t,i,r,n),this.decrypter.isSync())))return}}}}])}(),cg=188,ug=function(){function e(t,i,r){S(this,e),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=t,this.config=i,this.typeSupported=r,this.videoParser=new sg}return T(e,[{key:"resetInitSegment",value:function(t,i,r,a){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=e.createTrack("video"),this._audioTrack=e.createTrack("audio",a),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=r,this._duration=a}},{key:"resetTimeStamp",value:function(){}},{key:"resetContiguity",value:function(){var e=this._audioTrack,t=this._videoTrack,i=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}},{key:"demux",value:function(t,i){var r,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a||(this.sampleAes=null);var o=this._videoTrack,s=this._audioTrack,l=this._id3Track,c=this._txtTrack,u=o.pid,d=o.pesData,h=s.pid,p=l.pid,f=s.pesData,m=l.pesData,g=null,y=this.pmtParsed,v=this._pmtId,A=t.length;if(this.remainderData&&(A=(t=Kh(this.remainderData,t)).length,this.remainderData=null),A>4>1){if(T=k+5+t[k+4],T===k+cg)continue}else T=k+4;switch(S){case u:w&&(d&&(r=mg(d))&&this.videoParser.parseAVCPES(o,c,r,!1,this._duration),d={data:[],size:0}),d&&(d.data.push(t.subarray(T,k+cg)),d.size+=k+cg-T);break;case h:if(w){if(f&&(r=mg(f)))switch(s.segmentCodec){case"aac":this.parseAACPES(s,r);break;case"mp3":this.parseMPEGPES(s,r);break;case"ac3":this.parseAC3PES(s,r)}f={data:[],size:0}}f&&(f.data.push(t.subarray(T,k+cg)),f.size+=k+cg-T);break;case p:w&&(m&&(r=mg(m))&&this.parseID3PES(l,r),m={data:[],size:0}),m&&(m.data.push(t.subarray(T,k+cg)),m.size+=k+cg-T);break;case 0:w&&(T+=t[T]+1),v=this._pmtId=hg(t,T);break;case v:w&&(T+=t[T]+1);var E=pg(t,T,this.typeSupported,a);u=E.videoPid,u>0&&(o.pid=u,o.segmentCodec=E.segmentVideoCodec),h=E.audioPid,h>0&&(s.pid=h,s.segmentCodec=E.segmentAudioCodec),p=E.id3Pid,p>0&&(l.pid=p),null===g||y||(Ud.warn("MPEG-TS PMT found at ".concat(k," after unknown PID '").concat(g,"'. Backtracking to sync byte @").concat(b," to parse all TS packets.")),g=null,k=b-188),y=this.pmtParsed=!0;break;case 17:case 8191:break;default:g=S}}else _++;if(_>0){var C=new Error("Found ".concat(_," TS packet/s that do not start with 0x47"));this.observer.emit(Rd.ERROR,Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!1,error:C,reason:C.message})}o.pesData=d,s.pesData=f,l.pesData=m;var x={audioTrack:s,videoTrack:o,id3Track:l,textTrack:c};return n&&this.extractRemainingSamples(x),x}},{key:"flush",value:function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}},{key:"extractRemainingSamples",value:function(e){var t,i=e.audioTrack,r=e.videoTrack,a=e.id3Track,n=e.textTrack,o=r.pesData,s=i.pesData,l=a.pesData;if(o&&(t=mg(o))?(this.videoParser.parseAVCPES(r,n,t,!0,this._duration),r.pesData=null):r.pesData=o,s&&(t=mg(s))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,t);break;case"mp3":this.parseMPEGPES(i,t);break;case"ac3":this.parseAC3PES(i,t)}i.pesData=null}else null!=s&&s.size&&Ud.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=s;l&&(t=mg(l))?(this.parseID3PES(a,t),a.pesData=null):a.pesData=l}},{key:"demuxSampleAes",value:function(e,t,i){var r=this.demux(e,i,!0,!this.config.progressive),a=this.sampleAes=new lg(this.observer,this.config,t);return this.decrypt(r,a)}},{key:"decrypt",value:function(e,t){return new Promise((function(i){var r=e.audioTrack,a=e.videoTrack;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(function(){a.samples?t.decryptAvcSamples(a.samples,0,0,(function(){i(e)})):i(e)})):a.samples&&t.decryptAvcSamples(a.samples,0,0,(function(){i(e)}))}))}},{key:"destroy",value:function(){this._duration=0}},{key:"parseAACPES",value:function(e,t){var i,r,a,n=0,o=this.aacOverFlow,s=t.data;if(o){this.aacOverFlow=null;var l=o.missing,c=o.sample.unit.byteLength;if(-1===l)s=Kh(o.sample.unit,s);else{var u=c-l;o.sample.unit.set(s.subarray(0,l),u),e.samples.push(o.sample),n=o.missing}}for(i=n,r=s.length;i0;)s+=a;else Ud.warn("[tsdemuxer]: AC3 PES unknown PTS")}},{key:"parseID3PES",value:function(e,t){if(void 0!==t.pts){var i=Td({},t,{type:this._videoTrack?Yp:qp,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}else Ud.warn("[tsdemuxer]: ID3 PES unknown PTS")}}],[{key:"probe",value:function(t){var i=e.syncOffset(t);return i>0&&Ud.warn("MPEG2-TS detected but first sync word found @ offset ".concat(i)),-1!==i}},{key:"syncOffset",value:function(e){for(var t=e.length,i=Math.min(940,t-cg)+1,r=0;r1&&(0===n&&o>2||s+cg>i))return n}r++}return-1}},{key:"createTrack",value:function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Ih[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}}])}();function dg(e,t){return((31&e[t+1])<<8)+e[t+2]}function hg(e,t){return(31&e[t+10])<<8|e[t+11]}function pg(e,t,i,r){var a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t0)for(var l=t+5,c=s;c>2;){106===e[l]&&(!0!==i.ac3?Ud.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=o,a.segmentAudioCodec="ac3"));var u=e[l+1]+2;l+=u,c-=u}break;case 194:case 135:Ud.warn("Unsupported EC-3 in M2TS found");break;case 36:Ud.warn("Unsupported HEVC in M2TS found")}t+=s+5}return a}function fg(e){Ud.log("".concat(e," with AES-128-CBC encryption found in unencrypted stream"))}function mg(e){var t,i,r,a,n,o=0,s=e.data;if(!e||0===e.size)return null;for(;s[0].length<19&&s.length>1;)s[0]=Kh(s[0],s[1]),s.splice(1,1);if(t=s[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if(i=(t[4]<<8)+t[5],i&&i>e.size-6)return null;var l=t[7];192&l&&(a=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(n=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,a-n>54e5&&(Ud.warn("".concat(Math.round((a-n)/9e4),"s delta between PTS and DTS, align them")),a=n)):n=a),r=t[8];var c=r+9;if(e.size<=c)return null;e.size-=c;for(var u=new Uint8Array(e.size),d=0,h=s.length;dp){c-=p;continue}t=t.subarray(c),p-=c,c=0}u.set(t,o),o+=p}return i&&(i-=r+3),{data:u,pts:a,dts:n,len:i}}return null}var gg=function(){function e(){S(this,e)}return T(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}])}(),yg=Math.pow(2,32)-1,vg=function(){function e(){S(this,e)}return T(e,null,[{key:"init",value:function(){var t;for(t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:i,audio:r};var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=n,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,l,o,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,a))}},{key:"box",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r>24&255,s[1]=a>>16&255,s[2]=a>>8&255,s[3]=255&a,s.set(e,4),n=0,a=8;n>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,i,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,i))}},{key:"moov",value:function(t){for(var i=t.length,r=[];i--;)r[i]=e.trak(t[i]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var i=t.length,r=[];i--;)r[i]=e.trex(t[i]);return e.box.apply(null,[e.types.mvex].concat(r))}},{key:"mvhd",value:function(t,i){i*=t;var r=Math.floor(i/(yg+1)),a=Math.floor(i%(yg+1)),n=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,a>>24,a>>16&255,a>>8&255,255&a,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 e.box(e.types.mvhd,n)}},{key:"sdtp",value:function(t){var i,r,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),o.push(255&a),o=o.concat(Array.prototype.slice.call(r));var s=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(o))),l=t.width,c=t.height,u=t.pixelRatio[0],d=t.pixelRatio[1];return e.box(e.types.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,l>>8&255,255&l,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))}},{key:"esds",value:function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}},{key:"audioStsd",value:function(e){var t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0])}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,e.audioStsd(t),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){return e.box(e.types[".mp3"],e.audioStsd(t))}},{key:"ac3",value:function(t){return e.box(e.types["ac-3"],e.audioStsd(t),e.box(e.types.dac3,t.config))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):"ac3"===t.segmentCodec?e.box(e.types.stsd,e.STSD,e.ac3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var i=t.id,r=t.duration*t.timescale,a=t.width,n=t.height,o=Math.floor(r/(yg+1)),s=Math.floor(r%(yg+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))}},{key:"traf",value:function(t,i){var r=e.sdtp(t),a=t.id,n=Math.floor(i/(yg+1)),o=Math.floor(i%(yg+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o])),e.trun(t,r.length+16+20+8+16+8+8),r)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var i=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,i){var r,a,n,o,s,l,c=t.samples||[],u=c.length,d=12+16*u,h=new Uint8Array(d);for(i+=8+d,h.set(["video"===t.type?1:0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r);return e.box(e.types.trun,h)}},{key:"initSegment",value:function(t){e.types||e.init();var i=e.moov(t);return Kh(e.FTYP,i)}}])}();function Ag(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e*t*i;return r?Math.round(a):a}function bg(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ag(e,1e3,1/9e4,t)}vg.types=void 0,vg.HDLR_TYPES=void 0,vg.STTS=void 0,vg.STSC=void 0,vg.STCO=void 0,vg.STSZ=void 0,vg.VMHD=void 0,vg.SMHD=void 0,vg.STSD=void 0,vg.FTYP=void 0,vg.DINF=void 0;var _g,kg=null,wg=null,Sg=function(){function e(t,i,r){if(S(this,e),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=i,this.typeSupported=r,this.ISGenerated=!1,null===kg){var a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);kg=a?parseInt(a[1]):0}if(null===wg){var n=navigator.userAgent.match(/Safari\/(\d+)/i);wg=n?parseInt(n[1]):0}}return T(e,[{key:"destroy",value:function(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}},{key:"resetTimeStamp",value:function(e){Ud.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}},{key:"resetNextTimestamp",value:function(){Ud.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}},{key:"resetInitSegment",value:function(){Ud.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}},{key:"getVideoStartPts",value:function(e){var t=!1,i=e.reduce((function(e,i){var r=i.pts-e;return r<-4294967296?(t=!0,Tg(e,i.pts)):r>0?e:i.pts}),e[0].pts);return t&&Ud.debug("PTS rollover detected"),i}},{key:"remux",value:function(e,t,i,r,a,n,o,s){var l,c,u,d,h,p,f=a,m=a,g=e.pid>-1,y=t.pid>-1,v=t.samples.length,A=e.samples.length>0,b=o&&v>0||v>1;if((!g||A)&&(!y||b)||this.ISGenerated||o){if(this.ISGenerated){var _,k,w,S,T=this.videoTrackConfig;!T||t.width===T.width&&t.height===T.height&&(null==(_=t.pixelRatio)?void 0:_[0])===(null==(k=T.pixelRatio)?void 0:k[0])&&(null==(w=t.pixelRatio)?void 0:w[1])===(null==(S=T.pixelRatio)?void 0:S[1])||this.resetInitSegment()}else u=this.generateIS(e,t,a,n);var E,C=this.isVideoContiguous,x=-1;if(b&&(x=function(e){for(var t=0;t0){Ud.warn("[mp4-remuxer]: Dropped ".concat(x," out of ").concat(v," video samples due to a missing keyframe"));var R=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(x),t.dropped+=x,m+=(t.samples[0].pts-R)/t.inputTimeScale,E=m}else-1===x&&(Ud.warn("[mp4-remuxer]: No keyframe found out of ".concat(v," video samples")),p=!1);if(this.ISGenerated){if(A&&b){var D=this.getVideoStartPts(t.samples),L=(Tg(e.samples[0].pts,D)-D)/t.inputTimeScale;f+=Math.max(0,L),m+=Math.max(0,-L)}if(A){if(e.samplerate||(Ud.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,a,n)),c=this.remuxAudio(e,f,this.isAudioContiguous,n,y||b||s===Fp?m:void 0),b){var I=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(Ud.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,a,n)),l=this.remuxVideo(t,m,C,I)}}else b&&(l=this.remuxVideo(t,m,C,0));l&&(l.firstKeyFrame=x,l.independent=-1!==x,l.firstKeyFramePTS=E)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(h=Eg(i,a,this._initPTS,this._initDTS)),r.samples.length&&(d=Cg(r,a,this._initPTS))),{audio:c,video:l,initSegment:u,independent:p,text:d,id3:h}}},{key:"generateIS",value:function(e,t,i,r){var a,n,o,s=e.samples,l=t.samples,c=this.typeSupported,u={},d=this._initPTS,h=!d||r,p="audio/mp4";if(h&&(a=n=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":c.mpeg?(p="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}u.audio={id:"audio",container:p,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&c.mpeg?new Uint8Array(0):vg.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(o=e.inputTimeScale,d&&o===d.timescale?h=!1:a=n=s[0].pts-Math.round(o*i))}if(t.sps&&t.pps&&l.length){if(t.timescale=t.inputTimeScale,u.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:vg.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(o=t.inputTimeScale,d&&o===d.timescale)h=!1;else{var f=this.getVideoStartPts(l),m=Math.round(o*i);n=Math.min(n,Tg(l[0].dts,f)-m),a=Math.min(a,f-m)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(u).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:a,timescale:o},this._initDTS={baseTime:n,timescale:o}):a=o=void 0,{tracks:u,initPTS:a,timescale:o}}},{key:"remuxVideo",value:function(e,t,i,r){var a,n,o=e.inputTimeScale,s=e.samples,l=[],c=s.length,u=this._initPTS,d=this.nextAvcDts,h=8,p=this.videoSampleDuration,f=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=!1;if(!i||null===d){var y=t*o,v=s[0].pts-Tg(s[0].dts,s[0].pts);kg&&null!==d&&Math.abs(y-v-d)<15e3?i=!0:d=y-v}for(var A=u.baseTime*o/u.timescale,b=0;b0?b-1:b].dts&&(g=!0)}g&&s.sort((function(e,t){var i=e.dts-t.dts,r=e.pts-t.pts;return i||r})),a=s[0].dts,n=s[s.length-1].dts;var k=n-a,w=k?Math.round(k/(c-1)):p||e.inputTimeScale/30;if(i){var S=a-d,T=S>w,E=S<-1;if((T||E)&&(T?Ud.warn("AVC: ".concat(bg(S,!0)," ms (").concat(S,"dts) hole between fragments detected at ").concat(t.toFixed(3))):Ud.warn("AVC: ".concat(bg(-S,!0)," ms (").concat(S,"dts) overlapping between fragments detected at ").concat(t.toFixed(3))),!E||d>=s[0].pts||kg)){a=d;var C=s[0].pts-S;if(T)s[0].dts=a,s[0].pts=C;else for(var x=0;xC);x++)s[x].dts-=S,s[x].pts-=S;Ud.log("Video: Initial PTS/DTS adjusted: ".concat(bg(C,!0),"/").concat(bg(a,!0),", delta: ").concat(bg(S,!0)," ms"))}}a=Math.max(0,a);for(var R=0,D=0,L=a,I=0;I0?q.dts-s[J-1].dts:w;if(Y=J>0?q.pts-s[J-1].pts:w,ie.stretchShortVideoTrack&&null!==this.nextAudioPts){var ae=Math.floor(ie.maxBufferHole*o),ne=(r?f+r*o:this.nextAudioPts)-q.pts;ne>ae?(p=ne-re,p<0?p=re:G=!0,Ud.log("[mp4-remuxer]: It is approximately ".concat(ne/90," ms to the next segment; using duration ").concat(p/90," ms for the last video frame."))):p=re}else p=re}var oe=Math.round(q.pts-q.dts);z=Math.min(z,p),W=Math.max(W,p),H=Math.min(H,Y),V=Math.max(V,Y),l.push(new xg(q.key,p,Q,oe))}if(l.length)if(kg){if(kg<70){var se=l[0].flags;se.dependsOn=2,se.isNonSync=0}}else if(wg&&V-H0&&(r&&Math.abs(g-m)<9e3||Math.abs(Tg(p[0].pts-y,g)-m)<20*l),p.forEach((function(e){e.pts=Tg(e.pts-y,g)})),!i||m<0){if(p=p.filter((function(e){return e.pts>=0})),!p.length)return;m=0===a?0:r&&!h?Math.max(0,g):p[0].pts}if("aac"===e.segmentCodec)for(var v=this.config.maxAudioFramesDrift,A=0,b=m;A=v*l&&S<1e4&&h){var T=Math.round(w/l);b=k-T*l,b<0&&(T--,b+=l),0===A&&(this.nextAudioPts=m=b),Ud.warn("[mp4-remuxer]: Injecting ".concat(T," audio frame @ ").concat((b/n).toFixed(3),"s due to ").concat(Math.round(1e3*w/n)," ms gap."));for(var E=0;E0))return;I+=f;try{R=new Uint8Array(I)}catch(e){return void this.observer.emit(Rd.ERROR,Rd.ERROR,{type:Dd.MUX_ERROR,details:Ld.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:I,reason:"fail allocating audio mdat ".concat(I)})}u||(new DataView(R.buffer).setUint32(0,I),R.set(vg.types.mdat,4))}R.set(F,f);var N=F.byteLength;f+=N,d.push(new xg(!0,s,N,0)),L=O}var j=d.length;if(j){var G=d[d.length-1];this.nextAudioPts=m=L+o*G.duration;var z=u?new Uint8Array(0):vg.moof(e.sequenceNumber++,D/o,Td({},e,{samples:d}));e.samples=[];var H=D/n,W=m/n,V={data1:z,data2:R,startPTS:H,endPTS:W,startDTS:H,endDTS:W,type:"audio",hasAudio:!0,hasVideo:!1,nb:j};return this.isAudioContiguous=!0,V}}},{key:"remuxEmptyAudio",value:function(e,t,i,r){var a=e.inputTimeScale,n=a/(e.samplerate?e.samplerate:a),o=this.nextAudioPts,s=this._initDTS,l=9e4*s.baseTime/s.timescale,c=(null!==o?o:r.startDTS*a)+l,u=r.endDTS*a+l,d=1024*n,h=Math.ceil((u-c)/d),p=gg.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(Ud.warn("[mp4-remuxer]: remux empty Audio"),p){for(var f=[],m=0;m4294967296;)e+=i;return e}function Eg(e,t,i,r){var a=e.samples.length;if(a){for(var n=e.inputTimeScale,o=0;o4)return i;if(t===Hd){if("ec-3"===i||"ac-3"===i||"alac"===i)return i;if("fLaC"===i||"Opus"===i)return yp(i,!1);var r="mp4a.40.5";return Ud.info('Parsed audio codec "'.concat(i,'" or audio object type not handled. Using "').concat(r,'"')),r}return Ud.warn('Unhandled video codec "'.concat(i,'"')),"hvc1"===i||"hev1"===i?"hvc1.1.6.L120.90":"av01"===i?"av01.0.04M.08":"avc1.42e01e"}try{_g=self.performance.now.bind(self.performance)}catch(e){Ud.debug("Unable to use Performance API on this environment"),_g=null==$d?void 0:$d.Date.now}var Dg=[{demux:function(){function e(t,i){S(this,e),this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=i}return T(e,[{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(e,t,i,r){var a=this.videoTrack=Bm("video",1),n=this.audioTrack=Bm("audio",1),o=this.txtTrack=Bm("text",1);if(this.id3Track=Bm("id3",1),this.timeOffset=0,null!=e&&e.byteLength){var s=Gh(e);if(s.video){var l=s.video,c=l.id,u=l.timescale,d=l.codec;a.id=c,a.timescale=o.timescale=u,a.codec=d}if(s.audio){var h=s.audio,p=h.id,f=h.timescale,m=h.codec;n.id=p,n.timescale=f,n.codec=m}o.id=Ih.text,a.sampleDuration=0,a.duration=n.duration=r}}},{key:"resetContiguity",value:function(){this.remainderData=null}},{key:"demux",value:function(e,t){this.timeOffset=t;var i=e,r=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Kh(this.remainderData,e));var n=function(e){var t={valid:null,remainder:null},i=Nh(e,["moof"]);if(i.length<2)return t.remainder=e,t;var r=i[i.length-1];return t.valid=dh(e,0,r.byteOffset-8),t.remainder=dh(e,r.byteOffset-8),t}(i);this.remainderData=n.remainder,r.samples=n.valid||new Uint8Array}else r.samples=i;var o=this.extractID3Track(r,t);return a.samples=Yh(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}},{key:"flush",value:function(){var e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var r=this.extractID3Track(t,this.timeOffset);return i.samples=Yh(e,t),{videoTrack:t,audioTrack:Bm(),id3Track:r,textTrack:Bm()}}},{key:"extractID3Track",value:function(e,t){var i=this.id3Track;if(e.samples.length){var r=Nh(e.samples,["emsg"]);r&&r.forEach((function(e){var r=function(e){var t=e[0],i="",r="",a=0,n=0,o=0,s=0,l=0,c=0;if(0===t){for(;"\0"!==Ph(e.subarray(c,c+1));)i+=Ph(e.subarray(c,c+1)),c+=1;for(i+=Ph(e.subarray(c,c+1)),c+=1;"\0"!==Ph(e.subarray(c,c+1));)r+=Ph(e.subarray(c,c+1)),c+=1;r+=Ph(e.subarray(c,c+1)),c+=1,a=Mh(e,12),n=Mh(e,16),s=Mh(e,20),l=Mh(e,24),c=28}else if(1===t){c+=4,a=Mh(e,c),c+=4;var u=Mh(e,c);c+=4;var d=Mh(e,c);for(c+=4,o=Math.pow(2,32)*u+d,Cd(o)||(o=Number.MAX_SAFE_INTEGER,Ud.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),s=Mh(e,c),c+=4,l=Mh(e,c),c+=4;"\0"!==Ph(e.subarray(c,c+1));)i+=Ph(e.subarray(c,c+1)),c+=1;for(i+=Ph(e.subarray(c,c+1)),c+=1;"\0"!==Ph(e.subarray(c,c+1));)r+=Ph(e.subarray(c,c+1)),c+=1;r+=Ph(e.subarray(c,c+1)),c+=1}return{schemeIdUri:i,value:r,timeScale:a,presentationTime:o,presentationTimeDelta:n,eventDuration:s,id:l,payload:e.subarray(c,e.byteLength)}}(e);if(tg.test(r.schemeIdUri)){var a=Ed(r.presentationTime)?r.presentationTime/r.timeScale:t+r.presentationTimeDelta/r.timeScale,n=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;n<=.001&&(n=Number.POSITIVE_INFINITY);var o=r.payload;i.samples.push({data:o,len:o.byteLength,dts:a,pts:a,type:Yp,duration:n})}}))}return i}},{key:"demuxSampleAes",value:function(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){return function(e){for(var t=e.byteLength,i=0;i8&&109===e[i+4]&&111===e[i+5]&&111===e[i+6]&&102===e[i+7])return!0;i=r>1?i+r:t}return!1}(e)}}])}(),remux:function(){function e(){S(this,e),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}return T(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this.initPTS=e,this.lastEndTime=null}},{key:"resetNextTimestamp",value:function(){this.lastEndTime=null}},{key:"resetInitSegment",value:function(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(function(e,t){if(!e||!t)return e;var i=t.keyId;return i&&t.isCommonEncryption&&Nh(e,["moov","trak"]).forEach((function(e){var t=Nh(e,["mdia","minf","stbl","stsd"])[0].subarray(8),r=Nh(t,["enca"]),a=r.length>0;a||(r=Nh(t,["encv"])),r.forEach((function(e){Nh(a?e.subarray(28):e.subarray(78),["sinf"]).forEach((function(e){var t=Jh(e);if(t){var r=t.subarray(8,24);r.some((function(e){return 0!==e}))||(Ud.log("[eme] Patching keyId in 'enc".concat(a?"a":"v",">sinf>>tenc' box: ").concat(Rh(r)," -> ").concat(Rh(i))),t.set(i,8))}}))}))})),e}(e,r)),this.emitInitSegment=!0}},{key:"generateInitSegment",value:function(e){var t=this.audioCodec,i=this.videoCodec;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Gh(e);r.audio&&(t=Rg(r.audio,Hd)),r.video&&(i=Rg(r.video,Wd));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?a.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:Ud.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a}},{key:"remux",value:function(e,t,i,r,a,n){var o,s,l=this.initPTS,c=this.lastEndTime,u={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};Ed(c)||(c=this.lastEndTime=a||0);var d=t.samples;if(null==d||!d.length)return u;var h={initPTS:void 0,timescale:1},p=this.initData;if(null!=(o=p)&&o.length||(this.generateInitSegment(d),p=this.initData),null==(s=p)||!s.length)return Ud.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);var f=function(e,t){for(var i=0,r=0,a=0,n=Nh(e,["moof","traf"]),o=0;oa}(l,g,a,f)||h.timescale!==l.timescale&&n)&&(h.initPTS=g-a,l&&1===l.timescale&&Ud.warn("Adjusting initPTS by "+(h.initPTS-l.baseTime)),this.initPTS=l={baseTime:h.initPTS,timescale:1});var y=e?g-l.baseTime/l.timescale:c,v=y+f;!function(e,t,i){Nh(t,["moof","traf"]).forEach((function(t){Nh(t,["tfhd"]).forEach((function(r){var a=Mh(r,4),n=e[a];if(n){var o=n.timescale||9e4;Nh(t,["tfdt"]).forEach((function(e){var t=e[0],r=i*o;if(r){var a=Mh(e,4);if(0===t)a-=r,a=Math.max(a,0),Oh(e,4,a);else{a*=Math.pow(2,32),a+=Mh(e,8),a-=r,a=Math.max(a,0);var n=Math.floor(a/(Dh+1)),s=Math.floor(a%(Dh+1));Oh(e,4,n),Oh(e,8,s)}}}))}}))}))}(p,d,l.baseTime/l.timescale),f>0?this.lastEndTime=v:(Ud.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var A=!!p.audio,b=!!p.video,_="";A&&(_+="audio"),b&&(_+="video");var k={data1:d,startPTS:y,startDTS:y,endPTS:v,endDTS:v,type:_,hasAudio:A,hasVideo:b,nb:1,dropped:0};return u.audio="audio"===k.type?k:void 0,u.video="audio"!==k.type?k:void 0,u.initSegment=h,u.id3=Eg(i,a,l,l),r.samples.length&&(u.text=Cg(r,a,l)),u}}])}()},{demux:ug,remux:Sg},{demux:function(e){function t(e,i){var r;return S(this,t),r=_(this,t),r.observer=void 0,r.config=void 0,r.observer=e,r.config=i,r}return k(t,e),T(t,[{key:"resetInitSegment",value:function(e,i,r,a){b(t,"resetInitSegment",this,3)([e,i,r,a]),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:i,duration:a,inputTimeScale:9e4,dropped:0}}},{key:"canParse",value:function(e,t){return function(e,t){return function(e,t){return t+50&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(i=t),i}(o,t);if(_&&"AES-128"===_.method){var k=this.getDecrypter();if(!k.isSync())return this.decryptionPromise=k.webCryptoDecrypt(o,_.key.buffer,_.iv.buffer).then((function(e){var t=a.push(e,null,i);return a.decryptionPromise=null,t})),this.decryptionPromise;var w=k.softwareDecrypt(o,_.key.buffer,_.iv.buffer);if(i.part>-1&&(w=k.flush()),!w)return n.executeEnd=_g(),Ig(i);o=new Uint8Array(w)}var S=this.needsProbing(d,h);if(S){var T=this.configureTransmuxer(o);if(T)return Ud.warn("[transmuxer] ".concat(T.message)),this.observer.emit(Rd.ERROR,Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!1,error:T,reason:T.message}),n.executeEnd=_g(),Ig(i)}(d||h||m||S)&&this.resetInitSegment(b,g,y,A,t),(d||m||S)&&this.resetInitialTimestamp(v),u||this.resetContiguity();var E=this.transmux(o,_,f,p,i),C=this.currentTransmuxState;return C.contiguous=!0,C.discontinuity=!1,C.trackSwitch=!1,n.executeEnd=_g(),E}},{key:"flush",value:function(e){var t=this,i=e.transmuxing;i.executeStart=_g();var r=this.decrypter,a=this.currentTransmuxState,n=this.decryptionPromise;if(n)return n.then((function(){return t.flush(e)}));var o=[],s=a.timeOffset;if(r){var l=r.flush();l&&o.push(this.push(l,null,e))}var c=this.demuxer,u=this.remuxer;if(!c||!u)return i.executeEnd=_g(),[Ig(e)];var d=c.flush(s);return Pg(d)?d.then((function(i){return t.flushRemux(o,i,e),o})):(this.flushRemux(o,d,e),o)}},{key:"flushRemux",value:function(e,t,i){var r=t.audioTrack,a=t.videoTrack,n=t.id3Track,o=t.textTrack,s=this.currentTransmuxState,l=s.accurateTimeOffset,c=s.timeOffset;Ud.log("[transmuxer.ts]: Flushed fragment ".concat(i.sn).concat(i.part>-1?" p: "+i.part:""," of level ").concat(i.level));var u=this.remuxer.remux(r,a,n,o,c,l,!0,this.id);e.push({remuxResult:u,chunkMeta:i}),i.transmuxing.executeEnd=_g()}},{key:"resetInitialTimestamp",value:function(e){var t=this.demuxer,i=this.remuxer;t&&i&&(t.resetTimeStamp(e),i.resetTimeStamp(e))}},{key:"resetContiguity",value:function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}},{key:"resetInitSegment",value:function(e,t,i,r,a){var n=this.demuxer,o=this.remuxer;n&&o&&(n.resetInitSegment(e,t,i,r),o.resetInitSegment(e,t,i,a))}},{key:"destroy",value:function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}},{key:"transmux",value:function(e,t,i,r,a){var n;return n=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,i,r,a):this.transmuxUnencrypted(e,i,r,a),n}},{key:"transmuxUnencrypted",value:function(e,t,i,r){var a=this.demuxer.demux(e,t,!1,!this.config.progressive),n=a.audioTrack,o=a.videoTrack,s=a.id3Track,l=a.textTrack;return{remuxResult:this.remuxer.remux(n,o,s,l,t,i,!1,this.id),chunkMeta:r}}},{key:"transmuxSampleAes",value:function(e,t,i,r,a){var n=this;return this.demuxer.demuxSampleAes(e,t,i).then((function(e){return{remuxResult:n.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,i,r,!1,n.id),chunkMeta:a}}))}},{key:"configureTransmuxer",value:function(e){for(var t,i=this.config,r=this.observer,a=this.typeSupported,n=this.vendor,o=0,s=Dg.length;o1&&l.id===(null==g?void 0:g.stats.chunkCount),k=!v&&(1===A||0===A&&(1===b||_&&b<=0)),w=self.performance.now();(v||A||0===a.stats.parsing.start)&&(a.stats.parsing.start=w),!n||!b&&k||(n.stats.parsing.start=w);var S=!(g&&(null==(u=a.initSegment)?void 0:u.url)===(null==(d=g.initSegment)?void 0:d.url)),T=new Mg(y,k,s,v,f,S);if(!k||y||S){Ud.log("[transmuxer-interface, ".concat(a.type,"]: Starting new transmux session for sn: ").concat(l.sn," p: ").concat(l.part," level: ").concat(l.level," id: ").concat(l.id,"\n discontinuity: ").concat(y,"\n trackSwitch: ").concat(v,"\n contiguous: ").concat(k,"\n accurateTimeOffset: ").concat(s,"\n timeOffset: ").concat(f,"\n initSegmentChange: ").concat(S));var E=new Bg(i,r,t,o,c);this.configureTransmuxer(E)}if(this.frag=a,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:l,state:T},e instanceof ArrayBuffer?[e]:[]);else if(p){var C=p.push(e,m,l,T);Pg(C)?(p.async=!0,C.then((function(e){h.handleTransmuxComplete(e)})).catch((function(e){h.transmuxerError(e,l,"transmuxer-interface push error")}))):(p.async=!1,this.handleTransmuxComplete(C))}}},{key:"flush",value:function(e){var t=this;e.transmuxing.start=self.performance.now();var i=this.transmuxer;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(i){var r=i.flush(e);Pg(r)||i.async?(Pg(r)||(r=Promise.resolve(r)),r.then((function(i){t.handleFlushResult(i,e)})).catch((function(i){t.transmuxerError(i,e,"transmuxer-interface flush error")}))):this.handleFlushResult(r,e)}}},{key:"transmuxerError",value:function(e,t,i){this.hls&&(this.error=e,this.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}},{key:"handleFlushResult",value:function(e,t){var i=this;e.forEach((function(e){i.handleTransmuxComplete(e)})),this.onFlush(t)}},{key:"onWorkerMessage",value:function(e){var t=e.data,i=this.hls;switch(t.event){case"init":var r,a=null==(r=this.workerContext)?void 0:r.objectURL;a&&self.URL.revokeObjectURL(a);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":Ud[t.data.logType]&&Ud[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data)}}},{key:"configureTransmuxer",value:function(e){var t=this.transmuxer;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}},{key:"handleTransmuxComplete",value:function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}])}();function Ng(e,t){if(e.length!==t.length)return!1;for(var i=0;i>>=0)>r-1)throw new DOMException("Failed to execute '".concat(e,"' on 'TimeRanges': The index provided (").concat(i,") is greater than the maximum bound (").concat(r,")"));return t[i][e]};this.buffered={get length(){return t.length},end:function(e){return i("end",e,t.length)},start:function(e){return i("start",e,t.length)}}})),Hg=function(){function e(t){S(this,e),this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}return T(e,[{key:"append",value:function(e,t,i){var r=this.queues[t];r.push(e),1!==r.length||i||this.executeNext(t)}},{key:"insertAbort",value:function(e,t){this.queues[t].unshift(e),this.executeNext(t)}},{key:"appendBlocker",value:function(e){var t,i=new Promise((function(e){t=e})),r={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,e),i}},{key:"executeNext",value:function(e){var t=this.queues[e];if(t.length){var i=t[0];try{i.execute()}catch(t){Ud.warn('[buffer-operation-queue]: Exception executing "'.concat(e,'" SourceBuffer operation: ').concat(t)),i.onError(t);var r=this.buffers[e];null!=r&&r.updating||this.shiftAndExecuteNext(e)}}}},{key:"shiftAndExecuteNext",value:function(e){this.queues[e].shift(),this.executeNext(e)}},{key:"current",value:function(e){return this.queues[e][0]}}])}(),Wg=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;function Vg(e){var t=e.querySelectorAll("source");[].slice.call(t).forEach((function(t){e.removeChild(t)}))}var Jg={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},qg=function(e){var t=e;return Jg.hasOwnProperty(e)&&(t=Jg[e]),String.fromCharCode(t)},Kg=15,Yg=100,Qg={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Xg={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Zg={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},$g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ey=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],ty=function(){function e(){S(this,e),this.time=null,this.verboseLevel=0}return T(e,[{key:"log",value:function(e,t){if(this.verboseLevel>=e){var i="function"==typeof t?t():t;Ud.log("".concat(this.time," [").concat(e,"] ").concat(i))}}}])}(),iy=function(e){for(var t=[],i=0;iYg&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Yg)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var i=this.pos+1;i=144&&this.backSpace();var i=qg(e);this.pos>=Yg?this.logger.log(0,(function(){return"Cannot insert "+e.toString(16)+" ("+i+") at position "+t.pos+". Skipping it!"})):(this.chars[this.pos].setChar(i,this.currPenState),this.moveCursor(1))}},{key:"clearFromPos",value:function(e){var t;for(t=e;t0&&(i=e?"["+t.join(" | ")+"]":t.join("\n")),i}},{key:"getTextAndFormat",value:function(){return this.rows}}])}(),sy=function(){function e(t,i,r){S(this,e),this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new oy(r),this.nonDisplayedMemory=new oy(r),this.lastOutputScreen=new oy(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}return T(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(function(){return"MODE="+e})),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=this,i=0;i=46,t.italics)t.foreground="white";else{var i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}])}(),ly=function(){function e(t,i,r){S(this,e),this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;var a=this.logger=new ty;this.channels=[null,new sy(t,i,a),new sy(t+1,r,a)]}return T(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var i,r,a,n=!1;this.logger.time=e;for(var o=0;o ("+iy([r,a])+")"),i=this.parseCmd(r,a),i||(i=this.parseMidrow(r,a)),i||(i=this.parsePAC(r,a)),i||(i=this.parseBackgroundAttributes(r,a)),!i&&(n=this.parseChars(r,a),n)){var s=this.currentChannel;s&&s>0?this.channels[s].insertChars(n):this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||n||this.logger.log(2,"Couldn't parse cleaned data "+iy([r,a])+" orig: "+iy([t[o],t[o+1]]))}}},{key:"parseCmd",value:function(e,t){var i=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;if(uy(e,t,i))return cy(null,null,i),this.logger.log(3,"Repeated command ("+iy([e,t])+") is dropped"),!0;var r=20===e||21===e||23===e?1:2,a=this.channels[r];return 20===e||21===e||28===e||29===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),cy(e,t,i),this.currentChannel=r,!0}},{key:"parseMidrow",value:function(e,t){var i=0;if((17===e||25===e)&&t>=32&&t<=47){if(i=17===e?1:2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;var r=this.channels[i];return!!r&&(r.ccMIDROW(t),this.logger.log(3,"MIDROW ("+iy([e,t])+")"),!0)}return!1}},{key:"parsePAC",value:function(e,t){var i,r=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;if(uy(e,t,r))return cy(null,null,r),!0;var a=e<=23?1:2;i=t>=64&&t<=95?1===a?Qg[e]:Zg[e]:1===a?Xg[e]:$g[e];var n=this.channels[a];return!!n&&(n.setPAC(this.interpretPAC(i,t)),cy(e,t,r),this.currentChannel=a,!0)}},{key:"interpretPAC",value:function(e,t){var i,r={color:null,italics:!1,indent:null,underline:!1,row:e};return i=t>95?t-96:t-64,r.underline=1==(1&i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r}},{key:"parseChars",value:function(e,t){var i,r,a=null,n=null;(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19)?(r=17===n?t+80:18===n?t+112:t+144,this.logger.log(2,"Special char '"+qg(r)+"' in channel "+i),a=[r]):e>=32&&e<=127&&(a=0===t?[e]:[e,t]);if(a){var o=iy(a);this.logger.log(3,"Char codes = "+o.join(",")),cy(e,t,this.cmdHistory)}return a}},{key:"parseBackgroundAttributes",value:function(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;var i,r={};16===e||24===e?(i=Math.floor((t-32)/2),r.background=ey[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));var a=e<=23?1:2;return this.channels[a].setBkgData(r),cy(e,t,this.cmdHistory),!0}},{key:"reset",value:function(){for(var e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}},{key:"reset",value:function(){this.cueRanges=[],this.startTime=null}}])}(),hy=function(){if(null!=$d&&$d.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function i(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;var i=t.toLowerCase();return!!~e.indexOf(i)&&i}function r(e){return i(t,e)}function a(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r100)throw new Error("Position must be between 0 and 100.");A=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",a({},l,{get:function(){return b},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",a({},l,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",a({},l,{get:function(){return k},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");k=t,this.hasBeenReset=!0}})),s.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}(),py=function(){function e(){S(this,e)}return T(e,[{key:"decode",value:function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}])}();function fy(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+parseFloat(r||0)}var i=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}var my=function(){function e(){S(this,e),this.values=Object.create(null)}return T(e,[{key:"set",value:function(e,t){this.get(e)||""===t||(this.values[e]=t)}},{key:"get",value:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}},{key:"has",value:function(e){return e in this.values}},{key:"alt",value:function(e,t,i){for(var r=0;r=0&&i<=100)return this.set(e,i),!0}return!1}}])}();function gy(e,t,i,r){var a=r?e.split(r):[e];for(var n in a)if("string"==typeof a[n]){var o=a[n].split(i);2===o.length&&t(o[0],o[1])}}var yy=new hy(0,0,""),vy="middle"===yy.align?"middle":"center";function Ay(e,t,i){var r=e;function a(){var t=fy(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function n(){e=e.replace(/^\s+/,"")}if(n(),t.startTime=a(),n(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.slice(3),n(),t.endTime=a(),n(),function(e,t){var r=new my;gy(e,(function(e,t){var a;switch(e){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===t){r.set(e,i[n].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":a=t.split(","),r.integer(e,a[0]),r.percent(e,a[0])&&r.set("snapToLines",!1),r.alt(e,a[0],["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start",vy,"end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start",vy,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",vy,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");var a=r.get("line","auto");"auto"===a&&-1===yy.line&&(a=-1),t.line=a,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",vy);var n=r.get("position","auto");"auto"===n&&50===yy.position&&(n="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=n}(e,t)}function by(e){return e.replace(//gi,"\n")}var _y=function(){function e(){S(this,e),this.state="INITIAL",this.buffer="",this.decoder=new py,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}return T(e,[{key:"parse",value:function(e){var t=this;function i(){var e=t.buffer,i=0;for(e=by(e);i2&&void 0!==arguments[2]?arguments[2]:0;return e.slice(i,i+t.length)===t},Sy=function(e){for(var t=5381,i=e.length;i;)t=33*t^e.charCodeAt(--i);return(t>>>0).toString()};function Ty(e,t,i){return Sy(e.toString())+Sy(t.toString())+Sy(i)}function Ey(e,t,i,r,a,n,o){var s,l=new _y,c=Ch(new Uint8Array(e)).trim().replace(ky,"\n").split("\n"),u=[],d=t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Ag(e,9e4,1/t)}(t.baseTime,t.timescale):0,h="00:00.000",p=0,f=0,m=!0;l.oncue=function(e){var n=i[r],o=i.ccOffset,l=(p-d)/9e4;if(null!=n&&n.new&&(void 0!==f?o=i.ccOffset=n.start:function(e,t,i){var r=e[t],a=e[r.prevCC];if(!a||!a.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!=(n=a)&&n.new;){var n;e.ccOffset+=r.start-a.start,r.new=!1,r=a,a=e[r.prevCC]}e.presentationOffset=i}(i,r,l)),l){if(!t)return void(s=new Error("Missing initPTS for VTT MPEGTS"));o=l-i.presentationOffset}var c=e.endTime-e.startTime,h=Tg(9e4*(e.startTime+o-f),9e4*a)/9e4;e.startTime=Math.max(h,0),e.endTime=Math.max(h+c,0);var m=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(m)),e.id||(e.id=Ty(e.startTime,e.endTime,m)),e.endTime>0&&u.push(e)},l.onparsingerror=function(e){s=e},l.onflush=function(){s?o(s):n(u)},c.forEach((function(e){if(m){if(wy(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach((function(e){wy(e,"LOCAL:")?h=e.slice(6):wy(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{f=function(e){var t=parseInt(e.slice(-3)),i=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),a=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(Ed(t)&&Ed(i)&&Ed(r)&&Ed(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:".concat(e));return t+=1e3*i,t+=6e4*r,t+=36e5*a,t}(h)/1e3}catch(e){s=e}return}""===e&&(m=!1)}l.parse(e+"\n")})),l.flush()}var Cy="stpp.ttml.im1t",xy=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ry=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Dy={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ly(e,t,i,r){var a=Nh(new Uint8Array(e),["mdat"]);if(0!==a.length){var n=a.map((function(e){return Ch(e)})),o=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Ag(e,t,1/i,r)}(t.baseTime,1,t.timescale);try{n.forEach((function(e){return i(function(e,t){var i=new DOMParser,r=i.parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(a).reduce((function(e,t){return e[t]=r.getAttribute("ttp:".concat(t))||a[t],e}),{}),o="preserve"!==r.getAttribute("xml:space"),s=Py(Iy(r,"styling","style")),l=Py(Iy(r,"layout","region")),c=Iy(r,"body","[begin]");return[].map.call(c,(function(e){var i=By(e,o);if(!i||!e.hasAttribute("begin"))return null;var r=Fy(e.getAttribute("begin"),n),a=Fy(e.getAttribute("dur"),n),c=Fy(e.getAttribute("end"),n);if(null===r)throw Uy(e);if(null===c){if(null===a)throw Uy(e);c=r+a}var u=new hy(r-t,c-t,i);u.id=Ty(u.startTime,u.endTime,u.text);var d=function(e,t,i){var r="http://www.w3.org/ns/ttml#styling",a=null,n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return o&&i.hasOwnProperty(o)&&(a=i[o]),n.reduce((function(i,n){var o=My(t,r,n)||My(e,r,n)||My(a,r,n);return o&&(i[n]=o),i}),{})}(l[e.getAttribute("region")],s[e.getAttribute("style")],s),h=d.textAlign;if(h){var p=Dy[h];p&&(u.lineAlign=p),u.align=h}return Td(u,d),u})).filter((function(e){return null!==e}))}(e,o))}))}catch(e){r(e)}}else r(new Error("Could not parse IMSC1 mdat"))}function Iy(e,t,i){var r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function Py(e){return e.reduce((function(e,t){var i=t.getAttribute("xml:id");return i&&(e[i]=t),e}),{})}function By(e,t){return[].slice.call(e.childNodes).reduce((function(e,i,r){var a;return"br"===i.nodeName&&r?e+"\n":null!=(a=i.childNodes)&&a.length?By(i,t):t?e+i.textContent.trim().replace(/\s+/g," "):e+i.textContent}),"")}function My(e,t,i){return e&&e.hasAttributeNS(t,i)?e.getAttributeNS(t,i):null}function Uy(e){return new Error("Could not parse ttml timestamp ".concat(e))}function Fy(e,t){if(!e)return null;var i=fy(e);return null===i&&(xy.test(e)?i=function(e,t){var i=xy.exec(e),r=(0|i[4])+(0|i[5])/t.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/t.frameRate}(e,t):Ry.test(e)&&(i=function(e,t){var i=Ry.exec(e),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),i}function Oy(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function Ny(e,t){return!!e&&e.kind===Oy(t)&&Gg(t,e)}var jy=function(){function e(t){S(this,e),this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}return T(e,[{key:"setStreamController",value:function(e){this.streamController=e}},{key:"destroy",value:function(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}},{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Rd.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Rd.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Rd.MEDIA_DETACHING,this.onMediaDetaching,this)}},{key:"unregisterListener",value:function(){var e=this.hls;e.off(Rd.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Rd.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Rd.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Rd.MEDIA_DETACHING,this.onMediaDetaching,this)}},{key:"onFpsDropLevelCapping",value:function(e,t){var i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}},{key:"onMediaAttaching",value:function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}},{key:"onManifestParsed",value:function(e,t){var i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}},{key:"onLevelsUpdated",value:function(e,t){this.timer&&Ed(this.autoLevelCapping)&&this.detectPlayerSize()}},{key:"onBufferCodecs",value:function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}},{key:"onMediaDetaching",value:function(){this.stopCapping()}},{key:"detectPlayerSize",value:function(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);var e=this.hls.levels;if(e.length){var t=this.hls,i=this.getMaxLevel(e.length-1);i!==this.autoLevelCapping&&Ud.log("Setting autoLevelCapping to ".concat(i,": ").concat(e[i].height,"p@").concat(e[i].bitrate," for media ").concat(this.mediaWidth,"x").concat(this.mediaHeight)),t.autoLevelCapping=i,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(t){var i=this,r=this.hls.levels;if(!r.length)return-1;var a=r.filter((function(e,r){return i.isLevelAllowed(e)&&r<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)}},{key:"startCapping",value:function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"stopCapping",value:function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}},{key:"getDimensions",value:function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,t.width||t.height||(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}},{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}},{key:"isLevelAllowed",value:function(e){return!this.restrictedLevels.some((function(t){return e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height}))}}],[{key:"getMaxLevelByMediaSize",value:function(e,t,i){if(null==e||!e.length)return-1;for(var r,a,n=e.length-1,o=Math.max(t,i),s=0;s=o||l.height>=o)&&(r=l,!(a=e[s+1])||r.width!==a.width||r.height!==a.height)){n=s;break}}return n}}])}(),Gy="[eme]",zy=function(){function e(t){S(this,e),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=e.CDMCleanupPromise?[e.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=Ud.debug.bind(Ud,Gy),this.log=Ud.log.bind(Ud,Gy),this.warn=Ud.warn.bind(Ud,Gy),this.error=Ud.error.bind(Ud,Gy),this.hls=t,this.config=t.config,this.registerListeners()}return T(e,[{key:"destroy",value:function(){this.unregisterListeners(),this.onMediaDetached();var e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}},{key:"registerListeners",value:function(){this.hls.on(Rd.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Rd.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Rd.MANIFEST_LOADED,this.onManifestLoaded,this)}},{key:"unregisterListeners",value:function(){this.hls.off(Rd.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Rd.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Rd.MANIFEST_LOADED,this.onManifestLoaded,this)}},{key:"getLicenseServerUrl",value:function(e){var t=this.config,i=t.drmSystems,r=t.widevineLicenseUrl,a=i[e];if(a)return a.licenseUrl;if(e===eh.WIDEVINE&&r)return r;throw new Error('no license server URL configured for key-system "'.concat(e,'"'))}},{key:"getServerCertificateUrl",value:function(e){var t=this.config.drmSystems,i=t[e];if(i)return i.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'.concat(e,'"]'))}},{key:"attemptKeySystemAccess",value:function(e){var t=this,i=this.hls.levels,r=function(e){function t(t,i,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,i){return!!e&&i.indexOf(e)===t})),a=i.map((function(e){return e.audioCodec})).filter(r),n=i.map((function(e){return e.videoCodec})).filter(r);return a.length+n.length===0&&n.push("avc1.42e01e"),new Promise((function(i,r){var o=function(e){var s=e.shift();t.getMediaKeysPromise(s,a,n).then((function(e){return i({keySystem:s,mediaKeys:e})})).catch((function(t){e.length?o(e):r(t instanceof Jy?t:new Jy({type:Dd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};o(e)}))}},{key:"requestMediaKeySystemAccess",value:function(e,t){var i=this.config.requestMediaKeySystemAccessFunc;if("function"!=typeof i){var r="Configured requestMediaKeySystemAccess is not a function ".concat(i);return null===uh&&"http:"===self.location.protocol&&(r="navigator.requestMediaKeySystemAccess is not available over insecure protocol ".concat(location.protocol)),Promise.reject(new Error(r))}return i(e,t)}},{key:"getMediaKeysPromise",value:function(e,t,i){var r=this,a=function(e,t,i,r){var a;switch(e){case eh.FAIRPLAY:a=["cenc","sinf"];break;case eh.WIDEVINE:case eh.PLAYREADY:a=["cenc"];break;case eh.CLEARKEY:a=["cenc","keyids"];break;default:throw new Error("Unknown key-system: ".concat(e))}return function(e,t,i,r){return[{initDataTypes:e,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:t.map((function(e){return{contentType:'audio/mp4; codecs="'.concat(e,'"'),robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}})),videoCapabilities:i.map((function(e){return{contentType:'video/mp4; codecs="'.concat(e,'"'),robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}}))}]}(a,t,i,r)}(e,t,i,this.config.drmSystemOptions),n=this.keySystemAccessPromises[e],o=null==n?void 0:n.keySystemAccess;if(!o){this.log('Requesting encrypted media "'.concat(e,'" key-system access with config: ').concat(JSON.stringify(a))),o=this.requestMediaKeySystemAccess(e,a);var s=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch((function(t){r.log('Failed to obtain access to key-system "'.concat(e,'": ').concat(t))})),o.then((function(t){r.log('Access for key-system "'.concat(t.keySystem,'" obtained'));var i=r.fetchServerCertificate(e);return r.log('Create media-keys for "'.concat(e,'"')),s.mediaKeys=t.createMediaKeys().then((function(t){return r.log('Media-keys created for "'.concat(e,'"')),i.then((function(i){return i?r.setMediaKeysServerCertificate(t,e,i):t}))})),s.mediaKeys.catch((function(t){r.error('Failed to create media-keys for "'.concat(e,'"}: ').concat(t))})),s.mediaKeys}))}return o.then((function(){return n.mediaKeys}))}},{key:"createMediaKeySessionContext",value:function(e){var t=e.decryptdata,i=e.keySystem,r=e.mediaKeys;this.log('Creating key-system session "'.concat(i,'" keyId: ').concat(Rh(t.keyId||[])));var a=r.createSession(),n={decryptdata:t,keySystem:i,mediaKeys:r,mediaKeysSession:a,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}},{key:"renewKeySession",value:function(e){var t=e.decryptdata;if(t.pssh){var i=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),a="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,a,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}},{key:"getKeyIdString",value:function(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return Rh(e.keyId)}},{key:"updateKeySession",value:function(e,t){var i,r=e.mediaKeysSession;return this.log('Updating key-session "'.concat(r.sessionId,'" for keyID ').concat(Rh((null==(i=e.decryptdata)?void 0:i.keyId)||[]),"\n } (data length: ").concat(t?t.byteLength:t,")")),r.update(t)}},{key:"selectKeySystemFormat",value:function(e){var t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: ".concat(e.sn," ").concat(e.type,": ").concat(e.level,") key formats ").concat(t.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}},{key:"getKeyFormatPromise",value:function(e){var t=this;return new Promise((function(i,r){var a=lh(t.config),n=e.map(nh).filter((function(e){return!!e&&-1!==a.indexOf(e)}));return t.getKeySystemSelectionPromise(n).then((function(e){var t=e.keySystem,a=sh(t);a?i(a):r(new Error('Unable to find format for key-system "'.concat(t,'"')))})).catch(r)}))}},{key:"loadKey",value:function(e){var t=this,i=e.keyInfo.decryptdata,r=this.getKeyIdString(i),a="(keyId: ".concat(r,' format: "').concat(i.keyFormat,'" method: ').concat(i.method," uri: ").concat(i.uri,")");this.log("Starting session for key ".concat(a));var n=this.keyIdToKeySessionPromise[r];return n||(n=this.keyIdToKeySessionPromise[r]=this.getKeySystemForKeyPromise(i).then((function(r){var n=r.keySystem,o=r.mediaKeys;return t.throwIfDestroyed(),t.log("Handle encrypted media sn: ".concat(e.frag.sn," ").concat(e.frag.type,": ").concat(e.frag.level," using key ").concat(a)),t.attemptSetMediaKeys(n,o).then((function(){t.throwIfDestroyed();var e=t.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:i});return t.generateRequestWithPreferredKeySession(e,"cenc",i.pssh,"playlist-key")}))})),n.catch((function(e){return t.handleError(e)}))),n}},{key:"throwIfDestroyed",value:function(){if(!this.hls)throw new Error("invalid state")}},{key:"handleError",value:function(e){this.hls&&(this.error(e.message),e instanceof Jy?this.hls.trigger(Rd.ERROR,e.data):this.hls.trigger(Rd.ERROR,{type:Dd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}},{key:"getKeySystemForKeyPromise",value:function(e){var t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){var r=nh(e.keyFormat),a=r?[r]:lh(this.config);return this.attemptKeySystemAccess(a)}return i}},{key:"getKeySystemSelectionPromise",value:function(e){if(e.length||(e=lh(this.config)),0===e.length)throw new Jy({type:Dd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options ".concat(JSON.stringify({drmSystems:this.config.drmSystems})));return this.attemptKeySystemAccess(e)}},{key:"_onMediaEncrypted",value:function(e){var t=this,i=e.initDataType,r=e.initData;if(this.debug('"'.concat(e.type,'" event: init data type: "').concat(i,'"')),null!==r){var a,n;if("sinf"===i&&this.config.drmSystems[eh.FAIRPLAY]){var o=Ph(new Uint8Array(r));try{var s=Qd(JSON.parse(o).sinf),l=Jh(new Uint8Array(s));if(!l)return;a=l.subarray(8,24),n=eh.FAIRPLAY}catch(e){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{var c=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;var t={version:0,systemId:"",kids:null,data:null},i=new DataView(e),r=i.getUint32(0);if(e.byteLength!==r&&r>44)return null;if(1886614376!==i.getUint32(4))return null;if(t.version=i.getUint32(8)>>>24,t.version>1)return null;t.systemId=Rh(new Uint8Array(e,12,16));var a=i.getUint32(28);if(0===t.version){if(r-320)for(var n,o=0,s=a.length;o in key message");return Zd(atob(p))}},{key:"setupLicenseXHR",value:function(e,t,i,r){var a=this,n=this.config.licenseXhrSetup;return n?Promise.resolve().then((function(){if(!i.decryptdata)throw new Error("Key removed");return n.call(a.hls,e,t,i,r)})).catch((function(o){if(!i.decryptdata)throw o;return e.open("POST",t,!0),n.call(a.hls,e,t,i,r)})).then((function(i){return e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:i||r}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}},{key:"requestLicense",value:function(e,t){var i=this,r=this.config.keyLoadPolicy.default;return new Promise((function(a,n){var o=i.getLicenseServerUrl(e.keySystem);i.log("Sending license request to URL: ".concat(o));var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=function(){if(!i.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(4===s.readyState)if(200===s.status){i._requestLicenseFailureCount=0;var l=s.response;i.log("License received ".concat(l instanceof ArrayBuffer?l.byteLength:l));var c=i.config.licenseResponseCallback;if(c)try{l=c.call(i.hls,s,o,e)}catch(e){i.error(e)}a(l)}else{var u=r.errorRetry,d=u?u.maxNumRetry:0;if(i._requestLicenseFailureCount++,i._requestLicenseFailureCount>d||s.status>=400&&s.status<500)n(new Jy({type:Dd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:{url:o,data:void 0,code:s.status,text:s.statusText}},"License Request XHR failed (".concat(o,"). Status: ").concat(s.status," (").concat(s.statusText,")")));else{var h=d-i._requestLicenseFailureCount+1;i.warn("Retrying license request, ".concat(h," attempts left")),i.requestLicense(e,t).then(a,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=s,i.setupLicenseXHR(s,o,e,t).then((function(t){var r=t.xhr,a=t.licenseChallenge;e.keySystem==eh.PLAYREADY&&(a=i.unpackPlayReadyKeyMessage(r,a)),r.send(a)}))}))}},{key:"onMediaAttached",value:function(e,t){if(this.config.emeEnabled){var i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}}},{key:"onMediaDetached",value:function(){var t=this,i=this.media,r=this.mediaKeySessions;i&&(i.removeEventListener("encrypted",this.onMediaEncrypted),i.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},tp.clearKeyUriToKeyIdMap();var a=r.length;e.CDMCleanupPromise=Promise.all(r.map((function(e){return t.removeSession(e)})).concat(null==i?void 0:i.setMediaKeys(null).catch((function(e){t.log("Could not clear media keys: ".concat(e))})))).then((function(){a&&(t.log("finished closing key sessions and clearing media keys"),r.length=0)})).catch((function(e){t.log("Could not close sessions and clear media keys: ".concat(e))}))}},{key:"onManifestLoading",value:function(){this.keyFormatPromise=null}},{key:"onManifestLoaded",value:function(e,t){var i=t.sessionKeys;if(i&&this.config.emeEnabled&&!this.keyFormatPromise){var r=i.reduce((function(e,t){return-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e}),[]);this.log("Selecting key-system from session-keys ".concat(r.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(r)}}},{key:"removeSession",value:function(e){var t=this,i=e.mediaKeysSession,r=e.licenseXhr;if(i){this.log("Remove licenses and keys and close session ".concat(i.sessionId)),e._onmessage&&(i.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(i.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;var a=this.mediaKeySessions.indexOf(e);return a>-1&&this.mediaKeySessions.splice(a,1),i.remove().catch((function(e){t.log("Could not remove session: ".concat(e))})).then((function(){return i.close()})).catch((function(e){t.log("Could not close session: ".concat(e))}))}}}])}();zy.CDMCleanupPromise=void 0;var Hy,Wy,Vy,Jy=function(e){function t(e,i){var r;return S(this,t),r=_(this,t,[i]),r.data=void 0,e.error||(e.error=new Error(i)),r.data=e,e.err=e.error,r}return k(t,e),T(t)}(y(Error));!function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"}(Hy||(Hy={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(Wy||(Wy={})),function(e){e.OBJECT="CMCD-Object",e.REQUEST="CMCD-Request",e.SESSION="CMCD-Session",e.STATUS="CMCD-Status"}(Vy||(Vy={}));var qy=p(p(p(p({},Vy.OBJECT,["br","d","ot","tb"]),Vy.REQUEST,["bl","dl","mtp","nor","nrr","su"]),Vy.SESSION,["cid","pr","sf","sid","st","v"]),Vy.STATUS,["bs","rtp"]),Ky=T((function e(t,i){S(this,e),this.value=void 0,this.params=void 0,Array.isArray(t)&&(t=t.map((function(t){return t instanceof e?t:new e(t)}))),this.value=t,this.params=i})),Yy=T((function e(t){S(this,e),this.description=void 0,this.description=t}));function Qy(e,t,i,r){return new Error("failed to ".concat(e,' "').concat((a=t,Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":"object"==E(a)?JSON.stringify(a):String(a)),'" as ').concat(i),{cause:r});var a}var Xy="Bare Item",Zy=/[\x00-\x1f\x7f]+/;function $y(e,t,i){return Qy("serialize",e,t,i)}function ev(e){if(!1===ArrayBuffer.isView(e))throw $y(e,"Byte Sequence");return":".concat((t=e,btoa(String.fromCharCode.apply(String,g(t)))),":");var t}function tv(e){if(function(e){return e<-999999999999999||99999999999999912)throw $y(e,"Decimal");var i=t.toString();return i.includes(".")?i:"".concat(i,".0")}function av(e){var t,i=(t=e).description||t.toString().slice(7,-1);if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(i))throw $y(i,"Token");return i}function nv(e){switch(E(e)){case"number":if(!Ed(e))throw $y(e,Xy);return Number.isInteger(e)?tv(e):rv(e);case"string":return function(e){if(Zy.test(e))throw $y(e,"String");return'"'.concat(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),'"')}(e);case"symbol":return av(e);case"boolean":return function(e){if("boolean"!=typeof e)throw $y(e,"Boolean");return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return"@".concat(tv(e.getTime()/1e3))}(e);if(e instanceof Uint8Array)return ev(e);if(e instanceof Yy)return av(e);default:throw $y(e,Xy)}}function ov(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw $y(e,"Key");return e}function sv(e){return null==e?"":Object.entries(e).map((function(e){var t=h(e,2),i=t[0],r=t[1];return!0===r?";".concat(ov(i)):";".concat(ov(i),"=").concat(nv(r))})).join("")}function lv(e){return e instanceof Ky?"".concat(nv(e.value)).concat(sv(e.params)):nv(e)}function cv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{whitespace:!0};if("object"!=E(e))throw $y(e,"Dict");var i=e instanceof Map?e.entries():Object.entries(e),r=null!=t&&t.whitespace?" ":"";return Array.from(i).map((function(e){var t=h(e,2),i=t[0],r=t[1];r instanceof Ky==0&&(r=new Ky(r));var a,n=ov(i);return!0===r.value?n+=sv(r.params):(n+="=",Array.isArray(r.value)?n+="(".concat((a=r).value.map(lv).join(" "),")").concat(sv(a.params)):n+=lv(r)),n})).join(",".concat(r))}var uv=function(e){return Math.round(e)},dv=function(e){return 100*uv(e/100)},hv={br:uv,d:uv,bl:dv,dl:dv,mtp:dv,nor:function(e,t){return null!=t&&t.baseUrl&&(e=function(e,t){var i=new URL(e),r=new URL(t);if(i.origin!==r.origin)return e;for(var a=i.pathname.split("/").slice(1),n=r.pathname.split("/").slice(1,-1);a[0]===n[0];)a.shift(),n.shift();for(;n.length;)n.shift(),a.unshift("..");return a.join("/")}(e,t.baseUrl)),encodeURIComponent(e)},rtp:dv,tb:uv};function pv(e,t){var i={};if(null==e||"object"!=E(e))return i;var r=Object.keys(e).sort(),a=Td({},hv,null==t?void 0:t.formatters),n=null==t?void 0:t.filter;return r.forEach((function(r){if(null==n||!n(r)){var o=e[r],s=a[r];s&&(o=s(o,t)),"v"===r&&1===o||"pr"==r&&1===o||function(e){return"number"==typeof e?Ed(e):null!=e&&""!==e&&!1!==e}(o)&&(function(e){return"ot"===e||"sf"===e||"st"===e}(r)&&"string"==typeof o&&(o=new Yy(o)),i[r]=o)}})),i}function fv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?function(e,t){return cv(e,t)}(pv(e,t),Td({whitespace:!1},t)):""}function mv(e,t,i){return Td(e,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{};var i=Object.entries(e),r=Object.entries(qy).concat(Object.entries((null==t?void 0:t.customHeaderMap)||{})),a=i.reduce((function(e,t){var i,a=h(t,2),n=a[0],o=a[1],s=(null==(i=r.find((function(e){return e[1].includes(n)})))?void 0:i[0])||Vy.REQUEST;return null!=e[s]||(e[s]={}),e[s][n]=o,e}),{});return Object.entries(a).reduce((function(e,i){var r=h(i,2),a=r[0],n=r[1];return e[a]=fv(n,t),e}),{})}(t,i))}var gv=/CMCD=[^&#]+/;function yv(e,t,i){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";var i=fv(e,t);return"CMCD=".concat(encodeURIComponent(i))}(t,i);if(!r)return e;if(gv.test(e))return e.replace(gv,r);var a=e.includes("?")?"&":"?";return"".concat(e).concat(a).concat(r)}function vv(e,t,i,r){e&&Object.keys(t).forEach((function(a){var n=e.filter((function(e){return e.groupId===a})).map((function(e){var n=Td({},e);return n.details=void 0,n.attrs=new Nd(n.attrs),n.url=n.attrs.URI=Av(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),n.groupId=n.attrs["GROUP-ID"]=t[a],n.attrs["PATHWAY-ID"]=r,n}));e.push.apply(e,g(n))}))}function Av(e,t,i,r){var a,n=r.HOST,o=r.PARAMS,s=r[i];t&&(a=null==s?void 0:s[t],a&&(e=a));var l=new self.URL(e);return n&&!a&&(l.host=n),o&&Object.keys(o).sort().forEach((function(e){e&&l.searchParams.set(e,o[e])})),l.href}var bv=/^age:\s*[\d.]+\s*$/im,_v=function(){function e(t){S(this,e),this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new zd,this.retryDelay=0}return T(e,[{key:"destroy",value:function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null,this.stats=null}},{key:"abortInternal",value:function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}},{key:"abort",value:function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}},{key:"load",value:function(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}},{key:"loadInternal",value:function(){var e=this,t=this.config,i=this.context;if(t&&i){var r=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0,a.aborted=!1;var n=this.xhrSetup;n?Promise.resolve().then((function(){if(!e.stats.aborted)return n(r,i.url)})).catch((function(e){return r.open("GET",i.url,!0),n(r,i.url)})).then((function(){e.stats.aborted||e.openAndSendXhr(r,i,t)})).catch((function(t){e.callbacks.onError({code:r.status,text:t.message},i,r,a)})):this.openAndSendXhr(r,i,t)}}},{key:"openAndSendXhr",value:function(e,t,i){e.readyState||e.open("GET",t.url,!0);var r=t.headers,a=i.loadPolicy,n=a.maxTimeToFirstByteMs,o=a.maxLoadTimeMs;if(r)for(var s in r)e.setRequestHeader(s,r[s]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&Ed(n)?n:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}},{key:"readystatechange",value:function(){var e=this.context,t=this.loader,i=this.stats;if(e&&t){var r=t.readyState,a=this.config;if(!i.aborted&&r>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),a.timeout!==a.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),a.timeout=a.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;var n=t.status,o="text"!==t.responseType;if(n>=200&&n<300&&(o&&t.response||null!==t.responseText)){i.loading.end=Math.max(self.performance.now(),i.loading.first);var s=o?t.response:t.responseText,l="arraybuffer"===t.responseType?s.byteLength:s.length;if(i.loaded=i.total=l,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first),!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(i,e,s,t),!this.callbacks)return;var u={url:t.responseURL,data:s,code:n};this.callbacks.onSuccess(u,i,e,t)}else{var d=a.loadPolicy.errorRetry;wf(d,i.retry,!1,{url:e.url,data:void 0,code:n})?this.retry(d):(Ud.error("".concat(n," while loading ").concat(e.url)),this.callbacks.onError({code:n,text:t.statusText},e,t,i))}}}}},{key:"loadtimeout",value:function(){var e,t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(wf(t,this.stats.retry,!0))this.retry(t);else{var i;Ud.warn("timeout while loading ".concat(null==(i=this.context)?void 0:i.url));var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}},{key:"retry",value:function(e){var t=this.context,i=this.stats;this.retryDelay=_f(e,i.retry),i.retry++,Ud.warn("".concat(status?"HTTP Status "+status:"Timeout"," while loading ").concat(null==t?void 0:t.url,", retrying ").concat(i.retry,"/").concat(e.maxNumRetry," in ").concat(this.retryDelay,"ms")),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}},{key:"loadprogress",value:function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}},{key:"getCacheAge",value:function(){var e=null;if(this.loader&&bv.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}},{key:"getResponseHeader",value:function(e){return this.loader&&new RegExp("^".concat(e,":\\s*[\\d.]+\\s*$"),"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}])}(),kv=/(\d+)-(\d+)\/(\d+)/,wv=function(){function e(t){S(this,e),this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||Sv,this.controller=new self.AbortController,this.stats=new zd}return T(e,[{key:"destroy",value:function(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}},{key:"abortInternal",value:function(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}},{key:"abort",value:function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}},{key:"load",value:function(e,t,i){var r=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var n=function(e,t){var i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(Td({},e.headers))};return e.rangeEnd&&i.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),i}(e,this.controller.signal),o=i.onProgress,s="arraybuffer"===e.responseType,l=s?"byteLength":"length",c=t.loadPolicy,u=c.maxTimeToFirstByteMs,d=c.maxLoadTimeMs;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=u&&Ed(u)?u:d,this.requestTimeout=self.setTimeout((function(){r.abortInternal(),i.onTimeout(a,e,r.response)}),t.timeout),self.fetch(this.request).then((function(n){r.response=r.loader=n;var l=Math.max(self.performance.now(),a.loading.start);if(self.clearTimeout(r.requestTimeout),t.timeout=d,r.requestTimeout=self.setTimeout((function(){r.abortInternal(),i.onTimeout(a,e,r.response)}),d-(l-a.loading.start)),!n.ok){var c=n.status,u=n.statusText;throw new Ev(u||"fetch, bad network response",c,n)}return a.loading.first=l,a.total=function(e){var t=e.get("Content-Range");if(t){var i=function(e){var t=kv.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(Ed(i))return i}var r=e.get("Content-Length");if(r)return parseInt(r)}(n.headers)||a.total,o&&Ed(t.highWaterMark)?r.loadProgressively(n,a,e,t.highWaterMark,o):s?n.arrayBuffer():"json"===e.responseType?n.json():n.text()})).then((function(n){var s=r.response;if(!s)throw new Error("loader destroyed");self.clearTimeout(r.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first);var c=n[l];c&&(a.loaded=a.total=c);var u={url:s.url,data:n,code:s.status};o&&!Ed(t.highWaterMark)&&o(a,e,n,s),i.onSuccess(u,a,e,s)})).catch((function(t){if(self.clearTimeout(r.requestTimeout),!a.aborted){var n=t&&t.code||0,o=t?t.message:null;i.onError({code:n,text:o},e,t?t.details:null,a)}}))}},{key:"getCacheAge",value:function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}},{key:"getResponseHeader",value:function(e){return this.response?this.response.headers.get(e):null}},{key:"loadProgressively",value:function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,n=new Pm,o=e.body.getReader(),s=function(){return o.read().then((function(o){if(o.done)return n.dataLength&&a(t,i,n.flush(),e),Promise.resolve(new ArrayBuffer(0));var l=o.value,c=l.length;return t.loaded+=c,c=r&&a(t,i,n.flush(),e)):a(t,i,l,e),s()})).catch((function(){return Promise.reject()}))};return s()}}])}();function Sv(e,t){return new self.Request(e.url,t)}var Tv,Ev=function(e){function t(e,i,r){var a;return S(this,t),a=_(this,t,[e]),a.code=void 0,a.details=void 0,a.code=i,a.details=r,a}return k(t,e),T(t)}(y(Error)),Cv=/\s/,xv={newCue:function(e,t,i,r){for(var a,n,o,s,l,c=[],u=self.VTTCue||self.TextTrackCue,d=0;d=16?s--:s++;var f=by(l.trim()),m=Ty(t,i,f);null!=e&&null!=(h=e.cues)&&h.getCueById(m)||(n=new u(t,i,f),n.id=m,n.line=d+1,n.align="left",n.position=10+Math.min(80,10*Math.floor(8*s/32)),c.push(n))}return e&&c.length&&(c.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),c.forEach((function(t){return Hp(e,t)}))),c}},Rv=kd(kd({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:_v,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:function(){function e(t){var i=this;S(this,e),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=function(){var e=i.fragCurrent,t=i.partCurrent,r=i.hls,a=r.autoLevelEnabled,n=r.media;if(e&&n){var o=performance.now(),s=t?t.stats:e.stats,l=t?t.duration:e.duration,c=o-s.loading.start,u=r.minAutoLevel;if(s.aborted||s.loaded&&s.loaded===s.total||e.level<=u)return i.clearTimer(),void(i._nextAutoLevel=-1);if(a&&!n.paused&&n.playbackRate&&n.readyState){var d=r.mainForwardBufferInfo;if(null!==d){var h=i.bwEstimator.getEstimateTTFB(),p=Math.abs(n.playbackRate);if(!(c<=Math.max(h,l/(2*p)*1e3))){var f=d.len/p,m=s.loading.first?s.loading.first-s.loading.start:-1,g=s.loaded&&m>-1,y=i.getBwEstimate(),v=r.levels,A=v[e.level],b=s.total||Math.max(s.loaded,Math.round(l*A.averageBitrate/8)),_=g?c-m:c;_<1&&g&&(_=Math.min(c,8*s.loaded/y));var k=g?1e3*s.loaded/_:0,w=k?(b-s.loaded)/k:8*b/y+h/1e3;if(!(w<=f)){var S,T=k?8*k:y,E=Number.POSITIVE_INFINITY;for(S=e.level-1;S>u;S--){var C=v[S].maxBitrate;if(E=i.getTimeToLoadFrag(h/1e3,T,l*C,!v[S].details),E=w)&&!(E>10*l)){r.nextLoadLevel=r.nextAutoLevel=S,g?i.bwEstimator.sample(c-Math.min(h,m),s.loaded):i.bwEstimator.sampleTTFB(c);var x=v[S].maxBitrate;i.getBwEstimate()*i.hls.config.abrBandWidthUpFactor>x&&i.resetEstimator(x),i.clearTimer(),Ud.warn("[abr] Fragment ".concat(e.sn).concat(t?" part "+t.index:""," of level ").concat(e.level," is loading too slowly;\n Time to underbuffer: ").concat(f.toFixed(3)," s\n Estimated load time for current fragment: ").concat(w.toFixed(3)," s\n Estimated load time for down switch fragment: ").concat(E.toFixed(3)," s\n TTFB estimate: ").concat(0|m," ms\n Current BW estimate: ").concat(Ed(y)?0|y:"Unknown"," bps\n New BW estimate: ").concat(0|i.getBwEstimate()," bps\n Switching to level ").concat(S," @ ").concat(0|x," bps")),r.trigger(Rd.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:s})}}}}}}},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}return T(e,[{key:"resetEstimator",value:function(e){e&&(Ud.log("setting initial bwe to ".concat(e)),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}},{key:"initEstimator",value:function(){var e=this.hls.config;return new Ff(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}},{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.FRAG_LOADING,this.onFragLoading,this),e.on(Rd.FRAG_LOADED,this.onFragLoaded,this),e.on(Rd.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Rd.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Rd.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Rd.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Rd.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(Rd.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e&&(e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.FRAG_LOADING,this.onFragLoading,this),e.off(Rd.FRAG_LOADED,this.onFragLoaded,this),e.off(Rd.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Rd.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Rd.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Rd.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Rd.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(Rd.ERROR,this.onError,this))}},{key:"destroy",value:function(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}},{key:"onManifestLoading",value:function(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}},{key:"onLevelsUpdated",value:function(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}},{key:"onMaxAutoLevelUpdated",value:function(){this.firstSelection=-1,this.nextAutoLevelKey=""}},{key:"onFragLoading",value:function(e,t){var i,r=t.frag;this.ignoreFragment(r)||(r.bitrateTest||(this.fragCurrent=r,this.partCurrent=null!=(i=t.part)?i:null),this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100))}},{key:"onLevelSwitching",value:function(e,t){this.clearTimer()}},{key:"onError",value:function(e,t){if(!t.fatal)switch(t.details){case Ld.BUFFER_ADD_CODEC_ERROR:case Ld.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Ld.FRAG_LOAD_TIMEOUT:var i=t.frag,r=this.fragCurrent,a=this.partCurrent;if(i&&r&&i.sn===r.sn&&i.level===r.level){var n=performance.now(),o=a?a.stats:i.stats,s=n-o.loading.start,l=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&l>-1){var c=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(s-Math.min(c,l),o.loaded)}else this.bwEstimator.sampleTTFB(s)}break}}},{key:"getTimeToLoadFrag",value:function(e,t,i,r){return e+i/t+(r?this.lastLevelLoadSec:0)}},{key:"onLevelLoaded",value:function(e,t){var i=this.hls.config,r=t.stats.loading,a=r.end-r.start;Ed(a)&&(this.lastLevelLoadSec=a/1e3),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}},{key:"onFragLoaded",value:function(e,t){var i=t.frag,r=t.part,a=r?r.stats:i.stats;if(i.type===Up&&this.bwEstimator.sampleTTFB(a.loading.first-a.loading.start),!this.ignoreFragment(i)){if(this.clearTimer(),i.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){var n=r?r.duration:i.duration,o=this.hls.levels[i.level],s=(o.loaded?o.loaded.bytes:0)+a.loaded,l=(o.loaded?o.loaded.duration:0)+n;o.loaded={bytes:s,duration:l},o.realBitrate=Math.round(8*s/l)}if(i.bitrateTest){var c={stats:a,frag:i,part:r,id:i.type};this.onFragBuffered(Rd.FRAG_BUFFERED,c),i.bitrateTest=!1}else this.lastLoadedFragLevel=i.level}}},{key:"onFragBuffered",value:function(e,t){var i=t.frag,r=t.part,a=null!=r&&r.stats.loaded?r.stats:i.stats;if(!a.aborted&&!this.ignoreFragment(i)){var n=a.parsing.end-a.loading.start-Math.min(a.loading.first-a.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,a.loaded),a.bwEstimate=this.getBwEstimate(),i.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}}},{key:"ignoreFragment",value:function(e){return e.type!==Up||"initSegment"===e.sn}},{key:"clearTimer",value:function(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}},{key:"firstAutoLevel",get:function(){var e=this.hls,t=e.maxAutoLevel,i=e.minAutoLevel,r=this.getBwEstimate(),a=this.hls.config.maxStarvationDelay,n=this.findBestLevel(r,i,t,0,a,1,1);if(n>-1)return n;var o=this.hls.firstLevel,s=Math.min(Math.max(o,i),t);return Ud.warn("[abr] Could not find best starting auto level. Defaulting to first in playlist ".concat(o," clamped to ").concat(s)),s}},{key:"forcedAutoLevel",get:function(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}},{key:"nextAutoLevel",get:function(){var e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&i&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e;var r=t&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){var a=this.hls.levels;if(a.length>Math.max(e,r)&&a[e].loadError<=a[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r},set:function(e){var t=this.hls,i=t.maxAutoLevel,r=t.minAutoLevel,a=Math.min(Math.max(e,r),i);this._nextAutoLevel!==a&&(this.nextAutoLevelKey="",this._nextAutoLevel=a)}},{key:"getAutoLevelKey",value:function(){return"".concat(this.getBwEstimate(),"_").concat(this.getStarvationDelay().toFixed(2))}},{key:"getNextABRAutoLevel",value:function(){var e=this.fragCurrent,t=this.partCurrent,i=this.hls,r=i.maxAutoLevel,a=i.config,n=i.minAutoLevel,o=t?t.duration:e?e.duration:0,s=this.getBwEstimate(),l=this.getStarvationDelay(),c=a.abrBandWidthFactor,u=a.abrBandWidthUpFactor;if(l){var d=this.findBestLevel(s,n,r,l,0,c,u);if(d>=0)return d}var h=o?Math.min(o,a.maxStarvationDelay):a.maxStarvationDelay;if(!l){var p=this.bitrateTestDelay;p&&(h=(o?Math.min(o,a.maxLoadingDelay):a.maxLoadingDelay)-p,Ud.info("[abr] bitrate test took ".concat(Math.round(1e3*p),"ms, set first fragment max fetchDuration to ").concat(Math.round(1e3*h)," ms")),c=u=1)}var f=this.findBestLevel(s,n,r,l,h,c,u);if(Ud.info("[abr] ".concat(l?"rebuffering expected":"buffer is empty",", optimal quality level ").concat(f)),f>-1)return f;var m=i.levels[n],g=i.levels[i.loadLevel];return(null==m?void 0:m.bitrate)<(null==g?void 0:g.bitrate)?n:i.loadLevel}},{key:"getStarvationDelay",value:function(){var e=this.hls,t=e.media;if(!t)return 1/0;var i=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/i}},{key:"getBwEstimate",value:function(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}},{key:"findBestLevel",value:function(e,t,i,r,a,n,o){var s,l=this,c=r+a,u=this.lastLoadedFragLevel,d=-1===u?this.hls.firstLevel:u,h=this.fragCurrent,p=this.partCurrent,f=this.hls,m=f.levels,g=f.allAudioTracks,y=f.loadLevel,v=f.config;if(1===m.length)return 0;var A,b=m[d],_=!(null==b||null==(s=b.details)||!s.live),k=-1===y||-1===u,w="SDR",S=(null==b?void 0:b.frameRate)||0,T=v.audioPreference,E=v.videoPreference,C=this.audioTracksByGroup||(this.audioTracksByGroup=function(e){return e.reduce((function(e,t){var i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);var r=t.channels||"2";return i.channels[r]=(i.channels[r]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}(g));if(k){if(-1!==this.firstSelection)return this.firstSelection;var x=this.codecTiers||(this.codecTiers=function(e,t,i,r){return e.slice(i,r+1).reduce((function(e,i){if(!i.codecSet)return e;var r=i.audioGroups,a=e[i.codecSet];a||(e[i.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,i.bitrate);var n=Math.min(i.height,i.width);return a.minHeight=Math.min(a.minHeight,n),a.minFramerate=Math.min(a.minFramerate,i.frameRate),a.maxScore=Math.max(a.maxScore,i.score),a.fragmentError+=i.fragmentError,a.videoRanges[i.videoRange]=(a.videoRanges[i.videoRange]||0)+1,r&&r.forEach((function(e){if(e){var i=t.groups[e];a.hasDefaultAudio=a.hasDefaultAudio||t.hasDefaultAudio?i.hasDefault:i.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(i.channels).forEach((function(e){a.channels[e]=(a.channels[e]||0)+i.channels[e]}))}})),e}),{})}(m,C,t,i)),R=function(e,t,i,r,a){for(var n=Object.keys(e),o=null==r?void 0:r.channels,s=null==r?void 0:r.audioCodec,l=o&&2===parseInt(o),c=!0,u=!1,d=1/0,h=1/0,p=1/0,f=0,m=[],g=zf(t,a),y=g.preferHDR,v=g.allowedVideoRanges,A=function(){var t=e[n[b]];c=t.channels[2]>0,d=Math.min(d,t.minHeight),h=Math.min(h,t.minFramerate),p=Math.min(p,t.minBitrate);var i=v.filter((function(e){return t.videoRanges[e]>0}));i.length>0&&(u=!0,m=i)},b=n.length;b--;)A();d=Ed(d)?d:0,h=Ed(h)?h:0;var _=Math.max(1080,d),k=Math.max(30,h);p=Ed(p)?p:i,i=Math.max(p,i),u||(t=void 0,m=[]);var w=n.reduce((function(t,r){var a=e[r];if(r===t)return t;if(a.minBitrate>i)return Hf(r,"min bitrate of ".concat(a.minBitrate," > current estimate of ").concat(i)),t;if(!a.hasDefaultAudio)return Hf(r,"no renditions with default or auto-select sound found"),t;if(s&&r.indexOf(s.substring(0,4))%5!=0)return Hf(r,'audio codec preference "'.concat(s,'" not found')),t;if(o&&!l){if(!a.channels[o])return Hf(r,"no renditions with ".concat(o," channel sound found (channels options: ").concat(Object.keys(a.channels),")")),t}else if((!s||l)&&c&&0===a.channels[2])return Hf(r,"no renditions with stereo sound found"),t;return a.minHeight>_?(Hf(r,"min resolution of ".concat(a.minHeight," > maximum of ").concat(_)),t):a.minFramerate>k?(Hf(r,"min framerate of ".concat(a.minFramerate," > maximum of ").concat(k)),t):m.some((function(e){return a.videoRanges[e]>0}))?a.maxScore=fp(t)||a.fragmentError>e[t].fragmentError)?t:(f=a.maxScore,r):(Hf(r,"no variants with VIDEO-RANGE of ".concat(JSON.stringify(m)," found")),t)}),void 0);return{codecSet:w,videoRanges:m,preferHDR:y,minFramerate:h,minBitrate:p}}(x,w,e,T,E),D=R.codecSet,L=R.videoRanges,I=R.minFramerate,P=R.minBitrate,B=R.preferHDR;A=D,w=B?L[L.length-1]:L[0],S=I,e=Math.max(e,P),Ud.log("[abr] picked start tier ".concat(JSON.stringify(R)))}else A=null==b?void 0:b.codecSet,w=null==b?void 0:b.videoRange;for(var M,U,F=p?p.duration:h?h.duration:0,O=this.bwEstimator.getEstimateTTFB()/1e3,N=[],j=function(){var t=m[G],s=G>d;if(!t)return 0;if(v.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){var h=navigator.mediaCapabilities;"function"==typeof(null==h?void 0:h.decodingInfo)&&jf(t,C,w,S,e,T)?(t.supportedPromise=Gf(t,C,h),t.supportedPromise.then((function(e){if(l.hls){t.supportedResult=e;var i=l.hls.levels,r=i.indexOf(t);e.error?Ud.warn('[abr] MediaCapabilities decodingInfo error: "'.concat(e.error,'" for level ').concat(r," ").concat(JSON.stringify(e))):e.supported||(Ud.warn("[abr] Unsupported MediaCapabilities decodingInfo result for level ".concat(r," ").concat(JSON.stringify(e))),r>-1&&i.length>1&&(Ud.log("[abr] Removing unsupported level ".concat(r)),l.hls.removeLevel(r)))}}))):t.supportedResult=Of}if(A&&t.codecSet!==A||w&&t.videoRange!==w||s&&S>t.frameRate||!s&&S>0&&S=2*F&&0===a?m[G].averageBitrate:m[G].maxBitrate,R=l.getTimeToLoadFrag(O,f,x*E,void 0===g);if(f>=x&&(G===u||0===t.loadError&&0===t.fragmentError)&&(R<=O||!Ed(R)||_&&!l.bitrateTestDelay||R").concat(G," adjustedbw(").concat(Math.round(f),")-bitrate=").concat(Math.round(f-x)," ttfb:").concat(O.toFixed(1)," avgDuration:").concat(E.toFixed(1)," maxFetchDuration:").concat(c.toFixed(1)," fetchDuration:").concat(R.toFixed(1)," firstSelection:").concat(k," codecSet:").concat(A," videoRange:").concat(w," hls.loadLevel:").concat(y))),k&&(l.firstSelection=G),G)}}},G=i;G>=t;G--)if(U=j(),0!==U&&U)return U.v;return-1}}])}(),bufferController:function(){function e(t){var i=this;S(this,e),this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=function(e){i.hls&&i.hls.pauseBuffering()},this._onStartStreaming=function(e){i.hls&&i.hls.resumeBuffering()},this._onMediaSourceOpen=function(){var e=i.media,t=i.mediaSource;i.log("Media source opened"),e&&(e.removeEventListener("emptied",i._onMediaEmptied),i.updateMediaElementDuration(),i.hls.trigger(Rd.MEDIA_ATTACHED,{media:e,mediaSource:t})),t&&t.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){i.log("Media source closed")},this._onMediaSourceEnded=function(){i.log("Media source ended")},this._onMediaEmptied=function(){var e=i.mediaSrc,t=i._objectUrl;e!==t&&Ud.error("Media element src was set while attaching MediaSource (".concat(t," > ").concat(e,")"))},this.hls=t;var r="[buffer-controller]";this.appendSource=t.config.preferManagedMediaSource&&"undefined"!=typeof self&&self.ManagedMediaSource,this.log=Ud.log.bind(Ud,r),this.warn=Ud.warn.bind(Ud,r),this.error=Ud.error.bind(Ud,r),this._initSourceBuffer(),this.registerListeners()}return T(e,[{key:"hasSourceTypes",value:function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}},{key:"destroy",value:function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}},{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Rd.BUFFER_RESET,this.onBufferReset,this),e.on(Rd.BUFFER_APPENDING,this.onBufferAppending,this),e.on(Rd.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Rd.BUFFER_EOS,this.onBufferEos,this),e.on(Rd.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Rd.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Rd.FRAG_PARSED,this.onFragParsed,this),e.on(Rd.FRAG_CHANGED,this.onFragChanged,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Rd.BUFFER_RESET,this.onBufferReset,this),e.off(Rd.BUFFER_APPENDING,this.onBufferAppending,this),e.off(Rd.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Rd.BUFFER_EOS,this.onBufferEos,this),e.off(Rd.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Rd.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Rd.FRAG_PARSED,this.onFragParsed,this),e.off(Rd.FRAG_CHANGED,this.onFragChanged,this)}},{key:"_initSourceBuffer",value:function(){this.sourceBuffer={},this.operationQueue=new Hg(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}},{key:"onManifestLoading",value:function(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}},{key:"onManifestParsed",value:function(e,t){var i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.log("".concat(this.bufferCodecEventsExpected," bufferCodec event(s) expected"))}},{key:"onMediaAttaching",value:function(e,t){var i=this.media=t.media,r=lp(this.appendSource);if(i&&r){var a,n=this.mediaSource=new r;this.log("created media source: ".concat(null==(a=n.constructor)?void 0:a.name)),n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming));var o=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{i.removeAttribute("src");var s=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||s&&n instanceof s,Vg(i),function(e,t){var i=self.document.createElement("source");i.type="video/mp4",i.src=t,e.appendChild(i)}(i,o),i.load()}catch(e){i.src=o}else i.src=o;i.addEventListener("emptied",this._onMediaEmptied)}}},{key:"onMediaDetaching",value:function(){var e=this.media,t=this.mediaSource,i=this._objectUrl;if(t){if(this.log("media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){this.warn("onMediaDetaching: ".concat(e.message," while calling endOfStream"))}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),this.mediaSrc===i?(e.removeAttribute("src"),this.appendSource&&Vg(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(Rd.MEDIA_DETACHED,void 0)}},{key:"onBufferReset",value:function(){var e=this;this.getSourceBufferTypes().forEach((function(t){e.resetBuffer(t)})),this._initSourceBuffer()}},{key:"resetBuffer",value:function(e){var t=this.sourceBuffer[e];try{var i;t&&(this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,null!=(i=this.mediaSource)&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t))}catch(t){this.warn("onBufferReset ".concat(e),t)}}},{key:"onBufferCodecs",value:function(e,t){var i=this,r=this.getSourceBufferTypes().length,a=Object.keys(t);if(a.forEach((function(e){if(r){var a=i.tracks[e];if(a&&"function"==typeof a.buffer.changeType){var n,o=t[e],s=o.id,l=o.codec,c=o.levelCodec,u=o.container,d=o.metadata,h=vp(a.codec,a.levelCodec),p=null==h?void 0:h.replace(Wg,"$1"),f=vp(l,c),m=null==(n=f)?void 0:n.replace(Wg,"$1");if(f&&p!==m){"audio"===e.slice(0,5)&&(f=yp(f,i.appendSource));var g="".concat(u,";codecs=").concat(f);i.appendChangeType(e,g),i.log("switching codec ".concat(h," to ").concat(f)),i.tracks[e]={buffer:a.buffer,codec:l,container:u,levelCodec:c,metadata:d,id:s}}}}else i.pendingTracks[e]=t[e]})),!r){var n=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==n&&(this.log("".concat(n," bufferCodec event(s) expected ").concat(a.join(","))),this.bufferCodecEventsExpected=n),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks()}}},{key:"appendChangeType",value:function(e,t){var i=this,r=this.operationQueue,a={execute:function(){var a=i.sourceBuffer[e];a&&(i.log("changing ".concat(e," sourceBuffer type to ").concat(t)),a.changeType(t)),r.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){i.warn("Failed to change ".concat(e," SourceBuffer type"),t)}};r.append(a,e,!!this.pendingTracks[e])}},{key:"onBufferAppending",value:function(e,t){var i=this,r=this.hls,a=this.operationQueue,n=this.tracks,o=t.data,s=t.type,l=t.frag,c=t.part,u=t.chunkMeta,d=u.buffering[s],h=self.performance.now();d.start=h;var p=l.stats.buffering,f=c?c.stats.buffering:null;0===p.start&&(p.start=h),f&&0===f.start&&(f.start=h);var m=n.audio,g=!1;"audio"===s&&"audio/mpeg"===(null==m?void 0:m.container)&&(g=!this.lastMpegAudioChunk||1===u.id||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);var y=l.start,v={execute:function(){if(d.executeStart=self.performance.now(),g){var e=i.sourceBuffer[s];if(e){var t=y-e.timestampOffset;Math.abs(t)>=.1&&(i.log("Updating audio SourceBuffer timestampOffset to ".concat(y," (delta: ").concat(t,") sn: ").concat(l.sn,")")),e.timestampOffset=y)}}i.appendExecutor(o,s)},onStart:function(){},onComplete:function(){var e=self.performance.now();d.executeEnd=d.end=e,0===p.first&&(p.first=e),f&&0===f.first&&(f.first=e);var t=i.sourceBuffer,r={};for(var a in t)r[a]=rm.getBuffered(t[a]);i.appendErrors[s]=0,"audio"===s||"video"===s?i.appendErrors.audiovideo=0:(i.appendErrors.audio=0,i.appendErrors.video=0),i.hls.trigger(Rd.BUFFER_APPENDED,{type:s,frag:l,part:c,chunkMeta:u,parent:l.type,timeRanges:r})},onError:function(e){var t={type:Dd.MEDIA_ERROR,parent:l.type,details:Ld.BUFFER_APPEND_ERROR,sourceBufferName:s,frag:l,part:c,chunkMeta:u,error:e,err:e,fatal:!1};if(e.code===DOMException.QUOTA_EXCEEDED_ERR)t.details=Ld.BUFFER_FULL_ERROR;else{var a=++i.appendErrors[s];t.details=Ld.BUFFER_APPEND_ERROR,i.warn("Failed ".concat(a,"/").concat(r.config.appendErrorMaxRetry,' times to append segment in "').concat(s,'" sourceBuffer')),a>=r.config.appendErrorMaxRetry&&(t.fatal=!0)}r.trigger(Rd.ERROR,t)}};a.append(v,s,!!this.pendingTracks[s])}},{key:"onBufferFlushing",value:function(e,t){var i=this,r=this.operationQueue,a=function(e){return{execute:i.removeExecutor.bind(i,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(Rd.BUFFER_FLUSHED,{type:e})},onError:function(t){i.warn("Failed to remove from ".concat(e," SourceBuffer"),t)}}};t.type?r.append(a(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){r.append(a(e),e)}))}},{key:"onFragParsed",value:function(e,t){var i=this,r=t.frag,a=t.part,n=[],o=a?a.elementaryStreams:r.elementaryStreams;o[Vd]?n.push("audiovideo"):(o[Hd]&&n.push("audio"),o[Wd]&&n.push("video")),0===n.length&&this.warn("Fragments must have at least one ElementaryStreamType set. type: ".concat(r.type," level: ").concat(r.level," sn: ").concat(r.sn)),this.blockBuffers((function(){var e=self.performance.now();r.stats.buffering.end=e,a&&(a.stats.buffering.end=e);var t=a?a.stats:r.stats;i.hls.trigger(Rd.FRAG_BUFFERED,{frag:r,part:a,stats:t,id:r.type})}),n)}},{key:"onFragChanged",value:function(e,t){this.trimBuffers()}},{key:"onBufferEos",value:function(e,t){var i=this;this.getSourceBufferTypes().reduce((function(e,r){var a=i.sourceBuffer[r];return!a||t.type&&t.type!==r||(a.ending=!0,a.ended||(a.ended=!0,i.log("".concat(r," sourceBuffer now EOS")))),e&&!(a&&!a.ended)}),!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){i.getSourceBufferTypes().forEach((function(e){var t=i.sourceBuffer[e];t&&(t.ending=!1)}));var e=i.mediaSource;e&&"open"===e.readyState?(i.log("Calling mediaSource.endOfStream()"),e.endOfStream()):e&&i.log("Could not call mediaSource.endOfStream(). mediaSource.readyState: ".concat(e.readyState))})))}},{key:"onLevelUpdated",value:function(e,t){var i=t.details;i.fragments.length&&(this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}},{key:"trimBuffers",value:function(){var e=this.hls,t=this.details,i=this.media;if(i&&null!==t&&this.getSourceBufferTypes().length){var r=e.config,a=i.currentTime,n=t.levelTargetDuration,o=t.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(Ed(o)&&o>0){var s=Math.max(o,n),l=Math.floor(a/n)*n-s;this.flushBackBuffer(a,n,l)}if(Ed(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){var c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),u=Math.max(c,n),d=Math.floor(a/n)*n+u;this.flushFrontBuffer(a,n,d)}}}},{key:"flushBackBuffer",value:function(e,t,i){var r=this,a=this.details,n=this.sourceBuffer;this.getSourceBufferTypes().forEach((function(o){var s=n[o];if(s){var l=rm.getBuffered(s);if(l.length>0&&i>l.start(0)){if(r.hls.trigger(Rd.BACK_BUFFER_REACHED,{bufferEnd:i}),null!=a&&a.live)r.hls.trigger(Rd.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(s.ended&&l.end(l.length-1)-e<2*t)return void r.log("Cannot flush ".concat(o," back buffer while SourceBuffer is in ended state"));r.hls.trigger(Rd.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:o})}}}))}},{key:"flushFrontBuffer",value:function(e,t,i){var r=this,a=this.sourceBuffer;this.getSourceBufferTypes().forEach((function(n){var o=a[n];if(o){var s=rm.getBuffered(o),l=s.length;if(l<2)return;var c=s.start(l-1),u=s.end(l-1);if(i>c||e>=c&&e<=u)return;if(o.ended&&e-u<2*t)return void r.log("Cannot flush ".concat(n," front buffer while SourceBuffer is in ended state"));r.hls.trigger(Rd.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:n})}}))}},{key:"updateMediaElementDuration",value:function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,i=this.media,r=this.mediaSource,a=e.fragments[0].start+e.totalduration,n=i.duration,o=Ed(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(r.duration=1/0,this.updateSeekableRange(e)):(a>o&&a>n||!Ed(n))&&(this.log("Updating Media Source duration to ".concat(a.toFixed(3))),r.duration=a)}}},{key:"updateSeekableRange",value:function(e){var t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&null!=t&&t.setLiveSeekableRange){var r=Math.max(0,i[0].start),a=Math.max(r,r+e.totalduration);this.log("Media Source duration is set to ".concat(t.duration,". Setting seekable range to ").concat(r,"-").concat(a,".")),t.setLiveSeekableRange(r,a)}}},{key:"checkPendingTracks",value:function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,i=this.pendingTracks,r=Object.keys(i).length;if(r&&(!e||2===r||"audiovideo"in i)){this.createSourceBuffers(i),this.pendingTracks={};var a=this.getSourceBufferTypes();if(a.length)this.hls.trigger(Rd.BUFFER_CREATED,{tracks:this.tracks}),a.forEach((function(e){t.executeNext(e)}));else{var n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}},{key:"createSourceBuffers",value:function(e){var t=this,i=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var a=function(a){if(!i[a]){var n=e[a];if(!n)throw Error("source buffer exists for track ".concat(a,", however track does not"));var o=n.levelCodec||n.codec;o&&"audio"===a.slice(0,5)&&(o=yp(o,t.appendSource));var s="".concat(n.container,";codecs=").concat(o);t.log("creating sourceBuffer(".concat(s,")"));try{var l=i[a]=r.addSourceBuffer(s),c=a;t.addBufferListener(c,"updatestart",t._onSBUpdateStart),t.addBufferListener(c,"updateend",t._onSBUpdateEnd),t.addBufferListener(c,"error",t._onSBUpdateError),t.appendSource&&t.addBufferListener(c,"bufferedchange",(function(e,i){var r=i.removedRanges;null!=r&&r.length&&t.hls.trigger(Rd.BUFFER_FLUSHED,{type:a})})),t.tracks[a]={buffer:l,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(e){t.error("error while trying to add sourceBuffer: ".concat(e.message)),t.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,sourceBufferName:a,mimeType:s})}}};for(var n in e)a(n)}},{key:"mediaSrc",get:function(){var e,t=(null==(e=this.media)?void 0:e.firstChild)||this.media;return null==t?void 0:t.src}},{key:"_onSBUpdateStart",value:function(e){var t=this.operationQueue;t.current(e).onStart()}},{key:"_onSBUpdateEnd",value:function(e){var t;if("closed"!==(null==(t=this.mediaSource)?void 0:t.readyState)){var i=this.operationQueue;i.current(e).onComplete(),i.shiftAndExecuteNext(e)}else this.resetBuffer(e)}},{key:"_onSBUpdateError",value:function(e,t){var i,r=new Error("".concat(e," SourceBuffer error. MediaSource readyState: ").concat(null==(i=this.mediaSource)?void 0:i.readyState));this.error("".concat(r),t),this.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});var a=this.operationQueue.current(e);a&&a.onError(r)}},{key:"removeExecutor",value:function(e,t,i){var r=this.media,a=this.mediaSource,n=this.operationQueue,o=this.sourceBuffer,s=o[e];if(!r||!a||!s)return this.warn("Attempting to remove from the ".concat(e," SourceBuffer, but it does not exist")),void n.shiftAndExecuteNext(e);var l=Ed(r.duration)?r.duration:1/0,c=Ed(a.duration)?a.duration:1/0,u=Math.max(0,t),d=Math.min(i,l,c);d>u&&(!s.ending||s.ended)?(s.ended=!1,this.log("Removing [".concat(u,",").concat(d,"] from the ").concat(e," SourceBuffer")),s.remove(u,d)):n.shiftAndExecuteNext(e)}},{key:"appendExecutor",value:function(e,t){var i=this.sourceBuffer[t];if(i)i.ended=!1,i.appendBuffer(e);else if(!this.pendingTracks[t])throw new Error("Attempting to append to the ".concat(t," SourceBuffer, but it does not exist"))}},{key:"blockBuffers",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getSourceBufferTypes();if(!i.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);var r=this.operationQueue,a=i.map((function(e){return r.appendBlocker(e)}));Promise.all(a).then((function(){e(),i.forEach((function(e){var i=t.sourceBuffer[e];null!=i&&i.updating||r.shiftAndExecuteNext(e)}))}))}},{key:"getSourceBufferTypes",value:function(){return Object.keys(this.sourceBuffer)}},{key:"addBufferListener",value:function(e,t,i){var r=this.sourceBuffer[e];if(r){var a=i.bind(this,e);this.listeners[e].push({event:t,listener:a}),r.addEventListener(t,a)}}},{key:"removeBufferListeners",value:function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))}}])}(),capLevelController:jy,errorController:function(){function e(t){S(this,e),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=t,this.log=Ud.log.bind(Ud,"[info]:"),this.warn=Ud.warn.bind(Ud,"[warning]:"),this.error=Ud.error.bind(Ud,"[error]:"),this.registerListeners()}return T(e,[{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.ERROR,this.onError,this),e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.LEVEL_UPDATED,this.onLevelUpdated,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e&&(e.off(Rd.ERROR,this.onError,this),e.off(Rd.ERROR,this.onErrorOut,this),e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.LEVEL_UPDATED,this.onLevelUpdated,this))}},{key:"destroy",value:function(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}},{key:"startLoad",value:function(e){}},{key:"stopLoad",value:function(){this.playlistError=0}},{key:"getVariantLevelIndex",value:function(e){return(null==e?void 0:e.type)===Up?e.level:this.hls.loadLevel}},{key:"onManifestLoading",value:function(){this.playlistError=0,this.penalizedRenditions={}}},{key:"onLevelUpdated",value:function(){this.playlistError=0}},{key:"onError",value:function(e,t){var i,r;if(!t.fatal){var a=this.hls,n=t.context;switch(t.details){case Ld.FRAG_LOAD_ERROR:case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_ERROR:case Ld.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case Ld.FRAG_PARSING_ERROR:if(null!=(i=t.frag)&&i.gap)return void(t.errorAction={action:xf,flags:If});case Ld.FRAG_GAP:case Ld.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Rf);case Ld.LEVEL_EMPTY_ERROR:case Ld.LEVEL_PARSING_ERROR:var o,s,l=t.parent===Up?t.level:a.loadLevel;return void(t.details===Ld.LEVEL_EMPTY_ERROR&&null!=(o=t.context)&&null!=(s=o.levelDetails)&&s.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l)));case Ld.LEVEL_LOAD_ERROR:case Ld.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==n?void 0:n.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level)));case Ld.AUDIO_TRACK_LOAD_ERROR:case Ld.AUDIO_TRACK_LOAD_TIMEOUT:case Ld.SUBTITLE_LOAD_ERROR:case Ld.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){var c=a.levels[a.loadLevel];if(c&&(n.type===Bp&&c.hasAudioGroup(n.groupId)||n.type===Mp&&c.hasSubtitleGroup(n.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,a.loadLevel),t.errorAction.action=Rf,void(t.errorAction.flags=Pf)}return;case Ld.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var u=a.levels[a.loadLevel],d=null==u?void 0:u.attrs["HDCP-LEVEL"];return void(d?t.errorAction={action:Rf,flags:Bf,hdcpLevel:d}:this.keySystemError(t));case Ld.BUFFER_ADD_CODEC_ERROR:case Ld.REMUX_ALLOC_ERROR:case Ld.BUFFER_APPEND_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(r=t.level)?r:a.loadLevel));case Ld.INTERNAL_EXCEPTION:case Ld.BUFFER_APPENDING_ERROR:case Ld.BUFFER_FULL_ERROR:case Ld.LEVEL_SWITCH_ERROR:case Ld.BUFFER_STALLED_ERROR:case Ld.BUFFER_SEEK_OVER_HOLE:case Ld.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:xf,flags:If})}t.type===Dd.KEY_SYSTEM_ERROR&&this.keySystemError(t)}}},{key:"keySystemError",value:function(e){var t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}},{key:"getPlaylistRetryOrSwitchAction",value:function(e,t){var i=bf(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++;if(wf(i,r,Af(e),e.response))return{action:Lf,flags:If,retryConfig:i,retryCount:r};var a=this.getLevelSwitchAction(e,t);return i&&(a.retryConfig=i,a.retryCount=r),a}},{key:"getFragRetryOrSwitchAction",value:function(e){var t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],a=t.config,n=a.fragLoadPolicy,o=a.keyLoadPolicy,s=bf(e.details.startsWith("key")?o:n,e),l=t.levels.reduce((function(e,t){return e+t.fragmentError}),0);if(r&&(e.details!==Ld.FRAG_GAP&&r.fragmentError++,wf(s,l,Af(e),e.response)))return{action:Lf,flags:If,retryConfig:s,retryCount:l};var c=this.getLevelSwitchAction(e,i);return s&&(c.retryConfig=s,c.retryCount=l),c}},{key:"getLevelSwitchAction",value:function(e,t){var i=this.hls;null==t&&(t=i.loadLevel);var r=this.hls.levels[t];if(r){var a,n,o=e.details;r.loadError++,o===Ld.BUFFER_APPEND_ERROR&&r.fragmentError++;var s=-1,l=i.levels,c=i.loadLevel,u=i.minAutoLevel,d=i.maxAutoLevel;i.autoLevelEnabled||(i.loadLevel=-1);for(var h,p,f,m=null==(a=e.frag)?void 0:a.type,g=(m===Fp&&o===Ld.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(o===Ld.BUFFER_ADD_CODEC_ERROR||o===Ld.BUFFER_APPEND_ERROR))&&l.some((function(e){var t=e.audioCodec;return r.audioCodec!==t})),y="video"===e.sourceBufferName&&(o===Ld.BUFFER_ADD_CODEC_ERROR||o===Ld.BUFFER_APPEND_ERROR)&&l.some((function(e){var t=e.codecSet,i=e.audioCodec;return r.codecSet!==t&&r.audioCodec===i})),v=null!=(n=e.context)?n:{},A=v.type,b=v.groupId,_=function(){var t=(k+c)%l.length;if(t!==c&&t>=u&&t<=d&&0===l[t].loadError){var i=l[t];if(o===Ld.FRAG_GAP&&e.frag){var a=l[t].details;if(a){var n=Tf(e.frag,a.fragments,e.frag.start);if(null!=n&&n.gap)return 0}}else{if(A===Bp&&i.hasAudioGroup(b)||A===Mp&&i.hasSubtitleGroup(b))return 0;if(m===Fp&&null!=(h=r.audioGroups)&&h.some((function(e){return i.hasAudioGroup(e)}))||m===Op&&null!=(p=r.subtitleGroups)&&p.some((function(e){return i.hasSubtitleGroup(e)}))||g&&r.audioCodec===i.audioCodec||!g&&r.audioCodec!==i.audioCodec||y&&r.codecSet===i.codecSet)return 0}return s=t,1}},k=l.length;k--;)if(f=_(),0!==f&&1===f)break;if(s>-1&&i.loadLevel!==s)return e.levelRetry=!0,this.playlistError=0,{action:Rf,flags:If,nextAutoLevel:s}}return{action:Rf,flags:Pf}}},{key:"onErrorOut",value:function(e,t){var i;switch(null==(i=t.errorAction)?void 0:i.action){case xf:break;case Rf:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===Ld.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn('MediaSource ended after "'.concat(t.sourceBufferName,'" sourceBuffer append error. Attempting to recover from media error.')),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}},{key:"sendAlternateToPenaltyBox",value:function(e){var t=this.hls,i=e.errorAction;if(i){var r=i.flags,a=i.hdcpLevel,n=i.nextAutoLevel;switch(r){case If:this.switchLevel(e,n);break;case Bf:a&&(t.maxHdcpLevel=rf[rf.indexOf(a)-1],i.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'.concat(t.maxHdcpLevel,'" or lower'))}i.resolved||this.switchLevel(e,n)}}},{key:"switchLevel",value:function(e,t){void 0!==t&&e.errorAction&&(this.warn("switching to level ".concat(t," after ").concat(e.details)),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}])}(),fpsController:function(){function e(t){S(this,e),this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}return T(e,[{key:"setStreamController",value:function(e){this.streamController=e}},{key:"registerListeners",value:function(){this.hls.on(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this)}},{key:"unregisterListeners",value:function(){this.hls.off(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this)}},{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}},{key:"onMediaAttaching",value:function(e,t){var i=this.hls.config;if(i.capLevelOnFPSDrop){var r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}},{key:"checkFPS",value:function(e,t,i){var r=performance.now();if(t){if(this.lastTime){var a=r-this.lastTime,n=i-this.lastDroppedFrames,o=t-this.lastDecodedFrames,s=1e3*n/a,l=this.hls;if(l.trigger(Rd.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:i}),s>0&&n>l.config.fpsDroppedMonitoringThreshold*o){var c=l.currentLevel;Ud.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=c)&&(c-=1,l.trigger(Rd.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}])}(),stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:uh,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:xv,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:function(e){function t(e,i,r){var a;return S(this,t),a=_(this,t,[e,i,r,"[subtitle-stream-controller]",Op]),a.currentTrackId=-1,a.tracksBuffered=[],a.mainDetails=null,a._registerListeners(),a}return k(t,e),T(t,[{key:"onHandlerDestroying",value:function(){this._unregisterListeners(),b(t,"onHandlerDestroying",this,3)([]),this.mainDetails=null}},{key:"_registerListeners",value:function(){var e=this.hls;e.on(Rd.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Rd.ERROR,this.onError,this),e.on(Rd.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Rd.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Rd.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Rd.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(Rd.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Rd.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(Rd.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Rd.ERROR,this.onError,this),e.off(Rd.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Rd.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(Rd.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Rd.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(Rd.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Rd.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"startLoad",value:function(e){this.stopLoad(),this.state=_m,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}},{key:"onManifestLoading",value:function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}},{key:"onMediaDetaching",value:function(){this.tracksBuffered=[],b(t,"onMediaDetaching",this,3)([])}},{key:"onLevelLoaded",value:function(e,t){this.mainDetails=t.details}},{key:"onSubtitleFragProcessed",value:function(e,t){var i=t.frag,r=t.success;if(this.fragPrevious=i,this.state=_m,r){var a=this.tracksBuffered[this.currentTrackId];if(a){for(var n,o=i.start,s=0;s=a[s].start&&o<=a[s].end){n=a[s];break}var l=i.start+i.duration;n?n.end=l:(n={start:o,end:l},a.push(n)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null)}}}},{key:"onBufferFlushing",value:function(e,t){var i=t.startOffset,r=t.endOffset;if(0===i&&r!==Number.POSITIVE_INFINITY){var a=r-1;if(a<=0)return;t.endOffsetSubtitles=Math.max(0,a),this.tracksBuffered.forEach((function(e){for(var t=0;t=a.length||o!==r)&&s){this.log("Subtitle track ".concat(o," loaded [").concat(n.startSN,",").concat(n.endSN,"]").concat(n.lastPartSn?"[part-".concat(n.lastPartSn,"-").concat(n.lastPartIndex,"]"):"",",duration:").concat(n.totalduration)),this.mediaBuffer=this.mediaBufferTimeRanges;var l=0;if(n.live||null!=(i=s.details)&&i.live){var c=this.mainDetails;if(n.deltaUpdateFailed||!c)return;var u,d=c.fragments[0];s.details?(l=this.alignPlaylists(n,s.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===l&&d&&(l=d.start,mf(n,l))):n.hasProgramDateTime&&c.hasProgramDateTime?(cm(n,c),l=n.fragments[0].start):d&&(l=d.start,mf(n,l))}s.details=n,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(this.mainDetails||n,l),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===_m&&(Tf(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),s.details=void 0))}}else this.warn("Subtitle tracks were reset while loading level ".concat(o))}},{key:"_handleFragmentLoadComplete",value:function(e){var t=this,i=e.frag,r=e.payload,a=i.decryptdata,n=this.hls;if(!this.fragContextChanged(i)&&r&&r.byteLength>0&&null!=a&&a.key&&a.iv&&"AES-128"===a.method){var o=performance.now();this.decrypter.decrypt(new Uint8Array(r),a.key.buffer,a.iv.buffer).catch((function(e){throw n.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:i}),e})).then((function(e){var t=performance.now();n.trigger(Rd.FRAG_DECRYPTED,{frag:i,payload:e,stats:{tstart:o,tdecrypt:t}})})).catch((function(e){t.warn("".concat(e.name,": ").concat(e.message)),t.state=_m}))}}},{key:"doTick",value:function(){if(this.media){if(this.state===_m){var e=this.currentTrackId,t=this.levels,i=null==t?void 0:t[e];if(!i||!t.length||!i.details)return;var r=this.config,a=this.getLoadPosition(),n=rm.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a,r.maxBufferHole),o=n.end,s=n.len,l=this.getFwdBufferInfo(this.media,Up),c=i.details;if(s>this.getMaxBufferLength(null==l?void 0:l.len)+c.levelTargetDuration)return;var u=c.fragments,d=u.length,h=c.edge,p=null,f=this.fragPrevious;if(oh-m?0:m;p=Tf(f,u,Math.max(u[0].start,o),g),!p&&f&&f.start-1&&this.toggleTrackModes()}},{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Rd.LEVEL_LOADING,this.onLevelLoading,this),e.on(Rd.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Rd.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Rd.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(Rd.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Rd.LEVEL_LOADING,this.onLevelLoading,this),e.off(Rd.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Rd.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Rd.ERROR,this.onError,this)}},{key:"onMediaAttached",value:function(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}},{key:"pollTrackChange",value:function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}},{key:"onMediaDetaching",value:function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Jp(this.media.textTracks).forEach((function(e){Wp(e)})),this.subtitleTrack=-1,this.media=null)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}},{key:"onManifestParsed",value:function(e,t){this.tracks=t.subtitleTracks}},{key:"onSubtitleTrackLoaded",value:function(e,t){var i=t.id,r=t.groupId,a=t.details,n=this.tracksInGroup[i];if(n&&n.groupId===r){var o=n.details;n.details=t.details,this.log("Subtitle track ".concat(i,' "').concat(n.name,'" lang:').concat(n.lang," group:").concat(r," loaded [").concat(a.startSN,"-").concat(a.endSN,"]")),i===this.trackId&&this.playlistLoaded(i,t,o)}else this.warn("Subtitle track with id:".concat(i," and group:").concat(r," not found in active group ").concat(null==n?void 0:n.groupId))}},{key:"onLevelLoading",value:function(e,t){this.switchLevel(t.level)}},{key:"onLevelSwitching",value:function(e,t){this.switchLevel(t.level)}},{key:"switchLevel",value:function(e){var t=this.hls.levels[e];if(t){var i=t.subtitleGroups||null,r=this.groupIds,a=this.currentTrack;if(!i||(null==r?void 0:r.length)!==(null==i?void 0:i.length)||null!=i&&i.some((function(e){return-1===(null==r?void 0:r.indexOf(e))}))){this.groupIds=i,this.trackId=-1,this.currentTrack=null;var n=this.tracks.filter((function(e){return!i||-1!==i.indexOf(e.groupId)}));if(n.length)this.selectDefaultTrack&&!n.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),n.forEach((function(e,t){e.id=t}));else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=n;var o=this.hls.config.subtitlePreference;if(!a&&o){this.selectDefaultTrack=!1;var s=Wf(o,n);if(s>-1)a=n[s];else{var l=Wf(o,this.tracks);a=this.tracks[l]}}var c=this.findTrackId(a);-1===c&&a&&(c=this.findTrackId(null));var u={subtitleTracks:n};this.log("Updating subtitle tracks, ".concat(n.length,' track(s) found in "').concat(null==i?void 0:i.join(","),'" group-id')),this.hls.trigger(Rd.SUBTITLE_TRACKS_UPDATED,u),-1!==c&&-1===this.trackId&&this.setSubtitleTrack(c)}else this.shouldReloadPlaylist(a)&&this.setSubtitleTrack(this.trackId)}}},{key:"findTrackId",value:function(e){for(var t=this.tracksInGroup,i=this.selectDefaultTrack,r=0;r-1){var a=this.tracksInGroup[r];return this.setSubtitleTrack(r),a}if(i)return null;var n=Wf(e,t);if(n>-1)return t[n]}}return null}},{key:"loadPlaylist",value:function(e){b(t,"loadPlaylist",this,3)([]);var i=this.currentTrack;if(this.shouldLoadPlaylist(i)&&i){var r=i.id,a=i.groupId,n=i.url;if(e)try{n=e.addDirectives(n)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: ".concat(e))}this.log("Loading subtitle playlist for id ".concat(r)),this.hls.trigger(Rd.SUBTITLE_TRACK_LOADING,{url:n,id:r,groupId:a,deliveryDirectives:e||null})}}},{key:"toggleTrackModes",value:function(){var e=this.media;if(e){var t,i=Jp(e.textTracks),r=this.currentTrack;if(r&&(t=i.filter((function(e){return Gg(r,e)}))[0],t||this.warn('Unable to find subtitle TextTrack with name "'.concat(r.name,'" and language "').concat(r.lang,'"'))),[].slice.call(i).forEach((function(e){"disabled"!==e.mode&&e!==t&&(e.mode="disabled")})),t){var a=this.subtitleDisplay?"showing":"hidden";t.mode!==a&&(t.mode=a)}}}},{key:"setSubtitleTrack",value:function(e){var t=this.tracksInGroup;if(this.media)if(e<-1||e>=t.length||!Ed(e))this.warn("Invalid subtitle track id: ".concat(e));else{this.clearTimer(),this.selectDefaultTrack=!1;var i=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),r){var a=!!r.details&&!r.details.live;if(e!==this.trackId||r!==i||!a){this.log("Switching to subtitle-track ".concat(e)+(r?' "'.concat(r.name,'" lang:').concat(r.lang," group:").concat(r.groupId):""));var n=r.id,o=r.groupId,s=void 0===o?"":o,l=r.name,c=r.type,u=r.url;this.hls.trigger(Rd.SUBTITLE_TRACK_SWITCH,{id:n,groupId:s,name:l,type:c,url:u});var d=this.switchParams(r.url,null==i?void 0:i.details);this.loadPlaylist(d)}}else this.hls.trigger(Rd.SUBTITLE_TRACK_SWITCH,{id:e})}else this.queuedDefaultTrack=e}}])}(Mf),timelineController:function(){function e(t){S(this,e),this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},t.on(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Rd.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(Rd.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(Rd.FRAG_LOADING,this.onFragLoading,this),t.on(Rd.FRAG_LOADED,this.onFragLoaded,this),t.on(Rd.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(Rd.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(Rd.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(Rd.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(Rd.BUFFER_FLUSHING,this.onBufferFlushing,this)}return T(e,[{key:"destroy",value:function(){var e=this.hls;e.off(Rd.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Rd.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Rd.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Rd.FRAG_LOADING,this.onFragLoading,this),e.off(Rd.FRAG_LOADED,this.onFragLoaded,this),e.off(Rd.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Rd.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Rd.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Rd.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(Rd.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}},{key:"initCea608Parsers",value:function(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){var e=new dy(this,"textTrack1"),t=new dy(this,"textTrack2"),i=new dy(this,"textTrack3"),r=new dy(this,"textTrack4");this.cea608Parser1=new ly(1,e,t),this.cea608Parser2=new ly(3,i,r)}}},{key:"addCues",value:function(e,t,i,r,a){for(var n,o,s,l,c=!1,u=a.length;u--;){var d=a[u],h=(n=d[0],o=d[1],s=t,l=i,Math.min(o,l)-Math.max(n,s));if(h>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],i),c=!0,h/(i-t)>.5))return}if(c||a.push([t,i]),this.config.renderTextTracksNatively){var p=this.captionsTracks[e];this.Cues.newCue(p,t,i,r)}else{var f=this.Cues.newCue(null,t,i,r);this.hls.trigger(Rd.CUES_PARSED,{type:"captions",cues:f,track:e})}}},{key:"onInitPtsFound",value:function(e,t){var i=this,r=t.frag,a=t.id,n=t.initPTS,o=t.timescale,s=this.unparsedVttFrags;"main"===a&&(this.initPTS[r.cc]={baseTime:n,timescale:o}),s.length&&(this.unparsedVttFrags=[],s.forEach((function(e){i.onFragLoaded(Rd.FRAG_LOADED,e)})))}},{key:"getExistingTrack",value:function(e,t){var i=this.media;if(i)for(var r=0;rr.cc||l.trigger(Rd.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:t})}))}else o.push(e)}},{key:"_fallbackToIMSC1",value:function(e,t){var i=this,r=this.tracks[e.level];r.textCodec||Ly(t,this.initPTS[e.cc],(function(){r.textCodec=Cy,i._parseIMSC1(e,t)}),(function(){r.textCodec="wvtt"}))}},{key:"_appendCues",value:function(e,t){var i=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[t];if(!r||"disabled"===r.mode)return;e.forEach((function(e){return Hp(r,e)}))}else{var a=this.tracks[t];if(!a)return;var n=a.default?"default":"subtitles"+t;i.trigger(Rd.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}},{key:"onFragDecrypted",value:function(e,t){var i=t.frag;i.type===Op&&this.onFragLoaded(Rd.FRAG_LOADED,t)}},{key:"onSubtitleTracksCleared",value:function(){this.tracks=[],this.captionsTracks={}}},{key:"onFragParsingUserdata",value:function(e,t){this.initCea608Parsers();var i=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&i&&r){var a=t.frag,n=t.samples;if(a.type!==Up||"NONE"!==this.closedCaptionsForLevel(a))for(var o=0;o0&&-1===e?(this.log("Override startPosition with lastCurrentTime @".concat(t.toFixed(3))),e=t,this.state=_m):(this.loadedmetadata=!1,this.state=Tm),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}},{key:"doTick",value:function(){switch(this.state){case _m:this.doTickIdle();break;case Tm:var e,i=this.levels,r=this.trackId,a=null==i||null==(e=i[r])?void 0:e.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=Dm}break;case Sm:var n,o=performance.now(),s=this.retryDate;if(!s||o>=s||null!=(n=this.media)&&n.seeking){var l=this.levels,c=this.trackId;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((null==l?void 0:l[c])||null),this.state=_m}break;case Dm:var u=this.waitingData;if(u){var d=u.frag,h=u.part,p=u.cache,f=u.complete;if(void 0!==this.initPTS[d.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=wm;var m={frag:d,part:h,payload:p.flush(),networkDetails:null};this._handleFragmentLoadProgress(m),f&&b(t,"_handleFragmentLoadComplete",this,3)([m])}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc (".concat(d.cc,") cancelled because video is at cc ").concat(this.videoTrackCC)),this.clearWaitingFragment();else{var g=this.getLoadPosition(),y=rm.bufferInfo(this.mediaBuffer,g,this.config.maxBufferHole);Ef(y.end,this.config.maxFragLookUpTolerance,d)<0&&(this.log("Waiting fragment cc (".concat(d.cc,") @ ").concat(d.start," cancelled because another fragment at ").concat(y.end," is needed")),this.clearWaitingFragment())}}else this.state=_m}this.onTickEnd()}},{key:"clearWaitingFragment",value:function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=_m)}},{key:"resetLoadingState",value:function(){this.clearWaitingFragment(),b(t,"resetLoadingState",this,3)([])}},{key:"onTickEnd",value:function(){var e=this.media;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}},{key:"doTickIdle",value:function(){var e=this.hls,t=this.levels,i=this.media,r=this.trackId,a=e.config;if((i||!this.startFragRequested&&a.startFragPrefetch)&&null!=t&&t[r]){var n=t[r],o=n.details;if(!o||o.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(o))this.state=Tm;else{var s=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&s&&(this.bufferFlushed=!1,this.afterBufferFlushed(s,Hd,Fp));var l=this.getFwdBufferInfo(s,Fp);if(null!==l){var c=this.bufferedTrack,u=this.switchingTrack;if(!u&&this._streamEnded(l,o))return e.trigger(Rd.BUFFER_EOS,{type:"audio"}),void(this.state=xm);var d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Up),h=l.len,p=this.getMaxBufferLength(null==d?void 0:d.len),f=o.fragments,m=f[0].start,g=this.flushing?this.getLoadPosition():l.end;if(u&&i){var y=this.getLoadPosition();c&&!jg(u.attrs,c.attrs)&&(g=y),o.PTSKnown&&ym||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=m+.05)}if(!(h>=p&&!u&&gd.end+o.targetduration;if(b||(null==d||!d.len)&&l.len){var _=this.getAppendedFrag(v.start,Up);if(null===_)return;if(A||(A=!!_.gap||!!b&&0===d.len),b&&!A||A&&l.nextStart&&l.nextStart<_.end)return}this.loadFragment(v,n,g)}else this.bufferFlushed=!0}}}}}},{key:"getMaxBufferLength",value:function(e){var i=b(t,"getMaxBufferLength",this,3)([]);return e?Math.min(Math.max(i,e),this.config.maxMaxBufferLength):i}},{key:"onMediaDetaching",value:function(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,b(t,"onMediaDetaching",this,3)([])}},{key:"onAudioTracksUpdated",value:function(e,t){var i=t.audioTracks;this.resetTransmuxer(),this.levels=i.map((function(e){return new cf(e)}))}},{key:"onAudioTrackSwitching",value:function(e,t){var i=!!t.url;this.trackId=t.id;var r=this.fragCurrent;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=_m,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=bm),this.tick()}},{key:"onManifestLoading",value:function(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}},{key:"onLevelLoaded",value:function(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(Rd.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}},{key:"onAudioTrackLoaded",value:function(e,t){var i;if(null!=this.mainDetails){var r=this.levels,a=t.details,n=t.id;if(r){this.log("Audio track ".concat(n," loaded [").concat(a.startSN,",").concat(a.endSN,"]").concat(a.lastPartSn?"[part-".concat(a.lastPartSn,"-").concat(a.lastPartIndex,"]"):"",",duration:").concat(a.totalduration));var o=r[n],s=0;if(a.live||null!=(i=o.details)&&i.live){this.checkLiveUpdate(a);var l,c=this.mainDetails;if(a.deltaUpdateFailed||!c)return;!o.details&&a.hasProgramDateTime&&c.hasProgramDateTime?(cm(a,c),s=a.fragments[0].start):s=this.alignPlaylists(a,o.details,null==(l=this.levelLastLoaded)?void 0:l.details)}o.details=a,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(this.mainDetails||a,s),this.state!==Tm||this.waitForCdnTuneIn(a)||(this.state=_m),this.tick()}else this.warn("Audio tracks were reset while loading level ".concat(n))}else this.cachedTrackLoadedData=t}},{key:"_handleFragmentLoadProgress",value:function(e){var t,i=e.frag,r=e.part,a=e.payload,n=this.config,o=this.trackId,s=this.levels;if(s){var l=s[o];if(l){var c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);var u=n.defaultAudioCodec||l.audioCodec||"mp4a.40.2",d=this.transmuxer;d||(d=this.transmuxer=new Og(this.hls,Fp,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var h=this.initPTS[i.cc],p=null==(t=i.initSegment)?void 0:t.data;if(void 0!==h){var f=!1,m=r?r.index:-1,g=-1!==m,y=new am(i.level,i.sn,i.stats.chunkCount,a.byteLength,m,g);d.push(a,p,u,"",i,r,c.totalduration,f,y,h)}else{this.log("Unknown video PTS for cc ".concat(i.cc,", waiting for video PTS before demuxing audio frag ").concat(i.sn," of [").concat(c.startSN," ,").concat(c.endSN,"],track ").concat(o));var v=this.waitingData=this.waitingData||{frag:i,part:r,cache:new Pm,complete:!1},A=v.cache;A.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=Dm}}else this.warn("Audio track is undefined on fragment load progress")}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment ".concat(i.sn," of level ").concat(i.level," will not be buffered"))}},{key:"_handleFragmentLoadComplete",value:function(e){this.waitingData?this.waitingData.complete=!0:b(t,"_handleFragmentLoadComplete",this,3)([e])}},{key:"onBufferReset",value:function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}},{key:"onBufferCreated",value:function(e,t){var i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}},{key:"onFragBuffered",value:function(e,t){var i=t.frag,r=t.part;if(i.type===Fp)if(this.fragContextChanged(i))this.warn("Fragment ".concat(i.sn).concat(r?" p: "+r.index:""," of level ").concat(i.level," finished buffering, but was aborted. state: ").concat(this.state,", audioSwitch: ").concat(this.switchingTrack?this.switchingTrack.name:"false"));else{if("initSegment"!==i.sn){this.fragPrevious=i;var a=this.switchingTrack;a&&(this.bufferedTrack=a,this.switchingTrack=null,this.hls.trigger(Rd.AUDIO_TRACK_SWITCHED,kd({},a)))}this.fragBufferedComplete(i,r)}else if(!this.loadedmetadata&&i.type===Up){var n=this.videoBuffer||this.media;n&&rm.getBuffered(n).length&&(this.loadedmetadata=!0)}}},{key:"onError",value:function(e,i){var r;if(i.fatal)this.state=Rm;else switch(i.details){case Ld.FRAG_GAP:case Ld.FRAG_PARSING_ERROR:case Ld.FRAG_DECRYPT_ERROR:case Ld.FRAG_LOAD_ERROR:case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_ERROR:case Ld.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Fp,i);break;case Ld.AUDIO_TRACK_LOAD_ERROR:case Ld.AUDIO_TRACK_LOAD_TIMEOUT:case Ld.LEVEL_PARSING_ERROR:i.levelRetry||this.state!==Tm||(null==(r=i.context)?void 0:r.type)!==Bp||(this.state=_m);break;case Ld.BUFFER_APPEND_ERROR:case Ld.BUFFER_FULL_ERROR:if(!i.parent||"audio"!==i.parent)return;if(i.details===Ld.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(i)&&(this.bufferedTrack=null,b(t,"flushMainBuffer",this,3)([0,Number.POSITIVE_INFINITY,"audio"]));break;case Ld.INTERNAL_EXCEPTION:this.recoverWorkerError(i)}}},{key:"onBufferFlushing",value:function(e,t){var i=t.type;i!==Wd&&(this.flushing=!0)}},{key:"onBufferFlushed",value:function(e,t){var i=t.type;if(i!==Wd){this.flushing=!1,this.bufferFlushed=!0,this.state===xm&&(this.state=_m);var r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,i,Fp),this.tick())}}},{key:"_handleTransmuxComplete",value:function(e){var t,i="audio",r=this.hls,a=e.remuxResult,n=e.chunkMeta,o=this.getCurrentContext(n);if(o){var s=o.frag,l=o.part,c=o.level,u=c.details,d=a.audio,h=a.text,p=a.id3,f=a.initSegment;if(!this.fragContextChanged(s)&&u){if(this.state=Em,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=f&&f.tracks){var m=s.initSegment||s;this._bufferInitSegment(c,f.tracks,m,n),r.trigger(Rd.FRAG_PARSING_INIT_SEGMENT,{frag:m,id:i,tracks:f.tracks})}if(d){var g=d.startPTS,y=d.endPTS,v=d.startDTS,A=d.endDTS;l&&(l.elementaryStreams[Hd]={startPTS:g,endPTS:y,startDTS:v,endDTS:A}),s.setElementaryStreamInfo(Hd,g,y,v,A),this.bufferFragmentData(d,s,l,n)}if(null!=p&&null!=(t=p.samples)&&t.length){var b=Td({id:i,frag:s,details:u},p);r.trigger(Rd.FRAG_PARSING_METADATA,b)}if(h){var _=Td({id:i,frag:s,details:u},h);r.trigger(Rd.FRAG_PARSING_USERDATA,_)}}else this.fragmentTracker.removeFragment(s)}else this.resetWhenMissingContext(n)}},{key:"_bufferInitSegment",value:function(e,t,i,r){if(this.state===Em){t.video&&delete t.video;var a=t.audio;if(a){a.id="audio";var n=e.audioCodec;this.log("Init audio buffer, container:".concat(a.container,", codecs[level/parsed]=[").concat(n,"/").concat(a.codec,"]")),n&&1===n.split(",").length&&(a.levelCodec=n),this.hls.trigger(Rd.BUFFER_CODECS,t);var o=a.initSegment;if(null!=o&&o.byteLength){var s={type:"audio",frag:i,part:null,chunkMeta:r,parent:i.type,data:o};this.hls.trigger(Rd.BUFFER_APPENDING,s)}this.tickImmediate()}}}},{key:"loadFragment",value:function(e,i,r){var a,n=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||n===Yf||n===Xf)if("initSegment"===e.sn)this._loadInitSegment(e,i);else if(null!=(a=i.details)&&a.live&&!this.initPTS[e.cc]){this.log("Waiting for video PTS in continuity counter ".concat(e.cc," of live stream before loading audio fragment ").concat(e.sn," of level ").concat(this.trackId)),this.state=Dm;var o=this.mainDetails;o&&o.fragments[0].start!==i.details.fragments[0].start&&cm(i.details,o)}else this.startFragRequested=!0,b(t,"loadFragment",this,3)([e,i,r]);else this.clearTrackerIfNeeded(e)}},{key:"flushAudioIfNeeded",value:function(e){var i=this.media,r=this.bufferedTrack,a=null==r?void 0:r.attrs,n=e.attrs;i&&a&&(a.CHANNELS!==n.CHANNELS||r.name!==e.name||r.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),b(t,"flushMainBuffer",this,3)([0,Number.POSITIVE_INFINITY,"audio"]),this.bufferedTrack=null)}},{key:"completeAudioSwitch",value:function(e){var t=this.hls;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(Rd.AUDIO_TRACK_SWITCHED,kd({},e))}}])}(Im),audioTrackController:function(e){function t(e){var i;return S(this,t),i=_(this,t,[e,"[audio-track-controller]"]),i.tracks=[],i.groupIds=null,i.tracksInGroup=[],i.trackId=-1,i.currentTrack=null,i.selectDefaultTrack=!0,i.registerListeners(),i}return k(t,e),T(t,[{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Rd.LEVEL_LOADING,this.onLevelLoading,this),e.on(Rd.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Rd.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Rd.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Rd.LEVEL_LOADING,this.onLevelLoading,this),e.off(Rd.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Rd.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Rd.ERROR,this.onError,this)}},{key:"destroy",value:function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,b(t,"destroy",this,3)([])}},{key:"onManifestLoading",value:function(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}},{key:"onManifestParsed",value:function(e,t){this.tracks=t.audioTracks||[]}},{key:"onAudioTrackLoaded",value:function(e,t){var i=t.id,r=t.groupId,a=t.details,n=this.tracksInGroup[i];if(n&&n.groupId===r){var o=n.details;n.details=t.details,this.log("Audio track ".concat(i,' "').concat(n.name,'" lang:').concat(n.lang," group:").concat(r," loaded [").concat(a.startSN,"-").concat(a.endSN,"]")),i===this.trackId&&this.playlistLoaded(i,t,o)}else this.warn("Audio track with id:".concat(i," and group:").concat(r," not found in active group ").concat(null==n?void 0:n.groupId))}},{key:"onLevelLoading",value:function(e,t){this.switchLevel(t.level)}},{key:"onLevelSwitching",value:function(e,t){this.switchLevel(t.level)}},{key:"switchLevel",value:function(e){var t=this.hls.levels[e];if(t){var i=t.audioGroups||null,r=this.groupIds,a=this.currentTrack;if(!i||(null==r?void 0:r.length)!==(null==i?void 0:i.length)||null!=i&&i.some((function(e){return-1===(null==r?void 0:r.indexOf(e))}))){this.groupIds=i,this.trackId=-1,this.currentTrack=null;var n=this.tracks.filter((function(e){return!i||-1!==i.indexOf(e.groupId)}));if(n.length)this.selectDefaultTrack&&!n.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),n.forEach((function(e,t){e.id=t}));else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=n;var o=this.hls.config.audioPreference;if(!a&&o){var s=Wf(o,n,Jf);if(s>-1)a=n[s];else{var l=Wf(o,this.tracks);a=this.tracks[l]}}var c=this.findTrackId(a);-1===c&&a&&(c=this.findTrackId(null));var u={audioTracks:n};this.log("Updating audio tracks, ".concat(n.length," track(s) found in group(s): ").concat(null==i?void 0:i.join(","))),this.hls.trigger(Rd.AUDIO_TRACKS_UPDATED,u);var d=this.trackId;if(-1!==c&&-1===d)this.setAudioTrack(c);else if(n.length&&-1===d){var h,p=new Error("No audio track selected for current audio group-ID(s): ".concat(null==(h=this.groupIds)?void 0:h.join(",")," track count: ").concat(n.length));this.warn(p.message),this.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:p})}}else this.shouldReloadPlaylist(a)&&this.setAudioTrack(this.trackId)}}},{key:"onError",value:function(e,t){!t.fatal&&t.context&&(t.context.type!==Bp||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||(this.requestScheduled=-1,this.checkRetry(t)))}},{key:"allAudioTracks",get:function(){return this.tracks}},{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}},{key:"setAudioOption",value:function(e){var t=this.hls;if(t.config.audioPreference=e,e){var i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){var r=this.currentTrack;if(r&&Vf(e,r,Jf))return r;var a=Wf(e,this.tracksInGroup,Jf);if(a>-1){var n=this.tracksInGroup[a];return this.setAudioTrack(a),n}if(r){var o=t.loadLevel;-1===o&&(o=t.firstAutoLevel);var s=function(e,t,i,r,a){var n=t[r],o=t.reduce((function(e,t,i){var r=t.uri;return(e[r]||(e[r]=[])).push(i),e}),{})[n.uri];o.length>1&&(r=Math.max.apply(Math,o));var s=n.videoRange,l=n.frameRate,c=n.codecSet.substring(0,4),u=qf(t,r,(function(t){if(t.videoRange!==s||t.frameRate!==l||t.codecSet.substring(0,4)!==c)return!1;var r=t.audioGroups,n=i.filter((function(e){return!r||-1!==r.indexOf(e.groupId)}));return Wf(e,n,a)>-1}));return u>-1?u:qf(t,r,(function(t){var r=t.audioGroups,n=i.filter((function(e){return!r||-1!==r.indexOf(e.groupId)}));return Wf(e,n,a)>-1}))}(e,t.levels,i,o,Jf);if(-1===s)return null;t.nextLoadLevel=s}if(e.channels||e.audioCodec){var l=Wf(e,i);if(l>-1)return i[l]}}}return null}},{key:"setAudioTrack",value:function(e){var t=this.tracksInGroup;if(e<0||e>=t.length)this.warn("Invalid audio track id: ".concat(e));else{this.clearTimer(),this.selectDefaultTrack=!1;var i=this.currentTrack,r=t[e],a=r.details&&!r.details.live;if((e!==this.trackId||r!==i||!a)&&(this.log("Switching to audio-track ".concat(e,' "').concat(r.name,'" lang:').concat(r.lang," group:").concat(r.groupId," channels:").concat(r.channels)),this.trackId=e,this.currentTrack=r,this.hls.trigger(Rd.AUDIO_TRACK_SWITCHING,kd({},r)),!a)){var n=this.switchParams(r.url,null==i?void 0:i.details);this.loadPlaylist(n)}}}},{key:"findTrackId",value:function(e){for(var t=this.tracksInGroup,i=0;i1&&void 0!==arguments[1]?arguments[1]:{};Td(t,this.createData());var i=t.ot===Hy.INIT||t.ot===Hy.VIDEO||t.ot===Hy.MUXED;this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);var r=this.includeKeys;r&&(t=Object.keys(t).reduce((function(e,i){return r.includes(i)&&(e[i]=t[i]),e}),{})),this.useHeaders?(e.headers||(e.headers={}),mv(e.headers,t)):e.url=yv(e.url,t)}},{key:"getObjectType",value:function(e){var t=e.type;return"subtitle"===t?Hy.TIMED_TEXT:"initSegment"===e.sn?Hy.INIT:"audio"===t?Hy.AUDIO:"main"===t?this.hls.audioTracks.length?Hy.VIDEO:Hy.MUXED:void 0}},{key:"getTopBandwidth",value:function(e){var t,i=0,r=this.hls;if(e===Hy.AUDIO)t=r.audioTracks;else{var a=r.maxAutoLevel,n=a>-1?a+1:r.levels.length;t=r.levels.slice(0,n)}var o,s=f(t);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.bitrate>i&&(i=l.bitrate)}}catch(c){s.e(c)}finally{s.f()}return i>0?i:NaN}},{key:"getBufferLength",value:function(e){var t=this.hls.media,i=e===Hy.AUDIO?this.audioBuffer:this.videoBuffer;return i&&t?1e3*rm.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len:NaN}},{key:"createPlaylistLoader",value:function(){var e=this.config.pLoader,t=this.applyPlaylistData,i=e||this.config.loader;return function(){function e(t){S(this,e),this.loader=void 0,this.loader=new i(t)}return T(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}},{key:"destroy",value:function(){this.loader.destroy()}},{key:"abort",value:function(){this.loader.abort()}},{key:"load",value:function(e,i,r){t(e),this.loader.load(e,i,r)}}])}()}},{key:"createFragmentLoader",value:function(){var e=this.config.fLoader,t=this.applyFragmentData,i=e||this.config.loader;return function(){function e(t){S(this,e),this.loader=void 0,this.loader=new i(t)}return T(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}},{key:"destroy",value:function(){this.loader.destroy()}},{key:"abort",value:function(){this.loader.abort()}},{key:"load",value:function(e,i,r){t(e),this.loader.load(e,i,r)}}])}()}}])}(),contentSteeringController:function(){function e(t){S(this,e),this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=t,this.log=Ud.log.bind(Ud,"[content-steering]:"),this.registerListeners()}return T(e,[{key:"registerListeners",value:function(){var e=this.hls;e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Rd.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e&&(e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Rd.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Rd.ERROR,this.onError,this))}},{key:"startLoad",value:function(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){var e=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}},{key:"stopLoad",value:function(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}},{key:"clearTimeout",value:function(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}},{key:"destroy",value:function(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}},{key:"removeLevel",value:function(e){var t=this.levels;t&&(this.levels=t.filter((function(t){return t!==e})))}},{key:"onManifestLoading",value:function(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}},{key:"onManifestLoaded",value:function(e,t){var i=t.contentSteering;null!==i&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}},{key:"onManifestParsed",value:function(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}},{key:"onError",value:function(e,t){var i=t.errorAction;if((null==i?void 0:i.action)===Rf&&i.flags===Pf){var r=this.levels,a=this.pathwayPriority,n=this.pathwayId;if(t.context){var o=t.context,s=o.groupId,l=o.pathwayId,c=o.type;s&&r?n=this.getPathwayForGroupId(s,c,n):l&&(n=l)}n in this.penalizedPathways||(this.penalizedPathways[n]=performance.now()),!a&&r&&(a=r.reduce((function(e,t){return-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e}),[])),a&&a.length>1&&(this.updatePathwayPriority(a),i.resolved=this.pathwayId!==n),i.resolved||Ud.warn("Could not resolve ".concat(t.details,' ("').concat(t.error.message,'") with content-steering for Pathway: ').concat(n," levels: ").concat(r?r.length:r," priorities: ").concat(JSON.stringify(a)," penalized: ").concat(JSON.stringify(this.penalizedPathways)))}}},{key:"filterParsedLevels",value:function(e){this.levels=e;var t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){var i=e[0].pathwayId;this.log("No levels found in Pathway ".concat(this.pathwayId,'. Setting initial Pathway to "').concat(i,'"')),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log("Found ".concat(t.length,"/").concat(e.length,' levels in Pathway "').concat(this.pathwayId,'"')),t):e}},{key:"getLevelsForPathway",value:function(e){return null===this.levels?[]:this.levels.filter((function(t){return e===t.pathwayId}))}},{key:"updatePathwayPriority",value:function(e){var t;this.pathwayPriority=e;var i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach((function(e){r-i[e]>3e5&&delete i[e]}));for(var a=0;a0){this.log('Setting Pathway to "'.concat(n,'"')),this.pathwayId=n,vf(t),this.hls.trigger(Rd.LEVELS_UPDATED,{levels:t});var l=this.hls.levels[o];s&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==s.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==s.bitrate&&this.log("Unstable Pathways change from bitrate ".concat(s.bitrate," to ").concat(l.bitrate)),this.hls.nextLoadLevel=o);break}}}}},{key:"getPathwayForGroupId",value:function(e,t,i){for(var r=this.getLevelsForPathway(i).concat(this.levels||[]),a=0;a1&&void 0!==arguments[1]?arguments[1]:1e3*this.timeToLoad;this.clearTimeout(),this.reloadTimer=self.setTimeout((function(){var i,r=null==(i=t.hls)?void 0:i.media;!r||r.ended?t.scheduleRefresh(e,1e3*t.timeToLoad):t.loadSteeringManifest(e)}),i)}}])}()});function Dv(e){return e&&"object"==E(e)?Array.isArray(e)?e.map(Dv):Object.keys(e).reduce((function(t,i){return t[i]=Dv(e[i]),t}),{}):e}function Lv(e){var t=e.loader;t!==wv&&t!==_v?(Ud.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}()&&(e.loader=wv,e.progressive=!0,e.enableSoftwareAES=!0,Ud.log("[config]: Progressive streaming enabled, using FetchLoader"))}var Iv=function(e){function t(e,i){var r;return S(this,t),r=_(this,t,[e,"[level-controller]"]),r._levels=[],r._firstLevel=-1,r._maxAutoLevel=-1,r._startLevel=void 0,r.currentLevel=null,r.currentLevelIndex=-1,r.manualLevelIndex=-1,r.steering=void 0,r.onParsedComplete=void 0,r.steering=i,r._registerListeners(),r}return k(t,e),T(t,[{key:"_registerListeners",value:function(){var e=this.hls;e.on(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Rd.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Rd.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Rd.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Rd.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Rd.ERROR,this.onError,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(Rd.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Rd.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Rd.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Rd.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Rd.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Rd.ERROR,this.onError,this)}},{key:"destroy",value:function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),b(t,"destroy",this,3)([])}},{key:"stopLoad",value:function(){this._levels.forEach((function(e){e.loadError=0,e.fragmentError=0})),b(t,"stopLoad",this,3)([])}},{key:"resetLevels",value:function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}},{key:"onManifestLoading",value:function(e,t){this.resetLevels()}},{key:"onManifestLoaded",value:function(e,t){var i=this.hls.config.preferManagedMediaSource,r=[],a={},n={},o=!1,s=!1,l=!1;t.levels.forEach((function(e){var t,c,u=e.attrs,d=e.audioCodec,h=e.videoCodec;-1!==(null==(t=d)?void 0:t.indexOf("mp4a.40.34"))&&(Tv||(Tv=/chrome|firefox/i.test(navigator.userAgent)),Tv&&(e.audioCodec=d=void 0)),d&&(e.audioCodec=d=yp(d,i)),0===(null==(c=h)?void 0:c.indexOf("avc1"))&&(h=e.videoCodec=function(e){var t=e.split(".");if(t.length>2){var i=t.shift()+".";return i+=parseInt(t.shift()).toString(16),i+=("000"+parseInt(t.shift()).toString(16)).slice(-4),i}return e}(h));var p=e.width,f=e.height,m=e.unknownCodecs;if(o||(o=!(!p||!f)),s||(s=!!h),l||(l=!!d),!(null!=m&&m.length||d&&!up(d,"audio",i)||h&&!up(h,"video",i))){var g=u.CODECS,y=u["FRAME-RATE"],v=u["HDCP-LEVEL"],A=u["PATHWAY-ID"],b=u.RESOLUTION,_=u["VIDEO-RANGE"],k="".concat("".concat(A||".","-"),e.bitrate,"-").concat(b,"-").concat(y,"-").concat(g,"-").concat(_,"-").concat(v);if(a[k])if(a[k].uri===e.url||e.attrs["PATHWAY-ID"])a[k].addGroupId("audio",u.AUDIO),a[k].addGroupId("text",u.SUBTITLES);else{var w=n[k]+=1;e.attrs["PATHWAY-ID"]=new Array(w+1).join(".");var S=new cf(e);a[k]=S,r.push(S)}else{var T=new cf(e);a[k]=T,n[k]=1,r.push(T)}}})),this.filterAndSortMediaOptions(r,t,o,s,l)}},{key:"filterAndSortMediaOptions",value:function(e,t,i,r,a){var n=this,o=[],s=[],l=e;if((i||r)&&a&&(l=l.filter((function(e){var t,i=e.videoCodec,r=e.videoRange,a=e.width,n=e.height;return(!!i||!(!a||!n))&&!!(t=r)&&af.indexOf(t)>-1}))),0!==l.length){if(t.audioTracks){var c=this.hls.config.preferManagedMediaSource;o=t.audioTracks.filter((function(e){return!e.audioCodec||up(e.audioCodec,"audio",c)})),Pv(o)}t.subtitles&&(s=t.subtitles,Pv(s));var u=l.slice(0);l.sort((function(e,t){if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return af.indexOf(e.videoRange)-af.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){var r=pp(e.videoCodec),a=pp(t.videoCodec);if(r!==a)return a-r}if(e.uri===t.uri&&e.codecSet!==t.codecSet){var n=fp(e.codecSet),o=fp(t.codecSet);if(n!==o)return o-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));var d=u[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==u.length))for(var h=0;hg&&g===Rv.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=y)}break}var v=a&&!r,A={levels:l,audioTracks:o,subtitleTracks:s,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:r,altAudio:!v&&o.some((function(e){return!!e.url}))};this.hls.trigger(Rd.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else Promise.resolve().then((function(){if(n.hls){t.levels.length&&n.warn("One or more CODECS in variant not supported: ".concat(JSON.stringify(t.levels[0].attrs)));var e=new Error("no level with compatible codecs found in manifest");n.hls.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}))}},{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;if(0!==t.length){if(e<0||e>=t.length){var i=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(Rd.ERROR,{type:Dd.OTHER_ERROR,details:Ld.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:i,reason:i.message}),r)return;e=Math.min(e,t.length-1)}var a=this.currentLevelIndex,n=this.currentLevel,o=n?n.attrs["PATHWAY-ID"]:void 0,s=t[e],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,a!==e||!s.details||!n||o!==l){this.log("Switching to level ".concat(e," (").concat(s.height?s.height+"p ":"").concat(s.videoRange?s.videoRange+" ":"").concat(s.codecSet?s.codecSet+" ":"","@").concat(s.bitrate,")").concat(l?" with Pathway "+l:""," from level ").concat(a).concat(o?" with Pathway "+o:""));var c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(Rd.LEVEL_SWITCHING,c);var u=s.details;if(!u||u.live){var d=this.switchParams(s.uri,null==n?void 0:n.details);this.loadPlaylist(d)}}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"onError",value:function(e,t){!t.fatal&&t.context&&t.context.type===Pp&&t.context.level===this.level&&this.checkRetry(t)}},{key:"onFragBuffered",value:function(e,t){var i=t.frag;if(void 0!==i&&i.type===Up){var r=i.elementaryStreams;if(!Object.keys(r).some((function(e){return!!r[e]})))return;var a=this._levels[i.level];null!=a&&a.loadError&&(this.log("Resetting level error count of ".concat(a.loadError," on frag buffered")),a.loadError=0)}}},{key:"onLevelLoaded",value:function(e,t){var i,r,a=t.level,n=t.details,o=this._levels[a];if(!o)return this.warn("Invalid level index ".concat(a)),void(null!=(r=t.deliveryDirectives)&&r.skip&&(n.deltaUpdateFailed=!0));a===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0),this.playlistLoaded(a,t,o.details)):null!=(i=t.deliveryDirectives)&&i.skip&&(n.deltaUpdateFailed=!0)}},{key:"loadPlaylist",value:function(e){b(t,"loadPlaylist",this,3)([]);var i=this.currentLevelIndex,r=this.currentLevel;if(r&&this.shouldLoadPlaylist(r)){var a=r.uri;if(e)try{a=e.addDirectives(a)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: ".concat(e))}var n=r.attrs["PATHWAY-ID"];this.log("Loading level index ".concat(i).concat(void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""," with").concat(n?" Pathway "+n:""," ").concat(a)),this.clearTimer(),this.hls.trigger(Rd.LEVEL_LOADING,{url:a,level:i,pathwayId:r.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}},{key:"removeLevel",value:function(e){var t,i=this,r=this._levels.filter((function(t,r){return r!==e||(i.steering&&i.steering.removeLevel(t),t===i.currentLevel&&(i.currentLevel=null,i.currentLevelIndex=-1,t.details&&t.details.fragments.forEach((function(e){return e.level=-1}))),!1)}));vf(r),this._levels=r,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(Rd.LEVELS_UPDATED,{levels:r})}},{key:"onLevelsUpdated",value:function(e,t){var i=t.levels;this._levels=i}},{key:"checkMaxAutoUpdated",value:function(){var e=this.hls,t=e.autoLevelCapping,i=e.maxAutoLevel,r=e.maxHdcpLevel;this._maxAutoLevel!==i&&(this._maxAutoLevel=i,this.hls.trigger(Rd.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:i,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}])}(Mf);function Pv(e){var t={};e.forEach((function(e){var i=e.groupId||"";e.id=t[i]=t[i]||0,t[i]++}))}var Bv=function(){function e(t){S(this,e),this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}return T(e,[{key:"abort",value:function(e){for(var t in this.keyUriToKeyInfo){var i=this.keyUriToKeyInfo[t].loader;if(i){var r;if(e&&e!==(null==(r=i.context)?void 0:r.frag.type))return;i.abort()}}}},{key:"detach",value:function(){for(var e in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}},{key:"destroy",value:function(){for(var e in this.detach(),this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}},{key:"createKeyLoadError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ld.KEY_LOAD_ERROR,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return new fm({type:Dd.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:a,error:i,networkDetails:r})}},{key:"loadClear",value:function(e,t){var i=this;if(this.emeController&&this.config.emeEnabled)for(var r=e.sn,a=e.cc,n=function(){var e=t[o];if(a<=e.cc&&("initSegment"===r||"initSegment"===e.sn||r2,h=!u||t&&t.start<=n||u-n>2&&!this.fragmentTracker.getPartialFragment(n);if(d||h)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var p;if(!(c.len>0)&&!u)return;var f=Math.max(u,c.start||0)-n,m=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,g=(null==m||null==(p=m.details)?void 0:p.live)?2*m.details.targetduration:2,y=this.fragmentTracker.getPartialFragment(n);if(f>0&&(f<=g||y))return void(r.paused||this._trySkipBufferHole(y))}var v=self.performance.now();if(null!==a){var A=v-a;if(o||!(A>=250)||(this._reportStall(c),this.media)){var b=rm.bufferInfo(r,n,i.maxBufferHole);this._tryFixBufferStall(b,A)}}else this.stalled=v}else if(this.moved=!0,o||(this.nudgeRetry=0),null!==a){if(this.stallReported){var _=self.performance.now()-a;Ud.warn("playback not stuck anymore @".concat(n,", after ").concat(Math.round(_),"ms")),this.stallReported=!1}this.stalled=null}}}},{key:"_tryFixBufferStall",value:function(e,t){var i=this.config,r=this.fragmentTracker,a=this.media;if(null!==a){var n=a.currentTime,o=r.getPartialFragment(n);(!o||!this._trySkipBufferHole(o)&&this.media)&&(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-n1e3*i.highBufferWatchdogPeriod&&(Ud.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}}},{key:"_reportStall",value:function(e){var t=this.hls,i=this.media,r=this.stallReported;if(!r&&i){this.stallReported=!0;var a=new Error("Playback stalling at @".concat(i.currentTime," due to low buffer (").concat(JSON.stringify(e),")"));Ud.warn(a.message),t.trigger(Rd.ERROR,{type:Dd.MEDIA_ERROR,details:Ld.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len})}}},{key:"_trySkipBufferHole",value:function(e){var t=this.config,i=this.hls,r=this.media;if(null===r)return 0;var a=r.currentTime,n=rm.bufferInfo(r,a,0),o=a0&&n.len<1&&r.readyState<3,c=o-a;if(c>0&&(s||l)){if(c>t.maxBufferHole){var u=this.fragmentTracker,d=!1;if(0===a){var h=u.getAppendedFrag(0,Up);h&&o1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @".concat(t.toFixed(3))),e=t),this.state=_m,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=bm}},{key:"stopLoad",value:function(){this._forceStartLoad=!1,b(t,"stopLoad",this,3)([])}},{key:"doTick",value:function(){switch(this.state){case Lm:var e=this.levels,t=this.level,i=null==e?void 0:e[t],r=null==i?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=_m;break}if(this.hls.nextLoadLevel!==this.level){this.state=_m;break}break;case Sm:var a,n=self.performance.now(),o=this.retryDate;if(!o||n>=o||null!=(a=this.media)&&a.seeking){var s=this.levels,l=this.level,c=null==s?void 0:s[l];this.resetStartWhenNotLoaded(c||null),this.state=_m}}this.state===_m&&this.doTickIdle(),this.onTickEnd()}},{key:"onTickEnd",value:function(){b(t,"onTickEnd",this,3)([]),this.checkBuffer(),this.checkFragmentChanged()}},{key:"doTickIdle",value:function(){var e=this.hls,t=this.levelLastLoaded,i=this.levels,r=this.media;if(null!==t&&(r||!this.startFragRequested&&e.config.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)){var a=e.nextLoadLevel;if(null!=i&&i[a]){var n=i[a],o=this.getMainFwdBufferInfo();if(null!==o){var s=this.getLevelDetails();if(s&&this._streamEnded(o,s)){var l={};return this.altAudio&&(l.type="video"),this.hls.trigger(Rd.BUFFER_EOS,l),void(this.state=xm)}e.loadLevel!==a&&-1===e.manualLevel&&this.log("Adapting to level ".concat(a," from level ").concat(this.level)),this.level=e.nextLoadLevel=a;var c=n.details;if(!c||this.state===Lm||c.live&&this.levelLastLoaded!==n)return this.level=a,void(this.state=Lm);var u=o.len,d=this.getMaxBufferLength(n.maxBitrate);if(!(u>=d)){this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);var h=this.backtrackFragment?this.backtrackFragment.start:o.end,p=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==Zf){var f,m=(null!=(f=this.backtrackFragment)?f:p).sn-c.startSN,g=c.fragments[m-1];g&&p.cc===g.cc&&(p=g,this.fragmentTracker.removeFragment(g))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,h)){if(!p.gap){var y=this.audioOnly&&!this.altAudio?Hd:Wd,v=(y===Wd?this.videoBuffer:this.mediaBuffer)||this.media;v&&this.afterBufferFlushed(v,y,Up)}p=this.getNextFragmentLoopLoading(p,c,o,Up,d)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,n,h))}}}}}},{key:"loadFragment",value:function(e,i,r){var a=this.fragmentTracker.getState(e);this.fragCurrent=e,a===Yf||a===Xf?"initSegment"===e.sn?this._loadInitSegment(e,i):this.bitrateTest?(this.log("Fragment ".concat(e.sn," of level ").concat(e.level," is being downloaded to test bitrate and will not be buffered")),this._loadBitrateTestFrag(e,i)):(this.startFragRequested=!0,b(t,"loadFragment",this,3)([e,i,r])):this.clearTrackerIfNeeded(e)}},{key:"getBufferedFrag",value:function(e){return this.fragmentTracker.getBufferedFrag(e,Up)}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.end+.5):null}},{key:"immediateLevelSwitch",value:function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"nextLevelSwitch",value:function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var i,r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);var a=this.getLevelDetails();if(null!=a&&a.live){var n=this.getMainFwdBufferInfo();if(!n||n.len<2*a.targetduration)return}if(!t.paused&&e){var o=e[this.hls.nextLoadLevel],s=this.fragLastKbps;i=s&&this.fragCurrent?this.fragCurrent.duration*o.maxBitrate/(1e3*s)+1:0}else i=0;var l=this.getBufferedFrag(t.currentTime+i);if(l){var c=this.followingBufferedFrag(l);if(c){this.abortCurrentFrag();var u=c.maxStartPTS?c.maxStartPTS:c.start,d=c.duration,h=Math.max(l.end,u+Math.min(Math.max(d-this.config.maxFragLookUpTolerance,d*(this.couldBacktrack?.5:.125)),d*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}}},{key:"abortCurrentFrag",value:function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case km:case wm:case Sm:case Em:case Cm:this.state=_m}this.nextLoadPosition=this.getLoadPosition()}},{key:"flushMainBuffer",value:function(e,i){b(t,"flushMainBuffer",this,3)([e,i,this.altAudio?"video":null])}},{key:"onMediaAttached",value:function(e,i){b(t,"onMediaAttached",this,3)([e,i]);var r=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new Fv(this.config,r,this.fragmentTracker,this.hls)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),b(t,"onMediaDetaching",this,3)([])}},{key:"onMediaPlaying",value:function(){this.tick()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:null;Ed(t)&&this.log("Media seeked to ".concat(t.toFixed(3)));var i=this.getMainFwdBufferInfo();null!==i&&0!==i.len?this.tick():this.warn('Main forward buffer length on "seeked" event '.concat(i?i.len:"empty",")"))}},{key:"onManifestLoading",value:function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(Rd.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}},{key:"onManifestParsed",value:function(e,t){var i=!1,r=!1;t.levels.forEach((function(e){var t=e.audioCodec;t&&(i=i||-1!==t.indexOf("mp4a.40.2"),r=r||-1!==t.indexOf("mp4a.40.5"))})),this.audioCodecSwitch=i&&r&&!function(){var e,t=Mv();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}},{key:"onLevelLoading",value:function(e,t){var i=this.levels;if(i&&this.state===_m){var r=i[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(r.details))&&(this.state=Lm)}}},{key:"onLevelLoaded",value:function(e,t){var i,r=this.levels,a=t.level,n=t.details,o=n.totalduration;if(r){this.log("Level ".concat(a," loaded [").concat(n.startSN,",").concat(n.endSN,"]").concat(n.lastPartSn?"[part-".concat(n.lastPartSn,"-").concat(n.lastPartIndex,"]"):"",", cc [").concat(n.startCC,", ").concat(n.endCC,"] duration:").concat(o));var s=r[a],l=this.fragCurrent;!l||this.state!==wm&&this.state!==Sm||l.level!==t.level&&l.loader&&this.abortCurrentFrag();var c=0;if(n.live||null!=(i=s.details)&&i.live){var u;if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;c=this.alignPlaylists(n,s.details,null==(u=this.levelLastLoaded)?void 0:u.details)}if(s.details=n,this.levelLastLoaded=s,this.hls.trigger(Rd.LEVEL_UPDATED,{details:n,level:a}),this.state===Lm){if(this.waitForCdnTuneIn(n))return;this.state=_m}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,c),this.tick()}else this.warn("Levels were reset while loading level ".concat(a))}},{key:"_handleFragmentLoadProgress",value:function(e){var t,i=e.frag,r=e.part,a=e.payload,n=this.levels;if(n){var o=n[i.level],s=o.details;if(!s)return this.warn("Dropping fragment ".concat(i.sn," of level ").concat(i.level," after level details were reset")),void this.fragmentTracker.removeFragment(i);var l=o.videoCodec,c=s.PTSKnown||!s.live,u=null==(t=i.initSegment)?void 0:t.data,d=this._getAudioCodec(o),h=this.transmuxer=this.transmuxer||new Og(this.hls,Up,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=r?r.index:-1,f=-1!==p,m=new am(i.level,i.sn,i.stats.chunkCount,a.byteLength,p,f),g=this.initPTS[i.cc];h.push(a,u,d,l,i,r,s.totalduration,c,m,g)}else this.warn("Levels were reset while fragment load was in progress. Fragment ".concat(i.sn," of level ").concat(i.level," will not be buffered"))}},{key:"onAudioTrackSwitching",value:function(e,t){var i=this.altAudio;if(!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var r=this.fragCurrent;r&&(this.log("Switching to main audio track, cancel main fragment load"),r.abortRequests(),this.fragmentTracker.removeFragment(r)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var a=this.hls;i&&(a.trigger(Rd.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),a.trigger(Rd.AUDIO_TRACK_SWITCHED,t)}}},{key:"onAudioTrackSwitched",value:function(e,t){var i=t.id,r=!!this.hls.audioTracks[i].url;if(r){var a=this.videoBuffer;a&&this.mediaBuffer!==a&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=a)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e,t){var i,r,a=t.tracks,n=!1;for(var o in a){var s=a[o];if("main"===s.id){if(r=o,i=s,"video"===o){var l=a[o];l&&(this.videoBuffer=l.buffer)}}else n=!0}n&&i?(this.log("Alternate track found, use ".concat(r,".buffered to schedule main fragment loading")),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}},{key:"onFragBuffered",value:function(e,t){var i=t.frag,r=t.part;if(!i||i.type===Up){if(this.fragContextChanged(i))return this.warn("Fragment ".concat(i.sn).concat(r?" p: "+r.index:""," of level ").concat(i.level," finished buffering, but was aborted. state: ").concat(this.state)),void(this.state===Cm&&(this.state=_m));var a=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}}},{key:"onError",value:function(e,t){var i;if(t.fatal)this.state=Rm;else switch(t.details){case Ld.FRAG_GAP:case Ld.FRAG_PARSING_ERROR:case Ld.FRAG_DECRYPT_ERROR:case Ld.FRAG_LOAD_ERROR:case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_ERROR:case Ld.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Up,t);break;case Ld.LEVEL_LOAD_ERROR:case Ld.LEVEL_LOAD_TIMEOUT:case Ld.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Lm||(null==(i=t.context)?void 0:i.type)!==Pp||(this.state=_m);break;case Ld.BUFFER_APPEND_ERROR:case Ld.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;if(t.details===Ld.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case Ld.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}},{key:"checkBuffer",value:function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){if(this.loadedmetadata||!rm.getBuffered(e).length){var i=this.state!==_m?this.fragCurrent:null;t.poll(this.lastCurrentTime,i)}this.lastCurrentTime=e.currentTime}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=_m,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}},{key:"onBufferFlushed",value:function(e,t){var i=t.type;if(i!==Hd||this.audioOnly&&!this.altAudio){var r=(i===Wd?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,i,Up),this.tick()}}},{key:"onLevelsUpdated",value:function(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"seekToStartPos",value:function(){var e=this.media;if(e){var t=e.currentTime,i=this.startPosition;if(i>=0&&t0&&(aA.cc;if(!1!==a.independent){var k=u.startPTS,w=u.endPTS,S=u.startDTS,T=u.endDTS;if(l)l.elementaryStreams[u.type]={startPTS:k,endPTS:w,startDTS:S,endDTS:T};else if(u.firstKeyFrame&&u.independent&&1===n.id&&!_&&(this.couldBacktrack=!0),u.dropped&&u.independent){var E=this.getMainFwdBufferInfo(),C=(E?E.end:this.getLoadPosition())+this.config.maxBufferHole,x=u.firstKeyFramePTS?u.firstKeyFramePTS:k;if(!b&&C2&&(s.gap=!0);s.setElementaryStreamInfo(u.type,k,w,S,T),this.backtrackFragment&&(this.backtrackFragment=s),this.bufferFragmentData(u,s,l,n,b||_)}else{if(!b&&!_)return void this.backtrack(s);s.gap=!0}}if(m){var R=m.startPTS,D=m.endPTS,L=m.startDTS,I=m.endDTS;l&&(l.elementaryStreams[Hd]={startPTS:R,endPTS:D,startDTS:L,endDTS:I}),s.setElementaryStreamInfo(Hd,R,D,L,I),this.bufferFragmentData(m,s,l,n)}if(f&&null!=h&&null!=(t=h.samples)&&t.length){var P={id:i,frag:s,details:f,samples:h.samples};r.trigger(Rd.FRAG_PARSING_METADATA,P)}if(f&&d){var B={id:i,frag:s,details:f,samples:d.samples};r.trigger(Rd.FRAG_PARSING_USERDATA,B)}}}else this.resetWhenMissingContext(n)}},{key:"_bufferInitSegment",value:function(e,t,i,r){var a=this;if(this.state===Em){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var n=t.audio,o=t.video,s=t.audiovideo;if(n){var l=e.audioCodec,c=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(l&&(l=-1!==l.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==n.metadata.channelCount&&-1===c.indexOf("firefox")&&(l="mp4a.40.5")),l&&-1!==l.indexOf("mp4a.40.5")&&-1!==c.indexOf("android")&&"audio/mpeg"!==n.container&&(l="mp4a.40.2",this.log("Android: force audio codec to ".concat(l))),e.audioCodec&&e.audioCodec!==l&&this.log('Swapping manifest audio codec "'.concat(e.audioCodec,'" for "').concat(l,'"')),n.levelCodec=l,n.id="main",this.log("Init audio buffer, container:".concat(n.container,", codecs[selected/level/parsed]=[").concat(l||"","/").concat(e.audioCodec||"","/").concat(n.codec,"]"))}o&&(o.levelCodec=e.videoCodec,o.id="main",this.log("Init video buffer, container:".concat(o.container,", codecs[level/parsed]=[").concat(e.videoCodec||"","/").concat(o.codec,"]"))),s&&this.log("Init audiovideo buffer, container:".concat(s.container,", codecs[level/parsed]=[").concat(e.codecs,"/").concat(s.codec,"]")),this.hls.trigger(Rd.BUFFER_CODECS,t),Object.keys(t).forEach((function(e){var n=t[e].initSegment;null!=n&&n.byteLength&&a.hls.trigger(Rd.BUFFER_APPENDING,{type:e,data:n,frag:i,part:null,chunkMeta:r,parent:i.type})})),this.tickImmediate()}}},{key:"getMainFwdBufferInfo",value:function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Up)}},{key:"backtrack",value:function(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=_m}},{key:"checkFragmentChanged",value:function(){var e=this.media,t=null;if(e&&e.readyState>1&&!1===e.seeking){var i=e.currentTime;if(rm.isBuffered(e,i)?t=this.getAppendedFrag(i):rm.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;var r=this.fragPlaying,a=t.level;r&&t.sn===r.sn&&r.level===a||(this.fragPlaying=t,this.hls.trigger(Rd.FRAG_CHANGED,{frag:t}),r&&r.level===a||this.hls.trigger(Rd.LEVEL_SWITCHED,{level:a}))}}}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){var e=this.media;if(e){var t=e.currentTime,i=this.currentFrag;if(i&&Ed(t)&&Ed(i.programDateTime)){var r=i.programDateTime+1e3*(t-i.start);return new Date(r)}}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])}(Im),Nv=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};S(this,e),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Fg,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,function(e,t){if("object"==("undefined"===typeof console?"undefined":E(console))&&!0===e||"object"==E(e)){Md(e,"debug","log","info","warn","error");try{Bd.log('Debug logs enabled for "'.concat(t,'" in hls.js version 1.5.7'))}catch(e){Bd=Pd}}else Bd=Pd}(t.debug||!1,"Hls instance");var i=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');var i=Dv(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((function(e){var a="".concat("level"===e?"playlist":e,"LoadPolicy"),n=void 0===t[a],o=[];r.forEach((function(r){var s="".concat(e,"Loading").concat(r),l=t[s];if(void 0!==l&&n){o.push(s);var c=i[a].default;switch(t[a]={default:c},r){case"TimeOut":c.maxLoadTimeMs=l,c.maxTimeToFirstByteMs=l;break;case"MaxRetry":c.errorRetry.maxNumRetry=l,c.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":c.errorRetry.retryDelayMs=l,c.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":c.errorRetry.maxRetryDelayMs=l,c.timeoutRetry.maxRetryDelayMs=l}}})),o.length&&Ud.warn('hls.js config: "'.concat(o.join('", "'),'" setting(s) are deprecated, use "').concat(a,'": ').concat(JSON.stringify(t[a])))})),kd(kd({},i),t)}(e.DefaultConfig,t);this.userConfig=t,i.progressive&&Lv(i);var r=i.abrController,a=i.bufferController,n=i.capLevelController,o=i.errorController,s=i.fpsController,l=new o(this),c=this.abrController=new r(this),u=this.bufferController=new a(this),d=this.capLevelController=new n(this),h=new s(this),p=new Gp(this),f=new ef(this),m=i.contentSteeringController,g=m?new m(this):null,y=this.levelController=new Iv(this,g),v=new $f(this),A=new Bv(this.config),b=this.streamController=new Ov(this,v,A);d.setStreamController(b),h.setStreamController(b);var _=[p,y,b];g&&_.splice(1,0,g),this.networkControllers=_;var k=[c,u,d,h,f,v];this.audioTrackController=this.createController(i.audioTrackController,_);var w=i.audioStreamController;w&&_.push(new w(this,v,A)),this.subtitleTrackController=this.createController(i.subtitleTrackController,_);var T=i.subtitleStreamController;T&&_.push(new T(this,v,A)),this.createController(i.timelineController,k),A.emeController=this.emeController=this.createController(i.emeController,k),this.cmcdController=this.createController(i.cmcdController,k),this.latencyController=this.createController(tf,k),this.coreComponents=k,_.push(l);var C=l.onErrorOut;"function"==typeof C&&this.on(Rd.ERROR,C,l)}return T(e,[{key:"createController",value:function(e,t){if(e){var i=new e(this);return t&&t.push(i),i}return null}},{key:"on",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._emitter.on(e,t,i)}},{key:"once",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._emitter.once(e,t,i)}},{key:"removeAllListeners",value:function(e){this._emitter.removeAllListeners(e)}},{key:"off",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this,r=arguments.length>3?arguments[3]:void 0;this._emitter.off(e,t,i,r)}},{key:"listeners",value:function(e){return this._emitter.listeners(e)}},{key:"emit",value:function(e,t,i){return this._emitter.emit(e,t,i)}},{key:"trigger",value:function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(Ud.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),!this.triggeringException){this.triggeringException=!0;var i=e===Rd.ERROR;this.trigger(Rd.ERROR,{type:Dd.OTHER_ERROR,details:Ld.INTERNAL_EXCEPTION,fatal:i,event:e,error:t}),this.triggeringException=!1}}return!1}},{key:"listenerCount",value:function(e){return this._emitter.listenerCount(e)}},{key:"destroy",value:function(){Ud.log("destroy"),this.trigger(Rd.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0;var e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}},{key:"attachMedia",value:function(e){Ud.log("attachMedia"),this._media=e,this.trigger(Rd.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){Ud.log("detachMedia"),this.trigger(Rd.MEDIA_DETACHING,void 0),this._media=null}},{key:"loadSource",value:function(e){this.stopLoad();var t=this.media,i=this.url,r=this.url=bd.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,Ud.log("loadSource:".concat(r)),t&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(Rd.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Ud.log("startLoad(".concat(e,")")),this.started=!0,this.networkControllers.forEach((function(t){t.startLoad(e)}))}},{key:"stopLoad",value:function(){Ud.log("stopLoad"),this.started=!1,this.networkControllers.forEach((function(e){e.stopLoad()}))}},{key:"resumeBuffering",value:function(){this.started&&this.networkControllers.forEach((function(e){"fragmentLoader"in e&&e.startLoad(-1)}))}},{key:"pauseBuffering",value:function(){this.networkControllers.forEach((function(e){"fragmentLoader"in e&&e.stopLoad()}))}},{key:"swapAudioCodec",value:function(){Ud.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){Ud.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)}},{key:"removeLevel",value:function(e){this.levelController.removeLevel(e)}},{key:"levels",get:function(){var e=this.levelController.levels;return e||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){Ud.log("set currentLevel:".concat(e)),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){Ud.log("set nextLevel:".concat(e)),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){Ud.log("set loadLevel:".concat(e)),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){Ud.log("set firstLevel:".concat(e)),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){var e=this.levelController.startLevel;return-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e},set:function(e){Ud.log("set startLevel:".concat(e)),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(Ud.log("set autoLevelCapping:".concat(e)),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN},set:function(e){this.abrController.resetEstimator(e)}},{key:"ttfbEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimateTTFB():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(e){(function(e){return rf.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var i=e.length,r=0;r=t)return r;return 0}},{key:"maxAutoLevel",get:function(){var e,t=this.levels,i=this.autoLevelCapping,r=this.maxHdcpLevel;if(e=-1===i&&null!=t&&t.length?t.length-1:i,r)for(var a=e;a--;){var n=t[a].attrs["HDCP-LEVEL"];if(n&&n<=r)return a}return e}},{key:"firstAutoLevel",get:function(){return this.abrController.firstAutoLevel}},{key:"nextAutoLevel",get:function(){return this.abrController.nextAutoLevel},set:function(e){this.abrController.nextAutoLevel=e}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"setAudioOption",value:function(e){var t;return null==(t=this.audioTrackController)?void 0:t.setAudioOption(e)}},{key:"setSubtitleOption",value:function(e){var t;return null==(t=this.subtitleTrackController)||t.setSubtitleOption(e),null}},{key:"allAudioTracks",get:function(){var e=this.audioTrackController;return e?e.allAudioTracks:[]}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"allSubtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.5.7"}},{key:"isMSESupported",value:function(){return Uv()}},{key:"isSupported",value:function(){return function(){if(!Uv())return!1;var e=lp();return"function"==typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((function(t){return e.isTypeSupported(hp(t,"video"))}))||["mp4a.40.2","fLaC"].some((function(t){return e.isTypeSupported(hp(t,"audio"))})))}()}},{key:"getMediaSource",value:function(){return lp()}},{key:"Events",get:function(){return Rd}},{key:"ErrorTypes",get:function(){return Dd}},{key:"ErrorDetails",get:function(){return Ld}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:Rv},set:function(t){e.defaultConfig=t}}])}();Nv.defaultConfig=void 0;var jv=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.TAG_NAME="HlsDecoder",e._opt,i.canVideoPlay=!1,i.$videoElement=null,i.canvasRenderInterval=null,i.bandwidthEstimateInterval=null,i.fpsInterval=null,i.hlsFps=0,i.hlsPrevFrams=0,i.isInitInfo=!1,i.eventsDestroy=[],i.supportVideoFrameCallbackHandle=null,i.player.isHlsCanVideoPlay()?(i.$videoElement=i.player.video.$videoElement,i.canVideoPlay=!0):Nv.isSupported()?(i.$videoElement=i.player.video.$videoElement,i.hls=new Nv({}),i._initHls(),i._bindEvents()):i.player.debug.error(i.TAG_NAME,"init hls error ,not support "),i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){e.supportVideoFrameCallbackHandle&&e.$videoElement&&(e.$videoElement.cancelVideoFrameCallback(e.supportVideoFrameCallbackHandle),e.supportVideoFrameCallbackHandle=null),e.hls&&(e.hls.destroy(),e.hls=null),e.eventsDestroy.length&&(e.eventsDestroy.forEach((function(e){return e()})),e.eventsDestroy=[]),e.isInitInfo=!1,e._stopCanvasRender(),e._stopBandwidthEstimateInterval(),e._stopFpsInterval(),e.$videoElement=null,e.hlsFps=0,e.player.debug.log(e.TAG_NAME,"destroy"),setTimeout((function(){t()}),0)}))}},{key:"checkHlsBufferedDelay",value:function(){var e=this.$videoElement,t=0,i=e.buffered,r=i.length?i.end(i.length-1):0;return t=r-e.currentTime,t<0&&(this.player.debug.warn(this.TAG_NAME,"checkHlsBufferedDelay ".concat(t," < 0, and buffered is ").concat(r," ,currentTime is ").concat(e.currentTime," , try to seek ").concat(e.currentTime," to ").concat(r)),e.currentTime=r,t=0),t}},{key:"getFps",value:function(){return this.hlsFps}},{key:"_startCanvasRender",value:function(){var e=this;qo()?this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)):(this._stopCanvasRender(),this.canvasRenderInterval=setInterval((function(){e.player.video.render({$video:e.$videoElement,ts:parseInt(1e3*e.$videoElement.currentTime,10)||0})}),40))}},{key:"_stopCanvasRender",value:function(){this.canvasRenderInterval&&(clearInterval(this.canvasRenderInterval),this.canvasRenderInterval=null)}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.player.isDestroyedOrClosed())this.player.debug.log(this.TAG_NAME,"videoFrameCallback() player is destroyed");else{var i=parseInt(1e3*Math.max(t.mediaTime,this.$videoElement.currentTime),10)||0;this.player.video.render({$video:this.$videoElement,ts:i}),this.player.handleRender(),this.player.updateStats({dts:i}),this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this))}}},{key:"_startBandwidthEstimateInterval",value:function(){var e=this;this._stopBandwidthEstimateInterval(),this.bandwidthEstimateInterval=setInterval((function(){var t=0;e.hls.bandwidthEstimate&&(t=e.hls.bandwidthEstimate),e.player.emit(xt.kBps,(t/1024/8/10).toFixed(2))}),1e3)}},{key:"_stopBandwidthEstimateInterval",value:function(){this.bandwidthEstimateInterval&&(clearInterval(this.bandwidthEstimateInterval),this.bandwidthEstimateInterval=null)}},{key:"_startFpsInterval",value:function(){var e=this;this._stopCanvasRender(),this.fpsInterval=setInterval((function(){if(e.$videoElement)if(wo(e.$videoElement.getVideoPlaybackQuality)){var t=e.$videoElement.getVideoPlaybackQuality();e.hlsFps=t.totalVideoFrames-e.hlsPrevFrams,e.hlsPrevFrams=t.totalVideoFrames}else{var i=e.$videoElement.webkitDecodedFrameCount||0;e.hlsFps=i-e.hlsPrevFrams,e.hlsPrevFrams=i}}),1e3)}},{key:"_stopFpsInterval",value:function(){this.fpsInterval&&(clearInterval(this.fpsInterval),this.fpsInterval=null)}},{key:"_initHls",value:function(){this.player._opt.useCanvasRender&&(this.$videoElement=document.createElement("video"),this.$videoElement.muted=!0,Wn()&&(this.$videoElement.style.position="absolute"),this.initVideoEvents()),this.hls.attachMedia(this.$videoElement)}},{key:"_bindEvents",value:function(){var e=this,t=this.player,i=this.player.events.proxy;this.hls;var r=this.$videoElement,a=qo(),n=i(r,wr,(function(i){if(e.hls){var r=parseInt(i.timeStamp,10);e.player._opt.useCanvasRender&&No(a)&&t.updateStats({ts:r,dts:r})}}));this.eventsDestroy.push(n),this._startBandwidthEstimateInterval(),this._startFpsInterval(),this.hls.on(Nv.Events.ERROR,(function(t,i){if(i.fatal)switch(i.type){case Nv.ErrorTypes.NETWORK_ERROR:e.player.debug.warn(e.TAG_NAME,"fatal network error encountered, try to recover"),e.hls.startLoad();break;case Nv.ErrorTypes.MEDIA_ERROR:e.player.debug.warn(e.TAG_NAME,"fatal media error encountered, try to recover"),e.hls.recoverMediaError()}})),this.hls.on(Nv.Events.MEDIA_ATTACHING,(function(){})),this.hls.on(Nv.Events.MEDIA_ATTACHED,(function(){})),this.hls.on(Nv.Events.MEDIA_DETACHING,(function(){})),this.hls.on(Nv.Events.MEDIA_DETACHED,(function(){})),this.hls.on(Nv.Events.BUFFER_RESET,(function(){})),this.hls.on(Nv.Events.BUFFER_CODECS,(function(){})),this.hls.on(Nv.Events.BUFFER_CREATED,(function(){})),this.hls.on(Nv.Events.BUFFER_APPENDING,(function(t,i){e.player.debug.log(e.TAG_NAME,"BUFFER_APPENDING",i.type)})),this.hls.on(Nv.Events.BUFFER_APPENDED,(function(){})),this.hls.on(Nv.Events.BUFFER_EOS,(function(){})),this.hls.on(Nv.Events.BUFFER_FLUSHING,(function(){})),this.hls.on(Nv.Events.BUFFER_FLUSHED,(function(){})),this.hls.on(Nv.Events.MANIFEST_LOADING,(function(){e.player.debug.log(e.TAG_NAME,"MANIFEST_LOADING 开始加载playlist m3u8资源")})),this.hls.on(Nv.Events.MANIFEST_LOADED,(function(t,i){e.player.debug.log(e.TAG_NAME,"MANIFEST_LOADED playlist m3u8文件加载完成",i.url)})),this.hls.on(Nv.Events.MANIFEST_PARSED,(function(){e.player.debug.log(e.TAG_NAME,"MANIFEST_PARSED playlist m3u8解析完成"),t._times.demuxStart||(t._times.demuxStart=Ln())})),this.hls.on(Nv.Events.LEVEL_LOADING,(function(){})),this.hls.on(Nv.Events.LEVEL_LOADED,(function(e,t){})),this.hls.on(Nv.Events.FRAG_LOADING,(function(){})),this.hls.on(Nv.Events.FRAG_LOADED,(function(e,i){t._times.decodeStart||(t._times.decodeStart=Ln())})),this.hls.on(Nv.Events.BUFFER_APPENDING,(function(){t._times.videoStart||(t._times.videoStart=Ln(),t.handlePlayToRenderTimes())})),this.hls.on(Nv.Events.FRAG_DECRYPTED,(function(){})),this.hls.on(Nv.Events.KEY_LOADING,(function(){})),this.hls.on(Nv.Events.KEY_LOADING,(function(){})),this.hls.on(Nv.Events.FPS_DROP,(function(e){})),this.hls.on(Nv.Events.FPS_DROP_LEVEL_CAPPING,(function(e){})),this.hls.on(Nv.Events.FRAG_PARSING_INIT_SEGMENT,(function(t,i){e.player.debug.log(e.TAG_NAME,"FRAG_PARSING_INIT_SEGMENT",i);var r=!!(i&&i.tracks&&i.tracks.audio),a=!!(i&&i.tracks&&i.tracks.video);if(r&&i.tracks.audio){var n=i.tracks.audio,o=n.metadata&&n.metadata.channelCount?n.metadata.channelCount:0,s=n.codec;e.player.audio&&e.player.audio.updateAudioInfo({encType:s,channels:o,sampleRate:44100})}if(a&&i.tracks.video){var l=i.tracks.video,c={encTypeCode:-1!==l.codec.indexOf("avc")?Gt:zt};l.metadata&&(c.width=l.metadata.width,c.height=l.metadata.height),e.player.video&&e.player.video.updateVideoInfo(c)}}))}},{key:"initVideoPlay",value:function(e){this.player._opt.useCanvasRender&&(this.$videoElement=document.createElement("video"),this.initVideoEvents()),this.$videoElement.autoplay=!0,this.$videoElement.muted=!0,this.$videoElement.src=e}},{key:"_initRenderSize",value:function(){this.isInitInfo||(this.player.video.updateVideoInfo({width:this.$videoElement.videoWidth,height:this.$videoElement.videoHeight}),this.player.video.initCanvasViewSize(),this.isInitInfo=!0)}},{key:"initVideoEvents",value:function(){var e=this,t=this.player.events.proxy,i=t(this.$videoElement,_r,(function(){e.player.debug.log(e.TAG_NAME,"video canplay"),e.$videoElement.play().then((function(){e.player.debug.log(e.TAG_NAME,"video play"),e._startCanvasRender(),e._initRenderSize()})).catch((function(t){e.player.debug.warn(e.TAG_NAME,"video play error ",t)}))})),r=t(this.$videoElement,kr,(function(){e.player.debug.log(e.TAG_NAME,"video waiting")})),a=t(this.$videoElement,wr,(function(t){var i=parseInt(t.timeStamp,10);e.player.handleRender(),e.player.updateStats({ts:i}),e.$videoElement.paused&&(e.player.debug.warn(e.TAG_NAME,"video is paused and next try to replay"),e.$videoElement.play().then((function(){e.player.debug.log(e.TAG_NAME,"video is paused and replay success")})).catch((function(t){e.player.debug.warn(e.TAG_NAME,"video is paused and replay error ",t)})))})),n=t(this.$videoElement,Sr,(function(){e.player.debug.log(e.TAG_NAME,"video playback Rate change",e.$videoElement&&e.$videoElement.playbackRate)}));this.eventsDestroy.push(i,r,a,n)}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){t.canVideoPlay?(t.initVideoPlay(e),i()):t.hls.on(Nv.Events.MEDIA_ATTACHED,(function(){t.hls.loadSource(e),i()}))}))}}])}(s),Gv=2097152,zv="fetch",Hv="xhr",Wv="arraybuffer",Vv="text",Jv="json",qv="real_time_speed",Kv=Object.prototype.toString;function Yv(e){if("[object Object]"!==Kv.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Qv(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function Xv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Zv(e,t){if(e){if(!t)return e;var i,r=Object.keys(t).map((function(e){if(i=t[e],null!=i)return Array.isArray(i)?e+="[]":i=[i],i.map((function(t){var i;return i=t,"[object Date]"===Kv.call(i)?t=t.toISOString():function(e){return null!==e&&"object"==E(e)}(t)&&(t=JSON.stringify(t)),"".concat(Xv(e),"=").concat(Xv(t))})).join("&")})).filter(Boolean).join("&");if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}}function $v(e,t,i,r,a,n,o,s,l,c,u){return a=null!=a?parseFloat(a):null,r=parseInt(r||"0",10),Number.isNaN(r)&&(r=0),{data:e,done:t,option:{range:l,vid:c,index:s,contentLength:r,age:a,startTime:n,firstByteTime:o,endTime:Date.now(),priOptions:u},response:i}}function eA(e,t){return Math.round(8*e*1e3/t/1024)}var tA=function(e){function t(e,i,r,a){var n;return S(this,t),n=_(this,t,[a]),pu(m(n),"retryCount",0),pu(m(n),"isTimeout",!1),pu(m(n),"loaderType",zv),pu(m(n),"startTime",0),pu(m(n),"endTime",0),pu(m(n),"options",{}),n.url=e,n.request=i,n.response=r,n}return k(t,e),T(t)}(y(Error)),iA=function(t){function i(e){var t;return S(this,i),t=_(this,i),pu(m(t),"_abortController",null),pu(m(t),"_timeoutTimer",null),pu(m(t),"_reader",null),pu(m(t),"_response",null),pu(m(t),"_aborted",!1),pu(m(t),"_index",-1),pu(m(t),"_range",null),pu(m(t),"_receivedLength",0),pu(m(t),"_running",!1),pu(m(t),"_logger",null),pu(m(t),"_vid",""),pu(m(t),"_onProcessMinLen",0),pu(m(t),"_onCancel",null),pu(m(t),"_priOptions",null),pu(m(t),"TAG_NAME","FetchLoader"),t.player=e,t}return k(i,t),T(i,[{key:"load",value:function(e){var t,i=this,r=e.url,a=e.vid,n=e.timeout,o=e.responseType,s=e.onProgress,l=e.index,c=e.onTimeout,u=e.onCancel,d=e.range,h=e.transformResponse,p=e.request,f=e.params,m=(e.logger,e.method),g=e.headers,y=e.body,b=e.mode,_=e.credentials,k=e.cache,w=e.redirect,S=e.referrer,T=e.referrerPolicy,E=e.onProcessMinLen,C=e.priOptions;this._aborted=!1,this._onProcessMinLen=E,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=l,this._range=d||[0,0],this._vid=a||r,this._priOptions=C||{};var x={method:m,headers:g,body:y,mode:b,credentials:_,cache:k,redirect:w,referrer:S,referrerPolicy:T,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},R=!1;clearTimeout(this._timeoutTimer),r=Zv(r,f);var D=Qv(d);D&&(g=p?p.headers:x.headers=x.headers||(Headers?new Headers:{}),Headers&&g instanceof Headers?g.append("Range",D):g.Range=D),n&&(this._timeoutTimer=setTimeout((function(){if(R=!0,i.cancel(),c){var e=new tA(r,x,null,"timeout");e.isTimeout=!0,c(e,{index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions})}}),n));var L=Date.now();return(no(l)||no(d))&&this.player.debug.log(this.TAG_NAME,"[fetch load start], index,",l,",range,",d),new Promise((function(e,t){fetch(p||r,p?void 0:x).then(function(){var a=A(v().mark((function a(n){var c,u,p,f;return v().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(clearTimeout(i._timeoutTimer),i._response=n,!i._aborted&&i._running){a.next=2;break}return a.abrupt("return");case 2:if(h&&(n=h(n,r)||n),n.ok){a.next=4;break}throw new tA(r,x,n,"bad network response");case 4:if(c=Date.now(),o!==Vv){a.next=12;break}return a.next=8,n.text();case 8:u=a.sent,i._running=!1,a.next=28;break;case 12:if(o!==Jv){a.next=19;break}return a.next=15,n.json();case 15:u=a.sent,i._running=!1,a.next=28;break;case 19:if(!s){a.next=21;break}return a.abrupt("return",(i.resolve=e,i.reject=t,void i._loadChunk(n,s,L,c)));case 21:return a.next=23,n.arrayBuffer();case 23:u=a.sent,u=new Uint8Array(u),i._running=!1,p=Date.now()-L,f=eA(u.byteLength,p),i.emit(qv,{speed:f,len:u.byteLength,time:p,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions});case 28:(no(l)||no(d))&&i.player.debug.log(i.TAG_NAME,"[fetch load end], index,",l,",range,",d),e($v(u,!0,n,n.headers.get("Content-Length"),n.headers.get("age"),L,c,l,d,i._vid,i._priOptions));case 29:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()).catch((function(e){var a;clearTimeout(i._timeoutTimer),i._running=!1,i._aborted&&!R||((e=e instanceof tA?e:new tA(r,x,null,null===(a=e)||void 0===a?void 0:a.message)).startTime=L,e.endTime=Date.now(),e.isTimeout=R,e.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},t(e))}))}))}},{key:"cancel",value:function(){var t=A(v().mark((function t(){return v().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this._aborted){t.next=14;break}if(this._aborted=!0,this._running=!1,!this._response){t.next=12;break}if(t.prev=2,t.t0=this._reader,!t.t0){t.next=7;break}return t.next=7,this._reader.cancel();case 7:t.next=11;break;case 9:t.prev=9,t.t1=t["catch"](2);case 11:this._response=this._reader=null;case 12:if(this._abortController){try{this._abortController.abort()}catch(e){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 14:case"end":return t.stop()}}),t,this,[[2,9]])})));function i(){return t.apply(this,arguments)}return i}()},{key:"_loadChunk",value:function(e,t,i,r){var a=this;if(!e.body||!e.body.getReader){this._running=!1;var n=new tA(e.url,"",e,"onProgress of bad response.body.getReader");return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(n)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(Gv),this._writeIdx=0);var o,s,l,c=this._reader=e.body.getReader(),u=function(){var n=A(v().mark((function n(){var d,h,p,f,m,g,y,A;return v().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return s=Date.now(),n.prev=1,n.next=4,c.read();case 4:o=n.sent,l=Date.now(),n.next=11;break;case 8:return n.prev=8,n.t0=n["catch"](1),n.abrupt("return",(l=Date.now(),void(a._aborted||(a._running=!1,n.t0.options={index:a._index,range:a._range,vid:a._vid,priOptions:a._priOptions},a.reject(n.t0)))));case 11:if(h=(null===(d=a._range)||void 0===d?void 0:d.length)>0?a._range[0]:0,p=h+a._receivedLength,!a._aborted){n.next=14;break}return n.abrupt("return",(a._running=!1,void t(void 0,!1,{range:[p,p],vid:a._vid,index:a._index,startTime:s,endTime:l,st:i,firstByteTime:r,priOptions:a._priOptions},e)));case 14:f=o.value?o.value.byteLength:0,a._receivedLength+=f,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress call】,task,",a._range,", start,",p,", end,",h+a._receivedLength,", done,",o.done),a._onProcessMinLen>0?a._writeIdx+f>=a._onProcessMinLen||o.done?(m=new Uint8Array(a._writeIdx+f),m.set(a._cache.slice(0,a._writeIdx),0),f>0&&m.set(o.value,a._writeIdx),a._writeIdx=0,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress enough】,done,",o.done,",len,",m.byteLength,", writeIdx,",a._writeIdx)):f>0&&a._writeIdx+f0&&(g=new Uint8Array(a._writeIdx+f+2048),a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress extra start】,size,",a._writeIdx+f+2048,", datalen,",f,", writeIdx,",a._writeIdx),g.set(a._cache.slice(0,a._writeIdx),0),f>0&&g.set(o.value,a._writeIdx),a._writeIdx+=f,delete a._cache,a._cache=g,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress extra end】,len,",f,", writeIdx,",a._writeIdx)):m=o.value,(m&&m.byteLength>0||o.done)&&t(m,o.done,{range:[a._range[0]+a._receivedLength-(m?m.byteLength:0),a._range[0]+a._receivedLength],vid:a._vid,index:a._index,startTime:s,endTime:l,st:i,firstByteTime:r,priOptions:a._priOptions},e),o.done?(y=Date.now()-i,A=eA(a._receivedLength,y),a.emit(qv,{speed:A,len:a._receivedLength,time:y,vid:a._vid,index:a._index,range:a._range,priOptions:a._priOptions}),a._running=!1,a.player.debug.log(a.TAG_NAME,"[fetchLoader onProgress end],task,",a._range,",done,",o.done),a.resolve($v(o,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),i,r,a._index,a._range,a._vid,a._priOptions))):u();case 17:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(){return n.apply(this,arguments)}}();u()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}])}(s),rA=function(){function e(t,i,r){S(this,e),pu(this,"TAG_NAME","Task"),this.promise=function(){var e,t,i=new Promise((function(i,r){e=i,t=r}));return i.used=!1,i.resolve=function(){return i.used=!0,e.apply(void 0,arguments)},i.reject=function(){return i.used=!0,t.apply(void 0,arguments)},i}(),this.alive=!!i.onProgress,this._loaderType=t,this.player=r,this._loader=t===zv&&window.fetch?new iA(r):new aA(r),this._config=i,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=i.retryCheckFunc}return T(e,[{key:"exec",value:function(){var e=this,t=this._config,i=t.retry,r=t.retryDelay,a=t.onRetryError,n=t.transformError,o=d(t,C),s=function(){var t=A(v().mark((function t(){var l,c,u;return v().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(o);case 3:l=t.sent,e.promise.resolve(l),t.next=18;break;case 7:if(t.prev=7,t.t0=t["catch"](0),e._loader.running=!1,e.player.debug.log(e.TAG_NAME,"[task request catch err]",t.t0),!e._canceled){t.next=11;break}return t.abrupt("return");case 11:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,n&&(c=n(c)||c),a&&e._retryCount>0&&a(c,e._retryCount,{index:o.index,vid:o.vid,range:o.range,priOptions:o.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=i)){t.next=17;break}return t.abrupt("return",(clearTimeout(e._retryTimer),e.player.debug.log(e.TAG_NAME,"[task request setTimeout],retry",e._retryCount,",retry range,",o.range),void(e._retryTimer=setTimeout(s,r))));case 17:e.promise.reject(c);case 18:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,this._loader.cancel()));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}])}(),aA=function(e){function i(e){var t;return S(this,i),t=_(this,i),pu(m(t),"_xhr",null),pu(m(t),"_aborted",!1),pu(m(t),"_timeoutTimer",null),pu(m(t),"_range",null),pu(m(t),"_receivedLength",0),pu(m(t),"_url",null),pu(m(t),"_onProgress",null),pu(m(t),"_index",-1),pu(m(t),"_headers",null),pu(m(t),"_currentChunkSizeKB",384),pu(m(t),"_timeout",null),pu(m(t),"_xhr",null),pu(m(t),"_withCredentials",null),pu(m(t),"_startTime",-1),pu(m(t),"_loadCompleteResolve",null),pu(m(t),"_loadCompleteReject",null),pu(m(t),"_runing",!1),pu(m(t),"_logger",!1),pu(m(t),"_vid",""),pu(m(t),"_responseType",void 0),pu(m(t),"_credentials",void 0),pu(m(t),"_method",void 0),pu(m(t),"_transformResponse",void 0),pu(m(t),"_firstRtt",void 0),pu(m(t),"_onCancel",null),pu(m(t),"_priOptions",null),pu(m(t),"TAG_NAME","XhrLoader"),t.player=e,t}return k(i,e),T(i,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this.player.debug.log(this.TAG_NAME,"【xhrLoader task】, range",this._range),this._url=Zv(e.url,e.params);var i=Date.now();return new Promise((function(e,i){t._loadCompleteResolve=e,t._loadCompleteReject=i,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof tA?e:new tA(t._url,t._request)).startTime=i,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===Wv&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,i=this._range[0]+this._receivedLength,r=this._range[1];t],tast :",this._range,", SubRange, ",e)}else e=this._range,this.player.debug.log(this.TAG_NAME,"[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var i=this;try{this._startTime=Date.now();var r=this._xhr=new XMLHttpRequest;r.open(this._method||"GET",this._url,!0),r.responseType=this._responseType,this._timeout&&(r.timeout=this._timeout),r.withCredentials=this._withCredentials,r.onload=this._onLoad.bind(this),r.onreadystatechange=this._onReadyStatechange.bind(this),r.onerror=function(e){var t,r,a;i._running=!1;var n=new tA(i._url,i._request,null==e||null===(t=e.currentTarget)||void 0===t?void 0:t.response,"xhr.onerror.status:"+(null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.status)+",statusText,"+(null==e||null===(a=e.currentTarget)||void 0===a?void 0:a.statusText));n.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},i._loadCompleteReject(n)},r.ontimeout=function(e){i.cancel();var t=new tA(i._url,i._request,{status:408},"timeout");i._onTimeout&&(t.isTimeout=!0,i._onTimeout(t,{index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions})),t.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},i._loadCompleteReject(t)};var a=this._headers||{},n=Qv(e);n&&(a.Range=n),a&&Object.keys(a).forEach((function(e){r.setRequestHeader(e,a[e])})),this.player.debug.log(this.TAG_NAME,"[xhr.send->] tast,",this._range,",load sub range, ",e),r.send(this._body)}catch(t){t.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(t)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,i=e.target.status;if(i<200||i>299){var r=new tA(this._url,null,w(w({},e.target.response),{},{status:i}),"bad response,status:"+i);return r.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(r)}var a,n=null,o=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===Wv){var l,c=new Uint8Array(e.target.response);if(a=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var u=Date.now()-this._startTime,d=eA(this._receivedLength,u);this.emit(qv,{speed:d,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[a,s+this._receivedLength],priOptions:this._priOptions})}n=c,o=!((null===(l=this._range)||void 0===l?void 0:l.length)>1&&this._range[1]&&this._receivedLength], tast :",this._range,", start",a,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",o)}else o=!0,n=e.target.response;var h={ok:i>=200&&i<300,status:i,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(h=this._transformResponse(h,this._url)||h),this._onProgress&&this._onProgress(n,o,{index:this._index,vid:this._vid,range:[a,s+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},h),o?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve($v(this._onProgress?null:n,o,h,h.headers["content-length"],h.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,b(i,"removeAllListeners",this,3)([]),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,i=e.getAllResponseHeaders().trim().split("\r\n"),r={},a=f(i);try{for(a.s();!(t=a.n()).done;){var n=t.value,o=n.split(": ");r[o[0].toLowerCase()]=o.slice(1).join(": ")}}catch(s){a.e(s)}finally{a.f()}return r}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}])}(s),nA=function(e){function t(e,i){var r;return S(this,t),r=_(this,t),pu(m(r),"type",zv),pu(m(r),"_queue",[]),pu(m(r),"_alive",[]),pu(m(r),"_currentTask",null),pu(m(r),"_config",void 0),r.player=i,r._config=function(e){return w({loaderType:zv,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:Vv,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),r._config.loaderType!==Hv&&iA.isSupported()||(r.type=Hv),r}return k(t,e),T(t,[{key:"destroy",value:function(){this._queue=[],this._alive=[],this._currentTask=null}},{key:"isFetch",value:function(){return this.type===zv}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?i=e:i.url=e||i.url||this._config.url,i=Object.assign({},this._config,i),i.params&&(i.params=Object.assign({},i.params)),i.headers&&Yv(i.headers)&&(i.headers=Object.assign({},i.headers)),i.body&&Yv(i.body)&&(i.body=Object.assign({},i.body)),i.transformRequest&&(i=i.transformRequest(i)||i);var r=new rA(this.type,i,this.player);return r.loader.on(qv,(function(e){t.emit(qv,e)})),this._queue.push(r),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),r.promise}},{key:"cancel",value:function(){var e=A(v().mark((function e(){var t;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,i;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(i=e._alive)||void 0===i?void 0:i.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return iA.isSupported()}}])}(s),oA="network",sA="network_timeout",lA="other",cA="manifest",uA="hls",dA="demux",hA=function(e){function t(e,i,r,a,n){var o;return S(this,t),o=_(this,t,[n||(null==r?void 0:r.message)]),o.errorType=e===sA?oA:e,o.originError=r,o.ext=a,o.errorMessage=o.message,o}return k(t,e),T(t,null,[{key:"create",value:function(e,i,r,a,n){return e instanceof t?e:(e instanceof Error&&(r=e,e=""),e||(e=lA),new t(e,i,r,a,n))}},{key:"network",value:function(e){var i;return new t(null!=e&&e.isTimeout?sA:oA,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(i=e.response)||void 0===i?void 0:i.status})}}])}(y(Error)),pA=/^#(EXT[^:]*)(?::(.*))?$/,fA=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g,mA=/^(?:[a-zA-Z0-9+\-.]+:)?\/\//,gA=/^((?:[a-zA-Z0-9+\-.]+:)?\/\/[^/?#]*)?([^?#]*\/)?/;function yA(e){var t=e.match(pA);if(t&&t[1])return[t[1].replace("EXT-X-",""),t[2]]}function vA(e){for(var t={},i=fA.exec(e);i;)t[i[1]]=i[2]||i[3],i=fA.exec(e);return t}function AA(e,t){if(!t||!e||mA.test(e))return e;var i=gA.exec(t);return i?"/"===e[0]?i[1]+e:i[1]+i[2]+e:e}var bA={audio:[/^mp4a/,/^vorbis$/,/^opus$/,/^flac$/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function _A(e,t){var i=bA[e];if(i&&t&&t.length)for(var r=0;r>8*(15-t)&255}}}])}(),IA=function(){function e(){S(this,e)}return T(e,null,[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;if(!t.includes("#EXTM3U"))throw new Error("Invalid m3u8 file");var r=function(e){return e.split(/[\r\n]/).map((function(e){return e.trim()})).filter(Boolean)}(t);return e.isMediaPlaylist(t)?function(e,t){var i=new RA;i.url=t;for(var r,a=new DA,n=null,o=null,s=0,l=0,c=0,u=0,d=!1;(r=e[u++])&&!d;)if("#"===r[0]){var p=yA(r);if(p){var f=h(p,2),m=f[0],g=f[1];switch(m){case"VERSION":i.version=parseInt(g);break;case"PLAYLIST-TYPE":i.type=null==g?void 0:g.toUpperCase();break;case"TARGETDURATION":i.targetDuration=parseFloat(g);break;case"ENDLIST":var y=i.segments[i.segments.length-1];y&&(y.isLast=!0),i.live=!1,d=!0;break;case"MEDIA-SEQUENCE":l=i.startSN=parseInt(g);break;case"DISCONTINUITY-SEQUENCE":c=i.startCC=parseInt(g);break;case"DISCONTINUITY":c++;break;case"BYTERANGE":a.setByteRange(g,i.segments[i.segments.length-1]);break;case"EXTINF":var v=g.split(","),A=h(v,2),b=A[0],_=A[1];a.start=s,a.duration=parseFloat(b),s+=a.duration,a.title=_;break;case"KEY":var k=vA(g);if("NONE"===k.METHOD){o=null;break}if("AES-128"!==k.METHOD)throw new Error("encrypt ".concat(k.METHOD,"/").concat(k.KEYFORMAT," is not supported"));if(o=new LA,o.method=k.METHOD,o.url=/^blob:/.test(k.URI)?k.URI:AA(k.URI,t),o.keyFormat=k.KEYFORMAT||"identity",o.keyFormatVersions=k.KEYFORMATVERSIONS,k.IV){var w=k.IV.slice(2);w=(1&w.length?"0":"")+w,o.iv=new Uint8Array(w.length/2);for(var S=0,T=w.length/2;S3&&void 0!==arguments[3]?arguments[3]:i,a=[];return e&&(a[0]=this.loadVideoSegment(e,i)),t&&(a[1]=this.loadAudioSegment(t,r)),Promise.all(a)}},{key:"loadVideoSegment",value:function(e,t){return this._loadSegment(this._segmentLoader,e,t)}},{key:"loadAudioSegment",value:function(e,t){return this._loadSegment(this._audioSegmentLoader,e,t)}},{key:"_loadSegment",value:function(){var e=A(v().mark((function e(t,i,r){var a,n,o,s,l,c,u,d,p,f,m,g,y,A,b,_=this;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return u=[],this.hls.emit(ba,{url:i.url}),u[0]=t.load(i.url),r&&i.initSegment&&(p=i.initSegment.url,n=this._mapCache[p],n||(this.hls.emit(ba,{url:p}),u[1]=t.load(p).then((function(e){e&&(Object.keys(_._mapCache)>30&&(_._mapCache={}),n=_._mapCache[p]=e.data,_._emitOnLoaded(e,p))}))),f=null===(d=i.initSegment.key)||void 0===d?void 0:d.url,f&&(c=i.initSegment.key.iv,l=this._keyCache[f],l||(this.hls.emit(ba,{url:f}),u[2]=this._keyLoader.load(f).then((function(e){e&&(l=_._keyCache[f]=e.data,_._emitOnLoaded(e,f))}))))),m=null===(a=i.key)||void 0===a?void 0:a.url,m&&(s=i.key.iv,o=this._keyCache[m],o||(this.hls.emit(ba,{url:m}),u[3]=this._keyLoader.load(m).then((function(e){e&&(o=_._keyCache[m]=e.data,_._emitOnLoaded(e,m))})))),e.next=6,Promise.all(u);case 6:if(g=e.sent,y=h(g,1),A=y[0],A){e.next=11;break}return e.abrupt("return");case 11:return b=A.data,e.abrupt("return",(this._emitOnLoaded(A,i.url),{data:b,map:n,key:o,mapKey:l,keyIv:s,mapKeyIv:c}));case 13:case"end":return e.stop()}}),e,this)})));function t(t,i,r){return e.apply(this,arguments)}return t}()},{key:"reset",value:function(){this.error=null,this._mapCache={},this._keyCache={},this._bandwidthService.reset()}},{key:"cancel",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this._keyLoader.cancel(),this._segmentLoader.cancel(),this._audioSegmentLoader.cancel()]);case 2:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}])}(),UA=function(){function e(t,i,r){S(this,e),this.live=void 0,this.id=0,this.bitrate=0,this.width=0,this.height=0,this.name="",this.url="",this.audioCodec="",this.videoCodec="",this.textCodec="",this.startCC=0,this.endCC=0,this.startSN=0,this.endSN=-1,this.totalDuration=0,this.targetDuration=0,this.snDiff=null,this.segments=[],this.audioStreams=[],this.subtitleStreams=[],this.closedCaptions=[],this.currentAudioStream=null,this.currentSubtitleStream=null,this.TAG_NAME="HlsStream",this.update(t,i,r)}return T(e,[{key:"lastSegment",get:function(){return this.segments.length?this.segments[this.segments.length-1]:null}},{key:"segmentDuration",get:function(){var e;return this.targetDuration||(null===(e=this.segments[0])||void 0===e?void 0:e.duration)||0}},{key:"liveEdge",get:function(){return this.endTime}},{key:"endTime",get:function(){var e;return(null===(e=this.lastSegment)||void 0===e?void 0:e.end)||0}},{key:"currentSubtitleEndSn",get:function(){var e;return(null===(e=this.currentSubtitleStream)||void 0===e?void 0:e.endSN)||0}},{key:"clearOldSegment",value:function(e,t){return this._clearSegments(e,t)}},{key:"getAudioSegment",value:function(e){if(e&&this.currentAudioStream){var t=e.sn-this.snDiff;return this.currentAudioStream.segments.find((function(e){return e.sn===t}))}}},{key:"update",value:function(e,t){this.url=e.url,Array.isArray(e.segments)?(null!==this.live&&void 0!==this.live||(this.live=e.live),this._updateSegments(e,this),this.startCC=e.startCC,this.endCC=e.endCC,this.startSN=e.startSN,this.endSN=e.endSN||-1,this.totalDuration=e.totalDuration,this.targetDuration=e.targetDuration,this.live=e.live,t&&this.currentAudioStream&&Array.isArray(t.segments)&&(this._updateSegments(t,this.currentAudioStream),(null===this.snDiff||void 0===this.snDiff)&&e.segments.length&&t.segments.length&&(this.snDiff=e.segments[0].sn-t.segments[0].sn))):(this.id=e.id,this.bitrate=e.bitrate,this.width=e.width,this.height=e.height,this.name=e.name,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.textCodec=e.textCodec,this.audioStreams=e.audioStreams,this.subtitleStreams=e.subtitleStreams,!this.currentAudioStream&&this.audioStreams.length&&(this.currentAudioStream=this.audioStreams.find((function(e){return e.default}))||this.audioStreams[0]),!this.currentSubtitleStream&&this.subtitleStreams.length&&(this.currentSubtitleStream=this.subtitleStreams.find((function(e){return e.default}))||this.subtitleStreams[0]))}},{key:"updateSubtitle",value:function(e){var t=this;if(e&&this.currentSubtitleStream&&Array.isArray(e.segments)){var i=this._updateSegments(e,this.currentSubtitleStream),r=this.currentSubtitleStream.segments;return r.length>100&&(this.currentSubtitleStream.segments=r.slice(100)),i?i.map((function(e){return{sn:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end,lang:t.currentSubtitleStream.lang}})):void 0}}},{key:"switchSubtitle",value:function(e){var t=this.subtitleStreams.find((function(t){return t.lang===e})),i=this.currentSubtitleStream;t&&(this.currentSubtitleStream=t,i.segments=[])}},{key:"_clearSegments",value:function(e,t){for(var i=0,r=this.segments,a=0,n=r.length;a=e){i=a;break}return i>t&&(i=t),i&&(this.segments=this.segments.slice(i),this.currentAudioStream&&(this.currentAudioStream.segments=this.currentAudioStream.segments.slice(i))),t-i}},{key:"_updateSegments",value:function(e,t){var i=t.segments;if(this.live){var r=i[i.length-1],a=(null==r?void 0:r.sn)||-1;if(ao[0].cc&&o.forEach((function(e){return e.cc+=l}))}return t.endSN=e.endSN,t.segments=i.concat(o),o}}else t.segments=e.segments}}])}(),FA=function(){function e(t){S(this,e),this.hls=t,this.player=t.player,this.streams=[],this.currentStream=null,this.dvrWindow=0,this._segmentPointer=-1,this.TAG_NAME="HlsPlaylist"}return T(e,[{key:"destroy",value:function(){this.reset()}},{key:"lastSegment",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.lastSegment}},{key:"currentSegment",get:function(){var e;return null===(e=this.currentSegments)||void 0===e?void 0:e[this._segmentPointer]}},{key:"nextSegment",get:function(){var e;return null===(e=this.currentSegments)||void 0===e?void 0:e[this._segmentPointer+1]}},{key:"currentSegments",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.segments}},{key:"currentSubtitleEndSn",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.currentSubtitleEndSn}},{key:"liveEdge",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.liveEdge}},{key:"totalDuration",get:function(){var e;return(null===(e=this.currentStream)||void 0===e?void 0:e.totalDuration)||0}},{key:"seekRange",get:function(){var e=this.currentSegments;if(e&&e.length)return[e[0].start,e[e.length-1].end]}},{key:"isEmpty",get:function(){var e;return!(null!==(e=this.currentSegments)&&void 0!==e&&e.length)}},{key:"isLive",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.live}},{key:"hasSubtitle",get:function(){var e;return!(null===(e=this.currentStream)||void 0===e||!e.currentSubtitleStream)}},{key:"getAudioSegment",value:function(e){var t;return null===(t=this.currentStream)||void 0===t?void 0:t.getAudioSegment(e)}},{key:"moveSegmentPointer",value:function(e){var t;null==e&&(e=this._segmentPointer+1),this._segmentPointer=In(e,-1,null===(t=this.currentSegments)||void 0===t?void 0:t.length),this.player.debug.log(this.TAG_NAME,"moveSegmentPointer() and param pos is ".concat(e," and clamp result is ").concat(this._segmentPointer))}},{key:"reset",value:function(){this.streams=[],this.currentStream=null,this.dvrWindow=0,this._segmentPointer=-1}},{key:"getSegmentByIndex",value:function(e){var t;return null===(t=this.currentSegments)||void 0===t?void 0:t[e]}},{key:"setNextSegmentByIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._segmentPointer=e-1,this.player.debug.log(this.TAG_NAME,"setNextSegmentByIndex()",e,this._segmentPointer)}},{key:"findSegmentIndexByTime",value:function(e){var t=this.currentSegments;if(t){for(var i,r=0,a=t.length;r=i.start&&e0&&void 0!==arguments[0]?arguments[0]:50,t=this.currentStream;if(this.dvrWindow&&t){var i=t.endTime-this.dvrWindow;if(i<=0)this.player.debug.log(this.TAG_NAME,"clearOldSegment() stream.endTime:".concat(t.endTime,", this.dvrWindow:").concat(this.dvrWindow," startTime <= 0"));else{var r=t.segments;if(r.length<=e)this.player.debug.log(this.TAG_NAME,"clearOldSegment() segments.length:".concat(r.length," <= maxPlaylistSize:").concat(e));else{var a=this._segmentPointer;this._segmentPointer=t.clearOldSegment(i,a),this.player.debug.log(this.TAG_NAME,"clearOldSegment() update _segmentPointer:",a,this._segmentPointer),this.player.debug.log(this.TAG_NAME,"currentSegments",this.currentSegments)}}}}},{key:"checkSegmentTrackChange",value:function(e,t){var i=this.findSegmentIndexByTime(e),r=this.getSegmentByIndex(i);if(r&&(r.hasAudio||r.hasVideo)){if(2!==t&&r.hasAudio&&r.hasVideo)return r;if(!(r.end-e>.3)){var a=this.getSegmentByIndex(i+1);return!a||!a.hasAudio&&!a.hasVideo||a.hasAudio===r.hasAudio&&a.hasVideo===r.hasVideo?void 0:a}}}}])}(),OA=function(){function e(t,i){S(this,e),this.hls=t,this.player=i;var r=window.crypto||window.msCrypto;this.subtle=r&&(r.subtle||r.webkitSubtle),this.externalDecryptor=null}return T(e,[{key:"decrypt",value:function(e,t){if(e||t){var i=[];return e&&(i[0]=this._decryptSegment(e)),t&&(i[1]=this._decryptSegment(t)),Promise.all(i)}}},{key:"_decryptSegment",value:function(){var e=A(v().mark((function e(t){var i;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.data,e.t0=t.key,!e.t0){e.next=6;break}return e.next=5,this._decryptData(t.data,t.key,t.keyIv);case 5:i=e.sent;case 6:return e.abrupt("return",t.map?ku(t.map,i):i);case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_decryptData",value:function(){var e=A(v().mark((function e(t,i,r){var a,n;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.externalDecryptor){e.next=4;break}return e.next=3,this.externalDecryptor.decrypt(t,i,r);case 3:return e.abrupt("return",e.sent);case 4:if(!this.subtle){e.next=12;break}return e.next=7,this.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["encrypt","decrypt"]);case 7:return a=e.sent,e.next=10,this.subtle.decrypt({name:"AES-CBC",iv:r},a,t);case 10:return n=e.sent,e.abrupt("return",new Uint8Array(n));case 12:return t=Oc(t),i=Oc(i),r=Oc(r),e.abrupt("return",function(e){for(var t=e.words,i=e.sigBytes,r=new Uint8Array(i),a=0;a>>2]>>>24-a%4*8&255;return r}(Uc.AES.decrypt({ciphertext:t},i,{iv:r,mode:Uc.mode.CBC})));case 14:case"end":return e.stop()}}),e,this)})));function t(t,i,r){return e.apply(this,arguments)}return t}()}])}(),NA=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.player=e,i._pmtId=-1,i._remainingPacketData=null,i._videoPesData=[],i._audioPesData=[],i._gopId=0,i._videoPid=-1,i._audioPid=-1,i._codecType=Gt,i._audioCodecType=Vt,i._vps=null,i._sps=null,i._pps=null,i.TAG_NAME="HlsTsLoader",i._isForHls=!0,i.videoTrack=t.initVideoTrack(),i.audioTrack=t.initAudioTrack(),i._baseDts=-1,i._baseDtsInited=!1,i._basefps=25,i._baseFpsInterval=null,i._tempSampleTsList=[],i._hasAudio=!1,i._hasVideo=!1,i._audioNextPts=void 0,i._videoNextDts=void 0,i._audioTimestampBreak=!1,i._videoTimestampBreak=!1,i._lastAudioExceptionGapDot=0,i._lastAudioExceptionOverlapDot=0,i._lastAudioExceptionLargeGapDot=0,i._isSendAACSeqHeader=!1,i.workerClearTimeout=null,i.workerUrl=null,i.loopWorker=null,i.tempSampleListInfo={},i._isUseWorker()&&i._initLoopWorker(),i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.workerUrl&&(URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this.loopWorker&&(this.loopWorker.postMessage({cmd:"destroy"}),this.loopWorker.terminate(),this.loopWorker=null),this._stopDecodeLoopInterval(),this.videoTrack=null,this.audioTrack=null,this.tempSampleListInfo={},this._baseDts=-1,this._baseDtsInited=!1,this._basefps=25,this._hasCalcFps=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=!1,this._videoTimestampBreak=!1,this._lastAudioExceptionGapDot=0,this._lastAudioExceptionOverlapDot=0,this._lastAudioExceptionLargeGapDot=0,this._isForHls=!0,this._isSendAACSeqHeader=!1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_parsePES",value:function(e){var t=e[8];if(!(null==t||e.lengthe.length-6)){var a,n,o=e[7];return 192&o&&(a=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&o?(n=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,a-n>54e5&&(a=n)):n=a),{data:e.subarray(9+t),pts:a,dts:n,originalPts:a,originalDts:n}}}}},{key:"_demux",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];i&&(this._pmtId=-1,this.videoTrack=t.initVideoTrack(),this.audioTrack=t.initAudioTrack()),!r||i?(this._remainingPacketData=null,this._videoPesData=[],this._audioPesData=[]):(this.videoTrack.samples=[],this.audioTrack.samples=[],this._remainingPacketData&&(e=ku(this._remainingPacketData,e),this._remainingPacketData=null));var a=e.length,n=a%188;n&&(this._remainingPacketData=e.subarray(a-n),a-=n);for(var o=0;o>4>1){if(c=o+5+e[o+4],c===o+188)continue}else c=o+4;switch(l){case 0:s&&(c+=e[c]+1),this._pmtId=(31&e[c+10])<<8|e[c+11];break;case this._pmtId:s&&(c+=e[c]+1);var u=c+3+((15&e[c+1])<<8|e[c+2])-4;for(c+=12+((15&e[c+10])<<8|e[c+11]);c=t)return[];for(var a=[];r>>1&63:31&e[0];switch(t){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!a&&5!==t||a&&5===t)break;n.isIFrame=!0,r._gopId++;break;case 6:case 39:case 40:if(!a&&6!==t||a&&6===t)break;return void function(e,t){for(var i=e.length,r=t?2:1,a=0;255===e[r];)a+=255,r++;for(a+=e[r++];255===e[r];)255,r++;if(e[r++],5===a&&i>r+16)for(var n=0;n<16;n++)e[r].toString(16),r++;e.subarray(r)}(function(e){for(var t=e.byteLength,i=[],r=1;r=i)){var a=r,n=[],o=(60&e[r+2])>>>2,s=cn[o];if(!s)throw new Error("Invalid sampling index: ".concat(o));for(var l,c,u=1+((192&e[r+2])>>>6),d=(1&e[r+2])<<2|(192&e[r+3])>>>6,h=0,p=gn(s);r+7>5,i-r=i?void 0:e.subarray(r),frames:n,samplingFrequencyIndex:o,sampleRate:s,objectType:u,channelCount:d,originCodec:"mp4a.40.".concat(u)}}}(e.data,e.originalPts);if(t){if(this.audioTrack.codec=t.codec,this.audioTrack.sampleRate=t.sampleRate,this.audioTrack.channelCount=t.channelCount,!this._isSendAACSeqHeader){var i=hn({profile:t.objectType,sampleRate:t.samplingFrequencyIndex,channel:t.channelCount});this._isSendAACSeqHeader=!0,this.player.debug.log(this.TAG_NAME,"aac seq header","profile: ".concat(t.objectType,", sampleRate:").concat(t.sampleRate,",sampleRateIndex: ").concat(t.samplingFrequencyIndex,", channel: ").concat(t.channelCount)),this._doDecodeByHls(i,ot,0,!1,0)}if(this._isSendAACSeqHeader){var r=[];t.frames.forEach((function(e){var t=e.pts,i=new Uint8Array(e.data.length+2);i.set([175,1],0),i.set(e.data,2);var a={type:ot,pts:t,dts:t,payload:i};r.push(a)})),this.audioTrack.samples=this.audioTrack.samples.concat(r)}else this.player.debug.warn(this.TAG_NAME,"aac seq header not send")}else this.player.debug.warn(this.TAG_NAME,"aac parseADTS error")}this._audioPesData=[]}else e&&"startPrefixError"===e.code&&(this._audioPesData=[])}}},{key:"_fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(9e4*t);var a=this.videoTrack,n=this.audioTrack,o=a.samples,s=n.samples;if(o.length||s.length){var l=o[0],c=s[0],u=0;if(o.length&&s.length&&(u=l.dts-c.pts),this._baseDtsInited||this._calculateBaseDts(),i&&(this._calculateBaseDts(),this._baseDts-=t),!r){this._videoNextDts=u>0?t+u:t,this._audioNextPts=u>0?t:t-u;var d=l?l.dts-this._baseDts-this._videoNextDts:0,h=c?c.pts-this._baseDts-this._audioNextPts:0;Math.abs(d||h)>$a&&(this._calculateBaseDts(this.audioTrack,this.videoTrack),this._baseDts-=t)}this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(n),this._fixVideo(a);var p=a.samples.concat(n.samples);p=p.map((function(e){return e.dts=Math.round(e.dts/90),e.pts=Math.round(e.pts/90),e.cts=e.pts-e.dts,e})).sort((function(e,t){return e.dts-t.dts})),p.forEach((function(t){var i=new Uint8Array(t.payload);delete t.payload,e._isUseWorker()?e.loopWorker.postMessage(w(w({},t),{},{payload:i,cmd:"sample"}),[i.buffer]):t.type===st?e._doDecodeVideo(w(w({},t),{},{payload:i})):t.type===ot&&e._doDecodeAudio(w(w({},t),{},{payload:i}))})),No(this._hasCalcFps)&&this._isUseWorker()&&(this._hasCalcFps=!0,this._calcDecodeFps(p))}}},{key:"_isUseWorker",value:function(){return!this.player.isUseMSE()&&this.isForHls()}},{key:"_calculateBaseDts",value:function(){var e=this.audioTrack,t=this.videoTrack,i=e.samples,r=t.samples;if(!i.length&&!r.length)return!1;var a=1/0,n=1/0;i.length&&(e.baseDts=a=i[0].pts),r.length&&(t.baseDts=n=r[0].dts),this._baseDts=Math.min(a,n);var o=n-a;return Number.isFinite(o)&&Math.abs(o)>45e3&&this.player.debug.warn(this.TAG_NAME,"large av first frame gap,\n video pts: ".concat(n,",\n audio pts: ").concat(a,",\n base dts: ").concat(this._baseDts,",\n detect is: ").concat(o)),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){if(this._baseDtsInited&&this._videoTimestampBreak&&this._audioTimestampBreak){if(!this._calculateBaseDts(this.audioTrack,this.videoTrack))return;this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts),this._audioLastSample=null,this._videoLastSample=null,this._videoTimestampBreak=!1,this._audioTimestampBreak=!1}}},{key:"_fixAudio",value:function(e){var t=this,i=e.samples;i.length&&(i.forEach((function(e){e.pts-=t._baseDts,e.dts=e.pts})),this._doFixAudioInternal(e,i,9e4))}},{key:"_fixVideo",value:function(e){var t=this,i=e.samples;if(i.length){if(i.forEach((function(e){e.dts-=t._baseDts,e.pts-=t._baseDts})),void 0===this._videoNextDts){var r=i[0];this._videoNextDts=r.dts}var a,n=i.length,o=0,s=i[0],l=i[1],c=this._videoNextDts-s.dts;Math.abs(c)>45e3&&(s.dts+=c,s.pts+=c,this.player.debug.warn(this.TAG_NAME,"large video gap between chunk,\n next dts is ".concat(this._videoNextDts,",\n first dts is ").concat(s.dts,",\n next dts is ").concat(l.dts,",\n duration is ").concat(c)),l&&Math.abs(l.dts-s.dts)>$a&&(this._videoTimestampBreak=!0,i.forEach((function(e,t){0!==t&&(e.dts+=c,e.pts+=c)}))));var u=e.samples[0],d=e.samples[n-1];a=1===n?9e3:Math.floor((d.dts-u.dts)/(n-1));for(var h=0;h$a||o<0){this._videoTimestampBreak=!0,o=this._audioTimestampBreak?a:Math.max(o,2700);var m=this._audioNextPts||0;f&&f.dts>m&&(o=a),this.player.debug.warn(this.TAG_NAME,"large video gap between frames,\n time is ".concat(p/e.timescale,",\n dts is ").concat(p,",\n origin dts is ").concat(i[h].originalDts,",\n next dts is ").concat(this._videoNextDts,",\n sample Duration is ").concat(o," ,\n ref Sample DurationInt is ").concat(a))}i[h].duration=o,this._videoNextDts+=o}}}},{key:"_doFixAudioInternal",value:function(e,t,i){e.sampleDuration||(e.sampleDuration=gn(e.timescale,i));var r=e.sampleDuration;if(void 0===this._audioNextPts){var a=t[0];this._audioNextPts=a.pts}for(var n=0;n=3*r&&l<=Xa&&!Wn()){mn(e.codec,e.channelCount)||t[0].data.subarray();var c=Math.floor(l/r);Math.abs(s.pts-this._lastAudioExceptionGapDot)>Za&&(this._lastAudioExceptionGapDot=s.pts),this.player.debug.warn(this.TAG_NAME,"audio gap detected,\n pts is ".concat(t.pts,",\n originPts is ").concat(t.originalPts,",\n count is ").concat(c,",\n nextPts is ").concat(o,",\n ref sample duration is ").concat(r));for(var u=0;u=-9e4?(Math.abs(s.pts-this._lastAudioExceptionOverlapDot)>Za&&(this._lastAudioExceptionOverlapDot=s.pts,this.player.debug.warn(this.TAG_NAME,"audio overlap detected,\n pts is ".concat(s.pts,",\n originPts is ").concat(s.originalPts,",\n nextPts is ").concat(o,",\n ref sample duration is ").concat(r))),t.splice(n,1),n--):(Math.abs(l)>=Xa&&(this._audioTimestampBreak=!0,Math.abs(s.pts-this._lastAudioExceptionLargeGapDot)>Za&&(this._lastAudioExceptionLargeGapDot=s.pts,this.player.debug.warn(this.TAG_NAME,"large audio gap detected,\n time is ".concat(s.pts/1e3,"\n pts is ").concat(s.pts,",\n originPts is ").concat(s.originalPts,",\n nextPts is ").concat(o,",\n sample duration is ").concat(l,"\n ref sample duration is ").concat(r)))),s.dts=s.pts=o,this._audioNextPts+=r)}}},{key:"_calcDecodeFps",value:function(e){var t=Lo(e.map((function(e){return{ts:e.dts||e.pts,type:e.type}})),st);t&&(this.player.debug.log(this.TAG_NAME,"_calcDecodeFps() video fps is ".concat(t,", update base fps is ").concat(this._basefps)),this._basefps=t),this._postMessageToLoopWorker("updateBaseFps",{baseFps:this._basefps})}},{key:"_initLoopWorker",value:function(){var e=this;this.player.debug.log(this.TAG_NAME,"_initLoopWorker()");var t=Jo(function(){var e=1,t=2,i=new(function(){function i(){S(this,i),this.baseFps=0,this.fpsInterval=null,this.preLoopTimestamp=null,this.startBpsTime=null,this.allSampleList=[]}return T(i,[{key:"destroy",value:function(){this._clearInterval(),this.baseFps=0,this.allSampleList=[],this.preLoopTimestamp=null,this.startBpsTime=null}},{key:"updateBaseFps",value:function(e){this.baseFps=e,this._clearInterval(),this._startInterval()}},{key:"pushSample",value:function(e){delete e.cmd,this.allSampleList.push(e)}},{key:"_startInterval",value:function(){var e=this,t=Math.ceil(1e3/this.baseFps);this.fpsInterval=setInterval((function(){var i=(new Date).getTime();e.preLoopTimestamp||(e.preLoopTimestamp=i),e.startBpsTime||(e.startBpsTime=i);var r=i-e.preLoopTimestamp;r>2*t&&console.warn("JbPro:[TsLoader LoopWorker] loop interval is ".concat(r,"ms, more than ").concat(t," * 2ms")),e._loop(),e.preLoopTimestamp=(new Date).getTime(),e.startBpsTime&&i-e.startBpsTime>=1e3&&(e._calcSampleList(),e.startBpsTime=i)}),t)}},{key:"_clearInterval",value:function(){this.fpsInterval&&(clearInterval(this.fpsInterval),this.fpsInterval=null)}},{key:"_calcSampleList",value:function(){var i={buferredDuration:0,allListLength:this.allSampleList.length,audioListLength:0,videoListLength:0};this.allSampleList.forEach((function(r){r.type===t?(i.videoListLength++,r.duration&&(i.buferredDuration+=Math.round(r.duration/90))):r.type===e&&i.audioListLength++})),postMessage(w({cmd:"sampleListInfo"},i))}},{key:"_loop",value:function(){var i=null;if(this.allSampleList.length)if(i=this.allSampleList.shift(),i.type===t){postMessage(w({cmd:"decodeVideo"},i),[i.payload.buffer]);for(var r=this.allSampleList[0];r&&r.type===e;)i=this.allSampleList.shift(),postMessage(w({cmd:"decodeAudio"},i),[i.payload.buffer]),r=this.allSampleList[0]}else i.type===e&&(postMessage(w({cmd:"decodeAudio"},i),[i.payload.buffer]),this.allSampleList.length&&this.allSampleList[0].type===t&&(i=this.allSampleList.shift(),postMessage(w({cmd:"decodeVideo"},i),[i.payload.buffer])))}}])}());self.onmessage=function(e){var t=e.data;switch(t.cmd){case"updateBaseFps":i.updateBaseFps(t.baseFps);break;case"sample":i.pushSample(t);break;case"destroy":i.destroy(),i=null}}}.toString()),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),a=new Worker(r);this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(e.workerUrl),e.workerUrl=null,e.workerClearTimeout=null}),ke),a.onmessage=function(t){var i=t.data;switch(i.cmd){case"decodeVideo":e._doDecodeVideo(i);break;case"decodeAudio":e._doDecodeAudio(i);break;case"sampleListInfo":e.tempSampleListInfo=i}},this.loopWorker=a}},{key:"_postMessageToLoopWorker",value:function(e,t){this._isUseWorker()&&(this.loopWorker?this.loopWorker.postMessage(w({cmd:e},t)):this.player.debug.warn(this.TAG_NAME,"loop worker is not init, can not post message"))}},{key:"_doDecodeAudio",value:function(e){var t=new Uint8Array(e.payload);this.player.updateStats({abps:t.byteLength});var i=t;Oo(this.player._opt.m7sCryptoAudio)&&(i=this.cryptoPayloadAudio(t)),this.isForHls()?this._doDecodeByHls(i,ot,e.dts,!1,0):this._doDecodeByTs(i,ot,e.dts,!1,0)}},{key:"_doDecodeVideo",value:function(e){var t=new Uint8Array(e.payload),i=null;i=e.isHevc?hl(t,e.isIFrame):Zs(t,e.isIFrame),this.player.updateStats({dts:e.dts,vbps:i.byteLength});var r=e.pts-e.dts,a=this.cryptoPayload(i,e.isIFrame);this.isForHls()?this._doDecodeByHls(a,st,e.dts,e.isIFrame,r):this._doDecodeByTs(a,st,e.dts,e.isIFrame,r)}},{key:"_stopDecodeLoopInterval",value:function(){this._baseFpsInterval&&(clearInterval(this._baseFpsInterval),this._baseFpsInterval=null)}},{key:"getBuferredDuration",value:function(){return this.tempSampleListInfo.buferredDuration||0}},{key:"getSampleListLength",value:function(){return this.tempSampleListInfo.allListLength||0}},{key:"getSampleAudioListLength",value:function(){return this.tempSampleListInfo.audioListLength||0}},{key:"getSampleVideoListLength",value:function(){return this.tempSampleListInfo.videoListLength||0}},{key:"isForHls",value:function(){return this._isForHls}},{key:"getInputByteLength",value:function(){return this._remainingPacketData&&this._remainingPacketData.byteLength||0}}],[{key:"initVideoTrack",value:function(){return{samples:[]}}},{key:"initAudioTrack",value:function(){return{samples:[]}}},{key:"probe",value:function(e){return!!e.length&&71===e[0]&&71===e[188]&&71===e[376]}}])}(iu);function jA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function GA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function zA(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Math.pow(2,32);return GA(e,t)*i+GA(e,t+4)}var HA="aac",WA="g7110a",VA="g7110m",JA="avc",qA="hevc",KA=function(){function e(){S(this,e)}return T(e,null,[{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"getRateIndexByRate",value:function(t){return e.FREQ.indexOf(t)}}])}();function YA(e,t,i,r,a,n){var o,s,l,c=[],u=null==a?void 0:a.entries,d=t.entries,h=r.entries,p=i.entrySizes,f=null==n?void 0:n.entries;f&&(o={},f.forEach((function(e){o[e-1]=!0}))),u&&(s=[],u.forEach((function(e){for(var t=e.count,i=e.offset,r=0;r=k&&(A++,k=d[A+1]?d[A+1].firstChunk-1:1/0),_+=d[A].samplesPerChunk)})),c}function QA(e,t){return e.dataReferenceIndex=jA(t,6),e.width=jA(t,24),e.height=jA(t,26),e.horizresolution=GA(t,28),e.vertresolution=GA(t,32),e.frameCount=jA(t,40),e.depth=jA(t,74),78}function XA(e,t){return e.dataReferenceIndex=jA(t,6),e.channelCount=jA(t,16),e.sampleSize=jA(t,18),e.sampleRate=GA(t,24)/65536,28}function ZA(e,t,i){if(e){if(e.size!==e.data.length)throw new Error("box ".concat(e.type," size !== data.length"));var r={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(r.version=e.data[e.headerSize],r.flags=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<16)+(e[t+1]<<8)+(e[t+2]||0)}(e.data,e.headerSize+1),r.headerSize+=4),i(r,e.data.subarray(r.headerSize),r.start+r.headerSize),r}}pu(KA,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var $A=function(e,t,i){for(var r=String(i),a=t>>0,n=Math.ceil(a/r.length),o=[],s=String(e);n--;)o.push(r);return o.join("").substring(0,a-s.length)+s},eb=function(){for(var e=[],t=arguments.length,i=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:0,a=[];if(!t)return a;for(var n=0,o="",s=0;t.length>7;){if(n=GA(t),o=String.fromCharCode.apply(null,t.subarray(4,8)),s=8,1===n?(n=zA(t,8),s+=8):n||(n=t.length),!i[0]||o===i[0]){var l=t.subarray(0,n);if(!(i.length<2))return e.findBox(l.subarray(s),i.slice(1),r+s);a.push({start:r,size:n,headerSize:s,type:o,data:l})}r+=n,t=t.subarray(n)}return a}},{key:"tfhd",value:function(e){return ZA(e,!0,(function(e,t){e.trackId=GA(t);var i=4,r=1&e.flags,a=2&e.flags,n=8&e.flags,o=16&e.flags,s=32&e.flags;r&&(i+=4,e.baseDataOffset=GA(t,i),i+=4),a&&(e.sampleDescriptionIndex=GA(t,i),i+=4),n&&(e.defaultSampleDuration=GA(t,i),i+=4),o&&(e.defaultSampleSize=GA(t,i),i+=4),s&&(e.defaultSampleFlags=GA(t,i))}))}},{key:"sidx",value:function(e){return ZA(e,!0,(function(e,t){var i=0;e.reference_ID=GA(t,i),i+=4,e.timescale=GA(t,i),i+=4,0===e.version?(e.earliest_presentation_time=GA(t,i),i+=4,e.first_offset=GA(t,i),i+=4):(e.earliest_presentation_time=zA(t,i),i+=8,e.first_offset=zA(t,i),i+=8),i+=2,e.references=[];var r=jA(t,i);i+=2;for(var a=0;a>31&1,n.referenced_size=2147483647&o,n.subsegment_duration=GA(t,i),i+=4,o=GA(t,i),i+=4,n.starts_with_SAP=o>>31&1,n.SAP_type=o>>28&7,n.SAP_delta_time=268435455&o}}))}},{key:"moov",value:function(t){return ZA(t,!1,(function(t,i,r){t.mvhd=e.mvhd(e.findBox(i,["mvhd"],r)[0]),t.trak=e.findBox(i,["trak"],r).map((function(t){return e.trak(t)})),t.pssh=e.pssh(e.findBox(i,["pssh"],r)[0])}))}},{key:"mvhd",value:function(e){return ZA(e,!0,(function(e,t){var i=0;1===e.version?(e.timescale=GA(t,16),e.duration=zA(t,20),i+=28):(e.timescale=GA(t,8),e.duration=GA(t,12),i+=16),e.nextTrackId=GA(t,i+76)}))}},{key:"trak",value:function(t){return ZA(t,!1,(function(t,i,r){t.tkhd=e.tkhd(e.findBox(i,["tkhd"],r)[0]),t.mdia=e.mdia(e.findBox(i,["mdia"],r)[0])}))}},{key:"tkhd",value:function(e){return ZA(e,!0,(function(e,t){var i=0;1===e.version?(e.trackId=GA(t,16),e.duration=zA(t,24),i+=32):(e.trackId=GA(t,8),e.duration=GA(t,16),i+=20),e.width=GA(t,i+52),e.height=GA(t,i+56)}))}},{key:"mdia",value:function(t){return ZA(t,!1,(function(t,i,r){t.mdhd=e.mdhd(e.findBox(i,["mdhd"],r)[0]),t.hdlr=e.hdlr(e.findBox(i,["hdlr"],r)[0]),t.minf=e.minf(e.findBox(i,["minf"],r)[0])}))}},{key:"mdhd",value:function(e){return ZA(e,!0,(function(e,t){var i=0;1===e.version?(e.timescale=GA(t,16),e.duration=zA(t,20),i+=28):(e.timescale=GA(t,8),e.duration=GA(t,12),i+=16);var r=jA(t,i);e.language=String.fromCharCode(96+(r>>10&31),96+(r>>5&31),96+(31&r))}))}},{key:"hdlr",value:function(e){return ZA(e,!0,(function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))}))}},{key:"minf",value:function(t){return ZA(t,!1,(function(t,i,r){t.vmhd=e.vmhd(e.findBox(i,["vmhd"],r)[0]),t.smhd=e.smhd(e.findBox(i,["smhd"],r)[0]),t.stbl=e.stbl(e.findBox(i,["stbl"],r)[0])}))}},{key:"vmhd",value:function(e){return ZA(e,!0,(function(e,t){e.graphicsmode=jA(t),e.opcolor=[jA(t,2),jA(t,4),jA(t,6)]}))}},{key:"smhd",value:function(e){return ZA(e,!0,(function(e,t){e.balance=jA(t)}))}},{key:"stbl",value:function(t){return ZA(t,!1,(function(t,i,r){var a,n,o;t.stsd=e.stsd(e.findBox(i,["stsd"],r)[0]),t.stts=e.stts(e.findBox(i,["stts"],r)[0]),t.ctts=e.ctts(e.findBox(i,["ctts"],r)[0]),t.stsc=e.stsc(e.findBox(i,["stsc"],r)[0]),t.stsz=e.stsz(e.findBox(i,["stsz"],r)[0]),t.stco=e.stco(e.findBox(i,["stco"],r)[0]),t.stco||(t.co64=e.co64(e.findBox(i,["co64"],r)[0]),t.stco=t.co64);var s=null===(a=t.stsd.entries[0])||void 0===a||null===(n=a.sinf)||void 0===n||null===(o=n.schi)||void 0===o?void 0:o.tenc.default_IV_size;t.stss=e.stss(e.findBox(i,["stss"],r)[0]),t.senc=e.senc(e.findBox(i,["senc"],r)[0],s)}))}},{key:"senc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return ZA(e,!0,(function(e,i){var r=0,a=GA(i,r);r+=4,e.samples=[];for(var n=0;n0){var o=GA(t,a);a+=4;for(var s=0;s<(""+o).length;s++)for(var l=0;l<16;l++){var c=t[a];a+=1,i.push(eb(c))}}var u=GA(t,a);e.data_size=u,a+=4,e.kid=i,e.system_id=r,e.buffer=t}))}},{key:"stsd",value:function(t){return ZA(t,!0,(function(t,i,r){t.entryCount=GA(i),t.entries=e.findBox(i.subarray(4),[],r+4).map((function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t);case"enca":return ZA(t,!1,(function(t,i,r){t.channelCount=jA(i,16),t.samplesize=jA(i,18),t.sampleRate=GA(i,24)/65536,i=i.subarray(28),t.sinf=e.sinf(e.findBox(i,["sinf"],r)[0]),t.esds=e.esds(e.findBox(i,["esds"],r)[0])}));case"encv":return ZA(t,!1,(function(t,i,r){t.width=jA(i,24),t.height=jA(i,26),t.horizresolution=GA(i,28),t.vertresolution=GA(i,32),i=i.subarray(78),t.sinf=e.sinf(e.findBox(i,["sinf"],r)[0]),t.avcC=e.avcC(e.findBox(i,["avcC"],r)[0]),t.hvcC=e.hvcC(e.findBox(i,["hvcC"],r)[0]),t.pasp=e.pasp(e.findBox(i,["pasp"],r)[0])}))}})).filter(Boolean)}))}},{key:"tenc",value:function(e){return ZA(e,!1,(function(e,t){var i=6;e.default_IsEncrypted=t[i],i+=1,e.default_IV_size=t[i],i+=1,e.default_KID=[];for(var r=0;r<16;r++)e.default_KID.push(eb(t[i])),i+=1}))}},{key:"schi",value:function(t){return ZA(t,!1,(function(t,i,r){t.tenc=e.tenc(e.findBox(i,["tenc"],r)[0])}))}},{key:"sinf",value:function(t){return ZA(t,!1,(function(t,i,r){t.schi=e.schi(e.findBox(i,["schi"],r)[0]),t.frma=e.frma(e.findBox(i,["frma"],r)[0])}))}},{key:"frma",value:function(e){return ZA(e,!1,(function(e,t){e.data_format="";for(var i=0;i<4;i++)e.data_format+=String.fromCharCode(t[i])}))}},{key:"avc1",value:function(t){return ZA(t,!1,(function(t,i,r){var a=QA(t,i),n=i.subarray(a);r+=a,t.avcC=e.avcC(e.findBox(n,["avcC"],r)[0]),t.pasp=e.pasp(e.findBox(n,["pasp"],r)[0])}))}},{key:"avcC",value:function(e){return ZA(e,!1,(function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=function(e){for(var t,i="avc1.",r=0;r<3;r++)t=e[r].toString(16),t.length<2&&(t="0".concat(t)),i+=t;return i}([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var i=6,r=0;r>6,t.generalTierFlag=(32&r)>>5,t.generalProfileIdc=31&r,t.generalProfileCompatibility=GA(i,2),t.generalConstraintIndicatorFlags=i.subarray(6,12),t.generalLevelIdc=i[12],t.avgFrameRate=jA(i,19),t.numOfArrays=i[22],t.vps=[],t.sps=[],t.pps=[];for(var a=23,n=0,o=0,s=0,l=0;l>3;return 31===s&&o.length>=2&&(s=32+((7&o[0])<<3)+((224&o[1])>>5)),e.objectType=s,e.codec+=s.toString(16),void("."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1)))}return void("."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1)))}e.codec+=(t[i].toString(16)+".").padStart(3,"0"),t=t.subarray(i+13)}}}))}},{key:"alaw",value:function(e){return ZA(e,!1,(function(e,t){XA(e,t)}))}},{key:"stts",value:function(e){return ZA(e,!0,(function(e,t){for(var i=GA(t),r=[],a=4,n=0;no&&1&r&&(e.dataOffset=-(1+~GA(t,o)),o+=4),a>o&&4&r&&(e.firstSampleFlags=GA(t,o),o+=4),e.samples=[],a>o)for(var s,l=0;l>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}}},{key:"moovToTrack",value:function(e,t,i){var r,a,n=e.trak;if(n&&n.length){var o=n.find((function(e){var t,i;return"vide"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)})),s=n.find((function(e){var t,i;return"soun"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)}));if(o&&t){var l,c,u,d,h,p,f,m=t,g=null===(l=o.tkhd)||void 0===l?void 0:l.trackId;null!=g&&(m.id=o.tkhd.trackId),m.tkhdDuration=o.tkhd.duration,m.mvhdDurtion=e.mvhd.duration,m.mvhdTimecale=e.mvhd.timescale,m.timescale=m.formatTimescale=o.mdia.mdhd.timescale,m.duration=o.mdia.mdhd.duration||m.mvhdDurtion/m.mvhdTimecale*m.timescale;var y,v,A,b,_,k,w,S,T=o.mdia.minf.stbl.stsd.entries[0];if(m.width=T.width,m.height=T.height,T.pasp&&(m.sarRatio=[T.pasp.hSpacing,T.pasp.vSpacing]),T.hvcC)m.codecType=qA,m.codec=T.hvcC.codec,m.vps=T.hvcC.vps,m.sps=T.hvcC.sps,m.pps=T.hvcC.pps,m.hvcC=T.hvcC.data;else{if(!T.avcC)throw new Error("unknown video stsd entry");m.codecType=JA,m.codec=T.avcC.codec,m.sps=T.avcC.sps,m.pps=T.avcC.pps}m.present=!0,m.ext={},m.ext.stss=null===(c=o.mdia)||void 0===c||null===(u=c.minf)||void 0===u||null===(d=u.stbl)||void 0===d?void 0:d.stss,m.ext.ctts=null===(h=o.mdia)||void 0===h||null===(p=h.minf)||void 0===p||null===(f=p.stbl)||void 0===f?void 0:f.ctts,T&&"encv"===T.type&&(m.isVideoEncryption=!0,T.default_KID=null===(y=T.sinf)||void 0===y||null===(v=y.schi)||void 0===v?void 0:v.tenc.default_KID,T.default_IsEncrypted=null===(A=T.sinf)||void 0===A||null===(b=A.schi)||void 0===b?void 0:b.tenc.default_IsEncrypted,T.default_IV_size=null===(_=T.sinf)||void 0===_||null===(k=_.schi)||void 0===k?void 0:k.tenc.default_IV_size,m.videoSenc=o.mdia.minf.stbl.senc&&o.mdia.minf.stbl.senc.samples,T.data_format=null===(w=T.sinf)||void 0===w||null===(S=w.frma)||void 0===S?void 0:S.data_format,m.useEME=e.useEME,m.kidValue=e.kidValue,m.pssh=e.pssh,m.encv=T)}if(s&&i){var E,C,x,R,D,L,I,P,B,M=i,U=null===(E=s.tkhd)||void 0===E?void 0:E.trackId;null!=U&&(M.id=s.tkhd.trackId),M.tkhdDuration=s.tkhd.duration,M.mvhdDurtion=e.mvhd.duration,M.mvhdTimecale=e.mvhd.timescale,M.timescale=M.formatTimescale=s.mdia.mdhd.timescale,M.duration=s.mdia.mdhd.duration||M.mvhdDurtion/M.mvhdTimecale*M.timescale;var F,O,N,j,G,z,H,W,V=s.mdia.minf.stbl.stsd.entries[0];switch(M.sampleSize=V.sampleSize,M.sampleRate=V.sampleRate,M.channelCount=V.channelCount,M.present=!0,V.type){case"alaw":M.codecType=M.codec=WA,M.sampleRate=8e3;break;case"ulaw":M.codecType=M.codec=VA,M.sampleRate=8e3;break;default:M.codecType=HA,M.sampleDuration=KA.getFrameDuration(M.sampleRate,M.timescale),M.sampleRateIndex=KA.getRateIndexByRate(M.sampleRate),M.objectType=(null===(r=V.esds)||void 0===r?void 0:r.objectType)||2,V.esds&&(M.config=Array.from(V.esds.config)),M.codec=(null===(a=V.esds)||void 0===a?void 0:a.codec)||"mp4a.40.2"}M.sampleDuration=KA.getFrameDuration(M.sampleRate,M.timescale),M.objectType=(null===(C=V.esds)||void 0===C?void 0:C.objectType)||2,V.esds&&(V.esds.config?M.config=Array.from(V.esds.config):console.warn("esds config is null")),M.codec=(null===(x=V.esds)||void 0===x?void 0:x.codec)||"mp4a.40.2",M.sampleRateIndex=KA.getRateIndexByRate(M.sampleRate),M.ext={},M.ext.stss=null===(R=s.mdia)||void 0===R||null===(D=R.minf)||void 0===D||null===(L=D.stbl)||void 0===L?void 0:L.stss,M.ext.ctts=null===(I=s.mdia)||void 0===I||null===(P=I.minf)||void 0===P||null===(B=P.stbl)||void 0===B?void 0:B.ctts,M.present=!0,V&&"enca"===V.type&&(M.isAudioEncryption=!0,V.data_format=null===(F=V.sinf)||void 0===F||null===(O=F.frma)||void 0===O?void 0:O.data_format,V.default_KID=null===(N=V.sinf)||void 0===N||null===(j=N.schi)||void 0===j?void 0:j.tenc.default_KID,V.default_IsEncrypted=null===(G=V.sinf)||void 0===G||null===(z=G.schi)||void 0===z?void 0:z.tenc.default_IsEncrypted,V.default_IV_size=null===(H=V.sinf)||void 0===H||null===(W=H.schi)||void 0===W?void 0:W.tenc.default_IV_size,M.audioSenc=s.mdia.minf.stbl.senc&&s.mdia.minf.stbl.senc.samples,M.useEME=e.useEME,M.kidValue=e.kidValue,M.enca=V)}if(i&&(i.isVideoEncryption=!!t&&t.isVideoEncryption),t&&(t.isAudioEncryption=!!i&&i.isAudioEncryption),null!=t&&t.encv||null!=i&&i.enca){var J,q,K=null==t||null===(J=t.encv)||void 0===J?void 0:J.default_KID,Y=null==i||null===(q=i.enca)||void 0===q?void 0:q.default_KID,Q=K||Y?(K||Y).join(""):null;t&&(t.kid=Q),i&&(i.kid=Q)}return t&&(t.flags=3841),i&&(i.flags=1793),{videoTrack:t,audioTrack:i}}}},{key:"evaluateDefaultDuration",value:function(e,t,i){var r,a=null==t||null===(r=t.samples)||void 0===r?void 0:r.length;return a?1024*a/t.timescale*e.timescale/i:1024}},{key:"moofToSamples",value:function(t,i,r){var a={};return t.mfhd&&(i&&(i.sequenceNumber=t.mfhd.sequenceNumber),r&&(r.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach((function(t){var n=t.tfhd,o=t.tfdt,s=t.trun;if(n&&s){o&&(i&&i.id===n.trackId&&(i.baseMediaDecodeTime=o.baseMediaDecodeTime),r&&r.id===n.trackId&&(r.baseMediaDecodeTime=o.baseMediaDecodeTime));var l=n.defaultSampleSize||0,c=n.defaultSampleDuration||e.evaluateDefaultDuration(i,r,s.samples.length||s.sampleCount),u=s.dataOffset||0,d=0,h=-1;if(!s.samples.length&&s.sampleCount){a[n.trackId]=[];for(var p=0;p>>0!=65536}).keyframe&&(h++,e.gopId=h),d+=e.duration,u+=e.size,e}))}})),a}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var i=t.find((function(e){var t,i;return"vide"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)})),r=t.find((function(e){var t,i;return"soun"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)}));if(i||r){var a,n;if(i){var o,s,l=null===(o=i.mdia)||void 0===o||null===(s=o.minf)||void 0===s?void 0:s.stbl;if(!l)return;var c=l.stts,u=l.stsc,d=l.stsz,h=l.stco,p=l.stss,f=l.ctts;if(!(c&&u&&d&&h&&p))return;a=YA(c,u,d,h,f,p)}if(r){var m,g,y,v=null===(m=r.mdia)||void 0===m||null===(g=m.minf)||void 0===g?void 0:g.stbl;if(!v)return;var A=null===(y=r.mdia.mdhd)||void 0===y?void 0:y.timescale,b=v.stts,_=v.stsc,k=v.stsz,w=v.stco;if(!(A&&b&&_&&k&&w))return;n=YA(b,_,k,w)}return{videoSamples:a,audioSamples:n}}}}}])}(),ib=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.player=e,i.TAG_NAME="HlsFmp4Loader",i.tempSampleListInfo={},i.isInitVideo=!1,i.isInitAudio=!1,i.videoTrack={id:1,samples:[],sps:[],pps:[],vps:[],codec:""},i.audioTrack={id:2,samples:[],sampleRate:0,channelCount:0,codec:"",codecType:""},i.workerClearTimeout=null,i.workerUrl=null,i.loopWorker=null,i._hasCalcFps=!1,i._basefps=25,i.player.isUseMSE()||i._initLoopWorker(),e.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.workerUrl&&(URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this.loopWorker&&(this.loopWorker.postMessage({cmd:"destroy"}),this.loopWorker.terminate(),this.loopWorker=null),this._hasCalcFps=!1,this.videoTrack=null,this.audioTrack=null,this.isInitVideo=!1,this.isInitAudio=!1,this._basefps=25,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"demux",value:function(e,t){var i=this,r=this.audioTrack,a=this.videoTrack;if(this.checkInitAudio(),this.checkInitVideo(),r.samples=[],a.samples=[],t){if(this.player.updateStats({abps:t.byteLength}),No(this.isInitAudio)){var n=tb.findBox(t,["moov"])[0];if(!n)return void this.player.debug.error(this.TAG_NAME,"cannot found moov box");tb.moovToTrack(tb.moov(n),null,r),this.checkInitAudio()&&(this.player.debug.log(this.TAG_NAME,"audioData audio init success"),this._sendAccADTSHeader(r))}var o=tb.findBox(t,["moof"])[0];if(o){var s=tb.moofToSamples(tb.moof(o),null,r)[r.id],l=r.baseMediaDecodeTime;if(s){var c=o.start;s.map((function(e){e.offset+=c;var i=t.subarray(e.offset,e.offset+e.size),a=e.dts+l,n=new Uint8Array(i.length+2);n.set([175,1],0),n.set(i,2),r.samples.push({type:ot,pts:a,dts:a,payload:n,duration:e.duration,size:n.byteLength})}))}}}if(e){if(this.player.updateStats({vbps:e.byteLength}),No(this.isInitVideo)&&No(this.isInitAudio)){var u=tb.findBox(e,["moov"])[0];if(!u)throw new Error("cannot found moov box");if(tb.moovToTrack(tb.moov(u),a,r),No(this.isInitAudio)&&this.checkInitAudio()&&(this.player.debug.log(this.TAG_NAME,"videoData audio init success",r),this._sendAccADTSHeader(r)),this.checkInitVideo()){this.player.debug.log(this.TAG_NAME,"video init success");var d=null;a.codecType===Er?a.sps.length&&a.vps.length&&a.pps.length&&(d=dl({sps:a.sps[0],pps:a.pps[0],vps:a.vps[0]})):a.sps.length&&a.pps.length&&(d=Xs({sps:a.sps[0],pps:a.pps[0]})),d&&(this.player.debug.log(this.TAG_NAME,"seqHeader"),this._doDecodeByHls(d,st,0,!0,0))}}var h=tb.findBox(e,["moof"])[0];if(h){var p=tb.moofToSamples(tb.moof(h),a,r),f=a.baseMediaDecodeTime,m=r.baseMediaDecodeTime,g=h.start;Object.keys(p).forEach((function(t){a.id==t?p[t].map((function(t){t.offset+=g;var i={type:st,pts:(t.pts||t.dts)+f,dts:t.dts+f,units:[],payload:null,isIFrame:!1};i.duration=t.duration,i.gopId=t.gopId,t.keyframe&&(i.isIFrame=!0);var r=e.subarray(t.offset,t.offset+t.size);i.payload=r,a.samples.push(i)})):r.id==t&&p[t].map((function(t){t.offset+=g;var i=e.subarray(t.offset,t.offset+t.size),a=t.dts+m,n=new Uint8Array(i.length+2);n.set([175,1],0),n.set(i,2),r.samples.push({type:ot,pts:a,dts:a,payload:n,duration:t.duration,size:n.byteLength})}))}))}}var y=a.samples.concat(r.samples);y.sort((function(e,t){return e.dts-t.dts})),y.forEach((function(e){var t=new Uint8Array(e.payload);delete e.payload,i.player.isUseMSE()?e.type===st?i._doDecodeVideo(w(w({},e),{},{payload:t})):e.type===ot&&i._doDecodeAudio(w(w({},e),{},{payload:t})):i.loopWorker.postMessage(w(w({},e),{},{payload:t,cmd:"sample"}),[t.buffer])})),No(this._hasCalcFps)&&(this._hasCalcFps=!0,this._calcDecodeFps(y))}},{key:"checkInitAudio",value:function(){return this.isInitAudio=!!(this.audioTrack.sampleRate&&this.audioTrack.channelCount&&this.audioTrack.codec&&"aac"===this.audioTrack.codecType),this.isInitAudio}},{key:"checkInitVideo",value:function(){return this.isInitVideo=!!(this.videoTrack.pps.length&&this.videoTrack.sps.length&&this.videoTrack.codec),this.isInitVideo}},{key:"_sendAccADTSHeader",value:function(e){var t=hn({profile:e.objectType,sampleRate:e.sampleRateIndex,channel:e.channelCount});this._doDecodeByHls(t,ot,0,!0,0)}},{key:"_calcDecodeFps",value:function(e){var t=Lo(e.map((function(e){return{ts:e.dts||e.pts,type:e.type}})),st);t&&(this.player.debug.log(this.TAG_NAME,"_calcDecodeFps() video fps is ".concat(t,", update base fps is ").concat(this._basefps)),this._basefps=t),this._postMessageToLoopWorker("updateBaseFps",{baseFps:this._basefps})}},{key:"_initLoopWorker",value:function(){var e=this;this.player.debug.log(this.TAG_NAME,"_initLoopWorker()");var t=Jo(function(){var e=1,t=2,i=new(function(){function i(){S(this,i),this.baseFps=0,this.fpsInterval=null,this.preLoopTimestamp=null,this.startBpsTime=null,this.allSampleList=[]}return T(i,[{key:"destroy",value:function(){this._clearInterval(),this.baseFps=0,this.allSampleList=[],this.preLoopTimestamp=null,this.startBpsTime=null}},{key:"updateBaseFps",value:function(e){this.baseFps=e,this._clearInterval(),this._startInterval()}},{key:"pushSample",value:function(e){delete e.cmd,this.allSampleList.push(e)}},{key:"_startInterval",value:function(){var e=this,t=Math.ceil(1e3/this.baseFps);this.fpsInterval=setInterval((function(){var i=(new Date).getTime();e.preLoopTimestamp||(e.preLoopTimestamp=i),e.startBpsTime||(e.startBpsTime=i);var r=i-e.preLoopTimestamp;r>2*t&&console.warn("JbPro:[HlsFmp4Loader LoopWorker] loop interval is ".concat(r,"ms, more than ").concat(t," * 2ms")),e._loop(),e.preLoopTimestamp=(new Date).getTime(),e.startBpsTime&&i-e.startBpsTime>=1e3&&(e._calcSampleList(),e.startBpsTime=i)}),t)}},{key:"_clearInterval",value:function(){this.fpsInterval&&(clearInterval(this.fpsInterval),this.fpsInterval=null)}},{key:"_calcSampleList",value:function(){var i={buferredDuration:0,allListLength:this.allSampleList.length,audioListLength:0,videoListLength:0};this.allSampleList.forEach((function(r){r.type===t?(i.videoListLength++,r.duration&&(i.buferredDuration+=r.duration)):r.type===e&&i.audioListLength++})),postMessage(w({cmd:"sampleListInfo"},i))}},{key:"_loop",value:function(){var i=null;if(this.allSampleList.length)if(i=this.allSampleList.shift(),i.type===t){postMessage(w({cmd:"decodeVideo"},i),[i.payload.buffer]);for(var r=this.allSampleList[0];r&&r.type===e;)i=this.allSampleList.shift(),postMessage(w({cmd:"decodeAudio"},i),[i.payload.buffer]),r=this.allSampleList[0]}else i.type===e&&(postMessage(w({cmd:"decodeAudio"},i),[i.payload.buffer]),this.allSampleList.length&&this.allSampleList[0].type===t&&(i=this.allSampleList.shift(),postMessage(w({cmd:"decodeVideo"},i),[i.payload.buffer])))}}])}());self.onmessage=function(e){var t=e.data;switch(t.cmd){case"updateBaseFps":i.updateBaseFps(t.baseFps);break;case"sample":i.pushSample(t);break;case"destroy":i.destroy(),i=null}}}.toString()),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),a=new Worker(r);this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(e.workerUrl),e.workerUrl=null,e.workerClearTimeout=null}),ke),a.onmessage=function(t){var i=t.data;switch(i.cmd){case"decodeVideo":e._doDecodeVideo(i);break;case"decodeAudio":e._doDecodeAudio(i);break;case"sampleListInfo":e.tempSampleListInfo=i}},this.loopWorker=a}},{key:"_postMessageToLoopWorker",value:function(e,t){this.player.isUseMSE()||(this.loopWorker?this.loopWorker.postMessage(w({cmd:e},t)):this.player.debug.warn(this.TAG_NAME,"loop worker is not init, can not post message"))}},{key:"_doDecodeAudio",value:function(e){var t=new Uint8Array(e.payload);this._doDecodeByHls(t,ot,e.dts,!1,0)}},{key:"_doDecodeVideo",value:function(e){var t=new Uint8Array(e.payload),i=null;i=e.isHevc?hl(t,e.isIFrame):Zs(t,e.isIFrame),this.player.updateStats({dts:e.dts});var r=e.pts-e.dts;this._doDecodeByHls(i,st,e.dts,e.isIFrame,r)}},{key:"getBuferredDuration",value:function(){return this.tempSampleListInfo.buferredDuration||0}},{key:"getSampleListLength",value:function(){return this.tempSampleListInfo.allListLength||0}},{key:"getSampleAudioListLength",value:function(){return this.tempSampleListInfo.audioListLength||0}},{key:"getSampleVideoListLength",value:function(){return this.tempSampleListInfo.videoListLength||0}}])}(iu),rb=function(){function e(t,i){S(this,e),this.hls=t,this.player=this.hls.player,this.isMP4=i,this._initSegmentId="",this.TAG_NAME="HlsTransmuxer",this._demuxer=i?new ib(this.hls.player):new NA(this.hls.player),this.player.debug.log(this.TAG_NAME,"init and isMP4 is ".concat(i))}return T(e,[{key:"destroy",value:function(){this._demuxer&&(this._demuxer.destroy(),this._demuxer=null)}},{key:"transmux",value:function(e,t,i,r,a,n){this.player.debug.log(this.TAG_NAME,"transmux videoChunk:".concat(e&&e.byteLength,", audioChunk:").concat(t&&t.byteLength,", discontinuity:").concat(i,", contiguous:").concat(r,", startTime:").concat(a,", needInit:").concat(n));var o=this._demuxer;try{this.isMP4?o.demux(e,t):o.demuxAndFix(ku(e,t),i,r,a)}catch(e){throw new hA(dA,uA,e)}}}])}(),ab=function(){function e(t){S(this,e),this.hls=t,this.player=t.player,this._decryptor=new OA(this.hls,this.player),this._transmuxer=null,this._mse=null,this._softVideo=null,this._sourceCreated=!1,this._needInitSegment=!0,this._directAppend=!1,this.TAG_NAME="HlsBufferService"}return T(e,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._softVideo=null,this._transmuxer&&(this._transmuxer.destroy(),this._transmuxer=null);case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"baseDts",get:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t._baseDts}},{key:"nbSb",get:function(){return 0}},{key:"updateDuration",value:function(){var e=A(v().mark((function e(t){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.player.debug.log(this.TAG_NAME,"updateDuration()",t);case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getBuferredDuration",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getBuferredDuration()}},{key:"getBufferedSegments",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getSampleListLength()}},{key:"getBufferedAudioSegments",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getSampleAudioListLength()}},{key:"getBufferedVideoSegments",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getSampleVideoListLength()}},{key:"createSource",value:function(e,t,i,r){if(!this._sourceCreated){var a=e||t;a&&(NA.probe(a)?this._transmuxer||(this._transmuxer=new rb(this.hls,!1)):tb.probe(a)?this._transmuxer||(this._transmuxer=new rb(this.hls,!0)):this.player.debug.error(this.TAG_NAME,"createSource error: chunk is not ts"))}}},{key:"appendBuffer",value:function(){var e=A(v().mark((function e(t,i,r,a,n,o,s){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!(null!=r&&r.length||null!=a&&a.length)){e.next=2;break}return e.abrupt("return",(this._needInitSegment,this._transmuxer.transmux(r,a,n,o,s,this._needInitSegment||n),!0));case 2:case"end":return e.stop()}}),e,this)})));function t(t,i,r,a,n,o,s){return e.apply(this,arguments)}return t}()},{key:"clearAllBuffer",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.player.debug.log(this.TAG_NAME,"clearAllBuffer");case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"decryptBuffer",value:function(e,t){return this._decryptor.decrypt(e,t)}},{key:"reset",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._transmuxer=null,this._needInitSegment=!0,this._directAppend=!1;case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"endOfStream",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._softVideo&&this._softVideo.endOfStream();case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"setLiveSeekableRange",value:function(){var e=A(v().mark((function e(t,i){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"seamlessSwitch",value:function(){this._needInitSegment=!0}}])}(),nb=function(){function e(t){var i=this;S(this,e),this.emitter=t,this._seiSet=new Set,t.on(Sa,(function(e){e&&i._seiSet.add(e)}))}return T(e,[{key:"throw",value:function(e){var t=this;if(null!=e&&this._seiSet.size){var i=e-.2,r=e+.2,a=[];this._seiSet.forEach((function(e){e.time>=i&&e.time<=r&&a.push(e)})),a.forEach((function(e){t._seiSet.delete(e),t.emitter.emit(Ta,e)}))}}},{key:"reset",value:function(){this._seiSet.clear()}}])}(),ob=function(){function e(t){S(this,e),this._timescale=t,this.encodeType="",this.audioCodec="",this.videoCodec="",this.domain="",this.fps=0,this.bitrate=0,this.width=0,this.height=0,this.samplerate=0,this.channelCount=0,this.gop=0,this._bitsAccumulateSize=0,this._bitsAccumulateDuration=0}return T(e,[{key:"getStats",value:function(){return{encodeType:this.encodeType,audioCodec:this.audioCodec,videoCodec:this.videoCodec,domain:this.domain,fps:this.fps,bitrate:this.bitrate,width:this.width,height:this.height,samplerate:this.samplerate,channelCount:this.channelCount,gop:this.gop}}},{key:"setEncodeType",value:function(e){this.encodeType=e}},{key:"setFpsFromScriptData",value:function(e){var t,i=e.data,r=null==i||null===(t=i.onMetaData)||void 0===t?void 0:t.framerate;r&&r>0&&r<100&&(this.fps=r)}},{key:"setVideoMeta",value:function(e){if(this.width=e.width,this.height=e.height,this.videoCodec=e.codec,this.encodeType=e.codecType,e.fpsNum&&e.fpsDen){var t=e.fpsNum/e.fpsDen;t>0&&t<100&&(this.fps=t)}}},{key:"setAudioMeta",value:function(e){this.audioCodec=e.codec,this.samplerate=e.sampleRate,this.channelCount=e.channelCount}},{key:"setDomain",value:function(e){this.domain=e.split("/").slice(2,3)[0]}},{key:"updateBitrate",value:function(e){var t=this;if((!this.fps||this.fps>=100)&&e.length){var i=e.reduce((function(e,t){return e+t.duration}),0)/e.length;this.fps=Math.round(this._timescale/i)}e.forEach((function(e){1===e.gopId&&t.gop++,t._bitsAccumulateDuration+=e.duration/(t._timescale/1e3),t._bitsAccumulateSize+=e.units.reduce((function(e,t){return e+t.length}),0),t._bitsAccumulateDuration>=1e3&&(t.bitrate=8*t._bitsAccumulateSize,t._bitsAccumulateDuration=0,t._bitsAccumulateSize=0)}))}}])}(),sb=function(){function e(t){S(this,e);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;pu(this,"_core",null),pu(this,"_samples",[]),this._core=t,this._timescale=i,this._stats=new ob(i),this._bindEvents()}return T(e,[{key:"getStats",value:function(){var e,t,i,r,a,n,o,s=(null===(e=this._core)||void 0===e?void 0:e.media)||{},l=s.currentTime,c=void 0===l?0:l,u=s.decodeFps,d=void 0===u?0:u;return w(w({},this._stats.getStats()),{},{downloadSpeed:(null===(t=this._core)||void 0===t||null===(i=t.speedInfo)||void 0===i?void 0:i.call(t).speed)||0,avgSpeed:(null===(r=this._core)||void 0===r||null===(a=r.speedInfo)||void 0===a?void 0:a.call(r).avgSpeed)||0,currentTime:c,bufferEnd:(null===(n=this._core)||void 0===n||null===(o=n.bufferInfo())||void 0===o?void 0:o.remaining)||0,decodeFps:d})}},{key:"_bindEvents",value:function(){var e=this;this._core.on(ma,(function(t){return e._stats.updateBitrate(t.samples)})),this._core.on(ga,(function(t){e._stats.setFpsFromScriptData(t)})),this._core.on(ya,(function(t){"video"===t.type?e._stats.setVideoMeta(t.track):e._stats.setAudioMeta(t.track)})),this._core.on(va,(function(t){e._stats.setDomain(t.responseUrl)}))}},{key:"reset",value:function(){this._samples=[],this._stats=new ob(this._timescale)}}])}(),lb=function(e){function t(e){var i;S(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i=_(this,t),pu(m(i),"_loadSegment",A(v().mark((function e(){var t,r;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!i._segmentProcessing){e.next=2;break}return e.abrupt("return",void i.player.debug.warn("_loadSegment()","_segmentProcessing is ture and return"));case 2:if(i._playlist){e.next=4;break}return e.abrupt("return",void i.player.debug.warn("_loadSegment()","this._playlist is null and return"));case 4:if(t=i._playlist.currentSegment,r=i._playlist.nextSegment,i.player.debug.log(i.TAG_NAME,"_loadSegment()","curSeg",t&&t.url,"nextSeg",r&&r.url),!r){e.next=7;break}return e.abrupt("return",i._loadSegmentDirect());case 7:i.player.debug.log(i.TAG_NAME,"nextSeg is null and return");case 8:case"end":return e.stop()}}),e)})))),i.player=e,i.config=null,i._manifestLoader=null,i._segmentLoader=null,i._playlist=null,i._bufferService=null,i._seiService=null,i._stats=null,i._prevSegSn=null,i._prevSegCc=null,i._tickTimer=null,i._tickInterval=500,i._segmentProcessing=!1,i._reloadOnPlay=!1,i._switchUrlOpts=null,i._disconnectTimer=null,i.TAG_NAME="Hls256",i.canVideoPlay=!1,i.$videoElement=null,i.config=r=function(e){return w({isLive:!0,maxPlaylistSize:50,retryCount:3,retryDelay:1e3,pollRetryCount:2,loadTimeout:1e4,preloadTime:30,softDecode:!1,bufferBehind:10,maxJumpDistance:3,startTime:0,targetLatency:10,maxLatency:20,allowedStreamTrackChange:!0},e)}(r),i._manifestLoader=new PA(m(i)),i._segmentLoader=new MA(m(i)),i._playlist=new FA(m(i)),i._bufferService=new ab(m(i)),i._seiService=new nb(m(i)),i._stats=new sb(m(i),9e4),i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"destroy()"),this._playlist.reset(),this._segmentLoader.reset(),this._seiService.reset(),e.next=6,Promise.all([this._clear(),this._bufferService.destroy()]);case 6:if(e.t0=this._manifestLoader,!e.t0){e.next=11;break}return e.next=10,this._manifestLoader.destroy();case 10:this._manifestLoader=null;case 11:this._segmentLoader&&(this._segmentLoader.destroy(),this._segmentLoader=null),this._playlist&&(this._playlist.destroy(),this._playlist=null),this.player.debug.log(this.TAG_NAME,"destroy end");case 14:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._tickTimer=setTimeout((function(){e._tick()}),this._tickInterval)}},{key:"_stopTick",value:function(){this._tickTimer&&clearTimeout(this._tickTimer),this._tickTimer=null}},{key:"_tick",value:function(){this.player.isDestroyedOrClosed()?this.player.debug.log(this.TAG_NAME,"_tick() player is destroyed"):(this._startTick(),this._loadSegment())}},{key:"isLive",get:function(){return this._playlist.isLive}},{key:"streams",get:function(){return this._playlist.streams}},{key:"currentStream",get:function(){return this._playlist.currentStream}},{key:"hasSubtitle",get:function(){return this._playlist.hasSubtitle}},{key:"baseDts",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.baseDts}},{key:"speedInfo",value:function(){return this._segmentLoader.speedInfo()}},{key:"resetBandwidth",value:function(){this._segmentLoader.resetBandwidth()}},{key:"getStats",value:function(){return this._stats.getStats()}},{key:"loadSource",value:function(){var e=A(v().mark((function e(t){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this._reset();case 2:return e.next=4,this._loadData(t);case 4:return this._startTick(),e.abrupt("return",!0);case 6:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_loadData",value:function(){var e=A(v().mark((function e(t){var i,r,a,n,o,s,l,c;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:try{t&&(t=t.trim())}catch(t){}if(t){e.next=3;break}throw this._emitError(new hA(lA,lA,null,null,"m3u8 url is missing"));case 3:return e.next=5,this._loadM3U8(t);case 5:if(i=e.sent,r=this._playlist.currentStream,this._urlSwitching&&(0===r.bitrate&&null!==(a=this._switchUrlOpts)&&void 0!==a&&a.bitrate&&(r.bitrate=null===(n=this._switchUrlOpts)||void 0===n?void 0:n.bitrate),o=this._getSeamlessSwitchPoint(),this.config.startTime=o,s=this._playlist.findSegmentIndexByTime(o),l=this._playlist.getSegmentByIndex(s+1),l&&(c=l.start,this.player.debug.warn(this.TAG_NAME,"clear buffer from ".concat(c)))),e.t0=i,!e.t0){e.next=17;break}if(!this.isLive){e.next=14;break}this.player.debug.log(this.TAG_NAME,"is live"),this._bufferService.setLiveSeekableRange(0,4294967295),this.config.targetLatency0&&void 0!==i[0]&&i[0],this.player.debug.log(this.TAG_NAME,"_reset()"),this._reloadOnPlay=!1,this._prevSegSn=null,this._prevSegCc=null,this._switchUrlOpts=null,this._playlist.reset(),this._segmentLoader.reset(),this._seiService.reset(),this._stats.reset(),e.next=12,this._clear();case 12:return e.abrupt("return",this._bufferService.reset(t));case 13:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_end",value:function(){this.player.debug.log(this.TAG_NAME,"_end()"),this._clear()}},{key:"_emitError",value:function(e){var t,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!1===(null===(t=e.originError)||void 0===t?void 0:t.fatal)?console.warn(e):(console.table(e),console.error(e),console.error(null===(i=this.media)||void 0===i?void 0:i.error),this._stopTick(),this._urlSwitching&&(this._urlSwitching=!1,this.emit(Ea,e)),r&&this._end(),this._seiService.reset(),this.emit(Da,e)),e}},{key:"_getSeamlessSwitchPoint",value:function(){var e=this.media,t=e.currentTime;if(!e.paused){var i,r=this._playlist.findSegmentIndexByTime(e.currentTime),a=this._playlist.getSegmentByIndex(r),n=null===(i=this._stats)||void 0===i?void 0:i.getStats().downloadSpeed;t+=n&&a?a.duration*this._playlist.currentStream.bitrate/n+1:5}return t}},{key:"getDemuxBuferredDuration",value:function(){return this._bufferService.getBuferredDuration()||0}},{key:"getDemuxBufferedListLength",value:function(){return this._bufferService.getBufferedSegments()||0}},{key:"getDemuxAudioBufferedListLength",value:function(){return this._bufferService.getBufferedAudioSegments()||0}},{key:"getDemuxVideoBufferedListLength",value:function(){return this._bufferService.getBufferedVideoSegments()||0}}])}(s),cb=function(e){function t(e){var i;return S(this,t),i=_(this,t),pu(m(i),"TAG_NAME","Hls256Decoder"),i.player=e,i.$videoElement=i.player.video.$videoElement,i.hls=null,i.eventsDestroy=[],i.bandwidthEstimateInterval=null,i.hls=new lb(e),i._bindEvents(),i}return k(t,e),T(t,[{key:"destroy",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._stopBandwidthEstimateInterval(),e.t0=this.hls,!e.t0){e.next=6;break}return e.next=5,this.hls.destroy();case 5:this.hls=null;case 6:return this.eventsDestroy.length&&(this.eventsDestroy.forEach((function(e){return e()})),this.eventsDestroy=[]),this.$videoElement=null,this.player.debug.log(this.TAG_NAME,"destroy"),e.abrupt("return",!0);case 10:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_bindEvents",value:function(){var e=this;this.hls.on(Da,(function(t){e.player.emitError(It.hlsError,t)})),this._startBandwidthEstimateInterval()}},{key:"_startBandwidthEstimateInterval",value:function(){var e=this;this._stopBandwidthEstimateInterval(),this.bandwidthEstimateInterval=setInterval((function(){var t=e.hls.speedInfo();e.player.emit(xt.kBps,(t.avgSpeed/1024/8).toFixed(2)),e.hls.resetBandwidth()}),1e3)}},{key:"_stopBandwidthEstimateInterval",value:function(){this.bandwidthEstimateInterval&&(clearInterval(this.bandwidthEstimateInterval),this.bandwidthEstimateInterval=null)}},{key:"loadSource",value:function(){var e=A(v().mark((function e(t){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.url=t,e.next=3,this.hls.loadSource(t);case 3:return e.abrupt("return",!0);case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"checkHlsBufferedDelay",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxBuferredDuration()),e}},{key:"getDemuxBufferedListLength",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxBufferedListLength()),e}},{key:"getDemuxAudioBufferedListLength",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxAudioBufferedListLength()),e}},{key:"getDemuxVideoBufferedListLength",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxVideoBufferedListLength()),e}}])}(s),ub=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.TAG_NAME="CommonWebrtc",i.rtcPeerConnection=null,i.videoStream=null,i.isDisconnected=!1,i.isH264=i.player.isWebrtcH264(),i.eventsDestroy=[],i.supportVideoFrameCallbackHandle=null,i.isInitInfo=!1,i.$videoElement=i.player.video.$videoElement,i.bandwidthEstimateInterval=null,i.rtcPeerTrackVideoReceiver=null,i.rtcPeerTrackAudioReceiver=null,i.prevWebrtcVideoStats={},i.prevWebrtcAudioStats={},i.currentWebrtcStats={},i.player._opt.webrtcUseCanvasRender&&i.isH264&&(i.$videoElement=document.createElement("video"),Wn()&&(i.$videoElement.style.position="absolute"),i._initVideoEvents()),i.$videoElement.muted=!0,i._initRtcPeerConnection(),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.isDisconnected=!1,this.isInitInfo=!1,this.prevWebrtcVideoStats={},this.currentWebrtcStats={},this.rtcPeerTrackVideoReceiver=null,this.rtcPeerTrackAudioReceiver=null,this._stopBandwidthEstimateInterval(),this.supportVideoFrameCallbackHandle&&this.$videoElement&&(this.$videoElement.cancelVideoFrameCallback(this.supportVideoFrameCallbackHandle),this.supportVideoFrameCallbackHandle=null),this.eventsDestroy.length&&(this.eventsDestroy.forEach((function(e){return e()})),this.eventsDestroy=[]),this.isH264&&(this.videoStream&&(this.videoStream.getTracks().forEach((function(e){return e.stop()})),this.videoStream=null),this.$videoElement.srcObject=null),this.rtcPeerConnection&&(this.rtcPeerConnection.onicecandidate=Cn,this.rtcPeerConnection.ontrack=Cn,this.rtcPeerConnection.onconnectionstatechange=Cn,this.rtcPeerConnection.ondatachannel=Cn,this.rtcPeerConnection.close(),this.rtcPeerConnection=null)}},{key:"_initVideoEvents",value:function(){var e=this,t=this.player.events.proxy,i=t(this.$videoElement,_r,(function(){e.player.debug.log(e.TAG_NAME,"video canplay"),e.$videoElement.play().then((function(){e.player.debug.log(e.TAG_NAME,"video play"),e._startCanvasRender(),e._initRenderSize()})).catch((function(t){e.player.debug.warn(e.TAG_NAME,"video play error ",t)}))})),r=t(this.$videoElement,kr,(function(){e.player.debug.log("HlsDecoder","video waiting")})),a=t(this.$videoElement,wr,(function(t){var i=parseInt(t.timeStamp,10);e.player.handleRender(),e.player.updateStats({ts:i}),e.$videoElement.paused&&(e.player.debug.warn("HlsDecoder","video is paused and next try to replay"),e.$videoElement.play().then((function(){e.player.debug.log("HlsDecoder","video is paused and replay success")})).catch((function(t){e.player.debug.warn("HlsDecoder","video is paused and replay error ",t)})))})),n=t(this.$videoElement,Sr,(function(){e.player.debug.log("HlsDecoder","video playback Rate change",e.$videoElement&&e.$videoElement.playbackRate)}));this.eventsDestroy.push(i,r,a,n)}},{key:"_initRtcPeerConnection",value:function(){var e=this,t=new RTCPeerConnection,i=this.player;t.addTransceiver("video",{direction:"recvonly"}),t.addTransceiver("audio",{direction:"recvonly"}),t.onsignalingstatechange=function(t){e.player.debug.log(e.TAG_NAME,"onsignalingstatechange",t)},t.oniceconnectionstatechange=function(r){e.player.debug.log(e.TAG_NAME,"oniceconnectionstatechange",t.iceConnectionState);var a=t.iceConnectionState;switch(e.player.emit(xt.webrtcOnIceConnectionStateChange,a),e.isDisconnected="disconnected"===a,t.iceConnectionState){case"new":case"checking":case"closed":case"connected":case"completed":break;case"failed":i.emit(xt.webrtcFailed);break;case"disconnected":i.emit(xt.webrtcDisconnect);break;case"closed":i.emit(xt.webrtcClosed)}},t.onicecandidate=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidate",t),t.candidate&&e.player.debug.log(e.TAG_NAME,"Remote ICE candidate: ",t.candidate.candidate)},t.ontrack=function(i){if(e.player.debug.log(e.TAG_NAME,"ontrack",i),"video"===i.track.kind){e.player.debug.log(e.TAG_NAME,"ontrack video"),e.rtcPeerTrackVideoReceiver=t.getReceivers().find((function(e){return e.track===i.track})),e.rtcPeerTrackVideoReceiver&&e._startBandwidthEstimateInterval();var r=i.streams[0];e.$videoElement.autoplay=!0,e.$videoElement.srcObject=r,e.videoStream=r}else"audio"===i.track.kind&&(e.player.debug.log(e.TAG_NAME,"ontrack audio"),e.rtcPeerTrackAudioReceiver=t.getReceivers().find((function(e){return e.track===i.track})),e.rtcPeerTrackAudioReceiver&&e._startBandwidthEstimateInterval())},t.onicecandidateerror=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidateerror",t),e.player.emitError(It.webrtcIceCandidateError,t)},t.onconnectionstatechange=function(r){switch(e.player.debug.log(e.TAG_NAME,"onconnectionstatechange",r),e.player.emit(xt.webrtcOnConnectionStateChange,t.connectionState),t.connectionState){case"new":case"connecting":case"connected":case"disconnected":break;case"failed":e.isDisconnected&&i.emit(xt.webrtcFailed)}},this.rtcPeerConnection=t}},{key:"_startBandwidthEstimateInterval",value:function(){var e=this;this.player.debug.log(this.TAG_NAME,"_startBandwidthEstimateInterval"),this._stopBandwidthEstimateInterval(),this.bandwidthEstimateInterval=setInterval((function(){e.rtcPeerTrackVideoReceiver&&e.rtcPeerTrackVideoReceiver.getStats().then((function(t){var i={},r=0;t.forEach((function(t){if(t)switch(t.type){case Ja:("succeeded"===t.state||t.bytesReceived)&&(e.currentWebrtcStats.timestamp=t.timestamp,e.currentWebrtcStats.rtt=t.currentRoundTripTime||-1,e.currentWebrtcStats.bytesReceived=t.bytesReceived||0,e.currentWebrtcStats.bytesSent=t.bytesSent||0);break;case Ya:e.currentWebrtcStats.remoteCandidate=t||{};break;case Ka:e.currentWebrtcStats.localCandidate=t||{};break;case qa:e.currentWebrtcStats.lastTimeStamp=t.timestamp;var a=((t.timestamp||0)-(e.prevWebrtcVideoStats.timestamp||0))/1e3,n=Number(t.bytesReceived||0)-Number(e.prevWebrtcVideoStats.bytesReceived||0),o=Math.floor(n/a);r+=o,i.vbps=o,e.prevWebrtcVideoStats=t;break;case Qa:t.frameWidth&&t.frameHeight&&(e.currentWebrtcStats.frameWidth=t.frameWidth||0,e.currentWebrtcStats.frameHeight=t.frameHeight||0)}})),e.rtcPeerTrackAudioReceiver?e.rtcPeerTrackAudioReceiver.getStats().then((function(t){t.forEach((function(t){if(t&&t.type===qa){e.currentWebrtcStats.lastTimeStamp=t.timestamp;var a=((t.timestamp||0)-(e.prevWebrtcAudioStats.timestamp||0))/1e3,n=Number(t.bytesReceived||0)-Number(e.prevWebrtcAudioStats.bytesReceived||0),o=Math.floor(n/a);r+=o,i.abps=o,e.prevWebrtcAudioStats=t}})),e.player.updateStats(i),e.player.emit(xt.kBps,(r/1024).toFixed(2))})):(e.player.updateStats(i),e.player.emit(xt.kBps,(r/1024).toFixed(2)))}))}),1e3)}},{key:"_stopBandwidthEstimateInterval",value:function(){this.player.debug.log(this.TAG_NAME,"_stopBandwidthEstimateInterval"),this.bandwidthEstimateInterval&&(clearInterval(this.bandwidthEstimateInterval),this.bandwidthEstimateInterval=null)}},{key:"_startCanvasRender",value:function(){var e=this;qo()?this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)):(this._stopCanvasRender(),this.canvasRenderInterval=setInterval((function(){e.player.video.render({$video:e.$videoElement,ts:0})}),40))}},{key:"_stopCanvasRender",value:function(){this.canvasRenderInterval&&(clearInterval(this.canvasRenderInterval),this.canvasRenderInterval=null)}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player.isDestroyedOrClosed()?this.player.debug.log(this.TAG_NAME,"videoFrameCallback() player is destroyed"):(this.player.video.render({$video:this.$videoElement,ts:t.mediaTime||0}),this.player.updateStats({dts:t.mediaTime||0}),this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)))}},{key:"_initRenderSize",value:function(){this.isInitInfo||(this.player.video.updateVideoInfo({width:this.$videoElement.videoWidth,height:this.$videoElement.videoHeight}),this.player.video.initCanvasViewSize(),this.isInitInfo=!0)}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.currentTime),e}}])}(s),db=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.rtcPeerConnectionDataChannel=null,i.player.isWebrtcH265()&&(i.streamRate=Un((function(t){e.emit(xt.kBps,(t/1024).toFixed(2))}))),i.TAG_NAME="WebrtcForM7SDecoder",i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.stopStreamRateInterval(),this.rtcPeerConnectionDataChannel&&(this.rtcPeerConnectionDataChannel.onopen=Cn,this.rtcPeerConnectionDataChannel.onclose=Cn,this.rtcPeerConnectionDataChannel.onmessage=Cn,this.rtcPeerConnectionDataChannel.close(),this.rtcPeerConnectionDataChannel=null),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_initRtcPeerConnection",value:function(){var e=this,t=new RTCPeerConnection,i=this.player;t.addTransceiver("video",{direction:"recvonly"}),t.addTransceiver("audio",{direction:"recvonly"}),t.onsignalingstatechange=function(t){e.player.debug.log(e.TAG_NAME,"onsignalingstatechange",t)},t.oniceconnectionstatechange=function(r){e.player.debug.log(e.TAG_NAME,"oniceconnectionstatechange",t.iceConnectionState);var a=t.iceConnectionState;switch(e.player.emit(xt.webrtcOnIceConnectionStateChange,a),e.isDisconnected="disconnected"===a,t.iceConnectionState){case"new":case"checking":case"closed":case"connected":case"completed":break;case"failed":i.emit(xt.webrtcFailed);break;case"disconnected":i.emit(xt.webrtcDisconnect);break;case"closed":i.emit(xt.webrtcClosed)}},t.onicecandidate=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidate",t),t.candidate&&e.player.debug.log(e.TAG_NAME,"Remote ICE candidate: ",t.candidate.candidate)},t.ontrack=function(r){e.player.debug.log(e.TAG_NAME,"ontrack",r);var a=i.video.$videoElement;if(i.isWebrtcH264())if("video"===r.track.kind){e.player.debug.log(e.TAG_NAME,"ontrack video"),e.rtcPeerTrackVideoReceiver=t.getReceivers().find((function(e){return e.track===r.track})),e.rtcPeerTrackVideoReceiver&&e._startBandwidthEstimateInterval();var n=r.streams[0];a.autoplay=!0,a.srcObject=n,e.videoStream=n}else"audio"===r.track.kind&&(e.player.debug.log(e.TAG_NAME,"ontrack audio"),e.rtcPeerTrackAudioReceiver=t.getReceivers().find((function(e){return e.track===r.track})),e.rtcPeerTrackAudioReceiver&&e._startBandwidthEstimateInterval())},t.onicecandidateerror=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidateerror",t),e.player.emitError(It.webrtcIceCandidateError,t)},t.onconnectionstatechange=function(r){switch(i.debug.log(e.TAG_NAME,"sdp connect status ".concat(t.connectionState)),t.connectionState){case"new":case"connecting":case"connected":case"disconnected":break;case"failed":e.isDisconnected&&i.emit(xt.webrtcFailed)}},t.ondatachannel=function(t){var i=t.channel;e.player.debug.log(e.TAG_NAME,"ondatachannel"),i.onopen=function(){e.player.debug.log(e.TAG_NAME,"ondatachannel and onopen")},i.onmessage=function(t){var i=t.data;if(e.player.isWebrtcH264())return e.player.debug.warn(e.TAG_NAME,"ondatachannel is H265 but decode is h264 so emit webrtcStreamH265 "),void e.player.emit(xt.webrtcStreamH265);e.player.isDestroyedOrClosed()?e.player.debug.warn(e.TAG_NAME,"ondatachannel and player is destroyed"):(e.streamRate&&e.streamRate(i.byteLength),e.player.demux&&e.player.demux.dispatch(i))},i.onclose=function(){e.player.debug.warn(e.TAG_NAME,"ondatachannel and onclose")},e.rtcPeerConnectionDataChannel=i},t.createDataChannel("signal").onmessage=function(t){e.player.debug.log(e.TAG_NAME,"signalChannel,onmessage",t),JSON.parse(t.data).type},this.rtcPeerConnection=t}},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"loadSource",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){var n=t.rtcPeerConnection;n.createOffer().then((function(o){n.setLocalDescription(o),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t,i){var r={"Content-Type":"application/sdp"};return i.username&&i.password&&(r.Authorization="Basic "+btoa(i.username+":"+i.password)),fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:r,body:t})}(e,o.sdp,i).then((function(e){e.text().then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response"),e?n.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then((function(){t.player.isWebrtcH265()&&t.startStreamRateInterval(),r()})).catch((function(e){a(e)})):a("sdp is null")})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource response.text() error",e),a(e)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),a(e)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),a(e)}))}))}}])}(ub),hb=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="WebrtcForZLMDecoder",i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return Vl({url:e,type:"POST",data:t,contentType:"text/plain;charset=utf-8",processData:!1,dataType:"json"})}(e,n.sdp).then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response and code is ".concat(e.code));var n=e;if(n&&0!==n.code)return r(n.msg);n&&n.sdp?a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:n.sdp})).then((function(){i()})).catch((function(e){r(e)})):r("sdp is null")})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}])}(ub),pb=function(e){function t(e,i){var r;if(S(this,t),r=_(this,t),r.player=e,r.player.$container.classList.add("jb-pro-container-playback"),r._showPrecision=null,r._startTime=null,r._playStartTime=null,r._playingTimestamp=null,r._fps=parseInt(i.fps,10)||e._opt.playbackFps,r._isUseFpsRender=!!Oo(i.isUseFpsRender),r._rate=1,r._audioTimestamp=0,r._videoTimestamp=0,r.controlType=i.controlType||ve.normal,i.controlType&&-1===[ve.normal,ve.simple].indexOf(i.controlType)&&(r.player.debug.warn("Playback","constructor()","controlType is not in [normal,simple]",i.controlType),r.controlType=ve.normal),r._currentLocalTimestamp=0,r._localOneFrameTimestamp=i.localOneFrameTimestamp||40,r._localCalculateTimeInterval=null,r._isUseLocalCalculateTime=!!Oo(i.isUseLocalCalculateTime),r._isPlaybackPauseClearCache=!No(i.isPlaybackPauseClearCache),r._isCacheBeforeDecodeForFpsRender=!!Oo(i.isCacheBeforeDecodeForFpsRender),r._startfpsTime=null,r._startFpsTimestamp=null,r._checkStatsInterval=null,r._playbackTs=0,r._renderFps=0,r._isUseLocalCalculateTime?r._startLocalCalculateTime():r._listen(),r.playbackList=[],r._playbackListStartTimestamp=null,r._totalDuration=0,i.controlType===ve.normal)r.initPlaybackList(i.playList,i.showPrecision,i.startTime);else if(i.controlType===ve.simple){i.duration&&(r._totalDuration=1e3*i.duration);var a=i.startTime||0;a>r.totalDuration&&(a=r.totalDuration),r.setStartTime(a)}r.player.on(xt.playbackPause,(function(e){e?r.pause():r.resume()}));var n={fps:r._fps,isUseFpsRender:r._isUseFpsRender,localOneFrameTimestamp:r._localOneFrameTimestamp,isUseLocalCalculateTime:r._isUseLocalCalculateTime,uiUsePlaybackPause:i.uiUsePlaybackPause,showControl:i.showControl};return e.debug.log("Playback","init",JSON.stringify(n)),r}return k(t,e),T(t,[{key:"destroy",value:function(){this._startTime=null,this._showPrecision=null,this._playStartTime=null,this._playingTimestamp=null,this._totalDuration=0,this._audioTimestamp=0,this._videoTimestamp=0,this._fps=null,this._isUseFpsRender=!1,this._rate=1,this.playbackList=[],this._playbackListStartTimestamp=null,this._localCalculateTimeInterval=null,this._currentLocalTimestamp=0,this._startfpsTime=null,this._startFpsTimestamp=null,this._renderFps=0,this._playbackTs=0,this._stopLocalCalculateTime(),this.clearStatsInterval(),this.player.$container&&this.player.$container.classList.remove("jb-pro-container-playback"),this.off(),this.player.debug.log("Playback","destroy")}},{key:"_listen",value:function(){var e=this;this.player.on(xt.stats,(function(t){var i=t.ts;e._playStartTime||(e._playStartTime=i-1e3);var r=i-e._playStartTime;e.setPlayingTimestamp(r)}))}},{key:"pause",value:function(){this.clearStatsInterval()}},{key:"resume",value:function(){this.startCheckStatsInterval()}},{key:"updateStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._startFpsTimestamp||(this._startFpsTimestamp=Ln()),no(e.ts)&&(this.player.updateStats({fps:!0,ts:e.ts}),this._playbackTs=e.ts,this._startfpsTime||(this._startfpsTime=e.ts),this._renderFps+=1);var t=Ln(),i=t-this._startFpsTimestamp;if(!(i<1e3)){var r=null;this._startfpsTime&&(r=this._playbackTs-this._startfpsTime),this.player.emit(xt.playbackStats,{fps:this._renderFps,rate:this.rate,start:this._startfpsTime,end:this._playbackTs,timestamp:i,dataTimestamp:r,audioBufferSize:this.player.audio?this.player.audio.bufferSize:0,videoBufferSize:this.player.video?this.player.video.bufferSize:0,ts:this._playbackTs}),this._renderFps=0,this._startfpsTime=this._playbackTs,this._startFpsTimestamp=t}}},{key:"updateLocalOneFrameTimestamp",value:function(e){this._localOneFrameTimestamp=e}},{key:"_startLocalCalculateTime",value:function(){var e=this;this._stopLocalCalculateTime(),this._localCalculateTimeInterval=setInterval((function(){var t=e._currentLocalTimestamp;e._playStartTime||(e._playStartTime=t-1e3);var i=t-e._playStartTime;e.setPlayingTimestamp(i)}),1e3)}},{key:"startCheckStatsInterval",value:function(){var e=this;this.clearStatsInterval(),this._checkStatsInterval=setInterval((function(){e.updateStats()}),1e3)}},{key:"_stopLocalCalculateTime",value:function(){this._localCalculateTimeInterval&&(clearInterval(this._localCalculateTimeInterval),this._localCalculateTimeInterval=null)}},{key:"clearStatsInterval",value:function(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}},{key:"increaseLocalTimestamp",value:function(){this._isUseLocalCalculateTime&&(this._currentLocalTimestamp+=this._localOneFrameTimestamp)}},{key:"initPlaybackList",value:function(e,t,i){this.playbackList=e||[];var r=0;if(this.playbackList.forEach((function(e,t){10===mo(e.start)&&(e.startTimestamp=1e3*e.start,e.startTime=Vn(e.startTimestamp)),10===mo(e.end)&&(e.endTimestamp=1e3*e.end,e.endTime=Vn(e.endTimestamp)),e.duration=e.end-e.start,r+=e.duration})),this._totalDuration=r,this.player.debug.log("Playback",this.playbackList),this.playbackList.length>0){var a=this.playbackList[0].startTimestamp;this._playbackListStartTimestamp=a;var n=a;i&&(10===mo(i)&&(i*=1e3),this._isTimeInPlaybackList(i)&&(n=i)),this.setStartTime(n)}var o=t||Hi;this.setShowPrecision(o)}},{key:"totalDuration",get:function(){return(this._totalDuration||0)/1e3}},{key:"startTime",get:function(){return this._startTime||0}},{key:"setStartTime",value:function(e){this._startTime=e,this._playingTimestamp=e,this._playStartTime=null}},{key:"setRate",value:function(e){this._rate=e,this.player.emit(xt.playbackRateChange,e)}},{key:"fps",get:function(){return this._fps}},{key:"rate",get:function(){return this._rate}},{key:"isUseFpsRender",get:function(){return this._isUseFpsRender}},{key:"isUseLocalCalculateTime",get:function(){return this._isUseLocalCalculateTime}},{key:"showPrecision",get:function(){return this._showPrecision}},{key:"is60Min",get:function(){return this.showPrecision===Hi}},{key:"is30Min",get:function(){return this.showPrecision===Wi}},{key:"is10Min",get:function(){return this.showPrecision===Vi}},{key:"is5Min",get:function(){return this.showPrecision===Ji}},{key:"is1Min",get:function(){return this.showPrecision===Ji}},{key:"isPlaybackPauseClearCache",get:function(){return this._isPlaybackPauseClearCache}},{key:"isCacheBeforeDecodeForFpsRender",get:function(){return this._isCacheBeforeDecodeForFpsRender}},{key:"setShowPrecision",value:function(e){Ki.includes(e)||(this.player.debug.warn("Playback","setShowPrecision()","type is not in PLAYBACK_CONTROL_TIME_PRECISION_ARRAY",e),e=Hi),this._showPrecision&&this._showPrecision===e||(this._showPrecision=e,this.player.emit(xt.playbackPrecision,this._showPrecision,this.playbackList),this.player.emit(xt.playbackShowPrecisionChange,this._showPrecision))}},{key:"setPlayingTimestamp",value:function(e){var t;if(this.controlType===ve.normal){t=this.startTime+e,this._playingTimestamp=t,this.player.emit(xt.playbackTime,t);var i=new Date(t);this.player.emit(xt.playbackTimestamp,{ts:t,hour:i.getHours(),min:i.getMinutes(),second:i.getSeconds()})}else this.controlType===ve.simple&&(t=this.startTime+Math.round(e/1e3),t>this.totalDuration&&(this.player.debug.log("Playback","setPlayingTimestamp()","timestamp ".concat(t," > this.totalDuration ").concat(this.totalDuration)),t=this.totalDuration),this._playingTimestamp=t,this.player.emit(xt.playbackTime,t),this.player.emit(xt.playbackTimestamp,{ts:t}))}},{key:"playingTimestamp",get:function(){return this._playingTimestamp}},{key:"narrowPrecision",value:function(){var e=Ki.indexOf(this.showPrecision)-1;if(e>=0){var t=Ki[e];this.setShowPrecision(t)}}},{key:"expandPrecision",value:function(){var e=Ki.indexOf(this.showPrecision)+1;if(e<=Ki.length-1){var t=Ki[e];this.setShowPrecision(t)}}},{key:"seek",value:function(e){if(this.player.debug.log("Playback","seek()",e),this.controlType===ve.normal){if("true"===e.hasRecord){var t=e.time;"min"===e.type&&(t=60*e.time);var i=function(e){var t={};return e>-1&&(t={hour:Math.floor(e/60/60)%60,min:Math.floor(e/60)%60,second:e%60}),t}(t);if(this._playbackListStartTimestamp){var r=new Date(this._playbackListStartTimestamp).setHours(i.hour,i.min,i.second,0);i.timestamp=r;var a=this._findMoreInfoByTimestamp(r);i&&a.more&&(i.more=a.more)}this.player.emit(xt.playbackSeek,i)}}else if(this.controlType===ve.simple){var n=e.time;this.player.emit(xt.playbackSeek,{ts:n})}}},{key:"currentTimeScroll",value:function(){this.player.emit(xt.playbackTimeScroll)}},{key:"_findMoreInfoByTimestamp",value:function(e){var t=null;return this.playbackList.forEach((function(i,r){i.startTimestamp<=e&&i.endTimestamp>=e&&(t=i)})),t}},{key:"_isTimeInPlaybackList",value:function(e){var t=!1;return this.playbackList.forEach((function(i,r){i.startTimestamp<=e&&i.endTimestamp>=e&&(t=!0)})),t}},{key:"getControlType",value:function(){return this.controlType}},{key:"isControlTypeNormal",value:function(){return this.controlType===ve.normal}},{key:"isControlTypeSimple",value:function(){return this.controlType===ve.simple}}])}(s),fb=function(e){function t(e){var i;S(this,t),i=_(this,t),i.player=e,i.TAG_NAME="zoom",i.bindEvents=[],i.isDragging=!1,i.currentZoom=1,i.prevVideoElementStyleTransform=null,i.prevVideoElementStyleScale=null,i.maxScale=5,i.tempPosition={x:0,y:0},i.videoPosition={left:0,top:0};var r=i.player,a=r.events.proxy;r.debug;i.player.on(xt.zooming,(function(e){if(e){i.player.$container.classList.add("jb-pro-zoom-control"),i._bindEvents();var t=i.player.video.$videoElement.style.transform,r=i.player.video.$videoElement.offsetLeft,a=i.player.video.$videoElement.offsetTop;r=parseFloat(r),a=parseFloat(a),r&&(i.videoPosition.left=r),a&&(i.videoPosition.top=a),i.prevVideoElementStyleTransform=t;var n=t.match(/scale\([0-9., ]*\)/g);if(n&&n[0]){var o=n[0].replace("scale(","").replace(")","");i.prevVideoElementStyleScale=o.split(",")}}else{i.player.$container.classList.remove("jb-pro-zoom-control"),i._unbindEvents(),i._resetVideoPosition(),i.player.$container.style.cursor="auto";var s=i.prevVideoElementStyleTransform;i.player.video.$videoElement.style.transform=s,i.prevVideoElementStyleTransform=null,i.prevVideoElementStyleScale=null,On()&&i.player._opt.useWebFullScreen&&i.player.resize()}}));var n=a(window,On()?"touchend":"mouseup",(function(e){i.handleMouseUp(e)}));return i.bindEvents.push(n),e.debug.log("zoom","init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.bindEvents=[],this.isDragging=!1,this.currentZoom=1,this.prevVideoElementStyleTransform=null,this.prevVideoElementStyleScale=null,this.tempPosition={x:0,y:0},this.videoPosition={left:0,top:0},this.off(),this.player.debug.log("zoom","destroy")}},{key:"_bindEvents",value:function(){var e=this,t=this.player,i=t.events.proxy,r=(t.debug,i(this.player.$container,On()?"touchmove":"mousemove",(function(t){e.handleMouseMove(t)})));this.bindEvents.push(r);var a=i(this.player.$container,On()?"touchstart":"mousedown",(function(t){e.handleMouseDown(t)}));this.bindEvents.push(a);var n=i(window,On()?"touchend":"mouseup",(function(t){e.handleMouseUp(t)}));this.bindEvents.push(n)}},{key:"_unbindEvents",value:function(){this.bindEvents.forEach((function(e){e&&e()}))}},{key:"handleMouseMove",value:function(e){if(e.stopPropagation(),this.isDragging&&this.player.zooming){e.preventDefault();var t=So(e),i=t.posX,r=t.posY,a=this.tempPosition.x-i,n=this.tempPosition.y-r;this.videoPosition.left=this.videoPosition.left-a,this.videoPosition.top=this.videoPosition.top-n,this.tempPosition.x=i,this.tempPosition.y=r,this.updateVideoPosition()}}},{key:"handleMouseDown",value:function(e){e.stopPropagation();var t=_o(e);if(this.player.zooming&&(t.matches("video")||t.matches("canvas"))){e.preventDefault();var i=So(e),r=i.posX,a=i.posY;this.player.$container.style.cursor="grabbing",this.tempPosition.x=r,this.tempPosition.y=a,this.isDragging=!0,this.player.debug.log("zoom","handleMouseDown is dragging true")}}},{key:"handleMouseUp",value:function(e){e.stopPropagation(),this.isDragging&&this.player.zooming&&(e.preventDefault(),this.tempPosition={x:0,y:0},this.isDragging=!1,this.player.$container.style.cursor="grab",this.player.debug.log("zoom","handleMouseUp is dragging false"))}},{key:"updateVideoPosition",value:function(){var e=this.player.video.$videoElement;e.style.left=this.videoPosition.left+"px",e.style.top=this.videoPosition.top+"px"}},{key:"_resetVideoPosition",value:function(){this.player.resize(),this.tempPosition={x:0,y:0},this.videoPosition={left:0,top:0},this.currentZoom=1,this.isDragging=!1}},{key:"narrowPrecision",value:function(){this.currentZoom<=1||(this.currentZoom-=1,this.updateVideoElementScale())}},{key:"expandPrecision",value:function(){this.currentZoom>=this.maxScale||(this.currentZoom+=1,this.updateVideoElementScale())}},{key:"updatePrevVideoElementStyleScale",value:function(e){this.prevVideoElementStyleScale=e}},{key:"updateVideoElementScale",value:function(){var e=this.player.video.$videoElement,t=e.style.transform,i=1,r=1;if(this.prevVideoElementStyleScale){var a=this.prevVideoElementStyleScale[0];void 0!==a&&(i=a,r=a);var n=this.prevVideoElementStyleScale[1];void 0!==n&&(r=n)}r=qn(r),i=qn(i);var o,s=.5*i*(this.currentZoom-1)+i,l=.5*r*(this.currentZoom-1)+r;o=-1===t.indexOf("scale(")?t+" scale(".concat(s,",").concat(l,")"):t.replace(/scale\([0-9., ]*\)/,"scale(".concat(s,",").concat(l,")")),this.player.debug.log("zoom","updateVideoElementScale end is ".concat(s,", ").concat(l," style is ").concat(o)),e.style.transform=o}}])}(s),mb=function(e){function t(e){var i;S(this,t),i=_(this,t),i.player=e,i.faceDetector=null,i.objectDetector=null,i.imageDetector=null,i.occlusionDetector=null,i.initFaceDetector(),i.initObjectDetector(),i.initImageDetector(),i.initOcclusionDetector();var r="init";return i.faceDetector&&(r+=" and use faceDetector"),i.objectDetector&&(r+=" and use objectDetector"),i.imageDetector&&(r+=" and use imageDetector"),i.occlusionDetector&&(r+=" and use occlusionDetector"),i.player.debug.log("AiLoader",r),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.off(),this.faceDetector&&(this.faceDetector.destroy(),this.faceDetector=null),this.objectDetector&&(this.objectDetector.destroy(),this.objectDetector=null),this.imageDetector&&(this.imageDetector.destroy(),this.imageDetector=null),this.occlusionDetector&&(this.occlusionDetector.destroy(),this.occlusionDetector=null),this.player.debug.log("AiLoader","destroy")}},{key:"initFaceDetector",value:function(){var e=this;if(this.player._opt.useFaceDetector&&window.JessibucaProFaceDetector){var t=new JessibucaProFaceDetector({detectWidth:this.player._opt.aiFaceDetectWidth,showRect:!1,debug:this.player._opt.debug,debugLevel:this.player._opt.debugLevel,debugUuid:this.player._opt.debugUuid});t.load().then((function(){e.player.debug.log("AiLoader","init face detector success"),e.faceDetector=t,e.faceDetector.on("jessibuca-pro-face-detector-info",(function(t){if(e.player.emit(xt.aiFaceDetectorInfo,t),e.player._opt.aiFaceDetectShowRect){var i=e.player._opt.aiFaceDetectRectConfig||{},r=(t.list||[]).map((function(e){return e.type="rect",e.color=i.borderColor||"#0000FF",e.lineWidth=i.borderWidth||2,e}));e.player.video&&e.player.video.addAiContentToCanvas(r)}}))}))}}},{key:"initObjectDetector",value:function(){var e=this;if(this.player._opt.useObjectDetector&&window.JessibucaProObjectDetector){var t=new JessibucaProObjectDetector({detectWidth:this.player._opt.aiObjectDetectWidth,showRect:!1,debug:this.player._opt.debug,debugLevel:this.player._opt.debugLevel,debugUuid:this.player._opt.debugUuid});t.load().then((function(){e.player.debug.log("AiLoader","init object detector success"),e.objectDetector=t,e.objectDetector.on("jessibuca-pro-object-detector-info",(function(t){if(e.player.emit(xt.aiObjectDetectorInfo,t),e.player._opt.aiObjectDetectShowRect){var i=[],r=e.player._opt.aiObjectDetectRectConfig||{};(t.list||[]).forEach((function(e){var t={type:"rect",color:r.borderColor||"#0000FF",lineWidth:r.borderWidth||2,x:e.rect.x,y:e.rect.y,width:e.rect.width,height:e.rect.height},a={type:"text",color:r.color||"#000",fontSize:r.fontSize||14,text:e.zh,x:e.rect.x,y:e.rect.y-25};i.push(t,a)})),e.player.video&&e.player.video.addAiContentToCanvas(i)}}))}))}}},{key:"initImageDetector",value:function(){var e=this;if(this.player._opt.useImageDetector&&window.JessibucaProImageDetector){var t=new JessibucaProImageDetector({debug:this.player._opt.debug,debugLevel:this.player._opt.debugLevel,debugUuid:this.player._opt.debugUuid});t.load().then((function(){e.player.debug.log("AiLoader","init image detector success"),e.imageDetector=t}))}}},{key:"initOcclusionDetector",value:function(){var e=this;if(this.player._opt.useOcclusionDetector&&window.JessibucaProOcclusionDetector){var t=new JessibucaProOcclusionDetector({debug:this.player._opt.debug,debugLevel:this.player._opt.debugLevel,debugUuid:this.player._opt.debugUuid});t.load().then((function(){e.player.debug.log("AiLoader","init occlusion detector success"),e.occlusionDetector=t}))}}},{key:"updateFaceDetectorConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.faceDetector&&this.faceDetector.updateConfig(e)}},{key:"updateObjectDetectorConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.objectDetector&&this.objectDetector.updateConfig(e)}},{key:"updateImageDetectorConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.imageDetector&&this.imageDetector.updateConfig(e)}},{key:"updateOcclusionDetectorConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.occlusionDetector&&this.occlusionDetector.updateConfig(e)}}])}(s),gb=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.LOG_NAME="Contextmenu",i.menuList=[],i.$contextmenus=e.control.$contextmenus,On()?i.player.debug.warn(i.LOG_NAME,"not support mobile"):i.init(),e.debug.log(i.LOG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.menuList=[],this.player.debug.log(this.LOG_NAME,"destroy")}},{key:"isShow",get:function(){return e=this.player.$container,t="jb-pro-contextmenus-show",e.classList.contains(t);var e,t}},{key:"show",value:function(){$u(this.player.$container,"jb-pro-contextmenus-show")}},{key:"hide",value:function(){var e,t;e=this.player.$container,t="jb-pro-contextmenus-show",e.classList.remove(t)}},{key:"init",value:function(){var e=this,t=this.player,i=t.events.proxy;t.debug;this.player._opt.contextmenuBtns.length>0&&this.player._opt.contextmenuBtns.forEach((function(t){e.addMenuItem(t)})),i(this.player.$container,"contextmenu",(function(t){t.preventDefault(),e.show();var i=t.clientX,r=t.clientY,a=e.player.$container.getBoundingClientRect(),n=a.height,o=a.width,s=a.left,l=a.top,c=e.$contextmenus.getBoundingClientRect(),u=c.height,d=c.width,h=i-s,p=r-l;i+d>s+o&&(h=o-d),r+u>l+n&&(p=n-u),Pn(e.$contextmenus,{left:"".concat(h,"px"),top:"".concat(p,"px")})})),i(this.player.$container,"click",(function(t){id(t,e.$contextmenus)||e.hide()})),this.player.on(xt.blur,(function(){e.hide()}))}},{key:"_validateMenuItem",value:function(e){var t=!0;return e.content||(this.player.debug.warn(this.LOG_NAME,"content is required"),t=!1),t}},{key:"addMenuItem",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=Bo(oa);if(t=Object.assign({},i,t),this._validateMenuItem(t)){var r=this.player,a=r.events.proxy,n=(r.debug,Kn()),o='\n
\n ').concat(t.content,"\n
\n "),s=Array.from(this.$contextmenus.children)[t.index];s?s.insertAdjacentHTML("beforebegin",o):ed(this.$contextmenus,o);var l=this.$contextmenus.querySelector(".jb-pro-contextmenu-".concat(n));t.click&&a(l,"click",(function(i){i.preventDefault(),t.click.call(e.player,e,i),e.hide()})),this.menuList.push({uuid:n,$menuItem:l})}}}])}(s),yb=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="WebrtcForSRSDecoder",i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:t})}(e,n.sdp).then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response and code is ".concat(e.code));var n=e;if(n&&0!==n.code)return r(n.msg);n?a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:n})).then((function(){i()})).catch((function(e){r(e)})):r("sdp is null")})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}])}(ub),vb=function(e){function t(e){var i;return S(this,t),i=_(this,t,[e]),i.TAG_NAME="WebrtcForOthersDecoder",i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){b(t,"destroy",this,3)([]),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:t})}(e,n.sdp).then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response and code is ".concat(e.code)),e.text().then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response");try{var n=JSON.parse(e);t.player.debug.log(t.TAG_NAME,"this is json sdp response"),0!=n.code&&(t.player.debug.log(t.TAG_NAME,"response json code ".concat(n.code)),r(new Error("response sdp json code: ".concat(n.code)))),e=n.sdp}catch(e){t.player.debug.log(t.TAG_NAME,"this is raw sdp response")}e?a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then((function(){i()})).catch((function(e){r(e)})):r("sdp is null")})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource response.text() error",e),r(e)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}])}(ub),Ab=function(e){function t(e){var i;if(S(this,t),i=_(this,t),i.TAG_NAME="AliyunRtc",i.player=e,!window.AliRTS)throw new Error("AliyunRtc is not defined");return i.aliyunRtc=window.AliRTS.createClient(),i.aliyunRtcRemoteStream=null,i.$videoElement=i.player.video.$videoElement,i.listenEvents(),i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.aliyunRtc&&(this.aliyunRtcRemoteStream&&(this.aliyunRtcRemoteStream=null),this.aliyunRtc.unsubscribe(),this.aliyunRtc=null),this.off(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"listenEvents",value:function(){var e=this;this.aliyunRtc.on("onError",(function(t){e.player.debug.log(e.TAG_NAME,"onError and code is ".concat(t.errorCode," and message: ").concat(t.message)),10400!==t.errorCode&&(e.player.debug.error(e.TAG_NAME,"onError and code is ".concat(t.errorCode," and message: ").concat(t.message)),e.player.emitError(It.aliyunRtcError,t))})),this.aliyunRtc.on("reconnect",(function(t){e.player.debug.log(e.TAG_NAME,"reconnect",t)}));var t="canplay",i="waiting",r="playing",a="media";this.aliyunRtc.on("onPlayEvent",(function(n){if(n.event===t)e.player.debug.log(e.TAG_NAME,"onPlayEvent and canplay");else if(n.event===i)e.player.debug.log(e.TAG_NAME,"onPlayEvent and playing - > waiting");else if(n.event===r)e.player.debug.log(e.TAG_NAME,"onPlayEvent and waiting -> playing");else if(n.event===a){var o=n.data,s={},l=0;if(o.audio){var c=Math.floor(o.audio.bytesReceivedPerSecond);l+=c,s.abps=c}if(o.video){var u=Math.floor(o.video.bytesReceivedPerSecond);l+=u,s.vbps=u}e.player.updateStats(s),e.player.emit(xt.kBps,(l/1024).toFixed(2))}}))}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){t.aliyunRtc.isSupport({isReceiveVideo:!0}).then((function(){t.aliyunRtc.subscribe(e,{}).then((function(e){t.aliyunRtcRemoteStream=e,e.play(t.$videoElement),i()})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource and subscribe is not success: ",e.message),r(e.message)}))})).catch((function(e){t.player.debug.error(t.TAG_NAME,"loadSource and is not support: ",e.message),r(e.message)}))}))}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.currentTime),e}}])}(s),bb=function(){function e(t){S(this,e),this.player=t,this.TAG_NAME="PressureObserverCpu",this.observer=null,this.latestCpuInfo=null,this.currentLevel=-1,this._init(),this.player.debug.log(this.TAG_NAME,"init")}return T(e,[{key:"destroy",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.latestCpuInfo=null,this.currentLevel=-1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"getCurrentCpuState",value:function(){return this.currentLevel}},{key:"_init",value:function(){var e=this;No(Ko())?this.player.debug.log(this.TAG_NAME,"not support PressureObserver"):(this.observer=new PressureObserver((function(t){var i=(t||[]).find((function(e){return"cpu"===e.source}));if(i){switch(e.latestCpuInfo=i,i.state){case"nominal":e.currentLevel=0;break;case"fair":e.currentLevel=1;break;case"serious":e.currentLevel=2;break;case"critical":e.currentLevel=3;break;default:e.currentLevel=-1}e.player.emit(xt.pressureObserverCpu,e.currentLevel)}})),this.observer&&this.observer.observe("cpu"))}}])}(),_b=function(t){function i(e){var t;S(this,i);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=_(this,i,[e]),t.TAG_NAME="DynamicWatermark",t.isPauseAnimation=!1,t.isStopAnimation=!1,t.rafID=null,t.speed=r.speed||.2,t.isDynamic=!0,t.shadowRootDynamicDom=null,t.isGhost=!0===r.isGhost,t.ghostConfig={on:r.on||5,off:r.off||5},t.waterMarkWillRemove=!1,t.waterMarkWillAdd=!1,t.player.once(xt.start,(function(){var e=r.content,i=t.player.getVideoInfo();i||(i={width:200,height:200}),t.update({text:{content:e,fontSize:r.fontSize||18,color:r.color||"white"},left:i.width*Math.random(),top:i.height*Math.random(),opacity:r.opacity||.15}),t.startAnimation()})),t.player.debug.log(t.TAG_NAME,"int"),t}return k(i,t),T(i,[{key:"destroy",value:function(){b(i,"destroy",this,3)([]),this.shadowRootDynamicDom=null,this.stopAnimation(),this.rafID&&(cancelAnimationFrame(this.rafID),this.rafID=null)}},{key:"startAnimation",value:function(){var t=this;if(!this.rafID){var i=1,r=1,a=Math.random(),n={width:0,height:0},o=function(){try{if(No(t.isPauseAnimation)&&t.shadowRootDynamicDom&&t.shadowRootInnerDom){var s=t.shadowRootInnerDom,l=t.shadowRootDynamicDom,c=s.getBoundingClientRect(),u=l.getBoundingClientRect();if(u.width&&u.height&&(n.width=u.width,n.height=u.height),!t.shadowRootInnerDom.contains(t.shadowRootDynamicDom))return t.isGhost?No(t.waterMarkWillAdd)&&(t.waterMarkWillAdd=!0,setTimeout((function(){t._addDom(c,n),t.waterMarkWillAdd=!1}),1e3*t.ghostConfig.off)):t._addDom(c,n),void(0!==t.speed&&requestAnimationFrame(o));var d=Math.min(1,0===t.speed?0:t.speed?t.speed:.2),h=u.left-c.left,p=u.top-c.top;h+=d*r*a,p+=d*i*(1-a),h+n.width>c.width?(r=-1,a=Math.random()):h<0&&(r=1,a=Math.random()),p+n.height>c.height?(i=-1,a=Math.random()):p<0&&(i=1,a=Math.random()),h=Math.min(c.width-n.width,h),p=Math.min(c.height-n.height,p);var f=h/c.width*100,m=p/c.height*100;t.shadowRootDynamicDom.style.left="".concat(f,"%"),t.shadowRootDynamicDom.style.top="".concat(m,"%"),No(t.waterMarkWillRemove)&&t.isGhost&&(t.waterMarkWillRemove=!0,setTimeout((function(){t._removeDom(),t.waterMarkWillRemove=!1}),1e3*t.ghostConfig.on))}}catch(e){}if(t.isStopAnimation)return t.isStopAnimation=!1,cancelAnimationFrame(t.rafID),void(t.rafID=null);0!==t.speed&&requestAnimationFrame(o)};this.rafID=requestAnimationFrame(o)}}},{key:"_addDom",value:function(e,t){if(this.shadowRootInnerDom&&this.shadowRootDynamicDom){this.shadowRootInnerDom.appendChild(this.shadowRootDynamicDom);var i=e.width*Math.random(),r=e.height*Math.random();i=Math.min(e.width-2*t.width,i),r=Math.min(e.height-2*t.height,r),this.shadowRootDynamicDom.style.left="".concat(i,"px"),this.shadowRootDynamicDom.style.top="".concat(r,"px")}}},{key:"resumeAnimation",value:function(){this.isPauseAnimation=!1}},{key:"pauseAnimation",value:function(){this.isPauseAnimation=!0}},{key:"stopAnimation",value:function(){this.isStopAnimation=!0}}])}(ns),kb=function(e){function t(e){var i;S(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i=_(this,t),i._opt={},i.TAG_NAME="Player",i.$container=e;var a,n=Uo();if(i._opt=Object.assign({},n,r),i.debug=new an(i),i.debug.log(i.TAG_NAME,"init"),i._opt.forceNoOffscreen=!0,i._canPlayAppleMpegurl=!1,(Wn()||Hn())&&(i._canPlayAppleMpegurl=To(),i.debug.log(i.TAG_NAME,"isIOS or isSafari and canPlayAppleMpegurl",i._canPlayAppleMpegurl)),On()&&(i.debug.log(i.TAG_NAME,"isMobile and set _opt.controlAutoHide false"),i._opt.controlAutoHide=!1,Oo(sn.isEnabled)&&Oo(i._opt.useWebFullScreen)&&(i.debug.log(i.TAG_NAME,"screenfull.isEnabled is true and _opt.useWebFullScreen is true , set _opt.useWebFullScreen false"),i._opt.useWebFullScreen=!1),No(sn.isEnabled)&&No(i._opt.useWebFullScreen)&&(i.debug.log(i.TAG_NAME,"screenfull.isEnabled is false and _opt.useWebFullScreen is false , set _opt.useWebFullScreen true"),i._opt.useWebFullScreen=!0)),Ho()&&(i.debug.log(i.TAG_NAME,"isIphone and set _opt.videoRenderSupportScale false"),i._opt.videoRenderSupportScale=!1,Ao()&&Oo(i._opt.isHls)&&No(i._opt.supportHls265)&&(i.debug.log(i.TAG_NAME,"isIphone and is in wechat and is hls so set supportHls265 true"),i._opt.supportHls265=!0)),No(i._opt.playFailedAndReplay)&&(i.debug.log(i.TAG_NAME,"_opt.playFailedAndReplay is false and set others replay params false"),i._opt.webglAlignmentErrorReplay=!1,i._opt.webglContextLostErrorReplay=!1,i._opt.autoWasm=!1,i._opt.mseDecodeErrorReplay=!1,i._opt.mediaSourceTsIsMaxDiffReplay=!1,i._opt.wcsDecodeErrorReplay=!1,i._opt.wasmDecodeErrorReplay=!1,i._opt.simdDecodeErrorReplay=!1,i._opt.videoElementPlayingFailedReplay=!1,i._opt.networkDelayTimeoutReplay=!1,i._opt.widthOrHeightChangeReplay=!1,i._opt.simdH264DecodeVideoWidthIsTooLargeReplay=!1,i._opt.mediaSourceUseCanvasRenderPlayFailedReplay=!1,i._opt.heartTimeoutReplay=!1,i._opt.loadingTimeoutReplay=!1,i._opt.websocket1006ErrorReplay=!1,i._opt.streamErrorReplay=!1,i._opt.streamEndReplay=!1),i._opt.hiddenControl&&(i.debug.log(i.TAG_NAME,"_opt.hiddenControl is true and set others show btn to false"),Object.keys(i._opt.operateBtns).forEach((function(e){i._opt.operateBtns[e]&&-1===(""+e).indexOf("Fn")&&(i._opt.operateBtns[e]=!1)})),i._opt.showBandwidth=!1,i._opt.extendOperateBtns=[],i._opt.controlHtml="",i.isPlayback()&&(i._opt.playbackConfig.showControl=!1)),i._opt.forceNoOffscreen||("undefined"==typeof OffscreenCanvas?(i._opt.forceNoOffscreen=!0,i._opt.useOffscreen=!1):i._opt.useOffscreen=!0),i._opt.isMpeg4&&(i.debug.log(i.TAG_NAME,"isMpeg4 is true, so set _opt.useWasm true and others params false"),i._opt.useWCS=!1,i._opt.useMSE=!1,i._opt.isNakedFlow=!1,i._opt.useSIMD=!1,i._opt.isFmp4=!1,i._opt.useWasm=!0),i.isPlayback()&&(i._opt.mseDecoderUseWorker=!1),i._opt.poster&&(i._opt.background=i._opt.poster),No(i._opt.muted)&&(i._opt.isNotMute=!0),i._opt.mseDecoderUseWorker&&(i._opt.mseDecoderUseWorker=!!(self.Worker&&self.MediaSource&&"canConstructInDedicatedWorker"in self.MediaSource&&!0===self.MediaSource.canConstructInDedicatedWorker),No(i._opt.mseDecoderUseWorker)&&i.debug.log(i.TAG_NAME,"mseDecoderUseWorker is true but not support so set _opt.mseDecoderUseWorker = false")),(i.isOldHls()||i.isWebrtcH264()||i.isAliyunRtc())&&(i.debug.log(i.TAG_NAME,"isOldHls or isWebrtcH264 or isAliyunRtc is true, so set some params false and _opt.recordType is webm"),i._opt.useWCS=!1,i._opt.useMSE=!1,i._opt.isNakedFlow=!1,i._opt.useSIMD=!1,i._opt.isFmp4=!1,i._opt.useWasm=!1,i._opt.recordType=W),i._opt.isNakedFlow&&(i.debug.log(i.TAG_NAME,"isNakedFlow is true, so set _opt.mseDecodeAudio false"),i._opt.mseDecodeAudio=!1),Gn()&&(i.debug.log(i.TAG_NAME,"isFirefox is true, so set _opt.mseDecodeAudio false"),i._opt.mseDecodeAudio=!1),!i.isOldHls()&&!i.isWebrtcH264()){if(i._opt.useWCS){var o="VideoEncoder"in window,s=$n();i._opt.useWCS=o,i._opt.useWCS&&i._opt.isH265&&(i._opt.useWCS=s),i._opt.useWCS||i.debug.warn(i.TAG_NAME,"\n useWCS is true,\n and supportWCS is ".concat(o,", supportHevcWCS is ").concat(s," , _opt.isH265 is ").concat(i._opt.isH265,"\n so set useWCS false")),i._opt.useWCS&&(i._opt.useOffscreen?i._opt.wcsUseVideoRender=!1:i._opt.wcsUseVideoRender&&(i._opt.wcsUseVideoRender=eo()&&to(),i._opt.wcsUseVideoRender||i.debug.warn(i.TAG_NAME,"wcsUseVideoRender is true, but not support so set wcsUseVideoRender false")))}if(i._opt.useMSE){var l=function(){var e=!1;return"MediaSource"in self&&(e=!0),e}()||function(){var e=!1;return!("MediaSource"in self)&&"ManagedMediaSource"in self&&(e=!0),e}(),c=Zn()||function(){var e=!1;return!("MediaSource"in self)&&"ManagedMediaSource"in self&&(self.ManagedMediaSource.isTypeSupported(Ii)||self.ManagedMediaSource.isTypeSupported(Pi)||self.ManagedMediaSource.isTypeSupported(Bi)||self.ManagedMediaSource.isTypeSupported(Mi)||self.ManagedMediaSource.isTypeSupported(Ui))&&(e=!0),e}();i._opt.useMSE=l,i._opt.useMSE&&i._opt.isH265&&(i._opt.useMSE=c),i._opt.useMSE||i.debug.warn(i.TAG_NAME,"\n useMSE is true,\n and supportMSE is ".concat(l,", supportHevcMSE is ").concat(c," , _opt.isH265 is ").concat(i._opt.isH265,"\n so set useMSE false"))}}if(No(i._opt.useMSE)&&(i._opt.mseDecodeAudio=!1),i._opt.useMSE?(i._opt.useWCS&&i.debug.warn(i.TAG_NAME,"useMSE is true and useWCS is true then useWCS set true->false"),i._opt.forceNoOffscreen||i.debug.warn(i.TAG_NAME,"useMSE is true and forceNoOffscreen is false then forceNoOffscreen set false->true"),i._opt.useWCS=!1,i._opt.forceNoOffscreen=!0):i._opt.useWCS,i._opt.isWebrtc&&i._opt.demuxUseWorker&&(i.debug.warn(i.TAG_NAME,"isWebrtc is true and demuxUseWorker is true then demuxUseWorker set true->false"),i._opt.demuxUseWorker=!1),i._opt.isHls&&i._opt.demuxUseWorker&&(i.debug.warn(i.TAG_NAME,"isHls is true and demuxUseWorker is true then demuxUseWorker set true->false"),i._opt.demuxUseWorker=!1),i._opt.isAliyunRtc&&i._opt.demuxUseWorker&&(i.debug.warn(i.TAG_NAME,"isAliyunRtc is true and demuxUseWorker is true then demuxUseWorker set true->false"),i._opt.demuxUseWorker=!1),i.isStreamWebTransport()&&i._opt.demuxUseWorker&&(i.debug.warn(i.TAG_NAME,"is stream use webTransport is true and demuxUseWorker is true then demuxUseWorker set true->false"),i._opt.demuxUseWorker=!1),No(i._opt.demuxUseWorker)&&(i._opt.mseDecoderUseWorker=!1),i.isPlayback()&&(i._opt.mseDecoderUseWorker=!1),i._opt.useMThreading&&(i._opt.useMThreading="undefined"!=typeof SharedArrayBuffer,i._opt.useMThreading||i.debug.warn(i.TAG_NAME,"useMThreading is true, but not support so set useMThreading false")),i._opt.useSIMD||-1!==i._opt.decoder.indexOf("-simd")){var u=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),d=Ho();i._opt.useSIMD=u&&No(d),i._opt.useSIMD||i.debug.warn(i.TAG_NAME,"useSIMD is true, but not support(isSupportSimd is ".concat(u," ,isIphone is ").concat(d,") so set useSIMD false"))}if(i._opt.useSIMD?-1===i._opt.decoder.indexOf("-simd")?i._opt.useMThreading?i._opt.decoder=i._opt.decoder.replace("decoder-pro.js","decoder-pro-simd-mt.js"):i._opt.decoder=i._opt.decoder.replace("decoder-pro.js","decoder-pro-simd.js"):i._opt.useMThreading&&(i._opt.decoder=i._opt.decoder.replace("decoder-pro-simd.js","decoder-pro-simd-mt.js")):-1!==i._opt.decoder.indexOf("-simd")?i._opt.useMThreading?i._opt.decoder=i._opt.decoder.replace("decoder-pro-simd.js","decoder-pro-mt.js"):i._opt.decoder=i._opt.decoder.replace("decoder-pro-simd.js","decoder-pro.js"):i._opt.useMThreading&&(i._opt.decoder=i._opt.decoder.replace("decoder-pro.js","decoder-pro-mt.js")),-1!==i._opt.decoder.indexOf("-simd")?i._opt.useMThreading?(i._opt.decoderAudio=i._opt.decoder.replace("decoder-pro-simd-mt.js","decoder-pro-audio.js"),i._opt.decoderHard=i._opt.decoder.replace("decoder-pro-simd-mt.js","decoder-pro-hard.js"),i._opt.decoderHardNotWasm=i._opt.decoder.replace("decoder-pro-simd-mt.js","decoder-pro-hard-not-wasm.js")):(i._opt.decoderAudio=i._opt.decoder.replace("decoder-pro-simd.js","decoder-pro-audio.js"),i._opt.decoderHard=i._opt.decoder.replace("decoder-pro-simd.js","decoder-pro-hard.js"),i._opt.decoderHardNotWasm=i._opt.decoder.replace("decoder-pro-simd.js","decoder-pro-hard-not-wasm.js")):i._opt.useMThreading?(i._opt.decoderAudio=i._opt.decoder.replace("decoder-pro-mt.js","decoder-pro-audio.js"),i._opt.decoderHard=i._opt.decoder.replace("decoder-pro-mt.js","decoder-pro-hard.js"),i._opt.decoderHardNotWasm=i._opt.decoder.replace("decoder-pro-mt.js","decoder-pro-hard-not-wasm.js")):(i._opt.decoderAudio=i._opt.decoder.replace("decoder-pro.js","decoder-pro-audio.js"),i._opt.decoderHard=i._opt.decoder.replace("decoder-pro.js","decoder-pro-hard.js"),i._opt.decoderHardNotWasm=i._opt.decoder.replace("decoder-pro.js","decoder-pro-hard-not-wasm.js")),No(i._opt.hasAudio)&&(i._opt.operateBtns.audio=!1),No(i._opt.hasVideo)&&(i._opt.operateBtns.fullscreen=!1,i._opt.operateBtns.screenshot=!1,i._opt.operateBtns.record=!1,i._opt.operateBtns.ptz=!1,i._opt.operateBtns.quality=!1,i._opt.operateBtns.zoom=!1),i._opt.qualityConfig&&0===i._opt.qualityConfig.length&&i._opt.operateBtns.quality&&(i._opt.operateBtns.quality=!1,i.debug.warn(i.TAG_NAME,"_opt.qualityConfig is empty, so set operateBtns.quality false")),Oo(i._opt.useWebGPU)&&(i._opt.useWebGPU=function(){var e=!1;return"gpu"in navigator&&(e=!0),e}(),No(i._opt.useWebGPU)&&i.debug.warn(i.TAG_NAME,"useWebGPU is true, but not support so set useWebGPU false")),i._opt.hasControl=i._hasControl(),i._loading=!1,i._playing=!1,i._playbackPause=!1,i._hasLoaded=!1,i._zooming=!1,i._destroyed=!1,i._closed=!1,i._checkHeartTimeout=null,i._checkLoadingTimeout=null,i._checkStatsInterval=null,i._checkVisibleHiddenTimeout=null,i._startBpsTime=null,i._isPlayingBeforePageHidden=!1,i._stats={buf:0,netBuf:0,fps:0,maxFps:0,dfps:0,abps:0,vbps:0,ts:0,mseTs:0,currentPts:0,pTs:0,dts:0,mseVideoBufferDelayTime:0,isDropping:!1},i._allStatsData={},i._faceDetectActive=!1,i._objectDetectActive=!1,i._occlusionDetectActive=!1,i._imageDetectActive=!1,i._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},i._videoTimestamp=0,i._audioTimestamp=0,i._latestAudioTimestamp=0,i._videoIframeIntervalTs=0,i._streamQuality=i._opt.defaultStreamQuality||"",!i._streamQuality&&i._opt.qualityConfig.length>0&&(i._streamQuality=i._opt.qualityConfig[0]||""),i._visibility=!0,i._lastestVisibilityChangeTimestamp=null,i._tempWorkerStats=null,i._historyFpsList=[],i._historyVideoDiffList=[],i._tempStreamList=[],i._tempInnerPlayBgobj=null,i._flvMetaData=null,i._flvMetaDataFps=null,i._mseWorkerData={},No(i._opt.useMSE)&&No(i._opt.useWCS)&&!i.isWebrtcH264()&&!i.isOldHls()&&(i._opt.useWasm=!0),(i.isOldHls()||i.isWebrtcH264())&&(i._opt.hasVideo=!0,i._opt.hasAudio=!0),i._opt.hasVideo||(i._opt.useMSE=!1,i._opt.useWCS=!1),i._opt.useWasm&&(i._opt.useOffscreen?i._opt.wasmUseVideoRender=!1:i._opt.wasmUseVideoRender&&(i._opt.wasmUseVideoRender=Jn()&&eo()&&to(),i._opt.wasmUseVideoRender||i.debug.warn(i.TAG_NAME,"use wasm video render, but not support so set wasmUseVideoRender false")),i._opt.useSIMD?i.debug.log(i.TAG_NAME,"use simd wasm"):i.debug.log(i.TAG_NAME,"use wasm")),i._opt.useWasm&&(i._opt.useFaceDetector&&window.JessibucaProFaceDetector||i._opt.useObjectDetector&&window.JessibucaProObjectDetector||i._opt.useOcclusionDetector&&window.JessibucaProOcclusionDetector||i._opt.useImageDetector&&window.JessibucaProImageDetector)?(i.ai=new mb(i),i._opt.useFaceDetector&&window.JessibucaProFaceDetector||(i._opt.operateBtns.aiFace=!1),i._opt.useObjectDetector&&window.JessibucaProObjectDetector||(i._opt.operateBtns.aiObject=!1),i._opt.useOcclusionDetector&&window.JessibucaProOcclusionDetector||(i._opt.operateBtns.aiOcclusion=!1),i._opt.useImageDetector&&i._opt.aiImageDetectActive&&window.JessibucaProImageDetector&&(i.imageDetectActive=!0)):(i._opt.operateBtns.aiObject=!1,i._opt.operateBtns.aiFace=!1,i._opt.operateBtns.aiOcclusion=!1),i._opt.useFaceDetector&&(i._opt.useWasm&&window.JessibucaProFaceDetector||i.debug.warn(i.TAG_NAME,"use face detector, useWasm is ".concat(i._opt.useWasm," and window.JbProFaceDetector is null"))),i._opt.useObjectDetector&&(i._opt.useWasm&&window.JessibucaProObjectDetector||i.debug.warn(i.TAG_NAME,"use object detector, useWasm is ".concat(i._opt.useWasm," and window.JbProObjectDetector is null"))),i._opt.useOcclusionDetector&&(i._opt.useWasm&&window.JessibucaProOcclusionDetector||i.debug.warn(i.TAG_NAME,"use occlusion detector, useWasm is ".concat(i._opt.useWasm," and window.JessibucaProOcclusionDetector is null"))),i._opt.useImageDetector&&(i._opt.useWasm&&window.JessibucaProImageDetector||i.debug.warn(i.TAG_NAME,"use image detector, useWasm is ".concat(i._opt.useWasm," and window.JessibucaProImageDetector is null"))),i._opt.useVideoRender&&(i._opt.useWasm&&!i._opt.useOffscreen?(i._opt.wasmUseVideoRender=Jn()&&eo()&&to(),i._opt.wasmUseVideoRender||i.debug.warn(i.TAG_NAME,"use wasm video render, but not support so set wasmUseVideoRender false")):i._opt.useWCS&&!i._opt.useOffscreen&&(i._opt.wcsUseVideoRender=eo()&&to(),i._opt.wcsUseVideoRender||i.debug.warn(i.TAG_NAME,"use wcs video render, but not support so set wcsUseVideoRender false"))),i._opt.useCanvasRender&&(i._opt.useMSE&&No(i._opt.mseDecoderUseWorker)&&(i._opt.mseUseCanvasRender=!0),i._opt.useWasm&&(i._opt.wasmUseVideoRender=!1),i._opt.useWCS&&(i._opt.wcsUseVideoRender=!1),i.isOldHls()&&!Wn()&&(i._opt.hlsUseCanvasRender=!0),i.isWebrtcH264()&&(i._opt.webrtcUseCanvasRender=!0)),i._opt.useVideoRender=!1,i._opt.useCanvasRender=!1,i._opt.useWasm?i._opt.wasmUseVideoRender?i._opt.useVideoRender=!0:i._opt.useCanvasRender=!0:i._opt.useWCS?i._opt.wcsUseVideoRender?i._opt.useVideoRender=!0:i._opt.useCanvasRender=!0:i._opt.useMSE?i._opt.mseUseCanvasRender?i._opt.useCanvasRender=!0:i._opt.useVideoRender=!0:i.isOldHls()?i._opt.hlsUseCanvasRender?i._opt.useCanvasRender=!0:i._opt.useVideoRender=!0:i.isWebrtcH264()&&(i._opt.webrtcUseCanvasRender?i._opt.useCanvasRender=!0:i._opt.useVideoRender=!0),a=i,Object.defineProperty(a,"rect",{get:function(){var e={};return a.$container&&(e=a.$container.getBoundingClientRect(),e.width=Math.max(e.width,a.$container.clientWidth),e.height=Math.max(e.height,a.$container.clientHeight)),e}}),["bottom","height","left","right","top","width"].forEach((function(e){Object.defineProperty(a,e,{get:function(){return a.rect[e]||0}})})),i.events=new Yo(i),i._opt.hasVideo&&(i.video=new vs(i),i.recorder=new El(i)),i.isOldHls()?(i.hlsDecoder=new jv(i),i.loaded=!0):i.isWebrtcH264()?(i._opt.isWebrtcForZLM?i.webrtc=new hb(i):i._opt.isWebrtcForSRS?i.webrtc=new yb(i):i._opt.isWebrtcForOthers?i.webrtc=new vb(i):i.webrtc=new db(i),i.loaded=!0):i.isAliyunRtc()?(i.aliyunRtcDecoder=new Ab(i),i.loaded=!0):(i.isUseHls265()&&(i.hlsDecoder=new cb(i)),i.isWebrtcH265()&&(i.webrtc=new db(i)),No(Eo(i._opt))?i.decoderWorker=new Pl(i):i.loaded=!0),i._opt.hasAudio&&(i.audio=new Fs(i)),i.stream=null,i.demux=null,i._lastVolume=null,i._isMute=null,i._isInZoom=!1,i._playingStartTimestamp=null,i.isMSEVideoDecoderInitializationFailedNotSupportHevc=!1,i.isMSEAudioDecoderError=!1,i.isMSEPlaybackRateChangePause=!1,i.isPlayFailedAndPaused=!1,i._opt.useWCS&&(i.webcodecsDecoder=new zu(i),!i._opt.hasAudio&&No(i._opt.demuxUseWorker)&&(i.loaded=!0)),i._opt.useMSE&&No(i._opt.mseDecoderUseWorker)&&(i.mseDecoder=new md(i),!i._opt.hasAudio&&No(i._opt.demuxUseWorker)&&(i.loaded=!0)),i.control=new od(i),i._opt.contextmenuBtns.length>0&&No(i._opt.disableContextmenu)&&Nn()?i.contextmenu=new gb(i):Oo(i._opt.disableContextmenu)&&i._opt.contextmenuBtns.length>0&&Nn()&&i.debug.warn(i.TAG_NAME,"disableContextmenu is true, but contextmenuBtns is not empty, so Contextmenu can not be created,please check"),i.isPlayback()&&(i.playback=new pb(i,i._opt.playbackConfig)),i._opt.operateBtns.zoom&&(i.zoom=new fb(i)),/(iphone|ipad|ipod|ios|android)/i.test(window.navigator.userAgent.toLowerCase())&&No(i._opt.supportLockScreenPlayAudio&&Hn())&&(i.keepScreenOn=new yd(i)),function(e){try{var t=function(t){_o(t)===e.$container&&(e.emit(Rt.fullscreen,e.fullscreen),e.fullscreen?e._opt.useMSE&&e.resize():e.resize())};sn.on("change",t),e.events.destroys.push((function(){sn.off("change",t)}))}catch(e){}if(e.on(xt.decoderWorkerInit,(function(){e.debug.log("player","listen decoderWorkerInit and set loaded true"),e.loaded=!0})),e.on(xt.play,(function(){e.loading=!1})),e.on(xt.fullscreen,(function(t){if(t)try{sn.request(e.$container).then((function(){})).catch((function(t){e.debug.error("player","fullscreen request error",t),On()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}))}catch(t){On()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}else try{sn.exit().then((function(){e.webFullscreen&&(e.webFullscreen=!1)})).catch((function(t){e.debug.error("player","fullscreen exit error",t),e.webFullscreen&&(e.webFullscreen=!1)}))}catch(t){e.webFullscreen&&(e.webFullscreen=!1)}})),On()&&e.on(xt.webFullscreen,(function(t){t?e.$container.classList.add("jb-pro-fullscreen-web"):e.$container.classList.remove("jb-pro-fullscreen-web"),e.emit(Rt.fullscreen,e.fullscreen)})),e.on(xt.resize,(function(){e.video&&e.video.resize()})),e._opt.debug){var i=[xt.timeUpdate,xt.currentPts,xt.videoSEI],r=[xt.stats,xt.playbackStats,xt.playbackTimestamp,xt.flvMetaData,xt.playToRenderTimes,xt.audioInfo,xt.videoInfo];Object.keys(xt).forEach((function(t){e.on(xt[t],(function(a){if(!i.includes(t)){var n;r.includes(t)&&(a=JSON.stringify(a));for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l1&&void 0!==arguments[1]&&arguments[1];this._opt=Object.assign({},this._opt,e),Oo(i)&&this.decoderWorker&&Object.keys(e).forEach((function(i){t.decoderWorker.updateWorkConfig({key:i,value:e[i]})}))}},{key:"init",value:function(){var e=this;return new Promise((function(t,i){e.video||e._opt.hasVideo&&(e.video=new vs(e)),e.audio||e._opt.hasAudio&&(e.audio=new Fs(e)),e.stream||(e.stream=new Js(e)),e.isOldHls()?(e.hlsDecoder||(e.hlsDecoder=new jv(e),e.loaded=!0),t()):e.isWebrtcH264()?(e.webrtc||(e._opt.isWebrtcForZLM?e.webrtc=new hb(e):e._opt.isWebrtcForSRS?e.webrtc=new yb(e):e._opt.isWebrtcForOthers?e.webrtc=new vb(e):e.webrtc=new db(e),e.loaded=!0),t()):e.isAliyunRtc()?(e.aliyunRtcDecoder||(e.aliyunRtcDecoder=new Ab(e),e.loaded=!0),t()):(e.demux||e._opt.hasVideo&&!e.isUseWorkerDemuxAndDecode&&(e.demux=new Gu(e)),e._opt.useWCS&&(e.webcodecsDecoder||(e.webcodecsDecoder=new zu(e))),e._opt.useMSE&&No(e._opt.mseDecoderUseWorker)&&(e.mseDecoder||(e.mseDecoder=new md(e))),e.isUseHls265()&&(e.hlsDecoder||(e.hlsDecoder=new cb(e))),e.isWebrtcH265()&&(e.webrtc||(e.webrtc=new db(e))),e.decoderWorker?e.loaded?t():e.once(xt.decoderWorkerInit,(function(){e.isDestroyedOrClosed()?(e.debug.error(e.TAG_NAME,"init() failed and player is destroyed"),i("init() failed and player is destroyed")):(e.loaded=!0,t())})):Eo(e._opt)?t():(e.decoderWorker=new Pl(e),e.once(xt.decoderWorkerInit,(function(){e.isDestroyedOrClosed()?(e.debug.error(e.TAG_NAME,"init() failed and player is destroyed"),i("init() failed and player is destroyed")):(e.loaded=!0,t())}))))}))}},{key:"play",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){if(!e&&!t._opt.url)return a("url is empty");t._closed=!1,t.loading=!0,t.playing=!1,t._times.playInitStart=Ln(),e||(e=t._opt.url),t._opt.url=e,t.control&&t._opt.loadingBackground&&t.control.initLoadingBackground(),t.init().then((function(){t.debug.log(t.TAG_NAME,"play() init and next fetch stream"),t._times.playStart=Ln(),t._opt.isNotMute&&t.mute(!1),t.enableWakeLock(),t.checkLoadingTimeout(),t.stream?(t.stream.once(It.fetchError,(function(e){t.emitError(It.fetchError,e)})),t.stream.once(It.websocketError,(function(e){t.emitError(It.websocketError,e)})),t.stream.once(xt.streamEnd,(function(e){t.emit(xt.streamEnd,e)})),t.stream.once(It.hlsError,(function(e){t.emitError(It.hlsError,e)})),t.stream.once(It.webrtcError,(function(e){t.emitError(It.webrtcError,e)})),t.stream.once(xt.streamSuccess,(function(){r(),t._times.streamResponse=Ln(),t.video&&t.video.play(),t.checkStatsInterval(),t.isPlayback()&&t.playback&&t.playback.startCheckStatsInterval()})),t.stream.fetchStream(e,i)):(t.debug.warn(t.TAG_NAME,"play() this.stream is null and is isDestroyedOrClosed is ".concat(t.isDestroyedOrClosed())),a("this.stream is null"))})).catch((function(e){a(e)}))}))}},{key:"playForControl",value:function(){var e=this;return new Promise((function(t,i){e.debug.log(e.TAG_NAME,"playForControl() and pauseAndNextPlayUseLastFrameShow is ".concat(e._opt.pauseAndNextPlayUseLastFrameShow)),e._opt.pauseAndNextPlayUseLastFrameShow&&e._tempInnerPlayBgobj&&e._tempInnerPlayBgobj.loadingBackground&&e.updateOption({loadingBackground:e._tempInnerPlayBgobj.loadingBackground,loadingBackgroundWidth:e._tempInnerPlayBgobj.loadingBackgroundWidth,loadingBackgroundHeight:e._tempInnerPlayBgobj.loadingBackgroundHeight}),e.play().then((function(e){t(e)})).catch((function(e){i(e)}))}))}},{key:"close",value:function(){var e=this;return new Promise((function(t,i){e._close().then((function(){e.video&&e.video.clearView(),t()})).catch((function(e){i(e)}))}))}},{key:"resumeAudioAfterPause",value:function(){this.lastVolume&&No(this._isMute)&&(this.volume=this.lastVolume)}},{key:"_close",value:function(){var e=A(v().mark((function e(){return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._closed=!0,this.video&&(this.video.resetInit(),this.video.pause(!0)),this.loading=!1,this.recording=!1,this.zooming=!1,this.playing=!1,this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.isPlayback()&&this.playback&&this.playback.clearStatsInterval(),this.releaseWakeLock(),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},e.t0=this.decoderWorker,!e.t0){e.next=19;break}return e.next=18,this.decoderWorker.destroy();case 18:this.decoderWorker=null;case 19:if(e.t1=this.stream,!e.t1){e.next=24;break}return e.next=23,this.stream.destroy();case 23:this.stream=null;case 24:if(this.demux&&(this.demux.destroy(),this.demux=null),this.webcodecsDecoder&&(this.webcodecsDecoder.destroy(),this.webcodecsDecoder=null),this.mseDecoder&&(this.mseDecoder.destroy(),this.mseDecoder=null),e.t2=this.hlsDecoder,!e.t2){e.next=32;break}return e.next=31,this.hlsDecoder.destroy();case 31:this.hlsDecoder=null;case 32:if(this.webrtc&&(this.webrtc.destroy(),this.webrtc=null),this.aliyunRtcDecoder&&(this.aliyunRtcDecoder.destroy(),this.aliyunRtcDecoder=null),e.t3=this.audio,!e.t3){e.next=39;break}return e.next=38,this.audio.destroy();case 38:this.audio=null;case 39:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,r){t?e.close().then((function(){i()})).catch((function(e){r(e)})):e._close().then((function(){i()})).catch((function(e){r(e)}))}))}},{key:"pauseForControl",value:function(){var e=this;return new Promise((function(t,i){if(e.debug.log(e.TAG_NAME,"_pauseInner()"),e._opt.pauseAndNextPlayUseLastFrameShow&&e.video){var r=e.video.screenshot("","png",.92,"base64");if(r){var a=e.getVideoInfo();a?(e.debug.log(e.TAG_NAME,"pauseForControl() and loadingBackground width is ".concat(a.width," and height is ").concat(a.height)),e._tempInnerPlayBgobj={loadingBackground:r,loadingBackgroundWidth:a.width,loadingBackgroundHeight:a.height}):e.debug.warn(e.TAG_NAME,"pauseForControl() and videoInfo is null")}else e.debug.warn(e.TAG_NAME,"pauseForControl() and loadingBackground is null")}e.pause().then((function(e){t(e)})).catch((function(e){i(e)}))}))}},{key:"isAudioMute",value:function(){var e=!0;return this.audio&&(e=this.audio.isMute),e}},{key:"isAudioNotMute",value:function(){return!this.isAudioMute()}},{key:"mute",value:function(e){this.audio&&this.audio.mute(e)}},{key:"resize",value:function(){this.video&&this.video.resize()}},{key:"startRecord",value:function(e,t){this.recording||(this.recorder.setFileName(e,t),this.recording=!0)}},{key:"stopRecordAndSave",value:function(e,t){var i=this;return new Promise((function(r,a){i.recorder||a("recorder is null"),i.recording?(i._opt.useWasm&&i.decoderWorker&&i.decoderWorker.updateWorkConfig({key:"isRecording",value:!1}),i.recorder.stopRecordAndSave(e,t).then((function(e){r(e)})).catch((function(e){a(e)}))):a("recorder is not recording")}))}},{key:"_hasControl",value:function(){var e=this,t=!1,i=!1;return Object.keys(this._opt.operateBtns).forEach((function(t){e._opt.operateBtns[t]&&-1===(""+t).indexOf("Fn")&&(i=!0)})),(this._opt.showBandwidth||i)&&(t=!0),this._opt.extendOperateBtns&&this._opt.extendOperateBtns.length>0&&(t=!0),this.isPlayback()&&this._opt.playbackConfig.showControl&&(t=!0),this._opt.controlHtml&&(t=!0),t}},{key:"useWasmDecode",value:function(){return No(this._opt.useMSE)&&No(this._opt.useWCS)}},{key:"canVideoTrackWritter",value:function(){var e=this._opt;return!this.isOldHls()&&!this.isWebrtcH264()&&No(e.useMSE)&&!this.isAliyunRtc()&&(e.useWCS&&No(e.useOffscreen)&&e.wcsUseVideoRender||this.useWasmDecode())}},{key:"checkHeartTimeout$2",value:function(){if(No(this.playbackPause)&&this.playing){if(this.isDestroyedOrClosed())return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but player is destroyed"));if(No(this.isHistoryFpsListAllZero()))return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but fps is not all zero"));if(0!==this._stats.fps)return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but fps is ".concat(this._stats.fps)));if(No(this.visibility)&&0!==this._stats.vbps)return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but page is not visibility and vbps is ".concat(this._stats.vbps)));var e=this._historyFpsList.join(",");this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 and\n pause and emit delayTimeout event and\n current vbps is ".concat(this._stats.vbps," and\n current fps is ").concat(this._stats.fps," and\n history FpsList is ").concat(e," and\n current visibility is ").concat(this.visibility," and")),this.emit(xt.timeout,xt.delayTimeout),this.emit(xt.delayTimeout)}else this.debug.log(this.TAG_NAME,"checkHeartTimeout$2 playbackPause is ".concat(this.playbackPause,", playing is ").concat(this.playing))}},{key:"checkStatsInterval",value:function(){var e=this;this._checkStatsInterval=setInterval((function(){e.updateStats()}),1e3)}},{key:"checkLoadingTimeout",value:function(){var e=this;this._checkLoadingTimeout=setTimeout((function(){e.playing?e.debug.warn(e.TAG_NAME,"checkLoadingTimeout but loading is ".concat(e.loading," and playing is ").concat(e.playing)):e.isDestroyedOrClosed()?e.debug&&e.debug.warn(e.TAG_NAME,"checkLoadingTimeout but player is destroyed"):(e.debug.warn(e.TAG_NAME,"checkLoadingTimeout and pause and emit loadingTimeout event"),e.emit(xt.timeout,xt.loadingTimeout),e.emit(xt.loadingTimeout))}),1e3*this._opt.loadingTimeout)}},{key:"clearCheckLoadingTimeout",value:function(){this._checkLoadingTimeout&&(this.debug.log(this.TAG_NAME,"clearCheckLoadingTimeout"),clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}},{key:"clearStatsInterval",value:function(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}},{key:"handleRender",value:function(){this.isDestroyedOrClosed()?this.debug&&this.debug.warn(this.TAG_NAME,"handleRender but player is destroyed"):(this.loading&&(this.clearCheckLoadingTimeout(),this.loading=!1,this.emit(xt.start)),this.playing||(this.playing=!0))}},{key:"updateStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._startBpsTime||(this._startBpsTime=Ln()),no(e.ts)){var t=parseInt(e.ts,10);this._stats.ts=t,null===this._playingStartTimestamp&&t>0&&(this._playingStartTimestamp=t)}no(e.dts)&&(this._stats.dts=parseInt(e.dts,10)),no(e.mseTs)&&(this._stats.mseTs=e.mseTs),no(e.buf)&&(this._stats.buf=e.buf),no(e.netBuf)&&(this._stats.netBuf=e.netBuf),no(e.currentPts)&&(this._stats.currentPts=e.currentPts),e.fps&&(this._stats.fps+=1),e.dfps&&(this._stats.dfps+=1),e.abps&&(this._stats.abps+=e.abps),e.vbps&&(this._stats.vbps+=e.vbps),e.workerStats&&(this._tempWorkerStats=e.workerStats),e.isDropping&&(this._stats.isDropping=e.isDropping),e.mseVideoBufferDelayTime&&(this._stats.mseVideoBufferDelayTime=parseInt(1e3*e.mseVideoBufferDelayTime,10));var i=Ln();if(!(i-this._startBpsTime<1e3)){null!==this._playingStartTimestamp&&this._stats.fps>0&&(this._stats.pTs+=1);var r=0,a=0,n=0,o=0,s=0;this._opt.useMSE&&(this.mseDecoder?(r=this.mseDecoder.checkSourceBufferDelay(),r=parseInt(1e3*r,10),a=this.mseDecoder.checkSourceBufferStore(),a=a.toFixed(2),n=this.mseDecoder.getDecodeDiffTimes(),o=this.mseDecoder.getDecodePlaybackRate(),s=this.mseDecoder.getPendingSegmentsLength()):this.isMseDecoderUseWorker()&&(r=this.video.checkSourceBufferDelay(),r=parseInt(1e3*r,10),a=this.video.checkSourceBufferStore(),a=a.toFixed(2),o=this.video.getDecodePlaybackRate())),this._opt.useWCS&&this.webcodecsDecoder&&(n=this.webcodecsDecoder.getDecodeDiffTimes()),this.isOldHls()&&this.hlsDecoder&&(r=this.hlsDecoder.checkHlsBufferedDelay(),r=parseInt(1e3*r,10));var l=0,c=0,u=0;this.isUseHls265()&&this.hlsDecoder&&(r=this.hlsDecoder.checkHlsBufferedDelay(),r=r.toFixed(2),l=this.hlsDecoder.getDemuxBufferedListLength(),u=this.hlsDecoder.getDemuxVideoBufferedListLength(),c=this.hlsDecoder.getDemuxAudioBufferedListLength());var d=0,h=0,p=0,f=!1,m=0;this._opt.useWasm||this._opt.demuxUseWorker?this._tempWorkerStats&&(h=this._tempWorkerStats.demuxBufferDelay,p=this._tempWorkerStats.audioDemuxBufferDelay,d=this._tempWorkerStats.streamBufferByteLength,this._stats.netBuf=this._tempWorkerStats.netBuf,m=this._tempWorkerStats.pushLatestDelay,f=this._tempWorkerStats.isStreamTsMoreThanLocal,this._stats.buf=this._tempWorkerStats.latestDelay):this.demux&&(d=this.demux.getInputByteLength(),m=this.demux.getPushLatestDelay(),f=this.demux.getIsStreamTsMoreThanLocal(),this.demux.bufferList&&(h=this.demux.bufferList.length));var g=0,y=0;this.audio&&this.audio.bufferList&&(g=this.audio.bufferList.length,y=parseInt(g*this.audio.oneBufferDuration,10));var v=0,A=0;if(this.isPlayback()&&this.video){this._opt.playbackConfig.isUseFpsRender&&(v=this.video.bufferList&&this.video.bufferList.length||0);var b=this.video.getStreamFps(),_=b>0?1e3/b:0;A=parseInt(_*v+_*h,10)}var k=0;this.videoTimestamp>0&&(k=this._stats.dts-this.videoTimestamp);var w=k+this._stats.netBuf;this.isOldHls()&&(this._stats.fps=this.hlsDecoder.getFps()),this._stats.fps>this._stats.maxFps&&(this._stats.maxFps=this._stats.fps);var S=this.getVideoCurrentTime(),T=this._stats.videoCurrentTime,E=-1;T&&S&&(E=(S-T).toFixed(2),S=S.toFixed(2));var C=0;this.audioTimestamp>0&&(C=this.audioTimestamp-this.getRenderCurrentPts()),this._allStatsData=Object.assign(this._stats,{audioBuffer:g,audioBufferDelayTs:y,audioTs:this.audioTimestamp,latestAudioTs:this.latestAudioTimestamp,playbackVideoBuffer:v,playbackVideoWaitingBuffer:0,playbackAudioWaitingBuffer:0,playbackCacheDataDuration:A,demuxBuffer:h,pushLatestDelay:m,audioDemuxBuffer:p,streamBuffer:d,mseDelay:r,mseStore:a,mseDecodeDiffTimes:n,mseDecodePlaybackRate:o,msePendingBuffer:s,wcsDecodeDiffTimes:n,hlsDelay:r,hlsDemuxLength:l,hlsDemuxAudioLength:c,hlsDemuxVideoLength:u,delayTs:k,totalDelayTs:w,isStreamTsMoreThanLocal:f,videoCurrentTime:S,videoCurrentTimeDiff:E,audioSyncVideo:C});var x=null,R=null,D="";if(this.isPlayer()&&this._opt.hasVideo&&this.playing){x=function(e,t){var i=3,r=t||25;return e<.33*r?i=0:e<.5*r?i=1:e<.83*r&&(i=2),i}(this._stats.fps,this._flvMetaDataFps),this._allStatsData.performance=x;var L=this.checkVideoSmooth(this._allStatsData);D=L.reason,R=L.result,this._allStatsData.videoSmooth=R}this.emit(xt.stats,this._allStatsData),this._allStatsData.streamBuffer>this._opt.flvDemuxBufferSizeMaxLarge&&this.getDemuxType()===J&&this.emit(It.flvDemuxBufferSizeTooLarge,this._allStatsData.streamBuffer),this._opt.hasVideo?(this.updateHistoryFpsList(this._stats.fps,this._stats.videoCurrentTimeDiff),no(x)&&this.emit(xt.performance,x),no(R)&&this.emit(xt.videoSmooth,R,D)):this._opt.hasAudio&&this.updateHistoryFpsList(this._stats.abps,0),this._stats.fps=0,this._stats.dfps=0,this._stats.abps=0,this._stats.vbps=0,this._stats.isDropping=!1,this._startBpsTime=i}}},{key:"resetStats",value:function(){this._startBpsTime=null,this._playingStartTimestamp=null,this._historyFpsList=[],this._historyVideoDiffList=[],this._stats={buf:0,netBuf:0,fps:0,maxFps:0,dfps:0,abps:0,vbps:0,ts:0,mseTs:0,currentPts:0,pTs:0,dts:0,mseVideoBufferDelayTime:0,isDropping:!1},this._allStatsData={}}},{key:"checkVideoSmooth",value:function(e){var t=!0,i="";if(this._opt.videoBuffer,this._opt.videoBufferDelay,this.isWebrtcH264()||this.isOldHls())return{result:t,reason:i};if(0===e.vbps&&No(this._opt.isHls)&&(i="vbpsIsZero",this.debug.log(this.TAG_NAME,"checkVideoSmooth false because ".concat(i)),t=!1),t&&e.isDropping&&(i="isDroppingIsTrue",this.debug.log(this.TAG_NAME,"checkVideoSmooth false because ".concat(i)),t=!1),t&&this.visibility&&this._historyFpsList.length>=this._opt.heartTimeout){var r=function(e){var t=Math.max.apply(Math,g(e)),i=Math.min.apply(Math,g(e));return e.filter((function(e){return e!==t&&e!==i}))}(this._historyFpsList),a=r.reduce((function(e,t){return e+t}),0)/r.length,n=.83*a;e.fps=1.5||e.videoCurrentTimeDiff<=.5)&&-1!==e.videoCurrentTimeDiff&&(i="videoCurrentTimeDiffIsNotNormal",this.debug.log(this.TAG_NAME,"checkVideoSmooth false because videoCurrentTimeDiff is ".concat(e.videoCurrentTimeDiff)),t=!1),{result:t,reason:i}}},{key:"enableWakeLock",value:function(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.enable()}},{key:"releaseWakeLock",value:function(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.disable()}},{key:"clearBufferDelay",value:function(){this._opt.useWasm?this.decoderWorker&&this.decoderWorker.clearWorkBuffer(!0):this.demux&&this.demux.clearBuffer(!0)}},{key:"doDestroy",value:function(){this.emit(xt.beforeDestroy)}},{key:"handlePlayToRenderTimes",value:function(){if(this.isDestroyedOrClosed())this.debug.log(this.TAG_NAME,"handlePlayToRenderTimes but player is closed or destroyed");else{var e=this.getPlayToRenderTimes();this.emit(xt.playToRenderTimes,e)}}},{key:"getPlayToRenderTimes",value:function(){var e=this._times;return e.playTimestamp=e.playStart-e.playInitStart,e.streamTimestamp=e.streamStart-e.playStart,e.streamResponseTimestamp=e.streamResponse-e.streamStart>0?e.streamResponse-e.streamStart:0,e.demuxTimestamp=e.demuxStart-e.streamResponse>0?e.demuxStart-e.streamResponse:0,e.decodeTimestamp=e.decodeStart-e.demuxStart>0?e.decodeStart-e.demuxStart:0,e.videoTimestamp=e.videoStart-e.decodeStart,e.allTimestamp=e.videoStart-e.playInitStart,e}},{key:"getOption",value:function(){return this._opt}},{key:"getPlayType",value:function(){return this._opt.playType}},{key:"isPlayer",value:function(){return this._opt.playType===j}},{key:"isPlayback",value:function(){return this._opt.playType===z}},{key:"isDemuxSetCodecInit",value:function(){var e=!0,t=this._opt;return t.useWCS&&!t.useOffscreen?e=!!this.webcodecsDecoder&&this.webcodecsDecoder.hasInit:t.useMSE&&(e=!!this.mseDecoder&&this.mseDecoder.hasInit),e}},{key:"isDemuxDecodeFirstIIframeInit",value:function(){var e=!0,t=this._opt;return t.useWCS&&!t.useOffscreen?e=!!this.webcodecsDecoder&&this.webcodecsDecoder.isDecodeFirstIIframe:t.useMSE&&(e=!!this.mseDecoder&&this.mseDecoder.isDecodeFirstIIframe),e}},{key:"isAudioPlaybackRateSpeed",value:function(){var e=!1;return this.audio&&(e=this.audio.isPlaybackRateSpeed()),e}},{key:"getPlayingTimestamp",value:function(){return this._stats.pTs}},{key:"getRecordingType",value:function(){var e=null;return this.recorder&&(e=this.recorder.getType()),e}},{key:"getRecordingByteLength",value:function(){var e=0;return this.recording&&(e=this.recorder.getToTalByteLength()),e}},{key:"getRecordingDuration",value:function(){var e=0;return this.recording&&(e=this.recorder.getTotalDuration()),e}},{key:"getDecodeType",value:function(){var e="",t=this.getOption();return this.isWebrtcH264()?ce:this.isAliyunRtc()?de:this.isOldHls()?ue:(t.useMSE&&(e+=re+" ",t.mseDecoderUseWorker&&(e+="worker")),t.useWCS&&(e+=ae+" "),t.useWasm&&(e+=oe+" ",t.useSIMD&&(e+=se+" "),t.useMThreading&&(e+=le+" ")),t.useOffscreen&&(e+=ne+" "),e)}},{key:"getDemuxType",value:function(){return this._opt.demuxType}},{key:"getRenderType",value:function(){var e="";return this.video&&(e=this.video.getType()),e}},{key:"getCanvasRenderType",value:function(){var e="";return this.video&&(e=this.video.getCanvasType()),e}},{key:"getAudioEngineType",value:function(){var e="";return this.audio&&(e=this.audio.getEngineType()),e}},{key:"getStreamType",value:function(){var e="";return this.stream&&(e=this.stream.getStreamType()),e}},{key:"getAllStatsData",value:function(){return this._allStatsData}},{key:"isFlvDemux",value:function(){return this._opt.demuxType===J}},{key:"isM7SDemux",value:function(){return this._opt.demuxType===q}},{key:"isNakedFlowDemux",value:function(){return this._opt.demuxType===X}},{key:"isMpeg4Demux",value:function(){return this._opt.demuxType===$}},{key:"isTsDemux",value:function(){return this._opt.demuxType===te}},{key:"isFmp4Demux",value:function(){return this._opt.demuxType===Z}},{key:"togglePerformancePanel",value:function(e){this.updateOption({showPerformance:e}),this.emit(xt.togglePerformancePanel,e)}},{key:"setScaleMode",value:function(e){var t={isFullResize:!1,isResize:!1,aspectRatio:"default"};switch(e=Number(e)){case vi:t.isFullResize=!1,t.isResize=!1;break;case Ai:t.isFullResize=!1,t.isResize=!0;break;case bi:t.isFullResize=!0,t.isResize=!0}this.updateOption(t),this.resize(),this.emit(xt.viewResizeChange,e)}},{key:"startVisibilityHiddenTimeout",value:function(){var e=this;this.clearVisibilityHiddenTimeout(),this._opt.pageVisibilityHiddenTimeout>0&&(this.visibilityHiddenTimeout=setTimeout((function(){e.emit(xt.visibilityHiddenTimeout)}),1e3*this._opt.pageVisibilityHiddenTimeout))}},{key:"clearVisibilityHiddenTimeout",value:function(){this._checkVisibleHiddenTimeout&&(clearTimeout(this._checkVisibleHiddenTimeout),this._checkVisibleHiddenTimeout=null)}},{key:"faceDetect",value:function(e){this.faceDetectActive=e,No(e)&&this.video&&this.video.addAiContentToCanvas([])}},{key:"objectDetect",value:function(e){this.objectDetectActive=e,No(e)&&this.video&&this.video.addAiContentToCanvas([])}},{key:"occlusionDetect",value:function(e){this.occlusionDetectActive=e}},{key:"downloadNakedFlowFile",value:function(){this.demux&&this.demux.downloadNakedFlowFile&&this.demux.downloadNakedFlowFile()}},{key:"downloadFmp4File",value:function(){this.demux&&this.demux.downloadFmp4File&&this.demux.downloadFmp4File()}},{key:"downloadMpeg4File",value:function(){var e=new Blob([this._tempStreamList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+".mpeg4",t.click(),window.URL.revokeObjectURL(t.href)}catch(e){console.error("downloadMpeg4File",e)}}},{key:"hasCacheOnGopBuffer",value:function(){var e=this.videoIframeIntervalTs,t=this._allStatsData.demuxBuffer,i=this._allStatsData.maxFps,r=!1;return e&&t&&i&&(r=1e3/i*t>e),r}},{key:"addContentToCanvas",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.video&&this.video.addContentToCanvas(e)}},{key:"addContentToContainer",value:function(){}},{key:"sendWebsocketMessage",value:function(e){var t=this.getStreamType();t===M||t===O+" "+M?this.stream.sendMessage(e):this.debug.warn(this.TAG_NAME,"sendWebsocketMessage: stream type is not websocket, current stream type is ".concat(this.getStreamType()))}},{key:"checkIsInRender",value:function(){var e=this._stats;return e.vbps>0&&e.fps>0}},{key:"setControlHtml",value:function(e){this.control&&this.control.$controlHtml&&(this.control.$controlHtml.innerHTML=e)}},{key:"clearControlHtml",value:function(){this.control&&this.control.$controlHtml&&(this.control.$controlHtml.innerHTML="")}},{key:"updateWatermark",value:function(e){this.singleWatermark&&this.singleWatermark.update(e)}},{key:"removeWatermark",value:function(){this.singleWatermark&&this.singleWatermark.remove()}},{key:"getVideoInfo",value:function(){var e=null;return this.video&&(e=this.video.getVideoInfo()),e}},{key:"getAudioInfo",value:function(){var e=null;return this.audio&&(e=this.audio.getAudioInfo()),e}},{key:"getVideoPlaybackQuality",value:function(){var e=null;return this.video&&(e=this.video.getPlaybackQuality()),e}},{key:"emitError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.emit(xt.error,e,t),this.emit(e,t)}},{key:"updateHistoryFpsList",value:function(e,t){this.playbackPause||(this._historyFpsList.length>this._opt.heartTimeout&&(this._historyFpsList.shift(),this._historyVideoDiffList.shift()),this._historyFpsList.push(e),this._historyVideoDiffList.push(t),this.isHistoryFpsListAllZero()&&this.checkHeartTimeout$2())}},{key:"isHistoryFpsListAllZero",value:function(){var e=!0;if(this._historyFpsList.length0){e=!1;break}if(e)for(var i=0;i0){e=!1;break}return e}},{key:"isUseHls265",value:function(){return Oo(this._opt.isHls)&&Oo(this._opt.supportHls265)}},{key:"isHls",value:function(){return Oo(this._opt.isHls)}},{key:"isOldHls",value:function(){return Oo(this._opt.isHls)&&No(this._opt.supportHls265)}},{key:"isWebrtcNotH265",value:function(){return Oo(this._opt.isWebrtc)&&No(this._opt.isWebrtcH265)}},{key:"isWebrtcH264",value:function(){return Oo(this._opt.isWebrtc)&&No(this._opt.isWebrtcH265)}},{key:"isWebrtcH265",value:function(){return Oo(this._opt.isWebrtc)&&Oo(this._opt.isWebrtcH265)}},{key:"isAliyunRtc",value:function(){return Oo(this._opt.isAliyunRtc)}},{key:"isUseHls265UseMse",value:function(){return this.isUseHls265()&&this.isUseMSE()}},{key:"isStreamWebTransport",value:function(){return this.getStreamType()===F}},{key:"isPlaybackCacheBeforeDecodeForFpsRender",value:function(){return this.isPlayback()&&Oo(this._opt.playbackConfig.isCacheBeforeDecodeForFpsRender)&&Oo(this._opt.useWCS)}},{key:"isPlaybackUseWCS",value:function(){return this.isPlayback()&&Oo(this._opt.useWCS)}},{key:"isPlaybackUseMSE",value:function(){return this.isPlayback()&&Oo(this._opt.useMSE)}},{key:"isPlayUseMSE",value:function(){return this.isPlayer()&&Oo(this._opt.useMSE)}},{key:"isInWebFullscreen",value:function(){return this._opt.useWebFullScreen&&On()&&this.fullscreen}},{key:"getPlaybackRate",value:function(){var e=1;return Oo(this.isPlayback())&&this.playback&&(e=this.playback.rate),e}},{key:"isPlaybackOnlyDecodeIFrame",value:function(){return Oo(this.isPlayback())&&this.getPlaybackRate()>=this._opt.playbackForwardMaxRateDecodeIFrame}},{key:"pushTempStream",value:function(e){var t=new Uint8Array(e);this._tempStreamList.push(t)}},{key:"updateLoadingText",value:function(e){this.loading&&this.control&&this.control.updateLoadingText(e)}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.video&&(this._opt.useMSE?this.mseDecoder?e=this.mseDecoder.getVideoCurrentTime():this.isMseDecoderUseWorker()&&(e=this.video.getVideoCurrentTime()):this.isWebrtcH264()&&this.webrtc?e=this.webrtc.getVideoCurrentTime():this.isAliyunRtc()&&this.aliyunRtcDecoder&&(e=this.aliyunRtcDecoder.getVideoCurrentTime())),e}},{key:"addMemoryLog",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r0){var r=i/1e3;this._flvMetaDataFps=r}}ao(t.hasAudio)&&No(t.hasAudio)&&(this.debug.log("updateMetaData","hasAudio",t.hasAudio,"and update _opt.hasAudio"),this._opt.hasAudio=t.hasAudio),ao(t.hasVideo)&&No(t.hasVideo)&&(this.debug.log("updateMetaData","hasVideo",t.hasVideo,"and update _opt.hasVideo"),this._opt.hasVideo=t.hasVideo)}this.emit(xt.flvMetaData,e)}},{key:"getMetaData",value:function(){return this._flvMetaData}},{key:"getExtendBtnList",value:function(){return this.control.getExtendBtnList().map((function(e){return{name:e.name,$container:e.$iconContainer,$btn:e.$iconWrap,$activeBtn:e.$activeIconWrap}}))}},{key:"getCpuLevel",value:function(){var e=null;return this.pressureObserverCpu&&(e=this.pressureObserverCpu.getCurrentCpuState()),e}},{key:"isRecordTypeFlv",value:function(){return this.recorder&&this._opt.recordType===V}},{key:"isRecordTypeMp4",value:function(){return this.recorder&&this._opt.recordType===H}},{key:"isRecordTypeWebm",value:function(){return this.recorder&&this._opt.recordType===W}},{key:"isDemuxInWorker",value:function(){return this._opt.useWasm||this._opt.demuxUseWorker}},{key:"isUseMSE",value:function(){return Oo(this._opt.useMSE)}},{key:"isUseWCS",value:function(){return Oo(this._opt.useWCS)}},{key:"isUseWASM",value:function(){return Oo(this._opt.useWasm)}},{key:"isMseDecoderUseWorker",value:function(){return this.isUseMSE()&&Oo(this._opt.mseDecoderUseWorker)}},{key:"getAudioSyncVideoDiff",value:function(){return this.audioTimestamp-this.getRenderCurrentPts()}},{key:"getMseVideoBufferDelayTime",value:function(){var e=0;return this._opt.useMSE&&this.mseDecoder&&(this.mseDecoder?e=this.mseDecoder.getVideoBufferDelayTime():this.isMseDecoderUseWorker()&&(e=this.video.getVideoBufferDelayTime()),e=parseInt(1e3*e,10)),e}},{key:"updateCurrentPts",value:function(e){this.updateStats({currentPts:e}),this.emit(xt.currentPts,e)}},{key:"getRenderCurrentPts",value:function(){var e=0;return e=this._stats.currentPts?this._stats.currentPts:this.videoTimestamp-this.getMseVideoBufferDelayTime(),e}},{key:"openSyncAudioAndVideo",value:function(){return this._opt.syncAudioAndVideo&&this._opt.hasVideo}},{key:"showTipsMessageByCode",value:function(e){if(this.control){var t=this._opt.showMessageConfig[e]||"未知异常";this.control.showTipsMessage(t,e)}}},{key:"showTipsMessageByContent",value:function(e){this.control&&e&&this.control.showTipsMessage(e)}},{key:"hideTipsMessage",value:function(){this.control&&this.control.hideTipsMessage()}},{key:"decoderCheckFirstIFrame",value:function(){Oo(this._opt.checkFirstIFrame)&&(this.mseDecoder?this.mseDecoder.isDecodeFirstIIframe=!1:this.webcodecsDecoder&&(this.webcodecsDecoder.isDecodeFirstIIframe=!1))}},{key:"isHlsCanVideoPlay",value:function(){return this._canPlayAppleMpegurl&&this.isOldHls()}},{key:"setPtzPosition",value:function(e){this.control&&this.control.updatePtzPosition(e)}},{key:"setPlayFailedAndPaused",value:function(){this.isPlayFailedAndPaused=!0}},{key:"getMseMineType",value:function(){var e={};return this.mseDecoder&&(e=this.mseDecoder.getMimeType()),e}},{key:"getMaxDelayTs",value:function(){return this._opt.videoBuffer+this._opt.videoBufferDelay}},{key:"isMseVideoStateInited",value:function(){return!this.video||this.video.getReadyStateInited()}}])}(s),wb=function(){function i(e){S(this,i);var t=e.fromSampleRate,r=e.toSampleRate,a=e.channels,n=e.inputBufferSize;if(!t||!r||!a)throw new Error("Invalid settings specified for the resampler.");this.resampler=null,this.fromSampleRate=t,this.toSampleRate=r,this.channels=a||0,this.inputBufferSize=n,this.initialize()}return T(i,[{key:"initialize",value:function(){this.fromSampleRate==this.toSampleRate?(this.resampler=function(e){return e},this.ratioWeight=1):(this.fromSampleRate0?u:0)]*n+t[s+(h+u)]*o;a+=r,s=Math.floor(a)*h}for(u=0;u0&&s=l)){for(o=0;o0?o:0)]*n;h+=n,n=0;break}for(o=0;o=0?t=213:(t=85,(e=-e-1)<0&&(e=32767)),i=Tb(e,Sb,8),i>=8?127^t:(r=i<<4,r|=i<2?e>>4&15:e>>i+3&15,r^t)}(e)})),t}function Cb(e){var t=[];return Array.prototype.slice.call(e).forEach((function(e,i){t[i]=function(e){var t=0;e<0?(e=132-e,t=127):(e+=132,t=255);var i=Tb(e,Sb,8);return i>=8?127^t:(i<<4|e>>i+3&15)^t}(e)})),t}var xb=function(e){function t(e){var i;S(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i=_(this,t),i._opt={},e&&(i.player=e),i.TAG_NAME="talk";var a=Bo(ta);return i._opt=Object.assign({},a,r),i._opt.sampleRate=parseInt(i._opt.sampleRate,10),i._opt.sampleBitsWidth=parseInt(i._opt.sampleBitsWidth,10),i.audioContext=null,i.gainNode=null,i.recorder=null,i.workletRecorder=null,i.biquadFilter=null,i.userMediaStream=null,i.clearWorkletUrlTimeout=null,i.bufferSize=512,i._opt.audioBufferLength=i.calcAudioBufferLength(),i.audioBufferList=[],i.socket=null,i.socketStatus=Pt,i.mediaStreamSource=null,i.heartInterval=null,i.checkGetUserMediaTimeout=null,i.wsUrl=null,i.startTimestamp=0,i.sequenceId=0,i.tempTimestamp=null,i.tempG711BufferList=[],i.tempRtpBufferList=[],i.tempPcmBufferList=[],i.events=new Yo(i),i._initTalk(),i.player||(i.debug=new an(i)),i._opt.encType!==ur&&i._opt.encType!==dr||8e3===i._opt.sampleRate&&16===i._opt.sampleBitsWidth||i.warn(i.TAG_NAME,"\n encType is ".concat(i._opt.encType," and sampleBitsWidth is ").concat(i._opt.sampleBitsWidth,", set sampleBitsWidth to ").concat(i._opt.sampleBitsWidth,"。\n ").concat(i._opt.encType," only support sampleRate 8000 and sampleBitsWidth 16")),i.log(i.TAG_NAME,"init",JSON.stringify(i._opt)),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.clearWorkletUrlTimeout&&(clearTimeout(this.clearWorkletUrlTimeout),this.clearWorkletUrlTimeout=null),this.userMediaStream&&(this.userMediaStream.getTracks&&this.userMediaStream.getTracks().forEach((function(e){e.stop()})),this.userMediaStream=null),this.mediaStreamSource&&(this.mediaStreamSource.disconnect(),this.mediaStreamSource=null),this.recorder&&(this.recorder.disconnect(),this.recorder.onaudioprocess=null,this.recorder=null),this.biquadFilter&&(this.biquadFilter.disconnect(),this.biquadFilter=null),this.gainNode&&(this.gainNode.disconnect(),this.gainNode=null),this.workletRecorder&&(this.workletRecorder.disconnect(),this.workletRecorder=null),this.socket&&(this.socketStatus===Bt&&this._sendClose(),this.socket.close(),this.socket=null),this._stopHeartInterval(),this._stopCheckGetUserMediaTimeout(),this.audioContext=null,this.gainNode=null,this.recorder=null,this.audioBufferList=[],this.sequenceId=0,this.wsUrl=null,this.tempTimestamp=null,this.tempRtpBufferList=[],this.tempG711BufferList=[],this.tempPcmBufferList=[],this.startTimestamp=0,this.log(this.TAG_NAME,"destroy")}},{key:"addRtpToBuffer",value:function(e){var t=e.length+this.tempRtpBufferList.length,i=new Uint8Array(t);i.set(this.tempRtpBufferList,0),i.set(e,this.tempRtpBufferList.length),this.tempRtpBufferList=i}},{key:"addG711ToBuffer",value:function(e){var t=e.length+this.tempG711BufferList.length,i=new Uint8Array(t);i.set(this.tempG711BufferList,0),i.set(e,this.tempG711BufferList.length),this.tempG711BufferList=i}},{key:"addPcmToBuffer",value:function(e){var t=e.length+this.tempPcmBufferList.length,i=new Uint8Array(t);i.set(this.tempPcmBufferList,0),i.set(e,this.tempPcmBufferList.length),this.tempG711ButempPcmBufferListfferList=i}},{key:"downloadRtpFile",value:function(){this.debug.log(this.TAG_NAME,"downloadRtpFile");var e=new Blob([this.tempRtpBufferList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+".rtp",t.click(),window.URL.revokeObjectURL(t.href)}catch(e){console.error("downloadRtpFile",e)}}},{key:"downloadG711File",value:function(){this.debug.log(this.TAG_NAME,"downloadG711File");var e=new Blob([this.tempG711BufferList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+"."+this._opt.encType,t.click(),window.URL.revokeObjectURL(t.href)}catch(e){console.error("downloadG711File",e)}}},{key:"downloadPcmFile",value:function(){this.debug.log(this.TAG_NAME,"downloadPcmFile");var e=new Blob([this.tempPcmBufferList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+"."+this._opt.encType,t.click(),window.URL.revokeObjectURL(t.href)}catch(e){console.error("downloadRtpFile",e)}}},{key:"downloadFile",value:function(){this._opt.packetType===qr?this.downloadRtpFile():this._opt.encType===ur||this._opt.encType===dr?this.downloadG711File():this.downloadPcmFile()}},{key:"calcAudioBufferLength",value:function(){var e=this._opt,t=e.sampleRate;e.sampleBitsWidth;return 8*t*.02/8}},{key:"socketStatusOpen",get:function(){return this.socketStatus===Bt}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i1?a-1:0),o=1;o do talk"),e.emit(xt.talkStreamOpen),t(),e._doTalk()})),r(e.socket,Zr,(function(t){e.log(e.TAG_NAME,"websocket message",t.data)})),r(e.socket,Qr,(function(t){e.socketStatus=Mt,e.warn(e.TAG_NAME,"websocket close -> reject",t),e.emit(xt.talkStreamClose),i(t)})),r(e.socket,Xr,(function(t){e.socketStatus=Ut,e.error(e.TAG_NAME,"websocket error -> reject",t),e.emit(xt.talkStreamError,t),i(t)}))}))}},{key:"_sendClose",value:function(){}},{key:"_initTalk",value:function(){this._initMethods(),this._opt.engine===$r?this._initWorklet():this._opt.engine===ea&&this._initScriptProcessor(),this.log(this.TAG_NAME,"audioContext samplerate",this.audioContext.sampleRate)}},{key:"_initMethods",value:function(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:48e3}),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.biquadFilter=this.audioContext.createBiquadFilter(),this.biquadFilter.type="lowpass",this.biquadFilter.frequency.value=3e3,this.resampler=new wb({fromSampleRate:this.audioContext.sampleRate,toSampleRate:this._opt.sampleRate,channels:this._opt.numberChannels,inputBufferSize:this.bufferSize})}},{key:"_initScriptProcessor",value:function(){var e=this,t=this.audioContext.createScriptProcessor||this.audioContext.createJavaScriptNode;this.recorder=t.apply(this.audioContext,[this.bufferSize,this._opt.numberChannels,this._opt.numberChannels]),this.recorder.onaudioprocess=function(t){return e._onaudioprocess(t)}}},{key:"_initWorklet",value:function(){var e=this,t=Co((function(){var e=function(e){function t(e){var i;return S(this,t),i=_(this,t),i._cursor=0,i._bufferSize=e.processorOptions.bufferSize,i._buffer=new Float32Array(i._bufferSize),i}return k(t,e),T(t,[{key:"process",value:function(e,t,i){if(!e.length||!e[0].length)return!0;for(var r=0;r>8,t[s++]=255&l>>0}t[s++]=128,t[s++]=128+i,t[s++]=r/256,t[s++]=r%256,t[s++]=a/65536/256,t[s++]=a/65536%256,t[s++]=a%65536/256,t[s++]=a%65536%256,t[s++]=n/65536/256,t[s++]=n/65536%256,t[s++]=n%65536/256,t[s++]=n%65536%256;for(var c=t.concat(g(e)),u=new Uint8Array(c.length),d=0;d\n \n \n ').concat(g.watermark_txt,'\n \n \n ').concat(g.watermark_txt,'\n \n \n \n \n '),k=window.btoa(unescape(encodeURIComponent(_))),w=document.createElement("div");w.style.position="absolute",w.style.left="0px",w.style.top="0px",w.style.overflow="hidden",w.style.zIndex="9999999",w.style.width=s+"px",w.style.height=l+"px",w.style.display="block",w.style["-ms-user-select"]="none",w.style.backgroundImage="url(data:image/svg+xml;base64,".concat(k,")"),h.appendChild(w)}},{key:"_removeMark",value:function(){var e=this.defaultSettings,t=document.getElementById(e.watermark_id);if(t){var i=t.parentNode;i&&i.removeChild(t)}}},{key:"_calcTextSize",value:function(){var e=this.globalSetting,t=e.watermark_txt,i=e.watermark_font,r=e.watermark_fontsize,a=document.createElement("span");a.innerHTML=t,a.setAttribute("style","font-family: ".concat(i,"; font-size: ").concat(r,"px; visibility: hidden; display: inline-block")),document.querySelector("body").appendChild(a);var n={width:a.offsetWidth,height:a.offsetHeight};return a.remove(),n}}])}(),Lb="right",Ib="left",Pb="up",Bb="down",Mb="leftUp",Ub="leftDown",Fb="rightUp",Ob="rightDown",Nb="zoomExpand",jb="zoomNarrow",Gb="apertureFar",zb="apertureNear",Hb="focusFar",Wb="focusNear",Vb="setPos",Jb="calPos",qb="delPos",Kb="wiperOpen",Yb="wiperClose",Qb="cruiseStart",Xb={stop:0,fiStop:0,right:1,left:2,up:8,down:4,leftUp:10,leftDown:6,rightUp:9,rightDown:5,zoomExpand:16,zoomNarrow:32,apertureFar:72,apertureNear:68,focusFar:66,focusNear:65,setPos:129,calPos:130,delPos:131,wiperOpen:140,wiperClose:141,setCruise:132,decCruise:133,cruiseStart:136,cruiseStop:0},Zb=[25,50,75,100,125,150,175,200,225,250],$b=[1,2,3,4,5,6,7,8,9,16],e_=[16,48,80,112,144,160,176,192,208,224];function t_(e){var t,i,r,a,n=e.type,o=e.speed,s=void 0===o?5:o,l=e.index,c=void 0===l?0:l,u=function(e){return Zb[(e=e||5)-1]||Zb[4]}(s);if(t=Xb[n],!t)return"";switch(n){case Pb:case Bb:case Gb:case zb:r=u;break;case Lb:case Ib:case Hb:case Wb:i=u;break;case Mb:case Ub:case Fb:case Ob:i=u,r=u;break;case Nb:case jb:a=function(e){return e_[(e=e||5)-1]||e_[4]}(s);break;case Jb:case qb:case Vb:r=i_(c);break;case Yb:case Kb:i=1;break;case Qb:i=i_(c)}return function(e,t,i,r){var a=[];return a[0]=165,a[1]=15,a[2]=1,a[3]=0,a[4]=0,a[5]=0,a[6]=0,e&&(a[3]=e),t&&(a[4]=t),i&&(a[5]=i),r&&(a[6]=r),a[7]=(a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6])%256,function(e){for(var t="",i=0;it)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i===t?r[n]=a_(e[n]):"object"==E(e[n])?r[n]=n_(e[n],t,i+1):r[n]=e[n]);return r}}function o_(){return(new Date).toLocaleString()}var s_=function(){function e(t){S(this,e);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=t,this.TAG_NAME="MemoryLogger",this.logMaxSize=(null==i?void 0:i.logMaxSize)||204800,this.logSize=0,this.logTextArray=[],this.player.debug.log(this.TAG_NAME,"init")}return T(e,[{key:"destroy",value:function(){this.clear(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"clear",value:function(){this.logSize=0,this.logTextArray=[]}},{key:"logCache",value:function(){var e="";try{for(var t=arguments.length,i=new Array(t),r=0;rthis.logMaxSize){var n=this.logTextArray.shift();this.logSize-=n.length}}},{key:"getLog",value:function(){return this.logTextArray.join("\n")}},{key:"getLogBlob",value:function(){var e=this.getLog();return new Blob([e],{type:"text/plain"})}},{key:"download",value:function(){var e=this.getLog();this.clear();var t=new Blob([e],{type:"text/plain"});hs(t,"JbPro-"+o_()+".log")}}])}(),l_=function(e){function t(e){var i;return S(this,t),i=_(this,t),i.player=e,i.TAG_NAME="Network",i.online=i.isOnline(),i.prevOnline=i.online,i.interval=null,i._initListener(),i.player.debug.log(i.TAG_NAME,"init"),i}return k(t,e),T(t,[{key:"destroy",value:function(){this.off(),this._stopCheck(),window.removeEventListener("online",this._updateOnlineStatus),window.removeEventListener("offline",this._updateOfflineStatus),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_initListener",value:function(){window.addEventListener("online",this._updateOnlineStatus.bind(this)),window.addEventListener("offline",this._updateOfflineStatus.bind(this))}},{key:"_stopCheck",value:function(){this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"_startCheck",value:function(){var e=this;this.interval=setInterval((function(){e.isOnline()!==e.prevOnline&&(e.isOnline()?e._updateOnlineStatus():e._updateOfflineStatus())}),1e3)}},{key:"_updateOnlineStatus",value:function(){this.prevOnline=this.online,this.online=!0,this.logStatus(),this.emit("online")}},{key:"_updateOfflineStatus",value:function(){this.prevOnline=this.online,this.online=!1,this.logStatus(),this.emit("offline")}},{key:"logStatus",value:function(){var e=this.prevOnline?"online":"offline",t=this.online?"online":"offline";this.player.debug.log(this.TAG_NAME,"prevOnline: ".concat(this.prevOnline,", online: ").concat(this.online,", status: ").concat(e," -> ").concat(t))}},{key:"isOnline",value:function(){return void 0===navigator.onLine||navigator.onLine}},{key:"isOffline",value:function(){return!this.isOnline()}}])}(s),c_=function(t){function i(){var e;S(this,i);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=_(this,i),e._opt={},e.TAG_NAME="JbPro",e.$container=null,Object.keys(t).forEach((function(e){if(void 0===t[e])throw new Error('JbPro option "'.concat(e,'" can not be undefined'))})),e.originalOptions=t;var r=Mo(),a=Object.assign({},r,t);a.url="",a.isMulti&&(a.debugUuid="xxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))),e.debug=new an(e),e.debug.log("JbPro","init");var n=t.container;if("string"==typeof t.container&&(n=document.querySelector(t.container)),!n)throw e.debug.error("JbPro","JbPro need container option and now container is",t.container),new Error("JbPro need container option");if(a.decoder&&No(-1!==a.decoder.indexOf("decoder-pro.js")||-1!==a.decoder.indexOf("decoder-pro-simd.js")))throw e.debug.error("JbPro","JbPro decoder ".concat(a.decoder," must be decoder-pro.js or decoder-pro-simd.js")),new Error("JbPro decoder ".concat(a.decoder," must be decoder-pro.js or decoder-pro-simd.js"));if("CANVAS"===n.nodeName||"VIDEO"===n.nodeName)throw e.debug.error("JbPro","JbPro container type can not be ".concat(n.nodeName," type")),new Error("JbPro container type can not be ".concat(n.nodeName," type"));if(a.videoBuffer>=a.heartTimeout)throw e.debug.error("JbPro","JbPro videoBuffer ".concat(a.videoBuffer,"s must be less than heartTimeout ").concat(a.heartTimeout,"s")),new Error("JbPro videoBuffer ".concat(a.videoBuffer,"s must be less than heartTimeout ").concat(a.heartTimeout,"s"));if(e._checkHasCreated(n))throw e.debug.error("JbPro","JbPro container has been created and can not be created again",n),new Error("JbPro container has been created and can not be created again",n);if(!n.classList)throw e.debug.error(e.TAG_NAME,"JbPro container is invalid, must be a DOM Element",n),new Error("JbPro container is invalid, must be a DOM Element",n);if(a.videoBuffer>10&&console.warn("JbPro","videoBuffer ".concat(a.videoBuffer,"s is too long, will black screen for ").concat(a.videoBuffer,"s , it is recommended to set it to less than 10s")),n.classList.add("jb-pro-container"),jo(n,_e,Kn()),No(a.isLive)){var o=document.createElement("video");return u(e,(o.muted=!0,o.setAttribute("controlsList","nodownload"),o.disablePictureInPicture="disablePictureInPicture",o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.height="100%",o.style.width="100%",n.appendChild(o),e.$videoElement=o,e.$container=n,void(e._opt=a)))}if(delete a.container,no(a.videoBuffer)&&(a.videoBuffer=1e3*Number(a.videoBuffer)),no(a.videoBufferDelay)&&(a.videoBufferDelay=1e3*Number(a.videoBufferDelay)),no(a.networkDelay)&&(a.networkDelay=1e3*Number(a.networkDelay)),no(a.aiFaceDetectInterval)&&(a.aiFaceDetectInterval=1e3*Number(a.aiFaceDetectInterval)),no(a.aiObjectDetectInterval)&&(a.aiObjectDetectInterval=1e3*Number(a.aiObjectDetectInterval)),no(a.timeout)&&(ro(a.loadingTimeout)&&(a.loadingTimeout=a.timeout),ro(a.heartTimeout)&&(a.heartTimeout=a.timeout)),no(a.autoWasm)&&(ro(a.decoderErrorAutoWasm)&&(a.decoderErrorAutoWasm=a.autoWasm),ro(a.hardDecodingNotSupportAutoWasm)&&(a.hardDecodingNotSupportAutoWasm=a.autoWasm)),no(a.aiFaceDetectLevel)&&ro(a.aiFaceDetectWidth)){var s=La[a.aiFaceDetectLevel];s&&(a.aiFaceDetectWidth=s)}if(no(a.aiObjectDetectLevel)&&ro(a.aiObjectDetectWidth)){var l=Ia[a.aiObjectDetectLevel];l&&(a.aiObjectDetectWidth=l)}return Oo(a.isCrypto)&&(a.isM7sCrypto=!0),e._opt=a,e._destroyed=!1,e.$container=n,e._tempPlayBgObj={},e._tempVideoLastIframeInfo={},e._tempPlayerIsMute=!0,e._loadingTimeoutReplayTimes=0,e._heartTimeoutReplayTimes=0,e._streamErrorReplayTimes=0,e._streamEndReplayTimes=0,e._websocket1006ErrorReplayTimes=0,e.events=new Yo(e),e._opt.isUseNewFullscreenWatermark?e.watermark=new Db(e):e.watermark=new Rb(e),e.memoryLogger=new s_(e),e.network=new l_(e),e._websocket1006ErrorRetryLog=[],e._mseDecodeErrorRetryLog=[],e._wcsDecodeErrorRetryLog=[],e._isNetworkOfflinePaused=!1,e._isNetworkOfflinePausedAndNextPlayConfig={},e.widthOrHeightChangeReplayDelayTimeout=null,e.streamErrorReplayDelayTimeout=null,e.streamEndReplayDelayTimeout=null,e.$loadingBgImage=null,e.$loadingBg=null,e._initPlayer(n,a),e._initWatermark(),e._initNetwork(),e.debug.log("JbPro",'init success and version is "4-1-2024"'),console.log('JbPro Version is "4-1-2024"'),e}return k(i,t),T(i,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){e.debug.log("JbPro","destroy()"),e._destroyed=!0,e.off(),e._removeTimeout(),e.$videoElement&&(e.$videoElement.pause(),e.$videoElement.currentTime=0,e.$videoElement.srcObject&&(e.$videoElement.srcObject=null,e.$videoElement.removeAttribute("srcObject")),e.$videoElement.src&&(e.$videoElement.src="",e.$videoElement.removeAttribute("src")),e.$container&&e.$container.removeChild(e.$videoElement),e.$videoElement=null),e._removeLoadingBackgroundForIOS(),e.player?e.player.destroy().then((function(){e.player=null,e._destroy(),t()})).catch((function(){i()})):(e._destroy(),t())}))}},{key:"_removeTimeout",value:function(){this.widthOrHeightChangeReplayDelayTimeout&&(clearTimeout(this.widthOrHeightChangeReplayDelayTimeout),this.widthOrHeightChangeReplayDelayTimeout=null),this.streamErrorReplayDelayTimeout&&(clearTimeout(this.streamErrorReplayDelayTimeout),this.streamErrorReplayDelayTimeout=null),this.streamEndReplayDelayTimeout&&(clearTimeout(this.streamEndReplayDelayTimeout),this.streamEndReplayDelayTimeout=null)}},{key:"_destroy",value:function(){var e,t;this.events&&(this.events.destroy(),this.events=null),this.talk&&(this.talk.destroy(),this.talk=null),this.watermark&&(this.watermark.destroy(),this.watermark=null),this.network&&(this.network.destroy(),this.network=null),this.memoryLogger&&(this.memoryLogger.destroy(),this.memoryLogger=null),this.$container&&(this.$container.classList.remove("jb-pro-container"),this.$container.classList.remove("jb-pro-fullscreen-web"),e=this.$container,t=_e,e&&(e.dataset?delete e.dataset[t]:e.removeAttribute("data-"+t)),this.$container=null),this._tempPlayBgObj=null,this._tempVideoLastIframeInfo=null,this._isNetworkOfflinePaused=!1,this._isNetworkOfflinePausedAndNextPlayConfig={},this._tempPlayerIsMute=!0,this._resetReplayTimes(),this.debug&&this.debug.log("JbPro","destroy end"),this._opt=null,this.debug=null}},{key:"_resetReplayTimes",value:function(){this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0,this._streamErrorReplayTimes=0,this._streamEndReplayTimes=0,this._websocket1006ErrorReplayTimes=0,this._websocket1006ErrorRetryLog=[],this._mseDecodeErrorRetryLog=[],this._wcsDecodeErrorRetryLog=[]}},{key:"_getOriginalOpt",value:function(){var e=Mo();return Object.assign({},e,this.originalOptions)}},{key:"_initPlayer",value:function(e,t){this.player=new kb(e,t),this._bindEvents()}},{key:"_initTalk",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.talk&&(this.talk.destroy(),this.talk=null),this.player&&(e.debug=this.player._opt.debug),this.talk=new xb(this.player,e),this.debug.log("JbPro","_initTalk",this.talk.getOption()),this._bindTalkEvents()}},{key:"_resetPlayer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(i,r){e.debug.log(e.TAG_NAME,"_resetPlayer()",JSON.stringify(t));var a=function(){e._opt.url="",e._opt.playOptions={},e._opt=Object.assign(e._opt,t),e._initPlayer(e.$container,e._opt)};e.player?e.player.destroy().then((function(){e.player=null,a(),e.debug.log(e.TAG_NAME,"_resetPlayer() end"),i()})).catch((function(){r()})):(a(),e.debug.log(e.TAG_NAME,"_resetPlayer() end"),i())}))}},{key:"_bindEvents",value:function(){var e=this,t=this;Object.keys(Rt).forEach((function(i){e.player.on(Rt[i],(function(){for(var e=arguments.length,r=new Array(e),a=0;a0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,r){e.debug.log("JbPro","pause() ".concat(t)),(e._opt.pauseAndNextPlayUseLastFrameShow||e._opt.replayUseLastFrameShow)&&(e._tempPlayBgObj=e._getVideoLastIframeInfo()),e._tempPlayerIsMute=e.isMute(),e._pause(t).then((function(e){i(e)})).catch((function(e){r(e)}))}))}},{key:"_pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,r){if(e.debug.log("JbPro","_pause() ".concat(t)),e.isDestroyed())return r("JbPro is destroyed");e._resetReplayTimes(),e.player?e.player.pause(t).then((function(e){i(e)})).catch((function(e){r(e)})):r("player is null")}))}},{key:"close",value:function(){var e=this;return new Promise((function(t,i){e.debug.log("JbPro","close()"),e._opt.url="",e._resetReplayTimes(),e.player?e.player.close().then((function(){t()})).catch((function(e){i(e)})):i("player is null")}))}},{key:"clearView",value:function(){this.debug.log("JbPro","clearView()"),this.player&&this.player.video?this.getRenderType()===he?this.player.video.clearView():this.debug.warn("JbPro","clearView","render type is video, not support clearView, please use canvas render type"):this.debug.warn("JbPro","clearView","player is null")}},{key:"play",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){if(e.debug.log("JbPro","play() ".concat(t),JSON.stringify(i)),!t&&!e._opt.url)return e.emit(xt.error,It.playError),void a("url is null and this._opt.url is null");if(t&&(t=(""+t).trim(),-1===t.indexOf("http:")&&-1===t.indexOf("https:")&&-1===t.indexOf("webrtc:")&&-1===t.indexOf("ws:")&&-1===t.indexOf("wss:")&&-1===t.indexOf("wt:")&&-1===t.indexOf("artc:")))return a("url ".concat(t,' must be "http:" or "https:" or "webrtc:" or "ws:" or "wss:" or "wt:" or "artc:" protocol'));if(No(e._opt.isLive))return e.$videoElement.controls="controls",e.$videoElement.muted=!1,e.$videoElement.src=t,e.$videoElement.play(),void r(e.$videoElement);if(e._opt.isM7sCrypto){var n=i.cryptoKey||e._opt.playOptions.cryptoKey,o=i.cryptoIV||e._opt.playOptions.cryptoIV;if(e._opt.m7sCryptoKey&&(!n||!o)){var s=e._opt.m7sCryptoKey.split(".");n=Io(s[0]),o=Io(s[1])}if(!n||!o){var l=t||e._opt.url;return void e._cryptoPlay(l).then((function(n){var o=n.cryptoIV,s=n.cryptoKey;e._opt.playOptions.cryptoKey=s,e._opt.playOptions.cryptoIV=o,i.cryptoIV=o,i.cryptoKey=s,e._playBefore(t,i).then((function(){r()})).catch((function(e){a(e)}))})).catch((function(e){a(e)}))}e._opt.playOptions.cryptoKey=n,e._opt.playOptions.cryptoIV=o,i.cryptoIV=o,i.cryptoKey=n}else if(e._opt.isXorCrypto){var c=i.cryptoKey||e._opt.playOptions.cryptoKey,u=i.cryptoIV||e._opt.playOptions.cryptoIV;if(e._opt.xorCryptoKey&&(!c||!u)){var d=e._opt.xorCryptoKey.split(".");c=Io(d[0]),u=Io(d[1])}c&&u&&(e._opt.playOptions.cryptoKey=c,e._opt.playOptions.cryptoIV=u,i.cryptoIV=u,i.cryptoKey=c)}e._playBefore(t,i).then((function(){r()})).catch((function(e){a(e)}))}))}},{key:"_playBefore",value:function(e,t){var i=this;return new Promise((function(r,a){if(i.player)if(e)if(i._opt.url)if(e===i._opt.url)if(i.player.playing)i.debug.log("JbPro","_playBefore","playing and resolve()"),r();else{i.debug.log("JbPro","_playBefore","this._opt.url === url and pause -> play and destroy play");var n=i._getOriginalOpt();(i._opt.pauseAndNextPlayUseLastFrameShow||i._opt.replayUseLastFrameShow)&&i._tempPlayBgObj&&i._tempPlayBgObj.loadingBackground&&(n=Object.assign(n,i._tempPlayBgObj)),No(i._tempPlayerIsMute)&&(n.isNotMute=!0,i._tempPlayerIsMute=!0);var o=i._opt.url,s=i._opt.playOptions;i._resetPlayer(n).then((function(){i._play(o,s).then((function(){r()})).catch((function(e){i.debug.error("JbPro","_playBefore this.player.play error",e),i.emit(xt.crashLog,i.getCrashLog("this.player.play 1",e)),a(e)}))})).catch((function(e){i.debug.error("JbPro","_resetPlayer error",e)}))}else{i.debug.log("JbPro","_playBefore","\n this._url.url is ".concat(i._opt.url,"\n and new url is ").concat(e,"\n and destroy and play new url"));var l=i._getOriginalOpt();i._resetPlayer(l).then((function(){i._play(e,t).then((function(){r()})).catch((function(e){i.debug.error("JbPro","_playBefore _play error",e),i.emit(xt.crashLog,i.getCrashLog("this.player.play 2",e)),a(e)}))})).catch((function(e){i.debug.error("JbPro","_resetPlayer error",e)}))}else i._play(e,t).then((function(){r()})).catch((function(e){i.debug.error("JbPro","_playBefore _play error",e),i.emit(xt.crashLog,i.getCrashLog("this.player.play 3",e)),a(e)}));else{var c=i._getOriginalOpt();(i._opt.pauseAndNextPlayUseLastFrameShow||i._opt.replayUseLastFrameShow)&&i._tempPlayBgObj&&i._tempPlayBgObj.loadingBackground&&(c=Object.assign(c,i._tempPlayBgObj)),No(i._tempPlayerIsMute)&&(c.isNotMute=!0,i._tempPlayerIsMute=!0);var u=i._opt.url,d=i._opt.playOptions;i._resetPlayer(c).then((function(){i._play(u,d).then((function(){r()})).catch((function(e){i.debug.error("JbPro","_playBefore _play error",e),i.emit(xt.crashLog,i.getCrashLog("this.player.play 4",e)),a(e)}))})).catch((function(e){i.debug.error("JbPro","_resetPlayer error",e)}))}else e?i._play(e,t).then((function(){r()})).catch((function(e){i.debug.error("JbPro","_playBefore _play error",e),i.emit(xt.crashLog,i.getCrashLog("this.player.play 5",e)),a(e)})):i._play(i._opt.url,i._opt.playOptions).then((function(){r()})).catch((function(e){i.debug.error("JbPro","_playBefore _play error",e),i.emit(xt.crashLog,i.getCrashLog("this.player.play 6",e)),a(e)}))}))}},{key:"_cryptoPlay",value:function(e){var t=this;return new Promise((function(i,r){var a,n=function(e){var t=(e||document.location.toString()).split("//"),i=t[1].indexOf("/"),r=t[1].substring(i);return-1!=r.indexOf("?")&&(r=r.split("?")[0]),r}(e),o=t._opt.cryptoKeyUrl,s="",l=Po(e);if(o){if(s=o,t._opt.isM7sCrypto&&-1===s.indexOf("/crypto/?stream=")){var c=Po(o);s=c.origin+be+"?stream=".concat(n)}}else o=l.origin+be,s=o+"?stream=".concat(n);t.player.debug.log("JbPro","_cryptoPlay() cryptoKeyUrl: ".concat(s," and opt.cryptoKeyUrl: ").concat(t._opt.cryptoKeyUrl)),(a=s,new Promise((function(e,t){Vl.get(a).then((function(t){e(t)})).catch((function(e){t(e)}))}))).then((function(e){if(e){var t=e.split("."),a=Io(t[0]),n=Io(t[1]);n&&a?i({cryptoIV:n,cryptoKey:a}):r("get cryptoIV or cryptoKey error")}else r("cryptoKeyUrl: getM7SCryptoStreamKey ".concat(s," res is null"))})).catch((function(e){r(e)}))}))}},{key:"playback",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){if(t.debug.log("JbPro","playback() ".concat(e,", options: ").concat(JSON.stringify(i))),No(t._opt.isLive))return a("this._opt.isLive is false, can not playback");var n=Uo(),o=Object.assign({},n.playbackConfig,t._opt.playbackConfig,i);o.isUseFpsRender||o.isCacheBeforeDecodeForFpsRender&&(o.isCacheBeforeDecodeForFpsRender=!1,t.debug.warn("JbPro","playbackConfig.isUseFpsRender is false, isCacheBeforeDecodeForFpsRender can not be ture, isCacheBeforeDecodeForFpsRender is set to false")),0===o.rateConfig.length&&o.showRateBtn&&(o.showRateBtn=!1,t.debug.warn("JbPro","playbackConfig.rateConfig.length is 0, showRateBtn can not be ture, showRateBtn is set to false")),o.controlType,ve.simple,t._resetPlayer({videoBuffer:0,playbackConfig:o,playType:z,openWebglAlignment:!0,useMSE:o.useMSE,useWCS:o.useWCS,useSIMD:!0}).then((function(){t.play(e,i).then((function(){r()})).catch((function(e){a(e)}))})).catch((function(e){a(e)}))}))}},{key:"playbackPause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.debug.log("JbPro","playbackPause() ".concat(t)),this._opt.playType===j?Promise.reject("playType is player, can not call playbackPause method"):new Promise((function(i,r){if(!e.player)return r("player is null");Oo(t)?e._pause().then((function(){i()})).catch((function(e){r(e)})):(e.player.playbackPause=!0,i())}))}},{key:"playbackResume",value:function(){var e=this;return this.debug.log("JbPro","playbackResume()"),this._opt.playType===j?Promise.reject("playType is player, can not call playbackResume method"):new Promise((function(t,i){if(!e.player)return i("player is null");e.player.playbackPause=!1,t()}))}},{key:"forward",value:function(e){var t=this;return this.debug.log("JbPro","forward() ".concat(e)),No(this._opt.isLive)||this._opt.playType===j?Promise.reject("forward() method only just for playback type"):Xn(Number(e))?new Promise((function(i,r){t.player?(e=In(Number(e),.1,32),t.player.decoderWorker&&t.player.decoderWorker.updateWorkConfig({key:"playbackRate",value:e}),t.player.playback.setRate(e),t.player.video&&t.player.video.setRate(e),t.player.audio&&t.player.audio.setRate(e),(t.player.isPlaybackUseWCS()||t.player.isPlaybackUseMSE())&&(t.player.demux.dropBuffer$2(),t.player.isPlaybackCacheBeforeDecodeForFpsRender()&&t.player.demux.initPlaybackCacheLoop()),i()):r("player is not playing")})):Promise.reject('forward() params "rate": '.concat(e," must be number type"))}},{key:"playbackForward",value:function(e){return this.forward(e)}},{key:"normal",value:function(){return this.forward(1)}},{key:"playbackNormal",value:function(){return this.normal()}},{key:"updatePlaybackForwardMaxRateDecodeIFrame",value:function(e){this.debug.log("JbPro","updatePlaybackForwardMaxRateDecodeIFrame() ".concat(e)),e=Number(e),e=In(e=parseInt(e,10),1,8),this._opt.playbackForwardMaxRateDecodeIFrame=e,this.player?this.player.updateOption({playbackForwardMaxRateDecodeIFrame:e},!0):this.debug.warn("JbPro","updatePlaybackForwardMaxRateDecodeIFrame() player is null")}},{key:"setPlaybackStartTime",value:function(e){this.debug.log("JbPro","setPlaybackStartTime() ".concat(e));var t=mo(e);this.player?this.player.isPlayback()?t<10&&0!==e&&this.player.playback.isControlTypeNormal()?this.debug.warn("JbPro","setPlaybackStartTime() control type is normal and timestamp: ".concat(e," is not valid")):this.player.playback.isControlTypeSimple()&&e>this.player.playback.totalDuration?this.debug.warn("JbPro","setPlaybackStartTime() control type is simple and timestamp: ".concat(e," is more than ").concat(this.player.playback.totalDuration)):this.player.playing&&(this.player.playback.isControlTypeNormal()&&10===t&&(e*=1e3),this.player.playback.setStartTime(e),this.playbackClearCacheBuffer()):this.debug.warn("JbPro","setPlaybackStartTime() playType is not playback"):this.debug.warn("JbPro","setPlaybackStartTime() player is null")}},{key:"setPlaybackShowPrecision",value:function(e){this.debug.log("JbPro","setPlaybackShowPrecision() ".concat(e)),this.player?this.player.isPlayback()?this.player.playback.isControlTypeNormal()?this.player.playback.setShowPrecision(e):this.debug.warn("JbPro","control type is not normal , not support!"):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"playbackCurrentTimeScroll",value:function(){this.debug.log("JbPro","playbackCurrentTimeScroll()"),this.player?this.player.isPlayback()?this.player.playback.isControlTypeNormal()?this.player.playback.currentTimeScroll():this.debug.warn("JbPro","control type is not normal , not support!"):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"playbackClearCacheBuffer",value:function(){this.debug.log("JbPro","playbackClearCacheBuffer()"),this.player?this.player.isPlayback()?(this.player.video&&this.player.video.clear(),this.player.audio&&this.player.audio.clear(),this.clearBufferDelay()):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"getPlaybackCurrentRate",value:function(){if(this.player){if(this.player.isPlayback())return this.player.getPlaybackRate();this.debug.warn("JbPro","playType is not playback")}else this.debug.warn("JbPro","player is null")}},{key:"updatePlaybackLocalOneFrameTimestamp",value:function(e){this.debug.log("JbPro","updatePlaybackLocalOneFrameTimestamp() ".concat(e)),this.player?this.player.isPlayback()?this.player.playback.updateLocalOneFrameTimestamp(e):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"setStreamQuality",value:function(e){this.debug.log("JbPro","setStreamQuality() ".concat(e)),this.player?this.player._opt.operateBtns.quality?(this.player._opt.qualityConfig||[]).includes(e)?this.player.streamQuality=e:this.debug.warn("JbPro","quality: ".concat(e," is not in qualityList")):this.debug.warn("JbPro","player._opt.operateBtns.quality is false"):this.debug.warn("JbPro","player is null")}},{key:"_play",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(a,n){if(!t.player)return n("player is null");var o=!1;t._opt.url&&t._opt.url!==i&&(o=!0),t._opt.url=i,t._opt.playOptions=r;var s=i.split("?")[0],u=s.startsWith("http://")||s.startsWith("https://"),d=s.startsWith("webrtc://"),h=s.startsWith("artc://"),p=s.startsWith("wt://"),f=s.startsWith("ws://")||s.startsWith("wss://"),m=u||f,g=u&&s.endsWith(".m3u8"),y=m&&s.endsWith(".flv"),v=m&&(s.endsWith(".fmp4")||s.endsWith(".mp4")),A=m&&s.endsWith(".mpeg4"),b=m&&(s.endsWith(".h264")||s.endsWith(".h265")),_=m&&s.endsWith(".ts"),k=t._opt.isWebrtcForZLM||!1,w=t._opt.isWebrtcForSRS||!1,S=t._opt.isWebrtcForOthers||!1;d&&(-1!==i.indexOf("/index/api/webrtc")?(k=!0,w=!1,S=!1):-1!==i.indexOf("/rtc/v1/play/")&&(w=!0,k=!1,S=!1));var T=null,E=null;if(y&&No(t._opt.isFlv)&&t._resetDemuxType("isFlv"),v&&No(t._opt.isFmp4)&&t._resetDemuxType("isFmp4"),A&&No(t._opt.isMpeg4)&&t._resetDemuxType("isMpeg4"),b&&No(t._opt.isNakedFlow)&&t._resetDemuxType("isNakedFlow"),_&&No(t._opt.isTs)&&t._resetDemuxType("isTs"),u?T=g?x:c:p?T=D:d?T=R:h?T=L:f&&(T=l),t._opt.isNakedFlow?E=X:t._opt.isFmp4?E=Z:t._opt.isMpeg4?E=$:t._opt.isFlv?E=J:t._opt.isTs?E=te:g?E=K:d?E=Y:h?E=ee:p?E=Q:f&&(E=q),!T||!E)return t._opt.playFailedAndPausedShowMessage&&t.showErrorMessageTips("url is not support"),n("play url ".concat(i," is invalid, protocol is ").concat(I[T],", demuxType is ").concat(E));t.debug.log("JbPro","play url ".concat(i," protocol is ").concat(I[T],", demuxType is ").concat(E));var C=function(){t.player.once(It.webglAlignmentError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webglAlignmentError but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.webglAlignmentError,e)),t.player&&t.player._opt.webglAlignmentErrorReplay){t.debug.log("JbPro","webglAlignmentError");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({openWebglAlignment:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webglAlignmentError and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webglAlignmentError,{},e),t.debug.error("JbPro","webglAlignmentError and play error",i)}))})).catch((function(e){t.debug.error("JbPro","webglAlignmentError and _resetPlayer error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.webglAlignmentError,{},e),t.debug.log("JbPro","webglAlignmentError and webglAlignmentErrorReplay is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webglAlignmentError,{},e),t.debug.error("JbPro","webglAlignmentError and pause error",i)}))}})),t.player.once(It.webglContextLostError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webglContextLostError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.webglContextLostError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.webglContextLostErrorReplay){t.debug.log("JbPro","webglContextLostError");var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","webglContextLostError and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.webglContextLostError,i,e),t.debug.error("JbPro","webglContextLostError and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.webglContextLostError,i,e),t.debug.error("JbPro","webglContextLostError and _resetPlayer error",r)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.emit(xt.playFailedAndPaused,It.webglContextLostError,i,e),t.debug.log("JbPro","webglContextLostError and webglContextLostErrorReplay is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.webglContextLostError,i,e),t.debug.error("JbPro","webglAlignmentError and pause error",r)}))}}})),t.player.once(It.mediaSourceH265NotSupport,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceH265NotSupport but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceH265NotSupport,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceH265NotSupport,e),t.debug.error("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceH265NotSupport,{},e),t.debug.error("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] _resetPlayer error",i)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceH265NotSupport,{},e),t.debug.log("JbPro","mediaSourceH265NotSupport and autoWasm is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceH265NotSupport,{},e),t.debug.error("JbPro","mediaSourceH265NotSupport and pause error",i)}))}})),t.player.once(It.mediaSourceFull,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceFull but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceFull,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={},o=t.player._opt.decoderErrorAutoWasm,s=!0;o?n={useMSE:!1,useWCS:!1}:t._checkIsMeaningfulRetry(tn)?t._mseDecodeErrorRetryLog.push(Ln()):(o=!0,s=!1,n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","mediaSourceFull and auto wasm ".concat(No(s)?" and is not meaningful Retry":""," [mse-> ").concat(o?"wasm":"mse","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceFull and reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceFull,i,e),t.debug.error("JbPro","mediaSourceFull and reset player and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceFull,i,e),t.debug.error("JbPro","mediaSourceFull and _resetPlayer error",r)}))}else{var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceFull,i,e),t.debug.log("JbPro","mediaSourceFull and autoWasm is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceFull,i,e),t.debug.error("JbPro","mediaSourceFull and pause error",r)}))}}})),t.player.once(It.mediaSourceAppendBufferError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceAppendBufferError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceAppendBufferError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={},o=t.player._opt.decoderErrorAutoWasm,s=!0;o?n={useMSE:!1,useWCS:!1}:t._checkIsMeaningfulRetry(tn)?t._mseDecodeErrorRetryLog.push(Ln()):(o=!0,s=!1,n={useMSE:!1,useWCS:!1}),t.player.isMSEAudioDecoderError&&(t.player.debug.log("JbPro","mediaSourceAppendBufferError and isMSEAudioDecoderError is true so set mseDecodeAudio = false"),n.mseDecodeAudio=!1),t.debug.log("JbPro","mediaSourceAppendBufferError and auto wasm ".concat(No(s)?" and is not meaningful Retry":""," [mse-> ").concat(o?"wasm":"mse","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceAppendBufferError and reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceAppendBufferError,i,e),t.debug.error("JbPro","mediaSourceAppendBufferError and reset player and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceAppendBufferError,i,e),t.debug.error("JbPro","mediaSourceAppendBufferError and _resetPlayer error",r)}))}else{var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceAppendBufferError,i,e),t.debug.log("JbPro","mediaSourceAppendBufferError and autoWasm is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceAppendBufferError,i,e),t.debug.error("JbPro","mediaSourceAppendBufferError and pause error",r)}))}}})),t.player.once(It.mseSourceBufferError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mseSourceBufferError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mseSourceBufferError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={};if(t.player._opt.mseDecoderUseWorker)n={mseDecoderUseWorker:!1},t.debug.log("JbPro","mseSourceBufferError auto wasm [mse worker -> mse] reset player and play");else{var o=t.player._opt.decoderErrorAutoWasm,s=!0;o?n={useMSE:!1,useWCS:!1}:t._checkIsMeaningfulRetry(tn)?t._mseDecodeErrorRetryLog.push(Ln()):(o=!0,s=!1,n={useMSE:!1,useWCS:!1}),t.player.isMSEVideoDecoderInitializationFailedNotSupportHevc&&(t.debug.log("JbPro","mseSourceBufferError and isMSEVideoDecoderInitializationFailedNotSupportHevc is true so auto wasm"),n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","mseSourceBufferError auto wasm ".concat(No(s)?" and is not meaningful Retry":""," [mse-> ").concat(o?"wasm":"mse","] reset player and play"))}t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mseSourceBufferError reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mseSourceBufferError,i,e),t.debug.error("JbPro","mseSourceBufferError reset player and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mseSourceBufferError,i,e),t.debug.error("JbPro","mseSourceBufferError _resetPlayer and play error",r)}))}else{var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.mseSourceBufferError,i,e),t.debug.log("JbPro","mseSourceBufferError and autoWasm is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mseSourceBufferError,i,e),t.debug.error("JbPro","mseSourceBufferError and pause error:",r)}))}}})),t.player.once(It.mediaSourceBufferedIsZeroError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceBufferedIsZeroError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceBufferedIsZeroError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={},o=t.player._opt.decoderErrorAutoWasm,s=!0;o?n={useMSE:!1,useWCS:!1}:t._checkIsMeaningfulRetry(tn)?t._mseDecodeErrorRetryLog.push(Ln()):(o=!0,s=!1,n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","mediaSourceBufferedIsZeroError auto wasm ".concat(No(s)?" and is not meaningful Retry":""," [mse-> ").concat(o?"wasm":"mse","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceBufferedIsZeroError reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceBufferedIsZeroError,i,e),t.debug.error("JbPro","mediaSourceBufferedIsZeroError reset player and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceBufferedIsZeroError,i,e),t.debug.error("JbPro","mediaSourceBufferedIsZeroError _resetPlayer and play error",r)}))}else{var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceBufferedIsZeroError,i,e),t.debug.log("JbPro","mediaSourceBufferedIsZeroError and autoWasm is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceBufferedIsZeroError,i,e),t.debug.error("JbPro","mediaSourceBufferedIsZeroError and pause error:",r)}))}}})),t.player.once(It.mseAddSourceBufferError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mseAddSourceBufferError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mseAddSourceBufferError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={useMSE:!1,useWCS:!1};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mseAddSourceBufferError,i,e),t.debug.error("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] reset player and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mseAddSourceBufferError,i,e),t.debug.error("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] _resetPlayer and play error",r)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.emit(xt.playFailedAndPaused,It.mseAddSourceBufferError,i,e),t.debug.log("JbPro","mseAddSourceBufferError and autoWasm is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mseAddSourceBufferError,i,e),t.debug.error("JbPro","mseAddSourceBufferError and pause error",r)}))}}})),t.player.once(It.mediaSourceDecoderConfigurationError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceDecoderConfigurationError but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceDecoderConfigurationError,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions,a={useMSE:!1,useWCS:!1};t._resetPlayer(a).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceDecoderConfigurationError,e),t.debug.error("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceDecoderConfigurationError,e),t.debug.error("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] _resetPlayer and play error",i)}))}else{var n=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(n).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceDecoderConfigurationError,e),t.debug.log("JbPro","mediaSourceDecoderConfigurationError and autoWasm is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceDecoderConfigurationError,e),t.debug.error("JbPro","mediaSourceDecoderConfigurationError and pause error",i)}))}})),t.player.once(It.mediaSourceTsIsMaxDiff,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceTsIsMaxDiff but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceTsIsMaxDiff,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mediaSourceTsIsMaxDiffReplay){t.debug.log("JbPro","mediaSourceTsIsMaxDiff reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceTsIsMaxDiff replay success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceTsIsMaxDiff,i,e),t.debug.error("JbPro","mediaSourceTsIsMaxDiff replay error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceTsIsMaxDiff,i,e),t.debug.error("JbPro","mediaSourceTsIsMaxDiff _resetPlayer error",r)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceTsIsMaxDiff,i,e),t.debug.log("JbPro","mediaSourceTsIsMaxDiff and replay is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.mediaSourceTsIsMaxDiff,i,e),t.debug.error("JbPro","mediaSourceTsIsMaxDiff and pause error",r)}))}}})),t.player.once(It.mseWidthOrHeightChange,(function(i){if(t.isDestroyed())t.debug.log("JbPro","mseWidthOrHeightChange but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.mseWidthOrHeightChange,i));var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.widthOrHeightChangeReplay){t.debug.log("JbPro","mseWidthOrHeightChange and reset player and play");var a=t._opt.url,n=t._opt.playOptions,o={};t.player._opt.replayUseLastFrameShow&&(o=Object.assign({},o,r,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(o.isNotMute=!0),t._resetPlayer(o).then((function(){t.player._opt.widthOrHeightChangeReplayDelayTime>0?t.widthOrHeightChangeReplayDelayTimeout=setTimeout((function(){t.isDestroyed()?t.debug.log("JbPro","mseWidthOrHeightChange and widthOrHeightChangeReplayDelayTime but player is destroyed"):t.play(a,n).then((function(){t.debug.log("JbPro","mseWidthOrHeightChange and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mseWidthOrHeightChange,r,i),t.debug.error("JbPro","mseWidthOrHeightChange and reset player and play error",e)}))}),1e3*t.player._opt.widthOrHeightChangeReplayDelayTime):t.play(a,n).then((function(){t.debug.log("JbPro","mseWidthOrHeightChange and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mseWidthOrHeightChange,r,i),t.debug.error("JbPro","mseWidthOrHeightChange and reset player and play error",e)}))})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mseWidthOrHeightChange,r,i),t.debug.error("JbPro","mseWidthOrHeightChange and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(s).then((function(){t.emit(xt.playFailedAndPaused,It.mseWidthOrHeightChange,r,i),t.debug.error("JbPro","mseWidthOrHeightChange and _resetPlayer error",e)})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mseWidthOrHeightChange,r,i),t.debug.error("JbPro","mseWidthOrHeightChange error and pause error",e)}))}}})),t.player.once(It.mediaSourceAudioG711NotSupport,(function(i){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceAudioG711NotSupport but player is destroyed");else{var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mediaSourceAudioG711NotSupportReplay){t.debug.log("JbPro","mediaSourceAudioG711NotSupport and reset player and play");var a=t._opt.url,n=t._opt.playOptions,o={mseDecodeAudio:!1};t.player._opt.replayUseLastFrameShow&&(o=Object.assign({},o,r,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(o.isNotMute=!0),t._resetPlayer(o).then((function(){t.play(a,n).then((function(){t.debug.log("JbPro","mediaSourceAudioG711NotSupport and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioG711NotSupport,r,i),t.debug.error("JbPro","mediaSourceAudioG711NotSupport and reset player and play error",e)}))})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioG711NotSupport,r,i),t.debug.error("JbPro","mediaSourceAudioG711NotSupport and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(s).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioG711NotSupport,r,i),t.debug.error("JbPro","mediaSourceAudioG711NotSupport and _resetPlayer error",e)})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioG711NotSupport,r,i),t.debug.error("JbPro","mediaSourceAudioG711NotSupport error and pause error",e)}))}}})),t.player.once(It.mediaSourceAudioInitTimeout,(function(i){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceAudioInitTimeout but player is destroyed");else{var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mediaSourceAudioInitTimeoutReplay){t.debug.log("JbPro","mediaSourceAudioInitTimeout and reset player and play");var a=t._opt.url,n=t._opt.playOptions,o={mseDecodeAudio:!1};t.player._opt.replayUseLastFrameShow&&(o=Object.assign({},o,r,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(o.isNotMute=!0),t._resetPlayer(o).then((function(){t.play(a,n).then((function(){t.debug.log("JbPro","mediaSourceAudioInitTimeout and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioInitTimeout,r,i),t.debug.error("JbPro","mediaSourceAudioInitTimeout and reset player and play error",e)}))})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioInitTimeout,r,i),t.debug.error("JbPro","mediaSourceAudioInitTimeout and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(s).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioInitTimeout,r),t.debug.error("JbPro","mediaSourceAudioInitTimeout and _resetPlayer error",e)})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioInitTimeout,r),t.debug.error("JbPro","mediaSourceAudioInitTimeout error and pause error",e)}))}}})),t.player.once(It.mediaSourceAudioNoDataTimeout,(function(i){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceAudioNoDataTimeout but player is destroyed");else{var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mediaSourceAudioInitTimeoutReplay){t.debug.log("JbPro","mediaSourceAudioNoDataTimeout and reset player and play");var a=t._opt.url,n=t._opt.playOptions,o={mseDecodeAudio:!1};t.player._opt.replayUseLastFrameShow&&(o=Object.assign({},o,r,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(o.isNotMute=!0),t._resetPlayer(o).then((function(){t.play(a,n).then((function(){t.debug.log("JbPro","mediaSourceAudioNoDataTimeout and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioNoDataTimeout,r,i),t.debug.error("JbPro","mediaSourceAudioNoDataTimeout and reset player and play error",e)}))})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioNoDataTimeout,r,i),t.debug.error("JbPro","mediaSourceAudioNoDataTimeout and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(s).then((function(){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioNoDataTimeout,r),t.debug.error("JbPro","mediaSourceAudioNoDataTimeout and _resetPlayer error",e)})).catch((function(e){t.emit(xt.playFailedAndPaused,It.mediaSourceAudioNoDataTimeout,r),t.debug.error("JbPro","mediaSourceAudioNoDataTimeout error and pause error",e)}))}}})),t.player.once(It.mediaSourceUseCanvasRenderPlayFailed,(function(e){if(t.isDestroyed())t.debug.log("JbPro","mediaSourceUseCanvasRenderPlayFailed but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.mediaSourceUseCanvasRenderPlayFailed,e)),t.player&&t.player._opt.mediaSourceUseCanvasRenderPlayFailedReplay&&t.player._opt.mediaSourceUseCanvasRenderPlayFailedReplayType){t.debug.log("JbPro","mediaSourceUseCanvasRenderPlayFailed relayType is ".concat(t.player._opt.mediaSourceUseCanvasRenderPlayFailedReplayType," and reset player and play"));var i=t._opt.url,r=t._opt.playOptions,a={},n=t.player._opt.mediaSourceUseCanvasRenderPlayFailedReplayType;n===he?a={useMSE:!1,useWCS:!1}:n===pe&&(a={useVideoRender:!0,useCanvasRender:!1}),t._resetPlayer(a).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","mediaSourceUseCanvasRenderPlayFailed and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceUseCanvasRenderPlayFailed,e),t.debug.error("JbPro","mediaSourceUseCanvasRenderPlayFailed and reset player and play error",i)}))})).catch((function(e){t.debug.error("JbPro","mediaSourceUseCanvasRenderPlayFailed auto and _resetPlayer and play error",e)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.debug.log("JbPro","mediaSourceUseCanvasRenderPlayFailed and pause player success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.mediaSourceUseCanvasRenderPlayFailed,e),t.debug.error("JbPro","mediaSourceUseCanvasRenderPlayFailed and pause",i)}))}})),t.player.once(It.webcodecsH265NotSupport,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webcodecsH265NotSupport but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.webcodecsH265NotSupport,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsH265NotSupport,e),t.debug.error("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] reset player and play error",i)}))})).catch((function(e){t.debug.error("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] _resetPlayer and play error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.webcodecsH265NotSupport,e),t.debug.log("JbPro","webcodecsH265NotSupport and autoWasm is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsH265NotSupport,e),t.debug.error("JbPro","webcodecsH265NotSupport and pause error",i)}))}})),t.player.once(It.webcodecsUnsupportedConfigurationError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webcodecsUnsupportedConfigurationError but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.webcodecsUnsupportedConfigurationError,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsUnsupportedConfigurationError,e),t.debug.error("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsUnsupportedConfigurationError,e),t.debug.error("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] _resetPlayer and play error",i)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.webcodecsUnsupportedConfigurationError,e),t.debug.log("JbPro","webcodecsUnsupportedConfigurationError and autoWasm is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsUnsupportedConfigurationError,e),t.debug.error("JbPro","webcodecsUnsupportedConfigurationError and pause error",i)}))}})),t.player.once(It.webcodecsDecodeConfigureError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webcodecsDecodeConfigureError but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.webcodecsDecodeConfigureError,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeConfigureError,e),t.debug.error("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeConfigureError,e),t.debug.error("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] _resetPlayer and play error",i)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeConfigureError,e),t.debug.log("JbPro","webcodecsDecodeConfigureError and autoWasm is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeConfigureError,e),t.debug.error("JbPro","webcodecsDecodeConfigureError and pause error",i)}))}})),t.player.once(It.webcodecsDecodeError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webcodecsDecodeError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.webcodecsDecodeError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.wcsDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={},o=t.player._opt.decoderErrorAutoWasm,s=!0;o?n={useMSE:!1,useWCS:!1}:t._checkIsMeaningfulRetry(rn)?t._wcsDecodeErrorRetryLog.push(Ln()):(o=!0,s=!1,n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","webcodecs decode error autoWasm ".concat(No(s)?" and is not meaningful Retry":""," [wcs-> ").concat(o?"wasm":"wcs","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","webcodecs decode error reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeError,i,e),t.debug.error("JbPro","webcodecs decode error reset player and play error",r)}))})).catch((function(){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeError,i,e),t.debug.error("JbPro","webcodecs decode error _resetPlayer error")}))}else{var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeError,i,e),t.debug.log("JbPro","webcodecs decode error and autoWasm is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.webcodecsDecodeError,i,e),t.debug.error("JbPro","webcodecs decode error and pause error",r)}))}}})),t.player.once(It.wcsWidthOrHeightChange,(function(i){if(t.isDestroyed())t.debug.log("JbPro","wcsWidthOrHeightChange but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.wcsWidthOrHeightChange,i));var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.widthOrHeightChangeReplay){t.debug.log("JbPro","wcsWidthOrHeightChange and reset player and play");var a=t._opt.url,n=t._opt.playOptions,o={};t.player._opt.replayUseLastFrameShow&&(o=Object.assign({},o,r,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(o.isNotMute=!0),t._resetPlayer(o).then((function(){t._opt.widthOrHeightChangeReplayDelayTime>0?t.widthOrHeightChangeReplayDelayTimeout=setTimeout((function(){t.isDestroyed()?t.debug.log("JbPro","wcsWidthOrHeightChange and widthOrHeightChangeReplayDelayTime but player is destroyed"):t.play(a,n).then((function(){t.debug.log("JbPro","wcsWidthOrHeightChange and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wcsWidthOrHeightChange,r,i),t.debug.error("JbPro","wcsWidthOrHeightChange and reset player and play error",e)}))}),1e3*t._opt.widthOrHeightChangeReplayDelayTime):t.play(a,n).then((function(){t.debug.log("JbPro","wcsWidthOrHeightChange and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wcsWidthOrHeightChange,r,i),t.debug.error("JbPro","wcsWidthOrHeightChange and reset player and play error",e)}))})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wcsWidthOrHeightChange,r,i),t.debug.error("JbPro","wcsWidthOrHeightChange and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(s).then((function(){t.emit(xt.playFailedAndPaused,It.wcsWidthOrHeightChange,r,i),t.debug.error("JbPro","wcsWidthOrHeightChange and _resetPlayer error",e)})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wcsWidthOrHeightChange,r,i),t.debug.error("JbPro","wcsWidthOrHeightChange error and pause error",e)}))}}})),t.player.once(It.wasmDecodeError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","wasmDecodeError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.wasmDecodeError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.wasmDecodeErrorReplay){t.debug.log("JbPro","wasm decode error and reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","wasm decode error and reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.wasmDecodeError,i,e),t.debug.error("JbPro","wasm decode error and reset player and play error",r)}))})).catch((function(){t.emit(xt.playFailedAndPaused,It.wasmDecodeError,i,e),t.debug.error("JbPro","wasm decode error and _resetPlayer error")}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.emit(xt.playFailedAndPaused,It.wasmDecodeError,i,e),t.debug.log("JbPro","wasm decode error and wasmDecodeErrorReplay is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.wasmDecodeError,i,e),t.debug.error("JbPro","wasm decode error and pause error",r)}))}}})),t.player.once(It.simdDecodeError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","simdDecodeError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.simdDecodeError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.simdDecodeErrorReplay){t.debug.log("JbPro","simdDecodeError error simdDecodeErrorReplayType is ".concat(t.player._opt.simdDecodeErrorReplayType," and reset player and play"));var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.simdDecodeErrorReplayType===oe&&(n={useSIMD:!1}),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","simdDecodeError and reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.simdDecodeError,i,e),t.debug.error("JbPro","simdDecodeError and reset player and play error",r)}))})).catch((function(r){t.emit(xt.playFailedAndPaused,It.simdDecodeError,i,e),t.debug.error("JbPro","simdDecodeError and _resetPlayer error",r)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.emit(xt.playFailedAndPaused,It.simdDecodeError,i,e),t.debug.error("JbPro","simdDecodeError and simdDecodeErrorReplay is false")})).catch((function(r){t.emit(xt.playFailedAndPaused,It.simdDecodeError,i,e),t.debug.error("JbPro","simdDecodeError error and pause error",r)}))}}})),t.player.once(It.wasmWidthOrHeightChange,(function(i){if(t.isDestroyed())t.debug.log("JbPro","wasmWidthOrHeightChange but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.wasmWidthOrHeightChange,i));var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.widthOrHeightChangeReplay){t.debug.log("JbPro","wasmWidthOrHeightChange and reset player and play");var a=t._opt.url,n=t._opt.playOptions,o={};t.player._opt.replayUseLastFrameShow&&(o=Object.assign({},o,r,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(o.isNotMute=!0),t._resetPlayer(o).then((function(){t._opt.widthOrHeightChangeReplayDelayTime>0?t.widthOrHeightChangeReplayDelayTimeout=setTimeout((function(){t.isDestroyed()?t.debug.log("JbPro","wasmWidthOrHeightChange and widthOrHeightChangeReplayDelayTime but player is destroyed"):t.play(a,n).then((function(){t.debug.log("JbPro","wasmWidthOrHeightChange and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wasmWidthOrHeightChange,r,i),t.debug.error("JbPro","wasmWidthOrHeightChange and reset player and play error",e)}))}),1e3*t._opt.widthOrHeightChangeReplayDelayTime):t.play(a,n).then((function(){t.debug.log("JbPro","wasmWidthOrHeightChange and reset player and play success")})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wasmWidthOrHeightChange,r,i),t.debug.error("JbPro","wasmWidthOrHeightChange and reset player and play error",e)}))})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wasmWidthOrHeightChange,r,i),t.debug.error("JbPro","wasmWidthOrHeightChange and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(s).then((function(){t.emit(xt.playFailedAndPaused,It.wasmWidthOrHeightChange,r,i),t.debug.error("JbPro","wasmWidthOrHeightChange and _resetPlayer error",e)})).catch((function(e){t.emit(xt.playFailedAndPaused,It.wasmWidthOrHeightChange,r),t.debug.error("JbPro","wasmWidthOrHeightChange error and pause error",e)}))}}})),t.player.once(It.wasmUseVideoRenderError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","wasmUseVideoRenderError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.wasmUseVideoRenderError,e)),t.debug.log("JbPro","wasmUseVideoRenderError and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useVideoRender:!1,useCanvasRender:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","wasmUseVideoRenderError and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.wasmUseVideoRenderError,{},e),t.debug.error("JbPro","wasmUseVideoRenderError and reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.wasmUseVideoRenderError,{},e),t.debug.error("JbPro","wasmUseVideoRenderError and _resetPlayer error",i)}))}})),t.player.once(It.videoElementPlayingFailed,(function(e){if(t.isDestroyed())t.debug.log("JbPro","videoElementPlayingFailed but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.videoElementPlayingFailed,e)),t.player&&t.player._opt.videoElementPlayingFailedReplay){t.debug.log("JbPro","videoElementPlayingFailed and useMSE is ".concat(t._opt.useMSE," and reset player and play"));var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useVideoRender:!1,useCanvasRender:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","videoElementPlayingFailed and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.videoElementPlayingFailed,{},e),t.debug.error("JbPro","videoElementPlayingFailed and reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.videoElementPlayingFailed,{},e),t.debug.error("JbPro","videoElementPlayingFailed and _resetPlayer error",i)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.videoElementPlayingFailed,{},e),t.debug.error("JbPro","videoElementPlayingFailed and videoElementPlayingFailedReplay is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.videoElementPlayingFailed,{},e),t.debug.error("JbPro","videoElementPlayingFailed and _pause error",i)}))}})),t.player.once(It.simdH264DecodeVideoWidthIsTooLarge,(function(e){if(t.isDestroyed())t.debug.log("JbPro","simdH264DecodeVideoWidthIsTooLarge but player is destroyed");else if(t.emit(xt.crashLog,t.getCrashLog(It.simdH264DecodeVideoWidthIsTooLarge,e)),t.player&&t.player._opt.simdH264DecodeVideoWidthIsTooLargeReplay){t.debug.log("JbPro","simdH264DecodeVideoWidthIsTooLarge and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useSIMD:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","simdH264DecodeVideoWidthIsTooLarge and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.simdH264DecodeVideoWidthIsTooLarge,{},e),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and reset player and play error",i)}))})).catch((function(i){t.emit(xt.playFailedAndPaused,It.simdH264DecodeVideoWidthIsTooLarge,{},e),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and _resetPlayer error",i)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(a).then((function(){t.emit(xt.playFailedAndPaused,It.simdH264DecodeVideoWidthIsTooLarge,{},e),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and simdDecodeErrorReplay is false")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.simdH264DecodeVideoWidthIsTooLarge,{},e),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and pause error",i)}))}})),t.player.once(xt.networkDelayTimeout,(function(e){if(t.player._opt.networkDelayTimeoutReplay){if(t.isDestroyed())return void t.debug.log("JbPro","networkDelayTimeout but player is destroyed");t.emit(xt.crashLog,t.getCrashLog(xt.networkDelayTimeout,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","network delay time out and reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};t.player&&t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","wasm decode error and reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,xt.networkDelayTimeout,i,e),t.debug.error("JbPro","wasm decode error and reset player and play error",r)}))})).catch((function(){t.emit(xt.playFailedAndPaused,xt.networkDelayTimeout,i,e),t.debug.error("JbPro","wasm decode error and _resetPlayer error")}))}})),t.player.once(xt.flvDemuxBufferSizeTooLarge,(function(e){if(t.isDestroyed())t.debug.log("JbPro","flvDemuxBufferSizeTooLarge but player is destroyed");else{var i=t._getVideoLastIframeInfo();if(t.player._opt.flvDemuxBufferSizeTooLargeReplay){t.emit(xt.crashLog,t.getCrashLog(xt.flvDemuxBufferSizeTooLarge,e)),t.debug.log("JbPro","flv Demux Buffer Size Too Large and flvDemuxBufferSizeTooLargeReplay = true and reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};t.player&&t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(n.isNotMute=!0),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log(t.TAG_NAME,"flv Demux Buffer Size Too Large and reset player and play success")})).catch((function(r){t.emit(xt.playFailedAndPaused,xt.flvDemuxBufferSizeTooLarge,i,e),t.debug.error(t.TAG_NAME,"flv Demux Buffer Size Too Large and reset player and play error",r)}))})).catch((function(){t.emit(xt.playFailedAndPaused,xt.flvDemuxBufferSizeTooLarge,i,e),t.debug.error(t.TAG_NAME,"flv Demux Buffer Size Too Large and _resetPlayer error")}))}else if(t._opt.flvDemuxBufferSizeTooLargeEmitFailed){t.debug.log(t.TAG_NAME,"flv Demux Buffer Size Too Large and flvDemuxBufferSizeTooLargeEmitFailed = true and pause player");var o=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(o).then((function(){t.emit(xt.playFailedAndPaused,It.flvDemuxBufferSizeTooLarge,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,It.flvDemuxBufferSizeTooLarge,i,e),t.debug.error(t.TAG_NAME,"flv Demux Buffer Size Too Large",r)}))}}})),t.player.once(It.fetchError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","fetchError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.fetchError,e));var i=t._getVideoLastIframeInfo(),r=t._isNeedNetworkDisconnectReplay();if(t.player._opt.streamErrorReplay||r){r?t.debug.log("JbPro","fetch error and network is disconnect and reset player and play"):t.debug.log("JbPro","fetch error and streamErrorReplay is true and _streamErrorReplayTimes is ".concat(t._streamErrorReplayTimes,", streamErrorReplayDelayTime is ").concat(t._opt.streamErrorReplayDelayTime,", next replay"));var a={};t.player._opt.replayUseLastFrameShow&&(a=Object.assign({},a,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(a.isNotMute=!0);var n=t._opt.playOptions,o=t._opt.url,s=r?1:t._opt.streamErrorReplayDelayTime;t._resetPlayer(a).then((function(){t.streamErrorReplayDelayTimeout=setTimeout((function(){if(t.isDestroyed())t.debug.log("JbPro","fetch error and _resetPlayer but player is destroyed and return");else{if(t.network.isOffline())return t.debug.log("JbPro","fetch error and network is offline and wait network online to play , so return"),t._isNetworkOfflinePaused=!0,void(t._isNetworkOfflinePausedAndNextPlayConfig={url:o,options:n,type:It.fetchError});t._streamErrorReplayTimes++,t.play(o,n).then((function(){t.debug.log("JbPro","fetch error and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.fetchError,{},e),t.debug.error("JbPro","fetch error and reset player and play error",i)}))}}),1e3*s)})).catch((function(i){t.emit(xt.playFailedAndPaused,It.fetchError,{},e),t.debug.error("JbPro","fetch error and _resetPlayer error",i)}))}else{t.debug.log("JbPro","fetch error and pause player");var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.fetchError,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,It.fetchError,i,e),t.debug.error("JbPro","fetch error and pause",r)}))}}})),t.player.once(xt.streamEnd,(function(e){if(t.isDestroyed())t.debug.log("JbPro","streamEnd but player is destroyed and return");else{t.emit(xt.crashLog,t.getCrashLog(xt.streamEnd,e));var i=t._getVideoLastIframeInfo(),r=t._checkIsMeaningfulRetry(en),a=""+e=="1006"&&t.player._opt.websocket1006ErrorReplay,n=a&&r,o=t.player._opt.streamEndReplay,s=t._isNeedNetworkDisconnectReplay();if(n||o||s){s?t.debug.log("JbPro","streamEnd and network is disconnect and reset player and play"):n?t.debug.log("JbPro","streamEnd and websocket1006ErrorReplay is true and error is 1006 and _websocket1006ErrorReplayTimes is ".concat(t._websocket1006ErrorReplayTimes," , delay ").concat(t._opt.websocket1006ErrorReplayDelayTime,"s reset player and play")):t.debug.log("JbPro","streamEnd and isStreamEndReplay is true and and _streamEndReplayTimes is ".concat(t._streamEndReplayTimes," , delay ").concat(t._opt.streamEndReplayDelayTime,"s reset player and play"));var l=t._opt.playOptions,c=t._opt.url;t._websocket1006ErrorRetryLog.push(Ln());var u={};t.player._opt.replayUseLastFrameShow&&(u=Object.assign({},u,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(u.isNotMute=!0);var d=n?t._opt.websocket1006ErrorReplayDelayTime:t._opt.streamEndReplayDelayTime;s&&(d=1),t._initLoadingBackgroundForIOS(i),t._resetPlayer(u).then((function(){t.streamEndReplayDelayTimeout=setTimeout((function(){if(t._removeLoadingBackgroundForIOS(),t.isDestroyed())s?t.debug.log("JbPro","streamEnd and network is disconnect and _resetPlayer() but player is destroyed and return"):n?t.debug.log("JbPro","streamEnd and 1006 error and _resetPlayer() but player is destroyed and return"):t.debug.log("JbPro","streamEnd and _resetPlayer() but player is destroyed and return");else{if(t.network.isOffline())return n?t.debug.log("JbPro","streamEnd and 1006 error network is offline and wait network online to play , so return"):t.debug.log("JbPro","streamEnd and network is offline and wait network online to play , so return"),t._isNetworkOfflinePaused=!0,void(t._isNetworkOfflinePausedAndNextPlayConfig={url:c,options:l,type:n?It.websocket1006Error:It.streamEnd});n?t._websocket1006ErrorReplayTimes++:t._streamEndReplayTimes++,t.play(c,l).then((function(){n?t.debug.log("JbPro","streamEnd and 1006 error and reset player and play success"):t.debug.log("JbPro","streamEnd and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.streamEnd,{},e),n?t.debug.error("JbPro","streamEnd and 1006 error and reset player and play error",i):t.debug.error("JbPro","streamEnd and reset player and play error",i)}))}}),1e3*d)})).catch((function(i){t.emit(xt.playFailedAndPaused,It.streamEnd,{},e),n?t.debug.error("JbPro","streamEnd and 1006 and _resetPlayer error",i):t.debug.error("JbPro","streamEnd and _resetPlayer error",i)}))}else{a?t.debug.log("JbPro","streamEnd pause player "+(No(r)?"and is not meaningful retry":"")):t.debug.log("JbPro","streamEnd pause player");var h=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(h).then((function(){t.emit(xt.playFailedAndPaused,xt.streamEnd,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,xt.streamEnd,i,e),t.debug.error("JbPro","streamEnd pause",r)}))}}})),t.player.once(It.websocketError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","websocketError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.websocketError,e));var i=t._getVideoLastIframeInfo(),r=t._isNeedNetworkDisconnectReplay();if(t.player._opt.streamErrorReplay||r){r?t.debug.log("JbPro","websocketError error and network is disconnect and reset player and play"):t.debug.log("JbPro","websocketError error and streamErrorReplay is true and _streamErrorReplayTimes is ".concat(t._streamErrorReplayTimes," and streamErrorReplayDelayTime is ").concat(t._opt.streamErrorReplayDelayTime,", next replay"));var a={};t.player._opt.replayUseLastFrameShow&&(a=Object.assign({},a,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),No(t.isMute())&&(a.isNotMute=!0);var n=t._opt.playOptions,o=t._opt.url,s=r?1:t._opt.streamErrorReplayDelayTime;t._resetPlayer(a).then((function(){t.streamErrorReplayDelayTimeout=setTimeout((function(){if(t.isDestroyed())r?t.debug.log("JbPro","websocketError error and network is disconnect and _resetPlayer() but player is destroyed and return"):t.debug.log("JbPro","websocketError error and _resetPlayer() but player is destroyed and return");else{if(t.network.isOffline())return t.debug.log("JbPro","websocketError error and network is offline and wait network online to play , so return"),t._isNetworkOfflinePaused=!0,void(t._isNetworkOfflinePausedAndNextPlayConfig={url:o,options:n,type:It.websocketError});t._streamErrorReplayTimes++,t.play(o,n).then((function(){t.debug.log("JbPro","websocketError error and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,It.fetchError,{},e),t.debug.error("JbPro","websocketError error and reset player and play error",i)}))}}),1e3*s)})).catch((function(i){t.emit(xt.playFailedAndPaused,It.fetchError,{},e),t.debug.error("JbPro","websocketError error and _resetPlayer error",i)}))}else{t.debug.log("JbPro","websocketError and pause player");var l=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(l).then((function(){t.emit(xt.playFailedAndPaused,It.websocketError,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,It.websocketError,i,e),t.debug.error("JbPro","websocketError and pause",r)}))}}})),t.player.once(It.webrtcError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webrtcError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.webrtcError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","webrtcError and pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(r).then((function(){t.emit(xt.playFailedAndPaused,It.webrtcError,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,It.webrtcError,i,e),t.debug.error("JbPro","webrtcError and pause",r)}))}})),t.player.once(It.hlsError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","hlsError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.hlsError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","hlsError and pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(r).then((function(){t.emit(xt.playFailedAndPaused,It.hlsError,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,It.hlsError,i,e),t.debug.error("JbPro","hlsError and pause",r)}))}})),t.player.once(It.aliyunRtcError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","aliyunRtcError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.aliyunRtcError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","aliyunRtcError and pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(r).then((function(){t.emit(xt.playFailedAndPaused,It.aliyunRtcError,i,e)})).catch((function(r){t.emit(xt.playFailedAndPaused,It.aliyunRtcError,i,e),t.debug.error("JbPro","aliyunRtcError and pause",r)}))}})),t.player.once(It.decoderWorkerInitError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","decoderWorkerInitError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.decoderWorkerInitError,e)),t.debug.log("JbPro","decoderWorkerInitError and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(i).then((function(){t.emit(xt.playFailedAndPaused,It.decoderWorkerInitError,{},e)})).catch((function(i){t.emit(xt.playFailedAndPaused,It.decoderWorkerInitError,{},e),t.debug.error("JbPro","decoderWorkerInitError and pause",i)}))}})),t.player.once(It.videoElementPlayingFailedForWebrtc,(function(e){if(t.isDestroyed())t.debug.log("JbPro","videoElementPlayingFailedForWebrtc but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.videoElementPlayingFailedForWebrtc,e)),t.debug.log("JbPro","videoElementPlayingFailedForWebrtc and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(i).then((function(){t.emit(xt.playFailedAndPaused,It.videoElementPlayingFailedForWebrtc,{},e)})).catch((function(i){t.emit(xt.playFailedAndPaused,It.videoElementPlayingFailedForWebrtc,{},e),t.debug.error("JbPro","videoElementPlayingFailedForWebrtc and pause",i)}))}})),t.player.once(It.videoInfoError,(function(e){if(t.isDestroyed())t.debug.log("JbPro","videoInfoError but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(It.videoInfoError,e)),t.debug.log("JbPro","videoInfoError and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t.player.setPlayFailedAndPaused(),t._pause(i).then((function(){t.emit(xt.playFailedAndPaused,It.videoInfoError,{},e)})).catch((function(i){t.emit(xt.playFailedAndPaused,It.videoInfoError,{},e),t.debug.error("JbPro","videoInfoError and pause",i)}))}})),t.player.once(xt.webrtcStreamH265,(function(e){if(t.isDestroyed())t.debug.log("JbPro","webrtcStreamH265 but player is destroyed");else{t.debug.log("JbPro","webrtcStreamH265 and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({isWebrtcH265:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webrtcStreamH265 and reset player and play success")})).catch((function(i){t.emit(xt.playFailedAndPaused,xt.webrtcStreamH265,{},e),t.debug.error("JbPro","webrtcStreamH265 and reset player and play error",i)}))})).catch((function(){t.emit(xt.playFailedAndPaused,xt.webrtcStreamH265,{},e),t.debug.error("JbPro","webrtcStreamH265 and _resetPlayer error")}))}})),t.player.on(xt.delayTimeout,(function(e){if(t.isDestroyed())t.debug.log("JbPro","delay timeout but player is destroyed");else{t.emit(xt.crashLog,t.getCrashLog(xt.delayTimeout,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.heartTimeoutReplay&&(t._heartTimeoutReplayTimes10&&this.debug.warn("JbPro","setBufferTime() buffer time is ".concat(e," second, is too large, video will show blank screen until cache ").concat(e," second buffer data"));var t=1e3*e;this._opt.videoBuffer=t,this.player?this.player.updateOption({videoBuffer:t},!0):this.debug.warn("JbPro","setBufferTime() player is null")}},{key:"setBufferDelayTime",value:function(e){this.debug.log("JbPro","setBufferDelayTime() ".concat(e)),(e=Number(e))<.2&&this.debug.warn("JbPro","setBufferDelayTime() buffer time delay is ".concat(e," second, is too small"));var t=1e3*(e=In(e,.2,100));this._opt.videoBufferDelay=t,this.player?this.player.updateOption({videoBufferDelay:t},!0):this.debug.warn("JbPro","setBufferDelayTime() player is null")}},{key:"setRotate",value:function(e){this.debug.log("JbPro","setRotate() ".concat(e)),e=parseInt(e,10),this._opt.rotate!==e&&-1!==[0,90,180,270].indexOf(e)?(this._opt.rotate=e,this.player?(this.player.updateOption({rotate:e}),this.resize()):this.debug.warn("JbPro","setRotate() player is null")):this.debug.warn("JbPro","setRotate() rotate is ".concat(e," and this._opt.rotate is ").concat(this._opt.rotate))}},{key:"setMirrorRotate",value:function(e){this.debug.log("JbPro","setMirrorRotate() ".concat(e)),e||(e="none"),this._opt.mirrorRotate!==e&&-1!==["none","level","vertical"].indexOf(e)?(this._opt.mirrorRotate=e,this.player?(this.player.updateOption({mirrorRotate:e}),this.resize()):this.debug.warn("JbPro","setMirrorRotate() player is null")):this.debug.warn("JbPro","setMirrorRotate() mirrorRotate is ".concat(e," and this._opt.mirrorRotate is ").concat(this._opt.mirrorRotate))}},{key:"setAspectRatio",value:function(e){this.debug.log("JbPro","setAspectRatio() ".concat(e)),e||(e="default"),this._opt.aspectRatio!==e&&-1!==["default","4:3","16:9"].indexOf(e)?(this._opt.aspectRatio=e,this.player?(this.player.updateOption({aspectRatio:e}),this.resize()):this.debug.warn("JbPro","setAspectRatio() player is null")):this.debug.warn("JbPro","setAspectRatio() aspectRatio is ".concat(e," and this._opt.aspectRatio is ").concat(this._opt.mirrorRotate))}},{key:"hasLoaded",value:function(){return!0}},{key:"_hasLoaded",value:function(){return this.player&&this.player.loaded||!1}},{key:"setKeepScreenOn",value:function(){this.debug.log("JbPro","setKeepScreenOn()"),this._opt.keepScreenOn=!0,this.player?this.player.updateOption({keepScreenOn:!0}):this.debug.warn("JbPro","setKeepScreenOn() player is not ready")}},{key:"setFullscreen",value:function(e){this.debug.log("JbPro","setFullscreen() ".concat(e));var t=!!e;this.player?this.player.fullscreen!==t?this.player.fullscreen=t:this.debug.warn("JbPro","setFullscreen() fullscreen is ".concat(t," and this.player.fullscreen is ").concat(this.player.fullscreen)):this.debug.warn("JbPro","setFullscreen() player is not ready")}},{key:"setWebFullscreen",value:function(e){this.debug.log("JbPro","setWebFullscreen() ".concat(e));var t=!!e;this.player?this.player.webFullscreen=t:this.debug.warn("JbPro","setWebFullscreen() player is not ready")}},{key:"screenshot",value:function(e,t,i,r){return this.debug.log("JbPro","screenshot() ".concat(e," ").concat(t," ").concat(i," ").concat(r)),this.player&&this.player.video?this.player.video.screenshot(e,t,i,r):(this.debug.warn("JbPro","screenshot() player is not ready"),null)}},{key:"screenshotWatermark",value:function(e){var t=this;return new Promise((function(i,r){t.debug.log("JbPro","screenshotWatermark()",e),t.player&&t.player.video?t.player.video.screenshotWatermark(e).then((function(e){i(e)})).catch((function(e){r(e)})):(t.debug.warn("JbPro","screenshotWatermark() player is not ready"),r("player is not ready"))}))}},{key:"startRecord",value:function(e,t){var i=this;return new Promise((function(r,a){if(i.debug.log("JbPro","startRecord() ".concat(e," ").concat(t)),!i.player)return i.debug.warn("JbPro","startRecord() player is not ready"),a("player is not ready");i.player.playing?(i.player.startRecord(e,t),r()):(i.debug.warn("JbPro","startRecord() player is not playing"),a("not playing"))}))}},{key:"stopRecordAndSave",value:function(e,t){var i=this;return new Promise((function(r,a){i.debug.log("JbPro","stopRecordAndSave() ".concat(e," ").concat(t)),i.player&&i.player.recording?i.player.stopRecordAndSave(e,t).then((function(e){r(e)})).catch((function(e){a(e)})):a("not recording")}))}},{key:"isPlaying",value:function(){var e=!1;return this.player&&(e=this.player.isPlaying()),e}},{key:"isLoading",value:function(){return!!this.player&&this.player.loading}},{key:"isPause",value:function(){var e=!1;return this._opt.playType===j?e=!this.isPlaying()&&!this.isLoading():this._opt.playType===z&&this.player&&(e=this.player.playbackPause),e}},{key:"isPaused",value:function(){return this.isPause()}},{key:"isPlaybackPause",value:function(){var e=!1;return this._opt.playType===z&&this.player&&(e=this.player.playbackPause),e}},{key:"isMute",value:function(){var e=!0;return this.player&&(e=this.player.isAudioMute()),e}},{key:"isRecording",value:function(){return this.player&&this.player.recorder&&this.player.recorder.recording||!1}},{key:"isFullscreen",value:function(){var e=!1;return this.player&&(e=this.player.fullscreen),e}},{key:"isWebFullscreen",value:function(){var e=!1;return this.player&&(e=this.player.webFullscreen),e}},{key:"clearBufferDelay",value:function(){this.debug.log("JbPro","clearBufferDelay()"),this.player?this.player.clearBufferDelay():this.debug.warn("JbPro","clearBufferDelay() player is not init")}},{key:"setNetworkDelayTime",value:function(e){this.debug.log("JbPro","setNetworkDelayTime() ".concat(e)),(e=Number(e))<1&&this.debug.warn("JbPro","setNetworkDelayTime() network delay is ".concat(e," second, is too small"));var t=1e3*(e=In(e,1,100));this._opt.networkDelay=t,this.player?this.player.updateOption({networkDelay:t},!0):this.debug.warn("JbPro","setNetworkDelayTime() player is null")}},{key:"getDecodeType",value:function(){var e="";return this.player&&(e=this.player.getDecodeType()),e}},{key:"getRenderType",value:function(){var e="";return this.player&&(e=this.player.getRenderType()),e}},{key:"getAudioEngineType",value:function(){var e="";return this.player&&(e=this.player.getAudioEngineType()),e}},{key:"getPlayingTimestamp",value:function(){var e=0;return this.player&&(e=this.player.getPlayingTimestamp()),e}},{key:"getStatus",value:function(){var e=jr;return this.player&&(e=this.player.loading?Fr:this.player.playing?Or:Nr),e}},{key:"getPlayType",value:function(){return this.player?this.player._opt.playType:j}},{key:"togglePerformancePanel",value:function(e){this.debug.log("JbPro","togglePerformancePanel() ".concat(e));var t=this.player._opt.showPerformance,i=!t;ao(e)&&(i=e),i!==t?this.player?this.player.togglePerformancePanel(i):this.debug.warn("JbPro","togglePerformancePanel() failed, this.player is not init"):this.debug.warn("JbPro","togglePerformancePanel() failed, showPerformance is prev: ".concat(t," === now: ").concat(i))}},{key:"openZoom",value:function(){this.debug.log("JbPro","openZoom()"),this.player?this.player.zooming=!0:this.debug.warn("JbPro","openZoom() failed, this.player is not init")}},{key:"closeZoom",value:function(){this.debug.log("JbPro","closeZoom()"),this.player?this.player.zooming=!1:this.debug.warn("JbPro","closeZoom() failed, this.player is not init")}},{key:"isZoomOpen",value:function(){var e=!1;return this.player&&(e=this.player.zooming),e}},{key:"toggleZoom",value:function(e){this.debug.log("JbPro","toggleZoom() ".concat(e)),ao(e)||(e=!this.isZoomOpen()),Oo(e)?this.openZoom():No(!1)&&this.closeZoom()}},{key:"expandZoom",value:function(){this.debug.log("JbPro","expandZoom()"),this.player&&this.player.zoom&&this.player.zooming?this.player.zoom.expandPrecision():this.debug.warn("JbPro","expandZoom() failed, zoom is not open or not init")}},{key:"narrowZoom",value:function(){this.debug.log("JbPro","narrowZoom()"),this.player&&this.player.zoom&&this.player.zooming?this.player.zoom.narrowPrecision():this.debug.warn("JbPro","narrowZoom failed, zoom is not open or not init")}},{key:"getCurrentZoomIndex",value:function(){var e=1;return this.player&&this.player.zoom&&(e=this.player.zoom.currentZoom),e}},{key:"startTalk",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){t.debug.log("JbPro","startTalk()",e,i),t._initTalk(i),t.talk.startTalk(e).then((function(){r(),t.talk.once(xt.talkStreamClose,(function(){t.debug.warn("JbPro","talk stream close"),t.stopTalk().catch((function(e){}))})),t.talk.once(xt.talkStreamError,(function(e){t.debug.warn("JbPro","talk stream error",e),t.stopTalk().catch((function(e){}))})),t.talk.once(xt.talkStreamInactive,(function(){t.debug.warn("JbPro","talk stream inactive"),t.stopTalk().catch((function(e){}))}))})).catch((function(e){a(e)}))}))}},{key:"stopTalk",value:function(){var e=this;return new Promise((function(t,i){if(e.debug.log("JbPro","stopTalk()"),!e.talk)return i("stopTalk() talk is not init");e.talk.destroy(),t()}))}},{key:"getTalkVolume",value:function(){var e=this;return new Promise((function(t,i){if(!e.talk)return i("getTalkVolume() talk is not init");t(e.talk.volume)}))}},{key:"setTalkVolume",value:function(e){var t=this;return new Promise((function(i,r){if(t.debug.log("JbPro","setTalkVolume()",e),!t.talk)return r("setTalkVolume() talk is not init");t.talk.setVolume(e/100),i()}))}},{key:"setNakedFlowFps",value:function(e){var t=this;return new Promise((function(i,r){if(t.debug.log("JbPro","setNakedFlowFps()",e),ro(e))return r("setNakedFlowFps() fps is empty");var a=Number(e);a=In(a,1,100),t._opt.nakedFlowFps=a,t.player?t.player.updateOption({nakedFlowFps:a}):t.debug.warn("JbPro","setNakedFlowFps() player is null"),i()}))}},{key:"getCrashLog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.player){var i=this.player.getAllStatsData(),r=this.player,a={url:this._opt.url,playType:r.isPlayback()?"playback":"live",demuxType:r.getDemuxType(),decoderType:r.getDecodeType(),renderType:r.getRenderType(),videoInfo:{encType:"",width:"",height:""},audioInfo:{encType:"",sampleRate:"",channels:""},audioEngine:r.getAudioEngineType(),allTimes:i.pTs,timestamp:Ln(),type:e,error:Do(t)||e};if(r.video){var n=r.video.videoInfo||{};a.videoInfo={encType:n.encType||"",width:n.width||"",height:n.height||""}}if(r.audio){var o=r.audio.audioInfo||{};a.audioInfo={encType:o.encType||"",sampleRate:o.sampleRate||"",channels:o.channels||""}}return a}}},{key:"updateDebugLevel",value:function(e){this.debug.log("JbPro","updateDebugLevel()",e),e===fe||e===me?e!==this.player._opt.debugLevel?(this._opt.debugLevel=e,this.player?this.player.updateOption({debugLevel:e},!0):this.debug.warn("JbPro","updateDebugLevel() player is null")):this.debug.warn("JbPro","updateDebugLevel() level is same, level: ".concat(e)):this.debug.warn("JbPro","updateDebugLevel() level is not valid, level: ".concat(e))}},{key:"updateWatermark",value:function(e){this.debug.log("JbPro","updateWatermark()",e),this.player?this.player.updateWatermark(e):this.debug.warn("JbPro","updateWatermark() player is not init")}},{key:"removeWatermark",value:function(){this.debug.log("JbPro","removeWatermark()"),this.player?this.player.removeWatermark():this.debug.warn("JbPro","removeWatermark() player is not init")}},{key:"updateFullscreenWatermark",value:function(e){if(this.debug.log("JbPro","updateFullscreenWatermark()",e),yo(e)){this._opt.fullscreenWatermarkConfig=e;var t=so(this.$container,e);if(!t.watermark_txt)return void this.debug.warn("JbPro","fullscreenWatermarkConfig text is empty");this.watermark.load(t)}else this.debug.warn("JbPro","updateFullscreenWatermark() config is not valid, config: ".concat(e))}},{key:"removeFullscreenWatermark",value:function(){this.debug.log("JbPro","removeFullscreenWatermark()"),this.watermark?this.watermark.remove():this.debug.warn("JbPro","removeFullscreenWatermark() watermark is not init")}},{key:"faceDetectOpen",value:function(){this.debug.log("JbPro","faceDetectOpen()"),this.player?this.player.faceDetect(!0):this.debug.warn("JbPro","faceDetectOpen() player is not init")}},{key:"faceDetectClose",value:function(){this.debug.log("JbPro","faceDetectClose()"),this.player?this.player.faceDetect(!1):this.debug.warn("JbPro","faceDetectClose() player is not init")}},{key:"objectDetectOpen",value:function(){this.debug.log("JbPro","objectDetectOpen()"),this.player?this.player.objectDetect(!0):this.debug.warn("JbPro","objectDetectOpen() player is not init")}},{key:"objectDetectClose",value:function(){this.debug.log("JbPro","objectDetectClose()"),this.player?this.player.objectDetect(!1):this.debug.warn("JbPro","objectDetectClose() player is not init")}},{key:"sendWebsocketMessage",value:function(e){this.debug.log("JbPro","sendWebsocketMessage()",e),this.player?this.player.sendWebsocketMessage(e):this.debug.warn("JbPro","sendWebsocketMessage() player is not init")}},{key:"addContentToCanvas",value:function(e){this.debug.log("JbPro","addContentToCanvas()"),this.player?this.player.addContentToCanvas(e):this.debug.warn("JbPro","addContentToCanvas() player is not init")}},{key:"clearContentToCanvas",value:function(){this.debug.log("JbPro","clearContentToCanvas()"),this.player?this.player.addContentToCanvas([]):this.debug.warn("JbPro","clearContentToCanvas() player is not init")}},{key:"addContentToContainer",value:function(e){this.debug.log("JbPro","addContentToContainer()"),this.player?this.player.addContentToContainer(e):this.debug.warn("JbPro","addContentToContainer() player is not init")}},{key:"clearContentToContainer",value:function(){this.debug.log("JbPro","clearContentToContainer()"),this.player?this.player.addContentToContainer([]):this.debug.warn("JbPro","clearContentToContainer() player is not init")}},{key:"setControlHtml",value:function(e){this.debug.log("JbPro","setControlHtml()",e),this.player?this.player.setControlHtml(e):this.debug.warn("JbPro","setControlHtml() player is not init")}},{key:"clearControlHtml",value:function(){this.debug.log("JbPro","clearControlHtml()"),this.player?this.player.clearControlHtml():this.debug.warn("JbPro","clearControlHtml() player is not init")}},{key:"getVideoInfo",value:function(){var e=null;return this.player&&(e=this.player.getVideoInfo()),e}},{key:"getAudioInfo",value:function(){var e=null;return this.player&&(e=this.player.getAudioInfo()),e}},{key:"setSm4CryptoKey",value:function(e){this.debug.log("JbPro","setSm4CryptoKey()",e),32===(e=""+e).length?(this._opt.sm4CryptoKey=e,this.player?this.player.updateOption({sm4CryptoKey:e},!0):this.debug.warn("JbPro","setSm4CryptoKey() player is null")):this.debug.warn("JbPro","setSm4CryptoKey() key is invalid and length is ".concat(e.length," !== 32"))}},{key:"setM7sCryptoKey",value:function(e){this.debug.log("JbPro","setM7sCryptoKey()",e),e=""+e,this._opt.m7sCryptoKey=e,this.player?this.player.updateOption({m7sCryptoKey:e},!0):this.debug.warn("JbPro","setM7sCryptoKey() player is null")}},{key:"setXorCryptoKey",value:function(e){this.debug.log("JbPro","setXorCryptoKey()",e),e=""+e,this._opt.xorCryptoKey=e,this.player?this.player.updateOption({xorCryptoKey:e},!0):this.debug.warn("JbPro","setXorCryptoKey() player is null")}},{key:"updateLoadingText",value:function(e){this.debug.log("JbPro","updateLoadingText()",e),this.player?this.player.updateLoadingText(e):this.debug.warn("JbPro","updateLoadingText() player is null")}},{key:"updateIsEmitSEI",value:function(e){this.debug.log("JbPro","updateIsEmitSEI()",e),this._opt.isEmitSEI=e,this.player?this.player.updateOption({isEmitSEI:e},!0):this.debug.warn("JbPro","updateIsEmitSEI() player is null")}},{key:"getPTZCmd",value:function(e,t){if(this.debug.log("JbPro","getPTZCmd()",e),e)return this.player?t_({type:e,index:0,speed:t}):void this.debug.warn("JbPro","getPTZCmd() player is null");this.debug.warn("JbPro","getPTZCmd() ptz is null")}},{key:"downloadTempNakedFlowFile",value:function(){var e=this;return new Promise((function(t,i){e.player?(e.player.downloadNakedFlowFile(),t()):i("player is not init")}))}},{key:"downloadTempFmp4File",value:function(){var e=this;return new Promise((function(t,i){e.player?(e.player.downloadFmp4File(),t()):i("player is not init")}))}},{key:"downloadTempMpeg4File",value:function(){var e=this;return new Promise((function(t,i){e.player?(e.player.downloadMpeg4File(),t()):i("player is not init")}))}},{key:"downloadTempRtpFile",value:function(){var e=this;return new Promise((function(t,i){e.talk?(e.talk.downloadRtpFile(),t()):i("talk is not init")}))}},{key:"downloadMemoryLog",value:function(){this.memoryLogger&&this.memoryLogger.download()}},{key:"_getVideoLastIframeInfo",value:function(){var e=this.getVideoInfo()||{},t={loadingBackground:this.screenshot("","png",.92,"base64"),loadingBackgroundWidth:e.width||0,loadingBackgroundHeight:e.height||0};return t.loadingBackground&&t.loadingBackgroundWidth&&t.loadingBackgroundHeight&&(this._tempVideoLastIframeInfo=t),this._tempVideoLastIframeInfo||{}}},{key:"getExtendBtnList",value:function(){this.debug.log("JbPro","getExtendBtnList()");var e=[];return this.player?e=this.player.getExtendBtnList():this.debug.warn("JbPro","getExtendBtnList() player is null"),e}},{key:"getFlvMetaData",value:function(){this.debug.log("JbPro","getFlvMetaData()");var e=null;return this.player?e=this.player.getMetaData():this.debug.warn("JbPro","getFlvMetaData() player is null"),e}},{key:"updateAiFaceDetectInterval",value:function(e){this.debug.log("JbPro","updateAiFaceDetectInterval()",e);var t=1e3*(e=Number(e));this._opt.aiFaceDetectInterval=t,this.player?this.player.updateOption({aiFaceDetectInterval:t}):this.debug.warn("JbPro","updateAiFaceDetectInterval() player is null")}},{key:"updateAiFaceDetectLevel",value:function(e){if(this.debug.log("JbPro","updateAiFaceDetectLevel()",e),La[e]){var t=La[e];this._opt.aiFaceDetectWidth=t,this.player?(this.player.updateOption({aiFaceDetectWidth:t}),this.player.ai&&this.player.ai.updateFaceDetectorConfig({detectWidth:t})):this.debug.warn("JbPro","updateAiFaceDetectLevel() player is null")}else this.debug.warn("JbPro","'updateAiFaceDetectLevel() level ".concat(e," is invalid'"))}},{key:"updateAiObjectDetectInterval",value:function(e){this.debug.log("JbPro","updateAiObjectDetectInterval()",e);var t=1e3*(e=Number(e));this._opt.aiObjectDetectInterval=t,this.player?this.player.updateOption({aiObjectDetectInterval:t}):this.debug.warn("JbPro","updateAiObjectDetectInterval() player is null")}},{key:"updateAiObjectDetectLevel",value:function(e){if(this.debug.log("JbPro","updateAiObjectDetectLevel()",e),Ia[e]){var t=Ia[e];this._opt.aiObjectDetectWidth=t,this.player?(this.player.updateOption({aiObjectDetectWidth:t}),this.player.ai&&this.player.ai.updateObjectDetectorConfig({detectWidth:t})):this.debug.warn("JbPro","updateAiObjectDetectLevel() player is null")}else this.debug.warn("JbPro","'updateAiObjectDetectLevel() level ".concat(e," is invalid'"))}},{key:"setCryptoKeyUrl",value:function(e){this.debug.log("JbPro","setCryptoKeyUrl()",e),e&&(this._opt.cryptoKeyUrl=e)}},{key:"showErrorMessageTips",value:function(e){this.debug.log("JbPro","showErrorMessageTips()",e),e&&(this.player?this.player.showTipsMessageByContent(e):this.debug.warn("JbPro","showErrorMessageTips() player is null"))}},{key:"setPtzPosition",value:function(e){this.debug.log("JbPro","setPtzPosition()",e),e&&!go(e)&&(this.player?this.player.setPtzPosition(e):this.debug.warn("JbPro","setPtzPosition() player is null"))}},{key:"hideErrorMessageTips",value:function(){this.debug.log("JbPro","hideErrorMessageTips()"),this.player?this.player.hideTipsMessage():this.debug.warn("JbPro","hideErrorMessageTips() player is null")}},{key:"getContainerRect",value:function(){return this._getContainerRect()}},{key:"proxy",value:function(e,t,i,r){return this.events.proxy(e,t,i,r)}},{key:"_checkIsMeaningfulRetry",value:function(e){var t=!0,i=[];if(e===en?i=this._websocket1006ErrorRetryLog:e===tn?i=this._mseDecodeErrorRetryLog:e===rn&&(i=this._wcsDecodeErrorRetryLog),this.debug.log(this.TAG_NAME,"_checkIsMeaningfulRetry() type is ".concat(e,", and retryLog is ").concat(i.join(","))),i.length>=5){var r=i[0],a=i[i.length-1],n=a-r;n<=1e4&&(this.debug.warn(this.TAG_NAME,"retry type is ".concat(e,", and retry length is ").concat(i.length,", and start is ").concat(r," and end is ").concat(a," and diff is ").concat(n)),t=!1)}return t}},{key:"_initLoadingBackgroundForIOS",value:function(e){(Hn()||Wn())&&e.loadingBackground&&e.loadingBackgroundWidth&&e.loadingBackgroundHeight&&(this.debug.log(this.TAG_NAME,"_initLoadingBackgroundForIOS"),this._initLoadingBg(),"default"===this.player._opt.aspectRatio||On()?this._doInitLoadingBackground(e):this._doInitLoadingBackgroundForRatio(e))}},{key:"_doInitLoadingBackground",value:function(e){var t=this,i=this._getContainerRect(),r=i.height,a=this.player._opt;a.hasControl&&!a.controlAutoHide&&(r-=a.playType===z?yi:gi);var n=i.width,o=r,s=a.rotate;270!==s&&90!==s||(n=r,o=i.width),this.$loadingBgImage.width=n,this.$loadingBgImage.height=o,this.$loadingBgImage.src=e.loadingBackground;var l=(i.width-n)/2,c=(r-o)/2,u="contain";a.isResize||(u="fill"),a.isFullResize&&(u="none");var d="";"none"===a.mirrorRotate&&s&&(d+=" rotate("+s+"deg)"),"level"===a.mirrorRotate?d+=" rotateY(180deg)":"vertical"===a.mirrorRotate&&(d+=" rotateX(180deg)"),this._opt.videoRenderSupportScale&&(this.$loadingBgImage.style.objectFit=u),this.$loadingBgImage.style.transform=d,this.$loadingBgImage.style.padding="0",this.$loadingBgImage.style.left=l+"px",this.$loadingBgImage.style.top=c+"px",this.$loadingBgImage.complete?$u(this.$loadingBg,"show"):this.$loadingBgImage.onload=function(){$u(t.$loadingBg,"show"),t.$loadingBgImage.onload=null}}},{key:"_doInitLoadingBackgroundForRatio",value:function(e){var t=this,i=this.player._opt.aspectRatio.split(":").map(Number),r=this._getContainerRect(),a=r.width,n=r.height,o=this.player._opt,s=0;o.hasControl&&!o.controlAutoHide&&(s=o.playType===z?yi:gi,n-=s);var l=e.loadingBackgroundWidth,c=e.loadingBackgroundHeight,u=l/c,d=i[0]/i[1];if(this.$loadingBgImage.src=e.loadingBackground,u>d){var h=d*c/l;this.$loadingBgImage.style.width=100*h+"%",this.$loadingBgImage.style.height="calc(100% - ".concat(s,"px)"),this.$loadingBgImage.style.padding="0 ".concat((a-a*h)/2,"px")}else{var p=l/d/c;this.$loadingBgImage.style.width="100%",this.$loadingBgImage.style.height="calc(".concat(100*p,"% - ").concat(s,"px)"),this.$loadingBgImage.style.padding=(n-n*p)/2+"px 0"}this.$loadingBgImage.complete?$u(this.$loadingBg,"show"):this.$loadingBgImage.onload=function(){$u(t.$loadingBg,"show"),t.$loadingBgImage.onload=null}}},{key:"_initLoadingBg",value:function(){if(!this.$loadingBg){var e=document.createElement("div"),t=document.createElement("img");e.className="jb-pro-loading-bg-for-ios",this.$loadingBg=e,this.$loadingBgImage=t,e.appendChild(t),this.$container.appendChild(e)}}},{key:"_removeLoadingBackgroundForIOS",value:function(){if(this.$loadingBg){if(this.debug.log(this.TAG_NAME,"_removeLoadingBackgroundForIOS()"),!rd(this.$loadingBg)){var e=this.$container.querySelector(".jb-pro-loading-bg-for-ios");e&&this.$container&&this.$container.removeChild(e)}this.$loadingBg=null,this.$loadingBgImage=null}}},{key:"_getContainerRect",value:function(){var e={};return this.$container&&(e=this.$container.getBoundingClientRect(),e.width=Math.max(e.width,this.$container.clientWidth),e.height=Math.max(e.height,this.$container.clientHeight)),e}},{key:"_isNeedNetworkDisconnectReplay",value:function(){return this._opt.networkDisconnectReplay&&this.network.isOffline()}}])}(s);c_.ERROR=It,c_.EVENTS=Rt,window.JessibucaPro=c_,window.JbPro=c_,window.WebPlayerPro=c_,nd('.jb-pro-multi-container .jb-pro-multi-player-container-v2{overflow:hidden;width:100%;height:100%;position:relative;display:grid;grid-template-columns:repeat(var(--split),1fr);grid-template-rows:repeat(var(--split),1fr)}.jb-pro-multi-container .jb-pro-multi-player-container-v2 .jb-pro-multi-player{overflow:hidden;position:relative;width:100%;height:100%}.jb-pro-multi-container .jb-pro-multi-player-container-v2 .jb-pro-multi-player .jb-pro-multi-player-draw-window{position:absolute;z-index:1;width:calc(100% - 2px);height:calc(100% - 2px);color:#fff;transition:all .25s}.jb-pro-multi-container .jb-pro-multi-player-container-v2 .jb-pro-multi-player .jb-pro-multi-player-video-window{position:absolute;left:1px;top:1px;z-index:2;width:calc(100% - 2px);height:calc(100% - 2px)}.jb-pro-multi-container .jb-pro-multi-player[fullscreen="1"]{grid-column-start:1;grid-column-end:9;grid-row-start:1;grid-row-end:9}.jb-pro-multi-container .jb-pro-multi-layout-6 .jb-pro-multi-player[order="0"]{grid-column-start:1;grid-column-end:3;grid-row-start:1;grid-row-end:3}.jb-pro-multi-container .jb-pro-multi-layout-9 .jb-pro-multi-player[order="0"]{grid-column-start:1;grid-column-end:4;grid-row-start:1;grid-row-end:4}');var u_=function(t){function i(){var e;S(this,i);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=_(this,i),e._opt={},Object.keys(t).forEach((function(e){if(void 0===t[e])throw new Error('jb-pro-multi option "'.concat(e,'" can not be undefined'))}));var r=Bo(sa);e._opt=Object.assign({},r,t),e.LOG_TAG="jbProMulti";var a=t.container;if("string"==typeof t.container&&(a=document.querySelector(t.container)),!a)throw new Error("Jb-pro-multi need container option");if("CANVAS"===a.nodeName||"VIDEO"===a.nodeName)throw new Error("Jb-pro-multi container type can not be ".concat(a.nodeName," type"));return a.classList.add("jb-pro-multi-container"),e.maxWindowSize=e._opt.maxSplit*e._opt.maxSplit,e.currentWindowIndex=-1,e.currentWindowUuid=null,e.specialLayoutType=null,e.startDragWindowItem=null,e.windowList=[],e.$container=a,e.debug=new an(e),e.events=new Yo(e),e._opt.split||(e._opt.split=1),Oo(e._opt.draggable)?e._initWindows$2():e._initWindows(),e._innerArrangeWindow(e._opt.split,!0),e._initEvents(),e._handleWindowSelect(0),e._listenFullscreenChange(),e}return k(i,t),T(i,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){if(e.debug.log(e.LOG_TAG,"destroy()"),e.off(),e.events&&(e.events.destroy(),e.events=null),e.specialLayoutType=null,e.startDragWindowItem=null,e.currentWindowUuid=null,e.currentWindowIndex=-1,e.$container&&(e.$container.classList.remove("jb-pro-multi-container"),e.$container=null),e.windowList){var r=[];e.windowList.forEach((function(e){e.$playerContainerEvents.forEach((function(e){e()})),e.player&&r.push(e.player.destroy())})),Promise.all(r).then((function(){e.windowList.forEach((function(e){e.player=null})),e.windowList=[],t()})).catch((function(e){i(e)}))}else t();e.debug&&e.debug.log(e.LOG_TAG,"destroy")}))}},{key:"_createPlayer",value:function(e){var t=this,i=this,r=this._findWindowItemIndex(e);e.uuid;var a=this._opt;a.supportDblclickContainerFullscreen&&(a.supportDblclickFullscreen=!1);var n=new c_(w(w({},a),{},{isMulti:!0,multiIndex:r,container:e.$player}));return Object.keys(Rt).forEach((function(e){n.on(Rt[e],(function(){for(var t=arguments.length,a=new Array(t),n=0;n\n
\n
\n \n ");var i='
'.concat(e,"
");this.$container.innerHTML=i;for(var r=this.$container.querySelectorAll(".jb-pro-multi-player"),a=0;a\n
\n
\n \n ');var r='
\n ').concat(e,"\n
");this.$container.innerHTML=r,this.$multiContainer=this.$container.querySelector(".jb-pro-multi-player-container-v2");for(var a=this.$container.querySelectorAll(".jb-pro-multi-player"),n=0;n ").concat(n.style.order)),e._sortWindows()}e.emit(la.drop,r,t)}));if(i.$playerContainerEvents=[n,s,l,c,u,o,d,h,p,f],e._opt.draggable){var m=t(a,"dragstart",(function(t){var i=Go(a,"uuid"),r=e._findWindowItemIndexByUuid(i);e._handleWindowSelect(r),e.startDragWindowItem=e._getWindowItem(r),e.emit(la.dragstart,r,t,a)}));i.$playerContainerEvents.push(m)}if(e._opt.supportMousemoveEvent){var g=t(a,"mousemove",(function(t){var i=Go(a,"uuid"),r=e._findWindowItemIndexByUuid(i);e.emit(la.mousemove,r,t)}));i.$playerContainerEvents.push(g)}}))}},{key:"_getContainerRect",value:function(){var e=this.$container.getBoundingClientRect();return{width:parseInt(e.width),height:parseInt(e.height)}}},{key:"_updateWindows",value:function(){for(var e=this._getContainerRect(),t=e.width,i=e.height,r=this._opt.split,a=t%r,n=i%r,o=(t-a-2*r)/r,s=(i-n-2*r)/r,l=(t-a)/r,c=(i-n)/r,u=this._getCurrentMaxSplit(),d=0;d=Math.pow(r,2)?n:0),v=l+(d%r==r-1?a:0),A=c+(d+r>=Math.pow(r,2)?n:0);p.style.width=v+"px",p.style.height=A+"px",p.style.display="block",m.style.width=g+"px",m.style.height=y+"px",m.style.display="block",f.style.width=g+"px",f.style.height=y+"px",f.style.display="block",h.player&&h.player.resize()}if(this.specialLayoutType){var b,_,k,w,S=this.windowList[0],T=S.$playerContainer,E=S.$player,C=S.$playerBorder,x=T.style.width.replace("px",""),R=T.style.height.replace("px",""),D=E.style.width.replace("px",""),L=E.style.height.replace("px","");this.specialLayoutType===ca?(b=2*x,_=2*R,k=2*D+2,w=2*L+2):this.specialLayoutType===ua&&(b=3*x,_=3*R,k=3*D+4,w=3*L+4),T.style.width=b+"px",T.style.height=_+"px",E.style.width=k+"px",E.style.height=w+"px",C.style.width=k+"px",C.style.height=w+"px",S.player&&S.player.resize(),u=this._getSpecialMaxSplit()}for(var I=u;I1}))}},{key:"_sortWindows",value:function(){for(var e=[],t=0;t1&&(this.windowList.forEach((function(e){i.$playerBorder.style.display="block",e.$playerBorder.style.border="1px solid ".concat(t._opt.style.border)})),this._opt.showSelectedBorder&&(i.$playerBorder.style.border="1px solid ".concat(this._opt.style.borderSelect)))):this.debug.warn(this.LOG_TAG,"_handleWindowSelect() ".concat(e," is not exist")),1===this._opt.split&&(i.$playerBorder.style.display="none")}},{key:"_handleWindowContainerFullscreen",value:function(e,t){var i=this._getWindowItem(e);if(i){if(ao(t)&&t===i.isContainerFullscreen)return;if(this._opt.draggable)i.isContainerFullscreen?(i.$playerContainer.setAttribute("fullscreen","0"),i.$playerContainer.style.fullscreen="0"):(i.$playerContainer.setAttribute("fullscreen","1"),i.$playerContainer.style.fullscreen="1");else if(i.isContainerFullscreen)i.$playerContainer.style.position="relative",i.$playerContainer.style.left="auto",i.$playerContainer.style.top="auto",i.$playerContainer.style.zIndex="auto",i.$playerContainer.style.width=i.prevInfo.playerContainerWidth,i.$playerContainer.style.height=i.prevInfo.playerContainerHeight,i.$player.style.width=i.prevInfo.playerWidth,i.$player.style.height=i.prevInfo.playerHeight,this.getSelectedWindowUuid()===i.uuid&&(i.$playerBorder.style.display="block");else{var r=this._getContainerRect(),a=r.width,n=r.height;i.prevInfo={playerContainerWidth:i.$playerContainer.style.width,playerContainerHeight:i.$playerContainer.style.height,playerWidth:i.$player.style.width,playerHeight:i.$player.style.height},i.$playerContainer.style.position="absolute",i.$playerContainer.style.top="0",i.$playerContainer.style.left="0",i.$playerContainer.style.zIndex="10",i.$playerContainer.style.width=a+"px",i.$playerContainer.style.height=n+"px",i.$player.style.width=a+"px",i.$player.style.height=n+"px",i.$playerBorder.style.display="none"}i.isContainerFullscreen=!i.isContainerFullscreen,i.player&&i.player.resize()}else this.debug.warn(this.LOG_TAG,"handleWindowContainerFullscreen() ".concat(e," is not exist"))}},{key:"_handleFullscreenResize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,i=this._getContainerRect(),r=0,a=setInterval((function(){var n=sn.isFullscreen,o=e._getContainerRect(),s={width:screen.width,height:screen.height};e.debug.log(e.LOG_TAG,"isInFullscreen ".concat(n," , checkRectInterval times : ").concat(r," nowRect:").concat(JSON.stringify(o),", prevRect:").concat(JSON.stringify(i)," ,window screen rect:").concat(JSON.stringify(s)));var l=o.width===i.width&&o.height===i.height,c=!n||s.width-o.width<10&&s.height-o.height<10;if(l&&c||r>=t)return e.resize(),void clearInterval(a);i=o,r++}),1e3)}},{key:"_listenFullscreenChange",value:function(){var t=this;try{var i=function(e){_o(e)===t.$container&&(t.emit(la.multiFullscreen,sn.isFullscreen),sn.isFullscreen||-1!==window.navigator.userAgent.indexOf("Edg")?t._handleFullscreenResize():t.resize())};sn.on("change",i),this.events.destroys.push((function(){sn.off("change",i)}))}catch(e){}}},{key:"play",value:function(e,t,i){var r=this;return new Promise((function(a,n){(Xn(t)||vo(t))&&(i=t,t={});var o=r._getWindowItem(i);if(o)if(o.player)o.player.play(e,t).then((function(){a()})).catch((function(e){n(e)}));else{var s=r._createPlayer(o);o.player=s,s.play(e,t).then((function(){a()})).catch((function(e){n(e)}))}else n("play() windowIndex ".concat(selectedWindowIndex," is not exist"))}))}},{key:"getOption",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getOption():(this.debug.warn(this.LOG_TAG,"getOption() windowIndex ".concat(e," is not exist")),{})}},{key:"setDebug",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setDebug(e):this.debug.warn(this.LOG_TAG,"setDebug() windowIndex ".concat(t," is not exist"))}},{key:"mute",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.mute():this.debug.warn(this.LOG_TAG,"mute() windowIndex ".concat(e," is not exist"))}},{key:"cancelMute",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.cancelMute():this.debug.warn(this.LOG_TAG,"cancelMute() windowIndex ".concat(e," is not exist"))}},{key:"setVolume",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setVolume(e):this.debug.warn(this.LOG_TAG,"setVolume() windowIndex ".concat(t," is not exist"))}},{key:"audioResume",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.audioResume():this.debug.warn(this.LOG_TAG,"audioResume() windowIndex ".concat(e," is not exist"))}},{key:"setTimeout",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setTimeout(e):this.debug.warn(this.LOG_TAG,"setTimeout() windowIndex ".concat(t," is not exist"))}},{key:"setScaleMode",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setScaleMode(e):this.debug.warn(this.LOG_TAG,"setScaleMode() windowIndex ".concat(t," is not exist"))}},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){var n=e._getWindowItem(i);n&&n.player?n.player.pause(t).then((function(){r()})).catch((function(e){a(e)})):a("pause() windowIndex ".concat(i," is not exist"))}))}},{key:"close",value:function(e){var t=this;return new Promise((function(i,r){var a=t._getWindowItem(e);a&&a.player?a.player.close().then((function(){i()})).catch((function(e){r(e)})):r("close() windowIndex ".concat(e," is not exist"))}))}},{key:"clearView",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.clearView():this.debug.warn(this.LOG_TAG,"clearView() windowIndex ".concat(e," is not exist"))}},{key:"setStreamQuality",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setStreamQuality(e):this.debug.warn(this.LOG_TAG,"setStreamQuality() windowIndex ".concat(t," is not exist"))}},{key:"resize",value:function(){this._opt.draggable?this._updateWindows$2():this._updateWindows()}},{key:"setBufferTime",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setBufferTime(e):this.debug.warn(this.LOG_TAG,"setBufferTime() windowIndex ".concat(t," is not exist"))}},{key:"setBufferDelayTime",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setBufferDelayTime(e):this.debug.warn(this.LOG_TAG,"setBufferDelayTime() windowIndex ".concat(t," is not exist"))}},{key:"setRotate",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setRotate(e):this.debug.warn(this.LOG_TAG,"setRotate() windowIndex ".concat(t," is not exist"))}},{key:"setMirrorRotate",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setMirrorRotate(e):this.debug.warn(this.LOG_TAG,"setMirrorRotate() windowIndex ".concat(t," is not exist"))}},{key:"updateIsEmitSEI",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.updateIsEmitSEI(e):this.debug.warn(this.LOG_TAG,"updateIsEmitSEI() windowIndex ".concat(t," is not exist"))}},{key:"setAspectRatio",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setAspectRatio(e):this.debug.warn(this.LOG_TAG,"setAspectRatio() windowIndex ".concat(t," is not exist"))}},{key:"hasLoaded",value:function(e){var t=this._getWindowItem(e);return!(!t||!t.player)&&t.player.hasLoaded()}},{key:"setKeepScreenOn",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.setKeepScreenOn():this.debug.warn(this.LOG_TAG,"setKeepScreenOn() windowIndex ".concat(e," is not exist"))}},{key:"setFullscreen",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setFullscreen(e):this.debug.warn(this.LOG_TAG,"setFullscreen() windowIndex ".concat(t," is not exist"))}},{key:"screenshot",value:function(e,t){var i=this._getWindowItem(t);return i&&i.player?i.player.screenshot(e.filename,e.format,e.quality,e.type):null}},{key:"screenshotWatermark",value:function(e,t){var i=this._getWindowItem(t);return i&&i.player?i.player.screenshotWatermark(e):null}},{key:"startRecord",value:function(e,t,i){var r=this;return new Promise((function(a,n){var o=r._getWindowItem(i);o&&o.player?o.player.startRecord(e,t).then((function(){a()})).catch((function(e){n(e)})):(r.debug.warn(r.LOG_TAG,"startRecord() windowIndex ".concat(i," is not exist")),n("windowIndex ".concat(i," is not exist")))}))}},{key:"stopRecordAndSave",value:function(e,t,i){var r=this;return new Promise((function(a,n){var o=r._getWindowItem(i);o&&o.player?o.player.stopRecordAndSave(e,t).then((function(e){a(e)})).catch((function(e){n(e)})):(r.debug.warn(r.LOG_TAG,"stopRecordAndSave() windowIndex ".concat(i," is not exist")),n("windowIndex ".concat(i," is not exist")))}))}},{key:"isPlaying",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.isPlaying():(this.debug.warn(this.LOG_TAG,"isPlaying() windowIndex ".concat(e," is not exist")),!1)}},{key:"isLoading",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.isLoading():(this.debug.warn(this.LOG_TAG,"isLoading() windowIndex ".concat(e," is not exist")),!1)}},{key:"isPaused",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.isPaused():(this.debug.warn(this.LOG_TAG,"windowIndex ".concat(e," is not exist")),!1)}},{key:"isMute",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.isMute():(this.debug.warn(this.LOG_TAG,"isMute() windowIndex ".concat(e," is not exist")),!1)}},{key:"isRecording",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.isRecording():(this.debug.warn(this.LOG_TAG,"isRecording() windowIndex ".concat(e," is not exist")),!1)}},{key:"clearBufferDelay",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.clearBufferDelay():this.debug.warn(this.LOG_TAG,"clearBufferDelay() windowIndex ".concat(e," is not exist"))}},{key:"setNetworkDelayTime",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setNetworkDelayTime(e):this.debug.warn(this.LOG_TAG,"setNetworkDelayTime() windowIndex ".concat(t," is not exist"))}},{key:"getDecodeType",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getDecodeType():(this.debug.warn(this.LOG_TAG,"getDecodeType() windowIndex ".concat(e," is not exist")),null)}},{key:"getRenderType",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getRenderType():(this.debug.warn(this.LOG_TAG,"windowIndex ".concat(e," is not exist")),null)}},{key:"getAudioEngineType",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getAudioEngineType():(this.debug.warn(this.LOG_TAG,"windowIndex ".concat(e," is not exist")),null)}},{key:"getPlayingTimestamp",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getPlayingTimestamp():(this.debug.warn(this.LOG_TAG,"windowIndex ".concat(e," is not exist")),null)}},{key:"getStatus",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getStatus():(this.debug.warn(this.LOG_TAG,"getStatus() windowIndex ".concat(e," is not exist")),null)}},{key:"getPlayType",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getPlayType():(this.debug.warn(this.LOG_TAG,"getPlayType() windowIndex ".concat(e," is not exist")),null)}},{key:"togglePerformancePanel",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.togglePerformancePanel(e):this.debug.warn(this.LOG_TAG,"togglePerformancePanel() windowIndex ".concat(t," is not exist"))}},{key:"openZoom",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.openZoom():this.debug.warn(this.LOG_TAG,"openZoom() windowIndex ".concat(e," is not exist"))}},{key:"closeZoom",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.closeZoom():this.debug.warn(this.LOG_TAG,"closeZoom() windowIndex ".concat(e," is not exist"))}},{key:"isZoomOpen",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.isZoomOpen():(this.debug.warn(this.LOG_TAG,"isZoomOpen() windowIndex ".concat(e," is not exist")),!1)}},{key:"expandZoom",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.expandZoom():this.debug.warn(this.LOG_TAG,"expandZoom() windowIndex ".concat(e," is not exist"))}},{key:"narrowZoom",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.narrowZoom():this.debug.warn(this.LOG_TAG,"narrowZoom() windowIndex ".concat(e," is not exist"))}},{key:"getCurrentZoomIndex",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getCurrentZoomIndex():(this.debug.warn(this.LOG_TAG,"getCurrentZoomIndex() windowIndex ".concat(e," is not exist")),0)}},{key:"setNakedFlowFps",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setNakedFlowFps(e):this.debug.warn(this.LOG_TAG,"setNakedFlowFps() windowIndex ".concat(t," is not exist"))}},{key:"updateDebugLevel",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.updateDebugLevel(e):this.debug.warn(this.LOG_TAG,"updateDebugLevel() windowIndex ".concat(t," is not exist"))}},{key:"updateWatermark",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.updateWatermark(e):this.debug.warn(this.LOG_TAG,"updateWatermark() windowIndex ".concat(t," is not exist"))}},{key:"removeWatermark",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.removeWatermark():this.debug.warn(this.LOG_TAG,"removeWatermark() windowIndex ".concat(e," is not exist"))}},{key:"updateFullscreenWatermark",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.updateFullscreenWatermark(e):this.debug.warn(this.LOG_TAG,"updateFullscreenWatermark() windowIndex ".concat(t," is not exist"))}},{key:"removeFullscreenWatermark",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.removeFullscreenWatermark():this.debug.warn(this.LOG_TAG,"removeFullscreenWatermark() windowIndex ".concat(e," is not exist"))}},{key:"faceDetectOpen",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.faceDetectOpen():this.debug.warn(this.LOG_TAG,"faceDetectOpen() windowIndex ".concat(e," is not exist"))}},{key:"faceDetectClose",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.faceDetectClose():this.debug.warn(this.LOG_TAG,"faceDetectClose() windowIndex ".concat(e," is not exist"))}},{key:"objectDetectOpen",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.objectDetectOpen():this.debug.warn(this.LOG_TAG,"objectDetectOpen() windowIndex ".concat(e," is not exist"))}},{key:"objectDetectClose",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.objectDetectClose():this.debug.warn(this.LOG_TAG,"objectDetectClose() windowIndex ".concat(e," is not exist"))}},{key:"sendWebsocketMessage",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.sendWebsocketMessage(e):this.debug.warn(this.LOG_TAG,"sendWebsocketMessage() windowIndex ".concat(t," is not exist"))}},{key:"addContentToCanvas",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.addContentToCanvas(e):this.debug.warn(this.LOG_TAG,"addContentToCanvas() windowIndex ".concat(t," is not exist"))}},{key:"clearContentToCanvas",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.clearContentToCanvas():this.debug.warn(this.LOG_TAG,"clearContentToCanvas() windowIndex ".concat(e," is not exist"))}},{key:"setControlHtml",value:function(e,t){var i=this._getWindowItem(t);i&&i.player?i.player.setControlHtml(e):this.debug.warn(this.LOG_TAG,"setControlHtml() windowIndex ".concat(t," is not exist"))}},{key:"clearControlHtml",value:function(e){var t=this._getWindowItem(e);t&&t.player?t.player.clearControlHtml():this.debug.warn(this.LOG_TAG,"clearControlHtml() windowIndex ".concat(e," is not exist"))}},{key:"getFlvMetaData",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getFlvMetaData():(this.debug.warn(this.LOG_TAG,"getFlvMetaData() windowIndex ".concat(e," is not exist")),null)}},{key:"getExtendBtnList",value:function(e){var t=this._getWindowItem(e);return t&&t.player?t.player.getExtendBtnList():(this.debug.warn(this.LOG_TAG,"getExtendBtnList() windowIndex ".concat(e," is not exist")),null)}},{key:"updateAiFaceDetectInterval",value:function(e,t){var i=this._getWindowItem(t);if(!i||!i.player)return this.debug.warn(this.LOG_TAG,"updateAiFaceDetectInterval() windowIndex ".concat(t," is not exist")),null;i.player.updateAiFaceDetectInterval(e)}},{key:"updateAiFaceDetectLevel",value:function(e,t){var i=this._getWindowItem(t);if(!i||!i.player)return this.debug.warn(this.LOG_TAG,"updateAiFaceDetectLevel() windowIndex ".concat(t," is not exist")),null;i.player.updateAiFaceDetectLevel(e)}},{key:"updateAiObjectDetectInterval",value:function(e,t){var i=this._getWindowItem(t);if(!i||!i.player)return this.debug.warn(this.LOG_TAG,"updateAiObjectDetectInterval() windowIndex ".concat(t," is not exist")),null;i.player.updateAiObjectDetectInterval(e)}},{key:"updateAiObjectDetectLevel",value:function(e,t){var i=this._getWindowItem(t);if(!i||!i.player)return this.debug.warn(this.LOG_TAG,"updateAiObjectDetectLevel() windowIndex ".concat(t," is not exist")),null;i.player.updateAiObjectDetectLevel(e)}},{key:"setCryptoKeyUrl",value:function(e,t){var i=this._getWindowItem(t);if(!i||!i.player)return this.debug.warn(this.LOG_TAG,"setCryptoKeyUrl() windowIndex ".concat(t," is not exist")),null;i.player.setCryptoKeyUrl(e)}},{key:"showErrorMessageTips",value:function(e,t){var i=this._getWindowItem(t);if(!i||!i.player)return this.debug.warn(this.LOG_TAG,"showErrorMessageTips() windowIndex ".concat(t," is not exist")),null;i.player.showErrorMessageTips(e)}},{key:"hideErrorMessageTips",value:function(e){var t=this._getWindowItem(e);if(!t||!t.player)return this.debug.warn(this.LOG_TAG,"hideErrorMessageTips() windowIndex ".concat(e," is not exist")),null;t.player.hideErrorMessageTips()}},{key:"destroySingle",value:function(e){var t=this;return new Promise((function(i,r){var a=t._getWindowItem(e);a?a.player&&a.player.destroy().then((function(){a.player=null,i()})).catch((function(e){r(e)})):(r("windowIndex is not exist"),t.debug.warn(t.LOG_TAG,"destroySingle() windowIndex ".concat(e," is not exist")))}))}},{key:"initSingle",value:function(e){var t=this;return new Promise((function(i,r){var a=t._getWindowItem(e);if(a)if(a.player)a.player.destroy().then((function(){a.player=null;var e=t._createPlayer(a);a.player=e,i()})).catch((function(e){r(e)}));else{var n=t._createPlayer(a);a.player=n,i()}else r("windowIndex is not exist"),t.debug.warn(t.LOG_TAG,"destroySingle() windowIndex ".concat(e," is not exist"))}))}},{key:"setFullscreenMulti",value:function(e){var t=this;return new Promise((function(i,r){if(t.debug.log(t.LOG_TAG,"setFullscreenMulti",e),e)try{sn.request(t.$container).then((function(){i()})).catch((function(e){t.debug.error(t.LOG_TAG,"fullscreen request inner error",e),r(e)}))}catch(e){t.debug.error(t.LOG_TAG,"fullscreen request error",e),r(e)}else try{sn.exit().then((function(){i()})).catch((function(e){t.debug.error(t.LOG_TAG,"fullscreen exit inner error",e),r(e)}))}catch(e){t.debug.error(t.LOG_TAG,"fullscreen exit error",e),r(e)}}))}},{key:"toggleSingleWindowContainerFullscreen",value:function(e,t){var i=this;this.debug.log(this.LOG_TAG,"setSingleWindowContainerFullscreen",t);var r=this._getWindowItem(t);this.windowList.forEach((function(e){e.uuid!==r.uuid&&i._handleWindowContainerFullscreen(e.uuid,!1)})),this._handleWindowContainerFullscreen(r.uuid,e)}},{key:"selectWindow",value:function(e){this.debug.log(this.LOG_TAG,"selectWindow",e),this._handleWindowSelect(e)}},{key:"arrangeWindow",value:function(e){this.debug.log(this.LOG_TAG,"arrangeWindow",e),this._innerArrangeWindow(e)}},{key:"_innerArrangeWindow",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)if([ca,ua].includes(e))this._arrangeSpecialWindow(e);else{if(this._opt.split===e&&null===this.specialLayoutType&&No(t))return void this.debug.warn(this.LOG_TAG,"arrangeWindow() split ".concat(e," is not changed"));this.specialLayoutType=null,this._arrangeWindow(e)}else this.debug.warn(this.LOG_TAG,"arrangeWindow() split ".concat(e," is not valid"))}},{key:"_arrangeWindow",value:function(e){(e=qn(e))<1||!Xn(e)?this.debug.warn(this.LOG_TAG,"arrangeWindow() split ".concat(e," is not valid")):(e>this._opt.maxSplit&&(e=this._opt.maxSplit),this._opt.split=e,this.currentWindowIndex=0,this._opt.draggable?this._updateWindows$2():this._updateWindows(),this._handleWindowSelect(this.currentWindowIndex))}},{key:"_arrangeSpecialWindow",value:function(e){this._opt.maxSplit<=3&&e===ua||this._opt.maxSplit<=2&&e===ca?this.debug.warn(this.LOG_TAG,"_arrangeSpecialWindow() type ".concat(e," is not valid because maxSplit is ").concat(this._opt.maxSplit)):this.specialLayoutType&&this.specialLayoutType===e?this.debug.warn(this.LOG_TAG,"_arrangeSpecialWindow() type ".concat(e," is not changed")):(this.specialLayoutType=e,e===ca?this._arrangeWindow(3):e===ua?this._arrangeWindow(4):this.debug.warn(this.LOG_TAG,"_arrangeSpecialWindow() type ".concat(e," is not valid")))}},{key:"getCurrentSplit",value:function(){return this.specialLayoutType?this.specialLayoutType:this._opt.split}},{key:"_getCurrentMaxSplit",value:function(){if(this.specialLayoutType){var e=0;return this.specialLayoutType===ca?e=9:this.specialLayoutType===ua&&(e=16),e}return this._opt.split*this._opt.split}},{key:"_getSpecialMaxSplit",value:function(){var e=0;return this.specialLayoutType===ca?e=6:this.specialLayoutType===ua&&(e=8),e}},{key:"getSelectedWindowIndex",value:function(){return this.currentWindowIndex}},{key:"getSelectedWindowUuid",value:function(){return this.currentWindowUuid}},{key:"getWindowItem",value:function(e){var t=this._getWindowItem(e),i=null;return t&&(i={index:e,$player:t.$player,$playerContainer:t.$playerContainer,player:t.player,uuid:t.uuid}),i}},{key:"getNextWindowItem",value:function(e){var t=null,i=this._getWindowItem(e);if(i){var r=this._getWindowUuidList()||[],a=r.findIndex((function(e){return e===i.uuid}));if(a0){var n=a-1,o=this._findWindowItemByUuid(r[n]);o&&(t={index:n,$player:o.$player,$playerContainer:o.$playerContainer,player:o.player,uuid:o.uuid})}}return t}},{key:"isWindowItemHasInitPlayer",value:function(e){var t=!1,i=this._getWindowItem(e);return i&&i.player&&(t=!0),t}},{key:"_getWindowItem",value:function(e){var t=null,i=vo(e)&&16===e.length;return t=i||!Xn(e)?this._findWindowItemByUuid(i?e:this.currentWindowUuid):this.windowList[e],t}},{key:"_getWindowUuidList",value:function(){var e=this;return this.windowList.filter((function(t,i){return i