ezuikit-flv 2.0.2-alpha.2 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -2
- package/decoder.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
*
|
|
3
|
-
* EzuikitFlv.js v2.0.
|
|
3
|
+
* EzuikitFlv.js v2.0.2
|
|
4
4
|
* Copyright (c) 2025-10-16 Ezviz-OpenBiz
|
|
5
5
|
*
|
|
6
6
|
* https://github.com/Ezviz-OpenBiz/EZUIKit-flv
|
|
@@ -46,4 +46,4 @@ const I="ezplayer",O="PAUSE_TIMING_HEADER_FOOTER",B=["rec","cloudRec","cloudReco
|
|
|
46
46
|
* Copyright (c) 2024-7-11 Ezviz-OpenBiz
|
|
47
47
|
* Released under MIT the License.
|
|
48
48
|
*
|
|
49
|
-
*/var $i,Fi,Ni,Vi,ji=($i="undefined"!=typeof self?self:window,Fi={navigator:void 0!==$i.navigator?$i.navigator:{userAgent:""},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},Ni={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t,i=(null==(t=Fi.navigator)?void 0:t.userAgent)||"",n=Ni.getMatchMap(i);for(var r in Fi.infoMap)for(var o=0;o<Fi.infoMap[r].length;o++){var a=Fi.infoMap[r][o];n[a]&&(e[r]=a)}},getOS:function(){var e=this;return Ni.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,t=Fi.navigator.userAgent||"";e.osVersion="";var i={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return"function"==typeof i[e.os]&&(e.osVersion=i[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"vertical":"horizontal"},getDeviceType:function(){var e=this;return e.device="PC",Ni.matchInfoMap(e),e.device},getNetwork:function(){var e,t,i,n;return null==(e=(null==(t=navigator)?void 0:t.connection)||(null==(i=navigator)?void 0:i.mozConnection)||(null==(n=navigator)?void 0:n.webkitConnection))?void 0:e.effectiveType},getLanguage:function(){var e,t,i;return this.language=((i=((null==(e=Fi.navigator)?void 0:e.browserLanguage)||(null==(t=Fi.navigator)?void 0:t.language)).split("-"))[1]&&(i[1]=i[1].toUpperCase()),i.join("_")),this.language},createFingerprint:function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),n=e||window.location.host;i.textBaseline="top",i.font="14px 'Arial'",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",i.fillText(n,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(n,4,17);var r=t.toDataURL().replace("data:image/png;base64,","");return function(e){var t,i,n,r="";for(t=0,i=(e+="").length;t<i;t++)r+=(n=e.charCodeAt(t).toString(16)).length<2?"0"+n:n;return r}(atob(r).slice(-16,-12))},getBrowserInfo:function(){var e=this;Ni.matchInfoMap(e);var t=Fi.navigator.userAgent||"",i=function(e,t){var i=Fi.navigator.mimeTypes;for(var n in i)if(i[n][e]==t)return!0;return!1},n=Ni.getMatchMap(t),r=!1;if($i.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");+o>36&&$i.showModalDialog?r=!0:+o>45&&(r=i("type","application/vnd.chromium.remoting-viewer"))}if(n.Baidu&&n.Opera&&(n.Baidu=!1),n.Mobile&&(n.Mobile=!t.includes("iPad")),r&&(i("type","application/gameplugin")||Fi.navigator&&void 0===Fi.navigator.connection.saveData?n["360SE"]=!0:n["360EE"]=!0),n.IE||n.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 105:break;case 102:n["360EE"]=!0;break;case 104:n["360SE"]=!0}var a={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){return{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[+navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",a[e.browser]&&(e.browserVersion=a[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Edge"==e.browser&&(e.engine="EdgeHTML"),"Chrome"==e.browser&&parseInt(e.browserVersion)>27&&(e.engine="Blink"),"Opera"==e.browser&&parseInt(e.browserVersion)>12&&(e.engine="Blink"),"Yandex"==e.browser&&(e.engine="Blink"),e.browser+" (version: "+e.browserVersion+"; kernel: "+e.engine+")"}},Vi={DeviceInfoObj:function(e){var t,i=function(t){var i;null==(i=e.info)||i.forEach((function(e){e.toLowerCase()===t.toLowerCase()&&(r[t]=n[t])}))};e=e||{domain:""};var n={deviceType:Ni.getDeviceType(),OS:Ni.getOS(),OSVersion:Ni.getOSVersion(),sh:$i.screen.height,sw:$i.screen.width,lang:Ni.getLanguage(),netWork:Ni.getNetwork(),orientation:Ni.getOrientationStatu(),browserInfo:Ni.getBrowserInfo(),fingerprint:Ni.createFingerprint(e.domain),userAgent:null==(t=Fi.navigator)?void 0:t.userAgent};if(!e.info||0===e.info.length)return n;var r={};for(var o in n)i(o);return r}},{getDeviceInfo:function(e){return Vi.DeviceInfoObj(e)}}),Qi=function(){function e(){}return e.add=function(t,i){e.queues.push({url:t,data:i})},e.fire=function(){if(e.queues&&0!==e.queues.length){e.isStop=!1;var t=e.queues[0];t.url&&e.api.report(t.data),e.queues.splice(0,1),e.fire()}else e.isStop=!0},e}();Qi.isStop=!0,Qi.queues=[];var Gi=function(){function e(e){this.url=e}var t=e.prototype;return t.report=function(e){this.checkUrl(this.url)&&this.sendInfo(e)},t.sendInfo=function(e){navigator.sendBeacon?this.sendBeacon(this.url,e):this.sendImage(this.url,e)},t.sendImage=function(e,t){var i=this.changeJSON2Query(t),n=new Image;n.onload=n.onerror=function(){n=null},n.src=e+"?"+i+"&random="+Math.random()},t.sendBeacon=function(e,t){try{navigator.sendBeacon(e,this.formatParamsByURLSearchParams(t))}catch(e){}},t.formatParamsByURLSearchParams=function(e){var t=new URLSearchParams;for(var i in e)"object"==typeof e[i]&&(e[i]=JSON.stringify(e[i])),t.append(i,e[i]);return t},t.changeJSON2Query=function(e){var t="";for(var i in e){""!=t&&(t+="&");var n=e[i];t+=i+"="+encodeURIComponent("object"==typeof n?JSON.stringify(n):n)}return t},t.checkUrl=function(e){return!!e&&/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)},e}();function zi(){return zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},zi.apply(this,arguments)}var Hi=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),Qi.api=new Gi(e.url)}var t=e.prototype;return t.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),Qi.isStop&&Qi.fire()),this},t.setForbidden=function(e){this.options.forbidden=e},t.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=zi({},this.extendsInfo||{},e)},t._handleRecordError=function(e){try{var t=this._handleErrorInfo(e);Qi.add(this.options.url,t)}catch(e){}},t._handleErrorInfo=function(e){var t=this._getExtendsInfo(),i=zi({st:(new Date).getTime()},t,e);return i.clientInfo=this.clientInfo,i},t._getExtendsInfo=function(){try{var e,t={},i=this.extendsInfo||{};for(var n in"function"==typeof i.getDynamic&&(e=i.getDynamic()),"[object Object]"===Object.prototype.toString.call(e)&&(i=zi({},i,e)),i)"function"!=typeof i[n]&&(t[n]=i[n]);return t}catch(e){return{}}},t._getDeviceInfo=function(){try{var e=ji.getDeviceInfo();return JSON.stringify(e)}catch(e){return""}},e}();function Wi(e){if(/http[s]?:\/\/|ws[s]?:\/\//.test(e)){const t=e.split("?")[1],i=t?t.split("&"):[],n={};for(let e=0;e<i.length;++e){const[t,r]=i[e].split("=");n[t]=n[t]||decodeURIComponent(r)}try{const t=e.split(".flv")[0].split("/"),i=t[t.length-1].split("_");t.length>0&&i[0]&&i[1]&&i[2]&&(n.serial=i[0],n.no=i[1],n.bitstream=i[2])}catch(e){}return n}return{}}class qi{static initMonitor(e){qi.collect=new Hi({forbidden:e,url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",jsError:!1,promiseError:!1,resourceError:!1,extendsInfo:{protocol:"flv",v:"2.0.1-alpha.0"}})}static report(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qi.collect||qi.initMonitor();try{const i=Wi(qi.url);qi.collect.send({url:qi.url,serial:i.serial,no:i.no,action:e,logInfo:t})}catch(e){}}}class Ki extends Ui{constructor(e,t){super(e,t,fi),this._opt.useMSE=!1,this._loadingTimeoutDelayTimer=null,this._opt.hasAudio&&(this.audio=new mi(this)),this.decoderWorker=new yi(this),this.stream=null,this.demux=null,this._muted=this._opt.muted,oi()&&(this.keepScreenOn=new ki(this)),this._enableSoundOnUserInteraction=this._enableSoundOnUserInteraction.bind(this),window.addEventListener("click",this._enableSoundOnUserInteraction),window.addEventListener("pointerdown",this._enableSoundOnUserInteraction),window.addEventListener("touchstart",this._enableSoundOnUserInteraction),window.addEventListener("keydown",this._enableSoundOnUserInteraction),document.body.addEventListener("click",this._enableSoundOnUserInteraction),document.body.addEventListener("pointerdown",this._enableSoundOnUserInteraction),document.body.addEventListener("touchstart",this._enableSoundOnUserInteraction),document.body.addEventListener("keydown",this._enableSoundOnUserInteraction),this.on(Nt.audioInfo,(e=>{var t;e.encType&&!this.muted&&(null===(t=this.audio)||void 0===t?void 0:t.isStateRunning())&&setTimeout((()=>{var e,t;null===(t=(e=this.audio).audioEnabled)||void 0===t||t.call(e,!0)}),100)}))}destroy(){var e,t,i,n,r,o;this._loading=!1,this._playing=!1,this._hasLoaded=!1,this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.audio&&(null===(t=(e=this.audio).destroy)||void 0===t||t.call(e),this.audio=null),this.stream&&(null===(n=(i=this.stream).destroy)||void 0===n||n.call(i),this.stream=null),this.demux&&(null===(o=null===(r=this.demux)||void 0===r?void 0:r.destroy)||void 0===o||o.call(r),this.demux=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.releaseWakeLock(),this.keepScreenOn=null,this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,window.removeEventListener("click",this._enableSoundOnUserInteraction),window.removeEventListener("pointerdown",this._enableSoundOnUserInteraction),window.removeEventListener("touchstart",this._enableSoundOnUserInteraction),window.removeEventListener("keydown",this._enableSoundOnUserInteraction),document.body.removeEventListener("click",this._enableSoundOnUserInteraction),document.body.removeEventListener("pointerdown",this._enableSoundOnUserInteraction),document.body.removeEventListener("touchstart",this._enableSoundOnUserInteraction),document.body.removeEventListener("keydown",this._enableSoundOnUserInteraction),super.destroy()}set loaded(e){this._hasLoaded=e}get loaded(){return this._hasLoaded}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(Nt.playing,e),this.emit(Nt.volumechange,this.volume,this.muted),e?this.emit(Nt.play):this.emit(Nt.pause))}get playing(){return this._playing}get muted(){return this._muted}set muted(e){this.audio&&(this.audio.muted=e),super._updateMuted(e)}get volume(){return this._volume}set volume(e){this.audio&&(this.audio.volume=e),super._updateVolume(e)}set loading(e){this.loading!==e&&(this._loading=e,this.emit(Nt.loading,this._loading),e||this.emit(Nt.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e,this._opt.useWCS||this._opt.useMSE||this.audioTimestamp&&this.videoTimestamp&&this.audio&&this.audio.emit(Nt.videoSyncAudio,{audioTimestamp:this.audioTimestamp,videoTimestamp:this.videoTimestamp,diff:this.audioTimestamp-this.videoTimestamp}))}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!0===this._opt.debug}_init(){return new Promise(((e,t)=>{this.stream||(this.stream=new gi(this)),this.audio||this._opt.hasAudio&&(this.audio=new mi(this)),this.demux||(this.demux=new Ci(this)),this.decoderWorker?e():(this.decoderWorker=new yi(this),this.once(Nt.decoderWorkerInit,(()=>{e()})))}))}play(e){return this._opt=Object.assign({},this._opt,e||{}),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{if(!this._opt.url)return t();this.loading=!0,this.playing=!1,this._times.playInitStart=ii(),this._init().then((()=>{this._times.playStart=ii(),this._opt.muted||(this.muted=!1),this.enableWakeLock();try{this.stream.fetchStream(this._opt.url,this._opt)}catch(e){}this.checkLoadingTimeout(),this.stream.once(Nt.streamError,(e=>{this.stream&&(this.stream.destroy(),this.stream=null),this.clearCheckLoadingTimeout(),this.emit(Nt.streamError,e),this.emit(Nt.delayTimeout,e),t(e)})),this.stream.once(Nt.streamEnd,(()=>{t()})),this.stream.once(Nt.streamSuccess,(()=>{this.clearCheckLoadingTimeout(),this.emit(Nt.streamSuccess),e(),this._times.streamResponse=ii(),this.video.play(),this.checkStatsInterval()}))})).catch((e=>{t(e)})),this._resumeAudioAfterPause()}))}close(){return new Promise((e=>{this._close().then((()=>{var t,i;null===(i=null===(t=this.video)||void 0===t?void 0:t.clearView)||void 0===i||i.call(t),e()}))}))}_resumeAudioAfterPause(){this._volume&&(this.volume=this._volume)}_close(){return new Promise((e=>{var t,i;this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this.stream&&(this.stream.destroy(),this.stream=null),this.demux&&(this.demux.destroy(),this.demux=null),this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.audio&&(null===(i=(t=this.audio).pause)||void 0===i||i.call(t)),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.playing=!1,this.loading=!1,this.video&&(this.video.resetInit(),this.video.pause(!0)),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:""},setTimeout((()=>{e()}),0)}))}pause(e=!1){return e?this.close():this._close()}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}checkHeartTimeout(){var e;0!==this._opt.heartTimeout&&(this._checkHeartTimeout=setTimeout((()=>{if(this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this.playing){if(0!==this._stats.fps)return;this.pause().then((()=>{this.emit(Nt.timeout,Nt.heartTimeout),this.emit(Nt.heartTimeout)}))}}),1e3*((null===(e=this._opt)||void 0===e?void 0:e.heartTimeout)||5)))}checkStatsInterval(){this._checkStatsInterval=setInterval((()=>{this.updateStats()}),1e3)}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkLoadingTimeout(){0!==this._opt.loadingTimeout&&(this._checkLoadingTimeout=setTimeout((()=>{this.playing||(this.clearCheckLoadingTimeout(),this.pause().then((()=>{this.emit(Nt.timeout,Nt.loadingTimeout),this.emit(Nt.loadingTimeout)})).catch((()=>{})))}),1e3*this._opt.loadingTimeout))}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}clearStatsInterval(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}handleRender(){this.loading&&(this.emit(Nt.start),this.loading=!1),this.clearCheckLoadingTimeout(),this.playing||(this.playing=!0),this.checkHeart()}updateStats(e){e=e||{},this._startBpsTime||(this._startBpsTime=ii()),ai(e.ts)&&(this._stats.ts=e.ts),ai(e.buf)&&(this._stats.buf=e.buf),e.fps&&(this._stats.fps+=1),e.abps&&(this._stats.abps+=e.abps),e.vbps&&(this._stats.vbps+=e.vbps);const t=ii();t-this._startBpsTime<1e3||(this.emit(Nt.stats,this._stats),this._stats.fps=0,this._stats.abps=0,this._stats.vbps=0,this._startBpsTime=t)}resetStats(){this._startBpsTime=null,this._stats={buf:0,fps:0,abps:0,vbps:0,ts:0}}enableWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.enable()}releaseWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.disable()}handlePlayToRenderTimes(){const e=this._times;e.playTimestamp=e.playStart-e.playInitStart,e.streamTimestamp=e.streamStart-e.playStart,e.streamResponseTimestamp=e.streamResponse-e.streamStart,e.demuxTimestamp=e.demuxStart-e.streamResponse,e.decodeTimestamp=e.decodeStart-e.demuxStart,e.videoTimestamp=e.videoStart-e.decodeStart,e.allTimestamp=e.videoStart-e.playInitStart,this.emit(Nt.playToRenderTimes,e)}getOption(){return this._opt}emitError(e,t=""){qi.report(51,{event:e,value:t}),this.emit(Nt.error,e,t),this.emit(e,t)}_enableSoundOnUserInteraction(){var e,t,i;this.muted||(null===(e=this.audio)||void 0===e?void 0:e.isStateSuspended())&&(null===(i=(t=this.audio).audioEnabled)||void 0===i||i.call(t,!0))}}var Yi,Xi={exports:{}};var Zi=(Yi||(Yi=1,function(e,t){!function(t,i){e.exports=i()}(self,(()=>(()=>{var e={62:(e,t,i)=>{var n=i(1465)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},63:(e,t,i)=>{var n=i(4152);e.exports=function(e){return n(e)||null===e}},115:(e,t,i)=>{var n=i(815),r=i(4152),o=i(5727),a=i(452),s=i(6908),l=i(7553),A=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=a(e,d);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw new A("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},219:(e,t,i)=>{var n=i(2719),r=i(7024),o=i(256),a=function(e){return function(t,i,a){var s=n(t),l=o(s);if(0===l)return!e&&-1;var A,d=r(a,l);if(e&&i!=i){for(;l>d;)if((A=s[d++])!=A)return!0}else for(;l>d;d++)if((e||d in s)&&s[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},256:(e,t,i)=>{var n=i(2420);e.exports=function(e){return n(e.length)}},279:(e,t,i)=>{var n=i(815),r=i(5736),o=i(7749),a=i(4985),s=i(9273),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(r(i))return o(n(i,e));throw new l(a(e)+" is not iterable")}},309:(e,t,i)=>{var n=i(9922),r=i(497);e.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}},452:(e,t,i)=>{var n=i(5736),r=i(5599);e.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}},458:(e,t,i)=>{var n=i(526),r=i(6458);e.exports=function(e){if("Function"===n(e))return r(e)}},497:(e,t,i)=>{var n=i(9922),r=i(9211),o=i(526),a=i(7553)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?i:l?o(t):"Object"===(n=o(t))&&r(t.callee)?"Arguments":n}},526:(e,t,i)=>{var n=i(6458),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},550:(e,t,i)=>{i.d(t,{A:()=>n});const n={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},577:(e,t,i)=>{var n=i(3463),r=i(1002),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},594:e=>{var t=TypeError;e.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},605:(e,t,i)=>{var n=i(7553);t.f=n},648:(e,t,i)=>{i(2578),i(4579);var n=i(9364),r=i(1562),o=i(2363),a=i(5057),s=i(815),l=i(6458),A=i(9646),d=i(6666),c=i(3930),u=i(1176),h=i(8873),p=i(1541),f=i(7712),_=i(3587),m=i(2757),v=i(9211),g=i(4347),y=i(7042),b=i(497),E=i(7749),S=i(4152),C=i(6677),w=i(6122),T=i(6330),k=i(279),L=i(9273),I=i(1567),O=i(594),B=i(7553),R=i(986),x=B("iterator"),D="URLSearchParams",M=D+"Iterator",P=_.set,U=_.getterFor(D),$=_.getterFor(M),F=o("fetch"),N=o("Request"),V=o("Headers"),j=N&&N.prototype,Q=V&&V.prototype,G=r.TypeError,z=r.encodeURIComponent,H=String.fromCharCode,W=a("String","fromCodePoint"),q=parseInt,K=l("".charAt),Y=l([].join),X=l([].push),Z=l("".replace),J=l([].shift),ee=l([].splice),te=l("".split),ie=l("".slice),ne=l(/./.exec),re=/\+/g,oe=/^[0-9a-f]+$/i,ae=function(e,t){var i=ie(e,t,t+2);return ne(oe,i)?q(i,16):NaN},se=function(e){for(var t=0,i=128;i>0&&e&i;i>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},Ae=function(e){for(var t=(e=Z(e,re," ")).length,i="",n=0;n<t;){var r=K(e,n);if("%"===r){if("%"===K(e,n+1)||n+3>t){i+="%",n++;continue}var o=ae(e,n+1);if(o!=o){i+=r,n++;continue}n+=2;var a=se(o);if(0===a)r=H(o);else{if(1===a||a>4){i+="�",n++;continue}for(var s=[o],l=1;l<a&&!(3+ ++n>t||"%"!==K(e,n));){var A=ae(e,n+1);if(A!=A){n+=3;break}if(A>191||A<128)break;X(s,A),n+=2,l++}if(s.length!==a){i+="�";continue}var d=le(s);null===d?i+="�":r=W(d)}}i+=r,n++}return i},de=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ue=function(e){return ce[e]},he=function(e){return Z(z(e),de,ue)},pe=f((function(e,t){P(this,{type:M,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=$(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,I(void 0,!0);var n=t[i];switch(e.kind){case"keys":return I(n.key,!1);case"values":return I(n.value,!1)}return I([n.key,n.value],!1)}),!0),fe=function(e){this.entries=[],this.url=null,void 0!==e&&(S(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===K(e,0)?ie(e,1):e:C(e)))};fe.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,n,r,o,a,l,A=this.entries,d=L(e);if(d)for(i=(t=k(e,d)).next;!(n=s(i,t)).done;){if(o=(r=k(E(n.value))).next,(a=s(o,r)).done||(l=s(o,r)).done||!s(o,r).done)throw new G("Expected sequence with length 2");X(A,{key:C(a.value),value:C(l.value)})}else for(var c in e)g(e,c)&&X(A,{key:c,value:C(e[c])})},parseQuery:function(e){if(e)for(var t,i,n=this.entries,r=te(e,"&"),o=0;o<r.length;)(t=r[o++]).length&&(i=te(t,"="),X(n,{key:Ae(J(i)),value:Ae(Y(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],n=0;n<t.length;)e=t[n++],X(i,he(e.key)+"="+he(e.value));return Y(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var _e=function(){m(this,me);var e=P(this,new fe(arguments.length>0?arguments[0]:void 0));A||(this.size=e.entries.length)},me=_e.prototype;if(h(me,{append:function(e,t){var i=U(this);O(arguments.length,2),X(i.entries,{key:C(e),value:C(t)}),A||this.length++,i.updateURL()},delete:function(e){for(var t=U(this),i=O(arguments.length,1),n=t.entries,r=C(e),o=i<2?void 0:arguments[1],a=void 0===o?o:C(o),s=0;s<n.length;){var l=n[s];if(l.key!==r||void 0!==a&&l.value!==a)s++;else if(ee(n,s,1),void 0!==a)break}A||(this.size=n.length),t.updateURL()},get:function(e){var t=U(this).entries;O(arguments.length,1);for(var i=C(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){var t=U(this).entries;O(arguments.length,1);for(var i=C(e),n=[],r=0;r<t.length;r++)t[r].key===i&&X(n,t[r].value);return n},has:function(e){for(var t=U(this).entries,i=O(arguments.length,1),n=C(e),r=i<2?void 0:arguments[1],o=void 0===r?r:C(r),a=0;a<t.length;){var s=t[a++];if(s.key===n&&(void 0===o||s.value===o))return!0}return!1},set:function(e,t){var i=U(this);O(arguments.length,1);for(var n,r=i.entries,o=!1,a=C(e),s=C(t),l=0;l<r.length;l++)(n=r[l]).key===a&&(o?ee(r,l--,1):(o=!0,n.value=s));o||X(r,{key:a,value:s}),A||(this.size=r.length),i.updateURL()},sort:function(){var e=U(this);R(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=U(this).entries,n=y(e,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((t=i[r++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),c(me,x,me.entries,{name:"entries"}),c(me,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),A&&u(me,"size",{get:function(){return U(this).entries.length},configurable:!0,enumerable:!0}),p(_e,D),n({global:!0,constructor:!0,forced:!d},{URLSearchParams:_e}),!d&&v(V)){var ve=l(Q.has),ge=l(Q.set),ye=function(e){if(S(e)){var t,i=e.body;if(b(i)===D)return t=e.headers?new V(e.headers):new V,ve(t,"content-type")||ge(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),w(e,{body:T(0,C(i)),headers:T(0,t)})}return e};if(v(F)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return F(e,arguments.length>1?ye(arguments[1]):{})}}),v(N)){var be=function(e){return m(this,j),new N(e,arguments.length>1?ye(arguments[1]):{})};j.constructor=be,be.prototype=j,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:be})}}e.exports={URLSearchParams:_e,getState:U}},719:(e,t,i)=>{i.d(t,{A:()=>n});const n=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},e.prototype.isSeekable=function(){return this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}},e.prototype._search=function(e,t){var i=0,n=e.length-1,r=0,o=0,a=n;for(t<e[0]&&(i=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===n||t>=e[r]&&t<e[r+1]){i=r;break}e[r]<t?o=r+1:a=r-1}return i},e}()},730:(e,t,i)=>{var n=i(9364),r=i(815);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}})},775:(e,t,i)=>{var n=i(9845),r=i(1562),o=i(4191),a="__core-js_shared__",s=e.exports=r[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.40.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE",source:"https://github.com/zloirock/core-js"})},778:(e,t,i)=>{i(4220)},804:(e,t,i)=>{var n=i(9364),r=i(5057),o=i(4347),a=i(6677),s=i(3463),l=i(9266),A=s("string-to-symbol-registry"),d=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(o(A,t))return A[t];var i=r("Symbol")(t);return A[t]=i,d[i]=t,i}})},815:(e,t,i)=>{var n=i(6898),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},834:(e,t,i)=>{i(6383)},947:(e,t,i)=>{var n=i(9364),r=i(7917),o=i(2809),a=i(7819),s=i(9083);n({target:"Object",stat:!0,forced:!r||o((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},986:(e,t,i)=>{var n=i(8626),r=Math.floor,o=function(e,t){var i=e.length;if(i<8)for(var a,s,l=1;l<i;){for(s=l,a=e[l];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==l++&&(e[s]=a)}else for(var A=r(i/2),d=o(n(e,0,A),t),c=o(n(e,A),t),u=d.length,h=c.length,p=0,f=0;p<u||f<h;)e[p+f]=p<u&&f<h?t(d[p],c[f])<=0?d[p++]:c[f++]:p<u?d[p++]:c[f++];return e};e.exports=o},1002:(e,t,i)=>{var n=i(6458),r=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++r+o,36)}},1031:(e,t,i)=>{var n=i(7553),r=i(6122),o=i(3643).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:r(null)}),e.exports=function(e){s[a][e]=!0}},1068:(e,t,i)=>{var n=i(63),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o("Can't set "+r(e)+" as a prototype")}},1144:(e,t,i)=>{var n=i(815),r=i(4347),o=i(9615),a=i(7677),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||r(e,"flags")||!o(s,e)?t:n(a,e)}},1147:(e,t,i)=>{var n,r,o,a=i(2809),s=i(9211),l=i(4152),A=i(6122),d=i(8125),c=i(3930),u=i(7553),h=i(9845),p=u("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(r=d(d(o)))!==Object.prototype&&(n=r):f=!0),!l(n)||a((function(){var e={};return n[p].call(e)!==e}))?n={}:h&&(n=A(n)),s(n[p])||c(n,p,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},1176:(e,t,i)=>{var n=i(4233),r=i(3643);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}},1209:(e,t,i)=>{var n=i(5057),r=i(6458),o=i(2630),a=i(7819),s=i(7749),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=a.f;return i?l(t,i(e)):t}},1432:(e,t,i)=>{var n=i(6458),r=i(5736);e.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},1454:(e,t,i)=>{i(648)},1464:(e,t,i)=>{var n=i(9364),r=i(4979).map;n({target:"Array",proto:!0,forced:!i(8611)("map")},{map:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},1465:(e,t,i)=>{var n=i(1562),r=i(4152),o=n.document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},1541:(e,t,i)=>{var n=i(3643).f,r=i(4347),o=i(7553)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!r(e,o)&&n(e,o,{configurable:!0,value:t})}},1562:function(e){var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},1567:e=>{e.exports=function(e,t){return{value:e,done:t}}},1684:(e,t,i)=>{var n=i(5736),r=i(9083),o=i(5273),a=i(256),s=TypeError,l="Reduce of empty array with no initial value",A=function(e){return function(t,i,A,d){var c=r(t),u=o(c),h=a(c);if(n(i),0===h&&A<2)throw new s(l);var p=e?h-1:0,f=e?-1:1;if(A<2)for(;;){if(p in u){d=u[p],p+=f;break}if(p+=f,e?p<0:h<=p)throw new s(l)}for(;e?p>=0:h>p;p+=f)p in u&&(d=i(d,u[p],p,c));return d}};e.exports={left:A(!1),right:A(!0)}},1766:(e,t,i)=>{var n=i(9364),r=i(4347),o=i(5727),a=i(4985),s=i(3463),l=i(9266),A=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!o(e))throw new TypeError(a(e)+" is not a symbol");if(r(A,e))return A[e]}})},1900:(e,t,i)=>{e.exports=i(2632).default},1951:(e,t,i)=>{i.d(t,{$_:()=>n,EX:()=>o,EZ:()=>r,Sc:()=>a});var n=function(e,t,i,n,r){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null},r=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),o=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0===this._list.length)return null;var t=this._list,i=0,n=t.length-1,r=0,o=0,a=n;for(e<t[0].dts&&(i=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===n||e>=t[r].dts&&e<t[r+1].dts){i=r;break}t[r].dts<e?o=r+1:a=r-1}return this._list[i]},e}(),a=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t,i=this._list;if(0===i.length)return-2;var n=i.length-1,r=0,o=0,a=n,s=0;if(e<i[0].originalBeginDts)return-1;for(;o<=a;){if((r=o+Math.floor((a-o)/2))===n||e>((null===(t=i[r].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<i[r+1].originalBeginDts){s=r;break}i[r].originalBeginDts<e?o=r+1:a=r-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t,i,n=this._list,r=e,o=this._lastAppendLocation,a=0;-1!==o&&o<n.length&&r.originalBeginDts>=((null===(i=null===(t=n[o])||void 0===t?void 0:t.lastSample)||void 0===i?void 0:i.originalDts)||0)&&(o===n.length-1||o<n.length-1&&r.originalBeginDts<n[o+1].originalBeginDts)?a=o+1:n.length>0&&(a=this._searchNearestSegmentBefore(r.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,0,r)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},2139:(e,t,i)=>{i.d(t,{A:()=>n});const n=i(5307)},2250:(e,t,i)=>{var n=i(6458),r=i(3930),o=Date.prototype,a="Invalid Date",s="toString",l=n(o[s]),A=n(o.getTime);String(new Date(NaN))!==a&&r(o,s,(function(){var e=A(this);return e==e?l(this):a}))},2327:e=>{e.exports={}},2363:(e,t,i)=>{var n=i(1562),r=i(9646),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!r)return n[e];var t=o(n,e);return t&&t.value}},2377:(e,t,i)=>{var n=i(4979).forEach,r=i(5888)("forEach");e.exports=r?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},2382:(e,t,i)=>{var n=i(9364),r=i(815),o=i(9845),a=i(6656),s=i(9211),l=i(7712),A=i(8125),d=i(6641),c=i(1541),u=i(9277),h=i(3930),p=i(7553),f=i(2327),_=i(1147),m=a.PROPER,v=a.CONFIGURABLE,g=_.IteratorPrototype,y=_.BUGGY_SAFARI_ITERATORS,b=p("iterator"),E="keys",S="values",C="entries",w=function(){return this};e.exports=function(e,t,i,a,p,_,T){l(i,t,a);var k,L,I,O=function(e){if(e===p&&M)return M;if(!y&&e&&e in x)return x[e];switch(e){case E:case S:case C:return function(){return new i(this,e)}}return function(){return new i(this)}},B=t+" Iterator",R=!1,x=e.prototype,D=x[b]||x["@@iterator"]||p&&x[p],M=!y&&D||O(p),P="Array"===t&&x.entries||D;if(P&&(k=A(P.call(new e)))!==Object.prototype&&k.next&&(o||A(k)===g||(d?d(k,g):s(k[b])||h(k,b,w)),c(k,B,!0,!0),o&&(f[B]=w)),m&&p===S&&D&&D.name!==S&&(!o&&v?u(x,"name",S):(R=!0,M=function(){return r(D,this)})),p)if(L={values:O(S),keys:_?M:O(E),entries:O(C)},T)for(I in L)(y||R||!(I in x))&&h(x,I,L[I]);else n({target:t,proto:!0,forced:y||R},L);return o&&!T||x[b]===M||h(x,b,M,{name:p}),f[t]=M,L}},2420:(e,t,i)=>{var n=i(4685),r=Math.min;e.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}},2460:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(2139);const r=function(){function e(){}return e.e=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","error",r)),e.ENABLE_ERROR&&(console.error?console.error(r):console.warn?console.warn(r):console.log(r))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},e.d=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","debug",r)),e.ENABLE_DEBUG&&(console.debug?console.debug(r):console.log(r))},e.v=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","verbose",r)),e.ENABLE_VERBOSE&&console.log(r)},e.FORCE_GLOBAL_TAG=!1,e.GLOBAL_TAG="ezuikit-flv",e.ENABLE_CALLBACK=!1,e.emitter=new n.A,e.ENABLE_ERROR=!0,e.ENABLE_INFO=!0,e.ENABLE_WARN=!0,e.ENABLE_DEBUG=!0,e.ENABLE_VERBOSE=!0,e}()},2578:(e,t,i)=>{var n=i(2719),r=i(1031),o=i(2327),a=i(3587),s=i(3643).f,l=i(2382),A=i(1567),d=i(9845),c=i(9646),u="Array Iterator",h=a.set,p=a.getterFor(u);e.exports=l(Array,"Array",(function(e,t){h(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,A(void 0,!0);switch(e.kind){case"keys":return A(i,!1);case"values":return A(t[i],!1)}return A([i,t[i]],!1)}),"values");var f=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!d&&c&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},2630:(e,t,i)=>{var n=i(3430),r=i(6853).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},2632:(e,t,i)=>{i.d(t,{default:()=>F});var n={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},r=i(8098),o={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function a(){return Object.assign({},o)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportMSEH265Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},e.supportNetworkStreamIO=function(){var e=new r.A({},a()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t},e.getNetworkLoaderTypeName=function(){var e=new r.A({},a()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){void 0===e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"===i},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName()||"",t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const l=s;var A=i(9034),d=i(2139),c=i(2460),u=i(8870);const h={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"};i(6041),i(8845),i(6815),i(9688),i(5758),i(5347),i(2578),i(5336),i(1464),i(4742),i(2250),i(6033),i(3813),i(4659),i(3074),i(9917),i(3478),i(5597),i(6263),i(6810),i(6728),i(7958),i(834),i(8862),i(4879),i(778),i(730),i(1454);var p=function(){var e=ENTRY_MODULE,t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.m=e,i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(e){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=i(ENTRY_MODULE);return n.default||n},f="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+f+").*?\\)";function m(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function v(e,t,n){var r={};r[n]=[];var o,a=t.toString(),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return r;for(var l,A=s[1],d=new RegExp("(\\\\n|\\W)"+m(A)+_,"g");l=d.exec(a);)"dll-reference"!==l[3]&&r[n].push(l[3]);for(d=new RegExp("\\("+m(A)+'\\("(dll-reference\\s('+f+'))"\\)\\)'+_,"g");l=d.exec(a);)e[l[2]]||(r[n].push(l[1]),e[l[2]]=i(l[1]).m),r[l[2]]=r[l[2]]||[],r[l[2]].push(l[4]);for(var c=Object.keys(r),u=0;u<c.length;u++)for(var h=0;h<r[c[u]].length;h++)o=r[c[u]][h],!isNaN(1*o)&&(r[c[u]][h]=1*r[c[u]][h]);return r}function g(e){return Object.keys(e).reduce((function(t,i){return t||e[i].length>0}),!1)}function y(e,t,i,n){var r=e[n].map((function(e){return'"'.concat(e,'": ').concat(t[n][e].toString())})).join(","),o=p.toString().split("ENTRY_MODULE");return"".concat(o[0],"{").concat(r,"}").concat(o[1],'"').concat(i,'"').concat(o[2])}var b=i(8635),E=i(9953),S=i(550),C=i(719);const w=function(){function e(e,t){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new d.A,t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=function(e,t){t=t||{};var n={main:i.m},r=t.all?{main:Object.keys(n.main)}:function(e,t){for(var i={main:[7477]},n={main:[]},r={main:{}};g(i);)for(var o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s].pop();if(r[s]=r[s]||{},!r[s][l]&&e[s][l]){r[s][l]=!0,n[s]=n[s]||[],n[s].push(l);for(var A=v(e,e[s][l],s),d=Object.keys(A),c=0;c<d.length;c++)i[d[c]]=i[d[c]]||[],i[d[c]]=i[d[c]].concat(A[d[c]])}}return n}(n),o="";Object.keys(r).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;r[e][t];)t++;r[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o+="var ".concat(e," = (").concat(y(r,n,t,modules),")();\n")})),o+="(".concat(y(r,n,7477,"main"),")();");var a=new window.Blob([o],{type:"text/javascript"});if(t.bare)return a;var s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(a),l=new window.Worker(s);return l.objectURL=s,l}(),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},b.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:b.A.getConfig()})}catch(i){c.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new E.A(e,t)}else this._controller=new E.A(e,t);if(this._controller){var n=this._controller;null==n||n.on(S.A.IO_ERROR,this._onIOError.bind(this)),null==n||n.on(S.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==n||n.on(S.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==n||n.on(S.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==n||n.on(S.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==n||n.on(S.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==n||n.on(S.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==n||n.on(S.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==n||n.on(S.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==n||n.on(S.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==n||n.on(S.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==n||n.on(S.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==n||n.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==n||n.on(S.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==n||n.on(S.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==n||n.on(S.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){var e;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"transmuxing-worker destroy"}),b.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(e=this._controller)||void 0===e||e.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){var e;this._worker?this._worker.postMessage({cmd:"start"}):null===(e=this._controller)||void 0===e||e.start()},e.prototype.close=function(){var e;this._worker?this._worker.postMessage({cmd:"stop"}):null===(e=this._controller)||void 0===e||e.stop()},e.prototype.seek=function(e){var t;this._worker?this._worker.postMessage({cmd:"seek",param:e}):null===(t=this._controller)||void 0===t||t.seek(e)},e.prototype.pause=function(){var e;this._worker?this._worker.postMessage({cmd:"pause"}):null===(e=this._controller)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this._worker?this._worker.postMessage({cmd:"resume"}):null===(e=this._controller)||void 0===e||e.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(S.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(S.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=null==t?void 0:t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case S.A.INIT_SEGMENT:case S.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case S.A.LOADING_COMPLETE:case S.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case S.A.MEDIA_INFO:Object.setPrototypeOf(i,C.A.prototype),this._emitter.emit(t.msg,i);break;case S.A.METADATA_ARRIVED:case S.A.SCRIPTDATA_ARRIVED:case S.A.TIMED_ID3_METADATA_ARRIVED:case S.A.SMPTE2038_METADATA_ARRIVED:case S.A.SCTE35_METADATA_ARRIVED:case S.A.PES_PRIVATE_DATA_DESCRIPTOR:case S.A.PES_PRIVATE_DATA_ARRIVED:case S.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case S.A.IO_ERROR:case S.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case S.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":c.A.emitter.emit("log",i.type,i.logcat)}},e}(),T="error",k="source_open",L="update_end",I="buffer_full";var O=i(1951),B=i(4383);const R=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new d.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new O.EX}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new B.j4("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){c.A.e(this.TAG,e.message)}null==n||n.removeEventListener("error",this.e.onSourceBufferError),null==n||n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){c.A.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){var i;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,r="".concat(n.container);n.codec&&n.codec.length>0&&(r+=";codecs=".concat(n.codec));var o=!1;if(c.A.v(this.TAG,"Received Initialization Segment, mimeType: "+r),this._lastInitSegments[n.type]=n,r!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])c.A.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type]||"",", target: ").concat(r));else{o=!0;try{var a=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(r);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return c.A.e(this.TAG,e.message),void this._emitter.emit(T,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=r}t||this._pendingSegments[n.type].push(n),o||this._sourceBuffers[n.type]&&!(null===(i=this._sourceBuffers[n.type])||void 0===i?void 0:i.updating)&&this._doAppendSegments(),u.A.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){var t,i;for(var n in this._sourceBuffers)if(this._sourceBuffers[n]){var r=this._sourceBuffers[n];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==r||r.abort()}catch(e){c.A.e(this.TAG,e.message)}this._idrList.clear();var o=this._pendingSegments[n];if(o.splice(0,o.length),"closed"!==(null===(i=this._mediaSource)||void 0===i?void 0:i.readyState)){if(r){for(var a=0;a<r.buffered.length;a++){var s=r.buffered.start(a),l=r.buffered.end(a);this._pendingRemoveRanges[n].push({start:s,end:l})}(null==r?void 0:r.updating)||this._doRemoveRanges()}if(u.A.safari){var A=this._lastInitSegments[n];A&&(this._pendingSegments[n].push(A),(null==r?void 0:r.updating)||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e,t,i=this._mediaSource,n=this._sourceBuffers;i&&"open"===i.readyState?(null===(e=n.video)||void 0===e?void 0:e.updating)||(null===(t=n.audio)||void 0===t?void 0:t.updating)?this._hasPendingEos=!0:(this._hasPendingEos=!1,i.endOfStream()):i&&"closed"===i.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype.getNearestKeyframe=function(e){return this._idrList.getLastSyncPointBeforeDts(e)},e.prototype._needCleanupSourceBuffer=function(){var e,t;if(!this._config.autoCleanupSourceBuffer)return!1;var i=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var n in this._sourceBuffers){var r=this._sourceBuffers[n];if(r){var o=r.buffered;if(o.length>=1&&i-o.start(0)>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e,t,i,n=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var r in this._sourceBuffers){var o=this._sourceBuffers[r];if(o){for(var a=o.buffered,s=!1,l=0;l<a.length;l++){var A=a.start(l),d=a.end(l);if(A<=n&&n<d+3){if(n-A>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){s=!0;var c=n-((null===(i=this._config)||void 0===i?void 0:i.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[r].push({start:A,end:c})}}else d<n&&(s=!0,this._pendingRemoveRanges[r].push({start:A,end:d}))}s&&!o.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e,t,i,n,r=this._sourceBuffers;if(0!==(null===(e=this._mediaElement)||void 0===e?void 0:e.readyState)&&"open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)&&!(null===(i=r.video)||void 0===i?void 0:i.updating)&&!(null===(n=r.audio)||void 0===n?void 0:n.updating)){var o=this._mediaSource.duration,a=this._pendingMediaDuration;a>0&&(isNaN(o)||a>o)&&(c.A.v(this.TAG,"Update MediaSource duration from ".concat(o," to ").concat(a)),this._mediaSource.duration=a),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){var e;for(var t in this._pendingRemoveRanges)if(this._sourceBuffers[t]&&!(null===(e=this._sourceBuffers[t])||void 0===e?void 0:e.updating))for(var i=this._sourceBuffers[t],n=this._pendingRemoveRanges[t];n.length&&!(null==i?void 0:i.updating);){var r=n.shift();null==i||i.remove(r.start,r.end)}},e.prototype._doAppendSegments=function(){var e,t,i,n=this._pendingSegments;for(var r in n)if(this._sourceBuffers[r]&&!(null===(e=this._sourceBuffers[r])||void 0===e?void 0:e.updating)&&n[r].length>0){var o=n[r].shift();if(null==o?void 0:o.timestampOffset){var a=(null===(t=this._sourceBuffers[r])||void 0===t?void 0:t.timestampOffset)||0,s=o.timestampOffset/1e3;Math.abs(a-s)>.1&&(c.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(a," to ").concat(s)),this._sourceBuffers[r]&&(this._sourceBuffers[r].timestampOffset=s)),delete o.timestampOffset}if(!o.data||0===o.data.byteLength)continue;try{null===(i=this._sourceBuffers[r])||void 0===i||i.appendBuffer(o.data),this._isBufferFull=!1,"video"===r&&o.hasOwnProperty("info")&&this._idrList.appendArray(o.info.syncPoints)}catch(e){this._pendingSegments[r].unshift(o),22===e.code?(this._isBufferFull||this._emitter.emit(I),this._isBufferFull=!0):(c.A.e(this.TAG,e.message),this._emitter.emit(T,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){var e;if(c.A.v(this.TAG,"MediaSource onSourceOpen"),null===(e=this._mediaSource)||void 0===e||e.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var i=t.shift();this.appendInitSegment(i,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(k)},e.prototype._onSourceEnded=function(){c.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){c.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(L)},e.prototype._onSourceBufferError=function(e){c.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}();var x=i(6399),D={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},M={NETWORK_EXCEPTION:A.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:A.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:A.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:A.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:x.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:x.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:x.A.CODEC_UNSUPPORTED};const P=function(){function e(e,t){var i,n,r;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new d.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var o=e.type.toLowerCase();if("mse"!==o&&"mpegts"!==o&&"m2ts"!==o&&"flv"!==o)throw new B.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var s=u.A.chrome&&(u.A.version&&(null===(i=u.A.version)||void 0===i?void 0:i.major)<50||u.A.version&&50===(null===(n=null===u.A||void 0===u.A?void 0:u.A.version)||void 0===n?void 0:n.major)&&((null===(r=null===u.A||void 0===u.A?void 0:u.A.version)||void 0===r?void 0:r.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||u.A.msedge||u.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){this._emitter.emit(h.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===h.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){i._emitter.emit(h.MEDIA_INFO,i.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){i._emitter.emit(h.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t,i,n,r,o,a=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new R(this._config),null===(t=this._msectl)||void 0===t||t.on(L,this._onmseUpdateEnd.bind(this)),null===(i=this._msectl)||void 0===i||i.on(I,this._onmseBufferFull.bind(this)),null===(n=this._msectl)||void 0===n||n.on(k,(function(){a._mseSourceOpened=!0,a._hasPendingLoad&&(a._hasPendingLoad=!1,a.load())})),null===(r=this._msectl)||void 0===r||r.on(T,(function(e){a._emitter.emit(h.ERROR,D.MEDIA_ERROR,M.MEDIA_MSE_ERROR,e)})),null===(o=this._msectl)||void 0===o||o.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){var e;this._mediaElement&&(null===(e=this._msectl)||void 0===e||e.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new B.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new B.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new w(this._mediaDataSource,this._config),this._transmuxer.on(S.A.INIT_SEGMENT,(function(t,i){var n;null===(n=e._msectl)||void 0===n||n.appendInitSegment(i)})),this._transmuxer.on(S.A.MEDIA_SEGMENT,(function(t,i){var n,r,o;if(null===(n=e._msectl)||void 0===n||n.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var a=null===(r=e._mediaElement)||void 0===r?void 0:r.currentTime;i.info.endDts>=1e3*(a+((null===(o=e._config)||void 0===o?void 0:o.lazyLoadMaxDuration)||0))&&null==e._progressChecker&&(c.A.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(S.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(h.LOADING_COMPLETE)})),this._transmuxer.on(S.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(h.RECOVERED_EARLY_EOF)})),this._transmuxer.on(S.A.IO_ERROR,(function(t,i){e._emitter.emit(h.ERROR,D.NETWORK_ERROR,t,i)})),this._transmuxer.on(S.A.DEMUX_ERROR,(function(t,i){e._emitter.emit(h.ERROR,D.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(S.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(h.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(S.A.METADATA_ARRIVED,(function(t){e._emitter.emit(h.METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(h.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(S.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(h.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(h.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(h.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(h.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(h.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(S.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(h.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(S.A.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){var e,t,i,n;return t=this,n=function(){return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,r){function o(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((n=n.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){var e,t,i,n,r=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,o=(null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime)||0;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&(null==r?void 0:r.length)>0&&!(null===(i=this._mediaElement)||void 0===i?void 0:i.paused)){var a=r.end(r.length-1);if(a>((null===(n=this._config)||void 0===n?void 0:n.liveBufferLatencyMaxLatency)||0)&&a-o>(this._config.liveBufferLatencyMaxLatency||0)){var s=a-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=s}}if(this._config.lazyLoad&&!this._config.isLive){for(var l=0,A=0;A<r.length;A++){var d=r.start(A),u=r.end(A);if(d<=o&&o<u){l=u;break}}l>=o+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(c.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){c.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e,t,i,n=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,r=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered)||[],o=!1,a=0;a<r.length;a++){var s=r.start(a),l=r.end(a);if(n>=s&&n<l){n>=l-(this._config.lazyLoadRecoverDuration||0)&&(o=!0);break}}o&&(window.clearInterval(this._progressChecker),this._progressChecker=null,o&&(c.A.v(this.TAG,"Continue loading from paused position"),null===(i=this._transmuxer)||void 0===i||i.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t,i=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,n=0;n<i.length;n++){var r=i.start(n),o=i.end(n);if(e>=r&&e<o)return!0}return!1},e.prototype._internalSeek=function(e){var t,i,n,r=this._isTimepointBuffered(e),o=!1,a=0;if(e<1&&this._mediaElement.buffered.length>0){var s=this._mediaElement.buffered.start(0);(s<1&&e<s||u.A.safari)&&(o=!0,a=u.A.safari?.1:s)}if(o)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=a);else if(r){if(this._alwaysSeekKeyframe){var l=null===(t=this._msectl)||void 0===t?void 0:t.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=l?l.dts/1e3:e)}else this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e);null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(e),null===(n=this._transmuxer)||void 0===n||n.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e))},e.prototype._checkAndApplyUnbufferedSeekpoint=function(){var e,t,i,n;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){var r=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(r)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(r),null===(n=this._transmuxer)||void 0===n||n.seek(Math.floor(1e3*r)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=r)))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},e.prototype._checkAndResumeStuckPlayback=function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var i=t.buffered;i.length>0&&t.currentTime<i.start(0)&&(c.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(i.start(0))),this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=i.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress)))}else this._mediaElement&&this._mediaElement.removeEventListener("progress",this.e.onvProgress)},e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null)},e.prototype._onvSeeking=function(e){var t,i,n,r=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime,o=null===(i=this._mediaElement)||void 0===i?void 0:i.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(r<1&&o.length>0){var a=o.start(0);if(a<1&&r<a||u.A.safari)return this._requestSetTime=!0,void(this._mediaElement&&(u.A.safari?this._mediaElement.currentTime=.1:this._mediaElement.currentTime=a))}if(this._isTimepointBuffered(r)){if(this._alwaysSeekKeyframe){var s=null===(n=this._msectl)||void 0===n?void 0:n.getNearestKeyframe(Math.floor(1e3*r));null!=s&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=s.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:r,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},e.prototype._onvCanPlay=function(e){var t;this._receivedCanPlay=!0,null===(t=this._mediaElement)||void 0===t||t.removeEventListener("canplay",this.e.onvCanPlay)},e.prototype._onvStalled=function(e){this._checkAndResumeStuckPlayback(!0)},e.prototype._onvProgress=function(e){this._checkAndResumeStuckPlayback()},e}(),U=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new d.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new B.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new B.Qn("NativePlayer(".concat(e.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){var e;this._emitter.emit(h.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,null===(e=this._emitter)||void 0===e||e.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===h.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(h.MEDIA_INFO,i.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(h.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){var e;if(!this._mediaElement)throw new B.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=(null===(e=this._mediaDataSource)||void 0===e?void 0:e.url)||"",this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){var e,t,i,n;return t=this,n=function(){return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,r){function o(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((n=n.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null),this._emitter.emit(h.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(h.STATISTICS_INFO,this.statisticsInfo)},e}();var $={createPlayer:function(e,t){(null==e?void 0:e.url)&&(e.url=function(e,t){void 0===t&&(t=["h264"]);var i=(t||["h264"]).reduce((function(e,t){return t=t.toLowerCase(),e+(n[t]||0)}),0),r=e.split("?")[0],o=e.split("?")[1];return o=(o||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),r+"?"+o+(o?"&":"")+"vc="+i}(e.url,["h264","h265"]));var i=e;if(null==i||"object"!=typeof i)throw new B.Qn("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(i,"type"))throw new B.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new P(i,t);default:return new U(i,t)}},isSupported:function(){return l.supportMSEH264Playback()},getFeatureList:function(){return l.getFeatureList()},BaseLoader:A.HC,LoaderStatus:A.eO,LoaderErrors:A.Xv,version:"",Events:h,ErrorTypes:D,ErrorDetails:M,MSEPlayer:P,NativePlayer:U,LoggingControl:b.A};Object.defineProperty($,"version",{enumerable:!0,get:function(){return"2.0.1"}});const F=$},2671:(e,t,i)=>{var n=i(6458),r=i(2809),o=i(9211),a=i(497),s=i(5057),l=i(3732),A=function(){},d=s("Reflect","construct"),c=/^\s*(?:class|function)\b/,u=n(c.exec),h=!c.test(A),p=function(e){if(!o(e))return!1;try{return d(A,[],e),!0}catch(e){return!1}},f=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!u(c,l(e))}catch(e){return!0}};f.sham=!0,e.exports=!d||r((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?f:p},2719:(e,t,i)=>{var n=i(5273),r=i(5840);e.exports=function(e){return n(r(e))}},2757:(e,t,i)=>{var n=i(9615),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}},2792:(e,t,i)=>{var n=i(9646),r=i(2809);e.exports=n&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2807:(e,t,i)=>{var n=i(9047);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},2809:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2897:(e,t,i)=>{var n=i(9646),r=i(815),o=i(7403),a=i(6330),s=i(2719),l=i(4151),A=i(4347),d=i(6071),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=s(e),t=l(t),d)try{return c(e,t)}catch(e){}if(A(e,t))return a(!r(o.f,e,t),e[t])}},2915:(e,t,i)=>{var n=i(7553),r=i(2327),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[o]===e)}},3074:(e,t,i)=>{var n=i(9364),r=i(9083),o=i(7642);n({target:"Object",stat:!0,forced:i(2809)((function(){o(1)}))},{keys:function(e){return o(r(e))}})},3430:(e,t,i)=>{var n=i(6458),r=i(4347),o=i(2719),a=i(219).indexOf,s=i(7923),l=n([].push);e.exports=function(e,t){var i,n=o(e),A=0,d=[];for(i in n)!r(s,i)&&r(n,i)&&l(d,i);for(;t.length>A;)r(n,i=t[A++])&&(~a(d,i)||l(d,i));return d}},3439:(e,t,i)=>{var n=i(9646),r=i(6458),o=i(815),a=i(2809),s=i(7642),l=i(7819),A=i(7403),d=i(9083),c=i(5273),u=Object.assign,h=Object.defineProperty,p=r([].concat);e.exports=!u||a((function(){if(n&&1!==u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[i]=7,r.split("").forEach((function(e){t[e]=e})),7!==u({},e)[i]||s(u({},t)).join("")!==r}))?function(e,t){for(var i=d(e),r=arguments.length,a=1,u=l.f,h=A.f;r>a;)for(var f,_=c(arguments[a++]),m=u?p(s(_),u(_)):s(_),v=m.length,g=0;v>g;)f=m[g++],n&&!o(h,_,f)||(i[f]=_[f]);return i}:u},3463:(e,t,i)=>{var n=i(775);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},3478:(e,t,i)=>{var n=i(9646),r=i(1562),o=i(6458),a=i(4346),s=i(5405),l=i(9277),A=i(6122),d=i(2630).f,c=i(9615),u=i(9666),h=i(6677),p=i(1144),f=i(8587),_=i(9614),m=i(3930),v=i(2809),g=i(4347),y=i(3587).enforce,b=i(9603),E=i(7553),S=i(7517),C=i(6288),w=E("match"),T=r.RegExp,k=T.prototype,L=r.SyntaxError,I=o(k.exec),O=o("".charAt),B=o("".replace),R=o("".indexOf),x=o("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,P=/a/g,U=new T(M)!==M,$=f.MISSED_STICKY,F=f.UNSUPPORTED_Y;if(a("RegExp",n&&(!U||$||S||C||v((function(){return P[w]=!1,T(M)!==M||T(P)===P||"/a/i"!==String(T(M,"i"))}))))){for(var N=function(e,t){var i,n,r,o,a,d,f=c(k,this),_=u(e),m=void 0===t,v=[],b=e;if(!f&&_&&m&&e.constructor===N)return e;if((_||c(k,e))&&(e=e.source,m&&(t=p(b))),e=void 0===e?"":h(e),t=void 0===t?"":h(t),b=e,S&&"dotAll"in M&&(n=!!t&&R(t,"s")>-1)&&(t=B(t,/s/g,"")),i=t,$&&"sticky"in M&&(r=!!t&&R(t,"y")>-1)&&F&&(t=B(t,/y/g,"")),C&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],a=A(null),s=!1,l=!1,d=0,c="";n<=i;n++){if("\\"===(t=O(e,n)))t+=O(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(r+=t,"?:"===x(e,n+1,n+3))continue;I(D,x(e,n+1))&&(n+=2,l=!0),d++;continue;case">"===t&&l:if(""===c||g(a,c))throw new L("Invalid capture group name");a[c]=!0,o[o.length]=[c,d],l=!1,c="";continue}l?c+=t:r+=t}return[r,o]}(e),e=o[0],v=o[1]),a=s(T(e,t),f?this:k,N),(n||r||v.length)&&(d=y(a),n&&(d.dotAll=!0,d.raw=N(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=O(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+O(e,++n);return r}(e),i)),r&&(d.sticky=!0),v.length&&(d.groups=v)),e!==b)try{l(a,"source",""===b?"(?:)":b)}catch(e){}return a},V=d(T),j=0;V.length>j;)_(N,T,V[j++]);k.constructor=N,N.prototype=k,m(r,"RegExp",N,{constructor:!0})}b("RegExp")},3479:(e,t,i)=>{var n=i(5993);e.exports="NODE"===n},3587:(e,t,i)=>{var n,r,o,a=i(4468),s=i(1562),l=i(4152),A=i(9277),d=i(4347),c=i(775),u=i(577),h=i(7923),p="Object already initialized",f=s.TypeError,_=s.WeakMap;if(a||c.state){var m=c.state||(c.state=new _);m.get=m.get,m.has=m.has,m.set=m.set,n=function(e,t){if(m.has(e))throw new f(p);return t.facade=e,m.set(e,t),t},r=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var v=u("state");h[v]=!0,n=function(e,t){if(d(e,v))throw new f(p);return t.facade=e,A(e,v,t),t},r=function(e){return d(e,v)?e[v]:{}},o=function(e){return d(e,v)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=r(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return i}}}},3643:(e,t,i)=>{var n=i(9646),r=i(6071),o=i(2792),a=i(7749),s=i(4151),l=TypeError,A=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",h="writable";t.f=n?o?function(e,t,i){if(a(e),t=s(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&h in i&&!i[h]){var n=d(e,t);n&&n[h]&&(e[t]=i.value,i={configurable:u in i?i[u]:n[u],enumerable:c in i?i[c]:n[c],writable:!1})}return A(e,t,i)}:A:function(e,t,i){if(a(e),t=s(t),a(i),r)try{return A(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},3732:(e,t,i)=>{var n=i(6458),r=i(9211),o=i(775),a=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},3813:(e,t,i)=>{i(1541)(Math,"Math",!0)},3930:(e,t,i)=>{var n=i(9211),r=i(3643),o=i(4233),a=i(4191);e.exports=function(e,t,i,s){s||(s={});var l=s.enumerable,A=void 0!==s.name?s.name:t;if(n(i)&&o(i,A,s),s.global)l?e[t]=i:a(t,i);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},3992:(e,t,i)=>{var n=i(9364),r=i(5057),o=i(8891),a=i(815),s=i(6458),l=i(2809),A=i(9211),d=i(5727),c=i(8626),u=i(9695),h=i(7917),p=String,f=r("JSON","stringify"),_=s(/./.exec),m=s("".charAt),v=s("".charCodeAt),g=s("".replace),y=s(1..toString),b=/[\uD800-\uDFFF]/g,E=/^[\uD800-\uDBFF]$/,S=/^[\uDC00-\uDFFF]$/,C=!h||l((function(){var e=r("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),w=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),T=function(e,t){var i=c(arguments),n=u(t);if(A(n)||void 0!==e&&!d(e))return i[1]=function(e,t){if(A(n)&&(t=a(n,this,p(e),t)),!d(t))return t},o(f,null,i)},k=function(e,t,i){var n=m(i,t-1),r=m(i,t+1);return _(E,e)&&!_(S,r)||_(S,e)&&!_(E,n)?"\\u"+y(v(e,0),16):e};f&&n({target:"JSON",stat:!0,arity:3,forced:C||w},{stringify:function(e,t,i){var n=c(arguments),r=o(C?T:f,null,n);return w&&"string"==typeof r?g(r,b,k):r}})},4151:(e,t,i)=>{var n=i(115),r=i(5727);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},4152:(e,t,i)=>{var n=i(9211);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},4160:(e,t,i)=>{var n=i(815),r=i(5057),o=i(7553),a=i(3930);e.exports=function(){var e=r("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,s=o("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return n(i,this)}),{arity:1})}},4191:(e,t,i)=>{var n=i(1562),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},4220:(e,t,i)=>{i(6810);var n,r=i(9364),o=i(9646),a=i(6666),s=i(1562),l=i(7042),A=i(6458),d=i(3930),c=i(1176),u=i(2757),h=i(4347),p=i(3439),f=i(4478),_=i(8626),m=i(4417).codeAt,v=i(4955),g=i(6677),y=i(1541),b=i(594),E=i(648),S=i(3587),C=S.set,w=S.getterFor("URL"),T=E.URLSearchParams,k=E.getState,L=s.URL,I=s.TypeError,O=s.parseInt,B=Math.floor,R=Math.pow,x=A("".charAt),D=A(/./.exec),M=A([].join),P=A(1..toString),U=A([].pop),$=A([].push),F=A("".replace),N=A([].shift),V=A("".split),j=A("".slice),Q=A("".toLowerCase),G=A([].unshift),z="Invalid scheme",H="Invalid host",W="Invalid port",q=/[a-z]/i,K=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,Z=/^[0-7]+$/,J=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ie=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,re=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,oe=/[\t\n\r]/g,ae=function(e){var t,i,n,r;if("number"==typeof e){for(t=[],i=0;i<4;i++)G(t,e%256),e=B(e/256);return M(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,i=1,n=null,r=0,o=0;o<8;o++)0!==e[o]?(r>i&&(t=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i?n:t}(e),i=0;i<8;i++)r&&0===e[i]||(r&&(r=!1),n===i?(t+=i?":":"::",r=!0):(t+=P(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},se={},le=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),Ae=p({},le,{"#":1,"?":1,"{":1,"}":1}),de=p({},Ae,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ce=function(e,t){var i=m(e,0);return i>32&&i<127&&!h(t,e)?e:encodeURIComponent(e)},ue={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var i;return 2===e.length&&D(q,x(e,0))&&(":"===(i=x(e,1))||!t&&"|"===i)},pe=function(e){var t;return e.length>1&&he(j(e,0,2))&&(2===e.length||"/"===(t=x(e,2))||"\\"===t||"?"===t||"#"===t)},fe=function(e){return"."===e||"%2e"===Q(e)},_e={},me={},ve={},ge={},ye={},be={},Ee={},Se={},Ce={},we={},Te={},ke={},Le={},Ie={},Oe={},Be={},Re={},xe={},De={},Me={},Pe={},Ue=function(e,t,i){var n,r,o,a=g(e);if(t){if(r=this.parse(a))throw new I(r);this.searchParams=null}else{if(void 0!==i&&(n=new Ue(i,!0)),r=this.parse(a,null,n))throw new I(r);(o=k(new T)).bindURL(this),this.searchParams=o}};Ue.prototype={type:"URL",parse:function(e,t,i){var r,o,a,s,l,A=this,d=t||_e,c=0,u="",p=!1,m=!1,v=!1;for(e=g(e),t||(A.scheme="",A.username="",A.password="",A.host=null,A.port=null,A.path=[],A.query=null,A.fragment=null,A.cannotBeABaseURL=!1,e=F(e,ne,""),e=F(e,re,"$1")),e=F(e,oe,""),r=f(e);c<=r.length;){switch(o=r[c],d){case _e:if(!o||!D(q,o)){if(t)return z;d=ve;continue}u+=Q(o),d=me;break;case me:if(o&&(D(K,o)||"+"===o||"-"===o||"."===o))u+=Q(o);else{if(":"!==o){if(t)return z;u="",d=ve,c=0;continue}if(t&&(A.isSpecial()!==h(ue,u)||"file"===u&&(A.includesCredentials()||null!==A.port)||"file"===A.scheme&&!A.host))return;if(A.scheme=u,t)return void(A.isSpecial()&&ue[A.scheme]===A.port&&(A.port=null));u="","file"===A.scheme?d=Ie:A.isSpecial()&&i&&i.scheme===A.scheme?d=ge:A.isSpecial()?d=Se:"/"===r[c+1]?(d=ye,c++):(A.cannotBeABaseURL=!0,$(A.path,""),d=De)}break;case ve:if(!i||i.cannotBeABaseURL&&"#"!==o)return z;if(i.cannotBeABaseURL&&"#"===o){A.scheme=i.scheme,A.path=_(i.path),A.query=i.query,A.fragment="",A.cannotBeABaseURL=!0,d=Pe;break}d="file"===i.scheme?Ie:be;continue;case ge:if("/"!==o||"/"!==r[c+1]){d=be;continue}d=Ce,c++;break;case ye:if("/"===o){d=we;break}d=xe;continue;case be:if(A.scheme=i.scheme,o===n)A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.query=i.query;else if("/"===o||"\\"===o&&A.isSpecial())d=Ee;else if("?"===o)A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.query="",d=Me;else{if("#"!==o){A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.path.length--,d=xe;continue}A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.query=i.query,A.fragment="",d=Pe}break;case Ee:if(!A.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,d=xe;continue}d=we}else d=Ce;break;case Se:if(d=Ce,"/"!==o||"/"!==x(u,c+1))continue;c++;break;case Ce:if("/"!==o&&"\\"!==o){d=we;continue}break;case we:if("@"===o){p&&(u="%40"+u),p=!0,a=f(u);for(var y=0;y<a.length;y++){var b=a[y];if(":"!==b||v){var E=ce(b,de);v?A.password+=E:A.username+=E}else v=!0}u=""}else if(o===n||"/"===o||"?"===o||"#"===o||"\\"===o&&A.isSpecial()){if(p&&""===u)return"Invalid authority";c-=f(u).length+1,u="",d=Te}else u+=o;break;case Te:case ke:if(t&&"file"===A.scheme){d=Be;continue}if(":"!==o||m){if(o===n||"/"===o||"?"===o||"#"===o||"\\"===o&&A.isSpecial()){if(A.isSpecial()&&""===u)return H;if(t&&""===u&&(A.includesCredentials()||null!==A.port))return;if(s=A.parseHost(u))return s;if(u="",d=Re,t)return;continue}"["===o?m=!0:"]"===o&&(m=!1),u+=o}else{if(""===u)return H;if(s=A.parseHost(u))return s;if(u="",d=Le,t===ke)return}break;case Le:if(!D(Y,o)){if(o===n||"/"===o||"?"===o||"#"===o||"\\"===o&&A.isSpecial()||t){if(""!==u){var S=O(u,10);if(S>65535)return W;A.port=A.isSpecial()&&S===ue[A.scheme]?null:S,u=""}if(t)return;d=Re;continue}return W}u+=o;break;case Ie:if(A.scheme="file","/"===o||"\\"===o)d=Oe;else{if(!i||"file"!==i.scheme){d=xe;continue}switch(o){case n:A.host=i.host,A.path=_(i.path),A.query=i.query;break;case"?":A.host=i.host,A.path=_(i.path),A.query="",d=Me;break;case"#":A.host=i.host,A.path=_(i.path),A.query=i.query,A.fragment="",d=Pe;break;default:pe(M(_(r,c),""))||(A.host=i.host,A.path=_(i.path),A.shortenPath()),d=xe;continue}}break;case Oe:if("/"===o||"\\"===o){d=Be;break}i&&"file"===i.scheme&&!pe(M(_(r,c),""))&&(he(i.path[0],!0)?$(A.path,i.path[0]):A.host=i.host),d=xe;continue;case Be:if(o===n||"/"===o||"\\"===o||"?"===o||"#"===o){if(!t&&he(u))d=xe;else if(""===u){if(A.host="",t)return;d=Re}else{if(s=A.parseHost(u))return s;if("localhost"===A.host&&(A.host=""),t)return;u="",d=Re}continue}u+=o;break;case Re:if(A.isSpecial()){if(d=xe,"/"!==o&&"\\"!==o)continue}else if(t||"?"!==o)if(t||"#"!==o){if(o!==n&&(d=xe,"/"!==o))continue}else A.fragment="",d=Pe;else A.query="",d=Me;break;case xe:if(o===n||"/"===o||"\\"===o&&A.isSpecial()||!t&&("?"===o||"#"===o)){if(".."===(l=Q(l=u))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(A.shortenPath(),"/"===o||"\\"===o&&A.isSpecial()||$(A.path,"")):fe(u)?"/"===o||"\\"===o&&A.isSpecial()||$(A.path,""):("file"===A.scheme&&!A.path.length&&he(u)&&(A.host&&(A.host=""),u=x(u,0)+":"),$(A.path,u)),u="","file"===A.scheme&&(o===n||"?"===o||"#"===o))for(;A.path.length>1&&""===A.path[0];)N(A.path);"?"===o?(A.query="",d=Me):"#"===o&&(A.fragment="",d=Pe)}else u+=ce(o,Ae);break;case De:"?"===o?(A.query="",d=Me):"#"===o?(A.fragment="",d=Pe):o!==n&&(A.path[0]+=ce(o,se));break;case Me:t||"#"!==o?o!==n&&("'"===o&&A.isSpecial()?A.query+="%27":A.query+="#"===o?"%23":ce(o,se)):(A.fragment="",d=Pe);break;case Pe:o!==n&&(A.fragment+=ce(o,le))}c++}},parseHost:function(e){var t,i,n;if("["===x(e,0)){if("]"!==x(e,e.length-1))return H;if(t=function(e){var t,i,n,r,o,a,s,l=[0,0,0,0,0,0,0,0],A=0,d=null,c=0,u=function(){return x(e,c)};if(":"===u()){if(":"!==x(e,1))return;c+=2,d=++A}for(;u();){if(8===A)return;if(":"!==u()){for(t=i=0;i<4&&D(ee,u());)t=16*t+O(u(),16),c++,i++;if("."===u()){if(0===i)return;if(c-=i,A>6)return;for(n=0;u();){if(r=null,n>0){if(!("."===u()&&n<4))return;c++}if(!D(Y,u()))return;for(;D(Y,u());){if(o=O(u(),10),null===r)r=o;else{if(0===r)return;r=10*r+o}if(r>255)return;c++}l[A]=256*l[A]+r,2!=++n&&4!==n||A++}if(4!==n)return;break}if(":"===u()){if(c++,!u())return}else if(u())return;l[A++]=t}else{if(null!==d)return;c++,d=++A}}if(null!==d)for(a=A-d,A=7;0!==A&&a>0;)s=l[A],l[A--]=l[d+a-1],l[d+--a]=s;else if(8!==A)return;return l}(j(e,1,-1)),!t)return H;this.host=t}else if(this.isSpecial()){if(e=v(e),D(te,e))return H;if(t=function(e){var t,i,n,r,o,a,s,l=V(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(i=[],n=0;n<t;n++){if(""===(r=l[n]))return e;if(o=10,r.length>1&&"0"===x(r,0)&&(o=D(X,r)?16:8,r=j(r,8===o?1:2)),""===r)a=0;else{if(!D(10===o?J:8===o?Z:ee,r))return e;a=O(r,o)}$(i,a)}for(n=0;n<t;n++)if(a=i[n],n===t-1){if(a>=R(256,5-t))return null}else if(a>255)return null;for(s=U(i),n=0;n<i.length;n++)s+=i[n]*R(256,3-n);return s}(e),null===t)return H;this.host=t}else{if(D(ie,e))return H;for(t="",i=f(e),n=0;n<i.length;n++)t+=ce(i[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return h(ue,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,n=e.password,r=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,A=t+":";return null!==r?(A+="//",e.includesCredentials()&&(A+=i+(n?":"+n:"")+"@"),A+=ae(r),null!==o&&(A+=":"+o)):"file"===t&&(A+="//"),A+=e.cannotBeABaseURL?a[0]:a.length?"/"+M(a,"/"):"",null!==s&&(A+="?"+s),null!==l&&(A+="#"+l),A},setHref:function(e){var t=this.parse(e);if(t)throw new I(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new $e(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(g(e)+":",_e)},getUsername:function(){return this.username},setUsername:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=ce(t[i],de)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=ce(t[i],de)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Te)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,ke)},getPort:function(){var e=this.port;return null===e?"":g(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=g(e))?this.port=null:this.parse(e,Le))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+M(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Re))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=g(e))?this.query=null:("?"===x(e,0)&&(e=j(e,1)),this.query="",this.parse(e,Me)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=g(e))?("#"===x(e,0)&&(e=j(e,1)),this.fragment="",this.parse(e,Pe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var $e=function(e){var t=u(this,Fe),i=b(arguments.length,1)>1?arguments[1]:void 0,n=C(t,new Ue(e,!1,i));o||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Fe=$e.prototype,Ne=function(e,t){return{get:function(){return w(this)[e]()},set:t&&function(e){return w(this)[t](e)},configurable:!0,enumerable:!0}};if(o&&(c(Fe,"href",Ne("serialize","setHref")),c(Fe,"origin",Ne("getOrigin")),c(Fe,"protocol",Ne("getProtocol","setProtocol")),c(Fe,"username",Ne("getUsername","setUsername")),c(Fe,"password",Ne("getPassword","setPassword")),c(Fe,"host",Ne("getHost","setHost")),c(Fe,"hostname",Ne("getHostname","setHostname")),c(Fe,"port",Ne("getPort","setPort")),c(Fe,"pathname",Ne("getPathname","setPathname")),c(Fe,"search",Ne("getSearch","setSearch")),c(Fe,"searchParams",Ne("getSearchParams")),c(Fe,"hash",Ne("getHash","setHash"))),d(Fe,"toJSON",(function(){return w(this).serialize()}),{enumerable:!0}),d(Fe,"toString",(function(){return w(this).serialize()}),{enumerable:!0}),L){var Ve=L.createObjectURL,je=L.revokeObjectURL;Ve&&d($e,"createObjectURL",l(Ve,L)),je&&d($e,"revokeObjectURL",l(je,L))}y($e,"URL"),r({global:!0,constructor:!0,forced:!a,sham:!o},{URL:$e})},4233:(e,t,i)=>{var n=i(6458),r=i(2809),o=i(9211),a=i(4347),s=i(9646),l=i(6656).CONFIGURABLE,A=i(3732),d=i(3587),c=d.enforce,u=d.get,h=String,p=Object.defineProperty,f=n("".slice),_=n("".replace),m=n([].join),v=s&&!r((function(){return 8!==p((function(){}),"length",{value:8}).length})),g=String(String).split("String"),y=e.exports=function(e,t,i){"Symbol("===f(h(t),0,7)&&(t="["+_(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!a(e,"name")||l&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&a(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=c(e);return a(n,"source")||(n.source=m(g,"string"==typeof t?t:"")),e};Function.prototype.toString=y((function(){return o(this)&&u(this).source||A(this)}),"toString")},4346:(e,t,i)=>{var n=i(2809),r=i(9211),o=/#|\.prototype\./,a=function(e,t){var i=l[s(e)];return i===d||i!==A&&(r(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},A=a.NATIVE="N",d=a.POLYFILL="P";e.exports=a},4347:(e,t,i)=>{var n=i(6458),r=i(9083),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},4383:(e,t,i)=>{i.d(t,{Al:()=>o,Qn:()=>s,Xu:()=>l,j4:()=>a});var n,r=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(){function e(e){this.name="RuntimeException",this._message=e}return Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name="IllegalStateException",i}return r(t,e),t}(o),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name="InvalidArgumentException",i}return r(t,e),t}(o),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name="NotImplementedException",i}return r(t,e),t}(o)},4417:(e,t,i)=>{var n=i(6458),r=i(4685),o=i(6677),a=i(5840),s=n("".charAt),l=n("".charCodeAt),A=n("".slice),d=function(e){return function(t,i){var n,d,c=o(a(t)),u=r(i),h=c.length;return u<0||u>=h?e?"":void 0:(n=l(c,u))<55296||n>56319||u+1===h||(d=l(c,u+1))<56320||d>57343?e?s(c,u):n:e?A(c,u,u+2):d-56320+(n-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},4468:(e,t,i)=>{var n=i(1562),r=i(9211),o=n.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},4478:(e,t,i)=>{var n=i(7042),r=i(815),o=i(9083),a=i(5957),s=i(2915),l=i(2671),A=i(256),d=i(8286),c=i(279),u=i(9273),h=Array;e.exports=function(e){var t=o(e),i=l(this),p=arguments.length,f=p>1?arguments[1]:void 0,_=void 0!==f;_&&(f=n(f,p>2?arguments[2]:void 0));var m,v,g,y,b,E,S=u(t),C=0;if(!S||this===h&&s(S))for(m=A(t),v=i?new this(m):h(m);m>C;C++)E=_?f(t[C],C):t[C],d(v,C,E);else for(v=i?new this:[],b=(y=c(t,S)).next;!(g=r(b,y)).done;C++)E=_?a(y,f,[g.value,C],!0):g.value,d(v,C,E);return v.length=C,v}},4579:(e,t,i)=>{var n=i(9364),r=i(6458),o=i(7024),a=RangeError,s=String.fromCharCode,l=String.fromCodePoint,A=r([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,i=[],n=arguments.length,r=0;n>r;){if(t=+arguments[r++],o(t,1114111)!==t)throw new a(t+" is not a valid code point");i[r]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return A(i,"")}})},4659:(e,t,i)=>{var n=i(9364),r=i(9646),o=i(3643).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!r},{defineProperty:o})},4685:(e,t,i)=>{var n=i(9879);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},4715:(e,t,i)=>{var n=i(5057);e.exports=n("document","documentElement")},4742:(e,t,i)=>{var n=i(9364),r=i(1684).left,o=i(5888),a=i(4941);n({target:"Array",proto:!0,forced:!i(3479)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return r(this,e,t,t>1?arguments[1]:void 0)}})},4879:(e,t,i)=>{var n=i(1562),r=i(9402),o=i(62),a=i(2578),s=i(9277),l=i(1541),A=i(7553)("iterator"),d=a.values,c=function(e,t){if(e){if(e[A]!==d)try{s(e,A,d)}catch(t){e[A]=d}if(l(e,t,!0),r[t])for(var i in a)if(e[i]!==a[i])try{s(e,i,a[i])}catch(t){e[i]=a[i]}}};for(var u in r)c(n[u]&&n[u].prototype,u);c(o,"DOMTokenList")},4884:(e,t,i)=>{var n=i(526),r=i(2719),o=i(2630).f,a=i(8626),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===n(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(r(e))}},4941:(e,t,i)=>{var n,r,o=i(1562),a=i(8053),s=o.process,l=o.Deno,A=s&&s.versions||l&&l.version,d=A&&A.v8;d&&(r=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},4955:(e,t,i)=>{var n=i(6458),r=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",l=RangeError,A=n(a.exec),d=Math.floor,c=String.fromCharCode,u=n("".charCodeAt),h=n([].join),p=n([].push),f=n("".replace),_=n("".split),m=n("".toLowerCase),v=function(e){return e+22+75*(e<26)},g=function(e,t,i){var n=0;for(e=i?d(e/700):e>>1,e+=d(e/t);e>455;)e=d(e/35),n+=36;return d(n+36*e/(e+38))},y=function(e){var t=[];e=function(e){for(var t=[],i=0,n=e.length;i<n;){var r=u(e,i++);if(r>=55296&&r<=56319&&i<n){var o=u(e,i++);56320==(64512&o)?p(t,((1023&r)<<10)+(1023&o)+65536):(p(t,r),i--)}else p(t,r)}return t}(e);var i,n,o=e.length,a=128,A=0,f=72;for(i=0;i<e.length;i++)(n=e[i])<128&&p(t,c(n));var _=t.length,m=_;for(_&&p(t,"-");m<o;){var y=r;for(i=0;i<e.length;i++)(n=e[i])>=a&&n<y&&(y=n);var b=m+1;if(y-a>d((r-A)/b))throw new l(s);for(A+=(y-a)*b,a=y,i=0;i<e.length;i++){if((n=e[i])<a&&++A>r)throw new l(s);if(n===a){for(var E=A,S=36;;){var C=S<=f?1:S>=f+26?26:S-f;if(E<C)break;var w=E-C,T=36-C;p(t,c(v(C+w%T))),E=d(w/T),S+=36}p(t,c(v(E))),f=g(A,b,m===_),A=0,m++}}A++,a++}return h(t,"")};e.exports=function(e){var t,i,n=[],r=_(f(m(e),a,"."),".");for(t=0;t<r.length;t++)i=r[t],p(n,A(o,i)?"xn--"+y(i):i);return h(n,".")}},4979:(e,t,i)=>{var n=i(7042),r=i(6458),o=i(5273),a=i(9083),s=i(256),l=i(2807),A=r([].push),d=function(e){var t=1===e,i=2===e,r=3===e,d=4===e,c=6===e,u=7===e,h=5===e||c;return function(p,f,_,m){for(var v,g,y=a(p),b=o(y),E=s(b),S=n(f,_),C=0,w=m||l,T=t?w(p,E):i||u?w(p,0):void 0;E>C;C++)if((h||C in b)&&(g=S(v=b[C],C,y),e))if(t)T[C]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return C;case 2:A(T,v)}else switch(e){case 4:return!1;case 7:A(T,v)}return c?-1:r||d?d:T}};e.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6),filterReject:d(7)}},4985:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},5057:(e,t,i)=>{var n=i(1562),r=i(9211);e.exports=function(e,t){return arguments.length<2?(i=n[e],r(i)?i:void 0):n[e]&&n[e][t];var i}},5273:(e,t,i)=>{var n=i(6458),r=i(2809),o=i(526),a=Object,s=n("".split);e.exports=r((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},5307:e=>{var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,A,d=this._events[s],c=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),c){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,r),!0;case 5:return d.fn.call(d.context,t,n,r,o),!0;case 6:return d.fn.call(d.context,t,n,r,o,a),!0}for(A=1,l=new Array(c-1);A<c;A++)l[A-1]=arguments[A];d.fn.apply(d.context,l)}else{var u,h=d.length;for(A=0;A<h;A++)switch(d[A].once&&this.removeListener(e,d[A].fn,void 0,!0),c){case 1:d[A].fn.call(d[A].context);break;case 2:d[A].fn.call(d[A].context,t);break;case 3:d[A].fn.call(d[A].context,t,n);break;case 4:d[A].fn.call(d[A].context,t,n,r);break;default:if(!l)for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];d[A].fn.apply(d[A].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var l=0,A=[],d=s.length;l<d;l++)(s[l].fn!==t||r&&!s[l].once||n&&s[l].context!==n)&&A.push(s[l]);A.length?this._events[o]=1===A.length?A[0]:A:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s},5336:(e,t,i)=>{var n=i(9364),r=i(6458),o=i(5273),a=i(2719),s=i(5888),l=r([].join);n({target:"Array",proto:!0,forced:o!==Object||!s("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},5347:(e,t,i)=>{var n=i(9364),r=i(2377);n({target:"Array",proto:!0,forced:[].forEach!==r},{forEach:r})},5405:(e,t,i)=>{var n=i(9211),r=i(4152),o=i(6641);e.exports=function(e,t,i){var a,s;return o&&n(a=t.constructor)&&a!==i&&r(s=a.prototype)&&s!==i.prototype&&o(e,s),e}},5597:(e,t,i)=>{var n=i(9364),r=i(9377);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},5599:e=>{e.exports=function(e){return null==e}},5716:(e,t,i)=>{var n=i(6458),r=i(9083),o=Math.floor,a=n("".charAt),s=n("".replace),l=n("".slice),A=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,d=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,n,c,u){var h=i+e.length,p=n.length,f=d;return void 0!==c&&(c=r(c),f=A),s(u,f,(function(r,s){var A;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,i);case"'":return l(t,h);case"<":A=c[l(s,1,-1)];break;default:var d=+s;if(0===d)return r;if(d>p){var u=o(d/10);return 0===u?r:u<=p?void 0===n[u-1]?a(s,1):n[u-1]+a(s,1):r}A=n[d-1]}return void 0===A?"":A}))}},5727:(e,t,i)=>{var n=i(5057),r=i(9211),o=i(9615),a=i(9742),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&o(t.prototype,s(e))}},5736:(e,t,i)=>{var n=i(9211),r=i(4985),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(r(e)+" is not a function")}},5758:(e,t,i)=>{var n=i(9364),r=i(4979).filter;n({target:"Array",proto:!0,forced:!i(8611)("filter")},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},5810:(e,t,i)=>{var n=i(526);e.exports=Array.isArray||function(e){return"Array"===n(e)}},5840:(e,t,i)=>{var n=i(5599),r=TypeError;e.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}},5888:(e,t,i)=>{var n=i(2809);e.exports=function(e,t){var i=[][e];return!!i&&n((function(){i.call(null,t||function(){return 1},1)}))}},5957:(e,t,i)=>{var n=i(7749),r=i(8401);e.exports=function(e,t,i,o){try{return o?t(n(i)[0],i[1]):t(i)}catch(t){r(e,"throw",t)}}},5993:(e,t,i)=>{var n=i(1562),r=i(8053),o=i(526),a=function(e){return r.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},6033:(e,t,i)=>{var n=i(1562);i(1541)(n.JSON,"JSON",!0)},6041:(e,t,i)=>{i(7267),i(804),i(1766),i(3992),i(947)},6071:(e,t,i)=>{var n=i(9646),r=i(2809),o=i(1465);e.exports=!n&&!r((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},6122:(e,t,i)=>{var n,r=i(7749),o=i(7815),a=i(6853),s=i(7923),l=i(4715),A=i(1465),d=i(577),c="prototype",u="script",h=d("IE_PROTO"),p=function(){},f=function(e){return"<"+u+">"+e+"</"+u+">"},_=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;m="undefined"!=typeof document?document.domain&&n?_(n):(t=A("iframe"),i="java"+u+":",t.style.display="none",l.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):_(n);for(var r=a.length;r--;)delete m[c][a[r]];return m()};s[h]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[c]=r(e),i=new p,p[c]=null,i[h]=e):i=m(),void 0===t?i:o.f(i,t)}},6263:(e,t,i)=>{var n=i(6656).PROPER,r=i(3930),o=i(7749),a=i(6677),s=i(2809),l=i(1144),A="toString",d=RegExp.prototype,c=d[A],u=s((function(){return"/a/b"!==c.call({source:"a",flags:"b"})})),h=n&&c.name!==A;(u||h)&&r(d,A,(function(){var e=o(this);return"/"+a(e.source)+"/"+a(l(e))}),{unsafe:!0})},6285:(e,t,i)=>{var n=i(1562);e.exports=n},6288:(e,t,i)=>{var n=i(2809),r=i(1562).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},6330:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6383:(e,t,i)=>{var n=i(9364),r=i(1562);n({global:!0,forced:r.globalThis!==r},{globalThis:r})},6399:(e,t,i)=>{i.d(t,{A:()=>n});const n={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},6458:(e,t,i)=>{var n=i(6898),r=Function.prototype,o=r.call,a=n&&r.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},6641:(e,t,i)=>{var n=i(1432),r=i(4152),o=i(5840),a=i(1068);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return o(i),a(n),r(i)?(t?e(i,n):i.__proto__=n,i):i}}():void 0)},6656:(e,t,i)=>{var n=i(9646),r=i(4347),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=r(o,"name"),l=s&&"something"===function(){}.name,A=s&&(!n||n&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:A}},6666:(e,t,i)=>{var n=i(2809),r=i(7553),o=i(9646),a=i(9845),s=r("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),i.delete("a",2),i.delete("b",void 0),a&&(!e.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!t.size&&(a||!o)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},6677:(e,t,i)=>{var n=i(497),r=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}},6728:(e,t,i)=>{var n=i(815),r=i(9518),o=i(7749),a=i(5599),s=i(2420),l=i(6677),A=i(5840),d=i(452),c=i(9987),u=i(9260);r("match",(function(e,t,i){return[function(t){var i=A(this),r=a(t)?void 0:d(t,e);return r?n(r,t,i):new RegExp(t)[e](l(i))},function(e){var n=o(this),r=l(e),a=i(t,n,r);if(a.done)return a.value;if(!n.global)return u(n,r);var A=n.unicode;n.lastIndex=0;for(var d,h=[],p=0;null!==(d=u(n,r));){var f=l(d[0]);h[p]=f,""===f&&(n.lastIndex=c(r,s(n.lastIndex),A)),p++}return 0===p?null:h}]}))},6810:(e,t,i)=>{var n=i(4417).charAt,r=i(6677),o=i(3587),a=i(2382),s=i(1567),l="String Iterator",A=o.set,d=o.getterFor(l);a(String,"String",(function(e){A(this,{type:l,string:r(e),index:0})}),(function(){var e,t=d(this),i=t.string,r=t.index;return r>=i.length?s(void 0,!0):(e=n(i,r),t.index+=e.length,s(e,!1))}))},6815:(e,t,i)=>{var n=i(5057),r=i(7225),o=i(1541);r("toStringTag"),o(n("Symbol"),"Symbol")},6853:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6898:(e,t,i)=>{var n=i(2809);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6908:(e,t,i)=>{var n=i(815),r=i(9211),o=i(4152),a=TypeError;e.exports=function(e,t){var i,s;if("string"===t&&r(i=e.toString)&&!o(s=n(i,e)))return s;if(r(i=e.valueOf)&&!o(s=n(i,e)))return s;if("string"!==t&&r(i=e.toString)&&!o(s=n(i,e)))return s;throw new a("Can't convert object to primitive value")}},7024:(e,t,i)=>{var n=i(4685),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},7042:(e,t,i)=>{var n=i(458),r=i(5736),o=i(6898),a=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},7225:(e,t,i)=>{var n=i(6285),r=i(4347),o=i(605),a=i(3643).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});r(t,e)||a(t,e,{value:o.f(e)})}},7267:(e,t,i)=>{var n=i(9364),r=i(1562),o=i(815),a=i(6458),s=i(9845),l=i(9646),A=i(7917),d=i(2809),c=i(4347),u=i(9615),h=i(7749),p=i(2719),f=i(4151),_=i(6677),m=i(6330),v=i(6122),g=i(7642),y=i(2630),b=i(4884),E=i(7819),S=i(2897),C=i(3643),w=i(7815),T=i(7403),k=i(3930),L=i(1176),I=i(3463),O=i(577),B=i(7923),R=i(1002),x=i(7553),D=i(605),M=i(7225),P=i(4160),U=i(1541),$=i(3587),F=i(4979).forEach,N=O("hidden"),V="Symbol",j="prototype",Q=$.set,G=$.getterFor(V),z=Object[j],H=r.Symbol,W=H&&H[j],q=r.RangeError,K=r.TypeError,Y=r.QObject,X=S.f,Z=C.f,J=b.f,ee=T.f,te=a([].push),ie=I("symbols"),ne=I("op-symbols"),re=I("wks"),oe=!Y||!Y[j]||!Y[j].findChild,ae=function(e,t,i){var n=X(z,t);n&&delete z[t],Z(e,t,i),n&&e!==z&&Z(z,t,n)},se=l&&d((function(){return 7!==v(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?ae:Z,le=function(e,t){var i=ie[e]=v(W);return Q(i,{type:V,tag:e,description:t}),l||(i.description=t),i},Ae=function(e,t,i){e===z&&Ae(ne,t,i),h(e);var n=f(t);return h(i),c(ie,n)?(i.enumerable?(c(e,N)&&e[N][n]&&(e[N][n]=!1),i=v(i,{enumerable:m(0,!1)})):(c(e,N)||Z(e,N,m(1,v(null))),e[N][n]=!0),se(e,n,i)):Z(e,n,i)},de=function(e,t){h(e);var i=p(t),n=g(i).concat(pe(i));return F(n,(function(t){l&&!o(ce,i,t)||Ae(e,t,i[t])})),e},ce=function(e){var t=f(e),i=o(ee,this,t);return!(this===z&&c(ie,t)&&!c(ne,t))&&(!(i||!c(this,t)||!c(ie,t)||c(this,N)&&this[N][t])||i)},ue=function(e,t){var i=p(e),n=f(t);if(i!==z||!c(ie,n)||c(ne,n)){var r=X(i,n);return!r||!c(ie,n)||c(i,N)&&i[N][n]||(r.enumerable=!0),r}},he=function(e){var t=J(p(e)),i=[];return F(t,(function(e){c(ie,e)||c(B,e)||te(i,e)})),i},pe=function(e){var t=e===z,i=J(t?ne:p(e)),n=[];return F(i,(function(e){!c(ie,e)||t&&!c(z,e)||te(n,ie[e])})),n};A||(k(W=(H=function(){if(u(W,this))throw new K("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?_(arguments[0]):void 0,t=R(e),i=function(e){var n=void 0===this?r:this;n===z&&o(i,ne,e),c(n,N)&&c(n[N],t)&&(n[N][t]=!1);var a=m(1,e);try{se(n,t,a)}catch(e){if(!(e instanceof q))throw e;ae(n,t,a)}};return l&&oe&&se(z,t,{configurable:!0,set:i}),le(t,e)})[j],"toString",(function(){return G(this).tag})),k(H,"withoutSetter",(function(e){return le(R(e),e)})),T.f=ce,C.f=Ae,w.f=de,S.f=ue,y.f=b.f=he,E.f=pe,D.f=function(e){return le(x(e),e)},l&&(L(W,"description",{configurable:!0,get:function(){return G(this).description}}),s||k(z,"propertyIsEnumerable",ce,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!A,sham:!A},{Symbol:H}),F(g(re),(function(e){M(e)})),n({target:V,stat:!0,forced:!A},{useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),n({target:"Object",stat:!0,forced:!A,sham:!l},{create:function(e,t){return void 0===t?v(e):de(v(e),t)},defineProperty:Ae,defineProperties:de,getOwnPropertyDescriptor:ue}),n({target:"Object",stat:!0,forced:!A},{getOwnPropertyNames:he}),P(),U(H,V),B[N]=!0},7403:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},7477:(e,t,i)=>{var n=i(8635),r=i(9953),o=i(550),a=null,s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function l(e,t){var i={msg:o.A.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function A(e,t){var i={msg:o.A.MEDIA_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function d(){var e={msg:o.A.LOADING_COMPLETE};self.postMessage(e)}function c(){var e={msg:o.A.RECOVERED_EARLY_EOF};self.postMessage(e)}function u(e){var t={msg:o.A.MEDIA_INFO,data:e};self.postMessage(t)}function h(e){var t={msg:o.A.METADATA_ARRIVED,data:e};self.postMessage(t)}function p(e){var t={msg:o.A.SCRIPTDATA_ARRIVED,data:e};self.postMessage(t)}function f(e){var t={msg:o.A.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function _(e){var t={msg:o.A.SMPTE2038_METADATA_ARRIVED,data:e};self.postMessage(t)}function m(e){var t={msg:o.A.SCTE35_METADATA_ARRIVED,data:e};self.postMessage(t)}function v(e){var t={msg:o.A.PES_PRIVATE_DATA_DESCRIPTOR,data:e};self.postMessage(t)}function g(e){var t={msg:o.A.PES_PRIVATE_DATA_ARRIVED,data:e};self.postMessage(t)}function y(e){var t={msg:o.A.STATISTICS_INFO,data:e};self.postMessage(t)}function b(e,t){self.postMessage({msg:o.A.IO_ERROR,data:{type:e,info:t}})}function E(e,t){self.postMessage({msg:o.A.DEMUX_ERROR,data:{type:e,info:t}})}function S(e){self.postMessage({msg:o.A.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":(a=new r.A(e.data.param[0],e.data.param[1])).on(o.A.IO_ERROR,b),a.on(o.A.DEMUX_ERROR,E),a.on(o.A.INIT_SEGMENT,l),a.on(o.A.MEDIA_SEGMENT,A),a.on(o.A.LOADING_COMPLETE,d),a.on(o.A.RECOVERED_EARLY_EOF,c),a.on(o.A.MEDIA_INFO,u),a.on(o.A.METADATA_ARRIVED,h),a.on(o.A.SCRIPTDATA_ARRIVED,p),a.on(o.A.TIMED_ID3_METADATA_ARRIVED,f),a.on(o.A.SMPTE2038_METADATA_ARRIVED,_),a.on(o.A.SCTE35_METADATA_ARRIVED,m),a.on(o.A.PES_PRIVATE_DATA_DESCRIPTOR,v),a.on(o.A.PES_PRIVATE_DATA_ARRIVED,g),a.on(o.A.STATISTICS_INFO,y),a.on(o.A.RECOMMEND_SEEKPOINT,S);break;case"destroy":a&&(a.destroy(),a=null),self.postMessage({msg:"destroyed"});break;case"start":null==a||a.start();break;case"stop":null==a||a.stop();break;case"seek":null==a||a.seek(e.data.param);break;case"pause":null==a||a.pause();break;case"resume":null==a||a.resume();break;case"logging_config":var t=e.data.param;n.A.applyConfig(t),!0===t.enableCallback?n.A.addLogListener(s):n.A.removeLogListener(s)}}))},7478:(e,t,i)=>{var n=i(4347),r=i(1209),o=i(2897),a=i(3643);e.exports=function(e,t,i){for(var s=r(t),l=a.f,A=o.f,d=0;d<s.length;d++){var c=s[d];n(e,c)||i&&n(i,c)||l(e,c,A(t,c))}}},7517:(e,t,i)=>{var n=i(2809),r=i(1562).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},7553:(e,t,i)=>{var n=i(1562),r=i(3463),o=i(4347),a=i(1002),s=i(7917),l=i(9742),A=n.Symbol,d=r("wks"),c=l?A.for||A:A&&A.withoutSetter||a;e.exports=function(e){return o(d,e)||(d[e]=s&&o(A,e)?A[e]:c("Symbol."+e)),d[e]}},7642:(e,t,i)=>{var n=i(3430),r=i(6853);e.exports=Object.keys||function(e){return n(e,r)}},7677:(e,t,i)=>{var n=i(7749);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},7712:(e,t,i)=>{var n=i(1147).IteratorPrototype,r=i(6122),o=i(6330),a=i(1541),s=i(2327),l=function(){return this};e.exports=function(e,t,i,A){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!A,i)}),a(e,d,!1,!0),s[d]=l,e}},7749:(e,t,i)=>{var n=i(4152),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(r(e)+" is not an object")}},7815:(e,t,i)=>{var n=i(9646),r=i(2792),o=i(3643),a=i(7749),s=i(2719),l=i(7642);t.f=n&&!r?Object.defineProperties:function(e,t){a(e);for(var i,n=s(t),r=l(t),A=r.length,d=0;A>d;)o.f(e,i=r[d++],n[i]);return e}},7819:(e,t)=>{t.f=Object.getOwnPropertySymbols},7917:(e,t,i)=>{var n=i(4941),r=i(2809),o=i(1562).String;e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},7923:e=>{e.exports={}},7955:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7958:(e,t,i)=>{var n=i(8891),r=i(815),o=i(6458),a=i(9518),s=i(2809),l=i(7749),A=i(9211),d=i(5599),c=i(4685),u=i(2420),h=i(6677),p=i(5840),f=i(9987),_=i(452),m=i(5716),v=i(9260),g=i(7553)("replace"),y=Math.max,b=Math.min,E=o([].concat),S=o([].push),C=o("".indexOf),w=o("".slice),T="$0"==="a".replace(/./,"$0"),k=!!/./[g]&&""===/./[g]("a","$0");a("replace",(function(e,t,i){var o=k?"$":"$0";return[function(e,i){var n=p(this),o=d(e)?void 0:_(e,g);return o?r(o,e,n,i):r(t,h(n),e,i)},function(e,r){var a=l(this),s=h(e);if("string"==typeof r&&-1===C(r,o)&&-1===C(r,"$<")){var d=i(t,a,s,r);if(d.done)return d.value}var p=A(r);p||(r=h(r));var _,g=a.global;g&&(_=a.unicode,a.lastIndex=0);for(var T,k=[];null!==(T=v(a,s))&&(S(k,T),g);)""===h(T[0])&&(a.lastIndex=f(s,u(a.lastIndex),_));for(var L,I="",O=0,B=0;B<k.length;B++){for(var R,x=h((T=k[B])[0]),D=y(b(c(T.index),s.length),0),M=[],P=1;P<T.length;P++)S(M,void 0===(L=T[P])?L:String(L));var U=T.groups;if(p){var $=E([x],M,D,s);void 0!==U&&S($,U),R=h(n(r,void 0,$))}else R=m(x,s,D,M,U,r);D>=O&&(I+=w(s,O,D)+R,O=D+x.length)}return I+w(s,O)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!T||k)},8053:(e,t,i)=>{var n=i(1562).navigator,r=n&&n.userAgent;e.exports=r?String(r):""},8098:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(2460);const r=function(){function e(){var e;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(e=self.performance)||void 0===e?void 0:e.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0===e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var o,a=i(9034),s=i(8870),l=i(4383),A=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});const d=function(e){function t(t,i){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._abortController=null,n._contentLength=null,n._receivedLength=0,n}return A(t,e),t.isSupported=function(){var e;try{var t=s.A.msedge&&((null===(e=null===s.A||void 0===s.A?void 0:s.A.version)||void 0===e?void 0:e.minor)||0)>=15048&&!s.A.webkit,i=!s.A.msedge||t;return self.fetch&&self.ReadableStream&&i}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t),o=new self.Headers;if("object"==typeof r.headers){var s=r.headers;for(var A in s)s.hasOwnProperty(A)&&o.append(A,s[A])}var d={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var A in this._config.headers)o.append(A,this._config.headers[A]);e.cors||(d.mode="same-origin"),e.withCredentials&&(d.credentials="include"),(null==e?void 0:e.referrerPolicy)&&(d.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(d.signal=this._abortController.signal)),this._status=a.eO.kConnecting,self.fetch(r.url,d).then((function(e){var t,n;if(i._requestAbort)return i._status=a.eO.kIdle,void(null===(t=e.body)||void 0===t||t.cancel());if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&i._onURLRedirect){var o=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(o)}var s=e.headers.get("Content-Length");return null!=s&&(i._contentLength=parseInt(s),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,null===(n=e.body)||void 0===n?void 0:n.getReader())}if(i._status=a.eO.kError,!i._onError)throw new l.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){var t;if(!(null===(t=i._abortController)||void 0===t?void 0:t.signal.aborted)){if(i._status=a.eO.kError,!i._onError)throw e;i._onError(a.Xv.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){var e;if(this._requestAbort=!0,(this._status!==a.eO.kBuffering||!s.A.chrome)&&this._abortController)try{null===(e=this._abortController)||void 0===e||e.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){var n,r,o,s;if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=a.eO.kError;var A=a.Xv.EARLY_EOF,d={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new l.Al(d.msg);t._onError(A,d)}else t._status=a.eO.kComplete,t._onComplete&&t._onComplete((null===(n=t._range)||void 0===n?void 0:n.from)||0,((null===(r=t._range)||void 0===r?void 0:r.from)||0)+t._receivedLength-1);else{if(null===(o=t._abortController)||void 0===o?void 0:o.signal.aborted)return void(t._status=a.eO.kComplete);if(t._requestAbort)return t._status=a.eO.kComplete,e.cancel();t._status=a.eO.kBuffering;var c=i.value.buffer,u=((null===(s=t._range)||void 0===s?void 0:s.from)||0)+t._receivedLength;t._receivedLength+=c.byteLength,t._onDataArrival&&t._onDataArrival(c,u,t._receivedLength),t._pump(e)}})).catch((function(e){var i,n;if(null===(n=null===(i=t._abortController)||void 0===i?void 0:i.signal)||void 0===n?void 0:n.aborted)t._status=a.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=a.eO.kError;var r=0,o=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(r=a.Xv.EXCEPTION,o={code:e.code,msg:e.message}):(r=a.Xv.EARLY_EOF,o={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new l.Al(o.msg);t._onError(r,o)}}))},t}(a.HC);var c=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const u=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return c(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return n.A.w("MozChunkedLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);var n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="moz-chunked-arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onloadend=this._onLoadEnd.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var s in o)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s])}if("object"==typeof this._config.headers)for(var s in o=this._config.headers)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s]);this._status=a.eO.kConnecting,r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!==t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=a.eO.kError,!this._onError)throw new l.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=a.eO.kBuffering}},t.prototype._onProgress=function(e){var t;if(this._status!==a.eO.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var i=e.target.response,n=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength)}},t.prototype._onLoadEnd=function(e){this._requestAbort?this._requestAbort=!1:this._status!==a.eO.kError&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var h=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const p=function(e){function t(t,i){var n=e.call(this,"xhr-range-loader")||this;return n.TAG="RangeLoader",n._seekHandler=t,n._config=i,n._needStash=!1,n._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],n._currentChunkSizeKB=384,n._currentSpeedNormalized=0,n._zeroSpeedChunkCount=0,n._xhr=null,n._speedSampler=new r,n._requestAbort=!1,n._waitForTotalLength=!1,n._totalLengthReceived=!1,n._currentRequestURL=null,n._currentRedirectedURL=null,n._currentRequestRange=null,n._totalLength=null,n._contentLength=null,n._receivedLength=0,n._lastTimeLoaded=0,n}return h(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return n.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=a.eO.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e,t,i=1024*this._currentChunkSizeKB,n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength,r=n+i;null!=this._contentLength&&r-this._range.from>=this._contentLength&&(r=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:n,to:r},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var a in o)o.hasOwnProperty(a)&&r.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers)for(var a in o=this._config.headers)o.hasOwnProperty(a)&&r.setRequestHeader(a,o[a]);r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=a.eO.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=a.eO.kBuffering}else{if(this._status=a.eO.kError,!this._onError)throw new l.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==a.eO.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,o=i;if(e<t[0])return t[0];for(;r<=o;){if((n=r+Math.floor((o-r)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:o=n-1}},t.prototype._onLoad=function(e){if(this._status!==a.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var n=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(n,r,this._receivedLength),o&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var f=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const _=function(e){function t(t,i){var n=e.call(this,"websocket-loader")||this;return n.TAG="WebSocketLoader",n._needStash=!0,n._ws=null,n._requestAbort=!1,n._receivedLength=0,n}return f(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=a.eO.kConnecting}catch(e){this._status=a.eO.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(i.msg);this._onError(a.Xv.EXCEPTION,i)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=a.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=a.eO.kBuffering},t.prototype._onWebSocketClose=function(e){this._requestAbort?this._requestAbort=!1:(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1))},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(null==i?void 0:i.result)},i.readAsArrayBuffer(e.data)}else{this._status=a.eO.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new l.Al(n.msg);this._onError(a.Xv.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=a.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(t.msg);this._onError(a.Xv.EXCEPTION,t)},t}(a.HC),m=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i,n={};return 0!==t.from||-1!==t.to?(i=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),n.Range=i):this._zeroStart&&(n.Range="bytes=0-"),{url:e,headers:n}},e.prototype.removeURLParameters=function(e){return e},e}(),v=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var n=!0;i.includes("?")||(i+="?",n=!1),n&&(i+="&"),i+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(i+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t,i=e.split("?")[0],n=e.indexOf("?");-1!==n&&(t=e.substring(n+1));var r="";if(void 0!==t&&t.length>0)for(var o=t.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),l=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(r+="&"),r+=o[a])}return 0===r.length?i:i+"?"+r},e}(),g=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,void 0!==t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,t.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url||""),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new r,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){var e,t,i;(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&(null===(t=this._loader)||void 0===t||t.abort()),null===(i=this._loader)||void 0===i||i.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){var e;return(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){var e;return null===(e=this._dataSource)||void 0===e?void 0:e.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){var e;return null!=this._redirectedURL||void 0!==(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){var e;return this._redirectedURL||(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){var e,t;return this._loaderClass===p?null===(e=this._loader)||void 0===e?void 0:e.currentSpeed:null===(t=this._speedSampler)||void 0===t?void 0:t.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new m(!!this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new v(t,i)}else{if("custom"!==e.seekType)throw new l.Qn("Invalid seekType in config: ".concat((null==e?void 0:e.seekType)||""));if("function"!=typeof e.customSeekHandler)throw new l.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){var e;if(null!=this._config.customLoader)this._loaderClass=(null===(e=this._config)||void 0===e?void 0:e.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=_;else if(d.isSupported())this._loaderClass=d;else if(u.isSupported())this._loaderClass=u;else{if(!p.isSupported())throw new l.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=p}},e.prototype._createLoader=function(){var e;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(e=this._loader)||void 0===e?void 0:e.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},e.prototype.open=function(e){var t,i;this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),null===(t=this._speedSampler)||void 0===t||t.reset(),e||(this._fullRequestFlag=!0),null===(i=this._loader)||void 0===i||i.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){var e;null===(e=this._loader)||void 0===e||e.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){var e,t;this.isWorking()&&(null===(e=this._loader)||void 0===e||e.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){var i,n,r,o;(null===(i=this._loader)||void 0===i?void 0:i.isWorking())&&(null===(n=this._loader)||void 0===n||n.abort()),this._flushStashBuffer(t),null===(r=this._loader)||void 0===r||r.destroy(),this._loader=null;var a={from:e,to:-1};this._currentRange={from:a.from,to:-1},null===(o=this._speedSampler)||void 0===o||o.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,a),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new l.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var i=new ArrayBuffer(t);if(this._stashUsed>0){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,r=0,o=i;if(e<t[0])return t[0];for(;r<=o;){if((n=r+Math.floor((o-r)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:o=n-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange&&(this._currentRange.to=t+e.byteLength-1),this._onDataArrival?this._onDataArrival(e,t):0},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,i){var n,r;if(!this._onDataArrival)throw new l.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(n=this._speedSampler)||void 0===n||n.addBytes(e.byteLength);var o=null===(r=this._speedSampler)||void 0===r?void 0:r.lastSecondKBps;if(0!==o){var a=this._normalizeSpeed(o);this._speedNormalized!==a&&(this._speedNormalized=a,this._adjustStashSize(a))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(d=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(d=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed);(c=this._dispatchChunks(s,this._stashByteStart))<s.byteLength?c>0&&(u=new Uint8Array(s,c),d.set(u,0),this._stashUsed=u.byteLength,this._stashByteStart+=c):(this._stashUsed=0,this._stashByteStart+=c),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),d=new Uint8Array(this._stashBuffer,0,this._bufferSize)),d.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(c=this._dispatchChunks(e,t))<e.byteLength&&((A=e.byteLength-c)>this._bufferSize&&(this._expandBuffer(A),d=new Uint8Array(this._stashBuffer,0,this._bufferSize)),d.set(new Uint8Array(e,c),0),this._stashUsed+=A,this._stashByteStart=t+c);else if(0===this._stashUsed){var A;(c=this._dispatchChunks(e,t))<e.byteLength&&((A=e.byteLength-c)>this._bufferSize&&this._expandBuffer(A),(d=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,c),0),this._stashUsed+=A,this._stashByteStart=t+c)}else{var d,c;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(d=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(c=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&c>0){var u=new Uint8Array(this._stashBuffer,c);d.set(u,0)}this._stashUsed-=c,this._stashByteStart+=c}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),r=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){var o=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,i);o.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=i}return 0}n.A.w(this.TAG,"".concat(r," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,r}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){var i;switch(n.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=a.Xv.UNRECOVERABLE_EARLY_EOF),e){case a.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var r=((null===(i=this._currentRange)||void 0===i?void 0:i.to)||0)+1;return void(r<this._totalLength&&(n.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(r,!1)))}e=a.Xv.UNRECOVERABLE_EARLY_EOF;case a.Xv.UNRECOVERABLE_EARLY_EOF:case a.Xv.CONNECTING_TIMEOUT:case a.Xv.HTTP_STATUS_CODE_INVALID:case a.Xv.EXCEPTION:}if(!this._onError)throw new l.Al("IOException: "+t.msg);this._onError(e,t)},e}()},8125:(e,t,i)=>{var n=i(4347),r=i(9211),o=i(9083),a=i(577),s=i(8465),l=a("IE_PROTO"),A=Object,d=A.prototype;e.exports=s?A.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof A?d:null}},8286:(e,t,i)=>{var n=i(9646),r=i(3643),o=i(6330);e.exports=function(e,t,i){n?r.f(e,t,o(0,i)):e[t]=i}},8401:(e,t,i)=>{var n=i(815),r=i(7749),o=i(452);e.exports=function(e,t,i){var a,s;r(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw i;if(s)throw a;return r(a),i}},8465:(e,t,i)=>{var n=i(2809);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},8587:(e,t,i)=>{var n=i(2809),r=i(1562).RegExp,o=n((function(){var e=r("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||n((function(){return!r("a","y").sticky})),s=o||n((function(){var e=r("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},8611:(e,t,i)=>{var n=i(2809),r=i(7553),o=i(4941),a=r("species");e.exports=function(e){return o>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},8626:(e,t,i)=>{var n=i(6458);e.exports=n([].slice)},8635:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(2139),r=i(2460);const o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return r.A.FORCE_GLOBAL_TAG},set:function(t){r.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return r.A.GLOBAL_TAG},set:function(t){r.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return r.A.ENABLE_VERBOSE&&r.A.ENABLE_DEBUG&&r.A.ENABLE_INFO&&r.A.ENABLE_WARN&&r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_VERBOSE=t,r.A.ENABLE_DEBUG=t,r.A.ENABLE_INFO=t,r.A.ENABLE_WARN=t,r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return r.A.ENABLE_DEBUG},set:function(t){r.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return r.A.ENABLE_VERBOSE},set:function(t){r.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return r.A.ENABLE_INFO},set:function(t){r.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return r.A.ENABLE_WARN},set:function(t){r.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:r.A.GLOBAL_TAG,forceGlobalTag:r.A.FORCE_GLOBAL_TAG,enableVerbose:r.A.ENABLE_VERBOSE,enableDebug:r.A.ENABLE_DEBUG,enableInfo:r.A.ENABLE_INFO,enableWarn:r.A.ENABLE_WARN,enableError:r.A.ENABLE_ERROR,enableCallback:r.A.ENABLE_CALLBACK}},e.applyConfig=function(e){r.A.GLOBAL_TAG=e.globalTag,r.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,r.A.ENABLE_VERBOSE=e.enableVerbose,r.A.ENABLE_DEBUG=e.enableDebug,r.A.ENABLE_INFO=e.enableInfo,r.A.ENABLE_WARN=e.enableWarn,r.A.ENABLE_ERROR=e.enableError,r.A.ENABLE_CALLBACK=!!e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){r.A.emitter.addListener("log",t),r.A.emitter.listenerCount("log")>0&&(r.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){r.A.emitter.removeListener("log",t),0===r.A.emitter.listenerCount("log")&&(r.A.ENABLE_CALLBACK=!1,e._notifyChange())},e.emitter=new n.A,e}()},8845:(e,t,i)=>{var n=i(9364),r=i(9646),o=i(1562),a=i(6458),s=i(4347),l=i(9211),A=i(9615),d=i(6677),c=i(1176),u=i(7478),h=o.Symbol,p=h&&h.prototype;if(r&&l(h)&&(!("description"in p)||void 0!==h().description)){var f={},_=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:d(arguments[0]),t=A(p,this)?new h(e):void 0===e?h():h(e);return""===e&&(f[t]=!0),t};u(_,h),_.prototype=p,p.constructor=_;var m="Symbol(description detection)"===String(h("description detection")),v=a(p.valueOf),g=a(p.toString),y=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),E=a("".slice);c(p,"description",{configurable:!0,get:function(){var e=v(this);if(s(f,e))return"";var t=g(e),i=m?E(t,7,-1):b(t,y,"$1");return""===i?void 0:i}}),n({global:!0,constructor:!0,forced:!0},{Symbol:_})}},8862:(e,t,i)=>{var n=i(1562),r=i(9402),o=i(62),a=i(2377),s=i(9277),l=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var A in r)r[A]&&l(n[A]&&n[A].prototype);l(o)},8870:(e,t,i)=>{i.d(t,{A:()=>r});var n={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(e)||!e.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},o={};if(r.browser){o[r.browser]=!0;var a=r.majorVersion.split(".");o.version={major:parseInt(r.majorVersion,10),string:r.version},a.length>1&&(o.version.minor=parseInt(a[1],10)),a.length>2&&(o.version.build=parseInt(a[2],10))}if(r.platform&&(o[r.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),o.rv||o.iemobile){o.rv&&delete o.rv;var s="msie";r.browser=s,o[s]=!0}if(o.edge){delete o.edge;var l="msedge";r.browser=l,o[l]=!0}if(o.opr){var A="opera";r.browser=A,o[A]=!0}if(o.safari&&o.android){var d="android";r.browser=d,o[d]=!0}for(var c in o.name=r.browser,o.platform=r.platform,n)Object.prototype.hasOwnProperty.call(n,c)&&delete n[c];Object.assign(n,o)}();const r=n},8873:(e,t,i)=>{var n=i(3930);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},8891:(e,t,i)=>{var n=i(6898),r=Function.prototype,o=r.apply,a=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},9034:(e,t,i)=>{i.d(t,{HC:()=>a,Xv:()=>o,eO:()=>r});var n=i(4383),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},o={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},a=function(){function e(e){this._type=e||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===r.kConnecting||this._status===r.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new n.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.Xu("Unimplemented abstract function!")},e}()},9047:(e,t,i)=>{var n=i(5810),r=i(2671),o=i(4152),a=i(7553)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(r(t)&&(t===s||n(t.prototype))||o(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},9083:(e,t,i)=>{var n=i(5840),r=Object;e.exports=function(e){return r(n(e))}},9211:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},9260:(e,t,i)=>{var n=i(815),r=i(7749),o=i(9211),a=i(526),s=i(9377),l=TypeError;e.exports=function(e,t){var i=e.exec;if(o(i)){var A=n(i,e,t);return null!==A&&r(A),A}if("RegExp"===a(e))return n(s,e,t);throw new l("RegExp#exec called on incompatible receiver")}},9266:(e,t,i)=>{var n=i(7917);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},9273:(e,t,i)=>{var n=i(497),r=i(452),o=i(5599),a=i(2327),s=i(7553)("iterator");e.exports=function(e){if(!o(e))return r(e,s)||r(e,"@@iterator")||a[n(e)]}},9277:(e,t,i)=>{var n=i(9646),r=i(3643),o=i(6330);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9364:(e,t,i)=>{var n=i(1562),r=i(2897).f,o=i(9277),a=i(3930),s=i(4191),l=i(7478),A=i(4346);e.exports=function(e,t){var i,d,c,u,h,p=e.target,f=e.global,_=e.stat;if(i=f?n:_?n[p]||s(p,{}):n[p]&&n[p].prototype)for(d in t){if(u=t[d],c=e.dontCallGetSet?(h=r(i,d))&&h.value:i[d],!A(f?d:p+(_?".":"#")+d,e.forced)&&void 0!==c){if(typeof u==typeof c)continue;l(u,c)}(e.sham||c&&c.sham)&&o(u,"sham",!0),a(i,d,u,e)}}},9377:(e,t,i)=>{var n,r,o=i(815),a=i(6458),s=i(6677),l=i(7677),A=i(8587),d=i(3463),c=i(6122),u=i(3587).get,h=i(7517),p=i(6288),f=d("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,m=_,v=a("".charAt),g=a("".indexOf),y=a("".replace),b=a("".slice),E=(r=/b*/g,o(_,n=/a/,"a"),o(_,r,"a"),0!==n.lastIndex||0!==r.lastIndex),S=A.BROKEN_CARET,C=void 0!==/()??/.exec("")[1];(E||C||S||h||p)&&(m=function(e){var t,i,n,r,a,A,d,h=this,p=u(h),w=s(e),T=p.raw;if(T)return T.lastIndex=h.lastIndex,t=o(m,T,w),h.lastIndex=T.lastIndex,t;var k=p.groups,L=S&&h.sticky,I=o(l,h),O=h.source,B=0,R=w;if(L&&(I=y(I,"y",""),-1===g(I,"g")&&(I+="g"),R=b(w,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==v(w,h.lastIndex-1))&&(O="(?: "+O+")",R=" "+R,B++),i=new RegExp("^(?:"+O+")",I)),C&&(i=new RegExp("^"+O+"$(?!\\s)",I)),E&&(n=h.lastIndex),r=o(_,L?i:h,R),L?r?(r.input=b(r.input,B),r[0]=b(r[0],B),r.index=h.lastIndex,h.lastIndex+=r[0].length):h.lastIndex=0:E&&r&&(h.lastIndex=h.global?r.index+r[0].length:n),C&&r&&r.length>1&&o(f,r[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r&&k)for(r.groups=A=c(null),a=0;a<k.length;a++)A[(d=k[a])[0]]=r[d[1]];return r}),e.exports=m},9402:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9518:(e,t,i)=>{i(5597);var n=i(815),r=i(3930),o=i(9377),a=i(2809),s=i(7553),l=i(9277),A=s("species"),d=RegExp.prototype;e.exports=function(e,t,i,c){var u=s(e),h=!a((function(){var t={};return t[u]=function(){return 7},7!==""[e](t)})),p=h&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[A]=function(){return i},i.flags="",i[u]=/./[u]),i.exec=function(){return t=!0,null},i[u](""),!t}));if(!h||!p||i){var f=/./[u],_=t(u,""[e],(function(e,t,i,r,a){var s=t.exec;return s===o||s===d.exec?h&&!a?{done:!0,value:n(f,t,i,r)}:{done:!0,value:n(e,i,t,r)}:{done:!1}}));r(String.prototype,e,_[0]),r(d,u,_[1])}c&&l(d[u],"sham",!0)}},9603:(e,t,i)=>{var n=i(5057),r=i(1176),o=i(7553),a=i(9646),s=o("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},9614:(e,t,i)=>{var n=i(3643).f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},9615:(e,t,i)=>{var n=i(6458);e.exports=n({}.isPrototypeOf)},9646:(e,t,i)=>{var n=i(2809);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9666:(e,t,i)=>{var n=i(4152),r=i(526),o=i(7553)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===r(e))}},9688:(e,t,i)=>{var n=i(9364),r=i(2809),o=i(5810),a=i(4152),s=i(9083),l=i(256),A=i(7955),d=i(8286),c=i(2807),u=i(8611),h=i(7553),p=i(4941),f=h("isConcatSpreadable"),_=p>=51||!r((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),m=function(e){if(!a(e))return!1;var t=e[f];return void 0!==t?!!t:o(e)};n({target:"Array",proto:!0,arity:1,forced:!_||!u("concat")},{concat:function(e){var t,i,n,r,o,a=s(this),u=c(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(m(o=-1===t?a:arguments[t]))for(r=l(o),A(h+r),i=0;i<r;i++,h++)i in o&&d(u,h,o[i]);else A(h+1),d(u,h++,o);return u.length=h,u}})},9695:(e,t,i)=>{var n=i(6458),r=i(5810),o=i(9211),a=i(526),s=i(6677),l=n([].push);e.exports=function(e){if(o(e))return e;if(r(e)){for(var t=e.length,i=[],n=0;n<t;n++){var A=e[n];"string"==typeof A?l(i,A):"number"!=typeof A&&"Number"!==a(A)&&"String"!==a(A)||l(i,s(A))}var d=i.length,c=!0;return function(e,t){if(c)return c=!1,t;if(r(this))return t;for(var n=0;n<d;n++)if(i[n]===e)return t}}}},9742:(e,t,i)=>{var n=i(7917);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9845:e=>{e.exports=!1},9879:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},9917:(e,t,i)=>{var n=i(9922),r=i(3930),o=i(309);n||r(Object.prototype,"toString",o,{unsafe:!0})},9922:(e,t,i)=>{var n={};n[i(7553)("toStringTag")]="z",e.exports="[object z]"===String(n)},9953:(e,t,i)=>{i.d(t,{A:()=>Me});var n=i(2139),r=i(2460),o=i(8870),a=i(719);function s(e,t,i){var n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}const l=function(e){for(var t=[],i=e,n=0,r=e.length;n<r;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(s(i,n,1)&&(o=(31&i[n])<<6|63&i[n+1])>=128){t.push(String.fromCharCode(65535&o)),n+=2;continue}}else if(i[n]<240){if(s(i,n,2)&&(o=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2])>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),n+=3;continue}}else if(i[n]<248){var o;if(s(i,n,3)&&(o=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3])>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};var A,d=i(4383),c=(A=new ArrayBuffer(2),new DataView(A).setInt16(0,256,!0),256===new Int16Array(A)[0]);const u=function(){function e(){}return e.parseScriptData=function(t,i,n){var o={};try{var a=e.parseValue(t,i,n),s=e.parseValue(t,i+a.size,n-a.size);o[a.data]=s.data}catch(e){r.A.e("AMF",e.toString())}return o},e.parseObject=function(t,i,n){if(n<3)throw new d.j4("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),o=e.parseValue(t,i+r.size,n-r.size),a=o.objectEnd;return{data:{name:r.data,value:o.data},size:r.size+o.size,objectEnd:a}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new d.j4("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!c);return{data:n>0?l(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new d.j4("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!c);return{data:n>0?l(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new d.j4("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!c),o=n.getInt16(8,!c);return{data:new Date(r+=60*o*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new d.j4("Data not enough when parse Value");var o,a=new DataView(t,i,n),s=1,l=a.getUint8(0),A=!1;try{switch(l){case 0:o=a.getFloat64(1,!c),s+=8;break;case 1:o=!!a.getUint8(1),s+=1;break;case 2:var u=e.parseString(t,i+1,n-1);o=u.data,s+=u.size;break;case 3:o={};var h=0;for(9==(16777215&a.getUint32(n-4,!c))&&(h=3);s<n-4;){var p=e.parseObject(t,i+s,n-s-h);if(p.objectEnd)break;o[p.data.name]=p.data.value,s+=p.size}s<=n-3&&9==(16777215&a.getUint32(s-1,!c))&&(s+=3);break;case 8:for(o={},s+=4,h=0,9==(16777215&a.getUint32(n-4,!c))&&(h=3);s<n-8;){var f=e.parseVariable(t,i+s,n-s-h);if(f.objectEnd)break;o[f.data.name]=f.data.value,s+=f.size}s<=n-3&&9==(16777215&a.getUint32(s-1,!c))&&(s+=3);break;case 9:o=void 0,s=1,A=!0;break;case 10:o=[];var _=a.getUint32(1,!c);s+=4;for(var m=0;m<_;m++){var v=e.parseValue(t,i+s,n-s);o.push(v.data),s+=v.size}break;case 11:var g=e.parseDate(t,i+1,n-1);o=g.data,s+=g.size;break;case 12:var y=e.parseString(t,i+1,n-1);o=y.data,s+=y.size;break;default:s=n,r.A.w("AMF","Unsupported AMF value type "+l.toString())}}catch(e){r.A.e("AMF",e.toString())}return{data:o,size:s,objectEnd:A}},e}(),h=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e,t=this._total_bytes-this._buffer_index;if(t<=0)throw new d.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var i=Math.min(4,t),n=new Uint8Array(4);n.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i},e.prototype.readBits=function(e){if(e>32)throw new d.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(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 n=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(n,this._current_word_bits_left),o=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,i<<r|o},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),p=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){for(var i=t.subarray(1,4),n="avc1.",r=0;r<3;r++){var o=i[r].toString(16);o.length<2&&(o="0"+o),n+=o}var a=e._ebsp2rbsp(t),s=new h(a);s.readByte();var l=s.readByte();s.readByte();var A=s.readByte();s.readUEG();var d=e.getProfileString(l),c=e.getLevelString(A),u=1,p=420,f=8,_=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(3===(u=s.readUEG())&&s.readBits(1),u<=3&&(p=[0,420,422,444][u]),f=s.readUEG()+8,_=s.readUEG()+8,s.readBits(1),s.readBool()))for(var m=3!==u?8:12,v=0;v<m;v++)s.readBool()&&(v<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var g=s.readUEG();if(0===g)s.readUEG();else if(1===g){s.readBits(1),s.readSEG(),s.readSEG();var y=s.readUEG();for(v=0;v<y;v++)s.readSEG()}var b=s.readUEG();s.readBits(1);var E=s.readUEG(),S=s.readUEG(),C=s.readBits(1);0===C&&s.readBits(1),s.readBits(1);var w=0,T=0,k=0,L=0;s.readBool()&&(w=s.readUEG(),T=s.readUEG(),k=s.readUEG(),L=s.readUEG());var I=1,O=1,B=0,R=!0,x=0,D=0;if(s.readBool()){if(s.readBool()){var M=s.readByte();M>0&&M<16?(I=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][M-1],O=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][M-1]):255===M&&(I=s.readByte()<<8|s.readByte(),O=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 P=s.readBits(32),U=s.readBits(32);R=s.readBool(),B=(x=U)/(D=2*P)}}var $=1;1===I&&1===O||($=I/O);var F=0,N=0;0===u?(F=1,N=2-C):(F=3===u?1:2,N=(1===u?2:1)*(2-C));var V=16*(E+1),j=16*(S+1)*(2-C);V-=(w+T)*F,j-=(k+L)*N;var Q=Math.ceil(V*$);return s.destroy(),s=null,{codec_mimetype:n,profile_idc:l,level_idc:A,profile_string:d,level_string:c,chroma_format_idc:u,bit_depth:f,bit_depth_luma:f,bit_depth_chroma:_,ref_frames:b,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:R,fps:B,fps_den:D,fps_num:x},sar_ratio:{width:I,height:O},codec_size:{width:V,height:j},present_size:{width:Q,height:j}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0;r<t;r++)0!==n&&(n=(i+e.readSEG()+256)%256),i=0===n?i:n},e.getProfileString=function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},e}();var f=i(6399);const _=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),n=new h(i);return n.readByte(),n.readByte(),n.readBits(4),n.readBits(2),n.readBits(6),{num_temporal_layers:n.readBits(3)+1,temporal_id_nested:n.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new h(i);n.readByte(),n.readByte();for(var r=0,o=0,a=0,s=0,l=(n.readBits(4),n.readBits(3)),A=(n.readBool(),n.readBits(2)),d=n.readBool(),c=n.readBits(5),u=n.readByte(),p=n.readByte(),f=n.readByte(),_=n.readByte(),m=n.readByte(),v=n.readByte(),g=n.readByte(),y=n.readByte(),b=n.readByte(),E=n.readByte(),S=n.readByte(),C=[],w=[],T=0;T<l;T++)C.push(n.readBool()),w.push(n.readBool());if(l>0)for(T=l;T<8;T++)n.readBits(2);for(T=0;T<l;T++)C[T]&&(n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte()),w[T]&&n.readByte();n.readUEG();var k=n.readUEG();3===k&&n.readBits(1);var L=n.readUEG(),I=n.readUEG();n.readBool()&&(r+=n.readUEG(),o+=n.readUEG(),a+=n.readUEG(),s+=n.readUEG());var O=n.readUEG(),B=n.readUEG(),R=n.readUEG();for(T=n.readBool()?0:l;T<=l;T++)n.readUEG(),n.readUEG(),n.readUEG();if(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readBool()&&n.readBool())for(var x=0;x<4;x++)for(var D=0;D<(3===x?2:6);D++)if(n.readBool()){var M=Math.min(64,1<<4+(x<<1));for(x>1&&n.readSEG(),T=0;T<M;T++)n.readSEG()}else n.readUEG();n.readBool(),n.readBool(),n.readBool()&&(n.readByte(),n.readUEG(),n.readUEG(),n.readBool());var P=n.readUEG(),U=0;for(T=0;T<P;T++){var $=!1;if(0!==T&&($=n.readBool()),$){T===P&&n.readUEG(),n.readBool(),n.readUEG();for(var F=0,N=0;N<=U;N++){var V=n.readBool(),j=!1;V||(j=n.readBool()),(V||j)&&F++}U=F}else{var Q=n.readUEG(),G=n.readUEG();for(U=Q+G,N=0;N<Q;N++)n.readUEG(),n.readBool();for(N=0;N<G;N++)n.readUEG(),n.readBool()}}if(n.readBool()){var z=n.readUEG();for(T=0;T<z;T++){for(N=0;N<R+4;N++)n.readBits(1);n.readBits(1)}}var H=0,W=1,q=1,K=!1,Y=1,X=1;if(n.readBool(),n.readBool(),n.readBool()){if(n.readBool()){var Z=n.readByte();Z>0&&Z<=16?(W=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Z-1],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Z-1]):255===Z&&(W=n.readBits(16),q=n.readBits(16))}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(3),n.readBool(),n.readBool()&&(n.readByte(),n.readByte(),n.readByte())),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool(),n.readBool(),n.readBool(),n.readBool()&&(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG()),n.readBool()&&(Y=n.readBits(32),X=n.readBits(32),n.readBool()&&n.readUEG(),n.readBool())){var J,ee,te=!1;for(J=n.readBool(),ee=n.readBool(),(J||ee)&&((te=n.readBool())&&(n.readByte(),n.readBits(5),n.readBool(),n.readBits(5)),n.readBits(4),n.readBits(4),te&&n.readBits(4),n.readBits(5),n.readBits(5),n.readBits(5)),T=0;T<=l;T++){var ie=n.readBool();K=ie;var ne=!1,re=1;ie||(ne=n.readBool());var oe=!1;if(ne?n.readSEG():oe=n.readBool(),oe||(re=n.readUEG()+1),J)for(N=0;N<re;N++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());if(ee)for(N=0;N<re;N++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG())}}n.readBool()&&(n.readBool(),n.readBool(),n.readBool(),H=n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG())}n.readBool();var ae="hvc1.".concat(c,".1.L").concat(S,".B0"),se=L-(r+o)*(1===k||2===k?2:1),le=I-(a+s)*(1===k?2:1),Ae=1;return 1!==W&&1!==q&&(Ae=W/q),n.destroy(),n=null,{codec_mimetype:ae,level_string:e.getLevelString(S),profile_idc:c,bit_depth:O+8,ref_frames:1,chroma_format:k,chroma_format_string:e.getChromaFormatString(k),general_level_idc:S,general_profile_space:A,general_tier_flag:d,general_profile_idc:c,general_profile_compatibility_flags_1:u,general_profile_compatibility_flags_2:p,general_profile_compatibility_flags_3:f,general_profile_compatibility_flags_4:_,general_constraint_indicator_flags_1:m,general_constraint_indicator_flags_2:v,general_constraint_indicator_flags_3:g,general_constraint_indicator_flags_4:y,general_constraint_indicator_flags_5:b,general_constraint_indicator_flags_6:E,min_spatial_segmentation_idc:H,constant_frame_rate:0,chroma_format_idc:k,bit_depth_luma_minus8:O,bit_depth_chroma_minus8:B,frame_rate:{fixed:K,fps:X/Y,fps_den:Y,fps_num:X},sar_ratio:{width:W,height:q},codec_size:{width:se,height:le},present_size:{width:se*Ae,height:le}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),n=new h(i);n.readByte(),n.readByte(),n.readUEG(),n.readUEG(),n.readBool(),n.readBool(),n.readBits(3),n.readBool(),n.readBool(),n.readUEG(),n.readUEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool()&&n.readUEG(),n.readSEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool(),n.readBool();var r=n.readBool(),o=n.readBool(),a=1;return o&&r?a=0:o?a=3:r&&(a=2),{parallelismType:a}},e.getChromaFormatString=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"}},e.getProfileString=function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();function m(e){return e.byteOffset%2==0&&e.byteLength%2==0}function v(e){return e.byteOffset%4==0&&e.byteLength%4==0}function g(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const y=function(e,t){return e.byteLength===t.byteLength&&(v(e)&&v(t)?function(e,t){return g(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):m(e)&&m(t)?function(e,t){return g(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return g(e,t)}(e,t))},b=function(){function e(){}return e.parseOBUs=function(t){for(var i=null,n=0;n<t.byteLength;){t[n];var r=(120&t[n])>>3,o=!!(4&t[n]),a=!!(2&t[n]);t[n],n+=1,o&&(n+=1);var s=Number.POSITIVE_INFINITY;if(a){s=0;for(var l=0;s|=(127&t[n])<<7*l,128&t[n+=1];l++);}1===r&&(i=e.parseSeuqneceHeader(t.subarray(n,n+s))),n+=s}return i},e.parseSeuqneceHeader=function(t){var i=new h(t),n=i.readBits(3),r=(i.readBool(),i.readBool()),o=!0,a=0,s=0,l=[];if(r)l.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var A=i.readBits(32),d=i.readBits(32),c=i.readBool();if(c){for(var u=0;0===i.readBits(1);)u+=1;u>=32||i.readBits(u)}a=d,s=A,o=c,i.readBool()&&(i.readBits(5),i.readBits(32),i.readBits(5),i.readBits(5))}for(var p=i.readBool(),f=i.readBits(5),_=0;_<=f;_++){var m=i.readBits(12),v=i.readBits(5),g=v>7?i.readBits(1):0;l.push({operating_point_idc:m,level:v,tier:g}),p&&i.readBool()&&i.readBits(4)}}var y=l[0],b=y.level,E=y.tier,S=i.readBits(4),C=i.readBits(4),w=i.readBits(S+1)+1,T=i.readBits(C+1)+1,k=!1;r||(k=i.readBool()),k&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var L=!1;r||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(L=i.readBool())&&(i.readBool(),i.readBool()),(i.readBool()||i.readBits(1))&&(i.readBool()||i.readBits(1)),L&&i.readBits(3)),i.readBool(),i.readBool(),i.readBool();var I=i.readBool(),O=8;O=2===n&&I?i.readBool()?12:10:I?10:8;var B=!1;1!==n&&(B=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var R=1,x=1;return B?(i.readBits(1),R=1,x=1):(i.readBits(1),0===n?(R=1,x=1):1===n?(R=0,x=0):12===O?i.readBits(1)&&i.readBits(1):(R=1,x=0),R&&x&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(n,".").concat(e.getLevelString(b,E),".").concat(O.toString(10).padStart(2,"0")),level:b,tier:E,level_string:e.getLevelString(b,E),profile_idc:n,profile_string:"".concat(n),bit_depth:O,ref_frames:1,chroma_format:e.getChromaFormat(B,R,x),chroma_format_string:e.getChromaFormatString(B,R,x),frame_rate:{fixed:o,fps:a/s,fps_den:s,fps_num:a},sar_ratio:{width:1,height:1},codec_size:{width:w,height:T},present_size:{width:1*w,height:T}}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN},e.getChromaFormatString=function(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"},e}();var E=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new a.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var n,r=(4&t[4])>>>2!=0,o=!!(1&t[4]),a=(n=t)[5]<<24|n[6]<<16|n[7]<<8|n[8];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:r,hasVideoTrack:o}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo&&(this._mediaInfo.duration=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo&&(this._mediaInfo.hasAudio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo&&(this._mediaInfo.hasVideo=e)},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new a.A},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){var n,o;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new d.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0,s=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;var l=e.probe(t);a=(null==l?void 0:l.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,i+a!==this._dataOffset&&r.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(A=new DataView(t,a)).getUint32(0,!s)&&r.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),a+=4);a<t.byteLength;){this._dispatch=!0;var A=new DataView(t,a);if(a+11+4>t.byteLength)break;var c=A.getUint8(0),u=16777215&A.getUint32(0,!s);if(a+11+u+4>t.byteLength)break;if(8===c||9===c||18===c){var h=A.getUint8(4),p=A.getUint8(5),f=A.getUint8(6)|p<<8|h<<16|A.getUint8(7)<<24;16777215&A.getUint32(7,!s)&&r.A.w(this.TAG,"Meet tag which has StreamID != 0!");var _=a+11;switch(c){case 8:this._parseAudioData(t,_,u,f);break;case 9:this._parseVideoData(t,_,u,f,i+a);break;case 18:this._parseScriptData(t,_,u)}var m=A.getUint32(11+u,!s);m!==11+u&&r.A.w(this.TAG,"Invalid PrevTagSize ".concat(m)),a+=11+u+4}else r.A.w(this.TAG,"Unsupported tag type ".concat(c,", skipped")),a+=11+u+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(n=this._audioTrack)||void 0===n?void 0:n.length)||(null===(o=this._videoTrack)||void 0===o?void 0:o.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),a},e.prototype._parseScriptData=function(e,t,i){var n,o,a,s=u.parseScriptData(e,t,i);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void r.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&r.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;var l=null===(n=this._metadata)||void 0===n?void 0:n.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},l)),"boolean"==typeof(null==l?void 0:l.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=l.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==l?void 0:l.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=l.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==l?void 0:l.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=l.audiodatarate),"number"==typeof(null==l?void 0:l.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=l.videodatarate),"number"==typeof(null==l?void 0:l.width)&&this._mediaInfo&&(this._mediaInfo.width=l.width),"number"==typeof(null==l?void 0:l.height)&&this._mediaInfo&&(this._mediaInfo.height=l.height),"number"==typeof(null==l?void 0:l.duration)){if(!this._durationOverrided){var A=Math.floor(l.duration*this._timescale);this._duration=A,this._mediaInfo&&(this._mediaInfo.duration=A)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==l?void 0:l.framerate)){var d=Math.floor(1e3*l.framerate);if(d>0){var c=d/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=c,this._referenceFrameRate.fps_num=d,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=c)}}if("object"==typeof(null==l?void 0:l.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var h=l.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h)),l.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=l),r.A.v(this.TAG,"Parsed onMetaData"),(null===(o=this._mediaInfo)||void 0===o?void 0:o.isComplete())&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,this._mediaInfo))}Object.keys(s).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},s))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n<e.times.length;n++){var r=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(r),i.push(e.filepositions[n])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,n){var o,a,s,l,A,d,c,u,h,p;if(i<=1)r.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var _=new DataView(e,t,i).getUint8(0),m=_>>>4;if(2===m||10===m){var v=0,g=(12&_)>>>2;if(g>=0&&g<=4){v=this._flvSoundRateTable[g];var b=1&_,E=this._audioMetadata,S=this._audioTrack;if(E||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(E=this._audioMetadata={}).type="audio",E.id=null==S?void 0:S.id,E.timescale=this._timescale,E.duration=this._duration,E.audioSampleRate=v,E.channelCount=0===b?1:2),10===m){var C=this._parseAACAudioData(e,t+1,i-1);if(void 0===C)return;if(0===(null==C?void 0:C.packetType)){if(null==E?void 0:E.config){if(y(C.data.config,null==E?void 0:E.config))return;r.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var w=C.data;E.audioSampleRate=null==w?void 0:w.samplingRate,E.channelCount=null==w?void 0:w.channelCount,E.codec=null==w?void 0:w.codec,E.originalCodec=null==w?void 0:w.originalCodec,E.config=null==w?void 0:w.config,E.refSampleDuration=1024/E.audioSampleRate*E.timescale,r.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"audio",E),(L=this._mediaInfo).audioCodec=E.originalCodec||"",L.audioSampleRate=E.audioSampleRate,L.audioChannelCount=E.channelCount,L.hasVideo?null!=L.videoCodec&&(L.mimeType='video/x-flv; codecs="'+L.videoCodec+","+L.audioCodec+'"'):L.mimeType='video/x-flv; codecs="'+L.audioCodec+'"',(null==L?void 0:L.isComplete())&&(null===(c=this._onMediaInfo)||void 0===c||c.call(this,L))}else if(1===C.packetType){var T=this._timestampBase+n,k={unit:C.data,length:C.data.byteLength,dts:T,pts:T};S&&(null==S||S.samples.push(k),S.length+=(null===(u=null==C?void 0:C.data)||void 0===u?void 0:u.length)||0)}else r.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(C.packetType))}else if(2===m){if(!E.codec){var L;if(void 0===(w=this._parseMP3AudioData(e,t+1,i-1,!0)))return;E.audioSampleRate=w.samplingRate,E.channelCount=w.channelCount,E.codec=w.codec,E.originalCodec=w.originalCodec,E.refSampleDuration=1152/E.audioSampleRate*E.timescale,r.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(h=this._onTrackMetadata)||void 0===h||h.call(this,"audio",E),(L=this._mediaInfo).audioCodec=E.codec,L.audioSampleRate=E.audioSampleRate,L.audioChannelCount=E.channelCount,L.audioDataRate=w.bitRate,(null==L?void 0:L.hasVideo)?null!=L.videoCodec&&(L.mimeType='video/x-flv; codecs="'+L.videoCodec+","+L.audioCodec+'"'):L.mimeType='video/x-flv; codecs="'+L.audioCodec+'"',L.isComplete()&&(null===(p=this._onMediaInfo)||void 0===p||p.call(this,L))}var I=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0===I)return;T=this._timestampBase+n;var O={unit:I,length:I.byteLength,dts:T,pts:T};null==S||S.samples.push(O),S&&(S.length+=I.length)}}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+g)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+m)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var n={},o=new Uint8Array(e,t,i);return n.packetType=o[0],0===o[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=o.subarray(1),n}r.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,r,o,a,s=new Uint8Array(e,t,i),l=null,A=0,d=null;if(A=o=s[0]>>>3,(a=(7&s[0])<<1|s[1]>>>7)<0||a>=this._mpegSamplingRates.length)null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var c=this._mpegSamplingRates[a],u=(120&s[1])>>>3;if(!(u<0||u>=8)){5===A&&(d=(7&s[1])<<1|s[2]>>>7,s[2]);var h=self.navigator.userAgent.toLowerCase();return h.includes("firefox")?a>=6?(A=5,l=new Array(4),d=a-3):(A=2,l=new Array(2),d=a):h.includes("android")?(A=2,l=new Array(2),d=a):(A=5,d=a,l=new Array(4),a>=6?d=a-3:1===u&&(A=2,l=new Array(2),d=a)),l[0]=A<<3,l[0]|=(15&a)>>>1,l[1]=(15&a)<<7,l[1]|=(15&u)<<3,5===A&&(l[1]|=(15&d)>>>1,l[2]=(1&d)<<7,l[2]|=8,l[3]=0),{config:l,samplingRate:c,channelCount:u,codec:"mp4a.40."+A,originalCodec:"mp4a.40."+o}}null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(!(i<4)){this._littleEndian;var o,a=new Uint8Array(e,t,i);if(n){if(255!==a[0])return;var s=a[1]>>>3&3,l=(6&a[1])>>1,A=(240&a[2])>>>4,d=(12&a[2])>>>2,c=3&~(a[3]>>>6)?2:1,u=0,h=0;switch(s){case 0:u=this._mpegAudioV25SampleRateTable[d];break;case 2:u=this._mpegAudioV20SampleRateTable[d];break;case 3:u=this._mpegAudioV10SampleRateTable[d]}switch(l){case 1:A<this._mpegAudioL3BitRateTable.length&&(h=this._mpegAudioL3BitRateTable[A]);break;case 2:A<this._mpegAudioL2BitRateTable.length&&(h=this._mpegAudioL2BitRateTable[A]);break;case 3:A<this._mpegAudioL1BitRateTable.length&&(h=this._mpegAudioL1BitRateTable[A])}o={bitRate:h,samplingRate:u,channelCount:c,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}r.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseVideoData=function(e,t,i,n,o){var a,s;if(i<=1)r.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!this._hasVideoFlagOverrided||!1!==this._hasVideo){var l=new Uint8Array(e,t,i)[0],A=(112&l)>>>4;if(128&l){var d=15&l,c=String.fromCharCode.apply(String,function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}(new Uint8Array(e,t,i).slice(1,5)),!1));"hvc1"===c?this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,n,o,A,d):"av01"===c?this._parseEnhancedAV1VideoPacket(e,t+5,i-5,n,o,A,d):null===(s=this._onError)||void 0===s||s.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(c))}else{var u=15&l;7===u?this._parseAVCVideoPacket(e,t+1,i-1,n,o,A):12===u?this._parseHEVCVideoPacket(e,t+1,i-1,n,o,A):null===(a=this._onError)||void 0===a||a.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(u))}}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,o,a){var s;if(i<4)r.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,A=new DataView(e,t,i),d=A.getUint8(0),c=(16777215&A.getUint32(0,!l))<<8>>8;0===d?this._parseAVCDecoderConfigurationRecord(e,t+4,i-4):1===d?this._parseAVCVideoData(e,t+4,i-4,n,o,a,c):2===d||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,n,o,a){var s;if(i<4)r.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var l=this._littleEndian,A=new DataView(e,t,i),d=A.getUint8(0),c=(16777215&A.getUint32(0,!l))<<8>>8;0===d?this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4):1===d?this._parseHEVCVideoData(e,t+4,i-4,n,o,a,c):2===d||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,n,r,o,a){var s,l=this._littleEndian,A=new DataView(e,t,i);if(0===a)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===a){var d=(4294967040&A.getUint32(0,!l))>>8;this._parseHEVCVideoData(e,t+3,i-3,n,r,o,d)}else 3===a?this._parseHEVCVideoData(e,t,i,n,r,o,0):2===a||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,n,r,o,a){var s,l;this._littleEndian,0===a?this._parseAV1CodecConfigurationRecord(e,t,i):1===a?this._parseAV1VideoData(e,t,i,n,r,o,0):5===a?null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(a)):2===a||null===(l=this._onError)||void 0===l||l.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){var n,o,a,s,l,A,d,c,u,h,_;if(i<7)r.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var m=this._videoMetadata,v=this._videoTrack,g=this._littleEndian,b=new DataView(e,t,i);if(m){if(void 0!==m.avcc){var E=new Uint8Array(e,t,i);if(y(E,m.avcc))return;r.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(m=this._videoMetadata={}).type="video",m.id=null==v?void 0:v.id,m.timescale=this._timescale,m.duration=this._duration;var S=b.getUint8(0),C=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===S&&0!==C)if(this._naluLengthSize=1+(3&b.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var w=31&b.getUint8(5);if(0!==w){w>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(w));for(var T=6,k=0;k<w;k++){var L=b.getUint16(T,!g);if(T+=2,0!==L){var I=new Uint8Array(e,t+T,L);T+=L;var O=p.parseSPS(I);if(0===k){m.codecWidth=O.codec_size.width,m.codecHeight=O.codec_size.height,m.presentWidth=O.present_size.width,m.presentHeight=O.present_size.height,m.profile=O.profile_string,m.level=O.level_string,m.bitDepth=O.bit_depth,m.chromaFormat=O.chroma_format,m.sarRatio=O.sar_ratio,m.frameRate=O.frame_rate,O.frame_rate.fixed&&0!==O.frame_rate.fps_num&&0!==O.frame_rate.fps_den||(m.frameRate=this._referenceFrameRate);var B=null===(s=m.frameRate)||void 0===s?void 0:s.fps_den,R=null===(l=m.frameRate)||void 0===l?void 0:l.fps_num;m.refSampleDuration=m.timescale*(B/R);for(var x=I.subarray(1,4),D="avc1.",M=0;M<3;M++){var P=x[M].toString(16);P.length<2&&(P="0"+P),D+=P}m.codec=D;var U=this._mediaInfo;U.width=m.codecWidth,U.height=m.codecHeight,U.fps=m.frameRate.fps,U.profile=m.profile,U.level=m.level,U.refFrames=O.ref_frames,U.chromaFormat=O.chroma_format_string,U.sarNum=m.sarRatio.width,U.sarDen=m.sarRatio.height,U.videoCodec=D,U.hasAudio?null!=U.audioCodec&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.videoCodec+'"',U.isComplete()&&(null===(A=this._onMediaInfo)||void 0===A||A.call(this,U))}}}var $=b.getUint8(T);if(0!==$){for($>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat($)),T++,k=0;k<$;k++)L=b.getUint16(T,!g),T+=2,0!==L&&(T+=L);m.avcc=new Uint8Array(i),m.avcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(c=this._audioTrack)||void 0===c?void 0:c.length)||(null===(u=this._videoTrack)||void 0===u?void 0:u.length))&&(null===(h=this._onDataAvailable)||void 0===h||h.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(_=this._onTrackMetadata)||void 0===_||_.call(this,"video",m)}else null===(d=this._onError)||void 0===d||d.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){var n,o,a,s,l,A,d;if(i<22)r.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var c=this._videoMetadata,u=this._videoTrack,h=this._littleEndian,p=new DataView(e,t,i);if(c){if(void 0!==c.hvcc){var m=new Uint8Array(e,t,i);if(y(m,c.hvcc))return;r.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(c=this._videoMetadata={}).type="video",c.id=null==u?void 0:u.id,c.timescale=this._timescale,c.duration=this._duration;var v=p.getUint8(0),g=31&p.getUint8(1);if(1===v&&0!==g)if(this._naluLengthSize=1+(3&p.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var b=p.getUint8(22),E=0,S=23;E<b;E++){var C=63&p.getUint8(S+0),w=p.getUint16(S+1,!h);S+=3;for(var T=0;T<w;T++){var k=p.getUint16(S+0,!h);if(0===T)if(33===C){S+=2;var L=new Uint8Array(e,t+S,k),I=_.parseSPS(L);c.codecWidth=I.codec_size.width,c.codecHeight=I.codec_size.height,c.presentWidth=I.present_size.width,c.presentHeight=I.present_size.height,c.profile=null==I?void 0:I.profile_string,c.level=I.level_string,c.bitDepth=I.bit_depth,c.chromaFormat=I.chroma_format,c.sarRatio=I.sar_ratio,c.frameRate=I.frame_rate,I.frame_rate.fixed&&0!==I.frame_rate.fps_num&&0!==I.frame_rate.fps_den||(c.frameRate=this._referenceFrameRate);var O=c.frameRate.fps_den,B=c.frameRate.fps_num;c.refSampleDuration=c.timescale*(O/B),c.codec=I.codec_mimetype;var R=this._mediaInfo;R.width=c.codecWidth,R.height=c.codecHeight,R.fps=c.frameRate.fps,R.profile=c.profile,R.level=c.level,R.refFrames=I.ref_frames,R.chromaFormat=I.chroma_format_string,R.sarNum=c.sarRatio.width,R.sarDen=c.sarRatio.height,R.videoCodec=I.codec_mimetype,R.hasAudio?null!=R.audioCodec&&(R.mimeType='video/x-flv; codecs="'+R.videoCodec+","+R.audioCodec+'"'):R.mimeType='video/x-flv; codecs="'+R.videoCodec+'"',R.isComplete()&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,R)),S+=k}else S+=2+k;else S+=2+k}}c.hvcc=new Uint8Array(i),c.hvcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"video",c)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){var n,o,a,s,l,A,d,c,u,h,p;if(i<4)r.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var _=this._videoMetadata,m=this._videoTrack,v=(this._littleEndian,new DataView(e,t,i));_?void 0!==_.av1c&&r.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(_=this._videoMetadata={}).type="video",_.id=null==m?void 0:m.id,_.timescale=this._timescale,_.duration=this._duration);var g=127&v.getUint8(0);if(v.getUint8(1),v.getUint8(1),v.getUint8(2),1===g){var y=b.parseOBUs(new Uint8Array(e,t+4,i-4));if(null!=y){_.codecWidth=null===(a=null==y?void 0:y.codec_size)||void 0===a?void 0:a.width,_.codecHeight=null===(s=null==y?void 0:y.codec_size)||void 0===s?void 0:s.height,_.presentWidth=null===(l=null==y?void 0:y.present_size)||void 0===l?void 0:l.width,_.presentHeight=null===(A=null==y?void 0:y.present_size)||void 0===A?void 0:A.height,_.profile=y.profile_string,_.level=y.level_string,_.bitDepth=y.bit_depth,_.chromaFormat=y.chroma_format,_.sarRatio=y.sar_ratio,_.frameRate=y.frame_rate,y.frame_rate.fixed&&0!==y.frame_rate.fps_num&&0!==y.frame_rate.fps_den||(_.frameRate=this._referenceFrameRate);var E=_.frameRate.fps_den,S=_.frameRate.fps_num;_.refSampleDuration=_.timescale*(E/S),_.codec=y.codec_mimetype;var C=this._mediaInfo;C.width=_.codecWidth,C.height=_.codecHeight,C.fps=_.frameRate.fps,C.profile=_.profile,C.level=_.level,C.refFrames=y.ref_frames,C.chromaFormat=y.chroma_format_string,C.sarNum=_.sarRatio.width,C.sarDen=_.sarRatio.height,C.videoCodec=y.codec_mimetype,C.hasAudio?null!=C.audioCodec&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.videoCodec+'"',C.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,C)),_.av1c=new Uint8Array(i),_.av1c.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(c=this._audioTrack)||void 0===c?void 0:c.length)||(null===(u=this._videoTrack)||void 0===u?void 0:u.length))&&(null===(h=this._onDataAvailable)||void 0===h||h.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(p=this._onTrackMetadata)||void 0===p||p.call(this,"video",_)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,n,o,a,s){for(var l=this._littleEndian,A=new DataView(e,t,i),d=[],c=0,u=0,h=this._naluLengthSize,p=this._timestampBase+n,f=1===a;u<i;){if(u+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(u,", dataSize = ").concat(i));break}var _=A.getUint32(u,!l);if(3===h&&(_>>>=8),_>i-h)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&A.getUint8(u+h);5===m&&(f=!0);var v=new Uint8Array(e,t+u,h+_),g={type:m,data:v};d.push(g),c+=v.byteLength,u+=h+_}if(d.length){var y=this._videoTrack,b={units:d,length:c,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(y.samples.push(b),y.length+=c)}},e.prototype._parseHEVCVideoData=function(e,t,i,n,o,a,s){for(var l=this._littleEndian,A=new DataView(e,t,i),d=[],c=0,u=0,h=this._naluLengthSize,p=this._timestampBase+n,f=1===a;u<i;){if(u+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(u,", dataSize = ").concat(i));break}var _=A.getUint32(u,!l);if(3===h&&(_>>>=8),_>i-h)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&A.getUint8(u+h);19!==m&&20!==m||(f=!0);var v=new Uint8Array(e,t+u,h+_),g={type:m,data:v};d.push(g),c+=v.byteLength,u+=h+_}if(d.length){var y=this._videoTrack,b={units:d,length:c,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(null==y||y.samples.push(b),y.length+=c)}},e.prototype._parseAV1VideoData=function(e,t,i,n,r,o,a){this._littleEndian;var s,l=[],A=this._timestampBase+n,d=1===o;if(s=i,l.push({unitType:0,data:new Uint8Array(e,t+0,i)}),l.length){var c=this._videoTrack,u={units:l,length:s,isKeyframe:d,dts:A,cts:a,pts:A+a};d&&(u.fileposition=r),c&&(null==c||c.samples.push(u),c.length+=s)}},e}();const S=E,C=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},e}();var w,T=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kID3=21]="kID3",e[e.kSCTE35=134]="kSCTE35",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(w||(w={}));var k,L=function(){this.pid_stream_type={},this.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},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},I=function(){},O=function(){},B=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(k||(k={}));var R,x,D=function(){},M=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},P=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],r=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===r)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],r=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,!(n>=k.kReserved0)&&0===r){var a=e.subarray(i,o);(t=new D).type=n,t.data=a}}return t},e}(),U=function(){function e(e,t,i){var n=8+e.byteLength+1+2+t.byteLength,r=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(r=!0,n+=4);var o=this.data=new Uint8Array(n);o[0]=1,o[1]=e[1],o[2]=e[2],o[3]=e[3],o[4]=255,o[5]=225;var a=e.byteLength;o[6]=a>>>8,o[7]=255&a;var s=8;o.set(e,8),o[s+=a]=1;var l=t.byteLength;o[s+1]=l>>>8,o[s+2]=255&l,o.set(t,s+3),s+=3+l,r&&(o[s]=252|i.chroma_format_idc,o[s+1]=248|i.bit_depth_luma-8,o[s+2]=248|i.bit_depth_chroma-8,o[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(R||(R={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(x||(x={}));var $,F,N=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],V=($=function(e,t){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},$(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),j=function(){},Q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return V(t,e),t}(j),G=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=(8&e[i+1])>>>3,r=(6&e[i+1])>>>1,o=1&e[i+1],a=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,l=(1&e[i+2])<<2|(192&e[i+3])>>>6,A=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+A>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var d=1===o?7:9,c=A-d;i+=d;var u=this.findNextSyncwordOffset(i+c);if(this.current_syncword_offset_=u,(0===n||1===n)&&0===r){var h=e.subarray(i,i+c);(t=new j).audio_object_type=a+1,t.sampling_freq_index=s,t.sampling_frequency=N[s],t.channel_config=l,t.data=h}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),z=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=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++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),i=0,n=0;n<=t;n++)i<<=8,i|=e.readByte();return i},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var n=this.current_syncword_offset_,o=(31&t[n+1])<<8|t[n+2];if(n+3+o>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new h(t.subarray(n+3,n+3+o)),s=null;if(a.readBool()){if(null==e){r.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+o),a.destroy();continue}s=e}else{var l=a.readBool();if(l&&a.readBool()){r.A.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(l&&this.getLATMValue(a),!a.readBool()){r.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){r.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){r.A.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){r.A.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var A=l?this.getLATMValue(a):0,d=a.readBits(5);A-=5;var c=a.readBits(4);A-=4;var u=a.readBits(4);A-=4,a.readBits(3),(A-=3)>0&&a.readBits(A);var p=a.readBits(3);if(0!==p){r.A.e(this.TAG,"frameLengthType = ".concat(p,". Only frameLengthType = 0 Supported")),a.destroy();break}a.readByte();var f=a.readBool();if(f)if(l)this.getLATMValue(a);else{for(var _=0;;){_<<=8;var m=a.readBool();if(_+=a.readByte(),!m)break}console.log(_)}a.readBool()&&a.readByte(),(s=new Q).audio_object_type=d,s.sampling_freq_index=c,s.sampling_frequency=N[s.sampling_freq_index],s.channel_config=u,s.other_data_present=f}for(var v=0;;){var g=a.readByte();if(v+=g,255!==g)break}for(var y=new Uint8Array(v),b=0;b<v;b++)y[b]=a.readByte();(i=new Q).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=N[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=y,this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+o)}return i},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),H=function(e){var t=[],i=e.audio_object_type,n=e.audio_object_type,r=e.sampling_freq_index,o=e.channel_config,a=0,s=navigator.userAgent.toLowerCase();s.includes("firefox")?r>=6?(n=5,t=new Array(4),a=r-3):(n=2,t=new Array(2),a=r):s.includes("android")?(n=2,t=new Array(2),a=r):(n=5,a=r,t=new Array(4),r>=6?a=r-3:1===o&&(n=2,t=new Array(2),a=r)),t[0]=n<<3,t[0]|=(15&r)>>>1,t[1]=(15&r)<<7,t[1]|=(15&o)<<3,5===n&&(t[1]|=(15&a)>>>1,t[2]=(1&a)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=N[r],this.channel_count=o,this.codec_mimetype="mp4a.40."+n.toString(),this.original_codec_mimetype="mp4a.40."+i.toString()},W=function(){},q=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(F||(F={}));var K,Y=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},X=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},Z=function(e,t){var i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:Y(t)}},J=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ee=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(var r=0;r<n.component_count;r++)n.components.push(J(e))}return n.duration_flag&&(n.break_duration=X(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n},te=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:n.readBits(32)}},ie=function(e,t,i,n){var r=n.readBits(8),o=n.readBits(3);n.readBits(5);for(var a="",s=0;s<o;s++)a+=String.fromCharCode(n.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:r,dtmf_count:o,DTMF_char:a}},ne=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},re=function(e,t,i,n){var r=n.readBits(32),o=n.readBool();n.readBits(7);var a={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:r,segmentation_event_cancel_indicator:o};if(o)return a;if(a.program_segmentation_flag=n.readBool(),a.segmentation_duration_flag=n.readBool(),a.delivery_not_restricted_flag=n.readBool(),a.delivery_not_restricted_flag?n.readBits(5):(a.web_delivery_allowed_flag=n.readBool(),a.no_regional_blackout_flag=n.readBool(),a.archive_allowed_flag=n.readBool(),a.device_restrictions=n.readBits(2)),!a.program_segmentation_flag){a.component_count=n.readBits(8),a.components=[];for(var s=0;s<a.component_count;s++)a.components.push(ne(n))}a.segmentation_duration_flag&&(a.segmentation_duration=n.readBits(40)),a.segmentation_upid_type=n.readBits(8),a.segmentation_upid_length=n.readBits(8);var l=new Uint8Array(a.segmentation_upid_length);for(s=0;s<a.segmentation_upid_length;s++)l[s]=n.readBits(8);return a.segmentation_upid=l.buffer,a.segmentation_type_id=n.readBits(8),a.segment_num=n.readBits(8),a.segments_expected=n.readBits(8),52!==a.segmentation_type_id&&54!==a.segmentation_type_id&&56!==a.segmentation_type_id&&58!==a.segmentation_type_id||(a.sub_segment_num=n.readBits(8),a.sub_segments_expected=n.readBits(8)),a},oe=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:n.readBits(48),TAI_ns:n.readBits(32),UTC_offset:n.readBits(16)}},ae=function(e){return{component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}},se=function(e,t,i,n){for(var r=n.readBits(4),o=[],a=0;a<r;a++)o.push(ae(n));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:r,components:o}};!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD"}(K||(K={}));var le=function(){},Ae=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},de=function(){function e(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],r=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===r)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,r=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,0===r){var a=e.subarray(i,o);(t=new le).type=n,t.data=a}}return t},e}(),ce=function(){function e(e,t,i,n){var r=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),o=this.data=new Uint8Array(r);o[0]=1,o[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,o[2]=n.general_profile_compatibility_flags_1,o[3]=n.general_profile_compatibility_flags_2,o[4]=n.general_profile_compatibility_flags_3,o[5]=n.general_profile_compatibility_flags_4,o[6]=n.general_constraint_indicator_flags_1,o[7]=n.general_constraint_indicator_flags_2,o[8]=n.general_constraint_indicator_flags_3,o[9]=n.general_constraint_indicator_flags_4,o[10]=n.general_constraint_indicator_flags_5,o[11]=n.general_constraint_indicator_flags_6,o[12]=n.general_level_idc,o[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,o[14]=255&n.min_spatial_segmentation_idc,o[15]=252|3&n.parallelismType,o[16]=252|3&n.chroma_format_idc,o[17]=248|7&n.bit_depth_luma_minus8,o[18]=248|7&n.bit_depth_chroma_minus8,o[19]=0,o[20]=0,o[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,o[22]=3,o[23]=128|K.kSliceVPS,o[24]=0,o[25]=1,o[26]=(65280&e.byteLength)>>8,o[27]=255&e.byteLength,o.set(e,28),o[23+(5+e.byteLength)+0]=128|K.kSliceSPS,o[23+(5+e.byteLength)+1]=0,o[23+(5+e.byteLength)+2]=1,o[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,o[23+(5+e.byteLength)+4]=255&t.byteLength,o.set(t,23+(5+e.byteLength)+5),o[23+(5+e.byteLength+5+t.byteLength)+0]=128|K.kSlicePPS,o[23+(5+e.byteLength+5+t.byteLength)+1]=0,o[23+(5+e.byteLength+5+t.byteLength)+2]=1,o[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,o[23+(5+e.byteLength+5+t.byteLength)+4]=255&i.byteLength,o.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),ue=function(){},he=function(){},pe=function(){},fe=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],_e=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=e[i+4]>>6,r=[48e3,44200,33e3][n],o=63&e[i+4],a=2*fe[n][o];if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=s;var l=e[i+5]>>3,A=7&e[i+5],d=e[i+6]>>5,c=0;1&d&&1!==d&&(c+=2),4&d&&(c+=2),2===d&&(c+=2);var u=(e[i+6]<<8|e[i+7])>>12-c&1,h=[2,1,2,3,3,4,4,5][d]+u;(t=new pe).sampling_frequency=r,t.channel_count=h,t.channel_mode=d,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=u,t.bit_stream_mode=A,t.frame_size_code=o,t.data=e.subarray(i,i+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),me=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ve=function(){},ge=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=new h(e.subarray(i+2)),r=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1),o=n.readBits(2),a=null,s=null;3===o?(a=[24e3,22060,16e3][o=n.readBits(2)],s=3):(a=[48e3,44100,32e3][o],s=n.readBits(2));var l=n.readBits(3),A=n.readBits(1),d=n.readBits(5);if(i+r>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=this.findNextSyncwordOffset(i+r);this.current_syncword_offset_=c;var u=[2,1,2,3,3,4,4,5][l]+A;n.destroy(),(t=new ve).sampling_frequency=a,t.channel_count=u,t.channel_mode=l,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=A,t.frame_size=r,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+r)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),ye=function(e){var t,i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},be=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ee=function(){return Ee=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ee.apply(this,arguments)},Se=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a},Ce=function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},we=function(e){function t(t,i){var n=e.call(this)||this;return n.TAG="TSDemuxer",n.first_parse_=!0,n.media_info_=new a.A,n.timescale_=90,n.duration_=0,n.current_pmt_pid_=-1,n.program_pmt_map_={},n.pes_slice_queues_={},n.section_slice_queues_={},n.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},n.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},n.aac_last_sample_pts_=void 0,n.aac_last_incomplete_data_=null,n.has_video_=!1,n.has_audio_=!1,n.video_init_segment_dispatched_=!1,n.audio_init_segment_dispatched_=!1,n.video_metadata_changed_=!1,n.audio_metadata_changed_=!1,n.loas_previous_frame=null,n.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},n.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},n.ts_packet_size_=t.ts_packet_size,n.sync_offset_=t.sync_offset,n.config_=i,n}return be(t,e),t.prototype.destroy=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,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),i=-1,n=188;if(t.byteLength<=3*n)return{needMoreData:!0};for(;-1===i;){for(var o=Math.min(1e3,t.byteLength-3*n),a=0;a<o;){if(71===t[a]&&71===t[a+n]&&71===t[a+2*n]){i=a;break}a++}if(-1===i)if(188===n)n=192;else{if(192!==n)break;n=204}}return-1===i?{match:!1}:(192===n&&i>=4?(r.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===n&&r.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,sync_offset:i})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new a.A},t.prototype.parseChunks=function(e,t){var i;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new d.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0;for(this.first_parse_&&(this.first_parse_=!1,n=this.sync_offset_);n+this.ts_packet_size_<=e.byteLength;){var o=t+n;192===this.ts_packet_size_&&(n+=4);var a=new Uint8Array(e,n,188),s=a[0];if(71!==s){r.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var l=(64&a[1])>>>6,A=(a[1],(31&a[1])<<8|a[2]),c=(48&a[3])>>>4,u=15&a[3],h={},p=4;if(2===c||3===c){var f=a[4];if(5+f===188){n+=188,204===this.ts_packet_size_&&(n+=16);continue}f>0&&(h=this.parseAdaptationField(e,n+4,1+f)),p=5+f}if(1===c||3===c)if(0===A||A===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[A]===w.kSCTE35){var _=188-p;this.handleSectionSlice(e,n+p,_,{pid:A,file_position:o,payload_unit_start_indicator:l,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}else if(void 0!==(null===(i=this.pmt_)||void 0===i?void 0:i.pid_stream_type[A])){_=188-p;var m=this.pmt_.pid_stream_type[A];(A===this.pmt_.common_pids.h264||A===this.pmt_.common_pids.h265||A===this.pmt_.common_pids.adts_aac||A===this.pmt_.common_pids.loas_aac||A===this.pmt_.common_pids.ac3||A===this.pmt_.common_pids.eac3||A===this.pmt_.common_pids.opus||A===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[A]||this.pmt_.timed_id3_pids[A])&&this.handlePESSlice(e,n+p,_,{pid:A,stream_type:m,file_position:o,payload_unit_start_indicator:l,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}n+=188,204===this.ts_packet_size_&&(n+=16)}return this.dispatchAudioVideoMediaSegment(),n},t.prototype.parseAdaptationField=function(e,t,i){var n=new Uint8Array(e,t,i),o=n[0];return o>0?o>183?(r.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(o)),{}):{discontinuity_indicator:(128&n[1])>>>7,random_access_indicator:(64&n[1])>>>6,elementary_stream_priority_indicator:(32&n[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,i,n){var r=new Uint8Array(e,t,i),o=this.section_slice_queues_?this.section_slice_queues_[n.pid]:{};if(n.payload_unit_start_indicator){var a=r[0];if(void 0!==o&&0!==(null==o?void 0:o.total_length)){var s=new Uint8Array(e,t+1,Math.min(i,a));o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):this.clearSlices(o,n)}for(var l=1+a;l<r.byteLength&&255!==r[l+0];){var A=(15&r[l+1])<<8|r[l+2];this.section_slice_queues_&&(this.section_slice_queues_[n.pid]=new B,o=this.section_slice_queues_[n.pid]),o.expected_length=A+3,o.file_position=n.file_position,o.random_access_indicator=n.random_access_indicator,s=new Uint8Array(e,t+l,Math.min(i-l,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):o.total_length>=o.expected_length&&this.clearSlices(o,n),l+=s.byteLength}}else void 0!==o&&0!==o.total_length&&(s=new Uint8Array(e,t,Math.min(i,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):o.total_length>=o.expected_length&&this.clearSlices(o,n))},t.prototype.handlePESSlice=function(e,t,i,n){var o=new Uint8Array(e,t,i),a=o[0]<<16|o[1]<<8|o[2],s=(o[3],o[4]<<8|o[5]);if(n.payload_unit_start_indicator){if(1!==a)return void r.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(a));var l=this.pes_slice_queues_[n.pid];l&&(0===l.expected_length||l.expected_length===l.total_length?this.emitPESSlices(l,n):this.clearSlices(l,n)),this.pes_slice_queues_&&(this.pes_slice_queues_[n.pid]=new B,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator)}if(void 0!==this.pes_slice_queues_[n.pid]){var A=this.pes_slice_queues_[n.pid];A.slices.push(o),n.payload_unit_start_indicator&&(A.expected_length=0===s?0:s+6),A.total_length+=o.byteLength,A.expected_length>0&&A.expected_length===A.total_length?this.emitPESSlices(A,n):A.expected_length>0&&A.expected_length<A.total_length&&this.clearSlices(A,n)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,r=0;n<e.slices.length;n++){var o=e.slices[n];i.set(o,r),r+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new O;a.pid=t.pid,a.data=i,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parseSection(a)},t.prototype.emitPESSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,r=0;n<e.slices.length;n++){var o=e.slices[n];i.set(o,r),r+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new I;a.pid=t.pid,a.data=i,a.stream_type=t.stream_type,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parsePES(a)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t,i=e.data,n=e.pid;0===n?this.parsePAT(i):n===this.current_pmt_pid_?this.parsePMT(i):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[n])&&this.parseSCTE35(i)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],n=t[3],o=t[4]<<8|t[5];if(1===i)if(188!==n&&190!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n){t[6];var a=(192&t[7])>>>6,s=t[8],l=void 0,A=void 0;2!==a&&3!==a||(l=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,A=3===a?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:l);var d=9+s,c=void 0;if(0!==o){if(o<3+s)return void r.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");c=o-3-s}else c=t.byteLength-d;var u=t.subarray(d,d+c);switch(e.stream_type){case w.kMPEG1Audio:case w.kMPEG2Audio:this.parseMP3Payload(u,l);break;case w.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(u,l):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(u,l):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(u,l):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(u,l,A,e.pid,n):this.parsePESPrivateDataPayload(u,l,A,e.pid,n);break;case w.kADTSAAC:this.parseADTSAACPayload(u,l);break;case w.kLOASAAC:this.parseLOASAACPayload(u,l);break;case w.kAC3:this.parseAC3Payload(u,l);break;case w.kEAC3:this.parseEAC3Payload(u,l);break;case w.kID3:this.parseTimedID3MetadataPayload(u,l,A,e.pid,n);break;case w.kH264:this.parseH264Payload(u,l,A,e.file_position,e.random_access_indicator);break;case w.kH265:this.parseH265Payload(u,l,A,e.file_position,e.random_access_indicator)}}else 188!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n||e.stream_type!==w.kPESPrivateData||(d=6,c=void 0,c=0!==o?o:t.byteLength-d,u=t.subarray(d,d+c),this.parsePESPrivateDataPayload(u,void 0,void 0,e.pid,n));else r.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2],n=(e[3],e[4],(62&e[5])>>>1),o=1&e[5],a=e[6],s=(e[7],null);if(1===o&&0===a)(s=new T).version_number=n;else if(null==(s=this.pat_))return;for(var l=i-5-4,A=-1,d=-1,c=8;c<8+l;c+=4){var u=e[c]<<8|e[c+1],h=(31&e[c+2])<<8|e[c+3];0===u?s.network_pid=h:(s.program_pmt_pid[u]=h,-1===A&&(A=u),-1===d&&(d=h))}1===o&&0===a&&(void 0===this.pat_&&r.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=A,this.current_pmt_pid_=d)}else r.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t=e[0];if(2===t){var i=(15&e[1])<<8|e[2],n=e[3]<<8|e[4],o=(62&e[5])>>>1,a=1&e[5],s=e[6],l=(e[7],null);if(1===a&&0===s)(l=new L).program_number=n,l.version_number=o,this.program_pmt_map_[n]=l;else if(null==(l=this.program_pmt_map_[n]))return;e[8],e[9];for(var A=(15&e[10])<<8|e[11],d=12+A,c=i-9-A-4,u=d;u<d+c;){var h=e[u],p=(31&e[u+1])<<8|e[u+2],f=(15&e[u+3])<<8|e[u+4];l.pid_stream_type[p]=h;var _=l.common_pids.h264||l.common_pids.h265,m=l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.eac3||l.common_pids.opus||l.common_pids.mp3;if(h!==w.kH264||_)if(h!==w.kH265||_)if(h!==w.kADTSAAC||m)if(h!==w.kLOASAAC||m)if(h!==w.kAC3||m)if(h!==w.kEAC3||m)if(h!==w.kMPEG1Audio&&h!==w.kMPEG2Audio||m)if(h===w.kPESPrivateData){if(l.pes_private_data_pids[p]=!0,f>0){for(var v=u+5;v<u+5+f;){var g=e[v+0],y=e[v+1];if(5===g){var b=String.fromCharCode.apply(String,Ce([],Se(Array.from(e.subarray(v+2,v+2+y))),!1));"VANC"===b?l.smpte2038_pids[p]=!0:"Opus"===b&&(l.common_pids.opus=p)}else if(127===g&&p===l.common_pids.opus){var E=null;if(128===e[v+2]&&(E=e[v+3]),null==E){r.A.e(this.TAG,"Not Supported Opus channel count.");continue}var S={codec:"opus",channel_count:15&E?15&E:2,channel_config_code:E,sample_rate:48e3},C={codec:"opus",meta:S};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(C)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(C)):(this.audio_metadata_=S,this.dispatchAudioInitSegment(C))}v+=2+y}var T=e.subarray(u+5,u+5+f);this.dispatchPESPrivateDataDescriptor(p,h,T)}}else h===w.kID3?l.timed_id3_pids[p]=!0:h===w.kSCTE35&&(l.scte_35_pids[p]=!0);else l.common_pids.mp3=p;else l.common_pids.eac3=p;else l.common_pids.ac3=p;else l.common_pids.loas_aac=p;else l.common_pids.adts_aac=p;else l.common_pids.h265=p;else l.common_pids.h264=p;u+=5+f}n===this.current_program_&&(void 0===this.pmt_&&r.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(l))),this.pmt_=l,(l.common_pids.h264||l.common_pids.h265)&&(this.has_video_=!0),(l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.opus||l.common_pids.mp3)&&(this.has_audio_=!0))}else r.A.e(this.TAG,"parsePMT: table_id ".concat(t," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t,i,n,r,o,a,s=new h(e),l=s.readBits(8),A=s.readBool(),d=s.readBool();s.readBits(2);var c=s.readBits(12),u=s.readBits(8),p=s.readBool(),f=s.readBits(6),_=4*s.readBits(31)+s.readBits(2),m=s.readBits(8),v=s.readBits(12),g=s.readBits(12),y=s.readBits(8),b=null;y===F.kSpliceNull?b={}:y===F.kSpliceSchedule?b=function(e){for(var t=e.readBits(8),i=[],n=0;n<t;n++)i.push(ee(e));return{splice_count:t,events:i}}(s):y===F.kSpliceInsert?b=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),n.splice_immediate_flag=e.readBool(),e.readBits(4),n.program_splice_flag&&!n.splice_immediate_flag&&(n.splice_time=Y(e)),!n.program_splice_flag){n.component_count=e.readBits(8),n.components=[];for(var r=0;r<n.component_count;r++)n.components.push(Z(n.splice_immediate_flag,e))}return n.duration_flag&&(n.break_duration=X(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n}(s):y===F.kTimeSignal?b=function(e){return{splice_time:Y(e)}}(s):y===F.kBandwidthReservation?b={}:y===F.kPrivateCommand?b=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),n=new Uint8Array(e-4),r=0;r<e-4;r++)n[r]=t.readBits(8);return{identifier:i,private_data:n.buffer}}(g,s):s.readBits(8*g);for(var E=[],S=s.readBits(16),C=0;C<S;){var w=s.readBits(8),T=s.readBits(8),k=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===w?E.push(te(w,T,k,s)):1===w?E.push(ie(w,T,k,s)):2===w?E.push(re(w,T,k,s)):3===w?E.push(oe(w,T,k,s)):4===w?E.push(se(w,T,k,s)):s.readBits(8*(T-4)),C+=2+T}var L={table_id:l,section_syntax_indicator:A,private_indicator:d,section_length:c,protocol_version:u,encrypted_packet:p,encryption_algorithm:f,pts_adjustment:_,cw_index:m,tier:v,splice_command_length:g,splice_command_type:y,splice_command:b,descriptor_loop_length:S,splice_descriptors:E,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===F.kSpliceInsert){var I=b;if(I.splice_event_cancel_indicator)return{splice_command_type:y,detail:L,data:e};if(I.program_splice_flag&&!I.splice_immediate_flag){var O=I.duration_flag?null===(t=null==I?void 0:I.break_duration)||void 0===t?void 0:t.auto_return:void 0,B=I.duration_flag?((null===(i=null==I?void 0:I.break_duration)||void 0===i?void 0:i.duration)||0)/90:void 0;return(null===(n=I.splice_time)||void 0===n?void 0:n.time_specified_flag)?{splice_command_type:y,pts:(_+((null===(r=null==I?void 0:I.splice_time)||void 0===r?void 0:r.pts_time)||0))%Math.pow(2,33),auto_return:O,duraiton:B,detail:L,data:e}:{splice_command_type:y,auto_return:O,duraiton:B,detail:L,data:e}}return{splice_command_type:y,auto_return:O=I.duration_flag?null===(o=I.break_duration)||void 0===o?void 0:o.auto_return:void 0,duraiton:B=I.duration_flag?((null===(a=I.break_duration)||void 0===a?void 0:a.duration)||0)/90:void 0,detail:L,data:e}}if(y===F.kTimeSignal){var R=b;return R.splice_time.time_specified_flag?{splice_command_type:y,pts:(_+(R.splice_time.pts_time||0))%Math.pow(2,33),detail:L,data:e}:{splice_command_type:y,detail:L,data:e}}return{splice_command_type:y,detail:L,data:e}}(e);if(void 0!==t.pts){var i=Math.floor(t.pts/this.timescale_);t.pts=i}else t.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseH264Payload=function(e,t,i,n,o){for(var a,s,l=new P(e),A=null,d=[],c=0,u=!1;null!=(A=l.readNextNaluPayload());){var h=new M(A);if(h.type===k.kSliceSPS){var f=p.parseSPS(A.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(h,f)&&(r.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:h,pps:void 0,details:f}):this.video_metadata_&&(this.video_metadata_.sps=h,this.video_metadata_.details=f)}else h.type===k.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_&&(this.video_metadata_.pps=h),(null===(a=this.video_metadata_)||void 0===a?void 0:a.sps)&&(null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(h.type===k.kSliceIDR||h.type===k.kSliceNonIDR&&1===o)&&(u=!0);this.video_init_segment_dispatched_&&(d.push(h),c+=h.data.byteLength)}var _=Math.floor(t/this.timescale_),m=Math.floor(i/this.timescale_);if(d.length){var v=this.video_track_,g={units:d,length:c,isKeyframe:u,dts:m,pts:_,cts:_-m,file_position:n};v&&(v.samples.push(g),v.length+=c)}},t.prototype.parseH265Payload=function(e,t,i,n,o){for(var a,s,l,A,d,c,u,h=new de(e),p=null,f=[],m=0,v=!1;null!=(p=h.readNextNaluPayload());){var g=new Ae(p);if(g.type===K.kSliceVPS){if(!this.video_init_segment_dispatched_){var y=_.parseVPS(p.data);this.video_metadata_&&(this.video_metadata_.vps=g,this.video_metadata_.details=Ee(Ee({},null===(a=this.video_metadata_)||void 0===a?void 0:a.details),y))}}else g.type===K.kSliceSPS?(y=_.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(g,y)&&(r.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:g,pps:void 0,details:y}):this.video_metadata_&&(this.video_metadata_.sps=g,this.video_metadata_.details=Ee(Ee({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),y))):g.type===K.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(y=_.parsePPS(p.data),this.video_metadata_&&(this.video_metadata_.pps=g,this.video_metadata_.details=Ee(Ee({},null===(l=this.video_metadata_)||void 0===l?void 0:l.details),y)),(null===(A=this.video_metadata_)||void 0===A?void 0:A.vps)&&(null===(d=this.video_metadata_)||void 0===d?void 0:d.sps)&&(null===(c=this.video_metadata_)||void 0===c?void 0:c.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):g.type!==K.kSliceIDR_W_RADL&&g.type!==K.kSliceIDR_N_LP&&g.type!==K.kSliceCRA_NUT||(v=!0);this.video_init_segment_dispatched_&&(f.push(g),m+=g.data.byteLength)}var b=Math.floor(t/this.timescale_),E=Math.floor(i/this.timescale_);if(f.length){var S=this.video_track_,C={units:f,length:m,isKeyframe:v,dts:E,pts:b,cts:b-E,file_position:n};S&&(null===(u=S.samples)||void 0===u||u.push(C),S.length+=m)}},t.prototype.detectVideoMetadataChange=function(e,t){var i,n,o,a,s,l,A,d,c,u;if(t.codec_mimetype!==(null===(n=null===(i=this.video_metadata_)||void 0===i?void 0:i.details)||void 0===n?void 0:n.codec_mimetype))return r.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(null===(o=this.video_metadata_)||void 0===o?void 0:o.details.codec_mimetype," to ").concat(null==t?void 0:t.codec_mimetype)),!0;if(t.codec_size.width!==(null===(s=null===(a=this.video_metadata_)||void 0===a?void 0:a.details)||void 0===s?void 0:s.codec_size.width)||t.codec_size.height!==(null===(A=null===(l=this.video_metadata_)||void 0===l?void 0:l.details)||void 0===A?void 0:A.codec_size.height)){var h=null===(d=this.video_metadata_)||void 0===d?void 0:d.details.codec_size,p=t.codec_size;return r.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(h.width,"x").concat(h.height," to ").concat(p.width,"x").concat(p.height)),!0}return t.present_size.width!==(null===(c=this.video_metadata_)||void 0===c?void 0:c.details.present_size.width)&&(r.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(null===(u=this.video_metadata_)||void 0===u?void 0:u.details.present_size.width," to ").concat(null==t?void 0:t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},t.prototype.dispatchVideoInitSegment=function(){var e,t,i,n,o,a,s,l,A,d,c,u,h=null===(e=this.video_metadata_)||void 0===e?void 0:e.details,p={type:"video"};p.id=null===(t=this.video_track_)||void 0===t?void 0:t.id,p.timescale=1e3,p.duration=this.duration_,p.codecWidth=h.codec_size.width,p.codecHeight=h.codec_size.height,p.presentWidth=h.present_size.width,p.presentHeight=h.present_size.height,p.profile=h.profile_string,p.level=h.level_string,p.bitDepth=h.bit_depth,p.chromaFormat=h.chroma_format,p.sarRatio=h.sar_ratio,p.frameRate=h.frame_rate;var f=p.frameRate.fps_den,_=p.frameRate.fps_num;if(p.refSampleDuration=f/_*1e3,p.codec=h.codec_mimetype,null===(i=this.video_metadata_)||void 0===i?void 0:i.vps){var m=null===(n=this.video_metadata_)||void 0===n?void 0:n.vps.data.subarray(4),v=null===(a=null===(o=this.video_metadata_)||void 0===o?void 0:o.sps)||void 0===a?void 0:a.data.subarray(4),g=null===(l=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===l?void 0:l.data.subarray(4),y=new ce(m,v,g,h);p.hvcc=y.getData(),this.video_init_segment_dispatched_||r.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}else{v=null===(d=null===(A=this.video_metadata_)||void 0===A?void 0:A.sps)||void 0===d?void 0:d.data.subarray(4),g=null===(u=null===(c=this.video_metadata_)||void 0===c?void 0:c.pps)||void 0===u?void 0:u.data.subarray(4);var b=new U(v,g,h);p.avcc=b.getData(),this.video_init_segment_dispatched_||r.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}this.onTrackMetadata&&this.onTrackMetadata("video",p),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var E=this.media_info_;E.hasVideo=!0,E.width=p.codecWidth,E.height=p.codecHeight,E.fps=p.frameRate.fps,E.profile=p.profile,E.level=p.level,E.refFrames=h.ref_frames,E.chromaFormat=h.chroma_format_string,E.sarNum=p.sarRatio.width,E.sarDen=p.sarRatio.height,E.videoCodec=p.codec,E.hasAudio&&E.audioCodec?E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,",").concat(E.audioCodec,'"'):E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,'"'),E.isComplete()&&this.onMediaInfo&&this.onMediaInfo(E)},t.prototype.dispatchVideoMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.video_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.audio_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,null)},t.prototype.dispatchAudioVideoMediaSegment=function(){var e,t;this.isInitSegmentDispatched()&&((null===(e=this.audio_track_)||void 0===e?void 0:e.length)||(null===(t=this.video_track_)||void 0===t?void 0:t.length))&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,this.video_track_)},t.prototype.parseADTSAACPayload=function(e,t){var i,n,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/(null===(n=this.audio_metadata_)||void 0===n?void 0:n.sampling_frequency)*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var A=this.aac_last_sample_pts_+s;Math.abs(A-l)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(A,"ms, PES pts: ").concat(l,"ms")),l=A)}}for(var d=new G(e),c=null,u=l,h=0;null!=(c=d.readNextAACFrame());){s=1024/c.sampling_frequency*1e3;var p={codec:"aac",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(p)),h=u;var f=Math.floor(u),_={unit:c.data,length:c.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=c.data.byteLength),u+=s}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),h&&(this.aac_last_sample_pts_=h)}},t.prototype.parseLOASAACPayload=function(e,t){var i,n,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/this.audio_metadata_.sampling_frequency*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var A=this.aac_last_sample_pts_+s;Math.abs(A-l)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(A,"ms, PES pts: ").concat(l,"ms")),l=A)}}for(var d=new z(e),c=null,u=l,h=0;null!=(c=d.readNextAACFrame(null!==(n=this.loas_previous_frame)&&void 0!==n?n:void 0));){this.loas_previous_frame=c,s=1024/c.sampling_frequency*1e3;var p={codec:"aac",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(p)),h=u;var f=Math.floor(u),_={unit:c.data,length:c.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=c.data.byteLength),u+=s}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),h&&(this.aac_last_sample_pts_=h)}},t.prototype.parseAC3Payload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=1536/this.audio_metadata_.sampling_frequency*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void r.A.w(this.TAG,"AC3: Unknown pts");for(var s=new _e(e),l=null,A=a,d=0;null!=(l=s.readNextAC3Frame());){o=1536/l.sampling_frequency*1e3;var c={codec:"ac-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,bit_stream_mode:l.bit_stream_mode,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(c)),d=A;var u=Math.floor(A),h={unit:l.data,length:l.data.byteLength,pts:u,dts:u};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(h),this.audio_track_.length+=l.data.byteLength),A+=o}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseEAC3Payload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ec-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void r.A.w(this.TAG,"EAC3: Unknown pts");for(var s=new ge(e),l=null,A=a,d=0;null!=(l=s.readNextEAC3Frame());){o=1536/l.sampling_frequency*1e3;var c={codec:"ec-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,num_blks:l.num_blks,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(c)),d=A;var u=Math.floor(A),h={unit:l.data,length:l.data.byteLength,pts:u,dts:u};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(h),this.audio_track_.length+=l.data.byteLength),A+=o}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseOpusPayload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"opus"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=20,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void r.A.w(this.TAG,"Opus: Unknown pts");for(var s=a,l=0,A=0;A<e.length;){o=20;for(var d=!!(16&e[A+1]),c=!!(8&e[A+1]),u=A+2,h=0;255===e[u];)h+=255,u+=1;h+=e[u],u+=1,u+=d?2:0,u+=c?2:0,l=s;var p=Math.floor(s),f=e.slice(u,u+h),_={unit:f,length:f.byteLength,pts:p,dts:p};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(_),this.audio_track_.length+=f.byteLength),s+=o,A=u+h}l&&(this.aac_last_sample_pts_=l)}},t.prototype.parseMP3Payload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){var n=e[1]>>>3&3,r=(6&e[1])>>1,o=(e[2],(12&e[2])>>>2),a=3&~(e[3]>>>6)?2:1,s=0,l=34;switch(n){case 0:s=[11025,12e3,8e3,0][o];break;case 2:s=[22050,24e3,16e3,0][o];break;case 3:s=[44100,48e3,32e3,0][o]}switch(r){case 1:l=34;break;case 2:l=33;break;case 3:l=32}var A=new he;A.object_type=l,A.sample_rate=s,A.channel_count=a,A.data=e;var d={codec:"mp3",data:A};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"mp3",object_type:l,sample_rate:s,channel_count:a},this.dispatchAudioInitSegment(d));var c={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(c),this.audio_track_.length+=e.byteLength)}},t.prototype.detectAudioMetadataChange=function(e){var t,i,n,o;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return r.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((a=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return r.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(a.audio_object_type)),!0;if(a.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return r.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(a.sampling_freq_index)),!0;if(a.channel_config!==this.audio_metadata_.channel_config)return r.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(n=this.audio_metadata_)||void 0===n?void 0:n.channel_config," to ").concat(a.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var a;if((a=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return r.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(o=this.audio_metadata_)||void 0===o?void 0:o.sampling_frequency," to ").concat(a.sampling_frequency)),!0;if(a.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return r.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(a.bit_stream_identification)),!0;if(a.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return r.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(a.bit_stream_mode)),!0;if(a.channel_mode!==this.audio_metadata_.channel_mode)return r.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(a.channel_mode)),!0;if(a.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return r.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(a.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((s=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var s;if((s=e.data).object_type!==this.audio_metadata_.object_type)return r.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(s.object_type)),!0;if(s.sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t,i,n,o,a,s,l={type:"audio"};if(l.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,l.timescale=1e3,l.duration=this.duration_,"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var A="aac"===e.codec?e.data:null,d=new H(A);l.audioSampleRate=d.sampling_rate,l.channelCount=d.channel_count,l.codec=d.codec_mimetype,l.originalCodec=d.original_codec_mimetype,l.config=d.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale}else if("ac-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){var c="ac-3"===e.codec?e.data:null,u=new me(c);l.audioSampleRate=u.sampling_rate,l.channelCount=u.channel_count,l.codec=u.codec_mimetype,l.originalCodec=u.original_codec_mimetype,l.config=u.config,l.refSampleDuration=1536/l.audioSampleRate*l.timescale}else if("ec-3"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)){var h="ec-3"===e.codec?e.data:null,p=new ye(h);l.audioSampleRate=p.sampling_rate,l.channelCount=p.channel_count,l.codec=p.codec_mimetype,l.originalCodec=p.original_codec_mimetype,l.config=p.config,l.refSampleDuration=256*p.num_blks/l.audioSampleRate*l.timescale}else"opus"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)?(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.channelConfigCode=this.audio_metadata_.channel_config_code,l.codec="opus",l.originalCodec="opus",l.config=void 0,l.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.codec="mp3",l.originalCodec="mp3",l.config=void 0);this.audio_init_segment_dispatched_||r.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(l.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",l),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var f=this.media_info_;f.hasAudio=!0,f.audioCodec=l.originalCodec,f.audioSampleRate=l.audioSampleRate,f.audioChannelCount=l.channelCount,f.hasVideo&&f.videoCodec?f.mimeType='video/mp2t; codecs="'.concat(f.videoCodec,",").concat(f.audioCodec,'"'):f.mimeType='video/mp2t; codecs="'.concat(f.audioCodec,'"'),f.isComplete()&&this.onMediaInfo&&this.onMediaInfo(f)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var n=new q;n.pid=e,n.stream_type=t,n.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,n,r){var o=new W;if(o.pid=n,o.stream_id=r,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}else o.nearest_pts=this.aac_last_sample_pts_;if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onPESPrivateData&&this.onPESPrivateData(o)},t.prototype.parseTimedID3MetadataPayload=function(e,t,i,n,r){var o=new W;if(o.pid=n,o.stream_id=r,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,i,n,r){var o=new ue;if(o.pid=n,o.stream_id=r,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(o.nearest_pts=this.aac_last_sample_pts_,void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}o.ancillaries=function(e){for(var t=new h(e),i=0,n=[];i+=6,0===t.readBits(6);){var r=t.readBool();i+=1;var o=t.readBits(11);i+=11;var a=t.readBits(12);i+=12;var s=255&t.readBits(10);i+=10;var l=255&t.readBits(10);i+=10;var A=255&t.readBits(10);i+=10;for(var d=new Uint8Array(A),c=0;c<A;c++){var u=255&t.readBits(10);i+=10,d[c]=u}t.readBits(10),i+=10;var p="User Defined";65===s?7===l&&(p="SCTE-104"):95===s?220===l?p="ARIB STD-B37 (1SEG)":221===l?p="ARIB STD-B37 (ANALOG)":222===l?p="ARIB STD-B37 (SD)":223===l&&(p="ARIB STD-B37 (HD)"):97===s&&(1===l?p="EIA-708":2===l&&(p="EIA-608")),n.push({yc_indicator:r,line_number:o,horizontal_offset:a,did:s,sdid:l,user_data:d,description:p,information:{}}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,n}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},t}(C);const Te=we;var ke=new Uint8Array([0,0,0,0,0,0,0,0]),Le=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],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)])},e.box=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=8,r=null,o=Array.prototype.slice.call(arguments,1),a=o.length,s=0;s<a;s++)n+=o[s].byteLength;(r=new Uint8Array(n))[0]=n>>>24&255,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=255&n,r.set(e,4);var l=8;for(s=0;s<a;s++)r.set(o[s],l),l+=o[s].byteLength;return r},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),n=e.moov(t),r=new Uint8Array(i.byteLength+n.byteLength);return r.set(i,0),r.set(n,i.byteLength),r},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),n=e.trak(t),r=e.mvex(t);return e.box(e.types.moov,i,n,r)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,n=t.duration,r=t.presentWidth,o=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,r>>>8&255,255&r,0,0,o>>>8&255,255&o,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,n=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var i;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i;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))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=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))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.ac3=function(t){var i,n=t.channelCount,r=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types["ac-3"],o,e.box(e.types.dac3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.ec3=function(t){var i,n=t.channelCount,r=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types["ec-3"],o,e.box(e.types.dec3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.esds=function(t){var i,n=null!==(i=t.config)&&void 0!==i?i:[],r=n.length,o=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(n).concat([6,1,2]));return e.box(e.types.esds,o)},e.Opus=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types.Opus,r,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,n=t.channelConfigCode,r=t.audioSampleRate,o=[];switch(n){case 1:case 2:o=[0];break;case 0:o=[255,1,1,0,1];break;case 128:o=[255,2,0,0,1];break;case 3:o=[1,2,1,0,2,1];break;case 4:o=[1,2,2,0,1,2,3];break;case 5:o=[1,3,2,0,4,1,2,3];break;case 6:o=[1,4,2,0,4,1,2,3,5];break;case 7:o=[1,4,2,0,4,1,2,3,5,6];break;case 8:o=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:o=[1,1,2,0,1];break;case 131:o=[1,1,3,0,1,2];break;case 132:o=[1,1,4,0,1,2,3];break;case 133:o=[1,1,5,0,1,2,3,4];break;case 134:o=[1,1,6,0,1,2,3,4,5];break;case 135:o=[1,1,7,0,1,2,3,4,5,6];break;case 136:o=[1,1,8,0,1,2,3,4,5,6,7]}var a=new Uint8Array(function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([0,i,0,0,r>>>24&255,r>>>17&255,r>>>8&255,r>>>0&255,0,0],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}(o),!1));return e.box(e.types.dOps,a)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,r=t.codecHeight,o=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,n>>>8&255,255&n,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,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,o,e.box(e.types.avcC,i))},e.hvc1=function(t){var i=t.hvcc,n=t.codecWidth,r=t.codecHeight,o=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,n>>>8&255,255&n,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,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,o,e.box(e.types.hvcC,i))},e.av01=function(t){var i,n,r=t.av1c,o=null!==(i=t.codecWidth)&&void 0!==i?i:192,a=null!==(n=t.codecHeight)&&void 0!==n?n:108,s=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,o>>>8&255,255&o,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,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.av01,s,e.box(e.types.av1C,r))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,n=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,n)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=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)},e.traf=function(t,i){var n=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,o,s,a)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,r=new Uint8Array(4+n),o=0;o<n;o++){var a=i[o].flags;r[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,r)},e.trun=function(t,i){var n=t.samples||[],r=n.length,o=12+16*r,a=new Uint8Array(o);i+=8+o,a.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<r;s++){var l=n[s].duration,A=n[s].size,d=n[s].flags,c=n[s].cts;a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,A>>>24&255,A>>>16&255,A>>>8&255,255&A,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.isNonSync,0,0,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*s)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:ke,STSC:ke,STCO:ke,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),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]),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]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e}();Le.init();const Ie=Le,Oe=function(){function e(){}return e.getSilentFrame=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])}return null},e}();var Be=i(1951);const Re=function(){function e(e){var t;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=e,this._isLive=!!e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Be.Sc("audio"),this._videoSegmentInfoList=new Be.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.A.chrome||!(o.A.version&&o.A.version.major<50||o.A.version&&50===o.A.version.major&&((null===(t=o.A.version)||void 0===t?void 0:t.build)||0)<2661)),this._fillSilentAfterSeek=!(!o.A.msedge&&!o.A.msie),this._mp3UseMpegAudio=!o.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){var t;return e.onDataAvailable=null===(t=this.remux)||void 0===t?void 0:t.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new d.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",r="",i=new Uint8Array):i=Ie.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Ie.generateInitSegment(t)}if(!this._onInitSegment)throw new d.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:r,container:"".concat(e,"/").concat(n),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){var i,n;this._dtsBaseInited||((null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(n=null==t?void 0:t.samples)||void 0===n?void 0:n.length)&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){var i,n,a,s,l,A,d;if(null!=this._audioMeta){var c,u,h=e,p=h.samples,f=-1,_=this._audioMeta.refSampleDuration,m="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,v=this._dtsBaseInited&&void 0===this._audioNextDts,g=!1;if(p&&0!==p.length&&(1!==p.length||t)){var y=0,b=null,E=0;m?(y=0,E=h.length):(y=8,E=8+h.length);var S=null;if(p.length>1&&(E-=(S=p.pop()).length),null!=this._audioStashedLastSample){var C=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(C),E+=C.length}null!=S&&(this._audioStashedLastSample=S);var w=p[0].dts-this._dtsBase;if(this._audioNextDts)c=w-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())c=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(g=!0);else{var T=this._audioSegmentInfoList.getLastSampleBefore(w);if(null!=T){var k=w-(T.originalDts+T.duration);k<=3&&(k=0),c=w-(T.dts+T.duration+k)}else c=0}if(g){var L=w-c,I=this._videoSegmentInfoList.getLastSegmentBefore(w);if(null!=I&&I.beginDts<L){if(N=Oe.getSilentFrame(null===(i=this._audioMeta)||void 0===i?void 0:i.originalCodec,null===(n=this._audioMeta)||void 0===n?void 0:n.channelCount)){var O=I.beginDts,B=L-I.beginDts;r.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(O,", duration: ").concat(B)),p.unshift({unit:N,dts:O,pts:O}),E+=N.byteLength}}else g=!1}for(var R=[],x=0;x<p.length;x++){var D=(C=p[x]).unit,M=C.dts-this._dtsBase,P=(O=M,!1),U=null,$=0;if(!(M<-.001)){if("mp3"!==this._audioMeta.codec){var F=M;if(this._audioNextDts&&(F=this._audioNextDts),(c=M-F)<=-3*(_||0)){r.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(M," ms ,curRefDts: ").concat(F," ms) due to dtsCorrection: ").concat(c," ms overlap."));continue}if(c>=3*(_||0)&&this._fillAudioTimestampGap&&!o.A.safari){P=!0;var N,V=Math.floor(c/(_||0));r.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(M," ms, curRefDts: ").concat(F," ms, ")+"dtsCorrection: ".concat(Math.round(c)," ms, generate: ").concat(V," frames")),O=Math.floor(F),$=Math.floor(F+(_||0))-O,null==(N=Oe.getSilentFrame(null===(a=this._audioMeta)||void 0===a?void 0:a.originalCodec,this._audioMeta.channelCount))&&(r.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(s=this._audioMeta)||void 0===s?void 0:s.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),N=D),U=[];for(var j=0;j<V;j++){F+=_||0;var Q=Math.floor(F),G=Math.floor(F+(_||0))-Q,z={dts:Q,pts:Q,cts:0,unit:N,size:N.byteLength,duration:G,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};U.push(z),E+=z.size}this._audioNextDts=F+(_||0)}else O=Math.floor(F),$=Math.floor(F+(_||0))-O,this._audioNextDts=F+(_||0)}else O=M-c,$=x!==p.length-1?p[x+1].dts-this._dtsBase-c-O:null!=S?S.dts-this._dtsBase-c-O:R.length>=1?null===(l=R[R.length-1])||void 0===l?void 0:l.duration:Math.floor(_||0),this._audioNextDts=O+$;-1===f&&(f=O),R.push({dts:O,pts:O,cts:0,unit:C.unit,size:null===(A=C.unit)||void 0===A?void 0:A.byteLength,duration:$,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),P&&R.push.apply(R,U)}}if(0===R.length)return h.samples=[],void(h.length=0);for(m?b=new Uint8Array(E):((b=new Uint8Array(E))[0]=E>>>24&255,b[1]=E>>>16&255,b[2]=E>>>8&255,b[3]=255&E,b.set(Ie.types.mdat,4)),x=0;x<R.length;x++)D=R[x].unit,b.set(D,y),y+=D.byteLength||0;var H=R[R.length-1];u=H.dts+H.duration;var W,q=new Be.EZ;q.beginDts=f,q.endDts=u,q.beginPts=f,q.endPts=u,q.originalBeginDts=R[0].originalDts,q.originalEndDts=H.originalDts+H.duration,q.firstSample=new Be.$_(R[0].dts,R[0].pts,R[0].duration,R[0].originalDts,!1),q.lastSample=new Be.$_(H.dts,H.pts,H.duration,H.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),h.samples=R,h.sequenceNumber++,W=m?new Uint8Array:Ie.moof(h,f),h.samples=[],h.length=0;var K={type:"audio",data:this._mergeBoxes(W,b).buffer,sampleCount:R.length,info:q};m&&v&&K&&(K.timestampOffset=f),null===(d=this._onMediaSegment)||void 0===d||d.call(this,"audio",K)}}},e.prototype._remuxVideo=function(e,t){var i,n;if(null!=this._videoMeta){var r,o,a,s=e,l=s.samples,A=-1,d=-1;if(l&&0!==l.length&&(1!==l.length||t)){var c=8,u=null,h=8+e.length,p=null;if(l.length>1&&(h-=(p=l.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,l.unshift(f),h+=(null==f?void 0:f.length)||0}null!=p&&(this._videoStashedLastSample=p);var _=l[0].dts-this._dtsBase;if(this._videoNextDts)r=_-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())r=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(_);if(null!=m){var v=_-(m.originalDts+m.duration);v<=3&&(v=0),r=_-(m.dts+m.duration+v)}else r=0}for(var g=new Be.EZ,y=[],b=0;b<l.length;b++){var E,S=(f=l[b]).dts-this._dtsBase,C=f.isKeyframe,w=S-r,T=f.cts,k=w+T;if(-1===A&&(A=w,d=k),E=b!==l.length-1?l[b+1].dts-this._dtsBase-r-w:null!=p?p.dts-this._dtsBase-r-w:y.length>=1?y[y.length-1].duration:Math.floor((null===(i=this._videoMeta)||void 0===i?void 0:i.refSampleDuration)||0),C){var L=new Be.$_(w,k,E,f.dts,!0);L.fileposition=f.fileposition,g.appendSyncPoint(L)}y.push({dts:w,pts:k,cts:T,units:f.units,size:f.length,isKeyframe:C,duration:E,originalDts:S,flags:{isLeading:0,dependsOn:C?2:1,isDependedOn:C?1:0,hasRedundancy:0,isNonSync:C?0:1}})}for((u=new Uint8Array(h))[0]=h>>>24&255,u[1]=h>>>16&255,u[2]=h>>>8&255,u[3]=255&h,u.set(Ie.types.mdat,4),b=0;b<y.length;b++)for(var I=y[b].units;null==I?void 0:I.length;){var O=I.shift(),B=null==O?void 0:O.data;u.set(B,c),c+=B.byteLength}var R=y[y.length-1];if(o=R.dts+R.duration,a=R.pts+R.duration,this._videoNextDts=o,g.beginDts=A,g.endDts=o,g.beginPts=d,g.endPts=a,g.originalBeginDts=y[0].originalDts,g.originalEndDts=R.originalDts+R.duration,g.firstSample=new Be.$_(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,!!y[0].isKeyframe),g.lastSample=new Be.$_(R.dts,R.pts,R.duration,R.originalDts,!!R.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),s.samples=y,s.sequenceNumber++,this._forceFirstIDR){var x=y[0].flags;x.dependsOn=2,x.isNonSync=0}var D=Ie.moof(s,A);s.samples=[],s.length=0,null===(n=this._onMediaSegment)||void 0===n||n.call(this,"video",{type:"video",data:this._mergeBoxes(D,u).buffer,sampleCount:y.length,info:g})}}},e.prototype._mergeBoxes=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i},e}();var xe=i(8098),De=i(550);const Me=function(){function e(e,t){var i;this.TAG="TransmuxingController",this._emitter=new n.A,this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var r=0;null===(i=this._mediaDataSource.segments)||void 0===i||i.forEach((function(i){i.timestampBase=r,r+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(r)||this._mediaDataSource.duration===r||(this._mediaDataSource.duration=r),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){var e,t,i;this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(null===(e=this._ioctl)||void 0===e||e.destroy(),this._ioctl=null),this._demuxer&&(null===(t=this._demuxer)||void 0===t||t.destroy(),this._demuxer=null),this._remuxer&&(null===(i=this._remuxer)||void 0===i||i.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){var i,n,r;if(this._currentSegmentIndex=e,null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments){var o=null===(n=this._mediaDataSource)||void 0===n?void 0:n.segments[e],a=this._ioctl=new xe.A(o,this._config,e);a.onError=this._onIOException.bind(this),a.onSeeked=this._onIOSeeked.bind(this),a.onComplete=this._onIOComplete.bind(this),a.onRedirect=this._onIORedirect.bind(this),a.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?null===(r=this._demuxer)||void 0===r||r.bindDataSource(this._ioctl):a.onDataArrival=this._onInitChunkArrival.bind(this),a.open(t)}},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isWorking())&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isPaused())&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){var t,i,n,r,o,a,s,l,A,d,c,u,h,p;if(null!=this._mediaInfo&&(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable())){var f=this._searchSegmentIndexContains(e);if(f===this._currentSegmentIndex){var _=(null===(i=this._mediaInfo)||void 0===i?void 0:i.segments)?null===(n=this._mediaInfo)||void 0===n?void 0:n.segments[f]:{};if(void 0===_)this._pendingSeekTime=e;else{var m=null==_?void 0:_.getNearestKeyframe(e);null===(r=this._remuxer)||void 0===r||r.seek(null==m?void 0:m.milliseconds),null===(o=this._ioctl)||void 0===o||o.seek(null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds}}else{var v=(null===(a=this._mediaInfo)||void 0===a?void 0:a.segments)?null===(s=this._mediaInfo)||void 0===s?void 0:s.segments[f]:{};void 0===v?(this._pendingSeekTime=e,this._internalAbort(),null===(l=this._remuxer)||void 0===l||l.seek(),null===(A=this._remuxer)||void 0===A||A.insertDiscontinuity(),this._loadSegment(f)):(m=v.getNearestKeyframe(e),this._internalAbort(),null===(d=this._remuxer)||void 0===d||d.seek(e),null===(c=this._remuxer)||void 0===c||c.insertDiscontinuity(),this._demuxer&&(null===(u=this._demuxer)||void 0===u||u.resetMediaInfo(),this._demuxer.timestampBase=(null===(h=this._mediaDataSource)||void 0===h?void 0:h.segments)?null===(p=this._mediaDataSource)||void 0===p?void 0:p.segments[f].timestampBase:0),this._loadSegment(f,null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds,this._reportSegmentMediaInfo(f))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){var t,i=this._mediaDataSource.segments,n=((null==i?void 0:i.length)||0)-1;if(0===((null==i?void 0:i.length)||0))return n;for(var r=0;r<((null==i?void 0:i.length)||0);r++)if(i&&e<((null===(t=i[r])||void 0===t?void 0:t.timestampBase)||0)){n=r-1;break}return n},e.prototype._onInitChunkArrival=function(e,t){var i,n,o,a,s,l=this,A=0;if(t>0)null===(i=this._demuxer)||void 0===i||i.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(n=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===n?void 0:n.timestampBase:0,A=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(e,t))||0;else{var d=null;(d=S.probe(e)).match&&(this._setupFLVDemuxerRemuxer(d),A=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(e,t))||0),d.match||(null==d?void 0:d.needMoreData)||(d=Te.probe(e)).match&&(this._setupTSDemuxerRemuxer(d),A=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0),d.match||(null==d?void 0:d.needMoreData)||(d=null,r.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){l._internalAbort()})),this._emitter.emit(De.A.DEMUX_ERROR,f.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return A},e.prototype._setupFLVDemuxerRemuxer=function(e){var t;this._demuxer=new S(e,this._config),this._remuxer||(this._remuxer=new Re(this._config));var i=this._mediaDataSource;void 0===i.duration||isNaN(i.duration)||(this._demuxer.overridedDuration=i.duration),"boolean"==typeof i.hasAudio&&(this._demuxer.overridedHasAudio=i.hasAudio),"boolean"==typeof i.hasVideo&&(this._demuxer.overridedHasVideo=i.hasVideo),i.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(t=null==i?void 0:i.segments[this._currentSegmentIndex])||void 0===t?void 0:t.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new Te(e,this._config);this._remuxer||(this._remuxer=new Re(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._onMediaInfo=function(e){var t,i,n=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0,Object.setPrototypeOf(this._mediaInfo,a.A.prototype));var r=Object.assign({},e);Object.setPrototypeOf(r,a.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=r),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=n._pendingSeekTime;n._pendingSeekTime=null,n.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(De.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(De.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTimedID3Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onSMPTE2038Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(De.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){var e;null===(e=this._remuxer)||void 0===e||e.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t,i,n=e+1;n<((null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(n)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(De.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t,i=null===(t=this._ioctl)||void 0===t?void 0:t.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[i].redirectedURL=e)},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(De.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){r.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(De.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){r.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(De.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(De.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(De.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,n=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(De.A.RECOMMEND_SEEKPOINT,n)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t,i,n,r,o=(null===(t=this._mediaInfo)||void 0===t?void 0:t.segments)?null===(i=this._mediaInfo)||void 0===i?void 0:i.segments[e]:{},a=Object.assign({},o);a.duration=null===(n=this._mediaInfo)||void 0===n?void 0:n.duration,a.segmentCount=null===(r=this._mediaInfo)||void 0===r?void 0:r.segmentCount,delete a.segments,delete a.keyframesIndex,this._emitter.emit(De.A.MEDIA_INFO,a)},e.prototype._reportStatisticsInfo=function(){var e,t,i,n,r,o,a={};a.url=null===(e=this._ioctl)||void 0===e?void 0:e.currentURL,a.hasRedirect=null===(t=this._ioctl)||void 0===t?void 0:t.hasRedirect,a.hasRedirect&&(a.redirectedURL=null===(i=this._ioctl)||void 0===i?void 0:i.currentRedirectedURL),a.speed=null===(n=this._ioctl)||void 0===n?void 0:n.currentSpeed,a.loaderType=null===(r=this._ioctl)||void 0===r?void 0:r.loaderType,a.currentSegmentIndex=this._currentSegmentIndex,a.totalSegmentCount=null===(o=this._mediaDataSource.segments)||void 0===o?void 0:o.length,this._emitter.emit(De.A.STATISTICS_INFO,a)},e}()},9987:(e,t,i)=>{var n=i(4417).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}return i.m=e,i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(1900)})()))}(Xi)),Xi.exports);class Ji extends li{constructor(e){var t,i;super(e),this._videoMuted=!0,this.player=e;const n=document.createElement("video"),r=document.createElement("canvas");this.$posterElement=document.createElement("img"),n.oncontextmenu=e=>{e.preventDefault()},n.crossOrigin="anonymous",this._videoMuted=!window.___enableSoundOnUserInteraction___&&this.player._opt.autoPlay||this.player._opt.muted||!this.player._opt.hasAudio,n.muted=this._videoMuted,n.style.position="absolute",n.style.top="0px",n.style.left="0px",this._delayPlay=!1,e.$container.appendChild(n),this.videoInfo={width:"",height:"",encType:""},this.$videoElement=n,this.$canvasElement=r,this.canvasContext=r.getContext("2d"),this.fixChromeVideoFlashBug(),this.resize();const{proxy:o}=this.player.events;o(this.$videoElement,"loadstart",(()=>{this.player.emit("loadstart")})),o(this.$videoElement,"loadeddata",(()=>{this.player.debug.log("Video",`loadeddata ${this._delayPlay}`),this.player.emit(Nt.streamSuccess)})),o(this.$videoElement,"canplay",(()=>{this.player.debug.log("Video",`canplay and _delayPlay is ${this._delayPlay}`),this._delayPlay&&this._play(),this.player.$container.contains(this.$posterElement)&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement)})),o(this.$videoElement,"waiting",(()=>{this.player.emit(Nt.videoWaiting)})),o(this.$videoElement,"timeupdate",(()=>{this.player.emit(Nt.timeUpdate,this.currentTime),!this.isPlaying()&&this.init&&(this.player.debug.log("Video","timeupdate and this.isPlaying is false and retry play"),this.$videoElement.play())})),null===(i=null===(t=this.player.debug)||void 0===t?void 0:t.log)||void 0===i||i.call(t,"Video","init"),this._enableSoundOnUserInteraction=this._enableSoundOnUserInteraction.bind(this),window.addEventListener("mouseup",this._enableSoundOnUserInteraction),window.addEventListener("click",this._enableSoundOnUserInteraction),window.addEventListener("touchstart",this._enableSoundOnUserInteraction),window.addEventListener("keydown",this._enableSoundOnUserInteraction)}destroy(){var e;this.$canvasElement=null,this.canvasContext=null,this.$videoElement&&(this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.src="",this.$videoElement.removeAttribute("src")),this.trackGenerator&&(this.trackGenerator.stop(),this.trackGenerator=null),this.vwriter&&(this.vwriter.close(),this.vwriter=null),(null===(e=this.player.$container)||void 0===e?void 0:e.contains(this.$posterElement))&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement),super.destroy(),this.player.debug.log("Video","destroy")}fixChromeVideoFlashBug(){const e=function(){const e=navigator.userAgent.toLowerCase(),t={},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(let n in i)if(i[n]){let i="";if("IE"===n)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===n){for(const e in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[e].type&&(n="360");i=e.match(/chrome\/([\d.]+)/)[1]}else"Firefox"===n?i=e.match(/firefox\/([\d.]+)/)[1]:"Opera"===n?i=e.match(/opera\/([\d.]+)/)[1]:"Safari"===n?i=e.match(/version\/([\d.]+)/)[1]:"Edge"===n?i=e.match(/edge\/([\d.]+)/)[1]:"QQBrowser"===n&&(i=e.match(/qqbrowser\/([\d.]+)/)[1]);t.type=n,t.version=parseInt(i)}return t}(),t=e.type.toLowerCase();if("chrome"===t||"edge"===t){this.player.$container.style.backdropFilter="blur(0px)"}}play(){if(this.$videoElement){const e=this._getVideoReadyState();if(this.player.debug.log("Video",`play and readyState: ${e}`),0===e)return this.player.debug.warn("Video","readyState is 0 and set _delayPlay to true"),void(this._delayPlay=!0);this._play()}}_getVideoReadyState(){let e=0;return this.$videoElement&&(e=this.$videoElement.readyState),e}_play(){if(this.$videoElement){const e=setTimeout((()=>{this.$videoElement.play().then((()=>{this._delayPlay=!1,this.player.debug.log("Video","_play success"),setTimeout((()=>{this.isPlaying()||(this.player.debug.warn("Video","play failed and retry play"),this._play())}),100)})).catch((e=>{this.player.debug.error("Video","_play error",e)})).finally((()=>{clearTimeout(e)}))}),20)}}pause(e){this._poster(),this.$videoElement.paused||(e?this.$videoElement&&this.$videoElement.pause():setTimeout((()=>{this.$videoElement&&this.$videoElement.pause()}),100))}clearView(){}screenshot(e,t,i,n){var r;e=e||ii()+"",n=n||Qt.download,t=t||"png";const o={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"};"number"!=typeof i&&(i=Number(i||.92));const a=this.$videoElement,s=this.$canvasElement;s.width=a.videoWidth,s.height=a.videoHeight,null===(r=this.canvasContext)||void 0===r||r.drawImage(a,0,0,s.width,s.height);const l=s.toDataURL(o[t]||o.png,i);if(setTimeout((()=>{var e;null===(e=this.canvasContext)||void 0===e||e.clearRect(0,0,s.width,s.height),s.width=0,s.height=0}),2e3),"data:,"!==l){if(n===Qt.base64)return l;{const i=ti(l,e+"."+t);return n===Qt.blob?i:n===Qt.download?(pi(i,e),i):void 0}}}initCanvasViewSize(){this.resize()}_poster(){const e=this.screenshot("poster","png",.75,Qt.base64);void 0===e||e.length<10||(this.$posterElement.src=e,this.$posterElement.style.position="absolute",this.$posterElement.style.top="0px",this.$posterElement.style.left="0px",this.$posterElement.style.zIndex="1",this.$posterElement.style.objectFit="contain",this.$posterElement.style.pointerEvents="none",this.player.$container.appendChild(this.$posterElement),this.resize())}render(e){this.vwriter&&this.vwriter.write(e.videoFrame)}resize(){this._resizeElement(this.$videoElement),this._resizeElement(this.$posterElement)}_resizeElement(e){const i=this.player._opt;let n=this.player.width,r=this.player.height;const o=i.rotate;this._isFullScreen&&[0,180].includes(this._orientation)&&t()&&([n,r]=[r,n]),e.width=n,e.height=r,270!==o&&90!==o||(e.width=r,e.height=n);const a=(n-e.width)/2,s=(r-e.height)/2;let l="contain";i.scaleMode===Ht.full&&(l="fill"),i.scaleMode===Ht.fullAuto&&(l="cover"),e.style.objectFit=l,e.style.transform="rotate("+o+"deg)",e.style.left=a+"px",e.style.top=s+"px"}isPlaying(){return this.$videoElement&&!this.$videoElement.paused}get currentTime(){var e;return(null===(e=this.$videoElement)||void 0===e?void 0:e.currentTime)||0}_enableSoundOnUserInteraction(){!this.player._opt.autoPlay||this.player.muted||window.____enableSoundOnUserInteraction___||(this.$videoElement.muted=!1),window.____enableSoundOnUserInteraction___=!0,window.removeEventListener("mouseup",this._enableSoundOnUserInteraction),window.removeEventListener("click",this._enableSoundOnUserInteraction),window.removeEventListener("touchstart",this._enableSoundOnUserInteraction),window.removeEventListener("keydown",this._enableSoundOnUserInteraction)}}class en extends Ui{constructor(e,t){super(e,t,Ji),this._checkLoadingTimeout=null,this._opt.useMSE=!0,this.emit(Nt.decoderLoaded),t.autoPlay&&this._createPlayer(t)}close(){}_createPlayer(e){var t;this._opt=Object.assign({},this._opt,e),this._removeFlvEvents(),this.player&&(this.player.unload(),this.player.detachMediaElement(),this.player.destroy(),this.player=null),this.events||(this.events=new Di(this)),this.video||(this.video=new Ji(this)),null===(t=Zi.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!this._opt.debug,enableDebug:!!this._opt.debug,enableInfo:!!this._opt.debug,enableWarn:!!this._opt.debug,enableError:!0}),this.player=Zi.createPlayer({type:"flv",url:e.url,isLive:e.isLive},{stashInitialSize:128,enableWorker:!0,liveBufferLatencyChasing:!0,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:86400,fixAudioTimestampGap:!1}),this.player.attachMediaElement(this.video.$videoElement),this._flvEvents()}_removeFlvEvents(){this.player&&(this.player.off(Zi.Events.ERROR),this.player.off(Zi.Events.LOADING_COMPLETE),this.player.off(Zi.Events.RECOVERED_EARLY_EOF),this.player.off(Zi.Events.MEDIA_INFO),this.player.off(Zi.Events.STATISTICS_INFO),this.player.off(Zi.Events.DESTROYING))}_flvEvents(){if(this.player){let e=0;this.player.on(Zi.Events.ERROR,((t,i,n)=>{var r;if("MediaError"===t&&"MediaMSEError"===i&&9===n.code&&this.emit(jt.mediaSourceH265NotSupport,n),this.emit(Nt.error,{errorTypes:t,errorDetails:i,info:n}),t.indexOf("NetworkError")>-1&&(this.emit(Nt.streamError,{errorTypes:t,errorDetails:i,info:n,api:this._opt.url,type:"stream"}),this.player))try{this.pause().then((()=>{this.emit(Nt.delayTimeout)})).catch((()=>{this.emit(Nt.delayTimeout)}))}catch(e){}if("MediaError"===t&&"CodecUnsupported"===i&&-1===n.code&&n.msg.indexOf("Unsupported audio codec"))0===e&&(qi.report(51,{event:t,value:n}),e=1,this.debug.error(`${Zi.Events.ERROR}`,t,i,JSON.stringify(n)),this.emit(Nt.audioCodecUnsupported,!0));else if(null===(r=n.msg)||void 0===r?void 0:r.includes("SourceBuffer is full")){const e=this.player._msectl._sourceBuffers[0];try{const t=this.video.$videoElement.currentTime;Math.max(0,t-5)>0&&e&&!e.updating&&e.remove(0,Math.max(0,t-5))}catch(e){}qi.report(51,{event:t,value:n}),this.debug.error(`${Zi.Events.ERROR}`,t,i,JSON.stringify(n))}else"NetworkError"===t&&"UnrecoverableEarlyEof"===i||(qi.report(51,{event:t,value:n}),this.debug.error(`${Zi.Events.ERROR}`,t,i,JSON.stringify(n)))})),this.player.on(Zi.Events.LOADING_COMPLETE,(e=>{this.debug.warn(`${Zi.Events.LOADING_COMPLETE}`,JSON.stringify(e))})),this.player.on(Zi.Events.RECOVERED_EARLY_EOF,(e=>{this.debug.warn(`${Zi.Events.RECOVERED_EARLY_EOF}`,e)})),this.player.on("media_info",(e=>{this.clearCheckLoadingTimeout(),this.video.updateVideoInfo(Object.assign({encTypeCode:(null==e?void 0:e.videoCodec.indexOf("avc"))>=0?7:12},e))})),this.player.on(Zi.Events.STATISTICS_INFO,(e=>{e.decodedFrames===this._decodedFrames&&null===this._checkHeartTimeout?this.checkHeartTimeout():e.decodedFrames!==this._decodedFrames&&(this.clearCheckHeartTimeout(),this._decodedFrames=e.decodedFrames)})),this.player.on(Zi.Events.DESTROYING,(e=>{this.debug.log(`${Zi.Events.DESTROYING}`,JSON.stringify(e))})),this.on(Nt.videoWaiting,(()=>{this.clearCheckHeartTimeout(),null===this._checkHeartTimeout&&this.handleRender()})),this._onVideoLoadstart=this._onVideoLoadstart.bind(this),this.off("loadstart"),this.on("loadstart",this._onVideoLoadstart),this.on(Nt.timeUpdate,(()=>{this.clearCheckHeartTimeout()})),this._onVideoStreamSuccess=this._onVideoStreamSuccess.bind(this),this.off(Nt.streamSuccess,this._onVideoStreamSuccess),this.on(Nt.streamSuccess,this._onVideoStreamSuccess)}}_onVideoLoadstart(){this.checkLoadingTimeout()}_onVideoStreamSuccess(){this.clearCheckLoadingTimeout()}getOption(){return this._opt}emitError(e,t=""){this.emit(Nt.error,e,t),this.emit(e,t)}destroy(){this._destroy(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.video&&(this.video.destroy(),this.video=null),this.events&&(this.events.destroy(),this.events=null),this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}_destroy(){this.player&&this.playing&&this.player.pause(),this._flvPlayerDestroy(),this._loading=!1,this._playing=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0}resetStats(){}get loaded(){return!0}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(Nt.playing,e),e?this.emit(Nt.play):this.emit(Nt.pause))}get playing(){return this._playing}get muted(){return this._muted}set muted(e){this.video&&(this.video.$videoElement.muted=e,this.player&&(this.player.muted=e)),super._updateMuted(e)}get volume(){return this._volume}set volume(e){super._updateVolume(e),this.video&&(this.video.$videoElement.volume=e)}set loading(e){this.loading!==e&&(this._loading=e,this.emit(Nt.loading,this._loading),e||this.emit(Nt.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e)}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!!this._opt.debug}checkLoadingTimeout(){var e;0!==this._opt.loadingTimeout&&(this._checkLoadingTimeout=setTimeout((()=>{this.clearCheckLoadingTimeout();try{this.pause().then((()=>{this.emit(Nt.timeout,Nt.loadingTimeout),this.emit(Nt.loadingTimeout)})).catch((()=>{this.emit(Nt.timeout,Nt.loadingTimeout),this.emit(Nt.loadingTimeout)}))}catch(e){}}),1e3*((null===(e=this._opt)||void 0===e?void 0:e.loadingTimeout)||10)))}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkHeartTimeout(){var e,t;if(0===this._opt.heartTimeout)return;const i=(null===(e=this.video)||void 0===e?void 0:e.currentTime)||0;this._checkHeartTimeout=setTimeout((()=>{var e;if(this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this.playing&&this.video){if(i!==((null===(e=this.video)||void 0===e?void 0:e.currentTime)||0))return;try{this.pause().then((()=>{this.emit(Nt.timeout,Nt.heartTimeout),this.emit(Nt.heartTimeout)})).catch((()=>{this.emit(Nt.timeout,Nt.heartTimeout),this.emit(Nt.heartTimeout)}))}catch(e){}}}),1e3*((null===(t=this._opt)||void 0===t?void 0:t.heartTimeout)||5))}handleRender(){this.loading&&(this.emit(Nt.start),this.loading=!1),this.playing||(this.playing=!0),this.checkHeart()}updateOption(e){var t;super.updateOption(e),null===(t=Zi.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!e.debug,enableDebug:!!e.debug,enableInfo:!!e.debug,enableWarn:!!e.debug,enableError:!0})}play(e={}){return this._play(e)}_play(e={}){return this.player&&this._destroy(),this.clearCheckHeartTimeout(),this._createPlayer(Object.assign({},this._opt,e)),this.loading=!0,this._playing=!1,this._times.playInitStart=ii(),this.player?(this.player.load(),new Promise(((e,t)=>{this.player.play().then((()=>{this.loading=!1,this.playing=!0,this._opt.muted||(this.muted=!1),e()})).catch((e=>{t(e)}))}))):Promise.reject()}_flvPlayerDestroy(){this.player&&(this.video.pause(),this.player.unload(),this._removeFlvEvents(),this.player.detachMediaElement(),this.player.destroy(),this.player=null)}_close(){return new Promise((e=>{this._loading=!1,this._playing=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.video&&this.video.resetInit(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.player&&(this._flvPlayerDestroy(),this._pause=!0),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,setTimeout((()=>{e()}),110)}))}pause(){return this._close()}resumeAudioAfterPause(){}}class tn{constructor(e,t){this._opt=Object.assign({},bt,t),(oi()||"360EE"===_t().browser)&&(this._opt.useMSE=!1);return new(tn.getLoaderFactory(this._opt.useMSE))(e,this._opt)}static getLoaderFactory(e){return e?en:Ki}}function nn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=new URL(e),n=e.split("?")[1];let r={};if(n){const e=n.split("&");for(let t of e){if(""===t)continue;const e=t.split("=");e[0]&&(r[e[0]]=e[1])}}const o={protocol:i.protocol,hostname:i.hostname,port:i.port,pathname:i.pathname,search:i.search,query:r,url:e};if(t&&/_(\d+)_(\d+)\.flv/.test(e)){const e=i.pathname.split("/")[i.pathname.split("/").length-1].replace(/.flv$/,"").split("_");e[0].indexOf("-")>=0?(o.streamName=e[0].split("-")[0],o.deviceSerial=e[0].split("-")[1]):o.deviceSerial=e[0],o.channelNo=+e[1],o.streamTypeIn=+e[2]}return o}var rn,on={exports:{}},an=a(Object.freeze({__proto__:null,default:{}}));var sn=(rn||(rn=1,function(e){!function(){var t="input is invalid type",i="object"==typeof window,n=i?window:{};n.JS_MD5_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self,a=!n.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?n=r:o&&(n=self);var s,l=!n.JS_MD5_NO_COMMON_JS&&e.exports,A=!n.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),c=[128,32768,8388608,-2147483648],u=[0,8,16,24],h=["hex","array","digest","buffer","arrayBuffer","base64"],p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(A){var _=new ArrayBuffer(68);s=new Uint8Array(_),f=new Uint32Array(_)}var m=Array.isArray;!n.JS_MD5_NO_NODE_JS&&m||(m=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var v=ArrayBuffer.isView;!A||!n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&v||(v=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e){var i=typeof e;if("string"===i)return[e,!0];if("object"!==i||null===e)throw new Error(t);if(A&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!v(e))throw new Error(t);return[e,!1]},y=function(e){return function(t){return new S(!0).update(t)[e]()}},b=function(e){var i,r=an,o=an.Buffer;return i=o.from&&!n.JS_MD5_NO_BUFFER_FROM?o.from:function(e){return new o(e)},function(n){if("string"==typeof n)return r.createHash("md5").update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),m(n)||v(n)||n.constructor===o?r.createHash("md5").update(i(n)).digest("hex"):e(n)}},E=function(e){return function(t,i){return new C(t,!0).update(i)[e]()}};function S(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(A){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function C(e,t){var i,n=g(e);if(e=n[0],n[1]){var r,o=[],a=e.length,s=0;for(i=0;i<a;++i)(r=e.charCodeAt(i))<128?o[s++]=r:r<2048?(o[s++]=192|r>>>6,o[s++]=128|63&r):r<55296||r>=57344?(o[s++]=224|r>>>12,o[s++]=128|r>>>6&63,o[s++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++i)),o[s++]=240|r>>>18,o[s++]=128|r>>>12&63,o[s++]=128|r>>>6&63,o[s++]=128|63&r);e=o}e.length>64&&(e=new S(!0).update(e).array());var l=[],A=[];for(i=0;i<64;++i){var d=e[i]||0;l[i]=92^d,A[i]=54^d}S.call(this,t),this.update(A),this.oKeyPad=l,this.inner=!0,this.sharedMemory=t}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=g(e);e=t[0];for(var i,n,r=t[1],o=0,a=e.length,s=this.blocks,l=this.buffer8;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),r)if(A)for(n=this.start;o<a&&n<64;++o)(i=e.charCodeAt(o))<128?l[n++]=i:i<2048?(l[n++]=192|i>>>6,l[n++]=128|63&i):i<55296||i>=57344?(l[n++]=224|i>>>12,l[n++]=128|i>>>6&63,l[n++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),l[n++]=240|i>>>18,l[n++]=128|i>>>12&63,l[n++]=128|i>>>6&63,l[n++]=128|63&i);else for(n=this.start;o<a&&n<64;++o)(i=e.charCodeAt(o))<128?s[n>>>2]|=i<<u[3&n++]:i<2048?(s[n>>>2]|=(192|i>>>6)<<u[3&n++],s[n>>>2]|=(128|63&i)<<u[3&n++]):i<55296||i>=57344?(s[n>>>2]|=(224|i>>>12)<<u[3&n++],s[n>>>2]|=(128|i>>>6&63)<<u[3&n++],s[n>>>2]|=(128|63&i)<<u[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),s[n>>>2]|=(240|i>>>18)<<u[3&n++],s[n>>>2]|=(128|i>>>12&63)<<u[3&n++],s[n>>>2]|=(128|i>>>6&63)<<u[3&n++],s[n>>>2]|=(128|63&i)<<u[3&n++]);else if(A)for(n=this.start;o<a&&n<64;++o)l[n++]=e[o];else for(n=this.start;o<a&&n<64;++o)s[n>>>2]|=e[o]<<u[3&n++];this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=c[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},S.prototype.hash=function(){var e,t,i,n,r,o,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879|0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&e)+a[1]-117830708)<<12|n>>>20)+e|0)&(-271733879^e))+a[2]-1126478375)<<17|i>>>15)+n|0)&(n^e))+a[3]-1316259209)<<22|t>>>10)+i|0:(e=this.h0,t=this.h1,i=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(i^n))+a[0]-680876936)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[1]-389564586)<<12|n>>>20)+e|0)&(e^t))+a[2]+606105819)<<17|i>>>15)+n|0)&(n^e))+a[3]-1044525330)<<22|t>>>10)+i|0),t=((t+=((e=((e+=(n^t&(i^n))+a[4]-176418897)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[5]+1200080426)<<12|n>>>20)+e|0)&(e^t))+a[6]-1473231341)<<17|i>>>15)+n|0)&(n^e))+a[7]-45705983)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(n^t&(i^n))+a[8]+1770035416)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[9]-1958414417)<<12|n>>>20)+e|0)&(e^t))+a[10]-42063)<<17|i>>>15)+n|0)&(n^e))+a[11]-1990404162)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(n^t&(i^n))+a[12]+1804603682)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[13]-40341101)<<12|n>>>20)+e|0)&(e^t))+a[14]-1502002290)<<17|i>>>15)+n|0)&(n^e))+a[15]+1236535329)<<22|t>>>10)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[1]-165796510)<<5|e>>>27)+t|0)^t))+a[6]-1069501632)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[11]+643717713)<<14|i>>>18)+n|0)^n))+a[0]-373897302)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[5]-701558691)<<5|e>>>27)+t|0)^t))+a[10]+38016083)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[15]-660478335)<<14|i>>>18)+n|0)^n))+a[4]-405537848)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[9]+568446438)<<5|e>>>27)+t|0)^t))+a[14]-1019803690)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[3]-187363961)<<14|i>>>18)+n|0)^n))+a[8]+1163531501)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[13]-1444681467)<<5|e>>>27)+t|0)^t))+a[2]-51403784)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[7]+1735328473)<<14|i>>>18)+n|0)^n))+a[12]-1926607734)<<20|t>>>12)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[5]-378558)<<4|e>>>28)+t|0))+a[8]-2022574463)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[11]+1839030562)<<16|i>>>16)+n|0))+a[14]-35309556)<<23|t>>>9)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[1]-1530992060)<<4|e>>>28)+t|0))+a[4]+1272893353)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[7]-155497632)<<16|i>>>16)+n|0))+a[10]-1094730640)<<23|t>>>9)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[13]+681279174)<<4|e>>>28)+t|0))+a[0]-358537222)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[3]-722521979)<<16|i>>>16)+n|0))+a[6]+76029189)<<23|t>>>9)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[9]-640364487)<<4|e>>>28)+t|0))+a[12]-421815835)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[15]+530742520)<<16|i>>>16)+n|0))+a[2]-995338651)<<23|t>>>9)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[0]-198630844)<<6|e>>>26)+t|0)|~i))+a[7]+1126891415)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[14]-1416354905)<<15|i>>>17)+n|0)|~e))+a[5]-57434055)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[12]+1700485571)<<6|e>>>26)+t|0)|~i))+a[3]-1894986606)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[10]-1051523)<<15|i>>>17)+n|0)|~e))+a[1]-2054922799)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[8]+1873313359)<<6|e>>>26)+t|0)|~i))+a[15]-30611744)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[6]-1560198380)<<15|i>>>17)+n|0)|~e))+a[13]+1309151649)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[4]-145523070)<<6|e>>>26)+t|0)|~i))+a[11]-1120210379)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[2]+718787259)<<15|i>>>17)+n|0)|~e))+a[9]-343485551)<<21|t>>>11)+i|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=i-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+i|0,this.h3=this.h3+n|0)},S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return d[e>>>4&15]+d[15&e]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>28&15]+d[e>>>24&15]+d[t>>>4&15]+d[15&t]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>28&15]+d[t>>>24&15]+d[i>>>4&15]+d[15&i]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>28&15]+d[i>>>24&15]+d[n>>>4&15]+d[15&n]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>28&15]+d[n>>>24&15]},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&i,i>>>8&255,i>>>16&255,i>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255]},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},S.prototype.buffer=S.prototype.arrayBuffer,S.prototype.base64=function(){for(var e,t,i,n="",r=this.array(),o=0;o<15;)e=r[o++],t=r[o++],i=r[o++],n+=p[e>>>2]+p[63&(e<<4|t>>>4)]+p[63&(t<<2|i>>>6)]+p[63&i];return e=r[o],n+=p[e>>>2]+p[e<<4&63]+"=="},C.prototype=new S,C.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var w=function(){var e=y("hex");a&&(e=b(e)),e.create=function(){return new S},e.update=function(t){return e.create().update(t)};for(var t=0;t<h.length;++t){var i=h[t];e[i]=y(i)}return e}();w.md5=w,w.md5.hmac=function(){var e=E("hex");e.create=function(e){return new C(e)},e.update=function(t,i){return e.create(t).update(i)};for(var t=0;t<h.length;++t){var i=h[t];e[i]=E(i)}return e}(),l?e.exports=w:n.md5=w}()}(on)),on.exports),ln=o(sn);const An="/api/v3/device/local/video/unify/query",dn="/api/service/device/capacity/video/quality",cn="/api/v3/device/setVideoLevel",un="/api/lapp/v2/live/address/get",hn="/api/service/media/live/cdn/config",pn="/api/service/media/live/record/cdn/config",fn="/api/service/media/streammanage/interrupt/info";function _n(e){return e<10?"0"+e:e+""}const mn={0:"流畅",1:"标清",2:"高清",3:"超清",4:"极清",5:"3K",6:"4K"},vn=[{videoLevel:1,name:mn[1],streamTypeIn:2,type:"compatible"},{videoLevel:2,name:mn[2],streamTypeIn:1,type:"compatible"}];class gn{constructor(e,t){this._player=e,this.baseURL=(t.baseURL||"https://open.ys7.com").replace(/\/$/,""),this.accessToken=t.accessToken,this.deviceSerial=t.deviceSerial,this.channelNo=t.channelNo,this.appName=t.appName,this.v=t.v}fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=/http[s]?:\/\//.test(e)?e:`${this.baseURL}${e}`,n=t.headers;return delete t.headers,fetch(i,{...t||{},...null===n?{}:{headers:{clientType:"ezuikit-flv",accessToken:this.accessToken,deviceSerial:this.deviceSerial,localIndex:this.channelNo,...n||{}}}})}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"get"})}post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"post"})}setVideoLevelService(e){const t=new FormData;return t.append("videoLevel",parseInt(e)),this.post(`${cn}`,{body:t}).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,jt.fetchError,{api:cn,error:e})}))}async getLocalVideoUnifyQueryService(e){var t,i,n,r;const o=(e.startTime+36e5*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0))/1e3,a=(e.endTime+36e5*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0))/1e3,s=async e=>{let t=[];try{var i,n,r;const A=await this.get(`${An}?startTime=${e.startTime}&endTime=${e.endTime}&pageSize=${e.pageSize||200}`).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,jt.fetchError,{api:An,error:e})}));var o,a,l;if(200!==(null==A||null===(i=A.meta)||void 0===i?void 0:i.code))return null===(o=(a=this._player).emit)||void 0===o||o.call(a,jt.fetchError,{api:An,error:null==A?void 0:A.meta}),t;if(null!=A&&null!==(n=A.data)&&void 0!==n&&null!==(n=n.records)&&void 0!==n&&n.length&&(t=t.concat(A.data.records||[])),null!=A&&null!==(r=A.data)&&void 0!==r&&r.hasMore)t=t.concat(await s({...e,startTime:null==A||null===(l=A.data)||void 0===l?void 0:l.nextFileTime}))}catch(e){}return t},l=await s({...e,startTime:o,endTime:a})||[];return this._player.playbackRecords=(l||[]).map((e=>{var t,i;return{...e,startTime:e.startTime-3600*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0),endTime:e.endTime-3600*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0)}})).reduce(((e,t)=>{const i=e[e.length-1];return i&&i.endTime===t.startTime?i.endTime=t.endTime:e.push(t),e}),[]),null===(n=(r=this._player).emit)||void 0===n||n.call(r,Nt.localVideoRecords,this._player.playbackRecords),l}async getVideoQualityService(){let e=vn;try{var t,i;const o=await this.get(`${dn}?deviceSerial=${this.deviceSerial}`).then((e=>e.json())).catch((e=>{this._player.emit(jt.fetchError,{api:dn,error:e})}));var n,r;if(200!==(null==o||null===(t=o.meta)||void 0===t?void 0:t.code))return null===(n=(r=this._player).emit)||void 0===n||n.call(r,jt.fetchError,{api:dn,error:null==o?void 0:o.meta}),e;null!=o&&null!==(i=o.data)&&void 0!==i&&i.length&&(e=o.data)}catch(e){}return e=e.map((e=>({...e,name:mn[e.videoLevel]||"未知"}))),e}getPlayAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new FormData;return Object.keys(e).forEach((i=>{t.append(i,e[i])})),t.append("protocol",4),t.append("accessToken",this.accessToken),t.append("deviceSerial",this.deviceSerial),t.append("channelNo",this.channelNo),this.post(`${un}`,{body:t}).then((e=>e.json())).then((e=>{var t;return 200==+e.code?null==e||null===(t=e.data)||void 0===t?void 0:t.url:""}))}getRecordAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNRecordAddressService(e)):this.getPlayAddressService({...e,type:2})}getLiveAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNLiveAddressService(e)):this.getPlayAddressService({...e,type:1})}getCDNPlayAddressService(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new FormData,n=new Date,r=`${n.getFullYear()}-${_n(n.getMonth()+1)}-${_n(n.getDate())} 00:00:00`,o=`${n.getFullYear()}-${_n(n.getMonth()+1)}-${_n(n.getDate())} 23:59:59`;return i.append("startTime",r),i.append("endTime",o),i.append("playProtocol",2),i.append("streamName",ln((function(e,t){var i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[];for(t=t||n.length,i=0;i<e;i++)r[i]=n[0|Math.random()*t];return r.join("")}(32)+"_"+(new Date).getTime()).replace(/-/gi,"")+"_"+this.deviceSerial+"_"+this.channelNo+"_"+t.quality)),i.append("supportH265",1),i.append("appName",this.appName),Object.keys(t).forEach((e=>{i.append(e,t[e])})),this.post(e,{body:i}).then((e=>e.json())).then((e=>{var t,i;return 200==+(null===(t=e.meta)||void 0===t?void 0:t.code)?null===(i=e.data)||void 0===i?void 0:i.cdnUrl:""}))}async getCDNLiveAddressService(e){return this.getCDNPlayAddressService(`${hn}`,e)}async getCDNRecordAddressService(e){return this.getCDNPlayAddressService(`${pn}`,{recordStartTime:e.startTime,recordEndTime:e.stopTime,quality:e.quality,type:e.type||1})}async getStreamInterreputInfo(e){const t=new FormData;return t.append("streamId",e),this.post(fn,{body:t,headers:null}).then((e=>e.json()))}}function yn(e){return new Date(bn(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/"))}function bn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return`${(e=e.replace(/\//gi,"").replace(/-/gi,"").replace(/:/gi,"").replace(/ /gi,"")).substring(0,4)}${t}${e.substring(4,6)}${t}${e.substring(6,8)} ${e.substring(8,10)}:${e.substring(10,12)}:${e.substring(12,14)}`}function En(e){let t=null;if(t="string"==typeof e?document.querySelector("#"+e.replace(/^#/,"")):e,!t)throw new Error("Flv required node can be a string (dom id) or dom (HTMLElement node)");if("CANVAS"===t.nodeName||"VIDEO"===t.nodeName)throw new Error(`Flv container type can not be ${t.nodeName} type`);return t}var Sn={95e3:"服务端内部处理异常",95400:"私有化协议vtm检测私有化协议中码流类型小于0或者设备序列号为空等非法参数场景返回(app不重试取流)",95402:"回放找不到录像文件",95403:"操作码或信令密钥与设备不匹配",95404:"设备不在线\t检查设备网络",95405:"流媒体向设备发送或接受信令超时/cas响应超时",95406:"token失效",95407:"客户端的URL格式错误",95409:"预览开启隐私保护",95411:"token无权限",95412:"session不存在",95413:"token验证失败\t刷新重试",95415:"设备通道错",95416:"设备资源受限\t刷新重试",95417:"设备4G流量耗尽",95451:"设备不支持的码流类型",95452:"设备链接流媒体服务器失败",95454:"流媒体中关于设备取流会话不存在",95455:"设备通道未关联",95456:"设备通道关联设备不在线",95457:"客户端不支持端到端加密",95458:"设备不支持当前并发ECDH密",95459:"VTDU 处理ECDH 加密失败",95460:"手表正在拍照或录像",95461:"手表正在视频聊天",95462:"手表正在识图",95463:"手表正在QQ视频",95464:"手表正在坐姿检测",95465:"手表温度过高",95466:"设备视频通话中,不支持预览",95492:"设备不支持的命令",95500:"服务器处理失败",95503:"vtm返回分配vtdu失败, 请稍后重试",95504:"服务器负载达到上限,请稍后重试",95505:"vtm ecdh解密失败",95506:"vtm 返回IPC不支持取流(需要IPC添加NVR后支持)",95507:"不支持该4G卡套餐在非萤石App取流",95544:"设备返回无视频源",95545:"视频分享时间已经结束",95546:"取流并发路数限制",95547:"开放平台用户并发限制",95556:"ticket校验失败",95557:"回放服务器等待流头超时, 刷新重试,检测设备网络,重启设备",95558:"查找录像开始时间错误",95560:"群组分享取流二次验证失败",95561:"分享群组用户被锁住",95562:"群组分享用户权限变更",95563:"认证服务连接失败",95564:"认证超时",95565:"缓存无效",95566:"不在分享时间内预览",95567:"分享通道被锁定",95568:"未找到认证类型",95569:"认证返回的参数异常",95600:"分享设备不在分享时间内",95601:"群组分享用户没权限",95602:"群组分享权限变更",95530:"机房故障不可用, 刷新重试",95610:"接收流头失败",95620:"心跳超时",95701:"cas信令返回格式错误",95702:"SPGW请求Cas、Status透传超时,刷新重试",95703:"SPGW请求http不通,刷新重试",96001:"客户端参数出错",96002:"等待客户端侧心跳超时(20秒无心跳包)",96099:"客户端默认错误",96101:"不支持的命令",96102:"设备流头发送失败, 刷新重试",96103:"cas/设备返回错误1, 刷新重试",96104:"cas/设备返回错误-1, 刷新重试",96105:"设备返回错误码3, 刷新重试",96106:"设备返回错误码4, 刷新重试",96107:"设备返回错误码5, 刷新重试",96108:"cas信令回应重复, 刷新重试",96109:"视频广场取消分享",96110:"设备信令默认错误\t设备错返回的错误码,不具体\t刷新重试,或者重启设备",96501:"设备数据链路和实际链路不匹配, 刷新重试",96502:"设备数据链路重复建立连接, 刷新重试",96503:"设备数据链路端口不匹配, 刷新重试",96504:"缓存设备数据链路失败, 刷新重试",96505:"设备发送确认头消息重复, 刷新重试",96506:"设备数据先于确定头部到达, 刷新重试",96508:"设备数据头部长度非法, 刷新重试,或者重启设备",96509:"索引找不到设备数据管理块, 刷新重试",96510:"设备数据链路vtdu内存块协议状态不匹配",96511:"设备数据头部没有streamkey错误",96512:"设备数据头部非法",96513:"设备数据长度过小",96514:"设备老协议推流头部没有streamkey错误",96515:"设备老协议推流数据非法",96516:"设备老协议索引找不到内存管理块",96517:"设备老协议推流数据非法",96518:"设备数据包过大, 刷新重试,或者重启设备",96519:"设备推流链路网络不稳定, 设备长时间未推流超时",96520:"设备推流链路网络不稳定, 设备网络异常",90601:"流ID不存在",90602:"流被禁用",90603:"不在可用时间区间",90604:"用户设备关系验证失败",90605:"通道被隐藏",90606:"4G无限流量卡",4050:"服务内部调用向vtdu取流的接口失败",4054:"服务内部生成ticket失败",4056:"vtm服务信息为空",4057:"取流url非法(可能是格式、参数错误)",4058:"取流url过期(不在可用时间)",9048:"并发限制",9049:"带宽限制",9053:"不支持H265",9057:"设备码流加密",9060:"设备取流校验不通过",9061:"auth认证不通过",9062:"auth认证网络有问题"},Cn={95e3:"Internal server processing error",95400:"Private protocol VTM detection failed: Invalid parameters (stream type < 0 or empty device serial number), (App should not retry streaming)",95402:"Playback failed: Recording file not found",95403:"Operation code/signaling key mismatch with the device",95404:"Device offline, Check device network",95405:"Stream server timeout when sending/receiving device signaling or CAS response timeout, Check device network or restart device",95406:"Token expired, Refresh token or restart device",95407:"Invalid client URL format",95409:"Privacy protection enabled during preview",95411:"Token lacks permissions/user unauthorized",95412:"Session does not exist",95413:"Token verification failed, Refresh token",95415:"Invalid device channel",95416:"Device resource limit reached, Retry later",95417:"Device 4G data quota exhausted",95451:"Unsupported stream type by device",95452:"Device failed to connect to stream server",95454:"Streaming session not found in stream server",95455:"Device channel not associated",95456:"Associated device channel offline",95457:"Client does not support end-to-end encryption",95458:"Device does not support current concurrent ECDH encryption",95459:"VTDU failed to process ECDH encryption",95460:"Watch is capturing photos/video",95461:"Watch is in video chat",95462:"Watch is performing image recognition",95463:"Watch is in QQ video call",95464:"Watch is performing posture detection",95465:"Watch temperature too high",95466:"Device in video call; preview not supported",95492:"Unsupported command by device",95500:"Server processing failure",95503:"VTM failed to allocate VTDU, Retry later (VTDU service issue)",95504:"Server overloaded, Retry later",95505:"VTM ECDH decryption failed",95506:"IPC streaming not supported (requires NVR binding)",95507:"4G plan does not support non-EZVIZ app streaming",95544:"No video source from device",95545:"Video sharing period ended",95546:"Stream concurrency limit reached",95547:"Open platform user concurrency limit exceeded",95556:"Ticket validation failed",95557:"Playback server timeout waiting for stream header, Retry later or check device network.",95558:"Invalid playback start time",95560:"Group sharing stream secondary validation failed",95561:"Group shared user locked",95562:"Group sharing permissions modified",95563:"Authentication service connection failed",95564:"Authentication timeout",95565:"Invalid cache",95566:"Preview outside sharing period",95567:"Shared channel locked",95568:"Authentication type not found",95569:"Invalid authentication parameters",95600:"Shared device not in sharing period",95601:"Group user lacks permissions",95602:"Group sharing permissions modified",95530:"Data center outage, Retry later",95610:"Failed to receive stream header",95620:"Heartbeat timeout",95701:"CAS signaling format error",95702:"SPGW request to CAS/Status timeout, Retry later",95703:"SPGW HTTP request failed, Retry later",96001:"Client parameter error",96002:"Client heartbeat timeout (20s no packet)",96099:"Default client error",96101:"Unsupported command",96102:"Device stream header delivery failed, Retry later",96103:"CAS/device returned error code 1, Retry later",96104:"CAS/device returned error code -1, Retry later",96105:"Device returned error code 3, Retry later",96106:"Device returned error code 4, Retry later",96107:"Device returned error code 5, Retry later",96108:"Duplicate CAS signaling response, Retry later",96109:"Video sharing canceled by platform",96110:"Default device signaling error, Retry or restart device",96501:"Device data path mismatch, Retry later",96502:"Duplicate device data path connection, Retry later",96503:"Device data port mismatch, Retry later",96504:"Failed to cache device data path (insufficient memory), Retry later",96505:"Duplicate device acknowledgment header, Retry later",96506:"Device data arrived before header confirmation, Retry later",96508:"Invalid device data header length, Retry or restart device",96509:"Data management block not found, Retry later",96510:"VTDU protocol state mismatch for device data path",96511:"Missing stream key in device data header",96512:"Invalid device data header",96513:"Device data length too small",96514:"Legacy protocol: Missing stream key in push header",96515:"Invalid legacy protocol push data",96516:"Legacy protocol: Data management block not found",96517:"Invalid legacy protocol push data",96518:"Device data packet too large, Retry or restart device",96519:"Unstable device push stream (timeout due to inactivity)",96520:"Unstable device push stream (network issue)",90601:"Stream ID does not exist",90602:"Stream is disabled",90603:"Not within the available time range",90604:"User-device relationship verification failed",90605:"Channel is hidden",90606:"4G unlimited data plan",4050:"Internal service call to VTDU for stream retrieval failed",4054:"Internal service failed to generate ticket",4056:"VTM service information is empty",4057:"Stream retrieval URL is invalid (possibly due to format or parameter error)",4058:"Stream retrieval URL has expired (not within valid time range)",9048:"Concurrency limit exceeded",9049:"Bandwidth limit exceeded",9053:"H265 encoding not supported",9057:"Device stream is encrypted",9060:"Device stream retrieval validation failed",9061:"Auth authentication failed",9062:"Auth authentication network issue"};const wn=["h264","h265"],Tn=[.5,1,2,4,8];class kn extends ct{constructor(t){var i,n,r;super({...t,volumeOptions:{muted:t.muted??bt.muted,volume:t.volume??bt.volume,...t.volumeOptions||{}},container:En(t.id||t.container),type:"flv"}),e(this,"urlInfo",{}),e(this,"services",null),e(this,"_loadingTimeoutDelayTimer",null),e(this,"_heartTimeoutDelayTimer",null),null===(i=this.i18n)||void 0===i||null===(n=i.appendTranslations)||void 0===n||n.call(i,{zh:Sn,en:Cn}),qi.initMonitor(t.ignoreMonitor||t.disableColect);const o=Object.assign({},{isLive:!0,timeZone:0},bt,t);let a=En(t.id||t.container);if(!t.url)throw new Error("Flv url is empty");var s;qi.url=t.url,qi.report(1,{name:"constructor"}),a.classList.add("ezui-player-container","ezui-flv-container"),delete o.container,o.forceNoOffscreen=!0,ai(o.videoBuffer)&&(o.videoBuffer=1e3*Number(o.videoBuffer)),this._opt=o,this.urlInfo=nn(o.url,this._opt.isEzviz),this.$container=a,this._heartTimeoutDelayTimes=0,this._loadingTimeoutReplayTimes=0,this.events=new Di(this),this._initPlayer(a,o),this._videoInfo={},this._currentPlayDate=null,this.definitionList=[],this.definition={},this._playbackRate=1,this.playbackRateList=Tn,this.playbackRecords=[],this.services=new gn(this,{baseURL:(null===(r=this._opt.env)||void 0===r?void 0:r.domain)||Jt,accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo}),this._httpServices(),(s=this).on(Nt.volumechange,((e,t)=>{var i,n;(null===(i=s.player)||void 0===i?void 0:i.volume)!==e&&(s.player.volume=e),(null===(n=s.player)||void 0===n?void 0:n.muted)!==t&&(s.player.muted=t)})),s.on(Nt.control.play,(e=>{e?s.play():s.pause()})),s.on(Nt.fullscreenChange,(e=>{s.player.emit(Nt.fullscreenChange,e)})),s.on(Nt.orientationChange,(e=>{s.player.emit(Nt.orientationChange,e)})),function(e){var t,i;null===(t=e.player)||void 0===t||t.on(Nt.volumechange,((t,i)=>{e.volume!==t&&(e.volume=t),e.muted!==i&&(e.muted=i)})),null===(i=e.player)||void 0===i||i.on(Nt.audioCodecUnsupported,(t=>{e.emit(Nt.audioCodecUnsupported,t)}))}(this),this.options.useMSE&&(this._onvisibilitychange=this._onvisibilitychange.bind(this),document.addEventListener("visibilitychange",this._onvisibilitychange))}_httpServices(){try{var e,t,i;if(this._opt.isEzviz&&null!==(e=this._opt)&&void 0!==e&&e.accessToken&&this.urlInfo.deviceSerial&&this.urlInfo.channelNo>=0&&this.urlInfo.streamTypeIn)if(this.services=new gn(this,{baseURL:((null===(t=this._opt.env)||void 0===t?void 0:t.domain)||Jt).replace(/\/$/,""),accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo,appName:this._opt.appName,v:null===(i=this.urlInfo.query)||void 0===i?void 0:i.v}),this._isEzvizPlayback(this._opt.url)&&!this._opt.isLive){var n,r,o,a;this._playbackRate=+((null===(n=this.urlInfo)||void 0===n||null===(n=n.query)||void 0===n?void 0:n.playbackSpeed)||1),null===(r=this.services)||void 0===r||r.getLocalVideoUnifyQueryService({startTime:yn(null===(o=this.urlInfo)||void 0===o||null===(o=o.query)||void 0===o?void 0:o.begin).getTime(),endTime:yn(null===(a=this.urlInfo)||void 0===a||null===(a=a.query)||void 0===a?void 0:a.end).getTime()});let e=null,t=0;this.on(Nt.timeUpdate,(i=>{const n=this.playbackRecords.length;if(n>0){var r,o;const A=yn(this.urlInfo.query.begin).getTime()/1e3;let d=null===(r=this.playbackRecords[t])||void 0===r?void 0:r.startTime,c=null===(o=this.playbackRecords[t])||void 0===o?void 0:o.endTime;if(A<=this.playbackRecords[0].startTime)t=0;else{if(A>=this.playbackRecords[this.playbackRecords.length-1].endTime)return;for(let e=0;e<n;e++){const i=this.playbackRecords[e];if(A>=i.startTime&&A<=i.endTime){var a;t=e,d=A,c=null===(a=this.playbackRecords[t])||void 0===a?void 0:a.endTime;break}{const n=this.playbackRecords[e+1];if(A>=i.endTime&&A<=n.startTime){var s,l;t=e+1,d=null===(s=this.playbackRecords[t])||void 0===s?void 0:s.startTime,c=null===(l=this.playbackRecords[t])||void 0===l?void 0:l.endTime;break}}}}let u=parseInt(d+i,10);if(0===i)return;this.emit(Nt.timeUpdateOSD,{currentTime:i,currentFragmentPlayEnd:d+i>=c,currentSliceIndex:t,osd:u}),u+3>=this.playbackRecords[n-1].endTime&&(e&&clearTimeout(e),e=setTimeout((()=>{this.emit(Nt.end),clearTimeout(e),this.pause()}),3e3)),d+i>=c&&t<n-1&&t++;const h=new Date(1e3*u);this._currentPlayDate=`${h.getFullYear()}${_n(h.getMonth()+1)}${_n(h.getDate())}${_n(h.getHours())}${_n(h.getMinutes())}${_n(h.getSeconds())}`}}))}else if(!this._isEzvizPlayback(this._opt.url)&&this._opt.isLive){var s,l,A,d;const e=null!==(s=this.urlInfo)&&void 0!==s&&null!==(s=s.query)&&void 0!==s&&s.expire?parseInt((1e3*this.urlInfo.query.expire-(new Date).getTime())/1e3):void 0;Promise.all([null===(l=this.services)||void 0===l?void 0:l.getVideoQualityService(),null===(A=this.services)||void 0===A?void 0:A.getLiveAddressService({quality:"1"==(null===(d=this.urlInfo)||void 0===d?void 0:d.streamTypeIn)?2:1,expireTime:e})]).then((e=>{let t=[this.urlInfo.url,e[1]].sort(((e,t)=>{const i=e=>{const t=e.match(/_(\d+)\.flv/);return t?parseInt(t[1],10):0};return i(e)-i(t)}));const i=e[0].map(((e,i)=>({...e,url:1===e.streamTypeIn?t[0]:t[1]})));this.definitionList=i,this.emit(Nt.getDefinitionListResult,i),this.emit(Nt.definitionListChange,i)}))}}catch(e){var c,u;null===(c=this.player)||void 0===c||null===(c=c.debug)||void 0===c||null===(u=c.error)||void 0===u||u.call(c,e)}}setDefinitionList(e){this.player&&(this.definitionList=e,this.emit(Nt.definitionListChange,e))}switchDefinition(e){if(this.player){if(e.videoLevel>=0&&[1,2].includes(e.streamTypeIn)){const r=this.definitionList.find((t=>t.videoLevel===e.videoLevel));if(r){if(this.emit(Nt.definitionChange,r),this.definition=r,r.url){var t;if("compatible"!==r.type)null===(t=this.services)||void 0===t||t.setVideoLevelService(r.videoLevel);return this.playing?this.pause().then((()=>{this.play({url:r.url})})):this.play({url:r.url}),Promise.resolve(0)}var i;return null===(i=this.player.debug)||void 0===i||i.warn("play url is not found"),Promise.resolve(1)}var n;return null===(n=this.player.debug)||void 0===n||n.warn("definition is not found"),Promise.resolve(1)}var r;return null===(r=this.player.debug)||void 0===r||r.warn(`not support ${null==e?void 0:e.videoLevel}`),Promise.resolve(1)}}setPlaybackRateList(e){this.player&&(this.playbackRateList=e,this.emit(Nt.playbackRateListChange,e))}get playbackRate(){return this._playbackRate}set playbackRate(e){this.switchPlaybackRate(e)}switchPlaybackRate(e){var t,i,n;return this.player&&this._isEzvizPlayback(this._opt.url)?(e=+e,null!==(t=this.playbackRateList)&&void 0!==t&&t.includes(e)?this._getNewRecordPlayUrl({playbackRate:e}).then((t=>t?(this._playbackRate=e,this.emit(Nt.playbackRateChange,e),this.playing?this.pause().then((e=>{this.play({url:t})})):this.play({url:t}),0):1)):(null===(i=this.player)||void 0===i||null===(i=i.debug)||void 0===i||i.warn(`not support ${e}`),Promise.resolve(1))):(null===(n=this.player)||void 0===n||null===(n=n.debug)||void 0===n||n.warn(`not support ${e}`),Promise.resolve(1))}_getNewRecordPlayUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.player&&this._isEzvizPlayback(this._opt.url)){var t,i,n,r;const o=yn(this._currentPlayDate||(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.begin)),a=yn(null===(i=this.urlInfo)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.end);return null===(n=this.services)||void 0===n?void 0:n.getRecordAddressService({expireTime:parseInt((new Date(1e3*(null===(r=this.urlInfo.query)||void 0===r?void 0:r.expire)).getTime()-(new Date).getTime())/1e3,10),startTime:`${o.getFullYear()}-${_n(o.getMonth()+1)}-${_n(o.getDate())} ${_n(o.getHours())}:${_n(o.getMinutes())}:${_n(o.getSeconds())}`,stopTime:`${a.getFullYear()}-${_n(a.getMonth()+1)}-${_n(a.getDate())} ${_n(a.getHours())}:${_n(a.getMinutes())}:${_n(a.getSeconds())}`,playbackSpeed:e.playbackRate||this.playbackRate,quality:this.urlInfo.streamTypeIn})}return Promise.resolve("")}_isEzvizPlayback(e){return this._opt.isEzviz&&/rec=(local|cloud)/.test(this._opt.url)}static _setOptions(e){const t=En((e=Object.assign({},{isLive:!0,timeZone:0},bt,e)).id||e.container);return e.container=t,e}destroy(){this.events&&(this.events.destroy(),this.events=null),super.destroy(),this.player&&(this.player.destroy(),this.player=null),this.$container&&(this.$container.classList.remove("ezui-flv-container"),this.$container.classList.remove("ezui-player-container"),this.$container=null),this.definitionList=[],this.definition={},this._videoInfo={},this._currentPlayDate=null,this.urlInfo={},this._playbackRate=1,this.playbackRateList=[],this.playbackRecords=[],this.$container=null,this._opt={},this._loadingTimeoutReplayTimes=0,this.removeAllListeners(),document.removeEventListener("visibilitychange",this._onvisibilitychange),qi.report(50,{name:"destroy"})}_handlevideoInfo(e){this._videoInfo=e||{}}_initPlayer(e,t){var i,r,o,a;t.url&&(t.url=n(t.url,wn)),this.player=new tn(this.contentControl.$container,Object.assign({},t,{orientation:this.orientationAngle})),null===(i=this.player.debug)||void 0===i||i.log("Flv","version",kn.version),null===(r=this.player.debug)||void 0===r||r.log("Flv","_initPlayer",JSON.stringify(t)),this._bindEvents(),t.autoPlay&&this.play(),this._handlevideoInfo=this._handlevideoInfo.bind(this),null===(o=this.player)||void 0===o||o.off(Nt.videoInfo,this._handlevideoInfo),null===(a=this.player)||void 0===a||a.on(Nt.videoInfo,this._handlevideoInfo)}_resetPlayer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.destroy(),this.player=null,this._opt=Object.assign(this._opt,e),this._initPlayer(this.$container,this._opt)}_bindEvents(){Object.keys(Vt).forEach((e=>{[Nt.volumechange,Nt.play].includes(e)||this.player.on(Vt[e],(t=>{this.emit(e,t)}))}))}setDebug(e){this.player.updateOption({debug:e}),qi.report(50,{name:"setDebug"})}setLogger(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.updateOption({loggerOptions:{...this.player._opt.loggerOptions||{},...e}})}closeSound(){this.setVolume(0),qi.report(50,{name:"closeSound"})}openSound(){this.setVolume(.8),qi.report(50,{name:"openSound"})}setVolume(e){this.volume=e}getVolume(){return qi.report(50,{name:"getVolume"}),this.volume}audioResume(){var e,t;null===(e=this.player)||void 0===e||null===(e=e.audio)||void 0===e||null===(t=e.audioEnabled)||void 0===t||t.call(e,!0),qi.report(50,{name:"audioResume"})}setScaleMode(e){return new Promise(((t,i)=>{try{e=Number(e)}catch(e){return void i(e)}[Ht.full,Ht.auto,Ht.fullAuto].includes(e)?(this.player.updateOption({scaleMode:e}),this.player.resize(),t(),qi.report(50,{name:"setScaleMode"})):i("scale mode 0 | 1 | 2")}))}pause(){var e,t;return qi.report(50,{name:"pause"}),this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),this._heartTimeoutDelayTimer&&(clearTimeout(this._heartTimeoutDelayTimer),this._heartTimeoutDelayTimer=null),this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this.playing=!1,null===(e=this.player)||void 0===e||null===(t=e.pause)||void 0===t?void 0:t.call(e)}clearView(){this.player.video.clearView(),qi.report(50,{name:"clearView"})}async play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._loadingTimeoutReplayTimes=0,this.__play(e)}async __play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.loading=!0,e.url&&(qi.url=e.url),"string"==typeof e&&(e={url:e}),this._currentPlayDate&&!e.url&&this._isEzvizPlayback())try{e.url=await this.services.getRecordAddressService({expireTime:86400,quality:this.urlInfo.streamTypeIn,startTime:bn(this._currentPlayDate,"-"),stopTime:bn(this.urlInfo.query.end,"-"),playbackSpeed:this.playbackRate}),this._currentPlayDate=null}catch(e){}const t=n(e.url||this._opt.url,wn);return this.urlInfo=nn(t,this._opt.isEzviz),this._playbackRate=this.urlInfo.query.playbackSpeed||1,this._opt=Object.assign({},this._opt,e||{},{url:t}),this._opt.urlQuery=Wi(e.url),qi.report(50,{name:"play"}),this.playing=!0,await new Promise(((e,t)=>{var i;if(!this._opt.url)return this.emit(Nt.error,jt.playError),void t("play url is empty");null!==(i=this.player)&&void 0!==i&&i.playing?(this.clearView(),this.player.play({...this._opt,muted:this.muted,volume:this.volume}).then((()=>{this.loading=!1,this.posterControl.hide(),e()})).catch((e=>{this.player.debug.warn("Flv","pause -> play and play error",e),this.player.pause().then((()=>{t(e)}))}))):this._play({...this._opt,muted:this.muted,volume:this.volume}).then((()=>{this.loading=!1,this.posterControl.hide(),e()})).catch((e=>{this.player.debug.warn("Flv","this._play error",e),t(e)}))}))}_play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((t,i)=>{const n=0===e.url.indexOf("http"),r=n?vt:mt,o=n||-1!==e.url.indexOf(".flv")||this._opt.isFlv?gt:yt;this.player.updateOption({protocol:r,demuxType:o}),this.player.once(jt.webglAlignmentError,(()=>{this.player.off(jt.webglAlignmentError),this.pause().then((()=>{this.player.debug.log("Flv","webglAlignmentError"),this._resetPlayer({openWebglAlignment:!0}),this.play(e).then((()=>{this.player.debug.log("Flv","webglAlignmentError and play success")})).catch((()=>{this.player.debug.log("Flv","webglAlignmentError and play error")}))}))})),this.player.once(jt.mediaSourceH265NotSupport,(()=>{this.player.off(jt.mediaSourceH265NotSupport),this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play"),this._resetPlayer({useMSE:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play success")})).catch((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play error")})))}))})),this.player.once(jt.mediaSourceFull,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source full"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source full and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source full and reset player and play error")}))}))})),this.player.once(jt.mediaSourceAppendBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer error"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer error and reset player and play error")}))}))})),this.player.once(jt.mediaSourceBufferListLarge,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source buffer list large"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source buffer list large and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source buffer list large and reset player and play error")}))}))})),this.player.once(jt.mediaSourceAppendBufferEndTimeout,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer end timeout"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer end timeout and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer end timeout and reset player and play error")}))}))})),this.player.once(jt.mseSourceBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","mseSourceBufferError close success")}))})),this.player.once(jt.webcodecsH265NotSupport,(()=>{this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","auto wasm [wcs-> wasm] reset player and play error")})))}))})),this.player.once(jt.wasmDecodeError,(()=>{this.player._opt.wasmDecodeErrorReplay&&this.pause().then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","wasm decode error and reset player and play error")}))}))})),this.player.off(Nt.delayTimeout,this._onDelayTimeout),this._onDelayTimeout=this._onDelayTimeout.bind(this),this.player.once(Nt.delayTimeout,this._onDelayTimeout),this.player.off(Nt.heartTimeout,this._onHeartTimeout),this._onHeartTimeout=this._onHeartTimeout.bind(this),this.player.once(Nt.heartTimeout,this._onHeartTimeout),this.player.off(Nt.loadingTimeout,this._onLoadingTimeout),this._onLoadingTimeout=this._onLoadingTimeout.bind(this),this.player.once(Nt.loadingTimeout,this._onLoadingTimeout),this.player.off(Nt.streamSuccess,this._onStreamSuccess),this._onStreamSuccess=this._onStreamSuccess.bind(this),this.player.once(Nt.streamSuccess,this._onStreamSuccess),this.player.off(Nt.streamError,this._onStreamError),this._onStreamError=this._onStreamError.bind(this),this.player.once(Nt.streamError,this._onStreamError),this.hasLoaded()?this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{if(this.player){this.player.debug.warn("Flv","hasLoaded and play error",e),null==e||e.name;try{this.player.pause().then((()=>{i(e)}))}catch(e){}}})):this.player.once(Nt.decoderWorkerInit,(()=>{this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{if(this.player){this.player.debug.warn("Flv","decoderWorkerInit and play error",e);try{this.player.pause().then((()=>{i(e)}))}catch(e){}}}))}))}))}_onDelayTimeout(e){this._delayTimeoutTimer=setTimeout((()=>{this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes?(this._loadingTimeoutReplayTimes+=1,this.player.debug.warn("Flv",`delay timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(Nt.delayTimeout,this._onDelayTimeout),this.emit(Nt.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0}))):this._getDeviceStreamErrorInfo()}),1e3*(this._opt.loadingTimeoutDelay||3))}_onHeartTimeout(){this._heartTimeoutDelayTimes<+this.player._opt.heartTimeoutReplayTimes||-1==+this.player._opt.heartTimeoutReplayTimes?(this._heartTimeoutDelayTimes+=1,this.player.debug.warn("Flv",`heart timeout replay time is ${this._heartTimeoutDelayTimes}`),this.player.off(Nt.heartTimeout,this._onLoadingTimeout),this.emit(Nt.heartRetryTimes,this._heartTimeoutDelayTimes),this.__play(this._opt).then((()=>{this._heartTimeoutDelayTimes=0}))):this._getDeviceStreamErrorInfo()}_onLoadingTimeout(){this._loadingTimeoutDelayTimer=setTimeout((()=>{this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes?(this._loadingTimeoutReplayTimes+=1,this.player.debug.warn("Flv",`loading timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(Nt.delayTimeout,this._onLoadingTimeout),this.emit(Nt.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0}))):this._getDeviceStreamErrorInfo()}),1e3*(this._opt.loadingTimeoutDelay||3))}_getDeviceStreamErrorInfo(){var e,t;this.services&&null!==(e=this.urlInfo)&&void 0!==e&&null!==(e=e.query)&&void 0!==e&&e.sid?this.services.getStreamInterreputInfo(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.sid).then((e=>{if(this.playing=!1,200===e.meta.code){var t,i;let n=this.i18n.t(null===(t=e.data)||void 0===t?void 0:t.intrCode);/^\[missing /.test(n)?null!==(i=e.data)&&void 0!==i&&i.intrCode?this.emit(Nt.message,this.i18n.t("fetchError")+` [${e.data.intrCode}]`,"fetchError"):this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError"):this.emit(Nt.message,n+` [${e.data.intrCode}]`,"fetchError")}else this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError")})).catch((()=>{this.playing=!1,this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError")})):(this.playing=!1,this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError"))}_onStreamSuccess(){this.emit(Nt.streamSuccess)}_onStreamError(){this.emit(Nt.streamError)}setBufferTime(e){var t,i;e=Number(e),this.player.updateOption({videoBuffer:1e3*e}),null===(t=this.player)||void 0===t||null===(t=t.decoderWorker)||void 0===t||null===(i=t.updateWorkConfig)||void 0===i||i.call(t,{key:"videoBuffer",value:1e3*e})}setRotate(e){qi.report(50,{name:"setRotate",value:e});try{e=parseInt(e,10)}catch(e){return Promise.reject("rotate 0 | 90 | 180 | 270")}return new Promise(((t,i)=>{kn.ROTATE.includes(e)?(this.player.updateOption({rotate:e}),this.player.resize(),t()):i("rotate 0 | 90 | 180 | 270")}))}hasLoaded(){return this.player.loaded}setKeepScreenOn(){this.player.updateOption({keepScreenOn:!0}),qi.report(50,{name:"setKeepScreenOn"})}get videoInfo(){return this._videoInfo}get currentTime(){return this.player.video?this.player.video.currentTime:0}screenshot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"png",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.92,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"download";if(this.player.video)return i=+i,this.player.video.screenshot(e,t,i,n)}getState(){return{playing:!!this.player&&this.player.playing,muted:!(this.player&&this.muted),fullscreen:this.currentFullscreen,loaded:!!this.player&&this.player.loaded,volume:this.player?parseFloat(this.player.volume).toFixed(2):0,isDebug:!!this.player&&this.player.isDebug}}getOptions(){return this.player?this.player._opt:{}}getVersion(){return qi.report(50,{name:"getVersion"}),"2.0.1-alpha.0"}static supportType(e){if("flv"===e.type)return!0;if(e.url){let t=e.url;t.startsWith("http://")||t.startsWith("https://")||(t=/^\/\//.test(t)?"http:"+t:location.origin+location.pathname+t);try{return/\.flv$/i.test(new URL(t).pathname)}catch(e){}}return!1}_onvisibilitychange(){!document.hidden&&this.playing&&this.muted&&this.options.isLive&&this.pause().finally((()=>{var e;null===(e=this.play)||void 0===e||e.call(this).catch((e=>{}))}))}}return e(kn,"ERROR",jt),e(kn,"EVENTS",Nt),e(kn,"QUALITY_ENUM",mn),e(kn,"ROTATE",[0,90,180,270]),e(kn,"TIMEOUT",{delayTimeout:Nt.delayTimeout}),e(kn,"version","2.0.1-alpha.0"),kn}));
|
|
49
|
+
*/var $i,Fi,Ni,Vi,ji=($i="undefined"!=typeof self?self:window,Fi={navigator:void 0!==$i.navigator?$i.navigator:{userAgent:""},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},Ni={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,Edge:e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t,i=(null==(t=Fi.navigator)?void 0:t.userAgent)||"",n=Ni.getMatchMap(i);for(var r in Fi.infoMap)for(var o=0;o<Fi.infoMap[r].length;o++){var a=Fi.infoMap[r][o];n[a]&&(e[r]=a)}},getOS:function(){var e=this;return Ni.matchInfoMap(e),null==e?void 0:e.os},getOSVersion:function(){var e=this,t=Fi.navigator.userAgent||"";e.osVersion="";var i={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return"function"==typeof i[e.os]&&(e.osVersion=i[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"vertical":"horizontal"},getDeviceType:function(){var e=this;return e.device="PC",Ni.matchInfoMap(e),e.device},getNetwork:function(){var e,t,i,n;return null==(e=(null==(t=navigator)?void 0:t.connection)||(null==(i=navigator)?void 0:i.mozConnection)||(null==(n=navigator)?void 0:n.webkitConnection))?void 0:e.effectiveType},getLanguage:function(){var e,t,i;return this.language=((i=((null==(e=Fi.navigator)?void 0:e.browserLanguage)||(null==(t=Fi.navigator)?void 0:t.language)).split("-"))[1]&&(i[1]=i[1].toUpperCase()),i.join("_")),this.language},createFingerprint:function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),n=e||window.location.host;i.textBaseline="top",i.font="14px 'Arial'",i.fillStyle="#f60",i.fillRect(125,1,62,20),i.fillStyle="#069",i.fillText(n,2,15),i.fillStyle="rgba(102, 204, 0, 0.7)",i.fillText(n,4,17);var r=t.toDataURL().replace("data:image/png;base64,","");return function(e){var t,i,n,r="";for(t=0,i=(e+="").length;t<i;t++)r+=(n=e.charCodeAt(t).toString(16)).length<2?"0"+n:n;return r}(atob(r).slice(-16,-12))},getBrowserInfo:function(){var e=this;Ni.matchInfoMap(e);var t=Fi.navigator.userAgent||"",i=function(e,t){var i=Fi.navigator.mimeTypes;for(var n in i)if(i[n][e]==t)return!0;return!1},n=Ni.getMatchMap(t),r=!1;if($i.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");+o>36&&$i.showModalDialog?r=!0:+o>45&&(r=i("type","application/vnd.chromium.remoting-viewer"))}if(n.Baidu&&n.Opera&&(n.Baidu=!1),n.Mobile&&(n.Mobile=!t.includes("iPad")),r&&(i("type","application/gameplugin")||Fi.navigator&&void 0===Fi.navigator.connection.saveData?n["360SE"]=!0:n["360EE"]=!0),n.IE||n.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:case 75:case 105:break;case 102:n["360EE"]=!0;break;case 104:n["360SE"]=!0}var a={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[+t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){return{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[+navigator.userAgent.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",a[e.browser]&&(e.browserVersion=a[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Edge"==e.browser&&(e.engine="EdgeHTML"),"Chrome"==e.browser&&parseInt(e.browserVersion)>27&&(e.engine="Blink"),"Opera"==e.browser&&parseInt(e.browserVersion)>12&&(e.engine="Blink"),"Yandex"==e.browser&&(e.engine="Blink"),e.browser+" (version: "+e.browserVersion+"; kernel: "+e.engine+")"}},Vi={DeviceInfoObj:function(e){var t,i=function(t){var i;null==(i=e.info)||i.forEach((function(e){e.toLowerCase()===t.toLowerCase()&&(r[t]=n[t])}))};e=e||{domain:""};var n={deviceType:Ni.getDeviceType(),OS:Ni.getOS(),OSVersion:Ni.getOSVersion(),sh:$i.screen.height,sw:$i.screen.width,lang:Ni.getLanguage(),netWork:Ni.getNetwork(),orientation:Ni.getOrientationStatu(),browserInfo:Ni.getBrowserInfo(),fingerprint:Ni.createFingerprint(e.domain),userAgent:null==(t=Fi.navigator)?void 0:t.userAgent};if(!e.info||0===e.info.length)return n;var r={};for(var o in n)i(o);return r}},{getDeviceInfo:function(e){return Vi.DeviceInfoObj(e)}}),Qi=function(){function e(){}return e.add=function(t,i){e.queues.push({url:t,data:i})},e.fire=function(){if(e.queues&&0!==e.queues.length){e.isStop=!1;var t=e.queues[0];t.url&&e.api.report(t.data),e.queues.splice(0,1),e.fire()}else e.isStop=!0},e}();Qi.isStop=!0,Qi.queues=[];var Gi=function(){function e(e){this.url=e}var t=e.prototype;return t.report=function(e){this.checkUrl(this.url)&&this.sendInfo(e)},t.sendInfo=function(e){navigator.sendBeacon?this.sendBeacon(this.url,e):this.sendImage(this.url,e)},t.sendImage=function(e,t){var i=this.changeJSON2Query(t),n=new Image;n.onload=n.onerror=function(){n=null},n.src=e+"?"+i+"&random="+Math.random()},t.sendBeacon=function(e,t){try{navigator.sendBeacon(e,this.formatParamsByURLSearchParams(t))}catch(e){}},t.formatParamsByURLSearchParams=function(e){var t=new URLSearchParams;for(var i in e)"object"==typeof e[i]&&(e[i]=JSON.stringify(e[i])),t.append(i,e[i]);return t},t.changeJSON2Query=function(e){var t="";for(var i in e){""!=t&&(t+="&");var n=e[i];t+=i+"="+encodeURIComponent("object"==typeof n?JSON.stringify(n):n)}return t},t.checkUrl=function(e){return!!e&&/^[hH][tT][tT][pP]([sS]?):\/\//.test(e)},e}();function zi(){return zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},zi.apply(this,arguments)}var Hi=function(){function e(e){this.options=e,this.extendsInfo=e.extendsInfo||{},this.clientInfo=this._getDeviceInfo(),Qi.api=new Gi(e.url)}var t=e.prototype;return t.send=function(e){return this.options.forbidden||"object"!=typeof e||(this._handleRecordError(e),Qi.isStop&&Qi.fire()),this},t.setForbidden=function(e){this.options.forbidden=e},t.updateExtendsInfo=function(e){void 0===e&&(e={}),this.extendsInfo=zi({},this.extendsInfo||{},e)},t._handleRecordError=function(e){try{var t=this._handleErrorInfo(e);Qi.add(this.options.url,t)}catch(e){}},t._handleErrorInfo=function(e){var t=this._getExtendsInfo(),i=zi({st:(new Date).getTime()},t,e);return i.clientInfo=this.clientInfo,i},t._getExtendsInfo=function(){try{var e,t={},i=this.extendsInfo||{};for(var n in"function"==typeof i.getDynamic&&(e=i.getDynamic()),"[object Object]"===Object.prototype.toString.call(e)&&(i=zi({},i,e)),i)"function"!=typeof i[n]&&(t[n]=i[n]);return t}catch(e){return{}}},t._getDeviceInfo=function(){try{var e=ji.getDeviceInfo();return JSON.stringify(e)}catch(e){return""}},e}();function Wi(e){if(/http[s]?:\/\/|ws[s]?:\/\//.test(e)){const t=e.split("?")[1],i=t?t.split("&"):[],n={};for(let e=0;e<i.length;++e){const[t,r]=i[e].split("=");n[t]=n[t]||decodeURIComponent(r)}try{const t=e.split(".flv")[0].split("/"),i=t[t.length-1].split("_");t.length>0&&i[0]&&i[1]&&i[2]&&(n.serial=i[0],n.no=i[1],n.bitstream=i[2])}catch(e){}return n}return{}}class qi{static initMonitor(e){qi.collect=new Hi({forbidden:e,url:"https://log.ys7.com/statistics.do/opensdk_ezuikit",jsError:!1,promiseError:!1,resourceError:!1,extendsInfo:{protocol:"flv",v:"2.0.2"}})}static report(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qi.collect||qi.initMonitor();try{const i=Wi(qi.url);qi.collect.send({url:qi.url,serial:i.serial,no:i.no,action:e,logInfo:t})}catch(e){}}}class Ki extends Ui{constructor(e,t){super(e,t,fi),this._opt.useMSE=!1,this._loadingTimeoutDelayTimer=null,this._opt.hasAudio&&(this.audio=new mi(this)),this.decoderWorker=new yi(this),this.stream=null,this.demux=null,this._muted=this._opt.muted,oi()&&(this.keepScreenOn=new ki(this)),this._enableSoundOnUserInteraction=this._enableSoundOnUserInteraction.bind(this),window.addEventListener("click",this._enableSoundOnUserInteraction),window.addEventListener("pointerdown",this._enableSoundOnUserInteraction),window.addEventListener("touchstart",this._enableSoundOnUserInteraction),window.addEventListener("keydown",this._enableSoundOnUserInteraction),document.body.addEventListener("click",this._enableSoundOnUserInteraction),document.body.addEventListener("pointerdown",this._enableSoundOnUserInteraction),document.body.addEventListener("touchstart",this._enableSoundOnUserInteraction),document.body.addEventListener("keydown",this._enableSoundOnUserInteraction),this.on(Nt.audioInfo,(e=>{var t;e.encType&&!this.muted&&(null===(t=this.audio)||void 0===t?void 0:t.isStateRunning())&&setTimeout((()=>{var e,t;null===(t=(e=this.audio).audioEnabled)||void 0===t||t.call(e,!0)}),100)}))}destroy(){var e,t,i,n,r,o;this._loading=!1,this._playing=!1,this._hasLoaded=!1,this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.audio&&(null===(t=(e=this.audio).destroy)||void 0===t||t.call(e),this.audio=null),this.stream&&(null===(n=(i=this.stream).destroy)||void 0===n||n.call(i),this.stream=null),this.demux&&(null===(o=null===(r=this.demux)||void 0===r?void 0:r.destroy)||void 0===o||o.call(r),this.demux=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.releaseWakeLock(),this.keepScreenOn=null,this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,window.removeEventListener("click",this._enableSoundOnUserInteraction),window.removeEventListener("pointerdown",this._enableSoundOnUserInteraction),window.removeEventListener("touchstart",this._enableSoundOnUserInteraction),window.removeEventListener("keydown",this._enableSoundOnUserInteraction),document.body.removeEventListener("click",this._enableSoundOnUserInteraction),document.body.removeEventListener("pointerdown",this._enableSoundOnUserInteraction),document.body.removeEventListener("touchstart",this._enableSoundOnUserInteraction),document.body.removeEventListener("keydown",this._enableSoundOnUserInteraction),super.destroy()}set loaded(e){this._hasLoaded=e}get loaded(){return this._hasLoaded}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(Nt.playing,e),this.emit(Nt.volumechange,this.volume,this.muted),e?this.emit(Nt.play):this.emit(Nt.pause))}get playing(){return this._playing}get muted(){return this._muted}set muted(e){this.audio&&(this.audio.muted=e),super._updateMuted(e)}get volume(){return this._volume}set volume(e){this.audio&&(this.audio.volume=e),super._updateVolume(e)}set loading(e){this.loading!==e&&(this._loading=e,this.emit(Nt.loading,this._loading),e||this.emit(Nt.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e,this._opt.useWCS||this._opt.useMSE||this.audioTimestamp&&this.videoTimestamp&&this.audio&&this.audio.emit(Nt.videoSyncAudio,{audioTimestamp:this.audioTimestamp,videoTimestamp:this.videoTimestamp,diff:this.audioTimestamp-this.videoTimestamp}))}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!0===this._opt.debug}_init(){return new Promise(((e,t)=>{this.stream||(this.stream=new gi(this)),this.audio||this._opt.hasAudio&&(this.audio=new mi(this)),this.demux||(this.demux=new Ci(this)),this.decoderWorker?e():(this.decoderWorker=new yi(this),this.once(Nt.decoderWorkerInit,(()=>{e()})))}))}play(e){return this._opt=Object.assign({},this._opt,e||{}),this.clearCheckHeartTimeout(),new Promise(((e,t)=>{if(!this._opt.url)return t();this.loading=!0,this.playing=!1,this._times.playInitStart=ii(),this._init().then((()=>{this._times.playStart=ii(),this._opt.muted||(this.muted=!1),this.enableWakeLock();try{this.stream.fetchStream(this._opt.url,this._opt)}catch(e){}this.checkLoadingTimeout(),this.stream.once(Nt.streamError,(e=>{this.stream&&(this.stream.destroy(),this.stream=null),this.clearCheckLoadingTimeout(),this.emit(Nt.streamError,e),this.emit(Nt.delayTimeout,e),t(e)})),this.stream.once(Nt.streamEnd,(()=>{t()})),this.stream.once(Nt.streamSuccess,(()=>{this.clearCheckLoadingTimeout(),this.emit(Nt.streamSuccess),e(),this._times.streamResponse=ii(),this.video.play(),this.checkStatsInterval()}))})).catch((e=>{t(e)})),this._resumeAudioAfterPause()}))}close(){return new Promise((e=>{this._close().then((()=>{var t,i;null===(i=null===(t=this.video)||void 0===t?void 0:t.clearView)||void 0===i||i.call(t),e()}))}))}_resumeAudioAfterPause(){this._volume&&(this.volume=this._volume)}_close(){return new Promise((e=>{var t,i;this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this.stream&&(this.stream.destroy(),this.stream=null),this.demux&&(this.demux.destroy(),this.demux=null),this.decoderWorker&&(this.decoderWorker.destroy(),this.decoderWorker=null),this.audio&&(null===(i=(t=this.audio).pause)||void 0===i||i.call(t)),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.playing=!1,this.loading=!1,this.video&&(this.video.resetInit(),this.video.pause(!0)),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:""},setTimeout((()=>{e()}),0)}))}pause(e=!1){return e?this.close():this._close()}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}checkHeartTimeout(){var e;0!==this._opt.heartTimeout&&(this._checkHeartTimeout=setTimeout((()=>{if(this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this.playing){if(0!==this._stats.fps)return;this.pause().then((()=>{this.emit(Nt.timeout,Nt.heartTimeout),this.emit(Nt.heartTimeout)}))}}),1e3*((null===(e=this._opt)||void 0===e?void 0:e.heartTimeout)||5)))}checkStatsInterval(){this._checkStatsInterval=setInterval((()=>{this.updateStats()}),1e3)}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkLoadingTimeout(){0!==this._opt.loadingTimeout&&(this._checkLoadingTimeout=setTimeout((()=>{this.playing||(this.clearCheckLoadingTimeout(),this.pause().then((()=>{this.emit(Nt.timeout,Nt.loadingTimeout),this.emit(Nt.loadingTimeout)})).catch((()=>{})))}),1e3*this._opt.loadingTimeout))}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}clearStatsInterval(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}handleRender(){this.loading&&(this.emit(Nt.start),this.loading=!1),this.clearCheckLoadingTimeout(),this.playing||(this.playing=!0),this.checkHeart()}updateStats(e){e=e||{},this._startBpsTime||(this._startBpsTime=ii()),ai(e.ts)&&(this._stats.ts=e.ts),ai(e.buf)&&(this._stats.buf=e.buf),e.fps&&(this._stats.fps+=1),e.abps&&(this._stats.abps+=e.abps),e.vbps&&(this._stats.vbps+=e.vbps);const t=ii();t-this._startBpsTime<1e3||(this.emit(Nt.stats,this._stats),this._stats.fps=0,this._stats.abps=0,this._stats.vbps=0,this._startBpsTime=t)}resetStats(){this._startBpsTime=null,this._stats={buf:0,fps:0,abps:0,vbps:0,ts:0}}enableWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.enable()}releaseWakeLock(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.disable()}handlePlayToRenderTimes(){const e=this._times;e.playTimestamp=e.playStart-e.playInitStart,e.streamTimestamp=e.streamStart-e.playStart,e.streamResponseTimestamp=e.streamResponse-e.streamStart,e.demuxTimestamp=e.demuxStart-e.streamResponse,e.decodeTimestamp=e.decodeStart-e.demuxStart,e.videoTimestamp=e.videoStart-e.decodeStart,e.allTimestamp=e.videoStart-e.playInitStart,this.emit(Nt.playToRenderTimes,e)}getOption(){return this._opt}emitError(e,t=""){qi.report(51,{event:e,value:t}),this.emit(Nt.error,e,t),this.emit(e,t)}_enableSoundOnUserInteraction(){var e,t,i;this.muted||(null===(e=this.audio)||void 0===e?void 0:e.isStateSuspended())&&(null===(i=(t=this.audio).audioEnabled)||void 0===i||i.call(t,!0))}}var Yi,Xi={exports:{}};var Zi=(Yi||(Yi=1,function(e,t){!function(t,i){e.exports=i()}(self,(()=>(()=>{var e={62:(e,t,i)=>{var n=i(1465)("span").classList,r=n&&n.constructor&&n.constructor.prototype;e.exports=r===Object.prototype?void 0:r},63:(e,t,i)=>{var n=i(4152);e.exports=function(e){return n(e)||null===e}},115:(e,t,i)=>{var n=i(815),r=i(4152),o=i(5727),a=i(452),s=i(6908),l=i(7553),A=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=a(e,d);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw new A("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},219:(e,t,i)=>{var n=i(2719),r=i(7024),o=i(256),a=function(e){return function(t,i,a){var s=n(t),l=o(s);if(0===l)return!e&&-1;var A,d=r(a,l);if(e&&i!=i){for(;l>d;)if((A=s[d++])!=A)return!0}else for(;l>d;d++)if((e||d in s)&&s[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},256:(e,t,i)=>{var n=i(2420);e.exports=function(e){return n(e.length)}},279:(e,t,i)=>{var n=i(815),r=i(5736),o=i(7749),a=i(4985),s=i(9273),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(r(i))return o(n(i,e));throw new l(a(e)+" is not iterable")}},309:(e,t,i)=>{var n=i(9922),r=i(497);e.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}},452:(e,t,i)=>{var n=i(5736),r=i(5599);e.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}},458:(e,t,i)=>{var n=i(526),r=i(6458);e.exports=function(e){if("Function"===n(e))return r(e)}},497:(e,t,i)=>{var n=i(9922),r=i(9211),o=i(526),a=i(7553)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?i:l?o(t):"Object"===(n=o(t))&&r(t.callee)?"Arguments":n}},526:(e,t,i)=>{var n=i(6458),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},550:(e,t,i)=>{i.d(t,{A:()=>n});const n={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},577:(e,t,i)=>{var n=i(3463),r=i(1002),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},594:e=>{var t=TypeError;e.exports=function(e,i){if(e<i)throw new t("Not enough arguments");return e}},605:(e,t,i)=>{var n=i(7553);t.f=n},648:(e,t,i)=>{i(2578),i(4579);var n=i(9364),r=i(1562),o=i(2363),a=i(5057),s=i(815),l=i(6458),A=i(9646),d=i(6666),c=i(3930),u=i(1176),h=i(8873),p=i(1541),f=i(7712),_=i(3587),m=i(2757),v=i(9211),g=i(4347),y=i(7042),b=i(497),E=i(7749),S=i(4152),C=i(6677),w=i(6122),T=i(6330),k=i(279),L=i(9273),I=i(1567),O=i(594),B=i(7553),R=i(986),x=B("iterator"),D="URLSearchParams",M=D+"Iterator",P=_.set,U=_.getterFor(D),$=_.getterFor(M),F=o("fetch"),N=o("Request"),V=o("Headers"),j=N&&N.prototype,Q=V&&V.prototype,G=r.TypeError,z=r.encodeURIComponent,H=String.fromCharCode,W=a("String","fromCodePoint"),q=parseInt,K=l("".charAt),Y=l([].join),X=l([].push),Z=l("".replace),J=l([].shift),ee=l([].splice),te=l("".split),ie=l("".slice),ne=l(/./.exec),re=/\+/g,oe=/^[0-9a-f]+$/i,ae=function(e,t){var i=ie(e,t,t+2);return ne(oe,i)?q(i,16):NaN},se=function(e){for(var t=0,i=128;i>0&&e&i;i>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},Ae=function(e){for(var t=(e=Z(e,re," ")).length,i="",n=0;n<t;){var r=K(e,n);if("%"===r){if("%"===K(e,n+1)||n+3>t){i+="%",n++;continue}var o=ae(e,n+1);if(o!=o){i+=r,n++;continue}n+=2;var a=se(o);if(0===a)r=H(o);else{if(1===a||a>4){i+="�",n++;continue}for(var s=[o],l=1;l<a&&!(3+ ++n>t||"%"!==K(e,n));){var A=ae(e,n+1);if(A!=A){n+=3;break}if(A>191||A<128)break;X(s,A),n+=2,l++}if(s.length!==a){i+="�";continue}var d=le(s);null===d?i+="�":r=W(d)}}i+=r,n++}return i},de=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ue=function(e){return ce[e]},he=function(e){return Z(z(e),de,ue)},pe=f((function(e,t){P(this,{type:M,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=$(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,I(void 0,!0);var n=t[i];switch(e.kind){case"keys":return I(n.key,!1);case"values":return I(n.value,!1)}return I([n.key,n.value],!1)}),!0),fe=function(e){this.entries=[],this.url=null,void 0!==e&&(S(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===K(e,0)?ie(e,1):e:C(e)))};fe.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,n,r,o,a,l,A=this.entries,d=L(e);if(d)for(i=(t=k(e,d)).next;!(n=s(i,t)).done;){if(o=(r=k(E(n.value))).next,(a=s(o,r)).done||(l=s(o,r)).done||!s(o,r).done)throw new G("Expected sequence with length 2");X(A,{key:C(a.value),value:C(l.value)})}else for(var c in e)g(e,c)&&X(A,{key:c,value:C(e[c])})},parseQuery:function(e){if(e)for(var t,i,n=this.entries,r=te(e,"&"),o=0;o<r.length;)(t=r[o++]).length&&(i=te(t,"="),X(n,{key:Ae(J(i)),value:Ae(Y(i,"="))}))},serialize:function(){for(var e,t=this.entries,i=[],n=0;n<t.length;)e=t[n++],X(i,he(e.key)+"="+he(e.value));return Y(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var _e=function(){m(this,me);var e=P(this,new fe(arguments.length>0?arguments[0]:void 0));A||(this.size=e.entries.length)},me=_e.prototype;if(h(me,{append:function(e,t){var i=U(this);O(arguments.length,2),X(i.entries,{key:C(e),value:C(t)}),A||this.length++,i.updateURL()},delete:function(e){for(var t=U(this),i=O(arguments.length,1),n=t.entries,r=C(e),o=i<2?void 0:arguments[1],a=void 0===o?o:C(o),s=0;s<n.length;){var l=n[s];if(l.key!==r||void 0!==a&&l.value!==a)s++;else if(ee(n,s,1),void 0!==a)break}A||(this.size=n.length),t.updateURL()},get:function(e){var t=U(this).entries;O(arguments.length,1);for(var i=C(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){var t=U(this).entries;O(arguments.length,1);for(var i=C(e),n=[],r=0;r<t.length;r++)t[r].key===i&&X(n,t[r].value);return n},has:function(e){for(var t=U(this).entries,i=O(arguments.length,1),n=C(e),r=i<2?void 0:arguments[1],o=void 0===r?r:C(r),a=0;a<t.length;){var s=t[a++];if(s.key===n&&(void 0===o||s.value===o))return!0}return!1},set:function(e,t){var i=U(this);O(arguments.length,1);for(var n,r=i.entries,o=!1,a=C(e),s=C(t),l=0;l<r.length;l++)(n=r[l]).key===a&&(o?ee(r,l--,1):(o=!0,n.value=s));o||X(r,{key:a,value:s}),A||(this.size=r.length),i.updateURL()},sort:function(){var e=U(this);R(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,i=U(this).entries,n=y(e,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((t=i[r++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),c(me,x,me.entries,{name:"entries"}),c(me,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),A&&u(me,"size",{get:function(){return U(this).entries.length},configurable:!0,enumerable:!0}),p(_e,D),n({global:!0,constructor:!0,forced:!d},{URLSearchParams:_e}),!d&&v(V)){var ve=l(Q.has),ge=l(Q.set),ye=function(e){if(S(e)){var t,i=e.body;if(b(i)===D)return t=e.headers?new V(e.headers):new V,ve(t,"content-type")||ge(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),w(e,{body:T(0,C(i)),headers:T(0,t)})}return e};if(v(F)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return F(e,arguments.length>1?ye(arguments[1]):{})}}),v(N)){var be=function(e){return m(this,j),new N(e,arguments.length>1?ye(arguments[1]):{})};j.constructor=be,be.prototype=j,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:be})}}e.exports={URLSearchParams:_e,getState:U}},719:(e,t,i)=>{i.d(t,{A:()=>n});const n=function(){function e(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return e.prototype.isComplete=function(){return!this.hasAudio||this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&this.audioChannelCount,!this.hasVideo||this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&this.sarDen,null!=this.mimeType},e.prototype.isSeekable=function(){return this.hasKeyframesIndex},e.prototype.getNearestKeyframe=function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}},e.prototype._search=function(e,t){var i=0,n=e.length-1,r=0,o=0,a=n;for(t<e[0]&&(i=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===n||t>=e[r]&&t<e[r+1]){i=r;break}e[r]<t?o=r+1:a=r-1}return i},e}()},730:(e,t,i)=>{var n=i(9364),r=i(815);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}})},775:(e,t,i)=>{var n=i(9845),r=i(1562),o=i(4191),a="__core-js_shared__",s=e.exports=r[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.40.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE",source:"https://github.com/zloirock/core-js"})},778:(e,t,i)=>{i(4220)},804:(e,t,i)=>{var n=i(9364),r=i(5057),o=i(4347),a=i(6677),s=i(3463),l=i(9266),A=s("string-to-symbol-registry"),d=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(o(A,t))return A[t];var i=r("Symbol")(t);return A[t]=i,d[i]=t,i}})},815:(e,t,i)=>{var n=i(6898),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},834:(e,t,i)=>{i(6383)},947:(e,t,i)=>{var n=i(9364),r=i(7917),o=i(2809),a=i(7819),s=i(9083);n({target:"Object",stat:!0,forced:!r||o((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},986:(e,t,i)=>{var n=i(8626),r=Math.floor,o=function(e,t){var i=e.length;if(i<8)for(var a,s,l=1;l<i;){for(s=l,a=e[l];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==l++&&(e[s]=a)}else for(var A=r(i/2),d=o(n(e,0,A),t),c=o(n(e,A),t),u=d.length,h=c.length,p=0,f=0;p<u||f<h;)e[p+f]=p<u&&f<h?t(d[p],c[f])<=0?d[p++]:c[f++]:p<u?d[p++]:c[f++];return e};e.exports=o},1002:(e,t,i)=>{var n=i(6458),r=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++r+o,36)}},1031:(e,t,i)=>{var n=i(7553),r=i(6122),o=i(3643).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:r(null)}),e.exports=function(e){s[a][e]=!0}},1068:(e,t,i)=>{var n=i(63),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o("Can't set "+r(e)+" as a prototype")}},1144:(e,t,i)=>{var n=i(815),r=i(4347),o=i(9615),a=i(7677),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||r(e,"flags")||!o(s,e)?t:n(a,e)}},1147:(e,t,i)=>{var n,r,o,a=i(2809),s=i(9211),l=i(4152),A=i(6122),d=i(8125),c=i(3930),u=i(7553),h=i(9845),p=u("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(r=d(d(o)))!==Object.prototype&&(n=r):f=!0),!l(n)||a((function(){var e={};return n[p].call(e)!==e}))?n={}:h&&(n=A(n)),s(n[p])||c(n,p,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},1176:(e,t,i)=>{var n=i(4233),r=i(3643);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}},1209:(e,t,i)=>{var n=i(5057),r=i(6458),o=i(2630),a=i(7819),s=i(7749),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=a.f;return i?l(t,i(e)):t}},1432:(e,t,i)=>{var n=i(6458),r=i(5736);e.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}},1454:(e,t,i)=>{i(648)},1464:(e,t,i)=>{var n=i(9364),r=i(4979).map;n({target:"Array",proto:!0,forced:!i(8611)("map")},{map:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},1465:(e,t,i)=>{var n=i(1562),r=i(4152),o=n.document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},1541:(e,t,i)=>{var n=i(3643).f,r=i(4347),o=i(7553)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!r(e,o)&&n(e,o,{configurable:!0,value:t})}},1562:function(e){var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},1567:e=>{e.exports=function(e,t){return{value:e,done:t}}},1684:(e,t,i)=>{var n=i(5736),r=i(9083),o=i(5273),a=i(256),s=TypeError,l="Reduce of empty array with no initial value",A=function(e){return function(t,i,A,d){var c=r(t),u=o(c),h=a(c);if(n(i),0===h&&A<2)throw new s(l);var p=e?h-1:0,f=e?-1:1;if(A<2)for(;;){if(p in u){d=u[p],p+=f;break}if(p+=f,e?p<0:h<=p)throw new s(l)}for(;e?p>=0:h>p;p+=f)p in u&&(d=i(d,u[p],p,c));return d}};e.exports={left:A(!1),right:A(!0)}},1766:(e,t,i)=>{var n=i(9364),r=i(4347),o=i(5727),a=i(4985),s=i(3463),l=i(9266),A=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!o(e))throw new TypeError(a(e)+" is not a symbol");if(r(A,e))return A[e]}})},1900:(e,t,i)=>{e.exports=i(2632).default},1951:(e,t,i)=>{i.d(t,{$_:()=>n,EX:()=>o,EZ:()=>r,Sc:()=>a});var n=function(e,t,i,n,r){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=r,this.fileposition=null},r=function(){function e(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return e.prototype.appendSyncPoint=function(e){e.isSyncPoint=!0,this.syncPoints.push(e)},e}(),o=function(){function e(){this._list=[]}return e.prototype.clear=function(){this._list=[]},e.prototype.appendArray=function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))},e.prototype.getLastSyncPointBeforeDts=function(e){if(0===this._list.length)return null;var t=this._list,i=0,n=t.length-1,r=0,o=0,a=n;for(e<t[0].dts&&(i=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===n||e>=t[r].dts&&e<t[r+1].dts){i=r;break}t[r].dts<e?o=r+1:a=r-1}return this._list[i]},e}(),a=function(){function e(e){this._type=e,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(){return 0===this._list.length},e.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},e.prototype._searchNearestSegmentBefore=function(e){var t,i=this._list;if(0===i.length)return-2;var n=i.length-1,r=0,o=0,a=n,s=0;if(e<i[0].originalBeginDts)return-1;for(;o<=a;){if((r=o+Math.floor((a-o)/2))===n||e>((null===(t=i[r].lastSample)||void 0===t?void 0:t.originalDts)||0)&&e<i[r+1].originalBeginDts){s=r;break}i[r].originalBeginDts<e?o=r+1:a=r-1}return s},e.prototype._searchNearestSegmentAfter=function(e){return this._searchNearestSegmentBefore(e)+1},e.prototype.append=function(e){var t,i,n=this._list,r=e,o=this._lastAppendLocation,a=0;-1!==o&&o<n.length&&r.originalBeginDts>=((null===(i=null===(t=n[o])||void 0===t?void 0:t.lastSample)||void 0===i?void 0:i.originalDts)||0)&&(o===n.length-1||o<n.length-1&&r.originalBeginDts<n[o+1].originalBeginDts)?a=o+1:n.length>0&&(a=this._searchNearestSegmentBefore(r.originalBeginDts)+1),this._lastAppendLocation=a,this._list.splice(a,0,r)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},2139:(e,t,i)=>{i.d(t,{A:()=>n});const n=i(5307)},2250:(e,t,i)=>{var n=i(6458),r=i(3930),o=Date.prototype,a="Invalid Date",s="toString",l=n(o[s]),A=n(o.getTime);String(new Date(NaN))!==a&&r(o,s,(function(){var e=A(this);return e==e?l(this):a}))},2327:e=>{e.exports={}},2363:(e,t,i)=>{var n=i(1562),r=i(9646),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!r)return n[e];var t=o(n,e);return t&&t.value}},2377:(e,t,i)=>{var n=i(4979).forEach,r=i(5888)("forEach");e.exports=r?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},2382:(e,t,i)=>{var n=i(9364),r=i(815),o=i(9845),a=i(6656),s=i(9211),l=i(7712),A=i(8125),d=i(6641),c=i(1541),u=i(9277),h=i(3930),p=i(7553),f=i(2327),_=i(1147),m=a.PROPER,v=a.CONFIGURABLE,g=_.IteratorPrototype,y=_.BUGGY_SAFARI_ITERATORS,b=p("iterator"),E="keys",S="values",C="entries",w=function(){return this};e.exports=function(e,t,i,a,p,_,T){l(i,t,a);var k,L,I,O=function(e){if(e===p&&M)return M;if(!y&&e&&e in x)return x[e];switch(e){case E:case S:case C:return function(){return new i(this,e)}}return function(){return new i(this)}},B=t+" Iterator",R=!1,x=e.prototype,D=x[b]||x["@@iterator"]||p&&x[p],M=!y&&D||O(p),P="Array"===t&&x.entries||D;if(P&&(k=A(P.call(new e)))!==Object.prototype&&k.next&&(o||A(k)===g||(d?d(k,g):s(k[b])||h(k,b,w)),c(k,B,!0,!0),o&&(f[B]=w)),m&&p===S&&D&&D.name!==S&&(!o&&v?u(x,"name",S):(R=!0,M=function(){return r(D,this)})),p)if(L={values:O(S),keys:_?M:O(E),entries:O(C)},T)for(I in L)(y||R||!(I in x))&&h(x,I,L[I]);else n({target:t,proto:!0,forced:y||R},L);return o&&!T||x[b]===M||h(x,b,M,{name:p}),f[t]=M,L}},2420:(e,t,i)=>{var n=i(4685),r=Math.min;e.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}},2460:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(2139);const r=function(){function e(){}return e.e=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","error",r)),e.ENABLE_ERROR&&(console.error?console.error(r):console.warn?console.warn(r):console.log(r))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},e.d=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","debug",r)),e.ENABLE_DEBUG&&(console.debug?console.debug(r):console.log(r))},e.v=function(t,i){var n;t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(i);e.ENABLE_CALLBACK&&(null===(n=e.emitter)||void 0===n||n.emit("log","verbose",r)),e.ENABLE_VERBOSE&&console.log(r)},e.FORCE_GLOBAL_TAG=!1,e.GLOBAL_TAG="ezuikit-flv",e.ENABLE_CALLBACK=!1,e.emitter=new n.A,e.ENABLE_ERROR=!0,e.ENABLE_INFO=!0,e.ENABLE_WARN=!0,e.ENABLE_DEBUG=!0,e.ENABLE_VERBOSE=!0,e}()},2578:(e,t,i)=>{var n=i(2719),r=i(1031),o=i(2327),a=i(3587),s=i(3643).f,l=i(2382),A=i(1567),d=i(9845),c=i(9646),u="Array Iterator",h=a.set,p=a.getterFor(u);e.exports=l(Array,"Array",(function(e,t){h(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,i=e.index++;if(!t||i>=t.length)return e.target=null,A(void 0,!0);switch(e.kind){case"keys":return A(i,!1);case"values":return A(t[i],!1)}return A([i,t[i]],!1)}),"values");var f=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!d&&c&&"values"!==f.name)try{s(f,"name",{value:"values"})}catch(e){}},2630:(e,t,i)=>{var n=i(3430),r=i(6853).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},2632:(e,t,i)=>{i.d(t,{default:()=>F});var n={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32},r=i(8098),o={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,liveBufferLatencyChasing:!1,liveBufferLatencyMaxLatency:1.5,liveBufferLatencyMinRemain:.5,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0,url:void 0,redirectedURL:void 0,cors:!1};function a(){return Object.assign({},o)}var s=function(){function e(){}return e.supportMSEH264Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportMSEH265Playback=function(){var e;return null===(e=window.MediaSource)||void 0===e?void 0:e.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')},e.supportNetworkStreamIO=function(){var e=new r.A({},a()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"===t||"xhr-moz-chunked-loader"===t},e.getNetworkLoaderTypeName=function(){var e=new r.A({},a()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){void 0===e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"===i},e.getFeatureList=function(){var t={msePlayback:!1,mseLivePlayback:!1,mseH265Playback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeMP4H265Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.msePlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName()||"",t.mseLivePlayback=t.msePlayback&&t.networkStreamIO,t.mseH265Playback=e.supportMSEH265Playback(),t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeMP4H265Playback=e.supportNativeMediaPlayback('video/mp4; codecs="hvc1.1.6.L93.B0"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}();const l=s;var A=i(9034),d=i(2139),c=i(2460),u=i(8870);const h={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",TIMED_ID3_METADATA_ARRIVED:"timed_id3_metadata_arrived",SMPTE2038_METADATA_ARRIVED:"smpte2038_metadata_arrived",SCTE35_METADATA_ARRIVED:"scte35_metadata_arrived",PES_PRIVATE_DATA_DESCRIPTOR:"pes_private_data_descriptor",PES_PRIVATE_DATA_ARRIVED:"pes_private_data_arrived",STATISTICS_INFO:"statistics_info",DESTROYING:"destroying"};i(6041),i(8845),i(6815),i(9688),i(5758),i(5347),i(2578),i(5336),i(1464),i(4742),i(2250),i(6033),i(3813),i(4659),i(3074),i(9917),i(3478),i(5597),i(6263),i(6810),i(6728),i(7958),i(834),i(8862),i(4879),i(778),i(730),i(1454);var p=function(){var e=ENTRY_MODULE,t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.m=e,i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("[object Object]"===Object.prototype.toString.call(globalThis))return globalThis;try{return this||new Function("return this")()}catch(e){if("[object Object]"===Object.prototype.toString.call(window))return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=i(ENTRY_MODULE);return n.default||n},f="[\\.|\\-|\\+|\\w|/|@]+",_="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+f+").*?\\)";function m(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function v(e,t,n){var r={};r[n]=[];var o,a=t.toString(),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||a.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!s)return r;for(var l,A=s[1],d=new RegExp("(\\\\n|\\W)"+m(A)+_,"g");l=d.exec(a);)"dll-reference"!==l[3]&&r[n].push(l[3]);for(d=new RegExp("\\("+m(A)+'\\("(dll-reference\\s('+f+'))"\\)\\)'+_,"g");l=d.exec(a);)e[l[2]]||(r[n].push(l[1]),e[l[2]]=i(l[1]).m),r[l[2]]=r[l[2]]||[],r[l[2]].push(l[4]);for(var c=Object.keys(r),u=0;u<c.length;u++)for(var h=0;h<r[c[u]].length;h++)o=r[c[u]][h],!isNaN(1*o)&&(r[c[u]][h]=1*r[c[u]][h]);return r}function g(e){return Object.keys(e).reduce((function(t,i){return t||e[i].length>0}),!1)}function y(e,t,i,n){var r=e[n].map((function(e){return'"'.concat(e,'": ').concat(t[n][e].toString())})).join(","),o=p.toString().split("ENTRY_MODULE");return"".concat(o[0],"{").concat(r,"}").concat(o[1],'"').concat(i,'"').concat(o[2])}var b=i(8635),E=i(9953),S=i(550),C=i(719);const w=function(){function e(e,t){if(this.TAG="Transmuxer",this._workerDestroying=!1,this._controller=null,this._emitter=new d.A,t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=this._worker=function(e,t){t=t||{};var n={main:i.m},r=t.all?{main:Object.keys(n.main)}:function(e,t){for(var i={main:[7477]},n={main:[]},r={main:{}};g(i);)for(var o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s].pop();if(r[s]=r[s]||{},!r[s][l]&&e[s][l]){r[s][l]=!0,n[s]=n[s]||[],n[s].push(l);for(var A=v(e,e[s][l],s),d=Object.keys(A),c=0;c<d.length;c++)i[d[c]]=i[d[c]]||[],i[d[c]]=i[d[c]].concat(A[d[c]])}}return n}(n),o="";Object.keys(r).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;r[e][t];)t++;r[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o+="var ".concat(e," = (").concat(y(r,n,t,modules),")();\n")})),o+="(".concat(y(r,n,7477,"main"),")();");var a=new window.Blob([o],{type:"text/javascript"});if(t.bare)return a;var s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(a),l=new window.Worker(s);return l.objectURL=s,l}(),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},b.A.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:b.A.getConfig()})}catch(i){c.A.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new E.A(e,t)}else this._controller=new E.A(e,t);if(this._controller){var n=this._controller;null==n||n.on(S.A.IO_ERROR,this._onIOError.bind(this)),null==n||n.on(S.A.DEMUX_ERROR,this._onDemuxError.bind(this)),null==n||n.on(S.A.INIT_SEGMENT,this._onInitSegment.bind(this)),null==n||n.on(S.A.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),null==n||n.on(S.A.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),null==n||n.on(S.A.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),null==n||n.on(S.A.MEDIA_INFO,this._onMediaInfo.bind(this)),null==n||n.on(S.A.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),null==n||n.on(S.A.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),null==n||n.on(S.A.TIMED_ID3_METADATA_ARRIVED,this._onTimedID3MetadataArrived.bind(this)),null==n||n.on(S.A.SMPTE2038_METADATA_ARRIVED,this._onSMPTE2038MetadataArrived.bind(this)),null==n||n.on(S.A.SCTE35_METADATA_ARRIVED,this._onSCTE35MetadataArrived.bind(this)),null==n||n.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,this._onPESPrivateDataDescriptor.bind(this)),null==n||n.on(S.A.PES_PRIVATE_DATA_ARRIVED,this._onPESPrivateDataArrived.bind(this)),null==n||n.on(S.A.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),null==n||n.on(S.A.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){var e;this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"transmuxing-worker destroy"}),b.A.removeListener(this.e.onLoggingConfigChanged),this.e=null):(null===(e=this._controller)||void 0===e||e.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){var e;this._worker?this._worker.postMessage({cmd:"start"}):null===(e=this._controller)||void 0===e||e.start()},e.prototype.close=function(){var e;this._worker?this._worker.postMessage({cmd:"stop"}):null===(e=this._controller)||void 0===e||e.stop()},e.prototype.seek=function(e){var t;this._worker?this._worker.postMessage({cmd:"seek",param:e}):null===(t=this._controller)||void 0===t||t.seek(e)},e.prototype.pause=function(){var e;this._worker?this._worker.postMessage({cmd:"pause"}):null===(e=this._controller)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this._worker?this._worker.postMessage({cmd:"resume"}):null===(e=this._controller)||void 0===e||e.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(S.A.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(S.A.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onTimedID3MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.TIMED_ID3_METADATA_ARRIVED,e)}))},e.prototype._onSMPTE2038MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SMPTE2038_METADATA_ARRIVED,e)}))},e.prototype._onSCTE35MetadataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.SCTE35_METADATA_ARRIVED,e)}))},e.prototype._onPESPrivateDataDescriptor=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.PES_PRIVATE_DATA_DESCRIPTOR,e)}))},e.prototype._onPESPrivateDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.PES_PRIVATE_DATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(S.A.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(S.A.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=null==t?void 0:t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case S.A.INIT_SEGMENT:case S.A.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case S.A.LOADING_COMPLETE:case S.A.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case S.A.MEDIA_INFO:Object.setPrototypeOf(i,C.A.prototype),this._emitter.emit(t.msg,i);break;case S.A.METADATA_ARRIVED:case S.A.SCRIPTDATA_ARRIVED:case S.A.TIMED_ID3_METADATA_ARRIVED:case S.A.SMPTE2038_METADATA_ARRIVED:case S.A.SCTE35_METADATA_ARRIVED:case S.A.PES_PRIVATE_DATA_DESCRIPTOR:case S.A.PES_PRIVATE_DATA_ARRIVED:case S.A.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case S.A.IO_ERROR:case S.A.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case S.A.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":c.A.emitter.emit("log",i.type,i.logcat)}},e}(),T="error",k="source_open",L="update_end",I="buffer_full";var O=i(1951),B=i(4383);const R=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new d.A,this._config.isLive&&void 0===this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new O.EX}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new B.j4("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){c.A.e(this.TAG,e.message)}null==n||n.removeEventListener("error",this.e.onSourceBufferError),null==n||n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){c.A.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){var i;if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,r="".concat(n.container);n.codec&&n.codec.length>0&&(r+=";codecs=".concat(n.codec));var o=!1;if(c.A.v(this.TAG,"Received Initialization Segment, mimeType: "+r),this._lastInitSegments[n.type]=n,r!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])c.A.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type]||"",", target: ").concat(r));else{o=!0;try{var a=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(r);a.addEventListener("error",this.e.onSourceBufferError),a.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return c.A.e(this.TAG,e.message),void this._emitter.emit(T,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=r}t||this._pendingSegments[n.type].push(n),o||this._sourceBuffers[n.type]&&!(null===(i=this._sourceBuffers[n.type])||void 0===i?void 0:i.updating)&&this._doAppendSegments(),u.A.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){var t,i;for(var n in this._sourceBuffers)if(this._sourceBuffers[n]){var r=this._sourceBuffers[n];if("open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState))try{null==r||r.abort()}catch(e){c.A.e(this.TAG,e.message)}this._idrList.clear();var o=this._pendingSegments[n];if(o.splice(0,o.length),"closed"!==(null===(i=this._mediaSource)||void 0===i?void 0:i.readyState)){if(r){for(var a=0;a<r.buffered.length;a++){var s=r.buffered.start(a),l=r.buffered.end(a);this._pendingRemoveRanges[n].push({start:s,end:l})}(null==r?void 0:r.updating)||this._doRemoveRanges()}if(u.A.safari){var A=this._lastInitSegments[n];A&&(this._pendingSegments[n].push(A),(null==r?void 0:r.updating)||this._doAppendSegments())}}}},e.prototype.endOfStream=function(){var e,t,i=this._mediaSource,n=this._sourceBuffers;i&&"open"===i.readyState?(null===(e=n.video)||void 0===e?void 0:e.updating)||(null===(t=n.audio)||void 0===t?void 0:t.updating)?this._hasPendingEos=!0:(this._hasPendingEos=!1,i.endOfStream()):i&&"closed"===i.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)},e.prototype.getNearestKeyframe=function(e){return this._idrList.getLastSyncPointBeforeDts(e)},e.prototype._needCleanupSourceBuffer=function(){var e,t;if(!this._config.autoCleanupSourceBuffer)return!1;var i=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var n in this._sourceBuffers){var r=this._sourceBuffers[n];if(r){var o=r.buffered;if(o.length>=1&&i-o.start(0)>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0))return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e,t,i,n=null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime;for(var r in this._sourceBuffers){var o=this._sourceBuffers[r];if(o){for(var a=o.buffered,s=!1,l=0;l<a.length;l++){var A=a.start(l),d=a.end(l);if(A<=n&&n<d+3){if(n-A>=((null===(t=this._config)||void 0===t?void 0:t.autoCleanupMaxBackwardDuration)||0)){s=!0;var c=n-((null===(i=this._config)||void 0===i?void 0:i.autoCleanupMinBackwardDuration)||0);this._pendingRemoveRanges[r].push({start:A,end:c})}}else d<n&&(s=!0,this._pendingRemoveRanges[r].push({start:A,end:d}))}s&&!o.updating&&this._doRemoveRanges()}}},e.prototype._updateMediaSourceDuration=function(){var e,t,i,n,r=this._sourceBuffers;if(0!==(null===(e=this._mediaElement)||void 0===e?void 0:e.readyState)&&"open"===(null===(t=this._mediaSource)||void 0===t?void 0:t.readyState)&&!(null===(i=r.video)||void 0===i?void 0:i.updating)&&!(null===(n=r.audio)||void 0===n?void 0:n.updating)){var o=this._mediaSource.duration,a=this._pendingMediaDuration;a>0&&(isNaN(o)||a>o)&&(c.A.v(this.TAG,"Update MediaSource duration from ".concat(o," to ").concat(a)),this._mediaSource.duration=a),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){var e;for(var t in this._pendingRemoveRanges)if(this._sourceBuffers[t]&&!(null===(e=this._sourceBuffers[t])||void 0===e?void 0:e.updating))for(var i=this._sourceBuffers[t],n=this._pendingRemoveRanges[t];n.length&&!(null==i?void 0:i.updating);){var r=n.shift();null==i||i.remove(r.start,r.end)}},e.prototype._doAppendSegments=function(){var e,t,i,n=this._pendingSegments;for(var r in n)if(this._sourceBuffers[r]&&!(null===(e=this._sourceBuffers[r])||void 0===e?void 0:e.updating)&&n[r].length>0){var o=n[r].shift();if(null==o?void 0:o.timestampOffset){var a=(null===(t=this._sourceBuffers[r])||void 0===t?void 0:t.timestampOffset)||0,s=o.timestampOffset/1e3;Math.abs(a-s)>.1&&(c.A.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(a," to ").concat(s)),this._sourceBuffers[r]&&(this._sourceBuffers[r].timestampOffset=s)),delete o.timestampOffset}if(!o.data||0===o.data.byteLength)continue;try{null===(i=this._sourceBuffers[r])||void 0===i||i.appendBuffer(o.data),this._isBufferFull=!1,"video"===r&&o.hasOwnProperty("info")&&this._idrList.appendArray(o.info.syncPoints)}catch(e){this._pendingSegments[r].unshift(o),22===e.code?(this._isBufferFull||this._emitter.emit(I),this._isBufferFull=!0):(c.A.e(this.TAG,e.message),this._emitter.emit(T,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){var e;if(c.A.v(this.TAG,"MediaSource onSourceOpen"),null===(e=this._mediaSource)||void 0===e||e.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var t=this._pendingSourceBufferInit;t.length;){var i=t.shift();this.appendInitSegment(i,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(k)},e.prototype._onSourceEnded=function(){c.A.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){c.A.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(L)},e.prototype._onSourceBufferError=function(e){c.A.e(this.TAG,"SourceBuffer Error: ".concat(e))},e}();var x=i(6399),D={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},M={NETWORK_EXCEPTION:A.Xv.EXCEPTION,NETWORK_STATUS_CODE_INVALID:A.Xv.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:A.Xv.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:A.Xv.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:x.A.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:x.A.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:x.A.CODEC_UNSUPPORTED};const P=function(){function e(e,t){var i,n,r;this.TAG="MSEPlayer",this._type="MSEPlayer",this._emitter=new d.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var o=e.type.toLowerCase();if("mse"!==o&&"mpegts"!==o&&"m2ts"!==o&&"flv"!==o)throw new B.Qn("MSEPlayer requires an mpegts/m2ts/flv MediaDataSource input!");e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var s=u.A.chrome&&(u.A.version&&(null===(i=u.A.version)||void 0===i?void 0:i.major)<50||u.A.version&&50===(null===(n=null===u.A||void 0===u.A?void 0:u.A.version)||void 0===n?void 0:n.major)&&((null===(r=null===u.A||void 0===u.A?void 0:u.A.version)||void 0===r?void 0:r.build)||-1)<2661);this._alwaysSeekKeyframe=!!(s||u.A.msedge||u.A.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){this._emitter.emit(h.DESTROYING),null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===h.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){i._emitter.emit(h.MEDIA_INFO,i.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){i._emitter.emit(h.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t,i,n,r,o,a=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new R(this._config),null===(t=this._msectl)||void 0===t||t.on(L,this._onmseUpdateEnd.bind(this)),null===(i=this._msectl)||void 0===i||i.on(I,this._onmseBufferFull.bind(this)),null===(n=this._msectl)||void 0===n||n.on(k,(function(){a._mseSourceOpened=!0,a._hasPendingLoad&&(a._hasPendingLoad=!1,a.load())})),null===(r=this._msectl)||void 0===r||r.on(T,(function(e){a._emitter.emit(h.ERROR,D.MEDIA_ERROR,M.MEDIA_MSE_ERROR,e)})),null===(o=this._msectl)||void 0===o||o.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){var e;this._mediaElement&&(null===(e=this._msectl)||void 0===e||e.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new B.j4("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new B.j4("MSEPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(!this._config.deferLoadAfterSourceOpen||this._mseSourceOpened?(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new w(this._mediaDataSource,this._config),this._transmuxer.on(S.A.INIT_SEGMENT,(function(t,i){var n;null===(n=e._msectl)||void 0===n||n.appendInitSegment(i)})),this._transmuxer.on(S.A.MEDIA_SEGMENT,(function(t,i){var n,r,o;if(null===(n=e._msectl)||void 0===n||n.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var a=null===(r=e._mediaElement)||void 0===r?void 0:r.currentTime;i.info.endDts>=1e3*(a+((null===(o=e._config)||void 0===o?void 0:o.lazyLoadMaxDuration)||0))&&null==e._progressChecker&&(c.A.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(S.A.LOADING_COMPLETE,(function(){var t;null===(t=e._msectl)||void 0===t||t.endOfStream(),e._emitter.emit(h.LOADING_COMPLETE)})),this._transmuxer.on(S.A.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(h.RECOVERED_EARLY_EOF)})),this._transmuxer.on(S.A.IO_ERROR,(function(t,i){e._emitter.emit(h.ERROR,D.NETWORK_ERROR,t,i)})),this._transmuxer.on(S.A.DEMUX_ERROR,(function(t,i){e._emitter.emit(h.ERROR,D.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(S.A.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(h.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(S.A.METADATA_ARRIVED,(function(t){e._emitter.emit(h.METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(h.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(S.A.TIMED_ID3_METADATA_ARRIVED,(function(t){e._emitter.emit(h.TIMED_ID3_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SMPTE2038_METADATA_ARRIVED,(function(t){e._emitter.emit(h.SMPTE2038_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.SCTE35_METADATA_ARRIVED,(function(t){e._emitter.emit(h.SCTE35_METADATA_ARRIVED,t)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_DESCRIPTOR,(function(t){e._emitter.emit(h.PES_PRIVATE_DATA_DESCRIPTOR,t)})),this._transmuxer.on(S.A.PES_PRIVATE_DATA_ARRIVED,(function(t){e._emitter.emit(h.PES_PRIVATE_DATA_ARRIVED,t)})),this._transmuxer.on(S.A.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(h.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(S.A.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()):this._hasPendingLoad=!0)},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){var e,t,i,n;return t=this,n=function(){return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,r){function o(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((n=n.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){var e,t,i,n,r=null===(e=this._mediaElement)||void 0===e?void 0:e.buffered,o=(null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime)||0;if(this._config.isLive&&this._config.liveBufferLatencyChasing&&(null==r?void 0:r.length)>0&&!(null===(i=this._mediaElement)||void 0===i?void 0:i.paused)){var a=r.end(r.length-1);if(a>((null===(n=this._config)||void 0===n?void 0:n.liveBufferLatencyMaxLatency)||0)&&a-o>(this._config.liveBufferLatencyMaxLatency||0)){var s=a-(this._config.liveBufferLatencyMinRemain||0);this.currentTime=s}}if(this._config.lazyLoad&&!this._config.isLive){for(var l=0,A=0;A<r.length;A++){var d=r.start(A),u=r.end(A);if(d<=o&&o<u){l=u;break}}l>=o+(this._config.lazyLoadMaxDuration||0)&&null==this._progressChecker&&(c.A.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){c.A.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e,t,i,n=(null===(e=this._mediaElement)||void 0===e?void 0:e.currentTime)||0,r=(null===(t=this._mediaElement)||void 0===t?void 0:t.buffered)||[],o=!1,a=0;a<r.length;a++){var s=r.start(a),l=r.end(a);if(n>=s&&n<l){n>=l-(this._config.lazyLoadRecoverDuration||0)&&(o=!0);break}}o&&(window.clearInterval(this._progressChecker),this._progressChecker=null,o&&(c.A.v(this.TAG,"Continue loading from paused position"),null===(i=this._transmuxer)||void 0===i||i.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t,i=null===(t=this._mediaElement)||void 0===t?void 0:t.buffered,n=0;n<i.length;n++){var r=i.start(n),o=i.end(n);if(e>=r&&e<o)return!0}return!1},e.prototype._internalSeek=function(e){var t,i,n,r=this._isTimepointBuffered(e),o=!1,a=0;if(e<1&&this._mediaElement.buffered.length>0){var s=this._mediaElement.buffered.start(0);(s<1&&e<s||u.A.safari)&&(o=!0,a=u.A.safari?.1:s)}if(o)this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=a);else if(r){if(this._alwaysSeekKeyframe){var l=null===(t=this._msectl)||void 0===t?void 0:t.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=null!=l?l.dts/1e3:e)}else this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e);null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(e),null===(n=this._transmuxer)||void 0===n||n.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=e))},e.prototype._checkAndApplyUnbufferedSeekpoint=function(){var e,t,i,n;if(this._seekpointRecord)if(((null===(e=this._seekpointRecord)||void 0===e?void 0:e.recordTime)||0)<=this._now()-100){var r=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(r)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),null===(i=this._msectl)||void 0===i||i.seek(r),null===(n=this._transmuxer)||void 0===n||n.seek(Math.floor(1e3*r)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=r)))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},e.prototype._checkAndResumeStuckPlayback=function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var i=t.buffered;i.length>0&&t.currentTime<i.start(0)&&(c.A.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(i.start(0))),this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=i.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress)))}else this._mediaElement&&this._mediaElement.removeEventListener("progress",this.e.onvProgress)},e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null)},e.prototype._onvSeeking=function(e){var t,i,n,r=null===(t=this._mediaElement)||void 0===t?void 0:t.currentTime,o=null===(i=this._mediaElement)||void 0===i?void 0:i.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(r<1&&o.length>0){var a=o.start(0);if(a<1&&r<a||u.A.safari)return this._requestSetTime=!0,void(this._mediaElement&&(u.A.safari?this._mediaElement.currentTime=.1:this._mediaElement.currentTime=a))}if(this._isTimepointBuffered(r)){if(this._alwaysSeekKeyframe){var s=null===(n=this._msectl)||void 0===n?void 0:n.getNearestKeyframe(Math.floor(1e3*r));null!=s&&(this._requestSetTime=!0,this._mediaElement&&(this._mediaElement.currentTime=s.dts/1e3))}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:r,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},e.prototype._onvCanPlay=function(e){var t;this._receivedCanPlay=!0,null===(t=this._mediaElement)||void 0===t||t.removeEventListener("canplay",this.e.onvCanPlay)},e.prototype._onvStalled=function(e){this._checkAndResumeStuckPlayback(!0)},e.prototype._onvProgress=function(e){this._checkAndResumeStuckPlayback()},e}(),U=function(){function e(e,t){this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new d.A,this._config=a(),"object"==typeof t&&Object.assign(this._config,t);var i=e.type.toLowerCase();if("mse"===i||"mpegts"===i||"m2ts"===i||"flv"===i)throw new B.Qn("NativePlayer does't support mse/mpegts/m2ts/flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new B.Qn("NativePlayer(".concat(e.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}return e.prototype.destroy=function(){var e;this._emitter.emit(h.DESTROYING),this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,null===(e=this._emitter)||void 0===e||e.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===h.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(h.MEDIA_INFO,i.mediaInfo)})):e===h.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){i._emitter.emit(h.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.load=function(){var e;if(!this._mediaElement)throw new B.j4("HTMLMediaElement must be attached before load()!");this._mediaElement.src=(null===(e=this._mediaDataSource)||void 0===e?void 0:e.url)||"",this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){var e,t,i,n;return t=this,n=function(){return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,(function(t){switch(t.label){case 0:return[4,null===(e=this._mediaElement)||void 0===e?void 0:e.play()];case 1:return[2,t.sent()]}}))},new((i=void 0)||(i=Promise))((function(e,r){function o(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,a)}s((n=n.apply(t,[])).next())}))},e.prototype.pause=function(){var e;null===(e=this._mediaElement)||void 0===e||e.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.volume},set:function(e){this._mediaElement&&(this._mediaElement.volume=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){var e;return null===(e=this._mediaElement)||void 0===e?void 0:e.muted},set:function(e){this._mediaElement&&(this._mediaElement.muted=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else void 0!==this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement&&(this._mediaElement.currentTime=this._pendingSeekTime),this._pendingSeekTime=null),this._emitter.emit(h.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(h.STATISTICS_INFO,this.statisticsInfo)},e}();var $={createPlayer:function(e,t){(null==e?void 0:e.url)&&(e.url=function(e,t){void 0===t&&(t=["h264"]);var i=(t||["h264"]).reduce((function(e,t){return t=t.toLowerCase(),e+(n[t]||0)}),0),r=e.split("?")[0],o=e.split("?")[1];return o=(o||"").split("&").filter((function(e){return!/^vc=\d?/.test(e)})).join("&"),r+"?"+o+(o?"&":"")+"vc="+i}(e.url,["h264","h265"]));var i=e;if(null==i||"object"!=typeof i)throw new B.Qn("MediaDataSource must be an javascript object!");if(!Object.prototype.hasOwnProperty.call(i,"type"))throw new B.Qn("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"mse":case"mpegts":case"m2ts":case"flv":return new P(i,t);default:return new U(i,t)}},isSupported:function(){return l.supportMSEH264Playback()},getFeatureList:function(){return l.getFeatureList()},BaseLoader:A.HC,LoaderStatus:A.eO,LoaderErrors:A.Xv,version:"",Events:h,ErrorTypes:D,ErrorDetails:M,MSEPlayer:P,NativePlayer:U,LoggingControl:b.A};Object.defineProperty($,"version",{enumerable:!0,get:function(){return"2.0.1"}});const F=$},2671:(e,t,i)=>{var n=i(6458),r=i(2809),o=i(9211),a=i(497),s=i(5057),l=i(3732),A=function(){},d=s("Reflect","construct"),c=/^\s*(?:class|function)\b/,u=n(c.exec),h=!c.test(A),p=function(e){if(!o(e))return!1;try{return d(A,[],e),!0}catch(e){return!1}},f=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!u(c,l(e))}catch(e){return!0}};f.sham=!0,e.exports=!d||r((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?f:p},2719:(e,t,i)=>{var n=i(5273),r=i(5840);e.exports=function(e){return n(r(e))}},2757:(e,t,i)=>{var n=i(9615),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}},2792:(e,t,i)=>{var n=i(9646),r=i(2809);e.exports=n&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2807:(e,t,i)=>{var n=i(9047);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},2809:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},2897:(e,t,i)=>{var n=i(9646),r=i(815),o=i(7403),a=i(6330),s=i(2719),l=i(4151),A=i(4347),d=i(6071),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=s(e),t=l(t),d)try{return c(e,t)}catch(e){}if(A(e,t))return a(!r(o.f,e,t),e[t])}},2915:(e,t,i)=>{var n=i(7553),r=i(2327),o=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||a[o]===e)}},3074:(e,t,i)=>{var n=i(9364),r=i(9083),o=i(7642);n({target:"Object",stat:!0,forced:i(2809)((function(){o(1)}))},{keys:function(e){return o(r(e))}})},3430:(e,t,i)=>{var n=i(6458),r=i(4347),o=i(2719),a=i(219).indexOf,s=i(7923),l=n([].push);e.exports=function(e,t){var i,n=o(e),A=0,d=[];for(i in n)!r(s,i)&&r(n,i)&&l(d,i);for(;t.length>A;)r(n,i=t[A++])&&(~a(d,i)||l(d,i));return d}},3439:(e,t,i)=>{var n=i(9646),r=i(6458),o=i(815),a=i(2809),s=i(7642),l=i(7819),A=i(7403),d=i(9083),c=i(5273),u=Object.assign,h=Object.defineProperty,p=r([].concat);e.exports=!u||a((function(){if(n&&1!==u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[i]=7,r.split("").forEach((function(e){t[e]=e})),7!==u({},e)[i]||s(u({},t)).join("")!==r}))?function(e,t){for(var i=d(e),r=arguments.length,a=1,u=l.f,h=A.f;r>a;)for(var f,_=c(arguments[a++]),m=u?p(s(_),u(_)):s(_),v=m.length,g=0;v>g;)f=m[g++],n&&!o(h,_,f)||(i[f]=_[f]);return i}:u},3463:(e,t,i)=>{var n=i(775);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},3478:(e,t,i)=>{var n=i(9646),r=i(1562),o=i(6458),a=i(4346),s=i(5405),l=i(9277),A=i(6122),d=i(2630).f,c=i(9615),u=i(9666),h=i(6677),p=i(1144),f=i(8587),_=i(9614),m=i(3930),v=i(2809),g=i(4347),y=i(3587).enforce,b=i(9603),E=i(7553),S=i(7517),C=i(6288),w=E("match"),T=r.RegExp,k=T.prototype,L=r.SyntaxError,I=o(k.exec),O=o("".charAt),B=o("".replace),R=o("".indexOf),x=o("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,M=/a/g,P=/a/g,U=new T(M)!==M,$=f.MISSED_STICKY,F=f.UNSUPPORTED_Y;if(a("RegExp",n&&(!U||$||S||C||v((function(){return P[w]=!1,T(M)!==M||T(P)===P||"/a/i"!==String(T(M,"i"))}))))){for(var N=function(e,t){var i,n,r,o,a,d,f=c(k,this),_=u(e),m=void 0===t,v=[],b=e;if(!f&&_&&m&&e.constructor===N)return e;if((_||c(k,e))&&(e=e.source,m&&(t=p(b))),e=void 0===e?"":h(e),t=void 0===t?"":h(t),b=e,S&&"dotAll"in M&&(n=!!t&&R(t,"s")>-1)&&(t=B(t,/s/g,"")),i=t,$&&"sticky"in M&&(r=!!t&&R(t,"y")>-1)&&F&&(t=B(t,/y/g,"")),C&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],a=A(null),s=!1,l=!1,d=0,c="";n<=i;n++){if("\\"===(t=O(e,n)))t+=O(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(r+=t,"?:"===x(e,n+1,n+3))continue;I(D,x(e,n+1))&&(n+=2,l=!0),d++;continue;case">"===t&&l:if(""===c||g(a,c))throw new L("Invalid capture group name");a[c]=!0,o[o.length]=[c,d],l=!1,c="";continue}l?c+=t:r+=t}return[r,o]}(e),e=o[0],v=o[1]),a=s(T(e,t),f?this:k,N),(n||r||v.length)&&(d=y(a),n&&(d.dotAll=!0,d.raw=N(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=O(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+O(e,++n);return r}(e),i)),r&&(d.sticky=!0),v.length&&(d.groups=v)),e!==b)try{l(a,"source",""===b?"(?:)":b)}catch(e){}return a},V=d(T),j=0;V.length>j;)_(N,T,V[j++]);k.constructor=N,N.prototype=k,m(r,"RegExp",N,{constructor:!0})}b("RegExp")},3479:(e,t,i)=>{var n=i(5993);e.exports="NODE"===n},3587:(e,t,i)=>{var n,r,o,a=i(4468),s=i(1562),l=i(4152),A=i(9277),d=i(4347),c=i(775),u=i(577),h=i(7923),p="Object already initialized",f=s.TypeError,_=s.WeakMap;if(a||c.state){var m=c.state||(c.state=new _);m.get=m.get,m.has=m.has,m.set=m.set,n=function(e,t){if(m.has(e))throw new f(p);return t.facade=e,m.set(e,t),t},r=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var v=u("state");h[v]=!0,n=function(e,t){if(d(e,v))throw new f(p);return t.facade=e,A(e,v,t),t},r=function(e){return d(e,v)?e[v]:{}},o=function(e){return d(e,v)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=r(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return i}}}},3643:(e,t,i)=>{var n=i(9646),r=i(6071),o=i(2792),a=i(7749),s=i(4151),l=TypeError,A=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",h="writable";t.f=n?o?function(e,t,i){if(a(e),t=s(t),a(i),"function"==typeof e&&"prototype"===t&&"value"in i&&h in i&&!i[h]){var n=d(e,t);n&&n[h]&&(e[t]=i.value,i={configurable:u in i?i[u]:n[u],enumerable:c in i?i[c]:n[c],writable:!1})}return A(e,t,i)}:A:function(e,t,i){if(a(e),t=s(t),a(i),r)try{return A(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},3732:(e,t,i)=>{var n=i(6458),r=i(9211),o=i(775),a=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},3813:(e,t,i)=>{i(1541)(Math,"Math",!0)},3930:(e,t,i)=>{var n=i(9211),r=i(3643),o=i(4233),a=i(4191);e.exports=function(e,t,i,s){s||(s={});var l=s.enumerable,A=void 0!==s.name?s.name:t;if(n(i)&&o(i,A,s),s.global)l?e[t]=i:a(t,i);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},3992:(e,t,i)=>{var n=i(9364),r=i(5057),o=i(8891),a=i(815),s=i(6458),l=i(2809),A=i(9211),d=i(5727),c=i(8626),u=i(9695),h=i(7917),p=String,f=r("JSON","stringify"),_=s(/./.exec),m=s("".charAt),v=s("".charCodeAt),g=s("".replace),y=s(1..toString),b=/[\uD800-\uDFFF]/g,E=/^[\uD800-\uDBFF]$/,S=/^[\uDC00-\uDFFF]$/,C=!h||l((function(){var e=r("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),w=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),T=function(e,t){var i=c(arguments),n=u(t);if(A(n)||void 0!==e&&!d(e))return i[1]=function(e,t){if(A(n)&&(t=a(n,this,p(e),t)),!d(t))return t},o(f,null,i)},k=function(e,t,i){var n=m(i,t-1),r=m(i,t+1);return _(E,e)&&!_(S,r)||_(S,e)&&!_(E,n)?"\\u"+y(v(e,0),16):e};f&&n({target:"JSON",stat:!0,arity:3,forced:C||w},{stringify:function(e,t,i){var n=c(arguments),r=o(C?T:f,null,n);return w&&"string"==typeof r?g(r,b,k):r}})},4151:(e,t,i)=>{var n=i(115),r=i(5727);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},4152:(e,t,i)=>{var n=i(9211);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},4160:(e,t,i)=>{var n=i(815),r=i(5057),o=i(7553),a=i(3930);e.exports=function(){var e=r("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,s=o("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return n(i,this)}),{arity:1})}},4191:(e,t,i)=>{var n=i(1562),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},4220:(e,t,i)=>{i(6810);var n,r=i(9364),o=i(9646),a=i(6666),s=i(1562),l=i(7042),A=i(6458),d=i(3930),c=i(1176),u=i(2757),h=i(4347),p=i(3439),f=i(4478),_=i(8626),m=i(4417).codeAt,v=i(4955),g=i(6677),y=i(1541),b=i(594),E=i(648),S=i(3587),C=S.set,w=S.getterFor("URL"),T=E.URLSearchParams,k=E.getState,L=s.URL,I=s.TypeError,O=s.parseInt,B=Math.floor,R=Math.pow,x=A("".charAt),D=A(/./.exec),M=A([].join),P=A(1..toString),U=A([].pop),$=A([].push),F=A("".replace),N=A([].shift),V=A("".split),j=A("".slice),Q=A("".toLowerCase),G=A([].unshift),z="Invalid scheme",H="Invalid host",W="Invalid port",q=/[a-z]/i,K=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,Z=/^[0-7]+$/,J=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ie=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,re=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,oe=/[\t\n\r]/g,ae=function(e){var t,i,n,r;if("number"==typeof e){for(t=[],i=0;i<4;i++)G(t,e%256),e=B(e/256);return M(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,i=1,n=null,r=0,o=0;o<8;o++)0!==e[o]?(r>i&&(t=n,i=r),n=null,r=0):(null===n&&(n=o),++r);return r>i?n:t}(e),i=0;i<8;i++)r&&0===e[i]||(r&&(r=!1),n===i?(t+=i?":":"::",r=!0):(t+=P(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},se={},le=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),Ae=p({},le,{"#":1,"?":1,"{":1,"}":1}),de=p({},Ae,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ce=function(e,t){var i=m(e,0);return i>32&&i<127&&!h(t,e)?e:encodeURIComponent(e)},ue={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var i;return 2===e.length&&D(q,x(e,0))&&(":"===(i=x(e,1))||!t&&"|"===i)},pe=function(e){var t;return e.length>1&&he(j(e,0,2))&&(2===e.length||"/"===(t=x(e,2))||"\\"===t||"?"===t||"#"===t)},fe=function(e){return"."===e||"%2e"===Q(e)},_e={},me={},ve={},ge={},ye={},be={},Ee={},Se={},Ce={},we={},Te={},ke={},Le={},Ie={},Oe={},Be={},Re={},xe={},De={},Me={},Pe={},Ue=function(e,t,i){var n,r,o,a=g(e);if(t){if(r=this.parse(a))throw new I(r);this.searchParams=null}else{if(void 0!==i&&(n=new Ue(i,!0)),r=this.parse(a,null,n))throw new I(r);(o=k(new T)).bindURL(this),this.searchParams=o}};Ue.prototype={type:"URL",parse:function(e,t,i){var r,o,a,s,l,A=this,d=t||_e,c=0,u="",p=!1,m=!1,v=!1;for(e=g(e),t||(A.scheme="",A.username="",A.password="",A.host=null,A.port=null,A.path=[],A.query=null,A.fragment=null,A.cannotBeABaseURL=!1,e=F(e,ne,""),e=F(e,re,"$1")),e=F(e,oe,""),r=f(e);c<=r.length;){switch(o=r[c],d){case _e:if(!o||!D(q,o)){if(t)return z;d=ve;continue}u+=Q(o),d=me;break;case me:if(o&&(D(K,o)||"+"===o||"-"===o||"."===o))u+=Q(o);else{if(":"!==o){if(t)return z;u="",d=ve,c=0;continue}if(t&&(A.isSpecial()!==h(ue,u)||"file"===u&&(A.includesCredentials()||null!==A.port)||"file"===A.scheme&&!A.host))return;if(A.scheme=u,t)return void(A.isSpecial()&&ue[A.scheme]===A.port&&(A.port=null));u="","file"===A.scheme?d=Ie:A.isSpecial()&&i&&i.scheme===A.scheme?d=ge:A.isSpecial()?d=Se:"/"===r[c+1]?(d=ye,c++):(A.cannotBeABaseURL=!0,$(A.path,""),d=De)}break;case ve:if(!i||i.cannotBeABaseURL&&"#"!==o)return z;if(i.cannotBeABaseURL&&"#"===o){A.scheme=i.scheme,A.path=_(i.path),A.query=i.query,A.fragment="",A.cannotBeABaseURL=!0,d=Pe;break}d="file"===i.scheme?Ie:be;continue;case ge:if("/"!==o||"/"!==r[c+1]){d=be;continue}d=Ce,c++;break;case ye:if("/"===o){d=we;break}d=xe;continue;case be:if(A.scheme=i.scheme,o===n)A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.query=i.query;else if("/"===o||"\\"===o&&A.isSpecial())d=Ee;else if("?"===o)A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.query="",d=Me;else{if("#"!==o){A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.path.length--,d=xe;continue}A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,A.path=_(i.path),A.query=i.query,A.fragment="",d=Pe}break;case Ee:if(!A.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){A.username=i.username,A.password=i.password,A.host=i.host,A.port=i.port,d=xe;continue}d=we}else d=Ce;break;case Se:if(d=Ce,"/"!==o||"/"!==x(u,c+1))continue;c++;break;case Ce:if("/"!==o&&"\\"!==o){d=we;continue}break;case we:if("@"===o){p&&(u="%40"+u),p=!0,a=f(u);for(var y=0;y<a.length;y++){var b=a[y];if(":"!==b||v){var E=ce(b,de);v?A.password+=E:A.username+=E}else v=!0}u=""}else if(o===n||"/"===o||"?"===o||"#"===o||"\\"===o&&A.isSpecial()){if(p&&""===u)return"Invalid authority";c-=f(u).length+1,u="",d=Te}else u+=o;break;case Te:case ke:if(t&&"file"===A.scheme){d=Be;continue}if(":"!==o||m){if(o===n||"/"===o||"?"===o||"#"===o||"\\"===o&&A.isSpecial()){if(A.isSpecial()&&""===u)return H;if(t&&""===u&&(A.includesCredentials()||null!==A.port))return;if(s=A.parseHost(u))return s;if(u="",d=Re,t)return;continue}"["===o?m=!0:"]"===o&&(m=!1),u+=o}else{if(""===u)return H;if(s=A.parseHost(u))return s;if(u="",d=Le,t===ke)return}break;case Le:if(!D(Y,o)){if(o===n||"/"===o||"?"===o||"#"===o||"\\"===o&&A.isSpecial()||t){if(""!==u){var S=O(u,10);if(S>65535)return W;A.port=A.isSpecial()&&S===ue[A.scheme]?null:S,u=""}if(t)return;d=Re;continue}return W}u+=o;break;case Ie:if(A.scheme="file","/"===o||"\\"===o)d=Oe;else{if(!i||"file"!==i.scheme){d=xe;continue}switch(o){case n:A.host=i.host,A.path=_(i.path),A.query=i.query;break;case"?":A.host=i.host,A.path=_(i.path),A.query="",d=Me;break;case"#":A.host=i.host,A.path=_(i.path),A.query=i.query,A.fragment="",d=Pe;break;default:pe(M(_(r,c),""))||(A.host=i.host,A.path=_(i.path),A.shortenPath()),d=xe;continue}}break;case Oe:if("/"===o||"\\"===o){d=Be;break}i&&"file"===i.scheme&&!pe(M(_(r,c),""))&&(he(i.path[0],!0)?$(A.path,i.path[0]):A.host=i.host),d=xe;continue;case Be:if(o===n||"/"===o||"\\"===o||"?"===o||"#"===o){if(!t&&he(u))d=xe;else if(""===u){if(A.host="",t)return;d=Re}else{if(s=A.parseHost(u))return s;if("localhost"===A.host&&(A.host=""),t)return;u="",d=Re}continue}u+=o;break;case Re:if(A.isSpecial()){if(d=xe,"/"!==o&&"\\"!==o)continue}else if(t||"?"!==o)if(t||"#"!==o){if(o!==n&&(d=xe,"/"!==o))continue}else A.fragment="",d=Pe;else A.query="",d=Me;break;case xe:if(o===n||"/"===o||"\\"===o&&A.isSpecial()||!t&&("?"===o||"#"===o)){if(".."===(l=Q(l=u))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(A.shortenPath(),"/"===o||"\\"===o&&A.isSpecial()||$(A.path,"")):fe(u)?"/"===o||"\\"===o&&A.isSpecial()||$(A.path,""):("file"===A.scheme&&!A.path.length&&he(u)&&(A.host&&(A.host=""),u=x(u,0)+":"),$(A.path,u)),u="","file"===A.scheme&&(o===n||"?"===o||"#"===o))for(;A.path.length>1&&""===A.path[0];)N(A.path);"?"===o?(A.query="",d=Me):"#"===o&&(A.fragment="",d=Pe)}else u+=ce(o,Ae);break;case De:"?"===o?(A.query="",d=Me):"#"===o?(A.fragment="",d=Pe):o!==n&&(A.path[0]+=ce(o,se));break;case Me:t||"#"!==o?o!==n&&("'"===o&&A.isSpecial()?A.query+="%27":A.query+="#"===o?"%23":ce(o,se)):(A.fragment="",d=Pe);break;case Pe:o!==n&&(A.fragment+=ce(o,le))}c++}},parseHost:function(e){var t,i,n;if("["===x(e,0)){if("]"!==x(e,e.length-1))return H;if(t=function(e){var t,i,n,r,o,a,s,l=[0,0,0,0,0,0,0,0],A=0,d=null,c=0,u=function(){return x(e,c)};if(":"===u()){if(":"!==x(e,1))return;c+=2,d=++A}for(;u();){if(8===A)return;if(":"!==u()){for(t=i=0;i<4&&D(ee,u());)t=16*t+O(u(),16),c++,i++;if("."===u()){if(0===i)return;if(c-=i,A>6)return;for(n=0;u();){if(r=null,n>0){if(!("."===u()&&n<4))return;c++}if(!D(Y,u()))return;for(;D(Y,u());){if(o=O(u(),10),null===r)r=o;else{if(0===r)return;r=10*r+o}if(r>255)return;c++}l[A]=256*l[A]+r,2!=++n&&4!==n||A++}if(4!==n)return;break}if(":"===u()){if(c++,!u())return}else if(u())return;l[A++]=t}else{if(null!==d)return;c++,d=++A}}if(null!==d)for(a=A-d,A=7;0!==A&&a>0;)s=l[A],l[A--]=l[d+a-1],l[d+--a]=s;else if(8!==A)return;return l}(j(e,1,-1)),!t)return H;this.host=t}else if(this.isSpecial()){if(e=v(e),D(te,e))return H;if(t=function(e){var t,i,n,r,o,a,s,l=V(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(i=[],n=0;n<t;n++){if(""===(r=l[n]))return e;if(o=10,r.length>1&&"0"===x(r,0)&&(o=D(X,r)?16:8,r=j(r,8===o?1:2)),""===r)a=0;else{if(!D(10===o?J:8===o?Z:ee,r))return e;a=O(r,o)}$(i,a)}for(n=0;n<t;n++)if(a=i[n],n===t-1){if(a>=R(256,5-t))return null}else if(a>255)return null;for(s=U(i),n=0;n<i.length;n++)s+=i[n]*R(256,3-n);return s}(e),null===t)return H;this.host=t}else{if(D(ie,e))return H;for(t="",i=f(e),n=0;n<i.length;n++)t+=ce(i[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return h(ue,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,n=e.password,r=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,A=t+":";return null!==r?(A+="//",e.includesCredentials()&&(A+=i+(n?":"+n:"")+"@"),A+=ae(r),null!==o&&(A+=":"+o)):"file"===t&&(A+="//"),A+=e.cannotBeABaseURL?a[0]:a.length?"/"+M(a,"/"):"",null!==s&&(A+="?"+s),null!==l&&(A+="#"+l),A},setHref:function(e){var t=this.parse(e);if(t)throw new I(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new $e(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(g(e)+":",_e)},getUsername:function(){return this.username},setUsername:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=ce(t[i],de)}},getPassword:function(){return this.password},setPassword:function(e){var t=f(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=ce(t[i],de)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Te)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,ke)},getPort:function(){var e=this.port;return null===e?"":g(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=g(e))?this.port=null:this.parse(e,Le))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+M(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Re))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=g(e))?this.query=null:("?"===x(e,0)&&(e=j(e,1)),this.query="",this.parse(e,Me)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=g(e))?("#"===x(e,0)&&(e=j(e,1)),this.fragment="",this.parse(e,Pe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var $e=function(e){var t=u(this,Fe),i=b(arguments.length,1)>1?arguments[1]:void 0,n=C(t,new Ue(e,!1,i));o||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Fe=$e.prototype,Ne=function(e,t){return{get:function(){return w(this)[e]()},set:t&&function(e){return w(this)[t](e)},configurable:!0,enumerable:!0}};if(o&&(c(Fe,"href",Ne("serialize","setHref")),c(Fe,"origin",Ne("getOrigin")),c(Fe,"protocol",Ne("getProtocol","setProtocol")),c(Fe,"username",Ne("getUsername","setUsername")),c(Fe,"password",Ne("getPassword","setPassword")),c(Fe,"host",Ne("getHost","setHost")),c(Fe,"hostname",Ne("getHostname","setHostname")),c(Fe,"port",Ne("getPort","setPort")),c(Fe,"pathname",Ne("getPathname","setPathname")),c(Fe,"search",Ne("getSearch","setSearch")),c(Fe,"searchParams",Ne("getSearchParams")),c(Fe,"hash",Ne("getHash","setHash"))),d(Fe,"toJSON",(function(){return w(this).serialize()}),{enumerable:!0}),d(Fe,"toString",(function(){return w(this).serialize()}),{enumerable:!0}),L){var Ve=L.createObjectURL,je=L.revokeObjectURL;Ve&&d($e,"createObjectURL",l(Ve,L)),je&&d($e,"revokeObjectURL",l(je,L))}y($e,"URL"),r({global:!0,constructor:!0,forced:!a,sham:!o},{URL:$e})},4233:(e,t,i)=>{var n=i(6458),r=i(2809),o=i(9211),a=i(4347),s=i(9646),l=i(6656).CONFIGURABLE,A=i(3732),d=i(3587),c=d.enforce,u=d.get,h=String,p=Object.defineProperty,f=n("".slice),_=n("".replace),m=n([].join),v=s&&!r((function(){return 8!==p((function(){}),"length",{value:8}).length})),g=String(String).split("String"),y=e.exports=function(e,t,i){"Symbol("===f(h(t),0,7)&&(t="["+_(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!a(e,"name")||l&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&a(i,"arity")&&e.length!==i.arity&&p(e,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=c(e);return a(n,"source")||(n.source=m(g,"string"==typeof t?t:"")),e};Function.prototype.toString=y((function(){return o(this)&&u(this).source||A(this)}),"toString")},4346:(e,t,i)=>{var n=i(2809),r=i(9211),o=/#|\.prototype\./,a=function(e,t){var i=l[s(e)];return i===d||i!==A&&(r(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},A=a.NATIVE="N",d=a.POLYFILL="P";e.exports=a},4347:(e,t,i)=>{var n=i(6458),r=i(9083),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},4383:(e,t,i)=>{i.d(t,{Al:()=>o,Qn:()=>s,Xu:()=>l,j4:()=>a});var n,r=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=function(){function e(e){this.name="RuntimeException",this._message=e}return Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),a=function(e){function t(t){var i=e.call(this,t)||this;return i.name="IllegalStateException",i}return r(t,e),t}(o),s=function(e){function t(t){var i=e.call(this,t)||this;return i.name="InvalidArgumentException",i}return r(t,e),t}(o),l=function(e){function t(t){var i=e.call(this,t)||this;return i.name="NotImplementedException",i}return r(t,e),t}(o)},4417:(e,t,i)=>{var n=i(6458),r=i(4685),o=i(6677),a=i(5840),s=n("".charAt),l=n("".charCodeAt),A=n("".slice),d=function(e){return function(t,i){var n,d,c=o(a(t)),u=r(i),h=c.length;return u<0||u>=h?e?"":void 0:(n=l(c,u))<55296||n>56319||u+1===h||(d=l(c,u+1))<56320||d>57343?e?s(c,u):n:e?A(c,u,u+2):d-56320+(n-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},4468:(e,t,i)=>{var n=i(1562),r=i(9211),o=n.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},4478:(e,t,i)=>{var n=i(7042),r=i(815),o=i(9083),a=i(5957),s=i(2915),l=i(2671),A=i(256),d=i(8286),c=i(279),u=i(9273),h=Array;e.exports=function(e){var t=o(e),i=l(this),p=arguments.length,f=p>1?arguments[1]:void 0,_=void 0!==f;_&&(f=n(f,p>2?arguments[2]:void 0));var m,v,g,y,b,E,S=u(t),C=0;if(!S||this===h&&s(S))for(m=A(t),v=i?new this(m):h(m);m>C;C++)E=_?f(t[C],C):t[C],d(v,C,E);else for(v=i?new this:[],b=(y=c(t,S)).next;!(g=r(b,y)).done;C++)E=_?a(y,f,[g.value,C],!0):g.value,d(v,C,E);return v.length=C,v}},4579:(e,t,i)=>{var n=i(9364),r=i(6458),o=i(7024),a=RangeError,s=String.fromCharCode,l=String.fromCodePoint,A=r([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,i=[],n=arguments.length,r=0;n>r;){if(t=+arguments[r++],o(t,1114111)!==t)throw new a(t+" is not a valid code point");i[r]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return A(i,"")}})},4659:(e,t,i)=>{var n=i(9364),r=i(9646),o=i(3643).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!r},{defineProperty:o})},4685:(e,t,i)=>{var n=i(9879);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},4715:(e,t,i)=>{var n=i(5057);e.exports=n("document","documentElement")},4742:(e,t,i)=>{var n=i(9364),r=i(1684).left,o=i(5888),a=i(4941);n({target:"Array",proto:!0,forced:!i(3479)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return r(this,e,t,t>1?arguments[1]:void 0)}})},4879:(e,t,i)=>{var n=i(1562),r=i(9402),o=i(62),a=i(2578),s=i(9277),l=i(1541),A=i(7553)("iterator"),d=a.values,c=function(e,t){if(e){if(e[A]!==d)try{s(e,A,d)}catch(t){e[A]=d}if(l(e,t,!0),r[t])for(var i in a)if(e[i]!==a[i])try{s(e,i,a[i])}catch(t){e[i]=a[i]}}};for(var u in r)c(n[u]&&n[u].prototype,u);c(o,"DOMTokenList")},4884:(e,t,i)=>{var n=i(526),r=i(2719),o=i(2630).f,a=i(8626),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===n(e)?function(e){try{return o(e)}catch(e){return a(s)}}(e):o(r(e))}},4941:(e,t,i)=>{var n,r,o=i(1562),a=i(8053),s=o.process,l=o.Deno,A=s&&s.versions||l&&l.version,d=A&&A.v8;d&&(r=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},4955:(e,t,i)=>{var n=i(6458),r=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",l=RangeError,A=n(a.exec),d=Math.floor,c=String.fromCharCode,u=n("".charCodeAt),h=n([].join),p=n([].push),f=n("".replace),_=n("".split),m=n("".toLowerCase),v=function(e){return e+22+75*(e<26)},g=function(e,t,i){var n=0;for(e=i?d(e/700):e>>1,e+=d(e/t);e>455;)e=d(e/35),n+=36;return d(n+36*e/(e+38))},y=function(e){var t=[];e=function(e){for(var t=[],i=0,n=e.length;i<n;){var r=u(e,i++);if(r>=55296&&r<=56319&&i<n){var o=u(e,i++);56320==(64512&o)?p(t,((1023&r)<<10)+(1023&o)+65536):(p(t,r),i--)}else p(t,r)}return t}(e);var i,n,o=e.length,a=128,A=0,f=72;for(i=0;i<e.length;i++)(n=e[i])<128&&p(t,c(n));var _=t.length,m=_;for(_&&p(t,"-");m<o;){var y=r;for(i=0;i<e.length;i++)(n=e[i])>=a&&n<y&&(y=n);var b=m+1;if(y-a>d((r-A)/b))throw new l(s);for(A+=(y-a)*b,a=y,i=0;i<e.length;i++){if((n=e[i])<a&&++A>r)throw new l(s);if(n===a){for(var E=A,S=36;;){var C=S<=f?1:S>=f+26?26:S-f;if(E<C)break;var w=E-C,T=36-C;p(t,c(v(C+w%T))),E=d(w/T),S+=36}p(t,c(v(E))),f=g(A,b,m===_),A=0,m++}}A++,a++}return h(t,"")};e.exports=function(e){var t,i,n=[],r=_(f(m(e),a,"."),".");for(t=0;t<r.length;t++)i=r[t],p(n,A(o,i)?"xn--"+y(i):i);return h(n,".")}},4979:(e,t,i)=>{var n=i(7042),r=i(6458),o=i(5273),a=i(9083),s=i(256),l=i(2807),A=r([].push),d=function(e){var t=1===e,i=2===e,r=3===e,d=4===e,c=6===e,u=7===e,h=5===e||c;return function(p,f,_,m){for(var v,g,y=a(p),b=o(y),E=s(b),S=n(f,_),C=0,w=m||l,T=t?w(p,E):i||u?w(p,0):void 0;E>C;C++)if((h||C in b)&&(g=S(v=b[C],C,y),e))if(t)T[C]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return C;case 2:A(T,v)}else switch(e){case 4:return!1;case 7:A(T,v)}return c?-1:r||d?d:T}};e.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6),filterReject:d(7)}},4985:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},5057:(e,t,i)=>{var n=i(1562),r=i(9211);e.exports=function(e,t){return arguments.length<2?(i=n[e],r(i)?i:void 0):n[e]&&n[e][t];var i}},5273:(e,t,i)=>{var n=i(6458),r=i(2809),o=i(526),a=Object,s=n("".split);e.exports=r((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},5307:e=>{var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,A,d=this._events[s],c=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),c){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,r),!0;case 5:return d.fn.call(d.context,t,n,r,o),!0;case 6:return d.fn.call(d.context,t,n,r,o,a),!0}for(A=1,l=new Array(c-1);A<c;A++)l[A-1]=arguments[A];d.fn.apply(d.context,l)}else{var u,h=d.length;for(A=0;A<h;A++)switch(d[A].once&&this.removeListener(e,d[A].fn,void 0,!0),c){case 1:d[A].fn.call(d[A].context);break;case 2:d[A].fn.call(d[A].context,t);break;case 3:d[A].fn.call(d[A].context,t,n);break;case 4:d[A].fn.call(d[A].context,t,n,r);break;default:if(!l)for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];d[A].fn.apply(d[A].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var l=0,A=[],d=s.length;l<d;l++)(s[l].fn!==t||r&&!s[l].once||n&&s[l].context!==n)&&A.push(s[l]);A.length?this._events[o]=1===A.length?A[0]:A:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s},5336:(e,t,i)=>{var n=i(9364),r=i(6458),o=i(5273),a=i(2719),s=i(5888),l=r([].join);n({target:"Array",proto:!0,forced:o!==Object||!s("join",",")},{join:function(e){return l(a(this),void 0===e?",":e)}})},5347:(e,t,i)=>{var n=i(9364),r=i(2377);n({target:"Array",proto:!0,forced:[].forEach!==r},{forEach:r})},5405:(e,t,i)=>{var n=i(9211),r=i(4152),o=i(6641);e.exports=function(e,t,i){var a,s;return o&&n(a=t.constructor)&&a!==i&&r(s=a.prototype)&&s!==i.prototype&&o(e,s),e}},5597:(e,t,i)=>{var n=i(9364),r=i(9377);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},5599:e=>{e.exports=function(e){return null==e}},5716:(e,t,i)=>{var n=i(6458),r=i(9083),o=Math.floor,a=n("".charAt),s=n("".replace),l=n("".slice),A=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,d=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,n,c,u){var h=i+e.length,p=n.length,f=d;return void 0!==c&&(c=r(c),f=A),s(u,f,(function(r,s){var A;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,i);case"'":return l(t,h);case"<":A=c[l(s,1,-1)];break;default:var d=+s;if(0===d)return r;if(d>p){var u=o(d/10);return 0===u?r:u<=p?void 0===n[u-1]?a(s,1):n[u-1]+a(s,1):r}A=n[d-1]}return void 0===A?"":A}))}},5727:(e,t,i)=>{var n=i(5057),r=i(9211),o=i(9615),a=i(9742),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&o(t.prototype,s(e))}},5736:(e,t,i)=>{var n=i(9211),r=i(4985),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(r(e)+" is not a function")}},5758:(e,t,i)=>{var n=i(9364),r=i(4979).filter;n({target:"Array",proto:!0,forced:!i(8611)("filter")},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},5810:(e,t,i)=>{var n=i(526);e.exports=Array.isArray||function(e){return"Array"===n(e)}},5840:(e,t,i)=>{var n=i(5599),r=TypeError;e.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}},5888:(e,t,i)=>{var n=i(2809);e.exports=function(e,t){var i=[][e];return!!i&&n((function(){i.call(null,t||function(){return 1},1)}))}},5957:(e,t,i)=>{var n=i(7749),r=i(8401);e.exports=function(e,t,i,o){try{return o?t(n(i)[0],i[1]):t(i)}catch(t){r(e,"throw",t)}}},5993:(e,t,i)=>{var n=i(1562),r=i(8053),o=i(526),a=function(e){return r.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},6033:(e,t,i)=>{var n=i(1562);i(1541)(n.JSON,"JSON",!0)},6041:(e,t,i)=>{i(7267),i(804),i(1766),i(3992),i(947)},6071:(e,t,i)=>{var n=i(9646),r=i(2809),o=i(1465);e.exports=!n&&!r((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},6122:(e,t,i)=>{var n,r=i(7749),o=i(7815),a=i(6853),s=i(7923),l=i(4715),A=i(1465),d=i(577),c="prototype",u="script",h=d("IE_PROTO"),p=function(){},f=function(e){return"<"+u+">"+e+"</"+u+">"},_=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;m="undefined"!=typeof document?document.domain&&n?_(n):(t=A("iframe"),i="java"+u+":",t.style.display="none",l.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):_(n);for(var r=a.length;r--;)delete m[c][a[r]];return m()};s[h]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[c]=r(e),i=new p,p[c]=null,i[h]=e):i=m(),void 0===t?i:o.f(i,t)}},6263:(e,t,i)=>{var n=i(6656).PROPER,r=i(3930),o=i(7749),a=i(6677),s=i(2809),l=i(1144),A="toString",d=RegExp.prototype,c=d[A],u=s((function(){return"/a/b"!==c.call({source:"a",flags:"b"})})),h=n&&c.name!==A;(u||h)&&r(d,A,(function(){var e=o(this);return"/"+a(e.source)+"/"+a(l(e))}),{unsafe:!0})},6285:(e,t,i)=>{var n=i(1562);e.exports=n},6288:(e,t,i)=>{var n=i(2809),r=i(1562).RegExp;e.exports=n((function(){var e=r("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},6330:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6383:(e,t,i)=>{var n=i(9364),r=i(1562);n({global:!0,forced:r.globalThis!==r},{globalThis:r})},6399:(e,t,i)=>{i.d(t,{A:()=>n});const n={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},6458:(e,t,i)=>{var n=i(6898),r=Function.prototype,o=r.call,a=n&&r.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},6641:(e,t,i)=>{var n=i(1432),r=i(4152),o=i(5840),a=i(1068);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return o(i),a(n),r(i)?(t?e(i,n):i.__proto__=n,i):i}}():void 0)},6656:(e,t,i)=>{var n=i(9646),r=i(4347),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=r(o,"name"),l=s&&"something"===function(){}.name,A=s&&(!n||n&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:A}},6666:(e,t,i)=>{var n=i(2809),r=i(7553),o=i(9646),a=i(9845),s=r("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),i.delete("a",2),i.delete("b",void 0),a&&(!e.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!t.size&&(a||!o)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},6677:(e,t,i)=>{var n=i(497),r=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}},6728:(e,t,i)=>{var n=i(815),r=i(9518),o=i(7749),a=i(5599),s=i(2420),l=i(6677),A=i(5840),d=i(452),c=i(9987),u=i(9260);r("match",(function(e,t,i){return[function(t){var i=A(this),r=a(t)?void 0:d(t,e);return r?n(r,t,i):new RegExp(t)[e](l(i))},function(e){var n=o(this),r=l(e),a=i(t,n,r);if(a.done)return a.value;if(!n.global)return u(n,r);var A=n.unicode;n.lastIndex=0;for(var d,h=[],p=0;null!==(d=u(n,r));){var f=l(d[0]);h[p]=f,""===f&&(n.lastIndex=c(r,s(n.lastIndex),A)),p++}return 0===p?null:h}]}))},6810:(e,t,i)=>{var n=i(4417).charAt,r=i(6677),o=i(3587),a=i(2382),s=i(1567),l="String Iterator",A=o.set,d=o.getterFor(l);a(String,"String",(function(e){A(this,{type:l,string:r(e),index:0})}),(function(){var e,t=d(this),i=t.string,r=t.index;return r>=i.length?s(void 0,!0):(e=n(i,r),t.index+=e.length,s(e,!1))}))},6815:(e,t,i)=>{var n=i(5057),r=i(7225),o=i(1541);r("toStringTag"),o(n("Symbol"),"Symbol")},6853:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6898:(e,t,i)=>{var n=i(2809);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6908:(e,t,i)=>{var n=i(815),r=i(9211),o=i(4152),a=TypeError;e.exports=function(e,t){var i,s;if("string"===t&&r(i=e.toString)&&!o(s=n(i,e)))return s;if(r(i=e.valueOf)&&!o(s=n(i,e)))return s;if("string"!==t&&r(i=e.toString)&&!o(s=n(i,e)))return s;throw new a("Can't convert object to primitive value")}},7024:(e,t,i)=>{var n=i(4685),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},7042:(e,t,i)=>{var n=i(458),r=i(5736),o=i(6898),a=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},7225:(e,t,i)=>{var n=i(6285),r=i(4347),o=i(605),a=i(3643).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});r(t,e)||a(t,e,{value:o.f(e)})}},7267:(e,t,i)=>{var n=i(9364),r=i(1562),o=i(815),a=i(6458),s=i(9845),l=i(9646),A=i(7917),d=i(2809),c=i(4347),u=i(9615),h=i(7749),p=i(2719),f=i(4151),_=i(6677),m=i(6330),v=i(6122),g=i(7642),y=i(2630),b=i(4884),E=i(7819),S=i(2897),C=i(3643),w=i(7815),T=i(7403),k=i(3930),L=i(1176),I=i(3463),O=i(577),B=i(7923),R=i(1002),x=i(7553),D=i(605),M=i(7225),P=i(4160),U=i(1541),$=i(3587),F=i(4979).forEach,N=O("hidden"),V="Symbol",j="prototype",Q=$.set,G=$.getterFor(V),z=Object[j],H=r.Symbol,W=H&&H[j],q=r.RangeError,K=r.TypeError,Y=r.QObject,X=S.f,Z=C.f,J=b.f,ee=T.f,te=a([].push),ie=I("symbols"),ne=I("op-symbols"),re=I("wks"),oe=!Y||!Y[j]||!Y[j].findChild,ae=function(e,t,i){var n=X(z,t);n&&delete z[t],Z(e,t,i),n&&e!==z&&Z(z,t,n)},se=l&&d((function(){return 7!==v(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?ae:Z,le=function(e,t){var i=ie[e]=v(W);return Q(i,{type:V,tag:e,description:t}),l||(i.description=t),i},Ae=function(e,t,i){e===z&&Ae(ne,t,i),h(e);var n=f(t);return h(i),c(ie,n)?(i.enumerable?(c(e,N)&&e[N][n]&&(e[N][n]=!1),i=v(i,{enumerable:m(0,!1)})):(c(e,N)||Z(e,N,m(1,v(null))),e[N][n]=!0),se(e,n,i)):Z(e,n,i)},de=function(e,t){h(e);var i=p(t),n=g(i).concat(pe(i));return F(n,(function(t){l&&!o(ce,i,t)||Ae(e,t,i[t])})),e},ce=function(e){var t=f(e),i=o(ee,this,t);return!(this===z&&c(ie,t)&&!c(ne,t))&&(!(i||!c(this,t)||!c(ie,t)||c(this,N)&&this[N][t])||i)},ue=function(e,t){var i=p(e),n=f(t);if(i!==z||!c(ie,n)||c(ne,n)){var r=X(i,n);return!r||!c(ie,n)||c(i,N)&&i[N][n]||(r.enumerable=!0),r}},he=function(e){var t=J(p(e)),i=[];return F(t,(function(e){c(ie,e)||c(B,e)||te(i,e)})),i},pe=function(e){var t=e===z,i=J(t?ne:p(e)),n=[];return F(i,(function(e){!c(ie,e)||t&&!c(z,e)||te(n,ie[e])})),n};A||(k(W=(H=function(){if(u(W,this))throw new K("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?_(arguments[0]):void 0,t=R(e),i=function(e){var n=void 0===this?r:this;n===z&&o(i,ne,e),c(n,N)&&c(n[N],t)&&(n[N][t]=!1);var a=m(1,e);try{se(n,t,a)}catch(e){if(!(e instanceof q))throw e;ae(n,t,a)}};return l&&oe&&se(z,t,{configurable:!0,set:i}),le(t,e)})[j],"toString",(function(){return G(this).tag})),k(H,"withoutSetter",(function(e){return le(R(e),e)})),T.f=ce,C.f=Ae,w.f=de,S.f=ue,y.f=b.f=he,E.f=pe,D.f=function(e){return le(x(e),e)},l&&(L(W,"description",{configurable:!0,get:function(){return G(this).description}}),s||k(z,"propertyIsEnumerable",ce,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!A,sham:!A},{Symbol:H}),F(g(re),(function(e){M(e)})),n({target:V,stat:!0,forced:!A},{useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),n({target:"Object",stat:!0,forced:!A,sham:!l},{create:function(e,t){return void 0===t?v(e):de(v(e),t)},defineProperty:Ae,defineProperties:de,getOwnPropertyDescriptor:ue}),n({target:"Object",stat:!0,forced:!A},{getOwnPropertyNames:he}),P(),U(H,V),B[N]=!0},7403:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},7477:(e,t,i)=>{var n=i(8635),r=i(9953),o=i(550),a=null,s=function(e,t){self.postMessage({msg:"logcat_callback",data:{type:e,logcat:t}})};function l(e,t){var i={msg:o.A.INIT_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function A(e,t){var i={msg:o.A.MEDIA_SEGMENT,data:{type:e,data:t}};self.postMessage(i,[t.data])}function d(){var e={msg:o.A.LOADING_COMPLETE};self.postMessage(e)}function c(){var e={msg:o.A.RECOVERED_EARLY_EOF};self.postMessage(e)}function u(e){var t={msg:o.A.MEDIA_INFO,data:e};self.postMessage(t)}function h(e){var t={msg:o.A.METADATA_ARRIVED,data:e};self.postMessage(t)}function p(e){var t={msg:o.A.SCRIPTDATA_ARRIVED,data:e};self.postMessage(t)}function f(e){var t={msg:o.A.TIMED_ID3_METADATA_ARRIVED,data:e};self.postMessage(t)}function _(e){var t={msg:o.A.SMPTE2038_METADATA_ARRIVED,data:e};self.postMessage(t)}function m(e){var t={msg:o.A.SCTE35_METADATA_ARRIVED,data:e};self.postMessage(t)}function v(e){var t={msg:o.A.PES_PRIVATE_DATA_DESCRIPTOR,data:e};self.postMessage(t)}function g(e){var t={msg:o.A.PES_PRIVATE_DATA_ARRIVED,data:e};self.postMessage(t)}function y(e){var t={msg:o.A.STATISTICS_INFO,data:e};self.postMessage(t)}function b(e,t){self.postMessage({msg:o.A.IO_ERROR,data:{type:e,info:t}})}function E(e,t){self.postMessage({msg:o.A.DEMUX_ERROR,data:{type:e,info:t}})}function S(e){self.postMessage({msg:o.A.RECOMMEND_SEEKPOINT,data:e})}self.addEventListener("message",(function(e){switch(e.data.cmd){case"init":(a=new r.A(e.data.param[0],e.data.param[1])).on(o.A.IO_ERROR,b),a.on(o.A.DEMUX_ERROR,E),a.on(o.A.INIT_SEGMENT,l),a.on(o.A.MEDIA_SEGMENT,A),a.on(o.A.LOADING_COMPLETE,d),a.on(o.A.RECOVERED_EARLY_EOF,c),a.on(o.A.MEDIA_INFO,u),a.on(o.A.METADATA_ARRIVED,h),a.on(o.A.SCRIPTDATA_ARRIVED,p),a.on(o.A.TIMED_ID3_METADATA_ARRIVED,f),a.on(o.A.SMPTE2038_METADATA_ARRIVED,_),a.on(o.A.SCTE35_METADATA_ARRIVED,m),a.on(o.A.PES_PRIVATE_DATA_DESCRIPTOR,v),a.on(o.A.PES_PRIVATE_DATA_ARRIVED,g),a.on(o.A.STATISTICS_INFO,y),a.on(o.A.RECOMMEND_SEEKPOINT,S);break;case"destroy":a&&(a.destroy(),a=null),self.postMessage({msg:"destroyed"});break;case"start":null==a||a.start();break;case"stop":null==a||a.stop();break;case"seek":null==a||a.seek(e.data.param);break;case"pause":null==a||a.pause();break;case"resume":null==a||a.resume();break;case"logging_config":var t=e.data.param;n.A.applyConfig(t),!0===t.enableCallback?n.A.addLogListener(s):n.A.removeLogListener(s)}}))},7478:(e,t,i)=>{var n=i(4347),r=i(1209),o=i(2897),a=i(3643);e.exports=function(e,t,i){for(var s=r(t),l=a.f,A=o.f,d=0;d<s.length;d++){var c=s[d];n(e,c)||i&&n(i,c)||l(e,c,A(t,c))}}},7517:(e,t,i)=>{var n=i(2809),r=i(1562).RegExp;e.exports=n((function(){var e=r(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},7553:(e,t,i)=>{var n=i(1562),r=i(3463),o=i(4347),a=i(1002),s=i(7917),l=i(9742),A=n.Symbol,d=r("wks"),c=l?A.for||A:A&&A.withoutSetter||a;e.exports=function(e){return o(d,e)||(d[e]=s&&o(A,e)?A[e]:c("Symbol."+e)),d[e]}},7642:(e,t,i)=>{var n=i(3430),r=i(6853);e.exports=Object.keys||function(e){return n(e,r)}},7677:(e,t,i)=>{var n=i(7749);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},7712:(e,t,i)=>{var n=i(1147).IteratorPrototype,r=i(6122),o=i(6330),a=i(1541),s=i(2327),l=function(){return this};e.exports=function(e,t,i,A){var d=t+" Iterator";return e.prototype=r(n,{next:o(+!A,i)}),a(e,d,!1,!0),s[d]=l,e}},7749:(e,t,i)=>{var n=i(4152),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(r(e)+" is not an object")}},7815:(e,t,i)=>{var n=i(9646),r=i(2792),o=i(3643),a=i(7749),s=i(2719),l=i(7642);t.f=n&&!r?Object.defineProperties:function(e,t){a(e);for(var i,n=s(t),r=l(t),A=r.length,d=0;A>d;)o.f(e,i=r[d++],n[i]);return e}},7819:(e,t)=>{t.f=Object.getOwnPropertySymbols},7917:(e,t,i)=>{var n=i(4941),r=i(2809),o=i(1562).String;e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},7923:e=>{e.exports={}},7955:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7958:(e,t,i)=>{var n=i(8891),r=i(815),o=i(6458),a=i(9518),s=i(2809),l=i(7749),A=i(9211),d=i(5599),c=i(4685),u=i(2420),h=i(6677),p=i(5840),f=i(9987),_=i(452),m=i(5716),v=i(9260),g=i(7553)("replace"),y=Math.max,b=Math.min,E=o([].concat),S=o([].push),C=o("".indexOf),w=o("".slice),T="$0"==="a".replace(/./,"$0"),k=!!/./[g]&&""===/./[g]("a","$0");a("replace",(function(e,t,i){var o=k?"$":"$0";return[function(e,i){var n=p(this),o=d(e)?void 0:_(e,g);return o?r(o,e,n,i):r(t,h(n),e,i)},function(e,r){var a=l(this),s=h(e);if("string"==typeof r&&-1===C(r,o)&&-1===C(r,"$<")){var d=i(t,a,s,r);if(d.done)return d.value}var p=A(r);p||(r=h(r));var _,g=a.global;g&&(_=a.unicode,a.lastIndex=0);for(var T,k=[];null!==(T=v(a,s))&&(S(k,T),g);)""===h(T[0])&&(a.lastIndex=f(s,u(a.lastIndex),_));for(var L,I="",O=0,B=0;B<k.length;B++){for(var R,x=h((T=k[B])[0]),D=y(b(c(T.index),s.length),0),M=[],P=1;P<T.length;P++)S(M,void 0===(L=T[P])?L:String(L));var U=T.groups;if(p){var $=E([x],M,D,s);void 0!==U&&S($,U),R=h(n(r,void 0,$))}else R=m(x,s,D,M,U,r);D>=O&&(I+=w(s,O,D)+R,O=D+x.length)}return I+w(s,O)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!T||k)},8053:(e,t,i)=>{var n=i(1562).navigator,r=n&&n.userAgent;e.exports=r?String(r):""},8098:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(2460);const r=function(){function e(){var e;this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,(null===(e=self.performance)||void 0===e?void 0:e.now)?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0===e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}();var o,a=i(9034),s=i(8870),l=i(4383),A=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});const d=function(e){function t(t,i){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._abortController=null,n._contentLength=null,n._receivedLength=0,n}return A(t,e),t.isSupported=function(){var e;try{var t=s.A.msedge&&((null===(e=null===s.A||void 0===s.A?void 0:s.A.version)||void 0===e?void 0:e.minor)||0)>=15048&&!s.A.webkit,i=!s.A.msedge||t;return self.fetch&&self.ReadableStream&&i}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t),o=new self.Headers;if("object"==typeof r.headers){var s=r.headers;for(var A in s)s.hasOwnProperty(A)&&o.append(A,s[A])}var d={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var A in this._config.headers)o.append(A,this._config.headers[A]);e.cors||(d.mode="same-origin"),e.withCredentials&&(d.credentials="include"),(null==e?void 0:e.referrerPolicy)&&(d.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,this._abortController&&(d.signal=this._abortController.signal)),this._status=a.eO.kConnecting,self.fetch(r.url,d).then((function(e){var t,n;if(i._requestAbort)return i._status=a.eO.kIdle,void(null===(t=e.body)||void 0===t||t.cancel());if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&i._onURLRedirect){var o=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(o)}var s=e.headers.get("Content-Length");return null!=s&&(i._contentLength=parseInt(s),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,null===(n=e.body)||void 0===n?void 0:n.getReader())}if(i._status=a.eO.kError,!i._onError)throw new l.Al("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){var t;if(!(null===(t=i._abortController)||void 0===t?void 0:t.signal.aborted)){if(i._status=a.eO.kError,!i._onError)throw e;i._onError(a.Xv.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){var e;if(this._requestAbort=!0,(this._status!==a.eO.kBuffering||!s.A.chrome)&&this._abortController)try{null===(e=this._abortController)||void 0===e||e.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){var n,r,o,s;if(i.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=a.eO.kError;var A=a.Xv.EARLY_EOF,d={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new l.Al(d.msg);t._onError(A,d)}else t._status=a.eO.kComplete,t._onComplete&&t._onComplete((null===(n=t._range)||void 0===n?void 0:n.from)||0,((null===(r=t._range)||void 0===r?void 0:r.from)||0)+t._receivedLength-1);else{if(null===(o=t._abortController)||void 0===o?void 0:o.signal.aborted)return void(t._status=a.eO.kComplete);if(t._requestAbort)return t._status=a.eO.kComplete,e.cancel();t._status=a.eO.kBuffering;var c=i.value.buffer,u=((null===(s=t._range)||void 0===s?void 0:s.from)||0)+t._receivedLength;t._receivedLength+=c.byteLength,t._onDataArrival&&t._onDataArrival(c,u,t._receivedLength),t._pump(e)}})).catch((function(e){var i,n;if(null===(n=null===(i=t._abortController)||void 0===i?void 0:i.signal)||void 0===n?void 0:n.aborted)t._status=a.eO.kComplete;else if(11!==e.code||!s.A.msedge){t._status=a.eO.kError;var r=0,o=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(r=a.Xv.EXCEPTION,o={code:e.code,msg:e.message}):(r=a.Xv.EARLY_EOF,o={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new l.Al(o.msg);t._onError(r,o)}}))},t}(a.HC);var c=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const u=function(e){function t(t,i){var n=e.call(this,"xhr-moz-chunked-loader")||this;return n.TAG="MozChunkedLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._xhr=null,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return c(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return n.A.w("MozChunkedLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!==e.redirectedURL&&(i=e.redirectedURL);var n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="moz-chunked-arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onloadend=this._onLoadEnd.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var s in o)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s])}if("object"==typeof this._config.headers)for(var s in o=this._config.headers)o.hasOwnProperty(s)&&r.setRequestHeader(s,o[s]);this._status=a.eO.kConnecting,r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=a.eO.kComplete},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(void 0!==t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var i=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(i)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=a.eO.kError,!this._onError)throw new l.Al("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=a.eO.kBuffering}},t.prototype._onProgress=function(e){var t;if(this._status!==a.eO.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var i=e.target.response,n=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength)}},t.prototype._onLoadEnd=function(e){this._requestAbort?this._requestAbort=!1:this._status!==a.eO.kError&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var h=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const p=function(e){function t(t,i){var n=e.call(this,"xhr-range-loader")||this;return n.TAG="RangeLoader",n._seekHandler=t,n._config=i,n._needStash=!1,n._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],n._currentChunkSizeKB=384,n._currentSpeedNormalized=0,n._zeroSpeedChunkCount=0,n._xhr=null,n._speedSampler=new r,n._requestAbort=!1,n._waitForTotalLength=!1,n._totalLengthReceived=!1,n._currentRequestURL=null,n._currentRedirectedURL=null,n._currentRequestRange=null,n._totalLength=null,n._contentLength=null,n._receivedLength=0,n._lastTimeLoaded=0,n}return h(t,e),t.isSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return n.A.w("RangeLoader",e.message),!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),e.prototype.destroy.call(this)},Object.defineProperty(t.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),t.prototype.open=function(e,t){this._dataSource=e,this._range=t,this._status=a.eO.kConnecting;var i=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))},t.prototype._openSubRange=function(){var e,t,i=1024*this._currentChunkSizeKB,n=((null===(e=this._range)||void 0===e?void 0:e.from)||0)+this._receivedLength,r=n+i;null!=this._contentLength&&r-this._range.from>=this._contentLength&&(r=((null===(t=this._range)||void 0===t?void 0:t.from)||0)+this._contentLength-1),this._currentRequestRange={from:n,to:r},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var o=n.headers;for(var a in o)o.hasOwnProperty(a)&&r.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers)for(var a in o=this._config.headers)o.hasOwnProperty(a)&&r.setRequestHeader(a,o[a]);r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=a.eO.kComplete},t.prototype._internalAbort=function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=a.eO.kBuffering}else{if(this._status=a.eO.kError,!this._onError)throw new l.Al("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(a.Xv.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==a.eO.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=(this._totalLength||0)-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,o=i;if(e<t[0])return t[0];for(;r<=o;){if((n=r+Math.floor((o-r)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:o=n-1}},t.prototype._onLoad=function(e){if(this._status!==a.eO.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var n=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(n,r,this._receivedLength),o&&(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},t.prototype._onXhrError=function(e){this._status=a.eO.kError;var t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=a.Xv.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=a.Xv.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new l.Al(i.msg);this._onError(t,i)},t}(a.HC);var f=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const _=function(e){function t(t,i){var n=e.call(this,"websocket-loader")||this;return n.TAG="WebSocketLoader",n._needStash=!0,n._ws=null,n._requestAbort=!1,n._receivedLength=0,n}return f(t,e),t.isSupported=function(){try{return void 0!==self.WebSocket}catch(e){return!1}},t.prototype.destroy=function(){this._ws&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=a.eO.kConnecting}catch(e){this._status=a.eO.kError;var i={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(i.msg);this._onError(a.Xv.EXCEPTION,i)}},t.prototype.abort=function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=a.eO.kComplete},t.prototype._onWebSocketOpen=function(e){this._status=a.eO.kBuffering},t.prototype._onWebSocketClose=function(e){this._requestAbort?this._requestAbort=!1:(this._status=a.eO.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1))},t.prototype._onWebSocketMessage=function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var i=new FileReader;i.onload=function(){t._dispatchArrayBuffer(null==i?void 0:i.result)},i.readAsArrayBuffer(e.data)}else{this._status=a.eO.kError;var n={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new l.Al(n.msg);this._onError(a.Xv.EXCEPTION,n)}},t.prototype._dispatchArrayBuffer=function(e){var t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)},t.prototype._onWebSocketError=function(e){this._status=a.eO.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new l.Al(t.msg);this._onError(a.Xv.EXCEPTION,t)},t}(a.HC),m=function(){function e(e){this._zeroStart=e||!1}return e.prototype.getConfig=function(e,t){var i,n={};return 0!==t.from||-1!==t.to?(i=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),n.Range=i):this._zeroStart&&(n.Range="bytes=0-"),{url:e,headers:n}},e.prototype.removeURLParameters=function(e){return e},e}(),v=function(){function e(e,t){this._startName=e,this._endName=t}return e.prototype.getConfig=function(e,t){var i=e;if(0!==t.from||-1!==t.to){var n=!0;i.includes("?")||(i+="?",n=!1),n&&(i+="&"),i+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(i+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:i,headers:{}}},e.prototype.removeURLParameters=function(e){var t,i=e.split("?")[0],n=e.indexOf("?");-1!==n&&(t=e.substring(n+1));var r="";if(void 0!==t&&t.length>0)for(var o=t.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),l=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(r+="&"),r+=o[a])}return 0===r.length?i:i+"?"+r},e}(),g=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=65536,void 0!==t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,t.enableStashBuffer||(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url||""),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new r,this._speedNormalizeList=[32,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=function(){var e,t,i;(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&(null===(t=this._loader)||void 0===t||t.abort()),null===(i=this._loader)||void 0===i||i.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){var e;return(null===(e=this._loader)||void 0===e?void 0:e.isWorking())&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){var e;return null===(e=this._dataSource)||void 0===e?void 0:e.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){var e;return null!=this._redirectedURL||void 0!==(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){var e;return this._redirectedURL||(null===(e=this._dataSource)||void 0===e?void 0:e.redirectedURL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){var e,t;return this._loaderClass===p?null===(e=this._loader)||void 0===e?void 0:e.currentSpeed:null===(t=this._speedSampler)||void 0===t?void 0:t.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){var e;return null===(e=this._loader)||void 0===e?void 0:e.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new m(!!this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new v(t,i)}else{if("custom"!==e.seekType)throw new l.Qn("Invalid seekType in config: ".concat((null==e?void 0:e.seekType)||""));if("function"!=typeof e.customSeekHandler)throw new l.Qn("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){var e;if(null!=this._config.customLoader)this._loaderClass=(null===(e=this._config)||void 0===e?void 0:e.customLoader)||null;else if(this._isWebSocketURL)this._loaderClass=_;else if(d.isSupported())this._loaderClass=d;else if(u.isSupported())this._loaderClass=u;else{if(!p.isSupported())throw new l.Al("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=p}},e.prototype._createLoader=function(){var e;this._loaderClass&&(this._loader=new this._loaderClass(this._seekHandler,this._config),(null===(e=this._loader)||void 0===e?void 0:e.needStashBuffer)||(this._enableStash=!1),this._loader&&(this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)))},e.prototype.open=function(e){var t,i;this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),null===(t=this._speedSampler)||void 0===t||t.reset(),e||(this._fullRequestFlag=!0),null===(i=this._loader)||void 0===i||i.open(this._dataSource,Object.assign({},this._currentRange))},e.prototype.abort=function(){var e;null===(e=this._loader)||void 0===e||e.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=function(){var e,t;this.isWorking()&&(null===(e=this._loader)||void 0===e||e.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange&&(this._currentRange.to=this._stashByteStart-1)):this._resumeFrom=((null===(t=this._currentRange)||void 0===t?void 0:t.to)||0)+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){var i,n,r,o;(null===(i=this._loader)||void 0===i?void 0:i.isWorking())&&(null===(n=this._loader)||void 0===n||n.abort()),this._flushStashBuffer(t),null===(r=this._loader)||void 0===r||r.destroy(),this._loader=null;var a={from:e,to:-1};this._currentRange={from:a.from,to:-1},null===(o=this._speedSampler)||void 0===o||o.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,a),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new l.Qn("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var i=new ArrayBuffer(t);if(this._stashUsed>0){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,r=0,o=i;if(e<t[0])return t[0];for(;r<=o;){if((n=r+Math.floor((o-r)/2))===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?r=n+1:o=n-1}},e.prototype._adjustStashSize=function(e){var t=0;(t=this._config.isLive?e/8:e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t},e.prototype._dispatchChunks=function(e,t){return this._currentRange&&(this._currentRange.to=t+e.byteLength-1),this._onDataArrival?this._onDataArrival(e,t):0},e.prototype._onURLRedirect=function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)},e.prototype._onContentLengthKnown=function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)},e.prototype._onLoaderChunkArrival=function(e,t,i){var n,r;if(!this._onDataArrival)throw new l.j4("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),null===(n=this._speedSampler)||void 0===n||n.addBytes(e.byteLength);var o=null===(r=this._speedSampler)||void 0===r?void 0:r.lastSecondKBps;if(0!==o){var a=this._normalizeSpeed(o);this._speedNormalized!==a&&(this._speedNormalized=a,this._adjustStashSize(a))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize)(d=new Uint8Array(this._stashBuffer,0,this._stashSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;else if(d=new Uint8Array(this._stashBuffer,0,this._bufferSize),this._stashUsed>0){var s=this._stashBuffer.slice(0,this._stashUsed);(c=this._dispatchChunks(s,this._stashByteStart))<s.byteLength?c>0&&(u=new Uint8Array(s,c),d.set(u,0),this._stashUsed=u.byteLength,this._stashByteStart+=c):(this._stashUsed=0,this._stashByteStart+=c),this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),d=new Uint8Array(this._stashBuffer,0,this._bufferSize)),d.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else(c=this._dispatchChunks(e,t))<e.byteLength&&((A=e.byteLength-c)>this._bufferSize&&(this._expandBuffer(A),d=new Uint8Array(this._stashBuffer,0,this._bufferSize)),d.set(new Uint8Array(e,c),0),this._stashUsed+=A,this._stashByteStart=t+c);else if(0===this._stashUsed){var A;(c=this._dispatchChunks(e,t))<e.byteLength&&((A=e.byteLength-c)>this._bufferSize&&this._expandBuffer(A),(d=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,c),0),this._stashUsed+=A,this._stashByteStart=t+c)}else{var d,c;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(d=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(c=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))<this._stashUsed&&c>0){var u=new Uint8Array(this._stashBuffer,c);d.set(u,0)}this._stashUsed-=c,this._stashByteStart+=c}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),r=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){var o=new Uint8Array(this._stashBuffer,0,this._bufferSize),a=new Uint8Array(t,i);o.set(a,0),this._stashUsed=a.byteLength,this._stashByteStart+=i}return 0}n.A.w(this.TAG,"".concat(r," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,r}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){var i;switch(n.A.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=a.Xv.UNRECOVERABLE_EARLY_EOF),e){case a.Xv.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var r=((null===(i=this._currentRange)||void 0===i?void 0:i.to)||0)+1;return void(r<this._totalLength&&(n.A.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(r,!1)))}e=a.Xv.UNRECOVERABLE_EARLY_EOF;case a.Xv.UNRECOVERABLE_EARLY_EOF:case a.Xv.CONNECTING_TIMEOUT:case a.Xv.HTTP_STATUS_CODE_INVALID:case a.Xv.EXCEPTION:}if(!this._onError)throw new l.Al("IOException: "+t.msg);this._onError(e,t)},e}()},8125:(e,t,i)=>{var n=i(4347),r=i(9211),o=i(9083),a=i(577),s=i(8465),l=a("IE_PROTO"),A=Object,d=A.prototype;e.exports=s?A.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof A?d:null}},8286:(e,t,i)=>{var n=i(9646),r=i(3643),o=i(6330);e.exports=function(e,t,i){n?r.f(e,t,o(0,i)):e[t]=i}},8401:(e,t,i)=>{var n=i(815),r=i(7749),o=i(452);e.exports=function(e,t,i){var a,s;r(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw i;return i}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw i;if(s)throw a;return r(a),i}},8465:(e,t,i)=>{var n=i(2809);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},8587:(e,t,i)=>{var n=i(2809),r=i(1562).RegExp,o=n((function(){var e=r("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||n((function(){return!r("a","y").sticky})),s=o||n((function(){var e=r("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},8611:(e,t,i)=>{var n=i(2809),r=i(7553),o=i(4941),a=r("species");e.exports=function(e){return o>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},8626:(e,t,i)=>{var n=i(6458);e.exports=n([].slice)},8635:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(2139),r=i(2460);const o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return r.A.FORCE_GLOBAL_TAG},set:function(t){r.A.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return r.A.GLOBAL_TAG},set:function(t){r.A.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return r.A.ENABLE_VERBOSE&&r.A.ENABLE_DEBUG&&r.A.ENABLE_INFO&&r.A.ENABLE_WARN&&r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_VERBOSE=t,r.A.ENABLE_DEBUG=t,r.A.ENABLE_INFO=t,r.A.ENABLE_WARN=t,r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return r.A.ENABLE_DEBUG},set:function(t){r.A.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return r.A.ENABLE_VERBOSE},set:function(t){r.A.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return r.A.ENABLE_INFO},set:function(t){r.A.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return r.A.ENABLE_WARN},set:function(t){r.A.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return r.A.ENABLE_ERROR},set:function(t){r.A.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:r.A.GLOBAL_TAG,forceGlobalTag:r.A.FORCE_GLOBAL_TAG,enableVerbose:r.A.ENABLE_VERBOSE,enableDebug:r.A.ENABLE_DEBUG,enableInfo:r.A.ENABLE_INFO,enableWarn:r.A.ENABLE_WARN,enableError:r.A.ENABLE_ERROR,enableCallback:r.A.ENABLE_CALLBACK}},e.applyConfig=function(e){r.A.GLOBAL_TAG=e.globalTag,r.A.FORCE_GLOBAL_TAG=e.forceGlobalTag,r.A.ENABLE_VERBOSE=e.enableVerbose,r.A.ENABLE_DEBUG=e.enableDebug,r.A.ENABLE_INFO=e.enableInfo,r.A.ENABLE_WARN=e.enableWarn,r.A.ENABLE_ERROR=e.enableError,r.A.ENABLE_CALLBACK=!!e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){r.A.emitter.addListener("log",t),r.A.emitter.listenerCount("log")>0&&(r.A.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){r.A.emitter.removeListener("log",t),0===r.A.emitter.listenerCount("log")&&(r.A.ENABLE_CALLBACK=!1,e._notifyChange())},e.emitter=new n.A,e}()},8845:(e,t,i)=>{var n=i(9364),r=i(9646),o=i(1562),a=i(6458),s=i(4347),l=i(9211),A=i(9615),d=i(6677),c=i(1176),u=i(7478),h=o.Symbol,p=h&&h.prototype;if(r&&l(h)&&(!("description"in p)||void 0!==h().description)){var f={},_=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:d(arguments[0]),t=A(p,this)?new h(e):void 0===e?h():h(e);return""===e&&(f[t]=!0),t};u(_,h),_.prototype=p,p.constructor=_;var m="Symbol(description detection)"===String(h("description detection")),v=a(p.valueOf),g=a(p.toString),y=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),E=a("".slice);c(p,"description",{configurable:!0,get:function(){var e=v(this);if(s(f,e))return"";var t=g(e),i=m?E(t,7,-1):b(t,y,"$1");return""===i?void 0:i}}),n({global:!0,constructor:!0,forced:!0},{Symbol:_})}},8862:(e,t,i)=>{var n=i(1562),r=i(9402),o=i(62),a=i(2377),s=i(9277),l=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var A in r)r[A]&&l(n[A]&&n[A].prototype);l(o)},8870:(e,t,i)=>{i.d(t,{A:()=>r});var n={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.includes("trident")&&/(rv)(?::| )([\w.]+)/.exec(e)||!e.includes("compatible")&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},o={};if(r.browser){o[r.browser]=!0;var a=r.majorVersion.split(".");o.version={major:parseInt(r.majorVersion,10),string:r.version},a.length>1&&(o.version.minor=parseInt(a[1],10)),a.length>2&&(o.version.build=parseInt(a[2],10))}if(r.platform&&(o[r.platform]=!0),(o.chrome||o.opr||o.safari)&&(o.webkit=!0),o.rv||o.iemobile){o.rv&&delete o.rv;var s="msie";r.browser=s,o[s]=!0}if(o.edge){delete o.edge;var l="msedge";r.browser=l,o[l]=!0}if(o.opr){var A="opera";r.browser=A,o[A]=!0}if(o.safari&&o.android){var d="android";r.browser=d,o[d]=!0}for(var c in o.name=r.browser,o.platform=r.platform,n)Object.prototype.hasOwnProperty.call(n,c)&&delete n[c];Object.assign(n,o)}();const r=n},8873:(e,t,i)=>{var n=i(3930);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},8891:(e,t,i)=>{var n=i(6898),r=Function.prototype,o=r.apply,a=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},9034:(e,t,i)=>{i.d(t,{HC:()=>a,Xv:()=>o,eO:()=>r});var n=i(4383),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},o={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},a=function(){function e(e){this._type=e||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return e.prototype.destroy=function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},e.prototype.isWorking=function(){return this._status===r.kConnecting||this._status===r.kBuffering},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),e.prototype.open=function(e,t){throw new n.Xu("Unimplemented abstract function!")},e.prototype.abort=function(){throw new n.Xu("Unimplemented abstract function!")},e}()},9047:(e,t,i)=>{var n=i(5810),r=i(2671),o=i(4152),a=i(7553)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(r(t)&&(t===s||n(t.prototype))||o(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},9083:(e,t,i)=>{var n=i(5840),r=Object;e.exports=function(e){return r(n(e))}},9211:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},9260:(e,t,i)=>{var n=i(815),r=i(7749),o=i(9211),a=i(526),s=i(9377),l=TypeError;e.exports=function(e,t){var i=e.exec;if(o(i)){var A=n(i,e,t);return null!==A&&r(A),A}if("RegExp"===a(e))return n(s,e,t);throw new l("RegExp#exec called on incompatible receiver")}},9266:(e,t,i)=>{var n=i(7917);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},9273:(e,t,i)=>{var n=i(497),r=i(452),o=i(5599),a=i(2327),s=i(7553)("iterator");e.exports=function(e){if(!o(e))return r(e,s)||r(e,"@@iterator")||a[n(e)]}},9277:(e,t,i)=>{var n=i(9646),r=i(3643),o=i(6330);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},9364:(e,t,i)=>{var n=i(1562),r=i(2897).f,o=i(9277),a=i(3930),s=i(4191),l=i(7478),A=i(4346);e.exports=function(e,t){var i,d,c,u,h,p=e.target,f=e.global,_=e.stat;if(i=f?n:_?n[p]||s(p,{}):n[p]&&n[p].prototype)for(d in t){if(u=t[d],c=e.dontCallGetSet?(h=r(i,d))&&h.value:i[d],!A(f?d:p+(_?".":"#")+d,e.forced)&&void 0!==c){if(typeof u==typeof c)continue;l(u,c)}(e.sham||c&&c.sham)&&o(u,"sham",!0),a(i,d,u,e)}}},9377:(e,t,i)=>{var n,r,o=i(815),a=i(6458),s=i(6677),l=i(7677),A=i(8587),d=i(3463),c=i(6122),u=i(3587).get,h=i(7517),p=i(6288),f=d("native-string-replace",String.prototype.replace),_=RegExp.prototype.exec,m=_,v=a("".charAt),g=a("".indexOf),y=a("".replace),b=a("".slice),E=(r=/b*/g,o(_,n=/a/,"a"),o(_,r,"a"),0!==n.lastIndex||0!==r.lastIndex),S=A.BROKEN_CARET,C=void 0!==/()??/.exec("")[1];(E||C||S||h||p)&&(m=function(e){var t,i,n,r,a,A,d,h=this,p=u(h),w=s(e),T=p.raw;if(T)return T.lastIndex=h.lastIndex,t=o(m,T,w),h.lastIndex=T.lastIndex,t;var k=p.groups,L=S&&h.sticky,I=o(l,h),O=h.source,B=0,R=w;if(L&&(I=y(I,"y",""),-1===g(I,"g")&&(I+="g"),R=b(w,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==v(w,h.lastIndex-1))&&(O="(?: "+O+")",R=" "+R,B++),i=new RegExp("^(?:"+O+")",I)),C&&(i=new RegExp("^"+O+"$(?!\\s)",I)),E&&(n=h.lastIndex),r=o(_,L?i:h,R),L?r?(r.input=b(r.input,B),r[0]=b(r[0],B),r.index=h.lastIndex,h.lastIndex+=r[0].length):h.lastIndex=0:E&&r&&(h.lastIndex=h.global?r.index+r[0].length:n),C&&r&&r.length>1&&o(f,r[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r&&k)for(r.groups=A=c(null),a=0;a<k.length;a++)A[(d=k[a])[0]]=r[d[1]];return r}),e.exports=m},9402:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9518:(e,t,i)=>{i(5597);var n=i(815),r=i(3930),o=i(9377),a=i(2809),s=i(7553),l=i(9277),A=s("species"),d=RegExp.prototype;e.exports=function(e,t,i,c){var u=s(e),h=!a((function(){var t={};return t[u]=function(){return 7},7!==""[e](t)})),p=h&&!a((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[A]=function(){return i},i.flags="",i[u]=/./[u]),i.exec=function(){return t=!0,null},i[u](""),!t}));if(!h||!p||i){var f=/./[u],_=t(u,""[e],(function(e,t,i,r,a){var s=t.exec;return s===o||s===d.exec?h&&!a?{done:!0,value:n(f,t,i,r)}:{done:!0,value:n(e,i,t,r)}:{done:!1}}));r(String.prototype,e,_[0]),r(d,u,_[1])}c&&l(d[u],"sham",!0)}},9603:(e,t,i)=>{var n=i(5057),r=i(1176),o=i(7553),a=i(9646),s=o("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},9614:(e,t,i)=>{var n=i(3643).f;e.exports=function(e,t,i){i in e||n(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})}},9615:(e,t,i)=>{var n=i(6458);e.exports=n({}.isPrototypeOf)},9646:(e,t,i)=>{var n=i(2809);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9666:(e,t,i)=>{var n=i(4152),r=i(526),o=i(7553)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===r(e))}},9688:(e,t,i)=>{var n=i(9364),r=i(2809),o=i(5810),a=i(4152),s=i(9083),l=i(256),A=i(7955),d=i(8286),c=i(2807),u=i(8611),h=i(7553),p=i(4941),f=h("isConcatSpreadable"),_=p>=51||!r((function(){var e=[];return e[f]=!1,e.concat()[0]!==e})),m=function(e){if(!a(e))return!1;var t=e[f];return void 0!==t?!!t:o(e)};n({target:"Array",proto:!0,arity:1,forced:!_||!u("concat")},{concat:function(e){var t,i,n,r,o,a=s(this),u=c(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(m(o=-1===t?a:arguments[t]))for(r=l(o),A(h+r),i=0;i<r;i++,h++)i in o&&d(u,h,o[i]);else A(h+1),d(u,h++,o);return u.length=h,u}})},9695:(e,t,i)=>{var n=i(6458),r=i(5810),o=i(9211),a=i(526),s=i(6677),l=n([].push);e.exports=function(e){if(o(e))return e;if(r(e)){for(var t=e.length,i=[],n=0;n<t;n++){var A=e[n];"string"==typeof A?l(i,A):"number"!=typeof A&&"Number"!==a(A)&&"String"!==a(A)||l(i,s(A))}var d=i.length,c=!0;return function(e,t){if(c)return c=!1,t;if(r(this))return t;for(var n=0;n<d;n++)if(i[n]===e)return t}}}},9742:(e,t,i)=>{var n=i(7917);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9845:e=>{e.exports=!1},9879:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},9917:(e,t,i)=>{var n=i(9922),r=i(3930),o=i(309);n||r(Object.prototype,"toString",o,{unsafe:!0})},9922:(e,t,i)=>{var n={};n[i(7553)("toStringTag")]="z",e.exports="[object z]"===String(n)},9953:(e,t,i)=>{i.d(t,{A:()=>Me});var n=i(2139),r=i(2460),o=i(8870),a=i(719);function s(e,t,i){var n=e;if(t+i<n.length){for(;i--;)if(128!=(192&n[++t]))return!1;return!0}return!1}const l=function(e){for(var t=[],i=e,n=0,r=e.length;n<r;)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(s(i,n,1)&&(o=(31&i[n])<<6|63&i[n+1])>=128){t.push(String.fromCharCode(65535&o)),n+=2;continue}}else if(i[n]<240){if(s(i,n,2)&&(o=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2])>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),n+=3;continue}}else if(i[n]<248){var o;if(s(i,n,3)&&(o=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3])>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")};var A,d=i(4383),c=(A=new ArrayBuffer(2),new DataView(A).setInt16(0,256,!0),256===new Int16Array(A)[0]);const u=function(){function e(){}return e.parseScriptData=function(t,i,n){var o={};try{var a=e.parseValue(t,i,n),s=e.parseValue(t,i+a.size,n-a.size);o[a.data]=s.data}catch(e){r.A.e("AMF",e.toString())}return o},e.parseObject=function(t,i,n){if(n<3)throw new d.j4("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),o=e.parseValue(t,i+r.size,n-r.size),a=o.objectEnd;return{data:{name:r.data,value:o.data},size:r.size+o.size,objectEnd:a}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new d.j4("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!c);return{data:n>0?l(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new d.j4("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!c);return{data:n>0?l(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new d.j4("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!c),o=n.getInt16(8,!c);return{data:new Date(r+=60*o*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new d.j4("Data not enough when parse Value");var o,a=new DataView(t,i,n),s=1,l=a.getUint8(0),A=!1;try{switch(l){case 0:o=a.getFloat64(1,!c),s+=8;break;case 1:o=!!a.getUint8(1),s+=1;break;case 2:var u=e.parseString(t,i+1,n-1);o=u.data,s+=u.size;break;case 3:o={};var h=0;for(9==(16777215&a.getUint32(n-4,!c))&&(h=3);s<n-4;){var p=e.parseObject(t,i+s,n-s-h);if(p.objectEnd)break;o[p.data.name]=p.data.value,s+=p.size}s<=n-3&&9==(16777215&a.getUint32(s-1,!c))&&(s+=3);break;case 8:for(o={},s+=4,h=0,9==(16777215&a.getUint32(n-4,!c))&&(h=3);s<n-8;){var f=e.parseVariable(t,i+s,n-s-h);if(f.objectEnd)break;o[f.data.name]=f.data.value,s+=f.size}s<=n-3&&9==(16777215&a.getUint32(s-1,!c))&&(s+=3);break;case 9:o=void 0,s=1,A=!0;break;case 10:o=[];var _=a.getUint32(1,!c);s+=4;for(var m=0;m<_;m++){var v=e.parseValue(t,i+s,n-s);o.push(v.data),s+=v.size}break;case 11:var g=e.parseDate(t,i+1,n-1);o=g.data,s+=g.size;break;case 12:var y=e.parseString(t,i+1,n-1);o=y.data,s+=y.size;break;default:s=n,r.A.w("AMF","Unsupported AMF value type "+l.toString())}}catch(e){r.A.e("AMF",e.toString())}return{data:o,size:s,objectEnd:A}},e}(),h=function(){function e(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}return e.prototype.destroy=function(){this._buffer=null},e.prototype._fillCurrentWord=function(){var e,t=this._total_bytes-this._buffer_index;if(t<=0)throw new d.j4("ExpGolomb: _fillCurrentWord() but no bytes available");var i=Math.min(4,t),n=new Uint8Array(4);n.set(null===(e=this._buffer)||void 0===e?void 0:e.subarray(this._buffer_index,this._buffer_index+i)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=i,this._current_word_bits_left=8*i},e.prototype.readBits=function(e){if(e>32)throw new d.Qn("ExpGolomb: readBits() bits exceeded max 32bits!");if(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 n=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(n,this._current_word_bits_left),o=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,i<<r|o},e.prototype.readBool=function(){return 1===this.readBits(1)},e.prototype.readByte=function(){return this.readBits(8)},e.prototype._skipLeadingZero=function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),p=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){for(var i=t.subarray(1,4),n="avc1.",r=0;r<3;r++){var o=i[r].toString(16);o.length<2&&(o="0"+o),n+=o}var a=e._ebsp2rbsp(t),s=new h(a);s.readByte();var l=s.readByte();s.readByte();var A=s.readByte();s.readUEG();var d=e.getProfileString(l),c=e.getLevelString(A),u=1,p=420,f=8,_=8;if((100===l||110===l||122===l||244===l||44===l||83===l||86===l||118===l||128===l||138===l||144===l)&&(3===(u=s.readUEG())&&s.readBits(1),u<=3&&(p=[0,420,422,444][u]),f=s.readUEG()+8,_=s.readUEG()+8,s.readBits(1),s.readBool()))for(var m=3!==u?8:12,v=0;v<m;v++)s.readBool()&&(v<6?e._skipScalingList(s,16):e._skipScalingList(s,64));s.readUEG();var g=s.readUEG();if(0===g)s.readUEG();else if(1===g){s.readBits(1),s.readSEG(),s.readSEG();var y=s.readUEG();for(v=0;v<y;v++)s.readSEG()}var b=s.readUEG();s.readBits(1);var E=s.readUEG(),S=s.readUEG(),C=s.readBits(1);0===C&&s.readBits(1),s.readBits(1);var w=0,T=0,k=0,L=0;s.readBool()&&(w=s.readUEG(),T=s.readUEG(),k=s.readUEG(),L=s.readUEG());var I=1,O=1,B=0,R=!0,x=0,D=0;if(s.readBool()){if(s.readBool()){var M=s.readByte();M>0&&M<16?(I=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][M-1],O=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][M-1]):255===M&&(I=s.readByte()<<8|s.readByte(),O=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 P=s.readBits(32),U=s.readBits(32);R=s.readBool(),B=(x=U)/(D=2*P)}}var $=1;1===I&&1===O||($=I/O);var F=0,N=0;0===u?(F=1,N=2-C):(F=3===u?1:2,N=(1===u?2:1)*(2-C));var V=16*(E+1),j=16*(S+1)*(2-C);V-=(w+T)*F,j-=(k+L)*N;var Q=Math.ceil(V*$);return s.destroy(),s=null,{codec_mimetype:n,profile_idc:l,level_idc:A,profile_string:d,level_string:c,chroma_format_idc:u,bit_depth:f,bit_depth_luma:f,bit_depth_chroma:_,ref_frames:b,chroma_format:p,chroma_format_string:e.getChromaFormatString(p),frame_rate:{fixed:R,fps:B,fps_den:D,fps_num:x},sar_ratio:{width:I,height:O},codec_size:{width:V,height:j},present_size:{width:Q,height:j}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0;r<t;r++)0!==n&&(n=(i+e.readSEG()+256)%256),i=0===n?i:n},e.getProfileString=function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}},e.getLevelString=function(e){return(e/10).toFixed(1)},e.getChromaFormatString=function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},e}();var f=i(6399);const _=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,o=0;o<i;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(n[r]=t[o],r++);return new Uint8Array(n.buffer,0,r)},e.parseVPS=function(t){var i=e._ebsp2rbsp(t),n=new h(i);return n.readByte(),n.readByte(),n.readBits(4),n.readBits(2),n.readBits(6),{num_temporal_layers:n.readBits(3)+1,temporal_id_nested:n.readBool()}},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new h(i);n.readByte(),n.readByte();for(var r=0,o=0,a=0,s=0,l=(n.readBits(4),n.readBits(3)),A=(n.readBool(),n.readBits(2)),d=n.readBool(),c=n.readBits(5),u=n.readByte(),p=n.readByte(),f=n.readByte(),_=n.readByte(),m=n.readByte(),v=n.readByte(),g=n.readByte(),y=n.readByte(),b=n.readByte(),E=n.readByte(),S=n.readByte(),C=[],w=[],T=0;T<l;T++)C.push(n.readBool()),w.push(n.readBool());if(l>0)for(T=l;T<8;T++)n.readBits(2);for(T=0;T<l;T++)C[T]&&(n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte(),n.readByte()),w[T]&&n.readByte();n.readUEG();var k=n.readUEG();3===k&&n.readBits(1);var L=n.readUEG(),I=n.readUEG();n.readBool()&&(r+=n.readUEG(),o+=n.readUEG(),a+=n.readUEG(),s+=n.readUEG());var O=n.readUEG(),B=n.readUEG(),R=n.readUEG();for(T=n.readBool()?0:l;T<=l;T++)n.readUEG(),n.readUEG(),n.readUEG();if(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readBool()&&n.readBool())for(var x=0;x<4;x++)for(var D=0;D<(3===x?2:6);D++)if(n.readBool()){var M=Math.min(64,1<<4+(x<<1));for(x>1&&n.readSEG(),T=0;T<M;T++)n.readSEG()}else n.readUEG();n.readBool(),n.readBool(),n.readBool()&&(n.readByte(),n.readUEG(),n.readUEG(),n.readBool());var P=n.readUEG(),U=0;for(T=0;T<P;T++){var $=!1;if(0!==T&&($=n.readBool()),$){T===P&&n.readUEG(),n.readBool(),n.readUEG();for(var F=0,N=0;N<=U;N++){var V=n.readBool(),j=!1;V||(j=n.readBool()),(V||j)&&F++}U=F}else{var Q=n.readUEG(),G=n.readUEG();for(U=Q+G,N=0;N<Q;N++)n.readUEG(),n.readBool();for(N=0;N<G;N++)n.readUEG(),n.readBool()}}if(n.readBool()){var z=n.readUEG();for(T=0;T<z;T++){for(N=0;N<R+4;N++)n.readBits(1);n.readBits(1)}}var H=0,W=1,q=1,K=!1,Y=1,X=1;if(n.readBool(),n.readBool(),n.readBool()){if(n.readBool()){var Z=n.readByte();Z>0&&Z<=16?(W=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][Z-1],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][Z-1]):255===Z&&(W=n.readBits(16),q=n.readBits(16))}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(3),n.readBool(),n.readBool()&&(n.readByte(),n.readByte(),n.readByte())),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool(),n.readBool(),n.readBool(),n.readBool()&&(n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG()),n.readBool()&&(Y=n.readBits(32),X=n.readBits(32),n.readBool()&&n.readUEG(),n.readBool())){var J,ee,te=!1;for(J=n.readBool(),ee=n.readBool(),(J||ee)&&((te=n.readBool())&&(n.readByte(),n.readBits(5),n.readBool(),n.readBits(5)),n.readBits(4),n.readBits(4),te&&n.readBits(4),n.readBits(5),n.readBits(5),n.readBits(5)),T=0;T<=l;T++){var ie=n.readBool();K=ie;var ne=!1,re=1;ie||(ne=n.readBool());var oe=!1;if(ne?n.readSEG():oe=n.readBool(),oe||(re=n.readUEG()+1),J)for(N=0;N<re;N++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG());if(ee)for(N=0;N<re;N++)n.readUEG(),n.readUEG(),te&&(n.readUEG(),n.readUEG())}}n.readBool()&&(n.readBool(),n.readBool(),n.readBool(),H=n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG(),n.readUEG())}n.readBool();var ae="hvc1.".concat(c,".1.L").concat(S,".B0"),se=L-(r+o)*(1===k||2===k?2:1),le=I-(a+s)*(1===k?2:1),Ae=1;return 1!==W&&1!==q&&(Ae=W/q),n.destroy(),n=null,{codec_mimetype:ae,level_string:e.getLevelString(S),profile_idc:c,bit_depth:O+8,ref_frames:1,chroma_format:k,chroma_format_string:e.getChromaFormatString(k),general_level_idc:S,general_profile_space:A,general_tier_flag:d,general_profile_idc:c,general_profile_compatibility_flags_1:u,general_profile_compatibility_flags_2:p,general_profile_compatibility_flags_3:f,general_profile_compatibility_flags_4:_,general_constraint_indicator_flags_1:m,general_constraint_indicator_flags_2:v,general_constraint_indicator_flags_3:g,general_constraint_indicator_flags_4:y,general_constraint_indicator_flags_5:b,general_constraint_indicator_flags_6:E,min_spatial_segmentation_idc:H,constant_frame_rate:0,chroma_format_idc:k,bit_depth_luma_minus8:O,bit_depth_chroma_minus8:B,frame_rate:{fixed:K,fps:X/Y,fps_den:Y,fps_num:X},sar_ratio:{width:W,height:q},codec_size:{width:se,height:le},present_size:{width:se*Ae,height:le}}},e.parsePPS=function(t){var i=e._ebsp2rbsp(t),n=new h(i);n.readByte(),n.readByte(),n.readUEG(),n.readUEG(),n.readBool(),n.readBool(),n.readBits(3),n.readBool(),n.readBool(),n.readUEG(),n.readUEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool()&&n.readUEG(),n.readSEG(),n.readSEG(),n.readBool(),n.readBool(),n.readBool(),n.readBool();var r=n.readBool(),o=n.readBool(),a=1;return o&&r?a=0:o?a=3:r&&(a=2),{parallelismType:a}},e.getChromaFormatString=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"}},e.getProfileString=function(e){switch(e){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}},e.getLevelString=function(e){return(e/30).toFixed(1)},e}();function m(e){return e.byteOffset%2==0&&e.byteLength%2==0}function v(e){return e.byteOffset%4==0&&e.byteLength%4==0}function g(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const y=function(e,t){return e.byteLength===t.byteLength&&(v(e)&&v(t)?function(e,t){return g(new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4))}(e,t):m(e)&&m(t)?function(e,t){return g(new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2))}(e,t):function(e,t){return g(e,t)}(e,t))},b=function(){function e(){}return e.parseOBUs=function(t){for(var i=null,n=0;n<t.byteLength;){t[n];var r=(120&t[n])>>3,o=!!(4&t[n]),a=!!(2&t[n]);t[n],n+=1,o&&(n+=1);var s=Number.POSITIVE_INFINITY;if(a){s=0;for(var l=0;s|=(127&t[n])<<7*l,128&t[n+=1];l++);}1===r&&(i=e.parseSeuqneceHeader(t.subarray(n,n+s))),n+=s}return i},e.parseSeuqneceHeader=function(t){var i=new h(t),n=i.readBits(3),r=(i.readBool(),i.readBool()),o=!0,a=0,s=0,l=[];if(r)l.push({operating_point_idc:0,level:i.readBits(5),tier:0});else{if(i.readBool()){var A=i.readBits(32),d=i.readBits(32),c=i.readBool();if(c){for(var u=0;0===i.readBits(1);)u+=1;u>=32||i.readBits(u)}a=d,s=A,o=c,i.readBool()&&(i.readBits(5),i.readBits(32),i.readBits(5),i.readBits(5))}for(var p=i.readBool(),f=i.readBits(5),_=0;_<=f;_++){var m=i.readBits(12),v=i.readBits(5),g=v>7?i.readBits(1):0;l.push({operating_point_idc:m,level:v,tier:g}),p&&i.readBool()&&i.readBits(4)}}var y=l[0],b=y.level,E=y.tier,S=i.readBits(4),C=i.readBits(4),w=i.readBits(S+1)+1,T=i.readBits(C+1)+1,k=!1;r||(k=i.readBool()),k&&(i.readBits(4),i.readBits(4)),i.readBool(),i.readBool(),i.readBool();var L=!1;r||(i.readBool(),i.readBool(),i.readBool(),i.readBool(),(L=i.readBool())&&(i.readBool(),i.readBool()),(i.readBool()||i.readBits(1))&&(i.readBool()||i.readBits(1)),L&&i.readBits(3)),i.readBool(),i.readBool(),i.readBool();var I=i.readBool(),O=8;O=2===n&&I?i.readBool()?12:10:I?10:8;var B=!1;1!==n&&(B=i.readBool()),i.readBool()&&(i.readBits(8),i.readBits(8),i.readBits(8));var R=1,x=1;return B?(i.readBits(1),R=1,x=1):(i.readBits(1),0===n?(R=1,x=1):1===n?(R=0,x=0):12===O?i.readBits(1)&&i.readBits(1):(R=1,x=0),R&&x&&i.readBits(2),i.readBits(1)),i.readBool(),i.destroy(),i=null,{codec_mimetype:"av01.".concat(n,".").concat(e.getLevelString(b,E),".").concat(O.toString(10).padStart(2,"0")),level:b,tier:E,level_string:e.getLevelString(b,E),profile_idc:n,profile_string:"".concat(n),bit_depth:O,ref_frames:1,chroma_format:e.getChromaFormat(B,R,x),chroma_format_string:e.getChromaFormatString(B,R,x),frame_rate:{fixed:o,fps:a/s,fps_den:s,fps_num:a},sar_ratio:{width:1,height:1},codec_size:{width:w,height:T},present_size:{width:1*w,height:T}}},e.getLevelString=function(e,t){return"".concat(e.toString(10).padStart(2,"0")).concat(0===t?"M":"H")},e.getChromaFormat=function(e,t,i){return e?0:0===t&&0===i?3:1===t&&0===i?2:1===t&&1===i?1:Number.NaN},e.getChromaFormatString=function(e,t,i){return e?"4:0:0":0===t&&0===i?"4:4:4":1===t&&0===i?"4:2:2":1===t&&1===i?"4:2:0":"Unknown"},e}();var E=function(){function e(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new a.A,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return e.prototype.destroy=function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null},e.probe=function(e){var t=new Uint8Array(e);if(t.byteLength<9)return{needMoreData:!0};var i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;var n,r=(4&t[4])>>>2!=0,o=!!(1&t[4]),a=(n=t)[5]<<24|n[6]<<16|n[7]<<8|n[8];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:r,hasVideoTrack:o}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo&&(this._mediaInfo.duration=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo&&(this._mediaInfo.hasAudio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo&&(this._mediaInfo.hasVideo=e)},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new a.A},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){var n,o;if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new d.j4("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var a=0,s=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;var l=e.probe(t);a=(null==l?void 0:l.dataOffset)||0}for(this._firstParse&&(this._firstParse=!1,i+a!==this._dataOffset&&r.A.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(A=new DataView(t,a)).getUint32(0,!s)&&r.A.w(this.TAG,"PrevTagSize0 !== 0 !!!"),a+=4);a<t.byteLength;){this._dispatch=!0;var A=new DataView(t,a);if(a+11+4>t.byteLength)break;var c=A.getUint8(0),u=16777215&A.getUint32(0,!s);if(a+11+u+4>t.byteLength)break;if(8===c||9===c||18===c){var h=A.getUint8(4),p=A.getUint8(5),f=A.getUint8(6)|p<<8|h<<16|A.getUint8(7)<<24;16777215&A.getUint32(7,!s)&&r.A.w(this.TAG,"Meet tag which has StreamID != 0!");var _=a+11;switch(c){case 8:this._parseAudioData(t,_,u,f);break;case 9:this._parseVideoData(t,_,u,f,i+a);break;case 18:this._parseScriptData(t,_,u)}var m=A.getUint32(11+u,!s);m!==11+u&&r.A.w(this.TAG,"Invalid PrevTagSize ".concat(m)),a+=11+u+4}else r.A.w(this.TAG,"Unsupported tag type ".concat(c,", skipped")),a+=11+u+4}return this._isInitialMetadataDispatched()&&this._dispatch&&((null===(n=this._audioTrack)||void 0===n?void 0:n.length)||(null===(o=this._videoTrack)||void 0===o?void 0:o.length))&&this._onDataAvailable(this._audioTrack,this._videoTrack),a},e.prototype._parseScriptData=function(e,t,i){var n,o,a,s=u.parseScriptData(e,t,i);if(s.hasOwnProperty("onMetaData")){if(null==s.onMetaData||"object"!=typeof s.onMetaData)return void r.A.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&r.A.w(this.TAG,"Found another onMetaData tag!"),this._metadata=s;var l=null===(n=this._metadata)||void 0===n?void 0:n.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},l)),"boolean"==typeof(null==l?void 0:l.hasAudio)&&(this._hasAudioFlagOverrided||(this._hasAudio=l.hasAudio,this._mediaInfo&&(this._mediaInfo.hasAudio=this._hasAudio))),"boolean"==typeof(null==l?void 0:l.hasVideo)&&(this._hasVideoFlagOverrided||(this._hasVideo=l.hasVideo,this._mediaInfo&&(this._mediaInfo.hasVideo=this._hasVideo))),"number"==typeof(null==l?void 0:l.audiodatarate)&&this._mediaInfo&&(this._mediaInfo.audioDataRate=l.audiodatarate),"number"==typeof(null==l?void 0:l.videodatarate)&&this._mediaInfo&&(this._mediaInfo.videoDataRate=l.videodatarate),"number"==typeof(null==l?void 0:l.width)&&this._mediaInfo&&(this._mediaInfo.width=l.width),"number"==typeof(null==l?void 0:l.height)&&this._mediaInfo&&(this._mediaInfo.height=l.height),"number"==typeof(null==l?void 0:l.duration)){if(!this._durationOverrided){var A=Math.floor(l.duration*this._timescale);this._duration=A,this._mediaInfo&&(this._mediaInfo.duration=A)}}else this._mediaInfo&&(this._mediaInfo.duration=0);if("number"==typeof(null==l?void 0:l.framerate)){var d=Math.floor(1e3*l.framerate);if(d>0){var c=d/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=c,this._referenceFrameRate.fps_num=d,this._referenceFrameRate.fps_den=1e3,this._mediaInfo&&(this._mediaInfo.fps=c)}}if("object"==typeof(null==l?void 0:l.keyframes)){this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!0);var h=l.keyframes;this._mediaInfo&&(this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h)),l.keyframes=null}else this._mediaInfo&&(this._mediaInfo.hasKeyframesIndex=!1);this._dispatch=!1,this._mediaInfo&&(this._mediaInfo.metadata=l),r.A.v(this.TAG,"Parsed onMetaData"),(null===(o=this._mediaInfo)||void 0===o?void 0:o.isComplete())&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,this._mediaInfo))}Object.keys(s).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},s))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n<e.times.length;n++){var r=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(r),i.push(e.filepositions[n])}return{times:t,filepositions:i}},e.prototype._parseAudioData=function(e,t,i,n){var o,a,s,l,A,d,c,u,h,p;if(i<=1)r.A.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var _=new DataView(e,t,i).getUint8(0),m=_>>>4;if(2===m||10===m){var v=0,g=(12&_)>>>2;if(g>=0&&g<=4){v=this._flvSoundRateTable[g];var b=1&_,E=this._audioMetadata,S=this._audioTrack;if(E||(!1!==this._hasAudio||this._hasAudioFlagOverrided||(this._hasAudio=!0,this._mediaInfo&&(this._mediaInfo.hasAudio=!0)),(E=this._audioMetadata={}).type="audio",E.id=null==S?void 0:S.id,E.timescale=this._timescale,E.duration=this._duration,E.audioSampleRate=v,E.channelCount=0===b?1:2),10===m){var C=this._parseAACAudioData(e,t+1,i-1);if(void 0===C)return;if(0===(null==C?void 0:C.packetType)){if(null==E?void 0:E.config){if(y(C.data.config,null==E?void 0:E.config))return;r.A.w(this.TAG,"AudioSpecificConfig has been changed, re-generate initialization segment")}var w=C.data;E.audioSampleRate=null==w?void 0:w.samplingRate,E.channelCount=null==w?void 0:w.channelCount,E.codec=null==w?void 0:w.codec,E.originalCodec=null==w?void 0:w.originalCodec,E.config=null==w?void 0:w.config,E.refSampleDuration=1024/E.audioSampleRate*E.timescale,r.A.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"audio",E),(L=this._mediaInfo).audioCodec=E.originalCodec||"",L.audioSampleRate=E.audioSampleRate,L.audioChannelCount=E.channelCount,L.hasVideo?null!=L.videoCodec&&(L.mimeType='video/x-flv; codecs="'+L.videoCodec+","+L.audioCodec+'"'):L.mimeType='video/x-flv; codecs="'+L.audioCodec+'"',(null==L?void 0:L.isComplete())&&(null===(c=this._onMediaInfo)||void 0===c||c.call(this,L))}else if(1===C.packetType){var T=this._timestampBase+n,k={unit:C.data,length:C.data.byteLength,dts:T,pts:T};S&&(null==S||S.samples.push(k),S.length+=(null===(u=null==C?void 0:C.data)||void 0===u?void 0:u.length)||0)}else r.A.e(this.TAG,"Flv: Unsupported AAC data type ".concat(C.packetType))}else if(2===m){if(!E.codec){var L;if(void 0===(w=this._parseMP3AudioData(e,t+1,i-1,!0)))return;E.audioSampleRate=w.samplingRate,E.channelCount=w.channelCount,E.codec=w.codec,E.originalCodec=w.originalCodec,E.refSampleDuration=1152/E.audioSampleRate*E.timescale,r.A.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,null===(h=this._onTrackMetadata)||void 0===h||h.call(this,"audio",E),(L=this._mediaInfo).audioCodec=E.codec,L.audioSampleRate=E.audioSampleRate,L.audioChannelCount=E.channelCount,L.audioDataRate=w.bitRate,(null==L?void 0:L.hasVideo)?null!=L.videoCodec&&(L.mimeType='video/x-flv; codecs="'+L.videoCodec+","+L.audioCodec+'"'):L.mimeType='video/x-flv; codecs="'+L.audioCodec+'"',L.isComplete()&&(null===(p=this._onMediaInfo)||void 0===p||p.call(this,L))}var I=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0===I)return;T=this._timestampBase+n;var O={unit:I,length:I.byteLength,dts:T,pts:T};null==S||S.samples.push(O),S&&(S.length+=I.length)}}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+g)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+m)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var n={},o=new Uint8Array(e,t,i);return n.packetType=o[0],0===o[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=o.subarray(1),n}r.A.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,r,o,a,s=new Uint8Array(e,t,i),l=null,A=0,d=null;if(A=o=s[0]>>>3,(a=(7&s[0])<<1|s[1]>>>7)<0||a>=this._mpegSamplingRates.length)null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var c=this._mpegSamplingRates[a],u=(120&s[1])>>>3;if(!(u<0||u>=8)){5===A&&(d=(7&s[1])<<1|s[2]>>>7,s[2]);var h=self.navigator.userAgent.toLowerCase();return h.includes("firefox")?a>=6?(A=5,l=new Array(4),d=a-3):(A=2,l=new Array(2),d=a):h.includes("android")?(A=2,l=new Array(2),d=a):(A=5,d=a,l=new Array(4),a>=6?d=a-3:1===u&&(A=2,l=new Array(2),d=a)),l[0]=A<<3,l[0]|=(15&a)>>>1,l[1]=(15&a)<<7,l[1]|=(15&u)<<3,5===A&&(l[1]|=(15&d)>>>1,l[2]=(1&d)<<7,l[2]|=8,l[3]=0),{config:l,samplingRate:c,channelCount:u,codec:"mp4a.40."+A,originalCodec:"mp4a.40."+o}}null===(r=this._onError)||void 0===r||r.call(this,f.A.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(!(i<4)){this._littleEndian;var o,a=new Uint8Array(e,t,i);if(n){if(255!==a[0])return;var s=a[1]>>>3&3,l=(6&a[1])>>1,A=(240&a[2])>>>4,d=(12&a[2])>>>2,c=3&~(a[3]>>>6)?2:1,u=0,h=0;switch(s){case 0:u=this._mpegAudioV25SampleRateTable[d];break;case 2:u=this._mpegAudioV20SampleRateTable[d];break;case 3:u=this._mpegAudioV10SampleRateTable[d]}switch(l){case 1:A<this._mpegAudioL3BitRateTable.length&&(h=this._mpegAudioL3BitRateTable[A]);break;case 2:A<this._mpegAudioL2BitRateTable.length&&(h=this._mpegAudioL2BitRateTable[A]);break;case 3:A<this._mpegAudioL1BitRateTable.length&&(h=this._mpegAudioL1BitRateTable[A])}o={bitRate:h,samplingRate:u,channelCount:c,codec:"mp3",originalCodec:"mp3"}}else o=a;return o}r.A.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")},e.prototype._parseVideoData=function(e,t,i,n,o){var a,s;if(i<=1)r.A.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!this._hasVideoFlagOverrided||!1!==this._hasVideo){var l=new Uint8Array(e,t,i)[0],A=(112&l)>>>4;if(128&l){var d=15&l,c=String.fromCharCode.apply(String,function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}(new Uint8Array(e,t,i).slice(1,5)),!1));"hvc1"===c?this._parseEnhancedHEVCVideoPacket(e,t+5,i-5,n,o,A,d):"av01"===c?this._parseEnhancedAV1VideoPacket(e,t+5,i-5,n,o,A,d):null===(s=this._onError)||void 0===s||s.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(c))}else{var u=15&l;7===u?this._parseAVCVideoPacket(e,t+1,i-1,n,o,A):12===u?this._parseHEVCVideoPacket(e,t+1,i-1,n,o,A):null===(a=this._onError)||void 0===a||a.call(this,f.A.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(u))}}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,o,a){var s;if(i<4)r.A.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var l=this._littleEndian,A=new DataView(e,t,i),d=A.getUint8(0),c=(16777215&A.getUint32(0,!l))<<8>>8;0===d?this._parseAVCDecoderConfigurationRecord(e,t+4,i-4):1===d?this._parseAVCVideoData(e,t+4,i-4,n,o,a,c):2===d||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},e.prototype._parseHEVCVideoPacket=function(e,t,i,n,o,a){var s;if(i<4)r.A.w(this.TAG,"Flv: Invalid HEVC packet, missing HEVCPacketType or/and CompositionTime");else{var l=this._littleEndian,A=new DataView(e,t,i),d=A.getUint8(0),c=(16777215&A.getUint32(0,!l))<<8>>8;0===d?this._parseHEVCDecoderConfigurationRecord(e,t+4,i-4):1===d?this._parseHEVCVideoData(e,t+4,i-4,n,o,a,c):2===d||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(d))}},e.prototype._parseEnhancedHEVCVideoPacket=function(e,t,i,n,r,o,a){var s,l=this._littleEndian,A=new DataView(e,t,i);if(0===a)this._parseHEVCDecoderConfigurationRecord(e,t,i);else if(1===a){var d=(4294967040&A.getUint32(0,!l))>>8;this._parseHEVCVideoData(e,t+3,i-3,n,r,o,d)}else 3===a?this._parseHEVCVideoData(e,t,i,n,r,o,0):2===a||null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseEnhancedAV1VideoPacket=function(e,t,i,n,r,o,a){var s,l;this._littleEndian,0===a?this._parseAV1CodecConfigurationRecord(e,t,i):1===a?this._parseAV1VideoData(e,t,i,n,r,o,0):5===a?null===(s=this._onError)||void 0===s||s.call(this,f.A.FORMAT_ERROR,"Flv: Not Suported MP2T AV1 video packet type ".concat(a)):2===a||null===(l=this._onError)||void 0===l||l.call(this,f.A.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(a))},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){var n,o,a,s,l,A,d,c,u,h,_;if(i<7)r.A.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var m=this._videoMetadata,v=this._videoTrack,g=this._littleEndian,b=new DataView(e,t,i);if(m){if(void 0!==m.avcc){var E=new Uint8Array(e,t,i);if(y(E,m.avcc))return;r.A.w(this.TAG,"AVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(m=this._videoMetadata={}).type="video",m.id=null==v?void 0:v.id,m.timescale=this._timescale,m.duration=this._duration;var S=b.getUint8(0),C=b.getUint8(1);if(b.getUint8(2),b.getUint8(3),1===S&&0!==C)if(this._naluLengthSize=1+(3&b.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var w=31&b.getUint8(5);if(0!==w){w>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(w));for(var T=6,k=0;k<w;k++){var L=b.getUint16(T,!g);if(T+=2,0!==L){var I=new Uint8Array(e,t+T,L);T+=L;var O=p.parseSPS(I);if(0===k){m.codecWidth=O.codec_size.width,m.codecHeight=O.codec_size.height,m.presentWidth=O.present_size.width,m.presentHeight=O.present_size.height,m.profile=O.profile_string,m.level=O.level_string,m.bitDepth=O.bit_depth,m.chromaFormat=O.chroma_format,m.sarRatio=O.sar_ratio,m.frameRate=O.frame_rate,O.frame_rate.fixed&&0!==O.frame_rate.fps_num&&0!==O.frame_rate.fps_den||(m.frameRate=this._referenceFrameRate);var B=null===(s=m.frameRate)||void 0===s?void 0:s.fps_den,R=null===(l=m.frameRate)||void 0===l?void 0:l.fps_num;m.refSampleDuration=m.timescale*(B/R);for(var x=I.subarray(1,4),D="avc1.",M=0;M<3;M++){var P=x[M].toString(16);P.length<2&&(P="0"+P),D+=P}m.codec=D;var U=this._mediaInfo;U.width=m.codecWidth,U.height=m.codecHeight,U.fps=m.frameRate.fps,U.profile=m.profile,U.level=m.level,U.refFrames=O.ref_frames,U.chromaFormat=O.chroma_format_string,U.sarNum=m.sarRatio.width,U.sarDen=m.sarRatio.height,U.videoCodec=D,U.hasAudio?null!=U.audioCodec&&(U.mimeType='video/x-flv; codecs="'+U.videoCodec+","+U.audioCodec+'"'):U.mimeType='video/x-flv; codecs="'+U.videoCodec+'"',U.isComplete()&&(null===(A=this._onMediaInfo)||void 0===A||A.call(this,U))}}}var $=b.getUint8(T);if(0!==$){for($>1&&r.A.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat($)),T++,k=0;k<$;k++)L=b.getUint16(T,!g),T+=2,0!==L&&(T+=L);m.avcc=new Uint8Array(i),m.avcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(c=this._audioTrack)||void 0===c?void 0:c.length)||(null===(u=this._videoTrack)||void 0===u?void 0:u.length))&&(null===(h=this._onDataAvailable)||void 0===h||h.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(_=this._onTrackMetadata)||void 0===_||_.call(this,"video",m)}else null===(d=this._onError)||void 0===d||d.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else null===(a=this._onError)||void 0===a||a.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}},e.prototype._parseHEVCDecoderConfigurationRecord=function(e,t,i){var n,o,a,s,l,A,d;if(i<22)r.A.w(this.TAG,"Flv: Invalid HEVCDecoderConfigurationRecord, lack of data!");else{var c=this._videoMetadata,u=this._videoTrack,h=this._littleEndian,p=new DataView(e,t,i);if(c){if(void 0!==c.hvcc){var m=new Uint8Array(e,t,i);if(y(m,c.hvcc))return;r.A.w(this.TAG,"HEVCDecoderConfigurationRecord has been changed, re-generate initialization segment")}}else!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(c=this._videoMetadata={}).type="video",c.id=null==u?void 0:u.id,c.timescale=this._timescale,c.duration=this._duration;var v=p.getUint8(0),g=31&p.getUint8(1);if(1===v&&0!==g)if(this._naluLengthSize=1+(3&p.getUint8(21)),3===this._naluLengthSize||4===this._naluLengthSize){for(var b=p.getUint8(22),E=0,S=23;E<b;E++){var C=63&p.getUint8(S+0),w=p.getUint16(S+1,!h);S+=3;for(var T=0;T<w;T++){var k=p.getUint16(S+0,!h);if(0===T)if(33===C){S+=2;var L=new Uint8Array(e,t+S,k),I=_.parseSPS(L);c.codecWidth=I.codec_size.width,c.codecHeight=I.codec_size.height,c.presentWidth=I.present_size.width,c.presentHeight=I.present_size.height,c.profile=null==I?void 0:I.profile_string,c.level=I.level_string,c.bitDepth=I.bit_depth,c.chromaFormat=I.chroma_format,c.sarRatio=I.sar_ratio,c.frameRate=I.frame_rate,I.frame_rate.fixed&&0!==I.frame_rate.fps_num&&0!==I.frame_rate.fps_den||(c.frameRate=this._referenceFrameRate);var O=c.frameRate.fps_den,B=c.frameRate.fps_num;c.refSampleDuration=c.timescale*(O/B),c.codec=I.codec_mimetype;var R=this._mediaInfo;R.width=c.codecWidth,R.height=c.codecHeight,R.fps=c.frameRate.fps,R.profile=c.profile,R.level=c.level,R.refFrames=I.ref_frames,R.chromaFormat=I.chroma_format_string,R.sarNum=c.sarRatio.width,R.sarDen=c.sarRatio.height,R.videoCodec=I.codec_mimetype,R.hasAudio?null!=R.audioCodec&&(R.mimeType='video/x-flv; codecs="'+R.videoCodec+","+R.audioCodec+'"'):R.mimeType='video/x-flv; codecs="'+R.videoCodec+'"',R.isComplete()&&(null===(a=this._onMediaInfo)||void 0===a||a.call(this,R)),S+=k}else S+=2+k;else S+=2+k}}c.hvcc=new Uint8Array(i),c.hvcc.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed HEVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(s=this._audioTrack)||void 0===s?void 0:s.length)||(null===(l=this._videoTrack)||void 0===l?void 0:l.length))&&(null===(A=this._onDataAvailable)||void 0===A||A.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(d=this._onTrackMetadata)||void 0===d||d.call(this,"video",c)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: Invalid HEVCDecoderConfigurationRecord")}},e.prototype._parseAV1CodecConfigurationRecord=function(e,t,i){var n,o,a,s,l,A,d,c,u,h,p;if(i<4)r.A.w(this.TAG,"Flv: Invalid AV1CodecConfigurationRecord, lack of data!");else{var _=this._videoMetadata,m=this._videoTrack,v=(this._littleEndian,new DataView(e,t,i));_?void 0!==_.av1c&&r.A.w(this.TAG,"Found another AV1CodecConfigurationRecord!"):(!1!==this._hasVideo||this._hasVideoFlagOverrided||(this._hasVideo=!0,this._mediaInfo&&(this._mediaInfo.hasVideo=!0)),(_=this._videoMetadata={}).type="video",_.id=null==m?void 0:m.id,_.timescale=this._timescale,_.duration=this._duration);var g=127&v.getUint8(0);if(v.getUint8(1),v.getUint8(1),v.getUint8(2),1===g){var y=b.parseOBUs(new Uint8Array(e,t+4,i-4));if(null!=y){_.codecWidth=null===(a=null==y?void 0:y.codec_size)||void 0===a?void 0:a.width,_.codecHeight=null===(s=null==y?void 0:y.codec_size)||void 0===s?void 0:s.height,_.presentWidth=null===(l=null==y?void 0:y.present_size)||void 0===l?void 0:l.width,_.presentHeight=null===(A=null==y?void 0:y.present_size)||void 0===A?void 0:A.height,_.profile=y.profile_string,_.level=y.level_string,_.bitDepth=y.bit_depth,_.chromaFormat=y.chroma_format,_.sarRatio=y.sar_ratio,_.frameRate=y.frame_rate,y.frame_rate.fixed&&0!==y.frame_rate.fps_num&&0!==y.frame_rate.fps_den||(_.frameRate=this._referenceFrameRate);var E=_.frameRate.fps_den,S=_.frameRate.fps_num;_.refSampleDuration=_.timescale*(E/S),_.codec=y.codec_mimetype;var C=this._mediaInfo;C.width=_.codecWidth,C.height=_.codecHeight,C.fps=_.frameRate.fps,C.profile=_.profile,C.level=_.level,C.refFrames=y.ref_frames,C.chromaFormat=y.chroma_format_string,C.sarNum=_.sarRatio.width,C.sarDen=_.sarRatio.height,C.videoCodec=y.codec_mimetype,C.hasAudio?null!=C.audioCodec&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.videoCodec+'"',C.isComplete()&&(null===(d=this._onMediaInfo)||void 0===d||d.call(this,C)),_.av1c=new Uint8Array(i),_.av1c.set(new Uint8Array(e,t,i),0),r.A.v(this.TAG,"Parsed AV1CodecConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&((null===(c=this._audioTrack)||void 0===c?void 0:c.length)||(null===(u=this._videoTrack)||void 0===u?void 0:u.length))&&(null===(h=this._onDataAvailable)||void 0===h||h.call(this,this._audioTrack,this._videoTrack)):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,null===(p=this._onTrackMetadata)||void 0===p||p.call(this,"video",_)}else null===(o=this._onError)||void 0===o||o.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}else null===(n=this._onError)||void 0===n||n.call(this,f.A.FORMAT_ERROR,"Flv: Invalid AV1CodecConfigurationRecord")}},e.prototype._parseAVCVideoData=function(e,t,i,n,o,a,s){for(var l=this._littleEndian,A=new DataView(e,t,i),d=[],c=0,u=0,h=this._naluLengthSize,p=this._timestampBase+n,f=1===a;u<i;){if(u+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(u,", dataSize = ").concat(i));break}var _=A.getUint32(u,!l);if(3===h&&(_>>>=8),_>i-h)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&A.getUint8(u+h);5===m&&(f=!0);var v=new Uint8Array(e,t+u,h+_),g={type:m,data:v};d.push(g),c+=v.byteLength,u+=h+_}if(d.length){var y=this._videoTrack,b={units:d,length:c,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(y.samples.push(b),y.length+=c)}},e.prototype._parseHEVCVideoData=function(e,t,i,n,o,a,s){for(var l=this._littleEndian,A=new DataView(e,t,i),d=[],c=0,u=0,h=this._naluLengthSize,p=this._timestampBase+n,f=1===a;u<i;){if(u+4>=i){r.A.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(u,", dataSize = ").concat(i));break}var _=A.getUint32(u,!l);if(3===h&&(_>>>=8),_>i-h)return void r.A.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var m=31&A.getUint8(u+h);19!==m&&20!==m||(f=!0);var v=new Uint8Array(e,t+u,h+_),g={type:m,data:v};d.push(g),c+=v.byteLength,u+=h+_}if(d.length){var y=this._videoTrack,b={units:d,length:c,isKeyframe:f,dts:p,cts:s,pts:p+s};f&&(b.fileposition=o),y&&(null==y||y.samples.push(b),y.length+=c)}},e.prototype._parseAV1VideoData=function(e,t,i,n,r,o,a){this._littleEndian;var s,l=[],A=this._timestampBase+n,d=1===o;if(s=i,l.push({unitType:0,data:new Uint8Array(e,t+0,i)}),l.length){var c=this._videoTrack,u={units:l,length:s,isKeyframe:d,dts:A,cts:a,pts:A+a};d&&(u.fileposition=r),c&&(null==c||c.samples.push(u),c.length+=s)}},e}();const S=E,C=function(){function e(){}return e.prototype.destroy=function(){this.onError=null,this.onMediaInfo=null,this.onMetaDataArrived=null,this.onTrackMetadata=null,this.onDataAvailable=null,this.onTimedID3Metadata=null,this.onSMPTE2038Metadata=null,this.onSCTE35Metadata=null,this.onPESPrivateData=null,this.onPESPrivateDataDescriptor=null},e}();var w,T=function(){this.program_pmt_pid={}};!function(e){e[e.kMPEG1Audio=3]="kMPEG1Audio",e[e.kMPEG2Audio=4]="kMPEG2Audio",e[e.kPESPrivateData=6]="kPESPrivateData",e[e.kADTSAAC=15]="kADTSAAC",e[e.kLOASAAC=17]="kLOASAAC",e[e.kAC3=129]="kAC3",e[e.kEAC3=135]="kEAC3",e[e.kID3=21]="kID3",e[e.kSCTE35=134]="kSCTE35",e[e.kH264=27]="kH264",e[e.kH265=36]="kH265"}(w||(w={}));var k,L=function(){this.pid_stream_type={},this.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},this.pes_private_data_pids={},this.timed_id3_pids={},this.scte_35_pids={},this.smpte2038_pids={}},I=function(){},O=function(){},B=function(){this.slices=[],this.total_length=0,this.expected_length=0,this.file_position=0,this.random_access_indicator=0};!function(e){e[e.kUnspecified=0]="kUnspecified",e[e.kSliceNonIDR=1]="kSliceNonIDR",e[e.kSliceDPA=2]="kSliceDPA",e[e.kSliceDPB=3]="kSliceDPB",e[e.kSliceDPC=4]="kSliceDPC",e[e.kSliceIDR=5]="kSliceIDR",e[e.kSliceSEI=6]="kSliceSEI",e[e.kSliceSPS=7]="kSliceSPS",e[e.kSlicePPS=8]="kSlicePPS",e[e.kSliceAUD=9]="kSliceAUD",e[e.kEndOfSequence=10]="kEndOfSequence",e[e.kEndOfStream=11]="kEndOfStream",e[e.kFiller=12]="kFiller",e[e.kSPSExt=13]="kSPSExt",e[e.kReserved0=14]="kReserved0"}(k||(k={}));var R,x,D=function(){},M=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},P=function(){function e(e){this.TAG="H264AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H264 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],r=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===r)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=31&e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3],r=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,!(n>=k.kReserved0)&&0===r){var a=e.subarray(i,o);(t=new D).type=n,t.data=a}}return t},e}(),U=function(){function e(e,t,i){var n=8+e.byteLength+1+2+t.byteLength,r=!1;66!==e[3]&&77!==e[3]&&88!==e[3]&&(r=!0,n+=4);var o=this.data=new Uint8Array(n);o[0]=1,o[1]=e[1],o[2]=e[2],o[3]=e[3],o[4]=255,o[5]=225;var a=e.byteLength;o[6]=a>>>8,o[7]=255&a;var s=8;o.set(e,8),o[s+=a]=1;var l=t.byteLength;o[s+1]=l>>>8,o[s+2]=255&l,o.set(t,s+3),s+=3+l,r&&(o[s]=252|i.chroma_format_idc,o[s+1]=248|i.bit_depth_luma-8,o[s+2]=248|i.bit_depth_chroma-8,o[s+3]=0,s+=4)}return e.prototype.getData=function(){return this.data},e}();!function(e){e[e.kNull=0]="kNull",e[e.kAACMain=1]="kAACMain",e[e.kAAC_LC=2]="kAAC_LC",e[e.kAAC_SSR=3]="kAAC_SSR",e[e.kAAC_LTP=4]="kAAC_LTP",e[e.kAAC_SBR=5]="kAAC_SBR",e[e.kAAC_Scalable=6]="kAAC_Scalable",e[e.kLayer1=32]="kLayer1",e[e.kLayer2=33]="kLayer2",e[e.kLayer3=34]="kLayer3"}(R||(R={})),function(e){e[e.k96000Hz=0]="k96000Hz",e[e.k88200Hz=1]="k88200Hz",e[e.k64000Hz=2]="k64000Hz",e[e.k48000Hz=3]="k48000Hz",e[e.k44100Hz=4]="k44100Hz",e[e.k32000Hz=5]="k32000Hz",e[e.k24000Hz=6]="k24000Hz",e[e.k22050Hz=7]="k22050Hz",e[e.k16000Hz=8]="k16000Hz",e[e.k12000Hz=9]="k12000Hz",e[e.k11025Hz=10]="k11025Hz",e[e.k8000Hz=11]="k8000Hz",e[e.k7350Hz=12]="k7350Hz"}(x||(x={}));var $,F,N=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],V=($=function(e,t){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},$(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),j=function(){},Q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return V(t,e),t}(j),G=function(){function e(e){this.TAG="AACADTSParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found ADTS syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(4095==(i[t+0]<<8|i[t+1])>>>4)return t;t++}},e.prototype.readNextAACFrame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=(8&e[i+1])>>>3,r=(6&e[i+1])>>>1,o=1&e[i+1],a=(192&e[i+2])>>>6,s=(60&e[i+2])>>>2,l=(1&e[i+2])<<2|(192&e[i+3])>>>6,A=(3&e[i+3])<<11|e[i+4]<<3|(224&e[i+5])>>>5;if(e[i+6],i+A>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var d=1===o?7:9,c=A-d;i+=d;var u=this.findNextSyncwordOffset(i+c);if(this.current_syncword_offset_=u,(0===n||1===n)&&0===r){var h=e.subarray(i,i+c);(t=new j).audio_object_type=a+1,t.sampling_freq_index=s,t.sampling_frequency=N[s],t.channel_config=l,t.data=h}}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),z=function(){function e(e){this.TAG="AACLOASParser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found LOAS syncword until payload end")}return e.prototype.findNextSyncwordOffset=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++}},e.prototype.getLATMValue=function(e){for(var t=e.readBits(2),i=0,n=0;n<=t;n++)i<<=8,i|=e.readByte();return i},e.prototype.readNextAACFrame=function(e){for(var t=this.data_,i=null;null==i&&!this.eof_flag_;){var n=this.current_syncword_offset_,o=(31&t[n+1])<<8|t[n+2];if(n+3+o>=this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var a=new h(t.subarray(n+3,n+3+o)),s=null;if(a.readBool()){if(null==e){r.A.w(this.TAG,"StreamMuxConfig Missing"),this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+o),a.destroy();continue}s=e}else{var l=a.readBool();if(l&&a.readBool()){r.A.e(this.TAG,"audioMuxVersionA is Not Supported"),a.destroy();break}if(l&&this.getLATMValue(a),!a.readBool()){r.A.e(this.TAG,"allStreamsSameTimeFraming zero is Not Supported"),a.destroy();break}if(0!==a.readBits(6)){r.A.e(this.TAG,"more than 2 numSubFrames Not Supported"),a.destroy();break}if(0!==a.readBits(4)){r.A.e(this.TAG,"more than 2 numProgram Not Supported"),a.destroy();break}if(0!==a.readBits(3)){r.A.e(this.TAG,"more than 2 numLayer Not Supported"),a.destroy();break}var A=l?this.getLATMValue(a):0,d=a.readBits(5);A-=5;var c=a.readBits(4);A-=4;var u=a.readBits(4);A-=4,a.readBits(3),(A-=3)>0&&a.readBits(A);var p=a.readBits(3);if(0!==p){r.A.e(this.TAG,"frameLengthType = ".concat(p,". Only frameLengthType = 0 Supported")),a.destroy();break}a.readByte();var f=a.readBool();if(f)if(l)this.getLATMValue(a);else{for(var _=0;;){_<<=8;var m=a.readBool();if(_+=a.readByte(),!m)break}console.log(_)}a.readBool()&&a.readByte(),(s=new Q).audio_object_type=d,s.sampling_freq_index=c,s.sampling_frequency=N[s.sampling_freq_index],s.channel_config=u,s.other_data_present=f}for(var v=0;;){var g=a.readByte();if(v+=g,255!==g)break}for(var y=new Uint8Array(v),b=0;b<v;b++)y[b]=a.readByte();(i=new Q).audio_object_type=s.audio_object_type,i.sampling_freq_index=s.sampling_freq_index,i.sampling_frequency=N[s.sampling_freq_index],i.channel_config=s.channel_config,i.other_data_present=s.other_data_present,i.data=y,this.current_syncword_offset_=this.findNextSyncwordOffset(n+3+o)}return i},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),H=function(e){var t=[],i=e.audio_object_type,n=e.audio_object_type,r=e.sampling_freq_index,o=e.channel_config,a=0,s=navigator.userAgent.toLowerCase();s.includes("firefox")?r>=6?(n=5,t=new Array(4),a=r-3):(n=2,t=new Array(2),a=r):s.includes("android")?(n=2,t=new Array(2),a=r):(n=5,a=r,t=new Array(4),r>=6?a=r-3:1===o&&(n=2,t=new Array(2),a=r)),t[0]=n<<3,t[0]|=(15&r)>>>1,t[1]=(15&r)<<7,t[1]|=(15&o)<<3,5===n&&(t[1]|=(15&a)>>>1,t[2]=(1&a)<<7,t[2]|=8,t[3]=0),this.config=t,this.sampling_rate=N[r],this.channel_count=o,this.codec_mimetype="mp4a.40."+n.toString(),this.original_codec_mimetype="mp4a.40."+i.toString()},W=function(){},q=function(){};!function(e){e[e.kSpliceNull=0]="kSpliceNull",e[e.kSpliceSchedule=4]="kSpliceSchedule",e[e.kSpliceInsert=5]="kSpliceInsert",e[e.kTimeSignal=6]="kTimeSignal",e[e.kBandwidthReservation=7]="kBandwidthReservation",e[e.kPrivateCommand=255]="kPrivateCommand"}(F||(F={}));var K,Y=function(e){var t=e.readBool();return t?(e.readBits(6),{time_specified_flag:t,pts_time:4*e.readBits(31)+e.readBits(2)}):(e.readBits(7),{time_specified_flag:t})},X=function(e){var t=e.readBool();return e.readBits(6),{auto_return:t,duration:4*e.readBits(31)+e.readBits(2)}},Z=function(e,t){var i=t.readBits(8);return e?{component_tag:i}:{component_tag:i,splice_time:Y(t)}},J=function(e){return{component_tag:e.readBits(8),utc_splice_time:e.readBits(32)}},ee=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),e.readBits(5),n.program_splice_flag)n.utc_splice_time=e.readBits(32);else{n.component_count=e.readBits(8),n.components=[];for(var r=0;r<n.component_count;r++)n.components.push(J(e))}return n.duration_flag&&(n.break_duration=X(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n},te=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,provider_avail_id:n.readBits(32)}},ie=function(e,t,i,n){var r=n.readBits(8),o=n.readBits(3);n.readBits(5);for(var a="",s=0;s<o;s++)a+=String.fromCharCode(n.readBits(8));return{descriptor_tag:e,descriptor_length:t,identifier:i,preroll:r,dtmf_count:o,DTMF_char:a}},ne=function(e){var t=e.readBits(8);return e.readBits(7),{component_tag:t,pts_offset:4*e.readBits(31)+e.readBits(2)}},re=function(e,t,i,n){var r=n.readBits(32),o=n.readBool();n.readBits(7);var a={descriptor_tag:e,descriptor_length:t,identifier:i,segmentation_event_id:r,segmentation_event_cancel_indicator:o};if(o)return a;if(a.program_segmentation_flag=n.readBool(),a.segmentation_duration_flag=n.readBool(),a.delivery_not_restricted_flag=n.readBool(),a.delivery_not_restricted_flag?n.readBits(5):(a.web_delivery_allowed_flag=n.readBool(),a.no_regional_blackout_flag=n.readBool(),a.archive_allowed_flag=n.readBool(),a.device_restrictions=n.readBits(2)),!a.program_segmentation_flag){a.component_count=n.readBits(8),a.components=[];for(var s=0;s<a.component_count;s++)a.components.push(ne(n))}a.segmentation_duration_flag&&(a.segmentation_duration=n.readBits(40)),a.segmentation_upid_type=n.readBits(8),a.segmentation_upid_length=n.readBits(8);var l=new Uint8Array(a.segmentation_upid_length);for(s=0;s<a.segmentation_upid_length;s++)l[s]=n.readBits(8);return a.segmentation_upid=l.buffer,a.segmentation_type_id=n.readBits(8),a.segment_num=n.readBits(8),a.segments_expected=n.readBits(8),52!==a.segmentation_type_id&&54!==a.segmentation_type_id&&56!==a.segmentation_type_id&&58!==a.segmentation_type_id||(a.sub_segment_num=n.readBits(8),a.sub_segments_expected=n.readBits(8)),a},oe=function(e,t,i,n){return{descriptor_tag:e,descriptor_length:t,identifier:i,TAI_seconds:n.readBits(48),TAI_ns:n.readBits(32),UTC_offset:n.readBits(16)}},ae=function(e){return{component_tag:e.readBits(8),ISO_code:String.fromCharCode(e.readBits(8),e.readBits(8),e.readBits(8)),Bit_Stream_Mode:e.readBits(3),Num_Channels:e.readBits(4),Full_Srvc_Audio:e.readBool()}},se=function(e,t,i,n){for(var r=n.readBits(4),o=[],a=0;a<r;a++)o.push(ae(n));return{descriptor_tag:e,descriptor_length:t,identifier:i,audio_count:r,components:o}};!function(e){e[e.kSliceIDR_W_RADL=19]="kSliceIDR_W_RADL",e[e.kSliceIDR_N_LP=20]="kSliceIDR_N_LP",e[e.kSliceCRA_NUT=21]="kSliceCRA_NUT",e[e.kSliceVPS=32]="kSliceVPS",e[e.kSliceSPS=33]="kSliceSPS",e[e.kSlicePPS=34]="kSlicePPS",e[e.kSliceAUD=35]="kSliceAUD"}(K||(K={}));var le=function(){},Ae=function(e){var t=e.data.byteLength;this.type=e.type,this.data=new Uint8Array(4+t),new DataView(this.data.buffer).setUint32(0,t),this.data.set(e.data,4)},de=function(){function e(e){this.TAG="H265AnnexBParser",this.current_startcode_offset_=0,this.eof_flag_=!1,this.data_=e,this.current_startcode_offset_=this.findNextStartCodeOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not find H265 startcode until payload end!")}return e.prototype.findNextStartCodeOffset=function(e){for(var t=e,i=this.data_;;){if(t+3>=i.byteLength)return this.eof_flag_=!0,i.byteLength;var n=i[t+0]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3],r=i[t+0]<<16|i[t+1]<<8|i[t+2];if(1===n||1===r)return t;t++}},e.prototype.readNextNaluPayload=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_startcode_offset_,n=e[i+=1==(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])?4:3]>>1&63,r=(128&e[i])>>>7,o=this.findNextStartCodeOffset(i);if(this.current_startcode_offset_=o,0===r){var a=e.subarray(i,o);(t=new le).type=n,t.data=a}}return t},e}(),ce=function(){function e(e,t,i,n){var r=23+(5+e.byteLength)+(5+t.byteLength)+(5+i.byteLength),o=this.data=new Uint8Array(r);o[0]=1,o[1]=(3&n.general_profile_space)<<6|(n.general_tier_flag?1:0)<<5|31&n.general_profile_idc,o[2]=n.general_profile_compatibility_flags_1,o[3]=n.general_profile_compatibility_flags_2,o[4]=n.general_profile_compatibility_flags_3,o[5]=n.general_profile_compatibility_flags_4,o[6]=n.general_constraint_indicator_flags_1,o[7]=n.general_constraint_indicator_flags_2,o[8]=n.general_constraint_indicator_flags_3,o[9]=n.general_constraint_indicator_flags_4,o[10]=n.general_constraint_indicator_flags_5,o[11]=n.general_constraint_indicator_flags_6,o[12]=n.general_level_idc,o[13]=240|(3840&n.min_spatial_segmentation_idc)>>8,o[14]=255&n.min_spatial_segmentation_idc,o[15]=252|3&n.parallelismType,o[16]=252|3&n.chroma_format_idc,o[17]=248|7&n.bit_depth_luma_minus8,o[18]=248|7&n.bit_depth_chroma_minus8,o[19]=0,o[20]=0,o[21]=(3&n.constant_frame_rate)<<6|(7&n.num_temporal_layers)<<3|(n.temporal_id_nested?1:0)<<2|3,o[22]=3,o[23]=128|K.kSliceVPS,o[24]=0,o[25]=1,o[26]=(65280&e.byteLength)>>8,o[27]=255&e.byteLength,o.set(e,28),o[23+(5+e.byteLength)+0]=128|K.kSliceSPS,o[23+(5+e.byteLength)+1]=0,o[23+(5+e.byteLength)+2]=1,o[23+(5+e.byteLength)+3]=(65280&t.byteLength)>>8,o[23+(5+e.byteLength)+4]=255&t.byteLength,o.set(t,23+(5+e.byteLength)+5),o[23+(5+e.byteLength+5+t.byteLength)+0]=128|K.kSlicePPS,o[23+(5+e.byteLength+5+t.byteLength)+1]=0,o[23+(5+e.byteLength+5+t.byteLength)+2]=1,o[23+(5+e.byteLength+5+t.byteLength)+3]=(65280&i.byteLength)>>8,o[23+(5+e.byteLength+5+t.byteLength)+4]=255&i.byteLength,o.set(i,23+(5+e.byteLength+5+t.byteLength)+5)}return e.prototype.getData=function(){return this.data},e}(),ue=function(){},he=function(){},pe=function(){},fe=[[64,64,80,80,96,96,112,112,128,128,160,160,192,192,224,224,256,256,320,320,384,384,448,448,512,512,640,640,768,768,896,896,1024,1024,1152,1152,1280,1280],[69,70,87,88,104,105,121,122,139,140,174,175,208,209,243,244,278,279,348,349,417,418,487,488,557,558,696,697,835,836,975,976,1114,1115,1253,1254,1393,1394],[96,96,120,120,144,144,168,168,192,192,240,240,288,288,336,336,384,384,480,480,576,576,672,672,768,768,960,960,1152,1152,1344,1344,1536,1536,1728,1728,1920,1920]],_e=function(){function e(e){this.TAG="AC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=e[i+4]>>6,r=[48e3,44200,33e3][n],o=63&e[i+4],a=2*fe[n][o];if(i+a>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var s=this.findNextSyncwordOffset(i+a);this.current_syncword_offset_=s;var l=e[i+5]>>3,A=7&e[i+5],d=e[i+6]>>5,c=0;1&d&&1!==d&&(c+=2),4&d&&(c+=2),2===d&&(c+=2);var u=(e[i+6]<<8|e[i+7])>>12-c&1,h=[2,1,2,3,3,4,4,5][d]+u;(t=new pe).sampling_frequency=r,t.channel_count=h,t.channel_mode=d,t.bit_stream_identification=l,t.low_frequency_effects_channel_on=u,t.bit_stream_mode=A,t.frame_size_code=o,t.data=e.subarray(i,i+a)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),me=function(e){var t;t=[e.sampling_rate_code<<6|e.bit_stream_identification<<1|e.bit_stream_mode>>2,(3&e.bit_stream_mode)<<6|e.channel_mode<<3|e.low_frequency_effects_channel_on<<2|e.frame_size_code>>4,e.frame_size_code<<4&224],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.bit_stream_mode=e.bit_stream_mode,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ac-3",this.original_codec_mimetype="ac-3"},ve=function(){},ge=function(){function e(e){this.TAG="EAC3Parser",this.data_=e,this.current_syncword_offset_=this.findNextSyncwordOffset(0),this.eof_flag_&&r.A.e(this.TAG,"Could not found AC3 syncword until payload end")}return e.prototype.findNextSyncwordOffset=function(e){for(var t=e,i=this.data_;;){if(t+7>=i.byteLength)return this.eof_flag_=!0,i.byteLength;if(2935==(i[t+0]<<8|i[t+1]))return t;t++}},e.prototype.readNextEAC3Frame=function(){for(var e=this.data_,t=null;null==t&&!this.eof_flag_;){var i=this.current_syncword_offset_,n=new h(e.subarray(i+2)),r=(n.readBits(2),n.readBits(3),n.readBits(11)+1<<1),o=n.readBits(2),a=null,s=null;3===o?(a=[24e3,22060,16e3][o=n.readBits(2)],s=3):(a=[48e3,44100,32e3][o],s=n.readBits(2));var l=n.readBits(3),A=n.readBits(1),d=n.readBits(5);if(i+r>this.data_.byteLength){this.eof_flag_=!0,this.has_last_incomplete_data=!0;break}var c=this.findNextSyncwordOffset(i+r);this.current_syncword_offset_=c;var u=[2,1,2,3,3,4,4,5][l]+A;n.destroy(),(t=new ve).sampling_frequency=a,t.channel_count=u,t.channel_mode=l,t.bit_stream_identification=d,t.low_frequency_effects_channel_on=A,t.frame_size=r,t.num_blks=[1,2,3,6][s],t.data=e.subarray(i,i+r)}return t},e.prototype.hasIncompleteData=function(){return this.has_last_incomplete_data},e.prototype.getIncompleteData=function(){return this.has_last_incomplete_data?this.data_.subarray(this.current_syncword_offset_):null},e}(),ye=function(e){var t,i=Math.floor(e.frame_size*e.sampling_frequency/(16*e.num_blks));t=[255&i,248&i,e.sampling_rate_code<<6|e.bit_stream_identification<<1,e.channel_mode<<1|e.low_frequency_effects_channel_on,0],this.config=t,this.sampling_rate=e.sampling_frequency,this.bit_stream_identification=e.bit_stream_identification,this.num_blks=e.num_blks,this.low_frequency_effects_channel_on=e.low_frequency_effects_channel_on,this.channel_count=e.channel_count,this.channel_mode=e.channel_mode,this.codec_mimetype="ec-3",this.original_codec_mimetype="ec-3"},be=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};return function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ee=function(){return Ee=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Ee.apply(this,arguments)},Se=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a},Ce=function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))},we=function(e){function t(t,i){var n=e.call(this)||this;return n.TAG="TSDemuxer",n.first_parse_=!0,n.media_info_=new a.A,n.timescale_=90,n.duration_=0,n.current_pmt_pid_=-1,n.program_pmt_map_={},n.pes_slice_queues_={},n.section_slice_queues_={},n.video_metadata_={vps:void 0,sps:void 0,pps:void 0,details:void 0},n.audio_metadata_={codec:void 0,audio_object_type:void 0,sampling_freq_index:void 0,sampling_frequency:void 0,channel_config:void 0},n.aac_last_sample_pts_=void 0,n.aac_last_incomplete_data_=null,n.has_video_=!1,n.has_audio_=!1,n.video_init_segment_dispatched_=!1,n.audio_init_segment_dispatched_=!1,n.video_metadata_changed_=!1,n.audio_metadata_changed_=!1,n.loas_previous_frame=null,n.video_track_={type:"video",id:1,sequenceNumber:0,samples:[],length:0},n.audio_track_={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},n.ts_packet_size_=t.ts_packet_size,n.sync_offset_=t.sync_offset,n.config_=i,n}return be(t,e),t.prototype.destroy=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,e.prototype.destroy.call(this)},t.probe=function(e){var t=new Uint8Array(e),i=-1,n=188;if(t.byteLength<=3*n)return{needMoreData:!0};for(;-1===i;){for(var o=Math.min(1e3,t.byteLength-3*n),a=0;a<o;){if(71===t[a]&&71===t[a+n]&&71===t[a+2*n]){i=a;break}a++}if(-1===i)if(188===n)n=192;else{if(192!==n)break;n=204}}return-1===i?{match:!1}:(192===n&&i>=4?(r.A.v("TSDemuxer","ts_packet_size = 192, m2ts mode"),i-=4):204===n&&r.A.v("TSDemuxer","ts_packet_size = 204, RS encoded MPEG2-TS stream"),{match:!0,consumed:0,ts_packet_size:n,sync_offset:i})},t.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},t.prototype.resetMediaInfo=function(){this.media_info_=new a.A},t.prototype.parseChunks=function(e,t){var i;if(!(this.onError&&this.onMediaInfo&&this.onTrackMetadata&&this.onDataAvailable))throw new d.j4("onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0;for(this.first_parse_&&(this.first_parse_=!1,n=this.sync_offset_);n+this.ts_packet_size_<=e.byteLength;){var o=t+n;192===this.ts_packet_size_&&(n+=4);var a=new Uint8Array(e,n,188),s=a[0];if(71!==s){r.A.e(this.TAG,"sync_byte = ".concat(s,", not 0x47"));break}var l=(64&a[1])>>>6,A=(a[1],(31&a[1])<<8|a[2]),c=(48&a[3])>>>4,u=15&a[3],h={},p=4;if(2===c||3===c){var f=a[4];if(5+f===188){n+=188,204===this.ts_packet_size_&&(n+=16);continue}f>0&&(h=this.parseAdaptationField(e,n+4,1+f)),p=5+f}if(1===c||3===c)if(0===A||A===this.current_pmt_pid_||void 0!==this.pmt_&&this.pmt_.pid_stream_type[A]===w.kSCTE35){var _=188-p;this.handleSectionSlice(e,n+p,_,{pid:A,file_position:o,payload_unit_start_indicator:l,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}else if(void 0!==(null===(i=this.pmt_)||void 0===i?void 0:i.pid_stream_type[A])){_=188-p;var m=this.pmt_.pid_stream_type[A];(A===this.pmt_.common_pids.h264||A===this.pmt_.common_pids.h265||A===this.pmt_.common_pids.adts_aac||A===this.pmt_.common_pids.loas_aac||A===this.pmt_.common_pids.ac3||A===this.pmt_.common_pids.eac3||A===this.pmt_.common_pids.opus||A===this.pmt_.common_pids.mp3||this.pmt_.pes_private_data_pids[A]||this.pmt_.timed_id3_pids[A])&&this.handlePESSlice(e,n+p,_,{pid:A,stream_type:m,file_position:o,payload_unit_start_indicator:l,continuity_conunter:u,random_access_indicator:h.random_access_indicator})}n+=188,204===this.ts_packet_size_&&(n+=16)}return this.dispatchAudioVideoMediaSegment(),n},t.prototype.parseAdaptationField=function(e,t,i){var n=new Uint8Array(e,t,i),o=n[0];return o>0?o>183?(r.A.w(this.TAG,"Illegal adaptation_field_length: ".concat(o)),{}):{discontinuity_indicator:(128&n[1])>>>7,random_access_indicator:(64&n[1])>>>6,elementary_stream_priority_indicator:(32&n[1])>>>5}:{}},t.prototype.handleSectionSlice=function(e,t,i,n){var r=new Uint8Array(e,t,i),o=this.section_slice_queues_?this.section_slice_queues_[n.pid]:{};if(n.payload_unit_start_indicator){var a=r[0];if(void 0!==o&&0!==(null==o?void 0:o.total_length)){var s=new Uint8Array(e,t+1,Math.min(i,a));o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):this.clearSlices(o,n)}for(var l=1+a;l<r.byteLength&&255!==r[l+0];){var A=(15&r[l+1])<<8|r[l+2];this.section_slice_queues_&&(this.section_slice_queues_[n.pid]=new B,o=this.section_slice_queues_[n.pid]),o.expected_length=A+3,o.file_position=n.file_position,o.random_access_indicator=n.random_access_indicator,s=new Uint8Array(e,t+l,Math.min(i-l,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):o.total_length>=o.expected_length&&this.clearSlices(o,n),l+=s.byteLength}}else void 0!==o&&0!==o.total_length&&(s=new Uint8Array(e,t,Math.min(i,o.expected_length-o.total_length)),o.slices.push(s),o.total_length+=s.byteLength,o.total_length===o.expected_length?this.emitSectionSlices(o,n):o.total_length>=o.expected_length&&this.clearSlices(o,n))},t.prototype.handlePESSlice=function(e,t,i,n){var o=new Uint8Array(e,t,i),a=o[0]<<16|o[1]<<8|o[2],s=(o[3],o[4]<<8|o[5]);if(n.payload_unit_start_indicator){if(1!==a)return void r.A.e(this.TAG,"handlePESSlice: packet_start_code_prefix should be 1 but with value ".concat(a));var l=this.pes_slice_queues_[n.pid];l&&(0===l.expected_length||l.expected_length===l.total_length?this.emitPESSlices(l,n):this.clearSlices(l,n)),this.pes_slice_queues_&&(this.pes_slice_queues_[n.pid]=new B,this.pes_slice_queues_[n.pid].file_position=n.file_position,this.pes_slice_queues_[n.pid].random_access_indicator=n.random_access_indicator)}if(void 0!==this.pes_slice_queues_[n.pid]){var A=this.pes_slice_queues_[n.pid];A.slices.push(o),n.payload_unit_start_indicator&&(A.expected_length=0===s?0:s+6),A.total_length+=o.byteLength,A.expected_length>0&&A.expected_length===A.total_length?this.emitPESSlices(A,n):A.expected_length>0&&A.expected_length<A.total_length&&this.clearSlices(A,n)}},t.prototype.emitSectionSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,r=0;n<e.slices.length;n++){var o=e.slices[n];i.set(o,r),r+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new O;a.pid=t.pid,a.data=i,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parseSection(a)},t.prototype.emitPESSlices=function(e,t){for(var i=new Uint8Array(e.total_length),n=0,r=0;n<e.slices.length;n++){var o=e.slices[n];i.set(o,r),r+=o.byteLength}e.slices=[],e.expected_length=-1,e.total_length=0;var a=new I;a.pid=t.pid,a.data=i,a.stream_type=t.stream_type,a.file_position=e.file_position,a.random_access_indicator=e.random_access_indicator,this.parsePES(a)},t.prototype.clearSlices=function(e,t){e.slices=[],e.expected_length=-1,e.total_length=0},t.prototype.parseSection=function(e){var t,i=e.data,n=e.pid;0===n?this.parsePAT(i):n===this.current_pmt_pid_?this.parsePMT(i):(null===(t=this.pmt_)||void 0===t?void 0:t.scte_35_pids[n])&&this.parseSCTE35(i)},t.prototype.parsePES=function(e){var t=e.data,i=t[0]<<16|t[1]<<8|t[2],n=t[3],o=t[4]<<8|t[5];if(1===i)if(188!==n&&190!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n){t[6];var a=(192&t[7])>>>6,s=t[8],l=void 0,A=void 0;2!==a&&3!==a||(l=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,A=3===a?536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2:l);var d=9+s,c=void 0;if(0!==o){if(o<3+s)return void r.A.v(this.TAG,"Malformed PES: PES_packet_length < 3 + PES_header_data_length");c=o-3-s}else c=t.byteLength-d;var u=t.subarray(d,d+c);switch(e.stream_type){case w.kMPEG1Audio:case w.kMPEG2Audio:this.parseMP3Payload(u,l);break;case w.kPESPrivateData:this.pmt_.common_pids.opus===e.pid?this.parseOpusPayload(u,l):this.pmt_.common_pids.ac3===e.pid?this.parseAC3Payload(u,l):this.pmt_.common_pids.eac3===e.pid?this.parseEAC3Payload(u,l):this.pmt_.smpte2038_pids[e.pid]?this.parseSMPTE2038MetadataPayload(u,l,A,e.pid,n):this.parsePESPrivateDataPayload(u,l,A,e.pid,n);break;case w.kADTSAAC:this.parseADTSAACPayload(u,l);break;case w.kLOASAAC:this.parseLOASAACPayload(u,l);break;case w.kAC3:this.parseAC3Payload(u,l);break;case w.kEAC3:this.parseEAC3Payload(u,l);break;case w.kID3:this.parseTimedID3MetadataPayload(u,l,A,e.pid,n);break;case w.kH264:this.parseH264Payload(u,l,A,e.file_position,e.random_access_indicator);break;case w.kH265:this.parseH265Payload(u,l,A,e.file_position,e.random_access_indicator)}}else 188!==n&&191!==n&&240!==n&&241!==n&&255!==n&&242!==n&&248!==n||e.stream_type!==w.kPESPrivateData||(d=6,c=void 0,c=0!==o?o:t.byteLength-d,u=t.subarray(d,d+c),this.parsePESPrivateDataPayload(u,void 0,void 0,e.pid,n));else r.A.e(this.TAG,"parsePES: packet_start_code_prefix should be 1 but with value ".concat(i))},t.prototype.parsePAT=function(e){var t=e[0];if(0===t){var i=(15&e[1])<<8|e[2],n=(e[3],e[4],(62&e[5])>>>1),o=1&e[5],a=e[6],s=(e[7],null);if(1===o&&0===a)(s=new T).version_number=n;else if(null==(s=this.pat_))return;for(var l=i-5-4,A=-1,d=-1,c=8;c<8+l;c+=4){var u=e[c]<<8|e[c+1],h=(31&e[c+2])<<8|e[c+3];0===u?s.network_pid=h:(s.program_pmt_pid[u]=h,-1===A&&(A=u),-1===d&&(d=h))}1===o&&0===a&&(void 0===this.pat_&&r.A.v(this.TAG,"Parsed first PAT: ".concat(JSON.stringify(s))),this.pat_=s,this.current_program_=A,this.current_pmt_pid_=d)}else r.A.e(this.TAG,"parsePAT: table_id ".concat(t," is not corresponded to PAT!"))},t.prototype.parsePMT=function(e){var t=e[0];if(2===t){var i=(15&e[1])<<8|e[2],n=e[3]<<8|e[4],o=(62&e[5])>>>1,a=1&e[5],s=e[6],l=(e[7],null);if(1===a&&0===s)(l=new L).program_number=n,l.version_number=o,this.program_pmt_map_[n]=l;else if(null==(l=this.program_pmt_map_[n]))return;e[8],e[9];for(var A=(15&e[10])<<8|e[11],d=12+A,c=i-9-A-4,u=d;u<d+c;){var h=e[u],p=(31&e[u+1])<<8|e[u+2],f=(15&e[u+3])<<8|e[u+4];l.pid_stream_type[p]=h;var _=l.common_pids.h264||l.common_pids.h265,m=l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.eac3||l.common_pids.opus||l.common_pids.mp3;if(h!==w.kH264||_)if(h!==w.kH265||_)if(h!==w.kADTSAAC||m)if(h!==w.kLOASAAC||m)if(h!==w.kAC3||m)if(h!==w.kEAC3||m)if(h!==w.kMPEG1Audio&&h!==w.kMPEG2Audio||m)if(h===w.kPESPrivateData){if(l.pes_private_data_pids[p]=!0,f>0){for(var v=u+5;v<u+5+f;){var g=e[v+0],y=e[v+1];if(5===g){var b=String.fromCharCode.apply(String,Ce([],Se(Array.from(e.subarray(v+2,v+2+y))),!1));"VANC"===b?l.smpte2038_pids[p]=!0:"Opus"===b&&(l.common_pids.opus=p)}else if(127===g&&p===l.common_pids.opus){var E=null;if(128===e[v+2]&&(E=e[v+3]),null==E){r.A.e(this.TAG,"Not Supported Opus channel count.");continue}var S={codec:"opus",channel_count:15&E?15&E:2,channel_config_code:E,sample_rate:48e3},C={codec:"opus",meta:S};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(C)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(C)):(this.audio_metadata_=S,this.dispatchAudioInitSegment(C))}v+=2+y}var T=e.subarray(u+5,u+5+f);this.dispatchPESPrivateDataDescriptor(p,h,T)}}else h===w.kID3?l.timed_id3_pids[p]=!0:h===w.kSCTE35&&(l.scte_35_pids[p]=!0);else l.common_pids.mp3=p;else l.common_pids.eac3=p;else l.common_pids.ac3=p;else l.common_pids.loas_aac=p;else l.common_pids.adts_aac=p;else l.common_pids.h265=p;else l.common_pids.h264=p;u+=5+f}n===this.current_program_&&(void 0===this.pmt_&&r.A.v(this.TAG,"Parsed first PMT: ".concat(JSON.stringify(l))),this.pmt_=l,(l.common_pids.h264||l.common_pids.h265)&&(this.has_video_=!0),(l.common_pids.adts_aac||l.common_pids.loas_aac||l.common_pids.ac3||l.common_pids.opus||l.common_pids.mp3)&&(this.has_audio_=!0))}else r.A.e(this.TAG,"parsePMT: table_id ".concat(t," is not corresponded to PMT!"))},t.prototype.parseSCTE35=function(e){var t=function(e){var t,i,n,r,o,a,s=new h(e),l=s.readBits(8),A=s.readBool(),d=s.readBool();s.readBits(2);var c=s.readBits(12),u=s.readBits(8),p=s.readBool(),f=s.readBits(6),_=4*s.readBits(31)+s.readBits(2),m=s.readBits(8),v=s.readBits(12),g=s.readBits(12),y=s.readBits(8),b=null;y===F.kSpliceNull?b={}:y===F.kSpliceSchedule?b=function(e){for(var t=e.readBits(8),i=[],n=0;n<t;n++)i.push(ee(e));return{splice_count:t,events:i}}(s):y===F.kSpliceInsert?b=function(e){var t=e.readBits(32),i=e.readBool();e.readBits(7);var n={splice_event_id:t,splice_event_cancel_indicator:i};if(i)return n;if(n.out_of_network_indicator=e.readBool(),n.program_splice_flag=e.readBool(),n.duration_flag=e.readBool(),n.splice_immediate_flag=e.readBool(),e.readBits(4),n.program_splice_flag&&!n.splice_immediate_flag&&(n.splice_time=Y(e)),!n.program_splice_flag){n.component_count=e.readBits(8),n.components=[];for(var r=0;r<n.component_count;r++)n.components.push(Z(n.splice_immediate_flag,e))}return n.duration_flag&&(n.break_duration=X(e)),n.unique_program_id=e.readBits(16),n.avail_num=e.readBits(8),n.avails_expected=e.readBits(8),n}(s):y===F.kTimeSignal?b=function(e){return{splice_time:Y(e)}}(s):y===F.kBandwidthReservation?b={}:y===F.kPrivateCommand?b=function(e,t){for(var i=String.fromCharCode(t.readBits(8),t.readBits(8),t.readBits(8),t.readBits(8)),n=new Uint8Array(e-4),r=0;r<e-4;r++)n[r]=t.readBits(8);return{identifier:i,private_data:n.buffer}}(g,s):s.readBits(8*g);for(var E=[],S=s.readBits(16),C=0;C<S;){var w=s.readBits(8),T=s.readBits(8),k=String.fromCharCode(s.readBits(8),s.readBits(8),s.readBits(8),s.readBits(8));0===w?E.push(te(w,T,k,s)):1===w?E.push(ie(w,T,k,s)):2===w?E.push(re(w,T,k,s)):3===w?E.push(oe(w,T,k,s)):4===w?E.push(se(w,T,k,s)):s.readBits(8*(T-4)),C+=2+T}var L={table_id:l,section_syntax_indicator:A,private_indicator:d,section_length:c,protocol_version:u,encrypted_packet:p,encryption_algorithm:f,pts_adjustment:_,cw_index:m,tier:v,splice_command_length:g,splice_command_type:y,splice_command:b,descriptor_loop_length:S,splice_descriptors:E,E_CRC32:p?s.readBits(32):void 0,CRC32:s.readBits(32)};if(y===F.kSpliceInsert){var I=b;if(I.splice_event_cancel_indicator)return{splice_command_type:y,detail:L,data:e};if(I.program_splice_flag&&!I.splice_immediate_flag){var O=I.duration_flag?null===(t=null==I?void 0:I.break_duration)||void 0===t?void 0:t.auto_return:void 0,B=I.duration_flag?((null===(i=null==I?void 0:I.break_duration)||void 0===i?void 0:i.duration)||0)/90:void 0;return(null===(n=I.splice_time)||void 0===n?void 0:n.time_specified_flag)?{splice_command_type:y,pts:(_+((null===(r=null==I?void 0:I.splice_time)||void 0===r?void 0:r.pts_time)||0))%Math.pow(2,33),auto_return:O,duraiton:B,detail:L,data:e}:{splice_command_type:y,auto_return:O,duraiton:B,detail:L,data:e}}return{splice_command_type:y,auto_return:O=I.duration_flag?null===(o=I.break_duration)||void 0===o?void 0:o.auto_return:void 0,duraiton:B=I.duration_flag?((null===(a=I.break_duration)||void 0===a?void 0:a.duration)||0)/90:void 0,detail:L,data:e}}if(y===F.kTimeSignal){var R=b;return R.splice_time.time_specified_flag?{splice_command_type:y,pts:(_+(R.splice_time.pts_time||0))%Math.pow(2,33),detail:L,data:e}:{splice_command_type:y,detail:L,data:e}}return{splice_command_type:y,detail:L,data:e}}(e);if(void 0!==t.pts){var i=Math.floor(t.pts/this.timescale_);t.pts=i}else t.nearest_pts=this.aac_last_sample_pts_;this.onSCTE35Metadata&&this.onSCTE35Metadata(t)},t.prototype.parseH264Payload=function(e,t,i,n,o){for(var a,s,l=new P(e),A=null,d=[],c=0,u=!1;null!=(A=l.readNextNaluPayload());){var h=new M(A);if(h.type===k.kSliceSPS){var f=p.parseSPS(A.data);this.video_init_segment_dispatched_?this.detectVideoMetadataChange(h,f)&&(r.A.v(this.TAG,"H264: Critical h264 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:h,pps:void 0,details:f}):this.video_metadata_&&(this.video_metadata_.sps=h,this.video_metadata_.details=f)}else h.type===k.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(this.video_metadata_&&(this.video_metadata_.pps=h),(null===(a=this.video_metadata_)||void 0===a?void 0:a.sps)&&(null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):(h.type===k.kSliceIDR||h.type===k.kSliceNonIDR&&1===o)&&(u=!0);this.video_init_segment_dispatched_&&(d.push(h),c+=h.data.byteLength)}var _=Math.floor(t/this.timescale_),m=Math.floor(i/this.timescale_);if(d.length){var v=this.video_track_,g={units:d,length:c,isKeyframe:u,dts:m,pts:_,cts:_-m,file_position:n};v&&(v.samples.push(g),v.length+=c)}},t.prototype.parseH265Payload=function(e,t,i,n,o){for(var a,s,l,A,d,c,u,h=new de(e),p=null,f=[],m=0,v=!1;null!=(p=h.readNextNaluPayload());){var g=new Ae(p);if(g.type===K.kSliceVPS){if(!this.video_init_segment_dispatched_){var y=_.parseVPS(p.data);this.video_metadata_&&(this.video_metadata_.vps=g,this.video_metadata_.details=Ee(Ee({},null===(a=this.video_metadata_)||void 0===a?void 0:a.details),y))}}else g.type===K.kSliceSPS?(y=_.parseSPS(p.data),this.video_init_segment_dispatched_?this.detectVideoMetadataChange(g,y)&&(r.A.v(this.TAG,"H265: Critical h265 metadata has been changed, attempt to re-generate InitSegment"),this.video_metadata_changed_=!0,this.video_metadata_={vps:void 0,sps:g,pps:void 0,details:y}):this.video_metadata_&&(this.video_metadata_.sps=g,this.video_metadata_.details=Ee(Ee({},null===(s=this.video_metadata_)||void 0===s?void 0:s.details),y))):g.type===K.kSlicePPS?this.video_init_segment_dispatched_&&!this.video_metadata_changed_||(y=_.parsePPS(p.data),this.video_metadata_&&(this.video_metadata_.pps=g,this.video_metadata_.details=Ee(Ee({},null===(l=this.video_metadata_)||void 0===l?void 0:l.details),y)),(null===(A=this.video_metadata_)||void 0===A?void 0:A.vps)&&(null===(d=this.video_metadata_)||void 0===d?void 0:d.sps)&&(null===(c=this.video_metadata_)||void 0===c?void 0:c.pps)&&(this.video_metadata_changed_&&this.dispatchVideoMediaSegment(),this.dispatchVideoInitSegment())):g.type!==K.kSliceIDR_W_RADL&&g.type!==K.kSliceIDR_N_LP&&g.type!==K.kSliceCRA_NUT||(v=!0);this.video_init_segment_dispatched_&&(f.push(g),m+=g.data.byteLength)}var b=Math.floor(t/this.timescale_),E=Math.floor(i/this.timescale_);if(f.length){var S=this.video_track_,C={units:f,length:m,isKeyframe:v,dts:E,pts:b,cts:b-E,file_position:n};S&&(null===(u=S.samples)||void 0===u||u.push(C),S.length+=m)}},t.prototype.detectVideoMetadataChange=function(e,t){var i,n,o,a,s,l,A,d,c,u;if(t.codec_mimetype!==(null===(n=null===(i=this.video_metadata_)||void 0===i?void 0:i.details)||void 0===n?void 0:n.codec_mimetype))return r.A.v(this.TAG,"Video: Codec mimeType changed from "+"".concat(null===(o=this.video_metadata_)||void 0===o?void 0:o.details.codec_mimetype," to ").concat(null==t?void 0:t.codec_mimetype)),!0;if(t.codec_size.width!==(null===(s=null===(a=this.video_metadata_)||void 0===a?void 0:a.details)||void 0===s?void 0:s.codec_size.width)||t.codec_size.height!==(null===(A=null===(l=this.video_metadata_)||void 0===l?void 0:l.details)||void 0===A?void 0:A.codec_size.height)){var h=null===(d=this.video_metadata_)||void 0===d?void 0:d.details.codec_size,p=t.codec_size;return r.A.v(this.TAG,"Video: Coded Resolution changed from "+"".concat(h.width,"x").concat(h.height," to ").concat(p.width,"x").concat(p.height)),!0}return t.present_size.width!==(null===(c=this.video_metadata_)||void 0===c?void 0:c.details.present_size.width)&&(r.A.v(this.TAG,"Video: Present resolution width changed from "+"".concat(null===(u=this.video_metadata_)||void 0===u?void 0:u.details.present_size.width," to ").concat(null==t?void 0:t.present_size.width)),!0)},t.prototype.isInitSegmentDispatched=function(){return this.has_video_&&this.has_audio_?this.video_init_segment_dispatched_&&this.audio_init_segment_dispatched_:this.has_video_&&!this.has_audio_?this.video_init_segment_dispatched_:!(this.has_video_||!this.has_audio_)&&this.audio_init_segment_dispatched_},t.prototype.dispatchVideoInitSegment=function(){var e,t,i,n,o,a,s,l,A,d,c,u,h=null===(e=this.video_metadata_)||void 0===e?void 0:e.details,p={type:"video"};p.id=null===(t=this.video_track_)||void 0===t?void 0:t.id,p.timescale=1e3,p.duration=this.duration_,p.codecWidth=h.codec_size.width,p.codecHeight=h.codec_size.height,p.presentWidth=h.present_size.width,p.presentHeight=h.present_size.height,p.profile=h.profile_string,p.level=h.level_string,p.bitDepth=h.bit_depth,p.chromaFormat=h.chroma_format,p.sarRatio=h.sar_ratio,p.frameRate=h.frame_rate;var f=p.frameRate.fps_den,_=p.frameRate.fps_num;if(p.refSampleDuration=f/_*1e3,p.codec=h.codec_mimetype,null===(i=this.video_metadata_)||void 0===i?void 0:i.vps){var m=null===(n=this.video_metadata_)||void 0===n?void 0:n.vps.data.subarray(4),v=null===(a=null===(o=this.video_metadata_)||void 0===o?void 0:o.sps)||void 0===a?void 0:a.data.subarray(4),g=null===(l=null===(s=this.video_metadata_)||void 0===s?void 0:s.pps)||void 0===l?void 0:l.data.subarray(4),y=new ce(m,v,g,h);p.hvcc=y.getData(),this.video_init_segment_dispatched_||r.A.v(this.TAG,"Generated first HEVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}else{v=null===(d=null===(A=this.video_metadata_)||void 0===A?void 0:A.sps)||void 0===d?void 0:d.data.subarray(4),g=null===(u=null===(c=this.video_metadata_)||void 0===c?void 0:c.pps)||void 0===u?void 0:u.data.subarray(4);var b=new U(v,g,h);p.avcc=b.getData(),this.video_init_segment_dispatched_||r.A.v(this.TAG,"Generated first AVCDecoderConfigurationRecord for mimeType: ".concat(p.codec))}this.onTrackMetadata&&this.onTrackMetadata("video",p),this.video_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var E=this.media_info_;E.hasVideo=!0,E.width=p.codecWidth,E.height=p.codecHeight,E.fps=p.frameRate.fps,E.profile=p.profile,E.level=p.level,E.refFrames=h.ref_frames,E.chromaFormat=h.chroma_format_string,E.sarNum=p.sarRatio.width,E.sarDen=p.sarRatio.height,E.videoCodec=p.codec,E.hasAudio&&E.audioCodec?E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,",").concat(E.audioCodec,'"'):E.mimeType='video/mp2t; codecs="'.concat(E.videoCodec,'"'),E.isComplete()&&this.onMediaInfo&&this.onMediaInfo(E)},t.prototype.dispatchVideoMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.video_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(null,this.video_track_)},t.prototype.dispatchAudioMediaSegment=function(){var e;this.isInitSegmentDispatched()&&(null===(e=this.audio_track_)||void 0===e?void 0:e.length)&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,null)},t.prototype.dispatchAudioVideoMediaSegment=function(){var e,t;this.isInitSegmentDispatched()&&((null===(e=this.audio_track_)||void 0===e?void 0:e.length)||(null===(t=this.video_track_)||void 0===t?void 0:t.length))&&this.onDataAvailable&&this.onDataAvailable(this.audio_track_,this.video_track_)},t.prototype.parseADTSAACPayload=function(e,t){var i,n,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/(null===(n=this.audio_metadata_)||void 0===n?void 0:n.sampling_frequency)*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var A=this.aac_last_sample_pts_+s;Math.abs(A-l)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(A,"ms, PES pts: ").concat(l,"ms")),l=A)}}for(var d=new G(e),c=null,u=l,h=0;null!=(c=d.readNextAACFrame());){s=1024/c.sampling_frequency*1e3;var p={codec:"aac",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(p)),h=u;var f=Math.floor(u),_={unit:c.data,length:c.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=c.data.byteLength),u+=s}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),h&&(this.aac_last_sample_pts_=h)}},t.prototype.parseLOASAACPayload=function(e,t){var i,n,o;if(!this.has_video_||this.video_init_segment_dispatched_){if(this.aac_last_incomplete_data_){var a=new Uint8Array(e.byteLength+this.aac_last_incomplete_data_.byteLength);a.set(this.aac_last_incomplete_data_,0),a.set(e,this.aac_last_incomplete_data_.byteLength),e=a}var s,l=0;if(void 0!==t&&(l=t/this.timescale_),"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){if(void 0===t&&void 0!==this.aac_last_sample_pts_)s=1024/this.audio_metadata_.sampling_frequency*1e3,l=this.aac_last_sample_pts_+s;else if(void 0===t)return void r.A.w(this.TAG,"AAC: Unknown pts");if(this.aac_last_incomplete_data_&&this.aac_last_sample_pts_){s=1024/this.audio_metadata_.sampling_frequency*1e3;var A=this.aac_last_sample_pts_+s;Math.abs(A-l)>1&&(r.A.w(this.TAG,"AAC: Detected pts overlapped, "+"expected: ".concat(A,"ms, PES pts: ").concat(l,"ms")),l=A)}}for(var d=new z(e),c=null,u=l,h=0;null!=(c=d.readNextAACFrame(null!==(n=this.loas_previous_frame)&&void 0!==n?n:void 0));){this.loas_previous_frame=c,s=1024/c.sampling_frequency*1e3;var p={codec:"aac",data:c};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(p)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(p)):(this.audio_metadata_={codec:"aac",audio_object_type:c.audio_object_type,sampling_freq_index:c.sampling_freq_index,sampling_frequency:c.sampling_frequency,channel_config:c.channel_config},this.dispatchAudioInitSegment(p)),h=u;var f=Math.floor(u),_={unit:c.data,length:c.data.byteLength,pts:f,dts:f};this.audio_track_&&(null===(o=this.audio_track_)||void 0===o||o.samples.push(_),this.audio_track_.length+=c.data.byteLength),u+=s}d.hasIncompleteData()&&(this.aac_last_incomplete_data_=d.getIncompleteData()),h&&(this.aac_last_sample_pts_=h)}},t.prototype.parseAC3Payload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ac-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=1536/this.audio_metadata_.sampling_frequency*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void r.A.w(this.TAG,"AC3: Unknown pts");for(var s=new _e(e),l=null,A=a,d=0;null!=(l=s.readNextAC3Frame());){o=1536/l.sampling_frequency*1e3;var c={codec:"ac-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"ac-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,bit_stream_mode:l.bit_stream_mode,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(c)),d=A;var u=Math.floor(A),h={unit:l.data,length:l.data.byteLength,pts:u,dts:u};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(h),this.audio_track_.length+=l.data.byteLength),A+=o}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseEAC3Payload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"ec-3"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=256*(this.audio_metadata_.num_blks||0)/(this.audio_metadata_.sampling_frequency||0)*1e3,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void r.A.w(this.TAG,"EAC3: Unknown pts");for(var s=new ge(e),l=null,A=a,d=0;null!=(l=s.readNextEAC3Frame());){o=1536/l.sampling_frequency*1e3;var c={codec:"ec-3",data:l};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(c)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(c)):(this.audio_metadata_={codec:"ec-3",sampling_frequency:l.sampling_frequency,bit_stream_identification:l.bit_stream_identification,low_frequency_effects_channel_on:l.low_frequency_effects_channel_on,num_blks:l.num_blks,channel_mode:l.channel_mode},this.dispatchAudioInitSegment(c)),d=A;var u=Math.floor(A),h={unit:l.data,length:l.data.byteLength,pts:u,dts:u};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(h),this.audio_track_.length+=l.data.byteLength),A+=o}d&&(this.aac_last_sample_pts_=d)}},t.prototype.parseOpusPayload=function(e,t){var i,n;if(!this.has_video_||this.video_init_segment_dispatched_){var o,a=0;if(void 0!==t&&(a=t/this.timescale_),"opus"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec))if(void 0===t&&void 0!==this.aac_last_sample_pts_)o=20,a=this.aac_last_sample_pts_+o;else if(void 0===t)return void r.A.w(this.TAG,"Opus: Unknown pts");for(var s=a,l=0,A=0;A<e.length;){o=20;for(var d=!!(16&e[A+1]),c=!!(8&e[A+1]),u=A+2,h=0;255===e[u];)h+=255,u+=1;h+=e[u],u+=1,u+=d?2:0,u+=c?2:0,l=s;var p=Math.floor(s),f=e.slice(u,u+h),_={unit:f,length:f.byteLength,pts:p,dts:p};this.audio_track_&&(null===(n=this.audio_track_)||void 0===n||n.samples.push(_),this.audio_track_.length+=f.byteLength),s+=o,A=u+h}l&&(this.aac_last_sample_pts_=l)}},t.prototype.parseMP3Payload=function(e,t){var i;if(!this.has_video_||this.video_init_segment_dispatched_){var n=e[1]>>>3&3,r=(6&e[1])>>1,o=(e[2],(12&e[2])>>>2),a=3&~(e[3]>>>6)?2:1,s=0,l=34;switch(n){case 0:s=[11025,12e3,8e3,0][o];break;case 2:s=[22050,24e3,16e3,0][o];break;case 3:s=[44100,48e3,32e3,0][o]}switch(r){case 1:l=34;break;case 2:l=33;break;case 3:l=32}var A=new he;A.object_type=l,A.sample_rate=s,A.channel_count=a,A.data=e;var d={codec:"mp3",data:A};this.audio_init_segment_dispatched_?this.detectAudioMetadataChange(d)&&(this.dispatchAudioMediaSegment(),this.dispatchAudioInitSegment(d)):(this.audio_metadata_={codec:"mp3",object_type:l,sample_rate:s,channel_count:a},this.dispatchAudioInitSegment(d));var c={unit:e,length:e.byteLength,pts:t/this.timescale_,dts:t/this.timescale_};this.audio_track_&&(null===(i=this.audio_track_)||void 0===i||i.samples.push(c),this.audio_track_.length+=e.byteLength)}},t.prototype.detectAudioMetadataChange=function(e){var t,i,n,o;if(e.codec!==(null===(t=this.audio_metadata_)||void 0===t?void 0:t.codec))return r.A.v(this.TAG,"Audio: Audio Codecs changed from "+"".concat(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec," to ").concat(e.codec)),!0;if("aac"===e.codec&&"aac"===this.audio_metadata_.codec){if((a=e.data).audio_object_type!==this.audio_metadata_.audio_object_type)return r.A.v(this.TAG,"AAC: AudioObjectType changed from "+"".concat(this.audio_metadata_.audio_object_type," to ").concat(a.audio_object_type)),!0;if(a.sampling_freq_index!==this.audio_metadata_.sampling_freq_index)return r.A.v(this.TAG,"AAC: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sampling_freq_index," to ").concat(a.sampling_freq_index)),!0;if(a.channel_config!==this.audio_metadata_.channel_config)return r.A.v(this.TAG,"AAC: Channel configuration changed from "+"".concat(null===(n=this.audio_metadata_)||void 0===n?void 0:n.channel_config," to ").concat(a.channel_config)),!0}else if("ac-3"===e.codec&&"ac-3"===this.audio_metadata_.codec){var a;if((a=e.data).sampling_frequency!==this.audio_metadata_.sampling_frequency)return r.A.v(this.TAG,"AC3: Sampling Frequency changed from "+"".concat(null===(o=this.audio_metadata_)||void 0===o?void 0:o.sampling_frequency," to ").concat(a.sampling_frequency)),!0;if(a.bit_stream_identification!==this.audio_metadata_.bit_stream_identification)return r.A.v(this.TAG,"AC3: Bit Stream Identification changed from "+"".concat(this.audio_metadata_.bit_stream_identification," to ").concat(a.bit_stream_identification)),!0;if(a.bit_stream_mode!==this.audio_metadata_.bit_stream_mode)return r.A.v(this.TAG,"AC3: BitStream Mode changed from "+"".concat(this.audio_metadata_.bit_stream_mode," to ").concat(a.bit_stream_mode)),!0;if(a.channel_mode!==this.audio_metadata_.channel_mode)return r.A.v(this.TAG,"AC3: Channel Mode changed from "+"".concat(this.audio_metadata_.channel_mode," to ").concat(a.channel_mode)),!0;if(a.low_frequency_effects_channel_on!==this.audio_metadata_.low_frequency_effects_channel_on)return r.A.v(this.TAG,"AC3: Low Frequency Effects Channel On changed from "+"".concat(this.audio_metadata_.low_frequency_effects_channel_on," to ").concat(a.low_frequency_effects_channel_on)),!0}else if("opus"===e.codec&&"opus"===this.audio_metadata_.codec){if((s=e.meta).sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"Opus: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"Opus: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}else if("mp3"===e.codec&&"mp3"===this.audio_metadata_.codec){var s;if((s=e.data).object_type!==this.audio_metadata_.object_type)return r.A.v(this.TAG,"MP3: AudioObjectType changed from "+"".concat(this.audio_metadata_.object_type," to ").concat(s.object_type)),!0;if(s.sample_rate!==this.audio_metadata_.sample_rate)return r.A.v(this.TAG,"MP3: SamplingFrequencyIndex changed from "+"".concat(this.audio_metadata_.sample_rate," to ").concat(s.sample_rate)),!0;if(s.channel_count!==this.audio_metadata_.channel_count)return r.A.v(this.TAG,"MP3: Channel count changed from "+"".concat(this.audio_metadata_.channel_count," to ").concat(s.channel_count)),!0}return!1},t.prototype.dispatchAudioInitSegment=function(e){var t,i,n,o,a,s,l={type:"audio"};if(l.id=null===(t=this.audio_track_)||void 0===t?void 0:t.id,l.timescale=1e3,l.duration=this.duration_,"aac"===(null===(i=this.audio_metadata_)||void 0===i?void 0:i.codec)){var A="aac"===e.codec?e.data:null,d=new H(A);l.audioSampleRate=d.sampling_rate,l.channelCount=d.channel_count,l.codec=d.codec_mimetype,l.originalCodec=d.original_codec_mimetype,l.config=d.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale}else if("ac-3"===(null===(n=this.audio_metadata_)||void 0===n?void 0:n.codec)){var c="ac-3"===e.codec?e.data:null,u=new me(c);l.audioSampleRate=u.sampling_rate,l.channelCount=u.channel_count,l.codec=u.codec_mimetype,l.originalCodec=u.original_codec_mimetype,l.config=u.config,l.refSampleDuration=1536/l.audioSampleRate*l.timescale}else if("ec-3"===(null===(o=this.audio_metadata_)||void 0===o?void 0:o.codec)){var h="ec-3"===e.codec?e.data:null,p=new ye(h);l.audioSampleRate=p.sampling_rate,l.channelCount=p.channel_count,l.codec=p.codec_mimetype,l.originalCodec=p.original_codec_mimetype,l.config=p.config,l.refSampleDuration=256*p.num_blks/l.audioSampleRate*l.timescale}else"opus"===(null===(a=this.audio_metadata_)||void 0===a?void 0:a.codec)?(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.channelConfigCode=this.audio_metadata_.channel_config_code,l.codec="opus",l.originalCodec="opus",l.config=void 0,l.refSampleDuration=20):"mp3"===(null===(s=this.audio_metadata_)||void 0===s?void 0:s.codec)&&(l.audioSampleRate=this.audio_metadata_.sample_rate,l.channelCount=this.audio_metadata_.channel_count,l.codec="mp3",l.originalCodec="mp3",l.config=void 0);this.audio_init_segment_dispatched_||r.A.v(this.TAG,"Generated first AudioSpecificConfig for mimeType: ".concat(l.codec)),this.onTrackMetadata&&this.onTrackMetadata("audio",l),this.audio_init_segment_dispatched_=!0,this.video_metadata_changed_=!1;var f=this.media_info_;f.hasAudio=!0,f.audioCodec=l.originalCodec,f.audioSampleRate=l.audioSampleRate,f.audioChannelCount=l.channelCount,f.hasVideo&&f.videoCodec?f.mimeType='video/mp2t; codecs="'.concat(f.videoCodec,",").concat(f.audioCodec,'"'):f.mimeType='video/mp2t; codecs="'.concat(f.audioCodec,'"'),f.isComplete()&&this.onMediaInfo&&this.onMediaInfo(f)},t.prototype.dispatchPESPrivateDataDescriptor=function(e,t,i){var n=new q;n.pid=e,n.stream_type=t,n.descriptor=i,this.onPESPrivateDataDescriptor&&this.onPESPrivateDataDescriptor(n)},t.prototype.parsePESPrivateDataPayload=function(e,t,i,n,r){var o=new W;if(o.pid=n,o.stream_id=r,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}else o.nearest_pts=this.aac_last_sample_pts_;if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onPESPrivateData&&this.onPESPrivateData(o)},t.prototype.parseTimedID3MetadataPayload=function(e,t,i,n,r){var o=new W;if(o.pid=n,o.stream_id=r,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}this.onTimedID3Metadata&&this.onTimedID3Metadata(o)},t.prototype.parseSMPTE2038MetadataPayload=function(e,t,i,n,r){var o=new ue;if(o.pid=n,o.stream_id=r,o.len=e.byteLength,o.data=e,void 0!==t){var a=Math.floor(t/this.timescale_);o.pts=a}if(o.nearest_pts=this.aac_last_sample_pts_,void 0!==i){var s=Math.floor(i/this.timescale_);o.dts=s}o.ancillaries=function(e){for(var t=new h(e),i=0,n=[];i+=6,0===t.readBits(6);){var r=t.readBool();i+=1;var o=t.readBits(11);i+=11;var a=t.readBits(12);i+=12;var s=255&t.readBits(10);i+=10;var l=255&t.readBits(10);i+=10;var A=255&t.readBits(10);i+=10;for(var d=new Uint8Array(A),c=0;c<A;c++){var u=255&t.readBits(10);i+=10,d[c]=u}t.readBits(10),i+=10;var p="User Defined";65===s?7===l&&(p="SCTE-104"):95===s?220===l?p="ARIB STD-B37 (1SEG)":221===l?p="ARIB STD-B37 (ANALOG)":222===l?p="ARIB STD-B37 (SD)":223===l&&(p="ARIB STD-B37 (HD)"):97===s&&(1===l?p="EIA-708":2===l&&(p="EIA-608")),n.push({yc_indicator:r,line_number:o,horizontal_offset:a,did:s,sdid:l,user_data:d,description:p,information:{}}),t.readBits(8-(i-Math.floor(i/8))%8),i+=(8-(i-Math.floor(i/8)))%8}return t.destroy(),t=null,n}(e),this.onSMPTE2038Metadata&&this.onSMPTE2038Metadata(o)},t}(C);const Te=we;var ke=new Uint8Array([0,0,0,0,0,0,0,0]),Le=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],hvc1:[],hvcC:[],av01:[],av1C:[],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)])},e.box=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=8,r=null,o=Array.prototype.slice.call(arguments,1),a=o.length,s=0;s<a;s++)n+=o[s].byteLength;(r=new Uint8Array(n))[0]=n>>>24&255,r[1]=n>>>16&255,r[2]=n>>>8&255,r[3]=255&n,r.set(e,4);var l=8;for(s=0;s<a;s++)r.set(o[s],l),l+=o[s].byteLength;return r},e.generateInitSegment=function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),n=e.moov(t),r=new Uint8Array(i.byteLength+n.byteLength);return r.set(i,0),r.set(n,i.byteLength),r},e.moov=function(t){var i=e.mvhd(t.timescale,t.duration),n=e.trak(t),r=e.mvex(t);return e.box(e.types.moov,i,n,r)},e.mvhd=function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,n=t.duration,r=t.presentWidth,o=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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,r>>>8&255,255&r,0,0,o>>>8&255,255&o,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,n=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,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var i;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i;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))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=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))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):"ac-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ac3(t)):"ec-3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.ec3(t)):"opus"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.Opus(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"video"===t.type&&t.codec.startsWith("hvc1")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t)):"video"===t.type&&t.codec.startsWith("av01")?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.av01(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.ac3=function(t){var i,n=t.channelCount,r=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types["ac-3"],o,e.box(e.types.dac3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.ec3=function(t){var i,n=t.channelCount,r=t.audioSampleRate,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types["ec-3"],o,e.box(e.types.dec3,new Uint8Array(null!==(i=t.config)&&void 0!==i?i:[])))},e.esds=function(t){var i,n=null!==(i=t.config)&&void 0!==i?i:[],r=n.length,o=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(n).concat([6,1,2]));return e.box(e.types.esds,o)},e.Opus=function(t){var i=t.channelCount,n=t.audioSampleRate,r=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,n>>>8&255,255&n,0,0]);return e.box(e.types.Opus,r,e.dOps(t))},e.dOps=function(t){var i=t.channelCount,n=t.channelConfigCode,r=t.audioSampleRate,o=[];switch(n){case 1:case 2:o=[0];break;case 0:o=[255,1,1,0,1];break;case 128:o=[255,2,0,0,1];break;case 3:o=[1,2,1,0,2,1];break;case 4:o=[1,2,2,0,1,2,3];break;case 5:o=[1,3,2,0,4,1,2,3];break;case 6:o=[1,4,2,0,4,1,2,3,5];break;case 7:o=[1,4,2,0,4,1,2,3,5,6];break;case 8:o=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:o=[1,1,2,0,1];break;case 131:o=[1,1,3,0,1,2];break;case 132:o=[1,1,4,0,1,2,3];break;case 133:o=[1,1,5,0,1,2,3,4];break;case 134:o=[1,1,6,0,1,2,3,4,5];break;case 135:o=[1,1,7,0,1,2,3,4,5,6];break;case 136:o=[1,1,8,0,1,2,3,4,5,6,7]}var a=new Uint8Array(function(e,t,i){if(2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([0,i,0,0,r>>>24&255,r>>>17&255,r>>>8&255,r>>>0&255,0,0],function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}(o),!1));return e.box(e.types.dOps,a)},e.avc1=function(t){var i=t.avcc,n=t.codecWidth,r=t.codecHeight,o=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,n>>>8&255,255&n,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,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,o,e.box(e.types.avcC,i))},e.hvc1=function(t){var i=t.hvcc,n=t.codecWidth,r=t.codecHeight,o=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,n>>>8&255,255&n,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,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,o,e.box(e.types.hvcC,i))},e.av01=function(t){var i,n,r=t.av1c,o=null!==(i=t.codecWidth)&&void 0!==i?i:192,a=null!==(n=t.codecHeight)&&void 0!==n?n:108,s=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,o>>>8&255,255&o,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,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.av01,s,e.box(e.types.av1C,r))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,n=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,n)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=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)},e.traf=function(t,i){var n=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,o,s,a)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,r=new Uint8Array(4+n),o=0;o<n;o++){var a=i[o].flags;r[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,r)},e.trun=function(t,i){var n=t.samples||[],r=n.length,o=12+16*r,a=new Uint8Array(o);i+=8+o,a.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var s=0;s<r;s++){var l=n[s].duration,A=n[s].size,d=n[s].flags,c=n[s].cts;a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,A>>>24&255,A>>>16&255,A>>>8&255,255&A,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.isNonSync,0,0,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*s)}return e.box(e.types.trun,a)},e.mdat=function(t){return e.box(e.types.mdat,t)},e.constants={FTYP:new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),STSD_PREFIX:new Uint8Array([0,0,0,0,0,0,0,1]),STTS:ke,STSC:ke,STCO:ke,STSZ:new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),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]),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]),DREF:new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),SMHD:new Uint8Array([0,0,0,0,0,0,0,0]),VMHD:new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e}();Le.init();const Ie=Le,Oe=function(){function e(){}return e.getSilentFrame=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])}return null},e}();var Be=i(1951);const Re=function(){function e(e){var t;this.TAG="MP4Remuxer",this._fillSilentAfterSeek=!1,this._config=e,this._isLive=!!e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Be.Sc("audio"),this._videoSegmentInfoList=new Be.Sc("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.A.chrome||!(o.A.version&&o.A.version.major<50||o.A.version&&50===o.A.version.major&&((null===(t=o.A.version)||void 0===t?void 0:t.build)||0)<2661)),this._fillSilentAfterSeek=!(!o.A.msedge&&!o.A.msie),this._mp3UseMpegAudio=!o.A.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){var t;return e.onDataAvailable=null===(t=this.remux)||void 0===t?void 0:t.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new d.j4("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),t&&this._remuxVideo(t),e&&this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",r="",i=new Uint8Array):i=Ie.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=Ie.generateInitSegment(t)}if(!this._onInitSegment)throw new d.j4("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:r,container:"".concat(e,"/").concat(n),mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){var i,n;this._dtsBaseInited||((null===(i=null==e?void 0:e.samples)||void 0===i?void 0:i.length)&&(this._audioDtsBase=e.samples[0].dts),(null===(n=null==t?void 0:t.samples)||void 0===n?void 0:n.length)&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.getTimestampBase=function(){if(this._dtsBaseInited)return this._dtsBase},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=null==e?void 0:e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=null==t?void 0:t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){var i,n,a,s,l,A,d;if(null!=this._audioMeta){var c,u,h=e,p=h.samples,f=-1,_=this._audioMeta.refSampleDuration,m="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,v=this._dtsBaseInited&&void 0===this._audioNextDts,g=!1;if(p&&0!==p.length&&(1!==p.length||t)){var y=0,b=null,E=0;m?(y=0,E=h.length):(y=8,E=8+h.length);var S=null;if(p.length>1&&(E-=(S=p.pop()).length),null!=this._audioStashedLastSample){var C=this._audioStashedLastSample;this._audioStashedLastSample=null,p.unshift(C),E+=C.length}null!=S&&(this._audioStashedLastSample=S);var w=p[0].dts-this._dtsBase;if(this._audioNextDts)c=w-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())c=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(g=!0);else{var T=this._audioSegmentInfoList.getLastSampleBefore(w);if(null!=T){var k=w-(T.originalDts+T.duration);k<=3&&(k=0),c=w-(T.dts+T.duration+k)}else c=0}if(g){var L=w-c,I=this._videoSegmentInfoList.getLastSegmentBefore(w);if(null!=I&&I.beginDts<L){if(N=Oe.getSilentFrame(null===(i=this._audioMeta)||void 0===i?void 0:i.originalCodec,null===(n=this._audioMeta)||void 0===n?void 0:n.channelCount)){var O=I.beginDts,B=L-I.beginDts;r.A.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(O,", duration: ").concat(B)),p.unshift({unit:N,dts:O,pts:O}),E+=N.byteLength}}else g=!1}for(var R=[],x=0;x<p.length;x++){var D=(C=p[x]).unit,M=C.dts-this._dtsBase,P=(O=M,!1),U=null,$=0;if(!(M<-.001)){if("mp3"!==this._audioMeta.codec){var F=M;if(this._audioNextDts&&(F=this._audioNextDts),(c=M-F)<=-3*(_||0)){r.A.w(this.TAG,"Dropping 1 audio frame (originalDts: ".concat(M," ms ,curRefDts: ").concat(F," ms) due to dtsCorrection: ").concat(c," ms overlap."));continue}if(c>=3*(_||0)&&this._fillAudioTimestampGap&&!o.A.safari){P=!0;var N,V=Math.floor(c/(_||0));r.A.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"originalDts: ".concat(M," ms, curRefDts: ").concat(F," ms, ")+"dtsCorrection: ".concat(Math.round(c)," ms, generate: ").concat(V," frames")),O=Math.floor(F),$=Math.floor(F+(_||0))-O,null==(N=Oe.getSilentFrame(null===(a=this._audioMeta)||void 0===a?void 0:a.originalCodec,this._audioMeta.channelCount))&&(r.A.w(this.TAG,"Unable to generate silent frame for "+"".concat(null===(s=this._audioMeta)||void 0===s?void 0:s.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),N=D),U=[];for(var j=0;j<V;j++){F+=_||0;var Q=Math.floor(F),G=Math.floor(F+(_||0))-Q,z={dts:Q,pts:Q,cts:0,unit:N,size:N.byteLength,duration:G,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};U.push(z),E+=z.size}this._audioNextDts=F+(_||0)}else O=Math.floor(F),$=Math.floor(F+(_||0))-O,this._audioNextDts=F+(_||0)}else O=M-c,$=x!==p.length-1?p[x+1].dts-this._dtsBase-c-O:null!=S?S.dts-this._dtsBase-c-O:R.length>=1?null===(l=R[R.length-1])||void 0===l?void 0:l.duration:Math.floor(_||0),this._audioNextDts=O+$;-1===f&&(f=O),R.push({dts:O,pts:O,cts:0,unit:C.unit,size:null===(A=C.unit)||void 0===A?void 0:A.byteLength,duration:$,originalDts:M,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),P&&R.push.apply(R,U)}}if(0===R.length)return h.samples=[],void(h.length=0);for(m?b=new Uint8Array(E):((b=new Uint8Array(E))[0]=E>>>24&255,b[1]=E>>>16&255,b[2]=E>>>8&255,b[3]=255&E,b.set(Ie.types.mdat,4)),x=0;x<R.length;x++)D=R[x].unit,b.set(D,y),y+=D.byteLength||0;var H=R[R.length-1];u=H.dts+H.duration;var W,q=new Be.EZ;q.beginDts=f,q.endDts=u,q.beginPts=f,q.endPts=u,q.originalBeginDts=R[0].originalDts,q.originalEndDts=H.originalDts+H.duration,q.firstSample=new Be.$_(R[0].dts,R[0].pts,R[0].duration,R[0].originalDts,!1),q.lastSample=new Be.$_(H.dts,H.pts,H.duration,H.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),h.samples=R,h.sequenceNumber++,W=m?new Uint8Array:Ie.moof(h,f),h.samples=[],h.length=0;var K={type:"audio",data:this._mergeBoxes(W,b).buffer,sampleCount:R.length,info:q};m&&v&&K&&(K.timestampOffset=f),null===(d=this._onMediaSegment)||void 0===d||d.call(this,"audio",K)}}},e.prototype._remuxVideo=function(e,t){var i,n;if(null!=this._videoMeta){var r,o,a,s=e,l=s.samples,A=-1,d=-1;if(l&&0!==l.length&&(1!==l.length||t)){var c=8,u=null,h=8+e.length,p=null;if(l.length>1&&(h-=(p=l.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,l.unshift(f),h+=(null==f?void 0:f.length)||0}null!=p&&(this._videoStashedLastSample=p);var _=l[0].dts-this._dtsBase;if(this._videoNextDts)r=_-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())r=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(_);if(null!=m){var v=_-(m.originalDts+m.duration);v<=3&&(v=0),r=_-(m.dts+m.duration+v)}else r=0}for(var g=new Be.EZ,y=[],b=0;b<l.length;b++){var E,S=(f=l[b]).dts-this._dtsBase,C=f.isKeyframe,w=S-r,T=f.cts,k=w+T;if(-1===A&&(A=w,d=k),E=b!==l.length-1?l[b+1].dts-this._dtsBase-r-w:null!=p?p.dts-this._dtsBase-r-w:y.length>=1?y[y.length-1].duration:Math.floor((null===(i=this._videoMeta)||void 0===i?void 0:i.refSampleDuration)||0),C){var L=new Be.$_(w,k,E,f.dts,!0);L.fileposition=f.fileposition,g.appendSyncPoint(L)}y.push({dts:w,pts:k,cts:T,units:f.units,size:f.length,isKeyframe:C,duration:E,originalDts:S,flags:{isLeading:0,dependsOn:C?2:1,isDependedOn:C?1:0,hasRedundancy:0,isNonSync:C?0:1}})}for((u=new Uint8Array(h))[0]=h>>>24&255,u[1]=h>>>16&255,u[2]=h>>>8&255,u[3]=255&h,u.set(Ie.types.mdat,4),b=0;b<y.length;b++)for(var I=y[b].units;null==I?void 0:I.length;){var O=I.shift(),B=null==O?void 0:O.data;u.set(B,c),c+=B.byteLength}var R=y[y.length-1];if(o=R.dts+R.duration,a=R.pts+R.duration,this._videoNextDts=o,g.beginDts=A,g.endDts=o,g.beginPts=d,g.endPts=a,g.originalBeginDts=y[0].originalDts,g.originalEndDts=R.originalDts+R.duration,g.firstSample=new Be.$_(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,!!y[0].isKeyframe),g.lastSample=new Be.$_(R.dts,R.pts,R.duration,R.originalDts,!!R.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),s.samples=y,s.sequenceNumber++,this._forceFirstIDR){var x=y[0].flags;x.dependsOn=2,x.isNonSync=0}var D=Ie.moof(s,A);s.samples=[],s.length=0,null===(n=this._onMediaSegment)||void 0===n||n.call(this,"video",{type:"video",data:this._mergeBoxes(D,u).buffer,sampleCount:y.length,info:g})}}},e.prototype._mergeBoxes=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i},e}();var xe=i(8098),De=i(550);const Me=function(){function e(e,t){var i;this.TAG="TransmuxingController",this._emitter=new n.A,this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!=typeof e.cors&&(e.cors=!0),"boolean"!=typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;var r=0;null===(i=this._mediaDataSource.segments)||void 0===i||i.forEach((function(i){i.timestampBase=r,r+=i.duration,i.cors=e.cors,i.withCredentials=e.withCredentials,t.referrerPolicy&&(i.referrerPolicy=t.referrerPolicy)})),isNaN(r)||this._mediaDataSource.duration===r||(this._mediaDataSource.duration=r),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return e.prototype.destroy=function(){var e,t,i;this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(null===(e=this._ioctl)||void 0===e||e.destroy(),this._ioctl=null),this._demuxer&&(null===(t=this._demuxer)||void 0===t||t.destroy(),this._demuxer=null),this._remuxer&&(null===(i=this._remuxer)||void 0===i||i.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},e.prototype._loadSegment=function(e,t){var i,n,r;if(this._currentSegmentIndex=e,null===(i=this._mediaDataSource)||void 0===i?void 0:i.segments){var o=null===(n=this._mediaDataSource)||void 0===n?void 0:n.segments[e],a=this._ioctl=new xe.A(o,this._config,e);a.onError=this._onIOException.bind(this),a.onSeeked=this._onIOSeeked.bind(this),a.onComplete=this._onIOComplete.bind(this),a.onRedirect=this._onIORedirect.bind(this),a.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?null===(r=this._demuxer)||void 0===r||r.bindDataSource(this._ioctl):a.onDataArrival=this._onInitChunkArrival.bind(this),a.open(t)}},e.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},e.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},e.prototype.pause=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isWorking())&&(this._ioctl.pause(),this._disableStatisticsReporter())},e.prototype.resume=function(){var e;(null===(e=this._ioctl)||void 0===e?void 0:e.isPaused())&&(this._ioctl.resume(),this._enableStatisticsReporter())},e.prototype.seek=function(e){var t,i,n,r,o,a,s,l,A,d,c,u,h,p;if(null!=this._mediaInfo&&(null===(t=this._mediaInfo)||void 0===t?void 0:t.isSeekable())){var f=this._searchSegmentIndexContains(e);if(f===this._currentSegmentIndex){var _=(null===(i=this._mediaInfo)||void 0===i?void 0:i.segments)?null===(n=this._mediaInfo)||void 0===n?void 0:n.segments[f]:{};if(void 0===_)this._pendingSeekTime=e;else{var m=null==_?void 0:_.getNearestKeyframe(e);null===(r=this._remuxer)||void 0===r||r.seek(null==m?void 0:m.milliseconds),null===(o=this._ioctl)||void 0===o||o.seek(null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds}}else{var v=(null===(a=this._mediaInfo)||void 0===a?void 0:a.segments)?null===(s=this._mediaInfo)||void 0===s?void 0:s.segments[f]:{};void 0===v?(this._pendingSeekTime=e,this._internalAbort(),null===(l=this._remuxer)||void 0===l||l.seek(),null===(A=this._remuxer)||void 0===A||A.insertDiscontinuity(),this._loadSegment(f)):(m=v.getNearestKeyframe(e),this._internalAbort(),null===(d=this._remuxer)||void 0===d||d.seek(e),null===(c=this._remuxer)||void 0===c||c.insertDiscontinuity(),this._demuxer&&(null===(u=this._demuxer)||void 0===u||u.resetMediaInfo(),this._demuxer.timestampBase=(null===(h=this._mediaDataSource)||void 0===h?void 0:h.segments)?null===(p=this._mediaDataSource)||void 0===p?void 0:p.segments[f].timestampBase:0),this._loadSegment(f,null==m?void 0:m.fileposition),this._pendingResolveSeekPoint=null==m?void 0:m.milliseconds,this._reportSegmentMediaInfo(f))}this._enableStatisticsReporter()}},e.prototype._searchSegmentIndexContains=function(e){var t,i=this._mediaDataSource.segments,n=((null==i?void 0:i.length)||0)-1;if(0===((null==i?void 0:i.length)||0))return n;for(var r=0;r<((null==i?void 0:i.length)||0);r++)if(i&&e<((null===(t=i[r])||void 0===t?void 0:t.timestampBase)||0)){n=r-1;break}return n},e.prototype._onInitChunkArrival=function(e,t){var i,n,o,a,s,l=this,A=0;if(t>0)null===(i=this._demuxer)||void 0===i||i.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments?null===(n=this._mediaDataSource.segments[this._currentSegmentIndex])||void 0===n?void 0:n.timestampBase:0,A=(null===(o=this._demuxer)||void 0===o?void 0:o.parseChunks(e,t))||0;else{var d=null;(d=S.probe(e)).match&&(this._setupFLVDemuxerRemuxer(d),A=(null===(a=this._demuxer)||void 0===a?void 0:a.parseChunks(e,t))||0),d.match||(null==d?void 0:d.needMoreData)||(d=Te.probe(e)).match&&(this._setupTSDemuxerRemuxer(d),A=(null===(s=this._demuxer)||void 0===s?void 0:s.parseChunks(e,t))||0),d.match||(null==d?void 0:d.needMoreData)||(d=null,r.A.e(this.TAG,"Non MPEG-TS/FLV, Unsupported media type!"),Promise.resolve().then((function(){l._internalAbort()})),this._emitter.emit(De.A.DEMUX_ERROR,f.A.FORMAT_UNSUPPORTED,"Non MPEG-TS/FLV, Unsupported media type!"))}return A},e.prototype._setupFLVDemuxerRemuxer=function(e){var t;this._demuxer=new S(e,this._config),this._remuxer||(this._remuxer=new Re(this._config));var i=this._mediaDataSource;void 0===i.duration||isNaN(i.duration)||(this._demuxer.overridedDuration=i.duration),"boolean"==typeof i.hasAudio&&(this._demuxer.overridedHasAudio=i.hasAudio),"boolean"==typeof i.hasVideo&&(this._demuxer.overridedHasVideo=i.hasVideo),i.segments&&this._demuxer&&this._remuxer&&(this._demuxer.timestampBase=null===(t=null==i?void 0:i.segments[this._currentSegmentIndex])||void 0===t?void 0:t.timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this))},e.prototype._setupTSDemuxerRemuxer=function(e){var t=this._demuxer=new Te(e,this._config);this._remuxer||(this._remuxer=new Re(this._config)),t.onError=this._onDemuxException.bind(this),t.onMediaInfo=this._onMediaInfo.bind(this),t.onMetaDataArrived=this._onMetaDataArrived.bind(this),t.onTimedID3Metadata=this._onTimedID3Metadata.bind(this),t.onSMPTE2038Metadata=this._onSMPTE2038Metadata.bind(this),t.onSCTE35Metadata=this._onSCTE35Metadata.bind(this),t.onPESPrivateDataDescriptor=this._onPESPrivateDataDescriptor.bind(this),t.onPESPrivateData=this._onPESPrivateData.bind(this),this._remuxer.bindDataSource(this._demuxer),this._demuxer.bindDataSource(this._ioctl),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this)},e.prototype._onMediaInfo=function(e){var t,i,n=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=(null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0,Object.setPrototypeOf(this._mediaInfo,a.A.prototype));var r=Object.assign({},e);Object.setPrototypeOf(r,a.A.prototype),this._mediaInfo.segments&&(this._mediaInfo.segments[this._currentSegmentIndex]=r),this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=n._pendingSeekTime;n._pendingSeekTime=null,n.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(De.A.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(De.A.SCRIPTDATA_ARRIVED,e)},e.prototype._onTimedID3Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.TIMED_ID3_METADATA_ARRIVED,e))},e.prototype._onSMPTE2038Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.dts&&(e.dts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SMPTE2038_METADATA_ARRIVED,e))},e.prototype._onSCTE35Metadata=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),this._emitter.emit(De.A.SCTE35_METADATA_ARRIVED,e))},e.prototype._onPESPrivateDataDescriptor=function(e){this._emitter.emit(De.A.PES_PRIVATE_DATA_DESCRIPTOR,e)},e.prototype._onPESPrivateData=function(e){var t,i=null===(t=this._remuxer)||void 0===t?void 0:t.getTimestampBase();void 0!==i&&(void 0!==e.pts&&(e.pts-=i),void 0!==e.nearest_pts&&(e.nearest_pts-=i),void 0!==e.dts&&(e.dts-=i),this._emitter.emit(De.A.PES_PRIVATE_DATA_ARRIVED,e))},e.prototype._onIOSeeked=function(){var e;null===(e=this._remuxer)||void 0===e||e.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t,i,n=e+1;n<((null===(i=null===(t=this._mediaDataSource)||void 0===t?void 0:t.segments)||void 0===i?void 0:i.length)||0)?(this._internalAbort(),this._remuxer&&this._remuxer.flushStashedSamples(),this._loadSegment(n)):(this._remuxer&&this._remuxer.flushStashedSamples(),this._emitter.emit(De.A.LOADING_COMPLETE),this._disableStatisticsReporter())},e.prototype._onIORedirect=function(e){var t,i=null===(t=this._ioctl)||void 0===t?void 0:t.extraData;this._mediaDataSource.segments&&(this._mediaDataSource.segments[i].redirectedURL=e)},e.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(De.A.RECOVERED_EARLY_EOF)},e.prototype._onIOException=function(e,t){r.A.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(De.A.IO_ERROR,e,t),this._disableStatisticsReporter()},e.prototype._onDemuxException=function(e,t){r.A.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(De.A.DEMUX_ERROR,e,t)},e.prototype._onRemuxerInitSegmentArrival=function(e,t){this._emitter.emit(De.A.INIT_SEGMENT,e,t)},e.prototype._onRemuxerMediaSegmentArrival=function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(De.A.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var i=t.info.syncPoints,n=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,o.A.safari&&i.length>0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(De.A.RECOMMEND_SEEKPOINT,n)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&this._reportStatisticsInfo&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t,i,n,r,o=(null===(t=this._mediaInfo)||void 0===t?void 0:t.segments)?null===(i=this._mediaInfo)||void 0===i?void 0:i.segments[e]:{},a=Object.assign({},o);a.duration=null===(n=this._mediaInfo)||void 0===n?void 0:n.duration,a.segmentCount=null===(r=this._mediaInfo)||void 0===r?void 0:r.segmentCount,delete a.segments,delete a.keyframesIndex,this._emitter.emit(De.A.MEDIA_INFO,a)},e.prototype._reportStatisticsInfo=function(){var e,t,i,n,r,o,a={};a.url=null===(e=this._ioctl)||void 0===e?void 0:e.currentURL,a.hasRedirect=null===(t=this._ioctl)||void 0===t?void 0:t.hasRedirect,a.hasRedirect&&(a.redirectedURL=null===(i=this._ioctl)||void 0===i?void 0:i.currentRedirectedURL),a.speed=null===(n=this._ioctl)||void 0===n?void 0:n.currentSpeed,a.loaderType=null===(r=this._ioctl)||void 0===r?void 0:r.loaderType,a.currentSegmentIndex=this._currentSegmentIndex,a.totalSegmentCount=null===(o=this._mediaDataSource.segments)||void 0===o?void 0:o.length,this._emitter.emit(De.A.STATISTICS_INFO,a)},e}()},9987:(e,t,i)=>{var n=i(4417).charAt;e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}return i.m=e,i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i(1900)})()))}(Xi)),Xi.exports);class Ji extends li{constructor(e){var t,i;super(e),this._videoMuted=!0,this.player=e;const n=document.createElement("video"),r=document.createElement("canvas");this.$posterElement=document.createElement("img"),n.oncontextmenu=e=>{e.preventDefault()},n.crossOrigin="anonymous",this._videoMuted=!window.___enableSoundOnUserInteraction___&&this.player._opt.autoPlay||this.player._opt.muted||!this.player._opt.hasAudio,n.muted=this._videoMuted,n.style.position="absolute",n.style.top="0px",n.style.left="0px",this._delayPlay=!1,e.$container.appendChild(n),this.videoInfo={width:"",height:"",encType:""},this.$videoElement=n,this.$canvasElement=r,this.canvasContext=r.getContext("2d"),this.fixChromeVideoFlashBug(),this.resize();const{proxy:o}=this.player.events;o(this.$videoElement,"loadstart",(()=>{this.player.emit("loadstart")})),o(this.$videoElement,"loadeddata",(()=>{this.player.debug.log("Video",`loadeddata ${this._delayPlay}`),this.player.emit(Nt.streamSuccess)})),o(this.$videoElement,"canplay",(()=>{this.player.debug.log("Video",`canplay and _delayPlay is ${this._delayPlay}`),this._delayPlay&&this._play(),this.player.$container.contains(this.$posterElement)&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement)})),o(this.$videoElement,"waiting",(()=>{this.player.emit(Nt.videoWaiting)})),o(this.$videoElement,"timeupdate",(()=>{this.player.emit(Nt.timeUpdate,this.currentTime),!this.isPlaying()&&this.init&&(this.player.debug.log("Video","timeupdate and this.isPlaying is false and retry play"),this.$videoElement.play())})),null===(i=null===(t=this.player.debug)||void 0===t?void 0:t.log)||void 0===i||i.call(t,"Video","init"),this._enableSoundOnUserInteraction=this._enableSoundOnUserInteraction.bind(this),window.addEventListener("mouseup",this._enableSoundOnUserInteraction),window.addEventListener("click",this._enableSoundOnUserInteraction),window.addEventListener("touchstart",this._enableSoundOnUserInteraction),window.addEventListener("keydown",this._enableSoundOnUserInteraction)}destroy(){var e;this.$canvasElement=null,this.canvasContext=null,this.$videoElement&&(this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.src="",this.$videoElement.removeAttribute("src")),this.trackGenerator&&(this.trackGenerator.stop(),this.trackGenerator=null),this.vwriter&&(this.vwriter.close(),this.vwriter=null),(null===(e=this.player.$container)||void 0===e?void 0:e.contains(this.$posterElement))&&this.$posterElement&&this.player.$container.removeChild(this.$posterElement),super.destroy(),this.player.debug.log("Video","destroy")}fixChromeVideoFlashBug(){const e=function(){const e=navigator.userAgent.toLowerCase(),t={},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(let n in i)if(i[n]){let i="";if("IE"===n)i=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===n){for(const e in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[e].type&&(n="360");i=e.match(/chrome\/([\d.]+)/)[1]}else"Firefox"===n?i=e.match(/firefox\/([\d.]+)/)[1]:"Opera"===n?i=e.match(/opera\/([\d.]+)/)[1]:"Safari"===n?i=e.match(/version\/([\d.]+)/)[1]:"Edge"===n?i=e.match(/edge\/([\d.]+)/)[1]:"QQBrowser"===n&&(i=e.match(/qqbrowser\/([\d.]+)/)[1]);t.type=n,t.version=parseInt(i)}return t}(),t=e.type.toLowerCase();if("chrome"===t||"edge"===t){this.player.$container.style.backdropFilter="blur(0px)"}}play(){if(this.$videoElement){const e=this._getVideoReadyState();if(this.player.debug.log("Video",`play and readyState: ${e}`),0===e)return this.player.debug.warn("Video","readyState is 0 and set _delayPlay to true"),void(this._delayPlay=!0);this._play()}}_getVideoReadyState(){let e=0;return this.$videoElement&&(e=this.$videoElement.readyState),e}_play(){if(this.$videoElement){const e=setTimeout((()=>{this.$videoElement.play().then((()=>{this._delayPlay=!1,this.player.debug.log("Video","_play success"),setTimeout((()=>{this.isPlaying()||(this.player.debug.warn("Video","play failed and retry play"),this._play())}),100)})).catch((e=>{this.player.debug.error("Video","_play error",e)})).finally((()=>{clearTimeout(e)}))}),20)}}pause(e){this._poster(),this.$videoElement.paused||(e?this.$videoElement&&this.$videoElement.pause():setTimeout((()=>{this.$videoElement&&this.$videoElement.pause()}),100))}clearView(){}screenshot(e,t,i,n){var r;e=e||ii()+"",n=n||Qt.download,t=t||"png";const o={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"};"number"!=typeof i&&(i=Number(i||.92));const a=this.$videoElement,s=this.$canvasElement;s.width=a.videoWidth,s.height=a.videoHeight,null===(r=this.canvasContext)||void 0===r||r.drawImage(a,0,0,s.width,s.height);const l=s.toDataURL(o[t]||o.png,i);if(setTimeout((()=>{var e;null===(e=this.canvasContext)||void 0===e||e.clearRect(0,0,s.width,s.height),s.width=0,s.height=0}),2e3),"data:,"!==l){if(n===Qt.base64)return l;{const i=ti(l,e+"."+t);return n===Qt.blob?i:n===Qt.download?(pi(i,e),i):void 0}}}initCanvasViewSize(){this.resize()}_poster(){const e=this.screenshot("poster","png",.75,Qt.base64);void 0===e||e.length<10||(this.$posterElement.src=e,this.$posterElement.style.position="absolute",this.$posterElement.style.top="0px",this.$posterElement.style.left="0px",this.$posterElement.style.zIndex="1",this.$posterElement.style.objectFit="contain",this.$posterElement.style.pointerEvents="none",this.player.$container.appendChild(this.$posterElement),this.resize())}render(e){this.vwriter&&this.vwriter.write(e.videoFrame)}resize(){this._resizeElement(this.$videoElement),this._resizeElement(this.$posterElement)}_resizeElement(e){const i=this.player._opt;let n=this.player.width,r=this.player.height;const o=i.rotate;this._isFullScreen&&[0,180].includes(this._orientation)&&t()&&([n,r]=[r,n]),e.width=n,e.height=r,270!==o&&90!==o||(e.width=r,e.height=n);const a=(n-e.width)/2,s=(r-e.height)/2;let l="contain";i.scaleMode===Ht.full&&(l="fill"),i.scaleMode===Ht.fullAuto&&(l="cover"),e.style.objectFit=l,e.style.transform="rotate("+o+"deg)",e.style.left=a+"px",e.style.top=s+"px"}isPlaying(){return this.$videoElement&&!this.$videoElement.paused}get currentTime(){var e;return(null===(e=this.$videoElement)||void 0===e?void 0:e.currentTime)||0}_enableSoundOnUserInteraction(){!this.player._opt.autoPlay||this.player.muted||window.____enableSoundOnUserInteraction___||(this.$videoElement.muted=!1),window.____enableSoundOnUserInteraction___=!0,window.removeEventListener("mouseup",this._enableSoundOnUserInteraction),window.removeEventListener("click",this._enableSoundOnUserInteraction),window.removeEventListener("touchstart",this._enableSoundOnUserInteraction),window.removeEventListener("keydown",this._enableSoundOnUserInteraction)}}class en extends Ui{constructor(e,t){super(e,t,Ji),this._checkLoadingTimeout=null,this._opt.useMSE=!0,this.emit(Nt.decoderLoaded),t.autoPlay&&this._createPlayer(t)}close(){}_createPlayer(e){var t;this._opt=Object.assign({},this._opt,e),this._removeFlvEvents(),this.player&&(this.player.unload(),this.player.detachMediaElement(),this.player.destroy(),this.player=null),this.events||(this.events=new Di(this)),this.video||(this.video=new Ji(this)),null===(t=Zi.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!this._opt.debug,enableDebug:!!this._opt.debug,enableInfo:!!this._opt.debug,enableWarn:!!this._opt.debug,enableError:!0}),this.player=Zi.createPlayer({type:"flv",url:e.url,isLive:e.isLive},{stashInitialSize:128,enableWorker:!0,liveBufferLatencyChasing:!0,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:86400,fixAudioTimestampGap:!1}),this.player.attachMediaElement(this.video.$videoElement),this._flvEvents()}_removeFlvEvents(){this.player&&(this.player.off(Zi.Events.ERROR),this.player.off(Zi.Events.LOADING_COMPLETE),this.player.off(Zi.Events.RECOVERED_EARLY_EOF),this.player.off(Zi.Events.MEDIA_INFO),this.player.off(Zi.Events.STATISTICS_INFO),this.player.off(Zi.Events.DESTROYING))}_flvEvents(){if(this.player){let e=0;this.player.on(Zi.Events.ERROR,((t,i,n)=>{var r;if("MediaError"===t&&"MediaMSEError"===i&&9===n.code&&this.emit(jt.mediaSourceH265NotSupport,n),this.emit(Nt.error,{errorTypes:t,errorDetails:i,info:n}),t.indexOf("NetworkError")>-1&&(this.emit(Nt.streamError,{errorTypes:t,errorDetails:i,info:n,api:this._opt.url,type:"stream"}),this.player))try{this.pause().then((()=>{this.emit(Nt.delayTimeout)})).catch((()=>{this.emit(Nt.delayTimeout)}))}catch(e){}if("MediaError"===t&&"CodecUnsupported"===i&&-1===n.code&&n.msg.indexOf("Unsupported audio codec"))0===e&&(qi.report(51,{event:t,value:n}),e=1,this.debug.error(`${Zi.Events.ERROR}`,t,i,JSON.stringify(n)),this.emit(Nt.audioCodecUnsupported,!0));else if(null===(r=n.msg)||void 0===r?void 0:r.includes("SourceBuffer is full")){const e=this.player._msectl._sourceBuffers[0];try{const t=this.video.$videoElement.currentTime;Math.max(0,t-5)>0&&e&&!e.updating&&e.remove(0,Math.max(0,t-5))}catch(e){}qi.report(51,{event:t,value:n}),this.debug.error(`${Zi.Events.ERROR}`,t,i,JSON.stringify(n))}else"NetworkError"===t&&"UnrecoverableEarlyEof"===i||(qi.report(51,{event:t,value:n}),this.debug.error(`${Zi.Events.ERROR}`,t,i,JSON.stringify(n)))})),this.player.on(Zi.Events.LOADING_COMPLETE,(e=>{this.debug.warn(`${Zi.Events.LOADING_COMPLETE}`,JSON.stringify(e))})),this.player.on(Zi.Events.RECOVERED_EARLY_EOF,(e=>{this.debug.warn(`${Zi.Events.RECOVERED_EARLY_EOF}`,e)})),this.player.on("media_info",(e=>{this.clearCheckLoadingTimeout(),this.video.updateVideoInfo(Object.assign({encTypeCode:(null==e?void 0:e.videoCodec.indexOf("avc"))>=0?7:12},e))})),this.player.on(Zi.Events.STATISTICS_INFO,(e=>{e.decodedFrames===this._decodedFrames&&null===this._checkHeartTimeout?this.checkHeartTimeout():e.decodedFrames!==this._decodedFrames&&(this.clearCheckHeartTimeout(),this._decodedFrames=e.decodedFrames)})),this.player.on(Zi.Events.DESTROYING,(e=>{this.debug.log(`${Zi.Events.DESTROYING}`,JSON.stringify(e))})),this.on(Nt.videoWaiting,(()=>{this.clearCheckHeartTimeout(),null===this._checkHeartTimeout&&this.handleRender()})),this._onVideoLoadstart=this._onVideoLoadstart.bind(this),this.off("loadstart"),this.on("loadstart",this._onVideoLoadstart),this.on(Nt.timeUpdate,(()=>{this.clearCheckHeartTimeout()})),this._onVideoStreamSuccess=this._onVideoStreamSuccess.bind(this),this.off(Nt.streamSuccess,this._onVideoStreamSuccess),this.on(Nt.streamSuccess,this._onVideoStreamSuccess)}}_onVideoLoadstart(){this.checkLoadingTimeout()}_onVideoStreamSuccess(){this.clearCheckLoadingTimeout()}getOption(){return this._opt}emitError(e,t=""){this.emit(Nt.error,e,t),this.emit(e,t)}destroy(){this._destroy(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.video&&(this.video.destroy(),this.video=null),this.events&&(this.events.destroy(),this.events=null),this.emit("destroy"),this.off(),this.debug.log("play","destroy end")}_destroy(){this.player&&this.playing&&this.player.pause(),this._flvPlayerDestroy(),this._loading=!1,this._playing=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0}resetStats(){}get loaded(){return!0}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(Nt.playing,e),e?this.emit(Nt.play):this.emit(Nt.pause))}get playing(){return this._playing}get muted(){return this._muted}set muted(e){this.video&&(this.video.$videoElement.muted=e,this.player&&(this.player.muted=e)),super._updateMuted(e)}get volume(){return this._volume}set volume(e){super._updateVolume(e),this.video&&(this.video.$videoElement.volume=e)}set loading(e){this.loading!==e&&(this._loading=e,this.emit(Nt.loading,this._loading),e||this.emit(Nt.loaded))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}set videoTimestamp(e){null!==e&&(this._videoTimestamp=e)}get videoTimestamp(){return this._videoTimestamp}get isDebug(){return!!this._opt.debug}checkLoadingTimeout(){var e;0!==this._opt.loadingTimeout&&(this._checkLoadingTimeout=setTimeout((()=>{this.clearCheckLoadingTimeout();try{this.pause().then((()=>{this.emit(Nt.timeout,Nt.loadingTimeout),this.emit(Nt.loadingTimeout)})).catch((()=>{this.emit(Nt.timeout,Nt.loadingTimeout),this.emit(Nt.loadingTimeout)}))}catch(e){}}),1e3*((null===(e=this._opt)||void 0===e?void 0:e.loadingTimeout)||10)))}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}checkHeart(){this.clearCheckHeartTimeout(),this.checkHeartTimeout()}clearCheckHeartTimeout(){this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}checkHeartTimeout(){var e,t;if(0===this._opt.heartTimeout)return;const i=(null===(e=this.video)||void 0===e?void 0:e.currentTime)||0;this._checkHeartTimeout=setTimeout((()=>{var e;if(this._checkHeartTimeout&&this.clearCheckHeartTimeout(),this.playing&&this.video){if(i!==((null===(e=this.video)||void 0===e?void 0:e.currentTime)||0))return;try{this.pause().then((()=>{this.emit(Nt.timeout,Nt.heartTimeout),this.emit(Nt.heartTimeout)})).catch((()=>{this.emit(Nt.timeout,Nt.heartTimeout),this.emit(Nt.heartTimeout)}))}catch(e){}}}),1e3*((null===(t=this._opt)||void 0===t?void 0:t.heartTimeout)||5))}handleRender(){this.loading&&(this.emit(Nt.start),this.loading=!1),this.playing||(this.playing=!0),this.checkHeart()}updateOption(e){var t;super.updateOption(e),null===(t=Zi.LoggingControl)||void 0===t||t.applyConfig({globalTag:"EzuikitFlv",enableVerbose:!!e.debug,enableDebug:!!e.debug,enableInfo:!!e.debug,enableWarn:!!e.debug,enableError:!0})}play(e={}){return this._play(e)}_play(e={}){return this.player&&this._destroy(),this.clearCheckHeartTimeout(),this._createPlayer(Object.assign({},this._opt,e)),this.loading=!0,this._playing=!1,this._times.playInitStart=ii(),this.player?(this.player.load(),new Promise(((e,t)=>{this.player.play().then((()=>{this.loading=!1,this.playing=!0,this._opt.muted||(this.muted=!1),e()})).catch((e=>{t(e)}))}))):Promise.reject()}_flvPlayerDestroy(){this.player&&(this.video.pause(),this.player.unload(),this._removeFlvEvents(),this.player.detachMediaElement(),this.player.destroy(),this.player=null)}_close(){return new Promise((e=>{this._loading=!1,this._playing=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.video&&this.video.resetInit(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.player&&(this._flvPlayerDestroy(),this._pause=!0),this.resetStats(),this._audioTimestamp=0,this._videoTimestamp=0,setTimeout((()=>{e()}),110)}))}pause(){return this._close()}resumeAudioAfterPause(){}}class tn{constructor(e,t){this._opt=Object.assign({},bt,t),(oi()||"360EE"===_t().browser)&&(this._opt.useMSE=!1);return new(tn.getLoaderFactory(this._opt.useMSE))(e,this._opt)}static getLoaderFactory(e){return e?en:Ki}}function nn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=new URL(e),n=e.split("?")[1];let r={};if(n){const e=n.split("&");for(let t of e){if(""===t)continue;const e=t.split("=");e[0]&&(r[e[0]]=e[1])}}const o={protocol:i.protocol,hostname:i.hostname,port:i.port,pathname:i.pathname,search:i.search,query:r,url:e};if(t&&/_(\d+)_(\d+)\.flv/.test(e)){const e=i.pathname.split("/")[i.pathname.split("/").length-1].replace(/.flv$/,"").split("_");e[0].indexOf("-")>=0?(o.streamName=e[0].split("-")[0],o.deviceSerial=e[0].split("-")[1]):o.deviceSerial=e[0],o.channelNo=+e[1],o.streamTypeIn=+e[2]}return o}var rn,on={exports:{}},an=a(Object.freeze({__proto__:null,default:{}}));var sn=(rn||(rn=1,function(e){!function(){var t="input is invalid type",i="object"==typeof window,n=i?window:{};n.JS_MD5_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self,a=!n.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?n=r:o&&(n=self);var s,l=!n.JS_MD5_NO_COMMON_JS&&e.exports,A=!n.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),c=[128,32768,8388608,-2147483648],u=[0,8,16,24],h=["hex","array","digest","buffer","arrayBuffer","base64"],p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];if(A){var _=new ArrayBuffer(68);s=new Uint8Array(_),f=new Uint32Array(_)}var m=Array.isArray;!n.JS_MD5_NO_NODE_JS&&m||(m=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var v=ArrayBuffer.isView;!A||!n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&v||(v=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e){var i=typeof e;if("string"===i)return[e,!0];if("object"!==i||null===e)throw new Error(t);if(A&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!v(e))throw new Error(t);return[e,!1]},y=function(e){return function(t){return new S(!0).update(t)[e]()}},b=function(e){var i,r=an,o=an.Buffer;return i=o.from&&!n.JS_MD5_NO_BUFFER_FROM?o.from:function(e){return new o(e)},function(n){if("string"==typeof n)return r.createHash("md5").update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),m(n)||v(n)||n.constructor===o?r.createHash("md5").update(i(n)).digest("hex"):e(n)}},E=function(e){return function(t,i){return new C(t,!0).update(i)[e]()}};function S(e){if(e)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=s;else if(A){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function C(e,t){var i,n=g(e);if(e=n[0],n[1]){var r,o=[],a=e.length,s=0;for(i=0;i<a;++i)(r=e.charCodeAt(i))<128?o[s++]=r:r<2048?(o[s++]=192|r>>>6,o[s++]=128|63&r):r<55296||r>=57344?(o[s++]=224|r>>>12,o[s++]=128|r>>>6&63,o[s++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++i)),o[s++]=240|r>>>18,o[s++]=128|r>>>12&63,o[s++]=128|r>>>6&63,o[s++]=128|63&r);e=o}e.length>64&&(e=new S(!0).update(e).array());var l=[],A=[];for(i=0;i<64;++i){var d=e[i]||0;l[i]=92^d,A[i]=54^d}S.call(this,t),this.update(A),this.oKeyPad=l,this.inner=!0,this.sharedMemory=t}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=g(e);e=t[0];for(var i,n,r=t[1],o=0,a=e.length,s=this.blocks,l=this.buffer8;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),r)if(A)for(n=this.start;o<a&&n<64;++o)(i=e.charCodeAt(o))<128?l[n++]=i:i<2048?(l[n++]=192|i>>>6,l[n++]=128|63&i):i<55296||i>=57344?(l[n++]=224|i>>>12,l[n++]=128|i>>>6&63,l[n++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),l[n++]=240|i>>>18,l[n++]=128|i>>>12&63,l[n++]=128|i>>>6&63,l[n++]=128|63&i);else for(n=this.start;o<a&&n<64;++o)(i=e.charCodeAt(o))<128?s[n>>>2]|=i<<u[3&n++]:i<2048?(s[n>>>2]|=(192|i>>>6)<<u[3&n++],s[n>>>2]|=(128|63&i)<<u[3&n++]):i<55296||i>=57344?(s[n>>>2]|=(224|i>>>12)<<u[3&n++],s[n>>>2]|=(128|i>>>6&63)<<u[3&n++],s[n>>>2]|=(128|63&i)<<u[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),s[n>>>2]|=(240|i>>>18)<<u[3&n++],s[n>>>2]|=(128|i>>>12&63)<<u[3&n++],s[n>>>2]|=(128|i>>>6&63)<<u[3&n++],s[n>>>2]|=(128|63&i)<<u[3&n++]);else if(A)for(n=this.start;o<a&&n<64;++o)l[n++]=e[o];else for(n=this.start;o<a&&n<64;++o)s[n>>>2]|=e[o]<<u[3&n++];this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=c[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},S.prototype.hash=function(){var e,t,i,n,r,o,a=this.blocks;this.first?t=((t=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879|0)^(i=((i=(-271733879^(n=((n=(-1732584194^2004318071&e)+a[1]-117830708)<<12|n>>>20)+e|0)&(-271733879^e))+a[2]-1126478375)<<17|i>>>15)+n|0)&(n^e))+a[3]-1316259209)<<22|t>>>10)+i|0:(e=this.h0,t=this.h1,i=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(i^n))+a[0]-680876936)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[1]-389564586)<<12|n>>>20)+e|0)&(e^t))+a[2]+606105819)<<17|i>>>15)+n|0)&(n^e))+a[3]-1044525330)<<22|t>>>10)+i|0),t=((t+=((e=((e+=(n^t&(i^n))+a[4]-176418897)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[5]+1200080426)<<12|n>>>20)+e|0)&(e^t))+a[6]-1473231341)<<17|i>>>15)+n|0)&(n^e))+a[7]-45705983)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(n^t&(i^n))+a[8]+1770035416)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[9]-1958414417)<<12|n>>>20)+e|0)&(e^t))+a[10]-42063)<<17|i>>>15)+n|0)&(n^e))+a[11]-1990404162)<<22|t>>>10)+i|0,t=((t+=((e=((e+=(n^t&(i^n))+a[12]+1804603682)<<7|e>>>25)+t|0)^(i=((i+=(t^(n=((n+=(i^e&(t^i))+a[13]-40341101)<<12|n>>>20)+e|0)&(e^t))+a[14]-1502002290)<<17|i>>>15)+n|0)&(n^e))+a[15]+1236535329)<<22|t>>>10)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[1]-165796510)<<5|e>>>27)+t|0)^t))+a[6]-1069501632)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[11]+643717713)<<14|i>>>18)+n|0)^n))+a[0]-373897302)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[5]-701558691)<<5|e>>>27)+t|0)^t))+a[10]+38016083)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[15]-660478335)<<14|i>>>18)+n|0)^n))+a[4]-405537848)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[9]+568446438)<<5|e>>>27)+t|0)^t))+a[14]-1019803690)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[3]-187363961)<<14|i>>>18)+n|0)^n))+a[8]+1163531501)<<20|t>>>12)+i|0,t=((t+=((n=((n+=(t^i&((e=((e+=(i^n&(t^i))+a[13]-1444681467)<<5|e>>>27)+t|0)^t))+a[2]-51403784)<<9|n>>>23)+e|0)^e&((i=((i+=(e^t&(n^e))+a[7]+1735328473)<<14|i>>>18)+n|0)^n))+a[12]-1926607734)<<20|t>>>12)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[5]-378558)<<4|e>>>28)+t|0))+a[8]-2022574463)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[11]+1839030562)<<16|i>>>16)+n|0))+a[14]-35309556)<<23|t>>>9)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[1]-1530992060)<<4|e>>>28)+t|0))+a[4]+1272893353)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[7]-155497632)<<16|i>>>16)+n|0))+a[10]-1094730640)<<23|t>>>9)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[13]+681279174)<<4|e>>>28)+t|0))+a[0]-358537222)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[3]-722521979)<<16|i>>>16)+n|0))+a[6]+76029189)<<23|t>>>9)+i|0,t=((t+=((o=(n=((n+=((r=t^i)^(e=((e+=(r^n)+a[9]-640364487)<<4|e>>>28)+t|0))+a[12]-421815835)<<11|n>>>21)+e|0)^e)^(i=((i+=(o^t)+a[15]+530742520)<<16|i>>>16)+n|0))+a[2]-995338651)<<23|t>>>9)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[0]-198630844)<<6|e>>>26)+t|0)|~i))+a[7]+1126891415)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[14]-1416354905)<<15|i>>>17)+n|0)|~e))+a[5]-57434055)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[12]+1700485571)<<6|e>>>26)+t|0)|~i))+a[3]-1894986606)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[10]-1051523)<<15|i>>>17)+n|0)|~e))+a[1]-2054922799)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[8]+1873313359)<<6|e>>>26)+t|0)|~i))+a[15]-30611744)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[6]-1560198380)<<15|i>>>17)+n|0)|~e))+a[13]+1309151649)<<21|t>>>11)+i|0,t=((t+=((n=((n+=(t^((e=((e+=(i^(t|~n))+a[4]-145523070)<<6|e>>>26)+t|0)|~i))+a[11]-1120210379)<<10|n>>>22)+e|0)^((i=((i+=(e^(n|~t))+a[2]+718787259)<<15|i>>>17)+n|0)|~e))+a[9]-343485551)<<21|t>>>11)+i|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=i-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+i|0,this.h3=this.h3+n|0)},S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return d[e>>>4&15]+d[15&e]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>28&15]+d[e>>>24&15]+d[t>>>4&15]+d[15&t]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>28&15]+d[t>>>24&15]+d[i>>>4&15]+d[15&i]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>28&15]+d[i>>>24&15]+d[n>>>4&15]+d[15&n]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>28&15]+d[n>>>24&15]},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,n=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&i,i>>>8&255,i>>>16&255,i>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255]},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},S.prototype.buffer=S.prototype.arrayBuffer,S.prototype.base64=function(){for(var e,t,i,n="",r=this.array(),o=0;o<15;)e=r[o++],t=r[o++],i=r[o++],n+=p[e>>>2]+p[63&(e<<4|t>>>4)]+p[63&(t<<2|i>>>6)]+p[63&i];return e=r[o],n+=p[e>>>2]+p[e<<4&63]+"=="},C.prototype=new S,C.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var w=function(){var e=y("hex");a&&(e=b(e)),e.create=function(){return new S},e.update=function(t){return e.create().update(t)};for(var t=0;t<h.length;++t){var i=h[t];e[i]=y(i)}return e}();w.md5=w,w.md5.hmac=function(){var e=E("hex");e.create=function(e){return new C(e)},e.update=function(t,i){return e.create(t).update(i)};for(var t=0;t<h.length;++t){var i=h[t];e[i]=E(i)}return e}(),l?e.exports=w:n.md5=w}()}(on)),on.exports),ln=o(sn);const An="/api/v3/device/local/video/unify/query",dn="/api/service/device/capacity/video/quality",cn="/api/v3/device/setVideoLevel",un="/api/lapp/v2/live/address/get",hn="/api/service/media/live/cdn/config",pn="/api/service/media/live/record/cdn/config",fn="/api/service/media/streammanage/interrupt/info";function _n(e){return e<10?"0"+e:e+""}const mn={0:"流畅",1:"标清",2:"高清",3:"超清",4:"极清",5:"3K",6:"4K"},vn=[{videoLevel:1,name:mn[1],streamTypeIn:2,type:"compatible"},{videoLevel:2,name:mn[2],streamTypeIn:1,type:"compatible"}];class gn{constructor(e,t){this._player=e,this.baseURL=(t.baseURL||"https://open.ys7.com").replace(/\/$/,""),this.accessToken=t.accessToken,this.deviceSerial=t.deviceSerial,this.channelNo=t.channelNo,this.appName=t.appName,this.v=t.v}fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=/http[s]?:\/\//.test(e)?e:`${this.baseURL}${e}`,n=t.headers;return delete t.headers,fetch(i,{...t||{},...null===n?{}:{headers:{clientType:"ezuikit-flv",accessToken:this.accessToken,deviceSerial:this.deviceSerial,localIndex:this.channelNo,...n||{}}}})}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"get"})}post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch(e,{...t||{},method:"post"})}setVideoLevelService(e){const t=new FormData;return t.append("videoLevel",parseInt(e)),this.post(`${cn}`,{body:t}).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,jt.fetchError,{api:cn,error:e})}))}async getLocalVideoUnifyQueryService(e){var t,i,n,r;const o=(e.startTime+36e5*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0))/1e3,a=(e.endTime+36e5*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0))/1e3,s=async e=>{let t=[];try{var i,n,r;const A=await this.get(`${An}?startTime=${e.startTime}&endTime=${e.endTime}&pageSize=${e.pageSize||200}`).then((e=>e.json())).catch((e=>{var t,i;null===(t=(i=this._player).emit)||void 0===t||t.call(i,jt.fetchError,{api:An,error:e})}));var o,a,l;if(200!==(null==A||null===(i=A.meta)||void 0===i?void 0:i.code))return null===(o=(a=this._player).emit)||void 0===o||o.call(a,jt.fetchError,{api:An,error:null==A?void 0:A.meta}),t;if(null!=A&&null!==(n=A.data)&&void 0!==n&&null!==(n=n.records)&&void 0!==n&&n.length&&(t=t.concat(A.data.records||[])),null!=A&&null!==(r=A.data)&&void 0!==r&&r.hasMore)t=t.concat(await s({...e,startTime:null==A||null===(l=A.data)||void 0===l?void 0:l.nextFileTime}))}catch(e){}return t},l=await s({...e,startTime:o,endTime:a})||[];return this._player.playbackRecords=(l||[]).map((e=>{var t,i;return{...e,startTime:e.startTime-3600*((null===(t=this._player._opt)||void 0===t?void 0:t.timeZone)||0),endTime:e.endTime-3600*((null===(i=this._player._opt)||void 0===i?void 0:i.timeZone)||0)}})).reduce(((e,t)=>{const i=e[e.length-1];return i&&i.endTime===t.startTime?i.endTime=t.endTime:e.push(t),e}),[]),null===(n=(r=this._player).emit)||void 0===n||n.call(r,Nt.localVideoRecords,this._player.playbackRecords),l}async getVideoQualityService(){let e=vn;try{var t,i;const o=await this.get(`${dn}?deviceSerial=${this.deviceSerial}`).then((e=>e.json())).catch((e=>{this._player.emit(jt.fetchError,{api:dn,error:e})}));var n,r;if(200!==(null==o||null===(t=o.meta)||void 0===t?void 0:t.code))return null===(n=(r=this._player).emit)||void 0===n||n.call(r,jt.fetchError,{api:dn,error:null==o?void 0:o.meta}),e;null!=o&&null!==(i=o.data)&&void 0!==i&&i.length&&(e=o.data)}catch(e){}return e=e.map((e=>({...e,name:mn[e.videoLevel]||"未知"}))),e}getPlayAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new FormData;return Object.keys(e).forEach((i=>{t.append(i,e[i])})),t.append("protocol",4),t.append("accessToken",this.accessToken),t.append("deviceSerial",this.deviceSerial),t.append("channelNo",this.channelNo),this.post(`${un}`,{body:t}).then((e=>e.json())).then((e=>{var t;return 200==+e.code?null==e||null===(t=e.data)||void 0===t?void 0:t.url:""}))}getRecordAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNRecordAddressService(e)):this.getPlayAddressService({...e,type:2})}getLiveAddressService(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.appName&&this.v?(delete e.expireTime,this.getCDNLiveAddressService(e)):this.getPlayAddressService({...e,type:1})}getCDNPlayAddressService(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new FormData,n=new Date,r=`${n.getFullYear()}-${_n(n.getMonth()+1)}-${_n(n.getDate())} 00:00:00`,o=`${n.getFullYear()}-${_n(n.getMonth()+1)}-${_n(n.getDate())} 23:59:59`;return i.append("startTime",r),i.append("endTime",o),i.append("playProtocol",2),i.append("streamName",ln((function(e,t){var i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[];for(t=t||n.length,i=0;i<e;i++)r[i]=n[0|Math.random()*t];return r.join("")}(32)+"_"+(new Date).getTime()).replace(/-/gi,"")+"_"+this.deviceSerial+"_"+this.channelNo+"_"+t.quality)),i.append("supportH265",1),i.append("appName",this.appName),Object.keys(t).forEach((e=>{i.append(e,t[e])})),this.post(e,{body:i}).then((e=>e.json())).then((e=>{var t,i;return 200==+(null===(t=e.meta)||void 0===t?void 0:t.code)?null===(i=e.data)||void 0===i?void 0:i.cdnUrl:""}))}async getCDNLiveAddressService(e){return this.getCDNPlayAddressService(`${hn}`,e)}async getCDNRecordAddressService(e){return this.getCDNPlayAddressService(`${pn}`,{recordStartTime:e.startTime,recordEndTime:e.stopTime,quality:e.quality,type:e.type||1})}async getStreamInterreputInfo(e){const t=new FormData;return t.append("streamId",e),this.post(fn,{body:t,headers:null}).then((e=>e.json()))}}function yn(e){return new Date(bn(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/"))}function bn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return`${(e=e.replace(/\//gi,"").replace(/-/gi,"").replace(/:/gi,"").replace(/ /gi,"")).substring(0,4)}${t}${e.substring(4,6)}${t}${e.substring(6,8)} ${e.substring(8,10)}:${e.substring(10,12)}:${e.substring(12,14)}`}function En(e){let t=null;if(t="string"==typeof e?document.querySelector("#"+e.replace(/^#/,"")):e,!t)throw new Error("Flv required node can be a string (dom id) or dom (HTMLElement node)");if("CANVAS"===t.nodeName||"VIDEO"===t.nodeName)throw new Error(`Flv container type can not be ${t.nodeName} type`);return t}var Sn={95e3:"服务端内部处理异常",95400:"私有化协议vtm检测私有化协议中码流类型小于0或者设备序列号为空等非法参数场景返回(app不重试取流)",95402:"回放找不到录像文件",95403:"操作码或信令密钥与设备不匹配",95404:"设备不在线\t检查设备网络",95405:"流媒体向设备发送或接受信令超时/cas响应超时",95406:"token失效",95407:"客户端的URL格式错误",95409:"预览开启隐私保护",95411:"token无权限",95412:"session不存在",95413:"token验证失败\t刷新重试",95415:"设备通道错",95416:"设备资源受限\t刷新重试",95417:"设备4G流量耗尽",95451:"设备不支持的码流类型",95452:"设备链接流媒体服务器失败",95454:"流媒体中关于设备取流会话不存在",95455:"设备通道未关联",95456:"设备通道关联设备不在线",95457:"客户端不支持端到端加密",95458:"设备不支持当前并发ECDH密",95459:"VTDU 处理ECDH 加密失败",95460:"手表正在拍照或录像",95461:"手表正在视频聊天",95462:"手表正在识图",95463:"手表正在QQ视频",95464:"手表正在坐姿检测",95465:"手表温度过高",95466:"设备视频通话中,不支持预览",95492:"设备不支持的命令",95500:"服务器处理失败",95503:"vtm返回分配vtdu失败, 请稍后重试",95504:"服务器负载达到上限,请稍后重试",95505:"vtm ecdh解密失败",95506:"vtm 返回IPC不支持取流(需要IPC添加NVR后支持)",95507:"不支持该4G卡套餐在非萤石App取流",95544:"设备返回无视频源",95545:"视频分享时间已经结束",95546:"取流并发路数限制",95547:"开放平台用户并发限制",95556:"ticket校验失败",95557:"回放服务器等待流头超时, 刷新重试,检测设备网络,重启设备",95558:"查找录像开始时间错误",95560:"群组分享取流二次验证失败",95561:"分享群组用户被锁住",95562:"群组分享用户权限变更",95563:"认证服务连接失败",95564:"认证超时",95565:"缓存无效",95566:"不在分享时间内预览",95567:"分享通道被锁定",95568:"未找到认证类型",95569:"认证返回的参数异常",95600:"分享设备不在分享时间内",95601:"群组分享用户没权限",95602:"群组分享权限变更",95530:"机房故障不可用, 刷新重试",95610:"接收流头失败",95620:"心跳超时",95701:"cas信令返回格式错误",95702:"SPGW请求Cas、Status透传超时,刷新重试",95703:"SPGW请求http不通,刷新重试",96001:"客户端参数出错",96002:"等待客户端侧心跳超时(20秒无心跳包)",96099:"客户端默认错误",96101:"不支持的命令",96102:"设备流头发送失败, 刷新重试",96103:"cas/设备返回错误1, 刷新重试",96104:"cas/设备返回错误-1, 刷新重试",96105:"设备返回错误码3, 刷新重试",96106:"设备返回错误码4, 刷新重试",96107:"设备返回错误码5, 刷新重试",96108:"cas信令回应重复, 刷新重试",96109:"视频广场取消分享",96110:"设备信令默认错误\t设备错返回的错误码,不具体\t刷新重试,或者重启设备",96501:"设备数据链路和实际链路不匹配, 刷新重试",96502:"设备数据链路重复建立连接, 刷新重试",96503:"设备数据链路端口不匹配, 刷新重试",96504:"缓存设备数据链路失败, 刷新重试",96505:"设备发送确认头消息重复, 刷新重试",96506:"设备数据先于确定头部到达, 刷新重试",96508:"设备数据头部长度非法, 刷新重试,或者重启设备",96509:"索引找不到设备数据管理块, 刷新重试",96510:"设备数据链路vtdu内存块协议状态不匹配",96511:"设备数据头部没有streamkey错误",96512:"设备数据头部非法",96513:"设备数据长度过小",96514:"设备老协议推流头部没有streamkey错误",96515:"设备老协议推流数据非法",96516:"设备老协议索引找不到内存管理块",96517:"设备老协议推流数据非法",96518:"设备数据包过大, 刷新重试,或者重启设备",96519:"设备推流链路网络不稳定, 设备长时间未推流超时",96520:"设备推流链路网络不稳定, 设备网络异常",90601:"流ID不存在",90602:"流被禁用",90603:"不在可用时间区间",90604:"用户设备关系验证失败",90605:"通道被隐藏",90606:"4G无限流量卡",4050:"服务内部调用向vtdu取流的接口失败",4054:"服务内部生成ticket失败",4056:"vtm服务信息为空",4057:"取流url非法(可能是格式、参数错误)",4058:"取流url过期(不在可用时间)",9048:"并发限制",9049:"带宽限制",9053:"不支持H265",9057:"设备码流加密",9060:"设备取流校验不通过",9061:"auth认证不通过",9062:"auth认证网络有问题"},Cn={95e3:"Internal server processing error",95400:"Private protocol VTM detection failed: Invalid parameters (stream type < 0 or empty device serial number), (App should not retry streaming)",95402:"Playback failed: Recording file not found",95403:"Operation code/signaling key mismatch with the device",95404:"Device offline, Check device network",95405:"Stream server timeout when sending/receiving device signaling or CAS response timeout, Check device network or restart device",95406:"Token expired, Refresh token or restart device",95407:"Invalid client URL format",95409:"Privacy protection enabled during preview",95411:"Token lacks permissions/user unauthorized",95412:"Session does not exist",95413:"Token verification failed, Refresh token",95415:"Invalid device channel",95416:"Device resource limit reached, Retry later",95417:"Device 4G data quota exhausted",95451:"Unsupported stream type by device",95452:"Device failed to connect to stream server",95454:"Streaming session not found in stream server",95455:"Device channel not associated",95456:"Associated device channel offline",95457:"Client does not support end-to-end encryption",95458:"Device does not support current concurrent ECDH encryption",95459:"VTDU failed to process ECDH encryption",95460:"Watch is capturing photos/video",95461:"Watch is in video chat",95462:"Watch is performing image recognition",95463:"Watch is in QQ video call",95464:"Watch is performing posture detection",95465:"Watch temperature too high",95466:"Device in video call; preview not supported",95492:"Unsupported command by device",95500:"Server processing failure",95503:"VTM failed to allocate VTDU, Retry later (VTDU service issue)",95504:"Server overloaded, Retry later",95505:"VTM ECDH decryption failed",95506:"IPC streaming not supported (requires NVR binding)",95507:"4G plan does not support non-EZVIZ app streaming",95544:"No video source from device",95545:"Video sharing period ended",95546:"Stream concurrency limit reached",95547:"Open platform user concurrency limit exceeded",95556:"Ticket validation failed",95557:"Playback server timeout waiting for stream header, Retry later or check device network.",95558:"Invalid playback start time",95560:"Group sharing stream secondary validation failed",95561:"Group shared user locked",95562:"Group sharing permissions modified",95563:"Authentication service connection failed",95564:"Authentication timeout",95565:"Invalid cache",95566:"Preview outside sharing period",95567:"Shared channel locked",95568:"Authentication type not found",95569:"Invalid authentication parameters",95600:"Shared device not in sharing period",95601:"Group user lacks permissions",95602:"Group sharing permissions modified",95530:"Data center outage, Retry later",95610:"Failed to receive stream header",95620:"Heartbeat timeout",95701:"CAS signaling format error",95702:"SPGW request to CAS/Status timeout, Retry later",95703:"SPGW HTTP request failed, Retry later",96001:"Client parameter error",96002:"Client heartbeat timeout (20s no packet)",96099:"Default client error",96101:"Unsupported command",96102:"Device stream header delivery failed, Retry later",96103:"CAS/device returned error code 1, Retry later",96104:"CAS/device returned error code -1, Retry later",96105:"Device returned error code 3, Retry later",96106:"Device returned error code 4, Retry later",96107:"Device returned error code 5, Retry later",96108:"Duplicate CAS signaling response, Retry later",96109:"Video sharing canceled by platform",96110:"Default device signaling error, Retry or restart device",96501:"Device data path mismatch, Retry later",96502:"Duplicate device data path connection, Retry later",96503:"Device data port mismatch, Retry later",96504:"Failed to cache device data path (insufficient memory), Retry later",96505:"Duplicate device acknowledgment header, Retry later",96506:"Device data arrived before header confirmation, Retry later",96508:"Invalid device data header length, Retry or restart device",96509:"Data management block not found, Retry later",96510:"VTDU protocol state mismatch for device data path",96511:"Missing stream key in device data header",96512:"Invalid device data header",96513:"Device data length too small",96514:"Legacy protocol: Missing stream key in push header",96515:"Invalid legacy protocol push data",96516:"Legacy protocol: Data management block not found",96517:"Invalid legacy protocol push data",96518:"Device data packet too large, Retry or restart device",96519:"Unstable device push stream (timeout due to inactivity)",96520:"Unstable device push stream (network issue)",90601:"Stream ID does not exist",90602:"Stream is disabled",90603:"Not within the available time range",90604:"User-device relationship verification failed",90605:"Channel is hidden",90606:"4G unlimited data plan",4050:"Internal service call to VTDU for stream retrieval failed",4054:"Internal service failed to generate ticket",4056:"VTM service information is empty",4057:"Stream retrieval URL is invalid (possibly due to format or parameter error)",4058:"Stream retrieval URL has expired (not within valid time range)",9048:"Concurrency limit exceeded",9049:"Bandwidth limit exceeded",9053:"H265 encoding not supported",9057:"Device stream is encrypted",9060:"Device stream retrieval validation failed",9061:"Auth authentication failed",9062:"Auth authentication network issue"};const wn=["h264","h265"],Tn=[.5,1,2,4,8];class kn extends ct{constructor(t){var i,n,r;super({...t,volumeOptions:{muted:t.muted??bt.muted,volume:t.volume??bt.volume,...t.volumeOptions||{}},container:En(t.id||t.container),type:"flv"}),e(this,"urlInfo",{}),e(this,"services",null),e(this,"_loadingTimeoutDelayTimer",null),e(this,"_heartTimeoutDelayTimer",null),null===(i=this.i18n)||void 0===i||null===(n=i.appendTranslations)||void 0===n||n.call(i,{zh:Sn,en:Cn}),qi.initMonitor(t.ignoreMonitor||t.disableColect);const o=Object.assign({},{isLive:!0,timeZone:0},bt,t);let a=En(t.id||t.container);if(!t.url)throw new Error("Flv url is empty");var s;qi.url=t.url,qi.report(1,{name:"constructor"}),a.classList.add("ezui-player-container","ezui-flv-container"),delete o.container,o.forceNoOffscreen=!0,ai(o.videoBuffer)&&(o.videoBuffer=1e3*Number(o.videoBuffer)),this._opt=o,this.urlInfo=nn(o.url,this._opt.isEzviz),this.$container=a,this._heartTimeoutDelayTimes=0,this._loadingTimeoutReplayTimes=0,this.events=new Di(this),this._initPlayer(a,o),this._videoInfo={},this._currentPlayDate=null,this.definitionList=[],this.definition={},this._playbackRate=1,this.playbackRateList=Tn,this.playbackRecords=[],this.services=new gn(this,{baseURL:(null===(r=this._opt.env)||void 0===r?void 0:r.domain)||Jt,accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo}),this._httpServices(),(s=this).on(Nt.volumechange,((e,t)=>{var i,n;(null===(i=s.player)||void 0===i?void 0:i.volume)!==e&&(s.player.volume=e),(null===(n=s.player)||void 0===n?void 0:n.muted)!==t&&(s.player.muted=t)})),s.on(Nt.control.play,(e=>{e?s.play():s.pause()})),s.on(Nt.fullscreenChange,(e=>{s.player.emit(Nt.fullscreenChange,e)})),s.on(Nt.orientationChange,(e=>{s.player.emit(Nt.orientationChange,e)})),function(e){var t,i;null===(t=e.player)||void 0===t||t.on(Nt.volumechange,((t,i)=>{e.volume!==t&&(e.volume=t),e.muted!==i&&(e.muted=i)})),null===(i=e.player)||void 0===i||i.on(Nt.audioCodecUnsupported,(t=>{e.emit(Nt.audioCodecUnsupported,t)}))}(this),this.options.useMSE&&(this._onvisibilitychange=this._onvisibilitychange.bind(this),document.addEventListener("visibilitychange",this._onvisibilitychange))}_httpServices(){try{var e,t,i;if(this._opt.isEzviz&&null!==(e=this._opt)&&void 0!==e&&e.accessToken&&this.urlInfo.deviceSerial&&this.urlInfo.channelNo>=0&&this.urlInfo.streamTypeIn)if(this.services=new gn(this,{baseURL:((null===(t=this._opt.env)||void 0===t?void 0:t.domain)||Jt).replace(/\/$/,""),accessToken:this._opt.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo,appName:this._opt.appName,v:null===(i=this.urlInfo.query)||void 0===i?void 0:i.v}),this._isEzvizPlayback(this._opt.url)&&!this._opt.isLive){var n,r,o,a;this._playbackRate=+((null===(n=this.urlInfo)||void 0===n||null===(n=n.query)||void 0===n?void 0:n.playbackSpeed)||1),null===(r=this.services)||void 0===r||r.getLocalVideoUnifyQueryService({startTime:yn(null===(o=this.urlInfo)||void 0===o||null===(o=o.query)||void 0===o?void 0:o.begin).getTime(),endTime:yn(null===(a=this.urlInfo)||void 0===a||null===(a=a.query)||void 0===a?void 0:a.end).getTime()});let e=null,t=0;this.on(Nt.timeUpdate,(i=>{const n=this.playbackRecords.length;if(n>0){var r,o;const A=yn(this.urlInfo.query.begin).getTime()/1e3;let d=null===(r=this.playbackRecords[t])||void 0===r?void 0:r.startTime,c=null===(o=this.playbackRecords[t])||void 0===o?void 0:o.endTime;if(A<=this.playbackRecords[0].startTime)t=0;else{if(A>=this.playbackRecords[this.playbackRecords.length-1].endTime)return;for(let e=0;e<n;e++){const i=this.playbackRecords[e];if(A>=i.startTime&&A<=i.endTime){var a;t=e,d=A,c=null===(a=this.playbackRecords[t])||void 0===a?void 0:a.endTime;break}{const n=this.playbackRecords[e+1];if(A>=i.endTime&&A<=n.startTime){var s,l;t=e+1,d=null===(s=this.playbackRecords[t])||void 0===s?void 0:s.startTime,c=null===(l=this.playbackRecords[t])||void 0===l?void 0:l.endTime;break}}}}let u=parseInt(d+i,10);if(0===i)return;this.emit(Nt.timeUpdateOSD,{currentTime:i,currentFragmentPlayEnd:d+i>=c,currentSliceIndex:t,osd:u}),u+3>=this.playbackRecords[n-1].endTime&&(e&&clearTimeout(e),e=setTimeout((()=>{this.emit(Nt.end),clearTimeout(e),this.pause()}),3e3)),d+i>=c&&t<n-1&&t++;const h=new Date(1e3*u);this._currentPlayDate=`${h.getFullYear()}${_n(h.getMonth()+1)}${_n(h.getDate())}${_n(h.getHours())}${_n(h.getMinutes())}${_n(h.getSeconds())}`}}))}else if(!this._isEzvizPlayback(this._opt.url)&&this._opt.isLive){var s,l,A,d;const e=null!==(s=this.urlInfo)&&void 0!==s&&null!==(s=s.query)&&void 0!==s&&s.expire?parseInt((1e3*this.urlInfo.query.expire-(new Date).getTime())/1e3):void 0;Promise.all([null===(l=this.services)||void 0===l?void 0:l.getVideoQualityService(),null===(A=this.services)||void 0===A?void 0:A.getLiveAddressService({quality:"1"==(null===(d=this.urlInfo)||void 0===d?void 0:d.streamTypeIn)?2:1,expireTime:e})]).then((e=>{let t=[this.urlInfo.url,e[1]].sort(((e,t)=>{const i=e=>{const t=e.match(/_(\d+)\.flv/);return t?parseInt(t[1],10):0};return i(e)-i(t)}));const i=e[0].map(((e,i)=>({...e,url:1===e.streamTypeIn?t[0]:t[1]})));this.definitionList=i,this.emit(Nt.getDefinitionListResult,i),this.emit(Nt.definitionListChange,i)}))}}catch(e){var c,u;null===(c=this.player)||void 0===c||null===(c=c.debug)||void 0===c||null===(u=c.error)||void 0===u||u.call(c,e)}}setDefinitionList(e){this.player&&(this.definitionList=e,this.emit(Nt.definitionListChange,e))}switchDefinition(e){if(this.player){if(e.videoLevel>=0&&[1,2].includes(e.streamTypeIn)){const r=this.definitionList.find((t=>t.videoLevel===e.videoLevel));if(r){if(this.emit(Nt.definitionChange,r),this.definition=r,r.url){var t;if("compatible"!==r.type)null===(t=this.services)||void 0===t||t.setVideoLevelService(r.videoLevel);return this.playing?this.pause().then((()=>{this.play({url:r.url})})):this.play({url:r.url}),Promise.resolve(0)}var i;return null===(i=this.player.debug)||void 0===i||i.warn("play url is not found"),Promise.resolve(1)}var n;return null===(n=this.player.debug)||void 0===n||n.warn("definition is not found"),Promise.resolve(1)}var r;return null===(r=this.player.debug)||void 0===r||r.warn(`not support ${null==e?void 0:e.videoLevel}`),Promise.resolve(1)}}setPlaybackRateList(e){this.player&&(this.playbackRateList=e,this.emit(Nt.playbackRateListChange,e))}get playbackRate(){return this._playbackRate}set playbackRate(e){this.switchPlaybackRate(e)}switchPlaybackRate(e){var t,i,n;return this.player&&this._isEzvizPlayback(this._opt.url)?(e=+e,null!==(t=this.playbackRateList)&&void 0!==t&&t.includes(e)?this._getNewRecordPlayUrl({playbackRate:e}).then((t=>t?(this._playbackRate=e,this.emit(Nt.playbackRateChange,e),this.playing?this.pause().then((e=>{this.play({url:t})})):this.play({url:t}),0):1)):(null===(i=this.player)||void 0===i||null===(i=i.debug)||void 0===i||i.warn(`not support ${e}`),Promise.resolve(1))):(null===(n=this.player)||void 0===n||null===(n=n.debug)||void 0===n||n.warn(`not support ${e}`),Promise.resolve(1))}_getNewRecordPlayUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.player&&this._isEzvizPlayback(this._opt.url)){var t,i,n,r;const o=yn(this._currentPlayDate||(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.begin)),a=yn(null===(i=this.urlInfo)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.end);return null===(n=this.services)||void 0===n?void 0:n.getRecordAddressService({expireTime:parseInt((new Date(1e3*(null===(r=this.urlInfo.query)||void 0===r?void 0:r.expire)).getTime()-(new Date).getTime())/1e3,10),startTime:`${o.getFullYear()}-${_n(o.getMonth()+1)}-${_n(o.getDate())} ${_n(o.getHours())}:${_n(o.getMinutes())}:${_n(o.getSeconds())}`,stopTime:`${a.getFullYear()}-${_n(a.getMonth()+1)}-${_n(a.getDate())} ${_n(a.getHours())}:${_n(a.getMinutes())}:${_n(a.getSeconds())}`,playbackSpeed:e.playbackRate||this.playbackRate,quality:this.urlInfo.streamTypeIn})}return Promise.resolve("")}_isEzvizPlayback(e){return this._opt.isEzviz&&/rec=(local|cloud)/.test(this._opt.url)}static _setOptions(e){const t=En((e=Object.assign({},{isLive:!0,timeZone:0},bt,e)).id||e.container);return e.container=t,e}destroy(){this.events&&(this.events.destroy(),this.events=null),super.destroy(),this.player&&(this.player.destroy(),this.player=null),this.$container&&(this.$container.classList.remove("ezui-flv-container"),this.$container.classList.remove("ezui-player-container"),this.$container=null),this.definitionList=[],this.definition={},this._videoInfo={},this._currentPlayDate=null,this.urlInfo={},this._playbackRate=1,this.playbackRateList=[],this.playbackRecords=[],this.$container=null,this._opt={},this._loadingTimeoutReplayTimes=0,this.removeAllListeners(),document.removeEventListener("visibilitychange",this._onvisibilitychange),qi.report(50,{name:"destroy"})}_handlevideoInfo(e){this._videoInfo=e||{}}_initPlayer(e,t){var i,r,o,a;t.url&&(t.url=n(t.url,wn)),this.player=new tn(this.contentControl.$container,Object.assign({},t,{orientation:this.orientationAngle})),null===(i=this.player.debug)||void 0===i||i.log("Flv","version",kn.version),null===(r=this.player.debug)||void 0===r||r.log("Flv","_initPlayer",JSON.stringify(t)),this._bindEvents(),t.autoPlay&&this.play(),this._handlevideoInfo=this._handlevideoInfo.bind(this),null===(o=this.player)||void 0===o||o.off(Nt.videoInfo,this._handlevideoInfo),null===(a=this.player)||void 0===a||a.on(Nt.videoInfo,this._handlevideoInfo)}_resetPlayer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.destroy(),this.player=null,this._opt=Object.assign(this._opt,e),this._initPlayer(this.$container,this._opt)}_bindEvents(){Object.keys(Vt).forEach((e=>{[Nt.volumechange,Nt.play].includes(e)||this.player.on(Vt[e],(t=>{this.emit(e,t)}))}))}setDebug(e){this.player.updateOption({debug:e}),qi.report(50,{name:"setDebug"})}setLogger(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.player.updateOption({loggerOptions:{...this.player._opt.loggerOptions||{},...e}})}closeSound(){this.setVolume(0),qi.report(50,{name:"closeSound"})}openSound(){this.setVolume(.8),qi.report(50,{name:"openSound"})}setVolume(e){this.volume=e}getVolume(){return qi.report(50,{name:"getVolume"}),this.volume}audioResume(){var e,t;null===(e=this.player)||void 0===e||null===(e=e.audio)||void 0===e||null===(t=e.audioEnabled)||void 0===t||t.call(e,!0),qi.report(50,{name:"audioResume"})}setScaleMode(e){return new Promise(((t,i)=>{try{e=Number(e)}catch(e){return void i(e)}[Ht.full,Ht.auto,Ht.fullAuto].includes(e)?(this.player.updateOption({scaleMode:e}),this.player.resize(),t(),qi.report(50,{name:"setScaleMode"})):i("scale mode 0 | 1 | 2")}))}pause(){var e,t;return qi.report(50,{name:"pause"}),this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),this._heartTimeoutDelayTimer&&(clearTimeout(this._heartTimeoutDelayTimer),this._heartTimeoutDelayTimer=null),this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this.playing=!1,null===(e=this.player)||void 0===e||null===(t=e.pause)||void 0===t?void 0:t.call(e)}clearView(){this.player.video.clearView(),qi.report(50,{name:"clearView"})}async play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._loadingTimeoutReplayTimes=0,this.__play(e)}async __play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.loading=!0,e.url&&(qi.url=e.url),"string"==typeof e&&(e={url:e}),this._currentPlayDate&&!e.url&&this._isEzvizPlayback())try{e.url=await this.services.getRecordAddressService({expireTime:86400,quality:this.urlInfo.streamTypeIn,startTime:bn(this._currentPlayDate,"-"),stopTime:bn(this.urlInfo.query.end,"-"),playbackSpeed:this.playbackRate}),this._currentPlayDate=null}catch(e){}const t=n(e.url||this._opt.url,wn);return this.urlInfo=nn(t,this._opt.isEzviz),this._playbackRate=this.urlInfo.query.playbackSpeed||1,this._opt=Object.assign({},this._opt,e||{},{url:t}),this._opt.urlQuery=Wi(e.url),qi.report(50,{name:"play"}),this.playing=!0,await new Promise(((e,t)=>{var i;if(!this._opt.url)return this.emit(Nt.error,jt.playError),void t("play url is empty");null!==(i=this.player)&&void 0!==i&&i.playing?(this.clearView(),this.player.play({...this._opt,muted:this.muted,volume:this.volume}).then((()=>{this.loading=!1,this.posterControl.hide(),e()})).catch((e=>{this.player.debug.warn("Flv","pause -> play and play error",e),this.player.pause().then((()=>{t(e)}))}))):this._play({...this._opt,muted:this.muted,volume:this.volume}).then((()=>{this.loading=!1,this.posterControl.hide(),e()})).catch((e=>{this.player.debug.warn("Flv","this._play error",e),t(e)}))}))}_play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(((t,i)=>{const n=0===e.url.indexOf("http"),r=n?vt:mt,o=n||-1!==e.url.indexOf(".flv")||this._opt.isFlv?gt:yt;this.player.updateOption({protocol:r,demuxType:o}),this.player.once(jt.webglAlignmentError,(()=>{this.player.off(jt.webglAlignmentError),this.pause().then((()=>{this.player.debug.log("Flv","webglAlignmentError"),this._resetPlayer({openWebglAlignment:!0}),this.play(e).then((()=>{this.player.debug.log("Flv","webglAlignmentError and play success")})).catch((()=>{this.player.debug.log("Flv","webglAlignmentError and play error")}))}))})),this.player.once(jt.mediaSourceH265NotSupport,(()=>{this.player.off(jt.mediaSourceH265NotSupport),this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play"),this._resetPlayer({useMSE:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play success")})).catch((()=>{this.player.debug.log("Flv","auto wasm [mse-> wasm] reset player and play error")})))}))})),this.player.once(jt.mediaSourceFull,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source full"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source full and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source full and reset player and play error")}))}))})),this.player.once(jt.mediaSourceAppendBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer error"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer error and reset player and play error")}))}))})),this.player.once(jt.mediaSourceBufferListLarge,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source buffer list large"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source buffer list large and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source buffer list large and reset player and play error")}))}))})),this.player.once(jt.mediaSourceAppendBufferEndTimeout,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","media source append buffer end timeout"),this._resetPlayer(),this.play(e).then((()=>{this.player.debug.log("Flv","media source append buffer end timeout and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","media source append buffer end timeout and reset player and play error")}))}))})),this.player.once(jt.mseSourceBufferError,(()=>{this.pause().then((()=>{this.player.debug.log("Flv","mseSourceBufferError close success")}))})),this.player.once(jt.webcodecsH265NotSupport,(()=>{this.pause().then((()=>{this.player._opt.autoWasm&&(this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","auto wasm [wcs-> wasm] reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","auto wasm [wcs-> wasm] reset player and play error")})))}))})),this.player.once(jt.wasmDecodeError,(()=>{this.player._opt.wasmDecodeErrorReplay&&this.pause().then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play"),this._resetPlayer({useWCS:!1}),this.play(e).then((()=>{this.player.debug.log("Flv","wasm decode error and reset player and play success")})).catch((()=>{this.player.debug.warn("Flv","wasm decode error and reset player and play error")}))}))})),this.player.off(Nt.delayTimeout,this._onDelayTimeout),this._onDelayTimeout=this._onDelayTimeout.bind(this),this.player.once(Nt.delayTimeout,this._onDelayTimeout),this.player.off(Nt.heartTimeout,this._onHeartTimeout),this._onHeartTimeout=this._onHeartTimeout.bind(this),this.player.once(Nt.heartTimeout,this._onHeartTimeout),this.player.off(Nt.loadingTimeout,this._onLoadingTimeout),this._onLoadingTimeout=this._onLoadingTimeout.bind(this),this.player.once(Nt.loadingTimeout,this._onLoadingTimeout),this.player.off(Nt.streamSuccess,this._onStreamSuccess),this._onStreamSuccess=this._onStreamSuccess.bind(this),this.player.once(Nt.streamSuccess,this._onStreamSuccess),this.player.off(Nt.streamError,this._onStreamError),this._onStreamError=this._onStreamError.bind(this),this.player.once(Nt.streamError,this._onStreamError),this.hasLoaded()?this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{if(this.player){this.player.debug.warn("Flv","hasLoaded and play error",e),null==e||e.name;try{this.player.pause().then((()=>{i(e)}))}catch(e){}}})):this.player.once(Nt.decoderWorkerInit,(()=>{this.player.play(e).then((()=>{var e,i;null!==(e=this.player)&&void 0!==e&&null!==(e=e.video)&&void 0!==e&&e.$videoElement&&(null===(i=this.urlInfo.query)||void 0===i?void 0:i.playbackSpeed)>=1&&(this.player.video.$videoElement.playbackRate=this.urlInfo.query.playbackSpeed),t()})).catch((e=>{if(this.player){this.player.debug.warn("Flv","decoderWorkerInit and play error",e);try{this.player.pause().then((()=>{i(e)}))}catch(e){}}}))}))}))}_onDelayTimeout(e){this._delayTimeoutTimer=setTimeout((()=>{this._delayTimeoutTimer&&(clearTimeout(this._delayTimeoutTimer),this._delayTimeoutTimer=null),this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes?(this._loadingTimeoutReplayTimes+=1,this.player.debug.warn("Flv",`delay timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(Nt.delayTimeout,this._onDelayTimeout),this.emit(Nt.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0}))):this._getDeviceStreamErrorInfo()}),1e3*(this._opt.loadingTimeoutDelay||3))}_onHeartTimeout(){this._heartTimeoutDelayTimes<+this.player._opt.heartTimeoutReplayTimes||-1==+this.player._opt.heartTimeoutReplayTimes?(this._heartTimeoutDelayTimes+=1,this.player.debug.warn("Flv",`heart timeout replay time is ${this._heartTimeoutDelayTimes}`),this.player.off(Nt.heartTimeout,this._onLoadingTimeout),this.emit(Nt.heartRetryTimes,this._heartTimeoutDelayTimes),this.__play(this._opt).then((()=>{this._heartTimeoutDelayTimes=0}))):this._getDeviceStreamErrorInfo()}_onLoadingTimeout(){this._loadingTimeoutDelayTimer=setTimeout((()=>{this._loadingTimeoutDelayTimer&&(clearTimeout(this._loadingTimeoutDelayTimer),this._loadingTimeoutDelayTimer=null),this._loadingTimeoutReplayTimes<+this.player._opt.loadingTimeoutReplayTimes||-1==+this.player._opt.loadingTimeoutReplayTimes?(this._loadingTimeoutReplayTimes+=1,this.player.debug.warn("Flv",`loading timeout replay time is ${this._loadingTimeoutReplayTimes}`),this.player.off(Nt.delayTimeout,this._onLoadingTimeout),this.emit(Nt.loadingRetryTimes,this._loadingTimeoutReplayTimes),this.__play(this._opt).then((()=>{this._loadingTimeoutReplayTimes=0}))):this._getDeviceStreamErrorInfo()}),1e3*(this._opt.loadingTimeoutDelay||3))}_getDeviceStreamErrorInfo(){var e,t;this.services&&null!==(e=this.urlInfo)&&void 0!==e&&null!==(e=e.query)&&void 0!==e&&e.sid?this.services.getStreamInterreputInfo(null===(t=this.urlInfo)||void 0===t||null===(t=t.query)||void 0===t?void 0:t.sid).then((e=>{if(this.playing=!1,200===e.meta.code){var t,i;let n=this.i18n.t(null===(t=e.data)||void 0===t?void 0:t.intrCode);/^\[missing /.test(n)?null!==(i=e.data)&&void 0!==i&&i.intrCode?this.emit(Nt.message,this.i18n.t("fetchError")+` [${e.data.intrCode}]`,"fetchError"):this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError"):this.emit(Nt.message,n+` [${e.data.intrCode}]`,"fetchError")}else this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError")})).catch((()=>{this.playing=!1,this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError")})):(this.playing=!1,this.emit(Nt.message,this.i18n.t("fetchError"),"fetchError"))}_onStreamSuccess(){this.emit(Nt.streamSuccess)}_onStreamError(){this.emit(Nt.streamError)}setBufferTime(e){var t,i;e=Number(e),this.player.updateOption({videoBuffer:1e3*e}),null===(t=this.player)||void 0===t||null===(t=t.decoderWorker)||void 0===t||null===(i=t.updateWorkConfig)||void 0===i||i.call(t,{key:"videoBuffer",value:1e3*e})}setRotate(e){qi.report(50,{name:"setRotate",value:e});try{e=parseInt(e,10)}catch(e){return Promise.reject("rotate 0 | 90 | 180 | 270")}return new Promise(((t,i)=>{kn.ROTATE.includes(e)?(this.player.updateOption({rotate:e}),this.player.resize(),t()):i("rotate 0 | 90 | 180 | 270")}))}hasLoaded(){return this.player.loaded}setKeepScreenOn(){this.player.updateOption({keepScreenOn:!0}),qi.report(50,{name:"setKeepScreenOn"})}get videoInfo(){return this._videoInfo}get currentTime(){return this.player.video?this.player.video.currentTime:0}screenshot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"png",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.92,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"download";if(this.player.video)return i=+i,this.player.video.screenshot(e,t,i,n)}getState(){return{playing:!!this.player&&this.player.playing,muted:!(this.player&&this.muted),fullscreen:this.currentFullscreen,loaded:!!this.player&&this.player.loaded,volume:this.player?parseFloat(this.player.volume).toFixed(2):0,isDebug:!!this.player&&this.player.isDebug}}getOptions(){return this.player?this.player._opt:{}}getVersion(){return qi.report(50,{name:"getVersion"}),"2.0.2"}static supportType(e){if("flv"===e.type)return!0;if(e.url){let t=e.url;t.startsWith("http://")||t.startsWith("https://")||(t=/^\/\//.test(t)?"http:"+t:location.origin+location.pathname+t);try{return/\.flv$/i.test(new URL(t).pathname)}catch(e){}}return!1}_onvisibilitychange(){!document.hidden&&this.playing&&this.muted&&this.options.isLive&&this.pause().finally((()=>{var e;null===(e=this.play)||void 0===e||e.call(this).catch((e=>{}))}))}}return e(kn,"ERROR",jt),e(kn,"EVENTS",Nt),e(kn,"QUALITY_ENUM",mn),e(kn,"ROTATE",[0,90,180,270]),e(kn,"TIMEOUT",{delayTimeout:Nt.delayTimeout}),e(kn,"version","2.0.2"),kn}));
|