@kwai-video-team/kwai-player-web
Version:
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
195 lines • 1.18 MB
JavaScript
(function(Tt,ft){typeof exports=="object"&&typeof module!="undefined"?ft(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],ft):(Tt=typeof globalThis!="undefined"?globalThis:Tt||self,ft(Tt.KwaiPlayer={},Tt.Vue))})(this,function(Tt,ft){"use strict";var TE=Object.defineProperty;var Nd=Object.getOwnPropertySymbols;var IE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable;var xd=(Tt,ft,Vi)=>ft in Tt?TE(Tt,ft,{enumerable:!0,configurable:!0,writable:!0,value:Vi}):Tt[ft]=Vi,kd=(Tt,ft)=>{for(var Vi in ft||(ft={}))IE.call(ft,Vi)&&xd(Tt,Vi,ft[Vi]);if(Nd)for(var Vi of Nd(ft))RE.call(ft,Vi)&&xd(Tt,Vi,ft[Vi]);return Tt};var Ec=(Tt,ft,Vi)=>new Promise(($s,ya)=>{var ln=un=>{try{ci(Vi.next(un))}catch(Ca){ya(Ca)}},qa=un=>{try{ci(Vi.throw(un))}catch(Ca){ya(Ca)}},ci=un=>un.done?$s(un.value):Promise.resolve(un.value).then(ln,qa);ci((Vi=Vi.apply(Tt,ft)).next())});Number.isFinite||(Number.isFinite=r=>typeof r=="number"&&isFinite(r)),Array.prototype.find||(Array.prototype.find=function(r,i){if(this===null||this===void 0)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof r!="function")throw new TypeError("callback must be a function");const n=Object(this),o=n.length>>>0;for(let s=0;s<o;s++)if(r.call(i,n[s],s,n))return n[s]}),Array.prototype.findIndex||(Array.prototype.findIndex=function(r,i){if(this===null||this===void 0)throw new TypeError("Array.prototype.findIndex called on null or undefined");if(typeof r!="function")throw new TypeError("callback must be a function");const n=Object(this),o=n.length>>>0;for(let s=0;s<o;s++)if(s in n&&r.call(i,n[s],s,n))return s;return-1}),Array.prototype.fill||(Array.prototype.fill=function(r,i=0,n=this.length){if(this===null||this===void 0)throw new TypeError("Array.prototype.fill called on null or undefined");const o=Object(this),s=o.length>>>0,d=i>>0,m=n>>0,A=d<0?Math.max(s+d,0):Math.min(d,s),T=m<0?Math.max(s+m,0):Math.min(m,s);for(let C=A;C<T;C++)o[C]=r;return o});var Vi=Object.defineProperty,$s=(r,i,n)=>i in r?Vi(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,ya=(r,i,n)=>($s(r,typeof i!="symbol"?i+"":i,n),n),ln=function(r){var i={};function n(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=r,n.c=i,n.d=function(o,s,d){n.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:d})},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n.t=function(o,s){if(1&s&&(o=n(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(n.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var m in o)n.d(d,m,function(A){return o[A]}.bind(null,m));return d},n.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(s,"a",s),s},n.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},n.p="",n(n.s=8)}([function(r,i,n){var o=n(5);function s(d,m){for(var A=0;A<m.length;A++){var T=m[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,o(T.key),T)}}r.exports=function(d,m,A){return m&&s(d.prototype,m),A&&s(d,A),Object.defineProperty(d,"prototype",{writable:!1}),d},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){function n(o){return r.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,n(o)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(7)();r.exports=o;try{regeneratorRuntime=o}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(r,i){function n(){return r.exports=n=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(o[m]=d[m])}return o},r.exports.__esModule=!0,r.exports.default=r.exports,n.apply(this,arguments)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){function n(o,s,d,m,A,T,C){try{var h=o[T](C),F=h.value}catch(w){return void d(w)}h.done?s(F):Promise.resolve(F).then(m,A)}r.exports=function(o){return function(){var s=this,d=arguments;return new Promise(function(m,A){var T=o.apply(s,d);function C(F){n(T,m,A,C,h,"next",F)}function h(F){n(T,m,A,C,h,"throw",F)}C(void 0)})}},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(1).default,s=n(6);r.exports=function(d){var m=s(d,"string");return o(m)=="symbol"?m:m+""},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(1).default;r.exports=function(s,d){if(o(s)!="object"||!s)return s;var m=s[Symbol.toPrimitive];if(m!==void 0){var A=m.call(s,d||"default");if(o(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(1).default;function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r.exports=s=function(){return m},r.exports.__esModule=!0,r.exports.default=r.exports;var d,m={},A=Object.prototype,T=A.hasOwnProperty,C=Object.defineProperty||function(de,$,ge){de[$]=ge.value},h=typeof Symbol=="function"?Symbol:{},F=h.iterator||"@@iterator",w=h.asyncIterator||"@@asyncIterator",I=h.toStringTag||"@@toStringTag";function S(de,$,ge){return Object.defineProperty(de,$,{value:ge,enumerable:!0,configurable:!0,writable:!0}),de[$]}try{S({},"")}catch(de){S=function($,ge,Pe){return $[ge]=Pe}}function W(de,$,ge,Pe){var ae=$&&$.prototype instanceof J?$:J,q=Object.create(ae.prototype),b=new Re(Pe||[]);return C(q,"_invoke",{value:L(de,ge,b)}),q}function j(de,$,ge){try{return{type:"normal",arg:de.call($,ge)}}catch(Pe){return{type:"throw",arg:Pe}}}m.wrap=W;var N="suspendedStart",K="executing",z="completed",B={};function J(){}function be(){}function X(){}var ye={};S(ye,F,function(){return this});var Be=Object.getPrototypeOf,Ve=Be&&Be(Be(Oe([])));Ve&&Ve!==A&&T.call(Ve,F)&&(ye=Ve);var je=X.prototype=J.prototype=Object.create(ye);function we(de){["next","throw","return"].forEach(function($){S(de,$,function(ge){return this._invoke($,ge)})})}function ue(de,$){function ge(ae,q,b,ve){var U=j(de[ae],de,q);if(U.type!=="throw"){var M=U.arg,ne=M.value;return ne&&o(ne)=="object"&&T.call(ne,"__await")?$.resolve(ne.__await).then(function(Le){ge("next",Le,b,ve)},function(Le){ge("throw",Le,b,ve)}):$.resolve(ne).then(function(Le){M.value=Le,b(M)},function(Le){return ge("throw",Le,b,ve)})}ve(U.arg)}var Pe;C(this,"_invoke",{value:function(ae,q){function b(){return new $(function(ve,U){ge(ae,q,ve,U)})}return Pe=Pe?Pe.then(b,b):b()}})}function L(de,$,ge){var Pe=N;return function(ae,q){if(Pe===K)throw Error("Generator is already running");if(Pe===z){if(ae==="throw")throw q;return{value:d,done:!0}}for(ge.method=ae,ge.arg=q;;){var b=ge.delegate;if(b){var ve=D(b,ge);if(ve){if(ve===B)continue;return ve}}if(ge.method==="next")ge.sent=ge._sent=ge.arg;else if(ge.method==="throw"){if(Pe===N)throw Pe=z,ge.arg;ge.dispatchException(ge.arg)}else ge.method==="return"&&ge.abrupt("return",ge.arg);Pe=K;var U=j(de,$,ge);if(U.type==="normal"){if(Pe=ge.done?z:"suspendedYield",U.arg===B)continue;return{value:U.arg,done:ge.done}}U.type==="throw"&&(Pe=z,ge.method="throw",ge.arg=U.arg)}}}function D(de,$){var ge=$.method,Pe=de.iterator[ge];if(Pe===d)return $.delegate=null,ge==="throw"&&de.iterator.return&&($.method="return",$.arg=d,D(de,$),$.method==="throw")||ge!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+ge+"' method")),B;var ae=j(Pe,de.iterator,$.arg);if(ae.type==="throw")return $.method="throw",$.arg=ae.arg,$.delegate=null,B;var q=ae.arg;return q?q.done?($[de.resultName]=q.value,$.next=de.nextLoc,$.method!=="return"&&($.method="next",$.arg=d),$.delegate=null,B):q:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,B)}function le(de){var $={tryLoc:de[0]};1 in de&&($.catchLoc=de[1]),2 in de&&($.finallyLoc=de[2],$.afterLoc=de[3]),this.tryEntries.push($)}function oe(de){var $=de.completion||{};$.type="normal",delete $.arg,de.completion=$}function Re(de){this.tryEntries=[{tryLoc:"root"}],de.forEach(le,this),this.reset(!0)}function Oe(de){if(de||de===""){var $=de[F];if($)return $.call(de);if(typeof de.next=="function")return de;if(!isNaN(de.length)){var ge=-1,Pe=function ae(){for(;++ge<de.length;)if(T.call(de,ge))return ae.value=de[ge],ae.done=!1,ae;return ae.value=d,ae.done=!0,ae};return Pe.next=Pe}}throw new TypeError(o(de)+" is not iterable")}return be.prototype=X,C(je,"constructor",{value:X,configurable:!0}),C(X,"constructor",{value:be,configurable:!0}),be.displayName=S(X,I,"GeneratorFunction"),m.isGeneratorFunction=function(de){var $=typeof de=="function"&&de.constructor;return!!$&&($===be||($.displayName||$.name)==="GeneratorFunction")},m.mark=function(de){return Object.setPrototypeOf?Object.setPrototypeOf(de,X):(de.__proto__=X,S(de,I,"GeneratorFunction")),de.prototype=Object.create(je),de},m.awrap=function(de){return{__await:de}},we(ue.prototype),S(ue.prototype,w,function(){return this}),m.AsyncIterator=ue,m.async=function(de,$,ge,Pe,ae){ae===void 0&&(ae=Promise);var q=new ue(W(de,$,ge,Pe),ae);return m.isGeneratorFunction($)?q:q.next().then(function(b){return b.done?b.value:q.next()})},we(je),S(je,I,"Generator"),S(je,F,function(){return this}),S(je,"toString",function(){return"[object Generator]"}),m.keys=function(de){var $=Object(de),ge=[];for(var Pe in $)ge.push(Pe);return ge.reverse(),function ae(){for(;ge.length;){var q=ge.pop();if(q in $)return ae.value=q,ae.done=!1,ae}return ae.done=!0,ae}},m.values=Oe,Re.prototype={constructor:Re,reset:function(de){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(oe),!de)for(var $ in this)$.charAt(0)==="t"&&T.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=d)},stop:function(){this.done=!0;var de=this.tryEntries[0].completion;if(de.type==="throw")throw de.arg;return this.rval},dispatchException:function(de){if(this.done)throw de;var $=this;function ge(U,M){return q.type="throw",q.arg=de,$.next=U,M&&($.method="next",$.arg=d),!!M}for(var Pe=this.tryEntries.length-1;Pe>=0;--Pe){var ae=this.tryEntries[Pe],q=ae.completion;if(ae.tryLoc==="root")return ge("end");if(ae.tryLoc<=this.prev){var b=T.call(ae,"catchLoc"),ve=T.call(ae,"finallyLoc");if(b&&ve){if(this.prev<ae.catchLoc)return ge(ae.catchLoc,!0);if(this.prev<ae.finallyLoc)return ge(ae.finallyLoc)}else if(b){if(this.prev<ae.catchLoc)return ge(ae.catchLoc,!0)}else{if(!ve)throw Error("try statement without catch or finally");if(this.prev<ae.finallyLoc)return ge(ae.finallyLoc)}}}},abrupt:function(de,$){for(var ge=this.tryEntries.length-1;ge>=0;--ge){var Pe=this.tryEntries[ge];if(Pe.tryLoc<=this.prev&&T.call(Pe,"finallyLoc")&&this.prev<Pe.finallyLoc){var ae=Pe;break}}ae&&(de==="break"||de==="continue")&&ae.tryLoc<=$&&$<=ae.finallyLoc&&(ae=null);var q=ae?ae.completion:{};return q.type=de,q.arg=$,ae?(this.method="next",this.next=ae.finallyLoc,B):this.complete(q)},complete:function(de,$){if(de.type==="throw")throw de.arg;return de.type==="break"||de.type==="continue"?this.next=de.arg:de.type==="return"?(this.rval=this.arg=de.arg,this.method="return",this.next="end"):de.type==="normal"&&$&&(this.next=$),B},finish:function(de){for(var $=this.tryEntries.length-1;$>=0;--$){var ge=this.tryEntries[$];if(ge.finallyLoc===de)return this.complete(ge.completion,ge.afterLoc),oe(ge),B}},catch:function(de){for(var $=this.tryEntries.length-1;$>=0;--$){var ge=this.tryEntries[$];if(ge.tryLoc===de){var Pe=ge.completion;if(Pe.type==="throw"){var ae=Pe.arg;oe(ge)}return ae}}throw Error("illegal catch attempt")},delegateYield:function(de,$,ge){return this.delegate={iterator:Oe(de),resultName:$,nextLoc:ge},this.method==="next"&&(this.arg=d),B}},m}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){n.r(i),n.d(i,"KwaiVideoLocalLog",function(){return je}),n.d(i,"LogLevel",function(){return w}),n.d(i,"DefaultLogger",function(){return j}),n.d(i,"Logger",function(){return W}),n.d(i,"printVersion",function(){return T}),n.d(i,"DEFAULT_LOG_LEVEL",function(){return I});var o=n(0),s=n.n(o),d=n(3),m=n.n(d),A={idbName:"kwai-video-local-log",idbMaxDataCount:25e3,idbMaxFoldLog:20,maxLogLen:4096};function T(we,ue){console.log("%c "+we+" %c "+ue+" %c","background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px; color: #fff","background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0; color: #fff","background:transparent")}var C=function(){function we(){this.timeout=6048e5}var ue=we.prototype;return ue.write=function(L,D){if(we.available)try{localStorage.setItem(L,JSON.stringify({value:D,time:Date.now()}))}catch(le){}},ue.read=function(L,D){if(D===void 0&&(D=!0),we.available)try{var le=localStorage.getItem(L);if(le){var oe=JSON.parse(le),Re=oe.value,Oe=oe.time,de=Oe===void 0?0:Oe;if(!D||Date.now()-de<(typeof D=="number"?D:this.timeout))return Re}}catch($){}},s()(we,null,[{key:"available",get:function(){if(we._available===void 0)try{localStorage.setItem("alg","test"),we._available=!0}catch(L){we._available=!1}return we._available}}])}();C._available=void 0;var h,F=C,w=function(we){return we.NONE="none",we.ERROR="e",we.WARN="w",we.INFO="i",we.DEBUG="d",we.VERBOSE="v",we}({}),I=w.ERROR,S=((h={})[w.NONE]={value:1,str:"N"},h[w.ERROR]={value:100,str:"E"},h[w.WARN]={value:200,str:"W"},h[w.INFO]={value:300,str:"I"},h[w.DEBUG]={value:400,str:"D"},h[w.VERBOSE]={value:500,str:"V"},h),W=function(){function we(L){if(this._name="kwai-v",this._level=I,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&location.protocol==="blob:"){var D,le=location.href.split("/"),oe=(D=le[le.length-1])==null?void 0:D.match(/(\w+)-/);oe&&(this._workerTag=L?L+"-"+oe[1]:oe[1])}else L&&(this._workerTag=L)}we.loadLogLevel=function(L,D){if(D===void 0&&(D=!0),location.href){var le=new RegExp(L+"=([a-z]{1})"),oe=location.href.match(le);if(oe&&oe.length>1){var Re=oe[1];if(this._isValueInLevel(Re))return Re}}var Oe=new F().read(L,D);if(this._isValueInLevel(Oe))return Oe},we.saveLogLevel=function(L,D){this._isValueInLevel(D)&&new F().write(L,D)},we._isValueInLevel=function(L){return Object.values(w).indexOf(L)!==-1};var ue=we.prototype;return ue.setOutput=function(L){return this._output=L,this},ue.setLevel=function(L){return this._level=L,this},ue.setId=function(L){return this._id=L,this},ue.setName=function(L){return this._name=L,this},ue.getLevel=function(){return this._level},ue.getOutput=function(){return this._output},ue.hasOutput=function(){return!!this._output},ue.e=function(L){if(this._isLevelEnabled(this._level,w.ERROR)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.ERROR,L,le);try{var Oe;(Oe=this._output)==null||Oe.e.apply(Oe,[Re].concat(le))}catch(de){}}},ue.w=function(L){if(this._isLevelEnabled(this._level,w.WARN)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.WARN,L,le);try{var Oe;(Oe=this._output)==null||Oe.w.apply(Oe,[Re].concat(le))}catch(de){}}},ue.i=function(L){if(this._isLevelEnabled(this._level,w.INFO)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.INFO,L,le);try{var Oe;(Oe=this._output)==null||Oe.i.apply(Oe,[Re].concat(le))}catch(de){}}},ue.d=function(L){if(this._isLevelEnabled(this._level,w.DEBUG)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.DEBUG,L,le);try{var Oe;(Oe=this._output)==null||Oe.d.apply(Oe,[Re].concat(le))}catch(de){}}},ue.v=function(L){if(this._isLevelEnabled(this._level,w.VERBOSE)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.VERBOSE,L,le);try{var Oe;(Oe=this._output)==null||Oe.v.apply(Oe,[Re].concat(le))}catch(de){}}},ue._isLevelEnabled=function(L,D){return S[L].value>=S[D].value},ue._printLog=function(L,D,le){var oe,Re,Oe=typeof D;if(Oe==="object")D=((Re=D)==null?void 0:Re.constructor.name)||"unknown";else if(Oe==="function"){var de;D=((de=Object.getOwnPropertyDescriptor(D,"name"))==null?void 0:de.value)||"unknown"}var $,ge,Pe=(((oe=S[L])==null?void 0:oe.str)||"")+"|"+this._name+"["+(typeof this._id=="function"?this._id():this._id)+"]["+this._workerTag+"]::"+D;return L===w.ERROR?($=console).error.apply($,[Pe].concat(le.slice(0))):(ge=console).log.apply(ge,[Pe].concat(le.slice(0))),Pe},we}(),j=new W,N=function(){return s()(function we(ue){this._logger=void 0,this._id=0,this._config=A,this._id=we._id,we._id++,this._logger=new W().setId(this._id).setLevel(w.INFO),this._config=m()({},A,ue)},[{key:"config",get:function(){return this._config}},{key:"logger",get:function(){return this._logger}},{key:"id",get:function(){return this._id}}],[{key:"packName",get:function(){return"ll_es"}},{key:"version",get:function(){return"1.0.13"}},{key:"buildTime",get:function(){return"Tue Oct 08 2024 17:18:49 GMT+0800 (中国标准时间)"}}])}();N._id=0;var K=n(4),z=n.n(K),B=n(2),J=n.n(B),be=function(){function we(L,D,le,oe,Re){var Oe=this;Re===void 0&&(Re=1),this._logger=void 0,this._name=void 0,this._storeName=void 0,this._dbIndex=void 0,this._version=void 0,this._taskQueue=[],this._openReq=void 0,this._isTransactionActive=!1,this._runTaskQueue=function(){for(;Oe._taskQueue.length;){var de=Oe._taskQueue.shift();de&&Oe.run(de.task,de.mode)}},this._logger=L,this._name=D,this._storeName=le,this._dbIndex=oe,this._version=Re}var ue=we.prototype;return ue.init=function(){var L=this;if(!this._openReq&&indexedDB){var D=this._openReq=indexedDB.open(this._name,this._version);this._logger.i("idb-wrapper","open",D),D.onerror=function(){L._logger.i("idb-wrapper","open error.")},D.onsuccess=function(){L._logger.i("idb-wrapper","open success."),L._runTaskQueue()},D.onupgradeneeded=function(){L._logger.i("idb-wrapper","open upgradeneeded."),D.result.objectStoreNames.contains(L._storeName)&&D.result.deleteObjectStore(L._storeName);var le=D.result.createObjectStore(L._storeName,{keyPath:"id",autoIncrement:!0});L._dbIndex&&L._dbIndex.forEach(function(oe){le.createIndex(oe.name,oe.keyPath,oe.option)})}}},ue.run=function(L,D){if(D===void 0&&(D="readwrite"),this.init(),this._openReq&&this._openReq.readyState==="done"&&!this._openReq.error)return this._doTask(L,D);this.state!=="error"&&(this._taskQueue.push({task:L,mode:D}),this._taskQueue.length>1e3&&this._taskQueue.shift())},ue.close=function(){var L=this;this._logger.i("idb-wrapper","close"),this._openReq&&(this._openReq.readyState==="done"?(this._openReq.result.close(),this._openReq=void 0):this._openReq.onsuccess=function(){L.close()})},ue.destroy=function(){this._logger.i("idb-wrapper","destroy"),this.close(),this._taskQueue=[]},ue._doTask=function(L,D){var le=this;if(D===void 0&&(D="readwrite"),this._openReq&&!this._openReq.error)try{this._isTransactionActive=!0;var oe=this._openReq.result.transaction(this._storeName,D),Re=void 0;oe.oncomplete=function(){le._isTransactionActive=!1,L.callback&&L.callback(Re),le._runTaskQueue()},oe.onabort=oe.onerror=function(){le._isTransactionActive=!1,L.callback&&L.callback(Re),le._runTaskQueue()},Re=L.exec(oe.objectStore(this._storeName))}catch(Oe){}else L.callback&&L.callback()},s()(we,[{key:"isTransactionActive",get:function(){return this._isTransactionActive}},{key:"state",get:function(){return this._openReq&&this._openReq.readyState==="done"?this._openReq.error?"error":"ready":"idle"}}])}(),X=[{name:"id",keyPath:"id",option:{unique:!0}}],ye=[function(){function we(L){this._ctx=void 0,this._idb=void 0,this._logCount=0,this._saveCount=0,this._reCountOnSaveCount=100,this._reduceData=!1,this._ctx=L,this._idb=new be(L.logger,L.config.idbName,L.config.idbName,X),this._reCountOnSaveCount=Math.min(200,Math.max(50,Math.round(this._ctx.config.idbMaxDataCount/10))),this._count()}we.isSupported=function(){return typeof indexedDB<"u"};var ue=we.prototype;return ue.saveLog=function(L){var D=this,le={exec:function(oe){return oe.add({value:L})},callback:function(oe){D._saveCount++,D._saveCount%D._reCountOnSaveCount==0&&D._count(),oe!=null&&oe.error&&D._ctx.logger.i("idb-backend","save log err",oe.error)}};this._idb.run(le)},ue.exportLog=function(){var L=z()(J.a.mark(function D(){var le=this;return J.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.abrupt("return",new Promise(function(Re,Oe){le._ctx.logger.i("idb-backend","export start");var de={exec:function($){return $.getAll()},callback:function($){Re($===void 0?"":le._mergeGetAll($.result))}};le._idb.run(de,"readonly")}));case 1:case"end":return oe.stop()}},D)}));return function(){return L.apply(this,arguments)}}(),ue.destroy=function(){this._idb.destroy()},ue.clean=function(){this._idb.run({exec:function(L){return L.clear()}})},ue._count=function(){var L=this,D={exec:function(le){return le.count()},callback:function(le){le!=null&&le.error||le==null||!le.result||(L._ctx.logger.i("idb-backend","count: "+le.result+" max: "+L._ctx.config.idbMaxDataCount),L._logCount=le.result,L._logCount>=L._ctx.config.idbMaxDataCount&&!L._reduceData&&L._deleteFromHead(L._logCount-Math.round(L._ctx.config.idbMaxDataCount/2)))}};this._idb.run(D)},ue._deleteFromHead=function(L){var D=this;this._ctx.logger.i("idb-backend","delete from head"),this._reduceData=!0;var le={exec:function(oe){return oe.openCursor()},callback:function(oe){if(D._reduceData=!1,oe!=null&&oe.result){var Re=IDBKeyRange.bound(oe.result.key,oe.result.key+L,!1,!1),Oe={exec:function(de){return D._ctx.logger.i("idb-backend","del: "+Re.lower+"~"+Re.upper),de.delete(Re)},callback:function(de){D._ctx.logger.i("idb-backend","del result: "+!(de==null||!de.error))}};D._idb.run(Oe)}}};this._idb.run(le)},ue._mergeGetAll=function(L){return L.length?L.reduce(function(D,le){return""+D+le.value+`
`},""):""},s()(we,[{key:"isActive",get:function(){return this._idb.state!=="error"}}])}()];function Be(we,ue,L){var D=new Date;typeof we!="string"&&(we=we.toString());var le=D.toLocaleString()+"."+D.getMilliseconds().toString().padStart(3,"0")+"|"+we+"|";return ue.forEach(function(oe){le+=typeof oe=="object"?JSON.stringify(oe)+" ":oe+" "}),le.length>L?le.substring(0,L):le}function Ve(we){return we.join(`
`)}var je=function(){function we(L){var D=this;this._ctx=void 0,this._backend=void 0,this._delayTimer=void 0,this._logCache=[],this._loggerForAdd=void 0,this._downloadHref=void 0,this._startDelay=function(){D._delayTimer=setInterval(function(){D._saveLog(!0)},1e3)},this._stopDelay=function(){D._delayTimer&&(clearTimeout(D._delayTimer),D._delayTimer=void 0)},T("kwai-video-local-log","1.0.13"),this._ctx=new N(L);var le=function(oe){for(var Re=arguments.length,Oe=new Array(Re>1?Re-1:0),de=1;de<Re;de++)Oe[de-1]=arguments[de];D.addLog.apply(D,[oe].concat(Oe))};this._loggerForAdd={e:le,w:le,i:le,d:le,v:le},this._ctx.logger.setOutput(this._loggerForAdd),this._ctx.logger.i("kwai-video-local-log","constructor",L,this._ctx.config),this._backend=function(oe){for(var Re=0;Re<ye.length;Re++){var Oe=ye[Re];if(Oe!=null&&Oe.isSupported())return new Oe(oe)}}(this._ctx),this._backend&&this._startDelay()}we.isSupported=function(){return function(){for(var L=0;L<ye.length;L++){var D=ye[L];if(D!=null&&D.isSupported())return!0}return!1}()};var ue=we.prototype;return ue.addLog=function(L){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];this._logCache.push(Be(L,le,this._ctx.config.maxLogLen)),this._saveLog()},ue.cleanLog=function(){var L;this._ctx.logger.i("kwai-video-local-log","clean"),(L=this._backend)==null||L.clean()},ue.exportLog=function(){var L=this;return this._ctx.logger.i("kwai-video-local-log","export log"),new Promise(function(D,le){L._backend?L._backend.exportLog().then(function(oe){D(Ve([oe].concat(L._logCache)))}):D("")})},ue.downloadLog=function(L){var D=this;this._ctx.logger.i("kwai-video-local-log","download log: "+L),this._destroyDownloadHref(),this.exportLog().then(function(le){var oe=new Blob([le],{type:"text/plain"});if(document){var Re=document.createElement("a");D._downloadHref=Re.href=URL.createObjectURL(oe),Re.download=L||"Log_web_"+new Date().toLocaleString()+".log",document.body.appendChild(Re),Re.click(),Re.remove()}else console.log("无document,当前是否在worker中")})},ue.destroy=function(){var L;this._destroyDownloadHref(),(L=this._backend)==null||L.destroy(),this._stopDelay()},ue.getLoggerForAdd=function(){return this._loggerForAdd},ue._destroyDownloadHref=function(){try{this._downloadHref&&(URL.revokeObjectURL(this._downloadHref),this._downloadHref=void 0)}catch(L){}},ue._saveLog=function(L){if(L===void 0&&(L=!1),this._backend&&this._backend.isActive&&(this._logCache.length>=this._ctx.config.idbMaxFoldLog||this._logCache.length>0&&L)){var D=Ve(this._logCache);this._logCache.splice(0,this._logCache.length),D&&this._backend.saveLog(D)}},s()(we,null,[{key:"version",get:function(){return"1.0.13"}}])}();i.default=je}]);ln===void 0&&console.error("esm-webpack-plugin: nothing exported!"),ln.KwaiVideoLocalLog;const qa=ln.LogLevel,ci=ln.DefaultLogger,un=ln.Logger,Ca=ln.printVersion;ln.DEFAULT_LOG_LEVEL,ln.default;var Jp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e_(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Xs={exports:{}},oa=typeof Reflect=="object"?Reflect:null,Ic=oa&&typeof oa.apply=="function"?oa.apply:function(r,i,n){return Function.prototype.apply.call(r,i,n)},Ja;oa&&typeof oa.ownKeys=="function"?Ja=oa.ownKeys:Object.getOwnPropertySymbols?Ja=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Ja=function(r){return Object.getOwnPropertyNames(r)};function t_(r){console&&console.warn&&console.warn(r)}var Rc=Number.isNaN||function(r){return r!==r};function Zt(){Zt.init.call(this)}Xs.exports=Zt,Xs.exports.once=a_,Zt.EventEmitter=Zt,Zt.prototype._events=void 0,Zt.prototype._eventsCount=0,Zt.prototype._maxListeners=void 0;var wc=10;function es(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Zt,"defaultMaxListeners",{enumerable:!0,get:function(){return wc},set:function(r){if(typeof r!="number"||r<0||Rc(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");wc=r}}),Zt.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},Zt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||Rc(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function Dc(r){return r._maxListeners===void 0?Zt.defaultMaxListeners:r._maxListeners}Zt.prototype.getMaxListeners=function(){return Dc(this)},Zt.prototype.emit=function(r){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var o=r==="error",s=this._events;if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var d;if(i.length>0&&(d=i[0]),d instanceof Error)throw d;var m=new Error("Unhandled error."+(d?" ("+d.message+")":""));throw m.context=d,m}var A=s[r];if(A===void 0)return!1;if(typeof A=="function")Ic(A,this,i);else for(var T=A.length,C=xc(A,T),n=0;n<T;++n)Ic(C[n],this,i);return!0};function Lc(r,i,n,o){var s,d,m;if(es(n),d=r._events,d===void 0?(d=r._events=Object.create(null),r._eventsCount=0):(d.newListener!==void 0&&(r.emit("newListener",i,n.listener?n.listener:n),d=r._events),m=d[i]),m===void 0)m=d[i]=n,++r._eventsCount;else if(typeof m=="function"?m=d[i]=o?[n,m]:[m,n]:o?m.unshift(n):m.push(n),s=Dc(r),s>0&&m.length>s&&!m.warned){m.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+m.length+" "+String(i)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=r,A.type=i,A.count=m.length,t_(A)}return r}Zt.prototype.addListener=function(r,i){return Lc(this,r,i,!1)},Zt.prototype.on=Zt.prototype.addListener,Zt.prototype.prependListener=function(r,i){return Lc(this,r,i,!0)};function i_(){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 Sc(r,i,n){var o={fired:!1,wrapFn:void 0,target:r,type:i,listener:n},s=i_.bind(o);return s.listener=n,o.wrapFn=s,s}Zt.prototype.once=function(r,i){return es(i),this.on(r,Sc(this,r,i)),this},Zt.prototype.prependOnceListener=function(r,i){return es(i),this.prependListener(r,Sc(this,r,i)),this},Zt.prototype.removeListener=function(r,i){var n,o,s,d,m;if(es(i),o=this._events,o===void 0)return this;if(n=o[r],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete o[r],o.removeListener&&this.emit("removeListener",r,n.listener||i));else if(typeof n!="function"){for(s=-1,d=n.length-1;d>=0;d--)if(n[d]===i||n[d].listener===i){m=n[d].listener,s=d;break}if(s<0)return this;s===0?n.shift():r_(n,s),n.length===1&&(o[r]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",r,m||i)}return this},Zt.prototype.off=Zt.prototype.removeListener,Zt.prototype.removeAllListeners=function(r){var i,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[r]),this;if(arguments.length===0){var s=Object.keys(n),d;for(o=0;o<s.length;++o)d=s[o],d!=="removeListener"&&this.removeAllListeners(d);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[r],typeof i=="function")this.removeListener(r,i);else if(i!==void 0)for(o=i.length-1;o>=0;o--)this.removeListener(r,i[o]);return this};function Oc(r,i,n){var o=r._events;if(o===void 0)return[];var s=o[i];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?n_(s):xc(s,s.length)}Zt.prototype.listeners=function(r){return Oc(this,r,!0)},Zt.prototype.rawListeners=function(r){return Oc(this,r,!1)},Zt.listenerCount=function(r,i){return typeof r.listenerCount=="function"?r.listenerCount(i):Nc.call(r,i)},Zt.prototype.listenerCount=Nc;function Nc(r){var i=this._events;if(i!==void 0){var n=i[r];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Zt.prototype.eventNames=function(){return this._eventsCount>0?Ja(this._events):[]};function xc(r,i){for(var n=new Array(i),o=0;o<i;++o)n[o]=r[o];return n}function r_(r,i){for(;i+1<r.length;i++)r[i]=r[i+1];r.pop()}function n_(r){for(var i=new Array(r.length),n=0;n<i.length;++n)i[n]=r[n].listener||r[n];return i}function a_(r,i){return new Promise(function(n,o){function s(m){r.removeListener(i,d),o(m)}function d(){typeof r.removeListener=="function"&&r.removeListener("error",s),n([].slice.call(arguments))}kc(r,i,d,{once:!0}),i!=="error"&&s_(r,s,{once:!0})})}function s_(r,i,n){typeof r.on=="function"&&kc(r,"error",i,n)}function kc(r,i,n,o){if(typeof r.on=="function")o.once?r.once(i,n):r.on(i,n);else if(typeof r.addEventListener=="function")r.addEventListener(i,function s(d){o.once&&r.removeEventListener(i,s),n(d)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var o_=Xs.exports,Mc=function(){if(typeof Map<"u")return Map;function r(i,n){var o=-1;return i.some(function(s,d){return s[0]===n?(o=d,!0):!1}),o}return function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(n){var o=r(this.__entries__,n),s=this.__entries__[o];return s&&s[1]},i.prototype.set=function(n,o){var s=r(this.__entries__,n);~s?this.__entries__[s][1]=o:this.__entries__.push([n,o])},i.prototype.delete=function(n){var o=this.__entries__,s=r(o,n);~s&&o.splice(s,1)},i.prototype.has=function(n){return!!~r(this.__entries__,n)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(n,o){o===void 0&&(o=null);for(var s=0,d=this.__entries__;s<d.length;s++){var m=d[s];n.call(o,m[1],m[0])}},i}()}(),Zs=typeof window<"u"&&typeof document<"u"&&window.document===document,ts=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),c_=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ts):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}}(),l_=2;function u_(r,i){var n=!1,o=!1,s=0;function d(){n&&(n=!1,r()),o&&A()}function m(){c_(d)}function A(){var T=Date.now();if(n){if(T-s<l_)return;o=!0}else n=!0,o=!1,setTimeout(m,i);s=T}return A}var h_=20,d_=["top","right","bottom","left","width","height","size","weight"],f_=typeof MutationObserver<"u",p_=function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=u_(this.refresh.bind(this),h_)}return r.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},r.prototype.removeObserver=function(i){var n=this.observers_,o=n.indexOf(i);~o&&n.splice(o,1),!n.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},r.prototype.updateObservers_=function(){var i=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return i.forEach(function(n){return n.broadcastActive()}),i.length>0},r.prototype.connect_=function(){!Zs||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),f_?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!Zs||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(i){var n=i.propertyName,o=n===void 0?"":n,s=d_.some(function(d){return!!~o.indexOf(d)});s&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),Pc=function(r,i){for(var n=0,o=Object.keys(i);n<o.length;n++){var s=o[n];Object.defineProperty(r,s,{value:i[s],enumerable:!1,writable:!1,configurable:!0})}return r},ca=function(r){var i=r&&r.ownerDocument&&r.ownerDocument.defaultView;return i||ts},Uc=rs(0,0,0,0);function is(r){return parseFloat(r)||0}function Bc(r){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];return i.reduce(function(o,s){var d=r["border-"+s+"-width"];return o+is(d)},0)}function __(r){for(var i=["top","right","bottom","left"],n={},o=0,s=i;o<s.length;o++){var d=s[o],m=r["padding-"+d];n[d]=is(m)}return n}function A_(r){var i=r.getBBox();return rs(0,0,i.width,i.height)}function v_(r){var i=r.clientWidth,n=r.clientHeight;if(!i&&!n)return Uc;var o=ca(r).getComputedStyle(r),s=__(o),d=s.left+s.right,m=s.top+s.bottom,A=is(o.width),T=is(o.height);if(o.boxSizing==="border-box"&&(Math.round(A+d)!==i&&(A-=Bc(o,"left","right")+d),Math.round(T+m)!==n&&(T-=Bc(o,"top","bottom")+m)),!m_(r)){var C=Math.round(A+d)-i,h=Math.round(T+m)-n;Math.abs(C)!==1&&(A-=C),Math.abs(h)!==1&&(T-=h)}return rs(s.left,s.top,A,T)}var g_=function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof ca(r).SVGGraphicsElement}:function(r){return r instanceof ca(r).SVGElement&&typeof r.getBBox=="function"}}();function m_(r){return r===ca(r).document.documentElement}function b_(r){return Zs?g_(r)?A_(r):v_(r):Uc}function E_(r){var i=r.x,n=r.y,o=r.width,s=r.height,d=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(d.prototype);return Pc(m,{x:i,y:n,width:o,height:s,top:n,right:i+o,bottom:s+n,left:i}),m}function rs(r,i,n,o){return{x:r,y:i,width:n,height:o}}var y_=function(){function r(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=rs(0,0,0,0),this.target=i}return r.prototype.isActive=function(){var i=b_(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},r}(),C_=function(){function r(i,n){var o=E_(n);Pc(this,{target:i,contentRect:o})}return r}(),T_=function(){function r(i,n,o){if(this.activeObservations_=[],this.observations_=new Mc,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=n,this.callbackCtx_=o}return r.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof ca(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(i)||(n.set(i,new y_(i)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof ca(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(i)&&(n.delete(i),n.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&i.activeObservations_.push(n)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var i=this.callbackCtx_,n=this.activeObservations_.map(function(o){return new C_(o.target,o.broadcastRect())});this.callback_.call(i,n,i),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r}(),Vc=typeof WeakMap<"u"?new WeakMap:new Mc,Fc=function(){function r(i){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=p_.getInstance(),o=new T_(i,n,this);Vc.set(this,o)}return r}();["observe","unobserve","disconnect"].forEach(function(r){Fc.prototype[r]=function(){var i;return(i=Vc.get(this))[r].apply(i,arguments)}}),function(){return typeof ts.ResizeObserver<"u"?ts.ResizeObserver:Fc}();var jc={},I_=Object.prototype.hasOwnProperty,R_;function Hc(r){try{return decodeURIComponent(r.replace(/\+/g," "))}catch(i){return null}}function Gc(r){try{return encodeURIComponent(r)}catch(i){return null}}function w_(r){for(var i=/([^=?#&]+)=?([^&]*)/g,n={},o;o=i.exec(r);){var s=Hc(o[1]),d=Hc(o[2]);s===null||d===null||s in n||(n[s]=d)}return n}function D_(r,i){i=i||"";var n=[],o,s;typeof i!="string"&&(i="?");for(s in r)if(I_.call(r,s)){if(o=r[s],!o&&(o===null||o===R_||isNaN(o))&&(o=""),s=Gc(s),o=Gc(o),s===null||o===null)continue;n.push(s+"="+o)}return n.length?i+n.join("&"):""}jc.stringify=D_,jc.parse=w_;var la=function(r){var i={};function n(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=r,n.c=i,n.d=function(o,s,d){n.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:d})},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n.t=function(o,s){if(1&s&&(o=n(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(n.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var m in o)n.d(d,m,function(A){return o[A]}.bind(null,m));return d},n.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(s,"a",s),s},n.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},n.p="",n(n.s=4)}([function(r,i){function n(o){return r.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,n(o)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(2);function s(d,m){for(var A=0;A<m.length;A++){var T=m[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,o(T.key),T)}}r.exports=function(d,m,A){return m&&s(d.prototype,m),A&&s(d,A),Object.defineProperty(d,"prototype",{writable:!1}),d},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(0).default,s=n(3);r.exports=function(d){var m=s(d,"string");return o(m)=="symbol"?m:m+""},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(0).default;r.exports=function(s,d){if(o(s)!="object"||!s)return s;var m=s[Symbol.toPrimitive];if(m!==void 0){var A=m.call(s,d||"default");if(o(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){function o(S,W){console.log("%c "+S+" %c "+W+" %c","background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px; color: #fff","background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0; color: #fff","background:transparent")}n.r(i),n.d(i,"LogLevel",function(){return C}),n.d(i,"DefaultLogger",function(){return I}),n.d(i,"Logger",function(){return w}),n.d(i,"printVersion",function(){return o}),n.d(i,"DEFAULT_LOG_LEVEL",function(){return h});var s=n(1),d=n.n(s),m=function(){function S(){this.timeout=6048e5}var W=S.prototype;return W.write=function(j,N){if(S.available)try{localStorage.setItem(j,JSON.stringify({value:N,time:Date.now()}))}catch(K){}},W.read=function(j,N){if(N===void 0&&(N=!0),S.available)try{var K=localStorage.getItem(j);if(K){var z=JSON.parse(K),B=z.value,J=z.time,be=J===void 0?0:J;if(!N||Date.now()-be<(typeof N=="number"?N:this.timeout))return B}}catch(X){}},d()(S,null,[{key:"available",get:function(){if(S._available===void 0)try{localStorage.setItem("alg","test"),S._available=!0}catch(j){S._available=!1}return S._available}}])}();m._available=void 0;var A,T=m,C=function(S){return S.NONE="none",S.ERROR="e",S.WARN="w",S.INFO="i",S.DEBUG="d",S.VERBOSE="v",S}({}),h=C.ERROR,F=((A={})[C.NONE]={value:1,str:"N"},A[C.ERROR]={value:100,str:"E"},A[C.WARN]={value:200,str:"W"},A[C.INFO]={value:300,str:"I"},A[C.DEBUG]={value:400,str:"D"},A[C.VERBOSE]={value:500,str:"V"},A),w=function(){function S(j){if(this._name="kwai-v",this._level=h,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&location.protocol==="blob:"){var N,K=location.href.split("/"),z=(N=K[K.length-1])==null?void 0:N.match(/(\w+)-/);z&&(this._workerTag=j?j+"-"+z[1]:z[1])}else j&&(this._workerTag=j)}S.loadLogLevel=function(j,N){if(N===void 0&&(N=!0),location.href){var K=new RegExp(j+"=([a-z]{1})"),z=location.href.match(K);if(z&&z.length>1){var B=z[1];if(this._isValueInLevel(B))return B}}var J=new T().read(j,N);if(this._isValueInLevel(J))return J},S.saveLogLevel=function(j,N){this._isValueInLevel(N)&&new T().write(j,N)},S._isValueInLevel=function(j){return Object.values(C).indexOf(j)!==-1};var W=S.prototype;return W.setOutput=function(j){return this._output=j,this},W.setLevel=function(j){return this._level=j,this},W.setId=function(j){return this._id=j,this},W.setName=function(j){return this._name=j,this},W.getLevel=function(){return this._level},W.getOutput=function(){return this._output},W.hasOutput=function(){return!!this._output},W.e=function(j){if(this._isLevelEnabled(this._level,C.ERROR)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.ERROR,j,K);try{var J;(J=this._output)==null||J.e.apply(J,[B].concat(K))}catch(be){}}},W.w=function(j){if(this._isLevelEnabled(this._level,C.WARN)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.WARN,j,K);try{var J;(J=this._output)==null||J.w.apply(J,[B].concat(K))}catch(be){}}},W.i=function(j){if(this._isLevelEnabled(this._level,C.INFO)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.INFO,j,K);try{var J;(J=this._output)==null||J.i.apply(J,[B].concat(K))}catch(be){}}},W.d=function(j){if(this._isLevelEnabled(this._level,C.DEBUG)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.DEBUG,j,K);try{var J;(J=this._output)==null||J.d.apply(J,[B].concat(K))}catch(be){}}},W.v=function(j){if(this._isLevelEnabled(this._level,C.VERBOSE)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.VERBOSE,j,K);try{var J;(J=this._output)==null||J.v.apply(J,[B].concat(K))}catch(be){}}},W._isLevelEnabled=function(j,N){return F[j].value>=F[N].value},W._printLog=function(j,N,K){var z,B,J=typeof N;if(J==="object")N=((B=N)==null?void 0:B.constructor.name)||"unknown";else if(J==="function"){var be;N=((be=Object.getOwnPropertyDescriptor(N,"name"))==null?void 0:be.value)||"unknown"}var X,ye,Be=(((z=F[j])==null?void 0:z.str)||"")+"|"+this._name+"["+(typeof this._id=="function"?this._id():this._id)+"]["+this._workerTag+"]::"+N;return j===C.ERROR?(X=console).error.apply(X,[Be].concat(K.slice(0))):(ye=console).log.apply(ye,[Be].concat(K.slice(0))),Be},S}(),I=new w}]);la===void 0&&console.error("esm-webpack-plugin: nothing exported!"),la.LogLevel;const Ta=la.DefaultLogger;la.Logger,la.printVersion,la.DEFAULT_LOG_LEVEL;/*! js-cookie v3.0.5 | MIT */function ns(r){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var o in n)r[o]=n[o]}return r}var L_={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function qs(r,i){function n(s,d,m){if(!(typeof document>"u")){m=ns({},i,m),typeof m.expires=="number"&&(m.expires=new Date(Date.now()+m.expires*864e5)),m.expires&&(m.expires=m.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var A="";for(var T in m)m[T]&&(A+="; "+T,m[T]!==!0&&(A+="="+m[T].split(";")[0]));return document.cookie=s+"="+r.write(d,s)+A}}function o(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var d=document.cookie?document.cookie.split("; "):[],m={},A=0;A<d.length;A++){var T=d[A].split("="),C=T.slice(1).join("=");try{var h=decodeURIComponent(T[0]);if(m[h]=r.read(C,h),s===h)break}catch(F){}}return s?m[s]:m}}return Object.create({set:n,get:o,remove:function(s,d){n(s,"",ns({},d,{expires:-1}))},withAttributes:function(s){return qs(this.converter,ns({},this.attributes,s))},withConverter:function(s){return qs(ns({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(r)}})}var Js=qs(L_,{path:"/"});const Ia="did",eo="kwai_player_device_id";function zc(){try{const r=Math.random()*1e9>>>0,i=[],n="0123456789ABCDEF";for(let s=0;s<7;s++)i.push(n.charAt(Math.random()*16));const o=`web_${r}${i.join("")}`;return Ta.i(Ia,"generate nanoId",o),o}catch(r){}return"web_did_generation_failed"}function S_(){let r="";try{r=(Js.get("did")||Js.get("_did")||Js.get("weblogger_did")||"").trim(),Ta.i(Ia,"generate deviceId from cookie",r)}catch(i){Ta.i(Ia,"generate deviceId from cookie err",i)}try{r?localStorage==null||localStorage.setItem(eo,r):(r=((localStorage==null?void 0:localStorage.getItem(eo))||"").trim(),Ta.i(Ia,"generate deviceId from ls",r)),r||(r=zc(),localStorage==null||localStorage.setItem(eo,r))}catch(i){Ta.i(Ia,"generate deviceId from ls err",i)}return r||zc()}S_();const Kc=class na{constructor(){ya(this,"timeout",7*24*3600*1e3)}write(i,n){if(na.available)try{localStorage.setItem(i,JSON.stringify({value:n,time:Date.now()}))}catch(o){}}read(i,n=!0){if(na.available)try{const o=localStorage.getItem(i);if(o){const{value:s,time:d=0}=JSON.parse(o);if(!n||Date.now()-d<(typeof n=="number"?n:this.timeout))return s}}catch(o){}}static get available(){if(typeof na._available>"u")try{localStorage.setItem("alg","test"),na._available=!0}catch(i){na._available=!1}return na._available}};ya(Kc,"_available");let Wc=Kc;var to={exports:{}};(function(r,i){(function(n,o){var s="1.0.2",d="",m="?",A="function",T="undefined",C="object",h="string",F="major",w="model",I="name",S="type",W="vendor",j="version",N="architecture",K="console",z="mobile",B="tablet",J="smarttv",be="wearable",X="embedded",ye=255,Be="Amazon",Ve="Apple",je="ASUS",we="BlackBerry",ue="Browser",L="Chrome",D="Edge",le="Firefox",oe="Google",Re="Huawei",Oe="LG",de="Microsoft",$="Motorola",ge="Opera",Pe="Samsung",ae="Sony",q="Xiaomi",b="Zebra",ve="Facebook",U=function(te,ie){var ee={};for(var Te in te)ie[Te]&&ie[Te].length%2===0?ee[Te]=ie[Te].concat(te[Te]):ee[Te]=te[Te];return ee},M=function(te){for(var ie={},ee=0;ee<te.length;ee++)ie[te[ee].toUpperCase()]=te[ee];return ie},ne=function(te,ie){return typeof te===h?Le(ie).indexOf(Le(te))!==-1:!1},Le=function(te){return te.toLowerCase()},Ue=function(te){return typeof te===h?te.replace(/[^\d\.]/g,d).split(".")[0]:o},re=function(te,ie){if(typeof te===h)return te=te.replace(/^\s\s*/,d).replace(/\s\s*$/,d),typeof ie===T?te:te.substring(0,ye)},k=function(te,ie){for(var ee=0,Te,Se,Ye,ze,it,ct;ee<ie.length&&!it;){var nt=ie[ee],Wt=ie[ee+1];for(Te=Se=0;Te<nt.length&&!it;)if(it=nt[Te++].exec(te),it)for(Ye=0;Ye<Wt.length;Ye++)ct=it[++Se],ze=Wt[Ye],typeof ze===C&&ze.length>0?ze.length===2?typeof ze[1]==A?this[ze[0]]=ze[1].call(this,ct):this[ze[0]]=ze[1]:ze.length===3?typeof ze[1]===A&&!(ze[1].exec&&ze[1].test)?this[ze[0]]=ct?ze[1].call(this,ct,ze[2]):o:this[ze[0]]=ct?ct.replace(ze[1],ze[2]):o:ze.length===4&&(this[ze[0]]=ct?ze[3].call(this,ct.replace(ze[1],ze[2])):o):this[ze]=ct||o;ee+=2}},P=function(te,ie){for(var ee in ie)if(typeof ie[ee]===C&&ie[ee].length>0){for(var Te=0;Te<ie[ee].length;Te++)if(ne(ie[ee][Te],te))return ee===m?o:ee}else if(ne(ie[ee],te))return ee===m?o:ee;return te},Z={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},he={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ie={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[j,[I,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[j,[I,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[I,j],[/opios[\/ ]+([\w\.]+)/i],[j,[I,ge+" Mini"]],[/\bopr\/([\w\.]+)/i],[j,[I,ge]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[I,j],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[j,[I,"UC"+ue]],[/\bqbcore\/([\w\.]+)/i],[j,[I,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[j,[I,"WeChat"]],[/konqueror\/([\w\.]+)/i],[j,[I,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[j,[I,"IE"]],[/yabrowser\/([\w\.]+)/i],[j,[I,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[I,/(.+)/,"$1 Secure "+ue],j],[/\bfocus\/([\w\.]+)/i],[j,[I,le+" Focus"]],[/\bopt\/([\w\.]+)/i],[j,[I,ge+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[j,[I,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[j,[I,"Dolphin"]],[/coast\/([\w\.]+)/i],[j,[I,ge+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[j,[I,"MIUI "+ue]],[/fxios\/([-\w\.]+)/i],[j,[I,le]],[/\bqihu|(qi?ho?o?|360)browser/i],[[I,"360 "+ue]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[I,/(.+)/,"$1 "+ue],j],[/(comodo_dragon)\/([\w\.]+)/i],[[I,/_/g," "],j],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[I,j],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[I],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[I,ve],j],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[I,j],[/\bgsa\/([\w\.]+) .*safari\//i],[j,[I,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[j,[I,L+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[I,L+" WebView"],j],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[j,[I,"Android "+ue]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[I,j],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[j,[I,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[j,I],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[I,[j,P,Z]],[/(webkit|khtml)\/([\w\.]+)/i],[I,j],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[I,"Netscape"],j],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[j,[I,le+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[I,j]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,Le]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,d,Le]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,Le]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[w,[W,Pe],[S,B]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[w,[W,Pe],[S,z]],[/\((ip(?:hone|od)[\w ]*);/i],[w,[W,Ve],[S,z]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[w,[W,Ve],[S,B]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[w,[W,Re],[S,B]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[w,[W,Re],[S,z]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[w,/_/g," "],[W,q],[S,z]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[w,/_/g," "],[W,q],[S,B]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[w,[W,"OPPO"],[S,z]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[w,[W,"Vivo"],[S,z]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[w,[W,"Realme"],[S,z]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[w,[W,$],[S,z]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[w,[W,$],[S,B]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[w,[W,Oe],[S,B]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[w,[W,Oe],[S,z]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[w,[W,"Lenovo"],[S,B]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[w,/_/g," "],[W,"Nokia"],[S,z]],[/(pixel c)\b/i],[w,[W,oe],[S,B]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[w,[W,oe],[S,z]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[w,[W,ae],[S,z]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[w,"Xperia Tablet"],[W,ae],[S,B]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[w,[W,"OnePlus"],[S,z]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[w,[W,Be],[S,B]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[w,/(.+)/g,"Fire Phone $1"],[W,Be],[S,z]],[/(playbook);[-\w\),; ]+(rim)/i],[w,W,[S,B]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[w,[W,we],[S,z]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[w,[W,je],[S,B]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[w,[W,je],[S,z]],[/(nexus 9)/i],[w,[W,"HTC"],[S,B]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[W,[w,/_/g," "],[S,z]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[w,[W,"Acer"],[S,B]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[w,[W,"Meizu"],[S,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[w,[W,"Sharp"],[S,z]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[W,w,[S,z]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[W,w,[S,B]],[/(surface duo)/i],[w,[W,de],[S,B]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[w,[W,"Fairphone"],[S,z]],[/(u304aa)/i],[w,[W,"AT&T"],[S,z]],[/\bsie-(\w*)/i],[w,[W,"Siemens"],[S,z]],[/\b(rct\w+) b/i],[w,[W,"RCA"],[S,B]],[/\b(venue[\d ]{2,7}) b/i],[w,[W,"Dell"],[S,B]],[/\b(q(?:mv|ta)\w+) b/i],[w,[W,"Verizon"],[S,B]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[w,[W,"Barnes & Noble"],[S,B]],[/\b(tm\d{3}\w+) b/i],[w,[W,"NuVision"],[S,B]],[/\b(k88) b/i],[w,[W,"ZTE"],[S,B]],[/\b(nx\d{3}j) b/i],[w,[W,"ZTE"],[S,z]],[/\b(gen\d{3}) b.+49h/i],[w,[W,"Swiss"],[S,z]],[/\b(zur\d{3}) b/i],[w,[W,"Swiss"],[S,B]],[/\b((zeki)?tb.*\b) b/i],[w,[W,"Zeki"],[S,B]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[W,"Dragon Touch"],w,[S,B]],[/\b(ns-?\w{0,9}) b/i],[w,[W,"Insignia"],[S,B]],[/\b((nxa|next)-?\w{0,9}) b/i],[w,[W,"NextBook"],[S,B]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[W,"Voice"],w,[S,z]],[/\b(lvtel\-)?(v1[12]) b/i],[[W,"LvTel"],w,[S,z]],[/\b(ph-1) /i],[w,[W,"Essential"],[S,z]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[w,[W,"Envizen"],[S,B]],[/\b(trio[-\w\. ]+) b/i],[w,[W,"MachSpeed"],[S,B]],[/\btu_(1491) b/i],[w,[W,"Rotor"],[S,B]],[/(shield[\w ]+) b/i],[w,[W,"Nvidia"],[S,B]],[/(sprint) (\w+)/i],[W,w,[S,z]],[/(kin\.[onetw]{3})/i],[[w,/\./g," "],[W,de],[S,z]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[w,[W,b],[S,B]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[w,[W,b],[S,z]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[W,w,[S,K]],[/droid.+; (shield) bui/i],[w,[W,"Nvidia"],[S,K]],[/(playstation [345portablevi]+)/i],[w,[W,ae],[S,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[w,[W,de],[S,K]],[/smart-tv.+(samsung)/i],[W,[S,J]],[/hbbtv.+maple;(\d+)/i],[[w,/^/,"SmartTV"],[W,Pe],[S,J]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[W,Oe],[S,J]],[/(apple) ?tv/i],[W,[w,Ve+" TV"],[S,J]],[/crkey/i],[[w,L+"cast"],[W,oe],[S,J]],[/droid.+aft(\w)( bui|\))/i],[w,[W,Be],[S,J]],[/\(dtv[\);].+(aquos)/i],[w,[W,"Sharp"],[S,J]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[W,re],[w,re],[S,J]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,J]],[/((pebble))app/i],[W,w,[S,be]],[/droid.+; (glass) \d/i],[w,[W,oe],[S,be]],[/droid.+; (wt63?0{2,3})\)/i],[w,[W,b],[S,be]],[/(quest( 2)?)/i],[w,[W,ve],[S,be]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[W,[S,X]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[w,[S,z]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[w,[S,B]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,B]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[S,z]],[/(android[-\w\. ]{0,9});.+buil/i],[w,[W,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[j,[I,D+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[j,[I,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[I,j],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[j,I]],os:[[/microsoft (windows) (vista|xp)/i],[I,j],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[I,[j,P,he]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[I,"Windows"],[j,P,he]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[j,/_/g,"."],[I,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[I,"Mac OS"],[j,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[j,I],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[I,j],[/\(bb(10);/i],[j,[I,we]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[j,[I,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[j,[I,le+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[j,[I,"webOS"]],[/crkey\/([\d\.]+)/i],[j,[I,L+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[I,"Chromium OS"],j],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[I,j],[/(sunos) ?([\w\.\d]*)/i],[[I,"Solaris"],j],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[I,j]]},Ee=function(te,ie){if(typeof te===C&&(ie=te,te=o),!(this instanceof Ee))return new Ee(te,ie).getResult();var ee=te||(typeof n!==T&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:d),Te=ie?U(Ie,ie):Ie;return this.getBrowser=function(){var Se={};return Se[I]=o,Se[j]=o,k.call(Se,ee,Te.browser),Se.major=Ue(Se.version),Se},this.getCPU=function(){var Se={};return Se[N]=o,k.call(Se,ee,Te.cpu),Se},this.getDevice=function(){var Se={};return Se[W]=o,Se[w]=o,Se[S]=o,k.call(Se,ee,Te.device),Se},this.getEngine=function(){var Se={};return Se[I]=o,Se[j]=o,k.call(Se,ee,Te.engine),Se},this.getOS=function(){var Se={};return Se[I]=o,Se[j]=o,k.call(Se,ee,Te.os),Se},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ee},this.setUA=function(Se){return ee=typeof Se===h&&Se.length>ye?re(Se,ye):Se,this},this.setUA(ee),this};Ee.VERSION=s,Ee.BROWSER=M([I,j,F]),Ee.CPU=M([N]),Ee.DEVICE=M([w,W,S,K,z,J,B,be,X]),Ee.ENGINE=Ee.OS=M([I,j]),r.exports&&(i=r.exports=Ee),i.UAParser=Ee;var pe=typeof n!==T&&(n.jQuery||n.Zepto);if(pe&&!pe.ua){var G=new Ee;pe.ua=G.getResult(),pe.ua.get=function(){return G.getUA()},pe.ua.set=function(te){G.setUA(te);var ie=G.getResult();for(var ee in ie)pe.ua[ee]=ie[ee]}}})(typeof window=="object"?window:Jp)})(to,to.exports);var O_=to.exports;const N_=e_(O_);let as=0;function x_(){return as=as?as+1:Date.now(),`c-${as}`}const hn=N_(),ss=hn.os.name,k_=ss&&ss.toLowerCase().indexOf("android")>=0,M_=ss&&ss.toLowerCase().indexOf("ios")>=0,ua=hn.device.type==="mobile"||k_||M_,Yc="kwai-p";let io=qa.ERROR;typeof location<"u"&&(io=un.loadLogLevel("kwai-player-log")||qa.ERROR,ci.setLevel(io).setName(Yc));const Qc=o_.EventEmitter;(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._kwai-player_1ufc0_2{position:relative;margin:0;padding:0}._kwai-player_1ufc0_2 *{margin:0;padding:0}._kwai-player-video-interactive_1ufc0_11{display:block;width:100%;height:100%;position:absolute;top:0;left:0}._kwai-player-poster_1ufc0_19{width:100%;height:100%;position:absolute;left:0;top:0;background-color:#333;background-size:contain;background-position:center;background-repeat:no-repeat}._kwai-player-video_1ufc0_11{display:block;width:100%;height:100%;position:absolute;top:0;left:0}._kwai-player-video_1ufc0_11 video{display:block;width:100%;height:100%}._kwai-player-video_1ufc0_11 canvas{display:block;margin:0 auto;width:100%;height:100%;max-width:100%;max-height:100%;position:relative}._kwai-player-disable-scroll_1ufc0_52{overflow:hidden;height:100%}._kwai-player-yoda_1ufc0_56{display:block;width:100%;height:100%;position:absolute;top:0;left:0}")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var P_=Object.defineProperty,U_=(r,i,n)=>i in r?P_(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,tt=(r,i,n)=>(U_(r,typeof i!="symbol"?i+"":i,n),n),Kn=(r=>(r.NONE="none",r.KWAI="kwai",r.KWAI2="kwai2",r))(Kn||{}),Zr=(r=>(r.SYSTEM="system",r.WINDOW="window",r))(Zr||{}),Ra=(r=>(r.VIDEO="video",r.VIDEO_INTERACTIVE="videoInteractive",r.DEFAULT="default",r))(Ra||{}),We=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(We||{});/*! For license information please see no-wasm-hdr.mjs.LICENSE.txt */var fi=function(r){var i={};function n(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=r,n.c=i,n.d=function(o,s,d){n.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:d})},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n.t=function(o,s){if(1&s&&(o=n(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(n.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var m in o)n.d(d,m,function(A){return o[A]}.bind(null,m));return d},n.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(s,"a",s),s},n.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},n.p="",n(n.s=62)}([function(r,i,n){n.d(i,"c",function(){return o}),n.d(i,"q",function(){return s}),n.d(i,"t",function(){return d}),n.d(i,"s",function(){return m}),n.d(i,"b",function(){return A}),n.d(i,"d",function(){return T}),n.d(i,"l",function(){return C}),n.d(i,"i",function(){return h}),n.d(i,"k",function(){return F}),n.d(i,"r",function(){return w}),n.d(i,"p",function(){return I}),n.d(i,"m",function(){return S}),n.d(i,"e",function(){return W}),n.d(i,"f",function(){return j}),n.d(i,"o",function(){return N}),n.d(i,"a",function(){return K}),n.d(i,"n",function(){return z}),n.d(i,"h",function(){return B}),n.d(i,"g",function(){return J}),n.d(i,"j",function(){return be});var o=function(X){return X.unknown="unknown",X.h264="h264",X.hevc="hevc",X.av1="av1",X.kvc3="kvc3",X.kvc4="kvc4",X.kvc5="kvc5",X.kvc6="kvc6",X.aac="aac",X.mp3="mp3",X.opus="opus",X.yuv="yuv",X.rawvideo="rawvideo",X.vvc="vvc",X.bvc2="bvc2",X.kvc30="kvc30",X}({}),s=function(X){return X.UNKNOWN="unknown",X.FHD="fhd",X.UHD_4K="4k",X}({}),d=function(X){return X.kvc3="kvc3",X.kvc4="kvc4",X.kvc5="kvc5",X.kvc6="kvc6",X.h265="h265",X.kw265="kw265",X.kvc30="kvc30",X}({}),m=function(X){return X.video="video",X.canvas="canvas",X}({}),A=function(X){return X.canvas2d="canvas2d",X.webgl="webgl",X}({}),T=function(X){return X.buildin="buildin",X.wasm="wasm",X.none="none",X.unsupported="unsupported",X}({}),C=function(X){return X.KWAI_FLV_ABR="kwaiFlvAbr",X.KWAI_FLV_MP="kwaiFlvMultipart",X.KWAI="kwai",X.FILE="file",X.OTHERS="others",X}({}),h=function(X){return X.flv="flv",X.hls="hls",X.hls_ts="hls_ts",X.hls_fmp4="hls_fmp4",X.webrtc="webrtc",X.mp4="mp4",X.raw="raw",X.mp3="mp3",X.wav="wav",X.aac="aac",X.matroska="matroska",X.ts="ts",X.ivf="ivf",X.yuv="yuv",X.unknown="unknown",X}({}),F=function(X){return X.RTC="rtc_retry",X.BACKUP="backup",X.FALLBACK="fallback",X.LOADER="loader",X}({}),w=function(X){return X.AUTO="auto",X.MIN="min",X}({}),I=function(X){return X.NONE="none",X.WAITING="waiting",X}({}),S=function(X){return X.NEXT="next",X.PREV="prev",X}({}),W=function(X){return X.STANDARD="standard",X.QUERY_START_END="queryStartEnd",X}({}),j=function(X){return X.MAIN="main",X.AUDIO="audio",X.SUBTITLE="subtitle",X}({}),N=function(X){return X.VIDEO="video",X.AUDIO="audio",X}({}),K=function(X){return X.unknown="unknown",X.native="native",X.mse="mse",X.rtc="rtc",X}({}),z=function(X){return X[X.Normal=0]="Normal",X[X.V360=1]="V360",X[X.V180=2]="V180",X}({}),B=function(X){return X[X.normal=0]="normal",X[X.internal=1]="internal",X[X.retry=2]="retry",X}({}),J=function(X){return X.NONE="none",X.KWAI="kwai",X.KWAI2="kwai2",X}({}),be=function(X){return X.UNKNOWN="",X.PROBABLY="probably",X}({})},function(r,i,n){function o(I){return{data:I,byteIndex:0,bitIndex:0}}function s(I,S){if(h(I)>S){var W=S%8;I.byteIndex=I.byteIndex+Math.floor(S/8)+Math.floor((I.bitIndex+W)/8),I.bitIndex=(I.bitIndex+W)%8}else I.byteIndex=I.data.byteLength-1,I.bitIndex=7}function d(I,S){if(S>32)throw new Error("len must be less 32");var W=I.data[I.byteIndex],j=Math.min(8-I.bitIndex,S),N=S-j;I.bitIndex+=j;var K=W>>8-I.bitIndex&Math.pow(2,j)-1;return I.bitIndex===8&&(I.bitIndex=0,I.byteIndex++),N?K<<N|d(I,N):K}function m(I){return d(I,w(I)+1)-1}function A(I){var S=m(I);return Math.pow(-1,S+1)*Math.ceil(S/2)}function T(I){var S=w(I);return S>=32?0:d(I,S)+(1<<S)-1}function C(I){for(var S=0,W=0;W<8;W++){var j=d(I,8);if(S|=(127&j)<<7*W,!(128&j))break}return S}function h(I){return 8*(I.data.byteLength-I.byteIndex)-I.bitIndex}function F(I){I.bitIndex>0&&(I.byteIndex++,I.bitIndex=0)}function w(I){for(var S=h(I),W=0;W<S;W++)if(d(I,1)===1)return I.bitIndex===0?(I.byteIndex--,I.bitIndex=7):I.bitIndex--,W;return 0}n.d(i,"c",function(){return o}),n.d(i,"g",function(){return s}),n.d(i,"a",function(){return d}),n.d(i,"h",function(){return m}),n.d(i,"f",function(){return A}),n.d(i,"i",function(){return T}),n.d(i,"e",function(){return C}),n.d(i,"d",function(){return h}),n.d(i,"b",function(){return F})},function(r,i,n){var o=function(s){return s.METADATA="metadata",s.MEDIA_INFO="mediaInfo",s.PARSING_INIT_SEGMENT="parsingInitSegment",s.PARSING_DATA="parsingData",s.PARSED_DATA="parsedData",s.SCRIPT_PARSED="scriptParsed",s.KEY_FRAME_INDEXS="keyFrameIndexs",s.VIDEO_FRAME_INFO="videoFrameInfo",s.DISCONTINUITY="discontinuity",s.REPORT="report",s.LOAD_END="loadEnd",s.ERROR="error",s.MANIFEST_LOADED="manifestLoaded",s.MANIFEST_PARSED="manifestParsed",s.LEVEL_SWITCHING="levelSwitching",s.LEVEL_SWITCHED="levelSwitched",s.LEVEL_SWITCH_PLAYING="levelSwitchPlaying",s.LEVEL_SWITCH_FAILED="levelSwitchFailed",s.LEVEL_LOADED="levelLoaded",s.LEVEL_UPDATED="levelUpdated",s.AUDIO_TRACK_SWITCHING="audioTrackSwitching",s.AUDIO_TRACK_SWITCHED="audioTrackSwitched",s.AUDIO_TRACK_UPDATED="audioTrackUpdated",s.AUDIO_TRACK_SWITCH_FAILED="audioTrackSwitchFailed",s.HLS_MANIFEST_PARSED="hlsManifestParsed",s.HLS_KEY_LOADED="hlsKeyLoaded",s.AUDIO_TRACK_LOADED="audioLoaded",s.SUBTITLE_TRACK_LOADED="subtitleTrackLoaded",s.SUBTITLE_LOADED="subtitleLoaded",s.SUBTITLE_TRACK_SWITCHED="subtitleTrackSwitched",s.SUBTITLE_TRACK_UPDATED="subtitleTrackUpdated",s.BUFFER_CLEANING="bufferCleaning",s.VIDEO_SEEK="vdeoSeek",s.ABR_NEXT="abrNext",s.PRIV_NAL="privNal",s.SEI="sei",s.AAC_PRIV="aacPriv",s.RAW_DATA="rawData",s.MP4_NOT_FASTSTART="mp4NotFaststart",s.VIDEO_CODEC_DETECTED="videoCodecChange",s.H265_DETECTED="h265Detected",s.VIDEO_RENDERER_CHANGE="videoRendererChange",s.DEC_LIB_LOADED="decLibLoaded",s.DEC_INIT_COMPLETE="decoderInitComplete",s.DEC_VIDEO_READY="decVideoReady",s.STEP="step",s.RENDERER_INIT_COMPLETE="rendererInitComplete",s.RENDERER_BUF_EXPIRED="rendererBufExpired",s.RENDERER_SEEK="rendererSeek",s.RENDERER_BUF_UPDATE="rendererBufUpdate",s.RENDERER_DRAW="rendererDraw",s.RENDERER_WAITING="rendererWaiting",s.RENDERER_WAITING_END="rendererWaitingEnd",s.DECODER_FRAME="decoderFrame",s.DECODER_IMG="decoderImg",s.DECODER_SEEK="decoderSeek",s.DECODER_SEEK_ABORT="decoderSeekAbort",s.DECODER_WAITING="decoderWaiting",s.DECODER_DATA_END="decoderDataEnd",s.DECODER_BUF_LOW="decoderDataEmpty",s.DECODER_DROP_FRAME="decocerDropFrame",s.DECODER_MEDIA_INFO="decoderMediaInfo",s.MEDIA_CONNECTED="mediaConnected",s.LOADER_CHUNK_ARRIVAL="loaderChunkArrival",s.DEMUXER_DETECTED="demuxerDetected",s.MEDIA_DEMUX="mediaDemux",s.KEY_FRAME="keyFrame",s.USE_BACKUP="useBackup",s.NEW_SOURCE="newSource",s.DOWNLOAD="download",s.STOP_LOAD="stopLoad",s.LOAD="load",s.WAITING="waiting",s.LOADEDMETADATA="loadedmetadata",s.LOADEDDATA="loadeddata",s.CANPLAY="canplay",s.SEEKING="seeking",s.SEEK_WITH_LOAD="seekWithLoad",s.SEEKED="seeked",s.PLAYING="playing",s.PAUSE="pause",s.PLAY="play",s.ENDED="ended",s.TIMEUPDATE="timeupdate",s.PROGRESS="progress",s.RATE_CHANGE="ratechange",s.DURATION_CHANGE="durationchange",s.HEARTBEAT="heartbeat",s.MSE_UPDATE="mseUpdate",s.MSE_BUFFER_FULL="mseBufferFull",s.MSE_SOURCE_CLOSE="mseSourceClose",s.RETRY="retry",s.WORKER_LOG="workerLog",s.VISIBILITY_CHANGE="visibilityChange",s.SCREENSHOT="screenshot",s}(o||{});i.a=o},function(r,i,n){n.d(i,"b",function(){return s}),n.d(i,"a",function(){return d}),n.d(i,"c",function(){return m}),n.d(i,"e",function(){return A}),n.d(i,"f",function(){return h}),n.d(i,"g",function(){return F}),n.d(i,"d",function(){return w});var o=n(19),s=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.MSE_ERROR="mseError",I.DECODER_ERROR="decoderError",I.RENDERER_ERROR="rendererError",I}({}),d=function(I){return I[I.LOAD_ERROR=10]="LOAD_ERROR",I[I.MANIFEST_LOAD_ERROR=11]="MANIFEST_LOAD_ERROR",I[I.LEVEL_LOAD_ERROR=12]="LEVEL_LOAD_ERROR",I[I.AUDIO_TRACK_LOAD_ERROR=13]="AUDIO_TRACK_LOAD_ERROR",I[I.KEY_LOAD_ERROR=14]="KEY_LOAD_ERROR",I[I.KEY_SYSTEM_LICENSE_REQUEST_FAILED=15]="KEY_SYSTEM_LICENSE_REQUEST_FAILED",I[I.DEC_LIB_LOAD_ERROR=16]="DEC_LIB_LOAD_ERROR",I[I.RTC_SDP_LOAD_ERROR=17]="RTC_SDP_LOAD_ERROR",I[I.SUBTITLE_TRACK_LOAD_ERROR=18]="SUBTITLE_TRACK_LOAD_ERROR",I[I.CANNOT_SEEK=100]="CANNOT_SEEK",I[I.VIDEO_ERROR=101]="VIDEO_ERROR",I[I.UNSUPPORTED=102]="UNSUPPORTED",I[I.CONFIG_ERROR=103]="CONFIG_ERROR",I[I.OTHER=104]="OTHER",I[I.UNKNOWN=105]="UNKNOWN",I[I.CANNOT_SEEK_BY_FRAME_INDEX=106]="CANNOT_SEEK_BY_FRAME_INDEX",I[I.SRC_EMPTY=107]="SRC_EMPTY",I[I.VIDEO_NO_SIZE=108]="VIDEO_NO_SIZE",I[I.NO_TRACKS_AVAILABLE=109]="NO_TRACKS_AVAILABLE",I[I.VIDEO_ERROR_1=111]="VIDEO_ERROR_1",I[I.VIDEO_ERROR_2=112]="VIDEO_ERROR_2",I[I.VIDEO_ERROR_3=113]="VIDEO_ERROR_3",I[I.VIDEO_ERROR_4=114]="VIDEO_ERROR_4",I[I.MEDIASOURCE_ERROR=200]="MEDIASOURCE_ERROR",I[I.ADDSOURCEBUFFER_ERROR=201]="ADDSOURCEBUFFER_ERROR",I[I.SOURCEBUFFER_ERROR=202]="SOURCEBUFFER_ERROR",I[I.ENDOFSTREAM_ERROR=203]="ENDOFSTREAM_ERROR",I[I.APPENDBUFFER_ERROR=204]="APPENDBUFFER_ERROR",I[I.CHANGETYPE_ERROR=205]="CHANGETYPE_ERROR",I[I.MSE_CAPABILITY_ERROR=206]="MSE_CAPABILITY_ERROR",I[I.MSE_SOURCE_BUFFER_CLOSE_ERROR=207]="MSE_SOURCE_BUFFER_CLOSE_ERROR",I[I.PARSING_ERROR=301]="PARSING_ERROR",I[I.REMUX_ERROR=302]="REMUX_ERROR",I[I.REMUX_ALLOC_ERROR=303]="REMUX_ALLOC_ERROR",I[I.REMUX_WORKER_ERROR=304]="REMUX_WORKER_ERROR",I[I.DEMUX_NOT_FOUND=305]="DEMUX_NOT_FOUND",I[I.MANIFEST_PARSING_ERROR=400]="MANIFEST_PARSING_ERROR",I[I.LEVEL_NO_UPDATE_ERROR=402]="LEVEL_NO_UPDATE_ERROR",I[I.KEY_SYSTEM_NO_ACCESS=500]="KEY_SYSTEM_NO_ACCESS",I[I.KEY_SYSTEM_NO_SESSION=501]="KEY_SYSTEM_NO_SESSION",I[I.KEY_SYSTEM_URL_ERROR=502]="KEY_SYSTEM_URL_ERROR",I[I.KEY_SYSTEM_NO_KEYS=505]="KEY_SYSTEM_NO_KEYS",I[I.FRAG_DECRYPT_ERROR=506]="FRAG_DECRYPT_ERROR",I[I.KEY_SYSTEM_NO_INIT_DATA=507]="KEY_SYSTEM_NO_INIT_DATA",I[I.KEY_SYSTEM_UNSUPPORTED=508]="KEY_SYSTEM_UNSUPPORTED",I[I.DECODER_LOAD_ERROR=600]="DECODER_LOAD_ERROR",I[I.DECODER_INIT_ERROR=601]="DECODER_INIT_ERROR",I[I.DECODER_DRAW_ERROR=602]="DECODER_DRAW_ERROR",I[I.DECODER_WEBGL_ERROR=603]="DECODER_WEBGL_ERROR",I[I.DECODER_UNSUPPORTED=604]="DECODER_UNSUPPORTED",I[I.DECODER_COPY_YUV_ERROR=605]="DECODER_COPY_YUV_ERROR",I[I.DECODER_DEC_ERROR=606]="DECODER_DEC_ERROR",I[I.DECODER_2D_ERROR=607]="DECODER_2D_ERROR",I[I.SCREENSHOT_INIT_ERROR=700]="SCREENSHOT_INIT_ERROR",I[I.SCREENSHOT_EMPTY_DATA_ERROR=701]="SCREENSHOT_EMPTY_DATA_ERROR",I[I.SCREENSHOT_CREATE_IMG_ERROR=702]="SCREENSHOT_CREATE_IMG_ERROR",I[I.LIVE_DISCONNECTED_ERROR=1009]="LIVE_DISCONNECTED_ERROR",I[I.WEBRTC_DISCONNECTED_ERROR=1010]="WEBRTC_DISCONNECTED_ERROR",I[I.WEBRTC_FAILED_ERROR=1011]="WEBRTC_FAILED_ERROR",I[I.WEBRTC_CLOSED_ERROR=1012]="WEBRTC_CLOSED_ERROR",I[I.WEBRTC_ICE_CANDIDATE_ERROR=1013]="WEBRTC_ICE_CANDIDATE_ERROR",I[I.WEBRTC_ICE_CONNECTION_ERROR=1014]="WEBRTC_ICE_CONNECTION_ERROR",I[I.WEBRTC_OFFER_ERROR=1015]="WEBRTC_OFFER_ERROR",I[I.WEBRTC_ANSWER_ERROR=1016]="WEBRTC_ANSWER_ERROR",I[I.WEBRTC_TRANSMISSION_DATA_NULL=1017]="WEBRTC_TRANSMISSION_DATA_NULL",I[I.WEBRTC_CONNECT_TIMEOUT=1018]="WEBRTC_CONNECT_TIMEOUT",I[I.WEBRTC_CONNECT_FAILED=1019]="WEBRTC_CONNECT_FAILED",I}({}),m=[d.VIDEO_ERROR,d.VIDEO_ERROR_1,d.VIDEO_ERROR_2,d.VIDEO_ERROR_3,d.VIDEO_ERROR_4];function A(I,S,W,j){var N={type:I,details:S,code:0,fatal:!0,reason:W};if(j)for(var K in j){var z=j[K];z!==void 0&&(N[K]=z)}return N}var T={other4xx:"05",serverError:"06",timeoutOpen:"07",timeoutIO:"08",handlingDataError:"10",other:"99"},C={400:"01",401:"02",403:"03",404:"04",200:"09",206:"09"};function h(I){return I.indexOf(o.a.LOADER_CONNECT_TIMEOUT)>=0}function F(I){return I.indexOf(o.a.LOADER_TRANS_TIMEOUT)>=0}function w(I,S,W){if(W===void 0&&(W=0),I>=100)return I;var j="00";return h(S)?j=T.timeoutOpen:F(S)?j=T.timeoutIO:function(N){return N.indexOf(o.a.HANDLING_DATA_ERROR)>=0}(S)?j=T.handlingDataError:Object.prototype.hasOwnProperty.call(C,W)?j=W!==200&&W!==206||!S?C[W]||"00":T.other:/^4\d{2}$/.test(W.toString())?j=T.other4xx:/^5\d{2}$/.test(W.toString())&&(j=T.serverError),parseInt(I+j,10)}},function(r,i,n){n.d(i,"a",function(){return s}),n.d(i,"f",function(){return d}),n.d(i,"k",function(){return m}),n.d(i,"c",function(){return A}),n.d(i,"g",function(){return T}),n.d(i,"d",function(){return C}),n.d(i,"h",function(){return h}),n.d(i,"l",function(){return F}),n.d(i,"e",function(){return w}),n.d(i,"j",function(){return I}),n.d(i,"i",function(){return S}),n.d(i,"b",function(){return W});var o="uin8arr out of range.";function s(j,N,K){var z=K?N+K:j.byteLength;if(Array.from)return String.fromCharCode.apply(null,Array.from(j.subarray(N,z)));for(var B=[],J=j.subarray(N,z),be=0;be<J.length;be++)B.push(J[be]);return String.fromCharCode.apply(null,B)}function d(j,N,K){if(N===void 0&&(N=0),K===void 0&&(K=!1),N+1>=j.length)throw new Error(o+" "+N+"/"+j.length);return K?(j[N+1]<<8)+j[N]:(j[N]<<8)+j[N+1]}function m(j,N,K){if(K===void 0&&(K=0),N.byteLength-K<2)throw new Error(o+" "+K+"/"+N.length);N[K]=j>>8&255,N[K+1]=255&j}function A(j,N,K){if(N===void 0&&(N=0),K===void 0&&(K=!1),N+1>=j.length)throw new Error(o+" "+N+"/"+j.length);var z=0;return 32768&(z=K?(j[N+1]<<8)+j[N]:(j[N]<<8)+j[N+1])&&(z=z-1-65535),z}function T(j,N,K){if(N===void 0&&(N=0),K===void 0&&(K=!1),N+2>=j.length)throw new Error(o+" "+N+"/"+j.length);return K?(j[N+2]<<16)+(j[N+1]<<8)+j[N]:(j[N]<<16)+(j[N+1]<<8)+j[N+2]}function C(j,N,K){if(N===void 0&&(N=0),K===void 0&&(K=!1),N+2>=j.length)throw new Error(o+" "+N+"/"+j.length);var z=0;return 8388608&(z=K?(j[N+2]<<16)+(j[N+1]<<8)+j[N]:(j[N]<<16)+(j[N+1]<<8)+j[N+2])&&(z=z-1-16777215),z}function h(j,N,K){if(N===void 0&&(N=0),K===void 0&&(K=!1),N+3>=j.length)throw new Error(o+" "+N+"/"+j.length);var z=0;return(z=K?j[N+3]*Math.pow(2,24)+(j[N+2]<<16)+(j[N+1]<<8)+j[N]:j[N]*Math.pow(2,24)+(j[N+1]<<16)+(j[N+2]<<8)+j[N+3])<0?4294967296+z:z}function F(j,N,K){if(K===void 0&&(K=0),N.byteLength-K<4)throw new Error(o+" "+K+"/"+N.length);N[K]=j>>24&255,N[K+1]=j>>16&255,N[K+2]=j>>8&255,N[K+3]=255&j}function w(j,N,K){if(K===void 0&&(K=!1),N+3>=j.length)throw new Error(o+" "+N+"/"+j.length);var z=0;return 2147483648&(z=K?j[N+3]*Math.pow(2,24)+(j[N+2]<<16)+(j[N+1]<<8)+j[N]:j[N]*Math.pow(2,24)+(j[N+1]<<16)+(j[N+2]<<8)+j[N+3])&&(z=z-1-4294967295),z}function I(j,N,K){if(K===void 0&&(K=0),N.byteLength-K<4)throw new Error(o+" "+K+"/"+N.length);j<0&&(j+=4294967296),F(j,N,K)}function S(j,N,K){if(N===void 0&&(N=0),K===void 0&&(K=!1),N+7>=j.length)throw new Error(o+" "+N+"/"+j.length);return K?j[N+7]*Math.pow(2,56)+j[N+6]*Math.pow(2,48)+j[N+5]*Math.pow(2,40)+j[N+4]*Math.pow(2,32)+j[N+3]*Math.pow(2,24)+(j[N+2]<<16)+(j[N+1]<<8)+j[N]:j[N]*Math.pow(2,56)+j[N+1]*Math.pow(2,48)+j[N+2]*Math.pow(2,40)+j[N+3]*Math.pow(2,32)+j[N+4]*Math.pow(2,24)+(j[N+5]<<16)+(j[N+6]<<8)+j[N+7]}function W(j,N){if(j.length!==N.length)return!1;for(var K=0;K<j.length;K++)if(j[K]!==N[K])return!1;return!0}},function(r,i,n){var o=n(52);function s(d,m){for(var A=0;A<m.length;A++){var T=m[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,o(T.key),T)}}r.exports=function(d,m,A){return m&&s(d.prototype,m),A&&s(d,A),Object.defineProperty(d,"prototype",{writable:!1}),d},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(8),s=n.n(o),d={version:{major:0,string:""}};(function(m){if(typeof navigator<"u"){m=m?m.toLowerCase():navigator.userAgent.toLowerCase();var A=/(edge)\/([\w.]+)/.exec(m)||/(edg)\/([\w.]+)/.exec(m)||/(opr)[/]([\w.]+)/.exec(m)||/(chrome)[ /]([\w.]+)/.exec(m)||/(iemobile)[/]([\w.]+)/.exec(m)||/(version)(applewebkit)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(m)||/(webkit)[ /]([\w.]+).*(version)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(m)||/(webkit)[ /]([\w.]+)/.exec(m)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(m)||/(msie) ([\w.]+)/.exec(m)||m.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(m)||m.indexOf("compatible")<0&&/(firefox)[ /]([\w.]+)/.exec(m)||[],T=/(ipad)/.exec(m)||/(ipod)/.exec(m)||/(windows phone)/.exec(m)||/(iphone)/.exec(m)||/(kindle)/.exec(m)||/(android)/.exec(m)||/(windows)/.exec(m)||/(mac)/.exec(m)||/(linux)/.exec(m)||/(cros)/.exec(m)||[],C=/(?:iphone|ipad|cpu) os (\d+)[._]\d+/.exec(m)||/android ([\d.]+)/.exec(m)||[],h={browser:A[5]||A[3]||A[1]||"",version:A[2]||A[4]||"0",majorVersion:A[4]||A[2]||"0",platform:T[0]||"",platformVersion:C[1]||""},F={x5:/ tbs\//.test(m),xweb:/ xweb\//.test(m),version:{major:0,string:""}};if(h.browser){F[h.browser]=!0;var w=h.majorVersion.split(".");F.version={major:parseInt(h.majorVersion,10),string:h.version},w.length>1&&(F.version.minor=parseInt(w[1],10)),w.length>2&&(F.version.build=parseInt(w[2],10))}if(h.platform&&(F[h.platform]=!0),(F.chrome||F.opr||F.safari)&&(F.webkit=!0),F.rv||F.iemobile){F.rv&&delete F.rv;var I="msie";h.browser=I,F[I]=!0}if(F.edg||F.edge){delete F.edg,delete F.edge;var S="msedge";h.browser=S,F[S]=!0}if(F.opr){var W="opera";h.browser=W,F[W]=!0}if(F.safari&&F.android){var j="android";h.browser=j,F[j]=!0}if(F.android){var N=m.match(/android[\s0-9.]+;([\w\s-]+)(build)?/);if(N)try{var K;F.model=(K=N[1].split("build")[0])==null?void 0:K.trim()}catch(B){}}else F.ipad?F.model="ipad":F.iphone&&(F.model="iphone");for(var z in(F.android||F.iphone||F.ipad)&&(F.mobile=!0),F.ios=F.iphone||F.ipad,F.name=h.browser,F.platform=h.platform,F.platformVersion=h.platformVersion,d)Object.prototype.hasOwnProperty.call(d,z)&&delete d[z];s()(d,F)}})(),i.a=d},function(r,i,n){n.d(i,"e",function(){return o}),n.d(i,"c",function(){return s}),n.d(i,"d",function(){return d}),n.d(i,"f",function(){return m}),n.d(i,"b",function(){return A}),n.d(i,"q",function(){return T}),n.d(i,"a",function(){return C}),n.d(i,"h",function(){return h}),n.d(i,"r",function(){return F}),n.d(i,"n",function(){return w}),n.d(i,"p",function(){return I}),n.d(i,"i",function(){return S}),n.d(i,"j",function(){return W}),n.d(i,"k",function(){return j}),n.d(i,"o",function(){return N}),n.d(i,"m",function(){return K}),n.d(i,"l",function(){return z}),n.d(i,"g",function(){return B});var o=1048576,s=10485760,d=25,m=1e3,A=1e3,T=9e4,C=4294967296,h=1e3,F=.1,w=240,I=2e3,S=1e3,W=1500,j=5,N=33554432,K="kwai-k",z="kwai-kernel-log",B=500},function(r,i){function n(){return r.exports=n=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(o[m]=d[m])}return o},r.exports.__esModule=!0,r.exports.default=r.exports,n.apply(this,arguments)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){n.d(i,"a",function(){return o});var o=function(s){return s[s.HEVC_NAL_TRAIL_N=0]="HEVC_NAL_TRAIL_N",s[s.HEVC_NAL_TRAIL_R=1]="HEVC_NAL_TRAIL_R",s[s.HEVC_NAL_TSA_N=2]="HEVC_NAL_TSA_N",s[s.HEVC_NAL_TSA_R=3]="HEVC_NAL_TSA_R",s[s.HEVC_NAL_STSA_N=4]="HEVC_NAL_STSA_N",s[s.HEVC_NAL_STSA_R=5]="HEVC_NAL_STSA_R",s[s.HEVC_NAL_RADL_N=6]="HEVC_NAL_RADL_N",s[s.HEVC_NAL_RADL_R=7]="HEVC_NAL_RADL_R",s[s.HEVC_NAL_RASL_N=8]="HEVC_NAL_RASL_N",s[s.HEVC_NAL_RASL_R=9]="HEVC_NAL_RASL_R",s[s.HEVC_NAL_VCL_N10=10]="HEVC_NAL_VCL_N10",s[s.HEVC_NAL_VCL_R11=11]="HEVC_NAL_VCL_R11",s[s.HEVC_NAL_VCL_N12=12]="HEVC_NAL_VCL_N12",s[s.HEVC_NAL_VCL_R13=13]="HEVC_NAL_VCL_R13",s[s.HEVC_NAL_VCL_N14=14]="HEVC_NAL_VCL_N14",s[s.HEVC_NAL_VCL_R15=15]="HEVC_NAL_VCL_R15",s[s.HEVC_NAL_BLA_W_LP=16]="HEVC_NAL_BLA_W_LP",s[s.HEVC_NAL_BLA_W_RADL=17]="HEVC_NAL_BLA_W_RADL",s[s.HEVC_NAL_BLA_N_LP=18]="HEVC_NAL_BLA_N_LP",s[s.HEVC_NAL_IDR_W_RADL=19]="HEVC_NAL_IDR_W_RADL",s[s.HEVC_NAL_IDR_N_LP=20]="HEVC_NAL_IDR_N_LP",s[s.HEVC_NAL_CRA_NUT=21]="HEVC_NAL_CRA_NUT",s[s.HEVC_NAL_RSV_IRAP_VCL22=22]="HEVC_NAL_RSV_IRAP_VCL22",s[s.HEVC_NAL_RSV_IRAP_VCL23=23]="HEVC_NAL_RSV_IRAP_VCL23",s[s.HEVC_NAL_RSV_VCL24=24]="HEVC_NAL_RSV_VCL24",s[s.HEVC_NAL_RSV_VCL25=25]="HEVC_NAL_RSV_VCL25",s[s.HEVC_NAL_RSV_VCL26=26]="HEVC_NAL_RSV_VCL26",s[s.HEVC_NAL_RSV_VCL27=27]="HEVC_NAL_RSV_VCL27",s[s.HEVC_NAL_RSV_VCL28=28]="HEVC_NAL_RSV_VCL28",s[s.HEVC_NAL_RSV_VCL29=29]="HEVC_NAL_RSV_VCL29",s[s.HEVC_NAL_RSV_VCL30=30]="HEVC_NAL_RSV_VCL30",s[s.HEVC_NAL_RSV_VCL31=31]="HEVC_NAL_RSV_VCL31",s[s.HEVC_NAL_VPS=32]="HEVC_NAL_VPS",s[s.HEVC_NAL_SPS=33]="HEVC_NAL_SPS",s[s.HEVC_NAL_PPS=34]="HEVC_NAL_PPS",s[s.HEVC_NAL_AUD=35]="HEVC_NAL_AUD",s[s.HEVC_NAL_EOS_NUT=36]="HEVC_NAL_EOS_NUT",s[s.HEVC_NAL_EOB_NUT=37]="HEVC_NAL_EOB_NUT",s[s.HEVC_NAL_FD_NUT=38]="HEVC_NAL_FD_NUT",s[s.HEVC_NAL_SEI_PREFIX=39]="HEVC_NAL_SEI_PREFIX",s[s.HEVC_NAL_SEI_SUFFIX=40]="HEVC_NAL_SEI_SUFFIX",s[s.HEVC_NAL_RSV_NVCL41=41]="HEVC_NAL_RSV_NVCL41",s[s.HEVC_NAL_RSV_NVCL42=42]="HEVC_NAL_RSV_NVCL42",s[s.HEVC_NAL_RSV_NVCL43=43]="HEVC_NAL_RSV_NVCL43",s[s.HEVC_NAL_RSV_NVCL44=44]="HEVC_NAL_RSV_NVCL44",s[s.HEVC_NAL_RSV_NVCL45=45]="HEVC_NAL_RSV_NVCL45",s[s.HEVC_NAL_RSV_NVCL46=46]="HEVC_NAL_RSV_NVCL46",s[s.HEVC_NAL_RSV_NVCL47=47]="HEVC_NAL_RSV_NVCL47",s[s.HEVC_NAL_UNSPEC48=48]="HEVC_NAL_UNSPEC48",s[s.HEVC_NAL_UNSPEC49=49]="HEVC_NAL_UNSPEC49",s[s.HEVC_NAL_UNSPEC50=50]="HEVC_NAL_UNSPEC50",s[s.HEVC_NAL_UNSPEC51=51]="HEVC_NAL_UNSPEC51",s[s.HEVC_NAL_UNSPEC52=52]="HEVC_NAL_UNSPEC52",s[s.HEVC_NAL_UNSPEC53=53]="HEVC_NAL_UNSPEC53",s[s.HEVC_NAL_UNSPEC54=54]="HEVC_NAL_UNSPEC54",s[s.HEVC_NAL_UNSPEC55=55]="HEVC_NAL_UNSPEC55",s[s.HEVC_NAL_UNSPEC56=56]="HEVC_NAL_UNSPEC56",s[s.HEVC_NAL_UNSPEC57=57]="HEVC_NAL_UNSPEC57",s[s.HEVC_NAL_UNSPEC58=58]="HEVC_NAL_UNSPEC58",s[s.HEVC_NAL_UNSPEC59=59]="HEVC_NAL_UNSPEC59",s[s.HEVC_NAL_UNSPEC60=60]="HEVC_NAL_UNSPEC60",s[s.HEVC_NAL_UNSPEC61=61]="HEVC_NAL_UNSPEC61",s[s.HEVC_NAL_UNSPEC62=62]="HEVC_NAL_UNSPEC62",s[s.PRIV_NAL_MAGIC_HEVC=63]="PRIV_NAL_MAGIC_HEVC",s[s.NAL_UNIT_INVALID=64]="NAL_UNIT_INVALID",s}({})},function(r,i,n){var o=n(56);r.exports=function(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,o(s,d)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){n.d(i,"e",function(){return o}),n.d(i,"a",function(){return s}),n.d(i,"d",function(){return d}),n.d(i,"b",function(){return m}),n.d(i,"c",function(){return A}),n(0);var o=function(T){return T[T.video=1]="video",T[T.audio=2]="audio",T}({}),s=function(T){return T[T.ADTS=0]="ADTS",T[T.ASC=1]="ASC",T}({}),d=function(T){return T.videoFrame="videoFrame",T.decoderConfig="decoderConfig",T}({}),m=function(T){return T.UNKNOWN="unknown",T.FLV="flv",T.FMP4="fmp4",T.TS="ts",T.MP4="mp4",T.RAW="raw",T.IVF="ivf",T.YUV="yuv",T}({}),A=function(T){return T.MANIFEST="manifest",T.LEVEL="level",T.AUDIO_TRACK="audioTrack",T.SUBTITLE_TRACK="subtitleTrack",T}({})},function(r,i,n){var o,s,d,m;n.d(i,"a",function(){return A}),n.d(i,"d",function(){return T}),n.d(i,"c",function(){return C}),n.d(i,"b",function(){return h}),n.d(i,"e",function(){return W}),n.d(i,"f",function(){return j});var A=function(N){return N[N.AVCOL_PRI_RESERVED0=0]="AVCOL_PRI_RESERVED0",N[N.AVCOL_PRI_BT709=1]="AVCOL_PRI_BT709",N[N.AVCOL_PRI_UNSPECIFIED=2]="AVCOL_PRI_UNSPECIFIED",N[N.AVCOL_PRI_RESERVED=3]="AVCOL_PRI_RESERVED",N[N.AVCOL_PRI_BT470M=4]="AVCOL_PRI_BT470M",N[N.AVCOL_PRI_BT470BG=5]="AVCOL_PRI_BT470BG",N[N.AVCOL_PRI_SMPTE170M=6]="AVCOL_PRI_SMPTE170M",N[N.AVCOL_PRI_SMPTE240M=7]="AVCOL_PRI_SMPTE240M",N[N.AVCOL_PRI_FILM=8]="AVCOL_PRI_FILM",N[N.AVCOL_PRI_BT2020=9]="AVCOL_PRI_BT2020",N[N.AVCOL_PRI_SMPTE428=10]="AVCOL_PRI_SMPTE428",N[N.AVCOL_PRI_SMPTEST428_1=10]="AVCOL_PRI_SMPTEST428_1",N[N.AVCOL_PRI_SMPTE431=11]="AVCOL_PRI_SMPTE431",N[N.AVCOL_PRI_SMPTE432=12]="AVCOL_PRI_SMPTE432",N[N.AVCOL_PRI_EBU3213=22]="AVCOL_PRI_EBU3213",N[N.AVCOL_PRI_JEDEC_P22=22]="AVCOL_PRI_JEDEC_P22",N[N.AVCOL_PRI_NB=23]="AVCOL_PRI_NB",N}({}),T=function(N){return N[N.AVCOL_TRC_RESERVED0=0]="AVCOL_TRC_RESERVED0",N[N.AVCOL_TRC_BT709=1]="AVCOL_TRC_BT709",N[N.AVCOL_TRC_UNSPECIFIED=2]="AVCOL_TRC_UNSPECIFIED",N[N.AVCOL_TRC_RESERVED=3]="AVCOL_TRC_RESERVED",N[N.AVCOL_TRC_GAMMA22=4]="AVCOL_TRC_GAMMA22",N[N.AVCOL_TRC_GAMMA28=5]="AVCOL_TRC_GAMMA28",N[N.AVCOL_TRC_SMPTE170M=6]="AVCOL_TRC_SMPTE170M",N[N.AVCOL_TRC_SMPTE240M=7]="AVCOL_TRC_SMPTE240M",N[N.AVCOL_TRC_LINEAR=8]="AVCOL_TRC_LINEAR",N[N.AVCOL_TRC_LOG=9]="AVCOL_TRC_LOG",N[N.AVCOL_TRC_LOG_SQRT=10]="AVCOL_TRC_LOG_SQRT",N[N.AVCOL_TRC_IEC61966_2_4=11]="AVCOL_TRC_IEC61966_2_4",N[N.AVCOL_TRC_BT1361_ECG=12]="AVCOL_TRC_BT1361_ECG",N[N.AVCOL_TRC_IEC61966_2_1=13]="AVCOL_TRC_IEC61966_2_1",N[N.AVCOL_TRC_BT2020_10=14]="AVCOL_TRC_BT2020_10",N[N.AVCOL_TRC_BT2020_12=15]="AVCOL_TRC_BT2020_12",N[N.AVCOL_TRC_SMPTE2084=16]="AVCOL_TRC_SMPTE2084",N[N.AVCOL_TRC_SMPTEST2084=16]="AVCOL_TRC_SMPTEST2084",N[N.AVCOL_TRC_SMPTE428=17]="AVCOL_TRC_SMPTE428",N[N.AVCOL_TRC_SMPTEST428_1=17]="AVCOL_TRC_SMPTEST428_1",N[N.AVCOL_TRC_ARIB_STD_B67=18]="AVCOL_TRC_ARIB_STD_B67",N[N.AVCOL_TRC_NB=19]="AVCOL_TRC_NB",N}({}),C=function(N){return N[N.AVCOL_SPC_RGB=0]="AVCOL_SPC_RGB",N[N.AVCOL_SPC_BT709=1]="AVCOL_SPC_BT709",N[N.AVCOL_SPC_UNSPECIFIED=2]="AVCOL_SPC_UNSPECIFIED",N[N.AVCOL_SPC_RESERVED=3]="AVCOL_SPC_RESERVED",N[N.AVCOL_SPC_FCC=4]="AVCOL_SPC_FCC",N[N.AVCOL_SPC_BT470BG=5]="AVCOL_SPC_BT470BG",N[N.AVCOL_SPC_SMPTE170M=6]="AVCOL_SPC_SMPTE170M",N[N.AVCOL_SPC_SMPTE240M=7]="AVCOL_SPC_SMPTE240M",N[N.AVCOL_SPC_YCGCO=8]="AVCOL_SPC_YCGCO",N[N.AVCOL_SPC_YCOCG=8]="AVCOL_SPC_YCOCG",N[N.AVCOL_SPC_BT2020_NCL=9]="AVCOL_SPC_BT2020_NCL",N[N.AVCOL_SPC_BT2020_CL=10]="AVCOL_SPC_BT2020_CL",N[N.AVCOL_SPC_SMPTE2085=11]="AVCOL_SPC_SMPTE2085",N[N.AVCOL_SPC_CHROMA_DERIVED_NCL=12]="AVCOL_SPC_CHROMA_DERIVED_NCL",N[N.AVCOL_SPC_CHROMA_DERIVED_CL=13]="AVCOL_SPC_CHROMA_DERIVED_CL",N[N.AVCOL_SPC_ICTCP=14]="AVCOL_SPC_ICTCP",N[N.AVCOL_SPC_NB=15]="AVCOL_SPC_NB",N}({}),h=function(N){return N[N.AVCOL_RANGE_UNSPECIFIED=0]="AVCOL_RANGE_UNSPECIFIED",N[N.AVCOL_RANGE_MPEG=1]="AVCOL_RANGE_MPEG",N[N.AVCOL_RANGE_JPEG=2]="AVCOL_RANGE_JPEG",N}({}),F=((o={})[A.AVCOL_PRI_RESERVED0]="reserved",o[A.AVCOL_PRI_BT709]="bt709",o[A.AVCOL_PRI_UNSPECIFIED]="unknown",o[A.AVCOL_PRI_RESERVED]="reserved",o[A.AVCOL_PRI_BT470M]="bt470m",o[A.AVCOL_PRI_BT470BG]="bt470bg",o[A.AVCOL_PRI_SMPTE170M]="smpte170m",o[A.AVCOL_PRI_SMPTE240M]="smpte240m",o[A.AVCOL_PRI_FILM]="film",o[A.AVCOL_PRI_BT2020]="bt2020",o[A.AVCOL_PRI_SMPTE428]="smpte428",o[A.AVCOL_PRI_SMPTE431]="smpte431",o[A.AVCOL_PRI_SMPTE432]="smpte432",o[A.AVCOL_PRI_EBU3213]="ebu3213",o),w=((s={})[T.AVCOL_TRC_RESERVED0]="reserved",s[T.AVCOL_TRC_BT709]="bt709",s[T.AVCOL_TRC_UNSPECIFIED]="unknown",s[T.AVCOL_TRC_RESERVED]="reserved",s[T.AVCOL_TRC_GAMMA22]="bt470m",s[T.AVCOL_TRC_GAMMA28]="bt470bg",s[T.AVCOL_TRC_SMPTE170M]="smpte170m",s[T.AVCOL_TRC_SMPTE240M]="smpte240m",s[T.AVCOL_TRC_LINEAR]="linear",s[T.AVCOL_TRC_LOG]="log100",s[T.AVCOL_TRC_LOG_SQRT]="log316",s[T.AVCOL_TRC_IEC61966_2_4]="iec61966-2-4",s[T.AVCOL_TRC_BT1361_ECG]="bt1361e",s[T.AVCOL_TRC_IEC61966_2_1]="iec61966-2-1",s[T.AVCOL_TRC_BT2020_10]="bt2020-10",s[T.AVCOL_TRC_BT2020_12]="bt2020-12",s[T.AVCOL_TRC_SMPTE2084]="smpte2084",s[T.AVCOL_TRC_SMPTE428]="smpte428",s[T.AVCOL_TRC_ARIB_STD_B67]="arib-std-b67",s),I=((d={})[C.AVCOL_SPC_RGB]="gbr",d[C.AVCOL_SPC_BT709]="bt709",d[C.AVCOL_SPC_UNSPECIFIED]="unknown",d[C.AVCOL_SPC_RESERVED]="reserved",d[C.AVCOL_SPC_FCC]="fcc",d[C.AVCOL_SPC_BT470BG]="bt470bg",d[C.AVCOL_SPC_SMPTE170M]="smpte170m",d[C.AVCOL_SPC_SMPTE240M]="smpte240m",d[C.AVCOL_SPC_YCGCO]="ycgco",d[C.AVCOL_SPC_BT2020_NCL]="bt2020nc",d[C.AVCOL_SPC_BT2020_CL]="bt2020c",d[C.AVCOL_SPC_SMPTE2085]="smpte2085",d[C.AVCOL_SPC_CHROMA_DERIVED_NCL]="chroma-derived-nc",d[C.AVCOL_SPC_CHROMA_DERIVED_CL]="chroma-derived-c",d[C.AVCOL_SPC_ICTCP]="ictcp",d),S=((m={})[h.AVCOL_RANGE_UNSPECIFIED]="unknown",m[h.AVCOL_RANGE_MPEG]="tv",m[h.AVCOL_RANGE_JPEG]="pc",m);function W(N){if(N&&typeof N.colorRange=="number"&&typeof N.matrixCoefficients=="number"&&typeof N.colourPrimaries=="number"&&typeof N.transferCharacteristics=="number"){var K=I[N.matrixCoefficients],z=F[N.colourPrimaries],B=w[N.transferCharacteristics];return K===z&&K===B?"("+(N.colorRange?S[N.colorRange]+" ":"unknown ")+K+")":"("+(N.colorRange?S[N.colorRange]+" ":"unknown ")+K+"/"+z+"/"+B+")"}return""}function j(N,K){return typeof N==typeof K&&(N===void 0||K===void 0||N.colorRange===K.colorRange&&N.colourPrimaries===K.colourPrimaries&&N.matrixCoefficients===K.matrixCoefficients&&N.transferCharacteristics===K.transferCharacteristics)}},function(r,i,n){n.d(i,"a",function(){return o});var o=function(s){return s.INIT_265="init265",s.APPEND_DATA="appendData",s.MEDIA_INFO="mediaInfo",s.UPDATE_STATE="updateState",s.RESET="reset",s.DESTROY="destroy",s.STEP="step",s.SEEK="seek",s.END_OF_DATA="endOfData",s.DEC_DROP_FRAME="dropFrame",s.CLEAN="clean",s.INIT_RENDERER="initRenderer",s.SCREENSHOT="screenshot",s}({})},function(r,i,n){n.d(i,"b",function(){return d}),n.d(i,"a",function(){return m});var o=n(5),s=n.n(o),d=function(){function A(){var C;this._=[],(C=this._).push.apply(C,arguments)}var T=A.prototype;return T.push=function(){var C;(C=this._).push.apply(C,arguments)},T.destroyItem=function(C){for(var h=0;h<this._.length;h++)if(this._[h]===C)return this._.splice(h,1),void C.destroy()},T.destroy=function(){for(;this._.length;){var C=this._.shift();C&&C.destroy()}},s()(A,[{key:"destroyed",get:function(){return!!this._.length}}])}(),m=function(){function A(){this.O=new d}return A.prototype.destroy=function(){this.O.destroy()},A}()},function(r,i,n){n.d(i,"j",function(){return o}),n.d(i,"e",function(){return s}),n.d(i,"f",function(){return d}),n.d(i,"g",function(){return m}),n.d(i,"h",function(){return A}),n.d(i,"d",function(){return T}),n.d(i,"a",function(){return C}),n.d(i,"b",function(){return h}),n.d(i,"c",function(){return F}),n.d(i,"i",function(){return w});var o=function(I){return I[I.AUDIO=8]="AUDIO",I[I.VIDEO=9]="VIDEO",I[I.SCRIPT=18]="SCRIPT",I}({}),s=13,d=11,m=4,A=5,T=0,C=1,h=3,F=5,w=function(){this.tagType=o.VIDEO,this.dataSize=0,this.timestamp=0,this.size=0,this.cts=0,this.frameType=0,this.codecId=0,this.body=void 0,this.packetType=void 0}},function(r,i,n){n.d(i,"a",function(){return o});var o=function(s){return s[s.VVC_NAL_UNIT_CODED_SLICE_TRAIL=0]="VVC_NAL_UNIT_CODED_SLICE_TRAIL",s[s.VVC_NAL_UNIT_CODED_SLICE_STSA=1]="VVC_NAL_UNIT_CODED_SLICE_STSA",s[s.VVC_NAL_UNIT_CODED_SLICE_RADL=2]="VVC_NAL_UNIT_CODED_SLICE_RADL",s[s.VVC_NAL_UNIT_CODED_SLICE_RASL=3]="VVC_NAL_UNIT_CODED_SLICE_RASL",s[s.VVC_NAL_UNIT_RESERVED_VCL_4=4]="VVC_NAL_UNIT_RESERVED_VCL_4",s[s.VVC_NAL_UNIT_RESERVED_VCL_5=5]="VVC_NAL_UNIT_RESERVED_VCL_5",s[s.VVC_NAL_UNIT_RESERVED_VCL_6=6]="VVC_NAL_UNIT_RESERVED_VCL_6",s[s.VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL=7]="VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL",s[s.VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP=8]="VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP",s[s.VVC_NAL_UNIT_CODED_SLICE_CRA=9]="VVC_NAL_UNIT_CODED_SLICE_CRA",s[s.VVC_NAL_UNIT_CODED_SLICE_GDR=10]="VVC_NAL_UNIT_CODED_SLICE_GDR",s[s.VVC_NAL_UNIT_RESERVED_IRAP_VCL_11=11]="VVC_NAL_UNIT_RESERVED_IRAP_VCL_11",s[s.VVC_NAL_UNIT_OPI=12]="VVC_NAL_UNIT_OPI",s[s.VVC_NAL_UNIT_DCI=13]="VVC_NAL_UNIT_DCI",s[s.VVC_NAL_UNIT_VPS=14]="VVC_NAL_UNIT_VPS",s[s.VVC_NAL_UNIT_SPS=15]="VVC_NAL_UNIT_SPS",s[s.VVC_NAL_UNIT_PPS=16]="VVC_NAL_UNIT_PPS",s[s.VVC_NAL_UNIT_PREFIX_APS=17]="VVC_NAL_UNIT_PREFIX_APS",s[s.VVC_NAL_UNIT_SUFFIX_APS=18]="VVC_NAL_UNIT_SUFFIX_APS",s[s.VVC_NAL_UNIT_PH=19]="VVC_NAL_UNIT_PH",s[s.VVC_NAL_UNIT_ACCESS_UNIT_DELIMITER=20]="VVC_NAL_UNIT_ACCESS_UNIT_DELIMITER",s[s.VVC_NAL_UNIT_EOS=21]="VVC_NAL_UNIT_EOS",s[s.VVC_NAL_UNIT_EOB=22]="VVC_NAL_UNIT_EOB",s[s.VVC_NAL_UNIT_PREFIX_SEI=23]="VVC_NAL_UNIT_PREFIX_SEI",s[s.VVC_NAL_UNIT_SUFFIX_SEI=24]="VVC_NAL_UNIT_SUFFIX_SEI",s[s.VVC_NAL_UNIT_FD=25]="VVC_NAL_UNIT_FD",s[s.VVC_NAL_UNIT_RESERVED_NVCL_26=26]="VVC_NAL_UNIT_RESERVED_NVCL_26",s[s.VVC_NAL_UNIT_RESERVED_NVCL_27=27]="VVC_NAL_UNIT_RESERVED_NVCL_27",s[s.VVC_NAL_UNIT_UNSPECIFIED_28=28]="VVC_NAL_UNIT_UNSPECIFIED_28",s[s.VVC_NAL_UNIT_UNSPECIFIED_29=29]="VVC_NAL_UNIT_UNSPECIFIED_29",s[s.VVC_NAL_UNIT_UNSPECIFIED_30=30]="VVC_NAL_UNIT_UNSPECIFIED_30",s[s.VVC_NAL_UNIT_UNSPECIFIED_31=31]="VVC_NAL_UNIT_UNSPECIFIED_31",s[s.VVC_NAL_UNIT_INVALID=32]="VVC_NAL_UNIT_INVALID",s}({})},function(r,i,n){n.d(i,"b",function(){return Pe}),n.d(i,"h",function(){return ae}),n.d(i,"f",function(){return U}),n.d(i,"g",function(){return M}),n.d(i,"d",function(){return ne}),n.d(i,"e",function(){return Le}),n.d(i,"c",function(){return Ue}),n.d(i,"a",function(){return re});var o=n(11),s=[41,41,47,49,49,51,47,47,43,43,43,40,40],d=[12,12,12,14,14,14,15,15,15,15,15,15,15],m=[33,33,38,40,40,40,41,41,37,37,37,34,34],A=[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,64,72,80,88,96,108,120,132,144,156,172,188,212,240,276,320,384,448,512,576,640,704,768,832,896,960,1024],T=[0,4,8,12,16,20,24,28,32,36,40,48,56,64,72,80,88,96,108,120,132,144,160,176,196,216,240,264,292,320,352,384,416,448,480,512,544,576,608,640,672,704,736,768,800,832,864,896,928,1024],C=[0,4,8,12,16,20,24,28,32,36,40,44,52,60,68,76,84,92,100,108,116,124,136,148,160,172,188,204,220,240,260,284,308,336,364,396,432,468,508,552,600,652,704,768,832,896,960,1024],h=[0,8,16,24,32,40,48,56,64,72,80,88,100,112,124,136,148,160,172,184,196,212,228,244,260,280,300,320,344,368,396,424,456,492,532,572,616,664,716,772,832,896,960,1024],F=[0,12,24,36,48,60,72,84,96,108,120,132,144,156,172,188,204,220,236,252,268,288,308,328,348,372,396,420,448,476,508,544,580,620,664,712,764,820,880,944,1024],w=[A,A,[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,64,72,80,88,100,112,124,140,156,172,192,216,240,268,304,344,384,424,464,504,544,584,624,664,704,744,784,824,864,904,944,984,1024],T,T,[0,4,8,12,16,20,24,28,32,36,40,48,56,64,72,80,88,96,108,120,132,144,160,176,196,216,240,264,292,320,352,384,416,448,480,512,544,576,608,640,672,704,736,768,800,832,864,896,928,960,992,1024],C,C,h,h,h,F,F],I=[0,4,8,12,16,20,24,32,40,48,64,92,128],S=[0,4,8,12,16,20,28,36,44,56,68,80,96,112,128],W=[0,4,8,12,16,20,24,28,36,44,52,64,76,92,108,128],j=[0,4,8,12,16,20,24,28,32,40,48,60,72,88,108,128],N=[0,4,8,12,16,20,24,28,36,44,52,60,72,88,108,128],K=[I,I,I,S,S,S,W,W,j,j,j,N,N],z=function(k){return k[k.AOT_NULL=0]="AOT_NULL",k[k.AOT_AAC_MAIN=1]="AOT_AAC_MAIN",k[k.AOT_AAC_LC=2]="AOT_AAC_LC",k[k.AOT_AAC_SSR=3]="AOT_AAC_SSR",k[k.AOT_AAC_LTP=4]="AOT_AAC_LTP",k[k.AOT_SBR=5]="AOT_SBR",k[k.AOT_AAC_SCALABLE=6]="AOT_AAC_SCALABLE",k[k.AOT_PS=29]="AOT_PS",k[k.AOT_ER_AAC_ELD=39]="AOT_ER_AAC_ELD",k}({}),B=n(1),J=[[1,0,60],[3,4,59],[4,10,61],[4,11,58],[4,12,62],[5,26,57],[5,27,63],[6,56,56],[6,57,64],[6,58,55],[6,59,65],[7,120,66],[7,121,54],[7,122,67],[8,246,53],[8,247,68],[8,248,52],[8,249,69],[8,250,51],[9,502,70],[9,503,50],[9,504,49],[9,505,71],[10,1012,72],[10,1013,48],[10,1014,73],[10,1015,47],[10,1016,74],[10,1017,46],[11,2036,76],[11,2037,75],[11,2038,77],[11,2039,78],[11,2040,45],[11,2041,43],[12,4084,44],[12,4085,79],[12,4086,42],[12,4087,41],[12,4088,80],[12,4089,40],[13,8180,81],[13,8181,39],[13,8182,82],[13,8183,38],[13,8184,83],[14,16370,37],[14,16371,35],[14,16372,85],[14,16373,33],[14,16374,36],[14,16375,34],[14,16376,84],[14,16377,32],[15,32756,87],[15,32757,89],[15,32758,30],[15,32759,31],[16,65520,86],[16,65521,29],[16,65522,26],[16,65523,27],[16,65524,28],[16,65525,24],[16,65526,88],[17,131054,25],[17,131055,22],[17,131056,23],[18,262114,90],[18,262115,21],[18,262116,19],[18,262117,3],[18,262118,1],[18,262119,2],[18,262120,0],[19,524242,98],[19,524243,99],[19,524244,100],[19,524245,101],[19,524246,102],[19,524247,117],[19,524248,97],[19,524249,91],[19,524250,92],[19,524251,93],[19,524252,94],[19,524253,95],[19,524254,96],[19,524255,104],[19,524256,111],[19,524257,112],[19,524258,113],[19,524259,114],[19,524260,115],[19,524261,116],[19,524262,110],[19,524263,105],[19,524264,106],[19,524265,107],[19,524266,108],[19,524267,109],[19,524268,118],[19,524269,6],[19,524270,8],[19,524271,9],[19,524272,10],[19,524273,5],[19,524274,103],[19,524275,120],[19,524276,119],[19,524277,4],[19,524278,7],[19,524279,15],[19,524280,16],[19,524281,18],[19,524282,20],[19,524283,17],[19,524284,11],[19,524285,12],[19,524286,14],[19,524287,13]],be=[[[1,0,0,0,0,0],[5,16,1,0,0,0],[5,17,-1,0,0,0],[5,18,0,0,0,-1],[5,19,0,1,0,0],[5,20,0,0,0,1],[5,21,0,0,-1,0],[5,22,0,0,1,0],[5,23,0,-1,0,0],[7,96,1,-1,0,0],[7,97,-1,1,0,0],[7,98,0,0,-1,1],[7,99,0,1,-1,0],[7,100,0,-1,1,0],[7,101,0,0,1,-1],[7,102,1,1,0,0],[7,103,0,0,-1,-1],[7,104,-1,-1,0,0],[7,105,0,-1,-1,0],[7,106,1,0,-1,0],[7,107,0,1,0,-1],[7,108,-1,0,1,0],[7,109,0,0,1,1],[7,110,1,0,1,0],[7,111,0,-1,0,1],[7,112,0,1,1,0],[7,113,0,1,0,1],[7,114,-1,0,-1,0],[7,115,1,0,0,1],[7,116,-1,0,0,-1],[7,117,1,0,0,-1],[7,118,-1,0,0,1],[7,119,0,-1,0,-1],[9,480,1,1,-1,0],[9,481,-1,1,-1,0],[9,482,1,-1,1,0],[9,483,0,1,1,-1],[9,484,0,1,-1,1],[9,485,0,-1,1,1],[9,486,0,-1,1,-1],[9,487,1,-1,-1,0],[9,488,1,0,-1,1],[9,489,0,1,-1,-1],[9,490,-1,1,1,0],[9,491,-1,0,1,-1],[9,492,-1,-1,1,0],[9,493,0,-1,-1,1],[9,494,1,-1,0,1],[9,495,1,-1,0,-1],[9,496,-1,1,0,-1],[9,497,-1,-1,-1,0],[9,498,0,-1,-1,-1],[9,499,0,1,1,1],[9,500,1,0,1,-1],[9,501,1,1,0,1],[9,502,-1,1,0,1],[9,503,1,1,1,0],[10,1008,-1,-1,0,1],[10,1009,-1,0,-1,-1],[10,1010,1,1,0,-1],[10,1011,1,0,-1,-1],[10,1012,-1,0,-1,1],[10,1013,-1,-1,0,-1],[10,1014,-1,0,1,1],[10,1015,1,0,1,1],[11,2032,1,-1,1,-1],[11,2033,-1,1,-1,1],[11,2034,-1,1,1,-1],[11,2035,1,-1,-1,1],[11,2036,1,1,1,1],[11,2037,-1,-1,1,1],[11,2038,1,1,-1,-1],[11,2039,-1,-1,1,-1],[11,2040,-1,-1,-1,-1],[11,2041,1,1,-1,1],[11,2042,1,-1,1,1],[11,2043,-1,1,1,1],[11,2044,-1,1,-1,-1],[11,2045,-1,-1,-1,1],[11,2046,1,-1,-1,-1],[11,2047,1,1,1,-1]],[[3,0,0,0,0,0],[4,2,1,0,0,0],[5,6,-1,0,0,0],[5,7,0,0,0,1],[5,8,0,0,-1,0],[5,9,0,0,0,-1],[5,10,0,-1,0,0],[5,11,0,0,1,0],[5,12,0,1,0,0],[6,26,0,-1,1,0],[6,27,-1,1,0,0],[6,28,0,1,-1,0],[6,29,0,0,1,-1],[6,30,0,1,0,-1],[6,31,0,0,-1,1],[6,32,-1,0,0,-1],[6,33,1,-1,0,0],[6,34,1,0,-1,0],[6,35,-1,-1,0,0],[6,36,0,0,-1,-1],[6,37,1,0,1,0],[6,38,1,0,0,1],[6,39,0,-1,0,1],[6,40,-1,0,1,0],[6,41,0,1,0,1],[6,42,0,-1,-1,0],[6,43,-1,0,0,1],[6,44,0,-1,0,-1],[6,45,-1,0,-1,0],[6,46,1,1,0,0],[6,47,0,1,1,0],[6,48,0,0,1,1],[6,49,1,0,0,-1],[7,100,0,1,-1,1],[7,101,1,0,-1,1],[7,102,-1,1,-1,0],[7,103,0,-1,1,-1],[7,104,1,-1,1,0],[7,105,1,1,0,-1],[7,106,1,0,1,1],[7,107,-1,1,1,0],[7,108,0,-1,-1,1],[7,109,1,1,1,0],[7,110,-1,0,1,-1],[7,111,-1,-1,-1,0],[7,112,-1,0,-1,1],[7,113,1,-1,-1,0],[7,114,1,1,-1,0],[8,230,1,-1,0,1],[8,231,-1,1,0,-1],[8,232,-1,-1,1,0],[8,233,-1,0,1,1],[8,234,-1,-1,0,1],[8,235,-1,-1,0,-1],[8,236,0,-1,-1,-1],[8,237,1,0,1,-1],[8,238,1,0,-1,-1],[8,239,0,1,-1,-1],[8,240,0,1,1,1],[8,241,-1,1,0,1],[8,242,-1,0,-1,-1],[8,243,0,1,1,-1],[8,244,1,-1,0,-1],[8,245,0,-1,1,1],[8,246,1,1,0,1],[8,247,1,-1,1,-1],[8,248,-1,1,-1,1],[9,498,1,-1,-1,1],[9,499,-1,-1,-1,-1],[9,500,-1,1,1,-1],[9,501,-1,1,1,1],[9,502,1,1,1,1],[9,503,-1,-1,1,-1],[9,504,1,-1,1,1],[9,505,-1,1,-1,-1],[9,506,-1,-1,1,1],[9,507,1,1,-1,-1],[9,508,1,-1,-1,-1],[9,509,-1,-1,-1,1],[9,510,1,1,-1,1],[9,511,1,1,1,-1]],[[1,0,0,0,0,0],[4,8,1,0,0,0],[4,9,0,0,0,1],[4,10,0,1,0,0],[4,11,0,0,1,0],[5,24,1,1,0,0],[5,25,0,0,1,1],[6,52,0,1,1,0],[6,53,0,1,0,1],[6,54,1,0,1,0],[6,55,0,1,1,1],[6,56,1,0,0,1],[6,57,1,1,1,0],[7,116,1,1,1,1],[7,117,1,0,1,1],[7,118,1,1,0,1],[8,238,2,0,0,0],[8,239,0,0,0,2],[8,240,0,0,1,2],[8,241,2,1,0,0],[8,242,1,2,1,0],[9,486,0,0,2,1],[9,487,0,1,2,1],[9,488,1,2,0,0],[9,489,0,1,1,2],[9,490,2,1,1,0],[9,491,0,0,2,0],[9,492,0,2,1,0],[9,493,0,1,2,0],[9,494,0,2,0,0],[9,495,0,1,0,2],[9,496,2,0,1,0],[9,497,1,2,1,1],[9,498,0,2,1,1],[9,499,1,1,2,0],[9,500,1,1,2,1],[10,1002,1,2,0,1],[10,1003,1,0,2,0],[10,1004,1,0,2,1],[10,1005,0,2,0,1],[10,1006,2,1,1,1],[10,1007,1,1,1,2],[10,1008,2,1,0,1],[10,1009,1,0,1,2],[10,1010,0,0,2,2],[10,1011,0,1,2,2],[10,1012,2,2,1,0],[10,1013,1,2,2,0],[10,1014,1,0,0,2],[10,1015,2,0,0,1],[10,1016,0,2,2,1],[11,2034,2,2,0,0],[11,2035,1,2,2,1],[11,2036,1,1,0,2],[11,2037,2,0,1,1],[11,2038,1,1,2,2],[11,2039,2,2,1,1],[11,2040,0,2,2,0],[11,2041,0,2,1,2],[12,4084,1,0,2,2],[12,4085,2,2,0,1],[12,4086,2,1,2,0],[12,4087,2,2,2,0],[12,4088,0,2,2,2],[12,4089,2,2,2,1],[12,4090,2,1,2,1],[12,4091,1,2,1,2],[12,4092,1,2,2,2],[13,8186,0,2,0,2],[13,8187,2,0,2,0],[13,8188,1,2,0,2],[14,16378,2,0,2,1],[14,16379,2,1,1,2],[14,16380,2,1,0,2],[15,32762,2,2,2,2],[15,32763,2,2,1,2],[15,32764,2,1,2,2],[15,32765,2,0,1,2],[15,32766,2,0,0,2],[16,65534,2,2,0,2],[16,65535,2,0,2,2]],[[4,0,1,1,1,1],[4,1,0,1,1,1],[4,2,1,1,0,1],[4,3,1,1,1,0],[4,4,1,0,1,1],[4,5,1,0,0,0],[4,6,1,1,0,0],[4,7,0,0,0,0],[4,8,0,0,1,1],[4,9,1,0,1,0],[5,20,1,0,0,1],[5,21,0,1,1,0],[5,22,0,0,0,1],[5,23,0,1,0,1],[5,24,0,0,1,0],[5,25,0,1,0,0],[7,104,2,1,1,1],[7,105,1,1,2,1],[7,106,1,2,1,1],[7,107,1,1,1,2],[7,108,2,1,1,0],[7,109,2,1,0,1],[7,110,1,2,1,0],[7,111,2,0,1,1],[7,112,0,1,2,1],[8,226,0,1,1,2],[8,227,1,1,2,0],[8,228,0,2,1,1],[8,229,1,0,1,2],[8,230,1,2,0,1],[8,231,1,1,0,2],[8,232,1,0,2,1],[8,233,2,1,0,0],[8,234,2,0,1,0],[8,235,1,2,0,0],[8,236,2,0,0,1],[8,237,0,1,0,2],[8,238,0,2,1,0],[8,239,0,0,1,2],[8,240,0,1,2,0],[8,241,0,2,0,1],[8,242,1,0,0,2],[8,243,0,0,2,1],[8,244,1,0,2,0],[8,245,2,0,0,0],[8,246,0,0,0,2],[9,494,0,2,0,0],[9,495,0,0,2,0],[9,496,1,2,2,1],[9,497,2,2,1,1],[9,498,2,1,2,1],[9,499,1,1,2,2],[9,500,1,2,1,2],[9,501,2,1,1,2],[10,1004,1,2,2,0],[10,1005,2,2,1,0],[10,1006,2,1,2,0],[10,1007,0,2,2,1],[10,1008,0,1,2,2],[10,1009,2,2,0,1],[10,1010,0,2,1,2],[10,1011,2,0,2,1],[10,1012,1,0,2,2],[10,1013,2,2,2,1],[10,1014,1,2,0,2],[10,1015,2,0,1,2],[10,1016,2,1,0,2],[10,1017,1,2,2,2],[11,2036,2,1,2,2],[11,2037,2,2,1,2],[11,2038,0,2,2,0],[11,2039,2,2,0,0],[11,2040,0,0,2,2],[11,2041,2,0,2,0],[11,2042,0,2,0,2],[11,2043,2,0,0,2],[11,2044,2,2,2,2],[11,2045,0,2,2,2],[11,2046,2,2,2,0],[12,4094,2,2,0,2],[12,4095,2,0,2,2]],[[1,0,0,0],[4,8,-1,0],[4,9,1,0],[4,10,0,1],[4,11,0,-1],[5,24,1,-1],[5,25,-1,1],[5,26,-1,-1],[5,27,1,1],[7,112,-2,0],[7,113,0,2],[7,114,2,0],[7,115,0,-2],[8,232,-2,-1],[8,233,2,1],[8,234,-1,-2],[8,235,1,2],[8,236,-2,1],[8,237,2,-1],[8,238,-1,2],[8,239,1,-2],[8,240,-3,0],[8,241,3,0],[8,242,0,-3],[8,243,0,3],[9,488,-3,-1],[9,489,1,3],[9,490,3,1],[9,491,-1,-3],[9,492,-3,1],[9,493,3,-1],[9,494,1,-3],[9,495,-1,3],[9,496,-2,2],[9,497,2,2],[9,498,-2,-2],[9,499,2,-2],[10,1e3,-3,-2],[10,1001,3,-2],[10,1002,-2,3],[10,1003,2,-3],[10,1004,3,2],[10,1005,2,3],[10,1006,-3,2],[10,1007,-2,-3],[10,1008,0,-4],[10,1009,-4,0],[10,1010,4,1],[10,1011,4,0],[11,2024,-4,-1],[11,2025,0,4],[11,2026,4,-1],[11,2027,-1,-4],[11,2028,1,4],[11,2029,-1,4],[11,2030,-4,1],[11,2031,1,-4],[11,2032,3,-3],[11,2033,-3,-3],[11,2034,-3,3],[11,2035,-2,4],[11,2036,-4,-2],[11,2037,4,2],[11,2038,2,-4],[11,2039,2,4],[11,2040,3,3],[11,2041,-4,2],[12,4084,-2,-4],[12,4085,4,-2],[12,4086,3,-4],[12,4087,-4,-3],[12,4088,-4,3],[12,4089,3,4],[12,4090,-3,4],[12,4091,4,3],[12,4092,4,-3],[12,4093,-3,-4],[13,8188,4,-4],[13,8189,-4,4],[13,8190,4,4],[13,8191,-4,-4]],[[4,0,0,0],[4,1,1,0],[4,2,0,-1],[4,3,0,1],[4,4,-1,0],[4,5,1,1],[4,6,-1,1],[4,7,1,-1],[4,8,-1,-1],[6,36,2,-1],[6,37,2,1],[6,38,-2,1],[6,39,-2,-1],[6,40,-2,0],[6,41,-1,2],[6,42,2,0],[6,43,1,-2],[6,44,1,2],[6,45,0,-2],[6,46,-1,-2],[6,47,0,2],[6,48,2,-2],[6,49,-2,2],[6,50,-2,-2],[6,51,2,2],[7,104,-3,1],[7,105,3,1],[7,106,3,-1],[7,107,-1,3],[7,108,-3,-1],[7,109,1,3],[7,110,1,-3],[7,111,-1,-3],[7,112,3,0],[7,113,-3,0],[7,114,0,-3],[7,115,0,3],[7,116,3,2],[8,234,-3,-2],[8,235,-2,3],[8,236,2,3],[8,237,3,-2],[8,238,2,-3],[8,239,-2,-3],[8,240,-3,2],[8,241,3,3],[9,484,3,-3],[9,485,-3,-3],[9,486,-3,3],[9,487,1,-4],[9,488,-1,-4],[9,489,4,1],[9,490,-4,1],[9,491,-4,-1],[9,492,1,4],[9,493,4,-1],[9,494,-1,4],[9,495,0,-4],[9,496,-4,2],[9,497,-4,-2],[9,498,2,4],[9,499,-2,-4],[9,500,-4,0],[9,501,4,2],[9,502,4,-2],[9,503,-2,4],[9,504,4,0],[9,505,2,-4],[9,506,0,4],[10,1014,-3,-4],[10,1015,-3,4],[10,1016,3,-4],[10,1017,4,-3],[10,1018,3,4],[10,1019,4,3],[10,1020,-4,3],[10,1021,-4,-3],[11,2044,4,4],[11,2045,-4,4],[11,2046,-4,-4],[11,2047,4,-4]],[[1,0,0,0],[3,4,1,0],[3,5,0,1],[4,12,1,1],[6,52,2,1],[6,53,1,2],[6,54,2,0],[6,55,0,2],[7,112,3,1],[7,113,1,3],[7,114,2,2],[7,115,3,0],[7,116,0,3],[8,234,2,3],[8,235,3,2],[8,236,1,4],[8,237,4,1],[8,238,1,5],[8,239,5,1],[8,240,3,3],[8,241,2,4],[8,242,0,4],[8,243,4,0],[9,488,4,2],[9,489,2,5],[9,490,5,2],[9,491,0,5],[9,492,6,1],[9,493,5,0],[9,494,1,6],[9,495,4,3],[9,496,3,5],[9,497,3,4],[9,498,5,3],[9,499,2,6],[9,500,6,2],[9,501,1,7],[10,1004,3,6],[10,1005,0,6],[10,1006,6,0],[10,1007,4,4],[10,1008,7,1],[10,1009,4,5],[10,1010,7,2],[10,1011,5,4],[10,1012,6,3],[10,1013,2,7],[10,1014,7,3],[10,1015,6,4],[10,1016,5,5],[10,1017,4,6],[10,1018,3,7],[11,2038,7,0],[11,2039,0,7],[11,2040,6,5],[11,2041,5,6],[11,2042,7,4],[11,2043,4,7],[11,2044,5,7],[11,2045,7,5],[12,4092,7,6],[12,4093,6,6],[12,4094,6,7],[12,4095,7,7]],[[3,0,1,1],[4,2,2,1],[4,3,1,0],[4,4,1,2],[4,5,0,1],[4,6,2,2],[5,14,0,0],[5,15,2,0],[5,16,0,2],[5,17,3,1],[5,18,1,3],[5,19,3,2],[5,20,2,3],[6,42,3,3],[6,43,4,1],[6,44,1,4],[6,45,4,2],[6,46,2,4],[6,47,3,0],[6,48,0,3],[6,49,4,3],[6,50,3,4],[6,51,5,2],[7,104,5,1],[7,105,2,5],[7,106,1,5],[7,107,5,3],[7,108,3,5],[7,109,4,4],[7,110,5,4],[7,111,0,4],[7,112,4,5],[7,113,4,0],[7,114,2,6],[7,115,6,2],[7,116,6,1],[7,117,1,6],[8,236,3,6],[8,237,6,3],[8,238,5,5],[8,239,5,0],[8,240,6,4],[8,241,0,5],[8,242,4,6],[8,243,7,1],[8,244,7,2],[8,245,2,7],[8,246,6,5],[8,247,7,3],[8,248,1,7],[8,249,5,6],[8,250,3,7],[9,502,6,6],[9,503,7,4],[9,504,6,0],[9,505,4,7],[9,506,0,6],[9,507,7,5],[9,508,7,6],[9,509,6,7],[10,1020,5,7],[10,1021,7,0],[10,1022,0,7],[10,1023,7,7]],[[1,0,0,0],[3,4,1,0],[3,5,0,1],[4,12,1,1],[6,52,2,1],[6,53,1,2],[6,54,2,0],[6,55,0,2],[7,112,3,1],[7,113,2,2],[7,114,1,3],[8,230,3,0],[8,231,0,3],[8,232,2,3],[8,233,3,2],[8,234,1,4],[8,235,4,1],[8,236,2,4],[8,237,1,5],[9,476,4,2],[9,477,3,3],[9,478,0,4],[9,479,4,0],[9,480,5,1],[9,481,2,5],[9,482,1,6],[9,483,3,4],[9,484,5,2],[9,485,6,1],[9,486,4,3],[10,974,0,5],[10,975,2,6],[10,976,5,0],[10,977,1,7],[10,978,3,5],[10,979,1,8],[10,980,8,1],[10,981,4,4],[10,982,5,3],[10,983,6,2],[10,984,7,1],[10,985,0,6],[10,986,8,2],[10,987,2,8],[10,988,3,6],[10,989,2,7],[10,990,4,5],[10,991,9,1],[10,992,1,9],[10,993,7,2],[11,1988,6,0],[11,1989,5,4],[11,1990,6,3],[11,1991,8,3],[11,1992,0,7],[11,1993,9,2],[11,1994,3,8],[11,1995,4,6],[11,1996,3,7],[11,1997,0,8],[11,1998,10,1],[11,1999,6,4],[11,2e3,2,9],[11,2001,5,5],[11,2002,8,0],[11,2003,7,0],[11,2004,7,3],[11,2005,10,2],[11,2006,9,3],[11,2007,8,4],[11,2008,1,10],[11,2009,7,4],[11,2010,6,5],[11,2011,5,6],[11,2012,4,8],[11,2013,4,7],[11,2014,3,9],[11,2015,11,1],[11,2016,5,8],[11,2017,9,0],[11,2018,8,5],[12,4038,10,3],[12,4039,2,10],[12,4040,0,9],[12,4041,11,2],[12,4042,9,4],[12,4043,6,6],[12,4044,12,1],[12,4045,4,9],[12,4046,8,6],[12,4047,1,11],[12,4048,9,5],[12,4049,10,4],[12,4050,5,7],[12,4051,7,5],[12,4052,2,11],[12,4053,1,12],[12,4054,12,2],[12,4055,11,3],[12,4056,3,10],[12,4057,5,9],[12,4058,6,7],[12,4059,8,7],[12,4060,11,4],[12,4061,0,10],[12,4062,7,6],[12,4063,12,3],[12,4064,10,0],[12,4065,10,5],[12,4066,4,10],[12,4067,6,8],[12,4068,2,12],[12,4069,9,6],[12,4070,9,7],[12,4071,4,11],[12,4072,11,0],[12,4073,6,9],[12,4074,3,11],[12,4075,5,10],[13,8152,8,8],[13,8153,7,8],[13,8154,12,5],[13,8155,3,12],[13,8156,11,5],[13,8157,7,7],[13,8158,12,4],[13,8159,11,6],[13,8160,10,6],[13,8161,4,12],[13,8162,7,9],[13,8163,5,11],[13,8164,0,11],[13,8165,12,6],[13,8166,6,10],[13,8167,12,0],[13,8168,10,7],[13,8169,5,12],[13,8170,7,10],[13,8171,9,8],[13,8172,0,12],[13,8173,11,7],[13,8174,8,9],[13,8175,9,9],[13,8176,10,8],[13,8177,7,11],[13,8178,12,7],[13,8179,6,11],[13,8180,8,11],[13,8181,11,8],[13,8182,7,12],[13,8183,6,12],[14,16368,8,10],[14,16369,10,9],[14,16370,8,12],[14,16371,9,10],[14,16372,9,11],[14,16373,9,12],[14,16374,10,11],[14,16375,12,9],[14,16376,10,10],[14,16377,11,9],[14,16378,12,8],[14,16379,11,10],[14,16380,12,10],[14,16381,12,11],[15,32764,10,12],[15,32765,11,11],[15,32766,11,12],[15,32767,12,12]],[[4,0,1,1],[4,1,1,2],[4,2,2,1],[5,6,2,2],[5,7,1,0],[5,8,0,1],[5,9,1,3],[5,10,3,2],[5,11,3,1],[5,12,2,3],[5,13,3,3],[6,28,2,0],[6,29,0,2],[6,30,2,4],[6,31,4,2],[6,32,1,4],[6,33,4,1],[6,34,0,0],[6,35,4,3],[6,36,3,4],[6,37,3,0],[6,38,0,3],[6,39,4,4],[6,40,2,5],[6,41,5,2],[7,84,1,5],[7,85,5,1],[7,86,5,3],[7,87,3,5],[7,88,5,4],[7,89,4,5],[7,90,6,2],[7,91,2,6],[7,92,6,3],[7,93,4,0],[7,94,6,1],[7,95,0,4],[7,96,1,6],[7,97,3,6],[7,98,5,5],[7,99,6,4],[7,100,4,6],[8,202,6,5],[8,203,7,2],[8,204,3,7],[8,205,2,7],[8,206,5,6],[8,207,8,2],[8,208,7,3],[8,209,5,0],[8,210,7,1],[8,211,0,5],[8,212,8,1],[8,213,1,7],[8,214,8,3],[8,215,7,4],[8,216,4,7],[8,217,2,8],[8,218,6,6],[8,219,7,5],[8,220,1,8],[8,221,3,8],[8,222,8,4],[8,223,4,8],[8,224,5,7],[8,225,8,5],[8,226,5,8],[9,454,7,6],[9,455,6,7],[9,456,9,2],[9,457,6,0],[9,458,6,8],[9,459,9,3],[9,460,3,9],[9,461,9,1],[9,462,2,9],[9,463,0,6],[9,464,8,6],[9,465,9,4],[9,466,4,9],[9,467,10,2],[9,468,1,9],[9,469,7,7],[9,470,8,7],[9,471,9,5],[9,472,7,8],[9,473,10,3],[9,474,5,9],[9,475,10,4],[9,476,2,10],[9,477,10,1],[9,478,3,10],[9,479,9,6],[9,480,6,9],[9,481,8,0],[9,482,4,10],[9,483,7,0],[9,484,11,2],[10,970,7,9],[10,971,11,3],[10,972,10,6],[10,973,1,10],[10,974,11,1],[10,975,9,7],[10,976,0,7],[10,977,8,8],[10,978,10,5],[10,979,3,11],[10,980,5,10],[10,981,8,9],[10,982,11,5],[10,983,0,8],[10,984,11,4],[10,985,2,11],[10,986,7,10],[10,987,6,10],[10,988,10,7],[10,989,4,11],[10,990,1,11],[10,991,12,2],[10,992,9,8],[10,993,12,3],[10,994,11,6],[10,995,5,11],[10,996,12,4],[10,997,11,7],[10,998,12,5],[10,999,3,12],[10,1e3,6,11],[10,1001,9,0],[10,1002,10,8],[10,1003,10,0],[10,1004,12,1],[10,1005,0,9],[10,1006,4,12],[10,1007,9,9],[10,1008,12,6],[10,1009,2,12],[10,1010,8,10],[11,2022,9,10],[11,2023,1,12],[11,2024,11,8],[11,2025,12,7],[11,2026,7,11],[11,2027,5,12],[11,2028,6,12],[11,2029,10,9],[11,2030,8,11],[11,2031,12,8],[11,2032,0,10],[11,2033,7,12],[11,2034,11,0],[11,2035,10,10],[11,2036,11,9],[11,2037,11,10],[11,2038,0,11],[11,2039,11,11],[11,2040,9,11],[11,2041,10,11],[11,2042,12,0],[11,2043,8,12],[12,4088,12,9],[12,4089,10,12],[12,4090,9,12],[12,4091,11,12],[12,4092,12,11],[12,4093,0,12],[12,4094,12,10],[12,4095,12,12]],[[4,0,0,0],[4,1,1,1],[5,4,16,16],[5,5,1,0],[5,6,0,1],[5,7,2,1],[5,8,1,2],[5,9,2,2],[6,20,1,3],[6,21,3,1],[6,22,3,2],[6,23,2,0],[6,24,2,3],[6,25,0,2],[6,26,3,3],[7,54,4,1],[7,55,1,4],[7,56,4,2],[7,57,2,4],[7,58,4,3],[7,59,3,4],[7,60,3,0],[7,61,0,3],[7,62,5,1],[7,63,5,2],[7,64,2,5],[7,65,4,4],[7,66,1,5],[7,67,5,3],[7,68,3,5],[7,69,5,4],[8,140,4,5],[8,141,6,2],[8,142,2,6],[8,143,6,1],[8,144,6,3],[8,145,3,6],[8,146,1,6],[8,147,4,16],[8,148,3,16],[8,149,16,5],[8,150,16,3],[8,151,16,4],[8,152,6,4],[8,153,16,6],[8,154,4,0],[8,155,4,6],[8,156,0,4],[8,157,2,16],[8,158,5,5],[8,159,5,16],[8,160,16,7],[8,161,16,2],[8,162,16,8],[8,163,2,7],[8,164,7,2],[8,165,3,7],[8,166,6,5],[8,167,5,6],[8,168,6,16],[8,169,16,10],[8,170,7,3],[8,171,7,1],[8,172,16,9],[8,173,7,16],[8,174,1,16],[8,175,1,7],[8,176,4,7],[8,177,16,11],[8,178,7,4],[8,179,16,12],[8,180,8,16],[8,181,16,1],[8,182,6,6],[8,183,9,16],[8,184,2,8],[8,185,5,7],[8,186,10,16],[8,187,16,13],[8,188,8,3],[8,189,8,2],[8,190,3,8],[8,191,5,0],[8,192,16,14],[8,193,11,16],[8,194,7,5],[8,195,4,8],[8,196,6,7],[8,197,7,6],[8,198,0,5],[9,398,8,4],[9,399,16,15],[9,400,12,16],[9,401,1,8],[9,402,8,1],[9,403,14,16],[9,404,5,8],[9,405,13,16],[9,406,3,9],[9,407,8,5],[9,408,7,7],[9,409,2,9],[9,410,8,6],[9,411,9,2],[9,412,9,3],[9,413,15,16],[9,414,4,9],[9,415,6,8],[9,416,6,0],[9,417,9,4],[9,418,5,9],[9,419,8,7],[9,420,7,8],[9,421,1,9],[9,422,10,3],[9,423,0,6],[9,424,10,2],[9,425,9,1],[9,426,9,5],[9,427,4,10],[9,428,2,10],[9,429,9,6],[9,430,3,10],[9,431,6,9],[9,432,10,4],[9,433,8,8],[9,434,10,5],[9,435,9,7],[9,436,11,3],[9,437,1,10],[9,438,7,0],[9,439,10,6],[9,440,7,9],[9,441,3,11],[9,442,5,10],[9,443,10,1],[9,444,4,11],[9,445,11,2],[9,446,13,2],[9,447,6,10],[9,448,13,3],[9,449,2,11],[9,450,16,0],[9,451,5,11],[9,452,11,5],[10,906,11,4],[10,907,9,8],[10,908,7,10],[10,909,8,9],[10,910,0,16],[10,911,4,13],[10,912,0,7],[10,913,3,13],[10,914,11,6],[10,915,13,1],[10,916,13,4],[10,917,12,3],[10,918,2,13],[10,919,13,5],[10,920,8,10],[10,921,6,11],[10,922,10,8],[10,923,10,7],[10,924,14,2],[10,925,12,4],[10,926,1,11],[10,927,4,12],[10,928,11,1],[10,929,3,12],[10,930,1,13],[10,931,12,2],[10,932,7,11],[10,933,3,14],[10,934,5,12],[10,935,5,13],[10,936,14,4],[10,937,4,14],[10,938,11,7],[10,939,14,3],[10,940,12,5],[10,941,13,6],[10,942,12,6],[10,943,8,0],[10,944,11,8],[10,945,2,12],[10,946,9,9],[10,947,14,5],[10,948,6,13],[10,949,10,10],[10,950,15,2],[10,951,8,11],[10,952,9,10],[10,953,14,6],[10,954,10,9],[10,955,5,14],[10,956,11,9],[10,957,14,1],[10,958,2,14],[10,959,6,12],[10,960,1,12],[10,961,13,8],[10,962,0,8],[10,963,13,7],[10,964,7,12],[10,965,12,7],[10,966,7,13],[10,967,15,3],[10,968,12,1],[10,969,6,14],[10,970,2,15],[10,971,15,5],[10,972,15,4],[10,973,1,14],[10,974,9,11],[10,975,4,15],[10,976,14,7],[10,977,8,13],[10,978,13,9],[10,979,8,12],[10,980,5,15],[10,981,3,15],[10,982,10,11],[10,983,11,10],[10,984,12,8],[10,985,15,6],[10,986,15,7],[10,987,8,14],[10,988,15,1],[10,989,7,14],[10,990,9,0],[10,991,0,9],[10,992,9,13],[10,993,9,12],[10,994,12,9],[10,995,14,8],[10,996,10,13],[10,997,14,9],[10,998,12,10],[10,999,6,15],[10,1e3,7,15],[11,2002,9,14],[11,2003,15,8],[11,2004,11,11],[11,2005,11,14],[11,2006,1,15],[11,2007,10,12],[11,2008,10,14],[11,2009,13,11],[11,2010,13,10],[11,2011,11,13],[11,2012,11,12],[11,2013,8,15],[11,2014,14,11],[11,2015,13,12],[11,2016,12,13],[11,2017,15,9],[11,2018,14,10],[11,2019,10,0],[11,2020,12,11],[11,2021,9,15],[11,2022,0,10],[11,2023,12,12],[11,2024,11,0],[11,2025,12,14],[11,2026,10,15],[11,2027,13,13],[11,2028,0,13],[11,2029,14,12],[11,2030,15,10],[11,2031,15,11],[11,2032,11,15],[11,2033,14,13],[11,2034,13,0],[11,2035,0,11],[11,2036,13,14],[11,2037,15,12],[11,2038,15,13],[11,2039,12,15],[11,2040,14,0],[11,2041,14,14],[11,2042,13,15],[11,2043,12,0],[11,2044,14,15],[12,4090,0,14],[12,4091,0,12],[12,4092,15,14],[12,4093,15,0],[12,4094,0,15],[12,4095,15,15]]],X=[!1,!1,!0,!0,!1,!1,!0,!0,!0,!0,!0],ye=function(){function k(){}return k.M=function(P,Z){for(var he=0,Ie=Z[he][0],Ee=Object(B.a)(P,Ie);Ee!==Z[he][1];){var pe=Z[++he][0]-Ie;Ie=Z[he][0],Ee<<=pe,Ee|=Object(B.a)(P,pe)}return he},k.S=function(P,Z,he,Ie){for(var Ee=he;Ee<he+Ie;Ee++)Z[Ee]&&Object(B.a)(P,1)&&(Z[Ee]=-Z[Ee])},k.T=function(P,Z){for(var he=4;Object(B.a)(P,1);)he++;var Ie=Object(B.a)(P,he)|1<<he;return Z<0?-Ie:Ie},k.decodeScaleFactor=function(P){var Z=this.M(P,J);return J[Z][2]},k.decodeSpectralData=function(P,Z,he,Ie){var Ee=be[Z-1],pe=this.M(P,Ee);if(he[Ie]=Ee[pe][2],he[Ie+1]=Ee[pe][3],Z<5&&(he[Ie+2]=Ee[pe][4],he[Ie+3]=Ee[pe][5]),Z<11)X[Z-1]&&this.S(P,he,Ie,Z<5?4:2);else{if(!(Z===11||Z>15))throw new Error("Huffman: unknown spectral codebook: "+Z);this.S(P,he,Ie,Z<5?4:2),Math.abs(he[Ie])===16&&(he[Ie]=this.T(P,he[Ie])),Math.abs(he[Ie+1])===16&&(he[Ie+1]=this.T(P,he[Ie+1]))}},k}(),Be=n(4),Ve=function(k){return k[k.ID_SCE=0]="ID_SCE",k[k.ID_CPE=1]="ID_CPE",k[k.ID_CCE=2]="ID_CCE",k[k.ID_LFE=3]="ID_LFE",k[k.ID_DSE=4]="ID_DSE",k[k.ID_PCE=5]="ID_PCE",k[k.ID_FIL=6]="ID_FIL",k[k.ID_END=7]="ID_END",k}({}),je=function(k){return k[k.ONLY_LONG_SEQUENCE=0]="ONLY_LONG_SEQUENCE",k[k.LONG_START_SEQUENCE=1]="LONG_START_SEQUENCE",k[k.EIGHT_SHORT_SEQUENCE=2]="EIGHT_SHORT_SEQUENCE",k[k.LONG_STOP_SEQUENCE=3]="LONG_STOP_SEQUENCE",k}(je||{}),we="Input buffer exhausted before END element found",ue="Pulse data corrupt or invalid",L=[1,4,3],D=[2,6,5],le=function(k){return k[k.BEFORE_TNS=0]="BEFORE_TNS",k[k.AFTER_TNS=1]="AFTER_TNS",k[k.AFTER_IMDCT=2]="AFTER_IMDCT",k}(le||{}),oe="aac-raw-block",Re=function(){function k(){}return k.decode=function(P,Z,he){for(var Ie={sampling_frequency_index:Z,aot:he,ics:{window_sequence:0,num_windows:0,max_sfb:0,num_window_groups:0,window_group_length:[],num_swb:0,swb_offset:[],predictor_present:0},sfb_cb:[],sect_end:[]},Ee=Object(B.c)(P),pe=[];Object(B.d)(Ee)>3;){var G=Object(B.a)(Ee,3);if(G===Ve.ID_CPE)this.D(Ie,Ee);else if(G===Ve.ID_CCE)this.L(Ie,Ee);else if(G===Ve.ID_LFE||G===Ve.ID_SCE)this.V(Ie,Ee);else if(G===Ve.ID_DSE)this.U(Ee);else if(G===Ve.ID_PCE)this.P(Ie,Ee);else{if(G!==Ve.ID_FIL)break;var te=this.H(Ee);if(te){var ie=this.K(Ee,te);ie&&pe.push(ie)}}}if(Object(B.b)(Ee),pe.length)return{priv:pe}},k.K=function(P,Z){var he=Z.byteIndex;if(!(he<6)){var Ie=P.data;he-=2;var Ee=Object(Be.f)(Ie,he);if(Ie[he-=2]===75&&Ie[he+1]===83){var pe=Ie[he-=1];if(he-pe<0)return;var G=Ie.subarray(he-pe,he+3);if(G[0]===0&&G[1]===pe-2&&Ee===function(te){for(var ie=0,ee=0,Te=0;Te<te.length;Te++)ee=(ee+(ie=(ie+te[Te])%255))%255;return ee<<8|ie}(G))return{id:G[0],checkSum:Ee,data:Ie.subarray(he-pe+2,he)}}}},k.P=function(P,Z){Object(B.g)(Z,6),P.sampling_frequency_index=Object(B.a)(Z,4);var he=Object(B.a)(Z,4),Ie=Object(B.a)(Z,4),Ee=Object(B.a)(Z,4),pe=Object(B.a)(Z,2),G=Object(B.a)(Z,3),te=Object(B.a)(Z,4);Object(B.a)(Z,1)&&Object(B.g)(Z,4),Object(B.a)(Z,1)&&Object(B.g)(Z,4),Object(B.a)(Z,1)&&Object(B.g)(Z,3),Object(B.g)(Z,5*he),Object(B.g)(Z,5*Ie),Object(B.g)(Z,5*Ee),Object(B.g)(Z,4*pe),Object(B.g)(Z,4*G),Object(B.g)(Z,5*te),Object(B.b)(Z);var ie=8*Object(B.a)(Z,8);if(Object(B.d)(Z)<ie)throw new Error("decode_pce: "+we);Object(B.g)(Z,ie)},k.H=function(P){var Z=Object(B.a)(P,4);if(Z===15&&(Z+=Object(B.a)(P,8)-1),Z)return Object(B.g)(P,8*Z),{byteIndex:P.byteIndex,bitIndex:P.bitIndex}},k.V=function(P,Z){Object(B.g)(Z,4),this.W(P,Z,0)},k.D=function(P,Z){Object(B.g)(Z,4);var he=Object(B.a)(Z,1);if(he){this.X(P,Z),P.ics.predictor_present&&P.aot!==z.AOT_AAC_MAIN&&Object(B.a)(Z,1)&&k.J(P,Z);var Ie=Object(B.a)(Z,2);if(Ie===3)throw new Error(oe+' "ms_present = 3 is reserved.');Ie&&k.$(P,Z,Ie)}this.W(P,Z,he),this.W(P,Z,he)},k.$=function(P,Z,he){var Ie=P.ics.num_window_groups*P.ics.max_sfb;he===1&&Object(B.g)(Z,Ie)},k.L=function(P,Z){Object(B.g)(Z,4);for(var he=2*Object(B.a)(Z,1),Ie=Object(B.a)(Z,3),Ee=0,pe=0;pe<=Ie;pe++){Ee++;var G=Object(B.a)(Z,1);Object(B.g)(Z,4),G&&Object(B.a)(Z,2)===3&&Ee++}he+=Object(B.a)(Z,1)||he>>1,Object(B.g)(Z,1),Object(B.g)(Z,2),this.W(P,Z,0);for(var te=0;te<Ee;te++){var ie=1;if(te>0&&(ie=he===le.AFTER_IMDCT?1:Object(B.a)(Z,1))&&ye.decodeScaleFactor(Z),he!==le.AFTER_IMDCT)for(var ee=0;ee<P.ics.num_window_groups;ee++)for(var Te=0;Te<P.ics.max_sfb;Te++)P.sfb_cb[ee][Te]!==0&&ie===0&&ye.decodeScaleFactor(Z)}},k.U=function(P){Object(B.g)(P,4);var Z=Object(B.a)(P,1),he=Object(B.a)(P,8);if(he===255&&(he+=Object(B.a)(P,8)),Z&&Object(B.b)(P),Object(B.d)(P)<8*he)throw new Error(oe+" skip_data_stream_element: "+we);Object(B.g)(P,8*he)},k.W=function(P,Z,he){var Ie=Object(B.a)(Z,8);if(he||this.X(P,Z),this.tt(P,Z),this.it(P,Z,Ie),Object(B.a)(Z,1)){if(P.ics.window_sequence===je.EIGHT_SHORT_SEQUENCE)throw new Error(oe+" error Pulse tool not allowed in eight short sequence.");this.et(P,Z)}Object(B.a)(Z,1)&&this.nt(P,Z),Object(B.a)(Z,1)&&this.rt(P,Z),this.ht(P,Z)},k.tt=function(P,Z){for(var he=P.ics.window_sequence===je.EIGHT_SHORT_SEQUENCE?3:5,Ie=0,Ee=0;Ee<P.ics.num_window_groups;Ee++){P.sfb_cb[Ee]||(P.sfb_cb[Ee]=[]),P.sect_end[Ee]||(P.sect_end[Ee]=[]);for(var pe=0;pe<P.ics.max_sfb;){var G=pe,te=Object(B.a)(Z,4);if(te===12)throw new Error(oe+" invalid band type");var ie=0;do{if(Object(B.d)(Z)<he)throw new Error(oe+" decode_band_types: "+we);if((G+=ie=Object(B.a)(Z,he))>P.ics.max_sfb)throw new Error(oe+" Number of bands("+G+") exceeds limit("+P.ics.max_sfb+").")}while(ie==(1<<he)-1);for(;pe<G;pe++)P.sfb_cb[Ee][Ie]=te,P.sect_end[Ee][Ie++]=G}}},k.it=function(P,Z,he){for(var Ie=0,Ee=1,pe=0;pe<P.ics.num_window_groups;pe++)for(var G=0;G<P.ics.max_sfb;){var te=P.sect_end[pe][Ie];switch(P.sfb_cb[pe][Ie]){case 0:for(;G<te;G++,Ie++);break;case 15:case 14:for(;G<te;G++,Ie++)ye.decodeScaleFactor(Z);break;case 13:for(;G<te;G++,Ie++)Ee-- >0?Object(B.g)(Z,9):ye.decodeScaleFactor(Z);break;default:for(;G<te;G++,Ie++)ye.decodeScaleFactor(Z)}}},k.et=function(P,Z){var he=Object(B.a)(Z,2)+1,Ie=Object(B.a)(Z,6);if(Ie>=P.ics.num_swb)throw new Error(oe+" "+ue);var Ee=[P.ics.swb_offset[Ie]];if(Ee[0]+=Object(B.a)(Z,5),Ee[0]>=P.ics.swb_offset[P.ics.num_swb])throw new Error(oe+" "+ue);for(var pe=[Object(B.a)(Z,4)],G=1;G<he;G++){if(Ee[G]=Object(B.a)(Z,5)+Ee[G-1],Ee[G]>P.ics.swb_offset[P.ics.num_swb])throw new Error(oe+" "+ue);pe[G]=Object(B.a)(Z,4)}},k.nt=function(P,Z){for(var he=P.ics.window_sequence===je.EIGHT_SHORT_SEQUENCE?L:D,Ie=P.ics.window_sequence===je.EIGHT_SHORT_SEQUENCE?7:P.aot===z.AOT_AAC_MAIN?20:12,Ee=0;Ee<P.ics.num_windows;Ee++){var pe=Object(B.a)(Z,he[0]);if(pe)for(var G=Object(B.a)(Z,1),te=0;te<pe;te++){Object(B.g)(Z,he[1]);var ie=Object(B.a)(Z,he[2]);if(ie>Ie)throw new Error(oe+" tns order: "+ie+" > "+Ie);if(ie){Object(B.g)(Z,1);for(var ee=G+3-Object(B.a)(Z,1),Te=0;Te<ie;Te++)Object(B.g)(Z,ee)}}}},k.rt=function(P,Z){for(var he=[[1,0,5],[2,1,2],[8,0,2],[2,1,5]],Ie=P.ics.window_sequence,Ee=Object(B.a)(Z,2),pe=0;pe<Ee;pe++)for(var G=0;G<he[Ie][0];G++)for(var te=Object(B.a)(Z,3),ie=0;ie<te;ie++)Object(B.g)(Z,4+(G==0&&he[Ie][1]?4:he[Ie][2]))},k.ht=function(P,Z){for(var he=P.sfb_cb,Ie=P.ics.swb_offset,Ee=0,pe=0,G=0;G<P.ics.num_window_groups;G++){for(var te=P.ics.window_group_length[G],ie=0;ie<P.ics.max_sfb;ie++,pe++){var ee=he[G][pe],Te=Ie[ie+1]-Ie[ie],Se=Ee+Ie[ie];if(!(ee===0||ee===15||ee===14)&&ee!==13)for(var Ye=0;Ye<te;Ye++,Se+=128)for(var ze=ee>=5?2:4,it=0;it<Te;it+=ze)ye.decodeSpectralData(Z,ee,[0,0,0,0],0)}Ee+=te<<7}},k.X=function(P,Z){var he=P.sampling_frequency_index;if(Object(B.a)(Z,1))throw new Error(oe+", Reserved bit set.");var Ie=P.ics.window_sequence=Object(B.a)(Z,2);if(Object(B.g)(Z,1),P.ics.num_window_groups=1,P.ics.window_group_length[0]=1,Ie===je.EIGHT_SHORT_SEQUENCE){P.ics.max_sfb=Object(B.a)(Z,4);for(var Ee=0;Ee<7;Ee++)Object(B.a)(Z,1)?P.ics.window_group_length[P.ics.num_window_groups-1]++:(P.ics.num_window_groups++,P.ics.window_group_length[P.ics.num_window_groups-1]=1);P.ics.num_windows=8,P.ics.num_swb=d[he],P.ics.swb_offset=K[he],P.ics.predictor_present=0}else if(P.ics.max_sfb=Object(B.a)(Z,6),P.ics.num_windows=1,P.ics.num_swb=s[he],P.ics.swb_offset=w[he],P.ics.predictor_present=Object(B.a)(Z,1),P.ics.predictor_present)if(P.aot===z.AOT_AAC_MAIN)k.ot(P,Z);else{if(P.aot===z.AOT_AAC_LC)throw new Error("Prediction is not allowed in AAC-LC.");Object(B.a)(Z,1)&&k.J(P,Z)}if(P.ics.max_sfb>P.ics.num_swb)throw new Error("Number of scalefactor bands in group ("+P.ics.max_sfb+") exceeds limit ("+P.ics.num_swb+").")},k.ot=function(P,Z){if(Object(B.a)(Z,1)){var he=Object(B.a)(Z,5);if(he===0||he>30)throw new Error("Invalid Predictor Reset Group.")}Object(B.g)(Z,Math.min(P.ics.max_sfb,m[P.sampling_frequency_index]))},k.J=function(P,Z){Object(B.g)(Z,14+Math.min(P.ics.max_sfb,40))},k}(),Oe=n(3),de=n(2),$=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ge="adts";function Pe(k,P,Z){Z===void 0&&(Z="mp4a.40.2"),Z=Z||"mp4a.40.2";var he=$.indexOf(k);if(!(he<0||Z!=="mp4a.40.5"&&Z!=="mp4a.40.2"))return Z==="mp4a.40.5"&&(he+=3),new Uint8Array([((31&(Z==="mp4a.40.2"?2:5))<<3)+(he>>1&7),((1&he)<<7)+((15&P)<<3)])}function ae(k,P,Z,he){if(he<=z.AOT_SBR)try{return Re.decode(P,Z,he)}catch(Ie){k.v(ge,"aac raw error",Ie.message)}}function q(k,P){return k[P]===255&&(246&k[P+1])==240}function b(k,P){return 1&k[P+1]?7:9}function ve(k,P){return(3&k[P+3])<<11|k[P+4]<<3|(224&k[P+5])>>>5}function U(k,P){return!!(P+1<k.length&&q(k,P))}function M(k,P){return k.asc!==Object(Be.f)(P)}function ne(k,P,Z,he,Ie,Ee){if(Ee===void 0&&(Ee=""),M(P,he)||!P.samplerate||!P.configParsed){var pe=Ie===o.a.ADTS?function(G){return{objectType:1+((192&G[0])>>>6),sampleingIndex:(60&G[0])>>>2,chanelConfig:(1&G[0])<<2|(192&G[1])>>>6}}(he):function(G){return{objectType:G[0]>>>3,sampleingIndex:(7&G[0])<<1|G[1]>>>7,chanelConfig:(120&G[1])>>>3}}(he);if(pe.sampleingIndex<0||pe.sampleingIndex>=13)return void Z.emit(de.a.ERROR,Object(Oe.e)(Oe.b.MUX_ERROR,Oe.a.PARSING_ERROR,"invalid sampling index:"+pe.sampleingIndex));if(pe.chanelConfig<0||pe.chanelConfig>=8)return void Z.emit(de.a.ERROR,Object(Oe.e)(Oe.b.MUX_ERROR,Oe.a.PARSING_ERROR,"invalid chanelConfig:"+pe.chanelConfig));pe.chanelConfig||(k.i(ge,"init track channelConfig:",pe.chanelConfig),pe.chanelConfig=2),Le(k,P,pe,Ee),P.asc=Object(Be.f)(he),P.configParsed=!0}}function Le(k,P,Z,he){he===void 0&&(he="");var Ie=function(Ee,pe,G){G===void 0&&(G="");var te,ie,ee=pe.objectType,Te=pe.sampleingIndex,Se=pe.chanelConfig,Ye=navigator.userAgent.toLowerCase(),ze=G||"mp4a.40."+ee;return Ee.v(ge,"manifest codec:"+G+",data:type:"+ee+",sampleingIndex:"+Te+"["+$[Te]+"Hz],channelConfig:"+Se),/firefox/i.test(Ye)?Te>=6?(ee=5,ie=new Array(4),te=Te-3):(ee=2,ie=new Array(2),te=Te):Ye.indexOf("android")!==-1?(ee=2,ie=new Array(2),te=Te):(ee=5,ie=new Array(4),G&&(G.indexOf("mp4a.40.29")!==-1||G.indexOf("mp4a.40.5")!==-1)||!G&&Te>=6?te=Te-3:((G&&G.indexOf("mp4a.40.2")!==-1&&(Te>=6&&Se===1||/vivaldi/i.test(Ye))||!G&&Se===1)&&(ee=2,ie=new Array(2)),te=Te)),ie[0]=ee<<3,ie[0]|=(14&Te)>>1,ie[1]|=(1&Te)<<7,ie[1]|=Se<<3,ee===5&&(ie[1]|=(14&te)>>1,ie[2]=(1&te)<<7,ie[2]|=8,ie[3]=0),{config:ie,samplerate:$[Te],extensionSamplerate:$[te],channelCount:Se,codec:"mp4a.40."+ee,manifestCodec:ze,sampleingIndex:Te}}(k,Z,he);Ie&&(P.config=Ie.config,P.samplerate=Ie.samplerate,P.extensionSamplerate=Ie.extensionSamplerate,P.channelCount=Ie.channelCount,P.codec=Ie.codec,P.manifestCodec=Ie.manifestCodec,P.sampleDuration=Ue(P.samplerate,P.inputTimescale),P.aacSampleingIndex=Z.sampleingIndex,P.aot=Z.objectType,k.v("parsed codec:"+P.codec+",rate:"+Ie.samplerate+",nb channel:"+Ie.channelCount))}function Ue(k,P){return 1024*P/k}function re(k,P,Z,he,Ie,Ee,pe){var G=function(it,ct,nt,Wt,Et,Ut,Yt){var Jt,si=ct.length,Lt=b(ct,nt);return Jt=ve(ct,nt),(Jt-=Lt)>0&&nt+Lt+Jt<=si?{headerLength:Lt,frameLength:Jt,stamp:Wt+Et*Ut,originStamp:Yt+Et*Ut}:null}(0,Z,he,Ie,Ee,Ue(P.samplerate,P.inputTimescale),pe);if(G){var te=G.frameLength,ie=G.headerLength,ee=G.stamp,Te=G.originStamp,Se=ie+te,Ye=Math.max(0,he+Se-Z.length);Ye?new Uint8Array(Se-ie).set(Z.subarray(he+ie,Z.length),0):Z.subarray(he+ie,he+Se);var ze={unit:Z.subarray(he+ie,he+ie+te),pts:ee,dts:ee,originDTS:Te,originPTS:Te};return Ye||P.samples.push(ze),{sample:ze,length:Se,missing:Ye}}}},function(r,i,n){r.exports=function(o){var s={};function d(m){if(s[m])return s[m].exports;var A=s[m]={i:m,l:!1,exports:{}};return o[m].call(A.exports,A,A.exports,d),A.l=!0,A.exports}return d.m=o,d.c=s,d.d=function(m,A,T){d.o(m,A)||Object.defineProperty(m,A,{enumerable:!0,get:T})},d.r=function(m){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(m,"__esModule",{value:!0})},d.t=function(m,A){if(1&A&&(m=d(m)),8&A||4&A&&typeof m=="object"&&m&&m.__esModule)return m;var T=Object.create(null);if(d.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:m}),2&A&&typeof m!="string")for(var C in m)d.d(T,C,function(h){return m[h]}.bind(null,C));return T},d.n=function(m){var A=m&&m.__esModule?function(){return m.default}:function(){return m};return d.d(A,"a",A),A},d.o=function(m,A){return Object.prototype.hasOwnProperty.call(m,A)},d.p="",d(d.s=4)}([function(o,s){function d(m){return o.exports=d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o.exports.__esModule=!0,o.exports.default=o.exports,d(m)}o.exports=d,o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(2);function A(T,C){for(var h=0;h<C.length;h++){var F=C[h];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(T,m(F.key),F)}}o.exports=function(T,C,h){return C&&A(T.prototype,C),h&&A(T,h),Object.defineProperty(T,"prototype",{writable:!1}),T},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(0).default,A=d(3);o.exports=function(T){var C=A(T,"string");return m(C)=="symbol"?C:C+""},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(0).default;o.exports=function(A,T){if(m(A)!="object"||!A)return A;var C=A[Symbol.toPrimitive];if(C!==void 0){var h=C.call(A,T||"default");if(m(h)!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(A)},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){function m(N,K){console.log("%c "+N+" %c "+K+" %c","background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px; color: #fff","background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0; color: #fff","background:transparent")}d.r(s),d.d(s,"LogLevel",function(){return w}),d.d(s,"DefaultLogger",function(){return j}),d.d(s,"Logger",function(){return W}),d.d(s,"printVersion",function(){return m}),d.d(s,"DEFAULT_LOG_LEVEL",function(){return I});var A=d(1),T=d.n(A),C=function(){function N(){this.timeout=6048e5}var K=N.prototype;return K.write=function(z,B){if(N.available)try{localStorage.setItem(z,JSON.stringify({value:B,time:Date.now()}))}catch(J){}},K.read=function(z,B){if(B===void 0&&(B=!0),N.available)try{var J=localStorage.getItem(z);if(J){var be=JSON.parse(J),X=be.value,ye=be.time,Be=ye===void 0?0:ye;if(!B||Date.now()-Be<(typeof B=="number"?B:this.timeout))return X}}catch(Ve){}},T()(N,null,[{key:"available",get:function(){if(N.ut===void 0)try{localStorage.setItem("alg","test"),N.ut=!0}catch(z){N.ut=!1}return N.ut}}])}();C.ut=void 0;var h,F=C,w=function(N){return N.NONE="none",N.ERROR="e",N.WARN="w",N.INFO="i",N.DEBUG="d",N.VERBOSE="v",N}({}),I=w.ERROR,S=((h={})[w.NONE]={value:1,str:"N"},h[w.ERROR]={value:100,str:"E"},h[w.WARN]={value:200,str:"W"},h[w.INFO]={value:300,str:"I"},h[w.DEBUG]={value:400,str:"D"},h[w.VERBOSE]={value:500,str:"V"},h),W=function(){function N(z){if(this.ct="kwai-v",this.ft=I,this.At=-1,this.vt=void 0,this.dt="main",typeof location<"u"&&location.protocol==="blob:"){var B,J=location.href.split("/"),be=(B=J[J.length-1])==null?void 0:B.match(/(\w+)-/);be&&(this.dt=z?z+"-"+be[1]:be[1])}else z&&(this.dt=z)}N.loadLogLevel=function(z,B){if(B===void 0&&(B=!0),location.href){var J=new RegExp(z+"=([a-z]{1})"),be=location.href.match(J);if(be&&be.length>1){var X=be[1];if(this.lt(X))return X}}var ye=new F().read(z,B);if(this.lt(ye))return ye},N.saveLogLevel=function(z,B){this.lt(B)&&new F().write(z,B)},N.lt=function(z){return Object.values(w).indexOf(z)!==-1};var K=N.prototype;return K.setOutput=function(z){return this.vt=z,this},K.setLevel=function(z){return this.ft=z,this},K.setId=function(z){return this.At=z,this},K.setName=function(z){return this.ct=z,this},K.getLevel=function(){return this.ft},K.getOutput=function(){return this.vt},K.hasOutput=function(){return!!this.vt},K.e=function(z){if(this.bt(this.ft,w.ERROR)){for(var B=arguments.length,J=new Array(B>1?B-1:0),be=1;be<B;be++)J[be-1]=arguments[be];var X=this.gt(w.ERROR,z,J);try{var ye;(ye=this.vt)==null||ye.e.apply(ye,[X].concat(J))}catch(Be){}}},K.w=function(z){if(this.bt(this.ft,w.WARN)){for(var B=arguments.length,J=new Array(B>1?B-1:0),be=1;be<B;be++)J[be-1]=arguments[be];var X=this.gt(w.WARN,z,J);try{var ye;(ye=this.vt)==null||ye.w.apply(ye,[X].concat(J))}catch(Be){}}},K.i=function(z){if(this.bt(this.ft,w.INFO)){for(var B=arguments.length,J=new Array(B>1?B-1:0),be=1;be<B;be++)J[be-1]=arguments[be];var X=this.gt(w.INFO,z,J);try{var ye;(ye=this.vt)==null||ye.i.apply(ye,[X].concat(J))}catch(Be){}}},K.d=function(z){if(this.bt(this.ft,w.DEBUG)){for(var B=arguments.length,J=new Array(B>1?B-1:0),be=1;be<B;be++)J[be-1]=arguments[be];var X=this.gt(w.DEBUG,z,J);try{var ye;(ye=this.vt)==null||ye.d.apply(ye,[X].concat(J))}catch(Be){}}},K.v=function(z){if(this.bt(this.ft,w.VERBOSE)){for(var B=arguments.length,J=new Array(B>1?B-1:0),be=1;be<B;be++)J[be-1]=arguments[be];var X=this.gt(w.VERBOSE,z,J);try{var ye;(ye=this.vt)==null||ye.v.apply(ye,[X].concat(J))}catch(Be){}}},K.bt=function(z,B){return S[z].value>=S[B].value},K.gt=function(z,B,J){var be,X,ye=typeof B;if(ye==="object")B=((X=B)==null?void 0:X.constructor.name)||"unknown";else if(ye==="function"){var Be;B=((Be=Object.getOwnPropertyDescriptor(B,"name"))==null?void 0:Be.value)||"unknown"}var Ve,je,we=(((be=S[z])==null?void 0:be.str)||"")+"|"+this.ct+"["+(typeof this.At=="function"?this.At():this.At)+"]["+this.dt+"]::"+B;return z===w.ERROR?(Ve=console).error.apply(Ve,[we].concat(J.slice(0))):(je=console).log.apply(je,[we].concat(J.slice(0))),we},N}(),j=new W}])},function(r,i,n){n.d(i,"a",function(){return o}),n.d(i,"b",function(){return s}),n.d(i,"c",function(){return d});var o=function(m){return m.LOADER_CONNECT_TIMEOUT="connectTimeout",m.LOADER_TRANS_TIMEOUT="transTimeout",m.HANDLING_DATA_ERROR="handlingDataError",m}({}),s=function(m){return m.XHR_ERROR_NAME="XHRError",m.FETCH_ERROR_NAME="FetchError",m.FETCH_READ_ERROR_NAME="ReadError",m.SLICE_UNPACK_ERROR_NAME="SliceUnpackError",m}({}),d=function(m){return m.UNKNOWN="unknown",m.FETCH="fetch",m.XHR="xhr",m}({})},function(r,i,n){n.d(i,"e",function(){return d}),n.d(i,"d",function(){return m}),n.d(i,"c",function(){return A}),n.d(i,"b",function(){return T}),n.d(i,"a",function(){return C});var o=n(7);function s(h,F,w,I){w===void 0&&(w=1),I===void 0&&(I=!1);var S=h*F*w;return I?Math.round(S):S}function d(h,F,w){return w===void 0&&(w=!1),s(h,F,.001,w)}function m(h,F,w){return w===void 0&&(w=!1),s(h,1e3,1/F,w)}function A(h,F){return F===void 0&&(F=!1),s(h,1e3,1/o.q,F)}function T(h,F){return F===void 0&&(F=1),s(h,o.q,1/F)}function C(h,F){return h>o.a&&F<60*o.q}},function(r,i,n){n.d(i,"a",function(){return A}),n.d(i,"c",function(){return T}),n.d(i,"d",function(){return C}),n.d(i,"b",function(){return h});var o,s=n(8),d=n.n(s),m={preferLowPowerToHighPerformance:!0,preserveDrawingBuffer:!0};function A(){return typeof HTMLCanvasElement>"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function T(w){return w.getContext("webgl",m)}function C(w,I){w!=null&&w.drawingBufferColorSpace&&(w.drawingBufferColorSpace=I||"srgb")}function h(){if(!o){var w=A();F(w,o={webGL:!1,performance:!1},!0)||F(w,o,!1)}return o}function F(w,I,S){S===void 0&&(S=!1);var W=!1,j=d()({failIfMajorPerformanceCaveat:S},m);try{var N=w.getContext("webgl",j);if(N){var K=N.getExtension("WEBGL_debug_renderer_info");I.webGL=!0,I.performance=S,K!=null&&K.UNMASKED_VENDOR_WEBGL&&(I.vendor=N.getParameter(K==null?void 0:K.UNMASKED_VENDOR_WEBGL)),K!=null&&K.UNMASKED_RENDERER_WEBGL&&(I.renderer=N.getParameter(K==null?void 0:K.UNMASKED_RENDERER_WEBGL)),W=!0;var z=N.getExtension("WEBGL_lose_context");z&&z.loseContext()}}catch(B){}return W}},function(r,i,n){n.d(i,"a",function(){return o});var o=function(s){return s[s.contain=0]="contain",s[s.fill=1]="fill",s[s.cover=2]="cover",s}({})},function(r,i,n){var o=n(59),s=n(60),d=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,m=/[\n\r\t]/g,A=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,T=/:\d+$/,C=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,h=/^[a-zA-Z]:/;function F(K){return(K||"").toString().replace(d,"")}var w=[["#","hash"],["?","query"],function(K,z){return W(z.protocol)?K.replace(/\\/g,"/"):K},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],I={hash:1,query:1};function S(K){var z,B=(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{}).location||{},J={},be=typeof(K=K||B);if(K.protocol==="blob:")J=new N(unescape(K.pathname),{});else if(be==="string")for(z in J=new N(K,{}),I)delete J[z];else if(be==="object"){for(z in K)z in I||(J[z]=K[z]);J.slashes===void 0&&(J.slashes=A.test(K.href))}return J}function W(K){return K==="file:"||K==="ftp:"||K==="http:"||K==="https:"||K==="ws:"||K==="wss:"}function j(K,z){K=(K=F(K)).replace(m,""),z=z||{};var B,J=C.exec(K),be=J[1]?J[1].toLowerCase():"",X=!!J[2],ye=!!J[3],Be=0;return X?ye?(B=J[2]+J[3]+J[4],Be=J[2].length+J[3].length):(B=J[2]+J[4],Be=J[2].length):ye?(B=J[3]+J[4],Be=J[3].length):B=J[4],be==="file:"?Be>=2&&(B=B.slice(2)):W(be)?B=J[4]:be?X&&(B=B.slice(2)):Be>=2&&W(z.protocol)&&(B=J[4]),{protocol:be,slashes:X||W(be),slashesCount:Be,rest:B}}function N(K,z,B){if(K=(K=F(K)).replace(m,""),!(this instanceof N))return new N(K,z,B);var J,be,X,ye,Be,Ve,je=w.slice(),we=typeof z,ue=this,L=0;for(we!=="object"&&we!=="string"&&(B=z,z=null),B&&typeof B!="function"&&(B=s.parse),J=!(be=j(K||"",z=S(z))).protocol&&!be.slashes,ue.slashes=be.slashes||J&&z.slashes,ue.protocol=be.protocol||z.protocol||"",K=be.rest,(be.protocol==="file:"&&(be.slashesCount!==2||h.test(K))||!be.slashes&&(be.protocol||be.slashesCount<2||!W(ue.protocol)))&&(je[3]=[/(.*)/,"pathname"]);L<je.length;L++)typeof(ye=je[L])!="function"?(X=ye[0],Ve=ye[1],X!=X?ue[Ve]=K:typeof X=="string"?~(Be=X==="@"?K.lastIndexOf(X):K.indexOf(X))&&(typeof ye[2]=="number"?(ue[Ve]=K.slice(0,Be),K=K.slice(Be+ye[2])):(ue[Ve]=K.slice(Be),K=K.slice(0,Be))):(Be=X.exec(K))&&(ue[Ve]=Be[1],K=K.slice(0,Be.index)),ue[Ve]=ue[Ve]||J&&ye[3]&&z[Ve]||"",ye[4]&&(ue[Ve]=ue[Ve].toLowerCase())):K=ye(K,ue);B&&(ue.query=B(ue.query)),J&&z.slashes&&ue.pathname.charAt(0)!=="/"&&(ue.pathname!==""||z.pathname!=="")&&(ue.pathname=function(D,le){if(D==="")return le;for(var oe=(le||"/").split("/").slice(0,-1).concat(D.split("/")),Re=oe.length,Oe=oe[Re-1],de=!1,$=0;Re--;)oe[Re]==="."?oe.splice(Re,1):oe[Re]===".."?(oe.splice(Re,1),$++):$&&(Re===0&&(de=!0),oe.splice(Re,1),$--);return de&&oe.unshift(""),Oe!=="."&&Oe!==".."||oe.push(""),oe.join("/")}(ue.pathname,z.pathname)),ue.pathname.charAt(0)!=="/"&&W(ue.protocol)&&(ue.pathname="/"+ue.pathname),o(ue.port,ue.protocol)||(ue.host=ue.hostname,ue.port=""),ue.username=ue.password="",ue.auth&&(~(Be=ue.auth.indexOf(":"))?(ue.username=ue.auth.slice(0,Be),ue.username=encodeURIComponent(decodeURIComponent(ue.username)),ue.password=ue.auth.slice(Be+1),ue.password=encodeURIComponent(decodeURIComponent(ue.password))):ue.username=encodeURIComponent(decodeURIComponent(ue.auth)),ue.auth=ue.password?ue.username+":"+ue.password:ue.username),ue.origin=ue.protocol!=="file:"&&W(ue.protocol)&&ue.host?ue.protocol+"//"+ue.host:"null",ue.href=ue.toString()}N.prototype={set:function(K,z,B){var J=this;switch(K){case"query":typeof z=="string"&&z.length&&(z=(B||s.parse)(z)),J[K]=z;break;case"port":J[K]=z,o(z,J.protocol)?z&&(J.host=J.hostname+":"+z):(J.host=J.hostname,J[K]="");break;case"hostname":J[K]=z,J.port&&(z+=":"+J.port),J.host=z;break;case"host":J[K]=z,T.test(z)?(z=z.split(":"),J.port=z.pop(),J.hostname=z.join(":")):(J.hostname=z,J.port="");break;case"protocol":J.protocol=z.toLowerCase(),J.slashes=!B;break;case"pathname":case"hash":if(z){var be=K==="pathname"?"/":"#";J[K]=z.charAt(0)!==be?be+z:z}else J[K]=z;break;case"username":case"password":J[K]=encodeURIComponent(z);break;case"auth":var X=z.indexOf(":");~X?(J.username=z.slice(0,X),J.username=encodeURIComponent(decodeURIComponent(J.username)),J.password=z.slice(X+1),J.password=encodeURIComponent(decodeURIComponent(J.password))):J.username=encodeURIComponent(decodeURIComponent(z))}for(var ye=0;ye<w.length;ye++){var Be=w[ye];Be[4]&&(J[Be[1]]=J[Be[1]].toLowerCase())}return J.auth=J.password?J.username+":"+J.password:J.username,J.origin=J.protocol!=="file:"&&W(J.protocol)&&J.host?J.protocol+"//"+J.host:"null",J.href=J.toString(),J},toString:function(K){K&&typeof K=="function"||(K=s.stringify);var z,B=this,J=B.host,be=B.protocol;be&&be.charAt(be.length-1)!==":"&&(be+=":");var X=be+(B.protocol&&B.slashes||W(B.protocol)?"//":"");return B.username?(X+=B.username,B.password&&(X+=":"+B.password),X+="@"):B.password?(X+=":"+B.password,X+="@"):B.protocol!=="file:"&&W(B.protocol)&&!J&&B.pathname!=="/"&&(X+="@"),(J[J.length-1]===":"||T.test(B.hostname)&&!B.port)&&(J+=":"),X+=J+B.pathname,(z=typeof B.query=="object"?K(B.query):B.query)&&(X+=z.charAt(0)!=="?"?"?"+z:z),B.hash&&(X+=B.hash),X}},N.extractProtocol=j,N.location=S,N.trimLeft=F,N.qs=s,r.exports=N},function(r,i,n){var o=n(17),s=n(40),d=n(0),m={chanelConfig:2,objectType:2,sampleingIndex:7},A="audio-helper",T=function(){function C(){}return C.initAudioForFillSilent=function(h,F,w){w===void 0&&(w=""),F.codec||(o.e(h,F,m,w||(/firefox/.test(navigator.userAgent.toLowerCase())?"mp4a.40.2":"mp4a.40.5")),F.codecType=d.c.aac)},C.fillAACFrameByCount=function(h,F,w,I,S,W){S===void 0&&(S=0),W===void 0&&(W=""),C.initAudioForFillSilent(h,F,W);var j=s.a.getSilentFrame(F.manifestCodec||F.codec,F.channelCount);if(j&&I>0){for(var N=o.c(F.samplerate,F.inputTimescale),K=w*F.inputTimescale||0,z=0;z<I;z++){var B=S*F.inputTimescale+N*z;F.samples.push({unit:j,pts:K,dts:K,duration:N,originDTS:B,originPTS:B,isFill:!0}),K+=N}return F.fillDuration+=N*I,K/F.inputTimescale}return w},C.ensureAudioFrame=function(h,F,w,I,S){if(I===void 0&&(I=""),w.samples.length){var W=w.samples[0];if(F.samples.length===0){var j=W.dts/w.inputTimescale;h.i(A,"fill audio before remux frame @"+j+". audio sample num:"+F.samples.length+" video sample num:"+w.samples.length),C.fillAACFrameByCount(h,F,j,1,W.originDTS/w.inputTimescale,I)}var N=w.samples[w.samples.length-1],K=N.dts/w.inputTimescale-(F.samples.length?F.samples[F.samples.length-1].dts/F.inputTimescale:W.dts/w.inputTimescale);S&&K>1&&(h.i(A,"fill audio @end:"+N.dts/w.inputTimescale+". diff:"+K),C.fillAACFrameByCount(h,F,N.dts/w.inputTimescale,1,N.originDTS/w.inputTimescale,I))}},C.alignStartByVideo=function(h,F,w){if(w.samples.length&&F.active&&F.samples.length){var I=o.c(F.samplerate,F.inputTimescale),S=w.samples[0],W=F.samples[0];if(!S||!W)return;var j=S.pts/w.inputTimescale*F.inputTimescale;if(W.pts-j<I)return;var N=s.a.getSilentFrame(F.manifestCodec||F.codec,F.channelCount);if(N){h.i(A,"align start by video. fill audio "+S.pts/w.inputTimescale+". gap:"+(S.pts/w.inputTimescale-W.pts/F.inputTimescale));var K=S.originDTS/w.inputTimescale*F.inputTimescale;F.samples.unshift({unit:N,pts:j,dts:j,duration:I,originDTS:K,originPTS:K,isFill:!0})}}},C.alignEndByRemuxer=function(h,F,w,I){if(w.outputRaw){var S=I.getLastPTS();typeof S.video=="number"&&typeof S.audio=="number"&&S.audio<S.video&&(h.i(A,"raw audio end: "+S.audio+" video end: "+S.video+" fill audio."),C.fillAACFrameByCount(h,F,S.video,1))}},C}();i.a=T},function(r,i,n){n.d(i,"a",function(){return o}),n.d(i,"b",function(){return s});var o=function(d){return d[d.AV_PIX_FMT_MONO=0]="AV_PIX_FMT_MONO",d[d.AV_PIX_FMT_YUV420P=1]="AV_PIX_FMT_YUV420P",d[d.AV_PIX_FMT_YUV422P=2]="AV_PIX_FMT_YUV422P",d[d.AV_PIX_FMT_YUV444P=3]="AV_PIX_FMT_YUV444P",d}({});function s(d,m,A){var T=[d],C=[m];return A===o.AV_PIX_FMT_YUV420P?(T[2]=T[1]=d/2,C[2]=C[1]=m/2):A===o.AV_PIX_FMT_YUV422P?(T[2]=T[1]=d/2,C[2]=C[1]=m):A===o.AV_PIX_FMT_YUV444P&&(T[2]=T[1]=d,C[2]=C[1]=m),{w:T,h:C}}},function(r,i,n){var o=n(5),s=n.n(o),d=function(){function m(){this.yt=0,this._t=[],this.Ct=0,this.It=0}var A=m.prototype;return A.put=function(T){if(this.unreadLen+T.byteLength>=m.MAX_CACHE_SIZE)throw new Error("max cache size");this._t.push(T),this.yt+=T.byteLength},A.get=function(T){if(!(T>this.unreadLen)){var C,h=this._t[this.Ct];if(this.It===0&&T===h.byteLength)T===h.buffer.byteLength?C=h:(C=new Uint8Array(T)).set(h),this.Ct++,this.It=0;else{C=new Uint8Array(T);for(var F=0,w=0,I=0;F<T;)I=this.It,w=Math.min(h.byteLength,T-F+I),I===0&&w===h.byteLength?C.set(h,F):C.set(h.subarray(I,w),F),F+=w-I,w>=h.byteLength?(this.Ct++,h=this._t[this.Ct],this.It=0):this.It=w}return this.Ot(),C}},A.read=function(T){if(!(T>this.unreadLen)){for(var C=new Uint8Array(T),h=this.Ct,F=0,w=0,I=this.It;F<T;){var S=this._t[h];h>0&&(I=0),w=Math.min(S.byteLength,T-F+I),C.set(S.subarray(I,w),F),F+=w-I,h++}return C}},A.skip=function(T){var C=this.It+T;if(!(C>this.yt)){if(C===this.yt)this.clear();else for(;C>0;){var h=this._t[this.Ct].byteLength;C<h?(this.It=C,C=0):C===h?(this.It=0,C=0,this.Ct++):(this.It=0,C-=h,this.Ct++)}this.Ot()}},A.clear=function(){this.yt=0,this._t=[],this.Ct=0,this.It=0},A.Ot=function(){for(;this.Ct;){var T=this._t.shift();T&&(this.yt-=T.byteLength),this.Ct--}},s()(m,[{key:"unreadLen",get:function(){return this.yt-this.It}}])}();d.MAX_CACHE_SIZE=524288e3,i.a=d},function(r,i,n){n.d(i,"a",function(){return o});var o=function(s){return s.INIT="init",s.FLUSH="flush",s.LOAD_END="loadEnd",s.DESTROY="destroy",s.PUSH="push",s.UPDATE_CONFIG="updateConfig",s}({})},function(r,i,n){var o=n(43),s=function(){function d(){this._$evt=new o.EventEmitter}var m=d.prototype;return m.on=function(A,T){var C=this;return this._$evt.on(A,T),{destroy:function(){return C._$evt.off(A,T)}}},m.prependListener=function(A,T){var C=this;return this._$evt.prependListener(A,T),{destroy:function(){return C._$evt.off(A,T)}}},m.removeAllListeners=function(A){this._$evt.removeAllListeners(A)},m.off=function(A,T){this._$evt.off(A,T)},m.listeners=function(A){return this._$evt.listeners(A)},m.emit=function(A,T){return this._$evt.emit(A,T)},m.listenerCount=function(A){return this._$evt.listenerCount(A)},d}();i.a=s},function(r,i,n){var o,s,d,m,A;o=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,d=/(?:\/|^)\.(?=\/)/g,m=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,A={buildAbsoluteURL:function(T,C,h){if(h=h||{},T=T.trim(),!(C=C.trim())){if(!h.alwaysNormalize)return T;var F=A.parseURL(T);if(!F)throw new Error("Error trying to parse base URL.");return F.path=A.normalizePath(F.path),A.buildURLFromParts(F)}var w=A.parseURL(C);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return h.alwaysNormalize?(w.path=A.normalizePath(w.path),A.buildURLFromParts(w)):C;var I=A.parseURL(T);if(!I)throw new Error("Error trying to parse base URL.");if(!I.netLoc&&I.path&&I.path[0]!=="/"){var S=s.exec(I.path);I.netLoc=S[1],I.path=S[2]}I.netLoc&&!I.path&&(I.path="/");var W={scheme:I.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(W.netLoc=I.netLoc,w.path[0]!=="/"))if(w.path){var j=I.path,N=j.substring(0,j.lastIndexOf("/")+1)+w.path;W.path=A.normalizePath(N)}else W.path=I.path,w.params||(W.params=I.params,w.query||(W.query=I.query));return W.path===null&&(W.path=h.alwaysNormalize?A.normalizePath(w.path):w.path),A.buildURLFromParts(W)},parseURL:function(T){var C=o.exec(T);return C?{scheme:C[1]||"",netLoc:C[2]||"",path:C[3]||"",params:C[4]||"",query:C[5]||"",fragment:C[6]||""}:null},normalizePath:function(T){for(T=T.split("").reverse().join("").replace(d,"");T.length!==(T=T.replace(m,"")).length;);return T.split("").reverse().join("")},buildURLFromParts:function(T){return T.scheme+T.netLoc+T.path+T.params+T.query+T.fragment}},r.exports=A},function(r,i,n){n.d(i,"a",function(){return Ue});var o=n(8),s=n.n(o),d=n(5),m=n.n(d),A=n(11),T=n(40),C=n(35),h=n(20),F=Object(C.b)(0);F.bitDepth=8,F.chromaFormat="4:2:0",F.codec="avc1.4d4015",F.colorInfo={colorRange:1,colourPrimaries:1,transferCharacteristics:4,matrixCoefficients:2},F.fps=15,F.codedHeight=270,F.id=1,F.level="2.1",F.sar={width:1,height:1},F.profile="Main",F.codedWidth=480,F.decConf=new Uint8Array([1,77,64,21,255,225,0,29,103,77,64,21,236,160,240,71,245,128,181,1,4,2,64,0,0,3,0,64,0,0,3,0,131,197,139,101,128,1,0,5,104,235,226,75,32]);var w=[{type:5,data:new Uint8Array([101,136,132,0,21,255,254,247,129,191,50,203,47,251,43,37,199,231,157,244,178,179,60,243,144,241,201,118,38,186,227,64,0,0,3,0,0,130,250,232,125,212,175,136,56,158,108,0,0,167,0,4,128,81,80,83,109,1,86,96,46,184,52,2,161,102,0,1,67])}],I=function(){function re(){}return re.getFillTrackBySamples=function(k,P){if(P.length){k.bitDepth=F.bitDepth,k.chromaFormat=F.chromaFormat,k.codec=F.codec,k.colorInfo=F.colorInfo,k.fps=k.fps||F.fps,k.id=F.id,k.level=F.level,k.sar=F.sar,k.profile=F.profile,k.codedWidth=F.codedWidth,k.codedHeight=F.codedHeight,k.duration=1/0,k.decConf=F.decConf,k.outputRaw=!1;for(var Z=k.sampleDuration=k.inputTimescale/k.fps||Object(h.e)(1,k.inputTimescale),he=P[0].dts,Ie=P[0].originDTS,Ee=P[0].originPTS,pe=0;he<=P[P.length-1].dts;)k.samples.push({cts:0,dts:he,key:!0,pts:he,originDTS:Ie,originPTS:Ee,units:w,size:0,isFill:!0}),he+=Z,Ie+=Z,Ee+=Z,pe++;return k.fillDuration+=Z*pe,k}},re}(),S=n(0),W=n(3),j=n(9),N=n(32),K=n(24),z=n(6),B=n(2),J=n(4),be=Math.pow(2,32)-1,X={video:new Uint8Array([0,0,0,45,104,100,108,114,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]),audio:new Uint8Array([0,0,0,45,104,100,108,114,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])},ye=new Uint8Array([0,0,0,24,102,116,121,112,105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),Be=new Uint8Array([0,0,0,16,115,116,116,115,0,0,0,0,0,0,0,0]),Ve=new Uint8Array([0,0,0,16,115,116,115,99,0,0,0,0,0,0,0,0]),je=new Uint8Array([0,0,0,16,115,116,99,111,0,0,0,0,0,0,0,0]),we=new Uint8Array([0,0,0,20,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,0]),ue=new Uint8Array([0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,20,118,109,104,100,0,0,0,1,0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0]),le=new Uint8Array([0,0,0,120,109,118,104,100,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,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]),oe=new Uint8Array([0,0,0,104,116,107,104,100,1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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]),Re=new Uint8Array([0,0,0,32,116,114,101,120,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]),Oe=new Uint8Array([0,0,0,44,109,100,104,100,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,172,68,0,0,0,0,0,0,0,0,85,196,0,0]),de=new Uint8Array([0,0,0,93,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,77,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,41,101,115,100,115,0,0,0,0,3,27,0,1,0,4,19,64,21,0,0,0,0,0,0,0,0,0,0,0,5]),$=new Uint8Array([0,0,0,52,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,36,46,109,112,51,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,0,0,0,0]),ge=new Uint8Array([0,0,0,71,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,55,79,112,117,115,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,0,0,0,0,0,0,0,19,100,79,112,115,0,2,0,0,0,0,0,0,0,0,0]),Pe=new Uint8Array([0,0,0,0,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,0,97,118,48,49,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,2,208,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,107,119,97,105,45,118,105,100,101,111,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]),ae=new Uint8Array([0,0,0,16,112,97,115,112,0,0,0,1,0,0,0,1]),q=new Uint8Array([255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64]),b=new Uint8Array([0,0,0,0,0,1,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64]),ve=new Uint8Array([0,0,0,0,255,255,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64]),U=function(){function re(){}return re.moov=function(k,P){for(var Z=ye,he=k.length,Ie=re.wt.avc1;he--;){var Ee=k[he];Ee.type===S.o.VIDEO&&(Ee.codec.indexOf("hev1")===0?Ie=re.wt.hev1:Ee.codec.indexOf("av01")===0&&(Ie=re.wt.av01))}var pe=Z.byteLength+re.Et(k,P),G={data:new Uint8Array(pe),offset:0};return G.data.set(Z,0),G.data.set(Ie,16),G.offset+=Z.byteLength,re.jt(G,k,P),G.data},re.videoMediaSegment=function(k,P,Z,he){var Ie=Z.codec.indexOf("av01")===0?0:4,Ee=8+Z.mp4Samples.reduce(function(G,te){return G+te.units.reduce(function(ie,ee){return ie+ee.data.byteLength+Ie},0)},0),pe=re.kt(Z,Ee,he);return re.Mt(pe,k,P,Z,Ee,he),Z.samples.forEach(function(G){G.units.forEach(function(te){var ie=te.data.byteLength;Ie?(Object(J.l)(ie,pe.data,pe.offset),pe.data.set(te.data,pe.offset+Ie),pe.offset+=Ie+ie):(pe.data.set(te.data,pe.offset),pe.offset+=ie)})}),pe.data},re.audioMediaSegment=function(k,P,Z,he){var Ie=8+Z.mp4Samples.reduce(function(pe,G){return pe+G.unit.byteLength},0),Ee=re.kt(Z,Ie,he);return re.Mt(Ee,k,P,Z,Ie,he),Z.mp4Samples.forEach(function(pe){Ee.data.set(pe.unit,Ee.offset),Ee.offset+=pe.unit.byteLength}),Ee.data},re.audioRawMpeg=function(k){var P=8+k.mp4Samples.reduce(function(he,Ie){return he+Ie.unit.byteLength},0),Z={data:new Uint8Array(P),offset:0};return re.St(Z,re.wt.mdat,P),k.mp4Samples.forEach(function(he){Z.data.set(he.unit,Z.offset),Z.offset+=he.unit.byteLength}),Z.data},re.Et=function(k,P){var Z=k.reduce(function(Ie,Ee){return Ie+re.Bt(Ee)},0),he=P?P.reduce(function(Ie,Ee){return Ie+Ee.byteLength+8},0):0;return 8+le.byteLength+Z+re.Tt(k)+he},re.jt=function(k,P,Z){var he=this,Ie=re.Et(P,Z);re.St(k,re.wt.moov,Ie);var Ee=P[0];if(!Ee)throw new Error("no tracks input.");re.Dt(k,Ee.timescale,Ee.duration),P.forEach(function(pe){re.Rt(k,pe)}),re.Lt(k,P),Z&&Z.forEach(function(pe){he.Nt(k,pe)})},re.Nt=function(k,P){this.St(k,re.wt.pssh,P.byteLength+8),k.data.set(P,k.offset),k.offset+=P.byteLength},re.Qt=function(k){return 104+17*k.mp4Samples.length+this.xt(k)},re.Vt=function(k,P,Z){if(this.xt(P)){var he=this.Ut(P);this.St(k,re.wt.saiz,he),k.offset+=5;var Ie=P.samples.length;Object(J.l)(Ie,k.data,k.offset),k.offset+=4,P.samples.forEach(function(te){te.auxiliaryInfo&&(k.data[k.offset]=te.auxiliaryInfo.enc.byteLength),k.offset++});var Ee=this.Ft();this.St(k,re.wt.saio,Ee),k.offset+=4,k.data[k.offset+3]=1,k.offset+=4;var pe=k.offset-Z+4+16;Object(J.l)(pe,k.data,k.offset),k.offset+=4;var G=this.Pt(P);this.St(k,re.wt.senc,G),P.useSubSampleEnc&&(k.data[k.offset+3]=2),k.offset+=4,Object(J.l)(Ie,k.data,k.offset),k.offset+=4,P.samples.forEach(function(te){te.auxiliaryInfo&&(k.data.set(te.auxiliaryInfo.enc,k.offset),k.offset+=te.auxiliaryInfo.enc.byteLength)})}},re.xt=function(k){var P=this.Pt(k);return P?P+this.Ut(k)+this.Ft():0},re.Ut=function(k){return 17+k.samples.length},re.Pt=function(k){var P=k.samples.reduce(function(Z,he){return Z+(he.auxiliaryInfo?he.auxiliaryInfo.enc.byteLength:0)},0);return P?16+P:0},re.Ft=function(){return 20},re.Mt=function(k,P,Z,he,Ie,Ee){Ee&&(k.data.set(Ee),k.offset=Ee.byteLength),re.Ht(k,P,Z,he),re.St(k,re.wt.mdat,Ie)},re.kt=function(k,P,Z){var he=re.Qt(k);return{data:new Uint8Array(he+P+(Z?Z.byteLength:0)),offset:0}},re.Dt=function(k,P,Z){var he=Math.floor(Z/(be+1)),Ie=Math.floor(Z%(be+1)),Ee=le;Object(J.l)(P,Ee,28),Object(J.l)(he,Ee,32),Object(J.l)(Ie,Ee,36),k.data.set(Ee,k.offset),k.offset+=le.byteLength},re.Yt=function(k,P){var Z=P.id,he=Math.floor(P.duration/(be+1)),Ie=Math.floor(P.duration%(be+1)),Ee=0,pe=0;Object.prototype.hasOwnProperty.call(P,"codedWidth")&&(Ee=P.codedWidth),Object.prototype.hasOwnProperty.call(P,"codedHeight")&&(pe=P.codedHeight);var G=oe;Object(J.l)(Z,G,28),Object(J.l)(he,G,36),Object(J.l)(Ie,G,40),P.rotation===90?b.forEach(function(te,ie){return G[60+ie]=te}):P.rotation===180?q.forEach(function(te,ie){return G[60+ie]=te}):P.rotation===270&&ve.forEach(function(te,ie){return G[60+ie]=te}),Object(J.k)(Ee,G,96),Object(J.k)(pe,G,100),k.data.set(G,k.offset),k.offset+=oe.byteLength},re.Bt=function(k){return 8+oe.byteLength+re.Gt(k)},re.Rt=function(k,P){var Z=re.Bt(P);this.St(k,re.wt.trak,Z),this.Yt(k,P),this.Kt(k,P)},re.Gt=function(k){return 8+Oe.byteLength+X[k.type].byteLength+re.Zt(k)},re.Kt=function(k,P){var Z=re.Gt(P);this.St(k,re.wt.mdia,Z),this.Wt(k,P.timescale,P.duration),k.data.set(X[P.type],k.offset),k.offset+=X[P.type].byteLength,this.Xt(k,P)},re.Wt=function(k,P,Z){var he=Math.floor(Z/(be+1)),Ie=Math.floor(Z%(be+1)),Ee=Oe;Object(J.l)(P,Ee,28),Object(J.l)(he,Ee,32),Object(J.l)(Ie,Ee,36),k.data.set(Ee,k.offset),k.offset+=Ee.byteLength},re.Zt=function(k){return k.type===S.o.AUDIO?8+D.byteLength+ue.byteLength+re.zt(k):8+L.byteLength+ue.byteLength+re.zt(k)},re.Xt=function(k,P){if(this.St(k,re.wt.minf,re.Zt(P)),P.type===S.o.AUDIO)return k.data.set(D,k.offset),k.offset+=D.byteLength,k.data.set(ue,k.offset),k.offset+=ue.byteLength,void this.Jt(k,P);k.data.set(L,k.offset),k.offset+=L.byteLength,k.data.set(ue,k.offset),k.offset+=ue.byteLength,this.Jt(k,P)},re.zt=function(k){return 8+this.qt(k)+Be.byteLength+Ve.byteLength+we.byteLength+je.byteLength},re.Jt=function(k,P){var Z=this.zt(P);this.St(k,re.wt.stbl,Z),this.$t(k,P),k.data.set(Be,k.offset),k.offset+=Be.byteLength,k.data.set(Ve,k.offset),k.offset+=Ve.byteLength,k.data.set(we,k.offset),k.offset+=we.byteLength,k.data.set(je,k.offset),k.offset+=je.byteLength},re.qt=function(k){return k.stsd?k.stsd.byteLength+8:k.type===S.o.AUDIO?re.ti(k):re.ii(k)},re.$t=function(k,P){if(P.stsd)return this.St(k,re.wt.stsd,P.stsd.byteLength+8),k.data.set(P.stsd,k.offset),void(k.offset+=P.stsd.byteLength);P.type!==S.o.AUDIO?re.ei(k,P):this.ni(k,P)},re.si=function(k){return k.decConf?8+k.decConf.byteLength:0},re.ii=function(k){var P=k.sar.width!==1||k.sar.height!==1?ae.length:0;return Pe.byteLength+re.si(k)+P},re.ei=function(k,P){var Z=this.si(P),he=this.ii(P),Ie=Pe,Ee=he-16,pe=re.wt.avc1,G=re.wt.avcC;P.codec.indexOf("hev1")===0?(pe=re.wt.hev1,G=re.wt.hvcC):P.codec.indexOf("av01")===0&&(pe=re.wt.av01,G=re.wt.av1C);var te=P.codedWidth,ie=P.codedHeight,ee=P.sar.width!==1||P.sar.height!==1;Object(J.l)(he,Ie,0),this.ri(Ie,pe,Ee,16),Object(J.k)(te,Ie,48),Object(J.k)(ie,Ie,50),k.data.set(Ie,k.offset),k.offset+=Ie.byteLength,this.St(k,G,Z),P.decConf&&(k.data.set(P.decConf,k.offset),k.offset+=P.decConf.byteLength),ee&&(k.data.set(ae,k.offset),Object(J.l)(P.sar.width||0,k.data,k.offset+8),Object(J.l)(P.sar.height||0,k.data,k.offset+12),k.offset+=ae.length)},re.hi=function(k){return 33+k.config.length+4},re.oi=function(k){return 52+re.hi(k)},re.ai=function(k,P){var Z=P.config.length,he=re.hi(P),Ie=re.oi(P),Ee=Ie-16,pe=de;Object(J.l)(Ie,pe,0),Object(J.l)(Ee,pe,16),pe[41]=P.channelCount,Object(J.k)(P.samplerate,pe,48),Object(J.l)(he,pe,52),pe[65]=23+Z,pe[70]=15+Z,k.data.set(pe,k.offset),k.offset+=pe.byteLength;var G=[Z].concat(P.config).concat([6,1,2]);k.data.set(G,k.offset),k.offset+=G.length},re.ui=function(k,P){var Z=ge;Z[41]=Z[61]=P.channelCount,Object(J.k)(P.samplerate,Z,48),Object(J.k)(P.samplerate,Z,66),k.data.set(Z,k.offset),k.offset+=Z.byteLength},re.ci=function(k,P){var Z=$;Z[41]=P.channelCount,Object(J.k)(P.samplerate,Z,48),k.data.set(Z,k.offset),k.offset+=Z.byteLength},re.ti=function(k){return k.codec==="mp3"?$.length:k.codec==="opus"?ge.length:re.oi(k)},re.ni=function(k,P){P.codec==="mp3"?re.ci(k,P):P.codec==="opus"?re.ui(k,P):re.ai(k,P)},re.Tt=function(k){return 8+k.length*Re.byteLength},re.Lt=function(k,P){var Z=re.Tt(P);this.St(k,re.wt.mvex,Z),P.forEach(function(he){re.fi(k,he)})},re.fi=function(k,P){var Z=P.id,he=Re;Object(J.l)(Z,he,12),k.data.set(he,k.offset),k.offset+=he.byteLength},re.Ht=function(k,P,Z,he){var Ie=he.mp4Samples.length,Ee=k.offset,pe=re.Qt(he),G=pe-24,te=12+Ie,ie=20+16*Ie,ee=pe+8,Te=he.id,Se=he.mp4Samples||[],Ye=Math.floor(Z/(be+1)),ze=Math.floor(Z%(be+1));re.St(k,re.wt.moof,pe),re.St(k,re.wt.mfhd,16),Object(J.l)(P,k.data,k.offset+4),k.offset+=8,re.St(k,re.wt.traf,G),re.St(k,re.wt.tfhd,20),k.data[k.offset+1]=2,k.data[k.offset+3]=2,Object(J.l)(Te,k.data,k.offset+4),k.data[k.offset+11]=he.sampleDescIndex||1,k.offset+=12,re.St(k,re.wt.tfdt,20),k.data[k.offset]=1,Object(J.l)(Ye,k.data,k.offset+4),Object(J.l)(ze,k.data,k.offset+8),k.offset+=12,re.St(k,re.wt.sdtp,te),k.offset+=4,Se.forEach(function(it,ct){var nt=it.flags;k.data[k.offset+ct]=nt.dependsOn<<4|nt.isDependedOn<<2|nt.hasRedundancy}),k.offset+=Ie,re.St(k,re.wt.trun,ie),k.data[k.offset]=1,k.data[k.offset+2]=15,k.data[k.offset+3]=1,Object(J.l)(Ie,k.data,k.offset+4),Object(J.l)(ee,k.data,k.offset+8),k.offset+=12,Se.forEach(function(it,ct){if(it){var nt=k.offset+16*ct;Object(J.l)(it.duration,k.data,nt),Object(J.l)(it.len,k.data,nt+4),k.data[nt+8]=it.flags.isLeading<<2|it.flags.dependsOn,k.data[nt+9]=it.flags.isDependedOn<<6|it.flags.hasRedundancy<<4|it.flags.isNonSync,k.data[nt+10]=61440&it.flags.degradPrio,k.data[nt+11]=15&it.flags.degradPrio,Object(J.j)(it.cts,k.data,nt+12)}}),k.offset+=16*Ie,this.xt(he)&&this.Vt(k,he,Ee)},re.St=function(k,P,Z){re.ri(k.data,P,Z,k.offset),k.offset+=8},re.ri=function(k,P,Z,he){Object(J.l)(Z,k,he),k.set(P,he+4)},re}();U.wt={avc1:[97,118,99,49],avcC:[97,118,99,67],btrt:[98,116,114,116],dinf:[100,105,110,102],dref:[100,114,101,102],esds:[101,115,100,115],ftyp:[102,116,121,112],hdlr:[104,100,108,114],mdat:[109,100,97,116],mdhd:[109,100,104,100],mdia:[109,100,105,97],mfhd:[109,102,104,100],minf:[109,105,110,102],moof:[109,111,111,102],moov:[109,111,111,118],mp4a:[109,112,52,97],mvex:[109,118,101,120],mvhd:[109,118,104,100],pasp:[112,97,115,112],sdtp:[115,100,116,112],stbl:[115,116,98,108],stco:[115,116,99,111],stsc:[115,116,115,99],stsd:[115,116,115,100],stsz:[115,116,115,122],stts:[115,116,116,115],tfdt:[116,102,100,116],tfhd:[116,102,104,100],traf:[116,114,97,102],trak:[116,114,97,107],trun:[116,114,117,110],trex:[116,114,101,120],tkhd:[116,107,104,100],vmhd:[118,109,104,100],smhd:[115,109,104,100],hvcC:[104,118,99,67],pssh:[112,115,115,104],saiz:[115,97,105,122],saio:[115,97,105,111],senc:[115,101,110,99],av1C:[97,118,49,67],hev1:[104,101,118,49],av01:[97,118,48,49]};var M=U,ne="remuxer",Le=function(){function re(P,Z,he,Ie,Ee){var pe=this;this.Ai=void 0,this.di=void 0,this.li=void 0,this.bi=void 0,this.pi=void 0,this.mi=void 0,this.gi=!1,this.yi="",this._i=void 0,this.Ci=void 0,this.Ii=void 0,this.Oi=void 0,this.wi=void 0,this.Ei=void 0,this.ji={},this.ki=void 0,this.Mi=void 0,this.Si=void 0,this.Bi=void 0,this.Ti=void 0,this.Di=function(te){pe.Ai.emit(B.a.ERROR,te)},this.Ai=Z,this.di=he,this.li=Ie,this.Ci=P;var G=navigator.userAgent;this.bi=!(!(Ee&&Ee.indexOf("Apple")>-1&&G)||G.match("CriOS")),this.gi=!1,this.pi=!!(z.a.chrome&&z.a.version.major<70),this.mi=!(z.a.chrome&&z.a.version.major>=73),this.Bi={},this.Ti={video:0,audio:0},this.Ci.i(ne,"constructor safari: "+this.bi+", forceFirstIDR: "+this.pi+" forceDTSPositive: "+this.mi)}var k=re.prototype;return k.destroy=function(){},k.resetTimeStamp=function(P){this.Ci.i(ne,"reset timestamp",P),this.wi=this.Ei=P},k.resetInitSegment=function(P){this.Ci.i(ne,"reset init segment."),this.gi=!1,this.ji={},this._i=P,this.ki=void 0,this.yi="",this.Si=!1,this.Bi={}},k.getLastDTS=function(){return{video:this.Oi,audio:this.Ii}},k.getLastPTS=function(){return this.Ti},k.flush=function(P){var Z;if(P===void 0&&(P=!0),this.Ci.i(ne,"flush ",!!this.Bi.sample,this.Bi.sample&&this.Mi),this.Bi.sample&&this.Mi&&(this.Mi.samples=[this.Bi.sample],this.Bi.sample=void 0,Z=this.Ri(this.Mi,this.Oi||0,!0,!1,!0)),Z&&P){var he=[Z];this.Ai.emit(B.a.PARSING_DATA,{segments:he,extra:this._i})}return Z},k.remux=function(P,Z,he,Ie,Ee,pe,G){var te,ie,ee,Te,Se=this;if(pe===void 0&&(pe=!1),G&&(this.ki=G),this.Mi=Z,Ie||(this.Oi=this.Ii=void 0,this.Ti.video=this.Ti.audio=void 0),Z.active&&!Z.outputRaw&&(this.Bi.sample&&(Ie&&Z.samples.unshift(this.Bi.sample),this.Bi.sample=void 0),!this.di.gopRemux&&Z.samples.length>1&&!pe&&(this.Bi.prevSampleDuration=Z.samples[Z.samples.length-1].dts-Z.samples[Z.samples.length-2].dts,this.Bi.sample=Z.samples.pop())),P.active&&K.a.ensureAudioFrame(this.Ci,P,Z,(Te=this._i)==null?void 0:Te.audioCodec,pe),Z.active){if(!this.gi&&Z.outputRaw&&(ie=this.Li(Z)),Ie||K.a.alignStartByVideo(this.Ci,P,Z),Z.outputRaw&&Z.samples.length){if(te=Z.samples,Z.samples=[],Z.mp4Samples=[],this.di.ensureVideo&&P.samples.length&&P.samplerate){var Ye=this.Ni(Z,P);Ye&&(Z=Ye,ee=!0,this.Ci.i(ne,"fill black video. raw output."))}}else if((this.di.isLive||!Ie)&&pe&&!Z.outputRaw&&Z.samples.length===0&&P.samples.length&&P.samplerate&&(!this.gi||(P.samples[P.samples.length-1].pts-P.samples[0].pts)/P.inputTimescale>=1)){var ze=this.Ni(Z,P);ze&&(Z=ze,ee=!0,this.Ci.i(ne,"fill black video, no video samples."))}}if(this.yi=Z.codec,this.Si&&!ee&&Z.samples.length&&(this.gi=!1),this.gi||(this.Si=!1,this.Qi(P,Z,te||Z.samples,he,ie,ee)),!Ie&&Z.samples.length&&this.bi&&(Z.samples[0].pts=Z.samples[0].dts),this.gi){var it=he,ct=he;if(P.samples.length&&Z.samples.length)if(!Ie&&Ee){if(P.samples[0].pts/P.inputTimescale-Z.samples[0].pts/Z.inputTimescale<0){var nt=Z.samples[0];nt.pts=P.samples[0].pts/P.inputTimescale*Z.inputTimescale,nt.dts=nt.pts-nt.cts}}else{var Wt=P.samples[0].pts/P.inputTimescale-Z.samples[0].pts/Z.inputTimescale;it+=Math.max(0,Wt),ct+=Math.max(0,-Wt)}var Et=this.xi(P,it,Ie,Ee),Ut=this.Ri(Z,ct,Ie,Ee,pe);ee&&(this.Si=!0);var Yt=[];if(Et&&Yt.push(Et),Ut&&Yt.push(Ut),Yt.length&&this.Ai.emit(B.a.PARSING_DATA,{segments:Yt,extra:this._i}),te){var Jt=[],si=[],Lt=[];te.forEach(function(_t){_t.dts=_t.dts/Z.inputTimescale-(Se.wi||0),_t.cts=_t.cts/Z.inputTimescale,_t.pts=_t.dts+_t.cts,_t.originDTS=_t.originDTS/Z.inputTimescale,_t.originPTS=_t.originPTS/Z.inputTimescale,(_t.key&&!_t.isFill||_t.keyTime)&&Jt.push({key:_t.key,pts:_t.pts,cts:_t.cts,originPTS:_t.originPTS}),_t.sei&&si.push(_t.sei),_t.privNal&&Lt.push(_t.privNal),(!Se.Ti.video||_t.pts>Se.Ti.video)&&(Se.Ti.video=_t.pts)}),this.Ai.emit(B.a.RAW_DATA,{type:A.d.videoFrame,samples:te,extra:this._i,keyTime:Jt,sei:si,privNal:Lt,mediaInfo:{colorInfo:Z.colorInfo,rotation:Z.rotation,fps:Z.fps,sar:Z.sar}})}}},k.computeInitPTSDTS=function(P,Z,he,Ie,Ee){Ie===void 0&&(Ie=1),Ee===void 0&&(Ee=1);var pe=1/0,G=1/0;return Z&&(pe=G=Z.pts/Ie-P),he&&(pe=Math.min(typeof pe=="number"?pe:1/0,he.pts/Ee-P),G=Math.min(typeof G=="number"?G:1/0,he.dts/Ee-P)),{initPTS:pe,initDTS:G}},k.Li=function(P){return P.codec?this.Vi(P):P.codecType?{container:"video/mp4",codec:P.codec,codecType:P.codecType||S.c.unknown}:void 0},k.Vi=function(P){if(P.codec){var Z=Object(N.a)(P.codedWidth,P.codedHeight,P.sar);return{container:"video/mp4",codec:P.codec,codecType:P.codecType||S.c.unknown,metadata:{width:Z.width,height:Z.height,codedWidth:P.codedWidth,codedHeight:P.codedHeight,sar:P.sar,rotation:P.rotation,fps:P.fps,profile:P.profile,level:P.level,chromaFormat:P.chromaFormat,bitDepth:P.bitDepth,colorInfo:P.colorInfo,videoBitrate:P.bitrate,videoMaxBitrate:P.maxBitrate,enhancedFlv:P.enhancedFlv}}}},k.Qi=function(P,Z,he,Ie,Ee,pe){var G,te,ie=this.Ai,ee=P.samples,Te=this.li,Se={},Ye={tracks:Se},ze=this.wi===void 0,it="audio/mp4";if(ze&&(G=te=1/0),P.config&&ee.length&&(P.duration=P.duration/P.timescale*P.samplerate,P.timescale=P.samplerate,this.Ci.v(ne,"audio sampling rate : "+P.samplerate),P.codecType===S.c.mp3?Te.mpeg?(it="audio/mpeg",P.codec=""):Te.mp3&&(P.codec="mp3"):P.codecType===S.c.opus&&(P.codec="opus"),this.ji.audio=P.codecType===S.c.mp3&&Te.mpeg?new Uint8Array:M.moov([P],this.ki),Se.audio={container:it,codec:P.codec,codecType:P.codecType||S.c.unknown,metadata:{channel:P.channelCount,audioSampleRate:P.extensionSamplerate||P.samplerate,audioBitrate:P.bitrate,audioMaxBitrate:P.maxBitrate}},ze&&(G=te=ee[0].pts/P.inputTimescale-Ie)),Z.codec&&he.length){var ct=Z.inputTimescale;Z.timescale=ct,Z.duration<=0&&(this.Ci.i(ne,"videoTrack.duration === 0"),Z.duration=1),Z.outputRaw||(this.ji.video=M.moov([Z],this.ki),Se.video=this.Vi(Z)),Se.video&&Se.video.metadata&&(Se.video.metadata.isFillVideo=pe),ze&&(G=Math.min(typeof G=="number"?G:1/0,he[0].pts/ct-Ie),te=Math.min(typeof te=="number"?te:1/0,he[0].dts/ct-Ie))}else Z.codec&&!Z.active&&(Se.video=this.Vi(Z),Se.video&&Se.video.metadata&&(Se.video.active=!1,Se.video.metadata.isFillVideo=pe));Ee&&(Se.rawVideo=Ee),Object.keys(Se).length?(ie.emit(B.a.PARSING_INIT_SEGMENT,Ye),this.gi=!0,ze&&(this.wi=G,this.Ei=te,this.Ci.i(ne,"init pts:"+G+" dts:"+te+" offset:"+Ie))):this.Di(Object(W.e)(W.b.MUX_ERROR,W.a.PARSING_ERROR,"no audio/video samples found",{fatal:!1}))},k.Ri=function(P,Z,he,Ie,Ee){var pe=this;if(Ie===void 0&&(Ie=!1),Ee===void 0&&(Ee=!1),P.samples.length&&this.wi!==void 0&&this.Ei!==void 0){var G,te,ie=P.inputTimescale,ee=P.samples,Te=[],Se=this.Ei*ie,Ye=this.wi*ie,ze=Object(h.e)(1,ie),it=ee.length,ct=[],nt=[],Wt=[],Et=0,Ut=0,Yt=0,Jt=this.Oi?this.Oi*ie:0,si=this.bi;if(it!==0&&ie!==0&&(si&&(he=he||!!(it&&Jt&&(Ie&&Math.abs(Z*ie-Jt/ie)<.1||Math.abs(ee[0].pts-Jt-Se)<ie/5))),he||(Jt=Z*ie),Jt!==void 0)){ee.forEach(function(Ct){Ct.pts=Ue(Ct.pts-Ye,Jt),Ct.dts=Ue(Ct.dts-Ye,Jt)}),ee.sort(function(Ct,Bt){var ri=Ct.dts-Bt.dts,Mi=Ct.pts-Bt.pts;return ri||Mi}),this.mi&&ee.forEach(function(Ct){Ct.dts<0&&(Ct.dts=0,Ct.cts=Ct.pts-Ct.dts)}),Yt=ee[0].dts,Ut=Math.max(ee[0].pts,0);var Lt,_t=Yt-Jt;if(he&&_t){if(Ut-=_t,Yt=Jt,ee[0].dts=Yt,ee[0].pts=Ut,_t<0)for(var ai=1;ee[ai]&&ee[ai].dts<=ee[ai-1].dts;){var wi=ee[ai-1].dts+ze-ee[ai].dts;ee[ai].dts+=wi,ee[ai].pts+=wi,ai++}this.Ci.v(ne,"Video/PTS/DTS adjusted: "+Object(h.d)(Ut,ie,!0)+"/"+Object(h.d)(Yt,ie,!0))}te=ee[it-1].dts,G=Math.max(ee[it-1].pts,0,te),si&&(Et=Math.round((te-Yt)/(it-1)));for(var Oi=0;Oi<it;Oi++){var bi=ee[Oi];si?bi.dts=Yt+Oi*Et:(bi.dts=Math.max(bi.dts,Yt),typeof Lt=="number"&&bi.dts<Lt&&(bi.dts=Lt+1),bi.pts=bi.cts+bi.dts,Lt=bi.dts)}!he&&ee[0].key&&ee[0].pts<ee[0].dts&&(ee[0].pts=ee[0].dts);for(var zi=function(){var Ct,Bt=ee[Pt];if(!si){if(Pt<it-1)Et=Math.round(ee[Pt+1].dts-Bt.dts);else if(Et=pe.Bi.prevSampleDuration?pe.Bi.prevSampleDuration:P.sampleDuration||Et,Ee&&pe.Ii){var ri=pe.Ii*ie-Bt.pts;ri>.5*P.inputTimescale&&(Et=ri)}}var Mi=Bt.pts-Bt.dts;if(Et<0||isNaN(Et)||!isFinite(Et)){var Gr=he&&it<2?_t:0;Et=Math.round(Math.max(P.sampleDuration-Gr,ze,1));var yi=ee[Pt+1];yi&&(yi.dts=Bt.dts+Et,yi.pts=yi.dts+yi.cts)}else Et=Math.round(Et);var Ci=P.codec.indexOf("av01")===0?0:4;if(Ct=Bt.units.reduce(function(bt,zt){return zt.data.byteLength+Ci+bt},0),Bt.key&&!Bt.isFill||Bt.keyTime){var Br={key:Bt.key,pts:Bt.pts/ie,cts:Bt.cts/ie,originPTS:Bt.originPTS/ie};P.codecType===S.c.hevc&&Bt.units.reduce(function(bt,zt){return bt||zt.type===j.a.HEVC_NAL_CRA_NUT},!1)&&(Bt.key=!1,Br.cra=!0),ct.push(Br)}Bt.sei&&nt.push(Bt.sei),Bt.privNal&&Wt.push(Bt.privNal),(Et/ie>2||Et/ie<=.001)&&pe.Ci.i(ne,"sample duration exception.",Ee,Et,Mi),Te.push({len:Ct,units:Bt.units,duration:Et||1,cts:Mi,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Bt.key?2:1,isNonSync:Bt.key?0:1},auxiliaryInfo:Bt.auxiliaryInfo})},Pt=0;Pt<it;Pt++)zi();if(this.Oi=(te+Et)/ie,Te.length&&this.pi){var It=Te[0].flags;It.dependsOn=2,It.isNonSync=0}P.mp4Samples=Te;var Ni=M.videoMediaSegment(P.sequenceNumber++,Math.round(Yt),P,this.Ui(S.o.VIDEO));this.Mi&&(this.Mi.sequenceNumber=P.sequenceNumber);var Nt={payload:Ni,adjustedStart:_t/ie,startPTS:Ut/ie,endPTS:(G+Et)/ie,startDTS:Yt/ie,endDTS:this.Oi,type:S.o.VIDEO,originFirstDTS:ee[0].originDTS/ie,originFirstPTS:ee[0].originPTS/ie,firstParseTime:ee[0].parseTime,fillDuration:P.fillDuration/ie,droppedDuration:P.droppedDuration/ie,droppedFrames:P.droppedFrames,keyTime:ct,sei:nt,privNal:Wt,sampleCount:Te.length};return P.fillDuration=0,P.droppedDuration=0,P.droppedFrames=0,P.samples=[],P.mp4Samples=[],this.Ti.video=G/ie,Nt}}},k.xi=function(P,Z,he,Ie){if(Ie===void 0&&(Ie=!1),P.samples.length&&this.wi!==void 0){var Ee,pe,G,te,ie=P.inputTimescale,ee=P.timescale,Te=ie/ee,Se=P.codecType===S.c.aac?1024:1152,Ye=Se*Te,ze=this.wi*ie,it=[],ct=Object(h.e)(1,ie),nt=P.codecType===S.c.mp3&&this.li.mpeg,Wt=0,Et=P.samples,Ut=this.Ii?this.Ii*ie:this.Ii,Yt=!1;if(he=he||!!(Et.length&&Ut&&(Ie&&Math.abs(Z-Ut/ie)<.1||Math.abs(Et[0].pts-Ut-ze)<20*Ye)),Et.forEach(function(fr){fr.pts=fr.dts=Ue(fr.pts-ze,Z*ie)}),Et=Et.filter(function(fr){return fr.pts>=0}),Et.length!==0&&(he&&Ut!==void 0||(Ut=Ie?Z*ie:Et[0].pts,Yt=!0),Ut!==void 0)){if(P.codecType===S.c.aac)for(var Jt=this.di.maxAudioFramesDrift*Ye,si=0,Lt=Ut;si<Et.length;){var _t=Et[si],ai=_t.pts-Lt;if(ai<=-Jt)this.Ci.w(ne,"Dropping 1 audio frame @ "+(Ut/ie).toFixed(3)+"s"),Et.splice(si,1),P.droppedDuration+=Ye;else if(ai>=Jt&&ai<100*ie&&Lt){var wi=Math.round(ai/Ye);this.Ci.i(ne,"Injecting "+wi+" audio frame @ "+(Lt/ie).toFixed(3)+"s due to "+Math.round(Object(h.d)(ai,ie))+" ms gap. "+si+" "+P.manifestCodec+" "+P.codec);for(var Oi=0;Oi<wi;Oi++){var bi=Math.max(Lt,0);(pe=T.a.getSilentFrame(P.manifestCodec||P.codec,P.channelCount))||(this.Ci.v(ne,"Unable to get silent frame for given audio codec; duplicating last frame instead."),pe=_t.unit.subarray());var zi=_t.originDTS-(wi-Oi)*Ye;Et.splice(si,0,{unit:pe,pts:bi,dts:bi,originDTS:zi,originPTS:zi,isFill:!0,duration:Ye}),Lt+=Ye,si++}P.fillDuration+=Ye*wi,_t.pts=_t.dts=Lt,Lt+=_t.duration||Ye}else{var Pt=Et[si+1];if(Pt){var It=Math.round(Pt.pts-_t.pts);It<1?(Pt.pts=Pt.dts=_t.pts+1,_t.duration=ct):_t.duration=It>Jt?Ye:It}_t.pts=_t.dts=Lt,Lt=_t.pts+(_t.duration||Ye),si++}}for(var Ni=Et.length,Nt=0,Ct=Et.length;Nt<Ct;Nt++){var Bt,ri=Et[Nt],Mi=ri.unit,Gr=ri.duration?Math.round(ri.duration/Te):Se,yi=ri.pts;if(G!==void 0&&Ee)Ee.duration=Math.round((yi-G)/Te);else{var Ci=Math.round(yi-Ut),Br=0;if(he&&P.codecType===S.c.aac&&Ci){if(Ci>0&&Ci<100*ie)Br=Math.round((yi-Ut)/Ye),this.Ci.v(ne,Ci+" ms hole between AAC samples detected,filling it");else if(Ci<-.012*ie){this.Ci.v(ne,"drop overlapping AAC sample, expected/parsed/delta:"+(Ut/ie).toFixed(3)+"s/"+(yi/ie).toFixed(3)+"s/"+-Ci/ie*1e3+"ms");continue}yi=Ut}Wt=yi;for(var bt=0;bt<Br;bt++){var zt=Se;(pe=T.a.getSilentFrame(P.manifestCodec||P.codec,P.channelCount))||(this.Ci.v(ne,"Unable to get silent frame for given audio codec; duplicating this frame instead."),pe=Mi.subarray(),ri.duration&&(zt=Gr)),Ee={len:pe.byteLength,cts:0,duration:zt,unit:pe,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1,isNonSync:0},auxiliaryInfo:ri.auxiliaryInfo},it.push(Ee)}}ri.aacPriv&&(te||(te=[]),(Bt=te).push.apply(Bt,ri.aacPriv)),Ee={len:Mi.byteLength,cts:0,duration:Gr,unit:Mi,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1,isNonSync:0},auxiliaryInfo:ri.auxiliaryInfo},it.push(Ee),G=yi}if(Ni=it.length,Ee){if(Ni&&typeof G=="number"){var tn;Ee&&Ee.duration===0&&(Ee.duration=Se),Ut=G+Te*Ee.duration,P.mp4Samples=it,tn=nt?M.audioRawMpeg(P):M.audioMediaSegment(P.sequenceNumber++,Wt/Te,P,this.Ui(S.o.AUDIO)),P.samples=[],P.mp4Samples=[];var ei=Wt/ie,ui=this.Ii=Ut/ie,zr={payload:tn,startPTS:ei,endPTS:ui,startDTS:ei,endDTS:ui,type:S.o.AUDIO,originFirstDTS:Et[0].originDTS/ie,originFirstPTS:Et[0].originPTS/ie,firstParseTime:Et[0].parseTime,fillDuration:P.fillDuration/ie,droppedDuration:P.droppedDuration/ie,aacPriv:te,sampleCount:it.length};return nt&&(zr.updateTimestampOffset=!0),P.fillDuration=0,P.droppedDuration=0,this.Ti.audio=G/ie,zr}Yt&&delete this.Ii,P.samples=[],P.mp4Samples=[]}}}},k.Ui=function(P){var Z;return this.ji&&this.ji[P]&&(Z=this.ji[P],delete this.ji[P]),Z},k.Ni=function(P,Z){var he=s()({},P);he.samples=[],he.codecType=S.c.h264,he.inputTimescale=P.inputTimescale,he.timescale=P.timescale;var Ie=I.getFillTrackBySamples(he,Z.samples);return Ie&&(this.gi=he.codec===this.yi),Ie},m()(re,[{key:"iSGenerated",get:function(){return this.gi}}])}();function Ue(re,k){var P;if(k===void 0)return re;for(P=k<re?-8589934592:8589934592;Math.abs(re-k)>4294967296;)re+=P;return re}i.b=Le},function(r,i,n){var o=n(5),s=n.n(o),d=n(0),m=n(22),A=n(21),T="canvas-output",C=function(){function h(w,I,S){this.Ci=void 0,this.Fi=void 0,this.Pi=void 0,this.Hi=d.s.video,this.Yi=null,this.Gi=null,this.Ki={w:0,h:0},this.Zi={w:0,h:0},this.Wi={w:0,h:0},this.Pi=S,this.Fi=I,this.Ci=w,w.i(T,"constructor colorSpace: "+I.preferCanvasColorSpace)}h.getPictModeByCss=function(w){var I=m.a.contain;return w instanceof HTMLCanvasElement&&(w.style.objectFit==="fill"?I=m.a.fill:w.style.objectFit==="cover"&&(I=m.a.cover)),I};var F=h.prototype;return F.reset=function(){this.Ci.i(T,"reset"),this.Hi=d.s.video,this.Xi()},F.updateCanvasSize=function(w,I){var S=!1;return w===this.Ki.w&&I===this.Ki.h||(S=!0,this.Ki.w=w,this.Ki.h=I,this.zi()),this.Ji(),S},F.updateFormatSize=function(w,I,S){var W=!1,j=S%180==90||S%180==-90,N=j?I:w,K=j?w:I;return N===this.Zi.w&&K===this.Zi.h||(W=!0,this.Zi.w=N,this.Zi.h=K,this.zi(),this.Ji()),W},F.updateRendererType=function(w){this.Ci.i(T,"updateRendererType: "+w);var I=this.rendererType;return w!==d.s.canvas||this.Pi||this.qi(),this.Hi=w,I!==this.rendererType},F.destroy=function(){this.Ci.i(T,"destroy"),this.Xi()},F.zi=function(){if(this.Pi&&this.Ki.h){var w=this.Ki,I=w.w,S=w.h,W=this.Zi,j=W.w,N=W.h;if(N){var K=I/S;K>j/N?S>N&&(I=(S=N)*K):I>j&&(S=(I=j)/K)}this.Pi.width=I,this.Pi.height=S,this.Ci.i(T,"update canvas size",I,S)}},F.Ji=function(){var w,I,S=((w=this.Pi)==null?void 0:w.width)||this.Ki.w,W=((I=this.Pi)==null?void 0:I.height)||this.Ki.h,j=this.Zi,N=j.w/j.h;N>S/W?(this.Wi.w=S,this.Wi.h=Math.round(S/N)):(this.Wi.w=Math.round(W*N),this.Wi.h=W)},F.$i=function(w){this.Ci.i(T,"create canvas");var I=document.createElement("canvas");return w.w?(I.width=w.w,I.height=w.h):(w.w=I.width,w.h=I.height),I},F.qi=function(){this.Pi||(this.Pi=this.$i(this.Ki))},F.Xi=function(){if(this.Ci.i(T,"destroy canvas"),this.Yi){var w=this.Yi.getExtension("WEBGL_lose_context");w&&w.loseContext()}this.Yi=null,this.Pi&&(typeof HTMLCanvasElement<"u"&&this.Pi instanceof HTMLCanvasElement&&this.Pi.remove(),this.Pi=void 0)},s()(h,[{key:"rendererType",get:function(){return this.Hi}},{key:"canvas",get:function(){return this.Pi||this.qi(),this.Pi}},{key:"webgl",get:function(){var w;return!this.Yi&&this.Pi&&(this.Yi=Object(A.c)(this.Pi)),(w=this.Fi)!=null&&w.preferCanvasColorSpace&&this.Yi&&Object.prototype.hasOwnProperty.call(this.Yi,"drawingBufferColorSpace")&&(this.Yi.drawingBufferColorSpace=this.Fi.preferCanvasColorSpace),this.Yi}},{key:"canvas2d",get:function(){return!this.Gi&&this.Pi&&(this.Gi=this.Pi.getContext("2d")),this.Gi}},{key:"canvasSize",get:function(){return this.Ki}},{key:"formatSize",get:function(){return this.Zi}},{key:"displaySize",get:function(){return this.Wi}}])}();i.a=C},function(r,i,n){function o(s,d,m){return m===void 0?{width:s,height:d}:m.width>m.height?{width:Math.round(m.width/m.height*s),height:d}:m.width<m.height?{width:s,height:Math.round(d*m.height/m.width)}:{width:s,height:d}}n.d(i,"a",function(){return o})},function(r,i,n){function o(C){var h={};function F(I){if(h[I])return h[I].exports;var S=h[I]={i:I,l:!1,exports:{}};return C[I].call(S.exports,S,S.exports,F),S.l=!0,S.exports}F.m=C,F.c=h,F.i=function(I){return I},F.d=function(I,S,W){F.o(I,S)||Object.defineProperty(I,S,{configurable:!1,enumerable:!0,get:W})},F.r=function(I){Object.defineProperty(I,"__esModule",{value:!0})},F.n=function(I){var S=I&&I.__esModule?function(){return I.default}:function(){return I};return F.d(S,"a",S),S},F.o=function(I,S){return Object.prototype.hasOwnProperty.call(I,S)},F.p="/",F.oe=function(I){throw console.error(I),I};var w=F(F.s=ENTRY_MODULE);return w.default||w}var s="[\\.|\\-|\\+|\\w|/|@]+",d="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+s+").*?\\)";function m(C){return(C+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function A(C,h,F){var w={};w[F]=[];var I=h.toString(),S=I.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!S)return w;for(var W,j=S[1],N=new RegExp("(\\\\n|\\W)"+m(j)+d,"g");W=N.exec(I);)W[3]!=="dll-reference"&&w[F].push(W[3]);for(N=new RegExp("\\("+m(j)+'\\("(dll-reference\\s('+s+'))"\\)\\)'+d,"g");W=N.exec(I);)C[W[2]]||(w[F].push(W[1]),C[W[2]]=n(W[1]).m),w[W[2]]=w[W[2]]||[],w[W[2]].push(W[4]);for(var K,z=Object.keys(w),B=0;B<z.length;B++)for(var J=0;J<w[z[B]].length;J++)K=w[z[B]][J],isNaN(1*K)||(w[z[B]][J]=1*w[z[B]][J]);return w}function T(C){return Object.keys(C).reduce(function(h,F){return h||C[F].length>0},!1)}r.exports=function(C,h){h=h||{};var F={main:n.m},w=h.all?{main:Object.keys(F.main)}:function(N,K){for(var z={main:[K]},B={main:[]},J={main:{}};T(z);)for(var be=Object.keys(z),X=0;X<be.length;X++){var ye=be[X],Be=z[ye].pop();if(J[ye]=J[ye]||{},!J[ye][Be]&&N[ye][Be]){J[ye][Be]=!0,B[ye]=B[ye]||[],B[ye].push(Be);for(var Ve=A(N,N[ye][Be],ye),je=Object.keys(Ve),we=0;we<je.length;we++)z[je[we]]=z[je[we]]||[],z[je[we]]=z[je[we]].concat(Ve[je[we]])}}return B}(F,C),I="";Object.keys(w).filter(function(N){return N!=="main"}).forEach(function(N){for(var K=0;w[N][K];)K++;w[N].push(K),F[N][K]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",I=I+"var "+N+" = ("+o.toString().replace("ENTRY_MODULE",JSON.stringify(K))+")({"+w[N].map(function(z){return JSON.stringify(z)+": "+F[N][z].toString()}).join(",")+`});
`}),I=I+"new (("+o.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+w.main.map(function(N){return JSON.stringify(N)+": "+F.main[N].toString()}).join(",")+"}))(self);";var S=new window.Blob([I],{type:"text/javascript"});if(h.bare)return S;var W=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(S),j=new window.Worker(W);return j.objectURL=W,j}},function(r,i,n){n.d(i,"b",function(){return A}),n.d(i,"a",function(){return T});var o=n(18),s=n(7),d=n(2),m=function(){function C(F){this.te=void 0,this.te=F}var h=C.prototype;return h.e=function(F){for(var w=arguments.length,I=new Array(w>1?w-1:0),S=1;S<w;S++)I[S-1]=arguments[S];this.te.postMessage({event:d.a.WORKER_LOG,data:{level:o.LogLevel.ERROR,tag:F,msg:I}})},h.w=function(F){for(var w=arguments.length,I=new Array(w>1?w-1:0),S=1;S<w;S++)I[S-1]=arguments[S];this.te.postMessage({event:d.a.WORKER_LOG,data:{level:o.LogLevel.WARN,tag:F,msg:I}})},h.i=function(F){for(var w=arguments.length,I=new Array(w>1?w-1:0),S=1;S<w;S++)I[S-1]=arguments[S];this.te.postMessage({event:d.a.WORKER_LOG,data:{level:o.LogLevel.INFO,tag:F,msg:I}})},h.d=function(F){for(var w=arguments.length,I=new Array(w>1?w-1:0),S=1;S<w;S++)I[S-1]=arguments[S];this.te.postMessage({event:d.a.WORKER_LOG,data:{level:o.LogLevel.DEBUG,tag:F,msg:I}})},h.v=function(F){for(var w=arguments.length,I=new Array(w>1?w-1:0),S=1;S<w;S++)I[S-1]=arguments[S];this.te.postMessage({event:d.a.WORKER_LOG,data:{level:o.LogLevel.VERBOSE,tag:F,msg:I}})},C}();function A(C,h,F,w,I){var S=new o.Logger(I).setName(s.m).setLevel(h).setId(F);return w&&S.setOutput(new m(C)),o.DefaultLogger.setLevel(h),S}function T(C,h){try{switch(h.level){case o.LogLevel.VERBOSE:C.v.apply(C,[h.tag].concat(h.msg));break;case o.LogLevel.INFO:C.i.apply(C,[h.tag].concat(h.msg));break;case o.LogLevel.ERROR:C.e.apply(C,[h.tag].concat(h.msg));break;case o.LogLevel.WARN:C.w.apply(C,[h.tag].concat(h.msg));break;case o.LogLevel.DEBUG:C.d.apply(C,[h.tag].concat(h.msg))}}catch(F){}}},function(r,i,n){n.d(i,"b",function(){return A}),n.d(i,"a",function(){return T});var o=n(11),s=n(0),d=n(7);function m(C,h,F){return F===void 0&&(F=d.f),{type:C,id:o.e[C],pid:-1,inputTimescale:F,timescale:F,codec:"",sequenceNumber:0,samples:[],mp4Samples:[],duration:h,sampleDuration:0,fillDuration:0,droppedDuration:0,droppedFrames:0}}function A(C,h){h===void 0&&(h=d.f);var F=m(s.o.VIDEO,C,h);return F.codedWidth=0,F.codedHeight=0,F.rotation=0,F.sar={width:1,height:1},F.profile="",F.level="",F.chromaFormat="",F.fps=0,F.codecType=s.c.unknown,F.dpb=16,F}function T(C,h){h===void 0&&(h=d.f);var F=m(s.o.AUDIO,C,h);return F.config=[],F.samplerate=0,F.channelCount=0,F.codecType=s.c.unknown,F}},function(r,i,n){n.d(i,"a",function(){return d}),n.d(i,"b",function(){return m}),n.d(i,"c",function(){return A});var o={0:"NONE",8:"INTRA",64:"STILL_PICTURE",1:"MAIN_10",65:"MAIN_10_STILL_PICTURE",17:"MULTILAYER_MAIN_10",81:"MULTILAYER_MAIN_10_STILL_PICTURE",33:"MAIN_10_444",97:"MAIN_10_444_STILL_PICTURE",49:"MULTILAYER_MAIN_10_444",113:"MULTILAYER_MAIN_10_444_STILL_PICTURE",2:"MAIN_12",34:"MAIN_12_444",35:"MAIN_16_444",10:"MAIN_12_INTRA",42:"MAIN_12_444_INTRA",43:"MAIN_16_444_INTRA",66:"MAIN_12_STILL_PICTURE",98:"MAIN_12_444_STILL_PICTURE",99:"MAIN_16_444_STILL_PICTURE"},s={16:"1.0",32:"2.0",35:"2.1",48:"3.0",51:"3.1",64:"4.0",67:"4.1",80:"5.0",83:"5.1",86:"5.2",96:"6.0",99:"6.1",102:"6.2",105:"6.3"};function d(T){switch(T){case 0:return"Monochrome";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}}var m=function(T){return s[T]||"Unknown"},A=function(T){return o[T]||"Unknown"}},function(r,i,n){var o=n(17),s=n(24),d=function(){function m(T){this.Ci=void 0,this.ie=-1,this.Ci=T}var A=m.prototype;return A.reset=function(){this.ie=-1},A.update=function(T,C){if(C.samples.length){var h=C.samples.reduce(function(z,B,J){return C.samples[z].pts>B.pts?z:J},0),F=C.samples[0],w=Math.max(0,F.dts/C.inputTimescale),I=F.originDTS/C.inputTimescale,S=C.samples[h],W=(S.pts+(S.duration||0))/C.inputTimescale,j=o.c(T.samplerate,1),N=W;T.samples.length&&(N=Math.min(T.samples[0].dts/T.inputTimescale,W)),this.ie===-1?this.ie=w:(I=this.ie-w+I,w=this.ie);var K=Math.max(0,Math.ceil((N-w)/j));K>0&&(this.Ci.i("slient-audio","fill cnt: "+K+"@"+w+" duration: "+(N-w)),this.ie=s.a.fillAACFrameByCount(this.Ci,T,w,K,I))}},m}();i.a=d},function(r,i,n){function o(s,d){var m=[];return s.samples.forEach(function(A){var T=s.inputTimescale;m.push({index:0,dts:A.dts/T,pts:A.pts/T,duration:(A.duration||0)/T})}),m.sort(function(A,T){return A.pts-T.pts}),m.forEach(function(A,T){A.index=d+T}),m}n.d(i,"a",function(){return o})},function(r,i,n){i.a={search:function(o,s){for(var d=0,m=o.length-1,A=null,T=null;d<=m;){var C=s(T=o[A=(d+m)/2|0]);if(C>0)d=A+1;else{if(!(C<0))return T;m=A-1}}return null},searchIndex:function(o,s){for(var d=0,m=o.length-1,A=null;d<=m;){var T=s(o[A=(d+m)/2|0]);if(T>0)d=A+1;else{if(!(T<0))return A;m=A-1}}return-1}}},function(r,i,n){n.d(i,"a",function(){return o});var o=function(){function s(){}return s.getSilentFrame=function(d,m){if(d==="mp4a.40.2"){if(m===1)return new Uint8Array([0,200,0,128,35,128]);if(m===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(m===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(m===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(m===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(m===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(m===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(m===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(m===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},s}()},function(r,i,n){function o(d){for(var m=[],A=d.byteLength,T=0;T<A;){if(d[T]<128)m.push(d[T]);else if(!(d[T]<192)){if(d[T]<224){if(T<A-1&&d[T+1]>>6==2){m.push((31&d[T])<<6|63&d[T+1]),T+=2;continue}}else if(d[T]<240){if(T<A-2&&d[T+1]>>6==2&&d[T+2]>>6==2){m.push((15&d[T])<<12|(63&d[T+1])<<6|63&d[T+2]),T+=3;continue}}else if(d[T]<248&&T<A-3&&d[T+1]>>6==2&&d[T+2]>>6==2&&d[T+3]>>6==2){m.push((7&d[T])<<18|(63&d[T+1])<<12|(63&d[T+2])<<6|63&d[T+3]),T+=4;continue}}T++}return(String.fromCodePoint||s).apply(void 0,m)}function s(){for(var d=[],m=0,A="",T=arguments.length,C=new Array(T),h=0;h<T;h++)C[h]=arguments[h];for(var F=0,w=C.length;F!==w;++F){var I=+C[F];if(!(I<1114111&&I>>>0===I))throw RangeError("Invalid code point: "+I);I<=65535?m=d.push(I):(I-=65536,m=d.push(55296+(I>>10),I%1024+56320)),m>=16383&&(A+=String.fromCharCode.apply(null,d),d.length=0)}return A+String.fromCharCode.apply(null,d)}n.d(i,"a",function(){return o})},function(r,i,n){n.r(i);var o=n(18),s=n(11),d=n(27),m=n(34),A=n(28),T=n(2),C=n(47);i.default=function(h){var F,w,I=new A.a;[T.a.PRIV_NAL,T.a.VIDEO_CODEC_DETECTED,T.a.PARSING_INIT_SEGMENT,T.a.PARSED_DATA,T.a.LOAD_END,T.a.ERROR,T.a.DEMUXER_DETECTED,T.a.MEDIA_DEMUX,T.a.METADATA,T.a.KEY_FRAME_INDEXS,T.a.VIDEO_FRAME_INFO,T.a.MP4_NOT_FASTSTART,T.a.AAC_PRIV].forEach(function(S){return I.on(S,function(W){return h.postMessage({event:S,data:W})})}),I.on(T.a.PARSING_DATA,function(S){var W={event:T.a.PARSING_DATA,data:S},j=[];S.segments.forEach(function(N){j.push(N.payload.buffer)}),h.postMessage(W,j)}),I.on(T.a.RAW_DATA,function(S){var W={event:T.a.RAW_DATA,data:S};if(S.type===s.d.videoFrame){var j=[];S.samples&&S.samples.forEach(function(N){N.units.forEach(function(K){N.units.length&&j.indexOf(K.data.buffer)===-1&&j.push(K.data.buffer)})});try{h.postMessage(W,j)}catch(N){h.postMessage(W)}}else h.postMessage(W)}),h.addEventListener("message",function(S){var W=S.data;switch(W.cmd){case d.a.INIT:w||(w=Object(m.b)(h,W.config.logLevel||o.DEFAULT_LOG_LEVEL,W.contextId,W.hasExternalLogger,"mux")),w.i("mux-worker","init",W),function(j,N,K,z,B){F=new C.a(j,N,K,z,B)}(I,W.typeSupported,W.config,W.vendor,w);break;case d.a.PUSH:F.pushMuxData(W.data,W.decryptdata,W.initSegment,W.timeOffset,W.contiguous,W.trackSwitch,W.discontinuity,W.accurateTimeOffset,W.fragEnd,W.transmuxData);break;case d.a.FLUSH:F.flush();break;case d.a.LOAD_END:F.end();break;case d.a.UPDATE_CONFIG:F.updateConfig(W.config)}})}},function(r,i,n){var o,s=typeof Reflect=="object"?Reflect:null,d=s&&typeof s.apply=="function"?s.apply:function(K,z,B){return Function.prototype.apply.call(K,z,B)};o=s&&typeof s.ownKeys=="function"?s.ownKeys:Object.getOwnPropertySymbols?function(K){return Object.getOwnPropertyNames(K).concat(Object.getOwnPropertySymbols(K))}:function(K){return Object.getOwnPropertyNames(K)};var m=Number.isNaN||function(K){return K!=K};function A(){A.init.call(this)}r.exports=A,r.exports.once=function(K,z){return new Promise(function(B,J){function be(ye){K.removeListener(z,X),J(ye)}function X(){typeof K.removeListener=="function"&&K.removeListener("error",be),B([].slice.call(arguments))}N(K,z,X,{once:!0}),z!=="error"&&function(ye,Be,Ve){typeof ye.on=="function"&&N(ye,"error",Be,Ve)}(K,be,{once:!0})})},A.EventEmitter=A,A.prototype.ee=void 0,A.prototype.ne=0,A.prototype.se=void 0;var T=10;function C(K){if(typeof K!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof K)}function h(K){return K.se===void 0?A.defaultMaxListeners:K.se}function F(K,z,B,J){var be,X,ye,Be;if(C(B),(X=K.ee)===void 0?(X=K.ee=Object.create(null),K.ne=0):(X.newListener!==void 0&&(K.emit("newListener",z,B.listener?B.listener:B),X=K.ee),ye=X[z]),ye===void 0)ye=X[z]=B,++K.ne;else if(typeof ye=="function"?ye=X[z]=J?[B,ye]:[ye,B]:J?ye.unshift(B):ye.push(B),(be=h(K))>0&&ye.length>be&&!ye.warned){ye.warned=!0;var Ve=new Error("Possible EventEmitter memory leak detected. "+ye.length+" "+String(z)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ve.name="MaxListenersExceededWarning",Ve.emitter=K,Ve.type=z,Ve.count=ye.length,Be=Ve,console&&console.warn&&console.warn(Be)}return K}function w(){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(K,z,B){var J={fired:!1,wrapFn:void 0,target:K,type:z,listener:B},be=w.bind(J);return be.listener=B,J.wrapFn=be,be}function S(K,z,B){var J=K.ee;if(J===void 0)return[];var be=J[z];return be===void 0?[]:typeof be=="function"?B?[be.listener||be]:[be]:B?function(X){for(var ye=new Array(X.length),Be=0;Be<ye.length;++Be)ye[Be]=X[Be].listener||X[Be];return ye}(be):j(be,be.length)}function W(K){var z=this.ee;if(z!==void 0){var B=z[K];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}function j(K,z){for(var B=new Array(z),J=0;J<z;++J)B[J]=K[J];return B}function N(K,z,B,J){if(typeof K.on=="function")J.once?K.once(z,B):K.on(z,B);else{if(typeof K.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof K);K.addEventListener(z,function be(X){J.once&&K.removeEventListener(z,be),B(X)})}}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return T},set:function(K){if(typeof K!="number"||K<0||m(K))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+K+".");T=K}}),A.init=function(){this.ee!==void 0&&this.ee!==Object.getPrototypeOf(this).ee||(this.ee=Object.create(null),this.ne=0),this.se=this.se||void 0},A.prototype.setMaxListeners=function(K){if(typeof K!="number"||K<0||m(K))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+K+".");return this.se=K,this},A.prototype.getMaxListeners=function(){return h(this)},A.prototype.emit=function(K){for(var z=[],B=1;B<arguments.length;B++)z.push(arguments[B]);var J=K==="error",be=this.ee;if(be!==void 0)J=J&&be.error===void 0;else if(!J)return!1;if(J){var X;if(z.length>0&&(X=z[0]),X instanceof Error)throw X;var ye=new Error("Unhandled error."+(X?" ("+X.message+")":""));throw ye.context=X,ye}var Be=be[K];if(Be===void 0)return!1;if(typeof Be=="function")d(Be,this,z);else{var Ve=Be.length,je=j(Be,Ve);for(B=0;B<Ve;++B)d(je[B],this,z)}return!0},A.prototype.addListener=function(K,z){return F(this,K,z,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(K,z){return F(this,K,z,!0)},A.prototype.once=function(K,z){return C(z),this.on(K,I(this,K,z)),this},A.prototype.prependOnceListener=function(K,z){return C(z),this.prependListener(K,I(this,K,z)),this},A.prototype.removeListener=function(K,z){var B,J,be,X,ye;if(C(z),(J=this.ee)===void 0)return this;if((B=J[K])===void 0)return this;if(B===z||B.listener===z)--this.ne==0?this.ee=Object.create(null):(delete J[K],J.removeListener&&this.emit("removeListener",K,B.listener||z));else if(typeof B!="function"){for(be=-1,X=B.length-1;X>=0;X--)if(B[X]===z||B[X].listener===z){ye=B[X].listener,be=X;break}if(be<0)return this;be===0?B.shift():function(Be,Ve){for(;Ve+1<Be.length;Ve++)Be[Ve]=Be[Ve+1];Be.pop()}(B,be),B.length===1&&(J[K]=B[0]),J.removeListener!==void 0&&this.emit("removeListener",K,ye||z)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(K){var z,B,J;if((B=this.ee)===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this.ee=Object.create(null),this.ne=0):B[K]!==void 0&&(--this.ne==0?this.ee=Object.create(null):delete B[K]),this;if(arguments.length===0){var be,X=Object.keys(B);for(J=0;J<X.length;++J)(be=X[J])!=="removeListener"&&this.removeAllListeners(be);return this.removeAllListeners("removeListener"),this.ee=Object.create(null),this.ne=0,this}if(typeof(z=B[K])=="function")this.removeListener(K,z);else if(z!==void 0)for(J=z.length-1;J>=0;J--)this.removeListener(K,z[J]);return this},A.prototype.listeners=function(K){return S(this,K,!0)},A.prototype.rawListeners=function(K){return S(this,K,!1)},A.listenerCount=function(K,z){return typeof K.listenerCount=="function"?K.listenerCount(z):W.call(K,z)},A.prototype.listenerCount=W,A.prototype.eventNames=function(){return this.ne>0?o(this.ee):[]}},function(r,i,n){n.d(i,"a",function(){return T});var o=n(10),s=n.n(o),d=n(14),m=n(21),A=n(32),T=function(C){function h(w){var I;return(I=C.call(this)||this).Ci=void 0,I.re=void 0,I.he=void 0,I.Ci=w,I}s()(h,C);var F=h.prototype;return F.copyImageData=function(w,I,S,W){var j;this.re||(this.re=Object(m.a)());var N={willReadFrequently:!0};W&&(N.colorSpace=W),this.he||(this.he=this.re.getContext("2d",N));var K,z,B=0,J=0,be=typeof window<"u"&&w instanceof HTMLVideoElement;if(be)B=w.videoWidth,J=w.videoHeight;else if(S===90||S===270){var X=Object(A.a)(w.height,w.width,I);B=X.height,J=X.width}else{var ye=Object(A.a)(w.width,w.height,I);B=ye.width,J=ye.height}return this.re.width=B,this.re.height=J,be?(K=this.he)==null||K.drawImage(w,0,0):(z=this.he)==null||z.drawImage(w,0,0,w.width,w.height,0,0,this.re.width,this.re.height),(j=this.he)==null?void 0:j.getImageData(0,0,B,J,N)},F.destroy=function(){this.Ci.i("image-data-copier","destrpy"),this.re=void 0,this.he=void 0},h}(d.a)},function(r,i,n){var o=n(52);r.exports=function(s,d,m){return(d=o(d))in s?Object.defineProperty(s,d,{value:m,enumerable:!0,configurable:!0,writable:!0}):s[d]=m,s},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=function(){function s(){}return s.getPosByTime=function(d,m){if(d&&d.length!==0){if(d[0]&&m<=d[0].time)return d[0];if(d[d.length-1]&&m>=d[d.length-1].time)return d[d.length-1];for(var A=0,T=d.length-1,C=0,h=0;A<=T;)if(m>(h=d[(C=(A+T)/2|0)+1]?d[C+1].time:Number.MAX_SAFE_INTEGER))A=C+1;else{if(!(m<d[C].time))return m===h?d[C+1]:d[C];T=C-1}return d[0]}},s}();i.a=o},function(r,i,n){var o=n(11),s=n(3),d=n(26);function m(V,y,f){return Uint8Array.prototype.slice?V.slice(y,f):new Uint8Array(Array.prototype.slice.call(V,y,f))}var A=function(){function V(y,f){this.ae=void 0,this.ue=void 0,this.ae=y,this.ue=f}return V.prototype.decrypt=function(y,f){return this.ae.decrypt({name:"AES-CBC",iv:this.ue},f,y)},V}(),T=function(){function V(){this.ce=[0,1,2,4,8,16,32,64,128,27,54],this.fe=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.Ae=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.ve=new Uint32Array(256),this.de=new Uint32Array(256),this.le=new Uint32Array(0),this.be=0,this.pe=0,this.me=void 0,this.ge=void 0,this.ye()}var y=V.prototype;return y._e=function(f){for(var l=new DataView(f),p=new Uint32Array(4),E=0;E<4;E++)p[E]=l.getUint32(4*E);return p},y.ye=function(){var f=this.ve,l=this.de,p=this.fe,E=p[0],x=p[1],H=p[2],O=p[3],Y=this.Ae,ce=Y[0],Ae=Y[1],_e=Y[2],me=Y[3],Ce=new Uint32Array(256),Me=0,Ge=0,ke=0;for(ke=0;ke<256;ke++)Ce[ke]=ke<128?ke<<1:ke<<1^283;for(ke=0;ke<256;ke++){var qe=Ge^Ge<<1^Ge<<2^Ge<<3^Ge<<4;qe=qe>>>8^255&qe^99,f[Me]=qe,l[qe]=Me;var Xe=Ce[Me],et=Ce[Xe],ot=Ce[et],Ke=257*Ce[qe]^16843008*qe;E[Me]=Ke<<24|Ke>>>8,x[Me]=Ke<<16|Ke>>>16,H[Me]=Ke<<8|Ke>>>24,O[Me]=Ke,Ke=16843009*ot^65537*et^257*Xe^16843008*Me,ce[qe]=Ke<<24|Ke>>>8,Ae[qe]=Ke<<16|Ke>>>16,_e[qe]=Ke<<8|Ke>>>24,me[qe]=Ke,Me?(Me=Xe^Ce[Ce[Ce[ot^Xe]]],Ge^=Ce[Ce[Ge]]):Me=Ge=1}},y.expandKey=function(f){for(var l=this._e(f),p=!0,E=0;E<l.length&&p;)p=l[E]===this.le[E],E++;if(!p){this.le=l;var x=this.pe=l.length;if(x!==4&&x!==6&&x!==8)throw new Error("Invalid aes key size="+x);var H,O,Y=this.be=4*(x+6+1),ce=this.me=new Uint32Array(Y),Ae=this.ge=new Uint32Array(Y),_e=this.ve,me=this.ce,Ce=this.Ae,Me=Ce[0],Ge=Ce[1],ke=Ce[2],qe=Ce[3],Xe=0,et=0;for(H=0;H<Y;H++)H<x?Xe=ce[H]=l[H]:(et=Xe,H%x==0?(et=_e[(et=et<<8|et>>>24)>>>24]<<24|_e[et>>>16&255]<<16|_e[et>>>8&255]<<8|_e[255&et],et^=me[H/x|0]<<24):x>6&&H%x==4&&(et=_e[et>>>24]<<24|_e[et>>>16&255]<<16|_e[et>>>8&255]<<8|_e[255&et]),ce[H]=Xe=(ce[H-x]^et)>>>0);for(O=0;O<Y;O++)H=Y-O,et=3&O?ce[H]:ce[H-4],Ae[O]=O<4||H<=4?et:Me[_e[et>>>24]]^Ge[_e[et>>>16&255]]^ke[_e[et>>>8&255]]^qe[_e[255&et]],Ae[O]=Ae[O]>>>0}},y.Ce=function(f){return f<<24|(65280&f)<<8|(16711680&f)>>8|f>>>24},y.decrypt=function(f,l,p){for(var E,x,H,O,Y,ce,Ae,_e,me,Ce,Me,Ge,ke,qe,Xe=this.pe+6,et=this.ge,ot=this.de,Ke=this.Ae,Rt=Ke[0],wt=Ke[1],ut=Ke[2],yt=Ke[3],pt=this._e(p),St=pt[0],Qt=pt[1],$t=pt[2],_i=pt[3],qi=new Int32Array(f),Ji=new Int32Array(qi.length),Di=this.Ce;l<qi.length;){for(me=Di(qi[l]),Ce=Di(qi[l+1]),Me=Di(qi[l+2]),Ge=Di(qi[l+3]),Y=me^et[0],ce=Ge^et[1],Ae=Me^et[2],_e=Ce^et[3],ke=4,qe=1;qe<Xe;qe++)E=Rt[Y>>>24]^wt[ce>>16&255]^ut[Ae>>8&255]^yt[255&_e]^et[ke],x=Rt[ce>>>24]^wt[Ae>>16&255]^ut[_e>>8&255]^yt[255&Y]^et[ke+1],H=Rt[Ae>>>24]^wt[_e>>16&255]^ut[Y>>8&255]^yt[255&ce]^et[ke+2],O=Rt[_e>>>24]^wt[Y>>16&255]^ut[ce>>8&255]^yt[255&Ae]^et[ke+3],Y=E,ce=x,Ae=H,_e=O,ke+=4;E=ot[Y>>>24]<<24^ot[ce>>16&255]<<16^ot[Ae>>8&255]<<8^ot[255&_e]^et[ke],x=ot[ce>>>24]<<24^ot[Ae>>16&255]<<16^ot[_e>>8&255]<<8^ot[255&Y]^et[ke+1],H=ot[Ae>>>24]<<24^ot[_e>>16&255]<<16^ot[Y>>8&255]<<8^ot[255&ce]^et[ke+2],O=ot[_e>>>24]<<24^ot[Y>>16&255]<<16^ot[ce>>8&255]<<8^ot[255&Ae]^et[ke+3],ke+=3,Ji[l]=Di(E^St),Ji[l+1]=Di(O^Qt),Ji[l+2]=Di(H^$t),Ji[l+3]=Di(x^_i),St=me,Qt=Ce,$t=Me,_i=Ge,l+=4}return Ji.buffer},V}(),C=function(){function V(y,f){this.ae=void 0,this.le=void 0,this.ae=y,this.le=f}return V.prototype.expandKey=function(){return this.ae.importKey("raw",this.le,{name:"AES-CBC",length:128},!1,["encrypt","decrypt"])},V}(),h="decrypter",F=function(){function V(f,l,p){var E=(p===void 0?{}:p).removePKCS7Padding,x=E===void 0||E;if(this.Ie=!0,this.di=void 0,this.Ci=void 0,this.Oe=void 0,this.ae=null,this.we=null,this.le=null,this.Ee=null,this.je=null,this.ke=null,this.Me=null,this.Ci=f,this.di=l,this.Oe=x,x)try{var H=self.crypto;H&&(this.ae=H.subtle||H.webkitSubtle)}catch(O){}this.ae===null&&(this.di.enableSoftwareAES=!0)}var y=V.prototype;return y.isSync=function(){return this.di.enableSoftwareAES},y.flush=function(){var f=this.Me;if(f){var l,p,E,x=new Uint8Array(f);return this.reset(),this.Oe?(p=(l=x).byteLength,(E=p&&new DataView(l.buffer).getUint8(p-1))?m(l,0,p-E):l):x}this.reset()},y.reset=function(){this.Me=null,this.ke=null,this.je=null,this.we&&(this.we=null)},y.decrypt=function(f,l,p,E){if(this.di.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(f),l,p);var x=this.flush();x&&E(x.buffer)}else this.webCryptoDecrypt(new Uint8Array(f),l,p).then(E)},y.softwareDecrypt=function(f,l,p){var E,x,H,O=this.ke,Y=this.Me,ce=this.je;this.Se("JS AES decrypt"),ce&&(E=ce,x=f,(H=new Uint8Array(E.length+x.length)).set(E),H.set(x,E.length),f=H,this.je=null);var Ae=this.Be(f);if(!Ae.length)return null;O&&(p=O);var _e=this.we;_e||(_e=this.we=new T),_e.expandKey(l);var me=Y;return this.Me=_e.decrypt(Ae.buffer,0,p),this.ke=m(Ae,-16).buffer,me||null},y.webCryptoDecrypt=function(f,l,p){var E=this,x=this.ae;return this.le===l&&this.Ee||(this.le=l,this.Ee=new C(x,l)),this.Ee.expandKey().then(function(H){return x?new A(x,p).decrypt(f.buffer,H):Promise.reject(new Error("web crypto not initialized"))}).catch(function(H){return E.Te(H,f,l,p)})},y.Te=function(f,l,p,E){return this.Ci.w(h,"[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",f),this.di.enableSoftwareAES=!0,this.Ie=!0,this.softwareDecrypt(l,p,E)},y.Be=function(f){var l=f,p=f.length-f.length%16;return p!==f.length&&(l=m(f,0,p),this.je=m(f,p)),l},y.Se=function(f){this.Ie&&(this.Ci.i(h,"[decrypter.ts]: "+f),this.Ie=!1)},V}(),w=n(5),I=n.n(w),S=n(10),W=n.n(S),j=n(17),N=n(7),K=null,z=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],J=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],be=[0,1,1,4];function X(V,y,f,l,p){if(!(f+24>y.length)){var E=ye(y,f);if(E&&f+E.frameLength<=y.length){var x=l+p*(E.samplesPerFrame*N.f/E.sampleRate),H={unit:y.subarray(f,f+E.frameLength),pts:x,dts:x,originDTS:l,originPTS:l};return V.config=[],V.channelCount=E.channelCount,V.samplerate=E.sampleRate,V.samples.push(H),{sample:H,length:E.frameLength,missing:0}}}}function ye(V,y){var f=V[y+1]>>3&3,l=V[y+1]>>1&3,p=V[y+2]>>4&15,E=V[y+2]>>2&3;if(f!==1&&p!==0&&p!==15&&E!==3){var x=V[y+2]>>1&1,H=V[y+3]>>6,O=1e3*z[14*(f===3?3-l:l===3?3:4)+p-1],Y=B[3*(f===3?0:f===2?1:2)+E],ce=H===3?1:2,Ae=J[f][l],_e=be[l],me=8*Ae*_e,Ce=Math.floor(Ae*O/Y+x)*_e;if(K===null){var Me=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);K=Me?parseInt(Me[1]):0}return K&&K<=87&&l===2&&O>=224e3&&H===0&&(V[y+3]=128|V[y+3]),{sampleRate:Y,channelCount:ce,frameLength:Ce,samplesPerFrame:me}}}function Be(V,y){return!(V[y]!==255||224&~V[y+1]||!(6&V[y+1]))}function Ve(V,y){return y+1<V.length&&Be(V,y)}var je=function(V){return V[V.KEY_FRAME=0]="KEY_FRAME",V[V.INTER_FRAME=1]="INTER_FRAME",V[V.INTRA_ONLY_FRAME=2]="INTRA_ONLY_FRAME",V[V.SWITCH_FRAME=3]="SWITCH_FRAME",V}({}),we=function(V){return V[V.AV1_OBU_SEQUENCE_HEADER=1]="AV1_OBU_SEQUENCE_HEADER",V[V.AV1_OBU_TEMPORAL_DELIMITER=2]="AV1_OBU_TEMPORAL_DELIMITER",V[V.AV1_OBU_FRAME_HEADER=3]="AV1_OBU_FRAME_HEADER",V[V.AV1_OBU_TILE_GROUP=4]="AV1_OBU_TILE_GROUP",V[V.AV1_OBU_METADATA=5]="AV1_OBU_METADATA",V[V.AV1_OBU_FRAME=6]="AV1_OBU_FRAME",V[V.AV1_OBU_REDUNDANT_FRAME_HEADER=7]="AV1_OBU_REDUNDANT_FRAME_HEADER",V[V.AV1_OBU_TILE_LIST=8]="AV1_OBU_TILE_LIST",V[V.AV1_OBU_PADDING=15]="AV1_OBU_PADDING",V}({}),ue=n(8),L=n.n(ue),D=n(35),le=n(24),oe=n(2),Re=n(37),Oe="base-demuxer",de=function(){function V(f,l,p,E,x){var H=this;this.Ci=void 0,this.Ai=void 0,this.De=void 0,this.di=void 0,this.li=void 0,this._i=void 0,this.Re=void 0,this.Le=void 0,this.Mi=void 0,this.Ne=void 0,this._t=void 0,this.Qe=void 0,this.xe=!1,this.Ve=!0,this.Ue=void 0,this.Fe=void 0,this.Pe=void 0,this.Di=function(O){H.Ai.emit(oe.a.ERROR,O)},f.i(Oe,"constructor",E),this.Ci=f,this.Ai=l,this.De=p,this.di=E,this.li=x,this.xe=!!this.di.gopRemux,this._t=new d.a,this.He()}var y=V.prototype;return y.resetInitSegment=function(f){var l;this.Ci.i(Oe,"reset init",f),this._i=f;var p=this.Ye(),E=this.Ge();typeof p=="boolean"&&(this.Mi.active=p,p||(this.xe=!1)),typeof E=="boolean"&&(this.Ne.active=E),this.Re=this.Le=void 0,this.Mi.samples=[],this.Ne.samples=[],(l=this.Qe)==null||l.reset(),this.Ve=!0,this.Ue=void 0,this.Pe=void 0,this.Fe=void 0,this.xe=!!this.di.gopRemux,this._t.clear()},y.resetTimeStamp=function(){},y.updateConfig=function(f){L()(this.di,f)},y.flush=function(){this.Ci.i(Oe,"flush"),this.Ke(!0),this.Ue=void 0},y.destroy=function(){this.Ci.i(Oe,"destroy"),this._t.clear()},y.He=function(f,l){f===void 0&&(f=1/0),this.Mi=Object(D.b)(f,l),this.Ne=Object(D.a)(f,l)},y.Ze=function(f,l){var p;if(((p=this._i)==null||!p.disableFillSlientForRaw)&&l.outputRaw&&!f.active){var E;this.Qe||(le.a.initAudioForFillSilent(this.Ci,f,(E=this._i)==null?void 0:E.audioCodec),this.Qe=new Re.a(this.Ci)),this.Qe.update(f,l)}},y.We=function(f,l){return!!(l.outputRaw||l.active||f.active)||(this.Di(Object(s.e)(s.b.MEDIA_ERROR,s.a.NO_TRACKS_AVAILABLE,"no tracks available. config V: "+this.di.videoEnabled+" A: "+this.di.audioEnabled)),!1)},y.Xe=function(f,l,p){if(f.samples.length===0&&l.samples.length===0)return p&&this.De.flush(),!1;if(!p&&(f.active&&f.samples.length===0||l.active&&l.samples.length<3)){var E=f.active&&f.configParsed&&this.ze(f)||0,x=l.active&&l.decConf&&this.Je(l)||0,H=l.samples.reduce(function(O,Y){return O+(Y.key?1:0)},0);return E>30?(this.Ci.i(Oe,"audio remux sec > 30, remux now."),this.Ke(!0)):(x>30||this.di.isLive&&H>1)&&(this.Ci.i(Oe,"video remux sec: "+x+" key: "+H+", remux now."),this.Ke(!0)),!1}return!0},y.Ke=function(f){},y.qe=function(f,l,p,E,x){this.Ve&&(this.Ve=!1,this.Ai.emit(oe.a.MEDIA_DEMUX,{type:E}));var H=!0,O=0,Y=!1;this.Ue&&(H=this.Ue.contiguous,O=this.Ue.timeOffset,Y=this.Ue.accurateTimeOffset);try{this.De.remux(f,l,O,H,Y,p,x),this.Ue=void 0}catch(ce){this.Ci.i(Oe,ce),this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,ce.message))}},y.ze=function(f){return f.samples.length?f.samples.length&&j.c(f.samplerate,1)*f.samples.length:0},y.Je=function(f){return f.samples.length?(f.samples[f.samples.length-1].dts-f.samples[0].dts)/f.inputTimescale:0},y.Ye=function(){var f,l;return typeof this.di.videoEnabled=="boolean"?this.di.videoEnabled?(l=this._i)==null?void 0:l.hasVideo:this.di.videoEnabled:(f=this._i)==null?void 0:f.hasVideo},y.Ge=function(){var f,l;return typeof this.di.audioEnabled=="boolean"?this.di.audioEnabled?(l=this._i)==null?void 0:l.hasAudio:this.di.audioEnabled:(f=this._i)==null?void 0:f.hasAudio},y.$e=function(f){var l=this.Mi;f.key&&(this.Pe=f.originPTS),f.keyframePTS=this.Pe,this.tn(f)&&l.samples.push(f)},y.tn=function(f){var l,p,E,x=this.Mi;if(!(((l=this._i)==null?void 0:l.pushVSampleMode)==="keyframesOnly"?f.key:((p=this._i)==null?void 0:p.pushVSampleMode)!=="disableAll"))return!1;var H=(E=this._i)==null?void 0:E.dropVideo;if(H)for(var O=0;O<H.length;O++){var Y,ce,Ae;if(!f.key&&(((Y=H[O])==null?void 0:Y.fragSn)===void 0||((ce=H[O])==null?void 0:ce.fragSn)===this.Fe)&&f.keyframePTS===Math.round(H[O].keyframePTS*x.inputTimescale))return this.Ci.i(Oe,"drop sample pts: "+f.originPTS/x.inputTimescale+" frag sn: "+((Ae=H[O])==null?void 0:Ae.fragSn)),x.droppedFrames++,x.droppedDuration+=f.duration||x.sampleDuration,!1}return!0},V}(),$=n(0),ge=n(15),Pe=function(V){return V[V.H264_NAL_UNSPECIFIED=0]="H264_NAL_UNSPECIFIED",V[V.H264_NAL_SLICE=1]="H264_NAL_SLICE",V[V.H264_NAL_DPA=2]="H264_NAL_DPA",V[V.H264_NAL_DPB=3]="H264_NAL_DPB",V[V.H264_NAL_DPC=4]="H264_NAL_DPC",V[V.H264_NAL_IDR_SLICE=5]="H264_NAL_IDR_SLICE",V[V.H264_NAL_SEI=6]="H264_NAL_SEI",V[V.H264_NAL_SPS=7]="H264_NAL_SPS",V[V.H264_NAL_PPS=8]="H264_NAL_PPS",V[V.H264_NAL_AUD=9]="H264_NAL_AUD",V[V.H264_NAL_END_SEQUENCE=10]="H264_NAL_END_SEQUENCE",V[V.H264_NAL_END_STREAM=11]="H264_NAL_END_STREAM",V[V.H264_NAL_FILLER_DATA=12]="H264_NAL_FILLER_DATA",V[V.H264_NAL_SPS_EXT=13]="H264_NAL_SPS_EXT",V[V.H264_NAL_PREFIX=14]="H264_NAL_PREFIX",V[V.H264_NAL_SUB_SPS=15]="H264_NAL_SUB_SPS",V[V.H264_NAL_DPS=16]="H264_NAL_DPS",V[V.H264_NAL_RESERVED17=17]="H264_NAL_RESERVED17",V[V.H264_NAL_RESERVED18=18]="H264_NAL_RESERVED18",V[V.H264_NAL_AUXILIARY_SLICE=19]="H264_NAL_AUXILIARY_SLICE",V[V.H264_NAL_EXTEN_SLICE=20]="H264_NAL_EXTEN_SLICE",V[V.H264_NAL_DEPTH_EXTEN_SLICE=21]="H264_NAL_DEPTH_EXTEN_SLICE",V[V.H264_NAL_RESERVED22=22]="H264_NAL_RESERVED22",V[V.H264_NAL_RESERVED23=23]="H264_NAL_RESERVED23",V[V.H264_NAL_UNSPECIFIED24=24]="H264_NAL_UNSPECIFIED24",V[V.H264_NAL_UNSPECIFIED25=25]="H264_NAL_UNSPECIFIED25",V[V.H264_NAL_UNSPECIFIED26=26]="H264_NAL_UNSPECIFIED26",V[V.H264_NAL_UNSPECIFIED27=27]="H264_NAL_UNSPECIFIED27",V[V.H264_NAL_UNSPECIFIED28=28]="H264_NAL_UNSPECIFIED28",V[V.H264_NAL_UNSPECIFIED29=29]="H264_NAL_UNSPECIFIED29",V[V.H264_NAL_UNSPECIFIED30=30]="H264_NAL_UNSPECIFIED30",V[V.NAL_FF_IGNORE=267448321]="NAL_FF_IGNORE",V[V.PRIV_NAL_MAGIC_H264=31]="PRIV_NAL_MAGIC_H264",V}({}),ae=n(9),q=n(4),b=n(1),ve=[{w:1,h:1},{w:12,h:11},{w:10,h:11},{w:16,h:11},{w:40,h:33},{w:24,h:11},{w:20,h:11},{w:32,h:11},{w:80,h:33},{w:18,h:11},{w:15,h:11},{w:64,h:33},{w:160,h:99},{w:4,h:3},{w:3,h:2},{w:2,h:1}],U=[$.c.hevc,$.c.kvc3,$.c.kvc4,$.c.kvc5,$.c.kvc6],M=[$.c.vvc,$.c.bvc2,$.c.kvc30];function ne(V){return!!V&&U.indexOf(V)>=0}function Le(V){return!!V&&M.indexOf(V)>=0}function Ue(V){var y=Object(b.a)(V,8);if(y>0&&y<=16){var f=ve[y-1];return f?{width:f.w,height:f.h}:void 0}if(y===255)return{width:Object(b.a)(V,16),height:Object(b.a)(V,16)}}function re(V,y,f){return f===void 0&&(f=0),V.forEach(function(l){l.dts=Math.max(0,l.dts+f)/y,l.cts=l.cts/y,l.pts=l.dts+l.cts,l.originDTS=l.originDTS/y}),V}var k=n(41),P=/\0/g,Z=function(){function V(){}return V.parseMetadata=function(y,f){var l={};try{var p=V.en(y,f,0),E=V.en(y,f,p.size);typeof p.data=="string"&&(l[p.data]=E.data)}catch(x){y.i("AMF",x.toString())}return l},V.nn=function(y,f,l){var p=V.rn(f,l),E=V.en(y,f,l+p.size),x=E.objectEnd;return{data:{name:p.data,value:E.data},size:E.size,objectEnd:x}},V.parseVariable=function(y,f,l){return V.nn(y,f,l)},V.parseLongString=function(y,f){var l=new DataView(y,f).getUint32(0);return{data:l>0?Object(k.a)(new Uint8Array(y,f+4,l)).replace(P," ").trim():"",size:4+l}},V.parseDate=function(y,f){var l=new DataView(y,f),p=l.getFloat64(0),E=l.getInt16(8);return{data:new Date(p+=60*E*1e3),size:10}},V.rn=function(y,f){var l=new DataView(y,f).getUint16(0);return{data:l>0?Object(k.a)(new Uint8Array(y,f+2,l)).replace(P," ").trim():"",size:2+l}},V.en=function(y,f,l){var p,E=f.byteLength,x=l,H=f,O=new DataView(H,0),Y=O.getUint8(x);x+=1;var ce=!1;switch(Y){case 0:p=O.getFloat64(x),x+=8;break;case 1:p=!!O.getUint8(x),x+=1;break;case 2:var Ae=V.rn(H,x);p=Ae.data,x+=Ae.size;break;case 3:for(p={},(16777215&O.getUint32(E-4))==9&&3;x<E-4;){var _e=V.nn(y,H,x);if(_e.objectEnd)break;typeof _e.data.name=="string"&&(p[_e.data.name]=_e.data.value),x=_e.size}x<=E-3&&(16777215&O.getUint32(x-1))===9&&(x+=3);break;case 8:for(p={},x+=4,(16777215&O.getUint32(E-4))==9&&3;x<E-8;){var me=V.parseVariable(y,H,x);if(me.objectEnd)break;p[me.data.name]=me.data.value,x=me.size}x<=E-3&&(16777215&O.getUint32(x-1))===9&&(x+=3);break;case 9:p=void 0,x=1,ce=!0;break;case 10:p=[];var Ce=O.getUint32(x);x+=4;for(var Me=0;Me<Ce;Me++){var Ge=V.en(y,H,x);p.push(Ge.data),x=Ge.size}break;case 11:var ke=V.parseDate(H,x+1);p=ke.data,x+=ke.size;break;case 12:var qe=V.rn(H,x+1);p=qe.data,x+=qe.size;break;default:x=E,y.v("AMF","AMF","Unsupported AMF value type "+Y)}return{data:p,size:x,objectEnd:ce}},V}(),he=function(){function V(f,l){this.Ci=void 0,this.Ai=void 0,this._t=void 0,this.hn=void 0,this.an={tags:[]},this.un=0,this.cn=void 0,this.fn=void 0,this.An=void 0,this.Ci=f,this.Ai=l,this._t=new d.a,this.un=ge.e,this.cn=this.vn}var y=V.prototype;return y.reset=function(){this.un=ge.e,this.cn=this.vn,this._t.clear(),this.hn=void 0,this.an={tags:[]},this.An=void 0,this.fn=void 0},y.append=function(f){for(this.an={tags:[]},this._t.put(f);this._t.unreadLen>=this.un;)this.cn();return this.an},y.vn=function(){var f=this._t.get(ge.e);f&&(f[0]===70&&f[1]===76&&f[2]===86&&f[3]===1||this.Ai.emit(oe.a.ERROR,Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Flv: wrong head")),this.An=!!((4&f[4])>>>2),this.fn=!!(1&f[4]),this.Ci.i("flv-tag-dump","head audio: "+this.An+" video: "+this.fn),this.an.head=f,this.un=ge.f,this.cn=this.dn)},y.dn=function(){this.hn=new ge.i;var f=this._t.get(ge.f);f&&(this.hn.tagType=f[0],this.hn.dataSize=Object(q.g)(f,1),this.hn.timestamp=((255&f[7])<<24)+Object(q.g)(f,4),this.cn=this.ln,this.un=this.hn.dataSize+ge.g)},y.ln=function(){var f=this.hn;f&&(f.tagType!==ge.j.SCRIPT&&f.tagType!==ge.j.AUDIO&&f.tagType!==ge.j.VIDEO||(f.body=this._t.get(f.dataSize),this._t.skip(4),this.an.tags.push(f),this.hn=void 0),this.cn=this.dn,this.un=ge.f)},I()(V,[{key:"trackInfo",get:function(){return typeof this.fn=="boolean"&&typeof this.An=="boolean"?{hasVideo:this.fn,hasAudio:this.An}:void 0}}])}(),Ie=n(45),Ee=n.n(Ie),pe=n(12),G=function(){function V(){}return V.parse=function(y){var f=Object(b.c)(y),l={seq_profile:Object(b.a)(f,3),seq_level_idx_0:0,seq_tier_0:0,high_bitdepth:0,twelve_bit:0,monochrome:0,chroma_subsampling_x:0,chroma_subsampling_y:0,chroma_sample_position:0,initial_presentation_delay_present:0,profile_string:"",level_string:"",chroma_format_string:"",bit_depth_luma:8,width:0,height:0,codec:"",color_info:{colorRange:pe.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:pe.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:pe.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:pe.c.AVCOL_SPC_UNSPECIFIED},buffer_delay_length_minus_1:0,frame_presentation_time_length_minus_1:0,frame_id_numbers_present_flag:0,reduced_still_picture_header:0,decoder_model_info_present_flag:0,equal_picture_interval:0,delta_frame_id_length_minus_2:0,additional_frame_id_length_minus_1:0,data:y};l.profile_string=function(ke){switch(ke){case 0:return"Main";case 1:return"High";case 2:return"Professional";default:return"Unknown"}}(l.seq_profile),Object(b.a)(f,1),l.reduced_still_picture_header=Object(b.a)(f,1);var p,E=0,x=0,H=[],O=[0],Y=[0],ce=[0];if(l.reduced_still_picture_header)H[0]=Object(b.a)(f,5);else{Object(b.a)(f,1)&&(this.bn(f,l),l.decoder_model_info_present_flag=Object(b.a)(f,1),l.decoder_model_info_present_flag&&this.pn(f,l)),E=Object(b.a)(f,1),x=Object(b.a)(f,5);for(var Ae=0;Ae<=x;Ae++)Object(b.a)(f,12),H[Ae]=Object(b.a)(f,5),H[Ae]>7?O[Ae]=Object(b.a)(f,1):O[Ae]=0,l.decoder_model_info_present_flag?(Y[Ae]=Object(b.a)(f,1),Y[Ae]&&this.mn(f,l,Ae)):Y[Ae]=0,E&&(ce[Ae]=Object(b.a)(f,1),ce[Ae]&&Object(b.a)(f,4))}l.seq_level_idx_0=H[0],l.seq_tier_0=O[0],l.level_string=(p=H[0])>31||p<0?"Unknown":p>23?"Reserved":2+(p>>2)+"."+(3&p);var _e=Object(b.a)(f,4),me=Object(b.a)(f,4),Ce=Object(b.a)(f,_e+1),Me=Object(b.a)(f,me+1);l.width=Ce+1,l.height=Me+1,l.frame_id_numbers_present_flag=l.reduced_still_picture_header?0:Object(b.a)(f,1),l.frame_id_numbers_present_flag&&(l.delta_frame_id_length_minus_2=Object(b.a)(f,4),l.additional_frame_id_length_minus_1=Object(b.a)(f,3)),Object(b.a)(f,3);var Ge=0;return l.reduced_still_picture_header||(Object(b.a)(f,4),(Ge=Object(b.a)(f,1))&&Object(b.a)(f,2),(Object(b.a)(f,1)||Object(b.a)(f,1))&&Object(b.a)(f,1)||Object(b.a)(f,1),Ge&&Object(b.a)(f,3)),Object(b.a)(f,3),this.gn(f,l),Object(b.a)(f,1),l.codec="av01."+l.seq_profile+"."+("0"+l.seq_level_idx_0).slice(-2)+(l.seq_tier_0?"H":"M")+"."+("0"+l.bit_depth_luma).slice(-2),l.chroma_format_string=function(ke){return ke.chroma_subsampling_x===0&&ke.chroma_subsampling_y===0?"4:4:4":ke.chroma_subsampling_x===1&&ke.chroma_subsampling_y===0?"4:2:2":ke.chroma_subsampling_x===1&&ke.chroma_subsampling_y===1?"4:2:0":"Unknown"}(l),l},V.bn=function(y,f){Object(b.a)(y,32),Object(b.a)(y,32),f.equal_picture_interval=Object(b.a)(y,1),f.equal_picture_interval&&Object(b.i)(y)},V.pn=function(y,f){f.buffer_delay_length_minus_1=Object(b.a)(y,5),f.num_units_in_decoding_tick=Object(b.a)(y,32),f.buffer_removal_time_length_minus_1=Object(b.a)(y,5),f.frame_presentation_time_length_minus_1=Object(b.a)(y,5)},V.mn=function(y,f,l){var p=f.buffer_delay_length_minus_1+1;f.decoder_buffer_delay||(f.decoder_buffer_delay=[]),f.decoder_buffer_delay[l]=Object(b.a)(y,p),f.encoder_buffer_delay||(f.encoder_buffer_delay=[]),f.encoder_buffer_delay[l]=Object(b.a)(y,p),f.low_delay_mode_flag||(f.low_delay_mode_flag=[]),f.low_delay_mode_flag[l]=Object(b.a)(y,p)},V.gn=function(y,f){f.high_bitdepth=Object(b.a)(y,1),f.seq_profile===2&&f.high_bitdepth?(f.twelve_bit=Object(b.a)(y,1),f.bit_depth_luma=f.twelve_bit?12:10):f.seq_profile<2&&(f.bit_depth_luma=f.high_bitdepth?10:8),f.seq_profile===1?f.monochrome=0:f.monochrome=Object(b.a)(y,1),Object(b.a)(y,1)?(f.color_info.colourPrimaries=Object(b.a)(y,8),f.color_info.transferCharacteristics=Object(b.a)(y,8),f.color_info.matrixCoefficients=Object(b.a)(y,8)):(f.color_info.colourPrimaries=pe.a.AVCOL_PRI_UNSPECIFIED,f.color_info.transferCharacteristics=pe.d.AVCOL_TRC_UNSPECIFIED,f.color_info.matrixCoefficients=pe.c.AVCOL_SPC_UNSPECIFIED),f.chroma_subsampling_x=1,f.chroma_subsampling_y=1,f.monochrome?f.color_info.colorRange=Object(b.a)(y,1)+1:(f.color_info.colourPrimaries===pe.a.AVCOL_PRI_BT709&&f.color_info.transferCharacteristics===pe.d.AVCOL_TRC_IEC61966_2_1&&f.color_info.matrixCoefficients===pe.c.AVCOL_SPC_RGB?(f.color_info.colorRange=1,f.chroma_subsampling_x=0,f.chroma_subsampling_y=0):(f.color_info.colorRange=Object(b.a)(y,1)+1,f.seq_profile===0?(f.chroma_subsampling_x=1,f.chroma_subsampling_y=1):f.seq_profile===1?(f.chroma_subsampling_x=0,f.chroma_subsampling_y=0):f.bit_depth_luma===12?(f.chroma_subsampling_x=Object(b.a)(y,1),f.chroma_subsampling_x?f.chroma_subsampling_y=Object(b.a)(y,1):f.chroma_subsampling_y=0):(f.chroma_subsampling_x=1,f.chroma_subsampling_y=0),f.chroma_subsampling_x&&f.chroma_subsampling_y&&Object(b.a)(y,2)),Object(b.a)(y,1))},V}();function te(V,y){var f=Object.keys(V);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(V);y&&(l=l.filter(function(p){return Object.getOwnPropertyDescriptor(V,p).enumerable})),f.push.apply(f,l)}return f}function ie(V){for(var y=1;y<arguments.length;y++){var f=arguments[y]!=null?arguments[y]:{};y%2?te(Object(f),!0).forEach(function(l){Ee()(V,l,f[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(V,Object.getOwnPropertyDescriptors(f)):te(Object(f)).forEach(function(l){Object.defineProperty(V,l,Object.getOwnPropertyDescriptor(f,l))})}return V}var ee=function(){function V(){}return V.createCtx=function(){return{seenFrameHeader:0,ref:[]}},V.parseOBU=function(y,f){for(var l=[],p=0;p<y.byteLength;){var E=y.subarray(p),x=this.yn(E),H=0,O=x.obu_extension_flag+1,Y=Object(b.c)(E);Object(b.g)(Y,8*O),H=x.obu_has_size_field?Object(b.e)(Y):E.length-O;var ce=Y.byteIndex,Ae=ie(ie({},x),{},{data:E.subarray(0,ce+H)});x.obu_type===we.AV1_OBU_SEQUENCE_HEADER?(Ae.content=G.parse(Ae.data.subarray(ce)),f.sh=Ae.content=G.parse(Ae.data.subarray(ce))):x.obu_type===we.AV1_OBU_FRAME_HEADER?(f.seenFrameHeader=0,this._n(Ae.data.subarray(ce),f)):x.obu_type===we.AV1_OBU_REDUNDANT_FRAME_HEADER?f.seenFrameHeader=1:x.obu_type===we.AV1_OBU_TEMPORAL_DELIMITER?f.seenFrameHeader=0:x.obu_type===we.AV1_OBU_FRAME&&(f.seenFrameHeader=0,Ae.content=this.Cn(Ae.data.subarray(ce),f)),l.push(Ae),p+=ce+H}return l},V.yn=function(y){var f={obu_forbidden_bit:y[0]>>7,obu_type:y[0]>>3&15,obu_extension_flag:y[0]>>2&1,obu_has_size_field:y[0]>>1&1};return f.obu_extension_flag&&(f.temporal_id=y[1]>>5,f.spatial_id=y[1]>>3&3),f},V._n=function(y,f){var l=Object(b.c)(y);f.seenFrameHeader?f.frame={keyframe:!1,show_existing_frame:0}:(f.seenFrameHeader=1,f.frame={keyframe:!1,show_existing_frame:0},this.In(l,f),f.frame.show_existing_frame?f.seenFrameHeader=0:f.seenFrameHeader=1)},V.Cn=function(y,f){return this._n(y,f),f.frame},V.In=function(y,f){var l=f.sh;if(l){var p=je.INTER_FRAME;if(l.reduced_still_picture_header)p=je.KEY_FRAME;else{if(Object(b.a)(y,1)==1)return void Object(b.a)(y,3);p=Object(b.a)(y,2)}f.frame&&(f.frame.keyframe=p===je.KEY_FRAME)}},V.On=function(y,f){var l=f.frame_presentation_time_length_minus_1+1;Object(b.a)(y,l)},V}(),Te=function(){function V(){}return V.parse=function(y,f){f===void 0&&(f=!0);var l={},p=new DataView(y.buffer,y.byteOffset).getUint32(0)!==(f?525030175:2113995134),E=6,x=new Uint8Array(1024);x.set(y.slice(0,6),0);for(var H=y.byteLength,O=[y[H-2],y[H-1]],Y=6;Y<H;){var ce=y[Y];O[0]===0&&O[1]===0&&ce===3||(x[E++]=ce),O[0]=O[1],O[1]=ce,++Y}for(var Ae=6,_e=new DataView(x.buffer);Ae<E;){var me=Ae,Ce=_e.getUint16(me,p);me+=2;var Me=_e.getUint16(me,p);me+=2;var Ge=_e.getUint16(me,p);if(me+=2,V.wn(_e,l,me,Ge,Ce,Me,p),me+=Ge,Ae+=Me,!Me)break}return l},V.wn=function(y,f,l,p,E,x,H){var O=V.En(y,l,p);switch(l+=p,E){case 1:break;case 2:f[O]=V.En(y,l,x-4);break;case 3:f[O]=y.getUint32(l,H);break;case 4:var Y=y.getUint32(l+4,H),ce=y.getUint32(l,H);f[O]=Math.pow(2,32)*Y+ce;break;case 5:f[O]=y.getFloat32(l,H);break;case 6:f[O]=y.getFloat64(l,H)}},V.En=function(y,f,l){for(var p="",E=f;E<f+l;E++)p+=String.fromCharCode(y.getUint8(E));return p},V}();function Se(V){for(var y,f=V.byteLength,l=[],p=1;p<f-2;)V[p]===0&&V[p+1]===0&&V[p+2]===3?(l.push(p+2),p+=2):p++;if(l.length===0)return V;y=f-l.length;var E=new Uint8Array(y),x=0;for(p=0;p<y;x++,p++)x===l[0]&&(x++,l.shift()),E[p]=V[x];return E}var Ye=function(){function V(){}return V.parse=function(y){var f=[];try{for(var l=Se(y),p=0;p<l.length-1;){var E=0,x=0,H=0;do E=l[p],p++,x+=E;while(E===255);do E=l[p],p++,H+=E;while(E===255);if(x===251){var O=Object(q.f)(l,p+1),Y=l.subarray(p+3,p+3+O);f.push({type:x,data:Y})}else{var ce=l.subarray(p,p+H);f.push({type:x,data:ce})}p+=H}}catch(Ae){}return f},V}();function ze(V){switch(V){case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}}var it={1:"Main",2:"Main 10",3:"Main Still Picture",4:"Rext"},ct={30:"1",60:"2",63:"2.1",90:"3",93:"3.1",120:"4",123:"4.1",150:"5",153:"5.1",156:"5.2",180:"6",183:"6.1",186:"6.2",255:"8.5"},nt=n(16),Wt=function(){function V(){}return V.parse=function(y){var f=Se(y),l=Object(b.c)(f);Object(b.a)(l,8);var p={pps_id:0,sps_id:0,cabac:0,pic_order_present:0,slice_group_count:0,mb_slice_group_map_type:0,ref_count:[],weighted_pred:0,weighted_bipred_idc:0,chroma_qp_index_offset:[],deblocking_filter_parameters_present:0,constrained_intra_pred:0,redundant_pic_cnt_present:0,transform_8x8_mode:0,data:new Uint8Array(y)};return p.pps_id=Object(b.h)(l),p.sps_id=Object(b.h)(l),p.cabac=Object(b.a)(l,1),p.pic_order_present=Object(b.a)(l,1),p.slice_group_count=Object(b.h)(l)+1,p.slice_group_count>1&&Object(b.h)(l),p.ref_count[0]=Object(b.h)(l)+1,p.ref_count[1]=Object(b.h)(l)+1,p.weighted_pred=Object(b.a)(l,1),p.weighted_bipred_idc=Object(b.a)(l,2),Object(b.f)(l),Object(b.f)(l),p.chroma_qp_index_offset[0]=Object(b.f)(l),p.deblocking_filter_parameters_present=Object(b.a)(l,1),p.constrained_intra_pred=Object(b.a)(l,1),p.redundant_pic_cnt_present=Object(b.a)(l,1),p.transform_8x8_mode=0,p},V}(),Et=function(){function V(){}return V.parse=function(y){var f=Se(y),l=Object(b.c)(f);Object(b.g)(l,8);var p=Object(b.a)(l,8);Object(b.g)(l,8);var E=Object(b.a)(l,8),x=Object(b.h)(l),H=function(Sn){switch(Sn){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"}}(p),O=function(Sn){return Sn<0?"Unknown":(Sn/10).toFixed(1)}(E),Y=1,ce=8,Ae=8;if((p===100||p===110||p===122||p===244||p===44||p===83||p===86||p===118||p===128||p===138||p===144)&&((Y=Object(b.h)(l))===3&&Object(b.a)(l,1),ce=Object(b.h)(l)+8,Ae=Object(b.h)(l)+8,Object(b.a)(l,1),Object(b.a)(l,1)))for(var _e=Y!==3?8:12,me=0;me<_e;me++)Object(b.a)(l,1)&&(me<6?V.jn(l,16):V.jn(l,64));var Ce=Object(b.h)(l)+4,Me=Object(b.h)(l),Ge=0,ke=0,qe=0,Xe=0,et=0,ot=[];if(Me===0)Ge=Object(b.h)(l)+4;else if(Me===1){ke=Object(b.a)(l,1),Xe=Object(b.f)(l),et=Object(b.f)(l),qe=Object(b.h)(l);for(var Ke=0;Ke<qe;Ke++)ot[Ke]=Object(b.f)(l)}var Rt=Object(b.h)(l);Object(b.a)(l,1);var wt=Object(b.h)(l)+1,ut=Object(b.h)(l)+1,yt=Object(b.a)(l,1);yt===0&&Object(b.a)(l,1),Object(b.a)(l,1);var pt=0,St=0,Qt=0,$t=0;Object(b.a)(l,1)&&(pt=Object(b.h)(l),St=Object(b.h)(l),Qt=Object(b.h)(l),$t=Object(b.h)(l));var _i={width:1,height:1},qi=0,Ji=!0,Di=0,rn=0,nr=pe.b.AVCOL_RANGE_UNSPECIFIED,gn=pe.a.AVCOL_PRI_UNSPECIFIED,Kr=pe.d.AVCOL_TRC_UNSPECIFIED,nn=pe.c.AVCOL_SPC_UNSPECIFIED;if(Object(b.a)(l,1)){if(Object(b.a)(l,1)){var Wr=Ue(l);Wr&&(_i=Wr)}if(Object(b.a)(l,1)&&Object(b.a)(l,1),Object(b.a)(l,1)&&(Object(b.a)(l,3),nr=Object(b.a)(l,1)?pe.b.AVCOL_RANGE_JPEG:pe.b.AVCOL_RANGE_MPEG,Object(b.a)(l,1)&&(gn=Object(b.a)(l,8),Kr=Object(b.a)(l,8),nn=Object(b.a)(l,8))),Object(b.a)(l,1)&&(Object(b.h)(l),Object(b.h)(l)),Object(b.a)(l,1)){var er=Object(b.a)(l,32),xi=Object(b.a)(l,32);Ji=!!Object(b.a)(l,1),qi=(Di=xi)/(rn=2*er)}}var _r=0,mn=0;Y===0?(_r=1,mn=2-yt):(_r=Y===3?1:2,mn=(Y===1?2:1)*(2-yt));var bn=16*wt,Li=16*ut*(2-yt);bn-=(pt+St)*_r,Li-=(Qt+$t)*mn;for(var Ga=y.subarray(1,4),Bs="avc1.",ba=0;ba<3;ba++){var ta=Ga[ba].toString(16);ta.length<2&&(ta="0"+ta),Bs+=ta}return{sps_id:x,profile_string:H,level_string:O,bit_depth_luma:ce,bit_depth_chroma:Ae,chroma_format_idc:Y,chroma_format_string:ze(Y),frame_rate:{fixed:Ji,fps:qi,fps_den:rn,fps_num:Di},sar:_i,codec_size:{width:bn,height:Li},color_info:{colorRange:nr,colourPrimaries:gn,transferCharacteristics:Kr,matrixCoefficients:nn},codec:Bs,pic_order_cnt_type:Me,log2_max_frame_num:Ce,log2_max_poc_lsb:Ge,frame_mbs_only_flag:yt,delta_pic_order_always_zero_flag:ke,num_ref_frames_in_pic_order_cnt_cycle:qe,offset_for_ref_frame:ot,offset_for_non_ref_pic:Xe,offset_for_top_to_bottom_field:et,ref_frame_count:Rt,data:new Uint8Array(y)}},V.jn=function(y,f){for(var l=8,p=8,E=0;E<f;E++)p!==0&&(p=(l+Object(b.f)(y)+256)%256),l=p===0?l:p},V}(),Ut=function(){function V(){}return V.parse=function(y){var f=Se(y),l=Object(b.c)(f);Object(b.g)(l,16);var p={pps_id:Object(b.h)(l),sps_id:Object(b.h)(l),dependent_slice_segments_enabled_flag:Object(b.a)(l,1),output_flag_present_flag:Object(b.a)(l,1),num_extra_slice_header_bits:Object(b.a)(l,3),sign_data_hiding_enabled_flag:Object(b.a)(l,1),cabac_init_present_flag:Object(b.a)(l,1),num_ref_idx_l0_default_active:Object(b.h)(l)+1,num_ref_idx_l1_default_active:Object(b.h)(l)+1,init_qp_minus26:Object(b.h)(l),constrained_intra_pred_flag:Object(b.a)(l,1),transform_skip_enabled_flag:Object(b.a)(l,1),tiles_enabled_flag:0,entropy_coding_sync_enabled_flag:0,data:new Uint8Array(y)};return Object(b.a)(l,1)&&Object(b.h)(l),Object(b.f)(l),Object(b.f)(l),Object(b.g)(l,4),p.tiles_enabled_flag=Object(b.a)(l,1),p.entropy_coding_sync_enabled_flag=Object(b.a)(l,1),p},V}(),Yt=function(){function V(){}return V.parsePTL=function(y,f,l){if(!this.kn(y,f.general_ptl)||Object(b.d)(y)<8+16*(l-1>0?1:0))return!1;var p;f.general_ptl.level_idc=Object(b.a)(y,8),f.general_ptl.level_string=(p=f.general_ptl.level_idc,ct[p]||"Unknown"),f.sub_layer_profile_present_flag=[],f.sub_layer_level_present_flag=[];for(var E=0;E<l-1;E++)f.sub_layer_profile_present_flag[E]=Object(b.a)(y,1),f.sub_layer_level_present_flag[E]=Object(b.a)(y,1);if(l-1>0)for(var x=l-1;x<8;x++)Object(b.a)(y,2);for(var H=0;H<l-1;H++){var O=f.sub_layer_ptl[H]=this.getPTLCommon();if(f.sub_layer_profile_present_flag[H]&&this.kn(y,O))return!1;if(f.sub_layer_level_present_flag[H]){if(Object(b.d)(y)<8)return!1;O.level_idc=Object(b.a)(y,8)}}return!0},V.getPTL=function(){return{general_ptl:V.getPTLCommon(),sub_layer_ptl:[],sub_layer_profile_present_flag:[],sub_layer_level_present_flag:[]}},V.getPTLCommon=function(){return{profile_space:0,tier_flag:0,profile_idc:0,profile_compatibility:0,profile_compatibility_flag:[],constraint_indicator:[],level_idc:0,profile_string:"",level_string:""}},V.kn=function(y,f){if(Object(b.d)(y)<88)return!1;f.profile_space=Object(b.a)(y,2),f.tier_flag=Object(b.a)(y,1),f.profile_idc=Object(b.a)(y,5),f.profile_compatibility_flag=[];for(var l=0;l<32;l++)f.profile_compatibility_flag[l]=Object(b.a)(y,1),f.profile_compatibility=(f.profile_compatibility_flag[l]<<31-l)+f.profile_compatibility,f.profile_idc==0&&l>0&&f.profile_compatibility_flag[l]&&(f.profile_idc=l);for(var p=0;p<6;p++)f.constraint_indicator.push(Object(b.a)(y,8));var E;return f.profile_string=(E=f.profile_idc,it[E]||"Unknown"),!0},V}(),Jt=[1,2,2,1],si=[1,2,1,1],Lt=function(){function V(){}return V.parse=function(y,f){f===void 0&&(f=$.c.hevc);var l=Se(y),p=Object(b.c)(l),E=Yt.getPTL();Object(b.g)(p,16);var x=Object(b.a)(p,4),H=Object(b.a)(p,3),O=H+1;Object(b.g)(p,1);var Y={vps_id:x,sps_id:0,chroma_format_idc:0,chroma_format_string:"",profile_string:"",level_string:"",bit_depth_luma:0,bit_depth_chroma:0,fps:0,width:0,height:0,conformance_window_flag:0,codec:"",color_info:{colorRange:pe.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:pe.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:pe.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:pe.c.AVCOL_SPC_UNSPECIFIED},min_spatial_segmentation_idc:0,log2_max_poc_lsb:0,separate_colour_plane_flag:0,log2_min_cb_size:0,log2_diff_max_min_coding_block_size:0,log2_min_tb_size:0,log2_max_trafo_size:0,log2_ctb_size:0,ctb_width:0,ctb_height:0,temporal_layer:[],ptl:E,sar:{width:1,height:1},data:new Uint8Array(y)};if(!Yt.parsePTL(p,E,O)||(Y.sps_id=Object(b.h)(p),Y.sps_id>=16))return Y;var ce=Object(b.h)(p);if(ce==3&&Object(b.a)(p,1)&&(ce=0),Y.width=Object(b.h)(p),Y.height=Object(b.h)(p),Y.conformance_window_flag=Object(b.a)(p,1),Y.conformance_window_flag){var Ae=si[ce],_e=Jt[ce];Y.conf_win_left_offset=Object(b.h)(p),Y.conf_win_right_offset=Object(b.h)(p),Y.conf_win_top_offset=Object(b.h)(p),Y.conf_win_bottom_offset=Object(b.h)(p),Ae&&_e&&(Y.width=Y.width-(Y.conf_win_left_offset+Y.conf_win_right_offset)*_e,Y.height=Y.height-(Y.conf_win_top_offset+Y.conf_win_bottom_offset)*Ae)}Y.bit_depth_luma=Object(b.h)(p)+8,Y.bit_depth_chroma=Object(b.h)(p)+8,Y.log2_max_poc_lsb=Object(b.h)(p)+4;for(var me=Object(b.a)(p,1)?0:H;me<=H;me++)Y.temporal_layer.push({max_dec_pic_buffering:Object(b.h)(p)+1}),Object(b.h)(p),Object(b.h)(p);Y.log2_min_cb_size=Object(b.h)(p)+3,Y.log2_diff_max_min_coding_block_size=Object(b.h)(p),f!==$.c.kvc4&&f!==$.c.kvc5&&f!==$.c.kvc6||Object(b.h)(p),f!==$.c.kvc3&&f!==$.c.kvc4&&f!==$.c.kvc5&&f!==$.c.kvc6||Object(b.h)(p)&&(Object(b.h)(p),Object(b.h)(p)),Y.log2_min_tb_size=Object(b.h)(p)+2;var Ce=Object(b.h)(p);Y.log2_max_trafo_size=Ce+Y.log2_min_tb_size,Object(b.h)(p),Object(b.h)(p),Object(b.a)(p,1)&&Object(b.a)(p,1)&&this.skipScalingListData(p),Object(b.a)(p,1),Object(b.a)(p,1),Object(b.a)(p,1)&&(Object(b.a)(p,4),Object(b.a)(p,4),Object(b.h)(p),Object(b.h)(p),Object(b.a)(p,1));var Me=Object(b.h)(p);if(Me>64)return Y;for(var Ge=[],ke=0;ke<Me;ke++)if(this.parseRps(p,ke,Me,Ge)<0)return Y;if(Object(b.a)(p,1)){var qe=Object(b.h)(p);if(qe>31)return Y;for(me=0;me<qe;me++){var Xe=Math.min(Y.log2_max_poc_lsb,16);Object(b.a)(p,Xe),Object(b.a)(p,1)}}return Object(b.a)(p,1),Object(b.a)(p,1),Object(b.a)(p,1)&&this.hvccParseVui(p,Y,H),Y.log2_ctb_size=Y.log2_min_cb_size+Y.log2_diff_max_min_coding_block_size,Y.ctb_width=Y.width+(1<<Y.log2_ctb_size)-1>>Y.log2_ctb_size,Y.ctb_height=Y.height+(1<<Y.log2_ctb_size)-1>>Y.log2_ctb_size,Y.chroma_format_idc=ce,Y.chroma_format_string=ce===3?"4:4:4":"4:2:0",Y.profile_string=E.general_ptl.profile_string,Y.level_string=E.general_ptl.level_string,Y.codec=this.getCodec(E.general_ptl,f),Y},V.getCodec=function(y,f){f===void 0&&(f=$.c.hevc);for(var l=Math.abs(y.profile_compatibility).toString(16);l.length>1;){var p=l.length-1;if(l.charAt(p)!=="0")break;l=l.slice(0,p)}for(var E="",x=!1,H=5;H>=0;H--)(y.constraint_indicator[H]||x)&&(E="."+y.constraint_indicator[H].toString(16)+E,x=!0);return(f===$.c.hevc?"hev1":f)+"."+["","A","B","C"][y.profile_space]+y.profile_idc+"."+l+"."+(y.tier_flag===0?"L":"H")+y.level_idc+E},V.getGeneralPTL=function(){return{profile_space:0,tier_flag:0,profile_idc:0,profile_compatibility:0,profile_compatibility_flag:[],constraint_indicator:[],level_idc:0,profile_string:"",level_string:""}},V.skipScalingListData=function(y){var f,l,p,E;for(f=0;f<4;f++)for(l=0;l<(f==3?2:6);l++)if(Object(b.a)(y,1))for(E=Math.min(64,1<<4+(f<<1)),f>1&&Object(b.f)(y),p=0;p<E;p++)Object(b.f)(y);else Object(b.h)(y)},V.parseRps=function(y,f,l,p){var E;if(f&&Object(b.a)(y,1)){if(f>=l)return-1;for(Object(b.a)(y,1),Object(b.h)(y),p[f]=0,E=0;E<=p[f-1];E++){var x=0,H=Object(b.a)(y,1);H||(x=Object(b.a)(y,1)),(H||x)&&p[f]++}}else{var O=Object(b.h)(y),Y=Object(b.h)(y);if(2*(Y+O)>Object(b.d)(y))return-1;for(p[f]=O+Y,E=0;E<O;E++)Object(b.h)(y),Object(b.a)(y,1);for(E=0;E<Y;E++)Object(b.h)(y),Object(b.a)(y,1)}return 0},V.hvccParseVui=function(y,f,l){var p;if(Object(b.a)(y,1)){var E=Ue(y);E&&(f.sar=E)}Object(b.a)(y,1)&&Object(b.a)(y,1),Object(b.a)(y,1)&&(Object(b.a)(y,3),f.color_info.colorRange=Object(b.a)(y,1)?pe.b.AVCOL_RANGE_JPEG:pe.b.AVCOL_RANGE_MPEG,Object(b.a)(y,1)&&(f.color_info.colourPrimaries=Object(b.a)(y,8),f.color_info.transferCharacteristics=Object(b.a)(y,8),f.color_info.matrixCoefficients=Object(b.a)(y,8))),Object(b.a)(y,1)&&(Object(b.h)(y),Object(b.h)(y)),Object(b.a)(y,3),Object(b.a)(y,1)&&(Object(b.h)(y),Object(b.h)(y),Object(b.h)(y),Object(b.h)(y)),Object(b.a)(y,1)&&(this.parseTimingInfo(y,f),Object(b.a)(y,1)&&this.skipHrdParameters(y,1,l)),Object(b.a)(y,1)&&(Object(b.a)(y,3),p=Object(b.h)(y),f.min_spatial_segmentation_idc=Math.min(f.min_spatial_segmentation_idc,p),Object(b.h)(y),Object(b.h)(y),Object(b.h)(y),Object(b.h)(y))},V.parseTimingInfo=function(y,f){var l=Object(b.a)(y,32),p=Object(b.a)(y,32);f.fps=p/l||0,Object(b.a)(y,1)&&Object(b.h)(y)},V.skipHrdParameters=function(y,f,l){var p,E=0,x=0,H=0;for(f&&(x=Object(b.a)(y,1),H=Object(b.a)(y,1),(x||H)&&((E=Object(b.a)(y,1))&&Object(b.a)(y,19),Object(b.a)(y,8),E&&Object(b.a)(y,4),Object(b.a)(y,15))),p=0;p<=l;p++){var O=0,Y=0,ce=0;if(Object(b.a)(y,1)||(ce=Object(b.a)(y,1)),ce?Object(b.h)(y):Y=Object(b.a)(y,1),!Y&&(O=Object(b.h)(y))>31)return-1;x&&this.Mn(y,O,E),H&&this.Mn(y,O,E)}return 0},V.Mn=function(y,f,l){var p;for(p=0;p<=f;p++)Object(b.h)(y),Object(b.h)(y),l&&(Object(b.h)(y),Object(b.h)(y)),Object(b.a)(y,1)},V}(),_t="vps-parser",ai=function(){function V(){}return V.parse=function(y,f){var l=Se(f),p=Object(b.c)(l);Object(b.g)(p,16);var E={vps_id:Object(b.a)(p,4),fps:0,ptl:Yt.getPTL(),data:new Uint8Array(f)};if(E.vps_id>=16)return y.i(_t,"VPS id out of range:",E.vps_id),E;if(Object(b.a)(p,2)!==3)return y.i(_t,"vps_reserved_three_2bits is not three"),E;Object(b.g)(p,6);var x=Object(b.a)(p,3);if(Object(b.g)(p,1),Object(b.a)(p,16)!=65535)return y.i(_t,`vps_reserved_ffff_16bits is not 0xffff
`),E;if(x>7)return y.i(_t,"vps_max_sub_layers out of range: ",x),E;if(!Yt.parsePTL(p,E.ptl,x))return E;for(var H=Object(b.a)(p,1)?0:x-1;H<x;H++)Object(b.h)(p),Object(b.h)(p),Object(b.h)(p);var O=Object(b.a)(p,6),Y=Object(b.h)(p)+1;if(Y<1||Y>1024||(Y-1)*(O+1)>Object(b.d)(p))return y.i(_t,"too many layer_id_included_flags"),E;for(H=1;H<Y;H++)for(var ce=0;ce<=O;ce++)Object(b.a)(p,1);if(Object(b.a)(p,1)){var Ae=Object(b.a)(p,32),_e=Object(b.a)(p,32);E.fps=_e/Ae||0}return E},V}(),wi=function(){function V(){}return V.parse=function(y){var f=Se(y),l=Object(b.c)(f);Object(b.g)(l,16);var p={data:new Uint8Array(y),pps_id:Object(b.a)(l,6),sps_id:Object(b.a)(l,4),width:0,height:0};Object(b.a)(l,1),p.width=Object(b.h)(l),p.height=Object(b.h)(l),Object(b.a)(l,1)&&(p.pps_conf_win_left_offset=Object(b.h)(l),p.pps_conf_win_right_offset=Object(b.h)(l),p.pps_conf_win_top_offset=Object(b.h)(l),p.pps_conf_win_bottom_offset=Object(b.h)(l)),Object(b.a)(l,1)&&(Object(b.f)(l),Object(b.f)(l),Object(b.f)(l),Object(b.f)(l)),Object(b.a)(l,1);var E=Object(b.a)(l,1);if(Object(b.a)(l,1)){var x=0;E||(x=Object(b.h)(l));for(var H=Object(b.h)(l),O=0;O<=x;O++)Object(b.g)(l,H+1)}return p},V}(),Oi=n(36),bi=function(){function V(){}return V.parse=function(y){var f=Se(y),l=Object(b.c)(f);Object(b.g)(l,16);var p={data:new Uint8Array(y),sps_id:Object(b.a)(l,4),vps_id:Object(b.a)(l,4),max_sublayers_minus1:Object(b.a)(l,3),chroma_format_idc:Object(b.a)(l,2),chroma_format_string:"",level_idc:0,level_string:"",profile_idc:0,profile_string:"",width:0,height:0,bitdepth:8,fps:0,general_nal_hrd_params_present_flag:0,general_vcl_hrd_params_present_flag:0,general_du_hrd_params_present_flag:0,hrd_cpb_cnt_minus1:0,sps_num_ref_pic_lists:[],sps_long_term_ref_pics_flag:0,sps_inter_layer_prediction_enabled_flag:0,sps_log2_max_pic_order_cnt_lsb_minus4:0,sps_weighted_pred_flag:0,sps_weighted_bipred_flag:0,codec:"vvc",color_info:{colorRange:pe.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:pe.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:pe.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:pe.c.AVCOL_SPC_UNSPECIFIED}};p.chroma_format_string=Object(Oi.a)(p.chroma_format_idc);var E=1<<Object(b.a)(l,2)+5,x=Object(b.a)(l,1);if(x&&this.Sn(l,p,1,p.max_sublayers_minus1),Object(b.a)(l,1),Object(b.a)(l,1)&&Object(b.g)(l,1),p.width=Object(b.h)(l),p.height=Object(b.h)(l),Object(b.a)(l,1)&&(p.conf_win_left_offset=Object(b.h)(l),p.conf_win_right_offset=Object(b.h)(l),p.conf_win_top_offset=Object(b.h)(l),p.conf_win_bottom_offset=Object(b.h)(l)),Object(b.a)(l,1)){var H=Math.floor(p.width/E)+1,O=Math.floor(p.height/E)+1,Y=Object(b.h)(l),ce=0,Ae=0;Y>0&&(Ae=Object(b.a)(l,1),ce=Object(b.a)(l,1));for(var _e=0;Y>0&&_e<=Y;_e++)ce&&_e!==0||(_e>0&&p.width>E&&Object(b.g)(l,H),_e>0&&p.height>E&&Object(b.g)(l,O),_e<Y&&p.width>E&&Object(b.g)(l,H),_e<Y&&p.height>E&&Object(b.g)(l,O)),Ae||(Object(b.g)(l,1),Object(b.g)(l,1));var me=Object(b.h)(l);if(Object(b.a)(l,1)&&Object(b.a)(l,1))for(var Ce=0;Ce<=Y;Ce++)Object(b.g)(l,me+1)}p.bitdepth=Object(b.h)(l)+8,Object(b.a)(l,2),p.sps_log2_max_pic_order_cnt_lsb_minus4=Object(b.a)(l,4),Object(b.a)(l,1)&&Object(b.h)(l);var Me=Object(b.a)(l,2);Object(b.g)(l,8*Me);var Ge=Object(b.a)(l,2);if(Object(b.g)(l,8*Ge),x){var ke=0;p.max_sublayers_minus1>0&&(ke=Object(b.a)(l,1)),this.Bn(l,p.max_sublayers_minus1,ke)}Object(b.h)(l),Object(b.a)(l,1),Object(b.h)(l),Object(b.h)(l)!=0&&(Object(b.h)(l),Object(b.h)(l));var qe=0;p.chroma_format_idc!=0&&(qe=Object(b.a)(l,1)),qe&&(Object(b.h)(l),Object(b.h)(l)!=0&&(Object(b.h)(l),Object(b.h)(l))),Object(b.h)(l),Object(b.h)(l)!=0&&(Object(b.h)(l),Object(b.h)(l));var Xe=0;E>32&&(Xe=Object(b.a)(l,1));var et=Object(b.a)(l,1);et&&(Object(b.h)(l),Object(b.g)(l,1)),Object(b.a)(l,1)&&Object(b.g)(l,2);var ot=Object(b.a)(l,1);if(p.chroma_format_idc!=0)for(var Ke=Object(b.a)(l,1),Rt=Object(b.a)(l,1)?1:Ke?3:2,wt=[],ut=0;ut<Rt;ut++){Object(b.f)(l),wt[ut]=Object(b.h)(l);for(var yt=0;yt<=wt[ut];yt++)Object(b.h)(l),Object(b.h)(l)}Object(b.a)(l,1),Object(b.a)(l,1)&&p.chroma_format_idc!=0&&Object(b.g)(l,1),Object(b.a)(l,1),p.sps_weighted_pred_flag=Object(b.a)(l,1),p.sps_weighted_bipred_flag=Object(b.a)(l,1),p.sps_long_term_ref_pics_flag=Object(b.a)(l,1),p.vps_id>0&&(p.sps_inter_layer_prediction_enabled_flag=Object(b.a)(l,1)),Object(b.a)(l,1);for(var pt=Object(b.a)(l,1),St=0;St<(pt?1:2);St++){p.sps_num_ref_pic_lists[St]=Object(b.h)(l);for(var Qt=0;Qt<p.sps_num_ref_pic_lists[St];Qt++)this.Tn(l,p,St,Qt)}Object(b.a)(l,1),Object(b.a)(l,1)&&Object(b.g)(l,1);var $t=Object(b.a)(l,1);Object(b.a)(l,1)&&Object(b.g)(l,1),Object(b.a)(l,1),Object(b.a)(l,1)&&Object(b.g)(l,1),Object(b.a)(l,1)&&Object(b.g)(l,1);var _i=6-Object(b.h)(l);Object(b.a)(l,1),Object(b.a)(l,1)&&(Object(b.h)(l),Object(b.g)(l,1),$t&&Object(b.g)(l,1),Object(b.a)(l,1)&&Object(b.g)(l,1)),Object(b.a)(l,2),_i>=2&&Object(b.a)(l,1)&&_i>=3&&Object(b.h)(l),Object(b.h)(l),Object(b.a)(l,3),p.chroma_format_idc!=0&&Object(b.g)(l,1),p.chroma_format_idc===1&&Object(b.g)(l,2);var qi=Object(b.a)(l,1),Ji=0;if(p.chroma_format_idc!==3||Xe||(Ji=Object(b.a)(l,1)),(et||qi)&&Object(b.h)(l),Object(b.a)(l,1)&&Object(b.h)(l),Object(b.a)(l,1)){var Di=Object(b.a)(l,2);Object(b.f)(l);for(var rn=0;rn<Di+1;rn++)Object(b.f)(l),Object(b.h)(l)}var nr=Object(b.a)(l,1);ot&&nr&&Object(b.g)(l,1);var gn=0;if(Ji&&nr&&(gn=Object(b.a)(l,1)),gn&&Object(b.g)(l,1),Object(b.a)(l,2),Object(b.a)(l,1)&&Object(b.a)(l,1)){for(var Kr=Object(b.h)(l),nn=0;nn<Kr;nn++)Object(b.h)(l);for(var Wr=Object(b.h)(l),er=0;er<Wr;er++)Object(b.h)(l)}if(x&&Object(b.a)(l,1)){this.Dn(l,p);var xi=0;p.max_sublayers_minus1>0&&(xi=Object(b.a)(l,1));var _r=xi?0:p.max_sublayers_minus1;this.Rn(l,p,_r)}return Object(b.a)(l,1),Object(b.a)(l,1)&&(Object(b.h)(l),Object(b.b)(l),this.Ln(l,p)),p},V.Sn=function(y,f,l,p){l&&(f.profile_idc=Object(b.a)(y,7),f.profile_string=Object(Oi.c)(f.profile_idc),Object(b.g)(y,1)),f.level_idc=Object(b.a)(y,8),f.level_string=Object(Oi.b)(f.level_idc),Object(b.g)(y,2),l&&this.Nn(y);for(var E=[],x=p-1;x>=0;x--)E[x]=Object(b.a)(y,1);y.bitIndex&&Object(b.g)(y,8-y.bitIndex);for(var H=p-1;H>=0;H--)E[H]&&Object(b.g)(y,1);if(l)for(var O=Object(b.a)(y,8),Y=0;Y<O;Y++)Object(b.g)(y,32)},V.Nn=function(y){if(Object(b.a)(y,1)){Object(b.g)(y,71);var f=Object(b.a)(y,8),l=0;f>5&&(Object(b.g)(y,6),l=6),f>l&&Object(b.g)(y,f-l)}y.bitIndex&&Object(b.g)(y,8-y.bitIndex)},V.Bn=function(y,f,l){for(var p=l?0:f;p<=f;p++)Object(b.h)(y),Object(b.h)(y),Object(b.h)(y)},V.Tn=function(y,f,l,p){var E=Object(b.h)(y),x=0;f.sps_long_term_ref_pics_flag&&p<f.sps_num_ref_pic_lists[l]&&E>0&&(x=Object(b.a)(y,1));for(var H=0;H<E;H++){var O=0;if(f.sps_inter_layer_prediction_enabled_flag&&(O=Object(b.a)(y,1)),O)Object(b.h)(y);else{var Y=0;if(f.sps_long_term_ref_pics_flag&&(Y=Object(b.a)(y,1)),Y){var ce=Object(b.h)(y);((f.sps_weighted_pred_flag||f.sps_weighted_bipred_flag)&&H!=0?ce:ce+1)&&Object(b.g)(y,1)}else x&&Object(b.g)(y,f.sps_log2_max_pic_order_cnt_lsb_minus4+4)}}},V.Dn=function(y,f){var l=Object(b.a)(y,32),p=Object(b.a)(y,32);f.fps=p/l||0,f.general_nal_hrd_params_present_flag=Object(b.a)(y,1),f.general_vcl_hrd_params_present_flag=Object(b.a)(y,1),(f.general_nal_hrd_params_present_flag||f.general_vcl_hrd_params_present_flag)&&(Object(b.a)(y,1),f.general_du_hrd_params_present_flag=Object(b.a)(y,1),f.general_du_hrd_params_present_flag&&Object(b.g)(y,8),Object(b.g)(y,8),f.general_du_hrd_params_present_flag&&Object(b.g)(y,4),f.hrd_cpb_cnt_minus1=Object(b.h)(y))},V.Rn=function(y,f,l){for(var p=l;p<=f.max_sublayers_minus1;p++){var E=0;Object(b.a)(y,1)||(E=Object(b.a)(y,1)),E?Object(b.h)(y):(f.general_nal_hrd_params_present_flag||f.general_vcl_hrd_params_present_flag)&&f.hrd_cpb_cnt_minus1===0&&Object(b.g)(y,1),f.general_nal_hrd_params_present_flag&&this.Qn(y,f),f.general_vcl_hrd_params_present_flag&&this.Qn(y,f)}},V.Qn=function(y,f){for(var l=0;l<=f.hrd_cpb_cnt_minus1;l++)Object(b.h)(y),Object(b.h)(y),f.general_du_hrd_params_present_flag&&(Object(b.h)(y),Object(b.h)(y)),Object(b.g)(y,1)},V.Ln=function(y,f){var l=Object(b.a)(y,1),p=Object(b.a)(y,1);Object(b.a)(y,2),Object(b.a)(y,1)&&Object(b.a)(y,8)===255&&Object(b.a)(y,32),Object(b.a)(y,1)&&Object(b.a)(y,1),Object(b.a)(y,1)&&(f.color_info.colourPrimaries=Object(b.a)(y,8),f.color_info.transferCharacteristics=Object(b.a)(y,8),f.color_info.matrixCoefficients=Object(b.a)(y,8),f.color_info.colorRange=Object(b.a)(y,1)?pe.b.AVCOL_RANGE_JPEG:pe.b.AVCOL_RANGE_MPEG),Object(b.a)(y,1)&&(l&&!p||Object(b.h)(y),Object(b.h)(y))},V}(),zi=function(){function V(){}return V.parse=function(y){var f=Se(y),l=Object(b.c)(f);return Object(b.g)(l,16),{vps_id:Object(b.a)(l,4),data:new Uint8Array(y)}},V}(),Pt="video-config",It=function(){function V(){}return V.isParamSetsReady=function(y){return"nalus"in y?!(!y.nalus||!y.nalus.length):!!y.spsList.length},V.parseAV1C=function(y,f,l){var p;y.i(Pt,"parse av1c");var E=(p=ee.parseOBU(f.subarray(4),l)[0])==null?void 0:p.content;return{marker:f[0]>>7&1,version:127&f[0],seq_profile:f[1]>>5&7,seq_level_idx_0:31&f[1],seq_tier_0:f[2]>>7&1,high_bitdepth:f[2]>>6&1,twelve_bit:f[2]>>5&1,monochrome:f[2]>>4&1,chroma_subsampling_x:f[2]>>3&1,chroma_subsampling_y:f[2]>>2&1,chroma_sample_position:3&f[2],initial_presentation_delay_present:f[3]>>4&1,sh:E}},V.parseAVCC=function(y,f){var l=f[0],p=f[1],E=f[2],x=f[3];if(l===1&&p!==0){var H=1+(3&f[4]);if(H===3||H===4){var O=31&f[5];if(O!==0){O>1&&y.w(Pt,"H264 SPS count: "+O);for(var Y,ce,Ae=6,_e=[],me=[],Ce=0;Ce<O;Ce++){var Me=Object(q.f)(f,Ae);if(Ae+=2,Me!==0){var Ge=f.subarray(Ae,Ae+Me);Ae+=Me,_e[(Y=Et.parse(Ge)).sps_id]=Y}}var ke=f[Ae];if(typeof ke=="number"){if(ke!==0){ke>1&&y.w(Pt,"H264 PPS count: "+ke),Ae++;for(var qe=0;qe<ke;qe++){var Xe=Object(q.f)(f,Ae);Ae+=2;var et=f.subarray(Ae,Ae+Xe);me[(ce=Wt.parse(et)).pps_id]=ce,Xe!==0&&(Ae+=Xe)}return{version:l,avcProfile:p,profileCompatibility:E,avcLevel:x,naluLengthSize:H,paramSets:{spsList:_e,ppsList:me,sps:Y,pps:ce}}}y.i(Pt,"Invalid H264 PPS count: "+ke)}}else y.i(Pt,"Invalid H264 SPS count: "+O)}else y.i(Pt,"MP4: Strange NaluLengthSizeMinusOne: "+(H-1))}else y.i(Pt,"Invalid AVCDecoderConfigurationRecord")},V.parseHVCC=function(y,f,l){l===void 0&&(l=$.c.hevc);var p=22;p++;for(var E,x,H,O,Y=[],ce=[],Ae=[];p<f.byteLength;){var _e=63&f[p];if(p+=1,f.byteLength-p<=2)break;var me=Object(q.f)(f,p);p+=2;for(var Ce=0;Ce<me&&!(f.byteLength-p<=2);Ce++){var Me=Object(q.f)(f,p);if(p+=2,Me!==0){var Ge=f.subarray(p,p+Me);if(Ge.byteLength!==Me)break;_e===ae.a.HEVC_NAL_VPS?(y.v(Pt,"VPS lengh "+Me),Ae[(H=ai.parse(y,Ge)).vps_id]=H):_e===ae.a.HEVC_NAL_SPS?(y.v(Pt,"SPS lengh "+Me),Y[(E=Lt.parse(Ge,l)).sps_id]=E):_e===ae.a.HEVC_NAL_PPS?(y.v(Pt,"PPS lengh "+Me),ce[(x=Ut.parse(Ge)).pps_id]=x):_e===ae.a.HEVC_NAL_SEI_PREFIX||_e===ae.a.HEVC_NAL_SEI_SUFFIX?(y.i(Pt,"sei "+_e+" in hvcc"),O||(O=[]),O.push({type:_e,data:Ge})):y.i(Pt,"found "+_e+" nalu in hvcc."),p+=Me}}}return{paramSets:{vpsList:Ae,spsList:Y,ppsList:ce,seiList:O,sps:E,pps:x}}},V.xn=function(y,f,l){f+=3+(63&y[f]);var p=Object(b.c)(y);p.byteIndex=f;for(var E=[],x=l-2;x>=0;x--)E[x]=Object(b.a)(p,1);for(var H=l;H<=8&&l>1;H++)Object(b.g)(p,1);for(var O=l-2;O>=0;O--)E[O]&&Object(b.g)(p,8);return f=p.byteIndex,f+=1+4*y[p.byteIndex]},V.parseVvcC=function(y,f){var l=4,p=1&f[l];if(l++,p){var E=f[++l]>>4&7;l+=2,l=this.xn(f,l,E),l+=6}l++;for(var x,H,O,Y=[],ce=[],Ae=[];l<f.byteLength;){var _e=31&f[l];l+=1;var me=1;_e!==nt.a.VVC_NAL_UNIT_DCI&&_e!==nt.a.VVC_NAL_UNIT_OPI&&(me=Object(q.f)(f,l),l+=2);for(var Ce=0;Ce<me;Ce++){var Me=Object(q.f)(f,l);l+=2;var Ge=f.subarray(l,l+Me);if(Ge.byteLength!==Me)break;l+=Me,_e===nt.a.VVC_NAL_UNIT_VPS?(y.v(Pt,"VPS lengh "+Me),O=zi.parse(Ge),Ae.push(O)):_e===nt.a.VVC_NAL_UNIT_SPS?(y.v(Pt,"SPS lengh "+Me),x=bi.parse(Ge),Y.push(x)):_e===nt.a.VVC_NAL_UNIT_PPS&&(y.v(Pt,"PPS lengh "+Me),H=wi.parse(Ge),ce.push(H))}}return{paramSets:{vpsList:Ae,spsList:Y,ppsList:ce,sps:x,pps:H}}},V.parseBV2C=function(y,f){var l=18;l++;for(var p,E,x,H=[],O=[],Y=[];l<f.byteLength;){var ce=31&f[l];l+=1;var Ae=1;ce!==nt.a.VVC_NAL_UNIT_DCI&&ce!==nt.a.VVC_NAL_UNIT_OPI&&(Ae=Object(q.f)(f,l),l+=2);for(var _e=0;_e<Ae;_e++){var me=Object(q.f)(f,l);l+=2;var Ce=f.subarray(l,l+me);if(Ce.byteLength!==me)break;l+=me,ce===nt.a.VVC_NAL_UNIT_VPS?(y.v(Pt,"VPS lengh "+me),x=zi.parse(Ce),Y.push(x)):ce===nt.a.VVC_NAL_UNIT_SPS?(y.v(Pt,"SPS lengh "+me),p=bi.parse(Ce),H.push(p)):ce===nt.a.VVC_NAL_UNIT_PPS&&(y.v(Pt,"PPS lengh "+me),E=wi.parse(Ce),O.push(E))}}return{paramSets:{vpsList:Y,spsList:H,ppsList:O,sps:p,pps:E}}},V.parseKvLC=function(y,f){var l=4;l++,l++;for(var p,E,x,H=[],O=[],Y=[],ce=[];l<f.byteLength;){var Ae=31&f[l];l+=1;var _e=1;Ae!==nt.a.VVC_NAL_UNIT_DCI&&Ae!==nt.a.VVC_NAL_UNIT_OPI&&(_e=Object(q.f)(f,l),l+=2);for(var me=0;me<_e;me++){var Ce=Object(q.f)(f,l);l+=2;var Me=f.subarray(l,l+Ce);if(Me.byteLength!==Ce)break;l+=Ce,Ae===nt.a.VVC_NAL_UNIT_VPS?(y.v(Pt,"VPS lengh "+Ce),x=zi.parse(Me),Y.push(x)):Ae===nt.a.VVC_NAL_UNIT_SPS?(y.v(Pt,"SPS lengh "+Ce),p=bi.parse(Me),H.push(p)):Ae===nt.a.VVC_NAL_UNIT_PPS&&(y.v(Pt,"PPS lengh "+Ce),E=wi.parse(Me),O.push(E)),ce.push({type:Ae,data:Me})}}return{paramSets:{vpsList:Y,spsList:H,ppsList:O,sps:p,pps:E,nalus:ce}}},V.generateAV1C=function(y,f){y.i(Pt,"generate av1c");var l=new Uint8Array(5+f.data.length);return l[0]=129,l[1]=(f.seq_profile<<5)+(31&f.seq_level_idx_0),l[2]=(f.seq_tier_0<<7)+(f.high_bitdepth<<6)+(f.twelve_bit<<5)+(f.monochrome<<4)+(f.chroma_subsampling_x<<3)+(f.chroma_subsampling_y<<2)+(3&f.chroma_sample_position),l[3]=0,l[4]=8,l.set(f.data,5),l},V.generateAVCC=function(y,f){if(y.i(Pt,"generate avcc"),f.sps&&f.pps&&f.spsList.length&&f.ppsList.length){var l=f.spsList.filter(function(Y){return!!Y}),p=f.ppsList.filter(function(Y){return!!Y}),E=l.reduce(function(Y,ce){return Y+ce.data.byteLength},0),x=p.reduce(function(Y,ce){return Y+ce.data.byteLength},0),H=new Uint8Array(7+E+x+2*l.length+2*p.length);H.set([1,f.sps.data[1],f.sps.data[2],f.sps.data[3],255,224|l.length],0);var O=6;return l.forEach(function(Y){H[O]=Y.data.byteLength>>8&255,H[O+1]=255&Y.data.byteLength,H.set(Y.data,O+2),O+=2+Y.data.byteLength}),H[O]=p.length,O++,p.forEach(function(Y){H[O]=Y.data.byteLength>>8&255,H[O+1]=255&Y.data.byteLength,H.set(Y.data,O+2),O+=2+Y.data.byteLength}),H}},V.generateHVCC=function(y,f){if(y.i(Pt,"generate hvcc"),f.sps&&f.pps&&f.spsList.length&&f.ppsList.length&&f.vpsList.length){var l=f.spsList.filter(function(me){return!!me}),p=f.ppsList.filter(function(me){return!!me}),E=f.vpsList.filter(function(me){return!!me}),x=l.reduce(function(me,Ce){return me+Ce.data.byteLength},0)+p.reduce(function(me,Ce){return me+Ce.data.byteLength},0)+E.reduce(function(me,Ce){return me+Ce.data.byteLength},0)+2*(l.length+p.length+E.length),H=f.sps.ptl,O=new Uint8Array(32+x),Y=new DataView(O.buffer,0);O[0]=1,O[1]=(192&H.general_ptl.profile_space)+((1&H.general_ptl.tier_flag)<<5)+H.general_ptl.profile_idc&31,Y.setUint32(2,H.general_ptl.profile_compatibility);for(var ce=0;ce<6;ce++)Y.setUint8(ce+6,H.general_ptl.constraint_indicator[ce]||0);Y.setUint8(12,H.general_ptl.level_idc);var Ae=1;f.pps.entropy_coding_sync_enabled_flag&&f.pps.tiles_enabled_flag?Ae=0:f.pps.entropy_coding_sync_enabled_flag?Ae=3:f.pps.tiles_enabled_flag&&(Ae=2),O[13]=240+(3840&f.sps.min_spatial_segmentation_idc),O[14]=255&f.sps.min_spatial_segmentation_idc,O[15]=252+(3&Ae),O[16]=252+(3&f.sps.chroma_format_idc),O[17]=248+(f.sps.bit_depth_luma-8&7),O[18]=248+(f.sps.bit_depth_chroma-8&7),O[21]=3,O[22]=3;var _e=23;return[{nalus:E,type:ae.a.HEVC_NAL_VPS},{nalus:l,type:ae.a.HEVC_NAL_SPS},{nalus:p,type:ae.a.HEVC_NAL_PPS}].forEach(function(me){O[_e]=me.type,_e++,Y.setUint16(_e,me.nalus.length),_e+=2,me.nalus.forEach(function(Ce){Y.setUint16(_e,Ce.data.byteLength),_e+=2,O.set(Ce.data,_e),_e+=Ce.data.byteLength})}),O}},V.onH264SPSNalu=function(y,f){var l=!1,p=Et.parse(y);return f.sps&&Object(q.b)(p.data,f.sps.data)||(l=!0),f.sps=p,f.spsList=[p],l},V.onH264PPSNalu=function(y,f){var l=!1,p=Wt.parse(y);return f.pps&&Object(q.b)(p.data,f.pps.data)||(l=!0),f.pps=p,f.ppsList=[p],l},V.onHEVCVPSNalu=function(y,f,l){var p=!1,E=ai.parse(y,f),x=l.vps;return x&&Object(q.b)(E.data,x.data)||(p=!0),l.vps=E,l.vpsList=[E],p},V.onHEVCSPSNalu=function(y,f,l){var p=!1,E=Lt.parse(y,l);return f.sps&&Object(q.b)(E.data,f.sps.data)||(p=!0),f.sps=E,f.spsList=[E],p},V.onHEVCPPSNalu=function(y,f){var l=!1,p=Ut.parse(y);return f.pps&&Object(q.b)(p.data,f.pps.data)||(l=!0),f.pps=p,f.ppsList=[p],l},V.onVVCVPSNalu=function(y,f){var l=!1,p=zi.parse(y),E=f.vps;return E&&Object(q.b)(p.data,E.data)||(l=!0),f.vps=p,f.vpsList=[p],l},V.onVVCSPSNalu=function(y,f){var l=!1,p=bi.parse(y);return f.sps&&Object(q.b)(p.data,f.sps.data)||(l=!0),f.sps=p,f.spsList=[p],l},V.onVVCPPSNalu=function(y,f){var l=!1,p=wi.parse(y);return f.pps&&Object(q.b)(p.data,f.pps.data)||(l=!0),f.pps=p,f.ppsList=[p],l},V.hevDecoderConfigToSample=function(y,f){return{units:V.hevDecoderConfigToNalu(y),dts:0,cts:0,pts:0,originDTS:f,originPTS:f,key:!1,size:0}},V.hevDecoderConfigToNalu=function(y){var f=[];return y.seiList&&y.seiList.forEach(function(l){l&&f.push(l)}),y.vpsList.forEach(function(l){l&&f.push({type:ae.a.HEVC_NAL_VPS,data:l.data})}),y.spsList.forEach(function(l){l&&f.push({type:ae.a.HEVC_NAL_SPS,data:l.data})}),y.ppsList.forEach(function(l){l&&f.push({type:ae.a.HEVC_NAL_PPS,data:l.data})}),f},V.vvcDecoderConfigToNalu=function(y){if(y.nalus)return y.nalus;var f=[];return y.vpsList.forEach(function(l){l&&f.push({type:nt.a.VVC_NAL_UNIT_VPS,data:l.data})}),y.spsList.forEach(function(l){l&&f.push({type:nt.a.VVC_NAL_UNIT_SPS,data:l.data})}),y.ppsList.forEach(function(l){l&&f.push({type:nt.a.VVC_NAL_UNIT_PPS,data:l.data})}),f},V.avcDecoderConfigToNalu=function(y){var f=[];return y.spsList.forEach(function(l){l&&f.push({type:Pe.H264_NAL_SPS,data:l.data})}),y.ppsList.forEach(function(l){l&&f.push({type:Pe.H264_NAL_PPS,data:l.data})}),f},V.vvcDecoderConfigToSample=function(y,f){return{units:V.vvcDecoderConfigToNalu(y),dts:0,cts:0,pts:0,originDTS:f,originPTS:f,key:!1,size:0}},V.getDPB264=function(y){return y.sps?Math.min(Math.max(y.sps.ref_frame_count,2),16):16},V.getDPBHEVC=function(y){if(!y.sps)return 16;var f=y.sps.temporal_layer.reduce(function(l,p){return Math.max(p.max_dec_pic_buffering,l)},2);return Math.min(f,16)},V.getDPBLenAV1=function(){return 8},V}(),Ni="video-track-helper",Nt=function(){function V(){}return V.updateAV1Track=function(y,f,l,p){l&&(f.codedWidth=l.width,f.codedHeight=l.height,f.codec=l.codec,f.profile=l.profile_string,f.level=l.level_string,f.chromaFormat=l.chroma_format_string,f.bitDepth=l.bit_depth_luma,f.colorInfo=l.color_info,f.dpb=It.getDPBLenAV1(),f.decConf=p||It.generateAV1C(y,l))},V.updateAVCTrack=function(y,f,l,p){if(l.sps){var E=l.sps;f.codedWidth=E.codec_size.width,f.codedHeight=E.codec_size.height,f.sar=L()({},E.sar),E.frame_rate.fixed&&E.frame_rate.fps!==0&&(f.fps=E.frame_rate.fps,f.sampleDuration=f.inputTimescale/f.fps),f.codec=E.codec,f.profile=E.profile_string,f.level=E.level_string,f.chromaFormat=E.chroma_format_string,f.bitDepth=E.bit_depth_luma,f.colorInfo=E.color_info,f.dpb=It.getDPB264(l),f.fps&&(f.sampleDuration=Math.floor(f.inputTimescale/f.fps)),f.decConf=p||It.generateAVCC(y,l)}},V.updateHEVCTrack=function(y,f,l,p){if(l.sps){var E=l.sps,x=l.vps;f.codedWidth=E.width,f.codedHeight=E.height,f.sar=L()({},E.sar),f.codec=E.codec,f.profile=E.profile_string||(x==null?void 0:x.ptl.general_ptl.profile_string)||"",f.level=E.level_string||(x==null?void 0:x.ptl.general_ptl.level_string)||"",f.chromaFormat=E.chroma_format_string,f.bitDepth=E.bit_depth_luma,f.fps=E.fps||(x==null?void 0:x.fps)||0,f.colorInfo=E.color_info,f.dpb=It.getDPBHEVC(l),f.fps&&(f.sampleDuration=Math.floor(f.inputTimescale/f.fps)),f.decConf=p||It.generateHVCC(y,l)}},V.updateVVCTrack=function(y,f,l,p){if(l.sps){var E=l.sps;f.codedWidth=E.width,f.codedHeight=E.height,f.codec=E.codec,f.profile=E.profile_string||"",f.level=E.level_string||"",f.chromaFormat=E.chroma_format_string,f.bitDepth=E.bitdepth,f.fps=E.fps||0,f.colorInfo=E.color_info,f.decConf=p}},V.onAV1Detected=function(y,f,l,p,E){return y.i(Ni,"detected av1: "+p.av1+" enabled: "+E),E!==!1&&p.av1?(f.outputRaw=!p.av1,f.active=!0):(y.i(Ni,"AV1 found, disabled."),f.active=!1),f.active},V.onAVCDetected=function(y,f,l,p,E){return y.i(Ni,"detected avc. enabled: "+E),f.active=E!==!1,f.active},V.onHEVCDetected=function(y,f,l,p,E){return y.i(Ni,"detected hevc: "+p.hevc+" wasm: "+l.wasmDecoderEnabled+" enabled: "+E),E!==!1&&(l.wasmDecoderEnabled||p.hevc)?(f.outputRaw=!p.hevc||l.preferDecoder===$.d.wasm,f.active=!0):(y.i(Ni,"HEVC found, disabled. wasmDec:"+l.wasmDecoderEnabled),f.active=!1),f.active},V.onKVCDetected=function(y,f,l,p){return y.i(Ni,"detected kvc wasm: "+l.wasmDecoderEnabled+" enabled: "+p),p===!1?f.active=!1:(f.active=l.wasmDecoderEnabled,f.outputRaw=f.active),f.active||y.i(Ni,"KVC found, disabled. wasmDec:"+l.wasmDecoderEnabled),f.active},V.onVVCDetected=function(y,f,l,p){return y.i(Ni,"detected vvc wasm: "+l.wasmDecoderEnabled+" enabled: "+p),p===!1?f.active=!1:(f.active=l.wasmDecoderEnabled,f.outputRaw=f.active),f.active||y.i(Ni,"VVC found, disabled. wasmDec:"+l.wasmDecoderEnabled),f.active},V}(),Ct="flv-demuxer",Bt=function(V){function y(l,p,E,x,H){var O;return l.i(Ct,"constructor"),(O=V.call(this,l,p,E,x,H)||this).Vn=1/0,O.Un=4,O.Fn=void 0,O.Pn=void 0,O.Hn=[],O.Yn=!1,O.Gn=void 0,O.Fn=new he(l,O.Ai),O}W()(y,V),y.probe=function(l){return l.byteLength>=3&&l[0]===70&&l[1]===76&&l[2]===86};var f=y.prototype;return f.append=function(l,p,E,x,H,O){var Y=this;if(H===void 0&&(H=!1),!l.byteLength&&H)return this.xe?this.Kn():H?this.Zn():this.Ke(),this.Fn.reset(),void this.Ai.emit(oe.a.PARSED_DATA,{extra:this._i});this.Fe=O;var ce=this.Fn.append(l),Ae=this.Fn.trackInfo;Ae&&(this.Mi.active===void 0&&(this.Mi.active=this.Ye()!==!1&&Ae.hasVideo,this.Mi.active||(this.xe=!1)),this.Ne.active===void 0&&(this.Ne.active=this.Ge()!==!1&&Ae.hasAudio));var _e=ce.tags;this.Ue||(this.Ue={timeOffset:p,contiguous:E,accurateTimeOffset:x}),_e.length&&(_e.forEach(function(me){me.tagType===ge.j.VIDEO&&Y.Mi.active&&(Y.Yn||(Y.Ne.samples.length&&Y.Wn(),Y.Yn=!0),Y.Xn(me),!Y.xe&&Y.Mi.samples.reduce(function(Ce,Me){return Ce+Me.size},0)>N.o&&(Y.Ci.i(Ct,"max size remux"),Y.Ke())),me.tagType===ge.j.AUDIO&&Y.Ne.active&&Y.zn(me),me.tagType===ge.j.SCRIPT&&Y.Jn(me)}),this.xe||this.Ke(!(!H||!this.Mi.samples.length&&!this.Ne.samples.length)),H&&((this.Mi.samples.length||this.Ne.samples.length)&&this.Zn(),this.Fn.reset(),this.Ai.emit(oe.a.PARSED_DATA,{extra:this._i})))},f.flush=function(){this.Ci.i(Ct,"flush"),this.Zn(),this.Ue=void 0},f.resetInitSegment=function(l){this.Ci.i(Ct,"reset init",l),V.prototype.resetInitSegment.call(this,l),this.Vn=l.duration,this.Hn=[],this.Fn.reset()},f.He=function(){V.prototype.He.call(this,1/0,N.h)},f.Wn=function(){var l;this.Ci.i(Ct,"discontinuity"),this.Zn(),this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),(l=this.Qe)==null||l.reset()},f.qn=function(l,p,E){var x=E<p||E-p>=N.p;return x&&this.Ci.i(Ct,"time exception. "+l+" last: "+p+" current:"+E+" offset: "+(E-p)/N.h+"s"),x?E-p:0},f.$n=function(l,p,E){var x=this.qn(l,p,E);if(x){if(this.Ci.i(Ct,"time exception. waiting next key frame."),this.xe=!0,!this.Hn.length&&this.Mi.active&&typeof this.Le=="number"||this.Ne.active&&typeof this.Re=="number"){if(this.Hn.length&&(this.Hn[0].diff<0||this.Hn[0].diff/N.h>30))return this.es(),void this.Ci.i(Ct,"time exception. fix. "+l+", diff: "+x);this.ns()?this.Ci.i(Ct,"time exception. audio only"):(this.Ci.i(Ct,"time exception. remux. "+l+", diff: "+x),this.Ke(!0))}this.Hn.push({type:l,diff:x})}},f.Kn=function(){this.xe&&(this.Ci.v(Ct,"key frame"),this.Hn.length?(this.Mi.active&&this.Mi.samples.length>1||this.ns())&&(this.Ci.i(Ct,"time exception. fix on key frame.",this.Mi.samples.length,this.Ne.samples.length),this.es()):this.Ke(!0))},f.es=function(){(this.Hn.length>1||this.ns())&&(this.ss(this.Mi),this.ss(this.Ne)),this.De.flush();var l=this.De.getLastDTS(),p=Math.max(l.video||0,l.audio||0);this.Ci.i(Ct,"fix offset",p,l),this.Ue={accurateTimeOffset:!0,contiguous:!this.Ve,timeOffset:p},this._i&&this.De.resetInitSegment(this._i),this.De.resetTimeStamp(),this.Ne.samples.length&&(this.Re=this.Ne.samples[this.Ne.samples.length-1].dts),this.Mi.samples.length&&(this.Le=this.Mi.samples[this.Mi.samples.length-1].dts),this.Ke(!0),this.Hn=[],this.xe=!!this.di.gopRemux},f.ss=function(l){var p=l.samples;if(p.length>1){var E=l.sampleDuration||1,x=p[p.length-1];this.Ci.i(Ct,"reset "+l.type+" track samples time. sampleDuration:"+E+" dts:"+x.dts);for(var H=p.length-2;H>=0;H--){var O=p[H],Y=O.pts-O.dts;O.dts=x.dts-E,O.pts=O.dts+Y,x=O}}},f.Jn=function(l){if(l.body){var p=Z.parseMetadata(this.Ci,l.body.buffer);if(Object.prototype.hasOwnProperty.call(p,"onMetaData")){var E=p.onMetaData&&typeof p.onMetaData=="object"?p.onMetaData:{};if(typeof E.duration=="number"&&(this.Vn=this.Vn||E.duration),typeof E.framerate=="number"&&E.framerate>0&&(this.Mi.fps=this.Mi.fps||E.framerate,this.Mi.sampleDuration=Math.floor(N.h/this.Mi.fps)),typeof E.videodatarate=="number"&&(this.Mi.bitrate=E.videodatarate),typeof E.audiodatarate=="number"&&(this.Ne.bitrate=E.audiodatarate),E.keyframes&&typeof E.keyframes=="object"){var x=E.keyframes;if(x.filepositions&&Array.isArray(x.filepositions)&&x.times&&Array.isArray(x.times)&&x.filepositions.length===x.times.length){var H=[];x.times.forEach(function(O,Y){H.push({time:O,position:x.filepositions[Y]})}),E.keyframes=x}}this.Ci.i(Ct,"Parsed onMetaData"),this.Ai.emit(oe.a.METADATA,E)}}},f.Xn=function(l){if(l.body&&l.body.length!==0){var p=l.body[0],E=p>>4&8;l.frameType=p>>4&7,E?(this.Mi.enhancedFlv=!0,this.rs(l)):this.hs(l)}},f.rs=function(l){if(l.body&&l.body.length!==0){var p=15&l.body[0],E=Object(q.a)(l.body,1,4),x=5;if(E==="hvc1")l.codecId=12,p===ge.d?this.os(l,x):p!==ge.a&&p!==ge.b||(p===ge.a&&(l.cts=Object(q.d)(l.body,x),x+=3),this.us(l,x));else{if(E!=="av01")return void this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Flv: Unsupported codec in video frame enhanced: "+E));l.codecId=13,p===ge.d?this.os(l,x):p===ge.c||p===ge.a&&this.us(l,x)}}},f.hs=function(l){if(l.body&&l.body.length!==0){var p=ge.h;if(l.codecId=15&l.body[0],l.codecId===7||l.codecId===12||l.codecId===13){var E=l.body[1];if(l.cts=E===1?Object(q.d)(l.body,2):0,E===0)this.os(l,p);else if(E===1)this.us(l,p);else if(E!==2)return void this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Flv: Invalid video packet type "+E))}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Flv: Unsupported codec in video frame: "+l.codecId))}},f.os=function(l,p){this.Ci.i(l,"parse video tag condec conf. id: "+l.codecId);var E=this.Ye();l.codecId===7?(this.Mi.outputRaw&&(this.Wn(),this.Mi.outputRaw=!1),Nt.onAVCDetected(this.Ci,this.Mi,this.di,this.li,E),this.cs(l,p)):l.codecId===12?(Nt.onHEVCDetected(this.Ci,this.Mi,this.di,this.li,E),this.fs(l,p)):l.codecId===13&&(Nt.onAV1Detected(this.Ci,this.Mi,this.di,this.li,E),this.As(l,p)),this.Mi.duration=this.Vn*N.h},f.us=function(l,p){this.Mi.codec&&this.vs(l,p)},f.fs=function(l,p){if(l.body){var E=this.Mi,x=l.body.subarray(p,l.body.byteLength),H=It.parseHVCC(this.Ci,x);if(H&&H.paramSets.spsList.length){var O;if(this.Pn=H.paramSets,E.decConf&&!Object(q.b)(E.decConf,x)&&this.Wn(),E.codecType!==$.c.hevc&&(E.codecType=$.c.hevc,this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{codecType:$.c.hevc,enabled:!!E.active,decoder:this.Mi.outputRaw?$.d.wasm:$.d.buildin,bitDepth:E.bitDepth,timeOffset:((O=this.Ue)==null?void 0:O.timeOffset)||0})),Nt.updateHEVCTrack(this.Ci,E,H.paramSets),this.Mi.outputRaw){var Y=It.hevDecoderConfigToSample(H.paramSets,l.timestamp);this.Ai.emit(oe.a.RAW_DATA,{type:o.d.decoderConfig,samples:re([Y],E.inputTimescale),extra:this._i})}}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Invalid HEVCDecoderConfigurationRecord"))}},f.As=function(l,p){if(l.body){var E=this.Mi,x=l.body.subarray(p,l.body.byteLength);this.Gn=ee.createCtx();var H=It.parseAV1C(this.Ci,x,this.Gn);if(H){var O;E.decConf&&!Object(q.b)(E.decConf,x)&&this.Wn(),E.codecType!==$.c.av1&&(E.codecType=$.c.av1,this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:$.d.buildin,codecType:$.c.av1,timeOffset:((O=this.Ue)==null?void 0:O.timeOffset)||0})),H.sh&&Nt.updateAV1Track(this.Ci,E,H.sh,x)}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Invalid AV1DecoderConfigurationRecord"))}},f.cs=function(l,p){if(l.body){var E=l.body.subarray(p,l.body.byteLength),x=this.Mi,H=It.parseAVCC(this.Ci,l.body.subarray(p,l.body.byteLength));if(H&&H.paramSets.spsList.length){var O;this.Pn=H.paramSets,x.decConf&&!Object(q.b)(x.decConf,E)&&this.Wn(),x.codecType!==$.c.h264&&(x.codecType=$.c.h264,this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:$.d.buildin,codecType:$.c.h264,timeOffset:((O=this.Ue)==null?void 0:O.timeOffset)||0})),Nt.updateAVCTrack(this.Ci,x,H.paramSets,E)}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Invalid AVCDecoderConfigurationRecord"))}},f.vs=function(l,p){var E=this;if(l.body){var x=this.Mi,H=l.body.buffer,O=l.body.byteLength-p,Y=new DataView(H,p,O),ce=[],Ae=0,_e=this.Un,me=l.timestamp,Ce=l.cts,Me=!1;me===this.Le&&(Ce+=1);var Ge=me+Ce,ke=l.frameType===1;ke&&this.Kn(),typeof this.Le=="number"&&this.$n($.o.VIDEO,this.Le,me);var qe=[],Xe=[];if(l.codecId===13)this.Gn||(this.Gn=ee.createCtx()),ee.parseOBU(l.body.subarray(p),this.Gn).forEach(function(ut){ut.obu_type===we.AV1_OBU_SEQUENCE_HEADER&&!x.decConf&&ut.content&&Nt.updateAV1Track(E.Ci,x,ut.content),ce.push({type:0,data:ut.data})});else for(;Ae<O;){if(Ae+4>=O){this.Ci.v(Ct,"Malformed Nalu near timestamp "+me+", offset = "+Ae+", dataSize = "+O);break}var et=Y.getUint32(Ae);if(_e===3&&(et>>>=8),et>O-_e)return void this.Ci.v(Ct,"Malformed Nalus near timestamp "+me+", NaluSize > DataSize!");var ot=new Uint8Array(H,p+Ae+4,_e+et-4),Ke=0;if(l.codecId===7)if(this.Pn||(this.Pn={spsList:[],ppsList:[]}),(Ke=31&Y.getUint8(Ae+_e))===Pe.H264_NAL_IDR_SLICE)ke=!0;else if(Ke===Pe.PRIV_NAL_MAGIC_H264)try{Xe.push(Te.parse(ot,!0))}catch(ut){this.Ci.w(Ct,"PrivNal parse error "+ut)}else Ke===Pe.H264_NAL_SEI?qe.push.apply(qe,Ye.parse(ot.subarray(1))):Ke===Pe.H264_NAL_SPS?It.onH264SPSNalu(ot,this.Pn)&&(Me=!0):Ke===Pe.H264_NAL_PPS&&It.onH264PPSNalu(ot,this.Pn)&&(Me=!0);else if(l.codecId===12)if(this.Pn||(this.Pn={vpsList:[],spsList:[],ppsList:[]}),(Ke=(126&Y.getUint8(Ae+_e))>>1)===ae.a.HEVC_NAL_IDR_W_RADL||Ke===ae.a.HEVC_NAL_IDR_N_LP||Ke===ae.a.HEVC_NAL_CRA_NUT)ke=!0;else if(Ke===ae.a.PRIV_NAL_MAGIC_HEVC)try{Xe.push(Te.parse(ot,!1))}catch(ut){this.Ci.w(Ct,"PrivNal parse error "+ut)}else Ke===ae.a.HEVC_NAL_SEI_PREFIX||Ke===ae.a.HEVC_NAL_SEI_SUFFIX?qe.push.apply(qe,Ye.parse(ot.subarray(2))):Ke===ae.a.HEVC_NAL_VPS?It.onHEVCVPSNalu(this.Ci,ot,this.Pn)&&(Me=!0):Ke===ae.a.HEVC_NAL_SPS?It.onHEVCSPSNalu(ot,this.Pn,x.codecType)&&(Me=!0):Ke===ae.a.HEVC_NAL_PPS&&It.onHEVCPPSNalu(ot,this.Pn)&&(Me=!0);var Rt={type:Ke,data:ot};ce.push(Rt),Ae+=_e+et}if(ce.length){var wt={units:ce,dts:me,cts:Ce,pts:Ge,originDTS:l.timestamp,originPTS:l.timestamp+l.cts,key:ke,parseTime:performance?performance.now()/1e3:0,size:ce.reduce(function(ut,yt){return ut+yt.data.length},0)};qe.length&&(wt.sei={sei:qe,streamTimestamp:l.timestamp}),Xe.length&&(wt.privNal={info:Xe,streamTimestamp:l.timestamp}),this.$e(wt)}this.Le=me,Me&&this.Pn&&It.isParamSetsReady(this.Pn)&&(this.Ci.i(Ct,"dec param sets update."),x.codecType===$.c.h264?Nt.updateAVCTrack(this.Ci,x,this.Pn):ne(x.codecType)&&Nt.updateHEVCTrack(this.Ci,x,this.Pn))}},f.zn=function(l){if(l.body&&l.body.length!==0){var p=l.body[0];if(l.body.byteLength<=1)this.Ci.v(Ct,"Flv: Invalid audio packet, missing SoundData payload!");else{var E=this.Ne,x=p>>4;if(x===10)E.codecType=$.c.aac;else{if(x!==2&&x!==14)return this.Ci.w(Ct,"audio unsupported codec "+x),void(E.active=!1);E.codecType=$.c.mp3}if(E.codecType===$.c.aac){var H=l.body[1];if(H===0){if(l.body.byteLength<4)return;var O=l.body.subarray(2,4);return void this.ds(O)}if(H!==1)return void this.Ci.v(Ct,"Flv: Unsupported AAC data type "+H);if(!E.configParsed){var Y,ce,Ae=[5500,11025,22050,44100][p>>2&3];if(Ae<11025)return;var _e=1+(1&p);this.Ci.i(Ct,"missing AACPacketType 0. generate samplerate:"+Ae+" channel:"+_e+" codec:"+((Y=this._i)==null?void 0:Y.audioCodec));var me=j.b(Ae,_e,(ce=this._i)==null?void 0:ce.audioCodec);if(!me)return void this.Ci.v(Ct,"generate ASC fail.");this.ds(me)}}E.duration=this.Vn*N.h;var Ce,Me=E.codecType===$.c.aac?2:1,Ge=l.timestamp;if(E.sampleDuration&&this.Mi.active&&typeof this.Re=="number"&&this.$n($.o.AUDIO,this.Re,l.timestamp),E.codecType===$.c.aac){var ke=l.body.subarray(2);if(Ce={unit:ke,dts:Ge,pts:Ge,originDTS:Ge,originPTS:Ge,parseTime:self.performance?performance.now()/1e3:0},ke.length>2&&ke[0]===255&&ke[1]>>4==15){this.Ci.i(Ct,"adts header detected.");var qe=j.a(this.Ci,E,ke,0,Ge,0,Ge);qe&&(Ce=qe.sample)}else E.samples.push(Ce);if(this.di.enableAacPriv&&typeof E.aacSampleingIndex=="number"&&typeof E.aot=="number"){var Xe=j.h(this.Ci,Ce.unit,E.aacSampleingIndex,E.aot);Xe&&(Ce.aacPriv=[{payload:Xe.priv,streamTimestamp:l.timestamp}])}}else if(E.codecType===$.c.mp3){var et;Ce=(et=X(E,l.body,Me,Ge,0))==null?void 0:et.sample}this.Re=Ge}}},f.ds=function(l){var p,E=this.Ne;(j.g(E,l)||!E.configParsed)&&E.codec&&E.samples.length&&this.Wn(),j.d(this.Ci,E,this.Ai,l,o.a.ASC,(p=this._i)==null?void 0:p.audioCodec)},f.Zn=function(){this.Hn.length&&(this.Mi.active&&this.Mi.samples.length>1||this.ns())?(this.Ci.i(Ct,"time exception. fix on remux all.",this.Mi.samples.length,this.Ne.samples.length),this.es()):this.Ke(!0)},f.Ke=function(l){l===void 0&&(l=!1);var p=this.Ne,E=this.Mi;this.We(p,E)&&(this.Ze(p,E),this.Xe(p,E,l)&&this.qe(p,E,l,o.b.FLV))},f.Je=function(l){return l.samples.length?this.Hn.reduce(function(p,E){return p||E.type===$.o.VIDEO},!1)?l.samples.length*(l.sampleDuration||N.h/N.d)/l.inputTimescale:(l.samples[l.samples.length-1].dts-l.samples[0].dts)/l.inputTimescale:0},f.ns=function(){var l;return!(!this.di.isLive&&this.di.isLive!==void 0||!this.Ve||(l=this.Ue)!=null&&l.contiguous||!this.Mi.active||this.Mi.samples.length||!(this.Ne.samples.length>0))},I()(y,null,[{key:"probeSize",get:function(){return 188}}])}(de),ri=n(38),Mi="ivf-demuxer",Gr=function(V){function y(l,p,E,x,H){var O;return l.i(Mi,"constructor"),(O=V.call(this,l,p,E,x,H)||this).un=0,O.cn=void 0,O.ls=0,O.bs=0,O.Gn=void 0,O.cn=O.gs,O.un=8,O}W()(y,V),y.probe=function(l){return l.length>4&&l[0]===68&&l[1]===75&&l[2]===73&&l[3]===70};var f=y.prototype;return f.resetInitSegment=function(l){this.He(l.duration),V.prototype.resetInitSegment.call(this,l),this.ls=0,this.cn=this.gs,this.un=8},f.append=function(l,p,E,x,H){for(this.Ue||(this.Ue={timeOffset:p,contiguous:E,accurateTimeOffset:x}),this._t.put(l);this._t.unreadLen>=this.un;)this.cn();this.Ke(H)},f.He=function(l){V.prototype.He.call(this,l),this.Mi.active=this.Ye(),this.Ne.active=!1},f.gs=function(){if(!(this._t.unreadLen<8)){var l=this._t.get(8);if(l)if(y.probe(l)){var p=Object(q.f)(l,6,!0);this.un=p-8,this.cn=this.ys}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,"ivf start code error"))}},f.ys=function(){if(!(this._t.unreadLen<this.un)){var l=this._t.get(this.un),p=this.Mi;if(l&&p){var E=Object(q.a)(l,0,4);if(E==="AV01"){p.codecType=$.c.av1,p.codedWidth=Object(q.f)(l,4,!0),p.codedHeight=Object(q.f)(l,6,!0);var x=Object(q.h)(l,8,!0),H=Object(q.h)(l,12,!0),O=Object(q.h)(l,16,!0);p.inputTimescale=x/H,p.duration=O,this.Ci.i(Mi,"head. w: "+p.codedWidth+", h:"+p.codedHeight+", den:"+x+", num:"+H+", duration:"+p.duration),x&&H||this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,"ivf head den: "+x+", num: "+H));var Y={duration:p.duration/p.inputTimescale,keyframes:[{time:0,position:this.un}]};this.Ai.emit(oe.a.METADATA,Y),this.cn=this._s,this.un=12}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.UNSUPPORTED,"ivf "+E+" unsupported"))}}},f._s=function(){if(!(this._t.unreadLen<this.un)){var l=this._t.get(this.un);if(l){var p=Object(q.h)(l,0,!0);this.ls=Object(q.i)(l,4,!0),this.cn=this.Cs,this.un=p}}},f.Cs=function(){var l=this;if(!(this._t.unreadLen<this.un)){var p=this._t.get(this.un),E=this.Mi;if(p&&E){var x=[],H=!1;if(this.Gn||(this.Gn=ee.createCtx()),ee.parseOBU(p,this.Gn).forEach(function(Y){var ce;Y.obu_type===we.AV1_OBU_SEQUENCE_HEADER&&l.Gn&&l.Gn.sh&&(Nt.onAV1Detected(l.Ci,E,l.di,l.li,l.Ye()),Nt.updateAV1Track(l.Ci,E,l.Gn.sh)),H=H||!((ce=Y.content)==null||!ce.keyframe),x.push({type:0,data:Y.data})}),x.length){var O={units:x,dts:this.ls,cts:0,pts:this.ls,originDTS:this.ls,originPTS:this.ls,key:H,size:x.reduce(function(Y,ce){return Y+ce.data.length},0)};this.$e(O)}this.cn=this._s,this.un=12}}},f.Ke=function(l){l===void 0&&(l=!1);var p=this.Ne,E=this.Mi;if(this.We(p,E)&&this.Xe(p,E,l)){var x=Object(ri.a)(E,this.bs);this.bs+=x.length,this.Ai.emit(oe.a.VIDEO_FRAME_INFO,{videoFramesInfo:x}),this.Ve&&this.Ai.emit(oe.a.KEY_FRAME_INDEXS,{keyframes:[{time:0,position:0}]}),this.qe(p,E,l,o.b.IVF)}},I()(y,null,[{key:"probeSize",get:function(){return 8}}])}(de);function yi(V){var y=-function(f){var l=[];if(l[0]=Br(Ci(f[0]),Ci(f[3])),l[1]=Br(Ci(f[1]),Ci(f[4])),l[0]==0||l[1]==0)return NaN;var p=180*Math.atan2(Ci(f[1])/l[1],Ci(f[0])/l[0])/Math.PI;return-p}(V);return y-=360*Math.floor(y/360+.0025),(y%=360)<0&&(y+=360),y}function Ci(V){return V/65536}function Br(){for(var V=0,y=arguments.length,f=new Array(y),l=0;l<y;l++)f[l]=arguments[l];for(var p=f.length,E=0;E<p;E++){if(f[E]===1/0||f[E]===-1/0)return 1/0;V+=f[E]*f[E]}return Math.sqrt(V)}var bt=n(20),zt=function(){function V(){}return V.parseOneDescriptor=function(y){var f=0,l=y.data[y.pos],p=y.data[y.pos+1];for(y.pos+=2;128&p;)f=(127&p)<<7,p=y.data[y.pos],y.pos++;f+=127&p;var E=y.data.subarray(y.pos,y.pos+f);return l===3?V.Is(y):l===4?V.Os(y):(y.pos+=f,{tag:l,data:E})},V.getAudioConfig=function(y){if(y.tag===5)return y.data;if(y.descs&&y.descs.length)for(var f=0;f<y.descs.length;f++){var l=V.getAudioConfig(y.descs[f]);if(l)return l}},V.getObjectTypeIndication=function(y){if(y.descs&&y.descs.length){for(var f=0;f<y.descs.length;f++)if(y.descs[f].tag===4)return y.descs[f].oti}return-1},V.Is=function(y){var f=Object(q.f)(y.data,y.pos);y.pos+=2;var l=y.data[y.pos];y.pos++;var p=0;128&l&&(p=Object(q.f)(y.data,y.pos),y.pos+=2);var E="";if(64&l){var x=y.data[y.pos];E=Object(q.a)(y.data,y.pos+1,x),y.pos+=x+1}var H=0;32&l&&(H=Object(q.f)(y.data,y.pos),y.pos+=2);var O={tag:3,data:y.data,id:f,dependsOnESID:p,url:E,ocrESID:H};return y.pos<y.data.byteLength&&(O.descs=V.ws(y)),O},V.Os=function(y){var f={tag:4,data:y.data,oti:y.data[y.pos],streamType:y.data[y.pos+1],bufferSize:Object(q.g)(y.data,y.pos+2),maxBitrate:Object(q.h)(y.data,y.pos+5),avgBitrate:Object(q.h)(y.data,y.pos+9)};return y.pos+=13,y.data.byteLength>13&&(f.descs=V.ws(y)),f},V.ws=function(y){for(var f=[];y.pos<y.data.byteLength;){var l=V.parseOneDescriptor(y);f.push(l)}return f},V}(),tn=n(46),ei=function(V){return V[V.SIZE=0]="SIZE",V[V.NAME=1]="NAME",V[V.BIG_SIZE=2]="BIG_SIZE",V[V.DATA=3]="DATA",V}({}),ui=function(){function V(){}return V.readBoxes=function(y){for(var f=0,l=ei.SIZE,p={size:0,headSize:8,name:""},E=[];f<y.byteLength;)switch(l){case ei.SIZE:p.size=Object(q.h)(y,f),f+=4,l=ei.NAME;break;case ei.NAME:p.name=Object(q.a)(y,f,4),f+=4,l=p.size===1?ei.BIG_SIZE:ei.DATA;break;case ei.BIG_SIZE:p.size=Object(q.i)(y,f),p.headSize=16,f+=8,l=ei.DATA;break;case ei.DATA:p.data=y.subarray(f,f+p.size-p.headSize),f+=p.data.byteLength,l=ei.SIZE,E.push(p),p={size:0,headSize:8,name:""}}return E},V.readBox=function(y,f){f===void 0&&(f=0);for(var l=f,p=ei.SIZE,E={size:0,headSize:8,name:""};l<y.byteLength&&!E.data;)switch(p){case ei.SIZE:E.size=Object(q.h)(y,l),l+=4,p=ei.NAME;break;case ei.NAME:E.name=Object(q.a)(y,l,4),l+=4,p=E.size===1?ei.BIG_SIZE:ei.DATA;break;case ei.BIG_SIZE:E.size=Object(q.i)(y,l),E.headSize=16,l+=8,p=ei.DATA;break;case ei.DATA:if(!(y.byteLength-l>=E.size-E.headSize)){l=y.byteLength;break}E.data=y.subarray(l,l+E.size-E.headSize),l+=E.data.byteLength,p=ei.SIZE}if(E.size)return E},V.ftyp=function(y){var f=y.data;if(f)return{major_brand:Object(q.a)(f,0,4),minor_version:Object(q.h)(f,4),compatible_brands:Object(q.a)(f,8,f.byteLength-8)}},V.moov=function(y){var f={trak:[],mvex:[],pssh:[]};return y.data&&V.readBoxes(y.data).forEach(function(l){l.data&&(l.name==="mvhd"?f.mvhd=V.Es(l.data):l.name==="trak"?f.trak.push(V.ks(l.data)):l.name==="mvex"?f.mvex.push(V.Ms(l.data)):l.name==="pssh"?f.pssh.push(l):l.name==="udta"&&(f.udta||(f.udta=[]),f.udta.push(V.Ss(l.data))))}),f},V.moof=function(y){var f={};return y.data&&V.readBoxes(y.data).forEach(function(l){if(l.data&&l.name==="traf"){var p=V.Bs(l.data);f.traf?f.traf.push(p):f.traf=[p]}}),f},V.esds=function(y){if(y.data)return zt.parseOneDescriptor({data:y.data,pos:4})},V.sidx=function(y){var f=y.data;if(f){var l={referenceID:0,timescale:0,earliestPresentationTime:0,firstOffset:0,referenceCount:0,references:[]},p=f[0],E=4;l.referenceID=Object(q.e)(f,E),l.timescale=Object(q.h)(f,E+4),E+=8,p===0?(l.earliestPresentationTime=Object(q.h)(f,E),l.firstOffset=Object(q.h)(f,E+4),E+=8):(l.earliestPresentationTime=Object(q.i)(f,E),l.firstOffset=Object(q.i)(f,E+8),E+=16),l.referenceCount=Object(q.f)(f,E+2),E+=4;for(var x=0;x<l.referenceCount;x++){var H=2147483647&Object(q.h)(f,E);E+=4;var O=Object(q.h)(f,E);E+=4,l.references.push({size:H,duration:O/l.timescale}),E+=4}return l}},V.btrt=function(y){var f=y.data;if(f)return{bufferSizeDB:Object(q.h)(f,0),maxBitrate:Object(q.h)(f,4),avgBitrate:Object(q.h)(f,8)}},V.pasp=function(y){var f=y.data;if(f)return{hSpacing:Object(q.h)(f,0),vSpacing:Object(q.h)(f,4)}},V.Bs=function(y){var f={};return V.readBoxes(y).forEach(function(l){if(l.data)if(l.name==="tfhd")f.tfhd=V.Ts(l.data);else if(l.name==="tfdt")f.tfdt=V.Ds(l.data);else if(l.name==="trun"){var p=V.Rs(l.data);f.trun?f.trun.push(p):f.trun=[p]}else l.name==="saiz"?f.saiz=V.Ls(l.data):l.name==="saio"?f.saio=V.Ns(l.data):l.name==="senc"&&(f.senc=V.Qs(l.data))}),f},V.Ts=function(y){var f={trackID:Object(q.h)(y,4),baseDataOffset:0,sampleDescriptionIndex:0,defaultSampleDuration:0,defaultSampleSize:0,defaultSampleFlags:0},l=Object(q.g)(y,1),p=8;return p<=y.byteLength-8&&1&l?(f.baseDataOffset=Object(q.i)(y,p),p+=8):f.baseDataOffset=0,p<=y.byteLength-4&&2&l?(f.sampleDescriptionIndex=Object(q.h)(y,p),p+=4):f.sampleDescriptionIndex=0,p<=y.byteLength-4&&8&l?(f.defaultSampleDuration=Object(q.h)(y,p),p+=4):f.defaultSampleDuration=0,p<=y.byteLength-4&&16&l?(f.defaultSampleSize=Object(q.h)(y,p),p+=4):f.defaultSampleSize=0,p<=y.byteLength-4&&32&l?(f.defaultSampleFlags=Object(q.h)(y,p),p+=4):f.defaultSampleFlags=0,f},V.Ds=function(y){return{baseMediaDecodeTime:y[0]===1?Object(q.i)(y,4):Object(q.h)(y,4)}},V.Rs=function(y){var f=y[0],l=Object(q.g)(y,1),p={sampleCount:0,dataOffset:0,firstSampleFlags:0,sampleDuration:[],sampleSize:[],sampleFlags:[],sampleCompositionTimeOffset:[]},E=4;if(p.sampleCount=Object(q.h)(y,E),(E+=4)<=y.byteLength-4&&1&l?(p.dataOffset=Object(q.e)(y,E),E+=4):p.dataOffset=0,E<=y.byteLength-4&&4&l?(p.firstSampleFlags=Object(q.h)(y,E),E+=4):p.firstSampleFlags=0,E<=y.byteLength-4)for(var x=0;x<p.sampleCount;x++)256&l&&(p.sampleDuration[x]=Object(q.h)(y,E),E+=4),512&l&&(p.sampleSize[x]=Object(q.h)(y,E),E+=4),1024&l&&(p.sampleFlags[x]=Object(q.h)(y,E),E+=4),2048&l&&(p.sampleCompositionTimeOffset[x]=f===0?Object(q.h)(y,E):Object(q.e)(y,E),E+=4);return p},V.Ls=function(y){var f=y[0],l=Object(q.g)(y,1),p={defaultSampleInfoSize:0,sampleCount:0,sampleInfoSize:[]};if(f===0){var E=4;if(1&l&&(E+=8),p.defaultSampleInfoSize=y[E],p.sampleCount=Object(q.h)(y,E+1),E+=5,p.defaultSampleInfoSize===0)for(var x=0;x<p.sampleCount;x++)p.sampleInfoSize[x]=y[E],E++}return p},V.Ns=function(y){var f=y[0],l={entryCount:0,offset:[]},p=4;1&Object(q.g)(y,1)&&(p+=8),l.entryCount=Object(q.h)(y,p),p+=4;for(var E=0;E<l.entryCount;E++)f===0?(l.offset[E]=Object(q.h)(y,p),p+=4):(l.offset[E]=Object(q.i)(y,p),p+=8);return l},V.Qs=function(y,f){f===void 0&&(f=0);var l={sampleCount:0,useSubSampleEnc:!!(2&Object(q.g)(y,1)),encItemData:[]},p=4;return l.sampleCount=Object(q.h)(y,p),p+=4,f&&(l.iv=y.subarray(p,8*f),p+=f),l.encData=y.subarray(p),l},V.Es=function(y){var f=y[0],l=0,p=0;return f===1?(l=Object(q.h)(y,20),p=Object(q.i)(y,24)):f===0&&(l=Object(q.h)(y,12),p=Object(q.h)(y,16)),{timescale:l,duration:p}},V.Ms=function(y){var f={};return V.readBoxes(y).forEach(function(l){l.data&&(l.name==="mehd"?f.mehd=V.xs(l.data):l.name==="trex"&&(f.trex=V.Vs(l.data)))}),f},V.xs=function(y){return{fragmentDuration:y[0]===1?Object(q.i)(y,4):Object(q.h)(y,4)}},V.Vs=function(y){return{trackID:Object(q.h)(y,4),sampleDescriptionIndex:Object(q.h)(y,8),defaultSampleDuration:Object(q.h)(y,12),defaultSampleSize:Object(q.h)(y,16),defaultSampleFlags:Object(q.h)(y,20)}},V.ks=function(y){var f={};return V.readBoxes(y).forEach(function(l){l.data&&(l.name==="tkhd"?f.tkhd=V.Us(l.data):l.name==="tref"?f.tref=V.Fs(l.data):l.name==="mdia"?f.mdia=V.Ps(l.data):l.name==="edts"&&(f.edts=V.Hs(l.data)))}),f},V.Us=function(y){var f=0,l=0,p=4;y[0]===1?(f=Object(q.h)(y,p+16),l=Object(q.i)(y,p+24),p+=32):(f=Object(q.h)(y,p+8),l=Object(q.h)(y,p+16),p+=20),p+=16;for(var E=[],x=0;x<9;x++)E.push(Object(q.e)(y,p)),p+=4;return{width:Object(q.h)(y,p)>>16,height:Object(q.h)(y,p+4)>>16,trackId:f,duration:l,matrix:E}},V.Hs=function(y){var f={};return V.readBoxes(y).forEach(function(l){l.name==="elst"&&l.data&&(f.elst=V.Ys(l.data))}),f},V.Ys=function(y){var f={entries:[],entry_count:0},l=y[0];f.entry_count=Object(q.h)(y,4);for(var p=8,E=0;E<f.entry_count;E++){var x={segment_duration:0,media_time:0,media_rate_integer:0,media_rate_fraction:0};f.entries.push(x),l===1?(x.segment_duration=Object(q.i)(y,p),x.media_time=Object(q.i)(y,p+8),p+=16):(x.segment_duration=Object(q.h)(y,p),x.media_time=Object(q.e)(y,p+4),p+=8),x.media_rate_integer=Object(q.c)(y,p),x.media_rate_fraction=Object(q.c)(y,p+2),p+=4}return f},V.Fs=function(y){return{referenceType:Object(q.a)(y,4,4),trackId:Object(q.h)(y,8)}},V.Ps=function(y){var f={};return V.readBoxes(y).forEach(function(l){l.data&&(l.name==="minf"?f.minf=V.Gs(l.data):l.name==="hdlr"?f.hdlr=V.Ks(l.data):l.name==="mdhd"&&(f.mdhd=V.Zs(l.data)))}),f},V.Ks=function(y){var f={};return y[0]===0&&(f.type=Object(q.a)(y,8,4)),f},V.Gs=function(y){var f={};return V.readBoxes(y).forEach(function(l){l.data&&(l.name==="dinf"?V.Ws(l.data):l.name==="stbl"&&(f.stbl=V.Xs(l.data)))}),f},V.Ws=function(y){V.readBoxes(y).forEach(function(f){f.data&&f.name==="dref"&&V.zs(f.data)})},V.zs=function(y){for(var f=Object(q.h)(y,4),l=0;l<f&&8<y.byteLength;l++);},V.Xs=function(y){var f={};return V.readBoxes(y).forEach(function(l){l.data&&(l.name==="stsd"?f.stsd=V.Js(l.data):l.name==="stts"?f.stts=V.$s(l.data):l.name==="stsc"?f.stsc=V.tr(l.data):l.name==="stco"?f.stco=V.ir(l.data):l.name==="co64"?f.stco=V.er(l.data):l.name==="stsz"?f.stsz=V.nr(l.data):l.name==="stz2"?f.stsz=V.sr(l.data):l.name==="stss"?f.stss=V.rr(l.data):l.name==="ctts"?f.ctts=V.hr(l.data):l.name==="sgpd"?f.sgpd=V.ar(l.data):l.name==="stdp"?f.stdp=V.ur(l.data):l.name==="sdtp"?f.sdtp=V.cr(l.data):l.name==="sbgp"?f.sbgp=V.Ar(l.data):l.name==="subs"?f.subs=V.vr(l.data):l.name==="saiz"?f.saiz=V.Ls(l.data):l.name==="saio"?f.saio=V.Ns(l.data):l.name==="senc"&&(f.senc=V.Qs(l.data)))}),f},V.vr=function(y){var f=y[0],l={entries:[]},p=4,E=Object(q.h)(y,p);p+=4;for(var x=0;x<E;x++){var H={sampleDelta:Object(q.h)(y,p),subSamples:[]};l.entries.push(H);var O=Object(q.f)(y,p+4);p+=6;for(var Y=0;Y<O;Y++){var ce={priority:y[p+=f===1?4:2],discardable:y[p+1],codecSpecificParameters:Object(q.h)(y,p+2)};H.subSamples.push(ce),p+=6}}return l},V.Ar=function(y){var f=y[0],l=4,p={groupingType:Object(q.a)(y,l,4),entries:[]};l+=4,f===1&&(l+=4);var E=Object(q.h)(y,l);l+=4;for(var x=0;x<E;x++)p.entries.push({sampleCount:Object(q.e)(y,l),groupDescriptionIndex:Object(q.e)(y,l+4)}),l+=8;return p},V.cr=function(y){for(var f={entries:[]},l=4;l<y.byteLength;)f.entries.push({sampleDependsOn:y[l]>>4&3,sampleIsDependedOn:y[l]>>2&3,sampleHasRedundancy:3&y[l]}),l++;return f},V.ur=function(y){for(var f={priority:[]},l=4;l<y.length;)f.priority.push(Object(q.f)(y,l)),l+=2;return f},V.ar=function(y){var f=y[0],l={type:Object(q.a)(y,4,4),entries:[]},p=0,E=8;f===1&&(p=Object(q.h)(y,E),E+=4),f===2&&(E+=4);var x=Object(q.h)(y,E);E+=4;for(var H=0;H<x;H++){var O=0;f===1&&p===0?(O=Object(q.h)(y,E),E+=4):O=p;var Y={descriptionLength:O,data:y.subarray(E,E+O)};E+=O,l.entries.push(Y)}return l},V.Js=function(y){return{sampleEntrys:V.readBoxes(y.subarray(8,y.byteLength)),boxData:y}},V.$s=function(y){for(var f=Object(q.h)(y,4),l=8,p=[],E=0;E<f;E++)p.push({sampleCount:Object(q.h)(y,l),sampleDelta:Object(q.h)(y,l+4)}),l+=8;return{timeToSample:p}},V.tr=function(y){for(var f=Object(q.h)(y,4),l=8,p=[],E=0;E<f;E++)p.push({firstChunk:Object(q.h)(y,l),samplesPerChunk:Object(q.h)(y,l+4),sampleDescriptionIndex:Object(q.h)(y,l+8)}),l+=12;return{sampleToChunkBox:p}},V.ir=function(y){for(var f=Object(q.h)(y,4),l=8,p=[],E=0;E<f;E++)p.push(Object(q.h)(y,l)),l+=4;return{chunkOffset:p}},V.er=function(y){for(var f=Object(q.h)(y,4),l=8,p=[],E=0;E<f;E++)p.push(Object(q.i)(y,l)),l+=8;return{chunkOffset:p}},V.nr=function(y){var f=Object(q.h)(y,4),l=Object(q.h)(y,8),p=12;if(f===0){f=[];for(var E=0;E<l;E++)f.push(Object(q.h)(y,p)),p+=4}return{sampleCount:l,SampleSize:f}},V.sr=function(y){for(var f=y[7],l=[],p=Object(q.h)(y,8),E=12,x=0;x<p;x++)f===4?(l.push(y[E]>>4),++x<p&&l.push(15&y[E]),E+=1):f===8?(l.push(y[E]),E+=1):f===16&&(l.push(Object(q.f)(y,E)),E+=2);return{sampleCount:p,SampleSize:l}},V.rr=function(y){for(var f=Object(q.h)(y,4),l=8,p=[],E=0;E<f;E++)p.push(Object(q.h)(y,l)),l+=4;return{sampleNumber:p}},V.hr=function(y){for(var f=Object(q.h)(y,4),l=8,p=[],E=0;E<f;E++)p.push({sampleCount:Object(q.h)(y,l),sampleOffset:Object(q.e)(y,l+4)}),l+=8;return{compositionOffset:p}},V.Zs=function(y){var f=0,l=0;return y[0]===1?(f=Object(q.h)(y,20),l=Object(q.i)(y,24)):(f=Object(q.h)(y,12),l=Object(q.h)(y,16)),{timescale:f,duration:l}},V.Ss=function(y){var f=V.readBoxes(y),l={meta:{}};return f.forEach(function(p){p.data&&p.name==="meta"&&L()(l.meta,V.dr(p.data))}),l},V.dr=function(y){var f=Object(q.h)(y,4),l={};return(f===1751411826?V.readBoxes(y.subarray(0,y.byteLength)):V.readBoxes(y.subarray(4,y.byteLength))).forEach(function(p){p.data&&(p.name==="hdlr"?V.Ks(p.data):p.name==="ilst"&&L()(l,V.lr(p.data)))}),l},V.lr=function(y){for(var f={},l=0,p=function(){var E=Object(q.h)(y,l);l+=4;var x=Object(q.a)(y,l,4);l+=4,V.readBoxes(y.subarray(l,l+E-8)).forEach(function(H){var O=H.data;f[x]=O?Object(q.a)(O,8,O.length-8):""}),l+=E-8};l<y.length;)p();return f},V}(),zr=[64,102,103,104,105,107],fr=[64,102,103,104],ti={avc1:$.c.h264,avcC:$.c.h264,hev1:$.c.hevc,hvc1:$.c.hevc,hvcC:$.c.hevc,kvc3:$.c.kvc3,kvc4:$.c.kvc4,kvc5:$.c.kvc5,kvc6:$.c.kvc6,kvc7:$.c.kvc30,kvLC:$.c.kvc30,av01:$.c.av1,av1C:$.c.av1,bvc2:$.c.bvc2,bv2C:$.c.bvc2,vvc1:$.c.vvc,vvcC:$.c.vvc},Fn="notReady",mt="mp4-demuxer",Ti=function(V){function y(l,p,E,x,H){var O;return(O=V.call(this,l,p,E,x,H)||this).Vn=1/0,O.Un=4,O.br=void 0,O.pr=void 0,O.mr=0,O.gr=0,O.It=0,O.yr=void 0,O._r=void 0,O.Cr=void 0,O.Ir=void 0,O.Or=!1,O.wr=8,O.Er=0,O.jr=!0,O.kr=!1,O.Mr=0,O.Pn=void 0,O.Sr=!1,O.ki=void 0,O.Gn=void 0,l.i(mt,"constructor"),O}W()(y,V),y.probe=function(l){var p=Object(q.a)(l,4,4);return!(p!=="styp"&&p!=="ftyp")};var f=y.prototype;return f.append=function(l,p,E,x,H,O){if(H===void 0&&(H=!1),this.jr){this.Fe=O,this._t.put(l),this.Ue||(this.Ue={timeOffset:p,contiguous:E,accurateTimeOffset:x}),this.Or&&this.Br()&&this.Tr();do{if(this.Dr(),!this.pr||!this.jr)return;for(E||(this.Or||this.Rr(p),E=!0);this._t.unreadLen&&this.Lr();){if(!this.Cr){var Y=this.Nr();if(Y===Fn)return void this.Ci.i(mt,"sample not ready");this.Cr=Y}if(!this.Cr)return void(!this.Or&&this.It<this.Mr&&this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,"can not find next sample")));if(this.It){var ce=this.Cr.start-this.It;if(this._t.unreadLen<ce)return;this._t.skip(this.Cr.start-this.It)}if(this.It=this.Cr.start,!(this.Cr&&this.Cr.end-this.Cr.start<=this._t.unreadLen))break;var Ae=this._t.get(this.Cr.end-this.Cr.start);if(!Ae)return;this.It+=Ae.byteLength,this.Cr.type===$.o.VIDEO?(this.Mi.active&&this.Qr(this.Cr,Ae),this.mr++):(this.Ne.active&&this.Vr(this.Cr,Ae),this.gr++),this.Cr=void 0}this.Br()&&this.Tr()}while(this.Or&&this.Ur());this.kr&&!H||(this.Ke(H&&!this.Lr()),H&&this.Ai.emit(oe.a.PARSED_DATA,{extra:this._i}))}},f.Dr=function(){for(;this.Ur();){if(!this.Ir){var l=this._t.get(8);if(!l)return;var p=Object(q.h)(l);this.Ir={size:p,name:Object(q.a)(l,4,4),headSize:p>1?8:16},this.It+=8}if(this.Ir.size===1){if(!(this._t.unreadLen>=8))return void(this.wr=8);var E=this._t.get(8);if(!E)return;var x=Object(q.i)(E);this.Ir.size=x,this.It+=8}var H=this.Ir.size-this.Ir.headSize;if(this.Ir.name==="mdat"){if(this.Mr=this.It,!this.pr)return this.Ir=void 0,this.jr=!1,void this.Ai.emit(oe.a.MP4_NOT_FASTSTART,{pos:this.It+H});if(this.Or){this.Fr(this.It),this.wr=0,this.Er=this.It+H;break}if(!this.Or){this.Ir=void 0,this.wr=0;break}}if(this._t.unreadLen>=H){var O=this._t.get(H);if(this.Ir.data=O,this.It+=H,this.wr=8,this.Ir.name==="moov"){if(this.Pr(this.Ir),this.yr&&this.yr.samples.length||this._r&&this._r.samples.length){this.wr=0,this.Ir=void 0;break}this.Ir=void 0}else this.Ir.name==="moof"?(this.kr&&this.Ke(),this.Or=!0,this.Hr(this.Ir,this.It),this.Ir=void 0):this.Ir.name==="sidx"?(this.Yr(this.Ir,this.It),this.Ir=void 0):this.Ir.name==="ftyp"?(this.br=ui.ftyp(this.Ir),this.Ir=void 0):this.Ir=void 0}else this.wr=H}},f.Fr=function(l){var p,E,x=this.gr,H=this.mr,O=(p=this._r)==null?void 0:p.samples,Y=(E=this.yr)==null?void 0:E.samples,ce=O&&O[x],Ae=Y&&Y[H];if(ce&&Ae)for(var _e=l,me=O[x],Ce=Y[H];me||Ce;){var Me=me?me.noOffset?me.start+_e:me.start:Number.MAX_SAFE_INTEGER,Ge=Ce?Ce.noOffset?Ce.start+_e:Ce.start:Number.MAX_SAFE_INTEGER,ke=void 0;if(Me===Ge?me&&me.noOffset?(ke=Ce,H++):(ke=me,x++):Me<Ge?(ke=me,x++):(ke=Ce,H++),ke){if(ke.noOffset){ke.noOffset=void 0;var qe=ke.end-ke.start;ke.start=Math.min(Me,Ge),ke.end=ke.start+qe}_e=ke.end}me=O[x],Ce=Y[H]}else if(ce||Ae){var Xe=ce?O:Y;if(!Xe)return;for(var et=Xe.length-1;et>=0;et--){var ot=Xe[et];if(ot&&ot.noOffset){ot.noOffset=void 0,ot.start+=l,ot.end+=l;break}}}},f.Ur=function(){return!!(this.wr&&this._t.unreadLen>=this.wr)},f.Br=function(){return!!(this.Or&&this.Er&&!this.Lr()&&this.Er<=this.It+this._t.unreadLen)},f.Tr=function(){this.Br()&&(this._t.skip(this.Er-this.It),this.It=this.Er,this.Ir=void 0,this.wr=8,this.Er=0)},f.resetInitSegment=function(l,p){V.prototype.resetInitSegment.call(this,l),this.jr=!0,p&&this._t.put(p),this.mr=0,this.gr=0,this.It=0,this.Cr=void 0,this.Qe&&this.Qe.reset(),this.Or&&(this.yr&&(this.yr.samples=[],this.yr.endPTS=0),this._r&&(this._r.samples=[],this._r.endPTS=0),this.wr=8,this.Ir=void 0),this.Ci.i(mt,"reset init")},f.Qr=function(l,p){var E=this,x=0,H=[],O=!1,Y=this.Mi,ce=[],Ae=[],_e=!1;if(Y.codecType===$.c.av1)this.Gn||(this.Gn=ee.createCtx()),ee.parseOBU(p,this.Gn).forEach(function(qe){var Xe;qe.obu_type===we.AV1_OBU_SEQUENCE_HEADER&&qe.content&&Nt.updateAV1Track(E.Ci,Y,qe.content),O=O||qe.obu_type!==we.AV1_OBU_SEQUENCE_HEADER&&!((Xe=qe.content)==null||!Xe.keyframe),H.push({type:0,data:qe.data})});else for(;x<p.byteLength;){var me=Object(q.h)(p,x);if(x+=4,me>l.size){this.Ci.i(mt,"nalu size error. "+me+" > "+l.size);break}var Ce=p.subarray(x,x+me);this.Un===3&&(me>>>=8);var Me=0,Ge=void 0;if(Y.codecType===$.c.h264){if((Me=31&Ce[0])===Pe.H264_NAL_IDR_SLICE)O=O||!0;else if(Me===Pe.H264_NAL_SEI)ce.push.apply(ce,Ye.parse(Ce.subarray(1)));else if(Me===Pe.PRIV_NAL_MAGIC_H264)try{Ae.push(Te.parse(Ce,!0))}catch(qe){this.Ci.w(mt,"PrivNal parse error "+qe)}this.Pn||(this.Pn={spsList:[],ppsList:[]}),Me===Pe.H264_NAL_SPS?It.onH264SPSNalu(Ce,this.Pn)&&(_e=!0):Me===Pe.H264_NAL_PPS&&It.onH264PPSNalu(Ce,this.Pn)&&(_e=!0)}else if(ne(Y.codecType)){if((Me=(126&Ce[0])>>1)===ae.a.HEVC_NAL_IDR_W_RADL||Me===ae.a.HEVC_NAL_IDR_N_LP||Me===ae.a.HEVC_NAL_CRA_NUT)O=O||!0;else if(Me===ae.a.HEVC_NAL_SEI_PREFIX||Me===ae.a.HEVC_NAL_SEI_SUFFIX)ce.push.apply(ce,Ye.parse(Ce.subarray(2)));else if(Me===ae.a.PRIV_NAL_MAGIC_HEVC)try{Ae.push(Te.parse(Ce,!1))}catch(qe){this.Ci.w(mt,"PrivNal parse error "+qe)}this.Pn||(this.Pn={vpsList:[],spsList:[],ppsList:[]}),Me===ae.a.HEVC_NAL_VPS?It.onHEVCVPSNalu(this.Ci,Ce,this.Pn)&&(_e=!0):Me===ae.a.HEVC_NAL_SPS?It.onHEVCSPSNalu(Ce,this.Pn,Y.codecType)&&(_e=!0):Me===ae.a.HEVC_NAL_PPS&&It.onHEVCPPSNalu(Ce,this.Pn)&&(_e=!0)}else Le(Y.codecType)&&(Me=(248&Ce[1])>>3,Ge=(7&Ce[1])-1,Me!==nt.a.VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL&&Me!==nt.a.VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP||(O=O||!0),this.Pn||(this.Pn={vpsList:[],spsList:[],ppsList:[]}),Me===nt.a.VVC_NAL_UNIT_VPS?It.onVVCVPSNalu(Ce,this.Pn)&&(_e=!0):Me===nt.a.VVC_NAL_UNIT_SPS?It.onVVCSPSNalu(Ce,this.Pn)&&(_e=!0):Me===ae.a.HEVC_NAL_PPS&&It.onVVCPPSNalu(Ce,this.Pn)&&(_e=!0));H.push({type:Me,data:Ce,temporalId:Ge}),x+=me}if(_e&&this.Pn&&It.isParamSetsReady(this.Pn)&&(this.Ci.i(mt,"dec param sets update."),this.Gr(Y,this.Pn,_e)),H.length){var ke={units:H,dts:l.dts,cts:l.cts,pts:l.pts,originDTS:l.dts,originPTS:l.pts,key:O,duration:l.duration,size:H.reduce(function(qe,Xe){return qe+Xe.data.length},0)};ce.length&&(ke.sei={sei:ce,streamTimestamp:Object(bt.d)(l.pts,Y.inputTimescale)}),Ae.length&&(ke.privNal={info:Ae,streamTimestamp:Object(bt.d)(l.pts,Y.inputTimescale)}),l.auxiliaryInfo&&(ke.auxiliaryInfo=l.auxiliaryInfo),this.$e(ke)}},f.Vr=function(l,p){var E,x=this.Ne;if(x.codecType!==$.c.aac||!(p.length<=2||x.asc&&x.asc===Object(q.f)(p)))if(x.codecType===$.c.mp3){var H;E=(H=X(x,p,0,l.dts,0))==null?void 0:H.sample}else{if(E={unit:p,dts:l.dts,pts:l.dts,duration:l.duration||l.duration||x.sampleDuration,originDTS:l.dts,originPTS:l.dts},l.auxiliaryInfo&&(E.auxiliaryInfo=l.auxiliaryInfo),p.length>2&&p[0]===255&&p[1]>>4==15){this.Ci.i(mt,"adts header detected.");var O=j.a(this.Ci,x,p,0,l.dts,0,l.dts);O&&(E=O.sample)}else x.samples.push(E);if(this.di.enableAacPriv&&typeof x.aacSampleingIndex=="number"&&typeof x.aot=="number"){var Y=j.h(this.Ci,p,x.aacSampleingIndex,x.aot);Y&&(E.aacPriv=[{payload:Y.priv,streamTimestamp:Object(bt.d)(l.pts,x.inputTimescale)}])}}},f.Lr=function(){return!!(this._r&&this.gr<this._r.samples.length||this.yr&&this.mr<this.yr.samples.length)},f.Nr=function(){var l=this._r?this._r.samples[this.gr]:void 0,p=this.yr?this.yr.samples[this.mr]:void 0,E=l?l.start-this.It:-1,x=p?p.start-this.It:-1;return x>=0&&(x<E||x>E&&E<0)?p:E>=0&&(E<x||E>x&&x<0)?l:this.Or&&(E<x&&l!=null&&l.noOffset||E>x&&p!=null&&p.noOffset)?Fn:void 0},f.Ke=function(l){l===void 0&&(l=!1);var p=this.Ne,E=this.Mi;this.We(p,E)&&(this.Ze(p,E),l&&le.a.alignEndByRemuxer(this.Ci,p,E,this.De),this.Xe(p,E,l)&&this.qe(p,E,l,this.Or?o.b.FMP4:o.b.MP4,this.ki))},f.Kr=function(l){if(this.pr)for(var p=0;p<this.pr.mvex.length;p++){var E;if(((E=this.pr.mvex[p].trex)==null?void 0:E.trackID)===l)return this.pr.mvex[p].trex}},f.Zr=function(l){if(this.pr)for(var p=0;p<this.pr.trak.length;p++){var E;if(((E=this.pr.trak[p].tkhd)==null?void 0:E.trackId)===l)return this.pr.trak[p]}},f.Hr=function(l,p){var E,x=this,H=ui.moof(l);H.traf&&H.traf.length>1&&(this.kr=!0),(E=H.traf)==null||E.forEach(function(O){var Y=O.tfdt,ce=O.tfhd,Ae=O.trun;if(ce&&Ae){var _e,me=x.Kr(ce.trackID),Ce=(Y==null?void 0:Y.baseMediaDecodeTime)||0,Me=0,Ge=ce.defaultSampleSize||(me==null?void 0:me.defaultSampleSize)||0,ke=Ge,qe=ce.defaultSampleDuration||(me==null?void 0:me.defaultSampleDuration)||0,Xe=ce.trackID||0;Xe===x.Mi.id&&(_e=x.Mi),Xe===x.Ne.id&&(_e=x.Ne);var et=x.Zr(Xe);if(et&&_e){var ot,Ke;if((ot=et.mdia)!=null&&(ot=ot.mdhd)!=null&&ot.timescale&&(_e.inputTimescale=et.mdia.mdhd.timescale),_e.sampleDescIndex=ce.sampleDescriptionIndex,_e.type===$.o.VIDEO&&x.yr?Ke=x.yr:_e.type===$.o.AUDIO&&x._r&&(Ke=x._r),!Ke)return;var Rt=Ke.samples.length;_e.type==="video"&&typeof x.Le=="number"&&x.Le>Ce?Ce=x.Le:_e.type==="audio"&&typeof x.Re=="number"&&x.Re>Ce&&(Ce=x.Re);var wt=0;Ae.forEach(function(ut){if(_e&&Ke){var yt=!ut.dataOffset,pt=0;yt||(pt=ce.baseDataOffset?ce.baseDataOffset+ut.dataOffset:ut.dataOffset+p-l.size);for(var St=0;St<(ut.sampleCount||0);St++){qe=ut.sampleDuration[St]||ce.defaultSampleDuration||(me==null?void 0:me.defaultSampleDuration)||qe||0,Me=ut.sampleCompositionTimeOffset[St]||0,ke=ut.sampleSize[St]||Ge,qe||_e.type!==$.o.AUDIO||(qe=j.c(_e.samplerate,_e.inputTimescale));var Qt={type:_e.type,index:Rt,gopID:0,dts:Ce,cts:Me,pts:Ce+Me,duration:qe,start:pt,end:pt+ke,size:ke,noOffset:yt};if(O.senc){if(_e.useSubSampleEnc=O.senc.useSubSampleEnc,O.senc.encItemData[St])Qt.auxiliaryInfo={enc:O.senc.encItemData[St]};else if(O.saiz&&O.senc.encData){var $t=O.saiz.sampleInfoSize[St]||O.saiz.defaultSampleInfoSize;Qt.auxiliaryInfo={enc:O.senc.encData.subarray(wt,wt+$t)},wt+=$t}}pt+=ke,Ce+=qe,Rt++,Ke.samples.push(Qt),Ke.endPTS=Ce+Me}}}),_e.type==="video"?x.Le=Ce:_e.type==="audio"&&(x.Re=Ce)}}})},f.Yr=function(l,p){var E=ui.sidx(l),x=this.yr;if(E&&x&&E.referenceID===this.Mi.id){x.keyframes=[];var H=E.earliestPresentationTime/E.timescale,O=p;E.references.forEach(function(Y){x.keyframes.push({time:H,position:O}),H+=Y.duration,O+=Y.size}),this.Ai.emit(oe.a.KEY_FRAME_INDEXS,{keyframes:x.keyframes,append:!0})}},f.Pr=function(l){var p,E,x=this;this.Ci.i(mt,"parse moov size: "+l.size);var H=this.pr=ui.moov(l),O={mp4MoovSize:l.size};if(H.udta&&H.udta.forEach(function(Ke){L()(O,Ke.meta)}),this.br&&L()(O,this.br),H.mvhd){var Y=H.mvhd.timescale;this.Vn=H.mvhd.duration/Y,this.Vn||H.mvex.forEach(function(Ke){Ke.mehd&&(O.duration=x.Vn=Ke.mehd.fragmentDuration/Y)}),O.duration=this.Vn}if(this.ki=[],H.pssh.forEach(function(Ke){Ke.data&&x.ki&&x.ki.push(Ke.data)}),H.trak.forEach(function(Ke){var Rt,wt,ut,yt;if(Ke.mdia&&Ke.mdia.minf&&Ke.mdia.minf.stbl&&Ke.mdia.hdlr&&Ke.mdia.mdhd&&Ke.tkhd){if(Ke.mdia.hdlr.type==="vide")x.Mi.active===void 0&&(x.Mi.active=!0),x.yr=x.Wr(x.Mi,Ke.mdia.minf.stbl,Ke.mdia.mdhd,H.mvhd,(Rt=Ke.edts)==null?void 0:Rt.elst),x.Mi.rotation=yi(Ke.tkhd.matrix),x.Mi.id=Ke.tkhd.trackId,(wt=x.ki)!=null&&wt.length&&(x.Mi.stsd=(ut=Ke.mdia.minf.stbl.stsd)==null?void 0:ut.boxData),x.Mi.bitrate||(x.Mi.bitrate=8*(((yt=x.yr)==null?void 0:yt.size)||0)/1e3/(Ke.mdia.mdhd.duration/Ke.mdia.mdhd.timescale));else if(Ke.mdia.hdlr.type==="soun"){var pt,St,Qt,$t;x.Ne.active===void 0&&(x.Ne.active=!0),x.Ne.id=Ke.tkhd.trackId,x._r=x.Wr(x.Ne,Ke.mdia.minf.stbl,Ke.mdia.mdhd,H.mvhd,(pt=Ke.edts)==null?void 0:pt.elst),(St=x.ki)!=null&&St.length&&(x.Ne.stsd=(Qt=Ke.mdia.minf.stbl.stsd)==null?void 0:Qt.boxData),!x.Ne.bitrate&&(x.Ne.bitrate=8*((($t=x._r)==null?void 0:$t.size)||0)/1e3/(Ke.mdia.mdhd.duration/Ke.mdia.mdhd.timescale))}}}),this.yr&&this.yr.description.length&&this.Xr(this.yr.description),this._r&&this._r.description.length&&this.zr(this._r.description),this.yr){var ce,Ae,_e,me;this.yr.keyframes&&(O.keyframes=this.yr.keyframes,this._r&&this._r.samples.length&&this.yr.keyframes.length&&this._r.samples[0].start<this.yr.keyframes[0].position&&(O.keyframes[0]=L()({},O.keyframes[0]),O.keyframes[0].position=this._r.samples[0].start));var Ce=[],Me=this.Mi.inputTimescale,Ge=this.De.computeInitPTSDTS(0,(ce=this._r)!=null&&ce.samples?(Ae=this._r)==null?void 0:Ae.samples[0]:void 0,(_e=this.yr)!=null&&_e.samples?(me=this.yr)==null?void 0:me.samples[0]:void 0,this.Ne.inputTimescale,this.Mi.inputTimescale),ke=Ge.initDTS,qe=Ge.initPTS;this.yr.samples.forEach(function(Ke){Ce.push({index:0,dts:Ke.dts/Me-ke,pts:Ke.pts/Me-qe,duration:Ke.duration/Me})}),Ce.sort(function(Ke,Rt){return Ke.pts-Rt.pts}),Ce.forEach(function(Ke,Rt){Ke.index=Rt}),O.videoFramesInfo=Ce}else if(this._r&&this._r.samples.length){var Xe=0,et=this.Ne.inputTimescale,ot=[{time:0,position:this._r.samples[0].start}];this._r.samples.forEach(function(Ke){Ke.dts-Xe>10*et&&(ot.push({time:Ke.dts/et,position:Ke.start}),Xe=Ke.dts)}),O.keyframes=ot}O.duration=Math.max(((p=this.yr)==null?void 0:p.duration)||0,((E=this._r)==null?void 0:E.duration)||0,this.Vn),this.Sr&&(O.mp4MoovNoPs=!0),this.Ci.i(mt,"Parsed onMetaData"),this.Ai.emit(oe.a.METADATA,O)},f.Rr=function(l){var p,E;if(this.Ci.i(mt,"seek:"+l),l===0||this.Or)return this.mr=0,void(this.gr=0);var x=(p=this.yr)==null?void 0:p.samples,H=(E=this._r)==null?void 0:E.samples;if(x&&this.yr){var O=tn.a.getPosByTime(this.yr.keyframes,l);O&&(this.mr=this.Jr(x,O.position))}if(H)if(this.yr){if(x){var Y=x[this.mr];Y&&(this.gr=this.Jr(H,Y.end),this.Ci.i(mt,"seek audio by video pos: "+l+" a: "+this.gr+" v: "+this.mr))}}else this.gr=this.qr(H,l*this.Mi.inputTimescale),this.Ci.i(mt,"seek audio by time: "+l+" a: "+this.gr+" v: "+this.mr)},f.Jr=function(l,p){if(l[0]&&p<l[0].start)return 0;if(l[l.length-1]&&p>=l[l.length-1].end)return l.length-1;for(var E,x=0,H=l.length-1,O=0,Y=0;x<=H;){if(p>=((E=(Y=(O=(x+H)/2|0)-1)>=0?l[Y]:void 0)?E.end:l[O].start)&&p<l[O].end)return O;if(p===l[O].end)return O+1;p>l[O].end?x=O+1:H=O-1}return 0},f.qr=function(l,p){if(l[0]&&p<l[0].dts)return 0;if(l[l.length-1]&&p>=l[l.length-1].dts)return l.length-1;for(var E=0,x=l.length-1,H=0,O=0,Y=0;E<=x;)if(p>(Y=l[O=(H=(E+x)/2|0)+1]?l[O].dts:Number.MAX_SAFE_INTEGER))E=O;else{if(!(p<l[H].dts))return p===Y?O:H;x=H-1}return 0},f.Xr=function(l){var p=this;this.Ci.i(mt,"parse video desc: "+l[0].name);var E=!1;l.forEach(function(x){x.name!=="avc1"&&x.name!=="hev1"&&x.name!=="hvc1"&&x.name!=="kvc3"&&x.name!=="kvc4"&&x.name!=="kvc5"&&x.name!=="kvc6"&&x.name!=="av01"&&x.name!=="encv"&&x.name!=="bvc2"&&x.name!=="kvc7"&&x.name!=="vvc1"||(p.$r(x),E=!0)}),E||(this.Ci.i(mt,"video codec unsupported"),this.Mi.active=!1)},f.zr=function(l){var p=this;this.Ci.i(mt,"parse audio desc: "+l[0].name);var E=!1;l.forEach(function(x){(x.name==="mp4a"||x.name==="enca"||x.name==="Opus"&&p.li.opus)&&(p.th(x),E=!0)}),E||(this.Ci.i(mt,"audio codec unsupported"),this.Ne.active=!1)},f.th=function(l){var p=this;if(l.data&&l.data){var E=8,x=Object(q.f)(l.data,E);E+=x>=2?56:x===1?36:20,ui.readBoxes(l.data.subarray(E,l.data.byteLength)).forEach(function(H){if(H.name==="esds")p.ih(H);else if(H.name==="wave"&&H.data)ui.readBoxes(H.data).forEach(function(Y){Y.name==="esds"&&p.ih(Y)});else if(H.name==="btrt"){var O=ui.btrt(H);O&&(p.Ne.maxBitrate=O.maxBitrate/1e3,p.Ne.bitrate=O.avgBitrate/1e3)}else H.name==="dOps"&&H.data&&(p.Ne.codecType=$.c.opus,p.Ne.codec="opus",p.Ne.channelCount=H.data[1],p.Ne.samplerate=Object(q.h)(H.data,4))})}},f.ih=function(l){if(l.name==="esds"){var p=this.Ne,E=ui.esds(l);if(E){var x=zt.getObjectTypeIndication(E);if(zr.indexOf(x)===-1)return void(p.active=!1);if(fr.indexOf(x)!==-1){var H=zt.getAudioConfig(E);H&&j.d(this.Ci,p,this.Ai,H,o.a.ASC),p.codecType=$.c.aac}else p.codecType=$.c.mp3}}},f.$r=function(l){var p=this;if(l.data){var E=this.Mi,x=ui.readBoxes(l.data.subarray(78,l.data.byteLength)),H=this.Ye();x.forEach(function(O){var Y;if(O.name==="avcC")E.codecType=ti[O.name],Nt.onAVCDetected(p.Ci,E,p.di,p.li,H),p.eh(E,O),p.nh(E),p.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:$.d.buildin,codecType:$.c.h264,timeOffset:((Y=p.Ue)==null?void 0:Y.timeOffset)||0});else if(O.name==="hvcC")ne(E.codecType)||(E.codecType=ti[l.name]||$.c.hevc,E.codecType===$.c.hevc?Nt.onHEVCDetected(p.Ci,E,p.di,p.li,H):Nt.onKVCDetected(p.Ci,E,p.di,H)),p.rh(E,O),p.nh(E);else if(O.name==="av1C")E.codecType=ti[O.name],Nt.onAV1Detected(p.Ci,E,p.di,p.li,H),p.hh(E,O),p.nh(E);else if(O.name==="vvcC"||O.name==="bv2C"||O.name==="kvLC")E.codecType=ti[O.name],Nt.onVVCDetected(p.Ci,E,p.di,H),p.oh(E,O),p.nh(E);else if(O.name==="btrt"){var ce=ui.btrt(O);ce&&(E.maxBitrate=ce.maxBitrate/1e3,E.bitrate=ce.avgBitrate/1e3)}else if(O.name==="pasp"){var Ae=ui.pasp(O);Ae&&p.Mi.sar.width==p.Mi.sar.height&&(p.Mi.sar={width:Ae.hSpacing,height:Ae.vSpacing})}})}},f.hh=function(l,p){if(p.data){this.Gn=ee.createCtx();var E=It.parseAV1C(this.Ci,p.data,this.Gn);E?E.sh&&Nt.updateAV1Track(this.Ci,l,E.sh,p.data):this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"Invalid AV1DecoderConfigurationRecord"))}},f.eh=function(l,p){if(p.data){var E=It.parseAVCC(this.Ci,p.data);E&&It.isParamSetsReady(E.paramSets)?(this.Pn=E.paramSets,this.Gr(l,E.paramSets)):(this.Ci.i(mt,"parse avcc no sps/pps."),this.Sr=!0)}},f.rh=function(l,p){if(this.Ci.i(mt,"parse hvcc",l.codecType),p.data){var E=It.parseHVCC(this.Ci,p.data,l.codecType),x=E&&It.isParamSetsReady(E.paramSets);if(x?(this.Pn=E.paramSets,this.Gr(l,E.paramSets)):(this.Ci.i(mt,"parse hvcc no vps/sps/pps."),this.Sr=!0),this.Mi.outputRaw&&x){var H=It.hevDecoderConfigToSample(E.paramSets,0);this.Ai.emit(oe.a.RAW_DATA,{type:o.d.decoderConfig,samples:re([H],l.inputTimescale),extra:this._i})}}},f.oh=function(l,p){if(this.Ci.i(mt,"parse vvcC",l.codecType),p.data){var E,x=(E=l.codecType===$.c.kvc30?It.parseKvLC(this.Ci,p.data):l.codecType===$.c.bvc2?It.parseBV2C(this.Ci,p.data):It.parseVvcC(this.Ci,p.data))&&It.isParamSetsReady(E.paramSets);if(x?(this.Pn=E.paramSets,this.Gr(l,E.paramSets)):(this.Ci.i(mt,"parse vvcc no vps/sps/pps."),this.Sr=!0),this.Mi.outputRaw&&x){var H=It.vvcDecoderConfigToSample(E.paramSets,0);this.Ai.emit(oe.a.RAW_DATA,{type:o.d.decoderConfig,samples:[H],extra:this._i})}}},f.Gr=function(l,p,E){var x;E===void 0&&(E=!0),l.codecType===$.c.h264?Nt.updateAVCTrack(this.Ci,l,p):ne(l.codecType)?Nt.updateHEVCTrack(this.Ci,l,p):Le(l.codecType)&&(Nt.updateVVCTrack(this.Ci,l,p),l.sampleDuration=this.yr&&this.yr.samples.length?Math.round(this.Vn*l.inputTimescale/this.yr.samples.length):3003,l.duration=this.Vn),E&&this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{codecType:l.codecType||$.c.unknown,enabled:!!l.active,decoder:this.Mi.outputRaw?$.d.wasm:$.d.buildin,bitDepth:l.bitDepth,timeOffset:((x=this.Ue)==null?void 0:x.timeOffset)||0})},f.Wr=function(l,p,E,x,H){this.Ci.i(mt,"parse stbl type: "+l.type,this.Vn);var O={description:p.stsd?p.stsd.sampleEntrys:[],samples:[],keyframes:[],endPTS:0,size:0,duration:E.duration/E.timescale};if(l.inputTimescale=E.timescale,l.duration=E.duration,p.stco&&p.stsc&&p.stsz&&p.stsz.sampleCount){var Y,ce,Ae,_e=0,me=0,Ce=p.stco.chunkOffset[_e],Me=p.stsc.sampleToChunkBox[me],Ge=(Y=Me)==null?void 0:Y.samplesPerChunk,ke=(ce=Me)==null?void 0:ce.firstChunk,qe=0,Xe=Math.ceil(Object(bt.e)(1,l.inputTimescale));if(!Me)throw new Error("mp4 stbl error. sampleToChunkBox undefined");if(typeof Ge!="number")throw new Error("mp4 stbl error. chunkSampleCount");if(typeof ke!="number")throw new Error("mp4 stbl error. firstChunk");var et=0,ot=void 0,Ke=0,Rt=0;if(p.stts){if(!(ot=p.stts.timeToSample[et]))throw new Error("mp4 stbl error. timeToSample");Ke=ot.sampleCount}var wt=0,ut=void 0,yt=0,pt=0;if(p.ctts){if(!(ut=p.ctts.compositionOffset[wt]))throw new Error("mp4 stbl error. compositionOffset");yt=ut.sampleCount}var St=0,Qt=0;p.stss&&(Qt=p.stss.sampleNumber[St]);for(var $t=0;$t<p.stsz.sampleCount;$t++){if($t>=Ge&&_e<p.stco.chunkOffset.length){qe=0,ke++,_e++,Ce=p.stco.chunkOffset[_e];var _i=p.stsc.sampleToChunkBox[me+1];_i&&ke>=_i.firstChunk&&(me++,Me=_i),Ge+=Me.samplesPerChunk}if(p.stts&&$t>=Ke&&et<p.stts.timeToSample.length-1&&(et++,Ke+=(ot=p.stts.timeToSample[et]).sampleCount),p.ctts&&$t>=yt&&wt<p.ctts.compositionOffset.length-1&&(wt++,yt+=(ut=p.ctts.compositionOffset[wt]).sampleCount),p.stss&&Qt&&$t>=Qt-1&&(St++,Qt=p.stss.sampleNumber[St],Ae={time:0,position:0}),Me&&Ce){var qi,Ji;pt=((qi=ut)==null?void 0:qi.sampleOffset)||0;var Di=typeof p.stsz.SampleSize=="number"?p.stsz.SampleSize:p.stsz.SampleSize[$t],rn=Math.max(Xe,((Ji=ot)==null?void 0:Ji.sampleDelta)||0);$t===0&&(Rt=0-pt);var nr=Rt+pt,gn={type:l.type,index:$t,gopID:O.keyframes.length||1,dts:Rt,cts:pt,pts:nr,duration:rn,start:Ce+qe,end:Ce+qe+Di,size:Di};nr>O.endPTS&&(O.endPTS=nr),O.samples.push(gn),O.size+=Di,Ae&&(Ae.time=O.keyframes.length?Math.round((Rt+pt)/l.inputTimescale*1e3)/1e3:0,Ae.position=gn.start,O.keyframes.push(Ae),Ae=void 0),Rt+=rn,qe+=Di,!p.stss&&O.keyframes.length===0&&O.samples.length&&O.keyframes.push({time:0,position:O.samples[0].start})}}if(H&&H.entries.length>1&&x){this.Ci.i(mt,"elst box",l.type,H);for(var Kr=0,nn=0,Wr=0,er=0;er<H.entries.length;er++){var xi=H.entries[er];er===0&&xi.media_time===-1?(Kr=xi.segment_duration,nn=1):nn===er&&xi.media_time>=0&&(Wr=xi.media_time)}if(Kr&&x.timescale>0){var _r=Wr-(Kr=Kr/x.timescale*E.timescale),mn=_r/l.inputTimescale;this.Ci.i(mt,"elst track: "+l.type+" timeOffset: "+_r+"/"+mn+" startTime: "+Wr);var bn=0;O.samples.forEach(function(Li){Li.dts=Math.max(Li.dts-_r,bn),Li.pts=Li.dts+Li.cts,bn++}),bn=0,O.keyframes.forEach(function(Li,Ga){Ga>0&&(Li.time=Math.max(Li.time-mn,0)),bn=Li.time+.001}),O.duration-=mn}}return l.type===$.o.VIDEO&&O.samples.length&&E.timescale&&(O.fps=O.samples.length/(E.duration/E.timescale)),O.samples.length&&(l.sampleDuration=this.Vn*l.inputTimescale/O.samples.length),O}return O},f.nh=function(l){try{var p,E;(p=this.yr)!=null&&p.fps&&Number.isFinite((E=this.yr)==null?void 0:E.fps)&&this.yr.fps>0&&(l.fps=this.yr.fps)}catch(x){}},I()(y,null,[{key:"probeSize",get:function(){return 8}}])}(de),rr=n(30),pi=function(V){return V[V.AV_PICTURE_STRUCTURE_UNKNOWN=0]="AV_PICTURE_STRUCTURE_UNKNOWN",V[V.AV_PICTURE_STRUCTURE_TOP_FIELD=1]="AV_PICTURE_STRUCTURE_TOP_FIELD",V[V.AV_PICTURE_STRUCTURE_BOTTOM_FIELD=2]="AV_PICTURE_STRUCTURE_BOTTOM_FIELD",V[V.AV_PICTURE_STRUCTURE_FRAME=3]="AV_PICTURE_STRUCTURE_FRAME",V}(pi||{}),oi=function(V){return V[V.MMCO_END=0]="MMCO_END",V[V.MMCO_SHORT2UNUSED=1]="MMCO_SHORT2UNUSED",V[V.MMCO_LONG2UNUSED=2]="MMCO_LONG2UNUSED",V[V.MMCO_SHORT2LONG=3]="MMCO_SHORT2LONG",V[V.MMCO_SET_MAX_LONG=4]="MMCO_SET_MAX_LONG",V[V.MMCO_RESET=5]="MMCO_RESET",V[V.MMCO_LONG=6]="MMCO_LONG",V}(oi||{}),Xt=function(V){return V[V.AV_PICTURE_TYPE_NONE=0]="AV_PICTURE_TYPE_NONE",V[V.AV_PICTURE_TYPE_I=1]="AV_PICTURE_TYPE_I",V[V.AV_PICTURE_TYPE_P=2]="AV_PICTURE_TYPE_P",V[V.AV_PICTURE_TYPE_B=3]="AV_PICTURE_TYPE_B",V[V.AV_PICTURE_TYPE_S=4]="AV_PICTURE_TYPE_S",V[V.AV_PICTURE_TYPE_SI=5]="AV_PICTURE_TYPE_SI",V[V.AV_PICTURE_TYPE_SP=6]="AV_PICTURE_TYPE_SP",V[V.AV_PICTURE_TYPE_BI=7]="AV_PICTURE_TYPE_BI",V}(Xt||{}),pr=function(V){return V[V.HEVC_SLICE_B=0]="HEVC_SLICE_B",V[V.HEVC_SLICE_P=1]="HEVC_SLICE_P",V[V.HEVC_SLICE_I=2]="HEVC_SLICE_I",V}(pr||{}),jn=[Xt.AV_PICTURE_TYPE_P,Xt.AV_PICTURE_TYPE_B,Xt.AV_PICTURE_TYPE_I,Xt.AV_PICTURE_TYPE_SP,Xt.AV_PICTURE_TYPE_SI],Ki="raw-demuxer",Ms=function(V){function y(l,p,E,x,H){var O;return l.i(Ki,"constructor"),(O=V.call(this,l,p,E,x,H)||this).ah=!1,O.uh=void 0,O.mr=0,O.fh=0,O.Ti=0,O.Ah=N.f/N.d,O.dh=void 0,O.bh(),O.Qe=new Re.a(O.Ci),O}W()(y,V),y.probe=function(l){return l.length>4&&l[0]===0&&l[1]===0&&l[2]===0&&l[3]===1};var f=y.prototype;return f.resetInitSegment=function(l){this.He(l.duration),V.prototype.resetInitSegment.call(this,l),this.ah=!1,this.uh=void 0,this.mr=0,this.fh=0,this.bh(),this.Ci.i(Ki,"reset init")},f.append=function(l,p,E,x,H){var O=this.ph(l);if(this.Ue||(this.Ue={timeOffset:p,contiguous:E,accurateTimeOffset:x}),O&&O.length){var Y=-this._t.unreadLen;this._t.put(l);for(var ce=0,Ae=0;Ae<O.length;Ae++){var _e=O[Ae];if(ce=_e.pos-Y-_e.state){var me=this._t.get(ce);this._t.skip(_e.state),me&&(me=_e.state===3&&me[me.length-1]===0?me.subarray(0,me.length-1):me,this.mh(me))}else this._t.skip(_e.state);Y=_e.pos}}else this._t.put(l);if(H){var Ce,Me=this._t.get(this._t.unreadLen);Me&&(this.mh(Me),this.uh&&this.Mi&&this.gh(),this.flush());var Ge={duration:(this.Ti+this.Ah)/(((Ce=this.Mi)==null?void 0:Ce.inputTimescale)||N.f)};this.Ai.emit(oe.a.METADATA,Ge)}},f.He=function(l){var p;V.prototype.He.call(this,l),this.Mi.naluState=0,this.Mi.active=this.Ye(),le.a.initAudioForFillSilent(this.Ci,this.Ne,(p=this._i)==null?void 0:p.audioCodec)},f.ph=function(l){var p=this.Mi;if(p){for(var E=l.byteLength,x=[],H=0,O=p.naluState;H<E;)E-H>3&&O===0?(l[H+2]===1?l[H+1]===0&&l[H]===0&&x.push({pos:H+3,state:3}):l[H+2]===0&&(O=1,l[H+1]===0&&(O=2,l[H]===0&&(O=3))),H+=3):(O<2?l[H]===0?O++:O=0:O===3||O===2?l[H]===1?(x.push({pos:H+1,state:O+1}),O=0):l[H]>1&&(O=0):this.Ci.w(Ki,"error state",O),H++);return p.naluState=O,x}},f.Ke=function(l){var p;l===void 0&&(l=!1),this.gh();var E=this.Ne,x=this.Mi;if(this.We(E,x)&&((p=this.Qe)==null||p.update(E,x),this.Xe(E,x,l))){var H=Object(ri.a)(x,this.fh);this.Ai.emit(oe.a.VIDEO_FRAME_INFO,{videoFramesInfo:H}),this.Ve&&this.Ai.emit(oe.a.KEY_FRAME_INDEXS,{keyframes:[{time:0,position:0}]}),this.qe(E,x,l,o.b.RAW)}},f.mh=function(l){var p=this.Mi;if(p){if(!p.codecType||p.codecType===$.c.unknown){var E=31&l[0],x=(126&l[0])>>1;if(E>=Pe.H264_NAL_SPS&&E<=Pe.H264_NAL_AUD)p.codecType=$.c.h264,this.dh={pict_type:Xt.AV_PICTURE_TYPE_NONE,picture_structure:pi.AV_PICTURE_STRUCTURE_UNKNOWN,key_frame:0,priv_data:{picture_structure:pi.AV_PICTURE_STRUCTURE_UNKNOWN,poc:{poc_lsb:0,poc_msb:0,delta_poc_bottom:0,delta_poc:[],frame_num:0,prev_poc_msb:0,prev_poc_lsb:0,frame_num_offset:0,prev_frame_num_offset:0,prev_frame_num:0},ps:{spsList:[],ppsList:[]}}},this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:$.d.buildin,codecType:$.c.h264,timeOffset:0});else{if(!(x>=ae.a.HEVC_NAL_VPS&&x<=ae.a.HEVC_NAL_AUD||x===ae.a.HEVC_NAL_SEI_PREFIX||x===ae.a.HEVC_NAL_SEI_SUFFIX))return void this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,"unsupport codec"));var H,O,Y,ce;this.dh={pict_type:Xt.AV_PICTURE_TYPE_NONE,picture_structure:pi.AV_PICTURE_STRUCTURE_UNKNOWN,key_frame:0,priv_data:{ps:{spsList:[],ppsList:[],vpsList:[]},poc:0,pocTid0:0,max_dec_pic_buffering:0}},((H=this._i)==null?void 0:H.suffix)===".kvc3"?p.codecType=$.c.kvc3:((O=this._i)==null?void 0:O.suffix)===".kvc4"?p.codecType=$.c.kvc4:((Y=this._i)==null?void 0:Y.suffix)===".kvc5"?p.codecType=$.c.kvc5:((ce=this._i)==null?void 0:ce.suffix)===".kvc6"?p.codecType=$.c.kvc6:p.codecType=$.c.hevc}}p.codecType===$.c.h264?this.yh(l):ne(p.codecType)&&this._h(l)}},f.yh=function(l){var p=this.dh,E=this.Mi;if(p&&E){var x=p.priv_data,H=[0,0],O=0;p.pict_type=Xt.AV_PICTURE_TYPE_I,p.key_frame=0,p.picture_structure=pi.AV_PICTURE_STRUCTURE_UNKNOWN;var Y={ref_idc:l[0]>>5&3,type:31&l[0],nuh_layer_id:0,temporal_id:0,data:l};if(Y.type===Pe.H264_NAL_IDR_SLICE&&(E.decConf&&this.Ke(),this.fh=this.mr,p.key_frame=1,x.poc.prev_frame_num=0,x.poc.prev_frame_num_offset=0,x.poc.prev_poc_msb=x.poc.prev_poc_lsb=0),Y.type===Pe.H264_NAL_IDR_SLICE||Y.type===Pe.H264_NAL_SLICE){var ce=Object(b.c)(Se(l.subarray(1,l.byteLength)));Y.gbCtx=ce,Object(b.h)(ce);var Ae=Object(b.h)(ce);p.pict_type=jn[Ae%5];var _e=Object(b.h)(ce),me=x.ps.ppsList[_e],Ce=x.ps.spsList[me.sps_id];if(x.ps.sps=Ce,x.ps.pps=me,!(x.ps.sps&&x.ps.pps&&Ce&&me))throw new Error("raw nal slice error. sps/pps undefined");x.ps.sps.ref_frame_count<=1&&x.ps.pps.ref_count[0]<=1&&p.pict_type===Xt.AV_PICTURE_TYPE_I&&(p.key_frame=1),x.poc.frame_num=Object(b.a)(ce,Ce.log2_max_frame_num),Ce.frame_mbs_only_flag?x.picture_structure=pi.AV_PICTURE_STRUCTURE_FRAME:Object(b.a)(ce,1)?x.picture_structure=pi.AV_PICTURE_STRUCTURE_TOP_FIELD+Object(b.a)(ce,1):x.picture_structure=pi.AV_PICTURE_STRUCTURE_FRAME,Y.type===Pe.H264_NAL_IDR_SLICE&&Object(b.h)(ce),Ce.pic_order_cnt_type===0&&(x.poc.poc_lsb=Object(b.a)(ce,Ce.log2_max_poc_lsb),me.pic_order_present==1&&x.picture_structure==pi.AV_PICTURE_STRUCTURE_FRAME&&(x.poc.delta_poc_bottom=Object(b.f)(ce))),Ce.pic_order_cnt_type!=1||Ce.delta_pic_order_always_zero_flag||(x.poc.delta_poc[0]=Object(b.f)(ce),me.pic_order_present==1&&x.picture_structure===pi.AV_PICTURE_STRUCTURE_FRAME&&(x.poc.delta_poc[1]=Object(b.f)(ce))),H[0]=H[1]=Number.MAX_SAFE_INTEGER;var Me=this.Ch(H,Ce,x.poc,x.picture_structure,Y.ref_idc);if(Y.ref_idc&&Y.type!==Pe.H264_NAL_IDR_SLICE&&(O=this.Ih(p,ce))<0)return;if(x.poc.prev_frame_num=O?0:x.poc.frame_num,x.poc.prev_frame_num_offset=O?0:x.poc.frame_num_offset,Y.ref_idc!==0&&(O?(x.poc.prev_poc_msb=0,x.poc.prev_poc_lsb=x.picture_structure===pi.AV_PICTURE_STRUCTURE_BOTTOM_FIELD?0:H[0]):(x.poc.prev_poc_msb=x.poc.poc_msb,x.poc.prev_poc_lsb=x.poc.poc_lsb)),!E.decConf){var Ge;this.ah&&this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),Nt.updateAVCTrack(this.Ci,E,x.ps),this.nh(E);var ke=It.avcDecoderConfigToNalu(x.ps);this.uh&&(Ge=this.uh.units).push.apply(Ge,ke),E.fps&&(this.Ah=E.inputTimescale/E.fps)}this.uh&&(this.uh.poc!==-1&&Math.floor(Me/2)!==Math.floor(this.uh.poc/2)&&this.gh(),this.uh.units.push({type:Y.type,data:Y.data}),this.uh.poc===-1&&(this.uh.pts=this.mr?(Me/2+this.fh+Ce.ref_frame_count)*this.Ah:0,this.uh.cts=this.uh.pts-this.uh.dts,this.uh.originPTS=this.uh.originDTS+this.uh.cts,this.uh.pts>this.Ti&&(this.Ti=this.uh.pts),this.uh.key=!!p.key_frame,this.uh.poc=Me))}else if(Y.type!==Pe.H264_NAL_AUD){if(Y.type===Pe.H264_NAL_SPS){var qe=Et.parse(l);qe&&(x.ps.sps&&!Object(q.b)(x.ps.sps.data,qe.data)&&(this.ah=!0),x.ps.spsList[qe.sps_id]=qe),Nt.onAVCDetected(this.Ci,E,this.di,this.li,this.Ye()),E.decConf&&this.Ke(),E.decConf=void 0}else if(Y.type===Pe.H264_NAL_PPS){var Xe=Wt.parse(l);Xe&&(x.ps.pps&&!Object(q.b)(x.ps.pps.data,Xe.data)&&(this.ah=!0),x.ps.ppsList[Xe.pps_id]=Xe),E.decConf&&this.Ke(),E.decConf=void 0}}}},f._h=function(l){var p=this.dh,E=this.Mi;if(p&&E){var x,H=p.priv_data;p.pict_type=Xt.AV_PICTURE_TYPE_I,p.key_frame=0,p.picture_structure=pi.AV_PICTURE_STRUCTURE_UNKNOWN;var O={type:(126&l[0])>>1,nuh_layer_id:(1&l[0])<<5&l[1]>>3&31,temporal_id:(7&l[1])-1,ref_idc:0,data:l};if(!(O.nuh_layer_id>0))switch(O.type){case ae.a.HEVC_NAL_TRAIL_N:case ae.a.HEVC_NAL_TRAIL_R:case ae.a.HEVC_NAL_TSA_N:case ae.a.HEVC_NAL_TSA_R:case ae.a.HEVC_NAL_STSA_N:case ae.a.HEVC_NAL_STSA_R:case ae.a.HEVC_NAL_BLA_W_LP:case ae.a.HEVC_NAL_BLA_W_RADL:case ae.a.HEVC_NAL_BLA_N_LP:case ae.a.HEVC_NAL_IDR_W_RADL:case ae.a.HEVC_NAL_IDR_N_LP:case ae.a.HEVC_NAL_CRA_NUT:case ae.a.HEVC_NAL_RADL_N:case ae.a.HEVC_NAL_RADL_R:case ae.a.HEVC_NAL_RASL_N:case ae.a.HEVC_NAL_RASL_R:if(!E.decConf&&(this.ah&&this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),Nt.updateHEVCTrack(this.Ci,E,H.ps),E.decConf&&(this.nh(E),this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{codecType:E.codecType||$.c.unknown,enabled:!!E.active,decoder:E.outputRaw?$.d.wasm:$.d.buildin,bitDepth:E.bitDepth,timeOffset:0}),E.fps&&(this.Ah=E.inputTimescale/E.fps),E.outputRaw))){var Y=It.hevDecoderConfigToSample(H.ps,this.uh?this.uh.dts:0);this.Ai.emit(oe.a.RAW_DATA,{type:o.d.decoderConfig,samples:re([Y],E.inputTimescale),extra:this._i})}if(O.gbCtx=Object(b.c)(Se(O.data.subarray(2,O.data.byteLength))),x=this.Oh(p,O))return x;break;case ae.a.HEVC_NAL_AUD:break;case ae.a.HEVC_NAL_SEI_PREFIX:case ae.a.HEVC_NAL_SEI_SUFFIX:E.decConf?(this.gh(),this.uh&&this.uh.units.push({type:ae.a.HEVC_NAL_SEI_PREFIX,data:l})):(H.ps.seiList||(H.ps.seiList=[]),H.ps.seiList.push({type:O.type,data:l}));break;case ae.a.HEVC_NAL_SPS:var ce=Lt.parse(l,E.codecType);ce&&(H.ps.sps&&!Object(q.b)(H.ps.sps.data,ce.data)&&(this.ah=!0),H.ps.spsList[ce.sps_id]=ce,H.max_dec_pic_buffering=ce.temporal_layer.reduce(function(Ce,Me){return Math.max(Ce,Me.max_dec_pic_buffering)},0));var Ae=this.Ye();if(!(E.codecType===$.c.hevc?Nt.onHEVCDetected(this.Ci,E,this.di,this.li,Ae):Nt.onKVCDetected(this.Ci,E,this.di,Ae)))return void this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,"unsupport codec hevc"));E.decConf&&this.Ke(),E.decConf=void 0;break;case ae.a.HEVC_NAL_PPS:var _e=Ut.parse(l);_e&&(H.ps.pps&&!Object(q.b)(H.ps.pps.data,_e.data)&&(this.ah=!0),H.ps.ppsList[_e.pps_id]=_e),E.decConf&&this.Ke(),E.decConf=void 0;break;case ae.a.HEVC_NAL_VPS:var me=ai.parse(this.Ci,l);me&&(H.ps.vps&&!Object(q.b)(H.ps.vps.data,me.data)&&(this.ah=!0),H.ps.vpsList[me.vps_id]=me),E.decConf&&this.Ke(),E.decConf=void 0}}},f.gh=function(){this.Mi&&this.uh&&this.uh.units.length&&this.uh.pts!==-1&&(this.$e(this.uh),this.mr++,this.uh=void 0),this.uh||this.bh()},f.bh=function(){var l=this.mr*this.Ah;this.uh={poc:-1,key:!1,pts:-1,dts:l,cts:0,units:[],originDTS:l,originPTS:l,duration:this.Ah,size:0}},f.Oh=function(l,p){var E,x,H=l.priv_data,O=H.ps,Y=p.gbCtx;if(!Y)return-1;var ce=Object(b.a)(Y,1);(function(ke){return ke.type>=16&&ke.type<=23})(p)&&(l.key_frame=1,Object(b.g)(Y,1));var Ae=Object(b.h)(Y);if(O.pps=O.ppsList[Ae],!O.pps)throw new Error("raw hevc slice header error. pps undefined");if(O.sps=O.spsList[O.pps.sps_id],!O.sps)throw new Error("raw hevc slice header error. sps undefined");if(O.vps=O.vpsList[O.sps.vps_id],ce)x=0;else{x=O.pps.dependent_slice_segments_enabled_flag?Object(b.a)(Y,1):0;var _e=Math.ceil(Math.log2(O.sps.ctb_width*O.sps.ctb_height)),me=Object(b.a)(Y,_e);if(me>=O.sps.ctb_width*O.sps.ctb_height)return this.Ci.i(Ki,"Invalid slice segment address: "+me+"."),-1}if(x)return 0;for(E=0;E<O.pps.num_extra_slice_header_bits;E++)Object(b.g)(Y,1);var Ce=Object(b.h)(Y);if(Ce!==pr.HEVC_SLICE_I&&Ce!==pr.HEVC_SLICE_P&&Ce!==pr.HEVC_SLICE_B)return this.Ci.i(Ki,`Unknown slice type: %d.
`,Ce),-1;l.pict_type=Ce===pr.HEVC_SLICE_B?Xt.AV_PICTURE_TYPE_B:Ce===pr.HEVC_SLICE_P?Xt.AV_PICTURE_TYPE_P:Xt.AV_PICTURE_TYPE_I,O.pps.output_flag_present_flag&&Object(b.g)(Y,1),O.sps.separate_colour_plane_flag&&Object(b.g)(Y,2);var Me=function(ke){return ke.type===ae.a.HEVC_NAL_IDR_W_RADL||ke.type===ae.a.HEVC_NAL_IDR_N_LP}(p);if(Me)H.poc=0,this.Ke(),this.fh=this.mr;else{var Ge=Object(b.a)(Y,O.sps.log2_max_poc_lsb);H.poc=this.wh(O.sps,H.pocTid0,Ge,p.type)}return p.temporal_id===0&&p.type!==ae.a.HEVC_NAL_TRAIL_N&&p.type!==ae.a.HEVC_NAL_TSA_N&&p.type!==ae.a.HEVC_NAL_STSA_N&&p.type!==ae.a.HEVC_NAL_RADL_N&&p.type!==ae.a.HEVC_NAL_RASL_N&&p.type!==ae.a.HEVC_NAL_RADL_R&&p.type!==ae.a.HEVC_NAL_RASL_R&&(H.pocTid0=H.poc),this.uh&&(this.uh.poc!==-1&&H.poc!==this.uh.poc&&this.gh(),this.uh.units.push({type:p.type,data:p.data}),this.uh.pts===-1&&(this.uh.pts=this.mr?(H.poc+this.fh+H.max_dec_pic_buffering)*this.Ah:0,this.uh.cts=this.uh.pts-this.uh.dts,this.uh.originPTS=this.uh.originDTS+this.uh.cts,this.uh.pts>this.Ti&&(this.Ti=this.uh.pts),this.uh.key=Me,this.uh.poc=H.poc)),1},f.wh=function(l,p,E,x){var H,O=1<<l.log2_max_poc_lsb,Y=p%O,ce=p-Y;return H=E<Y&&Y-E>=O/2?ce+O:E>Y&&E-Y>O/2?ce-O:ce,x!==ae.a.HEVC_NAL_BLA_W_LP&&x!==ae.a.HEVC_NAL_BLA_W_RADL&&x!==ae.a.HEVC_NAL_BLA_N_LP||(H=0),H+E},f.Ch=function(l,p,E,x,H){var O=1<<p.log2_max_frame_num,Y=[];if(E.frame_num_offset=E.prev_frame_num_offset,E.frame_num<E.prev_frame_num&&(E.frame_num_offset+=O),p.pic_order_cnt_type===0){var ce=1<<p.log2_max_poc_lsb;E.prev_poc_lsb<0&&(E.prev_poc_lsb=E.poc_lsb),E.poc_lsb<E.prev_poc_lsb&&E.prev_poc_lsb-E.poc_lsb>=ce/2?E.poc_msb=E.prev_poc_msb+ce:E.poc_lsb>E.prev_poc_lsb&&E.prev_poc_lsb-E.poc_lsb<-ce/2?E.poc_msb=E.prev_poc_msb-ce:E.poc_msb=E.prev_poc_msb,Y[0]=Y[1]=E.poc_msb+E.poc_lsb,x===pi.AV_PICTURE_STRUCTURE_FRAME&&(Y[1]+=E.delta_poc_bottom)}else if(p.pic_order_cnt_type===1){var Ae,_e,me,Ce;for(Ae=p.num_ref_frames_in_pic_order_cnt_cycle!==0?E.frame_num_offset+E.frame_num:0,H===0&&Ae>0&&Ae--,_e=0,Ce=0;Ce<p.num_ref_frames_in_pic_order_cnt_cycle;Ce++)_e+=p.offset_for_ref_frame[Ce];if(Ae>0){var Me=(Ae-1)/p.num_ref_frames_in_pic_order_cnt_cycle,Ge=(Ae-1)%p.num_ref_frames_in_pic_order_cnt_cycle;for(me=Me*_e,Ce=0;Ce<=Ge;Ce++)me+=p.offset_for_ref_frame[Ce]}else me=0;H==0&&(me+=p.offset_for_non_ref_pic),Y[0]=me+E.delta_poc[0],Y[1]=Y[0]+p.offset_for_top_to_bottom_field,x===pi.AV_PICTURE_STRUCTURE_FRAME&&(Y[1]+=E.delta_poc[1])}else{var ke=2*(E.frame_num_offset+E.frame_num);H||ke--,Y[0]=ke,Y[1]=ke}return x!==pi.AV_PICTURE_STRUCTURE_BOTTOM_FIELD&&(l[0]=Y[0]),x!==pi.AV_PICTURE_STRUCTURE_TOP_FIELD&&(l[1]=Y[1]),Math.min(l[0],l[1])},f.Ih=function(l,p){var E=l.priv_data;if(!E.ps.pps)return-1;var x=3&l.pict_type,H=0,O=[];E.ps.pps.redundant_pic_cnt_present&&Object(b.h)(p),x===Xt.AV_PICTURE_TYPE_B&&Object(b.a)(p,1);var Y={list_count:H};if(this.Eh(Y,O,p,E.ps.pps,x,E.picture_structure)<0)return-2;if(H=Y.list_count,x!==Xt.AV_PICTURE_TYPE_I){for(var ce=0;ce<H;ce++)if(Object(b.a)(p,1))for(var Ae=0;;Ae++){var _e=Object(b.h)(p);if(!(_e<3)){if(_e>3)return this.Ci.i(Ki,`illegal reordering_of_pic_nums_idc %d
`,_e),-3;break}if(Object(b.h)(p),Ae>=O[ce])return this.Ci.i(Ki,`reference count %d overflow
`,Ae),-4}}if((E.ps.pps.weighted_pred&&x===Xt.AV_PICTURE_TYPE_P||E.ps.pps.weighted_bipred_idc===1&&x==Xt.AV_PICTURE_TYPE_B)&&E.ps.sps&&this.jh(p,E.ps.sps,O,x,{use_weight:0,use_weight_chroma:0,luma_log2_weight_denom:0,chroma_log2_weight_denom:0,luma_weight_flag:[],chroma_weight_flag:[]}),Object(b.a)(p,1))for(var me=0;me<66;me++){var Ce=Object(b.h)(p);if(Ce>oi.MMCO_LONG)return this.Ci.i(Ki,"illegal memory management control operation "+Ce),-5;if(Ce===oi.MMCO_END)return 0;if(Ce===oi.MMCO_RESET)return 1;Ce!==oi.MMCO_SHORT2UNUSED&&Ce!==oi.MMCO_SHORT2LONG||Object(b.h)(p),Ce!==oi.MMCO_SHORT2LONG&&Ce!==oi.MMCO_LONG2UNUSED&&Ce!==oi.MMCO_LONG&&Ce!==oi.MMCO_SET_MAX_LONG||Object(b.h)(p)}return 0},f.Eh=function(l,p,E,x,H,O){var Y;if(p[0]=x.ref_count[0],p[1]=x.ref_count[1],H!==Xt.AV_PICTURE_TYPE_I){var ce=[];if(ce[0]=ce[1]=O===pi.AV_PICTURE_STRUCTURE_FRAME?15:31,Object(b.a)(E,1)&&(p[0]=Object(b.h)(E)+1,H===Xt.AV_PICTURE_TYPE_B?p[1]=Object(b.h)(E)+1:p[1]=1),Y=H===Xt.AV_PICTURE_TYPE_B?2:1,p[0]-1>ce[0]||Y==2&&p[1]-1>ce[1])return this.Ci.i(Ki,`reference overflow %u > %u or %u > %u
`,p[0]-1,ce[0],p[1]-1,ce[1]),p[0]=p[1]=0,l.list_count=0,p[0]=0,p[1]=0,-1;p[1]-1>ce[1]&&(this.Ci.i(Ki,`reference overflow %u > %u
`,p[1]-1,ce[1]),p[1]=0)}else Y=0,p[0]=p[1]=0;return l.list_count=Y,0},f.jh=function(l,p,E,x,H){var O,Y;for(H.use_weight=0,H.use_weight_chroma=0,H.luma_log2_weight_denom=Object(b.h)(l),H.luma_log2_weight_denom>7&&(this.Ci.i(Ki,`luma_log2_weight_denom %d is out of range
`,H.luma_log2_weight_denom),H.luma_log2_weight_denom=0),p.chroma_format_idc&&(H.chroma_log2_weight_denom=Object(b.h)(l),H.chroma_log2_weight_denom>7&&(this.Ci.i(Ki,`chroma_log2_weight_denom %d is out of range
`,H.chroma_log2_weight_denom),H.chroma_log2_weight_denom=0)),O=0;O<2;O++){for(H.luma_weight_flag[O]=0,H.chroma_weight_flag[O]=0,Y=0;Y<E[O];Y++)if(Object(b.a)(l,1)&&(Object(b.f)(l),Object(b.f)(l)),p.chroma_format_idc&&Object(b.a)(l,1))for(var ce=0;ce<2;ce++)Object(b.f)(l),Object(b.f)(l);if(x!==Xt.AV_PICTURE_TYPE_B)break}return H.use_weight=H.use_weight||H.use_weight_chroma,0},f.nh=function(l){(!l.fps||l.fps>N.n)&&(l.fps=N.d)},I()(y,null,[{key:"probeSize",get:function(){return 4}}])}(de),Ps=function(){function V(f,l,p){var E=this;this.kh=void 0,this.Mh=void 0,this.decryptAacSamples=function(x,H,O){for(;;H++){if(H>=x.length)return void O();if(!(x[H].unit.length<32)){var Y=E.kh.isSync();if(E.Sh(x,H,O,Y),!Y)return}}},this.Bh=function(x,H){for(var O=new Uint8Array(H),Y=0,ce=32;ce<=x.length-16;ce+=160,Y+=16)x.set(O.subarray(Y,Y+16),ce);return x},this.Th=function(x,H,O,Y,ce,Ae){var _e=Se(ce.data),me=E.Dh(_e);E.Rh(me.buffer,function(Ce){ce.data=E.Bh(_e,Ce),Ae||E.decryptAvcSamples(x,H,O+1,Y)})},this.Mh=p,this.kh=new F(f,l,{removePKCS7Padding:!1})}var y=V.prototype;return y.decryptAvcSamples=function(f,l,p,E){for(;;l++,p=0){if(l>=f.length)return void E();for(var x=f[l].units;!(p>=x.length);p++){var H=x[p];if(!(H.data.length<=48||H.type!==1&&H.type!==5)){var O=this.kh.isSync();if(this.Th(f,l,p,E,H,O),!O)return}}}},y.Rh=function(f,l){this.Mh.key&&this.kh.decrypt(f,this.Mh.key.buffer,this.Mh.iv.buffer,l)},y.Sh=function(f,l,p,E){var x=this,H=f[l];if(H){var O=H.unit,Y=O.subarray(16,O.length-O.length%16),ce=Y.buffer.slice(Y.byteOffset,Y.byteOffset+Y.length);this.Rh(ce,function(Ae){Ae=new Uint8Array(Ae),O.set(new Uint8Array(Ae),16),E||x.decryptAacSamples(f,l+1,p)})}},y.Dh=function(f){for(var l=16*Math.floor((f.length-48)/160)+16,p=new Uint8Array(l),E=0,x=32;x<=f.length-16;x+=160,E+=16)p.set(f.subarray(x,x+16),E);return p},V}(),ja=function(V){return V[V.registration=5]="registration",V[V.av1=95]="av1",V[V.opus=127]="opus",V}({}),Xo={5:function(V,y){L()(V,{descriptor_name:"registration",format_identifier:Object(q.a)(y,0,4)})}};function Zo(V,y){var f={descriptor_tag:V[y],descriptor_length:V[y+1]},l=Xo[f.descriptor_tag];return l&&l(f,V.subarray(y+2,y+2+f.descriptor_length)),f}var Wi="ts-demuxer",ea=function(V){function y(l,p,E,x,H){var O;return l.i(Wi,"constructor"),(O=V.call(this,l,p,E,x,H)||this).Lh=void 0,O.Nh=!1,O.Qh=-1,O.Vn=0,O.xh=0,O.Vh=null,O.Uh=null,O.Fh=null,O.Ph=!1,O.Hh=0,O.Yh=!1,O.Gh=0,O.Kh={aacOverhead:0,unknownTSPacketCount:0},O.Zh={spsList:[],ppsList:[],vpsList:[]},O.Wh={spsList:[],ppsList:[]},O.Xh=void 0,O.ah=!1,O.zh=!1,O.Gn=void 0,O.Jh=function(Y,ce){return(31&Y[ce+10])<<8|Y[ce+11]},O.qh=function(Y,ce,Ae,_e){var me,Ce,Me,Ge,ke={audio:-1,video:-1,id3:-1,aCodecType:$.c.unknown,codecType:$.c.h264};me=(15&Y[ce+1])<<8|Y[ce+2],Ce=ce+3+me-4,Me=(15&Y[ce+10])<<8|Y[ce+11],ce+=12+Me;for(var qe=function(){Ge=(31&Y[ce+1])<<8|Y[ce+2];var Xe=Y[ce];if(O.Ci.i(Wi,"PMT stream_type: "+Xe),Xe===207&&_e||Xe===15)ke.audio===-1&&(ke.audio=Ge),ke.aCodecType=$.c.aac;else if(Xe===21)ke.id3===-1&&(ke.id3=Ge);else if(Xe===219&&_e||Xe===27)ke.video===-1&&(ke.video=Ge);else if(Xe===3||Xe===4)Ae.mpeg||Ae.mp3?ke.audio===-1&&(ke.audio=Ge):O.Ci.i(Wi,"MPEG audio found, not supported in this browser for now"),ke.aCodecType=$.c.mp3;else if(Xe===6||Xe>=128&&Xe<=255){Xe>=128&&Xe<=255&&O.Ci.i(Wi," PMT User Private: "+Xe);var et=4095&Object(q.f)(Y,ce+3);if(et){var ot=!1,Ke=!1,Rt=!1,wt=!1,ut=!1;O.$h(Y,ce+5,et).forEach(function(yt){if(yt.descriptor_tag===ja.av1)ot=!0;else if(yt.descriptor_tag!==ja.opus&&yt.descriptor_tag===ja.registration){var pt=yt.format_identifier;pt==="AV01"&&(ot=!0),pt==="KVC3"&&(Ke=!0),pt==="KVC4"&&(Rt=!0),pt==="KVC5"&&(wt=!0),pt==="KVC6"&&(ut=!0)}}),ot&&(Ae.av1?ke.video===-1&&ke.video===-1&&(ke.video=Ge):O.Ci.i(Wi,"AV1 video found, not supported in this browser for now"),ke.codecType=$.c.av1),Ke&&(ke.codecType=$.c.kvc3,ke.video===-1&&(ke.video=Ge)),Rt&&(ke.codecType=$.c.kvc4,ke.video===-1&&(ke.video=Ge)),wt&&(ke.codecType=$.c.kvc5,ke.video===-1&&(ke.video=Ge)),ut&&(ke.codecType=$.c.kvc6,ke.video===-1&&(ke.video=Ge))}}else Xe===36?(ke.codecType=$.c.hevc,ke.video===-1&&(ke.video=Ge)):O.Ci.v("unkown stream type:"+Xe);ce+=5+((15&Y[ce+3])<<8|Y[ce+4])};ce<Ce;)qe();return ke},O.io=function(Y,ce){ce===void 0&&(ce=!1);var Ae,_e,me,Ce,Me,Ge,ke=Y.data,qe=0,Xe=0,et=0,ot=0,Ke=0;if(Y&&Y.size!==0){for(;ke[0].length<19&&ke.length>1;){var Rt=new Uint8Array(ke[0].length+ke[1].length);Rt.set(ke[0]),Rt.set(ke[1],ke[0].length),ke[0]=Rt,ke.splice(1,1)}if(((Ae=ke[0])[0]<<16)+(Ae[1]<<8)+Ae[2]===1){if((me=(Ae[4]<<8)+Ae[5])&&me>Y.size-6||me===0&&!ce)return;if(192&(_e=Ae[7]))if(ot=Xe=536870912*(14&Ae[9])+4194304*(255&Ae[10])+16384*(254&Ae[11])+128*(255&Ae[12])+(254&Ae[13])/2,64&_e){if(Ke=et=536870912*(14&Ae[14])+4194304*(255&Ae[15])+16384*(254&Ae[16])+128*(255&Ae[17])+(254&Ae[18])/2,Math.abs(Xe-et)>60*N.q)if(O.Ci.w(Wi,Math.round((Xe-et)/N.q)+"s delta between PTS and DTS, align them"),Object(bt.a)(et,Xe)){O.Ci.i(Wi,"pes DTS > 33bit. align DTS:"+et+" PTS: "+Xe);var wt=Xe+8589934591-et;wt>0&&wt<60*N.q?Xe+=8589934591:et=Xe}else et=Xe}else et=Xe,Ke=ot;Ge=(Ce=Ae[8])+9,Y.size-=Ge,Me=new Uint8Array(Y.size);for(var ut=0,yt=ke.length;ut<yt;ut++){var pt=(Ae=ke[ut]).byteLength;if(Ge){if(Ge>pt){Ge-=pt;continue}Ae=Ae.subarray(Ge),pt-=Ge,Ge=0}Me.set(Ae,qe),qe+=pt}return me&&(me-=Ce+3),{data:Me,pts:Xe,dts:et,originDTS:Ke,originPTS:ot,len:me}}}},O.eo=function(Y,ce){if(Y.units.length&&Y.frame){var Ae=ce.samples,_e=Ae.length;(!O.di.forceKeyFrameOnDiscontinuity||Y.key===!0||ce.decConf&&(_e||O.Ph))&&(O.di.gopRemux&&Y.key&&Ae&&Ae.length>1&&O.Ue&&O.Ke(),Y.id=O.Mi.samples.length,Y.size=Y.units.reduce(function(me,Ce){return me+Ce.data.byteLength},0),O.$e(Y),!O.di.gopRemux&&O.Mi.samples.reduce(function(me,Ce){return me+Ce.size},0)>N.o&&(O.Ci.i(Wi,"max size remux"),O.Ke()))}},O.no=function(Y,ce){if(typeof O.Le=="number"&&!Object(bt.a)(O.Le,ce.dts)&&ce.dts-O.Le<90){var Ae=ce.pts-ce.dts;ce.dts=O.Le+90,ce.pts=ce.dts+Ae}var _e={key:Y,pts:ce.pts,dts:ce.dts,cts:ce.pts-ce.dts,units:[],originDTS:ce.originDTS,originPTS:ce.originPTS,size:0};return Object(bt.a)(O.xh,ce.originPTS)&&(O.Ci.i(Wi,"pts overflow last: "+O.xh+" curr: "+ce.originPTS),_e.keyTime=!0),O.Le=ce.dts,O.xh=ce.originPTS,_e},O.so=function(Y,ce){if(Y.data){var Ae,_e=O.Mi,me=O.Fh;_e.codecType===$.c.av1?(O.Gn||(O.Gn=ee.createCtx()),Ae=ee.parseOBU(Y.data,O.Gn)):Ae=O.ro(Y.data),Y.data=null,me&&me.frame&&Ae.length&&(!_e.audFound||me.originPTS!==Y.originPTS)&&(O.eo(me,_e),me=O.Fh=O.no(!1,Y)),ne(_e.codecType)?me=O._h(Ae,Y):_e.codecType===$.c.h264?me=O.ho(Ae,Y):_e.codecType===$.c.av1&&(me||(me=O.Fh=O.no(!1,Y)),Ae.forEach(function(Ce){if(Ce.obu_type===we.AV1_OBU_SEQUENCE_HEADER){var Me=Ce.content;Me&&O.Xh&&!Object(q.b)(O.Xh.data,Me.data)&&_e.decConf&&(O.oo(!0),O.De.iSGenerated&&O._i&&O.De.resetInitSegment(O._i)),O.Xh=Me,Nt.updateAV1Track(O.Ci,_e,Me)}var Ge;me&&(me.frame=me.frame||Ce.obu_type===we.AV1_OBU_FRAME||Ce.obu_type===we.AV1_OBU_FRAME_HEADER,me.key=me.key||Ce.obu_type!==we.AV1_OBU_SEQUENCE_HEADER&&!((Ge=Ce.content)==null||!Ge.keyframe),me.units.push({type:0,data:Ce.data}))})),ce&&me&&(O.eo(me,_e),O.Fh=null)}},O.ao=function(Y){if(Y.data){var ce=Y.data,Ae=O.Ne,_e=ce.length,me=0,Ce=0,Me=Y.pts;if(Me!==void 0)for(;Ce<_e;)if(Ve(ce,Ce)){var Ge=X(Ae,ce,Ce,Me,me);if(!Ge)break;Ce+=Ge.length,me++}else Ce++;else O.Ci.w("[tsdemuxer]: MPEG PES unknown PTS")}},O.uo=function(Y){var ce;if(Y.data){var Ae,_e,me,Ce,Me,Ge,ke=O.Ne,qe=O.Uh,Xe=Y.data,et=Y.pts,ot=O.Vh,Ke=null;if(O.Re=Y.dts,ot){var Rt=new Uint8Array(ot.byteLength+Xe.byteLength);Rt.set(ot,0),Rt.set(Xe,ot.byteLength),Xe=Rt}for(me=0,Ce=Xe.length;me<Ce-1&&!j.f(Xe,me);me++);if(me&&(me<Ce-1?(Me="AAC PES did not start with ADTS header,offset:"+me,Ge=!1):(Me="no ADTS header found in AAC PES",Ge=!0),O.Ci.w("parsing error:"+Me),O.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,Me,{fatal:Ge})),Ge))return;var wt=Xe.subarray(me+2,me+4);if((j.g(ke,wt)||!ke.configParsed)&&O.De.iSGenerated&&O._i&&O.De.resetInitSegment(O._i),j.d(O.Ci,ke,O.Ai,wt,o.a.ADTS,(ce=O._i)==null?void 0:ce.audioCodec),_e=0,Ae=j.c(ke.samplerate,ke.inputTimescale),qe&&(O.Gh||(O.Gh=et<qe?1:0),O.Gh||ot)){var ut=qe+Ae;Math.abs(ut-et)>1&&(O.Ci.v("AAC: align PTS for overlapping frames by "+Math.round((ut-et)/90)),et=ut)}for(;me<Ce;)if(j.f(Xe,me)&&me+5<Ce){var yt=j.a(O.Ci,ke,Xe,me,et,_e,Y.originPTS);if(!yt){me++;break}if(O.di.enableAacPriv&&typeof ke.aacSampleingIndex=="number"&&typeof ke.aot=="number"){var pt=j.h(O.Ci,yt.sample.unit,ke.aacSampleingIndex,ke.aot);pt&&(yt.sample.aacPriv=[{payload:pt.priv,streamTimestamp:Object(bt.c)(yt.sample.originPTS)}])}me+=yt.length,Ke=yt.sample.pts,yt.sample.originDTS=Y.originDTS,yt.sample.originPTS=Y.originPTS,_e++}else me++;_e>1&&(O.Kh.aacOverhead=1),ot=me<Ce?Xe.subarray(me,Ce):null,O.Vh=ot,O.Uh=Ke}},O.Lh=void 0,O}W()(y,V);var f=y.prototype;return f.setDecryptData=function(l){Ps&&l&&l.key&&l.method==="SAMPLE-AES"?this.Lh=new Ps(this.Ci,this.di,l):this.Lh=void 0},y.probe=function(l){var p=y.co(l);return!(p<0)},y.co=function(l){for(var p=Math.min(1e3,l.length-564),E=0;E<p;){if(l[E]===71&&l[E+188]===71&&l[E+376]===71)return E;E++}return-1},f.resetInitSegment=function(l){this.Nh=!1,this.Qh=-1,this.He(l.duration),this.Vh=null,this.Uh=null,this.Fh=null,this.Vn=l.duration,this.xh=0,this.Gh=0,this.Kh.aacOverhead=0,V.prototype.resetInitSegment.call(this,l),l.stat=this.Kh},f.append=function(l,p,E,x,H,O){H===void 0&&(H=!1),this.Fe=O,this.Ph=E,this.Hh=p,this.Yh=x,this.Ue||(this.Ue={timeOffset:p,contiguous:E,accurateTimeOffset:x});var Y,ce,Ae,_e,me,Ce=this.Mi,Me=this.Ne,Ge=this.Jh,ke=this.qh,qe=this.io,Xe=this.so,et=this.uo,ot=this.ao,Ke=l.length;this.Nh;var Rt=Ce.pid,wt=Me.pid,ut=this.Qh,yt=Ce.pesData,pt=Me.pesData;if(!l.byteLength&&H)return this.flush(),void this.fo();for(Ke-=(Ke+0)%188,Y=0;Y<Ke;Y+=188)if(l[Y]===71){if(ce=!!(64&l[Y+1]),Ae=((31&l[Y+1])<<8)+l[Y+2],(48&l[Y+3])>>4>1){if((_e=Y+5+l[Y+4])===Y+188)continue}else _e=Y+4;switch(Ae){case Rt:ce&&(yt&&(me=qe(yt,!0))&&me.pts!==void 0&&Xe(me,!1),yt={data:[],size:0}),yt&&(yt.data.push(l.subarray(_e,Y+188)),yt.size+=Y+188-_e);break;case wt:ce&&(pt&&(me=qe(pt))&&me.pts!==void 0&&(Me.codecType===$.c.aac?et(me):ot(me)),pt={data:[],size:0}),pt&&(pt.data.push(l.subarray(_e,Y+188)),pt.size+=Y+188-_e);break;case 0:ce&&(_e+=l[_e]+1),ut=this.Qh=Ge(l,_e);break;case ut:ce&&(_e+=l[_e]+1);var St=ke(l,_e,this.li,!!this.Lh);if(St.video<0&&St.audio<0)return void this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"no track found"));if(!this.Nh){var Qt={};this.Vn&&(Qt.duration=this.Vn),this.Ai.emit(oe.a.METADATA,Qt)}var $t=this.Ye(),_i=this.Ge();St.video>0&&(!ne(Ce.codecType)&&ne(St.codecType)?St.codecType===$.c.hevc?Nt.onHEVCDetected(this.Ci,Ce,this.di,this.li,$t):Nt.onKVCDetected(this.Ci,Ce,this.di,$t):(Ce.codecType!==$.c.h264&&St.codecType===$.c.h264||Ce.codecType!==$.c.av1&&St.codecType===$.c.av1)&&this.Mi.outputRaw&&(this.Ke(!0),this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),this.Mi.outputRaw=!1),St.codecType===$.c.h264?Nt.onAVCDetected(this.Ci,Ce,this.di,this.li,$t):St.codecType===$.c.av1&&Nt.onAV1Detected(this.Ci,Ce,this.di,this.li,$t),Ce.active===!1?Ce.pid=-1:Ce.pid=Rt=St.video,Ce.codecType=St.codecType),St.audio>0&&(typeof _i=="boolean"?this.Ne.active=_i:Me.active=!0,Me.active&&(Me.pid=wt=St.audio),Me.codecType=St.aCodecType),this.Nh=!0;break;case 17:case 8191:break;default:this.Kh.unknownTSPacketCount?this.Kh.unknownTSPacketCount++:this.Kh.unknownTSPacketCount=1}}else this.Di(Object(s.e)(s.b.MUX_ERROR,s.a.PARSING_ERROR,"TS packet did not start with 0x47",{fatal:!1}));yt&&(me=qe(yt,H))&&me.pts!==void 0?(Xe(me,H),Ce.pesData=void 0):(this.Fh&&H&&(this.eo(this.Fh,Ce),this.Fh=null),Ce.pesData=yt),pt&&(me=qe(pt))&&me.pts!==void 0?(Me.codecType===$.c.aac?et(me):ot(me),Me.pesData=void 0):(pt&&pt.size,Me.pesData=pt),(wt>0&&Me.samples.length===0||Rt>0&&Ce.samples.length===0||Rt<=0&&wt<=0)&&!H||(!H&&this.di.gopRemux||this.Ke(H),H&&this.fo())},f.fo=function(){this.Ai.emit(oe.a.PARSED_DATA,{extra:this._i})},f.Ao=function(){var l,p=this.Mi,E=this.Ne;p.pesData&&(l=this.io(p.pesData,!0))&&l.pts!==void 0&&this.so(l,!0),p.pesData=void 0,E.pesData&&(l=this.io(E.pesData))&&l.pts!==void 0&&(E.codecType===$.c.aac?this.uo(l):this.ao(l)),E.pesData=void 0},f.flush=function(){this.Ci.i(Wi,"flush"),this.Ao(),V.prototype.flush.call(this),this.Fh=null},f.He=function(l){V.prototype.He.call(this,l,N.q),this.Mi.audFound=!1,this.Mi.naluState=0},f.oo=function(l){l===void 0&&(l=!1),this.Ue&&this.Ke(l)},f.Ke=function(l){var p;l===void 0&&(l=!1);var E=this.Ne,x=this.Mi;if(this.We(E,x)&&(this.Ze(E,x),this.Xe(E,x,l)&&(!this.zh||l))){(p=this._i)!=null&&p.stat&&(this._i.stat.audioNonMonotonous=this.Gh);var H=!0,O=0,Y=!1;this.Ue&&(H=this.Ue.contiguous,O=this.Ue.timeOffset,Y=this.Ue.accurateTimeOffset),this.Ve&&(this.Ve=!1,this.Ai.emit(oe.a.MEDIA_DEMUX,{type:o.b.TS})),this.Lh?this.vo(E,x,O,H,Y,l):this.De.remux(E,x,O,H,Y,l),this.Ue=void 0}},f.vo=function(l,p,E,x,H,O){var Y=this;O===void 0&&(O=!1),l.samples&&this.Lh?this.Lh.decryptAacSamples(l.samples,0,function(){Y.do(l,p,E,x,H,O)}):this.do(l,p,E,x,H,O)},f.do=function(l,p,E,x,H,O){var Y=this;O===void 0&&(O=!1),p.samples&&this.Lh?this.Lh.decryptAvcSamples(p.samples,0,0,function(){Y.De.remux(l,p,E,x,H,O)}):this.De.remux(l,p,E,x,H,O)},f.$h=function(l,p,E){for(var x=E?p+E:l.byteLength,H=[];x-p>2;){var O=Zo(l,p);H.push(O),p+=2+O.descriptor_length}return H},f._h=function(l,p){var E=this,x=this.Mi,H=this.Zh,O=[],Y=[],ce=this.Fh,Ae=!1;return l.forEach(function(_e){var me;switch(_e.type){case ae.a.HEVC_NAL_IDR_W_RADL:case ae.a.HEVC_NAL_IDR_N_LP:case ae.a.HEVC_NAL_CRA_NUT:E.lo(),Ae=!0,ce||(ce=E.Fh=E.no(!1,p)),ce.key=!0,ce.frame=!0;break;case ae.a.HEVC_NAL_AUD:Ae=!1,x.audFound=!0,ce&&E.eo(ce,x),ce=E.Fh=E.no(!1,p);break;case ae.a.HEVC_NAL_SPS:Ae=!0;var Ce=Lt.parse(_e.data,x.codecType);H.sps&&!Object(q.b)(H.sps.data,Ce.data)&&(E.ah=!0),H.spsList[Ce.sps_id]=Ce,H.sps=Ce;break;case ae.a.HEVC_NAL_PPS:Ae=!0;var Me=Ut.parse(_e.data);H.pps&&!Object(q.b)(H.pps.data,Me.data)&&(E.ah=!0),H.ppsList[Me.pps_id]=Me,H.pps=Me;break;case ae.a.HEVC_NAL_VPS:Ae=!0;var Ge=ai.parse(E.Ci,_e.data);H.vps&&!Object(q.b)(H.vps.data,Ge.data)&&(E.ah=!0),H.vpsList[Ge.vps_id]=Ge,H.vps=Ge;break;case ae.a.HEVC_NAL_SEI_PREFIX:case ae.a.HEVC_NAL_SEI_SUFFIX:O.push.apply(O,Ye.parse(_e.data.subarray(2)));case ae.a.PRIV_NAL_MAGIC_HEVC:if(_e.type===ae.a.PRIV_NAL_MAGIC_HEVC)try{Y.push(Te.parse(_e.data,!1))}catch(ke){E.Ci.w(Wi,"PrivNal parse error "+ke)}default:if(E.lo(),Ae=!0,_e.type===void 0){Ae=!1;break}ce||(ce=E.Fh=E.no(!0,p)),ce.frame=!0}ce&&Ae&&((me=ce.units)==null||me.push(_e))}),ce&&(O.length&&(ce.sei={sei:O,streamTimestamp:Object(bt.c)(ce.originPTS)}),Y.length&&(ce.privNal={info:Y,streamTimestamp:Object(bt.c)(ce.originPTS)})),ce},f.ho=function(l,p){var E,x=this,H=this.Mi,O=this.Wh,Y=[],ce=[],Ae=this.Fh,_e=!1;return l.forEach(function(me){var Ce;switch(me.type){case Pe.H264_NAL_SLICE:x.lo(),E=!0,Ae||(Ae=x.Fh=x.no(!0,p)),Ae.frame=!0;var Me=me.data;if(_e&&Me.length>4){var Ge=Object(b.c)(Me);Object(b.g)(Ge,8),Object(b.h)(Ge);var ke=Object(b.h)(Ge);ke!==2&&ke!==4&&ke!==7&&ke!==9||(Ae.key=!0)}break;case Pe.H264_NAL_IDR_SLICE:x.lo(),E=!0,Ae||(Ae=x.Fh=x.no(!0,p)),Ae.key=!0,Ae.frame=!0;break;case Pe.H264_NAL_SEI:Y.push.apply(Y,Ye.parse(me.data.subarray(1))),E=!0;break;case Pe.PRIV_NAL_MAGIC_H264:try{ce.push(Te.parse(me.data,!0))}catch(et){x.Ci.w(Wi,"PrivNal parse error "+et)}E=!0;break;case Pe.H264_NAL_SPS:E=!0,_e=!0;var qe=Et.parse(me.data);O.sps&&!Object(q.b)(O.sps.data,qe.data)&&(x.ah=!0),O.spsList[qe.sps_id]=qe,O.sps=qe;break;case Pe.H264_NAL_PPS:E=!0;var Xe=Wt.parse(me.data);O.pps&&!Object(q.b)(O.pps.data,Xe.data)&&(x.ah=!0),O.ppsList[Xe.pps_id]=Xe,O.pps=Xe;break;case Pe.H264_NAL_AUD:E=!1,H.audFound=!0,Ae&&x.eo(Ae,H),Ae=x.Fh=x.no(!1,p);break;case Pe.H264_NAL_FILLER_DATA:default:E=!1}Ae&&E&&((Ce=Ae.units)==null||Ce.push(me))}),Ae&&(Y.length&&(Ae.sei={sei:Y,streamTimestamp:Object(bt.c)(Ae.originPTS)}),ce.length&&(Ae.privNal={info:ce,streamTimestamp:Object(bt.c)(Ae.originPTS)})),Ae},f.lo=function(){var l,p=this.Mi;p.decConf&&this.ah&&!this.Ve&&(this.Ci.i(Wi,"remux on paramSets update."),this.oo(!0),this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i));var E=!1;p.decConf&&!this.ah||(p.codecType===$.c.h264?this.Wh.spsList.length&&this.Wh.ppsList.length&&(Nt.updateAVCTrack(this.Ci,p,this.Wh),E=!0):this.Zh.spsList.length&&this.Zh.ppsList.length&&this.Zh.vpsList.length&&(Nt.updateHEVCTrack(this.Ci,p,this.Zh),E=!0)),E&&this.Ai.emit(oe.a.VIDEO_CODEC_DETECTED,{enabled:!!p.active,decoder:p.outputRaw?$.d.wasm:$.d.buildin,codecType:p.codecType||$.c.unknown,bitDepth:p.bitDepth,timeOffset:((l=this.Ue)==null?void 0:l.timeOffset)||0}),this.ah=!1},f.bo=function(){var l,p=this.Fh;if(!p||p.units.length===0){var E=this.Mi.samples;p=E[E.length-1]}if(p){var x=p.units;l=x[x.length-1]}return l},f.ro=function(l){var p,E,x,H,O=0,Y=0,ce=this.Mi.naluState||0,Ae=-1,_e=this.Mi,me=l.byteLength,Ce=me,Me=[],Ge=ce;if(ce===-1)Ae=0,H=ne(_e.codecType)?(126&l[0])>>1:31&l[0],ce=0,O=1;else if(ce>0)for(;Y<4;Y++){var ke=l[Y];if(ke!==0){if(ke===1&&ce>=2){Ae=Y+1,H=ne(_e.codecType)?(126&l[Ae])>>1:31&l[Ae],ce=0;var qe=this.bo();qe&&Ge&&Y<=4-Ge&&qe.state&&(qe.data=qe.data.subarray(0,qe.data.byteLength-Ge));break}Y<me&&(ce=0);break}ce++,O=Y+1}for(;O<Ce;)if((p=l[O+2])===1)if(l[O]===0&&l[O+1]===0){if(ce=O>0&&l[O-1]===0?3:2,O+=3,Ae>=0)x={data:l.subarray(Ae,O-ce-1),type:H||0},Me.push(x);else{var Xe=this.bo();if(Xe&&(E=O-ce-1)>0){var et=new Uint8Array(Xe.data.byteLength+E);et.set(Xe.data,0),et.set(l.subarray(0,E),Xe.data.byteLength),Xe.data=et}}O<me?(Ae=O,H=ne(_e.codecType)?(126&l[O])>>1:31&l[O],ce=0):ce=-1}else O+=3;else p===0?O++:O+=3;for(var ot=me-1;ot>me-4&&ot>=Y&&l[ot]===0;ot--)ce++;if(Ae>=0&&ce>=0&&Ae<me&&(x={data:l.subarray(Ae,me),type:H||0,state:ce},Me.push(x)),Me.length===0){var Ke=this.bo();if(Ke){var Rt=new Uint8Array(Ke.data.byteLength+l.byteLength);Rt.set(Ke.data,0),Rt.set(l,Ke.data.byteLength),Ke.data=Rt}}return _e.naluState=ce,Me},I()(y,[{key:"minChunkSize",get:function(){return 188}},{key:"encryptedChunkSize",get:function(){return 752}}],[{key:"probeSize",get:function(){return 752}}])}(de),Us="demuxer-inline",Ha=function(){function V(f,l,p,E,x){this.Ai=void 0,this.di=void 0,this.po=void 0,this.li=void 0,this.kh=void 0,this.mo=null,this._t=new d.a,this.yo=void 0,this.Ci=void 0,this._o=[],this.Co=void 0,this.De=void 0,this.Io=void 0,this.Oo=0,this.Ai=f,this.li=l,this.di=p,this.po=E,this.Ci=x,Bt&&this._o.push({Demux:Bt,Remux:rr.b,type:o.b.FLV}),Ti&&this._o.push({Demux:Ti,Remux:rr.b,type:o.b.MP4}),Gr&&this._o.push({Demux:Gr,Remux:rr.b,type:o.b.IVF}),ea&&this._o.push({Demux:ea,Remux:rr.b,type:o.b.TS}),Ms&&this._o.push({Demux:Ms,Remux:rr.b,type:o.b.RAW}),this.Oo=this._o.reduce(function(H,O){return Math.max(O.Demux.probeSize,H)},0)}var y=V.prototype;return y.pushMuxData=function(f,l,p,E,x,H,O,Y,ce,Ae){var _e=this,me=f;if((O||H)&&this._t.clear(),Ae.progress&&this.Oo)if(this._t.put(f),ce)me=this._t.get(this._t.unreadLen);else{var Ce=Math.floor(this._t.unreadLen/this.Oo)*this.Oo;if(!(Ce>=this.Oo))return void(this.Io||(this.Io={contiguous:x,trackSwitch:H,discontinuity:O,accurateTimeOffset:Y}));me=this._t.get(Ce)}else this._t.unreadLen&&(this._t.put(f),me=this._t.get(this._t.unreadLen));if(me)if(f=me,this.Io&&(x=this.Io.contiguous,H=this.Io.trackSwitch,O=this.Io.discontinuity,Y=this.Io.accurateTimeOffset,this.Io=void 0),f.byteLength>0&&l&&l.key&&l.method==="AES-128"){var Me,Ge=this.kh;!Ge&&ea&&F&&(Ge=this.kh=new F(this.Ci,this.di,{removePKCS7Padding:ce})),O&&(this.mo=null);var ke=this.mo?this.mo:l.iv;(Me=Ge)==null||Me.decrypt(f,l.key.buffer,ke.buffer,function(qe){ce?_e.mo=null:(_e.mo=new Uint8Array(16),_e.mo.set(f.subarray(f.byteLength-16),0)),_e.wo(new Uint8Array(qe),l,p,E,x,H,O,Y,ce,Ae)})}else l&&ce&&(this.mo=null),this.wo(f,l,p,E,x,H,O,Y,ce,Ae)},y.flush=function(){this.Co&&this.Co.flush(),this._t.clear()},y.end=function(){this.Ai.emit(oe.a.LOAD_END,{})},y.updateConfig=function(f){var l;this.Ci.i(Us,"update config",f),(l=this.Co)==null||l.updateConfig(f)},y.Eo=function(f,l){if(!this.Co||l&&this.yo&&!this.yo(f)){for(var p=this.Ai,E=this.li,x=this.di,H=0,O=this._o.length;H<O;H++){var Y=this._o[H],ce=Y.Demux.probe;if(ce(f)){this.De=new Y.Remux(this.Ci,p,x,E,Y.type===o.b.FLV?"":this.po),this.Co=new Y.Demux(this.Ci,p,this.De,x,E),this.Ai.emit(oe.a.DEMUXER_DETECTED,{type:Y.type}),this.yo=ce;break}}if(!this.Co)return void this.Ai.emit(oe.a.ERROR,Object(s.e)(s.b.MUX_ERROR,s.a.DEMUX_NOT_FOUND,"no demux matching with content found"))}},y.wo=function(f,l,p,E,x,H,O,Y,ce,Ae){try{this.Co||this.Eo(f,!0);var _e=this.Co,me=this.De;if(!me||!_e)return;this.Oo=l?_e.encryptedChunkSize||16:_e.minChunkSize||0,(H||O)&&(_e.resetInitSegment(Ae,p),me.resetInitSegment(Ae)),O&&(_e.resetTimeStamp(),me.resetTimeStamp()),l&&Object.prototype.hasOwnProperty.call(_e,"setDecryptData")&&_e.setDecryptData(l),_e.append(f,E,x,Y,ce,Ae.fragSn)}catch(Ce){this.Ci.i(Us,Ce),this.Ai.emit(oe.a.ERROR,Object(s.e)(s.b.MUX_ERROR,s.a.REMUX_ERROR,Ce.message))}},V}();i.a=Ha},function(r,i,n){var o=n(5),s=n.n(o),d=n(12),m=n(0),A=n(22),T=n(25),C="yuv2rgb-helper",h=new Float32Array([0,-.501960814,-.501960814,1,0,0,1,0,0,1,0,0]),F=new Float32Array([-.0627451017,-.501960814,-.501960814,1.1644,0,1.596,1.1644,-.3918,-.813,1.1644,2.0172,0]),w=new Float32Array([0,-.501960814,-.501960814,1,0,1.4075,1,-.3455,-.7169,1,1.779,0]),I=new Float32Array([-.0627451017,-.501960814,-.501960814,1.164,-.013561232000000003,1.365248481,1.164,-.345441461,-.756825597,1.164,2.059156233,.010008336]),S=new Float32Array([0,-.501960814,-.501960814,1,-.011864761000000005,1.197778023,1,-.302259224,-.6617980229999999,1,1.801888929,.008744828]),W=new Float32Array([-.0627451017,-.501960814,-.501960814,1.1644,0,1.7927,1.1644,-.2132,-.5329,1.1644,2.1124,0]),j=new Float32Array([0,-.501960814,-.501960814,1,0,1.581,1,-.1881,-.47,1,1.8629,0]),N=new Float32Array([-.062561095,-.500488759,-.500488759,1.1678,0,1.6836,1.1678,-.1879,-.6523,1.1678,2.1481,0]),K=new Float32Array([0,-.500488759,-.500488759,1,0,1.476,1,-.1647,-.5719,1,1.8832,0]),z=function(){function Ee(G,te){this.Ci=void 0,this.jo={rotation:0},this.ko=void 0,this.Ci=G,this.ko=te==null?void 0:te.preferCanvasColorSpace}var pe=Ee.prototype;return pe.update=function(G,te,ie){ie===void 0&&(ie=0);var ee,Te=G.format.colorInfo||te;return Object(d.f)(this.jo.colorInfo,Te)||(this.jo.matrix=this.Mo(G,Te),this.Ci.i(C,"color info update",te)),ee=this.jo.matrix?this.jo.matrix:this.jo.matrix=this.Mo(G,Te),this.jo.buffer=G,this.jo.colorInfo=te=Te,this.jo.rotation=ie,ee},pe.destroy=function(){this.Ci.i(C,"destroy"),this.jo.buffer=void 0,this.jo.colorInfo=void 0},pe.updatePreferCanvasColorSpace=function(G){var te=(this.ko||"srgb")!==(G||"srgb");return this.ko=G,te},pe.Mo=function(G,te){return this.Ci.i(C,"generate yuv matrix color info",te),G.format.chroma===T.a.AV_PIX_FMT_MONO?(this.Ci.i(C,"generate yuv matrix: mono."),h):(te&&(te.matrixCoefficients===d.c.AVCOL_SPC_BT470BG?(this.Ci.i(C,"generate yuv matrix. color: BT470BG range: "+d.b[te.colorRange]+" matrix bt601. full: "+(te.colorRange===d.b.AVCOL_RANGE_JPEG)),ie=te.colorRange===d.b.AVCOL_RANGE_JPEG?S:I):te.matrixCoefficients===d.c.AVCOL_SPC_SMPTE170M?(this.Ci.i(C,"generate yuv matrix. color: SMPTE170M range: "+d.b[te.colorRange]+" matrix bt601. full: "+(te.colorRange===d.b.AVCOL_RANGE_JPEG)),ie=te.colorRange===d.b.AVCOL_RANGE_JPEG?w:F):te.matrixCoefficients===d.c.AVCOL_SPC_BT709?(this.Ci.i(C,"generate yuv matrix. color: BT709 range: "+d.b[te.colorRange]+" matrix bt709. full: "+(te.colorRange===d.b.AVCOL_RANGE_JPEG)),ie=te.colorRange===d.b.AVCOL_RANGE_JPEG?j:W):te.matrixCoefficients===d.c.AVCOL_SPC_BT2020_NCL&&(this.Ci.i(C,"generate yuv matrix. color: BT2020_NCL range: "+d.b[te.colorRange]+" matrix bt2020. full: "+(te.colorRange===d.b.AVCOL_RANGE_JPEG)),ie=te.colorRange===d.b.AVCOL_RANGE_JPEG?K:N)),ie||(this.Ci.i(C,"generate yuv matrix. color: "+(te?d.c[te.matrixCoefficients]:"unknown")+" bits: "+G.y.bits+" height: "+G.format.height),G.y.bits>8?(this.Ci.i(C,"generate yuv matrix. matrix bt2020"),ie=N):G.format.height<=576?(this.Ci.i(C,"generate yuv matrix. matrix 601 limit"),ie=F):(this.Ci.i(C,"generate yuv matrix. matrix 709 limit"),ie=W)),ie);var ie},s()(Ee,[{key:"preferCanvasColorSpace",get:function(){return this.ko}},{key:"colorInfo",get:function(){return this.jo.colorInfo}},{key:"drawData",get:function(){return this.jo}}])}(),B=n(21),J=n(32),be=n(6),X=n(54),ye=n.n(X),Be="canvas2d-frame",Ve=function(){function Ee(G,te,ie,ee){this.Ci=void 0,this.So=void 0,this.Bo=void 0,this.To=A.a.contain,this.Pi=void 0,this.Do=void 0,this.Ro=void 0,this.Lo=0,this.No="notSet",this.Qo=void 0,this.xo=void 0,this.Vo=void 0,G.i(Be,"constructor colorSpace: "+(ie==null?void 0:ie.preferCanvasColorSpace)),this.So=te,this.Ci=G,this.Bo=new z(G,ie),this.Bo.updatePreferCanvasColorSpace(this.Bo.preferCanvasColorSpace),this.Pi=Object(B.a)(),this.Do=this.Pi.getContext("2d"),this.Qo=ee||new ye.a({logger:G}),this.Qo.readyState==="complete"?this.No="complete":this.Qo.readyState==="loading"&&(this.No="loading")}var pe=Ee.prototype;return pe.drawFrame=function(G,te,ie){var ee=this;if(this.Do&&this.Pi){var Te,Se,Ye=this.Bo.update(G,te,ie);if(te=this.Bo.colorInfo,this.Lo=ie||0,this.Ro&&(Te=this.Ro).width===G.format.width&&Te.height===G.format.height||(this.Ro=Te=this.Uo(this.Pi,G)),this.No==="notSet")return this.No="loading",this.Qo.initMap(Ye,((Se=te)==null?void 0:Se.transferCharacteristics)||d.d.AVCOL_TRC_UNSPECIFIED,G.y.bits).then(function(ze){return ee.No="complete",ze&&(ee._yuv2rgb(G,Te.data),ee.Fo(Te),ee.Po()),ze});this.No!=="loading"&&(this._yuv2rgb(G,Te.data),this.Fo(Te),this.Po())}},pe.Fo=function(G){var te=this.xo,ie=this.Vo,ee=this.Do,Te=this.Lo;te&&ie?(ie.clearRect(0,0,te.width,te.height),ie.putImageData(G,0,0),ee&&(ee.clearRect(0,0,ee.canvas.width,ee.canvas.height),Te===90?(ee.rotate(Math.PI/2),ee.drawImage(te,0,0,te.width,te.height,0,-ee.canvas.width,ee.canvas.height,ee.canvas.width),ee.resetTransform()):Te===270?(ee.rotate(1.5*Math.PI),ee.drawImage(te,0,0,te.width,te.height,-ee.canvas.height,0,ee.canvas.height,ee.canvas.width),ee.resetTransform()):Te===180?(ee.rotate(Math.PI),ee.drawImage(te,0,0,te.width,te.height,-ee.canvas.width,-ee.canvas.height,ee.canvas.width,ee.canvas.height),ee.resetTransform()):ee.drawImage(te,0,0,te.width,te.height,0,0,ee.canvas.width,ee.canvas.height))):ee==null||ee.putImageData(G,0,0)},pe._yuv2rgb=function(G,te){this.Qo.yuv2rgb(G.y.bytes,G.u.bytes,G.v.bytes,te,G.format.width,G.format.height,G.format.chroma,G.y.bits)},pe.setPictMode=function(G){this.To!==G&&(this.Ci.i(Be,"update pict mode",G),this.To=G,this.Po())},pe.updatePreferCanvasColorSpace=function(G){var te=this.Bo.updatePreferCanvasColorSpace(G),ie=this.Bo.drawData;return this.Pi&&ie.buffer&&(this.Ro=this.Uo(this.Pi,ie.buffer)),te},pe.clear=function(){this.Ci.i(Be,"clear"),this.So.clearRect(0,0,this.So.canvas.width,this.So.canvas.height)},pe.destroy=function(){this.Ci.i(Be,"destroy"),this.Qo.destroy(),this.Bo.destroy(),this.Xi()},pe.Xi=function(){this.Pi=void 0,this.Do=void 0,this.xo=void 0,this.Vo=void 0},pe.Po=function(){if(this.Pi){var G=0,te=0,ie=this.Pi.width,ee=this.Pi.height,Te=0,Se=0,Ye=this.So.canvas.width,ze=this.So.canvas.height,it=this.So,ct=ie/ee,nt=Ye/ze;this.To===A.a.contain?ct>nt?ze-=2*(Se=(ze-Ye/ct)/2):Ye-=2*(Te=(Ye-ze*ct)/2):this.To===A.a.cover&&(ct>nt?ie-=2*(G=(ie-ee*nt)/2):ee-=2*(te=(ee-ie/nt)/2)),it.clearRect(0,0,it.canvas.width,it.canvas.height),it.drawImage(this.Pi,G,te,ie,ee,Te,Se,Ye,ze)}},pe.Uo=function(G,te){this.Ci.i(Be,"init image data",te.format.width,te.format.height,this.Bo.preferCanvasColorSpace);for(var ie=this.Bo.preferCanvasColorSpace?{colorSpace:this.Bo.preferCanvasColorSpace}:void 0,ee=be.a.firefox?new ImageData(te.format.width,te.format.height):new ImageData(te.format.width,te.format.height,ie),Te=te.format.width*te.format.height,Se=1;Se<Te;Se++)ee.data[4*Se-1]=255;var Ye=this.Ho(te);if(this.Lo===90||this.Lo===270||this.Lo===180||Ye){this.xo||(this.xo=Object(B.a)(),this.Vo=this.xo.getContext("2d")),this.xo.width=te.format.width,this.xo.height=te.format.height;var ze=te.format.width,it=te.format.height;if(Ye){var ct=Object(J.a)(te.format.width,te.format.height,te.format.sar);ze=ct.width,it=ct.height}if(this.Lo===90||this.Lo===270){var nt=ze;ze=it,it=nt}G.width=ze,G.height=it}else G.width=te.format.width,G.height=te.format.height;return ee},pe.Ho=function(G){return!(!G.format.sar||G.format.sar.width===G.format.height)},s()(Ee,[{key:"preferCanvasColorSpace",get:function(){return this.Bo.preferCanvasColorSpace}},{key:"yuv2rgbLib",get:function(){return this.Qo}},{key:"ready",get:function(){return this.No==="complete"}},{key:"type",get:function(){return m.b.canvas2d}},{key:"drawData",get:function(){return this.Bo.drawData}},{key:"imageData",get:function(){var G;return(G=this.Do)==null?void 0:G.getImageData(0,0,this.Do.canvas.width,this.Do.canvas.height)}}])}(),je=n(8),we=n.n(je),ue=n(10),L=n.n(ue),D=n(14),le=n(3),oe=n(44),Re=n(2),Oe=`
precision lowp float;
attribute vec2 aPosition;
attribute vec2 aLumaPosition;
attribute vec2 aChromaPosition;
varying vec2 vLumaPosition;
varying vec2 vChromaPosition;
uniform mat3 uMatrix;
void main() {
gl_Position = vec4((uMatrix * vec3(aPosition, 1)).xy, 0, 1);
vLumaPosition = aLumaPosition;
vChromaPosition = aChromaPosition;
}
`,de=`
#define EOTF_C1 .8359375
#define EOTF_C2 18.8515625
#define EOTF_C3 18.6875
#define EOTF_HLG_GAMMA 0.2
#define _EOTF_HLG_A 0.17883277
#define _EOTF_HLG_B 0.28466892
#define _EOTF_HLG_C 0.55991073
#define MAIN_A 2.51
#define MAIN_B 0.03
#define MAIN_C 1.23
#define MAIN_D 0.59
#define MAIN_E 0.14
#define MAIN_ADAPTED_LUM 0.001
precision lowp float;
const vec3 eotf_m1 = vec3(1.0 / .1593017578125);
const vec3 eotf_m2 = vec3(1.0 / 78.84375);
const vec3 tonemapping_hlg_m1 = vec3(1.0 / 1.3);
const vec3 main_m1 = vec3(0.555555555556);
const vec3 main_m2 = vec3(2.0);
// bt2020 to bt709
const mat3 mat_xyz_to_rgbp3 = mat3(
1.66049100210843, -0.124550474521591, -0.0181507633549054,
-0.587641138788548, 1.13289989712596, -0.100578898008008,
-0.0728498633198855, -0.00834942260436943, 1.11872966136291
);
float _eotf_hlg(float x) {
if (x < 0.5) {
return pow(x / 0.5, 2.0) / 12.0;
} else {
return (exp((x - _EOTF_HLG_C) / _EOTF_HLG_A) + _EOTF_HLG_B) / 12.0;
}
}
vec3 eotf_hlg(vec3 i) {
vec3 res;
float Y = 0.2627 * res.x + 0.6780 * res.y + 0.0593 * res.z;
res = pow(Y, EOTF_HLG_GAMMA) * res;
res.x = _eotf_hlg(i.x);
res.y = _eotf_hlg(i.y);
res.z = _eotf_hlg(i.z);
return res;
}
vec3 eotf(vec3 i) {
i = max(i, 1e-10);
vec3 input_m2 = pow(i, eotf_m2);
return pow((input_m2 - EOTF_C1) / (EOTF_C2 - EOTF_C3 * input_m2), eotf_m1) * 10000.0;
}
vec3 tonemapping_hlg(vec3 i) {
vec3 res = pow(i, tonemapping_hlg_m1);
return res;
}
float _trc_gamma(float i) {
if (i < 0.018) {
return 4.5 * i;
} else {
return 1.099 * pow(i, 0.45);
}
}
vec3 trc_gamma(vec3 i) {
vec3 res;
res.x = _trc_gamma(i.x);
res.y = _trc_gamma(i.y);
res.z = _trc_gamma(i.z);
return res;
}
uniform sampler2D uTextureY;
uniform sampler2D uTextureCb;
uniform sampler2D uTextureCr;
uniform vec3 uColorCovYOffset;
uniform mat3 uColorConversion;
uniform int uColorTrc;
uniform int uBitsPerPixel;
varying vec2 vLumaPosition;
varying vec2 vChromaPosition;
void main() {
vec3 yuv;
if (uBitsPerPixel > 8) {
float normalized = pow(2.0, float(uBitsPerPixel - 8));
yuv.x = (texture2D(uTextureY, vLumaPosition).r + texture2D(uTextureY, vLumaPosition).a * 256.0) / normalized;
yuv.y = (texture2D(uTextureCb, vChromaPosition).r + texture2D(uTextureCb, vChromaPosition).a * 256.0) / normalized;
yuv.z = (texture2D(uTextureCr, vChromaPosition).r + texture2D(uTextureCr, vChromaPosition).a * 256.0) / normalized;
yuv += uColorCovYOffset;
vec3 rgb = yuv * uColorConversion;
vec3 rgb_lum;
if (uColorTrc == 16) { // HDR10 or HDR10+
// 电光转换(EOTF)
rgb_lum = eotf(rgb);
//tone mapping
vec3 tmp = rgb_lum * MAIN_ADAPTED_LUM;
rgb_lum = tmp * (tmp * MAIN_A + MAIN_B) / (tmp * (tmp * MAIN_C + MAIN_D) + MAIN_E) / 1.3;
rgb_lum = pow(rgb_lum, main_m1) * pow(main_m2, rgb_lum) / 2.0; //g=1.8
//调节饱和度
float gray = (rgb_lum.x + rgb_lum.y + rgb_lum.z) / 2.0;
rgb_lum = rgb_lum + (rgb_lum * 1.5 - gray) * 0.12;
} else { // HLG
rgb_lum = eotf_hlg(rgb);
rgb_lum = tonemapping_hlg(rgb_lum);
}
vec3 rgbp3 = trc_gamma(mat_xyz_to_rgbp3 * rgb_lum);
gl_FragColor = vec4(rgbp3, 1.0);
} else {
yuv.x = texture2D(uTextureY, vLumaPosition).x;
yuv.y = texture2D(uTextureCb, vChromaPosition).x;
yuv.z = texture2D(uTextureCr, vChromaPosition).x;
yuv += uColorCovYOffset;
gl_FragColor = vec4(clamp(yuv * uColorConversion, 0.0, 1.0), 1.0);
}
}`,$=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),ge=new Float32Array([1,-0,0,0,1,0,0,0,1]),Pe=new Float32Array([0,-1,0,1,0,0,0,0,1]),ae=new Float32Array([-1,0,0,0,-1,0,0,0,1]),q=new Float32Array([0,1,0,-1,0,0,0,0,1]),b="webgl-frame",ve=function(){function Ee(G,te,ie){this.Yi=void 0,this.Ci=void 0,this.Bo=void 0,this.Yo={},this.Go={},this.Ko=null,this.Zo=null,this.Wo=0,this.Xo=null,this.zo=0,this.Jo=null,this.qo=0,this.$o=null,this.ta=null,this.ia=null,this.ea=null,this.na=null,this.sa=null,this.ra=null,this.ha=null,this.To=A.a.cover,G.i(b,"constructor colorSpace: "+(ie==null?void 0:ie.preferCanvasColorSpace)),this.Yi=te,this.Ci=G,this.Bo=new z(G,ie),Object(B.d)(te,this.Bo.preferCanvasColorSpace)}Ee.getRotMatrix=function(G){switch(G){case 90:return Pe;case 180:return ae;case 270:return q}return ge},Ee.oa=function(G,te){G.bindTexture(G.TEXTURE_2D,te),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_WRAP_S,G.CLAMP_TO_EDGE),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_WRAP_T,G.CLAMP_TO_EDGE),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MIN_FILTER,G.LINEAR),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MAG_FILTER,G.LINEAR)};var pe=Ee.prototype;return pe.destroy=function(){this.Ci.i(b,"destroy");var G=this.Yi;if(G){this.aa(),this.Ci.i(b,"destroy. lose ctx");var te=G.getExtension("WEBGL_lose_context");te&&te.loseContext()}this.Bo.destroy()},pe.setPictMode=function(G){if(this.To!==G){this.Ci.i(b,"update pict mode",G),this.To=G,this.clear();var te=this.Bo.drawData;te.buffer&&this.drawFrame(te.buffer,te.colorInfo,te.rotation)}},pe.setWebGLCtx=function(G,te){te===void 0&&(te=A.a.contain),this.Ci.i(b,"set webgl",G,G!==this.Yi),this.To=te,G!==this.Yi&&(this.aa(),this.Yi=G)},pe.updatePreferCanvasColorSpace=function(G){return Object(B.d)(this.Yi,G),this.Bo.updatePreferCanvasColorSpace(G)},pe.ua=function(G){if(this.Yo[G])return this.Yo[G];var te=this.Yi;if(!te)return null;var ie=te.createTexture();return ie?(this.Yo[G]=ie,ie):null},pe.ca=function(G,te,ie,ee,Te){var Se=this.Yi;if(Se){var Ye=this.ua(G);Se.activeTexture(Se.TEXTURE0),Ee.oa(Se,Ye),Se.texImage2D(Se.TEXTURE_2D,0,ee>8?Se.LUMINANCE_ALPHA:Se.LUMINANCE,te,ie,0,ee>8?Se.LUMINANCE_ALPHA:Se.LUMINANCE,Se.UNSIGNED_BYTE,Te)}},pe.fa=function(){this.Ci.i(b,"init");var G=this.Yi;G&&(this.Ko=this.Aa(Oe,de),this.Ko&&(this.Zo=G.createBuffer(),G.bindBuffer(G.ARRAY_BUFFER,this.Zo),G.bufferData(G.ARRAY_BUFFER,$,G.STATIC_DRAW),this.Wo=G.getAttribLocation(this.Ko,"aPosition"),this.Xo=G.createBuffer(),this.zo=G.getAttribLocation(this.Ko,"aLumaPosition"),this.Jo=G.createBuffer(),this.qo=G.getAttribLocation(this.Ko,"aChromaPosition"),this.$o=G.getUniformLocation(this.Ko,"uColorCovYOffset"),this.ia=G.getUniformLocation(this.Ko,"uColorConversion"),this.ea=G.getUniformLocation(this.Ko,"uColorTrc"),this.na=G.getUniformLocation(this.Ko,"uBitsPerPixel"),this.ta=G.getUniformLocation(this.Ko,"textureSize"),this.sa=G.getUniformLocation(this.Ko,"uMatrix"),G.pixelStorei(G.UNPACK_ALIGNMENT,1)))},pe.va=function(G,te,ie){var ee=this.Yi;ee&&this.Ko&&(ee.activeTexture(te),this.Yo[G]&&ee.bindTexture(ee.TEXTURE_2D,this.Yo[G]),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_S,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_WRAP_T,ee.CLAMP_TO_EDGE),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_MIN_FILTER,ee.LINEAR),ee.texParameteri(ee.TEXTURE_2D,ee.TEXTURE_MAG_FILTER,ee.LINEAR),ee.uniform1i(ee.getUniformLocation(this.Ko,G),ie))},pe.Aa=function(G,te){var ie=this.Yi;if(ie){this.Ci.i(b,"init program",ie);var ee=this.da(ie.VERTEX_SHADER,G),Te=this.da(ie.FRAGMENT_SHADER,te);this.ra=ee,this.ha=Te;var Se=ie.createProgram();if(Se&&ee&&Te){if(ie.attachShader(Se,ee),ie.attachShader(Se,Te),ie.linkProgram(Se),!ie.getProgramParameter(Se,ie.LINK_STATUS)){var Ye=ie.getProgramInfoLog(Se);throw ie.deleteProgram(Se),new Error("GL program linking failed: "+Ye)}return Se}}return null},pe.da=function(G,te){var ie=this.Yi;if(ie){var ee=ie.createShader(G);if(ee){if(ie.shaderSource(ee,te),ie.compileShader(ee),!ie.getShaderParameter(ee,ie.COMPILE_STATUS)){var Te=ie.getShaderInfoLog(ee);throw ie.deleteShader(ee),new Error("GL shader compilation for "+G+" failed: "+Te)}return ee}}return null},pe.drawFrame=function(G,te,ie){ie===void 0&&(ie=0);var ee=this.Yi;if(ee){var Te=G.format,Se=G.y.bits>8?2:1,Ye=!this.Ko||this.la(G.format),ze=this.Bo.update(G,te,ie);te=this.Bo.colorInfo,Ye&&this.clear(),this.Ko||this.fa(),Ye&&(this.ba(this.Xo,this.zo,G.y.stride/Se,G.format),this.ba(this.Jo,this.qo,G.u.stride*Te.width/Te.chromaWidth/Se,G.format)),this.ca("uTextureY",G.y.stride/Se,G.format.height,G.y.bits,G.y.bytes),this.ca("uTextureCb",G.u.stride/Se,G.format.chromaHeight,G.u.bits,G.u.bytes),this.ca("uTextureCr",G.v.stride/Se,G.format.chromaHeight,G.v.bits,G.v.bytes),ee.useProgram(this.Ko),this.To===A.a.contain?ee.viewport((ee.canvas.width-Te.displayWidth)/2,(ee.canvas.height-Te.displayHeight)/2,Te.displayWidth,Te.displayHeight):this.To===A.a.cover?ee.canvas.width/ee.canvas.height>Te.displayWidth/Te.displayHeight?ee.viewport(0,(ee.canvas.height-Te.displayHeight*(ee.canvas.width/Te.displayWidth))/2,ee.canvas.width,ee.canvas.height*(ee.canvas.width/Te.displayWidth)):ee.viewport((ee.canvas.width-Te.displayWidth*(ee.canvas.height/Te.displayHeight))/2,0,ee.canvas.width*(ee.canvas.height/Te.displayHeight),ee.canvas.height):ee.viewport(0,0,ee.canvas.width,ee.canvas.height),this.va("uTextureY",ee.TEXTURE0,0),this.va("uTextureCb",ee.TEXTURE1,1),this.va("uTextureCr",ee.TEXTURE2,2),te&&ee.uniform1i(this.ea,te.transferCharacteristics),ee.uniform1i(this.na,G.y.bits),ee.uniformMatrix3fv(this.sa,!1,Ee.getRotMatrix(ie)),ee.uniform3fv(this.$o,ze.subarray(0,3)),ee.uniformMatrix3fv(this.ia,!1,ze.subarray(3,12));var it=new Float32Array([Te.width,Te.height]);ee.uniform2fv(this.ta,it),ee.bindBuffer(ee.ARRAY_BUFFER,this.Zo),ee.enableVertexAttribArray(this.Wo),ee.vertexAttribPointer(this.Wo,2,ee.FLOAT,!1,0,0),ee.bindBuffer(ee.ARRAY_BUFFER,this.Xo),ee.enableVertexAttribArray(this.zo),ee.vertexAttribPointer(this.zo,2,ee.FLOAT,!1,0,0),ee.bindBuffer(ee.ARRAY_BUFFER,this.Jo),ee.enableVertexAttribArray(this.qo),ee.vertexAttribPointer(this.qo,2,ee.FLOAT,!1,0,0),ee.drawArrays(ee.TRIANGLES,0,$.length/2),ee.finish()}},pe.ba=function(G,te,ie,ee){var Te=this.Yi;if(Te){var Se=ee.cropLeft/ie,Ye=(ee.cropLeft+ee.cropWidth)/ie,ze=(ee.cropTop+ee.cropHeight)/ee.height,it=ee.cropTop/ee.height,ct=new Float32Array([Se,ze,Ye,ze,Se,it,Se,it,Ye,ze,Ye,it]);Te.bindBuffer(Te.ARRAY_BUFFER,G),Te.bufferData(Te.ARRAY_BUFFER,ct,Te.STATIC_DRAW)}},pe.clear=function(){var G=this.Yi;G&&(G.viewport(0,0,G.canvas.width,G.canvas.height),G.clearColor(0,0,0,0),G.clear(G.COLOR_BUFFER_BIT))},pe.la=function(G){var te,ie=(te=this.Bo.drawData.buffer)==null?void 0:te.format;return!(ie&&G.width===ie.width&&G.height===ie.height&&G.chromaWidth===ie.chromaWidth&&G.chromaHeight===ie.chromaHeight)},pe.aa=function(){var G=this;this.Ci.i(b,"clear WebGL");var te=this.Yi;te&&(te.disableVertexAttribArray(this.Wo),te.disableVertexAttribArray(this.zo),te.disableVertexAttribArray(this.qo),this.Zo&&te.deleteBuffer(this.Zo),this.Xo&&te.deleteBuffer(this.Xo),this.Jo&&te.deleteBuffer(this.Jo),Object.keys(this.Yo).forEach(function(ie){G.Yi&&G.Yo[ie]&&G.Yi.deleteTexture(G.Yo[ie]),delete G.Yo[ie]}),Object.keys(this.Go).forEach(function(ie){G.Yi&&G.Go[ie]&&G.Yi.deleteFramebuffer(G.Go[ie]),delete G.Go[ie]}),this.Ko&&te.deleteProgram(this.Ko),this.ra&&te.deleteShader(this.ra),this.ha&&te.deleteShader(this.ha),this.Ko=null)},s()(Ee,[{key:"ready",get:function(){return!0}},{key:"preferCanvasColorSpace",get:function(){return this.Bo.preferCanvasColorSpace}},{key:"type",get:function(){return m.b.webgl}},{key:"drawData",get:function(){return this.Bo.drawData}},{key:"imageData",get:function(){if(this.Yi){var G=new ImageData(this.Yi.canvas.width,this.Yi.canvas.height);return this.Yi.readPixels(0,0,this.Yi.canvas.width,this.Yi.canvas.height,this.Yi.RGBA,this.Yi.UNSIGNED_BYTE,G.data),G}}}])}(),U="canvas-renderer-screenshot",M=function(Ee){function pe(te,ie){var ee;return(ee=Ee.call(this)||this).Ci=void 0,ee.Ai=void 0,ee.Pi=void 0,ee.Qo=void 0,ee.pa=void 0,ee.Ci=te,ee.Ai=ie,ee}L()(pe,Ee);var G=pe.prototype;return G.screenshot=function(te,ie){var ee,Te,Se=te.type,Ye=te.drawData;this.Ci.i(U,"screenshot type: "+Se+" id:"+(ie==null?void 0:ie.id)+" pts: "+((ee=Ye.buffer)==null?void 0:ee.format.pts));var ze={pts:((Te=Ye.buffer)==null?void 0:Te.format.pts)||-1};if(ie!=null&&ie.id&&(ze.id=ie.id),!Ye.buffer)return this.Ci.i(U,"screenshot type: "+Se+" id:"+(ie==null?void 0:ie.id)+" error. empty yuv"),ze.errorCode=le.a.SCREENSHOT_EMPTY_DATA_ERROR,ze.errorMessage="empty yuv",void this.Ai.emit(Re.a.SCREENSHOT,we()(ze,{errorCode:le.a.SCREENSHOT_EMPTY_DATA_ERROR,errorMessage:"empty yuv"}));this.Pi||(this.Pi=Object(B.a)());var it=this.Pi;if(this.ma(Ye.buffer.format.width,Ye.buffer.format.height,Ye.rotation),this.Qo?this.Qo.updatePreferCanvasColorSpace(ie==null?void 0:ie.colorSpace):(this.Ci.i(U,"create frame sink: "+Se),this.Qo=this.ga(it,Se,te.yuv2rgbLib)),this.Qo){var ct,nt={width:Ye.buffer.format.displayWidth,height:Ye.buffer.format.displayHeight};Ye.buffer.format.displayHeight=it.height,Ye.buffer.format.displayWidth=it.width;try{this.Qo.drawFrame(Ye.buffer,Ye.colorInfo,Ye.rotation)}catch(Wt){this.Ai.emit(Re.a.SCREENSHOT,we()(ze,{errorCode:le.a.SCREENSHOT_CREATE_IMG_ERROR,errorMessage:"draw frame error"}))}Ye.buffer.format.displayHeight=nt.height,Ye.buffer.format.displayWidth=nt.width,this.Qo.type===m.b.canvas2d?ct=this.Qo.imageData:(this.pa||(this.pa=new oe.a(this.Ci),this.O.push(this.pa)),ct=this.pa.copyImageData(it,Ye.buffer.format.sar,Ye.rotation,ie==null?void 0:ie.colorSpace)),ct?this.Ai.emit(Re.a.SCREENSHOT,we()(ze,{image:ct})):this.Ai.emit(Re.a.SCREENSHOT,we()(ze,{errorCode:le.a.SCREENSHOT_CREATE_IMG_ERROR,errorMessage:"image data null"}))}else this.Ai.emit(Re.a.SCREENSHOT,we()(ze,{errorCode:le.a.SCREENSHOT_INIT_ERROR,errorMessage:"create frame sink error"}))},G.destroy=function(){var te;this.Ci.i(U,"destroy"),(te=this.Qo)==null||te.destroy(),this.Pi=void 0,Ee.prototype.destroy.call(this)},G.ma=function(te,ie,ee){var Te=this.Pi;Te&&(ee===90||ee===270?(Te.width=ie,Te.height=te):(Te.width=te,Te.height=ie))},G.ga=function(te,ie,ee,Te){this.Ci.i(U,"init frameSink type:"+ie+" colorSpace:"+(Te==null?void 0:Te.colorSpace));var Se=Te!=null&&Te.colorSpace?{preferCanvasColorSpace:Te.colorSpace}:void 0;if(ie===m.b.webgl){var Ye=Object(B.c)(te);if(Ye)return Te!=null&&Te.colorSpace&&Object(B.d)(Ye,Te.colorSpace),new ve(this.Ci,Ye,Se)}var ze=Te!=null&&Te.colorSpace?{colorSpace:Te.colorSpace}:void 0,it=te.getContext("2d",ze);if(it)return new Ve(this.Ci,it,Se,ee)},pe}(D.a),ne=n(31),Le=n(39),Ue=function(Ee){return Ee[Ee.OK=0]="OK",Ee[Ee.REORDER=1]="REORDER",Ee}({}),re=52428800,k=1e3/24,P="yuv-cache",Z=function(){function Ee(G){this.Ci=void 0,this._t=[],this.ya=0,this.Ct=-1,this._a=re,this.Ci=G}var pe=Ee.prototype;return pe.init=function(G){G&&G>re&&(this._a=G)},pe.reset=function(){this.Ci.i(P,"reset"),this._t=[],this.ya=0,this.Ct=-1},pe.next=function(){return this.getFrameByIndex(this.Ct+1)},pe.prev=function(){return this.getFrameByIndex(this.Ct-1)},pe.push=function(G,te){te===void 0&&(te=!1);var ie=Ue.OK,ee=G.y.bytes.byteLength+G.u.bytes.byteLength+G.v.bytes.byteLength,Te=this._t[this._t.length-1];this._t.push({pts:G.format.pts,endPTS:G.format.pts+this.Ca(),size:ee,yuv:G});var Se=this.Ia();return te&&(G.y.bytes=new Uint8Array(G.y.bytes),G.u.bytes=new Uint8Array(G.u.bytes),G.v.bytes=new Uint8Array(G.v.bytes)),Te&&((Se<=0||Se>=1e3)&&this.Ci.i(P,"yuv cache pts diff: "+Se+", "+Te.pts+"/"+G.format.pts),Se<0?(this.Oa(),ie=Ue.REORDER):Te.endPTS=G.format.pts),this.ya+=ee,this.wa(),ie},pe.decDropFrameInfo=function(G){if(this.Ci.i(P,"dec drop: "+G.frames.length),G.frames.length){var te=this._t[this._t.length-1],ie=G.frames[0].pts;if(te){te.endPTS=ie;var ee=ie-te.pts;(ee<=0||ee>=1e3)&&this.Ci.i(P,"yuv drop frame pts diff: "+ee)}for(var Te=0;Te<G.frames.length;Te++){var Se=G.frames[Te],Ye=G.frames[Te+1];this._t.push({pts:Se.pts,endPTS:(Ye==null?void 0:Ye.pts)||Se.pts,size:0})}this.Oa()}},pe.ptsToIndex=function(G){var te=this._t[this._t.length-1];return te&&G<=te.endPTS?G===te.endPTS?this._t.length-1:Le.a.searchIndex(this._t,function(ie){return G<ie.pts?-1:G>=ie.endPTS?1:0}):-1},pe.getFrameByIndex=function(G){if(G>=0&&G<this._t.length)return this.Ct=G,this._t[G]},pe.getLessPtsIdxThen=function(G){var te=this._t[G];if(te&&G>0&&G<this._t.length)for(var ie=G-1;ie>=0;ie--){var ee=this._t[ie];if(ee&&ee.pts<te.pts)return ie}return-1},pe.clean=function(G){this.Ci.i(P,"clean. st: "+G),G>=0&&this.reset();var te=this._t[this._t.length-1];if(te&&G<=te.endPTS){var ie=Math.max(0,Le.a.searchIndex(this._t,function(ee){return G<ee.pts?-1:G>ee.pts?1:0}));this._t=this._t.slice(0,ie),ie<this.Ct&&(this.Ct=ie)}},pe.hasDropedAfterIdx=function(G){if(G>=this._t.length)return!1;for(var te=Math.max(0,G);te<this._t.length;te++){var ie=this._t[te];if(ie==null||!ie.yuv)return!0}return!1},pe.wa=function(){for(;this.ya>=this._a&&this.Ct>0;){var G=this._t.shift();G&&G.yuv&&(this.ya-=G.size),this.Ct--}},pe.Ia=function(){var G=this._t;return G.length>1?G[G.length-1].pts-G[G.length-2].pts:0},pe.Ca=function(){var G=this._t;return G.length>1?(G[G.length-1].pts-G[0].pts)/(G.length-1):k},pe.Oa=function(){if(!(this._t.length<=1)){this._t.sort(function(ee,Te){return ee.pts-Te.pts});for(var G=0;G<this._t.length;G++){var te=this._t[G],ie=this._t[G+1];te.endPTS=ie?ie.pts:te.pts+this.Ca()}}},s()(Ee,[{key:"current",get:function(){return this.getFrameByIndex(this.Ct)}},{key:"index",get:function(){return this.Ct},set:function(G){G>=0&&G<this._t.length&&(this.Ct=G)}},{key:"cache",get:function(){return this._t}},{key:"remaining",get:function(){return this._t.length-1-this.Ct}}])}(),he="canvas-renderer",Ie=function(){function Ee(G,te){this.di=void 0,this.Ai=void 0,this.Ci=void 0,this.Ea=void 0,this.Qo=void 0,this.ja=m.p.NONE,this.ka=!0,this.Ma=void 0,this.Sa=void 0,this.Ba=0,this.Ta=3,this.vt=m.s.canvas,this.Da=!1,this.Ra=void 0,this.La=10,this.Na=void 0,this.Qa=void 0,G.i(he,"constructor"),this.Ai=te,this.Ci=G,this.Ea=new Z(G)}var pe=Ee.prototype;return pe.init=function(G,te,ie){this.Ci.i(he,"init"),this.di=te,this.Na=new ne.a(this.Ci,te,ie),this.ja=this.di.videoDecBlockPolicy,this.Ea.init(te.videoFrameBufferSize);try{var ee=Object(B.b)(),Te=m.b.webgl;te.preferCanvasType!==m.b.canvas2d&&this.Na.webgl&&ee.webGL?(this.Ci.i(he,"webgl yuv2rgb"),this.Qo=new ve(this.Ci,this.Na.webgl,te)):this.Na.canvas2d&&(this.Ci.i(he,"software yuv2rgb"),this.Qo=new Ve(this.Ci,this.Na.canvas2d,te),Te=m.b.canvas2d),this.Ci.i(he,"renderer init complete. type: "+Te),this.Ai.emit(Re.a.RENDERER_INIT_COMPLETE,{type:Te})}catch(Se){return this.Ci.i(he,Se),void this.Ai.emit(Re.a.ERROR,Object(le.e)(le.b.DECODER_ERROR,le.a.DECODER_WEBGL_ERROR,"render initialization error: "+(Se==null?void 0:Se.message)))}this.Qo?this.xa():this.Ai.emit(Re.a.ERROR,Object(le.e)(le.b.DECODER_ERROR,le.a.DECODER_WEBGL_ERROR,"render initialization error"))},pe.append=function(G){var te;this.Ea.remaining,this.Ea.push(G)===Ue.REORDER&&(this.Ci.i(he,"yuv cache reorder."),this.Ea.ptsToIndex(this.Ba),this.Ma=this.Ea.current,(te=this.Ma)!=null&&te.yuv&&!this.ka&&this.Va(this.Ma.yuv)),this.Ua(),this.Ai.emit(Re.a.RENDERER_BUF_UPDATE,{needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining,desc:"append"})},pe.Ua=function(){this.ka&&(this.Ea.remaining>=this.Ta||this.Fa())&&this.Pa()},pe.updateState=function(G,te,ie,ee,Te,Se,Ye){var ze,it,ct;Ye===void 0&&(Ye=A.a.contain),this.Ba=G,this.vt!==Te&&(this.Ci.i(he,"renderer type change to "+Te+". clear."),this.Qo&&this.Qo.clear()),(ze=this.Qo)==null||ze.setPictMode(Ye),this.vt=Te,this.La=Se,Te!==m.s.video&&this.Na&&this.Na.updateCanvasSize(te,ie)&&(it=this.Qo)!=null&&it.drawData.buffer&&this.Va((ct=this.Qo)==null?void 0:ct.drawData.buffer)},pe.updateMediaInfo=function(G){this.Ci.i(he,"update media info",G),this.Sa=G},pe.step=function(G){if(!this.ka){if(G===m.m.NEXT){var te,ie=this.Ma?this.Ma.pts:-1;ie>=0&&(te=this.Ma)!=null&&te.yuv&&(this.Ba=ie,this.Ai.emit(Re.a.STEP,{type:G,time:ie}))}else if(G===m.m.PREV){var ee=this.Ma?this.Ea.index-1:this.Ea.index;if(ee>0){var Te=this.Ea.getLessPtsIdxThen(ee);if(Te>=0){if(ee-Te>1&&this.Ci.i(he,"step prev skip "+(ee-Te-1)),this.Ma=this.Ea.getFrameByIndex(Te),this.Ma&&this.Ma.yuv)return this.Ba=this.Ma.yuv.format.pts,void this.Ai.emit(Re.a.STEP,{type:G,time:this.Ma.yuv.format.pts})}else this.Ea.reset()}this.Ai.emit(Re.a.STEP,{type:G,time:-1})}}},pe.seek=function(G,te){this.Ci.i(he,"seek["+te+"]: seek. time: "+G);var ie=this.Ea.ptsToIndex(G);if(ie!==-1){var ee;if(!this.Ea.hasDropedAfterIdx(ie))return this.Ea.index=ie,this.Ma=this.Ea.current,this.Ci.i(he,"seek["+te+"]: hit yuv cache. time: "+G+" draw pts: "+((ee=this.Ma)==null?void 0:ee.pts)+" remain yuv: "+this.Ea.remaining),this.Ba=G,this.Ha(),this.Ai.emit(Re.a.RENDERER_BUF_UPDATE,{needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining,desc:"seek"}),void this.Ai.emit(Re.a.RENDERER_SEEK,{hitCache:!0,time:G,id:te});this.Ci.i(he,"seek["+te+"]: yuv cache has dropped. reset yuv cache."),this.Ea.reset(),this.Ai.emit(Re.a.RENDERER_BUF_UPDATE,{needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining,desc:"seek reset"})}this.Ta=this.La||10,this.ka=!0,this.Ci.i(he,"seek["+te+"]: miss yuv cache"),this.Ai.emit(Re.a.RENDERER_SEEK,{hitCache:!1,time:G,id:te})},pe.endOfData=function(){this.Ci.i(he,"end of data"),this.Da=!0,this.Ua()},pe.decDropFrameInfo=function(G){this.Ea.decDropFrameInfo(G)},pe.screenshot=function(G){this.Qa||(this.Qa=new M(this.Ci,this.Ai)),this.Qo&&this.Qa.screenshot(this.Qo,G)},pe.reset=function(G,te){te===void 0&&(te=!1),this.Ci.i(he,"reset",G),this.Ea.reset(),te||(this.Ba=-1),this.ka=!0,this.Ma=void 0,this.Da=!1,this.Ai.emit(Re.a.RENDERER_BUF_UPDATE,{needMore:!0,yuvBufLen:0,desc:"reset"})},pe.destroy=function(){var G,te;this.Ci.i(he,"destroy."),this.Qo&&this.Qo.destroy(),this.Ea.reset(),this.Ya(),(G=this.Na)==null||G.destroy(),this.Na=void 0,(te=this.Qa)==null||te.destroy()},pe.Fa=function(){return this.Da},pe.Ha=function(){var G,te;if(this.Na&&this.Ba!==-1){var ie=this.Ea.remaining;for(!this.Ma||(G=this.Ma)!=null&&G.yuv||this.Ci.i(he,"skip empty frame"),this.Ma&&(te=this.Ma)!=null&&te.yuv||(this.Ma=this.Ea.next());this.Ma&&this.Ba>=0;){var ee=this.Ba-this.Ma.pts,Te=this.Ba-this.Ma.endPTS;if(this.ka&&Te>200)this.Ci.v(he,"skip draw",this.Ba,this.Ma.endPTS,Te),this.Ma=this.Ea.next();else{if(this.Ua(),this.ka||!(ee>=-1))break;if(Te<=200){this.Ma.yuv&&this.Va(this.Ma.yuv),this.Ma=this.Ea.next();break}this.ja===m.p.NONE?(this.Ma.yuv&&this.Va(this.Ma.yuv),this.Ma=this.Ea.next()):(this.Ci.v(he,"skip b",this.Ma.pts,ee,Te),this.Ma=this.Ea.next(),this.Ma||this.Fa()||this.Ga())}}ie!=this.Ea.remaining&&this.Ai.emit(Re.a.RENDERER_BUF_UPDATE,{desc:"update",needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining})}},pe.Va=function(G){var te,ie=this;if(this.Na){var ee=G.format,Te=((te=this.Sa)==null?void 0:te.rotation)||0,Se=ee.sar?Object(J.a)(ee.width,ee.height,ee.sar):ee;if(this.Na.updateFormatSize(Se.width,Se.height,Te),ee.displayWidth=this.Na.displaySize.w,ee.displayHeight=this.Na.displaySize.h,this.Qo){var Ye,ze=this.Qo.drawFrame(G,(Ye=this.Sa)==null?void 0:Ye.colorInfo,Te);if(ze!==void 0)return this.Ai.emit(Re.a.RENDERER_WAITING),void ze.then(function(it){it?(ie.Ai.emit(Re.a.RENDERER_WAITING_END),ie.Ai.emit(Re.a.RENDERER_DRAW,{yuvBufLen:ie.Ea.remaining})):ie.Ai.emit(Re.a.ERROR,Object(le.e)(le.b.DECODER_ERROR,le.a.DECODER_2D_ERROR,"render initialization error. 2d"))});if(!this.Qo.ready)return void this.Ai.emit(Re.a.RENDERER_WAITING)}this.Ai.emit(Re.a.RENDERER_DRAW,{yuvBufLen:this.Ea.remaining})}},pe.xa=function(){var G=this;this.Ra||(this.Ra=setInterval(function(){G.Ha()},0))},pe.Ya=function(){this.Ra&&(clearInterval(this.Ra),this.Ra=void 0)},pe.Ga=function(){var G=this.La||10;this.Ci.i(he,"waiting. frame buf: "+G),this.Ta!==G&&(this.Ta=G),this.ka=!0,this.Ai.emit(Re.a.DECODER_WAITING)},pe.Pa=function(){this.Ci.i(he,"waiting ready. frame buf: "+this.Ea.remaining+", data ended: "+this.Fa()),this.ka=!1,this.Ai.emit(Re.a.DEC_VIDEO_READY)},Ee}();i.a=Ie},function(r,i,n){var o=n(0),s=n(7),d=n(3),m=n(9),A=n(11),T=n(16),C=n(5),h=n.n(C),F=s.b/s.n,w="video-dec-cache",I=function(){function b(U,M){var ne=this;this.Ci=void 0,this.Ai=void 0,this.Ka=[],this.Za=0,this.yt=0,this.Wa=0,this.Xa=-1,this.za=[],this.Ja=1,this.Ah=33,this.qa=void 0,this.$a=void 0,this.isIDR=function(Le){return Le.units.reduce(function(Ue,re){return ne.za.indexOf(re.type)!==-1||Ue},!1)},U.i(w,"constructor"),this.Ai=M,this.Ci=U}var ve=b.prototype;return ve.updateIdrFrame=function(U){this.Ci.i(w,"updateIdrFrame",U),this.za=U},ve.appendData=function(U){var M=this;if(U.type===A.d.decoderConfig){this.qa=U.samples[0];var ne=this.$a=[],Le={};return this.qa.units.forEach(function(re){Le[re.type]||(Le[re.type]=!0,ne.push(re.type))}),void this.Ci.i(w,"dec config",ne)}var Ue=this.Ka;U.samples.forEach(function(re,k){var P=M.isIDR(re);if(P||M.Xa!==-1){if(P){if(M.qa){var Z,he=!1;M.$a&&(he=M.$a.reduce(function(G,te){return G&&re.units.reduce(function(ie,ee){return ie||ee.type===te},!1)},!0)),!he&&(M.Ci.i(w,"key sample has not dec config. push dec config units."),(Z=re.units).unshift.apply(Z,M.qa.units))}M.Wa++}var Ie=re.units.reduce(function(G,te){return te.data.length+G},0),Ee={id:M.Ja,key:P,gopId:M.Wa,type:U.type||A.d.videoFrame,size:Ie,data:re,dts:re.dts*s.b,pts:re.pts*s.b,mediaInfo:U.mediaInfo};Ee.pts>M.Xa&&(M.Xa=Ee.pts);var pe=Ue[Ue.length-1];pe&&Math.abs(Ee.dts-pe.dts)>1e3&&M.Ci.i(w,"append error",M.Ka,M.Za),Ee.discontinuity=!!(Ee.type===A.d.videoFrame&&pe&&Math.abs(Ee.dts-pe.dts)>s.p),Ue.push(Ee),M.yt+=Ie,M.Ja++}}),Ue.length>10&&(this.Ah=Math.max(F,(Ue[Ue.length-1].dts-Ue[0].dts)/(Ue.length-1))),this.tu()},ve.clean=function(){this.Ci.i(w,"clean"),this.Ka=[],this.Ja=0,this.Za=0,this.yt=0,this.Wa=0,this.Xa=-1},ve.getItem=function(U){return this.Ka[U]},ve.getItemIdxByDts=function(U){var M=this.iu(this.Ka,U);if(M===-1){var ne=this.Ka[this.Ka.length-1];ne&&U>ne.dts&&U<ne.dts+this.Ah&&(M=this.Ka.length-1)}return M},ve.getItemByDts=function(U){var M=this.getItemIdxByDts(U);if(M>=0)return this.Ka[M]},ve.seek=function(U){var M=this.getItemIdxByDts(U);if(M<0&&this.hit(U)&&this.Ka.length&&U>this.Ka[this.Ka.length-1].dts&&(M=this.Ka.length-1),M>=0){for(var ne=M;ne>=0;ne--)if(this.Ka[ne].key&&this.Ka[ne].pts<=U)return this.Za=ne,!0}return!1},ve.hit=function(U){var M=this.Ka;return!!M.length&&U>=M[0].pts&&U<=this.Xa+this.Ah},ve.next=function(){if(this.Za<this.Ka.length){var U=this.Ka[this.Za];return this.Za++,this.tu(),U}},ve.tu=function(){var U=this.Ka;if(U.length){for(var M=0;this.yt>134217728&&this.Za>0;){var ne,Le=((ne=this.current)==null?void 0:ne.gopId)||U[U.length-1].gopId,Ue=U[0];if(Le-Ue.gopId<2)break;U.shift(),this.yt=this.yt-Ue.size,this.Za--,M++}M&&this.Ci.i(w,"remove",M)}},ve.iu=function(U,M){for(var ne,Le=U,Ue=0,re=Le.length-1,k=void 0,P=void 0;Ue<=re;)if(ne=Le[k=(Ue+re)/2|0],(P=Le[k+1])&&M>P.dts)Ue=k+1;else{if(P&&M===P.dts)return k+1;if(!(M<ne.dts))return P?k:-1;re=k-1}return-1},h()(b,[{key:"current",get:function(){return this.Ka[this.Za]}},{key:"remain",get:function(){return this.Ka.length-this.Za}},{key:"length",get:function(){return this.Ka.length}},{key:"idx",get:function(){return this.Za},set:function(U){this.Za=Math.min(Math.max(0,U),this.Ka.length)}},{key:"size",get:function(){return this.yt}},{key:"data",get:function(){return this.Ka}},{key:"frameDuration",get:function(){return this.Ah}}])}(),S=n(50),W=n.n(S),j=n(2),N=n(25),K=function(b){return b[b.KS265_PIXFMT_YUV_420P=0]="KS265_PIXFMT_YUV_420P",b[b.KS265_PIXFMT_YUV_420SP=1]="KS265_PIXFMT_YUV_420SP",b[b.KS265_PIXFMT_YUV_420SP_VU=2]="KS265_PIXFMT_YUV_420SP_VU",b}(K||{}),z={nWidth:720,nHeight:1280,nCodedWidth:720,nCodedHeight:1280,nLumaBitDepth:10,nChromaBitDepth:10,nChromaFormatIdc:0,profile:1,level:150,has_b_frames:1,pts:0,bIllegalStream:0,poc:0},B=[0,0,0,1],J="ks265-wrapper",be=function(){function b(U,M){this.Ai=void 0,this.Ci=void 0,this.eu=void 0,this.nu=void 0,this.Do=0,this.su=!1,this.ru=0,this.hu=!1,this.di={pAuth:0,threads:1,nal_mode:0,pic_out_pos:0,bEnableOutputRecToFile:0,strRecYuvFileName:0,logLevel:0,outputPixfmt:K.KS265_PIXFMT_YUV_420P,b_use_pthread:0,b_alpha_decode:0,p_arg:0,p_log_func:0,b_zerobuffer_contains_ref:1},this.ou=0,this.au=0,U.i(J,"constructor"),this.Ai=M,this.Ci=U}var ve=b.prototype;return ve.init=function(U,M,ne){var Le=this;if(this.Ci.i(J,"init simd: "+M+" threads: "+ne),!U.wasm.data)return Promise.reject("ks265 wasm is null");var Ue=U.js.data,re=U.jsw?U.jsw.data:"",k=new Function(Ue+" return KW265;")(),P=re?new Blob([Ue],{type:"text/javascript"}):"",Z=new Blob([re],{type:"text/javascript"});return k({wasmBinary:U.wasm.data,mainScriptUrlOrBlob:P,locateFile:function(he){return he.indexOf(".worker.js")!==-1?URL.createObjectURL(Z):""}}).then(function(he){Le.eu=he,Le.uu(),ne>1&&(Le.di.b_use_pthread=1,Le.di.threads=ne),Le.di.nal_mode=0,Le.cu()})},ve.pushNalus=function(U,M,ne){if(ne===void 0&&(ne=!1),this.eu&&this.nu){this.fu(this.eu,this.au+24,z),this.eu.setValue(this.au,0,"i32"),this.ru++;var Le=U.reduce(function(P,Z){return P+Z.data.byteLength},0)+B.length*U.length,Ue=new Uint8Array(Le),re=0;U.forEach(function(P){Ue.set(B,re),Ue.set(P.data,re+B.length),re+=B.length+P.data.byteLength});var k=performance.now();this.nu.KS265DecodeFrame(this.Do,Ue,Le,Math.round(M)||0),this.Au(k),this.hu=ne}},ve.getPendingNALNumber=function(){return this.ru},ve.endOfFrame=function(){},ve.nextFrame=function(){this.ru&&this.Au(),this.su=!0},ve.free=function(){var U;(U=this.nu)==null||U.KS265DecoderDestroy(this.Do),this.eu&&(this.ou&&this.eu._free(this.ou),this.au&&this.eu._free(this.au)),this.ou=this.au=0},ve.rebuild=function(){this.Ci.i(J,"rebuild"),this.free(),this.ru=0,this.su=!1,this.hu=!1,this.cu()},ve.flush=function(){},ve.reset=function(){},ve.isWaitingData=function(){return this.su},ve.Au=function(U){if(this.nu&&this.eu&&(U=U||performance.now(),this.hu&&this.nu.KS265DecodeFlush(this.Do,0),!(this.nu.KS265DecoderGetDecodedFrame(this.Do,this.au)<0))){var M=this.vu(this.eu,this.au);M.bValid&&(this.Ai.emit(j.a.DECODER_FRAME,{frame:this.du(this.eu,M),startTime:U}),this.hu||this.nu.KS265DecoderReturnDecodedFrame(this.Do,this.au),this.su=!1,this.ru--)}},ve.cu=function(){this.nu&&this.eu&&(this.ou=this.lu(this.eu,this.di),this.au=this.bu(this.eu),this.Do=this.nu.KS265DecoderCreate(this.ou),this.nu.KS265DecodeFlush(this.Do,1))},ve.du=function(U,M){var ne=N.a.AV_PIX_FMT_YUV420P,Le=Object(N.b)(M.frameinfo.nCodedWidth||M.frameinfo.nWidth,M.frameinfo.nCodedHeight||M.frameinfo.nHeight,ne),Ue=Le.w,re=Le.h;return{format:{width:Ue[0],height:re[0],chroma:ne,chromaWidth:Ue[1],chromaHeight:re[1],cropLeft:0,cropTop:0,cropWidth:M.frameinfo.nWidth,cropHeight:M.frameinfo.nHeight,displayWidth:0,displayHeight:0,pts:M.frameinfo.pts},y:{bytes:U.HEAPU8.subarray(M.pData[0],M.pData[0]+M.iStride[0]*re[0]),stride:M.iStride[0],bits:8},u:{bytes:U.HEAPU8.subarray(M.pData[1],M.pData[1]+M.iStride[1]*re[1]),stride:M.iStride[1],bits:8},v:{bytes:U.HEAPU8.subarray(M.pData[2],M.pData[2]+M.iStride[2]*re[1]),stride:M.iStride[2],bits:8}}},ve.lu=function(U,M){var ne=U._malloc(52);return U.setValue(ne,M.pAuth,"i32"),U.setValue(ne+4,M.threads,"i32"),U.setValue(ne+8,M.nal_mode,"i32"),U.setValue(ne+12,M.pic_out_pos,"i32"),U.setValue(ne+16,M.bEnableOutputRecToFile,"i32"),U.setValue(ne+20,M.strRecYuvFileName,"i32"),U.setValue(ne+24,M.logLevel,"i32"),U.setValue(ne+28,M.outputPixfmt,"i32"),U.setValue(ne+32,M.b_use_pthread,"i32"),U.setValue(ne+36,M.b_alpha_decode,"i32"),U.setValue(ne+40,M.p_arg,"i32"),U.setValue(ne+44,M.p_log_func,"i32"),U.setValue(ne+48,M.b_zerobuffer_contains_ref,"i32"),ne},ve.pu=function(U,M){return{nWidth:U.getValue(M,"i32"),nHeight:U.getValue(M+4,"i32"),nCodedWidth:U.getValue(M+8,"i32"),nCodedHeight:U.getValue(M+12,"i32"),nLumaBitDepth:U.getValue(M+16,"i32"),nChromaBitDepth:U.getValue(M+20,"i32"),nChromaFormatIdc:U.getValue(M+24,"i32"),profile:U.getValue(M+28,"i32"),level:U.getValue(M+32,"i32"),has_b_frames:U.getValue(M+36,"i32"),pts:U.getValue(M+40,"i32"),bIllegalStream:U.getValue(M+48,"i32"),poc:U.getValue(M+52,"i32")}},ve.fu=function(U,M,ne){U.setValue(M,ne.nWidth,"i32"),U.setValue(M+4,ne.nHeight,"i32"),U.setValue(M+8,ne.nCodedWidth,"i32"),U.setValue(M+12,ne.nCodedHeight,"i32"),U.setValue(M+16,ne.nChromaFormatIdc,"i32"),U.setValue(M+20,ne.profile,"i32"),U.setValue(M+24,ne.level,"i32"),U.setValue(M+28,ne.has_b_frames,"i32"),U.setValue(M+32,ne.pts,"i64")},ve.bu=function(U){return U._malloc(80)},ve.vu=function(U,M){return{bValid:U.getValue(M,"i32"),pData:[U.getValue(M+4,"i32"),U.getValue(M+8,"i32"),U.getValue(M+12,"i32")],iStride:[U.getValue(M+16,"i16"),U.getValue(M+18,"i16"),U.getValue(M+20,"i16")],frameinfo:this.pu(U,M+24)}},ve.uu=function(){this.eu&&(this.nu={KS265DecoderCreate:this.eu.cwrap("KS265DecoderCreate","number",["number"]),KS265DecoderDestroy:this.eu.cwrap("KS265DecoderDestroy","number",["number"]),KS265DecoderSetDecConfig:this.eu.cwrap("KS265DecoderSetDecConfig","number",["number","number"]),KS265DecodeFrameHeader:this.eu.cwrap("KS265DecodeFrameHeader","number",["number","array","number"]),KS265DecodeFrame:this.eu.cwrap("KS265DecodeFrame","number",["number","array","number","number"]),KS265DecodeFlush:this.eu.cwrap("KS265DecodeFlush","number",["number","number"]),KS265DecoderGetDecodedFrame:this.eu.cwrap("KS265DecoderGetDecodedFrame","number",["number","number"]),KS265DecoderReturnDecodedFrame:this.eu.cwrap("KS265DecoderReturnDecodedFrame","number",["number","number"]),KS265DumpVUIParameters:this.eu.cwrap("KS265DumpVUIParameters","number",["number","number","number"]),module:this.eu})},b}(),X=be,ye=n(12),Be=n(36),Ve=[0,0,0,1],je="kvc30-wrapper",we=function(){function b(U,M){this.Ai=void 0,this.Ci=void 0,this.eu=void 0,this.mu=void 0,this.Do=0,this.su=!1,this.ru=0,this.hu=!1,this.di={threads:1,needOutput:1},this.ou=0,this.gu=0,this.au=0,this.yu=0,this._u=[],this.Cu=void 0,this.Iu={ysize:0,usize:0,vsize:0,y:0,u:0,v:0,buf:0,pBufs:0},this.Ou=void 0,U.i(je,"constructor"),this.Ai=M,this.Ci=U}var ve=b.prototype;return ve.init=function(U,M,ne){var Le=this;if(this.Ci.i(je,"init simd: "+M+" threads: "+ne),!U.wasm.data)return Promise.reject("kvc wasm is null");var Ue=U.js.data,re=U.jsw?U.jsw.data:"",k=new Function(Ue+" return KVC30;")(),P=re?new Blob([Ue],{type:"text/javascript"}):"",Z=new Blob([re],{type:"text/javascript"});return k({wasmBinary:U.wasm.data,mainScriptUrlOrBlob:P,locateFile:function(he){return he.indexOf(".worker.js")!==-1?URL.createObjectURL(Z):""}}).then(function(he){Le.eu=he,Le.wu(),ne>1?(Le.di.threads=1,Le.di.threads=ne):Le.di.threads=0,Le.cu()})},ve.pushNalus=function(U,M,ne){if(ne===void 0&&(ne=!1),this.eu){this.eu.setValue(this.au,0,"i32"),this.ru++;var Le=U.reduce(function(k,P){return k+P.data.byteLength},0)+Ve.length*U.length,Ue=new Uint8Array(Le),re=0;U.forEach(function(k){Ue.set(Ve,re),Ue.set(k.data,re+Ve.length),re+=Ve.length+k.data.byteLength}),this.Eu(this.eu,Ue,M),this.ju(),this.hu=ne}},ve.getPendingNALNumber=function(){return this.ru},ve.endOfFrame=function(){},ve.nextFrame=function(){this.su=!0},ve.free=function(){var U;(U=this.mu)==null||U.KVCDecoderDestroy(this.Do),this.eu&&(this.Do&&this.eu._free(this.Do),this.Do=0,this.ou&&this.eu._free(this.ou),this.gu&&this.eu._free(this.gu),this.au&&this.eu._free(this.au),this.yu&&this.eu._free(this.yu),this.ku(),this.ou=this.au=0,this.Mu())},ve.rebuild=function(){this.Ci.i(je,"rebuild"),this.ru=0,this.su=!1,this.hu=!1,this.Iu.ysize=0,this.Iu.usize=0,this.Iu.vsize=0,this.Ci.i(je,"rebuild"),this.free(),this.cu()},ve.flush=function(){this.Ci.i(je,"flush"),this.eu&&(this.eu.setValue(this.gu,0,"i64"),this.eu.setValue(this.gu+8,0,"i32"),this.eu.setValue(this.gu+12,0,"i32"));var U=!1;do U=this.ju();while(U);this.ru=0,this.su=!1},ve.reset=function(){},ve.isWaitingData=function(){return this.su},ve.cu=function(){this.eu&&this.mu&&(this.Ci.i(je,"new decoder."),this.ou=this.Su(this.eu,this.di),this.gu=this.eu._malloc(16),this.au=this.eu._malloc(112),this.yu=this.eu._malloc(72),this.Do=this.mu.KVCDecoderCreate(this.ou))},ve.du=function(U,M){return{format:{width:M.width[0],height:M.height[0],chroma:1,chromaWidth:M.width[1],chromaHeight:M.height[1],cropLeft:0,cropTop:0,cropWidth:M.width[0],cropHeight:M.height[0],displayWidth:0,displayHeight:0,pts:M.pts,colorInfo:this.Bu()},y:{bytes:U.HEAPU8.subarray(M.bufs[0],M.bufs[0]+M.stride[0]*M.height[0]*M.bytesPerPixel),stride:M.stride[0],bits:M.bitDepth},u:{bytes:U.HEAPU8.subarray(M.bufs[1],M.bufs[1]+M.stride[1]*M.height[1]*M.bytesPerPixel),stride:M.stride[1],bits:M.bitDepth},v:{bytes:U.HEAPU8.subarray(M.bufs[2],M.bufs[2]+M.stride[2]*M.height[2]*M.bytesPerPixel),stride:M.stride[2],bits:M.bitDepth}}},ve.Su=function(U,M){var ne=U._malloc(68);return U.setValue(ne,0,"i32"),U.setValue(ne+4,0,"i32"),U.setValue(ne+8,0,"i32"),U.setValue(ne+12,0,"i32"),U.setValue(ne+16,0,"i32"),U.setValue(ne+20,0,"i32"),U.setValue(ne+24,0,"i32"),U.setValue(ne+28,0,"i32"),U.setValue(ne+32,0,"i32"),U.setValue(ne+36,M.threads,"i32"),U.setValue(ne+40,M.needOutput,"i32"),U.setValue(ne+44,0,"i32"),U.setValue(ne+48,0,"i32"),U.setValue(ne+52,0,"i32"),U.setValue(ne+56,0,"i32"),U.setValue(ne+60,0,"i32"),U.setValue(ne+64,0,"i32"),ne},ve.Eu=function(U,M,ne){var Le=U._malloc(M.byteLength);U.HEAPU8.set(M,Le),U.setValue(this.gu,Math.round(ne),"i64"),U.setValue(this.gu+8,Le,"i32"),U.setValue(this.gu+12,M.byteLength,"i32"),this._u.push(Le),this.Mu(16)},ve.Mu=function(U){if(U===void 0&&(U=0),this.eu)for(;this._u.length>U;){var M=this._u.shift();M&&this.eu._free(M)}},ve.Tu=function(U,M){return{pts:U.getValue(M,"i64"),bufs:[U.getValue(M+8,"i32"),U.getValue(M+12,"i32"),U.getValue(M+16,"i32"),U.getValue(M+20,"i32")],p_output_frame:U.getValue(M+24,"i32"),p_buffer_ref:U.getValue(M+28,"i32"),width:[U.getValue(M+32,"i32"),U.getValue(M+36,"i32"),U.getValue(M+40,"i32"),U.getValue(M+44,"i32")],height:[U.getValue(M+48,"i32"),U.getValue(M+52,"i32"),U.getValue(M+56,"i32"),U.getValue(M+60,"i32")],stride:[U.getValue(M+64,"i32"),U.getValue(M+68,"i32"),U.getValue(M+72,"i32"),U.getValue(M+76,"i32")],bytesPerPixel:U.getValue(M+80,"i32"),colorFormat:U.getValue(M+84,"i32"),bitDepth:U.getValue(M+88,"i32"),planes:U.getValue(M+92,"i32"),hasOutput:U.getValue(M+96,"i32"),isKeyFrame:U.getValue(M+100,"i32"),isPostProcess:U.getValue(M+104,"i32"),pixFmt:U.getValue(M+108,"i32")}},ve.Du=function(U,M){return{chromaFormat:U.getValue(M,"i32"),codedWidth:U.getValue(M+4,"i32"),codedHeight:U.getValue(M+8,"i32"),width:U.getValue(M+12,"i32"),height:U.getValue(M+16,"i32"),hasBFrames:U.getValue(M+20,"i32"),profile:U.getValue(M+24,"i32"),level:U.getValue(M+28,"i32"),bitdepth:U.getValue(M+32,"i32"),b_vui_valid:U.getValue(M+36,"i32"),aspect_ratio_info_present_flag:U.getValue(M+40,"i32"),video_full_range_flag:U.getValue(M+44,"i32"),sar_width:U.getValue(M+48,"i32"),sar_height:U.getValue(M+52,"i32"),colour_description_present_flag:U.getValue(M+56,"i32"),colour_primaries:U.getValue(M+60,"i32"),transfer_characteristics:U.getValue(M+64,"i32"),matrix_coeffs:U.getValue(M+68,"i32")}},ve.ju=function(){if(!this.eu||!this.mu)return!1;if(!this.mu.KVCDecodeFrame(this.Do,this.gu,this.au)){var U=this.Tu(this.eu,this.au);if(U.hasOutput)return this.Cu||this.Ru(),this.mu.KVCDecoderPostProcess&&this.Lu(this.eu,U),this.Ai.emit(j.a.DECODER_FRAME,{frame:this.du(this.eu,U),startTime:performance.now()}),this.mu.KVCDecodeUnrefFrame(this.Do,this.au),this.su=!1,this.ru--,!0}return!1},ve.Lu=function(U,M){var ne;if((ne=this.mu)!=null&&ne.KVCDecoderPostProcess){var Le=this.Iu,Ue=M.stride[0]*M.height[0]*M.bytesPerPixel,re=M.stride[1]*M.height[1]*M.bytesPerPixel,k=M.stride[2]*M.height[2]*M.bytesPerPixel;Ue===Le.ysize&&re===Le.usize&&k===Le.vsize||this.Nu(U,M);var P=this.mu.KVCDecoderPostProcess(this.Do,this.au,Le.pBufs,this.au+64);P?this.Ci.i(je,"post process fail: "+P):M.bufs=[Le.y,Le.u,Le.v]}},ve.ku=function(){this.Ci.i(je,"free post process yuv.");var U=this.Iu;this.eu&&(U.buf&&this.eu._free(U.buf),U.pBufs&&this.eu._free(U.pBufs)),U.y=U.u=U.v=U.buf=U.pBufs=0},ve.Nu=function(U,M){this.Ci.i(je,"malloc post process yuv."),this.ku();var ne=this.Iu;ne.ysize=M.stride[0]*M.height[0]*M.bytesPerPixel,ne.usize=M.stride[1]*M.height[1]*M.bytesPerPixel,ne.vsize=M.stride[2]*M.height[2]*M.bytesPerPixel;var Le=ne.ysize+ne.usize+ne.vsize;ne.buf=U._malloc(Le),ne.y=ne.buf,ne.u=ne.y+ne.ysize,ne.v=ne.u+ne.usize,ne.pBufs=U._malloc(16),U.setValue(ne.pBufs,ne.y,"i32"),U.setValue(ne.pBufs+4,ne.u,"i32"),U.setValue(ne.pBufs+8,ne.v,"i32")},ve.Ru=function(){this.eu&&this.mu&&(this.mu.KVCExportParams(this.Do,this.yu),this.Cu=this.Du(this.eu,this.yu),this.Ci.i(je,"video info",this.Cu),this.Cu&&this.Ai.emit(j.a.DECODER_MEDIA_INFO,{width:this.Cu.width,height:this.Cu.height,codedWidth:this.Cu.codedWidth,codedHeight:this.Cu.codedHeight,sar:{width:this.Cu.sar_width,height:this.Cu.sar_width},profile:Object(Be.c)(this.Cu.profile),level:Object(Be.b)(this.Cu.level),chromaFormat:Object(Be.a)(this.Cu.chromaFormat),bitDepth:this.Cu.bitdepth,colorInfo:this.Bu()}))},ve.Bu=function(){var U=this.Cu;return U&&U.colour_description_present_flag?(this.Ou=!0,{colorRange:U.video_full_range_flag?ye.b.AVCOL_RANGE_JPEG:ye.b.AVCOL_RANGE_MPEG,colourPrimaries:U.colour_primaries,transferCharacteristics:U.transfer_characteristics,matrixCoefficients:U.matrix_coeffs}):(this.Ou!==!1&&this.Ci.i(je,"no colour_description_present_flag"),this.Ou=!1,{colorRange:ye.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:ye.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:ye.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:ye.c.AVCOL_SPC_UNSPECIFIED})},ve.wu=function(){this.eu&&(this.mu={KVCDecoderCreate:this.eu.cwrap("kvc30dec_create","number",["number"]),KVCDecoderDestroy:this.eu.cwrap("kvc30dec_destroy","number",["number"]),KVCDecodeFrame:this.eu.cwrap("kvc30dec_decode","number",["number","number","number"]),KVCDecodeUnrefFrame:this.eu.cwrap("kvc30dec_unref_frame","number",["number","number"]),KVCExportParams:this.eu.cwrap("kvc30dec_export_params","number",["number","number"]),KVCGetVersion:this.eu.cwrap("kvc30dec_get_version","number",[]),module:this.eu},this.eu._kvc30dec_post_process&&(this.Ci.i(je,"post process func detected."),this.mu.KVCDecoderPostProcess=this.eu.cwrap("kvc30dec_post_process","number",["number","number","number","number"])))},b}(),ue=we,L=function(b){return b[b.KVC_PIXFMT_YUV_420P=0]="KVC_PIXFMT_YUV_420P",b[b.KVC_PIXFMT_YUV_420SP=1]="KVC_PIXFMT_YUV_420SP",b[b.KVC_PIXFMT_YUV_420SP_VU=2]="KVC_PIXFMT_YUV_420SP_VU",b}(L||{}),D={width:720,height:1280,codedWidth:720,codedHeight:1280,chromaFormat:0,profile:1,level:150,hasBFrames:1,pts:0},le=[0,0,0,1],oe="kvc-wrapper",Re=function(){function b(U,M,ne){ne===void 0&&(ne=o.c.kvc4),this.Ai=void 0,this.Ci=void 0,this.eu=void 0,this.mu=void 0,this.Do=0,this.su=!1,this.ru=0,this.hu=!1,this.Qu=o.c.unknown,this.xu=!1,this.Iu={ysize:0,usize:0,vsize:0,y:0,u:0,v:0},this.di={threads:1,queueDecode:0,picOutPos:0,outputPixfmt:L.KVC_PIXFMT_YUV_420P,b_use_pthread:0},this.ou=0,this.au=0,U.i(oe,"constructor"),this.Ci=U,this.Ai=M,this.Qu=ne}var ve=b.prototype;return ve.init=function(U,M,ne){var Le=this;if(this.Ci.i(oe,"init simd: "+M+" threads: "+ne),!U.wasm.data)return Promise.reject("kvc wasm is null");var Ue=U.js.data,re=U.jsw?U.jsw.data:"",k=new Function(Ue+" return KVCDecoder;")(),P=re?new Blob([Ue],{type:"text/javascript"}):"",Z=new Blob([re],{type:"text/javascript"});return k({wasmBinary:U.wasm.data,mainScriptUrlOrBlob:P,locateFile:function(he){return he.indexOf(".worker.js")!==-1?URL.createObjectURL(Z):""}}).then(function(he){var Ie;Le.eu=he,Le.wu(),Le.xu=Le.Qu===o.c.kvc5||Le.Qu===o.c.kvc6,Le.Qu===o.c.kvc6&&(Ie=Le.mu)!=null&&Ie.KVCDecoderPostProcess&&Le.Ci.i(oe,"kvc6 post process on."),ne>1&&(Le.di.b_use_pthread=1,Le.di.threads=ne),Le.di.queueDecode=0,Le.cu()})},ve.pushNalus=function(U,M,ne){if(ne===void 0&&(ne=!1),this.eu&&this.mu){this.Vu(this.eu,this.au+24,D),this.eu.setValue(this.au,0,"i32"),this.ru++;var Le=U.reduce(function(P,Z){return P+Z.data.byteLength},0)+le.length*U.length,Ue=new Uint8Array(Le),re=0;U.forEach(function(P){Ue.set(le,re),Ue.set(P.data,re+le.length),re+=le.length+P.data.byteLength});var k=performance.now();this.mu.KVCDecodeFrame(this.Do,Ue,Le,Math.round(M)||0),this.Au(k),this.hu=ne}},ve.getPendingNALNumber=function(){return this.ru},ve.endOfFrame=function(){},ve.nextFrame=function(){this.ru&&this.Au(),this.su=!0},ve.free=function(){var U;(U=this.mu)==null||U.KVCDecoderDestroy(this.Do),this.Do=0,this.eu&&(this.ou&&this.eu._free(this.ou),this.au&&this.eu._free(this.au)),this.ku(),this.ou=this.au=0},ve.rebuild=function(){this.Ci.i(oe,"rebuild"),this.ru=0,this.su=!1,this.hu=!1,this.Iu.ysize=0,this.Iu.usize=0,this.Iu.vsize=0,this.free(),this.cu()},ve.flush=function(){},ve.reset=function(){},ve.isWaitingData=function(){return this.su},ve.Au=function(U){if(this.eu&&this.mu&&(U=U||performance.now(),this.hu&&this.mu.KVCDecodeFlush(this.Do,0),!(this.mu.KVCDecoderGetDecodedFrame(this.Do,this.au)<0))){var M=this.Tu(this.eu,this.au);M.valid&&(this.Qu===o.c.kvc6&&this.mu.KVCDecoderPostProcess&&this.Lu(this.eu,M),this.Ai.emit(j.a.DECODER_FRAME,{frame:this.du(this.eu,M),startTime:U}),this.hu||this.mu.KVCDecoderReturnDecodedFrame(this.Do,this.au),this.su=!1,this.ru--)}},ve.Lu=function(U,M){var ne;(ne=this.mu)!=null&&ne.KVCDecoderPostProcess&&(M.ysize===this.Iu.ysize&&M.usize===this.Iu.usize&&M.vsize===this.Iu.vsize||this.Nu(U,M),U.HEAPU8.set(U.HEAPU8.subarray(M.data[0],M.data[0]+M.ysize),this.Iu.y),U.HEAPU8.set(U.HEAPU8.subarray(M.data[1],M.data[1]+M.usize),this.Iu.u),U.HEAPU8.set(U.HEAPU8.subarray(M.data[2],M.data[2]+M.vsize),this.Iu.v),M.data=[this.Iu.y,this.Iu.u,this.Iu.v],U.setValue(this.au+8,M.data[0],"i32"),U.setValue(this.au+12,M.data[1],"i32"),U.setValue(this.au+16,M.data[2],"i32"),this.mu.KVCDecoderPostProcess(this.Do,this.au))},ve.ku=function(){this.Ci.i(oe,"free post process yuv."),this.eu&&(this.Iu.y&&this.eu._free(this.Iu.y),this.Iu.u&&this.eu._free(this.Iu.u),this.Iu.v&&this.eu._free(this.Iu.v)),this.Iu.y=this.Iu.u=this.Iu.v=0},ve.Nu=function(U,M){this.Ci.i(oe,"malloc post process yuv."),this.ku(),this.Iu.y=U._malloc(M.ysize),this.Iu.u=U._malloc(M.usize),this.Iu.v=U._malloc(M.vsize),this.Iu.ysize=M.ysize,this.Iu.usize=M.usize,this.Iu.vsize=M.vsize},ve.cu=function(){this.eu&&this.mu&&(this.ou=this.Su(this.eu,this.di),this.au=this.Uu(this.eu),this.Do=this.mu.KVCDecoderCreate(this.ou),this.mu.KVCDecodeFlush(this.Do,1))},ve.du=function(U,M){var ne=N.a.AV_PIX_FMT_YUV420P,Le=Object(N.b)(M.info.codedWidth||M.info.width,M.info.codedHeight||M.info.height,ne),Ue=Le.w,re=Le.h;return{format:{width:Ue[0],height:re[0],chroma:ne,chromaWidth:Ue[1],chromaHeight:re[1],cropLeft:0,cropTop:0,cropWidth:Ue[0],cropHeight:re[0],displayWidth:0,displayHeight:0,pts:M.info.pts},y:{bytes:U.HEAPU8.subarray(M.data[0],M.data[0]+M.ysize),stride:M.stride[0],bits:8},u:{bytes:U.HEAPU8.subarray(M.data[1],M.data[1]+M.usize),stride:M.stride[1],bits:8},v:{bytes:U.HEAPU8.subarray(M.data[2],M.data[2]+M.vsize),stride:M.stride[2],bits:8}}},ve.Su=function(U,M){var ne=U._malloc(20);return U.setValue(ne,M.threads,"i32"),U.setValue(ne+4,M.queueDecode,"i32"),U.setValue(ne+8,M.picOutPos,"i32"),U.setValue(ne+12,M.outputPixfmt,"i32"),U.setValue(ne+16,M.b_use_pthread,"i32"),ne},ve.Fu=function(U){return U._malloc(40)},ve.Pu=function(U,M){return{width:U.getValue(M,"i32"),height:U.getValue(M+4,"i32"),codedWidth:U.getValue(M+8,"i32"),codedHeight:U.getValue(M+12,"i32"),chromaFormat:U.getValue(M+16,"i32"),profile:U.getValue(M+20,"i32"),level:U.getValue(M+24,"i32"),hasBFrames:U.getValue(M+28,"i32"),pts:U.getValue(M+32,"i64")}},ve.Vu=function(U,M,ne){U.setValue(M,ne.width,"i32"),U.setValue(M+4,ne.height,"i32"),U.setValue(M+8,ne.codedWidth,"i32"),U.setValue(M+12,ne.codedHeight,"i32"),U.setValue(M+16,ne.chromaFormat,"i32"),U.setValue(M+20,ne.profile,"i32"),U.setValue(M+24,ne.level,"i32"),U.setValue(M+28,ne.hasBFrames,"i32"),U.setValue(M+32,ne.pts,"i64")},ve.Uu=function(U){return U._malloc(this.xu?65536:64)},ve.Tu=function(U,M){var ne,Le=U.getValue(M,"i32"),Ue=4,re=0;this.xu?(re=U.getValue(M+Ue,"i32"),Ue+=4,ne=this.Pu(U,M+32)):ne=this.Pu(U,M+24);var k=[U.getValue(M+Ue,"i32"),U.getValue(M+Ue+4,"i32"),U.getValue(M+Ue+8,"i32")];Ue+=12;var P=[U.getValue(M+Ue,"i16"),U.getValue(M+Ue+2,"i16"),U.getValue(M+Ue+4,"i16")];return Ue+=6,{valid:Le,poc:re,data:k,stride:P,info:ne,ysize:P[0]*ne.height,usize:P[1]*ne.height/2,vsize:P[2]*ne.height/2}},ve.wu=function(){this.eu&&(this.mu={KVCDecoderCreate:this.eu.cwrap("KVCDecoderCreate","number",["number"]),KVCDecoderDestroy:this.eu.cwrap("KVCDecoderDestroy","number",["number"]),KVCDecoderSetDecConfig:this.eu.cwrap("KVCDecoderSetDecConfig","number",["number","number"]),KVCDecodeFrameHeader:this.eu.cwrap("KVCDecodeFrameHeader","number",["number","array","number"]),KVCDecodeFrame:this.eu.cwrap("KVCDecodeFrame","number",["number","array","number","number"]),KVCDecodeFlush:this.eu.cwrap("KVCDecodeFlush","number",["number","number"]),KVCDecoderGetDecodedFrame:this.eu.cwrap("KVCDecoderGetDecodedFrame","number",["number","number"]),KVCDecoderReturnDecodedFrame:this.eu.cwrap("KVCDecoderReturnDecodedFrame","number",["number","number"]),KVCDecoderGetVersion:this.eu.cwrap("KVCDecoderGetVersion","number",[]),KVC19DumpVUIParameters:this.eu.cwrap("KVCDumpVUIParameters","number",["number","number","number"]),module:this.eu},this.eu.Hu&&(this.Ci.i(oe,"post process func detected."),this.mu.KVCDecoderPostProcess=this.eu.cwrap("KVCDecoderPostProcess","number",["number","number"])))},b}(),Oe=Re,de=s.b/s.d,$=[m.a.HEVC_NAL_TRAIL_N,m.a.HEVC_NAL_TSA_N,m.a.HEVC_NAL_STSA_N,m.a.HEVC_NAL_RADL_N,m.a.HEVC_NAL_RASL_N],ge=[m.a.HEVC_NAL_IDR_W_RADL,m.a.HEVC_NAL_IDR_N_LP,m.a.HEVC_NAL_CRA_NUT],Pe=[T.a.VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL,T.a.VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP,T.a.VVC_NAL_UNIT_CODED_SLICE_CRA,T.a.VVC_NAL_UNIT_CODED_SLICE_GDR],ae="video-dec-inline",q=function(){function b(U,M){var ne=this;this.Ci=void 0,this.Yu=void 0,this.Ai=void 0,this.Ba=-1,this.Gu=0,this.La=16,this.Ku=0,this.Le=0,this.Ah=33,this.Zu=0,this.Wu=0,this.Ra=void 0,this.Sa=void 0,this.Xu=!1,this.vt=o.s.canvas,this.zu={id:-1,time:-1},this.Ju=1,this.qu=o.r.AUTO,this.Xa=-1,this.Da=!1,this.$u=0,this.tc=!1,this.ec=16,this.nc=void 0,this.sc=[],this.rc=[],this.hc=void 0,this.oc=function(Le){ne.Ci.i(ae,"seek["+ne.zu.id+"]: on seeked. hit cache:"+Le),ne.Ai.emit(j.a.DECODER_SEEK,{hitCache:Le,id:ne.zu.id}),Le&&(ne.zu.id=-1)},this.ac=function(Le){for(ne.Ku=Le.frame.format.pts;ne.rc.length&&Le.frame.format.pts+1>=ne.rc[0].pts;)ne.rc.shift();if(Le.startTime){var Ue,re=performance.now()-Le.startTime;ne.Ku+=re,ne.Wu++;var k=Le.frame;k.format.sar=(Ue=ne.Sa)==null?void 0:Ue.sar;try{ne.uc(k)}catch(Z){return void ne.Ai.emit(j.a.ERROR,Object(d.e)(d.b.DECODER_ERROR,d.a.DECODER_COPY_YUV_ERROR,"copy yuv error. "+(Z==null?void 0:Z.message)))}ne.Ai.emit(j.a.DECODER_IMG,{droped:ne.Zu,decoded:ne.Wu,decId:ne.Ju,frame:k});var P=ne.zu.time;ne.Da&&(P=ne.Xa>=0?Math.min(ne.Xa,P):P),ne.zu.id>=0&&Le.frame.format.pts+1>=P&&(ne.Ci.i(ae,"seek["+ne.zu.id+"]: on frame seeked. time: "+ne.zu.time+". frmae pts: "+k.format.pts),ne.oc(!0))}},this.fc=function(Le){return Le.units.reduce(function(Ue,re){return $.indexOf(re.type)!==-1&&Ue},!0)},this.Ac=function(Le){return Le.units.reduce(function(Ue,re){return ne.vc(re.type,re.temporalId)&&Ue},!0)},this.vc=function(Le,Ue){return Le!=255&&!!Ue},this.Ai=M,this.Ci=U,this.Ai.on(j.a.DECODER_FRAME,this.ac),this.hc=this.fc,this.nc=new I(U,M)}var ve=b.prototype;return ve.init=function(U,M,ne,Le,Ue,re,k){var P=this;this.Ci.i(ae,"init. "+k),this.Ju=U,this.qu=ne.videoDropFramePolicy,this.nc.updateIdrFrame(ge),k===o.t.kw265?this.Yu=new X(this.Ci,this.Ai):re===o.c.kvc3||re===o.c.kvc4||re===o.c.kvc5||re===o.c.kvc6?this.Yu=new Oe(this.Ci,this.Ai,re):re===o.c.bvc2||re===o.c.vvc||re===o.c.kvc30?(this.nc.updateIdrFrame(Pe),this.hc=this.Ac,this.Yu=new ue(this.Ci,this.Ai)):this.Yu=new W.a(this.Ci,this.Ai);try{this.Yu.init(M,Le,Ue).then(function(){P.Yu&&(P.tc=!0,P.Yu.nextFrame(),P.xa(),P.Ai.emit(j.a.DEC_INIT_COMPLETE,{simd:Le,threads:Ue,decoderType:k}))}).catch(function(Z){P.Ai.emit(j.a.ERROR,Object(d.e)(d.b.DECODER_ERROR,d.a.DECODER_INIT_ERROR,typeof Z!="string"?""+Z:Z))})}catch(Z){this.Ai.emit(j.a.ERROR,Object(d.e)(d.b.DECODER_ERROR,d.a.DECODER_INIT_ERROR,(Z==null?void 0:Z.message)||""))}},ve.appendData=function(U){this.Da&&this.Ci.i(ae,"end of data false on append"),this.Da=!1;var M=this.nc;M.appendData(U),!this.Xu&&M.frameDuration&&(this.Ah=M.frameDuration)},ve.endOfData=function(){this.Ci.i(ae,"end of data"),this.Da=!0},ve.updateState=function(U,M,ne,Le,Ue,re){this.vt=M,this.tc=ne,this.Gu=Le,this.La=re,M!==o.s.video&&(this.Ba=U)},ve.updateMediaInfo=function(U){this.Ci.i(ae,"update media info",U),this.Sa=U,this.dc()},ve.destroy=function(){this.Ai.off(j.a.DECODER_FRAME,this.ac),this.tc=!1,this.Ya()},ve.reset=function(U,M){M===void 0&&(M=!1),this.Ci.i(ae,"reset",U),this.lc(),this.Ju=U,this.Xa=-1,this.Ku=0,this.Le=0,this.Ba=-1,this.Gu=0,this.Da=!1,this.$u=0,this.tc=!0,this.dc(),this.nc.clean(),M||(this.zu.id=-1,this.zu.time=0),this.sc=[]},ve.seek=function(U,M){U=Math.max(0,U),this.zu.id>0&&this.Ci.i(ae,"seek["+M+"]: decoder seek abort ["+this.zu.id+"] "+this.zu.time),this.Ci.i(ae,"seek["+M+"]: decoder seek. time: "+U,U,this.Ba);var ne=this.nc,Le=this.rc;if(this.Ba=this.zu.time=U,this.zu.id=M,Le.length){var Ue=Le[0].pts||0,re=this.rc.reduce(function(Ee,pe){return Math.max(pe.pts,Ee)},Le[Le.length-1].pts);if(this.rc.length<=16&&re>0&&U>=Ue&&U<=re)return void this.Ci.i(ae,"seek["+M+"]: decoder seek hit dec cache. cache st: "+Ue+" ed: "+re)}if(ne.hit(U)){var k=ne.getItemIdxByDts(U),P=ne.idx,Z=ne.current;if(ne.getItem(k),this.Ci.i(ae,"seek["+M+"]: decoder seek. test",Z==null?void 0:Z.dts,U),!Z||U-Z.dts>3e3||U<Z.dts){var he,Ie;this.Ai.emit(j.a.RENDERER_BUF_EXPIRED),ne.seek(U),k<P?this.Ci.i(ae,"seek["+M+"]: decoder seek hit data cache. dec from key dts: "+((he=ne.current)==null?void 0:he.dts)+"/"+U):this.Ci.i(ae,"seek["+M+"]: decoder seek hit data cache. switch gop. "+(Z==null?void 0:Z.gopId)+" -> "+((Ie=ne.current)==null?void 0:Ie.gopId)),this.bc(),this.lc()}else this.Ci.i(ae,"seek["+M+"]: decoder seek hit data cache. continue decode.")}else this.Ci.i(ae,"seek["+M+"]: decoder seek miss cache."),ne.clean(),this.oc(!1)},ve.Fa=function(){return!(!this.Da||this.nc.remain||!this.Yu||this.Yu.isWaitingData()||this.Yu.getPendingNALNumber())},ve.uc=function(U){this.mc(U.y,U.format.width,U.format.height),this.mc(U.u,U.format.chromaWidth,U.format.chromaHeight),this.mc(U.v,U.format.chromaWidth,U.format.chromaHeight)},ve.mc=function(U,M,ne){var Le=U.bits>8?2:1;if(U.stride/Le>M){for(var Ue=new Uint8Array(M*ne*Le),re=0;re<ne;re++)Ue.set(U.bytes.subarray(U.stride*re,U.stride*re+M*Le),re*M*Le);U.stride=M*Le,U.bytes=Ue}else U.bytes=new Uint8Array(U.bytes)},ve.gc=function(U){if(this.Yu&&U){for(var M=0;M<this.sc.length;M++){if(this.sc[M]===U.id)return void this.sc.shift();this.sc[M]<U.id&&this.sc.shift()}this.rc.push({pts:U.pts,dts:U.dts,gopId:U.gopId}),this.rc.sort(function(Le,Ue){return Le.pts-Ue.pts});try{this.Yu.pushNalus(U.data.units,U.pts,this.Da&&!this.nc.remain),U.pts>this.$u&&(this.$u=U.pts),U.type===A.d.videoFrame&&(this.Le=U.dts,this.nc.remain||this.Yu.endOfFrame())}catch(Le){var ne="push data pts:"+Math.round(U.pts)+" dts:"+Math.round(U.dts)+" to dec error.";this.Ci.i(ae,ne,Le),this.Ai.emit(j.a.ERROR,Object(d.e)(d.b.DECODER_ERROR,d.a.DECODER_DEC_ERROR,ne,{fatal:!1}))}}},ve.lc=function(){var U;(U=this.Yu)==null||U.rebuild(),this.rc=[]},ve.bc=function(){this.Ci.i(ae,"reset time"),this.Yu&&this.Le&&this.Yu.reset(),this.Ku=0,this.Le=0,this.$u=0},ve.yc=function(){if(this.Yu&&this.Ba!==-1&&this.vt!==o.s.video){var U=this.nc,M=this.Ba;if(this.Ku&&U.remain&&this.tc&&this.zu.id<0){var ne=this._c(M),Le=U.getItem(ne);Le&&ne>5&&this.Cc(M,Le.gopId)}M+=(this.La+16)*this.Ah;var Ue=this.Gu<this.La;if(this.tc&&U.remain&&(this.Ku<=M||Ue)){for(var re=U.current,k=0;re&&(re.pts<=M||re.dts<=M||!this.Le||Ue)&&!(++k>3);)this.gc(re),U.next(),re=U.current,Ue=!1;this.Da&&!U.remain?(this.Yu.flush(),this.Ai.emit(j.a.DECODER_DATA_END)):U.remain<this.ec&&this.Ai.emit(j.a.DECODER_BUF_LOW)}this.Yu.isWaitingData()&&!this.Yu.getPendingNALNumber()||this.Yu.nextFrame()}},ve._c=function(U){for(var M=this.nc,ne=M.idx;ne<M.length;ne++){var Le=M.data[ne];if(Le.type===A.d.videoFrame&&Le.dts>=U)return ne-M.idx}return M.remain?M.remain:-1},ve.Cc=function(U,M){for(var ne=[],Le=this.nc,Ue=Le.idx;Ue<Le.length;){var re=Le.getItem(Ue);if(re.type===A.d.videoFrame)if(re.gopId<M)ne.push(re);else{if(re.gopId>M||!(U>re.dts&&this.qu!==o.r.MIN))break;this.hc(re.data)&&ne.push(re)}else re.gopId<M&&ne.push(re);Ue++}this.Ic(ne,M)},ve.Ic=function(U,M){var ne=!1,Le=!1,Ue={frames:[]};if(U.length){U.sort(function(k,P){return k.pts-P.pts});for(var re=0;re<U.length;re++)U[re].discontinuity&&(ne=!0),U[re].gopId!==M&&(Le=!0),this.sc.push(U[re].id),Ue.frames.push({pts:U[re].pts})}this.Zu+=U.length,Le&&this.Yu&&this.lc(),ne&&this.bc(),Ue.frames.length&&(this.Ci.i(ae,"drop frame. num: "+Ue.frames.length+" rebuild: "+Le+" pts: "+Ue.frames[0].pts+"~"+Ue.frames[Ue.frames.length-1].pts),this.Ai.emit(j.a.DECODER_DROP_FRAME,Ue))},ve.dc=function(){var U=this.Sa;U&&U.fps&&typeof U.fps=="number"&&U.fps>0&&U.fps<s.n?(this.Xu=!0,this.Ah=s.b/U.fps,this.ec=Math.max(2*U.fps,16)):this.Ah=de},ve.xa=function(){var U=this;this.Ra||(this.Ra=setInterval(function(){U.yc()},0))},ve.Ya=function(){this.Ra&&(clearInterval(this.Ra),this.Ra=void 0)},b}();i.a=q},function(r,i){r.exports=void 0},function(r,i,n){var o,s,d,m,A,T,C,h,F,w,I,S,W,j,N,K,z,B,J,be,X,ye,Be,Ve,je,we,ue,L,D,le,oe,Re,Oe,de,$,ge,Pe,ae,q;r.exports=(s=o="3.7.7",d=typeof Buffer=="function",m=typeof TextDecoder=="function"?new TextDecoder:void 0,A=typeof TextEncoder=="function"?new TextEncoder:void 0,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",C=Array.prototype.slice.call(T),q={},C.forEach(function(b,ve){return q[b]=ve}),h=q,F=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,w=String.fromCharCode.bind(String),I=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(b){return new Uint8Array(Array.prototype.slice.call(b,0))},S=function(b){return b.replace(/=/g,"").replace(/[+\/]/g,function(ve){return ve=="+"?"-":"_"})},W=function(b){return b.replace(/[^A-Za-z0-9\+\/]/g,"")},j=function(b){for(var ve,U,M,ne,Le="",Ue=b.length%3,re=0;re<b.length;){if((U=b.charCodeAt(re++))>255||(M=b.charCodeAt(re++))>255||(ne=b.charCodeAt(re++))>255)throw new TypeError("invalid character found");Le+=C[(ve=U<<16|M<<8|ne)>>18&63]+C[ve>>12&63]+C[ve>>6&63]+C[63&ve]}return Ue?Le.slice(0,Ue-3)+"===".substring(Ue):Le},N=typeof btoa=="function"?function(b){return btoa(b)}:d?function(b){return Buffer.from(b,"binary").toString("base64")}:j,K=d?function(b){return Buffer.from(b).toString("base64")}:function(b){for(var ve=4096,U=[],M=0,ne=b.length;M<ne;M+=ve)U.push(w.apply(null,b.subarray(M,M+ve)));return N(U.join(""))},z=function(b,ve){return ve===void 0&&(ve=!1),ve?S(K(b)):K(b)},B=function(b){if(b.length<2)return(ve=b.charCodeAt(0))<128?b:ve<2048?w(192|ve>>>6)+w(128|63&ve):w(224|ve>>>12&15)+w(128|ve>>>6&63)+w(128|63&ve);var ve=65536+1024*(b.charCodeAt(0)-55296)+(b.charCodeAt(1)-56320);return w(240|ve>>>18&7)+w(128|ve>>>12&63)+w(128|ve>>>6&63)+w(128|63&ve)},J=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,be=function(b){return b.replace(J,B)},X=d?function(b){return Buffer.from(b,"utf8").toString("base64")}:A?function(b){return K(A.encode(b))}:function(b){return N(be(b))},ye=function(b,ve){return ve===void 0&&(ve=!1),ve?S(X(b)):X(b)},Be=function(b){return ye(b,!0)},Ve=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,je=function(b){switch(b.length){case 4:var ve=((7&b.charCodeAt(0))<<18|(63&b.charCodeAt(1))<<12|(63&b.charCodeAt(2))<<6|63&b.charCodeAt(3))-65536;return w(55296+(ve>>>10))+w(56320+(1023&ve));case 3:return w((15&b.charCodeAt(0))<<12|(63&b.charCodeAt(1))<<6|63&b.charCodeAt(2));default:return w((31&b.charCodeAt(0))<<6|63&b.charCodeAt(1))}},we=function(b){return b.replace(Ve,je)},ue=function(b){if(b=b.replace(/\s+/g,""),!F.test(b))throw new TypeError("malformed base64.");b+="==".slice(2-(3&b.length));for(var ve,U,M,ne="",Le=0;Le<b.length;)ve=h[b.charAt(Le++)]<<18|h[b.charAt(Le++)]<<12|(U=h[b.charAt(Le++)])<<6|(M=h[b.charAt(Le++)]),ne+=U===64?w(ve>>16&255):M===64?w(ve>>16&255,ve>>8&255):w(ve>>16&255,ve>>8&255,255&ve);return ne},L=typeof atob=="function"?function(b){return atob(W(b))}:d?function(b){return Buffer.from(b,"base64").toString("binary")}:ue,D=d?function(b){return I(Buffer.from(b,"base64"))}:function(b){return I(L(b).split("").map(function(ve){return ve.charCodeAt(0)}))},le=function(b){return D(Re(b))},oe=d?function(b){return Buffer.from(b,"base64").toString("utf8")}:m?function(b){return m.decode(D(b))}:function(b){return we(L(b))},Re=function(b){return W(b.replace(/[-_]/g,function(ve){return ve=="-"?"+":"/"}))},de=function(b){return{value:b,enumerable:!1,writable:!0,configurable:!0}},$=function(){var b=function(ve,U){return Object.defineProperty(String.prototype,ve,de(U))};b("fromBase64",function(){return Oe(this)}),b("toBase64",function(ve){return ye(this,ve)}),b("toBase64URI",function(){return ye(this,!0)}),b("toBase64URL",function(){return ye(this,!0)}),b("toUint8Array",function(){return le(this)})},ge=function(){var b=function(ve,U){return Object.defineProperty(Uint8Array.prototype,ve,de(U))};b("toBase64",function(ve){return z(this,ve)}),b("toBase64URI",function(){return z(this,!0)}),b("toBase64URL",function(){return z(this,!0)})},Pe=function(){$(),ge()},ae={version:o,VERSION:s,atob:L,atobPolyfill:ue,btoa:N,btoaPolyfill:j,fromBase64:Oe=function(b){return oe(Re(b))},toBase64:ye,encode:ye,encodeURI:Be,encodeURL:Be,utob:be,btou:we,decode:Oe,isValid:function(b){if(typeof b!="string")return!1;var ve=b.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(ve)||!/[^\s0-9a-zA-Z\-_]/.test(ve)},fromUint8Array:z,toUint8Array:le,extendString:$,extendUint8Array:ge,extendBuiltins:Pe,Base64:{}},Object.keys(ae).forEach(function(b){return ae.Base64[b]=ae[b]}),ae)},function(r,i,n){var o=n(53).default,s=n(55);r.exports=function(d){var m=s(d,"string");return o(m)==="symbol"?m:String(m)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){function n(o){return r.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,n(o)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){r.exports=function(o){var s={};function d(m){if(s[m])return s[m].exports;var A=s[m]={i:m,l:!1,exports:{}};return o[m].call(A.exports,A,A.exports,d),A.l=!0,A.exports}return d.m=o,d.c=s,d.d=function(m,A,T){d.o(m,A)||Object.defineProperty(m,A,{enumerable:!0,get:T})},d.r=function(m){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(m,"__esModule",{value:!0})},d.t=function(m,A){if(1&A&&(m=d(m)),8&A||4&A&&typeof m=="object"&&m&&m.__esModule)return m;var T=Object.create(null);if(d.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:m}),2&A&&typeof m!="string")for(var C in m)d.d(T,C,function(h){return m[h]}.bind(null,C));return T},d.n=function(m){var A=m&&m.__esModule?function(){return m.default}:function(){return m};return d.d(A,"a",A),A},d.o=function(m,A){return Object.prototype.hasOwnProperty.call(m,A)},d.p="",d(d.s=9)}([function(o,s,d){var m=d(8)();o.exports=m;try{regeneratorRuntime=m}catch(A){typeof globalThis=="object"?globalThis.regeneratorRuntime=m:Function("r","regeneratorRuntime = r")(m)}},function(o,s){function d(m,A,T,C,h,F,w){try{var I=m[F](w),S=I.value}catch(W){return void T(W)}I.done?A(S):Promise.resolve(S).then(C,h)}o.exports=function(m){return function(){var A=this,T=arguments;return new Promise(function(C,h){var F=m.apply(A,T);function w(S){d(F,C,h,w,I,"next",S)}function I(S){d(F,C,h,w,I,"throw",S)}w(void 0)})}},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(6);function A(T,C){for(var h=0;h<C.length;h++){var F=C[h];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(T,m(F.key),F)}}o.exports=function(T,C,h){return C&&A(T.prototype,C),h&&A(T,h),Object.defineProperty(T,"prototype",{writable:!1}),T},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s){function d(m){return o.exports=d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o.exports.__esModule=!0,o.exports.default=o.exports,d(m)}o.exports=d,o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){o.exports=function(){var m,A="3.7.7",T=A,C=typeof Buffer=="function",h=typeof TextDecoder=="function"?new TextDecoder:void 0,F=typeof TextEncoder=="function"?new TextEncoder:void 0,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",I=Array.prototype.slice.call(w),S=(m={},I.forEach(function(M,ne){return m[M]=ne}),m),W=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,j=String.fromCharCode.bind(String),N=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(M){return new Uint8Array(Array.prototype.slice.call(M,0))},K=function(M){return M.replace(/=/g,"").replace(/[+\/]/g,function(ne){return ne=="+"?"-":"_"})},z=function(M){return M.replace(/[^A-Za-z0-9\+\/]/g,"")},B=function(M){for(var ne,Le,Ue,re,k="",P=M.length%3,Z=0;Z<M.length;){if((Le=M.charCodeAt(Z++))>255||(Ue=M.charCodeAt(Z++))>255||(re=M.charCodeAt(Z++))>255)throw new TypeError("invalid character found");k+=I[(ne=Le<<16|Ue<<8|re)>>18&63]+I[ne>>12&63]+I[ne>>6&63]+I[63&ne]}return P?k.slice(0,P-3)+"===".substring(P):k},J=typeof btoa=="function"?function(M){return btoa(M)}:C?function(M){return Buffer.from(M,"binary").toString("base64")}:B,be=C?function(M){return Buffer.from(M).toString("base64")}:function(M){for(var ne=4096,Le=[],Ue=0,re=M.length;Ue<re;Ue+=ne)Le.push(j.apply(null,M.subarray(Ue,Ue+ne)));return J(Le.join(""))},X=function(M,ne){return ne===void 0&&(ne=!1),ne?K(be(M)):be(M)},ye=function(M){if(M.length<2)return(ne=M.charCodeAt(0))<128?M:ne<2048?j(192|ne>>>6)+j(128|63&ne):j(224|ne>>>12&15)+j(128|ne>>>6&63)+j(128|63&ne);var ne=65536+1024*(M.charCodeAt(0)-55296)+(M.charCodeAt(1)-56320);return j(240|ne>>>18&7)+j(128|ne>>>12&63)+j(128|ne>>>6&63)+j(128|63&ne)},Be=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ve=function(M){return M.replace(Be,ye)},je=C?function(M){return Buffer.from(M,"utf8").toString("base64")}:F?function(M){return be(F.encode(M))}:function(M){return J(Ve(M))},we=function(M,ne){return ne===void 0&&(ne=!1),ne?K(je(M)):je(M)},ue=function(M){return we(M,!0)},L=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,D=function(M){switch(M.length){case 4:var ne=((7&M.charCodeAt(0))<<18|(63&M.charCodeAt(1))<<12|(63&M.charCodeAt(2))<<6|63&M.charCodeAt(3))-65536;return j(55296+(ne>>>10))+j(56320+(1023&ne));case 3:return j((15&M.charCodeAt(0))<<12|(63&M.charCodeAt(1))<<6|63&M.charCodeAt(2));default:return j((31&M.charCodeAt(0))<<6|63&M.charCodeAt(1))}},le=function(M){return M.replace(L,D)},oe=function(M){if(M=M.replace(/\s+/g,""),!W.test(M))throw new TypeError("malformed base64.");M+="==".slice(2-(3&M.length));for(var ne,Le,Ue,re="",k=0;k<M.length;)ne=S[M.charAt(k++)]<<18|S[M.charAt(k++)]<<12|(Le=S[M.charAt(k++)])<<6|(Ue=S[M.charAt(k++)]),re+=Le===64?j(ne>>16&255):Ue===64?j(ne>>16&255,ne>>8&255):j(ne>>16&255,ne>>8&255,255&ne);return re},Re=typeof atob=="function"?function(M){return atob(z(M))}:C?function(M){return Buffer.from(M,"base64").toString("binary")}:oe,Oe=C?function(M){return N(Buffer.from(M,"base64"))}:function(M){return N(Re(M).split("").map(function(ne){return ne.charCodeAt(0)}))},de=function(M){return Oe(ge(M))},$=C?function(M){return Buffer.from(M,"base64").toString("utf8")}:h?function(M){return h.decode(Oe(M))}:function(M){return le(Re(M))},ge=function(M){return z(M.replace(/[-_]/g,function(ne){return ne=="-"?"+":"/"}))},Pe=function(M){return $(ge(M))},ae=function(M){return{value:M,enumerable:!1,writable:!0,configurable:!0}},q=function(){var M=function(ne,Le){return Object.defineProperty(String.prototype,ne,ae(Le))};M("fromBase64",function(){return Pe(this)}),M("toBase64",function(ne){return we(this,ne)}),M("toBase64URI",function(){return we(this,!0)}),M("toBase64URL",function(){return we(this,!0)}),M("toUint8Array",function(){return de(this)})},b=function(){var M=function(ne,Le){return Object.defineProperty(Uint8Array.prototype,ne,ae(Le))};M("toBase64",function(ne){return X(this,ne)}),M("toBase64URI",function(){return X(this,!0)}),M("toBase64URL",function(){return X(this,!0)})},ve=function(){q(),b()},U={version:A,VERSION:T,atob:Re,atobPolyfill:oe,btoa:J,btoaPolyfill:B,fromBase64:Pe,toBase64:we,encode:we,encodeURI:ue,encodeURL:ue,utob:Ve,btou:le,decode:Pe,isValid:function(M){if(typeof M!="string")return!1;var ne=M.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(ne)||!/[^\s0-9a-zA-Z\-_]/.test(ne)},fromUint8Array:X,toUint8Array:de,extendString:q,extendUint8Array:b,extendBuiltins:ve,Base64:{}};return Object.keys(U).forEach(function(M){return U.Base64[M]=U[M]}),U}()},function(o,s){function d(){return o.exports=d=Object.assign?Object.assign.bind():function(m){for(var A=1;A<arguments.length;A++){var T=arguments[A];for(var C in T)({}).hasOwnProperty.call(T,C)&&(m[C]=T[C])}return m},o.exports.__esModule=!0,o.exports.default=o.exports,d.apply(null,arguments)}o.exports=d,o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(3).default,A=d(7);o.exports=function(T){var C=A(T,"string");return m(C)=="symbol"?C:C+""},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(3).default;o.exports=function(A,T){if(m(A)!="object"||!A)return A;var C=A[Symbol.toPrimitive];if(C!==void 0){var h=C.call(A,T||"default");if(m(h)!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(A)},o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){var m=d(3).default;function A(){o.exports=A=function(){return C},o.exports.__esModule=!0,o.exports.default=o.exports;var T,C={},h=Object.prototype,F=h.hasOwnProperty,w=Object.defineProperty||function(ae,q,b){ae[q]=b.value},I=typeof Symbol=="function"?Symbol:{},S=I.iterator||"@@iterator",W=I.asyncIterator||"@@asyncIterator",j=I.toStringTag||"@@toStringTag";function N(ae,q,b){return Object.defineProperty(ae,q,{value:b,enumerable:!0,configurable:!0,writable:!0}),ae[q]}try{N({},"")}catch(ae){N=function(q,b,ve){return q[b]=ve}}function K(ae,q,b,ve){var U=q&&q.prototype instanceof Be?q:Be,M=Object.create(U.prototype),ne=new ge(ve||[]);return w(M,"_invoke",{value:Re(ae,b,ne)}),M}function z(ae,q,b){try{return{type:"normal",arg:ae.call(q,b)}}catch(ve){return{type:"throw",arg:ve}}}C.wrap=K;var B="suspendedStart",J="suspendedYield",be="executing",X="completed",ye={};function Be(){}function Ve(){}function je(){}var we={};N(we,S,function(){return this});var ue=Object.getPrototypeOf,L=ue&&ue(ue(Pe([])));L&&L!==h&&F.call(L,S)&&(we=L);var D=je.prototype=Be.prototype=Object.create(we);function le(ae){["next","throw","return"].forEach(function(q){N(ae,q,function(b){return this._invoke(q,b)})})}function oe(ae,q){function b(U,M,ne,Le){var Ue=z(ae[U],ae,M);if(Ue.type!=="throw"){var re=Ue.arg,k=re.value;return k&&m(k)=="object"&&F.call(k,"__await")?q.resolve(k.__await).then(function(P){b("next",P,ne,Le)},function(P){b("throw",P,ne,Le)}):q.resolve(k).then(function(P){re.value=P,ne(re)},function(P){return b("throw",P,ne,Le)})}Le(Ue.arg)}var ve;w(this,"_invoke",{value:function(U,M){function ne(){return new q(function(Le,Ue){b(U,M,Le,Ue)})}return ve=ve?ve.then(ne,ne):ne()}})}function Re(ae,q,b){var ve=B;return function(U,M){if(ve===be)throw Error("Generator is already running");if(ve===X){if(U==="throw")throw M;return{value:T,done:!0}}for(b.method=U,b.arg=M;;){var ne=b.delegate;if(ne){var Le=Oe(ne,b);if(Le){if(Le===ye)continue;return Le}}if(b.method==="next")b.sent=b.A=b.arg;else if(b.method==="throw"){if(ve===B)throw ve=X,b.arg;b.dispatchException(b.arg)}else b.method==="return"&&b.abrupt("return",b.arg);ve=be;var Ue=z(ae,q,b);if(Ue.type==="normal"){if(ve=b.done?X:J,Ue.arg===ye)continue;return{value:Ue.arg,done:b.done}}Ue.type==="throw"&&(ve=X,b.method="throw",b.arg=Ue.arg)}}}function Oe(ae,q){var b=q.method,ve=ae.iterator[b];if(ve===T)return q.delegate=null,b==="throw"&&ae.iterator.return&&(q.method="return",q.arg=T,Oe(ae,q),q.method==="throw")||b!=="return"&&(q.method="throw",q.arg=new TypeError("The iterator does not provide a '"+b+"' method")),ye;var U=z(ve,ae.iterator,q.arg);if(U.type==="throw")return q.method="throw",q.arg=U.arg,q.delegate=null,ye;var M=U.arg;return M?M.done?(q[ae.resultName]=M.value,q.next=ae.nextLoc,q.method!=="return"&&(q.method="next",q.arg=T),q.delegate=null,ye):M:(q.method="throw",q.arg=new TypeError("iterator result is not an object"),q.delegate=null,ye)}function de(ae){var q={tryLoc:ae[0]};1 in ae&&(q.catchLoc=ae[1]),2 in ae&&(q.finallyLoc=ae[2],q.afterLoc=ae[3]),this.tryEntries.push(q)}function $(ae){var q=ae.completion||{};q.type="normal",delete q.arg,ae.completion=q}function ge(ae){this.tryEntries=[{tryLoc:"root"}],ae.forEach(de,this),this.reset(!0)}function Pe(ae){if(ae||ae===""){var q=ae[S];if(q)return q.call(ae);if(typeof ae.next=="function")return ae;if(!isNaN(ae.length)){var b=-1,ve=function U(){for(;++b<ae.length;)if(F.call(ae,b))return U.value=ae[b],U.done=!1,U;return U.value=T,U.done=!0,U};return ve.next=ve}}throw new TypeError(m(ae)+" is not iterable")}return Ve.prototype=je,w(D,"constructor",{value:je,configurable:!0}),w(je,"constructor",{value:Ve,configurable:!0}),Ve.displayName=N(je,j,"GeneratorFunction"),C.isGeneratorFunction=function(ae){var q=typeof ae=="function"&&ae.constructor;return!!q&&(q===Ve||(q.displayName||q.name)==="GeneratorFunction")},C.mark=function(ae){return Object.setPrototypeOf?Object.setPrototypeOf(ae,je):(ae.__proto__=je,N(ae,j,"GeneratorFunction")),ae.prototype=Object.create(D),ae},C.awrap=function(ae){return{__await:ae}},le(oe.prototype),N(oe.prototype,W,function(){return this}),C.AsyncIterator=oe,C.async=function(ae,q,b,ve,U){U===void 0&&(U=Promise);var M=new oe(K(ae,q,b,ve),U);return C.isGeneratorFunction(q)?M:M.next().then(function(ne){return ne.done?ne.value:M.next()})},le(D),N(D,j,"Generator"),N(D,S,function(){return this}),N(D,"toString",function(){return"[object Generator]"}),C.keys=function(ae){var q=Object(ae),b=[];for(var ve in q)b.push(ve);return b.reverse(),function U(){for(;b.length;){var M=b.pop();if(M in q)return U.value=M,U.done=!1,U}return U.done=!0,U}},C.values=Pe,ge.prototype={constructor:ge,reset:function(ae){if(this.prev=0,this.next=0,this.sent=this.A=T,this.done=!1,this.delegate=null,this.method="next",this.arg=T,this.tryEntries.forEach($),!ae)for(var q in this)q.charAt(0)==="t"&&F.call(this,q)&&!isNaN(+q.slice(1))&&(this[q]=T)},stop:function(){this.done=!0;var ae=this.tryEntries[0].completion;if(ae.type==="throw")throw ae.arg;return this.rval},dispatchException:function(ae){if(this.done)throw ae;var q=this;function b(Ue,re){return M.type="throw",M.arg=ae,q.next=Ue,re&&(q.method="next",q.arg=T),!!re}for(var ve=this.tryEntries.length-1;ve>=0;--ve){var U=this.tryEntries[ve],M=U.completion;if(U.tryLoc==="root")return b("end");if(U.tryLoc<=this.prev){var ne=F.call(U,"catchLoc"),Le=F.call(U,"finallyLoc");if(ne&&Le){if(this.prev<U.catchLoc)return b(U.catchLoc,!0);if(this.prev<U.finallyLoc)return b(U.finallyLoc)}else if(ne){if(this.prev<U.catchLoc)return b(U.catchLoc,!0)}else{if(!Le)throw Error("try statement without catch or finally");if(this.prev<U.finallyLoc)return b(U.finallyLoc)}}}},abrupt:function(ae,q){for(var b=this.tryEntries.length-1;b>=0;--b){var ve=this.tryEntries[b];if(ve.tryLoc<=this.prev&&F.call(ve,"finallyLoc")&&this.prev<ve.finallyLoc){var U=ve;break}}U&&(ae==="break"||ae==="continue")&&U.tryLoc<=q&&q<=U.finallyLoc&&(U=null);var M=U?U.completion:{};return M.type=ae,M.arg=q,U?(this.method="next",this.next=U.finallyLoc,ye):this.complete(M)},complete:function(ae,q){if(ae.type==="throw")throw ae.arg;return ae.type==="break"||ae.type==="continue"?this.next=ae.arg:ae.type==="return"?(this.rval=this.arg=ae.arg,this.method="return",this.next="end"):ae.type==="normal"&&q&&(this.next=q),ye},finish:function(ae){for(var q=this.tryEntries.length-1;q>=0;--q){var b=this.tryEntries[q];if(b.finallyLoc===ae)return this.complete(b.completion,b.afterLoc),$(b),ye}},catch:function(ae){for(var q=this.tryEntries.length-1;q>=0;--q){var b=this.tryEntries[q];if(b.tryLoc===ae){var ve=b.completion;if(ve.type==="throw"){var U=ve.arg;$(b)}return U}}throw Error("illegal catch attempt")},delegateYield:function(ae,q,b){return this.delegate={iterator:Pe(ae),resultName:q,nextLoc:b},this.method==="next"&&(this.arg=T),ye}},C}o.exports=A,o.exports.__esModule=!0,o.exports.default=o.exports},function(o,s,d){d.r(s),d.d(s,"KwaiPlayerYUV2RGB",function(){return Ve});var m=d(1),A=d.n(m),T=d(2),C=d.n(T),h=d(0),F=d.n(h),w=d(4),I="AGFzbQEAAAABHQVgAX8Bf2AAAGABfwBgAAF/YAh/f39/f39/fwF/AgcBAWEBYQAAAwcGAAECAAMEBAUBcAEBAQUHAQGAEICAAgYJAX8BQZCMhCALBx0HAWICAAFjAAIBZAAGAWUABQFmAQABZwAEAWgAAwqHOgZRAQJ/QYAIKAIAIgEgAEEHakF4cSICaiEAAkAgAkEAIAAgAU0bRQRAIAA/AEEQdE0NASAAEAANAQtBkIiAIEEwNgIAQX8PC0GACCAANgIAIAELAgALkgwBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQJxRQ0BIAMgAygCACIBayIDQaSIgCAoAgBJDQEgACABaiEAAkACQAJAQaiIgCAoAgAgA0cEQCADKAIMIQIgAUH/AU0EQCACIAMoAggiBEcNAkGUiIAgQZSIgCAoAgBBfiABQQN2d3E2AgAMBQsgAygCGCEGIAIgA0cEQCADKAIIIgEgAjYCDCACIAE2AggMBAsgAygCFCIBBH8gA0EUagUgAygCECIBRQ0DIANBEGoLIQQDQCAEIQcgASICQRRqIQQgAigCFCIBDQAgAkEQaiEEIAIoAhAiAQ0ACyAHQQA2AgAMAwsgBSgCBCIBQQNxQQNHDQNBnIiAICAANgIAIAUgAUF+cTYCBCADIABBAXI2AgQgBSAANgIADwsgBCACNgIMIAIgBDYCCAwCC0EAIQILIAZFDQACQCADKAIcIgFBAnRBxIqAIGoiBCgCACADRgRAIAQgAjYCACACDQFBmIiAIEGYiIAgKAIAQX4gAXdxNgIADAILIAZBEEEUIAYoAhAgA0YbaiACNgIAIAJFDQELIAIgBjYCGCADKAIQIgEEQCACIAE2AhAgASACNgIYCyADKAIUIgFFDQAgAiABNgIUIAEgAjYCGAsgAyAFTw0AIAUoAgQiAUEBcUUNAAJAAkACQAJAIAFBAnFFBEBBrIiAICgCACAFRgRAQayIgCAgAzYCAEGgiIAgQaCIgCAoAgAgAGoiADYCACADIABBAXI2AgQgA0GoiIAgKAIARw0GQZyIgCBBADYCAEGoiIAgQQA2AgAPC0GoiIAgKAIAIAVGBEBBqIiAICADNgIAQZyIgCBBnIiAICgCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQAgBSgCDCECIAFB/wFNBEAgBSgCCCIEIAJGBEBBlIiAIEGUiIAgKAIAQX4gAUEDdndxNgIADAULIAQgAjYCDCACIAQ2AggMBAsgBSgCGCEGIAIgBUcEQCAFKAIIIgEgAjYCDCACIAE2AggMAwsgBSgCFCIBBH8gBUEUagUgBSgCECIBRQ0CIAVBEGoLIQQDQCAEIQcgASICQRRqIQQgAigCFCIBDQAgAkEQaiEEIAIoAhAiAQ0ACyAHQQA2AgAMAgsgBSABQX5xNgIEIAMgAEEBcjYCBCAAIANqIAA2AgAMAwtBACECCyAGRQ0AAkAgBSgCHCIBQQJ0QcSKgCBqIgQoAgAgBUYEQCAEIAI2AgAgAg0BQZiIgCBBmIiAICgCAEF+IAF3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogAjYCACACRQ0BCyACIAY2AhggBSgCECIBBEAgAiABNgIQIAEgAjYCGAsgBSgCFCIBRQ0AIAIgATYCFCABIAI2AhgLIAMgAEEBcjYCBCAAIANqIAA2AgAgA0GoiIAgKAIARw0AQZyIgCAgADYCAA8LIABB/wFNBEAgAEF4cUG8iIAgaiEBAn9BlIiAICgCACIEQQEgAEEDdnQiAHFFBEBBlIiAICAAIARyNgIAIAEMAQsgASgCCAshACABIAM2AgggACADNgIMIAMgATYCDCADIAA2AggPC0EfIQIgAEH///8HTQRAIABBJiAAQQh2ZyIBa3ZBAXEgAUEBdGtBPmohAgsgAyACNgIcIANCADcCECACQQJ0QcSKgCBqIQcCfwJAAn9BmIiAICgCACIBQQEgAnQiBHFFBEBBmIiAICABIARyNgIAQRghAiAHIQRBCAwBCyAAQRkgAkEBdmtBACACQR9HG3QhAiAHKAIAIQQDQCAEIgEoAgRBeHEgAEYNAiACQR12IQQgAkEBdCECIAEgBEEEcWpBEGoiBygCACIEDQALQRghAiABIQRBCAshACADIQEgAwwBCyABKAIIIgQgAzYCDEEIIQIgAUEIaiEHQRghAEEACyEFIAcgAzYCACACIANqIAQ2AgAgAyABNgIMIAAgA2ogBTYCAEG0iIAgQbSIgCAoAgBBAWsiAEF/IAAbNgIACwu4KQELfyMAQRBrIgokAAJAAkACQAJAAkACQAJAAkACQAJAIABB9AFNBEBBlIiAICgCACIEQRAgAEELakH4A3EgAEELSRsiBkEDdiIAdiIBQQNxBEACQCABQX9zQQFxIABqIgJBA3QiAUG8iIAgaiIAIAFBxIiAIGooAgAiASgCCCIFRgRAQZSIgCAgBEF+IAJ3cTYCAAwBCyAFIAA2AgwgACAFNgIICyABQQhqIQAgASACQQN0IgJBA3I2AgQgASACaiIBIAEoAgRBAXI2AgQMCwsgBkGciIAgKAIAIghNDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIBQQN0IgBBvIiAIGoiAiAAQcSIgCBqKAIAIgAoAggiBUYEQEGUiIAgIARBfiABd3EiBDYCAAwBCyAFIAI2AgwgAiAFNgIICyAAIAZBA3I2AgQgACAGaiIHIAFBA3QiASAGayIFQQFyNgIEIAAgAWogBTYCACAIBEAgCEF4cUG8iIAgaiEBQaiIgCAoAgAhAgJ/IARBASAIQQN2dCIDcUUEQEGUiIAgIAMgBHI2AgAgAQwBCyABKAIICyEDIAEgAjYCCCADIAI2AgwgAiABNgIMIAIgAzYCCAsgAEEIaiEAQaiIgCAgBzYCAEGciIAgIAU2AgAMCwtBmIiAICgCACILRQ0BIAtoQQJ0QcSKgCBqKAIAIgIoAgRBeHEgBmshAyACIQEDQAJAIAEoAhAiAEUEQCABKAIUIgBFDQELIAAoAgRBeHEgBmsiASADIAEgA0kiARshAyAAIAIgARshAiAAIQEMAQsLIAIoAhghCSACIAIoAgwiAEcEQCACKAIIIgEgADYCDCAAIAE2AggMCgsgAigCFCIBBH8gAkEUagUgAigCECIBRQ0DIAJBEGoLIQUDQCAFIQcgASIAQRRqIQUgACgCFCIBDQAgAEEQaiEFIAAoAhAiAQ0ACyAHQQA2AgAMCQtBfyEGIABBv39LDQAgAEELaiIBQXhxIQZBmIiAICgCACIHRQ0AQR8hCEEAIAZrIQMgAEH0//8HTQRAIAZBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohCAsCQAJAAkAgCEECdEHEioAgaigCACIBRQRAQQAhAAwBC0EAIQAgBkEZIAhBAXZrQQAgCEEfRxt0IQIDQAJAIAEoAgRBeHEgBmsiBCADTw0AIAEhBSAEIgMNAEEAIQMgASEADAMLIAAgASgCFCIEIAQgASACQR12QQRxaigCECIBRhsgACAEGyEAIAJBAXQhAiABDQALCyAAIAVyRQRAQQAhBUECIAh0IgBBACAAa3IgB3EiAEUNAyAAaEECdEHEioAgaigCACEACyAARQ0BCwNAIAAoAgRBeHEgBmsiAiADSSEBIAIgAyABGyEDIAAgBSABGyEFIAAoAhAiAQR/IAEFIAAoAhQLIgANAAsLIAVFDQAgA0GciIAgKAIAIAZrTw0AIAUoAhghCCAFIAUoAgwiAEcEQCAFKAIIIgEgADYCDCAAIAE2AggMCAsgBSgCFCIBBH8gBUEUagUgBSgCECIBRQ0DIAVBEGoLIQIDQCACIQQgASIAQRRqIQIgACgCFCIBDQAgAEEQaiECIAAoAhAiAQ0ACyAEQQA2AgAMBwsgBkGciIAgKAIAIgVNBEBBqIiAICgCACEAAkAgBSAGayIBQRBPBEAgACAGaiICIAFBAXI2AgQgACAFaiABNgIAIAAgBkEDcjYCBAwBCyAAIAVBA3I2AgQgACAFaiIBIAEoAgRBAXI2AgRBACECQQAhAQtBnIiAICABNgIAQaiIgCAgAjYCACAAQQhqIQAMCQsgBkGgiIAgKAIAIgJJBEBBoIiAICACIAZrIgE2AgBBrIiAIEGsiIAgKAIAIgAgBmoiAjYCACACIAFBAXI2AgQgACAGQQNyNgIEIABBCGohAAwJC0EAIQAgBkEvaiIDAn9B7IuAICgCAARAQfSLgCAoAgAMAQtB+IuAIEJ/NwIAQfCLgCBCgKCAgICABDcCAEHsi4AgIApBDGpBcHFB2KrVqgVzNgIAQYCMgCBBADYCAEHQi4AgQQA2AgBBgCALIgFqIgRBACABayIHcSIBIAZNDQhBzIuAICgCACIFBEBBxIuAICgCACIIIAFqIgkgCE0gBSAJSXINCQsCQEHQi4AgLQAAQQRxRQRAAkACQAJAAkBBrIiAICgCACIFBEBB1IuAICEAA0AgACgCACIIIAVNBEAgBSAIIAAoAgRqSQ0DCyAAKAIIIgANAAsLQQAQASICQX9GDQMgASEEQfCLgCAoAgAiAEEBayIFIAJxBEAgASACayACIAVqQQAgAGtxaiEECyAEIAZNDQNBzIuAICgCACIABEBBxIuAICgCACIFIARqIgcgBU0gACAHSXINBAsgBBABIgAgAkcNAQwFCyAEIAJrIAdxIgQQASICIAAoAgAgACgCBGpGDQEgAiEACyAAQX9GDQEgBkEwaiAETQRAIAAhAgwEC0H0i4AgKAIAIgIgAyAEa2pBACACa3EiAhABQX9GDQEgAiAEaiEEIAAhAgwDCyACQX9HDQILQdCLgCBB0IuAICgCAEEEcjYCAAsgARABIgJBf0ZBABABIgBBf0ZyIAAgAk1yDQUgACACayIEIAZBKGpNDQULQcSLgCBBxIuAICgCACAEaiIANgIAQciLgCAoAgAgAEkEQEHIi4AgIAA2AgALAkBBrIiAICgCACIDBEBB1IuAICEAA0AgAiAAKAIAIgEgACgCBCIFakYNAiAAKAIIIgANAAsMBAtBpIiAICgCACIAQQAgACACTRtFBEBBpIiAICACNgIAC0EAIQBB2IuAICAENgIAQdSLgCAgAjYCAEG0iIAgQX82AgBBuIiAIEHsi4AgKAIANgIAQeCLgCBBADYCAANAIABBA3QiAUHEiIAgaiABQbyIgCBqIgU2AgAgAUHIiIAgaiAFNgIAIABBAWoiAEEgRw0AC0GgiIAgIARBKGsiAEF4IAJrQQdxIgFrIgU2AgBBrIiAICABIAJqIgE2AgAgASAFQQFyNgIEIAAgAmpBKDYCBEGwiIAgQfyLgCAoAgA2AgAMBAsgAiADTSABIANLcg0CIAAoAgxBCHENAiAAIAQgBWo2AgRBrIiAICADQXggA2tBB3EiAGoiATYCAEGgiIAgQaCIgCAoAgAgBGoiAiAAayIANgIAIAEgAEEBcjYCBCACIANqQSg2AgRBsIiAIEH8i4AgKAIANgIADAMLQQAhAAwGC0EAIQAMBAtBpIiAICgCACACSwRAQaSIgCAgAjYCAAsgAiAEaiEFQdSLgCAhAAJAA0AgBSAAKAIAIgFHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQMLQdSLgCAhAANAAkAgACgCACIBIANNBEAgAyABIAAoAgRqIgVJDQELIAAoAgghAAwBCwtBoIiAICAEQShrIgBBeCACa0EHcSIBayIHNgIAQayIgCAgASACaiIBNgIAIAEgB0EBcjYCBCAAIAJqQSg2AgRBsIiAIEH8i4AgKAIANgIAIAMgBUEnIAVrQQdxakEvayIAIAAgA0EQakkbIgFBGzYCBCABQdyLgCApAgA3AhAgAUHUi4AgKQIANwIIQdyLgCAgAUEIajYCAEHYi4AgIAQ2AgBB1IuAICACNgIAQeCLgCBBADYCACABQRhqIQADQCAAQQc2AgQgAEEIaiAAQQRqIQAgBUkNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siAkEBcjYCBCABIAI2AgACfyACQf8BTQRAIAJBeHFBvIiAIGohAAJ/QZSIgCAoAgAiAUEBIAJBA3Z0IgJxRQRAQZSIgCAgASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDEEMIQJBCAwBC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgAyAANgIcIANCADcCECAAQQJ0QcSKgCBqIQECQAJAQZiIgCAoAgAiBUEBIAB0IgRxRQRAQZiIgCAgBCAFcjYCACABIAM2AgAMAQsgAkEZIABBAXZrQQAgAEEfRxt0IQAgASgCACEFA0AgBSIBKAIEQXhxIAJGDQIgAEEddiEEIABBAXQhACABIARBBHFqIgQoAhAiBQ0ACyAEIAM2AhALIAMgATYCGEEIIQIgAyIBIQBBDAwBCyABKAIIIgAgAzYCDCABIAM2AgggAyAANgIIQQAhAEEYIQJBDAsgA2ogATYCACACIANqIAA2AgALQaCIgCAoAgAiACAGTQ0AQaCIgCAgACAGayIBNgIAQayIgCBBrIiAICgCACIAIAZqIgI2AgAgAiABQQFyNgIEIAAgBkEDcjYCBCAAQQhqIQAMBAtBkIiAIEEwNgIAQQAhAAwDCyAAIAI2AgAgACAAKAIEIARqNgIEIAJBeCACa0EHcWoiCCAGQQNyNgIEIAFBeCABa0EHcWoiBCAGIAhqIgNrIQcCQEGsiIAgKAIAIARGBEBBrIiAICADNgIAQaCIgCBBoIiAICgCACAHaiIANgIAIAMgAEEBcjYCBAwBC0GoiIAgKAIAIARGBEBBqIiAICADNgIAQZyIgCBBnIiAICgCACAHaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAMAQsgBCgCBCIAQQNxQQFGBEAgAEF4cSEJIAQoAgwhAgJAIABB/wFNBEAgBCgCCCIBIAJGBEBBlIiAIEGUiIAgKAIAQX4gAEEDdndxNgIADAILIAEgAjYCDCACIAE2AggMAQsgBCgCGCEGAkAgAiAERwRAIAQoAggiACACNgIMIAIgADYCCAwBCwJAIAQoAhQiAAR/IARBFGoFIAQoAhAiAEUNASAEQRBqCyEBA0AgASEFIAAiAkEUaiEBIAAoAhQiAA0AIAJBEGohASACKAIQIgANAAsgBUEANgIADAELQQAhAgsgBkUNAAJAIAQoAhwiAEECdEHEioAgaiIBKAIAIARGBEAgASACNgIAIAINAUGYiIAgQZiIgCAoAgBBfiAAd3E2AgAMAgsgBkEQQRQgBigCECAERhtqIAI2AgAgAkUNAQsgAiAGNgIYIAQoAhAiAARAIAIgADYCECAAIAI2AhgLIAQoAhQiAEUNACACIAA2AhQgACACNgIYCyAHIAlqIQcgBCAJaiIEKAIEIQALIAQgAEF+cTYCBCADIAdBAXI2AgQgAyAHaiAHNgIAIAdB/wFNBEAgB0F4cUG8iIAgaiEAAn9BlIiAICgCACIBQQEgB0EDdnQiAnFFBEBBlIiAICABIAJyNgIAIAAMAQsgACgCCAshASAAIAM2AgggASADNgIMIAMgADYCDCADIAE2AggMAQtBHyECIAdB////B00EQCAHQSYgB0EIdmciAGt2QQFxIABBAXRrQT5qIQILIAMgAjYCHCADQgA3AhAgAkECdEHEioAgaiEAAkACQEGYiIAgKAIAIgFBASACdCIFcUUEQEGYiIAgIAEgBXI2AgAgACADNgIADAELIAdBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAQNAIAEiACgCBEF4cSAHRg0CIAJBHXYhASACQQF0IQIgACABQQRxaiIFKAIQIgENAAsgBSADNgIQCyADIAA2AhggAyADNgIMIAMgAzYCCAwBCyAAKAIIIgEgAzYCDCAAIAM2AgggA0EANgIYIAMgADYCDCADIAE2AggLIAhBCGohAAwCCwJAIAhFDQACQCAFKAIcIgFBAnRBxIqAIGoiAigCACAFRgRAIAIgADYCACAADQFBmIiAICAHQX4gAXdxIgc2AgAMAgsgCEEQQRQgCCgCECAFRhtqIAA2AgAgAEUNAQsgACAINgIYIAUoAhAiAQRAIAAgATYCECABIAA2AhgLIAUoAhQiAUUNACAAIAE2AhQgASAANgIYCwJAIANBD00EQCAFIAMgBmoiAEEDcjYCBCAAIAVqIgAgACgCBEEBcjYCBAwBCyAFIAZBA3I2AgQgBSAGaiIEIANBAXI2AgQgAyAEaiADNgIAIANB/wFNBEAgA0F4cUG8iIAgaiEAAn9BlIiAICgCACIBQQEgA0EDdnQiAnFFBEBBlIiAICABIAJyNgIAIAAMAQsgACgCCAshASAAIAQ2AgggASAENgIMIAQgADYCDCAEIAE2AggMAQtBHyEAIANB////B00EQCADQSYgA0EIdmciAGt2QQFxIABBAXRrQT5qIQALIAQgADYCHCAEQgA3AhAgAEECdEHEioAgaiEBAkACQCAHQQEgAHQiAnFFBEBBmIiAICACIAdyNgIAIAEgBDYCACAEIAE2AhgMAQsgA0EZIABBAXZrQQAgAEEfRxt0IQAgASgCACEBA0AgASICKAIEQXhxIANGDQIgAEEddiEHIABBAXQhACACIAdBBHFqIgcoAhAiAQ0ACyAHIAQ2AhAgBCACNgIYCyAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgBUEIaiEADAELAkAgCUUNAAJAIAIoAhwiAUECdEHEioAgaiIFKAIAIAJGBEAgBSAANgIAIAANAUGYiIAgIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECACRhtqIAA2AgAgAEUNAQsgACAJNgIYIAIoAhAiAQRAIAAgATYCECABIAA2AhgLIAIoAhQiAUUNACAAIAE2AhQgASAANgIYCwJAIANBD00EQCACIAMgBmoiAEEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwBCyACIAZBA3I2AgQgAiAGaiIFIANBAXI2AgQgAyAFaiADNgIAIAgEQCAIQXhxQbyIgCBqIQBBqIiAICgCACEBAn9BASAIQQN2dCIHIARxRQRAQZSIgCAgBCAHcjYCACAADAELIAAoAggLIQQgACABNgIIIAQgATYCDCABIAA2AgwgASAENgIIC0GoiIAgIAU2AgBBnIiAICADNgIACyACQQhqIQALIApBEGokACAACwUAQZAIC9sDAQd/AkAgB0EKRgRAQQAhByAFBEAgACELIARBfnEhCgNAIAQEQCAEIAlsIQwgCiAJQQF2bCENQQAhCANAIAggDGoiDkEBdCEAAkACQAJAAkAgBg4EAgABAgMLIAggDWpBfnEhBwwCCyAIIApqQX5xIQcMAQsgACEHCyADIA5BAnRqIAIgB2otAAAgAiAHQQFqIg5qLQAAQQh0ckECdkH/AXEgACALaiIALQABQQp0IAAtAAAiAEECdHJBgB5xckEOdCABIAdqLQAAIAEgDmotAABBCHRyQfwHcSAAQQh0QYD4AHFyckGQCGooAgA2AAAgCEEBaiIIIARHDQALCyAJQQFqIgkgBUcNAAsLDAELQQAhByAFBEAgACELIARBAXYhCgNAIAQEQCAEIAlsIQwgCUEBdiAKbCENQQAhCANAIAggDGohAAJAAkACQAJAIAYOBAIAAQIDCyAIQQF2IA1qIQcMAgsgCEEBdiAKaiEHDAELIAAhBwsgAyAAQQJ0aiACIAdqLQAAIAAgC2otAAAiAEEEdEGAHnFyQQ50IAEgB2otAAAgAEEIdEGAHnFyQQJ0ckGQCGooAgA2AAAgCEEBaiIIIARHDQALCyAJQQFqIgkgBUcNAAsLC0EACwsLAQBBgAgLBBAGAQQ=",S="CnZhciBLd2FpWVVWMlJHQiA9ICgoKSA9PiB7CiAgdmFyIF9zY3JpcHROYW1lID0gdHlwZW9mIGRvY3VtZW50ICE9ICd1bmRlZmluZWQnID8gZG9jdW1lbnQuY3VycmVudFNjcmlwdD8uc3JjIDogdW5kZWZpbmVkOwogIAogIHJldHVybiAoCmZ1bmN0aW9uKG1vZHVsZUFyZyA9IHt9KSB7CiAgdmFyIG1vZHVsZVJ0bjsKCnZhciBhPW1vZHVsZUFyZyxmLGcsaD1uZXcgUHJvbWlzZSgoYixjKT0+e2Y9YjtnPWN9KSxsPSJvYmplY3QiPT10eXBlb2Ygd2luZG93LG09ImZ1bmN0aW9uIj09dHlwZW9mIGltcG9ydFNjcmlwdHMsbj1PYmplY3QuYXNzaWduKHt9LGEpLHA9IiIscSxyOwppZihsfHxtKW0/cD1zZWxmLmxvY2F0aW9uLmhyZWY6InVuZGVmaW5lZCIhPXR5cGVvZiBkb2N1bWVudCYmZG9jdW1lbnQuY3VycmVudFNjcmlwdCYmKHA9ZG9jdW1lbnQuY3VycmVudFNjcmlwdC5zcmMpLF9zY3JpcHROYW1lJiYocD1fc2NyaXB0TmFtZSkscC5zdGFydHNXaXRoKCJibG9iOiIpP3A9IiI6cD1wLnN1YnN0cigwLHAucmVwbGFjZSgvWz8jXS4qLywiIikubGFzdEluZGV4T2YoIi8iKSsxKSxtJiYocj1iPT57dmFyIGM9bmV3IFhNTEh0dHBSZXF1ZXN0O2Mub3BlbigiR0VUIixiLCExKTtjLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiO2Muc2VuZChudWxsKTtyZXR1cm4gbmV3IFVpbnQ4QXJyYXkoYy5yZXNwb25zZSl9KSxxPWI9PmZldGNoKGIse2NyZWRlbnRpYWxzOiJzYW1lLW9yaWdpbiJ9KS50aGVuKGM9PmMub2s/Yy5hcnJheUJ1ZmZlcigpOlByb21pc2UucmVqZWN0KEVycm9yKGMuc3RhdHVzKyIgOiAiK2MudXJsKSkpO3ZhciB0PWEucHJpbnRFcnJ8fGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTsKT2JqZWN0LmFzc2lnbihhLG4pO249bnVsbDt2YXIgdT1hLndhc21CaW5hcnksdix3PSExLHg7ZnVuY3Rpb24geSgpe3ZhciBiPXYuYnVmZmVyO2EuSEVBUDg9bmV3IEludDhBcnJheShiKTthLkhFQVAxNj1uZXcgSW50MTZBcnJheShiKTthLkhFQVBVOD14PW5ldyBVaW50OEFycmF5KGIpO2EuSEVBUFUxNj1uZXcgVWludDE2QXJyYXkoYik7YS5IRUFQMzI9bmV3IEludDMyQXJyYXkoYik7YS5IRUFQVTMyPW5ldyBVaW50MzJBcnJheShiKTthLkhFQVBGMzI9bmV3IEZsb2F0MzJBcnJheShiKTthLkhFQVBGNjQ9bmV3IEZsb2F0NjRBcnJheShiKX12YXIgej1bXSxBPVtdLEI9W107ZnVuY3Rpb24gQygpe3ZhciBiPWEucHJlUnVuLnNoaWZ0KCk7ei51bnNoaWZ0KGIpfXZhciBEPTAsRT1udWxsLEY9bnVsbCxHPWI9PmIuc3RhcnRzV2l0aCgiZGF0YTphcHBsaWNhdGlvbi9vY3RldC1zdHJlYW07YmFzZTY0LCIpLEg7CmZ1bmN0aW9uIEkoYil7aWYoYj09SCYmdSlyZXR1cm4gbmV3IFVpbnQ4QXJyYXkodSk7aWYocilyZXR1cm4gcihiKTt0aHJvdyJib3RoIGFzeW5jIGFuZCBzeW5jIGZldGNoaW5nIG9mIHRoZSB3YXNtIGZhaWxlZCI7fWZ1bmN0aW9uIEooYil7cmV0dXJuIHU/UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+SShiKSk6cShiKS50aGVuKGM9Pm5ldyBVaW50OEFycmF5KGMpLCgpPT5JKGIpKX1mdW5jdGlvbiBMKGIsYyxkKXtyZXR1cm4gSihiKS50aGVuKGU9PldlYkFzc2VtYmx5Lmluc3RhbnRpYXRlKGUsYykpLnRoZW4oZCxlPT57dChgZmFpbGVkIHRvIGFzeW5jaHJvbm91c2x5IHByZXBhcmUgd2FzbTogJHtlfWApO2Eub25BYm9ydD8uKGUpO2U9IkFib3J0ZWQoIitlKyIpIjt0KGUpO3c9ITA7ZT1uZXcgV2ViQXNzZW1ibHkuUnVudGltZUVycm9yKGUrIi4gQnVpbGQgd2l0aCAtc0FTU0VSVElPTlMgZm9yIG1vcmUgaW5mby4iKTtnKGUpO3Rocm93IGU7fSl9CmZ1bmN0aW9uIE0oYixjKXt2YXIgZD1IO3JldHVybiB1fHwiZnVuY3Rpb24iIT10eXBlb2YgV2ViQXNzZW1ibHkuaW5zdGFudGlhdGVTdHJlYW1pbmd8fEcoZCl8fCJmdW5jdGlvbiIhPXR5cGVvZiBmZXRjaD9MKGQsYixjKTpmZXRjaChkLHtjcmVkZW50aWFsczoic2FtZS1vcmlnaW4ifSkudGhlbihlPT5XZWJBc3NlbWJseS5pbnN0YW50aWF0ZVN0cmVhbWluZyhlLGIpLnRoZW4oYyxmdW5jdGlvbihrKXt0KGB3YXNtIHN0cmVhbWluZyBjb21waWxlIGZhaWxlZDogJHtrfWApO3QoImZhbGxpbmcgYmFjayB0byBBcnJheUJ1ZmZlciBpbnN0YW50aWF0aW9uIik7cmV0dXJuIEwoZCxiLGMpfSkpfQp2YXIgTj1iPT57Zm9yKDswPGIubGVuZ3RoOyliLnNoaWZ0KCkoYSl9LE89e2E6Yj0+e3ZhciBjPXgubGVuZ3RoO2I+Pj49MDtpZigyMTQ3NDgzNjQ4PGIpcmV0dXJuITE7Zm9yKHZhciBkPTE7ND49ZDtkKj0yKXt2YXIgZT1jKigxKy4yL2QpO2U9TWF0aC5taW4oZSxiKzEwMDY2MzI5Nik7YTp7ZT0oTWF0aC5taW4oMjE0NzQ4MzY0OCw2NTUzNipNYXRoLmNlaWwoTWF0aC5tYXgoYixlKS82NTUzNikpLXYuYnVmZmVyLmJ5dGVMZW5ndGgrNjU1MzUpLzY1NTM2O3RyeXt2Lmdyb3coZSk7eSgpO3ZhciBrPTE7YnJlYWsgYX1jYXRjaChLKXt9az12b2lkIDB9aWYoaylyZXR1cm4hMH1yZXR1cm4hMX19LFA9ZnVuY3Rpb24oKXtmdW5jdGlvbiBiKGQpe1A9ZC5leHBvcnRzO3Y9UC5iO3koKTtBLnVuc2hpZnQoUC5jKTtELS07YS5tb25pdG9yUnVuRGVwZW5kZW5jaWVzPy4oRCk7MD09RCYmKG51bGwhPT1FJiYoY2xlYXJJbnRlcnZhbChFKSxFPW51bGwpLEYmJihkPUYsRj1udWxsLGQoKSkpO3JldHVybiBQfQp2YXIgYz17YTpPfTtEKys7YS5tb25pdG9yUnVuRGVwZW5kZW5jaWVzPy4oRCk7aWYoYS5pbnN0YW50aWF0ZVdhc20pdHJ5e3JldHVybiBhLmluc3RhbnRpYXRlV2FzbShjLGIpfWNhdGNoKGQpe3QoYE1vZHVsZS5pbnN0YW50aWF0ZVdhc20gY2FsbGJhY2sgZmFpbGVkIHdpdGggZXJyb3I6ICR7ZH1gKSxnKGQpfUh8fD1HKCJsaWJ5dXYycmdiLndhc20iKT8ibGlieXV2MnJnYi53YXNtIjphLmxvY2F0ZUZpbGU/YS5sb2NhdGVGaWxlKCJsaWJ5dXYycmdiLndhc20iLHApOnArImxpYnl1djJyZ2Iud2FzbSI7TShjLGZ1bmN0aW9uKGQpe2IoZC5pbnN0YW5jZSl9KS5jYXRjaChnKTtyZXR1cm57fX0oKTthLl95dXYycmdiPShiLGMsZCxlLGssSyxTLFQpPT4oYS5feXV2MnJnYj1QLmQpKGIsYyxkLGUsayxLLFMsVCk7YS5fZ2V0X21hcF9wdHI9KCk9PihhLl9nZXRfbWFwX3B0cj1QLmUpKCk7YS5fbWFsbG9jPWI9PihhLl9tYWxsb2M9UC5nKShiKTthLl9mcmVlPWI9PihhLl9mcmVlPVAuaCkoYik7CnZhciBRO0Y9ZnVuY3Rpb24gUigpe1F8fFUoKTtRfHwoRj1SKX07ZnVuY3Rpb24gVSgpe2Z1bmN0aW9uIGIoKXtpZighUSYmKFE9ITAsYS5jYWxsZWRSdW49ITAsIXcpKXtOKEEpO2YoYSk7YS5vblJ1bnRpbWVJbml0aWFsaXplZD8uKCk7aWYoYS5wb3N0UnVuKWZvcigiZnVuY3Rpb24iPT10eXBlb2YgYS5wb3N0UnVuJiYoYS5wb3N0UnVuPVthLnBvc3RSdW5dKTthLnBvc3RSdW4ubGVuZ3RoOyl7dmFyIGM9YS5wb3N0UnVuLnNoaWZ0KCk7Qi51bnNoaWZ0KGMpfU4oQil9fWlmKCEoMDxEKSl7aWYoYS5wcmVSdW4pZm9yKCJmdW5jdGlvbiI9PXR5cGVvZiBhLnByZVJ1biYmKGEucHJlUnVuPVthLnByZVJ1bl0pO2EucHJlUnVuLmxlbmd0aDspQygpO04oeik7MDxEfHwoYS5zZXRTdGF0dXM/KGEuc2V0U3RhdHVzKCJSdW5uaW5nLi4uIiksc2V0VGltZW91dChmdW5jdGlvbigpe3NldFRpbWVvdXQoZnVuY3Rpb24oKXthLnNldFN0YXR1cygiIil9LDEpO2IoKX0sMSkpOmIoKSl9fQppZihhLnByZUluaXQpZm9yKCJmdW5jdGlvbiI9PXR5cGVvZiBhLnByZUluaXQmJihhLnByZUluaXQ9W2EucHJlSW5pdF0pOzA8YS5wcmVJbml0Lmxlbmd0aDspYS5wcmVJbml0LnBvcCgpKCk7VSgpO21vZHVsZVJ0bj1oOwoKCiAgcmV0dXJuIG1vZHVsZVJ0bjsKfQopOwp9KSgpOwppZiAodHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgPT09ICdvYmplY3QnKQogIG1vZHVsZS5leHBvcnRzID0gS3dhaVlVVjJSR0I7CmVsc2UgaWYgKHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lWydhbWQnXSkKICBkZWZpbmUoW10sICgpID0+IEt3YWlZVVYyUkdCKTsK",W="lib-yuv2rgb-wrapper",j=function(){function je(ue){var L;this.I=void 0,this.C=void 0,this.B=void 0,this.h=void 0,this.I=ue,(L=this.I)==null||L.i(W,"constructor")}var we=je.prototype;return we.init=function(){var ue=A()(F.a.mark(function L(){var D,le,oe,Re,Oe,de=this;return F.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return(D=this.I)==null||D.i(W,"init libyuv2rgb."),le=w.Base64.decode(S),oe=new Blob([le],{type:"text/javascript"}),Re=new Function(le+" return KwaiYUV2RGB;")(),Oe={wasmBinary:w.Base64.toUint8Array(I),mainScriptUrlOrBlob:oe},$.abrupt("return",Re(Oe).then(function(ge){var Pe;(Pe=de.I)==null||Pe.i(W,"inited."),de.C=ge}));case 6:case"end":return $.stop()}},L,this)}));return function(){return ue.apply(this,arguments)}}(),we.destroy=function(){var ue,L;(ue=this.I)==null||ue.i(W,"destroy"),this.Y(),this.h&&((L=this.C)==null||L._free(this.h),this.h=void 0),this.B=void 0,this.C=void 0},we.yuv2rgb=function(ue,L,D,le,oe,Re,Oe,de){var $=this.B,ge=this.C;ge&&($?$.y.size===ue.length&&$.u.size===L.length&&$.v.size===D.length||(this.Y(),$.y.ptr=ge._malloc(ue.length),$.y.size=ue.length,$.u.ptr=ge._malloc(L.length),$.u.size=L.length,$.v.ptr=ge._malloc(D.length),$.v.size=ue.length,$.rgb.ptr=ge._malloc(le.length),$.rgb.size=le.length):$=this.B={y:{ptr:ge._malloc(ue.length),size:ue.length},u:{ptr:ge._malloc(L.length),size:L.length},v:{ptr:ge._malloc(D.length),size:D.length},rgb:{ptr:ge._malloc(le.length),size:le.length}},ge.HEAPU8.set(ue,$.y.ptr),ge.HEAPU8.set(L,$.u.ptr),ge.HEAPU8.set(D,$.v.ptr),ge._yuv2rgb($.y.ptr,$.u.ptr,$.v.ptr,$.rgb.ptr,oe,Re,Oe,de),le.set(ge.HEAPU8.subarray($.rgb.ptr,$.rgb.ptr+$.rgb.size)))},we.Y=function(){this.B&&this.C&&(this.C._free(this.B.y.ptr),this.C._free(this.B.u.ptr),this.C._free(this.B.v.ptr),this.C._free(this.B.rgb.ptr))},C()(je,[{key:"inited",get:function(){return!!this.C}},{key:"map",get:function(){if(this.C){var ue=this.C._get_map_ptr();return this.C.HEAPU8.subarray(ue,ue+67108864)}}}])}(),N="map10bit",K=function(){function je(){}return je.initMap=function(){var we=A()(F.a.mark(function ue(L,D,le,oe){var Re,Oe,de,$,ge,Pe;return F.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:for(oe==null||oe.i(N,"init yuv2rgb map. full: "+D),Re=[],Oe=typeof OffscreenCanvas<"u"||document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")===0,de=0,$=1;$<9;$++)ge="https://s2-10895.kwimgs.com/kos/nlav10895/yuvmap/3/"+(D?"full/":"limit/")+"map_10bit_"+$+"."+(Oe?"webp":"png"),Re.push(je.G(ge,$,L,de,oe)),de+=8388608;return ae.next=7,Promise.all(Re);case 7:return Pe=ae.sent,ae.abrupt("return",Promise.resolve(Pe.reduce(function(q,b){return q&&b.result},!0)));case 9:case"end":return ae.stop()}},ue)}));return function(ue,L,D,le){return we.apply(this,arguments)}}(),je.G=function(){var we=A()(F.a.mark(function ue(L,D,le,oe,Re){return F.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Re==null||Re.i(N,"load map slice. url: "+L+" idx: "+D),Oe.abrupt("return",new Promise(function(de){fetch(L).then(function($){$.ok?$.blob().then(function(ge){createImageBitmap(ge).then(function(Pe){var ae=typeof HTMLCanvasElement>"u"?new OffscreenCanvas(1,1):document.createElement("canvas"),q=ae.getContext("2d");if(ae.width=Pe.width,ae.height=Pe.height,q){q.drawImage(Pe,0,0);var b=q.getImageData(0,0,ae.width,ae.height);le.set(b.data,oe),de({idx:D,result:!0})}else de({idx:D,result:!1});Pe.close()})}):de({idx:D,result:!1})}).catch(function($){de({idx:D,result:!1})})}));case 2:case"end":return Oe.stop()}},ue)}));return function(ue,L,D,le,oe){return we.apply(this,arguments)}}(),je}();function z(je){return B.apply(this,arguments)}function B(){return(B=A()(F.a.mark(function je(we){return F.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.abrupt("return",new Promise(function(L){setTimeout(function(){L()},we)}));case 1:case"end":return ue.stop()}},je)}))).apply(this,arguments)}var J=function(){function je(){}return je.N=function(we,ue,L,D,le){for(var oe=ue[0],Re=ue[1],Oe=ue[2],de=ue[3],$=ue[4],ge=ue[5],Pe=ue[6],ae=ue[7],q=ue[8],b=D;b<le;b++)for(var ve=0;ve<256;ve++)for(var U=0;U<256;U++){var M=b-L,ne=ve-128,Le=U-128,Ue=((b/16<<8)+U<<12)+((b%16<<8)+ve)<<2;we[Ue]=Math.min(255,Math.max(0,M*oe+ne*Re+Le*Oe|0)),we[Ue+1]=Math.min(255,Math.max(0,M*de+ne*$+Le*ge|0)),we[Ue+2]=Math.min(255,Math.max(0,M*Pe+ne*ae+Le*q|0)),we[Ue+3]=255}},je.initMap=function(){var we=A()(F.a.mark(function ue(L,D,le){var oe,Re;return F.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return le==null||le.i("map8bit","init yuv2rgb map. matrix: "+D),oe=D.subarray(3,12),Re=D[0]===0?0:16,je.N(L,oe,Re,0,64),Oe.next=5,z(0);case 5:return je.N(L,oe,Re,64,128),Oe.next=8,z(0);case 8:return je.N(L,oe,Re,128,192),Oe.next=11,z(0);case 11:return je.N(L,oe,Re,192,256),Oe.abrupt("return",!0);case 13:case"end":return Oe.stop()}},ue)}));return function(ue,L,D){return we.apply(this,arguments)}}(),je}(),be=d(5),X=d.n(be),ye={},Be="yuv2rgb",Ve=function(){function je(ue){var L;this.Z=void 0,this.I=void 0,this.F=void 0,this.R="notSet",this.Z=(L=ue,X()({},ye,L)),this.I=this.Z.logger,this.F=new j(this.I)}var we=je.prototype;return we.initMap=function(){var ue=A()(F.a.mark(function L(D,le,oe){var Re,Oe,de,$,ge,Pe=this;return F.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(Oe=D[0]===0,(Re=this.I)==null||Re.i(Be,"init yuv2rgb map. matrix: "+D+" full: "+Oe+" bit: "+oe),this.R="loading",this.F){ae.next=5;break}return ae.abrupt("return",Promise.reject("wasm undefined."));case 5:if(ae.prev=5,this.F.inited){ae.next=10;break}return ae.next=9,this.F.init();case 9:(de=this.I)==null||de.i(Be,"wasm inited.");case 10:if($=this.F.map){ae.next=14;break}return this.R="error",ae.abrupt("return",Promise.reject("map null."));case 14:return ge=oe===10?K.initMap($,Oe,le,this.I):J.initMap($,D,this.I),ae.abrupt("return",ge.then(function(q){return Pe.R=q?"complete":"error",q}));case 18:return ae.prev=18,ae.t0=ae.catch(5),ae.abrupt("return",Promise.reject(ae.t0));case 21:case"end":return ae.stop()}},L,this,[[5,18]])}));return function(L,D,le){return ue.apply(this,arguments)}}(),we.yuv2rgb=function(ue,L,D,le,oe,Re,Oe,de){var $;($=this.F)==null||$.yuv2rgb(ue,L,D,le,oe,Re,Oe,de)},we.destroy=function(){var ue,L;(ue=this.I)==null||ue.i(Be,"destroy"),this.I=void 0,(L=this.F)==null||L.destroy(),this.R="notSet"},C()(je,[{key:"readyState",get:function(){return this.R}}],[{key:"version",get:function(){return"1.0.0-alpha.8"}}])}();s.default=Ve}]).default},function(r,i,n){var o=n(53).default;r.exports=function(s,d){if(o(s)!=="object"||s===null)return s;var m=s[Symbol.toPrimitive];if(m!==void 0){var A=m.call(s,d||"default");if(o(A)!=="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){function n(o,s){return r.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,m){return d.__proto__=m,d},r.exports.__esModule=!0,r.exports.default=r.exports,n(o,s)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){Number.isFinite||(Number.isFinite=function(n){return typeof n=="number"&&isFinite(n)}),Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=Math.pow(2,53)-1),Object.values||(Object.values=function(n){if(n==null)throw new TypeError("Cannot convert undefined or null to object");var o=[];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.push(n[s]);return o})},function(r,i,n){n.r(i);var o=n(18),s=n(13),d=n(34),m=n(48),A=n(28),T=n(2);i.default=function(C){var h,F,w=new A.a;[T.a.STEP,T.a.RENDERER_BUF_UPDATE,T.a.DEC_VIDEO_READY,T.a.DECODER_WAITING,T.a.RENDERER_SEEK,T.a.RENDERER_DRAW,T.a.ERROR,T.a.RENDERER_INIT_COMPLETE,T.a.RENDERER_WAITING,T.a.RENDERER_WAITING_END].forEach(function(I){return w.on(I,function(S){return C.postMessage({event:I,data:S})})}),w.on(T.a.DECODER_IMG,function(I){C.postMessage({event:T.a.DECODER_IMG,data:I},[I.frame.y.bytes.buffer,I.frame.u.bytes.buffer,I.frame.v.bytes.buffer])}),w.on(T.a.SCREENSHOT,function(I){I.image?C.postMessage({event:T.a.SCREENSHOT,data:I},[I.image.data.buffer]):C.postMessage({event:T.a.SCREENSHOT,data:I})}),C.addEventListener("message",function(I){var S=I.data;switch(S.cmd){case s.a.UPDATE_STATE:h.updateState(S.streamTime,S.width,S.height,S.stoped,S.output,S.maxFrameBufLen,S.pictMode);break;case s.a.APPEND_DATA:h.append(S.frame);break;case s.a.SEEK:h.seek(S.time,S.id);break;case s.a.STEP:h.step(S.type);break;case s.a.INIT_RENDERER:F||(F=Object(d.b)(C,S.config.logLevel||o.DEFAULT_LOG_LEVEL,S.contextId,S.hasExternalLogger,"vr")),function(W,j,N,K){(h=new m.a(W,w)).init(j,N,K)}(F,S.id,S.config,S.canvas);break;case s.a.RESET:h.reset(S.decId,S.seeking);break;case s.a.MEDIA_INFO:h.updateMediaInfo(S.mediaInfo);break;case s.a.END_OF_DATA:h.endOfData();break;case s.a.DEC_DROP_FRAME:h.decDropFrameInfo(S.data);break;case s.a.DESTROY:h&&h.destroy(),w&&w.removeAllListeners();break;case s.a.SCREENSHOT:h.screenshot(S.options)}})}},function(r,i,n){r.exports=function(o,s){if(s=s.split(":")[0],!(o=+o))return!1;switch(s){case"http":case"ws":return o!==80;case"https":case"wss":return o!==443;case"ftp":return o!==21;case"gopher":return o!==70;case"file":return!1}return o!==0}},function(r,i,n){var o=Object.prototype.hasOwnProperty;function s(m){try{return decodeURIComponent(m.replace(/\+/g," "))}catch(A){return null}}function d(m){try{return encodeURIComponent(m)}catch(A){return null}}i.stringify=function(m,A){A=A||"";var T,C,h=[];for(C in typeof A!="string"&&(A="?"),m)if(o.call(m,C)){if((T=m[C])||T!=null&&!isNaN(T)||(T=""),C=d(C),T=d(T),C===null||T===null)continue;h.push(C+"="+T)}return h.length?A+h.join("&"):""},i.parse=function(m){for(var A,T=/([^=?#&]+)=?([^&]*)/g,C={};A=T.exec(m);){var h=s(A[1]),F=s(A[2]);h===null||F===null||h in C||(C[h]=F)}return C}},function(r,i,n){n.r(i);var o=n(18),s=n(13),d=n(34),m=n(28),A=n(2),T=n(49);i.default=function(C){var h,F,w=new m.a;[A.a.DEC_INIT_COMPLETE,A.a.DECODER_SEEK,A.a.RENDERER_BUF_EXPIRED,A.a.DECODER_DATA_END,A.a.DECODER_BUF_LOW,A.a.DECODER_DROP_FRAME,A.a.ERROR,A.a.DECODER_MEDIA_INFO].forEach(function(I){return w.on(I,function(S){return C.postMessage({event:I,data:S})})}),w.on(A.a.DECODER_IMG,function(I){C.postMessage({event:A.a.DECODER_IMG,data:I},[I.frame.y.bytes.buffer,I.frame.u.bytes.buffer,I.frame.v.bytes.buffer])}),C.addEventListener("message",function(I){var S=I.data;switch(S.cmd){case s.a.APPEND_DATA:h.appendData(S.data);break;case s.a.UPDATE_STATE:h.updateState(S.streamTime,S.output,S.active,S.frameBufLen,S.playbackRate,S.maxFrameBufLen);break;case s.a.INIT_265:F||(F=Object(d.b)(C,S.config.logLevel||o.DEFAULT_LOG_LEVEL,S.contextId,S.hasExternalLogger,"vd")),function(W,j,N,K,z,B,J,be){h&&h.destroy(),(h=new T.a(W,w)).init(j,N,K,z,B,J,be)}(F,S.id,S.lib,S.config,S.simd,S.threads,S.codecType,S.decoderType);break;case s.a.MEDIA_INFO:h.updateMediaInfo(S.mediaInfo);break;case s.a.DESTROY:h&&h.destroy(),w&&w.removeAllListeners();break;case s.a.RESET:h.reset(S.decId,S.seeking);break;case s.a.SEEK:h.seek(S.time,S.id);break;case s.a.END_OF_DATA:h.endOfData()}})}},function(r,i,n){n.r(i),n.d(i,"default",function(){return Od}),n.d(i,"createKernel",function(){return CE}),n.d(i,"AbstractDestroyable",function(){return F.a}),n.d(i,"CanvasContextType",function(){return h.b}),n.d(i,"CodecType",function(){return h.c}),n.d(i,"DestroyableList",function(){return F.b}),n.d(i,"Decoder",function(){return h.d}),n.d(i,"DemuxerType",function(){return _e.b}),n.d(i,"DownloadStatus",function(){return ut}),n.d(i,"ErrorDetails",function(){return L.a}),n.d(i,"ErrorTypes",function(){return L.b}),n.d(i,"HttpRangeType",function(){return h.e}),n.d(i,"KEvents",function(){return D.a}),n.d(i,"LiveShiftType",function(){return h.g}),n.d(i,"LogLevel",function(){return Xa.LogLevel}),n.d(i,"MediaBox",function(){return h.i}),n.d(i,"ReportTypes",function(){return Vr}),n.d(i,"StereoType",function(){return h.n}),n.d(i,"VideoDecBlockPolicy",function(){return h.p}),n.d(i,"VideoDropFramePolicy",function(){return h.r}),n.d(i,"VideoRendererType",function(){return h.s}),n.d(i,"WasmDecoder",function(){return h.t});var o=n(8),s=n.n(o),d=n(5),m=n.n(d),A=n(10),T=n.n(A),C=(n(57),n(43)),h=n(0),F=n(14),w=n(19),I=255,S=20;function W(v,_,a){if(v[_]===void 0)v[_]=a;else{var e=v[_];Array.isArray(e)?e.push(a):typeof e=="string"&&(v[_]=[e,a])}}function j(v){var _={};return typeof v=="string"?v.trim().split(/[\r\n]+/).forEach(function(a){var e=a.split(": "),t=e.shift(),c=e.join(":");t&&W(_,t,c)}):v&&v.forEach(function(a,e){a.split(",").forEach(function(t){W(_,e,t)})}),_}function N(v){var _=[];if(v)for(var a in v){var e=v[a];e&&_.push(a+": "+(Array.isArray(e)?e.join(","):e).slice(0,I))}if(_.length)return _.length>S?(_.sort(function(t,c){return K(c)-K(t)}),_.slice(0,S)):_}var K=function(v){return v.toLowerCase().indexOf("kwaisign")===0||v.toLowerCase().indexOf("x-ks-")===0?1:0},z=function(v){return v.MOZ_CHUNK="moz-chunked-arraybuffer",v.UNKNOW="unknow",v.UNSUPPORT="",v}({}),B=function(){function v(){var a=this;this.tag="xhr",this.Oc=null,this.wc=void 0,this.Ec=null,this.jc=z.UNKNOW,this.kc=function(){if(a.Oc){var e=a.Oc;e.readyState===2&&(a.wc.responseUrl=e.responseURL,a.wc.responseHeader=j(e.getAllResponseHeaders()),a.Ec&&a.Ec.onConnect&&a.Ec.onConnect(a.wc,e.status),(e.status<200||e.status>299)&&a.Di())}},this.Mc=function(){if(a.Oc){var e=a.Oc.response;a.Ec&&a.Ec.onProgress&&e&&a.Ec.onProgress(a.wc,e)}},this.Sc=function(){var e=null,t=a.Oc;!a.jc&&t&&(e=t.response),a.Ec&&a.Ec.onEnd(a.wc,e)},this.Di=function(){var e;if(a.Ec&&a.Ec.onError){var t=new Error("xhr load error.");t.name=w.b.XHR_ERROR_NAME,a.Ec.onError(t)}(e=a.Oc)==null||e.abort()},this.Oc=null}v.isSupportChunk=function(){if(v.Bc!==z.UNKNOW)return v.Bc;try{var a=new XMLHttpRequest;if(a.open("GET","https://example.com",!0),a.responseType=z.MOZ_CHUNK,a.responseType===z.MOZ_CHUNK)return v.Bc=z.MOZ_CHUNK,v.Bc}catch(e){v.Bc=z.UNSUPPORT}return z.UNSUPPORT};var _=v.prototype;return _.load=function(a,e){this.Ec=e,this.wc=a,this.jc=z.UNSUPPORT,a.progress&&a.responseType==="arraybuffer"&&(this.jc=v.isSupportChunk());var t=this.Oc=new XMLHttpRequest;t.open(a.requestMethod?a.requestMethod:"GET",this.wc.url,!0),this.jc===z.MOZ_CHUNK?(t.responseType=z.MOZ_CHUNK,t.onprogress=this.Mc,t.onload=this.Sc):(t.responseType=a.responseType||"arraybuffer",t.onload=this.Sc),t.onreadystatechange=this.kc,t.onerror=this.Di,t.withCredentials=!!a.credentials,a.range&&t.setRequestHeader("Range",a.range),a.headers&&a.headers.forEach(function(c){t.setRequestHeader(c.header,c.value)}),t.send(a.requestBody)},_.abort=function(){this.Oc&&(this.Oc.onreadystatechange=null,this.Oc.onprogress=null,this.Oc.onload=null,this.Oc.onerror=null,this.Oc.abort(),this.Oc=null)},_.destroy=function(){this.Ec=null,this.abort()},v}();B.Bc=z.UNKNOW;var J=[h.i.hls,h.i.hls_ts,h.i.hls_fmp4];function be(v){return!!v&&J.indexOf(v)!==-1}var X=n(6);function ye(v,_){var a=v.toString();return a.toLowerCase().indexOf("[native code]")!==-1&&a.indexOf(_)!==-1?h.j.UNKNOWN:h.j.PROBABLY}var Be=function(){function v(a){this.tag="fetch",this.Ci=void 0,this.wc=void 0,this.Ec=null,this.Tc=null,this.Dc=null,this.Rc=!1,this.Ci=a}v.isSupported=function(){return typeof fetch<"u"&&typeof ReadableStream<"u"};var _=v.prototype;return _.load=function(a,e){var t=this;this.wc=a,this.Ec=e;var c=new Headers;a.headers&&a.headers.forEach(function(Q){c.append(Q.header,Q.value)}),a.range&&c.append("Range",a.range);var u={method:a.requestMethod?a.requestMethod:"GET",headers:c,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade",signal:this.Lc()};a.requestBody&&(u.body=a.requestBody),a.credentials&&(u.credentials="include");var g=fetch;if(a.preferNative===!0){var R=this.Nc();g=R.func,a.monkeyPatched=R.patched,a.useResetNativeFetch=R==null?void 0:R.resetNativeFetch}else a.monkeyPatched=ye(g,"fetch");g(a.url,u).then(function(Q){if(a.responseUrl=Q.url,a.redirected=Q.redirected,a.responseHeader=j(Q.headers),t.Ec&&t.Ec.onConnect&&t.Ec.onConnect(a,Q.status),Q.ok)return t.Rc?void(Q.body&&Q.body.getReader().cancel().catch(function(fe){return t.Ci.i(t.tag,fe)})):a.responseType==="arraybuffer"?a.progress?void(Q.body&&(t.Dc=Q.body.getReader(),t.Qc(t.Dc))):void Q.arrayBuffer().then(function(fe){t.xc(a,fe)}).catch(function(fe){if(!t.Rc){var xe=new Error("arraybuffer error. "+Q.status+" "+fe);xe.name=w.b.FETCH_ERROR_NAME,t.Di(xe)}}):void Q.text().then(function(fe){t.xc(a,fe)}).catch(function(fe){if(!t.Rc){var xe=new Error("text error. "+Q.status+" "+fe);xe.name=w.b.FETCH_ERROR_NAME,t.Di(xe)}});var se=new Error("res not ok. "+Q.status+" "+Q.statusText);se.name=w.b.FETCH_ERROR_NAME,t.Di(se)}).catch(function(Q){Q.name!=="AbortError"&&t.Di(Q)})},_.abort=function(){this.Tc&&(this.Tc.abort(),this.Tc=null),this.Dc&&(this.Dc.cancel().catch(function(){}),this.Dc=null),this.Rc=!0},_.destroy=function(){this.Ec=null,this.abort()},_.Mc=function(a,e){this.Ec&&this.Ec.onProgress&&this.Ec.onProgress(a,e)},_.xc=function(a,e){this.Ec&&this.Ec.onEnd&&(this.Dc=null,this.Tc=null,this.Ec.onEnd(a,e))},_.Di=function(a){this.Ec&&this.Ec.onError&&this.Ec.onError(a)},_.Qc=function(a){var e=this;a.read().then(function(t){if(e.Rc)return a.cancel(),null;if(t.done)return e.xc(e.wc,null),null;var c=t.value.buffer;return e.wc.useResetNativeFetch&&X.a.safari&&(c=new Uint8Array(new Uint8Array(c).subarray()).buffer),e.Mc(e.wc,c),e.Qc(a)}).catch(function(t){t.name!=="AbortError"&&(t.name=w.b.FETCH_READ_ERROR_NAME,e.Di(t))})},_.Lc=function(){try{if(AbortController)return this.Tc=new AbortController,this.Tc.signal}catch(a){return null}return null},_.Nc=function(){if(v.Vc!==void 0)return v.Vc;if(ye(fetch,"fetch")===h.j.PROBABLY){var a=function(e){var t,c,u=document.createElement("iframe");document.body.appendChild(u);var g=(t=((c=u.contentWindow)==null?void 0:c.fetch)||null)==null?void 0:t.bind(e);return document.body.removeChild(u),g}(window);this.Ci.i(this.tag,"detected io monkey patched. get native io, fetch: "+!!a),v.Vc=a?{func:a,patched:h.j.PROBABLY,resetNativeFetch:!0}:{func:fetch,patched:h.j.PROBABLY,resetNativeFetch:!1}}else v.Vc={func:fetch,patched:h.j.UNKNOWN,resetNativeFetch:!1};return v.Vc},v}();Be.Vc=void 0;var Ve=n(7),je=n(22),we="fallback",ue=function(v){function _(e){var t;return(t=v.call(this)||this).Do=void 0,t.Ci=void 0,t.Uc=!1,t.Fc=void 0,t.Do=e,t.Ci=e.logger,t}T()(_,v);var a=_.prototype;return a.reset=function(){return this.Ci.i(we,"reset"),this.Uc=!1,this},a.stop=function(){return this},a.setRetryFunc=function(e){return this.Fc=e,this},a.destroy=function(){this.Ci.i(we,"fallback: "+this.constructor.name+" destroy."),this.Fc=void 0,v.prototype.destroy.call(this)},a.getAvailable=function(){return!(!this.Fc||this.Uc)},a.Pc=function(e){if(this.Fc&&this.Fc()!==!1)return this.Uc=!0,e},a.emit=function(e,t){return this.Do.evt.emit(e,t)},_}(F.a),L=n(3),D=n(2),le=function(v){return v.FLV_LIVE_RELOAD="flvLiveReload",v.USE_BACKUP="useBackup",v.USE_BACKUP_MULTIPART="useBackupMultipart",v.NO_WORKER="noWorker",v.SWAP_REMUX_TYPE="swapRemuxType",v.SWAP_AUDIO_CODECSTR="swapAudioCodecStr",v.NEXT_DESC="nextDesc",v.SWAP_WASM_DECODER="swapWasmDecoder",v.SWAP_CORE="swapCore",v.SWAP_264="swap264",v.RELOAD_WASM="reloadWasm",v.DROP_V_FRAME="dropVFrame",v}({}),oe="fallback",Re=function(v){function _(e){var t;return(t=v.call(this)||this).Do=void 0,t.Ci=void 0,t.Hc={},t.Yc=void 0,t.Di=function(c){if(t.Ci.i(oe,"on error",c,Object.keys(t.Hc)),t.Yc||(t.Yc=t.Gc()),c.fatal){t.Ci.i(oe,"error. type: "+c.type+" details: "+c.details+" reason: "+c.reason);for(var u=0;u<t.Yc.actions.length;u++){var g=t.Yc.actions[u];if(g){var R=t.Hc[g.type];if(R!=null&&R.getAvailable()){var Q=t.Do.stat.coreType,se=R.run(c);if(se)return t.Ci.i(oe,"fallback run. type: "+g.type+" "+u+"/"+t.Yc.actions.length+". reason: "+c.reason),c.preventFollowUp=!0,se.code=Object(L.d)(c.details,c.reason,c.statusCode),se.errorData=s()({},c),se.core=Q,t.Do.evt.emit(D.a.RETRY,se),void t.Kc(u)}}}t.Ci.i(oe,"no fallback matched. reason: "+c.reason)}},t.Do=e,t.Ci=e.logger,t.O.push(t.Do.evt.prependListener(D.a.ERROR,t.Di)),t}T()(_,v);var a=_.prototype;return a.register=function(e,t){var c=this;return this.Ci.i(oe,"register "+e+" "+t.constructor.name),this.Hc[e]&&(this.Ci.i(oe,e+" existed."),this.O.destroyItem(t)),this.Hc[e]=t,this.O.push(t),{destroy:function(){return c.unregisterAndDestroy(e)}}},a.unregisterAndDestroy=function(e){var t=this.Hc[e];return t&&(this.O.destroyItem(t),t.destroy(),delete this.Hc[e],this.Ci.i(oe,"unregisterAndDestroy "+e)),this},a.hasFallback=function(e){return!!this.Hc[e]},a.reset=function(){for(var e in this.Ci.i(oe,"reset"),this.Hc)this.unregisterAndDestroy(e);this.Hc={},this.Yc=void 0},a.stop=function(){for(var e in this.Hc)this.Hc[e].stop()},a.Kc=function(e){if(this.Yc){var t=this.Yc.actions[e];!t||t.type!==le.SWAP_CORE&&t.type!==le.NO_WORKER||(this.Zc(le.USE_BACKUP),this.Zc(le.USE_BACKUP_MULTIPART),this.Zc(le.FLV_LIVE_RELOAD))}},a.Gc=function(){this.Ci.i(oe,"generate fallback policy.");var e=this.Do,t=(X.a.mobile,{core:e.stat.coreType,actions:[]});return e.stat.coreType===h.a.mse?t.actions.push({type:le.RELOAD_WASM},{type:le.FLV_LIVE_RELOAD},{type:le.USE_BACKUP_MULTIPART},{type:le.USE_BACKUP},{type:le.NO_WORKER},{type:le.DROP_V_FRAME},{type:le.SWAP_REMUX_TYPE},{type:le.SWAP_AUDIO_CODECSTR},{type:le.SWAP_264},{type:le.NEXT_DESC},{type:le.SWAP_WASM_DECODER},{type:le.SWAP_CORE}):e.stat.coreType===h.a.native&&t.actions.push({type:le.USE_BACKUP},{type:le.SWAP_264},{type:le.NEXT_DESC},{type:le.SWAP_CORE},{type:le.RELOAD_WASM},{type:le.FLV_LIVE_RELOAD},{type:le.USE_BACKUP_MULTIPART},{type:le.NO_WORKER},{type:le.SWAP_REMUX_TYPE},{type:le.SWAP_AUDIO_CODECSTR},{type:le.SWAP_WASM_DECODER}),t},a.Zc=function(e){var t;(t=this.Hc[e])==null||t.reset()},_}(F.a),Oe=function(v){function _(){return v.apply(this,arguments)||this}T()(_,v);var a=_.prototype;return a.run=function(e){if(this.getAvailable()&&e.details===L.a.DECODER_INIT_ERROR&&(this.Do.stat.wasmLibHitCache!=="none"||this.Do.stat.wasmThreadsEnabled))return this.Ci.i("fallback-reload-wasm","run"),this.Do.stat.wasmThreadsEnabled&&(this.Do.stat.wasmThreadsEnabled=!1),this.Pc({type:h.k.FALLBACK,message:"wasm lib init error. reload wasm.",fallback:le.RELOAD_WASM})},a.getAvailable=function(){return!this.Uc&&!X.a.mobile},_}(ue);function de(){return typeof navigator>"u"?0:navigator.hardwareConcurrency||0}var $=n(31);function ge(){return typeof window!="object"||typeof document!="object"||typeof document.createElement!="function"}var Pe=n(33),ae=n.n(Pe),q=n(13),b=n(48),ve="canvas-renderer-wrapper",U=function(){function v(a){var e=this;if(this.Do=void 0,this.Ci=void 0,this.Ai=void 0,this.Wc=void 0,this.Xc=void 0,this.At=0,this.Gu=0,this.Na=void 0,this.zc=function(t){var c=t.data;(c.event===D.a.RENDERER_DRAW||c.event===D.a.RENDERER_BUF_UPDATE)&&(e.Gu=c.data.yuvBufLen),e.Xc&&e.Ai.emit(c.event,c.data)},this.Jc=function(t){e.Do.logger.i(ve,"worker onerror",t.message),e.Ai.emit(D.a.ERROR,Object(L.e)(L.b.RENDERER_ERROR,L.a.DECODER_DEC_ERROR,"r: "+t.message))},this.Do=a,this.Ci=a.logger,this.Ai=a.evt,!a.cOutput)throw new Error("canvas output undefined.");this.Na=a.cOutput}var _=v.prototype;return _.init=function(a){this.Ci.i(ve,"init renderer");var e=this.Do.getDecConfig();if(this.Na.canvas instanceof HTMLCanvasElement){if(a)try{var t;this.Xc=ae()(58);var c=this.Na.canvas.transferControlToOffscreen();(t=this.Xc)==null||t.postMessage({cmd:q.a.INIT_RENDERER,id:this.At,config:e,canvas:c,contextId:this.Do.id,hasExternalLogger:!!this.Do.config.logger},[c])}catch(g){var u;this.Ci.i(ve,"rendering worker startup failed.",g),(u=this.Xc)==null||u.terminate(),this.Xc=void 0}this.Xc?(this.Xc.addEventListener("message",this.zc),this.Xc.addEventListener("error",this.Jc)):(this.Wc=new b.a(this.Ci,this.Ai),this.Wc.init(this.At,e,this.Na.canvas))}else this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.RENDERER_ERROR,L.a.DECODER_UNSUPPORTED,"init error worker:"+!!this.Xc+" canvas:"+!!this.Na.canvas+" decoder:"+!!this.Wc))},_.destroy=function(){this.Ci.i(ve,"destroy"),this.Xc?(this.Xc.postMessage({cmd:q.a.DESTROY}),this.Xc.removeEventListener("message",this.zc),this.Xc.removeEventListener("error",this.Jc),this.Xc.terminate()):this.Wc&&(this.Wc.destroy(),this.Wc=void 0)},_.step=function(a){this.Ci.i(ve,"step: "+a),this.Xc?this.Xc.postMessage({cmd:q.a.STEP,type:a}):this.Wc&&this.Wc.step(a)},_.updateMediaInfo=function(a){(this.Xc||this.Wc)&&(this.Xc?this.Xc.postMessage({cmd:q.a.MEDIA_INFO,mediaInfo:a}):this.Wc&&this.Wc.updateMediaInfo(a))},_.seek=function(a,e){this.Ci.i(ve,"seek["+e+"]: time: "+a),this.Xc?this.Xc.postMessage({cmd:q.a.SEEK,time:a,id:e}):this.Wc&&this.Wc.seek(a,e)},_.reset=function(a){a===void 0&&(a=!1),this.Gu=0,this.Xc?this.Xc.postMessage({cmd:q.a.RESET,decId:this.At,seeking:a}):this.Wc&&this.Wc.reset(this.At,a)},_.append=function(a){this.Xc?this.Xc.postMessage({cmd:q.a.APPEND_DATA,frame:a},[a.y.bytes.buffer,a.u.bytes.buffer,a.v.bytes.buffer]):this.Wc&&this.Wc.append(a)},_.update=function(a,e,t,c,u,g,R){this.Xc?this.Xc.postMessage({cmd:q.a.UPDATE_STATE,streamTime:a,width:e,height:t,stoped:c,output:u,maxFrameBufLen:g,pictMode:R}):this.Wc&&this.Wc.updateState(a,e,t,c,u,g,R)},_.endOfData=function(){this.Xc?this.Xc.postMessage({cmd:q.a.END_OF_DATA}):this.Wc&&this.Wc.endOfData()},_.dropFrame=function(a){this.Xc?this.Xc.postMessage({cmd:q.a.DEC_DROP_FRAME,data:a}):this.Wc&&this.Wc.decDropFrameInfo(a)},_.screenshot=function(a){this.Xc?this.Xc.postMessage({cmd:q.a.SCREENSHOT,options:a}):this.Wc&&this.Wc.screenshot(a)},m()(v,[{key:"isUseingWorker",get:function(){return!!this.Xc}},{key:"id",get:function(){return this.At},set:function(a){this.At=a}},{key:"frameBufLen",get:function(){return this.Gu}}])}(),M=[16,24,32],ne=function(){function v(){this.qc=[],this.$c=0}return v.prototype.onWaiting=function(){this.qc.push(performance.now()),this.qc.length>3&&this.qc.shift(),this.$c>=M.length-1||this.qc.length>=3&&this.qc[this.qc.length-1]-this.qc[0]<15e3&&this.$c++},m()(v,[{key:"maxFrameBufLen",get:function(){return M[this.$c]||M[M.length-1]||M[0]}}])}(),Le="canvas-provider",Ue=function(v){function _(e){var t;return(t=v.call(this)||this).Do=void 0,t.Ci=void 0,t.Ai=void 0,t.Sa=[],t.tf=!1,t.if=!0,t.zu=void 0,t.No=!1,t.ef=void 0,t.yt={w:0,h:0},t.nf=!1,t.sf=void 0,t.rf=new ne,t.Ra=function(){var c;t.tf&&(c=t.Do.cOutput)!=null&&c.canvas&&(t.hf(),requestAnimationFrame(t.Ra))},t.Do=e,t.Ci=e.logger,t.Ai=e.evt,t.sf=new U(e),t.O.push(t.sf),t}T()(_,v);var a=_.prototype;return a.destroy=function(){this.Sa=[],this.stop(),v.prototype.destroy.call(this)},a.setMediaInfo=function(e){this.Ci.i(Le,"setMediaInfo",e),this.Sa.push(e)},a.start=function(){this.tf||(this.Ci.i(Le,"start loop"),this.tf=!0,requestAnimationFrame(this.Ra))},a.stop=function(){this.Ci.i(Le,"stop loop"),this.tf=!1},a.step=function(e){this.Ci.i(Le,"step type: "+e+"."),this.sf.step(e)},a.hf=function(){},a.af=function(e){var t=!1,c=(ge()?1:window.devicePixelRatio)||1,u=e.clientWidth*c,g=e.clientHeight*c;return this.yt.w===u&&this.yt.h===g||(this.yt.w=u,this.yt.h=g,t=!0),t},m()(_,[{key:"canvas",get:function(){var e;return(e=this.Do.cOutput)==null?void 0:e.canvas}},{key:"waiting",get:function(){return this.if}},{key:"pausedOnWaiting",get:function(){return this.ef},set:function(e){this.ef=e}}])}(F.a),re=n(51),k=(n(50),"https://s2-10895.kwimgs.com/kos/nlav10895/"),P={key:"kwai-deckvc30-lib",lib:k+"kvc30/9/libkvc30dec.wasm",libS:k+"kvc30/9/libkvc30dec-simd.wasm",libT:k+"kvc30/9/libkvc30dec-threads.wasm",libST:k+"kvc30/9/libkvc30dec-simd-threads.wasm",js:k+"kvc30/9/libkvc30dec.js",jsT:k+"kvc30/9/libkvc30dec-threads.js",jsST:k+"kvc30/9/libkvc30dec-simd-threads.js",jsW:k+"kvc30/9/libkvc30dec-threads.worker.js"},Z={key:"kwai-deckvc-lib",lib:k+"kvc/kvc-decoder-1.wasm",libS:k+"kvc/kvc-decoder-simd-1.wasm",libT:k+"kvc/kvc-decoder-threads-2.wasm",libST:k+"kvc/kvc-decoder-simd-threads-2.wasm",js:k+"kvc/kvc-decoder-1.js",jsT:k+"kvc/kvc-decoder-threads-2.js",jsST:k+"kvc/kvc-decoder-simd-threads-2.js",jsW:k+"kvc/kvc-decoder-threads-2.worker.js"},he={key:"kwai-deckvc4-lib",lib:k+"kvc4/kvc-decoder-1.wasm",libS:k+"kvc4/kvc-decoder-simd-1.wasm",libT:k+"kvc4/kvc-decoder-threads-1.wasm",libST:k+"kvc4/kvc-decoder-simd-threads-1.wasm",js:k+"kvc4/kvc-decoder-1.js",jsT:k+"kvc4/kvc-decoder-threads-1.js",jsST:k+"kvc4/kvc-decoder-simd-threads-1.js",jsW:k+"kvc4/kvc-decoder-threads-1.worker.js"},Ie={key:"kwai-deckvc6-lib",lib:k+"kvc6/kvc-decoder-2.wasm",libS:k+"kvc6/kvc-decoder-simd-2.wasm",libT:k+"kvc6/kvc-decoder-threads-2.wasm",libST:k+"kvc6/kvc-decoder-simd-threads-2.wasm",js:k+"kvc6/kvc-decoder-2.js",jsT:k+"kvc6/kvc-decoder-threads-2.js",jsST:k+"kvc6/kvc-decoder-simd-threads-2.js",jsW:k+"kvc6/kvc-decoder-threads-2.worker.js"},Ee={key:"kwai-kw265-lib",lib:k+"ks265/libks265dec-4.wasm",libS:k+"ks265/libks265dec-simd-4.wasm",libT:k+"ks265/libks265dec-threads-4.wasm",libST:k+"ks265/libks265dec-simd-threads-4.wasm",js:k+"ks265/libks265dec-4.js",jsT:k+"ks265/libks265dec-threads-4.js",jsST:k+"ks265/libks265dec-simd-threads-4.js",jsW:k+"ks265/libks265dec-threads-4.worker.js"},pe=function(){function v(){this.timeout=6048e5}var _=v.prototype;return _.write=function(a,e){if(v.available)try{return localStorage.setItem(a,JSON.stringify({value:e,time:Date.now()})),!0}catch(t){}return!1},_.read=function(a,e){if(e===void 0&&(e=!0),v.available)try{var t=localStorage.getItem(a);if(t){var c=JSON.parse(t),u=c.value,g=c.time,R=g===void 0?0:g;if(!e||Date.now()-R<(typeof e=="number"?e:this.timeout))return u}}catch(Q){}},m()(v,null,[{key:"available",get:function(){if(v.ut===void 0)try{localStorage.setItem("alg","test"),v.ut=!0}catch(a){v.ut=!1}return v.ut}}])}();pe.ut=void 0;var G=pe,te={},ie=Ee,ee={},Te="dec-lib-helper",Se=function(){function v(a){this.Ci=void 0,this.uf=new G,this.Ci=a,te[h.t.kvc3]=Z,te[h.t.kvc4]=he,te[h.t.kvc5]=Ie,te[h.t.kvc6]=Ie,te[h.t.kvc30]=P,te[h.t.kw265]=Ee}var _=v.prototype;return _.getDecLibURL=function(a){return te[a]||ie},_.getLsLibCacheKeys=function(){var a=[],e=Object.keys(te).map(function(u){return te[u].key});if(G.available)for(var t=0;t<localStorage.length;t++){var c=localStorage.key(t);c&&e.indexOf(c)>=0&&a.push(c)}return a},_.getMemLibCacheKeys=function(){return Object.keys(ee)},_.saveToCache=function(a,e,t){if(t===void 0&&(t=!0),this.Ci.i(Te,"save to cache "+a+". key: "+this.getDecLibURL(a).key+" ls: "+t),e.wasm.data&&(ee[a]=e,t)){var c={ts:Date.now(),js:s()({},e.js),wasm:{url:e.wasm.url,data:re.Base64.fromUint8Array(e.wasm.data)}};e.jsw&&(c.jsw=s()({},e.jsw));var u=!1,g=1;do this.cf(g,a),u=this.uf.write(this.getDecLibURL(a).key,c),this.getLsLibCacheKeys().length,g--;while(!u&&g>=0)}},_.loadFromCache=function(a,e){this.Ci.i(Te,"load from cache "+a+".");var t=ee[a];if(t){if(this.Ci.i(Te,"hit cache "+a+". mem"),this.ff(a,t,e))return"mem";delete ee[a]}var c=this.getDecLibURL(a),u=this.uf.read(c.key,!1);return u&&this.ff(a,u,e)?(this.Ci.i(Te,"hit cache "+a+". ls"),ee[a]=e,"ls"):"none"},_.removeMemCache=function(){ee={}},_.removeAllCache=function(){this.Ci.i(Te,"remove all cache"),this.removeMemCache();var a=this.getLsLibCacheKeys();G.available&&a.forEach(function(e){localStorage.removeItem(e)})},_.ff=function(a,e,t){return e.js&&e.js.data&&e.js.url===t.js.url&&(this.Ci.i(Te,"hit cache "+a+" js."),t.js.data=e.js.data),t.jsw&&e.jsw&&e.jsw.data&&e.jsw.url===t.jsw.url&&(this.Ci.i(Te,"hit cache "+a+" jsw."),t.jsw.data=e.jsw.data),e.wasm&&e.wasm.data&&e.wasm.url===t.wasm.url&&(this.Ci.i(Te,"hit cache "+a+" wasm."),t.wasm.data=typeof e.wasm.data=="string"?re.Base64.toUint8Array(e.wasm.data):new Uint8Array(e.wasm.data)),!(!t.js.data||!t.wasm.data)},_.cf=function(a,e){var t=this;if(this.Ci.i(Te,"remove ls Cache",a),G.available){var c=this.getLsLibCacheKeys();if(c.length>a){var u=[],g=[];c.forEach(function(Q){var se=t.uf.read(Q),fe=t.Af(se);se&&fe?g.push({key:Q,val:se}):u.push(Q)}),g.sort(function(Q,se){return Q.val.ts-se.val.ts});for(var R=0;R<g.length-a;R++)u.push(g[R].key);this.Ci.i(Te,"remove",u),u.forEach(function(Q){localStorage.removeItem(Q)})}}},_.Af=function(a){return!!(a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"ts")&&typeof a.ts=="number"&&Object.prototype.hasOwnProperty.call(a,"js")&&typeof a.js=="object"&&typeof a.js.data=="string"&&Object.prototype.hasOwnProperty.call(a,"wasm")&&typeof a.wasm=="object"&&typeof a.wasm.data=="string")},v}(),Ye=n(23),ze=n.n(Ye),it=0,ct="loader",nt=function(){function v(a){var e=this;this.Ci=void 0,this.wc=void 0,this.vf=void 0,this.Ec=null,this.di=void 0,this.df=void 0,this.lf=void 0,this.bf=0,this.pf=!1,this.mf=!1,this.gf=void 0,this.yf=void 0,this._f=void 0,this.Cf=void 0,this.If=0,this.Ct=0,this.Of=function(){var t;e.pf=!0,e.mf=!1;var c=e.lf,u=e.wc;(t=e.Ec)!=null&&t.onLoad&&e.Ec.onLoad(u,c),c.code=0,c.tfirst=0,c.loaded=0,e.wf(),e.vf=new(e.Ef())(e.Ci),c.type=e.vf instanceof Be?w.c.FETCH:w.c.XHR,e.vf&&(c.id=e.vf.tag+"-"+e.Ct,e.di.connectionTimeout&&(e.gf=setTimeout(function(){return e.jf(w.a.LOADER_CONNECT_TIMEOUT)},e.di.connectionTimeout)),e.kf(u),c.tsload=Date.now(),c.tstart=performance.now(),e.Ci.i(ct,"["+e.Ct+"]load: "+e.vf.tag+" "+u.url+" progress: "+u.progress+" type: "+u.type+" responseType: "+u.responseType+" range: "+u.range),e.vf.load(u,e.df))},this.Mf=function(t,c){e.Sf();var u=e.lf;e.Bf(t,u),e.Tf(),u.code=c,u.tfirst=Math.max(u.trequest,performance.now()),e.Ci.i(ct,"["+e.Ct+"]connect code: "+c+" len: "+u.contentLength+" totalLength: "+u.contentTotalLength),e.Ec&&e.Ec.onConnect&&e.Ec.onConnect(t,u),typeof t.rangeStart=="number"&&t.rangeStart>0&&u.code!==206&&e.Ec&&e.Ec.onError&&setTimeout(function(){e.Di(new Error("range error. "+t.range+" statu code:"+u.code))},0)},this.Mc=function(t,c){try{var u=e.lf;if(e.If=performance.now(),!t.breakpointContinuation&&u.output>u.loaded){if(u.loaded+c.byteLength-u.output>0){var g=c.slice(u.output-u.loaded);e.Df(e.wc,g,u)}u.loaded+=c.byteLength}else u.loaded+=c.byteLength,e.Df(e.wc,c,u)}catch(R){e.Ci.i(ct,"handling data error. ",R),e.Di(new Error(w.a.HANDLING_DATA_ERROR+". "+R))}},this.Di=function(t){e.Rf(),e.Lf();var c,u=e.lf,g=e.di,R=e.wc,Q=u.type===w.c.FETCH&&R.monkeyPatched&&R.preferNative===void 0;e.pf=!1,e.Ci.i(ct,"["+e.Ct+"]error: "+t.name+" "+(t==null?void 0:t.message)+" code: "+u.code+" retry: "+u.retry+"/"+g.maxRetry+" "+(Q?"monkeyPatchedFetch":"")),e.wc.breakpointContinuation&&u.code===416||Q&&e.lf.output===u.loaded&&u.loaded>0?(c=e.Ec)!=null&&c.onEnd&&e.Ec.onEnd(e.wc,null,u):(u.fatal=!g.maxRetry||u.retry>=g.maxRetry||!g.maxRetry,u.errName=t.name,u.errMessage=t.name+": "+t.message+". status: "+u.code,Q&&(t.name===w.b.FETCH_READ_ERROR_NAME&&!e.lf.loaded||t.message===w.a.LOADER_TRANS_TIMEOUT&&!e.lf.loaded||t.message===w.a.LOADER_CONNECT_TIMEOUT||!e.lf.code)&&(e.wc.preferNative=!0,e.Ci.i(ct,"monkey patched fetch error. switch to native fetch.")),e.Ec&&e.Ec.onError&&e.Ec.onError(e.wc,u),u.fatal||(g.breakpointContinuation&&e.lf.contentTotalLength&&(e.Ci.i(ct,"["+e.Ct+"]breakpointContinuation. "+e.lf.loaded+" / "+e.lf.contentTotalLength),e.lf.output&&e.lf.loaded>0?(e.Cf?e.wc.rangeStart=e.Cf+e.lf.output:e.wc.rangeStart=e.lf.output,e.wc.breakpointContinuation=!0):(e.wc.rangeStart=e.Cf,e.wc.breakpointContinuation=!1)),u.retry++,e.Ec&&(e.bf?(e._f=setTimeout(e.Of,e.bf),e.bf=2*e.bf):e.Of())))},this.jf=function(t){e.pf=!1,e.Nf();var c=new Error(t);e.Di(c)},this.Ci=a,this.Ct=it+=1,this.Ci.i(ct,"["+this.Ct+"]constructor"),this.vf=null,this.di={connectionTimeout:0,transmissionTimeout:0,maxRetry:0,retryDelay:0},this.df={onConnect:this.Mf,onProgress:this.Mc,onEnd:this.xc.bind(this),onError:this.Di}}var _=v.prototype;return _.Ef=function(){return v.Qf!==void 0||(v.Qf=B,X.a.msie||X.a.msedge?B.isSupportChunk()?v.Qf=B:Be.isSupported()&&(v.Qf=Be):Be.isSupported()?v.Qf=Be:B.isSupportChunk()&&(v.Qf=B)),v.Qf},_.load=function(a,e,t){this.fa(a,e,t),this.Of()},_.destroy=function(){this.vf&&this.Ci.i(ct,"["+this.Ct+"]destroy."),this.Rf(),this.Nf(!1),this.Lf(),this.Ec=null},_.abort=function(){this.Ci.i(ct,"["+this.Ct+"]abort"),this.Rf(),this.Nf()},_.fa=function(a,e,t){this.wc=a,this.Cf=a.rangeStart,this.Ec=e,this.di=t||this.di,this.lf={id:"",type:w.c.UNKNOWN,trequest:performance.now(),retry:0,loaded:0,code:0,output:0,tfirst:0,tload:0,total:0,tsload:0,tstart:0,fatal:!1,errName:"",errMessage:""},this.di.retryDelay&&(this.bf=this.di.retryDelay)},_.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=null)},_.Nf=function(a){a===void 0&&(a=!0),a&&this.Ec&&this.Ec.onAbort&&!this.mf&&this.pf&&this.Ec.onAbort(this.wc,this.lf),this.mf=!0,this.vf&&this.vf.abort()},_.Rf=function(){this.Sf(),this.wf(),this.xf()},_.Df=function(a,e,t){this.lf.output+=e.byteLength,this.Ec&&this.Ec.onProgress&&this.Ec.onProgress(a,e,t)},_.xc=function(a,e){this.Rf();var t=this.lf;this.Bf(a,t),t.total=e?t.loaded=typeof e=="string"?e.length||0:e.byteLength||0:t.loaded,t.tload=Math.max(t.tfirst,performance.now()),this.pf=!1,t.output=0,this.Ci.i(ct,"["+this.Ct+"]end size: "+t.total+" duration: "+t.trequest+"-"+t.tload),this.Ec&&this.Ec.onEnd(a,e,t)},_.Tf=function(){var a=this;this.xf(),this.If=performance.now();var e=this.di.transmissionTimeout||0;e&&(this.yf=setInterval(function(){performance.now()-a.If>e&&a.jf(w.a.LOADER_TRANS_TIMEOUT)},1e3))},_.xf=function(){this.yf&&(clearInterval(this.yf),this.yf=void 0)},_.Sf=function(){this.gf&&(clearTimeout(this.gf),this.gf=void 0)},_.wf=function(){this._f&&(clearTimeout(this._f),this._f=void 0)},_.kf=function(a){if(a.rangeEnd||a.rangeStart)if(a.rangeType&&a.rangeType!==h.e.STANDARD&&typeof a.url=="string"){var e=new ze.a(a.url,!0);a.rangeEnd?(e.query.start=(a.rangeStart||0).toString(),e.query.end=(a.rangeEnd-1).toString()):a.rangeStart&&(e.query.start=a.rangeStart.toString()),a.url=e.toString()}else a.rangeEnd?a.range="bytes="+(a.rangeStart||0)+"-"+(a.rangeEnd-1):a.rangeStart&&(a.range="bytes="+a.rangeStart+"-")},_.Bf=function(a,e){if(!e.contentTotalLength||!e.contentLength){var t=a.responseHeader;if(t){if(a.range||typeof a.rangeStart=="number"){var c=t["content-range"];c&&(e.contentTotalLength=parseInt((Array.isArray(c)?c[0]||"0":c).split("/")[1]||"0")||0)}var u=t["content-length"];u&&(e.contentLength=parseInt(Array.isArray(u)?u[0]||"0":u)||0)}}},m()(v,[{key:"context",get:function(){return this.wc}},{key:"config",get:function(){return this.di}}])}();nt.Qf=void 0;var Wt="dec-lib-loader",Et=function(){function v(a){var e=this;this.Vf=h.t.kw265,this.Do=void 0,this.Ci=void 0,this.Uf=void 0,this.Ff=void 0,this.Pf=void 0,this.Hf=0,this.Bo=void 0,this.Yf=function(t,c){c.fatal&&(e.Lf(),e.Do.evt.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.DEC_LIB_LOAD_ERROR,c.errMessage,{statusCode:c.code,url:t.url})))},this.Do=a,this.Ci=a.logger,this.Bo=new Se(a.logger)}var _=v.prototype;return _.load=function(a,e,t,c){this.Ci.i(Wt,"load ignoreCache: "+a+" decoderType: "+e+" simd: "+t+", threads: "+c),this.Hf=performance.now(),this.Vf=e;var u=this.Bo.getDecLibURL(this.Vf),g=u.js,R="",Q=u.lib;c&&u.jsW&&(t&&u.libST&&u.jsST?(Q=u.libST,g=u.jsST,R=u.jsW):u.libT&&u.jsT?(Q=u.libT,g=u.jsT,R=u.jsW):c=!1),t&&!c&&u.libS&&(Q=u.libS);var se,fe={js:{url:g,data:""},wasm:{url:Q}};R&&(fe.jsw={url:R,data:""}),a||(se=this.Bo.loadFromCache(this.Vf,fe)),this.Ci.i(Wt,"wasm: "+Q+" cacheType: "+se),this.Gf(fe,se)||(fe.js.data||this.Kf(fe),fe.wasm.data||this.Zf(fe),fe.jsw&&!fe.jsw.data&&this.Wf(fe))},_.destroy=function(){this.Lf()},_.Lf=function(){this.Xf(),this.zf(),this.Jf()},_.Gf=function(a,e){e===void 0&&(e="none");var t=!!(a.js.data&&a.wasm.data&&(!a.jsw||a.jsw&&a.jsw.data));if(e!=="mem"&&t&&this.Bo.saveToCache(this.Vf,a,e==="none"),t){this.Ci.i(Wt,"dec lib loaded",e);var c={lib:a,hitCache:e,duration:performance.now()-this.Hf};this.Do.evt.emit(D.a.DEC_LIB_LOADED,c)}return t},_.Zf=function(a){var e=this;this.Ci.i(Wt,"load wasm"),this.Xf();var t=this.Uf=new nt(this.Ci),c={onError:this.Yf,onEnd:function(R,Q){Q instanceof ArrayBuffer&&(a.wasm.data=new Uint8Array(Q),e.Gf(a))}},u={connectionTimeout:this.Do.config.decLibConnectionTimeout,maxRetry:this.Do.config.decLibLoadingMaxRetry,retryDelay:this.Do.config.decLibLoadingRetryDelay},g={url:a.wasm.url,responseType:"arraybuffer",progress:!1,preferNative:this.Do.stat.preferNativeLoader};t.load(g,c,u)},_.Kf=function(a){var e=this;this.Ci.i(Wt,"load js"),this.zf();var t=this.Ff=new nt(this.Ci),c={onError:this.Yf,onEnd:function(R,Q){typeof Q=="string"&&(a.js.data=Q,e.Gf(a))}},u={connectionTimeout:this.Do.config.decLibConnectionTimeout,maxRetry:this.Do.config.decLibLoadingMaxRetry},g={url:a.js.url,responseType:"text",progress:!1,preferNative:this.Do.stat.preferNativeLoader};t.load(g,c,u)},_.Wf=function(a){var e=this;if(this.Ci.i(Wt,"load jsw"),this.Jf(),a.jsw){var t=this.Pf=new nt(this.Ci),c={onError:this.Yf,onEnd:function(R,Q){typeof Q=="string"&&(a.jsw&&(a.jsw.data=Q),e.Gf(a))}},u={connectionTimeout:this.Do.config.decLibConnectionTimeout,maxRetry:this.Do.config.decLibLoadingMaxRetry},g={url:a.jsw.url,responseType:"text",progress:!1,preferNative:this.Do.stat.preferNativeLoader};t.load(g,c,u)}},_.Xf=function(){this.Uf&&this.Uf.destroy()},_.zf=function(){this.Ff&&this.Ff.destroy()},_.Jf=function(){this.Pf&&this.Pf.destroy()},v}(),Ut=n(21);function Yt(){var v,_,a;if(!ge())return((v=window)==null?void 0:v.ManagedMediaSource)||((_=window)==null?void 0:_.MediaSource)||((a=window)==null?void 0:a.WebKitMediaSource)}function Jt(){var v,_,a;if(!ge())return((v=window)==null?void 0:v.ManagedSourceBuffer)||((_=window)==null?void 0:_.SourceBuffer)||((a=window)==null?void 0:a.WebKitSourceBuffer)}var si=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){if(this.getAvailable()&&(this.Do.stat.coreType===h.a.mse&&a.type===L.b.NETWORK_ERROR&&a.details!==L.a.DEC_LIB_LOAD_ERROR&&a.details!==L.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED&&!this.Do.stat.multipart||this.Do.stat.coreType===h.a.native&&a.details!==L.a.KEY_SYSTEM_UNSUPPORTED)){var e=this.Do.lctx.current;if(e&&e.urlId<e.url.length-1)return this.Ci.i("fallback-backup","run"),e.urlId++,this.Pc({type:h.k.BACKUP,message:"trans error. use backup url.",fallback:le.USE_BACKUP})}},_}(ue),Lt=n(39);function _t(v,_){return _?Lt.a.search(_,function(a){return v<a.start?-1:v>a.start+a.duration?1:0}):null}function ai(v,_){return _?Lt.a.searchIndex(_,function(a){return v<a.start?-1:v>a.start+a.duration?1:0}):-1}function wi(v){if(v){var _=v.toLocaleLowerCase();return _.indexOf("audio")>=0?h.o.AUDIO:_.match(/(video|sps|pps|VTDecompression)/i)?h.o.VIDEO:void 0}}var Oi="fallback-drop-v-frame",bi=function(v){function _(){for(var e,t=arguments.length,c=new Array(t),u=0;u<t;u++)c[u]=arguments[u];return(e=v.call.apply(v,[this].concat(c))||this).qf=0,e}T()(_,v);var a=_.prototype;return a.run=function(e){var t=wi(e.reason);if(this.getAvailable()&&t===h.o.VIDEO&&e.details===L.a.VIDEO_ERROR_3){var c,u,g=this.Do;this.Ci.i(Oi,"run"),this.qf++;var R=g.streamTime.getKeyFrameTime(g.currentTime),Q=(c=g.lctx.current)==null?void 0:c.dropVideo,se=g.stat.multipart?(u=_t(g.currentTime,g.lctx.current.fragments))==null?void 0:u.sn:-1;if(typeof se!="number"||!Q)return;if(R){for(var fe=0;fe<Q.length;fe++){var xe,Fe,Ne;if(se>=0&&se===((xe=Q[fe])==null?void 0:xe.fragSn)&&((Fe=Q[fe])==null?void 0:Fe.keyframePTS)===R.originPTS||((Ne=Q[fe])==null?void 0:Ne.keyframePTS)===R.originPTS)return}var He={time:g.currentTime,keyframePTS:R.originPTS,fragSn:se>=0?se:void 0,mode:"keyframesOnly"},rt="video dec err: "+e.details+" @"+He.time+" drop v sample after key pts: "+He.keyframePTS+".";return this.Ci.i(Oi,rt),Q.push(He),this.Pc({type:h.k.FALLBACK,message:rt,fallback:le.DROP_V_FRAME})}}},a.reset=function(){return this.Ci.i(Oi,"reset"),this.qf=0,v.prototype.reset.call(this),this},a.getAvailable=function(){return!(!(this.Fc&&this.qf<this.Do.config.mseDecErrSkip)||this.Do.stat.isLive===!0&&this.Do.stat.box===h.i.flv)},_}(ue),zi="fallback-flv-live-reload",Pt=function(v){function _(){for(var e,t=arguments.length,c=new Array(t),u=0;u<t;u++)c[u]=arguments[u];return(e=v.call.apply(v,[this].concat(c))||this).$f=void 0,e.qf=0,e}T()(_,v);var a=_.prototype;return a.run=function(e){if(this.Fc&&e.type===L.b.NETWORK_ERROR&&e.details!==L.a.DEC_LIB_LOAD_ERROR&&e.details!==L.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED&&this.Do.stat.isLive!==!1&&this.Do.stat.box===h.i.flv&&this.getAvailable())return this.Ci.i(zi,"run"),this.tA(Math.max(this.Do.config.retryDelay,1e3*this.Do.bufferedSec),e,this.Fc),{type:h.k.LOADER,message:"live flv network error reason: "+(e==null?void 0:e.reason)+". retry: "+this.qf+". reload",fallback:le.FLV_LIVE_RELOAD}},a.reset=function(){return this.Ci.i(zi,"reset"),this.iA(),this.qf=0,v.prototype.reset.call(this),this},a.stop=function(){return this.iA(),this},a.destroy=function(){this.iA()},a.getAvailable=function(){return this.qf<this.Do.config.maxRetry},a.tA=function(e,t,c){var u=this;this.$f||(this.$f=setTimeout(function(){u.Ci.i(zi,"live retry:"+u.qf),u.qf++,c(),u.$f=void 0},e))},a.iA=function(){this.$f&&(this.Ci.i(zi,"clear retry delay timer."),clearTimeout(this.$f),this.$f=void 0)},_}(ue),It=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){if(this.getAvailable()&&a.details===L.a.REMUX_WORKER_ERROR&&this.Do.stat.webWorker)return this.Ci.i("fallback-no-worker","remux worker error. close worker and retry."),this.Do.stat.webWorker=!1,this.Pc({type:h.k.FALLBACK,message:"remux worker error. close worker",fallback:le.NO_WORKER})},_}(ue),Ni=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){var e=this.Do.stat.audioCodec,t=wi(a.reason);if(this.getAvailable()&&(!t||t===h.o.AUDIO)&&(a.details===L.a.VIDEO_ERROR||a.details===L.a.VIDEO_ERROR_3)&&!this.Do.stat.recoverSwapAudioCodec&&e)return this.Ci.i("fallback-swap-audio-codec-str","run"),e=e.indexOf("mp4a.40.5")!==-1?"mp4a.40.2":"mp4a.40.5",this.Do.stat.audioCodec=e,this.Do.stat.recoverSwapRemux=!0,this.Pc({type:h.k.FALLBACK,message:"video error: "+a.details+". change audio codec: "+e+".",fallback:le.SWAP_AUDIO_CODECSTR})},_}(ue),Nt=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){var e=wi(a.reason);if(this.getAvailable()&&(!e||e===h.o.VIDEO)&&!this.Do.stat.recoverSwapRemux&&(a.details===L.a.VIDEO_ERROR||a.details===L.a.VIDEO_ERROR_3))return this.Ci.i("fallback-swap-remux","run"),this.Do.stat.recoverSwapRemux=!0,this.Do.stat.box===h.i.flv&&this.Do.stat.isLive?this.Do.stat.gopRemux=!0:this.Do.streamingMuxEnabled=!1,this.Pc({type:h.k.FALLBACK,message:"video error: "+a.details+". change remux type.",fallback:le.SWAP_REMUX_TYPE})},_}(ue),Ct=function(v){function _(){return v.apply(this,arguments)||this}T()(_,v);var a=_.prototype;return a.run=function(e){if(this.getAvailable()&&Ks&&(e.details===L.a.VIDEO_ERROR||e.details===L.a.VIDEO_ERROR_3||e.details===L.a.VIDEO_ERROR_4||e.details===L.a.VIDEO_NO_SIZE)&&this.Do.stat.codecType===h.c.hevc&&this.Do.stat.decoder===h.d.buildin&&this.Do.config.wasmDecoderEnabled&&ht.TYPE_SUPPORTED.hevc&&!X.a.mobile)return this.Ci.i("fallback-wasm-decoder","run"),this.Do.lctx.levels.forEach(function(t){return t.dropVideo=[]}),this.Do.resetStreamingEnabled(),this.Do.stat.hevcFallbackWasm=!0,this.Pc({type:h.k.FALLBACK,message:"buildin "+(ht.isSupportHW?"hardware":"software")+" hevc dec error. video error: "+e.details+". use wasm decoder.",fallback:le.SWAP_WASM_DECODER})},a.getAvailable=function(){return!this.Uc&&!X.a.mobile},_}(ue),Bt=n(34),ri=n(12);function Mi(){return document.hidden||document.webkitHidden||document.mozHidden||!0}function Gr(v){var _;performance.addEventListener&&(_=v,performance&&(typeof performance.setResourceTimingBufferSize=="function"?performance.setResourceTimingBufferSize(_):typeof performance.webkitSetResourceTimingBufferSize=="function"&&performance.webkitSetResourceTimingBufferSize(_)),performance.addEventListener("resourcetimingbufferfull",Ci))}function yi(){performance.removeEventListener&&performance.removeEventListener("resourcetimingbufferfull",Ci)}var Ci=function(){performance&&(typeof performance.clearResourceTimings=="function"?performance.clearResourceTimings():typeof performance.webkitClearResourceTimings=="function"&&performance.webkitClearResourceTimings())},Br=n(44),bt=function(v){return v[v.NONE=0]="NONE",v[v.WAITING=1]="WAITING",v[v.SEEK=2]="SEEK",v[v.SELECT_BITRATE=3]="SELECT_BITRATE",v[v.INIT=4]="INIT",v[v.LOADING=5]="LOADING",v}({}),zt="kernel-base",tn=function(v){function _(e){var t;if((t=v.call(this)||this).Do=void 0,t.Ci=void 0,t.eA=void 0,t.nA=void 0,t.sA=void 0,t.Io=bt.INIT,t.Sa=void 0,t.rA=0,t.hA=[],t.oA=void 0,t.aA=void 0,t.uA=!1,t.pa=void 0,!e.video)throw new Error("video is null");return t.Do=e,t.Ci=e.logger,t.eA=e.video,t.aA={loadedmetadata:t.cA.bind(t),loadeddata:t.fA.bind(t),canplay:t.AA.bind(t),seeking:t.vA.bind(t),seeked:t.dA.bind(t),waiting:t.lA.bind(t),playing:t.bA.bind(t),pause:t.pA.bind(t),play:t.mA.bind(t),error:t.gA.bind(t),ended:t.yA.bind(t),ratechange:t._A.bind(t),durationchange:t.CA.bind(t),timeupdate:t.IA.bind(t),progress:t.OA.bind(t),emptied:t.wA.bind(t),resize:t.EA.bind(t)},t.jA(),t}T()(_,v);var a=_.prototype;return a.destroy=function(){this.Ci.i(zt,"destroy"),this.uA=!1,this.kA(),this.MA(),v.prototype.destroy.call(this)},a.getTrackBufInfo=function(){},a.load=function(){this.eA.load()},a.resume=function(){var e,t=this;this.eA.paused&&((e=this.eA.play())==null||e.catch(function(c){return t.Ci.i(zt,"resume, call play() fail.",c)}))},a.refresh=function(){},a.stopLoad=function(){},a.SA=function(){var e=this.Sa&&this.Sa.fps?this.Sa.fps:30;return this.eA.duration&&!this.eA.ended?this.eA.currentTime+1/e:-1},a.BA=function(){var e=this.Sa&&this.Sa.fps?this.Sa.fps:30;return this.eA.duration&&this.eA.currentTime-1/e>=0?this.eA.currentTime-1/e:-1},a.jA=function(){if(this.eA)for(var e in this.aA)this.eA.addEventListener(e,this.aA[e])},a.MA=function(){if(this.eA)for(var e in this.aA)this.eA.removeEventListener(e,this.aA[e])},a.cA=function(){this.Ci.i(zt,"loadedmetadata"),this.emit(D.a.LOADEDMETADATA)},a.fA=function(){this.Ci.i(zt,"loadeddata"),this.emit(D.a.LOADEDDATA)},a.AA=function(){this.Ci.i(zt,"canplay "+!!this.Io),this.emit(D.a.CANPLAY)},a.vA=function(){this.Ci.i(zt,"seeking "+this.eA.currentTime),this.emit(D.a.SEEKING)},a.dA=function(){this.Ci.i(zt,"seeked"),this.emit(D.a.SEEKED)},a.lA=function(){this.Ci.i(zt,"video waiting")},a.bA=function(){this.Ci.i(zt,"playing"),this.nA||(this.Io=bt.NONE,this.TA(),this.emit(D.a.PLAYING))},a.pA=function(){this.Ci.i(zt,"pause. seeking: "+this.eA.seeking),this.eA.ended||this.emit(D.a.PAUSE)},a.mA=function(){this.Ci.i(zt,"play",this.nA),this.emit(D.a.PLAY),X.a.safari&&this.eA.currentTime>=this.eA.duration&&this.eA.loop&&(this.Ci.i(zt,"safari loop fix. seek 0. loop: "+this.eA.loop+" "+this.eA.currentTime+"/"+this.eA.duration+"."),this.eA.currentTime=0)},a.gA=function(e){this.Ci.i(zt,"error",e)},a.yA=function(){this.Ci.i(zt,"ended"),this.uA=!1,this.emit(D.a.ENDED),this.kA()},a._A=function(){this.Ci.i(zt,"ratechange "+this.eA.playbackRate),this.emit(D.a.RATE_CHANGE)},a.CA=function(){this.Ci.i(zt,"durationchange "+this.eA.duration),this.emit(D.a.DURATION_CHANGE)},a.IA=function(){this.emit(D.a.TIMEUPDATE)},a.OA=function(){this.emit(D.a.PROGRESS)},a.wA=function(){this.Ci.i(zt,"video emptied")},a.EA=function(){this.Ci.i(zt,"video resize")},a.DA=function(){this.emit(D.a.HEARTBEAT)},a.TA=function(){this.sA||(this.sA=setInterval(this.DA.bind(this),Ve.i))},a.kA=function(){this.sA&&(clearInterval(this.sA),this.sA=void 0)},a.RA=function(e){this.uA=!1},a.emit=function(e,t){if(e===D.a.ERROR){var c=t;c.fatal&&(this.nA=c),this.Ci.i(zt,"error",c)}return this.Do.evt.emit(e,t)},a.internalSeek=function(e){this.uA=!0;try{this.eA.currentTime=e}catch(t){this.Ci.i(zt,"internal seek err.",t)}},a.screenshot=function(e){var t=1e3*this.eA.currentTime;if(this.eA instanceof HTMLVideoElement&&this.eA.videoWidth){this.pa||(this.pa=new Br.a(this.Ci),this.O.push(this.pa));var c=this.pa.copyImageData(this.eA,void 0,0,e==null?void 0:e.colorSpace);c&&this.emit(D.a.SCREENSHOT,{pts:t,id:e==null?void 0:e.id,image:c})}else this.emit(D.a.SCREENSHOT,{pts:t,id:e==null?void 0:e.id,errorCode:L.a.SCREENSHOT_CREATE_IMG_ERROR,errorMessage:"no video"})},m()(_,[{key:"type",get:function(){return h.a.unknown}}])}(F.a),ei=function(){function v(a){this.Do=void 0,this.LA=0,this.Do=a,this.Do.logger.i("auto-lazyload",a.stat.autoLazyLoad,a.stat.lazyLoadMaxDuration,a.stat.lazyLoadRecoverDuration)}var _=v.prototype;return _.update=function(){var a=this.Do.lctx.current;!this.Do.stat.isLive&&this.Do.stat.autoLazyLoad&&a&&(a.maxBitrate||a.bitrate||this.Do.loadRec.currentLoad)&&(this.NA(a,8*this.Do.loadRec.smoothedDownloadSpeed/1e3),this.checkStreamingMux())},_.checkStreamingMux=function(){var a,e=this.Do,t=this.Do.stat;if(t.box===h.i.flv&&t.isLive)e.streamingMux=!0;else{var c=e.bufferedSec+(((a=e.mse)==null?void 0:a.getBufferQueueSec())||0),u=this.QA();if(t.lazyLoadRecoverDuration<=u.min+.001){var g=t.multipart?this.xA():this.VA();Number.isFinite(this.LA)&&this.LA>0?e.streamingMux=!(g&&g/this.LA*2<c):e.streamingMux=!(g&&g/2<c)}else e.streamingMux=c<t.lazyLoadRecoverDuration+(t.lazyLoadMaxDuration-t.lazyLoadRecoverDuration)/2}},_.NA=function(a,e){var t=this.Do,c=0;if(a.maxBitrate)c=e/a.maxBitrate;else if(a.bitrate)c=e/(1.5*a.bitrate);else if(t.loadRec.currentLoad){var u=t.loadRec.currentLoad.audioDataRate+t.loadRec.currentLoad.videoDataRate;if(!u)return;c=e/(1.5*u)}c/=Math.max(1,t.playbackRate),this.LA=c;var g=this.QA();c>5?this.UA(Math.max(g.min,t.stat.lazyLoadMaxDuration-2)):c<3&&this.UA(Math.min(g.max,t.stat.lazyLoadMaxDuration+2))},_.UA=function(a){this.Do.stat.lazyLoadMaxDuration=a,this.Do.stat.lazyLoadRecoverDuration=.8*this.Do.stat.lazyLoadMaxDuration},_.QA=function(){var a=16,e=30;if(this.Do.stat.multipart){var t=this.xA();t&&(a=Math.max(16,3*t),e=Math.max(30,5*t))}return{min:a,max:e}},_.VA=function(){var a=this.Do.lctx.current;if(a){var e=8*Ve.e/1e3,t=a.maxBitrate||1.5*a.bitrate||0;if(t)return e/t}return 0},_.xA=function(){var a=this.Do;if(a.stat.multipart){var e=a.lctx.current;if(e)return e.targetduration||e.averagetargetduration||0}return 0},m()(v,[{key:"streamingMuxThreshold",get:function(){var a=this.Do.stat;if(a.box===h.i.flv&&a.isLive)return 0;var e=this.QA();return a.lazyLoadRecoverDuration<=e.min+.001?0:a.lazyLoadRecoverDuration+(a.lazyLoadMaxDuration-a.lazyLoadRecoverDuration)/2}}])}(),ui=function(v){return v.WIDEVINE="com.widevine.alpha",v.PLAYREADY="com.microsoft.playready",v.FAIRPLAY="com.apple.fairplay",v}({}),zr=function(v){return v.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",v}({}),fr=!ge()&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):void 0,ti="eme",Fn=function(){function v(a){var e=this;this.Do=void 0,this.Ci=void 0,this.FA={audioRobustness:"SW_SECURE_CRYPTO",videoRobustness:"SW_SECURE_DECODE"},this.PA=[],this.HA=!1,this.vf=void 0,this.YA=void 0,this.GA=void 0,this.KA="",this.ZA=[],this.WA=function(t){if(e.Ci.i(ti,'Media is encrypted using "'+t.initDataType+'" init data type'),!e.GA&&e.ZA.length&&t.initDataType==="cenc"&&t.initData&&(e.KA=e.KA||e.Do.config.widevineLicenseUrl,e.XA(ui.WIDEVINE,e.ZA)),!e.GA)return e.Ci.i(ti,"Fatal: Media is encrypted but no CDM access or no keys have been requested"),void e.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_KEYS,"media is encrypted but no CDM access or no keys have been requested"));var c=function(u){e.Do.video&&(e.JA(u),e.qA(t.initDataType,t.initData))};e.GA.then(c).catch(c)},this.$A=function(t){var c=t.target;e.tv(t.message,c)},this.Yf=function(t,c){c.fatal&&e.zA(Object(L.e)(L.b.NETWORK_ERROR,L.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,c.errMessage,{statusCode:c.code}))},this.ev=function(){return!!(X.a.chrome&&X.a.version.major>=68||X.a.firefox||X.a.msedge&&X.a.version.major>=88)},this.zA=function(t){e.Do.evt.emit(D.a.ERROR,t)},this.Do=a,this.Ci=a.logger,a.video&&a.video.addEventListener("encrypted",this.WA),this.YA={maxRetry:a.config.keyLoadingMaxRetry,connectionTimeout:a.config.keyConnectionTimeout,transmissionTimeout:a.config.keyTransmissionTimeout,retryDelay:a.config.keyLoadingRetryDelay}}v.nv=function(a,e,t){var c={audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.5"',robustness:t.audioRobustness||""},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:t.audioRobustness||""}],videoCapabilities:[]};return e.forEach(function(u){c.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:t.videoRobustness||""})}),[c]};var _=v.prototype;return _.onManifestParsed=function(a,e){var t=this;if(e===void 0&&(e=!1),this.ZA=a.map(function(u){return u.videoCodec}),e)if(a.reduce(function(u,g){return u&&(g.drmSchemaId===zr.WIDEVINE||!g.drmSchemaId)},!0)&&fr&&this.ev()){this.KA=a.reduce(function(u,g){return u||g.drmToken||""},"");var c=ui.WIDEVINE;this.Ci.i(ti,"on manifest parsed",c,this.ZA),this.XA(ui.WIDEVINE,this.ZA)}else setTimeout(function(){return t.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_UNSUPPORTED,"DRM unsupported."))},0)},_.reset=function(){var a=this;this.Ci.i(ti,"reset"),this.PA.map(function(c){if(c.mediaKeysSession)return c.mediaKeysSession.removeEventListener("message",a.$A),c.mediaKeysSession.close().catch(function(){})}),this.sv(),this.PA=[],this.HA=!1;try{var e,t;if((e=this.Do.video)!=null&&e.mediaKeys)return(t=this.Do.video)==null?void 0:t.setMediaKeys(null).catch(function(c){return a.Ci.i(ti,c)})}catch(c){}},_.destroy=function(){var a=this,e=this.Do.video;e&&e.removeEventListener("encrypted",this.WA);var t=this.PA;t.length&&Promise.all(t.map(function(c){if(c.mediaKeysSession)return c.mediaKeysSession.removeEventListener("message",a.$A),c.mediaKeysSession.close().catch(function(){})})).then(function(){if(e)return e.setMediaKeys(null)}).catch(function(){})},_.JA=function(a){if(this.Ci.i(ti,"attemptSetMediaKeys",!!a),!this.Do.video)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this.HA){var e=this.PA[0];if(!e||!e.mediaKeys)return this.Ci.i(ti,"Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_KEYS,"media is encrypted but no CDM access or no keys have been obtained yet"));this.Ci.i(ti,"Setting keys for encrypted media"),this.Do.video.setMediaKeys(e.mediaKeys),this.HA=!0}},_.qA=function(a,e){var t=this,c=this.PA[0];if(!c)return this.Ci.i(ti,"Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_ACCESS,"media is encrypted but not any key-system access has been obtained yet"));if(c.mediaKeysSessionInitialized)this.Ci.i(ti,"Key-Session already initialized but requested again");else{var u=c.mediaKeysSession;if(!u)return this.Ci.i(ti,"Fatal: Media is encrypted but no key-session existing"),void this.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_SESSION,"media is encrypted but no key-session existing"));if(!e)return this.Ci.i(ti,"Fatal: initData required for generating a key session is null"),void this.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_INIT_DATA,"initData required for generating a key session is null"));this.Ci.i(ti,'Generating key-session request for "'+a+'" init data type'),c.mediaKeysSessionInitialized=!0,u.generateRequest(a,e).then(function(){t.Ci.d(ti,"Key-session generation succeeded")}).catch(function(g){t.Ci.i(ti,"Error generating key-session request:",g),t.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_SESSION,"error generating key-session request:"+g,{fatal:!1}))})}},_.XA=function(a,e){var t=this,c=v.nv(a,e,this.FA);if(this.Ci.i(ti,"Requesting encrypted media key-system access"),fr){var u=fr(a,c);this.GA=u.then(function(g){var R={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:g,mediaKeySystemDomain:a};t.PA.push(R);var Q=Promise.resolve().then(function(){return g.createMediaKeys()}).then(function(se){return R.mediaKeys=se,t.PA.forEach(function(fe){fe.mediaKeysSession||(fe.mediaKeysSession=fe.mediaKeys.createSession()).addEventListener("message",t.$A,!1)}),se});return Q.catch(function(se){t.Ci.i(ti,"Failed to create media-keys:",se)}),Q}),u.catch(function(g){t.Ci.i(ti,'Failed to obtain key-system "'+a+'" access:',g)})}else this.Ci.i(ti,"no requestMediaKeySystemAccess")},_.hv=function(a){switch(a){case ui.WIDEVINE:if(!this.Do.config.widevineLicenseUrl)break;return this.Do.config.widevineLicenseUrl;case ui.PLAYREADY:if(!this.Do.config.playreadyLicenseUrl)break;return this.Do.config.playreadyLicenseUrl;case ui.FAIRPLAY:if(!this.Do.config.fairplayLicenseUrl)break;return this.Do.config.fairplayLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},_.tv=function(a,e){var t=this,c=this.PA[0];if(!c)return this.Ci.i(ti,"Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.zA(Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_NO_ACCESS,"media is encrypted but no key-system access has been obtained yet"));this.sv();var u={onError:this.Yf,onEnd:function(Q,se){t.sv(),se instanceof ArrayBuffer&&e.update(se)}},g=this.vf=new nt(this.Ci),R={requestMethod:"POST",requestBody:a,url:this.KA||this.hv(c.mediaKeySystemDomain),responseType:"arraybuffer"};g.load(R,u,this.YA)},_.sv=function(){this.vf&&this.vf.destroy()},m()(v,[{key:"isActive",get:function(){return!(!this.Do.video||!this.Do.video.mediaKeys)}}])}(),mt="mse",Ti=function(){function v(a,e,t,c){var u=this;this.di=void 0,this.ov=void 0,this.Io=void 0,this.Ai=void 0,this.Ci=void 0,this.video=void 0,this.sourceBuffer=void 0,this.av=void 0,this.uv=void 0,this.cv={video:[],audio:[]},this.fv={video:[],audio:[]},this.fn=void 0,this.An=void 0,this.Da=!1,this.Av=void 0,this.Vn=1/0,this.vv=0,this.dv=!1,this.lv=void 0,this.bv={},this.pv=!1,this.mv=void 0,this.gv=0,this.yv=void 0,this._v={},this.Cv=ht.isChangeTypeSupported(),this.Iv=function(){u.Ci.i(mt,"MediaSource onSourceOpen"),u.av&&(u.av.removeEventListener("sourceopen",u.Iv),u.Ov(),u.refresh())},this.wv=function(){u.Ci.i(mt,"MediaSource onSourceEnded")},this.Ev=function(){u.Ci.i(mt,"MediaSource onSourceClose"),u.Ai.emit(D.a.MSE_SOURCE_CLOSE)},this.jv=function(g){u.yc(g),u.Da&&u.kv(),u.Mv(),u.Io.mseUpdate++,u.Ai.emit(D.a.MSE_UPDATE)},this.Sv=function(g){var R=u.Bv(g.currentTarget);u.Ci.i(mt,R+" SourceBuffer Error: ",g),u.zA(Object(L.e)(L.b.MSE_ERROR,L.a.SOURCEBUFFER_ERROR,R+" source buffer error. "+JSON.stringify(u._v)))},this.Tv=function(){u.Ci.i(mt,"startPlayBufEnd"),u.Dv(),u.gv=0,u.refresh()},this.zA=function(g){u.Ai.emit(D.a.ERROR,g)},t.i(mt,"constructor"),this.di=a,this.ov=e,this.Ci=t,this.Ai=c,this.fn=!1,this.An=!1,this.sourceBuffer={},this.uv={},this.mv={},this.Av=!0,this.Io={mseBufferFull:0,mseRemove:0,mseUpdate:0}}var _=v.prototype;return _.attach=function(a){var e=this;this.Ci.i(mt,"attach",a),this.video=a;var t=Yt();if(t){var c=this.av=new t;this.ov.mms="streaming"in c;var u=URL.createObjectURL(c);this.Ci.i(mt,"attach mms:"+this.ov.mms+" src: "+u),this.video.src=u;try{this.video.load()}catch(g){}a.disableRemotePlayback=!0,this.Rv(c),this.pv=!1}else setTimeout(function(){e.zA(Object(L.e)(L.b.MSE_ERROR,L.a.MEDIASOURCE_ERROR,"MediaSource is not support"))},0)},_.trackInfo=function(a){var e=a.tracks.audio,t=a.tracks.video;e&&e.container&&(this.uv.audio=e.container+'; codecs="'+e.codec+'"'),t&&t.codec&&t.active!==!1&&(this.uv.video=t.container+'; codecs="'+t.codec+'"'),this.An=!(!this.An&&!e),this.fn=!!(this.fn||t&&t.active!==!1),this.Ci.i(mt,"track info. video: "+this.fn+" audio: "+this.An),this.Ov()},_.updateDuration=function(a){this.Ci.i(mt,"update duration: "+a),this.Vn=a,this.Mv()},_.setStartBufSec=function(a){this.Ci.i(mt,"startPlayBufSec: "+a),this.Dv(),this.gv=a,this.yv=setTimeout(this.Tv,1e3*a)},_.Mv=function(){if(typeof this.Vn=="number"&&this.video&&this.av&&this.sourceBuffer&&this.video.readyState!==0&&this.av.readyState==="open"){for(var a=0,e=Object.values(this.sourceBuffer);a<e.length;a++){var t=e[a];if(t&&t.updating)return}var c=this.video.duration;if(this.lv===void 0&&(this.lv=this.av.duration),this.ov.isLive&&this.ov.liveShiftType===h.g.NONE)this.lv=this.av.duration=1/0;else if(this.Vn!==this.lv&&this.Vn!==c||!Number.isFinite(c)){var u=!0;for(var g in this.sourceBuffer)u=u&&!!this.Vn&&this.bufferedEndByType(g)<this.Vn;u&&this.Vn&&(this.lv=this.av.duration=this.Vn),this.Vn=void 0}}},_.Ov=function(){var a=(this.An?1:0)+(this.fn?1:0),e=(this.uv.audio?1:0)+(this.uv.video?1:0);if(this.Ci.v(mt,"checkSourceBuffer",a,e,this.uv),this.av&&this.av.readyState==="open"&&a>0&&e>=a)for(var t in this.uv)this.uv[t]&&(this.Ci.i(mt,"add sb: "+t+" "+this.uv[t]),this.Lv(t))},_.Lv=function(a){var e=this;if(this.Ci.i(mt,"add source buffer: "+a),!this.sourceBuffer[a]&&!this.pv){try{var t=this.uv[a];if(!this.av||!t)throw new Error(a+" add source buffer. no mime codec");this.sourceBuffer[a]=this.av.addSourceBuffer(t),this._v[a]={sn:0,subSn:0,codec:t},this.mv[a]=!1}catch(g){return this.Ci.i(mt,g),void this.zA(Object(L.e)(L.b.MSE_ERROR,L.a.ADDSOURCEBUFFER_ERROR,"type:"+a+" codec:"+this.uv[a]+" msg:"+g.message))}var c=this.sourceBuffer[a];if(c){var u=this.bv[a]={updateend:function(){e.jv(a)},error:function(g){e.Sv(g)}};c.addEventListener("error",u.error),c.addEventListener("updateend",u.updateend),this.Vn&&this.av&&this.Vn!==this.av.duration&&(this.av.duration=this.Vn)}}},_.Nv=function(){return!(!this.fv||!(this.fv.video&&this.fv.video.length||this.fv.audio&&this.fv.audio.length))},_.refresh=function(){for(var a in this.sourceBuffer)this.yc(a)},_.Qv=function(a){if(this.fv[a]&&this.fv[a].length>0){if(!this.Av)return void(this.xv()>209715200&&!this.dv&&(this.dv=!0,this.zA(Object(L.e)(L.b.MSE_ERROR,L.a.APPENDBUFFER_ERROR,"bufferfull"))));var e=this.sourceBuffer[a];if(e&&!e.updating&&!this.dv){var t=this.fv[a].shift();this.Vv(t)}}},_.mediaSegment=function(a){var e=this;a.forEach(function(t){var c=t.type;t.codec=e.uv[t.type],e.fv[c]&&e.fv[c].push(t),e.sourceBuffer[c]&&(e.pv=!0,e.yc(c))})},_.bufferedByType=function(a){var e=this.sourceBuffer[a];return e&&e.buffered&&e.buffered.length>0?{start:e.buffered.start(0),end:e.buffered.end(e.buffered.length-1)}:{start:0,end:0}},_.bufferedEndByType=function(a){var e=this.sourceBuffer[a];return e&&e.buffered&&e.buffered.length>0?e.buffered.end(e.buffered.length-1):0},_.bufferSliceNumByType=function(a){var e=this.sourceBuffer[a];return e?e.buffered.length:0},_.pendingSecByType=function(a){var e=this.fv[a];return e?e.reduce(function(t,c){return t+c.endDTS-c.startDTS},0):0},_.pendingNum=function(){for(var a=0,e=0,t=Object.values(this.fv);e<t.length;e++)a+=t[e].length;return a},_.Uv=function(a){var e=this.video;if(e&&!e.seeking){var t=e.currentTime,c=this.sourceBuffer[a];if(c){var u=this.cv[a],g=c.buffered;if(g.length>=1&&t-g.start(0)>=10){var R=t-5;if(u&&u.length&&u[u.length-1].start===0&&u[u.length-1].end===R)return;u.push({start:0,end:R})}}}},_.Fv=function(a,e){try{for(var t=0;t<a.buffered.length;t++){var c=a.buffered.start(t),u=a.buffered.end(t),g=Math.max(c,e.start),R=Math.min(u,e.end);if(R>g)return this.Ci.i(mt,"remove: "+g+" ~ "+R),a.remove(g,R),this.Io.mseRemove++,!(e.end>u&&t<a.buffered.length-1)||(e.start=Math.max(e.start,R),!1);if(!(e.end>R))break;e.start=Math.max(e.start,R)}return!0}catch(Q){return!(a&&a.updating)}},_.Vv=function(a){if(a&&this.sourceBuffer[a.type]&&this.video&&!this.video.error){var e=this._v[a.type],t=this.sourceBuffer[a.type];if(a.codec&&e&&a.codec!==e.codec&&(this.Ci.i(mt,a.type+" codecType change: "+a.codec),t&&this.Cv)){this.Ci.i(mt,a.type+" changeType: "+a.codec);try{t.changeType(a.codec),e.subSn=0}catch(c){return void this.zA(Object(L.e)(L.b.MSE_ERROR,L.a.CHANGETYPE_ERROR,"type:"+a.type+" codec:"+a.codec+" code:"+c.code+" msg:"+c.message))}}e&&(e.codec=a.codec,e.start=a.startDTS,e.end=a.endDTS,e.sn++,e.subSn++);try{t&&(a.updateTimestampOffset&&!t.buffered.length&&(t.timestampOffset=a.startPTS),t.appendBuffer(a.payload.buffer),this.mv[a.type]=!0)}catch(c){this.Ci.i(mt,a.type,c.code,c.message),c.code!==22?(this.vv?this.vv++:this.vv=1,this.vv>this.di.appendErrorMaxRetry?(this.dv=!0,this.zA(Object(L.e)(L.b.MSE_ERROR,L.a.APPENDBUFFER_ERROR,"code:"+c.code+" type:"+a.type+" msg:"+c.message))):this.fv[a.type].unshift(a)):(this.fv[a.type].unshift(a),this.Uv(a.type),this.hasCleanUpTask(a.type)&&this.Pv(a.type),this.Ci.i(mt,"mse bufferfull"),this.Io.mseBufferFull++,this.Ai.emit(D.a.MSE_BUFFER_FULL))}}},_.Bv=function(a){for(var e in this.sourceBuffer)if(this.sourceBuffer[e]===a)return e;return"unknown"},_.clean=function(a,e,t){this.Ci.i(mt,"clean. st: "+a+" ed: "+e+" type: "+t);var c=0,u=Number.POSITIVE_INFINITY;for(var g in this.mv={},this.Da=!1,this.sourceBuffer)if(this.mv[g]=!1,(!t||t===g)&&this.sourceBuffer[g]){var R=this.fv[g];if(a&&R){c=Math.max(c,a);for(var Q=R.length-1;Q>=0;Q--){var se=R[Q];if(se&&se.startPTS&&!(se.startPTS>=a))break;R.pop()}}else this.fv[g]=[];e&&(u=Math.min(u,e)),this.cv[g].push({start:c,end:u}),this.Pv(g)}this.Av=!0},_.setAppendEnabled=function(a){!this.Av&&a?(this.Av=a,this.refresh()):this.Av=a},_.getAppendEnabled=function(){return this.Av},_.endOfData=function(){if(this.Ci.i(mt,"data end."),this.Da=!0,!this.Nv()&&this.video&&this.video.buffered.length){if(X.a.firefox&&!this.ov.isLive&&this.Vn===void 0)return this.Vn=this.video.buffered.end(this.video.buffered.length-1),this.Ci.i(mt,"data end. firefox no duration",this.Vn,this.ov.isLive),this.Mv(),void this.kv();(this.ov.isLive||!this.ov.isLive&&this.Vn!==void 0)&&(this.Ci.i(mt,"data end. end of stream"),this.kv())}},_.ended=function(){return this.Da},_.kv=function(){var a=this.av;if(a&&a.readyState==="open"&&!this.Nv()){for(var e=0,t=Object.values(this.sourceBuffer);e<t.length;e++){var c=t[e];if(c&&c.updating)return}try{this.Ci.i(mt,"end of stream"),a.endOfStream()}catch(u){this.Ci.i(mt,u),this.zA(Object(L.e)(L.b.MSE_ERROR,L.a.ENDOFSTREAM_ERROR,"code:"+u.code+" msg:"+u.message))}}},_.destroy=function(){if(this.Ci.i(mt,"destroy"),this.av){var a=this.av;if(this.kv(),a.readyState!=="closed"){for(var e in this.sourceBuffer){var t=this.sourceBuffer[e],c=this.bv[e];t&&c&&(t.removeEventListener("error",c.error),t.removeEventListener("updateend",c.updateend),a.removeSourceBuffer(t))}this.sourceBuffer={}}this.Hv(a),this.av=void 0}this.Dv(),this.fv={video:[],audio:[]},this.uv={},this.mv={},this.cv={video:[],audio:[]},this.sourceBuffer={},this.bv={}},_.hasCleanUpTask=function(a){var e=0;if(a===void 0)for(var t=0,c=Object.values(this.cv);t<c.length;t++)e+=c[t].length;else this.cv[a]&&(e=this.cv[a].length);return e>0},_.hasSourceBuffer=function(){return!!Object.keys(this.sourceBuffer).length},_.hasTrackInfo=function(){return!!Object.keys(this.uv).length},_.hasSourceBufferAppendStarted=function(){if(Object.keys(this.mv).length){for(var a=!0,e=0,t=Object.values(this.mv);e<t.length;e++){var c=t[e];a=a&&c}return a}return!1},_.xv=function(){var a=0;for(var e in this.fv)a+=this.fv[e].reduce(function(t,c){return c.payload&&c.payload.byteLength?t+c.payload.byteLength:t},0);return a},_.getBufferQueueSec=function(a){var e=this;return this.fv?(a?[a]:Object.keys(this.fv)).reduce(function(t,c){return e.fv[c]&&e.fv[c].length>0&&(Object.keys(e.sourceBuffer).length===0||e.sourceBuffer[c])?Math.max(t,e.fv[c].reduce(function(u,g){var R=g.endDTS-g.startDTS;return R?u+R:u},0)):t},0):0},_.yc=function(a){if(this.hasCleanUpTask(a)&&this.Pv(a),this.gv>0){if(!this.hasTrackInfo())return;for(var e in this.sourceBuffer)if(this.pendingSecByType(e)<this.gv)return;this.Tv()}this.Qv(a)},_.Pv=function(a){for(var e=this.cv[a];e&&e.length;){var t=e[0],c=this.sourceBuffer[a];if(c&&t){if(c.updating||!this.Fv(c,t))return;e.shift()}else e.shift()}this.refresh()},_.Dv=function(){this.yv&&(clearTimeout(this.yv),this.yv=void 0)},_.Rv=function(a){a.addEventListener("sourceopen",this.Iv),a.addEventListener("sourceended",this.wv),a.addEventListener("sourceclose",this.Ev)},_.Hv=function(a){a.removeEventListener("sourceopen",this.Iv),a.removeEventListener("sourceended",this.wv),a.removeEventListener("sourceclose",this.Ev)},m()(v,[{key:"stat",get:function(){return this.Io}},{key:"readyState",get:function(){return this.av?this.av.readyState:"closed"}},{key:"trackBufInfo",get:function(){var a={};try{for(var e in this.sourceBuffer)for(var t=this.sourceBuffer[e].buffered,c=a[e]=[],u=0;u<t.length;u++)c.push({st:t.start(u),ed:t.end(u)})}catch(g){}return a}}])}(),rr=function(){function v(a){this.Do=void 0,this.Ci=void 0,this.di=void 0,this.Yv=5e3,this.Gv=!1,this.Kv=0,this.Do=a,this.Ci=a.logger,this.di=a.stat.autoPlaybackRateConf}var _=v.prototype;return _.tick=function(){if(this.Gv&&this.Do.video&&!this.Do.video.paused){if(this.Yv>0){var a=performance.now();return this.Yv-=a-this.Kv,void(this.Kv=a)}this.Zv(this.Do.bufferedSec,this.Do.video)}},_.Zv=function(a,e){if(this.di){var t=1,c=this.di.rule,u=0;for(u=0;u<c.length&&!(e.playbackRate>=c[u].rate);u++);u>=c.length&&(u=c.length-1);var g=c[u];if(g){var R=u<c.length-1?c[u+1]:void 0,Q=u>0?c[u-1]:void 0;t=g.rate,Q&&a>Q.lower&&(t=Q.rate),R&&a<R.upper&&(t=R.rate),e.playbackRate!==t&&(this.Ci.i("playback-rate-manager","auto change playback rate from "+e.playbackRate+" to "+t),e.playbackRate=t)}}},m()(v,[{key:"enabled",get:function(){return this.Gv},set:function(a){if(a!==this.Gv)if(a){if(!this.di||!this.Do.config.autoPlaybackRate)return;this.Gv=!0,this.Kv=performance.now(),this.Yv=this.di.startDelay?1e3*this.di.startDelay:this.Yv,this.Do.isLiveShift&&this.Do.stat.liveShiftActive&&this.Do.video&&(this.Do.video.playbackRate=1)}else this.Gv&&this.Do.video&&(this.Do.video.playbackRate=1),this.Gv=!1}}])}(),pi=n(30),oi=function(){function v(){}return v.prototype.decode=function(_,a){if(!_)return"";if(typeof _!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(_))},v}(),Xt=function(){function v(){this.values=Object.create(null)}var _=v.prototype;return _.set=function(a,e){this.get(a)||e===""||(this.values[a]=e)},_.get=function(a,e,t){return t?this.has(a)?this.values[a]:e[t]:this.has(a)?this.values[a]:e},_.has=function(a){return a in this.values},_.alt=function(a,e,t){for(var c=0;c<t.length;++c)if(e===t[c]){this.set(a,e);break}},_.integer=function(a,e){/^-?\d+$/.test(e)&&this.set(a,parseInt(e,10))},_.percent=function(a,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var t=parseFloat(e);if(t>=0&&t<=100)return this.set(a,t),!0}return!1},v}();function pr(v,_,a,e){var t=e?v.split(e):[v];for(var c in t)if(typeof t[c]=="string"){var u=t[c].split(a);u.length===2&&_(u[0],u[1])}}var jn=typeof VTTCue>"u"?void 0:new VTTCue(0,0,""),Ki=(jn==null?void 0:jn.align)==="middle"?"middle":"center";function Ms(v,_,a){var e=v;function t(){var u=function(g){function R(se,fe,xe,Fe){return 3600*(se?parseInt(se):0)+60*(fe?parseInt(fe):0)+(xe?parseInt(xe):0)+(Fe?parseFloat(Fe):0)}var Q=g.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return Q?parseFloat(Q[2])>59?R(Q[2],Q[3],"0",Q[4]):R(Q[1],Q[2],Q[3],Q[4]):null}(v);if(u===null)throw new Error("Malformed timestamp: "+e);return v=v.replace(/^[^\sa-zA-Z-]+/,""),u}function c(){v=v.replace(/^\s+/,"")}if(c(),_.startTime=t(),c(),v.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+e);v=v.substr(3),c(),_.endTime=t(),c(),function(u,g){var R=new Xt;pr(u,function(fe,xe){var Fe;switch(fe){case"region":for(var Ne=a.length-1;Ne>=0;Ne--)if(a[Ne].id===xe){R.set(fe,a[Ne].region);break}break;case"vertical":R.alt(fe,xe,["rl","lr"]);break;case"line":Fe=xe.split(","),R.integer(fe,Fe[0]),R.percent(fe,Fe[0])&&R.set("snapToLines",!1),R.alt(fe,Fe[0],["auto"]),Fe.length===2&&R.alt("lineAlign",Fe[1],["start",Ki,"end"]);break;case"position":Fe=xe.split(","),R.percent(fe,Fe[0]),Fe.length===2&&R.alt("positionAlign",Fe[1],["start",Ki,"end","line-left","line-right","auto"]);break;case"size":R.percent(fe,xe);break;case"align":R.alt(fe,xe,["start",Ki,"end","left","right"])}},/:/,/\s/),g.region=R.get("region",null),g.vertical=R.get("vertical","");var Q=R.get("line","auto");Q==="auto"&&(jn==null?void 0:jn.line)===-1&&(Q=-1),g.line=Q,g.lineAlign=R.get("lineAlign","start"),g.snapToLines=R.get("snapToLines",!0),g.size=R.get("size",100),g.align=R.get("align",Ki);var se=R.get("position","auto");se==="auto"&&(jn==null?void 0:jn.position)===50&&(se=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=se}(v,_)}var Ps=function(){function v(){this.state="INITIAL",this.buffer="",this.decoder=new oi,this.regionList=[],this.cue=null,this.style="",this.oncue=void 0,this.onstyle=void 0,this.onparsingerror=void 0,this.onflush=void 0}var _=v.prototype;return _.parse=function(a){var e=this;a&&(this.buffer+=this.decoder.decode(a,{stream:!0}));var t=function(){var Q=e.buffer,se=0;for(Q=Q.replace(/<br(?: \/)?>/gi,`
`);se<Q.length&&Q[se]!=="\r"&&Q[se]!==`
`;)++se;var fe=Q.substr(0,se);return Q[se]==="\r"&&++se,Q[se]===`
`&&++se,e.buffer=Q.substr(se),fe};try{var c="";if(this.state==="INITIAL"){if(!/\r\n|\n/.test(this.buffer))return this;var u=(c=t()).match(/^()?WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new Error("Malformed WebVTT signature.");this.state="HEADER"}for(var g=!1;this.buffer;){if(!/\r\n|\n/.test(this.buffer))return this;switch(g?g=!1:c=t(),this.state){case"HEADER":/:/.test(c)?pr(c,function(Q,se){},/:/):c||(this.state="ID");continue;case"NOTE":c||(this.state="ID");continue;case"STYLE":c?this.style+=c:(this.style&&(this.onstyle&&this.onstyle(this.style),this.style=""),this.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(c)){this.state="NOTE";break}if(/^STYLE($|[ \t])/.test(c)){this.state="STYLE";break}if(!c)continue;if(this.cue=new VTTCue(0,0,""),this.state="CUE",c.indexOf("-->")===-1){this.cue.id=c;continue}case"CUE":if(!this.cue){this.state="BADCUE";continue}try{Ms(c,this.cue,this.regionList)}catch(Q){this.cue=null,this.state="BADCUE";continue}this.state="CUETEXT";continue;case"CUETEXT":var R=c.indexOf("-->")!==-1;if(!c||R&&(g=!0)){this.oncue&&this.cue&&this.oncue(this.cue),this.cue=null,this.state="ID";continue}if(this.cue===null)continue;this.cue.text&&(this.cue.text+=`
`),this.cue.text+=c;continue;case"BADCUE":c||(this.state="ID")}}}catch(Q){this.state==="CUETEXT"&&this.cue&&this.oncue&&this.oncue(this.cue),this.cue=null,this.state=this.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},_.flush=function(){try{if((this.cue||this.state==="HEADER")&&(this.buffer+=`
`,this.parse()),this.state==="INITIAL"||this.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){this.onparsingerror&&this.onparsingerror(a)}return this.onflush&&this.onflush(),this},v}(),ja=n(41),Xo=n(20),Zo=/\r\n|\n\r|\n|\r/g,Wi=function(v,_,a){return a===void 0&&(a=0),v.substr(a,_.length)===_},ea=function(v){for(var _=5381,a=v.length;a;)_=33*_^v.charCodeAt(--a);return(_>>>0).toString()};function Us(v,_,a,e,t,c,u,g){var R,Q=new Ps,se=Object(ja.a)(new Uint8Array(v)).trim().replace(Zo,`
`).split(`
`),fe=[],xe=Object(Xo.b)(_,a),Fe="",Ne="00:00.000",He=0,rt=0,$e=!0,vt=!1;Q.onstyle=function(dt){Fe+=dt},Q.oncue=function(dt){var Dt=e[t],Ei=e.ccOffset,Kt=(He-xe)/Ve.q;if(Dt!=null&&Dt.new&&(rt!==void 0?Ei=e.ccOffset=Dt.start:function(mi,Gn,zn){var di=mi[Gn],ar=mi[di.prevCC];if(!ar||!ar.new&&di.new)return mi.ccOffset=mi.presentationOffset=di.start,void(di.new=!1);for(;(kt=ar)!=null&&kt.new;){var kt;mi.ccOffset+=di.start-ar.start,di.new=!1,ar=mi[(di=ar).prevCC]}mi.presentationOffset=zn}(e,t,Kt)),Kt&&(Ei=Kt-e.presentationOffset),vt){var Bi=dt.endTime-dt.startTime,ki=Object(pi.a)((dt.startTime+Ei-rt)*Ve.q,c*Ve.q)/Ve.q;dt.startTime=ki,dt.endTime=ki+Bi}var ni=dt.text.trim();dt.text=decodeURIComponent(encodeURIComponent(ni)),dt.id||(dt.id=function(mi,Gn,zn){return ea(mi.toString())+ea(Gn.toString())+ea(zn)}(dt.startTime,dt.endTime,ni)),dt.endTime>0&&fe.push(dt)},Q.onparsingerror=function(dt){R=dt},Q.onflush=function(){R?g(R):u(fe,Fe)},se.forEach(function(dt){if($e){if(Wi(dt,"X-TIMESTAMP-MAP=")){$e=!1,vt=!0,dt.substr(16).split(",").forEach(function(Dt){Wi(Dt,"LOCAL:")?Ne=Dt.substr(6):Wi(Dt,"MPEGTS:")&&(He=parseInt(Dt.substr(7)))});try{rt=function(Dt){var Ei=parseInt(Dt.substr(-3)),Kt=parseInt(Dt.substr(-6,2)),Bi=parseInt(Dt.substr(-9,2)),ki=Dt.length>9?parseInt(Dt.substr(0,Dt.indexOf(":"))):0;if(!(Number.isFinite(Ei)&&Number.isFinite(Kt)&&Number.isFinite(Bi)&&Number.isFinite(ki)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+Dt);return Ei+=1e3*Kt,Ei+=6e4*Bi,Ei+36e5*ki}(Ne)/1e3}catch(Dt){vt=!1,R=Dt}return}dt===""&&($e=!1)}Q.parse(dt+`
`)}),Q.flush()}var Ha="subtitle",V=function(){function v(a){var e=this;this.Do=void 0,this.Ci=void 0,this.Wv=-1,this._=[],this.Xv=0,this.zv=void 0,this.Jv=void 0,this.qv=function(){var t=e._.reduce(function(c,u,g){return u.track.mode==="showing"?g:c},-1);t!==e.Wv&&(e.Wv=t,e.Ci.i(Ha,"subtitle switching"),e.Do.evt.emit(D.a.SUBTITLE_TRACK_SWITCHED,{level:t}))},this.Do=a,this.Ci=a.logger,this.zv={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.Do.video&&this.Do.video.textTracks.addEventListener("change",this.qv)}var _=v.prototype;return _.addTracks=function(a){var e=this;a.forEach(function(t,c){var u=e.$v();u&&e.Do.video&&(t.default?(e.Wv=c,u.mode="showing"):u.mode="hidden")})},_.select=function(a){if(this.td(),a!==this.Wv){var e=this._[a],t=this._[this.Wv];t&&(t.track.mode="hidden"),e?(this.nd(e.style),e.track.mode="showing",this.Wv=a):this.Wv=-1,this.Do.evt.emit(D.a.SUBTITLE_TRACK_SWITCHED,{level:this.Wv})}},_.reset=function(){this.Ci.i(Ha,"reset"),this._.forEach(function(a){(function(e){var t=e.mode;if(t==="disabled"&&(e.mode="hidden"),e.cues){for(var c=e.cues.length;c--;)e.removeCue(e.cues[c]);t==="disabled"&&(e.mode=t)}})(a.track),a.track.mode="hidden"}),this.Xv=0,this.Wv=-1,this.zv={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.td()},_.parseVTTs=function(a,e,t){var c=this,u=this._[this.Wv];u&&Us(a,t,e,this.zv,t,e,function(g,R){g.forEach(function(Q){(function(se,fe){var xe=se.mode;if(xe==="disabled"&&(se.mode="hidden"),se.cues&&!se.cues.getCueById(fe.id))try{if(se.addCue(fe),!se.cues.getCueById(fe.id))throw new Error("addCue is failed for: "+fe)}catch(Ne){var Fe=new self.TextTrackCue(fe.startTime,fe.endTime,fe.text);Fe.id=fe.id,se.addCue(Fe)}xe==="disabled"&&(se.mode=xe)})(u.track,Q)}),R&&(u.style+=R,c.nd(u.style))},function(g){c.Ci.i(Ha,g)})},_.destroy=function(){this.Do.video&&this.Do.video.textTracks.removeEventListener("change",this.qv),this.reset(),this._=[]},_.$v=function(){var a;if(this.Xv<this._.length)a=this._[this.Xv].track,this.Xv++;else{var e=this.Do.video;e&&(a=e.addTextTrack("subtitles"),this._.push({track:a,style:""}),this.Xv++)}return a},_.nd=function(a){a&&(this.Jv||(this.Jv=document.createElement("style"),document.head.appendChild(this.Jv)),this.Jv.innerHTML=a)},_.td=function(){this.Jv&&(this.Jv.innerHTML="",document.head.removeChild(this.Jv),this.Jv=void 0)},v}(),y=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){if(this.getAvailable()&&this.Do.stat.multipart&&this.Do.stat.coreType===h.a.mse&&a.type===L.b.NETWORK_ERROR&&a.details!==L.a.DEC_LIB_LOAD_ERROR&&a.details!==L.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED)return this.Ci.i("fallback-multipart","run"),this.Pc({type:h.k.BACKUP,message:"error. multipart use backup url.",fallback:le.USE_BACKUP_MULTIPART})},_}(ue),f="LevelHelper";function l(v,_,a,e){var t=_[a],c=_[e];if(t&&c){var u=c.startPTS;Number.isFinite(u)?e>a?(t.duration=u-t.start,t.duration<0&&v.w(f,"negative duration computed for frag "+t.sn+",level "+t.level+", duration "+t.duration+", there should be some duration drift between playlist and fragment!. from")):(c.duration=t.start-u,c.duration<0&&v.w(f,"negative duration computed for frag "+c.sn+",level "+c.level+", duration "+c.duration+", there should be some duration drift between playlist and fragment!. to")):c.start=e>a?t.start+t.duration:Math.max(t.start-c.duration,0)}}function p(v,_,a,e,t,c,u){var g=e;if(Number.isFinite(a.startPTS)){var R=Math.abs(a.startPTS-e);Number.isFinite(a.deltaPTS)?a.deltaPTS=Math.max(R,a.deltaPTS):a.deltaPTS=R,g=Math.max(e,a.startPTS),e=Math.min(e,a.startPTS),t=Math.max(t,a.endPTS),c=Math.min(c,a.startDTS),u=Math.max(u,a.endDTS)}var Q=e-a.start;a.start=a.startPTS=e,a.maxStartPTS=g,a.endPTS=t,a.startDTS=c,a.endDTS=u;var se=a.duration;a.duration=t-e,v.i(f,"update frag duration: "+se+" -> "+a.duration);var fe,xe=a.sn;if(!_||typeof xe!="number"||xe<_.startSN||xe>_.endSN)return 0;var Fe=xe-_.startSN,Ne=_.fragments;for(Ne[Fe]=a,fe=Fe;fe>0;fe--)l(v,Ne,fe,fe-1);for(fe=Fe;fe<Ne.length-1;fe++)l(v,Ne,fe,fe+1);return _.ptsKnown=!0,Q}function E(v,_,a){for(var e=a;e<_.fragments.length-1;e++)l(v,_.fragments,e,e+1)}function x(v,_,a,e){e===void 0&&(e=h.g.NONE);var t=e!==h.g.NONE,c=_.fragments.length-1;a.partOfData||function(u,g,R){R.initSegment&&g.initSegment&&(R.initSegment=g.initSegment);var Q,se=0;if(H(g,R,function(Fe,Ne){se=Fe.cc-Ne.cc,Number.isFinite(Fe.startPTS)&&(Ne.start=Ne.startPTS=Fe.startPTS,Ne.endPTS=Fe.endPTS,Ne.duration=Fe.duration,Ne.dropped=Fe.dropped,Q=Ne),R.ptsKnown=!0}),!!R.ptsKnown){if(se){u.v(f,"discontinuity sliding from playlist, take drift into account");for(var fe=R.fragments,xe=0;xe<fe.length;xe++)fe[xe].cc+=se}Q?p(u,R,Q,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS):function(Fe,Ne){var He=Ne.startSN-Fe.startSN,rt=Fe.fragments,$e=Ne.fragments;if(!(He<0||He>rt.length))for(var vt=0;vt<$e.length;vt++)$e[vt].start+=rt[He].start}(g,R),R.ptsKnown=g.ptsKnown}}(v,_,a),_.mergeFrom(a,t),e===h.g.KWAI2&&c>0&&E(v,_,c)}function H(v,_,a){if(v&&_)for(var e=Math.max(v.startSN,_.startSN)-_.startSN,t=Math.min(v.endSN,_.endSN)-_.startSN,c=_.startSN-v.startSN,u=e;u<=t;u++){var g=v.fragments[c+u],R=_.fragments[u];if(!g||!R)break;a(g,R,u)}}function O(v,_,a){var e=1e3*(_.averagetargetduration?_.averagetargetduration:_.targetduration),t=e/2;return v&&_.endSN===v.endSN&&(e=t),a&&(e=Math.max(t,e-(performance.now()-a))),Math.round(e)}function Y(v){return!v.drmSchemaId||v.drmSchemaId===zr.WIDEVINE}var ce="playback-rate";function Ae(v,_,a,e,t){a===void 0&&(a=3),_=Math.round(_),!e||e.startDelay===_||_<=0||(e.startDelay=typeof t=="number"?t:_,e.rule=[{rate:1.5,lower:_+2*a+1,upper:Number.MAX_SAFE_INTEGER},{rate:1.25,lower:_+a+1,upper:_+2*a},{rate:1.1,lower:_+1,upper:_+a},{rate:1,lower:0,upper:_}],v.i(ce,"update auto playbackRate delay: "+_+", step: "+a+" startDelay: "+t,JSON.stringify(e)))}var _e=n(11),me=/\.[^./\\?#]+(?=$|[?#])/i,Ce=/\.slice($|\?)/i,Me={".mp4":h.i.mp4,".m4s":h.i.mp4,".mov":h.i.mp4,".m4a":h.i.mp4,".flv":h.i.flv,".m3u8":h.i.hls,".sdp":h.i.webrtc,".webm":h.i.matroska,".mkv":h.i.matroska,".mka":h.i.matroska,".mp3":h.i.mp3,".wav":h.i.wav,".aac":h.i.aac,".ts":h.i.ts,".yuv":h.i.yuv,".slice":h.i.flv};function Ge(v){var _=v.toLocaleLowerCase().match(me);return _?_[0]:""}function ke(v){var _=Ge(v);return _&&Me[_]||h.i.unknown}function qe(v){return Ce.test(v)}var Xe=/^[^_][A-Za-z0-9_-]*$/,et=/_([A-Za-z0-9]+)_/;function ot(v){var _=new ze.a(v).pathname,a=ke(v),e=a===h.i.flv||be(a)||a===h.i.ts,t="",c="",u=_.split("/"),g=u[u.length-1]||"";if(e){try{var R=_.lastIndexOf("/");R>=0&&(_=_.slice(R+1));var Q=_.split(".")[0].split("_");Q.length===1?(t=wt(Q[0]),c=Rt(v)):Q.length===2?(t=wt(Q[0]),c=wt(Q[1])):Q.length>2&&(t=wt(Q.slice(0,Q.length-1).join("_")),c=wt(Q[Q.length-1]))}catch(se){}return{streamID:t,transcodingTpl:c,filename:g}}return{streamID:"",transcodingTpl:Rt(v),filename:g}}var Ke,Rt=function(v){var _=v.match(et),a="";return _!=null&&_.length&&_.length>1&&(a=_[1]),wt(a)},wt=function(v){return Xe.test(v)?v:""},ut=function(v){return v.FAIL="FAIL",v.ABORT="ABORT",v.SUCCESS="SUCCESS",v.CONNECTED="CONNECTED",v}({}),yt=((Ke={})[_e.c.MANIFEST]=L.a.MANIFEST_LOAD_ERROR,Ke[_e.c.LEVEL]=L.a.LEVEL_LOAD_ERROR,Ke[_e.c.AUDIO_TRACK]=L.a.AUDIO_TRACK_LOAD_ERROR,Ke[_e.c.SUBTITLE_TRACK]=L.a.SUBTITLE_TRACK_LOAD_ERROR,Ke);function pt(v,_,a,e,t){var c=typeof _.url=="string"?_.url:"",u=new ze.a(c).host,g={domain:u,stream_host:u,download_url:c,download_start_time:a.tsload,download_spend_time:a.tload?Math.round(a.tload-a.tstart):Math.round(performance.now()-a.tstart),http_response_time:a.tfirst?Math.round(a.tfirst-a.tstart):0,download_status:v,http_status_code:a.code,retry_index:a.retry,error_code:0,error_message:"",loader_id:a.id,download_size:a.total||a.loaded||0,resource_type:_.type||"",use_reset_native_fetch:_.useResetNativeFetch?1:0};_.redirected&&(g.redirect=1),_.responseUrl&&c!==_.responseUrl&&(g.response_url=_.responseUrl),t&&(g.codec=t),e&&(g.quality_type=e),_.monkeyPatched&&(g.monkey_patched=1);var R=_.frag;if(R&&(g.slice_play_start_time=Math.round(1e3*R.start),R.duration&&(g.slice_play_duration=Math.round(1e3*R.duration)),R.sn&&(g.slice_index=R.sn),R.level&&(g.slice_level_index=R.level)),v===ut.FAIL){var Q=yt[_.type]||L.a.LOAD_ERROR;g.error_code=Object(L.d)(Q,a.errMessage,a.code)}a.errMessage&&(g.error_message=a.errMessage),_.responseHeader&&(g.response_header=N(_.responseHeader)),typeof _.rangeStart=="number"&&(g.range_start=_.rangeStart),_.rangeEnd&&(g.range_end=_.rangeEnd);var se=ot(g.download_url);if(se.transcodingTpl&&(g.transcoding_template=se.transcodingTpl),typeof _.url=="string"){var fe=function(xe){if(performance&&typeof performance.getEntriesByName=="function"){var Fe=performance.getEntriesByName(xe,"resource");if(Fe.length){var Ne=Fe[Fe.length-1],He={};return Ne.redirectStart&&(He.redirect=Math.round(Ne.redirectEnd-Ne.redirectStart)),He.dns=Math.round(Ne.domainLookupEnd-Ne.domainLookupStart),He.tcp=Math.round(Ne.connectEnd-Ne.connectStart),He.request=Math.round(Ne.requestStart-Ne.connectEnd),He.firstResponse=Math.round(Ne.responseStart-Ne.requestStart),Ne.responseStart>0?He.response=Math.round(Ne.responseEnd-Ne.responseStart):He.response=Math.round(Ne.responseEnd-Ne.fetchStart),He.duration=Math.round(Ne.duration)||0,He}}return null}(_.url);fe&&(fe.redirect&&(g.time_redirect=fe.redirect),fe.dns&&(g.time_dns=fe.dns),fe.tcp&&(g.time_tcp=fe.tcp),fe.request&&(g.time_request=fe.request),fe.firstResponse&&(g.time_first_response=fe.firstResponse),fe.response&&(g.time_response=fe.response),fe.duration&&(g.duration=fe.duration))}return g}var St={beacon:!1,predictStep:5,targetBuffer:10,duration:5,smoothRatioToTarget:0,switchpanelty:2.5*1e-6,slidingWindowSize:3,kalmanR:Math.pow(.2,2),kalmanQ:4e-4,initBitrate:2e6,startBitrateLimit:!0,speedPredictRatio:1.5,speedPredictNum:3,algorithm:1,speedPredictRatioOnStart:3,lowProfileThreshold:4,lowProfileBitrate:25e5,lowProfileStartThreshold:5},Qt=function(v){return v[v.Default=0]="Default",v[v.Seek=1]="Seek",v}(Qt||{}),$t="kwai_hls_adaptive",_i="algorithm-hls",qi=function(){function v(a){this.Do=void 0,this.Ci=void 0,this.Fi=void 0,this.sd=0,this.rd=0,this.hd=void 0,this.od=[],this.ad={},this.ud=void 0,this.Ct=0,this.fd=0,this.Ad=Qt.Default,this.vd=0,this.dd=!1,this.ld=0,this.bd=0,this.pd=0,this.md=0,this.ud=new G,this.Fi=s()({},St),this.Do=a,this.Ci=a.logger}var _=v.prototype;return _.init=function(a){var e=s()({},St);this.Fi=s()(e,a),this.md=this.Fi.initBitrate},_.onManifestUpdated=function(){var a=this,e=this.Do.lctx;this.md=this.Fi.initBitrate,this.od=[],e.abrLevels.forEach(function(t){a.od.push(1e3*t.bitrate),t.default&&(a.md=t.bitrate)}),this.Ct=Math.min(e.abrDefault,this.od.length-1),this.Ci.i(_i,"setInfo "+this.od+", "+this.Ct),this.fd=0,this.sd=this.Fi.duration,this.rd=0,this.hd=new Array(this.Fi.slidingWindowSize),this.hd[this.Fi.slidingWindowSize-1]=0,this.Ad=Qt.Default,this.ld=this.gd(this.od,this.Fi.lowProfileBitrate)},_.destroy=function(){},_.bitrateInit=function(){var a=this,e=this.yd(this.od,this.md),t=this.ud.read($t);if(this.Ci.i(_i,"storage read:"+t),t!==void 0&&t.bitrate>=0&&t.speed>0&&t.version===2){t.time&&t.lowProfile&&Date.now()-t.time<2592e5&&(this.bd=Math.min(t.lowProfile,this.Fi.lowProfileStartThreshold+1),this.bd>this.Fi.lowProfileStartThreshold&&(this.dd=!0,e=Math.min(e,this.ld)));var c=Math.min(t.bitrate,1024*t.speed/this.Fi.speedPredictRatioOnStart),u=this.od.reduce(function(g,R,Q){return Math.abs(R-c)<Math.abs(a.od[g]-c)?Q:g},0);e=this.Fi.startBitrateLimit?Math.min(e,u):u}return e},_.onLevelLoad=function(a){a<this.od.length&&a>=0&&(this.Ct=a)},_.onKeyPoint=function(a){if(a.byteLength){var e=a.duration||a.spendTime,t=a.byteLength/e*7.8125;this.ad=s()({cache:!1},a),this.Ci.v(_i,"report download time:"+e+" bytes:"+a.byteLength+" buffered:"+a.buffered+" speed:"+t+" cache:"+this.ad.cache);var c=this._d(t,a.buffered/1e3),u=this.od[c];u&&c!==this.fd&&this.ud.write($t,{version:2,index:c,bitrate:u,speed:this.ad&&this.ad.speed?this.ad.speed:0,lowProfile:Math.max(0,this.dd?this.bd+1:this.bd-1),time:Date.now()}),this.fd=c,this.ad.speed=t,this.ad.buffered=a.buffered,this.ad.nextBitrate=this.od[this.fd],this.ad.currentBitrate=this.od[this.Ct]}},_.onSeek=function(a){this.Ci.v(_i,"report seek buffered:"+a.buffered+" inBuffer:"+a.isInBuffer),a.isInBuffer?this.Cd():this.ad.seek=1,(!a.isInBuffer||a.buffered/1e3<this.Fi.targetBuffer)&&(this.Ci.i(_i,"status change to seek."),this.Ad=Qt.Seek,this.vd=this.Fi.speedPredictNum)},_.onDownloadEnabled=function(a){a||this.Cd()},_.Cd=function(){this.sd=0,this.rd=0,this.hd=new Array(this.Fi.slidingWindowSize)},_._d=function(a,e){this.sd=e,this.hd.shift(),this.hd.push(a),this.Ad===Qt.Seek&&(e>=this.Fi.targetBuffer||this.vd<=0)&&(this.vd=0,this.Ad=Qt.Default,this.Ci.i(_i,"status change to default. buffered:"+e+" step:"+this.vd));var t=-1;return this.Ad===Qt.Seek?(this.vd--,this.rd=this.sd,t=this.Id(a)):t=this.Od(a,e),this.dd&&(t=Math.min(t,this.ld)),t},_.Id=function(a){var e=1024*a,t=this.od[this.Ct];if(t&&(e<t||e>t*this.Fi.speedPredictRatio))for(var c=this.od.length-1;c>=0;c--){var u=this.od[c];if(u&&e>u*this.Fi.speedPredictRatio)return c}return this.Ct},_.Od=function(a,e){var t,c=1024*a,u=this.od,g=u[this.Ct],R=this.Do.playbackRate;for(t=u.length-1;t>0;t--){var Q=u[t];if(Q&&c>Q*R)break}var se=u[t],fe=this.Ct;if(typeof se!="number"||typeof g!="number")return fe;var xe=e/R;return se>g?xe>se*this.Fi.duration/c&&(fe=t):se<g&&xe<g*this.Fi.duration/c+this.Fi.duration&&(fe=t),this.Ci.v(_i,"_nextRateBySpeedAndBuffered bitrateBySpeed:"+se+", nextBitrate:"+fe+", bitrate:"+g+", remainingTime:"+xe+", speed:"+c+", playbackRate:"+R),fe},_.yd=function(a,e){return a.reduce(function(t,c,u){return(a[t]+c)/2>=e?t:u},0)},_.gd=function(a,e){return a.reduce(function(t,c,u){return c>e?t:u},0)},m()(v,[{key:"nextLevel",get:function(){return this.fd}},{key:"lowProfile",get:function(){return this.dd}}])}(),Ji={speedPredictRatioOnStart:6},Di=function(){function v(a){this.Do=void 0,this.wd=void 0,this.Ed=void 0,this.jd=0,this.Ct=0,this.Do=a,this.Ed=0}var _=v.prototype;return _.init=function(){return this.wd=new qi(this.Do),this.wd.init(this.Do.config.hlsAdaptiveConfig||Ji),this.wd.onManifestUpdated(),this.wd.bitrateInit()},_.onAbrLevelsUpdated=function(){var a;(a=this.wd)==null||a.onManifestUpdated()},_.destory=function(){this.wd&&(this.wd=void 0)},_.onDownload=function(a){if(this.wd&&this.Do.isAbrAvailable&&typeof a.slice_play_start_time=="number"&&typeof a.slice_play_duration=="number"&&Number.isFinite(a.slice_play_start_time)&&Number.isFinite(a.slice_play_duration)&&a.download_status===ut.SUCCESS){this.Ed=a.slice_play_start_time+a.slice_play_duration;var e={buffered:this.Ed-1e3*this.Do.currentTime,duration:a.duration||0,spendTime:a.download_spend_time,byteLength:a.download_size};this.wd.onKeyPoint(e)}},_.onNewSource=function(){if(this.wd){var a=this.Do.lctx.currentIdx;this.jd=this.jd||performance.now(),a>=0&&a<this.Do.lctx.levels.length&&(this.Ct=a),this.wd.onLevelLoad(this.Do.lctx.orignIndexToAbr(a))}},_.onSeek=function(a){this.wd&&this.Do.isAbrAvailable&&this.wd.onSeek({isInBuffer:a.isInBuffer,buffered:this.Ed-1e3*this.Do.currentTime})},_.nextBitrateIndex=function(){var a=this.Do.lctx;if(a.abr&&this.wd){var e=a.abrIndexToOrign(this.wd.nextLevel);if(e!==this.Ct&&e>=0&&e<a.levels.length)return e}return this.Ct},_.setDownloadEnabled=function(a){this.wd&&this.wd.onDownloadEnabled(a)},m()(v,[{key:"abrInitLevel",get:function(){var a;return((a=this.wd)==null?void 0:a.bitrateInit())||0}}])}(),rn=function(){function v(a){var e=this;this.Do=void 0,this.kd=function(){e.Do.evt.emit(D.a.MANIFEST_LOADED)},this.Do=a}var _=v.prototype;return _.loadManifest=function(){this.kd()},_.loadLevel=function(){},_.destroy=function(){},v}(),nr=n(29),gn={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function Kr(v){var _={};return(v||"").split(/[ ,]+/).forEach(function(a){a.indexOf("avc1")!==0&&a.indexOf("hev1")!==0&&a.indexOf("av01")!==0&&a.indexOf("kvc")!==0||(_.video=a),a.indexOf("mp4a")===0&&(_.audio=a)}),_}function nn(v,_){var a=[].concat(v.split(/[ ,]+/));["video","audio"].forEach(function(e){var t=a.filter(function(u){return function(g,R){var Q=gn[R];return!!Q&&Q[g.slice(0,4)]===!0}(u,e)});if(t.length){var c=t.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("av01",0)===0||u.lastIndexOf("hev1",0)===0||u.lastIndexOf("hvc1",0)===0||u.lastIndexOf("mp4a",0)===0});_[e+"Codec"]=c.length>0?c[0]:t[0],a=a.filter(function(u){return t.indexOf(u)===-1})}}),_.codec=a.join(",")}function Wr(v){return v.indexOf("avc1")===0?h.c.h264:v.indexOf("hev1")===0||v.indexOf("hvc1")===0?h.c.hevc:v.indexOf("av01")===0?h.c.av1:h.c.unknown}var er=function(){function v(_){this.url=[],this.urlId=0,this.bitrate=0,this.maxBitrate=0,this.qualityType="",this.qualityLabel="",this.id=0,this.codec="",this.audioCodec="",this.videoCodec="",this.hidden=!1,this.enableAdaptive=!0,this.default=!1,this.width=void 0,this.height=void 0,this.index=0,this.drmSchemaId="",this.drmToken="",this.hdr=void 0,this.vCodecType=h.c.unknown,this.meta=void 0,this.fileName=void 0,this.fileSize=void 0,this.dropVideo=[],this.url=[_],this.urlId=0}return v.prototype.getKLevel=function(){return{width:this.width,height:this.height,qualityLabel:this.qualityLabel,qualityType:this.qualityType,bitrate:this.bitrate,maxBitrate:this.maxBitrate}},m()(v,[{key:"currentUrl",get:function(){return this.url[this.urlId]||""}}])}(),xi=function(v){function _(e){var t;return(t=v.call(this,e)||this).startSN=0,t.endSN=0,t.fragments=[],t.initSegment=null,t.live=!0,t.needSidxRanges=!1,t.startTimeOffset=null,t.targetduration=0,t.totalduration=0,t.type=null,t.version=null,t.ptsKnown=!1,t.m3u8Slice=void 0,t.audioGroupIds=void 0,t.attrs=void 0,t.averagetargetduration=void 0,t.name=void 0,t.lang=void 0,t.groupId="",t.instreamId="",t.autoselect=void 0,t.forced=void 0,t.size=0,t.partOfData=!1,t.http416=0,t}T()(_,v);var a=_.prototype;return a.clear=function(){this.fragments=[],this.startSN=0,this.endSN=0,this.initSegment=null,this.m3u8Slice=void 0,this.live=!0,this.needSidxRanges=!1,this.startTimeOffset=0},a.mergeFrom=function(e,t){if(t===void 0&&(t=!1),e.fragments.length){var c=this.endSN;if(this.endSN=e.endSN,e.partOfData||(e.initSegment&&!this.initSegment&&(this.initSegment=e.initSegment),this.live=e.live,this.needSidxRanges=e.needSidxRanges,this.targetduration=e.targetduration,this.ptsKnown=e.ptsKnown,this.averagetargetduration=e.averagetargetduration,this.hasFrag||(this.m3u8Slice=e.m3u8Slice,this.audioGroupIds=e.audioGroupIds,this.attrs=e.attrs,this.name=e.name,this.lang=e.lang,this.groupId=e.groupId,this.instreamId=e.instreamId,this.autoselect=e.autoselect,this.forced=e.forced)),t&&this.fragments.length){for(var u,g=e.fragments.length,R=0;R<e.fragments.length;R++){var Q=e.fragments[R].sn;if(typeof Q=="number"&&Q>c){g=R;break}}if(this.fragments.length&&e.fragments.splice(0,g),e.partOfData){var se=this.fragments[this.fragments.length-1],fe=se.endPTS,xe=se.cc;fe&&e.fragments.forEach(function(Fe){Fe.start=Fe.startPTS=fe,Fe.endPTS=Fe.startPTS+Fe.duration,fe=Fe.endPTS,Fe.cc=xe+Fe.cc})}(u=this.fragments).push.apply(u,e.fragments),this.totalduration=this.fragments.reduce(function(Fe,Ne){return Fe+Ne.duration},0),e.partOfData?this.size+=e.size:this.size=e.size}else this.startSN=e.startSN,this.fragments=e.fragments,this.totalduration=e.totalduration,this.size=e.size}},a.getTimeInfoAfter=function(e){e===void 0&&(e=0);var t,c,u=[],g=[];return this.fragments.forEach(function(R){typeof R.sn=="number"&&(R.sn>=e&&typeof c=="number"&&c!==R.cc&&(t?t.push({sn:R.sn,start:R.start}):t=[{sn:R.sn,start:R.start}]),c=R.cc,R.sn>=e&&(u.push(R.start),typeof R.programDateTime=="number"&&g.push(R.programDateTime)))}),{live:this.live,startSn:this.startSN,endSn:this.endSN,duration:this.totalduration,times:u,utcs:g,discontinuity:t,targetduration:this.targetduration}},m()(_,[{key:"timeInfo",get:function(){return this.getTimeInfoAfter()}},{key:"hasProgramDateTime",get:function(){return!(!this.fragments[0]||typeof this.fragments[0].programDateTime!="number"||!Number.isFinite(this.fragments[0].programDateTime))}},{key:"hasFrag",get:function(){return this.fragments.length>0}}])}(er),_r=function(){function v(){}return v.verify=function(_){return!!(_&&_.adaptationSet&&_.adaptationSet.representation&&_.adaptationSet.representation.length)&&_.adaptationSet.representation.reduce(function(a,e){return!!(e.url&&e.bandwidth&&a)},!0)},v.parse=function(_){var a=[];return v.verify(_)&&_.adaptationSet.representation.forEach(function(e){if(e&&(e.url||e.m3u8)){var t=new xi(e.baseUrl?Object(nr.buildAbsoluteURL)(e.baseUrl,e.url,{alwaysNormalize:!0}):e.url);t.bitrate=Math.floor(e.bandwidth/1e3),t.maxBitrate=Math.floor(e.bandwidth/1e3),t.qualityType=e.qualityType||"",t.qualityLabel=e.qualityLabel||"",e.width&&e.height&&(t.width=e.width,t.height=e.height),nn(e.codecs||"",t),t.audioCodec="",t.m3u8Slice=e.m3u8||e.m3u8Slice,t.totalduration=e.duration,e.backupUrl&&e.backupUrl.length&&(t.url=t.url.concat(e.backupUrl)),t.default=e.defaultSelect||!1,t.urlId=0,a.push(t)}}),{levels:a,def:0}},v}(),mn=function(){return m()(function(v,_){this.Md=null,this.baseuri=void 0,this.reluri=void 0,this.method=null,this.key=null,this.iv=void 0,this.baseuri=v,this.reluri=_},[{key:"uri",get:function(){return!this.Md&&this.reluri&&(this.Md=Object(nr.buildAbsoluteURL)(this.baseuri,this.reluri,{alwaysNormalize:!0})),this.Md}}])}(),bn=function(v){return v.AUDIO="audio",v.VIDEO="video",v}({}),Li=function(){function v(){var a;this.Sd="",this.Bd=null,this.Mh=null,this.Td=((a={})[bn.AUDIO]=!1,a[bn.VIDEO]=!1,a),this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.relurl=void 0,this.baseurl=void 0,this.duration=void 0,this.sn=0,this.levelkey=void 0,this.level=0,this.start=0,this.cc=0,this.maxStartPTS=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.deltaPTS=void 0,this.dropped=0,this.type=void 0,this.loader=void 0,this.title=null,this.urlId=0,this.data=void 0}var _=v.prototype;return _.setByteRange=function(a,e){var t=a.split("@",2),c=[];t.length===1?c[0]=e?e.byteRangeEndOffset:0:c[0]=parseInt(t[1],10),c[1]=parseInt(t[0],10)+c[0],this.Bd=c},_.addElementaryStream=function(a){this.Td[a]=!0},_.hasElementaryStream=function(a){return this.Td[a]===!0},_.createInitializationVector=function(a){for(var e=new Uint8Array(16),t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e},_.setDecryptDataFromLevelKey=function(a,e){var t=a;return a&&a.method&&a.uri&&!a.iv&&((t=new mn(a.baseuri,a.reluri)).method=a.method,t.iv=this.createInitializationVector(e)),t},m()(v,[{key:"url",get:function(){return!this.Sd&&this.relurl&&(this.Sd=Object(nr.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this.Sd},set:function(a){this.Sd=a}},{key:"byteRange",get:function(){return this.Bd?this.Bd:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){if(!this.levelkey&&!this.Mh)return null;if(!this.Mh&&this.levelkey){var a=this.sn;typeof a!="number"&&(a=0),this.Mh=this.setDecryptDataFromLevelKey(this.levelkey,a)}return this.Mh}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Number.isFinite(this.programDateTime))return null;var a=Number.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*a}},{key:"encrypted",get:function(){return!(!this.decryptdata||this.decryptdata.uri===null||this.decryptdata.key!==null)}}])}(),Ga=function(v){return v[v.LongVideo=1]="LongVideo",v[v.ShortVideo=2]="ShortVideo",v[v.LiveGame=3]="LiveGame",v[v.LiveShow=4]="LiveShow",v[v.LivePlayBack=5]="LivePlayBack",v}({}),Bs={1:h.i.hls_ts,2:h.i.mp4,3:h.i.flv,4:h.i.hls_fmp4},ba={avc:h.c.h264,hevc:h.c.hevc,av1:h.c.av1,kvc3:h.c.kvc3,kvc4:h.c.kvc4,kvc5:h.c.kvc5,kvc6:h.c.kvc6,kvc30:h.c.kvc30};function ta(v){var _=h.i.unknown;if(v&&v.length<2048)for(var a=v.split(`
`),e=0;e<a.length;e++){var t=a[e].trim();t&&t.indexOf("#")!==0&&(_=ke(t))}return _===h.i.ts?h.i.hls_ts:_===h.i.mp4?h.i.hls_fmp4:h.i.unknown}var Sn=function(){function v(){}return v.verify=function(_){return!!(_&&_.adaptationSet&&_.adaptationSet.length)&&_.adaptationSet.reduce(function(a,e){return!!(a&&e.representation&&e.representation.length)},!0)},v.parse=function(_,a){a===void 0&&(a=!1);var e,t,c,u,g,R,Q,se,fe,xe=[],Fe=!1,Ne=0,He=[],rt={};if(v.verify(_)){var $e=_;R=Bs[$e.mediaType],Q=$e.stereoType===1?h.n.V360:h.n.Normal,$e.businessType!==void 0&&(se=$e.businessType>=3&&$e.businessType<=5),$e.businessType===Ga.LivePlayBack&&(fe=!0),$e.version&&(rt.version=$e.version),$e.videoId&&(rt.videoId=$e.videoId),$e.videoBaseFeature&&(rt.videoBaseFeature=$e.videoBaseFeature),$e.videoAestheticFeature&&(rt.videoAestheticFeature=$e.videoAestheticFeature),$e.videoFeature&&(rt.videoFeature=$e.videoFeature),typeof $e.programStartTime=="number"&&(rt.programStartTime=$e.programStartTime),$e.adaptationSet.forEach(function(ni){var mi=ni.duration/1e3;se===void 0&&mi&&(se=!1),!Ne&&mi&&(Ne=mi);var Gn=ni.drmSchemaId,zn=ni.drmToken;ni.drmSchemaId&&(Fe=!0);var di=h.f.MAIN;if(ni.mimeType&&(ni.mimeType.indexOf("video")!==-1?rt.videoMimeType=ni.mimeType:ni.mimeType.indexOf("audio")!==-1?(rt.audioMimeType=ni.mimeType,di=h.f.AUDIO):ni.mimeType==="text/vtt"?(rt.subtitleMimeType=ni.mimeType,di=h.f.SUBTITLE):di=void 0),di){di===h.f.MAIN?rt.videoDuration=ni.duration:di===h.f.AUDIO&&(rt.audioDuration=ni.duration);var ar=ni.representation.map(function(kt,Rn){var Mt;if(!R&&kt.m3u8Slice&&(R=ta(kt.m3u8Slice)),R||(R=ke(kt.url)),be(R)?((Mt=new xi(kt.url)).lang=ni.language||"",Mt.default=!!kt.defaultSelect,Mt.id=kt.id||Rn,Mt.m3u8Slice=kt.m3u8Slice,Mt.totalduration=mi||Ne):Mt=new er(kt.url),typeof kt.fileSize=="number"&&(Mt.fileSize=kt.fileSize),Mt.vCodecType=h.c.unknown,Mt.hdr=kt.hdrType||0,Mt.maxBitrate=kt.maxBitrate||0,Mt.bitrate=kt.avgBitrate||Mt.maxBitrate,Mt.qualityType=kt.qualityType||"",Mt.qualityLabel=kt.qualityLabel||"",Mt.codec=kt.codecs||"",Mt.codec){var Za=Kr(Mt.codec);Mt.videoCodec=Za.video||"",Mt.vCodecType=Wr(Mt.videoCodec)}return kt.videoCodec&&ba[kt.videoCodec]&&(Mt.vCodecType=ba[kt.videoCodec]||h.c.unknown),He.push(Mt.vCodecType),$e.adaptationSet.length===1&&(Mt.audioCodec=""),kt.width&&kt.height&&(Mt.width=kt.width,Mt.height=kt.height),Mt.hidden=kt.hidden||!1,Mt.enableAdaptive=kt.disableAdaptive===void 0||!kt.disableAdaptive,Mt.default=kt.defaultSelect||!1,Mt.index=Rn,Mt.drmSchemaId=kt.drmSchemaId||Gn,Mt.drmToken=kt.drmToken||zn,Mt.drmSchemaId&&(Fe=!0),kt.backupUrl&&kt.backupUrl.length&&(Mt.url=Mt.url.concat(kt.backupUrl)),Mt.urlId=0,Mt.default&&c===void 0&&(di===h.f.MAIN?c=Rn:di===h.f.AUDIO?u=Rn:di===h.f.SUBTITLE&&(g=Rn)),(kt.comment||kt.kvqScore)&&(Mt.meta={comment:kt.comment,kvqScore:kt.kvqScore}),Mt});di===h.f.MAIN?xe=xe.concat(ar):di===h.f.AUDIO?(e||(e=[]),e=e.concat(ar)):di===h.f.SUBTITLE&&(t||(t=[]),t=t.concat(ar))}})}if(t&&v.processingSubtitleType(t,Ne),a)return[{codecType:He.length===1?He[0]:h.c.unknown,mediaLevels:{levels:xe,def:c||0,audioTracks:e,defAudio:u||0,subtitleTracks:t,defSubtitle:g||0,drm:Fe,box:R,stereoType:Q,isLive:se,meta:rt}}];var vt={};xe.forEach(function(ni){var mi=vt[ni.vCodecType];mi||(vt[ni.vCodecType]=mi={def:0,levels:[]}),ni.default&&(mi.def=mi.levels.length),mi.levels.push(ni)});var dt=Object.keys(vt).length,Dt=[];for(var Ei in vt){var Kt=vt[Ei];if(Kt){var Bi=Kt.levels[0];if(dt>1&&Bi&&Bi.m3u8Slice){var ki=ta(Bi.m3u8Slice);be(ki)&&(R=ki)}Dt.push({codecType:Ei,mediaLevels:{levels:Kt.levels,def:Kt.def,audioTracks:e,defAudio:u||0,subtitleTracks:t,defSubtitle:g||0,drm:Fe,box:R,stereoType:Q,isLive:se,isLiveShift:fe,meta:rt}})}}return Dt},v.processingSubtitleType=function(_,a){_.forEach(function(e,t){if(ke(e.currentUrl)===h.i.hls){e.live=!1,e.index=t,e.totalduration=a,e.targetduration=a,e.endSN=1;var c=new Li;c.type=h.f.SUBTITLE,c.start=0,c.sn=1,c.level=t,c.cc=0,c.url=e.currentUrl,c.duration=a,e.fragments=[c]}})},v.getAdaptationIdxByType=function(_,a){for(var e=0;e<_.adaptationSet.length;e++){var t=_.adaptationSet[e];if(t){var c;if(t.mimeType===void 0)return a==="video"?0:-1;if(((c=t.mimeType)==null?void 0:c.indexOf(a))===0)return e}}return-1},v}(),rb=/^(\d+)x(\d+)$/,kh=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,za=function(){function v(a){for(var e in typeof a=="string"&&(a=v.parseAttrList(a)),a)Object.prototype.hasOwnProperty.call(a,e)&&(this[e]=a[e])}var _=v.prototype;return _.decimalInteger=function(a){var e=parseInt(this[a],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},_.hexadecimalInteger=function(a){if(this[a]){var e=(this[a]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var t=new Uint8Array(e.length/2),c=0;c<e.length/2;c++)t[c]=parseInt(e.slice(2*c,2*c+2),16);return t}return null},_.hexadecimalIntegerAsNumber=function(a){var e=parseInt(this[a],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},_.decimalFloatingPoint=function(a){return parseFloat(this[a])},_.optionalFloat=function(a,e){var t=this[a];return t?parseFloat(t):e},_.enumeratedString=function(a){return this[a]},_.bool=function(a){return this[a]==="YES"},_.decimalResolution=function(a){var e=rb.exec(this[a]);if(e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},v.parseAttrList=function(a){var e,t={};for(kh.lastIndex=0;(e=kh.exec(a))!==null;){var c=e[2];c.indexOf('"')===0&&c.lastIndexOf('"')===c.length-1&&(c=c.slice(1,-1)),t[e[1]]=c}return t},v}(),Mh=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Ph=/#EXT-X-MEDIA:(.*)/g,Uh=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),nb=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,ab=/\.(mp4|m4s|m4v|m4a)$/i,Bh="m3u8-parser";function sb(v,_){v.rawProgramDateTime?v.programDateTime=Date.parse(v.rawProgramDateTime)||parseInt(v.rawProgramDateTime):_&&_.programDateTime&&(v.programDateTime=_.endProgramDateTime),typeof v.programDateTime=="number"&&Number.isFinite(v.programDateTime)||(v.programDateTime=null,v.rawProgramDateTime=null)}var Ka=function(){function v(){}return v.Dd=function(_,a){for(var e=0;e<_.length;e++){var t=_[e];if(t.id===a)return t}},v.Rd=function(_){var a,e=_.split(".");return e.length>2?(a=e.shift()+".",a+=parseInt(e.shift(),10).toString(16),a+=("000"+parseInt(e.shift(),10).toString(16)).substr(-4)):a=_,a},v.Ld=function(_,a){return Object(nr.buildAbsoluteURL)(a,_,{alwaysNormalize:!0})},v.parseMasterPlaylist=function(_,a){var e,t=[];for(Mh.lastIndex=0;(e=Mh.exec(_))!==null;){var c=new xi(v.Ld(e[2],a)),u=c.attrs=new za(e[1]),g=u.decimalResolution("RESOLUTION");g&&(c.width=g.width,c.height=g.height),c.maxBitrate=u.decimalInteger("BANDWIDTH")/1e3;var R=u.decimalInteger("AVERAGE-BANDWIDTH")/1e3;c.bitrate=R||c.maxBitrate,c.name=u.NAME,nn(u.CODECS||"",c),c.videoCodec&&c.videoCodec.indexOf("avc1")!==-1&&(c.vCodecType=Wr(c.videoCodec),c.videoCodec=v.Rd(c.videoCodec)),t.push(c)}return t},v.parseMasterPlaylistMedia=function(_,a,e,t){var c;t===void 0&&(t=[]);var u=[],g=0;for(Ph.lastIndex=0;(c=Ph.exec(_))!==null;){var R=new za(c[1]);if(R.TYPE===e){var Q=new xi(R.URI?v.Ld(R.URI,a):"");if(Q.attrs=R,Q.index=Q.id=g++,Q.groupId=R["GROUP-ID"]||"",Q.instreamId=R["INSTREAM-ID"]||"",Q.name=R.NAME||R.LANGUAGE,Q.type=e,Q.default=R.DEFAULT==="YES",Q.autoselect=R.AUTOSELECT==="YES",Q.forced=R.FORCED==="YES",Q.lang=R.LANGUAGE||"",t.length){var se=v.Dd(t,Q.groupId);Q.audioCodec=se?se.codec:t[0].codec}u.push(Q)}}return u},v.parseLevelPlaylist=function(_,a,e,t,c,u,g){c===void 0&&(c=h.f.MAIN),u===void 0&&(u=0),g===void 0&&(g=0);var R,Q,se,fe=g,xe=0,Fe=0,Ne=null,He=new Li,rt=null,$e=new xi(e);for(Uh.lastIndex=0;(Q=Uh.exec(a))!==null;){var vt=Q[1];if(vt){He.duration=parseFloat(vt);var dt=(" "+Q[2]).slice(1);He.title=dt||null,He.tagList.push(dt?["INF",vt,dt]:["INF",vt])}else if(Q[3]){if(Number.isFinite(He.duration)){var Dt=fe++;He.type=c,He.start=xe,He.levelkey=R,He.sn=Dt,He.level=t,He.cc=Fe,He.urlId=u,He.baseurl=e,He.relurl=(" "+Q[3]).slice(1),sb(He,Ne),$e.fragments.push(He),Ne=He,xe+=He.duration,He=new Li}}else if(Q[4]){var Ei=(" "+Q[4]).slice(1);Ne?He.setByteRange(Ei,Ne):He.setByteRange(Ei)}else if(Q[5])He.rawProgramDateTime=(" "+Q[5]).slice(1),He.tagList.push(["PROGRAM-DATE-TIME",He.rawProgramDateTime]),rt===null&&(rt=$e.fragments.length);else{if(!(Q=Q[0].match(nb))||Q.length<=0)break;for(se=1;se<Q.length&&Q[se]===void 0;se++);var Kt=(" "+Q[se+1]).slice(1),Bi=(" "+Q[se+2]).slice(1);switch(Q[se]){case"#":He.tagList.push(Bi?[Kt,Bi]:[Kt]);break;case"PLAYLIST-TYPE":$e.type=Kt.toUpperCase();break;case"MEDIA-SEQUENCE":fe=$e.startSN=parseInt(Kt,10);break;case"TARGETDURATION":$e.targetduration=parseFloat(Kt);break;case"VERSION":$e.version=parseInt(Kt,10);break;case"EXTM3U":break;case"ENDLIST":$e.live=!1;break;case"DIS":Fe++,He.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":Fe=parseInt(Kt,10);break;case"KEY":var ki=new za(Kt),ni=ki.enumeratedString("METHOD"),mi=ki.URI,Gn=ki.hexadecimalInteger("IV");ni&&(R=new mn(e,mi),mi&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ni)>=0&&(R.method=ni,R.key=null,Gn&&(R.iv=Gn)));break;case"START":var zn=new za(Kt).decimalFloatingPoint("TIME-OFFSET");Number.isFinite(zn)&&($e.startTimeOffset=zn);break;case"MAP":var di=new za(Kt);He.relurl=di.URI,di.BYTERANGE&&He.setByteRange(di.BYTERANGE),He.baseurl=e,He.level=t,He.type=c,He.sn="initSegment",$e.initSegment=He,(He=new Li).rawProgramDateTime=$e.initSegment.rawProgramDateTime;break;default:_.w(Bh,"line parsed but not handled: "+Q)}}}return(He=Ne)&&!He.relurl&&($e.fragments.pop(),xe-=He.duration),$e.totalduration=xe,$e.averagetargetduration=xe/$e.fragments.length,$e.endSN=fe-1,!$e.initSegment&&$e.fragments.length&&$e.fragments.every(function(ar){return ab.test(ar.relurl)})&&(_.w(Bh,"MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(He=new Li).relurl=$e.fragments[0].relurl,He.baseurl=e,He.level=t,He.type=c,He.sn="initSegment",$e.initSegment=He,$e.needSidxRanges=!0),rt&&function(ar,kt){for(var Rn=ar[kt],Mt=kt-1;Mt>=0;Mt--){var Za=ar[Mt];Rn&&Rn.programDateTime&&(Za.programDateTime=Rn.programDateTime-1e3*Za.duration),Rn=Za}}($e.fragments,rt),$e},v}(),ob=function(){function v(){}return v.parse=function(_){return _r.verify(_)?_r.parse(_):Sn.verify(_)?Sn.parse(_)[0].mediaLevels:{levels:[],def:0}},v.parseLevelSlice=function(_,a,e){if(a.m3u8Slice){var t=Ka.parseLevelPlaylist(_,a.m3u8Slice,a.url[0],a.index,e,0);return delete a.m3u8Slice,t.fragments.length===0?void 0:t}},v}(),cb=new RegExp('codecs="((/w|.)+)"'),qo=[{k:"video/mp4",v:h.i.mp4},{k:"video/quicktime",v:h.i.mp4},{k:"video/x-flv",v:h.i.flv},{k:"video/webm",v:h.i.matroska},{k:"video/x-matroska",v:h.i.matroska},{k:"video/mp2t",v:h.i.ts},{k:"audio/x-matroska",v:h.i.matroska},{k:"audio/mp4",v:h.i.mp4},{k:"audio/mpeg",v:h.i.mp3},{k:"audio/aac",v:h.i.aac},{k:"application/vnd.apple.mpegurl",v:h.i.hls},{k:"application/x-mpegurl",v:h.i.hls},{k:"audio/wave",v:h.i.wav},{k:"audio/wav",v:h.i.wav},{k:"audio/x-wav",v:h.i.wav},{k:"audio/x-pn-wav",v:h.i.wav}];function Jo(v){for(var _={type:v,box:h.i.unknown,vCodec:h.c.unknown},a=0;a<qo.length;a++)if(v.toLocaleLowerCase().indexOf(qo[a].k)===0){_.box=qo[a].v;var e=v.match(cb);e&&e.length>2&&e[1].split(",").forEach(function(t){t.indexOf("avc1")===0?_.vCodec=h.c.h264:t.indexOf("av01")===0?_.vCodec=h.c.av1:t.indexOf("hev1")!==0&&t.indexOf("hvc1")!==0||(_.vCodec=h.c.hevc)});break}return _}var Vh=function(){function v(){}return v.verify=function(_){return!!(_&&Object.prototype.hasOwnProperty.call(_,"version")&&Object.prototype.hasOwnProperty.call(_,"adaptationSet")&&Object.prototype.hasOwnProperty.call(_.adaptationSet,"representation")&&Array.isArray(_.adaptationSet.representation)&&_.adaptationSet.representation.length>0)&&_.adaptationSet.representation.reduce(function(a,e){return!!(a&&e.url&&e.bitrate&&e.qualityType)},!0)},v.parse=function(_){var a,e=[];return v.verify(_)&&_.adaptationSet.representation.forEach(function(t,c){var u=new er(t.url);u.id=t.id||c,u.maxBitrate=t.bitrate||0,u.bitrate=t.averageBitrate||u.maxBitrate,u.qualityType=t.qualityType||"",u.qualityLabel=t.name||"",u.codec=t.codec||"",u.hidden=t.hidden||!1,u.enableAdaptive=t.enableAdaptive===void 0||!!t.enableAdaptive,u.default=t.defaultSelect||!1,u.index=c,e.push(u),u.default&&a===void 0&&(a=c)}),{levels:e,def:a||0,srcType:h.l.KWAI_FLV_ABR}},v}(),Fh=function(){function v(){}return v.verify=function(_){return!!(_&&Object.prototype.hasOwnProperty.call(_,"segments")&&Array.isArray(_.segments)&&_.segments.length>0)&&(_.segments.forEach(function(a){if(!a.url||!a.duration||!a.time)return!1}),!0)},v.parse=function(_,a){a===void 0&&(a="");var e=[],t={levels:e,withCredentials:!1,hasVideo:!0,hasAudio:!0};if(v.verify(_)){var c=new xi("");e.push(c);var u=_;t.withCredentials=!!u.withCredentials,u.hasAudio!==void 0&&(t.hasAudio=!!u.hasAudio),u.hasVideo!==void 0&&(t.hasVideo=!!u.hasVideo);var g=0,R=0,Q=0,se=0,fe=0;u.segments.forEach(function(xe,Fe){var Ne=new Li;Ne.sn=Fe,typeof xe.startUtcTime=="string"?Ne.programDateTime=parseInt(xe.startUtcTime):typeof xe.startUtcTime=="number"&&(Ne.programDateTime=xe.startUtcTime),typeof xe.duration=="string"?Ne.duration=(parseFloat(xe.duration)||0)/1e3:Ne.duration=(xe.duration||0)/1e3,Ne.start=g,Ne.baseurl=a,Ne.relurl=xe.url,xe.filesize&&(fe+=xe.filesize),Ne.duration>se&&(se=Ne.duration),g+=Ne.duration,Fe>0&&Q!==xe.periodId&&(Ne.tagList.push(["DIS"]),R++),Ne.cc=R,Q=xe.periodId,c.fragments.push(Ne)}),c.bitrate=8*fe/1024/c.totalduration,c.live=!1,c.type=h.f.MAIN,c.startSN=0,c.endSN=c.fragments.length-1,c.totalduration=g,c.targetduration=se,c.averagetargetduration=g/c.fragments.length}return t},v}(),jh=new RegExp("^((http|https)://)|blob:"),lb=[h.i.matroska,h.i.mp3,h.i.aac],ub=[h.i.flv,h.i.raw,h.i.webrtc,h.i.ivf],hb=[h.i.mp4,h.i.flv,h.i.hls,h.i.raw,h.i.hls_fmp4,h.i.hls_ts,h.i.ts,h.i.ivf],Hh=Object.values(h.c),Gt="media-src",ec=function(){function v(){}return v.verifyMix=function(_){var a=0;for(var e in _)Hh.indexOf(e)!==-1&&a++;return a>0},v.isSrcEmpty=function(_){try{if(typeof _=="string"){if(!(_=_.trim()))return!0;if(!jh.test(_))return Object.keys(JSON.parse(_)).length===0}else if(!(_ instanceof Blob))return!_||Object.keys(_).length===0}catch(a){}return!1},v.filteringLevels=function(_,a,e){e===void 0&&(e=!1),_.i(Gt,"filteringLevels. input: "+a.levels.length+". mse: "+ht.isMSEAvailable()+" mixCodec: "+e);var t=X.a.chrome||X.a.firefox;a.levels.forEach(function(g){t&&g.audioCodec&&g.audioCodec.indexOf("mp4a.40.34")!==-1&&(g.audioCodec="")});var c=ht.isMSEAvailable()?ht.isMSECodecStrSupportedInMp4:ht.isVideoCodecStrSupportedInMp4,u=ht.isMSEAvailable()?ht.isMSECodecSupported:ht.isVideoCodecSupported;return a.levels=a.levels.filter(function(g){var R=!g.audioCodec||c(g.audioCodec,"audio"),Q=typeof g.hdr=="number"&&g.hdr>0,se=!0;(e||g.vCodecType===h.c.av1||X.a.mobile)&&((se=g.videoCodec?c(g.videoCodec):g.vCodecType===h.c.unknown||u(g.vCodecType,ht.getPlayTestDefinition(g),Q))||_.i(Gt,"filteringLevels. "+g.qualityType+" v unsupported. codec: "+g.vCodecType+" hdr: "+Q),g.qualityType.toLocaleLowerCase().indexOf("4k")>=0&&(X.a.mobile&&(se=!1),se||_.i(Gt,"filteringLevels. "+g.qualityType+" v unsupported. mobile: "+X.a.mobile)));var fe=Y(g);return fe||_.i(Gt,"filteringLevels. "+g.qualityType+" v unsupported. drm: "+g.drmSchemaId),R&&se&&fe}),a.audioTracks&&(a.audioTracks=a.audioTracks.filter(function(g){var R=!g.audioCodec||c(g.audioCodec,"audio");R||_.i(Gt,"filteringLevels. "+g.qualityType+" a unsupported. codec: "+g.audioCodec);var Q=Y(g);return Q||_.i(Gt,"filteringLevels. "+g.qualityType+" a unsupported. drm: "+g.drmSchemaId),R&&Q}),a.audioTracks.forEach(function(g){t&&g.audioCodec&&g.audioCodec.indexOf("mp4a.40.34")!==-1&&(g.audioCodec="")})),v.initLevelsDefault(_,a),a},v.initLevelsDefault=function(_,a){return _.i(Gt,"init level default"),a.def=-1,a.levels.forEach(function(e,t){e.index=t,e.default&&(a.def=t)}),a.def<0&&(a.def=a.levels.reduce(function(e,t,c){return t.bitrate<a.levels[e].bitrate?c:e},0),_.i(Gt,"no default main level, select lowest bit rate idx: "+a.def)),_.i(Gt,"audio level default: "+a.def),a.audioTracks&&a.audioTracks.length&&(a.defAudio=void 0,a.audioTracks.forEach(function(e,t){e.index=t,e.default&&(a.defAudio=t)}),a.defAudio===void 0&&(a.defAudio=0),_.i(Gt,"audio level default: "+a.defAudio)),a.subtitleTracks&&a.subtitleTracks.length&&(a.subtitleTracks.forEach(function(e,t){e.index=t,e.default&&(a.defSubtitle=t)}),a.defSubtitle===void 0&&(a.defSubtitle=0),_.i(Gt,"subtitle level default: "+a.defSubtitle)),a},v.preParse=function(_,a,e,t,c){if(c===void 0&&(c=""),_.i(Gt,"pre parse. native: "+e+", codecType: "+t+", baseUrl: "+c),typeof a=="string"){var u=this.Nd(_,a);if(!u)return[{src:a,box:h.i.unknown,srcType:h.l.OTHERS}];a=u}else a instanceof Blob||(a=JSON.parse(JSON.stringify(a)));if(Array.isArray(a)){_.i(Gt,"input mix container.",a.length);var g=[],R=[];a.forEach(function(fe){if(fe!=null&&fe.src){var xe={info:v.Qd(_,fe.src,e,t,c),priority:0,mime:void 0};g.push(xe.info.box),fe.type&&(xe.mime=Jo(fe.type)),R.push(xe)}});for(var Q=0;Q<R.length;Q++){var se=R[Q];if(se.info&&se.info.src){if(se.mime&&(se.mime.box!==h.i.unknown&&(se.info.box=se.mime.box),se.mime.vCodec!==h.c.unknown&&(se.info.codecType=se.mime.vCodec)),e!==void 0&&e!==se.info.nativeFirst||se.priority++,se.info.nativeFirst)se.priority+=se.info.box===h.i.unknown?1:ht.isVideoBoxSupported(se.info.box)?2:-100,se.priority+=se.info.codecType===h.c.unknown?1:t&&t===se.info.codecType||ht.isVideoCodecSupported(se.info.codecType)?2:-100;else{if(!ht.isMSEAvailable())continue;se.priority+=se.info.box===h.i.unknown?1:hb.indexOf(se.info.box)>=0?2:-100,se.priority+=se.info.codecType===h.c.unknown?1:t&&t===se.info.codecType||ht.isMSECodecSupported(se.info.codecType)?2:-100}_.i(Gt,"input mix container. media desc "+Q+". box: "+se.info.box+" codec: "+se.info.codecType+" priority: "+se.priority)}}return R.sort(function(fe,xe){return xe.priority-fe.priority}).filter(function(fe){return fe.priority>0}).map(function(fe){return fe.info})}return[v.Qd(_,a,e,t,c)]},v.Qd=function(_,a,e,t,c){if(c===void 0&&(c=""),_.i(Gt,"parse media desc. native: "+e+" codecType: "+t),typeof a=="string"){var u=this.Nd(_,a);if(!u)return{src:a,box:h.i.unknown,srcType:h.l.OTHERS};a=u}var g,R=ht.isMSEAvailable();if(v.verifyMix(a)){_.i(Gt,"input mix codec.",Object.keys(a));var Q=a,se=[];for(var fe in Q){var xe=fe;if(Hh.indexOf(xe)!==-1){var Fe=Q[xe];if(typeof Fe=="string"&&(Fe=Fe.trim()),!Fe){_.i(Gt,fe+" src is empty.");continue}var Ne=this.xd(_,Fe,c,xe,!0),He=Array.isArray(Ne)?this.Vd(Ne,xe)||Ne[0]:Ne;if(!He)continue;He.codecType=xe,se.push(He)}}g=this.Ud(_,se,e,t)}else{var rt=this.xd(_,a,c);Array.isArray(rt)?rt.length>1?(_.i(Gt,"input aas v2 mix codec."),g=this.Ud(_,rt,e,t)):rt.length===1&&((g=rt[0]).nativeFirst=this.Fd(_,g.box,R,e)):(g=rt).nativeFirst=this.Fd(_,g.box,R,e)}return g||(g={src:a,box:h.i.unknown,srcType:h.l.OTHERS}),g},v.Ud=function(_,a,e,t){var c,u,g=this,R={},Q={},se=[],fe=ht.isMSEAvailable();a.forEach(function($e){var vt=$e.codecType;if(vt)if($e.nativeFirst=g.Fd(_,$e.box,fe,e),se.push(vt),fe&&!$e.nativeFirst){var dt=ht.getVideoCodecCompatibilityByCodec(vt);Q[vt]=dt.decoder,vt===h.c.h264&&(dt.decoder=h.d.buildin,dt.smooth=!0),dt.smooth&&dt.decoder===h.d.buildin&&$e.mediaLevels&&($e.compatibility=dt,R[vt]=$e)}else{var Dt=ht.isVideoCodecSupported(vt);Q[vt]=Dt?h.d.buildin:h.d.unsupported,(vt===h.c.h264||Dt)&&($e.compatibility={decoder:h.d.buildin,smooth:!0,mix:!1},R[vt]=$e)}});var xe,Fe,Ne=(c=R[h.c.hevc])!=null&&c.mediaLevels&&R[h.c.hevc].mediaLevels.levels.length?R[h.c.hevc]:void 0,He=(u=R[h.c.av1])!=null&&u.mediaLevels&&R[h.c.av1].mediaLevels.levels.length?R[h.c.av1]:void 0,rt=R[h.c.h264];return _.i(Gt,"input vcodec. hevc: "+!!Ne+" av1: "+!!He+" h264: "+!!rt),t&&R[t]&&(xe=R[t],_.i(Gt,"selected the specified codec: "+t)),xe||((xe=He||Ne||rt)&&(xe.nativeFirst=this.Fd(_,xe.box,fe,e)),_.i(Gt,"selected src: "+((Fe=xe)==null?void 0:Fe.codecType),xe)),xe&&(se.length&&(xe.mixCodecInput=se),xe.mixCodecAvailable=Q),xe},v.Vd=function(_,a){for(var e=0;e<_.length;e++)if(_[e].codecType===a)return _[e]},v.Fd=function(_,a,e,t){if(!e||lb.indexOf(a)!==-1)return _.i(Gt,"get native first true. box: "+a+" mse: "+e),!0;if(ub.indexOf(a)!==-1||!ht.isVideoBoxSupported(a))return _.i(Gt,"get native first false. box: "+a),!1;if(!X.a.mobile){if(t){var c=ht.isVideoBoxSupported(a),u=!!c;return _.i(Gt,"get native first pc "+u+". box: "+a+" nativeFirstParams: true video box supported: "+c),u}if(t===void 0){var g=ht.isMSEAvailable(),R=!g;return _.i(Gt,"get native first pc "+R+". box: "+a+" nativeFirstParams: undefined mse supported: "+g),R}return _.i(Gt,"get native first pc false. nativeFirstParams: false"),!1}if(a===h.i.mp4||a===h.i.hls||a===h.i.hls_ts||a===h.i.ts){if(t===void 0||t){var Q=ht.isVideoBoxSupported(a),se=!!Q;return _.i(Gt,"get native first mobile "+se+". box: "+a+" nativeFirstParams: "+t+" video box supported: "+Q),se}return _.i(Gt,"get native first mobile false. nativeFirstParams: "+t),!1}if(a===h.i.hls_fmp4){if(t===void 0||t){var fe=ht.isVideoBoxSupported(a),xe=!(!fe||!X.a.x5&&!X.a.xweb);return _.i(Gt,"get native first mobile "+xe+". box: "+a+" nativeFirstParams: "+t+" video box supported: "+fe+" x5: "+X.a.x5+" xweb: "+X.a.xweb),xe}return _.i(Gt,"get native first mobile false. nativeFirstParams: "+t),!1}},v.xd=function(_,a,e,t,c){var u=this;e===void 0&&(e=""),t===void 0&&(t=h.c.unknown),c===void 0&&(c=!1);var g={src:a,box:h.i.unknown,srcType:h.l.OTHERS};if(typeof a=="string"){var R=new er(a);R.vCodecType=t,g.box=ke(a),g.mediaLevels={levels:[R],def:0},g.isLive=this.Pd(g.box)}else if(a instanceof Blob){var Q="unknow";a instanceof File?(g.box=ke(a.name),Q=a.name):g.box=Jo(a.type).box;var se=be(g.box)?new xi(URL.createObjectURL(a)):new er(URL.createObjectURL(a));se.vCodecType=t,se.fileName=Q,g.mediaLevels={levels:[se],def:0},g.srcType=h.l.FILE,g.isLive=!1}else{if(Sn.verify(a)){var fe=Sn.parse(a);return _.i(Gt,"kwai manifest"),fe.map(function(Ne){var He,rt;_.i(Gt,"kwai manifest codec: "+Ne.codecType+" meta:",Ne.mediaLevels.meta),v.Hd(Ne.mediaLevels.levels,t);var $e={meta:Ne.mediaLevels.meta,mediaLevels:v.filteringLevels(_,Ne.mediaLevels,c||fe.length>1),src:a,box:Ne.mediaLevels.box||ke(((He=Ne.mediaLevels.levels[0])==null?void 0:He.url[0])||""),srcType:h.l.KWAI,isLive:u.Pd(g.box),isLiveShift:Ne.mediaLevels.isLiveShift,codecType:Ne.codecType};return typeof((rt=$e.mediaLevels)==null?void 0:rt.isLive)=="boolean"&&($e.isLive=$e.mediaLevels.isLive),be($e.box)&&($e.multipart=!0),$e})}if(Vh.verify(a)){_.i(Gt,"flv abr manifest",t);var xe=Vh.parse(a);v.Hd(xe.levels,t),g.mediaLevels=v.filteringLevels(_,xe,c),g.box=h.i.flv,g.isLive=!0,g.srcType=h.l.KWAI_FLV_ABR}else if(Fh.verify(a)){_.i(Gt,"flv multipart");var Fe=Fh.parse(a,e);g.mediaLevels=s()({def:0},Fe),v.Hd(g.mediaLevels.levels,t),g.box=h.i.flv,g.isLive=!1,g.multipart=!0,g.srcType=h.l.KWAI_FLV_MP}else _r.verify(a)&&(g.mediaLevels=v.filteringLevels(_,_r.parse(a),c),g.box=h.i.hls,g.srcType=h.l.KWAI)}return be(g.box)&&(g.multipart=!0),g},v.Hd=function(_,a){a===void 0&&(a=h.c.unknown),_.forEach(function(e){e.vCodecType===h.c.unknown&&a!==h.c.unknown&&(e.vCodecType=a)})},v.Pd=function(_){var a;return[h.i.flv,h.i.hls,h.i.unknown,h.i.ivf,h.i.yuv].indexOf(_)===-1&&(a=!1),_===h.i.webrtc&&(a=!0),a},v.Nd=function(_,a){var e=a.trim();if(e){if(!jh.test(e)){try{e=JSON.parse(e)}catch(t){_.i(Gt,"formatStrData error",t)}typeof e=="string"&&(e=Object(nr.buildAbsoluteURL)(location.href,e,{alwaysNormalize:!0}))}return e}},v}();function db(v){switch(v){case h.f.MAIN:return _e.c.LEVEL;case h.f.SUBTITLE:return _e.c.SUBTITLE_TRACK;case h.f.AUDIO:return _e.c.AUDIO_TRACK;default:return _e.c.LEVEL}}var Wa,Gh,Vs,Yi="playlist-loader",fb=function(){function v(a){var e=this;this.Yd={},this.di=void 0,this.Ci=void 0,this.Ai=void 0,this.Do=void 0,this.Gd=function(t,c){c.retry&&e.Ai.emit(D.a.RETRY,{type:h.k.LOADER,core:h.a.mse,message:"manifest: "+c.errMessage,code:Object(L.d)(L.a.LOAD_ERROR,c.errMessage,c.code)})},this.Kd=function(t,c,u){if(e.Ai.emit(D.a.DOWNLOAD,pt(ut.SUCCESS,t,u)),t.isSidxRequest)e.zA(Object(L.e)(L.b.OTHER_ERROR,L.a.UNSUPPORTED,"unsupport sidx",{statusCode:u.code,url:t.url.toString()}));else if(e.Zd(t.type),typeof c=="string")if(c.indexOf("#EXTM3U")!==0&&c.indexOf("#EXTINF:")>=0&&t.rangeStart&&t.levelDetails)e.Wd(t,c,u);else{if(c.indexOf("#EXTM3U")!==0){if(t.rangeStart&&c.trim().length===0)return e.Ci.i(Yi,"emit empty. rangestart: "+t.rangeStart+". response is empty."),void e.Xd(t,u);var g=c;return g.length>100&&(g=g.slice(0,100)),void e.zd(t,"no EXTM3U delimiter."+g,u,!!c.trim().length)}c.indexOf("#EXTINF:")>0||c.indexOf("#EXT-X-TARGETDURATION:")>0?e.Wd(t,c,u):e.Jd(t,c,u)}else e.zA(Object(L.e)(L.b.NETWORK_ERROR,L.a.MANIFEST_PARSING_ERROR,'expected responseType of "text" for PlaylistLoader',{statusCode:u.code,url:t.url.toString()}))},this.qd=function(t,c){e.$d(t,c)},this.tl=function(t,c){e.Ai.emit(D.a.DOWNLOAD,pt(ut.ABORT,t,c))},this.zA=function(t){if(t.type===L.b.NETWORK_ERROR){var c=e.Do.lctx.current;!c||e.Do.stat.isLive||c.hasFrag&&c.live||(t.fatal=!0)}e.Ai.emit(D.a.ERROR,t)},this.Do=a,this.di=a.config,this.Ci=a.logger,this.Ai=a.evt,this.Yd={}}v.il=function(a){return a===_e.c.LEVEL},v.el=function(a){switch(a.type){case _e.c.AUDIO_TRACK:return h.f.AUDIO;case _e.c.SUBTITLE_TRACK:return h.f.SUBTITLE;default:return h.f.MAIN}},v.nl=function(a){if(a.urlBeforePreprocess)return a.urlBeforePreprocess;var e=a.responseUrl;return e&&e.indexOf("data:")!==0||typeof a.url!="string"||(e=a.url),e||""};var _=v.prototype;return _.sl=function(a){var e=new nt(this.Ci);return a.loader=e,this.Yd[a.type]=e,e},_.Ef=function(a){return this.Yd[a.type]},_.Zd=function(a){this.Yd[a]&&delete this.Yd[a]},_.rl=function(){for(var a in this.Yd){var e=this.Yd[a];e&&e.destroy(),this.Zd(a)}},_.destroy=function(){this.rl()},_.load=function(a){var e;this.Ci.i(Yi,"Loading playlist of type "+a.type+", level: "+a.level+", id: "+a.id);var t,c,u,g,R=this.Ef(a);if(R){var Q=R.context;if(Q&&Q.url===a.url)return this.Ci.i(Yi,"playlist request ongoing"),!1;this.Ci.w(Yi,"aborting previous loader for type: "+a.type),R.abort()}a.type===_e.c.MANIFEST?(t=this.di.manifestLoadingMaxRetry,c=this.di.manifestConnectionTimeout,u=this.di.manifestTransmissionTimeout,g=this.di.manifestLoadingRetryDelay):(t=this.di.levelLoadingMaxRetry,c=this.di.levelConnectionTimeout,u=this.di.levelTransmissionTimeout,g=this.di.levelLoadingRetryDelay),R=this.sl(a),a.responseType=a.responseType||"text";var se,fe={connectionTimeout:c,transmissionTimeout:u,maxRetry:t,retryDelay:g},xe={onLoad:this.Gd,onEnd:this.Kd,onError:this.qd,onAbort:this.tl};return(e=this.di.preprocessUrl)!=null&&e.manifest&&(this.Ci.i(Yi,"preprocessUrl manifest"),a.urlBeforePreprocess=a.url,a.url=(se=this.di.preprocessUrl)==null?void 0:se.manifest(a.url)),this.Ci.d(Yi,"Calling internal loader delegate for URL: "+a.url),R.load(a,xe,fe),!0},_.Jd=function(a,e,t){this.Ci.i(Yi,"handle master play list");var c=e,u=v.nl(a),g=Ka.parseMasterPlaylist(c,u);if(g.length){var R=g.map(function(He,rt){return{id:He.attrs?He.attrs.AUDIO:rt,codec:He.audioCodec}}),Q=Ka.parseMasterPlaylistMedia(c,u,"AUDIO",R),se=Ka.parseMasterPlaylistMedia(c,u,"SUBTITLES",R);if(Q.length){var fe=!1;if(Q.forEach(function(He){He.url||(fe=!0)}),fe===!1&&g[0].audioCodec&&(!g[0].attrs||!g[0].attrs.AUDIO)){this.Ci.v(Yi,"audio codec signaled in quality level, but no embedded audio track signaled, create one");var xe=new xi("");xe.type=h.f.MAIN,xe.name="main",xe.id=-1,Q.unshift(xe)}}var Fe=0;g.forEach(function(He,rt){He.default&&(Fe=rt)});var Ne={levels:g,audioTracks:Q,subtitleTracks:se,def:Fe};this.Ci.i(Yi,"hls mainfest"),this.Ai.emit(D.a.HLS_MANIFEST_PARSED,Ne)}else this.zd(a,"no level found in manifest",t)},_.Wd=function(a,e,t){var c=a.id,u=a.level,g=a.type;this.Ci.i(Yi,"handle track or level play list. id: "+c+" type: "+g+", level: "+u);var R=v.nl(a),Q=Number.isFinite(c)?c:0,se=Number.isFinite(u)?u:Q,fe=v.el(a),xe=a.levelDetails,Fe=!(e.indexOf("#EXTM3U")===0||!a.rangeStart),Ne=xe&&Fe?xe.endSN+1:0;xe&&(xe.http416=0);var He=Ka.parseLevelPlaylist(this.Ci,e,R,se,fe,Q,Ne);Fe&&(He.startSN=Ne,this.Ci.i(Yi,"part of media playlist data")),He.size=e.length,He.partOfData=Fe;var rt=He.fragments[0];if(a.liveShiftKwai2Params&&rt&&rt.programDateTime){var $e=a.liveShiftKwai2Params;$e.paramName==="offset"?this.Ci.w(Yi,"liveshift kwai2 m3u8 response. req: "+$e.time+" res: "+rt.programDateTime+" diff: "+($e.time-rt.programDateTime)+" sn: "+rt.sn+" cnt: "+He.fragments.length):a.liveShiftKwai2Params.paramName==="seqId"&&this.Ci.w(Yi,"liveshift kwai2 m3u8 response. req: "+$e.seqId+" res: "+rt.sn+" cnt: "+He.fragments.length)}if(g===_e.c.MANIFEST){var vt={levels:[He],def:0};this.Ci.i(Yi,"hls mainfest. track/level"),this.Ai.emit(D.a.HLS_MANIFEST_PARSED,vt)}if(He.needSidxRanges&&He.initSegment){var dt,Dt=He.initSegment.url;return(dt=this.di.preprocessUrl)!=null&&dt.stream&&(this.Ci.i(Yi,"preprocessUrl stream sidx"),a.urlBeforePreprocess=Dt,Dt=this.di.preprocessUrl.stream(Dt)),void this.load({url:Dt,isSidxRequest:!0,type:g,level:u,levelDetails:He,id:c,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",headers:this.di.headers})}a.levelDetails=He,this.hl(a,t)},_.zd=function(a,e,t,c){this.zA(Object(L.e)(L.b.NETWORK_ERROR,L.a.MANIFEST_PARSING_ERROR,e,{statusCode:t.code,url:a.url.toString()}))},_.$d=function(a,e){var t,c;this.Ci.i(Yi,"A network error occured while loading a "+a.type+"-type playlist");var u=this.Ef(a);switch(a.type){case _e.c.MANIFEST:t=L.a.MANIFEST_LOAD_ERROR,c=!0;break;case _e.c.LEVEL:t=L.a.LEVEL_LOAD_ERROR,c=!0;break;case _e.c.AUDIO_TRACK:t=L.a.AUDIO_TRACK_LOAD_ERROR,c=!0;break;case _e.c.SUBTITLE_TRACK:t=L.a.SUBTITLE_TRACK_LOAD_ERROR,c=!1;break;default:t=L.a.MANIFEST_LOAD_ERROR,c=!1}if(this.Ai.emit(D.a.DOWNLOAD,pt(ut.FAIL,a,e)),e.fatal){if(u&&(u.abort(),this.Zd(a.type)),a.rangeStart&&e.code===416)return this.Ci.i(Yi,"emit empty. level 416"),a.levelDetails&&a.levelDetails.http416++,void this.Xd(a,e);this.zA(Object(L.e)(L.b.NETWORK_ERROR,t,e.errMessage,{fatal:c,statusCode:e.code,url:a.url.toString()}))}},_.Xd=function(a,e){var t=new xi("");a.levelDetails?(t.endSN=a.levelDetails.endSN,t.targetduration=a.levelDetails.targetduration):t.targetduration=2,this.Ai.emit(D.a.LEVEL_LOADED,{details:t,level:a.level||0,stats:e})},_.hl=function(a,e){var t,c=a.type,u=a.level,g=a.levelDetails;if(g&&(g.targetduration||(t=a.levelDetails)!=null&&t.partOfData))if(v.il(a.type))this.Ai.emit(D.a.LEVEL_LOADED,{details:g,level:u||0,stats:e});else switch(c){case _e.c.AUDIO_TRACK:this.Ai.emit(D.a.AUDIO_TRACK_LOADED,{details:g,level:u||0,stats:e});break;case _e.c.SUBTITLE_TRACK:this.Ai.emit(D.a.SUBTITLE_TRACK_LOADED,{details:g,level:u||0,stats:e})}else this.zd(a,"invalid target duration.",e)},v}(),Fs="mp-hls",js=function(v){function _(e){var t;return(t=v.call(this)||this).ol=void 0,t.Do=void 0,t.Ci=void 0,t.Ai=void 0,t.kd=function(c){var u=t.Do.lctx;c=ec.filteringLevels(t.Ci,c),t.Do.stat.drm=c.drm,u.levels=c.levels,u.currentIdx=c.def,c.audioTracks&&(u.audioTracks=c.audioTracks,u.audioIdx=c.defAudio||0),c.subtitleTracks&&(u.subtitleTracks=c.subtitleTracks,u.subtitleIdx=c.defSubtitle||0),t.Ai.emit(D.a.MANIFEST_LOADED)},t.Do=e,t.Ci=e.logger,t.Ai=e.evt,t.ol=new fb(t.Do),t.O.push(t.ol,t.Ai.on(D.a.HLS_MANIFEST_PARSED,t.kd)),t}T()(_,v);var a=_.prototype;return a.loadManifest=function(){if(this.Ci.i(Fs,"load manifest."),this.Do.lctx.levels.length)this.Ai.emit(D.a.MANIFEST_LOADED);else if(this.ol){var e={url:this.Do.src,type:_e.c.MANIFEST,level:0,id:null,credentials:this.Do.config.credentials,headers:this.Do.config.headers,progress:!1,preferNative:this.Do.stat.preferNativeLoader};this.al(e),this.ol.load(e)}},a.loadLevel=function(e,t,c){if(t===void 0&&(t=h.f.MAIN),c===void 0&&(c=0),this.Ci.i(Fs,"load level. type: "+t),e.m3u8Slice){this.Ci.i(Fs,"load level. parse m3u8 slice.",c);var u=ob.parseLevelSlice(this.Ci,e,t);if(u){var g={details:u,level:c};if(t===h.f.MAIN?this.Ai.emit(D.a.LEVEL_LOADED,g):t===h.f.AUDIO?this.Ai.emit(D.a.AUDIO_TRACK_LOADED,g):t===h.f.SUBTITLE&&this.Ai.emit(D.a.SUBTITLE_TRACK_LOADED,g),!u.live)return}}if(this.ol){var R=e.urlId,Q={url:e.url[R],type:db(t),level:e.index,id:R,credentials:this.Do.config.credentials,headers:this.Do.config.headers,levelDetails:e,progress:!1,preferNative:this.Do.stat.preferNativeLoader};e.size&&e.http416<Ve.k&&this.Do.stat.liveShiftType===h.g.KWAI&&this.Ci.i(Fs,"load m3u8 range start: "+e.size+"."),this.al(Q),this.ol.load(Q)}},a.al=function(e){this.Do.isLiveShiftKwai2&&(e.url=this.Do.getKwai2LiveShiftUrl(e.url),this.Do.stat.liveShiftKwai2Params&&(e.liveShiftKwai2Params=s()({},this.Do.stat.liveShiftKwai2Params)),this.Do.stat.liveShiftKwai2Params.seqId=void 0)},_}(F.a),pb=js?((Wa={})[h.i.hls]=js,Wa[h.i.hls_ts]=js,Wa[h.i.hls_fmp4]=js,Wa[h.i.flv]=rn,Wa):((Gh={})[h.i.flv]=rn,Gh),tc=n(26),zh=function(){function v(a,e,t){var c=this;this.Do=void 0,this.Ci=void 0,this.Yd={},this.di=void 0,this.YA=void 0,this.ul=void 0,this.cl=void 0,this.fl=function(u,g,R){var Q=u.frag;Q.decryptdata?g&&g instanceof ArrayBuffer?(c.ul=Q.decryptdata.key=new Uint8Array(g),c.Yd[Q.type]=void 0,c.Do.evt.emit(D.a.HLS_KEY_LOADED,{frag:Q})):c.zA("key empty",R.code):c.zA("frag decrypt data empty",R.code)},this.Al=function(u,g){var R=u.frag.loader;g.fatal&&(R&&R.abort(),c.Yd[u.frag.type]=void 0,c.zA(g.errMessage,g.code))},this.zA=function(u,g){c.Do.evt.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.KEY_LOAD_ERROR,u,{statusCode:g}))},this.Do=a,this.Ci=a.logger,this.di=e,this.YA=t,this.Yd={},this.ul=null,this.cl=null}var _=v.prototype;return _.destroy=function(){for(var a in this.Yd){var e=this.Yd[a];e&&e.destroy()}this.Yd={}},_.load=function(a){var e=a.type,t=this.Yd[e],c=a.decryptdata,u=null;if(c&&(u=c.uri),!u||u===this.cl&&this.ul!==null)this.ul&&(c&&(c.key=this.ul),this.Do.evt.emit(D.a.HLS_KEY_LOADED,{frag:a}));else{var g=this.YA;t&&(this.Ci.w("KeyLoader","abort previous key loader for type:"+e),t.abort()),a.loader=this.Yd[e]=new nt(this.Ci),this.cl=u,this.ul=null;var R={url:u,frag:a,responseType:"arraybuffer",credentials:this.di.credentials,headers:this.di.headers,preferNative:this.di.preferNativeLoader},Q=g,se={onEnd:this.fl,onError:this.Al};a.loader.load(R,se,Q)}},v}(),Ya=n(27),On={local:0,server:0},Hs="live-time",an=function(v){function _(e){var t;return(t=v.call(this)||this).Ci=void 0,t.vl={abst:0,originDTS:0},t.dl=void 0,t.ll=void 0,_.Ci=t.Ci=e,e.i(Hs,"constructor"),_.bl={onError:_.Yf,onEnd:_.pl},_.YA={connectionTimeout:5e3},t}T()(_,v),_.load=function(e,t){_.sv();var c={url:"https://ntp.nc.gifshow.com/",responseType:"text",progress:!1,preferNative:t};(_.vf=new nt(e)).load(c,_.bl,_.YA)};var a=_.prototype;return a.ntpSync=function(e){this.Ci.i(Hs,"sync. state:",_.ml);var t=performance.now();(_.ml==="suspend"||t-_.gl>18e5)&&(this.Ci.i(Hs,"sync start."),_.gl=t,_.ml="loading",_.load(this.Ci,e))},a.onPrivNal=function(e){var t=this;e.info.forEach(function(c){typeof c.abst=="number"&&typeof e.streamTimestamp=="number"&&(t.vl.abst=c.abst/1e3,t.vl.originDTS=e.streamTimestamp/1e3)})},a.onParsing=function(e){var t=this;e.segments.forEach(function(c){c.type===h.o.VIDEO?t.dl={dts:c.startDTS,originDTS:c.originFirstDTS,parseTime:c.firstParseTime}:c.type===h.o.AUDIO&&(t.ll={dts:c.startDTS,originDTS:c.originFirstDTS,parseTime:c.firstParseTime})})},a.destroy=function(){_.sv()},a.getDisplayDelay=function(e){return this.yl(e,this.dl)},a.getAudioRenderDelay=function(e){return this.yl(e,this.ll)},a.getRecDelay=function(){var e=this.dl;if(this.serverNowMs&&e!=null&&e.parseTime){var t=this.vl,c=this.serverMs(1e3*e.parseTime+_._l);if(c&&t.originDTS&&t.abst)return Math.round(c-1e3*(e.originDTS-t.originDTS+t.abst))}return 0},a.serverMs=function(e){return On.server?e-On.local+On.server:null},a.yl=function(e,t){var c=this.serverNowMs,u=this.vl;return c&&t&&u.abst&&u.originDTS?Math.round(1e3*(t.dts-e-(t.originDTS-u.originDTS+u.abst))+c):0},_.sv=function(){_.vf&&_.vf.destroy()},m()(_,[{key:"syncState",get:function(){return _.ml}},{key:"time",get:function(){return s()({},On)}},{key:"now",get:function(){return this.serverNowMs||Date.now()}},{key:"serverNowMs",get:function(){return On.server?performance.now()-On.local+On.server:null}}],[{key:"workerTimeOffset",set:function(e){_._l=e}}])}(F.a);Vs=an,an._l=0,an.vf=void 0,an.bl=void 0,an.YA=void 0,an.ml="suspend",an.Ci=void 0,an.gl=void 0,an.Yf=function(){Vs.Ci.i(Hs,"ntp sync load error."),Vs.sv()},an.pl=function(v,_){if(Vs.sv(),typeof _=="string"){On.local=performance.now();var a=_.split(",");a.length>1&&(On.server=1e3*parseFloat(a[0])+parseInt(a[1],10)/1e3/2)}};var ic=an,_b=n(47),En="mux-base",rc=function(v){function _(e,t,c){var u;if((u=v.call(this)||this).At=void 0,u.Ai=void 0,u.Do=void 0,u.Ci=void 0,u.te=void 0,u.Cl=void 0,u.Rr=!1,u.Il=void 0,u.If=0,u.Ol=0,u._i=void 0,u.wl=!1,u.zc=function(g){var R=g.data.event,Q=g.data.data;u.El(R,Q),u.Ai.emit(R,Q)},u.At=c,u.Ai=e,u.Do=t,u.Ci=t.logger,t.stat.webWorker&&(u.te=t.stat.muxWorker,t.stat.muxWorker=void 0,!u.te))try{u.Ci.i(En,"init mux worker"),u.te=ae()(42),ic.workerTimeOffset=performance.now()}catch(g){}return u.Cl=0,u._i={audioCodec:t.stat.audioCodec,videoCodec:"",duration:0,remuxId:1,hasAudio:t.lctx.hasAudio,hasVideo:t.lctx.hasVideo,disableFillSlientForRaw:t.stat.avSeparated&&t.config.audioEnabled!==!1},t.lctx.current&&t.lctx.current.dropVideo.length&&(u._i.dropVideo=t.lctx.current.dropVideo),u.Ci.i(En,"constructor",u._i),u}T()(_,v);var a=_.prototype;return a.init=function(){var e=this;this.Ci.i(En,"TYPE_SUPPORTED","hw: "+ht.isSupportHW,ht.TYPE_SUPPORTED);var t=s()({},ht.TYPE_SUPPORTED);if(this.Do.stat.hevcFallbackWasm&&(t.hevc=!1),this.te){this.te.addEventListener("message",this.zc),this.te.addEventListener("error",function(c){e.Ci.i(En,"worker onerror",c.message),e.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.REMUX_WORKER_ERROR,c.message))});try{this.te.postMessage({cmd:Ya.a.INIT,typeSupported:t,config:this.Do.getRemuxConfig(),vendor:navigator.vendor,hasExternalLogger:!!this.Do.config.logger,contextId:this.Do.id})}catch(c){this.Ci.i(En,"worker init error"),this.te.terminate(),this.te=void 0}}this.te||(this.Il=new _b.a(this.Ai,t,this.Do.getRemuxConfig(),navigator.vendor,this.Ci),this.O.push(this.Ai.prependListener(D.a.PARSING_DATA,this.jl.bind(this)),this.Ai.prependListener(D.a.PARSED_DATA,this.fo.bind(this)),this.Ai.prependListener(D.a.RAW_DATA,this.kl.bind(this))))},a.destroy=function(){this.Do.stat.muxWorker=void 0,this.te&&(this.te.postMessage({cmd:Ya.a.DESTROY}),this.te.removeEventListener("message",this.zc),this.te.terminate(),this.te=void 0),v.prototype.destroy.call(this)},a.reset=function(e){this.Ci.i(En,"reset: "+e),this._i.remuxId++,this.Cl=0,this.Rr=e,this.wl=!1},a.end=function(){this.wl||(this.wl=!0,this.te?this.te.postMessage({cmd:Ya.a.LOAD_END}):this.Il&&this.Il.end())},a.updateConfig=function(e){this.te?this.te.postMessage({cmd:Ya.a.UPDATE_CONFIG,config:e}):this.Il&&this.Il.updateConfig(e)},a.onFragProgress=function(e){this.Ml(e,!1)},a.onFragLoaded=function(e){this.Ml(e,!0)},a.updateSuffix=function(e){this._i.suffix=e},a.Ml=function(e,t){var c=e.context.frag,u=e.discontinuity||!1,g=(c==null?void 0:c.start)||0,R=!1,Q=!0,se=null;if(this._i.progress=e.progress,e.data&&e.data.byteLength){var fe=performance.now(),xe=fe-(this.If||e.stats.trequest);e.stats.trequest!==this.Ol&&(this.Ol=e.stats.trequest,xe=fe-e.stats.trequest),this.If=fe,this.Ai.emit(D.a.LOADER_CHUNK_ARRIVAL,{progress:e.context.progress,byteLength:e.data.byteLength,timeCost:xe,ts:performance.now()})}this.Cl===0&&(R=!0,Q=e.remuxContiguous||!1,this.Ci.i(En,"chunk 0 contiguous: "+Q)),t?(this.If=0,this.Cl=0,se=e.data?new Uint8Array(e.data):new Uint8Array):(this.Cl++,e.data&&(se=new Uint8Array(e.data))),se&&(this.Sl(se,(c==null?void 0:c.decryptdata)||null,e.initData,g,Q,R,u,!this.Rr||(c==null?void 0:c.start)===0,t),this.Rr=!1)},a.jl=function(e){this.Bl(e)&&(e.expired=!0,this.Ci.i(En,"parsing data expired"))},a.fo=function(e){this.Bl(e)?(e.expired=!0,this.Ci.i(En,"parsed expired")):e&&(e.trackType=this.At)},a.kl=function(e){this.Bl(e)&&(e.expired=!0)},a.Bl=function(e){return!(!e.extra||e.extra.remuxId===this._i.remuxId)},a.Sl=function(e,t,c,u,g,R,Q,se,fe){g||this.Ci.i(En," demux contiguous false");var xe=this._i;this.te?this.te.postMessage({cmd:Ya.a.PUSH,data:e,decryptdata:t,initSegment:c,timeOffset:u||0,contiguous:g,trackSwitch:R,discontinuity:Q,accurateTimeOffset:se,fragEnd:fe,transmuxData:xe},[e.buffer]):this.Il&&this.Il.pushMuxData(e,t,c,u,g,R,Q,se,fe,s()({},xe))},a.El=function(e,t){switch(e){case D.a.PARSING_DATA:this.jl(t);break;case D.a.PARSED_DATA:this.fo(t);break;case D.a.RAW_DATA:this.kl(t)}},m()(_,[{key:"totalDuration",set:function(e){this._i.duration=e}},{key:"id",get:function(){return this.At}}])}(F.a),nc="mux-multipart",Ab=function(v){function _(e,t,c){var u;return(u=v.call(this,e,t,c)||this).Tl=void 0,u.Dl=void 0,u.Tl=void 0,u.Dl={},u}T()(_,v);var a=_.prototype;return a.reset=function(e){v.prototype.reset.call(this,e),this.Tl=void 0},a.Ml=function(e,t){if(e.context.frag){var c=e.context.frag,u=this.Tl,g=!1,R=Number.isFinite(c.startDTS)?c.startDTS:c.start,Q=!1,se=!0,fe=null;if(this._i.progress=e.progress,typeof c.sn=="number"&&(this._i.fragSn=c.sn),e.data&&e.data.byteLength){var xe=performance.now(),Fe={progress:e.context.progress,byteLength:e.data.byteLength,timeCost:performance.now()-(this.If||e.stats.trequest),ts:performance.now()};this.If=xe,this.Ai.emit(D.a.LOADER_CHUNK_ARRIVAL,Fe)}if(this.Cl===0){this.Dl={},g=!(u&&c.level===u.level),Q=!(u&&c.cc===u.cc);var Ne=u&&c.sn===u.sn+1;se=!(g||!Ne),this.Do.stat.isLive&&(Q=Q||!Ne),u&&e.remuxContiguous&&(se||(R=Number.isFinite(u.endDTS)?u.endDTS:u.start+u.duration),se=!0)}t?(this.If=0,this.Cl=0,this.Tl=e.context.frag,fe=e.data?new Uint8Array(e.data):new Uint8Array,this.Tl=c):(this.Cl++,e.data&&(fe=new Uint8Array(e.data))),fe&&(typeof e.liveShiftOffset=="number"&&(R=e.liveShiftOffset),this.Sl(fe,c.decryptdata,e.initData,R,se,g,Q,!this.Rr||e.context.frag.start===0,t),this.Rr=!1)}},a.jl=function(e){var t=this;if(this.Bl(e))return this.Ci.i(nc,"parsing data expired"),void(e.expired=!0);e.frag=this.Tl;var c=this.Dl;e.segments.forEach(function(u){var g=u.type;if(g===h.o.VIDEO&&u.adjustedStart&&u.adjustedStart>1)t.Ci.i(nc,"video segment adjustedStart: "+u.adjustedStart+" > 1");else{var R=c[g];R?(R.endPTS=u.endPTS,R.endDTS=u.endDTS):(u.endPTS||u.endDTS||!t.Tl||(u.endPTS=u.startPTS+t.Tl.duration,u.endDTS=u.startDTS+t.Tl.duration),c[g]={startDTS:u.startDTS,startPTS:u.startPTS,endPTS:u.endPTS,endDTS:u.endDTS})}})},a.fo=function(e){if(this.Bl(e))return e.expired=!0,void this.Ci.i(nc,"parsed expired");e.info=s()({},this.Dl),e.frag=this.Tl,this.Dl={},e&&(e.trackType=this.At)},a.kl=function(e){this.Bl(e)?e.expired=!0:e.frag=this.Tl},_}(rc),Ea="initSegment",Pi="stream-media",Kh=function(v){function _(e,t,c,u){var g;return(g=v.call(this)||this).Ai=void 0,g.Rl=void 0,g.Ll=void 0,g.Nl=0,g.Ql=-1,g.Il=void 0,g.xl=!0,g.Vl=!0,g.Ul=0,g.Fl=0,g.Pl=!1,g.vf=void 0,g.Hl=void 0,g.Yl=void 0,g.Gl=!1,g.Do=void 0,g.Ci=void 0,g.Kl=void 0,g.bl=void 0,g.Zl=void 0,g.Wl=void 0,g.Xl=void 0,g.zl=function(){var R=g.Do.lctx.getNextIdx(g.Rl);g.Do.lctx.getLevelIdx(g.Rl)!==R&&g.Do.lctx.setLevelIdx(R,g.Rl);var Q=g.level;if(Q){if(g.Kl&&Q.hasFrag){var se=g.Kl.frag,fe=Q.fragments[g.Nl];fe&&g.Do.config.adjustFragTime&&g.Nl===g.Kl.pos&&se&&Number.isFinite(se.startPTS)&&p(g.Ci,Q,fe,se.startPTS,se.endPTS,se.startDTS,se.endDTS)}if(g.xl&&!g.vf&&!g.Pl){if(g.Jl())return void g.Il.end();var xe=g.Tr();xe&&(Q.hasFrag&&Q.initSegment&&!Q.initSegment.data&&(g.Ci.i(Pi,"["+g.Rl+"]load init segment."),g.ql(Q.initSegment)),g.Ci.i(Pi,"["+g.Rl+"]load frag: "+xe.sn+" level: "+g.index),g.ql(xe))}}},g.$l=function(R){if(!R.expired){var Q=R.frag;if(g.Ci.i(Pi,"["+g.Rl+"]parsed. "+(Q==null?void 0:Q.sn)),R.trackType===g.Rl&&Q){for(var se in g.Pl=!1,g.Gl=!1,R.info){var fe=R.info[se];if(fe&&fe.endPTS&&fe.endDTS){var xe=g.Ll[Q.level];xe!=null&&xe.hasFrag&&(g.Do.isLiveShift||!g.Do.config.adjustFragTime?xe.live&&typeof Q.sn=="number"&&E(g.Ci,xe,Q.sn-xe.startSN):p(g.Ci,xe,Q,fe.startPTS,fe.endPTS,fe.startDTS,fe.endDTS))}}g.Kl&&(g.Kl=void 0),g.Jl()?g.Il.end():g.Rl===h.f.MAIN&&g.Ai.emit(D.a.ABR_NEXT,{startSec:g.tb(g.Nl)}),g.zl()}}},g.ib=function(){if(g.Xl&&g.eb(g.Xl.context.frag,g.Ll[g.Xl.context.frag.level])){var R=g.Xl.data.get(g.Xl.data.unreadLen);R&&g.nb(g.Xl.context,R.buffer,g.Xl.stats,g.Xl.progress),g.Xl=void 0}},g.sb=function(R,Q){Q.retry&&g.Ai.emit(D.a.RETRY,{type:h.k.LOADER,core:h.a.mse,message:""+Q.errMessage,code:Object(L.d)(L.a.LOAD_ERROR,Q.errMessage,Q.code)})},g.Mc=function(R,Q,se){R.frag&&R.frag.sn===Ea||Q instanceof ArrayBuffer&&g.rb(R,Q,se,!0)},g.xc=function(R,Q,se){g.Ql=-1,g.Fl=0,R.frag&&R.frag.sn===Ea?g.hb():g.Lf();var fe=g.Ll[R.frag.level],xe=pt(ut.SUCCESS,R,se,fe==null?void 0:fe.qualityType,fe==null?void 0:fe.codec);g.Ai.emit(D.a.DOWNLOAD,xe),g.Ci.i(Pi,"["+g.Rl+"]frag loaded. "+R.frag.sn),typeof Q!="string"&&(R.frag&&R.frag.sn===Ea&&Q?(R.frag.data=new Uint8Array(Q),g.Pl=!1,g.ib()):g.rb(R,Q,se,!1))},g.Di=function(R,Q){R.preferNative&&g.Do.stat.preferNativeLoader===void 0&&(g.Ci.i(Pi,"["+g.Rl+"]prefer native loader."),g.Do.stat.preferNativeLoader=!0),g.Pl=!1;var se=g.Ll[R.frag.level];if(g.Ai.emit(D.a.DOWNLOAD,pt(ut.FAIL,R,Q,se==null?void 0:se.qualityType,se==null?void 0:se.codec)),Q.fatal&&se)if(g.Gl=!1,g.Ql<0&&(g.Ql=Math.max(0,g.Nl-1)),g.ob(),g.Fl+=R.frag.duration||0,R.frag.sn===Ea||Q.code!==404||g.Do.config.maxFragFailSec&&g.Fl>=g.Do.config.maxFragFailSec||g.Jl()){var fe=Object(L.e)(L.b.NETWORK_ERROR,L.a.LOAD_ERROR,Q.errMessage,{statusCode:Q.code,url:R.url.toString()});g.Ai.emit(D.a.ERROR,fe)}else g.Nl<se.fragments.length&&(g.Ai.emit(D.a.VIDEO_SEEK,{sec:se.fragments[g.Nl].start}),g.zl())},g.ab=function(R,Q){var se=g.Ll[R.frag.level];g.Ai.emit(D.a.DOWNLOAD,pt(ut.ABORT,R,Q,se==null?void 0:se.qualityType,se==null?void 0:se.codec))},g.Rl=e,g.Ai=t,g.Do=c,g.Ci=c.logger,g.Ll=e===h.f.MAIN?c.lctx.levels:c.lctx.audioTracks,g.Ci.i(Pi,"["+e+"] constructor"),c.lctx.setLevelIdx(u,g.Rl),c.lctx.setNextIdx(u,g.Rl),g.bl={onLoad:g.sb,onProgress:g.Mc,onEnd:g.xc,onError:g.Di,onAbort:g.ab},g.Zl={connectionTimeout:c.config.connectionTimeout,transmissionTimeout:c.config.transmissionTimeout,maxRetry:c.config.maxRetry,retryDelay:c.config.retryDelay,breakpointContinuation:c.config.breakpointContinuation},g.Wl={connectionTimeout:c.config.keyConnectionTimeout,transmissionTimeout:c.config.keyTransmissionTimeout,maxRetry:c.config.keyLoadingMaxRetry,retryDelay:c.config.keyLoadingRetryDelay},g.O.push(g.Ai.prependListener(D.a.PARSED_DATA,g.$l)),g.Il=new Ab(t,c,e),g.Il.init(),g.O.push(c.evt.on(D.a.HLS_KEY_LOADED,g.ib)),g}T()(_,v);var a=_.prototype;return a.levelUpdated=function(e){if(e===void 0&&(e=!0),this.level&&this.level.hasFrag){var t=this.level.startSN;Number.isFinite(this.Ul)&&this.Ul!==t&&(this.Nl=Math.max(0,this.Nl-(t-this.Ul))),this.Ul=t,this.Il.totalDuration=this.level.totalduration,e&&this.zl()}},a.reset=function(){var e;this.Ci.i(Pi,"reset type: "+this.Rl+" frag num: "+((e=this.level)==null?void 0:e.fragments.length)),this.Nl=0,this.Kl=void 0,this.Ul=0,this.Gl=!1,this.ob(),this.ub(!0)},a.seek=function(e,t,c){t===void 0&&(t=!1),c===void 0&&(c=!0),this.Gl=!1;var u=this.level;if(this.xl=!0,this.Kl=void 0,this.ob(),this.Xl=void 0,u&&u.hasFrag){var g,R,Q=this.Do.isLiveShiftKwai2?e-(this.Do.stat.liveShiftOffset||0)/1e3:e,se=e===0?0:ai(Q,u.fragments);if(se>=0?this.Nl=se:(this.Nl=0,u.hasFrag&&Q>=u.fragments[0].start&&(this.Nl=u.fragments.length-1)),this.ub(!0),this.Ci.i(Pi,"["+this.Rl+"]seek: "+e+" "+t+" idx: "+this.Nl+" start: "+((g=u.fragments[this.Nl])==null?void 0:g.start)+" url: "+((R=u.fragments[this.Nl])==null?void 0:R.url)),c)if(t)this.Ai.emit(D.a.VIDEO_SEEK,{sec:u.fragments[this.Nl].start||e});else if(this.Do.isLiveShift&&e!==this.Do.currentTime){var fe;this.Ai.emit(D.a.VIDEO_SEEK,{sec:t&&((fe=u.fragments[this.Nl])==null?void 0:fe.start)||e})}else this.Ai.emit(D.a.VIDEO_SEEK,{sec:e});this.zl()}return e},a.destroy=function(){this.Ci.i(Pi,"["+this.Rl+"]destroy"),this.ob(),this.Il&&this.Il.destroy(),this.Yl&&(this.Yl.destroy(),this.Yl=void 0),this.Kl=void 0,v.prototype.destroy.call(this)},a.nextBackup=function(){if(this.Ci.i(Pi,"["+this.Rl+"]next backup."),this.Ll)for(var e=0;e<this.Ll.length;e++){var t=this.Ll[e];if(t.urlId>=t.url.length-1)return!1;t.urlId++,delete t.m3u8Slice,t.fragments=[]}return this.ob(),this.Vl=!0,this.Ql>=0&&(this.Nl=this.Ql),this.ub(!0),!0},a.setDownloadEnabled=function(e,t){t===void 0&&(t=!0),!this.xl&&e?(this.xl=e,t&&this.zl()):this.xl=e},a.setIndex=function(e){this.Ci.i(Pi,"["+this.Rl+"]set index "+e+"."),this.ob(),this.Vl=!0,this.Do.lctx.setLevelIdx(e,this.Rl),this.Do.lctx.setNextIdx(e,this.Rl),this.Kl=void 0},a.setNext=function(e){this.Ci.i(Pi,"["+this.Rl+"]set next "+e+"."),this.Vl=!0,this.Do.lctx.setNextIdx(e,this.Rl),this.Gl=!0},a.cb=function(e){return e.maxStartPTS||e.startPTS||e.start},a.fb=function(e){if(this.level&&this.level.hasFrag)return this.level.fragments[e]},a.tb=function(e){var t=this.fb(e);return t?this.cb(t):0},a.ub=function(e){this.Pl=!1,this.Il.reset(e)},a.ob=function(){this.Xl=void 0,this.Lf(),this.hb()},a.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},a.hb=function(){this.Hl&&(this.Hl.destroy(),this.Hl=void 0)},a.Ab=function(e){var t;this.Ci.i(Pi,"["+this.Rl+"]load key "+e.sn+"."),!this.Yl&&zh&&(this.Yl=new zh(this.Do,{credentials:this.Do.config.credentials,headers:this.Do.config.headers,preferNativeLoader:this.Do.stat.preferNativeLoader},this.Wl)),(t=this.Yl)==null||t.load(e)},a.Jl=function(){var e=this.level;return!!(e&&e.hasFrag&&!e.live&&this.Nl>=e.fragments.length)},a.Tr=function(){var e,t=this.level;return t&&this.Nl<t.fragments.length&&(e=t.fragments[this.Nl]),e&&(e.encrypted&&e.decryptdata&&this.Ab(e),typeof e.sn=="number"&&this.Nl++),e},a.ql=function(e){if(this.Rl===h.f.MAIN&&this.Do.stat.avSeparated&&this.Do.config.videoEnabled===!1){if(this.Vl){this.Ci.i(Pi,"["+this.Rl+"]mock load frag. video enabled false");var t=e.start;this.Ai.emit(D.a.NEW_SOURCE,{sync:t}),this.Vl=!1}}else if((this.Rl!==h.f.AUDIO||this.Do.config.audioEnabled!==!1)&&e){var c,u,g={url:e.url,responseType:"arraybuffer",progress:e.sn!==Ea&&this.Rl===h.f.MAIN&&this.Do.streamingMux,frag:e,type:"frag",credentials:this.Do.config.credentials,headers:this.Do.config.headers,preferNative:this.Do.stat.preferNativeLoader},R=e.byteRangeStartOffset,Q=e.byteRangeEndOffset;if(Number.isFinite(R)&&Number.isFinite(Q)&&(g.rangeStart=R,g.rangeEnd=Q,g.rangeType=this.Do.config.httpRangeType),(c=this.Do.config.preprocessUrl)!=null&&c.stream&&(this.Ci.d(Pi,"["+this.Rl+"]preprocessUrl stream."),g.url=(u=this.Do.config.preprocessUrl)==null?void 0:u.stream(g.url)),e.sn===Ea)g.progress=!1,this.hb(),this.Hl=new nt(this.Ci),this.Hl.load(g,this.bl,this.Zl);else if(this.Lf(),this.vf=new nt(this.Ci),this.vf.load(g,this.bl,this.Zl),this.Pl=!0,this.Rl===h.f.MAIN&&this.Vl){var se=e.start;this.Ai.emit(D.a.NEW_SOURCE,{sync:se}),this.Vl=!1}}},a.rb=function(e,t,c,u){if(this.eb(e.frag,this.Ll[e.frag.level])){if(this.Xl){this.lb(e,t,c,u);var g=this.Xl.data.get(this.Xl.data.unreadLen);this.Xl=void 0,g&&(t=g)}this.nb(e,t,c,u)}else this.Xl?this.lb(e,t,c,u):(this.Xl={context:e,stats:c,data:new tc.a,progress:u},t&&this.Xl.data.put(new Uint8Array(t)))},a.lb=function(e,t,c,u){this.Xl&&(this.Xl.context=e,this.Xl.stats=c,this.Xl.progress=u,t&&this.Xl.data.put(new Uint8Array(t)))},a.eb=function(e,t){return!(e.encrypted&&e.decryptdata&&!e.decryptdata.key||t!=null&&t.initSegment&&!t.initSegment.data)},a.nb=function(e,t,c,u){var g;this.Ci.i(Pi,"start demux");var R=this.Ll[e.frag.level],Q={context:e,data:t,initData:R==null||(g=R.initSegment)==null?void 0:g.data,stats:c,audioCodec:R==null?void 0:R.audioCodec,videoCodec:R==null?void 0:R.videoCodec,remuxContiguous:!!(this.Gl||R!=null&&R.live),progress:u},se=this.level;this.Do.isLiveShiftKwai2&&se&&typeof e.frag.sn=="number"&&this.Do.liveTime&&typeof this.Do.stat.liveShiftOffset=="number"&&this.Do.stat.liveShiftOffset>=0&&(e.frag.programDateTime?Q.liveShiftOffset=(e.frag.programDateTime-this.Do.stat.liveStartTime)/1e3:Q.liveShiftOffset=(this.Do.stat.liveShiftOffsetAligned||this.Do.stat.liveShiftOffset)/1e3),u?this.Il.onFragProgress(Q):this.Il.onFragLoaded(Q)},m()(_,[{key:"levels",get:function(){return this.Ll}},{key:"level",get:function(){return this.Do.lctx.getLevel(this.Rl)}},{key:"index",get:function(){return this.Do.lctx.getLevelIdx(this.Rl)}},{key:"manualNext",set:function(e){if(this.Rl===h.f.MAIN){var t=this.level;if(t!=null&&t.hasFrag){var c=ai(this.Do.currentTime+(t.targetduration||5)/2,t.fragments)+1;if(c>0&&c<t.fragments.length){c<this.Nl&&(this.ob(),this.ub(!1),this.Nl=c,this.Gl=!1),this.Vl=!0,this.Do.lctx.setNextIdx(e,this.Rl);var u=t.fragments[this.Nl];if(!u)return this.Ci.i(Pi,"set nextLevel failed. no frag @"+this.Nl),void this.Ai.emit(D.a.LEVEL_SWITCH_FAILED);var g=this.cb(u);return this.Ai.emit(D.a.LEVEL_SWITCHING,{id:0,time:g,level:e,smooth:!0,auto:!1}),(this.Kl&&this.Kl.frag.sn!==u.sn||!this.Kl)&&(this.Kl={level:this.Do.lctx.getLevelIdx(this.Rl),pos:this.Nl,frag:u,alignPTS:g}),this.Ai.emit(D.a.BUFFER_CLEANING,{startSec:this.Kl.alignPTS||g}),void this.zl()}}this.Ci.i(Pi,"set nextLevel failed. no frag"),this.Ai.emit(D.a.LEVEL_SWITCH_FAILED)}}},{key:"type",get:function(){return this.Rl}},{key:"lastLoadedFrag",get:function(){var e=this.Nl;return this.vf&&e--,this.fb(e)}}])}(F.a),Wh=function(){function v(a,e){var t=this;this.Ai=void 0,this.Do=void 0,this.vf=void 0,this.xl=!0,this.Nl=0,this.Ul=0,this.bl=void 0,this.Zl=void 0,this.bb=[],this.zl=function(){if(!(t.index<0)){var c=t.level;if(t.xl&&c&&!t.vf){var u=t.Tr();u&&t.ql(u)}}},this.xc=function(c,u,g){t.Lf();var R=t.Do.lctx.subtitleTracks[c.frag.level],Q=pt(ut.SUCCESS,c,g,R.qualityType);t.Ai.emit(D.a.DOWNLOAD,Q),u&&typeof u!="string"&&(R&&R.hasFrag&&R.fragments.length===1&&!R.live&&t.bb.indexOf(c.frag.level)===-1&&t.bb.push(c.frag.level),t.Ai.emit(D.a.SUBTITLE_LOADED,{data:u,cc:c.frag.cc,start:c.frag.start})),t.zl()},this.Di=function(c,u){var g;t.Ai.emit(D.a.DOWNLOAD,pt(ut.FAIL,c,u,(g=t.Do.lctx.subtitleTracks[c.frag.level])==null?void 0:g.qualityType)),t.Lf(),t.zl()},this.Ai=a,this.Do=e,e.lctx.subtitleIdx=e.lctx.subtitleTracks.reduce(function(c,u,g){return u.default?g:c},-1),this.bl={onEnd:this.xc,onError:this.Di},this.Zl={connectionTimeout:e.config.connectionTimeout,transmissionTimeout:e.config.transmissionTimeout,maxRetry:e.config.maxRetry,retryDelay:e.config.retryDelay}}var _=v.prototype;return _.levelUpdated=function(){if(this.level&&this.level.hasFrag){var a=this.level.startSN;Number.isFinite(this.Ul)&&this.Ul!==a&&(this.Nl=Math.max(0,this.Nl-(a-this.Ul))),this.Ul=a,this.zl()}},_.seek=function(a){if(this.index<0)return 0;var e=this.level;if(this.bb.indexOf(this.index)!==-1)return a;if(this.xl=!0,e&&e.hasFrag){var t=a===0?0:ai(a,e.fragments),c=e.fragments[t];this.vf&&c&&this.vf.context.frag.sn===c.sn&&this.vf.context.frag.level===c.level||(this.Nl=t>=0?t:e.fragments.length-1,this.Lf(),this.zl())}return a},_.setDownloadEnabled=function(a){!this.xl&&a?(this.xl=a,this.zl()):this.xl=a},_.setIndex=function(a){this.Lf(),this.Do.lctx.subtitleIdx=a},_.Tr=function(){var a=this.level;if(a&&a.hasFrag&&this.Nl<a.fragments.length){var e=a.fragments[this.Nl];if(e&&typeof e.sn=="number")return this.Nl++,e}},_.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},_.ql=function(a){if(a){var e={url:a.url,responseType:"arraybuffer",frag:a,type:"frag",credentials:this.Do.config.credentials,progress:!1,preferNative:this.Do.stat.preferNativeLoader},t=a.byteRangeStartOffset,c=a.byteRangeEndOffset;Number.isFinite(t)&&Number.isFinite(c)&&(e.rangeStart=t,e.rangeEnd=c),this.Lf(),this.vf=new nt(this.Do.logger),this.vf.load(e,this.bl,this.Zl)}},m()(v,[{key:"levels",get:function(){return this.Do.lctx.subtitleTracks}},{key:"level",get:function(){return this.Do.lctx.subtitle}},{key:"index",get:function(){return this.Do.lctx.subtitleIdx}},{key:"lastLoadedFrag",get:function(){var a=this.Nl;if(this.vf&&a--,this.level&&this.level.hasFrag)return this.level.fragments[a]}}])}(),Ui="multipart",vb=function(v){function _(e){var t;return(t=v.call(this)||this).Ai=void 0,t.pb=void 0,t.Do=void 0,t.Ci=void 0,t.mb=void 0,t.gb=void 0,t.yb=void 0,t._b=void 0,t.Cb=!1,t.Ib=void 0,t.Ob=void 0,t.wb=!1,t.Eb=0,t.jb=function(c){t.pb&&t.pb.onDownload(c),t.mb&&t.Do.config.videoEnabled!==!1&&(t.gb&&t.kb(t.mb,t.gb),t.Ob&&t.kb(t.mb,t.Ob))},t.Mb=function(c){t.gb&&t.gb.seek(c.startSec,!1,!1)},t.kd=function(){t.Ci.i(Ui,"on manifest loaded");var c=t.Do,u=c.lctx;if(c.stat.avSeparated=!!c.lctx.audioTracks.length,t.Ci.i(Ui,"manifest loaded. av separated: "+c.stat.avSeparated),u.audioTracks&&u.audioTracks.length&&(t.gb=new Kh(h.f.AUDIO,t.Ai,c,u.audioIdx)),u.subtitleTracks&&u.subtitleTracks.length&&Wh&&(t.Ob||(t.Ob=new Wh(t.Ai,c)),t.Sb()),u.levels.length>0){var g=0;t.Ci.i(Ui,"manifest",u.abr,u.default),g=t.pb&&u.abr?t.pb.init()||0:u.default,t.mb=new Kh(h.f.MAIN,t.Ai,c,g),t.Ai.emit(D.a.MANIFEST_PARSED,{levels:[],currentLevel:0}),t.pb&&t.Do.lctx.abr&&t.mb.setIndex(t.pb.abrInitLevel),t.Cb=!0;var R,Q=c.lctx.current;if(!Q)return;if(Q.hasFrag){if(c.stat.isLive=Q.live,t.Bb(Q),t.Tb(Q),t.Db(h.f.MAIN),Q.live){var se=O(null,Q,0);t.yb=setTimeout(function(fe){return t.Rb(fe,h.f.MAIN)},se,t.mb.index)}}else t.Rb(c.lctx.currentIdx,h.f.MAIN);t.gb&&c.lctx.audioTracks.length&&((R=c.lctx.audio)!=null&&R.hasFrag?(t.Db(h.f.AUDIO),Q.live&&t.Rb(c.lctx.audioIdx,h.f.AUDIO)):t.Rb(c.lctx.audioIdx,h.f.AUDIO))}else u.levels.length?t.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.MANIFEST_PARSING_ERROR,"manifest parsing error. core: mse mulitpart.")):t.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.UNSUPPORTED,"no supported codec"))},t.Lb=function(c){t.Nb(c,h.f.AUDIO)},t.Qb=function(c){t.Nb(c,h.f.SUBTITLE)},t.Nb=function(c,u){u===void 0&&(u=h.f.MAIN),t.Ci.i(Ui,"on level loaded. type: "+u+" level: "+c.level);var g=c.level,R=t.Do,Q=t.xb(u);if(Q&&Q.level&&g===Q.index){var se=Q.level,fe=c.details;if((u===h.f.MAIN&&R.stat.isLive===void 0||R.stat.isLive&&!fe.live)&&(R.stat.isLive=fe.live),R.stat.isLive){var xe=O(se,c.details,c.stats?c.stats.trequest:0);if(se.hasFrag)if(fe.endSN!==se.endSN)x(t.Ci,se,fe,R.stat.liveShiftType),t.Db(u,fe.startSN),t.Eb=0;else{if(t.Ci.i(Ui,"level no update. retry: "+t.Eb+"/"+R.config.levelNoUpdateRetry),t.Eb>=R.config.levelNoUpdateRetry)return void t.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.LEVEL_NO_UPDATE_ERROR,t.Do.stat.box+" level no update retry: "+t.Eb+"/"+R.config.levelNoUpdateRetry));t.Eb++}else t.Bb(fe),x(t.Ci,se,fe,R.stat.liveShiftType),t.Tb(se),t.Db(u,fe.startSN);t.Ci.v("live playlist, reload in "+Math.round(xe)+" ms"),R.isLiveShiftKwai2?t.Vb(Q,xe):t.Ub(u,Q.index,xe)}else t.Fb(),x(t.Ci,se,fe,R.stat.liveShiftType),t.Db(u,fe.startSN)}},t.Vb=function(c,u){if(c||(c=t.xb(h.f.MAIN)),c){var g=t.Do.getKwai2LiveShiftReloadInterval();(typeof g!="number"||g<=0)&&(g=typeof u!="number"||u<=0?O(null,c.level,null):u),t.Ci.i(Ui,"load level delay: "+g+" default: "+u),t.Ub(h.f.MAIN,c.index,g)}},t.Ub=function(c,u,g){t.Fb(),t.yb=setTimeout(function(R){return t.Rb(R,c)},g,u)},t.Db=function(c,u){c===void 0&&(c=h.f.MAIN),u===void 0&&(u=0);var g=t.xb(c),R=t.Do,Q=R.stat;if(g&&g.level&&g.level.hasFrag){g.setDownloadEnabled(!0,!1);var se=g.level.getTimeInfoAfter(u);if(c===h.f.MAIN){if(R.isLiveShiftKwai2&&typeof R.stat.liveShiftOffset=="number"){var fe=R.lctx.current.fragments,xe=R.getLiveShiftKwai2OffsetUTC(R.stat.liveShiftOffset);if(Q.liveShiftKwai2Params.paramName==="offset"&&fe.length)for(var Fe=function($e){var vt=fe[$e],dt=vt.programDateTime;if(dt&&Q.liveShiftOffset&&xe>=dt&&xe<=dt+1e3*vt.duration){if(Q.liveShiftOffsetAligned=Q.liveShiftOffset-(xe-dt),t.Ci.i(Ui,"liveshift kwai2. align offset: "+Q.liveShiftOffset+" -> "+Q.liveShiftOffsetAligned+", i: "+$e+"/"+fe.length),($e=Math.min($e,fe.length-2))>0){var Dt=fe[0];fe.forEach(function(Ei){Ei.start-=Dt.start})}return Ne=$e,1}Ne=$e},Ne=0;Ne<fe.length&&!Fe(Ne);Ne++);}c===h.f.MAIN&&(Q.liveShiftKwai2Params.paramName="seqId"),t.Ai.emit(D.a.LEVEL_UPDATED,se)}else c===h.f.AUDIO&&t.Ai.emit(D.a.AUDIO_TRACK_UPDATED,se);var He=!g.level.live||R.isLiveShift,rt=He&&Q.startFromSec>=0;g.levelUpdated(!rt),He&&(t.Ci.i(Ui,"start from "+Q.startFromSec+" on level update"),rt&&t.seek(Q.startFromSec,t._b,!1,!0),c===h.f.SUBTITLE&&g.seek(R.currentTime))}},t.Pb=function(c){if(t.pb&&t.Do.lctx.abr&&t.mb){var u=t.pb.nextBitrateIndex();u>=0&&u!==t.Do.lctx.currentIdx&&(t.Ai.emit(D.a.LEVEL_SWITCHING,{id:0,time:c.startSec,level:u,smooth:!0,auto:!0}),t.setNextLevel(u))}},t.kb=function(c,u){var g=c.lastLoadedFrag,R=u.lastLoadedFrag;g?R&&(R.start+R.duration>g.start+g.duration-.5?u.setDownloadEnabled(!1):u.setDownloadEnabled(!0)):u.setDownloadEnabled(!0)},t.xb=function(c){return c===void 0&&(c=h.f.MAIN),c===h.f.MAIN?t.mb:c===h.f.AUDIO?t.gb:t.Ob},t.Hb=function(c){return c===void 0&&(c=h.f.MAIN),c===h.f.MAIN?t.Do.lctx.levels:c===h.f.AUDIO?t.Do.lctx.audioTracks:t.Do.lctx.subtitleTracks},t.Ai=e.evt,t.Do=e,t.Ci=e.logger,t._b=e.config.startFromKeyframe,t.Yb(),t.O.push(e.fallback.register(le.USE_BACKUP_MULTIPART,new y(e).setRetryFunc(t.nextBackup.bind(t)))),t}T()(_,v);var a=_.prototype;return a.Yb=function(){var e=this,t=this.Ai;this.O.push(t.prependListener(D.a.RATE_CHANGE,function(){e.Do.isLiveShiftKwai2&&(e.Ci.i(Ui,"liveshift kwai2 reload Interval change by playback rate change."),e.Vb())}),t.prependListener(D.a.DOWNLOAD,this.jb),t.prependListener(D.a.BUFFER_CLEANING,this.Mb),t.prependListener(D.a.MANIFEST_LOADED,this.kd),t.prependListener(D.a.LEVEL_LOADED,this.Nb),t.prependListener(D.a.AUDIO_TRACK_LOADED,this.Lb),t.prependListener(D.a.SUBTITLE_TRACK_LOADED,this.Qb),t.prependListener(D.a.ABR_NEXT,this.Pb),t.prependListener(D.a.NEW_SOURCE,function(){var c;(c=e.pb)==null||c.onNewSource()}))},a.init=function(){this.Gb();var e=pb[this.Do.stat.box||h.i.hls];e?this.Ib=new e(this.Do):this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.UNSUPPORTED,"unsupported box: "+this.Do.stat.box))},a.destroy=function(){this.Ib&&(this.Ib.destroy(),this.Ib=void 0),this.Fb(),this.mb&&(this.mb.destroy(),this.mb=void 0),this.gb&&(this.gb.destroy(),this.gb=void 0),this.pb&&(this.pb.destory(),this.pb=void 0),v.prototype.destroy.call(this)},a.loadSource=function(){this.Ci.i(Ui,"load source"),this.Ib&&this.Ib.loadManifest()},a.setDownloadEnabled=function(e){e===void 0&&(e=!0),this.Do.stat.isNetworkInUse=e,this.mb&&this.mb.setDownloadEnabled(e),this.pb&&this.pb.setDownloadEnabled(e)},a.isSeekable=function(){return!this.Do.stat.isLive||this.Do.stat.liveShiftType!==h.g.NONE},a.seek=function(e,t,c,u){t===void 0&&(t=!1),c===void 0&&(c=!1),u===void 0&&(u=!1),this.Ci.i(Ui,"seek time: "+e+" key: "+t+" inbuf: "+c),this.pb&&this.pb.onSeek({isInBuffer:c});var g=this.Do,R=g.stat;if(c){var Q=this.xb(h.f.MAIN);g.isLiveShiftKwai2&&(this.Ci.i(Ui,"liveshift kwai2 reload Interval change by seek."),this.Vb(Q))}if(!c&&this.mb){if(this.mb.level&&this.mb.level.hasFrag){if(this.Ci.i(Ui,"seek: "+e+"."),!this.gb)return g.isLiveShiftKwai2&&!_t(e-(R.liveShiftOffset||0)/1e3,this.mb.level.fragments)&&!u?(this.Kb(e),void this.Rb(this.Do.lctx.currentIdx,h.f.MAIN)):(this.mb.seek(e,t),this.Ob&&this.Ob.seek(e),void(R.startFromSec=-1));if(this.gb.level&&this.gb.level.hasFrag&&!this.gb.level.live){var se=this.mb.seek(e,t);return this.gb.seek(se,!1,!1),this.Ob&&this.Ob.seek(se),void(R.startFromSec=-1)}}this.Ci.i(Ui,"no frag. startFromSec: "+e),R.startFromSec=e,this._b=t}},a.nextBackup=function(){if(this.mb){var e=this.mb.nextBackup();if(this.gb&&e&&(e=this.gb.nextBackup()),e)return this.mb.setDownloadEnabled(!1),this._b=!1,this.Rb(this.Do.lctx.currentIdx,h.f.MAIN),this.gb&&(this.gb.setDownloadEnabled(!1),this.Rb(this.Do.lctx.audioIdx,h.f.AUDIO)),!0}return!1},a.onAbrLevelsUpdated=function(){this.pb&&this.pb.onAbrLevelsUpdated()},a.setAudioTrack=function(e){var t;this.gb&&(e=Math.min(e,this.gb.levels.length-1),this.gb.setIndex(e),this.Cb&&((t=this.Do.video)!=null&&t.ended||this.seek(this.Do.currentTime),this.Zb(e,h.f.AUDIO),this.Ai.emit(D.a.AUDIO_TRACK_SWITCHING,{id:0,time:this.Do.currentTime,level:e,smooth:!1,auto:!1})))},a.setSubtitleTrack=function(e){this.Ob&&(e=Math.min(e,this.Ob.levels.length-1),this.Ob.setIndex(e),this.Cb&&e>=0&&(this.Zb(e,h.f.SUBTITLE)||this.Ob.seek(this.Do.currentTime)))},a.Rb=function(e,t){var c=this.Hb(t);if(this.Ci.i(Ui,"load level: "+e+" "+t),c.length){var u=c[e];u&&typeof u=="object"&&u.url.length>0&&this.Ib&&be(this.Do.stat.box)?this.Ib.loadLevel(u,t,e):this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.UNSUPPORTED,"unsupported. "+this.Do.stat.box+" has no level manifest."))}},a.Fb=function(){this.yb!==void 0&&(clearTimeout(this.yb),this.yb=void 0)},a.Gb=function(){this.Do.config.adaptive&&!this.pb&&(this.pb=new Di(this.Do))},a.setCurrentLevel=function(e){var t,c;e>=0?(this.Wb(!1),this.mb&&(e=Math.min(e,this.mb.levels.length-1),this.Kb(this.Do.currentTime),this.mb.setIndex(e),this.Ci.i(Ui,"setCurrentLevel: "+e+" manifest: "+this.Cb+" video ended:"+((t=this.Do.video)==null?void 0:t.ended)+", currentTime:"+this.Do.currentTime),this.Cb&&((c=this.Do.video)!=null&&c.ended||this.seek(this.Do.currentTime),this.Zb(e),this.Ai.emit(D.a.LEVEL_SWITCHING,{id:0,time:this.Do.currentTime,level:e,smooth:!1,auto:!1})))):this.Wb(!0)},a.setManualNextLevel=function(e){var t;this.Wb(e<0),this.Cb?(t=this.mb)!=null&&t.level&&this.mb.level.hasFrag&&e>=0&&(e=Math.min(e,this.mb.levels.length-1),this.mb.manualNext=e,this.Zb(e)||this.setDownloadEnabled(!0)):this.setCurrentLevel(e)},a.setNextLevel=function(e){this.mb&&this.Do.lctx.nextIdx!==e&&(this.mb.setNext(e),this.Zb(e))},a.Kb=function(e){if(this.Do.isLiveShiftKwai2){var t,c=this.Do,u=c.stat;c.lctx.clearFrag(),(t=this.mb)==null||t.reset(),u.liveShiftKwai2Params.paramName="offset",u.liveShiftOffset=1e3*e,u.liveShiftOffsetAligned=void 0,u.startFromSec=e,this.Eb=0,this.Ci.i(Ui,"liveshift kwai2 reset",e)}},a.Zb=function(e,t){t===void 0&&(t=h.f.MAIN);var c=this.xb(t),u=c==null?void 0:c.levels[e];return!(!u||u.hasFrag&&!u.live)&&(c.setDownloadEnabled(!1),this.Rb(e,t),!0)},a.Wb=function(e){this.pb&&(e&&!this.Do.lctx.abr&&this.Do.isAbrAvailable&&this.Ai.emit(D.a.LEVEL_SWITCHING,{id:0,time:this.Do.currentTime,level:-1,smooth:!0,auto:!1}),this.Do.lctx.abr=e&&this.Do.isAbrAvailable)},a.Sb=function(){if(!this.wb&&this.Ob){var e=this.Do.lctx.subtitle;e&&(e.hasFrag?this.Db(h.f.SUBTITLE):this.Rb(this.Do.lctx.subtitleIdx,h.f.SUBTITLE)),this.wb=!0}},a.Bb=function(e){if(this.Do.stat.isLive){var t=this.Do.config.liveDelayFragNum;if(t&&t>0&&!this.Do.config.autoPlaybackRateConf){var c=this.Do.getLiveDelay()/Ve.f;Ae(this.Ci,c,c/2,this.Do.stat.autoPlaybackRateConf,0)}}},a.Tb=function(e){var t=this.Do;if(!t.stat.isLive||t.isLiveShift){if(t.stat.isLive&&!t.isLiveShiftKwai2)if(t.stat.startFromSec<0&&e.totalduration){var c=t.liveLocalTime;t.stat.liveShiftType===h.g.KWAI&&(c+=e.targetduration+1),c>0&&(t.stat.startFromSec=c,this.Ci.i(Ui,"live delay startFromSec: "+t.stat.startFromSec),t.isLiveShift&&t.updateLiveShiftStatuByTime(t.stat.startFromSec))}else t.stat.startFromSec>=0&&t.isLiveShift&&t.updateLiveShiftStatuByTime(t.stat.startFromSec)}else t.stat.startFromSec=-1},m()(_,[{key:"audioTracks",get:function(){return this.gb?this.gb.levels:[]}}])}(F.a);function ac(v,_,a){if(_===void 0&&a===void 0)return v;var e=new ze.a(v,!0);return _&&e.query.kabr_spts===void 0&&(e.query.kabr_spts=""+Math.floor(_)),a===!0&&(e.query.onlyaudio="yes"),e.toString()}var Qi,sc,ia=n(15),Ar=function(v){return v[v.tagType=0]="tagType",v[v.tagSize=1]="tagSize",v[v.timestamp=2]="timestamp",v[v.frameType=3]="frameType",v[v.packetType=4]="packetType",v}(Ar||{}),Yh="flv-key-detector",gb=function(){function v(a){this.Do=void 0,this.Ci=void 0,this.Nl=0,this.Xb=void 0,this.zb=new Uint8Array(ia.e),this.Jb=0,this.qb=Ar.tagType,this.$b=0,this.tp=0,this.ep=0,this.np=0,this.sp=0,this.rp=0,this.hp=[],this.Do=a,this.Ci=a.logger,this.reset()}var _=v.prototype;return _.reset=function(){this.Ci.i(Yh,"reset"),this.Nl=ia.e,this.Xb=void 0,this.zb=new Uint8Array(ia.e),this.Jb=0,this.qb=Ar.tagType,this.$b=0,this.tp=3,this.ep=0,this.np=4,this.sp=0,this.rp=0,this.hp=[]},_.append=function(a){if(this.Xb===!1)return[];if(this.Xb===void 0&&(a.length+this.Jb>=ia.e?(this.zb.set(a.subarray(0,ia.e-this.Jb),this.Jb),this.Jb=ia.e,this.Xb=this.zb[0]===70&&this.zb[1]===76&&this.zb[2]===86,this.Ci.i(Yh,"get header: "+this.Xb)):(this.zb.set(a,this.Jb),this.Jb+=a.length)),this.Nl>a.byteLength)return this.Nl-=a.byteLength,[];this.hp=[];for(var e=this.Nl,t=0;e<a.byteLength;)switch(this.qb){case Ar.tagType:this.sp=a[e],this.$b=0,this.tp=3,t=e,e++,this.qb=Ar.tagSize;break;case Ar.tagSize:if(this.$b=this.$b+(a[e]<<8*(this.tp-1)),this.tp--,e++,this.tp>0)break;this.sp===ia.j.VIDEO?(this.ep=0,this.np=4,this.qb=Ar.timestamp):(e+=7+this.$b+4,this.qb=Ar.tagType);break;case Ar.timestamp:this.ep+=this.np===1?a[e]<<24:a[e]<<8*(this.np-2),this.np--,e++,this.np===0&&(e+=3,this.rp=0,this.qb=Ar.frameType);break;case Ar.frameType:this.rp=a[e]>>4,e++,this.qb=Ar.packetType;break;case Ar.packetType:this.rp===1&&a[e]===1&&this.hp.push({timestamp:this.ep,pos:t}),e+=this.$b-1+4,this.qb=Ar.tagType}return this.Nl=e-a.byteLength,this.hp},m()(v,[{key:"isFlv",get:function(){return this.Xb}},{key:"header",get:function(){return this.Xb?this.zb:void 0}}])}(),mb=n(46),oc=n(4),Qh=function(v){return v[v.flvHeader=0]="flvHeader",v[v.scriptData=1]="scriptData",v[v.audio=2]="audio",v[v.video=3]="video",v[v.seliceSeq=4]="seliceSeq",v}(Qh||{}),Gs="kwai-slice",bb=function(){function v(a){this.Ci=void 0,this._t=new tc.a,this.op=[],this.Wv=this.ap(),this.up=0,this.Ci=a}var _=v.prototype;return _.reset=function(){this.Ci.i(Gs,"reset"),this._t.clear(),this.op=[],this.Wv=this.ap(),this.up=0},_.append=function(a){for(this._t.put(new Uint8Array(a));this._t.unreadLen>=(this.Wv.bodyLen||15);)this.Wv.bodyLen?this.cp():this.fp();var e=this.op.reduce(function(u,g){var R;return(((R=g.data)==null?void 0:R.byteLength)||0)+u},0);if(e){var t=new Uint8Array(e),c=0;return this.op.forEach(function(u){u.data&&(t.set(u.data,c),c+=u.data.byteLength)}),this.op=[],t.buffer}},_.fp=function(){if(this._t.unreadLen>=15){var a=this._t.get(15);if(!a)throw new Error(Gs+" read slice_header fail");var e=this.Wv;if(e.bodyLen=(a[0]<<4)+(a[1]>>4)-15,e.type=15&a[1],e.sliceSeq=Object(oc.i)(a,2),e.segmentId=Object(oc.h)(a,10),e.posFlag=a[14]>>6,e.frameType=a[14]>>4&3,e.extended=1&a[14],e.bodyLen<=0)throw this.Wv=this.ap(),new Error(Gs+" slice body len: "+e.bodyLen)}},_.cp=function(){var a=this.Wv;if(a.bodyLen&&this._t.unreadLen>=a.bodyLen){var e=this._t.get(a.bodyLen);if(!e)throw new Error(Gs+" read slice_body fail");var t=0;a.extended&&(t+=Object(oc.f)(e));var c=e.subarray(t);e.length>3&&e[t]===70&&e[t+1]===76&&e[t+2]===86&&(this.up>0&&(c=c.subarray(13)),this.up++),a.data=c,this.op.push(a),this.Wv=this.ap()}},_.ap=function(){return{bodyLen:0,type:Qh.flvHeader,sliceSeq:0,segmentId:0,posFlag:0,frameType:0,extended:0}},v}(),Nn="media-loader",Eb=function(){function v(a,e){var t=this;this.bl=void 0,this.Do=void 0,this.Ci=void 0,this.wc=void 0,this.Ap=0,this.vf=void 0,this.vp=void 0,this.YA=void 0,this.dp=void 0,this.wl=!1,this.Nl=void 0,this.lp=0,this.bp=!0,this.pp=0,this.mp=!1,this.gp=!1,this.yp=Ve.e,this._p=function(c,u){t.bl.onLoad&&t.bl.onLoad(c,u)},this.Cp=function(c,u){t.Ip(u),!t.mp&&t.bl.onConnect&&t.bl.onConnect(c,u),t.mp=!0},this.Op=function(c,u,g){if(typeof u!="string"){var R;t.pp+=u.byteLength,!c.rangeEnd&&t.pp>=t.yp&&t.Do.stat.isLive===!1&&(!t.Ap||t.Ap&&t.pp<t.Ap)&&((R=t.vf)==null||R.abort(),t.Lf(),t.lp=t.pp,t.wp()),t.Ep(c,u,g)}},this.jp=function(c,u){t.bl.onAbort&&t.bl.onAbort(c,u),t.Lf()},this.Yf=function(c,u){u.fatal&&(t.Lf(),t.Do.stat.isNetworkInUse=!1),c.preferNative&&t.Do.stat.preferNativeLoader===void 0&&(t.Ci.i(Nn,"load error. prefer native loader."),t.Do.stat.preferNativeLoader=!0),u.code===416&&(!t.Ap||c.rangeEnd&&c.rangeEnd>=t.Ap)?(t.Ci.i(Nn,"416 end"),t.wl=!0,t.Lf(),t.kp(c,null,u)):t.bl.onError&&t.bl.onError(c,u)},this.pl=function(c,u,g){if(c.range&&t.bl.onRangeEnd&&t.bl.onRangeEnd(c,g),t.Ip(g),t.Lf(),typeof u!="string"){var R=(u==null?void 0:u.byteLength)||0;!t.Do.stat.isLive&&u&&t.Ep(c,u,g),(!c.range||typeof c.rangeStart=="number"&&c.rangeEnd&&c.rangeEnd-c.rangeStart>t.pp+R||t.Ap&&c.rangeEnd&&c.rangeEnd>=t.Ap)&&(t.Ci.i(Nn,"end true"),t.wl=!0),t.wl||t.Do.stat.isLive?(g.fatal&&(t.Do.stat.isNetworkInUse=!1),t.kp(c,null,g)):(c.rangeEnd&&(t.lp=c.rangeEnd),t.wp())}},this.bl=a,this.Do=e,this.Ci=e.logger,this.vp={onLoad:this._p,onConnect:this.Cp,onEnd:this.pl,onError:this.Yf,onAbort:this.jp,onProgress:this.Op},this.YA={connectionTimeout:e.config.connectionTimeout,transmissionTimeout:e.config.transmissionTimeout},e.stat.box===h.i.yuv&&e.yuvParams?this.yp=e.yuvParams.dataSize:this.yp=this.Do.src instanceof Blob?Ve.c:Ve.e,this.Do.src instanceof Blob&&(this.Do.loadRec.contentLen=this.Ap=this.Do.src.size),X.a.version&&(this.gp=X.a.name==="chrome"&&X.a.version.major>=99),this.Ci.i(Nn,"without preflight: "+this.gp+"; range size: "+this.yp,this.Ap),this.updateConfig()}var _=v.prototype;return _.load=function(a){this.Ci.i(Nn,"load"),this.Lf(),this.mp=!1,this.wl=!1,this.wc=a,qe(a.url)||a.fileName&&qe(a.fileName)?(this.Ci.i(Nn,"kwai slice"),this.Do.stat.isKwaiSlice=!0,this.dp?this.dp.reset():this.dp=new bb(this.Ci)):this.Do.stat.isKwaiSlice=!1,this.wc.progress=this.Do.streamingMux,this.wc.responseType="arraybuffer",this.wc.credentials=this.Do.config.credentials,this.wc.headers=this.Do.config.headers,this.wp()},_.seek=function(a){var e;this.Ci.i(Nn,"seek time:"+a.time+", pos:"+a.position),(e=this.vf)==null||e.abort(),this.Lf(),this.bp=!0,this.Nl=a,this.wl=!1,this.wp()},_.updateConfig=function(){var a=this.Do;this.Ci.i(Nn,"update loader config"),this.YA.maxRetry=a.stat.isLive?0:a.config.maxRetry,this.YA.retryDelay=a.stat.isLive?0:a.config.retryDelay,this.YA.breakpointContinuation=!(a.stat.box===h.i.flv&&a.stat.isLive)&&a.config.breakpointContinuation},_.destroy=function(){this.Lf()},_.ended=function(){return this.wl},_.setDownloadEnabled=function(a){a===void 0&&(a=!0),this.bp!==a&&(this.bp=a,a&&!this.vf&&this.wp())},_.wp=function(){var a;if(this.bp!==!1&&!this.wl&&this.wc)if(this.Lf(),this.Nl&&(this.lp=this.Nl.position,this.wc.frag&&(this.wc.frag.start=this.Nl.time),this.Nl=void 0),this.Ap&&this.lp>=this.Ap)this.Do.stat.isNetworkInUse=!1;else{var e,t=this.wc;this.Do.stat.isLive||(this.wc.progress=this.Do.streamingMux,t.rangeStart=this.lp,t.rangeEnd=(Math.floor(this.lp/this.yp)+1)*this.yp,t.rangeType=this.Do.config.httpRangeType,this.Gf(t)),this.Do.stat.isNetworkInUse=!0,this.pp=0,(a=this.Do.config.preprocessUrl)!=null&&a.stream&&(this.Ci.d(Nn,"preprocessUrl stream"),t.url=(e=this.Do.config.preprocessUrl)==null?void 0:e.stream(t.url)),this.vf=new nt(this.Ci),this.vf.load(t,this.vp,this.YA)}else this.Do.stat.isNetworkInUse=!1},_.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},_.Ep=function(a,e,t){if(this.bl.onProgress)if(this.Do.stat.isKwaiSlice){var c=this.Mp(a,e,t);c&&this.bl.onProgress(a,c,t)}else this.bl.onProgress(a,e,t)},_.kp=function(a,e,t){if(this.Do.stat.isKwaiSlice&&e){var c=this.Mp(a,e,t)||null;this.bl.onEnd(a,c,t)}else this.bl.onEnd(a,e,t)},_.Mp=function(a,e,t){if(this.Do.stat.isKwaiSlice&&this.dp)try{return this.dp.append(new Uint8Array(e))}catch(c){t.fatal=!0,t.errName=w.b.SLICE_UNPACK_ERROR_NAME,t.errMessage=c.message,this.bl.onError&&this.bl.onError(a,t)}},_.Gf=function(a){a.rangeEnd&&this.Ap&&a.rangeEnd>this.Ap&&(this.wl=!0)},_.Ip=function(a){!this.Ap&&a.contentTotalLength&&(this.Do.loadRec.contentLen=this.Ap=a.contentTotalLength)},v}(),yb=function(){function v(a){var e=this;this.Ci=void 0,this.wc=void 0,this.an=void 0,this.bl=void 0,this.vf=void 0,this.Sp=void 0,this.Bp=void 0,this.yb=void 0,this.Tp=0,this.Dp=function(){e.Rf(),e.vf&&e.vf.destroy(),e.wc&&e.an&&e.bl&&(e.an.firstPackageDuration=Math.round(e.an.firstPackageDuration),e.an.duration=Math.round(performance.now()-e.Tp),e.bl.onEnd(e.wc,e.an))},this.Mc=function(t,c,u){e.an&&(e.an.firstPackageDuration=u.tfirst?u.tfirst-u.trequest:0,e.an.loaded=u.loaded)},this.Yf=function(){e.an&&(e.an.succeeded=!1),e.Dp()},this.pl=function(){e.Dp()},this.Ci=a,this.Sp={connectionTimeout:0,transmissionTimeout:0,maxRetry:0,retryDelay:0},this.Bp={onProgress:this.Mc,onError:this.Yf,onEnd:this.pl}}var _=v.prototype;return _.start=function(a,e){this.wc=a,this.bl=e,this.an={loaded:0,duration:0,firstPackageDuration:0,succeeded:!0},this.Tp=performance.now(),this.vf&&this.vf.destroy();var t=Math.min(1e4,a.timeout);this.Sp.connectionTimeout=t;var c={url:a.url,progress:!0,responseType:"arraybuffer",preferNative:a.preferNativeLoader};this.vf=new nt(this.Ci),this.Rp(t),this.vf.load(c,this.Bp,this.Sp)},_.cancel=function(){this.Rf(),this.vf&&this.vf.destroy()},_.destroy=function(){this.cancel()},_.Rp=function(a){var e=this;this.yb=setTimeout(function(){return e.Dp()},a)},_.Rf=function(){clearTimeout(this.yb)},v}(),sn="algorithm-simple",Cb={stableBufferDiffThresholdSecond:.15,stableBufferIntervalMs:2e3,speedTestTimeoutMs:500,generateSpeedGapMs:3e3,bufferCheckIntervalMs:500,smoothedSpeedUtilizationRatio:.8,smallSpeedToBitrateRatio:.7,enoughSpeedToBitrateRatio:.9,bufferLowerLimitSecond:.8,recentBufferedSize:16,smoothedSpeedRatio:.9,isSpeedFullyUsed:!1},Tb=function(){function v(a){this.Do=void 0,this.Ci=void 0,this.Fi=void 0,this.Lp=void 0,this.Ll=void 0,this.Wv=0,this.Np=0,this.Qp=performance.now(),this.xp=void 0,this.Vp=0,this.Up=0,this.Fp=0,this.yb=void 0,this.Do=a,this.Ci=a.logger,this.xp=new yb(a.logger)}var _=v.prototype;return _.init=function(a){var e=this;this.Fi=s()({},Cb),s()(this.Fi,a),this.Ci.i(sn,"init",a,this.Fi),this.Lp=[0],this.yb=setInterval(function(){e.Pp()},this.Fi.bufferCheckIntervalMs)},_.onManifestUpdated=function(){this.Ll=this.Do.lctx.abrLevels.slice(0),this.Np=this.Do.lctx.abrDefault},_.onKeyPoint=function(a){var e=a.byteLength/Math.max(a.spendTime,.05)*8/1024;this.Ci.i(sn,"buffered: "+a.byteLength.toFixed(2)+", size: "+a.byteLength+", time: "+a.spendTime.toFixed(2)),this.Np=this._d(e,a.buffered)},_.onLevelLoad=function(a){this.Wv=Math.max(0,a)},_.onSeek=function(){},_.onDownloadEnabled=function(){},_.destroy=function(){this.xp.destroy(),clearInterval(this.yb)},_.Hp=function(a){var e=a-this.Up,t=e/a,c=performance.now();return(e<-this.Fi.stableBufferDiffThresholdSecond||t<-.2)&&(this.Ci.v(sn,"bufferDiffDown: "+e.toFixed(2)+"s, diffRatio: "+t.toFixed(2)),this.Qp=Math.max(c,this.Qp)),e>this.Fi.stableBufferDiffThresholdSecond&&c-this.Qp+this.Fi.bufferCheckIntervalMs>this.Fi.stableBufferIntervalMs&&(this.Qp=Math.max(c-2*this.Fi.bufferCheckIntervalMs,this.Qp+2*this.Fi.bufferCheckIntervalMs),this.Ci.v(sn,"bufferDiffUp: "+e.toFixed(2)+"s")),this.Up=a,c-this.Qp>this.Fi.stableBufferIntervalMs},_.Yp=function(){return this.Fi.isSpeedFullyUsed},_.Pp=function(){var a=this.Do.bufferedSec,e=this.Hp(a);if(this.Yp()){var t=this.Ll[this.Wv+1];this.Vp=e&&t?t.bitrate:0}else e&&this.Wv+1<this.Ll.length&&this.Do.lctx.abr&&this.Do.config.abrSpeedTest&&(this.Gp(),this.Qp=performance.now()+this.Fi.generateSpeedGapMs);this.Lp.push(a),this.Lp.length>this.Fi.recentBufferedSize&&this.Lp.shift()},_.Gp=function(){var a=this;this.Ci.v(sn,"start speed testing on index: "+(this.Wv+1));var e=this.Ll[this.Wv+1];if(e){var t=e.currentUrl,c=this.Do.loadRec.traffic,u=e.bitrate;this.xp.start({url:t,timeout:this.Fi.speedTestTimeoutMs,preferNativeLoader:this.Fi.preferNativeLoader},{onEnd:function(g,R){var Q=a.Do.loadRec.traffic-c;if(R.succeeded&&R.duration>0&&R.firstPackageDuration>0){var se=8*(Q+R.loaded)/R.duration;a.Ci.v(sn,"testSpeed: "+se.toFixed(0)),se>=u&&(a.Vp=u)}a.Ci.v(sn,"succeeded: "+R.succeeded+", firstPackageDuration: "+R.firstPackageDuration+", originalDownloadSize: "+Q+", downloadSize: "+R.loaded+", downloadTime: "+R.duration)}})}},_.Kp=function(a){for(var e=0,t=this.Ll.length-1;t>=0;t--)if(a>=this.Ll[t].bitrate){e=t;break}return e},_._d=function(a,e){var t=this.Od(a,e);return t!=this.Wv&&(this.Qp=performance.now()+this.Fi.generateSpeedGapMs),t<this.Wv?(this.xp.cancel(),this.Vp=0,this.Fp=a,this.Lp=[e]):this.Fp=this.Zp(a),t},_.Zp=function(a){return this.Fp>0?a*(1-this.Fi.smoothedSpeedRatio)+this.Fp*this.Fi.smoothedSpeedRatio:a},_.Wp=function(a){return a+(a-Math.max.apply(Math,this.Lp))},_.Xp=function(a){var e=Math.max.apply(Math,this.Lp),t=1+(a-e)/e,c=this.Ll[this.Wv];return c?t*c.bitrate:0},_.zp=function(a){var e=this.Ll[this.Wv];return!!e&&a/e.bitrate<this.Fi.smallSpeedToBitrateRatio},_.Jp=function(a){var e=this.Ll[this.Wv];return!!e&&a/e.bitrate>this.Fi.enoughSpeedToBitrateRatio},_.Od=function(a,e){var t=this.Xp(e),c=this.Zp(a);this.Ci.v(sn,"gopSpeed: "+a.toFixed(0)+", smoothedSpeed: "+c.toFixed(0));var u=this.Wp(e);this.Ci.v(sn,"bufferSpeed: "+t.toFixed(0)+", predictedBuffered: "+u.toFixed(1));var g=this.Wv;return u<this.Fi.bufferLowerLimitSecond||this.zp(t)?g=Math.min(this.Wv,this.Kp(t)):this.Jp(t)&&(this.Vp>0?(this.Ci.i(sn,"generatedSpeed used"),g=this.Kp(this.Vp),this.Vp=0):g=this.Kp(c*this.Fi.smoothedSpeedUtilizationRatio),g=Math.min(this.Wv+1,Math.max(g,this.Wv))),g},m()(v,[{key:"nextLevel",get:function(){return this.Ci.v(sn,"nextLevel: "+this.Np),this.Np}},{key:"lowProfile",get:function(){return!1}}])}(),$h="single-abr",Ib=function(){function v(a){this.Do=void 0,this.Ci=void 0,this.qp=void 0,this.$p=0,this.jd=0,this.tm=0,this.Ct=0,this.wd=void 0,this.Do=a,this.Ci=a.logger,a.lctx.abr=a.isAbrAvailable,this.wd=new Tb(a)}var _=v.prototype;return _.init=function(){return this.$p=0,this.jd=performance.now(),this.tm=0,this.wd.init(s()({preferNativeLoader:this.Do.stat.preferNativeLoader},this.Do.config.liveAdaptiveConfig)),this.wd.onManifestUpdated(),this.Do.lctx.levels.length&&(this.Do.lctx.abr?this.Ct=this.Do.lctx.abrIndexToOrign(this.wd.nextLevel):this.Ct=this.Do.lctx.default),this.Ct},_.destory=function(){this.wd&&this.wd.destroy()},_.onAbrLevelsUpdated=function(){this.wd.onManifestUpdated(),this.Ct=this.Do.lctx.abrIndexToOrign(this.wd.nextLevel)},_.onLoaderChunk=function(a){this.$p+=a},_.onLevelLoad=function(a){var e=this.Do.lctx;e.levels.length&&a>=0&&a<e.levels.length&&(this.tm=0,this.jd=performance.now(),this.$p=0,this.Ct=a,this.wd.onLevelLoad(e.orignIndexToAbr(a)))},_.onKeyFrame=function(a){var e=this.Do,t=e.lctx.levels;if(this.tm++,(e.lctx.abr||typeof this.qp=="number")&&this.tm>1&&t){var c=this.Ct,u=!1,g=performance.now();if(this.wd.onKeyPoint({buffered:e.bufferedSec,byteLength:this.$p,spendTime:(g-this.jd)/1e3}),this.$p=0,this.jd=g,typeof this.qp=="number")c=this.qp,this.qp=void 0;else{if(!e.lctx.abr||!this.wd)return;c=e.lctx.abrIndexToOrign(this.wd.nextLevel),u=!0}if(c!==this.Ct)return{url:this.getRequestUrl(c,a),level:c,auto:u}}},_.getRequestUrl=function(a,e){var t=this.Do.lctx.levels[a];if(t){var c=t.currentUrl;return this.Do.stat.box===h.i.flv?ac(c,e||this.Do.config.defaultSpts,this.Do.config.videoEnabled===!1):c}return""},m()(v,[{key:"nextLevel",get:function(){return typeof this.qp=="number"?this.qp:this.Ct},set:function(a){var e=this.Do.lctx;this.Ci.i($h,"next level: "+a),a>=0?(a=Math.min(e.levels.length-1,a),e.setNextIdx(a),e.abr=!1,this.qp=a):a===-1&&(e.abr=this.Do.isAbrAvailable)}},{key:"currentLevel",get:function(){return this.Ct},set:function(a){var e=this.Do.lctx;this.Ci.i($h,"current level: "+a),a>=0?(a=Math.min(e.levels.length-1,a),e.setLevelIdx(a),e.abr=!1,this.Ct=a):a===-1&&(e.abr=this.Do.isAbrAvailable)}}])}(),Xh=n(35),Rb=n(38),wb=n(24),Zh=n(28),Db=n(37),Lb=["mono","4:2:0","4:2:2","4:4:4"],Sb={colorRange:ri.b.AVCOL_RANGE_JPEG,colourPrimaries:ri.a.AVCOL_PRI_BT2020,transferCharacteristics:ri.d.AVCOL_TRC_SMPTEST2084,matrixCoefficients:ri.c.AVCOL_SPC_BT2020_CL},qh=function(){function v(a,e,t){this.At=void 0,this.Ai=void 0,this.im=void 0,this.Do=void 0,this.Ci=void 0,this._t=new tc.a,this.wl=!1,this.Hh=-1,this.nm=0,this.De=void 0,this.Ve=!0,this.Mi=void 0,this.Ne=void 0,this.Qe=void 0,this.Ph=!1,this.Yh=!1,this.Ah=0,this.sm=void 0,this.If=0,this.rm=0,this.hm=void 0,this.Vn=0,this.At=t,this.Ai=a,this.Do=e,this.Ci=e.logger,this.Qe=new Db.a(e.logger),this.im=new Zh.a,this.De=new pi.b(e.logger,this.Ai,e.getRemuxConfig(),ht.TYPE_SUPPORTED,"")}var _=v.prototype;return _.init=function(){var a;this.Ai.emit(D.a.DEMUXER_DETECTED,{type:_e.b.YUV}),(a=this.Do.cOutput)==null||a.updateRendererType(h.s.canvas),this.He(0)},_.destroy=function(){this._t.clear(),this.im.removeAllListeners(),this.De.destroy()},_.reset=function(a){this.Ci.i("yuv","reset: "+a),this.wl=!1,this.Hh=-1,this.Qe&&this.Qe.reset(),this.Ve=!1},_.end=function(){this.wl||(this.wl=!0,this.Ai.emit(D.a.LOAD_END,{}))},_.onFragProgress=function(a){this.om(a,!1)},_.onFragLoaded=function(a){this.om(a,!0)},_.updateConfig=function(){},_.updateSuffix=function(){},_.om=function(a,e){if(a.data&&a.data.byteLength){var t=performance.now(),c={progress:a.context.progress,byteLength:a.data.byteLength,timeCost:performance.now()-(this.If||a.stats.trequest),ts:performance.now()};this.If=t,this.Ai.emit(D.a.LOADER_CHUNK_ARRIVAL,c)}var u=a.context.frag,g=this.Mi;if(g)if(this.am(),this.sm){var R=this.sm;if(R){var Q=(u==null?void 0:u.start)||0;this.Hh!==Q?(this.nm=Math.floor(Q/(1/R.fps)),this.Hh=Q,this.Ph=!1,this.Yh=!1,this.De.resetInitSegment({duration:this.Vn,remuxId:0})):this.Yh=!0,a.data&&this._t.put(new Uint8Array(a.data)),g.codedWidth||(g.codedWidth=R.width,g.codedHeight=R.height,g.fps=R.fps,g.bitDepth=R.bpp,g.codecType=h.c.rawvideo);for(var se=this.um();se;){var fe=Math.floor(this.nm*this.Ah);se.format.pts=fe/g.inputTimescale*Ve.b,this.nm++,g.samples.push({units:[],dts:fe,cts:0,pts:fe,originDTS:fe,originPTS:fe,key:!0,yuv:se,duration:this.Ah,size:0}),this.rm++,se=this.um()}this.Do.updateVideoPlaybackQuality(this.rm,0),this.Ke(e),e&&(this.If=0,this.Vn||(this.Vn=this.nm/R.fps,this.Ai.emit(D.a.METADATA,{duration:this.Vn})))}}else this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.PARSING_ERROR,"yuv params error. "+JSON.stringify(this.sm)))},_.He=function(a){this.Mi=Object(Xh.b)(a),this.Mi.active=!0,this.Mi.outputRaw=!0,this.Mi.codec="yuv",this.Ne=Object(Xh.a)(a),wb.a.initAudioForFillSilent(this.Ci,this.Ne,this.Do.stat.audioCodec)},_.um=function(){if(this.sm){var a=this.sm.dataSize;if(a)return this._t.unreadLen>=a?this.fm():void 0;this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.REMUX_ERROR,"yuv params error, can not get img size. "+JSON.stringify(this.sm)))}},_.am=function(){if(!this.sm){var a;if(this.sm=this.Do.yuvParams,this.sm&&this.Mi){this.sm.bpp>8&&(this.Mi.colorInfo=Sb);var e={};if(this.Ah=Math.round(this.Mi.inputTimescale/this.sm.fps),this.Mi&&(this.Mi.chromaFormat=Lb[this.sm.chroma]||""),this.Do.loadRec.contentLen){this.hm=[];var t=Math.floor(this.Do.loadRec.contentLen/this.sm.dataSize);this.Vn=e.duration=t/this.sm.fps;for(var c=[],u=0;u<t;u++){var g=u*this.Ah/this.Mi.inputTimescale;this.hm.push({index:u,dts:g,pts:g,duration:this.Ah}),c.push({time:g,position:this.sm.dataSize*u})}e.keyframes=c}this.Ai.emit(D.a.METADATA,e),this.hm&&this.Ai.emit(D.a.VIDEO_FRAME_INFO,{videoFramesInfo:this.hm})}return this.Ai.emit(D.a.VIDEO_CODEC_DETECTED,{decoder:h.d.none,enabled:!0,codecType:h.c.yuv,bitDepth:(a=this.sm)==null?void 0:a.bpp,timeOffset:0}),this.sm}},_.fm=function(){var a=this.sm;if(a){var e=this._t,t=a.bpp>8?2:1,c=e.get(a.width*a.height*t),u=e.get(a.chromaWidth*a.chromaHeight*t),g=e.get(a.chromaWidth*a.chromaHeight*t);return c&&u&&g?{format:s()({},a),y:{bytes:c,stride:a.width*t,bits:a.bpp},u:{bytes:u,stride:a.chromaWidth*t,bits:a.bpp},v:{bytes:g,stride:a.chromaWidth*t,bits:a.bpp}}:void 0}},_.Ke=function(a){a===void 0&&(a=!1);var e=this.Ne,t=this.Mi;if(t&&e)if(this.Qe.update(e,t),e.samples.length!==0||t.samples.length!==0){if(a||!(e.active&&e.samples.length===0||t.active&&t.samples.length<2)){if(this.Ve&&(this.Vn||this.Ai.emit(D.a.KEY_FRAME_INDEXS,{keyframes:[{time:0,position:0}]}),this.Ve=!1,this.Ai.emit(D.a.MEDIA_DEMUX,{type:_e.b.YUV})),!this.hm){var c=Object(Rb.a)(t,this.nm-t.samples.length);this.Ai.emit(D.a.VIDEO_FRAME_INFO,{videoFramesInfo:c})}try{this.De.remux(e,t,this.Hh,this.Ph,this.Yh,a),this.Ph=!0}catch(u){this.Ci.i("yuv",u),this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.REMUX_ERROR,u.message))}}}else a&&this.De.flush()},m()(v,[{key:"totalDuration",set:function(a){}},{key:"id",get:function(){return this.At}}])}(),on="single",Ob=function(v){function _(e){var t;return(t=v.call(this)||this).Ai=void 0,t.Do=void 0,t.Ci=void 0,t.vf=void 0,t.Bp=void 0,t.Am=void 0,t.vm=0,t.No=!1,t.Gl=!1,t.dm=!1,t.lm=void 0,t.bm=void 0,t.pm=void 0,t.gm=!1,t.ym=!0,t._m=!1,t.Cm=!1,t.Im=!1,t.Om=!1,t.wm=!1,t.Il=void 0,t.Op=function(c,u,g){if(u instanceof ArrayBuffer){var R,Q,se;if(t.Am&&t.Am.onLoaderChunk(u.byteLength),t.lm&&t.lm.isFlv!==!1&&!t.Do.stat.flvAbrNotAligned){var fe=t.lm.append(new Uint8Array(u));if(t.Am&&t.Do.lctx.levels.length>1)for(var xe=0;xe<fe.length;xe++){var Fe=fe[xe];if(!Fe)break;if(t.Do.streamTime.localTimeOffset===void 0&&(t.Do.streamTime.localTimeOffset=Fe.timestamp/Ve.h),t.Am){if(t.Om){var Ne=(Q=c.url,new ze.a(Q,!0).query.kabr_spts);if(typeof Ne=="string"&&parseInt(Ne)>0&&Math.abs(parseInt(Ne)-Fe.timestamp)>Ve.g)return t.Ci.i(on,"keyframes not aligned req: "+Ne+" get: "+Fe.timestamp),t.Em(t.Am.currentLevel,!0),void(t.Do.stat.flvAbrNotAligned=!0)}if(R=t.Am.onKeyFrame(Fe.timestamp)){var He=new Uint8Array(Fe.pos);He.set(new Uint8Array(u).subarray(0,Fe.pos)),u=He.buffer;var rt={smooth:!0,auto:R.auto,id:0,time:t.vm||t.Do.currentTime,level:R.level};t.Ai.emit(D.a.LEVEL_SWITCHING,rt),t.vm=t.Do.streamTime.getLocalTime(Fe.timestamp/Ve.h)||0,R.auto&&(t.Om=!0);break}}}}t.gm&&((se=t.lm)!=null&&se.header&&(u=t.jm(u)),t.gm=!1);var $e={context:c,data:u,stats:g,remuxContiguous:t.Gl,discontinuity:t.dm,progress:!0};t.dm=!1,R?(t.Gl||(t.Gl=!0),t.Il.onFragLoaded($e),t.lm&&t.lm.reset(),t.RA(R.url,R.level)):t.Il.onFragProgress($e)}},t._p=function(c,u){u.retry&&t.Ai.emit(D.a.RETRY,{type:h.k.LOADER,core:h.a.mse,message:""+u.errMessage,code:Object(L.d)(L.a.LOAD_ERROR,u.errMessage,u.code)})},t.Cp=function(c,u){if(t.Do.stat.box===void 0||t.Do.stat.box===h.i.unknown){var g,R=(g=c.responseHeader)==null?void 0:g["content-type"];R&&(t.Do.stat.box=Jo(Array.isArray(R)?R[0]||"":R).box)}t.Cm=!(!u.contentLength&&!u.contentTotalLength),t.Ci.i(on,"on connect. contentLength: "+u.contentLength+" contentTotalLength: "+u.contentTotalLength),t.Ai.emit(D.a.MEDIA_CONNECTED,{headers:c.responseHeader}),t.jb(ut.CONNECTED,c,u)},t.jp=function(c,u){t.jb(ut.ABORT,c,u)},t.km=function(c,u){t.jb(ut.SUCCESS,c,u)},t.Yf=function(c,u){t.jb(ut.FAIL,c,u),u.fatal&&t.Ai.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.LOAD_ERROR,u.errMessage,{statusCode:u.code,url:c.url}))},t.pl=function(c,u,g){t.Do.config.flvLoadEndError&&t.Do.stat.isLive&&t.Do.stat.box===h.i.flv?t.Ai.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.LIVE_DISCONNECTED_ERROR,"flv live load end",{statusCode:g.code,url:c.url})):(t.Il.onFragLoaded({context:c,data:null,stats:g,remuxContiguous:!1,progress:!0}),t.jb(ut.SUCCESS,c,g),t.bm?t.Il.end():t._m=!0)},t.Mm=function(c){var u=t.Do.stat;t.bm=s()({},c),t.bm.keyframes&&(t.pm=t.bm.keyframes,t.Ci.i(on,"metadata keyframe",t.pm)),t.bm.keyframes||t.bm.duration?(u.isLive=!1,t.Il.updateConfig(t.Do.getRemuxConfig())):u.box===h.i.flv&&u.isLive===void 0&&(u.isLive=!0,t.Il.updateConfig(t.Do.getRemuxConfig())),t.vf.updateConfig(),t.ym?u.startFromSec>0&&!u.isLive&&t.pm&&t.pm.length>1?t.seek(u.startFromSec,t.Do.config.startFromKeyframe):t._m&&t.Il.end():t.seek(u.startFromSec,t.Do.config.startFromKeyframe),u.startFromSec=-1,u.box===h.i.mp4&&(c.mp4FastStart=t.ym),t._m=!1},t.Sm=function(){t._m&&(t.Il.end(),t._m=!1)},t.jl=function(c){X.a.safari&&t.Do.stat.codecType===h.c.hevc&&c.segments.forEach(function(u){if(u.type===h.o.VIDEO&&u.keyTime)for(var g=0;g<u.keyTime.length;g++){var R;if((R=u.keyTime[g])!=null&&R.cra)return t.Ci.i(on,"safari hevc cra nalu. always seek 0"),void(t.wm=!0)}})},t.Bm=function(c){if(t.Ci.i(on,"get key index"),c.append)if(t.pm&&c.keyframes[0]){for(var u=0;u<c.keyframes.length;u++){for(var g=!1,R=0;R<t.pm.length;R++)if(c.keyframes[u].time===t.pm[R].time){g=!0;break}g||t.pm.push(c.keyframes[u])}t.pm.sort(function(Q,se){return Q.time-se.time})}else t.pm=c.keyframes;else t.pm=c.keyframes},t.Tm=function(c){t.Ci.i(on,"not faststart",c.pos),t.vf.seek({position:c.pos,time:0}),t.Il.reset(!0),t.ym=!1,t._m=!1},t.Dm=function(c){t.Do.demuxerType=c.type,t.Cm&&(t.Do.stat.isLive=!1),t.Ci.i(on,"demuxer detected: "+c.type+", box:"+t.Do.stat.box+" isLive:"+t.Do.stat.isLive),t.vf.updateConfig()},t.Ai=e.evt,t.Do=e,t.Ci=e.logger,t.lm=new gb(t.Do),t.Bp={onLoad:t._p,onConnect:t.Cp,onProgress:t.Op,onError:t.Yf,onEnd:t.pl,onAbort:t.jp,onRangeEnd:t.km},t.vf=new Eb(t.Bp,e),t.Il=qh&&e.stat.box===h.i.yuv?new qh(t.Ai,e,h.f.MAIN):new rc(t.Ai,e,h.f.MAIN),t.Il.init(),t.O.push(t.Ai.prependListener(D.a.METADATA,t.Mm),t.Ai.prependListener(D.a.PARSING_INIT_SEGMENT,t.Sm),t.Ai.prependListener(D.a.PARSING_DATA,t.jl),t.Ai.prependListener(D.a.KEY_FRAME_INDEXS,t.Bm),t.Ai.prependListener(D.a.MP4_NOT_FASTSTART,t.Tm),t.Ai.prependListener(D.a.DEMUXER_DETECTED,t.Dm)),t}T()(_,v);var a=_.prototype;return a.init=function(){this.Do.stat.box===h.i.yuv&&this.Il instanceof rc&&this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MUX_ERROR,L.a.UNSUPPORTED,"yuv streams are not supported. yuv disabled.")),this.Am||(this.Am=new Ib(this.Do),this.No=!0,this.Do.lctx.currentIdx=this.Am.init(),this.Do.lctx.levels.length&&this.Ai.emit(D.a.MANIFEST_PARSED,{levels:[],currentLevel:0,auto:!1}))},a.destroy=function(){this.vf&&this.vf.destroy(),this.Am&&this.Am.destory(),this.lm=void 0,this.Il.destroy(),v.prototype.destroy.call(this)},a.loadSource=function(){var e=this.Am;if(e){var t=this.Do.lctx.current;t?this.RA(this.Rm(t.currentUrl)?ac(t.currentUrl,this.Do.config.defaultSpts,this.Do.config.videoEnabled===!1):t.currentUrl,e.currentLevel):this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.MANIFEST_PARSING_ERROR,"manifest parse error. core: mse."))}else typeof this.Do.src=="string"?this.RA(this.Do.src):this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.MANIFEST_PARSING_ERROR,"src Incorrect!"))},a.setDownloadEnabled=function(e){e===void 0&&(e=!0),this.vf.setDownloadEnabled(e)},a.isSeekable=function(){return!(!this.pm||!this.pm.length||this.Do.stat.isLive||this.Do.stat.isKwaiSlice)},a.seek=function(e,t,c){t===void 0&&(t=!1),c===void 0&&(c=!1),this.Ci.i(on,"seek: "+e+" "+t+" "+c);var u=this.pm;if((u||e<Ve.r)&&!c){var g=u?mb.a.getPosByTime(u,this.wm?0:e):{time:0,position:0};g&&(this.vf.seek(g),this.vm=g.time,this.Il.reset(!0),this.gm=g.position>0,e!==this.Do.currentTime&&this.Ai.emit(D.a.VIDEO_SEEK,{sec:t?g.time:e}))}else this.Ci.w(on,"no keyframe index"),this.Ai.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,L.a.CANNOT_SEEK,"can not seek",{fatal:!1}))},a.nextBackup=function(){return!1},a.onAbrLevelsUpdated=function(){var e;(e=this.Am)==null||e.onAbrLevelsUpdated()},a.setCurrentLevel=function(e){this.Ci.i(on,"set current level "+e),this.Am&&e>=0&&e!==this.Am.currentLevel&&this.Em(e)},a.setManualNextLevel=function(e){this.setNextLevel(e)},a.setNextLevel=function(e){if(this.No||this.setCurrentLevel(e),this.Do.stat.flvAbrNotAligned){if(e<0)return this.Ci.i(on,"flv not aligned. unsupprted abr."),void this.Ai.emit(D.a.LEVEL_SWITCH_FAILED);this.Em(e,!0)}var t=this.Am;t&&(e===-1&&this.Ai.emit(D.a.LEVEL_SWITCHING,{id:0,level:-1,time:this.Do.currentTime,smooth:!0,auto:!0}),t.nextLevel=e,this.Om=!0)},a.setAudioTrack=function(){},a.setSubtitleTrack=function(){},a.RA=function(e,t){t===void 0&&(t=0),this.Im=!0,this.Am&&this.Am.onLevelLoad(t),this.Do.lctx.currentIdx=t;var c=this.Do.lctx.current;this.Do.stat.audioCodec=this.Do.stat.audioCodec||(c?c.audioCodec:""),this.Ai.emit(D.a.NEW_SOURCE,{sync:this.vm});var u=Ge((c==null?void 0:c.fileName)||e);u&&this.Il.updateSuffix(u);var g=new Li;g.start=this.vm,g.type="frag";var R={url:e,responseType:"arraybuffer",credentials:this.Do.config.credentials,headers:this.Do.config.headers,frag:g,fileName:c==null?void 0:c.fileName,preferNative:this.Do.stat.preferNativeLoader};this.vf.load(R)},a.Em=function(e,t){var c=this.Am;if(c){c.currentLevel=e;var u=this.Do.lctx.current;if(u&&this.No){var g=this.Rm(u.currentUrl)?ac(u.currentUrl,this.Do.config.defaultSpts,this.Do.config.videoEnabled===!1):u.currentUrl;this.lm&&this.lm.reset(),this.Gl=!1,this.dm=!0,this.vm=this.Do.currentTime;var R={id:0,level:c.currentLevel,time:this.vm,smooth:!1,auto:!1};t&&(R.fallback=t),this.Ai.emit(D.a.LEVEL_SWITCHING,R),this.Il.reset(!0),this.Im&&this.RA(g,c.currentLevel)}}},a.jb=function(e,t,c){var u,g=pt(e,t,c,(u=this.Do.lctx.current)==null?void 0:u.qualityType);this.Ai.emit(D.a.DOWNLOAD,g)},a.jm=function(e){var t,c=(t=this.lm)==null?void 0:t.header;if(c){var u=new Uint8Array(e.byteLength+c.length);return u.set(c),u.set(new Uint8Array(e),c.length),u.buffer}return e},a.Rm=function(e){var t=this.Do.stat;return!(!t.isLive&&t.isLive!==void 0||t.box!==h.i.flv)},_}(F.a),Nb=function(v){function _(e){var t;return(t=v.call(this)||this).Lm=void 0,t.Do=void 0,t.Dm=function(c){t.Do.demuxerType=c.type,t.Do.logger.i("transmuxer","demuxer detected, box:"+t.Do.stat.box+" isLive:"+t.Do.stat.isLive)},t.Do=e,e.stat.multipart?t.Lm=new vb(e):t.Lm=new Ob(e),t.O.push(t.Lm),t}T()(_,v);var a=_.prototype;return a.init=function(){this.Nm(),this.Lm.init()},a.loadSource=function(){this.Lm.loadSource()},a.setDownloadEnabled=function(e){e===void 0&&(e=!0),this.Lm.setDownloadEnabled(e)},a.seek=function(e,t,c){c===void 0&&(c=!1),this.Lm.seek(e,t,c)},a.heartbeat=function(){},a.isSeekable=function(){return this.Lm.isSeekable()},a.setNextLevel=function(e){this.Lm.setManualNextLevel(e)},a.setCurrentLevel=function(e){this.Lm.setCurrentLevel(e)},a.onAbrLevelsUpdated=function(){this.Lm.onAbrLevelsUpdated()},a.setAudioTrack=function(e){this.Do.lctx.audioTracks.length&&this.Lm.setAudioTrack(e)},a.setSubtitleTrack=function(e){this.Do.lctx.subtitleTracks.length&&this.Lm.setSubtitleTrack(e)},a.Nm=function(){var e=this.Do.evt;this.O.push(e.prependListener(D.a.DEMUXER_DETECTED,this.Dm))},_}(F.a),Jh=function(){function v(a){this.Qm=void 0,this.Qm=a}var _=v.prototype;return _.update=function(a){var e=this;a.forEach(function(t){e.Qm[t.index]=t})},_.timeToIndex=function(a){if(this.Qm.length){if(a<this.Qm[0].pts)return 0;if(a>this.Qm[this.Qm.length-1].pts)return this.Qm.length-1;for(var e,t,c,u=0,g=this.Qm.length-1;u<=g;)if(e=(u+g)/2|0,t=this.Qm[e],(c=this.Qm[e+1])&&c.pts-.001<a)u=e+1;else{if(!(t&&t.pts-.001>a))return e;g=e-1}}return-1},_.isIndexInRange=function(a){return a>=0&&a<this.Qm.length},_.indexToTime=function(a){var e=this.Qm[a];return e?e.pts:-1},_.getNextFramePTSByTime=function(a){var e=this.timeToIndex(a),t=this.Qm[e+1];return e>=0&&t?t.pts:-1},_.getPrevFramePTSByTime=function(a){var e=this.timeToIndex(a)-1,t=this.Qm[e];return e>=0&&t?t.pts:-1},m()(v,[{key:"totalVideoFrames",get:function(){return this.Qm.length}}])}(),ed="seek-stuck",xb=function(){function v(a){this.Do=void 0,this.xm=-1,this.Do=a}var _=v.prototype;return _.onSeeking=function(){this.Do.logger.i(ed,"seeking. reset"),this.xm=-1},_.tick=function(a){var e,t,c=this.Do,u=c.video;if(!a||!u||u.buffered.length!==1||c.stat.isLive&&!be(c.stat.box)||c.stat.isNetworkInUse||(e=c.mse)!=null&&e.ended())return!1;var g=c.bufferedSec+(((t=c.mse)==null?void 0:t.getBufferQueueSec())||0);if(g>=c.stat.lazyLoadRecoverDuration&&g<300){var R=performance.now();return this.xm<0&&(this.xm=R),R-this.xm>=2e3?(this.xm=-1,this.Do.logger.i(ed,"mp stuck fix."),"fix"):"hit"}return this.xm=-1,!1},v}(),kb=function(){function v(a){this.Vm=void 0,this.Um=void 0,this.Fm=0,this.if=!1,this.Pm=!1,this.Vm=a}var _=v.prototype;return _.check=function(){var a=this.Vm,e=performance.now();if(!a.paused&&!a.seeking&&!a.ended&&e-this.Fm>=100){if(this.Fm=e,!this.Pm)return typeof this.Um=="number"&&Math.abs(a.currentTime-this.Um)>.017&&(this.Pm=!0),void(this.Um=a.currentTime);a.currentTime===this.Um?this.if||(this.if=!0,this.Hm(a,"waiting")):this.if&&(this.if=!1,this.Hm(a,"playing")),this.Um=a.currentTime}},_.reset=function(){this.Um=void 0,this.Pm=!1,this.if=!1},_.Hm=function(a,e){if(a&&a.dispatchEvent){var t=document.createEvent("CustomEvent");t.initCustomEvent(e,!0,!0,{}),a.dispatchEvent(t)}},v}(),yn="yuv-renderer",td=function(v){function _(e){var t;return(t=v.call(this,e)||this).Ju=1,t.Ym=0,t.Gm={streamTime:0,stoped:!1,frameBufLen:0,maxFrameBufLen:0,pictMode:je.a.contain},t.Km=function(){var c,u;t.if=!1,t.ef!==!1||(c=t.Do.video)!=null&&c.ended||(u=t.Do.video)==null||(u=u.play())==null||u.catch(function(g){return t.Ci.i(yn,"on dec ready, call play() fail.",g)}),t.ef=void 0},t.Zm=function(){var c,u;(c=t.Do.video)!=null&&c.ended||(t.rf.onWaiting(),t.if=!0,t.ef===void 0&&(t.ef=!((u=t.Do.video)==null||!u.paused)))},t.Wm=function(c){t.Ci.i(yn,"seek["+c.id+"]: renderer seek event",c),c.hitCache?t.if=!1:(t.ub(!0),t.hf()),t.zu=void 0},t.Xm=function(){var c;t.Ci.i(yn,"on ren waiting."),t.ef===void 0&&(t.ef=!((c=t.Do.video)==null||!c.paused)),t.Ai.emit(D.a.DECODER_WAITING)},t.zm=function(){t.Km()},t.Gm.maxFrameBufLen=t.rf.maxFrameBufLen,t}T()(_,v);var a=_.prototype;return a.init=function(e,t){this.Ci.i(yn,"init "+e+", "+t);var c=this.Ai;this.O.push(c.prependListener(D.a.DEC_VIDEO_READY,this.Km),c.prependListener(D.a.DECODER_WAITING,this.Zm),c.prependListener(D.a.RENDERER_SEEK,this.Wm),c.prependListener(D.a.RENDERER_WAITING,this.Xm),c.prependListener(D.a.RENDERER_WAITING_END,this.zm)),this.sf.id=this.Ju,this.sf.init(!1),this.No=!0,this.start()},a.setMediaInfo=function(e){this.sf.updateMediaInfo(e)},a.appendData=function(e){var t=this;e.samples.forEach(function(c){c.yuv&&t.sf.append(c.yuv)})},a.endOfData=function(){this.Ci.i(yn,"endOfData"),this.sf.endOfData()},a.heartbeat=function(){this.Ci.i(yn,"hb seeking: "+this.zu)},a.seek=function(e,t){this.Ci.i(yn,"seek["+t+"]: "+e+" "+this.zu),e*=Ve.b,this.sf.seek(e,t),this.start()},a.seekWithLoad=function(){this.Ci.i(yn,"seekWithLoad"),this.ub(!0),this.hf()},a.clean=function(e){e===void 0&&(e=0),this.Ci.i(yn,"clean"),e||this.ub(!1)},a.decoderChange=function(e,t){this.Ci.i(yn,"decoderChange: "+e+" @ "+t)},a.onParsingData=function(e){var t=this;e.segments.forEach(function(c){c.type===h.o.AUDIO&&t.Ym++})},a.screenshot=function(e){this.sf.screenshot(e)},a.ub=function(e){e===void 0&&(e=!1),this.Ju++,this.Ym=0,e||(this.zu=void 0),this.sf.id=this.Ju,this.sf.reset(e),this.if=!0},a.hf=function(){var e,t=(e=this.Do.cOutput)==null?void 0:e.canvas;if(!t)throw new Error("canvas output undefined.");if(t instanceof HTMLCanvasElement){var c,u=this.Do.currentTime*Ve.b,g=!1,R=!((c=this.Do.video)==null||!c.ended),Q=this.af(t),se=this.Gm,fe=$.a.getPictModeByCss(t);if(u!==0||this.Ym||(u=-1),se.streamTime===u&&se.stoped===R&&se.frameBufLen===this.sf.frameBufLen&&se.maxFrameBufLen===this.rf.maxFrameBufLen&&se.pictMode===fe||(se.streamTime=u,se.stoped=R,se.frameBufLen=this.sf.frameBufLen,se.maxFrameBufLen=this.rf.maxFrameBufLen,se.pictMode=fe,g=!0),!g&&!this.if&&!Q)return;(g||Q)&&this.sf.update(u,this.yt.w,this.yt.h,R,h.s.canvas,se.maxFrameBufLen,fe)}},m()(_,[{key:"isCanvasRenderer",get:function(){return!0}},{key:"decBufLow",get:function(){return!1}}])}(Ue),lt="kernel-base-mse",cc=function(v){function _(e){var t;(t=v.call(this,e)||this).Jm=void 0,t.Lm=void 0,t.qm=!1,t.$m=void 0,t.tg=!1,t.ig=void 0,t.eg=!1,t.Ob=void 0,t.ng=3,t.sg=0,t.rg=void 0,t.hg=void 0,t.og=void 0,t.ag=void 0,t.ug=void 0,t.cg=!1,t.fg=void 0,t.Ag=[],t.vg=void 0,t.dg=void 0,t.lg=!1,t.bg=!0,t.pg=void 0,t.mg=0,t.gg=NaN,t.yg=0,t._g={},t.Cg=!1,t.fl=0,t.Ig=[],t.Og=function(){t.Ci.i(lt,"mse buffer full. live: "+t.Do.live+" paused: "+t.eA.paused),t.Do.live?t.eA.paused&&(t.stopLoad(),t.wg()):t.Lm&&t.Lm.setDownloadEnabled(!1)},t.Eg=function(){t.Io!==bt.NONE&&t.Do.isTimeinBuffered(t.eA.currentTime)&&t.eA.readyState>=3?(t.AA(),t.Ci.v(lt,"canplay polyfill")):t.qm&&t.jg()},t.kg=function(){t.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.MSE_SOURCE_BUFFER_CLOSE_ERROR,"mse source close.",{fatal:!0}))},t.Mg=function(u){t.Ob&&t.Ob.parseVTTs(u.data,u.start,u.cc)},t.Sg=function(u){u.id=t.rA,t.rA++,u.auto=t.Do.lctx.abr,!u.smooth&&t.Jm&&(t.Jm.clean(),t.Do.streamingMux=!0),t.oA=u},t.Bg=function(u){var g;u.id=t.rA,t.rA++,u.auto=t.Do.lctx.abr,!u.smooth&&t.Jm&&(t.Jm.clean(),t.Do.streamingMux=!0),u.fallback&&(t.Ci.i(lt,"level switch fallback, set seek on canplay"),t.qm=!0),typeof u.level=="number"&&(u.bitrate=u.level<0?-1:((g=t.Do.lctx.levels[u.level])==null?void 0:g.bitrate)||0),u.level===-1?setTimeout(function(){return t.emit(D.a.LEVEL_SWITCHED,{time:u.time,bitrate:u.bitrate,level:u.level,smooth:u.smooth,auto:u.auto,id:u.id})},0):(u.smooth?t.hA=t.hA.sort(function(R,Q){return R.data.time-Q.data.time}).filter(function(R){return R.data.time<u.time-.5}):t.hA=[],t.hA.push({switched:!1,data:u}))},t.Mb=function(u){t.Jm&&t.Jm.clean(u.startSec,t.eA.duration)},t.Tg=function(u){t.Ci.i(lt,"manifest parsed",t.fg);var g=t.Do,R=t.Lm;if(R){t.Ci.i(lt,"avSeparated: "+g.stat.avSeparated),t.Dg();var Q,se=g.lctx.startIdx;if(typeof se=="number"&&se>=0&&se<g.lctx.levels.length&&(R.setCurrentLevel(se),t.Ci.i(lt,"set level from level startIdx.")),typeof t.fg=="number")return t.fg>=0&&(R.setCurrentLevel(t.fg),t.Ci.i(lt,"set level:"+t.fg+". manifest parsed stop event."),u.preventFollowUp=!0),void(t.fg=void 0);g.lctx.subtitleTracks.length&&t.Rg(),g.config.emeEnabled&&((Q=t.hg)==null||Q.onManifestParsed(g.lctx.levels,g.stat.drm))}},t.Lg=function(u){var g=t.Do,R=t.Jm;g.stat.isLive&&g.stat.liveShiftType!==h.g.KWAI||u==null||!u.duration||!R||R.updateDuration(u.duration),t.Ci.i(lt,"audio track update",u)},t.Ng=function(u){var g=t.Do,R=t.Jm;(!g.stat.isLive&&(u==null?void 0:u.live)===!1||g.stat.liveShiftType===h.g.KWAI)&&u!=null&&u.duration&&R&&R.updateDuration(u.duration),t.Ci.i(lt,"level update",u)},t.Qg=function(u){if(t.Ci.i(lt,"seek event from trans",u,u.sec===t.Do.currentTime),u.sec!==t.Do.currentTime){t.eg=!0;try{t.internalSeek(u.sec)}catch(g){}}},t.kl=function(u){u.expired||(t.rg&&t.rg.appendData(u),t.Do.loadRec.onRaw(u))},t.xg=function(u){t.Ci.i(lt,"video codec detected. dec:"+u.decoder+", codec:"+u.codecType+", bitDepth:"+u.bitDepth+" "+u.timeOffset);var g,R,Q=t.Do;u.decoder&&(t.Do.stat.decoder=u.decoder),t.rg&&u.decoder===h.d.buildin?(t.rg.decoderChange(h.d.buildin,u.timeOffset||0),Q.config.ensureVideo?t.Vg():(Q.config.ensureVideo=!0,(R=Q.cOutput)==null||R.updateRendererType(h.s.video),t.Ug(!t.rg.pausedOnWaiting))):(u.decoder===h.d.buildin&&((g=Q.cOutput)==null||g.updateRendererType(h.s.video)),u.enabled&&u.decoder===h.d.wasm&&Ks?(t.Fg(Ks,u.codecType,u.bitDepth),t.rg&&t.rg.decoderChange(h.d.wasm,u.timeOffset||0)):u.enabled&&u.decoder===h.d.none&&Q.stat.box===h.i.yuv&&td&&t.Fg(td,u.codecType,u.bitDepth))},t.Pg=function(u){t.og.update()},t.Hg=function(){t.Ci.i(lt,"wasm video ready"),t.Do.live?t.Yg():t.Jm&&t.Jm.setAppendEnabled(!0)},t.Gg=function(u){if(t.Ci.i(lt,"h265 step frame",u),u.type){var g=u.time/1e3;u.type===h.m.NEXT?(g<0&&(g=t.SA()),g!==t.eA.currentTime&&(t.eg=!0,t.internalSeek(g))):g>=0?g!==t.eA.currentTime&&(t.eg=!0,t.internalSeek(g)):t.eA.currentTime=t.BA()}},t.Kg=function(u){var g;if(t.Ci.i(lt,"seek["+u+"]: seek with load"),(!t.Do.stat.isLive||t.Do.isLiveShift)&&t.Lm&&t.Jm){t.ag.onSeeking();var R=t.eA.currentTime;if(!t.Lm.isSeekable()&&R>=Ve.r)return t.Ci.i(lt,"seek["+u+"]: seek disabled, rollback: "+t.sg+" seekTime: "+R),void(R!==t.sg&&t.internalSeek(t.sg));t.rg&&t.rg.seekWithLoad(),t.emit(D.a.SEEK_WITH_LOAD),t.Io=bt.SEEK,t.hA.length&&(t.hA=t.hA.slice(t.hA.length-1),t.hA[0].data.time=R),t.Jm.clean(),t.Jm.setAppendEnabled(!1),(g=t.rg)!=null&&g.isCanvasRenderer&&(t.qm=!1),t.Lm.seek(R,X.a.msie||t.Do.config.alwaysSeekKeyframe,!1)}},t.Zg=function(u){t.Ci.i(lt,"seek["+u.id+"]: decoder seek event.",u),u.preventFollowUp||(t.Ci.i(lt,"wasm seek frame",u),u.hitCache?t.Yg():t.Kg(u.id))},t.Wg=function(){t.Ci.i(lt,"h265 render buf empty. waiting."),t.Xg()},t.zg=function(u){t.Do.cOutput&&(t.Do.cOutput.updateRendererType(u.type),u.type=t.Do.cOutput.rendererType,u.canvas=t.Do.cOutput.rendererType===h.s.canvas&&t.Do.cOutput.canvas?t.Do.cOutput.canvas:void 0)},t.Jg=function(u){if(t.rg){var g=t.Sa;g&&(g.width=u.width,g.height=u.height,g.codedWidth=u.codedWidth,g.codedHeight=u.codedHeight,g.sar=u.sar,g.profile=u.profile,g.level=u.level,g.chromaFormat=u.chromaFormat,g.bitDepth=u.bitDepth,u.colorInfo&&(g.colorInfo=u.colorInfo,g.colorSpace=Object(ri.e)(u.colorInfo)),t.rg.setMediaInfo(s()({},g)),t.emit(D.a.MEDIA_INFO,t.Sa))}},t.Sm=function(u){var g;if(t.Do.stat.avSeparated){if(Object.prototype.hasOwnProperty.call(u.tracks,"video")&&(t._g.main=u.tracks.video),Object.prototype.hasOwnProperty.call(u.tracks,"audio")&&(t._g.audio=u.tracks.audio),!t._g.main&&t.Do.config.videoEnabled!==!1&&t.Do.stat.decoder===h.d.buildin||!t._g.audio&&t.Do.config.audioEnabled!==!1)return void t.Ci.i(lt,"av separated. init segment not ready. wating next");t.Ci.i(lt,"av separated. init segment ready."),u.tracks.video=t._g.main,u.tracks.audio=t._g.audio}t.Cg=!0;var R=t.Jm,Q=t.Do,se=t.Do.lctx.current;if(se&&u.tracks&&u.tracks.video&&!se.codec&&(se.codec=u.tracks.video.codec),t.hA.length){var fe=t.hA.filter(function($e){return!$e.switched})[0];fe&&(fe.switched=!0,t.emit(D.a.LEVEL_SWITCHED,s()({},fe.data)))}t.oA&&(t.emit(D.a.AUDIO_TRACK_SWITCHED,t.oA),t.oA=void 0);var xe=u.tracks.rawVideo||u.tracks.video,Fe=u.tracks.audio,Ne={};if(Fe){var He=Fe.metadata;Ne.hasAudio=!0,Ne.channel=He.channel,Ne.audioBitrate=He.audioBitrate,Ne.audioSampleRate=He.audioSampleRate,Ne.audioCodec=Fe.codec,Ne.audioCodecType=Fe.codecType}if(xe){var rt=xe.metadata;Ne.hasVideo=xe.active!==!1,rt&&!rt.isFillVideo&&(Ne.width=rt.width,Ne.height=rt.height,Ne.rotation=rt.rotation,Ne.fps=rt.fps,Ne.profile=rt.profile,Ne.level=rt.level,Ne.chromaFormat=rt.chromaFormat,Ne.bitDepth=rt.bitDepth,Ne.videoBitrate=rt.videoBitrate,rt.colorInfo&&(Ne.colorSpace=Object(ri.e)(rt.colorInfo)),Ne.videoCodec=xe.codec,Ne.videoCodecType=xe.codecType),s()(Ne,xe.metadata)}Q.stat.codecType=Ne.videoCodecType=(xe==null?void 0:xe.codecType)||h.c.unknown,t.Do.stat.audioCodec=((g=t.Do.lctx.current)==null?void 0:g.audioCodec)||"",Q.lctx.current&&(!Q.lctx.current.bitrate&&Ne.videoBitrate&&Ne.audioBitrate&&(Q.lctx.current.bitrate=Ne.videoBitrate+Ne.audioBitrate),!Q.lctx.current.maxBitrate&&xe!=null&&xe.metadata&&xe.metadata.videoMaxBitrate&&Fe!=null&&Fe.metadata.audioMaxBitrate&&(Q.lctx.current.maxBitrate=xe.metadata.videoMaxBitrate+Fe.metadata.audioMaxBitrate)),Ne.videoDecoder=Q.stat.decoder,t.rg&&t.rg.setMediaInfo(s()({},Ne)),Ne.videoCodecType!==h.c.kvc30&&t.emit(D.a.MEDIA_INFO,Ne),t.Sa=Ne,t.Ci.i(lt,"mediainfo",Ne),R&&R.trackInfo(u),t.qg()},t.$g=function(u){if(!u.expired){if(t.Cg){if(t.Ig.length)for(;t.Ig.length;){var g=t.Ig.shift();g&&t.ty(g)}}else t.Ig.push(u);t.ty(u),t.Yg()}},t.Mm=function(u){!t.Do.stat.isLive&&u.videoFramesInfo&&(t.pg=new Jh(u.videoFramesInfo)),typeof u.duration=="number"&&t.Jm&&(delete u.keyframes,t.Lm&&!t.Do.stat.multipart&&t.Jm.updateDuration(u.duration))},t.iy=function(u){!t.Do.stat.isLive&&u.videoFramesInfo&&(t.pg?t.pg.update(u.videoFramesInfo):t.pg=new Jh(u.videoFramesInfo))},t.Sc=function(u){t.Do.stat.isLive=!1,t.fl++,t.fl<2&&t.Do.stat.avSeparated?u.preventFollowUp=!0:(t.Jm&&t.Jm.endOfData(),t.rg&&t.rg.endOfData())},t.ey=function(u){t.Lm&&t.Lm.setSubtitleTrack(u.level)},t.ny=function(u){t.Do.config.logger&&Object(Bt.a)(t.Do.config.logger,u)},t.Ci.i(lt,"constructor"),t.og=new ei(t.Do),t.ag=new xb(t.Do),t.bg=!!t.Do.config.catchUpPausedLive,Fn&&(t.hg=new Fn(t.Do),t.O.push(t.hg)),e.video&&X.a.x5&&X.a.android&&(t.$m=new kb(t.eA)),t.wg(),t.Yb();var c=t.Ug.bind(t);return t.dg=new Pt(e).setRetryFunc(c),t.O.push(t.Do.evt.on(D.a.WORKER_LOG,t.ny)),t}T()(_,v);var a=_.prototype;return a.load=function(e){this.Ci.i(lt,"call load: "+e),this.sy(),this.hy(),this.TA(),this.fg=void 0,this.vg=void 0,this.RA(e)},a.stopLoad=function(){this.Ci.i(lt,"call stopLoad"),this.kA(),this.oy(),this.vg&&(this.vg.enabled=!1),this.rg&&this.uy(),this.Lm&&(this.Ay(),this.emit(D.a.STOP_LOAD))},a.destroy=function(){var e;this.Do.logger.i(lt,"call destroy"),this.$m=void 0,this.kA(),this.oy(),this.Lm&&this.emit(D.a.STOP_LOAD),this.vy(),(e=this.Ob)==null||e.destroy(),this.ug&&(this.eA.play=this.ug.play,this.eA.pause=this.ug.pause),this.pg=void 0,yi(),this.sy(),v.prototype.destroy.call(this)},a.hy=function(){var e=this.Do,t=this.Ug.bind(this);this.Ag.push(e.fallback.register(le.FLV_LIVE_RELOAD,this.dg),e.fallback.register(le.USE_BACKUP,new si(e).setRetryFunc(t)),e.fallback.register(le.NO_WORKER,new It(e).setRetryFunc(t)),e.fallback.register(le.DROP_V_FRAME,new bi(e).setRetryFunc(t)),e.fallback.register(le.SWAP_REMUX_TYPE,new Nt(e).setRetryFunc(t)),e.fallback.register(le.SWAP_AUDIO_CODECSTR,new Ni(e).setRetryFunc(t))),Ct&&this.Ag.push(e.fallback.register(le.SWAP_WASM_DECODER,new Ct(e).setRetryFunc(t)))},a.sy=function(){this.Ag.forEach(function(e){return e.destroy()}),this.Ag=[]},a.resume=function(){var e,t=this;this.Ci.i(lt,"call resume"),this.Do.live&&this.lg||(this.Lm||this.RA(h.h.internal),this.eA.paused&&((e=this.eA.play())==null||e.catch(function(c){return t.Ci.i(lt,"resume, call play() fail.",c)})))},a.refresh=function(){if(this.Ci.i(lt,"call refresh. live: "+this.Do.live),this.Do.live){if(this.lg)return;this.dg.reset()}else this.Do.stat.startFromSec=this.eA.currentTime;var e=this.Do.lctx.currentIdx,t=this.Do.lctx.audioIdx,c=this.Do.lctx.subtitleIdx,u=this.Do.lctx.abr;this.Do.lctx.currentIdx=e,this.Do.lctx.audioIdx=t,this.Do.lctx.subtitleIdx=c,this.Do.lctx.abr=u,this.Ug(),this.nA=void 0},a.onAbrLevelsUpdated=function(){var e;(e=this.Lm)==null||e.onAbrLevelsUpdated()},a.setCurrentLevel=function(e){var t;this.Ci.i(lt,"set currentLevel",e);var c=this.Do;return c.lctx.verifyLevelIdx(e)&&this.nA?(this.Ci.i(lt,"set currentLevel on error. refresh"),c.lctx.currentIdx=e,void this.refresh()):!this.ly(e,h.o.VIDEO)||e===c.lctx.currentIdx&&!c.lctx.abr||this.nA?(this.Ci.i(lt,"set currentLevel fail.",!this.ly(e,h.o.VIDEO),e,c.lctx.currentIdx,!c.lctx.abr,this.nA),void this.emit(D.a.LEVEL_SWITCH_FAILED)):e<0?(this.Ci.i(lt,"set currentLevel to auto."),void this.setNextLevel(-1)):c.isSwitchLevelByReload?(c.lctx.currentIdx=e,this.fg=e,void(this.eA.ended?(this.Ci.i(lt,"set currentLevel on manifest parsed. reset trans"),this.Ay(),this.by(),this.uy()):(this.Ci.i(lt,"set currentLevel on manifest parsed. reload"),this.Ug()))):(this.Io!==bt.INIT&&this.Io!==bt.LOADING&&(this.Io=bt.SELECT_BITRATE,this.qm=!0),this.Jm&&(this.Jm.clean(),c.streamingMux=!0),e>=0&&e!==c.lctx.currentIdx&&this.Dg(),(t=this.Lm)==null||t.setCurrentLevel(e),void(this.rg&&this.rg.clean()))},a.setNextLevel=function(e){var t;this.Ci.i(lt,"set nextLevel",e);var c=this.Do;return c.lctx.verifyLevelIdx(e)&&this.nA?(c.lctx.currentIdx=e,void this.refresh()):!this.ly(e,h.o.VIDEO)||this.nA?(this.Ci.i(lt,"set nextLevel failed.",e),void this.emit(D.a.LEVEL_SWITCH_FAILED)):void(c.bufferedSec<this.ng&&e>=0||e>=0&&c.isSwitchLevelByReload||c.isLiveShift?this.setCurrentLevel(e):(e>=0&&e!==c.lctx.nextIdx&&this.Dg(),(t=this.Lm)==null||t.setNextLevel(e)))},a.setAudioTrack=function(e){this.Ci.i(lt,"set audioTrack",e);var t=this.Do;if(!this.ly(e,h.o.AUDIO)||e===t.lctx.audioIdx||this.nA)return this.Ci.i(lt,"set audioTrack fail.",!this.ly(e,h.o.AUDIO),e,t.lctx.audioIdx,this.nA),void this.emit(D.a.AUDIO_TRACK_SWITCH_FAILED);this.Lm&&e!==t.lctx.audioIdx&&t.lctx.audioTracks.length>1&&(this.Dg(),this.Lm.setAudioTrack(e),this.Io!==bt.INIT&&this.Io!==bt.LOADING&&(this.Io=bt.SELECT_BITRATE,this.qm=!0),this.Jm&&(this.Jm.clean(),t.streamingMux=!0))},a.setSubtitleTrack=function(e){this.Lm&&e!==this.Do.lctx.subtitleIdx&&this.Do.lctx.subtitleTracks.length>=1&&this.Ob&&this.Ob.select(e)},a.liveEnd=function(){this.Ci.i(lt,"liveEnd",this.Do.stat.isLive),this.Do.stat.isLive&&(this.Do.stat.isLive=!1,this.lg=!0,this.Do.fallback.stop())},a.getTotalVideoFrames=function(){return this.pg?this.pg.totalVideoFrames:-1},a.getCurrentVideoFrame=function(){return this.pg?this.pg.timeToIndex(this.eA.currentTime):-1},a.seekToNextFrame=function(){if(!(this.getCurrentVideoFrame()>=this.getTotalVideoFrames()-1))if(this.rg)this.rg.step(h.m.NEXT);else if(this.pg){var e=this.pg.getNextFramePTSByTime(this.eA.currentTime);e>=0&&(this.eA.currentTime=e+.001)}else{var t=this.SA();t>0&&(this.eA.currentTime=t)}},a.seekToPrevFrame=function(){if(this.getCurrentVideoFrame()!==0)if(this.rg)this.rg.step(h.m.PREV);else if(this.pg){var e=this.pg.getPrevFramePTSByTime(this.eA.currentTime);e>=0&&(this.eA.currentTime=e+.001)}else{var t=this.BA();t>=0&&(this.eA.currentTime=t)}},a.setCurretVideoFrame=function(e){this.pg&&this.pg.isIndexInRange(e)?this.pg.indexToTime(e)>=0?this.eA.currentTime=this.pg.indexToTime(e)+.001:this.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,L.a.CANNOT_SEEK_BY_FRAME_INDEX,e+" out of range: [0, "+this.getTotalVideoFrames()+"]",{fatal:!1})):this.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,L.a.CANNOT_SEEK_BY_FRAME_INDEX,"unsupported",{fatal:!1}))},a.getTrackBufInfo=function(){var e;return(e=this.Jm)==null?void 0:e.trackBufInfo},a.screenshot=function(e){this.rg&&this.rg.isCanvasRenderer?this.rg.screenshot(e):v.prototype.screenshot.call(this,e)},a.cA=function(){this.eA instanceof HTMLVideoElement&&!this.eA.videoWidth&&this.Do.stat.codecType!==h.c.h264&&this.Do.stat.decoder===h.d.buildin&&(this.Do.canCodecFallback||this.Do.hasNextMediaDesc())?(this.Ci.i(lt,"metadata video size: "+this.eA.videoWidth+". fallback 264"),this.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,L.a.VIDEO_NO_SIZE,"buildin "+this.Do.stat.codecType+" dec no width."))):v.prototype.cA.call(this)},a.pA=function(){v.prototype.pA.call(this),this.Do.config.catchUpPausedLive&&!this.Do.stat.liveShiftActive&&(this.bg=!0)},a.bA=function(){if(!this.nA&&this.Do.live){var e=this.Do.getLiveDelay();if(this.Ci.i(lt,"on video playing. live: "+this.Do.live+" delay: "+e),e>0&&this.Do.bufferedSec>e/1e3+1&&this.bg){var t=this.Do.bufferedEnd-e/1e3;this.Do.isTimeinBuffered(t)&&this.internalSeek(t)}this.bg=!1}v.prototype.bA.call(this),this.gg=NaN},a.mA=function(){this.nA||this.Lm||this.load(),this.rg&&(this.rg.start(),this.rg.waiting&&this.rg.isCanvasRenderer&&(this.rg.pausedOnWaiting=!1,this.py())),v.prototype.mA.call(this)},a.yA=function(){this.sg=0,this.eg=!1,v.prototype.yA.call(this)},a.wg=function(){var e,t;(this.Jm&&(this.Jm.hasTrackInfo()||this.eA.error)||(e=this.hg)!=null&&e.isActive)&&(this.Ci.i(lt,"rebuild mse"),URL.revokeObjectURL(this.eA.src),this.by(),(t=this.hg)!=null&&t.isActive&&(this.Ci.i(lt,"eme reset src"),this.eA.src="",this.hg.reset())),this.Jm?this.Jm.clean():(this.Jm=new Ti(this.Do.config,this.Do.stat,this.Ci,this.Do.evt),this.Jm.attach(this.eA),this.Do.mse=this.Jm,this.Jm&&this.Do.isLiveShiftKwai2&&this.Jm.updateDuration(this.Do.getLiveShiftKwai2Duration()))},a.ly=function(e,t){var c=!0;return t===h.o.VIDEO?c=this.Do.lctx.verifyLevelIdx(e):t===h.o.AUDIO&&(c=this.Do.lctx.verifyAudioTrackIdx(e)),!!(this.Lm&&this.Jm&&c)},a.jg=function(){if(this.qm&&this.Jm&&!this.Jm.hasCleanUpTask()){var e=.001;this.Do.isTimeinBuffered(this.eA.currentTime+e)&&(this.Ci.i(lt,"seek on canplay "+this.eA.currentTime+" + "+e),this.qm=!1,this.internalSeek(this.eA.currentTime+e))}},a.my=function(){(this.Lm=new Nb(this.Do)).init(),this.$m&&this.$m.reset()},a.Yb=function(){var e=this.Do.evt;this.O.push(e.prependListener(D.a.PARSING_DATA,this.$g),e.prependListener(D.a.PARSING_INIT_SEGMENT,this.Sm),e.prependListener(D.a.LOAD_END,this.Sc),e.prependListener(D.a.SUBTITLE_LOADED,this.Mg),e.prependListener(D.a.AUDIO_TRACK_SWITCHING,this.Sg),e.prependListener(D.a.LEVEL_SWITCHING,this.Bg),e.prependListener(D.a.BUFFER_CLEANING,this.Mb),e.prependListener(D.a.METADATA,this.Mm),e.prependListener(D.a.VIDEO_FRAME_INFO,this.iy),e.prependListener(D.a.MANIFEST_PARSED,this.Tg),e.prependListener(D.a.AUDIO_TRACK_UPDATED,this.Lg),e.prependListener(D.a.LEVEL_UPDATED,this.Ng),e.prependListener(D.a.VIDEO_SEEK,this.Qg),e.prependListener(D.a.RAW_DATA,this.kl),e.prependListener(D.a.VIDEO_CODEC_DETECTED,this.xg),e.prependListener(D.a.LOADER_CHUNK_ARRIVAL,this.Pg),e.prependListener(D.a.MSE_BUFFER_FULL,this.Og),e.prependListener(D.a.MSE_UPDATE,this.Eg),e.prependListener(D.a.MSE_SOURCE_CLOSE,this.kg),e.prependListener(D.a.DEC_VIDEO_READY,this.Hg),e.prependListener(D.a.STEP,this.Gg),e.prependListener(D.a.DECODER_SEEK,this.Zg),e.prependListener(D.a.DECODER_WAITING,this.Wg),e.prependListener(D.a.VIDEO_RENDERER_CHANGE,this.zg),e.prependListener(D.a.DECODER_MEDIA_INFO,this.Jg),e.prependListener(D.a.SUBTITLE_TRACK_SWITCHED,this.ey))},a.Fg=function(e,t,c){c===void 0&&(c=8),this.Ci.i(lt,"init canvas renderer");var u=this.Jm,g=this.Do;if(!this.rg){var R,Q,se;u&&u.setAppendEnabled(!1),g.stat.mainThreadRendering=g.config.mainThreadRendering,(R=g.cOutput)==null||R.updateRendererType(h.s.canvas);var fe=this.rg=new e(g);this.gy(),fe.init(t,c),(Q=this.Jm)!=null&&Q.ended()&&fe.endOfData(),this.emit(D.a.VIDEO_RENDERER_CHANGE,{enabled:!0,canvas:(se=g.cOutput)==null?void 0:se.canvas,type:h.s.canvas})}},a.Yg=function(){var e=this.Do;if(this.Lm&&this.Jm)if(e.stat.multipart||e.stat.isLive||this.Io!==bt.WAITING){var t=e.bufferedSec,c=this.Jm.getBufferQueueSec(),u=!0;if((t<e.stat.lazyLoadRecoverDuration||e.live&&!this.Jm.getAppendEnabled())&&this.Jm.setAppendEnabled(!this.rg||!this.rg.isCanvasRenderer||!this.rg.waiting),e.stat.lazyLoadMaxDuration>0&&t+c>=(this.Jm.readyState==="closed"?1:e.stat.lazyLoadMaxDuration))u=!1;else{if(!(t+c<e.stat.lazyLoadRecoverDuration))return void this.og.checkStreamingMux();this.og.checkStreamingMux(),u=!0}e.isDownloadInterruptible&&this.Lm&&(this.Ci.v(lt,"download: "+u+" buffered:"+t+" mse:"+c),!u&&this.rg&&this.rg.decBufLow&&(this.Ci.i(lt,"dec data empty, download enable."),u=!0),this.Lm.setDownloadEnabled(u)),this.Jm.pendingNum()&&this.Jm.refresh()}else this.Lm.setDownloadEnabled(!0)},a.vA=function(){var e,t,c=this,u=this.Do.stat.seekingId++;if(this.Ci.i(lt,"seek["+u+"]: to "+this.eA.currentTime+" internal:"+this.uA),this.Do.config.forceRenderOnSeekEnd&&((e=this.rg)==null||!e.isCanvasRenderer)&&this.eA.currentTime>=this.eA.duration)this.Ci.i(lt,"seek["+u+"]: to end, force render. paused: "+this.eA.paused),this.eA.currentTime=this.eA.duration-.001,this.eA.paused&&((t=this.eA.play())==null||t.catch(function(Q){return c.Ci.i(lt,"resume, call play() fail.",Q)}));else if(this.Sa&&!(this.eA&&this.eA.currentTime>=this.eA.duration&&this.Jm&&this.Jm.ended())){this.Do.streamingMux=!0;var g=this.uA;if(this.uA=!1,this.eg)this.eg=!1;else{this.emit(D.a.SEEKING,{internal:g});var R=this.eA.currentTime;if(this.Do.isLiveShift&&R>this.eA.duration-this.Do.config.liveShiftDelaySec&&!g)return this.internalSeek(this.eA.duration-this.Do.config.liveShiftDelaySec),void this.Ci.i(lt,"liveshift kwai2 seek out of range");if(this.Do.isLiveShift&&this.Do.liveTime&&this.Do.updateLiveShiftStatuByTime(R),this.rg&&this.rg.isCanvasRenderer){if(g)return;this.rg.seek(R,u)}else this.Do.isTimeinBuffered(R)?g||(X.a.msedge&&X.a.version.major<88||X.a.msie?(this.qm=!0,this.Kg(u)):this.Lm&&be(this.Do.stat.box)&&this.Lm.seek(R,!1,!0)):R===0&&this.eA.buffered.length>0&&this.eA.buffered.start(0)<1?g||this.internalSeek(this.eA.buffered.start(0)):this.Kg(u)}}},a.Xg=function(){!this.eA.ended&&this.rg&&this.rg.isCanvasRenderer&&(this.eA.paused||this.py(),function(e,t,c){if(e&&e.dispatchEvent&&window.CustomEvent){var u=new CustomEvent(t,c);e.dispatchEvent(u)}}(this.eA,"waiting"))},a.Vg=function(){var e,t=this;this.rg&&this.rg.pausedOnWaiting===!1&&!this.eA.ended&&((e=this.eA.play())==null||e.catch(function(c){return t.Ci.i(lt,"custom waiting ended, call play() fail.",c)}))},a.Ay=function(){this.Lm&&(this.Lm.destroy(),this.Lm=void 0)},a.by=function(){this.Ci.i(lt,"destroy mse"),this.Do.mse=void 0,this.Jm&&(this.Jm.destroy(),this.Jm=void 0)},a.uy=function(){this.rg&&(this.rg.destroy(),this.rg=void 0)},a.Ug=function(e){var t,c,u=this;e===void 0&&(e=!0),this.Ci.i(lt,"reload. play: "+e),(t=this.Do.cOutput)==null||t.reset(),this.Do.live&&!this.Do.isLiveShiftKwai2||(this.Do.stat.startFromSec=this.eA.currentTime),this.Do.isLiveShiftKwai2&&(this.Do.stat.liveShiftKwai2Params.paramName="offset",this.Do.stat.liveShiftKwai2Params.time=this.eA.currentTime),this.fg=this.Do.lctx.abr?-1:this.Do.lctx.currentIdx,this.hA=[],this.oA=void 0,this.uA=!1,this.vy(),this.RA(h.h.retry),e?(c=this.eA.play())==null||c.catch(function(g){return u.Ci.i(lt,"reload. call play() fail.",g)}):this.eA.pause()},a.qg=function(){this.ig||(this.ig=setInterval(this.yy.bind(this),100))},a.oy=function(){this.ig&&(clearInterval(this.ig),this.ig=void 0)},a.vy=function(){this.Ci.i(lt,"stop video"),this.eA&&(this.Ay(),this.uy(),this.by(),URL.revokeObjectURL(this.eA.src),this.eA.src&&(this.eA.src=""))},a.yy=function(){var e=this.Do;e.stat.isLive?(this.vg||X.a.safari||X.a.ios||!e.stat.autoPlaybackRateConf||(this.Ci.i(lt,"autoPlayback rate on."),this.vg=new rr(e)),this.vg&&(this.vg.enabled=!e.stat.liveShiftActive,this.vg.tick())):this.vg&&(this.vg.enabled=!1);var t=this.eA;this.$m&&e.stat.firstFrameLoaded&&this.$m.check();var c=t.buffered.length>1,u=this.Io===bt.WAITING||this.Io===bt.LOADING||this.Io===bt.INIT||this.Io===bt.SEEK||this.Io===bt.SELECT_BITRATE,g=u&&!t.seeking,R=t.currentTime,Q=this.ag.tick(u);if(Q){if(Q==="fix"){var se,fe=t.buffered.start(0);t.buffered.length&&fe>R&&(this.Ci.i(lt,"play stuck. current time: "+R+" not in buffer range. "+fe),this.internalSeek(fe+.1)),this.Ci.i(lt,"play stuck. restart download."),(se=this.Lm)==null||se.setDownloadEnabled(!0)}}else{if(g||(this.yg=0),(c||g)&&!this.rg&&!t.ended&&this.Jm&&!this.Jm.hasCleanUpTask()&&this.Jm.hasSourceBufferAppendStarted()){var xe=e.currentBuffer(R),Fe=e.nextBuffer(R);g?!xe||xe.end-R<1?(Fe&&this.Ci.i(lt,"play stuck "+R+". buffered num: "+e.bufferSliceNum+" jump to next buf"),this._y(Fe)):this.eA.buffered.length>1&&xe.end-R>1?(xe&&this.Ci.i(lt,"play stuck "+R+". multi buf. current time+"),this._y(xe)):xe.end-R>1&&(this.yg>2?(this.Ci.i(lt,"play stuck "+R+". current time +, "+t.seeking),this.internalSeek(R+.5),this.yg=0):this.yg++):c&&xe&&xe.end-R<=.1&&(Fe&&this.Ci.i(lt,"try jump next C"),this._y(Fe))}this.hA.length&&this.Cy()}},a._y=function(e){if(e){var t=e.start+(X.a.safari?.3:.001);t>e.end&&(t=e.start),this.gg===t&&(t+=.1),this.gg=t,this.internalSeek(t),this.Ci.i(lt,"jump to "+t)}},a.Cy=function(){var e=this.hA[0];e&&this.eA.currentTime>=e.data.time&&this.Do.isTimeinBuffered(this.eA.currentTime)&&(e.switched||this.emit(D.a.LEVEL_SWITCHED,s()({},e.data)),this.emit(D.a.LEVEL_SWITCH_PLAYING,e.data),this.hA.shift())},a.RA=function(e){if(this.Ci.i(lt,"_load start sec:",this.Do.stat.startFromSec),!X.a.mobile&&!ht.isMSECodecCapabilityNormal()){var t="MSE is not fully functional. h264: "+ht.TYPE_SUPPORTED.h264+"; aac: "+ht.TYPE_SUPPORTED.aac;return this.Ci.i(lt,t),void this.emit(D.a.ERROR,Object(L.e)(L.b.MSE_ERROR,L.a.MSE_CAPABILITY_ERROR,t))}this.Do.stat.srcType!==h.l.KWAI&&this.Do.stat.srcType!==h.l.KWAI_FLV_ABR||this.Do.lctx.levels.length?(v.prototype.RA.call(this,e),this.Sa=void 0,this.nA=void 0,this.Io=bt.LOADING,this.hA=[],this.oy(),this.pg=void 0,this.gg=NaN,this.Do.fallback.stop(),this.Do.stat.isLive&&(this.Ci.i(lt,"live stream clear frag"),this.Do.lctx.clearFrag()),this.Ob&&this.Ob.reset(),this.Ay(),this.uy(),this.wg(),this.Do.config.startPlayBufferSec&&!e&&this.Jm&&this.Jm.setStartBufSec(this.Do.config.startPlayBufferSec),this.TA(),this.my(),this.emit(D.a.LOAD,{type:e}),this.Lm&&(this.Do.initLiveShiftKwai2StartSec(),this.Lm.loadSource()),this.Do.stat.isLive&&(this.lg=!1,this.Do.config.autoPlaybackRate&&this.vg&&(this.vg.enabled=!0))):this.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.SRC_EMPTY,"level cnt 0"))},a.ty=function(e){var t;this.Do.mse&&this.Do.mse.mediaSegment(e.segments),(t=this.Do.liveTime)==null||t.onParsing(e),this.Do.loadRec.onParsing(e),this.rg&&this.rg.onParsingData(e)},a.Dg=function(){this._g.audio=this._g.main=void 0,this.Cg=!this.Do.stat.avSeparated,this.fl=0,this.Ig=[],this.Ci.i(lt,"reset initSegment ready: "+this.Cg)},a.AA=function(){v.prototype.AA.call(this),this.Io!==bt.NONE&&(this.Io=bt.NONE,this.jg(),this.Cy(),this.eA.paused||this.bA())},a.IA=function(){this.eA.seeking||(this.sg=this.eA.currentTime),v.prototype.IA.call(this),Mi()&&performance.now()-this.mg>Ve.i&&(this.Yg(),this.mg=performance.now())},a.dA=function(){this.Sa&&v.prototype.dA.call(this),this.Ci.i(lt,"seeked. "+this.Do.currentTime+"/"+this.Do.streamTime.getStreamTime(this.Do.currentTime))},a.lA=function(){if(this.Ci.i(lt,"video waiting "+this.Do.currentTime),this.lg&&this.Do.stat.box===h.i.flv&&this.Do.stat.isLive)this.stopLoad();else{this.Io=this.Io||bt.WAITING;var e=this.Do.bufferedSec,t=!this.eA.ended&&!this.eA.seeking&&this.Io===bt.WAITING;this.emit(D.a.WAITING,{block:t,bufferedSec:e})}},a.gA=function(e){var t,c,u;if(this.Ci.i(lt,"video error@"+this.Do.currentTime+" "+((t=this.eA.error)==null?void 0:t.message)),!this.nA&&this.Sa){var g=((c=this.eA.error)==null?void 0:c.code)||0,R=((u=this.eA.error)==null?void 0:u.message)||"video error",Q=Object(L.d)(L.c[g]||L.a.VIDEO_ERROR,R);this.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,Q,R))}},a.DA=function(){var e;v.prototype.DA.call(this),this.Lm&&this.Lm.heartbeat(),this.Do.isLiveShift&&this.Do.updateLiveShiftStatuByTime(),(e=this.rg)==null||e.heartbeat(),this.Jm&&this.Do.isLiveShiftKwai2&&this.Jm.updateDuration(this.Do.getLiveShiftKwai2Duration()),this.Yg()},a.Rg=function(){this.Lm&&(!this.Ob&&V&&(this.Ob=new V(this.Do)),this.Ob&&this.Ob.addTracks(this.Do.lctx.subtitleTracks))},a.py=function(){this.cg=!0,this.eA.pause()},a.gy=function(){var e=this;!this.ug&&this.rg&&(this.ug={play:this.eA.play,pause:this.eA.pause},this.eA.pause=function(){e.ug.pause.call(e.eA),e.rg&&e.rg.waiting&&e.rg.isCanvasRenderer&&!e.cg&&(e.rg.pausedOnWaiting=!0),e.cg=!1},this.eA.play=function(){return e.rg&&e.rg.waiting&&e.rg.isCanvasRenderer?(e.rg.pausedOnWaiting=!1,Promise.resolve()):e.ug.play.call(e.eA)})},m()(_,[{key:"type",get:function(){return h.a.mse}}])}(tn),Mb={av1:['video/mp4; codecs="av01.0.08M.08,mp4a.40.2"'],hevc:['video/mp4; codecs="hev1.1.6.L120.90,mp4a.40.2"','video/mp4; codecs="hvc1.1.6.L120.90,mp4a.40.2"'],h264:['video/mp4; codecs="avc1.4D4028,mp4a.40.2"'],opus:['video/mp4; codecs="opus"'],mp3:['video/mp4; codecs="mp3"'],aac:['video/mp4; codecs="mp4a.40.2"']},Pb={av1:['video/mp4; codecs="av01.0.08M.10"'],hevc:['video/mp4; codecs="hev1.2.2.L120.90"','video/mp4; codecs="hvc1.2.2.L120.90"'],h264:['video/mp4; codecs="avc1.6e0028"']},Ub={av1:['video/mp4; codecs="av01.0.12M.08"'],hevc:['video/mp4; codecs="hev1.1.6.L150.90"','video/mp4; codecs="hvc1.1.6.L150.90"'],h264:['video/mp4; codecs="avc1.4D4033"']},Bb={av1:['video/mp4; codecs="av01.0.12M.10"'],hevc:['video/mp4; codecs="hev1.2.2.L150.90"','video/mp4; codecs="hvc1.2.2.L150.90"'],h264:['video/mp4; codecs="avc1.6e0028"']},Vb={mp4:["video/mp4","video/quicktime"],flv:["video/x-flv"],ts:["video/mp2t"],matroska:["video/x-matroska","video/webm"],hls:["application/vnd.apple.mpegURL","application/x-mpegURL"],hls_ts:["application/vnd.apple.mpegURL","application/x-mpegURL"],hls_fmp4:["application/vnd.apple.mpegURL","application/x-mpegURL"],aac:["audio/aac"],mp3:["audio/mpeg","audio/mp3"]},Cn=function(){function v(){}return v.isMSEAvailable=function(){if(v.Iy!==void 0)return v.Iy;if(!cc)return v.Iy=!1,!1;var _=Yt(),a=Jt();if(v.Oy=!!(_&&a&&a.prototype&&typeof a.prototype.appendBuffer=="function"&&typeof a.prototype.remove=="function"),_&&X.a.mobile&&v.Oy)try{var e=new _,t=document.createElement("video");t.src=URL.createObjectURL(e),URL.revokeObjectURL(t.src),v.Iy=!0}catch(c){v.Iy=!1}else v.Iy=v.Oy;return v.Iy},v.isMSECodecCapabilityNormal=function(){return v.isMSEAvailable()&&v.TYPE_SUPPORTED.h264},v.isSupported=function(_){return _===void 0&&(_=h.c.h264),v.isMSECodecSupported(_)&&v.isMSEAvailable()},v.isMSECodecSupported=function(_,a,e){if(_===void 0&&(_=h.c.h264),a===void 0&&(a=h.q.FHD),e===void 0&&(e=!1),X.a.msedge&&X.a.platform==="windows"||X.a.msie)return v.isMSEAvailable()&&_===h.c.h264;if(v.wy(_,a)===!1)return!1;var t=v.Ey(_,a,e);return!!t&&t.reduce(function(c,u){return c||v.isMSECodecStrSupported(u)},!1)},v.isVideoCodecSupported=function(_,a,e){if(_===void 0&&(_=h.c.h264),a===void 0&&(a=h.q.FHD),e===void 0&&(e=!1),X.a.msedge&&X.a.platform==="windows"||X.a.msie)return _===h.c.h264;if(v.wy(_,a)===!1)return!1;var t=v.Ey(_,a,e);if(!t)return!1;var c=v.jy();return t.reduce(function(u,g){return u||!(!c||!c.canPlayType(g))},!0)},v.isVideoBoxSupported=function(_){if(_===void 0&&(_=h.i.mp4),_===h.i.unknown)return!0;var a=Vb[_];if(!a)return!1;var e=v.jy();return a.reduce(function(t,c){return t||!(!e||!e.canPlayType(c))},!1)},v.isVideoCodecStrSupportedInMp4=function(_,a){a===void 0&&(a="");try{var e=v.jy();return!(!e||!e.canPlayType((a||"video")+'/mp4;codecs="'+_+'"'))}catch(t){}return!1},v.isWebRTCSupported=function(){return"RTCPeerConnection"in window&&"RTCRtpTransceiver"in window},v.isMSECodecStrSupportedInMp4=function(_,a){var e;return a===void 0&&(a=""),!((e=Yt())==null||!e.isTypeSupported((a||"video")+'/mp4;codecs="'+_+'"'))},v.isMSECodecStrSupported=function(_){var a=Yt();return!(!a||typeof a.isTypeSupported!="function"||!a.isTypeSupported(_))},v.isChangeTypeSupported=function(){if(v.Cv===void 0){var _=Jt();v.Cv=!(!_||_.prototype.changeType===void 0)}return v.Cv},v.getVideoCodecCompatibilityByCodec=function(_,a,e){a===void 0&&(a=h.q.FHD),e===void 0&&(e=!1);var t=h.d.unsupported,c=!0;_===h.c.h264?t=a===h.q.UHD_4K?(e?v.TYPE_SUPPORTED.h264Hdr4k:v.TYPE_SUPPORTED.h2644k)?h.d.buildin:h.d.unsupported:(e?v.TYPE_SUPPORTED.h264Hdr:v.TYPE_SUPPORTED.h264)?h.d.buildin:h.d.unsupported:_===h.c.av1?(t=a===h.q.UHD_4K?(e?v.TYPE_SUPPORTED.av1Hdr4k:v.TYPE_SUPPORTED.av14k)?h.d.buildin:h.d.unsupported:(e?v.TYPE_SUPPORTED.av1Hdr:v.TYPE_SUPPORTED.av1)?h.d.buildin:h.d.unsupported,c=de()>=2):_===h.c.hevc?(t=a===h.q.UHD_4K?(e?v.TYPE_SUPPORTED.hevcHdr4k:v.TYPE_SUPPORTED.hevc4k)?h.d.buildin:h.d.unsupported:(e?v.TYPE_SUPPORTED.hevcHdr:v.TYPE_SUPPORTED.hevc)?h.d.buildin:h.d.unsupported)===h.d.buildin?(X.a.msedge&&X.a.platform==="windows"&&(t=h.d.unsupported),c=!!(de()>=2||X.a.safari)):c=v.wasmSmooth:_!==h.c.kvc3&&_!==h.c.kvc4&&_!==h.c.kvc5&&_!==h.c.kvc6&&_!==h.c.vvc&&_!==h.c.kvc30&&_!==h.c.bvc2||(t=typeof WebAssembly<"u"?h.d.wasm:h.d.unsupported,c=v.wasmSmooth);var u=!1;return t===h.d.buildin&&(u=v.isChangeTypeSupported(),_===h.c.hevc&&v.wy(_,a)===!1&&(t=h.d.wasm)),{decoder:t,smooth:t!==h.d.unsupported&&c,mix:u}},v.getPlayTestDefinition=function(_){if(typeof _.width=="number"&&typeof _.height=="number"){if((_==null?void 0:_.width)>1920||(_==null?void 0:_.height)>1920)return h.q.UHD_4K}else if(_.qualityType.toLowerCase().indexOf("4k")!==-1)return h.q.UHD_4K;return h.q.FHD},v.Ey=function(_,a,e){a===void 0&&(a=h.q.FHD),e===void 0&&(e=!1),_===h.c.unknown&&(_=h.c.h264);var t=e?Pb:Mb,c=e?Bb:Ub;return a===h.q.UHD_4K&&c[_]||t[_]},v.wy=function(_,a){if(a===void 0&&(a=h.q.FHD),_===h.c.hevc&&v.playHEVCTest&&(a===h.q.UHD_4K&&v.playHEVCTest[a]===!1||a!==h.q.UHD_4K&&v.playHEVCTest[h.q.FHD]===!1))return!1},v.jy=function(){return sc||ge()||(sc=document.createElement("video")),sc},v.ky=function(){try{return typeof WebAssembly<"u"&&typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(_){return!1}},v.My=function(){return typeof WebAssembly<"u"&&WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))},m()(v,null,[{key:"isSupportSimd",get:function(){return v.Sy===void 0&&(v.Sy=v.My()),v.Sy}},{key:"isSupportThreads",get:function(){return v.By===void 0&&(v.By=v.ky()),v.By}},{key:"wasmSmooth",get:function(){if(v.Ty===void 0){var _=de();v.Ty=!!(v.isSupportHW&&v.isSupportThreads&&_&&_>=6)}return v.Ty}},{key:"isSupportHW",get:function(){return!!Object(Ut.b)().performance}},{key:"playHEVCTest",get:function(){return this.Dy},set:function(_){this.Dy=_}}])}();Qi=Cn,Cn.Cv=void 0,Cn.Iy=void 0,Cn.Oy=void 0,Cn.Sy=void 0,Cn.By=void 0,Cn.Ty=void 0,Cn.Dy=void 0,Cn.TYPE_SUPPORTED={mpeg:Qi.isMSECodecStrSupported("audio/mpeg"),mp3:Qi.isMSECodecSupported(h.c.mp3),opus:Qi.isMSECodecSupported(h.c.opus),aac:Qi.isMSECodecSupported(h.c.aac),hevc:Qi.isMSECodecSupported(h.c.hevc),hevc4k:Qi.isMSECodecSupported(h.c.hevc,h.q.UHD_4K),hevcHdr:Qi.isMSECodecSupported(h.c.hevc,h.q.FHD,!0),hevcHdr4k:Qi.isMSECodecSupported(h.c.hevc,h.q.UHD_4K,!0),av1:Qi.isMSECodecSupported(h.c.av1),av14k:Qi.isMSECodecSupported(h.c.av1,h.q.UHD_4K),av1Hdr:Qi.isMSECodecSupported(h.c.av1,h.q.FHD,!0),av1Hdr4k:Qi.isMSECodecSupported(h.c.av1,h.q.UHD_4K,!0),h264:Qi.isMSECodecSupported(h.c.h264),h2644k:Qi.isMSECodecSupported(h.c.h264,h.q.UHD_4K),h264Hdr:Qi.isMSECodecSupported(h.c.h264,h.q.FHD,!0),h264Hdr4k:Qi.isMSECodecSupported(h.c.h264,h.q.UHD_4K,!0)};var ht=Cn,Fb=n(49),zs="dec-wrapper",jb=function(){function v(a){var e=this;this.Ai=void 0,this.Do=void 0,this.Ry=void 0,this.Ly=void 0,this.At=0,this.zc=function(t){var c=t.data;e.Ly&&e.Ai.emit(c.event,c.data)},this.Jc=function(t){e.Do.logger.i(zs,"worker onerror",t.message),e.Ai.emit(D.a.ERROR,Object(L.e)(L.b.DECODER_ERROR,L.a.DECODER_DEC_ERROR,"dec: "+t.message))},this.Do=a,this.Ai=a.evt}var _=v.prototype;return _.init=function(a){a===void 0&&(a=!0),this.Do.logger.i(zs,"init worker: "+a),a&&(this.Ly=ae()(61)),this.Ly?(this.Ly.addEventListener("message",this.zc),this.Ly.addEventListener("error",this.Jc)):this.Ry=new Fb.a(this.Do.logger,this.Ai)},_.start=function(a,e,t,c,u){this.Do.logger.i(zs,"start");var g=this.Do.getDecConfig();this.Ly?this.Ly.postMessage({cmd:q.a.INIT_265,id:this.At,lib:a,config:g,simd:t,threads:e,codecType:c,decoderType:u,contextId:this.Do.id,hasExternalLogger:!!this.Do.config.logger}):this.Ry&&this.Ry.init(this.At,a,g,t,e,c,u)},_.destroy=function(){this.Ly?(this.Ly.postMessage({cmd:q.a.DESTROY}),this.Ly.removeEventListener("message",this.zc),this.Ly.removeEventListener("error",this.Jc),this.Ly.terminate()):this.Ry&&(this.Ry.destroy(),this.Ry=void 0)},_.append=function(a){this.Ly?this.Ly.postMessage({cmd:q.a.APPEND_DATA,data:a}):this.Ry&&this.Ry.appendData(a)},_.endOfData=function(){this.Ly?this.Ly.postMessage({cmd:q.a.END_OF_DATA}):this.Ry&&this.Ry.endOfData()},_.updateMediaInfo=function(a){this.Ly?this.Ly.postMessage({cmd:q.a.MEDIA_INFO,mediaInfo:a}):this.Ry&&this.Ry.updateMediaInfo(a)},_.reset=function(a){this.Ly?this.Ly.postMessage({cmd:q.a.RESET,decId:this.At,seeking:a}):this.Ry&&this.Ry.reset(this.At,a)},_.seek=function(a,e){this.Do.logger.i(zs,"seek["+e+"]: time: "+a),this.Ly?this.Ly.postMessage({cmd:q.a.SEEK,time:a,id:e}):this.Ry&&this.Ry.seek(a,e)},_.update=function(a,e,t,c,u,g){this.Ly?this.Ly.postMessage({cmd:q.a.UPDATE_STATE,streamTime:a,output:e,active:t,frameBufLen:c,playbackRate:u,maxFrameBufLen:g}):this.Ry&&this.Ry.updateState(a,e,t,c,u,g)},m()(v,[{key:"id",get:function(){return this.At},set:function(a){this.At=a}},{key:"isUseingWorker",get:function(){return!!this.Ly}}])}(),Hb=[4,2],Gb=[8,6,4,2],Qa=function(v){return v[v.data=0]="data",v[v.end=1]="end",v}(Qa||{}),Ai="v-dec-proxy",Ks=function(v){function _(e){var t;return(t=v.call(this,e)||this).Ny=[],t.Qy=void 0,t.Ym=0,t.xy=!0,t.Vy=[],t.Gm={streamTime:0,stoped:!1,output:h.s.canvas,decAppendActive:!0,frameBufLen:0,maxFrameBufLen:0,pictMode:je.a.contain},t.Uy=void 0,t.Qu=h.c.hevc,t.Vf=h.t.kw265,t.Ju=1,t.Fy=void 0,t.Py=void 0,t.Hy=void 0,t.Yy=!1,t.Gy=function(c){t.Ci.i(Ai,"dec lib loaded"),t.Do.stat.wasmLibHitCache=c.hitCache,t.Ky(c.lib)},t.Zy=function(c){t.Do.updateVideoPlaybackQuality(c.decoded,c.droped),c.decId===t.Ju&&t.sf.append(c.frame)},t.Wy=function(c){var u;if(t.Ci.i(Ai,"seek["+c.id+"]: decoder seek event.",c),((u=t.zu)==null?void 0:u.id)!==c.id&&t.Xy(t.seek))return void(c.preventFollowUp=!0);c.hitCache&&(t.if=!1),c.hitCache||(t.ub(!0),t.hf()),t.oc(c)},t.Xy=function(c){var u;if((u=t.Py)!=null&&u.id&&t.Py.time>=0){t.Ci.i(Ai,"seek["+t.Py.id+"]: has pending seek.");var g=t.Py,R=g.time,Q=g.id;return t.Py=void 0,t.zu={id:Q,time:R,state:"dec"},t.seek(R,Q),!0}return!1},t.Km=function(){var c,u;t.Ci.i(Ai,"on dec ready."),t.if=!1,t.ef!==!1||(c=t.Do.video)!=null&&c.ended||(u=t.Do.video)==null||(u=u.play())==null||u.catch(function(g){return t.Ci.i(Ai,"on dec ready, call play() fail.",g)}),t.ef=void 0},t.Zm=function(){var c,u;(c=t.Do.video)!=null&&c.ended||(t.Ci.i(Ai,"on dec waiting."),t.rf.onWaiting(),t.if=!0,t.ef===void 0&&(t.ef=!((u=t.Do.video)==null||!u.paused)))},t.zy=function(c){for(t.Ci.i(Ai,"on dec init complete"),t.No=!0,t.Jy();t.Ny.length;){var u=t.Ny.shift();u&&(u.type===Qa.data&&u.data?t.Qy.append(u.data):u.type===Qa.end&&t.Qy.endOfData())}t.Do.stat.wasmSimd=c.simd,t.Do.stat.wasmThreads=c.threads,t.Do.stat.wasmDecoder=c.decoderType},t.qy=function(){t.Yy=!0},t.Wm=function(c){var u,g;t.Ci.i(Ai,"seek["+c.id+"]: renderer seek event",c,"pending:",t.Py),c.hitCache?(u=t.Py)!=null&&u.id?t.Xy(t.seek):(t.if=!1,t.oc(c)):(t.Ai.emit(D.a.DECODER_WAITING),(g=t.Py)!=null&&g.id?t.Xy(t.Qy.seek):(t.zu&&(t.zu.state="dec"),t.Qy.seek(c.time,c.id)))},t.Xm=function(){var c;t.Ci.i(Ai,"on ren waiting."),t.ef===void 0&&(t.ef=!((c=t.Do.video)==null||!c.paused)),t.Ai.emit(D.a.DECODER_WAITING)},t.zm=function(){t.Km()},t.$y=function(){t.Ci.i(Ai,"renderer buf expired"),t.sf.reset(!0)},t.t_=function(c){t.xy=!!c.needMore},t.Yb(),t.Hy=new Et(t.Do),t.Gm.maxFrameBufLen=t.rf.maxFrameBufLen,t.Uy=ht.isSupportSimd,e.stat.wasmThreadsEnabled=!!(ht.isSupportThreads&&t.Do.config.maxVideoDecThreads>1),t.Qy=new jb(e),t.O.push(t.Qy),Oe&&t.O.push(t.Do.fallback.register(le.RELOAD_WASM,new Oe(t.Do).setRetryFunc(t.i_.bind(t)))),t.Qy.id=t.sf.id=t.Ju,t}T()(_,v);var a=_.prototype;return a.Yb=function(){var e=this,t=this.Ai;this.O.push(t.prependListener(D.a.DEC_LIB_LOADED,this.Gy),t.prependListener(D.a.DEC_INIT_COMPLETE,this.zy),t.prependListener(D.a.DECODER_IMG,this.Zy),t.prependListener(D.a.DEC_VIDEO_READY,this.Km),t.prependListener(D.a.DECODER_SEEK,this.Wy),t.prependListener(D.a.DECODER_WAITING,this.Zm),t.prependListener(D.a.DECODER_DATA_END,function(){return e.sf.endOfData()}),t.prependListener(D.a.DECODER_BUF_LOW,function(){return e.qy()}),t.prependListener(D.a.DECODER_DROP_FRAME,function(c){return e.sf.dropFrame(c)}),t.prependListener(D.a.RENDERER_BUF_UPDATE,this.t_),t.prependListener(D.a.RENDERER_BUF_EXPIRED,this.$y),t.prependListener(D.a.RENDERER_SEEK,this.Wm),t.prependListener(D.a.RENDERER_WAITING,this.Xm),t.prependListener(D.a.RENDERER_WAITING_END,this.zm))},a.init=function(e,t){this.Ci.i(Ai,"init codecType: "+e+" bitDepth: "+t),e&&(this.Qu=e),e===h.c.kvc3?this.Vf=h.t.kvc3:e===h.c.kvc4?this.Vf=h.t.kvc4:e===h.c.kvc5?this.Vf=h.t.kvc5:e===h.c.kvc6?this.Vf=h.t.kvc6:e===h.c.hevc?(this.Vf=h.t.kw265,t&&t>8&&(this.Vf=h.t.h265)):e!==h.c.bvc2&&e!==h.c.kvc30&&e!==h.c.vvc||(this.Vf=h.t.kvc30),this.sf.id=this.Ju,this.sf.init(!(!X.a.chrome||this.Do.stat.mainThreadRendering!==!1)),this.Qy.init(!this.Do.config.mainThreadDecoding),this.e_()},a.setMediaInfo=function(e){v.prototype.setMediaInfo.call(this,e),this.Jy()},a.appendData=function(e){this.No?(this.Yy=!1,this.Qy.append(e)):this.Ny.push({type:Qa.data,data:e})},a.endOfData=function(){this.Ci.i(Ai,"endOfData"),this.No?this.Qy.endOfData():this.Ny.push({type:Qa.end})},a.decoderChange=function(e,t){this.Ci.i(Ai,"decoderChange type: "+e+" time: "+t),this.Fy=e;var c=this.Vy;e===h.d.wasm?(!c.length||c.length&&c[c.length-1].end!==-1)&&c.push({start:t,end:-1}):e===h.d.buildin&&c.length&&c[c.length-1].end===-1&&(c[c.length-1].end=t)},a.onParsingData=function(e){var t=this;e.segments.forEach(function(c){c.type===h.o.AUDIO&&t.Ym++})},a.heartbeat=function(){var e;this.Ci.i(Ai,"hb decAppend: "+this.xy+" waiting: "+this.if+" seeking: "+((e=this.zu)==null?void 0:e.id))},a.seek=function(e,t){var c,u;this.Ci.i(Ai,"seek["+t+"]: seek. time:"+e+". state:"+(this.zu?this.zu.state+"|"+((c=this.zu)==null?void 0:c.id):""));var g=e*Ve.b;(u=this.zu)!=null&&u.id?this.zu.state==="renderer"?(this.Ci.i(Ai,"seek["+t+"]: pending."),this.Py={id:t,time:e,state:"pending"}):(this.Ci.i(Ai,"seek["+t+"]: seek start. dec seeking."),this.zu={id:t,time:e,state:"dec"},this.Qy.seek(g,t),this.start()):(this.Ci.i(Ai,"seek["+t+"]: seek start."),this.zu={id:t,time:e,state:"renderer"},this.sf.seek(g,t),this.start())},a.seekWithLoad=function(){this.Ci.i(Ai,"seekWithLoad. dec ready: "+this.No),this.No?(this.ub(!0),this.hf()):this.Ny=[]},a.clean=function(){this.Ci.i(Ai,"clean"),this.ub(!1)},a.screenshot=function(e){this.sf.screenshot(e)},a.hf=function(){var e,t=(e=this.Do.cOutput)==null?void 0:e.canvas;if(t instanceof HTMLCanvasElement){var c,u,g=this.Do.currentTime*Ve.b,R=!1,Q=!((c=this.Do.video)==null||!c.ended),se=((u=this.Do.video)==null?void 0:u.playbackRate)||1,fe=this.isCanvasRenderer?h.s.canvas:h.s.video,xe=this.af(t),Fe=this.xy,Ne=this.Gm,He=$.a.getPictModeByCss(t);if(this.Do.cOutput&&this.Do.cOutput.rendererType!==fe&&(Ne.output=fe,R=!0,this.Ai.emit(D.a.VIDEO_RENDERER_CHANGE,{enabled:!0,type:Ne.output,canvas:void 0})),g!==0||this.Ym||(g=-1),Ne.streamTime===g&&Ne.stoped===Q&&Ne.decAppendActive===Fe&&Ne.frameBufLen===this.sf.frameBufLen&&Ne.maxFrameBufLen===this.rf.maxFrameBufLen&&Ne.pictMode===He||(Ne.streamTime=g,Ne.stoped=Q,Ne.decAppendActive=Fe,Ne.frameBufLen=this.sf.frameBufLen,Ne.maxFrameBufLen=this.rf.maxFrameBufLen,Ne.pictMode=He,this.Do.stat.frameBufLen=Ne.frameBufLen,R=!0),!R&&!this.if&&!xe)return;(R||this.if)&&this.Qy.update(g,fe,Fe,this.sf.frameBufLen,se,Ne.maxFrameBufLen),(R||xe)&&this.sf.update(g,this.yt.w,this.yt.h,Q,fe,Ne.maxFrameBufLen,He)}},a.Jy=function(){if(this.Sa.length&&this.No){var e=this.Sa.shift();if(e){var t={};e.rotation&&(t.rotation=((e==null?void 0:e.rotation)||0)%360,t.rotation<0&&(t.rotation+=360)),e.fps&&(t.fps=e.fps),e.colorInfo&&(t.colorInfo=JSON.parse(JSON.stringify(e.colorInfo))),t.sar=e.sar,this.Qy.updateMediaInfo(t),this.sf.updateMediaInfo(t)}}},a.ub=function(e){e===void 0&&(e=!1),this.Ci.i(Ai,"reset",e),this.Ju++,this.xy=!0,this.Ym=0,this.Vy=[],e||(this.zu=void 0,this.Py=void 0),this.Fy===h.d.wasm&&this.Vy.push({start:0,end:-1}),this.Qy.id=this.sf.id=this.Ju,this.Qy.reset(e),this.sf.reset(e),this.if=!0},a.e_=function(e){e===void 0&&(e=!1),this.Uy===void 0||this.Do.stat.wasmThreadsEnabled===void 0?(this.Uy=!!ht.isSupportSimd,this.Do.stat.wasmThreadsEnabled=!!(ht.isSupportThreads&&this.Do.config.maxVideoDecThreads>1),this.Hy.load(e,this.Vf,this.Uy,this.Do.stat.wasmThreadsEnabled)):this.Hy.load(e,this.Vf,this.Uy,this.Do.stat.wasmThreadsEnabled)},a.Ky=function(e){this.Ci.i(Ai,"init dec"),this.start();var t=this.Do.stat.wasmThreadsEnabled?this.n_():1;this.Qy.id=this.Ju,this.Qy.start(e,t,!!this.Uy,this.Qu,this.Vf)},a.n_=function(){var e=Math.min(de(),this.Do.config.maxVideoDecThreads),t=Gb;this.Vf===h.t.kw265&&(t=Hb);for(var c=0;c<t.length;c++)if(e>=t[c])return t[c];return t[t.length-1]},a.oc=function(e){this.Ci.i(Ai,"seek["+e.id+"]: seeked. hit cache: "+e.hitCache+"."),this.zu=void 0},a.i_=function(){this.e_(!0)},m()(_,[{key:"isCanvasRenderer",get:function(){var e=this.Vy.length;if(e)for(var t=this.Do.currentTime,c=e-1;c>=0;c--){var u=this.Vy[c];if(u&&t>=u.start&&(t<u.end||u.end===-1))return!0}return!1}},{key:"decBufLow",get:function(){return this.Yy}}])}(Ue),id=536870912,Ws={alwaysSeekKeyframe:!1,lazyLoadMaxDuration:-1,lazyLoadRecoverDuration:20,webWorker:!0,appendErrorMaxRetry:3,credentials:!1,streamingMux:!0,autoPlaybackRate:!0,autoPlaybackRateConf:void 0,enableSoftwareAES:!0,startPlayBufferSec:0,startFromSec:-1,startFromKeyframe:!0,defaultSpts:-5e3,resourceBuffer:!0,resourceBufferSize:500,ntp:!0,ensureVideo:!1,adaptive:!0,abrSpeedTest:!0,httpRangeType:h.e.STANDARD,enableAacPriv:!1,mseDecErrSkip:2,maxAudioFramesDrift:5,forceKeyFrameOnDiscontinuity:!1,videoDropFramePolicy:h.r.AUTO,videoDecBlockPolicy:h.p.WAITING,videoFrameBufferSize:id,maxVideoDecThreads:8,mainThreadRendering:!1,mainThreadDecoding:!1,wasmDecoderEnabled:!X.a.mobile,maxRetry:3,connectionTimeout:1e4,transmissionTimeout:3e4,retryDelay:100,maxFragFailSec:11,flvLoadEndError:!0,catchUpPausedLive:!0,breakpointContinuation:!0,manifestLoadingMaxRetry:3,manifestConnectionTimeout:1e4,manifestTransmissionTimeout:1e4,manifestLoadingRetryDelay:1,levelLoadingMaxRetry:3,levelConnectionTimeout:1e4,levelTransmissionTimeout:1e4,levelLoadingRetryDelay:100,levelNoUpdateRetry:10,emeEnabled:!0,widevineLicenseUrl:"",playreadyLicenseUrl:"",fairplayLicenseUrl:"",keyLoadingMaxRetry:3,keyConnectionTimeout:1e4,keyTransmissionTimeout:5e3,keyLoadingRetryDelay:300,sdpConnectionTimeout:1e4,peerConnectionTimeout:1e4,peerConnectionMaxRetry:5,peerConnectionRetryDelay:3e3,decLibLoadingMaxRetry:2,decLibConnectionTimeout:5e3,decLibLoadingRetryDelay:300,liveDelayFragNum:3,liveShiftDelaySec:60,liveShiftType:h.g.NONE,preferNativeLoader:void 0,playbackAbilityCacheTimeout:864e5,adjustFragTime:!0},zb={maxRetry:1,retryDelay:100,connectionTimeout:1e4,levelConnectionTimeout:1e4,manifestConnectionTimeout:1e4},$a=function(){function v(){}return v.isStreamingSupported=function(){return v.s_===void 0&&(v.s_=Be.isSupported()||!!B.isSupportChunk()),v.s_},v.processConfig=function(_){if(_){var a=_.src,e=_.preprocessUrl,t=_.logger;_=s()(JSON.parse(JSON.stringify(_)),{src:a,preprocessUrl:e,logger:t})}_.isLive?Ws.videoFrameBufferSize=104857600:Ws.videoFrameBufferSize=id;var c=be(_.box)?s()({},Ws,zb):s()({},Ws);return s()(c,_),c.wasmDecoderEnabled=c.wasmDecoderEnabled&&!!Ks,c.startPlayBufferSec=Math.min(5,Math.max(0,c.startPlayBufferSec)),this.r_(c),Worker||(c.webWorker=!1),c},v.r_=function(_){var a=_.autoPlaybackRateConf;if(a){var e=a.rule;if(e&&Array.isArray(e)&&((e=e.filter(function(t){return t.upper>t.lower&&t.rate>0})).sort(function(t,c){return c.rate-t.rate}),e.length>1))return a.rule=e,void(_.autoPlaybackRateConf=a)}},v}();$a.s_=void 0;var lc="event-bus-consumer-manager",Kb=function(){function v(a,e){this.Ci=void 0,this.h_=[],this.Ai=void 0,a.i(lc,"constructor"),this.Ci=a,this.Ai=e,this.o_()}var _=v.prototype;return _.destroy=function(){this.Ci.i(lc,"destroy"),this.Ai.removeAllListeners(),this.h_.splice(0,this.h_.length)},_.register=function(a,e){e===void 0&&(e=!1),this.Ci.i(lc,"register",a.getName()),e?this.h_.unshift(a):this.h_.push(a),a.setEvtEmitter(this.Ai)},_.unregister=function(a){for(var e=this.h_.length-1;e>=0;e--)a===this.h_[e]&&this.h_.splice(e,1)},_.o_=function(){var a=this;Object.values(D.a).forEach(function(e){var t="on"+e.charAt(0).toUpperCase()+e.slice(1);a.Ai.on(e,function(){for(var c=arguments.length,u=new Array(c),g=0;g<c;g++)u[g]=arguments[g];for(var R=0;R<a.h_.length;R++){var Q=a.h_[R];if(Q&&t in Q){var se,fe=(se=Q[t]).call.apply(se,[Q].concat(u));if(fe!=null&&fe.stop)break}}})})},m()(v,[{key:"evt",get:function(){return this.Ai}}])}(),uc=function(v){function _(){for(var e,t=arguments.length,c=new Array(t),u=0;u<t;u++)c[u]=arguments[u];return(e=v.call.apply(v,[this].concat(c))||this).Ai=void 0,e}T()(_,v);var a=_.prototype;return a.getName=function(){throw new Error("getName method must be override.")},a.setEvtEmitter=function(e){this.Ai=e},a.emit=function(e,t){var c;return((c=this.Ai)==null?void 0:c.emit(e,t))||!1},a.onWorkerLog=function(e){},_}(F.a),rd="exposed-event",Wb=function(v){function _(e,t){var c;return(c=v.call(this)||this).Do=void 0,c.Ci=void 0,c.a_=void 0,c.Do=e,c.Ci=e.logger,c.a_=t,c}T()(_,v);var a=_.prototype;return a.onReport=function(e){this.a_.emit(D.a.REPORT,e)},a.onError=function(e){if((e==null||!e.preventFollowUp)&&e.fatal){var t=s()({},e);if(this.Do.stat.coreType===h.a.native){var c=this.Do.stat.retryInfo.getLastMseError();c&&(this.Ci.i(rd,"replace error info by mse error."),s()(t,{type:c.type,details:c.details,reason:c.reason,code:c.code}),c.url!==void 0&&(t.url=c.url),c.statusCode!==void 0&&(t.statusCode=c.statusCode))}this.a_.emit(D.a.ERROR,t)}},a.onManifestParsed=function(e){e!=null&&e.preventFollowUp||this.a_.emit(D.a.MANIFEST_PARSED,e)},a.onLevelSwitching=function(e){this.a_.emit(D.a.LEVEL_SWITCHING,e)},a.onLevelSwitched=function(e){this.a_.emit(D.a.LEVEL_SWITCHED,e)},a.onLevelSwitchFailed=function(){this.a_.emit(D.a.LEVEL_SWITCH_FAILED)},a.onLevelUpdated=function(e){this.a_.emit(D.a.LEVEL_UPDATED,e)},a.onLevelSwitchPlaying=function(e){this.a_.emit(D.a.LEVEL_SWITCH_PLAYING,e)},a.onAudioTrackSwitching=function(e){this.a_.emit(D.a.AUDIO_TRACK_SWITCHING,e)},a.onAudioTrackSwitched=function(e){this.a_.emit(D.a.AUDIO_TRACK_SWITCHED,e)},a.onAudioTrackUpdated=function(e){this.a_.emit(D.a.AUDIO_TRACK_UPDATED,e)},a.onAudioTrackSwitchFailed=function(){this.a_.emit(D.a.AUDIO_TRACK_SWITCH_FAILED)},a.onSubtitleTrackSwitched=function(e){this.a_.emit(D.a.SUBTITLE_TRACK_SWITCHED,e)},a.onLoadEnd=function(e){e!=null&&e.preventFollowUp||this.a_.emit(D.a.LOAD_END)},a.onVideoRendererChange=function(e){this.a_.emit(D.a.VIDEO_RENDERER_CHANGE,e)},a.onH265Detected=function(e){this.a_.emit(D.a.H265_DETECTED,e)},a.onScreenshot=function(e){e.pts===-1&&(e.pts=this.Do.video?1e3*this.Do.video.currentTime:0),this.a_.emit(D.a.SCREENSHOT,e)},a.getName=function(){return rd},_}(uc),Yb=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){if(this.getAvailable()&&this.Do.hasNextMediaDesc()&&(this.Do.stat.coreType===h.a.mse||this.Do.stat.coreType===h.a.native)&&(this.Ci.i("fallback-next-desc","run"),this.Do.nextMediaDesc()))return this.Pc({type:h.k.FALLBACK,message:"use next media description.",fallback:le.NEXT_DESC})},_}(ue),nd="fallback-swap-to-264",Qb=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){var e;if(this.getAvailable()&&a.type===L.b.MEDIA_ERROR&&(a.details===L.a.VIDEO_ERROR||a.details===L.a.VIDEO_ERROR_3||a.details===L.a.VIDEO_ERROR_4||a.details===L.a.VIDEO_NO_SIZE)&&this.Do.canCodecFallback&&this.Do.video instanceof HTMLVideoElement&&(this.Do.stat.coreType===h.a.mse||this.Do.stat.coreType===h.a.native&&((e=this.Do.video)==null||!e.videoWidth))&&this.Do.stat.codecType!==h.c.h264&&this.Do.stat.decoder===h.d.buildin){var t="metadata video size: "+this.Do.video.videoWidth+". fallback 264";this.Ci.i(nd,"run"),this.Do.reProcessSrc(h.c.h264,this.Do.stat.native);var c=this.Pc({type:h.k.FALLBACK,message:t,fallback:le.SWAP_264});return ht.playHEVCTest===void 0&&(this.Ci.i(nd,"play hevc test start"),this.Do.hevcTest.start()),c}},_}(ue),$b=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){if(this.getAvailable()&&this.Do.stat.coreType===h.a.native&&this.Do.stat.native&&a.statusCode!==0&&ht.isMSEAvailable()){var e="box: "+this.Do.stat.box+" native startup failed. switch to mse";return this.Ci.i("fallback-swap-to-mse","run"),this.Do.reProcessSrc(void 0,!1),this.Pc({type:h.k.FALLBACK,message:e,fallback:le.SWAP_CORE})}},_}(ue),Xb=function(v){function _(){return v.apply(this,arguments)||this}return T()(_,v),_.prototype.run=function(a){var e=wi(a.reason);if(this.getAvailable()&&this.Do.stat.coreType===h.a.mse&&!this.Do.stat.native&&!this.Do.isLiveShift){var t=a.reason,c=!1;if(a.details===L.a.DEMUX_NOT_FOUND?(t="demux not found",c=!0):(this.Do.stat.box!==h.i.mp4&&this.Do.stat.box!==h.i.unknown||this.Do.stat.decoder!==h.d.buildin||a.details!==L.a.SOURCEBUFFER_ERROR&&a.details!==L.a.MEDIASOURCE_ERROR&&a.details!==L.a.ADDSOURCEBUFFER_ERROR&&(a.type!==L.b.NETWORK_ERROR||a.details===L.a.DEC_LIB_LOAD_ERROR||a.details===L.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED||a.statusCode!==0||Object(L.f)(a.reason)||Object(L.g)(a.reason)))&&(this.Do.stat.box!==h.i.mp4||e!==h.o.AUDIO||this.Do.stat.recoverSwapRemux||a.details!==L.a.VIDEO_ERROR_3)?(this.Do.stat.box===h.i.mp4&&a.details===L.a.VIDEO_ERROR_4&&a.reason.indexOf("CHUNK_DEMUXER_ERROR_APPEND_FAILED")>=0||this.Do.stat.box===h.i.mp4&&e===h.o.AUDIO&&this.Do.stat.decoder===h.d.wasm&&a.type===L.b.MSE_ERROR&&this.Do.stat.codecType===h.c.hevc&&ht.isVideoCodecSupported(h.c.hevc))&&(c=!0):c=!0,c)return this.Ci.i("fallback-swap-to-native","run@"+this.Do.currentTime,this.Do.stat.startFromSec,this.Do.config.startFromSec),this.Do.stat.decoder===h.d.wasm&&this.emit(D.a.VIDEO_RENDERER_CHANGE,{enabled:!0,canvas:void 0,type:h.s.video}),this.Do.reProcessSrc(void 0,!0),this.Pc({type:h.k.FALLBACK,message:t+". swap to native.",fallback:le.SWAP_CORE})}},_}(ue),Xa=n(18),Hn="ios-compatible",Zb=function(v){function _(e,t){var c;return(c=v.call(this)||this).Do=void 0,c.Ci=void 0,c.u_=void 0,c.c_=!1,c.f_=void 0,c.A_=function(){var u=c.Do.video;c.f_=setTimeout(function(){c.Ci.i(Hn,"fix play stuck",u==null?void 0:u.currentTime),u&&c.u_((u==null?void 0:u.currentTime)+.001)},1e3)},c.v_=function(){c.f_&&(clearTimeout(c.f_),c.f_=void 0)},c.Do=e,c.Ci=e.logger,c.u_=t,c.Ci.i(Hn,"constructor"),c}T()(_,v);var a=_.prototype;return a.onLoad=function(){this.d_()},a.destroy=function(){this.Ci.i(Hn,"destroy"),this.d_()},a.onVisibilityChange=function(e){this.Ci.i(Hn,"onVisibilityChange",e.hidden),!e.hidden&&X.a.ios&&(this.Ci.i(Hn,"ios hidden false. play stuck detector on."),this.c_=!0)},a.onPlay=function(){this.c_&&(this.Ci.i(Hn,"on play. start detector timer."),this.c_=!1,this.A_())},a.onTimeupdate=function(){this.f_&&this.d_()},a.getName=function(){return Hn},a.d_=function(){this.Ci.i(Hn,"reset"),this.c_=!1,this.v_()},_}(uc),Vr=function(v){return v.METADATA="metadata",v.MEDIA_INFO="mediaInfo",v.HEARTBEAT="heartbeat",v.DOWNLOAD="download",v.REALTIME_BEACON="realtimeBeacon",v.DISCONTINUITY="discontinuity",v.KEY_FRAME="keyFrame",v.PRIV_NAL="privNal",v.SEI="sei",v.AAC_PRIV="aacPriv",v}({}),qb=function(){function v(){var a=this;this.yb=void 0,this.Oc=void 0,this.l_=void 0,this.xc=function(){a.b_()},this.p_=function(){a.Oc&&a.Oc.readyState>=2&&a.b_()},this.b_=function(){a.Oc&&a.l_&&a.l_(a.Oc.status),a.stop()}}var _=v.prototype;return _.start=function(a,e){this.l_=e,this.Oc&&this.stop();var t=this.Oc=new XMLHttpRequest;t.open("GET",a,!0),t.onreadystatechange=this.p_,t.onerror=this.xc,t.onload=this.xc,t.send(),this.yb=setTimeout(this.b_,1e3)},_.stop=function(){this.yb&&(clearTimeout(this.yb),this.yb=void 0),this.Oc&&(this.Oc.onreadystatechange=null,this.Oc.onload=null,this.Oc.onerror=null,this.Oc.abort(),this.Oc=void 0),this.l_=void 0},v}(),vi="kernel-native",Jb=function(v){function _(e){var t;return(t=v.call(this,e)||this).m_=void 0,t.g_=!1,t.O.push(t.Do.fallback.register(le.USE_BACKUP,new si(e).setRetryFunc(t.Ug.bind(t)))),t}T()(_,v);var a=_.prototype;return a.Ug=function(e){this.RA(h.h.retry)},a.load=function(e){var t;this.Ci.i(vi,"load",this.Do.stat.startFromSec);var c=this.Do.lctx.levels;if(c.length||this.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.MANIFEST_PARSING_ERROR,"manifest parse error. core: native")),this.Do.stat.drm)this.emit(D.a.ERROR,Object(L.e)(L.b.KEY_SYSTEM_ERROR,L.a.KEY_SYSTEM_UNSUPPORTED,"DRM unsupported."));else{var u=this.Do.lctx.default,g=this.Do.lctx.startIdx;typeof g=="number"&&g>=0&&g<c.length&&(u=g,this.Ci.i(vi,"set level from level startIdx.")),this.Ci.i(vi,"level: "+u+" "+((t=c[u])==null?void 0:t.qualityType)),this.Do.lctx.currentIdx=this.Do.lctx.nextIdx=u,this.Do.lctx.abr=!1,this.emit(D.a.MANIFEST_PARSED,{levels:[],currentLevel:0}),this.RA(e)}},a.onAbrLevelsUpdated=function(){},a.refresh=function(){var e,t=this;this.Do.stat.startFromSec=this.eA.currentTime,this.RA(h.h.retry),(e=this.eA.play())==null||e.catch(function(c){return t.Ci.i(vi,"refresh. call play() fail.",c)})},a.stopLoad=function(){this.emit(D.a.STOP_LOAD),this.kA()},a.setCurrentLevel=function(e){var t=this;this.Ci.i(vi,"set current level: "+e+" @ "+this.eA.currentTime);var c=this.Do;if(c.lctx.levels.length){if(e>=0&&e<c.lctx.levels.length&&c.lctx.currentIdx!==e){c.lctx.currentIdx=c.lctx.nextIdx=e;var u=c.lctx.current;if(u){var g;return this.Io=bt.SELECT_BITRATE,c.stat.startFromSec=this.eA.currentTime,this.rA++,this.emit(D.a.LEVEL_SWITCHING,{time:c.currentTime,bitrate:u.bitrate,level:e,smooth:!1,auto:!1,id:this.rA}),this.y_(c.lctx.currentIdx),!this.eA.paused&&((g=this.eA.play())==null||g.catch(function(R){return t.Ci.i(vi,"set current level, call play() fail.",R)})),void this.emit(D.a.LEVEL_SWITCHED,{time:c.currentTime,bitrate:u.bitrate,level:e,smooth:!1,auto:!1,id:this.rA})}}this.emit(D.a.LEVEL_SWITCH_FAILED)}else c.lctx.currentIdx=c.lctx.nextIdx=e},a.setNextLevel=function(e){this.setCurrentLevel(e)},a.liveEnd=function(){},a.destroy=function(){this.Ci.i(vi,"destroy"),this.m_&&(this.m_.stop(),this.m_=void 0),v.prototype.destroy.call(this),this.eA.src=""},a.mA=function(){this.nA||this.eA.src||this.load(),v.prototype.mA.call(this)},a.AA=function(){var e=this.Do,t=e.lctx.current;t&&this.Io===bt.SELECT_BITRATE&&this.emit(D.a.LEVEL_SWITCH_PLAYING,{time:e.currentTime,bitrate:t.bitrate,level:e.lctx.currentIdx,smooth:!1,auto:!1,id:this.rA}),this.Io!==bt.NONE&&(this.Io=bt.NONE),v.prototype.AA.call(this)},a.IA=function(){var e=this.Do;v.prototype.IA.call(this),this.g_&&(this.Ci.i(vi,"timeupdate start from: "+e.stat.startFromSec),this.__(),this.g_=!1)},a.lA=function(){this.Ci.i(vi,"video waiting"),this.Io=this.Io||bt.WAITING;var e=this.Do.bufferedSec,t=!this.eA.ended&&!this.eA.seeking&&this.Io===bt.WAITING;this.emit(D.a.WAITING,{block:t,bufferedSec:e})},a.CA=function(){var e;(X.a.android||this.Do.stat.isLive===void 0||((e=this.Sa)==null?void 0:e.width)===0)&&this.Sa&&this.eA.duration>0&&(this.Sa.isLive=this.Do.stat.isLive=!isFinite(this.eA.duration),this.eA instanceof HTMLVideoElement&&(this.Sa.width=this.eA.videoWidth,this.Sa.height=this.eA.videoHeight),this.emit(D.a.MEDIA_INFO,this.Sa)),this.C_()&&this.eA.duration>0&&(this.Ci.i(vi,"check video dec failed. on android wechat hls duration change."),this.I_()),v.prototype.CA.call(this)},a.fA=function(){if(this.Ci.i(vi,"video loadeddata. duration: "+this.eA.duration+" box: "+this.Do.stat.box),!(!this.C_()&&this.eA instanceof HTMLVideoElement&&(this.Ci.i(vi,"check video dec failed. on video loaded data."),this.I_()))){this.Do.stat.isLive===void 0&&this.eA.duration>0&&(this.Do.stat.isLive=!isFinite(this.eA.duration)),this.Sa={videoDecoder:h.d.buildin},this.eA instanceof HTMLVideoElement&&(this.Ci.i(vi,"video loadeddata. width: "+this.eA.videoWidth+" height: "+this.eA.videoHeight),this.Sa.width=this.eA.videoWidth,this.Sa.height=this.eA.videoHeight);var e=this.Do,t=e.lctx.current;if(t&&t.codec){var c=Kr(t.codec);this.Sa.audioCodec=c.audio,this.Sa.videoCodec=c.video,c.video&&(e.stat.codecType=Wr(c.video))}this.Sa.videoCodecType=e.stat.codecType,X.a.android?e.stat.startFromSec&&(this.g_=!0):this.__(),this.emit(D.a.MEDIA_INFO,this.Sa)}},a.vA=function(){this.Ci.i(vi,"seeking "+this.eA.currentTime);var e=this.eA.currentTime;this.uA?this.uA=!1:(this.emit(D.a.SEEKING),this.Do.isTimeinBuffered(e)||this.emit(D.a.SEEK_WITH_LOAD))},a.gA=function(e){var t,c=this;this.Ci.i(vi,"video error",e);var u=((t=this.eA.error)==null?void 0:t.code)||0,g=Object(L.d)(L.c[u]||L.a.VIDEO_ERROR,"video error");if(u===4&&this.Do.canCodecFallback)this.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,g,"buildin "+this.Do.stat.codecType+" dec error. video error: "+u));else{var R="video error";this.eA&&this.eA.error&&(R+=" code:"+u+" message:"+this.eA.error.message);var Q=Object(L.e)(L.b.MEDIA_ERROR,(u?L.c[u]:L.a.VIDEO_ERROR)||L.a.VIDEO_ERROR,R,{url:this.eA.src});u===2||u===4?(this.m_||(this.m_=new qb),this.Ci.i(vi,"video error start detect status code."),this.m_.start(this.eA.src,function(se){c.Ci.i(vi,"video error check http status code:",se),(u===2||u===4&&se>0)&&(se<200||se>299)?c.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.LOAD_ERROR,R,{statusCode:se,url:c.eA.src})):(se===0&&(Q.statusCode=0),c.emit(D.a.ERROR,Q))})):this.emit(D.a.ERROR,Q)}},a.RA=function(e){this.Ci.i(vi,"_load type: "+e),this.Sa=void 0,this.nA=void 0,this.Do.isLiveShift?this.emit(D.a.ERROR,Object(L.e)(L.b.OTHER_ERROR,L.a.UNSUPPORTED,"unsupported. core: "+this.type+" liveShift: "+this.Do.stat.liveShiftType)):(this.Io=bt.LOADING,v.prototype.RA.call(this,e),this.emit(D.a.LOAD,{type:e}),this.y_(this.Do.lctx.currentIdx),this.TA())},a.y_=function(e){var t=this.Do,c=t.lctx.current;if(c){var u;this.Ci.i(vi,"level",e);var g,R=c.currentUrl;this.emit(D.a.NEW_SOURCE,{sync:t.stat.startFromSec||0}),(u=this.Do.config.preprocessUrl)!=null&&u.stream&&(this.Ci.d(vi,"preprocessUrl stream"),R=(g=this.Do.config.preprocessUrl)==null?void 0:g.stream(R)),this.Ci.i(vi,"play: "+R),this.eA.src=R}},a.__=function(){var e=this.Do;e.stat.startFromSec>0&&(this.Ci.i(vi,"start from: "+e.stat.startFromSec),this.eA.currentTime=e.stat.startFromSec,e.stat.startFromSec=0)},a.I_=function(){return this.Ci.i(vi,"check video dec failed."),!!(this.eA instanceof HTMLVideoElement&&!this.eA.videoWidth&&this.Do.canCodecFallback)&&(this.emit(D.a.ERROR,Object(L.e)(L.b.MEDIA_ERROR,L.a.VIDEO_NO_SIZE,"buildin "+this.Do.stat.codecType+" dec no width.")),!0)},a.C_=function(){return X.a.android&&(X.a.xweb||X.a.x5)&&be(this.Do.stat.box)},m()(_,[{key:"type",get:function(){return h.a.native}}])}(tn),eE=n(45),tE=n.n(eE),iE=function(){function v(){this.O_=0,this.w_=0,this.E_=0,this.j_=0,this.an=void 0,this.an=this.k_()}var _=v.prototype;return _.reset=function(){this.an=this.k_(),this.O_=0,this.w_=0,this.E_=0,this.j_=0},_.parse=function(a){var e=this,t=this.an,c=0,u=0,g="",R="",Q="",se="";t.totalReceive=0,a.forEach(function(Fe){if(Fe.type==="inbound-rtp"){if(Fe.mediaType==="video"){var Ne=Fe.timestamp-e.O_;e.O_&&(c=(Fe.bytesReceived-e.E_)/Ne),e.E_=Fe.bytesReceived,e.O_=Fe.timestamp,t.key=Fe.keyFramesDecoded,t.videoPacketsLost=Fe.packetsLost,R=Fe.codecId,se=Fe.trackId}else if(Fe.mediaType==="audio"){var He=Fe.timestamp-e.w_;e.j_&&(u=(Fe.bytesReceived-e.j_)/He),e.j_=Fe.bytesReceived,t.audioPacketsLost=Fe.packetsLost,g=Fe.codecId,Q=Fe.trackId}t.totalReceive+=Fe.bytesReceived,e.w_=Fe.timestamp}}),t.audioDataRate=Math.round(7.8125*u),t.videoDataRate=Math.round(7.8125*c),t.speed=1e3*(c+u),a.forEach(function(Fe){Fe.type==="codec"?Fe.id===R?t.videoCodec=Fe.mimeType:Fe.id===g&&(t.audioCodec=Fe.mimeType,t.audioChannelCount=Fe.channels,t.audioSampleRate=Fe.clockRate):Fe.type==="track"&&(Fe.id===se?(t.width=Fe.frameWidth,t.height=Fe.frameHeight,t.videoAvgJitterBufferDelay=Fe.jitterBufferDelay/Fe.jitterBufferEmittedCount):Fe.id===Q&&(t.audioAvgJitterBufferDelay=Fe.jitterBufferDelay/Fe.jitterBufferEmittedCount))});var fe=null,xe=null;return a.forEach(function(Fe){Fe.type==="transport"&&(fe=a==null?void 0:a.get(Fe.selectedCandidatePairId))}),fe||a.forEach(function(Fe){Fe.type==="candidate-pair"&&Fe.selected&&(fe=Fe)}),fe&&fe.remoteCandidateId&&(xe=a==null?void 0:a.get(fe.remoteCandidateId)),xe&&(t.rtcRemoteAddress=xe.address||xe.ip||xe.ipAddress,t.rtcRemotePort=xe.port||xe.portNumber),this.an=t,t},_.k_=function(){return{totalReceive:0,speed:0,rtcRemoteAddress:"",rtcRemotePort:0,width:0,height:0,audioCodec:"",videoCodec:"",audioChannelCount:0,audioSampleRate:0,videoDataRate:0,audioDataRate:0,key:0,audioPacketsLost:0,videoPacketsLost:0,audioAvgJitterBufferDelay:0,videoAvgJitterBufferDelay:0}},m()(v,[{key:"result",get:function(){return this.an}}])}();function ad(v,_){var a=Object.keys(v);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(v);_&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(v,t).enumerable})),a.push.apply(a,e)}return a}function sd(v){for(var _=1;_<arguments.length;_++){var a=arguments[_]!=null?arguments[_]:{};_%2?ad(Object(a),!0).forEach(function(e){tE()(v,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(a)):ad(Object(a)).forEach(function(e){Object.defineProperty(v,e,Object.getOwnPropertyDescriptor(a,e))})}return v}var Fr="kernel-rtc",od=function(v){function _(e){var t;return(t=v.call(this,e)||this).vf=void 0,t.M_=void 0,t.YA=void 0,t.S_=void 0,t.B_="",t.T_=void 0,t.D_=!1,t._f=null,t.qf=0,t.R_=null,t.L_=void 0,t.N_=void 0,t.Q_=void 0,t.x_=void 0,t.V_=function(c){t.M_&&t.M_.getStats(null).then(function(u){var g=t.T_.parse(u);c(g)},function(u){return console.log(u)})},t.YA={connectionTimeout:t.Do.config.sdpConnectionTimeout||1e4,maxRetry:0,retryDelay:t.Do.config.retryDelay||1e3},t.L_=t.Do.config.transmissionTimeout||1e4,t.N_=t.Do.config.peerConnectionTimeout||1e5,t.Q_=t.Do.config.peerConnectionMaxRetry||5,t.x_=t.Do.config.peerConnectionRetryDelay||3e3,t.T_=new iE,t}T()(_,v);var a=_.prototype;return a.load=function(e){this.Ci.i(Fr,"load");var t=this.Do.lctx.current;t&&(this.B_=t.currentUrl),this.RA(e)},a.resume=function(){this.eA.paused&&this.refresh()},a.destroy=function(){v.prototype.destroy.call(this),this.U_(),this.sv(),this.eA&&(this.eA.srcObject=null),this.F_(),this.S_=void 0,this.vy()},a.refresh=function(){this.F_(),this.RA(h.h.retry)},a.stopLoad=function(){this.emit(D.a.STOP_LOAD),this.M_&&(this.M_.close(),this.M_=null),this.U_(),this.kA()},a.liveEnd=function(){},a.cA=function(){var e=this;this.V_(function(t){e.Sa||(e.Sa={}),e.Sa.width=t.width,e.Sa.height=t.height,e.Sa.audioCodec=t.audioCodec,e.Sa.audioSampleRate=t.audioSampleRate,e.Sa.channel=t.audioChannelCount,e.Sa.videoCodec=t.videoCodec,e.Sa.hasVideo=!!t.videoCodec,e.Sa.hasAudio=!!t.audioCodec,e.Sa.streamHost=t.rtcRemoteAddress}),v.prototype.cA.call(this)},a.DA=function(){var e=this;this.V_(function(t){var c;t.speed||e.R_||((c=e.M_)==null?void 0:c.connectionState)!=="connected"?t.speed&&(e.R_&&clearTimeout(e.R_),e.R_=null):e.R_=+setTimeout(function(){var u=Object(L.e)(L.b.NETWORK_ERROR,L.a.WEBRTC_TRANSMISSION_DATA_NULL,"transmission timeout "+e.L_,{fatal:!1,url:e.B_});e.emit(D.a.ERROR,u),e.P_(u.reason)},e.L_),e.Do.loadRec.setRTCStats(t),e.emit(D.a.HEARTBEAT)})},a.AA=function(){this.Io!==bt.NONE&&(this.Io=bt.NONE),v.prototype.AA.call(this)},a.RA=function(e){var t=this;this.T_.reset(),this.Io=bt.LOADING,this.emit(D.a.LOAD,{type:e}),this.emit(D.a.NEW_SOURCE,{sync:0}),this.M_&&this.M_.close(),this.H_(),this.Y_().catch(function(c){t.P_(c==null?void 0:c.reason)})},a.internalSeek=function(e){},a.vy=function(){this.eA&&(this.eA.srcObject=null)},a.P_=function(e){var t=this;this.D_=!0,this.M_&&this.M_.close(),this.U_(),this.qf<this.Q_&&(this.R_&&clearTimeout(this.R_),this._f&&clearTimeout(this._f),this._f=+setTimeout(function(){t.qf++,t.Ci.i(Fr,"retry",t.qf,e,t.B_),t.emit(D.a.RETRY,{type:h.k.RTC,message:"reason: "+e+". retry: "+t.qf,code:L.a.WEBRTC_FAILED_ERROR}),t._f=null,t.H_(),t.Y_().then(function(){t.qf=0,t.D_=!1},function(c){t.qf<t.Q_?t.P_(e):t.emit(D.a.ERROR,sd(sd({},c),{},{fatal:!0,url:t.B_}))})},this.x_))},a.U_=function(){this._f&&(clearTimeout(this._f),this._f=null)},a.G_=function(e){var t=this;this.sv();var c=this.vf=new nt(this.Ci),u={url:this.B_,responseType:"text",requestBody:e,requestMethod:"POST",progress:!1,headers:[{header:"Content-type",value:"application/json"}]};return new Promise(function(g,R){c.load(u,{onEnd:function(Q,se){if(t.sv(),typeof se=="string"){var fe=JSON.parse(se);t.emit(D.a.LEVEL_UPDATED),g(fe.sdp)}},onError:function(Q,se){if(t.Ci.i(Fr,"loadSdp",se),se.fatal){var fe={type:L.b.NETWORK_ERROR,details:L.a.RTC_SDP_LOAD_ERROR,reason:se.errMessage,fatal:se.fatal,url:t.B_};t.sv(),R(fe)}},onAbort:function(){t.sv(),R()}},t.YA)}).catch(function(g){return Promise.reject(g)})},a.H_=function(){var e=this,t=this.M_=new RTCPeerConnection;return t.addEventListener("track",function(c){return e.K_(c)}),t.addEventListener("connectionstatechange",function(c){return e.Z_(c)}),t.addEventListener("icecandidateerror",function(c){return e.W_(c)}),t.addEventListener("signalingstatechange",function(c){return e.X_(c)}),t.addEventListener("iceconnectionstatechange",function(c){return e.z_(c)}),t.addEventListener("icegatheringstatechange",function(c){return e.J_(c)}),t.addTransceiver("audio",{direction:"recvonly"}),t.addTransceiver("video",{direction:"recvonly"}),t},a.F_=function(){this.M_&&this.M_.close(),this.M_=null},a.Y_=function(){var e=this,t=this.M_;return t||Promise.reject("PeerConnection isn't exist"),this.q_().then(function(c){return e.G_(JSON.stringify({sdp:c.sdp}))}).then(function(c){return e.tC(c)}).then(function(){return t?new Promise(function(c,u){var g=setTimeout(function(){var R=Object(L.e)(L.b.NETWORK_ERROR,L.a.WEBRTC_CONNECT_TIMEOUT,"webrtc connect timeout",{fatal:!1,url:e.B_});e.emit(D.a.ERROR,R),u(R)},e.N_);t.addEventListener("connectionstatechange",function R(){switch(t.connectionState){case"connected":c(void 0),clearTimeout(g),t.removeEventListener("connectionstatechange",R);break;case"closed":case"disconnected":case"failed":clearTimeout(g),t.removeEventListener("connectionstatechange",R),u({type:L.b.NETWORK_ERROR,details:L.a.WEBRTC_CONNECT_FAILED,fatal:!1,reason:t.onconnectionstatechange})}})}):Promise.reject("PeerConnection isn't exist")}).catch(function(c){return e.Ci.i(Fr,c),Promise.reject(c)})},a.q_=function(){var e=this,t=this.M_;return t?t.createOffer().then(function(c){return e.Ci.i(Fr,"offer",c),t.setLocalDescription(c).then(function(){return c})},function(c){e.Ci.i(Fr,"offer",c);var u=Object(L.e)(L.b.NETWORK_ERROR,L.a.WEBRTC_OFFER_ERROR,"webrtc createoffer error"+c,{fatal:!1,url:e.B_});return e.emit(D.a.ERROR,u),Promise.reject(u)}):Promise.reject()},a.tC=function(e){var t=this,c=this.M_;if(!c||c.signalingState==="closed")return Promise.reject();var u=new RTCSessionDescription({type:"answer",sdp:e});return c.setRemoteDescription(u).then(function(){t.Ci.i(Fr,"answer",u)},function(g){t.Ci.i(Fr,"answer",g);var R=Object(L.e)(L.b.NETWORK_ERROR,L.a.WEBRTC_ANSWER_ERROR,"webrtc answer error",{fatal:!1,url:t.B_});return t.emit(D.a.ERROR,R),Promise.reject(R)})},a.K_=function(e){if(this.Do.video&&e.streams&&this.S_!==e.streams[0]){var t,c=this.S_=e.streams[0];this.Do.video.srcObject=c||null;var u=this.Sa={videoDecoder:h.d.buildin};(t=e.streams[0])==null||t.getTracks().forEach(function(g){var R=g.getSettings();u.width=R.width||u.width,u.height=R.height||u.height,u.fps=R.frameRate||u.fps})}},a.Z_=function(e){var t=this.M_;if(t)switch(this.Ci.i(Fr,"pcConnectionStateChange",t.connectionState,e),t.connectionState){case"connecting":case"connected":break;case"disconnected":case"failed":case"closed":this.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.WEBRTC_DISCONNECTED_ERROR,t.connectionState,{fatal:!1,url:this.B_})),!this.D_&&this.P_("PeerConnection state is "+t.connectionState)}},a.W_=function(e){var t;this.Ci.i(Fr,"iceCandidateError",e),this.emit(D.a.ERROR,Object(L.e)(L.b.NETWORK_ERROR,L.a.WEBRTC_ICE_CANDIDATE_ERROR,((t=this.M_)==null?void 0:t.iceConnectionState)||"",{fatal:!1})),!this.D_&&this.P_("iceCandidateError")},a.X_=function(e){var t;this.Ci.i(Fr,"signalingStateChange",(t=this.M_)==null?void 0:t.signalingState,e)},a.z_=function(e){var t;this.Ci.i(Fr,"iceConnecttionStateChange",(t=this.M_)==null?void 0:t.iceConnectionState,e)},a.J_=function(e){var t;this.Ci.i(Fr,"iceGatheringStateChange",(t=this.M_)==null?void 0:t.iceGatheringState,e)},a.sv=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},m()(_,[{key:"type",get:function(){return h.a.rtc}}])}(tn),hc="kwai-kernel-id",dc=function(){function v(){}return v.next=function(){if(G.available){var _=v.uf.read(hc,!1),a=v.At;return typeof _=="number"?(a=this.getNextId(_),this.uf.write(hc,a)):(a=this.getNextId(a),this.uf.write(hc,a)),v.At=a,a}return v.At=v.getNextId(v.At),v.At},v.getNextId=function(_){return++_>v.MAX_ID?0:_},m()(v,null,[{key:"MAX_ID",get:function(){return 999}}])}();dc.At=0,dc.uf=new G;var cd="sei-time",rE=function(v){function _(a){var e;return(e=v.call(this)||this).Do=void 0,e.iC=0,e.Ci=void 0,e.eC={idx:0,data:[],name:"sei"},e.nC={idx:0,data:[],name:"aacPriv"},e.sC={idx:0,data:[],name:"privNal"},e.$g=function(t){t.segments.forEach(function(c){c.type===h.o.VIDEO?(c.sei&&e.rC(c.sei,e.eC),c.privNal&&e.rC(c.privNal,e.sC)):c.type===h.o.AUDIO&&c.aacPriv&&e.rC(c.aacPriv,e.nC)}),e.hC()},e.kl=function(t){t.sei&&e.rC(t.sei,e.eC),e.hC()},e.oC=function(){var t;if((t=e.Do.video)==null||!t.seeking){var c=1e3*e.Do.currentTime,u=e.aC(c,e.eC);u==null||u.forEach(function(Q){e.Do.evt.emit(D.a.SEI,Q)});var g=e.aC(c,e.nC);g==null||g.forEach(function(Q){e.Do.evt.emit(D.a.AAC_PRIV,Q)});var R=e.aC(c,e.sC);R==null||R.forEach(function(Q){e.Do.evt.emit(D.a.PRIV_NAL,Q)})}},e.aC=function(t,c){if(c.data.length&&c.idx<c.data.length){for(var u=[],g=0,R=c.idx;R<c.data.length;R++){var Q;if(!(t>=(((Q=c.data[R])==null?void 0:Q.time)||0)))break;u.push(c.data[R]),g=R}if(u.length)return c.idx=g+1,u}},e.uC=function(){e.Ci.i(cd,"seek with load. remove all sei"),e.eC.data.splice(0),e.eC.idx=0,e.nC.data.splice(0),e.nC.idx=0,e.sC.data.splice(0),e.sC.idx=0,e.iC=0},e.cC=function(){var t=1e3*e.Do.currentTime;e.fC(t,e.eC),e.fC(t,e.nC),e.fC(t,e.sC)},e.fC=function(t,c){for(var u=0;u<c.data.length;u++)if(c.data[u].time>=t){c.idx=u;break}},e.rC=function(t,c){t.forEach(function(u){u&&typeof u.streamTimestamp=="number"&&(u.time=e.Do.streamTime.getLocalTime(u.streamTimestamp/1e3),typeof u.time=="number"&&(u.time=Math.round(1e3*u.time),c.data.push(u)))}),c.data.sort(function(u,g){return u.time-g.time})},e.hC=function(){var t=e.Do.video;if(e.iC>20&&t&&t.buffered.length){var c=1e3*t.buffered.start(0);e.AC(c,e.eC),e.AC(c,e.nC),e.AC(c,e.sC),e.iC=0}e.iC++},e.AC=function(t,c){if(c.data.length&&t>c.data[0].time){for(var u=0;u<Math.min(c.idx,c.data.length);u++)if(c.data[u].time>=t){c.data.splice(0,u),c.idx=Math.max(0,c.idx-u),e.Ci.i(cd,"remove "+u+" "+c.name+" info @"+t+". remain "+c.data.length);break}}},e.Do=a,e.Ci=a.logger,e.O.push(e.Do.evt.on(D.a.PARSING_DATA,e.$g),e.Do.evt.on(D.a.RAW_DATA,e.kl),e.Do.evt.on(D.a.TIMEUPDATE,e.oC),e.Do.evt.on(D.a.SEEK_WITH_LOAD,e.uC),e.Do.evt.on(D.a.SEEKING,e.cC)),e}return T()(_,v),m()(_,[{key:"seiLength",get:function(){return this.eC.data.length}},{key:"seiIdx",get:function(){return this.eC.idx}},{key:"aacPrivLength",get:function(){return this.nC.data.length}},{key:"aacPrivIdx",get:function(){return this.nC.idx}},{key:"privNalLength",get:function(){return this.sC.data.length}},{key:"privNalIdx",get:function(){return this.sC.idx}}])}(F.a),ra="stream-time",nE=function(v){function _(e){var t;return(t=v.call(this)||this).Ci=void 0,t.Do=void 0,t.vC=[],t.dC=void 0,t.jl=function(c){c.expired||c.segments.forEach(function(u){var g;u.type===h.o.VIDEO&&u.keyTime&&(u.keyTime.forEach(function(R){R.key&&t.Do.evt.emit(D.a.KEY_FRAME,{pts:R.pts,cts:R.cts})}),(g=t.vC).push.apply(g,u.keyTime.map(function(R){return s()({frag:c.frag},R)})),t.vC.sort(function(R,Q){return R.pts-Q.pts})),u.type===h.o.AUDIO&&u.originFirstDTS&&(t.dC=u.originFirstDTS-u.startDTS)})},t.kl=function(c){var u;c.keyTime&&!c.expired&&(u=t.vC).push.apply(u,c.keyTime.map(function(g){return s()({frag:c.frag},g)}))},t.uC=function(){var c,u=((c=t.Do.video)==null?void 0:c.currentTime)||0,g=t.Do.lctx.current,R=0;if(t.Ci.i(ra,"on seek with load. current time: "+t.Do.currentTime),t.Do.stat.multipart&&Object.prototype.hasOwnProperty.call(g,"fragments")){var Q=_t(u,g.fragments);if(!Q)return t.Ci.i(ra,"no frag. clear video key time."),void t.vC.splice(0,t.vC.length);for(var se=t.vC.length-1;se>=0;se--){var fe;if(((fe=t.vC[se].frag)==null?void 0:fe.sn)===Q.sn||t.vC[se].originPTS<u){R=se;break}}}t.Ci.i(ra,"clear video key time. st: "+R),t.vC.splice(R,t.vC.length-R)},e.logger.i(ra,"constructor"),t.Do=e,t.Ci=e.logger,t.O.push(t.Do.evt.on(D.a.PARSING_DATA,t.jl),t.Do.evt.on(D.a.RAW_DATA,t.kl),t.Do.evt.on(D.a.SEEK_WITH_LOAD,t.uC)),t}T()(_,v);var a=_.prototype;return a.reset=function(){this.Ci.i(ra,"reset"),this.dC=void 0,this.vC=[]},a.getLocalTime=function(e){if(!(e<0)){if(this.vC.length){var t=this.lC(e,this.vC);if(t)return e-t.originPTS+t.pts}return typeof this.dC=="number"?e-this.dC:void 0}},a.getStreamTime=function(e){if(!(e<0)){if(this.vC.length){var t,c=this.bC(e,this.vC);if(c)return this.Ci.i(ra,"get stream time by video. local: "+e+" pts: "+c.info.pts+" originPTS: "+c.info.originPTS+" sn: "+((t=c.info.frag)==null?void 0:t.sn)+" key: "+this.vC.length),e-c.info.pts+c.info.originPTS}return this.Ci.i(ra,"get local time by audio. local: "+e+" offset: "+this.dC),typeof this.dC=="number"?e+this.dC:void 0}},a.getKeyFrameTime=function(e,t){if(t===void 0&&(t=0),this.vC.length){var c=this.bC(e,this.vC);return c?this.vC[c.idx+t]:void 0}},a.bC=function(e,t){if(t){for(var c=t.length-1;c>=0;c--)if(t[c].pts<=e)return{info:t[c],idx:c}}},a.lC=function(e,t){if(t){for(var c=t.length-1;c>=0;c--)if(t[c].originPTS<=e)return t[c]}},m()(_,[{key:"localTimeOffset",get:function(){return this.dC},set:function(e){this.dC=e}}])}(F.a),$i=function(v){return v.SERIES_12="15_pro_max/15_plus/14_pro_max",v.SERIES_11="15_pro/15/14_pro",v.SERIES_10="14_plus/13_pro_max/12_pro_max",v.SERIES_9="14/13/13_pro/12/12_pro",v.SERIES_8="se_3/se_2/8/7/6s/6",v.SERIES_7="13_mini/12/11_pro/xs/x",v.SERIES_6="11_pro_max/xs_max",v.SERIES_5="11/xr",v.SERIES_4="8_plus/7_plus/6s_plus/6_plus",v.SERIES_3="se/5c/5s/5",v.SERIES_2="4s/4",v.SERIES_1="3gs/3g/1",v}({}),aE={"430_932_3":$i.SERIES_12,"393_852_3":$i.SERIES_11,"428_926_3":$i.SERIES_10,"390_844_3":$i.SERIES_9,"375_667_2":$i.SERIES_8,"375_812_3":$i.SERIES_7,"414_896_3":$i.SERIES_6,"414_896_2":$i.SERIES_5,"414_736_3":$i.SERIES_4,"320_568_2":$i.SERIES_3,"320_480_2":$i.SERIES_2,"320_480_1":$i.SERIES_1};function ld(){if(X.a.iphone&&typeof window<"u"&&window.screen){var v=window.screen.width+"_"+window.screen.height+"_"+window.devicePixelRatio;return aE[v]||"unknown"}return"unknown"}var Ys=n(25),sE=new RegExp("_([0-9]+)x([0-9]+)(_([0-9]+))?(_([0-9]+))?(_(420|422|444|mono))?"),oE=["mono","420","422","444"],fc,ud=function(){function v(){this._=[]}var _=v.prototype;return _.append=function(a){this._.push(a)},_.clear=function(){this._=[]},_.getLastMseError=function(){for(var a=this._.length-1;a>=0;a--){var e=this._[a];if(e&&e.core===h.a.mse){var t=e.errorData;return t&&(t.code=Object(L.d)(t.details,t.reason,t.statusCode)),t}}},_.pC=function(a){return a.map(function(e){var t={message:e.message,pos:e.pos,ts:e.ts};return e.code!==void 0&&(t.code=e.code),e.core!==void 0&&(t.core=e.core),e.count!==void 0&&(t.count=e.count),e.fallback!==void 0&&(t.fallback=e.fallback),t})},m()(v,[{key:"hasData",get:function(){return!!this._.length}},{key:"retryCount",get:function(){return this._.reduce(function(a,e){return(typeof e.count=="number"&&e.count>0?e.count:1)+a},0)}},{key:"mergedBeacon",get:function(){var a=[];return this._.forEach(function(e){var t;if(a.length&&e.type===h.k.LOADER&&((t=a[a.length-1])==null?void 0:t.type)===h.k.LOADER){var c=a[a.length-1].count;a[a.length-1].count=c?c+1:2}else a.push(s()({},e))}),this.pC(a.slice(-10))}},{key:"beacon",get:function(){return this.pC(this._.slice(-10))}}])}(),cE=function(){function v(){this.coreType=h.a.unknown,this.native=!1,this.codecType=h.c.unknown,this.gopRemux=!1,this.audioCodec="",this.recoverSwapRemux=!1,this.recoverSwapAudioCodec=!1,this.box=void 0,this.isLive=void 0,this.autoLazyLoad=!0,this.lazyLoadRecoverDuration=12.8,this.lazyLoadMaxDuration=16,this.firstFrameLoaded=!1,this.startFromSec=-1,this.webWorker=!0,this.muxWorker=void 0,this.isNetworkInUse=!1,this.srcType=h.l.OTHERS,this.videoPlaybackQuality=void 0,this.drm=void 0,this.mixContainerInput=void 0,this.mixCodecInput=void 0,this.mixCodecAvailable=void 0,this.srcMeta=void 0,this.multipart=void 0,this.demuxerType=void 0,this.retryInfo=new ud,this.mainThreadRendering=void 0,this.stereoType=void 0,this.decoder=h.d.buildin,this.wasmDecoder=void 0,this.wasmSimd=void 0,this.wasmThreads=void 0,this.wasmThreadsEnabled=void 0,this.wasmLibHitCache=void 0,this.isKwaiSlice=void 0,this.autoPlaybackRateConf=void 0,this.preferNativeLoader=void 0,this.avSeparated=!1,this.mms=!1,this.hevcFallbackWasm=!1,this.frameBufLen=0,this.flvAbrNotAligned=!1,this.seekingId=1,this.liveShiftKwai2Params={paramName:"offset",time:0},this.liveStartTime=0,this.liveShiftOffset=void 0,this.liveShiftOffsetAligned=void 0,this.mC=!1,this.gC=h.g.NONE}return v.prototype.reset=function(){this.coreType=h.a.unknown,this.codecType=h.c.unknown,this.audioCodec="",this.recoverSwapRemux=!1,this.recoverSwapAudioCodec=!1,this.box=h.i.unknown,this.autoLazyLoad=!0,this.firstFrameLoaded=!1,this.isNetworkInUse=!1,this.srcType=h.l.OTHERS,this.retryInfo.clear(),this.decoder=h.d.buildin,this.lazyLoadMaxDuration=16,this.lazyLoadRecoverDuration=.8*this.lazyLoadMaxDuration,this.isKwaiSlice=!1,this.avSeparated=!1,this.mms=!1,this.hevcFallbackWasm=!1,this.frameBufLen=0,this.flvAbrNotAligned=!1,this.seekingId=1,this.liveShiftKwai2Params={paramName:"offset",time:0},this.liveStartTime=0,this.liveShiftOffset=void 0,this.mC=!1,this.gC=h.g.NONE,this.drm=this.videoPlaybackQuality=this.mixContainerInput=this.mixCodecInput=this.mixCodecAvailable=this.multipart=this.stereoType=this.mainThreadRendering=this.wasmDecoder=this.wasmSimd=this.wasmThreads=this.wasmLibHitCache=void 0},m()(v,[{key:"liveShiftActive",get:function(){return this.liveShiftType!==h.g.NONE&&this.mC},set:function(_){this.mC=_}},{key:"liveShiftType",get:function(){return this.isLive&&(this.gC!==h.g.KWAI&&this.gC!==h.g.KWAI2||!X.a.mobile)&&be(this.box)?this.gC:h.g.NONE},set:function(_){this.gC=_}}])}(),lE=function(){function v(){this.yC=0,this._C=0,this.CC=0,this.IC=0,this.OC=0}var _=v.prototype;return _.reset=function(){this.CC=performance.now(),this.yC=this._C=this.IC=this.OC=0},_.getFPS=function(a){if(a){var e,t=performance.now(),c=a.totalVideoFrames,u=a.droppedVideoFrames;if(c){c<this._C&&(this._C=0,this.yC=0);var g=t-this.CC,R=u-this.yC,Q=c-this._C,se=0,fe=0;this.CC&&(se=parseFloat((1e3*R/g).toFixed(2)),fe=parseFloat((1e3*Q/g).toFixed(2))),this.IC=this.IC+=Q,this.OC=this.OC+=R,this.CC=t,this.yC=u,this._C=c,e={decoded:this.IC,dropped:this.OC,decodedFPS:fe,droppedFPS:se}}return this.CC=t,e}},v}(),hd="level-ctx",dd=function(){function v(a,e){this.Ci=void 0,this.An=void 0,this.fn=void 0,this.pb=!1,this.wC=-1,this.EC=0,this.jC=0,this.Ll=[],this.kC=0,this.MC=[],this.SC=0,this.BC=[],this.TC=[],this.DC=void 0,this.RC=void 0,a.i(hd,"constructor abr:"+e),this.Ci=a,this.pb=e}var _=v.prototype;return _.getLevel=function(a){return a===void 0&&(a=h.f.MAIN),a===h.f.MAIN?this.Ll[this.EC]:a===h.f.AUDIO?this.MC[this.kC]:a===h.f.SUBTITLE?this.BC[this.SC]:void 0},_.setLevelIdx=function(a,e){e===void 0&&(e=h.f.MAIN),e===h.f.MAIN?this.currentIdx=a:e===h.f.AUDIO?this.audioIdx=a:e===h.f.SUBTITLE&&(this.subtitleIdx=a)},_.getLevelIdx=function(a){return a===void 0&&(a=h.f.MAIN),a===h.f.MAIN?this.EC:a===h.f.AUDIO?this.kC:a===h.f.SUBTITLE?this.SC:-1},_.setNextIdx=function(a,e){e===void 0&&(e=h.f.MAIN),e===h.f.MAIN&&(this.nextIdx=a)},_.getNextIdx=function(a){return a===void 0&&(a=h.f.MAIN),a===h.f.MAIN?this.jC:-1},_.clearFrag=function(){this.Ci.i(hd,"clear"),[this.Ll,this.MC,this.BC].forEach(function(a){a.forEach(function(e){var t=e;t.fragments&&t.clear()})})},_.verifyLevelIdx=function(a){return this.Ll.length>0&&a<this.Ll.length&&a>=-1},_.verifyAudioTrackIdx=function(a){return this.MC.length>0&&a<this.MC.length&&a>=0},_.verifySubtitleTracksIdx=function(a){return this.BC.length>0&&a<this.BC.length&&a>=0},_.abrIndexToOrign=function(a){var e=this.TC[a];return e?e.index:0},_.orignIndexToAbr=function(a){var e=0;return this.TC.forEach(function(t,c){t.index!==a||(e=c)}),e},_.LC=function(){var a=this,e=this.RC;this.DC=0,this.TC=[],this.Ll.forEach(function(t,c){t.default&&!e&&(a.DC=c),t.enableAdaptive&&(!e||e&&e.indexOf(c)!==-1)&&a.TC.push(t)}),this.TC.sort(function(t,c){return t.bitrate-c.bitrate})},m()(v,[{key:"hasAudio",get:function(){return this.An},set:function(a){this.An=a}},{key:"hasVideo",get:function(){return this.fn},set:function(a){this.fn=a}},{key:"abr",get:function(){return this.pb},set:function(a){this.pb=a}},{key:"startIdx",get:function(){return this.wC},set:function(a){this.wC=a}},{key:"currentIdx",get:function(){return this.EC},set:function(a){a>=0&&(this.EC=a)}},{key:"nextIdx",get:function(){return this.jC},set:function(a){a>=0&&(this.jC=a)}},{key:"levels",get:function(){return this.Ll},set:function(a){this.Ll=a,this.LC()}},{key:"current",get:function(){return this.Ll[this.EC]}},{key:"currentUrl",get:function(){var a=this.Ll[this.EC];return(a==null?void 0:a.currentUrl)||""}},{key:"audioIdx",get:function(){return this.kC},set:function(a){a>=0&&(this.kC=a)}},{key:"audioTracks",get:function(){return this.MC},set:function(a){this.MC=a}},{key:"audio",get:function(){return this.MC[this.kC]}},{key:"subtitleIdx",get:function(){return this.SC},set:function(a){a>=0&&(this.SC=a)}},{key:"subtitleTracks",get:function(){return this.BC},set:function(a){this.BC=a}},{key:"subtitle",get:function(){return this.BC[this.SC]}},{key:"abrLevels",get:function(){return this.TC}},{key:"availableList",set:function(a){this.RC=a,this.LC()}},{key:"default",get:function(){return this.DC||0},set:function(a){this.DC=a}},{key:"abrDefault",get:function(){var a=0;return this.TC.forEach(function(e,t){e.default&&(a=t)}),a}}])}(),fd=function(){function v(){this.NC=0,this.QC=[],this.xC=[],this.VC={},this.UC={},this.FC=void 0,this.PC=0,this.HC=0,this.YC=0,this.GC=0,this.KC=0,this.ZC=0,this.WC=0}var _=v.prototype;return _.onStreamOpen=function(a,e,t,c){if(this.QC.length>10){var u=this.QC.shift();if(u){this.VC[u.vCodecType]=(this.VC[u.vCodecType]||0)+u.traffic;var g=u.qualityType||"unknown";this.UC[g]=(this.UC[g]||0)+u.traffic}}var R=this.FC?this.FC.index+1:0;this.FC={index:R,startPos:a,url:e,bitrate:t,qualityType:c,traffic:0,loadTimeCost:0,keyFrame:0,videoDataRate:0,audioDataRate:0,speed:0,vCodecType:h.c.unknown,segments:[]},this.QC.push(this.FC)},_.onMediaInfo=function(a){var e=this.QC[this.QC.length-1];e&&(a.videoCodecType&&(e.vCodecType=a.videoCodecType),e.mediaInfo=s()({},a))},_.setRTCStats=function(a){var e=this.FC;e&&(e.traffic=a.totalReceive,e.audioDataRate=a.audioDataRate,e.videoDataRate=a.videoDataRate,e.speed=a.speed,e.keyFrame=a.key,this.NC=e.traffic)},_.onDataReceive=function(a){this.NC+=a.byteLength;var e=this.xC;e.length>200&&e.pop(),e.unshift(a);var t=this.FC;t&&(t.traffic+=a.byteLength,t.loadTimeCost+=a.timeCost,t.speed=Math.round(t.traffic/t.loadTimeCost*1e3)||0)},_.onParsing=function(a){var e=this;a.segments.forEach(function(t){if(e.XC(t.type,1e3*(t.endDTS-t.startDTS),t.payload.byteLength),t.type===h.o.VIDEO){var c=t.endDTS-t.startDTS;isNaN(c)||(e.YC+=Math.round(1e3*c)),t.fillDuration&&(e.KC+=Math.round(1e3*t.fillDuration)),t.droppedDuration&&(e.WC+=Math.round(1e3*t.droppedDuration))}if(t.type===h.o.AUDIO){var u=t.endDTS-t.startDTS;isNaN(u)||(e.HC+=Math.round(1e3*u)),t.fillDuration&&(e.GC+=Math.round(1e3*t.fillDuration)),t.droppedDuration&&(e.ZC+=Math.round(1e3*t.droppedDuration))}})},_.onRaw=function(a){if(a.samples.length){var e=a.samples.reduce(function(c,u){return u.yuv?c+u.yuv.y.bytes.length+u.yuv.u.bytes.length+u.yuv.v.bytes.length:c+u.units.reduce(function(g,R){return g+R.data.byteLength},0)},0),t=a.samples[a.samples.length-1].dts-a.samples[0].dts+(a.samples[a.samples.length-1].duration||0);this.XC(h.o.VIDEO,t/90,e)}},_.downloadInfoByRange=function(a){a===void 0&&(a=1e3);var e={size:0,timeCost:0};if(this.xC.length)for(var t=performance.now(),c=0;c<this.xC.length;c++){var u=this.xC[c];if(!(u&&u.ts>t-a))break;e.size+=u.byteLength,e.timeCost+=u.timeCost}return e},_.XC=function(a,e,t){var c=this.QC[this.QC.length-1];if(c){var u=c.segments;u.push({type:a,duration:e,byteLength:t}),u.length>200&&u.shift();for(var g=0,R=0,Q=0;Q<u.length;Q++){var se=u[Q];se&&se.type===a&&(R+=se.byteLength,g+=se.duration)}g>0&&(a===h.o.VIDEO?c.videoDataRate=Math.round(8*R/g):a===h.o.AUDIO&&(c.audioDataRate=Math.round(8*R/g)))}},m()(v,[{key:"smoothedDownloadSpeed",get:function(){var a=this.xC,e=a[0];return e&&!e.progress?e.byteLength/e.timeCost*1e3:1e3*a.reduceRight(function(t,c){var u=c.byteLength/c.timeCost;return t>0?u*(1-.9)+.9*t:u},0)}},{key:"trafficGroupedByVCodecType",get:function(){var a=s()({},this.VC);return a.total=this.NC,this.QC.forEach(function(e){a[e.vCodecType]=(a[e.vCodecType]||0)+e.traffic}),a}},{key:"trafficGroupedByLevel",get:function(){var a=s()({},this.UC);return a.total=this.NC,this.QC.forEach(function(e){var t=e.qualityType||"unknown";a[t]=(a[t]||0)+e.traffic}),a}},{key:"traffic",get:function(){return this.NC}},{key:"speed",get:function(){var a=this.FC,e=this.downloadInfoByRange();return this.xC.length?e.timeCost?Math.round(e.size/e.timeCost*1e3):0:(a==null?void 0:a.speed)||0}},{key:"currentLoad",get:function(){return this.FC}},{key:"streams",get:function(){return this.QC}},{key:"contentLen",get:function(){return this.PC},set:function(a){this.PC=a}},{key:"muxA",get:function(){return this.HC}},{key:"muxV",get:function(){return this.YC}},{key:"fillA",get:function(){return this.GC}},{key:"fillV",get:function(){return this.KC}},{key:"droppedA",get:function(){return this.ZC}},{key:"droppedV",get:function(){return this.WC}}])}(),uE=n(42),hE=((fc={})[h.q.FHD]="data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAA1Btb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAADmAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACenRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAADmAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAHgAAABDgAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA5gAAXcAAAEAAAAAAfJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAEk+AABJPgFXEAAAAAAAhaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAAAAAAGpbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABaXN0YmwAAAEFc3RzZAAAAAAAAAABAAAA9Wh2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAHgAQ4AEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAB7aHZjQwEBYAAAAJAAAAAAAHjwAPz9+PgAAA8DoAABABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAmhAAEALkIBAQFgAAADAJAAAAMAAAMAeKADwIAQ5ZZWaSTK8BagIIBAgAAAAwCAAAADAISiAAEAB0QBwXK0YkAAAAAQcGFzcAAAAAEAAAABAAAAFGJ0cnQAAAAAAAAV+AAAFfgAAAAYc3R0cwAAAAAAAAABAAAAAQAST4AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAACvwAAAAEAAAAUc3RjbwAAAAAAAAABAAADfAAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNjAuMTYuMTAwAAAACGZyZWUAAALHbWRhdAAAABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAkAAAAuQgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDlllZpJMrwFqAggECAAAADAIAAAAMAhAAAAAdEAcFytGJAAAACYigBrxMImujggedddccbbbbbbuZo4//8Qs/H9kAtWJjtrvgCQAzQ8gAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwFbpe9yuAXAHyJgAAADAAADAAADAAADAAADAAADAAADAAADAAFJkwKEKkAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAZEhwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwPuAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAHpAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwABzQAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAUMAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwBsQAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwGHAAADAAADAAADAAADAAADAAADAAADAAADAAADAtoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAWMAAADAAADAAADAAADAAADAAADAAADAAADAAAJCAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAADygAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAABawAAADAAADAAADAAADAAADAAADAAADAAADAAAhYAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAALeAFwEAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAUUA=",fc[h.q.UHD_4K]="data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAA1Ftb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAADmAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACe3RyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAADmAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAPAAAACHAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA5gAAXcAAAEAAAAAAfNtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAEk+AABJPgFXEAAAAAAAhaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAAAAAAGqbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABanN0YmwAAAEGc3RzZAAAAAAAAAABAAAA9mh2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAPAAhwAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAB8aHZjQwEBYAAAAJAAAAAAAJbwAPz9+PgAAA8DoAABABhAAQwB//8BYAAAAwCQAAADAAADAJaVmAmhAAEAL0IBAQFgAAADAJAAAAMAAAMAlqAB4CACHFllZpJMrwFqAggECAAAAwAIAAADAAhAogABAAdEAcFytGJAAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAAQGgAAEBoAAAAGHN0dHMAAAAAAAAAAQAAAAEAEk+AAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAABRzdHN6AAAAAAAACA0AAAABAAAAFHN0Y28AAAAAAAAAAQAAA30AAABidWR0YQAAAFptZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAAC1pbHN0AAAAJal0b28AAAAdZGF0YQAAAAEAAAAATGF2ZjYwLjE2LjEwMAAAAAhmcmVlAAAIFW1kYXQAAAAYQAEMAf//AWAAAAMAkAAAAwAAAwCWlZgJAAAAL0IBAQFgAAADAJAAAAMAAAMAlqAB4CACHFllZpJMrwFqAggECAAAAwAIAAADAAhAAAAAB0QBwXK0YkAAAAevKAGvEwRHlP3jty4cOG7Zs2bNmzZs2bNWrVq1atWrVq1atWvmaOP//ELPx/ZALViY7a74AkAM0PIAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAX8Cl73K4BcAfImAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAIWAkwKEKkAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMDMocAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMCkgAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAABgwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAasAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAFZAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAg4AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMCJgAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAABFQAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAkIAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAPqAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAHJAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAACugAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAABDQAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAX8AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAIqAAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAC2gAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAA54AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAASkAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAXUAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAdMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAhYAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAmoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAq4AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAvoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA04AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA5IAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA84AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA+oAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABCwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABEwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABHQAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAgIA=",fc),pd="kwai-kernel-hevc",Tn="playback-hevc-test",_d=function(){function v(a){var e=this;this.Ci=void 0,this.uf=new G,this.zC=void 0,this.JC=[h.q.FHD,h.q.UHD_4K],this.qC=0,this.$C=void 0,this.tI=function(){var t,c;e.Ci.i(Tn,"on video event. "+((t=v.iI)==null?void 0:t.videoWidth)+" "+((c=v.iI)==null?void 0:c.error)),e.$C?(e.$C[e.JC[e.qC]]=!!v.iI&&v.iI.videoWidth>0&&!v.iI.error,e.qC++,e.qC<e.JC.length?(e.eI(),e.nI(e.JC[e.qC])):e.sI()):e.sI()},this.Ci=a}var _=v.prototype;return _.init=function(a){if(this.Ci.i(Tn,"init"),a>0){var e=this.uf.read(pd,a);this.Ci.i(Tn,"load from ls",e);try{e!==void 0&&Object.prototype.hasOwnProperty.call(e,h.q.FHD)&&Object.prototype.hasOwnProperty.call(e,h.q.UHD_4K)&&(ht.playHEVCTest=e,this.$C=ht.playHEVCTest)}catch(t){this.Ci.i(Tn,"load ls error")}}},_.start=function(){var a;this.Ci.i(Tn,"start");var e=this.$C!==void 0||v.iI;this.Ci.i(Tn,"start. tested: "+e),e||(a=v.iI)!=null&&a.src||this.rI()},_.destroy=function(){this.Rf(),this.eI()},_.sI=function(){this.Ci.i(Tn,"complete result:",this.$C,performance.now()),this.Rf(),this.eI(),ht.playHEVCTest=this.$C,this.uf.write(pd,this.$C)},_.rI=function(){var a;this.Ci.i(Tn,"start video test"),ge()?this.sI():(this.Rp(),this.$C=((a={})[h.q.FHD]=!1,a[h.q.UHD_4K]=!1,a),this.qC=0,this.nI(this.JC[0]))},_.nI=function(a){this.Ci.i(Tn,"test: "+a),v.iI||(v.iI=document.createElement("video")),v.iI.preload="metadata",v.iI.addEventListener("error",this.tI),v.iI.addEventListener("loadeddata",this.tI),v.iI.addEventListener("loadedmetadata",this.tI),v.iI.src=hE[a],v.iI.play().catch(function(){})},_.eI=function(){v.iI&&(v.iI.removeEventListener("error",this.tI),v.iI.removeEventListener("loadeddata",this.tI),v.iI.removeEventListener("loadedmetadata",this.tI),v.iI.src="")},_.Rp=function(){var a=this;this.Rf(),this.zC=setTimeout(function(){a.Ci.i(Tn,"timeout"),a.sI()},1e3)},_.Rf=function(){this.zC&&(clearTimeout(this.zC),this.zC=void 0)},v}();_d.iI=void 0;var dE=_d,gi="av-ctx",Ad=function(v){function _(e,t){var c;return(c=v.call(this)||this).video=void 0,c.mse=void 0,c.stat=new cE,c.loadRec=void 0,c.lctx=void 0,c.hI=[],c.oI=0,c.aI=0,c.uI=void 0,c.di=void 0,c.cI=!1,c.fI=!1,c.Na=void 0,c.AI=void 0,c.vI=new lE,c.dI=void 0,c.lI=void 0,c.At=void 0,c.Ci=void 0,c.Ai=void 0,c.bI=void 0,c.pI=void 0,c.mI=void 0,c.At=dc.next(),c.Ci=new Xa.Logger().setName(Ve.m).setId(c.At),c.Ai=new Zh.a,c.video=t,c.AI=new ic(c.Ci),c.lI=new dE(c.Ci),c.lctx=new dd(c.Ci,!0),c.bI=new Re(c),c.pI=new nE(c),c.mI=new rE(c),c.gI($a.processConfig(e)),c.AI&&c.O.push(c.AI),c.O.push(c.lI,c.bI,c.pI,c.mI),c}T()(_,v);var a=_.prototype;return a.destroy=function(){var e;this.logger.i(gi,"destroy"),(e=this.stat.muxWorker)==null||e.terminate(),this.yI(),this._I(),this.Ai.removeAllListeners(),v.prototype.destroy.call(this)},a.updateVideoPlaybackQuality=function(e,t){this.stat.videoPlaybackQuality?(this.stat.videoPlaybackQuality.droppedVideoFrames=t,this.stat.videoPlaybackQuality.totalVideoFrames=e):this.stat.videoPlaybackQuality={corruptedVideoFrames:0,creationTime:0,droppedVideoFrames:t,totalVideoFrames:e}},a.isTimeinBuffered=function(e){if(this.video){for(var t=this.video.buffered,c=0;c<t.length;c++)if(e>=t.start(c)&&e<t.end(c))return!0}return!1},a.currentBuffer=function(e){if(this.video)for(var t=this.video.buffered,c=0;c<t.length;c++){var u=t.start(c),g=t.end(c);if(u<=e&&e<g)return{start:u,end:g}}},a.nextBuffer=function(e){if(this.video)for(var t=this.video.buffered,c=0;c<t.length;c++){var u=t.start(c),g=t.end(c);if(u>e)return{start:u,end:g}}},a.getLiveShiftKwai2OffsetUTC=function(e){return this.stat.liveStartTime+e},a.getLiveShiftKwai2Duration=function(){return(this.AI.now-this.stat.liveStartTime)/1e3},a.getKwai2LiveShiftReloadInterval=function(){var e=this.lctx.current;if(e){if(e.fragments.length>1&&typeof this.stat.liveShiftOffset=="number"){var t=e.fragments[e.fragments.length-2];return Math.max((e.averagetargetduration||e.targetduration)*Ve.f,(this.stat.liveShiftOffsetAligned||this.stat.liveShiftOffset)+t.start*Ve.f-this.currentTime*Ve.f)/this.playbackRate}return(e.averagetargetduration||e.targetduration)*Ve.f/this.playbackRate}return 10*Ve.f/this.playbackRate},a.getKwai2LiveShiftUrl=function(e){var t=this.lctx.current,c=ze()(e,!0),u=this.stat.liveShiftKwai2Params;if(this.AI){if(u.paramName==="seqId"){var g=t.fragments[t.fragments.length-1],R=u.seqId||(g==null?void 0:g.sn);if(typeof R=="number")return c.query.seqID=R.toString(),c.toString()}return u.time=Math.round(this.getLiveShiftKwai2OffsetUTC(this.stat.liveShiftOffset||0)),c.query.startTime=u.time.toString(),c.toString()}return c.toString()},a.getLiveDelay=function(){var e=this.stat,t=this.di,c=10;if(e.multipart){var u=this.lctx.current;c=(u==null?void 0:u.averagetargetduration)||(u==null?void 0:u.targetduration)||c}return e.box===h.i.flv?-this.di.defaultSpts:be(e.box)?this.isLiveShift?t.liveShiftDelaySec*Ve.f:c*Ve.f*(t.liveDelayFragNum||1):-this.di.defaultSpts},a.initLiveShiftKwai2StartSec=function(){if(this.isLiveShiftKwai2){var e=this.stat.startFromSec>=0?this.stat.startFromSec:this.liveLocalTime;this.Ci.i(gi,"init liveshift kwai2 start from sec: "+e+" startFromSec: "+this.stat.startFromSec+" live: "+this.liveLocalTime+" duration: "+this.getLiveShiftKwai2Duration()),e>0&&(this.stat.startFromSec=e,this.stat.liveShiftOffset=1e3*e,this.stat.liveShiftOffsetAligned=void 0,this.updateLiveShiftStatuByTime(e))}},a.getRemuxConfig=function(){var e=this.di,t={isLive:this.stat.isLive,logLevel:e.logLevel,enableSoftwareAES:e.enableSoftwareAES,gopRemux:this.stat.gopRemux,preferDecoder:e.preferDecoder,streamingMux:this.streamingMux,ensureVideo:e.ensureVideo,maxAudioFramesDrift:e.maxAudioFramesDrift,forceKeyFrameOnDiscontinuity:e.forceKeyFrameOnDiscontinuity,wasmDecoderEnabled:e.wasmDecoderEnabled,enableAacPriv:e.enableAacPriv,audioEnabled:e.audioEnabled,videoEnabled:e.videoEnabled,mseDecErrSkip:e.mseDecErrSkip,adjustFragTime:e.adjustFragTime};return this.video instanceof HTMLAudioElement&&(this.Ci.i(gi,"HTMLAudioElement. set videoEnabled false."),t.videoEnabled=!1),t},a.getDecConfig=function(){var e=this.di;return{logLevel:e.logLevel,videoDropFramePolicy:e.videoDropFramePolicy,videoFrameBufferSize:e.videoFrameBufferSize,videoDecBlockPolicy:e.videoDecBlockPolicy,maxVideoDecThreads:e.maxVideoDecThreads,mainThreadRendering:e.mainThreadRendering,mainThreadDecoding:e.mainThreadDecoding,preferCanvasType:e.preferCanvasType,preferCanvasColorSpace:e.preferCanvasColorSpace}},a.setSrc=function(e,t){this.logger.i(gi,"set src",e),e&&(this.d_(),this.resetStreamingEnabled(),this.dI=void 0,this.loadRec=new fd),this.CI(e,t)},a.reProcessSrc=function(e,t){this.logger.i(gi,"reprocess src. codecType: "+e+" native: "+t+", has origin src: "+!!this.uI),this.uI&&this.II(this.uI,e,t)},a.updateLiveShiftStatuByTime=function(e){var t;if(this.isLiveShift&&(e===void 0&&(e=(t=this.video)==null?void 0:t.currentTime),this.lctx.current&&typeof e=="number"&&Number.isFinite(e))){var c=this.liveLocalTime;c>0&&(this.stat.liveShiftActive=!!(c&&e<c-5),this.Ci.i(gi,"update live shift statu by time. type: "+this.stat.liveShiftType+" "+this.stat.liveShiftActive+", time: "+e+" ed: "+c))}},a.resetStreamingEnabled=function(){var e=this.di;this.cI=this.fI=!(!e.streamingMux||!$a.isStreamingSupported()||X.a.msie||X.a.safari&&(this.stat.isLive===!1||this.stat.multipart)||X.a.msedge&&X.a.version.major<88&&(this.stat.isLive===!1||this.stat.multipart)),this.logger.i(gi,"resetStreamingEnabled: "+this.cI)},a.resetGopRemux=function(){this.stat.multipart&&!this.cI?this.stat.gopRemux=!1:this.stat.gopRemux=!!(X.a.safari||X.a.opera&&X.a.version.major<37),this.logger.i(gi,"resetGopRemux: "+this.stat.gopRemux)},a.hasNextMediaDesc=function(){return this.oI+1<this.hI.length},a.nextMediaDesc=function(){if(this.hasNextMediaDesc()){this.oI++;var e=this.hI[this.oI];if(e)return this.Ci.i(gi,"next media desc."),this.OI(e),!0}return!1},a.gI=function(e){if(this.di=e,!e.logLevel){var t=Xa.Logger.loadLogLevel(Ve.l);e.logLevel=t||Xa.DEFAULT_LOG_LEVEL}var c;if(e.logger&&this.Ci.setOutput(e.logger),this.Ci.setLevel(e.logLevel),this.Ci.getLevel()!==Xa.LogLevel.NONE&&(c=_.version,X.a.msie||console.log("%c kwai-player-kernel %c "+c+" %c","background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px; color: #fff","background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0; color: #fff","background:transparent")),this.logger.i(gi,"logger init."),this.logger.i(gi,"set config"),this.lI.init(this.di.playbackAbilityCacheTimeout),this.resetStreamingEnabled(),this.logger.i(gi,"browser",JSON.stringify(X.a)),ge()||this.logger.i(gi,"ua",navigator.userAgent),this.d_(),this.dI=void 0,this.stat.startFromSec=e.startFromSec>=0?e.startFromSec:typeof e.startFrom=="number"&&e.startFrom>=0?e.startFrom/1e3:-1,this.stat.webWorker=e.webWorker&&!!uE.default,typeof e.preferNativeLoader=="boolean"&&(this.stat.preferNativeLoader=e.preferNativeLoader),this.di.autoPlaybackRateConf)this.logger.i(gi,"use config.autoPlaybackRateConf",this.di.autoPlaybackRateConf),this.stat.autoPlaybackRateConf=this.di.autoPlaybackRateConf;else{var u=-Math.floor(this.di.defaultSpts/Ve.f);this.stat.autoPlaybackRateConf=function(g,R,Q){Q===void 0&&(Q=3);var se={startDelay:0,interval:.6,rule:[]};return Ae(g,R,Q,se),se}(this.Ci,u),this.logger.i(gi,"use default autoPlaybackRateConf",this.stat.autoPlaybackRateConf),this.Ci.i(gi,"get by delay: "+u)}try{this.stat.webWorker&&(this.stat.muxWorker=ae()(42)),ic.workerTimeOffset=performance.now(),this.logger.i(gi,"init mux worker")}catch(g){}e.lazyLoadMaxDuration>0&&e.lazyLoadRecoverDuration>0&&e.lazyLoadMaxDuration>=e.lazyLoadRecoverDuration&&(this.stat.lazyLoadMaxDuration=e.lazyLoadMaxDuration,this.stat.lazyLoadRecoverDuration=e.lazyLoadRecoverDuration),this.loadRec=new fd,e.src&&this.CI(e.src)},a.d_=function(){this.logger.i(gi,"reset stat");var e=this.di,t=this.stat;this.fI=this.cI;var c=t.preferNativeLoader;t.reset(),this.resetGopRemux(),this.pI.reset(),this.bI.reset(),t.isLive=e.isLive,t.native=e.nativeFirst,t.liveShiftType=this.di.liveShiftType,t.preferNativeLoader=c,this.stat=t},a.CI=function(e,t){this.oI=0,this.aI=Date.now(),this.II(e,t)},a.II=function(e,t,c){this.Ci.i(gi,"process src. codec: "+t+" native: "+c),e&&(this.uI=e);var u=this.config;this.hI=ec.preParse(this.Ci,e,typeof c=="boolean"?c:u.nativeFirst,t,u.baseURL);var g=this.hI[this.oI];g&&this.OI(g)},a.OI=function(e){var t,c,u,g,R,Q,se=this.config,fe=this.stat;(t=this.Na)==null||t.reset(),this.stat.srcType===h.l.FILE&&this.yI();var xe,Fe,Ne=this.lctx=new dd(this.Ci,se.adaptive);if(fe.codecType=e.codecType?e.codecType:h.c.unknown,fe.box=se.box||e.box||h.i.unknown,fe.srcType=e.srcType,fe.mixContainerInput=e.mixContainerInput,fe.mixCodecInput=e.mixCodecInput,fe.mixCodecAvailable=e.mixCodecAvailable,fe.multipart=e.multipart,fe.stereoType=(c=e.mediaLevels)==null?void 0:c.stereoType,(u=e.mediaLevels)!=null&&u.meta&&(fe.srcMeta=(xe=e.mediaLevels)==null?void 0:xe.meta,this.liveTime&&typeof e.mediaLevels.meta.programStartTime=="number"&&(this.stat.liveStartTime=e.mediaLevels.meta.programStartTime)),se.liveDelayFragNum&&se.liveDelayFragNum>0&&fe.multipart&&!se.autoPlaybackRateConf){var He=this.getLiveDelay();Ae(this.Ci,He/1e3,10,fe.autoPlaybackRateConf),this.Ci.i(gi,"update by delay: "+He+".",se)}e.nativeFirst!==void 0&&(fe.native=e.nativeFirst),typeof e.isLive=="boolean"&&(fe.isLive=e.isLive),e.isLiveShift===!0&&(fe.liveShiftType=h.g.KWAI2),typeof((g=e.mediaLevels)==null?void 0:g.isLive)=="boolean"&&(fe.isLive=e.mediaLevels.isLive),Ne.hasAudio=(R=e.mediaLevels)==null?void 0:R.hasAudio,Ne.hasVideo=(Q=e.mediaLevels)==null?void 0:Q.hasVideo,!e.mediaLevels||e.srcType===h.l.OTHERS&&be(fe.box)&&!fe.native||(this.Ci.i(gi,"src. get levels from src."),fe.drm=e.mediaLevels.drm,this.lctx.levels=e.mediaLevels.levels,this.lctx.default=this.lctx.currentIdx=e.mediaLevels.def,e.mediaLevels.audioTracks&&(this.lctx.audioTracks=e.mediaLevels.audioTracks,this.lctx.audioIdx=e.mediaLevels.defAudio||0),e.mediaLevels.subtitleTracks&&(this.lctx.subtitleTracks=e.mediaLevels.subtitleTracks,this.lctx.subtitleIdx=e.mediaLevels.defSubtitle||0)),this.lctx.default=function(rt){if(!X.a.mobile||rt.levels.length<=1||rt.levels[0].vCodecType!==h.c.hevc)return rt.default;var $e,vt;if(rt.levels.forEach(function(Dt,Ei){if(Dt.width&&Dt.height){var Kt=Math.min(Dt.width,Dt.height);Kt>720?vt=vt&&Kt>vt.minWH?vt:{idx:Ei,minWH:Kt}:$e=$e&&$e.minWH>Kt?$e:{idx:Ei,minWH:Kt}}}),!$e||!vt)return rt.default;if(X.a.android)return parseFloat(X.a.platformVersion||"")>=10?vt.idx:$e.idx;if(X.a.iphone){var dt=ld();return dt==="unknown"?typeof window<"u"&&window.screen&&(window.screen.width>400||window.devicePixelRatio>2)?vt.idx:$e.idx:[$i.SERIES_1,$i.SERIES_2,$i.SERIES_3,$i.SERIES_4,$i.SERIES_8].indexOf(dt)===-1?vt.idx:$e.idx}return rt.default}(this.lctx),e.box===h.i.yuv&&(this.dI=function(rt){if(rt){var $e=rt.match(sE);if($e&&$e.length>2){var vt=parseInt($e[1]),dt=parseInt($e[2]),Dt=$e[4]?parseInt($e[4]):Ve.d,Ei=$e[6]?parseInt($e[6]):8,Kt=Ys.a.AV_PIX_FMT_YUV420P;$e[8]!==void 0&&(Kt=oE.indexOf($e[8]));var Bi=0,ki=0;return Kt===Ys.a.AV_PIX_FMT_YUV420P?(Bi=vt/2,ki=dt/2):Kt===Ys.a.AV_PIX_FMT_YUV422P?(Bi=vt/2,ki=dt):Kt===Ys.a.AV_PIX_FMT_YUV444P?(Bi=vt,ki=dt):(Bi=0,ki=0),{width:vt,height:dt,chroma:Kt,chromaWidth:Bi,chromaHeight:ki,cropLeft:0,cropTop:0,cropWidth:vt,cropHeight:dt,displayWidth:vt,displayHeight:dt,pts:0,fps:Dt,bpp:Ei,dataSize:(vt*dt+Bi*ki*2)*(Ei>8?2:1)}}}}(e.src instanceof File?e.src.name:this.lctx.currentUrl)),this.config.ntp&&this.stat.isLive!==!1&&this.stat.box===h.i.flv&&((Fe=this.AI)==null||Fe.ntpSync(this.stat.preferNativeLoader)),this.resetStreamingEnabled(),this.resetGopRemux(),this.logger.i(gi,"use media desc complete. box: "+fe.box+" live: "+fe.isLive+" native: "+fe.native+" mobile: "+!!X.a.mobile+" gopRemux: "+fe.gopRemux+" streamingMux: "+this.streamingMux+" liveShift: "+fe.liveShiftType+" mixCodec: "+fe.mixCodecInput+" levelCnt: "+Ne.levels.length+" hasVideo: "+Ne.hasVideo+" hasAudio: "+Ne.hasAudio)},a.yI=function(){this.lctx&&this.lctx.levels.forEach(function(e){e.url.forEach(function(t){t.indexOf("blob:")===0&&URL.revokeObjectURL(t)})})},a._I=function(){this.Na&&(this.Na.destroy(),this.Na=void 0)},m()(_,[{key:"isLiveShiftKwai2",get:function(){return this.stat.liveShiftType===h.g.KWAI2}},{key:"isLiveShift",get:function(){return this.stat.liveShiftType!==h.g.NONE}},{key:"logger",get:function(){return this.Ci}},{key:"id",get:function(){return this.At}},{key:"live",get:function(){return!(!this.stat.isLive||this.stat.liveShiftActive)}},{key:"isDownloadInterruptible",get:function(){return!(this.live&&this.stat.multipart===!1)}},{key:"liveLocalTime",get:function(){var e=this.lctx.current;if(this.isLiveShift){var t,c,u=Number.isFinite((t=this.video)==null?void 0:t.duration)?(c=this.video)==null?void 0:c.duration:this.isLiveShiftKwai2?this.getLiveShiftKwai2Duration():(e==null?void 0:e.totalduration)||0;if(u)return u-(this.getLiveDelay()/Ve.f+.1)}else if(e&&e.totalduration)return e.totalduration-(this.getLiveDelay()/Ve.f+.1);return 0}},{key:"yuvParams",get:function(){return this.dI}},{key:"canCodecFallback",get:function(){return!(!this.stat.mixCodecInput||this.stat.codecType===h.c.h264||this.stat.mixCodecInput.indexOf(h.c.h264)===-1||this.stat.decoder!==h.d.buildin)}},{key:"fps",get:function(){return this.vI}},{key:"liveTime",get:function(){return this.AI}},{key:"cOutput",get:function(){if($.a)return this.Na||(this.Na=new $.a(this.Ci,this.di)),this.Na}},{key:"isAbrAvailable",get:function(){return this.di.adaptive&&this.lctx.levels.length>1&&!this.isSwitchLevelByReload&&!this.isLiveShift}},{key:"isSwitchLevelByReload",get:function(){return!(this.stat.box===h.i.flv&&this.stat.isLive!==!1&&!X.a.firefox&&this.di.videoEnabled!==!1||be(this.stat.box))}},{key:"mediaBufferedSec",get:function(){return this.video&&this.video.buffered&&this.video.buffered.length?{start:this.video.buffered.start(0),end:this.video.buffered.end(this.video.buffered.length-1)}:{start:0,end:0}}},{key:"bufferedSt",get:function(){return this.video&&this.video.buffered.length?this.video.buffered.start(0):-1}},{key:"bufferedEnd",get:function(){return this.video&&this.video.buffered.length?this.video.buffered.end(this.video.buffered.length-1):0}},{key:"bufferedSec",get:function(){return this.video&&this.video.buffered.length>0?Math.max(0,this.video.buffered.end(this.video.buffered.length-1)-this.video.currentTime):0}},{key:"bufferSliceNum",get:function(){return this.video?this.video.buffered.length:0}},{key:"currentTime",get:function(){return this.video?this.video.currentTime:0}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:1}},{key:"config",get:function(){return this.di}},{key:"src",get:function(){var e;return((e=this.hI[this.oI])==null?void 0:e.src)||""}},{key:"srcUpdateTime",get:function(){return this.aI}},{key:"originSrc",get:function(){return this.uI}},{key:"videoPlaybackQuality",get:function(){return this.stat.videoPlaybackQuality?this.stat.videoPlaybackQuality:this.video instanceof HTMLVideoElement?this.video.getVideoPlaybackQuality!==void 0?this.video.getVideoPlaybackQuality():{corruptedVideoFrames:0,creationTime:0,droppedVideoFrames:this.video.webkitDecodedFrameCount||0,totalVideoFrames:this.video.webkitDroppedFrameCount||0}:void 0}},{key:"demuxerType",get:function(){return this.stat.demuxerType},set:function(e){this.logger.i(gi,"set demuxer type",e);var t=this.stat;if(e!==t.demuxerType){var c=t.box===void 0||t.box===h.i.unknown;e===_e.b.RAW?(t.box=h.i.raw,t.isLive=!1):e===_e.b.FLV?(t.box=h.i.flv,t.multipart&&(t.isLive=!1)):e===_e.b.MP4||e===_e.b.FMP4?(c&&(t.box=h.i.mp4),t.multipart||(t.isLive=!1)):e===_e.b.TS?c&&(t.box=h.i.ts):e===_e.b.IVF&&(t.box=h.i.ivf,t.isLive=!1),t.demuxerType=e,this.resetGopRemux()}}},{key:"streamingMuxEnabled",get:function(){return this.cI&&!(this.src instanceof Blob)},set:function(e){this.cI=e}},{key:"streamingMux",get:function(){return this.stat.box===h.i.flv&&this.stat.isLive!==!1||this.streamingMuxEnabled&&this.fI},set:function(e){this.fI=e}},{key:"hevcTest",get:function(){return this.lI}},{key:"evt",get:function(){return this.Ai}},{key:"fallback",get:function(){return this.bI}},{key:"streamTime",get:function(){return this.pI}}],[{key:"packName",get:function(){return"no-wasm-hdr_es"}},{key:"version",get:function(){return"3.3.37"}},{key:"buildTime",get:function(){return"Mon Jan 20 2025 18:07:08 GMT+0800 (中国标准时间)"}}])}(F.a);Ad.instanceCount=0;var Yr=Ad,cn=function(v){return v.NORMEL="normal",v.SEEK="seek",v.END="end",v.LEVEL_SWITCH="levelSwitch",v.FIRST_FRAME="firstFrame",v.LOAD="load",v.BACKUP="backup",v}({}),hi=function(v){return v.START="start",v.MANIFEST="manifest",v.LEVEL="level",v.STREAM_CONNECTED="streamConnected",v.DATA="data",v.DEMUX="demux",v.SEGMENT="segment",v.CANPLAY="canplay",v.LOADEDMETADATA="loadedmetadata",v.LOADEDDATA="loadeddata",v.SEEKED="seeked",v}(hi||{}),vd=[{event:hi.START,detailName:"first-loader-open"},{event:hi.MANIFEST,detailName:"manifest-duration"},{event:hi.LEVEL,detailName:"level-duration"},{event:hi.STREAM_CONNECTED,detailName:"stream-connected-duration"},{event:hi.DATA,detailName:"first-package-duration"},{event:hi.DEMUX,detailName:"first-remux-duration"},{event:hi.SEGMENT,detailName:"first-segment-duration"},{event:hi.LOADEDMETADATA,detailName:"first-meta-duration"},{event:[hi.LOADEDDATA,hi.CANPLAY,hi.SEEKED],detailName:"first-frame-duration"}],pc="first-frame",fE=function(){function v(a){this.wI=0,this.Vn=0,this.ee=void 0,this.Pm=0,this.EI=0,this.jI={},this.Do=void 0,this.Ci=void 0,this.ee=vd.slice(0),this.Do=a,this.Ci=a.logger}var _=v.prototype;return _.start=function(){this.Ci.i(pc,"start"),this.wI=0,this.Pm=performance.now(),this.Vn=0,this.ee=vd.slice(0),this.EI=0,this.jI={},this.process(hi.START,this.Pm)},_.process=function(a,e){var t;if(e===void 0&&(e=0),this.Ci.i(pc,"process type: "+a+" "+e+" complete: "+this.wI),this.wI)return!1;var c=this.ee,u=-1;e=e||performance.now();for(var g=0;g<c.length;g++){var R=c[g];if(Array.isArray(R.event)){if(R.event.indexOf(a)!==-1){u=g;break}}else if(R.event===a){u=g;break}}if(u===-1)return!1;var Q=c.splice(0,u+1).pop(),se=((t=this.Do.mse)==null?void 0:t.readyState)==="closed";if((c.length===0||se&&a===hi.SEGMENT)&&(this.Vn=e-this.Pm,this.wI=Date.now(),this.Ci.i(pc,"complete "+this.Vn+" "+this.wI)),Q){var fe=Math.round(e-this.EI);this.EI===0&&(fe=Date.now()),this.EI=e,this.jI[Q.detailName]=fe}return!!this.wI},_.onDownloadError=function(){this.jI.download_retry?this.jI.download_retry++:this.jI.download_retry=1},_.onRetry=function(){this.jI.retry?this.jI.retry++:this.jI.retry=1},m()(v,[{key:"complete",get:function(){return this.wI}},{key:"duration",get:function(){return this.Vn}},{key:"details",get:function(){return this.jI}}])}(),gd=[/headless/,/spider/,/[a-z0-9]+bot[^a-z0-9]/],In=function(v){return v.none="",v.probably="probably",v.maybe="maybe",v}(In||{}),md=function(){if(ge())return In.none;if(navigator.webdriver)return In.probably;for(var v=navigator.userAgent.toLowerCase(),_=0;_<gd.length;_++)if(gd[_].test(v))return In.probably;if(window.innerWidth<=0&&window.innerHeight<=0)return In.probably;if(ht.isMSEAvailable()&&!ht.isMSECodecCapabilityNormal())return In.maybe;try{var a=document.createElement("canvas");a.width=4,a.width=4;var e=a.getContext("2d");if(e){e.fillStyle="#FFFFFF",e==null||e.fillRect(0,0,a.width,a.height);for(var t=e.getImageData(0,0,a.width,a.height).data,c=0;c<t.length;c++)if(t[c]!==0)return In.none;return In.maybe}}catch(u){return In.probably}return In.none}(),_c,Qr={};try{var bd;(bd=navigator.userAgentData)==null||bd.getHighEntropyValues(["architecture","bitness","model","platform","platformVersion"]).then(function(v){s()(Qr,v)})}catch(v){}var pE=new Uint8Array(16);function _E(){if(!_c&&!(_c=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _c(pE)}for(var AE=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,vE=function(v){return typeof v=="string"&&AE.test(v)},Xi=[],Ac=0;Ac<256;++Ac)Xi.push((Ac+256).toString(16).substr(1));var gE=function(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(Xi[v[_+0]]+Xi[v[_+1]]+Xi[v[_+2]]+Xi[v[_+3]]+"-"+Xi[v[_+4]]+Xi[v[_+5]]+"-"+Xi[v[_+6]]+Xi[v[_+7]]+"-"+Xi[v[_+8]]+Xi[v[_+9]]+"-"+Xi[v[_+10]]+Xi[v[_+11]]+Xi[v[_+12]]+Xi[v[_+13]]+Xi[v[_+14]]+Xi[v[_+15]]).toLowerCase();if(!vE(a))throw TypeError("Stringified UUID is invalid");return a},vc,mE=function(v,_,a){var e=(v=v||{}).random||(v.rng||_E)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,_){a=a||0;for(var t=0;t<16;++t)_[a+t]=e[t];return _}return gE(e)},bE=new Date().getTimezoneOffset()/-60;function gc(){return vc||(vc={support_mse:ht.isMSEAvailable()?1:0,support_aac_mse:ht.TYPE_SUPPORTED.aac?1:0,support_aac:ht.isVideoCodecSupported(h.c.aac)?1:0,support_h264_mse:ht.TYPE_SUPPORTED.h264?1:0,support_h264:ht.isVideoCodecSupported(h.c.h264)?1:0,support_h265_mse:ht.TYPE_SUPPORTED.hevc?1:0,support_h265:ht.isVideoCodecSupported(h.c.hevc)?1:0,support_av1_mse:ht.TYPE_SUPPORTED.av1?1:0,support_simd:ht.isSupportSimd?1:0,support_thread:ht.isSupportThreads?1:0,support_hw:ht.isSupportHW?1:0,support_change_type:ht.isChangeTypeSupported()?1:0,support_streaming:$a.isStreamingSupported()?1:0,hardware_concurrency:de()||0,wasm_dec_smooth:ht.wasmSmooth?1:0}),vc}function Ed(v,_){var a,e;return typeof navigator<"u"&&(navigator.webdriver&&(a=navigator.webdriver?1:0),navigator.onLine!==void 0&&(e=navigator.onLine?1:0)),{session_id:_.sessionId,kernel_version:Yr.version,pack_name:Yr.packName,creation_time:_.creationTime,time_zone:bE,src_update_time:v.srcUpdateTime,load_start_time:_.loadStartTime,instance_count:Yr.instanceCount,webdriver:a,on_line:e}}function yd(){var v={};if(typeof navigator<"u"){navigator.onLine!==void 0&&(v.network_on_line=navigator.onLine?1:0);var _=navigator.connection||navigator.mozConnection||navigator.webkitConnection;(_==null?void 0:_.rtt)!==void 0&&(v.network_rtt=_.rtt),(_==null?void 0:_.rtt)!==void 0&&(v.network_downlink=_.downlink),(_==null?void 0:_.effectiveType)!==void 0&&(v.network_effective_type=_.effectiveType),(_==null?void 0:_.saveData)!==void 0&&(v.network_save_data=_.saveData?1:0)}return v}function Cd(v,_){var a,e,t,c=(a=v.video)==null?void 0:a.duration,u=v.lctx.current,g=(u==null?void 0:u.currentUrl)||"",R=s()({play_url:(u==null?void 0:u.fileName)||g,url_id:(u==null?void 0:u.urlId)||0,stream_host:g?new ze.a(g).host:"",reuse:_.reuse,metadata_time:_.metadataTime,play_start_time:_.playStartTime,playing_start_time:_.playingStartTime,stream_duration:Math.round(1e3*(c&&Number.isFinite(c)?c:0)),max_bitrate:(u==null?void 0:u.maxBitrate)||0,codec:_.codecs,play_pos:_.playPos||0,v_data_rate:Math.round(((e=v.loadRec.currentLoad)==null?void 0:e.videoDataRate)||0),a_data_rate:Math.round(((t=v.loadRec.currentLoad)==null?void 0:t.audioDataRate)||0),drm:v.stat.drm?1:0,adaptive_multi_rate:v.lctx.abr?1:0,use_backup:_.useBackup,play_to_end:_.playToEnd,v_decoder:v.stat.decoder,video_codec_type:v.stat.codecType||h.c.unknown,start_codec:_.startCodec,demuxer:v.stat.demuxerType||_e.b.UNKNOWN,core_type:v.stat.coreType,mms:v.stat.mms?1:0,box:v.stat.box,kwai_slice:v.stat.isKwaiSlice?1:0,monkey_patched_fetch:_.monkeyPatchedFetch},Ed(v,_),yd(),function(fe){var xe=fe.video;return xe?{elem_crossorigin:xe.crossOrigin,elem_autoplay:xe.autoplay?1:0,elem_loop:xe.loop?1:0,elem_volume:xe.volume,elem_muted:xe.muted?1:0,elem_preload:xe.preload,elem_controls:xe.controls?1:0,elem_ready_state:xe.readyState,elem_network_state:xe.networkState,elem_playback_rate:xe.playbackRate,elem_paused:xe.paused?1:0,elem_ended:xe.ended?1:0,elem_seeking:xe.seeking?1:0,elem_tag_name:xe.tagName}:{}}(v));v.stat.flvAbrNotAligned&&(R.flv_abr_not_aligned=1),typeof ht.playHEVCTest=="boolean"&&(R.play_hevc_test=ht.playHEVCTest?1:0),v.stat.isLive!==void 0&&(R.live=v.stat.isLive?1:0),R.live_shift_type=v.stat.liveShiftType;var Q=ot((u==null?void 0:u.fileName)||g);v.stat.box===h.i.flv&&v.stat.isLive!==!1&&(R.stream_id=Q.streamID),_.httpHeader&&(R.response_header=N(_.httpHeader)),u!=null&&u.bitrate&&(R.bitrate=Math.round(u.bitrate)),u!=null&&u.qualityType&&(R.quality_type=u.qualityType),u!=null&&u.qualityLabel&&(R.quality_label=u.qualityLabel),_.startQualityType&&(R.start_quality_type=_.startQualityType),Q.transcodingTpl&&(R.transcoding_template=Q.transcodingTpl),Q.filename&&(R.filename=Q.filename),typeof navigator<"u"&&navigator.deviceMemory&&(R.device_memory=navigator.deviceMemory);var se=Object(Ut.b)();return se.renderer&&(R.gpu_renderer=se.renderer),md&&(R.bot=md),_.canvasCtxType&&(R.canvas_ctx=_.canvasCtxType),v.stat.wasmDecoder&&(R.wasm_dec=v.stat.wasmDecoder,R.wasm_dec_simd=v.stat.wasmSimd?1:0,R.wasm_dec_threads=v.stat.wasmThreads||0),R}function Td(v){var _={};if(v.metadata)for(var a in v.metadata){if(Object.keys(_).length>50)break;var e=v.metadata[a];typeof e=="string"?_[a]=e.substring(0,50):typeof e!="number"&&typeof e!="boolean"||(_[a]=e)}return _}function mc(){var v={};return Qr&&(Qr.architecture&&(v.architecture=Qr.architecture),Qr.bitness&&(v.bitness=Qr.bitness),Qr.model&&(v.model=Qr.model),Qr.platform&&(v.platform=Qr.platform),Qr.platformVersion&&(v.platform_version=Qr.platformVersion)),v}function bc(){var v={};return X.a.platformVersion&&(v.platform=X.a.platform||"",v.platform_version=X.a.platformVersion||0),X.a.iphone?v.model=ld():X.a.model&&(v.model=X.a.model),X.a.version&&(v.browser_name=X.a.name||"",v.browser_major=X.a.version.major||0),v}function Id(){var v,_,a,e={};return ge()||((v=window.screen)!=null&&v.width&&(e.screen_w=window.screen.width),(_=window.screen)!=null&&_.height&&(e.screen_h=window.screen.height),(a=window.screen)!=null&&a.colorDepth&&(e.screen_color_depth=window.screen.colorDepth),e.device_pixel_ratio=window.devicePixelRatio||1),e}function Rd(v){var _={};return v&&(v.fps&&(_.fps=Math.round(1e3*v.fps)/1e3),v.width&&(_.width=v.width),v.height&&(_.height=v.height),v.codedWidth&&(_.coded_width=v.codedWidth),v.codedHeight&&(_.coded_height=v.codedHeight),v.sar&&v.sar.width!==v.sar.height&&(_.sar=v.sar),v.enhancedFlv&&(_.enhanced_flv=v.enhancedFlv?1:0)),_}function wd(v){var _={src_type:v.stat.srcType};return v.stat.stereoType&&(_.stereo_type=v.stat.stereoType),v.stat.mixCodecInput&&v.stat.mixCodecInput.length&&(_.mix_codec_input=v.stat.mixCodecInput),v.stat.mixContainerInput&&v.stat.mixContainerInput.length&&(_.mix_container_input=v.stat.mixContainerInput),v.stat.mixCodecAvailable&&(_.mix_codec_available=v.stat.mixCodecAvailable),_}function Dd(v){var _={};return v.stat.srcMeta&&(_.src_meta=v.stat.srcMeta),_}function Ld(v){var _,a,e,t={};return(_=v.lctx.current)!=null&&_.meta&&(t.current_level_meta=v.lctx.current.meta,v.lctx.current.meta.comment&&v.lctx.current.meta.comment.split("/").forEach(function(c){c.indexOf("tt=")===0&&(t.transcoding_template=c.substring(3)),c.indexOf("ttExplain=")===0&&(t.transcoding_template_explain=c.substring(10))})),(a=v.lctx.current)!=null&&a.fileSize&&(t.filesize=(e=v.lctx.current)==null?void 0:e.fileSize),t}function Sd(v){var _=performance.now();return{play:Math.round(v.playDuration+(v.playStartMS?_-v.playStartMS:0)),actualPlay:Math.round(v.actualPlayDuration+(v.actualPlayStartMS?_-v.actualPlayStartMS:0)),pause:Math.round(v.pauseDuration+(v.pauseStartMS?_-v.pauseStartMS:0)),buffer:Math.round(v.bufferTime+(v.bufferingStartMS?_-v.bufferingStartMS:0))}}var EE=function(){function v(a,e){this.kI=void 0,this.Do=void 0,this.MI=void 0,this.SI=1,this.BI=0,this.TI=0,this.DI=!0,this.RI=void 0,this.LI=void 0,this.NI=0,this.QI=0,this.xI="",this.VI=new ud,this.kI=a,this.Do=e,this.SI=1,this.MI={play:0,actualPlay:0,pause:0,buffer:0,blockCount:0,pauseCnt:0,renderBlockCount:0,seekCnt:0,seekLoadCnt:0,decodedFrames:0,droppedFrames:0,muxDroppedFrames:0,traffic:0,download:0,mseUpdate:0,mseRemove:0,segment:0,muxA:0,muxV:0,fillA:0,fillV:0,droppedA:0,droppedV:0,keyFrame:0,onLineChange:0,visibilityChange:0,heartbeatTimeout:0,loadCnt:0,refreshCnt:0,wasmDecErr:0,videoRemuxSampleCount:0,audioRemuxSampleCount:0,videoRemuxDuration:0,audioRemuxDuration:0},this.UI()}var _=v.prototype;return _.FI=function(a,e){var t={};for(var c in e){var u=a[c],g=e[c];typeof u=="number"&&typeof g=="number"&&(t[c]=u-g,e[c]=u)}return t},_.UI=function(){this.BI=performance.now(),this.TI=Date.now(),this.LI=void 0,this.RI=void 0,this.QI=0,this.xI=""},_.setFirstScreenDuration=function(a,e,t){this.LI=Math.round(a),this.RI=e,this.DI=!0,this.NI=t},_.setError=function(a,e){this.QI=a,this.xI=e},_.build=function(){var a,e=this.kI,t=this.Do,c=this.Do.stat,u=performance.now(),g=Math.round(u-this.BI),R=this.FI(e,this.MI),Q=t.mse?this.FI((a=t.mse)==null?void 0:a.stat,this.MI):void 0,se=this.FI(Sd(this.kI),this.MI),fe=this.FI(this.Do.loadRec,this.MI),xe=this.Do.loadRec.downloadInfoByRange(g),Fe=xe.timeCost?Math.round(xe.size/xe.timeCost*1e3):0,Ne={tick_index:this.SI,tick_start:this.TI,tick_duration:g,error_code:this.QI,error_message:this.xI,block_cnt:R.blockCount||0,render_block_cnt:R.renderBlockCount||0,decoded_video_frames:R.decodedFrames||0,dropped_video_frames:(R.droppedFrames||0)+(R.muxDroppedFrames||0),segment_cnt:R.segment||0,play_duration:se.play||0,buffer_time:se.buffer||0,actual_play_duration:se.actualPlay||0,played_video_duration:se.play||0,traffic:Math.round(((fe==null?void 0:fe.traffic)||0)/1024),hidden:Mi()?1:0,download:R.download,download_speed:Fe,seek_cnt:R.seekCnt,seek_load_cnt:R.seekLoadCnt,pause_duration:se.pause,pause_cnt:R.pauseCnt,on_line_change:R.onLineChange,visibility_change:R.visibilityChange,heartbeat_timeout:R.heartbeatTimeout,load_cnt:R.loadCnt,refresh_cnt:R.refreshCnt,media_buffered_a:e.bufferedEndA,media_buffered_v:e.bufferedEndV};return s()(Ne,gc(),Cd(t,e),bc(),mc(),function(He){var rt,$e,vt,dt,Dt;return He.mse?(dt=He.mse.bufferedByType(h.o.VIDEO),Dt=He.mse.bufferedByType(h.o.AUDIO)):dt=Dt=He.mediaBufferedSec,{a_buf_start:Math.round(1e3*Dt.start)||0,a_buf_end:Math.round(1e3*Dt.end)||0,a_buf_len:Math.round(1e3*Math.max(0,Dt.end-He.currentTime))||0,a_buf_slices:((rt=He.mse)==null?void 0:rt.bufferSliceNumByType(h.o.AUDIO))||He.bufferSliceNum||0,v_buf_start:Math.round(1e3*dt.start)||0,v_buf_end:Math.round(1e3*dt.end)||0,v_buf_len:Math.round(1e3*Math.max(0,dt.end-He.currentTime))||0,v_buf_slices:(($e=He.mse)==null?void 0:$e.bufferSliceNumByType(h.o.VIDEO))||He.bufferSliceNum||0,buffer_queue_cnt:((vt=He.mse)==null?void 0:vt.pendingNum())||0}}(t),function(He){if(He.stat.isLive&&He.stat.box===h.i.flv){var rt,$e,vt,dt=(rt=He.liveTime)==null?void 0:rt.getDisplayDelay(He.currentTime);if(dt)return{v_rec_delay:($e=He.liveTime)==null?void 0:$e.getRecDelay(),v_render_delay:dt||0,a_render_delay:((vt=He.liveTime)==null?void 0:vt.getAudioRenderDelay(He.currentTime))||0}}return{}}(t),Ld(t)),this.VI.hasData&&(Ne.retry_record=this.VI.beacon,Ne.retry_cnt=this.VI.retryCount,this.VI.clear()),R.wasmDecErr&&(Ne.wasm_dec_err=R.wasmDecErr),fe.muxA&&(Ne.mux_a=fe.muxA),fe.muxV&&(Ne.mux_v=fe.muxV),fe.fillA&&(Ne.fill_a=fe.fillA),fe.fillV&&(Ne.fill_v=fe.fillV),fe.droppedA&&(Ne.dropped_a=fe.droppedA),fe.droppedV&&(Ne.dropped_v=fe.droppedV),R.muxDroppedFrames&&(Ne.mux_dropped_video_frames=R.muxDroppedFrames),c.coreType===h.a.mse&&(Ne.mse_update_cnt=(Q==null?void 0:Q.mseUpdate)||0,Ne.mse_remove_cnt=(Q==null?void 0:Q.mseRemove)||0,Ne.key_frame_cnt=R.keyFrame,c.isLive?(Ne.live_shift_type=t.stat.liveShiftType,t.isLiveShift&&(Ne.live_shift=t.stat.liveShiftActive?1:0)):(Ne.lazyload_min=Math.floor(c.lazyLoadRecoverDuration),Ne.lazyload_max=Math.floor(c.lazyLoadMaxDuration)),R.audioRemuxSampleCount&&(Ne.a_remux_sample_cnt=R.audioRemuxSampleCount),R.videoRemuxSampleCount&&(Ne.v_remux_sample_cnt=R.videoRemuxSampleCount),R.audioRemuxDuration&&(Ne.a_remux_duration=Math.floor(1e3*R.audioRemuxDuration)),R.videoRemuxDuration&&(Ne.v_remux_duration=Math.floor(1e3*R.videoRemuxDuration))),this.DI&&(this.LI===void 0?Ne.first_screen_total_duration=0:(Ne.first_screen_total_duration=this.LI,Ne.first_screen_details=this.RI,c.coreType===h.a.mse&&c.box===h.i.mp4&&(Ne.mp4_moov_size=e.mp4MoovSize,e.mp4FastStart!==void 0&&(Ne.mp4_fast_start=e.mp4FastStart?0:1)),this.RI=void 0,this.LI=void 0,this.DI=!1)),typeof this.NI=="number"&&e.playStartTime&&(Ne.click_to_first_frame=this.NI,this.NI>0&&(this.NI=void 0)),this.SI===1&&s()(Ne,gc(),wd(this.Do),Id()),this.UI(),this.SI++,Ne},v}(),$r="monitor",yE=function(v){function _(e){var t;return(t=v.call(this)||this).HI=void 0,t.YI=void 0,t.GI=void 0,t.Do=void 0,t.Ci=void 0,t.KI=void 0,t.kI=void 0,t.ZI=void 0,t.WI=!1,t.XI=!1,t.zI=!1,t.JI=!1,t.qI=function(){t.kI.onLineChange++},t.$I=function(c){var u;c===void 0&&(c=cn.NORMEL);try{var g;u=(g=t.ZI)==null?void 0:g.build()}catch(Q){}if(u){var R;c===cn.NORMEL&&u.first_screen_total_duration>0?(u.type=cn.FIRST_FRAME,u.metadata=Td(t.data)):(c===cn.LOAD&&s()(u,Dd(t.Do)),u.type=c),t.JI&&(s()(u,Rd((R=t.Do.loadRec.currentLoad)==null?void 0:R.mediaInfo)),t.JI=!1),t.Do.stat.isLive||(u.seek_record=t.kI.seekRecord.slice(0),t.kI.seekRecord=[]),t.Ci.i($r,"realtime beacon",u),t.emit(D.a.REPORT,{type:Vr.REALTIME_BEACON,value:u})}},t.GI=performance.now(),t.YI=Date.now(),t.KI=new fE(e),t.Do=e,t.Ci=e.logger,t.ub(),ge||(window.addEventListener("online",t.qI),window.addEventListener("offline",t.qI)),t}T()(_,v);var a=_.prototype;return a.getName=function(){return $r},a.ub=function(){var e;this.XI=!1,this.zI=!1,this.JI=!1,this.kI=(e={decodedFrames:0,droppedFrames:0,muxDroppedFrames:0,sessionId:mE(),creationTime:0,startTime:0,loadStartTime:0,playStartTime:0,metadataTime:0,playingStartTime:0,playDuration:0,actualPlayDuration:0,pauseDuration:0,pauseCnt:0,bufferTime:0,blockCount:0,renderBlockCount:0,seekCnt:0,seekDuration:0,seekLoadCnt:0,seekLoadDuration:0,seekStartTime:0,unknownTSPacketCount:0,audioNonMonotonous:0,startBitrate:0,smoothBitrate:-1,useBackup:0,aacOverhead:0,errorCode:0,errorMessage:"",download:0,reuse:0,playPos:0,seekRecord:[],codecs:"",firstScreenTotalDuration:0,clickToFirstFrame:0,playToEnd:0,keyFrame:0,onLineChange:0,visibilityChange:0,lastHeartbeatTime:0,heartbeatTimeout:0,loadCnt:0,refreshCnt:0,monkeyPatchedFetch:"",bufferedEndA:0,bufferedEndV:0,wasmDecErr:0,audioRemuxSampleCount:0,videoRemuxSampleCount:0,audioRemuxDuration:0,videoRemuxDuration:0},Be.isSupported()&&(e.monkeyPatchedFetch=ye(fetch,"fetch")),e),this.kI.creationTime=this.YI,this.Ci.i($r,"reset",this.kI.sessionId),this.Do.fps.reset(),this.Do.fps.getFPS(this.Do.videoPlaybackQuality)},a.onRendererInitComplete=function(e){this.Ci.i($r,"renderer init complete. type: "+e.type),this.data.canvasCtxType=e.type},a.onLoaderChunkArrival=function(e){this.Do.loadRec.onDataReceive(e),this.tO(hi.DATA)},a.onMediaConnected=function(e){e.headers&&(this.kI.httpHeader=e.headers),this.tO(hi.STREAM_CONNECTED)},a.onMediaDemux=function(){this.tO(hi.DEMUX,performance.now())},a.onKeyFrame=function(e){this.Do.loadRec.currentLoad&&this.Do.loadRec.currentLoad.keyFrame++,this.data.keyFrame++,e&&this.emit(D.a.REPORT,{type:Vr.KEY_FRAME,value:e})},a.onDecLibLoaded=function(e){this.kI.decLibLoadDuration=e.duration,this.kI.decLibCacheHit=e.hitCache},a.onNewSource=function(e){var t=this.kI,c=this.Do.lctx.current;c?(this.Do.loadRec.onStreamOpen(e.sync,c.currentUrl,c.bitrate,c.qualityType),t.level=this.Do.lctx.currentIdx,t.startQualityType||(t.startQualityType=c.qualityType)):this.Do.loadRec.onStreamOpen(e.sync,"",0,"unknown")},a.onDiscontinuity=function(e){this.emit(D.a.REPORT,{type:Vr.DISCONTINUITY,value:e})},a.onDownload=function(e){var t=this,c=this.kI;e.error_code&&!this.KI.complete&&this.KI.onDownloadError(),c.download++;var u=s()({use_backup:c.useBackup,first_screen:c.firstScreenTotalDuration?1:0},Ed(this.Do,c),bc(),mc(),yd(),e);e.error_code===1009?setTimeout(function(){t.emit(D.a.REPORT,{type:Vr.DOWNLOAD,value:u})},0):this.emit(D.a.REPORT,{type:Vr.DOWNLOAD,value:u})},a.onHeartbeat=function(){var e,t,c=this.kI,u=this.Do,g=u.fps.getFPS(this.Do.videoPlaybackQuality),R={},Q=u.loadRec,se=performance.now();c.lastHeartbeatTime&&se-c.lastHeartbeatTime>Ve.j&&c.heartbeatTimeout++,c.lastHeartbeatTime=performance.now(),(u.stat.coreType===h.a.mse||u.stat.coreType===h.a.rtc)&&(R.totalReceive=Q.traffic,R.speed=Q.speed,R.videoDataRate=((e=Q.currentLoad)==null?void 0:e.videoDataRate)||0,R.audioDataRate=((t=Q.currentLoad)==null?void 0:t.audioDataRate)||0),u.mse&&(R.videoBuffered=c.bufferedEndV=Math.round(Math.max(0,1e3*(u.mse.bufferedEndByType(h.o.VIDEO)-u.currentTime))),R.audioBuffered=c.bufferedEndA=Math.round(Math.max(0,1e3*(u.mse.bufferedEndByType(h.o.AUDIO)-u.currentTime))),R.fillAudio=Q.fillA,R.fillVideo=Q.fillV,R.keyFrame=c.keyFrame,u.stat.isLive?(R.isLive=u.stat.isLive,u.stat.liveShiftType&&(R.liveShift=u.stat.liveShiftActive)):(R.lazyloadMin=u.stat.lazyLoadRecoverDuration,R.lazyloadMax=u.stat.lazyLoadMaxDuration)),R.buffered=Math.round(1e3*u.bufferedSec),R.decodedFPS=(g==null?void 0:g.decodedFPS)||0,R.droppedFPS=(g==null?void 0:g.droppedFPS)||0,c.decodedFrames=R.decodedFrames=(g==null?void 0:g.decoded)||0,c.droppedFrames=R.droppedFrames=((g==null?void 0:g.dropped)||0)+c.muxDroppedFrames,u.stat.isLive&&u.stat.box===h.i.flv&&u.liveTime&&(R.audioRenderDelay=u.liveTime.getAudioRenderDelay(u.currentTime),R.displayDelay=u.liveTime.getDisplayDelay(u.currentTime),R.recDelay=u.liveTime.getRecDelay()),u.stat.decoder===h.d.wasm&&(R.wasmFrameBufLen=u.stat.frameBufLen),R.playPos=1e3*u.currentTime,this.Ci.i($r,"heartbeat",R),this.emit(D.a.REPORT,{type:Vr.HEARTBEAT,value:R})},a.destroy=function(){this.Ci.i($r,"destroy"),this.$I(cn.END),this.iO(),ge()||(window.removeEventListener("online",this.qI),window.removeEventListener("offline",this.qI)),v.prototype.destroy.call(this)},a.onLoad=function(e){if(this.Ci.i($r,"on load: "+e.type),this.kI.loadCnt++,this.kI.metadata=void 0,e.type)e.type!==h.h.internal&&e.type!==h.h.retry||this.KI.complete||this.KI.start(),this.kI.errorCode=0,this.kI.errorMessage="";else{var t;if((t=this.Do.lctx.current)==null||t.currentUrl,this.kI.startTime){var c=this.kI.reuse;this.ub(),this.kI.reuse=c+1}this.kI.startTime=performance.now(),this.kI.loadStartTime=Date.now(),this.KI.start(),this.WI=Mi(),this.iO(),this.ZI=new EE(this.kI,this.Do),this.$I(cn.LOAD)}},a.onStopLoad=function(){this.$I(cn.END),this.iO(),this.eO()},a.onManifestParsed=function(e){this.Ci.i($r,"on manifest:",e);var t=this.Do.lctx.current;t&&(this.kI.startBitrate||(this.kI.startBitrate=t.bitrate)),this.tO(hi.MANIFEST)},a.onLevelUpdated=function(e){this.tO(hi.LEVEL)},a.onAudioTrackUpdated=function(){},a.onMediaInfo=function(e){var t,c,u,g=this.Do;(e=e||{}).box=g.stat.box,e.tagName=(t=g.video)==null?void 0:t.tagName,g.stat.srcMeta&&(e.srcMeta=g.stat.srcMeta),(c=g.lctx.current)!=null&&c.meta&&(e.currentLevelMeta=(u=g.lctx.current)==null?void 0:u.meta),typeof g.stat.isLive=="boolean"&&(e.isLive=g.stat.isLive),e.liveShiftEnabled=g.isLiveShift,e.liveShiftType=g.stat.liveShiftType,e.packName=Yr.packName,g.loadRec.onMediaInfo(e);var R=[];e.videoCodec&&R.push(e.videoCodec),e.audioCodec&&R.push(e.audioCodec),this.kI.codecs=R.join(","),this.kI.startCodec||(this.kI.startCodec=this.kI.codecs),e.sid=this.kI.sessionId,e.hardwareAccelerated=ht.isSupportHW,e.coreType=g.stat.coreType,!e.streamHost&&g.lctx.currentUrl&&(e.streamHost=new ze.a(g.lctx.currentUrl).host);var Q,se=Object(Ut.b)();se.renderer&&(e.gpu=se.renderer),g.loadRec.currentLoad&&(g.loadRec.currentLoad.mediaInfo=e),g.config.ntp&&g.stat.isLive!==!1&&g.stat.box===h.i.flv&&((Q=g.liveTime)==null||Q.ntpSync(g.stat.preferNativeLoader)),g.stat.isKwaiSlice&&(e.isKwaiSlice=g.stat.isKwaiSlice);var fe=JSON.stringify(e);this.Ci.i($r,"mediainfo",fe),this.JI=!0,this.emit(D.a.REPORT,{type:Vr.MEDIA_INFO,value:JSON.parse(fe)})},a.onParsingData=function(e){var t=this.kI;e.extra&&e.extra.stat&&(t.unknownTSPacketCount=t.unknownTSPacketCount||e.extra.stat.unknownTSPacketCount||0,t.audioNonMonotonous=t.audioNonMonotonous||e.extra.stat.audioNonMonotonous||0,t.aacOverhead=t.aacOverhead||e.extra.stat.aacOverhead||0),e.segments.forEach(function(c){c.type===h.o.VIDEO?(c.droppedFrames&&(t.muxDroppedFrames+=c.droppedFrames),t.videoRemuxSampleCount+=c.sampleCount,t.videoRemuxDuration+=c.endDTS-c.startDTS):c.type===h.o.AUDIO&&(t.audioRemuxSampleCount+=c.sampleCount,t.audioRemuxDuration+=c.endDTS-c.startDTS)}),this.tO(hi.SEGMENT)},a.onPrivNal=function(e){var t;(t=this.Do.liveTime)==null||t.onPrivNal(e),this.emit(D.a.REPORT,{type:Vr.PRIV_NAL,value:e})},a.onSei=function(e){this.emit(D.a.REPORT,{type:Vr.SEI,value:e})},a.onAacPriv=function(e){this.emit(D.a.REPORT,{type:Vr.AAC_PRIV,value:e})},a.onPlay=function(){this.kI.playStartTime||(this.kI.playStartTime=Date.now()),this.nO()},a.onLoadedmetadata=function(){this.tO(hi.LOADEDMETADATA),this.kI.metadataTime||(this.kI.metadataTime=Date.now())},a.onLoadeddata=function(){this.tO(hi.LOADEDDATA),this.eO()},a.onCanplay=function(){this.tO(hi.CANPLAY),X.a.safari&&this.Do.stat.coreType!==h.a.mse||this.eO()},a.onPlaying=function(){var e;X.a.ios&&((e=this.Do.video)==null?void 0:e.readyState)!==4||(this.XI||(this.XI=!0),this.sO(),this.rO(),this.eO())},a.onPause=function(){var e;(e=this.Do.video)!=null&&e.seeking||!this.XI||(this.hO(),this.oO(),this.XI=!1)},a.onEnded=function(){this.kI.playToEnd++,this.XI=!1,this.hO(),this.rO(),this.eO(),this.$I(cn.END),this.iO()},a.onWaiting=function(e){this.kI.playPos=Math.round(1e3*this.Do.currentTime),this.XI&&this.KI.complete&&e.block&&this.aO(e.bufferedSec)},a.onSeeking=function(e){this.kI.seekRecord.push({from:this.kI.playPos,to:Math.round(1e3*this.Do.currentTime),time:Date.now()}),this.kI.seekRecord.length>50&&this.kI.seekRecord.shift(),this.Do.stat.isLive||e!=null&&e.internal||(this.kI.seekStartTime=performance.now())},a.onSeekWithLoad=function(){this.KI.complete&&(this.$I(cn.SEEK),this.uO(),this.zI=!0)},a.onSeeked=function(){if(this.Do.fps.getFPS(this.Do.videoPlaybackQuality),this.kI.seekStartTime){this.kI.seekCnt++;var e=Math.round(performance.now()-this.kI.seekStartTime);this.kI.seekDuration+=e,this.kI.seekStartTime=0,this.zI&&(this.kI.seekLoadCnt++,this.kI.seekLoadDuration+=e)}this.zI=!1,this.KI.complete||this.Do.stat.coreType===h.a.mse||!X.a.safari&&!X.a.msie||this.tO(hi.SEEKED)},a.onTimeupdate=function(){var e,t,c=this.Do,u=c.video;if(u){u.loop&&!c.stat.isLive&&c.currentTime===0&&Number.isFinite(u.duration)&&u.duration>0&&u.duration-this.kI.playPos/1e3<1&&this.kI.playToEnd++;var g=Math.round(1e3*c.currentTime);X.a.msie&&c.stat.coreType!==h.a.mse&&this.kI.bufferingStartMS&&this.kI.playPos!==g&&this.onPlaying(),this.kI.playPos=g,!X.a.ios||typeof this.kI.bufferingStartMS!="number"||((e=this.Do.video)==null?void 0:e.readyState)!==4||(t=this.Do.video)!=null&&t.paused||this.onPlaying()}},a.onProgress=function(){var e;X.a.safari&&this.Do.stat.coreType!==h.a.mse&&this.kI.bufferingStartMS&&((e=this.Do.video)==null?void 0:e.readyState)===4&&this.eO()},a.mediaCapabilities=function(e){this.kI.smoothBitrate=e},a.onLevelSwitching=function(e){e.smooth||(this.$I(cn.LEVEL_SWITCH),this.uO())},a.onRetry=function(e){this.Do.stat.retryInfo.append(e),e.type===h.k.BACKUP&&(this.kI.useBackup=1),this.KI.onRetry(),e.type===h.k.BACKUP&&(this.ZI&&this.ZI.setError(e.code||0,e.message||""),this.$I(cn.BACKUP),this.ZI&&this.ZI.setError(0,""))},a.onRefresh=function(){this.kI.refreshCnt++},a.onMetadata=function(e){this.kI.metadata||(this.kI.metadata=e),e.mp4MoovSize&&(this.kI.mp4MoovSize=e.mp4MoovSize),typeof e.mp4FastStart=="boolean"&&(this.kI.mp4FastStart=e.mp4FastStart),typeof e.mp4MoovNoPs=="boolean"&&(this.kI.mp4MoovNoPs=e.mp4MoovNoPs),typeof e.compatible_brands=="string"&&(this.kI.mp4CompatibleBrands=e.compatible_brands),this.Ci.i($r,"metadata",e),this.emit(D.a.REPORT,{type:Vr.METADATA,value:e})},a.onVisibilityChange=function(){this.kI.visibilityChange++},a.onError=function(e){e.preventFollowUp||(e.fatal?(this.Ci.i($r,"error",e),this.kI.errorCode=e.code,this.kI.errorMessage=e.reason,this.ZI&&this.ZI.setError(e.code,e.reason),this.hO(),this.rO(),this.eO()):e.details===L.a.DECODER_DEC_ERROR&&this.kI.wasmDecErr++)},a.tO=function(e,t){t===void 0&&(t=0),!this.KI.complete&&this.KI.process(e,t)&&this.cO()},a.sO=function(){this.kI.playingStartTime||(this.kI.playingStartTime=Date.now()),this.kI.playStartMS=this.kI.playStartMS||performance.now(),this.kI.actualPlayStartMS=this.kI.actualPlayStartMS||performance.now()},a.hO=function(){this.kI.playStartMS&&(this.kI.playDuration+=performance.now()-this.kI.playStartMS),this.kI.actualPlayStartMS&&(this.kI.actualPlayDuration+=performance.now()-this.kI.actualPlayStartMS),this.kI.playStartMS=void 0,this.kI.actualPlayStartMS=void 0},a.oO=function(){this.kI.pauseCnt++,this.kI.pauseStartMS=this.kI.pauseStartMS||performance.now()},a.rO=function(){this.kI.pauseStartMS&&(this.kI.pauseDuration+=performance.now()-this.kI.pauseStartMS),this.kI.pauseStartMS=void 0},a.aO=function(e){this.kI.bufferingStartMS||(this.kI.blockCount++,this.kI.bufferingStartMS=performance.now(),e>.6&&this.kI.renderBlockCount++),this.kI.actualPlayStartMS&&(this.kI.actualPlayDuration+=performance.now()-this.kI.actualPlayStartMS),this.kI.actualPlayStartMS=void 0},a.eO=function(){this.kI.bufferingStartMS&&(this.kI.bufferTime+=performance.now()-this.kI.bufferingStartMS,this.kI.bufferingStartMS=void 0)},a.cO=function(){this.Ci.i($r,"first frame"),this.Do.stat.firstFrameLoaded=!0;var e=this.kI;e.firstScreenTotalDuration=e.firstScreenTotalDuration||Math.round(this.KI.duration),e.firstScreenDetails=e.firstScreenDetails||this.KI.details,e.playStartTime&&this.KI.complete?e.clickToFirstFrame=e.clickToFirstFrame||Math.max(1,this.KI.complete-e.playStartTime):e.clickToFirstFrame=1,this.ZI&&this.ZI.setFirstScreenDuration(this.KI.duration,this.KI.details,e.clickToFirstFrame),this.Do.video&&!this.Do.video.paused&&this.sO()},a.nO=function(){this.HI===void 0&&(this.HI=setInterval(this.$I,1e4))},a.iO=function(){this.HI&&(clearTimeout(this.HI),this.HI=void 0)},a.uO=function(){this.iO(),this.nO()},m()(_,[{key:"runningStartTime",get:function(){return this.GI}},{key:"sid",get:function(){return this.kI.sessionId}},{key:"snapshot",get:function(){var e=this.Do.loadRec,t=this.Do.stat;return s()({streams:e.streams,live:t.isLive,liveShift:t.liveShiftActive,demuxer:t.demuxerType,decSimd:t.wasmSimd,decThreads:t.wasmThreads,decoderType:t.wasmDecoder},this.kI)}},{key:"data",get:function(){return this.kI}},{key:"audienceStat",get:function(){var e,t=this.kI,c=Sd(t),u=this.Do.stat,g=this.Do.loadRec,R={play_duration:c.play,actual_play_duration:c.actualPlay,traffic:Math.round(g.traffic/1024),buffer_time:c.buffer,block_cnt:t.blockCount,render_block_cnt:t.renderBlockCount,click_to_first_frame:t.playStartTime&&t.clickToFirstFrame||0,first_screen_total_duration:Math.round(t.firstScreenTotalDuration)||0,first_screen_details:t.firstScreenDetails||this.KI.details||null,error_code:t.errorCode||0,error_message:t.errorMessage||"",remux_process_type:(this.Do.streamingMuxEnabled?1:0)+(u.gopRemux?1:0),hidden_start:this.WI?1:0,current_running_time:Math.round(performance.now()-t.startTime),running_time:Math.round(performance.now()-this.GI),smooth_bitrate:t.smoothBitrate,start_bitrate:t.startBitrate||0,abr:this.Do.config.adaptive?1:0,pause_cnt:t.pauseCnt,traffic_vcodec:g.trafficGroupedByVCodecType,traffic_level:g.trafficGroupedByLevel,decoded_video_frames:t.decodedFrames,dropped_video_frames:t.droppedFrames+t.muxDroppedFrames,pause_duration:c.pause,seek_cnt:t.seekCnt,seek_duration:t.seekDuration,seek_load_cnt:t.seekLoadCnt,seek_load_duration:t.seekLoadDuration,start_sec:u.isLive?0:Math.round(this.Do.config.startFromSec||0),on_line_change:t.onLineChange,visibility_change:t.visibilityChange,heartbeat_timeout:t.heartbeatTimeout,load_cnt:t.loadCnt,refresh_cnt:t.refreshCnt,media_buffered_v:t.bufferedEndV,media_buffered_a:t.bufferedEndA,remux_worker:this.Do.stat.webWorker?1:0,av_separated:this.Do.stat.avSeparated?1:0};if(u.retryInfo.hasData&&(R.retry_record=u.retryInfo.mergedBeacon,R.retry_cnt=u.retryInfo.retryCount),t.wasmDecErr&&(R.wasm_dec_err=t.wasmDecErr),s()(R,gc(),Cd(this.Do,t),bc(),mc(),Rd((e=this.Do.loadRec.currentLoad)==null?void 0:e.mediaInfo),wd(this.Do),Dd(this.Do),Ld(this.Do),Id()),R.metadata=Td(t),u.coreType===h.a.mse&&this.Do.mse&&(R.mse_buffer_full=this.Do.mse.stat.mseBufferFull,R.mse_remove=this.Do.mse.stat.mseRemove,R.key_frame_cnt=t.keyFrame,u.box===h.i.mp4&&(R.mp4_moov_size=t.mp4MoovSize,t.mp4CompatibleBrands!==void 0&&(R.mp4_compatible_brands=t.mp4CompatibleBrands),t.mp4FastStart!==void 0&&(R.mp4_fast_start=t.mp4FastStart?1:0),t.mp4MoovNoPs!==void 0&&(R.mp4_moov_no_ps=t.mp4MoovNoPs?1:0)),R.a_remux_sample_cnt=t.audioRemuxSampleCount,R.v_remux_sample_cnt=t.videoRemuxSampleCount,R.a_remux_duration=Math.floor(1e3*t.audioRemuxDuration),R.v_remux_duration=Math.floor(1e3*t.videoRemuxDuration)),typeof this.Do.config.audioEnabled=="boolean"&&(R.a_enabled=this.Do.config.audioEnabled?1:0),typeof this.Do.config.videoEnabled=="boolean"&&(R.v_enabled=this.Do.config.videoEnabled?1:0),g.muxA&&(R.mux_a=g.muxA),g.muxV&&(R.mux_v=g.muxV),g.fillA&&(R.fill_a=g.fillA),g.fillV&&(R.fill_v=g.fillV),g.droppedA&&(R.dropped_a=g.droppedA),g.droppedV&&(R.dropped_v=g.droppedV),t.muxDroppedFrames&&(R.mux_dropped_video_frames=t.muxDroppedFrames),be(u.box)&&(R.unknown_ts_packet_count=t.unknownTSPacketCount,R.audio_non_monotonous=t.audioNonMonotonous,R.aac_overhead=t.aacOverhead),typeof t.decLibLoadDuration=="number"&&(R.dec_lib_load_duration=Math.round(t.decLibLoadDuration),R.dec_lib_hit=t.decLibCacheHit||""),this.Do.stat.coreType===h.a.native){var Q=this.Do.stat.retryInfo.getLastMseError();Q&&(R.last_error_code=t.errorCode,R.last_error_message=t.errorMessage,R.error_code=Q.code,R.error_message=Q.reason)}return R}}])}(uc),xt="kernel",Od=function(v){function _(e,t){var c;return(c=v.call(this)||this).eA=void 0,c.Do=void 0,c.fO=void 0,c.nA=void 0,c.AO=new C.EventEmitter,c.Ci=void 0,c.vO=!1,c.dO=void 0,c.Ai=void 0,c.lO=void 0,c.Tg=function(u){var g=c.Do;u.levels=g.lctx.levels.map(function(se){return se.getKLevel()}),u.currentLevel=g.lctx.currentIdx,u.auto=g.lctx.abr,u.levels=g.lctx.levels.map(function(se){return se.getKLevel()});var R=g.lctx.audioTracks;R&&R.length&&(u.audioTrack=g.lctx.audioIdx,u.audioTracks=R.map(function(se){return{lang:se.lang,qualityLabel:se.qualityLabel,qualityType:se.qualityType,bitrate:se.bitrate,groupId:se.groupId}}));var Q=g.lctx.subtitleTracks;Q&&Q.length&&(u.subtitleTrack=g.lctx.subtitleIdx,u.subtitleTracks=Q.map(function(se){return{lang:se.lang,name:se.name,groupId:se.groupId}})),u.currentLevel=g.lctx.currentIdx,u.auto=g.lctx.abr,u.isLive=g.stat.isLive,g.stat.stereoType!==void 0&&(u.stereoType=g.stat.stereoType)},c.bO=function(u){c.pO(u)},c.sb=function(u){u.type===h.h.retry&&(c.nA=void 0)},c.mO=function(u){u.pos=Math.floor(c.eA.currentTime),u.ts=Math.floor(performance.now())},c.Di=function(u){if(c.Ci.i(xt,"on error",u),!u.preventFollowUp){var g=c.Do;if(u.details===L.a.MANIFEST_PARSING_ERROR)try{ec.isSrcEmpty(c.Do.src)&&(c.Ci.i(xt,"src empty",c.Do.src),u.details=L.a.SRC_EMPTY),g.src?typeof g.src=="string"?u.reason+="src str:"+g.src.slice(0,1024):g.src instanceof Blob?u.reason+="src: blob":u.reason+="src other:"+JSON.stringify(g.src).slice(0,1024):u.reason+="src:"+g.src}catch(Q){u.reason+=Q.message}var R=Object(L.d)(u.details,u.reason,u.statusCode||0);u.code=R,c.nA||(c.nA=u),u.fatal&&c.stopLoad()}},c.gO=function(u){c.Ci.i(xt,"window error:",u.message);try{c.Ci.i(xt,"window error stack:",u.error.stack)}catch(g){}},c.yO=function(){c.Do.evt.emit(D.a.VISIBILITY_CHANGE,{hidden:document.hidden})},c.eA=e,c.Do=new Yr(t||{},c.eA),c.Yb(),c.Ci=c.Do.logger,typeof location<"u"&&c.Ci.i(xt,"href: "+location.href),c.Ci.i(xt,Yr.packName+", "+Yr.version+" build: "+Yr.buildTime+" cors: "+(e==null?void 0:e.crossOrigin)+" autoplay: "+(e==null?void 0:e.autoplay)+" dom: "+e.tagName,t),(!c.Do.config||c.Do.config.audioEnabled===!1&&c.Do.config.videoEnabled===!1)&&setTimeout(function(){c.zA(Object(L.e)(L.b.OTHER_ERROR,L.a.CONFIG_ERROR,"config data error"))},0),c.fO=new yE(c.Do),c.Do.config.src&&(c.lO=c._O()),c.dO=new Zb(c.Do,function(u){var g;return(g=c.lO)==null?void 0:g.internalSeek(u)}),c.Ai=new Kb(c.Ci,c.Do.evt),c.Ai.register(c.dO),c.Ai.register(c.fO),c.Ai.register(new Wb(c.Do,c.AO)),c.O.push(c.Ai,c.dO,c.fO),c.Ci.i(xt,"config",c.Do.config),Yr.instanceCount++,ge()||(window.addEventListener("error",c.gO),document.addEventListener("visibilitychange",c.yO)),c}T()(_,v),_.isSupport=function(e){if(h.i.webrtc===(e==null?void 0:e.box))return ht.isWebRTCSupported();if(e!=null&&e.nativeFirst)return ht.isVideoBoxSupported(e==null?void 0:e.box);var t=ht.isSupported();if(t){var c=!0;e&&(c=!(!e.isLive||e.box!==h.i.flv));var u=!c||$a.isStreamingSupported();return t&&!!u}return ht.isVideoBoxSupported(e==null?void 0:e.box)},_.videoCodecCapabilities=function(e){return ht.getVideoCodecCompatibilityByCodec(e)};var a=_.prototype;return a.on=function(e,t){this.Ci.i(xt,"call on "+e),this.AO.on(e,t)},a.once=function(e,t){this.Ci.i(xt,"call once "+e),this.AO.once(e,t)},a.removeAllListeners=function(e){this.Ci.i(xt,"call removeAllListeners"),this.AO.removeAllListeners(e)},a.off=function(e,t){this.Ci.i(xt,"call off "+e),this.AO.off(e,t)},a.listeners=function(e){return this.AO.listeners(e)},a.emit=function(e,t){return this.AO.emit(e,t)},a.listenerCount=function(e){return this.AO.listenerCount(e)},a.prependListener=function(e,t){this.AO.prependListener(e,t)},a.prependOnceListener=function(e,t){this.AO.prependOnceListener(e,t)},a.load=function(e,t){var c,u=this;if(this.Ci.i(xt,"call kernel load",e,t),this.fO.data.startTime>0&&this.Ci.i(xt,"play summary data:",this.fO.audienceStat),e&&this.Do.setSrc(e),this.Do.src)if(_.isSupport({box:this.Do.stat.box,isLive:this.Do.stat.isLive,nativeFirst:this.Do.stat.native})){var g,R;typeof(t==null?void 0:t.startFromSec)=="number"?this.Do.stat.startFromSec=t.startFromSec:e&&(this.Do.stat.startFromSec=-1),this.Do.stat.multipart&&this.Do.config.resourceBuffer&&Gr(this.Do.config.resourceBufferSize),e&&((c=this.lO)==null?void 0:c.type)!==((R=this.Do).stat.box===h.i.webrtc?h.a.rtc:R.stat.native?h.a.native:h.a.mse)&&((g=this.lO)==null||g.destroy(),this.lO=void 0),this.Do.fallback.register(le.NEXT_DESC,new Yb(this.Do).setRetryFunc(this.CO.bind(this))),this.Do.fallback.register(le.SWAP_264,new Qb(this.Do).setRetryFunc(this.CO.bind(this))),this.RA()}else setTimeout(function(){u.zA(Object(L.e)(L.b.OTHER_ERROR,L.a.UNSUPPORTED,"unsupported: "+u.Do.stat.box+" live: "+u.Do.stat.isLive+" native: "+u.Do.stat.native))},0);else this.zA(Object(L.e)(L.b.OTHER_ERROR,L.a.SRC_EMPTY,"url empty"))},a.getTimeNow=function(){var e;return((e=this.Do.liveTime)==null?void 0:e.serverNowMs)||null},a.setAvailableAbrLevels=function(e){this.Ci.i(xt,"setAvailableAbrLevels",e),this.Do.lctx.availableList=e.splice(0),this.lO&&"onAbrLevelsUpdated"in this.lO&&this.lO.onAbrLevelsUpdated()},a.preload=function(e,t){this.Ci.i(xt,"call preload")},a.isTimeinBuffered=function(e){return this.Do.stat.box!==h.i.webrtc&&this.Do.isTimeinBuffered(e)},a.resume=function(){var e,t,c=this;this.Ci.i(xt,"call resume"),(e=this.lO)==null||e.resume(),this.eA.paused&&((t=this.eA.play())==null||t.catch(function(u){return c.Ci.i(xt,"resume, call play() fail.",u)}))},a.destroy=function(){var e;this.Ci.i(xt,"call kernel destroy. play summary data:",this.fO.audienceStat),this.vO&&(Yr.instanceCount--,this.vO=!0),yi(),this.Do.fallback.unregisterAndDestroy(le.NEXT_DESC),this.Do.fallback.unregisterAndDestroy(le.SWAP_264),this.Do.fallback.unregisterAndDestroy(le.SWAP_CORE),v.prototype.destroy.call(this),(e=this.lO)==null||e.destroy(),this.Do.destroy(),this.removeAllListeners(),ge()||(window.removeEventListener("error",this.gO),document.removeEventListener("visibilitychange",this.yO))},a.refresh=function(){var e,t;this.Ci.i(xt,"call kernel refresh"),this.fO.onRefresh(),this.nA=void 0,(e=this.Do.cOutput)==null||e.reset(),(t=this.lO)==null||t.refresh()},a.stopLoad=function(){var e;this.Ci.i(xt,"call kernel stopLoad"),(e=this.lO)==null||e.stopLoad()},a.getStreamTime=function(e){var t=this.Do.streamTime.getStreamTime(e/1e3);return t?1e3*t:NaN},a.getAudienceStat=function(){return this.fO.audienceStat},a.getMediaInfo=function(){var e;return s()({},(e=this.Do.loadRec.currentLoad)==null?void 0:e.mediaInfo)},a.experiment=function(e){this.Ci.i(xt,"experiment",e)},a.liveEnd=function(){this.Ci.i(xt,"call liveEnd"),this.lO&&"liveEnd"in this.lO&&this.lO.liveEnd()},a.seekToNextFrame=function(){this.Ci.i(xt,"call seekToNextFrame"),this.lO&&"seekToNextFrame"in this.lO?this.lO.seekToNextFrame():this.IO()},a.seekToPrevFrame=function(){this.Ci.i(xt,"call seekToPrevFrame"),this.lO&&"seekToPrevFrame"in this.lO?this.lO.seekToPrevFrame():this.IO()},a.seekByFrameIndex=function(e){if(this.Ci.i(xt,"call seekByFrameIndex",e),this.lO&&"setCurretVideoFrame"in this.lO)return this.lO.setCurretVideoFrame(e);this.IO()},a.screenshot=function(e){var t;e&&(e=JSON.parse(JSON.stringify(e))),this.Ci.i(xt,"call screenshot",e),(t=this.lO)==null||t.screenshot(e)},a.RA=function(e){this.nA=void 0,this.lO||(this.lO=this._O()),this.lO&&(this.Do.fallback.hasFallback(le.SWAP_CORE)||(this.lO.type===h.a.mse?this.Do.fallback.register(le.SWAP_CORE,new Xb(this.Do).setRetryFunc(this.OO.bind(this))):this.lO.type===h.a.native&&this.Do.fallback.register(le.SWAP_CORE,new $b(this.Do).setRetryFunc(this.wO.bind(this)))),this.lO.load(e),this.Do.stat.coreType=this.lO.type)},a._O=function(){var e=this.Do,t=function(c){return c.stat.native?new Jb(c):c.stat.box!==h.i.webrtc&&cc?new cc(c):c.stat.box===h.i.webrtc&&od?new od(c):void 0}(e);if(t)return this.Ci.i(xt,"init av core. type: "+t.type),e.stat.coreType=t.type,t;this.zA(Object(L.e)(L.b.OTHER_ERROR,L.a.UNSUPPORTED,"init core error. "+e.stat.box+" native: "+e.stat.native+" unsupported."))},a.OO=function(){this.CO(h.a.native)},a.wO=function(){this.CO(h.a.mse)},a.CO=function(e){var t,c,u=this,g=this.eA.paused;!this.Do.live&&this.Do.stat.startFromSec<=0&&(this.Do.stat.startFromSec=this.eA.currentTime),(t=this.lO)==null||t.destroy(),this.lO=void 0,e!==void 0&&(this.Do.stat.native=e!==h.a.mse),this.Do.stat.demuxerType=void 0,this.RA(h.h.retry),g||(c=this.eA.play())==null||c.catch(function(R){return u.Ci.i(xt,"recover, call play() fail.",R)})},a.pO=function(e){var t=this.Do.cOutput;t&&(e===void 0&&(e={enabled:!0,type:t.rendererType,canvas:t.rendererType===h.s.canvas&&t.canvas?t.canvas:void 0}),this.Ci.i(xt,"video renderer change",e),e.canvas&&this.emit(D.a.H265_DETECTED,{canvas:e.canvas,message:"",enabled:e.enabled,decoder:h.d.wasm}))},a.IO=function(){this.zA(Object(L.e)(L.b.MEDIA_ERROR,L.a.CANNOT_SEEK_BY_FRAME_INDEX,"unsupported",{fatal:!1}))},a.zA=function(e){this.Do.evt.emit(D.a.ERROR,e)},a.Yb=function(){var e=this.Do.evt;e.on(D.a.ERROR,this.Di),e.on(D.a.MANIFEST_PARSED,this.Tg),e.on(D.a.VIDEO_RENDERER_CHANGE,this.bO),e.on(D.a.LOAD,this.sb),e.on(D.a.RETRY,this.mO)},m()(_,[{key:"liveShiftType",get:function(){return this.Do.stat.liveShiftType}},{key:"liveShift",get:function(){return this.Do.stat.liveShiftActive}},{key:"liveShiftDelaySec",get:function(){return this.Do.config.liveShiftDelaySec}},{key:"currentVideoFrame",get:function(){return this.lO&&"getCurrentVideoFrame"in this.lO?this.lO.getCurrentVideoFrame():0},set:function(e){this.Ci.i(xt,"call set currentVideoFrame",e),this.lO&&"setCurretVideoFrame"in this.lO&&this.lO.setCurretVideoFrame(e)}},{key:"totalVideoFrames",get:function(){return this.lO&&"getTotalVideoFrames"in this.lO?this.lO.getTotalVideoFrames():0}},{key:"audioTrack",get:function(){return this.Do.lctx.audioIdx||0},set:function(e){var t;this.Ci.i(xt,"call set audioTrack",e),this.Do.config.audioEnabled===!1&&(this.Ci.i(xt,"set audioTrack failed. conf audio enabled false"),this.emit(D.a.AUDIO_TRACK_SWITCH_FAILED)),this.lO&&"setAudioTrack"in this.lO&&((t=this.lO)==null||t.setAudioTrack(e))}},{key:"subtitleTrack",get:function(){return this.Do.lctx.subtitleIdx||0},set:function(e){var t;this.Ci.i(xt,"call set subtitleTrack",e),this.lO&&"setSubtitleTrack"in this.lO&&((t=this.lO)==null||t.setSubtitleTrack(e))}},{key:"currentLevel",get:function(){return this.Do.lctx.currentIdx||0},set:function(e){if(this.Ci.i(xt,"call set currentLevel from: "+this.Do.lctx.currentIdx+" to: "+e+" ",this.Do.lctx.abr),this.lO&&"setCurrentLevel"in this.lO)if(e<0&&!this.Do.isAbrAvailable)this.Ci.i(xt,"set currentLevel failed. unsupported auto"),this.emit(D.a.LEVEL_SWITCH_FAILED);else if(this.Do.config.videoEnabled===!1)this.Ci.i(xt,"set currentLevel failed. conf video enabled false"),this.emit(D.a.LEVEL_SWITCH_FAILED);else{var t;(t=this.lO)==null||t.setCurrentLevel(e)}else this.Ci.i(xt,"set nextLevel failed. unsupported"),this.emit(D.a.LEVEL_SWITCH_FAILED)}},{key:"nextLevel",get:function(){return this.Do.lctx.nextIdx||0},set:function(e){if(this.Ci.i(xt,"call set nextLevel from: "+this.Do.lctx.nextIdx+" to "+e),this.lO&&"setNextLevel"in this.lO)if(e<0&&!this.Do.isAbrAvailable)this.Ci.i(xt,"set nextLevel failed. unsupported auto"),this.emit(D.a.LEVEL_SWITCH_FAILED);else if(this.Do.config.videoEnabled===!1)this.Ci.i(xt,"set nextLevel failed. conf video enabled false"),this.emit(D.a.LEVEL_SWITCH_FAILED);else{var t;(t=this.lO)==null||t.setNextLevel(e)}else this.Ci.i(xt,"set nextLevel failed. unsupported"),this.emit(D.a.LEVEL_SWITCH_FAILED)}},{key:"startLevel",get:function(){return this.Do.lctx.startIdx||0},set:function(e){this.Ci.i(xt,"call set startLevel",e),this.Do.lctx.startIdx=e}},{key:"outputLog",get:function(){return this.Do.logger.getOutput()},set:function(e){this.Ci.i(xt,"call set output log",e),this.Do.logger.setOutput(e)}},{key:"autoLevelEnabled",get:function(){return this.Do.lctx.abr}},{key:"monitorData",get:function(){return this.fO&&this.lO?s()(this.fO.snapshot,{trackBufInfo:this.lO.getTrackBufInfo()}):null}},{key:"currentLevelTimeInfo",get:function(){var e=this.Do.lctx.current;if(e&&e.timeInfo)return e.timeInfo}},{key:"instanceId",get:function(){return this.Do.id}}],[{key:"version",get:function(){return Yr.version}},{key:"buildTime",get:function(){return Yr.buildTime}},{key:"MediaBox",get:function(){return h.i}},{key:"Events",get:function(){return{REPORT:D.a.REPORT,ERROR:D.a.ERROR,LEVEL_SWITCHING:D.a.LEVEL_SWITCHING,LEVEL_SWITCHED:D.a.LEVEL_SWITCHED,LEVEL_SWITCH_PLAYING:D.a.LEVEL_SWITCH_PLAYING,LEVEL_SWITCH_FAILED:D.a.LEVEL_SWITCH_FAILED,AUDIO_TRACK_SWITCHING:D.a.AUDIO_TRACK_SWITCHING,AUDIO_TRACK_SWITCHED:D.a.AUDIO_TRACK_SWITCHED,AUDIO_TRACK_UPDATED:D.a.AUDIO_TRACK_UPDATED,SUBTITLE_TRACK_SWITCHED:D.a.SUBTITLE_TRACK_SWITCHED,MANIFEST_PARSED:D.a.MANIFEST_PARSED,LEVEL_UPDATED:D.a.LEVEL_UPDATED,LOAD_END:D.a.LOAD_END,VIDEO_RENDERER_CHANGE:D.a.VIDEO_RENDERER_CHANGE,SCREENSHOT:D.a.SCREENSHOT}}},{key:"Reports",get:function(){return s()({},Vr)}}])}(F.a);function CE(v,_){return ge()?void 0:new Od(v,_)}}]);fi===void 0&&console.error("esm-webpack-plugin: nothing exported!");const B_=fi.default;fi.createKernel,fi.AbstractDestroyable,fi.CanvasContextType,fi.CodecType,fi.DestroyableList,fi.Decoder,fi.DemuxerType,fi.DownloadStatus,fi.ErrorDetails,fi.ErrorTypes,fi.HttpRangeType;const vr=fi.KEvents;fi.LiveShiftType,fi.LogLevel,fi.MediaBox,fi.ReportTypes,fi.StereoType,fi.VideoDecBlockPolicy,fi.VideoDropFramePolicy,fi.VideoRendererType,fi.WasmDecoder;const dn={"kwai-player":"_kwai-player_1ufc0_2","kwai-player-video-interactive":"_kwai-player-video-interactive_1ufc0_11","kwai-player-poster":"_kwai-player-poster_1ufc0_19","kwai-player-video":"_kwai-player-video_1ufc0_11","kwai-player-disable-scroll":"_kwai-player-disable-scroll_1ufc0_52","kwai-player-yoda":"_kwai-player-yoda_1ufc0_56"},ro="kwai-player-id",no=class xn{static next(){if(Wc.available){const i=xn._ls.read(ro,!1);let n=xn._id;return typeof i=="number"?(n=this.getNextId(i),this._ls.write(ro,n)):(n=this.getNextId(n),this._ls.write(ro,n)),xn._id=n,n}else return xn._id=xn.getNextId(xn._id),xn._id}static get MAX_ID(){return 999}static getNextId(i){return i++,i>xn.MAX_ID?0:i}};tt(no,"_id",0),tt(no,"_ls",new Wc);let V_=no;class ha{static verify(i){return!!(i&&i.liveStreamId&&(Array.isArray(i.liveAdaptiveManifest)&&i.liveAdaptiveManifest.length||Array.isArray(i.multiResolutionPlayUrls)&&i.multiResolutionPlayUrls.length||Array.isArray(i.playUrls)&&i.playUrls.length||i.hlsPlayUrl))}static parse(i){if(ha.verify(i)){let n;return i.liveAdaptiveManifest&&i.liveAdaptiveManifest.length?n=i.liveAdaptiveManifest[0]:i.multiResolutionPlayUrls&&i.multiResolutionPlayUrls.length&&(n=ha._multiResolution2Manifest(i.multiResolutionPlayUrls)),ua&&i.hlsPlayUrl?n?[{src:n},{src:i.hlsPlayUrl}]:i.hlsPlayUrl:n}}static _multiResolution2Manifest(i){return{version:"1",adaptationSet:{representation:i.map((n,o)=>{var s;return{id:o,url:(s=n.urls[0])==null?void 0:s.url,name:n.name,bitrate:0,qualityType:n.type,defaultSelect:n.defaultSelect}}).filter(n=>n.url)}}}}var $c=(r=>(r[r.CTOR_ERROR=1e4]="CTOR_ERROR",r))($c||{});class F_{static verify(i){return i&&Object.prototype.hasOwnProperty.call(i,"version")&&Object.prototype.hasOwnProperty.call(i,"adaptationSet")&&Object.prototype.hasOwnProperty.call(i.adaptationSet,"representation")&&Array.isArray(i.adaptationSet.representation)&&i.adaptationSet.representation.length>0?i.adaptationSet.representation.reduce((n,o)=>!!(n&&o.url&&o.bitrate&&o.qualityType),!0):!1}}class j_{static verify(i){return i&&i.adaptationSet&&i.adaptationSet.length?i.adaptationSet.reduce((n,o)=>!!(n&&o.representation&&o.representation.length),!0):!1}}const H_=/\.[^./\\?#]+(?=$|[?#])/i;function G_(r){const i=r.toLocaleLowerCase().match(H_);return i?i[0]:""}let z_=class Qs{static parse(i){if(typeof i=="string")try{return i=JSON.parse(i),Qs._parseManifest(i)}catch(n){return Qs._parseUrl(i)}else if(typeof i=="object")return Qs._parseManifest(i)}static _parseUrl(i){return G_(i)===".flv"?{isLive:!0,src:{liveStreamId:"",playUrls:[{url:i}]}}:{isLive:!1,src:[{url:i}]}}static _parseManifest(i){return j_.verify(i)?{isLive:!1,src:i}:F_.verify(i)?{isLive:!0,src:{liveStreamId:"",liveAdaptiveManifest:[i]}}:ha.verify(i)?{isLive:!0,src:i}:{isLive:!1}}};const Xc=typeof document>"u"?void 0:document.createElement("video");function K_(){return!!(Xc!=null&&Xc.requestPictureInPicture)}const Zc="fullscreen";class W_{constructor(i,n){tt(this,"_evt"),tt(this,"_logger"),tt(this,"_element"),tt(this,"_isFillWindow",!1),tt(this,"_originStyle"),tt(this,"_isSupportFullscreen",!0),tt(this,"_onFullscreenChange",()=>{this._logger.i(Zc,"_onFullscreenChange",this.isFull()),this.isFull()||(this._recoverStyle(),document.body.classList.remove(dn["kwai-player-disable-scroll"])),this._isFillWindow=!1,this._evt.emit("fullChange",{type:Zr.SYSTEM,isFull:this.isFull()})}),this._evt=i,this._logger=n,!(typeof document>"u")&&(this._isSupportFullscreen=typeof this._getExitFullscreenFunc()<"u"&&!(hn.os.name==="iOS"&&hn.device.type==="mobile"),"onfullscreenchange"in document?(document.addEventListener("fullscreenchange",this._onFullscreenChange),document.addEventListener("fullscreenerror",this._onFullscreenChange)):"onwebkitfullscreenchange"in document&&(document.addEventListener("webkitfullscreenchange",this._onFullscreenChange),document.addEventListener("webkitfullscreenerror",this._onFullscreenChange)))}destroy(){document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("fullscreenerror",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenerror",this._onFullscreenChange)}requestFull(i,n){n===Zr.SYSTEM?this.requestFullscreen(i):n===Zr.WINDOW?this.requestFillWindow(i):this._isSupportFullscreen?this.requestFullscreen(i):this.requestFillWindow(i)}exitFull(i){if(i===Zr.SYSTEM)return this.exitFullscreen();if(i===Zr.WINDOW)return this.exitFillWindow();this.isFull(Zr.SYSTEM)?this.exitFullscreen():this.exitFillWindow()}isFull(i){return i===Zr.SYSTEM?this.isFullScreen():i===Zr.WINDOW?this.isFillWindow():this.isFullScreen()||this.isFillWindow()}requestFullscreen(i){this._element=i,this._originStyle||this._saveOriginStyle(i),(hn.os.name==="Mac OS"||hn.browser.name==="IE"||hn.os.name==="iOS"&&hn.device.type!=="mobile")&&(i.style.width="100%",i.style.height="100%",i.style.background="black");const n=i;let o;n.requestFullscreen?o=n.requestFullscreen():n.mozRequestFullscreen?o=n.mozRequestFullscreen():n.mozRequestFullScreen?o=n.mozRequestFullScreen():n.webkitRequestFullscreen?o=n.webkitRequestFullscreen():n.webkitRequestFullScreen?o=n.webkitRequestFullScreen():n.msRequestFullscreen&&(o=n.msRequestFullscreen()),typeof Promise<"u"&&o instanceof Promise&&o.catch(s=>this._logger.e(Zc,s))}exitFullscreen(){this._recoverStyle(),this._element=void 0;const i=document;i.exitFullscreen?i.exitFullscreen():i.webkitCancelFullScreen?i.webkitCancelFullScreen():i.mozCancelFullScreen?i.mozCancelFullScreen():i.msExitFullscreen&&i.msExitFullscreen()}isFullScreen(){const i=document;return!!(i.fullscreen||i.fullscreenElement||i.isFullScreen||i.webkitIsFullScreen||i.mozFullScreen||i.msFullscreenElement)}requestFillWindow(i){this._element=i,this._originStyle||this._saveOriginStyle(i),i.style.width="100%",i.style.height="100%",i.style.background="black",i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.zIndex="99999",document.body.classList.add(dn["kwai-player-disable-scroll"]),this._isFillWindow=!0,this._evt.emit("fullChange",{type:"window",isFull:!0})}exitFillWindow(){this._recoverStyle(),this._isFillWindow=!1,this._element&&(this._element.style.zIndex="auto"),this._element=void 0,document.body.classList.remove(dn["kwai-player-disable-scroll"]),this._evt.emit("fullChange",{type:"window",isFull:!1})}isFillWindow(){return this._isFillWindow}isFullscreenAvailable(i){return i!==Zr.WINDOW&&typeof document<"u"?!!document.body.requestFullscreen||!!document.body.webkitRequestFullscreen||!!document.body.msRequestFullscreen||!!document.body.mozRequestFullscreen:!0}_getExitFullscreenFunc(){const i=document;return i.exitFullscreen||i.webkitCancelFullScreen||i.mozCancelFullScreen||i.msExitFullscreen}_saveOriginStyle(i){this._originStyle={position:i.style.position,background:i.style.background,width:i.style.width,height:i.style.height,left:i.style.left,right:i.style.right}}_recoverStyle(){if(this._element)for(const i in this._originStyle)this._element.style[i]=this._originStyle[i];this._originStyle=void 0}}const qc="ControlsPlugin",Jc="I18nPlugin",el="LoggerPlugin",tl="HotkeyPlugin",il="PlayInfoPlugin",rl="RotatePlugin",nl="PreviewPlugin",al="MaskPlugin",sl="VRPlugin",ol="DanmakuPlugin";var cl=(r=>(r.DARK="dark",r.LIGHT="light",r))(cl||{}),ll=(r=>(r.BOTTOM="bottom",r.PLAY_BAR="playBar",r.NONE="none",r))(ll||{}),ul=(r=>(r.PLAY_BAR_LEFT="playBarLeft",r.PLAY_BAR_RIGHT="playBarRight",r.CONTEXT_MENU="contextMenu",r))(ul||{});class Y_{constructor(){tt(this,"_callbacks",[])}add(i){this._callbacks.push(i)}remove(i){const n=this._callbacks.findIndex(o=>o===i);n>=0&&this._callbacks.splice(n,1)}call(i){this._callbacks.forEach(n=>n(i))}destroy(){this._callbacks.splice(0,this._callbacks.length)}}class tr extends Qc{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}}tt(tr,"label"),tt(tr,"version"),tt(tr,"isSupported");const hl=class Md extends tr{getLabel(){return Md.label}beforeInstall(i,n){}afterInstall(i,n){}};tt(hl,"label",qc);let Q_=hl;const dl=class Pd extends tr{getLabel(){return Pd.label}beforeInstall(i,n){}afterInstall(i,n){}};tt(dl,"label",Jc);let $_=dl;const fl=class Ud extends tr{getLabel(){return Ud.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}};tt(fl,"label",el);let X_=fl;const pl=class Bd extends tr{getLabel(){return Bd.label}};tt(pl,"label",tl);let Z_=pl;const _l=class Vd extends tr{getLabel(){return Vd.label}};tt(_l,"label",il);let q_=_l;const Al=class Fd extends tr{getLabel(){return Fd.label}};tt(Al,"label",rl);let J_=Al;const vl=class jd extends tr{getLabel(){return jd.label}};tt(vl,"label",nl);let eA=vl;const gl=class Hd extends tr{getLabel(){return Hd.label}};tt(gl,"label",al);let tA=gl;const ml=class Gd extends tr{getLabel(){return Gd.label}};tt(ml,"label",sl);let iA=ml;const bl=class zd extends tr{getLabel(){return zd.label}};tt(bl,"label",ol);let rA=bl;const Fi="pluginBase",El=class Kd{constructor(){tt(this,"_instances",[])}static register(i,n="append"){ci.i(Fi,"register",i.label,i.version),i.label||ci.i(Fi,"register plugin label is empty.");const o=this._plugins.findIndex(s=>s.label===i.label);o>=0?(ci.i(Fi,`register plugin label: ${i.label} exists.`),this._plugins.splice(o,1,i)):n==="append"?this._plugins.push(i):this._plugins.unshift(i)}static deregister(i){if(typeof i=="string"){ci.i(Fi,"deregister",i);const n=this._plugins.findIndex(o=>o.label===i);if(n===-1){ci.i(`${i} plugin unregistered`);return}this._plugins.splice(n,1)}else{ci.i(Fi,"deregister",i.label);const n=this._plugins.indexOf(i);if(n===-1){ci.i(`${i.label} plugin unregistered`);return}this._plugins.splice(n,1)}}initialize(i){const n=this._instances;for(const o of Kd._plugins)try{if(i&&i[o.label]===!1)continue;if(o.isSupported===!1){ci.i(Fi,`initialize ${o.label}, ${o.version}. The current browser does not support this plugin.`);continue}ci.i(Fi,"initialize",o.label,o.version,i);const s=new o;tr.isInstanceOfPlugin(s)?n.push(s):ci.e(Fi,`plugin type error: ${s}`)}catch(s){ci.e(Fi,"plugin initialize error",s)}}beforeInstallPlugins(i,n){for(const o of this._instances){const s=o.getLabel();ci.i(Fi,"beforeInstallPlugins",n,s);try{if(!o.beforeInstall)continue;n&&typeof n[s]=="object"?o.beforeInstall(i,n[s]):o.beforeInstall(i)}catch(d){ci.e(Fi,"beforeInstallPlugins error",d)}}}afterInstallPlugins(i,n){for(const o of this._instances){const s=o.getLabel();ci.i(Fi,"afterInstallPlugins",s,n);try{if(!o.afterInstall)continue;n&&typeof n[s]=="object"?o.afterInstall(i,n[s]):o.afterInstall(i)}catch(d){ci.e(Fi,"afterInstallPlugins error",d)}}}beforeUninstallPlugins(i){for(const n of this._instances)try{if(ci.i(Fi,"beforeUninstallPlugins",n.getLabel()),!n.beforeUninstall)continue;n.beforeUninstall.call(n,i)}catch(o){ci.e(Fi,"plugin beforeUninstall error",o)}}afterUninstallPlugins(i){for(const n of this._instances)try{if(ci.i(Fi,"afterUninstallPlugins",n.getLabel()),!n.afterUninstall)continue;n.afterUninstall.call(n,i)}catch(o){ci.e(Fi,"plugin afterUninstall error",o)}this._instances=[]}getPlugin(i){for(let n=0;n<this._instances.length;n++)if(this._instances[n].getLabel()===i)return this._instances[n]}getAllPlugins(){return this._instances}};tt(El,"_plugins",[]);let ao=El;const nA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAC1JREFUWEft0EERAAAAAUH6lxbDZxU4s815PffjAAECBAgQIECAAAECBAgQIDAaPwAh6O5R/QAAAABJRU5ErkJggg==",at="kwai-player",so=class Xr{constructor(i,n){tt(this,"_pluginBase",new ao),tt(this,"_eventHandlers"),tt(this,"_evt"),tt(this,"_mainDom"),tt(this,"_video"),tt(this,"_kernel"),tt(this,"_error"),tt(this,"_config"),tt(this,"_src",""),tt(this,"_autoplay",!1),tt(this,"_preload","none"),tt(this,"_poster",""),tt(this,"_controls","default"),tt(this,"_videoWidth",0),tt(this,"_videoHeight",0),tt(this,"_kernelLoaded",!1),tt(this,"_livePaused",!1),tt(this,"_canvas"),tt(this,"_mediaInfo"),tt(this,"_logger"),tt(this,"_isLiveShift",!1),tt(this,"_full"),tt(this,"_subContainerNumber",0),tt(this,"_data"),tt(this,"_id"),tt(this,"_videoLayer"),tt(this,"_videoInteractiveLayer"),tt(this,"_posterLayer"),tt(this,"_preprocessSrcFunc"),tt(this,"_preprocessURL"),tt(this,"_kernelStartTimeout",0),tt(this,"_instanceId"),tt(this,"_yodaDom"),tt(this,"_yoda"),tt(this,"_kernelType","unknown"),tt(this,"_outputLogger"),tt(this,"_yodaEnabled",!0),tt(this,"_screenshotId",1),tt(this,"_screenshotQueue",[]),tt(this,"_observer"),tt(this,"_objectFit",""),tt(this,"requestFullscreen",m=>{if(this._logger.i(at,"requestFullscreen"),!!this._mainDom){if(this._yoda){this._yoda.isFullscreen()||this._yoda.fullScreen("portrait");return}this._full.isFull(m)||this._full.requestFull(this._mainDom,m)}}),tt(this,"exitFullscreen",m=>{if(this._logger.i(at,"exitFullscreen"),!!this._mainDom){if(this._yoda){this._yoda.exitFullScreen();return}this._full.isFull(m)&&this._full.exitFull(m)}}),tt(this,"_onFullscreenchange",m=>{this.emit(We.FULLSCREEN_CHANGE,m)}),tt(this,"_onMutedChange",m=>{this._video&&(this._video.muted=m)}),tt(this,"_onVideoLoadstart",()=>{this.emit(We.LOADSTART)}),tt(this,"_onVideoProgress",()=>{this.emit(We.PROGRESS)}),tt(this,"_onVideoSuspend",()=>{this.emit(We.SUSPEND)}),tt(this,"_onVideoAbort",()=>{this.emit(We.ABORT)}),tt(this,"_onVideoEmptied",()=>{this.emit(We.EMPTIED)}),tt(this,"_onVideoStalled",()=>{this.emit(We.STALLED)}),tt(this,"_onVideoLoadedmetadata",()=>{this.emit(We.LOADEDMETADATA)}),tt(this,"_onVideoLoadeddata",()=>{this.emit(We.LOADEDDATA)}),tt(this,"_onVideoCanplay",()=>{this.emit(We.CANPLAY)}),tt(this,"_onVideoCanplaythrough",()=>{this.emit(We.CANPLAYTHROUGH)}),tt(this,"_onVideoPlaying",()=>{hn.os.name!=="iOS"&&hn.os.name!=="Android"&&this._hidePosterDom(),this.emit(We.PLAYING)}),tt(this,"_onVideoWaiting",()=>{this.emit(We.WAITING)}),tt(this,"_onVideoSeeking",()=>{this.emit(We.SEEKING)}),tt(this,"_onVideoSeeked",()=>{this.emit(We.SEEKED),this.kernel&&this._updateIsLiveShift(this.kernel.liveShift)}),tt(this,"_onVideoEnded",()=>{this.emit(We.ENDED)}),tt(this,"_onVideoDurationchange",()=>{this.emit(We.DURATIONCHANGE)}),tt(this,"_onVideoTimeupdate",()=>{var m,A;this._posterLayer.style.display!=="none"&&((m=this._video)==null?void 0:m.readyState)===4&&!((A=this._video)!=null&&A.paused)&&this._hidePosterDom(),this.emit(We.TIMEUPDATE)}),tt(this,"_onVideoPlay",()=>{this.emit(We.PLAY)}),tt(this,"_onVideoPause",()=>{this.emit(We.PAUSE)}),tt(this,"_onVideoRatechange",()=>{this.emit(We.RATECHANGE)}),tt(this,"_onVideoResize",()=>{this.emit(We.RESIZE)}),tt(this,"_onVideoVolumechange",()=>{this.emit(We.VOLUMECHANGE)}),tt(this,"_onVideoEnterpictureinpicture",()=>{this.emit(We.ENTER_PICTURE_IN_PICTURE)}),tt(this,"_onVideoLeavepictureinpicture",()=>{this.emit(We.LEAVE_PICTURE_IN_PICTURE)});var o;if(this._instanceId=V_.next(),this._logger=new un().setLevel(io).setName(Yc).setId(this._instanceId),n!=null&&n.logger&&this._logger.setOutput(n.logger),Ca("kwai-player",Xr.packVersion),this._logger.i(at,Xr.packVersion,Xr.version,this._instanceId,i.toString(),n),this._data=n||{},typeof i=="string"?(this._id=i,this._mainDom=document.querySelector(i)):(this._id=`kp_${Math.random()*1e3|0}`,this._mainDom=i),this._evt=new Qc,this._evt.setMaxListeners(30),this._full=new W_(this._evt,this._logger),this._evt.on("fullChange",this._onFullscreenchange),this._eventHandlers={loadstart:this._onVideoLoadstart,progress:this._onVideoProgress,suspend:this._onVideoSuspend,abort:this._onVideoAbort,emptied:this._onVideoEmptied,stalled:this._onVideoStalled,loadedmetadata:this._onVideoLoadedmetadata,loadeddata:this._onVideoLoadeddata,canplay:this._onVideoCanplay,canplaythrough:this._onVideoCanplaythrough,playing:this._onVideoPlaying,waiting:this._onVideoWaiting,seeking:this._onVideoSeeking,seeked:this._onVideoSeeked,ended:this._onVideoEnded,durationchange:this._onVideoDurationchange,timeupdate:this._onVideoTimeupdate,play:this._onVideoPlay,pause:this._onVideoPause,ratechange:this._onVideoRatechange,resize:this._onVideoResize,volumechange:this._onVideoVolumechange,enterpictureinpicture:this._onVideoEnterpictureinpicture,leavepictureinpicture:this._onVideoLeavepictureinpicture},n&&typeof n.controls<"u"&&(this.controls=n.controls),this._videoLayer=document.createElement("div"),this._videoLayer.className=dn["kwai-player-video"],this._posterLayer=document.createElement("div"),this._posterLayer.className=dn["kwai-player-poster"],this._posterLayer.dataset.kpRole="poster",this._videoLayer.appendChild(this._posterLayer),this._videoInteractiveLayer=document.createElement("div"),this._videoInteractiveLayer.className=dn["kwai-player-video-interactive"],this._video=document.createElement("video"),!this._mainDom){this._logger.i(at,`container not found.${i}`),this._setError({code:$c.CTOR_ERROR,message:`container not found.${i}`});return}this._observer=new MutationObserver(m=>{for(const A of m)A.type==="attributes"&&A.attributeName==="style"&&this._applyObjectFit()});const s={attributes:!0,attributeFilter:["style"]};this._observer.observe(this._mainDom,s),this._applyObjectFit(),this._mainDom.className=this._mainDom.className?`${this._mainDom.className} ${dn["kwai-player"]}`:dn["kwai-player"],this._mainDom.setAttribute("role","player"),this._mainDom.appendChild(this._videoLayer),this._mainDom.appendChild(this._videoInteractiveLayer),this._video.controls=!1,this._videoLayer.appendChild(this.video),Xr._yodaClass&&(this._yodaDom=document.createElement("div"),this._yodaDom.className=dn["kwai-player-yoda"],this._videoLayer.appendChild(this._yodaDom)),this._bindVideo(),this._pluginBase.initialize(n==null?void 0:n.plugins),this._pluginBase.beforeInstallPlugins(this,n==null?void 0:n.plugins),n&&this._parseData(n);const d=((o=this._config)==null?void 0:o.src)||this._src;d&&this._initKernel(!1),this._pluginBase.afterInstallPlugins(this,n==null?void 0:n.plugins),d&&(this._kernelStartTimeout=+setTimeout(()=>{this._clearKernelStartTimer(),this._kernelStart()},0)),this._logger.i(at,"constructor completed.")}static get version(){return"1.1.0"}get version(){return Xr.version}get packVersion(){return Xr.packVersion}get instanceId(){return this._instanceId}get kernelType(){return this._kernelType}get logger(){return this._logger}get outputLogger(){return this._outputLogger}set outputLogger(i){this._logger.i(at,"call set output logger",i),this._outputLogger=i,this._logger.setOutput(i),this._kernel&&(this._kernel.outputLog=i)}get config(){return this._logger.i(at,"call get config",this._config),this._config}set config(i){this._logger.i(at,"call set config",i),this._config=i,this._yoda||(this._initKernel(),this.emit(We.ATTRIBUTE_CHANGE_CONFIG))}get error(){return this._logger.i(at,"call get error",this._error),this._error}get videoId(){var i;return(i=this._data)==null?void 0:i.videoId}set videoId(i){this._data&&(this._data.videoId=i,this.emit(We.ATTRIBUTE_CHANGE_VIDEO_ID))}get previewUrl(){var i;return(i=this._data)==null?void 0:i.previewUrl}set previewUrl(i){this._logger.i(at,"call set previewUrl",i),this._data&&(this._data.previewUrl=i,this.emit(We.ATTRIBUTE_CHANGE_PREVIEW_URL))}get maskUrl(){var i;return(i=this._data)==null?void 0:i.maskUrl}set maskUrl(i){this._logger.i(at,"call set maskUrl",i),this._data&&(this._data.maskUrl=i,this.emit(We.ATTRIBUTE_CHANGE_MASK_URL))}get disableMask(){var i;return(i=this._data)==null?void 0:i.disableMask}set disableMask(i){this._logger.i(at,"call set disableMask",i),this._data&&(this._data.disableMask=i,this.emit(We.ATTRIBUTE_CHANGE_DISABLE_MASK))}get src(){return this._logger.v(at,"call get src",this._src),this._src}set src(i){this._logger.i(at,"call set src",i),this._src=this._preprocessSrcFunc?this._preprocessSrcFunc(i):i,this._destroyKernel(),this.emit(We.ATTRIBUTE_CHANGE_SRC),this._initKernel()}get isLiveShift(){return this._isLiveShift}set liveShiftType(i){this._logger.i(at,"call set liveShiftType",i),this._data&&(this._data.liveShiftType=i,this.emit(We.LIVE_SHIFT_TYPE_CHANGE))}get liveShiftType(){var i;return((i=this._data)==null?void 0:i.liveShiftType)||Kn.NONE}set crossOrigin(i){this._logger.i(at,"call set crossOrigin",i),this._video&&(this._video.crossOrigin=i),this.emit(We.ATTRIBUTE_CHANGE_CROSS_ORIGIN)}get crossOrigin(){var i;return this._logger.v(at,"call get crossOrigin",(i=this._video)==null?void 0:i.crossOrigin),this._video?this._video.crossOrigin:null}get networkState(){var i;return this._logger.v(at,"call get networkState",(i=this._video)==null?void 0:i.networkState),this._video?this._video.networkState:0}get preload(){return this._logger.v(at,"call get preload",this._preload),this._preload}set preload(i){this._logger.i(at,"call set preload",i),this._preload=i,this._video.preload=i,this.emit(We.ATTRIBUTE_CHANGE_PRELOAD)}get buffered(){var i;if(!this._yoda)return(i=this._video)==null?void 0:i.buffered}get readyState(){return this._yoda?this._yoda.readyState:this._video?this._video.readyState:0}get seeking(){var i;return this._yoda?this._yoda.seeking:!!((i=this._video)!=null&&i.seeking)}get currentTime(){return this._yoda?this._yoda.currentTime:this._video?this._video.currentTime:0}set currentTime(i){this._logger.i(at,"call set currentTime",i);try{this._yoda&&(this._yoda.currentTime=i),this._video&&(this._video.currentTime=i),this.emit(We.ATTRIBUTE_CHANGE_CURRENT_TIME)}catch(n){}}get duration(){return this._yoda?this._yoda.duration:this._video?this._video.duration:NaN}get paused(){return this._yoda?this._yoda.paused:this._video?this._video.paused:!0}get defaultPlaybackRate(){var i;return this._logger.v(at,"call get defaultPlaybackRate",(i=this._video)==null?void 0:i.defaultPlaybackRate),this._video?this._video.defaultPlaybackRate:1}set defaultPlaybackRate(i){this._logger.i(at,"call set defaultPlaybackRate",i),this._yoda&&(this._yoda.defaultPlaybackRate=i),this._video&&(this._video.defaultPlaybackRate=i),this.emit(We.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE)}get playbackRate(){return this._video?this._video.playbackRate:1}set playbackRate(i){this._logger.i(at,"call set playbackRate",i),this._yoda&&(this._yoda.playbackRate=i),this._video&&(this._video.playbackRate=i),this.emit(We.ATTRIBUTE_CHANGE_PLAYBACK_RATE)}get played(){var i;if(!this._yoda)return(i=this._video)==null?void 0:i.played}get seekable(){var i;if(!this._yoda)return(i=this._video)==null?void 0:i.seekable}get ended(){return this._yoda?this._yoda.ended:this._video?this._video.ended:!1}get autoplay(){return this._autoplay}set autoplay(i){this._logger.i(at,"call set autoplay",i),this._autoplay=i,this._yoda&&(this._yoda.autoplay=i),this.emit(We.ATTRIBUTE_CHANGE_AUTOPLAY)}get loop(){return this._yoda?this._yoda.loop:this._video?this._video.loop:!1}set loop(i){this._logger.i(at,"call set loop",i),this._video&&(this._video.loop=i),this.emit(We.ATTRIBUTE_CHANGE_LOOP)}get controls(){return this._controls}set controls(i){this._logger.i(at,"call set controls",i),i!==this._controls&&(this._controls=i),this.emit(We.ATTRIBUTE_CHANGE_CONTROLS)}get volume(){return this._yoda?1:this._video?this._video.volume:1}set volume(i){this._video&&(this._video.volume=i<0?0:i>1?1:i,this.emit(We.ATTRIBUTE_CHANGE_VOLUME))}get muted(){return this._yoda?this._yoda.muted:this._video?this._video.muted:!1}set muted(i){this._logger.i(at,`call set muted: ${i}, hasVideo: ${!!this._video}`),this._yoda&&(this._yoda.muted=i),this._video&&(this._video.muted=i),this.emit(We.ATTRIBUTE_CHANGE_MUTED)}get defaultMuted(){return this._yoda?this._yoda.defaultMuted:this._video?this._video.defaultMuted:!1}set defaultMuted(i){this._logger.i(at,"call set defaultMuted",i),this._yoda&&(this._yoda.defaultMuted=i),this._video&&(this._video.defaultMuted=i),this.emit(We.ATTRIBUTE_CHANGE_DEFAULT_MUTED)}get videoWidth(){var i;return this._videoWidth||((i=this._video)==null?void 0:i.videoWidth)}get videoHeight(){var i;return this._videoHeight||((i=this._video)==null?void 0:i.videoHeight)}get poster(){return this._poster}set poster(i){this._logger.i(at,"call set poster",i),this._poster=i,this._updatePosterDom(),this.emit(We.ATTRIBUTE_CHANGE_POSTER)}get disablePictureInPicture(){var i;return this._yoda?!0:!!((i=this._video)!=null&&i.disablePictureInPicture)}set disablePictureInPicture(i){this._logger.i(at,"call set disablePictureInPicture",i),!this._yoda&&this._video&&(this._video.disablePictureInPicture=i,this.emit(We.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE))}get disableDownload(){var i;return(i=this._data)==null?void 0:i.disableDownload}set disableDownload(i){this._logger.i(at,"call set disableDownload",i),this._data&&(this._data.disableDownload=i,this.emit(We.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD))}get playsinline(){var i;return!!((i=this._video)!=null&&i.hasAttribute("playsinline"))}set playsinline(i){this._logger.i(at,"call set playsinline",i),this._video&&(this._video.playsInline=i,this._video.webKitPlaysInline=i,i?(this._video.setAttribute("playsinline","playsinline"),this._video.setAttribute("webkit-playsinline","webkit-playsinline"),this._video.setAttribute("x5-playsinline","x5-playsinline")):(this._video.removeAttribute("playsinline"),this._video.removeAttribute("webkit-playsinline"),this._video.removeAttribute("x5-playsinline")),this.emit(We.ATTRIBUTE_CHANGE_PLAYSINLINE))}get disableAdaptive(){var i;return(i=this._data)==null?void 0:i.disableAdaptive}set disableAdaptive(i){this._logger.i(at,"call set disableAdaptive",i),this._data&&(this._data.disableAdaptive=i,this.emit(We.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE))}get currentLevel(){var i;return((i=this._kernel)==null?void 0:i.currentLevel)||0}set currentLevel(i){var n,o,s;if(this._logger.i(at,"call set currentLevel",i,!!this._kernel,this._livePaused),this._kernel){const d=this._video.paused;this._livePaused?((n=this._kernel)==null||n.refresh(),this._kernel.currentLevel=i):(this._kernel.currentLevel=i,this.emit(We.ATTRIBUTE_CHANGE_CURRENT_LEVEL)),!d&&this._video.paused&&(this._logger.i(at,"set level. play"),(s=(o=this._video)==null?void 0:o.play())==null||s.catch(m=>this._logger.i(at,"set current level, call play() fail.",m)))}}get nextLevel(){var i;return((i=this._kernel)==null?void 0:i.nextLevel)||0}set nextLevel(i){var n,o,s;if(this._logger.i(at,"call set nextLevel",i),this._kernel){const d=this._video.paused;this._livePaused?((n=this._kernel)==null||n.refresh(),this._kernel.currentLevel=i):(this._kernel.nextLevel=i,this.emit(We.ATTRIBUTE_CHANGE_NEXT_LEVEL)),!d&&this._video.paused&&(this._logger.i(at,"set next level. play"),(s=(o=this._video)==null?void 0:o.play())==null||s.catch(m=>this._logger.i(at,"set next level, call play() fail.",m)))}}get currentVideoFrame(){var i;return((i=this._kernel)==null?void 0:i.currentVideoFrame)||0}set currentVideoFrame(i){this._kernel&&(this._kernel.currentVideoFrame=i,this.emit(We.ATTRIBUTE_CHANGE_CURRENT_FRAME))}get totalVideoFrames(){var i;return((i=this._kernel)==null?void 0:i.totalVideoFrames)||0}get currentLevelTimeInfo(){var i;return(i=this._kernel)==null?void 0:i.currentLevelTimeInfo}get video(){return this._video}get canvas(){return this._canvas}get yodaDom(){return this._yodaDom}get audioTrack(){return this._kernel?this._kernel.audioTrack:-1}set audioTrack(i){this._logger.i(at,"call set audioTrack",i),this._kernel&&(this._kernel.audioTrack=i,this.emit(We.ATTRIBUTE_CHANGE_AUDIO_TRACK))}get productName(){var i;return(i=this._data)==null?void 0:i.productName}set productName(i){this._logger.i(at,"call set productName",i),this._data&&(this._data.productName=i)}get prefetch(){var i;return(i=this._data)==null?void 0:i.prefetch}set prefetch(i){this._logger.i(at,"call set prefetch",i),this._data&&(this._data.prefetch=i,this.emit(We.ATTRIBUTE_CHANGE_PREFETCH))}get showProgress(){var i;return(i=this._data)==null?void 0:i.showProgress}set showProgress(i){this._logger.i(at,"call set showProgress",i),this._data&&(this._data.showProgress=i,this.emit(We.ATTRIBUTE_CHANGE_SHOW_PROGRESS))}get showTime(){var i;return(i=this._data)==null?void 0:i.showTime}set showTime(i){this._logger.i(at,"call set showTime",i),this._data&&(this._data.showTime=i,this.emit(We.ATTRIBUTE_CHANGE_SHOW_TIME))}get disableHotkey(){var i;return(i=this._data)==null?void 0:i.disableHotkey}set disableHotkey(i){this._logger.i(at,"call set disableHotkey",i),this._data&&(this._data.disableHotkey=i,this.emit(We.ATTRIBUTE_CHANGE_DISABLE_HOTKEY))}get disableDanmaku(){var i;return(i=this._data)==null?void 0:i.disableDanmaku}set disableDanmaku(i){this._logger.i(at,"call set disableDanmaku",i),this._data&&(this._data.disableDanmaku=i,this.emit(We.ATTRIBUTE_CHANGE_DISABLE_DANMAKU))}get danmakuRendering(){var i;return(i=this._data)==null?void 0:i.danmakuRendering}set danmakuRendering(i){this._logger.i(at,"call set danmakuRendering",i),this._data&&(this._data.danmakuRendering=i,this.emit(We.ATTRIBUTE_CHANGE_DANMAKU_RENDERING))}get showInfoPanel(){var i;return(i=this._data)==null?void 0:i.showInfoPanel}set showInfoPanel(i){this._logger.i(at,"call set showInfoPanel",i),this._data&&(this._data.showInfoPanel=i,this.emit(We.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL))}get showNext(){var i;return(i=this._data)==null?void 0:i.showNext}set showNext(i){this._logger.i(at,"call set showNext",i),this._data&&(this._data.showNext=i,this.emit(We.ATTRIBUTE_CHANGE_SHOW_NEXT))}get showPrev(){var i;return(i=this._data)==null?void 0:i.showPrev}set showPrev(i){this._logger.i(at,"call set showPrev",i),this._data&&(this._data.showPrev=i,this.emit(We.ATTRIBUTE_CHANGE_SHOW_PREV))}get bizData(){var i;return(i=this._data)==null?void 0:i.bizData}set bizData(i){this._logger.i(at,"set biz data",i),this._data&&(this._data.bizData=i),this._yoda&&this._yoda.updateUserConfig({biz:JSON.parse(JSON.stringify(i))}),this.emit(We.ATTRIBUTE_CHANGE_BIZ_DATA)}get liveTime(){var i;return(i=this._data)!=null&&i.liveTime?{start:this._data.liveTime.start,end:this._data.liveTime.end}:void 0}set liveTime(i){this._logger.i(at,"set live time",i),this._data&&(this._data.liveTime=Object.assign({},i)),this.emit(We.ATTRIBUTE_CHANGE_LIVE_TIME)}get objectFit(){return this._objectFit}get kernel(){return this._kernel}setPreprocessURL(i){this._preprocessURL=i}setPreprocessSrcFunc(i){this._preprocessSrcFunc=i}load(){var i;this._logger.i(at,"call load"),(i=this._kernel)==null||i.load(),this._kernelLoaded=!0}play(){var i,n,o,s,d;return this._logger.i(at,"call play",this._kernelLoaded,this._livePaused),this._yoda?((n=(i=this._video)==null?void 0:i.play())==null||n.catch(m=>this._logger.i(at,"play, call play() fail.",m)),this._yoda.play()):(this._livePaused&&!this._isLiveShiftMode()?(o=this._kernel)==null||o.refresh():this._kernelLoaded||this.load(),this._video.paused?(d=(s=this._video)==null?void 0:s.play())==null?void 0:d.catch(m=>this._logger.i(at,"play, call play() fail.",m)):Promise.resolve())}pause(){var i,n,o;if(this._logger.i(at,"call pause",(i=this._mediaInfo)==null?void 0:i.isLive),this._yoda){this._yoda.pause();return}return this._kernel&&(n=this._mediaInfo)!=null&&n.isLive&&!this._isLiveShiftMode()&&(this._logger.i(at,"live stop load"),this._kernel.stopLoad(),this._livePaused=!0),this._isLiveShiftMode()&&!this._isLiveShift&&this._updateIsLiveShift(!0),(o=this._video)==null?void 0:o.pause()}requestPictureInPicture(){return this._logger.i(at,"call requestPictureInPicture"),this._yoda?Promise.reject("not support requestPictureInPicture. yoda"):this._video&&"requestPictureInPicture"in this._video?this._video.requestPictureInPicture():Promise.reject("not support requestPictureInPicture")}isPictureInPictureAvailable(){return this._yoda?!1:K_()}destroy(){var i,n,o;this._logger.i(at,"call destroy"),(i=this._observer)==null||i.disconnect(),this._observer=void 0,this._clearKernelStartTimer(),this._preprocessSrcFunc=void 0,this._screenshotQueue=[],this._pluginBase.beforeUninstallPlugins(this),this._evt.removeAllListeners(),this._destroyKernel(),this._unbindVideo(),this._destroyYoda(),(n=this._videoLayer.parentElement)==null||n.removeChild(this._videoLayer),(o=this._videoLayer.parentElement)==null||o.removeChild(this._videoInteractiveLayer),this.removeAllListeners(),this._pluginBase.afterUninstallPlugins(this)}refresh(){var i;this._logger.i(at,"call refresh"),(i=this._kernel)==null||i.refresh()}jumpToLive(){var i,n;this._logger.i(at,`call jumpToLive type: ${(i=this._data)==null?void 0:i.liveShiftType}`),this.kernel&&(n=this._data)!=null&&n.liveShiftType&&this._isLiveShiftMode()&&(this.video.currentTime=this.video.duration-this.kernel.liveShiftDelaySec,this.kernel&&this._updateIsLiveShift(!0))}getStreamTime(i){var n;return this._yoda?0:((n=this._kernel)==null?void 0:n.getStreamTime(i))||0}static register(i,n="append"){ao.register(i,n)}static deregister(i){ao.deregister(i)}static setYoda(i){Xr._yodaClass=i}getPluginInstance(i){return this._pluginBase.getPlugin(i)}getAllPlugins(){return this._pluginBase.getAllPlugins()}createSubContainer(i=Ra.DEFAULT){const n=document.createElement("div");n.id=`${this._id}-sub-${Math.round(this._subContainerNumber++)}`;let o=this._mainDom;if(i===Ra.VIDEO&&(o=this._videoLayer),i===Ra.VIDEO_INTERACTIVE&&(o=this._videoInteractiveLayer),o)o.children.length?o.children[o.children.length-1].insertAdjacentElement("afterend",n):o.appendChild(n);else throw new Error("cteate sub container error. no parent found.");return n}isFullscreen(i){return this._yoda?this._yoda.isFullscreen():this._full.isFull(i)}isFullscreenAvailable(i){return this._yoda?!0:this._full.isFullscreenAvailable(i)}_applyObjectFit(){var i;const n=((i=this._mainDom)==null?void 0:i.style.objectFit)||"";this._logger.i(at,`apply objectFit: ${n}`),this._video.style.objectFit=n,this._canvas&&(this._canvas.style.objectFit=n),this._yoda&&(this._yoda.objectFit=n||"contain"),this._objectFit=n,this.emit(We.OBJECT_FIT_CHANGE)}removeSubContainer(i){i.parentElement&&i.parentElement.removeChild(i)}screenshot(){const i=this._kernel;return this._yoda?(this._logger.i(at,"screenshot yoda"),this._yoda.screenshot()):i?(this._screenshotId++,new Promise(n=>{const o=this._screenshotId.toString();this._screenshotQueue.push({id:o,timer:setTimeout(()=>{this._logger.i(at,`screenshot[${o}] timeout.`),this._resolveScreenShotFromQueue(o)},500),callback:n}),i.screenshot({id:o}),this._logger.i(at,`screenshot[${o}] kernel`)})):(this._logger.i(at,"screenshot player not ready."),Promise.resolve())}_resolveScreenShotFromQueue(i,n){for(let o=0;o<this._screenshotQueue.length;o++)if(i===this._screenshotQueue[o].id){clearTimeout(this._screenshotQueue[o].timer),this._screenshotQueue[o].callback(n),this._screenshotQueue.splice(o,1);return}this._logger.i(at,`screenshot[${i}] not found.`)}get mainContainer(){return this._mainDom}get videoLayer(){return this._videoLayer}get videoInteractiveLayer(){return this._videoInteractiveLayer}get audienceStat(){var i;return(i=this._kernel)==null?void 0:i.getAudienceStat()}_updatePosterDom(){ua?(this._video.poster=this._poster||"",this._hidePosterDom()):this._poster?(this._video.poster=nA,this._posterLayer.className=dn["kwai-player-poster"],this._posterLayer.style.backgroundImage=`url(${this._poster})`):(this._video.poster="",this._posterLayer.className="",this._posterLayer.style.backgroundImage="")}_hidePosterDom(){this._posterLayer.style.display="none"}_setIsUseCanvas(i){this._video&&(this._video.style.display=i?"none":"block")}_setError(i){this._error=i,this._error&&setTimeout(()=>{try{this.emit(We.ERROR,this._error)}catch(n){}},0)}_resetPlayerStat(){if(this._canvas){try{this._videoLayer.removeChild(this._canvas)}catch(i){}this._canvas=void 0}this._setError(void 0),this._setIsUseCanvas(!1),this._mediaInfo=void 0,this._isLiveShift=!1}_destroyKernel(){this._kernel&&(this._kernelLoaded=!1,this._livePaused=!1,this.pause(),this._kernel.destroy(),this._kernel=void 0)}_destroyYoda(){this._yoda&&(this._yoda.destroy(),this._yoda=void 0)}_initYodaKernel(i){if(this._logger.i(at,"yoda init"),!Xr._yodaClass||!this._yodaDom||!this._src)return!1;const n=z_.parse(this._src);return n&&n.src?(this._yoda||(this._logger.i(at,"yoda new instance."),this._yoda=new Xr._yodaClass(this._yodaDom,this._logger,i),this._bindYoda(this._yoda),this._kernelType="yoda"),this._logger.i(at,"yoda instance already exists. try update conf"),n.isLive?this._yoda.src={isLive:n.isLive,src:n.src}:this._yoda.src={isLive:n.isLive,src:n.src},this.emit(We.ATTRIBUTE_CHANGE_MUTED),!0):!1}_bindYoda(i){this._logger.i(at,"yoda bind event."),i.on("play",this._onVideoPlay),i.on("playing",this._onVideoPlaying),i.on("pause",this._onVideoPause),i.on("loadedmetadata",()=>{this._onVideoLoadedmetadata(),this._onVideoDurationchange()}),i.on("timeupdate",this._onVideoTimeupdate),i.on("ended",this._onVideoEnded),i.on("waiting",this._onVideoWaiting),i.on("seeked",this._onVideoSeeked),i.on("seeking",this._onVideoSeeking),i.on("resize",n=>{this._videoWidth=n.data.width,this._videoHeight=n.data.height,this._onVideoResize()}),i.on("error",n=>{if(n.data.type==="initFailed"||n.data.type==="canNotInsert"||n.data.type==="internal"||n.data.type==="domLost"){const o=i.actionOnReady==="play";this._destroyYoda(),this._yodaEnabled=!1,this._initKernel(),o&&this.play();return}this._setError(Object.assign({code:0},n.data.originalError))})}_bindVideo(){if(this._video)for(const i in this._eventHandlers)this._video.addEventListener(i,this._eventHandlers[i])}_unbindVideo(){if(this._video)for(const i in this._eventHandlers)this._video.removeEventListener(i,this._eventHandlers[i])}_parseData(i){this._logger.i(at,"parse data.",i),i.src&&(this._src=this._preprocessSrcFunc?this._preprocessSrcFunc(i.src):i.src),i.config&&(this._config=i.config),i.crossOrigin&&(this.crossOrigin=i.crossOrigin),typeof i.preload<"u"&&(this.preload=i.preload),typeof i.defaultPlaybackRate=="number"&&(this.defaultPlaybackRate=i.defaultPlaybackRate),typeof i.playbackRate=="number"&&(this.playbackRate=i.playbackRate),typeof i.autoplay<"u"&&(this.autoplay=i.autoplay),typeof i.loop<"u"&&(this.loop=i.loop),typeof i.controls<"u"&&(this.controls=i.controls),typeof i.volume=="number"&&(this.volume=i.volume),typeof i.muted<"u"&&(this.muted=i.muted),typeof i.defaultMuted<"u"&&(this.defaultMuted=i.defaultMuted),typeof i.disablePictureInPicture<"u"&&(this.disablePictureInPicture=i.disablePictureInPicture),typeof i.disableAdaptive<"u"&&(this.disableAdaptive=i.disableAdaptive),typeof i.playsinline<"u"&&(this.playsinline=i.playsinline),typeof i.liveShiftType<"u"&&(this.liveShiftType=i.liveShiftType),typeof i.logger<"u"&&(this._outputLogger=i.logger),this.poster=i.poster||""}_initKernel(i=!0){var n,o,s,d,m;if(this._logger.i(at,"init kernel"),!this._video)return;if(this._posterLayer.style.display=ua?"none":"block",this._destroyKernel(),!this._src&&!((n=this._config)!=null&&n.src)){this._video.src="",this._resetPlayerStat();return}this._config||(this._config={});const A=Object.assign({},this._config,{adaptive:((o=this._data)==null?void 0:o.disableAdaptive)===!1,liveShiftType:(s=this._data)==null?void 0:s.liveShiftType,ntp:!1});if(ha.verify(this._src)?(this._logger.i(at,"live feed to media desc"),A.src=ha.parse(this._src)):A.src=this._src,this._preprocessURL&&(A.preprocessUrl=this._preprocessURL),typeof A.nativeFirst>"u"&&ua&&(A.nativeFirst=!0),this._isLiveShiftMode()&&(A.catchUpPausedLive=!1),(d=this._data)!=null&&d.logger&&(A.logger=this._data.logger),this._resetPlayerStat(),this._logger.i(at,`yoda check mobile: ${ua} liveshift: ${this.liveShiftType} class: ${!!Xr._yodaClass}`),ua&&this._yodaEnabled&&this.liveShiftType===Kn.NONE&&Xr._yodaClass){const C={defaultMuted:this.defaultMuted,muted:this.muted,defaultPlaybackRate:this.defaultPlaybackRate,playbackRate:this.playbackRate,autoplay:this._autoplay,loop:this.loop,objectFit:this._objectFit||"contain",biz:(m=this._data)==null?void 0:m.bizData};if(this._initYodaKernel(C)){i&&this._clearKernelStartTimer();return}}else this._destroyYoda();this._kernelType="kwai-player-kernel",this._logger.i(at,"init kernel",this._kernelType);const T=this._kernel=new B_(this._video,A);T.on(vr.VIDEO_RENDERER_CHANGE,C=>{const h=this._videoLayer;if(C.type==="canvas"&&(this._setIsUseCanvas(!0),this._canvas=C.canvas,this._canvas&&h.insertAdjacentElement("afterbegin",this._canvas)),C.type==="video"){this._setIsUseCanvas(!1);try{this._canvas&&h.removeChild(this._canvas)}catch(F){}this._canvas=void 0}this._applyObjectFit(),this.emit(We.VIDEO_RENDERER_CHANGE,C)}),T.on(vr.MANIFEST_PARSED,C=>{this._logger.i(at,vr.MANIFEST_PARSED,C),this.emit(We.MANIFEST_PARSED,C)}),T.on(vr.LEVEL_SWITCHING,C=>{this.emit(We.LEVEL_SWITCHING,C)}),T.on(vr.LEVEL_SWITCHED,C=>{this.emit(We.LEVEL_SWITCHED,C)}),T.on(vr.LEVEL_SWITCH_PLAYING,C=>{this.emit(We.LEVEL_SWITCH_PLAYING,C)}),T.on(vr.LEVEL_SWITCH_FAILED,()=>{this.emit(We.LEVEL_SWITCH_FAILED)}),T.on(vr.LEVEL_UPDATED,C=>{this.emit(We.LEVEL_UPDATED,C)}),T.on(vr.AUDIO_TRACK_SWITCHING,C=>{this.emit(We.AUDIO_TRACKS_SWITCHING,C)}),T.on(vr.AUDIO_TRACK_SWITCHED,C=>{this.emit(We.AUDIO_TRACKS_SWITCHED,C)}),T.on(vr.ERROR,C=>{this._setError({code:C.code,message:C.reason})}),T.on(vr.REPORT,C=>{C.type==="mediaInfo"&&(this._videoWidth=C.value.width||0,this._videoHeight=C.value.height||0,this._mediaInfo=C.value,this._data&&C.value.liveShiftType&&(this.liveShiftType=C.value.liveShiftType)),this.emit(We.REPORT,C)}),T.on(vr.SCREENSHOT,C=>{this._logger.i(at,`screenshot[${C.id}] kernel evt. id: ${C.id} img: ${!!C.image}`),C.id&&this._resolveScreenShotFromQueue(C.id,C.image)}),i&&(this._clearKernelStartTimer(),this._kernelStart())}_clearKernelStartTimer(){this._kernelStartTimeout&&(clearTimeout(this._kernelStartTimeout),this._kernelStartTimeout=0)}_kernelStart(){if(!(!this._kernel||!this._video)&&(this._autoplay||this._preload===""||this._preload==="auto"||this._preload==="metadata")&&(this._kernel.load(),this._kernelLoaded=!0,this.autoplay)){const i=this._video.play();i instanceof Promise&&i.catch(()=>{var n;this._logger.i(at,"autoplay fail, retry."),this._onMutedChange(!0),(n=this._video)==null||n.play().catch(()=>{})})}}_updateIsLiveShift(i){i!==this._isLiveShift&&(this._isLiveShift=i,this.emit(We.LIVE_SHIFT_CHANGE))}_isLiveShiftMode(){var i;return!!((i=this._data)!=null&&i.liveShiftType)&&this._data.liveShiftType!==Kn.NONE}on(i,n){this._evt.on(i,n)}once(i,n){this._evt.once(i,n)}removeAllListeners(i){this._logger.i(at,"call removeAllListeners"),this._evt.removeAllListeners(i)}off(i,n){this._evt.off(i,n)}listeners(i){return this._evt.listeners(i)}emit(i,n){return this._evt.emit(i,n)}listenerCount(i){return this._evt.listenerCount(i)}};tt(so,"packVersion","1.1.0"),tt(so,"_yodaClass");let sr=so;const aA=["id"],Ft="vue3",os=ft.defineComponent({__name:"Player",props:{id:{default:""},config:{default:void 0},plugins:{default:void 0},src:{default:""},controls:{type:[Boolean,String],default:!0},videoId:{default:""},autoplay:{type:Boolean,default:!1},crossOrigin:{default:null},defaultMuted:{type:Boolean,default:!1},defaultPlaybackRate:{default:1},loop:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},preload:{default:void 0},poster:{default:""},currentTime:{},playbackRate:{default:1},volume:{default:1},disablePictureInPicture:{type:Boolean,default:!1},playsinline:{type:Boolean,default:!1},disableDownload:{type:Boolean,default:!0},disableAdaptive:{type:Boolean,default:!0},disableHotkey:{type:Boolean,default:!1},disableMask:{type:Boolean,default:!1},currentLevel:{default:0},nextLevel:{default:0},audioTrack:{default:0},currentVideoFrame:{default:0},showProgress:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},prefetch:{type:Boolean,default:!0},showInfoPanel:{type:Boolean,default:!1},productName:{default:""},previewUrl:{default:""},maskUrl:{default:""},disableDanmaku:{type:Boolean},danmakuRendering:{type:Boolean,default:!0},bizData:{},liveShiftType:{}},setup(r,{expose:i,emit:n}){const o=[We.LOADSTART,We.PROGRESS,We.SUSPEND,We.ABORT,We.ERROR,We.EMPTIED,We.STALLED,We.LOADEDMETADATA,We.LOADEDDATA,We.CANPLAY,We.CANPLAYTHROUGH,We.PLAYING,We.WAITING,We.SEEKING,We.SEEKED,We.ENDED,We.DURATIONCHANGE,We.TIMEUPDATE,We.PLAY,We.PAUSE,We.RATECHANGE,We.RESIZE,We.VOLUMECHANGE,We.MANIFEST_PARSED,We.LEVEL_SWITCHING,We.LEVEL_SWITCHED,We.LEVEL_SWITCH_PLAYING,We.LEVEL_SWITCH_FAILED,We.AUDIO_TRACKS_SWITCHING,We.AUDIO_TRACKS_SWITCHED,We.FULLSCREEN_CHANGE,We.LEVEL_UPDATED,We.CLICK_NEXT,We.CLICK_REGISTER,We.CLICK_LOGIN,We.CLICK_VIP,We.INTERACTION,We.ATTRIBUTE_CHANGE,We.REPORT],s=n,d=r,m=ft.ref(x_());let A,T;return ft.watch(()=>d.config,C=>{A&&(T==null||T.i(Ft,"call set config",C),A.config=C)}),ft.watch(()=>d.controls,C=>{A&&(A.logger.i(Ft,"call set controls",C),A.controls=C)}),ft.watch(()=>d.videoId,C=>{A&&(A.logger.i(Ft,"call set videoId",C),A.videoId=C)}),ft.watch(()=>d.src,C=>{A&&(A.logger.i(Ft,"call set src",C),A.src=C||"")}),ft.watch(()=>d.autoplay,C=>{A&&(A.logger.i(Ft,"call set autoplay",C),A.autoplay=!!C)}),ft.watch(()=>d.crossOrigin,C=>{A&&(A.logger.i(Ft,"call set crossorigin",C),A.crossOrigin=C||null)}),ft.watch(()=>d.defaultMuted,C=>{A&&(A.logger.i(Ft,"call set defaultMuted",C),A.defaultMuted=!!C)}),ft.watch(()=>d.defaultPlaybackRate,C=>{A&&(A.logger.i(Ft,"call set defaultPlaybackRate",C),A.defaultPlaybackRate=C||1)}),ft.watch(()=>d.loop,C=>{A&&(A.logger.i(Ft,"call set loop",C),A.loop=!!C)}),ft.watch(()=>d.muted,C=>{A&&(A.logger.i(Ft,"call set muted",C),A.muted=!!C)}),ft.watch(()=>d.preload,C=>{A&&(A.logger.i(Ft,"call set preload",C),A.preload=C||"none")}),ft.watch(()=>d.poster,C=>{A&&(A.logger.i(Ft,"call set poster",C),A.poster=C||"")}),ft.watch(()=>d.currentTime,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set currentTime",C),A.currentTime=C)}),ft.watch(()=>d.playbackRate,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set playbackRate",C),A.playbackRate=C)}),ft.watch(()=>d.volume,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set volume",C),A.volume=C)}),ft.watch(()=>d.disablePictureInPicture,C=>{A&&(A.logger.i(Ft,"call set disablePictureInPicture",C),A.disablePictureInPicture=!!C)}),ft.watch(()=>d.playsinline,C=>{A&&(A.logger.i(Ft,"call set playsinline",C),A.playsinline=!!C)}),ft.watch(()=>d.disableDownload,C=>{A&&(A.logger.i(Ft,"call set disableDownload",C),A.disableDownload=!!C)}),ft.watch(()=>d.disableAdaptive,C=>{A&&(A.logger.i(Ft,"call set disableAdaptive",C),A.disableAdaptive=C||!0)}),ft.watch(()=>d.disableHotkey,C=>{A&&(A.logger.i(Ft,"call set disableHotkey",C),A.disableHotkey=!!C)}),ft.watch(()=>d.disableMask,C=>{A&&(A.logger.i(Ft,"call set disableMask",C),A.disableMask=!!C)}),ft.watch(()=>d.currentLevel,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set currentLevel",C),A.currentLevel=C)}),ft.watch(()=>d.nextLevel,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set nextLevel",C),A.nextLevel=C)}),ft.watch(()=>d.audioTrack,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set audioTrack",C),A.audioTrack=C)}),ft.watch(()=>d.currentVideoFrame,C=>{A&&typeof C=="number"&&(A.logger.i(Ft,"call set currentVideoFrame",C),A.currentVideoFrame=C)}),ft.watch(()=>d.showProgress,C=>{A&&(A.logger.i(Ft,"call set showProgress",C),A.showProgress=C||!0)}),ft.watch(()=>d.showTime,C=>{A&&(A.logger.i(Ft,"call set showTime",C),A.showTime=C||!0)}),ft.watch(()=>d.prefetch,C=>{A&&(A.logger.i(Ft,"call set prefetch",C),A.prefetch=C)}),ft.watch(()=>d.showInfoPanel,C=>{A&&(A.logger.i(Ft,"call set showInfoPanel",C),A.showInfoPanel=C)}),ft.watch(()=>d.previewUrl,C=>{A&&(A.logger.i(Ft,"call set previewUrl",C),A.previewUrl=C)}),ft.watch(()=>d.maskUrl,C=>{A&&(A.logger.i(Ft,"call set maskUrl",C),A.maskUrl=C)}),ft.watch(()=>d.disableDanmaku,C=>{A&&(A.logger.i(Ft,"call set disableDanmaku",C),A.disableDanmaku=!!C)}),ft.watch(()=>d.danmakuRendering,C=>{A&&(A.logger.i(Ft,"call set danmakuRendering",C),A.danmakuRendering=!!C)}),ft.watch(()=>d.bizData,C=>{A&&(A.logger.i(Ft,"call set bizData",C),A.bizData=C)},{deep:!0}),ft.watch(()=>d.liveShiftType,C=>{A&&(A.logger.i(Ft,"call set liveShiftType",C),A.liveShiftType=C||Kn.NONE)}),i({load:()=>A==null?void 0:A.load(),play:()=>A==null?void 0:A.play(),pause:()=>A==null?void 0:A.pause(),destroy:()=>A==null?void 0:A.destroy(),requestPictureInPicture:()=>A==null?void 0:A.requestPictureInPicture(),isFullscreen:C=>A==null?void 0:A.isFullscreen(C),requestFullscreen:C=>A==null?void 0:A.requestFullscreen(C),exitFullscreen:C=>A==null?void 0:A.exitFullscreen(C),isFullscreenAvailable:C=>A==null?void 0:A.isFullscreenAvailable(C),screenshot:()=>A==null?void 0:A.screenshot(),getError:()=>A==null?void 0:A.error,getNetworkState:()=>A?A.networkState:0,getBuffered:()=>A==null?void 0:A.buffered,getSeeking:()=>A?A.seeking:!1,getReadyState:()=>A?A.readyState:0,getDuration:()=>A?A.duration:NaN,getPaused:()=>A?A.paused:!0,getSeekable:()=>A==null?void 0:A.seekable,getEnded:()=>A?A.ended:!1,getVideoWidth:()=>A?A.videoWidth:0,getVideoHeight:()=>A?A.videoHeight:0,getTotalVideoFrames:()=>A?A.totalVideoFrames:0,setSrc:C=>{A&&(A.src=C)},getSrc:()=>A==null?void 0:A.src,setConfig:C=>{A&&(A.config=C)},getConfig:()=>A?A.config:d.config,setCrossOrigin:C=>{A&&(A.crossOrigin=C)},getCrossOrigin:()=>A?A.crossOrigin:d.crossOrigin,setPreload:C=>{A&&(A.preload=C)},getPreload:()=>A?A.preload:d.preload||"",setCurrentTime:C=>{A&&(A.currentTime=C)},getCurrentTime:()=>A?A.currentTime:0,setDefaultPlaybackRate:C=>{A&&(A.defaultPlaybackRate=C)},getDefaultPlaybackRate:()=>A?A.defaultPlaybackRate:d.defaultPlaybackRate,setPlaybackRate:C=>{A&&(A.playbackRate=C)},getPlaybackRate:()=>A?A.playbackRate:d.playbackRate,setAutoplay:C=>{A&&(A.autoplay=C)},getAutoplay:()=>A?A.autoplay:d.autoplay,setLoop:C=>{A&&(A.loop=C)},getLoop:()=>A?A.loop:d.loop,setControls:C=>{A&&(A.controls=C)},getControls:()=>A?A.controls:d.controls,setVideoId:C=>{A&&(A.videoId=C)},getVideoId:()=>A?A.videoId:d.videoId,setVolume:C=>{A&&(A.volume=C)},getVolume:()=>A?A.volume:1,setMuted:C=>{A&&(A.muted=C)},getMuted:()=>A?A.muted:d.muted,setDefaultMuted:C=>{A&&(A.defaultMuted=C)},getDefaultMuted:()=>A?A.defaultMuted:d.defaultMuted,setPoster:C=>{A&&(A.poster=C)},getPoster:()=>A?A.poster:d.poster,setDisablePictureInPicture:C=>{A&&(A.disablePictureInPicture=C)},getDisablePictureInPicture:()=>A?A.disablePictureInPicture:d.disablePictureInPicture,setPlaysinline:C=>{A&&(A.playsinline=C)},getPlaysinline:()=>A?A.playsinline:d.playsinline,setDisableDownload:C=>{A&&(A.disableDownload=C)},getDisableDownload:()=>A?A.disableDownload:d.disableDownload,setDisableAdaptive:C=>{A&&(A.disableAdaptive=C)},getDisableAdaptive:()=>A?A.disableAdaptive:d.disableAdaptive,setDisableHotkey:C=>{A&&(A.disableHotkey=C)},getDisableHotkey:()=>A?A.disableHotkey:d.disableHotkey,setDisableMask:C=>{A&&(A.disableMask=C)},getDisableMask:()=>A?A.disableMask:d.disableMask,setCurrentLevel:C=>{A&&(A.currentLevel=C)},getCurrentLevel:()=>A?A.currentLevel:0,setNextLevel:C=>{A&&(A.nextLevel=C)},getNextLevel:()=>A?A.nextLevel:0,setAudioTrack:C=>{A&&(A.audioTrack=C)},getAudioTrack:()=>A?A.audioTrack:-1,setCurrentVideoFrame:C=>{A&&(A.currentVideoFrame=C)},getCurrentVideoFrame:()=>(A==null?void 0:A.currentVideoFrame)||0,setShowProgress:C=>{A&&(A.showProgress=C)},getShowProgress:()=>A?A.showProgress:d.showProgress,setShowTime:C=>{A&&(A.showTime=C)},getShowTime:()=>A==null?void 0:A.showTime,setPrefetch:C=>{A&&(A.prefetch=C)},getPrefetch:()=>A==null?void 0:A.prefetch,setShowInfoPanel:C=>{A&&(A.showInfoPanel=C)},getShowInfoPanel:()=>A?A.showInfoPanel:d.showInfoPanel,setProductName:C=>{A&&(A.productName=C)},getProductName:()=>A?A.productName:d.productName,setPreviewUrl:C=>{A&&(A.previewUrl=C)},getPreviewUrl:()=>A?A.previewUrl:d.previewUrl,setMaskUrl:C=>{A&&(A.maskUrl=C)},getMaskUrl:()=>A?A.maskUrl:d.maskUrl,setDisableDanmaku:C=>{A&&(A.disableDanmaku=C)},getDisableDanmaku:()=>A?A.disableDanmaku:d.disableDanmaku,setDanmakuRendering:C=>{A&&(A.danmakuRendering=C)},getDanmakuRendering:()=>A==null?void 0:A.danmakuRendering,getStreamTime:C=>A?A.getStreamTime(C):0,getAudienceStat:()=>A==null?void 0:A.audienceStat,getIsLiveShift:()=>A?A.isLiveShift:!1,getLiveShiftType:()=>A?A.liveShiftType:Kn.NONE,setLiveShiftType:C=>{A&&(A.liveShiftType=C)},getVersion:()=>sr.version,getPluginInstance:C=>A==null?void 0:A.getPluginInstance(C),getAllPlugins:()=>A==null?void 0:A.getAllPlugins()}),ft.onMounted(()=>{const C=A=new sr(`#${m.value}`,{config:d.config,src:d.src,crossOrigin:d.crossOrigin,preload:d.preload,defaultPlaybackRate:d.defaultPlaybackRate,playbackRate:d.playbackRate,autoplay:d.autoplay,loop:d.loop,controls:d.controls,videoId:d.videoId,volume:d.volume,muted:d.muted,defaultMuted:d.defaultMuted,poster:d.poster,disablePictureInPicture:d.disablePictureInPicture,disableDownload:d.disableDownload,disableAdaptive:d.disableAdaptive,disableHotkey:d.disableHotkey,disableMask:d.disableMask,playsinline:d.playsinline,showProgress:d.showProgress,showTime:d.showTime,prefetch:d.prefetch,showInfoPanel:d.showInfoPanel,productName:d.productName,previewUrl:d.previewUrl,maskUrl:d.maskUrl,disableDanmaku:d.disableDanmaku,danmakuRendering:d.danmakuRendering,plugins:d.plugins,bizData:d.bizData,liveShiftType:d.liveShiftType});T=C.logger,o.forEach(h=>{C.on(h,F=>s(h,F))})}),ft.onBeforeUnmount(()=>{A==null||A.destroy(),A=void 0}),(C,h)=>(ft.openBlock(),ft.createElementBlock("div",{id:m.value},[ft.renderSlot(C.$slots,"watermark")],8,aA))}});os.install=r=>{r.component("KwaiPlayerVue3",os)};var sA=Object.defineProperty,oA=(r,i,n)=>i in r?sA(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,yl=(r,i,n)=>(oA(r,typeof i!="symbol"?i+"":i,n),n),kn=function(r){var i={};function n(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=r,n.c=i,n.d=function(o,s,d){n.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:d})},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n.t=function(o,s){if(1&s&&(o=n(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(n.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var m in o)n.d(d,m,function(A){return o[A]}.bind(null,m));return d},n.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(s,"a",s),s},n.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},n.p="",n(n.s=8)}([function(r,i,n){var o=n(5);function s(d,m){for(var A=0;A<m.length;A++){var T=m[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,o(T.key),T)}}r.exports=function(d,m,A){return m&&s(d.prototype,m),A&&s(d,A),Object.defineProperty(d,"prototype",{writable:!1}),d},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){function n(o){return r.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,n(o)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(7)();r.exports=o;try{regeneratorRuntime=o}catch(s){typeof globalThis=="object"?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(r,i){function n(){return r.exports=n=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(o[m]=d[m])}return o},r.exports.__esModule=!0,r.exports.default=r.exports,n.apply(this,arguments)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i){function n(o,s,d,m,A,T,C){try{var h=o[T](C),F=h.value}catch(w){return void d(w)}h.done?s(F):Promise.resolve(F).then(m,A)}r.exports=function(o){return function(){var s=this,d=arguments;return new Promise(function(m,A){var T=o.apply(s,d);function C(F){n(T,m,A,C,h,"next",F)}function h(F){n(T,m,A,C,h,"throw",F)}C(void 0)})}},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(1).default,s=n(6);r.exports=function(d){var m=s(d,"string");return o(m)=="symbol"?m:m+""},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(1).default;r.exports=function(s,d){if(o(s)!="object"||!s)return s;var m=s[Symbol.toPrimitive];if(m!==void 0){var A=m.call(s,d||"default");if(o(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(1).default;function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r.exports=s=function(){return m},r.exports.__esModule=!0,r.exports.default=r.exports;var d,m={},A=Object.prototype,T=A.hasOwnProperty,C=Object.defineProperty||function(de,$,ge){de[$]=ge.value},h=typeof Symbol=="function"?Symbol:{},F=h.iterator||"@@iterator",w=h.asyncIterator||"@@asyncIterator",I=h.toStringTag||"@@toStringTag";function S(de,$,ge){return Object.defineProperty(de,$,{value:ge,enumerable:!0,configurable:!0,writable:!0}),de[$]}try{S({},"")}catch(de){S=function($,ge,Pe){return $[ge]=Pe}}function W(de,$,ge,Pe){var ae=$&&$.prototype instanceof J?$:J,q=Object.create(ae.prototype),b=new Re(Pe||[]);return C(q,"_invoke",{value:L(de,ge,b)}),q}function j(de,$,ge){try{return{type:"normal",arg:de.call($,ge)}}catch(Pe){return{type:"throw",arg:Pe}}}m.wrap=W;var N="suspendedStart",K="executing",z="completed",B={};function J(){}function be(){}function X(){}var ye={};S(ye,F,function(){return this});var Be=Object.getPrototypeOf,Ve=Be&&Be(Be(Oe([])));Ve&&Ve!==A&&T.call(Ve,F)&&(ye=Ve);var je=X.prototype=J.prototype=Object.create(ye);function we(de){["next","throw","return"].forEach(function($){S(de,$,function(ge){return this._invoke($,ge)})})}function ue(de,$){function ge(ae,q,b,ve){var U=j(de[ae],de,q);if(U.type!=="throw"){var M=U.arg,ne=M.value;return ne&&o(ne)=="object"&&T.call(ne,"__await")?$.resolve(ne.__await).then(function(Le){ge("next",Le,b,ve)},function(Le){ge("throw",Le,b,ve)}):$.resolve(ne).then(function(Le){M.value=Le,b(M)},function(Le){return ge("throw",Le,b,ve)})}ve(U.arg)}var Pe;C(this,"_invoke",{value:function(ae,q){function b(){return new $(function(ve,U){ge(ae,q,ve,U)})}return Pe=Pe?Pe.then(b,b):b()}})}function L(de,$,ge){var Pe=N;return function(ae,q){if(Pe===K)throw Error("Generator is already running");if(Pe===z){if(ae==="throw")throw q;return{value:d,done:!0}}for(ge.method=ae,ge.arg=q;;){var b=ge.delegate;if(b){var ve=D(b,ge);if(ve){if(ve===B)continue;return ve}}if(ge.method==="next")ge.sent=ge._sent=ge.arg;else if(ge.method==="throw"){if(Pe===N)throw Pe=z,ge.arg;ge.dispatchException(ge.arg)}else ge.method==="return"&&ge.abrupt("return",ge.arg);Pe=K;var U=j(de,$,ge);if(U.type==="normal"){if(Pe=ge.done?z:"suspendedYield",U.arg===B)continue;return{value:U.arg,done:ge.done}}U.type==="throw"&&(Pe=z,ge.method="throw",ge.arg=U.arg)}}}function D(de,$){var ge=$.method,Pe=de.iterator[ge];if(Pe===d)return $.delegate=null,ge==="throw"&&de.iterator.return&&($.method="return",$.arg=d,D(de,$),$.method==="throw")||ge!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+ge+"' method")),B;var ae=j(Pe,de.iterator,$.arg);if(ae.type==="throw")return $.method="throw",$.arg=ae.arg,$.delegate=null,B;var q=ae.arg;return q?q.done?($[de.resultName]=q.value,$.next=de.nextLoc,$.method!=="return"&&($.method="next",$.arg=d),$.delegate=null,B):q:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,B)}function le(de){var $={tryLoc:de[0]};1 in de&&($.catchLoc=de[1]),2 in de&&($.finallyLoc=de[2],$.afterLoc=de[3]),this.tryEntries.push($)}function oe(de){var $=de.completion||{};$.type="normal",delete $.arg,de.completion=$}function Re(de){this.tryEntries=[{tryLoc:"root"}],de.forEach(le,this),this.reset(!0)}function Oe(de){if(de||de===""){var $=de[F];if($)return $.call(de);if(typeof de.next=="function")return de;if(!isNaN(de.length)){var ge=-1,Pe=function ae(){for(;++ge<de.length;)if(T.call(de,ge))return ae.value=de[ge],ae.done=!1,ae;return ae.value=d,ae.done=!0,ae};return Pe.next=Pe}}throw new TypeError(o(de)+" is not iterable")}return be.prototype=X,C(je,"constructor",{value:X,configurable:!0}),C(X,"constructor",{value:be,configurable:!0}),be.displayName=S(X,I,"GeneratorFunction"),m.isGeneratorFunction=function(de){var $=typeof de=="function"&&de.constructor;return!!$&&($===be||($.displayName||$.name)==="GeneratorFunction")},m.mark=function(de){return Object.setPrototypeOf?Object.setPrototypeOf(de,X):(de.__proto__=X,S(de,I,"GeneratorFunction")),de.prototype=Object.create(je),de},m.awrap=function(de){return{__await:de}},we(ue.prototype),S(ue.prototype,w,function(){return this}),m.AsyncIterator=ue,m.async=function(de,$,ge,Pe,ae){ae===void 0&&(ae=Promise);var q=new ue(W(de,$,ge,Pe),ae);return m.isGeneratorFunction($)?q:q.next().then(function(b){return b.done?b.value:q.next()})},we(je),S(je,I,"Generator"),S(je,F,function(){return this}),S(je,"toString",function(){return"[object Generator]"}),m.keys=function(de){var $=Object(de),ge=[];for(var Pe in $)ge.push(Pe);return ge.reverse(),function ae(){for(;ge.length;){var q=ge.pop();if(q in $)return ae.value=q,ae.done=!1,ae}return ae.done=!0,ae}},m.values=Oe,Re.prototype={constructor:Re,reset:function(de){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(oe),!de)for(var $ in this)$.charAt(0)==="t"&&T.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=d)},stop:function(){this.done=!0;var de=this.tryEntries[0].completion;if(de.type==="throw")throw de.arg;return this.rval},dispatchException:function(de){if(this.done)throw de;var $=this;function ge(U,M){return q.type="throw",q.arg=de,$.next=U,M&&($.method="next",$.arg=d),!!M}for(var Pe=this.tryEntries.length-1;Pe>=0;--Pe){var ae=this.tryEntries[Pe],q=ae.completion;if(ae.tryLoc==="root")return ge("end");if(ae.tryLoc<=this.prev){var b=T.call(ae,"catchLoc"),ve=T.call(ae,"finallyLoc");if(b&&ve){if(this.prev<ae.catchLoc)return ge(ae.catchLoc,!0);if(this.prev<ae.finallyLoc)return ge(ae.finallyLoc)}else if(b){if(this.prev<ae.catchLoc)return ge(ae.catchLoc,!0)}else{if(!ve)throw Error("try statement without catch or finally");if(this.prev<ae.finallyLoc)return ge(ae.finallyLoc)}}}},abrupt:function(de,$){for(var ge=this.tryEntries.length-1;ge>=0;--ge){var Pe=this.tryEntries[ge];if(Pe.tryLoc<=this.prev&&T.call(Pe,"finallyLoc")&&this.prev<Pe.finallyLoc){var ae=Pe;break}}ae&&(de==="break"||de==="continue")&&ae.tryLoc<=$&&$<=ae.finallyLoc&&(ae=null);var q=ae?ae.completion:{};return q.type=de,q.arg=$,ae?(this.method="next",this.next=ae.finallyLoc,B):this.complete(q)},complete:function(de,$){if(de.type==="throw")throw de.arg;return de.type==="break"||de.type==="continue"?this.next=de.arg:de.type==="return"?(this.rval=this.arg=de.arg,this.method="return",this.next="end"):de.type==="normal"&&$&&(this.next=$),B},finish:function(de){for(var $=this.tryEntries.length-1;$>=0;--$){var ge=this.tryEntries[$];if(ge.finallyLoc===de)return this.complete(ge.completion,ge.afterLoc),oe(ge),B}},catch:function(de){for(var $=this.tryEntries.length-1;$>=0;--$){var ge=this.tryEntries[$];if(ge.tryLoc===de){var Pe=ge.completion;if(Pe.type==="throw"){var ae=Pe.arg;oe(ge)}return ae}}throw Error("illegal catch attempt")},delegateYield:function(de,$,ge){return this.delegate={iterator:Oe(de),resultName:$,nextLoc:ge},this.method==="next"&&(this.arg=d),B}},m}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){n.r(i),n.d(i,"KwaiVideoLocalLog",function(){return je}),n.d(i,"LogLevel",function(){return w}),n.d(i,"DefaultLogger",function(){return j}),n.d(i,"Logger",function(){return W}),n.d(i,"printVersion",function(){return T}),n.d(i,"DEFAULT_LOG_LEVEL",function(){return I});var o=n(0),s=n.n(o),d=n(3),m=n.n(d),A={idbName:"kwai-video-local-log",idbMaxDataCount:25e3,idbMaxFoldLog:20,maxLogLen:4096};function T(we,ue){console.log("%c "+we+" %c "+ue+" %c","background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px; color: #fff","background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0; color: #fff","background:transparent")}var C=function(){function we(){this.timeout=6048e5}var ue=we.prototype;return ue.write=function(L,D){if(we.available)try{localStorage.setItem(L,JSON.stringify({value:D,time:Date.now()}))}catch(le){}},ue.read=function(L,D){if(D===void 0&&(D=!0),we.available)try{var le=localStorage.getItem(L);if(le){var oe=JSON.parse(le),Re=oe.value,Oe=oe.time,de=Oe===void 0?0:Oe;if(!D||Date.now()-de<(typeof D=="number"?D:this.timeout))return Re}}catch($){}},s()(we,null,[{key:"available",get:function(){if(we._available===void 0)try{localStorage.setItem("alg","test"),we._available=!0}catch(L){we._available=!1}return we._available}}])}();C._available=void 0;var h,F=C,w=function(we){return we.NONE="none",we.ERROR="e",we.WARN="w",we.INFO="i",we.DEBUG="d",we.VERBOSE="v",we}({}),I=w.ERROR,S=((h={})[w.NONE]={value:1,str:"N"},h[w.ERROR]={value:100,str:"E"},h[w.WARN]={value:200,str:"W"},h[w.INFO]={value:300,str:"I"},h[w.DEBUG]={value:400,str:"D"},h[w.VERBOSE]={value:500,str:"V"},h),W=function(){function we(L){if(this._name="kwai-v",this._level=I,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&location.protocol==="blob:"){var D,le=location.href.split("/"),oe=(D=le[le.length-1])==null?void 0:D.match(/(\w+)-/);oe&&(this._workerTag=L?L+"-"+oe[1]:oe[1])}else L&&(this._workerTag=L)}we.loadLogLevel=function(L,D){if(D===void 0&&(D=!0),location.href){var le=new RegExp(L+"=([a-z]{1})"),oe=location.href.match(le);if(oe&&oe.length>1){var Re=oe[1];if(this._isValueInLevel(Re))return Re}}var Oe=new F().read(L,D);if(this._isValueInLevel(Oe))return Oe},we.saveLogLevel=function(L,D){this._isValueInLevel(D)&&new F().write(L,D)},we._isValueInLevel=function(L){return Object.values(w).indexOf(L)!==-1};var ue=we.prototype;return ue.setOutput=function(L){return this._output=L,this},ue.setLevel=function(L){return this._level=L,this},ue.setId=function(L){return this._id=L,this},ue.setName=function(L){return this._name=L,this},ue.getLevel=function(){return this._level},ue.getOutput=function(){return this._output},ue.hasOutput=function(){return!!this._output},ue.e=function(L){if(this._isLevelEnabled(this._level,w.ERROR)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.ERROR,L,le);try{var Oe;(Oe=this._output)==null||Oe.e.apply(Oe,[Re].concat(le))}catch(de){}}},ue.w=function(L){if(this._isLevelEnabled(this._level,w.WARN)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.WARN,L,le);try{var Oe;(Oe=this._output)==null||Oe.w.apply(Oe,[Re].concat(le))}catch(de){}}},ue.i=function(L){if(this._isLevelEnabled(this._level,w.INFO)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.INFO,L,le);try{var Oe;(Oe=this._output)==null||Oe.i.apply(Oe,[Re].concat(le))}catch(de){}}},ue.d=function(L){if(this._isLevelEnabled(this._level,w.DEBUG)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.DEBUG,L,le);try{var Oe;(Oe=this._output)==null||Oe.d.apply(Oe,[Re].concat(le))}catch(de){}}},ue.v=function(L){if(this._isLevelEnabled(this._level,w.VERBOSE)){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];var Re=this._printLog(w.VERBOSE,L,le);try{var Oe;(Oe=this._output)==null||Oe.v.apply(Oe,[Re].concat(le))}catch(de){}}},ue._isLevelEnabled=function(L,D){return S[L].value>=S[D].value},ue._printLog=function(L,D,le){var oe,Re,Oe=typeof D;if(Oe==="object")D=((Re=D)==null?void 0:Re.constructor.name)||"unknown";else if(Oe==="function"){var de;D=((de=Object.getOwnPropertyDescriptor(D,"name"))==null?void 0:de.value)||"unknown"}var $,ge,Pe=(((oe=S[L])==null?void 0:oe.str)||"")+"|"+this._name+"["+(typeof this._id=="function"?this._id():this._id)+"]["+this._workerTag+"]::"+D;return L===w.ERROR?($=console).error.apply($,[Pe].concat(le.slice(0))):(ge=console).log.apply(ge,[Pe].concat(le.slice(0))),Pe},we}(),j=new W,N=function(){return s()(function we(ue){this._logger=void 0,this._id=0,this._config=A,this._id=we._id,we._id++,this._logger=new W().setId(this._id).setLevel(w.INFO),this._config=m()({},A,ue)},[{key:"config",get:function(){return this._config}},{key:"logger",get:function(){return this._logger}},{key:"id",get:function(){return this._id}}],[{key:"packName",get:function(){return"ll_es"}},{key:"version",get:function(){return"1.0.13"}},{key:"buildTime",get:function(){return"Tue Oct 08 2024 17:18:49 GMT+0800 (中国标准时间)"}}])}();N._id=0;var K=n(4),z=n.n(K),B=n(2),J=n.n(B),be=function(){function we(L,D,le,oe,Re){var Oe=this;Re===void 0&&(Re=1),this._logger=void 0,this._name=void 0,this._storeName=void 0,this._dbIndex=void 0,this._version=void 0,this._taskQueue=[],this._openReq=void 0,this._isTransactionActive=!1,this._runTaskQueue=function(){for(;Oe._taskQueue.length;){var de=Oe._taskQueue.shift();de&&Oe.run(de.task,de.mode)}},this._logger=L,this._name=D,this._storeName=le,this._dbIndex=oe,this._version=Re}var ue=we.prototype;return ue.init=function(){var L=this;if(!this._openReq&&indexedDB){var D=this._openReq=indexedDB.open(this._name,this._version);this._logger.i("idb-wrapper","open",D),D.onerror=function(){L._logger.i("idb-wrapper","open error.")},D.onsuccess=function(){L._logger.i("idb-wrapper","open success."),L._runTaskQueue()},D.onupgradeneeded=function(){L._logger.i("idb-wrapper","open upgradeneeded."),D.result.objectStoreNames.contains(L._storeName)&&D.result.deleteObjectStore(L._storeName);var le=D.result.createObjectStore(L._storeName,{keyPath:"id",autoIncrement:!0});L._dbIndex&&L._dbIndex.forEach(function(oe){le.createIndex(oe.name,oe.keyPath,oe.option)})}}},ue.run=function(L,D){if(D===void 0&&(D="readwrite"),this.init(),this._openReq&&this._openReq.readyState==="done"&&!this._openReq.error)return this._doTask(L,D);this.state!=="error"&&(this._taskQueue.push({task:L,mode:D}),this._taskQueue.length>1e3&&this._taskQueue.shift())},ue.close=function(){var L=this;this._logger.i("idb-wrapper","close"),this._openReq&&(this._openReq.readyState==="done"?(this._openReq.result.close(),this._openReq=void 0):this._openReq.onsuccess=function(){L.close()})},ue.destroy=function(){this._logger.i("idb-wrapper","destroy"),this.close(),this._taskQueue=[]},ue._doTask=function(L,D){var le=this;if(D===void 0&&(D="readwrite"),this._openReq&&!this._openReq.error)try{this._isTransactionActive=!0;var oe=this._openReq.result.transaction(this._storeName,D),Re=void 0;oe.oncomplete=function(){le._isTransactionActive=!1,L.callback&&L.callback(Re),le._runTaskQueue()},oe.onabort=oe.onerror=function(){le._isTransactionActive=!1,L.callback&&L.callback(Re),le._runTaskQueue()},Re=L.exec(oe.objectStore(this._storeName))}catch(Oe){}else L.callback&&L.callback()},s()(we,[{key:"isTransactionActive",get:function(){return this._isTransactionActive}},{key:"state",get:function(){return this._openReq&&this._openReq.readyState==="done"?this._openReq.error?"error":"ready":"idle"}}])}(),X=[{name:"id",keyPath:"id",option:{unique:!0}}],ye=[function(){function we(L){this._ctx=void 0,this._idb=void 0,this._logCount=0,this._saveCount=0,this._reCountOnSaveCount=100,this._reduceData=!1,this._ctx=L,this._idb=new be(L.logger,L.config.idbName,L.config.idbName,X),this._reCountOnSaveCount=Math.min(200,Math.max(50,Math.round(this._ctx.config.idbMaxDataCount/10))),this._count()}we.isSupported=function(){return typeof indexedDB<"u"};var ue=we.prototype;return ue.saveLog=function(L){var D=this,le={exec:function(oe){return oe.add({value:L})},callback:function(oe){D._saveCount++,D._saveCount%D._reCountOnSaveCount==0&&D._count(),oe!=null&&oe.error&&D._ctx.logger.i("idb-backend","save log err",oe.error)}};this._idb.run(le)},ue.exportLog=function(){var L=z()(J.a.mark(function D(){var le=this;return J.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.abrupt("return",new Promise(function(Re,Oe){le._ctx.logger.i("idb-backend","export start");var de={exec:function($){return $.getAll()},callback:function($){Re($===void 0?"":le._mergeGetAll($.result))}};le._idb.run(de,"readonly")}));case 1:case"end":return oe.stop()}},D)}));return function(){return L.apply(this,arguments)}}(),ue.destroy=function(){this._idb.destroy()},ue.clean=function(){this._idb.run({exec:function(L){return L.clear()}})},ue._count=function(){var L=this,D={exec:function(le){return le.count()},callback:function(le){le!=null&&le.error||le==null||!le.result||(L._ctx.logger.i("idb-backend","count: "+le.result+" max: "+L._ctx.config.idbMaxDataCount),L._logCount=le.result,L._logCount>=L._ctx.config.idbMaxDataCount&&!L._reduceData&&L._deleteFromHead(L._logCount-Math.round(L._ctx.config.idbMaxDataCount/2)))}};this._idb.run(D)},ue._deleteFromHead=function(L){var D=this;this._ctx.logger.i("idb-backend","delete from head"),this._reduceData=!0;var le={exec:function(oe){return oe.openCursor()},callback:function(oe){if(D._reduceData=!1,oe!=null&&oe.result){var Re=IDBKeyRange.bound(oe.result.key,oe.result.key+L,!1,!1),Oe={exec:function(de){return D._ctx.logger.i("idb-backend","del: "+Re.lower+"~"+Re.upper),de.delete(Re)},callback:function(de){D._ctx.logger.i("idb-backend","del result: "+!(de==null||!de.error))}};D._idb.run(Oe)}}};this._idb.run(le)},ue._mergeGetAll=function(L){return L.length?L.reduce(function(D,le){return""+D+le.value+`
`},""):""},s()(we,[{key:"isActive",get:function(){return this._idb.state!=="error"}}])}()];function Be(we,ue,L){var D=new Date;typeof we!="string"&&(we=we.toString());var le=D.toLocaleString()+"."+D.getMilliseconds().toString().padStart(3,"0")+"|"+we+"|";return ue.forEach(function(oe){le+=typeof oe=="object"?JSON.stringify(oe)+" ":oe+" "}),le.length>L?le.substring(0,L):le}function Ve(we){return we.join(`
`)}var je=function(){function we(L){var D=this;this._ctx=void 0,this._backend=void 0,this._delayTimer=void 0,this._logCache=[],this._loggerForAdd=void 0,this._downloadHref=void 0,this._startDelay=function(){D._delayTimer=setInterval(function(){D._saveLog(!0)},1e3)},this._stopDelay=function(){D._delayTimer&&(clearTimeout(D._delayTimer),D._delayTimer=void 0)},T("kwai-video-local-log","1.0.13"),this._ctx=new N(L);var le=function(oe){for(var Re=arguments.length,Oe=new Array(Re>1?Re-1:0),de=1;de<Re;de++)Oe[de-1]=arguments[de];D.addLog.apply(D,[oe].concat(Oe))};this._loggerForAdd={e:le,w:le,i:le,d:le,v:le},this._ctx.logger.setOutput(this._loggerForAdd),this._ctx.logger.i("kwai-video-local-log","constructor",L,this._ctx.config),this._backend=function(oe){for(var Re=0;Re<ye.length;Re++){var Oe=ye[Re];if(Oe!=null&&Oe.isSupported())return new Oe(oe)}}(this._ctx),this._backend&&this._startDelay()}we.isSupported=function(){return function(){for(var L=0;L<ye.length;L++){var D=ye[L];if(D!=null&&D.isSupported())return!0}return!1}()};var ue=we.prototype;return ue.addLog=function(L){for(var D=arguments.length,le=new Array(D>1?D-1:0),oe=1;oe<D;oe++)le[oe-1]=arguments[oe];this._logCache.push(Be(L,le,this._ctx.config.maxLogLen)),this._saveLog()},ue.cleanLog=function(){var L;this._ctx.logger.i("kwai-video-local-log","clean"),(L=this._backend)==null||L.clean()},ue.exportLog=function(){var L=this;return this._ctx.logger.i("kwai-video-local-log","export log"),new Promise(function(D,le){L._backend?L._backend.exportLog().then(function(oe){D(Ve([oe].concat(L._logCache)))}):D("")})},ue.downloadLog=function(L){var D=this;this._ctx.logger.i("kwai-video-local-log","download log: "+L),this._destroyDownloadHref(),this.exportLog().then(function(le){var oe=new Blob([le],{type:"text/plain"});if(document){var Re=document.createElement("a");D._downloadHref=Re.href=URL.createObjectURL(oe),Re.download=L||"Log_web_"+new Date().toLocaleString()+".log",document.body.appendChild(Re),Re.click(),Re.remove()}else console.log("无document,当前是否在worker中")})},ue.destroy=function(){var L;this._destroyDownloadHref(),(L=this._backend)==null||L.destroy(),this._stopDelay()},ue.getLoggerForAdd=function(){return this._loggerForAdd},ue._destroyDownloadHref=function(){try{this._downloadHref&&(URL.revokeObjectURL(this._downloadHref),this._downloadHref=void 0)}catch(L){}},ue._saveLog=function(L){if(L===void 0&&(L=!1),this._backend&&this._backend.isActive&&(this._logCache.length>=this._ctx.config.idbMaxFoldLog||this._logCache.length>0&&L)){var D=Ve(this._logCache);this._logCache.splice(0,this._logCache.length),D&&this._backend.saveLog(D)}},s()(we,null,[{key:"version",get:function(){return"1.0.13"}}])}();i.default=je}]);kn===void 0&&console.error("esm-webpack-plugin: nothing exported!");const Cl=kn.KwaiVideoLocalLog,Tl=kn.LogLevel,cA=kn.DefaultLogger,lA=kn.Logger;kn.printVersion,kn.DEFAULT_LOG_LEVEL,kn.default;var oo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Il(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var co={exports:{}},da=typeof Reflect=="object"?Reflect:null,Rl=da&&typeof da.apply=="function"?da.apply:function(r,i,n){return Function.prototype.apply.call(r,i,n)},cs;da&&typeof da.ownKeys=="function"?cs=da.ownKeys:Object.getOwnPropertySymbols?cs=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:cs=function(r){return Object.getOwnPropertyNames(r)};function uA(r){console&&console.warn&&console.warn(r)}var wl=Number.isNaN||function(r){return r!==r};function qt(){qt.init.call(this)}co.exports=qt,co.exports.once=pA,qt.EventEmitter=qt,qt.prototype._events=void 0,qt.prototype._eventsCount=0,qt.prototype._maxListeners=void 0;var Dl=10;function ls(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(qt,"defaultMaxListeners",{enumerable:!0,get:function(){return Dl},set:function(r){if(typeof r!="number"||r<0||wl(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Dl=r}}),qt.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},qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||wl(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function Ll(r){return r._maxListeners===void 0?qt.defaultMaxListeners:r._maxListeners}qt.prototype.getMaxListeners=function(){return Ll(this)},qt.prototype.emit=function(r){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var o=r==="error",s=this._events;if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var d;if(i.length>0&&(d=i[0]),d instanceof Error)throw d;var m=new Error("Unhandled error."+(d?" ("+d.message+")":""));throw m.context=d,m}var A=s[r];if(A===void 0)return!1;if(typeof A=="function")Rl(A,this,i);else for(var T=A.length,C=kl(A,T),n=0;n<T;++n)Rl(C[n],this,i);return!0};function Sl(r,i,n,o){var s,d,m;if(ls(n),d=r._events,d===void 0?(d=r._events=Object.create(null),r._eventsCount=0):(d.newListener!==void 0&&(r.emit("newListener",i,n.listener?n.listener:n),d=r._events),m=d[i]),m===void 0)m=d[i]=n,++r._eventsCount;else if(typeof m=="function"?m=d[i]=o?[n,m]:[m,n]:o?m.unshift(n):m.push(n),s=Ll(r),s>0&&m.length>s&&!m.warned){m.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+m.length+" "+String(i)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=r,A.type=i,A.count=m.length,uA(A)}return r}qt.prototype.addListener=function(r,i){return Sl(this,r,i,!1)},qt.prototype.on=qt.prototype.addListener,qt.prototype.prependListener=function(r,i){return Sl(this,r,i,!0)};function hA(){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 Ol(r,i,n){var o={fired:!1,wrapFn:void 0,target:r,type:i,listener:n},s=hA.bind(o);return s.listener=n,o.wrapFn=s,s}qt.prototype.once=function(r,i){return ls(i),this.on(r,Ol(this,r,i)),this},qt.prototype.prependOnceListener=function(r,i){return ls(i),this.prependListener(r,Ol(this,r,i)),this},qt.prototype.removeListener=function(r,i){var n,o,s,d,m;if(ls(i),o=this._events,o===void 0)return this;if(n=o[r],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete o[r],o.removeListener&&this.emit("removeListener",r,n.listener||i));else if(typeof n!="function"){for(s=-1,d=n.length-1;d>=0;d--)if(n[d]===i||n[d].listener===i){m=n[d].listener,s=d;break}if(s<0)return this;s===0?n.shift():dA(n,s),n.length===1&&(o[r]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",r,m||i)}return this},qt.prototype.off=qt.prototype.removeListener,qt.prototype.removeAllListeners=function(r){var i,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[r]),this;if(arguments.length===0){var s=Object.keys(n),d;for(o=0;o<s.length;++o)d=s[o],d!=="removeListener"&&this.removeAllListeners(d);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[r],typeof i=="function")this.removeListener(r,i);else if(i!==void 0)for(o=i.length-1;o>=0;o--)this.removeListener(r,i[o]);return this};function Nl(r,i,n){var o=r._events;if(o===void 0)return[];var s=o[i];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?fA(s):kl(s,s.length)}qt.prototype.listeners=function(r){return Nl(this,r,!0)},qt.prototype.rawListeners=function(r){return Nl(this,r,!1)},qt.listenerCount=function(r,i){return typeof r.listenerCount=="function"?r.listenerCount(i):xl.call(r,i)},qt.prototype.listenerCount=xl;function xl(r){var i=this._events;if(i!==void 0){var n=i[r];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}qt.prototype.eventNames=function(){return this._eventsCount>0?cs(this._events):[]};function kl(r,i){for(var n=new Array(i),o=0;o<i;++o)n[o]=r[o];return n}function dA(r,i){for(;i+1<r.length;i++)r[i]=r[i+1];r.pop()}function fA(r){for(var i=new Array(r.length),n=0;n<i.length;++n)i[n]=r[n].listener||r[n];return i}function pA(r,i){return new Promise(function(n,o){function s(m){r.removeListener(i,d),o(m)}function d(){typeof r.removeListener=="function"&&r.removeListener("error",s),n([].slice.call(arguments))}Ml(r,i,d,{once:!0}),i!=="error"&&_A(r,s,{once:!0})})}function _A(r,i,n){typeof r.on=="function"&&Ml(r,"error",i,n)}function Ml(r,i,n,o){if(typeof r.on=="function")o.once?r.once(i,n):r.on(i,n);else if(typeof r.addEventListener=="function")r.addEventListener(i,function s(d){o.once&&r.removeEventListener(i,s),n(d)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var AA=co.exports,Pl=function(){if(typeof Map<"u")return Map;function r(i,n){var o=-1;return i.some(function(s,d){return s[0]===n?(o=d,!0):!1}),o}return function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(n){var o=r(this.__entries__,n),s=this.__entries__[o];return s&&s[1]},i.prototype.set=function(n,o){var s=r(this.__entries__,n);~s?this.__entries__[s][1]=o:this.__entries__.push([n,o])},i.prototype.delete=function(n){var o=this.__entries__,s=r(o,n);~s&&o.splice(s,1)},i.prototype.has=function(n){return!!~r(this.__entries__,n)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(n,o){o===void 0&&(o=null);for(var s=0,d=this.__entries__;s<d.length;s++){var m=d[s];n.call(o,m[1],m[0])}},i}()}(),lo=typeof window<"u"&&typeof document<"u"&&window.document===document,us=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),vA=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(us):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}}(),gA=2;function mA(r,i){var n=!1,o=!1,s=0;function d(){n&&(n=!1,r()),o&&A()}function m(){vA(d)}function A(){var T=Date.now();if(n){if(T-s<gA)return;o=!0}else n=!0,o=!1,setTimeout(m,i);s=T}return A}var bA=20,EA=["top","right","bottom","left","width","height","size","weight"],yA=typeof MutationObserver<"u",CA=function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=mA(this.refresh.bind(this),bA)}return r.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},r.prototype.removeObserver=function(i){var n=this.observers_,o=n.indexOf(i);~o&&n.splice(o,1),!n.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},r.prototype.updateObservers_=function(){var i=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return i.forEach(function(n){return n.broadcastActive()}),i.length>0},r.prototype.connect_=function(){!lo||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yA?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!lo||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(i){var n=i.propertyName,o=n===void 0?"":n,s=EA.some(function(d){return!!~o.indexOf(d)});s&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r}(),Ul=function(r,i){for(var n=0,o=Object.keys(i);n<o.length;n++){var s=o[n];Object.defineProperty(r,s,{value:i[s],enumerable:!1,writable:!1,configurable:!0})}return r},fa=function(r){var i=r&&r.ownerDocument&&r.ownerDocument.defaultView;return i||us},Bl=ds(0,0,0,0);function hs(r){return parseFloat(r)||0}function Vl(r){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];return i.reduce(function(o,s){var d=r["border-"+s+"-width"];return o+hs(d)},0)}function TA(r){for(var i=["top","right","bottom","left"],n={},o=0,s=i;o<s.length;o++){var d=s[o],m=r["padding-"+d];n[d]=hs(m)}return n}function IA(r){var i=r.getBBox();return ds(0,0,i.width,i.height)}function RA(r){var i=r.clientWidth,n=r.clientHeight;if(!i&&!n)return Bl;var o=fa(r).getComputedStyle(r),s=TA(o),d=s.left+s.right,m=s.top+s.bottom,A=hs(o.width),T=hs(o.height);if(o.boxSizing==="border-box"&&(Math.round(A+d)!==i&&(A-=Vl(o,"left","right")+d),Math.round(T+m)!==n&&(T-=Vl(o,"top","bottom")+m)),!DA(r)){var C=Math.round(A+d)-i,h=Math.round(T+m)-n;Math.abs(C)!==1&&(A-=C),Math.abs(h)!==1&&(T-=h)}return ds(s.left,s.top,A,T)}var wA=function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof fa(r).SVGGraphicsElement}:function(r){return r instanceof fa(r).SVGElement&&typeof r.getBBox=="function"}}();function DA(r){return r===fa(r).document.documentElement}function LA(r){return lo?wA(r)?IA(r):RA(r):Bl}function SA(r){var i=r.x,n=r.y,o=r.width,s=r.height,d=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(d.prototype);return Ul(m,{x:i,y:n,width:o,height:s,top:n,right:i+o,bottom:s+n,left:i}),m}function ds(r,i,n,o){return{x:r,y:i,width:n,height:o}}var OA=function(){function r(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ds(0,0,0,0),this.target=i}return r.prototype.isActive=function(){var i=LA(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},r}(),NA=function(){function r(i,n){var o=SA(n);Ul(this,{target:i,contentRect:o})}return r}(),xA=function(){function r(i,n,o){if(this.activeObservations_=[],this.observations_=new Pl,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=n,this.callbackCtx_=o}return r.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof fa(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(i)||(n.set(i,new OA(i)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof fa(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(i)&&(n.delete(i),n.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&i.activeObservations_.push(n)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var i=this.callbackCtx_,n=this.activeObservations_.map(function(o){return new NA(o.target,o.broadcastRect())});this.callback_.call(i,n,i),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r}(),Fl=typeof WeakMap<"u"?new WeakMap:new Pl,jl=function(){function r(i){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=CA.getInstance(),o=new xA(i,n,this);Fl.set(this,o)}return r}();["observe","unobserve","disconnect"].forEach(function(r){jl.prototype[r]=function(){var i;return(i=Fl.get(this))[r].apply(i,arguments)}});var fs=function(){return typeof us.ResizeObserver<"u"?us.ResizeObserver:jl}(),kA=function(r,i){if(i=i.split(":")[0],r=+r,!r)return!1;switch(i){case"http":case"ws":return r!==80;case"https":case"wss":return r!==443;case"ftp":return r!==21;case"gopher":return r!==70;case"file":return!1}return r!==0},uo={},MA=Object.prototype.hasOwnProperty,PA;function Hl(r){try{return decodeURIComponent(r.replace(/\+/g," "))}catch(i){return null}}function Gl(r){try{return encodeURIComponent(r)}catch(i){return null}}function UA(r){for(var i=/([^=?#&]+)=?([^&]*)/g,n={},o;o=i.exec(r);){var s=Hl(o[1]),d=Hl(o[2]);s===null||d===null||s in n||(n[s]=d)}return n}function BA(r,i){i=i||"";var n=[],o,s;typeof i!="string"&&(i="?");for(s in r)if(MA.call(r,s)){if(o=r[s],!o&&(o===null||o===PA||isNaN(o))&&(o=""),s=Gl(s),o=Gl(o),s===null||o===null)continue;n.push(s+"="+o)}return n.length?i+n.join("&"):""}uo.stringify=BA,uo.parse=UA;var zl=kA,ps=uo,VA=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Kl=/[\n\r\t]/g,FA=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Wl=/:\d+$/,jA=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,HA=/^[a-zA-Z]:/;function ho(r){return(r||"").toString().replace(VA,"")}var fo=[["#","hash"],["?","query"],function(r,i){return fn(i.protocol)?r.replace(/\\/g,"/"):r},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Yl={hash:1,query:1};function Ql(r){var i;typeof window<"u"?i=window:typeof oo<"u"?i=oo:typeof self<"u"?i=self:i={};var n=i.location||{};r=r||n;var o={},s=typeof r,d;if(r.protocol==="blob:")o=new pn(unescape(r.pathname),{});else if(s==="string"){o=new pn(r,{});for(d in Yl)delete o[d]}else if(s==="object"){for(d in r)d in Yl||(o[d]=r[d]);o.slashes===void 0&&(o.slashes=FA.test(r.href))}return o}function fn(r){return r==="file:"||r==="ftp:"||r==="http:"||r==="https:"||r==="ws:"||r==="wss:"}function $l(r,i){r=ho(r),r=r.replace(Kl,""),i=i||{};var n=jA.exec(r),o=n[1]?n[1].toLowerCase():"",s=!!n[2],d=!!n[3],m=0,A;return s?d?(A=n[2]+n[3]+n[4],m=n[2].length+n[3].length):(A=n[2]+n[4],m=n[2].length):d?(A=n[3]+n[4],m=n[3].length):A=n[4],o==="file:"?m>=2&&(A=A.slice(2)):fn(o)?A=n[4]:o?s&&(A=A.slice(2)):m>=2&&fn(i.protocol)&&(A=n[4]),{protocol:o,slashes:s||fn(o),slashesCount:m,rest:A}}function GA(r,i){if(r==="")return i;for(var n=(i||"/").split("/").slice(0,-1).concat(r.split("/")),o=n.length,s=n[o-1],d=!1,m=0;o--;)n[o]==="."?n.splice(o,1):n[o]===".."?(n.splice(o,1),m++):m&&(o===0&&(d=!0),n.splice(o,1),m--);return d&&n.unshift(""),(s==="."||s==="..")&&n.push(""),n.join("/")}function pn(r,i,n){if(r=ho(r),r=r.replace(Kl,""),!(this instanceof pn))return new pn(r,i,n);var o,s,d,m,A,T,C=fo.slice(),h=typeof i,F=this,w=0;for(h!=="object"&&h!=="string"&&(n=i,i=null),n&&typeof n!="function"&&(n=ps.parse),i=Ql(i),s=$l(r||"",i),o=!s.protocol&&!s.slashes,F.slashes=s.slashes||o&&i.slashes,F.protocol=s.protocol||i.protocol||"",r=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||HA.test(r))||!s.slashes&&(s.protocol||s.slashesCount<2||!fn(F.protocol)))&&(C[3]=[/(.*)/,"pathname"]);w<C.length;w++){if(m=C[w],typeof m=="function"){r=m(r,F);continue}d=m[0],T=m[1],d!==d?F[T]=r:typeof d=="string"?(A=d==="@"?r.lastIndexOf(d):r.indexOf(d),~A&&(typeof m[2]=="number"?(F[T]=r.slice(0,A),r=r.slice(A+m[2])):(F[T]=r.slice(A),r=r.slice(0,A)))):(A=d.exec(r))&&(F[T]=A[1],r=r.slice(0,A.index)),F[T]=F[T]||o&&m[3]&&i[T]||"",m[4]&&(F[T]=F[T].toLowerCase())}n&&(F.query=n(F.query)),o&&i.slashes&&F.pathname.charAt(0)!=="/"&&(F.pathname!==""||i.pathname!=="")&&(F.pathname=GA(F.pathname,i.pathname)),F.pathname.charAt(0)!=="/"&&fn(F.protocol)&&(F.pathname="/"+F.pathname),zl(F.port,F.protocol)||(F.host=F.hostname,F.port=""),F.username=F.password="",F.auth&&(A=F.auth.indexOf(":"),~A?(F.username=F.auth.slice(0,A),F.username=encodeURIComponent(decodeURIComponent(F.username)),F.password=F.auth.slice(A+1),F.password=encodeURIComponent(decodeURIComponent(F.password))):F.username=encodeURIComponent(decodeURIComponent(F.auth)),F.auth=F.password?F.username+":"+F.password:F.username),F.origin=F.protocol!=="file:"&&fn(F.protocol)&&F.host?F.protocol+"//"+F.host:"null",F.href=F.toString()}function zA(r,i,n){var o=this;switch(r){case"query":typeof i=="string"&&i.length&&(i=(n||ps.parse)(i)),o[r]=i;break;case"port":o[r]=i,zl(i,o.protocol)?i&&(o.host=o.hostname+":"+i):(o.host=o.hostname,o[r]="");break;case"hostname":o[r]=i,o.port&&(i+=":"+o.port),o.host=i;break;case"host":o[r]=i,Wl.test(i)?(i=i.split(":"),o.port=i.pop(),o.hostname=i.join(":")):(o.hostname=i,o.port="");break;case"protocol":o.protocol=i.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(i){var s=r==="pathname"?"/":"#";o[r]=i.charAt(0)!==s?s+i:i}else o[r]=i;break;case"username":case"password":o[r]=encodeURIComponent(i);break;case"auth":var d=i.indexOf(":");~d?(o.username=i.slice(0,d),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=i.slice(d+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(i))}for(var m=0;m<fo.length;m++){var A=fo[m];A[4]&&(o[A[1]]=o[A[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin=o.protocol!=="file:"&&fn(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o}function KA(r){(!r||typeof r!="function")&&(r=ps.stringify);var i,n=this,o=n.host,s=n.protocol;s&&s.charAt(s.length-1)!==":"&&(s+=":");var d=s+(n.protocol&&n.slashes||fn(n.protocol)?"//":"");return n.username?(d+=n.username,n.password&&(d+=":"+n.password),d+="@"):n.password?(d+=":"+n.password,d+="@"):n.protocol!=="file:"&&fn(n.protocol)&&!o&&n.pathname!=="/"&&(d+="@"),(o[o.length-1]===":"||Wl.test(n.hostname)&&!n.port)&&(o+=":"),d+=o+n.pathname,i=typeof n.query=="object"?r(n.query):n.query,i&&(d+=i.charAt(0)!=="?"?"?"+i:i),n.hash&&(d+=n.hash),d}pn.prototype={set:zA,toString:KA},pn.extractProtocol=$l,pn.location=Ql,pn.trimLeft=ho,pn.qs=ps;var WA=pn;const Xl=Il(WA),YA={search:function(r,i){let n=0,o=r.length-1,s=null,d=null;for(;n<=o;){s=(n+o)/2|0,d=r[s];const m=i(d);if(m>0)n=s+1;else if(m<0)o=s-1;else return d}},searchIndex:function(r,i){let n=0,o=r.length-1,s=null,d=null;for(;n<=o;){s=(n+o)/2|0,d=r[s];const m=i(d);if(m>0)n=s+1;else if(m<0)o=s-1;else return s}return-1}};var pa=function(r){var i={};function n(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=r,n.c=i,n.d=function(o,s,d){n.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:d})},n.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},n.t=function(o,s){if(1&s&&(o=n(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var d=Object.create(null);if(n.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var m in o)n.d(d,m,function(A){return o[A]}.bind(null,m));return d},n.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(s,"a",s),s},n.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},n.p="",n(n.s=4)}([function(r,i){function n(o){return r.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},r.exports.__esModule=!0,r.exports.default=r.exports,n(o)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(2);function s(d,m){for(var A=0;A<m.length;A++){var T=m[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,o(T.key),T)}}r.exports=function(d,m,A){return m&&s(d.prototype,m),A&&s(d,A),Object.defineProperty(d,"prototype",{writable:!1}),d},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(0).default,s=n(3);r.exports=function(d){var m=s(d,"string");return o(m)=="symbol"?m:m+""},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){var o=n(0).default;r.exports=function(s,d){if(o(s)!="object"||!s)return s;var m=s[Symbol.toPrimitive];if(m!==void 0){var A=m.call(s,d||"default");if(o(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)},r.exports.__esModule=!0,r.exports.default=r.exports},function(r,i,n){function o(S,W){console.log("%c "+S+" %c "+W+" %c","background:#35495e ; padding: 1px; border-radius: 4px 0 0 4px; color: #fff","background:#ffa483 ; padding: 1px; border-radius: 0 4px 4px 0; color: #fff","background:transparent")}n.r(i),n.d(i,"LogLevel",function(){return C}),n.d(i,"DefaultLogger",function(){return I}),n.d(i,"Logger",function(){return w}),n.d(i,"printVersion",function(){return o}),n.d(i,"DEFAULT_LOG_LEVEL",function(){return h});var s=n(1),d=n.n(s),m=function(){function S(){this.timeout=6048e5}var W=S.prototype;return W.write=function(j,N){if(S.available)try{localStorage.setItem(j,JSON.stringify({value:N,time:Date.now()}))}catch(K){}},W.read=function(j,N){if(N===void 0&&(N=!0),S.available)try{var K=localStorage.getItem(j);if(K){var z=JSON.parse(K),B=z.value,J=z.time,be=J===void 0?0:J;if(!N||Date.now()-be<(typeof N=="number"?N:this.timeout))return B}}catch(X){}},d()(S,null,[{key:"available",get:function(){if(S._available===void 0)try{localStorage.setItem("alg","test"),S._available=!0}catch(j){S._available=!1}return S._available}}])}();m._available=void 0;var A,T=m,C=function(S){return S.NONE="none",S.ERROR="e",S.WARN="w",S.INFO="i",S.DEBUG="d",S.VERBOSE="v",S}({}),h=C.ERROR,F=((A={})[C.NONE]={value:1,str:"N"},A[C.ERROR]={value:100,str:"E"},A[C.WARN]={value:200,str:"W"},A[C.INFO]={value:300,str:"I"},A[C.DEBUG]={value:400,str:"D"},A[C.VERBOSE]={value:500,str:"V"},A),w=function(){function S(j){if(this._name="kwai-v",this._level=h,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&location.protocol==="blob:"){var N,K=location.href.split("/"),z=(N=K[K.length-1])==null?void 0:N.match(/(\w+)-/);z&&(this._workerTag=j?j+"-"+z[1]:z[1])}else j&&(this._workerTag=j)}S.loadLogLevel=function(j,N){if(N===void 0&&(N=!0),location.href){var K=new RegExp(j+"=([a-z]{1})"),z=location.href.match(K);if(z&&z.length>1){var B=z[1];if(this._isValueInLevel(B))return B}}var J=new T().read(j,N);if(this._isValueInLevel(J))return J},S.saveLogLevel=function(j,N){this._isValueInLevel(N)&&new T().write(j,N)},S._isValueInLevel=function(j){return Object.values(C).indexOf(j)!==-1};var W=S.prototype;return W.setOutput=function(j){return this._output=j,this},W.setLevel=function(j){return this._level=j,this},W.setId=function(j){return this._id=j,this},W.setName=function(j){return this._name=j,this},W.getLevel=function(){return this._level},W.getOutput=function(){return this._output},W.hasOutput=function(){return!!this._output},W.e=function(j){if(this._isLevelEnabled(this._level,C.ERROR)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.ERROR,j,K);try{var J;(J=this._output)==null||J.e.apply(J,[B].concat(K))}catch(be){}}},W.w=function(j){if(this._isLevelEnabled(this._level,C.WARN)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.WARN,j,K);try{var J;(J=this._output)==null||J.w.apply(J,[B].concat(K))}catch(be){}}},W.i=function(j){if(this._isLevelEnabled(this._level,C.INFO)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.INFO,j,K);try{var J;(J=this._output)==null||J.i.apply(J,[B].concat(K))}catch(be){}}},W.d=function(j){if(this._isLevelEnabled(this._level,C.DEBUG)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.DEBUG,j,K);try{var J;(J=this._output)==null||J.d.apply(J,[B].concat(K))}catch(be){}}},W.v=function(j){if(this._isLevelEnabled(this._level,C.VERBOSE)){for(var N=arguments.length,K=new Array(N>1?N-1:0),z=1;z<N;z++)K[z-1]=arguments[z];var B=this._printLog(C.VERBOSE,j,K);try{var J;(J=this._output)==null||J.v.apply(J,[B].concat(K))}catch(be){}}},W._isLevelEnabled=function(j,N){return F[j].value>=F[N].value},W._printLog=function(j,N,K){var z,B,J=typeof N;if(J==="object")N=((B=N)==null?void 0:B.constructor.name)||"unknown";else if(J==="function"){var be;N=((be=Object.getOwnPropertyDescriptor(N,"name"))==null?void 0:be.value)||"unknown"}var X,ye,Be=(((z=F[j])==null?void 0:z.str)||"")+"|"+this._name+"["+(typeof this._id=="function"?this._id():this._id)+"]["+this._workerTag+"]::"+N;return j===C.ERROR?(X=console).error.apply(X,[Be].concat(K.slice(0))):(ye=console).log.apply(ye,[Be].concat(K.slice(0))),Be},S}(),I=new w}]);pa===void 0&&console.error("esm-webpack-plugin: nothing exported!"),pa.LogLevel;const wa=pa.DefaultLogger;pa.Logger,pa.printVersion,pa.DEFAULT_LOG_LEVEL;/*! js-cookie v3.0.5 | MIT */function _s(r){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var o in n)r[o]=n[o]}return r}var QA={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function po(r,i){function n(s,d,m){if(!(typeof document>"u")){m=_s({},i,m),typeof m.expires=="number"&&(m.expires=new Date(Date.now()+m.expires*864e5)),m.expires&&(m.expires=m.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var A="";for(var T in m)m[T]&&(A+="; "+T,m[T]!==!0&&(A+="="+m[T].split(";")[0]));return document.cookie=s+"="+r.write(d,s)+A}}function o(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var d=document.cookie?document.cookie.split("; "):[],m={},A=0;A<d.length;A++){var T=d[A].split("="),C=T.slice(1).join("=");try{var h=decodeURIComponent(T[0]);if(m[h]=r.read(C,h),s===h)break}catch(F){}}return s?m[s]:m}}return Object.create({set:n,get:o,remove:function(s,d){n(s,"",_s({},d,{expires:-1}))},withAttributes:function(s){return po(this.converter,_s({},this.attributes,s))},withConverter:function(s){return po(_s({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(r)}})}var _o=po(QA,{path:"/"});const Da="did",Ao="kwai_player_device_id";function Zl(){try{const r=Math.random()*1e9>>>0,i=[],n="0123456789ABCDEF";for(let s=0;s<7;s++)i.push(n.charAt(Math.random()*16));const o=`web_${r}${i.join("")}`;return wa.i(Da,"generate nanoId",o),o}catch(r){}return"web_did_generation_failed"}function $A(){let r="";try{r=(_o.get("did")||_o.get("_did")||_o.get("weblogger_did")||"").trim(),wa.i(Da,"generate deviceId from cookie",r)}catch(i){wa.i(Da,"generate deviceId from cookie err",i)}try{r?localStorage==null||localStorage.setItem(Ao,r):(r=((localStorage==null?void 0:localStorage.getItem(Ao))||"").trim(),wa.i(Da,"generate deviceId from ls",r)),r||(r=Zl(),localStorage==null||localStorage.setItem(Ao,r))}catch(i){wa.i(Da,"generate deviceId from ls err",i)}return r||Zl()}function XA(r){As=r}let As=$A();const ql=class aa{constructor(){yl(this,"timeout",7*24*3600*1e3)}write(i,n){if(aa.available)try{localStorage.setItem(i,JSON.stringify({value:n,time:Date.now()}))}catch(o){}}read(i,n=!0){if(aa.available)try{const o=localStorage.getItem(i);if(o){const{value:s,time:d=0}=JSON.parse(o);if(!n||Date.now()-d<(typeof n=="number"?n:this.timeout))return s}}catch(o){}}static get available(){if(typeof aa._available>"u")try{localStorage.setItem("alg","test"),aa._available=!0}catch(i){aa._available=!1}return aa._available}};yl(ql,"_available");let Jl=ql;var vo={exports:{}};(function(r,i){(function(n,o){var s="1.0.2",d="",m="?",A="function",T="undefined",C="object",h="string",F="major",w="model",I="name",S="type",W="vendor",j="version",N="architecture",K="console",z="mobile",B="tablet",J="smarttv",be="wearable",X="embedded",ye=255,Be="Amazon",Ve="Apple",je="ASUS",we="BlackBerry",ue="Browser",L="Chrome",D="Edge",le="Firefox",oe="Google",Re="Huawei",Oe="LG",de="Microsoft",$="Motorola",ge="Opera",Pe="Samsung",ae="Sony",q="Xiaomi",b="Zebra",ve="Facebook",U=function(te,ie){var ee={};for(var Te in te)ie[Te]&&ie[Te].length%2===0?ee[Te]=ie[Te].concat(te[Te]):ee[Te]=te[Te];return ee},M=function(te){for(var ie={},ee=0;ee<te.length;ee++)ie[te[ee].toUpperCase()]=te[ee];return ie},ne=function(te,ie){return typeof te===h?Le(ie).indexOf(Le(te))!==-1:!1},Le=function(te){return te.toLowerCase()},Ue=function(te){return typeof te===h?te.replace(/[^\d\.]/g,d).split(".")[0]:o},re=function(te,ie){if(typeof te===h)return te=te.replace(/^\s\s*/,d).replace(/\s\s*$/,d),typeof ie===T?te:te.substring(0,ye)},k=function(te,ie){for(var ee=0,Te,Se,Ye,ze,it,ct;ee<ie.length&&!it;){var nt=ie[ee],Wt=ie[ee+1];for(Te=Se=0;Te<nt.length&&!it;)if(it=nt[Te++].exec(te),it)for(Ye=0;Ye<Wt.length;Ye++)ct=it[++Se],ze=Wt[Ye],typeof ze===C&&ze.length>0?ze.length===2?typeof ze[1]==A?this[ze[0]]=ze[1].call(this,ct):this[ze[0]]=ze[1]:ze.length===3?typeof ze[1]===A&&!(ze[1].exec&&ze[1].test)?this[ze[0]]=ct?ze[1].call(this,ct,ze[2]):o:this[ze[0]]=ct?ct.replace(ze[1],ze[2]):o:ze.length===4&&(this[ze[0]]=ct?ze[3].call(this,ct.replace(ze[1],ze[2])):o):this[ze]=ct||o;ee+=2}},P=function(te,ie){for(var ee in ie)if(typeof ie[ee]===C&&ie[ee].length>0){for(var Te=0;Te<ie[ee].length;Te++)if(ne(ie[ee][Te],te))return ee===m?o:ee}else if(ne(ie[ee],te))return ee===m?o:ee;return te},Z={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},he={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ie={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[j,[I,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[j,[I,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[I,j],[/opios[\/ ]+([\w\.]+)/i],[j,[I,ge+" Mini"]],[/\bopr\/([\w\.]+)/i],[j,[I,ge]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[I,j],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[j,[I,"UC"+ue]],[/\bqbcore\/([\w\.]+)/i],[j,[I,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[j,[I,"WeChat"]],[/konqueror\/([\w\.]+)/i],[j,[I,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[j,[I,"IE"]],[/yabrowser\/([\w\.]+)/i],[j,[I,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[I,/(.+)/,"$1 Secure "+ue],j],[/\bfocus\/([\w\.]+)/i],[j,[I,le+" Focus"]],[/\bopt\/([\w\.]+)/i],[j,[I,ge+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[j,[I,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[j,[I,"Dolphin"]],[/coast\/([\w\.]+)/i],[j,[I,ge+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[j,[I,"MIUI "+ue]],[/fxios\/([-\w\.]+)/i],[j,[I,le]],[/\bqihu|(qi?ho?o?|360)browser/i],[[I,"360 "+ue]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[I,/(.+)/,"$1 "+ue],j],[/(comodo_dragon)\/([\w\.]+)/i],[[I,/_/g," "],j],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[I,j],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[I],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[I,ve],j],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[I,j],[/\bgsa\/([\w\.]+) .*safari\//i],[j,[I,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[j,[I,L+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[I,L+" WebView"],j],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[j,[I,"Android "+ue]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[I,j],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[j,[I,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[j,I],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[I,[j,P,Z]],[/(webkit|khtml)\/([\w\.]+)/i],[I,j],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[I,"Netscape"],j],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[j,[I,le+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[I,j]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,Le]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,d,Le]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,Le]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[w,[W,Pe],[S,B]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[w,[W,Pe],[S,z]],[/\((ip(?:hone|od)[\w ]*);/i],[w,[W,Ve],[S,z]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[w,[W,Ve],[S,B]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[w,[W,Re],[S,B]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[w,[W,Re],[S,z]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[w,/_/g," "],[W,q],[S,z]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[w,/_/g," "],[W,q],[S,B]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[w,[W,"OPPO"],[S,z]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[w,[W,"Vivo"],[S,z]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[w,[W,"Realme"],[S,z]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[w,[W,$],[S,z]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[w,[W,$],[S,B]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[w,[W,Oe],[S,B]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[w,[W,Oe],[S,z]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[w,[W,"Lenovo"],[S,B]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[w,/_/g," "],[W,"Nokia"],[S,z]],[/(pixel c)\b/i],[w,[W,oe],[S,B]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[w,[W,oe],[S,z]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[w,[W,ae],[S,z]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[w,"Xperia Tablet"],[W,ae],[S,B]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[w,[W,"OnePlus"],[S,z]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[w,[W,Be],[S,B]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[w,/(.+)/g,"Fire Phone $1"],[W,Be],[S,z]],[/(playbook);[-\w\),; ]+(rim)/i],[w,W,[S,B]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[w,[W,we],[S,z]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[w,[W,je],[S,B]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[w,[W,je],[S,z]],[/(nexus 9)/i],[w,[W,"HTC"],[S,B]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[W,[w,/_/g," "],[S,z]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[w,[W,"Acer"],[S,B]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[w,[W,"Meizu"],[S,z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[w,[W,"Sharp"],[S,z]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[W,w,[S,z]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[W,w,[S,B]],[/(surface duo)/i],[w,[W,de],[S,B]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[w,[W,"Fairphone"],[S,z]],[/(u304aa)/i],[w,[W,"AT&T"],[S,z]],[/\bsie-(\w*)/i],[w,[W,"Siemens"],[S,z]],[/\b(rct\w+) b/i],[w,[W,"RCA"],[S,B]],[/\b(venue[\d ]{2,7}) b/i],[w,[W,"Dell"],[S,B]],[/\b(q(?:mv|ta)\w+) b/i],[w,[W,"Verizon"],[S,B]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[w,[W,"Barnes & Noble"],[S,B]],[/\b(tm\d{3}\w+) b/i],[w,[W,"NuVision"],[S,B]],[/\b(k88) b/i],[w,[W,"ZTE"],[S,B]],[/\b(nx\d{3}j) b/i],[w,[W,"ZTE"],[S,z]],[/\b(gen\d{3}) b.+49h/i],[w,[W,"Swiss"],[S,z]],[/\b(zur\d{3}) b/i],[w,[W,"Swiss"],[S,B]],[/\b((zeki)?tb.*\b) b/i],[w,[W,"Zeki"],[S,B]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[W,"Dragon Touch"],w,[S,B]],[/\b(ns-?\w{0,9}) b/i],[w,[W,"Insignia"],[S,B]],[/\b((nxa|next)-?\w{0,9}) b/i],[w,[W,"NextBook"],[S,B]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[W,"Voice"],w,[S,z]],[/\b(lvtel\-)?(v1[12]) b/i],[[W,"LvTel"],w,[S,z]],[/\b(ph-1) /i],[w,[W,"Essential"],[S,z]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[w,[W,"Envizen"],[S,B]],[/\b(trio[-\w\. ]+) b/i],[w,[W,"MachSpeed"],[S,B]],[/\btu_(1491) b/i],[w,[W,"Rotor"],[S,B]],[/(shield[\w ]+) b/i],[w,[W,"Nvidia"],[S,B]],[/(sprint) (\w+)/i],[W,w,[S,z]],[/(kin\.[onetw]{3})/i],[[w,/\./g," "],[W,de],[S,z]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[w,[W,b],[S,B]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[w,[W,b],[S,z]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[W,w,[S,K]],[/droid.+; (shield) bui/i],[w,[W,"Nvidia"],[S,K]],[/(playstation [345portablevi]+)/i],[w,[W,ae],[S,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[w,[W,de],[S,K]],[/smart-tv.+(samsung)/i],[W,[S,J]],[/hbbtv.+maple;(\d+)/i],[[w,/^/,"SmartTV"],[W,Pe],[S,J]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[W,Oe],[S,J]],[/(apple) ?tv/i],[W,[w,Ve+" TV"],[S,J]],[/crkey/i],[[w,L+"cast"],[W,oe],[S,J]],[/droid.+aft(\w)( bui|\))/i],[w,[W,Be],[S,J]],[/\(dtv[\);].+(aquos)/i],[w,[W,"Sharp"],[S,J]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[W,re],[w,re],[S,J]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[S,J]],[/((pebble))app/i],[W,w,[S,be]],[/droid.+; (glass) \d/i],[w,[W,oe],[S,be]],[/droid.+; (wt63?0{2,3})\)/i],[w,[W,b],[S,be]],[/(quest( 2)?)/i],[w,[W,ve],[S,be]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[W,[S,X]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[w,[S,z]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[w,[S,B]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[S,B]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[S,z]],[/(android[-\w\. ]{0,9});.+buil/i],[w,[W,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[j,[I,D+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[j,[I,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[I,j],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[j,I]],os:[[/microsoft (windows) (vista|xp)/i],[I,j],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[I,[j,P,he]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[I,"Windows"],[j,P,he]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[j,/_/g,"."],[I,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[I,"Mac OS"],[j,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[j,I],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[I,j],[/\(bb(10);/i],[j,[I,we]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[j,[I,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[j,[I,le+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[j,[I,"webOS"]],[/crkey\/([\d\.]+)/i],[j,[I,L+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[I,"Chromium OS"],j],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[I,j],[/(sunos) ?([\w\.\d]*)/i],[[I,"Solaris"],j],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[I,j]]},Ee=function(te,ie){if(typeof te===C&&(ie=te,te=o),!(this instanceof Ee))return new Ee(te,ie).getResult();var ee=te||(typeof n!==T&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:d),Te=ie?U(Ie,ie):Ie;return this.getBrowser=function(){var Se={};return Se[I]=o,Se[j]=o,k.call(Se,ee,Te.browser),Se.major=Ue(Se.version),Se},this.getCPU=function(){var Se={};return Se[N]=o,k.call(Se,ee,Te.cpu),Se},this.getDevice=function(){var Se={};return Se[W]=o,Se[w]=o,Se[S]=o,k.call(Se,ee,Te.device),Se},this.getEngine=function(){var Se={};return Se[I]=o,Se[j]=o,k.call(Se,ee,Te.engine),Se},this.getOS=function(){var Se={};return Se[I]=o,Se[j]=o,k.call(Se,ee,Te.os),Se},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ee},this.setUA=function(Se){return ee=typeof Se===h&&Se.length>ye?re(Se,ye):Se,this},this.setUA(ee),this};Ee.VERSION=s,Ee.BROWSER=M([I,j,F]),Ee.CPU=M([N]),Ee.DEVICE=M([w,W,S,K,z,J,B,be,X]),Ee.ENGINE=Ee.OS=M([I,j]),r.exports&&(i=r.exports=Ee),i.UAParser=Ee;var pe=typeof n!==T&&(n.jQuery||n.Zepto);if(pe&&!pe.ua){var G=new Ee;pe.ua=G.getResult(),pe.ua.get=function(){return G.getUA()},pe.ua.set=function(te){G.setUA(te);var ie=G.getResult();for(var ee in ie)pe.ua[ee]=ie[ee]}}})(typeof window=="object"?window:oo)})(vo,vo.exports);var ZA=vo.exports;const Mn=Il(ZA)(),vs=Mn.os.name,qA=vs&&vs.toLowerCase().indexOf("android")>=0,JA=vs&&vs.toLowerCase().indexOf("ios")>=0,Vt=Mn.device.type==="mobile"||qA||JA;function go(r=0,i){r=Math.floor(r)||0;let n=0;const o=r%60;if(i===!0||typeof i>"u"&&r>=3600){const s=Math.floor(r/3600);return n=Math.floor(r%3600/60),`${s>=10?s:`0${s}`}:${n>=10?n:`0${n}`}:${o>=10?o:`0${o}`}`}else return n=Math.floor(r/60),`${n>=10?n:`0${n}`}:${o>=10?o:`0${o}`}`}const e0="kwai-p";let eu=Tl.ERROR;typeof location<"u"&&(eu=lA.loadLogLevel("kwai-player-log")||Tl.ERROR,cA.setLevel(eu).setName(e0));const qr=AA.EventEmitter;(function(){try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var t0=Object.defineProperty,i0=(r,i,n)=>i in r?t0(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,gr=(r,i,n)=>(i0(r,typeof i!="symbol"?i+"":i,n),n);const mo="ControlsPlugin",r0="I18nPlugin",n0="LoggerPlugin",a0="HotkeyPlugin",s0="PlayInfoPlugin",o0="RotatePlugin",c0="PreviewPlugin",l0="MaskPlugin",u0="VRPlugin",h0="DanmakuPlugin";let mr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};gr(mr,"label"),gr(mr,"version"),gr(mr,"isSupported"),gr(class Wd extends mr{getLabel(){return Wd.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",mo),gr(class Yd extends mr{getLabel(){return Yd.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",r0),gr(class Qd extends mr{getLabel(){return Qd.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",n0),gr(class $d extends mr{getLabel(){return $d.label}},"label",a0),gr(class Xd extends mr{getLabel(){return Xd.label}},"label",s0),gr(class Zd extends mr{getLabel(){return Zd.label}},"label",o0),gr(class qd extends mr{getLabel(){return qd.label}},"label",c0),gr(class Jd extends mr{getLabel(){return Jd.label}},"label",l0),gr(class ef extends mr{getLabel(){return ef.label}},"label",u0),gr(class tf extends mr{getLabel(){return tf.label}},"label",h0);var gs,At,tu,Wn,iu,ru,bo,nu,ms={},au=[],d0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Pn(r,i){for(var n in i)r[n]=i[n];return r}function su(r){var i=r.parentNode;i&&i.removeChild(r)}function Eo(r,i,n){var o,s,d,m={};for(d in i)d=="key"?o=i[d]:d=="ref"?s=i[d]:m[d]=i[d];if(arguments.length>2&&(m.children=arguments.length>3?gs.call(arguments,2):n),typeof r=="function"&&r.defaultProps!=null)for(d in r.defaultProps)m[d]===void 0&&(m[d]=r.defaultProps[d]);return bs(r,m,o,s,null)}function bs(r,i,n,o,s){var d={type:r,props:i,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s==null?++tu:s};return s==null&&At.vnode!=null&&At.vnode(d),d}function ji(r){return r.children}function wn(r,i){this.props=r,this.context=i}function La(r,i){if(i==null)return r.__?La(r.__,r.__.__k.indexOf(r)+1):null;for(var n;i<r.__k.length;i++)if((n=r.__k[i])!=null&&n.__e!=null)return n.__e;return typeof r.type=="function"?La(r):null}function ou(r){var i,n;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,i=0;i<r.__k.length;i++)if((n=r.__k[i])!=null&&n.__e!=null){r.__e=r.__c.base=n.__e;break}return ou(r)}}function yo(r){(!r.__d&&(r.__d=!0)&&Wn.push(r)&&!Es.__r++||iu!==At.debounceRendering)&&((iu=At.debounceRendering)||ru)(Es)}function Es(){var r,i,n,o,s,d,m,A;for(Wn.sort(bo);r=Wn.shift();)r.__d&&(i=Wn.length,o=void 0,s=void 0,m=(d=(n=r).__v).__e,(A=n.__P)&&(o=[],(s=Pn({},d)).__v=d.__v+1,Co(A,d,s,n.__n,A.ownerSVGElement!==void 0,d.__h!=null?[m]:null,o,m==null?La(d):m,d.__h),_u(o,d),d.__e!=m&&ou(d)),Wn.length>i&&Wn.sort(bo));Es.__r=0}function cu(r,i,n,o,s,d,m,A,T,C){var h,F,w,I,S,W,j,N=o&&o.__k||au,K=N.length;for(n.__k=[],h=0;h<i.length;h++)if((I=n.__k[h]=(I=i[h])==null||typeof I=="boolean"||typeof I=="function"?null:typeof I=="string"||typeof I=="number"||typeof I=="bigint"?bs(null,I,null,null,I):Array.isArray(I)?bs(ji,{children:I},null,null,null):I.__b>0?bs(I.type,I.props,I.key,I.ref?I.ref:null,I.__v):I)!=null){if(I.__=n,I.__b=n.__b+1,(w=N[h])===null||w&&I.key==w.key&&I.type===w.type)N[h]=void 0;else for(F=0;F<K;F++){if((w=N[F])&&I.key==w.key&&I.type===w.type){N[F]=void 0;break}w=null}Co(r,I,w=w||ms,s,d,m,A,T,C),S=I.__e,(F=I.ref)&&w.ref!=F&&(j||(j=[]),w.ref&&j.push(w.ref,null,I),j.push(F,I.__c||S,I)),S!=null?(W==null&&(W=S),typeof I.type=="function"&&I.__k===w.__k?I.__d=T=lu(I,T,r):T=uu(r,I,w,N,S,T),typeof n.type=="function"&&(n.__d=T)):T&&w.__e==T&&T.parentNode!=r&&(T=La(w))}for(n.__e=W,h=K;h--;)N[h]!=null&&(typeof n.type=="function"&&N[h].__e!=null&&N[h].__e==n.__d&&(n.__d=hu(o).nextSibling),vu(N[h],N[h]));if(j)for(h=0;h<j.length;h++)Au(j[h],j[++h],j[++h])}function lu(r,i,n){for(var o,s=r.__k,d=0;s&&d<s.length;d++)(o=s[d])&&(o.__=r,i=typeof o.type=="function"?lu(o,i,n):uu(n,o,o,s,o.__e,i));return i}function ys(r,i){return i=i||[],r==null||typeof r=="boolean"||(Array.isArray(r)?r.some(function(n){ys(n,i)}):i.push(r)),i}function uu(r,i,n,o,s,d){var m,A,T;if(i.__d!==void 0)m=i.__d,i.__d=void 0;else if(n==null||s!=d||s.parentNode==null)e:if(d==null||d.parentNode!==r)r.appendChild(s),m=null;else{for(A=d,T=0;(A=A.nextSibling)&&T<o.length;T+=1)if(A==s)break e;r.insertBefore(s,d),m=d}return m!==void 0?m:s.nextSibling}function hu(r){var i,n,o;if(r.type==null||typeof r.type=="string")return r.__e;if(r.__k){for(i=r.__k.length-1;i>=0;i--)if((n=r.__k[i])&&(o=hu(n)))return o}return null}function f0(r,i,n,o,s){var d;for(d in n)d==="children"||d==="key"||d in i||Cs(r,d,null,n[d],o);for(d in i)s&&typeof i[d]!="function"||d==="children"||d==="key"||d==="value"||d==="checked"||n[d]===i[d]||Cs(r,d,i[d],n[d],o)}function du(r,i,n){i[0]==="-"?r.setProperty(i,n==null?"":n):r[i]=n==null?"":typeof n!="number"||d0.test(i)?n:n+"px"}function Cs(r,i,n,o,s){var d;e:if(i==="style")if(typeof n=="string")r.style.cssText=n;else{if(typeof o=="string"&&(r.style.cssText=o=""),o)for(i in o)n&&i in n||du(r.style,i,"");if(n)for(i in n)o&&n[i]===o[i]||du(r.style,i,n[i])}else if(i[0]==="o"&&i[1]==="n")d=i!==(i=i.replace(/Capture$/,"")),i=i.toLowerCase()in r?i.toLowerCase().slice(2):i.slice(2),r.l||(r.l={}),r.l[i+d]=n,n?o||r.addEventListener(i,d?pu:fu,d):r.removeEventListener(i,d?pu:fu,d);else if(i!=="dangerouslySetInnerHTML"){if(s)i=i.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(i!=="width"&&i!=="height"&&i!=="href"&&i!=="list"&&i!=="form"&&i!=="tabIndex"&&i!=="download"&&i in r)try{r[i]=n==null?"":n;break e}catch(m){}typeof n=="function"||(n==null||n===!1&&i[4]!=="-"?r.removeAttribute(i):r.setAttribute(i,n))}}function fu(r){return this.l[r.type+!1](At.event?At.event(r):r)}function pu(r){return this.l[r.type+!0](At.event?At.event(r):r)}function Co(r,i,n,o,s,d,m,A,T){var C,h,F,w,I,S,W,j,N,K,z,B,J,be,X,ye=i.type;if(i.constructor!==void 0)return null;n.__h!=null&&(T=n.__h,A=i.__e=n.__e,i.__h=null,d=[A]),(C=At.__b)&&C(i);try{e:if(typeof ye=="function"){if(j=i.props,N=(C=ye.contextType)&&o[C.__c],K=C?N?N.props.value:C.__:o,n.__c?W=(h=i.__c=n.__c).__=h.__E:("prototype"in ye&&ye.prototype.render?i.__c=h=new ye(j,K):(i.__c=h=new wn(j,K),h.constructor=ye,h.render=_0),N&&N.sub(h),h.props=j,h.state||(h.state={}),h.context=K,h.__n=o,F=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),ye.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Pn({},h.__s)),Pn(h.__s,ye.getDerivedStateFromProps(j,h.__s))),w=h.props,I=h.state,h.__v=i,F)ye.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(ye.getDerivedStateFromProps==null&&j!==w&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(j,K),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(j,h.__s,K)===!1||i.__v===n.__v){for(i.__v!==n.__v&&(h.props=j,h.state=h.__s,h.__d=!1),h.__e=!1,i.__e=n.__e,i.__k=n.__k,i.__k.forEach(function(Be){Be&&(Be.__=i)}),z=0;z<h._sb.length;z++)h.__h.push(h._sb[z]);h._sb=[],h.__h.length&&m.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(j,h.__s,K),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(w,I,S)})}if(h.context=K,h.props=j,h.__P=r,B=At.__r,J=0,"prototype"in ye&&ye.prototype.render){for(h.state=h.__s,h.__d=!1,B&&B(i),C=h.render(h.props,h.state,h.context),be=0;be<h._sb.length;be++)h.__h.push(h._sb[be]);h._sb=[]}else do h.__d=!1,B&&B(i),C=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++J<25);h.state=h.__s,h.getChildContext!=null&&(o=Pn(Pn({},o),h.getChildContext())),F||h.getSnapshotBeforeUpdate==null||(S=h.getSnapshotBeforeUpdate(w,I)),X=C!=null&&C.type===ji&&C.key==null?C.props.children:C,cu(r,Array.isArray(X)?X:[X],i,n,o,s,d,m,A,T),h.base=i.__e,i.__h=null,h.__h.length&&m.push(h),W&&(h.__E=h.__=null),h.__e=!1}else d==null&&i.__v===n.__v?(i.__k=n.__k,i.__e=n.__e):i.__e=p0(n.__e,i,n,o,s,d,m,T);(C=At.diffed)&&C(i)}catch(Be){i.__v=null,(T||d!=null)&&(i.__e=A,i.__h=!!T,d[d.indexOf(A)]=null),At.__e(Be,i,n)}}function _u(r,i){At.__c&&At.__c(i,r),r.some(function(n){try{r=n.__h,n.__h=[],r.some(function(o){o.call(n)})}catch(o){At.__e(o,n.__v)}})}function p0(r,i,n,o,s,d,m,A){var T,C,h,F=n.props,w=i.props,I=i.type,S=0;if(I==="svg"&&(s=!0),d!=null){for(;S<d.length;S++)if((T=d[S])&&"setAttribute"in T==!!I&&(I?T.localName===I:T.nodeType===3)){r=T,d[S]=null;break}}if(r==null){if(I===null)return document.createTextNode(w);r=s?document.createElementNS("http://www.w3.org/2000/svg",I):document.createElement(I,w.is&&w),d=null,A=!1}if(I===null)F===w||A&&r.data===w||(r.data=w);else{if(d=d&&gs.call(r.childNodes),C=(F=n.props||ms).dangerouslySetInnerHTML,h=w.dangerouslySetInnerHTML,!A){if(d!=null)for(F={},S=0;S<r.attributes.length;S++)F[r.attributes[S].name]=r.attributes[S].value;(h||C)&&(h&&(C&&h.__html==C.__html||h.__html===r.innerHTML)||(r.innerHTML=h&&h.__html||""))}if(f0(r,w,F,s,A),h)i.__k=[];else if(S=i.props.children,cu(r,Array.isArray(S)?S:[S],i,n,o,s&&I!=="foreignObject",d,m,d?d[0]:n.__k&&La(n,0),A),d!=null)for(S=d.length;S--;)d[S]!=null&&su(d[S]);A||("value"in w&&(S=w.value)!==void 0&&(S!==r.value||I==="progress"&&!S||I==="option"&&S!==F.value)&&Cs(r,"value",S,F.value,!1),"checked"in w&&(S=w.checked)!==void 0&&S!==r.checked&&Cs(r,"checked",S,F.checked,!1))}return r}function Au(r,i,n){try{typeof r=="function"?r(i):r.current=i}catch(o){At.__e(o,n)}}function vu(r,i,n){var o,s;if(At.unmount&&At.unmount(r),(o=r.ref)&&(o.current&&o.current!==r.__e||Au(o,null,i)),(o=r.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(d){At.__e(d,i)}o.base=o.__P=null,r.__c=void 0}if(o=r.__k)for(s=0;s<o.length;s++)o[s]&&vu(o[s],i,n||typeof r.type!="function");n||r.__e==null||su(r.__e),r.__=r.__e=r.__d=void 0}function _0(r,i,n){return this.constructor(r,n)}function Sa(r,i,n){var o,s,d;At.__&&At.__(r,i),s=(o=typeof n=="function")?null:n&&n.__k||i.__k,d=[],Co(i,r=(!o&&n||i).__k=Eo(ji,null,[r]),s||ms,ms,i.ownerSVGElement!==void 0,!o&&n?[n]:s?null:i.firstChild?gs.call(i.childNodes):null,d,!o&&n?n:s?s.__e:i.firstChild,o),_u(d,r)}function Oa(r,i){var n={__c:i="__cC"+nu++,__:r,Consumer:function(o,s){return o.children(s)},Provider:function(o){var s,d;return this.getChildContext||(s=[],(d={})[i]=this,this.getChildContext=function(){return d},this.shouldComponentUpdate=function(m){this.props.value!==m.value&&s.some(function(A){A.__e=!0,yo(A)})},this.sub=function(m){s.push(m);var A=m.componentWillUnmount;m.componentWillUnmount=function(){s.splice(s.indexOf(m),1),A&&A.call(m)}}),o.children}};return n.Provider.__=n.Consumer.contextType=n}gs=au.slice,At={__e:function(r,i,n,o){for(var s,d,m;i=i.__;)if((s=i.__c)&&!s.__)try{if((d=s.constructor)&&d.getDerivedStateFromError!=null&&(s.setState(d.getDerivedStateFromError(r)),m=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(r,o||{}),m=s.__d),m)return s.__E=s}catch(A){r=A}throw r}},tu=0,wn.prototype.setState=function(r,i){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Pn({},this.state),typeof r=="function"&&(r=r(Pn({},n),this.props)),r&&Pn(n,r),r!=null&&this.__v&&(i&&this._sb.push(i),yo(this))},wn.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),yo(this))},wn.prototype.render=ji,Wn=[],ru=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bo=function(r,i){return r.__v.__b-i.__v.__b},Es.__r=0,nu=0;var A0=0;function De(r,i,n,o,s,d){var m,A,T={};for(A in i)A=="ref"?m=i[A]:T[A]=i[A];var C={type:r,props:T,key:n,ref:m,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--A0,__source:s,__self:d};if(typeof r=="function"&&(m=r.defaultProps))for(A in m)T[A]===void 0&&(T[A]=m[A]);return At.vnode&&At.vnode(C),C}var _a,li,To,gu,Na=0,mu=[],Ts=[],bu=At.__b,Eu=At.__r,yu=At.diffed,Cu=At.__c,Tu=At.unmount;function xa(r,i){At.__h&&At.__h(li,r,Na||i),Na=0;var n=li.__H||(li.__H={__:[],__h:[]});return r>=n.__.length&&n.__.push({__V:Ts}),n.__[r]}function st(r){return Na=1,v0(Ru,r)}function v0(r,i,n){var o=xa(_a++,2);if(o.t=r,!o.__c&&(o.__=[n?n(i):Ru(void 0,i),function(A){var T=o.__N?o.__N[0]:o.__[0],C=o.t(T,A);T!==C&&(o.__N=[C,o.__[1]],o.__c.setState({}))}],o.__c=li,!li.u)){var s=function(A,T,C){if(!o.__c.__H)return!0;var h=o.__c.__H.__.filter(function(w){return w.__c});if(h.every(function(w){return!w.__N}))return!d||d.call(this,A,T,C);var F=!1;return h.forEach(function(w){if(w.__N){var I=w.__[0];w.__=w.__N,w.__N=void 0,I!==w.__[0]&&(F=!0)}}),!(!F&&o.__c.props===A)&&(!d||d.call(this,A,T,C))};li.u=!0;var d=li.shouldComponentUpdate,m=li.componentWillUpdate;li.componentWillUpdate=function(A,T,C){if(this.__e){var h=d;d=void 0,s(A,T,C),d=h}m&&m.call(this,A,T,C)},li.shouldComponentUpdate=s}return o.__N||o.__}function jt(r,i){var n=xa(_a++,3);!At.__s&&Ro(n.__H,i)&&(n.__=r,n.i=i,li.__H.__h.push(n))}function Un(r,i){var n=xa(_a++,4);!At.__s&&Ro(n.__H,i)&&(n.__=r,n.i=i,li.__h.push(n))}function Ot(r){return Na=5,Ii(function(){return{current:r}},[])}function Ii(r,i){var n=xa(_a++,7);return Ro(n.__H,i)?(n.__V=r(),n.i=i,n.__h=r,n.__V):n.__}function br(r,i){return Na=8,Ii(function(){return r},i)}function or(r){var i=li.context[r.__c],n=xa(_a++,9);return n.c=r,i?(n.__==null&&(n.__=!0,i.sub(li)),i.props.value):r.__}function g0(){for(var r;r=mu.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(Is),r.__H.__h.forEach(Io),r.__H.__h=[]}catch(i){r.__H.__h=[],At.__e(i,r.__v)}}At.__b=function(r){li=null,bu&&bu(r)},At.__r=function(r){Eu&&Eu(r),_a=0;var i=(li=r.__c).__H;i&&(To===li?(i.__h=[],li.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Ts,n.__N=n.i=void 0})):(i.__h.forEach(Is),i.__h.forEach(Io),i.__h=[])),To=li},At.diffed=function(r){yu&&yu(r);var i=r.__c;i&&i.__H&&(i.__H.__h.length&&(mu.push(i)!==1&&gu===At.requestAnimationFrame||((gu=At.requestAnimationFrame)||m0)(g0)),i.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Ts&&(n.__=n.__V),n.i=void 0,n.__V=Ts})),To=li=null},At.__c=function(r,i){i.some(function(n){try{n.__h.forEach(Is),n.__h=n.__h.filter(function(o){return!o.__||Io(o)})}catch(o){i.some(function(s){s.__h&&(s.__h=[])}),i=[],At.__e(o,n.__v)}}),Cu&&Cu(r,i)},At.unmount=function(r){Tu&&Tu(r);var i,n=r.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{Is(o)}catch(s){i=s}}),n.__H=void 0,i&&At.__e(i,n.__v))};var Iu=typeof requestAnimationFrame=="function";function m0(r){var i,n=function(){clearTimeout(o),Iu&&cancelAnimationFrame(i),setTimeout(r)},o=setTimeout(n,100);Iu&&(i=requestAnimationFrame(n))}function Is(r){var i=li,n=r.__c;typeof n=="function"&&(r.__c=void 0,n()),li=i}function Io(r){var i=li;r.__c=r.__(),li=i}function Ro(r,i){return!r||r.length!==i.length||i.some(function(n,o){return n!==r[o]})}function Ru(r,i){return typeof i=="function"?i(r):i}function wu(r,i){for(var n in i)r[n]=i[n];return r}function Du(r,i){for(var n in r)if(n!=="__source"&&!(n in i))return!0;for(var o in i)if(o!=="__source"&&r[o]!==i[o])return!0;return!1}function Lu(r){this.props=r}(Lu.prototype=new wn).isPureReactComponent=!0,Lu.prototype.shouldComponentUpdate=function(r,i){return Du(this.props,r)||Du(this.state,i)};var Su=At.__b;At.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),Su&&Su(r)};var b0=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Rs(r){function i(n){var o=wu({},n);return delete o.ref,r(o,n.ref||null)}return i.$$typeof=b0,i.render=i,i.prototype.isReactComponent=i.__f=!0,i.displayName="ForwardRef("+(r.displayName||r.name)+")",i}var E0=At.__e;At.__e=function(r,i,n,o){if(r.then){for(var s,d=i;d=d.__;)if((s=d.__c)&&s.__c)return i.__e==null&&(i.__e=n.__e,i.__k=n.__k),s.__c(r,i)}E0(r,i,n,o)};var Ou=At.unmount;function Nu(r,i,n){return r&&(r.__c&&r.__c.__H&&(r.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),r.__c.__H=null),(r=wu({},r)).__c!=null&&(r.__c.__P===n&&(r.__c.__P=i),r.__c=null),r.__k=r.__k&&r.__k.map(function(o){return Nu(o,i,n)})),r}function xu(r,i,n){return r&&(r.__v=null,r.__k=r.__k&&r.__k.map(function(o){return xu(o,i,n)}),r.__c&&r.__c.__P===i&&(r.__e&&n.insertBefore(r.__e,r.__d),r.__c.__e=!0,r.__c.__P=n)),r}function wo(){this.__u=0,this.t=null,this.__b=null}function ku(r){var i=r.__.__c;return i&&i.__a&&i.__a(r)}function ws(){this.u=null,this.o=null}At.unmount=function(r){var i=r.__c;i&&i.__R&&i.__R(),i&&r.__h===!0&&(r.type=null),Ou&&Ou(r)},(wo.prototype=new wn).__c=function(r,i){var n=i.__c,o=this;o.t==null&&(o.t=[]),o.t.push(n);var s=ku(o.__v),d=!1,m=function(){d||(d=!0,n.__R=null,s?s(A):A())};n.__R=m;var A=function(){if(!--o.__u){if(o.state.__a){var C=o.state.__a;o.__v.__k[0]=xu(C,C.__c.__P,C.__c.__O)}var h;for(o.setState({__a:o.__b=null});h=o.t.pop();)h.forceUpdate()}},T=i.__h===!0;o.__u++||T||o.setState({__a:o.__b=o.__v.__k[0]}),r.then(m,m)},wo.prototype.componentWillUnmount=function(){this.t=[]},wo.prototype.render=function(r,i){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Nu(this.__b,n,o.__O=o.__P)}this.__b=null}var s=i.__a&&Eo(ji,null,r.fallback);return s&&(s.__h=null),[Eo(ji,null,i.__a?null:r.children),s]};var Mu=function(r,i,n){if(++n[1]===n[0]&&r.o.delete(i),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(n=r.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;r.u=n=n[2]}};(ws.prototype=new wn).__a=function(r){var i=this,n=ku(i.__v),o=i.o.get(r);return o[0]++,function(s){var d=function(){i.props.revealOrder?(o.push(s),Mu(i,r,o)):s()};n?n(d):d()}},ws.prototype.render=function(r){this.u=null,this.o=new Map;var i=ys(r.children);r.revealOrder&&r.revealOrder[0]==="b"&&i.reverse();for(var n=i.length;n--;)this.o.set(i[n],this.u=[1,0,this.u]);return r.children},ws.prototype.componentDidUpdate=ws.prototype.componentDidMount=function(){var r=this;this.o.forEach(function(i,n){Mu(r,n,i)})};var y0=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,C0=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,T0=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,I0=/[A-Z0-9]/g,R0=typeof document!="undefined",w0=function(r){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(r)};wn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(r){Object.defineProperty(wn.prototype,r,{configurable:!0,get:function(){return this["UNSAFE_"+r]},set:function(i){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:i})}})});var Pu=At.event;function D0(){}function L0(){return this.cancelBubble}function S0(){return this.defaultPrevented}At.event=function(r){return Pu&&(r=Pu(r)),r.persist=D0,r.isPropagationStopped=L0,r.isDefaultPrevented=S0,r.nativeEvent=r};var O0={enumerable:!1,configurable:!0,get:function(){return this.class}},Uu=At.vnode;At.vnode=function(r){typeof r.type=="string"&&function(i){var n=i.props,o=i.type,s={};for(var d in n){var m=n[d];if(!(d==="value"&&"defaultValue"in n&&m==null||R0&&d==="children"&&o==="noscript"||d==="class"||d==="className")){var A=d.toLowerCase();d==="defaultValue"&&"value"in n&&n.value==null?d="value":d==="download"&&m===!0?m="":A==="ondoubleclick"?d="ondblclick":A!=="onchange"||o!=="input"&&o!=="textarea"||w0(n.type)?A==="onfocus"?d="onfocusin":A==="onblur"?d="onfocusout":T0.test(d)?d=A:o.indexOf("-")===-1&&C0.test(d)?d=d.replace(I0,"-$&").toLowerCase():m===null&&(m=void 0):A=d="oninput",A==="oninput"&&s[d=A]&&(d="oninputCapture"),s[d]=m}}o=="select"&&s.multiple&&Array.isArray(s.value)&&(s.value=ys(n.children).forEach(function(T){T.props.selected=s.value.indexOf(T.props.value)!=-1})),o=="select"&&s.defaultValue!=null&&(s.value=ys(n.children).forEach(function(T){T.props.selected=s.multiple?s.defaultValue.indexOf(T.props.value)!=-1:s.defaultValue==T.props.value})),n.class&&!n.className?(s.class=n.class,Object.defineProperty(s,"className",O0)):(n.className&&!n.class||n.class&&n.className)&&(s.class=s.className=n.className),i.props=s}(r),r.$$typeof=y0,Uu&&Uu(r)};var Bu=At.__r;At.__r=function(r){Bu&&Bu(r),r.__c};var Vu=At.diffed;At.diffed=function(r){Vu&&Vu(r);var i=r.props,n=r.__e;n!=null&&r.type==="textarea"&&"value"in i&&i.value!==n.value&&(n.value=i.value==null?"":i.value)},function(){try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode('._controls_azwg4_1{position:absolute;display:flex;flex-direction:column;justify-content:space-between;top:0;left:0;width:100%;height:100%;font-size:24px;font-family:PingFang SC,Roboto,Noto,sans-serif;font-weight:400}._controls_azwg4_1 ._video-area_azwg4_14{position:relative;width:100%;height:100%;flex-grow:1}._controls_azwg4_1 ._video-area_azwg4_14 ._bottom-controls_azwg4_20{position:absolute;bottom:0;width:100%;display:flex;flex-direction:column;justify-content:flex-end;transition:opacity .3s ease-in}._controls_azwg4_1 ._video-area_azwg4_14 ._bottom-controls_azwg4_20 ._bottom-controls-bg_azwg4_29{position:absolute;pointer-events:none;height:6.5833333333em;width:100%;background:0 bottom repeat-x linear-gradient(rgba(0,0,0,0),rgb(0,0,0));background-size:auto 6.5833333333em;opacity:.4;border-radius:.625em}._controls_azwg4_1 ._sending-area_azwg4_39{position:relative;width:100%;display:flex;justify-content:space-between;background-color:#191a1f;align-items:center}._controls_azwg4_1 ._sending-area_azwg4_39 ._sending-area-controls_azwg4_47{width:100%;margin:.4166666667em}._controls_azwg4_1 ._button-panel_azwg4_51{display:flex;position:relative;margin:.5833333333em 1.875em 1.5833333333em;justify-content:space-between}._controls_azwg4_1 ._button-panel-left_azwg4_57,._controls_azwg4_1 ._button-panel-right_azwg4_58{height:1.5833333333em;display:flex;flex-direction:row;align-items:center}._controls_azwg4_1 ._button-panel-center_azwg4_64{display:flex;flex-direction:row;flex-grow:1;justify-content:center;align-items:center}._controls_azwg4_1 ._button-panel-center_azwg4_64>div{margin:0 .6666666667em;width:100%}._controls_azwg4_1 ._panel-button-margins-left_azwg4_75{margin-left:1.25em}._controls_azwg4_1 ._panel-button-margins-right_azwg4_78{margin-right:1.25em}._controls_azwg4_1 ._panel-button-wrapper_azwg4_81{display:flex;align-items:center;justify-content:center;position:relative;line-height:1.5833333333em;min-width:1.5833333333em;height:1.5833333333em;color:rgba(255,255,255,.9);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:transparent}._controls_azwg4_1 ._panel-button-wrapper_azwg4_81._disabled_azwg4_97,._controls_azwg4_1 ._panel-button-wrapper_azwg4_81._disabled_azwg4_97:hover{opacity:.3;cursor:default}._controls_azwg4_1 ._panel-button-wrapper_azwg4_81 ._panel-button_azwg4_75{-webkit-tap-highlight-color:transparent;text-align:center}._controls_azwg4_1 ._panel-button-wrapper_azwg4_81 ._panel-button-text_azwg4_105{font-weight:400;font-size:.9166666667em;line-height:1;text-align:center}._controls_azwg4_1 ._live-shift_azwg4_111._disabled_azwg4_97{opacity:.3}._controls_azwg4_1 ._live-shift-chips_azwg4_114{display:flex;align-items:center;justify-content:center;border-radius:.3333333333em;border:2px solid rgba(255,255,255,.4);padding:0 .4166666667em 0 0;height:1.9166666667em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;word-break:keep-all}._controls_azwg4_1 ._live-shift-button_azwg4_128{display:flex;align-items:center;justify-content:center;border-radius:.3333333333em;border:2px solid rgba(255,255,255,.4);padding:0 .4166666667em 0 0;height:1.9166666667em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;word-break:keep-all;cursor:pointer}._controls_azwg4_1 ._live-shift-button_azwg4_128._disabled_azwg4_97{cursor:default}._controls_azwg4_1 ._panel-button-icon_azwg4_146{width:1.5833333333em;height:1.5833333333em}._controls_azwg4_1 ._panel-button-icon-plugin_azwg4_150{height:1.5833333333em}._controls_azwg4_1 ._panel-button-icon-plugin_azwg4_150 svg{width:1.5833333333em;height:1.5833333333em}._controls_azwg4_1 ._current-time-display_azwg4_157{margin-left:.9166666667em;font-family:Consolas,Monaco,monospace}._controls_azwg4_1 ._current-time-display_azwg4_157>div{font-weight:500;font-size:.9166666667em;color:#fff}._controls_azwg4_1 ._time-remaining-display_azwg4_166{margin-left:.4166666667em;font-family:Consolas,Monaco,monospace}._controls_azwg4_1 ._time-remaining-display_azwg4_166>div{font-weight:500;font-size:.9166666667em;color:rgba(255,255,255,.4);white-space:nowrap}._controls_azwg4_1 ._timeline_azwg4_176{display:block;margin:0 1.875em;padding:.25em 0 .2083333333em;cursor:pointer}._controls_azwg4_1 ._timeline_azwg4_176 ._thumb_azwg4_182{opacity:0}._controls_azwg4_1 ._timeline_azwg4_176 ._thumb-drag_azwg4_185{opacity:1}._controls_azwg4_1 ._segmented-track_azwg4_188,._controls_azwg4_1 ._segmented-vertical-track_azwg4_189{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._controls_azwg4_1 ._segmented-track_azwg4_188._disabled_azwg4_97,._controls_azwg4_1 ._segmented-track_azwg4_188._disabled_azwg4_97:hover,._controls_azwg4_1 ._segmented-vertical-track_azwg4_189._disabled_azwg4_97,._controls_azwg4_1 ._segmented-vertical-track_azwg4_189._disabled_azwg4_97:hover{cursor:default}._controls_azwg4_1 ._segmented-vertical-track_azwg4_189{height:100%;width:100%}._controls_azwg4_1 ._thumb_azwg4_182,._controls_azwg4_1 ._thumb-vertical_azwg4_206{position:absolute;top:50%;width:.625em;height:.625em;background:rgb(255,255,255);border-radius:50%;transform:translateY(-50%);transition:opacity .3s ease .3s}._controls_azwg4_1 ._thumb-vertical_azwg4_206{left:0;right:0;margin:0 auto}._controls_azwg4_1 ._segment-background_azwg4_221,._controls_azwg4_1 ._segment-vertical-background_azwg4_222{height:.1666666667em;background-color:rgba(255,255,255,.3)}._controls_azwg4_1 ._segment-vertical-background_azwg4_222{width:.1666666667em;height:100%;margin:0 auto}._controls_azwg4_1 ._segment-highlight-before_azwg4_231,._controls_azwg4_1 ._segment-vertical-highlight-before_azwg4_232{position:absolute;height:.1666666667em;background:rgba(255,255,255,.54)}._controls_azwg4_1 ._segment-highlight-after_azwg4_237,._controls_azwg4_1 ._segment-vertical-highlight-after_azwg4_238{position:absolute;height:.1666666667em;background:rgb(255,255,255)}._controls_azwg4_1 ._segment-vertical-highlight-before_azwg4_232,._controls_azwg4_1 ._segment-vertical-highlight-after_azwg4_238{width:.1666666667em;height:100%;bottom:0}._controls_azwg4_1 ._overlay_azwg4_249{position:absolute;top:0;left:0;width:100%;height:100%;background:center no-repeat;background-size:contain}._controls_azwg4_1 ._overflow_azwg4_258{background-color:rgba(0,0,0,.9);border-radius:4px;position:absolute;right:0;bottom:2.2916666667em;z-index:20;max-height:10.4166666667em;overflow-x:hidden;white-space:nowrap;padding:.375em 0;transition:transform .3s ease-out,opacity .2s linear;transform-origin:right bottom;opacity:1;transform:scale(1);color:#fff}._controls_azwg4_1 ._overflow_azwg4_258._closed_azwg4_275{transform:scale(0);transform-origin:right bottom;opacity:0}._controls_azwg4_1 ._overflow-item_azwg4_280{padding:0 0 0 1.2857142857em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;margin:.375em 0}@media (hover: hover){._controls_azwg4_1 ._error-retry_azwg4_293:hover{border:1px solid #333;cursor:pointer}._controls_azwg4_1 ._overflow-item_azwg4_280:hover{background-color:#212121}._controls_azwg4_1 ._playback-rate_azwg4_300:hover{color:#326bfb}._controls_azwg4_1 ._timeline_azwg4_176:hover ._thumb_azwg4_182{opacity:1}}._controls_azwg4_1 ._overflow-icon_azwg4_307{width:1.5833333333em;height:1.5833333333em;margin-right:.9166666667em;background-size:contain}._controls_azwg4_1 ._overflow-checkbox_azwg4_313{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75em;height:.75em;margin:0 .625em;border:none;outline:none}._controls_azwg4_1 ._overflow-checkbox_azwg4_313:checked{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDpub25lO30KCS5zdDF7ZmlsbDojNDI4NUY0O30KPC9zdHlsZT4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTAsMGgyNHYyNEgwVjB6Ii8+CjxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik05LDE2LjJMNC44LDEybC0xLjQsMS40TDksMTlMMjEsN2wtMS40LTEuNEw5LDE2LjJ6Ii8+Cjwvc3ZnPgo=)}._controls_azwg4_1 ._overflow-content_azwg4_326{flex-grow:1;display:flex;align-items:center;justify-content:space-between;line-height:1.5714285714em;font-size:.5833333333em;padding:.5em 0;font-weight:400}._controls_azwg4_1 ._loading_azwg4_336{position:absolute;left:50%;top:50%;right:0;bottom:0;pointer-events:none;overflow:hidden;transform:translate(-50%,-50%);width:25%;height:25%;max-width:7.5em;max-height:3.3333333333em;background-color:rgba(0,0,0,.5);border-radius:4px;display:flex;justify-content:center;align-items:center}._controls_azwg4_1 ._spinner_azwg4_355{-webkit-animation:_container-rotate_azwg4_1 1568ms linear infinite;animation:_container-rotate_azwg4_1 1568ms linear infinite;height:100%;width:100%}._controls_azwg4_1 ._spinner_azwg4_355:after{position:absolute;content:" ";top:-25%;left:-25%;width:150%;height:150%}._controls_azwg4_1 ._spinner_azwg4_355:before{position:absolute;content:" ";top:2px;left:2px;right:2px;bottom:2px;border-radius:100%}._controls_azwg4_1 ._kwai-layer_azwg4_378{width:100%;height:100%;white-space:nowrap;-webkit-animation-name:_fill-unfill-rotate_azwg4_1;animation-name:_fill-unfill-rotate_azwg4_1;-webkit-animation-duration:5332ms;animation-duration:5332ms;-webkit-animation-timing-function:cubic-bezier(.4,0,.2,1);animation-timing-function:cubic-bezier(.4,0,.2,1);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}._controls_azwg4_1 ._spinner-mask-1_azwg4_391{left:-50%}._controls_azwg4_1 ._spinner-mask-2_azwg4_392{right:-50%}._controls_azwg4_1 ._spinner-mask-1_azwg4_391,._controls_azwg4_1 ._spinner-mask-2_azwg4_392{position:absolute;width:100%;height:200%;top:-50%;overflow:hidden}._controls_azwg4_1 ._loading-spinner-frame_azwg4_427,._controls_azwg4_1 ._loading-panel-spinner-frame_azwg4_428{height:100%;width:25%;min-width:20px;overflow:hidden}._controls_azwg4_1 ._loading-spinner-mask-2-bg_azwg4_435{-webkit-animation-name:_mask-2-spin_azwg4_1;animation-name:_mask-2-spin_azwg4_1}._controls_azwg4_1 ._loading_azwg4_336 ._loading-spinner-mask-2-bg_azwg4_435{left:-100%;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMC8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgaWQ9ImJvZHlfMSIgd2lkdGg9IjEwMjQiIGhlaWdodD0iNzY4Ij4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy45MTgzNjc0IDAgMCAzLjkxODM2NzQgMTI4LjAwMDAzIC0wKSI+CiAgICA8cGF0aCBzdHJva2Utd2lkdGg9IjYiIGQ9Ik05OCA0OUw5OCA1M0MgNzMuMSA1MyA1MyA3My4xIDUzIDk4QyA1MyAxMTYgNjMuNiAxMzEuNiA3OC45IDEzOC44TDc4LjkgMTM4LjhMNzcuMjAwMDA1IDE0Mi40MDAwMUMgNzcuMyAxNDIuNDAwMDEgNzcuNCAxNDIuNTAwMDIgNzcuNTAwMDEgMTQyLjUwMDAyQyA3Ny40MDAwMSAxNDIuNTAwMDIgNzcuMzAwMDEgMTQyLjQwMDAxIDc3LjIwMDAwNSAxNDIuNDAwMDFDIDYwLjUgMTM0LjUgNDkgMTE3LjYgNDkgOThDIDQ5IDcwLjkgNzAuOSA0OSA5OCA0OXoiIHN0cm9rZT0ibm9uZSIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJub256ZXJvIiAvPgo8L2c+Cjwvc3ZnPg==);background-position:right center}._controls_azwg4_1 ._loading-spinner-mask-1-bg_azwg4_434{-webkit-animation-name:_mask-1-spin_azwg4_1;animation-name:_mask-1-spin_azwg4_1}._controls_azwg4_1 ._loading-spinner-mask-1-bg_azwg4_434,._controls_azwg4_1 ._loading-spinner-mask-2-bg_azwg4_435{position:absolute;background-repeat:no-repeat;width:200%;height:100%;top:0;-webkit-animation-duration:1333ms;animation-duration:1333ms;-webkit-animation-timing-function:cubic-bezier(.4,0,.2,1);animation-timing-function:cubic-bezier(.4,0,.2,1);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}._controls_azwg4_1 ._loading_azwg4_336 ._loading-spinner-mask-1-bg_azwg4_434{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxOTYgMTk2IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxOTYgMTk2OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxwYXRoIGZpbGw9IiNmZmYiIHN0cm9rZS13aWR0aD0iNiIgZD0iTTE0Nyw5OGMwLDE5LjYtMTEuNSwzNi41LTI4LjIsNDQuNGwwLDBjLTAuMSwwLTAuMiwwLjEtMC4zLDAuMQoJYzAuMSwwLDAuMi0wLjEsMC4zLTAuMWwtMS43LTMuNkMxMzIuNCwxMzEuNiwxNDMsMTE2LDE0Myw5OGMwLTI0LjktMjAuMS00NS00NS00NXYtNEMxMjUuMSw0OSwxNDcsNzAuOSwxNDcsOTh6Ii8+Cjwvc3ZnPgo=);background-position:left center}._controls_azwg4_1 ._context-menu_azwg4_508{position:absolute;left:0;top:0;color:#fff;z-index:20;background-color:rgba(0,0,0,.9);border-radius:4px}._controls_azwg4_1 ._context-menu-list_azwg4_517{padding:0}._controls_azwg4_1 ._context-menu-item_azwg4_520{cursor:pointer;display:flex;align-items:center;justify-content:space-between;margin:.375em 0}._controls_azwg4_1 ._context-menu-item_azwg4_520:hover{background-color:rgba(255,255,255,.1)}._controls_azwg4_1 ._context-menu-label_azwg4_530{vertical-align:middle;padding:.5em 1.7142857143em;font-weight:400;font-size:.5833333333em;line-height:1.5714285714em;white-space:nowrap}._controls_azwg4_1 ._context-menu-checkbox_azwg4_538{margin:0 .75em 0 0;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:.75em;height:.75em;cursor:pointer}._controls_azwg4_1 ._context-menu-checkbox_azwg4_538:checked{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjY2MTczNTA3OTc2IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjQ0MjUiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjUwIiBoZWlnaHQ9IjI1MCI+PHBhdGggZD0iTTgxNy43MjggMTk4LjcybDExMS43NDQgMTE0LjU2LTU0NS4yMTYgNTMyLjEyOC0yODUuOTItMjczLjAyNCAxMTAuNTI4LTExNS43MTIgMTc0LjE3NiAxNjYuMzM2eiIgcC1pZD0iNDQyNiIgZmlsbD0iI2ZmZmZmZiI+PC9wYXRoPjwvc3ZnPg==);background-size:contain}@-webkit-keyframes _container-rotate_azwg4_1{to{transform:rotate(360deg)}}@keyframes _container-rotate_azwg4_1{to{transform:rotate(360deg)}}@-webkit-keyframes _fill-unfill-rotate_azwg4_1{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}to{transform:rotate(1080deg)}}@keyframes _fill-unfill-rotate_azwg4_1{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}to{transform:rotate(1080deg)}}@-webkit-keyframes _mask-1-spin_azwg4_1{0%{transform:rotate(157deg)}50%{transform:rotate(30deg)}to{transform:rotate(157deg)}}@keyframes _mask-1-spin_azwg4_1{0%{transform:rotate(157deg)}50%{transform:rotate(30deg)}to{transform:rotate(157deg)}}@-webkit-keyframes _mask-2-spin_azwg4_1{0%{transform:rotate(-155deg)}50%{transform:rotate(-30deg)}to{transform:rotate(-155deg)}}@keyframes _mask-2-spin_azwg4_1{0%{transform:rotate(-155deg)}50%{transform:rotate(-30deg)}to{transform:rotate(-155deg)}}._controls_azwg4_1 ._error-alert_azwg4_657{display:flex;justify-content:center;align-items:center;flex-direction:column;position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(255,255,255,.9)}._controls_azwg4_1 ._error-icon_azwg4_669{height:6.6666666667em;width:6.6666666667em;background-size:100%;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYwIiBoZWlnaHQ9IjE2MCIgdmlld0JveD0iMCAwIDE2MCAxNjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxtYXNrIGlkPSJtYXNrMF8yNV8xNTgiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNjAiIGhlaWdodD0iMTYwIj4KPHJlY3Qgd2lkdGg9IjE2MCIgaGVpZ2h0PSIxNjAiIGZpbGw9IiNEOUQ5RDkiLz4KPC9tYXNrPgo8ZyBtYXNrPSJ1cmwoI21hc2swXzI1XzE1OCkiPgo8cGF0aCBkPSJNNzMuMzk5OCA2NC44NjRDNzYuNTc3MiA2MC4yMjQ3IDgzLjQyMzEgNjAuMjI0NyA4Ni42MDA1IDY0Ljg2NEwxNDMuMDE2IDE0Ny4yMzdDMTQ2LjY1MyAxNTIuNTQ2IDE0Mi44NTEgMTU5Ljc1NyAxMzYuNDE2IDE1OS43NTdIMjMuNTg0M0MxNy4xNDkzIDE1OS43NTcgMTMuMzQ3NyAxNTIuNTQ2IDE2Ljk4MzkgMTQ3LjIzN0w3My4zOTk4IDY0Ljg2NFoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8yNV8xNTgpIi8+CjxwYXRoIGQ9Ik03Mi4zNzE3IDk0LjIwNDhDNzIuMTQwOCA5MS40MjM2IDczLjM0MDIgODguNjE2NyA3NS45MDk3IDg3LjUyNzdDNzcuMDU4MiA4Ny4wNDEgNzguMzExMSA4Ni42NjY3IDc5LjQ0ODYgODYuNjY2N0M4MC41ODYgODYuNjY2NyA4MS44Mzg5IDg3LjA0MSA4Mi45ODc0IDg3LjUyNzdDODUuNTU2OSA4OC42MTY3IDg2Ljc1NjMgOTEuNDIzNiA4Ni41MjU1IDk0LjIwNDhMODQuNTAyNSAxMTguNTgxQzg0LjI1NzcgMTIxLjUzIDgyLjQwODUgMTI0LjUzIDc5LjQ0ODYgMTI0LjUzQzc2LjQ4ODcgMTI0LjUzIDc0LjYzOTUgMTIxLjUzIDc0LjM5NDcgMTE4LjU4MUw3Mi4zNzE3IDk0LjIwNDhaIiBmaWxsPSJ1cmwoI3BhaW50MV9saW5lYXJfMjVfMTU4KSIvPgo8ZWxsaXBzZSBjeD0iNzkuMzg0IiBjeT0iMTM4LjAxNCIgcng9IjUuMDUwNDkiIHJ5PSI1LjM0NzU3IiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNMTA3LjYxNSA0Ny4xMDYxTDExMy43MjcgMzIuMjc0QzExMy45OTUgMzEuNjI1MyAxMTQuOTU0IDMxLjc3NjcgMTE1LjAwOCAzMi40NzYzTDExNi40NjcgNTEuMjA0MkMxMTYuNTAyIDUxLjY2MjggMTE2LjA3NCA1Mi4wMTkgMTE1LjYzIDUxLjg5OTlMMTEyLjIwNSA1MC45ODIzQzExMS45MTMgNTAuOTA0MSAxMTEuNjA1IDUxLjAzMTkgMTExLjQ1NSA1MS4yOTM3TDEwMy4yMjEgNjUuNjAxOUMxMDIuODg0IDY2LjE4NzUgMTAxLjk5IDY1Ljk1ODEgMTAxLjk3NiA2NS4yODI2TDEwMS42MTQgNDYuOTgxNEMxMDEuNjA1IDQ2LjUzNzcgMTAyLjAyNCA0Ni4yMDk0IDEwMi40NTMgNDYuMzI0M0wxMDYuODI2IDQ3LjQ5NkMxMDcuMTUgNDcuNTgyNyAxMDcuNDg3IDQ3LjQxNTggMTA3LjYxNSA0Ny4xMDYxWiIgZmlsbD0idXJsKCNwYWludDJfbGluZWFyXzI1XzE1OCkiLz4KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZl8yNV8xNTgpIj4KPHBhdGggZD0iTTU3LjA1MzYgNTAuNTk0OEw1My42NzEgNDIuNTA1OUM1My4zOTk1IDQxLjg1NjcgNTQuMTg4NSA0MS4yODQzIDU0LjcyMTQgNDEuNzQzOEw2Mi41NTQ4IDQ4LjQ5ODJDNjIuOTAyNCA0OC43OTc5IDYyLjg1MDMgNDkuMzUwOSA2Mi40NTI4IDQ5LjU4MDRMNjEuMDI3NyA1MC40MDMyQzYwLjc2NTQgNTAuNTU0NiA2MC42MzgyIDUwLjg2MzggNjAuNzE3OSA1MS4xNTZMNjMuMTQ2NyA2MC4wNjA4QzYzLjMyNTEgNjAuNzE0OCA2Mi41MjcxIDYxLjE4NjcgNjIuMDQgNjAuNzE1NEw1NC42OTU1IDUzLjYwOTRDNTQuMzc3MiA1My4zMDE0IDU0LjQ0MjIgNTIuNzc0NCA1NC44MjU4IDUyLjU1MjlMNTYuNzcxOSA1MS40MjkzQzU3LjA2MjQgNTEuMjYxNiA1Ny4xODMxIDUwLjkwNDIgNTcuMDUzNiA1MC41OTQ4WiIgZmlsbD0idXJsKCNwYWludDNfbGluZWFyXzI1XzE1OCkiLz4KPC9nPgo8ZyBmaWx0ZXI9InVybCgjZmlsdGVyMV9mXzI1XzE1OCkiPgo8cGF0aCBkPSJNMjcuMjI3NyA3Ni4yOTUyTDIwLjI1MzggNzAuOTgxNEMxOS42OTQxIDcwLjU1NDkgMjAuMDkxMSA2OS42NjQ3IDIwLjc4MjQgNjkuNzk2MkwzMC45NDM1IDcxLjcyODlDMzEuMzk0NCA3MS44MTQ3IDMxLjYyNTggNzIuMzE5NyAzMS4zOTYzIDcyLjcxNzJMMzAuNTczNSA3NC4xNDIzQzMwLjQyMjEgNzQuNDA0NSAzMC40NjY1IDc0LjczNTkgMzAuNjgxNiA3NC45NDkxTDM3LjIzNzQgODEuNDQ2NkMzNy43MTg5IDgxLjkyMzcgMzcuMjYzOCA4Mi43MzE0IDM2LjYwNjMgODIuNTY2OEwyNi42OTI4IDgwLjA4NUMyNi4yNjMxIDc5Ljk3NzUgMjYuMDU1OSA3OS40ODg2IDI2LjI3NzMgNzkuMTA1TDI3LjQwMSA3Ny4xNTg4QzI3LjU2ODcgNzYuODY4MyAyNy40OTQ0IDc2LjQ5ODUgMjcuMjI3NyA3Ni4yOTUyWiIgZmlsbD0idXJsKCNwYWludDRfbGluZWFyXzI1XzE1OCkiLz4KPC9nPgo8L2c+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2ZfMjVfMTU4IiB4PSI1Mi4yODI0IiB5PSI0MC4yNDQzIiB3aWR0aD0iMTIuMjIzMyIgaGVpZ2h0PSIyMS45OTUzIiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9InNoYXBlIi8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjAuNjY2NjY3IiByZXN1bHQ9ImVmZmVjdDFfZm9yZWdyb3VuZEJsdXJfMjVfMTU4Ii8+CjwvZmlsdGVyPgo8ZmlsdGVyIGlkPSJmaWx0ZXIxX2ZfMjVfMTU4IiB4PSIxNy4zMjE2IiB5PSI2Ny4xMTY1IiB3aWR0aD0iMjIuNzgzIiBoZWlnaHQ9IjE4LjEzODgiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KPGZlRmxvb2QgZmxvb2Qtb3BhY2l0eT0iMCIgcmVzdWx0PSJCYWNrZ3JvdW5kSW1hZ2VGaXgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0ic2hhcGUiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMS4zMzMzMyIgcmVzdWx0PSJlZmZlY3QxX2ZvcmVncm91bmRCbHVyXzI1XzE1OCIvPgo8L2ZpbHRlcj4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzI1XzE1OCIgeDE9IjgwLjAwMDIiIHkxPSI1NS4yMjY4IiB4Mj0iODAuMDAwMiIgeTI9IjE5NC42MDEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0U5RTlFOSIvPgo8c3RvcCBvZmZzZXQ9IjAuNzU1MjA4IiBzdG9wLWNvbG9yPSIjQ0NDRkQ3Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl8yNV8xNTgiIHgxPSI3OS40NDg2IiB5MT0iODYuNjY2NyIgeDI9Ijc5LjQ0ODYiIHkyPSIxMjQuNTMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0id2hpdGUiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSJ3aGl0ZSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50Ml9saW5lYXJfMjVfMTU4IiB4MT0iMTE0LjMwOCIgeTE9IjI5LjU2MjMiIHgyPSIxMDMuOTU2IiB5Mj0iNjguMTk5MyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRUZGMUY1Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0RDRTBFNyIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50M19saW5lYXJfMjVfMTU4IiB4MT0iNTIuMzExOSIgeTE9IjQwLjA1MjUiIHgyPSI2NC44NTkyIiB5Mj0iNjEuNzg1MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRUZGMUY1Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0RDRTBFNyIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50NF9saW5lYXJfMjVfMTU4IiB4MT0iMTcuODUwMSIgeTE9IjY5LjUzNjIiIHgyPSIzOS41ODI3IiB5Mj0iODIuMDgzNiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRUZGMUY1Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0VGRjFGNSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=)}._controls_azwg4_1 ._error-title_azwg4_675{margin-top:1.5384615385em;font-size:1.0833333333em;font-weight:500;line-height:1.3846153846em}._controls_azwg4_1 ._error-message_azwg4_681{font-size:.9166666667em;font-weight:400;line-height:1.4090909091em;margin:.9166666667em;word-wrap:break-word;word-break:break-all;display:-webkit-box;-webkit-box-orient:vertical;line-clamp:2;-webkit-line-clamp:2;overflow:hidden;max-height:25%}._controls_azwg4_1 ._error-retry_azwg4_293{color:#333;width:7.75em;height:3em;text-align:center;border-radius:.5em;border:1px solid #ccced2;display:flex;justify-content:center;align-items:center;z-index:2}._controls_azwg4_1 ._error-retry_azwg4_293 ._error-retry-icon_azwg4_708{color:#333;width:1.25em;height:1.25em}._controls_azwg4_1 ._error-retry_azwg4_293>span{font-size:.9166666667em;margin-left:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._controls_azwg4_1 ._bottom-popup-layer_azwg4_721{position:absolute;left:50%;transform:translate(-50%);bottom:.4166666667em}._controls_azwg4_1 ._panel-playback-list_azwg4_727{margin-bottom:3.3333333333em;text-align:center;padding:.25em 0;background-color:rgba(0,0,0,.9);border-radius:4px}._controls_azwg4_1 ._panel-playback-list_azwg4_727 ._playback-rate_azwg4_300{padding:.5em 1em;cursor:pointer;white-space:nowrap;text-align:left;display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent}._controls_azwg4_1 ._panel-playback-list_azwg4_727 ._playback-rate_azwg4_300>div{line-height:1.5454545455em;font-size:.9166666667em}._controls_azwg4_1 ._panel-volume-wrapper_azwg4_748{background-color:rgba(0,0,0,.9);border-radius:4px;margin-bottom:3.3333333333em;width:1.7916666667em;height:6.4166666667em;display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;padding:0 0 .5em}._controls_azwg4_1 ._panel-volume-wrapper_azwg4_748 ._volume-text_azwg4_761{height:1.5454545455em;line-height:1.5454545455em;margin:.3636363636em .5454545455em;font-size:.9166666667em}._controls_azwg4_1 ._bottom-popup-layer-low-pos_azwg4_767{margin-bottom:2.2083333333em}._controls_azwg4_1 ._panel-button-tip_azwg4_770{background-color:rgba(0,0,0,.9);border-radius:4px;position:absolute;left:50%;transform:translate(-50%);bottom:3.25em;white-space:nowrap;padding:.5416666667em 1em}._controls_azwg4_1 ._panel-button-tip_azwg4_770 ._text_azwg4_780{line-height:1.5714285714em;font-size:1em}._controls_azwg4_1 ._panel-button-tip-low-pos_azwg4_784{bottom:2.625em}._controls_azwg4_1 ._tooltip_azwg4_787{background-color:rgba(0,0,0,.9);border-radius:4px;position:absolute;left:1.875em;bottom:5.4583333333em;white-space:nowrap;padding:.5416666667em .5em;color:#fff}._controls_azwg4_1 ._tooltip_azwg4_787>div{font-size:.75em;line-height:.8181818182em}._controls_azwg4_1 ._tooltip-low-pos_azwg4_801{bottom:4.7083333333em}._controls_azwg4_1 ._preview_azwg4_804{position:absolute;left:0;bottom:1.5833333333em;background-color:rgba(0,0,0,.3);border-radius:8px;overflow:hidden;display:block;visibility:hidden}._controls_azwg4_1 ._preview_azwg4_804 ._preview-img_azwg4_814{position:relative;transform-origin:0 0;left:0;top:0}._controls_azwg4_1 ._preview_azwg4_804 ._preview-time_azwg4_820{position:absolute;bottom:0;width:100%;height:50%;color:#fff;padding:.25em;background:0 bottom repeat-x linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.8))}._controls_azwg4_1 ._preview_azwg4_804 ._preview-time_azwg4_820>div{position:absolute;text-align:center;left:0;right:0;bottom:.3636363636em;font-weight:500;font-size:.75em}._controls_azwg4_1 ._preview_azwg4_804 ._preview-time-no-img_azwg4_838{position:relative;background:none;width:auto;height:auto}._controls_azwg4_1 ._preview_azwg4_804 ._preview-time-no-img_azwg4_838>div{position:relative;bottom:0;background:none}')),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();var N0=Object.defineProperty,x0=(r,i,n)=>i in r?N0(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Si=(r,i,n)=>(x0(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var k0=Object.defineProperty,M0=(r,i,n)=>i in r?k0(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Er=(r,i,n)=>(M0(r,typeof i!="symbol"?i+"":i,n),n);const P0="ControlsPlugin",Fu="I18nPlugin",U0="LoggerPlugin",B0="HotkeyPlugin",V0="PlayInfoPlugin",ju="RotatePlugin",Hu="PreviewPlugin",F0="MaskPlugin",Gu="VRPlugin",zu="DanmakuPlugin";var Yn=(r=>(r.BOTTOM="bottom",r.PLAY_BAR="playBar",r.NONE="none",r))(Yn||{}),ka=(r=>(r.PLAY_BAR_LEFT="playBarLeft",r.PLAY_BAR_RIGHT="playBarRight",r.CONTEXT_MENU="contextMenu",r))(ka||{});let yr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};Er(yr,"label"),Er(yr,"version"),Er(yr,"isSupported");const Ku=class rf extends yr{getLabel(){return rf.label}beforeInstall(i,n){}afterInstall(i,n){}};Er(Ku,"label",P0);let j0=Ku;Er(class nf extends yr{getLabel(){return nf.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",Fu),Er(class af extends yr{getLabel(){return af.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",U0),Er(class sf extends yr{getLabel(){return sf.label}},"label",B0),Er(class of extends yr{getLabel(){return of.label}},"label",V0),Er(class cf extends yr{getLabel(){return cf.label}},"label",ju),Er(class lf extends yr{getLabel(){return lf.label}},"label",Hu),Er(class uf extends yr{getLabel(){return uf.label}},"label",F0),Er(class hf extends yr{getLabel(){return hf.label}},"label",Gu),Er(class df extends yr{getLabel(){return df.label}},"label",zu);var Je=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Je||{}),Ds=(r=>(r.NONE="none",r.KWAI="kwai",r.KWAI2="kwai2",r))(Ds||{}),Qn=(r=>(r.SYSTEM="system",r.WINDOW="window",r))(Qn||{}),Ze=(r=>(r.PLAY="play",r.PAUSE="pause",r.REFRESH="refresh",r.NEXT="next",r.TURN_ON_LOOP="turnOnLoop",r.TURN_OFF_LOOP="turnOffLoop",r.LOOP="loop",r.PLAYBACK_RATE_NORMAL="playbackRateNromal",r.OPTIONS="options",r.DOWNLOAD="download",r.VIDEO_TRACK="videoTrack",r.AUDIO_TRACK="audioTrack",r.PLAYBACK_RATE="playbackRate",r.PLAYBACK_RATE_SHORT="playbackRateShort",r.PICTURE_IN_PICTURE="pictureInPicture",r.EXIT_PICTURE_IN_PICTURE="exitPictureInPicture",r.PLAY_INFO="playInfo",r.MIRROR_IMAGE="mirrorImage",r.ROTATE="rotate",r.FULLSCREEN="fullscreen",r.EXIT_FULLSCREEN="exitFullscreen",r.WINDOW_FULLSCREEN="windowFullscreen",r.EXIT_WINDOW_FULLSCREEN="exitWindowFullscreen",r.AUTO="auto",r.CURRENT_VOLUME="currentVolume",r.CURRENTLY_MUTED="currentlyMuted",r.SWITCH_TO_VIDEO="switchToVideo",r.SWITCHING_TO_VIDEO="switchingToVideo",r.SWITCHED_TO_VIDEO="switchedToVideo",r.SWITCH_TO_AUDIO="switchToAudio",r.SWITCHING_TO_AUDIO="switchingToAudio",r.SWITCHED_TO_AUDIO="switchedToAudio",r.FAIL="fail",r.ERROR_PANEL_TITLE="errorPanelTitle",r.ERROR_PANEL_RETRY_BTN="errorPanelRetryBtn",r.LIVE="live",r.RETURN_TO_LIVE="returnToLive",r))(Ze||{});const H0={play:"播放",pause:"暂停",refresh:"刷新",next:"下一个",turnOnLoop:"打开循环播放",turnOffLoop:"关闭循环播放",loop:"循环播放",playbackRateNromal:"正常",options:"选项",download:"下载",videoTrack:"视频轨",audioTrack:"音频轨",playbackRate:"播放速度",playbackRateShort:"倍速",pictureInPicture:"画中画",exitPictureInPicture:"退出画中画",playInfo:"视频信息",mirrorImage:"镜像画面",rotate:"旋转画面",fullscreen:"全屏",exitFullscreen:"退出全屏",windowFullscreen:"网页全屏",exitWindowFullscreen:"退出网页全屏",auto:"自动",currentVolume:"当前音量",currentlyMuted:"当前静音",switchToVideo:"切换到",switchingToVideo:"正在切换",switchedToVideo:"已切换",switchToAudio:"切换到",switchingToAudio:"正在切换",switchedToAudio:"已切换",fail:"失败",errorPanelTitle:"播放出错了",errorPanelRetryBtn:"点击重试",live:"直播中",returnToLive:"返回直播"};var Ls=(r=>(r.VERSION="version",r.LOOP="loop",r.PLAY_INFO="playInfo",r.MIRROR="mirror",r.ROTATE="rotate",r.PIP="pip",r))(Ls||{}),Hi=(r=>(r[r.DEFAULT=0]="DEFAULT",r[r.HOVER=1]="HOVER",r[r.DISABLED=2]="DISABLED",r))(Hi||{});function Ma(r,i,n){const o=r.findIndex(s=>s.id===n.id);o>=0&&(r.splice(o,1),i([...r]))}function Pa(r,i,n,o){const s=r.findIndex(d=>d.id===n.id);s<0?(typeof o>"u"?r.push(n):r.splice(o,0,n),i([...r])):typeof o=="number"&&o!==s&&(r.splice(s,1),r.splice(o,0,n),i([...r]))}const Ss=Oa(void 0),G0="adaptive-btns-context",z0=r=>{const{children:i,deps:n}=r,{player:o,text:s}=n,[d,m]=st([{id:Ls.VERSION,name:o.packVersion,handle:()=>{},isChecked:!1}]),[A,T]=st([]),[C]=st([]),h=Ot({id:Ls.LOOP,name:s(Ze.LOOP),handle:()=>{h.current.isChecked=o.loop=!o.loop,m([...d]),T([...A])},isChecked:!1}),F=Ot({id:Ls.PIP,name:s(Ze.PICTURE_IN_PICTURE),handle:()=>{document.pictureInPictureElement?document.exitPictureInPicture():o.requestPictureInPicture(),T([...A])},isChecked:!1}),w=()=>{!Vt&&o.isPictureInPictureAvailable()&&!o.disablePictureInPicture?(Pa(A,T,F.current,1),Pa(d,m,F.current,1)):(Ma(A,T,F.current),Ma(d,m,F.current))},I=()=>{C.forEach(S=>{S.btns.forEach(W=>{W.active?(Pa(d,m,W.btn),Pa(A,T,W.btn)):(Ma(d,m,W.btn),Ma(A,T,W.btn))})})};return Un(()=>{o.logger.i(G0,"init"),w();const S=()=>{Ma(d,m,h.current),I()},W=()=>{w()},j=z=>{z.type==="mediaInfo"&&!z.value.isLive&&Pa(d,m,h.current,1)},N=()=>{F.current.isChecked=!0,F.current.name=s(Ze.EXIT_PICTURE_IN_PICTURE),T([...A])},K=()=>{F.current.isChecked=!1,F.current.name=s(Ze.PICTURE_IN_PICTURE),T([...A])};return o.on(Je.ATTRIBUTE_CHANGE_SRC,S),o.on(Je.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,W),o.on(Je.REPORT,j),o.on(Je.ENTER_PICTURE_IN_PICTURE,N),o.on(Je.LEAVE_PICTURE_IN_PICTURE,K),o.getAllPlugins().forEach(z=>{const B=z.getLabel(),J=C.find(X=>X.id===B),be=z.controlsSoltBtns;if(J)J.btns.forEach(X=>X.active=!1),be==null||be.forEach((X,ye)=>{if(X.slotPos===ka.CONTEXT_MENU&&X.getText){const Be=`${B}-${ye}`,Ve=J.btns.find(je=>je.btn.id===Be);Ve&&(Ve.active=!0)}});else{const X=be==null?void 0:be.map((ye,Be)=>{var Ve;if(ye.slotPos===ka.CONTEXT_MENU&&ye.getText){const je=()=>{we.isChecked=ye.getChecked?ye.getChecked():!1,m([...d]),T([...A])};(Ve=ye.callback)==null||Ve.add(je);const we={id:`${B}-${Be}`,name:ye.getText(),handle:ye.onClick,isChecked:ye.getChecked?ye.getChecked():!1};return{btn:we,changeCallback:je,soltBtnInfo:ye,active:!0}}}).filter(ye=>typeof ye<"u");X!=null&&X.length&&C.push({id:B,btns:X})}}),I(),()=>{o.off(Je.ATTRIBUTE_CHANGE_SRC,S),o.off(Je.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,W),o.off(Je.REPORT,j),o.off(Je.ENTER_PICTURE_IN_PICTURE,N),o.off(Je.LEAVE_PICTURE_IN_PICTURE,K),C.forEach(z=>{z.btns.forEach(B=>{var J;(J=B.soltBtnInfo.callback)==null||J.remove(B.changeCallback)})})}},[]),De(Ss.Provider,{value:{player:o,contextMenuItems:d,overflowItems:A},children:i})},Bn=Oa(void 0),Jr="controls-context",K0=r=>{const{children:i,deps:n}=r,{player:o,text:s}=n,d=o.logger,[m,A]=st(!1),[T,C]=st([]),[h,F]=st([]),[w,I]=st(),[S,W]=st(-1),[j,N]=st(-1),[K,z]=st(o.playbackRate),[B,J]=st(!1),[be,X]=st(o.muted),[ye,Be]=st(o.volume),[Ve,je]=st(!1),[we,ue]=st(o.paused),[L,D]=st(o.isFullscreen(Qn.SYSTEM)),[le,oe]=st(o.isFullscreen(Qn.WINDOW)),[Re,Oe]=st(!0),[de,$]=st(o.loop),[ge,Pe]=st(!1),[ae,q]=st(!!o.controls),[b,ve]=st(!!o.isLiveShift),[U,M]=st(o.liveShiftType),[ne]=st(o.isFullscreenAvailable()),[Le]=st(n.options.showWindowFullScreen!==!1),[Ue,re]=st(!!o.disablePictureInPicture),[k]=st(n.options.showProgressTime===!0),[P]=st(n.options.showContextMenu!==!1),Z=Ii(()=>(U===Ds.KWAI||U===Ds.KWAI2)&&m?!Vt:!1,[U,m]),he=Ii(()=>!o.src||!!w,[o.src,w]),Ie=Ii(()=>!m,[m]),Ee=Ii(()=>m,[m]),pe=Ii(()=>!Vt&&o.isPictureInPictureAvailable()&&!Ue&&!Re&&ge,[Re,ge,Ue]),G=Ii(()=>!m&&!Vt&&n.options.showPlaybackRate!==!1,[m]),te=Ii(()=>!m&&n.options.showPlaybackRate!==!1,[m]),ie=Ii(()=>typeof o.showProgress>"u"&&typeof n.options.showProgress>"u"?!m||m&&Z:(!m||m&&Z)&&!!(o.showProgress||n.options.showProgress),[m,Z,o.showProgress]),ee=Ii(()=>o.showTime!==!1&&n.options.showTime!==!1,[o.showTime]),Te=Ii(()=>!!(o.showNext||n.options.showNext),[m,o.showNext]),Se=Ii(()=>!!(o.showPrev||n.options.showPrev),[m,o.showPrev]);Un(()=>{const Lt=Ti=>{d.i(Jr,"manifest parsed");const rr=[];if(Ti.levels.forEach((oi,Xt)=>{let pr=oi.qualityLabel||oi.qualityType;pr||(oi.width&&oi.height?pr=`${Math.min(oi.width,oi.height)}P`:pr=Xt.toString()),rr.push({val:Xt,label:pr,type:oi.qualityType||""})}),rr.reverse(),W(Ti.currentLevel),Ti.auto&&rr.length>1&&(rr.unshift({val:-1,label:s(Ze.AUTO),type:""}),W(-1)),C(rr),!Ti.audioTracks)return;const pi=[];Ti.audioTracks.forEach((oi,Xt)=>{pi.push({val:Xt,label:oi.qualityLabel||oi.qualityType||oi.lang||Xt.toString(),type:oi.qualityType})}),h.reverse(),F(pi),N(Ti.audioTrack||0),A(!!Ti.isLive)},_t=Ti=>{Ti.type==="mediaInfo"&&A(!!Ti.value.isLive)},ai=Ti=>{I(Ti),je(!1)},wi=()=>{I(void 0),Oe(!!o.canvas)},Oi=()=>{o.video.readyState>2&&je(!1)},bi=()=>{isFinite(o.duration)&&o.duration>0&&U===Ds.NONE&&A(!1)},zi=()=>z(o.playbackRate),Pt=()=>J(!0),It=()=>J(!1),Ni=()=>{je(!1),Pe(!1),A(!1)},Nt=()=>{I(void 0),z(o.playbackRate)},Ct=()=>{je(!0)},Bt=()=>{je(!0)},ri=()=>{je(!1)},Mi=()=>{bt(),ue(o.paused),je(!1),Pe(!0)},Gr=()=>{ue(o.paused)},yi=()=>{ue(o.paused),Pe(!0)},Ci=()=>{ue(o.paused)},Br=()=>{bt()},bt=()=>{X(o.muted||o.volume===0),Be(o.muted?0:o.volume)},zt=({isFull:Ti,type:rr})=>{rr==="window"?oe(Ti):(D(Ti),Ti||oe(!1))},tn=()=>{Oe(!!o.canvas)},ei=()=>{$(o.loop)},ui=()=>{q(!!o.controls)},zr=()=>{W(o.currentLevel)},fr=()=>{N(o.audioTrack)},ti=()=>{ve(!!o.isLiveShift)},Fn=()=>{M(o.liveShiftType)},mt=()=>{re(o.disablePictureInPicture)};return o.on(Je.ATTRIBUTE_CHANGE_SRC,Ni),o.on(Je.EMPTIED,Nt),o.on(Je.WAITING,Ct),o.on(Je.SEEKING,Bt),o.on(Je.SEEKED,ri),o.on(Je.PLAYING,Mi),o.on(Je.PAUSE,Gr),o.on(Je.CANPLAY,yi),o.on(Je.ENDED,Ci),o.on(Je.VOLUMECHANGE,Br),o.on(Je.MANIFEST_PARSED,Lt),o.on(Je.REPORT,_t),o.on(Je.ERROR,ai),o.on(Je.LOADEDDATA,wi),o.on(Je.TIMEUPDATE,Oi),o.on(Je.DURATIONCHANGE,bi),o.on(Je.RATECHANGE,zi),o.on(Je.ENTER_PICTURE_IN_PICTURE,Pt),o.on(Je.LEAVE_PICTURE_IN_PICTURE,It),o.on(Je.FULLSCREEN_CHANGE,zt),o.on(Je.VIDEO_RENDERER_CHANGE,tn),o.on(Je.LIVE_SHIFT_CHANGE,ti),o.on(Je.LIVE_SHIFT_TYPE_CHANGE,Fn),o.on(Je.ATTRIBUTE_CHANGE_LOOP,ei),o.on(Je.ATTRIBUTE_CHANGE_CONTROLS,ui),o.on(Je.ATTRIBUTE_CHANGE_CURRENT_LEVEL,zr),o.on(Je.ATTRIBUTE_CHANGE_NEXT_LEVEL,zr),o.on(Je.ATTRIBUTE_CHANGE_AUDIO_TRACK,fr),o.on(Je.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,mt),()=>{o.off(Je.ATTRIBUTE_CHANGE_SRC,Ni),o.off(Je.EMPTIED,Nt),o.off(Je.WAITING,Ct),o.off(Je.SEEKING,Bt),o.off(Je.SEEKED,ri),o.off(Je.PLAYING,Mi),o.off(Je.PAUSE,Gr),o.off(Je.CANPLAY,yi),o.off(Je.ENDED,Ci),o.off(Je.VOLUMECHANGE,Br),o.off(Je.MANIFEST_PARSED,Lt),o.off(Je.REPORT,_t),o.off(Je.ERROR,ai),o.off(Je.LOADEDDATA,wi),o.off(Je.TIMEUPDATE,Oi),o.off(Je.DURATIONCHANGE,bi),o.off(Je.RATECHANGE,zi),o.off(Je.ENTER_PICTURE_IN_PICTURE,Pt),o.off(Je.LEAVE_PICTURE_IN_PICTURE,It),o.off(Je.FULLSCREEN_CHANGE,zt),o.off(Je.VIDEO_RENDERER_CHANGE,tn),o.off(Je.LIVE_SHIFT_CHANGE,ti),o.off(Je.LIVE_SHIFT_TYPE_CHANGE,Fn),o.off(Je.ATTRIBUTE_CHANGE_LOOP,ei),o.off(Je.ATTRIBUTE_CHANGE_CONTROLS,ui),o.off(Je.ATTRIBUTE_CHANGE_CURRENT_LEVEL,zr),o.off(Je.ATTRIBUTE_CHANGE_NEXT_LEVEL,zr),o.off(Je.ATTRIBUTE_CHANGE_AUDIO_TRACK,fr),o.off(Je.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,mt)}},[]);const Ye=Lt=>{d.i(Jr,"change level",Lt),o.currentLevel=Lt,W(Lt)},ze=Lt=>{d.i(Jr,"change audio level",Lt),o.audioTrack=Lt,N(Lt)},it=Lt=>{d.i(Jr,"change playback rate level",Lt),o.playbackRate=Lt},ct=Lt=>{o.muted=!1,o.volume=Lt},nt=()=>{d.i(Jr,"change pip"),document.pictureInPictureElement?document.exitPictureInPicture():o.requestPictureInPicture()},Wt=()=>{d.i(Jr,"toggle muted",!o.muted),o.muted=!o.muted},Et=()=>{d.i(Jr,"toggle play",o.paused),o.paused?o.play():o.pause()},Ut=()=>{d.i(Jr,"toggle fullscreen"),o.isFullscreen(Qn.SYSTEM)?o.exitFullscreen():o.requestFullscreen(Qn.SYSTEM)},Yt=()=>{d.i(Jr,"toggle windows fullscreen"),o.isFullscreen(Qn.WINDOW)?o.exitFullscreen():o.requestFullscreen(Qn.WINDOW)},Jt=()=>{d.i(Jr,"jump to live"),o.jumpToLive()},si=()=>{d.i(Jr,"refresh"),o.refresh()};return De(Bn.Provider,{value:{text:s,player:o,isLive:m,currentLevel:S,currentAudioLevel:j,levels:T,audioLevels:h,error:w,playbackRate:K,isInPIP:B,muted:be,volume:ye,waiting:Ve,paused:we,isFullscreen:L,isWindowFullscreen:le,isCanvasRender:Re,isLoop:de,firstFrameReady:ge,isLiveShift:b,liveShiftType:U,liveShiftEnabled:Z,changeLevel:Ye,changeAudioLevel:ze,changePlaybackRate:it,changeVolume:ct,changePIP:nt,toggleMuted:Wt,togglePlay:Et,toggleFullscreen:Ut,toggleWindowFullscreen:Yt,refresh:si,jumpToLive:Jt,disabled:he,controls:ae,showLoop:Ie,showRefresh:Ee,showFullScreen:ne,showWindowFullScreen:Le,showPictureInPicture:pe,showPlaybackRate:G,showPlaybackRateOverflow:te,showProgress:ie,showProgressTime:k,showTime:ee,showNext:Te,showPrev:Se,showContextMenu:P,deps:n},children:i})};class W0{constructor(){Si(this,"_observer"),Si(this,"_target")}start(i,n,o){const s=i.getBoundingClientRect().width;n.forEach(d=>this._updateFontSize(d,s)),this._observer||(this._observer=new fs(d=>{o&&o(d),d.forEach(m=>{const{width:A}=m.contentRect;n.forEach(T=>this._updateFontSize(T,A))})}),this._observer.observe(i))}stop(){this._observer&&this._target&&(this._observer.unobserve(this._target),this._observer.disconnect(),this._observer=void 0)}_updateFontSize(i,n){n>=1280?i.style.fontSize="24px":n>=640?i.style.fontSize="18px":n>=200?i.style.fontSize="12px":i.style.fontSize="11px"}}const Y0="_controls_azwg4_1",Q0="_disabled_azwg4_97",$0="_timeline_azwg4_176",X0="_thumb_azwg4_182",Z0="_overlay_azwg4_249",q0="_overflow_azwg4_258",J0="_closed_azwg4_275",ev="_loading_azwg4_336",tv="_spinner_azwg4_355",iv="_text_azwg4_780",rv="_tooltip_azwg4_787",nv="_preview_azwg4_804",Qe={controls:Y0,"video-area":"_video-area_azwg4_14","bottom-controls":"_bottom-controls_azwg4_20","bottom-controls-bg":"_bottom-controls-bg_azwg4_29","sending-area":"_sending-area_azwg4_39","sending-area-controls":"_sending-area-controls_azwg4_47","button-panel":"_button-panel_azwg4_51","button-panel-left":"_button-panel-left_azwg4_57","button-panel-right":"_button-panel-right_azwg4_58","button-panel-center":"_button-panel-center_azwg4_64","panel-button-margins-left":"_panel-button-margins-left_azwg4_75","panel-button-margins-right":"_panel-button-margins-right_azwg4_78","panel-button-wrapper":"_panel-button-wrapper_azwg4_81",disabled:Q0,"panel-button":"_panel-button_azwg4_75","panel-button-text":"_panel-button-text_azwg4_105","live-shift":"_live-shift_azwg4_111","live-shift-chips":"_live-shift-chips_azwg4_114","live-shift-button":"_live-shift-button_azwg4_128","panel-button-icon":"_panel-button-icon_azwg4_146","panel-button-icon-plugin":"_panel-button-icon-plugin_azwg4_150","current-time-display":"_current-time-display_azwg4_157","time-remaining-display":"_time-remaining-display_azwg4_166",timeline:$0,thumb:X0,"thumb-drag":"_thumb-drag_azwg4_185","segmented-track":"_segmented-track_azwg4_188","segmented-vertical-track":"_segmented-vertical-track_azwg4_189","thumb-vertical":"_thumb-vertical_azwg4_206","segment-background":"_segment-background_azwg4_221","segment-vertical-background":"_segment-vertical-background_azwg4_222","segment-highlight-before":"_segment-highlight-before_azwg4_231","segment-vertical-highlight-before":"_segment-vertical-highlight-before_azwg4_232","segment-highlight-after":"_segment-highlight-after_azwg4_237","segment-vertical-highlight-after":"_segment-vertical-highlight-after_azwg4_238",overlay:Z0,overflow:q0,closed:J0,"overflow-item":"_overflow-item_azwg4_280","error-retry":"_error-retry_azwg4_293","playback-rate":"_playback-rate_azwg4_300","overflow-icon":"_overflow-icon_azwg4_307","overflow-checkbox":"_overflow-checkbox_azwg4_313","overflow-content":"_overflow-content_azwg4_326",loading:ev,spinner:tv,"container-rotate":"_container-rotate_azwg4_1","kwai-layer":"_kwai-layer_azwg4_378","fill-unfill-rotate":"_fill-unfill-rotate_azwg4_1","spinner-mask-1":"_spinner-mask-1_azwg4_391","spinner-mask-2":"_spinner-mask-2_azwg4_392","loading-spinner-frame":"_loading-spinner-frame_azwg4_427","loading-panel-spinner-frame":"_loading-panel-spinner-frame_azwg4_428","loading-spinner-mask-1-bg":"_loading-spinner-mask-1-bg_azwg4_434","loading-spinner-mask-2-bg":"_loading-spinner-mask-2-bg_azwg4_435","mask-1-spin":"_mask-1-spin_azwg4_1","mask-2-spin":"_mask-2-spin_azwg4_1","context-menu":"_context-menu_azwg4_508","context-menu-list":"_context-menu-list_azwg4_517","context-menu-item":"_context-menu-item_azwg4_520","context-menu-label":"_context-menu-label_azwg4_530","context-menu-checkbox":"_context-menu-checkbox_azwg4_538","error-alert":"_error-alert_azwg4_657","error-icon":"_error-icon_azwg4_669","error-title":"_error-title_azwg4_675","error-message":"_error-message_azwg4_681","error-retry-icon":"_error-retry-icon_azwg4_708","bottom-popup-layer":"_bottom-popup-layer_azwg4_721","panel-playback-list":"_panel-playback-list_azwg4_727","panel-volume-wrapper":"_panel-volume-wrapper_azwg4_748","volume-text":"_volume-text_azwg4_761","bottom-popup-layer-low-pos":"_bottom-popup-layer-low-pos_azwg4_767","panel-button-tip":"_panel-button-tip_azwg4_770",text:iv,"panel-button-tip-low-pos":"_panel-button-tip-low-pos_azwg4_784",tooltip:rv,"tooltip-low-pos":"_tooltip-low-pos_azwg4_801",preview:nv,"preview-img":"_preview-img_azwg4_814","preview-time":"_preview-time_azwg4_820","preview-time-no-img":"_preview-time-no-img_azwg4_838"},av=Rs(function(r,i){const n=or(Ss);if(!n)return De(ji,{});const{contextMenuItems:o}=n,s=Ot(0),d=()=>{s.current=+setTimeout(()=>{r.onChangeShowContextMenu()},300)},m=()=>{s.current&&(clearTimeout(s.current),s.current=0)},A=()=>{m()},T=C=>{r.onChangeShowContextMenu(),C()};return jt(()=>()=>{m()},[]),De(ji,{children:o.length!==0&&De("div",{ref:i,className:Qe["context-menu"],style:{left:r.left,top:r.top,visibility:r.visible?"visible":"hidden"},onMouseLeave:d,onMouseEnter:A,children:De("div",{className:Qe["context-menu-list"],children:o.map((C,h)=>De("div",{onClick:()=>{T(C.handle)},className:Qe["context-menu-item"],children:[De("div",{className:Qe["context-menu-label"],children:De("span",{children:C.name})}),De("input",{type:"checkbox",checked:C.isChecked,className:Qe["context-menu-checkbox"]})]},h))})})})});function sv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",children:De("path",{d:"M5.7 6.623v24.333a2.823 2.823 0 004.291 2.41l19.978-12.165a2.823 2.823 0 000-4.822L9.991 4.212A2.823 2.823 0 005.7 6.623z",fill:r.color||"#fff"})})}function ov(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",children:[De("rect",{x:"7",y:"6",width:"6",height:"26",rx:"2",fill:r.color||"#fff"}),De("rect",{x:"25",y:"6",width:"6",height:"26",rx:"2",fill:r.color||"#fff"})]})}function cv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",children:De("path",{d:"M16.808 5.665l-4.565 3.458-3.71.003a5.476 5.476 0 00-5.476 5.476v8.796a5.476 5.476 0 005.476 5.476l3.71.003 4.565 3.457a3.628 3.628 0 005.82-2.89V8.556a3.628 3.628 0 00-5.82-2.892zM19.88 7.39a.076.076 0 01.104.014l.011.02L20 30.303c0 .04-.033.072-.074.072a.076.076 0 01-.045-.015l-5.114-3.772a4.156 4.156 0 00-2.466-.807h-4.15C6.964 25.781 6 24.844 6 23.688v-9.626c0-1.156.963-2.093 2.152-2.093h4.15c.89 0 1.756-.284 2.465-.807l5.114-3.772zm10.485 1.365a1.781 1.781 0 012.354.895c1.39 3.098 2.092 6.219 2.092 9.35 0 3.131-.701 6.252-2.092 9.35a1.781 1.781 0 01-3.25-1.46c1.19-2.648 1.779-5.274 1.779-7.89 0-2.616-.59-5.242-1.779-7.89a1.781 1.781 0 01.896-2.355zm-4.554 3.606a1.781 1.781 0 012.202 1.224c.514 1.8.772 3.606.772 5.415 0 1.81-.258 3.616-.772 5.415a1.781 1.781 0 01-3.425-.979c.424-1.484.635-2.961.635-4.436s-.211-2.952-.635-4.437a1.781 1.781 0 011.223-2.202z",fill:r.color||"#fff"})})}function lv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:De("path",{d:"M25.313 5.625h2.812a3.75 3.75 0 013.75 3.75v2.813M25.313 31.875h2.812a3.75 3.75 0 003.75-3.75v-2.813M12.188 5.625H9.374a3.75 3.75 0 00-3.75 3.75v2.813M7.5 7.5L15 15M30 7.5L22.5 15M7.5 30l7.5-7.5M30 30l-7.5-7.5M12.188 31.875H9.374a3.75 3.75 0 01-3.75-3.75v-2.813",stroke:r.color||"#fff",strokeWidth:"2.813",strokeLinecap:"round"})})}function uv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:De("path",{d:"M28.563 16.938H25.75a3.75 3.75 0 01-3.75-3.75v-2.813M28 21.375h-2.81a3.75 3.75 0 00-3.75 3.75v2.81M10 16.938h2.813a3.75 3.75 0 003.75-3.75v-2.813M7.5 7.5L15 15M30 7.5L22.5 15M7.5 30l7.5-7.5M30 30l-7.5-7.5M10 21.375h2.813a3.75 3.75 0 013.75 3.75v2.813",stroke:r.color||"#fff",strokeWidth:"2.5",strokeLinecap:"round"})})}function hv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:De("path",{d:"M25.313 5.625h2.812a3.75 3.75 0 013.75 3.75v2.813M25.313 31.875h2.812a3.75 3.75 0 003.75-3.75v-2.813M12.188 5.625H9.374a3.75 3.75 0 00-3.75 3.75v2.813M12.188 31.875H9.374a3.75 3.75 0 01-3.75-3.75v-2.813",stroke:r.color||"#fff",strokeWidth:"2.813",strokeLinecap:"round"})})}function dv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:De("path",{d:"M31.875 12.188h-2.813a3.75 3.75 0 01-3.75-3.75V5.624M31.875 25.313h-2.813a3.75 3.75 0 00-3.75 3.75v2.812M5.625 12.188h2.813a3.75 3.75 0 003.75-3.75V5.624M5.625 25.313h2.813a3.75 3.75 0 013.75 3.75v2.812",stroke:r.color||"#fff",strokeWidth:"2.5",strokeLinecap:"round"})})}function fv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",children:De("path",{d:"M8.438 18.75a2.813 2.813 0 11-5.626 0 2.813 2.813 0 015.626 0zm13.124 0a2.813 2.813 0 11-5.625 0 2.813 2.813 0 015.626 0zm10.313 2.813a2.813 2.813 0 100-5.626 2.813 2.813 0 000 5.626z",fill:r.color||"#fff"})})}function pv(r){const i=r.color||"#fff";return De("svg",{className:r.className,width:"38",height:"39",viewBox:"0 0 38 38",children:[De("path",{d:"M16.808 6.29l-4.565 3.458-3.71.003a5.476 5.476 0 00-5.476 5.476v8.796A5.476 5.476 0 008.533 29.5l3.71.003 4.565 3.457a3.628 3.628 0 005.82-2.89V9.181a3.628 3.628 0 00-5.82-2.892zm3.073 1.725a.076.076 0 01.104.014l.011.02L20 30.928c0 .04-.033.072-.074.072a.076.076 0 01-.045-.015l-5.114-3.772a4.156 4.156 0 00-2.466-.807h-4.15C6.964 26.406 6 25.47 6 24.313v-9.626c0-1.156.963-2.093 2.152-2.093h4.15c.89 0 1.756-.284 2.465-.807l5.114-3.772zM30.366 9.38a1.781 1.781 0 012.354.895c1.39 3.098 2.092 6.219 2.092 9.35 0 3.131-.701 6.252-2.092 9.35a1.781 1.781 0 01-3.25-1.46c1.19-2.648 1.779-5.274 1.779-7.89 0-2.616-.59-5.242-1.779-7.89a1.781 1.781 0 01.896-2.355zm-4.554 3.606a1.781 1.781 0 012.202 1.224c.514 1.8.772 3.606.772 5.415 0 1.81-.258 3.616-.772 5.415a1.781 1.781 0 01-3.425-.979c.424-1.484.635-2.961.635-4.436s-.211-2.952-.635-4.437a1.781 1.781 0 011.223-2.202z",fill:i}),De("path",{d:"M4 5l29.5 26.5",stroke:i,strokeWidth:"2.5",strokeLinecap:"round"})]})}function _v(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",children:De("path",{d:"M22.659 14.9l8.505.17a1.622 1.622 0 001.664-1.577L33 5.108a1.2 1.2 0 00-1.185-1.216l-.827-.017a1.202 1.202 0 00-1.233 1.168l-.077 3.75a15.432 15.432 0 00-10.404-4.037C10.852 4.756 4 11.51 4 19.816c0 8.303 6.852 15.059 15.274 15.059 2.683 0 5.323-.696 7.633-2.013a15.298 15.298 0 004.741-4.217 1.181 1.181 0 00-.359-1.718l-.99-.587a1.219 1.219 0 00-1.596.312 11.734 11.734 0 01-3.582 3.162 11.823 11.823 0 01-5.847 1.541c-6.453 0-11.704-5.177-11.704-11.54 0-6.363 5.25-11.54 11.704-11.54a11.82 11.82 0 018.419 3.525l-4.969-.099a1.202 1.202 0 00-1.233 1.168l-.017.815A1.2 1.2 0 0022.66 14.9z",fill:r.color||"#fff"})})}function Av(r){return De("svg",{className:r.className,width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",children:De("path",{d:"M9.0625 12.0312H1.9375C1.46508 12.0312 1.01202 11.8436 0.677966 11.5095C0.343917 11.1755 0.15625 10.7224 0.15625 10.25V3.125C0.15625 2.65258 0.343917 2.19951 0.677966 1.86547C1.01202 1.53142 1.46508 1.34375 1.9375 1.34375C2.40992 1.34375 2.86299 1.53142 3.19703 1.86547C3.53108 2.19951 3.71875 2.65258 3.71875 3.125V5.18234C6.19023 2.74797 9.99617 0.15625 15 0.15625C21.5995 0.15625 25.5925 4.07352 25.7602 4.23977C26.0905 4.57413 26.2752 5.02546 26.2742 5.49542C26.2731 5.96538 26.0864 6.41589 25.7547 6.74879C25.423 7.0817 24.9731 7.27001 24.5032 7.27271C24.0332 7.27541 23.5812 7.09227 23.2457 6.7632C23.1804 6.70086 20.0469 3.71875 15 3.71875C10.6953 3.71875 7.43859 6.34313 5.5 8.46875H9.0625C9.53492 8.46875 9.98799 8.65642 10.322 8.99047C10.6561 9.32451 10.8437 9.77758 10.8438 10.25C10.8437 10.7224 10.6561 11.1755 10.322 11.5095C9.98799 11.8436 9.53492 12.0312 9.0625 12.0312ZM28.0625 17.9688H20.9375C20.4651 17.9688 20.012 18.1564 19.678 18.4905C19.3439 18.8245 19.1562 19.2776 19.1562 19.75C19.1562 20.2224 19.3439 20.6755 19.678 21.0095C20.012 21.3436 20.4651 21.5312 20.9375 21.5312H24.5C22.5703 23.6569 19.3047 26.2812 15 26.2812C9.95312 26.2812 6.81961 23.2991 6.7543 23.2353C6.41877 22.9062 5.96679 22.7231 5.49683 22.7258C5.02688 22.7285 4.57703 22.9168 4.2453 23.2497C3.91358 23.5826 3.72685 24.0331 3.72582 24.5031C3.72478 24.9731 3.90951 25.4244 4.23977 25.7587C4.4075 25.9265 8.40047 29.8438 15 29.8438C20.0038 29.8438 23.8098 27.252 26.2812 24.8177V26.875C26.2812 27.3474 26.4689 27.8005 26.803 28.1345C27.137 28.4686 27.5901 28.6562 28.0625 28.6562C28.5349 28.6562 28.988 28.4686 29.322 28.1345C29.6561 27.8005 29.8438 27.3474 29.8438 26.875V19.75C29.8438 19.2776 29.6561 18.8245 29.322 18.4905C28.988 18.1564 28.5349 17.9688 28.0625 17.9688Z",fill:r.color||"#fff"})})}function vv(r){const i=r.color||"#fff";return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:[De("rect",{x:"16.15",y:"22.225",width:"19",height:"12.35",rx:"4",fill:i}),De("path",{d:"M32.3 18.426v-8.351a4 4 0 00-4-4H9.7a4 4 0 00-4 4v16.7a4 4 0 004 4h3.6M10.925 11.3l7.6 7.6m0 0v-5.7m0 5.7H13.3",stroke:i,strokeWidth:"2.5",strokeLinecap:"round"})]})}function gv(r){const i=r.color||"#fff";return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:[De("rect",{x:"16.15",y:"21.85",width:"19",height:"12.35",rx:"4",fill:i}),De("path",{d:"M32.3 18.05V9.7a4 4 0 00-4-4H9.7a4 4 0 00-4 4v16.7a4 4 0 004 4h3.6M18.525 18.525l-7.6-7.6m0 0v5.7m0-5.7h5.225",stroke:i,strokeWidth:"2.5",strokeLinecap:"round"})]})}function mv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:De("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.326 10H11.69a3.94 3.94 0 00-3.94 3.94v9.747a3.94 3.94 0 003.94 3.94h9.636l.27-.01a3.943 3.943 0 003.521-2.855l.075-.32 1.18.78a2.5 2.5 0 003.878-2.085V14.49a2.5 2.5 0 00-.415-1.379l-.142-.194a2.5 2.5 0 00-3.322-.512l-1.18.777-.005-.034A3.941 3.941 0 0021.326 10zm-9.636 2.563h9.636c.76 0 1.377.617 1.377 1.377l-.002 1.577.011.175a1.282 1.282 0 001.977.895l2.997-1.98v8.412l-2.997-1.98a1.282 1.282 0 00-1.988 1.07l.002 1.58c0 .758-.617 1.374-1.377 1.374H11.69c-.76 0-1.377-.616-1.377-1.376V13.94c0-.76.617-1.377 1.377-1.377zm2.81 5.687a1.5 1.5 0 100-3 1.5 1.5 0 000 3z",fill:r.color||"#fff"})})}function bv(r){return De("svg",{className:r.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:De("path",{d:"M21.564 21.01c-.342 0-.692.017-1.061.038-.399.024-.824.05-1.3.05-.58 0-1.049.468-1.049 1.048v2.908L11.344 19l6.81-6.054v2.908c0 .58.469 1.049 1.049 1.049 4.5 0 7.043 3.02 7.884 6.477-2.407-1.99-3.87-2.37-5.523-2.37zm-2.361 7.427a1.047 1.047 0 001.049-1.049v-4.225c.127-.006.252-.015.375-.022 2.04-.12 3.17-.187 7.091 3.645a1.048 1.048 0 001.782-.75c0-5.285-3.171-10.632-9.249-11.183V10.61a1.047 1.047 0 00-1.745-.783L9.07 18.217a1.046 1.046 0 000 1.566l9.437 8.39c.196.173.445.265.697.265z",fill:r.color||"#fff"})})}const Wu=64;function Ev(r){const i=or(Bn);if(!i)return De(ji,{});const{deps:{text:n},refresh:o}=i,s=()=>{o()},d=Ii(()=>r.message.length>Wu?r.message.substring(0,Wu):r.message,[r.message]);return De("div",{className:Qe["error-alert"],children:[De("div",{className:Qe["error-icon"]}),De("div",{className:Qe["error-title"],children:n(Ze.ERROR_PANEL_TITLE)}),De("div",{className:Qe["error-message"],children:[r.code," ",d]}),De("div",{className:Qe["error-retry"],onClick:s,children:[De(Av,{color:"#333",className:Qe["error-retry-icon"]}),De("span",{children:n(Ze.ERROR_PANEL_RETRY_BTN)})]})]})}function yv(){return De("div",{className:Qe.loading,children:De("div",{className:Qe["loading-spinner-frame"],children:De("div",{className:Qe.spinner,children:De("div",{className:Qe["kwai-layer"],children:[De("div",{className:Qe["spinner-mask-1"],children:De("div",{className:Qe["loading-spinner-mask-1-bg"]})}),De("div",{className:Qe["spinner-mask-2"],children:De("div",{className:Qe["loading-spinner-mask-2-bg"]})})]})})})})}const Os=[{val:2,label:"2.0"},{val:1.5,label:"1.5"},{val:1.25,label:"1.25"},{val:1,label:"正常"},{val:.75,label:"0.75"},{val:.5,label:"0.5"}],Do=Oa(void 0),Cv=r=>{var i;const{children:n,deps:{player:o}}=r,[s,d]=st(o.currentTime),[m,A]=st(o.duration),T={st:0,ed:0};o.buffered&&o.buffered.length&&(T.st=o.buffered.start(0),T.ed=(i=o.buffered)==null?void 0:i.end(0));const[C,h]=st(T),F=Ii(()=>{const B=Number.isFinite(m)&&m||C.ed;return B?C.ed/B*100:0},[m,C]),w=Ii(()=>{const B=Number.isFinite(m)&&m||C.ed;return B?s/B*100:0},[s,m,C]),I=br(B=>{o.duration!==1/0&&(o.currentTime=B,d(o.currentTime))},[o]),S=br(()=>{A(o.duration)},[o]),W=br(()=>{var B,J,be;(B=o.buffered)!=null&&B.length&&h({st:(J=o.buffered)==null?void 0:J.start(0),ed:(be=o.buffered)==null?void 0:be.end(0)})},[o]),j=br(()=>{d(o.currentTime)},[o]),N=br(()=>{A(o.duration)},[o]),K=br(()=>{d(0),A(0),h({st:0,ed:0})},[o]),z=br(()=>{d(o.currentTime)},[o]);return Un(()=>(o.on(Je.ATTRIBUTE_CHANGE_SRC,K),o.on(Je.LOADEDDATA,S),o.on(Je.TIMEUPDATE,j),o.on(Je.PROGRESS,W),o.on(Je.DURATIONCHANGE,N),o.on(Je.SEEKING,z),()=>{o.off(Je.ATTRIBUTE_CHANGE_SRC,K),o.off(Je.LOADEDDATA,S),o.off(Je.TIMEUPDATE,j),o.off(Je.PROGRESS,W),o.off(Je.DURATIONCHANGE,N),o.off(Je.SEEKING,z)}),[]),De(Do.Provider,{value:{player:o,currentTime:s,currentTimePercent:w,duration:m,buffered:C,bufferedPercent:F,seek:I},children:n})},Yu=Oa(void 0),Tv=r=>De(Yu.Provider,{value:{panelHover:r.panelHover,setPanelHover:r.setPanelHover,dragProgress:r.dragProgress,setDragProgress:r.setDragProgress,floatLayerId:r.floatLayerId,setFloatLayerId:r.setFloatLayerId,height:r.height,width:r.width,container:r.container},children:r.children}),Dn="#FFF",Iv={[Hi.DEFAULT]:[Dn],[Hi.HOVER]:["#1280FF"],[Hi.DISABLED]:[Dn]},ii=r=>r?Iv[r]||[Dn]:[Dn],Rv=Rs((r,i)=>{const n=or(Bn);if(!n)return De(ji,{});const{text:o,isLiveShift:s}=n,{disabled:d,className:m}=r,A=i&&i?i:Ot(null),[T,C]=st(Hi.DEFAULT),[h,F]=st(!1),w=()=>{n.jumpToLive()},I=()=>{r.disabled||Vt||(C(Hi.HOVER),F(!0))},S=()=>{C(Hi.DEFAULT),F(!1)};return jt(()=>{d||C(Hi.DEFAULT)},[s]),jt(()=>{d&&C(Hi.DEFAULT)},[d]),De("div",{ref:A,"data-kp-role":r["data-kp-role"],className:[m,d?Qe.disabled:""].join(" "),children:[!s&&De("div",{className:Qe["live-shift-chips"],children:[De(mv,{color:Dn,className:Qe["panel-button-icon"]}),De("div",{className:Qe["panel-button-text"],style:{color:Dn},children:o(Ze.LIVE)})]}),s&&De("div",{className:[Qe["live-shift-button"],d?Qe.disabled:""].join(" "),onMouseEnter:I,onMouseLeave:S,onClick:w,style:T===Hi.HOVER?{borderColor:ii(T)[0]}:{},children:[De(bv,{color:ii(T)[0]||Dn,className:Qe["panel-button-icon"]}),De("div",{className:Qe["panel-button-text"],style:{color:ii(T)[0]||Dn},children:o(Ze.RETURN_TO_LIVE)})]})]})}),wv=Rs(function(r,i){const n=or(Bn),o=or(Ss);if(!n||!o)return;const{overflowItems:s}=o,d=i&&i?i:Ot(null),[m,A]=st(!1),T=De(Lo,{checkedValue:n.playbackRate,onBack:()=>A(!1),levels:Os.map(B=>(B.val===1&&(B.label=n.text(Ze.PLAYBACK_RATE_NORMAL)),B)),onCheck:B=>{N(B),A(!1),r.onClose()},text:n.text}),[C,h]=st(!1),F=De(Lo,{checkedValue:n.currentLevel,onBack:()=>h(!1),levels:n.levels,onCheck:B=>{K(B),h(!1),r.onClose()},text:n.text}),[w,I]=st(!1),S=De(Lo,{checkedValue:n.currentAudioLevel,onBack:()=>I(!1),levels:n.audioLevels,onCheck:B=>{z(B),I(!1),r.onClose()},text:n.text}),[W,j]=st(!1);jt(()=>{const B=r.showOverflow&&(m||C||w);j(B);const J=d;if(B&&J.current){const{height:be}=J.current.getBoundingClientRect();let X=0;m?X=Os.findIndex(ye=>ye.val===n.playbackRate)||0:C?X=n.levels.findIndex(ye=>ye.val===n.currentLevel)||0:w&&(X=n.audioLevels.findIndex(ye=>ye.val===n.currentAudioLevel)||0),J.current.scrollTop=(X+1)*50-(be-50)/2}!B&&J.current&&(J.current.scrollTop=0)},[r.showOverflow,m,C,w]),jt(()=>{r.showOverflow||(A(!1),h(!1),I(!1))},[r.showOverflow]);const N=B=>{n.changePlaybackRate(B),r.onClose()},K=B=>{n.changeLevel(B),r.onClose()},z=B=>{n.changeAudioLevel(B),r.onClose()};return De("div",{className:[Qe.overflow,r.className].join(" "),ref:d,style:{maxHeight:r.overflowMaxheight},"data-kp-role":"overflow",children:[m&&T,C&&F,w&&S,n.levels.length>1&&!W&&De(Aa,{"data-kp-role":"video-btn",onClick:B=>{B.stopPropagation(),h(!0)},children:[n.text(Ze.VIDEO_TRACK),De("span",{style:{paddingLeft:"18px"}})]}),n.audioLevels.length>1&&!W&&De(Aa,{"data-kp-role":"audio-btn",onClick:B=>{B.stopPropagation(),I(!0)},children:[n.text(Ze.AUDIO_TRACK),De("span",{style:{paddingLeft:"18px"}})]}),n.showPlaybackRateOverflow&&!W&&De(Aa,{onClick:B=>{B.stopPropagation(),A(!0)},"data-kp-role":"rate-btn",children:[n.text(Ze.PLAYBACK_RATE),De("span",{style:{paddingLeft:"18px"}})]}),s&&!W&&s.map((B,J)=>De(Aa,{"data-kp-role":"inline-btn",onClick:()=>{r.onClose(),B.handle()},icon:B.icon?B.icon():"",checked:B.isChecked,type:"checkbox",children:B.name},J))]})});function Lo(r){return De(ji,{children:[De(Aa,{onClick:i=>{i.stopPropagation(),r.onBack()},children:r.text(Ze.OPTIONS)},0)].concat(r.levels.map((i,n)=>De(Aa,{type:"checkbox",checked:r.checkedValue===i.val,onClick:()=>{r.onCheck(i.val)},children:i.label},n+1)))})}function Aa(r){return De("div",{className:Qe["overflow-item"],onClick:r.onClick,"data-kp-role":r["data-kp-role"],children:[De("div",{className:Qe["overflow-content"],children:De("span",{children:r.children})}),r.type==="checkbox"&&De("input",{type:"checkbox",className:Qe["overflow-checkbox"],checked:r.checked})]})}const en=Rs((r,i)=>{const{disabled:n,className:o,text:s,onChildrenVisibilityChange:d,tip:m,lowTipPos:A,resetOnClick:T,childrenVisibility:C}=r,h=i&&i?i:Ot(null),[F,w]=st(Hi.DEFAULT),[I,S]=st(!1),W=Ot(0),[j,N]=st(!1);jt(()=>{r.childrenVisibility===!1&&N(!1)},[r.childrenVisibility]);const K=()=>{W.current&&(clearTimeout(W.current),W.current=0)},z=Ot(null),B=ye=>{!n&&r.onClick&&r.onClick(ye),(T||z.current&&ye.target&&z.current.contains(ye.target))&&(S(!1),Vt||w(Hi.DEFAULT))},J=()=>{if(r.disabled)return;Vt||(w(Hi.HOVER),S(!0));const ye=!j;N(!0),r.children&&ye&&d&&d(!0,r.id),K()},be=()=>{w(Hi.DEFAULT),S(!1),r.children&&(W.current=+setTimeout(()=>{N(!1),d&&d(!1,r.id)},300))},X=()=>{if(r.disabled)return;Vt||(w(Hi.HOVER),S(!0));const ye=!j;N(!0),r.children&&ye&&d&&d(!0,r.id),K()};return jt(()=>{const ye=Be=>{if(r.children&&!("current"in h&&h.current&&(h.current===Be.target||h.current.contains(Be.target)))){const Ve=j;N(!1),r.children&&Ve&&d&&d(!1,r.id),w(Hi.DEFAULT)}};return r.children&&document.addEventListener("click",ye),()=>r.children&&document.removeEventListener("click",ye)},[j]),jt(()=>{(n||!C)&&w(Hi.DEFAULT)},[n,C]),jt(()=>()=>{K()},[]),De("div",{ref:h,"data-kp-role":r["data-kp-role"],onMouseEnter:J,onMouseLeave:be,onMouseMove:X,onClick:B,className:[Qe["panel-button-wrapper"],o,n?Qe.disabled:""].join(" "),children:[j&&r.children,m&&I&&De("div",{"data-kp-role":r["data-kp-role"]?`${r["data-kp-role"]}-tip`:"btn-tip",className:[Qe["panel-button-tip"],A?Qe["panel-button-tip-low-pos"]:""].join(" "),children:De("div",{className:Qe.text,children:m})}),r.icon&&r.icon(F),s&&De("div",{className:Qe["panel-button-text"],style:{color:r.color?r.color(F):Dn},children:s})]})});function Dv(r){const i=or(Bn),n=or(Do);if(!i||!n)return De(ji,{});const{deps:{pluginRotate:o,pluginPreview:s}}=i,d=Ot(null),m=Ot(0),[A,T]=st(0),[C,h]=st(!1),[F,w]=st(0);jt(()=>{if(j.current){const{width:ue}=j.current.getBoundingClientRect();w(ue/2)}}),jt(()=>{r.previewVisibility===!1&&(S.current=!1,Be())},[r.previewVisibility]);const I=ue=>{if(!S.current||r.disabled||!d)return;ue.defaultPrevented&&ue.preventDefault();const L=ue instanceof MouseEvent?ue.clientX:ue.changedTouches[0].clientX,D=ue instanceof MouseEvent?ue.clientY:ue.changedTouches[0].clientY,le=d.current,oe=d.current;if((S||ue instanceof PointerEvent||Vt&&ue instanceof MouseEvent)&&le&&oe){let Re=0;const{top:Oe,left:de,width:$,height:ge}=oe.getBoundingClientRect();(o==null?void 0:o.outerRotate)===90?Re=(D-Oe)/ge:(o==null?void 0:o.outerRotate)===180?Re=($-(L-de))/$:(o==null?void 0:o.outerRotate)===270?Re=(ge-(D-Oe))/ge:o!=null&&o.outerRotate||(Re=(L-de)/$),Re>1&&(Re=1),Re<0&&(Re=0),je(Re),m.current=Re,T(Re*100),r.onChange&&r.onChange(Re)}};jt(()=>{const ue=()=>{S.current&&r.onChangeEnd&&r.onChangeEnd(m.current),S.current=!1,W.current||Ve()},L=()=>{W.current=!1,ue()},D=le=>{I(le)};return document.addEventListener("mouseup",ue),document.addEventListener("mouseleave",L),document.addEventListener("touchend",ue),document.addEventListener("mousemove",D,!0),document.addEventListener("touchmove",D,!0),()=>{document.removeEventListener("mouseup",ue),document.removeEventListener("mouseleave",L),document.removeEventListener("touchend",ue),document.removeEventListener("mousemove",D,!0),document.removeEventListener("touchmove",D,!0)}},[i,n]);const S=Ot(!1),W=Ot(!1),j=Ot(null),N=ue=>{r.disabled||(S.current=!0,ue.stopImmediatePropagation(),I(ue))},K=ue=>{if(!r.disabled&&ue instanceof MouseEvent){W.current=!0;const L=ue.currentTarget,{left:D,width:le}=L.getBoundingClientRect(),oe=(ue.clientX-D)/le;S.current||je(oe),r.onMouseMove&&r.onMouseMove(oe,S.current)}},z=()=>{W.current=!1,r.onMouseLeave&&r.onMouseLeave(S.current),S.current||Ve()},B=Ot(null),J=Ot(null),[be,X]=st(""),ye=Ot(0),Be=()=>{ye.current&&(clearTimeout(ye.current),ye.current=0)},Ve=()=>{Be();const ue=B.current&&B.current.style.visibility!=="hidden";B.current&&(B.current.style.visibility="hidden",B.current.style.display="block"),ue&&r.onPreviewVisibilityChange&&r.onPreviewVisibilityChange(!1,r.id)},je=ue=>{if(Vt||!(s!=null&&s.hasPreview)&&!i.showProgressTime)return;const L=d.current,D=n.duration,le=s,oe=B.current;if(!L||!Number.isFinite(D)||!oe||!J.current||o!=null&&o.outerRotate)return;const{width:Re}=L.getBoundingClientRect();let Oe=ue*D;Oe<0&&(Oe=0),Oe>D&&(Oe=D);let de;if(s!=null&&s.hasPreview){if(de=le==null?void 0:le.getImgByTime(Oe),h(!!de),!de&&!i.showProgressTime)return}else h(!1);const $=Re*ue;if(oe.style.visibility==="hidden"){ye.current||(ye.current=+setTimeout(()=>{ye.current=0,J.current&&we(oe,J.current,de,Oe,$,Re)},300));return}else we(oe,J.current,de,Oe,$,Re)},we=(ue,L,D,le,oe,Re)=>{if(X(go(le,n.duration>=3600)),D){const $=144/D.h;ue.style.width=`${D.w*$/24}em`,ue.style.height=`${D.h*$/24}em`,L.style.transform=`scale(${ue.getBoundingClientRect().width/D.w})`,L.style.backgroundImage=`url(${D.url})`,L.style.height=`${D.h}px`,L.style.width=`${D.w}px`,L.style.backgroundPosition=`-${D.x}px -${D.y}px`}else ue.style.width="",ue.style.height="",L.style.transform="",L.style.backgroundImage="",L.style.height="",L.style.width="",L.style.backgroundPosition="";const{width:Oe}=ue.getBoundingClientRect();oe=oe-Oe/2,oe<0?oe=0:oe>Re-Oe&&(oe=Re-Oe);const de=ue.style.visibility==="visible";ue.style.transform=`translateX(${oe}px)`,ue.style.visibility="visible",de&&r.onPreviewVisibilityChange&&r.onPreviewVisibilityChange(!0,r.id)};return jt(()=>()=>{Be()},[]),De("div",{"data-kp-role":r["data-kp-role"],className:[Qe["segmented-track"],r.disabled?Qe.disabled:"",r.className].join(" "),style:{cursor:Vt?"default":""},ref:d,onMouseLeave:z,onMouseDown:N,onMouseMove:K,onMouseEnter:K,onTouchStart:N,onTouchMove:K,onTouchEnd:z,onClick:K,children:[De("div",{ref:B,style:{visibility:"hidden"},className:Qe.preview,children:[De("div",{ref:J,className:Qe["preview-img"]}),De("div",{className:[Qe["preview-time"],C?"":Qe["preview-time-no-img"]].join(" "),children:De("div",{children:be})})]}),De("div",{className:[Qe["segment-background"]].join(" "),children:[De("div",{className:Qe["segment-highlight-before"],style:{width:`${n.bufferedPercent}%`}}),De("div",{className:Qe["segment-highlight-after"],style:{width:`${S.current?A:n.currentTimePercent}%`}})]}),!r.disabled&&De("div",{className:[Qe.thumb,S.current?Qe["thumb-drag"]:""].join(" "),ref:j,style:{left:`calc(${S.current?A:n.currentTimePercent}% - ${F}px)`}})]})}function Lv(r){const i=or(Bn);if(!i)return De(ji,{});const{deps:{pluginRotate:n}}=i,o=Ot(null),s=Ot(null),d=Ii(()=>100-r.leftWidth,[r.beforeWidth,r.leftWidth]),[m,A]=st(!1),T=w=>{A(!0),C(w,!0)},C=(w,I=!1)=>{w.preventDefault();const S=w instanceof MouseEvent?w.clientX:w.changedTouches[0].clientX,W=w instanceof MouseEvent?w.clientY:w.changedTouches[0].clientY,j=o.current,N=o.current;if((m||I||w instanceof PointerEvent||Vt&&w instanceof MouseEvent)&&j&&N){const{left:K,right:z}=j.getBoundingClientRect();if(S<K||S>z)A(!1);else{let B=0;const{top:J,left:be,width:X,height:ye}=N.getBoundingClientRect();(n==null?void 0:n.outerRotate)===90?B=parseFloat(((X-(S-be))/X).toFixed(2)):(n==null?void 0:n.outerRotate)===180?B=parseFloat(((ye-(W-J))/ye).toFixed(2)):(n==null?void 0:n.outerRotate)===270?B=parseFloat(((S-be)/X).toFixed(2)):B=parseFloat(((W-J)/ye).toFixed(2)),r.onChange&&r.onChange(1-B)}}},h=()=>{A(!1)},F=()=>{A(!1)};return De("div",{"data-kp-role":r["data-kp-role"],className:[Qe["segmented-vertical-track"],r.className].join(" "),style:{cursor:Vt?"default":"pointer"},ref:o,onMouseUp:h,onMouseLeave:F,onMouseDown:T,onMouseMove:C,onTouchStart:T,onTouchMove:C,onTouchEnd:F,onClick:C,children:[De("div",{className:Qe["segment-vertical-background"],children:[De("div",{className:Qe["segment-vertical-highlight-before"],style:{height:`${r.beforeWidth}%`}}),De("div",{className:Qe["segment-vertical-highlight-after"],style:{height:`${r.leftWidth}%`}})]}),De("div",{className:Qe["thumb-vertical"],ref:s,style:{top:`${d}%`}})]})}function Sv(r){return De("div",{className:[Qe.tooltip,r.lowTipPos?Qe["tooltip-low-pos"]:""].join(" "),children:De("div",{children:r.text})})}const Ov="ui-panel",Nv=r=>{var i,n,o;const s=or(Bn),d=or(Do),m=or(Yu),A=or(Ss);if(!s||!d||!m||!A)return De(ji,{});const{player:T,text:C,disabled:h,deps:{options:F}}=s,{setPanelHover:w,floatLayerId:I,setFloatLayerId:S,container:W}=m,j=Ot(null),N=Ii(()=>r.showPanel&&!(Vt&&s.error),[r.showPanel,s.error]);jt(()=>{s.deps.options.stateChange&&s.deps.options.stateChange({type:"controlsVisibility",value:N})},[N]),jt(()=>{var re,k;const P=Ie=>{var Ee;(Ee=Pe.current)!=null&&Ee.contains(Ie.target)||S(0)},Z=()=>{Vt||w(!0)},he=()=>{w(!1)};return document.addEventListener("click",P),(re=j.current)==null||re.addEventListener("mouseenter",Z),(k=j.current)==null||k.addEventListener("mouseleave",he),()=>{var Ie,Ee;document.removeEventListener("click",P),(Ie=j.current)==null||Ie.removeEventListener("mouseenter",Z),(Ee=j.current)==null||Ee.removeEventListener("mouseleave",he)}},[]);const K=re=>{d.seek(re)},z=re=>{Number.isFinite(d.duration)&&T.emit(Je.INTERACTION,{type:"progresschange",data:{time:re*d.duration}}),F.seekMode==="onDragChange"&&K(re*d.duration)},B=re=>{F.seekMode!=="onDragChange"&&K(re*d.duration)},J=Ot(null),be=Ot(null),X=Ot(null),ye=Ot(null),Be=Ot(null),Ve=Ot(null),je=Ot(null),we=Ot(null),ue=Ot(null),L=Ot(null),D=Ot(null),le=Ot(null),oe=Ot(null),Re=()=>{if(m.width&&be.current&&J.current&&Le.current&&ne.current){const re=ne.current.getBoundingClientRect().width,k=[Le,ye,Be,Ve,D,le,je,X,we,ue,L,oe];if(!J.current.getBoundingClientRect().width)return;k.forEach(Z=>{Z.current&&(Z.current.style.display="")});let P=be.current.getBoundingClientRect().width+J.current.getBoundingClientRect().width+Le.current.getBoundingClientRect().width;k.forEach(Z=>{if(Z.current&&P>re){const he=Z.current?Math.ceil(Oe(Z.current)/5)*5:0;P-=he,Z.current.style.display="none"}})}},Oe=re=>{const k=getComputedStyle(re);return re.getBoundingClientRect().width+(parseFloat(k.marginLeft)||0)+(parseFloat(k.marginRight)||0)},de=Ii(()=>Vt&&(s.audioLevels.length>1||s.levels.length>1||s.showPlaybackRateOverflow||A.overflowItems.length>0),[s.audioLevels,s.levels,s.showPlaybackRate,A.overflowItems]);Un(()=>{Re()},[m.width,s.levels,s.audioLevels,s.showFullScreen,s.showPlaybackRate,s.showProgress,s.showTime,s.showPictureInPicture,s.isLive,d.duration]),jt(()=>{r.showPanel?setTimeout(Re,0):S(0)},[r.showPanel]),jt(()=>{S(0)},[s.error]);const[$,ge]=st(250);jt(()=>{if(D.current){const{top:re}=D.current.getBoundingClientRect(),{top:k}=W.getBoundingClientRect();ge(Math.min(re-k-15,250));return}ge(250)},[m.height,I]);const Pe=Ot(null),ae=re=>{Pe.current&&(Pe.current===re.target||Pe.current.contains(re.target))||s.toggleMuted()},[q,b]=st(""),ve=Ot(0),U=()=>{ve.current&&(clearTimeout(ve.current),ve.current=0)},M=re=>{var k;const P=T==null?void 0:T.getAllPlugins(),Z=[];for(let he=0;he<(P.length||0);he++)P[he].controlsSoltBtns&&((k=P[he].controlsSoltBtns)==null||k.forEach(Ie=>{const Ee=Ie.svgRaw;Ie.slotPos===re&&Ee&&Z.push(De(en,{icon:pe=>De("div",{style:{color:ii(pe)[0]},className:Qe["panel-button-icon-plugin"],dangerouslySetInnerHTML:{__html:Ee}}),className:Qe["panel-button-margins-left"],color:pe=>ii(pe)[0],onClick:Ie.onClick,disabled:h,tip:Ie.getTips?Ie.getTips():"",lowTipPos:!s.showProgress,"data-kp-role":Ie.role}))}));return Z};jt(()=>(q&&(U(),ve.current=+setTimeout(()=>{b("")},3e3)),()=>{U()}),[q]),jt(()=>{s.muted?d.duration>0&&b(C(Ze.CURRENTLY_MUTED)):b(`${C(Ze.CURRENT_VOLUME)}:${Math.floor(s.volume*100)}`)},[s.volume]),Un(()=>{const re=()=>{var Ie,Ee;s.levels.length<2||(Ie=s.levels.find(pe=>pe.val===T.currentLevel))!=null&&Ie.label&&b(`${C(Ze.SWITCHING_TO_VIDEO)} ${((Ee=s.levels.find(pe=>pe.val===s.currentLevel))==null?void 0:Ee.label)||""}`)},k=()=>{var Ie,Ee;s.levels.length<2||(Ie=s.levels.find(pe=>pe.val===T.currentLevel))!=null&&Ie.label&&b(`${C(Ze.SWITCH_TO_VIDEO)} ${((Ee=s.levels.find(pe=>pe.val===T.currentLevel))==null?void 0:Ee.label)||""} ${C(Ze.FAIL)}`)},P=()=>{var Ie,Ee;s.levels.length<2||(Ie=s.levels.find(pe=>pe.val===T.currentLevel))!=null&&Ie.label&&b(`${C(Ze.SWITCHED_TO_VIDEO)} ${((Ee=s.levels.find(pe=>pe.val===T.currentLevel))==null?void 0:Ee.label)||""}`)},Z=Ie=>{var Ee;s.audioLevels.length<2||b(`${C(Ze.SWITCHING_TO_AUDIO)} ${((Ee=s.audioLevels.find(pe=>pe.val===Ie.level))==null?void 0:Ee.label)||""}`)},he=Ie=>{var Ee;s.audioLevels.length<2||b(`${C(Ze.SWITCHED_TO_AUDIO)} ${((Ee=s.audioLevels.find(pe=>pe.val===Ie.level))==null?void 0:Ee.label)||""}`)};return T.on(Je.LEVEL_SWITCHING,re),T.on(Je.LEVEL_SWITCH_FAILED,k),T.on(Je.LEVEL_SWITCH_PLAYING,P),T.on(Je.AUDIO_TRACKS_SWITCHING,Z),T.on(Je.AUDIO_TRACKS_SWITCHED,he),()=>{T.off(Je.LEVEL_SWITCHING,re),T.off(Je.LEVEL_SWITCH_FAILED,k),T.off(Je.LEVEL_SWITCH_PLAYING,P),T.off(Je.AUDIO_TRACKS_SWITCHING,Z),T.off(Je.AUDIO_TRACKS_SWITCHED,he)}},[s.levels]);const ne=Ot(null),Le=Ot(null);jt(()=>{const re=r.danmakuControls();Le.current&&re&&(r.dankamuControlsActive?Le.current.appendChild(re):Le.current.innerHTML="")},[r.dankamuControlsActive]);const Ue=(re,k=0)=>{S(re?k:0)};return jt(()=>()=>{U()},[]),De("div",{ref:j,style:{opacity:N?1:0},className:Qe["bottom-controls"],children:[De("div",{className:Qe["bottom-controls-bg"]}),s.showProgress&&De(Dv,{"data-kp-role":"timeline",disabled:h,className:Qe.timeline,onChange:z,onChangeEnd:B,id:1,previewVisibility:I===1,onPreviewVisibilityChange:Ue}),F.showBottomButtonBar&&De("div",{ref:ne,className:Qe["button-panel"],children:[De("div",{ref:J,className:Qe["button-panel-left"],children:[De(en,{icon:s.paused?re=>De(sv,{color:ii(re)[0],className:Qe["panel-button-icon"]}):re=>De(ov,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],onClick:s.togglePlay,disabled:h,lowTipPos:!s.showProgress,"data-kp-role":"play-btn"}),s.showTime&&De("div",{ref:X,className:Qe["current-time-display"],children:De("div",{children:go(d.currentTime,d.duration>=3600)})}),d.duration!==1/0&&!isNaN(d.duration)&&s.showTime&&De("div",{ref:je,className:Qe["time-remaining-display"],children:De("div",{children:["/ ",go(d.duration,d.duration>=3600)]})}),s.liveShiftEnabled&&De(Rv,{className:[Qe["panel-button-margins-left"],Qe["live-shift"]].join(" "),"data-kp-role":"live-shift-btn",disabled:h}),M(ka.PLAY_BAR_LEFT)]}),De("div",{ref:Le,className:Qe["button-panel-center"]}),De("div",{ref:be,className:Qe["button-panel-right"],children:[s.audioLevels.length>1&&!Vt&&De(en,{ref:ye,text:((i=s.audioLevels.find(re=>re.val===s.currentAudioLevel))==null?void 0:i.label)||"",id:4,childrenVisibility:I===4,onChildrenVisibilityChange:Ue,className:Qe["panel-button-margins-left"],color:re=>ii(re)[0],children:De("div",{className:Qe["bottom-popup-layer"],children:De("div",{className:[Qe["panel-playback-list"],s.showProgress?"":Qe["bottom-popup-layer-low-pos"]].join(" "),children:s.audioLevels.map((re,k)=>De("div",{className:Qe["playback-rate"],onClick:()=>{s.changeAudioLevel(re.val),S(0)},children:De("div",{children:re.label})},k))})})}),s.levels.length>1&&!Vt&&De(en,{ref:Be,text:((n=s.levels.find(re=>re.val===s.currentLevel))==null?void 0:n.label)||"",id:3,childrenVisibility:I===3,onChildrenVisibilityChange:Ue,className:Qe["panel-button-margins-left"],color:re=>ii(re)[0],children:De("div",{className:Qe["bottom-popup-layer"],children:De("div",{className:[Qe["panel-playback-list"],s.showProgress?"":Qe["bottom-popup-layer-low-pos"]].join(" "),children:s.levels.map((re,k)=>De("div",{className:Qe["playback-rate"],onClick:()=>{s.changeLevel(re.val),S(0)},children:De("div",{children:re.label})},k))})})}),s.showPlaybackRate&&De(en,{ref:Ve,"data-kp-role":"play-rate",id:2,childrenVisibility:I===2,onChildrenVisibilityChange:Ue,text:s.playbackRate===1?C(Ze.PLAYBACK_RATE_SHORT):((o=Os.find(re=>re.val===s.playbackRate))==null?void 0:o.label)||s.playbackRate.toString(),disabled:h,className:Qe["panel-button-margins-left"],color:re=>ii(re)[0],children:De("div",{className:Qe["bottom-popup-layer"],children:De("div",{className:[Qe["panel-playback-list"],s.showProgress?"":Qe["bottom-popup-layer-low-pos"]].join(" "),children:Os.map((re,k)=>(re.val===1&&(re.label=C(Ze.PLAYBACK_RATE_NORMAL)),De("div",{className:Qe["playback-rate"],"data-kp-role":"playrate-item",onClick:()=>{T.logger.i(Ov,"playback rate",re.val),S(0),s.changePlaybackRate(re.val)},children:De("div",{children:re.label})},k)))})})}),s.showRefresh&&De(en,{ref:we,icon:re=>De(_v,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],onClick:s.refresh,tip:C(Ze.REFRESH),lowTipPos:!s.showProgress,className:Qe["panel-button-margins-left"],disabled:h,"data-kp-role":"refresh-btn"}),M(ka.PLAY_BAR_RIGHT),De(en,{ref:oe,icon:s.muted?re=>De(pv,{color:ii(re)[0],className:Qe["panel-button-icon"]}):re=>De(cv,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],"data-kp-role":"mute-btn",id:5,childrenVisibility:I===5,onChildrenVisibilityChange:Ue,onClick:ae,className:Qe["panel-button-margins-left"],disabled:h,children:!Vt&&De("div",{className:Qe["bottom-popup-layer"],children:De("div",{className:[Qe["panel-volume-wrapper"],s.showProgress?"":Qe["bottom-popup-layer-low-pos"]].join(" "),ref:Pe,"data-kp-role":"volume-panel",children:[De("div",{className:Qe["volume-text"],children:(s.volume*100).toFixed(0)}),De(Lv,{"data-kp-role":"volume-track",leftWidth:s.volume*100,beforeWidth:s.volume*100,onChange:s.changeVolume})]})})}),s.showPictureInPicture&&De(en,{ref:le,icon:s.isInPIP?re=>De(gv,{color:ii(re)[0],className:Qe["panel-button-icon"]}):re=>De(vv,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],onClick:s.changePIP,disabled:h,tip:s.isInPIP?C(Ze.EXIT_PICTURE_IN_PICTURE):C(Ze.PICTURE_IN_PICTURE),lowTipPos:!s.showProgress,className:Qe["panel-button-margins-left"],"data-kp-role":"picture-in-picture-btn"}),!s.isFullscreen&&s.showWindowFullScreen&&De(en,{ref:L,icon:s.isWindowFullscreen?re=>De(dv,{color:ii(re)[0],className:Qe["panel-button-icon"]}):re=>De(hv,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],onClick:s.toggleWindowFullscreen,disabled:h,tip:s.isWindowFullscreen?C(Ze.EXIT_WINDOW_FULLSCREEN):C(Ze.WINDOW_FULLSCREEN),lowTipPos:!s.showProgress,className:Qe["panel-button-margins-left"],"data-kp-role":"window-fullscreen-btn",resetOnClick:!0}),s.showFullScreen&&!Vt&&De(en,{ref:ue,icon:s.isFullscreen?re=>De(uv,{color:ii(re)[0],className:Qe["panel-button-icon"]}):re=>De(lv,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],onClick:s.toggleFullscreen,disabled:h,tip:s.isFullscreen?C(Ze.EXIT_FULLSCREEN):C(Ze.FULLSCREEN),lowTipPos:!s.showProgress,className:Qe["panel-button-margins-left"],"data-kp-role":"fullscreen-btn",resetOnClick:!0}),de&&De(en,{ref:D,icon:re=>De(fv,{color:ii(re)[0],className:Qe["panel-button-icon"]}),color:re=>ii(re)[0],"data-kp-role":"overflow-btn",onClick:re=>{re.stopPropagation(),S(I===6?0:6)},className:Qe["panel-button-margins-left"],disabled:h}),Vt&&De(wv,{className:`${Qe.overflow} ${I===6?"":Qe.closed}`,overflowMaxheight:$,showOverflow:I===6,onClose:()=>S(0)})]})]}),q&&De(Sv,{text:q,lowTipPos:!s.showProgress})]})};function xv(r){const i=or(Bn);if(!i)return De(ji,{});const{player:n,text:o,deps:{options:s,pluginVr:d,pluginDanmaku:m}}=i,[A,T]=st(!1),[C,h]=st(!1),[F,w]=st(""),[I,S]=st(0),W=Ot(void 0),[j,N]=st(r.container.getBoundingClientRect().width),[K,z]=st(r.container.getBoundingClientRect().height);Un(()=>{setTimeout(()=>{W.current=m==null?void 0:m.getControlPanelDom()},0);const ie=()=>{k(!1)};document.addEventListener("click",ie);const ee=new W0;return ee.start(r.container,[r.container],Te=>Te.forEach(Se=>{N(Se.contentRect.width),z(Se.contentRect.height)})),B.current&&r.videoLayer&&r.videoInteractive&&(B.current.insertAdjacentElement("afterbegin",r.videoInteractive),B.current.insertAdjacentElement("afterbegin",r.videoLayer)),()=>{document.removeEventListener("click",ie),W.current=void 0,ee.stop()}},[]);const B=Ot(null),[J,be]=st(!0);jt(()=>(B.current&&r.videoLayer&&r.videoInteractive&&(r.videoInteractive.addEventListener("click",L),r.videoInteractive.addEventListener("dblclick",D)),()=>{r.videoInteractive&&(r.videoInteractive.removeEventListener("click",L),r.videoInteractive.removeEventListener("dblclick",D))}),[i,J,I]),jt(()=>{const ie=n.mainContainer;ie&&(i.isFullscreen?ie.style.display="flex":ie.style.display="")},[i.isFullscreen]);const X=Ot(0),[ye,Be]=st(2),Ve=()=>{Be(2),X.current&&(clearTimeout(X.current),X.current=0)},je=()=>{Ve(),Be(0),X.current=+setTimeout(()=>{Be(1)},3e3)},we=Ii(()=>{var ie;return!i.paused&&!i.error&&!F&&!I&&!C&&!((ie=B.current)!=null&&ie.contains(document.activeElement))},[i.paused,i.error,F,I,C]);jt(()=>{ye===1&&(we?(Be(2),be(!1)):je())},[ye]),jt(()=>{we&&be(!1)},[i.error,F,C]),jt(()=>{!A&&we&&be(!1)},[I]),jt(()=>{we&&ye===2&&be(!1)},[i.paused]);const ue=()=>{Ve(),be(!0)};Un(()=>(je(),n.on(Je.PAUSE,ue),n.on(Je.ERROR,ue),()=>{n.off(Je.PAUSE,ue),n.off(Je.ERROR,ue)}),[]);const L=()=>{!n.controls||b.current||(je(),Vt?we&&(J?(be(!1),Ve()):(be(!0),je())):!i.disabled&&!(d!=null&&d.active)&&i.togglePlay())},D=()=>{var ie,ee;n.controls&&(i.toggleFullscreen(),window.getSelection?(ie=window.getSelection())==null||ie.removeAllRanges():(ee=document.getSelection())==null||ee.empty())},le=ie=>{Vt||(T(!0),ue(),je(),d!=null&&d.active&&Re&&(ie.preventDefault(),q(ie.clientX,ie.clientY)))},oe=()=>{T(!1),Oe(void 0),we&&(Ve(),be(!1))},[Re,Oe]=st(void 0),de=ie=>{d!=null&&d.active&&Oe({vrX:d.xAxis,vrY:d.yAxis,interactiveX:ie.clientX,interactiveY:ie.clientY})},$=()=>{Oe(void 0)},ge=ie=>{d!=null&&d.active&&Oe({vrX:d.xAxis,vrY:d.yAxis,interactiveX:ie.changedTouches[0].clientX,interactiveY:ie.changedTouches[0].clientY})},Pe=()=>{Oe(void 0)},ae=ie=>{ue(),je(),d!=null&&d.active&&Re&&(q(ie.changedTouches[0].clientX,ie.changedTouches[0].clientY),ie.preventDefault())},q=(ie,ee)=>{if(d!=null&&d.active&&Re){const{width:Te,height:Se}=r.container.getBoundingClientRect();d.yAxis=Re.vrY-(ie-Re.interactiveX)/Te*Math.PI/2,d.xAxis=Re.vrX+(ee-Re.interactiveY)/Se*Math.PI/2}},b=Ot(null),[ve,U]=st(0),[M,ne]=st(0),[Le,Ue]=st(!1);jt(()=>{const ie=ee=>{var Te;(Te=b.current)!=null&&Te.contains(ee.target)||(ee.preventDefault(),Ue(!1),k(!0),setTimeout(()=>{if(!b.current||!r.container)return;const{width:Se,height:Ye,left:ze,top:it}=r.container.getBoundingClientRect(),{width:ct,height:nt}=b.current.getBoundingClientRect();U(Math.min(ee.clientX-ze+5,Se-ct)),ne(Math.min(ee.clientY-it+5,Ye-nt)),Ue(!0)},0))};return i.controls&&i.showContextMenu&&r.container.addEventListener("contextmenu",ie),()=>r.container.removeEventListener("contextmenu",ie)},[i.controls]);const[re,k]=st(!1),P=()=>{k(!re)},Z=()=>!!(m&&n.disableDanmaku!==!0),he=()=>{const ie=Z(),ee=i.isFullscreen||i.isWindowFullscreen,Te=s.danmakuControls,Se=s.danmakuControlsFull;Ee(!Vt&&ie&&(ee?Se===Yn.PLAY_BAR:Te===Yn.PLAY_BAR));const Ye=!Vt&&ie&&(ee?Se===Yn.BOTTOM:Te===Yn.BOTTOM);te(Ye);const ze=W.current;ze&&Ye&&pe.current&&m&&(ze.classList.add(Qe["sending-area-controls"]),pe.current.appendChild(ze))},[Ie,Ee]=st(!1),pe=Ot(null),[G,te]=st(!1);return jt(()=>(n.on(Je.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS,he),n.on(Je.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN,he),n.on(Je.ATTRIBUTE_CHANGE_DISABLE_DANMAKU,he),()=>{n.off(Je.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS,he),n.off(Je.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN,he),n.off(Je.ATTRIBUTE_CHANGE_DISABLE_DANMAKU,he)}),[]),jt(he,[i.isFullscreen,i.isWindowFullscreen,Vt,G]),jt(()=>()=>{Ve()},[]),De(ji,{children:[De("div",{ref:B,className:Qe["video-area"],onMouseDown:de,onMouseUp:$,onTouchStart:ge,onTouchEnd:Pe,onTouchMove:ae,onMouseMove:le,onMouseLeave:oe,children:[i.controls&&i.waiting&&De(yv,{}),i.controls&&re&&!Vt&&De(av,{ref:b,visible:Le,onChangeShowContextMenu:P,left:ve,top:M}),i.controls&&i.error&&De(Ev,{text:o,code:i.error.code,message:i.error.message}),i.controls&&De(Tv,{panelHover:C,setPanelHover:h,dragProgress:F,setDragProgress:w,floatLayerId:I,setFloatLayerId:S,width:j,height:K,container:r.container,children:De(Cv,{deps:i.deps,children:De(Nv,{style:{},dankamuControlsActive:Ie,danmakuControls:()=>W.current,showPanel:J})})})]}),G&&De("div",{ref:pe,className:Qe["sending-area"]})]})}class kv{constructor(i,n){Si(this,"_label"),Si(this,"_player"),Si(this,"_i18n"),Si(this,"_rotate"),Si(this,"_preview"),Si(this,"_vr"),Si(this,"_danmaku"),Si(this,"_options",{}),Si(this,"text",o=>{var s;return((s=this._i18n)==null?void 0:s.text(this._label,o))||H0[o]||""}),this._label=i,this._player=n,this._i18n=n.getPluginInstance(Fu),this._rotate=n.getPluginInstance(ju),this._preview=n.getPluginInstance(Hu),this._vr=n.getPluginInstance(Gu),this._danmaku=n.getPluginInstance(zu)}get player(){return this._player}get pluginRotate(){return this._rotate}get pluginPreview(){return this._preview}get pluginVr(){return this._vr}get pluginDanmaku(){return this._danmaku}set options(i){this._options=i}get options(){return this._options}}class Qu extends j0{constructor(){super(),Si(this,"_player"),Si(this,"container"),Si(this,"_videoInteractive"),Si(this,"_videoLayer"),Si(this,"_danmaku"),Si(this,"_deps"),Si(this,"_onSrcChange",()=>{var i;if(!this.container)throw new Error("container is undefined");const n=(i=this._player)==null?void 0:i.mainContainer;n&&this._videoLayer&&(n==null||n.appendChild(this._videoLayer)),Sa(null,this.container),this._player&&this._renderUI()})}beforeInstall(i){this._player=i,this._deps=new kv(this.getLabel(),i),this._danmaku=this._deps.pluginDanmaku,i.on(Je.ATTRIBUTE_CHANGE_SRC,this._onSrcChange)}afterInstall(i,n){if(this._player=i,!i)throw new Error("player is undefined");if(this._deps&&(this._deps.options={danmakuControls:!!this._danmaku&&(n==null?void 0:n.danmakuControlsPos)||Yn.NONE,danmakuControlsFull:!!this._danmaku&&(n==null?void 0:n.danmakuControlsPosFullscreen)||Yn.PLAY_BAR,showBottomButtonBar:(n==null?void 0:n.showBottomButtonBar)!==!1,showProgress:n==null?void 0:n.showProgress,showTime:(n==null?void 0:n.showTime)!==!1,showNext:n==null?void 0:n.showNext,showPrev:n==null?void 0:n.showPrev,showWindowFullScreen:n==null?void 0:n.showWindowFullScreen,seekMode:n==null?void 0:n.seekMode,showProgressTime:n==null?void 0:n.showProgressTime,showPlaybackRate:n==null?void 0:n.showPlaybackRate,showContextMenu:n==null?void 0:n.showContextMenu,stateChange:n==null?void 0:n.stateChange}),this.container=i.createSubContainer(),this._videoInteractive=i.videoInteractiveLayer,this._videoLayer=i.videoLayer,!this.container)throw new Error("container is undefined");this.container.className=Qe.controls,this._renderUI()}beforeUninstall(){this.container&&Sa(null,this.container)}afterUninstall(){this._player&&this._player.off(Je.ATTRIBUTE_CHANGE_SRC,this._onSrcChange)}_renderUI(){this.container&&this._deps&&Sa(De(z0,{deps:this._deps,children:De(K0,{deps:this._deps,children:De(xv,{container:this.container,videoLayer:this._videoLayer,videoInteractive:this._videoInteractive})})}),this.container)}}Si(Qu,"version","1.1.0-alpha.0");const Mv=[{lang:"en",map:{[mo]:{[Ze.PLAY]:"Play",[Ze.PAUSE]:"Pause",[Ze.REFRESH]:"Refresh",[Ze.NEXT]:"Next",[Ze.TURN_ON_LOOP]:"Turn on loop",[Ze.TURN_OFF_LOOP]:"Turn off loop",[Ze.LOOP]:"Loop",[Ze.PLAYBACK_RATE_NORMAL]:"Normal",[Ze.OPTIONS]:"Options",[Ze.DOWNLOAD]:"Download",[Ze.VIDEO_TRACK]:"Video tracks",[Ze.AUDIO_TRACK]:"Audio tracks",[Ze.PLAYBACK_RATE]:"Playback speed",[Ze.PLAYBACK_RATE_SHORT]:"Speed",[Ze.PICTURE_IN_PICTURE]:"Picture in picture",[Ze.EXIT_PICTURE_IN_PICTURE]:"Exit picture in picture",[Ze.PLAY_INFO]:"Play info",[Ze.MIRROR_IMAGE]:"Mirror image",[Ze.ROTATE]:"Rotate",[Ze.FULLSCREEN]:"Fullscreen",[Ze.EXIT_FULLSCREEN]:"Exit fullscreen",[Ze.WINDOW_FULLSCREEN]:"Window fullscreen",[Ze.EXIT_WINDOW_FULLSCREEN]:"Exit window fullscreen",[Ze.AUTO]:"Auto",[Ze.CURRENT_VOLUME]:"Current volume",[Ze.CURRENTLY_MUTED]:"Currently muted",[Ze.SWITCH_TO_VIDEO]:"Switch to",[Ze.SWITCHING_TO_VIDEO]:"Switching to",[Ze.SWITCHED_TO_VIDEO]:"Switched to",[Ze.SWITCH_TO_AUDIO]:"Switch to",[Ze.SWITCHING_TO_AUDIO]:"Switching to",[Ze.SWITCHED_TO_AUDIO]:"Switched to",[Ze.FAIL]:"Fail",[Ze.ERROR_PANEL_TITLE]:"Video loading failed, please try again later.",[Ze.LIVE]:"Live",[Ze.RETURN_TO_LIVE]:"Return to Live",[Ze.ERROR_PANEL_RETRY_BTN]:"Click Retry"}}},{lang:"es",map:{[mo]:{[Ze.PLAY]:"Reproducir",[Ze.PAUSE]:"Pausa",[Ze.REFRESH]:"Actualizar",[Ze.NEXT]:"Siguiente",[Ze.TURN_ON_LOOP]:"Activar bucle",[Ze.TURN_OFF_LOOP]:"Desactivar bucle",[Ze.LOOP]:"Bucle",[Ze.PLAYBACK_RATE_NORMAL]:"Normal",[Ze.OPTIONS]:"Opciones",[Ze.DOWNLOAD]:"Descargar",[Ze.VIDEO_TRACK]:"Pistas de video",[Ze.AUDIO_TRACK]:"Pistas de audio",[Ze.PLAYBACK_RATE]:"Velocidad de reproducción",[Ze.PLAYBACK_RATE_SHORT]:"Velocidad",[Ze.PICTURE_IN_PICTURE]:"Imagen en imagen",[Ze.EXIT_PICTURE_IN_PICTURE]:"Salir de imagen en imagen",[Ze.PLAY_INFO]:"Información de reproducción",[Ze.MIRROR_IMAGE]:"Imagen espejo",[Ze.ROTATE]:"Rotar",[Ze.FULLSCREEN]:"Pantalla completa",[Ze.EXIT_FULLSCREEN]:"Salir de pantalla completa",[Ze.WINDOW_FULLSCREEN]:"Pantalla completa de ventana",[Ze.EXIT_WINDOW_FULLSCREEN]:"Salir de pantalla completa de ventana",[Ze.AUTO]:"Automático",[Ze.CURRENT_VOLUME]:"Volumen actual",[Ze.CURRENTLY_MUTED]:"Actualmente silenciado",[Ze.SWITCH_TO_VIDEO]:"Cambiar a video",[Ze.SWITCHING_TO_VIDEO]:"Cambiando a video",[Ze.SWITCHED_TO_VIDEO]:"Cambiado a video",[Ze.SWITCH_TO_AUDIO]:"Cambiar a audio",[Ze.SWITCHING_TO_AUDIO]:"Cambiando a audio",[Ze.SWITCHED_TO_AUDIO]:"Cambiado a audio",[Ze.FAIL]:"Error",[Ze.ERROR_PANEL_TITLE]:"Error al cargar el video, por favor inténtelo de nuevo más tarde.",[Ze.LIVE]:"En vivo",[Ze.RETURN_TO_LIVE]:"Volver a En vivo",[Ze.ERROR_PANEL_RETRY_BTN]:'Haz clic en Reintentar"'}}}];(function(){try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode("._alpha-video_1qqo5_1{display:none!important}")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Pv=Object.defineProperty,Uv=(r,i,n)=>i in r?Pv(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,gt=(r,i,n)=>(Uv(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Bv=Object.defineProperty,Vv=(r,i,n)=>i in r?Bv(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Cr=(r,i,n)=>(Vv(r,typeof i!="symbol"?i+"":i,n),n);const Fv="ControlsPlugin",jv="I18nPlugin",Hv="LoggerPlugin",Gv="HotkeyPlugin",zv="PlayInfoPlugin",Kv="RotatePlugin",Wv="PreviewPlugin",Yv="MaskPlugin",Qv="VRPlugin",$v="DanmakuPlugin";let cr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};Cr(cr,"label"),Cr(cr,"version"),Cr(cr,"isSupported"),Cr(class ff extends cr{getLabel(){return ff.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",Fv),Cr(class pf extends cr{getLabel(){return pf.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",jv),Cr(class _f extends cr{getLabel(){return _f.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",Hv),Cr(class Af extends cr{getLabel(){return Af.label}},"label",Gv),Cr(class vf extends cr{getLabel(){return vf.label}},"label",zv),Cr(class gf extends cr{getLabel(){return gf.label}},"label",Kv),Cr(class mf extends cr{getLabel(){return mf.label}},"label",Wv),Cr(class bf extends cr{getLabel(){return bf.label}},"label",Yv),Cr(class Ef extends cr{getLabel(){return Ef.label}},"label",Qv),Cr(class yf extends cr{getLabel(){return yf.label}},"label",$v);var Tr=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Tr||{}),$u=(r=>(r.VIDEO="video",r.VIDEO_INTERACTIVE="videoInteractive",r.DEFAULT="default",r))($u||{});class Xv{constructor(i,n,o){gt(this,"type","2:1"),gt(this,"videoWidth",0),gt(this,"videoHeight",0),gt(this,"objectFit",""),gt(this,"_logger"),gt(this,"_player"),gt(this,"_view"),this._logger=i,this._player=n,this._view=o}reset(){this.videoWidth=this.videoHeight=0}get realVideoWidth(){return this.type==="2:1"?this.videoWidth/3*2:this.videoWidth/2}get targetR(){return this.type==="2:1"?this.videoWidth/3*2/this.videoHeight:this.videoWidth/2/this.videoHeight}get view(){return this._view}get viewR(){const i=this.viewRect;return i.width/i.height}get videoR(){return this.videoWidth/this.videoHeight}get viewRect(){return this._view.getBoundingClientRect()}get player(){return this._player}get logger(){return this._logger}}const So=class yc{static setPixelRatioByDevice(i){yc.pixelRatioByDevice=i,yc.pixelRatio=i?window.devicePixelRatio:1}};gt(So,"pixelRatioByDevice",!0),gt(So,"pixelRatio",1);let Oo=So;const Xu="renderer-basic";let Zu=class{constructor(i,n){gt(this,"_logger"),gt(this,"_ctx"),gt(this,"_source"),gt(this,"_viewport",{x:0,y:0,w:1,h:1,scale:1}),this._logger=i,this._ctx=n}draw(){return Ec(this,null,function*(){const i=this._ctx.player;if(!i)return!1;const n=i.canvas||i.video;let o;return n instanceof HTMLCanvasElement?o=yield i.screenshot():o=n,o?Promise.resolve(this._drawImageData(o)):!1})}setSource(i){this._logger.i(Xu,"set source",i),this._source=i}setType(i){}clean(){}destroy(){this._logger.i(Xu,"destroy")}_drawImageData(i){return!0}_updateViewSize(){}_updateViewport(){const i=this._ctx.targetR,n=this._ctx.view.width,o=this._ctx.view.height,s=n/o,d=this._ctx,m=d.objectFit;this._viewport.x=0,this._viewport.y=0,this._viewport.w=n,this._viewport.h=o,m==="fill"||(m==="cover"?i>=d.viewR?(this._viewport.w=this._viewport.h*i,this._viewport.x=-(this._viewport.w-n)/2,this._viewport.scale=d.videoHeight/o):(this._viewport.h=this._viewport.w/i,this._viewport.y=-(this._viewport.h-o)/2,this._viewport.scale=d.realVideoWidth/n):i>s?(this._viewport.h=n/i,this._viewport.y=(o-this._viewport.h)/2,this._viewport.scale=d.realVideoWidth/n):(this._viewport.w=o*i,this._viewport.x=(n-this._viewport.w)/2,this._viewport.scale=d.videoHeight/o))}};function No(r,i){i=i||1;const n=r.clientWidth*i|0,o=r.clientHeight*i|0;return n&&o&&(r.width!==n||r.height!==o)?(r.width=n,r.height=o,!0):!1}function Zv(r,i,n,o,s){const d=s||Ju,m=r.createProgram();if(!m)return null;if(i.forEach(function(A){r.attachShader(m,A)}),n&&n.forEach(function(A,T){r.bindAttribLocation(m,o?o[T]:T,A)}),r.linkProgram(m),!r.getProgramParameter(m,r.LINK_STATUS)){const A=r.getProgramInfoLog(m);return d(`Error in program linking:${A}`),r.deleteProgram(m),null}return m}function qu(r,i,n,o){const s=o||Ju,d=r.createShader(n);if(!d)return null;if(r.shaderSource(d,i),r.compileShader(d),!r.getShaderParameter(d,r.COMPILE_STATUS)){const m=r.getShaderInfoLog(d);return s(`*** Error compiling shader '${d}':${m}`),r.deleteShader(d),null}return d}function qv(r,i,n,o=[],s=[],d){const m=[],A=qu(r,i,r.VERTEX_SHADER,d),T=qu(r,n,r.FRAGMENT_SHADER,d);return A&&m.push(A),T&&m.push(T),{program:Zv(r,m,o,s,d),vertexShader:A,fragmentShader:T}}function Ju(r){console&&(console.error?console.error(r):console.log&&console.log(r))}function Jv(r){const i={preferLowPowerToHighPerformance:!0,powerPreference:"default",preserveDrawingBuffer:!0};return r.getContext("webgl",i)}let xo,ko;function eg(r=!1){if(r){if(typeof ko<"u")return ko}else if(typeof xo<"u")return xo;let i=!1;try{const n=document.createElement("canvas"),o={preferLowPowerToHighPerformance:!0,failIfMajorPerformanceCaveat:r,preserveDrawingBuffer:!0};if(typeof WebGLRenderingContext<"u"){const s=n.getContext("webgl",o)||n.getContext("experimental-webgl",o);if(s){const d=s.getExtension("WEBGL_lose_context");d&&d.loseContext(),i=!0}else i=!1}else i=!1}catch(n){}return r?ko=i:xo=i,i}const Mo="renderer-2d";class tg extends Zu{constructor(){super(...arguments),gt(this,"_tmpCanvas"),gt(this,"_tmpCtx",null),gt(this,"_viewCtx",null)}_drawImageData(i){var n;const o=this._ctx.view;this._viewCtx||(this._viewCtx=o.getContext("2d",{willReadFrequently:!0})),(n=this._viewCtx)==null||n.clearRect(0,0,o.width,o.height),No(o,Oo.pixelRatio),this._updateViewport();let s;this._tmpCanvas||(this._tmpCanvas=document.createElement("canvas"),this._tmpCtx=this._tmpCanvas.getContext("2d",{willReadFrequently:!0}));const d=this._tmpCtx,m=this._ctx;if(!d)return this._logger.i(Mo,"create tmp ctx error."),!1;i instanceof ImageData?(s=this._tmpCanvas,s.width=i.width,s.height=i.height,d.putImageData(i,0,0)):(s=this._tmpCanvas,s.width=m.videoWidth,s.height=m.videoHeight,d.drawImage(i,0,0));const A=this._viewport,T=this._viewCtx,C=Math.round(m.realVideoWidth),h=Math.round(A.x),F=Math.round(A.y),w=Math.min(Math.round(A.w),o.width),I=Math.min(Math.round(A.h),o.height),S=h>=0?0:-h*A.scale,W=F>=0?0:-F*A.scale,j=S>0?C-2*S:C,N=W>0?m.videoHeight-2*W:m.videoHeight,K=m.type==="2:1"?2:1,z=Math.min(Math.round(j/K),m.videoWidth-C),B=Math.round(N/K);if(!s||!T)return!1;T.drawImage(s,S,W,j,N,Math.max(0,h),Math.max(0,F),w,I);const J=d.getImageData(C+S/K,W/K,z,B),be=T.getImageData(0,0,o.width,o.height);let X=0,ye=0;const Be=Math.max(0,h),Ve=Math.max(0,F);for(let je=0;je<be.height;je++)for(let we=Be;we<Be+w;we++)je<Ve||je>Ve+I||we<Be||we>Be+w||(X=be.width*je+we<<2,ye=Math.round(Math.min(B-1,Math.round((je-Ve)*B/I))*z+Math.min(Math.round((we-Be)*z/w),z-1))<<2,be.data[X+3]=J.data[ye]);return T.putImageData(be,0,0),!0}clean(){this._logger.i(Mo,"clean");const i=this._viewCtx;i&&i.clearRect(0,0,i.canvas.width,i.canvas.height)}destroy(){this._logger.i(Mo,"destroy"),super.destroy(),this._tmpCtx=null,this._tmpCanvas&&(this._tmpCanvas.width=0,this._tmpCanvas.height=0,this._tmpCanvas=void 0)}}const eh={vertex:`
attribute vec4 position;
attribute vec4 inputTextureCoordinate;
varying vec2 textureCoordinate;
void main() {
gl_Position = position;
textureCoordinate = inputTextureCoordinate.xy;
}
`,fragment:`
precision highp float;
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform int type;
void main() {
if (type == 2) {
float alphaX = 2.0 / 3.0;
vec3 colorRGB = texture2D(inputImageTexture, vec2(textureCoordinate.x * alphaX, textureCoordinate.y)).rgb;
vec2 rightTextureCoordinate = vec2(alphaX + (textureCoordinate.x / 3.0), textureCoordinate.y / 2.0);
float colorA = texture2D(inputImageTexture, vec2(alphaX + (textureCoordinate.x / 3.0), textureCoordinate.y / 2.0 + 0.5)).r;
gl_FragColor = vec4(colorRGB.rgb, colorA);
} else {
float alphaX = 0.5;
vec3 colorRGB = texture2D(inputImageTexture, vec2(textureCoordinate.x * alphaX, textureCoordinate.y)).rgb;
vec2 rightTextureCoordinate = vec2(alphaX + textureCoordinate.x / 2.0, textureCoordinate.y);
float colorA = texture2D(inputImageTexture, rightTextureCoordinate).r;
gl_FragColor = vec4(colorRGB.rgb, colorA);
}
}
`},$n="renderer-webgl";class ig extends Zu{constructor(i,n){i.i($n,"constructor"),super(i,n),gt(this,"_vShader",null),gt(this,"_fShader",null),gt(this,"_gl",null),gt(this,"_program",null),gt(this,"_positionBuffer",null),gt(this,"_texcoordBuffer",null),gt(this,"_texture",null),gt(this,"_typeUniform",null),gt(this,"_inputWidth",0),gt(this,"_inputHeight",0),gt(this,"_inputTextureUniform",null),gt(this,"_positionAttrib",0),gt(this,"_inputTextureCoordinateAttrib",0),this._gl=Jv(n.view)}_init(){this._logger.i($n,"init");const i=this._gl;if(!i)return this._logger.e($n,"init error gl null."),!1;const n=qv(i,eh.vertex,eh.fragment);this._vShader=n.vertexShader,this._fShader=n.fragmentShader;const o=this._program=n.program;return o?(No(i.canvas,Oo.pixelRatio),this._positionBuffer=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,this._positionBuffer),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),i.STATIC_DRAW),this._texcoordBuffer=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,this._texcoordBuffer),i.bufferData(i.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),i.STATIC_DRAW),this._typeUniform=i.getUniformLocation(o,"type"),this._logger.i($n,"init complete."),!0):(this._logger.e($n,"init error program null."),!1)}clean(){this._logger.i($n,"clean");const i=this._gl;i&&(i.viewport(0,0,i.canvas.width,i.canvas.height),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT))}destroy(){if(this._logger.i($n,"destroy",!!this._gl),this._gl){this._gl.disableVertexAttribArray(this._positionAttrib),this._gl.disableVertexAttribArray(this._inputTextureCoordinateAttrib),this._positionBuffer&&this._gl.deleteBuffer(this._positionBuffer),this._texcoordBuffer&&this._gl.deleteBuffer(this._texcoordBuffer),this._texture&&this._gl.deleteTexture(this._texture),this._program&&this._gl.deleteProgram(this._program),this._vShader&&this._gl.deleteShader(this._vShader),this._fShader&&this._gl.deleteShader(this._fShader);const i=this._gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),this._gl=null}super.destroy()}_drawImageData(i){const n=this._gl;if(!n)return!1;if(!this._program){if(!this._init())return!1;this._active(),this._texture=this._createAndSetupTexture(n)}if(No(n.canvas,Oo.pixelRatio),this.setType(this._ctx.type),i instanceof HTMLVideoElement){if((i.videoWidth!==this._inputWidth||i.videoHeight!==this._inputHeight)&&(this._inputWidth=i.videoWidth,this._inputHeight=i.videoHeight),i.readyState!==4)return!1}else(i.width!==this._inputWidth||i.height!==this._inputHeight)&&(this._inputWidth=i.width,this._inputHeight=i.height);return this._updateSize(),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,1),n.bindTexture(n.TEXTURE_2D,this._texture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_STRIP,0,4),n.finish(),!0}_createAndSetupTexture(i){const n=i.createTexture();return i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n}_updateSize(){const i=this._gl;i&&(this._updateViewport(),i.viewport(this._viewport.x,this._viewport.y,this._viewport.w,this._viewport.h))}_active(){const i=this._gl,n=this._program;i&&n&&(i.useProgram(n),this._positionAttrib=i.getAttribLocation(n,"position"),this._inputTextureCoordinateAttrib=i.getAttribLocation(n,"inputTextureCoordinate"),i.enableVertexAttribArray(this._positionAttrib),i.bindBuffer(i.ARRAY_BUFFER,this._positionBuffer),i.vertexAttribPointer(this._positionAttrib,2,i.FLOAT,!1,0,0),i.enableVertexAttribArray(this._inputTextureCoordinateAttrib),i.bindBuffer(i.ARRAY_BUFFER,this._texcoordBuffer),i.vertexAttribPointer(this._inputTextureCoordinateAttrib,2,i.FLOAT,!1,0,0),this._inputTextureUniform=i.getUniformLocation(n,"inputImageTexture"))}setType(i){this._gl&&this._gl.uniform1i(this._typeUniform,i==="2:1"?2:1)}}const Po=60,Ir="renderer";class rg{constructor(i,n,o,s){gt(this,"_ctx"),gt(this,"_logger"),gt(this,"_active",!1),gt(this,"_fps",Po),gt(this,"_drawTime",0),gt(this,"_animationFrameHandler",0),gt(this,"_readyState","idle"),gt(this,"_resizeObserver"),gt(this,"_r"),gt(this,"_loop",()=>{const d=this._ctx.player;this._active&&(d&&!d.paused&&!d.ended&&this._loopDraw(),this._animationFrameHandler=requestAnimationFrame(this._loop))}),gt(this,"_loopDraw",()=>{performance.now()-this._drawTime>1e3/this._fps&&this._readyState==="idle"&&this.draw()}),i.i(Ir,"constructor"),this._logger=i,this._ctx=new Xv(i,n,o),eg(!1)?(i.i(Ir,"backend: webgl."),this._r=new ig(i,this._ctx)):(i.i(Ir,"backend: canvas2d."),this._r=new tg(i,this._ctx)),this._r.setType(this._ctx.type),this._resizeObserver=new fs(()=>{this._active&&(i.i(Ir,"resize redraw"),this.draw())}),this._resizeObserver.observe(s)}reset(){this._logger.i(Ir,"reset",this._r),this._r.clean(),this._fps=Po,this._ctx.reset(),this.stop()}start(){this._logger.i(Ir,`start. active: ${this._active}`),this._active||(this._active=!0,this._animationFrameHandler=requestAnimationFrame(this._loop))}stop(){this._logger.i(Ir,"stop"),this._active=!1,cancelAnimationFrame(this._animationFrameHandler),this._animationFrameHandler=0}setInput(i){this._logger.i(Ir,"set input",i),this._r.setSource(i)}updateVideoSize(i,n){this._logger.i(Ir,"update video size",i,n),this._ctx.videoWidth=i,this._ctx.videoHeight=n}updateFps(i){this._logger.i(Ir,"update fps",i),this._fps=i||Po}updateType(i){this._logger.i(Ir,"update type",i),this._ctx.type=i,this._r.setType(i),this._active&&this.draw()}updateObjectFit(i){this._logger.i(Ir,`update objectFit: ${i} active: ${this._active}`),this._ctx.objectFit=i,this._active&&this.draw()}get readyState(){return this._readyState}get active(){return this._active}get ctx(){return this._ctx}draw(){return Ec(this,null,function*(){try{this._readyState="running",this._drawTime=performance.now();const i=yield this._r.draw();return this._readyState="idle",i}catch(i){return this._readyState="idle",!1}})}destroy(){this._logger.i(Ir,"destroy"),this.stop(),this._r.destroy(),this._resizeObserver&&this._ctx.view&&(this._resizeObserver.unobserve(this._ctx.view),this._resizeObserver.disconnect())}}const Ns={"alpha-video":"_alpha-video_1qqo5_1"},_n="alpha-video",Uo=class Cf extends cr{constructor(){super(...arguments),gt(this,"_player"),gt(this,"_logger"),gt(this,"_dom"),gt(this,"_outputCanvas"),gt(this,"_renderer"),gt(this,"_active"),gt(this,"_typeFromMeta"),gt(this,"_supported",!0),gt(this,"_onRendererChange",()=>{var i;this._player&&((i=this._renderer)==null||i.setInput(this._player.canvas||this._player.video))}),gt(this,"_onObjectFitChange",()=>{var i,n,o,s;(n=this._logger)==null||n.i(_n,`on objectFit change: ${(i=this._player)==null?void 0:i.objectFit}`),(s=this._renderer)==null||s.updateObjectFit(((o=this._player)==null?void 0:o.objectFit)||"")}),gt(this,"_onManifest",i=>{var n;(i.stereoType===0||typeof i.stereoType>"u")&&this._player?(this._player.crossOrigin="anonymous",this._supported=!0):this._supported=!1,(n=this._logger)==null||n.i(_n,`on manifest supported: ${this._supported} stereoType: ${i.stereoType}`)}),gt(this,"_onSrcChange",()=>{var i;this._typeFromMeta=void 0,(i=this._renderer)==null||i.reset(),this._stop()}),gt(this,"_onLoadedMetadata",()=>{var i;(i=this._logger)==null||i.i(_n,"on loaded metadata"),this._start()}),gt(this,"_onReport",i=>{var n,o,s,d,m;i.type==="mediaInfo"&&i.value.fps?((n=this._renderer)==null||n.updateFps(i.value.fps),i.value.width&&i.value.height&&((o=this._renderer)==null||o.updateVideoSize(i.value.width,i.value.height))):i.type==="metadata"&&typeof i.value.desc=="string"&&((s=this._logger)==null||s.i(_n,`media metadata desc: ${i.value.desc}`),i.value.desc.indexOf("alphaVideo_1")>=0?(this._typeFromMeta="1:1",(d=this._renderer)==null||d.updateType(this._typeFromMeta),this._start()):i.value.desc.indexOf("alphaVideo_2")>=0&&(this._typeFromMeta="2:1",(m=this._renderer)==null||m.updateType(this._typeFromMeta),this._start()))})}getLabel(){return Cf.label}beforeInstall(i){this._player=i,this._logger=i.logger,i.on(Tr.VIDEO_RENDERER_CHANGE,this._onRendererChange),i.on(Tr.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),i.on(Tr.LOADEDMETADATA,this._onLoadedMetadata),i.on(Tr.REPORT,this._onReport),i.on(Tr.MANIFEST_PARSED,this._onManifest),i.on(Tr.OBJECT_FIT_CHANGE,this._onObjectFitChange)}afterInstall(i,n){var o,s,d;this._dom=i.createSubContainer($u.VIDEO),this._dom.style.position="absolute",this._dom.style.top="0",this._dom.style.left="0",this._dom.style.width="100%",this._dom.style.height="100%",this._dom.style.visibility="hidden",this._outputCanvas=document.createElement("canvas"),this._outputCanvas.style.width="100%",this._outputCanvas.style.height="100%",this._dom.appendChild(this._outputCanvas),(o=this._logger)==null||o.i(_n,"after install",n),!this._renderer&&this._logger&&(this._logger.i(_n,"renderer init"),this._renderer=new rg(this._logger,i,this._outputCanvas,this._dom)),typeof(n==null?void 0:n.type)<"u"&&this._renderer&&(this._renderer.ctx.type=n.type),typeof(n==null?void 0:n.active)<"u"&&(this._active=n.active),(d=this._renderer)==null||d.updateObjectFit(((s=this._player)==null?void 0:s.objectFit)||"")}afterUninstall(i){var n;this._stop(),(n=this._renderer)==null||n.destroy(),this._renderer=void 0,this._player=void 0,this._logger=void 0,i.off(Tr.VIDEO_RENDERER_CHANGE,this._onRendererChange),i.off(Tr.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),i.off(Tr.LOADEDMETADATA,this._onLoadedMetadata),i.off(Tr.REPORT,this._onReport),i.off(Tr.MANIFEST_PARSED,this._onManifest),i.off(Tr.OBJECT_FIT_CHANGE,this._onObjectFitChange),this.removeAllListeners()}set active(i){var n;(n=this._logger)==null||n.i(_n,`set active: ${i}`),this._active=i,this._isActive?this._start():this._stop()}get active(){var i;return!!((i=this._renderer)!=null&&i.active&&this._supported&&this._isActive)}set type(i){var n,o,s;(n=this._logger)==null||n.i(_n,`set type ${i}`),typeof i>"u"?(o=this._renderer)==null||o.updateType(this._typeFromMeta||"2:1"):(s=this._renderer)==null||s.updateType(i)}get _isActive(){return this._active===!0||typeof this._active>"u"&&typeof this._typeFromMeta<"u"}_start(){var i,n;(i=this._logger)==null||i.i(_n,`start active: ${this._active} typeFromMeta: ${this._typeFromMeta} supported: ${this._supported}`),this._isActive&&this._supported&&(this._dom&&(this._dom.style.visibility="visible"),this._player&&(this._player.video.classList.add(Ns["alpha-video"]),this._player.canvas&&this._player.canvas.classList.add(Ns["alpha-video"])),(n=this._renderer)==null||n.start())}_stop(){var i,n;(i=this._logger)==null||i.i(_n,"stop",this._dom),this._dom&&(this._dom.style.visibility="hidden"),this._player&&(this._player.video.classList.remove(Ns["alpha-video"]),this._player.canvas&&this._player.canvas.classList.remove(Ns["alpha-video"])),(n=this._renderer)==null||n.stop()}};gt(Uo,"label","AlphaVideoPlugin"),gt(Uo,"version","1.1.0-alpha.0");let ng=Uo;var ag=Object.defineProperty,sg=(r,i,n)=>i in r?ag(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,jr=(r,i,n)=>(sg(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var og=Object.defineProperty,cg=(r,i,n)=>i in r?og(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Rr=(r,i,n)=>(cg(r,typeof i!="symbol"?i+"":i,n),n);const lg="ControlsPlugin",ug="I18nPlugin",hg="LoggerPlugin",dg="HotkeyPlugin",fg="PlayInfoPlugin",pg="RotatePlugin",_g="PreviewPlugin",Ag="MaskPlugin",vg="VRPlugin",gg="DanmakuPlugin";let wr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};Rr(wr,"label"),Rr(wr,"version"),Rr(wr,"isSupported"),Rr(class Tf extends wr{getLabel(){return Tf.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",lg),Rr(class If extends wr{getLabel(){return If.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",ug),Rr(class Rf extends wr{getLabel(){return Rf.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",hg);const th=class wf extends wr{getLabel(){return wf.label}};Rr(th,"label",dg);let mg=th;Rr(class Df extends wr{getLabel(){return Df.label}},"label",fg),Rr(class Lf extends wr{getLabel(){return Lf.label}},"label",pg),Rr(class Sf extends wr{getLabel(){return Sf.label}},"label",_g),Rr(class Of extends wr{getLabel(){return Of.label}},"label",Ag),Rr(class Nf extends wr{getLabel(){return Nf.label}},"label",vg),Rr(class xf extends wr{getLabel(){return xf.label}},"label",gg);var ih=(r=>(r.NONE="none",r.KWAI="kwai",r.KWAI2="kwai2",r))(ih||{});const va={KEEP_DOWN:"KEEP_DOWN",KEEP_DOWN_END:"KEEP_DOWN_END",SINGLE_DOWN:"SINGLE_DOWN"},ir={ArrowRight:"ArrowRight",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",Space:" "},bg="hotkey-plugin";let rh=class extends mg{constructor(){super(...arguments),jr(this,"_player"),jr(this,"_currentKey",""),jr(this,"_isKeepDown",!1),jr(this,"_emitKeepDownInterval",100),jr(this,"_emitKeepDownLastTime",0),jr(this,"_disable",!1),jr(this,"_onDown",i=>{!this._isValidInput(i)||this._disable||(this._currentKey&&(this._isKeepDown=!0,Date.now()-this._emitKeepDownLastTime>this._emitKeepDownInterval&&(this._emitKeepDownLastTime=Date.now(),this.emit(va.KEEP_DOWN,{key:i.key}))),this._currentKey=i.key)}),jr(this,"_onUp",i=>{!this._isValidInput(i)||this._disable||(this._isKeepDown?this.emit(va.KEEP_DOWN_END,{key:i.key}):this.emit(va.SINGLE_DOWN,{key:i.key}),this._currentKey="",this._isKeepDown=!1)}),jr(this,"_onKeepDown",({key:i})=>{if(this._player)switch(i){case ir.Space:{this._onSpaceDown();break}case ir.ArrowRight:{this._onChangeRate(3);break}case ir.ArrowLeft:{this._onSeek(-this._getSeekTickTime());break}case ir.ArrowUp:{this._onChangeVolume(5);break}case ir.ArrowDown:{this._onChangeVolume(-5);break}}}),jr(this,"_onKeepDownEnd",({key:i})=>{if(this._player)switch(i){case ir.Space:{this._onSpaceDown();break}case ir.ArrowRight:{this._onChangeRate(1);break}case ir.ArrowLeft:{this._onSeek(-this._getSeekTickTime());break}case ir.ArrowUp:{this._onChangeVolume(5);break}case ir.ArrowDown:{this._onChangeVolume(-5);break}}}),jr(this,"_onSingleDown",({key:i})=>{if(this._player)switch(i){case ir.Space:{this._onSpaceDown();break}case ir.ArrowRight:{this._onSeek(10);break}case ir.ArrowLeft:{this._onSeek(-this._getSeekTickTime());break}case ir.ArrowUp:{this._onChangeVolume(5);break}case ir.ArrowDown:{this._onChangeVolume(-5);break}}})}afterInstall(i){this._player=i,document.addEventListener("keydown",this._onDown),document.addEventListener("keyup",this._onUp),this.on(va.KEEP_DOWN,this._onKeepDown),this.on(va.KEEP_DOWN_END,this._onKeepDownEnd),this.on(va.SINGLE_DOWN,this._onSingleDown),this._disable=i.disableHotkey===!0,i.logger.i(bg,`hotkey disable: ${this._disable}`)}beforeUninstall(){this._player=void 0,document.removeEventListener("keydown",this._onDown),document.removeEventListener("keyup",this._onUp)}get disable(){return this._disable}_onSpaceDown(){const i=this._player;i&&(i.paused?i.play():i.pause())}_onSeek(i){if(this._player){if(this._isNormalLive())return;this._player.currentTime+=i}}_onChangeRate(i){if(this._player){if(this._isNormalLive())return;this._player.playbackRate=i}}_isNormalLive(){return!!(this._player&&this._player&&!Number.isFinite(this._player.duration)&&this._player.liveShiftType===ih.NONE)}_onChangeVolume(i){if(this._player){this._player.muted&&(this._player.muted=!1);let n=i/100+this._player.volume;n>1&&(n=1),n<0&&(n=0),this._player.volume=n}}_getSeekTickTime(){if(!this._player)return 0;let i=this._player.duration/200;return i>10&&(i=10),i<5&&(i=5),i}_isValidInput(i){var n;if(i.isComposing||["INPUT","TEXTAREA"].find(s=>{var d;return s===((d=i.target)==null?void 0:d.tagName)}))return!1;const o=(n=this._player)==null?void 0:n.mainContainer;if(o){const{left:s,top:d,width:m,height:A}=o.getBoundingClientRect(),[T,C]=[s+m,d+A];if(innerHeight<d||s>innerWidth||T<0||C<0)return!1}return!0}};jr(rh,"version","1.1.0-alpha.0");var Eg=Object.defineProperty,yg=(r,i,n)=>i in r?Eg(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Ua=(r,i,n)=>(yg(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Cg=Object.defineProperty,Tg=(r,i,n)=>i in r?Cg(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Dr=(r,i,n)=>(Tg(r,typeof i!="symbol"?i+"":i,n),n);const Ig="ControlsPlugin",Rg="I18nPlugin",wg="LoggerPlugin",Dg="HotkeyPlugin",Lg="PlayInfoPlugin",Sg="RotatePlugin",Og="PreviewPlugin",Ng="MaskPlugin",xg="VRPlugin",kg="DanmakuPlugin";let Lr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};Dr(Lr,"label"),Dr(Lr,"version"),Dr(Lr,"isSupported"),Dr(class kf extends Lr{getLabel(){return kf.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",Ig);const nh=class Mf extends Lr{getLabel(){return Mf.label}beforeInstall(i,n){}afterInstall(i,n){}};Dr(nh,"label",Rg);let Mg=nh;Dr(class Pf extends Lr{getLabel(){return Pf.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",wg),Dr(class Uf extends Lr{getLabel(){return Uf.label}},"label",Dg),Dr(class Bf extends Lr{getLabel(){return Bf.label}},"label",Lg),Dr(class Vf extends Lr{getLabel(){return Vf.label}},"label",Sg),Dr(class Ff extends Lr{getLabel(){return Ff.label}},"label",Og),Dr(class jf extends Lr{getLabel(){return jf.label}},"label",Ng),Dr(class Hf extends Lr{getLabel(){return Hf.label}},"label",xg),Dr(class Gf extends Lr{getLabel(){return Gf.label}},"label",kg);const Bo="zh",Pg="i18-plugin",Vo=class Cc extends Mg{constructor(){super(...arguments),Ua(this,"_lang",Bo),Ua(this,"_langDict",[]),Ua(this,"_current")}beforeInstall(){Cc.defaultDict&&(this._langDict=Cc.defaultDict)}afterInstall(i,n){var o;n!=null&&n.langDict&&(n==null?void 0:n.langDict).forEach(s=>{const d=this._getLocalDict(s.lang,!0);d?Object.assign(d,s.map):this._langDict.unshift(s)}),this._lang=(n==null?void 0:n.lang)||navigator.language||navigator.userLanguage||Bo,this._current=this._getLocalDict(this._lang,!0)||this._getLocalDict(this._lang),(o=i.logger)==null||o.i(Pg,`use lang: ${this._lang} ${!!this._current}.`)}text(i,n){return this._current&&this._current[i]&&this._current[i][n]||""}addDict(i,n){n=n||Bo;const o=this._getLocalDict(n,!0);o?Object.keys(i).forEach(s=>{o[s]||(o[s]={}),Object.assign(o[s],i[s])}):this._langDict.unshift({lang:n,map:i})}_getLocalDict(i,n=!1){for(let o=0;o<this._langDict.length;o++)if(n&&this._langDict[o].lang===i||!n&&i.indexOf(this._langDict[o].lang)===0)return this._langDict[o].map}};Ua(Vo,"version","1.1.0-alpha.0"),Ua(Vo,"defaultDict");let ah=Vo;var Ug=Object.defineProperty,Bg=(r,i,n)=>i in r?Ug(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Ht=(r,i,n)=>(Bg(r,typeof i!="symbol"?i+"":i,n),n);const sh={development:"./misc2",production:"https://log-sdk.ksapisrv.com/rest/wd/common/log/collect/misc2",oversea:"https://logsdk.kwai-pro.com/rest/wd/common/log/collect/misc2","logger-oversea":"https://data-track-sgp.corp.kuaishou.com/rest/wd/common/log/collect/misc2"},Vg=5e3;var ga=(r=>(r.SUMMARY="KP_WEB_SUMMARY",r.REALTIME="KP_WEB_REALTIME",r.DOWNLOAD="KP_WEB_DOWNLOAD",r.EVENT="KP_WEB_EVENT",r))(ga||{});const Fg={summary:"KP_WEB_SUMMARY",realtimeBeacon:"KP_WEB_REALTIME",download:"KP_WEB_DOWNLOAD",event:"KP_WEB_EVENT"},oh="production",jg="streamlake",ch=["summary","realtimeBeacon","download","event"];(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Hg=Object.defineProperty,Gg=(r,i,n)=>i in r?Hg(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Sr=(r,i,n)=>(Gg(r,typeof i!="symbol"?i+"":i,n),n);const zg="ControlsPlugin",Kg="I18nPlugin",Wg="LoggerPlugin",Yg="HotkeyPlugin",Qg="PlayInfoPlugin",$g="RotatePlugin",Xg="PreviewPlugin",Zg="MaskPlugin",qg="VRPlugin",Jg="DanmakuPlugin";let Or=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};Sr(Or,"label"),Sr(Or,"version"),Sr(Or,"isSupported"),Sr(class zf extends Or{getLabel(){return zf.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",zg),Sr(class Kf extends Or{getLabel(){return Kf.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",Kg);const lh=class Wf extends Or{getLabel(){return Wf.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}};Sr(lh,"label",Wg);let em=lh;Sr(class Yf extends Or{getLabel(){return Yf.label}},"label",Yg),Sr(class Qf extends Or{getLabel(){return Qf.label}},"label",Qg),Sr(class $f extends Or{getLabel(){return $f.label}},"label",$g),Sr(class Xf extends Or{getLabel(){return Xf.label}},"label",Xg),Sr(class Zf extends Or{getLabel(){return Zf.label}},"label",Zg),Sr(class qf extends Or{getLabel(){return qf.label}},"label",qg),Sr(class Jf extends Or{getLabel(){return Jf.label}},"label",Jg);var Xn=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Xn||{}),xs,tm=new Uint8Array(16);function im(){if(!xs&&(xs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!xs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xs(tm)}const rm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function nm(r){return typeof r=="string"&&rm.test(r)}for(var Gi=[],Fo=0;Fo<256;++Fo)Gi.push((Fo+256).toString(16).substr(1));function am(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Gi[r[i+0]]+Gi[r[i+1]]+Gi[r[i+2]]+Gi[r[i+3]]+"-"+Gi[r[i+4]]+Gi[r[i+5]]+"-"+Gi[r[i+6]]+Gi[r[i+7]]+"-"+Gi[r[i+8]]+Gi[r[i+9]]+"-"+Gi[r[i+10]]+Gi[r[i+11]]+Gi[r[i+12]]+Gi[r[i+13]]+Gi[r[i+14]]+Gi[r[i+15]]).toLowerCase();if(!nm(n))throw TypeError("Stringified UUID is invalid");return n}function uh(r,i,n){r=r||{};var o=r.random||(r.rng||im)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){n=n||0;for(var s=0;s<16;++s)i[n+s]=o[s];return i}return am(o)}const jo="log-ctx";class sm{constructor(){Ht(this,"_env",oh),Ht(this,"_reportTypes",[]),Ht(this,"_player"),Ht(this,"_logger"),Ht(this,"_logBaseInfo",this._getDefaultLogBaseInfo()),Ht(this,"_biz",{}),Ht(this,"_extraSummaryFields",{}),Ht(this,"_forceSendBeacon",!1)}setBaseInfo(i,n,o){this._player=i,this._logger=i.logger,this._logBaseInfo.env=this._env=n,this._reportTypes=o}setBizData(i){var n,o;if((n=this._logger)==null||n.i(jo,"set biz",i),!i){this._logBaseInfo=this._getDefaultLogBaseInfo();return}const s={};Object.keys(i).forEach(d=>{var m;const A=this._underscoreToCamelCase(d),T=i[d];if(["sessionId","deviceId","userId","globalId","networkType","packageName","versionName","channel"].indexOf(A)>=0&&(typeof T=="string"||typeof T=="number")){const C=this._val2String(i[d]).trim();C&&((m=this._logger)==null||m.i(jo,"biz to log:",A,C),s[A]=C)}d!=="secretId"&&d!=="secretKey"&&(this._biz[d]=T)}),Object.assign(this._logBaseInfo,s),s.deviceId&&((o=this._logger)==null||o.i(jo,`update did by bizData. ${s.deviceId}`),XA(this._logBaseInfo.deviceId))}preprocessingLog(i,n,o){var s,d;if(n)return n=Object.assign(n,{player_version:((s=this._player)==null?void 0:s.version)||"",pack_version:((d=this._player)==null?void 0:d.packVersion)||"",biz:this._biz}),i===ga.SUMMARY&&typeof n=="object"&&(o?n.extra=Object.assign({},this._extraSummaryFields,o):n.extra=this._extraSummaryFields),n}clearExtraSummary(){this._extraSummaryFields={}}appendSummaryField(i,n){this._extraSummaryFields[i]=n}get reportTypes(){return this._reportTypes}get logBaseInfo(){var i;return(i=this._player)!=null&&i.productName&&(this._logBaseInfo.productName=this._player.productName),this._logBaseInfo.deviceId||(this._logBaseInfo.deviceId=As),this._logBaseInfo}get player(){return this._player}set forceSendBeacon(i){this._forceSendBeacon=i}get forceSendBeacon(){return this._forceSendBeacon}_getDefaultLogBaseInfo(){let i=10;return Mn.os.name==="iOS"?i=9:Mn.os.name==="Android"&&(i=8),{env:this._env,productName:jg,sessionId:uh(),platform:i,deviceId:As,userId:"",globalId:"",networkType:"",packageName:"",versionName:"",channel:""}}_underscoreToCamelCase(i){return i.replace(/_([a-z])/g,(n,o)=>o.toUpperCase())}_val2String(i){return typeof i=="number"?i.toString():i||""}}const Ho="kwai-player-web-log-temp",om=3*24*3600*1e3,cm=5*1e3,hh=1,Zn="log-reissue";class lm{constructor(i,n,o){Ht(this,"_ctx"),Ht(this,"_logger"),Ht(this,"_webLogger"),Ht(this,"_active",!1),Ht(this,"_processingTs",0),Ht(this,"_lc",new Jl),Ht(this,"_timer",0),Ht(this,"_checkMissing",!1),Ht(this,"_tick",()=>{if(!this._active||!this._ctx.player)return;this._checkMissing&&(this._checkMissing=!1,this._checkMissingLog());const s=performance.now();if(s-this._processingTs>=cm){this._processingTs=s;const d=this._ctx.preprocessingLog(ga.SUMMARY,this._ctx.player.audienceStat,{reissue_log:1});d&&(this._logger.v(Zn,"write temp"),this._writeTemp(this._webLogger.generateFormData(this._ctx.logBaseInfo,[{key:ga.SUMMARY,value:d}])))}}),Ht(this,"_startTimer",()=>{this._timer||(this._timer=+setInterval(this._tick,1e3))}),Ht(this,"_stopTimer",()=>{clearInterval(this._timer),this._timer=0}),this._ctx=i,this._logger=n,this._webLogger=o,this._lc.timeout=om}start(){this._logger.i(Zn,"start"),this._active||(this._active=!0,this._processingTs=performance.now(),this._checkMissing=!0,this._startTimer())}stop(){this._logger.i(Zn,"stop"),this._active=!1,this._clear(),this._stopTimer()}_checkMissingLog(){const i=this._readTemp();this._clear(),i?(this._logger.i(Zn,"send missing log"),this._webLogger.send(this._ctx.logBaseInfo.env,ga.SUMMARY,i.value)):this._logger.i(Zn,"no missing log")}_clear(){try{localStorage==null||localStorage.removeItem(Ho)}catch(i){}}_writeTemp(i){if(!i)return;const n={version:hh,value:i,checkSum:this._fletcher16(i)};try{this._lc.write(Ho,btoa(JSON.stringify(n)))}catch(o){}}_readTemp(){const i=this._lc.read(Ho,!0);if(typeof i=="string")try{const n=JSON.parse(atob(i));if(n.version===hh&&typeof n.value=="string"&&n.checkSum===this._fletcher16(n.value))return this._logger.i(Zn,"read success"),n;this._logger.i(Zn,"read failed",n)}catch(n){}}_fletcher16(i){let n=0,o=0;for(let s=0;s<i.length;s++)n=(n+i.charCodeAt(s))%255,o=(o+n)%255;return o<<8|n}}const dh={unknown:0,none:1,wifi:2,"4g":3,"3g":4,"2g":5,"5g":7,"slow-2g":5},Go=new Date().toString().match(/GMT\+\d+/);let zo="";function um(){try{return parseInt((localStorage==null?void 0:localStorage.getItem("kwai_player_client_increment_id"))||"")||0}catch(r){}return 0}const ma="web-logger",Ko=class sa{constructor(i){Ht(this,"_waitingQueue",[]),Ht(this,"_nextTickTimer"),Ht(this,"_logger"),this._logger=i}sendLog(i,n,o,s=!1,d){this._logger.i(ma,"sendLog",i,n,o,`forceSendBeacon: ${s} immediately: ${d}`),o&&(this._waitingQueue.push({key:n,value:o}),d?(this.send(i.env,i.productName,this.generateFormData(i,this._waitingQueue),s),this._waitingQueue.splice(0)):this._nextTickTimer||(this._nextTickTimer=setTimeout(()=>{this._nextTickTimer=void 0,this.send(i.env,i.productName,this.generateFormData(i,this._waitingQueue),s),this._waitingQueue.splice(0)},0)))}send(i,n,o,s=!1){if(this._logger.i(ma,"send",i,n,!!o,`forceSendBeacon: ${s}`),!o)return;let d=sh[i]||sh.production;sa._clientIncrementId++;try{localStorage&&(localStorage.kwai_player_client_increment_id=sa._clientIncrementId)}catch(A){}const m=new Xl(d,!0);if(m.query.v="3.10.24",m.query.kpn=n,d=m.toString(),this._logger.i(ma,"send",i,n,!!o,d),s&&navigator.sendBeacon){const A=navigator.sendBeacon(d,o);this._logger.i(ma,"send data use sendBeacon.",A),A||this._sendByXhr(d,o)}else this._sendByXhr(d,o)}_sendByXhr(i,n){this._logger.i(ma,"send data use xhr.");const o=new XMLHttpRequest;o.open("POST",i),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.onerror=o.ontimeout=()=>{this._logger.i("sendLog error"),o.onerror=o.ontimeout=o.onload=null},o.onload=()=>{o.onerror=o.ontimeout=o.onload=null},o.timeout=Vg,o.send(n)}generateFormData(i,n){this._logger.i(ma,`device_id: ${i.deviceId}`);const o={common:sa._buildCommon(i,{service_name:"KwaiPlayerWeb"}),logs:n.map(s=>sa._buildEvent(i,s.key,s.value))};return o.logs.length?JSON.stringify(o):""}static _buildEvent(i,n,o){zo||(zo=uh());const s={identity:zo,page:location.href,hostname:location.hostname,page_type:2,params:new Xl(location.href,!0).query};return{client_timestamp:Date.now(),client_increment_id:sa._clientIncrementId,session_id:i.sessionId,time_zone:sa._timeZone,stat_package:{custom_stat_event:{key:n,value:JSON.stringify(Object.assign({},o,{url_package:s}))}}}}static _buildCommon(i,n){return kd({identity_package:{device_id:i.deviceId,global_id:i.globalId,user_id:i.userId},app_package:{language:navigator.language,platform:i.platform,container:i.platform===10?"WEB":"H5",package_name:i.packageName,product_name:i.productName,version_name:i.versionName,channel:i.channel},device_package:{os_version:Mn.os.version,model:Mn.os.name,ua:navigator.userAgent},need_encrypt:!1,sdk_version:"",h5_extra_attr:this._getH5ExtraAttr(i),global_attr:"{}",network_package:{type:this._getNetworkType(i.networkType)}},n)}static _getNetworkType(i){var n;const o=i||((n=(navigator==null?void 0:navigator.connection)||(navigator==null?void 0:navigator.mozConnection)||(navigator==null?void 0:navigator.webkitConnection))==null?void 0:n.effectiveType);return o&&dh[o]||dh.unknown}static _getH5ExtraAttr(i){const n=parseFloat(devicePixelRatio.toFixed(3))||1;return JSON.stringify({sdk_name:"",sdk_version:"",sdk_bundle:"",app_version_name:i.versionName,resolution:`${Math.floor(screen.width*n)}x${Math.floor(screen.height*n)}`,screen_width:Math.floor(screen.width),screen_height:Math.floor(screen.height),device_pixel_ratio:n,domain:location.origin,fromIframe:self!==top})}};Ht(Ko,"_clientIncrementId",um()),Ht(Ko,"_timeZone",Go&&Go[0]?Go[0]:"");let hm=Ko;const Ba="logger-plugin";class fh extends em{constructor(){super(...arguments),Ht(this,"_summaryAlreadySend",!1),Ht(this,"_webLogger"),Ht(this,"_logger"),Ht(this,"_ctx",new sm),Ht(this,"_logReissue"),Ht(this,"_parseBizData",()=>{var i,n,o;(n=this._logger)==null||n.i(Ba,"parse biz data",(i=this._ctx.player)==null?void 0:i.bizData),this._ctx.setBizData((o=this._ctx.player)==null?void 0:o.bizData)}),Ht(this,"_onReport",i=>{var n,o;if(this._ctx.reportTypes.indexOf(i.type)!==-1){const s=Fg[i.type];s?((n=this._logger)==null||n.i(Ba,"sendLog",this._ctx.logBaseInfo.productName,s),this._send(s,i.value)):(o=this._logger)==null||o.i(Ba,"unknown weblogger key.")}}),Ht(this,"_onSrcChange",()=>{var i;this._sendSummary(),this._summaryAlreadySend=!1,(i=this._logReissue)==null||i.start()}),Ht(this,"_sendSummary",()=>{var i,n;!this._ctx.player||this._summaryAlreadySend||!this._ctx.player.audienceStat||((i=this._logReissue)==null||i.stop(),this._summaryAlreadySend=!0,(n=this._logger)==null||n.i(Ba,"send summary"),this._send(ga.SUMMARY,this._ctx.player.audienceStat,!0))}),Ht(this,"_onBeforeunload",()=>{this._sendSummary()})}beforeInstall(i,n){let o;n&&n.reportTypes&&Array.isArray(n.reportTypes)&&(o=n.reportTypes.filter(s=>ch.indexOf(s)>=0)),n!=null&&n.productName&&(i.productName=n.productName),typeof(n==null?void 0:n.forceSendBeacon)<"u"&&(this._ctx.forceSendBeacon=n.forceSendBeacon),this._logger=i.logger,this._ctx.setBaseInfo(i,(n==null?void 0:n.env)||oh,o||ch),this._webLogger||(this._webLogger=new hm(i.logger)),this._logReissue=new lm(this._ctx,i.logger,this._webLogger),i.on(Xn.REPORT,this._onReport),i.on(Xn.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),i.on(Xn.ATTRIBUTE_CHANGE_BIZ_DATA,this._parseBizData),window.addEventListener("beforeunload",this._onBeforeunload),Mn&&Mn.device.type==="mobile"&&window.addEventListener("unload",this._onBeforeunload),this._parseBizData()}beforeUninstall(){this._sendSummary()}afterUninstall(){var i,n,o;(i=this._ctx.player)==null||i.off(Xn.REPORT,this._onReport),(n=this._ctx.player)==null||n.off(Xn.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),(o=this._ctx.player)==null||o.off(Xn.ATTRIBUTE_CHANGE_BIZ_DATA,this._parseBizData),window.removeEventListener("beforeunload",this._onBeforeunload),window.removeEventListener("unload",this._onBeforeunload)}appendSummaryField(i,n){var o;(o=this._logger)==null||o.i(Ba,"add summary field",i,n),this._ctx.appendSummaryField(i,n)}_send(i,n,o){var s;n&&((s=this._webLogger)==null||s.sendLog(this._ctx.logBaseInfo,i,this._ctx.preprocessingLog(i,n),this._ctx.forceSendBeacon,o))}}Ht(fh,"version","1.1.0-alpha.0"),function(){try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode("._container_afsrn_1{background-color:rgba(0,0,0,.5);border-radius:.375em;position:relative;color:#fff;font-size:12px;font-family:Arial,Roboto,Noto,sans-serif;box-sizing:border-box;padding:2em .625em .625em;overflow:auto;word-break:break-all;white-space:normal;max-width:500px;max-height:calc(100% - 10px);line-height:1.5;margin:.3125em}._container-h5_afsrn_19{background-color:rgba(0,0,0,.5);border-radius:.375em;position:relative;color:#fff;font-size:12px;font-family:Arial,Roboto,Noto,sans-serif;box-sizing:border-box;padding:2em .625em .625em;overflow:auto;word-break:break-all;white-space:normal;font-size:14px;width:100%;height:100%}._close-btn_afsrn_36{position:absolute;right:0;top:0;cursor:pointer;word-break:keep-all;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:.625em}._btn-tip_afsrn_49{background-color:rgba(0,0,0,.5);border-radius:.375em;position:absolute;left:50%;transform:translate(-50%);bottom:2.1875em;white-space:nowrap;padding:.5em}._actions_afsrn_60{display:flex;justify-content:flex-end;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:0}._actions_afsrn_60 ._copy-btn_afsrn_69{word-break:keep-all;cursor:pointer;padding:.625em 0 0 .625em}._info-item_afsrn_75{display:flex}._info-item-name_afsrn_79{width:20%;min-width:7.5em;text-align:right;margin-right:.625em;flex-shrink:0}._info-item-value_afsrn_87{flex-grow:1;text-align:left}._item-svg_afsrn_92{display:inline-block;width:60%;height:1em;margin-right:.625em;background:rgba(255,255,255,.2)}._item-value_afsrn_100{display:inline-block}@media (hover: hover){._close-btn_afsrn_36:hover,._copy-btn_afsrn_69:hover{color:#ccc}}")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();var dm=Object.defineProperty,fm=(r,i,n)=>i in r?dm(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Vn=(r,i,n)=>(fm(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var pm=Object.defineProperty,_m=(r,i,n)=>i in r?pm(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,lr=(r,i,n)=>(_m(r,typeof i!="symbol"?i+"":i,n),n);const Am="ControlsPlugin",ph="I18nPlugin",vm="LoggerPlugin",gm="HotkeyPlugin",mm="PlayInfoPlugin",bm="RotatePlugin",Em="PreviewPlugin",ym="MaskPlugin",Cm="VRPlugin",Tm="DanmakuPlugin";var Wo=(r=>(r.PLAY_BAR_LEFT="playBarLeft",r.PLAY_BAR_RIGHT="playBarRight",r.CONTEXT_MENU="contextMenu",r))(Wo||{});class Im{constructor(){lr(this,"_callbacks",[])}add(i){this._callbacks.push(i)}remove(i){const n=this._callbacks.findIndex(o=>o===i);n>=0&&this._callbacks.splice(n,1)}call(i){this._callbacks.forEach(n=>n(i))}destroy(){this._callbacks.splice(0,this._callbacks.length)}}let Nr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};lr(Nr,"label"),lr(Nr,"version"),lr(Nr,"isSupported"),lr(class ep extends Nr{getLabel(){return ep.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",Am),lr(class tp extends Nr{getLabel(){return tp.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",ph),lr(class ip extends Nr{getLabel(){return ip.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",vm),lr(class rp extends Nr{getLabel(){return rp.label}},"label",gm);const _h=class np extends Nr{getLabel(){return np.label}};lr(_h,"label",mm);let Rm=_h;lr(class ap extends Nr{getLabel(){return ap.label}},"label",bm),lr(class sp extends Nr{getLabel(){return sp.label}},"label",Em),lr(class op extends Nr{getLabel(){return op.label}},"label",ym),lr(class cp extends Nr{getLabel(){return cp.label}},"label",Cm),lr(class lp extends Nr{getLabel(){return lp.label}},"label",Tm);var An=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(An||{});const Ah=Oa(void 0),vh="kwai_player_ll_enabled",wm="play-info-context",Dm=r=>{const{children:i,player:n}=r,o=n.logger,s=new Cl,d=Cl.isSupported()&&!Vt,m=`${n.packVersion}(${n.version})`,A=new Jl,[T,C]=st(!1),h=(S,W=!1)=>{if(S=S&&d,S?(F(),n.outputLogger=s.getLoggerForAdd()):n.outputLogger=void 0,C(S),W)try{A.write(vh,S?"1":"0")}catch(j){}},F=()=>{try{localStorage.setItem("kwai-kernel-log",JSON.stringify({value:"i",time:Date.now()})),localStorage.setItem("kwai-player-log",JSON.stringify({value:"i",time:Date.now()}))}catch(S){}},w=()=>{h(!T,!0)},I=()=>{s.downloadLog()};try{const S=(A.read(vh)=="1"||!1)&&d;C(S),S&&h(S)}catch(S){}return jt(()=>()=>{o.i(wm,"destroy"),s.destroy()},[]),De(Ah.Provider,{value:{player:n,playerVersion:m,localLogSwitch:T,localLogEnabled:d,toggleLocalLog:w,downloadLocalLog:I},children:i})},Lm="_container_afsrn_1",Sm="_actions_afsrn_60",Ri={container:Lm,"container-h5":"_container-h5_afsrn_19","close-btn":"_close-btn_afsrn_36","btn-tip":"_btn-tip_afsrn_49",actions:Sm,"copy-btn":"_copy-btn_afsrn_69","info-item":"_info-item_afsrn_75","info-item-name":"_info-item-name_afsrn_79","info-item-value":"_info-item-value_afsrn_87","item-svg":"_item-svg_afsrn_92","item-value":"_item-value_afsrn_100"};function Hr(r){const{title:i,value:n}=r;return De("div",{className:Ri["info-item"],children:[De("div",{className:Ri["info-item-name"],children:[i,":"]}),De("div",{className:Ri["info-item-value"],children:n})]})}function Om(r){const{dataArray:i}=r,n=Ot(null),[o,s]=st("");return jt(()=>{if(n!=null&&n.current){const{width:d,height:m}=n.current.getBoundingClientRect(),A=Math.max(...i)||1,T=m-2,C=d/i.length;let h=`M0 ${T*(A-i[0])/A+1}`;for(let F=1;F<i.length;F++)h+=` L${F*C} ${T*(A-i[F])/A+1}`;s(h)}},[i]),De("svg",{ref:n,height:"100%",width:"100%",style:"display:block",children:De("path",{fill:"none",stroke:"#fff",strokeWidth:"1",d:o})})}function ks(r){const{title:i,suffix:n,value:o}=r,[s,d]=st(0);return jt(()=>{d(o[o.length-1]||0)},[o]),De("div",{className:Ri["info-item"],children:[De("div",{className:Ri["info-item-name"],children:[i,":"]}),De("div",{className:Ri["info-item-value"],children:[De("div",{className:Ri["item-svg"],children:De(Om,{dataArray:o})}),De("div",{className:Ri["item-value"],children:n(s)})]})]})}function Nm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xm=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var i=document.activeElement,n=[],o=0;o<r.rangeCount;o++)n.push(r.getRangeAt(o));switch(i.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":i.blur();break;default:i=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||n.forEach(function(s){r.addRange(s)}),i&&i.focus()}},km=xm,gh={"text/plain":"Text","text/html":"Url",default:"Text"},Mm="Copy to clipboard: #{key}, Enter";function Pm(r){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,i)}function Um(r,i){var n,o,s,d,m,A,T=!1;i||(i={}),n=i.debug||!1;try{s=km(),d=document.createRange(),m=document.getSelection(),A=document.createElement("span"),A.textContent=r,A.ariaHidden="true",A.style.all="unset",A.style.position="fixed",A.style.top=0,A.style.clip="rect(0, 0, 0, 0)",A.style.whiteSpace="pre",A.style.webkitUserSelect="text",A.style.MozUserSelect="text",A.style.msUserSelect="text",A.style.userSelect="text",A.addEventListener("copy",function(h){if(h.stopPropagation(),i.format)if(h.preventDefault(),typeof h.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var F=gh[i.format]||gh.default;window.clipboardData.setData(F,r)}else h.clipboardData.clearData(),h.clipboardData.setData(i.format,r);i.onCopy&&(h.preventDefault(),i.onCopy(h.clipboardData))}),document.body.appendChild(A),d.selectNodeContents(A),m.addRange(d);var C=document.execCommand("copy");if(!C)throw new Error("copy command was unsuccessful");T=!0}catch(h){n&&console.error("unable to copy using execCommand: ",h),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(i.format||"text",r),i.onCopy&&i.onCopy(window.clipboardData),T=!0}catch(F){n&&console.error("unable to copy using clipboardData: ",F),n&&console.error("falling back to prompt"),o=Pm("message"in i?i.message:Mm),window.prompt(o,r)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(d):m.removeAllRanges()),A&&document.body.removeChild(A),s()}return T}var Bm=Um;const Vm=Nm(Bm),mh=100,Fm="info-panel";function jm(r){const i=or(Ah);if(!i)return De(ji,{});const{player:n,playerVersion:o,localLogEnabled:s,localLogSwitch:d,toggleLocalLog:m,downloadLocalLog:A}=i,{onChangeShowEventLog:T}=r,C=As,[h,F]=st(""),[w,I]=st(""),[S,W]=st(""),[j,N]=st(""),[K,z]=st(""),[B,J]=st(""),[be,X]=st(0),[ye,Be]=st(""),[Ve,je]=st(""),[we,ue]=st([]),[L,D]=st([]),[le,oe]=st([]),[Re,Oe]=st([]),[de,$]=st(new Date().toString()),ge=Ot(void 0);Un(()=>{const k=()=>{I(""),W(""),N(""),z(""),J(""),X(0),Be(""),Re.splice(0,L.length),L.splice(0,L.length),le.splice(0,le.length),we.splice(0,we.length)},P=()=>{F(n.kernelType||"")},Z=he=>{if(he&&he.type==="mediaInfo"){ge.current=he.value,F(n.kernelType||""),I(he.value.streamHost||""),W(he.value.colorSpace||""),Be(he.value.sid||""),je(he.value.gpu||"");const Ie=[];he.value.coreType&&Ie.push(he.value.coreType),he.value.box&&(he.value.enhancedFlv?Ie.push("enhanced-flv"):Ie.push(he.value.box)),he.value.videoCodecType&&Ie.push(he.value.videoCodecType),he.value.videoDecoder&&Ie.push(he.value.videoDecoder),he.value.width&&he.value.height&&Ie.push(`${he.value.width}x${he.value.height}`),he.value.sar&&Ie.push(`[SAR ${he.value.sar.width}:${he.value.sar.height}]`),he.value.fps&&Ie.push(`@${he.value.fps.toFixed(2)}`),N(Ie.join(" "));const Ee=[];he.value.videoCodec&&Ee.push(he.value.videoCodec),he.value.audioCodec&&Ee.push(he.value.audioCodec),z(Ee.join(","))}he&&he.type==="heartbeat"&&(he.value.decodedFrames&&J(`${he.value.decodedFPS||0}/${he.value.droppedFPS||0} ${he.value.decodedFrames||0}/${he.value.droppedFrames||0}`),typeof he.value.totalReceive=="number"&&X(he.value.totalReceive),U(he.value.videoBuffered||0,L,D),U(he.value.audioBuffered||0,le,oe),!L.length&&!le.length&&U(he.value.buffered||0,Re,Oe),U(he.value.speed||0,we,ue),$(new Date().toString()))};return n.on(An.ATTRIBUTE_CHANGE_SRC,k),n.on(An.REPORT,Z),n.on(An.LOADEDMETADATA,P),()=>{n.off(An.ATTRIBUTE_CHANGE_SRC,k),n.off(An.REPORT,Z),n.off(An.LOADEDMETADATA,P),ve.current&&clearTimeout(ve.current)}},[]);const[Pe,ae]=st(""),[q,b]=st(!1),ve=Ot(0),U=br((k,P,Z)=>{typeof k=="number"&&!isNaN(k)&&(P.push(k),P.length>mh?P.shift():P.length===1&&(P.unshift(...new Array(mh-1)),P.forEach((he,Ie)=>{typeof he!="number"&&(P[Ie]=0)})),Z([...P]))},[]),M=br(()=>{n.logger.i(Fm,"click copy");const k={date:de};C&&(k.did=C),o&&(k.playerVersion=o),ye&&(k.sessionId=ye),w&&(k.streamHost=w),S&&(k.colorSpace=S),j&&(k.res=j),K&&(k.codec=K),Ve&&(k.gpu=Ve),L.length&&(k.vBuffer=L[L.length-1]),le.length&&(k.aBuffer=le[le.length-1]),Re.length&&(k.buffer=Re[Re.length-1]),we.length&&(k.speed=we[we.length-1]),ge.current&&(k.mediainfo=ge.current),k.userAgent=navigator.userAgent,k.summary=n.audienceStat;const P=Vm(JSON.stringify(k));ae(P?"已复制":"复制失败"),b(!0),ve.current&&clearTimeout(ve.current),ve.current=+setTimeout(()=>{b(!1),ve.current=0},1e3)},[]),ne=br(k=>k>1e9?`${(k/1e9).toFixed(2)} GB`:k>1e6?`${(k/1e6).toFixed(2)} MB`:`${(k/1e3).toFixed(2)} KB`,[]),Le=br(k=>k>1e7?`${(k/1e6).toFixed(2)} MB/s`:`${(k/1e3).toFixed(2)} KB/s`,[]),Ue=br(k=>k>1e3?`${(k/1e3).toFixed(2)} s`:`${k} ms`,[]),re=br(k=>{k.stopPropagation()},[]);return De("div",{className:Vt?Ri["container-h5"]:Ri.container,onContextMenu:re,children:[C&&De(Hr,{title:"DeviceId",value:C}),o&&De(Hr,{title:"PlayerVersion",value:o}),h&&De(Hr,{title:"kernel",value:h}),ye&&De(Hr,{title:"SessionId",value:ye}),w&&De(Hr,{title:"StreamHost",value:w}),j&&De(Hr,{title:"Res",value:j}),S&&De(Hr,{title:"Color",value:S}),K&&De(Hr,{title:"Codec",value:K}),B&&De(Hr,{title:"Frames",value:B}),!!Re.length&&De(ks,{title:"Buffered",value:Re,suffix:Ue}),!!L.length&&De(ks,{title:"VideoBuffered",value:L,suffix:Ue}),!!le.length&&De(ks,{title:"AudioBuffered",value:le,suffix:Ue}),!!we.length&&De(ks,{title:"Speed",value:we,suffix:Le}),be>0&&De(Hr,{title:"TotalReceive",value:ne(be)}),Ve&&De(Hr,{title:"GPU",value:Ve}),De(Hr,{title:"Date",value:de}),De("div",{className:[Vt?Ri["h5-btn"]:"",Ri["close-btn"]].join(" "),onClick:T,children:"[X]"}),De("div",{className:Ri.actions,children:[d&&De("div",{className:[Vt?Ri["h5-btn"]:"",Ri["copy-btn"]].join(" "),onClick:A,children:"[Download Log]"}),s&&De("div",{className:[Vt?Ri["h5-btn"]:"",Ri["copy-btn"]].join(" "),onClick:m,children:["[Log ",d?"on":"off","]"]}),De("div",{className:[Vt?Ri["h5-btn"]:"",Ri["copy-btn"]].join(" "),onClick:M,children:[q&&De("div",{className:Ri["btn-tip"],children:Pe}),De("div",{children:"[Copy]"})]})]})]})}const Hm="kwai-player-web-play-info",bh="play-info-plugin",Eh=class Tc extends Rm{constructor(){super(...arguments),Vn(this,"_player"),Vn(this,"_i18n"),Vn(this,"_callback",new Im),Vn(this,"_option",{showInPlayBar:!1,showInContextMenu:!0,svgRaw:'<svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>'}),Vn(this,"_container"),Vn(this,"_onChangeShowEventLog",()=>{this._container&&(this.isShow=!this.isShow)}),Vn(this,"_onShowInfoPanelChange",()=>{var i;this.isShow=!!((i=this._player)!=null&&i.showInfoPanel)})}beforeInstall(i,n){n&&(n.showInPlayBar===!0&&(this._option.showInPlayBar=!0),n.showInContextMenu===!1&&(this._option.showInContextMenu=!1),n.svgRaw&&(this._option.svgRaw=n.svgRaw)),this._i18n=i.getPluginInstance(ph)}afterInstall(i,n){if(this._player=i,!this._player)return;this._container||(this._container=this._player.createSubContainer(),this._container.style.display="none",this._container.style.position="absolute",this._container.style.maxHeight="100%",this._container.style.overflowY="auto",this._container.style.top="0",this._container.style.left="0",Vt&&(this._container.style.width="100%"));const o=i.logger;if(Sa(De(Dm,{player:i,children:De(jm,{onChangeShowEventLog:this._onChangeShowEventLog})}),this._container),typeof i.showInfoPanel=="boolean")this.isShow=i.showInfoPanel,o.i(bh,`set show by player: ${i.showInfoPanel}`);else{let s=Hm;typeof(n==null?void 0:n.keyInUrl)=="string"&&(s=n==null?void 0:n.keyInUrl),location.href.indexOf(s)>=0&&(this.isShow=!0,o.i(bh,"set show by url: true"))}i.on(An.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL,this._onShowInfoPanelChange)}beforeUninstall(i){this._callback.destroy()}afterUninstall(i){this._container&&(Sa(null,this._container),i.removeSubContainer(this._container)),this._player=void 0,i.off(An.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL,this._onShowInfoPanelChange),this.removeAllListeners()}set isShow(i){this._container&&(this._container.style.display=i?"block":"none",this.emit(An.ATTRIBUTE_CHANGE),this._callback.call(i))}get isShow(){var i;return((i=this._container)==null?void 0:i.style.display)==="block"}get dom(){return this._container}getLabel(){return Tc.label}get controlsSoltBtns(){const i=[];if(this._option.showInContextMenu){const n={role:"play-info-context-menu",slotPos:Wo.CONTEXT_MENU,getChecked:()=>this.isShow,getText:()=>this._text("playInfo"),svgRaw:this._option.svgRaw,onClick:()=>this.isShow=!this.isShow,callback:this._callback};i.push(n)}if(this._option.showInPlayBar&&!Vt){const n={role:"play-info-btn",slotPos:Wo.PLAY_BAR_RIGHT,getTips:()=>this._text("playInfo"),svgRaw:this._option.svgRaw,onClick:()=>this.isShow=!this.isShow,callback:this._callback};i.push(n)}return i}_text(i){var n;return((n=this._i18n)==null?void 0:n.text(Tc.label,i))||"视频信息"}};Vn(Eh,"version","1.1.0-alpha.0");let Gm=Eh;var zm=Object.defineProperty,Km=(r,i,n)=>i in r?zm(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Va=(r,i,n)=>(Km(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var Wm=Object.defineProperty,Ym=(r,i,n)=>i in r?Wm(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,xr=(r,i,n)=>(Ym(r,typeof i!="symbol"?i+"":i,n),n);const Qm="ControlsPlugin",$m="I18nPlugin",yh="LoggerPlugin",Xm="HotkeyPlugin",Zm="PlayInfoPlugin",qm="RotatePlugin",Jm="PreviewPlugin",e1="MaskPlugin",t1="VRPlugin",i1="DanmakuPlugin";let ur=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};xr(ur,"label"),xr(ur,"version"),xr(ur,"isSupported"),xr(class up extends ur{getLabel(){return up.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",Qm),xr(class hp extends ur{getLabel(){return hp.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",$m),xr(class dp extends ur{getLabel(){return dp.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",yh),xr(class fp extends ur{getLabel(){return fp.label}},"label",Xm),xr(class pp extends ur{getLabel(){return pp.label}},"label",Zm),xr(class _p extends ur{getLabel(){return _p.label}},"label",qm),xr(class Ap extends ur{getLabel(){return Ap.label}},"label",Jm),xr(class vp extends ur{getLabel(){return vp.label}},"label",e1),xr(class gp extends ur{getLabel(){return gp.label}},"label",t1),xr(class mp extends ur{getLabel(){return mp.label}},"label",i1);var Ch=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Ch||{});const Yo=class bp extends ur{constructor(){super(...arguments),Va(this,"_player"),Va(this,"_domainList",[]),Va(this,"_logger")}afterInstall(i){var n;this._player=i,this._logger=i.getPluginInstance(yh),i.on(Ch.ATTRIBUTE_CHANGE_SRC,()=>{var s;(s=this._player)!=null&&s.src&&this._check(this._player.src)});const o=this._player.src;(n=this._logger)==null||n.appendSummaryField("prefetch",this._player.prefetch?1:0),o&&this._check(o)}beforeUninstall(){this._player=void 0}getLabel(){return bp.label}_check(i){var n,o,s,d,m,A;if((n=this._player)!=null&&n.autoplay||((o=this._player)==null?void 0:o.preload)!=="none"||!this._player.prefetch){(s=this._logger)==null||s.appendSummaryField("prefetch_valid",0);return}if((d=this._logger)==null||d.appendSummaryField("prefetch_valid",1),typeof i=="string"){const T=this._getHostname(i);T&&this._domainList.indexOf(T)===-1&&(this._domainList.push(T),(m=this._logger)==null||m.appendSummaryField("prefetch_start_time",Date.now()),this._send(i))}if(typeof i=="object"){const T=this._pickUrl(i),C={};let h=!1;for(const F of T){const w=this._getHostname(F);w&&!C[w]&&(C[w]=F,this._send(F),h||((A=this._logger)==null||A.appendSummaryField("prefetch_start_time",Date.now()),h=!0))}}}_send(i,n){const o=new XMLHttpRequest;o.open("HEAD",i),o.onreadystatechange=()=>{o.readyState===3&&(o.abort(),n&&n()),o.readyState===4&&n&&n()},o.timeout=3e3,o.ontimeout=()=>{console.warn(`${i} timeout`),n&&n()},o.onerror=()=>{console.warn(`${i} error`),n&&n()},o.send()}_getHostname(i){const n=i.match("^(http|https)://[a-zA-Z0-9._-]+");return n?n[0]:""}_pickUrl(i,n=[]){const o=Object.keys(i);for(let s=0;s<o.length;s++){const d=o[s];typeof i[d]=="string"&&this._getHostname(i[d])&&n.push(i[d]),typeof i[d]=="object"&&this._pickUrl(i[d],n)}return n}};Va(Yo,"version","1.1.0-alpha.0"),Va(Yo,"label","PrefetchPlugin");let r1=Yo;var n1=Object.defineProperty,a1=(r,i,n)=>i in r?n1(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,vn=(r,i,n)=>(a1(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var s1=Object.defineProperty,o1=(r,i,n)=>i in r?s1(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,kr=(r,i,n)=>(o1(r,typeof i!="symbol"?i+"":i,n),n);const c1="ControlsPlugin",l1="I18nPlugin",u1="LoggerPlugin",h1="HotkeyPlugin",d1="PlayInfoPlugin",f1="RotatePlugin",p1="PreviewPlugin",_1="MaskPlugin",A1="VRPlugin",v1="DanmakuPlugin";class Mr extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}}kr(Mr,"label"),kr(Mr,"version"),kr(Mr,"isSupported"),kr(class Ep extends Mr{getLabel(){return Ep.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",c1),kr(class yp extends Mr{getLabel(){return yp.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",l1),kr(class Cp extends Mr{getLabel(){return Cp.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",u1),kr(class Tp extends Mr{getLabel(){return Tp.label}},"label",h1),kr(class Ip extends Mr{getLabel(){return Ip.label}},"label",d1),kr(class Rp extends Mr{getLabel(){return Rp.label}},"label",f1);const Th=class wp extends Mr{getLabel(){return wp.label}};kr(Th,"label",p1);let g1=Th;kr(class Dp extends Mr{getLabel(){return Dp.label}},"label",_1),kr(class Lp extends Mr{getLabel(){return Lp.label}},"label",A1),kr(class Sp extends Mr{getLabel(){return Sp.label}},"label",v1);var Fa=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Fa||{});const m1=3e3;var Ih={exports:{}};(function(r,i){(function(n){var o=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,d=/(?:\/|^)\.(?=\/)/g,m=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,A={buildAbsoluteURL:function(T,C,h){if(h=h||{},T=T.trim(),C=C.trim(),!C){if(!h.alwaysNormalize)return T;var F=A.parseURL(T);if(!F)throw new Error("Error trying to parse base URL.");return F.path=A.normalizePath(F.path),A.buildURLFromParts(F)}var w=A.parseURL(C);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return h.alwaysNormalize?(w.path=A.normalizePath(w.path),A.buildURLFromParts(w)):C;var I=A.parseURL(T);if(!I)throw new Error("Error trying to parse base URL.");if(!I.netLoc&&I.path&&I.path[0]!=="/"){var S=s.exec(I.path);I.netLoc=S[1],I.path=S[2]}I.netLoc&&!I.path&&(I.path="/");var W={scheme:I.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(W.netLoc=I.netLoc,w.path[0]!=="/"))if(!w.path)W.path=I.path,w.params||(W.params=I.params,w.query||(W.query=I.query));else{var j=I.path,N=j.substring(0,j.lastIndexOf("/")+1)+w.path;W.path=A.normalizePath(N)}return W.path===null&&(W.path=h.alwaysNormalize?A.normalizePath(w.path):w.path),A.buildURLFromParts(W)},parseURL:function(T){var C=o.exec(T);return C?{scheme:C[1]||"",netLoc:C[2]||"",path:C[3]||"",params:C[4]||"",query:C[5]||"",fragment:C[6]||""}:null},normalizePath:function(T){for(T=T.split("").reverse().join("").replace(d,"");T.length!==(T=T.replace(m,"")).length;);return T.split("").reverse().join("")},buildURLFromParts:function(T){return T.scheme+T.netLoc+T.path+T.params+T.query+T.fragment}};r.exports=A})()})(Ih);var b1=Ih.exports;const E1=/\r\n|\n\r|\n|\r/g,y1=/^(?:(\d+):)?(\d{1,2}):(\d{1,2})(\.\d+)?/,C1=/\#xywh=(\d+),(\d+),(\d+),(\d+)/;class T1{constructor(){vn(this,"_url",""),vn(this,"_xhr"),vn(this,"_imgList",[])}clear(){this._destroyLoader(),this._imgList=[]}load(i){this._url=i,this._imgList=[],this._load(n=>{this._destroyLoader(),this._imgList=this._parse(n)},()=>{this._destroyLoader(this._xhr)},i,m1,"text")}_load(i,n,o,s,d){this._destroyLoader();const m=this._xhr=new XMLHttpRequest;m.open("GET",o,!0),d&&(m.responseType=d),m.timeout=s,m.onreadystatechange=()=>{m.readyState===2&&(m.status<200||m.status>299)&&n&&n(`xhr error: ${m.status}`)},m.ontimeout=m.onerror=()=>{n&&n("xhr error")},m.onload=()=>{i(m.response)},m.send()}getImgByTime(i){if(this._imgList&&this._imgList)return YA.search(this._imgList,n=>i<n.start?-1:i>n.end?1:0)}get hasPreview(){return!!(this._imgList&&this._imgList.length>0)}_destroyLoader(i){i&&(i.ontimeout=null,i.onload=null,i.onreadystatechange=null,i.onerror=null,i.onabort=null,i.abort())}_parse(i){if(!/^WEBVTT/.test(i))throw new Error("Not webVTT");const n=i.trim().replace(E1,`
`).split(`
`),o=[];let s;return n.forEach(d=>{if(d.indexOf("-->")!==-1){const m=this._parseTimeStamp(d);d=d.substring(d.indexOf("-->")+3).trim();const A=this._parseTimeStamp(d);typeof m=="number"&&typeof A=="number"&&(s={start:m,end:A,x:0,y:0,w:0,h:0,url:""})}else if(d){const m=d.match(C1);if(m&&s){s.x=parseInt(m[1]),s.y=parseInt(m[2]),s.w=parseInt(m[3]),s.h=parseInt(m[4]);const A=new URL(b1.buildAbsoluteURL(this._url,d,{alwaysNormalize:!0}));A.hash="",s.url=A.toString(),o.push(s)}}}),o}_parseTimeStamp(i){const n=i.match(y1);if(n)return this._computeSeconds(n[1],n[2],n[3],n[4])}_computeSeconds(i,n,o,s){return(parseInt(i)||0)*3600+(parseInt(n)||0)*60+(parseInt(o)||0)+(parseFloat(s)||0)}}const I1="preview-plugin";class Rh extends g1{constructor(){super(...arguments),vn(this,"_player"),vn(this,"_logger"),vn(this,"_kwaiPreview",new T1),vn(this,"_isSupported",typeof Element.prototype.getBoundingClientRect<"u"),vn(this,"_onSrcChange",()=>{this._clear()}),vn(this,"_onPreviewUrlChange",()=>{var i;(i=this._player)!=null&&i.previewUrl?this._load(this._player.previewUrl):this._clear()})}beforeInstall(i){this._player=i,this._logger=i.logger,i.on(Fa.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),i.on(Fa.ATTRIBUTE_CHANGE_PREVIEW_URL,this._onPreviewUrlChange)}afterInstall(i){i.previewUrl&&this._load(i.previewUrl)}afterUninstall(i){this._clear(),i.off(Fa.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),i.off(Fa.ATTRIBUTE_CHANGE_PREVIEW_URL,this._onPreviewUrlChange)}getImgByTime(i){return this._kwaiPreview.getImgByTime(i)}get hasPreview(){return!!this._kwaiPreview.hasPreview}_load(i){var n;(n=this._logger)==null||n.i(I1,`load: ${i}. is supported:${this._isSupported}`),this._isSupported&&this._kwaiPreview.load(i)}_clear(){this._destroyParser()}_destroyParser(){this._kwaiPreview&&this._kwaiPreview.clear()}}vn(Rh,"version","1.1.0-alpha.0"),function(){try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();var R1=Object.defineProperty,w1=(r,i,n)=>i in r?R1(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Zi=(r,i,n)=>(w1(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var D1=Object.defineProperty,L1=(r,i,n)=>i in r?D1(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,hr=(r,i,n)=>(L1(r,typeof i!="symbol"?i+"":i,n),n);const S1="ControlsPlugin",wh="I18nPlugin",O1="LoggerPlugin",N1="HotkeyPlugin",x1="PlayInfoPlugin",k1="RotatePlugin",M1="PreviewPlugin",P1="MaskPlugin",U1="VRPlugin",B1="DanmakuPlugin";var qn=(r=>(r.PLAY_BAR_LEFT="playBarLeft",r.PLAY_BAR_RIGHT="playBarRight",r.CONTEXT_MENU="contextMenu",r))(qn||{});class Dh{constructor(){hr(this,"_callbacks",[])}add(i){this._callbacks.push(i)}remove(i){const n=this._callbacks.findIndex(o=>o===i);n>=0&&this._callbacks.splice(n,1)}call(i){this._callbacks.forEach(n=>n(i))}destroy(){this._callbacks.splice(0,this._callbacks.length)}}let Pr=class extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}};hr(Pr,"label"),hr(Pr,"version"),hr(Pr,"isSupported"),hr(class Op extends Pr{getLabel(){return Op.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",S1),hr(class Np extends Pr{getLabel(){return Np.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",wh),hr(class xp extends Pr{getLabel(){return xp.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",O1),hr(class kp extends Pr{getLabel(){return kp.label}},"label",N1),hr(class Mp extends Pr{getLabel(){return Mp.label}},"label",x1);const Lh=class Pp extends Pr{getLabel(){return Pp.label}};hr(Lh,"label",k1);let V1=Lh;hr(class Up extends Pr{getLabel(){return Up.label}},"label",M1),hr(class Bp extends Pr{getLabel(){return Bp.label}},"label",P1),hr(class Vp extends Pr{getLabel(){return Vp.label}},"label",U1),hr(class Fp extends Pr{getLabel(){return Fp.label}},"label",B1);var Ln=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Ln||{});const Sh=class jp extends V1{constructor(){super(...arguments),Zi(this,"_player"),Zi(this,"_i18n"),Zi(this,"_callback",new Dh),Zi(this,"_mirrorCallback",new Dh),Zi(this,"_option",{showInContextMenu:"always",svgRaw:{mirror:'<svg width="200" height="200" viewBox="0 0 1024 1024"><path d="M185.6 202.24l180.906667 46.933333v525.653334l-180.906667 46.933333V202.24zM166.4 139.093333a38.4 38.4 0 0 0-38.4 38.4v669.013334a38.4 38.4 0 0 0 38.4 38.4h9.813333l219.306667-56.746667a38.826667 38.826667 0 0 0 28.586667-37.546667V234.666667a38.826667 38.826667 0 0 0-28.586667-37.546667L176.213333 140.373333H166.4zM838.4 202.24v619.52l-180.906667-46.933333V249.173333l180.906667-46.933333z m19.2-63.146667a35.413333 35.413333 0 0 0-9.386667 0l-219.733333 58.026667a38.4 38.4 0 0 0-28.586667 37.546667v554.666666a38.4 38.4 0 0 0 28.586667 37.546667l219.733333 56.746667a35.413333 35.413333 0 0 0 9.386667 0 38.4 38.4 0 0 0 38.4-38.4V177.493333a38.4 38.4 0 0 0-38.4-38.4zM512 896a29.013333 29.013333 0 0 1-29.013333-28.586667V156.586667a29.013333 29.013333 0 0 1 58.026666 0v710.826666A29.013333 29.013333 0 0 1 512 896z" fill="currentColor" p-id="1609"></path></svg>',counterClockwise:'<svg viewBox="0 0 1024 1024" width="200" height="200"><path d="M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32z m-44 402H188V494h440v326z m191.3-491.5c-78.8-100.7-196-153.6-314.6-154.2l-0.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7 0.4 12.6-6.1v-63.9c12.9 0.1 25.9 0.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8 11 40.7 14 82.7 8.9 124.8-0.7 5.4-1.4 10.8-2.4 16.1h74.9c14.8-103.6-11.3-213-81-302.3z" fill="currentColor" p-id="1311"></path></svg>',clockwise:'<svg viewBox="0 0 1024 1024" version="1.1" width="200" height="200"><path d="M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-0.4-12.6 6.1l-0.2 64c-118.6 0.5-235.8 53.4-314.6 154.2-69.6 89.2-95.7 198.6-81.1 302.4h74.9c-0.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8zM880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32z m-44 402H396V494h440v326z" fill="currentColor" p-id="1460"></path></svg>'}}),Zi(this,"_mainContainer"),Zi(this,"_innerRotate",0),Zi(this,"_outerRotate",0),Zi(this,"_isMirror",!1),Zi(this,"_resizeLoop"),Zi(this,"_resizeObserver"),Zi(this,"_stereoType"),Zi(this,"_onPlayerRendererChange",()=>{this.innerRotate=this._innerRotate}),Zi(this,"_onPlayerSrcChanged",()=>{this._stereoType=0}),Zi(this,"_onPlayerManifestParsed",i=>{this._stereoType=i.stereoType,this._stereoType===1&&(this._isMirror=!1,this.innerRotate=0)})}beforeInstall(i,n){n!=null&&n.showInPlayBar&&(this._option.showInPlayBar=typeof n.showInPlayBar=="string"?n.showInPlayBar:Object.assign({},n.showInPlayBar)),n!=null&&n.showInContextMenu&&(this._option.showInContextMenu=typeof n.showInContextMenu=="string"?n.showInContextMenu:Object.assign({},n.showInContextMenu)),n!=null&&n.svgRaw&&(this._option.svgRaw=Object.assign({},this._option.svgRaw,n.svgRaw)),i&&(this._player=i,this._i18n=i.getPluginInstance(wh))}afterInstall(i){i&&(this._player=i,this._mainContainer=this._player.mainContainer),this._mainContainer&&(this._resizeObserver=new fs(()=>{this.innerRotate=this._innerRotate}),this._resizeObserver.observe(this._mainContainer)),i.on(Ln.ATTRIBUTE_CHANGE_SRC,this._onPlayerSrcChanged),i.on(Ln.MANIFEST_PARSED,this._onPlayerManifestParsed),i.on(Ln.VIDEO_RENDERER_CHANGE,this._onPlayerRendererChange)}beforeUninstall(i){this._callback.destroy(),this._mirrorCallback.destroy()}afterUninstall(i){this._resizeLoop&&(clearInterval(this._resizeLoop),this._resizeLoop=void 0),this._resizeObserver&&this._mainContainer&&(this._resizeObserver.unobserve(this._mainContainer),this._resizeObserver.disconnect()),i.off(Ln.ATTRIBUTE_CHANGE_SRC,this._onPlayerSrcChanged),i.off(Ln.MANIFEST_PARSED,this._onPlayerManifestParsed),i.off(Ln.VIDEO_RENDERER_CHANGE,this._onPlayerRendererChange),this.removeAllListeners()}set innerRotate(i){i%90===0&&(this._innerRotate=this._normalizeAngle(i),this._updateInnerRotate()),this.emit(Ln.ATTRIBUTE_CHANGE),this._callback.call(i===0)}get innerRotate(){return this._innerRotate}set outerRotate(i){i%90===0&&(this._outerRotate=this._normalizeAngle(i),this._mainContainer&&this._setOuterRotate(this._mainContainer,this._outerRotate)),this.emit(Ln.ATTRIBUTE_CHANGE)}get outerRotate(){return this._outerRotate}set isMirror(i){this._isMirror=i,this._updateInnerRotate(),this._mirrorCallback.call(i)}get isMirror(){return this._isMirror}get controlsSoltBtns(){var i,n,o,s,d,m;const A=[];if(this._stereoType===1)return A;const T=this._option.showInContextMenu;if(T&&this._isShow(T,"counterClockwise")){const h={role:"rotate-counter-clockwise-context-menu",slotPos:qn.CONTEXT_MENU,getChecked:()=>!1,svgRaw:(i=this._option.svgRaw)==null?void 0:i.counterClockwise,getText:()=>this._text("rotateCounterClockwise")||"逆时针旋转画面",getTips:()=>this._text("rotateCounterClockwise")||"逆时针旋转画面",onClick:()=>this.innerRotate-=90,callback:this._callback};A.push(h)}if(T&&this._isShow(T,"clockwise")){const h={role:"rotate-clockwise-context-menu",slotPos:qn.CONTEXT_MENU,getChecked:()=>!1,svgRaw:(n=this._option.svgRaw)==null?void 0:n.clockwise,getText:()=>this._text("rotateClockwise")||"顺时针旋转画面",getTips:()=>this._text("rotateClockwise")||"顺时针旋转画面",onClick:()=>this.innerRotate+=90,callback:this._callback};A.push(h)}if(T&&this._isShow(T,"mirror")){const h={role:"mirror-context-menu",slotPos:qn.CONTEXT_MENU,getChecked:()=>this.isMirror,getText:()=>this._text("mirrorImage")||"镜像画面",svgRaw:(o=this._option.svgRaw)==null?void 0:o.mirror,onClick:()=>this.isMirror=!this.isMirror,callback:this._mirrorCallback};A.push(h)}const C=this._option.showInPlayBar;if(C&&this._isShow(C,"counterClockwise")){const h={role:"rotate-counter-clockwise-btn",slotPos:qn.PLAY_BAR_RIGHT,getChecked:()=>!1,svgRaw:(s=this._option.svgRaw)==null?void 0:s.counterClockwise,getTips:()=>this._text("rotateCounterClockwise")||"逆时针旋转画面",onClick:()=>this.innerRotate-=90,callback:this._callback};A.push(h)}if(C&&this._isShow(C,"clockwise")){const h={role:"rotate-clockwise-btn",slotPos:qn.PLAY_BAR_RIGHT,getChecked:()=>!1,svgRaw:(d=this._option.svgRaw)==null?void 0:d.clockwise,getTips:()=>this._text("rotateClockwise")||"顺时针旋转画面",onClick:()=>this.innerRotate+=90,callback:this._callback};A.push(h)}if(C&&this._isShow(C,"mirror")){const h={role:"mirror-btn",slotPos:qn.PLAY_BAR_RIGHT,getTips:()=>this._text("mirrorImage"),svgRaw:(m=this._option.svgRaw)==null?void 0:m.mirror,onClick:()=>this.isMirror=!this.isMirror,callback:this._mirrorCallback};A.push(h)}return A}_text(i){var n;return((n=this._i18n)==null?void 0:n.text(jp.label,i))||""}_isShow(i,n){const o=typeof i=="string"?i:i[n];return o==="always"||(Vt?o==="mobile":o==="pc")}_updateInnerRotate(){const i=this._player,n=this._mainContainer,o=this._normalizeAngle(this._innerRotate);if(o%90!==0||!n||!i||!i.video)return;const s={transformOrigin:"left top"},d=n.getBoundingClientRect().height,m=n.getBoundingClientRect().width;o===90?(s.width=s.maxWidth=`${d/m*100}%`,s.height=s.maxHeight=`${m/d*100}%`,s.transform="rotate(90deg) translateY(-100%)",this._isMirror&&(s.transform+=" scaleX(-1) translateX(-100%)"),s.margin="0"):o===180?(s.width=s.maxWidth="",s.height=s.maxHeight="",this._isMirror?s.transform="rotate(180deg) translateY(-100%) scaleX(-1)":s.transform="rotate(180deg) translateY(-100%) translateX(-100%)",s.margin="0"):o===270?(s.width=s.maxWidth=`${d/m*100}%`,s.height=s.maxHeight=`${m/d*100}%`,this._isMirror?s.transform="rotate(270deg) scaleX(-1)":s.transform="rotate(270deg) translateX(-100%)",s.margin="0"):(s.width=s.maxWidth="",s.height=s.maxHeight="",this._isMirror?s.transform="scaleX(-1) translateX(-100%)":s.transform="",s.margin=""),i.canvas&&Object.assign(i.canvas.style,s),i.video&&Object.assign(i.video.style,s),i.yodaDom&&Object.assign(i.yodaDom.style,s)}_setOuterRotate(i,n){n=this._normalizeAngle(n),n%90===0&&(n===90?(i.style.width="100vh",i.style.height="100vw",i.style.transformOrigin="left top",i.style.transform=`rotate(${n}deg) translate(0, -100%)`):n===180?(i.style.width="100vw",i.style.height="100vh",i.style.transformOrigin="left top",i.style.transform=`rotate(${n}deg) translate(-100%, -100%)`):n===270?(i.style.width="100vh",i.style.height="100vw",i.style.transformOrigin="left top",i.style.transform=`rotate(${n}deg) translate(-100%, 0)`):n===0&&(i.style.width="100vw",i.style.height="100vh",i.style.transformOrigin="",i.style.transform=""))}_normalizeAngle(i){return(i%360+360)%360}};Zi(Sh,"version","1.1.0-alpha.0");let F1=Sh;(function(){try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode("._watermark-video-fit_1h6i8_1{position:absolute;display:block}._watermark-fill-fit_1h6i8_6{position:absolute;display:block;top:0;left:0;width:100%;height:100%}._watermark_1h6i8_1{position:absolute;top:0;left:0;width:100%;height:100%}")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var j1=Object.defineProperty,H1=(r,i,n)=>i in r?j1(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Jn=(r,i,n)=>(H1(r,typeof i!="symbol"?i+"":i,n),n);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();var G1=Object.defineProperty,z1=(r,i,n)=>i in r?G1(r,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[i]=n,Ur=(r,i,n)=>(z1(r,typeof i!="symbol"?i+"":i,n),n);const K1="ControlsPlugin",W1="I18nPlugin",Y1="LoggerPlugin",Q1="HotkeyPlugin",$1="PlayInfoPlugin",X1="RotatePlugin",Z1="PreviewPlugin",q1="MaskPlugin",J1="VRPlugin",eb="DanmakuPlugin";class dr extends qr{static isInstanceOfPlugin(i){return typeof i.beforeInstall=="function"&&typeof i.afterInstall=="function"&&typeof i.beforeUninstall=="function"&&typeof i.afterUninstall=="function"&&typeof i.getLabel=="function"}get controlsSoltBtns(){}beforeInstall(i,n){}afterInstall(i,n){}beforeUninstall(i){}afterUninstall(i){}}Ur(dr,"label"),Ur(dr,"version"),Ur(dr,"isSupported"),Ur(class Hp extends dr{getLabel(){return Hp.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",K1),Ur(class Gp extends dr{getLabel(){return Gp.label}beforeInstall(i,n){}afterInstall(i,n){}},"label",W1),Ur(class zp extends dr{getLabel(){return zp.label}beforeInstall(i,n){}afterInstall(i,n){}addBizLog(i,n){}appendSummaryField(i,n){}},"label",Y1),Ur(class Kp extends dr{getLabel(){return Kp.label}},"label",Q1),Ur(class Wp extends dr{getLabel(){return Wp.label}},"label",$1),Ur(class Yp extends dr{getLabel(){return Yp.label}},"label",X1),Ur(class Qp extends dr{getLabel(){return Qp.label}},"label",Z1),Ur(class $p extends dr{getLabel(){return $p.label}},"label",q1),Ur(class Xp extends dr{getLabel(){return Xp.label}},"label",J1),Ur(class Zp extends dr{getLabel(){return Zp.label}},"label",eb);var Qo=(r=>(r.ERROR="error",r.MANIFEST_PARSED="manifestparsed",r.LEVEL_SWITCHING="levelswitching",r.LEVEL_SWITCHED="levelswitched",r.LEVEL_SWITCH_PLAYING="levelswitchplaying",r.LEVEL_SWITCH_FAILED="levelswitchfailed",r.LEVEL_UPDATED="levelupdated",r.AUDIO_TRACKS_SWITCHING="audiotrackswitching",r.AUDIO_TRACKS_SWITCHED="audiotrackswitched",r.LOADSTART="loadstart",r.PROGRESS="progress",r.SUSPEND="suspend",r.ABORT="abort",r.EMPTIED="emptied",r.STALLED="stalled",r.LOADEDMETADATA="loadedmetadata",r.LOADEDDATA="loadeddata",r.CANPLAY="canplay",r.CANPLAYTHROUGH="canplaythrough",r.PLAYING="playing",r.WAITING="waiting",r.SEEKING="seeking",r.SEEKED="seeked",r.ENDED="ended",r.DURATIONCHANGE="durationchange",r.TIMEUPDATE="timeupdate",r.PLAY="play",r.PAUSE="pause",r.RATECHANGE="ratechange",r.RESIZE="resize",r.VOLUMECHANGE="volumechange",r.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",r.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",r.REPORT="report",r.VIDEO_RENDERER_CHANGE="videorendererchange",r.FULLSCREEN_CHANGE="fullscreenchange",r.ATTRIBUTE_CHANGE="attribute:change",r.INTERACTION="interaction",r.LIVE_SHIFT_CHANGE="liveshiftchange",r.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",r.OBJECT_FIT_CHANGE="objectfitchange",r.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",r.ATTRIBUTE_CHANGE_SRC="attribute:change:src",r.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",r.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",r.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",r.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",r.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",r.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",r.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",r.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",r.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",r.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",r.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",r.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",r.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",r.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",r.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",r.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",r.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",r.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",r.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",r.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",r.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",r.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",r.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",r.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",r.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",r.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",r.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",r.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",r.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",r.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",r.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",r.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",r.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",r.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",r.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",r.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",r.CLICK_NEXT="clicknext",r.CLICK_LOGIN="clicklogin",r.CLICK_REGISTER="clickregister",r.CLICK_VIP="clickvip",r))(Qo||{}),Oh=(r=>(r.VIDEO="video",r.VIDEO_INTERACTIVE="videoInteractive",r.DEFAULT="default",r))(Oh||{});const tb="_watermark_1h6i8_1",Nh={"watermark-video-fit":"_watermark-video-fit_1h6i8_1","watermark-fill-fit":"_watermark-fill-fit_1h6i8_6",watermark:tb};var xh=(r=>(r.VIDEO="video",r.FILL="fill",r))(xh||{});const $o=class qp extends dr{constructor(){super(...arguments),Jn(this,"_player"),Jn(this,"_container"),Jn(this,"_fit","video"),Jn(this,"_observer"),Jn(this,"_updateDomPosition",()=>{const i=this._player;if(this._container&&this._fit==="video"&&i){this._container.style.display=this._getContainerDisplay();const n=i.videoLayer,{width:o,height:s}=n.getBoundingClientRect(),d=i.videoWidth,m=i.videoHeight;if(!d||!m)return;if(d/m>o/s){const A=(s-m/d*o)/2;this._container.style.top=`${A}px`,this._container.style.bottom=`${A}px`,this._container.style.left="0",this._container.style.right="0"}else{const A=(o-d/m*s)/2;this._container.style.left=`${A}px`,this._container.style.right=`${A}px`,this._container.style.top="0",this._container.style.bottom="0"}}})}afterInstall(i){var n;this._player=i;const o=this._player.mainContainer,s=o==null?void 0:o.querySelector('[kwai-player-watermark=""]');s&&o&&(this._container=this._player.createSubContainer(Oh.VIDEO),this._applyClassName(this._container,this._fit),this._container.style.display=this._getContainerDisplay(),(n=this._container)==null||n.appendChild(s),this._observer=new fs(()=>{this._updateDomPosition()}),this._observer.observe(o)),i.on(Qo.RESIZE,this._updateDomPosition)}beforeUninstall(i){this._container&&(i==null||i.removeSubContainer(this._container)),i.off(Qo.REPORT,this._updateDomPosition),this._player=void 0,this._container=void 0,this._observer&&(this._observer.disconnect(),this._observer=void 0)}getLabel(){return qp.label}set fit(i){this._fit==="video"&&this._container&&(this._container.style.top="",this._container.style.bottom="",this._container.style.left="",this._container.style.right=""),this._fit=i,this._container&&(this._container.style.display=this._getContainerDisplay(),this._applyClassName(this._container,this._fit)),this._updateDomPosition()}get get(){return this._fit}_applyClassName(i,n){n==="video"?i.className=Nh["watermark-video-fit"]:i.className=Nh["watermark-fill-fit"]}_getContainerDisplay(){var i;return!((i=this._player)!=null&&i.videoWidth)&&this._fit==="video"?"none":""}};Jn($o,"version","1.1.0-alpha.0"),Jn($o,"label","WaterMarkPlugin");let ib=$o;ah.defaultDict=Mv,sr.register(ah),sr.register(fh),sr.register(ib),sr.register(Qu),sr.register(Gm),sr.register(r1),sr.register(Rh),sr.register(rh),sr.register(F1),sr.register(ng),sr.packVersion="1.1.19.vue3",Tt.CallbackProxy=Y_,Tt.ControlsLangDictKey=Ze,Tt.ControlsPluginLabel=qc,Tt.ControlsPluginModule=Q_,Tt.ControlsSlotPos=ul,Tt.DanmakuControlsPos=ll,Tt.DanmakuPluginDomStyle=cl,Tt.DanmakuPluginLabel=ol,Tt.DanmakuPluginModule=rA,Tt.FullscreenType=Zr,Tt.HotkeyPluginLabel=tl,Tt.HotkeyPluginModule=Z_,Tt.I18nPluginLabel=Jc,Tt.I18nPluginModule=$_,Tt.KwaiPlayer=sr,Tt.KwaiPlayerEvent=We,Tt.KwaiPlayerLayer=Ra,Tt.KwaiPlayerVue3=os,Tt.LiveShiftType=Kn,Tt.LoggerPluginLabel=el,Tt.LoggerPluginModule=X_,Tt.MaskPluginLabel=al,Tt.MaskPluginModule=tA,Tt.PlayInfoPluginLabel=il,Tt.PlayInfoPluginModule=q_,Tt.PluginModule=tr,Tt.PreviewPluginLabel=nl,Tt.PreviewPluginModule=eA,Tt.RotatePluginLabel=rl,Tt.RotatePluginModule=J_,Tt.VRPluginLabel=sl,Tt.VRPluginModule=iA,Tt.WatermarkFit=xh,Tt.default=os,Object.defineProperties(Tt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});