@shjjs/visual-ui 3.0.25 → 3.0.26

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/umd/index.js CHANGED
@@ -50,7 +50,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
50
50
  `:""}
51
51
  `),this.shadowRoot.appendChild(t),this.rendered=!0}initialize(){var e=this;if(this.swiper&&this.swiper.initialized)return;const{params:t,passedParams:r}=GEt(this);this.swiperParams=t,this.passedParams=r,delete this.swiperParams.init,this.render(),this.swiper=new xC(this.shadowRoot.querySelector(".swiper"),{...t.virtual?{}:{observer:!0},...t,touchEventsTarget:"container",onAny:function(n){n==="observerUpdate"&&e.calcSlideSlots();const s=t.eventsPrefix?`${t.eventsPrefix}${n.toLowerCase()}`:n.toLowerCase();for(var a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];const u=new CustomEvent(s,{detail:o,bubbles:n!=="hashChange",cancelable:!0});e.dispatchEvent(u)}})}connectedCallback(){this.swiper&&this.swiper.initialized&&this.nested&&this.closest("swiper-slide")&&this.closest("swiper-slide").swiperLoopMoveDOM||this.init===!1||this.getAttribute("init")==="false"||this.initialize()}disconnectedCallback(){this.nested&&this.closest("swiper-slide")&&this.closest("swiper-slide").swiperLoopMoveDOM||this.swiper&&this.swiper.destroy&&this.swiper.destroy()}updateSwiperOnPropChange(e,t){const{params:r,passedParams:n}=GEt(this,e,t);this.passedParams=n,this.swiperParams=r,!(this.swiper&&this.swiper.params[e]===t)&&Oxi({swiper:this.swiper,passedParams:this.passedParams,changedParams:[jle(e)],...e==="navigation"&&n[e]?{prevEl:".swiper-button-prev",nextEl:".swiper-button-next"}:{},...e==="pagination"&&n[e]?{paginationEl:".swiper-pagination"}:{},...e==="scrollbar"&&n[e]?{scrollbarEl:".swiper-scrollbar"}:{}})}attributeChangedCallback(e,t,r){this.swiper&&this.swiper.initialized&&(t==="true"&&r===null&&(r=!1),this.updateSwiperOnPropChange(e,r))}static get observedAttributes(){return Yle.filter(t=>t.includes("_")).map(t=>t.replace(/[A-Z]/g,r=>`-${r}`).replace("_","").toLowerCase())}}Yle.forEach(i=>{i!=="init"&&(i=i.replace("_",""),Object.defineProperty(HEt.prototype,i,{configurable:!0,get(){return(this.passedParams||{})[i]},set(e){this.passedParams||(this.passedParams={}),this.passedParams[i]=e,this.swiper&&this.swiper.initialized&&this.updateSwiperOnPropChange(i,e)}}))});class Vxi extends VEt{constructor(){super(),this.attachShadow({mode:"open"})}render(){const e=this.lazy||this.getAttribute("lazy")===""||this.getAttribute("lazy")==="true";if(UEt(this.shadowRoot,kxi),this.shadowRoot.appendChild(document.createElement("slot")),e){const t=document.createElement("div");t.classList.add("swiper-lazy-preloader"),t.part.add("preloader"),this.shadowRoot.appendChild(t)}}initialize(){this.render()}connectedCallback(){this.swiperLoopMoveDOM||this.initialize()}}const ZEt=()=>{typeof window>"u"||(window.customElements.get("swiper-container")||window.customElements.define("swiper-container",HEt),window.customElements.get("swiper-slide")||window.customElements.define("swiper-slide",Vxi))};typeof window<"u"&&(window.SwiperElementRegisterParams=i=>{Yle.push(...i)});const zEt="2.0.0",Wxi=i=>{const e=Ut.cloneDeep(i);return e.version!==zEt?{carousel:{photoGallery:e.photoGallery,pagination:e.pagination,freeMode:e.freeMode,reverseDirection:e.reverseDirection,slidesPerView:e.slidesPerView,speed:e.speed,spaceBetween:e.spaceBetween,autoplay:e.autoplay,pauseOnMouseEnter:e.pauseOnMouseEnter,delay:e.delay,paginationType:e.paginationType,rewind:e.rewind,loop:e.loop,grabCursor:e.grabCursor,effect:e.effect,stopOnLastSlide:e.stopOnLastSlide,roundLengths:e.roundLengths,direction:e.direction},version:zEt}:i},Uxi=(i,e)=>{xi(()=>Ut.cloneDeep(i.option),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0}),xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},Hxi=["src"],Zxi=qt({...qt({name:"ShjCarousel"}),props:{option:{},sources:{},useEvents:{}},setup(i,{expose:e}){ZEt();const t=Qr(()=>Wxi(i.option)),r=Ht(Ul()),n=()=>{r.value=Ul()};return pa(()=>{so(()=>{n()})}),Uxi({option:t.value,sources:i.sources},n),e({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(s,a)=>{const o=a6("swiper-slide"),l=a6("swiper-container");return kt(),Bi(l,{key:r.value,class:"carousel",direction:t.value.carousel.direction,speed:t.value.carousel.speed,"round-lengths":t.value.carousel.roundLengths,"grab-cursor":t.value.carousel.grabCursor,rewind:t.value.carousel.rewind,loop:t.value.carousel.loop,"slides-per-view":t.value.carousel.slidesPerView,"space-between":t.value.carousel.spaceBetween,autoplay:t.value.carousel.autoplay,delay:t.value.carousel.delay,"stop-on-last-slide":t.value.carousel.stopOnLastSlide,"reverse-direction":t.value.carousel.reverseDirection,"pause-on-mouse-enter":t.value.carousel.pauseOnMouseEnter,"free-mode":t.value.carousel.freeMode,effect:t.value.carousel.effect,pagination:t.value.carousel.pagination,"pagination-type":t.value.carousel.paginationType},{default:ho(()=>[(kt(!0),Or(Qs,null,Wl(t.value.carousel.photoGallery,(u,c)=>(kt(),Bi(o,{key:c},{default:ho(()=>[Hi("img",{class:"image",src:u.url,alt:""},null,8,Hxi)]),_:2},1024))),128))]),_:1},8,["direction","speed","round-lengths","grab-cursor","rewind","loop","slides-per-view","space-between","autoplay","delay","stop-on-last-slide","reverse-direction","pause-on-mouse-enter","free-mode","effect","pagination","pagination-type"])}}}),XEt=Xi(ku(Zxi,[["__scopeId","data-v-54425757"]]));var n8e={exports:{}},YEt;function zxi(){return YEt||(YEt=1,(function(i,e){(function(r,n){i.exports=n()})(self,function(){return(function(){var t={"./node_modules/es6-promise/dist/es6-promise.js":(function(a,o,l){(function(u,c){a.exports=c()})(this,(function(){function u(Le){var ft=typeof Le;return Le!==null&&(ft==="object"||ft==="function")}function c(Le){return typeof Le=="function"}var d=void 0;Array.isArray?d=Array.isArray:d=function(Le){return Object.prototype.toString.call(Le)==="[object Array]"};var h=d,p=0,g=void 0,x=void 0,v=function(ft,xt){z[p]=ft,z[p+1]=xt,p+=2,p===2&&(x?x(Z):K())};function C(Le){x=Le}function I(Le){v=Le}var S=typeof window<"u"?window:void 0,T=S||{},E=T.MutationObserver||T.WebKitMutationObserver,B=typeof self>"u"&&typeof process<"u"&&{}.toString.call(process)==="[object process]",P=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function M(){return function(){return process.nextTick(Z)}}function L(){return typeof g<"u"?function(){g(Z)}:U()}function k(){var Le=0,ft=new E(Z),xt=document.createTextNode("");return ft.observe(xt,{characterData:!0}),function(){xt.data=Le=++Le%2}}function V(){var Le=new MessageChannel;return Le.port1.onmessage=Z,function(){return Le.port2.postMessage(0)}}function U(){var Le=setTimeout;return function(){return Le(Z,1)}}var z=new Array(1e3);function Z(){for(var Le=0;Le<p;Le+=2){var ft=z[Le],xt=z[Le+1];ft(xt),z[Le]=void 0,z[Le+1]=void 0}p=0}function j(){try{var Le=Function("return this")().require("vertx");return g=Le.runOnLoop||Le.runOnContext,L()}catch{return U()}}var K=void 0;B?K=M():E?K=k():P?K=V():S===void 0?K=j():K=U();function J(Le,ft){var xt=this,It=new this.constructor(oe);It[ie]===void 0&&Gt(It);var wt=xt._state;if(wt){var Br=arguments[wt-1];v(function(){return Ye(wt,It,Br,xt._result)})}else We(xt,It,Le,ft);return It}function q(Le){var ft=this;if(Le&&typeof Le=="object"&&Le.constructor===ft)return Le;var xt=new ft(oe);return Pe(xt,Le),xt}var ie=Math.random().toString(36).substring(2);function oe(){}var ue=void 0,de=1,he=2;function ge(){return new TypeError("You cannot resolve a promise with itself")}function ce(){return new TypeError("A promises callback cannot return that same promise.")}function me(Le,ft,xt,It){try{Le.call(ft,xt,It)}catch(wt){return wt}}function te(Le,ft,xt){v(function(It){var wt=!1,Br=me(xt,ft,function(jr){wt||(wt=!0,ft!==jr?Pe(It,jr):Ae(It,jr))},function(jr){wt||(wt=!0,Me(It,jr))},"Settle: "+(It._label||" unknown promise"));!wt&&Br&&(wt=!0,Me(It,Br))},Le)}function fe(Le,ft){ft._state===de?Ae(Le,ft._result):ft._state===he?Me(Le,ft._result):We(ft,void 0,function(xt){return Pe(Le,xt)},function(xt){return Me(Le,xt)})}function Ee(Le,ft,xt){ft.constructor===Le.constructor&&xt===J&&ft.constructor.resolve===q?fe(Le,ft):xt===void 0?Ae(Le,ft):c(xt)?te(Le,ft,xt):Ae(Le,ft)}function Pe(Le,ft){if(Le===ft)Me(Le,ge());else if(u(ft)){var xt=void 0;try{xt=ft.then}catch(It){Me(Le,It);return}Ee(Le,ft,xt)}else Ae(Le,ft)}function Ne(Le){Le._onerror&&Le._onerror(Le._result),Se(Le)}function Ae(Le,ft){Le._state===ue&&(Le._result=ft,Le._state=de,Le._subscribers.length!==0&&v(Se,Le))}function Me(Le,ft){Le._state===ue&&(Le._state=he,Le._result=ft,v(Ne,Le))}function We(Le,ft,xt,It){var wt=Le._subscribers,Br=wt.length;Le._onerror=null,wt[Br]=ft,wt[Br+de]=xt,wt[Br+he]=It,Br===0&&Le._state&&v(Se,Le)}function Se(Le){var ft=Le._subscribers,xt=Le._state;if(ft.length!==0){for(var It=void 0,wt=void 0,Br=Le._result,jr=0;jr<ft.length;jr+=3)It=ft[jr],wt=ft[jr+xt],It?Ye(xt,It,wt,Br):wt(Br);Le._subscribers.length=0}}function Ye(Le,ft,xt,It){var wt=c(xt),Br=void 0,jr=void 0,Ii=!0;if(wt){try{Br=xt(It)}catch(Ar){Ii=!1,jr=Ar}if(ft===Br){Me(ft,ce());return}}else Br=It;ft._state!==ue||(wt&&Ii?Pe(ft,Br):Ii===!1?Me(ft,jr):Le===de?Ae(ft,Br):Le===he&&Me(ft,Br))}function ut(Le,ft){try{ft(function(It){Pe(Le,It)},function(It){Me(Le,It)})}catch(xt){Me(Le,xt)}}var At=0;function gt(){return At++}function Gt(Le){Le[ie]=At++,Le._state=void 0,Le._result=void 0,Le._subscribers=[]}function Ct(){return new Error("Array Methods must be provided an Array")}var jt=(function(){function Le(ft,xt){this._instanceConstructor=ft,this.promise=new ft(oe),this.promise[ie]||Gt(this.promise),h(xt)?(this.length=xt.length,this._remaining=xt.length,this._result=new Array(this.length),this.length===0?Ae(this.promise,this._result):(this.length=this.length||0,this._enumerate(xt),this._remaining===0&&Ae(this.promise,this._result))):Me(this.promise,Ct())}return Le.prototype._enumerate=function(xt){for(var It=0;this._state===ue&&It<xt.length;It++)this._eachEntry(xt[It],It)},Le.prototype._eachEntry=function(xt,It){var wt=this._instanceConstructor,Br=wt.resolve;if(Br===q){var jr=void 0,Ii=void 0,Ar=!1;try{jr=xt.then}catch(Er){Ar=!0,Ii=Er}if(jr===J&&xt._state!==ue)this._settledAt(xt._state,It,xt._result);else if(typeof jr!="function")this._remaining--,this._result[It]=xt;else if(wt===He){var rr=new wt(oe);Ar?Me(rr,Ii):Ee(rr,xt,jr),this._willSettleAt(rr,It)}else this._willSettleAt(new wt(function(Er){return Er(xt)}),It)}else this._willSettleAt(Br(xt),It)},Le.prototype._settledAt=function(xt,It,wt){var Br=this.promise;Br._state===ue&&(this._remaining--,xt===he?Me(Br,wt):this._result[It]=wt),this._remaining===0&&Ae(Br,this._result)},Le.prototype._willSettleAt=function(xt,It){var wt=this;We(xt,void 0,function(Br){return wt._settledAt(de,It,Br)},function(Br){return wt._settledAt(he,It,Br)})},Le})();function Qe(Le){return new jt(this,Le).promise}function Ge(Le){var ft=this;return h(Le)?new ft(function(xt,It){for(var wt=Le.length,Br=0;Br<wt;Br++)ft.resolve(Le[Br]).then(xt,It)}):new ft(function(xt,It){return It(new TypeError("You must pass an array to race."))})}function dt(Le){var ft=this,xt=new ft(oe);return Me(xt,Le),xt}function be(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ve(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var He=(function(){function Le(ft){this[ie]=gt(),this._result=this._state=void 0,this._subscribers=[],oe!==ft&&(typeof ft!="function"&&be(),this instanceof Le?ut(this,ft):Ve())}return Le.prototype.catch=function(xt){return this.then(null,xt)},Le.prototype.finally=function(xt){var It=this,wt=It.constructor;return c(xt)?It.then(function(Br){return wt.resolve(xt()).then(function(){return Br})},function(Br){return wt.resolve(xt()).then(function(){throw Br})}):It.then(xt,xt)},Le})();He.prototype.then=J,He.all=Qe,He.race=Ge,He.resolve=q,He.reject=dt,He._setScheduler=C,He._setAsap=I,He._asap=v;function Je(){var Le=void 0;if(typeof l.g<"u")Le=l.g;else if(typeof self<"u")Le=self;else try{Le=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var ft=Le.Promise;if(ft){var xt=null;try{xt=Object.prototype.toString.call(ft.resolve())}catch{}if(xt==="[object Promise]"&&!ft.cast)return}Le.Promise=He}return He.polyfill=Je,He.Promise=He,He}))}),"./node_modules/events/events.js":(function(a){var o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(U,z,Z){return Function.prototype.apply.call(U,z,Z)},u;o&&typeof o.ownKeys=="function"?u=o.ownKeys:Object.getOwnPropertySymbols?u=function(U){return Object.getOwnPropertyNames(U).concat(Object.getOwnPropertySymbols(U))}:u=function(U){return Object.getOwnPropertyNames(U)};function c(V){}var d=Number.isNaN||function(U){return U!==U};function h(){h.init.call(this)}a.exports=h,a.exports.once=M,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var p=10;function g(V){if(typeof V!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof V)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(V){if(typeof V!="number"||V<0||d(V))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+V+".");p=V}}),h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(U){if(typeof U!="number"||U<0||d(U))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+U+".");return this._maxListeners=U,this};function x(V){return V._maxListeners===void 0?h.defaultMaxListeners:V._maxListeners}h.prototype.getMaxListeners=function(){return x(this)},h.prototype.emit=function(U){for(var z=[],Z=1;Z<arguments.length;Z++)z.push(arguments[Z]);var j=U==="error",K=this._events;if(K!==void 0)j=j&&K.error===void 0;else if(!j)return!1;if(j){var J;if(z.length>0&&(J=z[0]),J instanceof Error)throw J;var q=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw q.context=J,q}var ie=K[U];if(ie===void 0)return!1;if(typeof ie=="function")l(ie,this,z);else for(var oe=ie.length,ue=E(ie,oe),Z=0;Z<oe;++Z)l(ue[Z],this,z);return!0};function v(V,U,z,Z){var j,K,J;if(g(z),K=V._events,K===void 0?(K=V._events=Object.create(null),V._eventsCount=0):(K.newListener!==void 0&&(V.emit("newListener",U,z.listener?z.listener:z),K=V._events),J=K[U]),J===void 0)J=K[U]=z,++V._eventsCount;else if(typeof J=="function"?J=K[U]=Z?[z,J]:[J,z]:Z?J.unshift(z):J.push(z),j=x(V),j>0&&J.length>j&&!J.warned){J.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(U)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=V,q.type=U,q.count=J.length}return V}h.prototype.addListener=function(U,z){return v(this,U,z,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(U,z){return v(this,U,z,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function I(V,U,z){var Z={fired:!1,wrapFn:void 0,target:V,type:U,listener:z},j=C.bind(Z);return j.listener=z,Z.wrapFn=j,j}h.prototype.once=function(U,z){return g(z),this.on(U,I(this,U,z)),this},h.prototype.prependOnceListener=function(U,z){return g(z),this.prependListener(U,I(this,U,z)),this},h.prototype.removeListener=function(U,z){var Z,j,K,J,q;if(g(z),j=this._events,j===void 0)return this;if(Z=j[U],Z===void 0)return this;if(Z===z||Z.listener===z)--this._eventsCount===0?this._events=Object.create(null):(delete j[U],j.removeListener&&this.emit("removeListener",U,Z.listener||z));else if(typeof Z!="function"){for(K=-1,J=Z.length-1;J>=0;J--)if(Z[J]===z||Z[J].listener===z){q=Z[J].listener,K=J;break}if(K<0)return this;K===0?Z.shift():B(Z,K),Z.length===1&&(j[U]=Z[0]),j.removeListener!==void 0&&this.emit("removeListener",U,q||z)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(U){var z,Z,j;if(Z=this._events,Z===void 0)return this;if(Z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Z[U]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Z[U]),this;if(arguments.length===0){var K=Object.keys(Z),J;for(j=0;j<K.length;++j)J=K[j],J!=="removeListener"&&this.removeAllListeners(J);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(z=Z[U],typeof z=="function")this.removeListener(U,z);else if(z!==void 0)for(j=z.length-1;j>=0;j--)this.removeListener(U,z[j]);return this};function S(V,U,z){var Z=V._events;if(Z===void 0)return[];var j=Z[U];return j===void 0?[]:typeof j=="function"?z?[j.listener||j]:[j]:z?P(j):E(j,j.length)}h.prototype.listeners=function(U){return S(this,U,!0)},h.prototype.rawListeners=function(U){return S(this,U,!1)},h.listenerCount=function(V,U){return typeof V.listenerCount=="function"?V.listenerCount(U):T.call(V,U)},h.prototype.listenerCount=T;function T(V){var U=this._events;if(U!==void 0){var z=U[V];if(typeof z=="function")return 1;if(z!==void 0)return z.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?u(this._events):[]};function E(V,U){for(var z=new Array(U),Z=0;Z<U;++Z)z[Z]=V[Z];return z}function B(V,U){for(;U+1<V.length;U++)V[U]=V[U+1];V.pop()}function P(V){for(var U=new Array(V.length),z=0;z<U.length;++z)U[z]=V[z].listener||V[z];return U}function M(V,U){return new Promise(function(z,Z){function j(J){V.removeListener(U,K),Z(J)}function K(){typeof V.removeListener=="function"&&V.removeListener("error",j),z([].slice.call(arguments))}k(V,U,K,{once:!0}),U!=="error"&&L(V,j,{once:!0})})}function L(V,U,z){typeof V.on=="function"&&k(V,"error",U,z)}function k(V,U,z,Z){if(typeof V.on=="function")Z.once?V.once(U,z):V.on(U,z);else if(typeof V.addEventListener=="function")V.addEventListener(U,function j(K){Z.once&&V.removeEventListener(U,j),z(K)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof V)}}),"./node_modules/webworkify-webpack/index.js":(function(a,o,l){function u(C){var I={};function S(E){if(I[E])return I[E].exports;var B=I[E]={i:E,l:!1,exports:{}};return C[E].call(B.exports,B,B.exports,S),B.l=!0,B.exports}S.m=C,S.c=I,S.i=function(E){return E},S.d=function(E,B,P){S.o(E,B)||Object.defineProperty(E,B,{configurable:!1,enumerable:!0,get:P})},S.r=function(E){Object.defineProperty(E,"__esModule",{value:!0})},S.n=function(E){var B=E&&E.__esModule?function(){return E.default}:function(){return E};return S.d(B,"a",B),B},S.o=function(E,B){return Object.prototype.hasOwnProperty.call(E,B)},S.p="/",S.oe=function(E){throw E};var T=S(S.s=ENTRY_MODULE);return T.default||T}var c="[\\.|\\-|\\+|\\w|/|@]+",d="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+c+").*?\\)";function h(C){return(C+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function p(C){return!isNaN(1*C)}function g(C,I,S){var T={};T[S]=[];var E=I.toString(),B=E.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!B)return T;for(var P=B[1],M=new RegExp("(\\\\n|\\W)"+h(P)+d,"g"),L;L=M.exec(E);)L[3]!=="dll-reference"&&T[S].push(L[3]);for(M=new RegExp("\\("+h(P)+'\\("(dll-reference\\s('+c+'))"\\)\\)'+d,"g");L=M.exec(E);)C[L[2]]||(T[S].push(L[1]),C[L[2]]=l(L[1]).m),T[L[2]]=T[L[2]]||[],T[L[2]].push(L[4]);for(var k=Object.keys(T),V=0;V<k.length;V++)for(var U=0;U<T[k[V]].length;U++)p(T[k[V]][U])&&(T[k[V]][U]=1*T[k[V]][U]);return T}function x(C){var I=Object.keys(C);return I.reduce(function(S,T){return S||C[T].length>0},!1)}function v(C,I){for(var S={main:[I]},T={main:[]},E={main:{}};x(S);)for(var B=Object.keys(S),P=0;P<B.length;P++){var M=B[P],L=S[M],k=L.pop();if(E[M]=E[M]||{},!(E[M][k]||!C[M][k])){E[M][k]=!0,T[M]=T[M]||[],T[M].push(k);for(var V=g(C,C[M][k],M),U=Object.keys(V),z=0;z<U.length;z++)S[U[z]]=S[U[z]]||[],S[U[z]]=S[U[z]].concat(V[U[z]])}}return T}a.exports=function(C,I){I=I||{};var S={main:l.m},T=I.all?{main:Object.keys(S.main)}:v(S,C),E="";Object.keys(T).filter(function(k){return k!=="main"}).forEach(function(k){for(var V=0;T[k][V];)V++;T[k].push(V),S[k][V]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",E=E+"var "+k+" = ("+u.toString().replace("ENTRY_MODULE",JSON.stringify(V))+")({"+T[k].map(function(U){return""+JSON.stringify(U)+": "+S[k][U].toString()}).join(",")+`});
52
52
  `}),E=E+"new (("+u.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+T.main.map(function(k){return""+JSON.stringify(k)+": "+S.main[k].toString()}).join(",")+"}))(self);";var B=new window.Blob([E],{type:"text/javascript"});if(I.bare)return B;var P=window.URL||window.webkitURL||window.mozURL||window.msURL,M=P.createObjectURL(B),L=new window.Worker(M);return L.objectURL=M,L}}),"./src/config.js":(function(a,o,l){l.r(o),l.d(o,{defaultConfig:function(){return u},createDefaultConfig:function(){return c}});var u={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,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};function c(){return Object.assign({},u)}}),"./src/core/features.js":(function(a,o,l){l.r(o);var u=l("./src/io/io-controller.js"),c=l("./src/config.js"),d=(function(){function h(){}return h.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},h.supportNetworkStreamIO=function(){var p=new u.default({},(0,c.createDefaultConfig)()),g=p.loaderType;return p.destroy(),g=="fetch-stream-loader"||g=="xhr-moz-chunked-loader"},h.getNetworkLoaderTypeName=function(){var p=new u.default({},(0,c.createDefaultConfig)()),g=p.loaderType;return p.destroy(),g},h.supportNativeMediaPlayback=function(p){h.videoElement==null&&(h.videoElement=window.document.createElement("video"));var g=h.videoElement.canPlayType(p);return g==="probably"||g=="maybe"},h.getFeatureList=function(){var p={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return p.mseFlvPlayback=h.supportMSEH264Playback(),p.networkStreamIO=h.supportNetworkStreamIO(),p.networkLoaderName=h.getNetworkLoaderTypeName(),p.mseLiveFlvPlayback=p.mseFlvPlayback&&p.networkStreamIO,p.nativeMP4H264Playback=h.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),p.nativeWebmVP8Playback=h.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),p.nativeWebmVP9Playback=h.supportNativeMediaPlayback('video/webm; codecs="vp9"'),p},h})();o.default=d}),"./src/core/media-info.js":(function(a,o,l){l.r(o);var u=(function(){function c(){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 c.prototype.isComplete=function(){var d=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,h=this.hasVideo===!1||this.hasVideo===!0&&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!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&d&&h},c.prototype.isSeekable=function(){return this.hasKeyframesIndex===!0},c.prototype.getNearestKeyframe=function(d){if(this.keyframesIndex==null)return null;var h=this.keyframesIndex,p=this._search(h.times,d);return{index:p,milliseconds:h.times[p],fileposition:h.filepositions[p]}},c.prototype._search=function(d,h){var p=0,g=d.length-1,x=0,v=0,C=g;for(h<d[0]&&(p=0,v=C+1);v<=C;)if(x=v+Math.floor((C-v)/2),x===g||h>=d[x]&&h<d[x+1]){p=x;break}else d[x]<h?v=x+1:C=x-1;return p},c})();o.default=u}),"./src/core/media-segment-info.js":(function(a,o,l){l.r(o),l.d(o,{SampleInfo:function(){return u},MediaSegmentInfo:function(){return c},IDRSampleList:function(){return d},MediaSegmentInfoList:function(){return h}});var u=(function(){function p(g,x,v,C,I){this.dts=g,this.pts=x,this.duration=v,this.originalDts=C,this.isSyncPoint=I,this.fileposition=null}return p})(),c=(function(){function p(){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 p.prototype.appendSyncPoint=function(g){g.isSyncPoint=!0,this.syncPoints.push(g)},p})(),d=(function(){function p(){this._list=[]}return p.prototype.clear=function(){this._list=[]},p.prototype.appendArray=function(g){var x=this._list;g.length!==0&&(x.length>0&&g[0].originalDts<x[x.length-1].originalDts&&this.clear(),Array.prototype.push.apply(x,g))},p.prototype.getLastSyncPointBeforeDts=function(g){if(this._list.length==0)return null;var x=this._list,v=0,C=x.length-1,I=0,S=0,T=C;for(g<x[0].dts&&(v=0,S=T+1);S<=T;)if(I=S+Math.floor((T-S)/2),I===C||g>=x[I].dts&&g<x[I+1].dts){v=I;break}else x[I].dts<g?S=I+1:T=I-1;return this._list[v]},p})(),h=(function(){function p(g){this._type=g,this._list=[],this._lastAppendLocation=-1}return Object.defineProperty(p.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"length",{get:function(){return this._list.length},enumerable:!1,configurable:!0}),p.prototype.isEmpty=function(){return this._list.length===0},p.prototype.clear=function(){this._list=[],this._lastAppendLocation=-1},p.prototype._searchNearestSegmentBefore=function(g){var x=this._list;if(x.length===0)return-2;var v=x.length-1,C=0,I=0,S=v,T=0;if(g<x[0].originalBeginDts)return T=-1,T;for(;I<=S;)if(C=I+Math.floor((S-I)/2),C===v||g>x[C].lastSample.originalDts&&g<x[C+1].originalBeginDts){T=C;break}else x[C].originalBeginDts<g?I=C+1:S=C-1;return T},p.prototype._searchNearestSegmentAfter=function(g){return this._searchNearestSegmentBefore(g)+1},p.prototype.append=function(g){var x=this._list,v=g,C=this._lastAppendLocation,I=0;C!==-1&&C<x.length&&v.originalBeginDts>=x[C].lastSample.originalDts&&(C===x.length-1||C<x.length-1&&v.originalBeginDts<x[C+1].originalBeginDts)?I=C+1:x.length>0&&(I=this._searchNearestSegmentBefore(v.originalBeginDts)+1),this._lastAppendLocation=I,this._list.splice(I,0,v)},p.prototype.getLastSegmentBefore=function(g){var x=this._searchNearestSegmentBefore(g);return x>=0?this._list[x]:null},p.prototype.getLastSampleBefore=function(g){var x=this.getLastSegmentBefore(g);return x!=null?x.lastSample:null},p.prototype.getLastSyncPointBefore=function(g){for(var x=this._searchNearestSegmentBefore(g),v=this._list[x].syncPoints;v.length===0&&x>0;)x--,v=this._list[x].syncPoints;return v.length>0?v[v.length-1]:null},p})()}),"./src/core/mse-controller.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./src/utils/logger.js"),h=l("./src/utils/browser.js"),p=l("./src/core/mse-events.js"),g=l("./src/core/media-segment-info.js"),x=l("./src/utils/exception.js"),v=(function(){function C(I){this.TAG="MSEController",this._config=I,this._emitter=new(c()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(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 g.IDRSampleList}return C.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},C.prototype.on=function(I,S){this._emitter.addListener(I,S)},C.prototype.off=function(I,S){this._emitter.removeListener(I,S)},C.prototype.attachMediaElement=function(I){if(this._mediaSource)throw new x.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");var S=this._mediaSource=new window.MediaSource;S.addEventListener("sourceopen",this.e.onSourceOpen),S.addEventListener("sourceended",this.e.onSourceEnded),S.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=I,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),I.src=this._mediaSourceObjectURL},C.prototype.detachMediaElement=function(){if(this._mediaSource){var I=this._mediaSource;for(var S in this._sourceBuffers){var T=this._pendingSegments[S];T.splice(0,T.length),this._pendingSegments[S]=null,this._pendingRemoveRanges[S]=null,this._lastInitSegments[S]=null;var E=this._sourceBuffers[S];if(E){if(I.readyState!=="closed"){try{I.removeSourceBuffer(E)}catch(B){d.default.e(this.TAG,B.message)}E.removeEventListener("error",this.e.onSourceBufferError),E.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[S]=null,this._sourceBuffers[S]=null}}if(I.readyState==="open")try{I.endOfStream()}catch(B){d.default.e(this.TAG,B.message)}I.removeEventListener("sourceopen",this.e.onSourceOpen),I.removeEventListener("sourceended",this.e.onSourceEnded),I.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)},C.prototype.appendInitSegment=function(I,S){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(I),this._pendingSegments[I.type].push(I);return}var T=I,E=""+T.container;T.codec&&T.codec.length>0&&(E+=";codecs="+T.codec);var B=!1;if(d.default.v(this.TAG,"Received Initialization Segment, mimeType: "+E),this._lastInitSegments[T.type]=T,E!==this._mimeTypes[T.type]){if(this._mimeTypes[T.type])d.default.v(this.TAG,"Notice: "+T.type+" mimeType changed, origin: "+this._mimeTypes[T.type]+", target: "+E);else{B=!0;try{var P=this._sourceBuffers[T.type]=this._mediaSource.addSourceBuffer(E);P.addEventListener("error",this.e.onSourceBufferError),P.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(M){d.default.e(this.TAG,M.message),this._emitter.emit(p.default.ERROR,{code:M.code,msg:M.message});return}}this._mimeTypes[T.type]=E}S||this._pendingSegments[T.type].push(T),B||this._sourceBuffers[T.type]&&!this._sourceBuffers[T.type].updating&&this._doAppendSegments(),h.default.safari&&T.container==="audio/mpeg"&&T.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=T.mediaDuration/1e3,this._updateMediaSourceDuration())},C.prototype.appendMediaSegment=function(I){var S=I;this._pendingSegments[S.type].push(S),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var T=this._sourceBuffers[S.type];T&&!T.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()},C.prototype.seek=function(I){for(var S in this._sourceBuffers)if(this._sourceBuffers[S]){var T=this._sourceBuffers[S];if(this._mediaSource.readyState==="open")try{T.abort()}catch(k){d.default.e(this.TAG,k.message)}this._idrList.clear();var E=this._pendingSegments[S];if(E.splice(0,E.length),this._mediaSource.readyState!=="closed"){for(var B=0;B<T.buffered.length;B++){var P=T.buffered.start(B),M=T.buffered.end(B);this._pendingRemoveRanges[S].push({start:P,end:M})}if(T.updating||this._doRemoveRanges(),h.default.safari){var L=this._lastInitSegments[S];L&&(this._pendingSegments[S].push(L),T.updating||this._doAppendSegments())}}}},C.prototype.endOfStream=function(){var I=this._mediaSource,S=this._sourceBuffers;if(!I||I.readyState!=="open"){I&&I.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}S.video&&S.video.updating||S.audio&&S.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,I.endOfStream())},C.prototype.getNearestKeyframe=function(I){return this._idrList.getLastSyncPointBeforeDts(I)},C.prototype._needCleanupSourceBuffer=function(){if(!this._config.autoCleanupSourceBuffer)return!1;var I=this._mediaElement.currentTime;for(var S in this._sourceBuffers){var T=this._sourceBuffers[S];if(T){var E=T.buffered;if(E.length>=1&&I-E.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},C.prototype._doCleanupSourceBuffer=function(){var I=this._mediaElement.currentTime;for(var S in this._sourceBuffers){var T=this._sourceBuffers[S];if(T){for(var E=T.buffered,B=!1,P=0;P<E.length;P++){var M=E.start(P),L=E.end(P);if(M<=I&&I<L+3){if(I-M>=this._config.autoCleanupMaxBackwardDuration){B=!0;var k=I-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[S].push({start:M,end:k})}}else L<I&&(B=!0,this._pendingRemoveRanges[S].push({start:M,end:L}))}B&&!T.updating&&this._doRemoveRanges()}}},C.prototype._updateMediaSourceDuration=function(){var I=this._sourceBuffers;if(!(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")&&!(I.video&&I.video.updating||I.audio&&I.audio.updating)){var S=this._mediaSource.duration,T=this._pendingMediaDuration;T>0&&(isNaN(S)||T>S)&&(d.default.v(this.TAG,"Update MediaSource duration from "+S+" to "+T),this._mediaSource.duration=T),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},C.prototype._doRemoveRanges=function(){for(var I in this._pendingRemoveRanges)if(!(!this._sourceBuffers[I]||this._sourceBuffers[I].updating))for(var S=this._sourceBuffers[I],T=this._pendingRemoveRanges[I];T.length&&!S.updating;){var E=T.shift();S.remove(E.start,E.end)}},C.prototype._doAppendSegments=function(){var I=this._pendingSegments;for(var S in I)if(!(!this._sourceBuffers[S]||this._sourceBuffers[S].updating)&&I[S].length>0){var T=I[S].shift();if(T.timestampOffset){var E=this._sourceBuffers[S].timestampOffset,B=T.timestampOffset/1e3,P=Math.abs(E-B);P>.1&&(d.default.v(this.TAG,"Update MPEG audio timestampOffset from "+E+" to "+B),this._sourceBuffers[S].timestampOffset=B),delete T.timestampOffset}if(!T.data||T.data.byteLength===0)continue;try{this._sourceBuffers[S].appendBuffer(T.data),this._isBufferFull=!1,S==="video"&&T.hasOwnProperty("info")&&this._idrList.appendArray(T.info.syncPoints)}catch(M){this._pendingSegments[S].unshift(T),M.code===22?(this._isBufferFull||this._emitter.emit(p.default.BUFFER_FULL),this._isBufferFull=!0):(d.default.e(this.TAG,M.message),this._emitter.emit(p.default.ERROR,{code:M.code,msg:M.message}))}}},C.prototype._onSourceOpen=function(){if(d.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var I=this._pendingSourceBufferInit;I.length;){var S=I.shift();this.appendInitSegment(S,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(p.default.SOURCE_OPEN)},C.prototype._onSourceEnded=function(){d.default.v(this.TAG,"MediaSource onSourceEnded")},C.prototype._onSourceClose=function(){d.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))},C.prototype._hasPendingSegments=function(){var I=this._pendingSegments;return I.video.length>0||I.audio.length>0},C.prototype._hasPendingRemoveRanges=function(){var I=this._pendingRemoveRanges;return I.video.length>0||I.audio.length>0},C.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(p.default.UPDATE_END)},C.prototype._onSourceBufferError=function(I){d.default.e(this.TAG,"SourceBuffer Error: "+I)},C})();o.default=v}),"./src/core/mse-events.js":(function(a,o,l){l.r(o);var u={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};o.default=u}),"./src/core/transmuxer.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./node_modules/webworkify-webpack/index.js"),h=l.n(d),p=l("./src/utils/logger.js"),g=l("./src/utils/logging-control.js"),x=l("./src/core/transmuxing-controller.js"),v=l("./src/core/transmuxing-events.js"),C=l("./src/core/media-info.js"),I=(function(){function S(T,E){if(this.TAG="Transmuxer",this._emitter=new(c()),E.enableWorker&&typeof Worker<"u")try{this._worker=h()("./src/core/transmuxing-worker.js"),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[T,E]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},g.default.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:g.default.getConfig()})}catch{p.default.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new x.default(T,E)}else this._controller=new x.default(T,E);if(this._controller){var B=this._controller;B.on(v.default.IO_ERROR,this._onIOError.bind(this)),B.on(v.default.DEMUX_ERROR,this._onDemuxError.bind(this)),B.on(v.default.INIT_SEGMENT,this._onInitSegment.bind(this)),B.on(v.default.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),B.on(v.default.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),B.on(v.default.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),B.on(v.default.MEDIA_INFO,this._onMediaInfo.bind(this)),B.on(v.default.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),B.on(v.default.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),B.on(v.default.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),B.on(v.default.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return S.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),g.default.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},S.prototype.on=function(T,E){this._emitter.addListener(T,E)},S.prototype.off=function(T,E){this._emitter.removeListener(T,E)},S.prototype.hasWorker=function(){return this._worker!=null},S.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},S.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},S.prototype.seek=function(T){this._worker?this._worker.postMessage({cmd:"seek",param:T}):this._controller.seek(T)},S.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},S.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},S.prototype._onInitSegment=function(T,E){var B=this;Promise.resolve().then(function(){B._emitter.emit(v.default.INIT_SEGMENT,T,E)})},S.prototype._onMediaSegment=function(T,E){var B=this;Promise.resolve().then(function(){B._emitter.emit(v.default.MEDIA_SEGMENT,T,E)})},S.prototype._onLoadingComplete=function(){var T=this;Promise.resolve().then(function(){T._emitter.emit(v.default.LOADING_COMPLETE)})},S.prototype._onRecoveredEarlyEof=function(){var T=this;Promise.resolve().then(function(){T._emitter.emit(v.default.RECOVERED_EARLY_EOF)})},S.prototype._onMediaInfo=function(T){var E=this;Promise.resolve().then(function(){E._emitter.emit(v.default.MEDIA_INFO,T)})},S.prototype._onMetaDataArrived=function(T){var E=this;Promise.resolve().then(function(){E._emitter.emit(v.default.METADATA_ARRIVED,T)})},S.prototype._onScriptDataArrived=function(T){var E=this;Promise.resolve().then(function(){E._emitter.emit(v.default.SCRIPTDATA_ARRIVED,T)})},S.prototype._onStatisticsInfo=function(T){var E=this;Promise.resolve().then(function(){E._emitter.emit(v.default.STATISTICS_INFO,T)})},S.prototype._onIOError=function(T,E){var B=this;Promise.resolve().then(function(){B._emitter.emit(v.default.IO_ERROR,T,E)})},S.prototype._onDemuxError=function(T,E){var B=this;Promise.resolve().then(function(){B._emitter.emit(v.default.DEMUX_ERROR,T,E)})},S.prototype._onRecommendSeekpoint=function(T){var E=this;Promise.resolve().then(function(){E._emitter.emit(v.default.RECOMMEND_SEEKPOINT,T)})},S.prototype._onLoggingConfigChanged=function(T){this._worker&&this._worker.postMessage({cmd:"logging_config",param:T})},S.prototype._onWorkerMessage=function(T){var E=T.data,B=E.data;if(E.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(E.msg){case v.default.INIT_SEGMENT:case v.default.MEDIA_SEGMENT:this._emitter.emit(E.msg,B.type,B.data);break;case v.default.LOADING_COMPLETE:case v.default.RECOVERED_EARLY_EOF:this._emitter.emit(E.msg);break;case v.default.MEDIA_INFO:Object.setPrototypeOf(B,C.default.prototype),this._emitter.emit(E.msg,B);break;case v.default.METADATA_ARRIVED:case v.default.SCRIPTDATA_ARRIVED:case v.default.STATISTICS_INFO:this._emitter.emit(E.msg,B);break;case v.default.IO_ERROR:case v.default.DEMUX_ERROR:this._emitter.emit(E.msg,B.type,B.info);break;case v.default.RECOMMEND_SEEKPOINT:this._emitter.emit(E.msg,B);break;case"logcat_callback":p.default.emitter.emit("log",B.type,B.logcat);break}},S})();o.default=I}),"./src/core/transmuxing-controller.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./src/utils/logger.js"),h=l("./src/utils/browser.js"),p=l("./src/core/media-info.js"),g=l("./src/demux/flv-demuxer.js"),x=l("./src/remux/mp4-remuxer.js"),v=l("./src/demux/demux-errors.js"),C=l("./src/io/io-controller.js"),I=l("./src/core/transmuxing-events.js"),S=(function(){function T(E,B){this.TAG="TransmuxingController",this._emitter=new(c()),this._config=B,E.segments||(E.segments=[{duration:E.duration,filesize:E.filesize,url:E.url}]),typeof E.cors!="boolean"&&(E.cors=!0),typeof E.withCredentials!="boolean"&&(E.withCredentials=!1),this._mediaDataSource=E,this._currentSegmentIndex=0;var P=0;this._mediaDataSource.segments.forEach(function(M){M.timestampBase=P,P+=M.duration,M.cors=E.cors,M.withCredentials=E.withCredentials,B.referrerPolicy&&(M.referrerPolicy=B.referrerPolicy)}),!isNaN(P)&&this._mediaDataSource.duration!==P&&(this._mediaDataSource.duration=P),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return T.prototype.destroy=function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null},T.prototype.on=function(E,B){this._emitter.addListener(E,B)},T.prototype.off=function(E,B){this._emitter.removeListener(E,B)},T.prototype.start=function(){this._loadSegment(0),this._enableStatisticsReporter()},T.prototype._loadSegment=function(E,B){this._currentSegmentIndex=E;var P=this._mediaDataSource.segments[E],M=this._ioctl=new C.default(P,this._config,E);M.onError=this._onIOException.bind(this),M.onSeeked=this._onIOSeeked.bind(this),M.onComplete=this._onIOComplete.bind(this),M.onRedirect=this._onIORedirect.bind(this),M.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),B?this._demuxer.bindDataSource(this._ioctl):M.onDataArrival=this._onInitChunkArrival.bind(this),M.open(B)},T.prototype.stop=function(){this._internalAbort(),this._disableStatisticsReporter()},T.prototype._internalAbort=function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)},T.prototype.pause=function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())},T.prototype.resume=function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())},T.prototype.seek=function(E){if(!(this._mediaInfo==null||!this._mediaInfo.isSeekable())){var B=this._searchSegmentIndexContains(E);if(B===this._currentSegmentIndex){var P=this._mediaInfo.segments[B];if(P==null)this._pendingSeekTime=E;else{var M=P.getNearestKeyframe(E);this._remuxer.seek(M.milliseconds),this._ioctl.seek(M.fileposition),this._pendingResolveSeekPoint=M.milliseconds}}else{var L=this._mediaInfo.segments[B];if(L==null)this._pendingSeekTime=E,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(B);else{var M=L.getNearestKeyframe(E);this._internalAbort(),this._remuxer.seek(E),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[B].timestampBase,this._loadSegment(B,M.fileposition),this._pendingResolveSeekPoint=M.milliseconds,this._reportSegmentMediaInfo(B)}}this._enableStatisticsReporter()}},T.prototype._searchSegmentIndexContains=function(E){for(var B=this._mediaDataSource.segments,P=B.length-1,M=0;M<B.length;M++)if(E<B[M].timestampBase){P=M-1;break}return P},T.prototype._onInitChunkArrival=function(E,B){var P=this,M=null,L=0;if(B>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,L=this._demuxer.parseChunks(E,B);else if((M=g.default.probe(E)).match){this._demuxer=new g.default(M,this._config),this._remuxer||(this._remuxer=new x.default(this._config));var k=this._mediaDataSource;k.duration!=null&&!isNaN(k.duration)&&(this._demuxer.overridedDuration=k.duration),typeof k.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=k.hasAudio),typeof k.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=k.hasVideo),this._demuxer.timestampBase=k.segments[this._currentSegmentIndex].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),L=this._demuxer.parseChunks(E,B)}else M=null,d.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){P._internalAbort()}),this._emitter.emit(I.default.DEMUX_ERROR,v.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),L=0;return L},T.prototype._onMediaInfo=function(E){var B=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},E),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,p.default.prototype));var P=Object.assign({},E);Object.setPrototypeOf(P,p.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=P,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var M=B._pendingSeekTime;B._pendingSeekTime=null,B.seek(M)})},T.prototype._onMetaDataArrived=function(E){this._emitter.emit(I.default.METADATA_ARRIVED,E)},T.prototype._onScriptDataArrived=function(E){this._emitter.emit(I.default.SCRIPTDATA_ARRIVED,E)},T.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},T.prototype._onIOComplete=function(E){var B=E,P=B+1;P<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(P)):(this._remuxer.flushStashedSamples(),this._emitter.emit(I.default.LOADING_COMPLETE),this._disableStatisticsReporter())},T.prototype._onIORedirect=function(E){var B=this._ioctl.extraData;this._mediaDataSource.segments[B].redirectedURL=E},T.prototype._onIORecoveredEarlyEof=function(){this._emitter.emit(I.default.RECOVERED_EARLY_EOF)},T.prototype._onIOException=function(E,B){d.default.e(this.TAG,"IOException: type = "+E+", code = "+B.code+", msg = "+B.msg),this._emitter.emit(I.default.IO_ERROR,E,B),this._disableStatisticsReporter()},T.prototype._onDemuxException=function(E,B){d.default.e(this.TAG,"DemuxException: type = "+E+", info = "+B),this._emitter.emit(I.default.DEMUX_ERROR,E,B)},T.prototype._onRemuxerInitSegmentArrival=function(E,B){this._emitter.emit(I.default.INIT_SEGMENT,E,B)},T.prototype._onRemuxerMediaSegmentArrival=function(E,B){if(this._pendingSeekTime==null&&(this._emitter.emit(I.default.MEDIA_SEGMENT,E,B),this._pendingResolveSeekPoint!=null&&E==="video")){var P=B.info.syncPoints,M=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,h.default.safari&&P.length>0&&P[0].originalDts===M&&(M=P[0].pts),this._emitter.emit(I.default.RECOMMEND_SEEKPOINT,M)}},T.prototype._enableStatisticsReporter=function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},T.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},T.prototype._reportSegmentMediaInfo=function(E){var B=this._mediaInfo.segments[E],P=Object.assign({},B);P.duration=this._mediaInfo.duration,P.segmentCount=this._mediaInfo.segmentCount,delete P.segments,delete P.keyframesIndex,this._emitter.emit(I.default.MEDIA_INFO,P)},T.prototype._reportStatisticsInfo=function(){var E={};E.url=this._ioctl.currentURL,E.hasRedirect=this._ioctl.hasRedirect,E.hasRedirect&&(E.redirectedURL=this._ioctl.currentRedirectedURL),E.speed=this._ioctl.currentSpeed,E.loaderType=this._ioctl.loaderType,E.currentSegmentIndex=this._currentSegmentIndex,E.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(I.default.STATISTICS_INFO,E)},T})();o.default=S}),"./src/core/transmuxing-events.js":(function(a,o,l){l.r(o);var u={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",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};o.default=u}),"./src/core/transmuxing-worker.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logging-control.js"),c=l("./src/utils/polyfill.js"),d=l("./src/core/transmuxing-controller.js"),h=l("./src/core/transmuxing-events.js"),p=function(g){var x=null,v=U.bind(this);c.default.install(),g.addEventListener("message",function(z){switch(z.data.cmd){case"init":x=new d.default(z.data.param[0],z.data.param[1]),x.on(h.default.IO_ERROR,L.bind(this)),x.on(h.default.DEMUX_ERROR,k.bind(this)),x.on(h.default.INIT_SEGMENT,C.bind(this)),x.on(h.default.MEDIA_SEGMENT,I.bind(this)),x.on(h.default.LOADING_COMPLETE,S.bind(this)),x.on(h.default.RECOVERED_EARLY_EOF,T.bind(this)),x.on(h.default.MEDIA_INFO,E.bind(this)),x.on(h.default.METADATA_ARRIVED,B.bind(this)),x.on(h.default.SCRIPTDATA_ARRIVED,P.bind(this)),x.on(h.default.STATISTICS_INFO,M.bind(this)),x.on(h.default.RECOMMEND_SEEKPOINT,V.bind(this));break;case"destroy":x&&(x.destroy(),x=null),g.postMessage({msg:"destroyed"});break;case"start":x.start();break;case"stop":x.stop();break;case"seek":x.seek(z.data.param);break;case"pause":x.pause();break;case"resume":x.resume();break;case"logging_config":{var Z=z.data.param;u.default.applyConfig(Z),Z.enableCallback===!0?u.default.addLogListener(v):u.default.removeLogListener(v);break}}});function C(z,Z){var j={msg:h.default.INIT_SEGMENT,data:{type:z,data:Z}};g.postMessage(j,[Z.data])}function I(z,Z){var j={msg:h.default.MEDIA_SEGMENT,data:{type:z,data:Z}};g.postMessage(j,[Z.data])}function S(){var z={msg:h.default.LOADING_COMPLETE};g.postMessage(z)}function T(){var z={msg:h.default.RECOVERED_EARLY_EOF};g.postMessage(z)}function E(z){var Z={msg:h.default.MEDIA_INFO,data:z};g.postMessage(Z)}function B(z){var Z={msg:h.default.METADATA_ARRIVED,data:z};g.postMessage(Z)}function P(z){var Z={msg:h.default.SCRIPTDATA_ARRIVED,data:z};g.postMessage(Z)}function M(z){var Z={msg:h.default.STATISTICS_INFO,data:z};g.postMessage(Z)}function L(z,Z){g.postMessage({msg:h.default.IO_ERROR,data:{type:z,info:Z}})}function k(z,Z){g.postMessage({msg:h.default.DEMUX_ERROR,data:{type:z,info:Z}})}function V(z){g.postMessage({msg:h.default.RECOMMEND_SEEKPOINT,data:z})}function U(z,Z){g.postMessage({msg:"logcat_callback",data:{type:z,logcat:Z}})}};o.default=p}),"./src/demux/amf-parser.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logger.js"),c=l("./src/utils/utf8-conv.js"),d=l("./src/utils/exception.js"),h=(function(){var g=new ArrayBuffer(2);return new DataView(g).setInt16(0,256,!0),new Int16Array(g)[0]===256})(),p=(function(){function g(){}return g.parseScriptData=function(x,v,C){var I={};try{var S=g.parseValue(x,v,C),T=g.parseValue(x,v+S.size,C-S.size);I[S.data]=T.data}catch(E){u.default.e("AMF",E.toString())}return I},g.parseObject=function(x,v,C){if(C<3)throw new d.IllegalStateException("Data not enough when parse ScriptDataObject");var I=g.parseString(x,v,C),S=g.parseValue(x,v+I.size,C-I.size),T=S.objectEnd;return{data:{name:I.data,value:S.data},size:I.size+S.size,objectEnd:T}},g.parseVariable=function(x,v,C){return g.parseObject(x,v,C)},g.parseString=function(x,v,C){if(C<2)throw new d.IllegalStateException("Data not enough when parse String");var I=new DataView(x,v,C),S=I.getUint16(0,!h),T;return S>0?T=(0,c.default)(new Uint8Array(x,v+2,S)):T="",{data:T,size:2+S}},g.parseLongString=function(x,v,C){if(C<4)throw new d.IllegalStateException("Data not enough when parse LongString");var I=new DataView(x,v,C),S=I.getUint32(0,!h),T;return S>0?T=(0,c.default)(new Uint8Array(x,v+4,S)):T="",{data:T,size:4+S}},g.parseDate=function(x,v,C){if(C<10)throw new d.IllegalStateException("Data size invalid when parse Date");var I=new DataView(x,v,C),S=I.getFloat64(0,!h),T=I.getInt16(8,!h);return S+=T*60*1e3,{data:new Date(S),size:10}},g.parseValue=function(x,v,C){if(C<1)throw new d.IllegalStateException("Data not enough when parse Value");var I=new DataView(x,v,C),S=1,T=I.getUint8(0),E,B=!1;try{switch(T){case 0:E=I.getFloat64(1,!h),S+=8;break;case 1:{var P=I.getUint8(1);E=!!P,S+=1;break}case 2:{var M=g.parseString(x,v+1,C-1);E=M.data,S+=M.size;break}case 3:{E={};var L=0;for((I.getUint32(C-4,!h)&16777215)===9&&(L=3);S<C-4;){var k=g.parseObject(x,v+S,C-S-L);if(k.objectEnd)break;E[k.data.name]=k.data.value,S+=k.size}if(S<=C-3){var V=I.getUint32(S-1,!h)&16777215;V===9&&(S+=3)}break}case 8:{E={},S+=4;var L=0;for((I.getUint32(C-4,!h)&16777215)===9&&(L=3);S<C-8;){var U=g.parseVariable(x,v+S,C-S-L);if(U.objectEnd)break;E[U.data.name]=U.data.value,S+=U.size}if(S<=C-3){var V=I.getUint32(S-1,!h)&16777215;V===9&&(S+=3)}break}case 9:E=void 0,S=1,B=!0;break;case 10:{E=[];var z=I.getUint32(1,!h);S+=4;for(var Z=0;Z<z;Z++){var j=g.parseValue(x,v+S,C-S);E.push(j.data),S+=j.size}break}case 11:{var K=g.parseDate(x,v+1,C-1);E=K.data,S+=K.size;break}case 12:{var J=g.parseString(x,v+1,C-1);E=J.data,S+=J.size;break}default:S=C,u.default.w("AMF","Unsupported AMF value type "+T)}}catch(q){u.default.e("AMF",q.toString())}return{data:E,size:S,objectEnd:B}},g})();o.default=p}),"./src/demux/demux-errors.js":(function(a,o,l){l.r(o);var u={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};o.default=u}),"./src/demux/exp-golomb.js":(function(a,o,l){l.r(o);var u=l("./src/utils/exception.js"),c=(function(){function d(h){this.TAG="ExpGolomb",this._buffer=h,this._buffer_index=0,this._total_bytes=h.byteLength,this._total_bits=h.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return d.prototype.destroy=function(){this._buffer=null},d.prototype._fillCurrentWord=function(){var h=this._total_bytes-this._buffer_index;if(h<=0)throw new u.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");var p=Math.min(4,h),g=new Uint8Array(4);g.set(this._buffer.subarray(this._buffer_index,this._buffer_index+p)),this._current_word=new DataView(g.buffer).getUint32(0,!1),this._buffer_index+=p,this._current_word_bits_left=p*8},d.prototype.readBits=function(h){if(h>32)throw new u.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(h<=this._current_word_bits_left){var p=this._current_word>>>32-h;return this._current_word<<=h,this._current_word_bits_left-=h,p}var g=this._current_word_bits_left?this._current_word:0;g=g>>>32-this._current_word_bits_left;var x=h-this._current_word_bits_left;this._fillCurrentWord();var v=Math.min(x,this._current_word_bits_left),C=this._current_word>>>32-v;return this._current_word<<=v,this._current_word_bits_left-=v,g=g<<v|C,g},d.prototype.readBool=function(){return this.readBits(1)===1},d.prototype.readByte=function(){return this.readBits(8)},d.prototype._skipLeadingZero=function(){var h;for(h=0;h<this._current_word_bits_left;h++)if((this._current_word&2147483648>>>h)!==0)return this._current_word<<=h,this._current_word_bits_left-=h,h;return this._fillCurrentWord(),h+this._skipLeadingZero()},d.prototype.readUEG=function(){var h=this._skipLeadingZero();return this.readBits(h+1)-1},d.prototype.readSEG=function(){var h=this.readUEG();return h&1?h+1>>>1:-1*(h>>>1)},d})();o.default=c}),"./src/demux/flv-demuxer.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logger.js"),c=l("./src/demux/amf-parser.js"),d=l("./src/demux/sps-parser.js"),h=l("./src/demux/demux-errors.js"),p=l("./src/core/media-info.js"),g=l("./src/utils/exception.js");function x(C,I){return C[I]<<24|C[I+1]<<16|C[I+2]<<8|C[I+3]}var v=(function(){function C(I,S){this.TAG="FLVDemuxer",this._config=S,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=I.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=I.hasAudioTrack,this._hasVideo=I.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new p.default,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 T=new ArrayBuffer(2);return new DataView(T).setInt16(0,256,!0),new Int16Array(T)[0]===256})()}return C.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},C.probe=function(I){var S=new Uint8Array(I),T={match:!1};if(S[0]!==70||S[1]!==76||S[2]!==86||S[3]!==1)return T;var E=(S[4]&4)>>>2!==0,B=(S[4]&1)!==0,P=x(S,5);return P<9?T:{match:!0,consumed:P,dataOffset:P,hasAudioTrack:E,hasVideoTrack:B}},C.prototype.bindDataSource=function(I){return I.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(C.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(I){this._onTrackMetadata=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(I){this._onMediaInfo=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(I){this._onMetaDataArrived=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(I){this._onScriptDataArrived=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onError",{get:function(){return this._onError},set:function(I){this._onError=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(I){this._onDataAvailable=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(I){this._timestampBase=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"overridedDuration",{get:function(){return this._duration},set:function(I){this._durationOverrided=!0,this._duration=I,this._mediaInfo.duration=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"overridedHasAudio",{set:function(I){this._hasAudioFlagOverrided=!0,this._hasAudio=I,this._mediaInfo.hasAudio=I},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"overridedHasVideo",{set:function(I){this._hasVideoFlagOverrided=!0,this._hasVideo=I,this._mediaInfo.hasVideo=I},enumerable:!1,configurable:!0}),C.prototype.resetMediaInfo=function(){this._mediaInfo=new p.default},C.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1},C.prototype.parseChunks=function(I,S){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new g.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var T=0,E=this._littleEndian;if(S===0)if(I.byteLength>13){var B=C.probe(I);T=B.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,S+T!==this._dataOffset&&u.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var P=new DataView(I,T),M=P.getUint32(0,!E);M!==0&&u.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),T+=4}for(;T<I.byteLength;){this._dispatch=!0;var P=new DataView(I,T);if(T+11+4>I.byteLength)break;var L=P.getUint8(0),k=P.getUint32(0,!E)&16777215;if(T+11+k+4>I.byteLength)break;if(L!==8&&L!==9&&L!==18){u.default.w(this.TAG,"Unsupported tag type "+L+", skipped"),T+=11+k+4;continue}var V=P.getUint8(4),U=P.getUint8(5),z=P.getUint8(6),Z=P.getUint8(7),j=z|U<<8|V<<16|Z<<24,K=P.getUint32(7,!E)&16777215;K!==0&&u.default.w(this.TAG,"Meet tag which has StreamID != 0!");var J=T+11;switch(L){case 8:this._parseAudioData(I,J,k,j);break;case 9:this._parseVideoData(I,J,k,j,S+T);break;case 18:this._parseScriptData(I,J,k);break}var q=P.getUint32(11+k,!E);q!==11+k&&u.default.w(this.TAG,"Invalid PrevTagSize "+q),T+=11+k+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),T},C.prototype._parseScriptData=function(I,S,T){var E=c.default.parseScriptData(I,S,T);if(E.hasOwnProperty("onMetaData")){if(E.onMetaData==null||typeof E.onMetaData!="object"){u.default.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&u.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=E;var B=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},B)),typeof B.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=B.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof B.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=B.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof B.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=B.audiodatarate),typeof B.videodatarate=="number"&&(this._mediaInfo.videoDataRate=B.videodatarate),typeof B.width=="number"&&(this._mediaInfo.width=B.width),typeof B.height=="number"&&(this._mediaInfo.height=B.height),typeof B.duration=="number"){if(!this._durationOverrided){var P=Math.floor(B.duration*this._timescale);this._duration=P,this._mediaInfo.duration=P}}else this._mediaInfo.duration=0;if(typeof B.framerate=="number"){var M=Math.floor(B.framerate*1e3);if(M>0){var L=M/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=L,this._referenceFrameRate.fps_num=M,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=L}}if(typeof B.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var k=B.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(k),B.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=B,u.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(E).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},E))},C.prototype._parseKeyframesIndex=function(I){for(var S=[],T=[],E=1;E<I.times.length;E++){var B=this._timestampBase+Math.floor(I.times[E]*1e3);S.push(B),T.push(I.filepositions[E])}return{times:S,filepositions:T}},C.prototype._parseAudioData=function(I,S,T,E){if(T<=1){u.default.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(!(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)){this._littleEndian;var B=new DataView(I,S,T),P=B.getUint8(0),M=P>>>4;if(M!==2&&M!==10){this._onError(h.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+M);return}var L=0,k=(P&12)>>>2;if(k>=0&&k<=4)L=this._flvSoundRateTable[k];else{this._onError(h.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+k);return}var V=P&1,U=this._audioMetadata,z=this._audioTrack;if(U||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),U=this._audioMetadata={},U.type="audio",U.id=z.id,U.timescale=this._timescale,U.duration=this._duration,U.audioSampleRate=L,U.channelCount=V===0?1:2),M===10){var Z=this._parseAACAudioData(I,S+1,T-1);if(Z==null)return;if(Z.packetType===0){U.config&&u.default.w(this.TAG,"Found another AudioSpecificConfig!");var j=Z.data;U.audioSampleRate=j.samplingRate,U.channelCount=j.channelCount,U.codec=j.codec,U.originalCodec=j.originalCodec,U.config=j.config,U.refSampleDuration=1024/U.audioSampleRate*U.timescale,u.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",U);var K=this._mediaInfo;K.audioCodec=U.originalCodec,K.audioSampleRate=U.audioSampleRate,K.audioChannelCount=U.channelCount,K.hasVideo?K.videoCodec!=null&&(K.mimeType='video/x-flv; codecs="'+K.videoCodec+","+K.audioCodec+'"'):K.mimeType='video/x-flv; codecs="'+K.audioCodec+'"',K.isComplete()&&this._onMediaInfo(K)}else if(Z.packetType===1){var J=this._timestampBase+E,q={unit:Z.data,length:Z.data.byteLength,dts:J,pts:J};z.samples.push(q),z.length+=Z.data.length}else u.default.e(this.TAG,"Flv: Unsupported AAC data type "+Z.packetType)}else if(M===2){if(!U.codec){var j=this._parseMP3AudioData(I,S+1,T-1,!0);if(j==null)return;U.audioSampleRate=j.samplingRate,U.channelCount=j.channelCount,U.codec=j.codec,U.originalCodec=j.originalCodec,U.refSampleDuration=1152/U.audioSampleRate*U.timescale,u.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",U);var K=this._mediaInfo;K.audioCodec=U.codec,K.audioSampleRate=U.audioSampleRate,K.audioChannelCount=U.channelCount,K.audioDataRate=j.bitRate,K.hasVideo?K.videoCodec!=null&&(K.mimeType='video/x-flv; codecs="'+K.videoCodec+","+K.audioCodec+'"'):K.mimeType='video/x-flv; codecs="'+K.audioCodec+'"',K.isComplete()&&this._onMediaInfo(K)}var ie=this._parseMP3AudioData(I,S+1,T-1,!1);if(ie==null)return;var J=this._timestampBase+E,oe={unit:ie,length:ie.byteLength,dts:J,pts:J};z.samples.push(oe),z.length+=ie.length}}},C.prototype._parseAACAudioData=function(I,S,T){if(T<=1){u.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var E={},B=new Uint8Array(I,S,T);return E.packetType=B[0],B[0]===0?E.data=this._parseAACAudioSpecificConfig(I,S+1,T-1):E.data=B.subarray(1),E},C.prototype._parseAACAudioSpecificConfig=function(I,S,T){var E=new Uint8Array(I,S,T),B=null,P=0,M=0,L=0,k=null;if(P=M=E[0]>>>3,L=(E[0]&7)<<1|E[1]>>>7,L<0||L>=this._mpegSamplingRates.length){this._onError(h.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var V=this._mpegSamplingRates[L],U=(E[1]&120)>>>3;if(U<0||U>=8){this._onError(h.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}P===5&&(k=(E[1]&7)<<1|E[2]>>>7,(E[2]&124)>>>2);var z=self.navigator.userAgent.toLowerCase();return z.indexOf("firefox")!==-1?L>=6?(P=5,B=new Array(4),k=L-3):(P=2,B=new Array(2),k=L):z.indexOf("android")!==-1?(P=2,B=new Array(2),k=L):(P=5,k=L,B=new Array(4),L>=6?k=L-3:U===1&&(P=2,B=new Array(2),k=L)),B[0]=P<<3,B[0]|=(L&15)>>>1,B[1]=(L&15)<<7,B[1]|=(U&15)<<3,P===5&&(B[1]|=(k&15)>>>1,B[2]=(k&1)<<7,B[2]|=8,B[3]=0),{config:B,samplingRate:V,channelCount:U,codec:"mp4a.40."+P,originalCodec:"mp4a.40."+M}},C.prototype._parseMP3AudioData=function(I,S,T,E){if(T<4){u.default.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}this._littleEndian;var B=new Uint8Array(I,S,T),P=null;if(E){if(B[0]!==255)return;var M=B[1]>>>3&3,L=(B[1]&6)>>1,k=(B[2]&240)>>>4,V=(B[2]&12)>>>2,U=B[3]>>>6&3,z=U!==3?2:1,Z=0,j=0,K="mp3";switch(M){case 0:Z=this._mpegAudioV25SampleRateTable[V];break;case 2:Z=this._mpegAudioV20SampleRateTable[V];break;case 3:Z=this._mpegAudioV10SampleRateTable[V];break}switch(L){case 1:k<this._mpegAudioL3BitRateTable.length&&(j=this._mpegAudioL3BitRateTable[k]);break;case 2:k<this._mpegAudioL2BitRateTable.length&&(j=this._mpegAudioL2BitRateTable[k]);break;case 3:k<this._mpegAudioL1BitRateTable.length&&(j=this._mpegAudioL1BitRateTable[k]);break}P={bitRate:j,samplingRate:Z,channelCount:z,codec:K,originalCodec:K}}else P=B;return P},C.prototype._parseVideoData=function(I,S,T,E,B){if(T<=1){u.default.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(!(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)){var P=new Uint8Array(I,S,T)[0],M=(P&240)>>>4,L=P&15;if(L!==7){this._onError(h.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+L);return}this._parseAVCVideoPacket(I,S+1,T-1,E,B,M)}},C.prototype._parseAVCVideoPacket=function(I,S,T,E,B,P){if(T<4){u.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var M=this._littleEndian,L=new DataView(I,S,T),k=L.getUint8(0),V=L.getUint32(0,!M)&16777215,U=V<<8>>8;if(k===0)this._parseAVCDecoderConfigurationRecord(I,S+4,T-4);else if(k===1)this._parseAVCVideoData(I,S+4,T-4,E,B,P,U);else if(k!==2){this._onError(h.default.FORMAT_ERROR,"Flv: Invalid video packet type "+k);return}},C.prototype._parseAVCDecoderConfigurationRecord=function(I,S,T){if(T<7){u.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var E=this._videoMetadata,B=this._videoTrack,P=this._littleEndian,M=new DataView(I,S,T);E?typeof E.avcc<"u"&&u.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),E=this._videoMetadata={},E.type="video",E.id=B.id,E.timescale=this._timescale,E.duration=this._duration);var L=M.getUint8(0),k=M.getUint8(1);if(M.getUint8(2),M.getUint8(3),L!==1||k===0){this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(M.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(h.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));return}var V=M.getUint8(5)&31;if(V===0){this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else V>1&&u.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+V);for(var U=6,z=0;z<V;z++){var Z=M.getUint16(U,!P);if(U+=2,Z!==0){var j=new Uint8Array(I,S+U,Z);U+=Z;var K=d.default.parseSPS(j);if(z===0){E.codecWidth=K.codec_size.width,E.codecHeight=K.codec_size.height,E.presentWidth=K.present_size.width,E.presentHeight=K.present_size.height,E.profile=K.profile_string,E.level=K.level_string,E.bitDepth=K.bit_depth,E.chromaFormat=K.chroma_format,E.sarRatio=K.sar_ratio,E.frameRate=K.frame_rate,(K.frame_rate.fixed===!1||K.frame_rate.fps_num===0||K.frame_rate.fps_den===0)&&(E.frameRate=this._referenceFrameRate);var J=E.frameRate.fps_den,q=E.frameRate.fps_num;E.refSampleDuration=E.timescale*(J/q);for(var ie=j.subarray(1,4),oe="avc1.",ue=0;ue<3;ue++){var de=ie[ue].toString(16);de.length<2&&(de="0"+de),oe+=de}E.codec=oe;var he=this._mediaInfo;he.width=E.codecWidth,he.height=E.codecHeight,he.fps=E.frameRate.fps,he.profile=E.profile,he.level=E.level,he.refFrames=K.ref_frames,he.chromaFormat=K.chroma_format_string,he.sarNum=E.sarRatio.width,he.sarDen=E.sarRatio.height,he.videoCodec=oe,he.hasAudio?he.audioCodec!=null&&(he.mimeType='video/x-flv; codecs="'+he.videoCodec+","+he.audioCodec+'"'):he.mimeType='video/x-flv; codecs="'+he.videoCodec+'"',he.isComplete()&&this._onMediaInfo(he)}}}var ge=M.getUint8(U);if(ge===0){this._onError(h.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else ge>1&&u.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+ge);U++;for(var z=0;z<ge;z++){var Z=M.getUint16(U,!P);U+=2,Z!==0&&(U+=Z)}E.avcc=new Uint8Array(T),E.avcc.set(new Uint8Array(I,S,T),0),u.default.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",E)},C.prototype._parseAVCVideoData=function(I,S,T,E,B,P,M){for(var L=this._littleEndian,k=new DataView(I,S,T),V=[],U=0,z=0,Z=this._naluLengthSize,j=this._timestampBase+E,K=P===1;z<T;){if(z+4>=T){u.default.w(this.TAG,"Malformed Nalu near timestamp "+j+", offset = "+z+", dataSize = "+T);break}var J=k.getUint32(z,!L);if(Z===3&&(J>>>=8),J>T-Z){u.default.w(this.TAG,"Malformed Nalus near timestamp "+j+", NaluSize > DataSize!");return}var q=k.getUint8(z+Z)&31;q===5&&(K=!0);var ie=new Uint8Array(I,S+z,Z+J),oe={type:q,data:ie};V.push(oe),U+=ie.byteLength,z+=Z+J}if(V.length){var ue=this._videoTrack,de={units:V,length:U,isKeyframe:K,dts:j,cts:M,pts:j+M};K&&(de.fileposition=B),ue.samples.push(de),ue.length+=U}},C})();o.default=v}),"./src/demux/sps-parser.js":(function(a,o,l){l.r(o);var u=l("./src/demux/exp-golomb.js"),c=(function(){function d(){}return d._ebsp2rbsp=function(h){for(var p=h,g=p.byteLength,x=new Uint8Array(g),v=0,C=0;C<g;C++)C>=2&&p[C]===3&&p[C-1]===0&&p[C-2]===0||(x[v]=p[C],v++);return new Uint8Array(x.buffer,0,v)},d.parseSPS=function(h){var p=d._ebsp2rbsp(h),g=new u.default(p);g.readByte();var x=g.readByte();g.readByte();var v=g.readByte();g.readUEG();var C=d.getProfileString(x),I=d.getLevelString(v),S=1,T=420,E=[0,420,422,444],B=8;if((x===100||x===110||x===122||x===244||x===44||x===83||x===86||x===118||x===128||x===138||x===144)&&(S=g.readUEG(),S===3&&g.readBits(1),S<=3&&(T=E[S]),B=g.readUEG()+8,g.readUEG(),g.readBits(1),g.readBool()))for(var P=S!==3?8:12,M=0;M<P;M++)g.readBool()&&(M<6?d._skipScalingList(g,16):d._skipScalingList(g,64));g.readUEG();var L=g.readUEG();if(L===0)g.readUEG();else if(L===1){g.readBits(1),g.readSEG(),g.readSEG();for(var k=g.readUEG(),M=0;M<k;M++)g.readSEG()}var V=g.readUEG();g.readBits(1);var U=g.readUEG(),z=g.readUEG(),Z=g.readBits(1);Z===0&&g.readBits(1),g.readBits(1);var j=0,K=0,J=0,q=0,ie=g.readBool();ie&&(j=g.readUEG(),K=g.readUEG(),J=g.readUEG(),q=g.readUEG());var oe=1,ue=1,de=0,he=!0,ge=0,ce=0,me=g.readBool();if(me){if(g.readBool()){var te=g.readByte(),fe=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ee=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];te>0&&te<16?(oe=fe[te-1],ue=Ee[te-1]):te===255&&(oe=g.readByte()<<8|g.readByte(),ue=g.readByte()<<8|g.readByte())}if(g.readBool()&&g.readBool(),g.readBool()&&(g.readBits(4),g.readBool()&&g.readBits(24)),g.readBool()&&(g.readUEG(),g.readUEG()),g.readBool()){var Pe=g.readBits(32),Ne=g.readBits(32);he=g.readBool(),ge=Ne,ce=Pe*2,de=ge/ce}}var Ae=1;(oe!==1||ue!==1)&&(Ae=oe/ue);var Me=0,We=0;if(S===0)Me=1,We=2-Z;else{var Se=S===3?1:2,Ye=S===1?2:1;Me=Se,We=Ye*(2-Z)}var ut=(U+1)*16,At=(2-Z)*((z+1)*16);ut-=(j+K)*Me,At-=(J+q)*We;var gt=Math.ceil(ut*Ae);return g.destroy(),g=null,{profile_string:C,level_string:I,bit_depth:B,ref_frames:V,chroma_format:T,chroma_format_string:d.getChromaFormatString(T),frame_rate:{fixed:he,fps:de,fps_den:ce,fps_num:ge},sar_ratio:{width:oe,height:ue},codec_size:{width:ut,height:At},present_size:{width:gt,height:At}}},d._skipScalingList=function(h,p){for(var g=8,x=8,v=0,C=0;C<p;C++)x!==0&&(v=h.readSEG(),x=(g+v+256)%256),g=x===0?g:x},d.getProfileString=function(h){switch(h){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"}},d.getLevelString=function(h){return(h/10).toFixed(1)},d.getChromaFormatString=function(h){switch(h){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}},d})();o.default=c}),"./src/flv.js":(function(a,o,l){l.r(o);var u=l("./src/utils/polyfill.js"),c=l("./src/core/features.js"),d=l("./src/io/loader.js"),h=l("./src/player/flv-player.js"),p=l("./src/player/native-player.js"),g=l("./src/player/player-events.js"),x=l("./src/player/player-errors.js"),v=l("./src/utils/logging-control.js"),C=l("./src/utils/exception.js");u.default.install();function I(B,P){var M=B;if(M==null||typeof M!="object")throw new C.InvalidArgumentException("MediaDataSource must be an javascript object!");if(!M.hasOwnProperty("type"))throw new C.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");return M.type==="flv"?new h.default(M,P):new p.default(M,P)}function S(){return c.default.supportMSEH264Playback()}function T(){return c.default.getFeatureList()}var E={};E.createPlayer=I,E.isSupported=S,E.getFeatureList=T,E.BaseLoader=d.BaseLoader,E.LoaderStatus=d.LoaderStatus,E.LoaderErrors=d.LoaderErrors,E.Events=g.default,E.ErrorTypes=x.ErrorTypes,E.ErrorDetails=x.ErrorDetails,E.FlvPlayer=h.default,E.NativePlayer=p.default,E.LoggingControl=v.default,Object.defineProperty(E,"version",{enumerable:!0,get:function(){return"1.6.2"}}),o.default=E}),"./src/index.js":(function(a,o,l){a.exports=l("./src/flv.js").default}),"./src/io/fetch-stream-loader.js":(function(a,o,l){l.r(o);var u=l("./src/utils/browser.js"),c=l("./src/io/loader.js"),d=l("./src/utils/exception.js"),h=(function(){var g=function(x,v){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,I){C.__proto__=I}||function(C,I){for(var S in I)Object.prototype.hasOwnProperty.call(I,S)&&(C[S]=I[S])},g(x,v)};return function(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");g(x,v);function C(){this.constructor=x}x.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}})(),p=(function(g){h(x,g);function x(v,C){var I=g.call(this,"fetch-stream-loader")||this;return I.TAG="FetchStreamLoader",I._seekHandler=v,I._config=C,I._needStash=!0,I._requestAbort=!1,I._contentLength=null,I._receivedLength=0,I}return x.isSupported=function(){try{var v=u.default.msedge&&u.default.version.minor>=15048,C=u.default.msedge?v:!0;return self.fetch&&self.ReadableStream&&C}catch{return!1}},x.prototype.destroy=function(){this.isWorking()&&this.abort(),g.prototype.destroy.call(this)},x.prototype.open=function(v,C){var I=this;this._dataSource=v,this._range=C;var S=v.url;this._config.reuseRedirectedURL&&v.redirectedURL!=null&&(S=v.redirectedURL);var T=this._seekHandler.getConfig(S,C),E=new self.Headers;if(typeof T.headers=="object"){var B=T.headers;for(var P in B)B.hasOwnProperty(P)&&E.append(P,B[P])}var M={method:"GET",headers:E,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var P in this._config.headers)E.append(P,this._config.headers[P]);v.cors===!1&&(M.mode="same-origin"),v.withCredentials&&(M.credentials="include"),v.referrerPolicy&&(M.referrerPolicy=v.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,M.signal=this._abortController.signal),this._status=c.LoaderStatus.kConnecting,self.fetch(T.url,M).then(function(L){if(I._requestAbort){I._status=c.LoaderStatus.kIdle,L.body.cancel();return}if(L.ok&&L.status>=200&&L.status<=299){if(L.url!==T.url&&I._onURLRedirect){var k=I._seekHandler.removeURLParameters(L.url);I._onURLRedirect(k)}var V=L.headers.get("Content-Length");return V!=null&&(I._contentLength=parseInt(V),I._contentLength!==0&&I._onContentLengthKnown&&I._onContentLengthKnown(I._contentLength)),I._pump.call(I,L.body.getReader())}else if(I._status=c.LoaderStatus.kError,I._onError)I._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:L.status,msg:L.statusText});else throw new d.RuntimeException("FetchStreamLoader: Http code invalid, "+L.status+" "+L.statusText)}).catch(function(L){if(!(I._abortController&&I._abortController.signal.aborted))if(I._status=c.LoaderStatus.kError,I._onError)I._onError(c.LoaderErrors.EXCEPTION,{code:-1,msg:L.message});else throw L})},x.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==c.LoaderStatus.kBuffering||!u.default.chrome)&&this._abortController)try{this._abortController.abort()}catch{}},x.prototype._pump=function(v){var C=this;return v.read().then(function(I){if(I.done)if(C._contentLength!==null&&C._receivedLength<C._contentLength){C._status=c.LoaderStatus.kError;var S=c.LoaderErrors.EARLY_EOF,T={code:-1,msg:"Fetch stream meet Early-EOF"};if(C._onError)C._onError(S,T);else throw new d.RuntimeException(T.msg)}else C._status=c.LoaderStatus.kComplete,C._onComplete&&C._onComplete(C._range.from,C._range.from+C._receivedLength-1);else{if(C._abortController&&C._abortController.signal.aborted){C._status=c.LoaderStatus.kComplete;return}else if(C._requestAbort===!0)return C._status=c.LoaderStatus.kComplete,v.cancel();C._status=c.LoaderStatus.kBuffering;var E=I.value.buffer,B=C._range.from+C._receivedLength;C._receivedLength+=E.byteLength,C._onDataArrival&&C._onDataArrival(E,B,C._receivedLength),C._pump(v)}}).catch(function(I){if(C._abortController&&C._abortController.signal.aborted){C._status=c.LoaderStatus.kComplete;return}if(!(I.code===11&&u.default.msedge)){C._status=c.LoaderStatus.kError;var S=0,T=null;if((I.code===19||I.message==="network error")&&(C._contentLength===null||C._contentLength!==null&&C._receivedLength<C._contentLength)?(S=c.LoaderErrors.EARLY_EOF,T={code:I.code,msg:"Fetch stream meet Early-EOF"}):(S=c.LoaderErrors.EXCEPTION,T={code:I.code,msg:I.message}),C._onError)C._onError(S,T);else throw new d.RuntimeException(T.msg)}})},x})(c.BaseLoader);o.default=p}),"./src/io/io-controller.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logger.js"),c=l("./src/io/speed-sampler.js"),d=l("./src/io/loader.js"),h=l("./src/io/fetch-stream-loader.js"),p=l("./src/io/xhr-moz-chunked-loader.js"),g=l("./src/io/xhr-range-loader.js"),x=l("./src/io/websocket-loader.js"),v=l("./src/io/range-seek-handler.js"),C=l("./src/io/param-seek-handler.js"),I=l("./src/utils/exception.js"),S=(function(){function T(E,B,P){this.TAG="IOController",this._config=B,this._extraData=P,this._stashInitialSize=1024*384,B.stashInitialSize!=null&&B.stashInitialSize>0&&(this._stashInitialSize=B.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,B.enableStashBuffer===!1&&(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 c.default,this._speedNormalizeList=[64,128,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 T.prototype.destroy=function(){this._loader.isWorking()&&this._loader.abort(),this._loader.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},T.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},T.prototype.isPaused=function(){return this._paused},Object.defineProperty(T.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"extraData",{get:function(){return this._extraData},set:function(E){this._extraData=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(E){this._onDataArrival=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(E){this._onSeeked=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onError",{get:function(){return this._onError},set:function(E){this._onError=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onComplete",{get:function(){return this._onComplete},set:function(E){this._onComplete=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(E){this._onRedirect=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(E){this._onRecoveredEarlyEof=E},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"hasRedirect",{get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"currentSpeed",{get:function(){return this._loaderClass===g.default?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),T.prototype._selectSeekHandler=function(){var E=this._config;if(E.seekType==="range")this._seekHandler=new v.default(this._config.rangeLoadZeroStart);else if(E.seekType==="param"){var B=E.seekParamStart||"bstart",P=E.seekParamEnd||"bend";this._seekHandler=new C.default(B,P)}else if(E.seekType==="custom"){if(typeof E.customSeekHandler!="function")throw new I.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new E.customSeekHandler}else throw new I.InvalidArgumentException("Invalid seekType in config: "+E.seekType)},T.prototype._selectLoader=function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=x.default;else if(h.default.isSupported())this._loaderClass=h.default;else if(p.default.isSupported())this._loaderClass=p.default;else if(g.default.isSupported())this._loaderClass=g.default;else throw new I.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!")},T.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),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)},T.prototype.open=function(E){this._currentRange={from:0,to:-1},E&&(this._currentRange.from=E),this._speedSampler.reset(),E||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))},T.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},T.prototype.pause=function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)},T.prototype.resume=function(){if(this._paused){this._paused=!1;var E=this._resumeFrom;this._resumeFrom=0,this._internalSeek(E,!0)}},T.prototype.seek=function(E){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(E,!0)},T.prototype._internalSeek=function(E,B){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(B),this._loader.destroy(),this._loader=null;var P={from:E,to:-1};this._currentRange={from:P.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,P),this._onSeeked&&this._onSeeked()},T.prototype.updateUrl=function(E){if(!E||typeof E!="string"||E.length===0)throw new I.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=E},T.prototype._expandBuffer=function(E){for(var B=this._stashSize;B+1024*1024*1<E;)B*=2;if(B+=1024*1024*1,B!==this._bufferSize){var P=new ArrayBuffer(B);if(this._stashUsed>0){var M=new Uint8Array(this._stashBuffer,0,this._stashUsed),L=new Uint8Array(P,0,B);L.set(M,0)}this._stashBuffer=P,this._bufferSize=B}},T.prototype._normalizeSpeed=function(E){var B=this._speedNormalizeList,P=B.length-1,M=0,L=0,k=P;if(E<B[0])return B[0];for(;L<=k;){if(M=L+Math.floor((k-L)/2),M===P||E>=B[M]&&E<B[M+1])return B[M];B[M]<E?L=M+1:k=M-1}},T.prototype._adjustStashSize=function(E){var B=0;this._config.isLive||E<512?B=E:E>=512&&E<=1024?B=Math.floor(E*1.5):B=E*2,B>8192&&(B=8192);var P=B*1024+1024*1024*1;this._bufferSize<P&&this._expandBuffer(P),this._stashSize=B*1024},T.prototype._dispatchChunks=function(E,B){return this._currentRange.to=B+E.byteLength-1,this._onDataArrival(E,B)},T.prototype._onURLRedirect=function(E){this._redirectedURL=E,this._onRedirect&&this._onRedirect(E)},T.prototype._onContentLengthKnown=function(E){E&&this._fullRequestFlag&&(this._totalLength=E,this._fullRequestFlag=!1)},T.prototype._onLoaderChunkArrival=function(E,B,P){if(!this._onDataArrival)throw new I.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(E.byteLength);var M=this._speedSampler.lastSecondKBps;if(M!==0){var L=this._normalizeSpeed(M);this._speedNormalized!==L&&(this._speedNormalized=L,this._adjustStashSize(L))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=B),this._stashUsed+E.byteLength<=this._stashSize){var U=new Uint8Array(this._stashBuffer,0,this._stashSize);U.set(new Uint8Array(E),this._stashUsed),this._stashUsed+=E.byteLength}else{var U=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var Z=this._stashBuffer.slice(0,this._stashUsed),k=this._dispatchChunks(Z,this._stashByteStart);if(k<Z.byteLength){if(k>0){var z=new Uint8Array(Z,k);U.set(z,0),this._stashUsed=z.byteLength,this._stashByteStart+=k}}else this._stashUsed=0,this._stashByteStart+=k;this._stashUsed+E.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+E.byteLength),U=new Uint8Array(this._stashBuffer,0,this._bufferSize)),U.set(new Uint8Array(E),this._stashUsed),this._stashUsed+=E.byteLength}else{var k=this._dispatchChunks(E,B);if(k<E.byteLength){var V=E.byteLength-k;V>this._bufferSize&&(this._expandBuffer(V),U=new Uint8Array(this._stashBuffer,0,this._bufferSize)),U.set(new Uint8Array(E,k),0),this._stashUsed+=V,this._stashByteStart=B+k}}}else if(this._stashUsed===0){var k=this._dispatchChunks(E,B);if(k<E.byteLength){var V=E.byteLength-k;V>this._bufferSize&&this._expandBuffer(V);var U=new Uint8Array(this._stashBuffer,0,this._bufferSize);U.set(new Uint8Array(E,k),0),this._stashUsed+=V,this._stashByteStart=B+k}}else{this._stashUsed+E.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+E.byteLength);var U=new Uint8Array(this._stashBuffer,0,this._bufferSize);U.set(new Uint8Array(E),this._stashUsed),this._stashUsed+=E.byteLength;var k=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(k<this._stashUsed&&k>0){var z=new Uint8Array(this._stashBuffer,k);U.set(z,0)}this._stashUsed-=k,this._stashByteStart+=k}}},T.prototype._flushStashBuffer=function(E){if(this._stashUsed>0){var B=this._stashBuffer.slice(0,this._stashUsed),P=this._dispatchChunks(B,this._stashByteStart),M=B.byteLength-P;if(P<B.byteLength)if(E)u.default.w(this.TAG,M+" bytes unconsumed data remain when flush buffer, dropped");else{if(P>0){var L=new Uint8Array(this._stashBuffer,0,this._bufferSize),k=new Uint8Array(B,P);L.set(k,0),this._stashUsed=k.byteLength,this._stashByteStart+=P}return 0}return this._stashUsed=0,this._stashByteStart=0,M}return 0},T.prototype._onLoaderComplete=function(E,B){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},T.prototype._onLoaderError=function(E,B){switch(u.default.e(this.TAG,"Loader error, code = "+B.code+", msg = "+B.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,E=d.LoaderErrors.UNRECOVERABLE_EARLY_EOF),E){case d.LoaderErrors.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var P=this._currentRange.to+1;P<this._totalLength&&(u.default.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(P,!1));return}E=d.LoaderErrors.UNRECOVERABLE_EARLY_EOF;break}case d.LoaderErrors.UNRECOVERABLE_EARLY_EOF:case d.LoaderErrors.CONNECTING_TIMEOUT:case d.LoaderErrors.HTTP_STATUS_CODE_INVALID:case d.LoaderErrors.EXCEPTION:break}if(this._onError)this._onError(E,B);else throw new I.RuntimeException("IOException: "+B.msg)},T})();o.default=S}),"./src/io/loader.js":(function(a,o,l){l.r(o),l.d(o,{LoaderStatus:function(){return c},LoaderErrors:function(){return d},BaseLoader:function(){return h}});var u=l("./src/utils/exception.js"),c={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},d={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},h=(function(){function p(g){this._type=g||"undefined",this._status=c.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return p.prototype.destroy=function(){this._status=c.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null},p.prototype.isWorking=function(){return this._status===c.kConnecting||this._status===c.kBuffering},Object.defineProperty(p.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"needStashBuffer",{get:function(){return this._needStash},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onContentLengthKnown",{get:function(){return this._onContentLengthKnown},set:function(g){this._onContentLengthKnown=g},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onURLRedirect",{get:function(){return this._onURLRedirect},set:function(g){this._onURLRedirect=g},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(g){this._onDataArrival=g},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onError",{get:function(){return this._onError},set:function(g){this._onError=g},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onComplete",{get:function(){return this._onComplete},set:function(g){this._onComplete=g},enumerable:!1,configurable:!0}),p.prototype.open=function(g,x){throw new u.NotImplementedException("Unimplemented abstract function!")},p.prototype.abort=function(){throw new u.NotImplementedException("Unimplemented abstract function!")},p})()}),"./src/io/param-seek-handler.js":(function(a,o,l){l.r(o);var u=(function(){function c(d,h){this._startName=d,this._endName=h}return c.prototype.getConfig=function(d,h){var p=d;if(h.from!==0||h.to!==-1){var g=!0;p.indexOf("?")===-1&&(p+="?",g=!1),g&&(p+="&"),p+=this._startName+"="+h.from.toString(),h.to!==-1&&(p+="&"+this._endName+"="+h.to.toString())}return{url:p,headers:{}}},c.prototype.removeURLParameters=function(d){var h=d.split("?")[0],p=void 0,g=d.indexOf("?");g!==-1&&(p=d.substring(g+1));var x="";if(p!=null&&p.length>0)for(var v=p.split("&"),C=0;C<v.length;C++){var I=v[C].split("="),S=C>0;I[0]!==this._startName&&I[0]!==this._endName&&(S&&(x+="&"),x+=v[C])}return x.length===0?h:h+"?"+x},c})();o.default=u}),"./src/io/range-seek-handler.js":(function(a,o,l){l.r(o);var u=(function(){function c(d){this._zeroStart=d||!1}return c.prototype.getConfig=function(d,h){var p={};if(h.from!==0||h.to!==-1){var g=void 0;h.to!==-1?g="bytes="+h.from.toString()+"-"+h.to.toString():g="bytes="+h.from.toString()+"-",p.Range=g}else this._zeroStart&&(p.Range="bytes=0-");return{url:d,headers:p}},c.prototype.removeURLParameters=function(d){return d},c})();o.default=u}),"./src/io/speed-sampler.js":(function(a,o,l){l.r(o);var u=(function(){function c(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return c.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},c.prototype.addBytes=function(d){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=d,this._totalBytes+=d):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=d,this._totalBytes+=d):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=d,this._totalBytes+=d,this._lastCheckpoint=this._now())},Object.defineProperty(c.prototype,"currentKBps",{get:function(){this.addBytes(0);var d=(this._now()-this._lastCheckpoint)/1e3;return d==0&&(d=1),this._intervalBytes/d/1024},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"averageKBps",{get:function(){var d=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/d/1024},enumerable:!1,configurable:!0}),c})();o.default=u}),"./src/io/websocket-loader.js":(function(a,o,l){l.r(o);var u=l("./src/io/loader.js"),c=l("./src/utils/exception.js"),d=(function(){var p=function(g,x){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,C){v.__proto__=C}||function(v,C){for(var I in C)Object.prototype.hasOwnProperty.call(C,I)&&(v[I]=C[I])},p(g,x)};return function(g,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");p(g,x);function v(){this.constructor=g}g.prototype=x===null?Object.create(x):(v.prototype=x.prototype,new v)}})(),h=(function(p){d(g,p);function g(){var x=p.call(this,"websocket-loader")||this;return x.TAG="WebSocketLoader",x._needStash=!0,x._ws=null,x._requestAbort=!1,x._receivedLength=0,x}return g.isSupported=function(){try{return typeof self.WebSocket<"u"}catch{return!1}},g.prototype.destroy=function(){this._ws&&this.abort(),p.prototype.destroy.call(this)},g.prototype.open=function(x){try{var v=this._ws=new self.WebSocket(x.url);v.binaryType="arraybuffer",v.onopen=this._onWebSocketOpen.bind(this),v.onclose=this._onWebSocketClose.bind(this),v.onmessage=this._onWebSocketMessage.bind(this),v.onerror=this._onWebSocketError.bind(this),this._status=u.LoaderStatus.kConnecting}catch(I){this._status=u.LoaderStatus.kError;var C={code:I.code,msg:I.message};if(this._onError)this._onError(u.LoaderErrors.EXCEPTION,C);else throw new c.RuntimeException(C.msg)}},g.prototype.abort=function(){var x=this._ws;x&&(x.readyState===0||x.readyState===1)&&(this._requestAbort=!0,x.close()),this._ws=null,this._status=u.LoaderStatus.kComplete},g.prototype._onWebSocketOpen=function(x){this._status=u.LoaderStatus.kBuffering},g.prototype._onWebSocketClose=function(x){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=u.LoaderStatus.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)},g.prototype._onWebSocketMessage=function(x){var v=this;if(x.data instanceof ArrayBuffer)this._dispatchArrayBuffer(x.data);else if(x.data instanceof Blob){var C=new FileReader;C.onload=function(){v._dispatchArrayBuffer(C.result)},C.readAsArrayBuffer(x.data)}else{this._status=u.LoaderStatus.kError;var I={code:-1,msg:"Unsupported WebSocket message type: "+x.data.constructor.name};if(this._onError)this._onError(u.LoaderErrors.EXCEPTION,I);else throw new c.RuntimeException(I.msg)}},g.prototype._dispatchArrayBuffer=function(x){var v=x,C=this._receivedLength;this._receivedLength+=v.byteLength,this._onDataArrival&&this._onDataArrival(v,C,this._receivedLength)},g.prototype._onWebSocketError=function(x){this._status=u.LoaderStatus.kError;var v={code:x.code,msg:x.message};if(this._onError)this._onError(u.LoaderErrors.EXCEPTION,v);else throw new c.RuntimeException(v.msg)},g})(u.BaseLoader);o.default=h}),"./src/io/xhr-moz-chunked-loader.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logger.js"),c=l("./src/io/loader.js"),d=l("./src/utils/exception.js"),h=(function(){var g=function(x,v){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,I){C.__proto__=I}||function(C,I){for(var S in I)Object.prototype.hasOwnProperty.call(I,S)&&(C[S]=I[S])},g(x,v)};return function(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");g(x,v);function C(){this.constructor=x}x.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}})(),p=(function(g){h(x,g);function x(v,C){var I=g.call(this,"xhr-moz-chunked-loader")||this;return I.TAG="MozChunkedLoader",I._seekHandler=v,I._config=C,I._needStash=!0,I._xhr=null,I._requestAbort=!1,I._contentLength=null,I._receivedLength=0,I}return x.isSupported=function(){try{var v=new XMLHttpRequest;return v.open("GET","https://example.com",!0),v.responseType="moz-chunked-arraybuffer",v.responseType==="moz-chunked-arraybuffer"}catch(C){return u.default.w("MozChunkedLoader",C.message),!1}},x.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),g.prototype.destroy.call(this)},x.prototype.open=function(v,C){this._dataSource=v,this._range=C;var I=v.url;this._config.reuseRedirectedURL&&v.redirectedURL!=null&&(I=v.redirectedURL);var S=this._seekHandler.getConfig(I,C);this._requestURL=S.url;var T=this._xhr=new XMLHttpRequest;if(T.open("GET",S.url,!0),T.responseType="moz-chunked-arraybuffer",T.onreadystatechange=this._onReadyStateChange.bind(this),T.onprogress=this._onProgress.bind(this),T.onloadend=this._onLoadEnd.bind(this),T.onerror=this._onXhrError.bind(this),v.withCredentials&&(T.withCredentials=!0),typeof S.headers=="object"){var E=S.headers;for(var B in E)E.hasOwnProperty(B)&&T.setRequestHeader(B,E[B])}if(typeof this._config.headers=="object"){var E=this._config.headers;for(var B in E)E.hasOwnProperty(B)&&T.setRequestHeader(B,E[B])}this._status=c.LoaderStatus.kConnecting,T.send()},x.prototype.abort=function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=c.LoaderStatus.kComplete},x.prototype._onReadyStateChange=function(v){var C=v.target;if(C.readyState===2){if(C.responseURL!=null&&C.responseURL!==this._requestURL&&this._onURLRedirect){var I=this._seekHandler.removeURLParameters(C.responseURL);this._onURLRedirect(I)}if(C.status!==0&&(C.status<200||C.status>299))if(this._status=c.LoaderStatus.kError,this._onError)this._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:C.status,msg:C.statusText});else throw new d.RuntimeException("MozChunkedLoader: Http code invalid, "+C.status+" "+C.statusText);else this._status=c.LoaderStatus.kBuffering}},x.prototype._onProgress=function(v){if(this._status!==c.LoaderStatus.kError){this._contentLength===null&&v.total!==null&&v.total!==0&&(this._contentLength=v.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var C=v.target.response,I=this._range.from+this._receivedLength;this._receivedLength+=C.byteLength,this._onDataArrival&&this._onDataArrival(C,I,this._receivedLength)}},x.prototype._onLoadEnd=function(v){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===c.LoaderStatus.kError)return;this._status=c.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)},x.prototype._onXhrError=function(v){this._status=c.LoaderStatus.kError;var C=0,I=null;if(this._contentLength&&v.loaded<this._contentLength?(C=c.LoaderErrors.EARLY_EOF,I={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(C=c.LoaderErrors.EXCEPTION,I={code:-1,msg:v.constructor.name+" "+v.type}),this._onError)this._onError(C,I);else throw new d.RuntimeException(I.msg)},x})(c.BaseLoader);o.default=p}),"./src/io/xhr-range-loader.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logger.js"),c=l("./src/io/speed-sampler.js"),d=l("./src/io/loader.js"),h=l("./src/utils/exception.js"),p=(function(){var x=function(v,C){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,S){I.__proto__=S}||function(I,S){for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(I[T]=S[T])},x(v,C)};return function(v,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");x(v,C);function I(){this.constructor=v}v.prototype=C===null?Object.create(C):(I.prototype=C.prototype,new I)}})(),g=(function(x){p(v,x);function v(C,I){var S=x.call(this,"xhr-range-loader")||this;return S.TAG="RangeLoader",S._seekHandler=C,S._config=I,S._needStash=!1,S._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],S._currentChunkSizeKB=384,S._currentSpeedNormalized=0,S._zeroSpeedChunkCount=0,S._xhr=null,S._speedSampler=new c.default,S._requestAbort=!1,S._waitForTotalLength=!1,S._totalLengthReceived=!1,S._currentRequestURL=null,S._currentRedirectedURL=null,S._currentRequestRange=null,S._totalLength=null,S._contentLength=null,S._receivedLength=0,S._lastTimeLoaded=0,S}return v.isSupported=function(){try{var C=new XMLHttpRequest;return C.open("GET","https://example.com",!0),C.responseType="arraybuffer",C.responseType==="arraybuffer"}catch(I){return u.default.w("RangeLoader",I.message),!1}},v.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),x.prototype.destroy.call(this)},Object.defineProperty(v.prototype,"currentSpeed",{get:function(){return this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),v.prototype.open=function(C,I){this._dataSource=C,this._range=I,this._status=d.LoaderStatus.kConnecting;var S=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(S=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!S?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()},v.prototype._openSubRange=function(){var C=this._currentChunkSizeKB*1024,I=this._range.from+this._receivedLength,S=I+C;this._contentLength!=null&&S-this._range.from>=this._contentLength&&(S=this._range.from+this._contentLength-1),this._currentRequestRange={from:I,to:S},this._internalOpen(this._dataSource,this._currentRequestRange)},v.prototype._internalOpen=function(C,I){this._lastTimeLoaded=0;var S=C.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?S=this._currentRedirectedURL:C.redirectedURL!=null&&(S=C.redirectedURL));var T=this._seekHandler.getConfig(S,I);this._currentRequestURL=T.url;var E=this._xhr=new XMLHttpRequest;if(E.open("GET",T.url,!0),E.responseType="arraybuffer",E.onreadystatechange=this._onReadyStateChange.bind(this),E.onprogress=this._onProgress.bind(this),E.onload=this._onLoad.bind(this),E.onerror=this._onXhrError.bind(this),C.withCredentials&&(E.withCredentials=!0),typeof T.headers=="object"){var B=T.headers;for(var P in B)B.hasOwnProperty(P)&&E.setRequestHeader(P,B[P])}if(typeof this._config.headers=="object"){var B=this._config.headers;for(var P in B)B.hasOwnProperty(P)&&E.setRequestHeader(P,B[P])}E.send()},v.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=d.LoaderStatus.kComplete},v.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)},v.prototype._onReadyStateChange=function(C){var I=C.target;if(I.readyState===2){if(I.responseURL!=null){var S=this._seekHandler.removeURLParameters(I.responseURL);I.responseURL!==this._currentRequestURL&&S!==this._currentRedirectedURL&&(this._currentRedirectedURL=S,this._onURLRedirect&&this._onURLRedirect(S))}if(I.status>=200&&I.status<=299){if(this._waitForTotalLength)return;this._status=d.LoaderStatus.kBuffering}else if(this._status=d.LoaderStatus.kError,this._onError)this._onError(d.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:I.status,msg:I.statusText});else throw new h.RuntimeException("RangeLoader: Http code invalid, "+I.status+" "+I.statusText)}},v.prototype._onProgress=function(C){if(this._status!==d.LoaderStatus.kError){if(this._contentLength===null){var I=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,I=!0;var S=C.total;this._internalAbort(),S!=null&S!==0&&(this._totalLength=S)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,I){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var T=C.loaded-this._lastTimeLoaded;this._lastTimeLoaded=C.loaded,this._speedSampler.addBytes(T)}},v.prototype._normalizeSpeed=function(C){var I=this._chunkSizeKBList,S=I.length-1,T=0,E=0,B=S;if(C<I[0])return I[0];for(;E<=B;){if(T=E+Math.floor((B-E)/2),T===S||C>=I[T]&&C<I[T+1])return I[T];I[T]<C?E=T+1:B=T-1}},v.prototype._onLoad=function(C){if(this._status!==d.LoaderStatus.kError){if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var I=this._speedSampler.lastSecondKBps;if(I===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(I=this._speedSampler.currentKBps)),I!==0){var S=this._normalizeSpeed(I);this._currentSpeedNormalized!==S&&(this._currentSpeedNormalized=S,this._currentChunkSizeKB=S)}var T=C.target.response,E=this._range.from+this._receivedLength;this._receivedLength+=T.byteLength;var B=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():B=!0,this._onDataArrival&&this._onDataArrival(T,E,this._receivedLength),B&&(this._status=d.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},v.prototype._onXhrError=function(C){this._status=d.LoaderStatus.kError;var I=0,S=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(I=d.LoaderErrors.EARLY_EOF,S={code:-1,msg:"RangeLoader meet Early-Eof"}):(I=d.LoaderErrors.EXCEPTION,S={code:-1,msg:C.constructor.name+" "+C.type}),this._onError)this._onError(I,S);else throw new h.RuntimeException(S.msg)},v})(d.BaseLoader);o.default=g}),"./src/player/flv-player.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./src/utils/logger.js"),h=l("./src/utils/browser.js"),p=l("./src/player/player-events.js"),g=l("./src/core/transmuxer.js"),x=l("./src/core/transmuxing-events.js"),v=l("./src/core/mse-controller.js"),C=l("./src/core/mse-events.js"),I=l("./src/player/player-errors.js"),S=l("./src/config.js"),T=l("./src/utils/exception.js"),E=(function(){function B(P,M){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(c()),this._config=(0,S.createDefaultConfig)(),typeof M=="object"&&Object.assign(this._config,M),P.type.toLowerCase()!=="flv")throw new T.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");P.isLive===!0&&(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=P,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 L=h.default.chrome&&(h.default.version.major<50||h.default.version.major===50&&h.default.version.build<2661);this._alwaysSeekKeyframe=!!(L||h.default.msedge||h.default.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return B.prototype.destroy=function(){this._progressChecker!=null&&(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},B.prototype.on=function(P,M){var L=this;P===p.default.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){L._emitter.emit(p.default.MEDIA_INFO,L.mediaInfo)}):P===p.default.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(function(){L._emitter.emit(p.default.STATISTICS_INFO,L.statisticsInfo)}),this._emitter.addListener(P,M)},B.prototype.off=function(P,M){this._emitter.removeListener(P,M)},B.prototype.attachMediaElement=function(P){var M=this;if(this._mediaElement=P,P.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),P.addEventListener("seeking",this.e.onvSeeking),P.addEventListener("canplay",this.e.onvCanPlay),P.addEventListener("stalled",this.e.onvStalled),P.addEventListener("progress",this.e.onvProgress),this._msectl=new v.default(this._config),this._msectl.on(C.default.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(C.default.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(C.default.SOURCE_OPEN,function(){M._mseSourceOpened=!0,M._hasPendingLoad&&(M._hasPendingLoad=!1,M.load())}),this._msectl.on(C.default.ERROR,function(L){M._emitter.emit(p.default.ERROR,I.ErrorTypes.MEDIA_ERROR,I.ErrorDetails.MEDIA_MSE_ERROR,L)}),this._msectl.attachMediaElement(P),this._pendingSeekTime!=null)try{P.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},B.prototype.detachMediaElement=function(){this._mediaElement&&(this._msectl.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)},B.prototype.load=function(){var P=this;if(!this._mediaElement)throw new T.IllegalStateException("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new T.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new g.default(this._mediaDataSource,this._config),this._transmuxer.on(x.default.INIT_SEGMENT,function(M,L){P._msectl.appendInitSegment(L)}),this._transmuxer.on(x.default.MEDIA_SEGMENT,function(M,L){if(P._msectl.appendMediaSegment(L),P._config.lazyLoad&&!P._config.isLive){var k=P._mediaElement.currentTime;L.info.endDts>=(k+P._config.lazyLoadMaxDuration)*1e3&&P._progressChecker==null&&(d.default.v(P.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),P._suspendTransmuxer())}}),this._transmuxer.on(x.default.LOADING_COMPLETE,function(){P._msectl.endOfStream(),P._emitter.emit(p.default.LOADING_COMPLETE)}),this._transmuxer.on(x.default.RECOVERED_EARLY_EOF,function(){P._emitter.emit(p.default.RECOVERED_EARLY_EOF)}),this._transmuxer.on(x.default.IO_ERROR,function(M,L){P._emitter.emit(p.default.ERROR,I.ErrorTypes.NETWORK_ERROR,M,L)}),this._transmuxer.on(x.default.DEMUX_ERROR,function(M,L){P._emitter.emit(p.default.ERROR,I.ErrorTypes.MEDIA_ERROR,M,{code:-1,msg:L})}),this._transmuxer.on(x.default.MEDIA_INFO,function(M){P._mediaInfo=M,P._emitter.emit(p.default.MEDIA_INFO,Object.assign({},M))}),this._transmuxer.on(x.default.METADATA_ARRIVED,function(M){P._emitter.emit(p.default.METADATA_ARRIVED,M)}),this._transmuxer.on(x.default.SCRIPTDATA_ARRIVED,function(M){P._emitter.emit(p.default.SCRIPTDATA_ARRIVED,M)}),this._transmuxer.on(x.default.STATISTICS_INFO,function(M){P._statisticsInfo=P._fillStatisticsInfo(M),P._emitter.emit(p.default.STATISTICS_INFO,Object.assign({},P._statisticsInfo))}),this._transmuxer.on(x.default.RECOMMEND_SEEKPOINT,function(M){P._mediaElement&&!P._config.accurateSeek&&(P._requestSetTime=!0,P._mediaElement.currentTime=M/1e3)}),this._transmuxer.open()}},B.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)},B.prototype.play=function(){return this._mediaElement.play()},B.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(B.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(P){this._mediaElement.volume=P},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(P){this._mediaElement.muted=P},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(P){this._mediaElement?this._internalSeek(P):this._pendingSeekTime=P},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"statisticsInfo",{get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),B.prototype._fillStatisticsInfo=function(P){if(P.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return P;var M=!0,L=0,k=0;if(this._mediaElement.getVideoPlaybackQuality){var V=this._mediaElement.getVideoPlaybackQuality();L=V.totalVideoFrames,k=V.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(L=this._mediaElement.webkitDecodedFrameCount,k=this._mediaElement.webkitDroppedFrameCount):M=!1;return M&&(P.decodedFrames=L,P.droppedFrames=k),P},B.prototype._onmseUpdateEnd=function(){if(!(!this._config.lazyLoad||this._config.isLive)){for(var P=this._mediaElement.buffered,M=this._mediaElement.currentTime,L=0,k=0;k<P.length;k++){var V=P.start(k),U=P.end(k);if(V<=M&&M<U){L=U;break}}L>=M+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(d.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},B.prototype._onmseBufferFull=function(){d.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()},B.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},B.prototype._checkProgressAndResume=function(){for(var P=this._mediaElement.currentTime,M=this._mediaElement.buffered,L=!1,k=0;k<M.length;k++){var V=M.start(k),U=M.end(k);if(P>=V&&P<U){P>=U-this._config.lazyLoadRecoverDuration&&(L=!0);break}}L&&(window.clearInterval(this._progressChecker),this._progressChecker=null,L&&(d.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},B.prototype._isTimepointBuffered=function(P){for(var M=this._mediaElement.buffered,L=0;L<M.length;L++){var k=M.start(L),V=M.end(L);if(P>=k&&P<V)return!0}return!1},B.prototype._internalSeek=function(P){var M=this._isTimepointBuffered(P),L=!1,k=0;if(P<1&&this._mediaElement.buffered.length>0){var V=this._mediaElement.buffered.start(0);(V<1&&P<V||h.default.safari)&&(L=!0,k=h.default.safari?.1:V)}if(L)this._requestSetTime=!0,this._mediaElement.currentTime=k;else if(M){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=P;else{var U=this._msectl.getNearestKeyframe(Math.floor(P*1e3));this._requestSetTime=!0,U!=null?this._mediaElement.currentTime=U.dts/1e3:this._mediaElement.currentTime=P}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(P),this._transmuxer.seek(Math.floor(P*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=P)},B.prototype._checkAndApplyUnbufferedSeekpoint=function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var P=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(P)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(P),this._transmuxer.seek(Math.floor(P*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=P))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},B.prototype._checkAndResumeStuckPlayback=function(P){var M=this._mediaElement;if(P||!this._receivedCanPlay||M.readyState<2){var L=M.buffered;L.length>0&&M.currentTime<L.start(0)&&(d.default.w(this.TAG,"Playback seems stuck at "+M.currentTime+", seek to "+L.start(0)),this._requestSetTime=!0,this._mediaElement.currentTime=L.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)},B.prototype._onvLoadedMetadata=function(P){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)},B.prototype._onvSeeking=function(P){var M=this._mediaElement.currentTime,L=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(M<1&&L.length>0){var k=L.start(0);if(k<1&&M<k||h.default.safari){this._requestSetTime=!0,this._mediaElement.currentTime=h.default.safari?.1:k;return}}if(this._isTimepointBuffered(M)){if(this._alwaysSeekKeyframe){var V=this._msectl.getNearestKeyframe(Math.floor(M*1e3));V!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=V.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:M,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)},B.prototype._onvCanPlay=function(P){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)},B.prototype._onvStalled=function(P){this._checkAndResumeStuckPlayback(!0)},B.prototype._onvProgress=function(P){this._checkAndResumeStuckPlayback()},B})();o.default=E}),"./src/player/native-player.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./src/player/player-events.js"),h=l("./src/config.js"),p=l("./src/utils/exception.js"),g=(function(){function x(v,C){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(c()),this._config=(0,h.createDefaultConfig)(),typeof C=="object"&&Object.assign(this._config,C),v.type.toLowerCase()==="flv")throw new p.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");if(v.hasOwnProperty("segments"))throw new p.InvalidArgumentException("NativePlayer("+v.type+") doesn't support multipart playback!");this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=v,this._mediaElement=null}return x.prototype.destroy=function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},x.prototype.on=function(v,C){var I=this;v===d.default.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){I._emitter.emit(d.default.MEDIA_INFO,I.mediaInfo)}):v===d.default.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){I._emitter.emit(d.default.STATISTICS_INFO,I.statisticsInfo)}),this._emitter.addListener(v,C)},x.prototype.off=function(v,C){this._emitter.removeListener(v,C)},x.prototype.attachMediaElement=function(v){if(this._mediaElement=v,v.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{v.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch{}},x.prototype.detachMediaElement=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},x.prototype.load=function(){if(!this._mediaElement)throw new p.IllegalStateException("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.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)},x.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},x.prototype.play=function(){return this._mediaElement.play()},x.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(x.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(v){this._mediaElement.volume=v},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(v){this._mediaElement.muted=v},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(v){this._mediaElement?this._mediaElement.currentTime=v:this._pendingSeekTime=v},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"mediaInfo",{get:function(){var v=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",C={mimeType:v+this._mediaDataSource.type};return this._mediaElement&&(C.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(C.width=this._mediaElement.videoWidth,C.height=this._mediaElement.videoHeight)),C},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"statisticsInfo",{get:function(){var v={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return v;var C=!0,I=0,S=0;if(this._mediaElement.getVideoPlaybackQuality){var T=this._mediaElement.getVideoPlaybackQuality();I=T.totalVideoFrames,S=T.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(I=this._mediaElement.webkitDecodedFrameCount,S=this._mediaElement.webkitDroppedFrameCount):C=!1;return C&&(v.decodedFrames=I,v.droppedFrames=S),v},enumerable:!1,configurable:!0}),x.prototype._onvLoadedMetadata=function(v){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(d.default.MEDIA_INFO,this.mediaInfo)},x.prototype._reportStatisticsInfo=function(){this._emitter.emit(d.default.STATISTICS_INFO,this.statisticsInfo)},x})();o.default=g}),"./src/player/player-errors.js":(function(a,o,l){l.r(o),l.d(o,{ErrorTypes:function(){return d},ErrorDetails:function(){return h}});var u=l("./src/io/loader.js"),c=l("./src/demux/demux-errors.js"),d={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},h={NETWORK_EXCEPTION:u.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:u.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:u.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:u.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:c.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:c.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:c.default.CODEC_UNSUPPORTED}}),"./src/player/player-events.js":(function(a,o,l){l.r(o);var u={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};o.default=u}),"./src/remux/aac-silent.js":(function(a,o,l){l.r(o);var u=(function(){function c(){}return c.getSilentFrame=function(d,h){if(d==="mp4a.40.2"){if(h===1)return new Uint8Array([0,200,0,128,35,128]);if(h===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(h===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(h===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(h===5)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(h===6)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(h===1)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(h===2)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(h===3)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},c})();o.default=u}),"./src/remux/mp4-generator.js":(function(a,o,l){l.r(o);var u=(function(){function c(){}return c.init=function(){c.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var d in c.types)c.types.hasOwnProperty(d)&&(c.types[d]=[d.charCodeAt(0),d.charCodeAt(1),d.charCodeAt(2),d.charCodeAt(3)]);var h=c.constants={};h.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),h.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),h.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),h.STSC=h.STCO=h.STTS,h.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),h.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]),h.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]),h.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),h.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},c.box=function(d){for(var h=8,p=null,g=Array.prototype.slice.call(arguments,1),x=g.length,v=0;v<x;v++)h+=g[v].byteLength;p=new Uint8Array(h),p[0]=h>>>24&255,p[1]=h>>>16&255,p[2]=h>>>8&255,p[3]=h&255,p.set(d,4);for(var C=8,v=0;v<x;v++)p.set(g[v],C),C+=g[v].byteLength;return p},c.generateInitSegment=function(d){var h=c.box(c.types.ftyp,c.constants.FTYP),p=c.moov(d),g=new Uint8Array(h.byteLength+p.byteLength);return g.set(h,0),g.set(p,h.byteLength),g},c.moov=function(d){var h=c.mvhd(d.timescale,d.duration),p=c.trak(d),g=c.mvex(d);return c.box(c.types.moov,h,p,g)},c.mvhd=function(d,h){return c.box(c.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,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]))},c.trak=function(d){return c.box(c.types.trak,c.tkhd(d),c.mdia(d))},c.tkhd=function(d){var h=d.id,p=d.duration,g=d.presentWidth,x=d.presentHeight;return c.box(c.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255,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,g>>>8&255,g&255,0,0,x>>>8&255,x&255,0,0]))},c.mdia=function(d){return c.box(c.types.mdia,c.mdhd(d),c.hdlr(d),c.minf(d))},c.mdhd=function(d){var h=d.timescale,p=d.duration;return c.box(c.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255,85,196,0,0]))},c.hdlr=function(d){var h=null;return d.type==="audio"?h=c.constants.HDLR_AUDIO:h=c.constants.HDLR_VIDEO,c.box(c.types.hdlr,h)},c.minf=function(d){var h=null;return d.type==="audio"?h=c.box(c.types.smhd,c.constants.SMHD):h=c.box(c.types.vmhd,c.constants.VMHD),c.box(c.types.minf,h,c.dinf(),c.stbl(d))},c.dinf=function(){var d=c.box(c.types.dinf,c.box(c.types.dref,c.constants.DREF));return d},c.stbl=function(d){var h=c.box(c.types.stbl,c.stsd(d),c.box(c.types.stts,c.constants.STTS),c.box(c.types.stsc,c.constants.STSC),c.box(c.types.stsz,c.constants.STSZ),c.box(c.types.stco,c.constants.STCO));return h},c.stsd=function(d){return d.type==="audio"?d.codec==="mp3"?c.box(c.types.stsd,c.constants.STSD_PREFIX,c.mp3(d)):c.box(c.types.stsd,c.constants.STSD_PREFIX,c.mp4a(d)):c.box(c.types.stsd,c.constants.STSD_PREFIX,c.avc1(d))},c.mp3=function(d){var h=d.channelCount,p=d.audioSampleRate,g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h,0,16,0,0,0,0,p>>>8&255,p&255,0,0]);return c.box(c.types[".mp3"],g)},c.mp4a=function(d){var h=d.channelCount,p=d.audioSampleRate,g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h,0,16,0,0,0,0,p>>>8&255,p&255,0,0]);return c.box(c.types.mp4a,g,c.esds(d))},c.esds=function(d){var h=d.config||[],p=h.length,g=new Uint8Array([0,0,0,0,3,23+p,0,1,0,4,15+p,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([p]).concat(h).concat([6,1,2]));return c.box(c.types.esds,g)},c.avc1=function(d){var h=d.avcc,p=d.codecWidth,g=d.codecHeight,x=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,p>>>8&255,p&255,g>>>8&255,g&255,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 c.box(c.types.avc1,x,c.box(c.types.avcC,h))},c.mvex=function(d){return c.box(c.types.mvex,c.trex(d))},c.trex=function(d){var h=d.id,p=new Uint8Array([0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return c.box(c.types.trex,p)},c.moof=function(d,h){return c.box(c.types.moof,c.mfhd(d.sequenceNumber),c.traf(d,h))},c.mfhd=function(d){var h=new Uint8Array([0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255]);return c.box(c.types.mfhd,h)},c.traf=function(d,h){var p=d.id,g=c.box(c.types.tfhd,new Uint8Array([0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255])),x=c.box(c.types.tfdt,new Uint8Array([0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255])),v=c.sdtp(d),C=c.trun(d,v.byteLength+16+16+8+16+8+8);return c.box(c.types.traf,g,x,C,v)},c.sdtp=function(d){for(var h=d.samples||[],p=h.length,g=new Uint8Array(4+p),x=0;x<p;x++){var v=h[x].flags;g[x+4]=v.isLeading<<6|v.dependsOn<<4|v.isDependedOn<<2|v.hasRedundancy}return c.box(c.types.sdtp,g)},c.trun=function(d,h){var p=d.samples||[],g=p.length,x=12+16*g,v=new Uint8Array(x);h+=8+x,v.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255],0);for(var C=0;C<g;C++){var I=p[C].duration,S=p[C].size,T=p[C].flags,E=p[C].cts;v.set([I>>>24&255,I>>>16&255,I>>>8&255,I&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,T.isLeading<<2|T.dependsOn,T.isDependedOn<<6|T.hasRedundancy<<4|T.isNonSync,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255],12+16*C)}return c.box(c.types.trun,v)},c.mdat=function(d){return c.box(c.types.mdat,d)},c})();u.init(),o.default=u}),"./src/remux/mp4-remuxer.js":(function(a,o,l){l.r(o);var u=l("./src/utils/logger.js"),c=l("./src/remux/mp4-generator.js"),d=l("./src/remux/aac-silent.js"),h=l("./src/utils/browser.js"),p=l("./src/core/media-segment-info.js"),g=l("./src/utils/exception.js"),x=(function(){function v(C){this.TAG="MP4Remuxer",this._config=C,this._isLive=C.isLive===!0,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 p.MediaSegmentInfoList("audio"),this._videoSegmentInfoList=new p.MediaSegmentInfoList("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(h.default.chrome&&(h.default.version.major<50||h.default.version.major===50&&h.default.version.build<2661)),this._fillSilentAfterSeek=h.default.msedge||h.default.msie,this._mp3UseMpegAudio=!h.default.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return v.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},v.prototype.bindDataSource=function(C){return C.onDataAvailable=this.remux.bind(this),C.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(v.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(C){this._onInitSegment=C},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(C){this._onMediaSegment=C},enumerable:!1,configurable:!0}),v.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},v.prototype.seek=function(C){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},v.prototype.remux=function(C,I){if(!this._onMediaSegment)throw new g.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(C,I),this._remuxVideo(I),this._remuxAudio(C)},v.prototype._onTrackMetadataReceived=function(C,I){var S=null,T="mp4",E=I.codec;if(C==="audio")this._audioMeta=I,I.codec==="mp3"&&this._mp3UseMpegAudio?(T="mpeg",E="",S=new Uint8Array):S=c.default.generateInitSegment(I);else if(C==="video")this._videoMeta=I,S=c.default.generateInitSegment(I);else return;if(!this._onInitSegment)throw new g.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(C,{type:C,data:S.buffer,codec:E,container:C+"/"+T,mediaDuration:I.duration})},v.prototype._calculateDtsBase=function(C,I){this._dtsBaseInited||(C.samples&&C.samples.length&&(this._audioDtsBase=C.samples[0].dts),I.samples&&I.samples.length&&(this._videoDtsBase=I.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},v.prototype.flushStashedSamples=function(){var C=this._videoStashedLastSample,I=this._audioStashedLastSample,S={type:"video",id:1,sequenceNumber:0,samples:[],length:0};C!=null&&(S.samples.push(C),S.length=C.length);var T={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};I!=null&&(T.samples.push(I),T.length=I.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(S,!0),this._remuxAudio(T,!0)},v.prototype._remuxAudio=function(C,I){if(this._audioMeta!=null){var S=C,T=S.samples,E=void 0,B=-1,P=-1,M=this._audioMeta.refSampleDuration,L=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,k=this._dtsBaseInited&&this._audioNextDts===void 0,V=!1;if(!(!T||T.length===0)&&!(T.length===1&&!I)){var U=0,z=null,Z=0;L?(U=0,Z=S.length):(U=8,Z=8+S.length);var j=null;if(T.length>1&&(j=T.pop(),Z-=j.length),this._audioStashedLastSample!=null){var K=this._audioStashedLastSample;this._audioStashedLastSample=null,T.unshift(K),Z+=K.length}j!=null&&(this._audioStashedLastSample=j);var J=T[0].dts-this._dtsBase;if(this._audioNextDts)E=J-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())E=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(V=!0);else{var q=this._audioSegmentInfoList.getLastSampleBefore(J);if(q!=null){var ie=J-(q.originalDts+q.duration);ie<=3&&(ie=0);var oe=q.dts+q.duration+ie;E=J-oe}else E=0}if(V){var ue=J-E,de=this._videoSegmentInfoList.getLastSegmentBefore(J);if(de!=null&&de.beginDts<ue){var he=d.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(he){var ge=de.beginDts,ce=ue-de.beginDts;u.default.v(this.TAG,"InsertPrefixSilentAudio: dts: "+ge+", duration: "+ce),T.unshift({unit:he,dts:ge,pts:ge}),Z+=he.byteLength}}else V=!1}for(var me=[],te=0;te<T.length;te++){var K=T[te],fe=K.unit,Ee=K.dts-this._dtsBase,ge=Ee,Pe=!1,Ne=null,Ae=0;if(!(Ee<-.001)){if(this._audioMeta.codec!=="mp3"){var Me=Ee,We=3;if(this._audioNextDts&&(Me=this._audioNextDts),E=Ee-Me,E<=-We*M){u.default.w(this.TAG,"Dropping 1 audio frame (originalDts: "+Ee+" ms ,curRefDts: "+Me+" ms) due to dtsCorrection: "+E+" ms overlap.");continue}else if(E>=We*M&&this._fillAudioTimestampGap&&!h.default.safari){Pe=!0;var Se=Math.floor(E/M);u.default.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
53
- `+("originalDts: "+Ee+" ms, curRefDts: "+Me+" ms, ")+("dtsCorrection: "+Math.round(E)+" ms, generate: "+Se+" frames")),ge=Math.floor(Me),Ae=Math.floor(Me+M)-ge;var he=d.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);he==null&&(u.default.w(this.TAG,"Unable to generate silent frame for "+(this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame")),he=fe),Ne=[];for(var Ye=0;Ye<Se;Ye++){Me=Me+M;var ut=Math.floor(Me),At=Math.floor(Me+M)-ut,gt={dts:ut,pts:ut,cts:0,unit:he,size:he.byteLength,duration:At,originalDts:Ee,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Ne.push(gt),Z+=gt.size}this._audioNextDts=Me+M}else ge=Math.floor(Me),Ae=Math.floor(Me+M)-ge,this._audioNextDts=Me+M}else{if(ge=Ee-E,te!==T.length-1){var Gt=T[te+1].dts-this._dtsBase-E;Ae=Gt-ge}else if(j!=null){var Gt=j.dts-this._dtsBase-E;Ae=Gt-ge}else me.length>=1?Ae=me[me.length-1].duration:Ae=Math.floor(M);this._audioNextDts=ge+Ae}B===-1&&(B=ge),me.push({dts:ge,pts:ge,cts:0,unit:K.unit,size:K.unit.byteLength,duration:Ae,originalDts:Ee,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Pe&&me.push.apply(me,Ne)}}if(me.length===0){S.samples=[],S.length=0;return}L?z=new Uint8Array(Z):(z=new Uint8Array(Z),z[0]=Z>>>24&255,z[1]=Z>>>16&255,z[2]=Z>>>8&255,z[3]=Z&255,z.set(c.default.types.mdat,4));for(var te=0;te<me.length;te++){var fe=me[te].unit;z.set(fe,U),U+=fe.byteLength}var Ct=me[me.length-1];P=Ct.dts+Ct.duration;var jt=new p.MediaSegmentInfo;jt.beginDts=B,jt.endDts=P,jt.beginPts=B,jt.endPts=P,jt.originalBeginDts=me[0].originalDts,jt.originalEndDts=Ct.originalDts+Ct.duration,jt.firstSample=new p.SampleInfo(me[0].dts,me[0].pts,me[0].duration,me[0].originalDts,!1),jt.lastSample=new p.SampleInfo(Ct.dts,Ct.pts,Ct.duration,Ct.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(jt),S.samples=me,S.sequenceNumber++;var Qe=null;L?Qe=new Uint8Array:Qe=c.default.moof(S,B),S.samples=[],S.length=0;var Ge={type:"audio",data:this._mergeBoxes(Qe,z).buffer,sampleCount:me.length,info:jt};L&&k&&(Ge.timestampOffset=B),this._onMediaSegment("audio",Ge)}}},v.prototype._remuxVideo=function(C,I){if(this._videoMeta!=null){var S=C,T=S.samples,E=void 0,B=-1,P=-1,M=-1,L=-1;if(!(!T||T.length===0)&&!(T.length===1&&!I)){var k=8,V=null,U=8+C.length,z=null;if(T.length>1&&(z=T.pop(),U-=z.length),this._videoStashedLastSample!=null){var Z=this._videoStashedLastSample;this._videoStashedLastSample=null,T.unshift(Z),U+=Z.length}z!=null&&(this._videoStashedLastSample=z);var j=T[0].dts-this._dtsBase;if(this._videoNextDts)E=j-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())E=0;else{var K=this._videoSegmentInfoList.getLastSampleBefore(j);if(K!=null){var J=j-(K.originalDts+K.duration);J<=3&&(J=0);var q=K.dts+K.duration+J;E=j-q}else E=0}for(var ie=new p.MediaSegmentInfo,oe=[],ue=0;ue<T.length;ue++){var Z=T[ue],de=Z.dts-this._dtsBase,he=Z.isKeyframe,ge=de-E,ce=Z.cts,me=ge+ce;B===-1&&(B=ge,M=me);var te=0;if(ue!==T.length-1){var fe=T[ue+1].dts-this._dtsBase-E;te=fe-ge}else if(z!=null){var fe=z.dts-this._dtsBase-E;te=fe-ge}else oe.length>=1?te=oe[oe.length-1].duration:te=Math.floor(this._videoMeta.refSampleDuration);if(he){var Ee=new p.SampleInfo(ge,me,te,Z.dts,!0);Ee.fileposition=Z.fileposition,ie.appendSyncPoint(Ee)}oe.push({dts:ge,pts:me,cts:ce,units:Z.units,size:Z.length,isKeyframe:he,duration:te,originalDts:de,flags:{isLeading:0,dependsOn:he?2:1,isDependedOn:he?1:0,hasRedundancy:0,isNonSync:he?0:1}})}V=new Uint8Array(U),V[0]=U>>>24&255,V[1]=U>>>16&255,V[2]=U>>>8&255,V[3]=U&255,V.set(c.default.types.mdat,4);for(var ue=0;ue<oe.length;ue++)for(var Pe=oe[ue].units;Pe.length;){var Ne=Pe.shift(),Ae=Ne.data;V.set(Ae,k),k+=Ae.byteLength}var Me=oe[oe.length-1];if(P=Me.dts+Me.duration,L=Me.pts+Me.duration,this._videoNextDts=P,ie.beginDts=B,ie.endDts=P,ie.beginPts=M,ie.endPts=L,ie.originalBeginDts=oe[0].originalDts,ie.originalEndDts=Me.originalDts+Me.duration,ie.firstSample=new p.SampleInfo(oe[0].dts,oe[0].pts,oe[0].duration,oe[0].originalDts,oe[0].isKeyframe),ie.lastSample=new p.SampleInfo(Me.dts,Me.pts,Me.duration,Me.originalDts,Me.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ie),S.samples=oe,S.sequenceNumber++,this._forceFirstIDR){var We=oe[0].flags;We.dependsOn=2,We.isNonSync=0}var Se=c.default.moof(S,B);S.samples=[],S.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Se,V).buffer,sampleCount:oe.length,info:ie})}}},v.prototype._mergeBoxes=function(C,I){var S=new Uint8Array(C.byteLength+I.byteLength);return S.set(C,0),S.set(I,C.byteLength),S},v})();o.default=x}),"./src/utils/browser.js":(function(a,o,l){l.r(o);var u={};function c(){var d=self.navigator.userAgent.toLowerCase(),h=/(edge)\/([\w.]+)/.exec(d)||/(opr)[\/]([\w.]+)/.exec(d)||/(chrome)[ \/]([\w.]+)/.exec(d)||/(iemobile)[\/]([\w.]+)/.exec(d)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+)/.exec(d)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(d)||/(msie) ([\w.]+)/.exec(d)||d.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(d)||d.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(d)||[],p=/(ipad)/.exec(d)||/(ipod)/.exec(d)||/(windows phone)/.exec(d)||/(iphone)/.exec(d)||/(kindle)/.exec(d)||/(android)/.exec(d)||/(windows)/.exec(d)||/(mac)/.exec(d)||/(linux)/.exec(d)||/(cros)/.exec(d)||[],g={browser:h[5]||h[3]||h[1]||"",version:h[2]||h[4]||"0",majorVersion:h[4]||h[2]||"0",platform:p[0]||""},x={};if(g.browser){x[g.browser]=!0;var v=g.majorVersion.split(".");x.version={major:parseInt(g.majorVersion,10),string:g.version},v.length>1&&(x.version.minor=parseInt(v[1],10)),v.length>2&&(x.version.build=parseInt(v[2],10))}if(g.platform&&(x[g.platform]=!0),(x.chrome||x.opr||x.safari)&&(x.webkit=!0),x.rv||x.iemobile){x.rv&&delete x.rv;var C="msie";g.browser=C,x[C]=!0}if(x.edge){delete x.edge;var I="msedge";g.browser=I,x[I]=!0}if(x.opr){var S="opera";g.browser=S,x[S]=!0}if(x.safari&&x.android){var T="android";g.browser=T,x[T]=!0}x.name=g.browser,x.platform=g.platform;for(var E in u)u.hasOwnProperty(E)&&delete u[E];Object.assign(u,x)}c(),o.default=u}),"./src/utils/exception.js":(function(a,o,l){l.r(o),l.d(o,{RuntimeException:function(){return c},IllegalStateException:function(){return d},InvalidArgumentException:function(){return h},NotImplementedException:function(){return p}});var u=(function(){var g=function(x,v){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,I){C.__proto__=I}||function(C,I){for(var S in I)Object.prototype.hasOwnProperty.call(I,S)&&(C[S]=I[S])},g(x,v)};return function(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");g(x,v);function C(){this.constructor=x}x.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}})(),c=(function(){function g(x){this._message=x}return Object.defineProperty(g.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),g.prototype.toString=function(){return this.name+": "+this.message},g})(),d=(function(g){u(x,g);function x(v){return g.call(this,v)||this}return Object.defineProperty(x.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),x})(c),h=(function(g){u(x,g);function x(v){return g.call(this,v)||this}return Object.defineProperty(x.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),x})(c),p=(function(g){u(x,g);function x(v){return g.call(this,v)||this}return Object.defineProperty(x.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),x})(c)}),"./src/utils/logger.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=(function(){function h(){}return h.e=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","error",x),h.ENABLE_ERROR},h.i=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","info",x),h.ENABLE_INFO},h.w=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","warn",x),h.ENABLE_WARN},h.d=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","debug",x),h.ENABLE_DEBUG},h.v=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","verbose",x),h.ENABLE_VERBOSE},h})();d.GLOBAL_TAG="flv.js",d.FORCE_GLOBAL_TAG=!1,d.ENABLE_ERROR=!0,d.ENABLE_INFO=!0,d.ENABLE_WARN=!0,d.ENABLE_DEBUG=!0,d.ENABLE_VERBOSE=!0,d.ENABLE_CALLBACK=!1,d.emitter=new(c()),o.default=d}),"./src/utils/logging-control.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./src/utils/logger.js"),h=(function(){function p(){}return Object.defineProperty(p,"forceGlobalTag",{get:function(){return d.default.FORCE_GLOBAL_TAG},set:function(g){d.default.FORCE_GLOBAL_TAG=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"globalTag",{get:function(){return d.default.GLOBAL_TAG},set:function(g){d.default.GLOBAL_TAG=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableAll",{get:function(){return d.default.ENABLE_VERBOSE&&d.default.ENABLE_DEBUG&&d.default.ENABLE_INFO&&d.default.ENABLE_WARN&&d.default.ENABLE_ERROR},set:function(g){d.default.ENABLE_VERBOSE=g,d.default.ENABLE_DEBUG=g,d.default.ENABLE_INFO=g,d.default.ENABLE_WARN=g,d.default.ENABLE_ERROR=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableDebug",{get:function(){return d.default.ENABLE_DEBUG},set:function(g){d.default.ENABLE_DEBUG=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableVerbose",{get:function(){return d.default.ENABLE_VERBOSE},set:function(g){d.default.ENABLE_VERBOSE=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableInfo",{get:function(){return d.default.ENABLE_INFO},set:function(g){d.default.ENABLE_INFO=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableWarn",{get:function(){return d.default.ENABLE_WARN},set:function(g){d.default.ENABLE_WARN=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableError",{get:function(){return d.default.ENABLE_ERROR},set:function(g){d.default.ENABLE_ERROR=g,p._notifyChange()},enumerable:!1,configurable:!0}),p.getConfig=function(){return{globalTag:d.default.GLOBAL_TAG,forceGlobalTag:d.default.FORCE_GLOBAL_TAG,enableVerbose:d.default.ENABLE_VERBOSE,enableDebug:d.default.ENABLE_DEBUG,enableInfo:d.default.ENABLE_INFO,enableWarn:d.default.ENABLE_WARN,enableError:d.default.ENABLE_ERROR,enableCallback:d.default.ENABLE_CALLBACK}},p.applyConfig=function(g){d.default.GLOBAL_TAG=g.globalTag,d.default.FORCE_GLOBAL_TAG=g.forceGlobalTag,d.default.ENABLE_VERBOSE=g.enableVerbose,d.default.ENABLE_DEBUG=g.enableDebug,d.default.ENABLE_INFO=g.enableInfo,d.default.ENABLE_WARN=g.enableWarn,d.default.ENABLE_ERROR=g.enableError,d.default.ENABLE_CALLBACK=g.enableCallback},p._notifyChange=function(){var g=p.emitter;if(g.listenerCount("change")>0){var x=p.getConfig();g.emit("change",x)}},p.registerListener=function(g){p.emitter.addListener("change",g)},p.removeListener=function(g){p.emitter.removeListener("change",g)},p.addLogListener=function(g){d.default.emitter.addListener("log",g),d.default.emitter.listenerCount("log")>0&&(d.default.ENABLE_CALLBACK=!0,p._notifyChange())},p.removeLogListener=function(g){d.default.emitter.removeListener("log",g),d.default.emitter.listenerCount("log")===0&&(d.default.ENABLE_CALLBACK=!1,p._notifyChange())},p})();h.emitter=new(c()),o.default=h}),"./src/utils/polyfill.js":(function(a,o,l){l.r(o);var u=(function(){function c(){}return c.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(d,h){return d.__proto__=h,d},Object.assign=Object.assign||function(d){if(d==null)throw new TypeError("Cannot convert undefined or null to object");for(var h=Object(d),p=1;p<arguments.length;p++){var g=arguments[p];if(g!=null)for(var x in g)g.hasOwnProperty(x)&&(h[x]=g[x])}return h},typeof self.Promise!="function"&&l("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},c})();u.install(),o.default=u}),"./src/utils/utf8-conv.js":(function(a,o,l){l.r(o);function u(d,h,p){var g=d;if(h+p<g.length){for(;p--;)if((g[++h]&192)!==128)return!1;return!0}else return!1}function c(d){for(var h=[],p=d,g=0,x=d.length;g<x;){if(p[g]<128){h.push(String.fromCharCode(p[g])),++g;continue}else if(!(p[g]<192)){if(p[g]<224){if(u(p,g,1)){var v=(p[g]&31)<<6|p[g+1]&63;if(v>=128){h.push(String.fromCharCode(v&65535)),g+=2;continue}}}else if(p[g]<240){if(u(p,g,2)){var v=(p[g]&15)<<12|(p[g+1]&63)<<6|p[g+2]&63;if(v>=2048&&(v&63488)!==55296){h.push(String.fromCharCode(v&65535)),g+=3;continue}}}else if(p[g]<248&&u(p,g,3)){var v=(p[g]&7)<<18|(p[g+1]&63)<<12|(p[g+2]&63)<<6|p[g+3]&63;if(v>65536&&v<1114112){v-=65536,h.push(String.fromCharCode(v>>>10|55296)),h.push(String.fromCharCode(v&1023|56320)),g+=4;continue}}}h.push("�"),++g}return h.join("")}o.default=c})},r={};function n(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,n),l.exports}n.m=t,(function(){n.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(o,{a:o}),o}})(),(function(){n.d=function(a,o){for(var l in o)n.o(o,l)&&!n.o(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:o[l]})}})(),(function(){n.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){n.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)}})(),(function(){n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})}})();var s=n("./src/index.js");return s})()})})(n8e)),n8e.exports}var Xxi=zxi();const jEt=f6(Xxi),KEt="2.0.0",Yxi=i=>{const e=Ut.cloneDeep(i);return e.version!==KEt?{config:{controls:e.controls,loop:e.loop,muted:e.muted,poster:e.poster,autoplay:e.autoplay},version:KEt}:i},jxi=(i,e)=>{xi(()=>Ut.cloneDeep(i.option),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0}),xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},Kxi=["poster","autoplay","controls","loop","muted"],Qxi=qt({...qt({name:"ShjFlv"}),props:{option:{},sources:{},useEvents:{}},emits:["on-video-progress","on-video-play","on-video-pause","on-video-ended","on-video-playing","on-video-timeupdate","on-video-error","on-video-volumechange"],setup(i,{expose:e,emit:t}){const r=Qr(()=>Yxi(i.option)),n=Ht(),s=Ht("");let a=null;const o=()=>{a&&(a.pause(),a.unload(),a.detachMediaElement(),a.destroy(),a=null),Po.parse({sources:i.sources,callback:({data:C})=>{try{if(gi.parseEvents(i.useEvents,"dataListener",C),s.value=C[0].data[0].src,!s.value)return;if(jEt.isSupported())try{a=jEt.createPlayer({type:"flv",url:s.value,isLive:!1,hasAudio:!0,hasVideo:!0,cors:!0,withCredentials:!1}),a.attachMediaElement(n.value),a.load(),r.value.config.autoplay&&a.play()}catch{}}catch{gi.parseEvents(i.useEvents,"dataListener",null)}}})};I0(()=>{a&&(a.pause(),a.unload(),a.detachMediaElement(),a.destroy(),a=null)});const l=t,u=()=>{l("on-video-progress"),gi.parseEvents(i.useEvents,"on-video-progress")},c=()=>{l("on-video-play"),gi.parseEvents(i.useEvents,"on-video-play")},d=()=>{l("on-video-pause"),gi.parseEvents(i.useEvents,"on-video-pause")},h=()=>{l("on-video-ended"),gi.parseEvents(i.useEvents,"on-video-ended")},p=()=>{l("on-video-playing"),gi.parseEvents(i.useEvents,"on-video-playing")},g=()=>{l("on-video-timeupdate"),gi.parseEvents(i.useEvents,"on-video-timeupdate")},x=()=>{l("on-video-error"),gi.parseEvents(i.useEvents,"on-video-error")},v=()=>{l("on-video-volumechange"),gi.parseEvents(i.useEvents,"on-video-volumechange")};return pa(()=>{so(()=>{o()})}),jxi({option:r.value,sources:i.sources},o),e({play:()=>{n.value&&n.value.play()},pause:()=>{n.value&&n.value.pause()},refresh:()=>o(),refreshView:()=>o(),refreshData:()=>o()}),(C,I)=>(kt(),Or("video",{ref_key:"videoRef",ref:n,class:"zerov-widget",poster:r.value.config.poster,autoplay:r.value.config.autoplay,controls:r.value.config.controls,loop:r.value.config.loop,muted:r.value.config.muted,onProgress:u,onPlay:c,onEnded:h,onPlaying:p,onPause:d,onTimeupdate:g,onError:x,onVolumechange:v},null,40,Kxi))}}),QEt=Xi(Qxi),Jxi=i=>i,qxi=(i,e)=>{xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},$xi=["src"],evi=qt({...qt({name:"ShjIframe"}),props:{option:{},sources:{},useEvents:{}},emits:["on-iframe-event-listener"],setup(i,{expose:e,emit:t}){const r=Ht(),n=Qr(()=>Jxi(i.option)),s=Ht(""),a=()=>{Po.parse({sources:i.sources,callback:({data:u})=>{try{gi.parseEvents(i.useEvents,"dataListener",u),s.value=u[0].data[0].url}catch{gi.parseEvents(i.useEvents,"dataListener",null),s.value=""}}})},o=t,l=u=>{u.source===r.value?.contentWindow&&(o("on-iframe-event-listener",u.data),i.useEvents&&Ut.isArray(i.useEvents)&&gi.parseEvents(i.useEvents,"on-iframe-event-listener",u.data))};return pa(()=>{so(()=>{a()}),window.addEventListener("message",l,!1)}),I0(()=>{window.removeEventListener("message",l,!1)}),qxi({option:n.value,sources:i.sources},a),e({refresh:()=>a(),refreshView:()=>a(),refreshData:()=>a(),sendChildrenMessages:(u,c)=>{if(r.value?.contentWindow)try{c[0].dataType==="params"?r.value.contentWindow.postMessage(u,s.value):r.value.contentWindow.postMessage(c[0].data,s.value)}catch{}}}),(u,c)=>s.value?(kt(),Or("iframe",{key:0,ref_key:"iframeRef",ref:r,src:s.value,class:"iframe",sandbox:"allow-scripts allow-same-origin allow-forms"},null,8,$xi)):Vi("",!0)}}),JEt=Xi(ku(evi,[["__scopeId","data-v-71d48c51"]])),qEt="2.0.0",tvi=i=>{const e=Ut.cloneDeep(i);return e.version!==qEt?{carousel:{iframes:e.iframes,pagination:e.pagination,freeMode:e.freeMode,reverseDirection:e.reverseDirection,slidesPerView:e.slidesPerView,speed:e.speed,spaceBetween:e.spaceBetween,autoplay:e.autoplay,pauseOnMouseEnter:e.pauseOnMouseEnter,delay:e.delay,paginationType:e.paginationType,rewind:e.rewind,loop:e.loop,grabCursor:e.grabCursor,effect:e.effect,stopOnLastSlide:e.stopOnLastSlide,roundLengths:e.roundLengths,direction:e.direction},version:qEt}:i},rvi=(i,e)=>{xi(()=>Ut.cloneDeep(i.option),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0}),xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})};var s8e={exports:{}},$Et;function ivi(){if($Et)return s8e.exports;$Et=1;var i=s8e.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=n}catch{t=n}})();function s(x){if(e===setTimeout)return setTimeout(x,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(x,0);try{return e(x,0)}catch{try{return e.call(null,x,0)}catch{return e.call(this,x,0)}}}function a(x){if(t===clearTimeout)return clearTimeout(x);if((t===n||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(x);try{return t(x)}catch{try{return t.call(null,x)}catch{return t.call(this,x)}}}var o=[],l=!1,u,c=-1;function d(){!l||!u||(l=!1,u.length?o=u.concat(o):c=-1,o.length&&h())}function h(){if(!l){var x=s(d);l=!0;for(var v=o.length;v;){for(u=o,o=[];++c<v;)u&&u[c].run();c=-1,v=o.length}u=null,l=!1,a(x)}}i.nextTick=function(x){var v=new Array(arguments.length-1);if(arguments.length>1)for(var C=1;C<arguments.length;C++)v[C-1]=arguments[C];o.push(new p(x,v)),o.length===1&&!l&&s(h)};function p(x,v){this.fun=x,this.array=v}p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function g(){}return i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(x){return[]},i.binding=function(x){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(x){throw new Error("process.chdir is not supported")},i.umask=function(){return 0},s8e.exports}var Kle=ivi();const nvi=["src"],svi=qt({...qt({name:"ShjIframeCarousel"}),props:{option:{}},setup(i,{expose:e}){ZEt();const t=Qr(()=>tvi(i.option)),r=Ht(Ul()),n=()=>{r.value=Ul()};return pa(()=>{Kle.nextTick(()=>{n()})}),rvi({option:t.value,sources:[]},n),e({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(s,a)=>{const o=a6("swiper-slide"),l=a6("swiper-container");return kt(),Bi(l,{key:r.value,class:"carousel",direction:t.value.carousel.direction,speed:t.value.carousel.speed,"round-lengths":t.value.carousel.roundLengths,"grab-cursor":t.value.carousel.grabCursor,rewind:t.value.carousel.rewind,loop:t.value.carousel.loop,"slides-per-view":t.value.carousel.slidesPerView,"space-between":t.value.carousel.spaceBetween,autoplay:t.value.carousel.autoplay,delay:t.value.carousel.delay,"stop-on-last-slide":t.value.carousel.stopOnLastSlide,"reverse-direction":t.value.carousel.reverseDirection,"pause-on-mouse-enter":t.value.carousel.pauseOnMouseEnter,"free-mode":t.value.carousel.freeMode,effect:t.value.carousel.effect,pagination:t.value.carousel.pagination,"pagination-type":t.value.carousel.paginationType},{default:ho(()=>[(kt(!0),Or(Qs,null,Wl(t.value.carousel.iframes,(u,c)=>(kt(),Bi(o,{key:u},{default:ho(()=>[Hi("iframe",{src:u.url,class:"iframe-slide",sandbox:"allow-scripts allow-same-origin"},null,8,nvi)]),_:2},1024))),128))]),_:1},8,["direction","speed","round-lengths","grab-cursor","rewind","loop","slides-per-view","space-between","autoplay","delay","stop-on-last-slide","reverse-direction","pause-on-mouse-enter","free-mode","effect","pagination","pagination-type"])}}}),e4t=Xi(ku(svi,[["__scopeId","data-v-e31f4b25"]])),t4t="2.0.0",avi=i=>{const e=Ut.cloneDeep(i);return e.version!==t4t?{base:{url:e.url,mode:e.mode},version:t4t}:i},ovi=qt({...qt({name:"ShjImage"}),props:{option:{}},setup(i,{expose:e}){const t=Qr(()=>avi(i.option));return e({refresh:()=>{},refreshView:()=>{},refreshData:()=>{}}),(r,n)=>(kt(),Or("div",{class:"image",style:ia({"--image-url":`url('${t.value.base.url}')`,"--image-repeat":t.value.base.mode==="repeat"?"repeat":"no-repeat","--image-size":t.value.base.mode==="repeat"?"auto":t.value.base.mode})},null,4))}}),r4t=Xi(ku(ovi,[["__scopeId","data-v-933d785d"]])),i4t="2.0.0",lvi=i=>{const e=Ut.cloneDeep(i);return e.version!==i4t?{base:{mode:e.mode},version:i4t}:i},uvi=(i,e)=>{xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},cvi=qt({...qt({name:"ShjImageDynamic"}),props:{option:{},sources:{},useEvents:{}},setup(i,{expose:e}){const t=Qr(()=>lvi(i.option)),r=Ht(""),n=()=>{Po.parse({sources:i.sources,callback:({data:s})=>{try{gi.parseEvents(i.useEvents,"dataListener",s),r.value=s[0].data[0].src}catch{gi.parseEvents(i.useEvents,"dataListener",null),r.value=""}}})};return pa(()=>{so(()=>{n()})}),uvi({option:t.value,sources:i.sources},n),e({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(s,a)=>(kt(),Or("div",{class:"image",style:ia({"--image-url":`url('${r.value}')`,"--image-repeat":t.value.base.mode==="repeat"?"repeat":"no-repeat","--image-size":t.value.base.mode==="repeat"?"auto":t.value.base.mode})},null,4))}}),n4t=Xi(ku(cvi,[["__scopeId","data-v-fc610a9d"]])),ga=Number.isFinite||function(i){return typeof i=="number"&&isFinite(i)},dvi=Number.isSafeInteger||function(i){return typeof i=="number"&&Math.abs(i)<=hvi},hvi=Number.MAX_SAFE_INTEGER||9007199254740991;let Qa=(function(i){return i.NETWORK_ERROR="networkError",i.MEDIA_ERROR="mediaError",i.KEY_SYSTEM_ERROR="keySystemError",i.MUX_ERROR="muxError",i.OTHER_ERROR="otherError",i})({}),Ui=(function(i){return i.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",i.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",i.KEY_SYSTEM_NO_SESSION="keySystemNoSession",i.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",i.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",i.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",i.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",i.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",i.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",i.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",i.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",i.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",i.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",i.MANIFEST_LOAD_ERROR="manifestLoadError",i.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",i.MANIFEST_PARSING_ERROR="manifestParsingError",i.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",i.LEVEL_EMPTY_ERROR="levelEmptyError",i.LEVEL_LOAD_ERROR="levelLoadError",i.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",i.LEVEL_PARSING_ERROR="levelParsingError",i.LEVEL_SWITCH_ERROR="levelSwitchError",i.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",i.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",i.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",i.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",i.FRAG_LOAD_ERROR="fragLoadError",i.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",i.FRAG_DECRYPT_ERROR="fragDecryptError",i.FRAG_PARSING_ERROR="fragParsingError",i.FRAG_GAP="fragGap",i.REMUX_ALLOC_ERROR="remuxAllocError",i.KEY_LOAD_ERROR="keyLoadError",i.KEY_LOAD_TIMEOUT="keyLoadTimeOut",i.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",i.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",i.BUFFER_APPEND_ERROR="bufferAppendError",i.BUFFER_APPENDING_ERROR="bufferAppendingError",i.BUFFER_STALLED_ERROR="bufferStalledError",i.BUFFER_FULL_ERROR="bufferFullError",i.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",i.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",i.ASSET_LIST_LOAD_ERROR="assetListLoadError",i.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",i.ASSET_LIST_PARSING_ERROR="assetListParsingError",i.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",i.INTERNAL_EXCEPTION="internalException",i.INTERNAL_ABORTED="aborted",i.ATTACH_MEDIA_ERROR="attachMediaError",i.UNKNOWN="unknown",i})({}),St=(function(i){return i.MEDIA_ATTACHING="hlsMediaAttaching",i.MEDIA_ATTACHED="hlsMediaAttached",i.MEDIA_DETACHING="hlsMediaDetaching",i.MEDIA_DETACHED="hlsMediaDetached",i.MEDIA_ENDED="hlsMediaEnded",i.STALL_RESOLVED="hlsStallResolved",i.BUFFER_RESET="hlsBufferReset",i.BUFFER_CODECS="hlsBufferCodecs",i.BUFFER_CREATED="hlsBufferCreated",i.BUFFER_APPENDING="hlsBufferAppending",i.BUFFER_APPENDED="hlsBufferAppended",i.BUFFER_EOS="hlsBufferEos",i.BUFFERED_TO_END="hlsBufferedToEnd",i.BUFFER_FLUSHING="hlsBufferFlushing",i.BUFFER_FLUSHED="hlsBufferFlushed",i.MANIFEST_LOADING="hlsManifestLoading",i.MANIFEST_LOADED="hlsManifestLoaded",i.MANIFEST_PARSED="hlsManifestParsed",i.LEVEL_SWITCHING="hlsLevelSwitching",i.LEVEL_SWITCHED="hlsLevelSwitched",i.LEVEL_LOADING="hlsLevelLoading",i.LEVEL_LOADED="hlsLevelLoaded",i.LEVEL_UPDATED="hlsLevelUpdated",i.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",i.LEVELS_UPDATED="hlsLevelsUpdated",i.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",i.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",i.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",i.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",i.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",i.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",i.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",i.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",i.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",i.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",i.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",i.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",i.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",i.CUES_PARSED="hlsCuesParsed",i.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",i.INIT_PTS_FOUND="hlsInitPtsFound",i.FRAG_LOADING="hlsFragLoading",i.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",i.FRAG_LOADED="hlsFragLoaded",i.FRAG_DECRYPTED="hlsFragDecrypted",i.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",i.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",i.FRAG_PARSING_METADATA="hlsFragParsingMetadata",i.FRAG_PARSED="hlsFragParsed",i.FRAG_BUFFERED="hlsFragBuffered",i.FRAG_CHANGED="hlsFragChanged",i.FPS_DROP="hlsFpsDrop",i.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",i.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",i.ERROR="hlsError",i.DESTROYING="hlsDestroying",i.KEY_LOADING="hlsKeyLoading",i.KEY_LOADED="hlsKeyLoaded",i.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",i.BACK_BUFFER_REACHED="hlsBackBufferReached",i.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",i.ASSET_LIST_LOADING="hlsAssetListLoading",i.ASSET_LIST_LOADED="hlsAssetListLoaded",i.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",i.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",i.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",i.INTERSTITIAL_STARTED="hlsInterstitialStarted",i.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",i.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",i.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",i.INTERSTITIAL_ENDED="hlsInterstitialEnded",i.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",i.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",i.EVENT_CUE_ENTER="hlsEventCueEnter",i})({});var qu={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Ga={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class fG{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class fvi{constructor(e,t,r,n=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new fG(e),this.fast_=new fG(t),this.defaultTTFB_=n,this.ttfb_=new fG(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:s}=this;r.halfLife!==e&&(this.slow_=new fG(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new fG(t,n.getEstimate(),n.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new fG(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,n=e/1e3,s=r/n;this.fast_.sample(n,s),this.slow_.sample(n,s)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function pvi(i,e,t){return(e=mvi(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ph(){return ph=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},ph.apply(null,arguments)}function s4t(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Kd(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?s4t(Object(t),!0).forEach(function(r){pvi(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):s4t(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function gvi(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function mvi(i){var e=gvi(i,"string");return typeof e=="symbol"?e:e+""}let H8=class{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const r=`[${e}]:`;this.trace=_6,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}};const _6=function(){},xvi={trace:_6,debug:_6,log:_6,warn:_6,info:_6,error:_6};function a8e(){return ph({},xvi)}function vvi(i,e){const t=self.console[i];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${i}] >`):_6}function a4t(i,e,t){return e[i]?e[i].bind(e):vvi(i,t)}const o8e=a8e();function yvi(i,e,t){const r=a8e();if(typeof console=="object"&&i===!0||typeof i=="object"){const n=["debug","log","info","warn","error"];n.forEach(s=>{r[s]=a4t(s,i,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.5`)}catch{return a8e()}n.forEach(s=>{o8e[s]=a4t(s,i)})}else ph(o8e,r);return r}const Cd=o8e;function D6(i=!0){return typeof self>"u"?void 0:(i||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Cvi(i){return typeof self<"u"&&i===self.ManagedMediaSource}function o4t(i,e){const t=Object.keys(i),r=Object.keys(e),n=t.length,s=r.length;return!n||!s||n===s&&!t.some(a=>r.indexOf(a)===-1)}function vC(i,e=!1){if(typeof TextDecoder<"u"){const u=new TextDecoder("utf-8").decode(i);if(e){const c=u.indexOf("\0");return c!==-1?u.substring(0,c):u}return u.replace(/\0/g,"")}const t=i.length;let r,n,s,a="",o=0;for(;o<t;){if(r=i[o++],r===0&&e)return a;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(r);break;case 12:case 13:n=i[o++],a+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=i[o++],s=i[o++],a+=String.fromCharCode((r&15)<<12|(n&63)<<6|(s&63)<<0);break}}return a}const WS={hexDump:function(i){let e="";for(let t=0;t<i.length;t++){let r=i[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}};function Avi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var l8e={exports:{}},l4t;function bvi(){return l4t||(l4t=1,(function(i,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,c){if(c=c||{},l=l.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return l;var d=o.parseURL(l);if(!d)throw new Error("Error trying to parse base URL.");return d.path=o.normalizePath(d.path),o.buildURLFromParts(d)}var h=o.parseURL(u);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=o.normalizePath(h.path),o.buildURLFromParts(h)):u;var p=o.parseURL(l);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var g=n.exec(p.path);p.netLoc=g[1],p.path=g[2]}p.netLoc&&!p.path&&(p.path="/");var x={scheme:p.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(x.netLoc=p.netLoc,h.path[0]!=="/"))if(!h.path)x.path=p.path,h.params||(x.params=p.params,h.query||(x.query=p.query));else{var v=p.path,C=v.substring(0,v.lastIndexOf("/")+1)+h.path;x.path=o.normalizePath(C)}return x.path===null&&(x.path=c.alwaysNormalize?o.normalizePath(h.path):h.path),o.buildURLFromParts(x)},parseURL:function(l){var u=r.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(s,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};i.exports=o})()})(l8e)),l8e.exports}var u8e=bvi();class c8e{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var jh={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class u4t{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,_vi(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let n;r.length===1?n=t?.byteRangeEndOffset||0:n=parseInt(r[1]),this._byteRange=[n,parseInt(r[0])+n]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[jh.AUDIO]:null,[jh.VIDEO]:null,[jh.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new c8e),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=u8e.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[jh.AUDIO]=null,e[jh.VIDEO]=null,e[jh.AUDIOVIDEO]=null}}function im(i){return i.sn!=="initSegment"}class d8e extends u4t{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(ga(e)&&ga(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const r=Object.keys(this.levelkeys);if(r.length===1)return this._decryptdata=this.levelkeys[r[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=ga(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),r=t.length;if(r>1||r===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!ga(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return im(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,r,n,s,a=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:s,partial:a};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,r),l.startDTS=Math.min(l.startDTS,n),l.endDTS=Math.max(l.endDTS,s)}}class Ivi extends u4t{constructor(e,t,r,n,s){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=n;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,s),s&&(this.fragOffset=s.fragOffset+s.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function c4t(i,e){const t=Object.getPrototypeOf(i);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||c4t(t,e)}}function _vi(i,e){const t=c4t(i,e);t&&(t.enumerable=!0,Object.defineProperty(i,e,t))}const Qle=Math.pow(2,32)-1,Dvi=[].push,d4t={video:1,audio:2,id3:3,text:4};function o1(i){return String.fromCharCode.apply(null,i)}function h4t(i,e){const t=i[e]<<8|i[e+1];return t<0?65536+t:t}function Qo(i,e){const t=p4t(i,e);return t<0?4294967296+t:t}function f4t(i,e){let t=Qo(i,e);return t*=Math.pow(2,32),t+=Qo(i,e+4),t}function p4t(i,e){return i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}function h8e(i,e,t){i[e]=t>>24,i[e+1]=t>>16&255,i[e+2]=t>>8&255,i[e+3]=t&255}function Svi(i){const e=i.byteLength;for(let t=0;t<e;){const r=Qo(i,t);if(r>8&&i[t+4]===109&&i[t+5]===111&&i[t+6]===111&&i[t+7]===102)return!0;t=r>1?t+r:e}return!1}function uu(i,e){const t=[];if(!e.length)return t;const r=i.byteLength;for(let n=0;n<r;){const s=Qo(i,n),a=o1(i.subarray(n+4,n+8)),o=s>1?n+s:r;if(a===e[0])if(e.length===1)t.push(i.subarray(n+8,o));else{const l=uu(i.subarray(n+8,o),e.slice(1));l.length&&Dvi.apply(t,l)}n=o}return t}function Evi(i){const e=[],t=i[0];let r=8;const n=Qo(i,r);r+=4;let s=0,a=0;t===0?(s=Qo(i,r),a=Qo(i,r+4),r+=8):(s=f4t(i,r),a=f4t(i,r+8),r+=16),r+=2;let o=i.length+a;const l=h4t(i,r);r+=2;for(let u=0;u<l;u++){let c=r;const d=Qo(i,c);c+=4;const h=d&2147483647;if((d&2147483648)>>>31===1)return Cd.warn("SIDX has hierarchical references (not supported)"),null;const g=Qo(i,c);c+=4,e.push({referenceSize:h,subsegmentDuration:g,info:{duration:g/n,start:o,end:o+h-1}}),o+=h,c+=4,r=c}return{earliestPresentationTime:s,timescale:n,version:t,referencesCount:l,references:e}}function g4t(i){const e=[],t=uu(i,["moov","trak"]);for(let n=0;n<t.length;n++){const s=t[n],a=uu(s,["tkhd"])[0];if(a){let o=a[0];const l=Qo(a,o===0?12:20),u=uu(s,["mdia","mdhd"])[0];if(u){o=u[0];const c=Qo(u,o===0?12:20),d=uu(s,["mdia","hdlr"])[0];if(d){const h=o1(d.subarray(8,12)),p={soun:jh.AUDIO,vide:jh.VIDEO}[h],g=uu(s,["mdia","minf","stbl","stsd"])[0],x=Tvi(g);p?(e[l]={timescale:c,type:p,stsd:x},e[p]=Kd({timescale:c,id:l},x)):e[l]={timescale:c,type:h,stsd:x}}}}}return uu(i,["moov","mvex","trex"]).forEach(n=>{const s=Qo(n,4),a=e[s];a&&(a.default={duration:Qo(n,12),flags:Qo(n,20)})}),e}function Tvi(i){const e=i.subarray(8),t=e.subarray(86),r=o1(e.subarray(4,8));let n=r,s;const a=r==="enca"||r==="encv";if(a){const u=uu(e,[r])[0].subarray(r==="enca"?28:78);uu(u,["sinf"]).forEach(d=>{const h=uu(d,["schm"])[0];if(h){const p=o1(h.subarray(4,8));if(p==="cbcs"||p==="cenc"){const g=uu(d,["frma"])[0];g&&(n=o1(g))}}})}const o=n;switch(n){case"avc1":case"avc2":case"avc3":case"avc4":{const l=uu(t,["avcC"])[0];l&&l.length>3&&(n+="."+qle(l[1])+qle(l[2])+qle(l[3]),s=Jle(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const l=uu(e,[r])[0],u=uu(l.subarray(28),["esds"])[0];if(u&&u.length>7){let c=4;if(u[c++]!==3)break;c=f8e(u,c),c+=2;const d=u[c++];if(d&128&&(c+=2),d&64&&(c+=u[c++]),u[c++]!==4)break;c=f8e(u,c);const h=u[c++];if(h===64)n+="."+qle(h);else break;if(c+=12,u[c++]!==5)break;c=f8e(u,c);const p=u[c++];let g=(p&248)>>3;g===31&&(g+=1+((p&7)<<3)+((u[c]&224)>>5)),n+="."+g}break}case"hvc1":case"hev1":{const l=uu(t,["hvcC"])[0];if(l&&l.length>12){const u=l[1],c=["","A","B","C"][u>>6],d=u&31,h=Qo(l,2),p=(u&32)>>5?"H":"L",g=l[12],x=l.subarray(6,12);n+="."+c+d,n+="."+Rvi(h).toString(16).toUpperCase(),n+="."+p+g;let v="";for(let C=x.length;C--;){const I=x[C];(I||v)&&(v="."+I.toString(16).toUpperCase()+v)}n+=v}s=Jle(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{n=Jle(n,t)||n;break}case"vp09":{const l=uu(t,["vpcC"])[0];if(l&&l.length>6){const u=l[4],c=l[5],d=l[6]>>4&15;n+="."+US(u)+"."+US(c)+"."+US(d)}break}case"av01":{const l=uu(t,["av1C"])[0];if(l&&l.length>2){const u=l[1]>>>5,c=l[1]&31,d=l[2]>>>7?"H":"M",h=(l[2]&64)>>6,p=(l[2]&32)>>5,g=u===2&&h?p?12:10:h?10:8,x=(l[2]&16)>>4,v=(l[2]&8)>>3,C=(l[2]&4)>>2,I=l[2]&3;n+="."+u+"."+US(c)+d+"."+US(g)+"."+x+"."+v+C+I+"."+US(1)+"."+US(1)+"."+US(1)+"."+0,s=Jle("dav1",t)}break}}return{codec:n,encrypted:a,supplemental:s}}function Jle(i,e){const t=uu(e,["dvvC"]),r=t.length?t[0]:uu(e,["dvcC"])[0];if(r){const n=r[2]>>1&127,s=r[2]<<5&32|r[3]>>3&31;return i+"."+US(n)+"."+US(s)}}function Rvi(i){let e=0;for(let t=0;t<32;t++)e|=(i>>t&1)<<31-t;return e>>>0}function f8e(i,e){const t=e+5;for(;i[e++]&128&&e<t;);return e}function qle(i){return("0"+i.toString(16).toUpperCase()).slice(-2)}function US(i){return(i<10?"0":"")+i}function wvi(i,e){if(!i||!e)return i;const t=e.keyId;return t&&e.isCommonEncryption&&uu(i,["moov","trak"]).forEach(n=>{const a=uu(n,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=uu(a,["enca"]);const l=o.length>0;l||(o=uu(a,["encv"])),o.forEach(u=>{const c=l?u.subarray(28):u.subarray(78);uu(c,["sinf"]).forEach(h=>{const p=m4t(h);if(p){const g=p.subarray(8,24);g.some(x=>x!==0)||(Cd.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${WS.hexDump(g)} -> ${WS.hexDump(t)}`),p.set(t,8))}})})}),i}function m4t(i){const e=uu(i,["schm"])[0];if(e){const t=o1(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return uu(i,["schi","tenc"])[0]}return null}function Fvi(i,e,t){const r={},n=uu(i,["moof","traf"]);for(let s=0;s<n.length;s++){const a=n[s],o=uu(a,["tfhd"])[0],l=Qo(o,4),u=e[l];if(!u)continue;const c=r[l]||(r[l]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type}),d=uu(a,["tfdt"])[0];if(d){const S=d[0];let T=Qo(d,4);S===1&&(T===Qle?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(T*=Qle+1,T+=Qo(d,8))),ga(T)&&(!ga(c.start)||T<c.start)&&(c.start=T)}const h=u.default,p=Qo(o,0)|h?.flags;let g=h?.duration||0;p&8&&(p&2?g=Qo(o,12):g=Qo(o,8));const x=uu(a,["trun"]);let v=c.start||0,C=0,I=g;for(let S=0;S<x.length;S++){const T=x[S],E=Qo(T,4),B=c.sampleCount;c.sampleCount+=E;const P=T[3]&1,M=T[3]&4,L=T[2]&1,k=T[2]&2,V=T[2]&4,U=T[2]&8;let z=8,Z=E;for(P&&(z+=4),M&&E&&(!(T[z+1]&1)&&c.keyFrameIndex===void 0&&(c.keyFrameIndex=B),z+=4,L?(I=Qo(T,z),z+=4):I=g,k&&(z+=4),U&&(z+=4),v+=I,C+=I,Z--);Z--;)L?(I=Qo(T,z),z+=4):I=g,k&&(z+=4),V&&(T[z+1]&1||c.keyFrameIndex===void 0&&(c.keyFrameIndex=c.sampleCount-(Z+1),c.keyFrameStart=v),z+=4),U&&(z+=4),v+=I,C+=I;!C&&g&&(C+=g*E)}c.duration+=C}if(!Object.keys(r).some(s=>r[s].duration)){let s=1/0,a=0;const o=uu(i,["sidx"]);for(let l=0;l<o.length;l++){const u=Evi(o[l]);if(u!=null&&u.references){s=Math.min(s,u.earliestPresentationTime/u.timescale);const c=u.references.reduce((d,h)=>d+h.info.duration||0,0);a=Math.max(a,c+u.earliestPresentationTime/u.timescale)}}a&&ga(a)&&Object.keys(r).forEach(l=>{r[l].duration||(r[l].duration=a*r[l].timescale-r[l].start)})}return r}function Bvi(i,e,t){uu(e,["moof","traf"]).forEach(r=>{uu(r,["tfhd"]).forEach(n=>{const s=Qo(n,4),a=i[s];if(!a)return;const o=a.timescale||9e4;uu(r,["tfdt"]).forEach(l=>{const u=l[0],c=t*o;if(c){let d=Qo(l,4);if(u===0)d-=c,d=Math.max(d,0),h8e(l,4,d);else{d*=Math.pow(2,32),d+=Qo(l,8),d-=c,d=Math.max(d,0);const h=Math.floor(d/(Qle+1)),p=Math.floor(d%(Qle+1));h8e(l,4,h),h8e(l,8,p)}}})})})}function Pvi(i){const e={valid:null,remainder:null},t=uu(i,["moof"]);if(t.length<2)return e.remainder=i,e;const r=t[t.length-1];return e.valid=i.slice(0,r.byteOffset-8),e.remainder=i.slice(r.byteOffset-8),e}function UA(i,e){const t=new Uint8Array(i.length+e.length);return t.set(i),t.set(e,i.length),t}function x4t(i,e){const t=[],r=e.samples,n=e.timescale,s=e.id;let a=!1;return uu(r,["moof"]).map(l=>{const u=l.byteOffset-8;uu(l,["traf"]).map(d=>{const h=uu(d,["tfdt"]).map(p=>{const g=p[0];let x=Qo(p,4);return g===1&&(x*=Math.pow(2,32),x+=Qo(p,8)),x/n})[0];return h!==void 0&&(i=h),uu(d,["tfhd"]).map(p=>{const g=Qo(p,4),x=Qo(p,0)&16777215,v=(x&1)!==0,C=(x&2)!==0,I=(x&8)!==0;let S=0;const T=(x&16)!==0;let E=0;const B=(x&32)!==0;let P=8;g===s&&(v&&(P+=8),C&&(P+=4),I&&(S=Qo(p,P),P+=4),T&&(E=Qo(p,P),P+=4),B&&(P+=4),e.type==="video"&&(a=$le(e.codec)),uu(d,["trun"]).map(M=>{const L=M[0],k=Qo(M,0)&16777215,V=(k&1)!==0;let U=0;const z=(k&4)!==0,Z=(k&256)!==0;let j=0;const K=(k&512)!==0;let J=0;const q=(k&1024)!==0,ie=(k&2048)!==0;let oe=0;const ue=Qo(M,4);let de=8;V&&(U=Qo(M,de),de+=4),z&&(de+=4);let he=U+u;for(let ge=0;ge<ue;ge++){if(Z?(j=Qo(M,de),de+=4):j=S,K?(J=Qo(M,de),de+=4):J=E,q&&(de+=4),ie&&(L===0?oe=Qo(M,de):oe=p4t(M,de),de+=4),e.type===jh.VIDEO){let ce=0;for(;ce<J;){const me=Qo(r,he);if(he+=4,Mvi(a,r[he])){const te=r.subarray(he,he+me);p8e(te,a?2:1,i+oe/n,t)}he+=me,ce+=me+4}}i+=j/n}}))})})}),t}function $le(i){if(!i)return!1;const e=i.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Mvi(i,e){if(i){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function p8e(i,e,t,r){const n=v4t(i);let s=0;s+=e;let a=0,o=0,l=0;for(;s<n.length;){a=0;do{if(s>=n.length)break;l=n[s++],a+=l}while(l===255);o=0;do{if(s>=n.length)break;l=n[s++],o+=l}while(l===255);const u=n.length-s;let c=s;if(o<u)s+=o;else if(o>u){Cd.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(a===4){if(n[c++]===181){const h=h4t(n,c);if(c+=2,h===49){const p=Qo(n,c);if(c+=4,p===1195456820){const g=n[c++];if(g===3){const x=n[c++],v=31&x,C=64&x,I=C?2+v*3:0,S=new Uint8Array(I);if(C){S[0]=x;for(let T=1;T<I;T++)S[T]=n[c++]}r.push({type:g,payloadType:a,pts:t,bytes:S})}}}}}else if(a===5&&o>16){const d=[];for(let g=0;g<16;g++){const x=n[c++].toString(16);d.push(x.length==1?"0"+x:x),(g===3||g===5||g===7||g===9)&&d.push("-")}const h=o-16,p=new Uint8Array(h);for(let g=0;g<h;g++)p[g]=n[c++];r.push({payloadType:a,pts:t,uuid:d.join(""),userData:vC(p),userDataBytes:p})}}}function v4t(i){const e=i.byteLength,t=[];let r=1;for(;r<e-2;)i[r]===0&&i[r+1]===0&&i[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return i;const n=e-t.length,s=new Uint8Array(n);let a=0;for(r=0;r<n;a++,r++)a===t[0]&&(a++,t.shift()),s[r]=i[a];return s}function Nvi(i){const e=i[0];let t="",r="",n=0,s=0,a=0,o=0,l=0,u=0;if(e===0){for(;o1(i.subarray(u,u+1))!=="\0";)t+=o1(i.subarray(u,u+1)),u+=1;for(t+=o1(i.subarray(u,u+1)),u+=1;o1(i.subarray(u,u+1))!=="\0";)r+=o1(i.subarray(u,u+1)),u+=1;r+=o1(i.subarray(u,u+1)),u+=1,n=Qo(i,12),s=Qo(i,16),o=Qo(i,20),l=Qo(i,24),u=28}else if(e===1){u+=4,n=Qo(i,u),u+=4;const d=Qo(i,u);u+=4;const h=Qo(i,u);for(u+=4,a=2**32*d+h,dvi(a)||(a=Number.MAX_SAFE_INTEGER,Cd.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=Qo(i,u),u+=4,l=Qo(i,u),u+=4;o1(i.subarray(u,u+1))!=="\0";)t+=o1(i.subarray(u,u+1)),u+=1;for(t+=o1(i.subarray(u,u+1)),u+=1;o1(i.subarray(u,u+1))!=="\0";)r+=o1(i.subarray(u,u+1)),u+=1;r+=o1(i.subarray(u,u+1)),u+=1}const c=i.subarray(u,i.byteLength);return{schemeIdUri:t,value:r,timeScale:n,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:c}}function Ovi(i,...e){const t=e.length;let r=8,n=t;for(;n--;)r+=e[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=r&255,s.set(i,4),n=0,r=8;n<t;n++)s.set(e[n],r),r+=e[n].byteLength;return s}function Lvi(i,e,t){if(i.byteLength!==16)throw new RangeError("Invalid system id");let r,n;r=0,n=new Uint8Array;let s;r>0?(s=new Uint8Array(4),e.length>0&&new DataView(s.buffer).setUint32(0,e.length,!1)):s=new Uint8Array;const a=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),Ovi([112,115,115,104],new Uint8Array([r,0,0,0]),i,s,n,a,t||new Uint8Array)}function kvi(i){const e=[];if(i instanceof ArrayBuffer){const t=i.byteLength;let r=0;for(;r+32<t;){const n=new DataView(i,r),s=Gvi(n);e.push(s),r+=s.size}}return e}function Gvi(i){const e=i.getUint32(0),t=i.byteOffset,r=i.byteLength;if(r<e)return{offset:t,size:r};if(i.getUint32(4)!==1886614376)return{offset:t,size:e};const s=i.getUint32(8)>>>24;if(s!==0&&s!==1)return{offset:t,size:e};const a=i.buffer,o=WS.hexDump(new Uint8Array(a,t+12,16)),l=i.getUint32(28);let u=null,c=null;if(s===0){if(e-32<l||l<22)return{offset:t,size:e};c=new Uint8Array(a,t+32,l)}else if(s===1){if(!l||r<t+32+l*16+16)return{offset:t,size:e};u=[];for(let d=0;d<l;d++)u.push(new Uint8Array(a,t+32+d*16,16))}return{version:s,systemId:o,kids:u,data:c,offset:t,size:e}}const y4t=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),pG={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function C4t(i,e){const t=pG[e];return!!t&&!!t[i.slice(0,4)]}function g8e(i,e,t=!0){return!i.split(",").some(r=>!A4t(r,e,t))}function A4t(i,e,t=!0){var r;const n=D6(t);return(r=n?.isTypeSupported(OK(i,e)))!=null?r:!1}function OK(i,e){return`${e}/mp4;codecs=${i}`}function b4t(i){if(i){const e=i.substring(0,4);return pG.video[e]}return 2}function eue(i){const e=y4t();return i.split(",").reduce((t,r)=>{const s=e&&$le(r)?9:pG.video[r];return s?(s*2+t)/(t?3:2):(pG.audio[r]+t)/(t?2:1)},0)}const m8e={};function Vvi(i,e=!0){if(m8e[i])return m8e[i];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[i];for(let n=0;n<t.length;n++){var r;if(A4t(t[n],"audio",e))return m8e[i]=t[n],t[n];if(t[n]==="mp3"&&(r=D6(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return i}const Wvi=/flac|opus|mp4a\.40\.34/i;function tue(i,e=!0){return i.replace(Wvi,t=>Vvi(t.toLowerCase(),e))}function Uvi(i,e){const t=[];if(i){const r=i.split(",");for(let n=0;n<r.length;n++)C4t(r[n],"video")||t.push(r[n])}return e&&t.push(e),t.join(",")}function rue(i,e){if(i&&(i.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(i)!==-1))return i;if(e){const t=e.split(",");if(t.length>1){if(i){for(let r=t.length;r--;)if(t[r].substring(0,4)===i.substring(0,4))return t[r]}return t[0]}}return e||i}function Hvi(i){const e=i.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");r.length>2&&r[0]==="avc1"&&(e[t]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Zvi(i){if(i.startsWith("av01.")){const e=i.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return i}function I4t(i){const e=D6(i)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function _4t(i){return i.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const D4t={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function S4t(i,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:i}}const E4t={};function zvi(i,e,t,r,n,s){const a=i.audioCodec?i.audioGroups:null,o=s?.audioCodec,l=s?.channels,u=l?parseInt(l):o?1/0:2;let c=null;if(a!=null&&a.length)try{a.length===1&&a[0]?c=e.groups[a[0]].channels:c=a.reduce((d,h)=>{if(h){const p=e.groups[h];if(!p)throw new Error(`Audio track group ${h} not found`);Object.keys(p.channels).forEach(g=>{d[g]=(d[g]||0)+p.channels[g]})}return d},{2:0})}catch{return!0}return i.videoCodec!==void 0&&(i.width>1920&&i.height>1088||i.height>1920&&i.width>1088||i.frameRate>Math.max(r,30)||i.videoRange!=="SDR"&&i.videoRange!==t||i.bitrate>Math.max(n,8e6))||!!c&&ga(u)&&Object.keys(c).some(d=>parseInt(d)>u)}function T4t(i,e,t){const r=i.videoCodec,n=i.audioCodec;if(!r&&!n||!t)return Promise.resolve(D4t);const s=[];if(r){const a={width:i.width,height:i.height,bitrate:Math.ceil(Math.max(i.bitrate*.9,i.averageBitrate)),framerate:i.frameRate||30},o=i.videoRange;o!=="SDR"&&(a.transferFunction=o.toLowerCase());const l=r.split(","),u=navigator.userAgent;if(l.some(c=>$le(c))&&y4t())return Promise.resolve(S4t(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),s));s.push.apply(s,l.map(c=>({type:"media-source",video:Kd(Kd({},a),{},{contentType:OK(Zvi(c),"video")})})))}return n&&i.audioGroups&&i.audioGroups.forEach(a=>{var o;a&&((o=e.groups[a])==null||o.tracks.forEach(l=>{if(l.groupId===a){const u=l.channels||"",c=parseFloat(u);ga(c)&&c>2&&s.push.apply(s,n.split(",").map(d=>({type:"media-source",audio:{contentType:OK(d,"audio"),channels:""+c}})))}}))}),Promise.all(s.map(a=>{const o=Xvi(a);return E4t[o]||(E4t[o]=t.decodingInfo(a))})).then(a=>({supported:!a.some(o=>!o.supported),configurations:s,decodingInfoResults:a})).catch(a=>({supported:!1,configurations:s,decodingInfoResults:[],error:a}))}function Xvi(i){const{audio:e,video:t}=i,r=t||e;if(r){const n=_4t(r.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${n}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${n}`}return""}const x8e=["NONE","TYPE-0","TYPE-1",null];function Yvi(i){return x8e.indexOf(i)>-1}const iue=["SDR","PQ","HLG"];function jvi(i){return!!i&&iue.indexOf(i)>-1}var nue={No:"",Yes:"YES",v2:"v2"};function R4t(i){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=i,n=r<e/2;return e&&n?t?nue.v2:nue.Yes:nue.No}class w4t{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class LK{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return F4t(this._audioGroups,e)}hasSubtitleGroup(e){return F4t(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function F4t(i,e){return!e||!i?!1:i.indexOf(e)!==-1}function Kvi(){if(typeof matchMedia=="function"){const i=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(i.media!==e.media)return i.matches===!0}return!1}function Qvi(i,e){let t=!1,r=[];if(i&&(t=i!=="SDR",r=[i]),e){r=e.allowedVideoRanges||iue.slice(0);const n=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:n&&Kvi(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const Jvi=i=>{const e=new WeakSet;return(t,r)=>{if(i&&(r=i(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},hp=(i,e)=>JSON.stringify(i,Jvi(e));function qvi(i,e,t,r,n){const s=Object.keys(i),a=r?.channels,o=r?.audioCodec,l=n?.videoCodec,u=a&&parseInt(a)===2;let c=!1,d=!1,h=1/0,p=1/0,g=1/0,x=1/0,v=0,C=[];const{preferHDR:I,allowedVideoRanges:S}=Qvi(e,n);for(let M=s.length;M--;){const L=i[s[M]];c||(c=L.channels[2]>0),h=Math.min(h,L.minHeight),p=Math.min(p,L.minFramerate),g=Math.min(g,L.minBitrate),S.filter(V=>L.videoRanges[V]>0).length>0&&(d=!0)}h=ga(h)?h:0,p=ga(p)?p:0;const T=Math.max(1080,h),E=Math.max(30,p);g=ga(g)?g:t,t=Math.max(g,t),d||(e=void 0);const B=s.length>1;return{codecSet:s.reduce((M,L)=>{const k=i[L];if(L===M)return M;if(C=d?S.filter(V=>k.videoRanges[V]>0):[],B){if(k.minBitrate>t)return HS(L,`min bitrate of ${k.minBitrate} > current estimate of ${t}`),M;if(!k.hasDefaultAudio)return HS(L,"no renditions with default or auto-select sound found"),M;if(o&&L.indexOf(o.substring(0,4))%5!==0)return HS(L,`audio codec preference "${o}" not found`),M;if(a&&!u){if(!k.channels[a])return HS(L,`no renditions with ${a} channel sound found (channels options: ${Object.keys(k.channels)})`),M}else if((!o||u)&&c&&k.channels[2]===0)return HS(L,"no renditions with stereo sound found"),M;if(k.minHeight>T)return HS(L,`min resolution of ${k.minHeight} > maximum of ${T}`),M;if(k.minFramerate>E)return HS(L,`min framerate of ${k.minFramerate} > maximum of ${E}`),M;if(!C.some(V=>k.videoRanges[V]>0))return HS(L,`no variants with VIDEO-RANGE of ${hp(C)} found`),M;if(l&&L.indexOf(l.substring(0,4))%5!==0)return HS(L,`video codec preference "${l}" not found`),M;if(k.maxScore<v)return HS(L,`max score of ${k.maxScore} < selected max of ${v}`),M}return M&&(eue(L)>=eue(M)||k.fragmentError>i[M].fragmentError)?M:(x=k.minIndex,v=k.maxScore,L)},void 0),videoRanges:C,preferHDR:I,minFramerate:p,minBitrate:g,minIndex:x}}function HS(i,e){Cd.log(`[abr] start candidates with "${i}" ignored because ${e}`)}function B4t(i){return i.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const n=t.channels||"2";return r.channels[n]=(r.channels[n]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function $vi(i,e,t,r){return i.slice(t,r+1).reduce((n,s,a)=>{if(!s.codecSet)return n;const o=s.audioGroups;let l=n[s.codecSet];l||(n[s.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,s.bitrate);const u=Math.min(s.height,s.width);return l.minHeight=Math.min(l.minHeight,u),l.minFramerate=Math.min(l.minFramerate,s.frameRate),l.minIndex=Math.min(l.minIndex,a),l.maxScore=Math.max(l.maxScore,s.score),l.fragmentError+=s.fragmentError,l.videoRanges[s.videoRange]=(l.videoRanges[s.videoRange]||0)+1,o&&o.forEach(c=>{if(!c)return;const d=e.groups[c];d&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(h=>{l.channels[h]=(l.channels[h]||0)+d.channels[h]}))}),n},{})}function P4t(i){if(!i)return i;const{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:s}=i;return{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:s}}function ZS(i,e,t){if("attrs"in i){const r=e.indexOf(i);if(r!==-1)return r}for(let r=0;r<e.length;r++){const n=e[r];if(dB(i,n,t))return r}return-1}function dB(i,e,t){const{groupId:r,name:n,lang:s,assocLang:a,default:o}=i,l=i.forced;return(r===void 0||e.groupId===r)&&(n===void 0||e.name===n)&&(s===void 0||eyi(s,e.lang))&&(s===void 0||e.assocLang===a)&&(o===void 0||e.default===o)&&(l===void 0||e.forced===l)&&(!("characteristics"in i)||tyi(i.characteristics||"",e.characteristics))&&(t===void 0||t(i,e))}function eyi(i,e="--"){return i.length===e.length?i===e:i.startsWith(e)||e.startsWith(i)}function tyi(i,e=""){const t=i.split(","),r=e.split(",");return t.length===r.length&&!t.some(n=>r.indexOf(n)===-1)}function hB(i,e){const{audioCodec:t,channels:r}=i;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function ryi(i,e,t,r,n){const s=e[r],o=e.reduce((h,p,g)=>{const x=p.uri;return(h[x]||(h[x]=[])).push(g),h},{})[s.uri];o.length>1&&(r=Math.max.apply(Math,o));const l=s.videoRange,u=s.frameRate,c=s.codecSet.substring(0,4),d=M4t(e,r,h=>{if(h.videoRange!==l||h.frameRate!==u||h.codecSet.substring(0,4)!==c)return!1;const p=h.audioGroups,g=t.filter(x=>!p||p.indexOf(x.groupId)!==-1);return ZS(i,g,n)>-1});return d>-1?d:M4t(e,r,h=>{const p=h.audioGroups,g=t.filter(x=>!p||p.indexOf(x.groupId)!==-1);return ZS(i,g,n)>-1})}function M4t(i,e,t){for(let r=e;r>-1;r--)if(t(i[r]))return r;for(let r=e+1;r<i.length;r++)if(t(i[r]))return r;return-1}function sue(i,e){var t;return!!i&&i!==((t=e.loadLevelObj)==null?void 0:t.uri)}class iyi extends H8{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var r;const{fragCurrent:n,partCurrent:s,hls:a}=this,{autoLevelEnabled:o,media:l}=a;if(!n||!l)return;const u=performance.now(),c=s?s.stats:n.stats,d=s?s.duration:n.duration,h=u-c.loading.start,p=a.minAutoLevel,g=n.level,x=this._nextAutoLevel;if(c.aborted||c.loaded&&c.loaded===c.total||g<=p){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const v=x>-1&&x!==g,C=!!t||v;if(!C&&(l.paused||!l.playbackRate||!l.readyState))return;const I=a.mainForwardBufferInfo;if(!C&&I===null)return;const S=this.bwEstimator.getEstimateTTFB(),T=Math.abs(l.playbackRate);if(h<=Math.max(S,1e3*(d/(T*2))))return;const E=I?I.len/T:0,B=c.loading.first?c.loading.first-c.loading.start:-1,P=c.loaded&&B>-1,M=this.getBwEstimate(),L=a.levels,k=L[g],V=Math.max(c.loaded,Math.round(d*(n.bitrate||k.averageBitrate)/8));let U=P?h-B:h;U<1&&P&&(U=Math.min(h,c.loaded*8/M));const z=P?c.loaded*1e3/U:0,Z=S/1e3,j=z?(V-c.loaded)/z:V*8/M+Z;if(j<=E)return;const K=z?z*8:M,J=((r=t?.details||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,q=this.hls.config.abrBandWidthUpFactor;let ie=Number.POSITIVE_INFINITY,oe;for(oe=g-1;oe>p;oe--){const ge=L[oe].maxBitrate,ce=!L[oe].details||J;if(ie=this.getTimeToLoadFrag(Z,K,d*ge,ce),ie<Math.min(E,d+Z))break}if(ie>=j||ie>d*10)return;P?this.bwEstimator.sample(h-Math.min(S,B),c.loaded):this.bwEstimator.sampleTTFB(h);const ue=L[oe].maxBitrate;this.getBwEstimate()*q>ue&&this.resetEstimator(ue);const de=this.findBestLevel(ue,p,oe,0,E,1,1);de>-1&&(oe=de),this.warn(`Fragment ${n.sn}${s?" part "+s.index:""} of level ${g} is loading too slowly;
53
+ `+("originalDts: "+Ee+" ms, curRefDts: "+Me+" ms, ")+("dtsCorrection: "+Math.round(E)+" ms, generate: "+Se+" frames")),ge=Math.floor(Me),Ae=Math.floor(Me+M)-ge;var he=d.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);he==null&&(u.default.w(this.TAG,"Unable to generate silent frame for "+(this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame")),he=fe),Ne=[];for(var Ye=0;Ye<Se;Ye++){Me=Me+M;var ut=Math.floor(Me),At=Math.floor(Me+M)-ut,gt={dts:ut,pts:ut,cts:0,unit:he,size:he.byteLength,duration:At,originalDts:Ee,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Ne.push(gt),Z+=gt.size}this._audioNextDts=Me+M}else ge=Math.floor(Me),Ae=Math.floor(Me+M)-ge,this._audioNextDts=Me+M}else{if(ge=Ee-E,te!==T.length-1){var Gt=T[te+1].dts-this._dtsBase-E;Ae=Gt-ge}else if(j!=null){var Gt=j.dts-this._dtsBase-E;Ae=Gt-ge}else me.length>=1?Ae=me[me.length-1].duration:Ae=Math.floor(M);this._audioNextDts=ge+Ae}B===-1&&(B=ge),me.push({dts:ge,pts:ge,cts:0,unit:K.unit,size:K.unit.byteLength,duration:Ae,originalDts:Ee,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Pe&&me.push.apply(me,Ne)}}if(me.length===0){S.samples=[],S.length=0;return}L?z=new Uint8Array(Z):(z=new Uint8Array(Z),z[0]=Z>>>24&255,z[1]=Z>>>16&255,z[2]=Z>>>8&255,z[3]=Z&255,z.set(c.default.types.mdat,4));for(var te=0;te<me.length;te++){var fe=me[te].unit;z.set(fe,U),U+=fe.byteLength}var Ct=me[me.length-1];P=Ct.dts+Ct.duration;var jt=new p.MediaSegmentInfo;jt.beginDts=B,jt.endDts=P,jt.beginPts=B,jt.endPts=P,jt.originalBeginDts=me[0].originalDts,jt.originalEndDts=Ct.originalDts+Ct.duration,jt.firstSample=new p.SampleInfo(me[0].dts,me[0].pts,me[0].duration,me[0].originalDts,!1),jt.lastSample=new p.SampleInfo(Ct.dts,Ct.pts,Ct.duration,Ct.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(jt),S.samples=me,S.sequenceNumber++;var Qe=null;L?Qe=new Uint8Array:Qe=c.default.moof(S,B),S.samples=[],S.length=0;var Ge={type:"audio",data:this._mergeBoxes(Qe,z).buffer,sampleCount:me.length,info:jt};L&&k&&(Ge.timestampOffset=B),this._onMediaSegment("audio",Ge)}}},v.prototype._remuxVideo=function(C,I){if(this._videoMeta!=null){var S=C,T=S.samples,E=void 0,B=-1,P=-1,M=-1,L=-1;if(!(!T||T.length===0)&&!(T.length===1&&!I)){var k=8,V=null,U=8+C.length,z=null;if(T.length>1&&(z=T.pop(),U-=z.length),this._videoStashedLastSample!=null){var Z=this._videoStashedLastSample;this._videoStashedLastSample=null,T.unshift(Z),U+=Z.length}z!=null&&(this._videoStashedLastSample=z);var j=T[0].dts-this._dtsBase;if(this._videoNextDts)E=j-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())E=0;else{var K=this._videoSegmentInfoList.getLastSampleBefore(j);if(K!=null){var J=j-(K.originalDts+K.duration);J<=3&&(J=0);var q=K.dts+K.duration+J;E=j-q}else E=0}for(var ie=new p.MediaSegmentInfo,oe=[],ue=0;ue<T.length;ue++){var Z=T[ue],de=Z.dts-this._dtsBase,he=Z.isKeyframe,ge=de-E,ce=Z.cts,me=ge+ce;B===-1&&(B=ge,M=me);var te=0;if(ue!==T.length-1){var fe=T[ue+1].dts-this._dtsBase-E;te=fe-ge}else if(z!=null){var fe=z.dts-this._dtsBase-E;te=fe-ge}else oe.length>=1?te=oe[oe.length-1].duration:te=Math.floor(this._videoMeta.refSampleDuration);if(he){var Ee=new p.SampleInfo(ge,me,te,Z.dts,!0);Ee.fileposition=Z.fileposition,ie.appendSyncPoint(Ee)}oe.push({dts:ge,pts:me,cts:ce,units:Z.units,size:Z.length,isKeyframe:he,duration:te,originalDts:de,flags:{isLeading:0,dependsOn:he?2:1,isDependedOn:he?1:0,hasRedundancy:0,isNonSync:he?0:1}})}V=new Uint8Array(U),V[0]=U>>>24&255,V[1]=U>>>16&255,V[2]=U>>>8&255,V[3]=U&255,V.set(c.default.types.mdat,4);for(var ue=0;ue<oe.length;ue++)for(var Pe=oe[ue].units;Pe.length;){var Ne=Pe.shift(),Ae=Ne.data;V.set(Ae,k),k+=Ae.byteLength}var Me=oe[oe.length-1];if(P=Me.dts+Me.duration,L=Me.pts+Me.duration,this._videoNextDts=P,ie.beginDts=B,ie.endDts=P,ie.beginPts=M,ie.endPts=L,ie.originalBeginDts=oe[0].originalDts,ie.originalEndDts=Me.originalDts+Me.duration,ie.firstSample=new p.SampleInfo(oe[0].dts,oe[0].pts,oe[0].duration,oe[0].originalDts,oe[0].isKeyframe),ie.lastSample=new p.SampleInfo(Me.dts,Me.pts,Me.duration,Me.originalDts,Me.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ie),S.samples=oe,S.sequenceNumber++,this._forceFirstIDR){var We=oe[0].flags;We.dependsOn=2,We.isNonSync=0}var Se=c.default.moof(S,B);S.samples=[],S.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Se,V).buffer,sampleCount:oe.length,info:ie})}}},v.prototype._mergeBoxes=function(C,I){var S=new Uint8Array(C.byteLength+I.byteLength);return S.set(C,0),S.set(I,C.byteLength),S},v})();o.default=x}),"./src/utils/browser.js":(function(a,o,l){l.r(o);var u={};function c(){var d=self.navigator.userAgent.toLowerCase(),h=/(edge)\/([\w.]+)/.exec(d)||/(opr)[\/]([\w.]+)/.exec(d)||/(chrome)[ \/]([\w.]+)/.exec(d)||/(iemobile)[\/]([\w.]+)/.exec(d)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+)/.exec(d)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(d)||/(msie) ([\w.]+)/.exec(d)||d.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(d)||d.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(d)||[],p=/(ipad)/.exec(d)||/(ipod)/.exec(d)||/(windows phone)/.exec(d)||/(iphone)/.exec(d)||/(kindle)/.exec(d)||/(android)/.exec(d)||/(windows)/.exec(d)||/(mac)/.exec(d)||/(linux)/.exec(d)||/(cros)/.exec(d)||[],g={browser:h[5]||h[3]||h[1]||"",version:h[2]||h[4]||"0",majorVersion:h[4]||h[2]||"0",platform:p[0]||""},x={};if(g.browser){x[g.browser]=!0;var v=g.majorVersion.split(".");x.version={major:parseInt(g.majorVersion,10),string:g.version},v.length>1&&(x.version.minor=parseInt(v[1],10)),v.length>2&&(x.version.build=parseInt(v[2],10))}if(g.platform&&(x[g.platform]=!0),(x.chrome||x.opr||x.safari)&&(x.webkit=!0),x.rv||x.iemobile){x.rv&&delete x.rv;var C="msie";g.browser=C,x[C]=!0}if(x.edge){delete x.edge;var I="msedge";g.browser=I,x[I]=!0}if(x.opr){var S="opera";g.browser=S,x[S]=!0}if(x.safari&&x.android){var T="android";g.browser=T,x[T]=!0}x.name=g.browser,x.platform=g.platform;for(var E in u)u.hasOwnProperty(E)&&delete u[E];Object.assign(u,x)}c(),o.default=u}),"./src/utils/exception.js":(function(a,o,l){l.r(o),l.d(o,{RuntimeException:function(){return c},IllegalStateException:function(){return d},InvalidArgumentException:function(){return h},NotImplementedException:function(){return p}});var u=(function(){var g=function(x,v){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,I){C.__proto__=I}||function(C,I){for(var S in I)Object.prototype.hasOwnProperty.call(I,S)&&(C[S]=I[S])},g(x,v)};return function(x,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");g(x,v);function C(){this.constructor=x}x.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}})(),c=(function(){function g(x){this._message=x}return Object.defineProperty(g.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),g.prototype.toString=function(){return this.name+": "+this.message},g})(),d=(function(g){u(x,g);function x(v){return g.call(this,v)||this}return Object.defineProperty(x.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),x})(c),h=(function(g){u(x,g);function x(v){return g.call(this,v)||this}return Object.defineProperty(x.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),x})(c),p=(function(g){u(x,g);function x(v){return g.call(this,v)||this}return Object.defineProperty(x.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),x})(c)}),"./src/utils/logger.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=(function(){function h(){}return h.e=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","error",x),h.ENABLE_ERROR},h.i=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","info",x),h.ENABLE_INFO},h.w=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","warn",x),h.ENABLE_WARN},h.d=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","debug",x),h.ENABLE_DEBUG},h.v=function(p,g){(!p||h.FORCE_GLOBAL_TAG)&&(p=h.GLOBAL_TAG);var x="["+p+"] > "+g;h.ENABLE_CALLBACK&&h.emitter.emit("log","verbose",x),h.ENABLE_VERBOSE},h})();d.GLOBAL_TAG="flv.js",d.FORCE_GLOBAL_TAG=!1,d.ENABLE_ERROR=!0,d.ENABLE_INFO=!0,d.ENABLE_WARN=!0,d.ENABLE_DEBUG=!0,d.ENABLE_VERBOSE=!0,d.ENABLE_CALLBACK=!1,d.emitter=new(c()),o.default=d}),"./src/utils/logging-control.js":(function(a,o,l){l.r(o);var u=l("./node_modules/events/events.js"),c=l.n(u),d=l("./src/utils/logger.js"),h=(function(){function p(){}return Object.defineProperty(p,"forceGlobalTag",{get:function(){return d.default.FORCE_GLOBAL_TAG},set:function(g){d.default.FORCE_GLOBAL_TAG=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"globalTag",{get:function(){return d.default.GLOBAL_TAG},set:function(g){d.default.GLOBAL_TAG=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableAll",{get:function(){return d.default.ENABLE_VERBOSE&&d.default.ENABLE_DEBUG&&d.default.ENABLE_INFO&&d.default.ENABLE_WARN&&d.default.ENABLE_ERROR},set:function(g){d.default.ENABLE_VERBOSE=g,d.default.ENABLE_DEBUG=g,d.default.ENABLE_INFO=g,d.default.ENABLE_WARN=g,d.default.ENABLE_ERROR=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableDebug",{get:function(){return d.default.ENABLE_DEBUG},set:function(g){d.default.ENABLE_DEBUG=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableVerbose",{get:function(){return d.default.ENABLE_VERBOSE},set:function(g){d.default.ENABLE_VERBOSE=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableInfo",{get:function(){return d.default.ENABLE_INFO},set:function(g){d.default.ENABLE_INFO=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableWarn",{get:function(){return d.default.ENABLE_WARN},set:function(g){d.default.ENABLE_WARN=g,p._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(p,"enableError",{get:function(){return d.default.ENABLE_ERROR},set:function(g){d.default.ENABLE_ERROR=g,p._notifyChange()},enumerable:!1,configurable:!0}),p.getConfig=function(){return{globalTag:d.default.GLOBAL_TAG,forceGlobalTag:d.default.FORCE_GLOBAL_TAG,enableVerbose:d.default.ENABLE_VERBOSE,enableDebug:d.default.ENABLE_DEBUG,enableInfo:d.default.ENABLE_INFO,enableWarn:d.default.ENABLE_WARN,enableError:d.default.ENABLE_ERROR,enableCallback:d.default.ENABLE_CALLBACK}},p.applyConfig=function(g){d.default.GLOBAL_TAG=g.globalTag,d.default.FORCE_GLOBAL_TAG=g.forceGlobalTag,d.default.ENABLE_VERBOSE=g.enableVerbose,d.default.ENABLE_DEBUG=g.enableDebug,d.default.ENABLE_INFO=g.enableInfo,d.default.ENABLE_WARN=g.enableWarn,d.default.ENABLE_ERROR=g.enableError,d.default.ENABLE_CALLBACK=g.enableCallback},p._notifyChange=function(){var g=p.emitter;if(g.listenerCount("change")>0){var x=p.getConfig();g.emit("change",x)}},p.registerListener=function(g){p.emitter.addListener("change",g)},p.removeListener=function(g){p.emitter.removeListener("change",g)},p.addLogListener=function(g){d.default.emitter.addListener("log",g),d.default.emitter.listenerCount("log")>0&&(d.default.ENABLE_CALLBACK=!0,p._notifyChange())},p.removeLogListener=function(g){d.default.emitter.removeListener("log",g),d.default.emitter.listenerCount("log")===0&&(d.default.ENABLE_CALLBACK=!1,p._notifyChange())},p})();h.emitter=new(c()),o.default=h}),"./src/utils/polyfill.js":(function(a,o,l){l.r(o);var u=(function(){function c(){}return c.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(d,h){return d.__proto__=h,d},Object.assign=Object.assign||function(d){if(d==null)throw new TypeError("Cannot convert undefined or null to object");for(var h=Object(d),p=1;p<arguments.length;p++){var g=arguments[p];if(g!=null)for(var x in g)g.hasOwnProperty(x)&&(h[x]=g[x])}return h},typeof self.Promise!="function"&&l("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},c})();u.install(),o.default=u}),"./src/utils/utf8-conv.js":(function(a,o,l){l.r(o);function u(d,h,p){var g=d;if(h+p<g.length){for(;p--;)if((g[++h]&192)!==128)return!1;return!0}else return!1}function c(d){for(var h=[],p=d,g=0,x=d.length;g<x;){if(p[g]<128){h.push(String.fromCharCode(p[g])),++g;continue}else if(!(p[g]<192)){if(p[g]<224){if(u(p,g,1)){var v=(p[g]&31)<<6|p[g+1]&63;if(v>=128){h.push(String.fromCharCode(v&65535)),g+=2;continue}}}else if(p[g]<240){if(u(p,g,2)){var v=(p[g]&15)<<12|(p[g+1]&63)<<6|p[g+2]&63;if(v>=2048&&(v&63488)!==55296){h.push(String.fromCharCode(v&65535)),g+=3;continue}}}else if(p[g]<248&&u(p,g,3)){var v=(p[g]&7)<<18|(p[g+1]&63)<<12|(p[g+2]&63)<<6|p[g+3]&63;if(v>65536&&v<1114112){v-=65536,h.push(String.fromCharCode(v>>>10|55296)),h.push(String.fromCharCode(v&1023|56320)),g+=4;continue}}}h.push("�"),++g}return h.join("")}o.default=c})},r={};function n(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return t[a].call(l.exports,l,l.exports,n),l.exports}n.m=t,(function(){n.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(o,{a:o}),o}})(),(function(){n.d=function(a,o){for(var l in o)n.o(o,l)&&!n.o(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:o[l]})}})(),(function(){n.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){n.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)}})(),(function(){n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})}})();var s=n("./src/index.js");return s})()})})(n8e)),n8e.exports}var Xxi=zxi();const jEt=f6(Xxi),KEt="2.0.0",Yxi=i=>{const e=Ut.cloneDeep(i);return e.version!==KEt?{config:{controls:e.controls,loop:e.loop,muted:e.muted,poster:e.poster,autoplay:e.autoplay},version:KEt}:i},jxi=(i,e)=>{xi(()=>Ut.cloneDeep(i.option),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0}),xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},Kxi=["poster","autoplay","controls","loop","muted"],Qxi=qt({...qt({name:"ShjFlv"}),props:{option:{},sources:{},useEvents:{}},emits:["on-video-progress","on-video-play","on-video-pause","on-video-ended","on-video-playing","on-video-timeupdate","on-video-error","on-video-volumechange"],setup(i,{expose:e,emit:t}){const r=Qr(()=>Yxi(i.option)),n=Ht(),s=Ht("");let a=null;const o=()=>{a&&(a.pause(),a.unload(),a.detachMediaElement(),a.destroy(),a=null),Po.parse({sources:i.sources,callback:({data:C})=>{try{if(gi.parseEvents(i.useEvents,"dataListener",C),s.value=C[0].data[0].src,!s.value)return;if(jEt.isSupported())try{a=jEt.createPlayer({type:"flv",url:s.value,isLive:!1,hasAudio:!0,hasVideo:!0,cors:!0,withCredentials:!1}),a.attachMediaElement(n.value),a.load(),r.value.config.autoplay&&a.play()}catch{}}catch{gi.parseEvents(i.useEvents,"dataListener",null)}}})};I0(()=>{a&&(a.pause(),a.unload(),a.detachMediaElement(),a.destroy(),a=null)});const l=t,u=()=>{l("on-video-progress"),gi.parseEvents(i.useEvents,"on-video-progress")},c=()=>{l("on-video-play"),gi.parseEvents(i.useEvents,"on-video-play")},d=()=>{l("on-video-pause"),gi.parseEvents(i.useEvents,"on-video-pause")},h=()=>{l("on-video-ended"),gi.parseEvents(i.useEvents,"on-video-ended")},p=()=>{l("on-video-playing"),gi.parseEvents(i.useEvents,"on-video-playing")},g=()=>{l("on-video-timeupdate"),gi.parseEvents(i.useEvents,"on-video-timeupdate")},x=()=>{l("on-video-error"),gi.parseEvents(i.useEvents,"on-video-error")},v=()=>{l("on-video-volumechange"),gi.parseEvents(i.useEvents,"on-video-volumechange")};return pa(()=>{so(()=>{o()})}),jxi({option:r.value,sources:i.sources},o),e({play:()=>{n.value&&n.value.play()},pause:()=>{n.value&&n.value.pause()},refresh:()=>o(),refreshView:()=>o(),refreshData:()=>o()}),(C,I)=>(kt(),Or("video",{ref_key:"videoRef",ref:n,class:"zerov-widget",poster:r.value.config.poster,autoplay:r.value.config.autoplay,controls:r.value.config.controls,loop:r.value.config.loop,muted:r.value.config.muted,onProgress:u,onPlay:c,onEnded:h,onPlaying:p,onPause:d,onTimeupdate:g,onError:x,onVolumechange:v},null,40,Kxi))}}),QEt=Xi(Qxi),Jxi=i=>i,qxi=(i,e)=>{xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},$xi=["src"],evi=qt({...qt({name:"ShjIframe"}),props:{option:{},sources:{},useEvents:{}},emits:["on-iframe-event-listener"],setup(i,{expose:e,emit:t}){const r=Ht(),n=Qr(()=>Jxi(i.option)),s=Ht(""),a=()=>{Po.parse({sources:i.sources,callback:({data:u})=>{try{gi.parseEvents(i.useEvents,"dataListener",u),s.value=u[0].data[0].url}catch{gi.parseEvents(i.useEvents,"dataListener",null),s.value=""}}})},o=t,l=u=>{u.source===r.value?.contentWindow&&(o("on-iframe-event-listener",u.data),i.useEvents&&Ut.isArray(i.useEvents)&&gi.parseEvents(i.useEvents,"on-iframe-event-listener",u.data))};return pa(()=>{so(()=>{a()}),window.addEventListener("message",l,!1)}),I0(()=>{window.removeEventListener("message",l,!1)}),qxi({option:n.value,sources:i.sources},a),e({refresh:()=>a(),refreshView:()=>a(),refreshData:()=>a(),sendChildrenMessages:(u,c)=>{if(r.value?.contentWindow)try{c[0].dataType==="params"?r.value.contentWindow.postMessage(u,s.value):r.value.contentWindow.postMessage(c[0].data,s.value)}catch{}}}),(u,c)=>s.value?(kt(),Or("iframe",{key:0,ref_key:"iframeRef",ref:r,src:s.value,class:"iframe",sandbox:"allow-scripts allow-same-origin allow-forms"},null,8,$xi)):Vi("",!0)}}),JEt=Xi(ku(evi,[["__scopeId","data-v-71d48c51"]])),qEt="2.0.0",tvi=i=>{const e=Ut.cloneDeep(i);return e.version!==qEt?{carousel:{iframes:e.iframes,pagination:e.pagination,freeMode:e.freeMode,reverseDirection:e.reverseDirection,slidesPerView:e.slidesPerView,speed:e.speed,spaceBetween:e.spaceBetween,autoplay:e.autoplay,pauseOnMouseEnter:e.pauseOnMouseEnter,delay:e.delay,paginationType:e.paginationType,rewind:e.rewind,loop:e.loop,grabCursor:e.grabCursor,effect:e.effect,stopOnLastSlide:e.stopOnLastSlide,roundLengths:e.roundLengths,direction:e.direction},version:qEt}:i},rvi=(i,e)=>{xi(()=>Ut.cloneDeep(i.option),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0}),xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})};var s8e={exports:{}},$Et;function ivi(){if($Et)return s8e.exports;$Et=1;var i=s8e.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=n}catch{t=n}})();function s(x){if(e===setTimeout)return setTimeout(x,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(x,0);try{return e(x,0)}catch{try{return e.call(null,x,0)}catch{return e.call(this,x,0)}}}function a(x){if(t===clearTimeout)return clearTimeout(x);if((t===n||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(x);try{return t(x)}catch{try{return t.call(null,x)}catch{return t.call(this,x)}}}var o=[],l=!1,u,c=-1;function d(){!l||!u||(l=!1,u.length?o=u.concat(o):c=-1,o.length&&h())}function h(){if(!l){var x=s(d);l=!0;for(var v=o.length;v;){for(u=o,o=[];++c<v;)u&&u[c].run();c=-1,v=o.length}u=null,l=!1,a(x)}}i.nextTick=function(x){var v=new Array(arguments.length-1);if(arguments.length>1)for(var C=1;C<arguments.length;C++)v[C-1]=arguments[C];o.push(new p(x,v)),o.length===1&&!l&&s(h)};function p(x,v){this.fun=x,this.array=v}p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function g(){}return i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(x){return[]},i.binding=function(x){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(x){throw new Error("process.chdir is not supported")},i.umask=function(){return 0},s8e.exports}var Kle=ivi();const nvi=["src"],svi=qt({...qt({name:"ShjIframeCarousel"}),props:{option:{}},setup(i,{expose:e}){ZEt();const t=Qr(()=>tvi(i.option)),r=Ht(Ul()),n=()=>{r.value=Ul()};return pa(()=>{Kle.nextTick(()=>{n()})}),rvi({option:t.value,sources:[]},n),e({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(s,a)=>{const o=a6("swiper-slide"),l=a6("swiper-container");return kt(),Bi(l,{key:r.value,class:"carousel",direction:t.value.carousel.direction,speed:t.value.carousel.speed,"round-lengths":t.value.carousel.roundLengths,"grab-cursor":t.value.carousel.grabCursor,rewind:t.value.carousel.rewind,loop:t.value.carousel.loop,"slides-per-view":t.value.carousel.slidesPerView,"space-between":t.value.carousel.spaceBetween,autoplay:t.value.carousel.autoplay,delay:t.value.carousel.delay,"stop-on-last-slide":t.value.carousel.stopOnLastSlide,"reverse-direction":t.value.carousel.reverseDirection,"pause-on-mouse-enter":t.value.carousel.pauseOnMouseEnter,"free-mode":t.value.carousel.freeMode,effect:t.value.carousel.effect,pagination:t.value.carousel.pagination,"pagination-type":t.value.carousel.paginationType},{default:ho(()=>[(kt(!0),Or(Qs,null,Wl(t.value.carousel.iframes,(u,c)=>(kt(),Bi(o,{key:u},{default:ho(()=>[Hi("iframe",{src:u.url,class:"iframe-slide",sandbox:"allow-scripts allow-same-origin"},null,8,nvi)]),_:2},1024))),128))]),_:1},8,["direction","speed","round-lengths","grab-cursor","rewind","loop","slides-per-view","space-between","autoplay","delay","stop-on-last-slide","reverse-direction","pause-on-mouse-enter","free-mode","effect","pagination","pagination-type"])}}}),e4t=Xi(ku(svi,[["__scopeId","data-v-e31f4b25"]])),t4t="2.0.0",avi=i=>{const e=Ut.cloneDeep(i);return e.version!==t4t?{base:{url:e.url,mode:e.mode,positionX:e.positionX,positionY:e.positionY,borderRadius:e.borderRadius},version:t4t}:i},ovi=qt({...qt({name:"ShjImage"}),props:{option:{}},setup(i,{expose:e}){const t=Qr(()=>avi(i.option));return e({refresh:()=>{},refreshView:()=>{},refreshData:()=>{}}),(r,n)=>(kt(),Or("div",{class:"image",style:ia({"--image-url":`url('${t.value.base.url}')`,"--image-border-radius":t.value.base.borderRadius+"px","--image-repeat":t.value.base.mode==="repeat"?"repeat":"no-repeat","--image-size":t.value.base.mode==="repeat"?"auto":t.value.base.mode,"--image-position-x":t.value.base.positionX+"px","--image-position-y":t.value.base.positionY+"px"})},null,4))}}),r4t=Xi(ku(ovi,[["__scopeId","data-v-3ef4f9e8"]])),i4t="2.0.0",lvi=i=>{const e=Ut.cloneDeep(i);return e.version!==i4t?{base:{mode:e.mode,positionX:e.positionX,positionY:e.positionY,borderRadius:e.borderRadius},version:i4t}:i},uvi=(i,e)=>{xi(()=>Ut.cloneDeep(i.sources),(t,r)=>{Ut.isEqual(t,r)||e(i.option)},{deep:!0})},cvi=qt({...qt({name:"ShjImageDynamic"}),props:{option:{},sources:{},useEvents:{}},setup(i,{expose:e}){const t=Qr(()=>lvi(i.option)),r=Ht(""),n=()=>{Po.parse({sources:i.sources,callback:({data:s})=>{try{gi.parseEvents(i.useEvents,"dataListener",s),r.value=s[0].data[0].src}catch{gi.parseEvents(i.useEvents,"dataListener",null),r.value=""}}})};return pa(()=>{so(()=>{n()})}),uvi({option:t.value,sources:i.sources},n),e({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(s,a)=>(kt(),Or("div",{class:"image",style:ia({"--image-url":`url('${r.value}')`,"--image-border-radius":t.value.base.borderRadius+"px","--image-repeat":t.value.base.mode==="repeat"?"repeat":"no-repeat","--image-size":t.value.base.mode==="repeat"?"auto":t.value.base.mode,"--image-position-x":t.value.base.positionX+"px","--image-position-y":t.value.base.positionY+"px"})},null,4))}}),n4t=Xi(ku(cvi,[["__scopeId","data-v-7b570c4e"]])),ga=Number.isFinite||function(i){return typeof i=="number"&&isFinite(i)},dvi=Number.isSafeInteger||function(i){return typeof i=="number"&&Math.abs(i)<=hvi},hvi=Number.MAX_SAFE_INTEGER||9007199254740991;let Qa=(function(i){return i.NETWORK_ERROR="networkError",i.MEDIA_ERROR="mediaError",i.KEY_SYSTEM_ERROR="keySystemError",i.MUX_ERROR="muxError",i.OTHER_ERROR="otherError",i})({}),Ui=(function(i){return i.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",i.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",i.KEY_SYSTEM_NO_SESSION="keySystemNoSession",i.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",i.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",i.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",i.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",i.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",i.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",i.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",i.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",i.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",i.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",i.MANIFEST_LOAD_ERROR="manifestLoadError",i.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",i.MANIFEST_PARSING_ERROR="manifestParsingError",i.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",i.LEVEL_EMPTY_ERROR="levelEmptyError",i.LEVEL_LOAD_ERROR="levelLoadError",i.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",i.LEVEL_PARSING_ERROR="levelParsingError",i.LEVEL_SWITCH_ERROR="levelSwitchError",i.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",i.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",i.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",i.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",i.FRAG_LOAD_ERROR="fragLoadError",i.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",i.FRAG_DECRYPT_ERROR="fragDecryptError",i.FRAG_PARSING_ERROR="fragParsingError",i.FRAG_GAP="fragGap",i.REMUX_ALLOC_ERROR="remuxAllocError",i.KEY_LOAD_ERROR="keyLoadError",i.KEY_LOAD_TIMEOUT="keyLoadTimeOut",i.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",i.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",i.BUFFER_APPEND_ERROR="bufferAppendError",i.BUFFER_APPENDING_ERROR="bufferAppendingError",i.BUFFER_STALLED_ERROR="bufferStalledError",i.BUFFER_FULL_ERROR="bufferFullError",i.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",i.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",i.ASSET_LIST_LOAD_ERROR="assetListLoadError",i.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",i.ASSET_LIST_PARSING_ERROR="assetListParsingError",i.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",i.INTERNAL_EXCEPTION="internalException",i.INTERNAL_ABORTED="aborted",i.ATTACH_MEDIA_ERROR="attachMediaError",i.UNKNOWN="unknown",i})({}),St=(function(i){return i.MEDIA_ATTACHING="hlsMediaAttaching",i.MEDIA_ATTACHED="hlsMediaAttached",i.MEDIA_DETACHING="hlsMediaDetaching",i.MEDIA_DETACHED="hlsMediaDetached",i.MEDIA_ENDED="hlsMediaEnded",i.STALL_RESOLVED="hlsStallResolved",i.BUFFER_RESET="hlsBufferReset",i.BUFFER_CODECS="hlsBufferCodecs",i.BUFFER_CREATED="hlsBufferCreated",i.BUFFER_APPENDING="hlsBufferAppending",i.BUFFER_APPENDED="hlsBufferAppended",i.BUFFER_EOS="hlsBufferEos",i.BUFFERED_TO_END="hlsBufferedToEnd",i.BUFFER_FLUSHING="hlsBufferFlushing",i.BUFFER_FLUSHED="hlsBufferFlushed",i.MANIFEST_LOADING="hlsManifestLoading",i.MANIFEST_LOADED="hlsManifestLoaded",i.MANIFEST_PARSED="hlsManifestParsed",i.LEVEL_SWITCHING="hlsLevelSwitching",i.LEVEL_SWITCHED="hlsLevelSwitched",i.LEVEL_LOADING="hlsLevelLoading",i.LEVEL_LOADED="hlsLevelLoaded",i.LEVEL_UPDATED="hlsLevelUpdated",i.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",i.LEVELS_UPDATED="hlsLevelsUpdated",i.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",i.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",i.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",i.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",i.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",i.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",i.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",i.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",i.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",i.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",i.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",i.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",i.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",i.CUES_PARSED="hlsCuesParsed",i.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",i.INIT_PTS_FOUND="hlsInitPtsFound",i.FRAG_LOADING="hlsFragLoading",i.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",i.FRAG_LOADED="hlsFragLoaded",i.FRAG_DECRYPTED="hlsFragDecrypted",i.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",i.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",i.FRAG_PARSING_METADATA="hlsFragParsingMetadata",i.FRAG_PARSED="hlsFragParsed",i.FRAG_BUFFERED="hlsFragBuffered",i.FRAG_CHANGED="hlsFragChanged",i.FPS_DROP="hlsFpsDrop",i.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",i.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",i.ERROR="hlsError",i.DESTROYING="hlsDestroying",i.KEY_LOADING="hlsKeyLoading",i.KEY_LOADED="hlsKeyLoaded",i.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",i.BACK_BUFFER_REACHED="hlsBackBufferReached",i.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",i.ASSET_LIST_LOADING="hlsAssetListLoading",i.ASSET_LIST_LOADED="hlsAssetListLoaded",i.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",i.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",i.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",i.INTERSTITIAL_STARTED="hlsInterstitialStarted",i.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",i.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",i.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",i.INTERSTITIAL_ENDED="hlsInterstitialEnded",i.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",i.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",i.EVENT_CUE_ENTER="hlsEventCueEnter",i})({});var qu={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Ga={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class fG{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class fvi{constructor(e,t,r,n=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new fG(e),this.fast_=new fG(t),this.defaultTTFB_=n,this.ttfb_=new fG(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:s}=this;r.halfLife!==e&&(this.slow_=new fG(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new fG(t,n.getEstimate(),n.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new fG(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,n=e/1e3,s=r/n;this.fast_.sample(n,s),this.slow_.sample(n,s)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function pvi(i,e,t){return(e=mvi(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function ph(){return ph=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},ph.apply(null,arguments)}function s4t(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Kd(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?s4t(Object(t),!0).forEach(function(r){pvi(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):s4t(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function gvi(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function mvi(i){var e=gvi(i,"string");return typeof e=="symbol"?e:e+""}let H8=class{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const r=`[${e}]:`;this.trace=_6,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}};const _6=function(){},xvi={trace:_6,debug:_6,log:_6,warn:_6,info:_6,error:_6};function a8e(){return ph({},xvi)}function vvi(i,e){const t=self.console[i];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${i}] >`):_6}function a4t(i,e,t){return e[i]?e[i].bind(e):vvi(i,t)}const o8e=a8e();function yvi(i,e,t){const r=a8e();if(typeof console=="object"&&i===!0||typeof i=="object"){const n=["debug","log","info","warn","error"];n.forEach(s=>{r[s]=a4t(s,i,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.5`)}catch{return a8e()}n.forEach(s=>{o8e[s]=a4t(s,i)})}else ph(o8e,r);return r}const Cd=o8e;function D6(i=!0){return typeof self>"u"?void 0:(i||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Cvi(i){return typeof self<"u"&&i===self.ManagedMediaSource}function o4t(i,e){const t=Object.keys(i),r=Object.keys(e),n=t.length,s=r.length;return!n||!s||n===s&&!t.some(a=>r.indexOf(a)===-1)}function vC(i,e=!1){if(typeof TextDecoder<"u"){const u=new TextDecoder("utf-8").decode(i);if(e){const c=u.indexOf("\0");return c!==-1?u.substring(0,c):u}return u.replace(/\0/g,"")}const t=i.length;let r,n,s,a="",o=0;for(;o<t;){if(r=i[o++],r===0&&e)return a;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(r);break;case 12:case 13:n=i[o++],a+=String.fromCharCode((r&31)<<6|n&63);break;case 14:n=i[o++],s=i[o++],a+=String.fromCharCode((r&15)<<12|(n&63)<<6|(s&63)<<0);break}}return a}const WS={hexDump:function(i){let e="";for(let t=0;t<i.length;t++){let r=i[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}};function Avi(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var l8e={exports:{}},l4t;function bvi(){return l4t||(l4t=1,(function(i,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,c){if(c=c||{},l=l.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return l;var d=o.parseURL(l);if(!d)throw new Error("Error trying to parse base URL.");return d.path=o.normalizePath(d.path),o.buildURLFromParts(d)}var h=o.parseURL(u);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=o.normalizePath(h.path),o.buildURLFromParts(h)):u;var p=o.parseURL(l);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var g=n.exec(p.path);p.netLoc=g[1],p.path=g[2]}p.netLoc&&!p.path&&(p.path="/");var x={scheme:p.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(x.netLoc=p.netLoc,h.path[0]!=="/"))if(!h.path)x.path=p.path,h.params||(x.params=p.params,h.query||(x.query=p.query));else{var v=p.path,C=v.substring(0,v.lastIndexOf("/")+1)+h.path;x.path=o.normalizePath(C)}return x.path===null&&(x.path=c.alwaysNormalize?o.normalizePath(h.path):h.path),o.buildURLFromParts(x)},parseURL:function(l){var u=r.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(s,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};i.exports=o})()})(l8e)),l8e.exports}var u8e=bvi();class c8e{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var jh={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class u4t{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,_vi(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let n;r.length===1?n=t?.byteRangeEndOffset||0:n=parseInt(r[1]),this._byteRange=[n,parseInt(r[0])+n]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[jh.AUDIO]:null,[jh.VIDEO]:null,[jh.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new c8e),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=u8e.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[jh.AUDIO]=null,e[jh.VIDEO]=null,e[jh.AUDIOVIDEO]=null}}function im(i){return i.sn!=="initSegment"}class d8e extends u4t{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(ga(e)&&ga(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const r=Object.keys(this.levelkeys);if(r.length===1)return this._decryptdata=this.levelkeys[r[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=ga(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),r=t.length;if(r>1||r===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!ga(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return im(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,r,n,s,a=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:s,partial:a};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,r),l.startDTS=Math.min(l.startDTS,n),l.endDTS=Math.max(l.endDTS,s)}}class Ivi extends u4t{constructor(e,t,r,n,s){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=n;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,s),s&&(this.fragOffset=s.fragOffset+s.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function c4t(i,e){const t=Object.getPrototypeOf(i);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||c4t(t,e)}}function _vi(i,e){const t=c4t(i,e);t&&(t.enumerable=!0,Object.defineProperty(i,e,t))}const Qle=Math.pow(2,32)-1,Dvi=[].push,d4t={video:1,audio:2,id3:3,text:4};function o1(i){return String.fromCharCode.apply(null,i)}function h4t(i,e){const t=i[e]<<8|i[e+1];return t<0?65536+t:t}function Qo(i,e){const t=p4t(i,e);return t<0?4294967296+t:t}function f4t(i,e){let t=Qo(i,e);return t*=Math.pow(2,32),t+=Qo(i,e+4),t}function p4t(i,e){return i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}function h8e(i,e,t){i[e]=t>>24,i[e+1]=t>>16&255,i[e+2]=t>>8&255,i[e+3]=t&255}function Svi(i){const e=i.byteLength;for(let t=0;t<e;){const r=Qo(i,t);if(r>8&&i[t+4]===109&&i[t+5]===111&&i[t+6]===111&&i[t+7]===102)return!0;t=r>1?t+r:e}return!1}function uu(i,e){const t=[];if(!e.length)return t;const r=i.byteLength;for(let n=0;n<r;){const s=Qo(i,n),a=o1(i.subarray(n+4,n+8)),o=s>1?n+s:r;if(a===e[0])if(e.length===1)t.push(i.subarray(n+8,o));else{const l=uu(i.subarray(n+8,o),e.slice(1));l.length&&Dvi.apply(t,l)}n=o}return t}function Evi(i){const e=[],t=i[0];let r=8;const n=Qo(i,r);r+=4;let s=0,a=0;t===0?(s=Qo(i,r),a=Qo(i,r+4),r+=8):(s=f4t(i,r),a=f4t(i,r+8),r+=16),r+=2;let o=i.length+a;const l=h4t(i,r);r+=2;for(let u=0;u<l;u++){let c=r;const d=Qo(i,c);c+=4;const h=d&2147483647;if((d&2147483648)>>>31===1)return Cd.warn("SIDX has hierarchical references (not supported)"),null;const g=Qo(i,c);c+=4,e.push({referenceSize:h,subsegmentDuration:g,info:{duration:g/n,start:o,end:o+h-1}}),o+=h,c+=4,r=c}return{earliestPresentationTime:s,timescale:n,version:t,referencesCount:l,references:e}}function g4t(i){const e=[],t=uu(i,["moov","trak"]);for(let n=0;n<t.length;n++){const s=t[n],a=uu(s,["tkhd"])[0];if(a){let o=a[0];const l=Qo(a,o===0?12:20),u=uu(s,["mdia","mdhd"])[0];if(u){o=u[0];const c=Qo(u,o===0?12:20),d=uu(s,["mdia","hdlr"])[0];if(d){const h=o1(d.subarray(8,12)),p={soun:jh.AUDIO,vide:jh.VIDEO}[h],g=uu(s,["mdia","minf","stbl","stsd"])[0],x=Tvi(g);p?(e[l]={timescale:c,type:p,stsd:x},e[p]=Kd({timescale:c,id:l},x)):e[l]={timescale:c,type:h,stsd:x}}}}}return uu(i,["moov","mvex","trex"]).forEach(n=>{const s=Qo(n,4),a=e[s];a&&(a.default={duration:Qo(n,12),flags:Qo(n,20)})}),e}function Tvi(i){const e=i.subarray(8),t=e.subarray(86),r=o1(e.subarray(4,8));let n=r,s;const a=r==="enca"||r==="encv";if(a){const u=uu(e,[r])[0].subarray(r==="enca"?28:78);uu(u,["sinf"]).forEach(d=>{const h=uu(d,["schm"])[0];if(h){const p=o1(h.subarray(4,8));if(p==="cbcs"||p==="cenc"){const g=uu(d,["frma"])[0];g&&(n=o1(g))}}})}const o=n;switch(n){case"avc1":case"avc2":case"avc3":case"avc4":{const l=uu(t,["avcC"])[0];l&&l.length>3&&(n+="."+qle(l[1])+qle(l[2])+qle(l[3]),s=Jle(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const l=uu(e,[r])[0],u=uu(l.subarray(28),["esds"])[0];if(u&&u.length>7){let c=4;if(u[c++]!==3)break;c=f8e(u,c),c+=2;const d=u[c++];if(d&128&&(c+=2),d&64&&(c+=u[c++]),u[c++]!==4)break;c=f8e(u,c);const h=u[c++];if(h===64)n+="."+qle(h);else break;if(c+=12,u[c++]!==5)break;c=f8e(u,c);const p=u[c++];let g=(p&248)>>3;g===31&&(g+=1+((p&7)<<3)+((u[c]&224)>>5)),n+="."+g}break}case"hvc1":case"hev1":{const l=uu(t,["hvcC"])[0];if(l&&l.length>12){const u=l[1],c=["","A","B","C"][u>>6],d=u&31,h=Qo(l,2),p=(u&32)>>5?"H":"L",g=l[12],x=l.subarray(6,12);n+="."+c+d,n+="."+Rvi(h).toString(16).toUpperCase(),n+="."+p+g;let v="";for(let C=x.length;C--;){const I=x[C];(I||v)&&(v="."+I.toString(16).toUpperCase()+v)}n+=v}s=Jle(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{n=Jle(n,t)||n;break}case"vp09":{const l=uu(t,["vpcC"])[0];if(l&&l.length>6){const u=l[4],c=l[5],d=l[6]>>4&15;n+="."+US(u)+"."+US(c)+"."+US(d)}break}case"av01":{const l=uu(t,["av1C"])[0];if(l&&l.length>2){const u=l[1]>>>5,c=l[1]&31,d=l[2]>>>7?"H":"M",h=(l[2]&64)>>6,p=(l[2]&32)>>5,g=u===2&&h?p?12:10:h?10:8,x=(l[2]&16)>>4,v=(l[2]&8)>>3,C=(l[2]&4)>>2,I=l[2]&3;n+="."+u+"."+US(c)+d+"."+US(g)+"."+x+"."+v+C+I+"."+US(1)+"."+US(1)+"."+US(1)+"."+0,s=Jle("dav1",t)}break}}return{codec:n,encrypted:a,supplemental:s}}function Jle(i,e){const t=uu(e,["dvvC"]),r=t.length?t[0]:uu(e,["dvcC"])[0];if(r){const n=r[2]>>1&127,s=r[2]<<5&32|r[3]>>3&31;return i+"."+US(n)+"."+US(s)}}function Rvi(i){let e=0;for(let t=0;t<32;t++)e|=(i>>t&1)<<31-t;return e>>>0}function f8e(i,e){const t=e+5;for(;i[e++]&128&&e<t;);return e}function qle(i){return("0"+i.toString(16).toUpperCase()).slice(-2)}function US(i){return(i<10?"0":"")+i}function wvi(i,e){if(!i||!e)return i;const t=e.keyId;return t&&e.isCommonEncryption&&uu(i,["moov","trak"]).forEach(n=>{const a=uu(n,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=uu(a,["enca"]);const l=o.length>0;l||(o=uu(a,["encv"])),o.forEach(u=>{const c=l?u.subarray(28):u.subarray(78);uu(c,["sinf"]).forEach(h=>{const p=m4t(h);if(p){const g=p.subarray(8,24);g.some(x=>x!==0)||(Cd.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${WS.hexDump(g)} -> ${WS.hexDump(t)}`),p.set(t,8))}})})}),i}function m4t(i){const e=uu(i,["schm"])[0];if(e){const t=o1(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return uu(i,["schi","tenc"])[0]}return null}function Fvi(i,e,t){const r={},n=uu(i,["moof","traf"]);for(let s=0;s<n.length;s++){const a=n[s],o=uu(a,["tfhd"])[0],l=Qo(o,4),u=e[l];if(!u)continue;const c=r[l]||(r[l]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type}),d=uu(a,["tfdt"])[0];if(d){const S=d[0];let T=Qo(d,4);S===1&&(T===Qle?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(T*=Qle+1,T+=Qo(d,8))),ga(T)&&(!ga(c.start)||T<c.start)&&(c.start=T)}const h=u.default,p=Qo(o,0)|h?.flags;let g=h?.duration||0;p&8&&(p&2?g=Qo(o,12):g=Qo(o,8));const x=uu(a,["trun"]);let v=c.start||0,C=0,I=g;for(let S=0;S<x.length;S++){const T=x[S],E=Qo(T,4),B=c.sampleCount;c.sampleCount+=E;const P=T[3]&1,M=T[3]&4,L=T[2]&1,k=T[2]&2,V=T[2]&4,U=T[2]&8;let z=8,Z=E;for(P&&(z+=4),M&&E&&(!(T[z+1]&1)&&c.keyFrameIndex===void 0&&(c.keyFrameIndex=B),z+=4,L?(I=Qo(T,z),z+=4):I=g,k&&(z+=4),U&&(z+=4),v+=I,C+=I,Z--);Z--;)L?(I=Qo(T,z),z+=4):I=g,k&&(z+=4),V&&(T[z+1]&1||c.keyFrameIndex===void 0&&(c.keyFrameIndex=c.sampleCount-(Z+1),c.keyFrameStart=v),z+=4),U&&(z+=4),v+=I,C+=I;!C&&g&&(C+=g*E)}c.duration+=C}if(!Object.keys(r).some(s=>r[s].duration)){let s=1/0,a=0;const o=uu(i,["sidx"]);for(let l=0;l<o.length;l++){const u=Evi(o[l]);if(u!=null&&u.references){s=Math.min(s,u.earliestPresentationTime/u.timescale);const c=u.references.reduce((d,h)=>d+h.info.duration||0,0);a=Math.max(a,c+u.earliestPresentationTime/u.timescale)}}a&&ga(a)&&Object.keys(r).forEach(l=>{r[l].duration||(r[l].duration=a*r[l].timescale-r[l].start)})}return r}function Bvi(i,e,t){uu(e,["moof","traf"]).forEach(r=>{uu(r,["tfhd"]).forEach(n=>{const s=Qo(n,4),a=i[s];if(!a)return;const o=a.timescale||9e4;uu(r,["tfdt"]).forEach(l=>{const u=l[0],c=t*o;if(c){let d=Qo(l,4);if(u===0)d-=c,d=Math.max(d,0),h8e(l,4,d);else{d*=Math.pow(2,32),d+=Qo(l,8),d-=c,d=Math.max(d,0);const h=Math.floor(d/(Qle+1)),p=Math.floor(d%(Qle+1));h8e(l,4,h),h8e(l,8,p)}}})})})}function Pvi(i){const e={valid:null,remainder:null},t=uu(i,["moof"]);if(t.length<2)return e.remainder=i,e;const r=t[t.length-1];return e.valid=i.slice(0,r.byteOffset-8),e.remainder=i.slice(r.byteOffset-8),e}function UA(i,e){const t=new Uint8Array(i.length+e.length);return t.set(i),t.set(e,i.length),t}function x4t(i,e){const t=[],r=e.samples,n=e.timescale,s=e.id;let a=!1;return uu(r,["moof"]).map(l=>{const u=l.byteOffset-8;uu(l,["traf"]).map(d=>{const h=uu(d,["tfdt"]).map(p=>{const g=p[0];let x=Qo(p,4);return g===1&&(x*=Math.pow(2,32),x+=Qo(p,8)),x/n})[0];return h!==void 0&&(i=h),uu(d,["tfhd"]).map(p=>{const g=Qo(p,4),x=Qo(p,0)&16777215,v=(x&1)!==0,C=(x&2)!==0,I=(x&8)!==0;let S=0;const T=(x&16)!==0;let E=0;const B=(x&32)!==0;let P=8;g===s&&(v&&(P+=8),C&&(P+=4),I&&(S=Qo(p,P),P+=4),T&&(E=Qo(p,P),P+=4),B&&(P+=4),e.type==="video"&&(a=$le(e.codec)),uu(d,["trun"]).map(M=>{const L=M[0],k=Qo(M,0)&16777215,V=(k&1)!==0;let U=0;const z=(k&4)!==0,Z=(k&256)!==0;let j=0;const K=(k&512)!==0;let J=0;const q=(k&1024)!==0,ie=(k&2048)!==0;let oe=0;const ue=Qo(M,4);let de=8;V&&(U=Qo(M,de),de+=4),z&&(de+=4);let he=U+u;for(let ge=0;ge<ue;ge++){if(Z?(j=Qo(M,de),de+=4):j=S,K?(J=Qo(M,de),de+=4):J=E,q&&(de+=4),ie&&(L===0?oe=Qo(M,de):oe=p4t(M,de),de+=4),e.type===jh.VIDEO){let ce=0;for(;ce<J;){const me=Qo(r,he);if(he+=4,Mvi(a,r[he])){const te=r.subarray(he,he+me);p8e(te,a?2:1,i+oe/n,t)}he+=me,ce+=me+4}}i+=j/n}}))})})}),t}function $le(i){if(!i)return!1;const e=i.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Mvi(i,e){if(i){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function p8e(i,e,t,r){const n=v4t(i);let s=0;s+=e;let a=0,o=0,l=0;for(;s<n.length;){a=0;do{if(s>=n.length)break;l=n[s++],a+=l}while(l===255);o=0;do{if(s>=n.length)break;l=n[s++],o+=l}while(l===255);const u=n.length-s;let c=s;if(o<u)s+=o;else if(o>u){Cd.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(a===4){if(n[c++]===181){const h=h4t(n,c);if(c+=2,h===49){const p=Qo(n,c);if(c+=4,p===1195456820){const g=n[c++];if(g===3){const x=n[c++],v=31&x,C=64&x,I=C?2+v*3:0,S=new Uint8Array(I);if(C){S[0]=x;for(let T=1;T<I;T++)S[T]=n[c++]}r.push({type:g,payloadType:a,pts:t,bytes:S})}}}}}else if(a===5&&o>16){const d=[];for(let g=0;g<16;g++){const x=n[c++].toString(16);d.push(x.length==1?"0"+x:x),(g===3||g===5||g===7||g===9)&&d.push("-")}const h=o-16,p=new Uint8Array(h);for(let g=0;g<h;g++)p[g]=n[c++];r.push({payloadType:a,pts:t,uuid:d.join(""),userData:vC(p),userDataBytes:p})}}}function v4t(i){const e=i.byteLength,t=[];let r=1;for(;r<e-2;)i[r]===0&&i[r+1]===0&&i[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return i;const n=e-t.length,s=new Uint8Array(n);let a=0;for(r=0;r<n;a++,r++)a===t[0]&&(a++,t.shift()),s[r]=i[a];return s}function Nvi(i){const e=i[0];let t="",r="",n=0,s=0,a=0,o=0,l=0,u=0;if(e===0){for(;o1(i.subarray(u,u+1))!=="\0";)t+=o1(i.subarray(u,u+1)),u+=1;for(t+=o1(i.subarray(u,u+1)),u+=1;o1(i.subarray(u,u+1))!=="\0";)r+=o1(i.subarray(u,u+1)),u+=1;r+=o1(i.subarray(u,u+1)),u+=1,n=Qo(i,12),s=Qo(i,16),o=Qo(i,20),l=Qo(i,24),u=28}else if(e===1){u+=4,n=Qo(i,u),u+=4;const d=Qo(i,u);u+=4;const h=Qo(i,u);for(u+=4,a=2**32*d+h,dvi(a)||(a=Number.MAX_SAFE_INTEGER,Cd.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=Qo(i,u),u+=4,l=Qo(i,u),u+=4;o1(i.subarray(u,u+1))!=="\0";)t+=o1(i.subarray(u,u+1)),u+=1;for(t+=o1(i.subarray(u,u+1)),u+=1;o1(i.subarray(u,u+1))!=="\0";)r+=o1(i.subarray(u,u+1)),u+=1;r+=o1(i.subarray(u,u+1)),u+=1}const c=i.subarray(u,i.byteLength);return{schemeIdUri:t,value:r,timeScale:n,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:c}}function Ovi(i,...e){const t=e.length;let r=8,n=t;for(;n--;)r+=e[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=r&255,s.set(i,4),n=0,r=8;n<t;n++)s.set(e[n],r),r+=e[n].byteLength;return s}function Lvi(i,e,t){if(i.byteLength!==16)throw new RangeError("Invalid system id");let r,n;r=0,n=new Uint8Array;let s;r>0?(s=new Uint8Array(4),e.length>0&&new DataView(s.buffer).setUint32(0,e.length,!1)):s=new Uint8Array;const a=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),Ovi([112,115,115,104],new Uint8Array([r,0,0,0]),i,s,n,a,t||new Uint8Array)}function kvi(i){const e=[];if(i instanceof ArrayBuffer){const t=i.byteLength;let r=0;for(;r+32<t;){const n=new DataView(i,r),s=Gvi(n);e.push(s),r+=s.size}}return e}function Gvi(i){const e=i.getUint32(0),t=i.byteOffset,r=i.byteLength;if(r<e)return{offset:t,size:r};if(i.getUint32(4)!==1886614376)return{offset:t,size:e};const s=i.getUint32(8)>>>24;if(s!==0&&s!==1)return{offset:t,size:e};const a=i.buffer,o=WS.hexDump(new Uint8Array(a,t+12,16)),l=i.getUint32(28);let u=null,c=null;if(s===0){if(e-32<l||l<22)return{offset:t,size:e};c=new Uint8Array(a,t+32,l)}else if(s===1){if(!l||r<t+32+l*16+16)return{offset:t,size:e};u=[];for(let d=0;d<l;d++)u.push(new Uint8Array(a,t+32+d*16,16))}return{version:s,systemId:o,kids:u,data:c,offset:t,size:e}}const y4t=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),pG={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function C4t(i,e){const t=pG[e];return!!t&&!!t[i.slice(0,4)]}function g8e(i,e,t=!0){return!i.split(",").some(r=>!A4t(r,e,t))}function A4t(i,e,t=!0){var r;const n=D6(t);return(r=n?.isTypeSupported(OK(i,e)))!=null?r:!1}function OK(i,e){return`${e}/mp4;codecs=${i}`}function b4t(i){if(i){const e=i.substring(0,4);return pG.video[e]}return 2}function eue(i){const e=y4t();return i.split(",").reduce((t,r)=>{const s=e&&$le(r)?9:pG.video[r];return s?(s*2+t)/(t?3:2):(pG.audio[r]+t)/(t?2:1)},0)}const m8e={};function Vvi(i,e=!0){if(m8e[i])return m8e[i];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[i];for(let n=0;n<t.length;n++){var r;if(A4t(t[n],"audio",e))return m8e[i]=t[n],t[n];if(t[n]==="mp3"&&(r=D6(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return i}const Wvi=/flac|opus|mp4a\.40\.34/i;function tue(i,e=!0){return i.replace(Wvi,t=>Vvi(t.toLowerCase(),e))}function Uvi(i,e){const t=[];if(i){const r=i.split(",");for(let n=0;n<r.length;n++)C4t(r[n],"video")||t.push(r[n])}return e&&t.push(e),t.join(",")}function rue(i,e){if(i&&(i.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(i)!==-1))return i;if(e){const t=e.split(",");if(t.length>1){if(i){for(let r=t.length;r--;)if(t[r].substring(0,4)===i.substring(0,4))return t[r]}return t[0]}}return e||i}function Hvi(i){const e=i.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");r.length>2&&r[0]==="avc1"&&(e[t]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Zvi(i){if(i.startsWith("av01.")){const e=i.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return i}function I4t(i){const e=D6(i)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function _4t(i){return i.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const D4t={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function S4t(i,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:i}}const E4t={};function zvi(i,e,t,r,n,s){const a=i.audioCodec?i.audioGroups:null,o=s?.audioCodec,l=s?.channels,u=l?parseInt(l):o?1/0:2;let c=null;if(a!=null&&a.length)try{a.length===1&&a[0]?c=e.groups[a[0]].channels:c=a.reduce((d,h)=>{if(h){const p=e.groups[h];if(!p)throw new Error(`Audio track group ${h} not found`);Object.keys(p.channels).forEach(g=>{d[g]=(d[g]||0)+p.channels[g]})}return d},{2:0})}catch{return!0}return i.videoCodec!==void 0&&(i.width>1920&&i.height>1088||i.height>1920&&i.width>1088||i.frameRate>Math.max(r,30)||i.videoRange!=="SDR"&&i.videoRange!==t||i.bitrate>Math.max(n,8e6))||!!c&&ga(u)&&Object.keys(c).some(d=>parseInt(d)>u)}function T4t(i,e,t){const r=i.videoCodec,n=i.audioCodec;if(!r&&!n||!t)return Promise.resolve(D4t);const s=[];if(r){const a={width:i.width,height:i.height,bitrate:Math.ceil(Math.max(i.bitrate*.9,i.averageBitrate)),framerate:i.frameRate||30},o=i.videoRange;o!=="SDR"&&(a.transferFunction=o.toLowerCase());const l=r.split(","),u=navigator.userAgent;if(l.some(c=>$le(c))&&y4t())return Promise.resolve(S4t(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),s));s.push.apply(s,l.map(c=>({type:"media-source",video:Kd(Kd({},a),{},{contentType:OK(Zvi(c),"video")})})))}return n&&i.audioGroups&&i.audioGroups.forEach(a=>{var o;a&&((o=e.groups[a])==null||o.tracks.forEach(l=>{if(l.groupId===a){const u=l.channels||"",c=parseFloat(u);ga(c)&&c>2&&s.push.apply(s,n.split(",").map(d=>({type:"media-source",audio:{contentType:OK(d,"audio"),channels:""+c}})))}}))}),Promise.all(s.map(a=>{const o=Xvi(a);return E4t[o]||(E4t[o]=t.decodingInfo(a))})).then(a=>({supported:!a.some(o=>!o.supported),configurations:s,decodingInfoResults:a})).catch(a=>({supported:!1,configurations:s,decodingInfoResults:[],error:a}))}function Xvi(i){const{audio:e,video:t}=i,r=t||e;if(r){const n=_4t(r.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${n}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${n}`}return""}const x8e=["NONE","TYPE-0","TYPE-1",null];function Yvi(i){return x8e.indexOf(i)>-1}const iue=["SDR","PQ","HLG"];function jvi(i){return!!i&&iue.indexOf(i)>-1}var nue={No:"",Yes:"YES",v2:"v2"};function R4t(i){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=i,n=r<e/2;return e&&n?t?nue.v2:nue.Yes:nue.No}class w4t{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class LK{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return F4t(this._audioGroups,e)}hasSubtitleGroup(e){return F4t(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function F4t(i,e){return!e||!i?!1:i.indexOf(e)!==-1}function Kvi(){if(typeof matchMedia=="function"){const i=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(i.media!==e.media)return i.matches===!0}return!1}function Qvi(i,e){let t=!1,r=[];if(i&&(t=i!=="SDR",r=[i]),e){r=e.allowedVideoRanges||iue.slice(0);const n=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:n&&Kvi(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const Jvi=i=>{const e=new WeakSet;return(t,r)=>{if(i&&(r=i(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},hp=(i,e)=>JSON.stringify(i,Jvi(e));function qvi(i,e,t,r,n){const s=Object.keys(i),a=r?.channels,o=r?.audioCodec,l=n?.videoCodec,u=a&&parseInt(a)===2;let c=!1,d=!1,h=1/0,p=1/0,g=1/0,x=1/0,v=0,C=[];const{preferHDR:I,allowedVideoRanges:S}=Qvi(e,n);for(let M=s.length;M--;){const L=i[s[M]];c||(c=L.channels[2]>0),h=Math.min(h,L.minHeight),p=Math.min(p,L.minFramerate),g=Math.min(g,L.minBitrate),S.filter(V=>L.videoRanges[V]>0).length>0&&(d=!0)}h=ga(h)?h:0,p=ga(p)?p:0;const T=Math.max(1080,h),E=Math.max(30,p);g=ga(g)?g:t,t=Math.max(g,t),d||(e=void 0);const B=s.length>1;return{codecSet:s.reduce((M,L)=>{const k=i[L];if(L===M)return M;if(C=d?S.filter(V=>k.videoRanges[V]>0):[],B){if(k.minBitrate>t)return HS(L,`min bitrate of ${k.minBitrate} > current estimate of ${t}`),M;if(!k.hasDefaultAudio)return HS(L,"no renditions with default or auto-select sound found"),M;if(o&&L.indexOf(o.substring(0,4))%5!==0)return HS(L,`audio codec preference "${o}" not found`),M;if(a&&!u){if(!k.channels[a])return HS(L,`no renditions with ${a} channel sound found (channels options: ${Object.keys(k.channels)})`),M}else if((!o||u)&&c&&k.channels[2]===0)return HS(L,"no renditions with stereo sound found"),M;if(k.minHeight>T)return HS(L,`min resolution of ${k.minHeight} > maximum of ${T}`),M;if(k.minFramerate>E)return HS(L,`min framerate of ${k.minFramerate} > maximum of ${E}`),M;if(!C.some(V=>k.videoRanges[V]>0))return HS(L,`no variants with VIDEO-RANGE of ${hp(C)} found`),M;if(l&&L.indexOf(l.substring(0,4))%5!==0)return HS(L,`video codec preference "${l}" not found`),M;if(k.maxScore<v)return HS(L,`max score of ${k.maxScore} < selected max of ${v}`),M}return M&&(eue(L)>=eue(M)||k.fragmentError>i[M].fragmentError)?M:(x=k.minIndex,v=k.maxScore,L)},void 0),videoRanges:C,preferHDR:I,minFramerate:p,minBitrate:g,minIndex:x}}function HS(i,e){Cd.log(`[abr] start candidates with "${i}" ignored because ${e}`)}function B4t(i){return i.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const n=t.channels||"2";return r.channels[n]=(r.channels[n]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function $vi(i,e,t,r){return i.slice(t,r+1).reduce((n,s,a)=>{if(!s.codecSet)return n;const o=s.audioGroups;let l=n[s.codecSet];l||(n[s.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,s.bitrate);const u=Math.min(s.height,s.width);return l.minHeight=Math.min(l.minHeight,u),l.minFramerate=Math.min(l.minFramerate,s.frameRate),l.minIndex=Math.min(l.minIndex,a),l.maxScore=Math.max(l.maxScore,s.score),l.fragmentError+=s.fragmentError,l.videoRanges[s.videoRange]=(l.videoRanges[s.videoRange]||0)+1,o&&o.forEach(c=>{if(!c)return;const d=e.groups[c];d&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(h=>{l.channels[h]=(l.channels[h]||0)+d.channels[h]}))}),n},{})}function P4t(i){if(!i)return i;const{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:s}=i;return{lang:e,assocLang:t,characteristics:r,channels:n,audioCodec:s}}function ZS(i,e,t){if("attrs"in i){const r=e.indexOf(i);if(r!==-1)return r}for(let r=0;r<e.length;r++){const n=e[r];if(dB(i,n,t))return r}return-1}function dB(i,e,t){const{groupId:r,name:n,lang:s,assocLang:a,default:o}=i,l=i.forced;return(r===void 0||e.groupId===r)&&(n===void 0||e.name===n)&&(s===void 0||eyi(s,e.lang))&&(s===void 0||e.assocLang===a)&&(o===void 0||e.default===o)&&(l===void 0||e.forced===l)&&(!("characteristics"in i)||tyi(i.characteristics||"",e.characteristics))&&(t===void 0||t(i,e))}function eyi(i,e="--"){return i.length===e.length?i===e:i.startsWith(e)||e.startsWith(i)}function tyi(i,e=""){const t=i.split(","),r=e.split(",");return t.length===r.length&&!t.some(n=>r.indexOf(n)===-1)}function hB(i,e){const{audioCodec:t,channels:r}=i;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function ryi(i,e,t,r,n){const s=e[r],o=e.reduce((h,p,g)=>{const x=p.uri;return(h[x]||(h[x]=[])).push(g),h},{})[s.uri];o.length>1&&(r=Math.max.apply(Math,o));const l=s.videoRange,u=s.frameRate,c=s.codecSet.substring(0,4),d=M4t(e,r,h=>{if(h.videoRange!==l||h.frameRate!==u||h.codecSet.substring(0,4)!==c)return!1;const p=h.audioGroups,g=t.filter(x=>!p||p.indexOf(x.groupId)!==-1);return ZS(i,g,n)>-1});return d>-1?d:M4t(e,r,h=>{const p=h.audioGroups,g=t.filter(x=>!p||p.indexOf(x.groupId)!==-1);return ZS(i,g,n)>-1})}function M4t(i,e,t){for(let r=e;r>-1;r--)if(t(i[r]))return r;for(let r=e+1;r<i.length;r++)if(t(i[r]))return r;return-1}function sue(i,e){var t;return!!i&&i!==((t=e.loadLevelObj)==null?void 0:t.uri)}class iyi extends H8{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var r;const{fragCurrent:n,partCurrent:s,hls:a}=this,{autoLevelEnabled:o,media:l}=a;if(!n||!l)return;const u=performance.now(),c=s?s.stats:n.stats,d=s?s.duration:n.duration,h=u-c.loading.start,p=a.minAutoLevel,g=n.level,x=this._nextAutoLevel;if(c.aborted||c.loaded&&c.loaded===c.total||g<=p){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const v=x>-1&&x!==g,C=!!t||v;if(!C&&(l.paused||!l.playbackRate||!l.readyState))return;const I=a.mainForwardBufferInfo;if(!C&&I===null)return;const S=this.bwEstimator.getEstimateTTFB(),T=Math.abs(l.playbackRate);if(h<=Math.max(S,1e3*(d/(T*2))))return;const E=I?I.len/T:0,B=c.loading.first?c.loading.first-c.loading.start:-1,P=c.loaded&&B>-1,M=this.getBwEstimate(),L=a.levels,k=L[g],V=Math.max(c.loaded,Math.round(d*(n.bitrate||k.averageBitrate)/8));let U=P?h-B:h;U<1&&P&&(U=Math.min(h,c.loaded*8/M));const z=P?c.loaded*1e3/U:0,Z=S/1e3,j=z?(V-c.loaded)/z:V*8/M+Z;if(j<=E)return;const K=z?z*8:M,J=((r=t?.details||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,q=this.hls.config.abrBandWidthUpFactor;let ie=Number.POSITIVE_INFINITY,oe;for(oe=g-1;oe>p;oe--){const ge=L[oe].maxBitrate,ce=!L[oe].details||J;if(ie=this.getTimeToLoadFrag(Z,K,d*ge,ce),ie<Math.min(E,d+Z))break}if(ie>=j||ie>d*10)return;P?this.bwEstimator.sample(h-Math.min(S,B),c.loaded):this.bwEstimator.sampleTTFB(h);const ue=L[oe].maxBitrate;this.getBwEstimate()*q>ue&&this.resetEstimator(ue);const de=this.findBestLevel(ue,p,oe,0,E,1,1);de>-1&&(oe=de),this.warn(`Fragment ${n.sn}${s?" part "+s.index:""} of level ${g} is loading too slowly;
54
54
  Fragment duration: ${n.duration.toFixed(3)}
55
55
  Time to underbuffer: ${E.toFixed(3)} s
56
56
  Estimated load time for current fragment: ${j.toFixed(3)} s