UNPKG

@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)*

1 lines 1.2 MB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KwaiPlayerVue2=e():t.KwaiPlayerVue2=e()}(this,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=5)}([function(t,e,i){var n=i(6);t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(){return t.exports=i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,i.apply(this,arguments)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=i(7)},function(t,e,i){"use strict";i.r(e),i.d(e,"CallbackProxy",(function(){return De})),i.d(e,"ControlsLangDictKey",(function(){return qa})),i.d(e,"ControlsPluginLabel",(function(){return ve})),i.d(e,"ControlsPluginModule",(function(){return Ne})),i.d(e,"ControlsSlotPos",(function(){return Le})),i.d(e,"DanmakuControlsPos",(function(){return we})),i.d(e,"DanmakuPluginDomStyle",(function(){return Re})),i.d(e,"DanmakuPluginLabel",(function(){return Ie})),i.d(e,"DanmakuPluginModule",(function(){return Ze})),i.d(e,"FullscreenType",(function(){return Kt})),i.d(e,"HotkeyPluginLabel",(function(){return me})),i.d(e,"HotkeyPluginModule",(function(){return Be})),i.d(e,"I18nPluginLabel",(function(){return Ae})),i.d(e,"I18nPluginModule",(function(){return xe})),i.d(e,"KwaiPlayer",(function(){return ii})),i.d(e,"KwaiPlayerEvent",(function(){return Qt})),i.d(e,"KwaiPlayerLayer",(function(){return Yt})),i.d(e,"KwaiPlayerVue2",(function(){return li})),i.d(e,"LiveShiftType",(function(){return Wt})),i.d(e,"LoggerPluginLabel",(function(){return ge})),i.d(e,"LoggerPluginModule",(function(){return Me})),i.d(e,"MaskPluginLabel",(function(){return Ce})),i.d(e,"MaskPluginModule",(function(){return Ke})),i.d(e,"PlayInfoPluginLabel",(function(){return be})),i.d(e,"PlayInfoPluginModule",(function(){return Fe})),i.d(e,"PluginModule",(function(){return Se})),i.d(e,"PreviewPluginLabel",(function(){return Ee})),i.d(e,"PreviewPluginModule",(function(){return ze})),i.d(e,"RotatePluginLabel",(function(){return ye})),i.d(e,"RotatePluginModule",(function(){return He})),i.d(e,"VRPluginLabel",(function(){return Te})),i.d(e,"VRPluginModule",(function(){return Qe})),i.d(e,"WatermarkFit",(function(){return Zc})),i.d(e,"default",(function(){return li}));var n,r,a,o,s,u=i(1),c=i.n(u),l=i(3),h=i.n(l),d=i(0),f=i.n(d),p=i(2),_=i.n(p),v=i(4),A=i.n(v);function g(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return m(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?m(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}var b=Object.defineProperty,y=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,T=function(t,e,i){return e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i},I=function(t,e,i){return new Promise((function(n,r){var a=function(t){try{s(i.next(t))}catch(t){r(t)}},o=function(t){try{s(i.throw(t))}catch(t){r(t)}},s=function(t){return t.done?n(t.value):Promise.resolve(t.value).then(a,o)};s((i=i.apply(t,e)).next())}))};Number.isFinite||(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)}),Array.prototype.find||(Array.prototype.find=function(t,e){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var i=Object(this),n=i.length>>>0,r=0;r<n;r++)if(t.call(e,i[r],r,i))return i[r]}),Array.prototype.findIndex||(Array.prototype.findIndex=function(t,e){if(null==this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var i=Object(this),n=i.length>>>0,r=0;r<n;r++)if(r in i&&t.call(e,i[r],r,i))return r;return-1}),Array.prototype.fill||(Array.prototype.fill=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=this.length),null==this)throw new TypeError("Array.prototype.fill called on null or undefined");for(var n=Object(this),r=n.length>>>0,a=e>>0,o=i>>0,s=a<0?Math.max(r+a,0):Math.min(a,r),u=o<0?Math.max(r+o,0):Math.min(o,r),c=s;c<u;c++)n[c]=t;return n});var R=Object.defineProperty,w=function(t,e,i){return function(t,e,i){e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},L=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=8)}([function(t,e,i){var n=i(5);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(7)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,i.apply(this,arguments)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(t,e,i,n,r,a,o){try{var s=t[a](o),u=s.value}catch(t){return void i(t)}s.done?e(u):Promise.resolve(u).then(n,r)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function s(t){i(o,r,a,s,u,"next",t)}function u(t){i(o,r,a,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(1).default,r=i(6);t.exports=function(t){var e=r(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(1).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(1).default;function r(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=r=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function d(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,i){return t[e]=i}}function f(t,e,i,n){var r=e&&e.prototype instanceof m?e:m,a=Object.create(r.prototype),o=new N(n||[]);return s(a,"_invoke",{value:L(t,i,o)}),a}function p(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=f;var _="suspendedStart",v="executing",A="completed",g={};function m(){}function b(){}function y(){}var E={};d(E,c,(function(){return this}));var C=Object.getPrototypeOf,T=C&&C(C(k([])));T&&T!==a&&o.call(T,c)&&(E=T);var I=y.prototype=m.prototype=Object.create(E);function R(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var i;s(this,"_invoke",{value:function(r,a){function s(){return new e((function(i,s){!function i(r,a,s,u){var c=p(t[r],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return i("throw",t,s,u)}))}u(c.arg)}(r,a,i,s)}))}return i=i?i.then(s,s):s()}})}function L(t,i,n){var r=_;return function(a,o){if(r===v)throw Error("Generator is already running");if(r===A){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===_)throw r=A,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var c=p(t,i,n);if("normal"===c.type){if(r=n.done?A:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=A,n.method="throw",n.arg=c.arg)}}}function D(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,D(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(r,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,g;var o=a.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function i(){for(;++r<t.length;)if(o.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return b.prototype=y,s(I,"constructor",{value:y,configurable:!0}),s(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,h,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,d(t,h,"GeneratorFunction")),t.prototype=Object.create(I),t},i.awrap=function(t){return{__await:t}},R(w.prototype),d(w.prototype,l,(function(){return this})),i.AsyncIterator=w,i.async=function(t,e,n,r,a){void 0===a&&(a=Promise);var o=new w(f(t,e,n,r),a);return i.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},R(I),d(I,h,"Generator"),d(I,c,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},i.values=k,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var i in this)"t"===i.charAt(0)&&o.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(n,r){return s.type="throw",s.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),O(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;O(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:k(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){i.r(e),i.d(e,"KwaiVideoLocalLog",(function(){return L})),i.d(e,"LogLevel",(function(){return f})),i.d(e,"DefaultLogger",(function(){return A})),i.d(e,"Logger",(function(){return v})),i.d(e,"printVersion",(function(){return u})),i.d(e,"DEFAULT_LOG_LEVEL",(function(){return p}));var n=i(0),r=i.n(n),a=i(3),o=i.n(a),s={idbName:"kwai-video-local-log",idbMaxDataCount:25e3,idbMaxFoldLog:20,maxLogLen:4096};function u(t,e){console.log("%c "+t+" %c "+e+" %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 t(){this.timeout=6048e5}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(t){}},r()(t,null,[{key:"available",get:function(){if(void 0===t._available)try{localStorage.setItem("alg","test"),t._available=!0}catch(e){t._available=!1}return t._available}}])}();c._available=void 0;var l,h,d=c,f=((h={}).NONE="none",h.ERROR="e",h.WARN="w",h.INFO="i",h.DEBUG="d",h.VERBOSE="v",h),p=f.ERROR,_=((l={})[f.NONE]={value:1,str:"N"},l[f.ERROR]={value:100,str:"E"},l[f.WARN]={value:200,str:"W"},l[f.INFO]={value:300,str:"I"},l[f.DEBUG]={value:400,str:"D"},l[f.VERBOSE]={value:500,str:"V"},l),v=function(){function t(t){if(this._name="kwai-v",this._level=p,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&"blob:"===location.protocol){var e,i=location.href.split("/"),n=null==(e=i[i.length-1])?void 0:e.match(/(\w+)-/);n&&(this._workerTag=t?t+"-"+n[1]:n[1])}else t&&(this._workerTag=t)}t.loadLogLevel=function(t,e){if(void 0===e&&(e=!0),location.href){var i=new RegExp(t+"=([a-z]{1})"),n=location.href.match(i);if(n&&n.length>1){var r=n[1];if(this._isValueInLevel(r))return r}}var a=(new d).read(t,e);if(this._isValueInLevel(a))return a},t.saveLogLevel=function(t,e){this._isValueInLevel(e)&&(new d).write(t,e)},t._isValueInLevel=function(t){return-1!==Object.values(f).indexOf(t)};var e=t.prototype;return e.setOutput=function(t){return this._output=t,this},e.setLevel=function(t){return this._level=t,this},e.setId=function(t){return this._id=t,this},e.setName=function(t){return this._name=t,this},e.getLevel=function(){return this._level},e.getOutput=function(){return this._output},e.hasOutput=function(){return!!this._output},e.e=function(t){if(this._isLevelEnabled(this._level,f.ERROR)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.ERROR,t,i);try{var a;null==(a=this._output)||a.e.apply(a,[r].concat(i))}catch(t){}}},e.w=function(t){if(this._isLevelEnabled(this._level,f.WARN)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.WARN,t,i);try{var a;null==(a=this._output)||a.w.apply(a,[r].concat(i))}catch(t){}}},e.i=function(t){if(this._isLevelEnabled(this._level,f.INFO)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.INFO,t,i);try{var a;null==(a=this._output)||a.i.apply(a,[r].concat(i))}catch(t){}}},e.d=function(t){if(this._isLevelEnabled(this._level,f.DEBUG)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.DEBUG,t,i);try{var a;null==(a=this._output)||a.d.apply(a,[r].concat(i))}catch(t){}}},e.v=function(t){if(this._isLevelEnabled(this._level,f.VERBOSE)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.VERBOSE,t,i);try{var a;null==(a=this._output)||a.v.apply(a,[r].concat(i))}catch(t){}}},e._isLevelEnabled=function(t,e){return _[t].value>=_[e].value},e._printLog=function(t,e,i){var n,r,a=typeof e;if("object"===a)e=(null==(r=e)?void 0:r.constructor.name)||"unknown";else if("function"===a){var o;e=(null==(o=Object.getOwnPropertyDescriptor(e,"name"))?void 0:o.value)||"unknown"}var s,u,c=((null==(n=_[t])?void 0:n.str)||"")+"|"+this._name+"["+("function"==typeof this._id?this._id():this._id)+"]["+this._workerTag+"]::"+e;return t===f.ERROR?(s=console).error.apply(s,[c].concat(i.slice(0))):(u=console).log.apply(u,[c].concat(i.slice(0))),c},t}(),A=new v,g=r()((function t(e){this._logger=void 0,this._id=0,this._config=s,this._id=t._id,t._id++,this._logger=(new v).setId(this._id).setLevel(f.INFO),this._config=o()({},s,e)}),[{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 (中国标准时间)"}}]);g._id=0;var m=i(4),b=i.n(m),y=i(2),E=i.n(y),C=function(){function t(t,e,i,n,r){var a=this;void 0===r&&(r=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(;a._taskQueue.length;){var t=a._taskQueue.shift();t&&a.run(t.task,t.mode)}},this._logger=t,this._name=e,this._storeName=i,this._dbIndex=n,this._version=r}var e=t.prototype;return e.init=function(){var t=this;if(!this._openReq&&indexedDB){var e=this._openReq=indexedDB.open(this._name,this._version);this._logger.i("idb-wrapper","open",e),e.onerror=function(){t._logger.i("idb-wrapper","open error.")},e.onsuccess=function(){t._logger.i("idb-wrapper","open success."),t._runTaskQueue()},e.onupgradeneeded=function(){t._logger.i("idb-wrapper","open upgradeneeded."),e.result.objectStoreNames.contains(t._storeName)&&e.result.deleteObjectStore(t._storeName);var i=e.result.createObjectStore(t._storeName,{keyPath:"id",autoIncrement:!0});t._dbIndex&&t._dbIndex.forEach((function(t){i.createIndex(t.name,t.keyPath,t.option)}))}}},e.run=function(t,e){if(void 0===e&&(e="readwrite"),this.init(),this._openReq&&"done"===this._openReq.readyState&&!this._openReq.error)return this._doTask(t,e);"error"!==this.state&&(this._taskQueue.push({task:t,mode:e}),this._taskQueue.length>1e3&&this._taskQueue.shift())},e.close=function(){var t=this;this._logger.i("idb-wrapper","close"),this._openReq&&("done"===this._openReq.readyState?(this._openReq.result.close(),this._openReq=void 0):this._openReq.onsuccess=function(){t.close()})},e.destroy=function(){this._logger.i("idb-wrapper","destroy"),this.close(),this._taskQueue=[]},e._doTask=function(t,e){var i=this;if(void 0===e&&(e="readwrite"),this._openReq&&!this._openReq.error)try{this._isTransactionActive=!0;var n=this._openReq.result.transaction(this._storeName,e),r=void 0;n.oncomplete=function(){i._isTransactionActive=!1,t.callback&&t.callback(r),i._runTaskQueue()},n.onabort=n.onerror=function(){i._isTransactionActive=!1,t.callback&&t.callback(r),i._runTaskQueue()},r=t.exec(n.objectStore(this._storeName))}catch(t){}else t.callback&&t.callback()},r()(t,[{key:"isTransactionActive",get:function(){return this._isTransactionActive}},{key:"state",get:function(){return this._openReq&&"done"===this._openReq.readyState?this._openReq.error?"error":"ready":"idle"}}])}(),T=[{name:"id",keyPath:"id",option:{unique:!0}}],I=[function(){function t(t){this._ctx=void 0,this._idb=void 0,this._logCount=0,this._saveCount=0,this._reCountOnSaveCount=100,this._reduceData=!1,this._ctx=t,this._idb=new C(t.logger,t.config.idbName,t.config.idbName,T),this._reCountOnSaveCount=Math.min(200,Math.max(50,Math.round(this._ctx.config.idbMaxDataCount/10))),this._count()}t.isSupported=function(){return typeof indexedDB<"u"};var e,i=t.prototype;return i.saveLog=function(t){var e=this,i={exec:function(e){return e.add({value:t})},callback:function(t){e._saveCount++,e._saveCount%e._reCountOnSaveCount==0&&e._count(),null!=t&&t.error&&e._ctx.logger.i("idb-backend","save log err",t.error)}};this._idb.run(i)},i.exportLog=(e=b()(E.a.mark((function t(){var e=this;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){e._ctx.logger.i("idb-backend","export start");var n={exec:function(t){return t.getAll()},callback:function(i){t(void 0===i?"":e._mergeGetAll(i.result))}};e._idb.run(n,"readonly")})));case 1:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)}),i.destroy=function(){this._idb.destroy()},i.clean=function(){this._idb.run({exec:function(t){return t.clear()}})},i._count=function(){var t=this,e={exec:function(t){return t.count()},callback:function(e){null!=e&&e.error||null==e||!e.result||(t._ctx.logger.i("idb-backend","count: "+e.result+" max: "+t._ctx.config.idbMaxDataCount),t._logCount=e.result,t._logCount>=t._ctx.config.idbMaxDataCount&&!t._reduceData&&t._deleteFromHead(t._logCount-Math.round(t._ctx.config.idbMaxDataCount/2)))}};this._idb.run(e)},i._deleteFromHead=function(t){var e=this;this._ctx.logger.i("idb-backend","delete from head"),this._reduceData=!0;var i={exec:function(t){return t.openCursor()},callback:function(i){if(e._reduceData=!1,null!=i&&i.result){var n=IDBKeyRange.bound(i.result.key,i.result.key+t,!1,!1),r={exec:function(t){return e._ctx.logger.i("idb-backend","del: "+n.lower+"~"+n.upper),t.delete(n)},callback:function(t){e._ctx.logger.i("idb-backend","del result: "+!(null==t||!t.error))}};e._idb.run(r)}}};this._idb.run(i)},i._mergeGetAll=function(t){return t.length?t.reduce((function(t,e){return""+t+e.value+"\n"}),""):""},r()(t,[{key:"isActive",get:function(){return"error"!==this._idb.state}}])}()];function R(t,e,i){var n=new Date;"string"!=typeof t&&(t=t.toString());var r=n.toLocaleString()+"."+n.getMilliseconds().toString().padStart(3,"0")+"|"+t+"|";return e.forEach((function(t){r+="object"==typeof t?JSON.stringify(t)+" ":t+" "})),r.length>i?r.substring(0,i):r}function w(t){return t.join("\n")}var L=function(){function t(t){var e=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(){e._delayTimer=setInterval((function(){e._saveLog(!0)}),1e3)},this._stopDelay=function(){e._delayTimer&&(clearTimeout(e._delayTimer),e._delayTimer=void 0)},u("kwai-video-local-log","1.0.13"),this._ctx=new g(t);var i=function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.addLog.apply(e,[t].concat(n))};this._loggerForAdd={e:i,w:i,i:i,d:i,v:i},this._ctx.logger.setOutput(this._loggerForAdd),this._ctx.logger.i("kwai-video-local-log","constructor",t,this._ctx.config),this._backend=function(t){for(var e=0;e<I.length;e++){var i=I[e];if(null!=i&&i.isSupported())return new i(t)}}(this._ctx),this._backend&&this._startDelay()}t.isSupported=function(){return function(){for(var t=0;t<I.length;t++){var e=I[t];if(null!=e&&e.isSupported())return!0}return!1}()};var e=t.prototype;return e.addLog=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];this._logCache.push(R(t,i,this._ctx.config.maxLogLen)),this._saveLog()},e.cleanLog=function(){var t;this._ctx.logger.i("kwai-video-local-log","clean"),null==(t=this._backend)||t.clean()},e.exportLog=function(){var t=this;return this._ctx.logger.i("kwai-video-local-log","export log"),new Promise((function(e,i){t._backend?t._backend.exportLog().then((function(i){e(w([i].concat(t._logCache)))})):e("")}))},e.downloadLog=function(t){var e=this;this._ctx.logger.i("kwai-video-local-log","download log: "+t),this._destroyDownloadHref(),this.exportLog().then((function(i){var n=new Blob([i],{type:"text/plain"});if(document){var r=document.createElement("a");e._downloadHref=r.href=URL.createObjectURL(n),r.download=t||"Log_web_"+(new Date).toLocaleString()+".log",document.body.appendChild(r),r.click(),r.remove()}else console.log("无document,当前是否在worker中")}))},e.destroy=function(){var t;this._destroyDownloadHref(),null==(t=this._backend)||t.destroy(),this._stopDelay()},e.getLoggerForAdd=function(){return this._loggerForAdd},e._destroyDownloadHref=function(){try{this._downloadHref&&(URL.revokeObjectURL(this._downloadHref),this._downloadHref=void 0)}catch(t){}},e._saveLog=function(t){if(void 0===t&&(t=!1),this._backend&&this._backend.isActive&&(this._logCache.length>=this._ctx.config.idbMaxFoldLog||this._logCache.length>0&&t)){var e=w(this._logCache);this._logCache.splice(0,this._logCache.length),e&&this._backend.saveLog(e)}},r()(t,null,[{key:"version",get:function(){return"1.0.13"}}])}();e.default=L}]);void 0===L&&console.error("esm-webpack-plugin: nothing exported!"),L.KwaiVideoLocalLog;var D=L.LogLevel,S=L.DefaultLogger,O=L.Logger,N=L.printVersion;L.DEFAULT_LOG_LEVEL,L.default;var k=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var P,M={exports:{}},U="object"==typeof Reflect?Reflect:null,B=U&&"function"==typeof U.apply?U.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};P=U&&"function"==typeof U.ownKeys?U.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var V=Number.isNaN||function(t){return t!=t};function F(){F.init.call(this)}M.exports=F,M.exports.once=function(t,e){return new Promise((function(i,n){function r(i){t.removeListener(e,a),n(i)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",r),i([].slice.call(arguments))}Z(t,e,a,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&Z(t,"error",e,i)}(t,r,{once:!0})}))},F.EventEmitter=F,F.prototype._events=void 0,F.prototype._eventsCount=0,F.prototype._maxListeners=void 0;var j=10;function H(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function G(t){return void 0===t._maxListeners?F.defaultMaxListeners:t._maxListeners}function z(t,e,i,n){var r,a,o;if(H(i),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),a=t._events),o=a[e]),void 0===o)o=a[e]=i,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(r=G(t))>0&&o.length>r&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,function(t){console&&console.warn&&console.warn(t)}(s)}return t}function W(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function K(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=W.bind(n);return r.listener=i,n.wrapFn=r,r}function Y(t,e,i){var n=t._events;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):X(r,r.length)}function Q(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function X(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function Z(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(a){n.once&&t.removeEventListener(e,r),i(a)}))}}Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:function(){return j},set:function(t){if("number"!=typeof t||t<0||V(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");j=t}}),F.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},F.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||V(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},F.prototype.getMaxListeners=function(){return G(this)},F.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=r[t];if(void 0===s)return!1;if("function"==typeof s)B(s,this,e);else{var u=s.length,c=X(s,u);for(i=0;i<u;++i)B(c[i],this,e)}return!0},F.prototype.addListener=function(t,e){return z(this,t,e,!1)},F.prototype.on=F.prototype.addListener,F.prototype.prependListener=function(t,e){return z(this,t,e,!0)},F.prototype.once=function(t,e){return H(e),this.on(t,K(this,t,e)),this},F.prototype.prependOnceListener=function(t,e){return H(e),this.prependListener(t,K(this,t,e)),this},F.prototype.removeListener=function(t,e){var i,n,r,a,o;if(H(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,r=a;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,r),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var r,a=Object.keys(i);for(n=0;n<a.length;++n)"removeListener"!==(r=a[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},F.prototype.listeners=function(t){return Y(this,t,!0)},F.prototype.rawListeners=function(t){return Y(this,t,!1)},F.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):Q.call(t,e)},F.prototype.listenerCount=Q,F.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]};var q=M.exports,J=function(){if(typeof Map<"u")return Map;function t(t,e){var i=-1;return t.some((function(t,n){return t[0]===e&&(i=n,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},e.prototype.set=function(e,i){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,n=t(i,e);~n&&i.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,n=this.__entries__;i<n.length;i++){var r=n[i];t.call(e,r[1],r[0])}},e}()}(),$=typeof window<"u"&&typeof document<"u"&&window.document===document,tt=typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),et="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(tt):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var it=["top","right","bottom","left","width","height","size","weight"],nt=typeof MutationObserver<"u",rt=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var i=!1,n=!1,r=0;function a(){i&&(i=!1,t()),n&&s()}function o(){et(a)}function s(){var t=Date.now();if(i){if(t-r<2)return;n=!0}else i=!0,n=!1,setTimeout(o,e);r=t}return s}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){!$||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),nt?(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)},t.prototype.disconnect_=function(){!$||!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)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;it.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),at=function(t,e){for(var i=0,n=Object.keys(e);i<n.length;i++){var r=n[i];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},ot=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||tt},st=ft(0,0,0,0);function ut(t){return parseFloat(t)||0}function ct(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(e,i){return e+ut(t["border-"+i+"-width"])}),0)}function lt(t){var e=t.clientWidth,i=t.clientHeight;if(!e&&!i)return st;var n=ot(t).getComputedStyle(t),r=function(t){for(var e={},i=0,n=["top","right","bottom","left"];i<n.length;i++){var r=n[i],a=t["padding-"+r];e[r]=ut(a)}return e}(n),a=r.left+r.right,o=r.top+r.bottom,s=ut(n.width),u=ut(n.height);if("border-box"===n.boxSizing&&(Math.round(s+a)!==e&&(s-=ct(n,"left","right")+a),Math.round(u+o)!==i&&(u-=ct(n,"top","bottom")+o)),!function(t){return t===ot(t).document.documentElement}(t)){var c=Math.round(s+a)-e,l=Math.round(u+o)-i;1!==Math.abs(c)&&(s-=c),1!==Math.abs(l)&&(u-=l)}return ft(r.left,r.top,s,u)}var ht=typeof SVGGraphicsElement<"u"?function(t){return t instanceof ot(t).SVGGraphicsElement}:function(t){return t instanceof ot(t).SVGElement&&"function"==typeof t.getBBox};function dt(t){return $?ht(t)?function(t){var e=t.getBBox();return ft(0,0,e.width,e.height)}(t):lt(t):st}function ft(t,e,i,n){return{x:t,y:e,width:i,height:n}}var pt=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ft(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=dt(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),_t=function(t,e){var i=function(t){var e=t.x,i=t.y,n=t.width,r=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(a.prototype);return at(o,{x:e,y:i,width:n,height:r,top:i,right:e+n,bottom:r+i,left:e}),o}(e);at(this,{target:t,contentRect:i})},vt=function(){function t(t,e,i){if(this.activeObservations_=[],this.observations_=new J,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u")&&Element instanceof Object){if(!(t instanceof ot(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new pt(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u")&&Element instanceof Object){if(!(t instanceof ot(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new _t(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),At=typeof WeakMap<"u"?new WeakMap:new J,gt=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=rt.getInstance(),n=new vt(e,i,this);At.set(this,n)};["observe","unobserve","disconnect"].forEach((function(t){gt.prototype[t]=function(){var e;return(e=At.get(this))[t].apply(e,arguments)}})),typeof tt.ResizeObserver<"u"&&tt.ResizeObserver;var mt={},bt=Object.prototype.hasOwnProperty;function yt(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function Et(t){try{return encodeURIComponent(t)}catch(t){return null}}mt.stringify=function(t,e){e=e||"";var i,n,r=[];for(n in"string"!=typeof e&&(e="?"),t)if(bt.call(t,n)){if(!(i=t[n])&&(null==i||isNaN(i))&&(i=""),n=Et(n),i=Et(i),null===n||null===i)continue;r.push(n+"="+i)}return r.length?e+r.join("&"):""},mt.parse=function(t){for(var e,i=/([^=?#&]+)=?([^&]*)/g,n={};e=i.exec(t);){var r=yt(e[1]),a=yt(e[2]);null===r||null===a||r in n||(n[r]=a)}return n};var Ct=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(2);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(0).default,r=i(3);t.exports=function(t){var e=r(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(0).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){function n(t,e){console.log("%c "+t+" %c "+e+" %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")}i.r(e),i.d(e,"LogLevel",(function(){return l})),i.d(e,"DefaultLogger",(function(){return p})),i.d(e,"Logger",(function(){return f})),i.d(e,"printVersion",(function(){return n})),i.d(e,"DEFAULT_LOG_LEVEL",(function(){return h}));var r=i(1),a=i.n(r),o=function(){function t(){this.timeout=6048e5}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(t){}},a()(t,null,[{key:"available",get:function(){if(void 0===t._available)try{localStorage.setItem("alg","test"),t._available=!0}catch(e){t._available=!1}return t._available}}])}();o._available=void 0;var s,u,c=o,l=((u={}).NONE="none",u.ERROR="e",u.WARN="w",u.INFO="i",u.DEBUG="d",u.VERBOSE="v",u),h=l.ERROR,d=((s={})[l.NONE]={value:1,str:"N"},s[l.ERROR]={value:100,str:"E"},s[l.WARN]={value:200,str:"W"},s[l.INFO]={value:300,str:"I"},s[l.DEBUG]={value:400,str:"D"},s[l.VERBOSE]={value:500,str:"V"},s),f=function(){function t(t){if(this._name="kwai-v",this._level=h,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&"blob:"===location.protocol){var e,i=location.href.split("/"),n=null==(e=i[i.length-1])?void 0:e.match(/(\w+)-/);n&&(this._workerTag=t?t+"-"+n[1]:n[1])}else t&&(this._workerTag=t)}t.loadLogLevel=function(t,e){if(void 0===e&&(e=!0),location.href){var i=new RegExp(t+"=([a-z]{1})"),n=location.href.match(i);if(n&&n.length>1){var r=n[1];if(this._isValueInLevel(r))return r}}var a=(new c).read(t,e);if(this._isValueInLevel(a))return a},t.saveLogLevel=function(t,e){this._isValueInLevel(e)&&(new c).write(t,e)},t._isValueInLevel=function(t){return-1!==Object.values(l).indexOf(t)};var e=t.prototype;return e.setOutput=function(t){return this._output=t,this},e.setLevel=function(t){return this._level=t,this},e.setId=function(t){return this._id=t,this},e.setName=function(t){return this._name=t,this},e.getLevel=function(){return this._level},e.getOutput=function(){return this._output},e.hasOutput=function(){return!!this._output},e.e=function(t){if(this._isLevelEnabled(this._level,l.ERROR)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.ERROR,t,i);try{var a;null==(a=this._output)||a.e.apply(a,[r].concat(i))}catch(t){}}},e.w=function(t){if(this._isLevelEnabled(this._level,l.WARN)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.WARN,t,i);try{var a;null==(a=this._output)||a.w.apply(a,[r].concat(i))}catch(t){}}},e.i=function(t){if(this._isLevelEnabled(this._level,l.INFO)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.INFO,t,i);try{var a;null==(a=this._output)||a.i.apply(a,[r].concat(i))}catch(t){}}},e.d=function(t){if(this._isLevelEnabled(this._level,l.DEBUG)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.DEBUG,t,i);try{var a;null==(a=this._output)||a.d.apply(a,[r].concat(i))}catch(t){}}},e.v=function(t){if(this._isLevelEnabled(this._level,l.VERBOSE)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.VERBOSE,t,i);try{var a;null==(a=this._output)||a.v.apply(a,[r].concat(i))}catch(t){}}},e._isLevelEnabled=function(t,e){return d[t].value>=d[e].value},e._printLog=function(t,e,i){var n,r,a=typeof e;if("object"===a)e=(null==(r=e)?void 0:r.constructor.name)||"unknown";else if("function"===a){var o;e=(null==(o=Object.getOwnPropertyDescriptor(e,"name"))?void 0:o.value)||"unknown"}var s,u,c=((null==(n=d[t])?void 0:n.str)||"")+"|"+this._name+"["+("function"==typeof this._id?this._id():this._id)+"]["+this._workerTag+"]::"+e;return t===l.ERROR?(s=console).error.apply(s,[c].concat(i.slice(0))):(u=console).log.apply(u,[c].concat(i.slice(0))),c},t}(),p=new f}]);void 0===Ct&&console.error("esm-webpack-plugin: nothing exported!"),Ct.LogLevel;var Tt=Ct.DefaultLogger;/*! js-cookie v3.0.5 | MIT */function It(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}Ct.Logger,Ct.printVersion,Ct.DEFAULT_LOG_LEVEL;var Rt=function t(e,i){function n(t,n,r){if(!(typeof document>"u")){"number"==typeof(r=It({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var o in r)r[o]&&(a+="; "+o,!0!==r[o]&&(a+="="+r[o].split(";")[0]));return document.cookie=t+"="+e.write(n,t)+a}}return Object.create({set:n,get:function(t){if(!(typeof document>"u"||arguments.length&&!t)){for(var i=document.cookie?document.cookie.split("; "):[],n={},r=0;r<i.length;r++){var a=i[r].split("="),o=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(n[s]=e.read(o,s),t===s)break}catch(t){}}return t?n[t]:n}},remove:function(t,e){n(t,"",It({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,It({},this.attributes,e))},withConverter:function(e){return t(It({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),wt="did",Lt="kwai_player_device_id";function Dt(){try{for(var t=1e9*Math.random()>>>0,e=[],i=0;i<7;i++)e.push("0123456789ABCDEF".charAt(16*Math.random()));var n="web_"+t+e.join("");return Tt.i(wt,"generate nanoId",n),n}catch(t){}return"web_did_generation_failed"}!function(){var t="";try{t=(Rt.get("did")||Rt.get("_did")||Rt.get("weblogger_did")||"").trim(),Tt.i(wt,"generate deviceId from cookie",t)}catch(t){Tt.i(wt,"generate deviceId from cookie err",t)}try{t?null==localStorage||localStorage.setItem(Lt,t):(t=((null==localStorage?void 0:localStorage.getItem(Lt))||"").trim(),Tt.i(wt,"generate deviceId from ls",t)),t||(t=Dt(),null==localStorage||localStorage.setItem(Lt,t))}catch(t){Tt.i(wt,"generate deviceId from ls err",t)}t||Dt()}();var St=function(){function t(){w(this,"timeout",6048e5)}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(n){}},_()(t,null,[{key:"available",get:function(){if(typeof t._available>"u")try{localStorage.setItem("alg","test"),t._available=!0}catch(e){t._available=!1}return t._available}}])}();w(St,"_available");var Ot,Nt,kt=St,xt={exports:{}};Ot=xt,Nt=xt.exports,function(t,e){var i="function",n="undefined",r="object",a="string",o="model",s="name",u="type",c="vendor",l="version",h="architecture",d="console",f="mobile",p="tablet",_="smarttv",v="wearable",A="embedded",g="Amazon",m="Apple",b="BlackBerry",y="Browser",E="Chrome",C="Firefox",T="Google",I="Microsoft",R="Motorola",w="Opera",L="Samsung",D="Sony",S="Xiaomi",O="Zebra",N="Facebook",k=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},x=function(t,e){return typeof t===a&&-1!==P(e).indexOf(P(t))},P=function(t){return t.toLowerCase()},M=function(t,e){if(typeof t===a)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===n?t:t.substring(0,255)},U=function(t,n){for(var a,o,s,u,c,l,h=0;h<n.length&&!c;){var d=n[h],f=n[h+1];for(a=o=0;a<d.length&&!c;)if(c=d[a++].exec(t))for(s=0;s<f.length;s++)l=c[++o],typeof(u=f[s])===r&&u.length>0?2===u.length?typeof u[1]==i?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==i||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):e:this[u[0]]=l?u[1].call(this,l,u[2]):e:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):this[u]=l||e;h+=2}},B=function(t,i){for(var n in i)if(typeof i[n]===r&&i[n].length>0){for(var a=0;a<i[n].length;a++)if(x(i[n][a],t))return"?"===n?e:n}else if(x(i[n],t))return"?"===n?e:n;return t},V={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"},F={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[s,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[s,l],[/opios[\/ ]+([\w\.]+)/i],[l,[s,w+" Mini"]],[/\bopr\/([\w\.]+)/i],[l,[s,w]],[/(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],[s,l],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[s,"UC"+y]],[/\bqbcore\/([\w\.]+)/i],[l,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[l,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[s,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[l,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure "+y],l],[/\bfocus\/([\w\.]+)/i],[l,[s,C+" Focus"]],[/\bopt\/([\w\.]+)/i],[l,[s,w+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[s,w+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[s,"MIUI "+y]],[/fxios\/([-\w\.]+)/i],[l,[s,C]],[/\bqihu|(qi?ho?o?|360)browser/i],[[s,"360 "+y]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 "+y],l],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[s,l],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[s],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[s,N],l],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[s,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[s,E+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[s,E+" WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[s,"Android "+y]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[s,l],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[l,[s,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[l,s],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[s,[l,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[s,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[s,"Netscape"],l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[s,C+" 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],[s,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,P]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",P]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,P]]],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],[o,[c,L],[u,p]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[o,[c,L],[u,f]],[/\((ip(?:hone|od)[\w ]*);/i],[o,[c,m],[u,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[o,[c,m],[u,p]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[o,[c,"Huawei"],[u,p]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[o,[c,"Huawei"],[u,f]],[/\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],[[o,/_/g," "],[c,S],[u,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[o,/_/g," "],[c,S],[u,p]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[o,[c,"OPPO"],[u,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[o,[c,"Vivo"],[u,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[o,[c,"Realme"],[u,f]],[/\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],[o,[c,R],[u,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[o,[c,R],[u,p]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[o,[c,"LG"],[u,p]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[o,[c,"LG"],[u,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[o,[c,"Lenovo"],[u,p]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[o,/_/g," "],[c,"Nokia"],[u,f]],[/(pixel c)\b/i],[o,[c,T],[u,p]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[o,[c,T],[u,f]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[o,[c,D],[u,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[o,"Xperia Tablet"],[c,D],[u,p]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[o,[c,"OnePlus"],[u,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[o,[c,g],[u,p]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[o,/(.+)/g,"Fire Phone $1"],[c,g],[u,f]],[/(playbook);[-\w\),; ]+(rim)/i],[o,c,[u,p]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[o,[c,b],[u,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[o,[c,"ASUS"],[u,p]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[o,[c,"ASUS"],[u,f]],[/(nexus 9)/i],[o,[c,"HTC"],[u,p]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[c,[o,/_/g," "],[u,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[o,[c,"Acer"],[u,p]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[o,[c,"Meizu"],[u,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[o,[c,"Sharp"],[u,f]],[/(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],[c,o,[u,f]],[/(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],[c,o,[u,p]],[/(surface duo)/i],[o,[c,I],[u,p]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[o,[c,"Fairphone"],[u,f]],[/(u304aa)/i],[o,[c,"AT&T"],[u,f]],[/\bsie-(\w*)/i],[o,[c,"Siemens"],[u,f]],[/\b(rct\w+) b/i],[o,[c,"RCA"],[u,p]],[/\b(venue[\d ]{2,7}) b/i],[o,[c,"Dell"],[u,p]],[/\b(q(?:mv|ta)\w+) b/i],[o,[c,"Verizon"],[u,p]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[o,[c,"Barnes & Noble"],[u,p]],[/\b(tm\d{3}\w+) b/i],[o,[c,"NuVision"],[u,p]],[/\b(k88) b/i],[o,[c,"ZTE"],[u,p]],[/\b(nx\d{3}j) b/i],[o,[c,"ZTE"],[u,f]],[/\b(gen\d{3}) b.+49h/i],[o,[c,"Swiss"],[u,f]],[/\b(zur\d{3}) b/i],[o,[c,"Swiss"],[u,p]],[/\b((zeki)?tb.*\b) b/i],[o,[c,"Zeki"],[u,p]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],o,[u,p]],[/\b(ns-?\w{0,9}) b/i],[o,[c,"Insignia"],[u,p]],[/\b((nxa|next)-?\w{0,9}) b/i],[o,[c,"NextBook"],[u,p]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],o,[u,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],o,[u,f]],[/\b(ph-1) /i],[o,[c,"Essential"],[u,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[o,[c,"Envizen"],[u,p]],[/\b(trio[-\w\. ]+) b/i],[o,[c,"MachSpeed"],[u,p]],[/\btu_(1491) b/i],[o,[c,"Rotor"],[u,p]],[/(shield[\w ]+) b/i],[o,[c,"Nvidia"],[u,p]],[/(sprint) (\w+)/i],[c,o,[u,f]],[/(kin\.[onetw]{3})/i],[[o,/\./g," "],[c,I],[u,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[o,[c,O],[u,p]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[o,[c,O],[u,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,o,[u,d]],[/droid.+; (shield) bui/i],[o,[c,"Nvidia"],[u,d]],[/(playstation [345portablevi]+)/i],[o,[c,D],[u,d]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[o,[c,I],[u,d]],[/smart-tv.+(samsung)/i],[c,[u,_]],[/hbbtv.+maple;(\d+)/i],[[o,/^/,"SmartTV"],[c,L],[u,_]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,"LG"],[u,_]],[/(apple) ?tv/i],[c,[o,m+" TV"],[u,_]],[/crkey/i],[[o,E+"cast"],[c,T],[u,_]],[/droid.+aft(\w)( bui|\))/i],[o,[c,g],[u,_]],[/\(dtv[\);].+(aquos)/i],[o,[c,"Sharp"],[u,_]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,M],[o,M],[u,_]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,_]],[/((pebble))app/i],[c,o,[u,v]],[/droid.+; (glass) \d/i],[o,[c,T],[u,v]],[/droid.+; (wt63?0{2,3})\)/i],[o,[c,O],[u,v]],[/(quest( 2)?)/i],[o,[c,N],[u,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[u,A]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[o,[u,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[o,[u,p]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,p]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[u,f]],[/(android[-\w\. ]{0,9});.+buil/i],[o,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[s,"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],[s,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,s]],os:[[/microsoft (windows) (vista|xp)/i],[s,l],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[s,[l,B,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[s,"Windows"],[l,B,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[s,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[s,"Mac OS"],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l,s],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[s,l],[/\(bb(10);/i],[l,[s,b]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[l,[s,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[s,C+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[l,[s,E+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[s,"Chromium OS"],l],[/(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],[s,l],[/(sunos) ?([\w\.\d]*)/i],[[s,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[s,l]]},j=function(i,d){if(typeof i===r&&(d=i,i=e),!(this instanceof j))return new j(i,d).getResult();var f=i||(typeof t!==n&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:""),p=d?function(t,e){var i={};for(var n in t)e[n]&&e[n].length%2==0?i[n]=e[n].concat(t[n]):i[n]=t[n];return i}(F,d):F;return this.getBrowser=function(){var t={};return t[s]=e,t[l]=e,U.call(t,f,p.browser),t.major=function(t){return typeof t===a?t.replace(/[^\d\.]/g,"").split(".")[0]:e}(t.version),t},this.getCPU=function(){var t={};return t[h]=e,U.call(t,f,p.cpu),t},this.getDevice=function(){var t={};return t[c]=e,t[o]=e,t[u]=e,U.call(t,f,p.device),t},this.getEngine=function(){var t={};return t[s]=e,t[l]=e,U.call(t,f,p.engine),t},this.getOS=function(){var t={};return t[s]=e,t[l]=e,U.call(t,f,p.os),t},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 f},this.setUA=function(t){return f=typeof t===a&&t.length>255?M(t,255):t,this},this.setUA(f),this};j.VERSION="1.0.2",j.BROWSER=k([s,l,"major"]),j.CPU=k([h]),j.DEVICE=k([o,c,u,d,f,_,p,v,A]),j.ENGINE=j.OS=k([s,l]),Ot.exports&&(Nt=Ot.exports=j),Nt.UAParser=j;var H=typeof t!==n&&(t.jQuery||t.Zepto);if(H&&!H.ua){var G=new j;H.ua=G.getResult(),H.ua.get=function(){return G.getUA()},H.ua.set=function(t){G.setUA(t);var e=G.getResult();for(var i in e)H.ua[i]=e[i]}}}("object"==typeof window?window:k);var Pt=0;var Mt=x(xt.exports)(),Ut=Mt.os.name,Bt=Ut&&Ut.toLowerCase().indexOf("android")>=0,Vt=Ut&&Ut.toLowerCase().indexOf("ios")>=0,Ft="mobile"===Mt.device.type||Bt||Vt,jt=D.ERROR;typeof location<"u"&&(jt=O.loadLogLevel("kwai-player-log")||D.ERROR,S.setLevel(jt).setName("kwai-p"));var Ht=q.EventEmitter;!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.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(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Gt=Object.defineProperty,zt=function(t,e,i){return function(t,e,i){e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Wt=function(t){return t.NONE="none",t.KWAI="kwai",t.KWAI2="kwai2",t}(Wt||{}),Kt=function(t){return t.SYSTEM="system",t.WINDOW="window",t}(Kt||{}),Yt=function(t){return t.VIDEO="video",t.VIDEO_INTERACTIVE="videoInteractive",t.DEFAULT="default",t}(Yt||{}),Qt=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(Qt||{}),Xt=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=62)}([function(t,e,i){i.d(e,"c",(function(){return r})),i.d(e,"q",(function(){return a})),i.d(e,"t",(function(){return o})),i.d(e,"s",(function(){return s})),i.d(e,"b",(function(){return u})),i.d(e,"d",(function(){return c})),i.d(e,"l",(function(){return l})),i.d(e,"i",(function(){return h})),i.d(e,"k",(function(){return d})),i.d(e,"r",(function(){return f})),i.d(e,"p",(function(){return p})),i.d(e,"m",(function(){return _})),i.d(e,"e",(function(){return v})),i.d(e,"f",(function(){return A})),i.d(e,"o",(function(){return g})),i.d(e,"a",(function(){return m})),i.d(e,"n",(function(){return b})),i.d(e,"h",(function(){return y})),i.d(e,"g",(function(){return E})),i.d(e,"j",(function(){return C}));var n,r=((n={}).unknown="unknown",n.h264="h264",n.hevc="hevc",n.av1="av1",n.kvc3="kvc3",n.kvc4="kvc4",n.kvc5="kvc5",n.kvc6="kvc6",n.aac="aac",n.mp3="mp3",n.opus="opus",n.yuv="yuv",n.rawvideo="rawvideo",n.vvc="vvc",n.bvc2="bvc2",n.kvc30="kvc30",n),a=function(t){return t.UNKNOWN="unknown",t.FHD="fhd",t.UHD_4K="4k",t}({}),o=function(t){return t.kvc3="kvc3",t.kvc4="kvc4",t.kvc5="kvc5",t.kvc6="kvc6",t.h265="h265",t.kw265="kw265",t.kvc30="kvc30",t}({}),s=function(t){return t.video="video",t.canvas="canvas",t}({}),u=function(t){return t.canvas2d="canvas2d",t.webgl="webgl",t}({}),c=function(t){return t.buildin="buildin",t.wasm="wasm",t.none="none",t.unsupported="unsupported",t}({}),l=function(t){return t.KWAI_FLV_ABR="kwaiFlvAbr",t.KWAI_FLV_MP="kwaiFlvMultipart",t.KWAI="kwai",t.FILE="file",t.OTHERS="others",t}({}),h=function(t){return t.flv="flv",t.hls="hls",t.hls_ts="hls_ts",t.hls_fmp4="hls_fmp4",t.webrtc="webrtc",t.mp4="mp4",t.raw="raw",t.mp3="mp3",t.wav="wav",t.aac="aac",t.matroska="matroska",t.ts="ts",t.ivf="ivf",t.yuv="yuv",t.unknown="unknown",t}({}),d=function(t){return t.RTC="rtc_retry",t.BACKUP="backup",t.FALLBACK="fallback",t.LOADER="loader",t}({}),f=function(t){return t.AUTO="auto",t.MIN="min",t}({}),p=function(t){return t.NONE="none",t.WAITING="waiting",t}({}),_=function(t){return t.NEXT="next",t.PREV="prev",t}({}),v=function(t){return t.STANDARD="standard",t.QUERY_START_END="queryStartEnd",t}({}),A=function(t){return t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle",t}({}),g=function(t){return t.VIDEO="video",t.AUDIO="audio",t}({}),m=function(t){return t.unknown="unknown",t.native="native",t.mse="mse",t.rtc="rtc",t}({}),b=function(t){return t[t.Normal=0]="Normal",t[t.V360=1]="V360",t[t.V180=2]="V180",t}({}),y=function(t){return t[t.normal=0]="normal",t[t.internal=1]="internal",t[t.retry=2]="retry",t}({}),E=function(t){return t.NONE="none",t.KWAI="kwai",t.KWAI2="kwai2",t}({}),C=function(t){return t.UNKNOWN="",t.PROBABLY="probably",t}({})},function(t,e,i){function n(t){return{data:t,byteIndex:0,bitIndex:0}}function r(t,e){if(l(t)>e){var i=e%8;t.byteIndex=t.byteIndex+Math.floor(e/8)+Math.floor((t.bitIndex+i)/8),t.bitIndex=(t.bitIndex+i)%8}else t.byteIndex=t.data.byteLength-1,t.bitIndex=7}function a(t,e){if(e>32)throw new Error("len must be less 32");var i=t.data[t.byteIndex],n=Math.min(8-t.bitIndex,e),r=e-n;t.bitIndex+=n;var o=i>>8-t.bitIndex&Math.pow(2,n)-1;return 8===t.bitIndex&&(t.bitIndex=0,t.byteIndex++),r?o<<r|a(t,r):o}function o(t){return a(t,d(t)+1)-1}function s(t){var e=o(t);return Math.pow(-1,e+1)*Math.ceil(e/2)}function u(t){var e=d(t);return e>=32?0:a(t,e)+(1<<e)-1}function c(t){for(var e=0,i=0;i<8;i++){var n=a(t,8);if(e|=(127&n)<<7*i,!(128&n))break}return e}function l(t){return 8*(t.data.byteLength-t.byteIndex)-t.bitIndex}function h(t){t.bitIndex>0&&(t.byteIndex++,t.bitIndex=0)}function d(t){for(var e=l(t),i=0;i<e;i++)if(1===a(t,1))return 0===t.bitIndex?(t.byteIndex--,t.bitIndex=7):t.bitIndex--,i;return 0}i.d(e,"c",(function(){return n})),i.d(e,"g",(function(){return r})),i.d(e,"a",(function(){return a})),i.d(e,"h",(function(){return o})),i.d(e,"f",(function(){return s})),i.d(e,"i",(function(){return u})),i.d(e,"e",(function(){return c})),i.d(e,"d",(function(){return l})),i.d(e,"b",(function(){return h}))},function(t,e,i){var n,r=((n=r||{}).METADATA="metadata",n.MEDIA_INFO="mediaInfo",n.PARSING_INIT_SEGMENT="parsingInitSegment",n.PARSING_DATA="parsingData",n.PARSED_DATA="parsedData",n.SCRIPT_PARSED="scriptParsed",n.KEY_FRAME_INDEXS="keyFrameIndexs",n.VIDEO_FRAME_INFO="videoFrameInfo",n.DISCONTINUITY="discontinuity",n.REPORT="report",n.LOAD_END="loadEnd",n.ERROR="error",n.MANIFEST_LOADED="manifestLoaded",n.MANIFEST_PARSED="manifestParsed",n.LEVEL_SWITCHING="levelSwitching",n.LEVEL_SWITCHED="levelSwitched",n.LEVEL_SWITCH_PLAYING="levelSwitchPlaying",n.LEVEL_SWITCH_FAILED="levelSwitchFailed",n.LEVEL_LOADED="levelLoaded",n.LEVEL_UPDATED="levelUpdated",n.AUDIO_TRACK_SWITCHING="audioTrackSwitching",n.AUDIO_TRACK_SWITCHED="audioTrackSwitched",n.AUDIO_TRACK_UPDATED="audioTrackUpdated",n.AUDIO_TRACK_SWITCH_FAILED="audioTrackSwitchFailed",n.HLS_MANIFEST_PARSED="hlsManifestParsed",n.HLS_KEY_LOADED="hlsKeyLoaded",n.AUDIO_TRACK_LOADED="audioLoaded",n.SUBTITLE_TRACK_LOADED="subtitleTrackLoaded",n.SUBTITLE_LOADED="subtitleLoaded",n.SUBTITLE_TRACK_SWITCHED="subtitleTrackSwitched",n.SUBTITLE_TRACK_UPDATED="subtitleTrackUpdated",n.BUFFER_CLEANING="bufferCleaning",n.VIDEO_SEEK="vdeoSeek",n.ABR_NEXT="abrNext",n.PRIV_NAL="privNal",n.SEI="sei",n.AAC_PRIV="aacPriv",n.RAW_DATA="rawData",n.MP4_NOT_FASTSTART="mp4NotFaststart",n.VIDEO_CODEC_DETECTED="videoCodecChange",n.H265_DETECTED="h265Detected",n.VIDEO_RENDERER_CHANGE="videoRendererChange",n.DEC_LIB_LOADED="decLibLoaded",n.DEC_INIT_COMPLETE="decoderInitComplete",n.DEC_VIDEO_READY="decVideoReady",n.STEP="step",n.RENDERER_INIT_COMPLETE="rendererInitComplete",n.RENDERER_BUF_EXPIRED="rendererBufExpired",n.RENDERER_SEEK="rendererSeek",n.RENDERER_BUF_UPDATE="rendererBufUpdate",n.RENDERER_DRAW="rendererDraw",n.RENDERER_WAITING="rendererWaiting",n.RENDERER_WAITING_END="rendererWaitingEnd",n.DECODER_FRAME="decoderFrame",n.DECODER_IMG="decoderImg",n.DECODER_SEEK="decoderSeek",n.DECODER_SEEK_ABORT="decoderSeekAbort",n.DECODER_WAITING="decoderWaiting",n.DECODER_DATA_END="decoderDataEnd",n.DECODER_BUF_LOW="decoderDataEmpty",n.DECODER_DROP_FRAME="decocerDropFrame",n.DECODER_MEDIA_INFO="decoderMediaInfo",n.MEDIA_CONNECTED="mediaConnected",n.LOADER_CHUNK_ARRIVAL="loaderChunkArrival",n.DEMUXER_DETECTED="demuxerDetected",n.MEDIA_DEMUX="mediaDemux",n.KEY_FRAME="keyFrame",n.USE_BACKUP="useBackup",n.NEW_SOURCE="newSource",n.DOWNLOAD="download",n.STOP_LOAD="stopLoad",n.LOAD="load",n.WAITING="waiting",n.LOADEDMETADATA="loadedmetadata",n.LOADEDDATA="loadeddata",n.CANPLAY="canplay",n.SEEKING="seeking",n.SEEK_WITH_LOAD="seekWithLoad",n.SEEKED="seeked",n.PLAYING="playing",n.PAUSE="pause",n.PLAY="play",n.ENDED="ended",n.TIMEUPDATE="timeupdate",n.PROGRESS="progress",n.RATE_CHANGE="ratechange",n.DURATION_CHANGE="durationchange",n.HEARTBEAT="heartbeat",n.MSE_UPDATE="mseUpdate",n.MSE_BUFFER_FULL="mseBufferFull",n.MSE_SOURCE_CLOSE="mseSourceClose",n.RETRY="retry",n.WORKER_LOG="workerLog",n.VISIBILITY_CHANGE="visibilityChange",n.SCREENSHOT="screenshot",n);e.a=r},function(t,e,i){i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return o})),i.d(e,"c",(function(){return s})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return v})),i.d(e,"g",(function(){return A})),i.d(e,"d",(function(){return g}));var n,r=i(19),a=((n={}).NETWORK_ERROR="networkError",n.MEDIA_ERROR="mediaError",n.KEY_SYSTEM_ERROR="keySystemError",n.MUX_ERROR="muxError",n.OTHER_ERROR="otherError",n.MSE_ERROR="mseError",n.DECODER_ERROR="decoderError",n.RENDERER_ERROR="rendererError",n),o=function(t){return t[t.LOAD_ERROR=10]="LOAD_ERROR",t[t.MANIFEST_LOAD_ERROR=11]="MANIFEST_LOAD_ERROR",t[t.LEVEL_LOAD_ERROR=12]="LEVEL_LOAD_ERROR",t[t.AUDIO_TRACK_LOAD_ERROR=13]="AUDIO_TRACK_LOAD_ERROR",t[t.KEY_LOAD_ERROR=14]="KEY_LOAD_ERROR",t[t.KEY_SYSTEM_LICENSE_REQUEST_FAILED=15]="KEY_SYSTEM_LICENSE_REQUEST_FAILED",t[t.DEC_LIB_LOAD_ERROR=16]="DEC_LIB_LOAD_ERROR",t[t.RTC_SDP_LOAD_ERROR=17]="RTC_SDP_LOAD_ERROR",t[t.SUBTITLE_TRACK_LOAD_ERROR=18]="SUBTITLE_TRACK_LOAD_ERROR",t[t.CANNOT_SEEK=100]="CANNOT_SEEK",t[t.VIDEO_ERROR=101]="VIDEO_ERROR",t[t.UNSUPPORTED=102]="UNSUPPORTED",t[t.CONFIG_ERROR=103]="CONFIG_ERROR",t[t.OTHER=104]="OTHER",t[t.UNKNOWN=105]="UNKNOWN",t[t.CANNOT_SEEK_BY_FRAME_INDEX=106]="CANNOT_SEEK_BY_FRAME_INDEX",t[t.SRC_EMPTY=107]="SRC_EMPTY",t[t.VIDEO_NO_SIZE=108]="VIDEO_NO_SIZE",t[t.NO_TRACKS_AVAILABLE=109]="NO_TRACKS_AVAILABLE",t[t.VIDEO_ERROR_1=111]="VIDEO_ERROR_1",t[t.VIDEO_ERROR_2=112]="VIDEO_ERROR_2",t[t.VIDEO_ERROR_3=113]="VIDEO_ERROR_3",t[t.VIDEO_ERROR_4=114]="VIDEO_ERROR_4",t[t.MEDIASOURCE_ERROR=200]="MEDIASOURCE_ERROR",t[t.ADDSOURCEBUFFER_ERROR=201]="ADDSOURCEBUFFER_ERROR",t[t.SOURCEBUFFER_ERROR=202]="SOURCEBUFFER_ERROR",t[t.ENDOFSTREAM_ERROR=203]="ENDOFSTREAM_ERROR",t[t.APPENDBUFFER_ERROR=204]="APPENDBUFFER_ERROR",t[t.CHANGETYPE_ERROR=205]="CHANGETYPE_ERROR",t[t.MSE_CAPABILITY_ERROR=206]="MSE_CAPABILITY_ERROR",t[t.MSE_SOURCE_BUFFER_CLOSE_ERROR=207]="MSE_SOURCE_BUFFER_CLOSE_ERROR",t[t.PARSING_ERROR=301]="PARSING_ERROR",t[t.REMUX_ERROR=302]="REMUX_ERROR",t[t.REMUX_ALLOC_ERROR=303]="REMUX_ALLOC_ERROR",t[t.REMUX_WORKER_ERROR=304]="REMUX_WORKER_ERROR",t[t.DEMUX_NOT_FOUND=305]="DEMUX_NOT_FOUND",t[t.MANIFEST_PARSING_ERROR=400]="MANIFEST_PARSING_ERROR",t[t.LEVEL_NO_UPDATE_ERROR=402]="LEVEL_NO_UPDATE_ERROR",t[t.KEY_SYSTEM_NO_ACCESS=500]="KEY_SYSTEM_NO_ACCESS",t[t.KEY_SYSTEM_NO_SESSION=501]="KEY_SYSTEM_NO_SESSION",t[t.KEY_SYSTEM_URL_ERROR=502]="KEY_SYSTEM_URL_ERROR",t[t.KEY_SYSTEM_NO_KEYS=505]="KEY_SYSTEM_NO_KEYS",t[t.FRAG_DECRYPT_ERROR=506]="FRAG_DECRYPT_ERROR",t[t.KEY_SYSTEM_NO_INIT_DATA=507]="KEY_SYSTEM_NO_INIT_DATA",t[t.KEY_SYSTEM_UNSUPPORTED=508]="KEY_SYSTEM_UNSUPPORTED",t[t.DECODER_LOAD_ERROR=600]="DECODER_LOAD_ERROR",t[t.DECODER_INIT_ERROR=601]="DECODER_INIT_ERROR",t[t.DECODER_DRAW_ERROR=602]="DECODER_DRAW_ERROR",t[t.DECODER_WEBGL_ERROR=603]="DECODER_WEBGL_ERROR",t[t.DECODER_UNSUPPORTED=604]="DECODER_UNSUPPORTED",t[t.DECODER_COPY_YUV_ERROR=605]="DECODER_COPY_YUV_ERROR",t[t.DECODER_DEC_ERROR=606]="DECODER_DEC_ERROR",t[t.DECODER_2D_ERROR=607]="DECODER_2D_ERROR",t[t.SCREENSHOT_INIT_ERROR=700]="SCREENSHOT_INIT_ERROR",t[t.SCREENSHOT_EMPTY_DATA_ERROR=701]="SCREENSHOT_EMPTY_DATA_ERROR",t[t.SCREENSHOT_CREATE_IMG_ERROR=702]="SCREENSHOT_CREATE_IMG_ERROR",t[t.LIVE_DISCONNECTED_ERROR=1009]="LIVE_DISCONNECTED_ERROR",t[t.WEBRTC_DISCONNECTED_ERROR=1010]="WEBRTC_DISCONNECTED_ERROR",t[t.WEBRTC_FAILED_ERROR=1011]="WEBRTC_FAILED_ERROR",t[t.WEBRTC_CLOSED_ERROR=1012]="WEBRTC_CLOSED_ERROR",t[t.WEBRTC_ICE_CANDIDATE_ERROR=1013]="WEBRTC_ICE_CANDIDATE_ERROR",t[t.WEBRTC_ICE_CONNECTION_ERROR=1014]="WEBRTC_ICE_CONNECTION_ERROR",t[t.WEBRTC_OFFER_ERROR=1015]="WEBRTC_OFFER_ERROR",t[t.WEBRTC_ANSWER_ERROR=1016]="WEBRTC_ANSWER_ERROR",t[t.WEBRTC_TRANSMISSION_DATA_NULL=1017]="WEBRTC_TRANSMISSION_DATA_NULL",t[t.WEBRTC_CONNECT_TIMEOUT=1018]="WEBRTC_CONNECT_TIMEOUT",t[t.WEBRTC_CONNECT_FAILED=1019]="WEBRTC_CONNECT_FAILED",t}({}),s=[o.VIDEO_ERROR,o.VIDEO_ERROR_1,o.VIDEO_ERROR_2,o.VIDEO_ERROR_3,o.VIDEO_ERROR_4];function u(t,e,i,n){var r={type:t,details:e,code:0,fatal:!0,reason:i};if(n)for(var a in n){var o=n[a];void 0!==o&&(r[a]=o)}return r}var c="05",l="06",h="07",d="08",f="10",p="99",_={400:"01",401:"02",403:"03",404:"04",200:"09",206:"09"};function v(t){return t.indexOf(r.a.LOADER_CONNECT_TIMEOUT)>=0}function A(t){return t.indexOf(r.a.LOADER_TRANS_TIMEOUT)>=0}function g(t,e,i){if(void 0===i&&(i=0),t>=100)return t;var n="00";return v(e)?n=h:A(e)?n=d:e.indexOf(r.a.HANDLING_DATA_ERROR)>=0?n=f:Object.prototype.hasOwnProperty.call(_,i)?n=200!==i&&206!==i||!e?_[i]||"00":p:/^4\d{2}$/.test(i.toString())?n=c:/^5\d{2}$/.test(i.toString())&&(n=l),parseInt(t+n,10)}},function(t,e,i){i.d(e,"a",(function(){return r})),i.d(e,"f",(function(){return a})),i.d(e,"k",(function(){return o})),i.d(e,"c",(function(){return s})),i.d(e,"g",(function(){return u})),i.d(e,"d",(function(){return c})),i.d(e,"h",(function(){return l})),i.d(e,"l",(function(){return h})),i.d(e,"e",(function(){return d})),i.d(e,"j",(function(){return f})),i.d(e,"i",(function(){return p})),i.d(e,"b",(function(){return _}));var n="uin8arr out of range.";function r(t,e,i){var n=i?e+i:t.byteLength;if(Array.from)return String.fromCharCode.apply(null,Array.from(t.subarray(e,n)));for(var r=[],a=t.subarray(e,n),o=0;o<a.length;o++)r.push(a[o]);return String.fromCharCode.apply(null,r)}function a(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),e+1>=t.length)throw new Error(n+" "+e+"/"+t.length);return i?(t[e+1]<<8)+t[e]:(t[e]<<8)+t[e+1]}function o(t,e,i){if(void 0===i&&(i=0),e.byteLength-i<2)throw new Error(n+" "+i+"/"+e.length);e[i]=t>>8&255,e[i+1]=255&t}function s(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),e+1>=t.length)throw new Error(n+" "+e+"/"+t.length);var r=0;return 32768&(r=i?(t[e+1]<<8)+t[e]:(t[e]<<8)+t[e+1])&&(r=r-1-65535),r}function u(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),e+2>=t.length)throw new Error(n+" "+e+"/"+t.length);return i?(t[e+2]<<16)+(t[e+1]<<8)+t[e]:(t[e]<<16)+(t[e+1]<<8)+t[e+2]}function c(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),e+2>=t.length)throw new Error(n+" "+e+"/"+t.length);var r=0;return 8388608&(r=i?(t[e+2]<<16)+(t[e+1]<<8)+t[e]:(t[e]<<16)+(t[e+1]<<8)+t[e+2])&&(r=r-1-16777215),r}function l(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),e+3>=t.length)throw new Error(n+" "+e+"/"+t.length);var r;return(r=i?t[e+3]*Math.pow(2,24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]:t[e]*Math.pow(2,24)+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3])<0?4294967296+r:r}function h(t,e,i){if(void 0===i&&(i=0),e.byteLength-i<4)throw new Error(n+" "+i+"/"+e.length);e[i]=t>>24&255,e[i+1]=t>>16&255,e[i+2]=t>>8&255,e[i+3]=255&t}function d(t,e,i){if(void 0===i&&(i=!1),e+3>=t.length)throw new Error(n+" "+e+"/"+t.length);var r=0;return 2147483648&(r=i?t[e+3]*Math.pow(2,24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]:t[e]*Math.pow(2,24)+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3])&&(r=r-1-4294967295),r}function f(t,e,i){if(void 0===i&&(i=0),e.byteLength-i<4)throw new Error(n+" "+i+"/"+e.length);t<0&&(t+=4294967296),h(t,e,i)}function p(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=!1),e+7>=t.length)throw new Error(n+" "+e+"/"+t.length);return i?t[e+7]*Math.pow(2,56)+t[e+6]*Math.pow(2,48)+t[e+5]*Math.pow(2,40)+t[e+4]*Math.pow(2,32)+t[e+3]*Math.pow(2,24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]:t[e]*Math.pow(2,56)+t[e+1]*Math.pow(2,48)+t[e+2]*Math.pow(2,40)+t[e+3]*Math.pow(2,32)+t[e+4]*Math.pow(2,24)+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7]}function _(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}},function(t,e,i){var n=i(52);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(8),r=i.n(n),a={version:{major:0,string:""}};(function(t){if(typeof navigator<"u"){t=t?t.toLowerCase():navigator.userAgent.toLowerCase();var e=/(edge)\/([\w.]+)/.exec(t)||/(edg)\/([\w.]+)/.exec(t)||/(opr)[/]([\w.]+)/.exec(t)||/(chrome)[ /]([\w.]+)/.exec(t)||/(iemobile)[/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+).*(version)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(firefox)[ /]([\w.]+)/.exec(t)||[],i=/(ipad)/.exec(t)||/(ipod)/.exec(t)||/(windows phone)/.exec(t)||/(iphone)/.exec(t)||/(kindle)/.exec(t)||/(android)/.exec(t)||/(windows)/.exec(t)||/(mac)/.exec(t)||/(linux)/.exec(t)||/(cros)/.exec(t)||[],n=/(?:iphone|ipad|cpu) os (\d+)[._]\d+/.exec(t)||/android ([\d.]+)/.exec(t)||[],o={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",majorVersion:e[4]||e[2]||"0",platform:i[0]||"",platformVersion:n[1]||""},s={x5:/ tbs\//.test(t),xweb:/ xweb\//.test(t),version:{major:0,string:""}};if(o.browser){s[o.browser]=!0;var u=o.majorVersion.split(".");s.version={major:parseInt(o.majorVersion,10),string:o.version},u.length>1&&(s.version.minor=parseInt(u[1],10)),u.length>2&&(s.version.build=parseInt(u[2],10))}if(o.platform&&(s[o.platform]=!0),(s.chrome||s.opr||s.safari)&&(s.webkit=!0),s.rv||s.iemobile){s.rv&&delete s.rv;var c="msie";o.browser=c,s[c]=!0}if(s.edg||s.edge){delete s.edg,delete s.edge;var l="msedge";o.browser=l,s[l]=!0}if(s.opr){var h="opera";o.browser=h,s[h]=!0}if(s.safari&&s.android){var d="android";o.browser=d,s[d]=!0}if(s.android){var f=t.match(/android[\s0-9.]+;([\w\s-]+)(build)?/);if(f)try{var p;s.model=null==(p=f[1].split("build")[0])?void 0:p.trim()}catch(t){}}else s.ipad?s.model="ipad":s.iphone&&(s.model="iphone");for(var _ in(s.android||s.iphone||s.ipad)&&(s.mobile=!0),s.ios=s.iphone||s.ipad,s.name=o.browser,s.platform=o.platform,s.platformVersion=o.platformVersion,a)Object.prototype.hasOwnProperty.call(a,_)&&delete a[_];r()(a,s)}})(),e.a=a},function(t,e,i){i.d(e,"e",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"d",(function(){return a})),i.d(e,"f",(function(){return o})),i.d(e,"b",(function(){return s})),i.d(e,"q",(function(){return u})),i.d(e,"a",(function(){return c})),i.d(e,"h",(function(){return l})),i.d(e,"r",(function(){return h})),i.d(e,"n",(function(){return d})),i.d(e,"p",(function(){return f})),i.d(e,"i",(function(){return p})),i.d(e,"j",(function(){return _})),i.d(e,"k",(function(){return v})),i.d(e,"o",(function(){return A})),i.d(e,"m",(function(){return g})),i.d(e,"l",(function(){return m})),i.d(e,"g",(function(){return b}));var n=1048576,r=10485760,a=25,o=1e3,s=1e3,u=9e4,c=4294967296,l=1e3,h=.1,d=240,f=2e3,p=1e3,_=1500,v=5,A=33554432,g="kwai-k",m="kwai-kernel-log",b=500},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,i.apply(this,arguments)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){i.d(e,"a",(function(){return r}));var n,r=((n={})[n.HEVC_NAL_TRAIL_N=0]="HEVC_NAL_TRAIL_N",n[n.HEVC_NAL_TRAIL_R=1]="HEVC_NAL_TRAIL_R",n[n.HEVC_NAL_TSA_N=2]="HEVC_NAL_TSA_N",n[n.HEVC_NAL_TSA_R=3]="HEVC_NAL_TSA_R",n[n.HEVC_NAL_STSA_N=4]="HEVC_NAL_STSA_N",n[n.HEVC_NAL_STSA_R=5]="HEVC_NAL_STSA_R",n[n.HEVC_NAL_RADL_N=6]="HEVC_NAL_RADL_N",n[n.HEVC_NAL_RADL_R=7]="HEVC_NAL_RADL_R",n[n.HEVC_NAL_RASL_N=8]="HEVC_NAL_RASL_N",n[n.HEVC_NAL_RASL_R=9]="HEVC_NAL_RASL_R",n[n.HEVC_NAL_VCL_N10=10]="HEVC_NAL_VCL_N10",n[n.HEVC_NAL_VCL_R11=11]="HEVC_NAL_VCL_R11",n[n.HEVC_NAL_VCL_N12=12]="HEVC_NAL_VCL_N12",n[n.HEVC_NAL_VCL_R13=13]="HEVC_NAL_VCL_R13",n[n.HEVC_NAL_VCL_N14=14]="HEVC_NAL_VCL_N14",n[n.HEVC_NAL_VCL_R15=15]="HEVC_NAL_VCL_R15",n[n.HEVC_NAL_BLA_W_LP=16]="HEVC_NAL_BLA_W_LP",n[n.HEVC_NAL_BLA_W_RADL=17]="HEVC_NAL_BLA_W_RADL",n[n.HEVC_NAL_BLA_N_LP=18]="HEVC_NAL_BLA_N_LP",n[n.HEVC_NAL_IDR_W_RADL=19]="HEVC_NAL_IDR_W_RADL",n[n.HEVC_NAL_IDR_N_LP=20]="HEVC_NAL_IDR_N_LP",n[n.HEVC_NAL_CRA_NUT=21]="HEVC_NAL_CRA_NUT",n[n.HEVC_NAL_RSV_IRAP_VCL22=22]="HEVC_NAL_RSV_IRAP_VCL22",n[n.HEVC_NAL_RSV_IRAP_VCL23=23]="HEVC_NAL_RSV_IRAP_VCL23",n[n.HEVC_NAL_RSV_VCL24=24]="HEVC_NAL_RSV_VCL24",n[n.HEVC_NAL_RSV_VCL25=25]="HEVC_NAL_RSV_VCL25",n[n.HEVC_NAL_RSV_VCL26=26]="HEVC_NAL_RSV_VCL26",n[n.HEVC_NAL_RSV_VCL27=27]="HEVC_NAL_RSV_VCL27",n[n.HEVC_NAL_RSV_VCL28=28]="HEVC_NAL_RSV_VCL28",n[n.HEVC_NAL_RSV_VCL29=29]="HEVC_NAL_RSV_VCL29",n[n.HEVC_NAL_RSV_VCL30=30]="HEVC_NAL_RSV_VCL30",n[n.HEVC_NAL_RSV_VCL31=31]="HEVC_NAL_RSV_VCL31",n[n.HEVC_NAL_VPS=32]="HEVC_NAL_VPS",n[n.HEVC_NAL_SPS=33]="HEVC_NAL_SPS",n[n.HEVC_NAL_PPS=34]="HEVC_NAL_PPS",n[n.HEVC_NAL_AUD=35]="HEVC_NAL_AUD",n[n.HEVC_NAL_EOS_NUT=36]="HEVC_NAL_EOS_NUT",n[n.HEVC_NAL_EOB_NUT=37]="HEVC_NAL_EOB_NUT",n[n.HEVC_NAL_FD_NUT=38]="HEVC_NAL_FD_NUT",n[n.HEVC_NAL_SEI_PREFIX=39]="HEVC_NAL_SEI_PREFIX",n[n.HEVC_NAL_SEI_SUFFIX=40]="HEVC_NAL_SEI_SUFFIX",n[n.HEVC_NAL_RSV_NVCL41=41]="HEVC_NAL_RSV_NVCL41",n[n.HEVC_NAL_RSV_NVCL42=42]="HEVC_NAL_RSV_NVCL42",n[n.HEVC_NAL_RSV_NVCL43=43]="HEVC_NAL_RSV_NVCL43",n[n.HEVC_NAL_RSV_NVCL44=44]="HEVC_NAL_RSV_NVCL44",n[n.HEVC_NAL_RSV_NVCL45=45]="HEVC_NAL_RSV_NVCL45",n[n.HEVC_NAL_RSV_NVCL46=46]="HEVC_NAL_RSV_NVCL46",n[n.HEVC_NAL_RSV_NVCL47=47]="HEVC_NAL_RSV_NVCL47",n[n.HEVC_NAL_UNSPEC48=48]="HEVC_NAL_UNSPEC48",n[n.HEVC_NAL_UNSPEC49=49]="HEVC_NAL_UNSPEC49",n[n.HEVC_NAL_UNSPEC50=50]="HEVC_NAL_UNSPEC50",n[n.HEVC_NAL_UNSPEC51=51]="HEVC_NAL_UNSPEC51",n[n.HEVC_NAL_UNSPEC52=52]="HEVC_NAL_UNSPEC52",n[n.HEVC_NAL_UNSPEC53=53]="HEVC_NAL_UNSPEC53",n[n.HEVC_NAL_UNSPEC54=54]="HEVC_NAL_UNSPEC54",n[n.HEVC_NAL_UNSPEC55=55]="HEVC_NAL_UNSPEC55",n[n.HEVC_NAL_UNSPEC56=56]="HEVC_NAL_UNSPEC56",n[n.HEVC_NAL_UNSPEC57=57]="HEVC_NAL_UNSPEC57",n[n.HEVC_NAL_UNSPEC58=58]="HEVC_NAL_UNSPEC58",n[n.HEVC_NAL_UNSPEC59=59]="HEVC_NAL_UNSPEC59",n[n.HEVC_NAL_UNSPEC60=60]="HEVC_NAL_UNSPEC60",n[n.HEVC_NAL_UNSPEC61=61]="HEVC_NAL_UNSPEC61",n[n.HEVC_NAL_UNSPEC62=62]="HEVC_NAL_UNSPEC62",n[n.PRIV_NAL_MAGIC_HEVC=63]="PRIV_NAL_MAGIC_HEVC",n[n.NAL_UNIT_INVALID=64]="NAL_UNIT_INVALID",n)},function(t,e,i){var n=i(56);t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){i.d(e,"e",(function(){return r})),i.d(e,"a",(function(){return a})),i.d(e,"d",(function(){return o})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return u})),i(0);var n,r=((n={})[n.video=1]="video",n[n.audio=2]="audio",n),a=function(t){return t[t.ADTS=0]="ADTS",t[t.ASC=1]="ASC",t}({}),o=function(t){return t.videoFrame="videoFrame",t.decoderConfig="decoderConfig",t}({}),s=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}({}),u=function(t){return t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack",t}({})},function(t,e,i){var n,r,a,o;i.d(e,"a",(function(){return u})),i.d(e,"d",(function(){return c})),i.d(e,"c",(function(){return l})),i.d(e,"b",(function(){return h})),i.d(e,"e",(function(){return v})),i.d(e,"f",(function(){return A}));var s,u=((s={})[s.AVCOL_PRI_RESERVED0=0]="AVCOL_PRI_RESERVED0",s[s.AVCOL_PRI_BT709=1]="AVCOL_PRI_BT709",s[s.AVCOL_PRI_UNSPECIFIED=2]="AVCOL_PRI_UNSPECIFIED",s[s.AVCOL_PRI_RESERVED=3]="AVCOL_PRI_RESERVED",s[s.AVCOL_PRI_BT470M=4]="AVCOL_PRI_BT470M",s[s.AVCOL_PRI_BT470BG=5]="AVCOL_PRI_BT470BG",s[s.AVCOL_PRI_SMPTE170M=6]="AVCOL_PRI_SMPTE170M",s[s.AVCOL_PRI_SMPTE240M=7]="AVCOL_PRI_SMPTE240M",s[s.AVCOL_PRI_FILM=8]="AVCOL_PRI_FILM",s[s.AVCOL_PRI_BT2020=9]="AVCOL_PRI_BT2020",s[s.AVCOL_PRI_SMPTE428=10]="AVCOL_PRI_SMPTE428",s[s.AVCOL_PRI_SMPTEST428_1=10]="AVCOL_PRI_SMPTEST428_1",s[s.AVCOL_PRI_SMPTE431=11]="AVCOL_PRI_SMPTE431",s[s.AVCOL_PRI_SMPTE432=12]="AVCOL_PRI_SMPTE432",s[s.AVCOL_PRI_EBU3213=22]="AVCOL_PRI_EBU3213",s[s.AVCOL_PRI_JEDEC_P22=22]="AVCOL_PRI_JEDEC_P22",s[s.AVCOL_PRI_NB=23]="AVCOL_PRI_NB",s),c=function(t){return t[t.AVCOL_TRC_RESERVED0=0]="AVCOL_TRC_RESERVED0",t[t.AVCOL_TRC_BT709=1]="AVCOL_TRC_BT709",t[t.AVCOL_TRC_UNSPECIFIED=2]="AVCOL_TRC_UNSPECIFIED",t[t.AVCOL_TRC_RESERVED=3]="AVCOL_TRC_RESERVED",t[t.AVCOL_TRC_GAMMA22=4]="AVCOL_TRC_GAMMA22",t[t.AVCOL_TRC_GAMMA28=5]="AVCOL_TRC_GAMMA28",t[t.AVCOL_TRC_SMPTE170M=6]="AVCOL_TRC_SMPTE170M",t[t.AVCOL_TRC_SMPTE240M=7]="AVCOL_TRC_SMPTE240M",t[t.AVCOL_TRC_LINEAR=8]="AVCOL_TRC_LINEAR",t[t.AVCOL_TRC_LOG=9]="AVCOL_TRC_LOG",t[t.AVCOL_TRC_LOG_SQRT=10]="AVCOL_TRC_LOG_SQRT",t[t.AVCOL_TRC_IEC61966_2_4=11]="AVCOL_TRC_IEC61966_2_4",t[t.AVCOL_TRC_BT1361_ECG=12]="AVCOL_TRC_BT1361_ECG",t[t.AVCOL_TRC_IEC61966_2_1=13]="AVCOL_TRC_IEC61966_2_1",t[t.AVCOL_TRC_BT2020_10=14]="AVCOL_TRC_BT2020_10",t[t.AVCOL_TRC_BT2020_12=15]="AVCOL_TRC_BT2020_12",t[t.AVCOL_TRC_SMPTE2084=16]="AVCOL_TRC_SMPTE2084",t[t.AVCOL_TRC_SMPTEST2084=16]="AVCOL_TRC_SMPTEST2084",t[t.AVCOL_TRC_SMPTE428=17]="AVCOL_TRC_SMPTE428",t[t.AVCOL_TRC_SMPTEST428_1=17]="AVCOL_TRC_SMPTEST428_1",t[t.AVCOL_TRC_ARIB_STD_B67=18]="AVCOL_TRC_ARIB_STD_B67",t[t.AVCOL_TRC_NB=19]="AVCOL_TRC_NB",t}({}),l=function(t){return t[t.AVCOL_SPC_RGB=0]="AVCOL_SPC_RGB",t[t.AVCOL_SPC_BT709=1]="AVCOL_SPC_BT709",t[t.AVCOL_SPC_UNSPECIFIED=2]="AVCOL_SPC_UNSPECIFIED",t[t.AVCOL_SPC_RESERVED=3]="AVCOL_SPC_RESERVED",t[t.AVCOL_SPC_FCC=4]="AVCOL_SPC_FCC",t[t.AVCOL_SPC_BT470BG=5]="AVCOL_SPC_BT470BG",t[t.AVCOL_SPC_SMPTE170M=6]="AVCOL_SPC_SMPTE170M",t[t.AVCOL_SPC_SMPTE240M=7]="AVCOL_SPC_SMPTE240M",t[t.AVCOL_SPC_YCGCO=8]="AVCOL_SPC_YCGCO",t[t.AVCOL_SPC_YCOCG=8]="AVCOL_SPC_YCOCG",t[t.AVCOL_SPC_BT2020_NCL=9]="AVCOL_SPC_BT2020_NCL",t[t.AVCOL_SPC_BT2020_CL=10]="AVCOL_SPC_BT2020_CL",t[t.AVCOL_SPC_SMPTE2085=11]="AVCOL_SPC_SMPTE2085",t[t.AVCOL_SPC_CHROMA_DERIVED_NCL=12]="AVCOL_SPC_CHROMA_DERIVED_NCL",t[t.AVCOL_SPC_CHROMA_DERIVED_CL=13]="AVCOL_SPC_CHROMA_DERIVED_CL",t[t.AVCOL_SPC_ICTCP=14]="AVCOL_SPC_ICTCP",t[t.AVCOL_SPC_NB=15]="AVCOL_SPC_NB",t}({}),h=function(t){return t[t.AVCOL_RANGE_UNSPECIFIED=0]="AVCOL_RANGE_UNSPECIFIED",t[t.AVCOL_RANGE_MPEG=1]="AVCOL_RANGE_MPEG",t[t.AVCOL_RANGE_JPEG=2]="AVCOL_RANGE_JPEG",t}({}),d=((n={})[u.AVCOL_PRI_RESERVED0]="reserved",n[u.AVCOL_PRI_BT709]="bt709",n[u.AVCOL_PRI_UNSPECIFIED]="unknown",n[u.AVCOL_PRI_RESERVED]="reserved",n[u.AVCOL_PRI_BT470M]="bt470m",n[u.AVCOL_PRI_BT470BG]="bt470bg",n[u.AVCOL_PRI_SMPTE170M]="smpte170m",n[u.AVCOL_PRI_SMPTE240M]="smpte240m",n[u.AVCOL_PRI_FILM]="film",n[u.AVCOL_PRI_BT2020]="bt2020",n[u.AVCOL_PRI_SMPTE428]="smpte428",n[u.AVCOL_PRI_SMPTE431]="smpte431",n[u.AVCOL_PRI_SMPTE432]="smpte432",n[u.AVCOL_PRI_EBU3213]="ebu3213",n),f=((r={})[c.AVCOL_TRC_RESERVED0]="reserved",r[c.AVCOL_TRC_BT709]="bt709",r[c.AVCOL_TRC_UNSPECIFIED]="unknown",r[c.AVCOL_TRC_RESERVED]="reserved",r[c.AVCOL_TRC_GAMMA22]="bt470m",r[c.AVCOL_TRC_GAMMA28]="bt470bg",r[c.AVCOL_TRC_SMPTE170M]="smpte170m",r[c.AVCOL_TRC_SMPTE240M]="smpte240m",r[c.AVCOL_TRC_LINEAR]="linear",r[c.AVCOL_TRC_LOG]="log100",r[c.AVCOL_TRC_LOG_SQRT]="log316",r[c.AVCOL_TRC_IEC61966_2_4]="iec61966-2-4",r[c.AVCOL_TRC_BT1361_ECG]="bt1361e",r[c.AVCOL_TRC_IEC61966_2_1]="iec61966-2-1",r[c.AVCOL_TRC_BT2020_10]="bt2020-10",r[c.AVCOL_TRC_BT2020_12]="bt2020-12",r[c.AVCOL_TRC_SMPTE2084]="smpte2084",r[c.AVCOL_TRC_SMPTE428]="smpte428",r[c.AVCOL_TRC_ARIB_STD_B67]="arib-std-b67",r),p=((a={})[l.AVCOL_SPC_RGB]="gbr",a[l.AVCOL_SPC_BT709]="bt709",a[l.AVCOL_SPC_UNSPECIFIED]="unknown",a[l.AVCOL_SPC_RESERVED]="reserved",a[l.AVCOL_SPC_FCC]="fcc",a[l.AVCOL_SPC_BT470BG]="bt470bg",a[l.AVCOL_SPC_SMPTE170M]="smpte170m",a[l.AVCOL_SPC_SMPTE240M]="smpte240m",a[l.AVCOL_SPC_YCGCO]="ycgco",a[l.AVCOL_SPC_BT2020_NCL]="bt2020nc",a[l.AVCOL_SPC_BT2020_CL]="bt2020c",a[l.AVCOL_SPC_SMPTE2085]="smpte2085",a[l.AVCOL_SPC_CHROMA_DERIVED_NCL]="chroma-derived-nc",a[l.AVCOL_SPC_CHROMA_DERIVED_CL]="chroma-derived-c",a[l.AVCOL_SPC_ICTCP]="ictcp",a),_=((o={})[h.AVCOL_RANGE_UNSPECIFIED]="unknown",o[h.AVCOL_RANGE_MPEG]="tv",o[h.AVCOL_RANGE_JPEG]="pc",o);function v(t){if(t&&"number"==typeof t.colorRange&&"number"==typeof t.matrixCoefficients&&"number"==typeof t.colourPrimaries&&"number"==typeof t.transferCharacteristics){var e=p[t.matrixCoefficients],i=d[t.colourPrimaries],n=f[t.transferCharacteristics];return e===i&&e===n?"("+(t.colorRange?_[t.colorRange]+" ":"unknown ")+e+")":"("+(t.colorRange?_[t.colorRange]+" ":"unknown ")+e+"/"+i+"/"+n+")"}return""}function A(t,e){return typeof t==typeof e&&(void 0===t||void 0===e||t.colorRange===e.colorRange&&t.colourPrimaries===e.colourPrimaries&&t.matrixCoefficients===e.matrixCoefficients&&t.transferCharacteristics===e.transferCharacteristics)}},function(t,e,i){i.d(e,"a",(function(){return r}));var n,r=((n={}).INIT_265="init265",n.APPEND_DATA="appendData",n.MEDIA_INFO="mediaInfo",n.UPDATE_STATE="updateState",n.RESET="reset",n.DESTROY="destroy",n.STEP="step",n.SEEK="seek",n.END_OF_DATA="endOfData",n.DEC_DROP_FRAME="dropFrame",n.CLEAN="clean",n.INIT_RENDERER="initRenderer",n.SCREENSHOT="screenshot",n)},function(t,e,i){i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return o}));var n=i(5),r=i.n(n),a=function(){function t(){var t;this._=[],(t=this._).push.apply(t,arguments)}var e=t.prototype;return e.push=function(){var t;(t=this._).push.apply(t,arguments)},e.destroyItem=function(t){for(var e=0;e<this._.length;e++)if(this._[e]===t)return this._.splice(e,1),void t.destroy()},e.destroy=function(){for(;this._.length;){var t=this._.shift();t&&t.destroy()}},r()(t,[{key:"destroyed",get:function(){return!!this._.length}}])}(),o=function(){function t(){this.O=new a}return t.prototype.destroy=function(){this.O.destroy()},t}()},function(t,e,i){i.d(e,"j",(function(){return r})),i.d(e,"e",(function(){return a})),i.d(e,"f",(function(){return o})),i.d(e,"g",(function(){return s})),i.d(e,"h",(function(){return u})),i.d(e,"d",(function(){return c})),i.d(e,"a",(function(){return l})),i.d(e,"b",(function(){return h})),i.d(e,"c",(function(){return d})),i.d(e,"i",(function(){return f}));var n,r=((n={})[n.AUDIO=8]="AUDIO",n[n.VIDEO=9]="VIDEO",n[n.SCRIPT=18]="SCRIPT",n),a=13,o=11,s=4,u=5,c=0,l=1,h=3,d=5,f=function(){this.tagType=r.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(t,e,i){i.d(e,"a",(function(){return r}));var n,r=((n={})[n.VVC_NAL_UNIT_CODED_SLICE_TRAIL=0]="VVC_NAL_UNIT_CODED_SLICE_TRAIL",n[n.VVC_NAL_UNIT_CODED_SLICE_STSA=1]="VVC_NAL_UNIT_CODED_SLICE_STSA",n[n.VVC_NAL_UNIT_CODED_SLICE_RADL=2]="VVC_NAL_UNIT_CODED_SLICE_RADL",n[n.VVC_NAL_UNIT_CODED_SLICE_RASL=3]="VVC_NAL_UNIT_CODED_SLICE_RASL",n[n.VVC_NAL_UNIT_RESERVED_VCL_4=4]="VVC_NAL_UNIT_RESERVED_VCL_4",n[n.VVC_NAL_UNIT_RESERVED_VCL_5=5]="VVC_NAL_UNIT_RESERVED_VCL_5",n[n.VVC_NAL_UNIT_RESERVED_VCL_6=6]="VVC_NAL_UNIT_RESERVED_VCL_6",n[n.VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL=7]="VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL",n[n.VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP=8]="VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP",n[n.VVC_NAL_UNIT_CODED_SLICE_CRA=9]="VVC_NAL_UNIT_CODED_SLICE_CRA",n[n.VVC_NAL_UNIT_CODED_SLICE_GDR=10]="VVC_NAL_UNIT_CODED_SLICE_GDR",n[n.VVC_NAL_UNIT_RESERVED_IRAP_VCL_11=11]="VVC_NAL_UNIT_RESERVED_IRAP_VCL_11",n[n.VVC_NAL_UNIT_OPI=12]="VVC_NAL_UNIT_OPI",n[n.VVC_NAL_UNIT_DCI=13]="VVC_NAL_UNIT_DCI",n[n.VVC_NAL_UNIT_VPS=14]="VVC_NAL_UNIT_VPS",n[n.VVC_NAL_UNIT_SPS=15]="VVC_NAL_UNIT_SPS",n[n.VVC_NAL_UNIT_PPS=16]="VVC_NAL_UNIT_PPS",n[n.VVC_NAL_UNIT_PREFIX_APS=17]="VVC_NAL_UNIT_PREFIX_APS",n[n.VVC_NAL_UNIT_SUFFIX_APS=18]="VVC_NAL_UNIT_SUFFIX_APS",n[n.VVC_NAL_UNIT_PH=19]="VVC_NAL_UNIT_PH",n[n.VVC_NAL_UNIT_ACCESS_UNIT_DELIMITER=20]="VVC_NAL_UNIT_ACCESS_UNIT_DELIMITER",n[n.VVC_NAL_UNIT_EOS=21]="VVC_NAL_UNIT_EOS",n[n.VVC_NAL_UNIT_EOB=22]="VVC_NAL_UNIT_EOB",n[n.VVC_NAL_UNIT_PREFIX_SEI=23]="VVC_NAL_UNIT_PREFIX_SEI",n[n.VVC_NAL_UNIT_SUFFIX_SEI=24]="VVC_NAL_UNIT_SUFFIX_SEI",n[n.VVC_NAL_UNIT_FD=25]="VVC_NAL_UNIT_FD",n[n.VVC_NAL_UNIT_RESERVED_NVCL_26=26]="VVC_NAL_UNIT_RESERVED_NVCL_26",n[n.VVC_NAL_UNIT_RESERVED_NVCL_27=27]="VVC_NAL_UNIT_RESERVED_NVCL_27",n[n.VVC_NAL_UNIT_UNSPECIFIED_28=28]="VVC_NAL_UNIT_UNSPECIFIED_28",n[n.VVC_NAL_UNIT_UNSPECIFIED_29=29]="VVC_NAL_UNIT_UNSPECIFIED_29",n[n.VVC_NAL_UNIT_UNSPECIFIED_30=30]="VVC_NAL_UNIT_UNSPECIFIED_30",n[n.VVC_NAL_UNIT_UNSPECIFIED_31=31]="VVC_NAL_UNIT_UNSPECIFIED_31",n[n.VVC_NAL_UNIT_INVALID=32]="VVC_NAL_UNIT_INVALID",n)},function(t,e,i){i.d(e,"b",(function(){return F})),i.d(e,"h",(function(){return j})),i.d(e,"f",(function(){return H})),i.d(e,"g",(function(){return G})),i.d(e,"d",(function(){return z})),i.d(e,"e",(function(){return W})),i.d(e,"c",(function(){return K})),i.d(e,"a",(function(){return Y}));var n,r=i(11),a=[41,41,47,49,49,51,47,47,43,43,43,40,40],o=[12,12,12,14,14,14,15,15,15,15,15,15,15],s=[33,33,38,40,40,40,41,41,37,37,37,34,34],u=[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],c=[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],l=[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],d=[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],f=[u,u,[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],c,c,[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],l,l,h,h,h,d,d],p=[0,4,8,12,16,20,24,32,40,48,64,92,128],_=[0,4,8,12,16,20,28,36,44,56,68,80,96,112,128],v=[0,4,8,12,16,20,24,28,36,44,52,64,76,92,108,128],A=[0,4,8,12,16,20,24,28,32,40,48,60,72,88,108,128],g=[0,4,8,12,16,20,24,28,36,44,52,60,72,88,108,128],m=[p,p,p,_,_,_,v,v,A,A,A,g,g],b=((n={})[n.AOT_NULL=0]="AOT_NULL",n[n.AOT_AAC_MAIN=1]="AOT_AAC_MAIN",n[n.AOT_AAC_LC=2]="AOT_AAC_LC",n[n.AOT_AAC_SSR=3]="AOT_AAC_SSR",n[n.AOT_AAC_LTP=4]="AOT_AAC_LTP",n[n.AOT_SBR=5]="AOT_SBR",n[n.AOT_AAC_SCALABLE=6]="AOT_AAC_SCALABLE",n[n.AOT_PS=29]="AOT_PS",n[n.AOT_ER_AAC_ELD=39]="AOT_ER_AAC_ELD",n),y=i(1),E=[[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]],C=[[[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]]],T=[!1,!1,!0,!0,!1,!1,!0,!0,!0,!0,!0],I=function(){function t(){}return t.M=function(t,e){for(var i=0,n=e[i][0],r=Object(y.a)(t,n);r!==e[i][1];){var a=e[++i][0]-n;n=e[i][0],r<<=a,r|=Object(y.a)(t,a)}return i},t.S=function(t,e,i,n){for(var r=i;r<i+n;r++)e[r]&&Object(y.a)(t,1)&&(e[r]=-e[r])},t.T=function(t,e){for(var i=4;Object(y.a)(t,1);)i++;var n=Object(y.a)(t,i)|1<<i;return e<0?-n:n},t.decodeScaleFactor=function(t){var e=this.M(t,E);return E[e][2]},t.decodeSpectralData=function(t,e,i,n){var r=C[e-1],a=this.M(t,r);if(i[n]=r[a][2],i[n+1]=r[a][3],e<5&&(i[n+2]=r[a][4],i[n+3]=r[a][5]),e<11)T[e-1]&&this.S(t,i,n,e<5?4:2);else{if(!(11===e||e>15))throw new Error("Huffman: unknown spectral codebook: "+e);this.S(t,i,n,e<5?4:2),16===Math.abs(i[n])&&(i[n]=this.T(t,i[n])),16===Math.abs(i[n+1])&&(i[n+1]=this.T(t,i[n+1]))}},t}(),R=i(4),w=function(t){return t[t.ID_SCE=0]="ID_SCE",t[t.ID_CPE=1]="ID_CPE",t[t.ID_CCE=2]="ID_CCE",t[t.ID_LFE=3]="ID_LFE",t[t.ID_DSE=4]="ID_DSE",t[t.ID_PCE=5]="ID_PCE",t[t.ID_FIL=6]="ID_FIL",t[t.ID_END=7]="ID_END",t}({}),L=function(t){return t[t.ONLY_LONG_SEQUENCE=0]="ONLY_LONG_SEQUENCE",t[t.LONG_START_SEQUENCE=1]="LONG_START_SEQUENCE",t[t.EIGHT_SHORT_SEQUENCE=2]="EIGHT_SHORT_SEQUENCE",t[t.LONG_STOP_SEQUENCE=3]="LONG_STOP_SEQUENCE",t}(L||{}),D="Input buffer exhausted before END element found",S="Pulse data corrupt or invalid",O=[1,4,3],N=[2,6,5],k=function(t){return t[t.BEFORE_TNS=0]="BEFORE_TNS",t[t.AFTER_TNS=1]="AFTER_TNS",t[t.AFTER_IMDCT=2]="AFTER_IMDCT",t}(k||{}),x="aac-raw-block",P=function(){function t(){}return t.decode=function(t,e,i){for(var n={sampling_frequency_index:e,aot:i,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:[]},r=Object(y.c)(t),a=[];Object(y.d)(r)>3;){var o=Object(y.a)(r,3);if(o===w.ID_CPE)this.D(n,r);else if(o===w.ID_CCE)this.L(n,r);else if(o===w.ID_LFE||o===w.ID_SCE)this.V(n,r);else if(o===w.ID_DSE)this.U(r);else if(o===w.ID_PCE)this.P(n,r);else{if(o!==w.ID_FIL)break;var s=this.H(r);if(s){var u=this.K(r,s);u&&a.push(u)}}}if(Object(y.b)(r),a.length)return{priv:a}},t.K=function(t,e){var i=e.byteIndex;if(!(i<6)){var n=t.data;i-=2;var r=Object(R.f)(n,i);if(75===n[i-=2]&&83===n[i+1]){var a=n[i-=1];if(i-a<0)return;var o=n.subarray(i-a,i+3);if(0===o[0]&&o[1]===a-2&&r===function(t){for(var e=0,i=0,n=0;n<t.length;n++)i=(i+(e=(e+t[n])%255))%255;return i<<8|e}(o))return{id:o[0],checkSum:r,data:n.subarray(i-a+2,i)}}}},t.P=function(t,e){Object(y.g)(e,6),t.sampling_frequency_index=Object(y.a)(e,4);var i=Object(y.a)(e,4),n=Object(y.a)(e,4),r=Object(y.a)(e,4),a=Object(y.a)(e,2),o=Object(y.a)(e,3),s=Object(y.a)(e,4);Object(y.a)(e,1)&&Object(y.g)(e,4),Object(y.a)(e,1)&&Object(y.g)(e,4),Object(y.a)(e,1)&&Object(y.g)(e,3),Object(y.g)(e,5*i),Object(y.g)(e,5*n),Object(y.g)(e,5*r),Object(y.g)(e,4*a),Object(y.g)(e,4*o),Object(y.g)(e,5*s),Object(y.b)(e);var u=8*Object(y.a)(e,8);if(Object(y.d)(e)<u)throw new Error("decode_pce: "+D);Object(y.g)(e,u)},t.H=function(t){var e=Object(y.a)(t,4);if(15===e&&(e+=Object(y.a)(t,8)-1),e)return Object(y.g)(t,8*e),{byteIndex:t.byteIndex,bitIndex:t.bitIndex}},t.V=function(t,e){Object(y.g)(e,4),this.W(t,e,0)},t.D=function(e,i){Object(y.g)(i,4);var n=Object(y.a)(i,1);if(n){this.X(e,i),e.ics.predictor_present&&e.aot!==b.AOT_AAC_MAIN&&Object(y.a)(i,1)&&t.J(e,i);var r=Object(y.a)(i,2);if(3===r)throw new Error(x+' "ms_present = 3 is reserved.');r&&t.$(e,i,r)}this.W(e,i,n),this.W(e,i,n)},t.$=function(t,e,i){var n=t.ics.num_window_groups*t.ics.max_sfb;1===i&&Object(y.g)(e,n)},t.L=function(t,e){Object(y.g)(e,4);for(var i=2*Object(y.a)(e,1),n=Object(y.a)(e,3),r=0,a=0;a<=n;a++){r++;var o=Object(y.a)(e,1);Object(y.g)(e,4),o&&3===Object(y.a)(e,2)&&r++}i+=Object(y.a)(e,1)||i>>1,Object(y.g)(e,1),Object(y.g)(e,2),this.W(t,e,0);for(var s=0;s<r;s++){var u=1;if(s>0&&(u=i===k.AFTER_IMDCT?1:Object(y.a)(e,1))&&I.decodeScaleFactor(e),i!==k.AFTER_IMDCT)for(var c=0;c<t.ics.num_window_groups;c++)for(var l=0;l<t.ics.max_sfb;l++)0!==t.sfb_cb[c][l]&&0===u&&I.decodeScaleFactor(e)}},t.U=function(t){Object(y.g)(t,4);var e=Object(y.a)(t,1),i=Object(y.a)(t,8);if(255===i&&(i+=Object(y.a)(t,8)),e&&Object(y.b)(t),Object(y.d)(t)<8*i)throw new Error(x+" skip_data_stream_element: "+D);Object(y.g)(t,8*i)},t.W=function(t,e,i){var n=Object(y.a)(e,8);if(i||this.X(t,e),this.tt(t,e),this.it(t,e,n),Object(y.a)(e,1)){if(t.ics.window_sequence===L.EIGHT_SHORT_SEQUENCE)throw new Error(x+" error Pulse tool not allowed in eight short sequence.");this.et(t,e)}Object(y.a)(e,1)&&this.nt(t,e),Object(y.a)(e,1)&&this.rt(t,e),this.ht(t,e)},t.tt=function(t,e){for(var i=t.ics.window_sequence===L.EIGHT_SHORT_SEQUENCE?3:5,n=0,r=0;r<t.ics.num_window_groups;r++){t.sfb_cb[r]||(t.sfb_cb[r]=[]),t.sect_end[r]||(t.sect_end[r]=[]);for(var a=0;a<t.ics.max_sfb;){var o=a,s=Object(y.a)(e,4);if(12===s)throw new Error(x+" invalid band type");var u=0;do{if(Object(y.d)(e)<i)throw new Error(x+" decode_band_types: "+D);if((o+=u=Object(y.a)(e,i))>t.ics.max_sfb)throw new Error(x+" Number of bands("+o+") exceeds limit("+t.ics.max_sfb+").")}while(u==(1<<i)-1);for(;a<o;a++)t.sfb_cb[r][n]=s,t.sect_end[r][n++]=o}}},t.it=function(t,e,i){for(var n=0,r=1,a=0;a<t.ics.num_window_groups;a++)for(var o=0;o<t.ics.max_sfb;){var s=t.sect_end[a][n];switch(t.sfb_cb[a][n]){case 0:for(;o<s;o++,n++);break;case 15:case 14:for(;o<s;o++,n++)I.decodeScaleFactor(e);break;case 13:for(;o<s;o++,n++)r-- >0?Object(y.g)(e,9):I.decodeScaleFactor(e);break;default:for(;o<s;o++,n++)I.decodeScaleFactor(e)}}},t.et=function(t,e){var i=Object(y.a)(e,2)+1,n=Object(y.a)(e,6);if(n>=t.ics.num_swb)throw new Error(x+" "+S);var r=[t.ics.swb_offset[n]];if(r[0]+=Object(y.a)(e,5),r[0]>=t.ics.swb_offset[t.ics.num_swb])throw new Error(x+" "+S);for(var a=[Object(y.a)(e,4)],o=1;o<i;o++){if(r[o]=Object(y.a)(e,5)+r[o-1],r[o]>t.ics.swb_offset[t.ics.num_swb])throw new Error(x+" "+S);a[o]=Object(y.a)(e,4)}},t.nt=function(t,e){for(var i=t.ics.window_sequence===L.EIGHT_SHORT_SEQUENCE?O:N,n=t.ics.window_sequence===L.EIGHT_SHORT_SEQUENCE?7:t.aot===b.AOT_AAC_MAIN?20:12,r=0;r<t.ics.num_windows;r++){var a=Object(y.a)(e,i[0]);if(a)for(var o=Object(y.a)(e,1),s=0;s<a;s++){Object(y.g)(e,i[1]);var u=Object(y.a)(e,i[2]);if(u>n)throw new Error(x+" tns order: "+u+" > "+n);if(u){Object(y.g)(e,1);for(var c=o+3-Object(y.a)(e,1),l=0;l<u;l++)Object(y.g)(e,c)}}}},t.rt=function(t,e){for(var i=[[1,0,5],[2,1,2],[8,0,2],[2,1,5]],n=t.ics.window_sequence,r=Object(y.a)(e,2),a=0;a<r;a++)for(var o=0;o<i[n][0];o++)for(var s=Object(y.a)(e,3),u=0;u<s;u++)Object(y.g)(e,4+(0==o&&i[n][1]?4:i[n][2]))},t.ht=function(t,e){for(var i=t.sfb_cb,n=t.ics.swb_offset,r=0,a=0,o=0;o<t.ics.num_window_groups;o++){for(var s=t.ics.window_group_length[o],u=0;u<t.ics.max_sfb;u++,a++){var c=i[o][a],l=n[u+1]-n[u],h=r+n[u];if(0!==c&&15!==c&&14!==c&&13!==c)for(var d=0;d<s;d++,h+=128)for(var f=c>=5?2:4,p=0;p<l;p+=f)I.decodeSpectralData(e,c,[0,0,0,0],0)}r+=s<<7}},t.X=function(e,i){var n=e.sampling_frequency_index;if(Object(y.a)(i,1))throw new Error(x+", Reserved bit set.");var r=e.ics.window_sequence=Object(y.a)(i,2);if(Object(y.g)(i,1),e.ics.num_window_groups=1,e.ics.window_group_length[0]=1,r===L.EIGHT_SHORT_SEQUENCE){e.ics.max_sfb=Object(y.a)(i,4);for(var s=0;s<7;s++)Object(y.a)(i,1)?e.ics.window_group_length[e.ics.num_window_groups-1]++:(e.ics.num_window_groups++,e.ics.window_group_length[e.ics.num_window_groups-1]=1);e.ics.num_windows=8,e.ics.num_swb=o[n],e.ics.swb_offset=m[n],e.ics.predictor_present=0}else if(e.ics.max_sfb=Object(y.a)(i,6),e.ics.num_windows=1,e.ics.num_swb=a[n],e.ics.swb_offset=f[n],e.ics.predictor_present=Object(y.a)(i,1),e.ics.predictor_present)if(e.aot===b.AOT_AAC_MAIN)t.ot(e,i);else{if(e.aot===b.AOT_AAC_LC)throw new Error("Prediction is not allowed in AAC-LC.");Object(y.a)(i,1)&&t.J(e,i)}if(e.ics.max_sfb>e.ics.num_swb)throw new Error("Number of scalefactor bands in group ("+e.ics.max_sfb+") exceeds limit ("+e.ics.num_swb+").")},t.ot=function(t,e){if(Object(y.a)(e,1)){var i=Object(y.a)(e,5);if(0===i||i>30)throw new Error("Invalid Predictor Reset Group.")}Object(y.g)(e,Math.min(t.ics.max_sfb,s[t.sampling_frequency_index]))},t.J=function(t,e){Object(y.g)(e,14+Math.min(t.ics.max_sfb,40))},t}(),M=i(3),U=i(2),B=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],V="adts";function F(t,e,i){void 0===i&&(i="mp4a.40.2"),i=i||"mp4a.40.2";var n=B.indexOf(t);if(!(n<0||"mp4a.40.5"!==i&&"mp4a.40.2"!==i))return"mp4a.40.5"===i&&(n+=3),new Uint8Array([((31&("mp4a.40.2"===i?2:5))<<3)+(n>>1&7),((1&n)<<7)+((15&e)<<3)])}function j(t,e,i,n){if(n<=b.AOT_SBR)try{return P.decode(e,i,n)}catch(e){t.v(V,"aac raw error",e.message)}}function H(t,e){return!!(e+1<t.length&&function(t,e){return 255===t[e]&&240==(246&t[e+1])}(t,e))}function G(t,e){return t.asc!==Object(R.f)(e)}function z(t,e,i,n,a,o){if(void 0===o&&(o=""),G(e,n)||!e.samplerate||!e.configParsed){var s=a===r.a.ADTS?{objectType:1+((192&(u=n)[0])>>>6),sampleingIndex:(60&u[0])>>>2,chanelConfig:(1&u[0])<<2|(192&u[1])>>>6}:function(t){return{objectType:t[0]>>>3,sampleingIndex:(7&t[0])<<1|t[1]>>>7,chanelConfig:(120&t[1])>>>3}}(n);if(s.sampleingIndex<0||s.sampleingIndex>=13)return void i.emit(U.a.ERROR,Object(M.e)(M.b.MUX_ERROR,M.a.PARSING_ERROR,"invalid sampling index:"+s.sampleingIndex));if(s.chanelConfig<0||s.chanelConfig>=8)return void i.emit(U.a.ERROR,Object(M.e)(M.b.MUX_ERROR,M.a.PARSING_ERROR,"invalid chanelConfig:"+s.chanelConfig));s.chanelConfig||(t.i(V,"init track channelConfig:",s.chanelConfig),s.chanelConfig=2),W(t,e,s,o),e.asc=Object(R.f)(n),e.configParsed=!0}var u}function W(t,e,i,n){void 0===n&&(n="");var r=function(t,e,i){void 0===i&&(i="");var n,r,a=e.objectType,o=e.sampleingIndex,s=e.chanelConfig,u=navigator.userAgent.toLowerCase(),c=i||"mp4a.40."+a;return t.v(V,"manifest codec:"+i+",data:type:"+a+",sampleingIndex:"+o+"["+B[o]+"Hz],channelConfig:"+s),/firefox/i.test(u)?o>=6?(a=5,r=new Array(4),n=o-3):(a=2,r=new Array(2),n=o):-1!==u.indexOf("android")?(a=2,r=new Array(2),n=o):(a=5,r=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&o>=6?n=o-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(o>=6&&1===s||/vivaldi/i.test(u))||!i&&1===s)&&(a=2,r=new Array(2)),n=o)),r[0]=a<<3,r[0]|=(14&o)>>1,r[1]|=(1&o)<<7,r[1]|=s<<3,5===a&&(r[1]|=(14&n)>>1,r[2]=(1&n)<<7,r[2]|=8,r[3]=0),{config:r,samplerate:B[o],extensionSamplerate:B[n],channelCount:s,codec:"mp4a.40."+a,manifestCodec:c,sampleingIndex:o}}(t,i,n);r&&(e.config=r.config,e.samplerate=r.samplerate,e.extensionSamplerate=r.extensionSamplerate,e.channelCount=r.channelCount,e.codec=r.codec,e.manifestCodec=r.manifestCodec,e.sampleDuration=K(e.samplerate,e.inputTimescale),e.aacSampleingIndex=i.sampleingIndex,e.aot=i.objectType,t.v("parsed codec:"+e.codec+",rate:"+r.samplerate+",nb channel:"+r.channelCount))}function K(t,e){return 1024*e/t}function Y(t,e,i,n,r,a,o){var s,u,c,l,h,d,f,p,_,v=(s=i,u=n,c=r,l=a,h=K(e.samplerate,e.inputTimescale),d=o,p=s.length,_=function(t,e){return 1&t[e+1]?7:9}(s,u),f=function(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}(s,u),(f-=_)>0&&u+_+f<=p?{headerLength:_,frameLength:f,stamp:c+l*h,originStamp:d+l*h}:null);if(v){var A=v.frameLength,g=v.headerLength,m=v.stamp,b=v.originStamp,y=g+A,E=Math.max(0,n+y-i.length);E?new Uint8Array(y-g).set(i.subarray(n+g,i.length),0):i.subarray(n+g,n+y);var C={unit:i.subarray(n+g,n+g+A),pts:m,dts:m,originDTS:b,originPTS:b};return E||e.samples.push(C),{sample:C,length:y,missing:E}}}},function(t,e,i){t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(2);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(0).default,r=i(3);t.exports=function(t){var e=r(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(0).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){function n(t,e){console.log("%c "+t+" %c "+e+" %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")}i.r(e),i.d(e,"LogLevel",(function(){return l})),i.d(e,"DefaultLogger",(function(){return p})),i.d(e,"Logger",(function(){return f})),i.d(e,"printVersion",(function(){return n})),i.d(e,"DEFAULT_LOG_LEVEL",(function(){return h}));var r=i(1),a=i.n(r),o=function(){function t(){this.timeout=6048e5}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(t){}},a()(t,null,[{key:"available",get:function(){if(void 0===t.ut)try{localStorage.setItem("alg","test"),t.ut=!0}catch(e){t.ut=!1}return t.ut}}])}();o.ut=void 0;var s,u,c=o,l=((u={}).NONE="none",u.ERROR="e",u.WARN="w",u.INFO="i",u.DEBUG="d",u.VERBOSE="v",u),h=l.ERROR,d=((s={})[l.NONE]={value:1,str:"N"},s[l.ERROR]={value:100,str:"E"},s[l.WARN]={value:200,str:"W"},s[l.INFO]={value:300,str:"I"},s[l.DEBUG]={value:400,str:"D"},s[l.VERBOSE]={value:500,str:"V"},s),f=function(){function t(t){if(this.ct="kwai-v",this.ft=h,this.At=-1,this.vt=void 0,this.dt="main",typeof location<"u"&&"blob:"===location.protocol){var e,i=location.href.split("/"),n=null==(e=i[i.length-1])?void 0:e.match(/(\w+)-/);n&&(this.dt=t?t+"-"+n[1]:n[1])}else t&&(this.dt=t)}t.loadLogLevel=function(t,e){if(void 0===e&&(e=!0),location.href){var i=new RegExp(t+"=([a-z]{1})"),n=location.href.match(i);if(n&&n.length>1){var r=n[1];if(this.lt(r))return r}}var a=(new c).read(t,e);if(this.lt(a))return a},t.saveLogLevel=function(t,e){this.lt(e)&&(new c).write(t,e)},t.lt=function(t){return-1!==Object.values(l).indexOf(t)};var e=t.prototype;return e.setOutput=function(t){return this.vt=t,this},e.setLevel=function(t){return this.ft=t,this},e.setId=function(t){return this.At=t,this},e.setName=function(t){return this.ct=t,this},e.getLevel=function(){return this.ft},e.getOutput=function(){return this.vt},e.hasOutput=function(){return!!this.vt},e.e=function(t){if(this.bt(this.ft,l.ERROR)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.gt(l.ERROR,t,i);try{var a;null==(a=this.vt)||a.e.apply(a,[r].concat(i))}catch(t){}}},e.w=function(t){if(this.bt(this.ft,l.WARN)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.gt(l.WARN,t,i);try{var a;null==(a=this.vt)||a.w.apply(a,[r].concat(i))}catch(t){}}},e.i=function(t){if(this.bt(this.ft,l.INFO)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.gt(l.INFO,t,i);try{var a;null==(a=this.vt)||a.i.apply(a,[r].concat(i))}catch(t){}}},e.d=function(t){if(this.bt(this.ft,l.DEBUG)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.gt(l.DEBUG,t,i);try{var a;null==(a=this.vt)||a.d.apply(a,[r].concat(i))}catch(t){}}},e.v=function(t){if(this.bt(this.ft,l.VERBOSE)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this.gt(l.VERBOSE,t,i);try{var a;null==(a=this.vt)||a.v.apply(a,[r].concat(i))}catch(t){}}},e.bt=function(t,e){return d[t].value>=d[e].value},e.gt=function(t,e,i){var n,r,a=typeof e;if("object"===a)e=(null==(r=e)?void 0:r.constructor.name)||"unknown";else if("function"===a){var o;e=(null==(o=Object.getOwnPropertyDescriptor(e,"name"))?void 0:o.value)||"unknown"}var s,u,c=((null==(n=d[t])?void 0:n.str)||"")+"|"+this.ct+"["+("function"==typeof this.At?this.At():this.At)+"]["+this.dt+"]::"+e;return t===l.ERROR?(s=console).error.apply(s,[c].concat(i.slice(0))):(u=console).log.apply(u,[c].concat(i.slice(0))),c},t}(),p=new f}])},function(t,e,i){i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o}));var n,r=((n={}).LOADER_CONNECT_TIMEOUT="connectTimeout",n.LOADER_TRANS_TIMEOUT="transTimeout",n.HANDLING_DATA_ERROR="handlingDataError",n),a=function(t){return t.XHR_ERROR_NAME="XHRError",t.FETCH_ERROR_NAME="FetchError",t.FETCH_READ_ERROR_NAME="ReadError",t.SLICE_UNPACK_ERROR_NAME="SliceUnpackError",t}({}),o=function(t){return t.UNKNOWN="unknown",t.FETCH="fetch",t.XHR="xhr",t}({})},function(t,e,i){i.d(e,"e",(function(){return a})),i.d(e,"d",(function(){return o})),i.d(e,"c",(function(){return s})),i.d(e,"b",(function(){return u})),i.d(e,"a",(function(){return c}));var n=i(7);function r(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n=!1);var r=t*e*i;return n?Math.round(r):r}function a(t,e,i){return void 0===i&&(i=!1),r(t,e,.001,i)}function o(t,e,i){return void 0===i&&(i=!1),r(t,1e3,1/e,i)}function s(t,e){return void 0===e&&(e=!1),r(t,1e3,1/n.q,e)}function u(t,e){return void 0===e&&(e=1),r(t,n.q,1/e)}function c(t,e){return t>n.a&&e<60*n.q}},function(t,e,i){i.d(e,"a",(function(){return s})),i.d(e,"c",(function(){return u})),i.d(e,"d",(function(){return c})),i.d(e,"b",(function(){return l}));var n,r=i(8),a=i.n(r),o={preferLowPowerToHighPerformance:!0,preserveDrawingBuffer:!0};function s(){return typeof HTMLCanvasElement>"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function u(t){return t.getContext("webgl",o)}function c(t,e){null!=t&&t.drawingBufferColorSpace&&(t.drawingBufferColorSpace=e||"srgb")}function l(){if(!n){var t=s();h(t,n={webGL:!1,performance:!1},!0)||h(t,n,!1)}return n}function h(t,e,i){void 0===i&&(i=!1);var n=!1,r=a()({failIfMajorPerformanceCaveat:i},o);try{var s=t.getContext("webgl",r);if(s){var u=s.getExtension("WEBGL_debug_renderer_info");e.webGL=!0,e.performance=i,null!=u&&u.UNMASKED_VENDOR_WEBGL&&(e.vendor=s.getParameter(null==u?void 0:u.UNMASKED_VENDOR_WEBGL)),null!=u&&u.UNMASKED_RENDERER_WEBGL&&(e.renderer=s.getParameter(null==u?void 0:u.UNMASKED_RENDERER_WEBGL)),n=!0;var c=s.getExtension("WEBGL_lose_context");c&&c.loseContext()}}catch(t){}return n}},function(t,e,i){i.d(e,"a",(function(){return r}));var n,r=((n={})[n.contain=0]="contain",n[n.fill=1]="fill",n[n.cover=2]="cover",n)},function(t,e,i){var n=i(59),r=i(60),a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function h(t){return(t||"").toString().replace(a,"")}var d=[["#","hash"],["?","query"],function(t,e){return _(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};function p(t){var e,i=(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{}).location||{},n={},r=typeof(t=t||i);if("blob:"===t.protocol)n=new A(unescape(t.pathname),{});else if("string"===r)for(e in n=new A(t,{}),f)delete n[e];else if("object"===r){for(e in t)e in f||(n[e]=t[e]);void 0===n.slashes&&(n.slashes=s.test(t.href))}return n}function _(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function v(t,e){t=(t=h(t)).replace(o,""),e=e||{};var i,n=c.exec(t),r=n[1]?n[1].toLowerCase():"",a=!!n[2],s=!!n[3],u=0;return a?s?(i=n[2]+n[3]+n[4],u=n[2].length+n[3].length):(i=n[2]+n[4],u=n[2].length):s?(i=n[3]+n[4],u=n[3].length):i=n[4],"file:"===r?u>=2&&(i=i.slice(2)):_(r)?i=n[4]:r?a&&(i=i.slice(2)):u>=2&&_(e.protocol)&&(i=n[4]),{protocol:r,slashes:a||_(r),slashesCount:u,rest:i}}function A(t,e,i){if(t=(t=h(t)).replace(o,""),!(this instanceof A))return new A(t,e,i);var a,s,u,c,f,g,m=d.slice(),b=typeof e,y=this,E=0;for("object"!==b&&"string"!==b&&(i=e,e=null),i&&"function"!=typeof i&&(i=r.parse),a=!(s=v(t||"",e=p(e))).protocol&&!s.slashes,y.slashes=s.slashes||a&&e.slashes,y.protocol=s.protocol||e.protocol||"",t=s.rest,("file:"===s.protocol&&(2!==s.slashesCount||l.test(t))||!s.slashes&&(s.protocol||s.slashesCount<2||!_(y.protocol)))&&(m[3]=[/(.*)/,"pathname"]);E<m.length;E++)"function"!=typeof(c=m[E])?(u=c[0],g=c[1],u!=u?y[g]=t:"string"==typeof u?~(f="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof c[2]?(y[g]=t.slice(0,f),t=t.slice(f+c[2])):(y[g]=t.slice(f),t=t.slice(0,f))):(f=u.exec(t))&&(y[g]=f[1],t=t.slice(0,f.index)),y[g]=y[g]||a&&c[3]&&e[g]||"",c[4]&&(y[g]=y[g].toLowerCase())):t=c(t,y);i&&(y.query=i(y.query)),a&&e.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==e.pathname)&&(y.pathname=function(t,e){if(""===t)return e;for(var i=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=i.length,r=i[n-1],a=!1,o=0;n--;)"."===i[n]?i.splice(n,1):".."===i[n]?(i.splice(n,1),o++):o&&(0===n&&(a=!0),i.splice(n,1),o--);return a&&i.unshift(""),"."!==r&&".."!==r||i.push(""),i.join("/")}(y.pathname,e.pathname)),"/"!==y.pathname.charAt(0)&&_(y.protocol)&&(y.pathname="/"+y.pathname),n(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(~(f=y.auth.indexOf(":"))?(y.username=y.auth.slice(0,f),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(f+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin="file:"!==y.protocol&&_(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString()}A.prototype={set:function(t,e,i){var a=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(i||r.parse)(e)),a[t]=e;break;case"port":a[t]=e,n(e,a.protocol)?e&&(a.host=a.hostname+":"+e):(a.host=a.hostname,a[t]="");break;case"hostname":a[t]=e,a.port&&(e+=":"+a.port),a.host=e;break;case"host":a[t]=e,u.test(e)?(e=e.split(":"),a.port=e.pop(),a.hostname=e.join(":")):(a.hostname=e,a.port="");break;case"protocol":a.protocol=e.toLowerCase(),a.slashes=!i;break;case"pathname":case"hash":if(e){var o="pathname"===t?"/":"#";a[t]=e.charAt(0)!==o?o+e:e}else a[t]=e;break;case"username":case"password":a[t]=encodeURIComponent(e);break;case"auth":var s=e.indexOf(":");~s?(a.username=e.slice(0,s),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=e.slice(s+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(e))}for(var c=0;c<d.length;c++){var l=d[c];l[4]&&(a[l[1]]=a[l[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin="file:"!==a.protocol&&_(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a},toString:function(t){t&&"function"==typeof t||(t=r.stringify);var e,i=this,n=i.host,a=i.protocol;a&&":"!==a.charAt(a.length-1)&&(a+=":");var o=a+(i.protocol&&i.slashes||_(i.protocol)?"//":"");return i.username?(o+=i.username,i.password&&(o+=":"+i.password),o+="@"):i.password?(o+=":"+i.password,o+="@"):"file:"!==i.protocol&&_(i.protocol)&&!n&&"/"!==i.pathname&&(o+="@"),(":"===n[n.length-1]||u.test(i.hostname)&&!i.port)&&(n+=":"),o+=n+i.pathname,(e="object"==typeof i.query?t(i.query):i.query)&&(o+="?"!==e.charAt(0)?"?"+e:e),i.hash&&(o+=i.hash),o}},A.extractProtocol=v,A.location=p,A.trimLeft=h,A.qs=r,t.exports=A},function(t,e,i){var n=i(17),r=i(40),a=i(0),o={chanelConfig:2,objectType:2,sampleingIndex:7},s="audio-helper",u=function(){function t(){}return t.initAudioForFillSilent=function(t,e,i){void 0===i&&(i=""),e.codec||(n.e(t,e,o,i||(/firefox/.test(navigator.userAgent.toLowerCase())?"mp4a.40.2":"mp4a.40.5")),e.codecType=a.c.aac)},t.fillAACFrameByCount=function(e,i,a,o,s,u){void 0===s&&(s=0),void 0===u&&(u=""),t.initAudioForFillSilent(e,i,u);var c=r.a.getSilentFrame(i.manifestCodec||i.codec,i.channelCount);if(c&&o>0){for(var l=n.c(i.samplerate,i.inputTimescale),h=a*i.inputTimescale||0,d=0;d<o;d++){var f=s*i.inputTimescale+l*d;i.samples.push({unit:c,pts:h,dts:h,duration:l,originDTS:f,originPTS:f,isFill:!0}),h+=l}return i.fillDuration+=l*o,h/i.inputTimescale}return a},t.ensureAudioFrame=function(e,i,n,r,a){if(void 0===r&&(r=""),n.samples.length){var o=n.samples[0];if(0===i.samples.length){var u=o.dts/n.inputTimescale;e.i(s,"fill audio before remux frame @"+u+". audio sample num:"+i.samples.length+" video sample num:"+n.samples.length),t.fillAACFrameByCount(e,i,u,1,o.originDTS/n.inputTimescale,r)}var c=n.samples[n.samples.length-1],l=c.dts/n.inputTimescale-(i.samples.length?i.samples[i.samples.length-1].dts/i.inputTimescale:o.dts/n.inputTimescale);a&&l>1&&(e.i(s,"fill audio @end:"+c.dts/n.inputTimescale+". diff:"+l),t.fillAACFrameByCount(e,i,c.dts/n.inputTimescale,1,c.originDTS/n.inputTimescale,r))}},t.alignStartByVideo=function(t,e,i){if(i.samples.length&&e.active&&e.samples.length){var a=n.c(e.samplerate,e.inputTimescale),o=i.samples[0],u=e.samples[0];if(!o||!u)return;var c=o.pts/i.inputTimescale*e.inputTimescale;if(u.pts-c<a)return;var l=r.a.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(l){t.i(s,"align start by video. fill audio "+o.pts/i.inputTimescale+". gap:"+(o.pts/i.inputTimescale-u.pts/e.inputTimescale));var h=o.originDTS/i.inputTimescale*e.inputTimescale;e.samples.unshift({unit:l,pts:c,dts:c,duration:a,originDTS:h,originPTS:h,isFill:!0})}}},t.alignEndByRemuxer=function(e,i,n,r){if(n.outputRaw){var a=r.getLastPTS();"number"==typeof a.video&&"number"==typeof a.audio&&a.audio<a.video&&(e.i(s,"raw audio end: "+a.audio+" video end: "+a.video+" fill audio."),t.fillAACFrameByCount(e,i,a.video,1))}},t}();e.a=u},function(t,e,i){i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return a}));var n,r=((n={})[n.AV_PIX_FMT_MONO=0]="AV_PIX_FMT_MONO",n[n.AV_PIX_FMT_YUV420P=1]="AV_PIX_FMT_YUV420P",n[n.AV_PIX_FMT_YUV422P=2]="AV_PIX_FMT_YUV422P",n[n.AV_PIX_FMT_YUV444P=3]="AV_PIX_FMT_YUV444P",n);function a(t,e,i){var n=[t],a=[e];return i===r.AV_PIX_FMT_YUV420P?(n[2]=n[1]=t/2,a[2]=a[1]=e/2):i===r.AV_PIX_FMT_YUV422P?(n[2]=n[1]=t/2,a[2]=a[1]=e):i===r.AV_PIX_FMT_YUV444P&&(n[2]=n[1]=t,a[2]=a[1]=e),{w:n,h:a}}},function(t,e,i){var n=i(5),r=i.n(n),a=function(){function t(){this.yt=0,this._t=[],this.Ct=0,this.It=0}var e=t.prototype;return e.put=function(e){if(this.unreadLen+e.byteLength>=t.MAX_CACHE_SIZE)throw new Error("max cache size");this._t.push(e),this.yt+=e.byteLength},e.get=function(t){if(!(t>this.unreadLen)){var e,i=this._t[this.Ct];if(0===this.It&&t===i.byteLength)t===i.buffer.byteLength?e=i:(e=new Uint8Array(t)).set(i),this.Ct++,this.It=0;else{e=new Uint8Array(t);for(var n=0,r=0,a=0;n<t;)a=this.It,r=Math.min(i.byteLength,t-n+a),0===a&&r===i.byteLength?e.set(i,n):e.set(i.subarray(a,r),n),n+=r-a,r>=i.byteLength?(this.Ct++,i=this._t[this.Ct],this.It=0):this.It=r}return this.Ot(),e}},e.read=function(t){if(!(t>this.unreadLen)){for(var e=new Uint8Array(t),i=this.Ct,n=0,r=0,a=this.It;n<t;){var o=this._t[i];i>0&&(a=0),r=Math.min(o.byteLength,t-n+a),e.set(o.subarray(a,r),n),n+=r-a,i++}return e}},e.skip=function(t){var e=this.It+t;if(!(e>this.yt)){if(e===this.yt)this.clear();else for(;e>0;){var i=this._t[this.Ct].byteLength;e<i?(this.It=e,e=0):e===i?(this.It=0,e=0,this.Ct++):(this.It=0,e-=i,this.Ct++)}this.Ot()}},e.clear=function(){this.yt=0,this._t=[],this.Ct=0,this.It=0},e.Ot=function(){for(;this.Ct;){var t=this._t.shift();t&&(this.yt-=t.byteLength),this.Ct--}},r()(t,[{key:"unreadLen",get:function(){return this.yt-this.It}}])}();a.MAX_CACHE_SIZE=524288e3,e.a=a},function(t,e,i){i.d(e,"a",(function(){return r}));var n,r=((n={}).INIT="init",n.FLUSH="flush",n.LOAD_END="loadEnd",n.DESTROY="destroy",n.PUSH="push",n.UPDATE_CONFIG="updateConfig",n)},function(t,e,i){var n=i(43),r=function(){function t(){this._$evt=new n.EventEmitter}var e=t.prototype;return e.on=function(t,e){var i=this;return this._$evt.on(t,e),{destroy:function(){return i._$evt.off(t,e)}}},e.prependListener=function(t,e){var i=this;return this._$evt.prependListener(t,e),{destroy:function(){return i._$evt.off(t,e)}}},e.removeAllListeners=function(t){this._$evt.removeAllListeners(t)},e.off=function(t,e){this._$evt.off(t,e)},e.listeners=function(t){return this._$evt.listeners(t)},e.emit=function(t,e){return this._$evt.emit(t,e)},e.listenerCount=function(t){return this._$evt.listenerCount(t)},t}();e.a=r},function(t,e,i){var n,r,a,o,s;n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var n=s.parseURL(t);if(!n)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):e;var o=s.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=r.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var l=o.path,h=l.substring(0,l.lastIndexOf("/")+1)+a.path;c.path=s.normalizePath(h)}else c.path=o.path,a.params||(c.params=o.params,a.query||(c.query=o.query));return null===c.path&&(c.path=i.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(c)},parseURL:function(t){var e=n.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(a,"");t.length!==(t=t.replace(o,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=s},function(t,e,i){i.d(e,"a",(function(){return Q}));var n=i(8),r=i.n(n),a=i(5),o=i.n(a),s=i(11),u=i(40),c=i(35),l=i(20),h=Object(c.b)(0);h.bitDepth=8,h.chromaFormat="4:2:0",h.codec="avc1.4d4015",h.colorInfo={colorRange:1,colourPrimaries:1,transferCharacteristics:4,matrixCoefficients:2},h.fps=15,h.codedHeight=270,h.id=1,h.level="2.1",h.sar={width:1,height:1},h.profile="Main",h.codedWidth=480,h.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 d=[{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])}],f=function(){function t(){}return t.getFillTrackBySamples=function(t,e){if(e.length){t.bitDepth=h.bitDepth,t.chromaFormat=h.chromaFormat,t.codec=h.codec,t.colorInfo=h.colorInfo,t.fps=t.fps||h.fps,t.id=h.id,t.level=h.level,t.sar=h.sar,t.profile=h.profile,t.codedWidth=h.codedWidth,t.codedHeight=h.codedHeight,t.duration=1/0,t.decConf=h.decConf,t.outputRaw=!1;for(var i=t.sampleDuration=t.inputTimescale/t.fps||Object(l.e)(1,t.inputTimescale),n=e[0].dts,r=e[0].originDTS,a=e[0].originPTS,o=0;n<=e[e.length-1].dts;)t.samples.push({cts:0,dts:n,key:!0,pts:n,originDTS:r,originPTS:a,units:d,size:0,isFill:!0}),n+=i,r+=i,a+=i,o++;return t.fillDuration+=i*o,t}},t}(),p=i(0),_=i(3),v=i(9),A=i(32),g=i(24),m=i(6),b=i(2),y=i(4),E=Math.pow(2,32)-1,C={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])},T=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]),I=new Uint8Array([0,0,0,16,115,116,116,115,0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,16,115,116,115,99,0,0,0,0,0,0,0,0]),w=new Uint8Array([0,0,0,16,115,116,99,111,0,0,0,0,0,0,0,0]),L=new Uint8Array([0,0,0,20,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,0]),D=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]),S=new Uint8Array([0,0,0,20,118,109,104,100,0,0,0,1,0,0,0,0,0,0,0,0]),O=new Uint8Array([0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0]),N=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]),k=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]),x=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]),P=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]),M=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]),U=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]),B=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]),V=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]),F=new Uint8Array([0,0,0,16,112,97,115,112,0,0,0,1,0,0,0,1]),j=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]),H=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]),G=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]),z=function(){function t(){}return t.moov=function(e,i){for(var n=T,r=e.length,a=t.wt.avc1;r--;){var o=e[r];o.type===p.o.VIDEO&&(0===o.codec.indexOf("hev1")?a=t.wt.hev1:0===o.codec.indexOf("av01")&&(a=t.wt.av01))}var s=n.byteLength+t.Et(e,i),u={data:new Uint8Array(s),offset:0};return u.data.set(n,0),u.data.set(a,16),u.offset+=n.byteLength,t.jt(u,e,i),u.data},t.videoMediaSegment=function(e,i,n,r){var a=0===n.codec.indexOf("av01")?0:4,o=8+n.mp4Samples.reduce((function(t,e){return t+e.units.reduce((function(t,e){return t+e.data.byteLength+a}),0)}),0),s=t.kt(n,o,r);return t.Mt(s,e,i,n,o,r),n.samples.forEach((function(t){t.units.forEach((function(t){var e=t.data.byteLength;a?(Object(y.l)(e,s.data,s.offset),s.data.set(t.data,s.offset+a),s.offset+=a+e):(s.data.set(t.data,s.offset),s.offset+=e)}))})),s.data},t.audioMediaSegment=function(e,i,n,r){var a=8+n.mp4Samples.reduce((function(t,e){return t+e.unit.byteLength}),0),o=t.kt(n,a,r);return t.Mt(o,e,i,n,a,r),n.mp4Samples.forEach((function(t){o.data.set(t.unit,o.offset),o.offset+=t.unit.byteLength})),o.data},t.audioRawMpeg=function(e){var i=8+e.mp4Samples.reduce((function(t,e){return t+e.unit.byteLength}),0),n={data:new Uint8Array(i),offset:0};return t.St(n,t.wt.mdat,i),e.mp4Samples.forEach((function(t){n.data.set(t.unit,n.offset),n.offset+=t.unit.byteLength})),n.data},t.Et=function(e,i){var n=e.reduce((function(e,i){return e+t.Bt(i)}),0),r=i?i.reduce((function(t,e){return t+e.byteLength+8}),0):0;return 8+N.byteLength+n+t.Tt(e)+r},t.jt=function(e,i,n){var r=this,a=t.Et(i,n);t.St(e,t.wt.moov,a);var o=i[0];if(!o)throw new Error("no tracks input.");t.Dt(e,o.timescale,o.duration),i.forEach((function(i){t.Rt(e,i)})),t.Lt(e,i),n&&n.forEach((function(t){r.Nt(e,t)}))},t.Nt=function(e,i){this.St(e,t.wt.pssh,i.byteLength+8),e.data.set(i,e.offset),e.offset+=i.byteLength},t.Qt=function(t){return 104+17*t.mp4Samples.length+this.xt(t)},t.Vt=function(e,i,n){if(this.xt(i)){var r=this.Ut(i);this.St(e,t.wt.saiz,r),e.offset+=5;var a=i.samples.length;Object(y.l)(a,e.data,e.offset),e.offset+=4,i.samples.forEach((function(t){t.auxiliaryInfo&&(e.data[e.offset]=t.auxiliaryInfo.enc.byteLength),e.offset++}));var o=this.Ft();this.St(e,t.wt.saio,o),e.offset+=4,e.data[e.offset+3]=1,e.offset+=4;var s=e.offset-n+4+16;Object(y.l)(s,e.data,e.offset),e.offset+=4;var u=this.Pt(i);this.St(e,t.wt.senc,u),i.useSubSampleEnc&&(e.data[e.offset+3]=2),e.offset+=4,Object(y.l)(a,e.data,e.offset),e.offset+=4,i.samples.forEach((function(t){t.auxiliaryInfo&&(e.data.set(t.auxiliaryInfo.enc,e.offset),e.offset+=t.auxiliaryInfo.enc.byteLength)}))}},t.xt=function(t){var e=this.Pt(t);return e?e+this.Ut(t)+this.Ft():0},t.Ut=function(t){return 17+t.samples.length},t.Pt=function(t){var e=t.samples.reduce((function(t,e){return t+(e.auxiliaryInfo?e.auxiliaryInfo.enc.byteLength:0)}),0);return e?16+e:0},t.Ft=function(){return 20},t.Mt=function(e,i,n,r,a,o){o&&(e.data.set(o),e.offset=o.byteLength),t.Ht(e,i,n,r),t.St(e,t.wt.mdat,a)},t.kt=function(e,i,n){var r=t.Qt(e);return{data:new Uint8Array(r+i+(n?n.byteLength:0)),offset:0}},t.Dt=function(t,e,i){var n=Math.floor(i/(E+1)),r=Math.floor(i%(E+1)),a=N;Object(y.l)(e,a,28),Object(y.l)(n,a,32),Object(y.l)(r,a,36),t.data.set(a,t.offset),t.offset+=N.byteLength},t.Yt=function(t,e){var i=e.id,n=Math.floor(e.duration/(E+1)),r=Math.floor(e.duration%(E+1)),a=0,o=0;Object.prototype.hasOwnProperty.call(e,"codedWidth")&&(a=e.codedWidth),Object.prototype.hasOwnProperty.call(e,"codedHeight")&&(o=e.codedHeight);var s=k;Object(y.l)(i,s,28),Object(y.l)(n,s,36),Object(y.l)(r,s,40),90===e.rotation?H.forEach((function(t,e){return s[60+e]=t})):180===e.rotation?j.forEach((function(t,e){return s[60+e]=t})):270===e.rotation&&G.forEach((function(t,e){return s[60+e]=t})),Object(y.k)(a,s,96),Object(y.k)(o,s,100),t.data.set(s,t.offset),t.offset+=k.byteLength},t.Bt=function(e){return 8+k.byteLength+t.Gt(e)},t.Rt=function(e,i){var n=t.Bt(i);this.St(e,t.wt.trak,n),this.Yt(e,i),this.Kt(e,i)},t.Gt=function(e){return 8+P.byteLength+C[e.type].byteLength+t.Zt(e)},t.Kt=function(e,i){var n=t.Gt(i);this.St(e,t.wt.mdia,n),this.Wt(e,i.timescale,i.duration),e.data.set(C[i.type],e.offset),e.offset+=C[i.type].byteLength,this.Xt(e,i)},t.Wt=function(t,e,i){var n=Math.floor(i/(E+1)),r=Math.floor(i%(E+1)),a=P;Object(y.l)(e,a,28),Object(y.l)(n,a,32),Object(y.l)(r,a,36),t.data.set(a,t.offset),t.offset+=a.byteLength},t.Zt=function(e){return e.type===p.o.AUDIO?8+O.byteLength+D.byteLength+t.zt(e):8+S.byteLength+D.byteLength+t.zt(e)},t.Xt=function(e,i){if(this.St(e,t.wt.minf,t.Zt(i)),i.type===p.o.AUDIO)return e.data.set(O,e.offset),e.offset+=O.byteLength,e.data.set(D,e.offset),e.offset+=D.byteLength,void this.Jt(e,i);e.data.set(S,e.offset),e.offset+=S.byteLength,e.data.set(D,e.offset),e.offset+=D.byteLength,this.Jt(e,i)},t.zt=function(t){return 8+this.qt(t)+I.byteLength+R.byteLength+L.byteLength+w.byteLength},t.Jt=function(e,i){var n=this.zt(i);this.St(e,t.wt.stbl,n),this.$t(e,i),e.data.set(I,e.offset),e.offset+=I.byteLength,e.data.set(R,e.offset),e.offset+=R.byteLength,e.data.set(L,e.offset),e.offset+=L.byteLength,e.data.set(w,e.offset),e.offset+=w.byteLength},t.qt=function(e){return e.stsd?e.stsd.byteLength+8:e.type===p.o.AUDIO?t.ti(e):t.ii(e)},t.$t=function(e,i){if(i.stsd)return this.St(e,t.wt.stsd,i.stsd.byteLength+8),e.data.set(i.stsd,e.offset),void(e.offset+=i.stsd.byteLength);i.type!==p.o.AUDIO?t.ei(e,i):this.ni(e,i)},t.si=function(t){return t.decConf?8+t.decConf.byteLength:0},t.ii=function(e){var i=1!==e.sar.width||1!==e.sar.height?F.length:0;return V.byteLength+t.si(e)+i},t.ei=function(e,i){var n=this.si(i),r=this.ii(i),a=V,o=r-16,s=t.wt.avc1,u=t.wt.avcC;0===i.codec.indexOf("hev1")?(s=t.wt.hev1,u=t.wt.hvcC):0===i.codec.indexOf("av01")&&(s=t.wt.av01,u=t.wt.av1C);var c=i.codedWidth,l=i.codedHeight,h=1!==i.sar.width||1!==i.sar.height;Object(y.l)(r,a,0),this.ri(a,s,o,16),Object(y.k)(c,a,48),Object(y.k)(l,a,50),e.data.set(a,e.offset),e.offset+=a.byteLength,this.St(e,u,n),i.decConf&&(e.data.set(i.decConf,e.offset),e.offset+=i.decConf.byteLength),h&&(e.data.set(F,e.offset),Object(y.l)(i.sar.width||0,e.data,e.offset+8),Object(y.l)(i.sar.height||0,e.data,e.offset+12),e.offset+=F.length)},t.hi=function(t){return 33+t.config.length+4},t.oi=function(e){return 52+t.hi(e)},t.ai=function(e,i){var n=i.config.length,r=t.hi(i),a=t.oi(i),o=a-16,s=M;Object(y.l)(a,s,0),Object(y.l)(o,s,16),s[41]=i.channelCount,Object(y.k)(i.samplerate,s,48),Object(y.l)(r,s,52),s[65]=23+n,s[70]=15+n,e.data.set(s,e.offset),e.offset+=s.byteLength;var u=[n].concat(i.config).concat([6,1,2]);e.data.set(u,e.offset),e.offset+=u.length},t.ui=function(t,e){var i=B;i[41]=i[61]=e.channelCount,Object(y.k)(e.samplerate,i,48),Object(y.k)(e.samplerate,i,66),t.data.set(i,t.offset),t.offset+=i.byteLength},t.ci=function(t,e){var i=U;i[41]=e.channelCount,Object(y.k)(e.samplerate,i,48),t.data.set(i,t.offset),t.offset+=i.byteLength},t.ti=function(e){return"mp3"===e.codec?U.length:"opus"===e.codec?B.length:t.oi(e)},t.ni=function(e,i){"mp3"===i.codec?t.ci(e,i):"opus"===i.codec?t.ui(e,i):t.ai(e,i)},t.Tt=function(t){return 8+t.length*x.byteLength},t.Lt=function(e,i){var n=t.Tt(i);this.St(e,t.wt.mvex,n),i.forEach((function(i){t.fi(e,i)}))},t.fi=function(t,e){var i=e.id,n=x;Object(y.l)(i,n,12),t.data.set(n,t.offset),t.offset+=n.byteLength},t.Ht=function(e,i,n,r){var a=r.mp4Samples.length,o=e.offset,s=t.Qt(r),u=s-24,c=12+a,l=20+16*a,h=s+8,d=r.id,f=r.mp4Samples||[],p=Math.floor(n/(E+1)),_=Math.floor(n%(E+1));t.St(e,t.wt.moof,s),t.St(e,t.wt.mfhd,16),Object(y.l)(i,e.data,e.offset+4),e.offset+=8,t.St(e,t.wt.traf,u),t.St(e,t.wt.tfhd,20),e.data[e.offset+1]=2,e.data[e.offset+3]=2,Object(y.l)(d,e.data,e.offset+4),e.data[e.offset+11]=r.sampleDescIndex||1,e.offset+=12,t.St(e,t.wt.tfdt,20),e.data[e.offset]=1,Object(y.l)(p,e.data,e.offset+4),Object(y.l)(_,e.data,e.offset+8),e.offset+=12,t.St(e,t.wt.sdtp,c),e.offset+=4,f.forEach((function(t,i){var n=t.flags;e.data[e.offset+i]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy})),e.offset+=a,t.St(e,t.wt.trun,l),e.data[e.offset]=1,e.data[e.offset+2]=15,e.data[e.offset+3]=1,Object(y.l)(a,e.data,e.offset+4),Object(y.l)(h,e.data,e.offset+8),e.offset+=12,f.forEach((function(t,i){if(t){var n=e.offset+16*i;Object(y.l)(t.duration,e.data,n),Object(y.l)(t.len,e.data,n+4),e.data[n+8]=t.flags.isLeading<<2|t.flags.dependsOn,e.data[n+9]=t.flags.isDependedOn<<6|t.flags.hasRedundancy<<4|t.flags.isNonSync,e.data[n+10]=61440&t.flags.degradPrio,e.data[n+11]=15&t.flags.degradPrio,Object(y.j)(t.cts,e.data,n+12)}})),e.offset+=16*a,this.xt(r)&&this.Vt(e,r,o)},t.St=function(e,i,n){t.ri(e.data,i,n,e.offset),e.offset+=8},t.ri=function(t,e,i,n){Object(y.l)(i,t,n),t.set(e,n+4)},t}();z.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 W=z,K="remuxer",Y=function(){function t(t,e,i,n,r){var a=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(t){a.Ai.emit(b.a.ERROR,t)},this.Ai=e,this.di=i,this.li=n,this.Ci=t;var o=navigator.userAgent;this.bi=!(!(r&&r.indexOf("Apple")>-1&&o)||o.match("CriOS")),this.gi=!1,this.pi=!!(m.a.chrome&&m.a.version.major<70),this.mi=!(m.a.chrome&&m.a.version.major>=73),this.Bi={},this.Ti={video:0,audio:0},this.Ci.i(K,"constructor safari: "+this.bi+", forceFirstIDR: "+this.pi+" forceDTSPositive: "+this.mi)}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.Ci.i(K,"reset timestamp",t),this.wi=this.Ei=t},e.resetInitSegment=function(t){this.Ci.i(K,"reset init segment."),this.gi=!1,this.ji={},this._i=t,this.ki=void 0,this.yi="",this.Si=!1,this.Bi={}},e.getLastDTS=function(){return{video:this.Oi,audio:this.Ii}},e.getLastPTS=function(){return this.Ti},e.flush=function(t){var e;if(void 0===t&&(t=!0),this.Ci.i(K,"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,e=this.Ri(this.Mi,this.Oi||0,!0,!1,!0)),e&&t){var i=[e];this.Ai.emit(b.a.PARSING_DATA,{segments:i,extra:this._i})}return e},e.remux=function(t,e,i,n,r,a,o){var u,c,l,h,d=this;if(void 0===a&&(a=!1),o&&(this.ki=o),this.Mi=e,n||(this.Oi=this.Ii=void 0,this.Ti.video=this.Ti.audio=void 0),e.active&&!e.outputRaw&&(this.Bi.sample&&(n&&e.samples.unshift(this.Bi.sample),this.Bi.sample=void 0),!this.di.gopRemux&&e.samples.length>1&&!a&&(this.Bi.prevSampleDuration=e.samples[e.samples.length-1].dts-e.samples[e.samples.length-2].dts,this.Bi.sample=e.samples.pop())),t.active&&g.a.ensureAudioFrame(this.Ci,t,e,null==(h=this._i)?void 0:h.audioCodec,a),e.active)if(!this.gi&&e.outputRaw&&(c=this.Li(e)),n||g.a.alignStartByVideo(this.Ci,t,e),e.outputRaw&&e.samples.length){if(u=e.samples,e.samples=[],e.mp4Samples=[],this.di.ensureVideo&&t.samples.length&&t.samplerate){var f=this.Ni(e,t);f&&(e=f,l=!0,this.Ci.i(K,"fill black video. raw output."))}}else if((this.di.isLive||!n)&&a&&!e.outputRaw&&0===e.samples.length&&t.samples.length&&t.samplerate&&(!this.gi||(t.samples[t.samples.length-1].pts-t.samples[0].pts)/t.inputTimescale>=1)){var p=this.Ni(e,t);p&&(e=p,l=!0,this.Ci.i(K,"fill black video, no video samples."))}if(this.yi=e.codec,this.Si&&!l&&e.samples.length&&(this.gi=!1),this.gi||(this.Si=!1,this.Qi(t,e,u||e.samples,i,c,l)),!n&&e.samples.length&&this.bi&&(e.samples[0].pts=e.samples[0].dts),this.gi){var _=i,v=i;if(t.samples.length&&e.samples.length)if(!n&&r){if(t.samples[0].pts/t.inputTimescale-e.samples[0].pts/e.inputTimescale<0){var A=e.samples[0];A.pts=t.samples[0].pts/t.inputTimescale*e.inputTimescale,A.dts=A.pts-A.cts}}else{var m=t.samples[0].pts/t.inputTimescale-e.samples[0].pts/e.inputTimescale;_+=Math.max(0,m),v+=Math.max(0,-m)}var y=this.xi(t,_,n,r),E=this.Ri(e,v,n,r,a);l&&(this.Si=!0);var C=[];if(y&&C.push(y),E&&C.push(E),C.length&&this.Ai.emit(b.a.PARSING_DATA,{segments:C,extra:this._i}),u){var T=[],I=[],R=[];u.forEach((function(t){t.dts=t.dts/e.inputTimescale-(d.wi||0),t.cts=t.cts/e.inputTimescale,t.pts=t.dts+t.cts,t.originDTS=t.originDTS/e.inputTimescale,t.originPTS=t.originPTS/e.inputTimescale,(t.key&&!t.isFill||t.keyTime)&&T.push({key:t.key,pts:t.pts,cts:t.cts,originPTS:t.originPTS}),t.sei&&I.push(t.sei),t.privNal&&R.push(t.privNal),(!d.Ti.video||t.pts>d.Ti.video)&&(d.Ti.video=t.pts)})),this.Ai.emit(b.a.RAW_DATA,{type:s.d.videoFrame,samples:u,extra:this._i,keyTime:T,sei:I,privNal:R,mediaInfo:{colorInfo:e.colorInfo,rotation:e.rotation,fps:e.fps,sar:e.sar}})}}},e.computeInitPTSDTS=function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=1);var a=1/0,o=1/0;return e&&(a=o=e.pts/n-t),i&&(a=Math.min("number"==typeof a?a:1/0,i.pts/r-t),o=Math.min("number"==typeof o?o:1/0,i.dts/r-t)),{initPTS:a,initDTS:o}},e.Li=function(t){return t.codec?this.Vi(t):t.codecType?{container:"video/mp4",codec:t.codec,codecType:t.codecType||p.c.unknown}:void 0},e.Vi=function(t){if(t.codec){var e=Object(A.a)(t.codedWidth,t.codedHeight,t.sar);return{container:"video/mp4",codec:t.codec,codecType:t.codecType||p.c.unknown,metadata:{width:e.width,height:e.height,codedWidth:t.codedWidth,codedHeight:t.codedHeight,sar:t.sar,rotation:t.rotation,fps:t.fps,profile:t.profile,level:t.level,chromaFormat:t.chromaFormat,bitDepth:t.bitDepth,colorInfo:t.colorInfo,videoBitrate:t.bitrate,videoMaxBitrate:t.maxBitrate,enhancedFlv:t.enhancedFlv}}}},e.Qi=function(t,e,i,n,r,a){var o,s,u=this.Ai,c=t.samples,l=this.li,h={},d={tracks:h},f=void 0===this.wi,v="audio/mp4";if(f&&(o=s=1/0),t.config&&c.length&&(t.duration=t.duration/t.timescale*t.samplerate,t.timescale=t.samplerate,this.Ci.v(K,"audio sampling rate : "+t.samplerate),t.codecType===p.c.mp3?l.mpeg?(v="audio/mpeg",t.codec=""):l.mp3&&(t.codec="mp3"):t.codecType===p.c.opus&&(t.codec="opus"),this.ji.audio=t.codecType===p.c.mp3&&l.mpeg?new Uint8Array:W.moov([t],this.ki),h.audio={container:v,codec:t.codec,codecType:t.codecType||p.c.unknown,metadata:{channel:t.channelCount,audioSampleRate:t.extensionSamplerate||t.samplerate,audioBitrate:t.bitrate,audioMaxBitrate:t.maxBitrate}},f&&(o=s=c[0].pts/t.inputTimescale-n)),e.codec&&i.length){var A=e.inputTimescale;e.timescale=A,e.duration<=0&&(this.Ci.i(K,"videoTrack.duration === 0"),e.duration=1),e.outputRaw||(this.ji.video=W.moov([e],this.ki),h.video=this.Vi(e)),h.video&&h.video.metadata&&(h.video.metadata.isFillVideo=a),f&&(o=Math.min("number"==typeof o?o:1/0,i[0].pts/A-n),s=Math.min("number"==typeof s?s:1/0,i[0].dts/A-n))}else e.codec&&!e.active&&(h.video=this.Vi(e),h.video&&h.video.metadata&&(h.video.active=!1,h.video.metadata.isFillVideo=a));r&&(h.rawVideo=r),Object.keys(h).length?(u.emit(b.a.PARSING_INIT_SEGMENT,d),this.gi=!0,f&&(this.wi=o,this.Ei=s,this.Ci.i(K,"init pts:"+o+" dts:"+s+" offset:"+n))):this.Di(Object(_.e)(_.b.MUX_ERROR,_.a.PARSING_ERROR,"no audio/video samples found",{fatal:!1}))},e.Ri=function(t,e,i,n,r){var a=this;if(void 0===n&&(n=!1),void 0===r&&(r=!1),t.samples.length&&void 0!==this.wi&&void 0!==this.Ei){var o,s,u=t.inputTimescale,c=t.samples,h=[],d=this.Ei*u,f=this.wi*u,_=Object(l.e)(1,u),A=c.length,g=[],m=[],b=[],y=0,E=0,C=0,T=this.Oi?this.Oi*u:0,I=this.bi;if(0!==A&&0!==u&&(I&&(i=i||!!(A&&T&&(n&&Math.abs(e*u-T/u)<.1||Math.abs(c[0].pts-T-d)<u/5))),i||(T=e*u),void 0!==T)){c.forEach((function(t){t.pts=Q(t.pts-f,T),t.dts=Q(t.dts-f,T)})),c.sort((function(t,e){var i=t.dts-e.dts,n=t.pts-e.pts;return i||n})),this.mi&&c.forEach((function(t){t.dts<0&&(t.dts=0,t.cts=t.pts-t.dts)})),C=c[0].dts,E=Math.max(c[0].pts,0);var R,w=C-T;if(i&&w){if(E-=w,C=T,c[0].dts=C,c[0].pts=E,w<0)for(var L=1;c[L]&&c[L].dts<=c[L-1].dts;){var D=c[L-1].dts+_-c[L].dts;c[L].dts+=D,c[L].pts+=D,L++}this.Ci.v(K,"Video/PTS/DTS adjusted: "+Object(l.d)(E,u,!0)+"/"+Object(l.d)(C,u,!0))}s=c[A-1].dts,o=Math.max(c[A-1].pts,0,s),I&&(y=Math.round((s-C)/(A-1)));for(var S=0;S<A;S++){var O=c[S];I?O.dts=C+S*y:(O.dts=Math.max(O.dts,C),"number"==typeof R&&O.dts<R&&(O.dts=R+1),O.pts=O.cts+O.dts,R=O.dts)}!i&&c[0].key&&c[0].pts<c[0].dts&&(c[0].pts=c[0].dts);for(var N=function(){var e,n=c[k];if(!I)if(k<A-1)y=Math.round(c[k+1].dts-n.dts);else if(y=a.Bi.prevSampleDuration?a.Bi.prevSampleDuration:t.sampleDuration||y,r&&a.Ii){var o=a.Ii*u-n.pts;o>.5*t.inputTimescale&&(y=o)}var s=n.pts-n.dts;if(y<0||isNaN(y)||!isFinite(y)){var l=i&&A<2?w:0;y=Math.round(Math.max(t.sampleDuration-l,_,1));var d=c[k+1];d&&(d.dts=n.dts+y,d.pts=d.dts+d.cts)}else y=Math.round(y);var f=0===t.codec.indexOf("av01")?0:4;if(e=n.units.reduce((function(t,e){return e.data.byteLength+f+t}),0),n.key&&!n.isFill||n.keyTime){var E={key:n.key,pts:n.pts/u,cts:n.cts/u,originPTS:n.originPTS/u};t.codecType===p.c.hevc&&n.units.reduce((function(t,e){return t||e.type===v.a.HEVC_NAL_CRA_NUT}),!1)&&(n.key=!1,E.cra=!0),g.push(E)}n.sei&&m.push(n.sei),n.privNal&&b.push(n.privNal),(y/u>2||y/u<=.001)&&a.Ci.i(K,"sample duration exception.",r,y,s),h.push({len:e,units:n.units,duration:y||1,cts:s,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:n.key?2:1,isNonSync:n.key?0:1},auxiliaryInfo:n.auxiliaryInfo})},k=0;k<A;k++)N();if(this.Oi=(s+y)/u,h.length&&this.pi){var x=h[0].flags;x.dependsOn=2,x.isNonSync=0}t.mp4Samples=h;var P=W.videoMediaSegment(t.sequenceNumber++,Math.round(C),t,this.Ui(p.o.VIDEO));this.Mi&&(this.Mi.sequenceNumber=t.sequenceNumber);var M={payload:P,adjustedStart:w/u,startPTS:E/u,endPTS:(o+y)/u,startDTS:C/u,endDTS:this.Oi,type:p.o.VIDEO,originFirstDTS:c[0].originDTS/u,originFirstPTS:c[0].originPTS/u,firstParseTime:c[0].parseTime,fillDuration:t.fillDuration/u,droppedDuration:t.droppedDuration/u,droppedFrames:t.droppedFrames,keyTime:g,sei:m,privNal:b,sampleCount:h.length};return t.fillDuration=0,t.droppedDuration=0,t.droppedFrames=0,t.samples=[],t.mp4Samples=[],this.Ti.video=o/u,M}}},e.xi=function(t,e,i,n){if(void 0===n&&(n=!1),t.samples.length&&void 0!==this.wi){var r,a,o,s,c=t.inputTimescale,h=t.timescale,d=c/h,f=t.codecType===p.c.aac?1024:1152,_=f*d,v=this.wi*c,A=[],g=Object(l.e)(1,c),m=t.codecType===p.c.mp3&&this.li.mpeg,b=0,y=t.samples,E=this.Ii?this.Ii*c:this.Ii,C=!1;if(i=i||!!(y.length&&E&&(n&&Math.abs(e-E/c)<.1||Math.abs(y[0].pts-E-v)<20*_)),y.forEach((function(t){t.pts=t.dts=Q(t.pts-v,e*c)})),0!==(y=y.filter((function(t){return t.pts>=0}))).length&&(i&&void 0!==E||(E=n?e*c:y[0].pts,C=!0),void 0!==E)){if(t.codecType===p.c.aac)for(var T=this.di.maxAudioFramesDrift*_,I=0,R=E;I<y.length;){var w=y[I],L=w.pts-R;if(L<=-T)this.Ci.w(K,"Dropping 1 audio frame @ "+(E/c).toFixed(3)+"s"),y.splice(I,1),t.droppedDuration+=_;else if(L>=T&&L<100*c&&R){var D=Math.round(L/_);this.Ci.i(K,"Injecting "+D+" audio frame @ "+(R/c).toFixed(3)+"s due to "+Math.round(Object(l.d)(L,c))+" ms gap. "+I+" "+t.manifestCodec+" "+t.codec);for(var S=0;S<D;S++){var O=Math.max(R,0);(a=u.a.getSilentFrame(t.manifestCodec||t.codec,t.channelCount))||(this.Ci.v(K,"Unable to get silent frame for given audio codec; duplicating last frame instead."),a=w.unit.subarray());var N=w.originDTS-(D-S)*_;y.splice(I,0,{unit:a,pts:O,dts:O,originDTS:N,originPTS:N,isFill:!0,duration:_}),R+=_,I++}t.fillDuration+=_*D,w.pts=w.dts=R,R+=w.duration||_}else{var k=y[I+1];if(k){var x=Math.round(k.pts-w.pts);x<1?(k.pts=k.dts=w.pts+1,w.duration=g):w.duration=x>T?_:x}w.pts=w.dts=R,R=w.pts+(w.duration||_),I++}}for(var P=y.length,M=0,U=y.length;M<U;M++){var B,V=y[M],F=V.unit,j=V.duration?Math.round(V.duration/d):f,H=V.pts;if(void 0!==o&&r)r.duration=Math.round((H-o)/d);else{var G=Math.round(H-E),z=0;if(i&&t.codecType===p.c.aac&&G){if(G>0&&G<100*c)z=Math.round((H-E)/_),this.Ci.v(K,G+" ms hole between AAC samples detected,filling it");else if(G<-.012*c){this.Ci.v(K,"drop overlapping AAC sample, expected/parsed/delta:"+(E/c).toFixed(3)+"s/"+(H/c).toFixed(3)+"s/"+-G/c*1e3+"ms");continue}H=E}b=H;for(var Y=0;Y<z;Y++){var X=f;(a=u.a.getSilentFrame(t.manifestCodec||t.codec,t.channelCount))||(this.Ci.v(K,"Unable to get silent frame for given audio codec; duplicating this frame instead."),a=F.subarray(),V.duration&&(X=j)),r={len:a.byteLength,cts:0,duration:X,unit:a,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1,isNonSync:0},auxiliaryInfo:V.auxiliaryInfo},A.push(r)}}V.aacPriv&&(s||(s=[]),(B=s).push.apply(B,V.aacPriv)),r={len:F.byteLength,cts:0,duration:j,unit:F,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1,isNonSync:0},auxiliaryInfo:V.auxiliaryInfo},A.push(r),o=H}if(P=A.length,r){if(P&&"number"==typeof o){var Z;r&&0===r.duration&&(r.duration=f),E=o+d*r.duration,t.mp4Samples=A,Z=m?W.audioRawMpeg(t):W.audioMediaSegment(t.sequenceNumber++,b/d,t,this.Ui(p.o.AUDIO)),t.samples=[],t.mp4Samples=[];var q=b/c,J=this.Ii=E/c,$={payload:Z,startPTS:q,endPTS:J,startDTS:q,endDTS:J,type:p.o.AUDIO,originFirstDTS:y[0].originDTS/c,originFirstPTS:y[0].originPTS/c,firstParseTime:y[0].parseTime,fillDuration:t.fillDuration/c,droppedDuration:t.droppedDuration/c,aacPriv:s,sampleCount:A.length};return m&&($.updateTimestampOffset=!0),t.fillDuration=0,t.droppedDuration=0,this.Ti.audio=o/c,$}C&&delete this.Ii,t.samples=[],t.mp4Samples=[]}}}},e.Ui=function(t){var e;return this.ji&&this.ji[t]&&(e=this.ji[t],delete this.ji[t]),e},e.Ni=function(t,e){var i=r()({},t);i.samples=[],i.codecType=p.c.h264,i.inputTimescale=t.inputTimescale,i.timescale=t.timescale;var n=f.getFillTrackBySamples(i,e.samples);return n&&(this.gi=i.codec===this.yi),n},o()(t,[{key:"iSGenerated",get:function(){return this.gi}}])}();function Q(t,e){var i;if(void 0===e)return t;for(i=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=i;return t}e.b=Y},function(t,e,i){var n=i(5),r=i.n(n),a=i(0),o=i(22),s=i(21),u="canvas-output",c=function(){function t(t,e,i){this.Ci=void 0,this.Fi=void 0,this.Pi=void 0,this.Hi=a.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=i,this.Fi=e,this.Ci=t,t.i(u,"constructor colorSpace: "+e.preferCanvasColorSpace)}t.getPictModeByCss=function(t){var e=o.a.contain;return t instanceof HTMLCanvasElement&&("fill"===t.style.objectFit?e=o.a.fill:"cover"===t.style.objectFit&&(e=o.a.cover)),e};var e=t.prototype;return e.reset=function(){this.Ci.i(u,"reset"),this.Hi=a.s.video,this.Xi()},e.updateCanvasSize=function(t,e){var i=!1;return t===this.Ki.w&&e===this.Ki.h||(i=!0,this.Ki.w=t,this.Ki.h=e,this.zi()),this.Ji(),i},e.updateFormatSize=function(t,e,i){var n=!1,r=i%180==90||i%180==-90,a=r?e:t,o=r?t:e;return a===this.Zi.w&&o===this.Zi.h||(n=!0,this.Zi.w=a,this.Zi.h=o,this.zi(),this.Ji()),n},e.updateRendererType=function(t){this.Ci.i(u,"updateRendererType: "+t);var e=this.rendererType;return t!==a.s.canvas||this.Pi||this.qi(),this.Hi=t,e!==this.rendererType},e.destroy=function(){this.Ci.i(u,"destroy"),this.Xi()},e.zi=function(){if(this.Pi&&this.Ki.h){var t=this.Ki,e=t.w,i=t.h,n=this.Zi,r=n.w,a=n.h;if(a){var o=e/i;o>r/a?i>a&&(e=(i=a)*o):e>r&&(i=(e=r)/o)}this.Pi.width=e,this.Pi.height=i,this.Ci.i(u,"update canvas size",e,i)}},e.Ji=function(){var t,e,i=(null==(t=this.Pi)?void 0:t.width)||this.Ki.w,n=(null==(e=this.Pi)?void 0:e.height)||this.Ki.h,r=this.Zi,a=r.w/r.h;a>i/n?(this.Wi.w=i,this.Wi.h=Math.round(i/a)):(this.Wi.w=Math.round(n*a),this.Wi.h=n)},e.$i=function(t){this.Ci.i(u,"create canvas");var e=document.createElement("canvas");return t.w?(e.width=t.w,e.height=t.h):(t.w=e.width,t.h=e.height),e},e.qi=function(){this.Pi||(this.Pi=this.$i(this.Ki))},e.Xi=function(){if(this.Ci.i(u,"destroy canvas"),this.Yi){var t=this.Yi.getExtension("WEBGL_lose_context");t&&t.loseContext()}this.Yi=null,this.Pi&&(typeof HTMLCanvasElement<"u"&&this.Pi instanceof HTMLCanvasElement&&this.Pi.remove(),this.Pi=void 0)},r()(t,[{key:"rendererType",get:function(){return this.Hi}},{key:"canvas",get:function(){return this.Pi||this.qi(),this.Pi}},{key:"webgl",get:function(){var t;return!this.Yi&&this.Pi&&(this.Yi=Object(s.c)(this.Pi)),null!=(t=this.Fi)&&t.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}}])}();e.a=c},function(t,e,i){function n(t,e,i){return void 0===i?{width:t,height:e}:i.width>i.height?{width:Math.round(i.width/i.height*t),height:e}:i.width<i.height?{width:t,height:Math.round(e*i.height/i.width)}:{width:t,height:e}}i.d(e,"a",(function(){return n}))},function(t,e,i){function n(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i.oe=function(t){throw console.error(t),t};var n=i(i.s=ENTRY_MODULE);return n.default||n}var r="[\\.|\\-|\\+|\\w|/|@]+",a="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+r+").*?\\)";function o(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(t,e,n){var s={};s[n]=[];var u=e.toString(),c=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return s;for(var l,h=c[1],d=new RegExp("(\\\\n|\\W)"+o(h)+a,"g");l=d.exec(u);)"dll-reference"!==l[3]&&s[n].push(l[3]);for(d=new RegExp("\\("+o(h)+'\\("(dll-reference\\s('+r+'))"\\)\\)'+a,"g");l=d.exec(u);)t[l[2]]||(s[n].push(l[1]),t[l[2]]=i(l[1]).m),s[l[2]]=s[l[2]]||[],s[l[2]].push(l[4]);for(var f,p=Object.keys(s),_=0;_<p.length;_++)for(var v=0;v<s[p[_]].length;v++)f=s[p[_]][v],isNaN(1*f)||(s[p[_]][v]=1*s[p[_]][v]);return s}function u(t){return Object.keys(t).reduce((function(e,i){return e||t[i].length>0}),!1)}t.exports=function(t,e){e=e||{};var r={main:i.m},a=e.all?{main:Object.keys(r.main)}:function(t,e){for(var i={main:[e]},n={main:[]},r={main:{}};u(i);)for(var a=Object.keys(i),o=0;o<a.length;o++){var c=a[o],l=i[c].pop();if(r[c]=r[c]||{},!r[c][l]&&t[c][l]){r[c][l]=!0,n[c]=n[c]||[],n[c].push(l);for(var h=s(t,t[c][l],c),d=Object.keys(h),f=0;f<d.length;f++)i[d[f]]=i[d[f]]||[],i[d[f]]=i[d[f]].concat(h[d[f]])}}return n}(r,t),o="";Object.keys(a).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;a[t][e];)e++;a[t].push(e),r[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+t+" = ("+n.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a[t].map((function(e){return JSON.stringify(e)+": "+r[t][e].toString()})).join(",")+"});\n"})),o=o+"new (("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a.main.map((function(t){return JSON.stringify(t)+": "+r.main[t].toString()})).join(",")+"}))(self);";var c=new window.Blob([o],{type:"text/javascript"});if(e.bare)return c;var l=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(c),h=new window.Worker(l);return h.objectURL=l,h}},function(t,e,i){i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return u}));var n=i(18),r=i(7),a=i(2),o=function(){function t(t){this.te=void 0,this.te=t}var e=t.prototype;return e.e=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this.te.postMessage({event:a.a.WORKER_LOG,data:{level:n.LogLevel.ERROR,tag:t,msg:i}})},e.w=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this.te.postMessage({event:a.a.WORKER_LOG,data:{level:n.LogLevel.WARN,tag:t,msg:i}})},e.i=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this.te.postMessage({event:a.a.WORKER_LOG,data:{level:n.LogLevel.INFO,tag:t,msg:i}})},e.d=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this.te.postMessage({event:a.a.WORKER_LOG,data:{level:n.LogLevel.DEBUG,tag:t,msg:i}})},e.v=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this.te.postMessage({event:a.a.WORKER_LOG,data:{level:n.LogLevel.VERBOSE,tag:t,msg:i}})},t}();function s(t,e,i,a,s){var u=new n.Logger(s).setName(r.m).setLevel(e).setId(i);return a&&u.setOutput(new o(t)),n.DefaultLogger.setLevel(e),u}function u(t,e){try{switch(e.level){case n.LogLevel.VERBOSE:t.v.apply(t,[e.tag].concat(e.msg));break;case n.LogLevel.INFO:t.i.apply(t,[e.tag].concat(e.msg));break;case n.LogLevel.ERROR:t.e.apply(t,[e.tag].concat(e.msg));break;case n.LogLevel.WARN:t.w.apply(t,[e.tag].concat(e.msg));break;case n.LogLevel.DEBUG:t.d.apply(t,[e.tag].concat(e.msg))}}catch(t){}}},function(t,e,i){i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return u}));var n=i(11),r=i(0),a=i(7);function o(t,e,i){return void 0===i&&(i=a.f),{type:t,id:n.e[t],pid:-1,inputTimescale:i,timescale:i,codec:"",sequenceNumber:0,samples:[],mp4Samples:[],duration:e,sampleDuration:0,fillDuration:0,droppedDuration:0,droppedFrames:0}}function s(t,e){void 0===e&&(e=a.f);var i=o(r.o.VIDEO,t,e);return i.codedWidth=0,i.codedHeight=0,i.rotation=0,i.sar={width:1,height:1},i.profile="",i.level="",i.chromaFormat="",i.fps=0,i.codecType=r.c.unknown,i.dpb=16,i}function u(t,e){void 0===e&&(e=a.f);var i=o(r.o.AUDIO,t,e);return i.config=[],i.samplerate=0,i.channelCount=0,i.codecType=r.c.unknown,i}},function(t,e,i){i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return s}));var n={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"},r={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 a(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 o=function(t){return r[t]||"Unknown"},s=function(t){return n[t]||"Unknown"}},function(t,e,i){var n=i(17),r=i(24),a=function(){function t(t){this.Ci=void 0,this.ie=-1,this.Ci=t}var e=t.prototype;return e.reset=function(){this.ie=-1},e.update=function(t,e){if(e.samples.length){var i=e.samples.reduce((function(t,i,n){return e.samples[t].pts>i.pts?t:n}),0),a=e.samples[0],o=Math.max(0,a.dts/e.inputTimescale),s=a.originDTS/e.inputTimescale,u=e.samples[i],c=(u.pts+(u.duration||0))/e.inputTimescale,l=n.c(t.samplerate,1),h=c;t.samples.length&&(h=Math.min(t.samples[0].dts/t.inputTimescale,c)),-1===this.ie?this.ie=o:(s=this.ie-o+s,o=this.ie);var d=Math.max(0,Math.ceil((h-o)/l));d>0&&(this.Ci.i("slient-audio","fill cnt: "+d+"@"+o+" duration: "+(h-o)),this.ie=r.a.fillAACFrameByCount(this.Ci,t,o,d,s))}},t}();e.a=a},function(t,e,i){function n(t,e){var i=[];return t.samples.forEach((function(e){var n=t.inputTimescale;i.push({index:0,dts:e.dts/n,pts:e.pts/n,duration:(e.duration||0)/n})})),i.sort((function(t,e){return t.pts-e.pts})),i.forEach((function(t,i){t.index=e+i})),i}i.d(e,"a",(function(){return n}))},function(t,e,i){e.a={search:function(t,e){for(var i=0,n=t.length-1,r=null,a=null;i<=n;){var o=e(a=t[r=(i+n)/2|0]);if(o>0)i=r+1;else{if(!(o<0))return a;n=r-1}}return null},searchIndex:function(t,e){for(var i=0,n=t.length-1,r=null;i<=n;){var a=e(t[r=(i+n)/2|0]);if(a>0)i=r+1;else{if(!(a<0))return r;n=r-1}}return-1}}},function(t,e,i){i.d(e,"a",(function(){return n}));var n=function(){function t(){}return t.getSilentFrame=function(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)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},t}()},function(t,e,i){function n(t){for(var e=[],i=t.byteLength,n=0;n<i;){if(t[n]<128)e.push(t[n]);else if(!(t[n]<192))if(t[n]<224){if(n<i-1&&t[n+1]>>6==2){e.push((31&t[n])<<6|63&t[n+1]),n+=2;continue}}else if(t[n]<240){if(n<i-2&&t[n+1]>>6==2&&t[n+2]>>6==2){e.push((15&t[n])<<12|(63&t[n+1])<<6|63&t[n+2]),n+=3;continue}}else if(t[n]<248&&n<i-3&&t[n+1]>>6==2&&t[n+2]>>6==2&&t[n+3]>>6==2){e.push((7&t[n])<<18|(63&t[n+1])<<12|(63&t[n+2])<<6|63&t[n+3]),n+=4;continue}n++}return(String.fromCodePoint||r).apply(void 0,e)}function r(){for(var t=[],e=0,i="",n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];for(var o=0,s=r.length;o!==s;++o){var u=+r[o];if(!(u<1114111&&u>>>0===u))throw RangeError("Invalid code point: "+u);u<=65535?e=t.push(u):(u-=65536,e=t.push(55296+(u>>10),u%1024+56320)),e>=16383&&(i+=String.fromCharCode.apply(null,t),t.length=0)}return i+String.fromCharCode.apply(null,t)}i.d(e,"a",(function(){return n}))},function(t,e,i){i.r(e);var n=i(18),r=i(11),a=i(27),o=i(34),s=i(28),u=i(2),c=i(47);e.default=function(t){var e,i,l=new s.a;[u.a.PRIV_NAL,u.a.VIDEO_CODEC_DETECTED,u.a.PARSING_INIT_SEGMENT,u.a.PARSED_DATA,u.a.LOAD_END,u.a.ERROR,u.a.DEMUXER_DETECTED,u.a.MEDIA_DEMUX,u.a.METADATA,u.a.KEY_FRAME_INDEXS,u.a.VIDEO_FRAME_INFO,u.a.MP4_NOT_FASTSTART,u.a.AAC_PRIV].forEach((function(e){return l.on(e,(function(i){return t.postMessage({event:e,data:i})}))})),l.on(u.a.PARSING_DATA,(function(e){var i={event:u.a.PARSING_DATA,data:e},n=[];e.segments.forEach((function(t){n.push(t.payload.buffer)})),t.postMessage(i,n)})),l.on(u.a.RAW_DATA,(function(e){var i={event:u.a.RAW_DATA,data:e};if(e.type===r.d.videoFrame){var n=[];e.samples&&e.samples.forEach((function(t){t.units.forEach((function(e){t.units.length&&-1===n.indexOf(e.data.buffer)&&n.push(e.data.buffer)}))}));try{t.postMessage(i,n)}catch(e){t.postMessage(i)}}else t.postMessage(i)})),t.addEventListener("message",(function(r){var s,u,h,d,f,p=r.data;switch(p.cmd){case a.a.INIT:i||(i=Object(o.b)(t,p.config.logLevel||n.DEFAULT_LOG_LEVEL,p.contextId,p.hasExternalLogger,"mux")),i.i("mux-worker","init",p),s=l,u=p.typeSupported,h=p.config,d=p.vendor,f=i,e=new c.a(s,u,h,d,f);break;case a.a.PUSH:e.pushMuxData(p.data,p.decryptdata,p.initSegment,p.timeOffset,p.contiguous,p.trackSwitch,p.discontinuity,p.accurateTimeOffset,p.fragEnd,p.transmuxData);break;case a.a.FLUSH:e.flush();break;case a.a.LOAD_END:e.end();break;case a.a.UPDATE_CONFIG:e.updateConfig(p.config)}}))}},function(t,e,i){var n,r="object"==typeof Reflect?Reflect:null,a=r&&"function"==typeof r.apply?r.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(i,n){function r(i){t.removeListener(e,a),n(i)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",r),i([].slice.call(arguments))}var o,s;A(t,e,a,{once:!0}),"error"!==e&&(s=r,"function"==typeof(o=t).on&&A(o,"error",s,{once:!0}))}))},s.EventEmitter=s,s.prototype.ee=void 0,s.prototype.ne=0,s.prototype.se=void 0;var u=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t.se?s.defaultMaxListeners:t.se}function h(t,e,i,n){var r,a,o,s;if(c(i),void 0===(a=t.ee)?(a=t.ee=Object.create(null),t.ne=0):(void 0!==a.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),a=t.ee),o=a[e]),void 0===o)o=a[e]=i,++t.ne;else if("function"==typeof o?o=a[e]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(r=l(t))>0&&o.length>r&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function p(t,e,i){var n=t.ee;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):v(r,r.length)}function _(t){var e=this.ee;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function v(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function A(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(a){n.once&&t.removeEventListener(e,r),i(a)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),s.init=function(){void 0!==this.ee&&this.ee!==Object.getPrototypeOf(this).ee||(this.ee=Object.create(null),this.ne=0),this.se=this.se||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this.se=t,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this.ee;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=r[t];if(void 0===u)return!1;if("function"==typeof u)a(u,this,e);else{var c=u.length,l=v(u,c);for(i=0;i<c;++i)a(l[i],this,e)}return!0},s.prototype.addListener=function(t,e){return h(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return h(this,t,e,!0)},s.prototype.once=function(t,e){return c(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var i,n,r,a,o;if(c(e),void 0===(n=this.ee))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this.ne?this.ee=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,r=a;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,r),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this.ee))return this;if(void 0===i.removeListener)return 0===arguments.length?(this.ee=Object.create(null),this.ne=0):void 0!==i[t]&&(0==--this.ne?this.ee=Object.create(null):delete i[t]),this;if(0===arguments.length){var r,a=Object.keys(i);for(n=0;n<a.length;++n)"removeListener"!==(r=a[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this.ee=Object.create(null),this.ne=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):_.call(t,e)},s.prototype.listenerCount=_,s.prototype.eventNames=function(){return this.ne>0?n(this.ee):[]}},function(t,e,i){i.d(e,"a",(function(){return u}));var n=i(10),r=i.n(n),a=i(14),o=i(21),s=i(32),u=function(t){function e(e){var i;return(i=t.call(this)||this).Ci=void 0,i.re=void 0,i.he=void 0,i.Ci=e,i}r()(e,t);var i=e.prototype;return i.copyImageData=function(t,e,i,n){var r;this.re||(this.re=Object(o.a)());var a={willReadFrequently:!0};n&&(a.colorSpace=n),this.he||(this.he=this.re.getContext("2d",a));var u,c,l=0,h=0,d=typeof window<"u"&&t instanceof HTMLVideoElement;if(d)l=t.videoWidth,h=t.videoHeight;else if(90===i||270===i){var f=Object(s.a)(t.height,t.width,e);l=f.height,h=f.width}else{var p=Object(s.a)(t.width,t.height,e);l=p.width,h=p.height}return this.re.width=l,this.re.height=h,d?null==(u=this.he)||u.drawImage(t,0,0):null==(c=this.he)||c.drawImage(t,0,0,t.width,t.height,0,0,this.re.width,this.re.height),null==(r=this.he)?void 0:r.getImageData(0,0,l,h,a)},i.destroy=function(){this.Ci.i("image-data-copier","destrpy"),this.re=void 0,this.he=void 0},e}(a.a)},function(t,e,i){var n=i(52);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=function(){function t(){}return t.getPosByTime=function(t,e){if(t&&0!==t.length){if(t[0]&&e<=t[0].time)return t[0];if(t[t.length-1]&&e>=t[t.length-1].time)return t[t.length-1];for(var i=0,n=t.length-1,r=0,a=0;i<=n;)if(e>(a=t[1+(r=(i+n)/2|0)]?t[r+1].time:Number.MAX_SAFE_INTEGER))i=r+1;else{if(!(e<t[r].time))return e===a?t[r+1]:t[r];n=r-1}return t[0]}},t}();e.a=n},function(t,e,i){var n=i(11),r=i(3),a=i(26);function o(t,e,i){return Uint8Array.prototype.slice?t.slice(e,i):new Uint8Array(Array.prototype.slice.call(t,e,i))}var s=function(){function t(t,e){this.ae=void 0,this.ue=void 0,this.ae=t,this.ue=e}return t.prototype.decrypt=function(t,e){return this.ae.decrypt({name:"AES-CBC",iv:this.ue},e,t)},t}(),u=function(){function t(){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 e=t.prototype;return e._e=function(t){for(var e=new DataView(t),i=new Uint32Array(4),n=0;n<4;n++)i[n]=e.getUint32(4*n);return i},e.ye=function(){var t=this.ve,e=this.de,i=this.fe,n=i[0],r=i[1],a=i[2],o=i[3],s=this.Ae,u=s[0],c=s[1],l=s[2],h=s[3],d=new Uint32Array(256),f=0,p=0,_=0;for(_=0;_<256;_++)d[_]=_<128?_<<1:_<<1^283;for(_=0;_<256;_++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,t[f]=v,e[v]=f;var A=d[f],g=d[A],m=d[g],b=257*d[v]^16843008*v;n[f]=b<<24|b>>>8,r[f]=b<<16|b>>>16,a[f]=b<<8|b>>>24,o[f]=b,b=16843009*m^65537*g^257*A^16843008*f,u[v]=b<<24|b>>>8,c[v]=b<<16|b>>>16,l[v]=b<<8|b>>>24,h[v]=b,f?(f=A^d[d[d[m^A]]],p^=d[d[p]]):f=p=1}},e.expandKey=function(t){for(var e=this._e(t),i=!0,n=0;n<e.length&&i;)i=e[n]===this.le[n],n++;if(!i){this.le=e;var r=this.pe=e.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);var a,o,s=this.be=4*(r+6+1),u=this.me=new Uint32Array(s),c=this.ge=new Uint32Array(s),l=this.ve,h=this.ce,d=this.Ae,f=d[0],p=d[1],_=d[2],v=d[3],A=0,g=0;for(a=0;a<s;a++)a<r?A=u[a]=e[a]:(g=A,a%r==0?(g=l[(g=g<<8|g>>>24)>>>24]<<24|l[g>>>16&255]<<16|l[g>>>8&255]<<8|l[255&g],g^=h[a/r|0]<<24):r>6&&a%r==4&&(g=l[g>>>24]<<24|l[g>>>16&255]<<16|l[g>>>8&255]<<8|l[255&g]),u[a]=A=(u[a-r]^g)>>>0);for(o=0;o<s;o++)a=s-o,g=3&o?u[a]:u[a-4],c[o]=o<4||a<=4?g:f[l[g>>>24]]^p[l[g>>>16&255]]^_[l[g>>>8&255]]^v[l[255&g]],c[o]=c[o]>>>0}},e.Ce=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},e.decrypt=function(t,e,i){for(var n,r,a,o,s,u,c,l,h,d,f,p,_,v,A=this.pe+6,g=this.ge,m=this.de,b=this.Ae,y=b[0],E=b[1],C=b[2],T=b[3],I=this._e(i),R=I[0],w=I[1],L=I[2],D=I[3],S=new Int32Array(t),O=new Int32Array(S.length),N=this.Ce;e<S.length;){for(h=N(S[e]),d=N(S[e+1]),f=N(S[e+2]),p=N(S[e+3]),s=h^g[0],u=p^g[1],c=f^g[2],l=d^g[3],_=4,v=1;v<A;v++)n=y[s>>>24]^E[u>>16&255]^C[c>>8&255]^T[255&l]^g[_],r=y[u>>>24]^E[c>>16&255]^C[l>>8&255]^T[255&s]^g[_+1],a=y[c>>>24]^E[l>>16&255]^C[s>>8&255]^T[255&u]^g[_+2],o=y[l>>>24]^E[s>>16&255]^C[u>>8&255]^T[255&c]^g[_+3],s=n,u=r,c=a,l=o,_+=4;n=m[s>>>24]<<24^m[u>>16&255]<<16^m[c>>8&255]<<8^m[255&l]^g[_],r=m[u>>>24]<<24^m[c>>16&255]<<16^m[l>>8&255]<<8^m[255&s]^g[_+1],a=m[c>>>24]<<24^m[l>>16&255]<<16^m[s>>8&255]<<8^m[255&u]^g[_+2],o=m[l>>>24]<<24^m[s>>16&255]<<16^m[u>>8&255]<<8^m[255&c]^g[_+3],_+=3,O[e]=N(n^R),O[e+1]=N(o^w),O[e+2]=N(a^L),O[e+3]=N(r^D),R=h,w=d,L=f,D=p,e+=4}return O.buffer},t}(),c=function(){function t(t,e){this.ae=void 0,this.le=void 0,this.ae=t,this.le=e}return t.prototype.expandKey=function(){return this.ae.importKey("raw",this.le,{name:"AES-CBC",length:128},!1,["encrypt","decrypt"])},t}(),l="decrypter",h=function(){function t(t,e,i){var n=(void 0===i?{}:i).removePKCS7Padding,r=void 0===n||n;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=t,this.di=e,this.Oe=r,r)try{var a=self.crypto;a&&(this.ae=a.subtle||a.webkitSubtle)}catch(t){}null===this.ae&&(this.di.enableSoftwareAES=!0)}var e=t.prototype;return e.isSync=function(){return this.di.enableSoftwareAES},e.flush=function(){var t=this.Me;if(t){var e,i,n,r=new Uint8Array(t);return this.reset(),this.Oe?(n=(i=(e=r).byteLength)&&new DataView(e.buffer).getUint8(i-1))?o(e,0,i-n):e:r}this.reset()},e.reset=function(){this.Me=null,this.ke=null,this.je=null,this.we&&(this.we=null)},e.decrypt=function(t,e,i,n){if(this.di.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),e,i);var r=this.flush();r&&n(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),e,i).then(n)},e.softwareDecrypt=function(t,e,i){var n,r,a,s=this.ke,c=this.Me,l=this.je;this.Se("JS AES decrypt"),l&&(n=l,r=t,(a=new Uint8Array(n.length+r.length)).set(n),a.set(r,n.length),t=a,this.je=null);var h=this.Be(t);if(!h.length)return null;s&&(i=s);var d=this.we;d||(d=this.we=new u),d.expandKey(e);var f=c;return this.Me=d.decrypt(h.buffer,0,i),this.ke=o(h,-16).buffer,f||null},e.webCryptoDecrypt=function(t,e,i){var n=this,r=this.ae;return this.le===e&&this.Ee||(this.le=e,this.Ee=new c(r,e)),this.Ee.expandKey().then((function(e){return r?new s(r,i).decrypt(t.buffer,e):Promise.reject(new Error("web crypto not initialized"))})).catch((function(r){return n.Te(r,t,e,i)}))},e.Te=function(t,e,i,n){return this.Ci.w(l,"[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.di.enableSoftwareAES=!0,this.Ie=!0,this.softwareDecrypt(e,i,n)},e.Be=function(t){var e=t,i=t.length-t.length%16;return i!==t.length&&(e=o(t,0,i),this.je=o(t,i)),e},e.Se=function(t){this.Ie&&(this.Ci.i(l,"[decrypter.ts]: "+t),this.Ie=!1)},t}(),d=i(5),f=i.n(d),p=i(10),_=i.n(p),v=i(17),A=i(7),g=null,m=[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],y=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],E=[0,1,1,4];function C(t,e,i,n,r){if(!(i+24>e.length)){var a=function(t,e){var i=t[e+1]>>3&3,n=t[e+1]>>1&3,r=t[e+2]>>4&15,a=t[e+2]>>2&3;if(1!==i&&0!==r&&15!==r&&3!==a){var o=t[e+2]>>1&1,s=t[e+3]>>6,u=1e3*m[14*(3===i?3-n:3===n?3:4)+r-1],c=b[3*(3===i?0:2===i?1:2)+a],l=3===s?1:2,h=y[i][n],d=E[n],f=8*h*d,p=Math.floor(h*u/c+o)*d;if(null===g){var _=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);g=_?parseInt(_[1]):0}return g&&g<=87&&2===n&&u>=224e3&&0===s&&(t[e+3]=128|t[e+3]),{sampleRate:c,channelCount:l,frameLength:p,samplesPerFrame:f}}}(e,i);if(a&&i+a.frameLength<=e.length){var o=n+r*(a.samplesPerFrame*A.f/a.sampleRate),s={unit:e.subarray(i,i+a.frameLength),pts:o,dts:o,originDTS:n,originPTS:n};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(s),{sample:s,length:a.frameLength,missing:0}}}}function T(t,e){return e+1<t.length&&function(t,e){return!(255!==t[e]||224&~t[e+1]||!(6&t[e+1]))}(t,e)}var I,R=((I={})[I.KEY_FRAME=0]="KEY_FRAME",I[I.INTER_FRAME=1]="INTER_FRAME",I[I.INTRA_ONLY_FRAME=2]="INTRA_ONLY_FRAME",I[I.SWITCH_FRAME=3]="SWITCH_FRAME",I),w=function(t){return t[t.AV1_OBU_SEQUENCE_HEADER=1]="AV1_OBU_SEQUENCE_HEADER",t[t.AV1_OBU_TEMPORAL_DELIMITER=2]="AV1_OBU_TEMPORAL_DELIMITER",t[t.AV1_OBU_FRAME_HEADER=3]="AV1_OBU_FRAME_HEADER",t[t.AV1_OBU_TILE_GROUP=4]="AV1_OBU_TILE_GROUP",t[t.AV1_OBU_METADATA=5]="AV1_OBU_METADATA",t[t.AV1_OBU_FRAME=6]="AV1_OBU_FRAME",t[t.AV1_OBU_REDUNDANT_FRAME_HEADER=7]="AV1_OBU_REDUNDANT_FRAME_HEADER",t[t.AV1_OBU_TILE_LIST=8]="AV1_OBU_TILE_LIST",t[t.AV1_OBU_PADDING=15]="AV1_OBU_PADDING",t}({}),L=i(8),D=i.n(L),S=i(35),O=i(24),N=i(2),k=i(37),x="base-demuxer",P=function(){function t(t,e,i,n,r){var o=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(t){o.Ai.emit(N.a.ERROR,t)},t.i(x,"constructor",n),this.Ci=t,this.Ai=e,this.De=i,this.di=n,this.li=r,this.xe=!!this.di.gopRemux,this._t=new a.a,this.He()}var e=t.prototype;return e.resetInitSegment=function(t){var e;this.Ci.i(x,"reset init",t),this._i=t;var i=this.Ye(),n=this.Ge();"boolean"==typeof i&&(this.Mi.active=i,i||(this.xe=!1)),"boolean"==typeof n&&(this.Ne.active=n),this.Re=this.Le=void 0,this.Mi.samples=[],this.Ne.samples=[],null==(e=this.Qe)||e.reset(),this.Ve=!0,this.Ue=void 0,this.Pe=void 0,this.Fe=void 0,this.xe=!!this.di.gopRemux,this._t.clear()},e.resetTimeStamp=function(){},e.updateConfig=function(t){D()(this.di,t)},e.flush=function(){this.Ci.i(x,"flush"),this.Ke(!0),this.Ue=void 0},e.destroy=function(){this.Ci.i(x,"destroy"),this._t.clear()},e.He=function(t,e){void 0===t&&(t=1/0),this.Mi=Object(S.b)(t,e),this.Ne=Object(S.a)(t,e)},e.Ze=function(t,e){var i,n;null!=(i=this._i)&&i.disableFillSlientForRaw||!e.outputRaw||t.active||(this.Qe||(O.a.initAudioForFillSilent(this.Ci,t,null==(n=this._i)?void 0:n.audioCodec),this.Qe=new k.a(this.Ci)),this.Qe.update(t,e))},e.We=function(t,e){return!!(e.outputRaw||e.active||t.active)||(this.Di(Object(r.e)(r.b.MEDIA_ERROR,r.a.NO_TRACKS_AVAILABLE,"no tracks available. config V: "+this.di.videoEnabled+" A: "+this.di.audioEnabled)),!1)},e.Xe=function(t,e,i){if(0===t.samples.length&&0===e.samples.length)return i&&this.De.flush(),!1;if(!i&&(t.active&&0===t.samples.length||e.active&&e.samples.length<3)){var n=t.active&&t.configParsed&&this.ze(t)||0,r=e.active&&e.decConf&&this.Je(e)||0,a=e.samples.reduce((function(t,e){return t+(e.key?1:0)}),0);return n>30?(this.Ci.i(x,"audio remux sec > 30, remux now."),this.Ke(!0)):(r>30||this.di.isLive&&a>1)&&(this.Ci.i(x,"video remux sec: "+r+" key: "+a+", remux now."),this.Ke(!0)),!1}return!0},e.Ke=function(t){},e.qe=function(t,e,i,n,a){this.Ve&&(this.Ve=!1,this.Ai.emit(N.a.MEDIA_DEMUX,{type:n}));var o=!0,s=0,u=!1;this.Ue&&(o=this.Ue.contiguous,s=this.Ue.timeOffset,u=this.Ue.accurateTimeOffset);try{this.De.remux(t,e,s,o,u,i,a),this.Ue=void 0}catch(t){this.Ci.i(x,t),this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,t.message))}},e.ze=function(t){return t.samples.length?t.samples.length&&v.c(t.samplerate,1)*t.samples.length:0},e.Je=function(t){return t.samples.length?(t.samples[t.samples.length-1].dts-t.samples[0].dts)/t.inputTimescale:0},e.Ye=function(){var t,e;return"boolean"==typeof this.di.videoEnabled?this.di.videoEnabled?null==(e=this._i)?void 0:e.hasVideo:this.di.videoEnabled:null==(t=this._i)?void 0:t.hasVideo},e.Ge=function(){var t,e;return"boolean"==typeof this.di.audioEnabled?this.di.audioEnabled?null==(e=this._i)?void 0:e.hasAudio:this.di.audioEnabled:null==(t=this._i)?void 0:t.hasAudio},e.$e=function(t){var e=this.Mi;t.key&&(this.Pe=t.originPTS),t.keyframePTS=this.Pe,this.tn(t)&&e.samples.push(t)},e.tn=function(t){var e,i,n,r=this.Mi;if(!("keyframesOnly"===(null==(e=this._i)?void 0:e.pushVSampleMode)?t.key:"disableAll"!==(null==(i=this._i)?void 0:i.pushVSampleMode)))return!1;var a=null==(n=this._i)?void 0:n.dropVideo;if(a)for(var o=0;o<a.length;o++){var s,u,c;if(!t.key&&(void 0===(null==(s=a[o])?void 0:s.fragSn)||(null==(u=a[o])?void 0:u.fragSn)===this.Fe)&&t.keyframePTS===Math.round(a[o].keyframePTS*r.inputTimescale))return this.Ci.i(x,"drop sample pts: "+t.originPTS/r.inputTimescale+" frag sn: "+(null==(c=a[o])?void 0:c.fragSn)),r.droppedFrames++,r.droppedDuration+=t.duration||r.sampleDuration,!1}return!0},t}(),M=i(0),U=i(15),B=function(t){return t[t.H264_NAL_UNSPECIFIED=0]="H264_NAL_UNSPECIFIED",t[t.H264_NAL_SLICE=1]="H264_NAL_SLICE",t[t.H264_NAL_DPA=2]="H264_NAL_DPA",t[t.H264_NAL_DPB=3]="H264_NAL_DPB",t[t.H264_NAL_DPC=4]="H264_NAL_DPC",t[t.H264_NAL_IDR_SLICE=5]="H264_NAL_IDR_SLICE",t[t.H264_NAL_SEI=6]="H264_NAL_SEI",t[t.H264_NAL_SPS=7]="H264_NAL_SPS",t[t.H264_NAL_PPS=8]="H264_NAL_PPS",t[t.H264_NAL_AUD=9]="H264_NAL_AUD",t[t.H264_NAL_END_SEQUENCE=10]="H264_NAL_END_SEQUENCE",t[t.H264_NAL_END_STREAM=11]="H264_NAL_END_STREAM",t[t.H264_NAL_FILLER_DATA=12]="H264_NAL_FILLER_DATA",t[t.H264_NAL_SPS_EXT=13]="H264_NAL_SPS_EXT",t[t.H264_NAL_PREFIX=14]="H264_NAL_PREFIX",t[t.H264_NAL_SUB_SPS=15]="H264_NAL_SUB_SPS",t[t.H264_NAL_DPS=16]="H264_NAL_DPS",t[t.H264_NAL_RESERVED17=17]="H264_NAL_RESERVED17",t[t.H264_NAL_RESERVED18=18]="H264_NAL_RESERVED18",t[t.H264_NAL_AUXILIARY_SLICE=19]="H264_NAL_AUXILIARY_SLICE",t[t.H264_NAL_EXTEN_SLICE=20]="H264_NAL_EXTEN_SLICE",t[t.H264_NAL_DEPTH_EXTEN_SLICE=21]="H264_NAL_DEPTH_EXTEN_SLICE",t[t.H264_NAL_RESERVED22=22]="H264_NAL_RESERVED22",t[t.H264_NAL_RESERVED23=23]="H264_NAL_RESERVED23",t[t.H264_NAL_UNSPECIFIED24=24]="H264_NAL_UNSPECIFIED24",t[t.H264_NAL_UNSPECIFIED25=25]="H264_NAL_UNSPECIFIED25",t[t.H264_NAL_UNSPECIFIED26=26]="H264_NAL_UNSPECIFIED26",t[t.H264_NAL_UNSPECIFIED27=27]="H264_NAL_UNSPECIFIED27",t[t.H264_NAL_UNSPECIFIED28=28]="H264_NAL_UNSPECIFIED28",t[t.H264_NAL_UNSPECIFIED29=29]="H264_NAL_UNSPECIFIED29",t[t.H264_NAL_UNSPECIFIED30=30]="H264_NAL_UNSPECIFIED30",t[t.NAL_FF_IGNORE=267448321]="NAL_FF_IGNORE",t[t.PRIV_NAL_MAGIC_H264=31]="PRIV_NAL_MAGIC_H264",t}({}),V=i(9),F=i(4),j=i(1),H=[{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}],G=[M.c.hevc,M.c.kvc3,M.c.kvc4,M.c.kvc5,M.c.kvc6],z=[M.c.vvc,M.c.bvc2,M.c.kvc30];function W(t){return!!t&&G.indexOf(t)>=0}function K(t){return!!t&&z.indexOf(t)>=0}function Y(t){var e=Object(j.a)(t,8);if(e>0&&e<=16){var i=H[e-1];return i?{width:i.w,height:i.h}:void 0}if(255===e)return{width:Object(j.a)(t,16),height:Object(j.a)(t,16)}}function Q(t,e,i){return void 0===i&&(i=0),t.forEach((function(t){t.dts=Math.max(0,t.dts+i)/e,t.cts=t.cts/e,t.pts=t.dts+t.cts,t.originDTS=t.originDTS/e})),t}var X=i(41),Z=/\0/g,q=function(){function t(){}return t.parseMetadata=function(e,i){var n={};try{var r=t.en(e,i,0),a=t.en(e,i,r.size);"string"==typeof r.data&&(n[r.data]=a.data)}catch(t){e.i("AMF",t.toString())}return n},t.nn=function(e,i,n){var r=t.rn(i,n),a=t.en(e,i,n+r.size),o=a.objectEnd;return{data:{name:r.data,value:a.data},size:a.size,objectEnd:o}},t.parseVariable=function(e,i,n){return t.nn(e,i,n)},t.parseLongString=function(t,e){var i=new DataView(t,e).getUint32(0);return{data:i>0?Object(X.a)(new Uint8Array(t,e+4,i)).replace(Z," ").trim():"",size:4+i}},t.parseDate=function(t,e){var i=new DataView(t,e),n=i.getFloat64(0),r=i.getInt16(8);return{data:new Date(n+=60*r*1e3),size:10}},t.rn=function(t,e){var i=new DataView(t,e).getUint16(0);return{data:i>0?Object(X.a)(new Uint8Array(t,e+2,i)).replace(Z," ").trim():"",size:2+i}},t.en=function(e,i,n){var r,a=i.byteLength,o=n,s=i,u=new DataView(s,0),c=u.getUint8(o);o+=1;var l=!1;switch(c){case 0:r=u.getFloat64(o),o+=8;break;case 1:r=!!u.getUint8(o),o+=1;break;case 2:var h=t.rn(s,o);r=h.data,o+=h.size;break;case 3:for(r={},u.getUint32(a-4);o<a-4;){var d=t.nn(e,s,o);if(d.objectEnd)break;"string"==typeof d.data.name&&(r[d.data.name]=d.data.value),o=d.size}o<=a-3&&9==(16777215&u.getUint32(o-1))&&(o+=3);break;case 8:for(r={},o+=4,u.getUint32(a-4);o<a-8;){var f=t.parseVariable(e,s,o);if(f.objectEnd)break;r[f.data.name]=f.data.value,o=f.size}o<=a-3&&9==(16777215&u.getUint32(o-1))&&(o+=3);break;case 9:r=void 0,o=1,l=!0;break;case 10:r=[];var p=u.getUint32(o);o+=4;for(var _=0;_<p;_++){var v=t.en(e,s,o);r.push(v.data),o=v.size}break;case 11:var A=t.parseDate(s,o+1);r=A.data,o+=A.size;break;case 12:var g=t.rn(s,o+1);r=g.data,o+=g.size;break;default:o=a,e.v("AMF","AMF","Unsupported AMF value type "+c)}return{data:r,size:o,objectEnd:l}},t}(),J=function(){function t(t,e){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=t,this.Ai=e,this._t=new a.a,this.un=U.e,this.cn=this.vn}var e=t.prototype;return e.reset=function(){this.un=U.e,this.cn=this.vn,this._t.clear(),this.hn=void 0,this.an={tags:[]},this.An=void 0,this.fn=void 0},e.append=function(t){for(this.an={tags:[]},this._t.put(t);this._t.unreadLen>=this.un;)this.cn();return this.an},e.vn=function(){var t=this._t.get(U.e);t&&(70===t[0]&&76===t[1]&&86===t[2]&&1===t[3]||this.Ai.emit(N.a.ERROR,Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Flv: wrong head")),this.An=!!((4&t[4])>>>2),this.fn=!!(1&t[4]),this.Ci.i("flv-tag-dump","head audio: "+this.An+" video: "+this.fn),this.an.head=t,this.un=U.f,this.cn=this.dn)},e.dn=function(){this.hn=new U.i;var t=this._t.get(U.f);t&&(this.hn.tagType=t[0],this.hn.dataSize=Object(F.g)(t,1),this.hn.timestamp=((255&t[7])<<24)+Object(F.g)(t,4),this.cn=this.ln,this.un=this.hn.dataSize+U.g)},e.ln=function(){var t=this.hn;t&&(t.tagType!==U.j.SCRIPT&&t.tagType!==U.j.AUDIO&&t.tagType!==U.j.VIDEO||(t.body=this._t.get(t.dataSize),this._t.skip(4),this.an.tags.push(t),this.hn=void 0),this.cn=this.dn,this.un=U.f)},f()(t,[{key:"trackInfo",get:function(){return"boolean"==typeof this.fn&&"boolean"==typeof this.An?{hasVideo:this.fn,hasAudio:this.An}:void 0}}])}(),$=i(45),tt=i.n($),et=i(12),it=function(){function t(){}return t.parse=function(t){var e=Object(j.c)(t),i={seq_profile:Object(j.a)(e,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:et.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:et.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:et.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:et.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:t};i.profile_string=function(t){switch(t){case 0:return"Main";case 1:return"High";case 2:return"Professional";default:return"Unknown"}}(i.seq_profile),Object(j.a)(e,1),i.reduced_still_picture_header=Object(j.a)(e,1);var n,r=0,a=0,o=[],s=[0],u=[0],c=[0];if(i.reduced_still_picture_header)o[0]=Object(j.a)(e,5);else{Object(j.a)(e,1)&&(this.bn(e,i),i.decoder_model_info_present_flag=Object(j.a)(e,1),i.decoder_model_info_present_flag&&this.pn(e,i)),r=Object(j.a)(e,1),a=Object(j.a)(e,5);for(var l=0;l<=a;l++)Object(j.a)(e,12),o[l]=Object(j.a)(e,5),o[l]>7?s[l]=Object(j.a)(e,1):s[l]=0,i.decoder_model_info_present_flag?(u[l]=Object(j.a)(e,1),u[l]&&this.mn(e,i,l)):u[l]=0,r&&(c[l]=Object(j.a)(e,1),c[l]&&Object(j.a)(e,4))}i.seq_level_idx_0=o[0],i.seq_tier_0=s[0],i.level_string=(n=o[0])>31||n<0?"Unknown":n>23?"Reserved":2+(n>>2)+"."+(3&n);var h=Object(j.a)(e,4),d=Object(j.a)(e,4),f=Object(j.a)(e,h+1),p=Object(j.a)(e,d+1);i.width=f+1,i.height=p+1,i.frame_id_numbers_present_flag=i.reduced_still_picture_header?0:Object(j.a)(e,1),i.frame_id_numbers_present_flag&&(i.delta_frame_id_length_minus_2=Object(j.a)(e,4),i.additional_frame_id_length_minus_1=Object(j.a)(e,3)),Object(j.a)(e,3);var _,v=0;return i.reduced_still_picture_header||(Object(j.a)(e,4),(v=Object(j.a)(e,1))&&Object(j.a)(e,2),(Object(j.a)(e,1)||Object(j.a)(e,1))&&Object(j.a)(e,1)||Object(j.a)(e,1),v&&Object(j.a)(e,3)),Object(j.a)(e,3),this.gn(e,i),Object(j.a)(e,1),i.codec="av01."+i.seq_profile+"."+("0"+i.seq_level_idx_0).slice(-2)+(i.seq_tier_0?"H":"M")+"."+("0"+i.bit_depth_luma).slice(-2),i.chroma_format_string=0===(_=i).chroma_subsampling_x&&0===_.chroma_subsampling_y?"4:4:4":1===_.chroma_subsampling_x&&0===_.chroma_subsampling_y?"4:2:2":1===_.chroma_subsampling_x&&1===_.chroma_subsampling_y?"4:2:0":"Unknown",i},t.bn=function(t,e){Object(j.a)(t,32),Object(j.a)(t,32),e.equal_picture_interval=Object(j.a)(t,1),e.equal_picture_interval&&Object(j.i)(t)},t.pn=function(t,e){e.buffer_delay_length_minus_1=Object(j.a)(t,5),e.num_units_in_decoding_tick=Object(j.a)(t,32),e.buffer_removal_time_length_minus_1=Object(j.a)(t,5),e.frame_presentation_time_length_minus_1=Object(j.a)(t,5)},t.mn=function(t,e,i){var n=e.buffer_delay_length_minus_1+1;e.decoder_buffer_delay||(e.decoder_buffer_delay=[]),e.decoder_buffer_delay[i]=Object(j.a)(t,n),e.encoder_buffer_delay||(e.encoder_buffer_delay=[]),e.encoder_buffer_delay[i]=Object(j.a)(t,n),e.low_delay_mode_flag||(e.low_delay_mode_flag=[]),e.low_delay_mode_flag[i]=Object(j.a)(t,n)},t.gn=function(t,e){e.high_bitdepth=Object(j.a)(t,1),2===e.seq_profile&&e.high_bitdepth?(e.twelve_bit=Object(j.a)(t,1),e.bit_depth_luma=e.twelve_bit?12:10):e.seq_profile<2&&(e.bit_depth_luma=e.high_bitdepth?10:8),1===e.seq_profile?e.monochrome=0:e.monochrome=Object(j.a)(t,1),Object(j.a)(t,1)?(e.color_info.colourPrimaries=Object(j.a)(t,8),e.color_info.transferCharacteristics=Object(j.a)(t,8),e.color_info.matrixCoefficients=Object(j.a)(t,8)):(e.color_info.colourPrimaries=et.a.AVCOL_PRI_UNSPECIFIED,e.color_info.transferCharacteristics=et.d.AVCOL_TRC_UNSPECIFIED,e.color_info.matrixCoefficients=et.c.AVCOL_SPC_UNSPECIFIED),e.chroma_subsampling_x=1,e.chroma_subsampling_y=1,e.monochrome?e.color_info.colorRange=Object(j.a)(t,1)+1:(e.color_info.colourPrimaries===et.a.AVCOL_PRI_BT709&&e.color_info.transferCharacteristics===et.d.AVCOL_TRC_IEC61966_2_1&&e.color_info.matrixCoefficients===et.c.AVCOL_SPC_RGB?(e.color_info.colorRange=1,e.chroma_subsampling_x=0,e.chroma_subsampling_y=0):(e.color_info.colorRange=Object(j.a)(t,1)+1,0===e.seq_profile?(e.chroma_subsampling_x=1,e.chroma_subsampling_y=1):1===e.seq_profile?(e.chroma_subsampling_x=0,e.chroma_subsampling_y=0):12===e.bit_depth_luma?(e.chroma_subsampling_x=Object(j.a)(t,1),e.chroma_subsampling_x?e.chroma_subsampling_y=Object(j.a)(t,1):e.chroma_subsampling_y=0):(e.chroma_subsampling_x=1,e.chroma_subsampling_y=0),e.chroma_subsampling_x&&e.chroma_subsampling_y&&Object(j.a)(t,2)),Object(j.a)(t,1))},t}();function nt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function rt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(i),!0).forEach((function(e){tt()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nt(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var at=function(){function t(){}return t.createCtx=function(){return{seenFrameHeader:0,ref:[]}},t.parseOBU=function(t,e){for(var i=[],n=0;n<t.byteLength;){var r,a=t.subarray(n),o=this.yn(a),s=o.obu_extension_flag+1,u=Object(j.c)(a);Object(j.g)(u,8*s),r=o.obu_has_size_field?Object(j.e)(u):a.length-s;var c=u.byteIndex,l=rt(rt({},o),{},{data:a.subarray(0,c+r)});o.obu_type===w.AV1_OBU_SEQUENCE_HEADER?(l.content=it.parse(l.data.subarray(c)),e.sh=l.content=it.parse(l.data.subarray(c))):o.obu_type===w.AV1_OBU_FRAME_HEADER?(e.seenFrameHeader=0,this._n(l.data.subarray(c),e)):o.obu_type===w.AV1_OBU_REDUNDANT_FRAME_HEADER?e.seenFrameHeader=1:o.obu_type===w.AV1_OBU_TEMPORAL_DELIMITER?e.seenFrameHeader=0:o.obu_type===w.AV1_OBU_FRAME&&(e.seenFrameHeader=0,l.content=this.Cn(l.data.subarray(c),e)),i.push(l),n+=c+r}return i},t.yn=function(t){var e={obu_forbidden_bit:t[0]>>7,obu_type:t[0]>>3&15,obu_extension_flag:t[0]>>2&1,obu_has_size_field:t[0]>>1&1};return e.obu_extension_flag&&(e.temporal_id=t[1]>>5,e.spatial_id=t[1]>>3&3),e},t._n=function(t,e){var i=Object(j.c)(t);e.seenFrameHeader?e.frame={keyframe:!1,show_existing_frame:0}:(e.seenFrameHeader=1,e.frame={keyframe:!1,show_existing_frame:0},this.In(i,e),e.frame.show_existing_frame?e.seenFrameHeader=0:e.seenFrameHeader=1)},t.Cn=function(t,e){return this._n(t,e),e.frame},t.In=function(t,e){var i=e.sh;if(i){var n=R.INTER_FRAME;if(i.reduced_still_picture_header)n=R.KEY_FRAME;else{if(1==Object(j.a)(t,1))return void Object(j.a)(t,3);n=Object(j.a)(t,2)}e.frame&&(e.frame.keyframe=n===R.KEY_FRAME)}},t.On=function(t,e){var i=e.frame_presentation_time_length_minus_1+1;Object(j.a)(t,i)},t}(),ot=function(){function t(){}return t.parse=function(e,i){void 0===i&&(i=!0);var n={},r=new DataView(e.buffer,e.byteOffset).getUint32(0)!==(i?525030175:2113995134),a=6,o=new Uint8Array(1024);o.set(e.slice(0,6),0);for(var s=e.byteLength,u=[e[s-2],e[s-1]],c=6;c<s;){var l=e[c];0===u[0]&&0===u[1]&&3===l||(o[a++]=l),u[0]=u[1],u[1]=l,++c}for(var h=6,d=new DataView(o.buffer);h<a;){var f=h,p=d.getUint16(f,r);f+=2;var _=d.getUint16(f,r);f+=2;var v=d.getUint16(f,r);if(f+=2,t.wn(d,n,f,v,p,_,r),f+=v,h+=_,!_)break}return n},t.wn=function(e,i,n,r,a,o,s){var u=t.En(e,n,r);switch(n+=r,a){case 1:break;case 2:i[u]=t.En(e,n,o-4);break;case 3:i[u]=e.getUint32(n,s);break;case 4:var c=e.getUint32(n+4,s),l=e.getUint32(n,s);i[u]=Math.pow(2,32)*c+l;break;case 5:i[u]=e.getFloat32(n,s);break;case 6:i[u]=e.getFloat64(n,s)}},t.En=function(t,e,i){for(var n="",r=e;r<e+i;r++)n+=String.fromCharCode(t.getUint8(r));return n},t}();function st(t){for(var e,i=t.byteLength,n=[],r=1;r<i-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return t;e=i-n.length;var a=new Uint8Array(e),o=0;for(r=0;r<e;o++,r++)o===n[0]&&(o++,n.shift()),a[r]=t[o];return a}var ut=function(){function t(){}return t.parse=function(t){var e=[];try{for(var i=st(t),n=0;n<i.length-1;){var r=0,a=0,o=0;do{r=i[n],n++,a+=r}while(255===r);do{r=i[n],n++,o+=r}while(255===r);if(251===a){var s=Object(F.f)(i,n+1),u=i.subarray(n+3,n+3+s);e.push({type:a,data:u})}else{var c=i.subarray(n,n+o);e.push({type:a,data:c})}n+=o}}catch(t){}return e},t}();function ct(t){switch(t){case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}}var lt={1:"Main",2:"Main 10",3:"Main Still Picture",4:"Rext"},ht={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"},dt=i(16),ft=function(){function t(){}return t.parse=function(t){var e=st(t),i=Object(j.c)(e);Object(j.a)(i,8);var n={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(t)};return n.pps_id=Object(j.h)(i),n.sps_id=Object(j.h)(i),n.cabac=Object(j.a)(i,1),n.pic_order_present=Object(j.a)(i,1),n.slice_group_count=Object(j.h)(i)+1,n.slice_group_count>1&&Object(j.h)(i),n.ref_count[0]=Object(j.h)(i)+1,n.ref_count[1]=Object(j.h)(i)+1,n.weighted_pred=Object(j.a)(i,1),n.weighted_bipred_idc=Object(j.a)(i,2),Object(j.f)(i),Object(j.f)(i),n.chroma_qp_index_offset[0]=Object(j.f)(i),n.deblocking_filter_parameters_present=Object(j.a)(i,1),n.constrained_intra_pred=Object(j.a)(i,1),n.redundant_pic_cnt_present=Object(j.a)(i,1),n.transform_8x8_mode=0,n},t}(),pt=function(){function t(){}return t.parse=function(e){var i=st(e),n=Object(j.c)(i);Object(j.g)(n,8);var r=Object(j.a)(n,8);Object(j.g)(n,8);var a,o=Object(j.a)(n,8),s=Object(j.h)(n),u=function(t){switch(t){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"}}(r),c=(a=o)<0?"Unknown":(a/10).toFixed(1),l=1,h=8,d=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(3===(l=Object(j.h)(n))&&Object(j.a)(n,1),h=Object(j.h)(n)+8,d=Object(j.h)(n)+8,Object(j.a)(n,1),Object(j.a)(n,1)))for(var f=3!==l?8:12,p=0;p<f;p++)Object(j.a)(n,1)&&(p<6?t.jn(n,16):t.jn(n,64));var _=Object(j.h)(n)+4,v=Object(j.h)(n),A=0,g=0,m=0,b=0,y=0,E=[];if(0===v)A=Object(j.h)(n)+4;else if(1===v){g=Object(j.a)(n,1),b=Object(j.f)(n),y=Object(j.f)(n),m=Object(j.h)(n);for(var C=0;C<m;C++)E[C]=Object(j.f)(n)}var T=Object(j.h)(n);Object(j.a)(n,1);var I=Object(j.h)(n)+1,R=Object(j.h)(n)+1,w=Object(j.a)(n,1);0===w&&Object(j.a)(n,1),Object(j.a)(n,1);var L=0,D=0,S=0,O=0;Object(j.a)(n,1)&&(L=Object(j.h)(n),D=Object(j.h)(n),S=Object(j.h)(n),O=Object(j.h)(n));var N={width:1,height:1},k=0,x=!0,P=0,M=0,U=et.b.AVCOL_RANGE_UNSPECIFIED,B=et.a.AVCOL_PRI_UNSPECIFIED,V=et.d.AVCOL_TRC_UNSPECIFIED,F=et.c.AVCOL_SPC_UNSPECIFIED;if(Object(j.a)(n,1)){if(Object(j.a)(n,1)){var H=Y(n);H&&(N=H)}if(Object(j.a)(n,1)&&Object(j.a)(n,1),Object(j.a)(n,1)&&(Object(j.a)(n,3),U=Object(j.a)(n,1)?et.b.AVCOL_RANGE_JPEG:et.b.AVCOL_RANGE_MPEG,Object(j.a)(n,1)&&(B=Object(j.a)(n,8),V=Object(j.a)(n,8),F=Object(j.a)(n,8))),Object(j.a)(n,1)&&(Object(j.h)(n),Object(j.h)(n)),Object(j.a)(n,1)){var G=Object(j.a)(n,32),z=Object(j.a)(n,32);x=!!Object(j.a)(n,1),k=(P=z)/(M=2*G)}}var W=0,K=0;0===l?(W=1,K=2-w):(W=3===l?1:2,K=(1===l?2:1)*(2-w));var Q=16*I,X=16*R*(2-w);Q-=(L+D)*W,X-=(S+O)*K;for(var Z=e.subarray(1,4),q="avc1.",J=0;J<3;J++){var $=Z[J].toString(16);$.length<2&&($="0"+$),q+=$}return{sps_id:s,profile_string:u,level_string:c,bit_depth_luma:h,bit_depth_chroma:d,chroma_format_idc:l,chroma_format_string:ct(l),frame_rate:{fixed:x,fps:k,fps_den:M,fps_num:P},sar:N,codec_size:{width:Q,height:X},color_info:{colorRange:U,colourPrimaries:B,transferCharacteristics:V,matrixCoefficients:F},codec:q,pic_order_cnt_type:v,log2_max_frame_num:_,log2_max_poc_lsb:A,frame_mbs_only_flag:w,delta_pic_order_always_zero_flag:g,num_ref_frames_in_pic_order_cnt_cycle:m,offset_for_ref_frame:E,offset_for_non_ref_pic:b,offset_for_top_to_bottom_field:y,ref_frame_count:T,data:new Uint8Array(e)}},t.jn=function(t,e){for(var i=8,n=8,r=0;r<e;r++)0!==n&&(n=(i+Object(j.f)(t)+256)%256),i=0===n?i:n},t}(),_t=function(){function t(){}return t.parse=function(t){var e=st(t),i=Object(j.c)(e);Object(j.g)(i,16);var n={pps_id:Object(j.h)(i),sps_id:Object(j.h)(i),dependent_slice_segments_enabled_flag:Object(j.a)(i,1),output_flag_present_flag:Object(j.a)(i,1),num_extra_slice_header_bits:Object(j.a)(i,3),sign_data_hiding_enabled_flag:Object(j.a)(i,1),cabac_init_present_flag:Object(j.a)(i,1),num_ref_idx_l0_default_active:Object(j.h)(i)+1,num_ref_idx_l1_default_active:Object(j.h)(i)+1,init_qp_minus26:Object(j.h)(i),constrained_intra_pred_flag:Object(j.a)(i,1),transform_skip_enabled_flag:Object(j.a)(i,1),tiles_enabled_flag:0,entropy_coding_sync_enabled_flag:0,data:new Uint8Array(t)};return Object(j.a)(i,1)&&Object(j.h)(i),Object(j.f)(i),Object(j.f)(i),Object(j.g)(i,4),n.tiles_enabled_flag=Object(j.a)(i,1),n.entropy_coding_sync_enabled_flag=Object(j.a)(i,1),n},t}(),vt=function(){function t(){}return t.parsePTL=function(t,e,i){if(!this.kn(t,e.general_ptl)||Object(j.d)(t)<8+16*(i-1>0?1:0))return!1;var n;e.general_ptl.level_idc=Object(j.a)(t,8),e.general_ptl.level_string=(n=e.general_ptl.level_idc,ht[n]||"Unknown"),e.sub_layer_profile_present_flag=[],e.sub_layer_level_present_flag=[];for(var r=0;r<i-1;r++)e.sub_layer_profile_present_flag[r]=Object(j.a)(t,1),e.sub_layer_level_present_flag[r]=Object(j.a)(t,1);if(i-1>0)for(var a=i-1;a<8;a++)Object(j.a)(t,2);for(var o=0;o<i-1;o++){var s=e.sub_layer_ptl[o]=this.getPTLCommon();if(e.sub_layer_profile_present_flag[o]&&this.kn(t,s))return!1;if(e.sub_layer_level_present_flag[o]){if(Object(j.d)(t)<8)return!1;s.level_idc=Object(j.a)(t,8)}}return!0},t.getPTL=function(){return{general_ptl:t.getPTLCommon(),sub_layer_ptl:[],sub_layer_profile_present_flag:[],sub_layer_level_present_flag:[]}},t.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:""}},t.kn=function(t,e){if(Object(j.d)(t)<88)return!1;e.profile_space=Object(j.a)(t,2),e.tier_flag=Object(j.a)(t,1),e.profile_idc=Object(j.a)(t,5),e.profile_compatibility_flag=[];for(var i=0;i<32;i++)e.profile_compatibility_flag[i]=Object(j.a)(t,1),e.profile_compatibility=(e.profile_compatibility_flag[i]<<31-i)+e.profile_compatibility,0==e.profile_idc&&i>0&&e.profile_compatibility_flag[i]&&(e.profile_idc=i);for(var n=0;n<6;n++)e.constraint_indicator.push(Object(j.a)(t,8));var r;return e.profile_string=(r=e.profile_idc,lt[r]||"Unknown"),!0},t}(),At=[1,2,2,1],gt=[1,2,1,1],mt=function(){function t(){}return t.parse=function(t,e){void 0===e&&(e=M.c.hevc);var i=st(t),n=Object(j.c)(i),r=vt.getPTL();Object(j.g)(n,16);var a=Object(j.a)(n,4),o=Object(j.a)(n,3),s=o+1;Object(j.g)(n,1);var u={vps_id:a,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:et.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:et.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:et.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:et.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:r,sar:{width:1,height:1},data:new Uint8Array(t)};if(!vt.parsePTL(n,r,s)||(u.sps_id=Object(j.h)(n),u.sps_id>=16))return u;var c=Object(j.h)(n);if(3==c&&Object(j.a)(n,1)&&(c=0),u.width=Object(j.h)(n),u.height=Object(j.h)(n),u.conformance_window_flag=Object(j.a)(n,1),u.conformance_window_flag){var l=gt[c],h=At[c];u.conf_win_left_offset=Object(j.h)(n),u.conf_win_right_offset=Object(j.h)(n),u.conf_win_top_offset=Object(j.h)(n),u.conf_win_bottom_offset=Object(j.h)(n),l&&h&&(u.width=u.width-(u.conf_win_left_offset+u.conf_win_right_offset)*h,u.height=u.height-(u.conf_win_top_offset+u.conf_win_bottom_offset)*l)}u.bit_depth_luma=Object(j.h)(n)+8,u.bit_depth_chroma=Object(j.h)(n)+8,u.log2_max_poc_lsb=Object(j.h)(n)+4;for(var d=Object(j.a)(n,1)?0:o;d<=o;d++)u.temporal_layer.push({max_dec_pic_buffering:Object(j.h)(n)+1}),Object(j.h)(n),Object(j.h)(n);u.log2_min_cb_size=Object(j.h)(n)+3,u.log2_diff_max_min_coding_block_size=Object(j.h)(n),e!==M.c.kvc4&&e!==M.c.kvc5&&e!==M.c.kvc6||Object(j.h)(n),e!==M.c.kvc3&&e!==M.c.kvc4&&e!==M.c.kvc5&&e!==M.c.kvc6||Object(j.h)(n)&&(Object(j.h)(n),Object(j.h)(n)),u.log2_min_tb_size=Object(j.h)(n)+2;var f=Object(j.h)(n);u.log2_max_trafo_size=f+u.log2_min_tb_size,Object(j.h)(n),Object(j.h)(n),Object(j.a)(n,1)&&Object(j.a)(n,1)&&this.skipScalingListData(n),Object(j.a)(n,1),Object(j.a)(n,1),Object(j.a)(n,1)&&(Object(j.a)(n,4),Object(j.a)(n,4),Object(j.h)(n),Object(j.h)(n),Object(j.a)(n,1));var p=Object(j.h)(n);if(p>64)return u;for(var _=[],v=0;v<p;v++)if(this.parseRps(n,v,p,_)<0)return u;if(Object(j.a)(n,1)){var A=Object(j.h)(n);if(A>31)return u;for(d=0;d<A;d++){var g=Math.min(u.log2_max_poc_lsb,16);Object(j.a)(n,g),Object(j.a)(n,1)}}return Object(j.a)(n,1),Object(j.a)(n,1),Object(j.a)(n,1)&&this.hvccParseVui(n,u,o),u.log2_ctb_size=u.log2_min_cb_size+u.log2_diff_max_min_coding_block_size,u.ctb_width=u.width+(1<<u.log2_ctb_size)-1>>u.log2_ctb_size,u.ctb_height=u.height+(1<<u.log2_ctb_size)-1>>u.log2_ctb_size,u.chroma_format_idc=c,u.chroma_format_string=3===c?"4:4:4":"4:2:0",u.profile_string=r.general_ptl.profile_string,u.level_string=r.general_ptl.level_string,u.codec=this.getCodec(r.general_ptl,e),u},t.getCodec=function(t,e){void 0===e&&(e=M.c.hevc);for(var i=Math.abs(t.profile_compatibility).toString(16);i.length>1;){var n=i.length-1;if("0"!==i.charAt(n))break;i=i.slice(0,n)}for(var r="",a=!1,o=5;o>=0;o--)(t.constraint_indicator[o]||a)&&(r="."+t.constraint_indicator[o].toString(16)+r,a=!0);return(e===M.c.hevc?"hev1":e)+"."+["","A","B","C"][t.profile_space]+t.profile_idc+"."+i+"."+(0===t.tier_flag?"L":"H")+t.level_idc+r},t.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:""}},t.skipScalingListData=function(t){var e,i,n,r;for(e=0;e<4;e++)for(i=0;i<(3==e?2:6);i++)if(Object(j.a)(t,1))for(r=Math.min(64,1<<4+(e<<1)),e>1&&Object(j.f)(t),n=0;n<r;n++)Object(j.f)(t);else Object(j.h)(t)},t.parseRps=function(t,e,i,n){var r;if(e&&Object(j.a)(t,1)){if(e>=i)return-1;for(Object(j.a)(t,1),Object(j.h)(t),n[e]=0,r=0;r<=n[e-1];r++){var a=0,o=Object(j.a)(t,1);o||(a=Object(j.a)(t,1)),(o||a)&&n[e]++}}else{var s=Object(j.h)(t),u=Object(j.h)(t);if(2*(u+s)>Object(j.d)(t))return-1;for(n[e]=s+u,r=0;r<s;r++)Object(j.h)(t),Object(j.a)(t,1);for(r=0;r<u;r++)Object(j.h)(t),Object(j.a)(t,1)}return 0},t.hvccParseVui=function(t,e,i){var n;if(Object(j.a)(t,1)){var r=Y(t);r&&(e.sar=r)}Object(j.a)(t,1)&&Object(j.a)(t,1),Object(j.a)(t,1)&&(Object(j.a)(t,3),e.color_info.colorRange=Object(j.a)(t,1)?et.b.AVCOL_RANGE_JPEG:et.b.AVCOL_RANGE_MPEG,Object(j.a)(t,1)&&(e.color_info.colourPrimaries=Object(j.a)(t,8),e.color_info.transferCharacteristics=Object(j.a)(t,8),e.color_info.matrixCoefficients=Object(j.a)(t,8))),Object(j.a)(t,1)&&(Object(j.h)(t),Object(j.h)(t)),Object(j.a)(t,3),Object(j.a)(t,1)&&(Object(j.h)(t),Object(j.h)(t),Object(j.h)(t),Object(j.h)(t)),Object(j.a)(t,1)&&(this.parseTimingInfo(t,e),Object(j.a)(t,1)&&this.skipHrdParameters(t,1,i)),Object(j.a)(t,1)&&(Object(j.a)(t,3),n=Object(j.h)(t),e.min_spatial_segmentation_idc=Math.min(e.min_spatial_segmentation_idc,n),Object(j.h)(t),Object(j.h)(t),Object(j.h)(t),Object(j.h)(t))},t.parseTimingInfo=function(t,e){var i=Object(j.a)(t,32),n=Object(j.a)(t,32);e.fps=n/i||0,Object(j.a)(t,1)&&Object(j.h)(t)},t.skipHrdParameters=function(t,e,i){var n,r=0,a=0,o=0;for(e&&(a=Object(j.a)(t,1),o=Object(j.a)(t,1),(a||o)&&((r=Object(j.a)(t,1))&&Object(j.a)(t,19),Object(j.a)(t,8),r&&Object(j.a)(t,4),Object(j.a)(t,15))),n=0;n<=i;n++){var s=0,u=0,c=0;if(Object(j.a)(t,1)||(c=Object(j.a)(t,1)),c?Object(j.h)(t):u=Object(j.a)(t,1),!u&&(s=Object(j.h)(t))>31)return-1;a&&this.Mn(t,s,r),o&&this.Mn(t,s,r)}return 0},t.Mn=function(t,e,i){var n;for(n=0;n<=e;n++)Object(j.h)(t),Object(j.h)(t),i&&(Object(j.h)(t),Object(j.h)(t)),Object(j.a)(t,1)},t}(),bt="vps-parser",yt=function(){function t(){}return t.parse=function(t,e){var i=st(e),n=Object(j.c)(i);Object(j.g)(n,16);var r={vps_id:Object(j.a)(n,4),fps:0,ptl:vt.getPTL(),data:new Uint8Array(e)};if(r.vps_id>=16)return t.i(bt,"VPS id out of range:",r.vps_id),r;if(3!==Object(j.a)(n,2))return t.i(bt,"vps_reserved_three_2bits is not three"),r;Object(j.g)(n,6);var a=Object(j.a)(n,3);if(Object(j.g)(n,1),65535!=Object(j.a)(n,16))return t.i(bt,"vps_reserved_ffff_16bits is not 0xffff\n"),r;if(a>7)return t.i(bt,"vps_max_sub_layers out of range: ",a),r;if(!vt.parsePTL(n,r.ptl,a))return r;for(var o=Object(j.a)(n,1)?0:a-1;o<a;o++)Object(j.h)(n),Object(j.h)(n),Object(j.h)(n);var s=Object(j.a)(n,6),u=Object(j.h)(n)+1;if(u<1||u>1024||(u-1)*(s+1)>Object(j.d)(n))return t.i(bt,"too many layer_id_included_flags"),r;for(o=1;o<u;o++)for(var c=0;c<=s;c++)Object(j.a)(n,1);if(Object(j.a)(n,1)){var l=Object(j.a)(n,32),h=Object(j.a)(n,32);r.fps=h/l||0}return r},t}(),Et=function(){function t(){}return t.parse=function(t){var e=st(t),i=Object(j.c)(e);Object(j.g)(i,16);var n={data:new Uint8Array(t),pps_id:Object(j.a)(i,6),sps_id:Object(j.a)(i,4),width:0,height:0};Object(j.a)(i,1),n.width=Object(j.h)(i),n.height=Object(j.h)(i),Object(j.a)(i,1)&&(n.pps_conf_win_left_offset=Object(j.h)(i),n.pps_conf_win_right_offset=Object(j.h)(i),n.pps_conf_win_top_offset=Object(j.h)(i),n.pps_conf_win_bottom_offset=Object(j.h)(i)),Object(j.a)(i,1)&&(Object(j.f)(i),Object(j.f)(i),Object(j.f)(i),Object(j.f)(i)),Object(j.a)(i,1);var r=Object(j.a)(i,1);if(Object(j.a)(i,1)){var a=0;r||(a=Object(j.h)(i));for(var o=Object(j.h)(i),s=0;s<=a;s++)Object(j.g)(i,o+1)}return n},t}(),Ct=i(36),Tt=function(){function t(){}return t.parse=function(t){var e=st(t),i=Object(j.c)(e);Object(j.g)(i,16);var n={data:new Uint8Array(t),sps_id:Object(j.a)(i,4),vps_id:Object(j.a)(i,4),max_sublayers_minus1:Object(j.a)(i,3),chroma_format_idc:Object(j.a)(i,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:et.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:et.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:et.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:et.c.AVCOL_SPC_UNSPECIFIED}};n.chroma_format_string=Object(Ct.a)(n.chroma_format_idc);var r=1<<Object(j.a)(i,2)+5,a=Object(j.a)(i,1);if(a&&this.Sn(i,n,1,n.max_sublayers_minus1),Object(j.a)(i,1),Object(j.a)(i,1)&&Object(j.g)(i,1),n.width=Object(j.h)(i),n.height=Object(j.h)(i),Object(j.a)(i,1)&&(n.conf_win_left_offset=Object(j.h)(i),n.conf_win_right_offset=Object(j.h)(i),n.conf_win_top_offset=Object(j.h)(i),n.conf_win_bottom_offset=Object(j.h)(i)),Object(j.a)(i,1)){var o=Math.floor(n.width/r)+1,s=Math.floor(n.height/r)+1,u=Object(j.h)(i),c=0,l=0;u>0&&(l=Object(j.a)(i,1),c=Object(j.a)(i,1));for(var h=0;u>0&&h<=u;h++)c&&0!==h||(h>0&&n.width>r&&Object(j.g)(i,o),h>0&&n.height>r&&Object(j.g)(i,s),h<u&&n.width>r&&Object(j.g)(i,o),h<u&&n.height>r&&Object(j.g)(i,s)),l||(Object(j.g)(i,1),Object(j.g)(i,1));var d=Object(j.h)(i);if(Object(j.a)(i,1)&&Object(j.a)(i,1))for(var f=0;f<=u;f++)Object(j.g)(i,d+1)}n.bitdepth=Object(j.h)(i)+8,Object(j.a)(i,2),n.sps_log2_max_pic_order_cnt_lsb_minus4=Object(j.a)(i,4),Object(j.a)(i,1)&&Object(j.h)(i);var p=Object(j.a)(i,2);Object(j.g)(i,8*p);var _=Object(j.a)(i,2);if(Object(j.g)(i,8*_),a){var v=0;n.max_sublayers_minus1>0&&(v=Object(j.a)(i,1)),this.Bn(i,n.max_sublayers_minus1,v)}Object(j.h)(i),Object(j.a)(i,1),Object(j.h)(i),0!=Object(j.h)(i)&&(Object(j.h)(i),Object(j.h)(i));var A=0;0!=n.chroma_format_idc&&(A=Object(j.a)(i,1)),A&&(Object(j.h)(i),0!=Object(j.h)(i)&&(Object(j.h)(i),Object(j.h)(i))),Object(j.h)(i),0!=Object(j.h)(i)&&(Object(j.h)(i),Object(j.h)(i));var g=0;r>32&&(g=Object(j.a)(i,1));var m=Object(j.a)(i,1);m&&(Object(j.h)(i),Object(j.g)(i,1)),Object(j.a)(i,1)&&Object(j.g)(i,2);var b=Object(j.a)(i,1);if(0!=n.chroma_format_idc)for(var y=Object(j.a)(i,1),E=Object(j.a)(i,1)?1:y?3:2,C=[],T=0;T<E;T++){Object(j.f)(i),C[T]=Object(j.h)(i);for(var I=0;I<=C[T];I++)Object(j.h)(i),Object(j.h)(i)}Object(j.a)(i,1),Object(j.a)(i,1)&&0!=n.chroma_format_idc&&Object(j.g)(i,1),Object(j.a)(i,1),n.sps_weighted_pred_flag=Object(j.a)(i,1),n.sps_weighted_bipred_flag=Object(j.a)(i,1),n.sps_long_term_ref_pics_flag=Object(j.a)(i,1),n.vps_id>0&&(n.sps_inter_layer_prediction_enabled_flag=Object(j.a)(i,1)),Object(j.a)(i,1);for(var R=Object(j.a)(i,1),w=0;w<(R?1:2);w++){n.sps_num_ref_pic_lists[w]=Object(j.h)(i);for(var L=0;L<n.sps_num_ref_pic_lists[w];L++)this.Tn(i,n,w,L)}Object(j.a)(i,1),Object(j.a)(i,1)&&Object(j.g)(i,1);var D=Object(j.a)(i,1);Object(j.a)(i,1)&&Object(j.g)(i,1),Object(j.a)(i,1),Object(j.a)(i,1)&&Object(j.g)(i,1),Object(j.a)(i,1)&&Object(j.g)(i,1);var S=6-Object(j.h)(i);Object(j.a)(i,1),Object(j.a)(i,1)&&(Object(j.h)(i),Object(j.g)(i,1),D&&Object(j.g)(i,1),Object(j.a)(i,1)&&Object(j.g)(i,1)),Object(j.a)(i,2),S>=2&&Object(j.a)(i,1)&&S>=3&&Object(j.h)(i),Object(j.h)(i),Object(j.a)(i,3),0!=n.chroma_format_idc&&Object(j.g)(i,1),1===n.chroma_format_idc&&Object(j.g)(i,2);var O=Object(j.a)(i,1),N=0;if(3!==n.chroma_format_idc||g||(N=Object(j.a)(i,1)),(m||O)&&Object(j.h)(i),Object(j.a)(i,1)&&Object(j.h)(i),Object(j.a)(i,1)){var k=Object(j.a)(i,2);Object(j.f)(i);for(var x=0;x<k+1;x++)Object(j.f)(i),Object(j.h)(i)}var P=Object(j.a)(i,1);b&&P&&Object(j.g)(i,1);var M=0;if(N&&P&&(M=Object(j.a)(i,1)),M&&Object(j.g)(i,1),Object(j.a)(i,2),Object(j.a)(i,1)&&Object(j.a)(i,1)){for(var U=Object(j.h)(i),B=0;B<U;B++)Object(j.h)(i);for(var V=Object(j.h)(i),F=0;F<V;F++)Object(j.h)(i)}if(a&&Object(j.a)(i,1)){this.Dn(i,n);var H=0;n.max_sublayers_minus1>0&&(H=Object(j.a)(i,1));var G=H?0:n.max_sublayers_minus1;this.Rn(i,n,G)}return Object(j.a)(i,1),Object(j.a)(i,1)&&(Object(j.h)(i),Object(j.b)(i),this.Ln(i,n)),n},t.Sn=function(t,e,i,n){i&&(e.profile_idc=Object(j.a)(t,7),e.profile_string=Object(Ct.c)(e.profile_idc),Object(j.g)(t,1)),e.level_idc=Object(j.a)(t,8),e.level_string=Object(Ct.b)(e.level_idc),Object(j.g)(t,2),i&&this.Nn(t);for(var r=[],a=n-1;a>=0;a--)r[a]=Object(j.a)(t,1);t.bitIndex&&Object(j.g)(t,8-t.bitIndex);for(var o=n-1;o>=0;o--)r[o]&&Object(j.g)(t,1);if(i)for(var s=Object(j.a)(t,8),u=0;u<s;u++)Object(j.g)(t,32)},t.Nn=function(t){if(Object(j.a)(t,1)){Object(j.g)(t,71);var e=Object(j.a)(t,8),i=0;e>5&&(Object(j.g)(t,6),i=6),e>i&&Object(j.g)(t,e-i)}t.bitIndex&&Object(j.g)(t,8-t.bitIndex)},t.Bn=function(t,e,i){for(var n=i?0:e;n<=e;n++)Object(j.h)(t),Object(j.h)(t),Object(j.h)(t)},t.Tn=function(t,e,i,n){var r=Object(j.h)(t),a=0;e.sps_long_term_ref_pics_flag&&n<e.sps_num_ref_pic_lists[i]&&r>0&&(a=Object(j.a)(t,1));for(var o=0;o<r;o++){var s=0;if(e.sps_inter_layer_prediction_enabled_flag&&(s=Object(j.a)(t,1)),s)Object(j.h)(t);else{var u=0;if(e.sps_long_term_ref_pics_flag&&(u=Object(j.a)(t,1)),u){var c=Object(j.h)(t);((e.sps_weighted_pred_flag||e.sps_weighted_bipred_flag)&&0!=o?c:c+1)&&Object(j.g)(t,1)}else a&&Object(j.g)(t,e.sps_log2_max_pic_order_cnt_lsb_minus4+4)}}},t.Dn=function(t,e){var i=Object(j.a)(t,32),n=Object(j.a)(t,32);e.fps=n/i||0,e.general_nal_hrd_params_present_flag=Object(j.a)(t,1),e.general_vcl_hrd_params_present_flag=Object(j.a)(t,1),(e.general_nal_hrd_params_present_flag||e.general_vcl_hrd_params_present_flag)&&(Object(j.a)(t,1),e.general_du_hrd_params_present_flag=Object(j.a)(t,1),e.general_du_hrd_params_present_flag&&Object(j.g)(t,8),Object(j.g)(t,8),e.general_du_hrd_params_present_flag&&Object(j.g)(t,4),e.hrd_cpb_cnt_minus1=Object(j.h)(t))},t.Rn=function(t,e,i){for(var n=i;n<=e.max_sublayers_minus1;n++){var r=0;Object(j.a)(t,1)||(r=Object(j.a)(t,1)),r?Object(j.h)(t):(e.general_nal_hrd_params_present_flag||e.general_vcl_hrd_params_present_flag)&&0===e.hrd_cpb_cnt_minus1&&Object(j.g)(t,1),e.general_nal_hrd_params_present_flag&&this.Qn(t,e),e.general_vcl_hrd_params_present_flag&&this.Qn(t,e)}},t.Qn=function(t,e){for(var i=0;i<=e.hrd_cpb_cnt_minus1;i++)Object(j.h)(t),Object(j.h)(t),e.general_du_hrd_params_present_flag&&(Object(j.h)(t),Object(j.h)(t)),Object(j.g)(t,1)},t.Ln=function(t,e){var i=Object(j.a)(t,1),n=Object(j.a)(t,1);Object(j.a)(t,2),Object(j.a)(t,1)&&255===Object(j.a)(t,8)&&Object(j.a)(t,32),Object(j.a)(t,1)&&Object(j.a)(t,1),Object(j.a)(t,1)&&(e.color_info.colourPrimaries=Object(j.a)(t,8),e.color_info.transferCharacteristics=Object(j.a)(t,8),e.color_info.matrixCoefficients=Object(j.a)(t,8),e.color_info.colorRange=Object(j.a)(t,1)?et.b.AVCOL_RANGE_JPEG:et.b.AVCOL_RANGE_MPEG),Object(j.a)(t,1)&&(i&&!n||Object(j.h)(t),Object(j.h)(t))},t}(),It=function(){function t(){}return t.parse=function(t){var e=st(t),i=Object(j.c)(e);return Object(j.g)(i,16),{vps_id:Object(j.a)(i,4),data:new Uint8Array(t)}},t}(),Rt="video-config",wt=function(){function t(){}return t.isParamSetsReady=function(t){return"nalus"in t?!(!t.nalus||!t.nalus.length):!!t.spsList.length},t.parseAV1C=function(t,e,i){var n;t.i(Rt,"parse av1c");var r=null==(n=at.parseOBU(e.subarray(4),i)[0])?void 0:n.content;return{marker:e[0]>>7&1,version:127&e[0],seq_profile:e[1]>>5&7,seq_level_idx_0:31&e[1],seq_tier_0:e[2]>>7&1,high_bitdepth:e[2]>>6&1,twelve_bit:e[2]>>5&1,monochrome:e[2]>>4&1,chroma_subsampling_x:e[2]>>3&1,chroma_subsampling_y:e[2]>>2&1,chroma_sample_position:3&e[2],initial_presentation_delay_present:e[3]>>4&1,sh:r}},t.parseAVCC=function(t,e){var i=e[0],n=e[1],r=e[2],a=e[3];if(1===i&&0!==n){var o=1+(3&e[4]);if(3===o||4===o){var s=31&e[5];if(0!==s){s>1&&t.w(Rt,"H264 SPS count: "+s);for(var u,c,l=6,h=[],d=[],f=0;f<s;f++){var p=Object(F.f)(e,l);if(l+=2,0!==p){var _=e.subarray(l,l+p);l+=p,h[(u=pt.parse(_)).sps_id]=u}}var v=e[l];if("number"==typeof v){if(0!==v){v>1&&t.w(Rt,"H264 PPS count: "+v),l++;for(var A=0;A<v;A++){var g=Object(F.f)(e,l);l+=2;var m=e.subarray(l,l+g);d[(c=ft.parse(m)).pps_id]=c,0!==g&&(l+=g)}return{version:i,avcProfile:n,profileCompatibility:r,avcLevel:a,naluLengthSize:o,paramSets:{spsList:h,ppsList:d,sps:u,pps:c}}}t.i(Rt,"Invalid H264 PPS count: "+v)}}else t.i(Rt,"Invalid H264 SPS count: "+s)}else t.i(Rt,"MP4: Strange NaluLengthSizeMinusOne: "+(o-1))}else t.i(Rt,"Invalid AVCDecoderConfigurationRecord")},t.parseHVCC=function(t,e,i){void 0===i&&(i=M.c.hevc);var n=22;n++;for(var r,a,o,s,u=[],c=[],l=[];n<e.byteLength;){var h=63&e[n];if(n+=1,e.byteLength-n<=2)break;var d=Object(F.f)(e,n);n+=2;for(var f=0;f<d&&!(e.byteLength-n<=2);f++){var p=Object(F.f)(e,n);if(n+=2,0!==p){var _=e.subarray(n,n+p);if(_.byteLength!==p)break;h===V.a.HEVC_NAL_VPS?(t.v(Rt,"VPS lengh "+p),l[(o=yt.parse(t,_)).vps_id]=o):h===V.a.HEVC_NAL_SPS?(t.v(Rt,"SPS lengh "+p),u[(r=mt.parse(_,i)).sps_id]=r):h===V.a.HEVC_NAL_PPS?(t.v(Rt,"PPS lengh "+p),c[(a=_t.parse(_)).pps_id]=a):h===V.a.HEVC_NAL_SEI_PREFIX||h===V.a.HEVC_NAL_SEI_SUFFIX?(t.i(Rt,"sei "+h+" in hvcc"),s||(s=[]),s.push({type:h,data:_})):t.i(Rt,"found "+h+" nalu in hvcc."),n+=p}}}return{paramSets:{vpsList:l,spsList:u,ppsList:c,seiList:s,sps:r,pps:a}}},t.xn=function(t,e,i){e+=3+(63&t[e]);var n=Object(j.c)(t);n.byteIndex=e;for(var r=[],a=i-2;a>=0;a--)r[a]=Object(j.a)(n,1);for(var o=i;o<=8&&i>1;o++)Object(j.g)(n,1);for(var s=i-2;s>=0;s--)r[s]&&Object(j.g)(n,8);return(e=n.byteIndex)+(1+4*t[n.byteIndex])},t.parseVvcC=function(t,e){var i=4,n=1&e[i];if(i++,n){var r=e[++i]>>4&7;i+=2,i=this.xn(e,i,r),i+=6}i++;for(var a,o,s,u=[],c=[],l=[];i<e.byteLength;){var h=31&e[i];i+=1;var d=1;h!==dt.a.VVC_NAL_UNIT_DCI&&h!==dt.a.VVC_NAL_UNIT_OPI&&(d=Object(F.f)(e,i),i+=2);for(var f=0;f<d;f++){var p=Object(F.f)(e,i);i+=2;var _=e.subarray(i,i+p);if(_.byteLength!==p)break;i+=p,h===dt.a.VVC_NAL_UNIT_VPS?(t.v(Rt,"VPS lengh "+p),s=It.parse(_),l.push(s)):h===dt.a.VVC_NAL_UNIT_SPS?(t.v(Rt,"SPS lengh "+p),a=Tt.parse(_),u.push(a)):h===dt.a.VVC_NAL_UNIT_PPS&&(t.v(Rt,"PPS lengh "+p),o=Et.parse(_),c.push(o))}}return{paramSets:{vpsList:l,spsList:u,ppsList:c,sps:a,pps:o}}},t.parseBV2C=function(t,e){var i=18;i++;for(var n,r,a,o=[],s=[],u=[];i<e.byteLength;){var c=31&e[i];i+=1;var l=1;c!==dt.a.VVC_NAL_UNIT_DCI&&c!==dt.a.VVC_NAL_UNIT_OPI&&(l=Object(F.f)(e,i),i+=2);for(var h=0;h<l;h++){var d=Object(F.f)(e,i);i+=2;var f=e.subarray(i,i+d);if(f.byteLength!==d)break;i+=d,c===dt.a.VVC_NAL_UNIT_VPS?(t.v(Rt,"VPS lengh "+d),a=It.parse(f),u.push(a)):c===dt.a.VVC_NAL_UNIT_SPS?(t.v(Rt,"SPS lengh "+d),n=Tt.parse(f),o.push(n)):c===dt.a.VVC_NAL_UNIT_PPS&&(t.v(Rt,"PPS lengh "+d),r=Et.parse(f),s.push(r))}}return{paramSets:{vpsList:u,spsList:o,ppsList:s,sps:n,pps:r}}},t.parseKvLC=function(t,e){var i=4;i++,i++;for(var n,r,a,o=[],s=[],u=[],c=[];i<e.byteLength;){var l=31&e[i];i+=1;var h=1;l!==dt.a.VVC_NAL_UNIT_DCI&&l!==dt.a.VVC_NAL_UNIT_OPI&&(h=Object(F.f)(e,i),i+=2);for(var d=0;d<h;d++){var f=Object(F.f)(e,i);i+=2;var p=e.subarray(i,i+f);if(p.byteLength!==f)break;i+=f,l===dt.a.VVC_NAL_UNIT_VPS?(t.v(Rt,"VPS lengh "+f),a=It.parse(p),u.push(a)):l===dt.a.VVC_NAL_UNIT_SPS?(t.v(Rt,"SPS lengh "+f),n=Tt.parse(p),o.push(n)):l===dt.a.VVC_NAL_UNIT_PPS&&(t.v(Rt,"PPS lengh "+f),r=Et.parse(p),s.push(r)),c.push({type:l,data:p})}}return{paramSets:{vpsList:u,spsList:o,ppsList:s,sps:n,pps:r,nalus:c}}},t.generateAV1C=function(t,e){t.i(Rt,"generate av1c");var i=new Uint8Array(5+e.data.length);return i[0]=129,i[1]=(e.seq_profile<<5)+(31&e.seq_level_idx_0),i[2]=(e.seq_tier_0<<7)+(e.high_bitdepth<<6)+(e.twelve_bit<<5)+(e.monochrome<<4)+(e.chroma_subsampling_x<<3)+(e.chroma_subsampling_y<<2)+(3&e.chroma_sample_position),i[3]=0,i[4]=8,i.set(e.data,5),i},t.generateAVCC=function(t,e){if(t.i(Rt,"generate avcc"),e.sps&&e.pps&&e.spsList.length&&e.ppsList.length){var i=e.spsList.filter((function(t){return!!t})),n=e.ppsList.filter((function(t){return!!t})),r=i.reduce((function(t,e){return t+e.data.byteLength}),0),a=n.reduce((function(t,e){return t+e.data.byteLength}),0),o=new Uint8Array(7+r+a+2*i.length+2*n.length);o.set([1,e.sps.data[1],e.sps.data[2],e.sps.data[3],255,224|i.length],0);var s=6;return i.forEach((function(t){o[s]=t.data.byteLength>>8&255,o[s+1]=255&t.data.byteLength,o.set(t.data,s+2),s+=2+t.data.byteLength})),o[s]=n.length,s++,n.forEach((function(t){o[s]=t.data.byteLength>>8&255,o[s+1]=255&t.data.byteLength,o.set(t.data,s+2),s+=2+t.data.byteLength})),o}},t.generateHVCC=function(t,e){if(t.i(Rt,"generate hvcc"),e.sps&&e.pps&&e.spsList.length&&e.ppsList.length&&e.vpsList.length){var i=e.spsList.filter((function(t){return!!t})),n=e.ppsList.filter((function(t){return!!t})),r=e.vpsList.filter((function(t){return!!t})),a=i.reduce((function(t,e){return t+e.data.byteLength}),0)+n.reduce((function(t,e){return t+e.data.byteLength}),0)+r.reduce((function(t,e){return t+e.data.byteLength}),0)+2*(i.length+n.length+r.length),o=e.sps.ptl,s=new Uint8Array(32+a),u=new DataView(s.buffer,0);s[0]=1,s[1]=(192&o.general_ptl.profile_space)+((1&o.general_ptl.tier_flag)<<5)+o.general_ptl.profile_idc&31,u.setUint32(2,o.general_ptl.profile_compatibility);for(var c=0;c<6;c++)u.setUint8(c+6,o.general_ptl.constraint_indicator[c]||0);u.setUint8(12,o.general_ptl.level_idc);var l=1;e.pps.entropy_coding_sync_enabled_flag&&e.pps.tiles_enabled_flag?l=0:e.pps.entropy_coding_sync_enabled_flag?l=3:e.pps.tiles_enabled_flag&&(l=2),s[13]=240+(3840&e.sps.min_spatial_segmentation_idc),s[14]=255&e.sps.min_spatial_segmentation_idc,s[15]=252+(3&l),s[16]=252+(3&e.sps.chroma_format_idc),s[17]=248+(e.sps.bit_depth_luma-8&7),s[18]=248+(e.sps.bit_depth_chroma-8&7),s[21]=3,s[22]=3;var h=23;return[{nalus:r,type:V.a.HEVC_NAL_VPS},{nalus:i,type:V.a.HEVC_NAL_SPS},{nalus:n,type:V.a.HEVC_NAL_PPS}].forEach((function(t){s[h]=t.type,h++,u.setUint16(h,t.nalus.length),h+=2,t.nalus.forEach((function(t){u.setUint16(h,t.data.byteLength),h+=2,s.set(t.data,h),h+=t.data.byteLength}))})),s}},t.onH264SPSNalu=function(t,e){var i=!1,n=pt.parse(t);return e.sps&&Object(F.b)(n.data,e.sps.data)||(i=!0),e.sps=n,e.spsList=[n],i},t.onH264PPSNalu=function(t,e){var i=!1,n=ft.parse(t);return e.pps&&Object(F.b)(n.data,e.pps.data)||(i=!0),e.pps=n,e.ppsList=[n],i},t.onHEVCVPSNalu=function(t,e,i){var n=!1,r=yt.parse(t,e),a=i.vps;return a&&Object(F.b)(r.data,a.data)||(n=!0),i.vps=r,i.vpsList=[r],n},t.onHEVCSPSNalu=function(t,e,i){var n=!1,r=mt.parse(t,i);return e.sps&&Object(F.b)(r.data,e.sps.data)||(n=!0),e.sps=r,e.spsList=[r],n},t.onHEVCPPSNalu=function(t,e){var i=!1,n=_t.parse(t);return e.pps&&Object(F.b)(n.data,e.pps.data)||(i=!0),e.pps=n,e.ppsList=[n],i},t.onVVCVPSNalu=function(t,e){var i=!1,n=It.parse(t),r=e.vps;return r&&Object(F.b)(n.data,r.data)||(i=!0),e.vps=n,e.vpsList=[n],i},t.onVVCSPSNalu=function(t,e){var i=!1,n=Tt.parse(t);return e.sps&&Object(F.b)(n.data,e.sps.data)||(i=!0),e.sps=n,e.spsList=[n],i},t.onVVCPPSNalu=function(t,e){var i=!1,n=Et.parse(t);return e.pps&&Object(F.b)(n.data,e.pps.data)||(i=!0),e.pps=n,e.ppsList=[n],i},t.hevDecoderConfigToSample=function(e,i){return{units:t.hevDecoderConfigToNalu(e),dts:0,cts:0,pts:0,originDTS:i,originPTS:i,key:!1,size:0}},t.hevDecoderConfigToNalu=function(t){var e=[];return t.seiList&&t.seiList.forEach((function(t){t&&e.push(t)})),t.vpsList.forEach((function(t){t&&e.push({type:V.a.HEVC_NAL_VPS,data:t.data})})),t.spsList.forEach((function(t){t&&e.push({type:V.a.HEVC_NAL_SPS,data:t.data})})),t.ppsList.forEach((function(t){t&&e.push({type:V.a.HEVC_NAL_PPS,data:t.data})})),e},t.vvcDecoderConfigToNalu=function(t){if(t.nalus)return t.nalus;var e=[];return t.vpsList.forEach((function(t){t&&e.push({type:dt.a.VVC_NAL_UNIT_VPS,data:t.data})})),t.spsList.forEach((function(t){t&&e.push({type:dt.a.VVC_NAL_UNIT_SPS,data:t.data})})),t.ppsList.forEach((function(t){t&&e.push({type:dt.a.VVC_NAL_UNIT_PPS,data:t.data})})),e},t.avcDecoderConfigToNalu=function(t){var e=[];return t.spsList.forEach((function(t){t&&e.push({type:B.H264_NAL_SPS,data:t.data})})),t.ppsList.forEach((function(t){t&&e.push({type:B.H264_NAL_PPS,data:t.data})})),e},t.vvcDecoderConfigToSample=function(e,i){return{units:t.vvcDecoderConfigToNalu(e),dts:0,cts:0,pts:0,originDTS:i,originPTS:i,key:!1,size:0}},t.getDPB264=function(t){return t.sps?Math.min(Math.max(t.sps.ref_frame_count,2),16):16},t.getDPBHEVC=function(t){if(!t.sps)return 16;var e=t.sps.temporal_layer.reduce((function(t,e){return Math.max(e.max_dec_pic_buffering,t)}),2);return Math.min(e,16)},t.getDPBLenAV1=function(){return 8},t}(),Lt="video-track-helper",Dt=function(){function t(){}return t.updateAV1Track=function(t,e,i,n){i&&(e.codedWidth=i.width,e.codedHeight=i.height,e.codec=i.codec,e.profile=i.profile_string,e.level=i.level_string,e.chromaFormat=i.chroma_format_string,e.bitDepth=i.bit_depth_luma,e.colorInfo=i.color_info,e.dpb=wt.getDPBLenAV1(),e.decConf=n||wt.generateAV1C(t,i))},t.updateAVCTrack=function(t,e,i,n){if(i.sps){var r=i.sps;e.codedWidth=r.codec_size.width,e.codedHeight=r.codec_size.height,e.sar=D()({},r.sar),r.frame_rate.fixed&&0!==r.frame_rate.fps&&(e.fps=r.frame_rate.fps,e.sampleDuration=e.inputTimescale/e.fps),e.codec=r.codec,e.profile=r.profile_string,e.level=r.level_string,e.chromaFormat=r.chroma_format_string,e.bitDepth=r.bit_depth_luma,e.colorInfo=r.color_info,e.dpb=wt.getDPB264(i),e.fps&&(e.sampleDuration=Math.floor(e.inputTimescale/e.fps)),e.decConf=n||wt.generateAVCC(t,i)}},t.updateHEVCTrack=function(t,e,i,n){if(i.sps){var r=i.sps,a=i.vps;e.codedWidth=r.width,e.codedHeight=r.height,e.sar=D()({},r.sar),e.codec=r.codec,e.profile=r.profile_string||(null==a?void 0:a.ptl.general_ptl.profile_string)||"",e.level=r.level_string||(null==a?void 0:a.ptl.general_ptl.level_string)||"",e.chromaFormat=r.chroma_format_string,e.bitDepth=r.bit_depth_luma,e.fps=r.fps||(null==a?void 0:a.fps)||0,e.colorInfo=r.color_info,e.dpb=wt.getDPBHEVC(i),e.fps&&(e.sampleDuration=Math.floor(e.inputTimescale/e.fps)),e.decConf=n||wt.generateHVCC(t,i)}},t.updateVVCTrack=function(t,e,i,n){if(i.sps){var r=i.sps;e.codedWidth=r.width,e.codedHeight=r.height,e.codec=r.codec,e.profile=r.profile_string||"",e.level=r.level_string||"",e.chromaFormat=r.chroma_format_string,e.bitDepth=r.bitdepth,e.fps=r.fps||0,e.colorInfo=r.color_info,e.decConf=n}},t.onAV1Detected=function(t,e,i,n,r){return t.i(Lt,"detected av1: "+n.av1+" enabled: "+r),!1!==r&&n.av1?(e.outputRaw=!n.av1,e.active=!0):(t.i(Lt,"AV1 found, disabled."),e.active=!1),e.active},t.onAVCDetected=function(t,e,i,n,r){return t.i(Lt,"detected avc. enabled: "+r),e.active=!1!==r,e.active},t.onHEVCDetected=function(t,e,i,n,r){return t.i(Lt,"detected hevc: "+n.hevc+" wasm: "+i.wasmDecoderEnabled+" enabled: "+r),!1!==r&&(i.wasmDecoderEnabled||n.hevc)?(e.outputRaw=!n.hevc||i.preferDecoder===M.d.wasm,e.active=!0):(t.i(Lt,"HEVC found, disabled. wasmDec:"+i.wasmDecoderEnabled),e.active=!1),e.active},t.onKVCDetected=function(t,e,i,n){return t.i(Lt,"detected kvc wasm: "+i.wasmDecoderEnabled+" enabled: "+n),!1===n?e.active=!1:(e.active=i.wasmDecoderEnabled,e.outputRaw=e.active),e.active||t.i(Lt,"KVC found, disabled. wasmDec:"+i.wasmDecoderEnabled),e.active},t.onVVCDetected=function(t,e,i,n){return t.i(Lt,"detected vvc wasm: "+i.wasmDecoderEnabled+" enabled: "+n),!1===n?e.active=!1:(e.active=i.wasmDecoderEnabled,e.outputRaw=e.active),e.active||t.i(Lt,"VVC found, disabled. wasmDec:"+i.wasmDecoderEnabled),e.active},t}(),St="flv-demuxer",Ot=function(t){function e(e,i,n,r,a){var o;return e.i(St,"constructor"),(o=t.call(this,e,i,n,r,a)||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 J(e,o.Ai),o}_()(e,t),e.probe=function(t){return t.byteLength>=3&&70===t[0]&&76===t[1]&&86===t[2]};var i=e.prototype;return i.append=function(t,e,i,n,r,a){var o=this;if(void 0===r&&(r=!1),!t.byteLength&&r)return this.xe?this.Kn():r?this.Zn():this.Ke(),this.Fn.reset(),void this.Ai.emit(N.a.PARSED_DATA,{extra:this._i});this.Fe=a;var s=this.Fn.append(t),u=this.Fn.trackInfo;u&&(void 0===this.Mi.active&&(this.Mi.active=!1!==this.Ye()&&u.hasVideo,this.Mi.active||(this.xe=!1)),void 0===this.Ne.active&&(this.Ne.active=!1!==this.Ge()&&u.hasAudio));var c=s.tags;this.Ue||(this.Ue={timeOffset:e,contiguous:i,accurateTimeOffset:n}),c.length&&(c.forEach((function(t){t.tagType===U.j.VIDEO&&o.Mi.active&&(o.Yn||(o.Ne.samples.length&&o.Wn(),o.Yn=!0),o.Xn(t),!o.xe&&o.Mi.samples.reduce((function(t,e){return t+e.size}),0)>A.o&&(o.Ci.i(St,"max size remux"),o.Ke())),t.tagType===U.j.AUDIO&&o.Ne.active&&o.zn(t),t.tagType===U.j.SCRIPT&&o.Jn(t)})),this.xe||this.Ke(!(!r||!this.Mi.samples.length&&!this.Ne.samples.length)),r&&((this.Mi.samples.length||this.Ne.samples.length)&&this.Zn(),this.Fn.reset(),this.Ai.emit(N.a.PARSED_DATA,{extra:this._i})))},i.flush=function(){this.Ci.i(St,"flush"),this.Zn(),this.Ue=void 0},i.resetInitSegment=function(e){this.Ci.i(St,"reset init",e),t.prototype.resetInitSegment.call(this,e),this.Vn=e.duration,this.Hn=[],this.Fn.reset()},i.He=function(){t.prototype.He.call(this,1/0,A.h)},i.Wn=function(){var t;this.Ci.i(St,"discontinuity"),this.Zn(),this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),null==(t=this.Qe)||t.reset()},i.qn=function(t,e,i){var n=i<e||i-e>=A.p;return n&&this.Ci.i(St,"time exception. "+t+" last: "+e+" current:"+i+" offset: "+(i-e)/A.h+"s"),n?i-e:0},i.$n=function(t,e,i){var n=this.qn(t,e,i);if(n){if(this.Ci.i(St,"time exception. waiting next key frame."),this.xe=!0,!this.Hn.length&&this.Mi.active&&"number"==typeof this.Le||this.Ne.active&&"number"==typeof this.Re){if(this.Hn.length&&(this.Hn[0].diff<0||this.Hn[0].diff/A.h>30))return this.es(),void this.Ci.i(St,"time exception. fix. "+t+", diff: "+n);this.ns()?this.Ci.i(St,"time exception. audio only"):(this.Ci.i(St,"time exception. remux. "+t+", diff: "+n),this.Ke(!0))}this.Hn.push({type:t,diff:n})}},i.Kn=function(){this.xe&&(this.Ci.v(St,"key frame"),this.Hn.length?(this.Mi.active&&this.Mi.samples.length>1||this.ns())&&(this.Ci.i(St,"time exception. fix on key frame.",this.Mi.samples.length,this.Ne.samples.length),this.es()):this.Ke(!0))},i.es=function(){(this.Hn.length>1||this.ns())&&(this.ss(this.Mi),this.ss(this.Ne)),this.De.flush();var t=this.De.getLastDTS(),e=Math.max(t.video||0,t.audio||0);this.Ci.i(St,"fix offset",e,t),this.Ue={accurateTimeOffset:!0,contiguous:!this.Ve,timeOffset:e},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},i.ss=function(t){var e=t.samples;if(e.length>1){var i=t.sampleDuration||1,n=e[e.length-1];this.Ci.i(St,"reset "+t.type+" track samples time. sampleDuration:"+i+" dts:"+n.dts);for(var r=e.length-2;r>=0;r--){var a=e[r],o=a.pts-a.dts;a.dts=n.dts-i,a.pts=a.dts+o,n=a}}},i.Jn=function(t){if(t.body){var e=q.parseMetadata(this.Ci,t.body.buffer);if(Object.prototype.hasOwnProperty.call(e,"onMetaData")){var i=e.onMetaData&&"object"==typeof e.onMetaData?e.onMetaData:{};if("number"==typeof i.duration&&(this.Vn=this.Vn||i.duration),"number"==typeof i.framerate&&i.framerate>0&&(this.Mi.fps=this.Mi.fps||i.framerate,this.Mi.sampleDuration=Math.floor(A.h/this.Mi.fps)),"number"==typeof i.videodatarate&&(this.Mi.bitrate=i.videodatarate),"number"==typeof i.audiodatarate&&(this.Ne.bitrate=i.audiodatarate),i.keyframes&&"object"==typeof i.keyframes){var n=i.keyframes;if(n.filepositions&&Array.isArray(n.filepositions)&&n.times&&Array.isArray(n.times)&&n.filepositions.length===n.times.length){var r=[];n.times.forEach((function(t,e){r.push({time:t,position:n.filepositions[e]})})),i.keyframes=n}}this.Ci.i(St,"Parsed onMetaData"),this.Ai.emit(N.a.METADATA,i)}}},i.Xn=function(t){if(t.body&&0!==t.body.length){var e=t.body[0],i=e>>4&8;t.frameType=e>>4&7,i?(this.Mi.enhancedFlv=!0,this.rs(t)):this.hs(t)}},i.rs=function(t){if(t.body&&0!==t.body.length){var e=15&t.body[0],i=Object(F.a)(t.body,1,4),n=5;if("hvc1"===i)t.codecId=12,e===U.d?this.os(t,n):e!==U.a&&e!==U.b||(e===U.a&&(t.cts=Object(F.d)(t.body,n),n+=3),this.us(t,n));else{if("av01"!==i)return void this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Flv: Unsupported codec in video frame enhanced: "+i));t.codecId=13,e===U.d?this.os(t,n):e===U.c||e===U.a&&this.us(t,n)}}},i.hs=function(t){if(t.body&&0!==t.body.length){var e=U.h;if(t.codecId=15&t.body[0],7===t.codecId||12===t.codecId||13===t.codecId){var i=t.body[1];if(t.cts=1===i?Object(F.d)(t.body,2):0,0===i)this.os(t,e);else if(1===i)this.us(t,e);else if(2!==i)return void this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Flv: Invalid video packet type "+i))}else this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Flv: Unsupported codec in video frame: "+t.codecId))}},i.os=function(t,e){this.Ci.i(t,"parse video tag condec conf. id: "+t.codecId);var i=this.Ye();7===t.codecId?(this.Mi.outputRaw&&(this.Wn(),this.Mi.outputRaw=!1),Dt.onAVCDetected(this.Ci,this.Mi,this.di,this.li,i),this.cs(t,e)):12===t.codecId?(Dt.onHEVCDetected(this.Ci,this.Mi,this.di,this.li,i),this.fs(t,e)):13===t.codecId&&(Dt.onAV1Detected(this.Ci,this.Mi,this.di,this.li,i),this.As(t,e)),this.Mi.duration=this.Vn*A.h},i.us=function(t,e){this.Mi.codec&&this.vs(t,e)},i.fs=function(t,e){if(t.body){var i,a=this.Mi,o=t.body.subarray(e,t.body.byteLength),s=wt.parseHVCC(this.Ci,o);if(s&&s.paramSets.spsList.length){if(this.Pn=s.paramSets,a.decConf&&!Object(F.b)(a.decConf,o)&&this.Wn(),a.codecType!==M.c.hevc&&(a.codecType=M.c.hevc,this.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{codecType:M.c.hevc,enabled:!!a.active,decoder:this.Mi.outputRaw?M.d.wasm:M.d.buildin,bitDepth:a.bitDepth,timeOffset:(null==(i=this.Ue)?void 0:i.timeOffset)||0})),Dt.updateHEVCTrack(this.Ci,a,s.paramSets),this.Mi.outputRaw){var u=wt.hevDecoderConfigToSample(s.paramSets,t.timestamp);this.Ai.emit(N.a.RAW_DATA,{type:n.d.decoderConfig,samples:Q([u],a.inputTimescale),extra:this._i})}}else this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Invalid HEVCDecoderConfigurationRecord"))}},i.As=function(t,e){if(t.body){var i=this.Mi,n=t.body.subarray(e,t.body.byteLength);this.Gn=at.createCtx();var a,o=wt.parseAV1C(this.Ci,n,this.Gn);if(o)i.decConf&&!Object(F.b)(i.decConf,n)&&this.Wn(),i.codecType!==M.c.av1&&(i.codecType=M.c.av1,this.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:M.d.buildin,codecType:M.c.av1,timeOffset:(null==(a=this.Ue)?void 0:a.timeOffset)||0})),o.sh&&Dt.updateAV1Track(this.Ci,i,o.sh,n);else this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Invalid AV1DecoderConfigurationRecord"))}},i.cs=function(t,e){if(t.body){var i,n=t.body.subarray(e,t.body.byteLength),a=this.Mi,o=wt.parseAVCC(this.Ci,t.body.subarray(e,t.body.byteLength));if(o&&o.paramSets.spsList.length)this.Pn=o.paramSets,a.decConf&&!Object(F.b)(a.decConf,n)&&this.Wn(),a.codecType!==M.c.h264&&(a.codecType=M.c.h264,this.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:M.d.buildin,codecType:M.c.h264,timeOffset:(null==(i=this.Ue)?void 0:i.timeOffset)||0})),Dt.updateAVCTrack(this.Ci,a,o.paramSets,n);else this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Invalid AVCDecoderConfigurationRecord"))}},i.vs=function(t,e){var i=this;if(t.body){var n=this.Mi,r=t.body.buffer,a=t.body.byteLength-e,o=new DataView(r,e,a),s=[],u=0,c=this.Un,l=t.timestamp,h=t.cts,d=!1;l===this.Le&&(h+=1);var f=l+h,p=1===t.frameType;p&&this.Kn(),"number"==typeof this.Le&&this.$n(M.o.VIDEO,this.Le,l);var _=[],v=[];if(13===t.codecId)this.Gn||(this.Gn=at.createCtx()),at.parseOBU(t.body.subarray(e),this.Gn).forEach((function(t){t.obu_type===w.AV1_OBU_SEQUENCE_HEADER&&!n.decConf&&t.content&&Dt.updateAV1Track(i.Ci,n,t.content),s.push({type:0,data:t.data})}));else for(;u<a;){if(u+4>=a){this.Ci.v(St,"Malformed Nalu near timestamp "+l+", offset = "+u+", dataSize = "+a);break}var A=o.getUint32(u);if(3===c&&(A>>>=8),A>a-c)return void this.Ci.v(St,"Malformed Nalus near timestamp "+l+", NaluSize > DataSize!");var g=new Uint8Array(r,e+u+4,c+A-4),m=0;if(7===t.codecId)if(this.Pn||(this.Pn={spsList:[],ppsList:[]}),(m=31&o.getUint8(u+c))===B.H264_NAL_IDR_SLICE)p=!0;else if(m===B.PRIV_NAL_MAGIC_H264)try{v.push(ot.parse(g,!0))}catch(t){this.Ci.w(St,"PrivNal parse error "+t)}else m===B.H264_NAL_SEI?_.push.apply(_,ut.parse(g.subarray(1))):m===B.H264_NAL_SPS?wt.onH264SPSNalu(g,this.Pn)&&(d=!0):m===B.H264_NAL_PPS&&wt.onH264PPSNalu(g,this.Pn)&&(d=!0);else if(12===t.codecId)if(this.Pn||(this.Pn={vpsList:[],spsList:[],ppsList:[]}),(m=(126&o.getUint8(u+c))>>1)===V.a.HEVC_NAL_IDR_W_RADL||m===V.a.HEVC_NAL_IDR_N_LP||m===V.a.HEVC_NAL_CRA_NUT)p=!0;else if(m===V.a.PRIV_NAL_MAGIC_HEVC)try{v.push(ot.parse(g,!1))}catch(t){this.Ci.w(St,"PrivNal parse error "+t)}else m===V.a.HEVC_NAL_SEI_PREFIX||m===V.a.HEVC_NAL_SEI_SUFFIX?_.push.apply(_,ut.parse(g.subarray(2))):m===V.a.HEVC_NAL_VPS?wt.onHEVCVPSNalu(this.Ci,g,this.Pn)&&(d=!0):m===V.a.HEVC_NAL_SPS?wt.onHEVCSPSNalu(g,this.Pn,n.codecType)&&(d=!0):m===V.a.HEVC_NAL_PPS&&wt.onHEVCPPSNalu(g,this.Pn)&&(d=!0);var b={type:m,data:g};s.push(b),u+=c+A}if(s.length){var y={units:s,dts:l,cts:h,pts:f,originDTS:t.timestamp,originPTS:t.timestamp+t.cts,key:p,parseTime:performance?performance.now()/1e3:0,size:s.reduce((function(t,e){return t+e.data.length}),0)};_.length&&(y.sei={sei:_,streamTimestamp:t.timestamp}),v.length&&(y.privNal={info:v,streamTimestamp:t.timestamp}),this.$e(y)}this.Le=l,d&&this.Pn&&wt.isParamSetsReady(this.Pn)&&(this.Ci.i(St,"dec param sets update."),n.codecType===M.c.h264?Dt.updateAVCTrack(this.Ci,n,this.Pn):W(n.codecType)&&Dt.updateHEVCTrack(this.Ci,n,this.Pn))}},i.zn=function(t){if(t.body&&0!==t.body.length){var e=t.body[0];if(t.body.byteLength<=1)this.Ci.v(St,"Flv: Invalid audio packet, missing SoundData payload!");else{var i=this.Ne,n=e>>4;if(10===n)i.codecType=M.c.aac;else{if(2!==n&&14!==n)return this.Ci.w(St,"audio unsupported codec "+n),void(i.active=!1);i.codecType=M.c.mp3}if(i.codecType===M.c.aac){var r=t.body[1];if(0===r){if(t.body.byteLength<4)return;var a=t.body.subarray(2,4);return void this.ds(a)}if(1!==r)return void this.Ci.v(St,"Flv: Unsupported AAC data type "+r);if(!i.configParsed){var o,s,u=[5500,11025,22050,44100][e>>2&3];if(u<11025)return;var c=1+(1&e);this.Ci.i(St,"missing AACPacketType 0. generate samplerate:"+u+" channel:"+c+" codec:"+(null==(o=this._i)?void 0:o.audioCodec));var l=v.b(u,c,null==(s=this._i)?void 0:s.audioCodec);if(!l)return void this.Ci.v(St,"generate ASC fail.");this.ds(l)}}i.duration=this.Vn*A.h;var h,d=i.codecType===M.c.aac?2:1,f=t.timestamp;if(i.sampleDuration&&this.Mi.active&&"number"==typeof this.Re&&this.$n(M.o.AUDIO,this.Re,t.timestamp),i.codecType===M.c.aac){var p=t.body.subarray(2);if(h={unit:p,dts:f,pts:f,originDTS:f,originPTS:f,parseTime:self.performance?performance.now()/1e3:0},p.length>2&&255===p[0]&&p[1]>>4==15){this.Ci.i(St,"adts header detected.");var _=v.a(this.Ci,i,p,0,f,0,f);_&&(h=_.sample)}else i.samples.push(h);if(this.di.enableAacPriv&&"number"==typeof i.aacSampleingIndex&&"number"==typeof i.aot){var g=v.h(this.Ci,h.unit,i.aacSampleingIndex,i.aot);g&&(h.aacPriv=[{payload:g.priv,streamTimestamp:t.timestamp}])}}else if(i.codecType===M.c.mp3){var m;h=null==(m=C(i,t.body,d,f,0))?void 0:m.sample}this.Re=f}}},i.ds=function(t){var e,i=this.Ne;(v.g(i,t)||!i.configParsed)&&i.codec&&i.samples.length&&this.Wn(),v.d(this.Ci,i,this.Ai,t,n.a.ASC,null==(e=this._i)?void 0:e.audioCodec)},i.Zn=function(){this.Hn.length&&(this.Mi.active&&this.Mi.samples.length>1||this.ns())?(this.Ci.i(St,"time exception. fix on remux all.",this.Mi.samples.length,this.Ne.samples.length),this.es()):this.Ke(!0)},i.Ke=function(t){void 0===t&&(t=!1);var e=this.Ne,i=this.Mi;this.We(e,i)&&(this.Ze(e,i),this.Xe(e,i,t)&&this.qe(e,i,t,n.b.FLV))},i.Je=function(t){return t.samples.length?this.Hn.reduce((function(t,e){return t||e.type===M.o.VIDEO}),!1)?t.samples.length*(t.sampleDuration||A.h/A.d)/t.inputTimescale:(t.samples[t.samples.length-1].dts-t.samples[0].dts)/t.inputTimescale:0},i.ns=function(){var t;return!(!this.di.isLive&&void 0!==this.di.isLive||!this.Ve||null!=(t=this.Ue)&&t.contiguous||!this.Mi.active||this.Mi.samples.length||!(this.Ne.samples.length>0))},f()(e,null,[{key:"probeSize",get:function(){return 188}}])}(P),Nt=i(38),kt="ivf-demuxer",xt=function(t){function e(e,i,n,r,a){var o;return e.i(kt,"constructor"),(o=t.call(this,e,i,n,r,a)||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}_()(e,t),e.probe=function(t){return t.length>4&&68===t[0]&&75===t[1]&&73===t[2]&&70===t[3]};var i=e.prototype;return i.resetInitSegment=function(e){this.He(e.duration),t.prototype.resetInitSegment.call(this,e),this.ls=0,this.cn=this.gs,this.un=8},i.append=function(t,e,i,n,r){for(this.Ue||(this.Ue={timeOffset:e,contiguous:i,accurateTimeOffset:n}),this._t.put(t);this._t.unreadLen>=this.un;)this.cn();this.Ke(r)},i.He=function(e){t.prototype.He.call(this,e),this.Mi.active=this.Ye(),this.Ne.active=!1},i.gs=function(){if(!(this._t.unreadLen<8)){var t=this._t.get(8);if(t)if(e.probe(t)){var i=Object(F.f)(t,6,!0);this.un=i-8,this.cn=this.ys}else this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,"ivf start code error"))}},i.ys=function(){if(!(this._t.unreadLen<this.un)){var t=this._t.get(this.un),e=this.Mi;if(t&&e){var i=Object(F.a)(t,0,4);if("AV01"===i){e.codecType=M.c.av1,e.codedWidth=Object(F.f)(t,4,!0),e.codedHeight=Object(F.f)(t,6,!0);var n=Object(F.h)(t,8,!0),a=Object(F.h)(t,12,!0),o=Object(F.h)(t,16,!0);e.inputTimescale=n/a,e.duration=o,this.Ci.i(kt,"head. w: "+e.codedWidth+", h:"+e.codedHeight+", den:"+n+", num:"+a+", duration:"+e.duration),n&&a||this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,"ivf head den: "+n+", num: "+a));var s={duration:e.duration/e.inputTimescale,keyframes:[{time:0,position:this.un}]};this.Ai.emit(N.a.METADATA,s),this.cn=this._s,this.un=12}else this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.UNSUPPORTED,"ivf "+i+" unsupported"))}}},i._s=function(){if(!(this._t.unreadLen<this.un)){var t=this._t.get(this.un);if(t){var e=Object(F.h)(t,0,!0);this.ls=Object(F.i)(t,4,!0),this.cn=this.Cs,this.un=e}}},i.Cs=function(){var t=this;if(!(this._t.unreadLen<this.un)){var e=this._t.get(this.un),i=this.Mi;if(e&&i){var n=[],r=!1;if(this.Gn||(this.Gn=at.createCtx()),at.parseOBU(e,this.Gn).forEach((function(e){var a;e.obu_type===w.AV1_OBU_SEQUENCE_HEADER&&t.Gn&&t.Gn.sh&&(Dt.onAV1Detected(t.Ci,i,t.di,t.li,t.Ye()),Dt.updateAV1Track(t.Ci,i,t.Gn.sh)),r=r||!(null==(a=e.content)||!a.keyframe),n.push({type:0,data:e.data})})),n.length){var a={units:n,dts:this.ls,cts:0,pts:this.ls,originDTS:this.ls,originPTS:this.ls,key:r,size:n.reduce((function(t,e){return t+e.data.length}),0)};this.$e(a)}this.cn=this._s,this.un=12}}},i.Ke=function(t){void 0===t&&(t=!1);var e=this.Ne,i=this.Mi;if(this.We(e,i)&&this.Xe(e,i,t)){var r=Object(Nt.a)(i,this.bs);this.bs+=r.length,this.Ai.emit(N.a.VIDEO_FRAME_INFO,{videoFramesInfo:r}),this.Ve&&this.Ai.emit(N.a.KEY_FRAME_INDEXS,{keyframes:[{time:0,position:0}]}),this.qe(e,i,t,n.b.IVF)}},f()(e,null,[{key:"probeSize",get:function(){return 8}}])}(P);function Pt(t){return t/65536}function Mt(){for(var t=0,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];for(var r=i.length,a=0;a<r;a++){if(i[a]===1/0||i[a]===-1/0)return 1/0;t+=i[a]*i[a]}return Math.sqrt(t)}var Ut=i(20),Bt=function(){function t(){}return t.parseOneDescriptor=function(e){var i=0,n=e.data[e.pos],r=e.data[e.pos+1];for(e.pos+=2;128&r;)i=(127&r)<<7,r=e.data[e.pos],e.pos++;i+=127&r;var a=e.data.subarray(e.pos,e.pos+i);return 3===n?t.Is(e):4===n?t.Os(e):(e.pos+=i,{tag:n,data:a})},t.getAudioConfig=function(e){if(5===e.tag)return e.data;if(e.descs&&e.descs.length)for(var i=0;i<e.descs.length;i++){var n=t.getAudioConfig(e.descs[i]);if(n)return n}},t.getObjectTypeIndication=function(t){if(t.descs&&t.descs.length)for(var e=0;e<t.descs.length;e++)if(4===t.descs[e].tag)return t.descs[e].oti;return-1},t.Is=function(e){var i=Object(F.f)(e.data,e.pos);e.pos+=2;var n=e.data[e.pos];e.pos++;var r=0;128&n&&(r=Object(F.f)(e.data,e.pos),e.pos+=2);var a="";if(64&n){var o=e.data[e.pos];a=Object(F.a)(e.data,e.pos+1,o),e.pos+=o+1}var s=0;32&n&&(s=Object(F.f)(e.data,e.pos),e.pos+=2);var u={tag:3,data:e.data,id:i,dependsOnESID:r,url:a,ocrESID:s};return e.pos<e.data.byteLength&&(u.descs=t.ws(e)),u},t.Os=function(e){var i={tag:4,data:e.data,oti:e.data[e.pos],streamType:e.data[e.pos+1],bufferSize:Object(F.g)(e.data,e.pos+2),maxBitrate:Object(F.h)(e.data,e.pos+5),avgBitrate:Object(F.h)(e.data,e.pos+9)};return e.pos+=13,e.data.byteLength>13&&(i.descs=t.ws(e)),i},t.ws=function(e){for(var i=[];e.pos<e.data.byteLength;){var n=t.parseOneDescriptor(e);i.push(n)}return i},t}(),Vt=i(46),Ft=function(t){return t[t.SIZE=0]="SIZE",t[t.NAME=1]="NAME",t[t.BIG_SIZE=2]="BIG_SIZE",t[t.DATA=3]="DATA",t}({}),jt=function(){function t(){}return t.readBoxes=function(t){for(var e=0,i=Ft.SIZE,n={size:0,headSize:8,name:""},r=[];e<t.byteLength;)switch(i){case Ft.SIZE:n.size=Object(F.h)(t,e),e+=4,i=Ft.NAME;break;case Ft.NAME:n.name=Object(F.a)(t,e,4),e+=4,i=1===n.size?Ft.BIG_SIZE:Ft.DATA;break;case Ft.BIG_SIZE:n.size=Object(F.i)(t,e),n.headSize=16,e+=8,i=Ft.DATA;break;case Ft.DATA:n.data=t.subarray(e,e+n.size-n.headSize),e+=n.data.byteLength,i=Ft.SIZE,r.push(n),n={size:0,headSize:8,name:""}}return r},t.readBox=function(t,e){void 0===e&&(e=0);for(var i=e,n=Ft.SIZE,r={size:0,headSize:8,name:""};i<t.byteLength&&!r.data;)switch(n){case Ft.SIZE:r.size=Object(F.h)(t,i),i+=4,n=Ft.NAME;break;case Ft.NAME:r.name=Object(F.a)(t,i,4),i+=4,n=1===r.size?Ft.BIG_SIZE:Ft.DATA;break;case Ft.BIG_SIZE:r.size=Object(F.i)(t,i),r.headSize=16,i+=8,n=Ft.DATA;break;case Ft.DATA:if(!(t.byteLength-i>=r.size-r.headSize)){i=t.byteLength;break}r.data=t.subarray(i,i+r.size-r.headSize),i+=r.data.byteLength,n=Ft.SIZE}if(r.size)return r},t.ftyp=function(t){var e=t.data;if(e)return{major_brand:Object(F.a)(e,0,4),minor_version:Object(F.h)(e,4),compatible_brands:Object(F.a)(e,8,e.byteLength-8)}},t.moov=function(e){var i={trak:[],mvex:[],pssh:[]};return e.data&&t.readBoxes(e.data).forEach((function(e){e.data&&("mvhd"===e.name?i.mvhd=t.Es(e.data):"trak"===e.name?i.trak.push(t.ks(e.data)):"mvex"===e.name?i.mvex.push(t.Ms(e.data)):"pssh"===e.name?i.pssh.push(e):"udta"===e.name&&(i.udta||(i.udta=[]),i.udta.push(t.Ss(e.data))))})),i},t.moof=function(e){var i={};return e.data&&t.readBoxes(e.data).forEach((function(e){if(e.data&&"traf"===e.name){var n=t.Bs(e.data);i.traf?i.traf.push(n):i.traf=[n]}})),i},t.esds=function(t){if(t.data)return Bt.parseOneDescriptor({data:t.data,pos:4})},t.sidx=function(t){var e=t.data;if(e){var i={referenceID:0,timescale:0,earliestPresentationTime:0,firstOffset:0,referenceCount:0,references:[]},n=e[0],r=4;i.referenceID=Object(F.e)(e,r),i.timescale=Object(F.h)(e,r+4),r+=8,0===n?(i.earliestPresentationTime=Object(F.h)(e,r),i.firstOffset=Object(F.h)(e,r+4),r+=8):(i.earliestPresentationTime=Object(F.i)(e,r),i.firstOffset=Object(F.i)(e,r+8),r+=16),i.referenceCount=Object(F.f)(e,r+2),r+=4;for(var a=0;a<i.referenceCount;a++){var o=2147483647&Object(F.h)(e,r);r+=4;var s=Object(F.h)(e,r);r+=4,i.references.push({size:o,duration:s/i.timescale}),r+=4}return i}},t.btrt=function(t){var e=t.data;if(e)return{bufferSizeDB:Object(F.h)(e,0),maxBitrate:Object(F.h)(e,4),avgBitrate:Object(F.h)(e,8)}},t.pasp=function(t){var e=t.data;if(e)return{hSpacing:Object(F.h)(e,0),vSpacing:Object(F.h)(e,4)}},t.Bs=function(e){var i={};return t.readBoxes(e).forEach((function(e){if(e.data)if("tfhd"===e.name)i.tfhd=t.Ts(e.data);else if("tfdt"===e.name)i.tfdt=t.Ds(e.data);else if("trun"===e.name){var n=t.Rs(e.data);i.trun?i.trun.push(n):i.trun=[n]}else"saiz"===e.name?i.saiz=t.Ls(e.data):"saio"===e.name?i.saio=t.Ns(e.data):"senc"===e.name&&(i.senc=t.Qs(e.data))})),i},t.Ts=function(t){var e={trackID:Object(F.h)(t,4),baseDataOffset:0,sampleDescriptionIndex:0,defaultSampleDuration:0,defaultSampleSize:0,defaultSampleFlags:0},i=Object(F.g)(t,1),n=8;return n<=t.byteLength-8&&1&i?(e.baseDataOffset=Object(F.i)(t,n),n+=8):e.baseDataOffset=0,n<=t.byteLength-4&&2&i?(e.sampleDescriptionIndex=Object(F.h)(t,n),n+=4):e.sampleDescriptionIndex=0,n<=t.byteLength-4&&8&i?(e.defaultSampleDuration=Object(F.h)(t,n),n+=4):e.defaultSampleDuration=0,n<=t.byteLength-4&&16&i?(e.defaultSampleSize=Object(F.h)(t,n),n+=4):e.defaultSampleSize=0,n<=t.byteLength-4&&32&i?(e.defaultSampleFlags=Object(F.h)(t,n),n+=4):e.defaultSampleFlags=0,e},t.Ds=function(t){return{baseMediaDecodeTime:1===t[0]?Object(F.i)(t,4):Object(F.h)(t,4)}},t.Rs=function(t){var e=t[0],i=Object(F.g)(t,1),n={sampleCount:0,dataOffset:0,firstSampleFlags:0,sampleDuration:[],sampleSize:[],sampleFlags:[],sampleCompositionTimeOffset:[]},r=4;if(n.sampleCount=Object(F.h)(t,r),(r+=4)<=t.byteLength-4&&1&i?(n.dataOffset=Object(F.e)(t,r),r+=4):n.dataOffset=0,r<=t.byteLength-4&&4&i?(n.firstSampleFlags=Object(F.h)(t,r),r+=4):n.firstSampleFlags=0,r<=t.byteLength-4)for(var a=0;a<n.sampleCount;a++)256&i&&(n.sampleDuration[a]=Object(F.h)(t,r),r+=4),512&i&&(n.sampleSize[a]=Object(F.h)(t,r),r+=4),1024&i&&(n.sampleFlags[a]=Object(F.h)(t,r),r+=4),2048&i&&(n.sampleCompositionTimeOffset[a]=0===e?Object(F.h)(t,r):Object(F.e)(t,r),r+=4);return n},t.Ls=function(t){var e=t[0],i=Object(F.g)(t,1),n={defaultSampleInfoSize:0,sampleCount:0,sampleInfoSize:[]};if(0===e){var r=4;if(1&i&&(r+=8),n.defaultSampleInfoSize=t[r],n.sampleCount=Object(F.h)(t,r+1),r+=5,0===n.defaultSampleInfoSize)for(var a=0;a<n.sampleCount;a++)n.sampleInfoSize[a]=t[r],r++}return n},t.Ns=function(t){var e=t[0],i={entryCount:0,offset:[]},n=4;1&Object(F.g)(t,1)&&(n+=8),i.entryCount=Object(F.h)(t,n),n+=4;for(var r=0;r<i.entryCount;r++)0===e?(i.offset[r]=Object(F.h)(t,n),n+=4):(i.offset[r]=Object(F.i)(t,n),n+=8);return i},t.Qs=function(t,e){void 0===e&&(e=0);var i={sampleCount:0,useSubSampleEnc:!!(2&Object(F.g)(t,1)),encItemData:[]},n=4;return i.sampleCount=Object(F.h)(t,n),n+=4,e&&(i.iv=t.subarray(n,8*e),n+=e),i.encData=t.subarray(n),i},t.Es=function(t){var e=t[0],i=0,n=0;return 1===e?(i=Object(F.h)(t,20),n=Object(F.i)(t,24)):0===e&&(i=Object(F.h)(t,12),n=Object(F.h)(t,16)),{timescale:i,duration:n}},t.Ms=function(e){var i={};return t.readBoxes(e).forEach((function(e){e.data&&("mehd"===e.name?i.mehd=t.xs(e.data):"trex"===e.name&&(i.trex=t.Vs(e.data)))})),i},t.xs=function(t){return{fragmentDuration:1===t[0]?Object(F.i)(t,4):Object(F.h)(t,4)}},t.Vs=function(t){return{trackID:Object(F.h)(t,4),sampleDescriptionIndex:Object(F.h)(t,8),defaultSampleDuration:Object(F.h)(t,12),defaultSampleSize:Object(F.h)(t,16),defaultSampleFlags:Object(F.h)(t,20)}},t.ks=function(e){var i={};return t.readBoxes(e).forEach((function(e){e.data&&("tkhd"===e.name?i.tkhd=t.Us(e.data):"tref"===e.name?i.tref=t.Fs(e.data):"mdia"===e.name?i.mdia=t.Ps(e.data):"edts"===e.name&&(i.edts=t.Hs(e.data)))})),i},t.Us=function(t){var e=0,i=0,n=4;1===t[0]?(e=Object(F.h)(t,n+16),i=Object(F.i)(t,n+24),n+=32):(e=Object(F.h)(t,n+8),i=Object(F.h)(t,n+16),n+=20),n+=16;for(var r=[],a=0;a<9;a++)r.push(Object(F.e)(t,n)),n+=4;return{width:Object(F.h)(t,n)>>16,height:Object(F.h)(t,n+4)>>16,trackId:e,duration:i,matrix:r}},t.Hs=function(e){var i={};return t.readBoxes(e).forEach((function(e){"elst"===e.name&&e.data&&(i.elst=t.Ys(e.data))})),i},t.Ys=function(t){var e={entries:[],entry_count:0},i=t[0];e.entry_count=Object(F.h)(t,4);for(var n=8,r=0;r<e.entry_count;r++){var a={segment_duration:0,media_time:0,media_rate_integer:0,media_rate_fraction:0};e.entries.push(a),1===i?(a.segment_duration=Object(F.i)(t,n),a.media_time=Object(F.i)(t,n+8),n+=16):(a.segment_duration=Object(F.h)(t,n),a.media_time=Object(F.e)(t,n+4),n+=8),a.media_rate_integer=Object(F.c)(t,n),a.media_rate_fraction=Object(F.c)(t,n+2),n+=4}return e},t.Fs=function(t){return{referenceType:Object(F.a)(t,4,4),trackId:Object(F.h)(t,8)}},t.Ps=function(e){var i={};return t.readBoxes(e).forEach((function(e){e.data&&("minf"===e.name?i.minf=t.Gs(e.data):"hdlr"===e.name?i.hdlr=t.Ks(e.data):"mdhd"===e.name&&(i.mdhd=t.Zs(e.data)))})),i},t.Ks=function(t){var e={};return 0===t[0]&&(e.type=Object(F.a)(t,8,4)),e},t.Gs=function(e){var i={};return t.readBoxes(e).forEach((function(e){e.data&&("dinf"===e.name?t.Ws(e.data):"stbl"===e.name&&(i.stbl=t.Xs(e.data)))})),i},t.Ws=function(e){t.readBoxes(e).forEach((function(e){e.data&&"dref"===e.name&&t.zs(e.data)}))},t.zs=function(t){for(var e=Object(F.h)(t,4),i=0;i<e&&8<t.byteLength;i++);},t.Xs=function(e){var i={};return t.readBoxes(e).forEach((function(e){e.data&&("stsd"===e.name?i.stsd=t.Js(e.data):"stts"===e.name?i.stts=t.$s(e.data):"stsc"===e.name?i.stsc=t.tr(e.data):"stco"===e.name?i.stco=t.ir(e.data):"co64"===e.name?i.stco=t.er(e.data):"stsz"===e.name?i.stsz=t.nr(e.data):"stz2"===e.name?i.stsz=t.sr(e.data):"stss"===e.name?i.stss=t.rr(e.data):"ctts"===e.name?i.ctts=t.hr(e.data):"sgpd"===e.name?i.sgpd=t.ar(e.data):"stdp"===e.name?i.stdp=t.ur(e.data):"sdtp"===e.name?i.sdtp=t.cr(e.data):"sbgp"===e.name?i.sbgp=t.Ar(e.data):"subs"===e.name?i.subs=t.vr(e.data):"saiz"===e.name?i.saiz=t.Ls(e.data):"saio"===e.name?i.saio=t.Ns(e.data):"senc"===e.name&&(i.senc=t.Qs(e.data)))})),i},t.vr=function(t){var e=t[0],i={entries:[]},n=4,r=Object(F.h)(t,n);n+=4;for(var a=0;a<r;a++){var o={sampleDelta:Object(F.h)(t,n),subSamples:[]};i.entries.push(o);var s=Object(F.f)(t,n+4);n+=6;for(var u=0;u<s;u++){var c={priority:t[n+=1===e?4:2],discardable:t[n+1],codecSpecificParameters:Object(F.h)(t,n+2)};o.subSamples.push(c),n+=6}}return i},t.Ar=function(t){var e=t[0],i=4,n={groupingType:Object(F.a)(t,i,4),entries:[]};i+=4,1===e&&(i+=4);var r=Object(F.h)(t,i);i+=4;for(var a=0;a<r;a++)n.entries.push({sampleCount:Object(F.e)(t,i),groupDescriptionIndex:Object(F.e)(t,i+4)}),i+=8;return n},t.cr=function(t){for(var e={entries:[]},i=4;i<t.byteLength;)e.entries.push({sampleDependsOn:t[i]>>4&3,sampleIsDependedOn:t[i]>>2&3,sampleHasRedundancy:3&t[i]}),i++;return e},t.ur=function(t){for(var e={priority:[]},i=4;i<t.length;)e.priority.push(Object(F.f)(t,i)),i+=2;return e},t.ar=function(t){var e=t[0],i={type:Object(F.a)(t,4,4),entries:[]},n=0,r=8;1===e&&(n=Object(F.h)(t,r),r+=4),2===e&&(r+=4);var a=Object(F.h)(t,r);r+=4;for(var o=0;o<a;o++){var s=0;1===e&&0===n?(s=Object(F.h)(t,r),r+=4):s=n;var u={descriptionLength:s,data:t.subarray(r,r+s)};r+=s,i.entries.push(u)}return i},t.Js=function(e){return{sampleEntrys:t.readBoxes(e.subarray(8,e.byteLength)),boxData:e}},t.$s=function(t){for(var e=Object(F.h)(t,4),i=8,n=[],r=0;r<e;r++)n.push({sampleCount:Object(F.h)(t,i),sampleDelta:Object(F.h)(t,i+4)}),i+=8;return{timeToSample:n}},t.tr=function(t){for(var e=Object(F.h)(t,4),i=8,n=[],r=0;r<e;r++)n.push({firstChunk:Object(F.h)(t,i),samplesPerChunk:Object(F.h)(t,i+4),sampleDescriptionIndex:Object(F.h)(t,i+8)}),i+=12;return{sampleToChunkBox:n}},t.ir=function(t){for(var e=Object(F.h)(t,4),i=8,n=[],r=0;r<e;r++)n.push(Object(F.h)(t,i)),i+=4;return{chunkOffset:n}},t.er=function(t){for(var e=Object(F.h)(t,4),i=8,n=[],r=0;r<e;r++)n.push(Object(F.i)(t,i)),i+=8;return{chunkOffset:n}},t.nr=function(t){var e=Object(F.h)(t,4),i=Object(F.h)(t,8),n=12;if(0===e){e=[];for(var r=0;r<i;r++)e.push(Object(F.h)(t,n)),n+=4}return{sampleCount:i,SampleSize:e}},t.sr=function(t){for(var e=t[7],i=[],n=Object(F.h)(t,8),r=12,a=0;a<n;a++)4===e?(i.push(t[r]>>4),++a<n&&i.push(15&t[r]),r+=1):8===e?(i.push(t[r]),r+=1):16===e&&(i.push(Object(F.f)(t,r)),r+=2);return{sampleCount:n,SampleSize:i}},t.rr=function(t){for(var e=Object(F.h)(t,4),i=8,n=[],r=0;r<e;r++)n.push(Object(F.h)(t,i)),i+=4;return{sampleNumber:n}},t.hr=function(t){for(var e=Object(F.h)(t,4),i=8,n=[],r=0;r<e;r++)n.push({sampleCount:Object(F.h)(t,i),sampleOffset:Object(F.e)(t,i+4)}),i+=8;return{compositionOffset:n}},t.Zs=function(t){var e=0,i=0;return 1===t[0]?(e=Object(F.h)(t,20),i=Object(F.i)(t,24)):(e=Object(F.h)(t,12),i=Object(F.h)(t,16)),{timescale:e,duration:i}},t.Ss=function(e){var i=t.readBoxes(e),n={meta:{}};return i.forEach((function(e){e.data&&"meta"===e.name&&D()(n.meta,t.dr(e.data))})),n},t.dr=function(e){var i=Object(F.h)(e,4),n={};return(1751411826===i?t.readBoxes(e.subarray(0,e.byteLength)):t.readBoxes(e.subarray(4,e.byteLength))).forEach((function(e){e.data&&("hdlr"===e.name?t.Ks(e.data):"ilst"===e.name&&D()(n,t.lr(e.data)))})),n},t.lr=function(e){for(var i={},n=0,r=function(){var r=Object(F.h)(e,n);n+=4;var a=Object(F.a)(e,n,4);n+=4,t.readBoxes(e.subarray(n,n+r-8)).forEach((function(t){var e=t.data;i[a]=e?Object(F.a)(e,8,e.length-8):""})),n+=r-8};n<e.length;)r();return i},t}(),Ht=[64,102,103,104,105,107],Gt=[64,102,103,104],zt={avc1:M.c.h264,avcC:M.c.h264,hev1:M.c.hevc,hvc1:M.c.hevc,hvcC:M.c.hevc,kvc3:M.c.kvc3,kvc4:M.c.kvc4,kvc5:M.c.kvc5,kvc6:M.c.kvc6,kvc7:M.c.kvc30,kvLC:M.c.kvc30,av01:M.c.av1,av1C:M.c.av1,bvc2:M.c.bvc2,bv2C:M.c.bvc2,vvc1:M.c.vvc,vvcC:M.c.vvc},Wt="notReady",Kt="mp4-demuxer",Yt=function(t){function e(e,i,n,r,a){var o;return(o=t.call(this,e,i,n,r,a)||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,e.i(Kt,"constructor"),o}_()(e,t),e.probe=function(t){var e=Object(F.a)(t,4,4);return!("styp"!==e&&"ftyp"!==e)};var i=e.prototype;return i.append=function(t,e,i,n,a,o){if(void 0===a&&(a=!1),this.jr){this.Fe=o,this._t.put(t),this.Ue||(this.Ue={timeOffset:e,contiguous:i,accurateTimeOffset:n}),this.Or&&this.Br()&&this.Tr();do{if(this.Dr(),!this.pr||!this.jr)return;for(i||(this.Or||this.Rr(e),i=!0);this._t.unreadLen&&this.Lr();){if(!this.Cr){var s=this.Nr();if(s===Wt)return void this.Ci.i(Kt,"sample not ready");this.Cr=s}if(!this.Cr)return void(!this.Or&&this.It<this.Mr&&this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,"can not find next sample")));if(this.It){var u=this.Cr.start-this.It;if(this._t.unreadLen<u)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 c=this._t.get(this.Cr.end-this.Cr.start);if(!c)return;this.It+=c.byteLength,this.Cr.type===M.o.VIDEO?(this.Mi.active&&this.Qr(this.Cr,c),this.mr++):(this.Ne.active&&this.Vr(this.Cr,c),this.gr++),this.Cr=void 0}this.Br()&&this.Tr()}while(this.Or&&this.Ur());this.kr&&!a||(this.Ke(a&&!this.Lr()),a&&this.Ai.emit(N.a.PARSED_DATA,{extra:this._i}))}},i.Dr=function(){for(;this.Ur();){if(!this.Ir){var t=this._t.get(8);if(!t)return;var e=Object(F.h)(t);this.Ir={size:e,name:Object(F.a)(t,4,4),headSize:e>1?8:16},this.It+=8}if(1===this.Ir.size){if(!(this._t.unreadLen>=8))return void(this.wr=8);var i=this._t.get(8);if(!i)return;var n=Object(F.i)(i);this.Ir.size=n,this.It+=8}var r=this.Ir.size-this.Ir.headSize;if("mdat"===this.Ir.name){if(this.Mr=this.It,!this.pr)return this.Ir=void 0,this.jr=!1,void this.Ai.emit(N.a.MP4_NOT_FASTSTART,{pos:this.It+r});if(this.Or){this.Fr(this.It),this.wr=0,this.Er=this.It+r;break}if(!this.Or){this.Ir=void 0,this.wr=0;break}}if(this._t.unreadLen>=r){var a=this._t.get(r);if(this.Ir.data=a,this.It+=r,this.wr=8,"moov"===this.Ir.name){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"moof"===this.Ir.name?(this.kr&&this.Ke(),this.Or=!0,this.Hr(this.Ir,this.It),this.Ir=void 0):"sidx"===this.Ir.name?(this.Yr(this.Ir,this.It),this.Ir=void 0):"ftyp"===this.Ir.name?(this.br=jt.ftyp(this.Ir),this.Ir=void 0):this.Ir=void 0}else this.wr=r}},i.Fr=function(t){var e,i,n=this.gr,r=this.mr,a=null==(e=this._r)?void 0:e.samples,o=null==(i=this.yr)?void 0:i.samples,s=a&&a[n],u=o&&o[r];if(s&&u)for(var c=t,l=a[n],h=o[r];l||h;){var d=l?l.noOffset?l.start+c:l.start:Number.MAX_SAFE_INTEGER,f=h?h.noOffset?h.start+c:h.start:Number.MAX_SAFE_INTEGER,p=void 0;if(d===f?l&&l.noOffset?(p=h,r++):(p=l,n++):d<f?(p=l,n++):(p=h,r++),p){if(p.noOffset){p.noOffset=void 0;var _=p.end-p.start;p.start=Math.min(d,f),p.end=p.start+_}c=p.end}l=a[n],h=o[r]}else if(s||u){var v=s?a:o;if(!v)return;for(var A=v.length-1;A>=0;A--){var g=v[A];if(g&&g.noOffset){g.noOffset=void 0,g.start+=t,g.end+=t;break}}}},i.Ur=function(){return!!(this.wr&&this._t.unreadLen>=this.wr)},i.Br=function(){return!!(this.Or&&this.Er&&!this.Lr()&&this.Er<=this.It+this._t.unreadLen)},i.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)},i.resetInitSegment=function(e,i){t.prototype.resetInitSegment.call(this,e),this.jr=!0,i&&this._t.put(i),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(Kt,"reset init")},i.Qr=function(t,e){var i=this,n=0,r=[],a=!1,o=this.Mi,s=[],u=[],c=!1;if(o.codecType===M.c.av1)this.Gn||(this.Gn=at.createCtx()),at.parseOBU(e,this.Gn).forEach((function(t){var e;t.obu_type===w.AV1_OBU_SEQUENCE_HEADER&&t.content&&Dt.updateAV1Track(i.Ci,o,t.content),a=a||t.obu_type!==w.AV1_OBU_SEQUENCE_HEADER&&!(null==(e=t.content)||!e.keyframe),r.push({type:0,data:t.data})}));else for(;n<e.byteLength;){var l=Object(F.h)(e,n);if(n+=4,l>t.size){this.Ci.i(Kt,"nalu size error. "+l+" > "+t.size);break}var h=e.subarray(n,n+l);3===this.Un&&(l>>>=8);var d=0,f=void 0;if(o.codecType===M.c.h264){if((d=31&h[0])===B.H264_NAL_IDR_SLICE)a=a||!0;else if(d===B.H264_NAL_SEI)s.push.apply(s,ut.parse(h.subarray(1)));else if(d===B.PRIV_NAL_MAGIC_H264)try{u.push(ot.parse(h,!0))}catch(t){this.Ci.w(Kt,"PrivNal parse error "+t)}this.Pn||(this.Pn={spsList:[],ppsList:[]}),d===B.H264_NAL_SPS?wt.onH264SPSNalu(h,this.Pn)&&(c=!0):d===B.H264_NAL_PPS&&wt.onH264PPSNalu(h,this.Pn)&&(c=!0)}else if(W(o.codecType)){if((d=(126&h[0])>>1)===V.a.HEVC_NAL_IDR_W_RADL||d===V.a.HEVC_NAL_IDR_N_LP||d===V.a.HEVC_NAL_CRA_NUT)a=a||!0;else if(d===V.a.HEVC_NAL_SEI_PREFIX||d===V.a.HEVC_NAL_SEI_SUFFIX)s.push.apply(s,ut.parse(h.subarray(2)));else if(d===V.a.PRIV_NAL_MAGIC_HEVC)try{u.push(ot.parse(h,!1))}catch(t){this.Ci.w(Kt,"PrivNal parse error "+t)}this.Pn||(this.Pn={vpsList:[],spsList:[],ppsList:[]}),d===V.a.HEVC_NAL_VPS?wt.onHEVCVPSNalu(this.Ci,h,this.Pn)&&(c=!0):d===V.a.HEVC_NAL_SPS?wt.onHEVCSPSNalu(h,this.Pn,o.codecType)&&(c=!0):d===V.a.HEVC_NAL_PPS&&wt.onHEVCPPSNalu(h,this.Pn)&&(c=!0)}else K(o.codecType)&&(d=(248&h[1])>>3,f=(7&h[1])-1,d!==dt.a.VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL&&d!==dt.a.VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP||(a=a||!0),this.Pn||(this.Pn={vpsList:[],spsList:[],ppsList:[]}),d===dt.a.VVC_NAL_UNIT_VPS?wt.onVVCVPSNalu(h,this.Pn)&&(c=!0):d===dt.a.VVC_NAL_UNIT_SPS?wt.onVVCSPSNalu(h,this.Pn)&&(c=!0):d===V.a.HEVC_NAL_PPS&&wt.onVVCPPSNalu(h,this.Pn)&&(c=!0));r.push({type:d,data:h,temporalId:f}),n+=l}if(c&&this.Pn&&wt.isParamSetsReady(this.Pn)&&(this.Ci.i(Kt,"dec param sets update."),this.Gr(o,this.Pn,c)),r.length){var p={units:r,dts:t.dts,cts:t.cts,pts:t.pts,originDTS:t.dts,originPTS:t.pts,key:a,duration:t.duration,size:r.reduce((function(t,e){return t+e.data.length}),0)};s.length&&(p.sei={sei:s,streamTimestamp:Object(Ut.d)(t.pts,o.inputTimescale)}),u.length&&(p.privNal={info:u,streamTimestamp:Object(Ut.d)(t.pts,o.inputTimescale)}),t.auxiliaryInfo&&(p.auxiliaryInfo=t.auxiliaryInfo),this.$e(p)}},i.Vr=function(t,e){var i,n=this.Ne;if(n.codecType!==M.c.aac||!(e.length<=2||n.asc&&n.asc===Object(F.f)(e)))if(n.codecType===M.c.mp3){var r;i=null==(r=C(n,e,0,t.dts,0))?void 0:r.sample}else{if(i={unit:e,dts:t.dts,pts:t.dts,duration:t.duration||t.duration||n.sampleDuration,originDTS:t.dts,originPTS:t.dts},t.auxiliaryInfo&&(i.auxiliaryInfo=t.auxiliaryInfo),e.length>2&&255===e[0]&&e[1]>>4==15){this.Ci.i(Kt,"adts header detected.");var a=v.a(this.Ci,n,e,0,t.dts,0,t.dts);a&&(i=a.sample)}else n.samples.push(i);if(this.di.enableAacPriv&&"number"==typeof n.aacSampleingIndex&&"number"==typeof n.aot){var o=v.h(this.Ci,e,n.aacSampleingIndex,n.aot);o&&(i.aacPriv=[{payload:o.priv,streamTimestamp:Object(Ut.d)(t.pts,n.inputTimescale)}])}}},i.Lr=function(){return!!(this._r&&this.gr<this._r.samples.length||this.yr&&this.mr<this.yr.samples.length)},i.Nr=function(){var t=this._r?this._r.samples[this.gr]:void 0,e=this.yr?this.yr.samples[this.mr]:void 0,i=t?t.start-this.It:-1,n=e?e.start-this.It:-1;return n>=0&&(n<i||n>i&&i<0)?e:i>=0&&(i<n||i>n&&n<0)?t:this.Or&&(i<n&&null!=t&&t.noOffset||i>n&&null!=e&&e.noOffset)?Wt:void 0},i.Ke=function(t){void 0===t&&(t=!1);var e=this.Ne,i=this.Mi;this.We(e,i)&&(this.Ze(e,i),t&&O.a.alignEndByRemuxer(this.Ci,e,i,this.De),this.Xe(e,i,t)&&this.qe(e,i,t,this.Or?n.b.FMP4:n.b.MP4,this.ki))},i.Kr=function(t){if(this.pr)for(var e=0;e<this.pr.mvex.length;e++){var i;if((null==(i=this.pr.mvex[e].trex)?void 0:i.trackID)===t)return this.pr.mvex[e].trex}},i.Zr=function(t){if(this.pr)for(var e=0;e<this.pr.trak.length;e++){var i;if((null==(i=this.pr.trak[e].tkhd)?void 0:i.trackId)===t)return this.pr.trak[e]}},i.Hr=function(t,e){var i,n=this,r=jt.moof(t);r.traf&&r.traf.length>1&&(this.kr=!0),null==(i=r.traf)||i.forEach((function(i){var r=i.tfdt,a=i.tfhd,o=i.trun;if(a&&o){var s,u=n.Kr(a.trackID),c=(null==r?void 0:r.baseMediaDecodeTime)||0,l=0,h=a.defaultSampleSize||(null==u?void 0:u.defaultSampleSize)||0,d=h,f=a.defaultSampleDuration||(null==u?void 0:u.defaultSampleDuration)||0,p=a.trackID||0;p===n.Mi.id&&(s=n.Mi),p===n.Ne.id&&(s=n.Ne);var _=n.Zr(p);if(_&&s){var A,g;if(null!=(A=_.mdia)&&null!=(A=A.mdhd)&&A.timescale&&(s.inputTimescale=_.mdia.mdhd.timescale),s.sampleDescIndex=a.sampleDescriptionIndex,s.type===M.o.VIDEO&&n.yr?g=n.yr:s.type===M.o.AUDIO&&n._r&&(g=n._r),!g)return;var m=g.samples.length;"video"===s.type&&"number"==typeof n.Le&&n.Le>c?c=n.Le:"audio"===s.type&&"number"==typeof n.Re&&n.Re>c&&(c=n.Re);var b=0;o.forEach((function(n){if(s&&g){var r=!n.dataOffset,o=0;r||(o=a.baseDataOffset?a.baseDataOffset+n.dataOffset:n.dataOffset+e-t.size);for(var p=0;p<(n.sampleCount||0);p++){f=n.sampleDuration[p]||a.defaultSampleDuration||(null==u?void 0:u.defaultSampleDuration)||f||0,l=n.sampleCompositionTimeOffset[p]||0,d=n.sampleSize[p]||h,f||s.type!==M.o.AUDIO||(f=v.c(s.samplerate,s.inputTimescale));var _={type:s.type,index:m,gopID:0,dts:c,cts:l,pts:c+l,duration:f,start:o,end:o+d,size:d,noOffset:r};if(i.senc)if(s.useSubSampleEnc=i.senc.useSubSampleEnc,i.senc.encItemData[p])_.auxiliaryInfo={enc:i.senc.encItemData[p]};else if(i.saiz&&i.senc.encData){var A=i.saiz.sampleInfoSize[p]||i.saiz.defaultSampleInfoSize;_.auxiliaryInfo={enc:i.senc.encData.subarray(b,b+A)},b+=A}o+=d,c+=f,m++,g.samples.push(_),g.endPTS=c+l}}})),"video"===s.type?n.Le=c:"audio"===s.type&&(n.Re=c)}}}))},i.Yr=function(t,e){var i=jt.sidx(t),n=this.yr;if(i&&n&&i.referenceID===this.Mi.id){n.keyframes=[];var r=i.earliestPresentationTime/i.timescale,a=e;i.references.forEach((function(t){n.keyframes.push({time:r,position:a}),r+=t.duration,a+=t.size})),this.Ai.emit(N.a.KEY_FRAME_INDEXS,{keyframes:n.keyframes,append:!0})}},i.Pr=function(t){var e,i,n=this;this.Ci.i(Kt,"parse moov size: "+t.size);var r=this.pr=jt.moov(t),a={mp4MoovSize:t.size};if(r.udta&&r.udta.forEach((function(t){D()(a,t.meta)})),this.br&&D()(a,this.br),r.mvhd){var o=r.mvhd.timescale;this.Vn=r.mvhd.duration/o,this.Vn||r.mvex.forEach((function(t){t.mehd&&(a.duration=n.Vn=t.mehd.fragmentDuration/o)})),a.duration=this.Vn}if(this.ki=[],r.pssh.forEach((function(t){t.data&&n.ki&&n.ki.push(t.data)})),r.trak.forEach((function(t){var e,i,a,o;if(t.mdia&&t.mdia.minf&&t.mdia.minf.stbl&&t.mdia.hdlr&&t.mdia.mdhd&&t.tkhd)if("vide"===t.mdia.hdlr.type)void 0===n.Mi.active&&(n.Mi.active=!0),n.yr=n.Wr(n.Mi,t.mdia.minf.stbl,t.mdia.mdhd,r.mvhd,null==(e=t.edts)?void 0:e.elst),n.Mi.rotation=function(t){var e,i,n=((i=[])[0]=Mt(Pt((e=t)[0]),Pt(e[3])),i[1]=Mt(Pt(e[1]),Pt(e[4])),-(0==i[0]||0==i[1]?NaN:-180*Math.atan2(Pt(e[1])/i[1],Pt(e[0])/i[0])/Math.PI));return n-=360*Math.floor(n/360+.0025),(n%=360)<0&&(n+=360),n}(t.tkhd.matrix),n.Mi.id=t.tkhd.trackId,null!=(i=n.ki)&&i.length&&(n.Mi.stsd=null==(a=t.mdia.minf.stbl.stsd)?void 0:a.boxData),n.Mi.bitrate||(n.Mi.bitrate=8*((null==(o=n.yr)?void 0:o.size)||0)/1e3/(t.mdia.mdhd.duration/t.mdia.mdhd.timescale));else if("soun"===t.mdia.hdlr.type){var s,u,c,l;void 0===n.Ne.active&&(n.Ne.active=!0),n.Ne.id=t.tkhd.trackId,n._r=n.Wr(n.Ne,t.mdia.minf.stbl,t.mdia.mdhd,r.mvhd,null==(s=t.edts)?void 0:s.elst),null!=(u=n.ki)&&u.length&&(n.Ne.stsd=null==(c=t.mdia.minf.stbl.stsd)?void 0:c.boxData),!n.Ne.bitrate&&(n.Ne.bitrate=8*((null==(l=n._r)?void 0:l.size)||0)/1e3/(t.mdia.mdhd.duration/t.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 s,u,c,l;this.yr.keyframes&&(a.keyframes=this.yr.keyframes,this._r&&this._r.samples.length&&this.yr.keyframes.length&&this._r.samples[0].start<this.yr.keyframes[0].position&&(a.keyframes[0]=D()({},a.keyframes[0]),a.keyframes[0].position=this._r.samples[0].start));var h=[],d=this.Mi.inputTimescale,f=this.De.computeInitPTSDTS(0,null!=(s=this._r)&&s.samples?null==(u=this._r)?void 0:u.samples[0]:void 0,null!=(c=this.yr)&&c.samples?null==(l=this.yr)?void 0:l.samples[0]:void 0,this.Ne.inputTimescale,this.Mi.inputTimescale),p=f.initDTS,_=f.initPTS;this.yr.samples.forEach((function(t){h.push({index:0,dts:t.dts/d-p,pts:t.pts/d-_,duration:t.duration/d})})),h.sort((function(t,e){return t.pts-e.pts})),h.forEach((function(t,e){t.index=e})),a.videoFramesInfo=h}else if(this._r&&this._r.samples.length){var v=0,A=this.Ne.inputTimescale,g=[{time:0,position:this._r.samples[0].start}];this._r.samples.forEach((function(t){t.dts-v>10*A&&(g.push({time:t.dts/A,position:t.start}),v=t.dts)})),a.keyframes=g}a.duration=Math.max((null==(e=this.yr)?void 0:e.duration)||0,(null==(i=this._r)?void 0:i.duration)||0,this.Vn),this.Sr&&(a.mp4MoovNoPs=!0),this.Ci.i(Kt,"Parsed onMetaData"),this.Ai.emit(N.a.METADATA,a)},i.Rr=function(t){var e,i;if(this.Ci.i(Kt,"seek:"+t),0===t||this.Or)return this.mr=0,void(this.gr=0);var n=null==(e=this.yr)?void 0:e.samples,r=null==(i=this._r)?void 0:i.samples;if(n&&this.yr){var a=Vt.a.getPosByTime(this.yr.keyframes,t);a&&(this.mr=this.Jr(n,a.position))}if(r)if(this.yr){if(n){var o=n[this.mr];o&&(this.gr=this.Jr(r,o.end),this.Ci.i(Kt,"seek audio by video pos: "+t+" a: "+this.gr+" v: "+this.mr))}}else this.gr=this.qr(r,t*this.Mi.inputTimescale),this.Ci.i(Kt,"seek audio by time: "+t+" a: "+this.gr+" v: "+this.mr)},i.Jr=function(t,e){if(t[0]&&e<t[0].start)return 0;if(t[t.length-1]&&e>=t[t.length-1].end)return t.length-1;for(var i,n=0,r=t.length-1,a=0,o=0;n<=r;){if(e>=((i=(o=(a=(n+r)/2|0)-1)>=0?t[o]:void 0)?i.end:t[a].start)&&e<t[a].end)return a;if(e===t[a].end)return a+1;e>t[a].end?n=a+1:r=a-1}return 0},i.qr=function(t,e){if(t[0]&&e<t[0].dts)return 0;if(t[t.length-1]&&e>=t[t.length-1].dts)return t.length-1;for(var i=0,n=t.length-1,r=0,a=0,o=0;i<=n;)if(e>(o=t[a=1+(r=(i+n)/2|0)]?t[a].dts:Number.MAX_SAFE_INTEGER))i=a;else{if(!(e<t[r].dts))return e===o?a:r;n=r-1}return 0},i.Xr=function(t){var e=this;this.Ci.i(Kt,"parse video desc: "+t[0].name);var i=!1;t.forEach((function(t){"avc1"!==t.name&&"hev1"!==t.name&&"hvc1"!==t.name&&"kvc3"!==t.name&&"kvc4"!==t.name&&"kvc5"!==t.name&&"kvc6"!==t.name&&"av01"!==t.name&&"encv"!==t.name&&"bvc2"!==t.name&&"kvc7"!==t.name&&"vvc1"!==t.name||(e.$r(t),i=!0)})),i||(this.Ci.i(Kt,"video codec unsupported"),this.Mi.active=!1)},i.zr=function(t){var e=this;this.Ci.i(Kt,"parse audio desc: "+t[0].name);var i=!1;t.forEach((function(t){("mp4a"===t.name||"enca"===t.name||"Opus"===t.name&&e.li.opus)&&(e.th(t),i=!0)})),i||(this.Ci.i(Kt,"audio codec unsupported"),this.Ne.active=!1)},i.th=function(t){var e=this;if(t.data&&t.data){var i=8,n=Object(F.f)(t.data,i);i+=n>=2?56:1===n?36:20,jt.readBoxes(t.data.subarray(i,t.data.byteLength)).forEach((function(t){if("esds"===t.name)e.ih(t);else if("wave"===t.name&&t.data)jt.readBoxes(t.data).forEach((function(t){"esds"===t.name&&e.ih(t)}));else if("btrt"===t.name){var i=jt.btrt(t);i&&(e.Ne.maxBitrate=i.maxBitrate/1e3,e.Ne.bitrate=i.avgBitrate/1e3)}else"dOps"===t.name&&t.data&&(e.Ne.codecType=M.c.opus,e.Ne.codec="opus",e.Ne.channelCount=t.data[1],e.Ne.samplerate=Object(F.h)(t.data,4))}))}},i.ih=function(t){if("esds"===t.name){var e=this.Ne,i=jt.esds(t);if(i){var r=Bt.getObjectTypeIndication(i);if(-1===Ht.indexOf(r))return void(e.active=!1);if(-1!==Gt.indexOf(r)){var a=Bt.getAudioConfig(i);a&&v.d(this.Ci,e,this.Ai,a,n.a.ASC),e.codecType=M.c.aac}else e.codecType=M.c.mp3}}},i.$r=function(t){var e=this;if(t.data){var i=this.Mi,n=jt.readBoxes(t.data.subarray(78,t.data.byteLength)),r=this.Ye();n.forEach((function(n){var a;if("avcC"===n.name)i.codecType=zt[n.name],Dt.onAVCDetected(e.Ci,i,e.di,e.li,r),e.eh(i,n),e.nh(i),e.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:M.d.buildin,codecType:M.c.h264,timeOffset:(null==(a=e.Ue)?void 0:a.timeOffset)||0});else if("hvcC"===n.name)W(i.codecType)||(i.codecType=zt[t.name]||M.c.hevc,i.codecType===M.c.hevc?Dt.onHEVCDetected(e.Ci,i,e.di,e.li,r):Dt.onKVCDetected(e.Ci,i,e.di,r)),e.rh(i,n),e.nh(i);else if("av1C"===n.name)i.codecType=zt[n.name],Dt.onAV1Detected(e.Ci,i,e.di,e.li,r),e.hh(i,n),e.nh(i);else if("vvcC"===n.name||"bv2C"===n.name||"kvLC"===n.name)i.codecType=zt[n.name],Dt.onVVCDetected(e.Ci,i,e.di,r),e.oh(i,n),e.nh(i);else if("btrt"===n.name){var o=jt.btrt(n);o&&(i.maxBitrate=o.maxBitrate/1e3,i.bitrate=o.avgBitrate/1e3)}else if("pasp"===n.name){var s=jt.pasp(n);s&&e.Mi.sar.width==e.Mi.sar.height&&(e.Mi.sar={width:s.hSpacing,height:s.vSpacing})}}))}},i.hh=function(t,e){if(e.data){this.Gn=at.createCtx();var i=wt.parseAV1C(this.Ci,e.data,this.Gn);i?i.sh&&Dt.updateAV1Track(this.Ci,t,i.sh,e.data):this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"Invalid AV1DecoderConfigurationRecord"))}},i.eh=function(t,e){if(e.data){var i=wt.parseAVCC(this.Ci,e.data);i&&wt.isParamSetsReady(i.paramSets)?(this.Pn=i.paramSets,this.Gr(t,i.paramSets)):(this.Ci.i(Kt,"parse avcc no sps/pps."),this.Sr=!0)}},i.rh=function(t,e){if(this.Ci.i(Kt,"parse hvcc",t.codecType),e.data){var i=wt.parseHVCC(this.Ci,e.data,t.codecType),r=i&&wt.isParamSetsReady(i.paramSets);if(r?(this.Pn=i.paramSets,this.Gr(t,i.paramSets)):(this.Ci.i(Kt,"parse hvcc no vps/sps/pps."),this.Sr=!0),this.Mi.outputRaw&&r){var a=wt.hevDecoderConfigToSample(i.paramSets,0);this.Ai.emit(N.a.RAW_DATA,{type:n.d.decoderConfig,samples:Q([a],t.inputTimescale),extra:this._i})}}},i.oh=function(t,e){if(this.Ci.i(Kt,"parse vvcC",t.codecType),e.data){var i,r=(i=t.codecType===M.c.kvc30?wt.parseKvLC(this.Ci,e.data):t.codecType===M.c.bvc2?wt.parseBV2C(this.Ci,e.data):wt.parseVvcC(this.Ci,e.data))&&wt.isParamSetsReady(i.paramSets);if(r?(this.Pn=i.paramSets,this.Gr(t,i.paramSets)):(this.Ci.i(Kt,"parse vvcc no vps/sps/pps."),this.Sr=!0),this.Mi.outputRaw&&r){var a=wt.vvcDecoderConfigToSample(i.paramSets,0);this.Ai.emit(N.a.RAW_DATA,{type:n.d.decoderConfig,samples:[a],extra:this._i})}}},i.Gr=function(t,e,i){var n;void 0===i&&(i=!0),t.codecType===M.c.h264?Dt.updateAVCTrack(this.Ci,t,e):W(t.codecType)?Dt.updateHEVCTrack(this.Ci,t,e):K(t.codecType)&&(Dt.updateVVCTrack(this.Ci,t,e),t.sampleDuration=this.yr&&this.yr.samples.length?Math.round(this.Vn*t.inputTimescale/this.yr.samples.length):3003,t.duration=this.Vn),i&&this.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{codecType:t.codecType||M.c.unknown,enabled:!!t.active,decoder:this.Mi.outputRaw?M.d.wasm:M.d.buildin,bitDepth:t.bitDepth,timeOffset:(null==(n=this.Ue)?void 0:n.timeOffset)||0})},i.Wr=function(t,e,i,n,r){this.Ci.i(Kt,"parse stbl type: "+t.type,this.Vn);var a={description:e.stsd?e.stsd.sampleEntrys:[],samples:[],keyframes:[],endPTS:0,size:0,duration:i.duration/i.timescale};if(t.inputTimescale=i.timescale,t.duration=i.duration,e.stco&&e.stsc&&e.stsz&&e.stsz.sampleCount){var o,s,u,c=0,l=0,h=e.stco.chunkOffset[c],d=e.stsc.sampleToChunkBox[l],f=null==(o=d)?void 0:o.samplesPerChunk,p=null==(s=d)?void 0:s.firstChunk,_=0,v=Math.ceil(Object(Ut.e)(1,t.inputTimescale));if(!d)throw new Error("mp4 stbl error. sampleToChunkBox undefined");if("number"!=typeof f)throw new Error("mp4 stbl error. chunkSampleCount");if("number"!=typeof p)throw new Error("mp4 stbl error. firstChunk");var A=0,g=void 0,m=0,b=0;if(e.stts){if(!(g=e.stts.timeToSample[A]))throw new Error("mp4 stbl error. timeToSample");m=g.sampleCount}var y=0,E=void 0,C=0,T=0;if(e.ctts){if(!(E=e.ctts.compositionOffset[y]))throw new Error("mp4 stbl error. compositionOffset");C=E.sampleCount}var I=0,R=0;e.stss&&(R=e.stss.sampleNumber[I]);for(var w=0;w<e.stsz.sampleCount;w++){if(w>=f&&c<e.stco.chunkOffset.length){_=0,p++,c++,h=e.stco.chunkOffset[c];var L=e.stsc.sampleToChunkBox[l+1];L&&p>=L.firstChunk&&(l++,d=L),f+=d.samplesPerChunk}if(e.stts&&w>=m&&A<e.stts.timeToSample.length-1&&(A++,m+=(g=e.stts.timeToSample[A]).sampleCount),e.ctts&&w>=C&&y<e.ctts.compositionOffset.length-1&&(y++,C+=(E=e.ctts.compositionOffset[y]).sampleCount),e.stss&&R&&w>=R-1&&(I++,R=e.stss.sampleNumber[I],u={time:0,position:0}),d&&h){var D,S;T=(null==(D=E)?void 0:D.sampleOffset)||0;var O="number"==typeof e.stsz.SampleSize?e.stsz.SampleSize:e.stsz.SampleSize[w],N=Math.max(v,(null==(S=g)?void 0:S.sampleDelta)||0);0===w&&(b=0-T);var k=b+T,x={type:t.type,index:w,gopID:a.keyframes.length||1,dts:b,cts:T,pts:k,duration:N,start:h+_,end:h+_+O,size:O};k>a.endPTS&&(a.endPTS=k),a.samples.push(x),a.size+=O,u&&(u.time=a.keyframes.length?Math.round((b+T)/t.inputTimescale*1e3)/1e3:0,u.position=x.start,a.keyframes.push(u),u=void 0),b+=N,_+=O,!e.stss&&0===a.keyframes.length&&a.samples.length&&a.keyframes.push({time:0,position:a.samples[0].start})}}if(r&&r.entries.length>1&&n){this.Ci.i(Kt,"elst box",t.type,r);for(var P=0,U=0,B=0,V=0;V<r.entries.length;V++){var F=r.entries[V];0===V&&-1===F.media_time?(P=F.segment_duration,U=1):U===V&&F.media_time>=0&&(B=F.media_time)}if(P&&n.timescale>0){var j=B-(P=P/n.timescale*i.timescale),H=j/t.inputTimescale;this.Ci.i(Kt,"elst track: "+t.type+" timeOffset: "+j+"/"+H+" startTime: "+B);var G=0;a.samples.forEach((function(t){t.dts=Math.max(t.dts-j,G),t.pts=t.dts+t.cts,G++})),G=0,a.keyframes.forEach((function(t,e){e>0&&(t.time=Math.max(t.time-H,0)),G=t.time+.001})),a.duration-=H}}return t.type===M.o.VIDEO&&a.samples.length&&i.timescale&&(a.fps=a.samples.length/(i.duration/i.timescale)),a.samples.length&&(t.sampleDuration=this.Vn*t.inputTimescale/a.samples.length),a}return a},i.nh=function(t){try{var e,i;null!=(e=this.yr)&&e.fps&&Number.isFinite(null==(i=this.yr)?void 0:i.fps)&&this.yr.fps>0&&(t.fps=this.yr.fps)}catch(t){}},f()(e,null,[{key:"probeSize",get:function(){return 8}}])}(P),Qt=i(30),Xt=function(t){return t[t.AV_PICTURE_STRUCTURE_UNKNOWN=0]="AV_PICTURE_STRUCTURE_UNKNOWN",t[t.AV_PICTURE_STRUCTURE_TOP_FIELD=1]="AV_PICTURE_STRUCTURE_TOP_FIELD",t[t.AV_PICTURE_STRUCTURE_BOTTOM_FIELD=2]="AV_PICTURE_STRUCTURE_BOTTOM_FIELD",t[t.AV_PICTURE_STRUCTURE_FRAME=3]="AV_PICTURE_STRUCTURE_FRAME",t}(Xt||{}),Zt=function(t){return t[t.MMCO_END=0]="MMCO_END",t[t.MMCO_SHORT2UNUSED=1]="MMCO_SHORT2UNUSED",t[t.MMCO_LONG2UNUSED=2]="MMCO_LONG2UNUSED",t[t.MMCO_SHORT2LONG=3]="MMCO_SHORT2LONG",t[t.MMCO_SET_MAX_LONG=4]="MMCO_SET_MAX_LONG",t[t.MMCO_RESET=5]="MMCO_RESET",t[t.MMCO_LONG=6]="MMCO_LONG",t}(Zt||{}),qt=function(t){return t[t.AV_PICTURE_TYPE_NONE=0]="AV_PICTURE_TYPE_NONE",t[t.AV_PICTURE_TYPE_I=1]="AV_PICTURE_TYPE_I",t[t.AV_PICTURE_TYPE_P=2]="AV_PICTURE_TYPE_P",t[t.AV_PICTURE_TYPE_B=3]="AV_PICTURE_TYPE_B",t[t.AV_PICTURE_TYPE_S=4]="AV_PICTURE_TYPE_S",t[t.AV_PICTURE_TYPE_SI=5]="AV_PICTURE_TYPE_SI",t[t.AV_PICTURE_TYPE_SP=6]="AV_PICTURE_TYPE_SP",t[t.AV_PICTURE_TYPE_BI=7]="AV_PICTURE_TYPE_BI",t}(qt||{}),Jt=function(t){return t[t.HEVC_SLICE_B=0]="HEVC_SLICE_B",t[t.HEVC_SLICE_P=1]="HEVC_SLICE_P",t[t.HEVC_SLICE_I=2]="HEVC_SLICE_I",t}(Jt||{}),$t=[qt.AV_PICTURE_TYPE_P,qt.AV_PICTURE_TYPE_B,qt.AV_PICTURE_TYPE_I,qt.AV_PICTURE_TYPE_SP,qt.AV_PICTURE_TYPE_SI],te="raw-demuxer",ee=function(t){function e(e,i,n,r,a){var o;return e.i(te,"constructor"),(o=t.call(this,e,i,n,r,a)||this).ah=!1,o.uh=void 0,o.mr=0,o.fh=0,o.Ti=0,o.Ah=A.f/A.d,o.dh=void 0,o.bh(),o.Qe=new k.a(o.Ci),o}_()(e,t),e.probe=function(t){return t.length>4&&0===t[0]&&0===t[1]&&0===t[2]&&1===t[3]};var i=e.prototype;return i.resetInitSegment=function(e){this.He(e.duration),t.prototype.resetInitSegment.call(this,e),this.ah=!1,this.uh=void 0,this.mr=0,this.fh=0,this.bh(),this.Ci.i(te,"reset init")},i.append=function(t,e,i,n,r){var a=this.ph(t);if(this.Ue||(this.Ue={timeOffset:e,contiguous:i,accurateTimeOffset:n}),a&&a.length){var o=-this._t.unreadLen;this._t.put(t);for(var s=0,u=0;u<a.length;u++){var c=a[u];if(s=c.pos-o-c.state){var l=this._t.get(s);this._t.skip(c.state),l&&(l=3===c.state&&0===l[l.length-1]?l.subarray(0,l.length-1):l,this.mh(l))}else this._t.skip(c.state);o=c.pos}}else this._t.put(t);if(r){var h,d=this._t.get(this._t.unreadLen);d&&(this.mh(d),this.uh&&this.Mi&&this.gh(),this.flush());var f={duration:(this.Ti+this.Ah)/((null==(h=this.Mi)?void 0:h.inputTimescale)||A.f)};this.Ai.emit(N.a.METADATA,f)}},i.He=function(e){var i;t.prototype.He.call(this,e),this.Mi.naluState=0,this.Mi.active=this.Ye(),O.a.initAudioForFillSilent(this.Ci,this.Ne,null==(i=this._i)?void 0:i.audioCodec)},i.ph=function(t){var e=this.Mi;if(e){for(var i=t.byteLength,n=[],r=0,a=e.naluState;r<i;)i-r>3&&0===a?(1===t[r+2]?0===t[r+1]&&0===t[r]&&n.push({pos:r+3,state:3}):0===t[r+2]&&(a=1,0===t[r+1]&&(a=2,0===t[r]&&(a=3))),r+=3):(a<2?0===t[r]?a++:a=0:3===a||2===a?1===t[r]?(n.push({pos:r+1,state:a+1}),a=0):t[r]>1&&(a=0):this.Ci.w(te,"error state",a),r++);return e.naluState=a,n}},i.Ke=function(t){var e;void 0===t&&(t=!1),this.gh();var i=this.Ne,r=this.Mi;if(this.We(i,r)&&(null==(e=this.Qe)||e.update(i,r),this.Xe(i,r,t))){var a=Object(Nt.a)(r,this.fh);this.Ai.emit(N.a.VIDEO_FRAME_INFO,{videoFramesInfo:a}),this.Ve&&this.Ai.emit(N.a.KEY_FRAME_INDEXS,{keyframes:[{time:0,position:0}]}),this.qe(i,r,t,n.b.RAW)}},i.mh=function(t){var e=this.Mi;if(e){if(!e.codecType||e.codecType===M.c.unknown){var i=31&t[0],n=(126&t[0])>>1;if(i>=B.H264_NAL_SPS&&i<=B.H264_NAL_AUD)e.codecType=M.c.h264,this.dh={pict_type:qt.AV_PICTURE_TYPE_NONE,picture_structure:Xt.AV_PICTURE_STRUCTURE_UNKNOWN,key_frame:0,priv_data:{picture_structure:Xt.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(N.a.VIDEO_CODEC_DETECTED,{enabled:!0,decoder:M.d.buildin,codecType:M.c.h264,timeOffset:0});else{if(!(n>=V.a.HEVC_NAL_VPS&&n<=V.a.HEVC_NAL_AUD||n===V.a.HEVC_NAL_SEI_PREFIX||n===V.a.HEVC_NAL_SEI_SUFFIX))return void this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,"unsupport codec"));var a,o,s,u;this.dh={pict_type:qt.AV_PICTURE_TYPE_NONE,picture_structure:Xt.AV_PICTURE_STRUCTURE_UNKNOWN,key_frame:0,priv_data:{ps:{spsList:[],ppsList:[],vpsList:[]},poc:0,pocTid0:0,max_dec_pic_buffering:0}},".kvc3"===(null==(a=this._i)?void 0:a.suffix)?e.codecType=M.c.kvc3:".kvc4"===(null==(o=this._i)?void 0:o.suffix)?e.codecType=M.c.kvc4:".kvc5"===(null==(s=this._i)?void 0:s.suffix)?e.codecType=M.c.kvc5:".kvc6"===(null==(u=this._i)?void 0:u.suffix)?e.codecType=M.c.kvc6:e.codecType=M.c.hevc}}e.codecType===M.c.h264?this.yh(t):W(e.codecType)&&this._h(t)}},i.yh=function(t){var e=this.dh,i=this.Mi;if(e&&i){var n=e.priv_data,r=[0,0],a=0;e.pict_type=qt.AV_PICTURE_TYPE_I,e.key_frame=0,e.picture_structure=Xt.AV_PICTURE_STRUCTURE_UNKNOWN;var o={ref_idc:t[0]>>5&3,type:31&t[0],nuh_layer_id:0,temporal_id:0,data:t};if(o.type===B.H264_NAL_IDR_SLICE&&(i.decConf&&this.Ke(),this.fh=this.mr,e.key_frame=1,n.poc.prev_frame_num=0,n.poc.prev_frame_num_offset=0,n.poc.prev_poc_msb=n.poc.prev_poc_lsb=0),o.type===B.H264_NAL_IDR_SLICE||o.type===B.H264_NAL_SLICE){var s=Object(j.c)(st(t.subarray(1,t.byteLength)));o.gbCtx=s,Object(j.h)(s);var u=Object(j.h)(s);e.pict_type=$t[u%5];var c=Object(j.h)(s),l=n.ps.ppsList[c],h=n.ps.spsList[l.sps_id];if(n.ps.sps=h,n.ps.pps=l,!(n.ps.sps&&n.ps.pps&&h&&l))throw new Error("raw nal slice error. sps/pps undefined");n.ps.sps.ref_frame_count<=1&&n.ps.pps.ref_count[0]<=1&&e.pict_type===qt.AV_PICTURE_TYPE_I&&(e.key_frame=1),n.poc.frame_num=Object(j.a)(s,h.log2_max_frame_num),h.frame_mbs_only_flag?n.picture_structure=Xt.AV_PICTURE_STRUCTURE_FRAME:Object(j.a)(s,1)?n.picture_structure=Xt.AV_PICTURE_STRUCTURE_TOP_FIELD+Object(j.a)(s,1):n.picture_structure=Xt.AV_PICTURE_STRUCTURE_FRAME,o.type===B.H264_NAL_IDR_SLICE&&Object(j.h)(s),0===h.pic_order_cnt_type&&(n.poc.poc_lsb=Object(j.a)(s,h.log2_max_poc_lsb),1==l.pic_order_present&&n.picture_structure==Xt.AV_PICTURE_STRUCTURE_FRAME&&(n.poc.delta_poc_bottom=Object(j.f)(s))),1!=h.pic_order_cnt_type||h.delta_pic_order_always_zero_flag||(n.poc.delta_poc[0]=Object(j.f)(s),1==l.pic_order_present&&n.picture_structure===Xt.AV_PICTURE_STRUCTURE_FRAME&&(n.poc.delta_poc[1]=Object(j.f)(s))),r[0]=r[1]=Number.MAX_SAFE_INTEGER;var d=this.Ch(r,h,n.poc,n.picture_structure,o.ref_idc);if(o.ref_idc&&o.type!==B.H264_NAL_IDR_SLICE&&(a=this.Ih(e,s))<0)return;if(n.poc.prev_frame_num=a?0:n.poc.frame_num,n.poc.prev_frame_num_offset=a?0:n.poc.frame_num_offset,0!==o.ref_idc&&(a?(n.poc.prev_poc_msb=0,n.poc.prev_poc_lsb=n.picture_structure===Xt.AV_PICTURE_STRUCTURE_BOTTOM_FIELD?0:r[0]):(n.poc.prev_poc_msb=n.poc.poc_msb,n.poc.prev_poc_lsb=n.poc.poc_lsb)),!i.decConf){var f;this.ah&&this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),Dt.updateAVCTrack(this.Ci,i,n.ps),this.nh(i);var p=wt.avcDecoderConfigToNalu(n.ps);this.uh&&(f=this.uh.units).push.apply(f,p),i.fps&&(this.Ah=i.inputTimescale/i.fps)}this.uh&&(-1!==this.uh.poc&&Math.floor(d/2)!==Math.floor(this.uh.poc/2)&&this.gh(),this.uh.units.push({type:o.type,data:o.data}),-1===this.uh.poc&&(this.uh.pts=this.mr?(d/2+this.fh+h.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=!!e.key_frame,this.uh.poc=d))}else if(o.type!==B.H264_NAL_AUD)if(o.type===B.H264_NAL_SPS){var _=pt.parse(t);_&&(n.ps.sps&&!Object(F.b)(n.ps.sps.data,_.data)&&(this.ah=!0),n.ps.spsList[_.sps_id]=_),Dt.onAVCDetected(this.Ci,i,this.di,this.li,this.Ye()),i.decConf&&this.Ke(),i.decConf=void 0}else if(o.type===B.H264_NAL_PPS){var v=ft.parse(t);v&&(n.ps.pps&&!Object(F.b)(n.ps.pps.data,v.data)&&(this.ah=!0),n.ps.ppsList[v.pps_id]=v),i.decConf&&this.Ke(),i.decConf=void 0}}},i._h=function(t){var e=this.dh,i=this.Mi;if(e&&i){var a,o=e.priv_data;e.pict_type=qt.AV_PICTURE_TYPE_I,e.key_frame=0,e.picture_structure=Xt.AV_PICTURE_STRUCTURE_UNKNOWN;var s={type:(126&t[0])>>1,nuh_layer_id:(1&t[0])<<5&t[1]>>3&31,temporal_id:(7&t[1])-1,ref_idc:0,data:t};if(!(s.nuh_layer_id>0))switch(s.type){case V.a.HEVC_NAL_TRAIL_N:case V.a.HEVC_NAL_TRAIL_R:case V.a.HEVC_NAL_TSA_N:case V.a.HEVC_NAL_TSA_R:case V.a.HEVC_NAL_STSA_N:case V.a.HEVC_NAL_STSA_R:case V.a.HEVC_NAL_BLA_W_LP:case V.a.HEVC_NAL_BLA_W_RADL:case V.a.HEVC_NAL_BLA_N_LP:case V.a.HEVC_NAL_IDR_W_RADL:case V.a.HEVC_NAL_IDR_N_LP:case V.a.HEVC_NAL_CRA_NUT:case V.a.HEVC_NAL_RADL_N:case V.a.HEVC_NAL_RADL_R:case V.a.HEVC_NAL_RASL_N:case V.a.HEVC_NAL_RASL_R:if(!i.decConf&&(this.ah&&this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),Dt.updateHEVCTrack(this.Ci,i,o.ps),i.decConf&&(this.nh(i),this.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{codecType:i.codecType||M.c.unknown,enabled:!!i.active,decoder:i.outputRaw?M.d.wasm:M.d.buildin,bitDepth:i.bitDepth,timeOffset:0}),i.fps&&(this.Ah=i.inputTimescale/i.fps),i.outputRaw))){var u=wt.hevDecoderConfigToSample(o.ps,this.uh?this.uh.dts:0);this.Ai.emit(N.a.RAW_DATA,{type:n.d.decoderConfig,samples:Q([u],i.inputTimescale),extra:this._i})}if(s.gbCtx=Object(j.c)(st(s.data.subarray(2,s.data.byteLength))),a=this.Oh(e,s))return a;break;case V.a.HEVC_NAL_AUD:break;case V.a.HEVC_NAL_SEI_PREFIX:case V.a.HEVC_NAL_SEI_SUFFIX:i.decConf?(this.gh(),this.uh&&this.uh.units.push({type:V.a.HEVC_NAL_SEI_PREFIX,data:t})):(o.ps.seiList||(o.ps.seiList=[]),o.ps.seiList.push({type:s.type,data:t}));break;case V.a.HEVC_NAL_SPS:var c=mt.parse(t,i.codecType);c&&(o.ps.sps&&!Object(F.b)(o.ps.sps.data,c.data)&&(this.ah=!0),o.ps.spsList[c.sps_id]=c,o.max_dec_pic_buffering=c.temporal_layer.reduce((function(t,e){return Math.max(t,e.max_dec_pic_buffering)}),0));var l=this.Ye();if(!(i.codecType===M.c.hevc?Dt.onHEVCDetected(this.Ci,i,this.di,this.li,l):Dt.onKVCDetected(this.Ci,i,this.di,l)))return void this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,"unsupport codec hevc"));i.decConf&&this.Ke(),i.decConf=void 0;break;case V.a.HEVC_NAL_PPS:var h=_t.parse(t);h&&(o.ps.pps&&!Object(F.b)(o.ps.pps.data,h.data)&&(this.ah=!0),o.ps.ppsList[h.pps_id]=h),i.decConf&&this.Ke(),i.decConf=void 0;break;case V.a.HEVC_NAL_VPS:var d=yt.parse(this.Ci,t);d&&(o.ps.vps&&!Object(F.b)(o.ps.vps.data,d.data)&&(this.ah=!0),o.ps.vpsList[d.vps_id]=d),i.decConf&&this.Ke(),i.decConf=void 0}}},i.gh=function(){this.Mi&&this.uh&&this.uh.units.length&&-1!==this.uh.pts&&(this.$e(this.uh),this.mr++,this.uh=void 0),this.uh||this.bh()},i.bh=function(){var t=this.mr*this.Ah;this.uh={poc:-1,key:!1,pts:-1,dts:t,cts:0,units:[],originDTS:t,originPTS:t,duration:this.Ah,size:0}},i.Oh=function(t,e){var i,n,r=t.priv_data,a=r.ps,o=e.gbCtx;if(!o)return-1;var s,u=Object(j.a)(o,1);(s=e).type>=16&&s.type<=23&&(t.key_frame=1,Object(j.g)(o,1));var c=Object(j.h)(o);if(a.pps=a.ppsList[c],!a.pps)throw new Error("raw hevc slice header error. pps undefined");if(a.sps=a.spsList[a.pps.sps_id],!a.sps)throw new Error("raw hevc slice header error. sps undefined");if(a.vps=a.vpsList[a.sps.vps_id],u)n=0;else{n=a.pps.dependent_slice_segments_enabled_flag?Object(j.a)(o,1):0;var l=Math.ceil(Math.log2(a.sps.ctb_width*a.sps.ctb_height)),h=Object(j.a)(o,l);if(h>=a.sps.ctb_width*a.sps.ctb_height)return this.Ci.i(te,"Invalid slice segment address: "+h+"."),-1}if(n)return 0;for(i=0;i<a.pps.num_extra_slice_header_bits;i++)Object(j.g)(o,1);var d=Object(j.h)(o);if(d!==Jt.HEVC_SLICE_I&&d!==Jt.HEVC_SLICE_P&&d!==Jt.HEVC_SLICE_B)return this.Ci.i(te,"Unknown slice type: %d.\n",d),-1;t.pict_type=d===Jt.HEVC_SLICE_B?qt.AV_PICTURE_TYPE_B:d===Jt.HEVC_SLICE_P?qt.AV_PICTURE_TYPE_P:qt.AV_PICTURE_TYPE_I,a.pps.output_flag_present_flag&&Object(j.g)(o,1),a.sps.separate_colour_plane_flag&&Object(j.g)(o,2);var f=function(t){return t.type===V.a.HEVC_NAL_IDR_W_RADL||t.type===V.a.HEVC_NAL_IDR_N_LP}(e);if(f)r.poc=0,this.Ke(),this.fh=this.mr;else{var p=Object(j.a)(o,a.sps.log2_max_poc_lsb);r.poc=this.wh(a.sps,r.pocTid0,p,e.type)}return 0===e.temporal_id&&e.type!==V.a.HEVC_NAL_TRAIL_N&&e.type!==V.a.HEVC_NAL_TSA_N&&e.type!==V.a.HEVC_NAL_STSA_N&&e.type!==V.a.HEVC_NAL_RADL_N&&e.type!==V.a.HEVC_NAL_RASL_N&&e.type!==V.a.HEVC_NAL_RADL_R&&e.type!==V.a.HEVC_NAL_RASL_R&&(r.pocTid0=r.poc),this.uh&&(-1!==this.uh.poc&&r.poc!==this.uh.poc&&this.gh(),this.uh.units.push({type:e.type,data:e.data}),-1===this.uh.pts&&(this.uh.pts=this.mr?(r.poc+this.fh+r.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=f,this.uh.poc=r.poc)),1},i.wh=function(t,e,i,n){var r,a=1<<t.log2_max_poc_lsb,o=e%a,s=e-o;return r=i<o&&o-i>=a/2?s+a:i>o&&i-o>a/2?s-a:s,n!==V.a.HEVC_NAL_BLA_W_LP&&n!==V.a.HEVC_NAL_BLA_W_RADL&&n!==V.a.HEVC_NAL_BLA_N_LP||(r=0),r+i},i.Ch=function(t,e,i,n,r){var a=1<<e.log2_max_frame_num,o=[];if(i.frame_num_offset=i.prev_frame_num_offset,i.frame_num<i.prev_frame_num&&(i.frame_num_offset+=a),0===e.pic_order_cnt_type){var s=1<<e.log2_max_poc_lsb;i.prev_poc_lsb<0&&(i.prev_poc_lsb=i.poc_lsb),i.poc_lsb<i.prev_poc_lsb&&i.prev_poc_lsb-i.poc_lsb>=s/2?i.poc_msb=i.prev_poc_msb+s:i.poc_lsb>i.prev_poc_lsb&&i.prev_poc_lsb-i.poc_lsb<-s/2?i.poc_msb=i.prev_poc_msb-s:i.poc_msb=i.prev_poc_msb,o[0]=o[1]=i.poc_msb+i.poc_lsb,n===Xt.AV_PICTURE_STRUCTURE_FRAME&&(o[1]+=i.delta_poc_bottom)}else if(1===e.pic_order_cnt_type){var u,c,l,h;for(u=0!==e.num_ref_frames_in_pic_order_cnt_cycle?i.frame_num_offset+i.frame_num:0,0===r&&u>0&&u--,c=0,h=0;h<e.num_ref_frames_in_pic_order_cnt_cycle;h++)c+=e.offset_for_ref_frame[h];if(u>0){var d=(u-1)/e.num_ref_frames_in_pic_order_cnt_cycle,f=(u-1)%e.num_ref_frames_in_pic_order_cnt_cycle;for(l=d*c,h=0;h<=f;h++)l+=e.offset_for_ref_frame[h]}else l=0;0==r&&(l+=e.offset_for_non_ref_pic),o[0]=l+i.delta_poc[0],o[1]=o[0]+e.offset_for_top_to_bottom_field,n===Xt.AV_PICTURE_STRUCTURE_FRAME&&(o[1]+=i.delta_poc[1])}else{var p=2*(i.frame_num_offset+i.frame_num);r||p--,o[0]=p,o[1]=p}return n!==Xt.AV_PICTURE_STRUCTURE_BOTTOM_FIELD&&(t[0]=o[0]),n!==Xt.AV_PICTURE_STRUCTURE_TOP_FIELD&&(t[1]=o[1]),Math.min(t[0],t[1])},i.Ih=function(t,e){var i=t.priv_data;if(!i.ps.pps)return-1;var n=3&t.pict_type,r=0,a=[];i.ps.pps.redundant_pic_cnt_present&&Object(j.h)(e),n===qt.AV_PICTURE_TYPE_B&&Object(j.a)(e,1);var o={list_count:r};if(this.Eh(o,a,e,i.ps.pps,n,i.picture_structure)<0)return-2;if(r=o.list_count,n!==qt.AV_PICTURE_TYPE_I)for(var s=0;s<r;s++)if(Object(j.a)(e,1))for(var u=0;;u++){var c=Object(j.h)(e);if(!(c<3)){if(c>3)return this.Ci.i(te,"illegal reordering_of_pic_nums_idc %d\n",c),-3;break}if(Object(j.h)(e),u>=a[s])return this.Ci.i(te,"reference count %d overflow\n",u),-4}if((i.ps.pps.weighted_pred&&n===qt.AV_PICTURE_TYPE_P||1===i.ps.pps.weighted_bipred_idc&&n==qt.AV_PICTURE_TYPE_B)&&i.ps.sps&&this.jh(e,i.ps.sps,a,n,{use_weight:0,use_weight_chroma:0,luma_log2_weight_denom:0,chroma_log2_weight_denom:0,luma_weight_flag:[],chroma_weight_flag:[]}),Object(j.a)(e,1))for(var l=0;l<66;l++){var h=Object(j.h)(e);if(h>Zt.MMCO_LONG)return this.Ci.i(te,"illegal memory management control operation "+h),-5;if(h===Zt.MMCO_END)return 0;if(h===Zt.MMCO_RESET)return 1;h!==Zt.MMCO_SHORT2UNUSED&&h!==Zt.MMCO_SHORT2LONG||Object(j.h)(e),h!==Zt.MMCO_SHORT2LONG&&h!==Zt.MMCO_LONG2UNUSED&&h!==Zt.MMCO_LONG&&h!==Zt.MMCO_SET_MAX_LONG||Object(j.h)(e)}return 0},i.Eh=function(t,e,i,n,r,a){var o;if(e[0]=n.ref_count[0],e[1]=n.ref_count[1],r!==qt.AV_PICTURE_TYPE_I){var s=[];if(s[0]=s[1]=a===Xt.AV_PICTURE_STRUCTURE_FRAME?15:31,Object(j.a)(i,1)&&(e[0]=Object(j.h)(i)+1,r===qt.AV_PICTURE_TYPE_B?e[1]=Object(j.h)(i)+1:e[1]=1),o=r===qt.AV_PICTURE_TYPE_B?2:1,e[0]-1>s[0]||2==o&&e[1]-1>s[1])return this.Ci.i(te,"reference overflow %u > %u or %u > %u\n",e[0]-1,s[0],e[1]-1,s[1]),e[0]=e[1]=0,t.list_count=0,e[0]=0,e[1]=0,-1;e[1]-1>s[1]&&(this.Ci.i(te,"reference overflow %u > %u \n",e[1]-1,s[1]),e[1]=0)}else o=0,e[0]=e[1]=0;return t.list_count=o,0},i.jh=function(t,e,i,n,r){var a,o;for(r.use_weight=0,r.use_weight_chroma=0,r.luma_log2_weight_denom=Object(j.h)(t),r.luma_log2_weight_denom>7&&(this.Ci.i(te,"luma_log2_weight_denom %d is out of range\n",r.luma_log2_weight_denom),r.luma_log2_weight_denom=0),e.chroma_format_idc&&(r.chroma_log2_weight_denom=Object(j.h)(t),r.chroma_log2_weight_denom>7&&(this.Ci.i(te,"chroma_log2_weight_denom %d is out of range\n",r.chroma_log2_weight_denom),r.chroma_log2_weight_denom=0)),a=0;a<2;a++){for(r.luma_weight_flag[a]=0,r.chroma_weight_flag[a]=0,o=0;o<i[a];o++)if(Object(j.a)(t,1)&&(Object(j.f)(t),Object(j.f)(t)),e.chroma_format_idc&&Object(j.a)(t,1))for(var s=0;s<2;s++)Object(j.f)(t),Object(j.f)(t);if(n!==qt.AV_PICTURE_TYPE_B)break}return r.use_weight=r.use_weight||r.use_weight_chroma,0},i.nh=function(t){(!t.fps||t.fps>A.n)&&(t.fps=A.d)},f()(e,null,[{key:"probeSize",get:function(){return 4}}])}(P),ie=function(){function t(t,e,i){var n=this;this.kh=void 0,this.Mh=void 0,this.decryptAacSamples=function(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)){var r=n.kh.isSync();if(n.Sh(t,e,i,r),!r)return}}},this.Bh=function(t,e){for(var i=new Uint8Array(e),n=0,r=32;r<=t.length-16;r+=160,n+=16)t.set(i.subarray(n,n+16),r);return t},this.Th=function(t,e,i,r,a,o){var s=st(a.data),u=n.Dh(s);n.Rh(u.buffer,(function(u){a.data=n.Bh(s,u),o||n.decryptAvcSamples(t,e,i+1,r)}))},this.Mh=i,this.kh=new h(t,e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptAvcSamples=function(t,e,i,n){for(;;e++,i=0){if(e>=t.length)return void n();for(var r=t[e].units;!(i>=r.length);i++){var a=r[i];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var o=this.kh.isSync();if(this.Th(t,e,i,n,a,o),!o)return}}}},e.Rh=function(t,e){this.Mh.key&&this.kh.decrypt(t,this.Mh.key.buffer,this.Mh.iv.buffer,e)},e.Sh=function(t,e,i,n){var r=this,a=t[e];if(a){var o=a.unit,s=o.subarray(16,o.length-o.length%16),u=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.Rh(u,(function(a){a=new Uint8Array(a),o.set(new Uint8Array(a),16),n||r.decryptAacSamples(t,e+1,i)}))}},e.Dh=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,i=new Uint8Array(e),n=0,r=32;r<=t.length-16;r+=160,n+=16)i.set(t.subarray(r,r+16),n);return i},t}(),ne=function(t){return t[t.registration=5]="registration",t[t.av1=95]="av1",t[t.opus=127]="opus",t}({}),re={5:function(t,e){D()(t,{descriptor_name:"registration",format_identifier:Object(F.a)(e,0,4)})}};function ae(t,e){var i={descriptor_tag:t[e],descriptor_length:t[e+1]},n=re[i.descriptor_tag];return n&&n(i,t.subarray(e+2,e+2+i.descriptor_length)),i}var oe="ts-demuxer",se=function(t){function e(e,i,a,o,s){var u;return e.i(oe,"constructor"),(u=t.call(this,e,i,a,o,s)||this).Lh=void 0,u.Nh=!1,u.Qh=-1,u.Vn=0,u.xh=0,u.Vh=null,u.Uh=null,u.Fh=null,u.Ph=!1,u.Hh=0,u.Yh=!1,u.Gh=0,u.Kh={aacOverhead:0,unknownTSPacketCount:0},u.Zh={spsList:[],ppsList:[],vpsList:[]},u.Wh={spsList:[],ppsList:[]},u.Xh=void 0,u.ah=!1,u.zh=!1,u.Gn=void 0,u.Jh=function(t,e){return(31&t[e+10])<<8|t[e+11]},u.qh=function(t,e,i,n){var r,a,o,s,c={audio:-1,video:-1,id3:-1,aCodecType:M.c.unknown,codecType:M.c.h264};r=(15&t[e+1])<<8|t[e+2],a=e+3+r-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;for(var l=function(){s=(31&t[e+1])<<8|t[e+2];var r=t[e];if(u.Ci.i(oe,"PMT stream_type: "+r),207===r&&n||15===r)-1===c.audio&&(c.audio=s),c.aCodecType=M.c.aac;else if(21===r)-1===c.id3&&(c.id3=s);else if(219===r&&n||27===r)-1===c.video&&(c.video=s);else if(3===r||4===r)i.mpeg||i.mp3?-1===c.audio&&(c.audio=s):u.Ci.i(oe,"MPEG audio found, not supported in this browser for now"),c.aCodecType=M.c.mp3;else if(6===r||r>=128&&r<=255){r>=128&&r<=255&&u.Ci.i(oe," PMT User Private: "+r);var a=4095&Object(F.f)(t,e+3);if(a){var o=!1,l=!1,h=!1,d=!1,f=!1;u.$h(t,e+5,a).forEach((function(t){if(t.descriptor_tag===ne.av1)o=!0;else if(t.descriptor_tag!==ne.opus&&t.descriptor_tag===ne.registration){var e=t.format_identifier;"AV01"===e&&(o=!0),"KVC3"===e&&(l=!0),"KVC4"===e&&(h=!0),"KVC5"===e&&(d=!0),"KVC6"===e&&(f=!0)}})),o&&(i.av1?-1===c.video&&-1===c.video&&(c.video=s):u.Ci.i(oe,"AV1 video found, not supported in this browser for now"),c.codecType=M.c.av1),l&&(c.codecType=M.c.kvc3,-1===c.video&&(c.video=s)),h&&(c.codecType=M.c.kvc4,-1===c.video&&(c.video=s)),d&&(c.codecType=M.c.kvc5,-1===c.video&&(c.video=s)),f&&(c.codecType=M.c.kvc6,-1===c.video&&(c.video=s))}}else 36===r?(c.codecType=M.c.hevc,-1===c.video&&(c.video=s)):u.Ci.v("unkown stream type:"+r);e+=5+((15&t[e+3])<<8|t[e+4])};e<a;)l();return c},u.io=function(t,e){void 0===e&&(e=!1);var i,n,r,a,o,s,c=t.data,l=0,h=0,d=0,f=0,p=0;if(t&&0!==t.size){for(;c[0].length<19&&c.length>1;){var _=new Uint8Array(c[0].length+c[1].length);_.set(c[0]),_.set(c[1],c[0].length),c[0]=_,c.splice(1,1)}if(((i=c[0])[0]<<16)+(i[1]<<8)+i[2]===1){if((r=(i[4]<<8)+i[5])&&r>t.size-6||0===r&&!e)return;if(192&(n=i[7]))if(f=h=536870912*(14&i[9])+4194304*(255&i[10])+16384*(254&i[11])+128*(255&i[12])+(254&i[13])/2,64&n){if(p=d=536870912*(14&i[14])+4194304*(255&i[15])+16384*(254&i[16])+128*(255&i[17])+(254&i[18])/2,Math.abs(h-d)>60*A.q)if(u.Ci.w(oe,Math.round((h-d)/A.q)+"s delta between PTS and DTS, align them"),Object(Ut.a)(d,h)){u.Ci.i(oe,"pes DTS > 33bit. align DTS:"+d+" PTS: "+h);var v=h+8589934591-d;v>0&&v<60*A.q?h+=8589934591:d=h}else d=h}else d=h,p=f;s=(a=i[8])+9,t.size-=s,o=new Uint8Array(t.size);for(var g=0,m=c.length;g<m;g++){var b=(i=c[g]).byteLength;if(s){if(s>b){s-=b;continue}i=i.subarray(s),b-=s,s=0}o.set(i,l),l+=b}return r&&(r-=a+3),{data:o,pts:h,dts:d,originDTS:p,originPTS:f,len:r}}}},u.eo=function(t,e){if(t.units.length&&t.frame){var i=e.samples,n=i.length;(!u.di.forceKeyFrameOnDiscontinuity||!0===t.key||e.decConf&&(n||u.Ph))&&(u.di.gopRemux&&t.key&&i&&i.length>1&&u.Ue&&u.Ke(),t.id=u.Mi.samples.length,t.size=t.units.reduce((function(t,e){return t+e.data.byteLength}),0),u.$e(t),!u.di.gopRemux&&u.Mi.samples.reduce((function(t,e){return t+e.size}),0)>A.o&&(u.Ci.i(oe,"max size remux"),u.Ke()))}},u.no=function(t,e){if("number"==typeof u.Le&&!Object(Ut.a)(u.Le,e.dts)&&e.dts-u.Le<90){var i=e.pts-e.dts;e.dts=u.Le+90,e.pts=e.dts+i}var n={key:t,pts:e.pts,dts:e.dts,cts:e.pts-e.dts,units:[],originDTS:e.originDTS,originPTS:e.originPTS,size:0};return Object(Ut.a)(u.xh,e.originPTS)&&(u.Ci.i(oe,"pts overflow last: "+u.xh+" curr: "+e.originPTS),n.keyTime=!0),u.Le=e.dts,u.xh=e.originPTS,n},u.so=function(t,e){if(t.data){var i,n=u.Mi,r=u.Fh;n.codecType===M.c.av1?(u.Gn||(u.Gn=at.createCtx()),i=at.parseOBU(t.data,u.Gn)):i=u.ro(t.data),t.data=null,r&&r.frame&&i.length&&(!n.audFound||r.originPTS!==t.originPTS)&&(u.eo(r,n),r=u.Fh=u.no(!1,t)),W(n.codecType)?r=u._h(i,t):n.codecType===M.c.h264?r=u.ho(i,t):n.codecType===M.c.av1&&(r||(r=u.Fh=u.no(!1,t)),i.forEach((function(t){if(t.obu_type===w.AV1_OBU_SEQUENCE_HEADER){var e=t.content;e&&u.Xh&&!Object(F.b)(u.Xh.data,e.data)&&n.decConf&&(u.oo(!0),u.De.iSGenerated&&u._i&&u.De.resetInitSegment(u._i)),u.Xh=e,Dt.updateAV1Track(u.Ci,n,e)}var i;r&&(r.frame=r.frame||t.obu_type===w.AV1_OBU_FRAME||t.obu_type===w.AV1_OBU_FRAME_HEADER,r.key=r.key||t.obu_type!==w.AV1_OBU_SEQUENCE_HEADER&&!(null==(i=t.content)||!i.keyframe),r.units.push({type:0,data:t.data}))}))),e&&r&&(u.eo(r,n),u.Fh=null)}},u.ao=function(t){if(t.data){var e=t.data,i=u.Ne,n=e.length,r=0,a=0,o=t.pts;if(void 0!==o)for(;a<n;)if(T(e,a)){var s=C(i,e,a,o,r);if(!s)break;a+=s.length,r++}else a++;else u.Ci.w("[tsdemuxer]: MPEG PES unknown PTS")}},u.uo=function(t){var e;if(t.data){var i,a,o,s,c,l,h=u.Ne,d=u.Uh,f=t.data,p=t.pts,_=u.Vh,A=null;if(u.Re=t.dts,_){var g=new Uint8Array(_.byteLength+f.byteLength);g.set(_,0),g.set(f,_.byteLength),f=g}for(o=0,s=f.length;o<s-1&&!v.f(f,o);o++);if(o&&(o<s-1?(c="AAC PES did not start with ADTS header,offset:"+o,l=!1):(c="no ADTS header found in AAC PES",l=!0),u.Ci.w("parsing error:"+c),u.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,c,{fatal:l})),l))return;var m=f.subarray(o+2,o+4);if((v.g(h,m)||!h.configParsed)&&u.De.iSGenerated&&u._i&&u.De.resetInitSegment(u._i),v.d(u.Ci,h,u.Ai,m,n.a.ADTS,null==(e=u._i)?void 0:e.audioCodec),a=0,i=v.c(h.samplerate,h.inputTimescale),d&&(u.Gh||(u.Gh=p<d?1:0),u.Gh||_)){var b=d+i;Math.abs(b-p)>1&&(u.Ci.v("AAC: align PTS for overlapping frames by "+Math.round((b-p)/90)),p=b)}for(;o<s;)if(v.f(f,o)&&o+5<s){var y=v.a(u.Ci,h,f,o,p,a,t.originPTS);if(!y){o++;break}if(u.di.enableAacPriv&&"number"==typeof h.aacSampleingIndex&&"number"==typeof h.aot){var E=v.h(u.Ci,y.sample.unit,h.aacSampleingIndex,h.aot);E&&(y.sample.aacPriv=[{payload:E.priv,streamTimestamp:Object(Ut.c)(y.sample.originPTS)}])}o+=y.length,A=y.sample.pts,y.sample.originDTS=t.originDTS,y.sample.originPTS=t.originPTS,a++}else o++;a>1&&(u.Kh.aacOverhead=1),_=o<s?f.subarray(o,s):null,u.Vh=_,u.Uh=A}},u.Lh=void 0,u}_()(e,t);var i=e.prototype;return i.setDecryptData=function(t){ie&&t&&t.key&&"SAMPLE-AES"===t.method?this.Lh=new ie(this.Ci,this.di,t):this.Lh=void 0},e.probe=function(t){return!(e.co(t)<0)},e.co=function(t){for(var e=Math.min(1e3,t.length-564),i=0;i<e;){if(71===t[i]&&71===t[i+188]&&71===t[i+376])return i;i++}return-1},i.resetInitSegment=function(e){this.Nh=!1,this.Qh=-1,this.He(e.duration),this.Vh=null,this.Uh=null,this.Fh=null,this.Vn=e.duration,this.xh=0,this.Gh=0,this.Kh.aacOverhead=0,t.prototype.resetInitSegment.call(this,e),e.stat=this.Kh},i.append=function(t,e,i,n,a,o){void 0===a&&(a=!1),this.Fe=o,this.Ph=i,this.Hh=e,this.Yh=n,this.Ue||(this.Ue={timeOffset:e,contiguous:i,accurateTimeOffset:n});var s,u,c,l,h,d=this.Mi,f=this.Ne,p=this.Jh,_=this.qh,v=this.io,A=this.so,g=this.uo,m=this.ao,b=t.length;this.Nh;var y=d.pid,E=f.pid,C=this.Qh,T=d.pesData,I=f.pesData;if(!t.byteLength&&a)return this.flush(),void this.fo();for(b-=(b+0)%188,s=0;s<b;s+=188)if(71===t[s]){if(u=!!(64&t[s+1]),c=((31&t[s+1])<<8)+t[s+2],(48&t[s+3])>>4>1){if((l=s+5+t[s+4])===s+188)continue}else l=s+4;switch(c){case y:u&&(T&&(h=v(T,!0))&&void 0!==h.pts&&A(h,!1),T={data:[],size:0}),T&&(T.data.push(t.subarray(l,s+188)),T.size+=s+188-l);break;case E:u&&(I&&(h=v(I))&&void 0!==h.pts&&(f.codecType===M.c.aac?g(h):m(h)),I={data:[],size:0}),I&&(I.data.push(t.subarray(l,s+188)),I.size+=s+188-l);break;case 0:u&&(l+=t[l]+1),C=this.Qh=p(t,l);break;case C:u&&(l+=t[l]+1);var R=_(t,l,this.li,!!this.Lh);if(R.video<0&&R.audio<0)return void this.Di(Object(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"no track found"));if(!this.Nh){var w={};this.Vn&&(w.duration=this.Vn),this.Ai.emit(N.a.METADATA,w)}var L=this.Ye(),D=this.Ge();R.video>0&&(!W(d.codecType)&&W(R.codecType)?R.codecType===M.c.hevc?Dt.onHEVCDetected(this.Ci,d,this.di,this.li,L):Dt.onKVCDetected(this.Ci,d,this.di,L):(d.codecType!==M.c.h264&&R.codecType===M.c.h264||d.codecType!==M.c.av1&&R.codecType===M.c.av1)&&this.Mi.outputRaw&&(this.Ke(!0),this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i),this.Mi.outputRaw=!1),R.codecType===M.c.h264?Dt.onAVCDetected(this.Ci,d,this.di,this.li,L):R.codecType===M.c.av1&&Dt.onAV1Detected(this.Ci,d,this.di,this.li,L),!1===d.active?d.pid=-1:d.pid=y=R.video,d.codecType=R.codecType),R.audio>0&&("boolean"==typeof D?this.Ne.active=D:f.active=!0,f.active&&(f.pid=E=R.audio),f.codecType=R.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(r.e)(r.b.MUX_ERROR,r.a.PARSING_ERROR,"TS packet did not start with 0x47",{fatal:!1}));T&&(h=v(T,a))&&void 0!==h.pts?(A(h,a),d.pesData=void 0):(this.Fh&&a&&(this.eo(this.Fh,d),this.Fh=null),d.pesData=T),I&&(h=v(I))&&void 0!==h.pts?(f.codecType===M.c.aac?g(h):m(h),f.pesData=void 0):(I&&I.size,f.pesData=I),(E>0&&0===f.samples.length||y>0&&0===d.samples.length||y<=0&&E<=0)&&!a||(!a&&this.di.gopRemux||this.Ke(a),a&&this.fo())},i.fo=function(){this.Ai.emit(N.a.PARSED_DATA,{extra:this._i})},i.Ao=function(){var t,e=this.Mi,i=this.Ne;e.pesData&&(t=this.io(e.pesData,!0))&&void 0!==t.pts&&this.so(t,!0),e.pesData=void 0,i.pesData&&(t=this.io(i.pesData))&&void 0!==t.pts&&(i.codecType===M.c.aac?this.uo(t):this.ao(t)),i.pesData=void 0},i.flush=function(){this.Ci.i(oe,"flush"),this.Ao(),t.prototype.flush.call(this),this.Fh=null},i.He=function(e){t.prototype.He.call(this,e,A.q),this.Mi.audFound=!1,this.Mi.naluState=0},i.oo=function(t){void 0===t&&(t=!1),this.Ue&&this.Ke(t)},i.Ke=function(t){var e;void 0===t&&(t=!1);var i=this.Ne,r=this.Mi;if(this.We(i,r)&&(this.Ze(i,r),this.Xe(i,r,t)&&(!this.zh||t))){null!=(e=this._i)&&e.stat&&(this._i.stat.audioNonMonotonous=this.Gh);var a=!0,o=0,s=!1;this.Ue&&(a=this.Ue.contiguous,o=this.Ue.timeOffset,s=this.Ue.accurateTimeOffset),this.Ve&&(this.Ve=!1,this.Ai.emit(N.a.MEDIA_DEMUX,{type:n.b.TS})),this.Lh?this.vo(i,r,o,a,s,t):this.De.remux(i,r,o,a,s,t),this.Ue=void 0}},i.vo=function(t,e,i,n,r,a){var o=this;void 0===a&&(a=!1),t.samples&&this.Lh?this.Lh.decryptAacSamples(t.samples,0,(function(){o.do(t,e,i,n,r,a)})):this.do(t,e,i,n,r,a)},i.do=function(t,e,i,n,r,a){var o=this;void 0===a&&(a=!1),e.samples&&this.Lh?this.Lh.decryptAvcSamples(e.samples,0,0,(function(){o.De.remux(t,e,i,n,r,a)})):this.De.remux(t,e,i,n,r,a)},i.$h=function(t,e,i){for(var n=i?e+i:t.byteLength,r=[];n-e>2;){var a=ae(t,e);r.push(a),e+=2+a.descriptor_length}return r},i._h=function(t,e){var i=this,n=this.Mi,r=this.Zh,a=[],o=[],s=this.Fh,u=!1;return t.forEach((function(t){var c;switch(t.type){case V.a.HEVC_NAL_IDR_W_RADL:case V.a.HEVC_NAL_IDR_N_LP:case V.a.HEVC_NAL_CRA_NUT:i.lo(),u=!0,s||(s=i.Fh=i.no(!1,e)),s.key=!0,s.frame=!0;break;case V.a.HEVC_NAL_AUD:u=!1,n.audFound=!0,s&&i.eo(s,n),s=i.Fh=i.no(!1,e);break;case V.a.HEVC_NAL_SPS:u=!0;var l=mt.parse(t.data,n.codecType);r.sps&&!Object(F.b)(r.sps.data,l.data)&&(i.ah=!0),r.spsList[l.sps_id]=l,r.sps=l;break;case V.a.HEVC_NAL_PPS:u=!0;var h=_t.parse(t.data);r.pps&&!Object(F.b)(r.pps.data,h.data)&&(i.ah=!0),r.ppsList[h.pps_id]=h,r.pps=h;break;case V.a.HEVC_NAL_VPS:u=!0;var d=yt.parse(i.Ci,t.data);r.vps&&!Object(F.b)(r.vps.data,d.data)&&(i.ah=!0),r.vpsList[d.vps_id]=d,r.vps=d;break;case V.a.HEVC_NAL_SEI_PREFIX:case V.a.HEVC_NAL_SEI_SUFFIX:a.push.apply(a,ut.parse(t.data.subarray(2)));case V.a.PRIV_NAL_MAGIC_HEVC:if(t.type===V.a.PRIV_NAL_MAGIC_HEVC)try{o.push(ot.parse(t.data,!1))}catch(t){i.Ci.w(oe,"PrivNal parse error "+t)}default:if(i.lo(),u=!0,void 0===t.type){u=!1;break}s||(s=i.Fh=i.no(!0,e)),s.frame=!0}s&&u&&(null==(c=s.units)||c.push(t))})),s&&(a.length&&(s.sei={sei:a,streamTimestamp:Object(Ut.c)(s.originPTS)}),o.length&&(s.privNal={info:o,streamTimestamp:Object(Ut.c)(s.originPTS)})),s},i.ho=function(t,e){var i,n=this,r=this.Mi,a=this.Wh,o=[],s=[],u=this.Fh,c=!1;return t.forEach((function(t){var l;switch(t.type){case B.H264_NAL_SLICE:n.lo(),i=!0,u||(u=n.Fh=n.no(!0,e)),u.frame=!0;var h=t.data;if(c&&h.length>4){var d=Object(j.c)(h);Object(j.g)(d,8),Object(j.h)(d);var f=Object(j.h)(d);2!==f&&4!==f&&7!==f&&9!==f||(u.key=!0)}break;case B.H264_NAL_IDR_SLICE:n.lo(),i=!0,u||(u=n.Fh=n.no(!0,e)),u.key=!0,u.frame=!0;break;case B.H264_NAL_SEI:o.push.apply(o,ut.parse(t.data.subarray(1))),i=!0;break;case B.PRIV_NAL_MAGIC_H264:try{s.push(ot.parse(t.data,!0))}catch(t){n.Ci.w(oe,"PrivNal parse error "+t)}i=!0;break;case B.H264_NAL_SPS:i=!0,c=!0;var p=pt.parse(t.data);a.sps&&!Object(F.b)(a.sps.data,p.data)&&(n.ah=!0),a.spsList[p.sps_id]=p,a.sps=p;break;case B.H264_NAL_PPS:i=!0;var _=ft.parse(t.data);a.pps&&!Object(F.b)(a.pps.data,_.data)&&(n.ah=!0),a.ppsList[_.pps_id]=_,a.pps=_;break;case B.H264_NAL_AUD:i=!1,r.audFound=!0,u&&n.eo(u,r),u=n.Fh=n.no(!1,e);break;case B.H264_NAL_FILLER_DATA:default:i=!1}u&&i&&(null==(l=u.units)||l.push(t))})),u&&(o.length&&(u.sei={sei:o,streamTimestamp:Object(Ut.c)(u.originPTS)}),s.length&&(u.privNal={info:s,streamTimestamp:Object(Ut.c)(u.originPTS)})),u},i.lo=function(){var t,e=this.Mi;e.decConf&&this.ah&&!this.Ve&&(this.Ci.i(oe,"remux on paramSets update."),this.oo(!0),this.De.iSGenerated&&this._i&&this.De.resetInitSegment(this._i));var i=!1;e.decConf&&!this.ah||(e.codecType===M.c.h264?this.Wh.spsList.length&&this.Wh.ppsList.length&&(Dt.updateAVCTrack(this.Ci,e,this.Wh),i=!0):this.Zh.spsList.length&&this.Zh.ppsList.length&&this.Zh.vpsList.length&&(Dt.updateHEVCTrack(this.Ci,e,this.Zh),i=!0)),i&&this.Ai.emit(N.a.VIDEO_CODEC_DETECTED,{enabled:!!e.active,decoder:e.outputRaw?M.d.wasm:M.d.buildin,codecType:e.codecType||M.c.unknown,bitDepth:e.bitDepth,timeOffset:(null==(t=this.Ue)?void 0:t.timeOffset)||0}),this.ah=!1},i.bo=function(){var t,e=this.Fh;if(!e||0===e.units.length){var i=this.Mi.samples;e=i[i.length-1]}if(e){var n=e.units;t=n[n.length-1]}return t},i.ro=function(t){var e,i,n,r,a=0,o=0,s=this.Mi.naluState||0,u=-1,c=this.Mi,l=t.byteLength,h=l,d=[],f=s;if(-1===s)u=0,r=W(c.codecType)?(126&t[0])>>1:31&t[0],s=0,a=1;else if(s>0)for(;o<4;o++){var p=t[o];if(0!==p){if(1===p&&s>=2){u=o+1,r=W(c.codecType)?(126&t[u])>>1:31&t[u],s=0;var _=this.bo();_&&f&&o<=4-f&&_.state&&(_.data=_.data.subarray(0,_.data.byteLength-f));break}o<l&&(s=0);break}s++,a=o+1}for(;a<h;)if(1===(e=t[a+2]))if(0===t[a]&&0===t[a+1]){if(s=a>0&&0===t[a-1]?3:2,a+=3,u>=0)n={data:t.subarray(u,a-s-1),type:r||0},d.push(n);else{var v=this.bo();if(v&&(i=a-s-1)>0){var A=new Uint8Array(v.data.byteLength+i);A.set(v.data,0),A.set(t.subarray(0,i),v.data.byteLength),v.data=A}}a<l?(u=a,r=W(c.codecType)?(126&t[a])>>1:31&t[a],s=0):s=-1}else a+=3;else 0===e?a++:a+=3;for(var g=l-1;g>l-4&&g>=o&&0===t[g];g--)s++;if(u>=0&&s>=0&&u<l&&(n={data:t.subarray(u,l),type:r||0,state:s},d.push(n)),0===d.length){var m=this.bo();if(m){var b=new Uint8Array(m.data.byteLength+t.byteLength);b.set(m.data,0),b.set(t,m.data.byteLength),m.data=b}}return c.naluState=s,d},f()(e,[{key:"minChunkSize",get:function(){return 188}},{key:"encryptedChunkSize",get:function(){return 752}}],[{key:"probeSize",get:function(){return 752}}])}(P),ue="demuxer-inline",ce=function(){function t(t,e,i,r,o){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 a.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=t,this.li=e,this.di=i,this.po=r,this.Ci=o,Ot&&this._o.push({Demux:Ot,Remux:Qt.b,type:n.b.FLV}),Yt&&this._o.push({Demux:Yt,Remux:Qt.b,type:n.b.MP4}),xt&&this._o.push({Demux:xt,Remux:Qt.b,type:n.b.IVF}),se&&this._o.push({Demux:se,Remux:Qt.b,type:n.b.TS}),ee&&this._o.push({Demux:ee,Remux:Qt.b,type:n.b.RAW}),this.Oo=this._o.reduce((function(t,e){return Math.max(e.Demux.probeSize,t)}),0)}var e=t.prototype;return e.pushMuxData=function(t,e,i,n,r,a,o,s,u,c){var l=this,d=t;if((o||a)&&this._t.clear(),c.progress&&this.Oo)if(this._t.put(t),u)d=this._t.get(this._t.unreadLen);else{var f=Math.floor(this._t.unreadLen/this.Oo)*this.Oo;if(!(f>=this.Oo))return void(this.Io||(this.Io={contiguous:r,trackSwitch:a,discontinuity:o,accurateTimeOffset:s}));d=this._t.get(f)}else this._t.unreadLen&&(this._t.put(t),d=this._t.get(this._t.unreadLen));if(d)if(t=d,this.Io&&(r=this.Io.contiguous,a=this.Io.trackSwitch,o=this.Io.discontinuity,s=this.Io.accurateTimeOffset,this.Io=void 0),t.byteLength>0&&e&&e.key&&"AES-128"===e.method){var p,_=this.kh;!_&&se&&h&&(_=this.kh=new h(this.Ci,this.di,{removePKCS7Padding:u})),o&&(this.mo=null);var v=this.mo?this.mo:e.iv;null==(p=_)||p.decrypt(t,e.key.buffer,v.buffer,(function(h){u?l.mo=null:(l.mo=new Uint8Array(16),l.mo.set(t.subarray(t.byteLength-16),0)),l.wo(new Uint8Array(h),e,i,n,r,a,o,s,u,c)}))}else e&&u&&(this.mo=null),this.wo(t,e,i,n,r,a,o,s,u,c)},e.flush=function(){this.Co&&this.Co.flush(),this._t.clear()},e.end=function(){this.Ai.emit(N.a.LOAD_END,{})},e.updateConfig=function(t){var e;this.Ci.i(ue,"update config",t),null==(e=this.Co)||e.updateConfig(t)},e.Eo=function(t,e){if(!this.Co||e&&this.yo&&!this.yo(t)){for(var i=this.Ai,a=this.li,o=this.di,s=0,u=this._o.length;s<u;s++){var c=this._o[s],l=c.Demux.probe;if(l(t)){this.De=new c.Remux(this.Ci,i,o,a,c.type===n.b.FLV?"":this.po),this.Co=new c.Demux(this.Ci,i,this.De,o,a),this.Ai.emit(N.a.DEMUXER_DETECTED,{type:c.type}),this.yo=l;break}}if(!this.Co)return void this.Ai.emit(N.a.ERROR,Object(r.e)(r.b.MUX_ERROR,r.a.DEMUX_NOT_FOUND,"no demux matching with content found"))}},e.wo=function(t,e,i,n,a,o,s,u,c,l){try{this.Co||this.Eo(t,!0);var h=this.Co,d=this.De;if(!d||!h)return;this.Oo=e?h.encryptedChunkSize||16:h.minChunkSize||0,(o||s)&&(h.resetInitSegment(l,i),d.resetInitSegment(l)),s&&(h.resetTimeStamp(),d.resetTimeStamp()),e&&Object.prototype.hasOwnProperty.call(h,"setDecryptData")&&h.setDecryptData(e),h.append(t,n,a,u,c,l.fragSn)}catch(t){this.Ci.i(ue,t),this.Ai.emit(N.a.ERROR,Object(r.e)(r.b.MUX_ERROR,r.a.REMUX_ERROR,t.message))}},t}();e.a=ce},function(t,e,i){var n,r=i(5),a=i.n(r),o=i(12),s=i(0),u=i(22),c=i(25),l="yuv2rgb-helper",h=new Float32Array([0,-.501960814,-.501960814,1,0,0,1,0,0,1,0,0]),d=new Float32Array([-.0627451017,-.501960814,-.501960814,1.1644,0,1.596,1.1644,-.3918,-.813,1.1644,2.0172,0]),f=new Float32Array([0,-.501960814,-.501960814,1,0,1.4075,1,-.3455,-.7169,1,1.779,0]),p=new Float32Array([-.0627451017,-.501960814,-.501960814,1.164,-.013561232000000003,1.365248481,1.164,-.345441461,-.756825597,1.164,2.059156233,.010008336]),_=new Float32Array([0,-.501960814,-.501960814,1,-.011864761000000005,1.197778023,1,-.302259224,-.6617980229999999,1,1.801888929,.008744828]),v=new Float32Array([-.0627451017,-.501960814,-.501960814,1.1644,0,1.7927,1.1644,-.2132,-.5329,1.1644,2.1124,0]),A=new Float32Array([0,-.501960814,-.501960814,1,0,1.581,1,-.1881,-.47,1,1.8629,0]),g=new Float32Array([-.062561095,-.500488759,-.500488759,1.1678,0,1.6836,1.1678,-.1879,-.6523,1.1678,2.1481,0]),m=new Float32Array([0,-.500488759,-.500488759,1,0,1.476,1,-.1647,-.5719,1,1.8832,0]),b=function(){function t(t,e){this.Ci=void 0,this.jo={rotation:0},this.ko=void 0,this.Ci=t,this.ko=null==e?void 0:e.preferCanvasColorSpace}var e=t.prototype;return e.update=function(t,e,i){void 0===i&&(i=0);var n,r=t.format.colorInfo||e;return Object(o.f)(this.jo.colorInfo,r)||(this.jo.matrix=this.Mo(t,r),this.Ci.i(l,"color info update",e)),n=this.jo.matrix?this.jo.matrix:this.jo.matrix=this.Mo(t,r),this.jo.buffer=t,this.jo.colorInfo=e=r,this.jo.rotation=i,n},e.destroy=function(){this.Ci.i(l,"destroy"),this.jo.buffer=void 0,this.jo.colorInfo=void 0},e.updatePreferCanvasColorSpace=function(t){var e=(this.ko||"srgb")!==(t||"srgb");return this.ko=t,e},e.Mo=function(t,e){return this.Ci.i(l,"generate yuv matrix color info",e),t.format.chroma===c.a.AV_PIX_FMT_MONO?(this.Ci.i(l,"generate yuv matrix: mono."),h):(e&&(e.matrixCoefficients===o.c.AVCOL_SPC_BT470BG?(this.Ci.i(l,"generate yuv matrix. color: BT470BG range: "+o.b[e.colorRange]+" matrix bt601. full: "+(e.colorRange===o.b.AVCOL_RANGE_JPEG)),i=e.colorRange===o.b.AVCOL_RANGE_JPEG?_:p):e.matrixCoefficients===o.c.AVCOL_SPC_SMPTE170M?(this.Ci.i(l,"generate yuv matrix. color: SMPTE170M range: "+o.b[e.colorRange]+" matrix bt601. full: "+(e.colorRange===o.b.AVCOL_RANGE_JPEG)),i=e.colorRange===o.b.AVCOL_RANGE_JPEG?f:d):e.matrixCoefficients===o.c.AVCOL_SPC_BT709?(this.Ci.i(l,"generate yuv matrix. color: BT709 range: "+o.b[e.colorRange]+" matrix bt709. full: "+(e.colorRange===o.b.AVCOL_RANGE_JPEG)),i=e.colorRange===o.b.AVCOL_RANGE_JPEG?A:v):e.matrixCoefficients===o.c.AVCOL_SPC_BT2020_NCL&&(this.Ci.i(l,"generate yuv matrix. color: BT2020_NCL range: "+o.b[e.colorRange]+" matrix bt2020. full: "+(e.colorRange===o.b.AVCOL_RANGE_JPEG)),i=e.colorRange===o.b.AVCOL_RANGE_JPEG?m:g)),i||(this.Ci.i(l,"generate yuv matrix. color: "+(e?o.c[e.matrixCoefficients]:"unknown")+" bits: "+t.y.bits+" height: "+t.format.height),t.y.bits>8?(this.Ci.i(l,"generate yuv matrix. matrix bt2020"),i=g):t.format.height<=576?(this.Ci.i(l,"generate yuv matrix. matrix 601 limit"),i=d):(this.Ci.i(l,"generate yuv matrix. matrix 709 limit"),i=v)),i);var i},a()(t,[{key:"preferCanvasColorSpace",get:function(){return this.ko}},{key:"colorInfo",get:function(){return this.jo.colorInfo}},{key:"drawData",get:function(){return this.jo}}])}(),y=i(21),E=i(32),C=i(6),T=i(54),I=i.n(T),R="canvas2d-frame",w=function(){function t(t,e,i,n){this.Ci=void 0,this.So=void 0,this.Bo=void 0,this.To=u.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,t.i(R,"constructor colorSpace: "+(null==i?void 0:i.preferCanvasColorSpace)),this.So=e,this.Ci=t,this.Bo=new b(t,i),this.Bo.updatePreferCanvasColorSpace(this.Bo.preferCanvasColorSpace),this.Pi=Object(y.a)(),this.Do=this.Pi.getContext("2d"),this.Qo=n||new I.a({logger:t}),"complete"===this.Qo.readyState?this.No="complete":"loading"===this.Qo.readyState&&(this.No="loading")}var e=t.prototype;return e.drawFrame=function(t,e,i){var n=this;if(this.Do&&this.Pi){var r,a,s=this.Bo.update(t,e,i);if(e=this.Bo.colorInfo,this.Lo=i||0,this.Ro&&(r=this.Ro).width===t.format.width&&r.height===t.format.height||(this.Ro=r=this.Uo(this.Pi,t)),"notSet"===this.No)return this.No="loading",this.Qo.initMap(s,(null==(a=e)?void 0:a.transferCharacteristics)||o.d.AVCOL_TRC_UNSPECIFIED,t.y.bits).then((function(e){return n.No="complete",e&&(n._yuv2rgb(t,r.data),n.Fo(r),n.Po()),e}));"loading"!==this.No&&(this._yuv2rgb(t,r.data),this.Fo(r),this.Po())}},e.Fo=function(t){var e=this.xo,i=this.Vo,n=this.Do,r=this.Lo;e&&i?(i.clearRect(0,0,e.width,e.height),i.putImageData(t,0,0),n&&(n.clearRect(0,0,n.canvas.width,n.canvas.height),90===r?(n.rotate(Math.PI/2),n.drawImage(e,0,0,e.width,e.height,0,-n.canvas.width,n.canvas.height,n.canvas.width),n.resetTransform()):270===r?(n.rotate(1.5*Math.PI),n.drawImage(e,0,0,e.width,e.height,-n.canvas.height,0,n.canvas.height,n.canvas.width),n.resetTransform()):180===r?(n.rotate(Math.PI),n.drawImage(e,0,0,e.width,e.height,-n.canvas.width,-n.canvas.height,n.canvas.width,n.canvas.height),n.resetTransform()):n.drawImage(e,0,0,e.width,e.height,0,0,n.canvas.width,n.canvas.height))):null==n||n.putImageData(t,0,0)},e._yuv2rgb=function(t,e){this.Qo.yuv2rgb(t.y.bytes,t.u.bytes,t.v.bytes,e,t.format.width,t.format.height,t.format.chroma,t.y.bits)},e.setPictMode=function(t){this.To!==t&&(this.Ci.i(R,"update pict mode",t),this.To=t,this.Po())},e.updatePreferCanvasColorSpace=function(t){var e=this.Bo.updatePreferCanvasColorSpace(t),i=this.Bo.drawData;return this.Pi&&i.buffer&&(this.Ro=this.Uo(this.Pi,i.buffer)),e},e.clear=function(){this.Ci.i(R,"clear"),this.So.clearRect(0,0,this.So.canvas.width,this.So.canvas.height)},e.destroy=function(){this.Ci.i(R,"destroy"),this.Qo.destroy(),this.Bo.destroy(),this.Xi()},e.Xi=function(){this.Pi=void 0,this.Do=void 0,this.xo=void 0,this.Vo=void 0},e.Po=function(){if(this.Pi){var t=0,e=0,i=this.Pi.width,n=this.Pi.height,r=0,a=0,o=this.So.canvas.width,s=this.So.canvas.height,c=this.So,l=i/n,h=o/s;this.To===u.a.contain?l>h?s-=2*(a=(s-o/l)/2):o-=2*(r=(o-s*l)/2):this.To===u.a.cover&&(l>h?i-=2*(t=(i-n*h)/2):n-=2*(e=(n-i/h)/2)),c.clearRect(0,0,c.canvas.width,c.canvas.height),c.drawImage(this.Pi,t,e,i,n,r,a,o,s)}},e.Uo=function(t,e){this.Ci.i(R,"init image data",e.format.width,e.format.height,this.Bo.preferCanvasColorSpace);for(var i=this.Bo.preferCanvasColorSpace?{colorSpace:this.Bo.preferCanvasColorSpace}:void 0,n=C.a.firefox?new ImageData(e.format.width,e.format.height):new ImageData(e.format.width,e.format.height,i),r=e.format.width*e.format.height,a=1;a<r;a++)n.data[4*a-1]=255;var o=this.Ho(e);if(90===this.Lo||270===this.Lo||180===this.Lo||o){this.xo||(this.xo=Object(y.a)(),this.Vo=this.xo.getContext("2d")),this.xo.width=e.format.width,this.xo.height=e.format.height;var s=e.format.width,u=e.format.height;if(o){var c=Object(E.a)(e.format.width,e.format.height,e.format.sar);s=c.width,u=c.height}if(90===this.Lo||270===this.Lo){var l=s;s=u,u=l}t.width=s,t.height=u}else t.width=e.format.width,t.height=e.format.height;return n},e.Ho=function(t){return!(!t.format.sar||t.format.sar.width===t.format.height)},a()(t,[{key:"preferCanvasColorSpace",get:function(){return this.Bo.preferCanvasColorSpace}},{key:"yuv2rgbLib",get:function(){return this.Qo}},{key:"ready",get:function(){return"complete"===this.No}},{key:"type",get:function(){return s.b.canvas2d}},{key:"drawData",get:function(){return this.Bo.drawData}},{key:"imageData",get:function(){var t;return null==(t=this.Do)?void 0:t.getImageData(0,0,this.Do.canvas.width,this.Do.canvas.height)}}])}(),L=i(8),D=i.n(L),S=i(10),O=i.n(S),N=i(14),k=i(3),x=i(44),P=i(2),M=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),U=new Float32Array([1,-0,0,0,1,0,0,0,1]),B=new Float32Array([0,-1,0,1,0,0,0,0,1]),V=new Float32Array([-1,0,0,0,-1,0,0,0,1]),F=new Float32Array([0,1,0,-1,0,0,0,0,1]),j="webgl-frame",H=function(){function t(t,e,i){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=u.a.cover,t.i(j,"constructor colorSpace: "+(null==i?void 0:i.preferCanvasColorSpace)),this.Yi=e,this.Ci=t,this.Bo=new b(t,i),Object(y.d)(e,this.Bo.preferCanvasColorSpace)}t.getRotMatrix=function(t){switch(t){case 90:return B;case 180:return V;case 270:return F}return U},t.oa=function(t,e){t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)};var e=t.prototype;return e.destroy=function(){this.Ci.i(j,"destroy");var t=this.Yi;if(t){this.aa(),this.Ci.i(j,"destroy. lose ctx");var e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}this.Bo.destroy()},e.setPictMode=function(t){if(this.To!==t){this.Ci.i(j,"update pict mode",t),this.To=t,this.clear();var e=this.Bo.drawData;e.buffer&&this.drawFrame(e.buffer,e.colorInfo,e.rotation)}},e.setWebGLCtx=function(t,e){void 0===e&&(e=u.a.contain),this.Ci.i(j,"set webgl",t,t!==this.Yi),this.To=e,t!==this.Yi&&(this.aa(),this.Yi=t)},e.updatePreferCanvasColorSpace=function(t){return Object(y.d)(this.Yi,t),this.Bo.updatePreferCanvasColorSpace(t)},e.ua=function(t){if(this.Yo[t])return this.Yo[t];var e=this.Yi;if(!e)return null;var i=e.createTexture();return i?(this.Yo[t]=i,i):null},e.ca=function(e,i,n,r,a){var o=this.Yi;if(o){var s=this.ua(e);o.activeTexture(o.TEXTURE0),t.oa(o,s),o.texImage2D(o.TEXTURE_2D,0,r>8?o.LUMINANCE_ALPHA:o.LUMINANCE,i,n,0,r>8?o.LUMINANCE_ALPHA:o.LUMINANCE,o.UNSIGNED_BYTE,a)}},e.fa=function(){this.Ci.i(j,"init");var t=this.Yi;t&&(this.Ko=this.Aa("\n    precision lowp float;\n\n    attribute vec2 aPosition;\n    attribute vec2 aLumaPosition;\n    attribute vec2 aChromaPosition;\n    varying vec2 vLumaPosition;\n    varying vec2 vChromaPosition;\n    uniform mat3 uMatrix;\n    void main() {\n        gl_Position = vec4((uMatrix * vec3(aPosition, 1)).xy, 0, 1);\n        vLumaPosition = aLumaPosition;\n        vChromaPosition = aChromaPosition;\n    }\n    ","\n    #define EOTF_C1 .8359375\n    #define EOTF_C2 18.8515625\n    #define EOTF_C3 18.6875\n    #define EOTF_HLG_GAMMA 0.2\n    #define _EOTF_HLG_A 0.17883277\n    #define _EOTF_HLG_B 0.28466892\n    #define _EOTF_HLG_C 0.55991073\n    #define MAIN_A 2.51\n    #define MAIN_B 0.03\n    #define MAIN_C 1.23\n    #define MAIN_D 0.59\n    #define MAIN_E 0.14\n    #define MAIN_ADAPTED_LUM 0.001\n\n    precision lowp float;\n\n    const vec3 eotf_m1 = vec3(1.0 / .1593017578125);\n    const vec3 eotf_m2 = vec3(1.0 / 78.84375);\n    const vec3 tonemapping_hlg_m1 = vec3(1.0 / 1.3);\n    const vec3 main_m1 = vec3(0.555555555556);\n    const vec3 main_m2 = vec3(2.0);\n    \n    // bt2020 to bt709\n    const mat3 mat_xyz_to_rgbp3 = mat3(\n        1.66049100210843, -0.124550474521591, -0.0181507633549054, \n        -0.587641138788548, 1.13289989712596, -0.100578898008008, \n        -0.0728498633198855, -0.00834942260436943, 1.11872966136291\n    );\n\n    float _eotf_hlg(float x) {\n        if (x < 0.5) {\n            return pow(x / 0.5, 2.0) / 12.0;\n        } else {\n            return (exp((x - _EOTF_HLG_C) / _EOTF_HLG_A) + _EOTF_HLG_B) / 12.0;\n        }\n    }\n\n    vec3 eotf_hlg(vec3 i) {\n        vec3 res;\n        float Y = 0.2627 * res.x + 0.6780 * res.y + 0.0593 * res.z;\n        res = pow(Y, EOTF_HLG_GAMMA) * res;\n        res.x = _eotf_hlg(i.x);\n        res.y = _eotf_hlg(i.y);\n        res.z = _eotf_hlg(i.z);\n        return res;\n    }\n\n    vec3 eotf(vec3 i) {\n        i = max(i, 1e-10);\n        vec3 input_m2 = pow(i, eotf_m2);\n        return pow((input_m2 - EOTF_C1) / (EOTF_C2 - EOTF_C3 * input_m2), eotf_m1) * 10000.0;\n    }\n\n    vec3 tonemapping_hlg(vec3 i) {\n        vec3 res = pow(i, tonemapping_hlg_m1);\n        return res;\n    }\n\n    float _trc_gamma(float i) {\n        if (i < 0.018) {\n            return 4.5 * i;\n        } else {\n            return 1.099 * pow(i, 0.45);\n        }\n    }\n\n    vec3 trc_gamma(vec3 i) {\n        vec3 res;\n        res.x = _trc_gamma(i.x);\n        res.y = _trc_gamma(i.y);\n        res.z = _trc_gamma(i.z);\n        return res;\n    }\n\n    uniform sampler2D uTextureY;\n    uniform sampler2D uTextureCb;\n    uniform sampler2D uTextureCr;\n    uniform vec3 uColorCovYOffset;\n    uniform mat3 uColorConversion;\n    uniform int uColorTrc;\n    uniform int uBitsPerPixel;\n    varying vec2 vLumaPosition;\n    varying vec2 vChromaPosition;\n\n    void main() {\n        vec3 yuv;\n        if (uBitsPerPixel > 8) {\n            float normalized = pow(2.0, float(uBitsPerPixel - 8));\n            yuv.x = (texture2D(uTextureY, vLumaPosition).r + texture2D(uTextureY, vLumaPosition).a * 256.0) / normalized;\n            yuv.y = (texture2D(uTextureCb, vChromaPosition).r + texture2D(uTextureCb, vChromaPosition).a * 256.0) / normalized;\n            yuv.z = (texture2D(uTextureCr, vChromaPosition).r + texture2D(uTextureCr, vChromaPosition).a * 256.0) / normalized;\n            yuv += uColorCovYOffset;\n            vec3 rgb = yuv * uColorConversion;\n\n            vec3 rgb_lum;\n            if (uColorTrc == 16) { // HDR10 or HDR10+\n                // 电光转换(EOTF)\n                rgb_lum = eotf(rgb);\n\n                //tone mapping\n                vec3 tmp = rgb_lum * MAIN_ADAPTED_LUM;\n                rgb_lum = tmp * (tmp * MAIN_A + MAIN_B) / (tmp * (tmp * MAIN_C + MAIN_D) + MAIN_E) / 1.3;\n                rgb_lum = pow(rgb_lum, main_m1) * pow(main_m2, rgb_lum) / 2.0; //g=1.8\n\n                //调节饱和度\n                float gray = (rgb_lum.x + rgb_lum.y + rgb_lum.z) / 2.0;\n                rgb_lum = rgb_lum + (rgb_lum * 1.5 - gray) * 0.12;\n            } else { // HLG\n                rgb_lum = eotf_hlg(rgb);\n                rgb_lum = tonemapping_hlg(rgb_lum);\n            }\n            vec3 rgbp3 = trc_gamma(mat_xyz_to_rgbp3 * rgb_lum);\n            gl_FragColor = vec4(rgbp3, 1.0);\n        } else {\n            yuv.x = texture2D(uTextureY, vLumaPosition).x;\n            yuv.y = texture2D(uTextureCb, vChromaPosition).x;\n            yuv.z = texture2D(uTextureCr, vChromaPosition).x;\n            yuv += uColorCovYOffset;\n            gl_FragColor = vec4(clamp(yuv * uColorConversion, 0.0, 1.0), 1.0);\n        }\n    }"),this.Ko&&(this.Zo=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.Zo),t.bufferData(t.ARRAY_BUFFER,M,t.STATIC_DRAW),this.Wo=t.getAttribLocation(this.Ko,"aPosition"),this.Xo=t.createBuffer(),this.zo=t.getAttribLocation(this.Ko,"aLumaPosition"),this.Jo=t.createBuffer(),this.qo=t.getAttribLocation(this.Ko,"aChromaPosition"),this.$o=t.getUniformLocation(this.Ko,"uColorCovYOffset"),this.ia=t.getUniformLocation(this.Ko,"uColorConversion"),this.ea=t.getUniformLocation(this.Ko,"uColorTrc"),this.na=t.getUniformLocation(this.Ko,"uBitsPerPixel"),this.ta=t.getUniformLocation(this.Ko,"textureSize"),this.sa=t.getUniformLocation(this.Ko,"uMatrix"),t.pixelStorei(t.UNPACK_ALIGNMENT,1)))},e.va=function(t,e,i){var n=this.Yi;n&&this.Ko&&(n.activeTexture(e),this.Yo[t]&&n.bindTexture(n.TEXTURE_2D,this.Yo[t]),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.uniform1i(n.getUniformLocation(this.Ko,t),i))},e.Aa=function(t,e){var i=this.Yi;if(i){this.Ci.i(j,"init program",i);var n=this.da(i.VERTEX_SHADER,t),r=this.da(i.FRAGMENT_SHADER,e);this.ra=n,this.ha=r;var a=i.createProgram();if(a&&n&&r){if(i.attachShader(a,n),i.attachShader(a,r),i.linkProgram(a),!i.getProgramParameter(a,i.LINK_STATUS)){var o=i.getProgramInfoLog(a);throw i.deleteProgram(a),new Error("GL program linking failed: "+o)}return a}}return null},e.da=function(t,e){var i=this.Yi;if(i){var n=i.createShader(t);if(n){if(i.shaderSource(n,e),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS)){var r=i.getShaderInfoLog(n);throw i.deleteShader(n),new Error("GL shader compilation for "+t+" failed: "+r)}return n}}return null},e.drawFrame=function(e,i,n){void 0===n&&(n=0);var r=this.Yi;if(r){var a=e.format,o=e.y.bits>8?2:1,s=!this.Ko||this.la(e.format),c=this.Bo.update(e,i,n);i=this.Bo.colorInfo,s&&this.clear(),this.Ko||this.fa(),s&&(this.ba(this.Xo,this.zo,e.y.stride/o,e.format),this.ba(this.Jo,this.qo,e.u.stride*a.width/a.chromaWidth/o,e.format)),this.ca("uTextureY",e.y.stride/o,e.format.height,e.y.bits,e.y.bytes),this.ca("uTextureCb",e.u.stride/o,e.format.chromaHeight,e.u.bits,e.u.bytes),this.ca("uTextureCr",e.v.stride/o,e.format.chromaHeight,e.v.bits,e.v.bytes),r.useProgram(this.Ko),this.To===u.a.contain?r.viewport((r.canvas.width-a.displayWidth)/2,(r.canvas.height-a.displayHeight)/2,a.displayWidth,a.displayHeight):this.To===u.a.cover?r.canvas.width/r.canvas.height>a.displayWidth/a.displayHeight?r.viewport(0,(r.canvas.height-a.displayHeight*(r.canvas.width/a.displayWidth))/2,r.canvas.width,r.canvas.height*(r.canvas.width/a.displayWidth)):r.viewport((r.canvas.width-a.displayWidth*(r.canvas.height/a.displayHeight))/2,0,r.canvas.width*(r.canvas.height/a.displayHeight),r.canvas.height):r.viewport(0,0,r.canvas.width,r.canvas.height),this.va("uTextureY",r.TEXTURE0,0),this.va("uTextureCb",r.TEXTURE1,1),this.va("uTextureCr",r.TEXTURE2,2),i&&r.uniform1i(this.ea,i.transferCharacteristics),r.uniform1i(this.na,e.y.bits),r.uniformMatrix3fv(this.sa,!1,t.getRotMatrix(n)),r.uniform3fv(this.$o,c.subarray(0,3)),r.uniformMatrix3fv(this.ia,!1,c.subarray(3,12));var l=new Float32Array([a.width,a.height]);r.uniform2fv(this.ta,l),r.bindBuffer(r.ARRAY_BUFFER,this.Zo),r.enableVertexAttribArray(this.Wo),r.vertexAttribPointer(this.Wo,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this.Xo),r.enableVertexAttribArray(this.zo),r.vertexAttribPointer(this.zo,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,this.Jo),r.enableVertexAttribArray(this.qo),r.vertexAttribPointer(this.qo,2,r.FLOAT,!1,0,0),r.drawArrays(r.TRIANGLES,0,M.length/2),r.finish()}},e.ba=function(t,e,i,n){var r=this.Yi;if(r){var a=n.cropLeft/i,o=(n.cropLeft+n.cropWidth)/i,s=(n.cropTop+n.cropHeight)/n.height,u=n.cropTop/n.height,c=new Float32Array([a,s,o,s,a,u,a,u,o,s,o,u]);r.bindBuffer(r.ARRAY_BUFFER,t),r.bufferData(r.ARRAY_BUFFER,c,r.STATIC_DRAW)}},e.clear=function(){var t=this.Yi;t&&(t.viewport(0,0,t.canvas.width,t.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT))},e.la=function(t){var e,i=null==(e=this.Bo.drawData.buffer)?void 0:e.format;return!(i&&t.width===i.width&&t.height===i.height&&t.chromaWidth===i.chromaWidth&&t.chromaHeight===i.chromaHeight)},e.aa=function(){var t=this;this.Ci.i(j,"clear WebGL");var e=this.Yi;e&&(e.disableVertexAttribArray(this.Wo),e.disableVertexAttribArray(this.zo),e.disableVertexAttribArray(this.qo),this.Zo&&e.deleteBuffer(this.Zo),this.Xo&&e.deleteBuffer(this.Xo),this.Jo&&e.deleteBuffer(this.Jo),Object.keys(this.Yo).forEach((function(e){t.Yi&&t.Yo[e]&&t.Yi.deleteTexture(t.Yo[e]),delete t.Yo[e]})),Object.keys(this.Go).forEach((function(e){t.Yi&&t.Go[e]&&t.Yi.deleteFramebuffer(t.Go[e]),delete t.Go[e]})),this.Ko&&e.deleteProgram(this.Ko),this.ra&&e.deleteShader(this.ra),this.ha&&e.deleteShader(this.ha),this.Ko=null)},a()(t,[{key:"ready",get:function(){return!0}},{key:"preferCanvasColorSpace",get:function(){return this.Bo.preferCanvasColorSpace}},{key:"type",get:function(){return s.b.webgl}},{key:"drawData",get:function(){return this.Bo.drawData}},{key:"imageData",get:function(){if(this.Yi){var t=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,t.data),t}}}])}(),G="canvas-renderer-screenshot",z=function(t){function e(e,i){var n;return(n=t.call(this)||this).Ci=void 0,n.Ai=void 0,n.Pi=void 0,n.Qo=void 0,n.pa=void 0,n.Ci=e,n.Ai=i,n}O()(e,t);var i=e.prototype;return i.screenshot=function(t,e){var i,n,r=t.type,a=t.drawData;this.Ci.i(G,"screenshot type: "+r+" id:"+(null==e?void 0:e.id)+" pts: "+(null==(i=a.buffer)?void 0:i.format.pts));var o={pts:(null==(n=a.buffer)?void 0:n.format.pts)||-1};if(null!=e&&e.id&&(o.id=e.id),!a.buffer)return this.Ci.i(G,"screenshot type: "+r+" id:"+(null==e?void 0:e.id)+" error. empty yuv"),o.errorCode=k.a.SCREENSHOT_EMPTY_DATA_ERROR,o.errorMessage="empty yuv",void this.Ai.emit(P.a.SCREENSHOT,D()(o,{errorCode:k.a.SCREENSHOT_EMPTY_DATA_ERROR,errorMessage:"empty yuv"}));this.Pi||(this.Pi=Object(y.a)());var u=this.Pi;if(this.ma(a.buffer.format.width,a.buffer.format.height,a.rotation),this.Qo?this.Qo.updatePreferCanvasColorSpace(null==e?void 0:e.colorSpace):(this.Ci.i(G,"create frame sink: "+r),this.Qo=this.ga(u,r,t.yuv2rgbLib)),this.Qo){var c,l={width:a.buffer.format.displayWidth,height:a.buffer.format.displayHeight};a.buffer.format.displayHeight=u.height,a.buffer.format.displayWidth=u.width;try{this.Qo.drawFrame(a.buffer,a.colorInfo,a.rotation)}catch(t){this.Ai.emit(P.a.SCREENSHOT,D()(o,{errorCode:k.a.SCREENSHOT_CREATE_IMG_ERROR,errorMessage:"draw frame error"}))}a.buffer.format.displayHeight=l.height,a.buffer.format.displayWidth=l.width,this.Qo.type===s.b.canvas2d?c=this.Qo.imageData:(this.pa||(this.pa=new x.a(this.Ci),this.O.push(this.pa)),c=this.pa.copyImageData(u,a.buffer.format.sar,a.rotation,null==e?void 0:e.colorSpace)),c?this.Ai.emit(P.a.SCREENSHOT,D()(o,{image:c})):this.Ai.emit(P.a.SCREENSHOT,D()(o,{errorCode:k.a.SCREENSHOT_CREATE_IMG_ERROR,errorMessage:"image data null"}))}else this.Ai.emit(P.a.SCREENSHOT,D()(o,{errorCode:k.a.SCREENSHOT_INIT_ERROR,errorMessage:"create frame sink error"}))},i.destroy=function(){var e;this.Ci.i(G,"destroy"),null==(e=this.Qo)||e.destroy(),this.Pi=void 0,t.prototype.destroy.call(this)},i.ma=function(t,e,i){var n=this.Pi;n&&(90===i||270===i?(n.width=e,n.height=t):(n.width=t,n.height=e))},i.ga=function(t,e,i,n){this.Ci.i(G,"init frameSink type:"+e+" colorSpace:"+(null==n?void 0:n.colorSpace));var r=null!=n&&n.colorSpace?{preferCanvasColorSpace:n.colorSpace}:void 0;if(e===s.b.webgl){var a=Object(y.c)(t);if(a)return null!=n&&n.colorSpace&&Object(y.d)(a,n.colorSpace),new H(this.Ci,a,r)}var o=null!=n&&n.colorSpace?{colorSpace:n.colorSpace}:void 0,u=t.getContext("2d",o);if(u)return new w(this.Ci,u,r,i)},e}(N.a),W=i(31),K=i(39),Y=((n={})[n.OK=0]="OK",n[n.REORDER=1]="REORDER",n),Q="yuv-cache",X=function(){function t(t){this.Ci=void 0,this._t=[],this.ya=0,this.Ct=-1,this._a=52428800,this.Ci=t}var e=t.prototype;return e.init=function(t){t&&t>52428800&&(this._a=t)},e.reset=function(){this.Ci.i(Q,"reset"),this._t=[],this.ya=0,this.Ct=-1},e.next=function(){return this.getFrameByIndex(this.Ct+1)},e.prev=function(){return this.getFrameByIndex(this.Ct-1)},e.push=function(t,e){void 0===e&&(e=!1);var i=Y.OK,n=t.y.bytes.byteLength+t.u.bytes.byteLength+t.v.bytes.byteLength,r=this._t[this._t.length-1];this._t.push({pts:t.format.pts,endPTS:t.format.pts+this.Ca(),size:n,yuv:t});var a=this.Ia();return e&&(t.y.bytes=new Uint8Array(t.y.bytes),t.u.bytes=new Uint8Array(t.u.bytes),t.v.bytes=new Uint8Array(t.v.bytes)),r&&((a<=0||a>=1e3)&&this.Ci.i(Q,"yuv cache pts diff: "+a+", "+r.pts+"/"+t.format.pts),a<0?(this.Oa(),i=Y.REORDER):r.endPTS=t.format.pts),this.ya+=n,this.wa(),i},e.decDropFrameInfo=function(t){if(this.Ci.i(Q,"dec drop: "+t.frames.length),t.frames.length){var e=this._t[this._t.length-1],i=t.frames[0].pts;if(e){e.endPTS=i;var n=i-e.pts;(n<=0||n>=1e3)&&this.Ci.i(Q,"yuv drop frame pts diff: "+n)}for(var r=0;r<t.frames.length;r++){var a=t.frames[r],o=t.frames[r+1];this._t.push({pts:a.pts,endPTS:(null==o?void 0:o.pts)||a.pts,size:0})}this.Oa()}},e.ptsToIndex=function(t){var e=this._t[this._t.length-1];return e&&t<=e.endPTS?t===e.endPTS?this._t.length-1:K.a.searchIndex(this._t,(function(e){return t<e.pts?-1:t>=e.endPTS?1:0})):-1},e.getFrameByIndex=function(t){if(t>=0&&t<this._t.length)return this.Ct=t,this._t[t]},e.getLessPtsIdxThen=function(t){var e=this._t[t];if(e&&t>0&&t<this._t.length)for(var i=t-1;i>=0;i--){var n=this._t[i];if(n&&n.pts<e.pts)return i}return-1},e.clean=function(t){this.Ci.i(Q,"clean. st: "+t),t>=0&&this.reset();var e=this._t[this._t.length-1];if(e&&t<=e.endPTS){var i=Math.max(0,K.a.searchIndex(this._t,(function(e){return t<e.pts?-1:t>e.pts?1:0})));this._t=this._t.slice(0,i),i<this.Ct&&(this.Ct=i)}},e.hasDropedAfterIdx=function(t){if(t>=this._t.length)return!1;for(var e=Math.max(0,t);e<this._t.length;e++){var i=this._t[e];if(null==i||!i.yuv)return!0}return!1},e.wa=function(){for(;this.ya>=this._a&&this.Ct>0;){var t=this._t.shift();t&&t.yuv&&(this.ya-=t.size),this.Ct--}},e.Ia=function(){var t=this._t;return t.length>1?t[t.length-1].pts-t[t.length-2].pts:0},e.Ca=function(){var t=this._t;return t.length>1?(t[t.length-1].pts-t[0].pts)/(t.length-1):1e3/24},e.Oa=function(){if(!(this._t.length<=1)){this._t.sort((function(t,e){return t.pts-e.pts}));for(var t=0;t<this._t.length;t++){var e=this._t[t],i=this._t[t+1];e.endPTS=i?i.pts:e.pts+this.Ca()}}},a()(t,[{key:"current",get:function(){return this.getFrameByIndex(this.Ct)}},{key:"index",get:function(){return this.Ct},set:function(t){t>=0&&t<this._t.length&&(this.Ct=t)}},{key:"cache",get:function(){return this._t}},{key:"remaining",get:function(){return this._t.length-1-this.Ct}}])}(),Z="canvas-renderer",q=function(){function t(t,e){this.di=void 0,this.Ai=void 0,this.Ci=void 0,this.Ea=void 0,this.Qo=void 0,this.ja=s.p.NONE,this.ka=!0,this.Ma=void 0,this.Sa=void 0,this.Ba=0,this.Ta=3,this.vt=s.s.canvas,this.Da=!1,this.Ra=void 0,this.La=10,this.Na=void 0,this.Qa=void 0,t.i(Z,"constructor"),this.Ai=e,this.Ci=t,this.Ea=new X(t)}var e=t.prototype;return e.init=function(t,e,i){this.Ci.i(Z,"init"),this.di=e,this.Na=new W.a(this.Ci,e,i),this.ja=this.di.videoDecBlockPolicy,this.Ea.init(e.videoFrameBufferSize);try{var n=Object(y.b)(),r=s.b.webgl;e.preferCanvasType!==s.b.canvas2d&&this.Na.webgl&&n.webGL?(this.Ci.i(Z,"webgl yuv2rgb"),this.Qo=new H(this.Ci,this.Na.webgl,e)):this.Na.canvas2d&&(this.Ci.i(Z,"software yuv2rgb"),this.Qo=new w(this.Ci,this.Na.canvas2d,e),r=s.b.canvas2d),this.Ci.i(Z,"renderer init complete. type: "+r),this.Ai.emit(P.a.RENDERER_INIT_COMPLETE,{type:r})}catch(t){return this.Ci.i(Z,t),void this.Ai.emit(P.a.ERROR,Object(k.e)(k.b.DECODER_ERROR,k.a.DECODER_WEBGL_ERROR,"render initialization error: "+(null==t?void 0:t.message)))}this.Qo?this.xa():this.Ai.emit(P.a.ERROR,Object(k.e)(k.b.DECODER_ERROR,k.a.DECODER_WEBGL_ERROR,"render initialization error"))},e.append=function(t){var e;this.Ea.remaining,this.Ea.push(t)===Y.REORDER&&(this.Ci.i(Z,"yuv cache reorder."),this.Ea.ptsToIndex(this.Ba),this.Ma=this.Ea.current,null!=(e=this.Ma)&&e.yuv&&!this.ka&&this.Va(this.Ma.yuv)),this.Ua(),this.Ai.emit(P.a.RENDERER_BUF_UPDATE,{needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining,desc:"append"})},e.Ua=function(){this.ka&&(this.Ea.remaining>=this.Ta||this.Fa())&&this.Pa()},e.updateState=function(t,e,i,n,r,a,o){var c,l,h;void 0===o&&(o=u.a.contain),this.Ba=t,this.vt!==r&&(this.Ci.i(Z,"renderer type change to "+r+". clear."),this.Qo&&this.Qo.clear()),null==(c=this.Qo)||c.setPictMode(o),this.vt=r,this.La=a,r!==s.s.video&&this.Na&&this.Na.updateCanvasSize(e,i)&&null!=(l=this.Qo)&&l.drawData.buffer&&this.Va(null==(h=this.Qo)?void 0:h.drawData.buffer)},e.updateMediaInfo=function(t){this.Ci.i(Z,"update media info",t),this.Sa=t},e.step=function(t){if(!this.ka)if(t===s.m.NEXT){var e,i=this.Ma?this.Ma.pts:-1;i>=0&&null!=(e=this.Ma)&&e.yuv&&(this.Ba=i,this.Ai.emit(P.a.STEP,{type:t,time:i}))}else if(t===s.m.PREV){var n=this.Ma?this.Ea.index-1:this.Ea.index;if(n>0){var r=this.Ea.getLessPtsIdxThen(n);if(r>=0){if(n-r>1&&this.Ci.i(Z,"step prev skip "+(n-r-1)),this.Ma=this.Ea.getFrameByIndex(r),this.Ma&&this.Ma.yuv)return this.Ba=this.Ma.yuv.format.pts,void this.Ai.emit(P.a.STEP,{type:t,time:this.Ma.yuv.format.pts})}else this.Ea.reset()}this.Ai.emit(P.a.STEP,{type:t,time:-1})}},e.seek=function(t,e){this.Ci.i(Z,"seek["+e+"]: seek. time: "+t);var i=this.Ea.ptsToIndex(t);if(-1!==i){var n;if(!this.Ea.hasDropedAfterIdx(i))return this.Ea.index=i,this.Ma=this.Ea.current,this.Ci.i(Z,"seek["+e+"]: hit yuv cache. time: "+t+" draw pts: "+(null==(n=this.Ma)?void 0:n.pts)+" remain yuv: "+this.Ea.remaining),this.Ba=t,this.Ha(),this.Ai.emit(P.a.RENDERER_BUF_UPDATE,{needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining,desc:"seek"}),void this.Ai.emit(P.a.RENDERER_SEEK,{hitCache:!0,time:t,id:e});this.Ci.i(Z,"seek["+e+"]: yuv cache has dropped. reset yuv cache."),this.Ea.reset(),this.Ai.emit(P.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(Z,"seek["+e+"]: miss yuv cache"),this.Ai.emit(P.a.RENDERER_SEEK,{hitCache:!1,time:t,id:e})},e.endOfData=function(){this.Ci.i(Z,"end of data"),this.Da=!0,this.Ua()},e.decDropFrameInfo=function(t){this.Ea.decDropFrameInfo(t)},e.screenshot=function(t){this.Qa||(this.Qa=new z(this.Ci,this.Ai)),this.Qo&&this.Qa.screenshot(this.Qo,t)},e.reset=function(t,e){void 0===e&&(e=!1),this.Ci.i(Z,"reset",t),this.Ea.reset(),e||(this.Ba=-1),this.ka=!0,this.Ma=void 0,this.Da=!1,this.Ai.emit(P.a.RENDERER_BUF_UPDATE,{needMore:!0,yuvBufLen:0,desc:"reset"})},e.destroy=function(){var t,e;this.Ci.i(Z,"destroy."),this.Qo&&this.Qo.destroy(),this.Ea.reset(),this.Ya(),null==(t=this.Na)||t.destroy(),this.Na=void 0,null==(e=this.Qa)||e.destroy()},e.Fa=function(){return this.Da},e.Ha=function(){var t,e;if(this.Na&&-1!==this.Ba){var i=this.Ea.remaining;for(!this.Ma||null!=(t=this.Ma)&&t.yuv||this.Ci.i(Z,"skip empty frame"),this.Ma&&null!=(e=this.Ma)&&e.yuv||(this.Ma=this.Ea.next());this.Ma&&this.Ba>=0;){var n=this.Ba-this.Ma.pts,r=this.Ba-this.Ma.endPTS;if(this.ka&&r>200)this.Ci.v(Z,"skip draw",this.Ba,this.Ma.endPTS,r),this.Ma=this.Ea.next();else{if(this.Ua(),this.ka||!(n>=-1))break;if(r<=200){this.Ma.yuv&&this.Va(this.Ma.yuv),this.Ma=this.Ea.next();break}this.ja===s.p.NONE?(this.Ma.yuv&&this.Va(this.Ma.yuv),this.Ma=this.Ea.next()):(this.Ci.v(Z,"skip b",this.Ma.pts,n,r),this.Ma=this.Ea.next(),this.Ma||this.Fa()||this.Ga())}}i!=this.Ea.remaining&&this.Ai.emit(P.a.RENDERER_BUF_UPDATE,{desc:"update",needMore:this.Ea.remaining<this.Ta,yuvBufLen:this.Ea.remaining})}},e.Va=function(t){var e,i=this;if(this.Na){var n=t.format,r=(null==(e=this.Sa)?void 0:e.rotation)||0,a=n.sar?Object(E.a)(n.width,n.height,n.sar):n;if(this.Na.updateFormatSize(a.width,a.height,r),n.displayWidth=this.Na.displaySize.w,n.displayHeight=this.Na.displaySize.h,this.Qo){var o,s=this.Qo.drawFrame(t,null==(o=this.Sa)?void 0:o.colorInfo,r);if(void 0!==s)return this.Ai.emit(P.a.RENDERER_WAITING),void s.then((function(t){t?(i.Ai.emit(P.a.RENDERER_WAITING_END),i.Ai.emit(P.a.RENDERER_DRAW,{yuvBufLen:i.Ea.remaining})):i.Ai.emit(P.a.ERROR,Object(k.e)(k.b.DECODER_ERROR,k.a.DECODER_2D_ERROR,"render initialization error. 2d"))}));if(!this.Qo.ready)return void this.Ai.emit(P.a.RENDERER_WAITING)}this.Ai.emit(P.a.RENDERER_DRAW,{yuvBufLen:this.Ea.remaining})}},e.xa=function(){var t=this;this.Ra||(this.Ra=setInterval((function(){t.Ha()}),0))},e.Ya=function(){this.Ra&&(clearInterval(this.Ra),this.Ra=void 0)},e.Ga=function(){var t=this.La||10;this.Ci.i(Z,"waiting. frame buf: "+t),this.Ta!==t&&(this.Ta=t),this.ka=!0,this.Ai.emit(P.a.DECODER_WAITING)},e.Pa=function(){this.Ci.i(Z,"waiting ready. frame buf: "+this.Ea.remaining+", data ended: "+this.Fa()),this.ka=!1,this.Ai.emit(P.a.DEC_VIDEO_READY)},t}();e.a=q},function(t,e,i){var n,r=i(0),a=i(7),o=i(3),s=i(9),u=i(11),c=i(16),l=i(5),h=i.n(l),d=a.b/a.n,f="video-dec-cache",p=function(){function t(t,e){var i=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(t){return t.units.reduce((function(t,e){return-1!==i.za.indexOf(e.type)||t}),!1)},t.i(f,"constructor"),this.Ai=e,this.Ci=t}var e=t.prototype;return e.updateIdrFrame=function(t){this.Ci.i(f,"updateIdrFrame",t),this.za=t},e.appendData=function(t){var e=this;if(t.type===u.d.decoderConfig){this.qa=t.samples[0];var i=this.$a=[],n={};return this.qa.units.forEach((function(t){n[t.type]||(n[t.type]=!0,i.push(t.type))})),void this.Ci.i(f,"dec config",i)}var r=this.Ka;t.samples.forEach((function(i,n){var o=e.isIDR(i);if(o||-1!==e.Xa){if(o){if(e.qa){var s,c=!1;e.$a&&(c=e.$a.reduce((function(t,e){return t&&i.units.reduce((function(t,i){return t||i.type===e}),!1)}),!0)),!c&&(e.Ci.i(f,"key sample has not dec config. push dec config units."),(s=i.units).unshift.apply(s,e.qa.units))}e.Wa++}var l=i.units.reduce((function(t,e){return e.data.length+t}),0),h={id:e.Ja,key:o,gopId:e.Wa,type:t.type||u.d.videoFrame,size:l,data:i,dts:i.dts*a.b,pts:i.pts*a.b,mediaInfo:t.mediaInfo};h.pts>e.Xa&&(e.Xa=h.pts);var d=r[r.length-1];d&&Math.abs(h.dts-d.dts)>1e3&&e.Ci.i(f,"append error",e.Ka,e.Za),h.discontinuity=!!(h.type===u.d.videoFrame&&d&&Math.abs(h.dts-d.dts)>a.p),r.push(h),e.yt+=l,e.Ja++}})),r.length>10&&(this.Ah=Math.max(d,(r[r.length-1].dts-r[0].dts)/(r.length-1))),this.tu()},e.clean=function(){this.Ci.i(f,"clean"),this.Ka=[],this.Ja=0,this.Za=0,this.yt=0,this.Wa=0,this.Xa=-1},e.getItem=function(t){return this.Ka[t]},e.getItemIdxByDts=function(t){var e=this.iu(this.Ka,t);if(-1===e){var i=this.Ka[this.Ka.length-1];i&&t>i.dts&&t<i.dts+this.Ah&&(e=this.Ka.length-1)}return e},e.getItemByDts=function(t){var e=this.getItemIdxByDts(t);if(e>=0)return this.Ka[e]},e.seek=function(t){var e=this.getItemIdxByDts(t);if(e<0&&this.hit(t)&&this.Ka.length&&t>this.Ka[this.Ka.length-1].dts&&(e=this.Ka.length-1),e>=0)for(var i=e;i>=0;i--)if(this.Ka[i].key&&this.Ka[i].pts<=t)return this.Za=i,!0;return!1},e.hit=function(t){var e=this.Ka;return!!e.length&&t>=e[0].pts&&t<=this.Xa+this.Ah},e.next=function(){if(this.Za<this.Ka.length){var t=this.Ka[this.Za];return this.Za++,this.tu(),t}},e.tu=function(){var t=this.Ka;if(t.length){for(var e=0;this.yt>134217728&&this.Za>0;){var i,n=(null==(i=this.current)?void 0:i.gopId)||t[t.length-1].gopId,r=t[0];if(n-r.gopId<2)break;t.shift(),this.yt=this.yt-r.size,this.Za--,e++}e&&this.Ci.i(f,"remove",e)}},e.iu=function(t,e){for(var i,n=t,r=0,a=n.length-1,o=void 0,s=void 0;r<=a;)if(i=n[o=(r+a)/2|0],(s=n[o+1])&&e>s.dts)r=o+1;else{if(s&&e===s.dts)return o+1;if(!(e<i.dts))return s?o:-1;a=o-1}return-1},h()(t,[{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(t){this.Za=Math.min(Math.max(0,t),this.Ka.length)}},{key:"size",get:function(){return this.yt}},{key:"data",get:function(){return this.Ka}},{key:"frameDuration",get:function(){return this.Ah}}])}(),_=i(50),v=i.n(_),A=i(2),g=i(25),m=((n=m||{})[n.KS265_PIXFMT_YUV_420P=0]="KS265_PIXFMT_YUV_420P",n[n.KS265_PIXFMT_YUV_420SP=1]="KS265_PIXFMT_YUV_420SP",n[n.KS265_PIXFMT_YUV_420SP_VU=2]="KS265_PIXFMT_YUV_420SP_VU",n),b={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},y=[0,0,0,1],E="ks265-wrapper",C=function(){function t(t,e){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:m.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,t.i(E,"constructor"),this.Ai=e,this.Ci=t}var e=t.prototype;return e.init=function(t,e,i){var n=this;if(this.Ci.i(E,"init simd: "+e+" threads: "+i),!t.wasm.data)return Promise.reject("ks265 wasm is null");var r=t.js.data,a=t.jsw?t.jsw.data:"",o=new Function(r+" return KW265;")(),s=a?new Blob([r],{type:"text/javascript"}):"",u=new Blob([a],{type:"text/javascript"});return o({wasmBinary:t.wasm.data,mainScriptUrlOrBlob:s,locateFile:function(t){return-1!==t.indexOf(".worker.js")?URL.createObjectURL(u):""}}).then((function(t){n.eu=t,n.uu(),i>1&&(n.di.b_use_pthread=1,n.di.threads=i),n.di.nal_mode=0,n.cu()}))},e.pushNalus=function(t,e,i){if(void 0===i&&(i=!1),this.eu&&this.nu){this.fu(this.eu,this.au+24,b),this.eu.setValue(this.au,0,"i32"),this.ru++;var n=t.reduce((function(t,e){return t+e.data.byteLength}),0)+y.length*t.length,r=new Uint8Array(n),a=0;t.forEach((function(t){r.set(y,a),r.set(t.data,a+y.length),a+=y.length+t.data.byteLength}));var o=performance.now();this.nu.KS265DecodeFrame(this.Do,r,n,Math.round(e)||0),this.Au(o),this.hu=i}},e.getPendingNALNumber=function(){return this.ru},e.endOfFrame=function(){},e.nextFrame=function(){this.ru&&this.Au(),this.su=!0},e.free=function(){var t;null==(t=this.nu)||t.KS265DecoderDestroy(this.Do),this.eu&&(this.ou&&this.eu._free(this.ou),this.au&&this.eu._free(this.au)),this.ou=this.au=0},e.rebuild=function(){this.Ci.i(E,"rebuild"),this.free(),this.ru=0,this.su=!1,this.hu=!1,this.cu()},e.flush=function(){},e.reset=function(){},e.isWaitingData=function(){return this.su},e.Au=function(t){if(this.nu&&this.eu&&(t=t||performance.now(),this.hu&&this.nu.KS265DecodeFlush(this.Do,0),!(this.nu.KS265DecoderGetDecodedFrame(this.Do,this.au)<0))){var e=this.vu(this.eu,this.au);e.bValid&&(this.Ai.emit(A.a.DECODER_FRAME,{frame:this.du(this.eu,e),startTime:t}),this.hu||this.nu.KS265DecoderReturnDecodedFrame(this.Do,this.au),this.su=!1,this.ru--)}},e.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))},e.du=function(t,e){var i=g.a.AV_PIX_FMT_YUV420P,n=Object(g.b)(e.frameinfo.nCodedWidth||e.frameinfo.nWidth,e.frameinfo.nCodedHeight||e.frameinfo.nHeight,i),r=n.w,a=n.h;return{format:{width:r[0],height:a[0],chroma:i,chromaWidth:r[1],chromaHeight:a[1],cropLeft:0,cropTop:0,cropWidth:e.frameinfo.nWidth,cropHeight:e.frameinfo.nHeight,displayWidth:0,displayHeight:0,pts:e.frameinfo.pts},y:{bytes:t.HEAPU8.subarray(e.pData[0],e.pData[0]+e.iStride[0]*a[0]),stride:e.iStride[0],bits:8},u:{bytes:t.HEAPU8.subarray(e.pData[1],e.pData[1]+e.iStride[1]*a[1]),stride:e.iStride[1],bits:8},v:{bytes:t.HEAPU8.subarray(e.pData[2],e.pData[2]+e.iStride[2]*a[1]),stride:e.iStride[2],bits:8}}},e.lu=function(t,e){var i=t._malloc(52);return t.setValue(i,e.pAuth,"i32"),t.setValue(i+4,e.threads,"i32"),t.setValue(i+8,e.nal_mode,"i32"),t.setValue(i+12,e.pic_out_pos,"i32"),t.setValue(i+16,e.bEnableOutputRecToFile,"i32"),t.setValue(i+20,e.strRecYuvFileName,"i32"),t.setValue(i+24,e.logLevel,"i32"),t.setValue(i+28,e.outputPixfmt,"i32"),t.setValue(i+32,e.b_use_pthread,"i32"),t.setValue(i+36,e.b_alpha_decode,"i32"),t.setValue(i+40,e.p_arg,"i32"),t.setValue(i+44,e.p_log_func,"i32"),t.setValue(i+48,e.b_zerobuffer_contains_ref,"i32"),i},e.pu=function(t,e){return{nWidth:t.getValue(e,"i32"),nHeight:t.getValue(e+4,"i32"),nCodedWidth:t.getValue(e+8,"i32"),nCodedHeight:t.getValue(e+12,"i32"),nLumaBitDepth:t.getValue(e+16,"i32"),nChromaBitDepth:t.getValue(e+20,"i32"),nChromaFormatIdc:t.getValue(e+24,"i32"),profile:t.getValue(e+28,"i32"),level:t.getValue(e+32,"i32"),has_b_frames:t.getValue(e+36,"i32"),pts:t.getValue(e+40,"i32"),bIllegalStream:t.getValue(e+48,"i32"),poc:t.getValue(e+52,"i32")}},e.fu=function(t,e,i){t.setValue(e,i.nWidth,"i32"),t.setValue(e+4,i.nHeight,"i32"),t.setValue(e+8,i.nCodedWidth,"i32"),t.setValue(e+12,i.nCodedHeight,"i32"),t.setValue(e+16,i.nChromaFormatIdc,"i32"),t.setValue(e+20,i.profile,"i32"),t.setValue(e+24,i.level,"i32"),t.setValue(e+28,i.has_b_frames,"i32"),t.setValue(e+32,i.pts,"i64")},e.bu=function(t){return t._malloc(80)},e.vu=function(t,e){return{bValid:t.getValue(e,"i32"),pData:[t.getValue(e+4,"i32"),t.getValue(e+8,"i32"),t.getValue(e+12,"i32")],iStride:[t.getValue(e+16,"i16"),t.getValue(e+18,"i16"),t.getValue(e+20,"i16")],frameinfo:this.pu(t,e+24)}},e.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})},t}(),T=i(12),I=i(36),R=[0,0,0,1],w="kvc30-wrapper",L=function(){function t(t,e){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,t.i(w,"constructor"),this.Ai=e,this.Ci=t}var e=t.prototype;return e.init=function(t,e,i){var n=this;if(this.Ci.i(w,"init simd: "+e+" threads: "+i),!t.wasm.data)return Promise.reject("kvc wasm is null");var r=t.js.data,a=t.jsw?t.jsw.data:"",o=new Function(r+" return KVC30;")(),s=a?new Blob([r],{type:"text/javascript"}):"",u=new Blob([a],{type:"text/javascript"});return o({wasmBinary:t.wasm.data,mainScriptUrlOrBlob:s,locateFile:function(t){return-1!==t.indexOf(".worker.js")?URL.createObjectURL(u):""}}).then((function(t){n.eu=t,n.wu(),i>1?(n.di.threads=1,n.di.threads=i):n.di.threads=0,n.cu()}))},e.pushNalus=function(t,e,i){if(void 0===i&&(i=!1),this.eu){this.eu.setValue(this.au,0,"i32"),this.ru++;var n=t.reduce((function(t,e){return t+e.data.byteLength}),0)+R.length*t.length,r=new Uint8Array(n),a=0;t.forEach((function(t){r.set(R,a),r.set(t.data,a+R.length),a+=R.length+t.data.byteLength})),this.Eu(this.eu,r,e),this.ju(),this.hu=i}},e.getPendingNALNumber=function(){return this.ru},e.endOfFrame=function(){},e.nextFrame=function(){this.su=!0},e.free=function(){var t;null==(t=this.mu)||t.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())},e.rebuild=function(){this.Ci.i(w,"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(w,"rebuild"),this.free(),this.cu()},e.flush=function(){this.Ci.i(w,"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 t=!1;do{t=this.ju()}while(t);this.ru=0,this.su=!1},e.reset=function(){},e.isWaitingData=function(){return this.su},e.cu=function(){this.eu&&this.mu&&(this.Ci.i(w,"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))},e.du=function(t,e){return{format:{width:e.width[0],height:e.height[0],chroma:1,chromaWidth:e.width[1],chromaHeight:e.height[1],cropLeft:0,cropTop:0,cropWidth:e.width[0],cropHeight:e.height[0],displayWidth:0,displayHeight:0,pts:e.pts,colorInfo:this.Bu()},y:{bytes:t.HEAPU8.subarray(e.bufs[0],e.bufs[0]+e.stride[0]*e.height[0]*e.bytesPerPixel),stride:e.stride[0],bits:e.bitDepth},u:{bytes:t.HEAPU8.subarray(e.bufs[1],e.bufs[1]+e.stride[1]*e.height[1]*e.bytesPerPixel),stride:e.stride[1],bits:e.bitDepth},v:{bytes:t.HEAPU8.subarray(e.bufs[2],e.bufs[2]+e.stride[2]*e.height[2]*e.bytesPerPixel),stride:e.stride[2],bits:e.bitDepth}}},e.Su=function(t,e){var i=t._malloc(68);return t.setValue(i,0,"i32"),t.setValue(i+4,0,"i32"),t.setValue(i+8,0,"i32"),t.setValue(i+12,0,"i32"),t.setValue(i+16,0,"i32"),t.setValue(i+20,0,"i32"),t.setValue(i+24,0,"i32"),t.setValue(i+28,0,"i32"),t.setValue(i+32,0,"i32"),t.setValue(i+36,e.threads,"i32"),t.setValue(i+40,e.needOutput,"i32"),t.setValue(i+44,0,"i32"),t.setValue(i+48,0,"i32"),t.setValue(i+52,0,"i32"),t.setValue(i+56,0,"i32"),t.setValue(i+60,0,"i32"),t.setValue(i+64,0,"i32"),i},e.Eu=function(t,e,i){var n=t._malloc(e.byteLength);t.HEAPU8.set(e,n),t.setValue(this.gu,Math.round(i),"i64"),t.setValue(this.gu+8,n,"i32"),t.setValue(this.gu+12,e.byteLength,"i32"),this._u.push(n),this.Mu(16)},e.Mu=function(t){if(void 0===t&&(t=0),this.eu)for(;this._u.length>t;){var e=this._u.shift();e&&this.eu._free(e)}},e.Tu=function(t,e){return{pts:t.getValue(e,"i64"),bufs:[t.getValue(e+8,"i32"),t.getValue(e+12,"i32"),t.getValue(e+16,"i32"),t.getValue(e+20,"i32")],p_output_frame:t.getValue(e+24,"i32"),p_buffer_ref:t.getValue(e+28,"i32"),width:[t.getValue(e+32,"i32"),t.getValue(e+36,"i32"),t.getValue(e+40,"i32"),t.getValue(e+44,"i32")],height:[t.getValue(e+48,"i32"),t.getValue(e+52,"i32"),t.getValue(e+56,"i32"),t.getValue(e+60,"i32")],stride:[t.getValue(e+64,"i32"),t.getValue(e+68,"i32"),t.getValue(e+72,"i32"),t.getValue(e+76,"i32")],bytesPerPixel:t.getValue(e+80,"i32"),colorFormat:t.getValue(e+84,"i32"),bitDepth:t.getValue(e+88,"i32"),planes:t.getValue(e+92,"i32"),hasOutput:t.getValue(e+96,"i32"),isKeyFrame:t.getValue(e+100,"i32"),isPostProcess:t.getValue(e+104,"i32"),pixFmt:t.getValue(e+108,"i32")}},e.Du=function(t,e){return{chromaFormat:t.getValue(e,"i32"),codedWidth:t.getValue(e+4,"i32"),codedHeight:t.getValue(e+8,"i32"),width:t.getValue(e+12,"i32"),height:t.getValue(e+16,"i32"),hasBFrames:t.getValue(e+20,"i32"),profile:t.getValue(e+24,"i32"),level:t.getValue(e+28,"i32"),bitdepth:t.getValue(e+32,"i32"),b_vui_valid:t.getValue(e+36,"i32"),aspect_ratio_info_present_flag:t.getValue(e+40,"i32"),video_full_range_flag:t.getValue(e+44,"i32"),sar_width:t.getValue(e+48,"i32"),sar_height:t.getValue(e+52,"i32"),colour_description_present_flag:t.getValue(e+56,"i32"),colour_primaries:t.getValue(e+60,"i32"),transfer_characteristics:t.getValue(e+64,"i32"),matrix_coeffs:t.getValue(e+68,"i32")}},e.ju=function(){if(!this.eu||!this.mu)return!1;if(!this.mu.KVCDecodeFrame(this.Do,this.gu,this.au)){var t=this.Tu(this.eu,this.au);if(t.hasOutput)return this.Cu||this.Ru(),this.mu.KVCDecoderPostProcess&&this.Lu(this.eu,t),this.Ai.emit(A.a.DECODER_FRAME,{frame:this.du(this.eu,t),startTime:performance.now()}),this.mu.KVCDecodeUnrefFrame(this.Do,this.au),this.su=!1,this.ru--,!0}return!1},e.Lu=function(t,e){var i;if(null!=(i=this.mu)&&i.KVCDecoderPostProcess){var n=this.Iu,r=e.stride[0]*e.height[0]*e.bytesPerPixel,a=e.stride[1]*e.height[1]*e.bytesPerPixel,o=e.stride[2]*e.height[2]*e.bytesPerPixel;r===n.ysize&&a===n.usize&&o===n.vsize||this.Nu(t,e);var s=this.mu.KVCDecoderPostProcess(this.Do,this.au,n.pBufs,this.au+64);s?this.Ci.i(w,"post process fail: "+s):e.bufs=[n.y,n.u,n.v]}},e.ku=function(){this.Ci.i(w,"free post process yuv.");var t=this.Iu;this.eu&&(t.buf&&this.eu._free(t.buf),t.pBufs&&this.eu._free(t.pBufs)),t.y=t.u=t.v=t.buf=t.pBufs=0},e.Nu=function(t,e){this.Ci.i(w,"malloc post process yuv."),this.ku();var i=this.Iu;i.ysize=e.stride[0]*e.height[0]*e.bytesPerPixel,i.usize=e.stride[1]*e.height[1]*e.bytesPerPixel,i.vsize=e.stride[2]*e.height[2]*e.bytesPerPixel;var n=i.ysize+i.usize+i.vsize;i.buf=t._malloc(n),i.y=i.buf,i.u=i.y+i.ysize,i.v=i.u+i.usize,i.pBufs=t._malloc(16),t.setValue(i.pBufs,i.y,"i32"),t.setValue(i.pBufs+4,i.u,"i32"),t.setValue(i.pBufs+8,i.v,"i32")},e.Ru=function(){this.eu&&this.mu&&(this.mu.KVCExportParams(this.Do,this.yu),this.Cu=this.Du(this.eu,this.yu),this.Ci.i(w,"video info",this.Cu),this.Cu&&this.Ai.emit(A.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(I.c)(this.Cu.profile),level:Object(I.b)(this.Cu.level),chromaFormat:Object(I.a)(this.Cu.chromaFormat),bitDepth:this.Cu.bitdepth,colorInfo:this.Bu()}))},e.Bu=function(){var t=this.Cu;return t&&t.colour_description_present_flag?(this.Ou=!0,{colorRange:t.video_full_range_flag?T.b.AVCOL_RANGE_JPEG:T.b.AVCOL_RANGE_MPEG,colourPrimaries:t.colour_primaries,transferCharacteristics:t.transfer_characteristics,matrixCoefficients:t.matrix_coeffs}):(!1!==this.Ou&&this.Ci.i(w,"no colour_description_present_flag"),this.Ou=!1,{colorRange:T.b.AVCOL_RANGE_UNSPECIFIED,colourPrimaries:T.a.AVCOL_PRI_UNSPECIFIED,transferCharacteristics:T.d.AVCOL_TRC_UNSPECIFIED,matrixCoefficients:T.c.AVCOL_SPC_UNSPECIFIED})},e.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(w,"post process func detected."),this.mu.KVCDecoderPostProcess=this.eu.cwrap("kvc30dec_post_process","number",["number","number","number","number"])))},t}(),D=function(t){return t[t.KVC_PIXFMT_YUV_420P=0]="KVC_PIXFMT_YUV_420P",t[t.KVC_PIXFMT_YUV_420SP=1]="KVC_PIXFMT_YUV_420SP",t[t.KVC_PIXFMT_YUV_420SP_VU=2]="KVC_PIXFMT_YUV_420SP_VU",t}(D||{}),S={width:720,height:1280,codedWidth:720,codedHeight:1280,chromaFormat:0,profile:1,level:150,hasBFrames:1,pts:0},O=[0,0,0,1],N="kvc-wrapper",k=function(){function t(t,e,i){void 0===i&&(i=r.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=r.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:D.KVC_PIXFMT_YUV_420P,b_use_pthread:0},this.ou=0,this.au=0,t.i(N,"constructor"),this.Ci=t,this.Ai=e,this.Qu=i}var e=t.prototype;return e.init=function(t,e,i){var n=this;if(this.Ci.i(N,"init simd: "+e+" threads: "+i),!t.wasm.data)return Promise.reject("kvc wasm is null");var a=t.js.data,o=t.jsw?t.jsw.data:"",s=new Function(a+" return KVCDecoder;")(),u=o?new Blob([a],{type:"text/javascript"}):"",c=new Blob([o],{type:"text/javascript"});return s({wasmBinary:t.wasm.data,mainScriptUrlOrBlob:u,locateFile:function(t){return-1!==t.indexOf(".worker.js")?URL.createObjectURL(c):""}}).then((function(t){var e;n.eu=t,n.wu(),n.xu=n.Qu===r.c.kvc5||n.Qu===r.c.kvc6,n.Qu===r.c.kvc6&&null!=(e=n.mu)&&e.KVCDecoderPostProcess&&n.Ci.i(N,"kvc6 post process on."),i>1&&(n.di.b_use_pthread=1,n.di.threads=i),n.di.queueDecode=0,n.cu()}))},e.pushNalus=function(t,e,i){if(void 0===i&&(i=!1),this.eu&&this.mu){this.Vu(this.eu,this.au+24,S),this.eu.setValue(this.au,0,"i32"),this.ru++;var n=t.reduce((function(t,e){return t+e.data.byteLength}),0)+O.length*t.length,r=new Uint8Array(n),a=0;t.forEach((function(t){r.set(O,a),r.set(t.data,a+O.length),a+=O.length+t.data.byteLength}));var o=performance.now();this.mu.KVCDecodeFrame(this.Do,r,n,Math.round(e)||0),this.Au(o),this.hu=i}},e.getPendingNALNumber=function(){return this.ru},e.endOfFrame=function(){},e.nextFrame=function(){this.ru&&this.Au(),this.su=!0},e.free=function(){var t;null==(t=this.mu)||t.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},e.rebuild=function(){this.Ci.i(N,"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()},e.flush=function(){},e.reset=function(){},e.isWaitingData=function(){return this.su},e.Au=function(t){if(this.eu&&this.mu&&(t=t||performance.now(),this.hu&&this.mu.KVCDecodeFlush(this.Do,0),!(this.mu.KVCDecoderGetDecodedFrame(this.Do,this.au)<0))){var e=this.Tu(this.eu,this.au);e.valid&&(this.Qu===r.c.kvc6&&this.mu.KVCDecoderPostProcess&&this.Lu(this.eu,e),this.Ai.emit(A.a.DECODER_FRAME,{frame:this.du(this.eu,e),startTime:t}),this.hu||this.mu.KVCDecoderReturnDecodedFrame(this.Do,this.au),this.su=!1,this.ru--)}},e.Lu=function(t,e){var i;null!=(i=this.mu)&&i.KVCDecoderPostProcess&&(e.ysize===this.Iu.ysize&&e.usize===this.Iu.usize&&e.vsize===this.Iu.vsize||this.Nu(t,e),t.HEAPU8.set(t.HEAPU8.subarray(e.data[0],e.data[0]+e.ysize),this.Iu.y),t.HEAPU8.set(t.HEAPU8.subarray(e.data[1],e.data[1]+e.usize),this.Iu.u),t.HEAPU8.set(t.HEAPU8.subarray(e.data[2],e.data[2]+e.vsize),this.Iu.v),e.data=[this.Iu.y,this.Iu.u,this.Iu.v],t.setValue(this.au+8,e.data[0],"i32"),t.setValue(this.au+12,e.data[1],"i32"),t.setValue(this.au+16,e.data[2],"i32"),this.mu.KVCDecoderPostProcess(this.Do,this.au))},e.ku=function(){this.Ci.i(N,"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},e.Nu=function(t,e){this.Ci.i(N,"malloc post process yuv."),this.ku(),this.Iu.y=t._malloc(e.ysize),this.Iu.u=t._malloc(e.usize),this.Iu.v=t._malloc(e.vsize),this.Iu.ysize=e.ysize,this.Iu.usize=e.usize,this.Iu.vsize=e.vsize},e.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))},e.du=function(t,e){var i=g.a.AV_PIX_FMT_YUV420P,n=Object(g.b)(e.info.codedWidth||e.info.width,e.info.codedHeight||e.info.height,i),r=n.w,a=n.h;return{format:{width:r[0],height:a[0],chroma:i,chromaWidth:r[1],chromaHeight:a[1],cropLeft:0,cropTop:0,cropWidth:r[0],cropHeight:a[0],displayWidth:0,displayHeight:0,pts:e.info.pts},y:{bytes:t.HEAPU8.subarray(e.data[0],e.data[0]+e.ysize),stride:e.stride[0],bits:8},u:{bytes:t.HEAPU8.subarray(e.data[1],e.data[1]+e.usize),stride:e.stride[1],bits:8},v:{bytes:t.HEAPU8.subarray(e.data[2],e.data[2]+e.vsize),stride:e.stride[2],bits:8}}},e.Su=function(t,e){var i=t._malloc(20);return t.setValue(i,e.threads,"i32"),t.setValue(i+4,e.queueDecode,"i32"),t.setValue(i+8,e.picOutPos,"i32"),t.setValue(i+12,e.outputPixfmt,"i32"),t.setValue(i+16,e.b_use_pthread,"i32"),i},e.Fu=function(t){return t._malloc(40)},e.Pu=function(t,e){return{width:t.getValue(e,"i32"),height:t.getValue(e+4,"i32"),codedWidth:t.getValue(e+8,"i32"),codedHeight:t.getValue(e+12,"i32"),chromaFormat:t.getValue(e+16,"i32"),profile:t.getValue(e+20,"i32"),level:t.getValue(e+24,"i32"),hasBFrames:t.getValue(e+28,"i32"),pts:t.getValue(e+32,"i64")}},e.Vu=function(t,e,i){t.setValue(e,i.width,"i32"),t.setValue(e+4,i.height,"i32"),t.setValue(e+8,i.codedWidth,"i32"),t.setValue(e+12,i.codedHeight,"i32"),t.setValue(e+16,i.chromaFormat,"i32"),t.setValue(e+20,i.profile,"i32"),t.setValue(e+24,i.level,"i32"),t.setValue(e+28,i.hasBFrames,"i32"),t.setValue(e+32,i.pts,"i64")},e.Uu=function(t){return t._malloc(this.xu?65536:64)},e.Tu=function(t,e){var i,n=t.getValue(e,"i32"),r=4,a=0;this.xu?(a=t.getValue(e+r,"i32"),r+=4,i=this.Pu(t,e+32)):i=this.Pu(t,e+24);var o=[t.getValue(e+r,"i32"),t.getValue(e+r+4,"i32"),t.getValue(e+r+8,"i32")];r+=12;var s=[t.getValue(e+r,"i16"),t.getValue(e+r+2,"i16"),t.getValue(e+r+4,"i16")];return r+=6,{valid:n,poc:a,data:o,stride:s,info:i,ysize:s[0]*i.height,usize:s[1]*i.height/2,vsize:s[2]*i.height/2}},e.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(N,"post process func detected."),this.mu.KVCDecoderPostProcess=this.eu.cwrap("KVCDecoderPostProcess","number",["number","number"])))},t}(),x=a.b/a.d,P=[s.a.HEVC_NAL_TRAIL_N,s.a.HEVC_NAL_TSA_N,s.a.HEVC_NAL_STSA_N,s.a.HEVC_NAL_RADL_N,s.a.HEVC_NAL_RASL_N],M=[s.a.HEVC_NAL_IDR_W_RADL,s.a.HEVC_NAL_IDR_N_LP,s.a.HEVC_NAL_CRA_NUT],U=[c.a.VVC_NAL_UNIT_CODED_SLICE_IDR_W_RADL,c.a.VVC_NAL_UNIT_CODED_SLICE_IDR_N_LP,c.a.VVC_NAL_UNIT_CODED_SLICE_CRA,c.a.VVC_NAL_UNIT_CODED_SLICE_GDR],B="video-dec-inline",V=function(){function t(t,e){var i=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=r.s.canvas,this.zu={id:-1,time:-1},this.Ju=1,this.qu=r.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(t){i.Ci.i(B,"seek["+i.zu.id+"]: on seeked. hit cache:"+t),i.Ai.emit(A.a.DECODER_SEEK,{hitCache:t,id:i.zu.id}),t&&(i.zu.id=-1)},this.ac=function(t){for(i.Ku=t.frame.format.pts;i.rc.length&&t.frame.format.pts+1>=i.rc[0].pts;)i.rc.shift();if(t.startTime){var e,n=performance.now()-t.startTime;i.Ku+=n,i.Wu++;var r=t.frame;r.format.sar=null==(e=i.Sa)?void 0:e.sar;try{i.uc(r)}catch(t){return void i.Ai.emit(A.a.ERROR,Object(o.e)(o.b.DECODER_ERROR,o.a.DECODER_COPY_YUV_ERROR,"copy yuv error. "+(null==t?void 0:t.message)))}i.Ai.emit(A.a.DECODER_IMG,{droped:i.Zu,decoded:i.Wu,decId:i.Ju,frame:r});var a=i.zu.time;i.Da&&(a=i.Xa>=0?Math.min(i.Xa,a):a),i.zu.id>=0&&t.frame.format.pts+1>=a&&(i.Ci.i(B,"seek["+i.zu.id+"]: on frame seeked. time: "+i.zu.time+". frmae pts: "+r.format.pts),i.oc(!0))}},this.fc=function(t){return t.units.reduce((function(t,e){return-1!==P.indexOf(e.type)&&t}),!0)},this.Ac=function(t){return t.units.reduce((function(t,e){return i.vc(e.type,e.temporalId)&&t}),!0)},this.vc=function(t,e){return 255!=t&&!!e},this.Ai=e,this.Ci=t,this.Ai.on(A.a.DECODER_FRAME,this.ac),this.hc=this.fc,this.nc=new p(t,e)}var e=t.prototype;return e.init=function(t,e,i,n,a,s,u){var c=this;this.Ci.i(B,"init. "+u),this.Ju=t,this.qu=i.videoDropFramePolicy,this.nc.updateIdrFrame(M),u===r.t.kw265?this.Yu=new C(this.Ci,this.Ai):s===r.c.kvc3||s===r.c.kvc4||s===r.c.kvc5||s===r.c.kvc6?this.Yu=new k(this.Ci,this.Ai,s):s===r.c.bvc2||s===r.c.vvc||s===r.c.kvc30?(this.nc.updateIdrFrame(U),this.hc=this.Ac,this.Yu=new L(this.Ci,this.Ai)):this.Yu=new v.a(this.Ci,this.Ai);try{this.Yu.init(e,n,a).then((function(){c.Yu&&(c.tc=!0,c.Yu.nextFrame(),c.xa(),c.Ai.emit(A.a.DEC_INIT_COMPLETE,{simd:n,threads:a,decoderType:u}))})).catch((function(t){c.Ai.emit(A.a.ERROR,Object(o.e)(o.b.DECODER_ERROR,o.a.DECODER_INIT_ERROR,"string"!=typeof t?""+t:t))}))}catch(t){this.Ai.emit(A.a.ERROR,Object(o.e)(o.b.DECODER_ERROR,o.a.DECODER_INIT_ERROR,(null==t?void 0:t.message)||""))}},e.appendData=function(t){this.Da&&this.Ci.i(B,"end of data false on append"),this.Da=!1;var e=this.nc;e.appendData(t),!this.Xu&&e.frameDuration&&(this.Ah=e.frameDuration)},e.endOfData=function(){this.Ci.i(B,"end of data"),this.Da=!0},e.updateState=function(t,e,i,n,a,o){this.vt=e,this.tc=i,this.Gu=n,this.La=o,e!==r.s.video&&(this.Ba=t)},e.updateMediaInfo=function(t){this.Ci.i(B,"update media info",t),this.Sa=t,this.dc()},e.destroy=function(){this.Ai.off(A.a.DECODER_FRAME,this.ac),this.tc=!1,this.Ya()},e.reset=function(t,e){void 0===e&&(e=!1),this.Ci.i(B,"reset",t),this.lc(),this.Ju=t,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(),e||(this.zu.id=-1,this.zu.time=0),this.sc=[]},e.seek=function(t,e){t=Math.max(0,t),this.zu.id>0&&this.Ci.i(B,"seek["+e+"]: decoder seek abort ["+this.zu.id+"] "+this.zu.time),this.Ci.i(B,"seek["+e+"]: decoder seek. time: "+t,t,this.Ba);var i=this.nc,n=this.rc;if(this.Ba=this.zu.time=t,this.zu.id=e,n.length){var r=n[0].pts||0,a=this.rc.reduce((function(t,e){return Math.max(e.pts,t)}),n[n.length-1].pts);if(this.rc.length<=16&&a>0&&t>=r&&t<=a)return void this.Ci.i(B,"seek["+e+"]: decoder seek hit dec cache. cache st: "+r+" ed: "+a)}if(i.hit(t)){var o,s,u=i.getItemIdxByDts(t),c=i.idx,l=i.current;if(i.getItem(u),this.Ci.i(B,"seek["+e+"]: decoder seek. test",null==l?void 0:l.dts,t),!l||t-l.dts>3e3||t<l.dts)this.Ai.emit(A.a.RENDERER_BUF_EXPIRED),i.seek(t),u<c?this.Ci.i(B,"seek["+e+"]: decoder seek hit data cache. dec from key dts: "+(null==(o=i.current)?void 0:o.dts)+"/"+t):this.Ci.i(B,"seek["+e+"]: decoder seek hit data cache. switch gop. "+(null==l?void 0:l.gopId)+" -> "+(null==(s=i.current)?void 0:s.gopId)),this.bc(),this.lc();else this.Ci.i(B,"seek["+e+"]: decoder seek hit data cache. continue decode.")}else this.Ci.i(B,"seek["+e+"]: decoder seek miss cache."),i.clean(),this.oc(!1)},e.Fa=function(){return!(!this.Da||this.nc.remain||!this.Yu||this.Yu.isWaitingData()||this.Yu.getPendingNALNumber())},e.uc=function(t){this.mc(t.y,t.format.width,t.format.height),this.mc(t.u,t.format.chromaWidth,t.format.chromaHeight),this.mc(t.v,t.format.chromaWidth,t.format.chromaHeight)},e.mc=function(t,e,i){var n=t.bits>8?2:1;if(t.stride/n>e){for(var r=new Uint8Array(e*i*n),a=0;a<i;a++)r.set(t.bytes.subarray(t.stride*a,t.stride*a+e*n),a*e*n);t.stride=e*n,t.bytes=r}else t.bytes=new Uint8Array(t.bytes)},e.gc=function(t){if(this.Yu&&t){for(var e=0;e<this.sc.length;e++){if(this.sc[e]===t.id)return void this.sc.shift();this.sc[e]<t.id&&this.sc.shift()}this.rc.push({pts:t.pts,dts:t.dts,gopId:t.gopId}),this.rc.sort((function(t,e){return t.pts-e.pts}));try{this.Yu.pushNalus(t.data.units,t.pts,this.Da&&!this.nc.remain),t.pts>this.$u&&(this.$u=t.pts),t.type===u.d.videoFrame&&(this.Le=t.dts,this.nc.remain||this.Yu.endOfFrame())}catch(e){var i="push data pts:"+Math.round(t.pts)+" dts:"+Math.round(t.dts)+" to dec error.";this.Ci.i(B,i,e),this.Ai.emit(A.a.ERROR,Object(o.e)(o.b.DECODER_ERROR,o.a.DECODER_DEC_ERROR,i,{fatal:!1}))}}},e.lc=function(){var t;null==(t=this.Yu)||t.rebuild(),this.rc=[]},e.bc=function(){this.Ci.i(B,"reset time"),this.Yu&&this.Le&&this.Yu.reset(),this.Ku=0,this.Le=0,this.$u=0},e.yc=function(){if(this.Yu&&-1!==this.Ba&&this.vt!==r.s.video){var t=this.nc,e=this.Ba;if(this.Ku&&t.remain&&this.tc&&this.zu.id<0){var i=this._c(e),n=t.getItem(i);n&&i>5&&this.Cc(e,n.gopId)}e+=(this.La+16)*this.Ah;var a=this.Gu<this.La;if(this.tc&&t.remain&&(this.Ku<=e||a)){for(var o=t.current,s=0;o&&(o.pts<=e||o.dts<=e||!this.Le||a)&&!(++s>3);)this.gc(o),t.next(),o=t.current,a=!1;this.Da&&!t.remain?(this.Yu.flush(),this.Ai.emit(A.a.DECODER_DATA_END)):t.remain<this.ec&&this.Ai.emit(A.a.DECODER_BUF_LOW)}this.Yu.isWaitingData()&&!this.Yu.getPendingNALNumber()||this.Yu.nextFrame()}},e._c=function(t){for(var e=this.nc,i=e.idx;i<e.length;i++){var n=e.data[i];if(n.type===u.d.videoFrame&&n.dts>=t)return i-e.idx}return e.remain?e.remain:-1},e.Cc=function(t,e){for(var i=[],n=this.nc,a=n.idx;a<n.length;){var o=n.getItem(a);if(o.type===u.d.videoFrame)if(o.gopId<e)i.push(o);else{if(o.gopId>e||!(t>o.dts&&this.qu!==r.r.MIN))break;this.hc(o.data)&&i.push(o)}else o.gopId<e&&i.push(o);a++}this.Ic(i,e)},e.Ic=function(t,e){var i=!1,n=!1,r={frames:[]};if(t.length){t.sort((function(t,e){return t.pts-e.pts}));for(var a=0;a<t.length;a++)t[a].discontinuity&&(i=!0),t[a].gopId!==e&&(n=!0),this.sc.push(t[a].id),r.frames.push({pts:t[a].pts})}this.Zu+=t.length,n&&this.Yu&&this.lc(),i&&this.bc(),r.frames.length&&(this.Ci.i(B,"drop frame. num: "+r.frames.length+" rebuild: "+n+" pts: "+r.frames[0].pts+"~"+r.frames[r.frames.length-1].pts),this.Ai.emit(A.a.DECODER_DROP_FRAME,r))},e.dc=function(){var t=this.Sa;t&&t.fps&&"number"==typeof t.fps&&t.fps>0&&t.fps<a.n?(this.Xu=!0,this.Ah=a.b/t.fps,this.ec=Math.max(2*t.fps,16)):this.Ah=x},e.xa=function(){var t=this;this.Ra||(this.Ra=setInterval((function(){t.yc()}),0))},e.Ya=function(){this.Ra&&(clearInterval(this.Ra),this.Ra=void 0)},t}();e.a=V},function(t,e){t.exports=void 0},function(t,e,i){var n,r,a,o,s,u,c,l,h,d,f,p,_,v,A,g,m,b,y,E,C,T,I,R,w,L,D,S,O,N,k,x,P,M,U,B,V;t.exports=(n="3.7.7",r="function"==typeof Buffer,a="function"==typeof TextDecoder?new TextDecoder:void 0,o="function"==typeof TextEncoder?new TextEncoder:void 0,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),V={},s.forEach((function(t,e){return V[t]=e})),u=V,c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),h="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t){return new Uint8Array(Array.prototype.slice.call(t,0))},d=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"}))},f=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(t){for(var e,i,n,r,a="",o=t.length%3,u=0;u<t.length;){if((i=t.charCodeAt(u++))>255||(n=t.charCodeAt(u++))>255||(r=t.charCodeAt(u++))>255)throw new TypeError("invalid character found");a+=s[(e=i<<16|n<<8|r)>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}return o?a.slice(0,o-3)+"===".substring(o):a},_="function"==typeof btoa?function(t){return btoa(t)}:r?function(t){return Buffer.from(t,"binary").toString("base64")}:p,v=r?function(t){return Buffer.from(t).toString("base64")}:function(t){for(var e=[],i=0,n=t.length;i<n;i+=4096)e.push(l.apply(null,t.subarray(i,i+4096)));return _(e.join(""))},A=function(t,e){return void 0===e&&(e=!1),e?d(v(t)):v(t)},g=function(t){if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?l(192|e>>>6)+l(128|63&e):l(224|e>>>12&15)+l(128|e>>>6&63)+l(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return l(240|e>>>18&7)+l(128|e>>>12&63)+l(128|e>>>6&63)+l(128|63&e)},m=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=function(t){return t.replace(m,g)},y=r?function(t){return Buffer.from(t,"utf8").toString("base64")}:o?function(t){return v(o.encode(t))}:function(t){return _(b(t))},E=function(t,e){return void 0===e&&(e=!1),e?d(y(t)):y(t)},C=function(t){return E(t,!0)},T=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,I=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return l(55296+(e>>>10))+l(56320+(1023&e));case 3:return l((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return l((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},R=function(t){return t.replace(T,I)},w=function(t){if(t=t.replace(/\s+/g,""),!c.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,i,n,r="",a=0;a<t.length;)e=u[t.charAt(a++)]<<18|u[t.charAt(a++)]<<12|(i=u[t.charAt(a++)])<<6|(n=u[t.charAt(a++)]),r+=64===i?l(e>>16&255):64===n?l(e>>16&255,e>>8&255):l(e>>16&255,e>>8&255,255&e);return r},L="function"==typeof atob?function(t){return atob(f(t))}:r?function(t){return Buffer.from(t,"base64").toString("binary")}:w,D=r?function(t){return h(Buffer.from(t,"base64"))}:function(t){return h(L(t).split("").map((function(t){return t.charCodeAt(0)})))},S=function(t){return D(N(t))},O=r?function(t){return Buffer.from(t,"base64").toString("utf8")}:a?function(t){return a.decode(D(t))}:function(t){return R(L(t))},N=function(t){return f(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},x=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},P=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,x(e))};t("fromBase64",(function(){return k(this)})),t("toBase64",(function(t){return E(this,t)})),t("toBase64URI",(function(){return E(this,!0)})),t("toBase64URL",(function(){return E(this,!0)})),t("toUint8Array",(function(){return S(this)}))},M=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,x(e))};t("toBase64",(function(t){return A(this,t)})),t("toBase64URI",(function(){return A(this,!0)})),t("toBase64URL",(function(){return A(this,!0)}))},U=function(){P(),M()},B={version:"3.7.7",VERSION:n,atob:L,atobPolyfill:w,btoa:_,btoaPolyfill:p,fromBase64:k=function(t){return O(N(t))},toBase64:E,encode:E,encodeURI:C,encodeURL:C,utob:b,btou:R,decode:k,isValid:function(t){if("string"!=typeof t)return!1;var e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:A,toUint8Array:S,extendString:P,extendUint8Array:M,extendBuiltins:U,Base64:{}},Object.keys(B).forEach((function(t){return B.Base64[t]=B[t]})),B)},function(t,e,i){var n=i(53).default,r=i(55);t.exports=function(t){var e=r(t,"string");return"symbol"===n(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){t.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=9)}([function(t,e,i){var n=i(8)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){function i(t,e,i,n,r,a,o){try{var s=t[a](o),u=s.value}catch(t){return void i(t)}s.done?e(u):Promise.resolve(u).then(n,r)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function s(t){i(o,r,a,s,u,"next",t)}function u(t){i(o,r,a,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(6);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n,r,a,o,s,u,c,l,h,d,f,p,_,v,A,g,m,b,y,E,C,T,I,R,w,L,D,S,O,N,k,x,P,M,U,B;t.exports=(r="3.7.7",a="function"==typeof Buffer,o="function"==typeof TextDecoder?new TextDecoder:void 0,s="function"==typeof TextEncoder?new TextEncoder:void 0,u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),n={},u.forEach((function(t,e){return n[t]=e})),c=n,l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,h=String.fromCharCode.bind(String),d="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(t){return new Uint8Array(Array.prototype.slice.call(t,0))},f=function(t){return t.replace(/=/g,"").replace(/[+\/]/g,(function(t){return"+"==t?"-":"_"}))},p=function(t){return t.replace(/[^A-Za-z0-9\+\/]/g,"")},_=function(t){for(var e,i,n,r,a="",o=t.length%3,s=0;s<t.length;){if((i=t.charCodeAt(s++))>255||(n=t.charCodeAt(s++))>255||(r=t.charCodeAt(s++))>255)throw new TypeError("invalid character found");a+=u[(e=i<<16|n<<8|r)>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}return o?a.slice(0,o-3)+"===".substring(o):a},v="function"==typeof btoa?function(t){return btoa(t)}:a?function(t){return Buffer.from(t,"binary").toString("base64")}:_,A=a?function(t){return Buffer.from(t).toString("base64")}:function(t){for(var e=[],i=0,n=t.length;i<n;i+=4096)e.push(h.apply(null,t.subarray(i,i+4096)));return v(e.join(""))},g=function(t,e){return void 0===e&&(e=!1),e?f(A(t)):A(t)},m=function(t){if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?h(192|e>>>6)+h(128|63&e):h(224|e>>>12&15)+h(128|e>>>6&63)+h(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return h(240|e>>>18&7)+h(128|e>>>12&63)+h(128|e>>>6&63)+h(128|63&e)},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,y=function(t){return t.replace(b,m)},E=a?function(t){return Buffer.from(t,"utf8").toString("base64")}:s?function(t){return A(s.encode(t))}:function(t){return v(y(t))},C=function(t,e){return void 0===e&&(e=!1),e?f(E(t)):E(t)},T=function(t){return C(t,!0)},I=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return h(55296+(e>>>10))+h(56320+(1023&e));case 3:return h((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return h((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},w=function(t){return t.replace(I,R)},L=function(t){if(t=t.replace(/\s+/g,""),!l.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));for(var e,i,n,r="",a=0;a<t.length;)e=c[t.charAt(a++)]<<18|c[t.charAt(a++)]<<12|(i=c[t.charAt(a++)])<<6|(n=c[t.charAt(a++)]),r+=64===i?h(e>>16&255):64===n?h(e>>16&255,e>>8&255):h(e>>16&255,e>>8&255,255&e);return r},D="function"==typeof atob?function(t){return atob(p(t))}:a?function(t){return Buffer.from(t,"base64").toString("binary")}:L,S=a?function(t){return d(Buffer.from(t,"base64"))}:function(t){return d(D(t).split("").map((function(t){return t.charCodeAt(0)})))},O=function(t){return S(k(t))},N=a?function(t){return Buffer.from(t,"base64").toString("utf8")}:o?function(t){return o.decode(S(t))}:function(t){return w(D(t))},k=function(t){return p(t.replace(/[-_]/g,(function(t){return"-"==t?"+":"/"})))},P=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}},M=function(){var t=function(t,e){return Object.defineProperty(String.prototype,t,P(e))};t("fromBase64",(function(){return x(this)})),t("toBase64",(function(t){return C(this,t)})),t("toBase64URI",(function(){return C(this,!0)})),t("toBase64URL",(function(){return C(this,!0)})),t("toUint8Array",(function(){return O(this)}))},U=function(){var t=function(t,e){return Object.defineProperty(Uint8Array.prototype,t,P(e))};t("toBase64",(function(t){return g(this,t)})),t("toBase64URI",(function(){return g(this,!0)})),t("toBase64URL",(function(){return g(this,!0)}))},B={version:r,VERSION:"3.7.7",atob:D,atobPolyfill:L,btoa:v,btoaPolyfill:_,fromBase64:x=function(t){return N(k(t))},toBase64:C,encode:C,encodeURI:T,encodeURL:T,utob:y,btou:w,decode:x,isValid:function(t){if("string"!=typeof t)return!1;var e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:g,toUint8Array:O,extendString:M,extendUint8Array:U,extendBuiltins:function(){M(),U()},Base64:{}},Object.keys(B).forEach((function(t){return B.Base64[t]=B[t]})),B)},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,i.apply(null,arguments)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(3).default,r=i(7);t.exports=function(t){var e=r(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(3).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(3).default;function r(){t.exports=r=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function d(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,i){return t[e]=i}}function f(t,e,i,n){var r=e&&e.prototype instanceof m?e:m,a=Object.create(r.prototype),o=new N(n||[]);return s(a,"_invoke",{value:L(t,i,o)}),a}function p(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=f;var _="suspendedStart",v="executing",A="completed",g={};function m(){}function b(){}function y(){}var E={};d(E,c,(function(){return this}));var C=Object.getPrototypeOf,T=C&&C(C(k([])));T&&T!==a&&o.call(T,c)&&(E=T);var I=y.prototype=m.prototype=Object.create(E);function R(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var i;s(this,"_invoke",{value:function(r,a){function s(){return new e((function(i,s){!function i(r,a,s,u){var c=p(t[r],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return i("throw",t,s,u)}))}u(c.arg)}(r,a,i,s)}))}return i=i?i.then(s,s):s()}})}function L(t,i,n){var r=_;return function(a,o){if(r===v)throw Error("Generator is already running");if(r===A){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n.A=n.arg;else if("throw"===n.method){if(r===_)throw r=A,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var c=p(t,i,n);if("normal"===c.type){if(r=n.done?A:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=A,n.method="throw",n.arg=c.arg)}}}function D(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,D(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(r,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,g;var o=a.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function i(){for(;++r<t.length;)if(o.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return b.prototype=y,s(I,"constructor",{value:y,configurable:!0}),s(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,h,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,d(t,h,"GeneratorFunction")),t.prototype=Object.create(I),t},i.awrap=function(t){return{__await:t}},R(w.prototype),d(w.prototype,l,(function(){return this})),i.AsyncIterator=w,i.async=function(t,e,n,r,a){void 0===a&&(a=Promise);var o=new w(f(t,e,n,r),a);return i.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},R(I),d(I,h,"Generator"),d(I,c,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},i.values=k,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this.A=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var i in this)"t"===i.charAt(0)&&o.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(n,r){return s.type="throw",s.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),O(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;O(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:k(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){i.r(e),i.d(e,"KwaiPlayerYUV2RGB",(function(){return y}));var n=i(1),r=i.n(n),a=i(2),o=i.n(a),s=i(0),u=i.n(s),c=i(4),l="lib-yuv2rgb-wrapper",h=function(){function t(t){var e;this.I=void 0,this.C=void 0,this.B=void 0,this.h=void 0,this.I=t,null==(e=this.I)||e.i(l,"constructor")}var e,i=t.prototype;return i.init=(e=r()(u.a.mark((function t(){var e,i,n,r,a,o=this;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null==(e=this.I)||e.i(l,"init libyuv2rgb."),i=c.Base64.decode("CnZhciBLd2FpWVVWMlJHQiA9ICgoKSA9PiB7CiAgdmFyIF9zY3JpcHROYW1lID0gdHlwZW9mIGRvY3VtZW50ICE9ICd1bmRlZmluZWQnID8gZG9jdW1lbnQuY3VycmVudFNjcmlwdD8uc3JjIDogdW5kZWZpbmVkOwogIAogIHJldHVybiAoCmZ1bmN0aW9uKG1vZHVsZUFyZyA9IHt9KSB7CiAgdmFyIG1vZHVsZVJ0bjsKCnZhciBhPW1vZHVsZUFyZyxmLGcsaD1uZXcgUHJvbWlzZSgoYixjKT0+e2Y9YjtnPWN9KSxsPSJvYmplY3QiPT10eXBlb2Ygd2luZG93LG09ImZ1bmN0aW9uIj09dHlwZW9mIGltcG9ydFNjcmlwdHMsbj1PYmplY3QuYXNzaWduKHt9LGEpLHA9IiIscSxyOwppZihsfHxtKW0/cD1zZWxmLmxvY2F0aW9uLmhyZWY6InVuZGVmaW5lZCIhPXR5cGVvZiBkb2N1bWVudCYmZG9jdW1lbnQuY3VycmVudFNjcmlwdCYmKHA9ZG9jdW1lbnQuY3VycmVudFNjcmlwdC5zcmMpLF9zY3JpcHROYW1lJiYocD1fc2NyaXB0TmFtZSkscC5zdGFydHNXaXRoKCJibG9iOiIpP3A9IiI6cD1wLnN1YnN0cigwLHAucmVwbGFjZSgvWz8jXS4qLywiIikubGFzdEluZGV4T2YoIi8iKSsxKSxtJiYocj1iPT57dmFyIGM9bmV3IFhNTEh0dHBSZXF1ZXN0O2Mub3BlbigiR0VUIixiLCExKTtjLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiO2Muc2VuZChudWxsKTtyZXR1cm4gbmV3IFVpbnQ4QXJyYXkoYy5yZXNwb25zZSl9KSxxPWI9PmZldGNoKGIse2NyZWRlbnRpYWxzOiJzYW1lLW9yaWdpbiJ9KS50aGVuKGM9PmMub2s/Yy5hcnJheUJ1ZmZlcigpOlByb21pc2UucmVqZWN0KEVycm9yKGMuc3RhdHVzKyIgOiAiK2MudXJsKSkpO3ZhciB0PWEucHJpbnRFcnJ8fGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTsKT2JqZWN0LmFzc2lnbihhLG4pO249bnVsbDt2YXIgdT1hLndhc21CaW5hcnksdix3PSExLHg7ZnVuY3Rpb24geSgpe3ZhciBiPXYuYnVmZmVyO2EuSEVBUDg9bmV3IEludDhBcnJheShiKTthLkhFQVAxNj1uZXcgSW50MTZBcnJheShiKTthLkhFQVBVOD14PW5ldyBVaW50OEFycmF5KGIpO2EuSEVBUFUxNj1uZXcgVWludDE2QXJyYXkoYik7YS5IRUFQMzI9bmV3IEludDMyQXJyYXkoYik7YS5IRUFQVTMyPW5ldyBVaW50MzJBcnJheShiKTthLkhFQVBGMzI9bmV3IEZsb2F0MzJBcnJheShiKTthLkhFQVBGNjQ9bmV3IEZsb2F0NjRBcnJheShiKX12YXIgej1bXSxBPVtdLEI9W107ZnVuY3Rpb24gQygpe3ZhciBiPWEucHJlUnVuLnNoaWZ0KCk7ei51bnNoaWZ0KGIpfXZhciBEPTAsRT1udWxsLEY9bnVsbCxHPWI9PmIuc3RhcnRzV2l0aCgiZGF0YTphcHBsaWNhdGlvbi9vY3RldC1zdHJlYW07YmFzZTY0LCIpLEg7CmZ1bmN0aW9uIEkoYil7aWYoYj09SCYmdSlyZXR1cm4gbmV3IFVpbnQ4QXJyYXkodSk7aWYocilyZXR1cm4gcihiKTt0aHJvdyJib3RoIGFzeW5jIGFuZCBzeW5jIGZldGNoaW5nIG9mIHRoZSB3YXNtIGZhaWxlZCI7fWZ1bmN0aW9uIEooYil7cmV0dXJuIHU/UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+SShiKSk6cShiKS50aGVuKGM9Pm5ldyBVaW50OEFycmF5KGMpLCgpPT5JKGIpKX1mdW5jdGlvbiBMKGIsYyxkKXtyZXR1cm4gSihiKS50aGVuKGU9PldlYkFzc2VtYmx5Lmluc3RhbnRpYXRlKGUsYykpLnRoZW4oZCxlPT57dChgZmFpbGVkIHRvIGFzeW5jaHJvbm91c2x5IHByZXBhcmUgd2FzbTogJHtlfWApO2Eub25BYm9ydD8uKGUpO2U9IkFib3J0ZWQoIitlKyIpIjt0KGUpO3c9ITA7ZT1uZXcgV2ViQXNzZW1ibHkuUnVudGltZUVycm9yKGUrIi4gQnVpbGQgd2l0aCAtc0FTU0VSVElPTlMgZm9yIG1vcmUgaW5mby4iKTtnKGUpO3Rocm93IGU7fSl9CmZ1bmN0aW9uIE0oYixjKXt2YXIgZD1IO3JldHVybiB1fHwiZnVuY3Rpb24iIT10eXBlb2YgV2ViQXNzZW1ibHkuaW5zdGFudGlhdGVTdHJlYW1pbmd8fEcoZCl8fCJmdW5jdGlvbiIhPXR5cGVvZiBmZXRjaD9MKGQsYixjKTpmZXRjaChkLHtjcmVkZW50aWFsczoic2FtZS1vcmlnaW4ifSkudGhlbihlPT5XZWJBc3NlbWJseS5pbnN0YW50aWF0ZVN0cmVhbWluZyhlLGIpLnRoZW4oYyxmdW5jdGlvbihrKXt0KGB3YXNtIHN0cmVhbWluZyBjb21waWxlIGZhaWxlZDogJHtrfWApO3QoImZhbGxpbmcgYmFjayB0byBBcnJheUJ1ZmZlciBpbnN0YW50aWF0aW9uIik7cmV0dXJuIEwoZCxiLGMpfSkpfQp2YXIgTj1iPT57Zm9yKDswPGIubGVuZ3RoOyliLnNoaWZ0KCkoYSl9LE89e2E6Yj0+e3ZhciBjPXgubGVuZ3RoO2I+Pj49MDtpZigyMTQ3NDgzNjQ4PGIpcmV0dXJuITE7Zm9yKHZhciBkPTE7ND49ZDtkKj0yKXt2YXIgZT1jKigxKy4yL2QpO2U9TWF0aC5taW4oZSxiKzEwMDY2MzI5Nik7YTp7ZT0oTWF0aC5taW4oMjE0NzQ4MzY0OCw2NTUzNipNYXRoLmNlaWwoTWF0aC5tYXgoYixlKS82NTUzNikpLXYuYnVmZmVyLmJ5dGVMZW5ndGgrNjU1MzUpLzY1NTM2O3RyeXt2Lmdyb3coZSk7eSgpO3ZhciBrPTE7YnJlYWsgYX1jYXRjaChLKXt9az12b2lkIDB9aWYoaylyZXR1cm4hMH1yZXR1cm4hMX19LFA9ZnVuY3Rpb24oKXtmdW5jdGlvbiBiKGQpe1A9ZC5leHBvcnRzO3Y9UC5iO3koKTtBLnVuc2hpZnQoUC5jKTtELS07YS5tb25pdG9yUnVuRGVwZW5kZW5jaWVzPy4oRCk7MD09RCYmKG51bGwhPT1FJiYoY2xlYXJJbnRlcnZhbChFKSxFPW51bGwpLEYmJihkPUYsRj1udWxsLGQoKSkpO3JldHVybiBQfQp2YXIgYz17YTpPfTtEKys7YS5tb25pdG9yUnVuRGVwZW5kZW5jaWVzPy4oRCk7aWYoYS5pbnN0YW50aWF0ZVdhc20pdHJ5e3JldHVybiBhLmluc3RhbnRpYXRlV2FzbShjLGIpfWNhdGNoKGQpe3QoYE1vZHVsZS5pbnN0YW50aWF0ZVdhc20gY2FsbGJhY2sgZmFpbGVkIHdpdGggZXJyb3I6ICR7ZH1gKSxnKGQpfUh8fD1HKCJsaWJ5dXYycmdiLndhc20iKT8ibGlieXV2MnJnYi53YXNtIjphLmxvY2F0ZUZpbGU/YS5sb2NhdGVGaWxlKCJsaWJ5dXYycmdiLndhc20iLHApOnArImxpYnl1djJyZ2Iud2FzbSI7TShjLGZ1bmN0aW9uKGQpe2IoZC5pbnN0YW5jZSl9KS5jYXRjaChnKTtyZXR1cm57fX0oKTthLl95dXYycmdiPShiLGMsZCxlLGssSyxTLFQpPT4oYS5feXV2MnJnYj1QLmQpKGIsYyxkLGUsayxLLFMsVCk7YS5fZ2V0X21hcF9wdHI9KCk9PihhLl9nZXRfbWFwX3B0cj1QLmUpKCk7YS5fbWFsbG9jPWI9PihhLl9tYWxsb2M9UC5nKShiKTthLl9mcmVlPWI9PihhLl9mcmVlPVAuaCkoYik7CnZhciBRO0Y9ZnVuY3Rpb24gUigpe1F8fFUoKTtRfHwoRj1SKX07ZnVuY3Rpb24gVSgpe2Z1bmN0aW9uIGIoKXtpZighUSYmKFE9ITAsYS5jYWxsZWRSdW49ITAsIXcpKXtOKEEpO2YoYSk7YS5vblJ1bnRpbWVJbml0aWFsaXplZD8uKCk7aWYoYS5wb3N0UnVuKWZvcigiZnVuY3Rpb24iPT10eXBlb2YgYS5wb3N0UnVuJiYoYS5wb3N0UnVuPVthLnBvc3RSdW5dKTthLnBvc3RSdW4ubGVuZ3RoOyl7dmFyIGM9YS5wb3N0UnVuLnNoaWZ0KCk7Qi51bnNoaWZ0KGMpfU4oQil9fWlmKCEoMDxEKSl7aWYoYS5wcmVSdW4pZm9yKCJmdW5jdGlvbiI9PXR5cGVvZiBhLnByZVJ1biYmKGEucHJlUnVuPVthLnByZVJ1bl0pO2EucHJlUnVuLmxlbmd0aDspQygpO04oeik7MDxEfHwoYS5zZXRTdGF0dXM/KGEuc2V0U3RhdHVzKCJSdW5uaW5nLi4uIiksc2V0VGltZW91dChmdW5jdGlvbigpe3NldFRpbWVvdXQoZnVuY3Rpb24oKXthLnNldFN0YXR1cygiIil9LDEpO2IoKX0sMSkpOmIoKSl9fQppZihhLnByZUluaXQpZm9yKCJmdW5jdGlvbiI9PXR5cGVvZiBhLnByZUluaXQmJihhLnByZUluaXQ9W2EucHJlSW5pdF0pOzA8YS5wcmVJbml0Lmxlbmd0aDspYS5wcmVJbml0LnBvcCgpKCk7VSgpO21vZHVsZVJ0bj1oOwoKCiAgcmV0dXJuIG1vZHVsZVJ0bjsKfQopOwp9KSgpOwppZiAodHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgPT09ICdvYmplY3QnKQogIG1vZHVsZS5leHBvcnRzID0gS3dhaVlVVjJSR0I7CmVsc2UgaWYgKHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lWydhbWQnXSkKICBkZWZpbmUoW10sICgpID0+IEt3YWlZVVYyUkdCKTsK"),n=new Blob([i],{type:"text/javascript"}),r=new Function(i+" return KwaiYUV2RGB;")(),a={wasmBinary:c.Base64.toUint8Array("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="),mainScriptUrlOrBlob:n},t.abrupt("return",r(a).then((function(t){var e;null==(e=o.I)||e.i(l,"inited."),o.C=t})));case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)}),i.destroy=function(){var t,e;null==(t=this.I)||t.i(l,"destroy"),this.Y(),this.h&&(null==(e=this.C)||e._free(this.h),this.h=void 0),this.B=void 0,this.C=void 0},i.yuv2rgb=function(t,e,i,n,r,a,o,s){var u=this.B,c=this.C;c&&(u?u.y.size===t.length&&u.u.size===e.length&&u.v.size===i.length||(this.Y(),u.y.ptr=c._malloc(t.length),u.y.size=t.length,u.u.ptr=c._malloc(e.length),u.u.size=e.length,u.v.ptr=c._malloc(i.length),u.v.size=t.length,u.rgb.ptr=c._malloc(n.length),u.rgb.size=n.length):u=this.B={y:{ptr:c._malloc(t.length),size:t.length},u:{ptr:c._malloc(e.length),size:e.length},v:{ptr:c._malloc(i.length),size:i.length},rgb:{ptr:c._malloc(n.length),size:n.length}},c.HEAPU8.set(t,u.y.ptr),c.HEAPU8.set(e,u.u.ptr),c.HEAPU8.set(i,u.v.ptr),c._yuv2rgb(u.y.ptr,u.u.ptr,u.v.ptr,u.rgb.ptr,r,a,o,s),n.set(c.HEAPU8.subarray(u.rgb.ptr,u.rgb.ptr+u.rgb.size)))},i.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))},o()(t,[{key:"inited",get:function(){return!!this.C}},{key:"map",get:function(){if(this.C){var t=this.C._get_map_ptr();return this.C.HEAPU8.subarray(t,t+67108864)}}}])}(),d="map10bit",f=function(){function t(){}return t.initMap=(e=r()(u.a.mark((function e(i,n,r,a){var o,s,c,l,h,f;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(null==a||a.i(d,"init yuv2rgb map. full: "+n),o=[],s=typeof OffscreenCanvas<"u"||0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp"),c=0,l=1;l<9;l++)h="https://s2-10895.kwimgs.com/kos/nlav10895/yuvmap/3/"+(n?"full/":"limit/")+"map_10bit_"+l+"."+(s?"webp":"png"),o.push(t.G(h,l,i,c,a)),c+=8388608;return e.next=7,Promise.all(o);case 7:return f=e.sent,e.abrupt("return",Promise.resolve(f.reduce((function(t,e){return t&&e.result}),!0)));case 9:case"end":return e.stop()}}),e)}))),function(t,i,n,r){return e.apply(this,arguments)}),t.G=function(){var t=r()(u.a.mark((function t(e,i,n,r,a){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null==a||a.i(d,"load map slice. url: "+e+" idx: "+i),t.abrupt("return",new Promise((function(t){fetch(e).then((function(e){e.ok?e.blob().then((function(e){createImageBitmap(e).then((function(e){var a=typeof HTMLCanvasElement>"u"?new OffscreenCanvas(1,1):document.createElement("canvas"),o=a.getContext("2d");if(a.width=e.width,a.height=e.height,o){o.drawImage(e,0,0);var s=o.getImageData(0,0,a.width,a.height);n.set(s.data,r),t({idx:i,result:!0})}else t({idx:i,result:!1});e.close()}))})):t({idx:i,result:!1})})).catch((function(e){t({idx:i,result:!1})}))})));case 2:case"end":return t.stop()}}),t)})));return function(e,i,n,r,a){return t.apply(this,arguments)}}(),t;var e}();function p(t){return _.apply(this,arguments)}function _(){return(_=r()(u.a.mark((function t(e){return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){setTimeout((function(){t()}),e)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var v=function(){function t(){}return t.N=function(t,e,i,n,r){for(var a=e[0],o=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],d=e[7],f=e[8],p=n;p<r;p++)for(var _=0;_<256;_++)for(var v=0;v<256;v++){var A=p-i,g=_-128,m=v-128,b=((p/16<<8)+v<<12)+((p%16<<8)+_)<<2;t[b]=Math.min(255,Math.max(0,A*a+g*o+m*s|0)),t[b+1]=Math.min(255,Math.max(0,A*u+g*c+m*l|0)),t[b+2]=Math.min(255,Math.max(0,A*h+g*d+m*f|0)),t[b+3]=255}},t.initMap=(e=r()(u.a.mark((function e(i,n,r){var a,o;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null==r||r.i("map8bit","init yuv2rgb map. matrix: "+n),a=n.subarray(3,12),o=0===n[0]?0:16,t.N(i,a,o,0,64),e.next=5,p(0);case 5:return t.N(i,a,o,64,128),e.next=8,p(0);case 8:return t.N(i,a,o,128,192),e.next=11,p(0);case 11:return t.N(i,a,o,192,256),e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e)}))),function(t,i,n){return e.apply(this,arguments)}),t;var e}(),A=i(5),g=i.n(A),m={},b="yuv2rgb",y=function(){function t(t){var e;this.Z=void 0,this.I=void 0,this.F=void 0,this.R="notSet",this.Z=(e=t,g()({},m,e)),this.I=this.Z.logger,this.F=new h(this.I)}var e,i=t.prototype;return i.initMap=(e=r()(u.a.mark((function t(e,i,n){var r,a,o,s,c,l=this;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=0===e[0],null==(r=this.I)||r.i(b,"init yuv2rgb map. matrix: "+e+" full: "+a+" bit: "+n),this.R="loading",this.F){t.next=5;break}return t.abrupt("return",Promise.reject("wasm undefined."));case 5:if(t.prev=5,this.F.inited){t.next=10;break}return t.next=9,this.F.init();case 9:null==(o=this.I)||o.i(b,"wasm inited.");case 10:if(s=this.F.map){t.next=14;break}return this.R="error",t.abrupt("return",Promise.reject("map null."));case 14:return c=10===n?f.initMap(s,a,i,this.I):v.initMap(s,e,this.I),t.abrupt("return",c.then((function(t){return l.R=t?"complete":"error",t})));case 18:return t.prev=18,t.t0=t.catch(5),t.abrupt("return",Promise.reject(t.t0));case 21:case"end":return t.stop()}}),t,this,[[5,18]])}))),function(t,i,n){return e.apply(this,arguments)}),i.yuv2rgb=function(t,e,i,n,r,a,o,s){var u;null==(u=this.F)||u.yuv2rgb(t,e,i,n,r,a,o,s)},i.destroy=function(){var t,e;null==(t=this.I)||t.i(b,"destroy"),this.I=void 0,null==(e=this.F)||e.destroy(),this.R="notSet"},o()(t,[{key:"readyState",get:function(){return this.R}}],[{key:"version",get:function(){return"1.0.0-alpha.8"}}])}();e.default=y}]).default},function(t,e,i){var n=i(53).default;t.exports=function(t,e){if("object"!==n(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e,n){return t.exports=i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e,n)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){Number.isFinite||(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)}),Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=Math.pow(2,53)-1),Object.values||(Object.values=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(t[i]);return e})},function(t,e,i){i.r(e);var n=i(18),r=i(13),a=i(34),o=i(48),s=i(28),u=i(2);e.default=function(t){var e,i,c=new s.a;[u.a.STEP,u.a.RENDERER_BUF_UPDATE,u.a.DEC_VIDEO_READY,u.a.DECODER_WAITING,u.a.RENDERER_SEEK,u.a.RENDERER_DRAW,u.a.ERROR,u.a.RENDERER_INIT_COMPLETE,u.a.RENDERER_WAITING,u.a.RENDERER_WAITING_END].forEach((function(e){return c.on(e,(function(i){return t.postMessage({event:e,data:i})}))})),c.on(u.a.DECODER_IMG,(function(e){t.postMessage({event:u.a.DECODER_IMG,data:e},[e.frame.y.bytes.buffer,e.frame.u.bytes.buffer,e.frame.v.bytes.buffer])})),c.on(u.a.SCREENSHOT,(function(e){e.image?t.postMessage({event:u.a.SCREENSHOT,data:e},[e.image.data.buffer]):t.postMessage({event:u.a.SCREENSHOT,data:e})})),t.addEventListener("message",(function(s){var u,l,h,d,f=s.data;switch(f.cmd){case r.a.UPDATE_STATE:e.updateState(f.streamTime,f.width,f.height,f.stoped,f.output,f.maxFrameBufLen,f.pictMode);break;case r.a.APPEND_DATA:e.append(f.frame);break;case r.a.SEEK:e.seek(f.time,f.id);break;case r.a.STEP:e.step(f.type);break;case r.a.INIT_RENDERER:i||(i=Object(a.b)(t,f.config.logLevel||n.DEFAULT_LOG_LEVEL,f.contextId,f.hasExternalLogger,"vr")),u=i,l=f.id,h=f.config,d=f.canvas,(e=new o.a(u,c)).init(l,h,d);break;case r.a.RESET:e.reset(f.decId,f.seeking);break;case r.a.MEDIA_INFO:e.updateMediaInfo(f.mediaInfo);break;case r.a.END_OF_DATA:e.endOfData();break;case r.a.DEC_DROP_FRAME:e.decDropFrameInfo(f.data);break;case r.a.DESTROY:e&&e.destroy(),c&&c.removeAllListeners();break;case r.a.SCREENSHOT:e.screenshot(f.options)}}))}},function(t,e,i){t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},function(t,e,i){var n=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function a(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var i,r,o=[];for(r in"string"!=typeof e&&(e="?"),t)if(n.call(t,r)){if((i=t[r])||null!=i&&!isNaN(i)||(i=""),r=a(r),i=a(i),null===r||null===i)continue;o.push(r+"="+i)}return o.length?e+o.join("&"):""},e.parse=function(t){for(var e,i=/([^=?#&]+)=?([^&]*)/g,n={};e=i.exec(t);){var a=r(e[1]),o=r(e[2]);null===a||null===o||a in n||(n[a]=o)}return n}},function(t,e,i){i.r(e);var n=i(18),r=i(13),a=i(34),o=i(28),s=i(2),u=i(49);e.default=function(t){var e,i,c=new o.a;[s.a.DEC_INIT_COMPLETE,s.a.DECODER_SEEK,s.a.RENDERER_BUF_EXPIRED,s.a.DECODER_DATA_END,s.a.DECODER_BUF_LOW,s.a.DECODER_DROP_FRAME,s.a.ERROR,s.a.DECODER_MEDIA_INFO].forEach((function(e){return c.on(e,(function(i){return t.postMessage({event:e,data:i})}))})),c.on(s.a.DECODER_IMG,(function(e){t.postMessage({event:s.a.DECODER_IMG,data:e},[e.frame.y.bytes.buffer,e.frame.u.bytes.buffer,e.frame.v.bytes.buffer])})),t.addEventListener("message",(function(o){var s,l,h,d,f,p,_,v,A=o.data;switch(A.cmd){case r.a.APPEND_DATA:e.appendData(A.data);break;case r.a.UPDATE_STATE:e.updateState(A.streamTime,A.output,A.active,A.frameBufLen,A.playbackRate,A.maxFrameBufLen);break;case r.a.INIT_265:i||(i=Object(a.b)(t,A.config.logLevel||n.DEFAULT_LOG_LEVEL,A.contextId,A.hasExternalLogger,"vd")),s=i,l=A.id,h=A.lib,d=A.config,f=A.simd,p=A.threads,_=A.codecType,v=A.decoderType,e&&e.destroy(),(e=new u.a(s,c)).init(l,h,d,f,p,_,v);break;case r.a.MEDIA_INFO:e.updateMediaInfo(A.mediaInfo);break;case r.a.DESTROY:e&&e.destroy(),c&&c.removeAllListeners();break;case r.a.RESET:e.reset(A.decId,A.seeking);break;case r.a.SEEK:e.seek(A.time,A.id);break;case r.a.END_OF_DATA:e.endOfData()}}))}},function(t,e,i){i.r(e),i.d(e,"default",(function(){return Ha})),i.d(e,"createKernel",(function(){return Ga})),i.d(e,"AbstractDestroyable",(function(){return h.a})),i.d(e,"CanvasContextType",(function(){return l.b})),i.d(e,"CodecType",(function(){return l.c})),i.d(e,"DestroyableList",(function(){return h.b})),i.d(e,"Decoder",(function(){return l.d})),i.d(e,"DemuxerType",(function(){return me.b})),i.d(e,"DownloadStatus",(function(){return Ne})),i.d(e,"ErrorDetails",(function(){return D.a})),i.d(e,"ErrorTypes",(function(){return D.b})),i.d(e,"HttpRangeType",(function(){return l.e})),i.d(e,"KEvents",(function(){return S.a})),i.d(e,"LiveShiftType",(function(){return l.g})),i.d(e,"LogLevel",(function(){return Ar.LogLevel})),i.d(e,"MediaBox",(function(){return l.i})),i.d(e,"ReportTypes",(function(){return br})),i.d(e,"StereoType",(function(){return l.n})),i.d(e,"VideoDecBlockPolicy",(function(){return l.p})),i.d(e,"VideoDropFramePolicy",(function(){return l.r})),i.d(e,"VideoRendererType",(function(){return l.s})),i.d(e,"WasmDecoder",(function(){return l.t}));var n=i(8),r=i.n(n),a=i(5),o=i.n(a),s=i(10),u=i.n(s),c=(i(57),i(43)),l=i(0),h=i(14),d=i(19);function f(t,e,i){if(void 0===t[e])t[e]=i;else{var n=t[e];Array.isArray(n)?n.push(i):"string"==typeof n&&(t[e]=[n,i])}}function p(t){var e={};return"string"==typeof t?t.trim().split(/[\r\n]+/).forEach((function(t){var i=t.split(": "),n=i.shift(),r=i.join(":");n&&f(e,n,r)})):t&&t.forEach((function(t,i){t.split(",").forEach((function(t){f(e,i,t)}))})),e}function _(t){var e=[];if(t)for(var i in t){var n=t[i];n&&e.push(i+": "+(Array.isArray(n)?n.join(","):n).slice(0,255))}if(e.length)return e.length>20?(e.sort((function(t,e){return A(e)-A(t)})),e.slice(0,20)):e}var v,A=function(t){return 0===t.toLowerCase().indexOf("kwaisign")||0===t.toLowerCase().indexOf("x-ks-")?1:0},g=((v={}).MOZ_CHUNK="moz-chunked-arraybuffer",v.UNKNOW="unknow",v.UNSUPPORT="",v),m=function(){function t(){var t=this;this.tag="xhr",this.Oc=null,this.wc=void 0,this.Ec=null,this.jc=g.UNKNOW,this.kc=function(){if(t.Oc){var e=t.Oc;2===e.readyState&&(t.wc.responseUrl=e.responseURL,t.wc.responseHeader=p(e.getAllResponseHeaders()),t.Ec&&t.Ec.onConnect&&t.Ec.onConnect(t.wc,e.status),(e.status<200||e.status>299)&&t.Di())}},this.Mc=function(){if(t.Oc){var e=t.Oc.response;t.Ec&&t.Ec.onProgress&&e&&t.Ec.onProgress(t.wc,e)}},this.Sc=function(){var e=null,i=t.Oc;!t.jc&&i&&(e=i.response),t.Ec&&t.Ec.onEnd(t.wc,e)},this.Di=function(){var e;if(t.Ec&&t.Ec.onError){var i=new Error("xhr load error.");i.name=d.b.XHR_ERROR_NAME,t.Ec.onError(i)}null==(e=t.Oc)||e.abort()},this.Oc=null}t.isSupportChunk=function(){if(t.Bc!==g.UNKNOW)return t.Bc;try{var e=new XMLHttpRequest;if(e.open("GET","https://example.com",!0),e.responseType=g.MOZ_CHUNK,e.responseType===g.MOZ_CHUNK)return t.Bc=g.MOZ_CHUNK,t.Bc}catch(e){t.Bc=g.UNSUPPORT}return g.UNSUPPORT};var e=t.prototype;return e.load=function(e,i){this.Ec=i,this.wc=e,this.jc=g.UNSUPPORT,e.progress&&"arraybuffer"===e.responseType&&(this.jc=t.isSupportChunk());var n=this.Oc=new XMLHttpRequest;n.open(e.requestMethod?e.requestMethod:"GET",this.wc.url,!0),this.jc===g.MOZ_CHUNK?(n.responseType=g.MOZ_CHUNK,n.onprogress=this.Mc,n.onload=this.Sc):(n.responseType=e.responseType||"arraybuffer",n.onload=this.Sc),n.onreadystatechange=this.kc,n.onerror=this.Di,n.withCredentials=!!e.credentials,e.range&&n.setRequestHeader("Range",e.range),e.headers&&e.headers.forEach((function(t){n.setRequestHeader(t.header,t.value)})),n.send(e.requestBody)},e.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)},e.destroy=function(){this.Ec=null,this.abort()},t}();m.Bc=g.UNKNOW;var b=[l.i.hls,l.i.hls_ts,l.i.hls_fmp4];function y(t){return!!t&&-1!==b.indexOf(t)}var E=i(6);function C(t,e){var i=t.toString();return-1!==i.toLowerCase().indexOf("[native code]")&&-1!==i.indexOf(e)?l.j.UNKNOWN:l.j.PROBABLY}var T=function(){function t(t){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=t}t.isSupported=function(){return typeof fetch<"u"&&typeof ReadableStream<"u"};var e=t.prototype;return e.load=function(t,e){var i=this;this.wc=t,this.Ec=e;var n=new Headers;t.headers&&t.headers.forEach((function(t){n.append(t.header,t.value)})),t.range&&n.append("Range",t.range);var r={method:t.requestMethod?t.requestMethod:"GET",headers:n,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade",signal:this.Lc()};t.requestBody&&(r.body=t.requestBody),t.credentials&&(r.credentials="include");var a=fetch;if(!0===t.preferNative){var o=this.Nc();a=o.func,t.monkeyPatched=o.patched,t.useResetNativeFetch=null==o?void 0:o.resetNativeFetch}else t.monkeyPatched=C(a,"fetch");a(t.url,r).then((function(e){if(t.responseUrl=e.url,t.redirected=e.redirected,t.responseHeader=p(e.headers),i.Ec&&i.Ec.onConnect&&i.Ec.onConnect(t,e.status),e.ok)return i.Rc?void(e.body&&e.body.getReader().cancel().catch((function(t){return i.Ci.i(i.tag,t)}))):"arraybuffer"===t.responseType?t.progress?void(e.body&&(i.Dc=e.body.getReader(),i.Qc(i.Dc))):void e.arrayBuffer().then((function(e){i.xc(t,e)})).catch((function(t){if(!i.Rc){var n=new Error("arraybuffer error. "+e.status+" "+t);n.name=d.b.FETCH_ERROR_NAME,i.Di(n)}})):void e.text().then((function(e){i.xc(t,e)})).catch((function(t){if(!i.Rc){var n=new Error("text error. "+e.status+" "+t);n.name=d.b.FETCH_ERROR_NAME,i.Di(n)}}));var n=new Error("res not ok. "+e.status+" "+e.statusText);n.name=d.b.FETCH_ERROR_NAME,i.Di(n)})).catch((function(t){"AbortError"!==t.name&&i.Di(t)}))},e.abort=function(){this.Tc&&(this.Tc.abort(),this.Tc=null),this.Dc&&(this.Dc.cancel().catch((function(){})),this.Dc=null),this.Rc=!0},e.destroy=function(){this.Ec=null,this.abort()},e.Mc=function(t,e){this.Ec&&this.Ec.onProgress&&this.Ec.onProgress(t,e)},e.xc=function(t,e){this.Ec&&this.Ec.onEnd&&(this.Dc=null,this.Tc=null,this.Ec.onEnd(t,e))},e.Di=function(t){this.Ec&&this.Ec.onError&&this.Ec.onError(t)},e.Qc=function(t){var e=this;t.read().then((function(i){if(e.Rc)return t.cancel(),null;if(i.done)return e.xc(e.wc,null),null;var n=i.value.buffer;return e.wc.useResetNativeFetch&&E.a.safari&&(n=new Uint8Array(new Uint8Array(n).subarray()).buffer),e.Mc(e.wc,n),e.Qc(t)})).catch((function(t){"AbortError"!==t.name&&(t.name=d.b.FETCH_READ_ERROR_NAME,e.Di(t))}))},e.Lc=function(){try{if(AbortController)return this.Tc=new AbortController,this.Tc.signal}catch(t){return null}return null},e.Nc=function(){if(void 0!==t.Vc)return t.Vc;if(C(fetch,"fetch")===l.j.PROBABLY){var e=function(t){var e,i,n=document.createElement("iframe");document.body.appendChild(n);var r=null==(e=(null==(i=n.contentWindow)?void 0:i.fetch)||null)?void 0:e.bind(t);return document.body.removeChild(n),r}(window);this.Ci.i(this.tag,"detected io monkey patched. get native io, fetch: "+!!e),t.Vc=e?{func:e,patched:l.j.PROBABLY,resetNativeFetch:!0}:{func:fetch,patched:l.j.PROBABLY,resetNativeFetch:!1}}else t.Vc={func:fetch,patched:l.j.UNKNOWN,resetNativeFetch:!1};return t.Vc},t}();T.Vc=void 0;var I=i(7),R=i(22),w="fallback",L=function(t){function e(e){var i;return(i=t.call(this)||this).Do=void 0,i.Ci=void 0,i.Uc=!1,i.Fc=void 0,i.Do=e,i.Ci=e.logger,i}u()(e,t);var i=e.prototype;return i.reset=function(){return this.Ci.i(w,"reset"),this.Uc=!1,this},i.stop=function(){return this},i.setRetryFunc=function(t){return this.Fc=t,this},i.destroy=function(){this.Ci.i(w,"fallback: "+this.constructor.name+" destroy."),this.Fc=void 0,t.prototype.destroy.call(this)},i.getAvailable=function(){return!(!this.Fc||this.Uc)},i.Pc=function(t){if(this.Fc&&!1!==this.Fc())return this.Uc=!0,t},i.emit=function(t,e){return this.Do.evt.emit(t,e)},e}(h.a),D=i(3),S=i(2),O=function(t){return t.FLV_LIVE_RELOAD="flvLiveReload",t.USE_BACKUP="useBackup",t.USE_BACKUP_MULTIPART="useBackupMultipart",t.NO_WORKER="noWorker",t.SWAP_REMUX_TYPE="swapRemuxType",t.SWAP_AUDIO_CODECSTR="swapAudioCodecStr",t.NEXT_DESC="nextDesc",t.SWAP_WASM_DECODER="swapWasmDecoder",t.SWAP_CORE="swapCore",t.SWAP_264="swap264",t.RELOAD_WASM="reloadWasm",t.DROP_V_FRAME="dropVFrame",t}({}),N="fallback",k=function(t){function e(e){var i;return(i=t.call(this)||this).Do=void 0,i.Ci=void 0,i.Hc={},i.Yc=void 0,i.Di=function(t){if(i.Ci.i(N,"on error",t,Object.keys(i.Hc)),i.Yc||(i.Yc=i.Gc()),t.fatal){i.Ci.i(N,"error. type: "+t.type+" details: "+t.details+" reason: "+t.reason);for(var e=0;e<i.Yc.actions.length;e++){var n=i.Yc.actions[e];if(n){var a=i.Hc[n.type];if(null!=a&&a.getAvailable()){var o=i.Do.stat.coreType,s=a.run(t);if(s)return i.Ci.i(N,"fallback run. type: "+n.type+" "+e+"/"+i.Yc.actions.length+". reason: "+t.reason),t.preventFollowUp=!0,s.code=Object(D.d)(t.details,t.reason,t.statusCode),s.errorData=r()({},t),s.core=o,i.Do.evt.emit(S.a.RETRY,s),void i.Kc(e)}}}i.Ci.i(N,"no fallback matched. reason: "+t.reason)}},i.Do=e,i.Ci=e.logger,i.O.push(i.Do.evt.prependListener(S.a.ERROR,i.Di)),i}u()(e,t);var i=e.prototype;return i.register=function(t,e){var i=this;return this.Ci.i(N,"register "+t+" "+e.constructor.name),this.Hc[t]&&(this.Ci.i(N,t+" existed."),this.O.destroyItem(e)),this.Hc[t]=e,this.O.push(e),{destroy:function(){return i.unregisterAndDestroy(t)}}},i.unregisterAndDestroy=function(t){var e=this.Hc[t];return e&&(this.O.destroyItem(e),e.destroy(),delete this.Hc[t],this.Ci.i(N,"unregisterAndDestroy "+t)),this},i.hasFallback=function(t){return!!this.Hc[t]},i.reset=function(){for(var t in this.Ci.i(N,"reset"),this.Hc)this.unregisterAndDestroy(t);this.Hc={},this.Yc=void 0},i.stop=function(){for(var t in this.Hc)this.Hc[t].stop()},i.Kc=function(t){if(this.Yc){var e=this.Yc.actions[t];!e||e.type!==O.SWAP_CORE&&e.type!==O.NO_WORKER||(this.Zc(O.USE_BACKUP),this.Zc(O.USE_BACKUP_MULTIPART),this.Zc(O.FLV_LIVE_RELOAD))}},i.Gc=function(){this.Ci.i(N,"generate fallback policy.");var t=this.Do,e=(E.a.mobile,{core:t.stat.coreType,actions:[]});return t.stat.coreType===l.a.mse?e.actions.push({type:O.RELOAD_WASM},{type:O.FLV_LIVE_RELOAD},{type:O.USE_BACKUP_MULTIPART},{type:O.USE_BACKUP},{type:O.NO_WORKER},{type:O.DROP_V_FRAME},{type:O.SWAP_REMUX_TYPE},{type:O.SWAP_AUDIO_CODECSTR},{type:O.SWAP_264},{type:O.NEXT_DESC},{type:O.SWAP_WASM_DECODER},{type:O.SWAP_CORE}):t.stat.coreType===l.a.native&&e.actions.push({type:O.USE_BACKUP},{type:O.SWAP_264},{type:O.NEXT_DESC},{type:O.SWAP_CORE},{type:O.RELOAD_WASM},{type:O.FLV_LIVE_RELOAD},{type:O.USE_BACKUP_MULTIPART},{type:O.NO_WORKER},{type:O.SWAP_REMUX_TYPE},{type:O.SWAP_AUDIO_CODECSTR},{type:O.SWAP_WASM_DECODER}),e},i.Zc=function(t){var e;null==(e=this.Hc[t])||e.reset()},e}(h.a),x=function(t){function e(){return t.apply(this,arguments)||this}u()(e,t);var i=e.prototype;return i.run=function(t){if(this.getAvailable()&&t.details===D.a.DECODER_INIT_ERROR&&("none"!==this.Do.stat.wasmLibHitCache||this.Do.stat.wasmThreadsEnabled))return this.Ci.i("fallback-reload-wasm","run"),this.Do.stat.wasmThreadsEnabled&&(this.Do.stat.wasmThreadsEnabled=!1),this.Pc({type:l.k.FALLBACK,message:"wasm lib init error. reload wasm.",fallback:O.RELOAD_WASM})},i.getAvailable=function(){return!this.Uc&&!E.a.mobile},e}(L);function P(){return typeof navigator>"u"?0:navigator.hardwareConcurrency||0}var M=i(31);function U(){return"object"!=typeof window||"object"!=typeof document||"function"!=typeof document.createElement}var B=i(33),V=i.n(B),F=i(13),j=i(48),H="canvas-renderer-wrapper",G=function(){function t(t){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 i=t.data;(i.event===S.a.RENDERER_DRAW||i.event===S.a.RENDERER_BUF_UPDATE)&&(e.Gu=i.data.yuvBufLen),e.Xc&&e.Ai.emit(i.event,i.data)},this.Jc=function(t){e.Do.logger.i(H,"worker onerror",t.message),e.Ai.emit(S.a.ERROR,Object(D.e)(D.b.RENDERER_ERROR,D.a.DECODER_DEC_ERROR,"r: "+t.message))},this.Do=t,this.Ci=t.logger,this.Ai=t.evt,!t.cOutput)throw new Error("canvas output undefined.");this.Na=t.cOutput}var e=t.prototype;return e.init=function(t){this.Ci.i(H,"init renderer");var e=this.Do.getDecConfig();if(this.Na.canvas instanceof HTMLCanvasElement){if(t)try{var i;this.Xc=V()(58);var n=this.Na.canvas.transferControlToOffscreen();null==(i=this.Xc)||i.postMessage({cmd:F.a.INIT_RENDERER,id:this.At,config:e,canvas:n,contextId:this.Do.id,hasExternalLogger:!!this.Do.config.logger},[n])}catch(t){var r;this.Ci.i(H,"rendering worker startup failed.",t),null==(r=this.Xc)||r.terminate(),this.Xc=void 0}this.Xc?(this.Xc.addEventListener("message",this.zc),this.Xc.addEventListener("error",this.Jc)):(this.Wc=new j.a(this.Ci,this.Ai),this.Wc.init(this.At,e,this.Na.canvas))}else this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.RENDERER_ERROR,D.a.DECODER_UNSUPPORTED,"init error worker:"+!!this.Xc+" canvas:"+!!this.Na.canvas+" decoder:"+!!this.Wc))},e.destroy=function(){this.Ci.i(H,"destroy"),this.Xc?(this.Xc.postMessage({cmd:F.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)},e.step=function(t){this.Ci.i(H,"step: "+t),this.Xc?this.Xc.postMessage({cmd:F.a.STEP,type:t}):this.Wc&&this.Wc.step(t)},e.updateMediaInfo=function(t){(this.Xc||this.Wc)&&(this.Xc?this.Xc.postMessage({cmd:F.a.MEDIA_INFO,mediaInfo:t}):this.Wc&&this.Wc.updateMediaInfo(t))},e.seek=function(t,e){this.Ci.i(H,"seek["+e+"]: time: "+t),this.Xc?this.Xc.postMessage({cmd:F.a.SEEK,time:t,id:e}):this.Wc&&this.Wc.seek(t,e)},e.reset=function(t){void 0===t&&(t=!1),this.Gu=0,this.Xc?this.Xc.postMessage({cmd:F.a.RESET,decId:this.At,seeking:t}):this.Wc&&this.Wc.reset(this.At,t)},e.append=function(t){this.Xc?this.Xc.postMessage({cmd:F.a.APPEND_DATA,frame:t},[t.y.bytes.buffer,t.u.bytes.buffer,t.v.bytes.buffer]):this.Wc&&this.Wc.append(t)},e.update=function(t,e,i,n,r,a,o){this.Xc?this.Xc.postMessage({cmd:F.a.UPDATE_STATE,streamTime:t,width:e,height:i,stoped:n,output:r,maxFrameBufLen:a,pictMode:o}):this.Wc&&this.Wc.updateState(t,e,i,n,r,a,o)},e.endOfData=function(){this.Xc?this.Xc.postMessage({cmd:F.a.END_OF_DATA}):this.Wc&&this.Wc.endOfData()},e.dropFrame=function(t){this.Xc?this.Xc.postMessage({cmd:F.a.DEC_DROP_FRAME,data:t}):this.Wc&&this.Wc.decDropFrameInfo(t)},e.screenshot=function(t){this.Xc?this.Xc.postMessage({cmd:F.a.SCREENSHOT,options:t}):this.Wc&&this.Wc.screenshot(t)},o()(t,[{key:"isUseingWorker",get:function(){return!!this.Xc}},{key:"id",get:function(){return this.At},set:function(t){this.At=t}},{key:"frameBufLen",get:function(){return this.Gu}}])}(),z=[16,24,32],W=function(){function t(){this.qc=[],this.$c=0}return t.prototype.onWaiting=function(){this.qc.push(performance.now()),this.qc.length>3&&this.qc.shift(),this.$c>=z.length-1||this.qc.length>=3&&this.qc[this.qc.length-1]-this.qc[0]<15e3&&this.$c++},o()(t,[{key:"maxFrameBufLen",get:function(){return z[this.$c]||z[z.length-1]||z[0]}}])}(),K="canvas-provider",Y=function(t){function e(e){var i;return(i=t.call(this)||this).Do=void 0,i.Ci=void 0,i.Ai=void 0,i.Sa=[],i.tf=!1,i.if=!0,i.zu=void 0,i.No=!1,i.ef=void 0,i.yt={w:0,h:0},i.nf=!1,i.sf=void 0,i.rf=new W,i.Ra=function(){var t;i.tf&&null!=(t=i.Do.cOutput)&&t.canvas&&(i.hf(),requestAnimationFrame(i.Ra))},i.Do=e,i.Ci=e.logger,i.Ai=e.evt,i.sf=new G(e),i.O.push(i.sf),i}u()(e,t);var i=e.prototype;return i.destroy=function(){this.Sa=[],this.stop(),t.prototype.destroy.call(this)},i.setMediaInfo=function(t){this.Ci.i(K,"setMediaInfo",t),this.Sa.push(t)},i.start=function(){this.tf||(this.Ci.i(K,"start loop"),this.tf=!0,requestAnimationFrame(this.Ra))},i.stop=function(){this.Ci.i(K,"stop loop"),this.tf=!1},i.step=function(t){this.Ci.i(K,"step type: "+t+"."),this.sf.step(t)},i.hf=function(){},i.af=function(t){var e=!1,i=(U()?1:window.devicePixelRatio)||1,n=t.clientWidth*i,r=t.clientHeight*i;return this.yt.w===n&&this.yt.h===r||(this.yt.w=n,this.yt.h=r,e=!0),e},o()(e,[{key:"canvas",get:function(){var t;return null==(t=this.Do.cOutput)?void 0:t.canvas}},{key:"waiting",get:function(){return this.if}},{key:"pausedOnWaiting",get:function(){return this.ef},set:function(t){this.ef=t}}])}(h.a),Q=i(51),X=(i(50),"https://s2-10895.kwimgs.com/kos/nlav10895/"),Z={key:"kwai-deckvc30-lib",lib:X+"kvc30/9/libkvc30dec.wasm",libS:X+"kvc30/9/libkvc30dec-simd.wasm",libT:X+"kvc30/9/libkvc30dec-threads.wasm",libST:X+"kvc30/9/libkvc30dec-simd-threads.wasm",js:X+"kvc30/9/libkvc30dec.js",jsT:X+"kvc30/9/libkvc30dec-threads.js",jsST:X+"kvc30/9/libkvc30dec-simd-threads.js",jsW:X+"kvc30/9/libkvc30dec-threads.worker.js"},q={key:"kwai-deckvc-lib",lib:X+"kvc/kvc-decoder-1.wasm",libS:X+"kvc/kvc-decoder-simd-1.wasm",libT:X+"kvc/kvc-decoder-threads-2.wasm",libST:X+"kvc/kvc-decoder-simd-threads-2.wasm",js:X+"kvc/kvc-decoder-1.js",jsT:X+"kvc/kvc-decoder-threads-2.js",jsST:X+"kvc/kvc-decoder-simd-threads-2.js",jsW:X+"kvc/kvc-decoder-threads-2.worker.js"},J={key:"kwai-deckvc4-lib",lib:X+"kvc4/kvc-decoder-1.wasm",libS:X+"kvc4/kvc-decoder-simd-1.wasm",libT:X+"kvc4/kvc-decoder-threads-1.wasm",libST:X+"kvc4/kvc-decoder-simd-threads-1.wasm",js:X+"kvc4/kvc-decoder-1.js",jsT:X+"kvc4/kvc-decoder-threads-1.js",jsST:X+"kvc4/kvc-decoder-simd-threads-1.js",jsW:X+"kvc4/kvc-decoder-threads-1.worker.js"},$={key:"kwai-deckvc6-lib",lib:X+"kvc6/kvc-decoder-2.wasm",libS:X+"kvc6/kvc-decoder-simd-2.wasm",libT:X+"kvc6/kvc-decoder-threads-2.wasm",libST:X+"kvc6/kvc-decoder-simd-threads-2.wasm",js:X+"kvc6/kvc-decoder-2.js",jsT:X+"kvc6/kvc-decoder-threads-2.js",jsST:X+"kvc6/kvc-decoder-simd-threads-2.js",jsW:X+"kvc6/kvc-decoder-threads-2.worker.js"},tt={key:"kwai-kw265-lib",lib:X+"ks265/libks265dec-4.wasm",libS:X+"ks265/libks265dec-simd-4.wasm",libT:X+"ks265/libks265dec-threads-4.wasm",libST:X+"ks265/libks265dec-simd-threads-4.wasm",js:X+"ks265/libks265dec-4.js",jsT:X+"ks265/libks265dec-threads-4.js",jsST:X+"ks265/libks265dec-simd-threads-4.js",jsW:X+"ks265/libks265dec-threads-4.worker.js"},et=function(){function t(){this.timeout=6048e5}var e=t.prototype;return e.write=function(e,i){if(t.available)try{return localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()})),!0}catch(t){}return!1},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(t){}},o()(t,null,[{key:"available",get:function(){if(void 0===t.ut)try{localStorage.setItem("alg","test"),t.ut=!0}catch(e){t.ut=!1}return t.ut}}])}();et.ut=void 0;var it=et,nt={},rt=tt,at={},ot="dec-lib-helper",st=function(){function t(t){this.Ci=void 0,this.uf=new it,this.Ci=t,nt[l.t.kvc3]=q,nt[l.t.kvc4]=J,nt[l.t.kvc5]=$,nt[l.t.kvc6]=$,nt[l.t.kvc30]=Z,nt[l.t.kw265]=tt}var e=t.prototype;return e.getDecLibURL=function(t){return nt[t]||rt},e.getLsLibCacheKeys=function(){var t=[],e=Object.keys(nt).map((function(t){return nt[t].key}));if(it.available)for(var i=0;i<localStorage.length;i++){var n=localStorage.key(i);n&&e.indexOf(n)>=0&&t.push(n)}return t},e.getMemLibCacheKeys=function(){return Object.keys(at)},e.saveToCache=function(t,e,i){if(void 0===i&&(i=!0),this.Ci.i(ot,"save to cache "+t+". key: "+this.getDecLibURL(t).key+" ls: "+i),e.wasm.data&&(at[t]=e,i)){var n={ts:Date.now(),js:r()({},e.js),wasm:{url:e.wasm.url,data:Q.Base64.fromUint8Array(e.wasm.data)}};e.jsw&&(n.jsw=r()({},e.jsw));var a=!1,o=1;do{this.cf(o,t),a=this.uf.write(this.getDecLibURL(t).key,n),this.getLsLibCacheKeys().length,o--}while(!a&&o>=0)}},e.loadFromCache=function(t,e){this.Ci.i(ot,"load from cache "+t+".");var i=at[t];if(i){if(this.Ci.i(ot,"hit cache "+t+". mem"),this.ff(t,i,e))return"mem";delete at[t]}var n=this.getDecLibURL(t),r=this.uf.read(n.key,!1);return r&&this.ff(t,r,e)?(this.Ci.i(ot,"hit cache "+t+". ls"),at[t]=e,"ls"):"none"},e.removeMemCache=function(){at={}},e.removeAllCache=function(){this.Ci.i(ot,"remove all cache"),this.removeMemCache();var t=this.getLsLibCacheKeys();it.available&&t.forEach((function(t){localStorage.removeItem(t)}))},e.ff=function(t,e,i){return e.js&&e.js.data&&e.js.url===i.js.url&&(this.Ci.i(ot,"hit cache "+t+" js."),i.js.data=e.js.data),i.jsw&&e.jsw&&e.jsw.data&&e.jsw.url===i.jsw.url&&(this.Ci.i(ot,"hit cache "+t+" jsw."),i.jsw.data=e.jsw.data),e.wasm&&e.wasm.data&&e.wasm.url===i.wasm.url&&(this.Ci.i(ot,"hit cache "+t+" wasm."),i.wasm.data="string"==typeof e.wasm.data?Q.Base64.toUint8Array(e.wasm.data):new Uint8Array(e.wasm.data)),!(!i.js.data||!i.wasm.data)},e.cf=function(t,e){var i=this;if(this.Ci.i(ot,"remove ls Cache",t),it.available){var n=this.getLsLibCacheKeys();if(n.length>t){var r=[],a=[];n.forEach((function(t){var e=i.uf.read(t),n=i.Af(e);e&&n?a.push({key:t,val:e}):r.push(t)})),a.sort((function(t,e){return t.val.ts-e.val.ts}));for(var o=0;o<a.length-t;o++)r.push(a[o].key);this.Ci.i(ot,"remove",r),r.forEach((function(t){localStorage.removeItem(t)}))}}},e.Af=function(t){return!!(t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"ts")&&"number"==typeof t.ts&&Object.prototype.hasOwnProperty.call(t,"js")&&"object"==typeof t.js&&"string"==typeof t.js.data&&Object.prototype.hasOwnProperty.call(t,"wasm")&&"object"==typeof t.wasm&&"string"==typeof t.wasm.data)},t}(),ut=i(23),ct=i.n(ut),lt=0,ht="loader",dt=function(){function t(t){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 i=e.lf,n=e.wc;null!=(t=e.Ec)&&t.onLoad&&e.Ec.onLoad(n,i),i.code=0,i.tfirst=0,i.loaded=0,e.wf(),e.vf=new(e.Ef())(e.Ci),i.type=e.vf instanceof T?d.c.FETCH:d.c.XHR,e.vf&&(i.id=e.vf.tag+"-"+e.Ct,e.di.connectionTimeout&&(e.gf=setTimeout((function(){return e.jf(d.a.LOADER_CONNECT_TIMEOUT)}),e.di.connectionTimeout)),e.kf(n),i.tsload=Date.now(),i.tstart=performance.now(),e.Ci.i(ht,"["+e.Ct+"]load: "+e.vf.tag+" "+n.url+" progress: "+n.progress+" type: "+n.type+" responseType: "+n.responseType+" range: "+n.range),e.vf.load(n,e.df))},this.Mf=function(t,i){e.Sf();var n=e.lf;e.Bf(t,n),e.Tf(),n.code=i,n.tfirst=Math.max(n.trequest,performance.now()),e.Ci.i(ht,"["+e.Ct+"]connect code: "+i+" len: "+n.contentLength+" totalLength: "+n.contentTotalLength),e.Ec&&e.Ec.onConnect&&e.Ec.onConnect(t,n),"number"==typeof t.rangeStart&&t.rangeStart>0&&206!==n.code&&e.Ec&&e.Ec.onError&&setTimeout((function(){e.Di(new Error("range error. "+t.range+" statu code:"+n.code))}),0)},this.Mc=function(t,i){try{var n=e.lf;if(e.If=performance.now(),!t.breakpointContinuation&&n.output>n.loaded){if(n.loaded+i.byteLength-n.output>0){var r=i.slice(n.output-n.loaded);e.Df(e.wc,r,n)}n.loaded+=i.byteLength}else n.loaded+=i.byteLength,e.Df(e.wc,i,n)}catch(t){e.Ci.i(ht,"handling data error. ",t),e.Di(new Error(d.a.HANDLING_DATA_ERROR+". "+t))}},this.Di=function(t){e.Rf(),e.Lf();var i,n=e.lf,r=e.di,a=e.wc,o=n.type===d.c.FETCH&&a.monkeyPatched&&void 0===a.preferNative;e.pf=!1,e.Ci.i(ht,"["+e.Ct+"]error: "+t.name+" "+(null==t?void 0:t.message)+" code: "+n.code+" retry: "+n.retry+"/"+r.maxRetry+" "+(o?"monkeyPatchedFetch":"")),e.wc.breakpointContinuation&&416===n.code||o&&e.lf.output===n.loaded&&n.loaded>0?null!=(i=e.Ec)&&i.onEnd&&e.Ec.onEnd(e.wc,null,n):(n.fatal=!r.maxRetry||n.retry>=r.maxRetry||!r.maxRetry,n.errName=t.name,n.errMessage=t.name+": "+t.message+". status: "+n.code,o&&(t.name===d.b.FETCH_READ_ERROR_NAME&&!e.lf.loaded||t.message===d.a.LOADER_TRANS_TIMEOUT&&!e.lf.loaded||t.message===d.a.LOADER_CONNECT_TIMEOUT||!e.lf.code)&&(e.wc.preferNative=!0,e.Ci.i(ht,"monkey patched fetch error. switch to native fetch.")),e.Ec&&e.Ec.onError&&e.Ec.onError(e.wc,n),n.fatal||(r.breakpointContinuation&&e.lf.contentTotalLength&&(e.Ci.i(ht,"["+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)),n.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 i=new Error(t);e.Di(i)},this.Ci=t,this.Ct=lt+=1,this.Ci.i(ht,"["+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 e=t.prototype;return e.Ef=function(){return void 0!==t.Qf||(t.Qf=m,E.a.msie||E.a.msedge?m.isSupportChunk()?t.Qf=m:T.isSupported()&&(t.Qf=T):T.isSupported()?t.Qf=T:m.isSupportChunk()&&(t.Qf=m)),t.Qf},e.load=function(t,e,i){this.fa(t,e,i),this.Of()},e.destroy=function(){this.vf&&this.Ci.i(ht,"["+this.Ct+"]destroy."),this.Rf(),this.Nf(!1),this.Lf(),this.Ec=null},e.abort=function(){this.Ci.i(ht,"["+this.Ct+"]abort"),this.Rf(),this.Nf()},e.fa=function(t,e,i){this.wc=t,this.Cf=t.rangeStart,this.Ec=e,this.di=i||this.di,this.lf={id:"",type:d.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)},e.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=null)},e.Nf=function(t){void 0===t&&(t=!0),t&&this.Ec&&this.Ec.onAbort&&!this.mf&&this.pf&&this.Ec.onAbort(this.wc,this.lf),this.mf=!0,this.vf&&this.vf.abort()},e.Rf=function(){this.Sf(),this.wf(),this.xf()},e.Df=function(t,e,i){this.lf.output+=e.byteLength,this.Ec&&this.Ec.onProgress&&this.Ec.onProgress(t,e,i)},e.xc=function(t,e){this.Rf();var i=this.lf;this.Bf(t,i),i.total=e?i.loaded="string"==typeof e?e.length||0:e.byteLength||0:i.loaded,i.tload=Math.max(i.tfirst,performance.now()),this.pf=!1,i.output=0,this.Ci.i(ht,"["+this.Ct+"]end size: "+i.total+" duration: "+i.trequest+"-"+i.tload),this.Ec&&this.Ec.onEnd(t,e,i)},e.Tf=function(){var t=this;this.xf(),this.If=performance.now();var e=this.di.transmissionTimeout||0;e&&(this.yf=setInterval((function(){performance.now()-t.If>e&&t.jf(d.a.LOADER_TRANS_TIMEOUT)}),1e3))},e.xf=function(){this.yf&&(clearInterval(this.yf),this.yf=void 0)},e.Sf=function(){this.gf&&(clearTimeout(this.gf),this.gf=void 0)},e.wf=function(){this._f&&(clearTimeout(this._f),this._f=void 0)},e.kf=function(t){if(t.rangeEnd||t.rangeStart)if(t.rangeType&&t.rangeType!==l.e.STANDARD&&"string"==typeof t.url){var e=new ct.a(t.url,!0);t.rangeEnd?(e.query.start=(t.rangeStart||0).toString(),e.query.end=(t.rangeEnd-1).toString()):t.rangeStart&&(e.query.start=t.rangeStart.toString()),t.url=e.toString()}else t.rangeEnd?t.range="bytes="+(t.rangeStart||0)+"-"+(t.rangeEnd-1):t.rangeStart&&(t.range="bytes="+t.rangeStart+"-")},e.Bf=function(t,e){if(!e.contentTotalLength||!e.contentLength){var i=t.responseHeader;if(i){if(t.range||"number"==typeof t.rangeStart){var n=i["content-range"];n&&(e.contentTotalLength=parseInt((Array.isArray(n)?n[0]||"0":n).split("/")[1]||"0")||0)}var r=i["content-length"];r&&(e.contentLength=parseInt(Array.isArray(r)?r[0]||"0":r)||0)}}},o()(t,[{key:"context",get:function(){return this.wc}},{key:"config",get:function(){return this.di}}])}();dt.Qf=void 0;var ft="dec-lib-loader",pt=function(){function t(t){var e=this;this.Vf=l.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,i){i.fatal&&(e.Lf(),e.Do.evt.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.DEC_LIB_LOAD_ERROR,i.errMessage,{statusCode:i.code,url:t.url})))},this.Do=t,this.Ci=t.logger,this.Bo=new st(t.logger)}var e=t.prototype;return e.load=function(t,e,i,n){this.Ci.i(ft,"load ignoreCache: "+t+" decoderType: "+e+" simd: "+i+", threads: "+n),this.Hf=performance.now(),this.Vf=e;var r=this.Bo.getDecLibURL(this.Vf),a=r.js,o="",s=r.lib;n&&r.jsW&&(i&&r.libST&&r.jsST?(s=r.libST,a=r.jsST,o=r.jsW):r.libT&&r.jsT?(s=r.libT,a=r.jsT,o=r.jsW):n=!1),i&&!n&&r.libS&&(s=r.libS);var u,c={js:{url:a,data:""},wasm:{url:s}};o&&(c.jsw={url:o,data:""}),t||(u=this.Bo.loadFromCache(this.Vf,c)),this.Ci.i(ft,"wasm: "+s+" cacheType: "+u),this.Gf(c,u)||(c.js.data||this.Kf(c),c.wasm.data||this.Zf(c),c.jsw&&!c.jsw.data&&this.Wf(c))},e.destroy=function(){this.Lf()},e.Lf=function(){this.Xf(),this.zf(),this.Jf()},e.Gf=function(t,e){void 0===e&&(e="none");var i=!!(t.js.data&&t.wasm.data&&(!t.jsw||t.jsw&&t.jsw.data));if("mem"!==e&&i&&this.Bo.saveToCache(this.Vf,t,"none"===e),i){this.Ci.i(ft,"dec lib loaded",e);var n={lib:t,hitCache:e,duration:performance.now()-this.Hf};this.Do.evt.emit(S.a.DEC_LIB_LOADED,n)}return i},e.Zf=function(t){var e=this;this.Ci.i(ft,"load wasm"),this.Xf();var i=this.Uf=new dt(this.Ci),n={onError:this.Yf,onEnd:function(i,n){n instanceof ArrayBuffer&&(t.wasm.data=new Uint8Array(n),e.Gf(t))}},r={connectionTimeout:this.Do.config.decLibConnectionTimeout,maxRetry:this.Do.config.decLibLoadingMaxRetry,retryDelay:this.Do.config.decLibLoadingRetryDelay},a={url:t.wasm.url,responseType:"arraybuffer",progress:!1,preferNative:this.Do.stat.preferNativeLoader};i.load(a,n,r)},e.Kf=function(t){var e=this;this.Ci.i(ft,"load js"),this.zf();var i=this.Ff=new dt(this.Ci),n={onError:this.Yf,onEnd:function(i,n){"string"==typeof n&&(t.js.data=n,e.Gf(t))}},r={connectionTimeout:this.Do.config.decLibConnectionTimeout,maxRetry:this.Do.config.decLibLoadingMaxRetry},a={url:t.js.url,responseType:"text",progress:!1,preferNative:this.Do.stat.preferNativeLoader};i.load(a,n,r)},e.Wf=function(t){var e=this;if(this.Ci.i(ft,"load jsw"),this.Jf(),t.jsw){var i=this.Pf=new dt(this.Ci),n={onError:this.Yf,onEnd:function(i,n){"string"==typeof n&&(t.jsw&&(t.jsw.data=n),e.Gf(t))}},r={connectionTimeout:this.Do.config.decLibConnectionTimeout,maxRetry:this.Do.config.decLibLoadingMaxRetry},a={url:t.jsw.url,responseType:"text",progress:!1,preferNative:this.Do.stat.preferNativeLoader};i.load(a,n,r)}},e.Xf=function(){this.Uf&&this.Uf.destroy()},e.zf=function(){this.Ff&&this.Ff.destroy()},e.Jf=function(){this.Pf&&this.Pf.destroy()},t}(),_t=i(21);function vt(){var t,e,i;if(!U())return(null==(t=window)?void 0:t.ManagedMediaSource)||(null==(e=window)?void 0:e.MediaSource)||(null==(i=window)?void 0:i.WebKitMediaSource)}function At(){var t,e,i;if(!U())return(null==(t=window)?void 0:t.ManagedSourceBuffer)||(null==(e=window)?void 0:e.SourceBuffer)||(null==(i=window)?void 0:i.WebKitSourceBuffer)}var gt=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){if(this.getAvailable()&&(this.Do.stat.coreType===l.a.mse&&t.type===D.b.NETWORK_ERROR&&t.details!==D.a.DEC_LIB_LOAD_ERROR&&t.details!==D.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED&&!this.Do.stat.multipart||this.Do.stat.coreType===l.a.native&&t.details!==D.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:l.k.BACKUP,message:"trans error. use backup url.",fallback:O.USE_BACKUP})}},e}(L),mt=i(39);function bt(t,e){return e?mt.a.search(e,(function(e){return t<e.start?-1:t>e.start+e.duration?1:0})):null}function yt(t,e){return e?mt.a.searchIndex(e,(function(e){return t<e.start?-1:t>e.start+e.duration?1:0})):-1}function Et(t){if(t){var e=t.toLocaleLowerCase();return e.indexOf("audio")>=0?l.o.AUDIO:e.match(/(video|sps|pps|VTDecompression)/i)?l.o.VIDEO:void 0}}var Ct="fallback-drop-v-frame",Tt=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).qf=0,e}u()(e,t);var i=e.prototype;return i.run=function(t){var e=Et(t.reason);if(this.getAvailable()&&e===l.o.VIDEO&&t.details===D.a.VIDEO_ERROR_3){var i,n,r=this.Do;this.Ci.i(Ct,"run"),this.qf++;var a=r.streamTime.getKeyFrameTime(r.currentTime),o=null==(i=r.lctx.current)?void 0:i.dropVideo,s=r.stat.multipart?null==(n=bt(r.currentTime,r.lctx.current.fragments))?void 0:n.sn:-1;if("number"!=typeof s||!o)return;if(a){for(var u=0;u<o.length;u++){var c,h,d;if(s>=0&&s===(null==(c=o[u])?void 0:c.fragSn)&&(null==(h=o[u])?void 0:h.keyframePTS)===a.originPTS||(null==(d=o[u])?void 0:d.keyframePTS)===a.originPTS)return}var f={time:r.currentTime,keyframePTS:a.originPTS,fragSn:s>=0?s:void 0,mode:"keyframesOnly"},p="video dec err: "+t.details+" @"+f.time+" drop v sample after key pts: "+f.keyframePTS+".";return this.Ci.i(Ct,p),o.push(f),this.Pc({type:l.k.FALLBACK,message:p,fallback:O.DROP_V_FRAME})}}},i.reset=function(){return this.Ci.i(Ct,"reset"),this.qf=0,t.prototype.reset.call(this),this},i.getAvailable=function(){return!(!(this.Fc&&this.qf<this.Do.config.mseDecErrSkip)||!0===this.Do.stat.isLive&&this.Do.stat.box===l.i.flv)},e}(L),It="fallback-flv-live-reload",Rt=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).$f=void 0,e.qf=0,e}u()(e,t);var i=e.prototype;return i.run=function(t){if(this.Fc&&t.type===D.b.NETWORK_ERROR&&t.details!==D.a.DEC_LIB_LOAD_ERROR&&t.details!==D.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED&&!1!==this.Do.stat.isLive&&this.Do.stat.box===l.i.flv&&this.getAvailable())return this.Ci.i(It,"run"),this.tA(Math.max(this.Do.config.retryDelay,1e3*this.Do.bufferedSec),t,this.Fc),{type:l.k.LOADER,message:"live flv network error reason: "+(null==t?void 0:t.reason)+". retry: "+this.qf+". reload",fallback:O.FLV_LIVE_RELOAD}},i.reset=function(){return this.Ci.i(It,"reset"),this.iA(),this.qf=0,t.prototype.reset.call(this),this},i.stop=function(){return this.iA(),this},i.destroy=function(){this.iA()},i.getAvailable=function(){return this.qf<this.Do.config.maxRetry},i.tA=function(t,e,i){var n=this;this.$f||(this.$f=setTimeout((function(){n.Ci.i(It,"live retry:"+n.qf),n.qf++,i(),n.$f=void 0}),t))},i.iA=function(){this.$f&&(this.Ci.i(It,"clear retry delay timer."),clearTimeout(this.$f),this.$f=void 0)},e}(L),wt=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){if(this.getAvailable()&&t.details===D.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:l.k.FALLBACK,message:"remux worker error. close worker",fallback:O.NO_WORKER})},e}(L),Lt=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){var e=this.Do.stat.audioCodec,i=Et(t.reason);if(this.getAvailable()&&(!i||i===l.o.AUDIO)&&(t.details===D.a.VIDEO_ERROR||t.details===D.a.VIDEO_ERROR_3)&&!this.Do.stat.recoverSwapAudioCodec&&e)return this.Ci.i("fallback-swap-audio-codec-str","run"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5",this.Do.stat.audioCodec=e,this.Do.stat.recoverSwapRemux=!0,this.Pc({type:l.k.FALLBACK,message:"video error: "+t.details+". change audio codec: "+e+".",fallback:O.SWAP_AUDIO_CODECSTR})},e}(L),Dt=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){var e=Et(t.reason);if(this.getAvailable()&&(!e||e===l.o.VIDEO)&&!this.Do.stat.recoverSwapRemux&&(t.details===D.a.VIDEO_ERROR||t.details===D.a.VIDEO_ERROR_3))return this.Ci.i("fallback-swap-remux","run"),this.Do.stat.recoverSwapRemux=!0,this.Do.stat.box===l.i.flv&&this.Do.stat.isLive?this.Do.stat.gopRemux=!0:this.Do.streamingMuxEnabled=!1,this.Pc({type:l.k.FALLBACK,message:"video error: "+t.details+". change remux type.",fallback:O.SWAP_REMUX_TYPE})},e}(L),St=function(t){function e(){return t.apply(this,arguments)||this}u()(e,t);var i=e.prototype;return i.run=function(t){if(this.getAvailable()&&ir&&(t.details===D.a.VIDEO_ERROR||t.details===D.a.VIDEO_ERROR_3||t.details===D.a.VIDEO_ERROR_4||t.details===D.a.VIDEO_NO_SIZE)&&this.Do.stat.codecType===l.c.hevc&&this.Do.stat.decoder===l.d.buildin&&this.Do.config.wasmDecoderEnabled&&Qn.TYPE_SUPPORTED.hevc&&!E.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:l.k.FALLBACK,message:"buildin "+(Qn.isSupportHW?"hardware":"software")+" hevc dec error. video error: "+t.details+". use wasm decoder.",fallback:O.SWAP_WASM_DECODER})},i.getAvailable=function(){return!this.Uc&&!E.a.mobile},e}(L),Ot=i(34),Nt=i(12);function kt(){return document.hidden||document.webkitHidden||document.mozHidden||!0}function xt(){performance.removeEventListener&&performance.removeEventListener("resourcetimingbufferfull",Pt)}var Pt=function(){performance&&("function"==typeof performance.clearResourceTimings?performance.clearResourceTimings():"function"==typeof performance.webkitClearResourceTimings&&performance.webkitClearResourceTimings())},Mt=i(44),Ut=function(t){return t[t.NONE=0]="NONE",t[t.WAITING=1]="WAITING",t[t.SEEK=2]="SEEK",t[t.SELECT_BITRATE=3]="SELECT_BITRATE",t[t.INIT=4]="INIT",t[t.LOADING=5]="LOADING",t}({}),Bt="kernel-base",Vt=function(t){function e(e){var i;if((i=t.call(this)||this).Do=void 0,i.Ci=void 0,i.eA=void 0,i.nA=void 0,i.sA=void 0,i.Io=Ut.INIT,i.Sa=void 0,i.rA=0,i.hA=[],i.oA=void 0,i.aA=void 0,i.uA=!1,i.pa=void 0,!e.video)throw new Error("video is null");return i.Do=e,i.Ci=e.logger,i.eA=e.video,i.aA={loadedmetadata:i.cA.bind(i),loadeddata:i.fA.bind(i),canplay:i.AA.bind(i),seeking:i.vA.bind(i),seeked:i.dA.bind(i),waiting:i.lA.bind(i),playing:i.bA.bind(i),pause:i.pA.bind(i),play:i.mA.bind(i),error:i.gA.bind(i),ended:i.yA.bind(i),ratechange:i._A.bind(i),durationchange:i.CA.bind(i),timeupdate:i.IA.bind(i),progress:i.OA.bind(i),emptied:i.wA.bind(i),resize:i.EA.bind(i)},i.jA(),i}u()(e,t);var i=e.prototype;return i.destroy=function(){this.Ci.i(Bt,"destroy"),this.uA=!1,this.kA(),this.MA(),t.prototype.destroy.call(this)},i.getTrackBufInfo=function(){},i.load=function(){this.eA.load()},i.resume=function(){var t,e=this;this.eA.paused&&(null==(t=this.eA.play())||t.catch((function(t){return e.Ci.i(Bt,"resume, call play() fail.",t)})))},i.refresh=function(){},i.stopLoad=function(){},i.SA=function(){var t=this.Sa&&this.Sa.fps?this.Sa.fps:30;return this.eA.duration&&!this.eA.ended?this.eA.currentTime+1/t:-1},i.BA=function(){var t=this.Sa&&this.Sa.fps?this.Sa.fps:30;return this.eA.duration&&this.eA.currentTime-1/t>=0?this.eA.currentTime-1/t:-1},i.jA=function(){if(this.eA)for(var t in this.aA)this.eA.addEventListener(t,this.aA[t])},i.MA=function(){if(this.eA)for(var t in this.aA)this.eA.removeEventListener(t,this.aA[t])},i.cA=function(){this.Ci.i(Bt,"loadedmetadata"),this.emit(S.a.LOADEDMETADATA)},i.fA=function(){this.Ci.i(Bt,"loadeddata"),this.emit(S.a.LOADEDDATA)},i.AA=function(){this.Ci.i(Bt,"canplay "+!!this.Io),this.emit(S.a.CANPLAY)},i.vA=function(){this.Ci.i(Bt,"seeking "+this.eA.currentTime),this.emit(S.a.SEEKING)},i.dA=function(){this.Ci.i(Bt,"seeked"),this.emit(S.a.SEEKED)},i.lA=function(){this.Ci.i(Bt,"video waiting")},i.bA=function(){this.Ci.i(Bt,"playing"),this.nA||(this.Io=Ut.NONE,this.TA(),this.emit(S.a.PLAYING))},i.pA=function(){this.Ci.i(Bt,"pause. seeking: "+this.eA.seeking),this.eA.ended||this.emit(S.a.PAUSE)},i.mA=function(){this.Ci.i(Bt,"play",this.nA),this.emit(S.a.PLAY),E.a.safari&&this.eA.currentTime>=this.eA.duration&&this.eA.loop&&(this.Ci.i(Bt,"safari loop fix. seek 0. loop: "+this.eA.loop+" "+this.eA.currentTime+"/"+this.eA.duration+"."),this.eA.currentTime=0)},i.gA=function(t){this.Ci.i(Bt,"error",t)},i.yA=function(){this.Ci.i(Bt,"ended"),this.uA=!1,this.emit(S.a.ENDED),this.kA()},i._A=function(){this.Ci.i(Bt,"ratechange "+this.eA.playbackRate),this.emit(S.a.RATE_CHANGE)},i.CA=function(){this.Ci.i(Bt,"durationchange "+this.eA.duration),this.emit(S.a.DURATION_CHANGE)},i.IA=function(){this.emit(S.a.TIMEUPDATE)},i.OA=function(){this.emit(S.a.PROGRESS)},i.wA=function(){this.Ci.i(Bt,"video emptied")},i.EA=function(){this.Ci.i(Bt,"video resize")},i.DA=function(){this.emit(S.a.HEARTBEAT)},i.TA=function(){this.sA||(this.sA=setInterval(this.DA.bind(this),I.i))},i.kA=function(){this.sA&&(clearInterval(this.sA),this.sA=void 0)},i.RA=function(t){this.uA=!1},i.emit=function(t,e){if(t===S.a.ERROR){var i=e;i.fatal&&(this.nA=i),this.Ci.i(Bt,"error",i)}return this.Do.evt.emit(t,e)},i.internalSeek=function(t){this.uA=!0;try{this.eA.currentTime=t}catch(t){this.Ci.i(Bt,"internal seek err.",t)}},i.screenshot=function(t){var e=1e3*this.eA.currentTime;if(this.eA instanceof HTMLVideoElement&&this.eA.videoWidth){this.pa||(this.pa=new Mt.a(this.Ci),this.O.push(this.pa));var i=this.pa.copyImageData(this.eA,void 0,0,null==t?void 0:t.colorSpace);i&&this.emit(S.a.SCREENSHOT,{pts:e,id:null==t?void 0:t.id,image:i})}else this.emit(S.a.SCREENSHOT,{pts:e,id:null==t?void 0:t.id,errorCode:D.a.SCREENSHOT_CREATE_IMG_ERROR,errorMessage:"no video"})},o()(e,[{key:"type",get:function(){return l.a.unknown}}])}(h.a),Ft=function(){function t(t){this.Do=void 0,this.LA=0,this.Do=t,this.Do.logger.i("auto-lazyload",t.stat.autoLazyLoad,t.stat.lazyLoadMaxDuration,t.stat.lazyLoadRecoverDuration)}var e=t.prototype;return e.update=function(){var t=this.Do.lctx.current;!this.Do.stat.isLive&&this.Do.stat.autoLazyLoad&&t&&(t.maxBitrate||t.bitrate||this.Do.loadRec.currentLoad)&&(this.NA(t,8*this.Do.loadRec.smoothedDownloadSpeed/1e3),this.checkStreamingMux())},e.checkStreamingMux=function(){var t,e=this.Do,i=this.Do.stat;if(i.box===l.i.flv&&i.isLive)e.streamingMux=!0;else{var n=e.bufferedSec+((null==(t=e.mse)?void 0:t.getBufferQueueSec())||0),r=this.QA();if(i.lazyLoadRecoverDuration<=r.min+.001){var a=i.multipart?this.xA():this.VA();Number.isFinite(this.LA)&&this.LA>0?e.streamingMux=!(a&&a/this.LA*2<n):e.streamingMux=!(a&&a/2<n)}else e.streamingMux=n<i.lazyLoadRecoverDuration+(i.lazyLoadMaxDuration-i.lazyLoadRecoverDuration)/2}},e.NA=function(t,e){var i=this.Do,n=0;if(t.maxBitrate)n=e/t.maxBitrate;else if(t.bitrate)n=e/(1.5*t.bitrate);else if(i.loadRec.currentLoad){var r=i.loadRec.currentLoad.audioDataRate+i.loadRec.currentLoad.videoDataRate;if(!r)return;n=e/(1.5*r)}n/=Math.max(1,i.playbackRate),this.LA=n;var a=this.QA();n>5?this.UA(Math.max(a.min,i.stat.lazyLoadMaxDuration-2)):n<3&&this.UA(Math.min(a.max,i.stat.lazyLoadMaxDuration+2))},e.UA=function(t){this.Do.stat.lazyLoadMaxDuration=t,this.Do.stat.lazyLoadRecoverDuration=.8*this.Do.stat.lazyLoadMaxDuration},e.QA=function(){var t=16,e=30;if(this.Do.stat.multipart){var i=this.xA();i&&(t=Math.max(16,3*i),e=Math.max(30,5*i))}return{min:t,max:e}},e.VA=function(){var t=this.Do.lctx.current;if(t){var e=8*I.e/1e3,i=t.maxBitrate||1.5*t.bitrate||0;if(i)return e/i}return 0},e.xA=function(){var t=this.Do;if(t.stat.multipart){var e=t.lctx.current;if(e)return e.targetduration||e.averagetargetduration||0}return 0},o()(t,[{key:"streamingMuxThreshold",get:function(){var t=this.Do.stat;if(t.box===l.i.flv&&t.isLive)return 0;var e=this.QA();return t.lazyLoadRecoverDuration<=e.min+.001?0:t.lazyLoadRecoverDuration+(t.lazyLoadMaxDuration-t.lazyLoadRecoverDuration)/2}}])}(),jt=function(t){return t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready",t.FAIRPLAY="com.apple.fairplay",t}({}),Ht=function(t){return t.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",t}({}),Gt=!U()&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):void 0,zt="eme",Wt=function(){function t(t){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(zt,'Media is encrypted using "'+t.initDataType+'" init data type'),!e.GA&&e.ZA.length&&"cenc"===t.initDataType&&t.initData&&(e.KA=e.KA||e.Do.config.widevineLicenseUrl,e.XA(jt.WIDEVINE,e.ZA)),!e.GA)return e.Ci.i(zt,"Fatal: Media is encrypted but no CDM access or no keys have been requested"),void e.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_KEYS,"media is encrypted but no CDM access or no keys have been requested"));var i=function(i){e.Do.video&&(e.JA(i),e.qA(t.initDataType,t.initData))};e.GA.then(i).catch(i)},this.$A=function(t){var i=t.target;e.tv(t.message,i)},this.Yf=function(t,i){i.fatal&&e.zA(Object(D.e)(D.b.NETWORK_ERROR,D.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,i.errMessage,{statusCode:i.code}))},this.ev=function(){return!!(E.a.chrome&&E.a.version.major>=68||E.a.firefox||E.a.msedge&&E.a.version.major>=88)},this.zA=function(t){e.Do.evt.emit(S.a.ERROR,t)},this.Do=t,this.Ci=t.logger,t.video&&t.video.addEventListener("encrypted",this.WA),this.YA={maxRetry:t.config.keyLoadingMaxRetry,connectionTimeout:t.config.keyConnectionTimeout,transmissionTimeout:t.config.keyTransmissionTimeout,retryDelay:t.config.keyLoadingRetryDelay}}t.nv=function(t,e,i){var n={audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.5"',robustness:i.audioRobustness||""},{contentType:'audio/mp4; codecs="mp4a.40.2"',robustness:i.audioRobustness||""}],videoCapabilities:[]};return e.forEach((function(t){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:i.videoRobustness||""})})),[n]};var e=t.prototype;return e.onManifestParsed=function(t,e){var i=this;if(void 0===e&&(e=!1),this.ZA=t.map((function(t){return t.videoCodec})),e)if(t.reduce((function(t,e){return t&&(e.drmSchemaId===Ht.WIDEVINE||!e.drmSchemaId)}),!0)&&Gt&&this.ev()){this.KA=t.reduce((function(t,e){return t||e.drmToken||""}),"");var n=jt.WIDEVINE;this.Ci.i(zt,"on manifest parsed",n,this.ZA),this.XA(jt.WIDEVINE,this.ZA)}else setTimeout((function(){return i.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_UNSUPPORTED,"DRM unsupported."))}),0)},e.reset=function(){var t=this;this.Ci.i(zt,"reset"),this.PA.map((function(e){if(e.mediaKeysSession)return e.mediaKeysSession.removeEventListener("message",t.$A),e.mediaKeysSession.close().catch((function(){}))})),this.sv(),this.PA=[],this.HA=!1;try{var e,i;if(null!=(e=this.Do.video)&&e.mediaKeys)return null==(i=this.Do.video)?void 0:i.setMediaKeys(null).catch((function(e){return t.Ci.i(zt,e)}))}catch(t){}},e.destroy=function(){var t=this,e=this.Do.video;e&&e.removeEventListener("encrypted",this.WA);var i=this.PA;i.length&&Promise.all(i.map((function(e){if(e.mediaKeysSession)return e.mediaKeysSession.removeEventListener("message",t.$A),e.mediaKeysSession.close().catch((function(){}))}))).then((function(){if(e)return e.setMediaKeys(null)})).catch((function(){}))},e.JA=function(t){if(this.Ci.i(zt,"attemptSetMediaKeys",!!t),!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(zt,"Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_KEYS,"media is encrypted but no CDM access or no keys have been obtained yet"));this.Ci.i(zt,"Setting keys for encrypted media"),this.Do.video.setMediaKeys(e.mediaKeys),this.HA=!0}},e.qA=function(t,e){var i=this,n=this.PA[0];if(!n)return this.Ci.i(zt,"Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_ACCESS,"media is encrypted but not any key-system access has been obtained yet"));if(n.mediaKeysSessionInitialized)this.Ci.i(zt,"Key-Session already initialized but requested again");else{var r=n.mediaKeysSession;if(!r)return this.Ci.i(zt,"Fatal: Media is encrypted but no key-session existing"),void this.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_SESSION,"media is encrypted but no key-session existing"));if(!e)return this.Ci.i(zt,"Fatal: initData required for generating a key session is null"),void this.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_INIT_DATA,"initData required for generating a key session is null"));this.Ci.i(zt,'Generating key-session request for "'+t+'" init data type'),n.mediaKeysSessionInitialized=!0,r.generateRequest(t,e).then((function(){i.Ci.d(zt,"Key-session generation succeeded")})).catch((function(t){i.Ci.i(zt,"Error generating key-session request:",t),i.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_SESSION,"error generating key-session request:"+t,{fatal:!1}))}))}},e.XA=function(e,i){var n=this,r=t.nv(e,i,this.FA);if(this.Ci.i(zt,"Requesting encrypted media key-system access"),Gt){var a=Gt(e,r);this.GA=a.then((function(t){var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};n.PA.push(i);var r=Promise.resolve().then((function(){return t.createMediaKeys()})).then((function(t){return i.mediaKeys=t,n.PA.forEach((function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession()).addEventListener("message",n.$A,!1)})),t}));return r.catch((function(t){n.Ci.i(zt,"Failed to create media-keys:",t)})),r})),a.catch((function(t){n.Ci.i(zt,'Failed to obtain key-system "'+e+'" access:',t)}))}else this.Ci.i(zt,"no requestMediaKeySystemAccess")},e.hv=function(t){switch(t){case jt.WIDEVINE:if(!this.Do.config.widevineLicenseUrl)break;return this.Do.config.widevineLicenseUrl;case jt.PLAYREADY:if(!this.Do.config.playreadyLicenseUrl)break;return this.Do.config.playreadyLicenseUrl;case jt.FAIRPLAY:if(!this.Do.config.fairplayLicenseUrl)break;return this.Do.config.fairplayLicenseUrl}throw new Error('no license server URL configured for key-system "'+t+'"')},e.tv=function(t,e){var i=this,n=this.PA[0];if(!n)return this.Ci.i(zt,"Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.zA(Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_NO_ACCESS,"media is encrypted but no key-system access has been obtained yet"));this.sv();var r={onError:this.Yf,onEnd:function(t,n){i.sv(),n instanceof ArrayBuffer&&e.update(n)}},a=this.vf=new dt(this.Ci),o={requestMethod:"POST",requestBody:t,url:this.KA||this.hv(n.mediaKeySystemDomain),responseType:"arraybuffer"};a.load(o,r,this.YA)},e.sv=function(){this.vf&&this.vf.destroy()},o()(t,[{key:"isActive",get:function(){return!(!this.Do.video||!this.Do.video.mediaKeys)}}])}(),Kt="mse",Yt=function(){function t(t,e,i,n){var r=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=Qn.isChangeTypeSupported(),this.Iv=function(){r.Ci.i(Kt,"MediaSource onSourceOpen"),r.av&&(r.av.removeEventListener("sourceopen",r.Iv),r.Ov(),r.refresh())},this.wv=function(){r.Ci.i(Kt,"MediaSource onSourceEnded")},this.Ev=function(){r.Ci.i(Kt,"MediaSource onSourceClose"),r.Ai.emit(S.a.MSE_SOURCE_CLOSE)},this.jv=function(t){r.yc(t),r.Da&&r.kv(),r.Mv(),r.Io.mseUpdate++,r.Ai.emit(S.a.MSE_UPDATE)},this.Sv=function(t){var e=r.Bv(t.currentTarget);r.Ci.i(Kt,e+" SourceBuffer Error: ",t),r.zA(Object(D.e)(D.b.MSE_ERROR,D.a.SOURCEBUFFER_ERROR,e+" source buffer error. "+JSON.stringify(r._v)))},this.Tv=function(){r.Ci.i(Kt,"startPlayBufEnd"),r.Dv(),r.gv=0,r.refresh()},this.zA=function(t){r.Ai.emit(S.a.ERROR,t)},i.i(Kt,"constructor"),this.di=t,this.ov=e,this.Ci=i,this.Ai=n,this.fn=!1,this.An=!1,this.sourceBuffer={},this.uv={},this.mv={},this.Av=!0,this.Io={mseBufferFull:0,mseRemove:0,mseUpdate:0}}var e=t.prototype;return e.attach=function(t){var e=this;this.Ci.i(Kt,"attach",t),this.video=t;var i=vt();if(i){var n=this.av=new i;this.ov.mms="streaming"in n;var r=URL.createObjectURL(n);this.Ci.i(Kt,"attach mms:"+this.ov.mms+" src: "+r),this.video.src=r;try{this.video.load()}catch(t){}t.disableRemotePlayback=!0,this.Rv(n),this.pv=!1}else setTimeout((function(){e.zA(Object(D.e)(D.b.MSE_ERROR,D.a.MEDIASOURCE_ERROR,"MediaSource is not support"))}),0)},e.trackInfo=function(t){var e=t.tracks.audio,i=t.tracks.video;e&&e.container&&(this.uv.audio=e.container+'; codecs="'+e.codec+'"'),i&&i.codec&&!1!==i.active&&(this.uv.video=i.container+'; codecs="'+i.codec+'"'),this.An=!(!this.An&&!e),this.fn=!!(this.fn||i&&!1!==i.active),this.Ci.i(Kt,"track info. video: "+this.fn+" audio: "+this.An),this.Ov()},e.updateDuration=function(t){this.Ci.i(Kt,"update duration: "+t),this.Vn=t,this.Mv()},e.setStartBufSec=function(t){this.Ci.i(Kt,"startPlayBufSec: "+t),this.Dv(),this.gv=t,this.yv=setTimeout(this.Tv,1e3*t)},e.Mv=function(){if("number"==typeof this.Vn&&this.video&&this.av&&this.sourceBuffer&&0!==this.video.readyState&&"open"===this.av.readyState){for(var t=0,e=Object.values(this.sourceBuffer);t<e.length;t++){var i=e[t];if(i&&i.updating)return}var n=this.video.duration;if(void 0===this.lv&&(this.lv=this.av.duration),this.ov.isLive&&this.ov.liveShiftType===l.g.NONE)this.lv=this.av.duration=1/0;else if(this.Vn!==this.lv&&this.Vn!==n||!Number.isFinite(n)){var r=!0;for(var a in this.sourceBuffer)r=r&&!!this.Vn&&this.bufferedEndByType(a)<this.Vn;r&&this.Vn&&(this.lv=this.av.duration=this.Vn),this.Vn=void 0}}},e.Ov=function(){var t=(this.An?1:0)+(this.fn?1:0),e=(this.uv.audio?1:0)+(this.uv.video?1:0);if(this.Ci.v(Kt,"checkSourceBuffer",t,e,this.uv),this.av&&"open"===this.av.readyState&&t>0&&e>=t)for(var i in this.uv)this.uv[i]&&(this.Ci.i(Kt,"add sb: "+i+" "+this.uv[i]),this.Lv(i))},e.Lv=function(t){var e=this;if(this.Ci.i(Kt,"add source buffer: "+t),!this.sourceBuffer[t]&&!this.pv){try{var i=this.uv[t];if(!this.av||!i)throw new Error(t+" add source buffer. no mime codec");this.sourceBuffer[t]=this.av.addSourceBuffer(i),this._v[t]={sn:0,subSn:0,codec:i},this.mv[t]=!1}catch(e){return this.Ci.i(Kt,e),void this.zA(Object(D.e)(D.b.MSE_ERROR,D.a.ADDSOURCEBUFFER_ERROR,"type:"+t+" codec:"+this.uv[t]+" msg:"+e.message))}var n=this.sourceBuffer[t];if(n){var r=this.bv[t]={updateend:function(){e.jv(t)},error:function(t){e.Sv(t)}};n.addEventListener("error",r.error),n.addEventListener("updateend",r.updateend),this.Vn&&this.av&&this.Vn!==this.av.duration&&(this.av.duration=this.Vn)}}},e.Nv=function(){return!(!this.fv||!(this.fv.video&&this.fv.video.length||this.fv.audio&&this.fv.audio.length))},e.refresh=function(){for(var t in this.sourceBuffer)this.yc(t)},e.Qv=function(t){if(this.fv[t]&&this.fv[t].length>0){if(!this.Av)return void(this.xv()>209715200&&!this.dv&&(this.dv=!0,this.zA(Object(D.e)(D.b.MSE_ERROR,D.a.APPENDBUFFER_ERROR,"bufferfull"))));var e=this.sourceBuffer[t];if(e&&!e.updating&&!this.dv){var i=this.fv[t].shift();this.Vv(i)}}},e.mediaSegment=function(t){var e=this;t.forEach((function(t){var i=t.type;t.codec=e.uv[t.type],e.fv[i]&&e.fv[i].push(t),e.sourceBuffer[i]&&(e.pv=!0,e.yc(i))}))},e.bufferedByType=function(t){var e=this.sourceBuffer[t];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}},e.bufferedEndByType=function(t){var e=this.sourceBuffer[t];return e&&e.buffered&&e.buffered.length>0?e.buffered.end(e.buffered.length-1):0},e.bufferSliceNumByType=function(t){var e=this.sourceBuffer[t];return e?e.buffered.length:0},e.pendingSecByType=function(t){var e=this.fv[t];return e?e.reduce((function(t,e){return t+e.endDTS-e.startDTS}),0):0},e.pendingNum=function(){for(var t=0,e=0,i=Object.values(this.fv);e<i.length;e++)t+=i[e].length;return t},e.Uv=function(t){var e=this.video;if(e&&!e.seeking){var i=e.currentTime,n=this.sourceBuffer[t];if(n){var r=this.cv[t],a=n.buffered;if(a.length>=1&&i-a.start(0)>=10){var o=i-5;if(r&&r.length&&0===r[r.length-1].start&&r[r.length-1].end===o)return;r.push({start:0,end:o})}}}},e.Fv=function(t,e){try{for(var i=0;i<t.buffered.length;i++){var n=t.buffered.start(i),r=t.buffered.end(i),a=Math.max(n,e.start),o=Math.min(r,e.end);if(o>a)return this.Ci.i(Kt,"remove: "+a+" ~ "+o),t.remove(a,o),this.Io.mseRemove++,!(e.end>r&&i<t.buffered.length-1&&(e.start=Math.max(e.start,o),1));if(!(e.end>o))break;e.start=Math.max(e.start,o)}return!0}catch(e){return!(t&&t.updating)}},e.Vv=function(t){if(t&&this.sourceBuffer[t.type]&&this.video&&!this.video.error){var e=this._v[t.type],i=this.sourceBuffer[t.type];if(t.codec&&e&&t.codec!==e.codec&&(this.Ci.i(Kt,t.type+" codecType change: "+t.codec),i&&this.Cv)){this.Ci.i(Kt,t.type+" changeType: "+t.codec);try{i.changeType(t.codec),e.subSn=0}catch(e){return void this.zA(Object(D.e)(D.b.MSE_ERROR,D.a.CHANGETYPE_ERROR,"type:"+t.type+" codec:"+t.codec+" code:"+e.code+" msg:"+e.message))}}e&&(e.codec=t.codec,e.start=t.startDTS,e.end=t.endDTS,e.sn++,e.subSn++);try{i&&(t.updateTimestampOffset&&!i.buffered.length&&(i.timestampOffset=t.startPTS),i.appendBuffer(t.payload.buffer),this.mv[t.type]=!0)}catch(e){this.Ci.i(Kt,t.type,e.code,e.message),22!==e.code?(this.vv?this.vv++:this.vv=1,this.vv>this.di.appendErrorMaxRetry?(this.dv=!0,this.zA(Object(D.e)(D.b.MSE_ERROR,D.a.APPENDBUFFER_ERROR,"code:"+e.code+" type:"+t.type+" msg:"+e.message))):this.fv[t.type].unshift(t)):(this.fv[t.type].unshift(t),this.Uv(t.type),this.hasCleanUpTask(t.type)&&this.Pv(t.type),this.Ci.i(Kt,"mse bufferfull"),this.Io.mseBufferFull++,this.Ai.emit(S.a.MSE_BUFFER_FULL))}}},e.Bv=function(t){for(var e in this.sourceBuffer)if(this.sourceBuffer[e]===t)return e;return"unknown"},e.clean=function(t,e,i){this.Ci.i(Kt,"clean. st: "+t+" ed: "+e+" type: "+i);var n=0,r=Number.POSITIVE_INFINITY;for(var a in this.mv={},this.Da=!1,this.sourceBuffer)if(this.mv[a]=!1,(!i||i===a)&&this.sourceBuffer[a]){var o=this.fv[a];if(t&&o){n=Math.max(n,t);for(var s=o.length-1;s>=0;s--){var u=o[s];if(u&&u.startPTS&&!(u.startPTS>=t))break;o.pop()}}else this.fv[a]=[];e&&(r=Math.min(r,e)),this.cv[a].push({start:n,end:r}),this.Pv(a)}this.Av=!0},e.setAppendEnabled=function(t){!this.Av&&t?(this.Av=t,this.refresh()):this.Av=t},e.getAppendEnabled=function(){return this.Av},e.endOfData=function(){if(this.Ci.i(Kt,"data end."),this.Da=!0,!this.Nv()&&this.video&&this.video.buffered.length){if(E.a.firefox&&!this.ov.isLive&&void 0===this.Vn)return this.Vn=this.video.buffered.end(this.video.buffered.length-1),this.Ci.i(Kt,"data end. firefox no duration",this.Vn,this.ov.isLive),this.Mv(),void this.kv();(this.ov.isLive||!this.ov.isLive&&void 0!==this.Vn)&&(this.Ci.i(Kt,"data end. end of stream"),this.kv())}},e.ended=function(){return this.Da},e.kv=function(){var t=this.av;if(t&&"open"===t.readyState&&!this.Nv()){for(var e=0,i=Object.values(this.sourceBuffer);e<i.length;e++){var n=i[e];if(n&&n.updating)return}try{this.Ci.i(Kt,"end of stream"),t.endOfStream()}catch(t){this.Ci.i(Kt,t),this.zA(Object(D.e)(D.b.MSE_ERROR,D.a.ENDOFSTREAM_ERROR,"code:"+t.code+" msg:"+t.message))}}},e.destroy=function(){if(this.Ci.i(Kt,"destroy"),this.av){var t=this.av;if(this.kv(),"closed"!==t.readyState){for(var e in this.sourceBuffer){var i=this.sourceBuffer[e],n=this.bv[e];i&&n&&(i.removeEventListener("error",n.error),i.removeEventListener("updateend",n.updateend),t.removeSourceBuffer(i))}this.sourceBuffer={}}this.Hv(t),this.av=void 0}this.Dv(),this.fv={video:[],audio:[]},this.uv={},this.mv={},this.cv={video:[],audio:[]},this.sourceBuffer={},this.bv={}},e.hasCleanUpTask=function(t){var e=0;if(void 0===t)for(var i=0,n=Object.values(this.cv);i<n.length;i++)e+=n[i].length;else this.cv[t]&&(e=this.cv[t].length);return e>0},e.hasSourceBuffer=function(){return!!Object.keys(this.sourceBuffer).length},e.hasTrackInfo=function(){return!!Object.keys(this.uv).length},e.hasSourceBufferAppendStarted=function(){if(Object.keys(this.mv).length){for(var t=!0,e=0,i=Object.values(this.mv);e<i.length;e++){var n=i[e];t=t&&n}return t}return!1},e.xv=function(){var t=0;for(var e in this.fv)t+=this.fv[e].reduce((function(t,e){return e.payload&&e.payload.byteLength?t+e.payload.byteLength:t}),0);return t},e.getBufferQueueSec=function(t){var e=this;return this.fv?(t?[t]:Object.keys(this.fv)).reduce((function(t,i){return e.fv[i]&&e.fv[i].length>0&&(0===Object.keys(e.sourceBuffer).length||e.sourceBuffer[i])?Math.max(t,e.fv[i].reduce((function(t,e){var i=e.endDTS-e.startDTS;return i?t+i:t}),0)):t}),0):0},e.yc=function(t){if(this.hasCleanUpTask(t)&&this.Pv(t),this.gv>0){if(!this.hasTrackInfo())return;for(var e in this.sourceBuffer)if(this.pendingSecByType(e)<this.gv)return;this.Tv()}this.Qv(t)},e.Pv=function(t){for(var e=this.cv[t];e&&e.length;){var i=e[0],n=this.sourceBuffer[t];if(n&&i){if(n.updating||!this.Fv(n,i))return;e.shift()}else e.shift()}this.refresh()},e.Dv=function(){this.yv&&(clearTimeout(this.yv),this.yv=void 0)},e.Rv=function(t){t.addEventListener("sourceopen",this.Iv),t.addEventListener("sourceended",this.wv),t.addEventListener("sourceclose",this.Ev)},e.Hv=function(t){t.removeEventListener("sourceopen",this.Iv),t.removeEventListener("sourceended",this.wv),t.removeEventListener("sourceclose",this.Ev)},o()(t,[{key:"stat",get:function(){return this.Io}},{key:"readyState",get:function(){return this.av?this.av.readyState:"closed"}},{key:"trackBufInfo",get:function(){var t={};try{for(var e in this.sourceBuffer)for(var i=this.sourceBuffer[e].buffered,n=t[e]=[],r=0;r<i.length;r++)n.push({st:i.start(r),ed:i.end(r)})}catch(t){}return t}}])}(),Qt=function(){function t(t){this.Do=void 0,this.Ci=void 0,this.di=void 0,this.Yv=5e3,this.Gv=!1,this.Kv=0,this.Do=t,this.Ci=t.logger,this.di=t.stat.autoPlaybackRateConf}var e=t.prototype;return e.tick=function(){if(this.Gv&&this.Do.video&&!this.Do.video.paused){if(this.Yv>0){var t=performance.now();return this.Yv-=t-this.Kv,void(this.Kv=t)}this.Zv(this.Do.bufferedSec,this.Do.video)}},e.Zv=function(t,e){if(this.di){var i=1,n=this.di.rule,r=0;for(r=0;r<n.length&&!(e.playbackRate>=n[r].rate);r++);r>=n.length&&(r=n.length-1);var a=n[r];if(a){var o=r<n.length-1?n[r+1]:void 0,s=r>0?n[r-1]:void 0;i=a.rate,s&&t>s.lower&&(i=s.rate),o&&t<o.upper&&(i=o.rate),e.playbackRate!==i&&(this.Ci.i("playback-rate-manager","auto change playback rate from "+e.playbackRate+" to "+i),e.playbackRate=i)}}},o()(t,[{key:"enabled",get:function(){return this.Gv},set:function(t){if(t!==this.Gv)if(t){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}}])}(),Xt=i(30),Zt=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}(),qt=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,i){for(var n=0;n<i.length;++n)if(e===i[n]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var i=parseFloat(e);if(i>=0&&i<=100)return this.set(t,i),!0}return!1},t}();function Jt(t,e,i,n){var r=n?t.split(n):[t];for(var a in r)if("string"==typeof r[a]){var o=r[a].split(i);2===o.length&&e(o[0],o[1])}}var $t=typeof VTTCue>"u"?void 0:new VTTCue(0,0,""),te="middle"===(null==$t?void 0:$t.align)?"middle":"center";function ee(t,e,i){var n=t;function r(){var e=function(t){function e(t,e,i,n){return 3600*(t?parseInt(t):0)+60*(e?parseInt(e):0)+(i?parseInt(i):0)+(n?parseFloat(n):0)}var i=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?e(i[2],i[3],"0",i[4]):e(i[1],i[2],i[3],i[4]):null}(t);if(null===e)throw new Error("Malformed timestamp: "+n);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);t=t.substr(3),a(),e.endTime=r(),a(),function(t,e){var n=new qt;Jt(t,(function(t,e){var r;switch(t){case"region":for(var a=i.length-1;a>=0;a--)if(i[a].id===e){n.set(t,i[a].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":r=e.split(","),n.integer(t,r[0]),n.percent(t,r[0])&&n.set("snapToLines",!1),n.alt(t,r[0],["auto"]),2===r.length&&n.alt("lineAlign",r[1],["start",te,"end"]);break;case"position":r=e.split(","),n.percent(t,r[0]),2===r.length&&n.alt("positionAlign",r[1],["start",te,"end","line-left","line-right","auto"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start",te,"end","left","right"])}}),/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");var r=n.get("line","auto");"auto"===r&&-1===(null==$t?void 0:$t.line)&&(r=-1),e.line=r,e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100),e.align=n.get("align",te);var a=n.get("position","auto");"auto"===a&&50===(null==$t?void 0:$t.position)&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}var ie=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new Zt,this.regionList=[],this.cue=null,this.style="",this.oncue=void 0,this.onstyle=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;t&&(this.buffer+=this.decoder.decode(t,{stream:!0}));var i=function(){var t=e.buffer,i=0;for(t=t.replace(/<br(?: \/)?>/gi,"\n");i<t.length&&"\r"!==t[i]&&"\n"!==t[i];)++i;var n=t.substr(0,i);return"\r"===t[i]&&++i,"\n"===t[i]&&++i,e.buffer=t.substr(i),n};try{var n="";if("INITIAL"===this.state){if(!/\r\n|\n/.test(this.buffer))return this;var r=(n=i()).match(/^()?WEBVTT([ \t].*)?$/);if(!r||!r[0])throw new Error("Malformed WebVTT signature.");this.state="HEADER"}for(var a=!1;this.buffer;){if(!/\r\n|\n/.test(this.buffer))return this;switch(a?a=!1:n=i(),this.state){case"HEADER":/:/.test(n)?Jt(n,(function(t,e){}),/:/):n||(this.state="ID");continue;case"NOTE":n||(this.state="ID");continue;case"STYLE":n?this.style+=n:(this.style&&(this.onstyle&&this.onstyle(this.style),this.style=""),this.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){this.state="NOTE";break}if(/^STYLE($|[ \t])/.test(n)){this.state="STYLE";break}if(!n)continue;if(this.cue=new VTTCue(0,0,""),this.state="CUE",-1===n.indexOf("--\x3e")){this.cue.id=n;continue}case"CUE":if(!this.cue){this.state="BADCUE";continue}try{ee(n,this.cue,this.regionList)}catch(t){this.cue=null,this.state="BADCUE";continue}this.state="CUETEXT";continue;case"CUETEXT":var o=-1!==n.indexOf("--\x3e");if(!n||o&&(a=!0)){this.oncue&&this.cue&&this.oncue(this.cue),this.cue=null,this.state="ID";continue}if(null===this.cue)continue;this.cue.text&&(this.cue.text+="\n"),this.cue.text+=n;continue;case"BADCUE":n||(this.state="ID")}}}catch(t){"CUETEXT"===this.state&&this.cue&&this.oncue&&this.oncue(this.cue),this.cue=null,this.state="INITIAL"===this.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(t){this.onparsingerror&&this.onparsingerror(t)}return this.onflush&&this.onflush(),this},t}(),ne=i(41),re=i(20),ae=/\r\n|\n\r|\n|\r/g,oe=function(t,e,i){return void 0===i&&(i=0),t.substr(i,e.length)===e},se=function(t){for(var e=5381,i=t.length;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()};var ue="subtitle",ce=function(){function t(t){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(t,e,i){return"showing"===e.track.mode?i:t}),-1);t!==e.Wv&&(e.Wv=t,e.Ci.i(ue,"subtitle switching"),e.Do.evt.emit(S.a.SUBTITLE_TRACK_SWITCHED,{level:t}))},this.Do=t,this.Ci=t.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 e=t.prototype;return e.addTracks=function(t){var e=this;t.forEach((function(t,i){var n=e.$v();n&&e.Do.video&&(t.default?(e.Wv=i,n.mode="showing"):n.mode="hidden")}))},e.select=function(t){if(this.td(),t!==this.Wv){var e=this._[t],i=this._[this.Wv];i&&(i.track.mode="hidden"),e?(this.nd(e.style),e.track.mode="showing",this.Wv=t):this.Wv=-1,this.Do.evt.emit(S.a.SUBTITLE_TRACK_SWITCHED,{level:this.Wv})}},e.reset=function(){this.Ci.i(ue,"reset"),this._.forEach((function(t){(function(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues){for(var i=t.cues.length;i--;)t.removeCue(t.cues[i]);"disabled"===e&&(t.mode=e)}})(t.track),t.track.mode="hidden"})),this.Xv=0,this.Wv=-1,this.zv={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.td()},e.parseVTTs=function(t,e,i){var n=this,r=this._[this.Wv];r&&function(t,e,i,n,r,a,o,s){var u,c=new ie,l=Object(ne.a)(new Uint8Array(t)).trim().replace(ae,"\n").split("\n"),h=[],d=Object(re.b)(e,i),f="",p="00:00.000",_=0,v=0,A=!0,g=!1;c.onstyle=function(t){f+=t},c.oncue=function(t){var e=n[r],i=n.ccOffset,o=(_-d)/I.q;if(null!=e&&e.new&&(void 0!==v?i=n.ccOffset=e.start:function(t,e,i){var n=t[e],r=t[n.prevCC];if(!r||!r.new&&n.new)return t.ccOffset=t.presentationOffset=n.start,void(n.new=!1);for(;null!=(a=r)&&a.new;){var a;t.ccOffset+=n.start-r.start,n.new=!1,r=t[(n=r).prevCC]}t.presentationOffset=i}(n,r,o)),o&&(i=o-n.presentationOffset),g){var s=t.endTime-t.startTime,u=Object(Xt.a)((t.startTime+i-v)*I.q,a*I.q)/I.q;t.startTime=u,t.endTime=u+s}var c,l,f,p=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(p)),t.id||(t.id=(c=t.startTime,l=t.endTime,f=p,se(c.toString())+se(l.toString())+se(f))),t.endTime>0&&h.push(t)},c.onparsingerror=function(t){u=t},c.onflush=function(){u?s(u):o(h,f)},l.forEach((function(t){if(A){if(oe(t,"X-TIMESTAMP-MAP=")){A=!1,g=!0,t.substr(16).split(",").forEach((function(t){oe(t,"LOCAL:")?p=t.substr(6):oe(t,"MPEGTS:")&&(_=parseInt(t.substr(7)))}));try{v=function(t){var e=parseInt(t.substr(-3)),i=parseInt(t.substr(-6,2)),n=parseInt(t.substr(-9,2)),r=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*i,(e+=6e4*n)+36e5*r}(p)/1e3}catch(t){g=!1,u=t}return}""===t&&(A=!1)}c.parse(t+"\n")})),c.flush()}(t,i,e,this.zv,i,e,(function(t,e){t.forEach((function(t){!function(t,e){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(i){var n=new self.TextTrackCue(e.startTime,e.endTime,e.text);n.id=e.id,t.addCue(n)}"disabled"===i&&(t.mode=i)}(r.track,t)})),e&&(r.style+=e,n.nd(r.style))}),(function(t){n.Ci.i(ue,t)}))},e.destroy=function(){this.Do.video&&this.Do.video.textTracks.removeEventListener("change",this.qv),this.reset(),this._=[]},e.$v=function(){var t;if(this.Xv<this._.length)t=this._[this.Xv].track,this.Xv++;else{var e=this.Do.video;e&&(t=e.addTextTrack("subtitles"),this._.push({track:t,style:""}),this.Xv++)}return t},e.nd=function(t){t&&(this.Jv||(this.Jv=document.createElement("style"),document.head.appendChild(this.Jv)),this.Jv.innerHTML=t)},e.td=function(){this.Jv&&(this.Jv.innerHTML="",document.head.removeChild(this.Jv),this.Jv=void 0)},t}(),le=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){if(this.getAvailable()&&this.Do.stat.multipart&&this.Do.stat.coreType===l.a.mse&&t.type===D.b.NETWORK_ERROR&&t.details!==D.a.DEC_LIB_LOAD_ERROR&&t.details!==D.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED)return this.Ci.i("fallback-multipart","run"),this.Pc({type:l.k.BACKUP,message:"error. multipart use backup url.",fallback:O.USE_BACKUP_MULTIPART})},e}(L),he="LevelHelper";function de(t,e,i,n){var r=e[i],a=e[n];if(r&&a){var o=a.startPTS;Number.isFinite(o)?n>i?(r.duration=o-r.start,r.duration<0&&t.w(he,"negative duration computed for frag "+r.sn+",level "+r.level+", duration "+r.duration+", there should be some duration drift between playlist and fragment!. from")):(a.duration=r.start-o,a.duration<0&&t.w(he,"negative duration computed for frag "+a.sn+",level "+a.level+", duration "+a.duration+", there should be some duration drift between playlist and fragment!. to")):a.start=n>i?r.start+r.duration:Math.max(r.start-a.duration,0)}}function fe(t,e,i,n,r,a,o){var s=n;if(Number.isFinite(i.startPTS)){var u=Math.abs(i.startPTS-n);Number.isFinite(i.deltaPTS)?i.deltaPTS=Math.max(u,i.deltaPTS):i.deltaPTS=u,s=Math.max(n,i.startPTS),n=Math.min(n,i.startPTS),r=Math.max(r,i.endPTS),a=Math.min(a,i.startDTS),o=Math.max(o,i.endDTS)}var c=n-i.start;i.start=i.startPTS=n,i.maxStartPTS=s,i.endPTS=r,i.startDTS=a,i.endDTS=o;var l=i.duration;i.duration=r-n,t.i(he,"update frag duration: "+l+" -> "+i.duration);var h,d=i.sn;if(!e||"number"!=typeof d||d<e.startSN||d>e.endSN)return 0;var f=d-e.startSN,p=e.fragments;for(p[f]=i,h=f;h>0;h--)de(t,p,h,h-1);for(h=f;h<p.length-1;h++)de(t,p,h,h+1);return e.ptsKnown=!0,c}function pe(t,e,i){for(var n=i;n<e.fragments.length-1;n++)de(t,e.fragments,n,n+1)}function _e(t,e,i,n){void 0===n&&(n=l.g.NONE);var r=n!==l.g.NONE,a=e.fragments.length-1;i.partOfData||function(t,e,i){i.initSegment&&e.initSegment&&(i.initSegment=e.initSegment);var n,r=0;if(function(t,e,i){if(t&&e)for(var n=Math.max(t.startSN,e.startSN)-e.startSN,r=Math.min(t.endSN,e.endSN)-e.startSN,a=e.startSN-t.startSN,o=n;o<=r;o++){var s=t.fragments[a+o],u=e.fragments[o];if(!s||!u)break;i(s,u,o)}}(e,i,(function(t,e){r=t.cc-e.cc,Number.isFinite(t.startPTS)&&(e.start=e.startPTS=t.startPTS,e.endPTS=t.endPTS,e.duration=t.duration,e.dropped=t.dropped,n=e),i.ptsKnown=!0})),i.ptsKnown){if(r){t.v(he,"discontinuity sliding from playlist, take drift into account");for(var a=i.fragments,o=0;o<a.length;o++)a[o].cc+=r}n?fe(t,i,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):function(t,e){var i=e.startSN-t.startSN,n=t.fragments,r=e.fragments;if(!(i<0||i>n.length))for(var a=0;a<r.length;a++)r[a].start+=n[i].start}(e,i),i.ptsKnown=e.ptsKnown}}(t,e,i),e.mergeFrom(i,r),n===l.g.KWAI2&&a>0&&pe(t,e,a)}function ve(t,e,i){var n=1e3*(e.averagetargetduration?e.averagetargetduration:e.targetduration),r=n/2;return t&&e.endSN===t.endSN&&(n=r),i&&(n=Math.max(r,n-(performance.now()-i))),Math.round(n)}function Ae(t){return!t.drmSchemaId||t.drmSchemaId===Ht.WIDEVINE}function ge(t,e,i,n,r){void 0===i&&(i=3),e=Math.round(e),!n||n.startDelay===e||e<=0||(n.startDelay="number"==typeof r?r:e,n.rule=[{rate:1.5,lower:e+2*i+1,upper:Number.MAX_SAFE_INTEGER},{rate:1.25,lower:e+i+1,upper:e+2*i},{rate:1.1,lower:e+1,upper:e+i},{rate:1,lower:0,upper:e}],t.i("playback-rate","update auto playbackRate delay: "+e+", step: "+i+" startDelay: "+r,JSON.stringify(n)))}var me=i(11),be=/\.[^./\\?#]+(?=$|[?#])/i,ye=/\.slice($|\?)/i,Ee={".mp4":l.i.mp4,".m4s":l.i.mp4,".mov":l.i.mp4,".m4a":l.i.mp4,".flv":l.i.flv,".m3u8":l.i.hls,".sdp":l.i.webrtc,".webm":l.i.matroska,".mkv":l.i.matroska,".mka":l.i.matroska,".mp3":l.i.mp3,".wav":l.i.wav,".aac":l.i.aac,".ts":l.i.ts,".yuv":l.i.yuv,".slice":l.i.flv};function Ce(t){var e=t.toLocaleLowerCase().match(be);return e?e[0]:""}function Te(t){var e=Ce(t);return e&&Ee[e]||l.i.unknown}function Ie(t){return ye.test(t)}var Re=/^[^_][A-Za-z0-9_-]*$/,we=/_([A-Za-z0-9]+)_/;function Le(t){var e=new ct.a(t).pathname,i=Te(t),n=i===l.i.flv||y(i)||i===l.i.ts,r="",a="",o=e.split("/"),s=o[o.length-1]||"";if(n){try{var u=e.lastIndexOf("/");u>=0&&(e=e.slice(u+1));var c=e.split(".")[0].split("_");1===c.length?(r=Oe(c[0]),a=Se(t)):2===c.length?(r=Oe(c[0]),a=Oe(c[1])):c.length>2&&(r=Oe(c.slice(0,c.length-1).join("_")),a=Oe(c[c.length-1]))}catch(t){}return{streamID:r,transcodingTpl:a,filename:s}}return{streamID:"",transcodingTpl:Se(t),filename:s}}var De,Se=function(t){var e=t.match(we),i="";return null!=e&&e.length&&e.length>1&&(i=e[1]),Oe(i)},Oe=function(t){return Re.test(t)?t:""},Ne=function(t){return t.FAIL="FAIL",t.ABORT="ABORT",t.SUCCESS="SUCCESS",t.CONNECTED="CONNECTED",t}({}),ke=((De={})[me.c.MANIFEST]=D.a.MANIFEST_LOAD_ERROR,De[me.c.LEVEL]=D.a.LEVEL_LOAD_ERROR,De[me.c.AUDIO_TRACK]=D.a.AUDIO_TRACK_LOAD_ERROR,De[me.c.SUBTITLE_TRACK]=D.a.SUBTITLE_TRACK_LOAD_ERROR,De);function xe(t,e,i,n,r){var a="string"==typeof e.url?e.url:"",o=new ct.a(a).host,s={domain:o,stream_host:o,download_url:a,download_start_time:i.tsload,download_spend_time:i.tload?Math.round(i.tload-i.tstart):Math.round(performance.now()-i.tstart),http_response_time:i.tfirst?Math.round(i.tfirst-i.tstart):0,download_status:t,http_status_code:i.code,retry_index:i.retry,error_code:0,error_message:"",loader_id:i.id,download_size:i.total||i.loaded||0,resource_type:e.type||"",use_reset_native_fetch:e.useResetNativeFetch?1:0};e.redirected&&(s.redirect=1),e.responseUrl&&a!==e.responseUrl&&(s.response_url=e.responseUrl),r&&(s.codec=r),n&&(s.quality_type=n),e.monkeyPatched&&(s.monkey_patched=1);var u=e.frag;if(u&&(s.slice_play_start_time=Math.round(1e3*u.start),u.duration&&(s.slice_play_duration=Math.round(1e3*u.duration)),u.sn&&(s.slice_index=u.sn),u.level&&(s.slice_level_index=u.level)),t===Ne.FAIL){var c=ke[e.type]||D.a.LOAD_ERROR;s.error_code=Object(D.d)(c,i.errMessage,i.code)}i.errMessage&&(s.error_message=i.errMessage),e.responseHeader&&(s.response_header=_(e.responseHeader)),"number"==typeof e.rangeStart&&(s.range_start=e.rangeStart),e.rangeEnd&&(s.range_end=e.rangeEnd);var l=Le(s.download_url);if(l.transcodingTpl&&(s.transcoding_template=l.transcodingTpl),"string"==typeof e.url){var h=function(t){if(performance&&"function"==typeof performance.getEntriesByName){var e=performance.getEntriesByName(t,"resource");if(e.length){var i=e[e.length-1],n={};return i.redirectStart&&(n.redirect=Math.round(i.redirectEnd-i.redirectStart)),n.dns=Math.round(i.domainLookupEnd-i.domainLookupStart),n.tcp=Math.round(i.connectEnd-i.connectStart),n.request=Math.round(i.requestStart-i.connectEnd),n.firstResponse=Math.round(i.responseStart-i.requestStart),i.responseStart>0?n.response=Math.round(i.responseEnd-i.responseStart):n.response=Math.round(i.responseEnd-i.fetchStart),n.duration=Math.round(i.duration)||0,n}}return null}(e.url);h&&(h.redirect&&(s.time_redirect=h.redirect),h.dns&&(s.time_dns=h.dns),h.tcp&&(s.time_tcp=h.tcp),h.request&&(s.time_request=h.request),h.firstResponse&&(s.time_first_response=h.firstResponse),h.response&&(s.time_response=h.response),h.duration&&(s.duration=h.duration))}return s}var Pe={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},Me=function(t){return t[t.Default=0]="Default",t[t.Seek=1]="Seek",t}(Me||{}),Ue="kwai_hls_adaptive",Be="algorithm-hls",Ve=function(){function t(t){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=Me.Default,this.vd=0,this.dd=!1,this.ld=0,this.bd=0,this.pd=0,this.md=0,this.ud=new it,this.Fi=r()({},Pe),this.Do=t,this.Ci=t.logger}var e=t.prototype;return e.init=function(t){var e=r()({},Pe);this.Fi=r()(e,t),this.md=this.Fi.initBitrate},e.onManifestUpdated=function(){var t=this,e=this.Do.lctx;this.md=this.Fi.initBitrate,this.od=[],e.abrLevels.forEach((function(e){t.od.push(1e3*e.bitrate),e.default&&(t.md=e.bitrate)})),this.Ct=Math.min(e.abrDefault,this.od.length-1),this.Ci.i(Be,"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=Me.Default,this.ld=this.gd(this.od,this.Fi.lowProfileBitrate)},e.destroy=function(){},e.bitrateInit=function(){var t=this,e=this.yd(this.od,this.md),i=this.ud.read(Ue);if(this.Ci.i(Be,"storage read:"+i),void 0!==i&&i.bitrate>=0&&i.speed>0&&2===i.version){i.time&&i.lowProfile&&Date.now()-i.time<2592e5&&(this.bd=Math.min(i.lowProfile,this.Fi.lowProfileStartThreshold+1),this.bd>this.Fi.lowProfileStartThreshold&&(this.dd=!0,e=Math.min(e,this.ld)));var n=Math.min(i.bitrate,1024*i.speed/this.Fi.speedPredictRatioOnStart),r=this.od.reduce((function(e,i,r){return Math.abs(i-n)<Math.abs(t.od[e]-n)?r:e}),0);e=this.Fi.startBitrateLimit?Math.min(e,r):r}return e},e.onLevelLoad=function(t){t<this.od.length&&t>=0&&(this.Ct=t)},e.onKeyPoint=function(t){if(t.byteLength){var e=t.duration||t.spendTime,i=t.byteLength/e*7.8125;this.ad=r()({cache:!1},t),this.Ci.v(Be,"report download time:"+e+" bytes:"+t.byteLength+" buffered:"+t.buffered+" speed:"+i+" cache:"+this.ad.cache);var n=this._d(i,t.buffered/1e3),a=this.od[n];a&&n!==this.fd&&this.ud.write(Ue,{version:2,index:n,bitrate:a,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=n,this.ad.speed=i,this.ad.buffered=t.buffered,this.ad.nextBitrate=this.od[this.fd],this.ad.currentBitrate=this.od[this.Ct]}},e.onSeek=function(t){this.Ci.v(Be,"report seek buffered:"+t.buffered+" inBuffer:"+t.isInBuffer),t.isInBuffer?this.Cd():this.ad.seek=1,(!t.isInBuffer||t.buffered/1e3<this.Fi.targetBuffer)&&(this.Ci.i(Be,"status change to seek."),this.Ad=Me.Seek,this.vd=this.Fi.speedPredictNum)},e.onDownloadEnabled=function(t){t||this.Cd()},e.Cd=function(){this.sd=0,this.rd=0,this.hd=new Array(this.Fi.slidingWindowSize)},e._d=function(t,e){this.sd=e,this.hd.shift(),this.hd.push(t),this.Ad===Me.Seek&&(e>=this.Fi.targetBuffer||this.vd<=0)&&(this.vd=0,this.Ad=Me.Default,this.Ci.i(Be,"status change to default. buffered:"+e+" step:"+this.vd));var i=-1;return this.Ad===Me.Seek?(this.vd--,this.rd=this.sd,i=this.Id(t)):i=this.Od(t,e),this.dd&&(i=Math.min(i,this.ld)),i},e.Id=function(t){var e=1024*t,i=this.od[this.Ct];if(i&&(e<i||e>i*this.Fi.speedPredictRatio))for(var n=this.od.length-1;n>=0;n--){var r=this.od[n];if(r&&e>r*this.Fi.speedPredictRatio)return n}return this.Ct},e.Od=function(t,e){var i,n=1024*t,r=this.od,a=r[this.Ct],o=this.Do.playbackRate;for(i=r.length-1;i>0;i--){var s=r[i];if(s&&n>s*o)break}var u=r[i],c=this.Ct;if("number"!=typeof u||"number"!=typeof a)return c;var l=e/o;return u>a?l>u*this.Fi.duration/n&&(c=i):u<a&&l<a*this.Fi.duration/n+this.Fi.duration&&(c=i),this.Ci.v(Be,"_nextRateBySpeedAndBuffered bitrateBySpeed:"+u+", nextBitrate:"+c+", bitrate:"+a+", remainingTime:"+l+", speed:"+n+", playbackRate:"+o),c},e.yd=function(t,e){return t.reduce((function(i,n,r){return(t[i]+n)/2>=e?i:r}),0)},e.gd=function(t,e){return t.reduce((function(t,i,n){return i>e?t:n}),0)},o()(t,[{key:"nextLevel",get:function(){return this.fd}},{key:"lowProfile",get:function(){return this.dd}}])}(),Fe={speedPredictRatioOnStart:6},je=function(){function t(t){this.Do=void 0,this.wd=void 0,this.Ed=void 0,this.jd=0,this.Ct=0,this.Do=t,this.Ed=0}var e=t.prototype;return e.init=function(){return this.wd=new Ve(this.Do),this.wd.init(this.Do.config.hlsAdaptiveConfig||Fe),this.wd.onManifestUpdated(),this.wd.bitrateInit()},e.onAbrLevelsUpdated=function(){var t;null==(t=this.wd)||t.onManifestUpdated()},e.destory=function(){this.wd&&(this.wd=void 0)},e.onDownload=function(t){if(this.wd&&this.Do.isAbrAvailable&&"number"==typeof t.slice_play_start_time&&"number"==typeof t.slice_play_duration&&Number.isFinite(t.slice_play_start_time)&&Number.isFinite(t.slice_play_duration)&&t.download_status===Ne.SUCCESS){this.Ed=t.slice_play_start_time+t.slice_play_duration;var e={buffered:this.Ed-1e3*this.Do.currentTime,duration:t.duration||0,spendTime:t.download_spend_time,byteLength:t.download_size};this.wd.onKeyPoint(e)}},e.onNewSource=function(){if(this.wd){var t=this.Do.lctx.currentIdx;this.jd=this.jd||performance.now(),t>=0&&t<this.Do.lctx.levels.length&&(this.Ct=t),this.wd.onLevelLoad(this.Do.lctx.orignIndexToAbr(t))}},e.onSeek=function(t){this.wd&&this.Do.isAbrAvailable&&this.wd.onSeek({isInBuffer:t.isInBuffer,buffered:this.Ed-1e3*this.Do.currentTime})},e.nextBitrateIndex=function(){var t=this.Do.lctx;if(t.abr&&this.wd){var e=t.abrIndexToOrign(this.wd.nextLevel);if(e!==this.Ct&&e>=0&&e<t.levels.length)return e}return this.Ct},e.setDownloadEnabled=function(t){this.wd&&this.wd.onDownloadEnabled(t)},o()(t,[{key:"abrInitLevel",get:function(){var t;return(null==(t=this.wd)?void 0:t.bitrateInit())||0}}])}(),He=function(){function t(t){var e=this;this.Do=void 0,this.kd=function(){e.Do.evt.emit(S.a.MANIFEST_LOADED)},this.Do=t}var e=t.prototype;return e.loadManifest=function(){this.kd()},e.loadLevel=function(){},e.destroy=function(){},t}(),Ge=i(29),ze={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 We(t){var e={};return(t||"").split(/[ ,]+/).forEach((function(t){0!==t.indexOf("avc1")&&0!==t.indexOf("hev1")&&0!==t.indexOf("av01")&&0!==t.indexOf("kvc")||(e.video=t),0===t.indexOf("mp4a")&&(e.audio=t)})),e}function Ke(t,e){var i=[].concat(t.split(/[ ,]+/));["video","audio"].forEach((function(t){var n=i.filter((function(e){return i=e,!!(n=ze[t])&&!0===n[i.slice(0,4)];var i,n}));if(n.length){var r=n.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("av01",0)||0===t.lastIndexOf("hev1",0)||0===t.lastIndexOf("hvc1",0)||0===t.lastIndexOf("mp4a",0)}));e[t+"Codec"]=r.length>0?r[0]:n[0],i=i.filter((function(t){return-1===n.indexOf(t)}))}})),e.codec=i.join(",")}function Ye(t){return 0===t.indexOf("avc1")?l.c.h264:0===t.indexOf("hev1")||0===t.indexOf("hvc1")?l.c.hevc:0===t.indexOf("av01")?l.c.av1:l.c.unknown}var Qe=function(){function t(t){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=l.c.unknown,this.meta=void 0,this.fileName=void 0,this.fileSize=void 0,this.dropVideo=[],this.url=[t],this.urlId=0}return t.prototype.getKLevel=function(){return{width:this.width,height:this.height,qualityLabel:this.qualityLabel,qualityType:this.qualityType,bitrate:this.bitrate,maxBitrate:this.maxBitrate}},o()(t,[{key:"currentUrl",get:function(){return this.url[this.urlId]||""}}])}(),Xe=function(t){function e(e){var i;return(i=t.call(this,e)||this).startSN=0,i.endSN=0,i.fragments=[],i.initSegment=null,i.live=!0,i.needSidxRanges=!1,i.startTimeOffset=null,i.targetduration=0,i.totalduration=0,i.type=null,i.version=null,i.ptsKnown=!1,i.m3u8Slice=void 0,i.audioGroupIds=void 0,i.attrs=void 0,i.averagetargetduration=void 0,i.name=void 0,i.lang=void 0,i.groupId="",i.instreamId="",i.autoselect=void 0,i.forced=void 0,i.size=0,i.partOfData=!1,i.http416=0,i}u()(e,t);var i=e.prototype;return i.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},i.mergeFrom=function(t,e){if(void 0===e&&(e=!1),t.fragments.length){var i=this.endSN;if(this.endSN=t.endSN,t.partOfData||(t.initSegment&&!this.initSegment&&(this.initSegment=t.initSegment),this.live=t.live,this.needSidxRanges=t.needSidxRanges,this.targetduration=t.targetduration,this.ptsKnown=t.ptsKnown,this.averagetargetduration=t.averagetargetduration,this.hasFrag||(this.m3u8Slice=t.m3u8Slice,this.audioGroupIds=t.audioGroupIds,this.attrs=t.attrs,this.name=t.name,this.lang=t.lang,this.groupId=t.groupId,this.instreamId=t.instreamId,this.autoselect=t.autoselect,this.forced=t.forced)),e&&this.fragments.length){for(var n,r=t.fragments.length,a=0;a<t.fragments.length;a++){var o=t.fragments[a].sn;if("number"==typeof o&&o>i){r=a;break}}if(this.fragments.length&&t.fragments.splice(0,r),t.partOfData){var s=this.fragments[this.fragments.length-1],u=s.endPTS,c=s.cc;u&&t.fragments.forEach((function(t){t.start=t.startPTS=u,t.endPTS=t.startPTS+t.duration,u=t.endPTS,t.cc=c+t.cc}))}(n=this.fragments).push.apply(n,t.fragments),this.totalduration=this.fragments.reduce((function(t,e){return t+e.duration}),0),t.partOfData?this.size+=t.size:this.size=t.size}else this.startSN=t.startSN,this.fragments=t.fragments,this.totalduration=t.totalduration,this.size=t.size}},i.getTimeInfoAfter=function(t){void 0===t&&(t=0);var e,i,n=[],r=[];return this.fragments.forEach((function(a){"number"==typeof a.sn&&(a.sn>=t&&"number"==typeof i&&i!==a.cc&&(e?e.push({sn:a.sn,start:a.start}):e=[{sn:a.sn,start:a.start}]),i=a.cc,a.sn>=t&&(n.push(a.start),"number"==typeof a.programDateTime&&r.push(a.programDateTime)))})),{live:this.live,startSn:this.startSN,endSn:this.endSN,duration:this.totalduration,times:n,utcs:r,discontinuity:e,targetduration:this.targetduration}},o()(e,[{key:"timeInfo",get:function(){return this.getTimeInfoAfter()}},{key:"hasProgramDateTime",get:function(){return!(!this.fragments[0]||"number"!=typeof this.fragments[0].programDateTime||!Number.isFinite(this.fragments[0].programDateTime))}},{key:"hasFrag",get:function(){return this.fragments.length>0}}])}(Qe),Ze=function(){function t(){}return t.verify=function(t){return!!(t&&t.adaptationSet&&t.adaptationSet.representation&&t.adaptationSet.representation.length)&&t.adaptationSet.representation.reduce((function(t,e){return!!(e.url&&e.bandwidth&&t)}),!0)},t.parse=function(e){var i=[];return t.verify(e)&&e.adaptationSet.representation.forEach((function(t){if(t&&(t.url||t.m3u8)){var e=new Xe(t.baseUrl?Object(Ge.buildAbsoluteURL)(t.baseUrl,t.url,{alwaysNormalize:!0}):t.url);e.bitrate=Math.floor(t.bandwidth/1e3),e.maxBitrate=Math.floor(t.bandwidth/1e3),e.qualityType=t.qualityType||"",e.qualityLabel=t.qualityLabel||"",t.width&&t.height&&(e.width=t.width,e.height=t.height),Ke(t.codecs||"",e),e.audioCodec="",e.m3u8Slice=t.m3u8||t.m3u8Slice,e.totalduration=t.duration,t.backupUrl&&t.backupUrl.length&&(e.url=e.url.concat(t.backupUrl)),e.default=t.defaultSelect||!1,e.urlId=0,i.push(e)}})),{levels:i,def:0}},t}(),qe=o()((function(t,e){this.Md=null,this.baseuri=void 0,this.reluri=void 0,this.method=null,this.key=null,this.iv=void 0,this.baseuri=t,this.reluri=e}),[{key:"uri",get:function(){return!this.Md&&this.reluri&&(this.Md=Object(Ge.buildAbsoluteURL)(this.baseuri,this.reluri,{alwaysNormalize:!0})),this.Md}}]),Je=function(t){return t.AUDIO="audio",t.VIDEO="video",t}({}),$e=function(){function t(){var t;this.Sd="",this.Bd=null,this.Mh=null,this.Td=((t={})[Je.AUDIO]=!1,t[Je.VIDEO]=!1,t),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 e=t.prototype;return e.setByteRange=function(t,e){var i=t.split("@",2),n=[];1===i.length?n[0]=e?e.byteRangeEndOffset:0:n[0]=parseInt(i[1],10),n[1]=parseInt(i[0],10)+n[0],this.Bd=n},e.addElementaryStream=function(t){this.Td[t]=!0},e.hasElementaryStream=function(t){return!0===this.Td[t]},e.createInitializationVector=function(t){for(var e=new Uint8Array(16),i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e},e.setDecryptDataFromLevelKey=function(t,e){var i=t;return t&&t.method&&t.uri&&!t.iv&&((i=new qe(t.baseuri,t.reluri)).method=t.method,i.iv=this.createInitializationVector(e)),i},o()(t,[{key:"url",get:function(){return!this.Sd&&this.relurl&&(this.Sd=Object(Ge.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this.Sd},set:function(t){this.Sd=t}},{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 t=this.sn;"number"!=typeof t&&(t=0),this.Mh=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this.Mh}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime||!Number.isFinite(this.programDateTime))return null;var t=Number.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)}}])}(),ti=function(t){return t[t.LongVideo=1]="LongVideo",t[t.ShortVideo=2]="ShortVideo",t[t.LiveGame=3]="LiveGame",t[t.LiveShow=4]="LiveShow",t[t.LivePlayBack=5]="LivePlayBack",t}({}),ei={1:l.i.hls_ts,2:l.i.mp4,3:l.i.flv,4:l.i.hls_fmp4},ii={avc:l.c.h264,hevc:l.c.hevc,av1:l.c.av1,kvc3:l.c.kvc3,kvc4:l.c.kvc4,kvc5:l.c.kvc5,kvc6:l.c.kvc6,kvc30:l.c.kvc30};function ni(t){var e=l.i.unknown;if(t&&t.length<2048)for(var i=t.split("\n"),n=0;n<i.length;n++){var r=i[n].trim();r&&0!==r.indexOf("#")&&(e=Te(r))}return e===l.i.ts?l.i.hls_ts:e===l.i.mp4?l.i.hls_fmp4:l.i.unknown}var ri=function(){function t(){}return t.verify=function(t){return!!(t&&t.adaptationSet&&t.adaptationSet.length)&&t.adaptationSet.reduce((function(t,e){return!!(t&&e.representation&&e.representation.length)}),!0)},t.parse=function(e,i){void 0===i&&(i=!1);var n,r,a,o,s,u,c,h,d,f=[],p=!1,_=0,v=[],A={};if(t.verify(e)){var g=e;u=ei[g.mediaType],c=1===g.stereoType?l.n.V360:l.n.Normal,void 0!==g.businessType&&(h=g.businessType>=3&&g.businessType<=5),g.businessType===ti.LivePlayBack&&(d=!0),g.version&&(A.version=g.version),g.videoId&&(A.videoId=g.videoId),g.videoBaseFeature&&(A.videoBaseFeature=g.videoBaseFeature),g.videoAestheticFeature&&(A.videoAestheticFeature=g.videoAestheticFeature),g.videoFeature&&(A.videoFeature=g.videoFeature),"number"==typeof g.programStartTime&&(A.programStartTime=g.programStartTime),g.adaptationSet.forEach((function(t){var e=t.duration/1e3;void 0===h&&e&&(h=!1),!_&&e&&(_=e);var i=t.drmSchemaId,c=t.drmToken;t.drmSchemaId&&(p=!0);var d=l.f.MAIN;if(t.mimeType&&(-1!==t.mimeType.indexOf("video")?A.videoMimeType=t.mimeType:-1!==t.mimeType.indexOf("audio")?(A.audioMimeType=t.mimeType,d=l.f.AUDIO):"text/vtt"===t.mimeType?(A.subtitleMimeType=t.mimeType,d=l.f.SUBTITLE):d=void 0),d){d===l.f.MAIN?A.videoDuration=t.duration:d===l.f.AUDIO&&(A.audioDuration=t.duration);var m=t.representation.map((function(n,r){var h;if(!u&&n.m3u8Slice&&(u=ni(n.m3u8Slice)),u||(u=Te(n.url)),y(u)?((h=new Xe(n.url)).lang=t.language||"",h.default=!!n.defaultSelect,h.id=n.id||r,h.m3u8Slice=n.m3u8Slice,h.totalduration=e||_):h=new Qe(n.url),"number"==typeof n.fileSize&&(h.fileSize=n.fileSize),h.vCodecType=l.c.unknown,h.hdr=n.hdrType||0,h.maxBitrate=n.maxBitrate||0,h.bitrate=n.avgBitrate||h.maxBitrate,h.qualityType=n.qualityType||"",h.qualityLabel=n.qualityLabel||"",h.codec=n.codecs||"",h.codec){var f=We(h.codec);h.videoCodec=f.video||"",h.vCodecType=Ye(h.videoCodec)}return n.videoCodec&&ii[n.videoCodec]&&(h.vCodecType=ii[n.videoCodec]||l.c.unknown),v.push(h.vCodecType),1===g.adaptationSet.length&&(h.audioCodec=""),n.width&&n.height&&(h.width=n.width,h.height=n.height),h.hidden=n.hidden||!1,h.enableAdaptive=void 0===n.disableAdaptive||!n.disableAdaptive,h.default=n.defaultSelect||!1,h.index=r,h.drmSchemaId=n.drmSchemaId||i,h.drmToken=n.drmToken||c,h.drmSchemaId&&(p=!0),n.backupUrl&&n.backupUrl.length&&(h.url=h.url.concat(n.backupUrl)),h.urlId=0,h.default&&void 0===a&&(d===l.f.MAIN?a=r:d===l.f.AUDIO?o=r:d===l.f.SUBTITLE&&(s=r)),(n.comment||n.kvqScore)&&(h.meta={comment:n.comment,kvqScore:n.kvqScore}),h}));d===l.f.MAIN?f=f.concat(m):d===l.f.AUDIO?(n||(n=[]),n=n.concat(m)):d===l.f.SUBTITLE&&(r||(r=[]),r=r.concat(m))}}))}if(r&&t.processingSubtitleType(r,_),i)return[{codecType:1===v.length?v[0]:l.c.unknown,mediaLevels:{levels:f,def:a||0,audioTracks:n,defAudio:o||0,subtitleTracks:r,defSubtitle:s||0,drm:p,box:u,stereoType:c,isLive:h,meta:A}}];var m={};f.forEach((function(t){var e=m[t.vCodecType];e||(m[t.vCodecType]=e={def:0,levels:[]}),t.default&&(e.def=e.levels.length),e.levels.push(t)}));var b=Object.keys(m).length,E=[];for(var C in m){var T=m[C];if(T){var I=T.levels[0];if(b>1&&I&&I.m3u8Slice){var R=ni(I.m3u8Slice);y(R)&&(u=R)}E.push({codecType:C,mediaLevels:{levels:T.levels,def:T.def,audioTracks:n,defAudio:o||0,subtitleTracks:r,defSubtitle:s||0,drm:p,box:u,stereoType:c,isLive:h,isLiveShift:d,meta:A}})}}return E},t.processingSubtitleType=function(t,e){t.forEach((function(t,i){if(Te(t.currentUrl)===l.i.hls){t.live=!1,t.index=i,t.totalduration=e,t.targetduration=e,t.endSN=1;var n=new $e;n.type=l.f.SUBTITLE,n.start=0,n.sn=1,n.level=i,n.cc=0,n.url=t.currentUrl,n.duration=e,t.fragments=[n]}}))},t.getAdaptationIdxByType=function(t,e){for(var i=0;i<t.adaptationSet.length;i++){var n=t.adaptationSet[i];if(n){var r;if(void 0===n.mimeType)return"video"===e?0:-1;if(0===(null==(r=n.mimeType)?void 0:r.indexOf(e)))return i}}return-1},t}(),ai=/^(\d+)x(\d+)$/,oi=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,si=function(){function t(e){for(var i in"string"==typeof e&&(e=t.parseAttrList(e)),e)Object.prototype.hasOwnProperty.call(e,i)&&(this[i]=e[i])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),n=0;n<e.length/2;n++)i[n]=parseInt(e.slice(2*n,2*n+2),16);return i}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var i=this[t];return i?parseFloat(i):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=ai.exec(this[t]);if(e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,i={};for(oi.lastIndex=0;null!==(e=oi.exec(t));){var n=e[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),i[e[1]]=n}return i},t}(),ui=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,ci=/#EXT-X-MEDIA:(.*)/g,li=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),hi=/(?:(?:#(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?/,di=/\.(mp4|m4s|m4v|m4a)$/i,fi="m3u8-parser";function pi(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime)||parseInt(t.rawProgramDateTime):e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),"number"==typeof t.programDateTime&&Number.isFinite(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}var _i=function(){function t(){}return t.Dd=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];if(n.id===e)return n}},t.Rd=function(t){var e,i=t.split(".");return i.length>2?(e=i.shift()+".",e+=parseInt(i.shift(),10).toString(16),e+=("000"+parseInt(i.shift(),10).toString(16)).substr(-4)):e=t,e},t.Ld=function(t,e){return Object(Ge.buildAbsoluteURL)(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,i){var n,r=[];for(ui.lastIndex=0;null!==(n=ui.exec(e));){var a=new Xe(t.Ld(n[2],i)),o=a.attrs=new si(n[1]),s=o.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.maxBitrate=o.decimalInteger("BANDWIDTH")/1e3;var u=o.decimalInteger("AVERAGE-BANDWIDTH")/1e3;a.bitrate=u||a.maxBitrate,a.name=o.NAME,Ke(o.CODECS||"",a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.vCodecType=Ye(a.videoCodec),a.videoCodec=t.Rd(a.videoCodec)),r.push(a)}return r},t.parseMasterPlaylistMedia=function(e,i,n,r){var a;void 0===r&&(r=[]);var o=[],s=0;for(ci.lastIndex=0;null!==(a=ci.exec(e));){var u=new si(a[1]);if(u.TYPE===n){var c=new Xe(u.URI?t.Ld(u.URI,i):"");if(c.attrs=u,c.index=c.id=s++,c.groupId=u["GROUP-ID"]||"",c.instreamId=u["INSTREAM-ID"]||"",c.name=u.NAME||u.LANGUAGE,c.type=n,c.default="YES"===u.DEFAULT,c.autoselect="YES"===u.AUTOSELECT,c.forced="YES"===u.FORCED,c.lang=u.LANGUAGE||"",r.length){var l=t.Dd(r,c.groupId);c.audioCodec=l?l.codec:r[0].codec}o.push(c)}}return o},t.parseLevelPlaylist=function(t,e,i,n,r,a,o){void 0===r&&(r=l.f.MAIN),void 0===a&&(a=0),void 0===o&&(o=0);var s,u,c,h=o,d=0,f=0,p=null,_=new $e,v=null,A=new Xe(i);for(li.lastIndex=0;null!==(u=li.exec(e));){var g=u[1];if(g){_.duration=parseFloat(g);var m=(" "+u[2]).slice(1);_.title=m||null,_.tagList.push(m?["INF",g,m]:["INF",g])}else if(u[3]){if(Number.isFinite(_.duration)){var b=h++;_.type=r,_.start=d,_.levelkey=s,_.sn=b,_.level=n,_.cc=f,_.urlId=a,_.baseurl=i,_.relurl=(" "+u[3]).slice(1),pi(_,p),A.fragments.push(_),p=_,d+=_.duration,_=new $e}}else if(u[4]){var y=(" "+u[4]).slice(1);p?_.setByteRange(y,p):_.setByteRange(y)}else if(u[5])_.rawProgramDateTime=(" "+u[5]).slice(1),_.tagList.push(["PROGRAM-DATE-TIME",_.rawProgramDateTime]),null===v&&(v=A.fragments.length);else{if(!(u=u[0].match(hi))||u.length<=0)break;for(c=1;c<u.length&&void 0===u[c];c++);var E=(" "+u[c+1]).slice(1),C=(" "+u[c+2]).slice(1);switch(u[c]){case"#":_.tagList.push(C?[E,C]:[E]);break;case"PLAYLIST-TYPE":A.type=E.toUpperCase();break;case"MEDIA-SEQUENCE":h=A.startSN=parseInt(E,10);break;case"TARGETDURATION":A.targetduration=parseFloat(E);break;case"VERSION":A.version=parseInt(E,10);break;case"EXTM3U":break;case"ENDLIST":A.live=!1;break;case"DIS":f++,_.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":f=parseInt(E,10);break;case"KEY":var T=new si(E),I=T.enumeratedString("METHOD"),R=T.URI,w=T.hexadecimalInteger("IV");I&&(s=new qe(i,R),R&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(I)>=0&&(s.method=I,s.key=null,w&&(s.iv=w)));break;case"START":var L=new si(E).decimalFloatingPoint("TIME-OFFSET");Number.isFinite(L)&&(A.startTimeOffset=L);break;case"MAP":var D=new si(E);_.relurl=D.URI,D.BYTERANGE&&_.setByteRange(D.BYTERANGE),_.baseurl=i,_.level=n,_.type=r,_.sn="initSegment",A.initSegment=_,(_=new $e).rawProgramDateTime=A.initSegment.rawProgramDateTime;break;default:t.w(fi,"line parsed but not handled: "+u)}}}return(_=p)&&!_.relurl&&(A.fragments.pop(),d-=_.duration),A.totalduration=d,A.averagetargetduration=d/A.fragments.length,A.endSN=h-1,!A.initSegment&&A.fragments.length&&A.fragments.every((function(t){return di.test(t.relurl)}))&&(t.w(fi,"MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(_=new $e).relurl=A.fragments[0].relurl,_.baseurl=i,_.level=n,_.type=r,_.sn="initSegment",A.initSegment=_,A.needSidxRanges=!0),v&&function(t,e){for(var i=t[e],n=e-1;n>=0;n--){var r=t[n];i&&i.programDateTime&&(r.programDateTime=i.programDateTime-1e3*r.duration),i=r}}(A.fragments,v),A},t}(),vi=function(){function t(){}return t.parse=function(t){return Ze.verify(t)?Ze.parse(t):ri.verify(t)?ri.parse(t)[0].mediaLevels:{levels:[],def:0}},t.parseLevelSlice=function(t,e,i){if(e.m3u8Slice){var n=_i.parseLevelPlaylist(t,e.m3u8Slice,e.url[0],e.index,i,0);return delete e.m3u8Slice,0===n.fragments.length?void 0:n}},t}(),Ai=new RegExp('codecs="((/w|.)+)"'),gi=[{k:"video/mp4",v:l.i.mp4},{k:"video/quicktime",v:l.i.mp4},{k:"video/x-flv",v:l.i.flv},{k:"video/webm",v:l.i.matroska},{k:"video/x-matroska",v:l.i.matroska},{k:"video/mp2t",v:l.i.ts},{k:"audio/x-matroska",v:l.i.matroska},{k:"audio/mp4",v:l.i.mp4},{k:"audio/mpeg",v:l.i.mp3},{k:"audio/aac",v:l.i.aac},{k:"application/vnd.apple.mpegurl",v:l.i.hls},{k:"application/x-mpegurl",v:l.i.hls},{k:"audio/wave",v:l.i.wav},{k:"audio/wav",v:l.i.wav},{k:"audio/x-wav",v:l.i.wav},{k:"audio/x-pn-wav",v:l.i.wav}];function mi(t){for(var e={type:t,box:l.i.unknown,vCodec:l.c.unknown},i=0;i<gi.length;i++)if(0===t.toLocaleLowerCase().indexOf(gi[i].k)){e.box=gi[i].v;var n=t.match(Ai);n&&n.length>2&&n[1].split(",").forEach((function(t){0===t.indexOf("avc1")?e.vCodec=l.c.h264:0===t.indexOf("av01")?e.vCodec=l.c.av1:0!==t.indexOf("hev1")&&0!==t.indexOf("hvc1")||(e.vCodec=l.c.hevc)}));break}return e}var bi=function(){function t(){}return t.verify=function(t){return!!(t&&Object.prototype.hasOwnProperty.call(t,"version")&&Object.prototype.hasOwnProperty.call(t,"adaptationSet")&&Object.prototype.hasOwnProperty.call(t.adaptationSet,"representation")&&Array.isArray(t.adaptationSet.representation)&&t.adaptationSet.representation.length>0)&&t.adaptationSet.representation.reduce((function(t,e){return!!(t&&e.url&&e.bitrate&&e.qualityType)}),!0)},t.parse=function(e){var i,n=[];return t.verify(e)&&e.adaptationSet.representation.forEach((function(t,e){var r=new Qe(t.url);r.id=t.id||e,r.maxBitrate=t.bitrate||0,r.bitrate=t.averageBitrate||r.maxBitrate,r.qualityType=t.qualityType||"",r.qualityLabel=t.name||"",r.codec=t.codec||"",r.hidden=t.hidden||!1,r.enableAdaptive=void 0===t.enableAdaptive||!!t.enableAdaptive,r.default=t.defaultSelect||!1,r.index=e,n.push(r),r.default&&void 0===i&&(i=e)})),{levels:n,def:i||0,srcType:l.l.KWAI_FLV_ABR}},t}(),yi=function(){function t(){}return t.verify=function(t){return!!(t&&Object.prototype.hasOwnProperty.call(t,"segments")&&Array.isArray(t.segments)&&t.segments.length>0)&&(t.segments.forEach((function(t){if(!t.url||!t.duration||!t.time)return!1})),!0)},t.parse=function(e,i){void 0===i&&(i="");var n=[],r={levels:n,withCredentials:!1,hasVideo:!0,hasAudio:!0};if(t.verify(e)){var a=new Xe("");n.push(a);var o=e;r.withCredentials=!!o.withCredentials,void 0!==o.hasAudio&&(r.hasAudio=!!o.hasAudio),void 0!==o.hasVideo&&(r.hasVideo=!!o.hasVideo);var s=0,u=0,c=0,h=0,d=0;o.segments.forEach((function(t,e){var n=new $e;n.sn=e,"string"==typeof t.startUtcTime?n.programDateTime=parseInt(t.startUtcTime):"number"==typeof t.startUtcTime&&(n.programDateTime=t.startUtcTime),"string"==typeof t.duration?n.duration=(parseFloat(t.duration)||0)/1e3:n.duration=(t.duration||0)/1e3,n.start=s,n.baseurl=i,n.relurl=t.url,t.filesize&&(d+=t.filesize),n.duration>h&&(h=n.duration),s+=n.duration,e>0&&c!==t.periodId&&(n.tagList.push(["DIS"]),u++),n.cc=u,c=t.periodId,a.fragments.push(n)})),a.bitrate=8*d/1024/a.totalduration,a.live=!1,a.type=l.f.MAIN,a.startSN=0,a.endSN=a.fragments.length-1,a.totalduration=s,a.targetduration=h,a.averagetargetduration=s/a.fragments.length}return r},t}(),Ei=new RegExp("^((http|https)://)|blob:"),Ci=[l.i.matroska,l.i.mp3,l.i.aac],Ti=[l.i.flv,l.i.raw,l.i.webrtc,l.i.ivf],Ii=[l.i.mp4,l.i.flv,l.i.hls,l.i.raw,l.i.hls_fmp4,l.i.hls_ts,l.i.ts,l.i.ivf],Ri=Object.values(l.c),wi="media-src",Li=function(){function t(){}return t.verifyMix=function(t){var e=0;for(var i in t)-1!==Ri.indexOf(i)&&e++;return e>0},t.isSrcEmpty=function(t){try{if("string"==typeof t){if(!(t=t.trim()))return!0;if(!Ei.test(t))return 0===Object.keys(JSON.parse(t)).length}else if(!(t instanceof Blob))return!t||0===Object.keys(t).length}catch(t){}return!1},t.filteringLevels=function(e,i,n){void 0===n&&(n=!1),e.i(wi,"filteringLevels. input: "+i.levels.length+". mse: "+Qn.isMSEAvailable()+" mixCodec: "+n);var r=E.a.chrome||E.a.firefox;i.levels.forEach((function(t){r&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec="")}));var a=Qn.isMSEAvailable()?Qn.isMSECodecStrSupportedInMp4:Qn.isVideoCodecStrSupportedInMp4,o=Qn.isMSEAvailable()?Qn.isMSECodecSupported:Qn.isVideoCodecSupported;return i.levels=i.levels.filter((function(t){var i=!t.audioCodec||a(t.audioCodec,"audio"),r="number"==typeof t.hdr&&t.hdr>0,s=!0;(n||t.vCodecType===l.c.av1||E.a.mobile)&&((s=t.videoCodec?a(t.videoCodec):t.vCodecType===l.c.unknown||o(t.vCodecType,Qn.getPlayTestDefinition(t),r))||e.i(wi,"filteringLevels. "+t.qualityType+" v unsupported. codec: "+t.vCodecType+" hdr: "+r),t.qualityType.toLocaleLowerCase().indexOf("4k")>=0&&(E.a.mobile&&(s=!1),s||e.i(wi,"filteringLevels. "+t.qualityType+" v unsupported. mobile: "+E.a.mobile)));var u=Ae(t);return u||e.i(wi,"filteringLevels. "+t.qualityType+" v unsupported. drm: "+t.drmSchemaId),i&&s&&u})),i.audioTracks&&(i.audioTracks=i.audioTracks.filter((function(t){var i=!t.audioCodec||a(t.audioCodec,"audio");i||e.i(wi,"filteringLevels. "+t.qualityType+" a unsupported. codec: "+t.audioCodec);var n=Ae(t);return n||e.i(wi,"filteringLevels. "+t.qualityType+" a unsupported. drm: "+t.drmSchemaId),i&&n})),i.audioTracks.forEach((function(t){r&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec="")}))),t.initLevelsDefault(e,i),i},t.initLevelsDefault=function(t,e){return t.i(wi,"init level default"),e.def=-1,e.levels.forEach((function(t,i){t.index=i,t.default&&(e.def=i)})),e.def<0&&(e.def=e.levels.reduce((function(t,i,n){return i.bitrate<e.levels[t].bitrate?n:t}),0),t.i(wi,"no default main level, select lowest bit rate idx: "+e.def)),t.i(wi,"audio level default: "+e.def),e.audioTracks&&e.audioTracks.length&&(e.defAudio=void 0,e.audioTracks.forEach((function(t,i){t.index=i,t.default&&(e.defAudio=i)})),void 0===e.defAudio&&(e.defAudio=0),t.i(wi,"audio level default: "+e.defAudio)),e.subtitleTracks&&e.subtitleTracks.length&&(e.subtitleTracks.forEach((function(t,i){t.index=i,t.default&&(e.defSubtitle=i)})),void 0===e.defSubtitle&&(e.defSubtitle=0),t.i(wi,"subtitle level default: "+e.defSubtitle)),e},t.preParse=function(e,i,n,r,a){if(void 0===a&&(a=""),e.i(wi,"pre parse. native: "+n+", codecType: "+r+", baseUrl: "+a),"string"==typeof i){var o=this.Nd(e,i);if(!o)return[{src:i,box:l.i.unknown,srcType:l.l.OTHERS}];i=o}else i instanceof Blob||(i=JSON.parse(JSON.stringify(i)));if(Array.isArray(i)){e.i(wi,"input mix container.",i.length);var s=[],u=[];i.forEach((function(i){if(null!=i&&i.src){var o={info:t.Qd(e,i.src,n,r,a),priority:0,mime:void 0};s.push(o.info.box),i.type&&(o.mime=mi(i.type)),u.push(o)}}));for(var c=0;c<u.length;c++){var h=u[c];if(h.info&&h.info.src){if(h.mime&&(h.mime.box!==l.i.unknown&&(h.info.box=h.mime.box),h.mime.vCodec!==l.c.unknown&&(h.info.codecType=h.mime.vCodec)),void 0!==n&&n!==h.info.nativeFirst||h.priority++,h.info.nativeFirst)h.priority+=h.info.box===l.i.unknown?1:Qn.isVideoBoxSupported(h.info.box)?2:-100,h.priority+=h.info.codecType===l.c.unknown?1:r&&r===h.info.codecType||Qn.isVideoCodecSupported(h.info.codecType)?2:-100;else{if(!Qn.isMSEAvailable())continue;h.priority+=h.info.box===l.i.unknown?1:Ii.indexOf(h.info.box)>=0?2:-100,h.priority+=h.info.codecType===l.c.unknown?1:r&&r===h.info.codecType||Qn.isMSECodecSupported(h.info.codecType)?2:-100}e.i(wi,"input mix container. media desc "+c+". box: "+h.info.box+" codec: "+h.info.codecType+" priority: "+h.priority)}}return u.sort((function(t,e){return e.priority-t.priority})).filter((function(t){return t.priority>0})).map((function(t){return t.info}))}return[t.Qd(e,i,n,r,a)]},t.Qd=function(e,i,n,r,a){if(void 0===a&&(a=""),e.i(wi,"parse media desc. native: "+n+" codecType: "+r),"string"==typeof i){var o=this.Nd(e,i);if(!o)return{src:i,box:l.i.unknown,srcType:l.l.OTHERS};i=o}var s,u=Qn.isMSEAvailable();if(t.verifyMix(i)){e.i(wi,"input mix codec.",Object.keys(i));var c=i,h=[];for(var d in c){var f=d;if(-1!==Ri.indexOf(f)){var p=c[f];if("string"==typeof p&&(p=p.trim()),!p){e.i(wi,d+" src is empty.");continue}var _=this.xd(e,p,a,f,!0),v=Array.isArray(_)?this.Vd(_,f)||_[0]:_;if(!v)continue;v.codecType=f,h.push(v)}}s=this.Ud(e,h,n,r)}else{var A=this.xd(e,i,a);Array.isArray(A)?A.length>1?(e.i(wi,"input aas v2 mix codec."),s=this.Ud(e,A,n,r)):1===A.length&&((s=A[0]).nativeFirst=this.Fd(e,s.box,u,n)):(s=A).nativeFirst=this.Fd(e,s.box,u,n)}return s||(s={src:i,box:l.i.unknown,srcType:l.l.OTHERS}),s},t.Ud=function(t,e,i,n){var r,a,o=this,s={},u={},c=[],h=Qn.isMSEAvailable();e.forEach((function(e){var n=e.codecType;if(n)if(e.nativeFirst=o.Fd(t,e.box,h,i),c.push(n),h&&!e.nativeFirst){var r=Qn.getVideoCodecCompatibilityByCodec(n);u[n]=r.decoder,n===l.c.h264&&(r.decoder=l.d.buildin,r.smooth=!0),r.smooth&&r.decoder===l.d.buildin&&e.mediaLevels&&(e.compatibility=r,s[n]=e)}else{var a=Qn.isVideoCodecSupported(n);u[n]=a?l.d.buildin:l.d.unsupported,(n===l.c.h264||a)&&(e.compatibility={decoder:l.d.buildin,smooth:!0,mix:!1},s[n]=e)}}));var d,f,p=null!=(r=s[l.c.hevc])&&r.mediaLevels&&s[l.c.hevc].mediaLevels.levels.length?s[l.c.hevc]:void 0,_=null!=(a=s[l.c.av1])&&a.mediaLevels&&s[l.c.av1].mediaLevels.levels.length?s[l.c.av1]:void 0,v=s[l.c.h264];return t.i(wi,"input vcodec. hevc: "+!!p+" av1: "+!!_+" h264: "+!!v),n&&s[n]&&(d=s[n],t.i(wi,"selected the specified codec: "+n)),d||((d=_||p||v)&&(d.nativeFirst=this.Fd(t,d.box,h,i)),t.i(wi,"selected src: "+(null==(f=d)?void 0:f.codecType),d)),d&&(c.length&&(d.mixCodecInput=c),d.mixCodecAvailable=u),d},t.Vd=function(t,e){for(var i=0;i<t.length;i++)if(t[i].codecType===e)return t[i]},t.Fd=function(t,e,i,n){if(!i||-1!==Ci.indexOf(e))return t.i(wi,"get native first true. box: "+e+" mse: "+i),!0;if(-1!==Ti.indexOf(e)||!Qn.isVideoBoxSupported(e))return t.i(wi,"get native first false. box: "+e),!1;if(!E.a.mobile){if(n){var r=Qn.isVideoBoxSupported(e),a=!!r;return t.i(wi,"get native first pc "+a+". box: "+e+" nativeFirstParams: true video box supported: "+r),a}if(void 0===n){var o=Qn.isMSEAvailable(),s=!o;return t.i(wi,"get native first pc "+s+". box: "+e+" nativeFirstParams: undefined mse supported: "+o),s}return t.i(wi,"get native first pc false. nativeFirstParams: false"),!1}if(e===l.i.mp4||e===l.i.hls||e===l.i.hls_ts||e===l.i.ts){if(void 0===n||n){var u=Qn.isVideoBoxSupported(e),c=!!u;return t.i(wi,"get native first mobile "+c+". box: "+e+" nativeFirstParams: "+n+" video box supported: "+u),c}return t.i(wi,"get native first mobile false. nativeFirstParams: "+n),!1}if(e===l.i.hls_fmp4){if(void 0===n||n){var h=Qn.isVideoBoxSupported(e),d=!(!h||!E.a.x5&&!E.a.xweb);return t.i(wi,"get native first mobile "+d+". box: "+e+" nativeFirstParams: "+n+" video box supported: "+h+" x5: "+E.a.x5+" xweb: "+E.a.xweb),d}return t.i(wi,"get native first mobile false. nativeFirstParams: "+n),!1}},t.xd=function(e,i,n,a,o){var s=this;void 0===n&&(n=""),void 0===a&&(a=l.c.unknown),void 0===o&&(o=!1);var u={src:i,box:l.i.unknown,srcType:l.l.OTHERS};if("string"==typeof i){var c=new Qe(i);c.vCodecType=a,u.box=Te(i),u.mediaLevels={levels:[c],def:0},u.isLive=this.Pd(u.box)}else if(i instanceof Blob){var h="unknow";i instanceof File?(u.box=Te(i.name),h=i.name):u.box=mi(i.type).box;var d=y(u.box)?new Xe(URL.createObjectURL(i)):new Qe(URL.createObjectURL(i));d.vCodecType=a,d.fileName=h,u.mediaLevels={levels:[d],def:0},u.srcType=l.l.FILE,u.isLive=!1}else{if(ri.verify(i)){var f=ri.parse(i);return e.i(wi,"kwai manifest"),f.map((function(n){var r,c;e.i(wi,"kwai manifest codec: "+n.codecType+" meta:",n.mediaLevels.meta),t.Hd(n.mediaLevels.levels,a);var h={meta:n.mediaLevels.meta,mediaLevels:t.filteringLevels(e,n.mediaLevels,o||f.length>1),src:i,box:n.mediaLevels.box||Te((null==(r=n.mediaLevels.levels[0])?void 0:r.url[0])||""),srcType:l.l.KWAI,isLive:s.Pd(u.box),isLiveShift:n.mediaLevels.isLiveShift,codecType:n.codecType};return"boolean"==typeof(null==(c=h.mediaLevels)?void 0:c.isLive)&&(h.isLive=h.mediaLevels.isLive),y(h.box)&&(h.multipart=!0),h}))}if(bi.verify(i)){e.i(wi,"flv abr manifest",a);var p=bi.parse(i);t.Hd(p.levels,a),u.mediaLevels=t.filteringLevels(e,p,o),u.box=l.i.flv,u.isLive=!0,u.srcType=l.l.KWAI_FLV_ABR}else if(yi.verify(i)){e.i(wi,"flv multipart");var _=yi.parse(i,n);u.mediaLevels=r()({def:0},_),t.Hd(u.mediaLevels.levels,a),u.box=l.i.flv,u.isLive=!1,u.multipart=!0,u.srcType=l.l.KWAI_FLV_MP}else Ze.verify(i)&&(u.mediaLevels=t.filteringLevels(e,Ze.parse(i),o),u.box=l.i.hls,u.srcType=l.l.KWAI)}return y(u.box)&&(u.multipart=!0),u},t.Hd=function(t,e){void 0===e&&(e=l.c.unknown),t.forEach((function(t){t.vCodecType===l.c.unknown&&e!==l.c.unknown&&(t.vCodecType=e)}))},t.Pd=function(t){var e;return-1===[l.i.flv,l.i.hls,l.i.unknown,l.i.ivf,l.i.yuv].indexOf(t)&&(e=!1),t===l.i.webrtc&&(e=!0),e},t.Nd=function(t,e){var i=e.trim();if(i){if(!Ei.test(i)){try{i=JSON.parse(i)}catch(e){t.i(wi,"formatStrData error",e)}"string"==typeof i&&(i=Object(Ge.buildAbsoluteURL)(location.href,i,{alwaysNormalize:!0}))}return i}},t}();function Di(t){switch(t){case l.f.MAIN:return me.c.LEVEL;case l.f.SUBTITLE:return me.c.SUBTITLE_TRACK;case l.f.AUDIO:return me.c.AUDIO_TRACK;default:return me.c.LEVEL}}var Si,Oi,Ni,ki="playlist-loader",xi=function(){function t(t){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,i){i.retry&&e.Ai.emit(S.a.RETRY,{type:l.k.LOADER,core:l.a.mse,message:"manifest: "+i.errMessage,code:Object(D.d)(D.a.LOAD_ERROR,i.errMessage,i.code)})},this.Kd=function(t,i,n){if(e.Ai.emit(S.a.DOWNLOAD,xe(Ne.SUCCESS,t,n)),t.isSidxRequest)e.zA(Object(D.e)(D.b.OTHER_ERROR,D.a.UNSUPPORTED,"unsupport sidx",{statusCode:n.code,url:t.url.toString()}));else if(e.Zd(t.type),"string"==typeof i)if(0!==i.indexOf("#EXTM3U")&&i.indexOf("#EXTINF:")>=0&&t.rangeStart&&t.levelDetails)e.Wd(t,i,n);else{if(0!==i.indexOf("#EXTM3U")){if(t.rangeStart&&0===i.trim().length)return e.Ci.i(ki,"emit empty. rangestart: "+t.rangeStart+". response is empty."),void e.Xd(t,n);var r=i;return r.length>100&&(r=r.slice(0,100)),void e.zd(t,"no EXTM3U delimiter."+r,n,!!i.trim().length)}i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?e.Wd(t,i,n):e.Jd(t,i,n)}else e.zA(Object(D.e)(D.b.NETWORK_ERROR,D.a.MANIFEST_PARSING_ERROR,'expected responseType of "text" for PlaylistLoader',{statusCode:n.code,url:t.url.toString()}))},this.qd=function(t,i){e.$d(t,i)},this.tl=function(t,i){e.Ai.emit(S.a.DOWNLOAD,xe(Ne.ABORT,t,i))},this.zA=function(t){if(t.type===D.b.NETWORK_ERROR){var i=e.Do.lctx.current;!i||e.Do.stat.isLive||i.hasFrag&&i.live||(t.fatal=!0)}e.Ai.emit(S.a.ERROR,t)},this.Do=t,this.di=t.config,this.Ci=t.logger,this.Ai=t.evt,this.Yd={}}t.il=function(t){return t===me.c.LEVEL},t.el=function(t){switch(t.type){case me.c.AUDIO_TRACK:return l.f.AUDIO;case me.c.SUBTITLE_TRACK:return l.f.SUBTITLE;default:return l.f.MAIN}},t.nl=function(t){if(t.urlBeforePreprocess)return t.urlBeforePreprocess;var e=t.responseUrl;return e&&0!==e.indexOf("data:")||"string"!=typeof t.url||(e=t.url),e||""};var e=t.prototype;return e.sl=function(t){var e=new dt(this.Ci);return t.loader=e,this.Yd[t.type]=e,e},e.Ef=function(t){return this.Yd[t.type]},e.Zd=function(t){this.Yd[t]&&delete this.Yd[t]},e.rl=function(){for(var t in this.Yd){var e=this.Yd[t];e&&e.destroy(),this.Zd(t)}},e.destroy=function(){this.rl()},e.load=function(t){var e;this.Ci.i(ki,"Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var i,n,r,a,o=this.Ef(t);if(o){var s=o.context;if(s&&s.url===t.url)return this.Ci.i(ki,"playlist request ongoing"),!1;this.Ci.w(ki,"aborting previous loader for type: "+t.type),o.abort()}t.type===me.c.MANIFEST?(i=this.di.manifestLoadingMaxRetry,n=this.di.manifestConnectionTimeout,r=this.di.manifestTransmissionTimeout,a=this.di.manifestLoadingRetryDelay):(i=this.di.levelLoadingMaxRetry,n=this.di.levelConnectionTimeout,r=this.di.levelTransmissionTimeout,a=this.di.levelLoadingRetryDelay),o=this.sl(t),t.responseType=t.responseType||"text";var u,c={connectionTimeout:n,transmissionTimeout:r,maxRetry:i,retryDelay:a},l={onLoad:this.Gd,onEnd:this.Kd,onError:this.qd,onAbort:this.tl};return null!=(e=this.di.preprocessUrl)&&e.manifest&&(this.Ci.i(ki,"preprocessUrl manifest"),t.urlBeforePreprocess=t.url,t.url=null==(u=this.di.preprocessUrl)?void 0:u.manifest(t.url)),this.Ci.d(ki,"Calling internal loader delegate for URL: "+t.url),o.load(t,l,c),!0},e.Jd=function(e,i,n){this.Ci.i(ki,"handle master play list");var r=i,a=t.nl(e),o=_i.parseMasterPlaylist(r,a);if(o.length){var s=o.map((function(t,e){return{id:t.attrs?t.attrs.AUDIO:e,codec:t.audioCodec}})),u=_i.parseMasterPlaylistMedia(r,a,"AUDIO",s),c=_i.parseMasterPlaylistMedia(r,a,"SUBTITLES",s);if(u.length){var h=!1;if(u.forEach((function(t){t.url||(h=!0)})),!1===h&&o[0].audioCodec&&(!o[0].attrs||!o[0].attrs.AUDIO)){this.Ci.v(ki,"audio codec signaled in quality level, but no embedded audio track signaled, create one");var d=new Xe("");d.type=l.f.MAIN,d.name="main",d.id=-1,u.unshift(d)}}var f=0;o.forEach((function(t,e){t.default&&(f=e)}));var p={levels:o,audioTracks:u,subtitleTracks:c,def:f};this.Ci.i(ki,"hls mainfest"),this.Ai.emit(S.a.HLS_MANIFEST_PARSED,p)}else this.zd(e,"no level found in manifest",n)},e.Wd=function(e,i,n){var r=e.id,a=e.level,o=e.type;this.Ci.i(ki,"handle track or level play list. id: "+r+" type: "+o+", level: "+a);var s=t.nl(e),u=Number.isFinite(r)?r:0,c=Number.isFinite(a)?a:u,l=t.el(e),h=e.levelDetails,d=!(0===i.indexOf("#EXTM3U")||!e.rangeStart),f=h&&d?h.endSN+1:0;h&&(h.http416=0);var p=_i.parseLevelPlaylist(this.Ci,i,s,c,l,u,f);d&&(p.startSN=f,this.Ci.i(ki,"part of media playlist data")),p.size=i.length,p.partOfData=d;var _=p.fragments[0];if(e.liveShiftKwai2Params&&_&&_.programDateTime){var v=e.liveShiftKwai2Params;"offset"===v.paramName?this.Ci.w(ki,"liveshift kwai2 m3u8 response. req: "+v.time+" res: "+_.programDateTime+" diff: "+(v.time-_.programDateTime)+" sn: "+_.sn+" cnt: "+p.fragments.length):"seqId"===e.liveShiftKwai2Params.paramName&&this.Ci.w(ki,"liveshift kwai2 m3u8 response. req: "+v.seqId+" res: "+_.sn+" cnt: "+p.fragments.length)}if(o===me.c.MANIFEST){var A={levels:[p],def:0};this.Ci.i(ki,"hls mainfest. track/level"),this.Ai.emit(S.a.HLS_MANIFEST_PARSED,A)}if(p.needSidxRanges&&p.initSegment){var g,m=p.initSegment.url;return null!=(g=this.di.preprocessUrl)&&g.stream&&(this.Ci.i(ki,"preprocessUrl stream sidx"),e.urlBeforePreprocess=m,m=this.di.preprocessUrl.stream(m)),void this.load({url:m,isSidxRequest:!0,type:o,level:a,levelDetails:p,id:r,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",headers:this.di.headers})}e.levelDetails=p,this.hl(e,n)},e.zd=function(t,e,i,n){this.zA(Object(D.e)(D.b.NETWORK_ERROR,D.a.MANIFEST_PARSING_ERROR,e,{statusCode:i.code,url:t.url.toString()}))},e.$d=function(t,e){var i,n;this.Ci.i(ki,"A network error occured while loading a "+t.type+"-type playlist");var r=this.Ef(t);switch(t.type){case me.c.MANIFEST:i=D.a.MANIFEST_LOAD_ERROR,n=!0;break;case me.c.LEVEL:i=D.a.LEVEL_LOAD_ERROR,n=!0;break;case me.c.AUDIO_TRACK:i=D.a.AUDIO_TRACK_LOAD_ERROR,n=!0;break;case me.c.SUBTITLE_TRACK:i=D.a.SUBTITLE_TRACK_LOAD_ERROR,n=!1;break;default:i=D.a.MANIFEST_LOAD_ERROR,n=!1}if(this.Ai.emit(S.a.DOWNLOAD,xe(Ne.FAIL,t,e)),e.fatal){if(r&&(r.abort(),this.Zd(t.type)),t.rangeStart&&416===e.code)return this.Ci.i(ki,"emit empty. level 416"),t.levelDetails&&t.levelDetails.http416++,void this.Xd(t,e);this.zA(Object(D.e)(D.b.NETWORK_ERROR,i,e.errMessage,{fatal:n,statusCode:e.code,url:t.url.toString()}))}},e.Xd=function(t,e){var i=new Xe("");t.levelDetails?(i.endSN=t.levelDetails.endSN,i.targetduration=t.levelDetails.targetduration):i.targetduration=2,this.Ai.emit(S.a.LEVEL_LOADED,{details:i,level:t.level||0,stats:e})},e.hl=function(e,i){var n,r=e.type,a=e.level,o=e.levelDetails;if(o&&(o.targetduration||null!=(n=e.levelDetails)&&n.partOfData))if(t.il(e.type))this.Ai.emit(S.a.LEVEL_LOADED,{details:o,level:a||0,stats:i});else switch(r){case me.c.AUDIO_TRACK:this.Ai.emit(S.a.AUDIO_TRACK_LOADED,{details:o,level:a||0,stats:i});break;case me.c.SUBTITLE_TRACK:this.Ai.emit(S.a.SUBTITLE_TRACK_LOADED,{details:o,level:a||0,stats:i})}else this.zd(e,"invalid target duration.",i)},t}(),Pi="mp-hls",Mi=function(t){function e(e){var i;return(i=t.call(this)||this).ol=void 0,i.Do=void 0,i.Ci=void 0,i.Ai=void 0,i.kd=function(t){var e=i.Do.lctx;t=Li.filteringLevels(i.Ci,t),i.Do.stat.drm=t.drm,e.levels=t.levels,e.currentIdx=t.def,t.audioTracks&&(e.audioTracks=t.audioTracks,e.audioIdx=t.defAudio||0),t.subtitleTracks&&(e.subtitleTracks=t.subtitleTracks,e.subtitleIdx=t.defSubtitle||0),i.Ai.emit(S.a.MANIFEST_LOADED)},i.Do=e,i.Ci=e.logger,i.Ai=e.evt,i.ol=new xi(i.Do),i.O.push(i.ol,i.Ai.on(S.a.HLS_MANIFEST_PARSED,i.kd)),i}u()(e,t);var i=e.prototype;return i.loadManifest=function(){if(this.Ci.i(Pi,"load manifest."),this.Do.lctx.levels.length)this.Ai.emit(S.a.MANIFEST_LOADED);else if(this.ol){var t={url:this.Do.src,type:me.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(t),this.ol.load(t)}},i.loadLevel=function(t,e,i){if(void 0===e&&(e=l.f.MAIN),void 0===i&&(i=0),this.Ci.i(Pi,"load level. type: "+e),t.m3u8Slice){this.Ci.i(Pi,"load level. parse m3u8 slice.",i);var n=vi.parseLevelSlice(this.Ci,t,e);if(n){var r={details:n,level:i};if(e===l.f.MAIN?this.Ai.emit(S.a.LEVEL_LOADED,r):e===l.f.AUDIO?this.Ai.emit(S.a.AUDIO_TRACK_LOADED,r):e===l.f.SUBTITLE&&this.Ai.emit(S.a.SUBTITLE_TRACK_LOADED,r),!n.live)return}}if(this.ol){var a=t.urlId,o={url:t.url[a],type:Di(e),level:t.index,id:a,credentials:this.Do.config.credentials,headers:this.Do.config.headers,levelDetails:t,progress:!1,preferNative:this.Do.stat.preferNativeLoader};t.size&&t.http416<I.k&&this.Do.stat.liveShiftType===l.g.KWAI&&this.Ci.i(Pi,"load m3u8 range start: "+t.size+"."),this.al(o),this.ol.load(o)}},i.al=function(t){this.Do.isLiveShiftKwai2&&(t.url=this.Do.getKwai2LiveShiftUrl(t.url),this.Do.stat.liveShiftKwai2Params&&(t.liveShiftKwai2Params=r()({},this.Do.stat.liveShiftKwai2Params)),this.Do.stat.liveShiftKwai2Params.seqId=void 0)},e}(h.a),Ui=Mi?((Si={})[l.i.hls]=Mi,Si[l.i.hls_ts]=Mi,Si[l.i.hls_fmp4]=Mi,Si[l.i.flv]=He,Si):((Oi={})[l.i.flv]=He,Oi),Bi=i(26),Vi=function(){function t(t,e,i){var n=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(t,e,i){var r=t.frag;r.decryptdata?e&&e instanceof ArrayBuffer?(n.ul=r.decryptdata.key=new Uint8Array(e),n.Yd[r.type]=void 0,n.Do.evt.emit(S.a.HLS_KEY_LOADED,{frag:r})):n.zA("key empty",i.code):n.zA("frag decrypt data empty",i.code)},this.Al=function(t,e){var i=t.frag.loader;e.fatal&&(i&&i.abort(),n.Yd[t.frag.type]=void 0,n.zA(e.errMessage,e.code))},this.zA=function(t,e){n.Do.evt.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.KEY_LOAD_ERROR,t,{statusCode:e}))},this.Do=t,this.Ci=t.logger,this.di=e,this.YA=i,this.Yd={},this.ul=null,this.cl=null}var e=t.prototype;return e.destroy=function(){for(var t in this.Yd){var e=this.Yd[t];e&&e.destroy()}this.Yd={}},e.load=function(t){var e=t.type,i=this.Yd[e],n=t.decryptdata,r=null;if(n&&(r=n.uri),!r||r===this.cl&&null!==this.ul)this.ul&&(n&&(n.key=this.ul),this.Do.evt.emit(S.a.HLS_KEY_LOADED,{frag:t}));else{var a=this.YA;i&&(this.Ci.w("KeyLoader","abort previous key loader for type:"+e),i.abort()),t.loader=this.Yd[e]=new dt(this.Ci),this.cl=r,this.ul=null;var o={url:r,frag:t,responseType:"arraybuffer",credentials:this.di.credentials,headers:this.di.headers,preferNative:this.di.preferNativeLoader},s=a,u={onEnd:this.fl,onError:this.Al};t.loader.load(o,u,s)}},t}(),Fi=i(27),ji={local:0,server:0},Hi="live-time",Gi=function(t){function e(i){var n;return(n=t.call(this)||this).Ci=void 0,n.vl={abst:0,originDTS:0},n.dl=void 0,n.ll=void 0,e.Ci=n.Ci=i,i.i(Hi,"constructor"),e.bl={onError:e.Yf,onEnd:e.pl},e.YA={connectionTimeout:5e3},n}u()(e,t),e.load=function(t,i){e.sv();var n={url:"https://ntp.nc.gifshow.com/",responseType:"text",progress:!1,preferNative:i};(e.vf=new dt(t)).load(n,e.bl,e.YA)};var i=e.prototype;return i.ntpSync=function(t){this.Ci.i(Hi,"sync. state:",e.ml);var i=performance.now();("suspend"===e.ml||i-e.gl>18e5)&&(this.Ci.i(Hi,"sync start."),e.gl=i,e.ml="loading",e.load(this.Ci,t))},i.onPrivNal=function(t){var e=this;t.info.forEach((function(i){"number"==typeof i.abst&&"number"==typeof t.streamTimestamp&&(e.vl.abst=i.abst/1e3,e.vl.originDTS=t.streamTimestamp/1e3)}))},i.onParsing=function(t){var e=this;t.segments.forEach((function(t){t.type===l.o.VIDEO?e.dl={dts:t.startDTS,originDTS:t.originFirstDTS,parseTime:t.firstParseTime}:t.type===l.o.AUDIO&&(e.ll={dts:t.startDTS,originDTS:t.originFirstDTS,parseTime:t.firstParseTime})}))},i.destroy=function(){e.sv()},i.getDisplayDelay=function(t){return this.yl(t,this.dl)},i.getAudioRenderDelay=function(t){return this.yl(t,this.ll)},i.getRecDelay=function(){var t=this.dl;if(this.serverNowMs&&null!=t&&t.parseTime){var i=this.vl,n=this.serverMs(1e3*t.parseTime+e._l);if(n&&i.originDTS&&i.abst)return Math.round(n-1e3*(t.originDTS-i.originDTS+i.abst))}return 0},i.serverMs=function(t){return ji.server?t-ji.local+ji.server:null},i.yl=function(t,e){var i=this.serverNowMs,n=this.vl;return i&&e&&n.abst&&n.originDTS?Math.round(1e3*(e.dts-t-(e.originDTS-n.originDTS+n.abst))+i):0},e.sv=function(){e.vf&&e.vf.destroy()},o()(e,[{key:"syncState",get:function(){return e.ml}},{key:"time",get:function(){return r()({},ji)}},{key:"now",get:function(){return this.serverNowMs||Date.now()}},{key:"serverNowMs",get:function(){return ji.server?performance.now()-ji.local+ji.server:null}}],[{key:"workerTimeOffset",set:function(t){e._l=t}}])}(h.a);Ni=Gi,Gi._l=0,Gi.vf=void 0,Gi.bl=void 0,Gi.YA=void 0,Gi.ml="suspend",Gi.Ci=void 0,Gi.gl=void 0,Gi.Yf=function(){Ni.Ci.i(Hi,"ntp sync load error."),Ni.sv()},Gi.pl=function(t,e){if(Ni.sv(),"string"==typeof e){ji.local=performance.now();var i=e.split(",");i.length>1&&(ji.server=1e3*parseFloat(i[0])+parseInt(i[1],10)/1e3/2)}};var zi=Gi,Wi=i(47),Ki="mux-base",Yi=function(t){function e(e,i,n){var r;if((r=t.call(this)||this).At=void 0,r.Ai=void 0,r.Do=void 0,r.Ci=void 0,r.te=void 0,r.Cl=void 0,r.Rr=!1,r.Il=void 0,r.If=0,r.Ol=0,r._i=void 0,r.wl=!1,r.zc=function(t){var e=t.data.event,i=t.data.data;r.El(e,i),r.Ai.emit(e,i)},r.At=n,r.Ai=e,r.Do=i,r.Ci=i.logger,i.stat.webWorker&&(r.te=i.stat.muxWorker,i.stat.muxWorker=void 0,!r.te))try{r.Ci.i(Ki,"init mux worker"),r.te=V()(42),zi.workerTimeOffset=performance.now()}catch(t){}return r.Cl=0,r._i={audioCodec:i.stat.audioCodec,videoCodec:"",duration:0,remuxId:1,hasAudio:i.lctx.hasAudio,hasVideo:i.lctx.hasVideo,disableFillSlientForRaw:i.stat.avSeparated&&!1!==i.config.audioEnabled},i.lctx.current&&i.lctx.current.dropVideo.length&&(r._i.dropVideo=i.lctx.current.dropVideo),r.Ci.i(Ki,"constructor",r._i),r}u()(e,t);var i=e.prototype;return i.init=function(){var t=this;this.Ci.i(Ki,"TYPE_SUPPORTED","hw: "+Qn.isSupportHW,Qn.TYPE_SUPPORTED);var e=r()({},Qn.TYPE_SUPPORTED);if(this.Do.stat.hevcFallbackWasm&&(e.hevc=!1),this.te){this.te.addEventListener("message",this.zc),this.te.addEventListener("error",(function(e){t.Ci.i(Ki,"worker onerror",e.message),t.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.REMUX_WORKER_ERROR,e.message))}));try{this.te.postMessage({cmd:Fi.a.INIT,typeSupported:e,config:this.Do.getRemuxConfig(),vendor:navigator.vendor,hasExternalLogger:!!this.Do.config.logger,contextId:this.Do.id})}catch(t){this.Ci.i(Ki,"worker init error"),this.te.terminate(),this.te=void 0}}this.te||(this.Il=new Wi.a(this.Ai,e,this.Do.getRemuxConfig(),navigator.vendor,this.Ci),this.O.push(this.Ai.prependListener(S.a.PARSING_DATA,this.jl.bind(this)),this.Ai.prependListener(S.a.PARSED_DATA,this.fo.bind(this)),this.Ai.prependListener(S.a.RAW_DATA,this.kl.bind(this))))},i.destroy=function(){this.Do.stat.muxWorker=void 0,this.te&&(this.te.postMessage({cmd:Fi.a.DESTROY}),this.te.removeEventListener("message",this.zc),this.te.terminate(),this.te=void 0),t.prototype.destroy.call(this)},i.reset=function(t){this.Ci.i(Ki,"reset: "+t),this._i.remuxId++,this.Cl=0,this.Rr=t,this.wl=!1},i.end=function(){this.wl||(this.wl=!0,this.te?this.te.postMessage({cmd:Fi.a.LOAD_END}):this.Il&&this.Il.end())},i.updateConfig=function(t){this.te?this.te.postMessage({cmd:Fi.a.UPDATE_CONFIG,config:t}):this.Il&&this.Il.updateConfig(t)},i.onFragProgress=function(t){this.Ml(t,!1)},i.onFragLoaded=function(t){this.Ml(t,!0)},i.updateSuffix=function(t){this._i.suffix=t},i.Ml=function(t,e){var i=t.context.frag,n=t.discontinuity||!1,r=(null==i?void 0:i.start)||0,a=!1,o=!0,s=null;if(this._i.progress=t.progress,t.data&&t.data.byteLength){var u=performance.now(),c=u-(this.If||t.stats.trequest);t.stats.trequest!==this.Ol&&(this.Ol=t.stats.trequest,c=u-t.stats.trequest),this.If=u,this.Ai.emit(S.a.LOADER_CHUNK_ARRIVAL,{progress:t.context.progress,byteLength:t.data.byteLength,timeCost:c,ts:performance.now()})}0===this.Cl&&(a=!0,o=t.remuxContiguous||!1,this.Ci.i(Ki,"chunk 0 contiguous: "+o)),e?(this.If=0,this.Cl=0,s=t.data?new Uint8Array(t.data):new Uint8Array):(this.Cl++,t.data&&(s=new Uint8Array(t.data))),s&&(this.Sl(s,(null==i?void 0:i.decryptdata)||null,t.initData,r,o,a,n,!this.Rr||0===(null==i?void 0:i.start),e),this.Rr=!1)},i.jl=function(t){this.Bl(t)&&(t.expired=!0,this.Ci.i(Ki,"parsing data expired"))},i.fo=function(t){this.Bl(t)?(t.expired=!0,this.Ci.i(Ki,"parsed expired")):t&&(t.trackType=this.At)},i.kl=function(t){this.Bl(t)&&(t.expired=!0)},i.Bl=function(t){return!(!t.extra||t.extra.remuxId===this._i.remuxId)},i.Sl=function(t,e,i,n,a,o,s,u,c){a||this.Ci.i(Ki," demux contiguous false");var l=this._i;this.te?this.te.postMessage({cmd:Fi.a.PUSH,data:t,decryptdata:e,initSegment:i,timeOffset:n||0,contiguous:a,trackSwitch:o,discontinuity:s,accurateTimeOffset:u,fragEnd:c,transmuxData:l},[t.buffer]):this.Il&&this.Il.pushMuxData(t,e,i,n,a,o,s,u,c,r()({},l))},i.El=function(t,e){switch(t){case S.a.PARSING_DATA:this.jl(e);break;case S.a.PARSED_DATA:this.fo(e);break;case S.a.RAW_DATA:this.kl(e)}},o()(e,[{key:"totalDuration",set:function(t){this._i.duration=t}},{key:"id",get:function(){return this.At}}])}(h.a),Qi="mux-multipart",Xi=function(t){function e(e,i,n){var r;return(r=t.call(this,e,i,n)||this).Tl=void 0,r.Dl=void 0,r.Tl=void 0,r.Dl={},r}u()(e,t);var i=e.prototype;return i.reset=function(e){t.prototype.reset.call(this,e),this.Tl=void 0},i.Ml=function(t,e){if(t.context.frag){var i=t.context.frag,n=this.Tl,r=!1,a=Number.isFinite(i.startDTS)?i.startDTS:i.start,o=!1,s=!0,u=null;if(this._i.progress=t.progress,"number"==typeof i.sn&&(this._i.fragSn=i.sn),t.data&&t.data.byteLength){var c=performance.now(),l={progress:t.context.progress,byteLength:t.data.byteLength,timeCost:performance.now()-(this.If||t.stats.trequest),ts:performance.now()};this.If=c,this.Ai.emit(S.a.LOADER_CHUNK_ARRIVAL,l)}if(0===this.Cl){this.Dl={},r=!(n&&i.level===n.level),o=!(n&&i.cc===n.cc);var h=n&&i.sn===n.sn+1;s=!(r||!h),this.Do.stat.isLive&&(o=o||!h),n&&t.remuxContiguous&&(s||(a=Number.isFinite(n.endDTS)?n.endDTS:n.start+n.duration),s=!0)}e?(this.If=0,this.Cl=0,this.Tl=t.context.frag,u=t.data?new Uint8Array(t.data):new Uint8Array,this.Tl=i):(this.Cl++,t.data&&(u=new Uint8Array(t.data))),u&&("number"==typeof t.liveShiftOffset&&(a=t.liveShiftOffset),this.Sl(u,i.decryptdata,t.initData,a,s,r,o,!this.Rr||0===t.context.frag.start,e),this.Rr=!1)}},i.jl=function(t){var e=this;if(this.Bl(t))return this.Ci.i(Qi,"parsing data expired"),void(t.expired=!0);t.frag=this.Tl;var i=this.Dl;t.segments.forEach((function(t){var n=t.type;if(n===l.o.VIDEO&&t.adjustedStart&&t.adjustedStart>1)e.Ci.i(Qi,"video segment adjustedStart: "+t.adjustedStart+" > 1");else{var r=i[n];r?(r.endPTS=t.endPTS,r.endDTS=t.endDTS):(t.endPTS||t.endDTS||!e.Tl||(t.endPTS=t.startPTS+e.Tl.duration,t.endDTS=t.startDTS+e.Tl.duration),i[n]={startDTS:t.startDTS,startPTS:t.startPTS,endPTS:t.endPTS,endDTS:t.endDTS})}}))},i.fo=function(t){if(this.Bl(t))return t.expired=!0,void this.Ci.i(Qi,"parsed expired");t.info=r()({},this.Dl),t.frag=this.Tl,this.Dl={},t&&(t.trackType=this.At)},i.kl=function(t){this.Bl(t)?t.expired=!0:t.frag=this.Tl},e}(Yi),Zi="initSegment",qi="stream-media",Ji=function(t){function e(e,i,n,r){var a;return(a=t.call(this)||this).Ai=void 0,a.Rl=void 0,a.Ll=void 0,a.Nl=0,a.Ql=-1,a.Il=void 0,a.xl=!0,a.Vl=!0,a.Ul=0,a.Fl=0,a.Pl=!1,a.vf=void 0,a.Hl=void 0,a.Yl=void 0,a.Gl=!1,a.Do=void 0,a.Ci=void 0,a.Kl=void 0,a.bl=void 0,a.Zl=void 0,a.Wl=void 0,a.Xl=void 0,a.zl=function(){var t=a.Do.lctx.getNextIdx(a.Rl);a.Do.lctx.getLevelIdx(a.Rl)!==t&&a.Do.lctx.setLevelIdx(t,a.Rl);var e=a.level;if(e){if(a.Kl&&e.hasFrag){var i=a.Kl.frag,n=e.fragments[a.Nl];n&&a.Do.config.adjustFragTime&&a.Nl===a.Kl.pos&&i&&Number.isFinite(i.startPTS)&&fe(a.Ci,e,n,i.startPTS,i.endPTS,i.startDTS,i.endDTS)}if(a.xl&&!a.vf&&!a.Pl){if(a.Jl())return void a.Il.end();var r=a.Tr();r&&(e.hasFrag&&e.initSegment&&!e.initSegment.data&&(a.Ci.i(qi,"["+a.Rl+"]load init segment."),a.ql(e.initSegment)),a.Ci.i(qi,"["+a.Rl+"]load frag: "+r.sn+" level: "+a.index),a.ql(r))}}},a.$l=function(t){if(!t.expired){var e=t.frag;if(a.Ci.i(qi,"["+a.Rl+"]parsed. "+(null==e?void 0:e.sn)),t.trackType===a.Rl&&e){for(var i in a.Pl=!1,a.Gl=!1,t.info){var n=t.info[i];if(n&&n.endPTS&&n.endDTS){var r=a.Ll[e.level];null!=r&&r.hasFrag&&(a.Do.isLiveShift||!a.Do.config.adjustFragTime?r.live&&"number"==typeof e.sn&&pe(a.Ci,r,e.sn-r.startSN):fe(a.Ci,r,e,n.startPTS,n.endPTS,n.startDTS,n.endDTS))}}a.Kl&&(a.Kl=void 0),a.Jl()?a.Il.end():a.Rl===l.f.MAIN&&a.Ai.emit(S.a.ABR_NEXT,{startSec:a.tb(a.Nl)}),a.zl()}}},a.ib=function(){if(a.Xl&&a.eb(a.Xl.context.frag,a.Ll[a.Xl.context.frag.level])){var t=a.Xl.data.get(a.Xl.data.unreadLen);t&&a.nb(a.Xl.context,t.buffer,a.Xl.stats,a.Xl.progress),a.Xl=void 0}},a.sb=function(t,e){e.retry&&a.Ai.emit(S.a.RETRY,{type:l.k.LOADER,core:l.a.mse,message:""+e.errMessage,code:Object(D.d)(D.a.LOAD_ERROR,e.errMessage,e.code)})},a.Mc=function(t,e,i){t.frag&&t.frag.sn===Zi||e instanceof ArrayBuffer&&a.rb(t,e,i,!0)},a.xc=function(t,e,i){a.Ql=-1,a.Fl=0,t.frag&&t.frag.sn===Zi?a.hb():a.Lf();var n=a.Ll[t.frag.level],r=xe(Ne.SUCCESS,t,i,null==n?void 0:n.qualityType,null==n?void 0:n.codec);a.Ai.emit(S.a.DOWNLOAD,r),a.Ci.i(qi,"["+a.Rl+"]frag loaded. "+t.frag.sn),"string"!=typeof e&&(t.frag&&t.frag.sn===Zi&&e?(t.frag.data=new Uint8Array(e),a.Pl=!1,a.ib()):a.rb(t,e,i,!1))},a.Di=function(t,e){t.preferNative&&void 0===a.Do.stat.preferNativeLoader&&(a.Ci.i(qi,"["+a.Rl+"]prefer native loader."),a.Do.stat.preferNativeLoader=!0),a.Pl=!1;var i=a.Ll[t.frag.level];if(a.Ai.emit(S.a.DOWNLOAD,xe(Ne.FAIL,t,e,null==i?void 0:i.qualityType,null==i?void 0:i.codec)),e.fatal&&i)if(a.Gl=!1,a.Ql<0&&(a.Ql=Math.max(0,a.Nl-1)),a.ob(),a.Fl+=t.frag.duration||0,t.frag.sn===Zi||404!==e.code||a.Do.config.maxFragFailSec&&a.Fl>=a.Do.config.maxFragFailSec||a.Jl()){var n=Object(D.e)(D.b.NETWORK_ERROR,D.a.LOAD_ERROR,e.errMessage,{statusCode:e.code,url:t.url.toString()});a.Ai.emit(S.a.ERROR,n)}else a.Nl<i.fragments.length&&(a.Ai.emit(S.a.VIDEO_SEEK,{sec:i.fragments[a.Nl].start}),a.zl())},a.ab=function(t,e){var i=a.Ll[t.frag.level];a.Ai.emit(S.a.DOWNLOAD,xe(Ne.ABORT,t,e,null==i?void 0:i.qualityType,null==i?void 0:i.codec))},a.Rl=e,a.Ai=i,a.Do=n,a.Ci=n.logger,a.Ll=e===l.f.MAIN?n.lctx.levels:n.lctx.audioTracks,a.Ci.i(qi,"["+e+"] constructor"),n.lctx.setLevelIdx(r,a.Rl),n.lctx.setNextIdx(r,a.Rl),a.bl={onLoad:a.sb,onProgress:a.Mc,onEnd:a.xc,onError:a.Di,onAbort:a.ab},a.Zl={connectionTimeout:n.config.connectionTimeout,transmissionTimeout:n.config.transmissionTimeout,maxRetry:n.config.maxRetry,retryDelay:n.config.retryDelay,breakpointContinuation:n.config.breakpointContinuation},a.Wl={connectionTimeout:n.config.keyConnectionTimeout,transmissionTimeout:n.config.keyTransmissionTimeout,maxRetry:n.config.keyLoadingMaxRetry,retryDelay:n.config.keyLoadingRetryDelay},a.O.push(a.Ai.prependListener(S.a.PARSED_DATA,a.$l)),a.Il=new Xi(i,n,e),a.Il.init(),a.O.push(n.evt.on(S.a.HLS_KEY_LOADED,a.ib)),a}u()(e,t);var i=e.prototype;return i.levelUpdated=function(t){if(void 0===t&&(t=!0),this.level&&this.level.hasFrag){var e=this.level.startSN;Number.isFinite(this.Ul)&&this.Ul!==e&&(this.Nl=Math.max(0,this.Nl-(e-this.Ul))),this.Ul=e,this.Il.totalDuration=this.level.totalduration,t&&this.zl()}},i.reset=function(){var t;this.Ci.i(qi,"reset type: "+this.Rl+" frag num: "+(null==(t=this.level)?void 0:t.fragments.length)),this.Nl=0,this.Kl=void 0,this.Ul=0,this.Gl=!1,this.ob(),this.ub(!0)},i.seek=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!0),this.Gl=!1;var n=this.level;if(this.xl=!0,this.Kl=void 0,this.ob(),this.Xl=void 0,n&&n.hasFrag){var r,a,o=this.Do.isLiveShiftKwai2?t-(this.Do.stat.liveShiftOffset||0)/1e3:t,s=0===t?0:yt(o,n.fragments);if(s>=0?this.Nl=s:(this.Nl=0,n.hasFrag&&o>=n.fragments[0].start&&(this.Nl=n.fragments.length-1)),this.ub(!0),this.Ci.i(qi,"["+this.Rl+"]seek: "+t+" "+e+" idx: "+this.Nl+" start: "+(null==(r=n.fragments[this.Nl])?void 0:r.start)+" url: "+(null==(a=n.fragments[this.Nl])?void 0:a.url)),i)if(e)this.Ai.emit(S.a.VIDEO_SEEK,{sec:n.fragments[this.Nl].start||t});else if(this.Do.isLiveShift&&t!==this.Do.currentTime){var u;this.Ai.emit(S.a.VIDEO_SEEK,{sec:e&&(null==(u=n.fragments[this.Nl])?void 0:u.start)||t})}else this.Ai.emit(S.a.VIDEO_SEEK,{sec:t});this.zl()}return t},i.destroy=function(){this.Ci.i(qi,"["+this.Rl+"]destroy"),this.ob(),this.Il&&this.Il.destroy(),this.Yl&&(this.Yl.destroy(),this.Yl=void 0),this.Kl=void 0,t.prototype.destroy.call(this)},i.nextBackup=function(){if(this.Ci.i(qi,"["+this.Rl+"]next backup."),this.Ll)for(var t=0;t<this.Ll.length;t++){var e=this.Ll[t];if(e.urlId>=e.url.length-1)return!1;e.urlId++,delete e.m3u8Slice,e.fragments=[]}return this.ob(),this.Vl=!0,this.Ql>=0&&(this.Nl=this.Ql),this.ub(!0),!0},i.setDownloadEnabled=function(t,e){void 0===e&&(e=!0),!this.xl&&t?(this.xl=t,e&&this.zl()):this.xl=t},i.setIndex=function(t){this.Ci.i(qi,"["+this.Rl+"]set index "+t+"."),this.ob(),this.Vl=!0,this.Do.lctx.setLevelIdx(t,this.Rl),this.Do.lctx.setNextIdx(t,this.Rl),this.Kl=void 0},i.setNext=function(t){this.Ci.i(qi,"["+this.Rl+"]set next "+t+"."),this.Vl=!0,this.Do.lctx.setNextIdx(t,this.Rl),this.Gl=!0},i.cb=function(t){return t.maxStartPTS||t.startPTS||t.start},i.fb=function(t){if(this.level&&this.level.hasFrag)return this.level.fragments[t]},i.tb=function(t){var e=this.fb(t);return e?this.cb(e):0},i.ub=function(t){this.Pl=!1,this.Il.reset(t)},i.ob=function(){this.Xl=void 0,this.Lf(),this.hb()},i.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},i.hb=function(){this.Hl&&(this.Hl.destroy(),this.Hl=void 0)},i.Ab=function(t){var e;this.Ci.i(qi,"["+this.Rl+"]load key "+t.sn+"."),!this.Yl&&Vi&&(this.Yl=new Vi(this.Do,{credentials:this.Do.config.credentials,headers:this.Do.config.headers,preferNativeLoader:this.Do.stat.preferNativeLoader},this.Wl)),null==(e=this.Yl)||e.load(t)},i.Jl=function(){var t=this.level;return!!(t&&t.hasFrag&&!t.live&&this.Nl>=t.fragments.length)},i.Tr=function(){var t,e=this.level;return e&&this.Nl<e.fragments.length&&(t=e.fragments[this.Nl]),t&&(t.encrypted&&t.decryptdata&&this.Ab(t),"number"==typeof t.sn&&this.Nl++),t},i.ql=function(t){if(this.Rl===l.f.MAIN&&this.Do.stat.avSeparated&&!1===this.Do.config.videoEnabled){if(this.Vl){this.Ci.i(qi,"["+this.Rl+"]mock load frag. video enabled false");var e=t.start;this.Ai.emit(S.a.NEW_SOURCE,{sync:e}),this.Vl=!1}}else if((this.Rl!==l.f.AUDIO||!1!==this.Do.config.audioEnabled)&&t){var i,n,r={url:t.url,responseType:"arraybuffer",progress:t.sn!==Zi&&this.Rl===l.f.MAIN&&this.Do.streamingMux,frag:t,type:"frag",credentials:this.Do.config.credentials,headers:this.Do.config.headers,preferNative:this.Do.stat.preferNativeLoader},a=t.byteRangeStartOffset,o=t.byteRangeEndOffset;if(Number.isFinite(a)&&Number.isFinite(o)&&(r.rangeStart=a,r.rangeEnd=o,r.rangeType=this.Do.config.httpRangeType),null!=(i=this.Do.config.preprocessUrl)&&i.stream&&(this.Ci.d(qi,"["+this.Rl+"]preprocessUrl stream."),r.url=null==(n=this.Do.config.preprocessUrl)?void 0:n.stream(r.url)),t.sn===Zi)r.progress=!1,this.hb(),this.Hl=new dt(this.Ci),this.Hl.load(r,this.bl,this.Zl);else if(this.Lf(),this.vf=new dt(this.Ci),this.vf.load(r,this.bl,this.Zl),this.Pl=!0,this.Rl===l.f.MAIN&&this.Vl){var s=t.start;this.Ai.emit(S.a.NEW_SOURCE,{sync:s}),this.Vl=!1}}},i.rb=function(t,e,i,n){if(this.eb(t.frag,this.Ll[t.frag.level])){if(this.Xl){this.lb(t,e,i,n);var r=this.Xl.data.get(this.Xl.data.unreadLen);this.Xl=void 0,r&&(e=r)}this.nb(t,e,i,n)}else this.Xl?this.lb(t,e,i,n):(this.Xl={context:t,stats:i,data:new Bi.a,progress:n},e&&this.Xl.data.put(new Uint8Array(e)))},i.lb=function(t,e,i,n){this.Xl&&(this.Xl.context=t,this.Xl.stats=i,this.Xl.progress=n,e&&this.Xl.data.put(new Uint8Array(e)))},i.eb=function(t,e){return!(t.encrypted&&t.decryptdata&&!t.decryptdata.key||null!=e&&e.initSegment&&!e.initSegment.data)},i.nb=function(t,e,i,n){var r;this.Ci.i(qi,"start demux");var a=this.Ll[t.frag.level],o={context:t,data:e,initData:null==a||null==(r=a.initSegment)?void 0:r.data,stats:i,audioCodec:null==a?void 0:a.audioCodec,videoCodec:null==a?void 0:a.videoCodec,remuxContiguous:!!(this.Gl||null!=a&&a.live),progress:n},s=this.level;this.Do.isLiveShiftKwai2&&s&&"number"==typeof t.frag.sn&&this.Do.liveTime&&"number"==typeof this.Do.stat.liveShiftOffset&&this.Do.stat.liveShiftOffset>=0&&(t.frag.programDateTime?o.liveShiftOffset=(t.frag.programDateTime-this.Do.stat.liveStartTime)/1e3:o.liveShiftOffset=(this.Do.stat.liveShiftOffsetAligned||this.Do.stat.liveShiftOffset)/1e3),n?this.Il.onFragProgress(o):this.Il.onFragLoaded(o)},o()(e,[{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(t){if(this.Rl===l.f.MAIN){var e=this.level;if(null!=e&&e.hasFrag){var i=yt(this.Do.currentTime+(e.targetduration||5)/2,e.fragments)+1;if(i>0&&i<e.fragments.length){i<this.Nl&&(this.ob(),this.ub(!1),this.Nl=i,this.Gl=!1),this.Vl=!0,this.Do.lctx.setNextIdx(t,this.Rl);var n=e.fragments[this.Nl];if(!n)return this.Ci.i(qi,"set nextLevel failed. no frag @"+this.Nl),void this.Ai.emit(S.a.LEVEL_SWITCH_FAILED);var r=this.cb(n);return this.Ai.emit(S.a.LEVEL_SWITCHING,{id:0,time:r,level:t,smooth:!0,auto:!1}),(this.Kl&&this.Kl.frag.sn!==n.sn||!this.Kl)&&(this.Kl={level:this.Do.lctx.getLevelIdx(this.Rl),pos:this.Nl,frag:n,alignPTS:r}),this.Ai.emit(S.a.BUFFER_CLEANING,{startSec:this.Kl.alignPTS||r}),void this.zl()}}this.Ci.i(qi,"set nextLevel failed. no frag"),this.Ai.emit(S.a.LEVEL_SWITCH_FAILED)}}},{key:"type",get:function(){return this.Rl}},{key:"lastLoadedFrag",get:function(){var t=this.Nl;return this.vf&&t--,this.fb(t)}}])}(h.a),$i=function(){function t(t,e){var i=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(!(i.index<0)){var t=i.level;if(i.xl&&t&&!i.vf){var e=i.Tr();e&&i.ql(e)}}},this.xc=function(t,e,n){i.Lf();var r=i.Do.lctx.subtitleTracks[t.frag.level],a=xe(Ne.SUCCESS,t,n,r.qualityType);i.Ai.emit(S.a.DOWNLOAD,a),e&&"string"!=typeof e&&(r&&r.hasFrag&&1===r.fragments.length&&!r.live&&-1===i.bb.indexOf(t.frag.level)&&i.bb.push(t.frag.level),i.Ai.emit(S.a.SUBTITLE_LOADED,{data:e,cc:t.frag.cc,start:t.frag.start})),i.zl()},this.Di=function(t,e){var n;i.Ai.emit(S.a.DOWNLOAD,xe(Ne.FAIL,t,e,null==(n=i.Do.lctx.subtitleTracks[t.frag.level])?void 0:n.qualityType)),i.Lf(),i.zl()},this.Ai=t,this.Do=e,e.lctx.subtitleIdx=e.lctx.subtitleTracks.reduce((function(t,e,i){return e.default?i:t}),-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 e=t.prototype;return e.levelUpdated=function(){if(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.zl()}},e.seek=function(t){if(this.index<0)return 0;var e=this.level;if(-1!==this.bb.indexOf(this.index))return t;if(this.xl=!0,e&&e.hasFrag){var i=0===t?0:yt(t,e.fragments),n=e.fragments[i];this.vf&&n&&this.vf.context.frag.sn===n.sn&&this.vf.context.frag.level===n.level||(this.Nl=i>=0?i:e.fragments.length-1,this.Lf(),this.zl())}return t},e.setDownloadEnabled=function(t){!this.xl&&t?(this.xl=t,this.zl()):this.xl=t},e.setIndex=function(t){this.Lf(),this.Do.lctx.subtitleIdx=t},e.Tr=function(){var t=this.level;if(t&&t.hasFrag&&this.Nl<t.fragments.length){var e=t.fragments[this.Nl];if(e&&"number"==typeof e.sn)return this.Nl++,e}},e.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},e.ql=function(t){if(t){var e={url:t.url,responseType:"arraybuffer",frag:t,type:"frag",credentials:this.Do.config.credentials,progress:!1,preferNative:this.Do.stat.preferNativeLoader},i=t.byteRangeStartOffset,n=t.byteRangeEndOffset;Number.isFinite(i)&&Number.isFinite(n)&&(e.rangeStart=i,e.rangeEnd=n),this.Lf(),this.vf=new dt(this.Do.logger),this.vf.load(e,this.bl,this.Zl)}},o()(t,[{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 t=this.Nl;if(this.vf&&t--,this.level&&this.level.hasFrag)return this.level.fragments[t]}}])}(),tn="multipart",en=function(t){function e(e){var i;return(i=t.call(this)||this).Ai=void 0,i.pb=void 0,i.Do=void 0,i.Ci=void 0,i.mb=void 0,i.gb=void 0,i.yb=void 0,i._b=void 0,i.Cb=!1,i.Ib=void 0,i.Ob=void 0,i.wb=!1,i.Eb=0,i.jb=function(t){i.pb&&i.pb.onDownload(t),i.mb&&!1!==i.Do.config.videoEnabled&&(i.gb&&i.kb(i.mb,i.gb),i.Ob&&i.kb(i.mb,i.Ob))},i.Mb=function(t){i.gb&&i.gb.seek(t.startSec,!1,!1)},i.kd=function(){i.Ci.i(tn,"on manifest loaded");var t=i.Do,e=t.lctx;if(t.stat.avSeparated=!!t.lctx.audioTracks.length,i.Ci.i(tn,"manifest loaded. av separated: "+t.stat.avSeparated),e.audioTracks&&e.audioTracks.length&&(i.gb=new Ji(l.f.AUDIO,i.Ai,t,e.audioIdx)),e.subtitleTracks&&e.subtitleTracks.length&&$i&&(i.Ob||(i.Ob=new $i(i.Ai,t)),i.Sb()),e.levels.length>0){var n;i.Ci.i(tn,"manifest",e.abr,e.default),n=i.pb&&e.abr?i.pb.init()||0:e.default,i.mb=new Ji(l.f.MAIN,i.Ai,t,n),i.Ai.emit(S.a.MANIFEST_PARSED,{levels:[],currentLevel:0}),i.pb&&i.Do.lctx.abr&&i.mb.setIndex(i.pb.abrInitLevel),i.Cb=!0;var r,a=t.lctx.current;if(!a)return;if(a.hasFrag){if(t.stat.isLive=a.live,i.Bb(a),i.Tb(a),i.Db(l.f.MAIN),a.live){var o=ve(null,a,0);i.yb=setTimeout((function(t){return i.Rb(t,l.f.MAIN)}),o,i.mb.index)}}else i.Rb(t.lctx.currentIdx,l.f.MAIN);i.gb&&t.lctx.audioTracks.length&&(null!=(r=t.lctx.audio)&&r.hasFrag?(i.Db(l.f.AUDIO),a.live&&i.Rb(t.lctx.audioIdx,l.f.AUDIO)):i.Rb(t.lctx.audioIdx,l.f.AUDIO))}else e.levels.length?i.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.MANIFEST_PARSING_ERROR,"manifest parsing error. core: mse mulitpart.")):i.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.UNSUPPORTED,"no supported codec"))},i.Lb=function(t){i.Nb(t,l.f.AUDIO)},i.Qb=function(t){i.Nb(t,l.f.SUBTITLE)},i.Nb=function(t,e){void 0===e&&(e=l.f.MAIN),i.Ci.i(tn,"on level loaded. type: "+e+" level: "+t.level);var n=t.level,r=i.Do,a=i.xb(e);if(a&&a.level&&n===a.index){var o=a.level,s=t.details;if((e===l.f.MAIN&&void 0===r.stat.isLive||r.stat.isLive&&!s.live)&&(r.stat.isLive=s.live),r.stat.isLive){var u=ve(o,t.details,t.stats?t.stats.trequest:0);if(o.hasFrag)if(s.endSN!==o.endSN)_e(i.Ci,o,s,r.stat.liveShiftType),i.Db(e,s.startSN),i.Eb=0;else{if(i.Ci.i(tn,"level no update. retry: "+i.Eb+"/"+r.config.levelNoUpdateRetry),i.Eb>=r.config.levelNoUpdateRetry)return void i.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.LEVEL_NO_UPDATE_ERROR,i.Do.stat.box+" level no update retry: "+i.Eb+"/"+r.config.levelNoUpdateRetry));i.Eb++}else i.Bb(s),_e(i.Ci,o,s,r.stat.liveShiftType),i.Tb(o),i.Db(e,s.startSN);i.Ci.v("live playlist, reload in "+Math.round(u)+" ms"),r.isLiveShiftKwai2?i.Vb(a,u):i.Ub(e,a.index,u)}else i.Fb(),_e(i.Ci,o,s,r.stat.liveShiftType),i.Db(e,s.startSN)}},i.Vb=function(t,e){if(t||(t=i.xb(l.f.MAIN)),t){var n=i.Do.getKwai2LiveShiftReloadInterval();("number"!=typeof n||n<=0)&&(n="number"!=typeof e||e<=0?ve(null,t.level,null):e),i.Ci.i(tn,"load level delay: "+n+" default: "+e),i.Ub(l.f.MAIN,t.index,n)}},i.Ub=function(t,e,n){i.Fb(),i.yb=setTimeout((function(e){return i.Rb(e,t)}),n,e)},i.Db=function(t,e){void 0===t&&(t=l.f.MAIN),void 0===e&&(e=0);var n=i.xb(t),r=i.Do,a=r.stat;if(n&&n.level&&n.level.hasFrag){n.setDownloadEnabled(!0,!1);var o=n.level.getTimeInfoAfter(e);if(t===l.f.MAIN){if(r.isLiveShiftKwai2&&"number"==typeof r.stat.liveShiftOffset){var s=r.lctx.current.fragments,u=r.getLiveShiftKwai2OffsetUTC(r.stat.liveShiftOffset);if("offset"===a.liveShiftKwai2Params.paramName&&s.length)for(var c=function(t){var e=s[t],n=e.programDateTime;if(n&&a.liveShiftOffset&&u>=n&&u<=n+1e3*e.duration){if(a.liveShiftOffsetAligned=a.liveShiftOffset-(u-n),i.Ci.i(tn,"liveshift kwai2. align offset: "+a.liveShiftOffset+" -> "+a.liveShiftOffsetAligned+", i: "+t+"/"+s.length),(t=Math.min(t,s.length-2))>0){var r=s[0];s.forEach((function(t){t.start-=r.start}))}return h=t,1}h=t},h=0;h<s.length&&!c(h);h++);}t===l.f.MAIN&&(a.liveShiftKwai2Params.paramName="seqId"),i.Ai.emit(S.a.LEVEL_UPDATED,o)}else t===l.f.AUDIO&&i.Ai.emit(S.a.AUDIO_TRACK_UPDATED,o);var d=!n.level.live||r.isLiveShift,f=d&&a.startFromSec>=0;n.levelUpdated(!f),d&&(i.Ci.i(tn,"start from "+a.startFromSec+" on level update"),f&&i.seek(a.startFromSec,i._b,!1,!0),t===l.f.SUBTITLE&&n.seek(r.currentTime))}},i.Pb=function(t){if(i.pb&&i.Do.lctx.abr&&i.mb){var e=i.pb.nextBitrateIndex();e>=0&&e!==i.Do.lctx.currentIdx&&(i.Ai.emit(S.a.LEVEL_SWITCHING,{id:0,time:t.startSec,level:e,smooth:!0,auto:!0}),i.setNextLevel(e))}},i.kb=function(t,e){var i=t.lastLoadedFrag,n=e.lastLoadedFrag;i?n&&(n.start+n.duration>i.start+i.duration-.5?e.setDownloadEnabled(!1):e.setDownloadEnabled(!0)):e.setDownloadEnabled(!0)},i.xb=function(t){return void 0===t&&(t=l.f.MAIN),t===l.f.MAIN?i.mb:t===l.f.AUDIO?i.gb:i.Ob},i.Hb=function(t){return void 0===t&&(t=l.f.MAIN),t===l.f.MAIN?i.Do.lctx.levels:t===l.f.AUDIO?i.Do.lctx.audioTracks:i.Do.lctx.subtitleTracks},i.Ai=e.evt,i.Do=e,i.Ci=e.logger,i._b=e.config.startFromKeyframe,i.Yb(),i.O.push(e.fallback.register(O.USE_BACKUP_MULTIPART,new le(e).setRetryFunc(i.nextBackup.bind(i)))),i}u()(e,t);var i=e.prototype;return i.Yb=function(){var t=this,e=this.Ai;this.O.push(e.prependListener(S.a.RATE_CHANGE,(function(){t.Do.isLiveShiftKwai2&&(t.Ci.i(tn,"liveshift kwai2 reload Interval change by playback rate change."),t.Vb())})),e.prependListener(S.a.DOWNLOAD,this.jb),e.prependListener(S.a.BUFFER_CLEANING,this.Mb),e.prependListener(S.a.MANIFEST_LOADED,this.kd),e.prependListener(S.a.LEVEL_LOADED,this.Nb),e.prependListener(S.a.AUDIO_TRACK_LOADED,this.Lb),e.prependListener(S.a.SUBTITLE_TRACK_LOADED,this.Qb),e.prependListener(S.a.ABR_NEXT,this.Pb),e.prependListener(S.a.NEW_SOURCE,(function(){var e;null==(e=t.pb)||e.onNewSource()})))},i.init=function(){this.Gb();var t=Ui[this.Do.stat.box||l.i.hls];t?this.Ib=new t(this.Do):this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.UNSUPPORTED,"unsupported box: "+this.Do.stat.box))},i.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),t.prototype.destroy.call(this)},i.loadSource=function(){this.Ci.i(tn,"load source"),this.Ib&&this.Ib.loadManifest()},i.setDownloadEnabled=function(t){void 0===t&&(t=!0),this.Do.stat.isNetworkInUse=t,this.mb&&this.mb.setDownloadEnabled(t),this.pb&&this.pb.setDownloadEnabled(t)},i.isSeekable=function(){return!this.Do.stat.isLive||this.Do.stat.liveShiftType!==l.g.NONE},i.seek=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=!1),this.Ci.i(tn,"seek time: "+t+" key: "+e+" inbuf: "+i),this.pb&&this.pb.onSeek({isInBuffer:i});var r=this.Do,a=r.stat;if(i){var o=this.xb(l.f.MAIN);r.isLiveShiftKwai2&&(this.Ci.i(tn,"liveshift kwai2 reload Interval change by seek."),this.Vb(o))}if(!i&&this.mb){if(this.mb.level&&this.mb.level.hasFrag){if(this.Ci.i(tn,"seek: "+t+"."),!this.gb)return!r.isLiveShiftKwai2||bt(t-(a.liveShiftOffset||0)/1e3,this.mb.level.fragments)||n?(this.mb.seek(t,e),this.Ob&&this.Ob.seek(t),void(a.startFromSec=-1)):(this.Kb(t),void this.Rb(this.Do.lctx.currentIdx,l.f.MAIN));if(this.gb.level&&this.gb.level.hasFrag&&!this.gb.level.live){var s=this.mb.seek(t,e);return this.gb.seek(s,!1,!1),this.Ob&&this.Ob.seek(s),void(a.startFromSec=-1)}}this.Ci.i(tn,"no frag. startFromSec: "+t),a.startFromSec=t,this._b=e}},i.nextBackup=function(){if(this.mb){var t=this.mb.nextBackup();if(this.gb&&t&&(t=this.gb.nextBackup()),t)return this.mb.setDownloadEnabled(!1),this._b=!1,this.Rb(this.Do.lctx.currentIdx,l.f.MAIN),this.gb&&(this.gb.setDownloadEnabled(!1),this.Rb(this.Do.lctx.audioIdx,l.f.AUDIO)),!0}return!1},i.onAbrLevelsUpdated=function(){this.pb&&this.pb.onAbrLevelsUpdated()},i.setAudioTrack=function(t){var e;this.gb&&(t=Math.min(t,this.gb.levels.length-1),this.gb.setIndex(t),this.Cb&&(null!=(e=this.Do.video)&&e.ended||this.seek(this.Do.currentTime),this.Zb(t,l.f.AUDIO),this.Ai.emit(S.a.AUDIO_TRACK_SWITCHING,{id:0,time:this.Do.currentTime,level:t,smooth:!1,auto:!1})))},i.setSubtitleTrack=function(t){this.Ob&&(t=Math.min(t,this.Ob.levels.length-1),this.Ob.setIndex(t),this.Cb&&t>=0&&(this.Zb(t,l.f.SUBTITLE)||this.Ob.seek(this.Do.currentTime)))},i.Rb=function(t,e){var i=this.Hb(e);if(this.Ci.i(tn,"load level: "+t+" "+e),i.length){var n=i[t];n&&"object"==typeof n&&n.url.length>0&&this.Ib&&y(this.Do.stat.box)?this.Ib.loadLevel(n,e,t):this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.UNSUPPORTED,"unsupported. "+this.Do.stat.box+" has no level manifest."))}},i.Fb=function(){void 0!==this.yb&&(clearTimeout(this.yb),this.yb=void 0)},i.Gb=function(){this.Do.config.adaptive&&!this.pb&&(this.pb=new je(this.Do))},i.setCurrentLevel=function(t){var e,i;t>=0?(this.Wb(!1),this.mb&&(t=Math.min(t,this.mb.levels.length-1),this.Kb(this.Do.currentTime),this.mb.setIndex(t),this.Ci.i(tn,"setCurrentLevel: "+t+" manifest: "+this.Cb+" video ended:"+(null==(e=this.Do.video)?void 0:e.ended)+", currentTime:"+this.Do.currentTime),this.Cb&&(null!=(i=this.Do.video)&&i.ended||this.seek(this.Do.currentTime),this.Zb(t),this.Ai.emit(S.a.LEVEL_SWITCHING,{id:0,time:this.Do.currentTime,level:t,smooth:!1,auto:!1})))):this.Wb(!0)},i.setManualNextLevel=function(t){var e;this.Wb(t<0),this.Cb?null!=(e=this.mb)&&e.level&&this.mb.level.hasFrag&&t>=0&&(t=Math.min(t,this.mb.levels.length-1),this.mb.manualNext=t,this.Zb(t)||this.setDownloadEnabled(!0)):this.setCurrentLevel(t)},i.setNextLevel=function(t){this.mb&&this.Do.lctx.nextIdx!==t&&(this.mb.setNext(t),this.Zb(t))},i.Kb=function(t){if(this.Do.isLiveShiftKwai2){var e,i=this.Do,n=i.stat;i.lctx.clearFrag(),null==(e=this.mb)||e.reset(),n.liveShiftKwai2Params.paramName="offset",n.liveShiftOffset=1e3*t,n.liveShiftOffsetAligned=void 0,n.startFromSec=t,this.Eb=0,this.Ci.i(tn,"liveshift kwai2 reset",t)}},i.Zb=function(t,e){void 0===e&&(e=l.f.MAIN);var i=this.xb(e),n=null==i?void 0:i.levels[t];return!(!n||n.hasFrag&&!n.live||(i.setDownloadEnabled(!1),this.Rb(t,e),0))},i.Wb=function(t){this.pb&&(t&&!this.Do.lctx.abr&&this.Do.isAbrAvailable&&this.Ai.emit(S.a.LEVEL_SWITCHING,{id:0,time:this.Do.currentTime,level:-1,smooth:!0,auto:!1}),this.Do.lctx.abr=t&&this.Do.isAbrAvailable)},i.Sb=function(){if(!this.wb&&this.Ob){var t=this.Do.lctx.subtitle;t&&(t.hasFrag?this.Db(l.f.SUBTITLE):this.Rb(this.Do.lctx.subtitleIdx,l.f.SUBTITLE)),this.wb=!0}},i.Bb=function(t){if(this.Do.stat.isLive){var e=this.Do.config.liveDelayFragNum;if(e&&e>0&&!this.Do.config.autoPlaybackRateConf){var i=this.Do.getLiveDelay()/I.f;ge(this.Ci,i,i/2,this.Do.stat.autoPlaybackRateConf,0)}}},i.Tb=function(t){var e=this.Do;if(!e.stat.isLive||e.isLiveShift){if(e.stat.isLive&&!e.isLiveShiftKwai2)if(e.stat.startFromSec<0&&t.totalduration){var i=e.liveLocalTime;e.stat.liveShiftType===l.g.KWAI&&(i+=t.targetduration+1),i>0&&(e.stat.startFromSec=i,this.Ci.i(tn,"live delay startFromSec: "+e.stat.startFromSec),e.isLiveShift&&e.updateLiveShiftStatuByTime(e.stat.startFromSec))}else e.stat.startFromSec>=0&&e.isLiveShift&&e.updateLiveShiftStatuByTime(e.stat.startFromSec)}else e.stat.startFromSec=-1},o()(e,[{key:"audioTracks",get:function(){return this.gb?this.gb.levels:[]}}])}(h.a);function nn(t,e,i){if(void 0===e&&void 0===i)return t;var n=new ct.a(t,!0);return e&&void 0===n.query.kabr_spts&&(n.query.kabr_spts=""+Math.floor(e)),!0===i&&(n.query.onlyaudio="yes"),n.toString()}var rn,an,on=i(15),sn=function(t){return t[t.tagType=0]="tagType",t[t.tagSize=1]="tagSize",t[t.timestamp=2]="timestamp",t[t.frameType=3]="frameType",t[t.packetType=4]="packetType",t}(sn||{}),un="flv-key-detector",cn=function(){function t(t){this.Do=void 0,this.Ci=void 0,this.Nl=0,this.Xb=void 0,this.zb=new Uint8Array(on.e),this.Jb=0,this.qb=sn.tagType,this.$b=0,this.tp=0,this.ep=0,this.np=0,this.sp=0,this.rp=0,this.hp=[],this.Do=t,this.Ci=t.logger,this.reset()}var e=t.prototype;return e.reset=function(){this.Ci.i(un,"reset"),this.Nl=on.e,this.Xb=void 0,this.zb=new Uint8Array(on.e),this.Jb=0,this.qb=sn.tagType,this.$b=0,this.tp=3,this.ep=0,this.np=4,this.sp=0,this.rp=0,this.hp=[]},e.append=function(t){if(!1===this.Xb)return[];if(void 0===this.Xb&&(t.length+this.Jb>=on.e?(this.zb.set(t.subarray(0,on.e-this.Jb),this.Jb),this.Jb=on.e,this.Xb=70===this.zb[0]&&76===this.zb[1]&&86===this.zb[2],this.Ci.i(un,"get header: "+this.Xb)):(this.zb.set(t,this.Jb),this.Jb+=t.length)),this.Nl>t.byteLength)return this.Nl-=t.byteLength,[];this.hp=[];for(var e=this.Nl,i=0;e<t.byteLength;)switch(this.qb){case sn.tagType:this.sp=t[e],this.$b=0,this.tp=3,i=e,e++,this.qb=sn.tagSize;break;case sn.tagSize:if(this.$b=this.$b+(t[e]<<8*(this.tp-1)),this.tp--,e++,this.tp>0)break;this.sp===on.j.VIDEO?(this.ep=0,this.np=4,this.qb=sn.timestamp):(e+=7+this.$b+4,this.qb=sn.tagType);break;case sn.timestamp:this.ep+=1===this.np?t[e]<<24:t[e]<<8*(this.np-2),this.np--,e++,0===this.np&&(e+=3,this.rp=0,this.qb=sn.frameType);break;case sn.frameType:this.rp=t[e]>>4,e++,this.qb=sn.packetType;break;case sn.packetType:1===this.rp&&1===t[e]&&this.hp.push({timestamp:this.ep,pos:i}),e+=this.$b-1+4,this.qb=sn.tagType}return this.Nl=e-t.byteLength,this.hp},o()(t,[{key:"isFlv",get:function(){return this.Xb}},{key:"header",get:function(){return this.Xb?this.zb:void 0}}])}(),ln=i(46),hn=i(4),dn=function(t){return t[t.flvHeader=0]="flvHeader",t[t.scriptData=1]="scriptData",t[t.audio=2]="audio",t[t.video=3]="video",t[t.seliceSeq=4]="seliceSeq",t}(dn||{}),fn="kwai-slice",pn=function(){function t(t){this.Ci=void 0,this._t=new Bi.a,this.op=[],this.Wv=this.ap(),this.up=0,this.Ci=t}var e=t.prototype;return e.reset=function(){this.Ci.i(fn,"reset"),this._t.clear(),this.op=[],this.Wv=this.ap(),this.up=0},e.append=function(t){for(this._t.put(new Uint8Array(t));this._t.unreadLen>=(this.Wv.bodyLen||15);)this.Wv.bodyLen?this.cp():this.fp();var e=this.op.reduce((function(t,e){var i;return((null==(i=e.data)?void 0:i.byteLength)||0)+t}),0);if(e){var i=new Uint8Array(e),n=0;return this.op.forEach((function(t){t.data&&(i.set(t.data,n),n+=t.data.byteLength)})),this.op=[],i.buffer}},e.fp=function(){if(this._t.unreadLen>=15){var t=this._t.get(15);if(!t)throw new Error(fn+" read slice_header fail");var e=this.Wv;if(e.bodyLen=(t[0]<<4)+(t[1]>>4)-15,e.type=15&t[1],e.sliceSeq=Object(hn.i)(t,2),e.segmentId=Object(hn.h)(t,10),e.posFlag=t[14]>>6,e.frameType=t[14]>>4&3,e.extended=1&t[14],e.bodyLen<=0)throw this.Wv=this.ap(),new Error(fn+" slice body len: "+e.bodyLen)}},e.cp=function(){var t=this.Wv;if(t.bodyLen&&this._t.unreadLen>=t.bodyLen){var e=this._t.get(t.bodyLen);if(!e)throw new Error(fn+" read slice_body fail");var i=0;t.extended&&(i+=Object(hn.f)(e));var n=e.subarray(i);e.length>3&&70===e[i]&&76===e[i+1]&&86===e[i+2]&&(this.up>0&&(n=n.subarray(13)),this.up++),t.data=n,this.op.push(t),this.Wv=this.ap()}},e.ap=function(){return{bodyLen:0,type:dn.flvHeader,sliceSeq:0,segmentId:0,posFlag:0,frameType:0,extended:0}},t}(),_n="media-loader",vn=function(){function t(t,e){var i=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=I.e,this._p=function(t,e){i.bl.onLoad&&i.bl.onLoad(t,e)},this.Cp=function(t,e){i.Ip(e),!i.mp&&i.bl.onConnect&&i.bl.onConnect(t,e),i.mp=!0},this.Op=function(t,e,n){var r;"string"!=typeof e&&(i.pp+=e.byteLength,!t.rangeEnd&&i.pp>=i.yp&&!1===i.Do.stat.isLive&&(!i.Ap||i.Ap&&i.pp<i.Ap)&&(null==(r=i.vf)||r.abort(),i.Lf(),i.lp=i.pp,i.wp()),i.Ep(t,e,n))},this.jp=function(t,e){i.bl.onAbort&&i.bl.onAbort(t,e),i.Lf()},this.Yf=function(t,e){e.fatal&&(i.Lf(),i.Do.stat.isNetworkInUse=!1),t.preferNative&&void 0===i.Do.stat.preferNativeLoader&&(i.Ci.i(_n,"load error. prefer native loader."),i.Do.stat.preferNativeLoader=!0),416===e.code&&(!i.Ap||t.rangeEnd&&t.rangeEnd>=i.Ap)?(i.Ci.i(_n,"416 end"),i.wl=!0,i.Lf(),i.kp(t,null,e)):i.bl.onError&&i.bl.onError(t,e)},this.pl=function(t,e,n){if(t.range&&i.bl.onRangeEnd&&i.bl.onRangeEnd(t,n),i.Ip(n),i.Lf(),"string"!=typeof e){var r=(null==e?void 0:e.byteLength)||0;!i.Do.stat.isLive&&e&&i.Ep(t,e,n),(!t.range||"number"==typeof t.rangeStart&&t.rangeEnd&&t.rangeEnd-t.rangeStart>i.pp+r||i.Ap&&t.rangeEnd&&t.rangeEnd>=i.Ap)&&(i.Ci.i(_n,"end true"),i.wl=!0),i.wl||i.Do.stat.isLive?(n.fatal&&(i.Do.stat.isNetworkInUse=!1),i.kp(t,null,n)):(t.rangeEnd&&(i.lp=t.rangeEnd),i.wp())}},this.bl=t,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===l.i.yuv&&e.yuvParams?this.yp=e.yuvParams.dataSize:this.yp=this.Do.src instanceof Blob?I.c:I.e,this.Do.src instanceof Blob&&(this.Do.loadRec.contentLen=this.Ap=this.Do.src.size),E.a.version&&(this.gp="chrome"===E.a.name&&E.a.version.major>=99),this.Ci.i(_n,"without preflight: "+this.gp+"; range size: "+this.yp,this.Ap),this.updateConfig()}var e=t.prototype;return e.load=function(t){this.Ci.i(_n,"load"),this.Lf(),this.mp=!1,this.wl=!1,this.wc=t,Ie(t.url)||t.fileName&&Ie(t.fileName)?(this.Ci.i(_n,"kwai slice"),this.Do.stat.isKwaiSlice=!0,this.dp?this.dp.reset():this.dp=new pn(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()},e.seek=function(t){var e;this.Ci.i(_n,"seek time:"+t.time+", pos:"+t.position),null==(e=this.vf)||e.abort(),this.Lf(),this.bp=!0,this.Nl=t,this.wl=!1,this.wp()},e.updateConfig=function(){var t=this.Do;this.Ci.i(_n,"update loader config"),this.YA.maxRetry=t.stat.isLive?0:t.config.maxRetry,this.YA.retryDelay=t.stat.isLive?0:t.config.retryDelay,this.YA.breakpointContinuation=!(t.stat.box===l.i.flv&&t.stat.isLive)&&t.config.breakpointContinuation},e.destroy=function(){this.Lf()},e.ended=function(){return this.wl},e.setDownloadEnabled=function(t){void 0===t&&(t=!0),this.bp!==t&&(this.bp=t,t&&!this.vf&&this.wp())},e.wp=function(){var t;if(!1!==this.bp&&!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,i=this.wc;this.Do.stat.isLive||(this.wc.progress=this.Do.streamingMux,i.rangeStart=this.lp,i.rangeEnd=(Math.floor(this.lp/this.yp)+1)*this.yp,i.rangeType=this.Do.config.httpRangeType,this.Gf(i)),this.Do.stat.isNetworkInUse=!0,this.pp=0,null!=(t=this.Do.config.preprocessUrl)&&t.stream&&(this.Ci.d(_n,"preprocessUrl stream"),i.url=null==(e=this.Do.config.preprocessUrl)?void 0:e.stream(i.url)),this.vf=new dt(this.Ci),this.vf.load(i,this.vp,this.YA)}else this.Do.stat.isNetworkInUse=!1},e.Lf=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},e.Ep=function(t,e,i){if(this.bl.onProgress)if(this.Do.stat.isKwaiSlice){var n=this.Mp(t,e,i);n&&this.bl.onProgress(t,n,i)}else this.bl.onProgress(t,e,i)},e.kp=function(t,e,i){if(this.Do.stat.isKwaiSlice&&e){var n=this.Mp(t,e,i)||null;this.bl.onEnd(t,n,i)}else this.bl.onEnd(t,e,i)},e.Mp=function(t,e,i){if(this.Do.stat.isKwaiSlice&&this.dp)try{return this.dp.append(new Uint8Array(e))}catch(e){i.fatal=!0,i.errName=d.b.SLICE_UNPACK_ERROR_NAME,i.errMessage=e.message,this.bl.onError&&this.bl.onError(t,i)}},e.Gf=function(t){t.rangeEnd&&this.Ap&&t.rangeEnd>this.Ap&&(this.wl=!0)},e.Ip=function(t){!this.Ap&&t.contentTotalLength&&(this.Do.loadRec.contentLen=this.Ap=t.contentTotalLength)},t}(),An=function(){function t(t){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,i,n){e.an&&(e.an.firstPackageDuration=n.tfirst?n.tfirst-n.trequest:0,e.an.loaded=n.loaded)},this.Yf=function(){e.an&&(e.an.succeeded=!1),e.Dp()},this.pl=function(){e.Dp()},this.Ci=t,this.Sp={connectionTimeout:0,transmissionTimeout:0,maxRetry:0,retryDelay:0},this.Bp={onProgress:this.Mc,onError:this.Yf,onEnd:this.pl}}var e=t.prototype;return e.start=function(t,e){this.wc=t,this.bl=e,this.an={loaded:0,duration:0,firstPackageDuration:0,succeeded:!0},this.Tp=performance.now(),this.vf&&this.vf.destroy();var i=Math.min(1e4,t.timeout);this.Sp.connectionTimeout=i;var n={url:t.url,progress:!0,responseType:"arraybuffer",preferNative:t.preferNativeLoader};this.vf=new dt(this.Ci),this.Rp(i),this.vf.load(n,this.Bp,this.Sp)},e.cancel=function(){this.Rf(),this.vf&&this.vf.destroy()},e.destroy=function(){this.cancel()},e.Rp=function(t){var e=this;this.yb=setTimeout((function(){return e.Dp()}),t)},e.Rf=function(){clearTimeout(this.yb)},t}(),gn="algorithm-simple",mn={stableBufferDiffThresholdSecond:.15,stableBufferIntervalMs:2e3,speedTestTimeoutMs:500,generateSpeedGapMs:3e3,bufferCheckIntervalMs:500,smoothedSpeedUtilizationRatio:.8,smallSpeedToBitrateRatio:.7,enoughSpeedToBitrateRatio:.9,bufferLowerLimitSecond:.8,recentBufferedSize:16,smoothedSpeedRatio:.9,isSpeedFullyUsed:!1},bn=function(){function t(t){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=t,this.Ci=t.logger,this.xp=new An(t.logger)}var e=t.prototype;return e.init=function(t){var e=this;this.Fi=r()({},mn),r()(this.Fi,t),this.Ci.i(gn,"init",t,this.Fi),this.Lp=[0],this.yb=setInterval((function(){e.Pp()}),this.Fi.bufferCheckIntervalMs)},e.onManifestUpdated=function(){this.Ll=this.Do.lctx.abrLevels.slice(0),this.Np=this.Do.lctx.abrDefault},e.onKeyPoint=function(t){var e=t.byteLength/Math.max(t.spendTime,.05)*8/1024;this.Ci.i(gn,"buffered: "+t.byteLength.toFixed(2)+", size: "+t.byteLength+", time: "+t.spendTime.toFixed(2)),this.Np=this._d(e,t.buffered)},e.onLevelLoad=function(t){this.Wv=Math.max(0,t)},e.onSeek=function(){},e.onDownloadEnabled=function(){},e.destroy=function(){this.xp.destroy(),clearInterval(this.yb)},e.Hp=function(t){var e=t-this.Up,i=e/t,n=performance.now();return(e<-this.Fi.stableBufferDiffThresholdSecond||i<-.2)&&(this.Ci.v(gn,"bufferDiffDown: "+e.toFixed(2)+"s, diffRatio: "+i.toFixed(2)),this.Qp=Math.max(n,this.Qp)),e>this.Fi.stableBufferDiffThresholdSecond&&n-this.Qp+this.Fi.bufferCheckIntervalMs>this.Fi.stableBufferIntervalMs&&(this.Qp=Math.max(n-2*this.Fi.bufferCheckIntervalMs,this.Qp+2*this.Fi.bufferCheckIntervalMs),this.Ci.v(gn,"bufferDiffUp: "+e.toFixed(2)+"s")),this.Up=t,n-this.Qp>this.Fi.stableBufferIntervalMs},e.Yp=function(){return this.Fi.isSpeedFullyUsed},e.Pp=function(){var t=this.Do.bufferedSec,e=this.Hp(t);if(this.Yp()){var i=this.Ll[this.Wv+1];this.Vp=e&&i?i.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(t),this.Lp.length>this.Fi.recentBufferedSize&&this.Lp.shift()},e.Gp=function(){var t=this;this.Ci.v(gn,"start speed testing on index: "+(this.Wv+1));var e=this.Ll[this.Wv+1];if(e){var i=e.currentUrl,n=this.Do.loadRec.traffic,r=e.bitrate;this.xp.start({url:i,timeout:this.Fi.speedTestTimeoutMs,preferNativeLoader:this.Fi.preferNativeLoader},{onEnd:function(e,i){var a=t.Do.loadRec.traffic-n;if(i.succeeded&&i.duration>0&&i.firstPackageDuration>0){var o=8*(a+i.loaded)/i.duration;t.Ci.v(gn,"testSpeed: "+o.toFixed(0)),o>=r&&(t.Vp=r)}t.Ci.v(gn,"succeeded: "+i.succeeded+", firstPackageDuration: "+i.firstPackageDuration+", originalDownloadSize: "+a+", downloadSize: "+i.loaded+", downloadTime: "+i.duration)}})}},e.Kp=function(t){for(var e=0,i=this.Ll.length-1;i>=0;i--)if(t>=this.Ll[i].bitrate){e=i;break}return e},e._d=function(t,e){var i=this.Od(t,e);return i!=this.Wv&&(this.Qp=performance.now()+this.Fi.generateSpeedGapMs),i<this.Wv?(this.xp.cancel(),this.Vp=0,this.Fp=t,this.Lp=[e]):this.Fp=this.Zp(t),i},e.Zp=function(t){return this.Fp>0?t*(1-this.Fi.smoothedSpeedRatio)+this.Fp*this.Fi.smoothedSpeedRatio:t},e.Wp=function(t){return t+(t-Math.max.apply(Math,this.Lp))},e.Xp=function(t){var e=Math.max.apply(Math,this.Lp),i=1+(t-e)/e,n=this.Ll[this.Wv];return n?i*n.bitrate:0},e.zp=function(t){var e=this.Ll[this.Wv];return!!e&&t/e.bitrate<this.Fi.smallSpeedToBitrateRatio},e.Jp=function(t){var e=this.Ll[this.Wv];return!!e&&t/e.bitrate>this.Fi.enoughSpeedToBitrateRatio},e.Od=function(t,e){var i=this.Xp(e),n=this.Zp(t);this.Ci.v(gn,"gopSpeed: "+t.toFixed(0)+", smoothedSpeed: "+n.toFixed(0));var r=this.Wp(e);this.Ci.v(gn,"bufferSpeed: "+i.toFixed(0)+", predictedBuffered: "+r.toFixed(1));var a=this.Wv;return r<this.Fi.bufferLowerLimitSecond||this.zp(i)?a=Math.min(this.Wv,this.Kp(i)):this.Jp(i)&&(this.Vp>0?(this.Ci.i(gn,"generatedSpeed used"),a=this.Kp(this.Vp),this.Vp=0):a=this.Kp(n*this.Fi.smoothedSpeedUtilizationRatio),a=Math.min(this.Wv+1,Math.max(a,this.Wv))),a},o()(t,[{key:"nextLevel",get:function(){return this.Ci.v(gn,"nextLevel: "+this.Np),this.Np}},{key:"lowProfile",get:function(){return!1}}])}(),yn="single-abr",En=function(){function t(t){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=t,this.Ci=t.logger,t.lctx.abr=t.isAbrAvailable,this.wd=new bn(t)}var e=t.prototype;return e.init=function(){return this.$p=0,this.jd=performance.now(),this.tm=0,this.wd.init(r()({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},e.destory=function(){this.wd&&this.wd.destroy()},e.onAbrLevelsUpdated=function(){this.wd.onManifestUpdated(),this.Ct=this.Do.lctx.abrIndexToOrign(this.wd.nextLevel)},e.onLoaderChunk=function(t){this.$p+=t},e.onLevelLoad=function(t){var e=this.Do.lctx;e.levels.length&&t>=0&&t<e.levels.length&&(this.tm=0,this.jd=performance.now(),this.$p=0,this.Ct=t,this.wd.onLevelLoad(e.orignIndexToAbr(t)))},e.onKeyFrame=function(t){var e=this.Do,i=e.lctx.levels;if(this.tm++,(e.lctx.abr||"number"==typeof this.qp)&&this.tm>1&&i){var n=this.Ct,r=!1,a=performance.now();if(this.wd.onKeyPoint({buffered:e.bufferedSec,byteLength:this.$p,spendTime:(a-this.jd)/1e3}),this.$p=0,this.jd=a,"number"==typeof this.qp)n=this.qp,this.qp=void 0;else{if(!e.lctx.abr||!this.wd)return;n=e.lctx.abrIndexToOrign(this.wd.nextLevel),r=!0}if(n!==this.Ct)return{url:this.getRequestUrl(n,t),level:n,auto:r}}},e.getRequestUrl=function(t,e){var i=this.Do.lctx.levels[t];if(i){var n=i.currentUrl;return this.Do.stat.box===l.i.flv?nn(n,e||this.Do.config.defaultSpts,!1===this.Do.config.videoEnabled):n}return""},o()(t,[{key:"nextLevel",get:function(){return"number"==typeof this.qp?this.qp:this.Ct},set:function(t){var e=this.Do.lctx;this.Ci.i(yn,"next level: "+t),t>=0?(t=Math.min(e.levels.length-1,t),e.setNextIdx(t),e.abr=!1,this.qp=t):-1===t&&(e.abr=this.Do.isAbrAvailable)}},{key:"currentLevel",get:function(){return this.Ct},set:function(t){var e=this.Do.lctx;this.Ci.i(yn,"current level: "+t),t>=0?(t=Math.min(e.levels.length-1,t),e.setLevelIdx(t),e.abr=!1,this.Ct=t):-1===t&&(e.abr=this.Do.isAbrAvailable)}}])}(),Cn=i(35),Tn=i(38),In=i(24),Rn=i(28),wn=i(37),Ln=["mono","4:2:0","4:2:2","4:4:4"],Dn={colorRange:Nt.b.AVCOL_RANGE_JPEG,colourPrimaries:Nt.a.AVCOL_PRI_BT2020,transferCharacteristics:Nt.d.AVCOL_TRC_SMPTEST2084,matrixCoefficients:Nt.c.AVCOL_SPC_BT2020_CL},Sn=function(){function t(t,e,i){this.At=void 0,this.Ai=void 0,this.im=void 0,this.Do=void 0,this.Ci=void 0,this._t=new Bi.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=i,this.Ai=t,this.Do=e,this.Ci=e.logger,this.Qe=new wn.a(e.logger),this.im=new Rn.a,this.De=new Xt.b(e.logger,this.Ai,e.getRemuxConfig(),Qn.TYPE_SUPPORTED,"")}var e=t.prototype;return e.init=function(){var t;this.Ai.emit(S.a.DEMUXER_DETECTED,{type:me.b.YUV}),null==(t=this.Do.cOutput)||t.updateRendererType(l.s.canvas),this.He(0)},e.destroy=function(){this._t.clear(),this.im.removeAllListeners(),this.De.destroy()},e.reset=function(t){this.Ci.i("yuv","reset: "+t),this.wl=!1,this.Hh=-1,this.Qe&&this.Qe.reset(),this.Ve=!1},e.end=function(){this.wl||(this.wl=!0,this.Ai.emit(S.a.LOAD_END,{}))},e.onFragProgress=function(t){this.om(t,!1)},e.onFragLoaded=function(t){this.om(t,!0)},e.updateConfig=function(){},e.updateSuffix=function(){},e.om=function(t,e){if(t.data&&t.data.byteLength){var i=performance.now(),n={progress:t.context.progress,byteLength:t.data.byteLength,timeCost:performance.now()-(this.If||t.stats.trequest),ts:performance.now()};this.If=i,this.Ai.emit(S.a.LOADER_CHUNK_ARRIVAL,n)}var r=t.context.frag,a=this.Mi;if(a)if(this.am(),this.sm){var o=this.sm;if(o){var s=(null==r?void 0:r.start)||0;this.Hh!==s?(this.nm=Math.floor(s/(1/o.fps)),this.Hh=s,this.Ph=!1,this.Yh=!1,this.De.resetInitSegment({duration:this.Vn,remuxId:0})):this.Yh=!0,t.data&&this._t.put(new Uint8Array(t.data)),a.codedWidth||(a.codedWidth=o.width,a.codedHeight=o.height,a.fps=o.fps,a.bitDepth=o.bpp,a.codecType=l.c.rawvideo);for(var u=this.um();u;){var c=Math.floor(this.nm*this.Ah);u.format.pts=c/a.inputTimescale*I.b,this.nm++,a.samples.push({units:[],dts:c,cts:0,pts:c,originDTS:c,originPTS:c,key:!0,yuv:u,duration:this.Ah,size:0}),this.rm++,u=this.um()}this.Do.updateVideoPlaybackQuality(this.rm,0),this.Ke(e),e&&(this.If=0,this.Vn||(this.Vn=this.nm/o.fps,this.Ai.emit(S.a.METADATA,{duration:this.Vn})))}}else this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.PARSING_ERROR,"yuv params error. "+JSON.stringify(this.sm)))},e.He=function(t){this.Mi=Object(Cn.b)(t),this.Mi.active=!0,this.Mi.outputRaw=!0,this.Mi.codec="yuv",this.Ne=Object(Cn.a)(t),In.a.initAudioForFillSilent(this.Ci,this.Ne,this.Do.stat.audioCodec)},e.um=function(){if(this.sm){var t=this.sm.dataSize;if(t)return this._t.unreadLen>=t?this.fm():void 0;this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.REMUX_ERROR,"yuv params error, can not get img size. "+JSON.stringify(this.sm)))}},e.am=function(){if(!this.sm){var t;if(this.sm=this.Do.yuvParams,this.sm&&this.Mi){this.sm.bpp>8&&(this.Mi.colorInfo=Dn);var e={};if(this.Ah=Math.round(this.Mi.inputTimescale/this.sm.fps),this.Mi&&(this.Mi.chromaFormat=Ln[this.sm.chroma]||""),this.Do.loadRec.contentLen){this.hm=[];var i=Math.floor(this.Do.loadRec.contentLen/this.sm.dataSize);this.Vn=e.duration=i/this.sm.fps;for(var n=[],r=0;r<i;r++){var a=r*this.Ah/this.Mi.inputTimescale;this.hm.push({index:r,dts:a,pts:a,duration:this.Ah}),n.push({time:a,position:this.sm.dataSize*r})}e.keyframes=n}this.Ai.emit(S.a.METADATA,e),this.hm&&this.Ai.emit(S.a.VIDEO_FRAME_INFO,{videoFramesInfo:this.hm})}return this.Ai.emit(S.a.VIDEO_CODEC_DETECTED,{decoder:l.d.none,enabled:!0,codecType:l.c.yuv,bitDepth:null==(t=this.sm)?void 0:t.bpp,timeOffset:0}),this.sm}},e.fm=function(){var t=this.sm;if(t){var e=this._t,i=t.bpp>8?2:1,n=e.get(t.width*t.height*i),a=e.get(t.chromaWidth*t.chromaHeight*i),o=e.get(t.chromaWidth*t.chromaHeight*i);return n&&a&&o?{format:r()({},t),y:{bytes:n,stride:t.width*i,bits:t.bpp},u:{bytes:a,stride:t.chromaWidth*i,bits:t.bpp},v:{bytes:o,stride:t.chromaWidth*i,bits:t.bpp}}:void 0}},e.Ke=function(t){void 0===t&&(t=!1);var e=this.Ne,i=this.Mi;if(i&&e)if(this.Qe.update(e,i),0!==e.samples.length||0!==i.samples.length){if(t||!(e.active&&0===e.samples.length||i.active&&i.samples.length<2)){if(this.Ve&&(this.Vn||this.Ai.emit(S.a.KEY_FRAME_INDEXS,{keyframes:[{time:0,position:0}]}),this.Ve=!1,this.Ai.emit(S.a.MEDIA_DEMUX,{type:me.b.YUV})),!this.hm){var n=Object(Tn.a)(i,this.nm-i.samples.length);this.Ai.emit(S.a.VIDEO_FRAME_INFO,{videoFramesInfo:n})}try{this.De.remux(e,i,this.Hh,this.Ph,this.Yh,t),this.Ph=!0}catch(t){this.Ci.i("yuv",t),this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.REMUX_ERROR,t.message))}}}else t&&this.De.flush()},o()(t,[{key:"totalDuration",set:function(t){}},{key:"id",get:function(){return this.At}}])}(),On="single",Nn=function(t){function e(e){var i;return(i=t.call(this)||this).Ai=void 0,i.Do=void 0,i.Ci=void 0,i.vf=void 0,i.Bp=void 0,i.Am=void 0,i.vm=0,i.No=!1,i.Gl=!1,i.dm=!1,i.lm=void 0,i.bm=void 0,i.pm=void 0,i.gm=!1,i.ym=!0,i._m=!1,i.Cm=!1,i.Im=!1,i.Om=!1,i.wm=!1,i.Il=void 0,i.Op=function(t,e,n){if(e instanceof ArrayBuffer){var r,a,o;if(i.Am&&i.Am.onLoaderChunk(e.byteLength),i.lm&&!1!==i.lm.isFlv&&!i.Do.stat.flvAbrNotAligned){var s=i.lm.append(new Uint8Array(e));if(i.Am&&i.Do.lctx.levels.length>1)for(var u=0;u<s.length;u++){var c=s[u];if(!c)break;if(void 0===i.Do.streamTime.localTimeOffset&&(i.Do.streamTime.localTimeOffset=c.timestamp/I.h),i.Am){if(i.Om){var l=(a=t.url,new ct.a(a,!0).query.kabr_spts);if("string"==typeof l&&parseInt(l)>0&&Math.abs(parseInt(l)-c.timestamp)>I.g)return i.Ci.i(On,"keyframes not aligned req: "+l+" get: "+c.timestamp),i.Em(i.Am.currentLevel,!0),void(i.Do.stat.flvAbrNotAligned=!0)}if(r=i.Am.onKeyFrame(c.timestamp)){var h=new Uint8Array(c.pos);h.set(new Uint8Array(e).subarray(0,c.pos)),e=h.buffer;var d={smooth:!0,auto:r.auto,id:0,time:i.vm||i.Do.currentTime,level:r.level};i.Ai.emit(S.a.LEVEL_SWITCHING,d),i.vm=i.Do.streamTime.getLocalTime(c.timestamp/I.h)||0,r.auto&&(i.Om=!0);break}}}}i.gm&&(null!=(o=i.lm)&&o.header&&(e=i.jm(e)),i.gm=!1);var f={context:t,data:e,stats:n,remuxContiguous:i.Gl,discontinuity:i.dm,progress:!0};i.dm=!1,r?(i.Gl||(i.Gl=!0),i.Il.onFragLoaded(f),i.lm&&i.lm.reset(),i.RA(r.url,r.level)):i.Il.onFragProgress(f)}},i._p=function(t,e){e.retry&&i.Ai.emit(S.a.RETRY,{type:l.k.LOADER,core:l.a.mse,message:""+e.errMessage,code:Object(D.d)(D.a.LOAD_ERROR,e.errMessage,e.code)})},i.Cp=function(t,e){if(void 0===i.Do.stat.box||i.Do.stat.box===l.i.unknown){var n,r=null==(n=t.responseHeader)?void 0:n["content-type"];r&&(i.Do.stat.box=mi(Array.isArray(r)?r[0]||"":r).box)}i.Cm=!(!e.contentLength&&!e.contentTotalLength),i.Ci.i(On,"on connect. contentLength: "+e.contentLength+" contentTotalLength: "+e.contentTotalLength),i.Ai.emit(S.a.MEDIA_CONNECTED,{headers:t.responseHeader}),i.jb(Ne.CONNECTED,t,e)},i.jp=function(t,e){i.jb(Ne.ABORT,t,e)},i.km=function(t,e){i.jb(Ne.SUCCESS,t,e)},i.Yf=function(t,e){i.jb(Ne.FAIL,t,e),e.fatal&&i.Ai.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.LOAD_ERROR,e.errMessage,{statusCode:e.code,url:t.url}))},i.pl=function(t,e,n){i.Do.config.flvLoadEndError&&i.Do.stat.isLive&&i.Do.stat.box===l.i.flv?i.Ai.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.LIVE_DISCONNECTED_ERROR,"flv live load end",{statusCode:n.code,url:t.url})):(i.Il.onFragLoaded({context:t,data:null,stats:n,remuxContiguous:!1,progress:!0}),i.jb(Ne.SUCCESS,t,n),i.bm?i.Il.end():i._m=!0)},i.Mm=function(t){var e=i.Do.stat;i.bm=r()({},t),i.bm.keyframes&&(i.pm=i.bm.keyframes,i.Ci.i(On,"metadata keyframe",i.pm)),i.bm.keyframes||i.bm.duration?(e.isLive=!1,i.Il.updateConfig(i.Do.getRemuxConfig())):e.box===l.i.flv&&void 0===e.isLive&&(e.isLive=!0,i.Il.updateConfig(i.Do.getRemuxConfig())),i.vf.updateConfig(),i.ym?e.startFromSec>0&&!e.isLive&&i.pm&&i.pm.length>1?i.seek(e.startFromSec,i.Do.config.startFromKeyframe):i._m&&i.Il.end():i.seek(e.startFromSec,i.Do.config.startFromKeyframe),e.startFromSec=-1,e.box===l.i.mp4&&(t.mp4FastStart=i.ym),i._m=!1},i.Sm=function(){i._m&&(i.Il.end(),i._m=!1)},i.jl=function(t){E.a.safari&&i.Do.stat.codecType===l.c.hevc&&t.segments.forEach((function(t){if(t.type===l.o.VIDEO&&t.keyTime)for(var e=0;e<t.keyTime.length;e++){var n;if(null!=(n=t.keyTime[e])&&n.cra)return i.Ci.i(On,"safari hevc cra nalu. always seek 0"),void(i.wm=!0)}}))},i.Bm=function(t){if(i.Ci.i(On,"get key index"),t.append)if(i.pm&&t.keyframes[0]){for(var e=0;e<t.keyframes.length;e++){for(var n=!1,r=0;r<i.pm.length;r++)if(t.keyframes[e].time===i.pm[r].time){n=!0;break}n||i.pm.push(t.keyframes[e])}i.pm.sort((function(t,e){return t.time-e.time}))}else i.pm=t.keyframes;else i.pm=t.keyframes},i.Tm=function(t){i.Ci.i(On,"not faststart",t.pos),i.vf.seek({position:t.pos,time:0}),i.Il.reset(!0),i.ym=!1,i._m=!1},i.Dm=function(t){i.Do.demuxerType=t.type,i.Cm&&(i.Do.stat.isLive=!1),i.Ci.i(On,"demuxer detected: "+t.type+", box:"+i.Do.stat.box+" isLive:"+i.Do.stat.isLive),i.vf.updateConfig()},i.Ai=e.evt,i.Do=e,i.Ci=e.logger,i.lm=new cn(i.Do),i.Bp={onLoad:i._p,onConnect:i.Cp,onProgress:i.Op,onError:i.Yf,onEnd:i.pl,onAbort:i.jp,onRangeEnd:i.km},i.vf=new vn(i.Bp,e),i.Il=Sn&&e.stat.box===l.i.yuv?new Sn(i.Ai,e,l.f.MAIN):new Yi(i.Ai,e,l.f.MAIN),i.Il.init(),i.O.push(i.Ai.prependListener(S.a.METADATA,i.Mm),i.Ai.prependListener(S.a.PARSING_INIT_SEGMENT,i.Sm),i.Ai.prependListener(S.a.PARSING_DATA,i.jl),i.Ai.prependListener(S.a.KEY_FRAME_INDEXS,i.Bm),i.Ai.prependListener(S.a.MP4_NOT_FASTSTART,i.Tm),i.Ai.prependListener(S.a.DEMUXER_DETECTED,i.Dm)),i}u()(e,t);var i=e.prototype;return i.init=function(){this.Do.stat.box===l.i.yuv&&this.Il instanceof Yi&&this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MUX_ERROR,D.a.UNSUPPORTED,"yuv streams are not supported. yuv disabled.")),this.Am||(this.Am=new En(this.Do),this.No=!0,this.Do.lctx.currentIdx=this.Am.init(),this.Do.lctx.levels.length&&this.Ai.emit(S.a.MANIFEST_PARSED,{levels:[],currentLevel:0,auto:!1}))},i.destroy=function(){this.vf&&this.vf.destroy(),this.Am&&this.Am.destory(),this.lm=void 0,this.Il.destroy(),t.prototype.destroy.call(this)},i.loadSource=function(){var t=this.Am;if(t){var e=this.Do.lctx.current;e?this.RA(this.Rm(e.currentUrl)?nn(e.currentUrl,this.Do.config.defaultSpts,!1===this.Do.config.videoEnabled):e.currentUrl,t.currentLevel):this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.MANIFEST_PARSING_ERROR,"manifest parse error. core: mse."))}else"string"==typeof this.Do.src?this.RA(this.Do.src):this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.MANIFEST_PARSING_ERROR,"src Incorrect!"))},i.setDownloadEnabled=function(t){void 0===t&&(t=!0),this.vf.setDownloadEnabled(t)},i.isSeekable=function(){return!(!this.pm||!this.pm.length||this.Do.stat.isLive||this.Do.stat.isKwaiSlice)},i.seek=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),this.Ci.i(On,"seek: "+t+" "+e+" "+i);var n=this.pm;if((n||t<I.r)&&!i){var r=n?ln.a.getPosByTime(n,this.wm?0:t):{time:0,position:0};r&&(this.vf.seek(r),this.vm=r.time,this.Il.reset(!0),this.gm=r.position>0,t!==this.Do.currentTime&&this.Ai.emit(S.a.VIDEO_SEEK,{sec:e?r.time:t}))}else this.Ci.w(On,"no keyframe index"),this.Ai.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,D.a.CANNOT_SEEK,"can not seek",{fatal:!1}))},i.nextBackup=function(){return!1},i.onAbrLevelsUpdated=function(){var t;null==(t=this.Am)||t.onAbrLevelsUpdated()},i.setCurrentLevel=function(t){this.Ci.i(On,"set current level "+t),this.Am&&t>=0&&t!==this.Am.currentLevel&&this.Em(t)},i.setManualNextLevel=function(t){this.setNextLevel(t)},i.setNextLevel=function(t){if(this.No||this.setCurrentLevel(t),this.Do.stat.flvAbrNotAligned){if(t<0)return this.Ci.i(On,"flv not aligned. unsupprted abr."),void this.Ai.emit(S.a.LEVEL_SWITCH_FAILED);this.Em(t,!0)}var e=this.Am;e&&(-1===t&&this.Ai.emit(S.a.LEVEL_SWITCHING,{id:0,level:-1,time:this.Do.currentTime,smooth:!0,auto:!0}),e.nextLevel=t,this.Om=!0)},i.setAudioTrack=function(){},i.setSubtitleTrack=function(){},i.RA=function(t,e){void 0===e&&(e=0),this.Im=!0,this.Am&&this.Am.onLevelLoad(e),this.Do.lctx.currentIdx=e;var i=this.Do.lctx.current;this.Do.stat.audioCodec=this.Do.stat.audioCodec||(i?i.audioCodec:""),this.Ai.emit(S.a.NEW_SOURCE,{sync:this.vm});var n=Ce((null==i?void 0:i.fileName)||t);n&&this.Il.updateSuffix(n);var r=new $e;r.start=this.vm,r.type="frag";var a={url:t,responseType:"arraybuffer",credentials:this.Do.config.credentials,headers:this.Do.config.headers,frag:r,fileName:null==i?void 0:i.fileName,preferNative:this.Do.stat.preferNativeLoader};this.vf.load(a)},i.Em=function(t,e){var i=this.Am;if(i){i.currentLevel=t;var n=this.Do.lctx.current;if(n&&this.No){var r=this.Rm(n.currentUrl)?nn(n.currentUrl,this.Do.config.defaultSpts,!1===this.Do.config.videoEnabled):n.currentUrl;this.lm&&this.lm.reset(),this.Gl=!1,this.dm=!0,this.vm=this.Do.currentTime;var a={id:0,level:i.currentLevel,time:this.vm,smooth:!1,auto:!1};e&&(a.fallback=e),this.Ai.emit(S.a.LEVEL_SWITCHING,a),this.Il.reset(!0),this.Im&&this.RA(r,i.currentLevel)}}},i.jb=function(t,e,i){var n,r=xe(t,e,i,null==(n=this.Do.lctx.current)?void 0:n.qualityType);this.Ai.emit(S.a.DOWNLOAD,r)},i.jm=function(t){var e,i=null==(e=this.lm)?void 0:e.header;if(i){var n=new Uint8Array(t.byteLength+i.length);return n.set(i),n.set(new Uint8Array(t),i.length),n.buffer}return t},i.Rm=function(t){var e=this.Do.stat;return!(!e.isLive&&void 0!==e.isLive||e.box!==l.i.flv)},e}(h.a),kn=function(t){function e(e){var i;return(i=t.call(this)||this).Lm=void 0,i.Do=void 0,i.Dm=function(t){i.Do.demuxerType=t.type,i.Do.logger.i("transmuxer","demuxer detected, box:"+i.Do.stat.box+" isLive:"+i.Do.stat.isLive)},i.Do=e,e.stat.multipart?i.Lm=new en(e):i.Lm=new Nn(e),i.O.push(i.Lm),i}u()(e,t);var i=e.prototype;return i.init=function(){this.Nm(),this.Lm.init()},i.loadSource=function(){this.Lm.loadSource()},i.setDownloadEnabled=function(t){void 0===t&&(t=!0),this.Lm.setDownloadEnabled(t)},i.seek=function(t,e,i){void 0===i&&(i=!1),this.Lm.seek(t,e,i)},i.heartbeat=function(){},i.isSeekable=function(){return this.Lm.isSeekable()},i.setNextLevel=function(t){this.Lm.setManualNextLevel(t)},i.setCurrentLevel=function(t){this.Lm.setCurrentLevel(t)},i.onAbrLevelsUpdated=function(){this.Lm.onAbrLevelsUpdated()},i.setAudioTrack=function(t){this.Do.lctx.audioTracks.length&&this.Lm.setAudioTrack(t)},i.setSubtitleTrack=function(t){this.Do.lctx.subtitleTracks.length&&this.Lm.setSubtitleTrack(t)},i.Nm=function(){var t=this.Do.evt;this.O.push(t.prependListener(S.a.DEMUXER_DETECTED,this.Dm))},e}(h.a),xn=function(){function t(t){this.Qm=void 0,this.Qm=t}var e=t.prototype;return e.update=function(t){var e=this;t.forEach((function(t){e.Qm[t.index]=t}))},e.timeToIndex=function(t){if(this.Qm.length){if(t<this.Qm[0].pts)return 0;if(t>this.Qm[this.Qm.length-1].pts)return this.Qm.length-1;for(var e,i,n,r=0,a=this.Qm.length-1;r<=a;)if(e=(r+a)/2|0,i=this.Qm[e],(n=this.Qm[e+1])&&n.pts-.001<t)r=e+1;else{if(!(i&&i.pts-.001>t))return e;a=e-1}}return-1},e.isIndexInRange=function(t){return t>=0&&t<this.Qm.length},e.indexToTime=function(t){var e=this.Qm[t];return e?e.pts:-1},e.getNextFramePTSByTime=function(t){var e=this.timeToIndex(t),i=this.Qm[e+1];return e>=0&&i?i.pts:-1},e.getPrevFramePTSByTime=function(t){var e=this.timeToIndex(t)-1,i=this.Qm[e];return e>=0&&i?i.pts:-1},o()(t,[{key:"totalVideoFrames",get:function(){return this.Qm.length}}])}(),Pn="seek-stuck",Mn=function(){function t(t){this.Do=void 0,this.xm=-1,this.Do=t}var e=t.prototype;return e.onSeeking=function(){this.Do.logger.i(Pn,"seeking. reset"),this.xm=-1},e.tick=function(t){var e,i,n=this.Do,r=n.video;if(!t||!r||1!==r.buffered.length||n.stat.isLive&&!y(n.stat.box)||n.stat.isNetworkInUse||null!=(e=n.mse)&&e.ended())return!1;var a=n.bufferedSec+((null==(i=n.mse)?void 0:i.getBufferQueueSec())||0);if(a>=n.stat.lazyLoadRecoverDuration&&a<300){var o=performance.now();return this.xm<0&&(this.xm=o),o-this.xm>=2e3?(this.xm=-1,this.Do.logger.i(Pn,"mp stuck fix."),"fix"):"hit"}return this.xm=-1,!1},t}(),Un=function(){function t(t){this.Vm=void 0,this.Um=void 0,this.Fm=0,this.if=!1,this.Pm=!1,this.Vm=t}var e=t.prototype;return e.check=function(){var t=this.Vm,e=performance.now();if(!t.paused&&!t.seeking&&!t.ended&&e-this.Fm>=100){if(this.Fm=e,!this.Pm)return"number"==typeof this.Um&&Math.abs(t.currentTime-this.Um)>.017&&(this.Pm=!0),void(this.Um=t.currentTime);t.currentTime===this.Um?this.if||(this.if=!0,this.Hm(t,"waiting")):this.if&&(this.if=!1,this.Hm(t,"playing")),this.Um=t.currentTime}},e.reset=function(){this.Um=void 0,this.Pm=!1,this.if=!1},e.Hm=function(t,e){if(t&&t.dispatchEvent){var i=document.createEvent("CustomEvent");i.initCustomEvent(e,!0,!0,{}),t.dispatchEvent(i)}},t}(),Bn="yuv-renderer",Vn=function(t){function e(e){var i;return(i=t.call(this,e)||this).Ju=1,i.Ym=0,i.Gm={streamTime:0,stoped:!1,frameBufLen:0,maxFrameBufLen:0,pictMode:R.a.contain},i.Km=function(){var t,e;i.if=!1,!1!==i.ef||null!=(t=i.Do.video)&&t.ended||null==(e=i.Do.video)||null==(e=e.play())||e.catch((function(t){return i.Ci.i(Bn,"on dec ready, call play() fail.",t)})),i.ef=void 0},i.Zm=function(){var t,e;null!=(t=i.Do.video)&&t.ended||(i.rf.onWaiting(),i.if=!0,void 0===i.ef&&(i.ef=!(null==(e=i.Do.video)||!e.paused)))},i.Wm=function(t){i.Ci.i(Bn,"seek["+t.id+"]: renderer seek event",t),t.hitCache?i.if=!1:(i.ub(!0),i.hf()),i.zu=void 0},i.Xm=function(){var t;i.Ci.i(Bn,"on ren waiting."),void 0===i.ef&&(i.ef=!(null==(t=i.Do.video)||!t.paused)),i.Ai.emit(S.a.DECODER_WAITING)},i.zm=function(){i.Km()},i.Gm.maxFrameBufLen=i.rf.maxFrameBufLen,i}u()(e,t);var i=e.prototype;return i.init=function(t,e){this.Ci.i(Bn,"init "+t+", "+e);var i=this.Ai;this.O.push(i.prependListener(S.a.DEC_VIDEO_READY,this.Km),i.prependListener(S.a.DECODER_WAITING,this.Zm),i.prependListener(S.a.RENDERER_SEEK,this.Wm),i.prependListener(S.a.RENDERER_WAITING,this.Xm),i.prependListener(S.a.RENDERER_WAITING_END,this.zm)),this.sf.id=this.Ju,this.sf.init(!1),this.No=!0,this.start()},i.setMediaInfo=function(t){this.sf.updateMediaInfo(t)},i.appendData=function(t){var e=this;t.samples.forEach((function(t){t.yuv&&e.sf.append(t.yuv)}))},i.endOfData=function(){this.Ci.i(Bn,"endOfData"),this.sf.endOfData()},i.heartbeat=function(){this.Ci.i(Bn,"hb seeking: "+this.zu)},i.seek=function(t,e){this.Ci.i(Bn,"seek["+e+"]: "+t+" "+this.zu),t*=I.b,this.sf.seek(t,e),this.start()},i.seekWithLoad=function(){this.Ci.i(Bn,"seekWithLoad"),this.ub(!0),this.hf()},i.clean=function(t){void 0===t&&(t=0),this.Ci.i(Bn,"clean"),t||this.ub(!1)},i.decoderChange=function(t,e){this.Ci.i(Bn,"decoderChange: "+t+" @ "+e)},i.onParsingData=function(t){var e=this;t.segments.forEach((function(t){t.type===l.o.AUDIO&&e.Ym++}))},i.screenshot=function(t){this.sf.screenshot(t)},i.ub=function(t){void 0===t&&(t=!1),this.Ju++,this.Ym=0,t||(this.zu=void 0),this.sf.id=this.Ju,this.sf.reset(t),this.if=!0},i.hf=function(){var t,e=null==(t=this.Do.cOutput)?void 0:t.canvas;if(!e)throw new Error("canvas output undefined.");if(e instanceof HTMLCanvasElement){var i,n=this.Do.currentTime*I.b,r=!1,a=!(null==(i=this.Do.video)||!i.ended),o=this.af(e),s=this.Gm,u=M.a.getPictModeByCss(e);if(0!==n||this.Ym||(n=-1),s.streamTime===n&&s.stoped===a&&s.frameBufLen===this.sf.frameBufLen&&s.maxFrameBufLen===this.rf.maxFrameBufLen&&s.pictMode===u||(s.streamTime=n,s.stoped=a,s.frameBufLen=this.sf.frameBufLen,s.maxFrameBufLen=this.rf.maxFrameBufLen,s.pictMode=u,r=!0),!r&&!this.if&&!o)return;(r||o)&&this.sf.update(n,this.yt.w,this.yt.h,a,l.s.canvas,s.maxFrameBufLen,u)}},o()(e,[{key:"isCanvasRenderer",get:function(){return!0}},{key:"decBufLow",get:function(){return!1}}])}(Y),Fn="kernel-base-mse",jn=function(t){function e(e){var i;(i=t.call(this,e)||this).Jm=void 0,i.Lm=void 0,i.qm=!1,i.$m=void 0,i.tg=!1,i.ig=void 0,i.eg=!1,i.Ob=void 0,i.ng=3,i.sg=0,i.rg=void 0,i.hg=void 0,i.og=void 0,i.ag=void 0,i.ug=void 0,i.cg=!1,i.fg=void 0,i.Ag=[],i.vg=void 0,i.dg=void 0,i.lg=!1,i.bg=!0,i.pg=void 0,i.mg=0,i.gg=NaN,i.yg=0,i._g={},i.Cg=!1,i.fl=0,i.Ig=[],i.Og=function(){i.Ci.i(Fn,"mse buffer full. live: "+i.Do.live+" paused: "+i.eA.paused),i.Do.live?i.eA.paused&&(i.stopLoad(),i.wg()):i.Lm&&i.Lm.setDownloadEnabled(!1)},i.Eg=function(){i.Io!==Ut.NONE&&i.Do.isTimeinBuffered(i.eA.currentTime)&&i.eA.readyState>=3?(i.AA(),i.Ci.v(Fn,"canplay polyfill")):i.qm&&i.jg()},i.kg=function(){i.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.MSE_SOURCE_BUFFER_CLOSE_ERROR,"mse source close.",{fatal:!0}))},i.Mg=function(t){i.Ob&&i.Ob.parseVTTs(t.data,t.start,t.cc)},i.Sg=function(t){t.id=i.rA,i.rA++,t.auto=i.Do.lctx.abr,!t.smooth&&i.Jm&&(i.Jm.clean(),i.Do.streamingMux=!0),i.oA=t},i.Bg=function(t){var e;t.id=i.rA,i.rA++,t.auto=i.Do.lctx.abr,!t.smooth&&i.Jm&&(i.Jm.clean(),i.Do.streamingMux=!0),t.fallback&&(i.Ci.i(Fn,"level switch fallback, set seek on canplay"),i.qm=!0),"number"==typeof t.level&&(t.bitrate=t.level<0?-1:(null==(e=i.Do.lctx.levels[t.level])?void 0:e.bitrate)||0),-1===t.level?setTimeout((function(){return i.emit(S.a.LEVEL_SWITCHED,{time:t.time,bitrate:t.bitrate,level:t.level,smooth:t.smooth,auto:t.auto,id:t.id})}),0):(t.smooth?i.hA=i.hA.sort((function(t,e){return t.data.time-e.data.time})).filter((function(e){return e.data.time<t.time-.5})):i.hA=[],i.hA.push({switched:!1,data:t}))},i.Mb=function(t){i.Jm&&i.Jm.clean(t.startSec,i.eA.duration)},i.Tg=function(t){i.Ci.i(Fn,"manifest parsed",i.fg);var e=i.Do,n=i.Lm;if(n){i.Ci.i(Fn,"avSeparated: "+e.stat.avSeparated),i.Dg();var r,a=e.lctx.startIdx;if("number"==typeof a&&a>=0&&a<e.lctx.levels.length&&(n.setCurrentLevel(a),i.Ci.i(Fn,"set level from level startIdx.")),"number"==typeof i.fg)return i.fg>=0&&(n.setCurrentLevel(i.fg),i.Ci.i(Fn,"set level:"+i.fg+". manifest parsed stop event."),t.preventFollowUp=!0),void(i.fg=void 0);e.lctx.subtitleTracks.length&&i.Rg(),e.config.emeEnabled&&(null==(r=i.hg)||r.onManifestParsed(e.lctx.levels,e.stat.drm))}},i.Lg=function(t){var e=i.Do,n=i.Jm;e.stat.isLive&&e.stat.liveShiftType!==l.g.KWAI||null==t||!t.duration||!n||n.updateDuration(t.duration),i.Ci.i(Fn,"audio track update",t)},i.Ng=function(t){var e=i.Do,n=i.Jm;(!e.stat.isLive&&!1===(null==t?void 0:t.live)||e.stat.liveShiftType===l.g.KWAI)&&null!=t&&t.duration&&n&&n.updateDuration(t.duration),i.Ci.i(Fn,"level update",t)},i.Qg=function(t){if(i.Ci.i(Fn,"seek event from trans",t,t.sec===i.Do.currentTime),t.sec!==i.Do.currentTime){i.eg=!0;try{i.internalSeek(t.sec)}catch(t){}}},i.kl=function(t){t.expired||(i.rg&&i.rg.appendData(t),i.Do.loadRec.onRaw(t))},i.xg=function(t){i.Ci.i(Fn,"video codec detected. dec:"+t.decoder+", codec:"+t.codecType+", bitDepth:"+t.bitDepth+" "+t.timeOffset);var e,n,r=i.Do;t.decoder&&(i.Do.stat.decoder=t.decoder),i.rg&&t.decoder===l.d.buildin?(i.rg.decoderChange(l.d.buildin,t.timeOffset||0),r.config.ensureVideo?i.Vg():(r.config.ensureVideo=!0,null==(n=r.cOutput)||n.updateRendererType(l.s.video),i.Ug(!i.rg.pausedOnWaiting))):(t.decoder===l.d.buildin&&(null==(e=r.cOutput)||e.updateRendererType(l.s.video)),t.enabled&&t.decoder===l.d.wasm&&ir?(i.Fg(ir,t.codecType,t.bitDepth),i.rg&&i.rg.decoderChange(l.d.wasm,t.timeOffset||0)):t.enabled&&t.decoder===l.d.none&&r.stat.box===l.i.yuv&&Vn&&i.Fg(Vn,t.codecType,t.bitDepth))},i.Pg=function(t){i.og.update()},i.Hg=function(){i.Ci.i(Fn,"wasm video ready"),i.Do.live?i.Yg():i.Jm&&i.Jm.setAppendEnabled(!0)},i.Gg=function(t){if(i.Ci.i(Fn,"h265 step frame",t),t.type){var e=t.time/1e3;t.type===l.m.NEXT?(e<0&&(e=i.SA()),e!==i.eA.currentTime&&(i.eg=!0,i.internalSeek(e))):e>=0?e!==i.eA.currentTime&&(i.eg=!0,i.internalSeek(e)):i.eA.currentTime=i.BA()}},i.Kg=function(t){var e;if(i.Ci.i(Fn,"seek["+t+"]: seek with load"),(!i.Do.stat.isLive||i.Do.isLiveShift)&&i.Lm&&i.Jm){i.ag.onSeeking();var n=i.eA.currentTime;if(!i.Lm.isSeekable()&&n>=I.r)return i.Ci.i(Fn,"seek["+t+"]: seek disabled, rollback: "+i.sg+" seekTime: "+n),void(n!==i.sg&&i.internalSeek(i.sg));i.rg&&i.rg.seekWithLoad(),i.emit(S.a.SEEK_WITH_LOAD),i.Io=Ut.SEEK,i.hA.length&&(i.hA=i.hA.slice(i.hA.length-1),i.hA[0].data.time=n),i.Jm.clean(),i.Jm.setAppendEnabled(!1),null!=(e=i.rg)&&e.isCanvasRenderer&&(i.qm=!1),i.Lm.seek(n,E.a.msie||i.Do.config.alwaysSeekKeyframe,!1)}},i.Zg=function(t){i.Ci.i(Fn,"seek["+t.id+"]: decoder seek event.",t),t.preventFollowUp||(i.Ci.i(Fn,"wasm seek frame",t),t.hitCache?i.Yg():i.Kg(t.id))},i.Wg=function(){i.Ci.i(Fn,"h265 render buf empty. waiting."),i.Xg()},i.zg=function(t){i.Do.cOutput&&(i.Do.cOutput.updateRendererType(t.type),t.type=i.Do.cOutput.rendererType,t.canvas=i.Do.cOutput.rendererType===l.s.canvas&&i.Do.cOutput.canvas?i.Do.cOutput.canvas:void 0)},i.Jg=function(t){if(i.rg){var e=i.Sa;e&&(e.width=t.width,e.height=t.height,e.codedWidth=t.codedWidth,e.codedHeight=t.codedHeight,e.sar=t.sar,e.profile=t.profile,e.level=t.level,e.chromaFormat=t.chromaFormat,e.bitDepth=t.bitDepth,t.colorInfo&&(e.colorInfo=t.colorInfo,e.colorSpace=Object(Nt.e)(t.colorInfo)),i.rg.setMediaInfo(r()({},e)),i.emit(S.a.MEDIA_INFO,i.Sa))}},i.Sm=function(t){var e;if(i.Do.stat.avSeparated){if(Object.prototype.hasOwnProperty.call(t.tracks,"video")&&(i._g.main=t.tracks.video),Object.prototype.hasOwnProperty.call(t.tracks,"audio")&&(i._g.audio=t.tracks.audio),!i._g.main&&!1!==i.Do.config.videoEnabled&&i.Do.stat.decoder===l.d.buildin||!i._g.audio&&!1!==i.Do.config.audioEnabled)return void i.Ci.i(Fn,"av separated. init segment not ready. wating next");i.Ci.i(Fn,"av separated. init segment ready."),t.tracks.video=i._g.main,t.tracks.audio=i._g.audio}i.Cg=!0;var n=i.Jm,a=i.Do,o=i.Do.lctx.current;if(o&&t.tracks&&t.tracks.video&&!o.codec&&(o.codec=t.tracks.video.codec),i.hA.length){var s=i.hA.filter((function(t){return!t.switched}))[0];s&&(s.switched=!0,i.emit(S.a.LEVEL_SWITCHED,r()({},s.data)))}i.oA&&(i.emit(S.a.AUDIO_TRACK_SWITCHED,i.oA),i.oA=void 0);var u=t.tracks.rawVideo||t.tracks.video,c=t.tracks.audio,h={};if(c){var d=c.metadata;h.hasAudio=!0,h.channel=d.channel,h.audioBitrate=d.audioBitrate,h.audioSampleRate=d.audioSampleRate,h.audioCodec=c.codec,h.audioCodecType=c.codecType}if(u){var f=u.metadata;h.hasVideo=!1!==u.active,f&&!f.isFillVideo&&(h.width=f.width,h.height=f.height,h.rotation=f.rotation,h.fps=f.fps,h.profile=f.profile,h.level=f.level,h.chromaFormat=f.chromaFormat,h.bitDepth=f.bitDepth,h.videoBitrate=f.videoBitrate,f.colorInfo&&(h.colorSpace=Object(Nt.e)(f.colorInfo)),h.videoCodec=u.codec,h.videoCodecType=u.codecType),r()(h,u.metadata)}a.stat.codecType=h.videoCodecType=(null==u?void 0:u.codecType)||l.c.unknown,i.Do.stat.audioCodec=(null==(e=i.Do.lctx.current)?void 0:e.audioCodec)||"",a.lctx.current&&(!a.lctx.current.bitrate&&h.videoBitrate&&h.audioBitrate&&(a.lctx.current.bitrate=h.videoBitrate+h.audioBitrate),!a.lctx.current.maxBitrate&&null!=u&&u.metadata&&u.metadata.videoMaxBitrate&&null!=c&&c.metadata.audioMaxBitrate&&(a.lctx.current.maxBitrate=u.metadata.videoMaxBitrate+c.metadata.audioMaxBitrate)),h.videoDecoder=a.stat.decoder,i.rg&&i.rg.setMediaInfo(r()({},h)),h.videoCodecType!==l.c.kvc30&&i.emit(S.a.MEDIA_INFO,h),i.Sa=h,i.Ci.i(Fn,"mediainfo",h),n&&n.trackInfo(t),i.qg()},i.$g=function(t){if(!t.expired){if(i.Cg){if(i.Ig.length)for(;i.Ig.length;){var e=i.Ig.shift();e&&i.ty(e)}}else i.Ig.push(t);i.ty(t),i.Yg()}},i.Mm=function(t){!i.Do.stat.isLive&&t.videoFramesInfo&&(i.pg=new xn(t.videoFramesInfo)),"number"==typeof t.duration&&i.Jm&&(delete t.keyframes,i.Lm&&!i.Do.stat.multipart&&i.Jm.updateDuration(t.duration))},i.iy=function(t){!i.Do.stat.isLive&&t.videoFramesInfo&&(i.pg?i.pg.update(t.videoFramesInfo):i.pg=new xn(t.videoFramesInfo))},i.Sc=function(t){i.Do.stat.isLive=!1,i.fl++,i.fl<2&&i.Do.stat.avSeparated?t.preventFollowUp=!0:(i.Jm&&i.Jm.endOfData(),i.rg&&i.rg.endOfData())},i.ey=function(t){i.Lm&&i.Lm.setSubtitleTrack(t.level)},i.ny=function(t){i.Do.config.logger&&Object(Ot.a)(i.Do.config.logger,t)},i.Ci.i(Fn,"constructor"),i.og=new Ft(i.Do),i.ag=new Mn(i.Do),i.bg=!!i.Do.config.catchUpPausedLive,Wt&&(i.hg=new Wt(i.Do),i.O.push(i.hg)),e.video&&E.a.x5&&E.a.android&&(i.$m=new Un(i.eA)),i.wg(),i.Yb();var n=i.Ug.bind(i);return i.dg=new Rt(e).setRetryFunc(n),i.O.push(i.Do.evt.on(S.a.WORKER_LOG,i.ny)),i}u()(e,t);var i=e.prototype;return i.load=function(t){this.Ci.i(Fn,"call load: "+t),this.sy(),this.hy(),this.TA(),this.fg=void 0,this.vg=void 0,this.RA(t)},i.stopLoad=function(){this.Ci.i(Fn,"call stopLoad"),this.kA(),this.oy(),this.vg&&(this.vg.enabled=!1),this.rg&&this.uy(),this.Lm&&(this.Ay(),this.emit(S.a.STOP_LOAD))},i.destroy=function(){var e;this.Do.logger.i(Fn,"call destroy"),this.$m=void 0,this.kA(),this.oy(),this.Lm&&this.emit(S.a.STOP_LOAD),this.vy(),null==(e=this.Ob)||e.destroy(),this.ug&&(this.eA.play=this.ug.play,this.eA.pause=this.ug.pause),this.pg=void 0,xt(),this.sy(),t.prototype.destroy.call(this)},i.hy=function(){var t=this.Do,e=this.Ug.bind(this);this.Ag.push(t.fallback.register(O.FLV_LIVE_RELOAD,this.dg),t.fallback.register(O.USE_BACKUP,new gt(t).setRetryFunc(e)),t.fallback.register(O.NO_WORKER,new wt(t).setRetryFunc(e)),t.fallback.register(O.DROP_V_FRAME,new Tt(t).setRetryFunc(e)),t.fallback.register(O.SWAP_REMUX_TYPE,new Dt(t).setRetryFunc(e)),t.fallback.register(O.SWAP_AUDIO_CODECSTR,new Lt(t).setRetryFunc(e))),St&&this.Ag.push(t.fallback.register(O.SWAP_WASM_DECODER,new St(t).setRetryFunc(e)))},i.sy=function(){this.Ag.forEach((function(t){return t.destroy()})),this.Ag=[]},i.resume=function(){var t,e=this;this.Ci.i(Fn,"call resume"),this.Do.live&&this.lg||(this.Lm||this.RA(l.h.internal),this.eA.paused&&(null==(t=this.eA.play())||t.catch((function(t){return e.Ci.i(Fn,"resume, call play() fail.",t)}))))},i.refresh=function(){if(this.Ci.i(Fn,"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 t=this.Do.lctx.currentIdx,e=this.Do.lctx.audioIdx,i=this.Do.lctx.subtitleIdx,n=this.Do.lctx.abr;this.Do.lctx.currentIdx=t,this.Do.lctx.audioIdx=e,this.Do.lctx.subtitleIdx=i,this.Do.lctx.abr=n,this.Ug(),this.nA=void 0},i.onAbrLevelsUpdated=function(){var t;null==(t=this.Lm)||t.onAbrLevelsUpdated()},i.setCurrentLevel=function(t){var e;this.Ci.i(Fn,"set currentLevel",t);var i=this.Do;return i.lctx.verifyLevelIdx(t)&&this.nA?(this.Ci.i(Fn,"set currentLevel on error. refresh"),i.lctx.currentIdx=t,void this.refresh()):!this.ly(t,l.o.VIDEO)||t===i.lctx.currentIdx&&!i.lctx.abr||this.nA?(this.Ci.i(Fn,"set currentLevel fail.",!this.ly(t,l.o.VIDEO),t,i.lctx.currentIdx,!i.lctx.abr,this.nA),void this.emit(S.a.LEVEL_SWITCH_FAILED)):t<0?(this.Ci.i(Fn,"set currentLevel to auto."),void this.setNextLevel(-1)):i.isSwitchLevelByReload?(i.lctx.currentIdx=t,this.fg=t,void(this.eA.ended?(this.Ci.i(Fn,"set currentLevel on manifest parsed. reset trans"),this.Ay(),this.by(),this.uy()):(this.Ci.i(Fn,"set currentLevel on manifest parsed. reload"),this.Ug()))):(this.Io!==Ut.INIT&&this.Io!==Ut.LOADING&&(this.Io=Ut.SELECT_BITRATE,this.qm=!0),this.Jm&&(this.Jm.clean(),i.streamingMux=!0),t>=0&&t!==i.lctx.currentIdx&&this.Dg(),null==(e=this.Lm)||e.setCurrentLevel(t),void(this.rg&&this.rg.clean()))},i.setNextLevel=function(t){var e;this.Ci.i(Fn,"set nextLevel",t);var i=this.Do;return i.lctx.verifyLevelIdx(t)&&this.nA?(i.lctx.currentIdx=t,void this.refresh()):!this.ly(t,l.o.VIDEO)||this.nA?(this.Ci.i(Fn,"set nextLevel failed.",t),void this.emit(S.a.LEVEL_SWITCH_FAILED)):void(i.bufferedSec<this.ng&&t>=0||t>=0&&i.isSwitchLevelByReload||i.isLiveShift?this.setCurrentLevel(t):(t>=0&&t!==i.lctx.nextIdx&&this.Dg(),null==(e=this.Lm)||e.setNextLevel(t)))},i.setAudioTrack=function(t){this.Ci.i(Fn,"set audioTrack",t);var e=this.Do;if(!this.ly(t,l.o.AUDIO)||t===e.lctx.audioIdx||this.nA)return this.Ci.i(Fn,"set audioTrack fail.",!this.ly(t,l.o.AUDIO),t,e.lctx.audioIdx,this.nA),void this.emit(S.a.AUDIO_TRACK_SWITCH_FAILED);this.Lm&&t!==e.lctx.audioIdx&&e.lctx.audioTracks.length>1&&(this.Dg(),this.Lm.setAudioTrack(t),this.Io!==Ut.INIT&&this.Io!==Ut.LOADING&&(this.Io=Ut.SELECT_BITRATE,this.qm=!0),this.Jm&&(this.Jm.clean(),e.streamingMux=!0))},i.setSubtitleTrack=function(t){this.Lm&&t!==this.Do.lctx.subtitleIdx&&this.Do.lctx.subtitleTracks.length>=1&&this.Ob&&this.Ob.select(t)},i.liveEnd=function(){this.Ci.i(Fn,"liveEnd",this.Do.stat.isLive),this.Do.stat.isLive&&(this.Do.stat.isLive=!1,this.lg=!0,this.Do.fallback.stop())},i.getTotalVideoFrames=function(){return this.pg?this.pg.totalVideoFrames:-1},i.getCurrentVideoFrame=function(){return this.pg?this.pg.timeToIndex(this.eA.currentTime):-1},i.seekToNextFrame=function(){if(!(this.getCurrentVideoFrame()>=this.getTotalVideoFrames()-1))if(this.rg)this.rg.step(l.m.NEXT);else if(this.pg){var t=this.pg.getNextFramePTSByTime(this.eA.currentTime);t>=0&&(this.eA.currentTime=t+.001)}else{var e=this.SA();e>0&&(this.eA.currentTime=e)}},i.seekToPrevFrame=function(){if(0!==this.getCurrentVideoFrame())if(this.rg)this.rg.step(l.m.PREV);else if(this.pg){var t=this.pg.getPrevFramePTSByTime(this.eA.currentTime);t>=0&&(this.eA.currentTime=t+.001)}else{var e=this.BA();e>=0&&(this.eA.currentTime=e)}},i.setCurretVideoFrame=function(t){this.pg&&this.pg.isIndexInRange(t)?this.pg.indexToTime(t)>=0?this.eA.currentTime=this.pg.indexToTime(t)+.001:this.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,D.a.CANNOT_SEEK_BY_FRAME_INDEX,t+" out of range: [0, "+this.getTotalVideoFrames()+"]",{fatal:!1})):this.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,D.a.CANNOT_SEEK_BY_FRAME_INDEX,"unsupported",{fatal:!1}))},i.getTrackBufInfo=function(){var t;return null==(t=this.Jm)?void 0:t.trackBufInfo},i.screenshot=function(e){this.rg&&this.rg.isCanvasRenderer?this.rg.screenshot(e):t.prototype.screenshot.call(this,e)},i.cA=function(){this.eA instanceof HTMLVideoElement&&!this.eA.videoWidth&&this.Do.stat.codecType!==l.c.h264&&this.Do.stat.decoder===l.d.buildin&&(this.Do.canCodecFallback||this.Do.hasNextMediaDesc())?(this.Ci.i(Fn,"metadata video size: "+this.eA.videoWidth+". fallback 264"),this.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,D.a.VIDEO_NO_SIZE,"buildin "+this.Do.stat.codecType+" dec no width."))):t.prototype.cA.call(this)},i.pA=function(){t.prototype.pA.call(this),this.Do.config.catchUpPausedLive&&!this.Do.stat.liveShiftActive&&(this.bg=!0)},i.bA=function(){if(!this.nA&&this.Do.live){var e=this.Do.getLiveDelay();if(this.Ci.i(Fn,"on video playing. live: "+this.Do.live+" delay: "+e),e>0&&this.Do.bufferedSec>e/1e3+1&&this.bg){var i=this.Do.bufferedEnd-e/1e3;this.Do.isTimeinBuffered(i)&&this.internalSeek(i)}this.bg=!1}t.prototype.bA.call(this),this.gg=NaN},i.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())),t.prototype.mA.call(this)},i.yA=function(){this.sg=0,this.eg=!1,t.prototype.yA.call(this)},i.wg=function(){var t,e;(this.Jm&&(this.Jm.hasTrackInfo()||this.eA.error)||null!=(t=this.hg)&&t.isActive)&&(this.Ci.i(Fn,"rebuild mse"),URL.revokeObjectURL(this.eA.src),this.by(),null!=(e=this.hg)&&e.isActive&&(this.Ci.i(Fn,"eme reset src"),this.eA.src="",this.hg.reset())),this.Jm?this.Jm.clean():(this.Jm=new Yt(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()))},i.ly=function(t,e){var i=!0;return e===l.o.VIDEO?i=this.Do.lctx.verifyLevelIdx(t):e===l.o.AUDIO&&(i=this.Do.lctx.verifyAudioTrackIdx(t)),!!(this.Lm&&this.Jm&&i)},i.jg=function(){if(this.qm&&this.Jm&&!this.Jm.hasCleanUpTask()){var t=.001;this.Do.isTimeinBuffered(this.eA.currentTime+t)&&(this.Ci.i(Fn,"seek on canplay "+this.eA.currentTime+" + "+t),this.qm=!1,this.internalSeek(this.eA.currentTime+t))}},i.my=function(){(this.Lm=new kn(this.Do)).init(),this.$m&&this.$m.reset()},i.Yb=function(){var t=this.Do.evt;this.O.push(t.prependListener(S.a.PARSING_DATA,this.$g),t.prependListener(S.a.PARSING_INIT_SEGMENT,this.Sm),t.prependListener(S.a.LOAD_END,this.Sc),t.prependListener(S.a.SUBTITLE_LOADED,this.Mg),t.prependListener(S.a.AUDIO_TRACK_SWITCHING,this.Sg),t.prependListener(S.a.LEVEL_SWITCHING,this.Bg),t.prependListener(S.a.BUFFER_CLEANING,this.Mb),t.prependListener(S.a.METADATA,this.Mm),t.prependListener(S.a.VIDEO_FRAME_INFO,this.iy),t.prependListener(S.a.MANIFEST_PARSED,this.Tg),t.prependListener(S.a.AUDIO_TRACK_UPDATED,this.Lg),t.prependListener(S.a.LEVEL_UPDATED,this.Ng),t.prependListener(S.a.VIDEO_SEEK,this.Qg),t.prependListener(S.a.RAW_DATA,this.kl),t.prependListener(S.a.VIDEO_CODEC_DETECTED,this.xg),t.prependListener(S.a.LOADER_CHUNK_ARRIVAL,this.Pg),t.prependListener(S.a.MSE_BUFFER_FULL,this.Og),t.prependListener(S.a.MSE_UPDATE,this.Eg),t.prependListener(S.a.MSE_SOURCE_CLOSE,this.kg),t.prependListener(S.a.DEC_VIDEO_READY,this.Hg),t.prependListener(S.a.STEP,this.Gg),t.prependListener(S.a.DECODER_SEEK,this.Zg),t.prependListener(S.a.DECODER_WAITING,this.Wg),t.prependListener(S.a.VIDEO_RENDERER_CHANGE,this.zg),t.prependListener(S.a.DECODER_MEDIA_INFO,this.Jg),t.prependListener(S.a.SUBTITLE_TRACK_SWITCHED,this.ey))},i.Fg=function(t,e,i){void 0===i&&(i=8),this.Ci.i(Fn,"init canvas renderer");var n=this.Jm,r=this.Do;if(!this.rg){var a,o,s;n&&n.setAppendEnabled(!1),r.stat.mainThreadRendering=r.config.mainThreadRendering,null==(a=r.cOutput)||a.updateRendererType(l.s.canvas);var u=this.rg=new t(r);this.gy(),u.init(e,i),null!=(o=this.Jm)&&o.ended()&&u.endOfData(),this.emit(S.a.VIDEO_RENDERER_CHANGE,{enabled:!0,canvas:null==(s=r.cOutput)?void 0:s.canvas,type:l.s.canvas})}},i.Yg=function(){var t=this.Do;if(this.Lm&&this.Jm)if(t.stat.multipart||t.stat.isLive||this.Io!==Ut.WAITING){var e=t.bufferedSec,i=this.Jm.getBufferQueueSec(),n=!0;if((e<t.stat.lazyLoadRecoverDuration||t.live&&!this.Jm.getAppendEnabled())&&this.Jm.setAppendEnabled(!this.rg||!this.rg.isCanvasRenderer||!this.rg.waiting),t.stat.lazyLoadMaxDuration>0&&e+i>=("closed"===this.Jm.readyState?1:t.stat.lazyLoadMaxDuration))n=!1;else{if(!(e+i<t.stat.lazyLoadRecoverDuration))return void this.og.checkStreamingMux();this.og.checkStreamingMux(),n=!0}t.isDownloadInterruptible&&this.Lm&&(this.Ci.v(Fn,"download: "+n+" buffered:"+e+" mse:"+i),!n&&this.rg&&this.rg.decBufLow&&(this.Ci.i(Fn,"dec data empty, download enable."),n=!0),this.Lm.setDownloadEnabled(n)),this.Jm.pendingNum()&&this.Jm.refresh()}else this.Lm.setDownloadEnabled(!0)},i.vA=function(){var t,e,i=this,n=this.Do.stat.seekingId++;if(this.Ci.i(Fn,"seek["+n+"]: to "+this.eA.currentTime+" internal:"+this.uA),this.Do.config.forceRenderOnSeekEnd&&(null==(t=this.rg)||!t.isCanvasRenderer)&&this.eA.currentTime>=this.eA.duration)this.Ci.i(Fn,"seek["+n+"]: to end, force render. paused: "+this.eA.paused),this.eA.currentTime=this.eA.duration-.001,this.eA.paused&&(null==(e=this.eA.play())||e.catch((function(t){return i.Ci.i(Fn,"resume, call play() fail.",t)})));else if(this.Sa&&!(this.eA&&this.eA.currentTime>=this.eA.duration&&this.Jm&&this.Jm.ended())){this.Do.streamingMux=!0;var r=this.uA;if(this.uA=!1,this.eg)this.eg=!1;else{this.emit(S.a.SEEKING,{internal:r});var a=this.eA.currentTime;if(this.Do.isLiveShift&&a>this.eA.duration-this.Do.config.liveShiftDelaySec&&!r)return this.internalSeek(this.eA.duration-this.Do.config.liveShiftDelaySec),void this.Ci.i(Fn,"liveshift kwai2 seek out of range");if(this.Do.isLiveShift&&this.Do.liveTime&&this.Do.updateLiveShiftStatuByTime(a),this.rg&&this.rg.isCanvasRenderer){if(r)return;this.rg.seek(a,n)}else this.Do.isTimeinBuffered(a)?r||(E.a.msedge&&E.a.version.major<88||E.a.msie?(this.qm=!0,this.Kg(n)):this.Lm&&y(this.Do.stat.box)&&this.Lm.seek(a,!1,!0)):0===a&&this.eA.buffered.length>0&&this.eA.buffered.start(0)<1?r||this.internalSeek(this.eA.buffered.start(0)):this.Kg(n)}}},i.Xg=function(){!this.eA.ended&&this.rg&&this.rg.isCanvasRenderer&&(this.eA.paused||this.py(),function(t,e,i){if(t&&t.dispatchEvent&&window.CustomEvent){var n=new CustomEvent("waiting",void 0);t.dispatchEvent(n)}}(this.eA))},i.Vg=function(){var t,e=this;this.rg&&!1===this.rg.pausedOnWaiting&&!this.eA.ended&&(null==(t=this.eA.play())||t.catch((function(t){return e.Ci.i(Fn,"custom waiting ended, call play() fail.",t)})))},i.Ay=function(){this.Lm&&(this.Lm.destroy(),this.Lm=void 0)},i.by=function(){this.Ci.i(Fn,"destroy mse"),this.Do.mse=void 0,this.Jm&&(this.Jm.destroy(),this.Jm=void 0)},i.uy=function(){this.rg&&(this.rg.destroy(),this.rg=void 0)},i.Ug=function(t){var e,i,n=this;void 0===t&&(t=!0),this.Ci.i(Fn,"reload. play: "+t),null==(e=this.Do.cOutput)||e.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(l.h.retry),t?null==(i=this.eA.play())||i.catch((function(t){return n.Ci.i(Fn,"reload. call play() fail.",t)})):this.eA.pause()},i.qg=function(){this.ig||(this.ig=setInterval(this.yy.bind(this),100))},i.oy=function(){this.ig&&(clearInterval(this.ig),this.ig=void 0)},i.vy=function(){this.Ci.i(Fn,"stop video"),this.eA&&(this.Ay(),this.uy(),this.by(),URL.revokeObjectURL(this.eA.src),this.eA.src&&(this.eA.src=""))},i.yy=function(){var t=this.Do;t.stat.isLive?(this.vg||E.a.safari||E.a.ios||!t.stat.autoPlaybackRateConf||(this.Ci.i(Fn,"autoPlayback rate on."),this.vg=new Qt(t)),this.vg&&(this.vg.enabled=!t.stat.liveShiftActive,this.vg.tick())):this.vg&&(this.vg.enabled=!1);var e=this.eA;this.$m&&t.stat.firstFrameLoaded&&this.$m.check();var i=e.buffered.length>1,n=this.Io===Ut.WAITING||this.Io===Ut.LOADING||this.Io===Ut.INIT||this.Io===Ut.SEEK||this.Io===Ut.SELECT_BITRATE,r=n&&!e.seeking,a=e.currentTime,o=this.ag.tick(n);if(o){if("fix"===o){var s,u=e.buffered.start(0);e.buffered.length&&u>a&&(this.Ci.i(Fn,"play stuck. current time: "+a+" not in buffer range. "+u),this.internalSeek(u+.1)),this.Ci.i(Fn,"play stuck. restart download."),null==(s=this.Lm)||s.setDownloadEnabled(!0)}}else{if(r||(this.yg=0),(i||r)&&!this.rg&&!e.ended&&this.Jm&&!this.Jm.hasCleanUpTask()&&this.Jm.hasSourceBufferAppendStarted()){var c=t.currentBuffer(a),l=t.nextBuffer(a);r?!c||c.end-a<1?(l&&this.Ci.i(Fn,"play stuck "+a+". buffered num: "+t.bufferSliceNum+" jump to next buf"),this._y(l)):this.eA.buffered.length>1&&c.end-a>1?(c&&this.Ci.i(Fn,"play stuck "+a+". multi buf. current time+"),this._y(c)):c.end-a>1&&(this.yg>2?(this.Ci.i(Fn,"play stuck "+a+". current time +, "+e.seeking),this.internalSeek(a+.5),this.yg=0):this.yg++):i&&c&&c.end-a<=.1&&(l&&this.Ci.i(Fn,"try jump next C"),this._y(l))}this.hA.length&&this.Cy()}},i._y=function(t){if(t){var e=t.start+(E.a.safari?.3:.001);e>t.end&&(e=t.start),this.gg===e&&(e+=.1),this.gg=e,this.internalSeek(e),this.Ci.i(Fn,"jump to "+e)}},i.Cy=function(){var t=this.hA[0];t&&this.eA.currentTime>=t.data.time&&this.Do.isTimeinBuffered(this.eA.currentTime)&&(t.switched||this.emit(S.a.LEVEL_SWITCHED,r()({},t.data)),this.emit(S.a.LEVEL_SWITCH_PLAYING,t.data),this.hA.shift())},i.RA=function(e){if(this.Ci.i(Fn,"_load start sec:",this.Do.stat.startFromSec),!E.a.mobile&&!Qn.isMSECodecCapabilityNormal()){var i="MSE is not fully functional. h264: "+Qn.TYPE_SUPPORTED.h264+"; aac: "+Qn.TYPE_SUPPORTED.aac;return this.Ci.i(Fn,i),void this.emit(S.a.ERROR,Object(D.e)(D.b.MSE_ERROR,D.a.MSE_CAPABILITY_ERROR,i))}this.Do.stat.srcType!==l.l.KWAI&&this.Do.stat.srcType!==l.l.KWAI_FLV_ABR||this.Do.lctx.levels.length?(t.prototype.RA.call(this,e),this.Sa=void 0,this.nA=void 0,this.Io=Ut.LOADING,this.hA=[],this.oy(),this.pg=void 0,this.gg=NaN,this.Do.fallback.stop(),this.Do.stat.isLive&&(this.Ci.i(Fn,"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(S.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(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.SRC_EMPTY,"level cnt 0"))},i.ty=function(t){var e;this.Do.mse&&this.Do.mse.mediaSegment(t.segments),null==(e=this.Do.liveTime)||e.onParsing(t),this.Do.loadRec.onParsing(t),this.rg&&this.rg.onParsingData(t)},i.Dg=function(){this._g.audio=this._g.main=void 0,this.Cg=!this.Do.stat.avSeparated,this.fl=0,this.Ig=[],this.Ci.i(Fn,"reset initSegment ready: "+this.Cg)},i.AA=function(){t.prototype.AA.call(this),this.Io!==Ut.NONE&&(this.Io=Ut.NONE,this.jg(),this.Cy(),this.eA.paused||this.bA())},i.IA=function(){this.eA.seeking||(this.sg=this.eA.currentTime),t.prototype.IA.call(this),kt()&&performance.now()-this.mg>I.i&&(this.Yg(),this.mg=performance.now())},i.dA=function(){this.Sa&&t.prototype.dA.call(this),this.Ci.i(Fn,"seeked. "+this.Do.currentTime+"/"+this.Do.streamTime.getStreamTime(this.Do.currentTime))},i.lA=function(){if(this.Ci.i(Fn,"video waiting "+this.Do.currentTime),this.lg&&this.Do.stat.box===l.i.flv&&this.Do.stat.isLive)this.stopLoad();else{this.Io=this.Io||Ut.WAITING;var t=this.Do.bufferedSec,e=!this.eA.ended&&!this.eA.seeking&&this.Io===Ut.WAITING;this.emit(S.a.WAITING,{block:e,bufferedSec:t})}},i.gA=function(t){var e,i,n;if(this.Ci.i(Fn,"video error@"+this.Do.currentTime+" "+(null==(e=this.eA.error)?void 0:e.message)),!this.nA&&this.Sa){var r=(null==(i=this.eA.error)?void 0:i.code)||0,a=(null==(n=this.eA.error)?void 0:n.message)||"video error",o=Object(D.d)(D.c[r]||D.a.VIDEO_ERROR,a);this.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,o,a))}},i.DA=function(){var e;t.prototype.DA.call(this),this.Lm&&this.Lm.heartbeat(),this.Do.isLiveShift&&this.Do.updateLiveShiftStatuByTime(),null==(e=this.rg)||e.heartbeat(),this.Jm&&this.Do.isLiveShiftKwai2&&this.Jm.updateDuration(this.Do.getLiveShiftKwai2Duration()),this.Yg()},i.Rg=function(){this.Lm&&(!this.Ob&&ce&&(this.Ob=new ce(this.Do)),this.Ob&&this.Ob.addTracks(this.Do.lctx.subtitleTracks))},i.py=function(){this.cg=!0,this.eA.pause()},i.gy=function(){var t=this;!this.ug&&this.rg&&(this.ug={play:this.eA.play,pause:this.eA.pause},this.eA.pause=function(){t.ug.pause.call(t.eA),t.rg&&t.rg.waiting&&t.rg.isCanvasRenderer&&!t.cg&&(t.rg.pausedOnWaiting=!0),t.cg=!1},this.eA.play=function(){return t.rg&&t.rg.waiting&&t.rg.isCanvasRenderer?(t.rg.pausedOnWaiting=!1,Promise.resolve()):t.ug.play.call(t.eA)})},o()(e,[{key:"type",get:function(){return l.a.mse}}])}(Vt),Hn={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"']},Gn={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"']},zn={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"']},Wn={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"']},Kn={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"]},Yn=function(){function t(){}return t.isMSEAvailable=function(){if(void 0!==t.Iy)return t.Iy;if(!jn)return t.Iy=!1,!1;var e=vt(),i=At();if(t.Oy=!!(e&&i&&i.prototype&&"function"==typeof i.prototype.appendBuffer&&"function"==typeof i.prototype.remove),e&&E.a.mobile&&t.Oy)try{var n=new e,r=document.createElement("video");r.src=URL.createObjectURL(n),URL.revokeObjectURL(r.src),t.Iy=!0}catch(e){t.Iy=!1}else t.Iy=t.Oy;return t.Iy},t.isMSECodecCapabilityNormal=function(){return t.isMSEAvailable()&&t.TYPE_SUPPORTED.h264},t.isSupported=function(e){return void 0===e&&(e=l.c.h264),t.isMSECodecSupported(e)&&t.isMSEAvailable()},t.isMSECodecSupported=function(e,i,n){if(void 0===e&&(e=l.c.h264),void 0===i&&(i=l.q.FHD),void 0===n&&(n=!1),E.a.msedge&&"windows"===E.a.platform||E.a.msie)return t.isMSEAvailable()&&e===l.c.h264;if(!1===t.wy(e,i))return!1;var r=t.Ey(e,i,n);return!!r&&r.reduce((function(e,i){return e||t.isMSECodecStrSupported(i)}),!1)},t.isVideoCodecSupported=function(e,i,n){if(void 0===e&&(e=l.c.h264),void 0===i&&(i=l.q.FHD),void 0===n&&(n=!1),E.a.msedge&&"windows"===E.a.platform||E.a.msie)return e===l.c.h264;if(!1===t.wy(e,i))return!1;var r=t.Ey(e,i,n);if(!r)return!1;var a=t.jy();return r.reduce((function(t,e){return t||!(!a||!a.canPlayType(e))}),!0)},t.isVideoBoxSupported=function(e){if(void 0===e&&(e=l.i.mp4),e===l.i.unknown)return!0;var i=Kn[e];if(!i)return!1;var n=t.jy();return i.reduce((function(t,e){return t||!(!n||!n.canPlayType(e))}),!1)},t.isVideoCodecStrSupportedInMp4=function(e,i){void 0===i&&(i="");try{var n=t.jy();return!(!n||!n.canPlayType((i||"video")+'/mp4;codecs="'+e+'"'))}catch(t){}return!1},t.isWebRTCSupported=function(){return"RTCPeerConnection"in window&&"RTCRtpTransceiver"in window},t.isMSECodecStrSupportedInMp4=function(t,e){var i;return void 0===e&&(e=""),!(null==(i=vt())||!i.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"'))},t.isMSECodecStrSupported=function(t){var e=vt();return!(!e||"function"!=typeof e.isTypeSupported||!e.isTypeSupported(t))},t.isChangeTypeSupported=function(){if(void 0===t.Cv){var e=At();t.Cv=!(!e||void 0===e.prototype.changeType)}return t.Cv},t.getVideoCodecCompatibilityByCodec=function(e,i,n){void 0===i&&(i=l.q.FHD),void 0===n&&(n=!1);var r=l.d.unsupported,a=!0;e===l.c.h264?r=i===l.q.UHD_4K?(n?t.TYPE_SUPPORTED.h264Hdr4k:t.TYPE_SUPPORTED.h2644k)?l.d.buildin:l.d.unsupported:(n?t.TYPE_SUPPORTED.h264Hdr:t.TYPE_SUPPORTED.h264)?l.d.buildin:l.d.unsupported:e===l.c.av1?(r=i===l.q.UHD_4K?(n?t.TYPE_SUPPORTED.av1Hdr4k:t.TYPE_SUPPORTED.av14k)?l.d.buildin:l.d.unsupported:(n?t.TYPE_SUPPORTED.av1Hdr:t.TYPE_SUPPORTED.av1)?l.d.buildin:l.d.unsupported,a=P()>=2):e===l.c.hevc?(r=i===l.q.UHD_4K?(n?t.TYPE_SUPPORTED.hevcHdr4k:t.TYPE_SUPPORTED.hevc4k)?l.d.buildin:l.d.unsupported:(n?t.TYPE_SUPPORTED.hevcHdr:t.TYPE_SUPPORTED.hevc)?l.d.buildin:l.d.unsupported)===l.d.buildin?(E.a.msedge&&"windows"===E.a.platform&&(r=l.d.unsupported),a=!!(P()>=2||E.a.safari)):a=t.wasmSmooth:e!==l.c.kvc3&&e!==l.c.kvc4&&e!==l.c.kvc5&&e!==l.c.kvc6&&e!==l.c.vvc&&e!==l.c.kvc30&&e!==l.c.bvc2||(r=typeof WebAssembly<"u"?l.d.wasm:l.d.unsupported,a=t.wasmSmooth);var o=!1;return r===l.d.buildin&&(o=t.isChangeTypeSupported(),e===l.c.hevc&&!1===t.wy(e,i)&&(r=l.d.wasm)),{decoder:r,smooth:r!==l.d.unsupported&&a,mix:o}},t.getPlayTestDefinition=function(t){if("number"==typeof t.width&&"number"==typeof t.height){if((null==t?void 0:t.width)>1920||(null==t?void 0:t.height)>1920)return l.q.UHD_4K}else if(-1!==t.qualityType.toLowerCase().indexOf("4k"))return l.q.UHD_4K;return l.q.FHD},t.Ey=function(t,e,i){void 0===e&&(e=l.q.FHD),void 0===i&&(i=!1),t===l.c.unknown&&(t=l.c.h264);var n=i?Gn:Hn,r=i?Wn:zn;return e===l.q.UHD_4K&&r[t]||n[t]},t.wy=function(e,i){if(void 0===i&&(i=l.q.FHD),e===l.c.hevc&&t.playHEVCTest&&(i===l.q.UHD_4K&&!1===t.playHEVCTest[i]||i!==l.q.UHD_4K&&!1===t.playHEVCTest[l.q.FHD]))return!1},t.jy=function(){return an||U()||(an=document.createElement("video")),an},t.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(t){return!1}},t.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]))},o()(t,null,[{key:"isSupportSimd",get:function(){return void 0===t.Sy&&(t.Sy=t.My()),t.Sy}},{key:"isSupportThreads",get:function(){return void 0===t.By&&(t.By=t.ky()),t.By}},{key:"wasmSmooth",get:function(){if(void 0===t.Ty){var e=P();t.Ty=!!(t.isSupportHW&&t.isSupportThreads&&e&&e>=6)}return t.Ty}},{key:"isSupportHW",get:function(){return!!Object(_t.b)().performance}},{key:"playHEVCTest",get:function(){return this.Dy},set:function(t){this.Dy=t}}])}();rn=Yn,Yn.Cv=void 0,Yn.Iy=void 0,Yn.Oy=void 0,Yn.Sy=void 0,Yn.By=void 0,Yn.Ty=void 0,Yn.Dy=void 0,Yn.TYPE_SUPPORTED={mpeg:rn.isMSECodecStrSupported("audio/mpeg"),mp3:rn.isMSECodecSupported(l.c.mp3),opus:rn.isMSECodecSupported(l.c.opus),aac:rn.isMSECodecSupported(l.c.aac),hevc:rn.isMSECodecSupported(l.c.hevc),hevc4k:rn.isMSECodecSupported(l.c.hevc,l.q.UHD_4K),hevcHdr:rn.isMSECodecSupported(l.c.hevc,l.q.FHD,!0),hevcHdr4k:rn.isMSECodecSupported(l.c.hevc,l.q.UHD_4K,!0),av1:rn.isMSECodecSupported(l.c.av1),av14k:rn.isMSECodecSupported(l.c.av1,l.q.UHD_4K),av1Hdr:rn.isMSECodecSupported(l.c.av1,l.q.FHD,!0),av1Hdr4k:rn.isMSECodecSupported(l.c.av1,l.q.UHD_4K,!0),h264:rn.isMSECodecSupported(l.c.h264),h2644k:rn.isMSECodecSupported(l.c.h264,l.q.UHD_4K),h264Hdr:rn.isMSECodecSupported(l.c.h264,l.q.FHD,!0),h264Hdr4k:rn.isMSECodecSupported(l.c.h264,l.q.UHD_4K,!0)};var Qn=Yn,Xn=i(49),Zn="dec-wrapper",qn=function(){function t(t){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 i=t.data;e.Ly&&e.Ai.emit(i.event,i.data)},this.Jc=function(t){e.Do.logger.i(Zn,"worker onerror",t.message),e.Ai.emit(S.a.ERROR,Object(D.e)(D.b.DECODER_ERROR,D.a.DECODER_DEC_ERROR,"dec: "+t.message))},this.Do=t,this.Ai=t.evt}var e=t.prototype;return e.init=function(t){void 0===t&&(t=!0),this.Do.logger.i(Zn,"init worker: "+t),t&&(this.Ly=V()(61)),this.Ly?(this.Ly.addEventListener("message",this.zc),this.Ly.addEventListener("error",this.Jc)):this.Ry=new Xn.a(this.Do.logger,this.Ai)},e.start=function(t,e,i,n,r){this.Do.logger.i(Zn,"start");var a=this.Do.getDecConfig();this.Ly?this.Ly.postMessage({cmd:F.a.INIT_265,id:this.At,lib:t,config:a,simd:i,threads:e,codecType:n,decoderType:r,contextId:this.Do.id,hasExternalLogger:!!this.Do.config.logger}):this.Ry&&this.Ry.init(this.At,t,a,i,e,n,r)},e.destroy=function(){this.Ly?(this.Ly.postMessage({cmd:F.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)},e.append=function(t){this.Ly?this.Ly.postMessage({cmd:F.a.APPEND_DATA,data:t}):this.Ry&&this.Ry.appendData(t)},e.endOfData=function(){this.Ly?this.Ly.postMessage({cmd:F.a.END_OF_DATA}):this.Ry&&this.Ry.endOfData()},e.updateMediaInfo=function(t){this.Ly?this.Ly.postMessage({cmd:F.a.MEDIA_INFO,mediaInfo:t}):this.Ry&&this.Ry.updateMediaInfo(t)},e.reset=function(t){this.Ly?this.Ly.postMessage({cmd:F.a.RESET,decId:this.At,seeking:t}):this.Ry&&this.Ry.reset(this.At,t)},e.seek=function(t,e){this.Do.logger.i(Zn,"seek["+e+"]: time: "+t),this.Ly?this.Ly.postMessage({cmd:F.a.SEEK,time:t,id:e}):this.Ry&&this.Ry.seek(t,e)},e.update=function(t,e,i,n,r,a){this.Ly?this.Ly.postMessage({cmd:F.a.UPDATE_STATE,streamTime:t,output:e,active:i,frameBufLen:n,playbackRate:r,maxFrameBufLen:a}):this.Ry&&this.Ry.updateState(t,e,i,n,r,a)},o()(t,[{key:"id",get:function(){return this.At},set:function(t){this.At=t}},{key:"isUseingWorker",get:function(){return!!this.Ly}}])}(),Jn=[4,2],$n=[8,6,4,2],tr=function(t){return t[t.data=0]="data",t[t.end=1]="end",t}(tr||{}),er="v-dec-proxy",ir=function(t){function e(e){var i;return(i=t.call(this,e)||this).Ny=[],i.Qy=void 0,i.Ym=0,i.xy=!0,i.Vy=[],i.Gm={streamTime:0,stoped:!1,output:l.s.canvas,decAppendActive:!0,frameBufLen:0,maxFrameBufLen:0,pictMode:R.a.contain},i.Uy=void 0,i.Qu=l.c.hevc,i.Vf=l.t.kw265,i.Ju=1,i.Fy=void 0,i.Py=void 0,i.Hy=void 0,i.Yy=!1,i.Gy=function(t){i.Ci.i(er,"dec lib loaded"),i.Do.stat.wasmLibHitCache=t.hitCache,i.Ky(t.lib)},i.Zy=function(t){i.Do.updateVideoPlaybackQuality(t.decoded,t.droped),t.decId===i.Ju&&i.sf.append(t.frame)},i.Wy=function(t){var e;i.Ci.i(er,"seek["+t.id+"]: decoder seek event.",t),(null==(e=i.zu)?void 0:e.id)!==t.id&&i.Xy(i.seek)?t.preventFollowUp=!0:(t.hitCache&&(i.if=!1),t.hitCache||(i.ub(!0),i.hf()),i.oc(t))},i.Xy=function(t){var e;if(null!=(e=i.Py)&&e.id&&i.Py.time>=0){i.Ci.i(er,"seek["+i.Py.id+"]: has pending seek.");var n=i.Py,r=n.time,a=n.id;return i.Py=void 0,i.zu={id:a,time:r,state:"dec"},i.seek(r,a),!0}return!1},i.Km=function(){var t,e;i.Ci.i(er,"on dec ready."),i.if=!1,!1!==i.ef||null!=(t=i.Do.video)&&t.ended||null==(e=i.Do.video)||null==(e=e.play())||e.catch((function(t){return i.Ci.i(er,"on dec ready, call play() fail.",t)})),i.ef=void 0},i.Zm=function(){var t,e;null!=(t=i.Do.video)&&t.ended||(i.Ci.i(er,"on dec waiting."),i.rf.onWaiting(),i.if=!0,void 0===i.ef&&(i.ef=!(null==(e=i.Do.video)||!e.paused)))},i.zy=function(t){for(i.Ci.i(er,"on dec init complete"),i.No=!0,i.Jy();i.Ny.length;){var e=i.Ny.shift();e&&(e.type===tr.data&&e.data?i.Qy.append(e.data):e.type===tr.end&&i.Qy.endOfData())}i.Do.stat.wasmSimd=t.simd,i.Do.stat.wasmThreads=t.threads,i.Do.stat.wasmDecoder=t.decoderType},i.qy=function(){i.Yy=!0},i.Wm=function(t){var e,n;i.Ci.i(er,"seek["+t.id+"]: renderer seek event",t,"pending:",i.Py),t.hitCache?null!=(e=i.Py)&&e.id?i.Xy(i.seek):(i.if=!1,i.oc(t)):(i.Ai.emit(S.a.DECODER_WAITING),null!=(n=i.Py)&&n.id?i.Xy(i.Qy.seek):(i.zu&&(i.zu.state="dec"),i.Qy.seek(t.time,t.id)))},i.Xm=function(){var t;i.Ci.i(er,"on ren waiting."),void 0===i.ef&&(i.ef=!(null==(t=i.Do.video)||!t.paused)),i.Ai.emit(S.a.DECODER_WAITING)},i.zm=function(){i.Km()},i.$y=function(){i.Ci.i(er,"renderer buf expired"),i.sf.reset(!0)},i.t_=function(t){i.xy=!!t.needMore},i.Yb(),i.Hy=new pt(i.Do),i.Gm.maxFrameBufLen=i.rf.maxFrameBufLen,i.Uy=Qn.isSupportSimd,e.stat.wasmThreadsEnabled=!!(Qn.isSupportThreads&&i.Do.config.maxVideoDecThreads>1),i.Qy=new qn(e),i.O.push(i.Qy),x&&i.O.push(i.Do.fallback.register(O.RELOAD_WASM,new x(i.Do).setRetryFunc(i.i_.bind(i)))),i.Qy.id=i.sf.id=i.Ju,i}u()(e,t);var i=e.prototype;return i.Yb=function(){var t=this,e=this.Ai;this.O.push(e.prependListener(S.a.DEC_LIB_LOADED,this.Gy),e.prependListener(S.a.DEC_INIT_COMPLETE,this.zy),e.prependListener(S.a.DECODER_IMG,this.Zy),e.prependListener(S.a.DEC_VIDEO_READY,this.Km),e.prependListener(S.a.DECODER_SEEK,this.Wy),e.prependListener(S.a.DECODER_WAITING,this.Zm),e.prependListener(S.a.DECODER_DATA_END,(function(){return t.sf.endOfData()})),e.prependListener(S.a.DECODER_BUF_LOW,(function(){return t.qy()})),e.prependListener(S.a.DECODER_DROP_FRAME,(function(e){return t.sf.dropFrame(e)})),e.prependListener(S.a.RENDERER_BUF_UPDATE,this.t_),e.prependListener(S.a.RENDERER_BUF_EXPIRED,this.$y),e.prependListener(S.a.RENDERER_SEEK,this.Wm),e.prependListener(S.a.RENDERER_WAITING,this.Xm),e.prependListener(S.a.RENDERER_WAITING_END,this.zm))},i.init=function(t,e){this.Ci.i(er,"init codecType: "+t+" bitDepth: "+e),t&&(this.Qu=t),t===l.c.kvc3?this.Vf=l.t.kvc3:t===l.c.kvc4?this.Vf=l.t.kvc4:t===l.c.kvc5?this.Vf=l.t.kvc5:t===l.c.kvc6?this.Vf=l.t.kvc6:t===l.c.hevc?(this.Vf=l.t.kw265,e&&e>8&&(this.Vf=l.t.h265)):t!==l.c.bvc2&&t!==l.c.kvc30&&t!==l.c.vvc||(this.Vf=l.t.kvc30),this.sf.id=this.Ju,this.sf.init(!(!E.a.chrome||!1!==this.Do.stat.mainThreadRendering)),this.Qy.init(!this.Do.config.mainThreadDecoding),this.e_()},i.setMediaInfo=function(e){t.prototype.setMediaInfo.call(this,e),this.Jy()},i.appendData=function(t){this.No?(this.Yy=!1,this.Qy.append(t)):this.Ny.push({type:tr.data,data:t})},i.endOfData=function(){this.Ci.i(er,"endOfData"),this.No?this.Qy.endOfData():this.Ny.push({type:tr.end})},i.decoderChange=function(t,e){this.Ci.i(er,"decoderChange type: "+t+" time: "+e),this.Fy=t;var i=this.Vy;t===l.d.wasm?(!i.length||i.length&&-1!==i[i.length-1].end)&&i.push({start:e,end:-1}):t===l.d.buildin&&i.length&&-1===i[i.length-1].end&&(i[i.length-1].end=e)},i.onParsingData=function(t){var e=this;t.segments.forEach((function(t){t.type===l.o.AUDIO&&e.Ym++}))},i.heartbeat=function(){var t;this.Ci.i(er,"hb decAppend: "+this.xy+" waiting: "+this.if+" seeking: "+(null==(t=this.zu)?void 0:t.id))},i.seek=function(t,e){var i,n;this.Ci.i(er,"seek["+e+"]: seek. time:"+t+". state:"+(this.zu?this.zu.state+"|"+(null==(i=this.zu)?void 0:i.id):""));var r=t*I.b;null!=(n=this.zu)&&n.id?"renderer"===this.zu.state?(this.Ci.i(er,"seek["+e+"]: pending."),this.Py={id:e,time:t,state:"pending"}):(this.Ci.i(er,"seek["+e+"]: seek start. dec seeking."),this.zu={id:e,time:t,state:"dec"},this.Qy.seek(r,e),this.start()):(this.Ci.i(er,"seek["+e+"]: seek start."),this.zu={id:e,time:t,state:"renderer"},this.sf.seek(r,e),this.start())},i.seekWithLoad=function(){this.Ci.i(er,"seekWithLoad. dec ready: "+this.No),this.No?(this.ub(!0),this.hf()):this.Ny=[]},i.clean=function(){this.Ci.i(er,"clean"),this.ub(!1)},i.screenshot=function(t){this.sf.screenshot(t)},i.hf=function(){var t,e=null==(t=this.Do.cOutput)?void 0:t.canvas;if(e instanceof HTMLCanvasElement){var i,n,r=this.Do.currentTime*I.b,a=!1,o=!(null==(i=this.Do.video)||!i.ended),s=(null==(n=this.Do.video)?void 0:n.playbackRate)||1,u=this.isCanvasRenderer?l.s.canvas:l.s.video,c=this.af(e),h=this.xy,d=this.Gm,f=M.a.getPictModeByCss(e);if(this.Do.cOutput&&this.Do.cOutput.rendererType!==u&&(d.output=u,a=!0,this.Ai.emit(S.a.VIDEO_RENDERER_CHANGE,{enabled:!0,type:d.output,canvas:void 0})),0!==r||this.Ym||(r=-1),d.streamTime===r&&d.stoped===o&&d.decAppendActive===h&&d.frameBufLen===this.sf.frameBufLen&&d.maxFrameBufLen===this.rf.maxFrameBufLen&&d.pictMode===f||(d.streamTime=r,d.stoped=o,d.decAppendActive=h,d.frameBufLen=this.sf.frameBufLen,d.maxFrameBufLen=this.rf.maxFrameBufLen,d.pictMode=f,this.Do.stat.frameBufLen=d.frameBufLen,a=!0),!a&&!this.if&&!c)return;(a||this.if)&&this.Qy.update(r,u,h,this.sf.frameBufLen,s,d.maxFrameBufLen),(a||c)&&this.sf.update(r,this.yt.w,this.yt.h,o,u,d.maxFrameBufLen,f)}},i.Jy=function(){if(this.Sa.length&&this.No){var t=this.Sa.shift();if(t){var e={};t.rotation&&(e.rotation=((null==t?void 0:t.rotation)||0)%360,e.rotation<0&&(e.rotation+=360)),t.fps&&(e.fps=t.fps),t.colorInfo&&(e.colorInfo=JSON.parse(JSON.stringify(t.colorInfo))),e.sar=t.sar,this.Qy.updateMediaInfo(e),this.sf.updateMediaInfo(e)}}},i.ub=function(t){void 0===t&&(t=!1),this.Ci.i(er,"reset",t),this.Ju++,this.xy=!0,this.Ym=0,this.Vy=[],t||(this.zu=void 0,this.Py=void 0),this.Fy===l.d.wasm&&this.Vy.push({start:0,end:-1}),this.Qy.id=this.sf.id=this.Ju,this.Qy.reset(t),this.sf.reset(t),this.if=!0},i.e_=function(t){void 0===t&&(t=!1),void 0===this.Uy||void 0===this.Do.stat.wasmThreadsEnabled?(this.Uy=!!Qn.isSupportSimd,this.Do.stat.wasmThreadsEnabled=!!(Qn.isSupportThreads&&this.Do.config.maxVideoDecThreads>1),this.Hy.load(t,this.Vf,this.Uy,this.Do.stat.wasmThreadsEnabled)):this.Hy.load(t,this.Vf,this.Uy,this.Do.stat.wasmThreadsEnabled)},i.Ky=function(t){this.Ci.i(er,"init dec"),this.start();var e=this.Do.stat.wasmThreadsEnabled?this.n_():1;this.Qy.id=this.Ju,this.Qy.start(t,e,!!this.Uy,this.Qu,this.Vf)},i.n_=function(){var t=Math.min(P(),this.Do.config.maxVideoDecThreads),e=$n;this.Vf===l.t.kw265&&(e=Jn);for(var i=0;i<e.length;i++)if(t>=e[i])return e[i];return e[e.length-1]},i.oc=function(t){this.Ci.i(er,"seek["+t.id+"]: seeked. hit cache: "+t.hitCache+"."),this.zu=void 0},i.i_=function(){this.e_(!0)},o()(e,[{key:"isCanvasRenderer",get:function(){var t=this.Vy.length;if(t)for(var e=this.Do.currentTime,i=t-1;i>=0;i--){var n=this.Vy[i];if(n&&e>=n.start&&(e<n.end||-1===n.end))return!0}return!1}},{key:"decBufLow",get:function(){return this.Yy}}])}(Y),nr=536870912,rr={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:l.e.STANDARD,enableAacPriv:!1,mseDecErrSkip:2,maxAudioFramesDrift:5,forceKeyFrameOnDiscontinuity:!1,videoDropFramePolicy:l.r.AUTO,videoDecBlockPolicy:l.p.WAITING,videoFrameBufferSize:nr,maxVideoDecThreads:8,mainThreadRendering:!1,mainThreadDecoding:!1,wasmDecoderEnabled:!E.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:l.g.NONE,preferNativeLoader:void 0,playbackAbilityCacheTimeout:864e5,adjustFragTime:!0},ar={maxRetry:1,retryDelay:100,connectionTimeout:1e4,levelConnectionTimeout:1e4,manifestConnectionTimeout:1e4},or=function(){function t(){}return t.isStreamingSupported=function(){return void 0===t.s_&&(t.s_=T.isSupported()||!!m.isSupportChunk()),t.s_},t.processConfig=function(t){if(t){var e=t.src,i=t.preprocessUrl,n=t.logger;t=r()(JSON.parse(JSON.stringify(t)),{src:e,preprocessUrl:i,logger:n})}t.isLive?rr.videoFrameBufferSize=104857600:rr.videoFrameBufferSize=nr;var a=y(t.box)?r()({},rr,ar):r()({},rr);return r()(a,t),a.wasmDecoderEnabled=a.wasmDecoderEnabled&&!!ir,a.startPlayBufferSec=Math.min(5,Math.max(0,a.startPlayBufferSec)),this.r_(a),Worker||(a.webWorker=!1),a},t.r_=function(t){var e=t.autoPlaybackRateConf;if(e){var i=e.rule;if(i&&Array.isArray(i)&&((i=i.filter((function(t){return t.upper>t.lower&&t.rate>0}))).sort((function(t,e){return e.rate-t.rate})),i.length>1))return e.rule=i,void(t.autoPlaybackRateConf=e)}},t}();or.s_=void 0;var sr="event-bus-consumer-manager",ur=function(){function t(t,e){this.Ci=void 0,this.h_=[],this.Ai=void 0,t.i(sr,"constructor"),this.Ci=t,this.Ai=e,this.o_()}var e=t.prototype;return e.destroy=function(){this.Ci.i(sr,"destroy"),this.Ai.removeAllListeners(),this.h_.splice(0,this.h_.length)},e.register=function(t,e){void 0===e&&(e=!1),this.Ci.i(sr,"register",t.getName()),e?this.h_.unshift(t):this.h_.push(t),t.setEvtEmitter(this.Ai)},e.unregister=function(t){for(var e=this.h_.length-1;e>=0;e--)t===this.h_[e]&&this.h_.splice(e,1)},e.o_=function(){var t=this;Object.values(S.a).forEach((function(e){var i="on"+e.charAt(0).toUpperCase()+e.slice(1);t.Ai.on(e,(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var a=0;a<t.h_.length;a++){var o=t.h_[a];if(o&&i in o){var s,u=(s=o[i]).call.apply(s,[o].concat(n));if(null!=u&&u.stop)break}}}))}))},o()(t,[{key:"evt",get:function(){return this.Ai}}])}(),cr=function(t){function e(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return(e=t.call.apply(t,[this].concat(n))||this).Ai=void 0,e}u()(e,t);var i=e.prototype;return i.getName=function(){throw new Error("getName method must be override.")},i.setEvtEmitter=function(t){this.Ai=t},i.emit=function(t,e){var i;return(null==(i=this.Ai)?void 0:i.emit(t,e))||!1},i.onWorkerLog=function(t){},e}(h.a),lr="exposed-event",hr=function(t){function e(e,i){var n;return(n=t.call(this)||this).Do=void 0,n.Ci=void 0,n.a_=void 0,n.Do=e,n.Ci=e.logger,n.a_=i,n}u()(e,t);var i=e.prototype;return i.onReport=function(t){this.a_.emit(S.a.REPORT,t)},i.onError=function(t){if((null==t||!t.preventFollowUp)&&t.fatal){var e=r()({},t);if(this.Do.stat.coreType===l.a.native){var i=this.Do.stat.retryInfo.getLastMseError();i&&(this.Ci.i(lr,"replace error info by mse error."),r()(e,{type:i.type,details:i.details,reason:i.reason,code:i.code}),void 0!==i.url&&(e.url=i.url),void 0!==i.statusCode&&(e.statusCode=i.statusCode))}this.a_.emit(S.a.ERROR,e)}},i.onManifestParsed=function(t){null!=t&&t.preventFollowUp||this.a_.emit(S.a.MANIFEST_PARSED,t)},i.onLevelSwitching=function(t){this.a_.emit(S.a.LEVEL_SWITCHING,t)},i.onLevelSwitched=function(t){this.a_.emit(S.a.LEVEL_SWITCHED,t)},i.onLevelSwitchFailed=function(){this.a_.emit(S.a.LEVEL_SWITCH_FAILED)},i.onLevelUpdated=function(t){this.a_.emit(S.a.LEVEL_UPDATED,t)},i.onLevelSwitchPlaying=function(t){this.a_.emit(S.a.LEVEL_SWITCH_PLAYING,t)},i.onAudioTrackSwitching=function(t){this.a_.emit(S.a.AUDIO_TRACK_SWITCHING,t)},i.onAudioTrackSwitched=function(t){this.a_.emit(S.a.AUDIO_TRACK_SWITCHED,t)},i.onAudioTrackUpdated=function(t){this.a_.emit(S.a.AUDIO_TRACK_UPDATED,t)},i.onAudioTrackSwitchFailed=function(){this.a_.emit(S.a.AUDIO_TRACK_SWITCH_FAILED)},i.onSubtitleTrackSwitched=function(t){this.a_.emit(S.a.SUBTITLE_TRACK_SWITCHED,t)},i.onLoadEnd=function(t){null!=t&&t.preventFollowUp||this.a_.emit(S.a.LOAD_END)},i.onVideoRendererChange=function(t){this.a_.emit(S.a.VIDEO_RENDERER_CHANGE,t)},i.onH265Detected=function(t){this.a_.emit(S.a.H265_DETECTED,t)},i.onScreenshot=function(t){-1===t.pts&&(t.pts=this.Do.video?1e3*this.Do.video.currentTime:0),this.a_.emit(S.a.SCREENSHOT,t)},i.getName=function(){return lr},e}(cr),dr=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){if(this.getAvailable()&&this.Do.hasNextMediaDesc()&&(this.Do.stat.coreType===l.a.mse||this.Do.stat.coreType===l.a.native)&&(this.Ci.i("fallback-next-desc","run"),this.Do.nextMediaDesc()))return this.Pc({type:l.k.FALLBACK,message:"use next media description.",fallback:O.NEXT_DESC})},e}(L),fr="fallback-swap-to-264",pr=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){var e;if(this.getAvailable()&&t.type===D.b.MEDIA_ERROR&&(t.details===D.a.VIDEO_ERROR||t.details===D.a.VIDEO_ERROR_3||t.details===D.a.VIDEO_ERROR_4||t.details===D.a.VIDEO_NO_SIZE)&&this.Do.canCodecFallback&&this.Do.video instanceof HTMLVideoElement&&(this.Do.stat.coreType===l.a.mse||this.Do.stat.coreType===l.a.native&&(null==(e=this.Do.video)||!e.videoWidth))&&this.Do.stat.codecType!==l.c.h264&&this.Do.stat.decoder===l.d.buildin){var i="metadata video size: "+this.Do.video.videoWidth+". fallback 264";this.Ci.i(fr,"run"),this.Do.reProcessSrc(l.c.h264,this.Do.stat.native);var n=this.Pc({type:l.k.FALLBACK,message:i,fallback:O.SWAP_264});return void 0===Qn.playHEVCTest&&(this.Ci.i(fr,"play hevc test start"),this.Do.hevcTest.start()),n}},e}(L),_r=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){if(this.getAvailable()&&this.Do.stat.coreType===l.a.native&&this.Do.stat.native&&0!==t.statusCode&&Qn.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:l.k.FALLBACK,message:e,fallback:O.SWAP_CORE})}},e}(L),vr=function(t){function e(){return t.apply(this,arguments)||this}return u()(e,t),e.prototype.run=function(t){var e=Et(t.reason);if(this.getAvailable()&&this.Do.stat.coreType===l.a.mse&&!this.Do.stat.native&&!this.Do.isLiveShift){var i=t.reason,n=!1;if(t.details===D.a.DEMUX_NOT_FOUND?(i="demux not found",n=!0):(this.Do.stat.box!==l.i.mp4&&this.Do.stat.box!==l.i.unknown||this.Do.stat.decoder!==l.d.buildin||t.details!==D.a.SOURCEBUFFER_ERROR&&t.details!==D.a.MEDIASOURCE_ERROR&&t.details!==D.a.ADDSOURCEBUFFER_ERROR&&(t.type!==D.b.NETWORK_ERROR||t.details===D.a.DEC_LIB_LOAD_ERROR||t.details===D.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED||0!==t.statusCode||Object(D.f)(t.reason)||Object(D.g)(t.reason)))&&(this.Do.stat.box!==l.i.mp4||e!==l.o.AUDIO||this.Do.stat.recoverSwapRemux||t.details!==D.a.VIDEO_ERROR_3)?(this.Do.stat.box===l.i.mp4&&t.details===D.a.VIDEO_ERROR_4&&t.reason.indexOf("CHUNK_DEMUXER_ERROR_APPEND_FAILED")>=0||this.Do.stat.box===l.i.mp4&&e===l.o.AUDIO&&this.Do.stat.decoder===l.d.wasm&&t.type===D.b.MSE_ERROR&&this.Do.stat.codecType===l.c.hevc&&Qn.isVideoCodecSupported(l.c.hevc))&&(n=!0):n=!0,n)return this.Ci.i("fallback-swap-to-native","run@"+this.Do.currentTime,this.Do.stat.startFromSec,this.Do.config.startFromSec),this.Do.stat.decoder===l.d.wasm&&this.emit(S.a.VIDEO_RENDERER_CHANGE,{enabled:!0,canvas:void 0,type:l.s.video}),this.Do.reProcessSrc(void 0,!0),this.Pc({type:l.k.FALLBACK,message:i+". swap to native.",fallback:O.SWAP_CORE})}},e}(L),Ar=i(18),gr="ios-compatible",mr=function(t){function e(e,i){var n;return(n=t.call(this)||this).Do=void 0,n.Ci=void 0,n.u_=void 0,n.c_=!1,n.f_=void 0,n.A_=function(){var t=n.Do.video;n.f_=setTimeout((function(){n.Ci.i(gr,"fix play stuck",null==t?void 0:t.currentTime),t&&n.u_((null==t?void 0:t.currentTime)+.001)}),1e3)},n.v_=function(){n.f_&&(clearTimeout(n.f_),n.f_=void 0)},n.Do=e,n.Ci=e.logger,n.u_=i,n.Ci.i(gr,"constructor"),n}u()(e,t);var i=e.prototype;return i.onLoad=function(){this.d_()},i.destroy=function(){this.Ci.i(gr,"destroy"),this.d_()},i.onVisibilityChange=function(t){this.Ci.i(gr,"onVisibilityChange",t.hidden),!t.hidden&&E.a.ios&&(this.Ci.i(gr,"ios hidden false. play stuck detector on."),this.c_=!0)},i.onPlay=function(){this.c_&&(this.Ci.i(gr,"on play. start detector timer."),this.c_=!1,this.A_())},i.onTimeupdate=function(){this.f_&&this.d_()},i.getName=function(){return gr},i.d_=function(){this.Ci.i(gr,"reset"),this.c_=!1,this.v_()},e}(cr),br=function(t){return t.METADATA="metadata",t.MEDIA_INFO="mediaInfo",t.HEARTBEAT="heartbeat",t.DOWNLOAD="download",t.REALTIME_BEACON="realtimeBeacon",t.DISCONTINUITY="discontinuity",t.KEY_FRAME="keyFrame",t.PRIV_NAL="privNal",t.SEI="sei",t.AAC_PRIV="aacPriv",t}({}),yr=function(){function t(){var t=this;this.yb=void 0,this.Oc=void 0,this.l_=void 0,this.xc=function(){t.b_()},this.p_=function(){t.Oc&&t.Oc.readyState>=2&&t.b_()},this.b_=function(){t.Oc&&t.l_&&t.l_(t.Oc.status),t.stop()}}var e=t.prototype;return e.start=function(t,e){this.l_=e,this.Oc&&this.stop();var i=this.Oc=new XMLHttpRequest;i.open("GET",t,!0),i.onreadystatechange=this.p_,i.onerror=this.xc,i.onload=this.xc,i.send(),this.yb=setTimeout(this.b_,1e3)},e.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},t}(),Er="kernel-native",Cr=function(t){function e(e){var i;return(i=t.call(this,e)||this).m_=void 0,i.g_=!1,i.O.push(i.Do.fallback.register(O.USE_BACKUP,new gt(e).setRetryFunc(i.Ug.bind(i)))),i}u()(e,t);var i=e.prototype;return i.Ug=function(t){this.RA(l.h.retry)},i.load=function(t){var e;this.Ci.i(Er,"load",this.Do.stat.startFromSec);var i=this.Do.lctx.levels;if(i.length||this.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.MANIFEST_PARSING_ERROR,"manifest parse error. core: native")),this.Do.stat.drm)this.emit(S.a.ERROR,Object(D.e)(D.b.KEY_SYSTEM_ERROR,D.a.KEY_SYSTEM_UNSUPPORTED,"DRM unsupported."));else{var n=this.Do.lctx.default,r=this.Do.lctx.startIdx;"number"==typeof r&&r>=0&&r<i.length&&(n=r,this.Ci.i(Er,"set level from level startIdx.")),this.Ci.i(Er,"level: "+n+" "+(null==(e=i[n])?void 0:e.qualityType)),this.Do.lctx.currentIdx=this.Do.lctx.nextIdx=n,this.Do.lctx.abr=!1,this.emit(S.a.MANIFEST_PARSED,{levels:[],currentLevel:0}),this.RA(t)}},i.onAbrLevelsUpdated=function(){},i.refresh=function(){var t,e=this;this.Do.stat.startFromSec=this.eA.currentTime,this.RA(l.h.retry),null==(t=this.eA.play())||t.catch((function(t){return e.Ci.i(Er,"refresh. call play() fail.",t)}))},i.stopLoad=function(){this.emit(S.a.STOP_LOAD),this.kA()},i.setCurrentLevel=function(t){var e=this;this.Ci.i(Er,"set current level: "+t+" @ "+this.eA.currentTime);var i=this.Do;if(i.lctx.levels.length){if(t>=0&&t<i.lctx.levels.length&&i.lctx.currentIdx!==t){i.lctx.currentIdx=i.lctx.nextIdx=t;var n,r=i.lctx.current;if(r)return this.Io=Ut.SELECT_BITRATE,i.stat.startFromSec=this.eA.currentTime,this.rA++,this.emit(S.a.LEVEL_SWITCHING,{time:i.currentTime,bitrate:r.bitrate,level:t,smooth:!1,auto:!1,id:this.rA}),this.y_(i.lctx.currentIdx),!this.eA.paused&&(null==(n=this.eA.play())||n.catch((function(t){return e.Ci.i(Er,"set current level, call play() fail.",t)}))),void this.emit(S.a.LEVEL_SWITCHED,{time:i.currentTime,bitrate:r.bitrate,level:t,smooth:!1,auto:!1,id:this.rA})}this.emit(S.a.LEVEL_SWITCH_FAILED)}else i.lctx.currentIdx=i.lctx.nextIdx=t},i.setNextLevel=function(t){this.setCurrentLevel(t)},i.liveEnd=function(){},i.destroy=function(){this.Ci.i(Er,"destroy"),this.m_&&(this.m_.stop(),this.m_=void 0),t.prototype.destroy.call(this),this.eA.src=""},i.mA=function(){this.nA||this.eA.src||this.load(),t.prototype.mA.call(this)},i.AA=function(){var e=this.Do,i=e.lctx.current;i&&this.Io===Ut.SELECT_BITRATE&&this.emit(S.a.LEVEL_SWITCH_PLAYING,{time:e.currentTime,bitrate:i.bitrate,level:e.lctx.currentIdx,smooth:!1,auto:!1,id:this.rA}),this.Io!==Ut.NONE&&(this.Io=Ut.NONE),t.prototype.AA.call(this)},i.IA=function(){var e=this.Do;t.prototype.IA.call(this),this.g_&&(this.Ci.i(Er,"timeupdate start from: "+e.stat.startFromSec),this.__(),this.g_=!1)},i.lA=function(){this.Ci.i(Er,"video waiting"),this.Io=this.Io||Ut.WAITING;var t=this.Do.bufferedSec,e=!this.eA.ended&&!this.eA.seeking&&this.Io===Ut.WAITING;this.emit(S.a.WAITING,{block:e,bufferedSec:t})},i.CA=function(){var e;(E.a.android||void 0===this.Do.stat.isLive||0===(null==(e=this.Sa)?void 0:e.width))&&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(S.a.MEDIA_INFO,this.Sa)),this.C_()&&this.eA.duration>0&&(this.Ci.i(Er,"check video dec failed. on android wechat hls duration change."),this.I_()),t.prototype.CA.call(this)},i.fA=function(){if(this.Ci.i(Er,"video loadeddata. duration: "+this.eA.duration+" box: "+this.Do.stat.box),!(!this.C_()&&this.eA instanceof HTMLVideoElement&&(this.Ci.i(Er,"check video dec failed. on video loaded data."),this.I_()))){void 0===this.Do.stat.isLive&&this.eA.duration>0&&(this.Do.stat.isLive=!isFinite(this.eA.duration)),this.Sa={videoDecoder:l.d.buildin},this.eA instanceof HTMLVideoElement&&(this.Ci.i(Er,"video loadeddata. width: "+this.eA.videoWidth+" height: "+this.eA.videoHeight),this.Sa.width=this.eA.videoWidth,this.Sa.height=this.eA.videoHeight);var t=this.Do,e=t.lctx.current;if(e&&e.codec){var i=We(e.codec);this.Sa.audioCodec=i.audio,this.Sa.videoCodec=i.video,i.video&&(t.stat.codecType=Ye(i.video))}this.Sa.videoCodecType=t.stat.codecType,E.a.android?t.stat.startFromSec&&(this.g_=!0):this.__(),this.emit(S.a.MEDIA_INFO,this.Sa)}},i.vA=function(){this.Ci.i(Er,"seeking "+this.eA.currentTime);var t=this.eA.currentTime;this.uA?this.uA=!1:(this.emit(S.a.SEEKING),this.Do.isTimeinBuffered(t)||this.emit(S.a.SEEK_WITH_LOAD))},i.gA=function(t){var e,i=this;this.Ci.i(Er,"video error",t);var n=(null==(e=this.eA.error)?void 0:e.code)||0,r=Object(D.d)(D.c[n]||D.a.VIDEO_ERROR,"video error");if(4===n&&this.Do.canCodecFallback)this.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,r,"buildin "+this.Do.stat.codecType+" dec error. video error: "+n));else{var a="video error";this.eA&&this.eA.error&&(a+=" code:"+n+" message:"+this.eA.error.message);var o=Object(D.e)(D.b.MEDIA_ERROR,(n?D.c[n]:D.a.VIDEO_ERROR)||D.a.VIDEO_ERROR,a,{url:this.eA.src});2===n||4===n?(this.m_||(this.m_=new yr),this.Ci.i(Er,"video error start detect status code."),this.m_.start(this.eA.src,(function(t){i.Ci.i(Er,"video error check http status code:",t),(2===n||4===n&&t>0)&&(t<200||t>299)?i.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.LOAD_ERROR,a,{statusCode:t,url:i.eA.src})):(0===t&&(o.statusCode=0),i.emit(S.a.ERROR,o))}))):this.emit(S.a.ERROR,o)}},i.RA=function(e){this.Ci.i(Er,"_load type: "+e),this.Sa=void 0,this.nA=void 0,this.Do.isLiveShift?this.emit(S.a.ERROR,Object(D.e)(D.b.OTHER_ERROR,D.a.UNSUPPORTED,"unsupported. core: "+this.type+" liveShift: "+this.Do.stat.liveShiftType)):(this.Io=Ut.LOADING,t.prototype.RA.call(this,e),this.emit(S.a.LOAD,{type:e}),this.y_(this.Do.lctx.currentIdx),this.TA())},i.y_=function(t){var e=this.Do,i=e.lctx.current;if(i){var n;this.Ci.i(Er,"level",t);var r,a=i.currentUrl;this.emit(S.a.NEW_SOURCE,{sync:e.stat.startFromSec||0}),null!=(n=this.Do.config.preprocessUrl)&&n.stream&&(this.Ci.d(Er,"preprocessUrl stream"),a=null==(r=this.Do.config.preprocessUrl)?void 0:r.stream(a)),this.Ci.i(Er,"play: "+a),this.eA.src=a}},i.__=function(){var t=this.Do;t.stat.startFromSec>0&&(this.Ci.i(Er,"start from: "+t.stat.startFromSec),this.eA.currentTime=t.stat.startFromSec,t.stat.startFromSec=0)},i.I_=function(){return this.Ci.i(Er,"check video dec failed."),!!(this.eA instanceof HTMLVideoElement&&!this.eA.videoWidth&&this.Do.canCodecFallback)&&(this.emit(S.a.ERROR,Object(D.e)(D.b.MEDIA_ERROR,D.a.VIDEO_NO_SIZE,"buildin "+this.Do.stat.codecType+" dec no width.")),!0)},i.C_=function(){return E.a.android&&(E.a.xweb||E.a.x5)&&y(this.Do.stat.box)},o()(e,[{key:"type",get:function(){return l.a.native}}])}(Vt),Tr=i(45),Ir=i.n(Tr),Rr=function(){function t(){this.O_=0,this.w_=0,this.E_=0,this.j_=0,this.an=void 0,this.an=this.k_()}var e=t.prototype;return e.reset=function(){this.an=this.k_(),this.O_=0,this.w_=0,this.E_=0,this.j_=0},e.parse=function(t){var e=this,i=this.an,n=0,r=0,a="",o="",s="",u="";i.totalReceive=0,t.forEach((function(t){if("inbound-rtp"===t.type){if("video"===t.mediaType){var c=t.timestamp-e.O_;e.O_&&(n=(t.bytesReceived-e.E_)/c),e.E_=t.bytesReceived,e.O_=t.timestamp,i.key=t.keyFramesDecoded,i.videoPacketsLost=t.packetsLost,o=t.codecId,u=t.trackId}else if("audio"===t.mediaType){var l=t.timestamp-e.w_;e.j_&&(r=(t.bytesReceived-e.j_)/l),e.j_=t.bytesReceived,i.audioPacketsLost=t.packetsLost,a=t.codecId,s=t.trackId}i.totalReceive+=t.bytesReceived,e.w_=t.timestamp}})),i.audioDataRate=Math.round(7.8125*r),i.videoDataRate=Math.round(7.8125*n),i.speed=1e3*(n+r),t.forEach((function(t){"codec"===t.type?t.id===o?i.videoCodec=t.mimeType:t.id===a&&(i.audioCodec=t.mimeType,i.audioChannelCount=t.channels,i.audioSampleRate=t.clockRate):"track"===t.type&&(t.id===u?(i.width=t.frameWidth,i.height=t.frameHeight,i.videoAvgJitterBufferDelay=t.jitterBufferDelay/t.jitterBufferEmittedCount):t.id===s&&(i.audioAvgJitterBufferDelay=t.jitterBufferDelay/t.jitterBufferEmittedCount))}));var c=null,l=null;return t.forEach((function(e){"transport"===e.type&&(c=null==t?void 0:t.get(e.selectedCandidatePairId))})),c||t.forEach((function(t){"candidate-pair"===t.type&&t.selected&&(c=t)})),c&&c.remoteCandidateId&&(l=null==t?void 0:t.get(c.remoteCandidateId)),l&&(i.rtcRemoteAddress=l.address||l.ip||l.ipAddress,i.rtcRemotePort=l.port||l.portNumber),this.an=i,i},e.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}},o()(t,[{key:"result",get:function(){return this.an}}])}();function wr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?wr(Object(i),!0).forEach((function(e){Ir()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):wr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Dr="kernel-rtc",Sr=function(t){function e(e){var i;return(i=t.call(this,e)||this).vf=void 0,i.M_=void 0,i.YA=void 0,i.S_=void 0,i.B_="",i.T_=void 0,i.D_=!1,i._f=null,i.qf=0,i.R_=null,i.L_=void 0,i.N_=void 0,i.Q_=void 0,i.x_=void 0,i.V_=function(t){i.M_&&i.M_.getStats(null).then((function(e){var n=i.T_.parse(e);t(n)}),(function(t){return console.log(t)}))},i.YA={connectionTimeout:i.Do.config.sdpConnectionTimeout||1e4,maxRetry:0,retryDelay:i.Do.config.retryDelay||1e3},i.L_=i.Do.config.transmissionTimeout||1e4,i.N_=i.Do.config.peerConnectionTimeout||1e5,i.Q_=i.Do.config.peerConnectionMaxRetry||5,i.x_=i.Do.config.peerConnectionRetryDelay||3e3,i.T_=new Rr,i}u()(e,t);var i=e.prototype;return i.load=function(t){this.Ci.i(Dr,"load");var e=this.Do.lctx.current;e&&(this.B_=e.currentUrl),this.RA(t)},i.resume=function(){this.eA.paused&&this.refresh()},i.destroy=function(){t.prototype.destroy.call(this),this.U_(),this.sv(),this.eA&&(this.eA.srcObject=null),this.F_(),this.S_=void 0,this.vy()},i.refresh=function(){this.F_(),this.RA(l.h.retry)},i.stopLoad=function(){this.emit(S.a.STOP_LOAD),this.M_&&(this.M_.close(),this.M_=null),this.U_(),this.kA()},i.liveEnd=function(){},i.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})),t.prototype.cA.call(this)},i.DA=function(){var t=this;this.V_((function(e){var i;e.speed||t.R_||"connected"!==(null==(i=t.M_)?void 0:i.connectionState)?e.speed&&(t.R_&&clearTimeout(t.R_),t.R_=null):t.R_=+setTimeout((function(){var e=Object(D.e)(D.b.NETWORK_ERROR,D.a.WEBRTC_TRANSMISSION_DATA_NULL,"transmission timeout "+t.L_,{fatal:!1,url:t.B_});t.emit(S.a.ERROR,e),t.P_(e.reason)}),t.L_),t.Do.loadRec.setRTCStats(e),t.emit(S.a.HEARTBEAT)}))},i.AA=function(){this.Io!==Ut.NONE&&(this.Io=Ut.NONE),t.prototype.AA.call(this)},i.RA=function(t){var e=this;this.T_.reset(),this.Io=Ut.LOADING,this.emit(S.a.LOAD,{type:t}),this.emit(S.a.NEW_SOURCE,{sync:0}),this.M_&&this.M_.close(),this.H_(),this.Y_().catch((function(t){e.P_(null==t?void 0:t.reason)}))},i.internalSeek=function(t){},i.vy=function(){this.eA&&(this.eA.srcObject=null)},i.P_=function(t){var e=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(){e.qf++,e.Ci.i(Dr,"retry",e.qf,t,e.B_),e.emit(S.a.RETRY,{type:l.k.RTC,message:"reason: "+t+". retry: "+e.qf,code:D.a.WEBRTC_FAILED_ERROR}),e._f=null,e.H_(),e.Y_().then((function(){e.qf=0,e.D_=!1}),(function(i){e.qf<e.Q_?e.P_(t):e.emit(S.a.ERROR,Lr(Lr({},i),{},{fatal:!0,url:e.B_}))}))}),this.x_))},i.U_=function(){this._f&&(clearTimeout(this._f),this._f=null)},i.G_=function(t){var e=this;this.sv();var i=this.vf=new dt(this.Ci),n={url:this.B_,responseType:"text",requestBody:t,requestMethod:"POST",progress:!1,headers:[{header:"Content-type",value:"application/json"}]};return new Promise((function(t,r){i.load(n,{onEnd:function(i,n){if(e.sv(),"string"==typeof n){var r=JSON.parse(n);e.emit(S.a.LEVEL_UPDATED),t(r.sdp)}},onError:function(t,i){if(e.Ci.i(Dr,"loadSdp",i),i.fatal){var n={type:D.b.NETWORK_ERROR,details:D.a.RTC_SDP_LOAD_ERROR,reason:i.errMessage,fatal:i.fatal,url:e.B_};e.sv(),r(n)}},onAbort:function(){e.sv(),r()}},e.YA)})).catch((function(t){return Promise.reject(t)}))},i.H_=function(){var t=this,e=this.M_=new RTCPeerConnection;return e.addEventListener("track",(function(e){return t.K_(e)})),e.addEventListener("connectionstatechange",(function(e){return t.Z_(e)})),e.addEventListener("icecandidateerror",(function(e){return t.W_(e)})),e.addEventListener("signalingstatechange",(function(e){return t.X_(e)})),e.addEventListener("iceconnectionstatechange",(function(e){return t.z_(e)})),e.addEventListener("icegatheringstatechange",(function(e){return t.J_(e)})),e.addTransceiver("audio",{direction:"recvonly"}),e.addTransceiver("video",{direction:"recvonly"}),e},i.F_=function(){this.M_&&this.M_.close(),this.M_=null},i.Y_=function(){var t=this,e=this.M_;return e||Promise.reject("PeerConnection isn't exist"),this.q_().then((function(e){return t.G_(JSON.stringify({sdp:e.sdp}))})).then((function(e){return t.tC(e)})).then((function(){return e?new Promise((function(i,n){var r=setTimeout((function(){var e=Object(D.e)(D.b.NETWORK_ERROR,D.a.WEBRTC_CONNECT_TIMEOUT,"webrtc connect timeout",{fatal:!1,url:t.B_});t.emit(S.a.ERROR,e),n(e)}),t.N_);e.addEventListener("connectionstatechange",(function t(){switch(e.connectionState){case"connected":i(void 0),clearTimeout(r),e.removeEventListener("connectionstatechange",t);break;case"closed":case"disconnected":case"failed":clearTimeout(r),e.removeEventListener("connectionstatechange",t),n({type:D.b.NETWORK_ERROR,details:D.a.WEBRTC_CONNECT_FAILED,fatal:!1,reason:e.onconnectionstatechange})}}))})):Promise.reject("PeerConnection isn't exist")})).catch((function(e){return t.Ci.i(Dr,e),Promise.reject(e)}))},i.q_=function(){var t=this,e=this.M_;return e?e.createOffer().then((function(i){return t.Ci.i(Dr,"offer",i),e.setLocalDescription(i).then((function(){return i}))}),(function(e){t.Ci.i(Dr,"offer",e);var i=Object(D.e)(D.b.NETWORK_ERROR,D.a.WEBRTC_OFFER_ERROR,"webrtc createoffer error"+e,{fatal:!1,url:t.B_});return t.emit(S.a.ERROR,i),Promise.reject(i)})):Promise.reject()},i.tC=function(t){var e=this,i=this.M_;if(!i||"closed"===i.signalingState)return Promise.reject();var n=new RTCSessionDescription({type:"answer",sdp:t});return i.setRemoteDescription(n).then((function(){e.Ci.i(Dr,"answer",n)}),(function(t){e.Ci.i(Dr,"answer",t);var i=Object(D.e)(D.b.NETWORK_ERROR,D.a.WEBRTC_ANSWER_ERROR,"webrtc answer error",{fatal:!1,url:e.B_});return e.emit(S.a.ERROR,i),Promise.reject(i)}))},i.K_=function(t){if(this.Do.video&&t.streams&&this.S_!==t.streams[0]){var e,i=this.S_=t.streams[0];this.Do.video.srcObject=i||null;var n=this.Sa={videoDecoder:l.d.buildin};null==(e=t.streams[0])||e.getTracks().forEach((function(t){var e=t.getSettings();n.width=e.width||n.width,n.height=e.height||n.height,n.fps=e.frameRate||n.fps}))}},i.Z_=function(t){var e=this.M_;if(e)switch(this.Ci.i(Dr,"pcConnectionStateChange",e.connectionState,t),e.connectionState){case"connecting":case"connected":break;case"disconnected":case"failed":case"closed":this.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.WEBRTC_DISCONNECTED_ERROR,e.connectionState,{fatal:!1,url:this.B_})),!this.D_&&this.P_("PeerConnection state is "+e.connectionState)}},i.W_=function(t){var e;this.Ci.i(Dr,"iceCandidateError",t),this.emit(S.a.ERROR,Object(D.e)(D.b.NETWORK_ERROR,D.a.WEBRTC_ICE_CANDIDATE_ERROR,(null==(e=this.M_)?void 0:e.iceConnectionState)||"",{fatal:!1})),!this.D_&&this.P_("iceCandidateError")},i.X_=function(t){var e;this.Ci.i(Dr,"signalingStateChange",null==(e=this.M_)?void 0:e.signalingState,t)},i.z_=function(t){var e;this.Ci.i(Dr,"iceConnecttionStateChange",null==(e=this.M_)?void 0:e.iceConnectionState,t)},i.J_=function(t){var e;this.Ci.i(Dr,"iceGatheringStateChange",null==(e=this.M_)?void 0:e.iceGatheringState,t)},i.sv=function(){this.vf&&(this.vf.destroy(),this.vf=void 0)},o()(e,[{key:"type",get:function(){return l.a.rtc}}])}(Vt),Or="kwai-kernel-id",Nr=function(){function t(){}return t.next=function(){if(it.available){var e=t.uf.read(Or,!1),i=t.At;return"number"==typeof e?(i=this.getNextId(e),this.uf.write(Or,i)):(i=this.getNextId(i),this.uf.write(Or,i)),t.At=i,i}return t.At=t.getNextId(t.At),t.At},t.getNextId=function(e){return++e>t.MAX_ID?0:e},o()(t,null,[{key:"MAX_ID",get:function(){return 999}}])}();Nr.At=0,Nr.uf=new it;var kr="sei-time",xr=function(t){function e(e){var i;return(i=t.call(this)||this).Do=void 0,i.iC=0,i.Ci=void 0,i.eC={idx:0,data:[],name:"sei"},i.nC={idx:0,data:[],name:"aacPriv"},i.sC={idx:0,data:[],name:"privNal"},i.$g=function(t){t.segments.forEach((function(t){t.type===l.o.VIDEO?(t.sei&&i.rC(t.sei,i.eC),t.privNal&&i.rC(t.privNal,i.sC)):t.type===l.o.AUDIO&&t.aacPriv&&i.rC(t.aacPriv,i.nC)})),i.hC()},i.kl=function(t){t.sei&&i.rC(t.sei,i.eC),i.hC()},i.oC=function(){var t;if(null==(t=i.Do.video)||!t.seeking){var e=1e3*i.Do.currentTime,n=i.aC(e,i.eC);null==n||n.forEach((function(t){i.Do.evt.emit(S.a.SEI,t)}));var r=i.aC(e,i.nC);null==r||r.forEach((function(t){i.Do.evt.emit(S.a.AAC_PRIV,t)}));var a=i.aC(e,i.sC);null==a||a.forEach((function(t){i.Do.evt.emit(S.a.PRIV_NAL,t)}))}},i.aC=function(t,e){if(e.data.length&&e.idx<e.data.length){for(var i=[],n=0,r=e.idx;r<e.data.length;r++){var a;if(!(t>=((null==(a=e.data[r])?void 0:a.time)||0)))break;i.push(e.data[r]),n=r}if(i.length)return e.idx=n+1,i}},i.uC=function(){i.Ci.i(kr,"seek with load. remove all sei"),i.eC.data.splice(0),i.eC.idx=0,i.nC.data.splice(0),i.nC.idx=0,i.sC.data.splice(0),i.sC.idx=0,i.iC=0},i.cC=function(){var t=1e3*i.Do.currentTime;i.fC(t,i.eC),i.fC(t,i.nC),i.fC(t,i.sC)},i.fC=function(t,e){for(var i=0;i<e.data.length;i++)if(e.data[i].time>=t){e.idx=i;break}},i.rC=function(t,e){t.forEach((function(t){t&&"number"==typeof t.streamTimestamp&&(t.time=i.Do.streamTime.getLocalTime(t.streamTimestamp/1e3),"number"==typeof t.time&&(t.time=Math.round(1e3*t.time),e.data.push(t)))})),e.data.sort((function(t,e){return t.time-e.time}))},i.hC=function(){var t=i.Do.video;if(i.iC>20&&t&&t.buffered.length){var e=1e3*t.buffered.start(0);i.AC(e,i.eC),i.AC(e,i.nC),i.AC(e,i.sC),i.iC=0}i.iC++},i.AC=function(t,e){if(e.data.length&&t>e.data[0].time)for(var n=0;n<Math.min(e.idx,e.data.length);n++)if(e.data[n].time>=t){e.data.splice(0,n),e.idx=Math.max(0,e.idx-n),i.Ci.i(kr,"remove "+n+" "+e.name+" info @"+t+". remain "+e.data.length);break}},i.Do=e,i.Ci=e.logger,i.O.push(i.Do.evt.on(S.a.PARSING_DATA,i.$g),i.Do.evt.on(S.a.RAW_DATA,i.kl),i.Do.evt.on(S.a.TIMEUPDATE,i.oC),i.Do.evt.on(S.a.SEEK_WITH_LOAD,i.uC),i.Do.evt.on(S.a.SEEKING,i.cC)),i}return u()(e,t),o()(e,[{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}}])}(h.a),Pr="stream-time",Mr=function(t){function e(e){var i;return(i=t.call(this)||this).Ci=void 0,i.Do=void 0,i.vC=[],i.dC=void 0,i.jl=function(t){t.expired||t.segments.forEach((function(e){var n;e.type===l.o.VIDEO&&e.keyTime&&(e.keyTime.forEach((function(t){t.key&&i.Do.evt.emit(S.a.KEY_FRAME,{pts:t.pts,cts:t.cts})})),(n=i.vC).push.apply(n,e.keyTime.map((function(e){return r()({frag:t.frag},e)}))),i.vC.sort((function(t,e){return t.pts-e.pts}))),e.type===l.o.AUDIO&&e.originFirstDTS&&(i.dC=e.originFirstDTS-e.startDTS)}))},i.kl=function(t){var e;t.keyTime&&!t.expired&&(e=i.vC).push.apply(e,t.keyTime.map((function(e){return r()({frag:t.frag},e)})))},i.uC=function(){var t,e=(null==(t=i.Do.video)?void 0:t.currentTime)||0,n=i.Do.lctx.current,r=0;if(i.Ci.i(Pr,"on seek with load. current time: "+i.Do.currentTime),i.Do.stat.multipart&&Object.prototype.hasOwnProperty.call(n,"fragments")){var a=bt(e,n.fragments);if(!a)return i.Ci.i(Pr,"no frag. clear video key time."),void i.vC.splice(0,i.vC.length);for(var o=i.vC.length-1;o>=0;o--){var s;if((null==(s=i.vC[o].frag)?void 0:s.sn)===a.sn||i.vC[o].originPTS<e){r=o;break}}}i.Ci.i(Pr,"clear video key time. st: "+r),i.vC.splice(r,i.vC.length-r)},e.logger.i(Pr,"constructor"),i.Do=e,i.Ci=e.logger,i.O.push(i.Do.evt.on(S.a.PARSING_DATA,i.jl),i.Do.evt.on(S.a.RAW_DATA,i.kl),i.Do.evt.on(S.a.SEEK_WITH_LOAD,i.uC)),i}u()(e,t);var i=e.prototype;return i.reset=function(){this.Ci.i(Pr,"reset"),this.dC=void 0,this.vC=[]},i.getLocalTime=function(t){if(!(t<0)){if(this.vC.length){var e=this.lC(t,this.vC);if(e)return t-e.originPTS+e.pts}return"number"==typeof this.dC?t-this.dC:void 0}},i.getStreamTime=function(t){if(!(t<0)){if(this.vC.length){var e,i=this.bC(t,this.vC);if(i)return this.Ci.i(Pr,"get stream time by video. local: "+t+" pts: "+i.info.pts+" originPTS: "+i.info.originPTS+" sn: "+(null==(e=i.info.frag)?void 0:e.sn)+" key: "+this.vC.length),t-i.info.pts+i.info.originPTS}return this.Ci.i(Pr,"get local time by audio. local: "+t+" offset: "+this.dC),"number"==typeof this.dC?t+this.dC:void 0}},i.getKeyFrameTime=function(t,e){if(void 0===e&&(e=0),this.vC.length){var i=this.bC(t,this.vC);return i?this.vC[i.idx+e]:void 0}},i.bC=function(t,e){if(e)for(var i=e.length-1;i>=0;i--)if(e[i].pts<=t)return{info:e[i],idx:i}},i.lC=function(t,e){if(e)for(var i=e.length-1;i>=0;i--)if(e[i].originPTS<=t)return e[i]},o()(e,[{key:"localTimeOffset",get:function(){return this.dC},set:function(t){this.dC=t}}])}(h.a),Ur=function(t){return t.SERIES_12="15_pro_max/15_plus/14_pro_max",t.SERIES_11="15_pro/15/14_pro",t.SERIES_10="14_plus/13_pro_max/12_pro_max",t.SERIES_9="14/13/13_pro/12/12_pro",t.SERIES_8="se_3/se_2/8/7/6s/6",t.SERIES_7="13_mini/12/11_pro/xs/x",t.SERIES_6="11_pro_max/xs_max",t.SERIES_5="11/xr",t.SERIES_4="8_plus/7_plus/6s_plus/6_plus",t.SERIES_3="se/5c/5s/5",t.SERIES_2="4s/4",t.SERIES_1="3gs/3g/1",t}({}),Br={"430_932_3":Ur.SERIES_12,"393_852_3":Ur.SERIES_11,"428_926_3":Ur.SERIES_10,"390_844_3":Ur.SERIES_9,"375_667_2":Ur.SERIES_8,"375_812_3":Ur.SERIES_7,"414_896_3":Ur.SERIES_6,"414_896_2":Ur.SERIES_5,"414_736_3":Ur.SERIES_4,"320_568_2":Ur.SERIES_3,"320_480_2":Ur.SERIES_2,"320_480_1":Ur.SERIES_1};function Vr(){if(E.a.iphone&&typeof window<"u"&&window.screen){var t=window.screen.width+"_"+window.screen.height+"_"+window.devicePixelRatio;return Br[t]||"unknown"}return"unknown"}var Fr,jr=i(25),Hr=new RegExp("_([0-9]+)x([0-9]+)(_([0-9]+))?(_([0-9]+))?(_(420|422|444|mono))?"),Gr=["mono","420","422","444"],zr=function(){function t(){this._=[]}var e=t.prototype;return e.append=function(t){this._.push(t)},e.clear=function(){this._=[]},e.getLastMseError=function(){for(var t=this._.length-1;t>=0;t--){var e=this._[t];if(e&&e.core===l.a.mse){var i=e.errorData;return i&&(i.code=Object(D.d)(i.details,i.reason,i.statusCode)),i}}},e.pC=function(t){return t.map((function(t){var e={message:t.message,pos:t.pos,ts:t.ts};return void 0!==t.code&&(e.code=t.code),void 0!==t.core&&(e.core=t.core),void 0!==t.count&&(e.count=t.count),void 0!==t.fallback&&(e.fallback=t.fallback),e}))},o()(t,[{key:"hasData",get:function(){return!!this._.length}},{key:"retryCount",get:function(){return this._.reduce((function(t,e){return("number"==typeof e.count&&e.count>0?e.count:1)+t}),0)}},{key:"mergedBeacon",get:function(){var t=[];return this._.forEach((function(e){var i;if(t.length&&e.type===l.k.LOADER&&(null==(i=t[t.length-1])?void 0:i.type)===l.k.LOADER){var n=t[t.length-1].count;t[t.length-1].count=n?n+1:2}else t.push(r()({},e))})),this.pC(t.slice(-10))}},{key:"beacon",get:function(){return this.pC(this._.slice(-10))}}])}(),Wr=function(){function t(){this.coreType=l.a.unknown,this.native=!1,this.codecType=l.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=l.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 zr,this.mainThreadRendering=void 0,this.stereoType=void 0,this.decoder=l.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=l.g.NONE}return t.prototype.reset=function(){this.coreType=l.a.unknown,this.codecType=l.c.unknown,this.audioCodec="",this.recoverSwapRemux=!1,this.recoverSwapAudioCodec=!1,this.box=l.i.unknown,this.autoLazyLoad=!0,this.firstFrameLoaded=!1,this.isNetworkInUse=!1,this.srcType=l.l.OTHERS,this.retryInfo.clear(),this.decoder=l.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=l.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},o()(t,[{key:"liveShiftActive",get:function(){return this.liveShiftType!==l.g.NONE&&this.mC},set:function(t){this.mC=t}},{key:"liveShiftType",get:function(){return this.isLive&&(this.gC!==l.g.KWAI&&this.gC!==l.g.KWAI2||!E.a.mobile)&&y(this.box)?this.gC:l.g.NONE},set:function(t){this.gC=t}}])}(),Kr=function(){function t(){this.yC=0,this._C=0,this.CC=0,this.IC=0,this.OC=0}var e=t.prototype;return e.reset=function(){this.CC=performance.now(),this.yC=this._C=this.IC=this.OC=0},e.getFPS=function(t){if(t){var e,i=performance.now(),n=t.totalVideoFrames,r=t.droppedVideoFrames;if(n){n<this._C&&(this._C=0,this.yC=0);var a=i-this.CC,o=r-this.yC,s=n-this._C,u=0,c=0;this.CC&&(u=parseFloat((1e3*o/a).toFixed(2)),c=parseFloat((1e3*s/a).toFixed(2))),this.IC=this.IC+=s,this.OC=this.OC+=o,this.CC=i,this.yC=r,this._C=n,e={decoded:this.IC,dropped:this.OC,decodedFPS:c,droppedFPS:u}}return this.CC=i,e}},t}(),Yr="level-ctx",Qr=function(){function t(t,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,t.i(Yr,"constructor abr:"+e),this.Ci=t,this.pb=e}var e=t.prototype;return e.getLevel=function(t){return void 0===t&&(t=l.f.MAIN),t===l.f.MAIN?this.Ll[this.EC]:t===l.f.AUDIO?this.MC[this.kC]:t===l.f.SUBTITLE?this.BC[this.SC]:void 0},e.setLevelIdx=function(t,e){void 0===e&&(e=l.f.MAIN),e===l.f.MAIN?this.currentIdx=t:e===l.f.AUDIO?this.audioIdx=t:e===l.f.SUBTITLE&&(this.subtitleIdx=t)},e.getLevelIdx=function(t){return void 0===t&&(t=l.f.MAIN),t===l.f.MAIN?this.EC:t===l.f.AUDIO?this.kC:t===l.f.SUBTITLE?this.SC:-1},e.setNextIdx=function(t,e){void 0===e&&(e=l.f.MAIN),e===l.f.MAIN&&(this.nextIdx=t)},e.getNextIdx=function(t){return void 0===t&&(t=l.f.MAIN),t===l.f.MAIN?this.jC:-1},e.clearFrag=function(){this.Ci.i(Yr,"clear"),[this.Ll,this.MC,this.BC].forEach((function(t){t.forEach((function(t){var e=t;e.fragments&&e.clear()}))}))},e.verifyLevelIdx=function(t){return this.Ll.length>0&&t<this.Ll.length&&t>=-1},e.verifyAudioTrackIdx=function(t){return this.MC.length>0&&t<this.MC.length&&t>=0},e.verifySubtitleTracksIdx=function(t){return this.BC.length>0&&t<this.BC.length&&t>=0},e.abrIndexToOrign=function(t){var e=this.TC[t];return e?e.index:0},e.orignIndexToAbr=function(t){var e=0;return this.TC.forEach((function(i,n){i.index!==t||(e=n)})),e},e.LC=function(){var t=this,e=this.RC;this.DC=0,this.TC=[],this.Ll.forEach((function(i,n){i.default&&!e&&(t.DC=n),i.enableAdaptive&&(!e||e&&-1!==e.indexOf(n))&&t.TC.push(i)})),this.TC.sort((function(t,e){return t.bitrate-e.bitrate}))},o()(t,[{key:"hasAudio",get:function(){return this.An},set:function(t){this.An=t}},{key:"hasVideo",get:function(){return this.fn},set:function(t){this.fn=t}},{key:"abr",get:function(){return this.pb},set:function(t){this.pb=t}},{key:"startIdx",get:function(){return this.wC},set:function(t){this.wC=t}},{key:"currentIdx",get:function(){return this.EC},set:function(t){t>=0&&(this.EC=t)}},{key:"nextIdx",get:function(){return this.jC},set:function(t){t>=0&&(this.jC=t)}},{key:"levels",get:function(){return this.Ll},set:function(t){this.Ll=t,this.LC()}},{key:"current",get:function(){return this.Ll[this.EC]}},{key:"currentUrl",get:function(){var t=this.Ll[this.EC];return(null==t?void 0:t.currentUrl)||""}},{key:"audioIdx",get:function(){return this.kC},set:function(t){t>=0&&(this.kC=t)}},{key:"audioTracks",get:function(){return this.MC},set:function(t){this.MC=t}},{key:"audio",get:function(){return this.MC[this.kC]}},{key:"subtitleIdx",get:function(){return this.SC},set:function(t){t>=0&&(this.SC=t)}},{key:"subtitleTracks",get:function(){return this.BC},set:function(t){this.BC=t}},{key:"subtitle",get:function(){return this.BC[this.SC]}},{key:"abrLevels",get:function(){return this.TC}},{key:"availableList",set:function(t){this.RC=t,this.LC()}},{key:"default",get:function(){return this.DC||0},set:function(t){this.DC=t}},{key:"abrDefault",get:function(){var t=0;return this.TC.forEach((function(e,i){e.default&&(t=i)})),t}}])}(),Xr=function(){function t(){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 e=t.prototype;return e.onStreamOpen=function(t,e,i,n){if(this.QC.length>10){var r=this.QC.shift();if(r){this.VC[r.vCodecType]=(this.VC[r.vCodecType]||0)+r.traffic;var a=r.qualityType||"unknown";this.UC[a]=(this.UC[a]||0)+r.traffic}}var o=this.FC?this.FC.index+1:0;this.FC={index:o,startPos:t,url:e,bitrate:i,qualityType:n,traffic:0,loadTimeCost:0,keyFrame:0,videoDataRate:0,audioDataRate:0,speed:0,vCodecType:l.c.unknown,segments:[]},this.QC.push(this.FC)},e.onMediaInfo=function(t){var e=this.QC[this.QC.length-1];e&&(t.videoCodecType&&(e.vCodecType=t.videoCodecType),e.mediaInfo=r()({},t))},e.setRTCStats=function(t){var e=this.FC;e&&(e.traffic=t.totalReceive,e.audioDataRate=t.audioDataRate,e.videoDataRate=t.videoDataRate,e.speed=t.speed,e.keyFrame=t.key,this.NC=e.traffic)},e.onDataReceive=function(t){this.NC+=t.byteLength;var e=this.xC;e.length>200&&e.pop(),e.unshift(t);var i=this.FC;i&&(i.traffic+=t.byteLength,i.loadTimeCost+=t.timeCost,i.speed=Math.round(i.traffic/i.loadTimeCost*1e3)||0)},e.onParsing=function(t){var e=this;t.segments.forEach((function(t){if(e.XC(t.type,1e3*(t.endDTS-t.startDTS),t.payload.byteLength),t.type===l.o.VIDEO){var i=t.endDTS-t.startDTS;isNaN(i)||(e.YC+=Math.round(1e3*i)),t.fillDuration&&(e.KC+=Math.round(1e3*t.fillDuration)),t.droppedDuration&&(e.WC+=Math.round(1e3*t.droppedDuration))}if(t.type===l.o.AUDIO){var n=t.endDTS-t.startDTS;isNaN(n)||(e.HC+=Math.round(1e3*n)),t.fillDuration&&(e.GC+=Math.round(1e3*t.fillDuration)),t.droppedDuration&&(e.ZC+=Math.round(1e3*t.droppedDuration))}}))},e.onRaw=function(t){if(t.samples.length){var e=t.samples.reduce((function(t,e){return e.yuv?t+e.yuv.y.bytes.length+e.yuv.u.bytes.length+e.yuv.v.bytes.length:t+e.units.reduce((function(t,e){return t+e.data.byteLength}),0)}),0),i=t.samples[t.samples.length-1].dts-t.samples[0].dts+(t.samples[t.samples.length-1].duration||0);this.XC(l.o.VIDEO,i/90,e)}},e.downloadInfoByRange=function(t){void 0===t&&(t=1e3);var e={size:0,timeCost:0};if(this.xC.length)for(var i=performance.now(),n=0;n<this.xC.length;n++){var r=this.xC[n];if(!(r&&r.ts>i-t))break;e.size+=r.byteLength,e.timeCost+=r.timeCost}return e},e.XC=function(t,e,i){var n=this.QC[this.QC.length-1];if(n){var r=n.segments;r.push({type:t,duration:e,byteLength:i}),r.length>200&&r.shift();for(var a=0,o=0,s=0;s<r.length;s++){var u=r[s];u&&u.type===t&&(o+=u.byteLength,a+=u.duration)}a>0&&(t===l.o.VIDEO?n.videoDataRate=Math.round(8*o/a):t===l.o.AUDIO&&(n.audioDataRate=Math.round(8*o/a)))}},o()(t,[{key:"smoothedDownloadSpeed",get:function(){var t=this.xC,e=t[0];return e&&!e.progress?e.byteLength/e.timeCost*1e3:1e3*t.reduceRight((function(t,e){var i=e.byteLength/e.timeCost;return t>0?i*(1-.9)+.9*t:i}),0)}},{key:"trafficGroupedByVCodecType",get:function(){var t=r()({},this.VC);return t.total=this.NC,this.QC.forEach((function(e){t[e.vCodecType]=(t[e.vCodecType]||0)+e.traffic})),t}},{key:"trafficGroupedByLevel",get:function(){var t=r()({},this.UC);return t.total=this.NC,this.QC.forEach((function(e){var i=e.qualityType||"unknown";t[i]=(t[i]||0)+e.traffic})),t}},{key:"traffic",get:function(){return this.NC}},{key:"speed",get:function(){var t=this.FC,e=this.downloadInfoByRange();return this.xC.length?e.timeCost?Math.round(e.size/e.timeCost*1e3):0:(null==t?void 0:t.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(t){this.PC=t}},{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}}])}(),Zr=i(42),qr=((Fr={})[l.q.FHD]="data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAA1Btb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAADmAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACenRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAADmAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAHgAAABDgAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA5gAAXcAAAEAAAAAAfJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAEk+AABJPgFXEAAAAAAAhaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAAAAAAGpbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABaXN0YmwAAAEFc3RzZAAAAAAAAAABAAAA9Wh2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAHgAQ4AEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAB7aHZjQwEBYAAAAJAAAAAAAHjwAPz9+PgAAA8DoAABABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAmhAAEALkIBAQFgAAADAJAAAAMAAAMAeKADwIAQ5ZZWaSTK8BagIIBAgAAAAwCAAAADAISiAAEAB0QBwXK0YkAAAAAQcGFzcAAAAAEAAAABAAAAFGJ0cnQAAAAAAAAV+AAAFfgAAAAYc3R0cwAAAAAAAAABAAAAAQAST4AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAACvwAAAAEAAAAUc3RjbwAAAAAAAAABAAADfAAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNjAuMTYuMTAwAAAACGZyZWUAAALHbWRhdAAAABhAAQwB//8BYAAAAwCQAAADAAADAHiVmAkAAAAuQgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDlllZpJMrwFqAggECAAAADAIAAAAMAhAAAAAdEAcFytGJAAAACYigBrxMImujggedddccbbbbbbuZo4//8Qs/H9kAtWJjtrvgCQAzQ8gAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwFbpe9yuAXAHyJgAAADAAADAAADAAADAAADAAADAAADAAADAAFJkwKEKkAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAZEhwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwPuAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAHpAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwABzQAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAUMAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwBsQAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwGHAAADAAADAAADAAADAAADAAADAAADAAADAAADAtoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAWMAAADAAADAAADAAADAAADAAADAAADAAADAAAJCAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAADygAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAABawAAADAAADAAADAAADAAADAAADAAADAAADAAAhYAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAALeAFwEAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAUUA=",Fr[l.q.UHD_4K]="data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAA1Ftb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAADmAABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACe3RyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAADmAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAPAAAACHAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAA5gAAXcAAAEAAAAAAfNtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAEk+AABJPgFXEAAAAAAAhaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAAAAAAGqbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABanN0YmwAAAEGc3RzZAAAAAAAAAABAAAA9mh2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAPAAhwAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAB8aHZjQwEBYAAAAJAAAAAAAJbwAPz9+PgAAA8DoAABABhAAQwB//8BYAAAAwCQAAADAAADAJaVmAmhAAEAL0IBAQFgAAADAJAAAAMAAAMAlqAB4CACHFllZpJMrwFqAggECAAAAwAIAAADAAhAogABAAdEAcFytGJAAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAAQGgAAEBoAAAAGHN0dHMAAAAAAAAAAQAAAAEAEk+AAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAABRzdHN6AAAAAAAACA0AAAABAAAAFHN0Y28AAAAAAAAAAQAAA30AAABidWR0YQAAAFptZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAAC1pbHN0AAAAJal0b28AAAAdZGF0YQAAAAEAAAAATGF2ZjYwLjE2LjEwMAAAAAhmcmVlAAAIFW1kYXQAAAAYQAEMAf//AWAAAAMAkAAAAwAAAwCWlZgJAAAAL0IBAQFgAAADAJAAAAMAAAMAlqAB4CACHFllZpJMrwFqAggECAAAAwAIAAADAAhAAAAAB0QBwXK0YkAAAAevKAGvEwRHlP3jty4cOG7Zs2bNmzZs2bNWrVq1atWrVq1atWvmaOP//ELPx/ZALViY7a74AkAM0PIAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAX8Cl73K4BcAfImAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAIWAkwKEKkAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMDMocAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMCkgAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAABgwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAasAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAFZAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAg4AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMCJgAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAABFQAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAkIAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAPqAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAHJAAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAACugAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAABDQAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAX8AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAIqAAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAC2gAAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAAAwAA54AAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAASkAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAXUAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAdMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAhYAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAmoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAq4AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAvoAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA04AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA5IAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA84AAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAA+oAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABCwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABEwAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMABHQAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAAAMAgIA=",Fr),Jr="kwai-kernel-hevc",$r="playback-hevc-test",ta=function(){function t(e){var i=this;this.Ci=void 0,this.uf=new it,this.zC=void 0,this.JC=[l.q.FHD,l.q.UHD_4K],this.qC=0,this.$C=void 0,this.tI=function(){var e,n;i.Ci.i($r,"on video event. "+(null==(e=t.iI)?void 0:e.videoWidth)+" "+(null==(n=t.iI)?void 0:n.error)),i.$C?(i.$C[i.JC[i.qC]]=!!t.iI&&t.iI.videoWidth>0&&!t.iI.error,i.qC++,i.qC<i.JC.length?(i.eI(),i.nI(i.JC[i.qC])):i.sI()):i.sI()},this.Ci=e}var e=t.prototype;return e.init=function(t){if(this.Ci.i($r,"init"),t>0){var e=this.uf.read(Jr,t);this.Ci.i($r,"load from ls",e);try{void 0!==e&&Object.prototype.hasOwnProperty.call(e,l.q.FHD)&&Object.prototype.hasOwnProperty.call(e,l.q.UHD_4K)&&(Qn.playHEVCTest=e,this.$C=Qn.playHEVCTest)}catch(t){this.Ci.i($r,"load ls error")}}},e.start=function(){var e;this.Ci.i($r,"start");var i=void 0!==this.$C||t.iI;this.Ci.i($r,"start. tested: "+i),i||null!=(e=t.iI)&&e.src||this.rI()},e.destroy=function(){this.Rf(),this.eI()},e.sI=function(){this.Ci.i($r,"complete result:",this.$C,performance.now()),this.Rf(),this.eI(),Qn.playHEVCTest=this.$C,this.uf.write(Jr,this.$C)},e.rI=function(){var t;this.Ci.i($r,"start video test"),U()?this.sI():(this.Rp(),this.$C=((t={})[l.q.FHD]=!1,t[l.q.UHD_4K]=!1,t),this.qC=0,this.nI(this.JC[0]))},e.nI=function(e){this.Ci.i($r,"test: "+e),t.iI||(t.iI=document.createElement("video")),t.iI.preload="metadata",t.iI.addEventListener("error",this.tI),t.iI.addEventListener("loadeddata",this.tI),t.iI.addEventListener("loadedmetadata",this.tI),t.iI.src=qr[e],t.iI.play().catch((function(){}))},e.eI=function(){t.iI&&(t.iI.removeEventListener("error",this.tI),t.iI.removeEventListener("loadeddata",this.tI),t.iI.removeEventListener("loadedmetadata",this.tI),t.iI.src="")},e.Rp=function(){var t=this;this.Rf(),this.zC=setTimeout((function(){t.Ci.i($r,"timeout"),t.sI()}),1e3)},e.Rf=function(){this.zC&&(clearTimeout(this.zC),this.zC=void 0)},t}();ta.iI=void 0;var ea=ta,ia="av-ctx",na=function(t){function e(e,i){var n;return(n=t.call(this)||this).video=void 0,n.mse=void 0,n.stat=new Wr,n.loadRec=void 0,n.lctx=void 0,n.hI=[],n.oI=0,n.aI=0,n.uI=void 0,n.di=void 0,n.cI=!1,n.fI=!1,n.Na=void 0,n.AI=void 0,n.vI=new Kr,n.dI=void 0,n.lI=void 0,n.At=void 0,n.Ci=void 0,n.Ai=void 0,n.bI=void 0,n.pI=void 0,n.mI=void 0,n.At=Nr.next(),n.Ci=(new Ar.Logger).setName(I.m).setId(n.At),n.Ai=new Rn.a,n.video=i,n.AI=new zi(n.Ci),n.lI=new ea(n.Ci),n.lctx=new Qr(n.Ci,!0),n.bI=new k(n),n.pI=new Mr(n),n.mI=new xr(n),n.gI(or.processConfig(e)),n.AI&&n.O.push(n.AI),n.O.push(n.lI,n.bI,n.pI,n.mI),n}u()(e,t);var i=e.prototype;return i.destroy=function(){var e;this.logger.i(ia,"destroy"),null==(e=this.stat.muxWorker)||e.terminate(),this.yI(),this._I(),this.Ai.removeAllListeners(),t.prototype.destroy.call(this)},i.updateVideoPlaybackQuality=function(t,e){this.stat.videoPlaybackQuality?(this.stat.videoPlaybackQuality.droppedVideoFrames=e,this.stat.videoPlaybackQuality.totalVideoFrames=t):this.stat.videoPlaybackQuality={corruptedVideoFrames:0,creationTime:0,droppedVideoFrames:e,totalVideoFrames:t}},i.isTimeinBuffered=function(t){if(this.video)for(var e=this.video.buffered,i=0;i<e.length;i++)if(t>=e.start(i)&&t<e.end(i))return!0;return!1},i.currentBuffer=function(t){if(this.video)for(var e=this.video.buffered,i=0;i<e.length;i++){var n=e.start(i),r=e.end(i);if(n<=t&&t<r)return{start:n,end:r}}},i.nextBuffer=function(t){if(this.video)for(var e=this.video.buffered,i=0;i<e.length;i++){var n=e.start(i),r=e.end(i);if(n>t)return{start:n,end:r}}},i.getLiveShiftKwai2OffsetUTC=function(t){return this.stat.liveStartTime+t},i.getLiveShiftKwai2Duration=function(){return(this.AI.now-this.stat.liveStartTime)/1e3},i.getKwai2LiveShiftReloadInterval=function(){var t=this.lctx.current;if(t){if(t.fragments.length>1&&"number"==typeof this.stat.liveShiftOffset){var e=t.fragments[t.fragments.length-2];return Math.max((t.averagetargetduration||t.targetduration)*I.f,(this.stat.liveShiftOffsetAligned||this.stat.liveShiftOffset)+e.start*I.f-this.currentTime*I.f)/this.playbackRate}return(t.averagetargetduration||t.targetduration)*I.f/this.playbackRate}return 10*I.f/this.playbackRate},i.getKwai2LiveShiftUrl=function(t){var e=this.lctx.current,i=ct()(t,!0),n=this.stat.liveShiftKwai2Params;if(this.AI){if("seqId"===n.paramName){var r=e.fragments[e.fragments.length-1],a=n.seqId||(null==r?void 0:r.sn);if("number"==typeof a)return i.query.seqID=a.toString(),i.toString()}return n.time=Math.round(this.getLiveShiftKwai2OffsetUTC(this.stat.liveShiftOffset||0)),i.query.startTime=n.time.toString(),i.toString()}return i.toString()},i.getLiveDelay=function(){var t=this.stat,e=this.di,i=10;if(t.multipart){var n=this.lctx.current;i=(null==n?void 0:n.averagetargetduration)||(null==n?void 0:n.targetduration)||i}return t.box===l.i.flv?-this.di.defaultSpts:y(t.box)?this.isLiveShift?e.liveShiftDelaySec*I.f:i*I.f*(e.liveDelayFragNum||1):-this.di.defaultSpts},i.initLiveShiftKwai2StartSec=function(){if(this.isLiveShiftKwai2){var t=this.stat.startFromSec>=0?this.stat.startFromSec:this.liveLocalTime;this.Ci.i(ia,"init liveshift kwai2 start from sec: "+t+" startFromSec: "+this.stat.startFromSec+" live: "+this.liveLocalTime+" duration: "+this.getLiveShiftKwai2Duration()),t>0&&(this.stat.startFromSec=t,this.stat.liveShiftOffset=1e3*t,this.stat.liveShiftOffsetAligned=void 0,this.updateLiveShiftStatuByTime(t))}},i.getRemuxConfig=function(){var t=this.di,e={isLive:this.stat.isLive,logLevel:t.logLevel,enableSoftwareAES:t.enableSoftwareAES,gopRemux:this.stat.gopRemux,preferDecoder:t.preferDecoder,streamingMux:this.streamingMux,ensureVideo:t.ensureVideo,maxAudioFramesDrift:t.maxAudioFramesDrift,forceKeyFrameOnDiscontinuity:t.forceKeyFrameOnDiscontinuity,wasmDecoderEnabled:t.wasmDecoderEnabled,enableAacPriv:t.enableAacPriv,audioEnabled:t.audioEnabled,videoEnabled:t.videoEnabled,mseDecErrSkip:t.mseDecErrSkip,adjustFragTime:t.adjustFragTime};return this.video instanceof HTMLAudioElement&&(this.Ci.i(ia,"HTMLAudioElement. set videoEnabled false."),e.videoEnabled=!1),e},i.getDecConfig=function(){var t=this.di;return{logLevel:t.logLevel,videoDropFramePolicy:t.videoDropFramePolicy,videoFrameBufferSize:t.videoFrameBufferSize,videoDecBlockPolicy:t.videoDecBlockPolicy,maxVideoDecThreads:t.maxVideoDecThreads,mainThreadRendering:t.mainThreadRendering,mainThreadDecoding:t.mainThreadDecoding,preferCanvasType:t.preferCanvasType,preferCanvasColorSpace:t.preferCanvasColorSpace}},i.setSrc=function(t,e){this.logger.i(ia,"set src",t),t&&(this.d_(),this.resetStreamingEnabled(),this.dI=void 0,this.loadRec=new Xr),this.CI(t,e)},i.reProcessSrc=function(t,e){this.logger.i(ia,"reprocess src. codecType: "+t+" native: "+e+", has origin src: "+!!this.uI),this.uI&&this.II(this.uI,t,e)},i.updateLiveShiftStatuByTime=function(t){var e;if(this.isLiveShift&&(void 0===t&&(t=null==(e=this.video)?void 0:e.currentTime),this.lctx.current&&"number"==typeof t&&Number.isFinite(t))){var i=this.liveLocalTime;i>0&&(this.stat.liveShiftActive=!!(i&&t<i-5),this.Ci.i(ia,"update live shift statu by time. type: "+this.stat.liveShiftType+" "+this.stat.liveShiftActive+", time: "+t+" ed: "+i))}},i.resetStreamingEnabled=function(){var t=this.di;this.cI=this.fI=!(!t.streamingMux||!or.isStreamingSupported()||E.a.msie||E.a.safari&&(!1===this.stat.isLive||this.stat.multipart)||E.a.msedge&&E.a.version.major<88&&(!1===this.stat.isLive||this.stat.multipart)),this.logger.i(ia,"resetStreamingEnabled: "+this.cI)},i.resetGopRemux=function(){this.stat.multipart&&!this.cI?this.stat.gopRemux=!1:this.stat.gopRemux=!!(E.a.safari||E.a.opera&&E.a.version.major<37),this.logger.i(ia,"resetGopRemux: "+this.stat.gopRemux)},i.hasNextMediaDesc=function(){return this.oI+1<this.hI.length},i.nextMediaDesc=function(){if(this.hasNextMediaDesc()){this.oI++;var t=this.hI[this.oI];if(t)return this.Ci.i(ia,"next media desc."),this.OI(t),!0}return!1},i.gI=function(t){if(this.di=t,!t.logLevel){var i=Ar.Logger.loadLogLevel(I.l);t.logLevel=i||Ar.DEFAULT_LOG_LEVEL}var n;if(t.logger&&this.Ci.setOutput(t.logger),this.Ci.setLevel(t.logLevel),this.Ci.getLevel()!==Ar.LogLevel.NONE&&(n=e.version,E.a.msie||console.log("%c kwai-player-kernel %c "+n+" %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(ia,"logger init."),this.logger.i(ia,"set config"),this.lI.init(this.di.playbackAbilityCacheTimeout),this.resetStreamingEnabled(),this.logger.i(ia,"browser",JSON.stringify(E.a)),U()||this.logger.i(ia,"ua",navigator.userAgent),this.d_(),this.dI=void 0,this.stat.startFromSec=t.startFromSec>=0?t.startFromSec:"number"==typeof t.startFrom&&t.startFrom>=0?t.startFrom/1e3:-1,this.stat.webWorker=t.webWorker&&!!Zr.default,"boolean"==typeof t.preferNativeLoader&&(this.stat.preferNativeLoader=t.preferNativeLoader),this.di.autoPlaybackRateConf)this.logger.i(ia,"use config.autoPlaybackRateConf",this.di.autoPlaybackRateConf),this.stat.autoPlaybackRateConf=this.di.autoPlaybackRateConf;else{var r=-Math.floor(this.di.defaultSpts/I.f);this.stat.autoPlaybackRateConf=function(t,e,i){void 0===i&&(i=3);var n={startDelay:0,interval:.6,rule:[]};return ge(t,e,i,n),n}(this.Ci,r),this.logger.i(ia,"use default autoPlaybackRateConf",this.stat.autoPlaybackRateConf),this.Ci.i(ia,"get by delay: "+r)}try{this.stat.webWorker&&(this.stat.muxWorker=V()(42)),zi.workerTimeOffset=performance.now(),this.logger.i(ia,"init mux worker")}catch(t){}t.lazyLoadMaxDuration>0&&t.lazyLoadRecoverDuration>0&&t.lazyLoadMaxDuration>=t.lazyLoadRecoverDuration&&(this.stat.lazyLoadMaxDuration=t.lazyLoadMaxDuration,this.stat.lazyLoadRecoverDuration=t.lazyLoadRecoverDuration),this.loadRec=new Xr,t.src&&this.CI(t.src)},i.d_=function(){this.logger.i(ia,"reset stat");var t=this.di,e=this.stat;this.fI=this.cI;var i=e.preferNativeLoader;e.reset(),this.resetGopRemux(),this.pI.reset(),this.bI.reset(),e.isLive=t.isLive,e.native=t.nativeFirst,e.liveShiftType=this.di.liveShiftType,e.preferNativeLoader=i,this.stat=e},i.CI=function(t,e){this.oI=0,this.aI=Date.now(),this.II(t,e)},i.II=function(t,e,i){this.Ci.i(ia,"process src. codec: "+e+" native: "+i),t&&(this.uI=t);var n=this.config;this.hI=Li.preParse(this.Ci,t,"boolean"==typeof i?i:n.nativeFirst,e,n.baseURL);var r=this.hI[this.oI];r&&this.OI(r)},i.OI=function(t){var e,i,n,r,a,o,s=this.config,u=this.stat;null==(e=this.Na)||e.reset(),this.stat.srcType===l.l.FILE&&this.yI();var c,h,d=this.lctx=new Qr(this.Ci,s.adaptive);if(u.codecType=t.codecType?t.codecType:l.c.unknown,u.box=s.box||t.box||l.i.unknown,u.srcType=t.srcType,u.mixContainerInput=t.mixContainerInput,u.mixCodecInput=t.mixCodecInput,u.mixCodecAvailable=t.mixCodecAvailable,u.multipart=t.multipart,u.stereoType=null==(i=t.mediaLevels)?void 0:i.stereoType,null!=(n=t.mediaLevels)&&n.meta&&(u.srcMeta=null==(c=t.mediaLevels)?void 0:c.meta,this.liveTime&&"number"==typeof t.mediaLevels.meta.programStartTime&&(this.stat.liveStartTime=t.mediaLevels.meta.programStartTime)),s.liveDelayFragNum&&s.liveDelayFragNum>0&&u.multipart&&!s.autoPlaybackRateConf){var f=this.getLiveDelay();ge(this.Ci,f/1e3,10,u.autoPlaybackRateConf),this.Ci.i(ia,"update by delay: "+f+".",s)}void 0!==t.nativeFirst&&(u.native=t.nativeFirst),"boolean"==typeof t.isLive&&(u.isLive=t.isLive),!0===t.isLiveShift&&(u.liveShiftType=l.g.KWAI2),"boolean"==typeof(null==(r=t.mediaLevels)?void 0:r.isLive)&&(u.isLive=t.mediaLevels.isLive),d.hasAudio=null==(a=t.mediaLevels)?void 0:a.hasAudio,d.hasVideo=null==(o=t.mediaLevels)?void 0:o.hasVideo,!t.mediaLevels||t.srcType===l.l.OTHERS&&y(u.box)&&!u.native||(this.Ci.i(ia,"src. get levels from src."),u.drm=t.mediaLevels.drm,this.lctx.levels=t.mediaLevels.levels,this.lctx.default=this.lctx.currentIdx=t.mediaLevels.def,t.mediaLevels.audioTracks&&(this.lctx.audioTracks=t.mediaLevels.audioTracks,this.lctx.audioIdx=t.mediaLevels.defAudio||0),t.mediaLevels.subtitleTracks&&(this.lctx.subtitleTracks=t.mediaLevels.subtitleTracks,this.lctx.subtitleIdx=t.mediaLevels.defSubtitle||0)),this.lctx.default=function(t){if(!E.a.mobile||t.levels.length<=1||t.levels[0].vCodecType!==l.c.hevc)return t.default;var e,i;if(t.levels.forEach((function(t,n){if(t.width&&t.height){var r=Math.min(t.width,t.height);r>720?i=i&&r>i.minWH?i:{idx:n,minWH:r}:e=e&&e.minWH>r?e:{idx:n,minWH:r}}})),!e||!i)return t.default;if(E.a.android)return parseFloat(E.a.platformVersion||"")>=10?i.idx:e.idx;if(E.a.iphone){var n=Vr();return"unknown"===n?typeof window<"u"&&window.screen&&(window.screen.width>400||window.devicePixelRatio>2)?i.idx:e.idx:-1===[Ur.SERIES_1,Ur.SERIES_2,Ur.SERIES_3,Ur.SERIES_4,Ur.SERIES_8].indexOf(n)?i.idx:e.idx}return t.default}(this.lctx),t.box===l.i.yuv&&(this.dI=function(t){if(t){var e=t.match(Hr);if(e&&e.length>2){var i=parseInt(e[1]),n=parseInt(e[2]),r=e[4]?parseInt(e[4]):I.d,a=e[6]?parseInt(e[6]):8,o=jr.a.AV_PIX_FMT_YUV420P;void 0!==e[8]&&(o=Gr.indexOf(e[8]));var s=0,u=0;return o===jr.a.AV_PIX_FMT_YUV420P?(s=i/2,u=n/2):o===jr.a.AV_PIX_FMT_YUV422P?(s=i/2,u=n):o===jr.a.AV_PIX_FMT_YUV444P?(s=i,u=n):(s=0,u=0),{width:i,height:n,chroma:o,chromaWidth:s,chromaHeight:u,cropLeft:0,cropTop:0,cropWidth:i,cropHeight:n,displayWidth:i,displayHeight:n,pts:0,fps:r,bpp:a,dataSize:(i*n+s*u*2)*(a>8?2:1)}}}}(t.src instanceof File?t.src.name:this.lctx.currentUrl)),this.config.ntp&&!1!==this.stat.isLive&&this.stat.box===l.i.flv&&(null==(h=this.AI)||h.ntpSync(this.stat.preferNativeLoader)),this.resetStreamingEnabled(),this.resetGopRemux(),this.logger.i(ia,"use media desc complete. box: "+u.box+" live: "+u.isLive+" native: "+u.native+" mobile: "+!!E.a.mobile+" gopRemux: "+u.gopRemux+" streamingMux: "+this.streamingMux+" liveShift: "+u.liveShiftType+" mixCodec: "+u.mixCodecInput+" levelCnt: "+d.levels.length+" hasVideo: "+d.hasVideo+" hasAudio: "+d.hasAudio)},i.yI=function(){this.lctx&&this.lctx.levels.forEach((function(t){t.url.forEach((function(t){0===t.indexOf("blob:")&&URL.revokeObjectURL(t)}))}))},i._I=function(){this.Na&&(this.Na.destroy(),this.Na=void 0)},o()(e,[{key:"isLiveShiftKwai2",get:function(){return this.stat.liveShiftType===l.g.KWAI2}},{key:"isLiveShift",get:function(){return this.stat.liveShiftType!==l.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&&!1===this.stat.multipart)}},{key:"liveLocalTime",get:function(){var t=this.lctx.current;if(this.isLiveShift){var e,i,n=Number.isFinite(null==(e=this.video)?void 0:e.duration)?null==(i=this.video)?void 0:i.duration:this.isLiveShiftKwai2?this.getLiveShiftKwai2Duration():(null==t?void 0:t.totalduration)||0;if(n)return n-(this.getLiveDelay()/I.f+.1)}else if(t&&t.totalduration)return t.totalduration-(this.getLiveDelay()/I.f+.1);return 0}},{key:"yuvParams",get:function(){return this.dI}},{key:"canCodecFallback",get:function(){return!(!this.stat.mixCodecInput||this.stat.codecType===l.c.h264||-1===this.stat.mixCodecInput.indexOf(l.c.h264)||this.stat.decoder!==l.d.buildin)}},{key:"fps",get:function(){return this.vI}},{key:"liveTime",get:function(){return this.AI}},{key:"cOutput",get:function(){if(M.a)return this.Na||(this.Na=new M.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===l.i.flv&&!1!==this.stat.isLive&&!E.a.firefox&&!1!==this.di.videoEnabled||y(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 t;return(null==(t=this.hI[this.oI])?void 0:t.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?void 0!==this.video.getVideoPlaybackQuality?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(t){this.logger.i(ia,"set demuxer type",t);var e=this.stat;if(t!==e.demuxerType){var i=void 0===e.box||e.box===l.i.unknown;t===me.b.RAW?(e.box=l.i.raw,e.isLive=!1):t===me.b.FLV?(e.box=l.i.flv,e.multipart&&(e.isLive=!1)):t===me.b.MP4||t===me.b.FMP4?(i&&(e.box=l.i.mp4),e.multipart||(e.isLive=!1)):t===me.b.TS?i&&(e.box=l.i.ts):t===me.b.IVF&&(e.box=l.i.ivf,e.isLive=!1),e.demuxerType=t,this.resetGopRemux()}}},{key:"streamingMuxEnabled",get:function(){return this.cI&&!(this.src instanceof Blob)},set:function(t){this.cI=t}},{key:"streamingMux",get:function(){return this.stat.box===l.i.flv&&!1!==this.stat.isLive||this.streamingMuxEnabled&&this.fI},set:function(t){this.fI=t}},{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 (中国标准时间)"}}])}(h.a);na.instanceCount=0;var ra,aa=na,oa=function(t){return t.NORMEL="normal",t.SEEK="seek",t.END="end",t.LEVEL_SWITCH="levelSwitch",t.FIRST_FRAME="firstFrame",t.LOAD="load",t.BACKUP="backup",t}({}),sa=function(t){return t.START="start",t.MANIFEST="manifest",t.LEVEL="level",t.STREAM_CONNECTED="streamConnected",t.DATA="data",t.DEMUX="demux",t.SEGMENT="segment",t.CANPLAY="canplay",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.SEEKED="seeked",t}(sa||{}),ua=[{event:sa.START,detailName:"first-loader-open"},{event:sa.MANIFEST,detailName:"manifest-duration"},{event:sa.LEVEL,detailName:"level-duration"},{event:sa.STREAM_CONNECTED,detailName:"stream-connected-duration"},{event:sa.DATA,detailName:"first-package-duration"},{event:sa.DEMUX,detailName:"first-remux-duration"},{event:sa.SEGMENT,detailName:"first-segment-duration"},{event:sa.LOADEDMETADATA,detailName:"first-meta-duration"},{event:[sa.LOADEDDATA,sa.CANPLAY,sa.SEEKED],detailName:"first-frame-duration"}],ca="first-frame",la=function(){function t(t){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=ua.slice(0),this.Do=t,this.Ci=t.logger}var e=t.prototype;return e.start=function(){this.Ci.i(ca,"start"),this.wI=0,this.Pm=performance.now(),this.Vn=0,this.ee=ua.slice(0),this.EI=0,this.jI={},this.process(sa.START,this.Pm)},e.process=function(t,e){var i;if(void 0===e&&(e=0),this.Ci.i(ca,"process type: "+t+" "+e+" complete: "+this.wI),this.wI)return!1;var n=this.ee,r=-1;e=e||performance.now();for(var a=0;a<n.length;a++){var o=n[a];if(Array.isArray(o.event)){if(-1!==o.event.indexOf(t)){r=a;break}}else if(o.event===t){r=a;break}}if(-1===r)return!1;var s=n.splice(0,r+1).pop(),u="closed"===(null==(i=this.Do.mse)?void 0:i.readyState);if((0===n.length||u&&t===sa.SEGMENT)&&(this.Vn=e-this.Pm,this.wI=Date.now(),this.Ci.i(ca,"complete "+this.Vn+" "+this.wI)),s){var c=Math.round(e-this.EI);0===this.EI&&(c=Date.now()),this.EI=e,this.jI[s.detailName]=c}return!!this.wI},e.onDownloadError=function(){this.jI.download_retry?this.jI.download_retry++:this.jI.download_retry=1},e.onRetry=function(){this.jI.retry?this.jI.retry++:this.jI.retry=1},o()(t,[{key:"complete",get:function(){return this.wI}},{key:"duration",get:function(){return this.Vn}},{key:"details",get:function(){return this.jI}}])}(),ha=[/headless/,/spider/,/[a-z0-9]+bot[^a-z0-9]/],da=function(t){return t.none="",t.probably="probably",t.maybe="maybe",t}(da||{}),fa=function(){if(U())return da.none;if(navigator.webdriver)return da.probably;for(var t=navigator.userAgent.toLowerCase(),e=0;e<ha.length;e++)if(ha[e].test(t))return da.probably;if(window.innerWidth<=0&&window.innerHeight<=0)return da.probably;if(Qn.isMSEAvailable()&&!Qn.isMSECodecCapabilityNormal())return da.maybe;try{var i=document.createElement("canvas");i.width=4,i.width=4;var n=i.getContext("2d");if(n){n.fillStyle="#FFFFFF",null==n||n.fillRect(0,0,i.width,i.height);for(var r=n.getImageData(0,0,i.width,i.height).data,a=0;a<r.length;a++)if(0!==r[a])return da.none;return da.maybe}}catch(t){return da.probably}return da.none}(),pa={};try{var _a;null==(_a=navigator.userAgentData)||_a.getHighEntropyValues(["architecture","bitness","model","platform","platformVersion"]).then((function(t){r()(pa,t)}))}catch(v){}var va=new Uint8Array(16);function Aa(){if(!ra&&!(ra=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ra(va)}for(var ga=/^(?:[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,ma=function(t){return"string"==typeof t&&ga.test(t)},ba=[],ya=0;ya<256;++ya)ba.push((ya+256).toString(16).substr(1));var Ea,Ca=function(t,e,i){var n=(t=t||{}).random||(t.rng||Aa)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var r=0;r<16;++r)e[i+r]=n[r];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(ba[t[e+0]]+ba[t[e+1]]+ba[t[e+2]]+ba[t[e+3]]+"-"+ba[t[e+4]]+ba[t[e+5]]+"-"+ba[t[e+6]]+ba[t[e+7]]+"-"+ba[t[e+8]]+ba[t[e+9]]+"-"+ba[t[e+10]]+ba[t[e+11]]+ba[t[e+12]]+ba[t[e+13]]+ba[t[e+14]]+ba[t[e+15]]).toLowerCase();if(!ma(i))throw TypeError("Stringified UUID is invalid");return i}(n)},Ta=(new Date).getTimezoneOffset()/-60;function Ia(){return Ea||(Ea={support_mse:Qn.isMSEAvailable()?1:0,support_aac_mse:Qn.TYPE_SUPPORTED.aac?1:0,support_aac:Qn.isVideoCodecSupported(l.c.aac)?1:0,support_h264_mse:Qn.TYPE_SUPPORTED.h264?1:0,support_h264:Qn.isVideoCodecSupported(l.c.h264)?1:0,support_h265_mse:Qn.TYPE_SUPPORTED.hevc?1:0,support_h265:Qn.isVideoCodecSupported(l.c.hevc)?1:0,support_av1_mse:Qn.TYPE_SUPPORTED.av1?1:0,support_simd:Qn.isSupportSimd?1:0,support_thread:Qn.isSupportThreads?1:0,support_hw:Qn.isSupportHW?1:0,support_change_type:Qn.isChangeTypeSupported()?1:0,support_streaming:or.isStreamingSupported()?1:0,hardware_concurrency:P()||0,wasm_dec_smooth:Qn.wasmSmooth?1:0}),Ea}function Ra(t,e){var i,n;return typeof navigator<"u"&&(navigator.webdriver&&(i=navigator.webdriver?1:0),void 0!==navigator.onLine&&(n=navigator.onLine?1:0)),{session_id:e.sessionId,kernel_version:aa.version,pack_name:aa.packName,creation_time:e.creationTime,time_zone:Ta,src_update_time:t.srcUpdateTime,load_start_time:e.loadStartTime,instance_count:aa.instanceCount,webdriver:i,on_line:n}}function wa(){var t={};if(typeof navigator<"u"){void 0!==navigator.onLine&&(t.network_on_line=navigator.onLine?1:0);var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;void 0!==(null==e?void 0:e.rtt)&&(t.network_rtt=e.rtt),void 0!==(null==e?void 0:e.rtt)&&(t.network_downlink=e.downlink),void 0!==(null==e?void 0:e.effectiveType)&&(t.network_effective_type=e.effectiveType),void 0!==(null==e?void 0:e.saveData)&&(t.network_save_data=e.saveData?1:0)}return t}function La(t,e){var i,n,a,o,s=null==(i=t.video)?void 0:i.duration,u=t.lctx.current,c=(null==u?void 0:u.currentUrl)||"",h=r()({play_url:(null==u?void 0:u.fileName)||c,url_id:(null==u?void 0:u.urlId)||0,stream_host:c?new ct.a(c).host:"",reuse:e.reuse,metadata_time:e.metadataTime,play_start_time:e.playStartTime,playing_start_time:e.playingStartTime,stream_duration:Math.round(1e3*(s&&Number.isFinite(s)?s:0)),max_bitrate:(null==u?void 0:u.maxBitrate)||0,codec:e.codecs,play_pos:e.playPos||0,v_data_rate:Math.round((null==(n=t.loadRec.currentLoad)?void 0:n.videoDataRate)||0),a_data_rate:Math.round((null==(a=t.loadRec.currentLoad)?void 0:a.audioDataRate)||0),drm:t.stat.drm?1:0,adaptive_multi_rate:t.lctx.abr?1:0,use_backup:e.useBackup,play_to_end:e.playToEnd,v_decoder:t.stat.decoder,video_codec_type:t.stat.codecType||l.c.unknown,start_codec:e.startCodec,demuxer:t.stat.demuxerType||me.b.UNKNOWN,core_type:t.stat.coreType,mms:t.stat.mms?1:0,box:t.stat.box,kwai_slice:t.stat.isKwaiSlice?1:0,monkey_patched_fetch:e.monkeyPatchedFetch},Ra(t,e),wa(),(o=t.video)?{elem_crossorigin:o.crossOrigin,elem_autoplay:o.autoplay?1:0,elem_loop:o.loop?1:0,elem_volume:o.volume,elem_muted:o.muted?1:0,elem_preload:o.preload,elem_controls:o.controls?1:0,elem_ready_state:o.readyState,elem_network_state:o.networkState,elem_playback_rate:o.playbackRate,elem_paused:o.paused?1:0,elem_ended:o.ended?1:0,elem_seeking:o.seeking?1:0,elem_tag_name:o.tagName}:{});t.stat.flvAbrNotAligned&&(h.flv_abr_not_aligned=1),"boolean"==typeof Qn.playHEVCTest&&(h.play_hevc_test=Qn.playHEVCTest?1:0),void 0!==t.stat.isLive&&(h.live=t.stat.isLive?1:0),h.live_shift_type=t.stat.liveShiftType;var d=Le((null==u?void 0:u.fileName)||c);t.stat.box===l.i.flv&&!1!==t.stat.isLive&&(h.stream_id=d.streamID),e.httpHeader&&(h.response_header=_(e.httpHeader)),null!=u&&u.bitrate&&(h.bitrate=Math.round(u.bitrate)),null!=u&&u.qualityType&&(h.quality_type=u.qualityType),null!=u&&u.qualityLabel&&(h.quality_label=u.qualityLabel),e.startQualityType&&(h.start_quality_type=e.startQualityType),d.transcodingTpl&&(h.transcoding_template=d.transcodingTpl),d.filename&&(h.filename=d.filename),typeof navigator<"u"&&navigator.deviceMemory&&(h.device_memory=navigator.deviceMemory);var f=Object(_t.b)();return f.renderer&&(h.gpu_renderer=f.renderer),fa&&(h.bot=fa),e.canvasCtxType&&(h.canvas_ctx=e.canvasCtxType),t.stat.wasmDecoder&&(h.wasm_dec=t.stat.wasmDecoder,h.wasm_dec_simd=t.stat.wasmSimd?1:0,h.wasm_dec_threads=t.stat.wasmThreads||0),h}function Da(t){var e={};if(t.metadata)for(var i in t.metadata){if(Object.keys(e).length>50)break;var n=t.metadata[i];"string"==typeof n?e[i]=n.substring(0,50):"number"!=typeof n&&"boolean"!=typeof n||(e[i]=n)}return e}function Sa(){var t={};return pa&&(pa.architecture&&(t.architecture=pa.architecture),pa.bitness&&(t.bitness=pa.bitness),pa.model&&(t.model=pa.model),pa.platform&&(t.platform=pa.platform),pa.platformVersion&&(t.platform_version=pa.platformVersion)),t}function Oa(){var t={};return E.a.platformVersion&&(t.platform=E.a.platform||"",t.platform_version=E.a.platformVersion||0),E.a.iphone?t.model=Vr():E.a.model&&(t.model=E.a.model),E.a.version&&(t.browser_name=E.a.name||"",t.browser_major=E.a.version.major||0),t}function Na(){var t,e,i,n={};return U()||(null!=(t=window.screen)&&t.width&&(n.screen_w=window.screen.width),null!=(e=window.screen)&&e.height&&(n.screen_h=window.screen.height),null!=(i=window.screen)&&i.colorDepth&&(n.screen_color_depth=window.screen.colorDepth),n.device_pixel_ratio=window.devicePixelRatio||1),n}function ka(t){var e={};return t&&(t.fps&&(e.fps=Math.round(1e3*t.fps)/1e3),t.width&&(e.width=t.width),t.height&&(e.height=t.height),t.codedWidth&&(e.coded_width=t.codedWidth),t.codedHeight&&(e.coded_height=t.codedHeight),t.sar&&t.sar.width!==t.sar.height&&(e.sar=t.sar),t.enhancedFlv&&(e.enhanced_flv=t.enhancedFlv?1:0)),e}function xa(t){var e={src_type:t.stat.srcType};return t.stat.stereoType&&(e.stereo_type=t.stat.stereoType),t.stat.mixCodecInput&&t.stat.mixCodecInput.length&&(e.mix_codec_input=t.stat.mixCodecInput),t.stat.mixContainerInput&&t.stat.mixContainerInput.length&&(e.mix_container_input=t.stat.mixContainerInput),t.stat.mixCodecAvailable&&(e.mix_codec_available=t.stat.mixCodecAvailable),e}function Pa(t){var e={};return t.stat.srcMeta&&(e.src_meta=t.stat.srcMeta),e}function Ma(t){var e,i,n,r={};return null!=(e=t.lctx.current)&&e.meta&&(r.current_level_meta=t.lctx.current.meta,t.lctx.current.meta.comment&&t.lctx.current.meta.comment.split("/").forEach((function(t){0===t.indexOf("tt=")&&(r.transcoding_template=t.substring(3)),0===t.indexOf("ttExplain=")&&(r.transcoding_template_explain=t.substring(10))}))),null!=(i=t.lctx.current)&&i.fileSize&&(r.filesize=null==(n=t.lctx.current)?void 0:n.fileSize),r}function Ua(t){var e=performance.now();return{play:Math.round(t.playDuration+(t.playStartMS?e-t.playStartMS:0)),actualPlay:Math.round(t.actualPlayDuration+(t.actualPlayStartMS?e-t.actualPlayStartMS:0)),pause:Math.round(t.pauseDuration+(t.pauseStartMS?e-t.pauseStartMS:0)),buffer:Math.round(t.bufferTime+(t.bufferingStartMS?e-t.bufferingStartMS:0))}}var Ba=function(){function t(t,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 zr,this.kI=t,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 e=t.prototype;return e.FI=function(t,e){var i={};for(var n in e){var r=t[n],a=e[n];"number"==typeof r&&"number"==typeof a&&(i[n]=r-a,e[n]=r)}return i},e.UI=function(){this.BI=performance.now(),this.TI=Date.now(),this.LI=void 0,this.RI=void 0,this.QI=0,this.xI=""},e.setFirstScreenDuration=function(t,e,i){this.LI=Math.round(t),this.RI=e,this.DI=!0,this.NI=i},e.setError=function(t,e){this.QI=t,this.xI=e},e.build=function(){var t,e,i,n,a,o,s,u=this.kI,c=this.Do,h=this.Do.stat,d=performance.now(),f=Math.round(d-this.BI),p=this.FI(u,this.MI),_=c.mse?this.FI(null==(t=c.mse)?void 0:t.stat,this.MI):void 0,v=this.FI(Ua(this.kI),this.MI),A=this.FI(this.Do.loadRec,this.MI),g=this.Do.loadRec.downloadInfoByRange(f),m=g.timeCost?Math.round(g.size/g.timeCost*1e3):0,b={tick_index:this.SI,tick_start:this.TI,tick_duration:f,error_code:this.QI,error_message:this.xI,block_cnt:p.blockCount||0,render_block_cnt:p.renderBlockCount||0,decoded_video_frames:p.decodedFrames||0,dropped_video_frames:(p.droppedFrames||0)+(p.muxDroppedFrames||0),segment_cnt:p.segment||0,play_duration:v.play||0,buffer_time:v.buffer||0,actual_play_duration:v.actualPlay||0,played_video_duration:v.play||0,traffic:Math.round(((null==A?void 0:A.traffic)||0)/1024),hidden:kt()?1:0,download:p.download,download_speed:m,seek_cnt:p.seekCnt,seek_load_cnt:p.seekLoadCnt,pause_duration:v.pause,pause_cnt:p.pauseCnt,on_line_change:p.onLineChange,visibility_change:p.visibilityChange,heartbeat_timeout:p.heartbeatTimeout,load_cnt:p.loadCnt,refresh_cnt:p.refreshCnt,media_buffered_a:u.bufferedEndA,media_buffered_v:u.bufferedEndV};return r()(b,Ia(),La(c,u),Oa(),Sa(),((e=c).mse?(o=e.mse.bufferedByType(l.o.VIDEO),s=e.mse.bufferedByType(l.o.AUDIO)):o=s=e.mediaBufferedSec,{a_buf_start:Math.round(1e3*s.start)||0,a_buf_end:Math.round(1e3*s.end)||0,a_buf_len:Math.round(1e3*Math.max(0,s.end-e.currentTime))||0,a_buf_slices:(null==(i=e.mse)?void 0:i.bufferSliceNumByType(l.o.AUDIO))||e.bufferSliceNum||0,v_buf_start:Math.round(1e3*o.start)||0,v_buf_end:Math.round(1e3*o.end)||0,v_buf_len:Math.round(1e3*Math.max(0,o.end-e.currentTime))||0,v_buf_slices:(null==(n=e.mse)?void 0:n.bufferSliceNumByType(l.o.VIDEO))||e.bufferSliceNum||0,buffer_queue_cnt:(null==(a=e.mse)?void 0:a.pendingNum())||0}),function(t){if(t.stat.isLive&&t.stat.box===l.i.flv){var e,i,n,r=null==(e=t.liveTime)?void 0:e.getDisplayDelay(t.currentTime);if(r)return{v_rec_delay:null==(i=t.liveTime)?void 0:i.getRecDelay(),v_render_delay:r||0,a_render_delay:(null==(n=t.liveTime)?void 0:n.getAudioRenderDelay(t.currentTime))||0}}return{}}(c),Ma(c)),this.VI.hasData&&(b.retry_record=this.VI.beacon,b.retry_cnt=this.VI.retryCount,this.VI.clear()),p.wasmDecErr&&(b.wasm_dec_err=p.wasmDecErr),A.muxA&&(b.mux_a=A.muxA),A.muxV&&(b.mux_v=A.muxV),A.fillA&&(b.fill_a=A.fillA),A.fillV&&(b.fill_v=A.fillV),A.droppedA&&(b.dropped_a=A.droppedA),A.droppedV&&(b.dropped_v=A.droppedV),p.muxDroppedFrames&&(b.mux_dropped_video_frames=p.muxDroppedFrames),h.coreType===l.a.mse&&(b.mse_update_cnt=(null==_?void 0:_.mseUpdate)||0,b.mse_remove_cnt=(null==_?void 0:_.mseRemove)||0,b.key_frame_cnt=p.keyFrame,h.isLive?(b.live_shift_type=c.stat.liveShiftType,c.isLiveShift&&(b.live_shift=c.stat.liveShiftActive?1:0)):(b.lazyload_min=Math.floor(h.lazyLoadRecoverDuration),b.lazyload_max=Math.floor(h.lazyLoadMaxDuration)),p.audioRemuxSampleCount&&(b.a_remux_sample_cnt=p.audioRemuxSampleCount),p.videoRemuxSampleCount&&(b.v_remux_sample_cnt=p.videoRemuxSampleCount),p.audioRemuxDuration&&(b.a_remux_duration=Math.floor(1e3*p.audioRemuxDuration)),p.videoRemuxDuration&&(b.v_remux_duration=Math.floor(1e3*p.videoRemuxDuration))),this.DI&&(void 0===this.LI?b.first_screen_total_duration=0:(b.first_screen_total_duration=this.LI,b.first_screen_details=this.RI,h.coreType===l.a.mse&&h.box===l.i.mp4&&(b.mp4_moov_size=u.mp4MoovSize,void 0!==u.mp4FastStart&&(b.mp4_fast_start=u.mp4FastStart?0:1)),this.RI=void 0,this.LI=void 0,this.DI=!1)),"number"==typeof this.NI&&u.playStartTime&&(b.click_to_first_frame=this.NI,this.NI>0&&(this.NI=void 0)),1===this.SI&&r()(b,Ia(),xa(this.Do),Na()),this.UI(),this.SI++,b},t}(),Va="monitor",Fa=function(t){function e(e){var i;return(i=t.call(this)||this).HI=void 0,i.YI=void 0,i.GI=void 0,i.Do=void 0,i.Ci=void 0,i.KI=void 0,i.kI=void 0,i.ZI=void 0,i.WI=!1,i.XI=!1,i.zI=!1,i.JI=!1,i.qI=function(){i.kI.onLineChange++},i.$I=function(t){var e,n;void 0===t&&(t=oa.NORMEL);try{var a;e=null==(a=i.ZI)?void 0:a.build()}catch(t){}e&&(t===oa.NORMEL&&e.first_screen_total_duration>0?(e.type=oa.FIRST_FRAME,e.metadata=Da(i.data)):(t===oa.LOAD&&r()(e,Pa(i.Do)),e.type=t),i.JI&&(r()(e,ka(null==(n=i.Do.loadRec.currentLoad)?void 0:n.mediaInfo)),i.JI=!1),i.Do.stat.isLive||(e.seek_record=i.kI.seekRecord.slice(0),i.kI.seekRecord=[]),i.Ci.i(Va,"realtime beacon",e),i.emit(S.a.REPORT,{type:br.REALTIME_BEACON,value:e}))},i.GI=performance.now(),i.YI=Date.now(),i.KI=new la(e),i.Do=e,i.Ci=e.logger,i.ub(),U||(window.addEventListener("online",i.qI),window.addEventListener("offline",i.qI)),i}u()(e,t);var i=e.prototype;return i.getName=function(){return Va},i.ub=function(){var t;this.XI=!1,this.zI=!1,this.JI=!1,this.kI=(t={decodedFrames:0,droppedFrames:0,muxDroppedFrames:0,sessionId:Ca(),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},T.isSupported()&&(t.monkeyPatchedFetch=C(fetch,"fetch")),t),this.kI.creationTime=this.YI,this.Ci.i(Va,"reset",this.kI.sessionId),this.Do.fps.reset(),this.Do.fps.getFPS(this.Do.videoPlaybackQuality)},i.onRendererInitComplete=function(t){this.Ci.i(Va,"renderer init complete. type: "+t.type),this.data.canvasCtxType=t.type},i.onLoaderChunkArrival=function(t){this.Do.loadRec.onDataReceive(t),this.tO(sa.DATA)},i.onMediaConnected=function(t){t.headers&&(this.kI.httpHeader=t.headers),this.tO(sa.STREAM_CONNECTED)},i.onMediaDemux=function(){this.tO(sa.DEMUX,performance.now())},i.onKeyFrame=function(t){this.Do.loadRec.currentLoad&&this.Do.loadRec.currentLoad.keyFrame++,this.data.keyFrame++,t&&this.emit(S.a.REPORT,{type:br.KEY_FRAME,value:t})},i.onDecLibLoaded=function(t){this.kI.decLibLoadDuration=t.duration,this.kI.decLibCacheHit=t.hitCache},i.onNewSource=function(t){var e=this.kI,i=this.Do.lctx.current;i?(this.Do.loadRec.onStreamOpen(t.sync,i.currentUrl,i.bitrate,i.qualityType),e.level=this.Do.lctx.currentIdx,e.startQualityType||(e.startQualityType=i.qualityType)):this.Do.loadRec.onStreamOpen(t.sync,"",0,"unknown")},i.onDiscontinuity=function(t){this.emit(S.a.REPORT,{type:br.DISCONTINUITY,value:t})},i.onDownload=function(t){var e=this,i=this.kI;t.error_code&&!this.KI.complete&&this.KI.onDownloadError(),i.download++;var n=r()({use_backup:i.useBackup,first_screen:i.firstScreenTotalDuration?1:0},Ra(this.Do,i),Oa(),Sa(),wa(),t);1009===t.error_code?setTimeout((function(){e.emit(S.a.REPORT,{type:br.DOWNLOAD,value:n})}),0):this.emit(S.a.REPORT,{type:br.DOWNLOAD,value:n})},i.onHeartbeat=function(){var t,e,i=this.kI,n=this.Do,r=n.fps.getFPS(this.Do.videoPlaybackQuality),a={},o=n.loadRec,s=performance.now();i.lastHeartbeatTime&&s-i.lastHeartbeatTime>I.j&&i.heartbeatTimeout++,i.lastHeartbeatTime=performance.now(),(n.stat.coreType===l.a.mse||n.stat.coreType===l.a.rtc)&&(a.totalReceive=o.traffic,a.speed=o.speed,a.videoDataRate=(null==(t=o.currentLoad)?void 0:t.videoDataRate)||0,a.audioDataRate=(null==(e=o.currentLoad)?void 0:e.audioDataRate)||0),n.mse&&(a.videoBuffered=i.bufferedEndV=Math.round(Math.max(0,1e3*(n.mse.bufferedEndByType(l.o.VIDEO)-n.currentTime))),a.audioBuffered=i.bufferedEndA=Math.round(Math.max(0,1e3*(n.mse.bufferedEndByType(l.o.AUDIO)-n.currentTime))),a.fillAudio=o.fillA,a.fillVideo=o.fillV,a.keyFrame=i.keyFrame,n.stat.isLive?(a.isLive=n.stat.isLive,n.stat.liveShiftType&&(a.liveShift=n.stat.liveShiftActive)):(a.lazyloadMin=n.stat.lazyLoadRecoverDuration,a.lazyloadMax=n.stat.lazyLoadMaxDuration)),a.buffered=Math.round(1e3*n.bufferedSec),a.decodedFPS=(null==r?void 0:r.decodedFPS)||0,a.droppedFPS=(null==r?void 0:r.droppedFPS)||0,i.decodedFrames=a.decodedFrames=(null==r?void 0:r.decoded)||0,i.droppedFrames=a.droppedFrames=((null==r?void 0:r.dropped)||0)+i.muxDroppedFrames,n.stat.isLive&&n.stat.box===l.i.flv&&n.liveTime&&(a.audioRenderDelay=n.liveTime.getAudioRenderDelay(n.currentTime),a.displayDelay=n.liveTime.getDisplayDelay(n.currentTime),a.recDelay=n.liveTime.getRecDelay()),n.stat.decoder===l.d.wasm&&(a.wasmFrameBufLen=n.stat.frameBufLen),a.playPos=1e3*n.currentTime,this.Ci.i(Va,"heartbeat",a),this.emit(S.a.REPORT,{type:br.HEARTBEAT,value:a})},i.destroy=function(){this.Ci.i(Va,"destroy"),this.$I(oa.END),this.iO(),U()||(window.removeEventListener("online",this.qI),window.removeEventListener("offline",this.qI)),t.prototype.destroy.call(this)},i.onLoad=function(t){if(this.Ci.i(Va,"on load: "+t.type),this.kI.loadCnt++,this.kI.metadata=void 0,t.type)t.type!==l.h.internal&&t.type!==l.h.retry||this.KI.complete||this.KI.start(),this.kI.errorCode=0,this.kI.errorMessage="";else{var e;if(null==(e=this.Do.lctx.current)||e.currentUrl,this.kI.startTime){var i=this.kI.reuse;this.ub(),this.kI.reuse=i+1}this.kI.startTime=performance.now(),this.kI.loadStartTime=Date.now(),this.KI.start(),this.WI=kt(),this.iO(),this.ZI=new Ba(this.kI,this.Do),this.$I(oa.LOAD)}},i.onStopLoad=function(){this.$I(oa.END),this.iO(),this.eO()},i.onManifestParsed=function(t){this.Ci.i(Va,"on manifest:",t);var e=this.Do.lctx.current;e&&(this.kI.startBitrate||(this.kI.startBitrate=e.bitrate)),this.tO(sa.MANIFEST)},i.onLevelUpdated=function(t){this.tO(sa.LEVEL)},i.onAudioTrackUpdated=function(){},i.onMediaInfo=function(t){var e,i,n,r=this.Do;(t=t||{}).box=r.stat.box,t.tagName=null==(e=r.video)?void 0:e.tagName,r.stat.srcMeta&&(t.srcMeta=r.stat.srcMeta),null!=(i=r.lctx.current)&&i.meta&&(t.currentLevelMeta=null==(n=r.lctx.current)?void 0:n.meta),"boolean"==typeof r.stat.isLive&&(t.isLive=r.stat.isLive),t.liveShiftEnabled=r.isLiveShift,t.liveShiftType=r.stat.liveShiftType,t.packName=aa.packName,r.loadRec.onMediaInfo(t);var a=[];t.videoCodec&&a.push(t.videoCodec),t.audioCodec&&a.push(t.audioCodec),this.kI.codecs=a.join(","),this.kI.startCodec||(this.kI.startCodec=this.kI.codecs),t.sid=this.kI.sessionId,t.hardwareAccelerated=Qn.isSupportHW,t.coreType=r.stat.coreType,!t.streamHost&&r.lctx.currentUrl&&(t.streamHost=new ct.a(r.lctx.currentUrl).host);var o,s=Object(_t.b)();s.renderer&&(t.gpu=s.renderer),r.loadRec.currentLoad&&(r.loadRec.currentLoad.mediaInfo=t),r.config.ntp&&!1!==r.stat.isLive&&r.stat.box===l.i.flv&&(null==(o=r.liveTime)||o.ntpSync(r.stat.preferNativeLoader)),r.stat.isKwaiSlice&&(t.isKwaiSlice=r.stat.isKwaiSlice);var u=JSON.stringify(t);this.Ci.i(Va,"mediainfo",u),this.JI=!0,this.emit(S.a.REPORT,{type:br.MEDIA_INFO,value:JSON.parse(u)})},i.onParsingData=function(t){var e=this.kI;t.extra&&t.extra.stat&&(e.unknownTSPacketCount=e.unknownTSPacketCount||t.extra.stat.unknownTSPacketCount||0,e.audioNonMonotonous=e.audioNonMonotonous||t.extra.stat.audioNonMonotonous||0,e.aacOverhead=e.aacOverhead||t.extra.stat.aacOverhead||0),t.segments.forEach((function(t){t.type===l.o.VIDEO?(t.droppedFrames&&(e.muxDroppedFrames+=t.droppedFrames),e.videoRemuxSampleCount+=t.sampleCount,e.videoRemuxDuration+=t.endDTS-t.startDTS):t.type===l.o.AUDIO&&(e.audioRemuxSampleCount+=t.sampleCount,e.audioRemuxDuration+=t.endDTS-t.startDTS)})),this.tO(sa.SEGMENT)},i.onPrivNal=function(t){var e;null==(e=this.Do.liveTime)||e.onPrivNal(t),this.emit(S.a.REPORT,{type:br.PRIV_NAL,value:t})},i.onSei=function(t){this.emit(S.a.REPORT,{type:br.SEI,value:t})},i.onAacPriv=function(t){this.emit(S.a.REPORT,{type:br.AAC_PRIV,value:t})},i.onPlay=function(){this.kI.playStartTime||(this.kI.playStartTime=Date.now()),this.nO()},i.onLoadedmetadata=function(){this.tO(sa.LOADEDMETADATA),this.kI.metadataTime||(this.kI.metadataTime=Date.now())},i.onLoadeddata=function(){this.tO(sa.LOADEDDATA),this.eO()},i.onCanplay=function(){this.tO(sa.CANPLAY),E.a.safari&&this.Do.stat.coreType!==l.a.mse||this.eO()},i.onPlaying=function(){var t;E.a.ios&&4!==(null==(t=this.Do.video)?void 0:t.readyState)||(this.XI||(this.XI=!0),this.sO(),this.rO(),this.eO())},i.onPause=function(){var t;null!=(t=this.Do.video)&&t.seeking||!this.XI||(this.hO(),this.oO(),this.XI=!1)},i.onEnded=function(){this.kI.playToEnd++,this.XI=!1,this.hO(),this.rO(),this.eO(),this.$I(oa.END),this.iO()},i.onWaiting=function(t){this.kI.playPos=Math.round(1e3*this.Do.currentTime),this.XI&&this.KI.complete&&t.block&&this.aO(t.bufferedSec)},i.onSeeking=function(t){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||null!=t&&t.internal||(this.kI.seekStartTime=performance.now())},i.onSeekWithLoad=function(){this.KI.complete&&(this.$I(oa.SEEK),this.uO(),this.zI=!0)},i.onSeeked=function(){if(this.Do.fps.getFPS(this.Do.videoPlaybackQuality),this.kI.seekStartTime){this.kI.seekCnt++;var t=Math.round(performance.now()-this.kI.seekStartTime);this.kI.seekDuration+=t,this.kI.seekStartTime=0,this.zI&&(this.kI.seekLoadCnt++,this.kI.seekLoadDuration+=t)}this.zI=!1,this.KI.complete||this.Do.stat.coreType===l.a.mse||!E.a.safari&&!E.a.msie||this.tO(sa.SEEKED)},i.onTimeupdate=function(){var t,e,i=this.Do,n=i.video;if(n){n.loop&&!i.stat.isLive&&0===i.currentTime&&Number.isFinite(n.duration)&&n.duration>0&&n.duration-this.kI.playPos/1e3<1&&this.kI.playToEnd++;var r=Math.round(1e3*i.currentTime);E.a.msie&&i.stat.coreType!==l.a.mse&&this.kI.bufferingStartMS&&this.kI.playPos!==r&&this.onPlaying(),this.kI.playPos=r,!E.a.ios||"number"!=typeof this.kI.bufferingStartMS||4!==(null==(t=this.Do.video)?void 0:t.readyState)||null!=(e=this.Do.video)&&e.paused||this.onPlaying()}},i.onProgress=function(){var t;E.a.safari&&this.Do.stat.coreType!==l.a.mse&&this.kI.bufferingStartMS&&4===(null==(t=this.Do.video)?void 0:t.readyState)&&this.eO()},i.mediaCapabilities=function(t){this.kI.smoothBitrate=t},i.onLevelSwitching=function(t){t.smooth||(this.$I(oa.LEVEL_SWITCH),this.uO())},i.onRetry=function(t){this.Do.stat.retryInfo.append(t),t.type===l.k.BACKUP&&(this.kI.useBackup=1),this.KI.onRetry(),t.type===l.k.BACKUP&&(this.ZI&&this.ZI.setError(t.code||0,t.message||""),this.$I(oa.BACKUP),this.ZI&&this.ZI.setError(0,""))},i.onRefresh=function(){this.kI.refreshCnt++},i.onMetadata=function(t){this.kI.metadata||(this.kI.metadata=t),t.mp4MoovSize&&(this.kI.mp4MoovSize=t.mp4MoovSize),"boolean"==typeof t.mp4FastStart&&(this.kI.mp4FastStart=t.mp4FastStart),"boolean"==typeof t.mp4MoovNoPs&&(this.kI.mp4MoovNoPs=t.mp4MoovNoPs),"string"==typeof t.compatible_brands&&(this.kI.mp4CompatibleBrands=t.compatible_brands),this.Ci.i(Va,"metadata",t),this.emit(S.a.REPORT,{type:br.METADATA,value:t})},i.onVisibilityChange=function(){this.kI.visibilityChange++},i.onError=function(t){t.preventFollowUp||(t.fatal?(this.Ci.i(Va,"error",t),this.kI.errorCode=t.code,this.kI.errorMessage=t.reason,this.ZI&&this.ZI.setError(t.code,t.reason),this.hO(),this.rO(),this.eO()):t.details===D.a.DECODER_DEC_ERROR&&this.kI.wasmDecErr++)},i.tO=function(t,e){void 0===e&&(e=0),!this.KI.complete&&this.KI.process(t,e)&&this.cO()},i.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()},i.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},i.oO=function(){this.kI.pauseCnt++,this.kI.pauseStartMS=this.kI.pauseStartMS||performance.now()},i.rO=function(){this.kI.pauseStartMS&&(this.kI.pauseDuration+=performance.now()-this.kI.pauseStartMS),this.kI.pauseStartMS=void 0},i.aO=function(t){this.kI.bufferingStartMS||(this.kI.blockCount++,this.kI.bufferingStartMS=performance.now(),t>.6&&this.kI.renderBlockCount++),this.kI.actualPlayStartMS&&(this.kI.actualPlayDuration+=performance.now()-this.kI.actualPlayStartMS),this.kI.actualPlayStartMS=void 0},i.eO=function(){this.kI.bufferingStartMS&&(this.kI.bufferTime+=performance.now()-this.kI.bufferingStartMS,this.kI.bufferingStartMS=void 0)},i.cO=function(){this.Ci.i(Va,"first frame"),this.Do.stat.firstFrameLoaded=!0;var t=this.kI;t.firstScreenTotalDuration=t.firstScreenTotalDuration||Math.round(this.KI.duration),t.firstScreenDetails=t.firstScreenDetails||this.KI.details,t.playStartTime&&this.KI.complete?t.clickToFirstFrame=t.clickToFirstFrame||Math.max(1,this.KI.complete-t.playStartTime):t.clickToFirstFrame=1,this.ZI&&this.ZI.setFirstScreenDuration(this.KI.duration,this.KI.details,t.clickToFirstFrame),this.Do.video&&!this.Do.video.paused&&this.sO()},i.nO=function(){void 0===this.HI&&(this.HI=setInterval(this.$I,1e4))},i.iO=function(){this.HI&&(clearTimeout(this.HI),this.HI=void 0)},i.uO=function(){this.iO(),this.nO()},o()(e,[{key:"runningStartTime",get:function(){return this.GI}},{key:"sid",get:function(){return this.kI.sessionId}},{key:"snapshot",get:function(){var t=this.Do.loadRec,e=this.Do.stat;return r()({streams:t.streams,live:e.isLive,liveShift:e.liveShiftActive,demuxer:e.demuxerType,decSimd:e.wasmSimd,decThreads:e.wasmThreads,decoderType:e.wasmDecoder},this.kI)}},{key:"data",get:function(){return this.kI}},{key:"audienceStat",get:function(){var t,e=this.kI,i=Ua(e),n=this.Do.stat,a=this.Do.loadRec,o={play_duration:i.play,actual_play_duration:i.actualPlay,traffic:Math.round(a.traffic/1024),buffer_time:i.buffer,block_cnt:e.blockCount,render_block_cnt:e.renderBlockCount,click_to_first_frame:e.playStartTime&&e.clickToFirstFrame||0,first_screen_total_duration:Math.round(e.firstScreenTotalDuration)||0,first_screen_details:e.firstScreenDetails||this.KI.details||null,error_code:e.errorCode||0,error_message:e.errorMessage||"",remux_process_type:(this.Do.streamingMuxEnabled?1:0)+(n.gopRemux?1:0),hidden_start:this.WI?1:0,current_running_time:Math.round(performance.now()-e.startTime),running_time:Math.round(performance.now()-this.GI),smooth_bitrate:e.smoothBitrate,start_bitrate:e.startBitrate||0,abr:this.Do.config.adaptive?1:0,pause_cnt:e.pauseCnt,traffic_vcodec:a.trafficGroupedByVCodecType,traffic_level:a.trafficGroupedByLevel,decoded_video_frames:e.decodedFrames,dropped_video_frames:e.droppedFrames+e.muxDroppedFrames,pause_duration:i.pause,seek_cnt:e.seekCnt,seek_duration:e.seekDuration,seek_load_cnt:e.seekLoadCnt,seek_load_duration:e.seekLoadDuration,start_sec:n.isLive?0:Math.round(this.Do.config.startFromSec||0),on_line_change:e.onLineChange,visibility_change:e.visibilityChange,heartbeat_timeout:e.heartbeatTimeout,load_cnt:e.loadCnt,refresh_cnt:e.refreshCnt,media_buffered_v:e.bufferedEndV,media_buffered_a:e.bufferedEndA,remux_worker:this.Do.stat.webWorker?1:0,av_separated:this.Do.stat.avSeparated?1:0};if(n.retryInfo.hasData&&(o.retry_record=n.retryInfo.mergedBeacon,o.retry_cnt=n.retryInfo.retryCount),e.wasmDecErr&&(o.wasm_dec_err=e.wasmDecErr),r()(o,Ia(),La(this.Do,e),Oa(),Sa(),ka(null==(t=this.Do.loadRec.currentLoad)?void 0:t.mediaInfo),xa(this.Do),Pa(this.Do),Ma(this.Do),Na()),o.metadata=Da(e),n.coreType===l.a.mse&&this.Do.mse&&(o.mse_buffer_full=this.Do.mse.stat.mseBufferFull,o.mse_remove=this.Do.mse.stat.mseRemove,o.key_frame_cnt=e.keyFrame,n.box===l.i.mp4&&(o.mp4_moov_size=e.mp4MoovSize,void 0!==e.mp4CompatibleBrands&&(o.mp4_compatible_brands=e.mp4CompatibleBrands),void 0!==e.mp4FastStart&&(o.mp4_fast_start=e.mp4FastStart?1:0),void 0!==e.mp4MoovNoPs&&(o.mp4_moov_no_ps=e.mp4MoovNoPs?1:0)),o.a_remux_sample_cnt=e.audioRemuxSampleCount,o.v_remux_sample_cnt=e.videoRemuxSampleCount,o.a_remux_duration=Math.floor(1e3*e.audioRemuxDuration),o.v_remux_duration=Math.floor(1e3*e.videoRemuxDuration)),"boolean"==typeof this.Do.config.audioEnabled&&(o.a_enabled=this.Do.config.audioEnabled?1:0),"boolean"==typeof this.Do.config.videoEnabled&&(o.v_enabled=this.Do.config.videoEnabled?1:0),a.muxA&&(o.mux_a=a.muxA),a.muxV&&(o.mux_v=a.muxV),a.fillA&&(o.fill_a=a.fillA),a.fillV&&(o.fill_v=a.fillV),a.droppedA&&(o.dropped_a=a.droppedA),a.droppedV&&(o.dropped_v=a.droppedV),e.muxDroppedFrames&&(o.mux_dropped_video_frames=e.muxDroppedFrames),y(n.box)&&(o.unknown_ts_packet_count=e.unknownTSPacketCount,o.audio_non_monotonous=e.audioNonMonotonous,o.aac_overhead=e.aacOverhead),"number"==typeof e.decLibLoadDuration&&(o.dec_lib_load_duration=Math.round(e.decLibLoadDuration),o.dec_lib_hit=e.decLibCacheHit||""),this.Do.stat.coreType===l.a.native){var s=this.Do.stat.retryInfo.getLastMseError();s&&(o.last_error_code=e.errorCode,o.last_error_message=e.errorMessage,o.error_code=s.code,o.error_message=s.reason)}return o}}])}(cr),ja="kernel",Ha=function(t){function e(e,i){var n;return(n=t.call(this)||this).eA=void 0,n.Do=void 0,n.fO=void 0,n.nA=void 0,n.AO=new c.EventEmitter,n.Ci=void 0,n.vO=!1,n.dO=void 0,n.Ai=void 0,n.lO=void 0,n.Tg=function(t){var e=n.Do;t.levels=e.lctx.levels.map((function(t){return t.getKLevel()})),t.currentLevel=e.lctx.currentIdx,t.auto=e.lctx.abr,t.levels=e.lctx.levels.map((function(t){return t.getKLevel()}));var i=e.lctx.audioTracks;i&&i.length&&(t.audioTrack=e.lctx.audioIdx,t.audioTracks=i.map((function(t){return{lang:t.lang,qualityLabel:t.qualityLabel,qualityType:t.qualityType,bitrate:t.bitrate,groupId:t.groupId}})));var r=e.lctx.subtitleTracks;r&&r.length&&(t.subtitleTrack=e.lctx.subtitleIdx,t.subtitleTracks=r.map((function(t){return{lang:t.lang,name:t.name,groupId:t.groupId}}))),t.currentLevel=e.lctx.currentIdx,t.auto=e.lctx.abr,t.isLive=e.stat.isLive,void 0!==e.stat.stereoType&&(t.stereoType=e.stat.stereoType)},n.bO=function(t){n.pO(t)},n.sb=function(t){t.type===l.h.retry&&(n.nA=void 0)},n.mO=function(t){t.pos=Math.floor(n.eA.currentTime),t.ts=Math.floor(performance.now())},n.Di=function(t){if(n.Ci.i(ja,"on error",t),!t.preventFollowUp){var e=n.Do;if(t.details===D.a.MANIFEST_PARSING_ERROR)try{Li.isSrcEmpty(n.Do.src)&&(n.Ci.i(ja,"src empty",n.Do.src),t.details=D.a.SRC_EMPTY),e.src?"string"==typeof e.src?t.reason+="src str:"+e.src.slice(0,1024):e.src instanceof Blob?t.reason+="src: blob":t.reason+="src other:"+JSON.stringify(e.src).slice(0,1024):t.reason+="src:"+e.src}catch(e){t.reason+=e.message}var i=Object(D.d)(t.details,t.reason,t.statusCode||0);t.code=i,n.nA||(n.nA=t),t.fatal&&n.stopLoad()}},n.gO=function(t){n.Ci.i(ja,"window error:",t.message);try{n.Ci.i(ja,"window error stack:",t.error.stack)}catch(t){}},n.yO=function(){n.Do.evt.emit(S.a.VISIBILITY_CHANGE,{hidden:document.hidden})},n.eA=e,n.Do=new aa(i||{},n.eA),n.Yb(),n.Ci=n.Do.logger,typeof location<"u"&&n.Ci.i(ja,"href: "+location.href),n.Ci.i(ja,aa.packName+", "+aa.version+" build: "+aa.buildTime+" cors: "+(null==e?void 0:e.crossOrigin)+" autoplay: "+(null==e?void 0:e.autoplay)+" dom: "+e.tagName,i),(!n.Do.config||!1===n.Do.config.audioEnabled&&!1===n.Do.config.videoEnabled)&&setTimeout((function(){n.zA(Object(D.e)(D.b.OTHER_ERROR,D.a.CONFIG_ERROR,"config data error"))}),0),n.fO=new Fa(n.Do),n.Do.config.src&&(n.lO=n._O()),n.dO=new mr(n.Do,(function(t){var e;return null==(e=n.lO)?void 0:e.internalSeek(t)})),n.Ai=new ur(n.Ci,n.Do.evt),n.Ai.register(n.dO),n.Ai.register(n.fO),n.Ai.register(new hr(n.Do,n.AO)),n.O.push(n.Ai,n.dO,n.fO),n.Ci.i(ja,"config",n.Do.config),aa.instanceCount++,U()||(window.addEventListener("error",n.gO),document.addEventListener("visibilitychange",n.yO)),n}u()(e,t),e.isSupport=function(t){if(l.i.webrtc===(null==t?void 0:t.box))return Qn.isWebRTCSupported();if(null!=t&&t.nativeFirst)return Qn.isVideoBoxSupported(null==t?void 0:t.box);var e=Qn.isSupported();if(e){var i=!0;t&&(i=!(!t.isLive||t.box!==l.i.flv));var n=!i||or.isStreamingSupported();return e&&!!n}return Qn.isVideoBoxSupported(null==t?void 0:t.box)},e.videoCodecCapabilities=function(t){return Qn.getVideoCodecCompatibilityByCodec(t)};var i=e.prototype;return i.on=function(t,e){this.Ci.i(ja,"call on "+t),this.AO.on(t,e)},i.once=function(t,e){this.Ci.i(ja,"call once "+t),this.AO.once(t,e)},i.removeAllListeners=function(t){this.Ci.i(ja,"call removeAllListeners"),this.AO.removeAllListeners(t)},i.off=function(t,e){this.Ci.i(ja,"call off "+t),this.AO.off(t,e)},i.listeners=function(t){return this.AO.listeners(t)},i.emit=function(t,e){return this.AO.emit(t,e)},i.listenerCount=function(t){return this.AO.listenerCount(t)},i.prependListener=function(t,e){this.AO.prependListener(t,e)},i.prependOnceListener=function(t,e){this.AO.prependOnceListener(t,e)},i.load=function(t,i){var n,r,a,o=this;(this.Ci.i(ja,"call kernel load",t,i),this.fO.data.startTime>0&&this.Ci.i(ja,"play summary data:",this.fO.audienceStat),t&&this.Do.setSrc(t),this.Do.src)?e.isSupport({box:this.Do.stat.box,isLive:this.Do.stat.isLive,nativeFirst:this.Do.stat.native})?("number"==typeof(null==i?void 0:i.startFromSec)?this.Do.stat.startFromSec=i.startFromSec:t&&(this.Do.stat.startFromSec=-1),this.Do.stat.multipart&&this.Do.config.resourceBuffer&&function(t){var e;performance.addEventListener&&(e=t,performance&&("function"==typeof performance.setResourceTimingBufferSize?performance.setResourceTimingBufferSize(e):"function"==typeof performance.webkitSetResourceTimingBufferSize&&performance.webkitSetResourceTimingBufferSize(e)),performance.addEventListener("resourcetimingbufferfull",Pt))}(this.Do.config.resourceBufferSize),t&&(null==(n=this.lO)?void 0:n.type)!==((a=this.Do).stat.box===l.i.webrtc?l.a.rtc:a.stat.native?l.a.native:l.a.mse)&&(null==(r=this.lO)||r.destroy(),this.lO=void 0),this.Do.fallback.register(O.NEXT_DESC,new dr(this.Do).setRetryFunc(this.CO.bind(this))),this.Do.fallback.register(O.SWAP_264,new pr(this.Do).setRetryFunc(this.CO.bind(this))),this.RA()):setTimeout((function(){o.zA(Object(D.e)(D.b.OTHER_ERROR,D.a.UNSUPPORTED,"unsupported: "+o.Do.stat.box+" live: "+o.Do.stat.isLive+" native: "+o.Do.stat.native))}),0):this.zA(Object(D.e)(D.b.OTHER_ERROR,D.a.SRC_EMPTY,"url empty"))},i.getTimeNow=function(){var t;return(null==(t=this.Do.liveTime)?void 0:t.serverNowMs)||null},i.setAvailableAbrLevels=function(t){this.Ci.i(ja,"setAvailableAbrLevels",t),this.Do.lctx.availableList=t.splice(0),this.lO&&"onAbrLevelsUpdated"in this.lO&&this.lO.onAbrLevelsUpdated()},i.preload=function(t,e){this.Ci.i(ja,"call preload")},i.isTimeinBuffered=function(t){return this.Do.stat.box!==l.i.webrtc&&this.Do.isTimeinBuffered(t)},i.resume=function(){var t,e,i=this;this.Ci.i(ja,"call resume"),null==(t=this.lO)||t.resume(),this.eA.paused&&(null==(e=this.eA.play())||e.catch((function(t){return i.Ci.i(ja,"resume, call play() fail.",t)})))},i.destroy=function(){var e;this.Ci.i(ja,"call kernel destroy. play summary data:",this.fO.audienceStat),this.vO&&(aa.instanceCount--,this.vO=!0),xt(),this.Do.fallback.unregisterAndDestroy(O.NEXT_DESC),this.Do.fallback.unregisterAndDestroy(O.SWAP_264),this.Do.fallback.unregisterAndDestroy(O.SWAP_CORE),t.prototype.destroy.call(this),null==(e=this.lO)||e.destroy(),this.Do.destroy(),this.removeAllListeners(),U()||(window.removeEventListener("error",this.gO),document.removeEventListener("visibilitychange",this.yO))},i.refresh=function(){var t,e;this.Ci.i(ja,"call kernel refresh"),this.fO.onRefresh(),this.nA=void 0,null==(t=this.Do.cOutput)||t.reset(),null==(e=this.lO)||e.refresh()},i.stopLoad=function(){var t;this.Ci.i(ja,"call kernel stopLoad"),null==(t=this.lO)||t.stopLoad()},i.getStreamTime=function(t){var e=this.Do.streamTime.getStreamTime(t/1e3);return e?1e3*e:NaN},i.getAudienceStat=function(){return this.fO.audienceStat},i.getMediaInfo=function(){var t;return r()({},null==(t=this.Do.loadRec.currentLoad)?void 0:t.mediaInfo)},i.experiment=function(t){this.Ci.i(ja,"experiment",t)},i.liveEnd=function(){this.Ci.i(ja,"call liveEnd"),this.lO&&"liveEnd"in this.lO&&this.lO.liveEnd()},i.seekToNextFrame=function(){this.Ci.i(ja,"call seekToNextFrame"),this.lO&&"seekToNextFrame"in this.lO?this.lO.seekToNextFrame():this.IO()},i.seekToPrevFrame=function(){this.Ci.i(ja,"call seekToPrevFrame"),this.lO&&"seekToPrevFrame"in this.lO?this.lO.seekToPrevFrame():this.IO()},i.seekByFrameIndex=function(t){if(this.Ci.i(ja,"call seekByFrameIndex",t),this.lO&&"setCurretVideoFrame"in this.lO)return this.lO.setCurretVideoFrame(t);this.IO()},i.screenshot=function(t){var e;t&&(t=JSON.parse(JSON.stringify(t))),this.Ci.i(ja,"call screenshot",t),null==(e=this.lO)||e.screenshot(t)},i.RA=function(t){this.nA=void 0,this.lO||(this.lO=this._O()),this.lO&&(this.Do.fallback.hasFallback(O.SWAP_CORE)||(this.lO.type===l.a.mse?this.Do.fallback.register(O.SWAP_CORE,new vr(this.Do).setRetryFunc(this.OO.bind(this))):this.lO.type===l.a.native&&this.Do.fallback.register(O.SWAP_CORE,new _r(this.Do).setRetryFunc(this.wO.bind(this)))),this.lO.load(t),this.Do.stat.coreType=this.lO.type)},i._O=function(){var t,e=this.Do,i=(t=e).stat.native?new Cr(t):t.stat.box!==l.i.webrtc&&jn?new jn(t):t.stat.box===l.i.webrtc&&Sr?new Sr(t):void 0;if(i)return this.Ci.i(ja,"init av core. type: "+i.type),e.stat.coreType=i.type,i;this.zA(Object(D.e)(D.b.OTHER_ERROR,D.a.UNSUPPORTED,"init core error. "+e.stat.box+" native: "+e.stat.native+" unsupported."))},i.OO=function(){this.CO(l.a.native)},i.wO=function(){this.CO(l.a.mse)},i.CO=function(t){var e,i,n=this,r=this.eA.paused;!this.Do.live&&this.Do.stat.startFromSec<=0&&(this.Do.stat.startFromSec=this.eA.currentTime),null==(e=this.lO)||e.destroy(),this.lO=void 0,void 0!==t&&(this.Do.stat.native=t!==l.a.mse),this.Do.stat.demuxerType=void 0,this.RA(l.h.retry),r||null==(i=this.eA.play())||i.catch((function(t){return n.Ci.i(ja,"recover, call play() fail.",t)}))},i.pO=function(t){var e=this.Do.cOutput;e&&(void 0===t&&(t={enabled:!0,type:e.rendererType,canvas:e.rendererType===l.s.canvas&&e.canvas?e.canvas:void 0}),this.Ci.i(ja,"video renderer change",t),t.canvas&&this.emit(S.a.H265_DETECTED,{canvas:t.canvas,message:"",enabled:t.enabled,decoder:l.d.wasm}))},i.IO=function(){this.zA(Object(D.e)(D.b.MEDIA_ERROR,D.a.CANNOT_SEEK_BY_FRAME_INDEX,"unsupported",{fatal:!1}))},i.zA=function(t){this.Do.evt.emit(S.a.ERROR,t)},i.Yb=function(){var t=this.Do.evt;t.on(S.a.ERROR,this.Di),t.on(S.a.MANIFEST_PARSED,this.Tg),t.on(S.a.VIDEO_RENDERER_CHANGE,this.bO),t.on(S.a.LOAD,this.sb),t.on(S.a.RETRY,this.mO)},o()(e,[{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(t){this.Ci.i(ja,"call set currentVideoFrame",t),this.lO&&"setCurretVideoFrame"in this.lO&&this.lO.setCurretVideoFrame(t)}},{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(t){var e;this.Ci.i(ja,"call set audioTrack",t),!1===this.Do.config.audioEnabled&&(this.Ci.i(ja,"set audioTrack failed. conf audio enabled false"),this.emit(S.a.AUDIO_TRACK_SWITCH_FAILED)),this.lO&&"setAudioTrack"in this.lO&&(null==(e=this.lO)||e.setAudioTrack(t))}},{key:"subtitleTrack",get:function(){return this.Do.lctx.subtitleIdx||0},set:function(t){var e;this.Ci.i(ja,"call set subtitleTrack",t),this.lO&&"setSubtitleTrack"in this.lO&&(null==(e=this.lO)||e.setSubtitleTrack(t))}},{key:"currentLevel",get:function(){return this.Do.lctx.currentIdx||0},set:function(t){if(this.Ci.i(ja,"call set currentLevel from: "+this.Do.lctx.currentIdx+" to: "+t+" ",this.Do.lctx.abr),this.lO&&"setCurrentLevel"in this.lO)if(t<0&&!this.Do.isAbrAvailable)this.Ci.i(ja,"set currentLevel failed. unsupported auto"),this.emit(S.a.LEVEL_SWITCH_FAILED);else if(!1===this.Do.config.videoEnabled)this.Ci.i(ja,"set currentLevel failed. conf video enabled false"),this.emit(S.a.LEVEL_SWITCH_FAILED);else{var e;null==(e=this.lO)||e.setCurrentLevel(t)}else this.Ci.i(ja,"set nextLevel failed. unsupported"),this.emit(S.a.LEVEL_SWITCH_FAILED)}},{key:"nextLevel",get:function(){return this.Do.lctx.nextIdx||0},set:function(t){if(this.Ci.i(ja,"call set nextLevel from: "+this.Do.lctx.nextIdx+" to "+t),this.lO&&"setNextLevel"in this.lO)if(t<0&&!this.Do.isAbrAvailable)this.Ci.i(ja,"set nextLevel failed. unsupported auto"),this.emit(S.a.LEVEL_SWITCH_FAILED);else if(!1===this.Do.config.videoEnabled)this.Ci.i(ja,"set nextLevel failed. conf video enabled false"),this.emit(S.a.LEVEL_SWITCH_FAILED);else{var e;null==(e=this.lO)||e.setNextLevel(t)}else this.Ci.i(ja,"set nextLevel failed. unsupported"),this.emit(S.a.LEVEL_SWITCH_FAILED)}},{key:"startLevel",get:function(){return this.Do.lctx.startIdx||0},set:function(t){this.Ci.i(ja,"call set startLevel",t),this.Do.lctx.startIdx=t}},{key:"outputLog",get:function(){return this.Do.logger.getOutput()},set:function(t){this.Ci.i(ja,"call set output log",t),this.Do.logger.setOutput(t)}},{key:"autoLevelEnabled",get:function(){return this.Do.lctx.abr}},{key:"monitorData",get:function(){return this.fO&&this.lO?r()(this.fO.snapshot,{trackBufInfo:this.lO.getTrackBufInfo()}):null}},{key:"currentLevelTimeInfo",get:function(){var t=this.Do.lctx.current;if(t&&t.timeInfo)return t.timeInfo}},{key:"instanceId",get:function(){return this.Do.id}}],[{key:"version",get:function(){return aa.version}},{key:"buildTime",get:function(){return aa.buildTime}},{key:"MediaBox",get:function(){return l.i}},{key:"Events",get:function(){return{REPORT:S.a.REPORT,ERROR:S.a.ERROR,LEVEL_SWITCHING:S.a.LEVEL_SWITCHING,LEVEL_SWITCHED:S.a.LEVEL_SWITCHED,LEVEL_SWITCH_PLAYING:S.a.LEVEL_SWITCH_PLAYING,LEVEL_SWITCH_FAILED:S.a.LEVEL_SWITCH_FAILED,AUDIO_TRACK_SWITCHING:S.a.AUDIO_TRACK_SWITCHING,AUDIO_TRACK_SWITCHED:S.a.AUDIO_TRACK_SWITCHED,AUDIO_TRACK_UPDATED:S.a.AUDIO_TRACK_UPDATED,SUBTITLE_TRACK_SWITCHED:S.a.SUBTITLE_TRACK_SWITCHED,MANIFEST_PARSED:S.a.MANIFEST_PARSED,LEVEL_UPDATED:S.a.LEVEL_UPDATED,LOAD_END:S.a.LOAD_END,VIDEO_RENDERER_CHANGE:S.a.VIDEO_RENDERER_CHANGE,SCREENSHOT:S.a.SCREENSHOT}}},{key:"Reports",get:function(){return r()({},br)}}])}(h.a);function Ga(t,e){return U()?void 0:new Ha(t,e)}}]);/*! For license information please see no-wasm-hdr.mjs.LICENSE.txt */void 0===Xt&&console.error("esm-webpack-plugin: nothing exported!");var Zt=Xt.default;Xt.createKernel,Xt.AbstractDestroyable,Xt.CanvasContextType,Xt.CodecType,Xt.DestroyableList,Xt.Decoder,Xt.DemuxerType,Xt.DownloadStatus,Xt.ErrorDetails,Xt.ErrorTypes,Xt.HttpRangeType;var qt=Xt.KEvents;Xt.LiveShiftType,Xt.LogLevel,Xt.MediaBox,Xt.ReportTypes,Xt.StereoType,Xt.VideoDecBlockPolicy,Xt.VideoDropFramePolicy,Xt.VideoRendererType,Xt.WasmDecoder;var Jt="_kwai-player_1ufc0_2",$t="_kwai-player-video-interactive_1ufc0_11",te="_kwai-player-poster_1ufc0_19",ee="_kwai-player-video_1ufc0_11",ie="_kwai-player-disable-scroll_1ufc0_52",ne="_kwai-player-yoda_1ufc0_56",re="kwai-player-id",ae=function(){function t(){}return t.next=function(){if(kt.available){var e=t._ls.read(re,!1),i=t._id;return"number"==typeof e?(i=this.getNextId(e),this._ls.write(re,i)):(i=this.getNextId(i),this._ls.write(re,i)),t._id=i,i}return t._id=t.getNextId(t._id),t._id},t.getNextId=function(e){return++e>t.MAX_ID?0:e},_()(t,null,[{key:"MAX_ID",get:function(){return 999}}])}();zt(ae,"_id",0),zt(ae,"_ls",new kt);var oe=ae,se=function(){function t(){}return t.verify=function(t){return!!(t&&t.liveStreamId&&(Array.isArray(t.liveAdaptiveManifest)&&t.liveAdaptiveManifest.length||Array.isArray(t.multiResolutionPlayUrls)&&t.multiResolutionPlayUrls.length||Array.isArray(t.playUrls)&&t.playUrls.length||t.hlsPlayUrl))},t.parse=function(e){var i;if(t.verify(e))return e.liveAdaptiveManifest&&e.liveAdaptiveManifest.length?i=e.liveAdaptiveManifest[0]:e.multiResolutionPlayUrls&&e.multiResolutionPlayUrls.length&&(i=t._multiResolution2Manifest(e.multiResolutionPlayUrls)),Ft&&e.hlsPlayUrl?i?[{src:i},{src:e.hlsPlayUrl}]:e.hlsPlayUrl:i},t._multiResolution2Manifest=function(t){return{version:"1",adaptationSet:{representation:t.map((function(t,e){var i;return{id:e,url:null==(i=t.urls[0])?void 0:i.url,name:t.name,bitrate:0,qualityType:t.type,defaultSelect:t.defaultSelect}})).filter((function(t){return t.url}))}}},t}(),ue=function(t){return t[t.CTOR_ERROR=1e4]="CTOR_ERROR",t}(ue||{}),ce=function(){function t(){}return t.verify=function(t){return!!(t&&Object.prototype.hasOwnProperty.call(t,"version")&&Object.prototype.hasOwnProperty.call(t,"adaptationSet")&&Object.prototype.hasOwnProperty.call(t.adaptationSet,"representation")&&Array.isArray(t.adaptationSet.representation)&&t.adaptationSet.representation.length>0)&&t.adaptationSet.representation.reduce((function(t,e){return!!(t&&e.url&&e.bitrate&&e.qualityType)}),!0)},t}(),le=function(){function t(){}return t.verify=function(t){return!!(t&&t.adaptationSet&&t.adaptationSet.length)&&t.adaptationSet.reduce((function(t,e){return!!(t&&e.representation&&e.representation.length)}),!0)},t}(),he=/\.[^./\\?#]+(?=$|[?#])/i;var de=function(){function t(){}return t.parse=function(e){if("string"==typeof e)try{return e=JSON.parse(e),t._parseManifest(e)}catch(i){return t._parseUrl(e)}else if("object"==typeof e)return t._parseManifest(e)},t._parseUrl=function(t){return".flv"===function(t){var e=t.toLocaleLowerCase().match(he);return e?e[0]:""}(t)?{isLive:!0,src:{liveStreamId:"",playUrls:[{url:t}]}}:{isLive:!1,src:[{url:t}]}},t._parseManifest=function(t){return le.verify(t)?{isLive:!1,src:t}:ce.verify(t)?{isLive:!0,src:{liveStreamId:"",liveAdaptiveManifest:[t]}}:se.verify(t)?{isLive:!0,src:t}:{isLive:!1}},t}(),fe=typeof document>"u"?void 0:document.createElement("video");var pe="fullscreen",_e=function(){function t(t,e){var i=this;zt(this,"_evt"),zt(this,"_logger"),zt(this,"_element"),zt(this,"_isFillWindow",!1),zt(this,"_originStyle"),zt(this,"_isSupportFullscreen",!0),zt(this,"_onFullscreenChange",(function(){i._logger.i(pe,"_onFullscreenChange",i.isFull()),i.isFull()||(i._recoverStyle(),document.body.classList.remove(ie)),i._isFillWindow=!1,i._evt.emit("fullChange",{type:Kt.SYSTEM,isFull:i.isFull()})})),this._evt=t,this._logger=e,!(typeof document>"u")&&(this._isSupportFullscreen=typeof this._getExitFullscreenFunc()<"u"&&!("iOS"===Mt.os.name&&"mobile"===Mt.device.type),"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)))}var e=t.prototype;return e.destroy=function(){document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("fullscreenerror",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenerror",this._onFullscreenChange)},e.requestFull=function(t,e){e===Kt.SYSTEM?this.requestFullscreen(t):e===Kt.WINDOW?this.requestFillWindow(t):this._isSupportFullscreen?this.requestFullscreen(t):this.requestFillWindow(t)},e.exitFull=function(t){return t===Kt.SYSTEM?this.exitFullscreen():t===Kt.WINDOW?this.exitFillWindow():void(this.isFull(Kt.SYSTEM)?this.exitFullscreen():this.exitFillWindow())},e.isFull=function(t){return t===Kt.SYSTEM?this.isFullScreen():t===Kt.WINDOW?this.isFillWindow():this.isFullScreen()||this.isFillWindow()},e.requestFullscreen=function(t){var e=this;this._element=t,this._originStyle||this._saveOriginStyle(t),("Mac OS"===Mt.os.name||"IE"===Mt.browser.name||"iOS"===Mt.os.name&&"mobile"!==Mt.device.type)&&(t.style.width="100%",t.style.height="100%",t.style.background="black");var i,n=t;n.requestFullscreen?i=n.requestFullscreen():n.mozRequestFullscreen?i=n.mozRequestFullscreen():n.mozRequestFullScreen?i=n.mozRequestFullScreen():n.webkitRequestFullscreen?i=n.webkitRequestFullscreen():n.webkitRequestFullScreen?i=n.webkitRequestFullScreen():n.msRequestFullscreen&&(i=n.msRequestFullscreen()),typeof Promise<"u"&&i instanceof Promise&&i.catch((function(t){return e._logger.e(pe,t)}))},e.exitFullscreen=function(){this._recoverStyle(),this._element=void 0;var t=document;t.exitFullscreen?t.exitFullscreen():t.webkitCancelFullScreen?t.webkitCancelFullScreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},e.isFullScreen=function(){var t=document;return!!(t.fullscreen||t.fullscreenElement||t.isFullScreen||t.webkitIsFullScreen||t.mozFullScreen||t.msFullscreenElement)},e.requestFillWindow=function(t){this._element=t,this._originStyle||this._saveOriginStyle(t),t.style.width="100%",t.style.height="100%",t.style.background="black",t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.zIndex="99999",document.body.classList.add(ie),this._isFillWindow=!0,this._evt.emit("fullChange",{type:"window",isFull:!0})},e.exitFillWindow=function(){this._recoverStyle(),this._isFillWindow=!1,this._element&&(this._element.style.zIndex="auto"),this._element=void 0,document.body.classList.remove(ie),this._evt.emit("fullChange",{type:"window",isFull:!1})},e.isFillWindow=function(){return this._isFillWindow},e.isFullscreenAvailable=function(t){return!(t!==Kt.WINDOW&&typeof document<"u")||!!(document.body.requestFullscreen||document.body.webkitRequestFullscreen||document.body.msRequestFullscreen||document.body.mozRequestFullscreen)},e._getExitFullscreenFunc=function(){var t=document;return t.exitFullscreen||t.webkitCancelFullScreen||t.mozCancelFullScreen||t.msExitFullscreen},e._saveOriginStyle=function(t){this._originStyle={position:t.style.position,background:t.style.background,width:t.style.width,height:t.style.height,left:t.style.left,right:t.style.right}},e._recoverStyle=function(){if(this._element)for(var t in this._originStyle)this._element.style[t]=this._originStyle[t];this._originStyle=void 0},t}(),ve="ControlsPlugin",Ae="I18nPlugin",ge="LoggerPlugin",me="HotkeyPlugin",be="PlayInfoPlugin",ye="RotatePlugin",Ee="PreviewPlugin",Ce="MaskPlugin",Te="VRPlugin",Ie="DanmakuPlugin",Re=function(t){return t.DARK="dark",t.LIGHT="light",t}(Re||{}),we=function(t){return t.BOTTOM="bottom",t.PLAY_BAR="playBar",t.NONE="none",t}(we||{}),Le=function(t){return t.PLAY_BAR_LEFT="playBarLeft",t.PLAY_BAR_RIGHT="playBarRight",t.CONTEXT_MENU="contextMenu",t}(Le||{}),De=function(){function t(){zt(this,"_callbacks",[])}var e=t.prototype;return e.add=function(t){this._callbacks.push(t)},e.remove=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},e.call=function(t){this._callbacks.forEach((function(e){return e(t)}))},e.destroy=function(){this._callbacks.splice(0,this._callbacks.length)},t}(),Se=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Ht);zt(Se,"label"),zt(Se,"version"),zt(Se,"isSupported");var Oe=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Se);zt(Oe,"label",ve);var Ne=Oe,ke=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Se);zt(ke,"label",Ae);var xe=ke,Pe=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Se);zt(Pe,"label",ge);var Me=Pe,Ue=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(Ue,"label",me);var Be=Ue,Ve=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(Ve,"label",be);var Fe=Ve,je=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(je,"label",ye);var He=je,Ge=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(Ge,"label",Ee);var ze=Ge,We=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(We,"label",Ce);var Ke=We,Ye=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(Ye,"label",Te);var Qe=Ye,Xe=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Se);zt(Xe,"label",Ie);var Ze=Xe,qe="pluginBase",Je=function(){function t(){zt(this,"_instances",[])}t.register=function(t,e){void 0===e&&(e="append"),S.i(qe,"register",t.label,t.version),t.label||S.i(qe,"register plugin label is empty.");var i=this._plugins.findIndex((function(e){return e.label===t.label}));i>=0?(S.i(qe,"register plugin label: "+t.label+" exists."),this._plugins.splice(i,1,t)):"append"===e?this._plugins.push(t):this._plugins.unshift(t)},t.deregister=function(t){if("string"==typeof t){S.i(qe,"deregister",t);var e=this._plugins.findIndex((function(e){return e.label===t}));if(-1===e)return void S.i(t+" plugin unregistered");this._plugins.splice(e,1)}else{S.i(qe,"deregister",t.label);var i=this._plugins.indexOf(t);if(-1===i)return void S.i(t.label+" plugin unregistered");this._plugins.splice(i,1)}};var e=t.prototype;return e.initialize=function(e){for(var i,n=this._instances,r=g(t._plugins);!(i=r()).done;){var a=i.value;try{if(e&&!1===e[a.label])continue;if(!1===a.isSupported){S.i(qe,"initialize "+a.label+", "+a.version+". The current browser does not support this plugin.");continue}S.i(qe,"initialize",a.label,a.version,e);var o=new a;Se.isInstanceOfPlugin(o)?n.push(o):S.e(qe,"plugin type error: "+o)}catch(o){S.e(qe,"plugin initialize error",o)}}},e.beforeInstallPlugins=function(t,e){for(var i,n=g(this._instances);!(i=n()).done;){var r=i.value,a=r.getLabel();S.i(qe,"beforeInstallPlugins",e,a);try{if(!r.beforeInstall)continue;e&&"object"==typeof e[a]?r.beforeInstall(t,e[a]):r.beforeInstall(t)}catch(t){S.e(qe,"beforeInstallPlugins error",t)}}},e.afterInstallPlugins=function(t,e){for(var i,n=g(this._instances);!(i=n()).done;){var r=i.value,a=r.getLabel();S.i(qe,"afterInstallPlugins",a,e);try{if(!r.afterInstall)continue;e&&"object"==typeof e[a]?r.afterInstall(t,e[a]):r.afterInstall(t)}catch(t){S.e(qe,"afterInstallPlugins error",t)}}},e.beforeUninstallPlugins=function(t){for(var e,i=g(this._instances);!(e=i()).done;){var n=e.value;try{if(S.i(qe,"beforeUninstallPlugins",n.getLabel()),!n.beforeUninstall)continue;n.beforeUninstall.call(n,t)}catch(t){S.e(qe,"plugin beforeUninstall error",t)}}},e.afterUninstallPlugins=function(t){for(var e,i=g(this._instances);!(e=i()).done;){var n=e.value;try{if(S.i(qe,"afterUninstallPlugins",n.getLabel()),!n.afterUninstall)continue;n.afterUninstall.call(n,t)}catch(t){S.e(qe,"plugin afterUninstall error",t)}}this._instances=[]},e.getPlugin=function(t){for(var e=0;e<this._instances.length;e++)if(this._instances[e].getLabel()===t)return this._instances[e]},e.getAllPlugins=function(){return this._instances},t}();zt(Je,"_plugins",[]);var $e=Je,ti="kwai-player",ei=function(){function t(e,i){var n,r=this;if(zt(this,"_pluginBase",new $e),zt(this,"_eventHandlers"),zt(this,"_evt"),zt(this,"_mainDom"),zt(this,"_video"),zt(this,"_kernel"),zt(this,"_error"),zt(this,"_config"),zt(this,"_src",""),zt(this,"_autoplay",!1),zt(this,"_preload","none"),zt(this,"_poster",""),zt(this,"_controls","default"),zt(this,"_videoWidth",0),zt(this,"_videoHeight",0),zt(this,"_kernelLoaded",!1),zt(this,"_livePaused",!1),zt(this,"_canvas"),zt(this,"_mediaInfo"),zt(this,"_logger"),zt(this,"_isLiveShift",!1),zt(this,"_full"),zt(this,"_subContainerNumber",0),zt(this,"_data"),zt(this,"_id"),zt(this,"_videoLayer"),zt(this,"_videoInteractiveLayer"),zt(this,"_posterLayer"),zt(this,"_preprocessSrcFunc"),zt(this,"_preprocessURL"),zt(this,"_kernelStartTimeout",0),zt(this,"_instanceId"),zt(this,"_yodaDom"),zt(this,"_yoda"),zt(this,"_kernelType","unknown"),zt(this,"_outputLogger"),zt(this,"_yodaEnabled",!0),zt(this,"_screenshotId",1),zt(this,"_screenshotQueue",[]),zt(this,"_observer"),zt(this,"_objectFit",""),zt(this,"requestFullscreen",(function(t){if(r._logger.i(ti,"requestFullscreen"),r._mainDom){if(r._yoda)return void(r._yoda.isFullscreen()||r._yoda.fullScreen("portrait"));r._full.isFull(t)||r._full.requestFull(r._mainDom,t)}})),zt(this,"exitFullscreen",(function(t){if(r._logger.i(ti,"exitFullscreen"),r._mainDom){if(r._yoda)return void r._yoda.exitFullScreen();r._full.isFull(t)&&r._full.exitFull(t)}})),zt(this,"_onFullscreenchange",(function(t){r.emit(Qt.FULLSCREEN_CHANGE,t)})),zt(this,"_onMutedChange",(function(t){r._video&&(r._video.muted=t)})),zt(this,"_onVideoLoadstart",(function(){r.emit(Qt.LOADSTART)})),zt(this,"_onVideoProgress",(function(){r.emit(Qt.PROGRESS)})),zt(this,"_onVideoSuspend",(function(){r.emit(Qt.SUSPEND)})),zt(this,"_onVideoAbort",(function(){r.emit(Qt.ABORT)})),zt(this,"_onVideoEmptied",(function(){r.emit(Qt.EMPTIED)})),zt(this,"_onVideoStalled",(function(){r.emit(Qt.STALLED)})),zt(this,"_onVideoLoadedmetadata",(function(){r.emit(Qt.LOADEDMETADATA)})),zt(this,"_onVideoLoadeddata",(function(){r.emit(Qt.LOADEDDATA)})),zt(this,"_onVideoCanplay",(function(){r.emit(Qt.CANPLAY)})),zt(this,"_onVideoCanplaythrough",(function(){r.emit(Qt.CANPLAYTHROUGH)})),zt(this,"_onVideoPlaying",(function(){"iOS"!==Mt.os.name&&"Android"!==Mt.os.name&&r._hidePosterDom(),r.emit(Qt.PLAYING)})),zt(this,"_onVideoWaiting",(function(){r.emit(Qt.WAITING)})),zt(this,"_onVideoSeeking",(function(){r.emit(Qt.SEEKING)})),zt(this,"_onVideoSeeked",(function(){r.emit(Qt.SEEKED),r.kernel&&r._updateIsLiveShift(r.kernel.liveShift)})),zt(this,"_onVideoEnded",(function(){r.emit(Qt.ENDED)})),zt(this,"_onVideoDurationchange",(function(){r.emit(Qt.DURATIONCHANGE)})),zt(this,"_onVideoTimeupdate",(function(){var t,e;"none"!==r._posterLayer.style.display&&4===(null==(t=r._video)?void 0:t.readyState)&&!(null!=(e=r._video)&&e.paused)&&r._hidePosterDom(),r.emit(Qt.TIMEUPDATE)})),zt(this,"_onVideoPlay",(function(){r.emit(Qt.PLAY)})),zt(this,"_onVideoPause",(function(){r.emit(Qt.PAUSE)})),zt(this,"_onVideoRatechange",(function(){r.emit(Qt.RATECHANGE)})),zt(this,"_onVideoResize",(function(){r.emit(Qt.RESIZE)})),zt(this,"_onVideoVolumechange",(function(){r.emit(Qt.VOLUMECHANGE)})),zt(this,"_onVideoEnterpictureinpicture",(function(){r.emit(Qt.ENTER_PICTURE_IN_PICTURE)})),zt(this,"_onVideoLeavepictureinpicture",(function(){r.emit(Qt.LEAVE_PICTURE_IN_PICTURE)})),this._instanceId=oe.next(),this._logger=(new O).setLevel(jt).setName("kwai-p").setId(this._instanceId),null!=i&&i.logger&&this._logger.setOutput(i.logger),N("kwai-player",t.packVersion),this._logger.i(ti,t.packVersion,t.version,this._instanceId,e.toString(),i),this._data=i||{},"string"==typeof e?(this._id=e,this._mainDom=document.querySelector(e)):(this._id="kp_"+(1e3*Math.random()|0),this._mainDom=e),this._evt=new Ht,this._evt.setMaxListeners(30),this._full=new _e(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},i&&typeof i.controls<"u"&&(this.controls=i.controls),this._videoLayer=document.createElement("div"),this._videoLayer.className=ee,this._posterLayer=document.createElement("div"),this._posterLayer.className=te,this._posterLayer.dataset.kpRole="poster",this._videoLayer.appendChild(this._posterLayer),this._videoInteractiveLayer=document.createElement("div"),this._videoInteractiveLayer.className=$t,this._video=document.createElement("video"),!this._mainDom)return this._logger.i(ti,"container not found."+e),void this._setError({code:ue.CTOR_ERROR,message:"container not found."+e});this._observer=new MutationObserver((function(t){for(var e,i=g(t);!(e=i()).done;){var n=e.value;"attributes"===n.type&&"style"===n.attributeName&&r._applyObjectFit()}}));this._observer.observe(this._mainDom,{attributes:!0,attributeFilter:["style"]}),this._applyObjectFit(),this._mainDom.className=this._mainDom.className?this._mainDom.className+" "+Jt:Jt,this._mainDom.setAttribute("role","player"),this._mainDom.appendChild(this._videoLayer),this._mainDom.appendChild(this._videoInteractiveLayer),this._video.controls=!1,this._videoLayer.appendChild(this.video),t._yodaClass&&(this._yodaDom=document.createElement("div"),this._yodaDom.className=ne,this._videoLayer.appendChild(this._yodaDom)),this._bindVideo(),this._pluginBase.initialize(null==i?void 0:i.plugins),this._pluginBase.beforeInstallPlugins(this,null==i?void 0:i.plugins),i&&this._parseData(i);var a=(null==(n=this._config)?void 0:n.src)||this._src;a&&this._initKernel(!1),this._pluginBase.afterInstallPlugins(this,null==i?void 0:i.plugins),a&&(this._kernelStartTimeout=+setTimeout((function(){r._clearKernelStartTimer(),r._kernelStart()}),0)),this._logger.i(ti,"constructor completed.")}var e=t.prototype;return e.setPreprocessURL=function(t){this._preprocessURL=t},e.setPreprocessSrcFunc=function(t){this._preprocessSrcFunc=t},e.load=function(){var t;this._logger.i(ti,"call load"),null==(t=this._kernel)||t.load(),this._kernelLoaded=!0},e.play=function(){var t,e,i,n,r,a=this;return this._logger.i(ti,"call play",this._kernelLoaded,this._livePaused),this._yoda?(null==(e=null==(t=this._video)?void 0:t.play())||e.catch((function(t){return a._logger.i(ti,"play, call play() fail.",t)})),this._yoda.play()):(this._livePaused&&!this._isLiveShiftMode()?null==(i=this._kernel)||i.refresh():this._kernelLoaded||this.load(),this._video.paused?null==(r=null==(n=this._video)?void 0:n.play())?void 0:r.catch((function(t){return a._logger.i(ti,"play, call play() fail.",t)})):Promise.resolve())},e.pause=function(){var t,e,i;if(this._logger.i(ti,"call pause",null==(t=this._mediaInfo)?void 0:t.isLive),!this._yoda)return this._kernel&&null!=(e=this._mediaInfo)&&e.isLive&&!this._isLiveShiftMode()&&(this._logger.i(ti,"live stop load"),this._kernel.stopLoad(),this._livePaused=!0),this._isLiveShiftMode()&&!this._isLiveShift&&this._updateIsLiveShift(!0),null==(i=this._video)?void 0:i.pause();this._yoda.pause()},e.requestPictureInPicture=function(){return this._logger.i(ti,"call requestPictureInPicture"),this._yoda?Promise.reject("not support requestPictureInPicture. yoda"):this._video&&"requestPictureInPicture"in this._video?this._video.requestPictureInPicture():Promise.reject("not support requestPictureInPicture")},e.isPictureInPictureAvailable=function(){return!this._yoda&&!(null==fe||!fe.requestPictureInPicture)},e.destroy=function(){var t,e,i;this._logger.i(ti,"call destroy"),null==(t=this._observer)||t.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(),null==(e=this._videoLayer.parentElement)||e.removeChild(this._videoLayer),null==(i=this._videoLayer.parentElement)||i.removeChild(this._videoInteractiveLayer),this.removeAllListeners(),this._pluginBase.afterUninstallPlugins(this)},e.refresh=function(){var t;this._logger.i(ti,"call refresh"),null==(t=this._kernel)||t.refresh()},e.jumpToLive=function(){var t,e;this._logger.i(ti,"call jumpToLive type: "+(null==(t=this._data)?void 0:t.liveShiftType)),this.kernel&&null!=(e=this._data)&&e.liveShiftType&&this._isLiveShiftMode()&&(this.video.currentTime=this.video.duration-this.kernel.liveShiftDelaySec,this.kernel&&this._updateIsLiveShift(!0))},e.getStreamTime=function(t){var e;return this._yoda?0:(null==(e=this._kernel)?void 0:e.getStreamTime(t))||0},t.register=function(t,e){void 0===e&&(e="append"),$e.register(t,e)},t.deregister=function(t){$e.deregister(t)},t.setYoda=function(e){t._yodaClass=e},e.getPluginInstance=function(t){return this._pluginBase.getPlugin(t)},e.getAllPlugins=function(){return this._pluginBase.getAllPlugins()},e.createSubContainer=function(t){void 0===t&&(t=Yt.DEFAULT);var e=document.createElement("div");e.id=this._id+"-sub-"+Math.round(this._subContainerNumber++);var i=this._mainDom;if(t===Yt.VIDEO&&(i=this._videoLayer),t===Yt.VIDEO_INTERACTIVE&&(i=this._videoInteractiveLayer),!i)throw new Error("cteate sub container error. no parent found.");return i.children.length?i.children[i.children.length-1].insertAdjacentElement("afterend",e):i.appendChild(e),e},e.isFullscreen=function(t){return this._yoda?this._yoda.isFullscreen():this._full.isFull(t)},e.isFullscreenAvailable=function(t){return!!this._yoda||this._full.isFullscreenAvailable(t)},e._applyObjectFit=function(){var t,e=(null==(t=this._mainDom)?void 0:t.style.objectFit)||"";this._logger.i(ti,"apply objectFit: "+e),this._video.style.objectFit=e,this._canvas&&(this._canvas.style.objectFit=e),this._yoda&&(this._yoda.objectFit=e||"contain"),this._objectFit=e,this.emit(Qt.OBJECT_FIT_CHANGE)},e.removeSubContainer=function(t){t.parentElement&&t.parentElement.removeChild(t)},e.screenshot=function(){var t=this,e=this._kernel;return this._yoda?(this._logger.i(ti,"screenshot yoda"),this._yoda.screenshot()):e?(this._screenshotId++,new Promise((function(i){var n=t._screenshotId.toString();t._screenshotQueue.push({id:n,timer:setTimeout((function(){t._logger.i(ti,"screenshot["+n+"] timeout."),t._resolveScreenShotFromQueue(n)}),500),callback:i}),e.screenshot({id:n}),t._logger.i(ti,"screenshot["+n+"] kernel")}))):(this._logger.i(ti,"screenshot player not ready."),Promise.resolve())},e._resolveScreenShotFromQueue=function(t,e){for(var i=0;i<this._screenshotQueue.length;i++)if(t===this._screenshotQueue[i].id)return clearTimeout(this._screenshotQueue[i].timer),this._screenshotQueue[i].callback(e),void this._screenshotQueue.splice(i,1);this._logger.i(ti,"screenshot["+t+"] not found.")},e._updatePosterDom=function(){Ft?(this._video.poster=this._poster||"",this._hidePosterDom()):this._poster?(this._video.poster="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAC1JREFUWEft0EERAAAAAUH6lxbDZxU4s815PffjAAECBAgQIECAAAECBAgQIDAaPwAh6O5R/QAAAABJRU5ErkJggg==",this._posterLayer.className=te,this._posterLayer.style.backgroundImage="url("+this._poster+")"):(this._video.poster="",this._posterLayer.className="",this._posterLayer.style.backgroundImage="")},e._hidePosterDom=function(){this._posterLayer.style.display="none"},e._setIsUseCanvas=function(t){this._video&&(this._video.style.display=t?"none":"block")},e._setError=function(t){var e=this;this._error=t,this._error&&setTimeout((function(){try{e.emit(Qt.ERROR,e._error)}catch(t){}}),0)},e._resetPlayerStat=function(){if(this._canvas){try{this._videoLayer.removeChild(this._canvas)}catch(t){}this._canvas=void 0}this._setError(void 0),this._setIsUseCanvas(!1),this._mediaInfo=void 0,this._isLiveShift=!1},e._destroyKernel=function(){this._kernel&&(this._kernelLoaded=!1,this._livePaused=!1,this.pause(),this._kernel.destroy(),this._kernel=void 0)},e._destroyYoda=function(){this._yoda&&(this._yoda.destroy(),this._yoda=void 0)},e._initYodaKernel=function(e){if(this._logger.i(ti,"yoda init"),!t._yodaClass||!this._yodaDom||!this._src)return!1;var i=de.parse(this._src);return!(!i||!i.src)&&(this._yoda||(this._logger.i(ti,"yoda new instance."),this._yoda=new t._yodaClass(this._yodaDom,this._logger,e),this._bindYoda(this._yoda),this._kernelType="yoda"),this._logger.i(ti,"yoda instance already exists. try update conf"),i.isLive,this._yoda.src={isLive:i.isLive,src:i.src},this.emit(Qt.ATTRIBUTE_CHANGE_MUTED),!0)},e._bindYoda=function(t){var e=this;this._logger.i(ti,"yoda bind event."),t.on("play",this._onVideoPlay),t.on("playing",this._onVideoPlaying),t.on("pause",this._onVideoPause),t.on("loadedmetadata",(function(){e._onVideoLoadedmetadata(),e._onVideoDurationchange()})),t.on("timeupdate",this._onVideoTimeupdate),t.on("ended",this._onVideoEnded),t.on("waiting",this._onVideoWaiting),t.on("seeked",this._onVideoSeeked),t.on("seeking",this._onVideoSeeking),t.on("resize",(function(t){e._videoWidth=t.data.width,e._videoHeight=t.data.height,e._onVideoResize()})),t.on("error",(function(i){if("initFailed"===i.data.type||"canNotInsert"===i.data.type||"internal"===i.data.type||"domLost"===i.data.type){var n="play"===t.actionOnReady;return e._destroyYoda(),e._yodaEnabled=!1,e._initKernel(),void(n&&e.play())}e._setError(h()({code:0},i.data.originalError))}))},e._bindVideo=function(){if(this._video)for(var t in this._eventHandlers)this._video.addEventListener(t,this._eventHandlers[t])},e._unbindVideo=function(){if(this._video)for(var t in this._eventHandlers)this._video.removeEventListener(t,this._eventHandlers[t])},e._parseData=function(t){this._logger.i(ti,"parse data.",t),t.src&&(this._src=this._preprocessSrcFunc?this._preprocessSrcFunc(t.src):t.src),t.config&&(this._config=t.config),t.crossOrigin&&(this.crossOrigin=t.crossOrigin),typeof t.preload<"u"&&(this.preload=t.preload),"number"==typeof t.defaultPlaybackRate&&(this.defaultPlaybackRate=t.defaultPlaybackRate),"number"==typeof t.playbackRate&&(this.playbackRate=t.playbackRate),typeof t.autoplay<"u"&&(this.autoplay=t.autoplay),typeof t.loop<"u"&&(this.loop=t.loop),typeof t.controls<"u"&&(this.controls=t.controls),"number"==typeof t.volume&&(this.volume=t.volume),typeof t.muted<"u"&&(this.muted=t.muted),typeof t.defaultMuted<"u"&&(this.defaultMuted=t.defaultMuted),typeof t.disablePictureInPicture<"u"&&(this.disablePictureInPicture=t.disablePictureInPicture),typeof t.disableAdaptive<"u"&&(this.disableAdaptive=t.disableAdaptive),typeof t.playsinline<"u"&&(this.playsinline=t.playsinline),typeof t.liveShiftType<"u"&&(this.liveShiftType=t.liveShiftType),typeof t.logger<"u"&&(this._outputLogger=t.logger),this.poster=t.poster||""},e._initKernel=function(e){var i,n,r,a,o,s=this;if(void 0===e&&(e=!0),this._logger.i(ti,"init kernel"),this._video){if(this._posterLayer.style.display=Ft?"none":"block",this._destroyKernel(),!(this._src||null!=(i=this._config)&&i.src))return this._video.src="",void this._resetPlayerStat();this._config||(this._config={});var u=h()({},this._config,{adaptive:!1===(null==(n=this._data)?void 0:n.disableAdaptive),liveShiftType:null==(r=this._data)?void 0:r.liveShiftType,ntp:!1});if(se.verify(this._src)?(this._logger.i(ti,"live feed to media desc"),u.src=se.parse(this._src)):u.src=this._src,this._preprocessURL&&(u.preprocessUrl=this._preprocessURL),typeof u.nativeFirst>"u"&&Ft&&(u.nativeFirst=!0),this._isLiveShiftMode()&&(u.catchUpPausedLive=!1),null!=(a=this._data)&&a.logger&&(u.logger=this._data.logger),this._resetPlayerStat(),this._logger.i(ti,"yoda check mobile: "+Ft+" liveshift: "+this.liveShiftType+" class: "+!!t._yodaClass),Ft&&this._yodaEnabled&&this.liveShiftType===Wt.NONE&&t._yodaClass){var c={defaultMuted:this.defaultMuted,muted:this.muted,defaultPlaybackRate:this.defaultPlaybackRate,playbackRate:this.playbackRate,autoplay:this._autoplay,loop:this.loop,objectFit:this._objectFit||"contain",biz:null==(o=this._data)?void 0:o.bizData};if(this._initYodaKernel(c))return void(e&&this._clearKernelStartTimer())}else this._destroyYoda();this._kernelType="kwai-player-kernel",this._logger.i(ti,"init kernel",this._kernelType);var l=this._kernel=new Zt(this._video,u);l.on(qt.VIDEO_RENDERER_CHANGE,(function(t){var e=s._videoLayer;if("canvas"===t.type&&(s._setIsUseCanvas(!0),s._canvas=t.canvas,s._canvas&&e.insertAdjacentElement("afterbegin",s._canvas)),"video"===t.type){s._setIsUseCanvas(!1);try{s._canvas&&e.removeChild(s._canvas)}catch(t){}s._canvas=void 0}s._applyObjectFit(),s.emit(Qt.VIDEO_RENDERER_CHANGE,t)})),l.on(qt.MANIFEST_PARSED,(function(t){s._logger.i(ti,qt.MANIFEST_PARSED,t),s.emit(Qt.MANIFEST_PARSED,t)})),l.on(qt.LEVEL_SWITCHING,(function(t){s.emit(Qt.LEVEL_SWITCHING,t)})),l.on(qt.LEVEL_SWITCHED,(function(t){s.emit(Qt.LEVEL_SWITCHED,t)})),l.on(qt.LEVEL_SWITCH_PLAYING,(function(t){s.emit(Qt.LEVEL_SWITCH_PLAYING,t)})),l.on(qt.LEVEL_SWITCH_FAILED,(function(){s.emit(Qt.LEVEL_SWITCH_FAILED)})),l.on(qt.LEVEL_UPDATED,(function(t){s.emit(Qt.LEVEL_UPDATED,t)})),l.on(qt.AUDIO_TRACK_SWITCHING,(function(t){s.emit(Qt.AUDIO_TRACKS_SWITCHING,t)})),l.on(qt.AUDIO_TRACK_SWITCHED,(function(t){s.emit(Qt.AUDIO_TRACKS_SWITCHED,t)})),l.on(qt.ERROR,(function(t){s._setError({code:t.code,message:t.reason})})),l.on(qt.REPORT,(function(t){"mediaInfo"===t.type&&(s._videoWidth=t.value.width||0,s._videoHeight=t.value.height||0,s._mediaInfo=t.value,s._data&&t.value.liveShiftType&&(s.liveShiftType=t.value.liveShiftType)),s.emit(Qt.REPORT,t)})),l.on(qt.SCREENSHOT,(function(t){s._logger.i(ti,"screenshot["+t.id+"] kernel evt. id: "+t.id+"  img: "+!!t.image),t.id&&s._resolveScreenShotFromQueue(t.id,t.image)})),e&&(this._clearKernelStartTimer(),this._kernelStart())}},e._clearKernelStartTimer=function(){this._kernelStartTimeout&&(clearTimeout(this._kernelStartTimeout),this._kernelStartTimeout=0)},e._kernelStart=function(){var t=this;if(this._kernel&&this._video&&(this._autoplay||""===this._preload||"auto"===this._preload||"metadata"===this._preload)&&(this._kernel.load(),this._kernelLoaded=!0,this.autoplay)){var e=this._video.play();e instanceof Promise&&e.catch((function(){var e;t._logger.i(ti,"autoplay fail, retry."),t._onMutedChange(!0),null==(e=t._video)||e.play().catch((function(){}))}))}},e._updateIsLiveShift=function(t){t!==this._isLiveShift&&(this._isLiveShift=t,this.emit(Qt.LIVE_SHIFT_CHANGE))},e._isLiveShiftMode=function(){var t;return!(null==(t=this._data)||!t.liveShiftType)&&this._data.liveShiftType!==Wt.NONE},e.on=function(t,e){this._evt.on(t,e)},e.once=function(t,e){this._evt.once(t,e)},e.removeAllListeners=function(t){this._logger.i(ti,"call removeAllListeners"),this._evt.removeAllListeners(t)},e.off=function(t,e){this._evt.off(t,e)},e.listeners=function(t){return this._evt.listeners(t)},e.emit=function(t,e){return this._evt.emit(t,e)},e.listenerCount=function(t){return this._evt.listenerCount(t)},_()(t,[{key:"version",get:function(){return t.version}},{key:"packVersion",get:function(){return t.packVersion}},{key:"instanceId",get:function(){return this._instanceId}},{key:"kernelType",get:function(){return this._kernelType}},{key:"logger",get:function(){return this._logger}},{key:"outputLogger",get:function(){return this._outputLogger},set:function(t){this._logger.i(ti,"call set output logger",t),this._outputLogger=t,this._logger.setOutput(t),this._kernel&&(this._kernel.outputLog=t)}},{key:"config",get:function(){return this._logger.i(ti,"call get config",this._config),this._config},set:function(t){this._logger.i(ti,"call set config",t),this._config=t,this._yoda||(this._initKernel(),this.emit(Qt.ATTRIBUTE_CHANGE_CONFIG))}},{key:"error",get:function(){return this._logger.i(ti,"call get error",this._error),this._error}},{key:"videoId",get:function(){var t;return null==(t=this._data)?void 0:t.videoId},set:function(t){this._data&&(this._data.videoId=t,this.emit(Qt.ATTRIBUTE_CHANGE_VIDEO_ID))}},{key:"previewUrl",get:function(){var t;return null==(t=this._data)?void 0:t.previewUrl},set:function(t){this._logger.i(ti,"call set previewUrl",t),this._data&&(this._data.previewUrl=t,this.emit(Qt.ATTRIBUTE_CHANGE_PREVIEW_URL))}},{key:"maskUrl",get:function(){var t;return null==(t=this._data)?void 0:t.maskUrl},set:function(t){this._logger.i(ti,"call set maskUrl",t),this._data&&(this._data.maskUrl=t,this.emit(Qt.ATTRIBUTE_CHANGE_MASK_URL))}},{key:"disableMask",get:function(){var t;return null==(t=this._data)?void 0:t.disableMask},set:function(t){this._logger.i(ti,"call set disableMask",t),this._data&&(this._data.disableMask=t,this.emit(Qt.ATTRIBUTE_CHANGE_DISABLE_MASK))}},{key:"src",get:function(){return this._logger.v(ti,"call get src",this._src),this._src},set:function(t){this._logger.i(ti,"call set src",t),this._src=this._preprocessSrcFunc?this._preprocessSrcFunc(t):t,this._destroyKernel(),this.emit(Qt.ATTRIBUTE_CHANGE_SRC),this._initKernel()}},{key:"isLiveShift",get:function(){return this._isLiveShift}},{key:"liveShiftType",get:function(){var t;return(null==(t=this._data)?void 0:t.liveShiftType)||Wt.NONE},set:function(t){this._logger.i(ti,"call set liveShiftType",t),this._data&&(this._data.liveShiftType=t,this.emit(Qt.LIVE_SHIFT_TYPE_CHANGE))}},{key:"crossOrigin",get:function(){var t;return this._logger.v(ti,"call get crossOrigin",null==(t=this._video)?void 0:t.crossOrigin),this._video?this._video.crossOrigin:null},set:function(t){this._logger.i(ti,"call set crossOrigin",t),this._video&&(this._video.crossOrigin=t),this.emit(Qt.ATTRIBUTE_CHANGE_CROSS_ORIGIN)}},{key:"networkState",get:function(){var t;return this._logger.v(ti,"call get networkState",null==(t=this._video)?void 0:t.networkState),this._video?this._video.networkState:0}},{key:"preload",get:function(){return this._logger.v(ti,"call get preload",this._preload),this._preload},set:function(t){this._logger.i(ti,"call set preload",t),this._preload=t,this._video.preload=t,this.emit(Qt.ATTRIBUTE_CHANGE_PRELOAD)}},{key:"buffered",get:function(){var t;if(!this._yoda)return null==(t=this._video)?void 0:t.buffered}},{key:"readyState",get:function(){return this._yoda?this._yoda.readyState:this._video?this._video.readyState:0}},{key:"seeking",get:function(){var t;return this._yoda?this._yoda.seeking:!(null==(t=this._video)||!t.seeking)}},{key:"currentTime",get:function(){return this._yoda?this._yoda.currentTime:this._video?this._video.currentTime:0},set:function(t){this._logger.i(ti,"call set currentTime",t);try{this._yoda&&(this._yoda.currentTime=t),this._video&&(this._video.currentTime=t),this.emit(Qt.ATTRIBUTE_CHANGE_CURRENT_TIME)}catch(t){}}},{key:"duration",get:function(){return this._yoda?this._yoda.duration:this._video?this._video.duration:NaN}},{key:"paused",get:function(){return this._yoda?this._yoda.paused:!this._video||this._video.paused}},{key:"defaultPlaybackRate",get:function(){var t;return this._logger.v(ti,"call get defaultPlaybackRate",null==(t=this._video)?void 0:t.defaultPlaybackRate),this._video?this._video.defaultPlaybackRate:1},set:function(t){this._logger.i(ti,"call set defaultPlaybackRate",t),this._yoda&&(this._yoda.defaultPlaybackRate=t),this._video&&(this._video.defaultPlaybackRate=t),this.emit(Qt.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE)}},{key:"playbackRate",get:function(){return this._video?this._video.playbackRate:1},set:function(t){this._logger.i(ti,"call set playbackRate",t),this._yoda&&(this._yoda.playbackRate=t),this._video&&(this._video.playbackRate=t),this.emit(Qt.ATTRIBUTE_CHANGE_PLAYBACK_RATE)}},{key:"played",get:function(){var t;if(!this._yoda)return null==(t=this._video)?void 0:t.played}},{key:"seekable",get:function(){var t;if(!this._yoda)return null==(t=this._video)?void 0:t.seekable}},{key:"ended",get:function(){return this._yoda?this._yoda.ended:!!this._video&&this._video.ended}},{key:"autoplay",get:function(){return this._autoplay},set:function(t){this._logger.i(ti,"call set autoplay",t),this._autoplay=t,this._yoda&&(this._yoda.autoplay=t),this.emit(Qt.ATTRIBUTE_CHANGE_AUTOPLAY)}},{key:"loop",get:function(){return this._yoda?this._yoda.loop:!!this._video&&this._video.loop},set:function(t){this._logger.i(ti,"call set loop",t),this._video&&(this._video.loop=t),this.emit(Qt.ATTRIBUTE_CHANGE_LOOP)}},{key:"controls",get:function(){return this._controls},set:function(t){this._logger.i(ti,"call set controls",t),t!==this._controls&&(this._controls=t),this.emit(Qt.ATTRIBUTE_CHANGE_CONTROLS)}},{key:"volume",get:function(){return this._yoda?1:this._video?this._video.volume:1},set:function(t){this._video&&(this._video.volume=t<0?0:t>1?1:t,this.emit(Qt.ATTRIBUTE_CHANGE_VOLUME))}},{key:"muted",get:function(){return this._yoda?this._yoda.muted:!!this._video&&this._video.muted},set:function(t){this._logger.i(ti,"call set muted: "+t+", hasVideo: "+!!this._video),this._yoda&&(this._yoda.muted=t),this._video&&(this._video.muted=t),this.emit(Qt.ATTRIBUTE_CHANGE_MUTED)}},{key:"defaultMuted",get:function(){return this._yoda?this._yoda.defaultMuted:!!this._video&&this._video.defaultMuted},set:function(t){this._logger.i(ti,"call set defaultMuted",t),this._yoda&&(this._yoda.defaultMuted=t),this._video&&(this._video.defaultMuted=t),this.emit(Qt.ATTRIBUTE_CHANGE_DEFAULT_MUTED)}},{key:"videoWidth",get:function(){var t;return this._videoWidth||(null==(t=this._video)?void 0:t.videoWidth)}},{key:"videoHeight",get:function(){var t;return this._videoHeight||(null==(t=this._video)?void 0:t.videoHeight)}},{key:"poster",get:function(){return this._poster},set:function(t){this._logger.i(ti,"call set poster",t),this._poster=t,this._updatePosterDom(),this.emit(Qt.ATTRIBUTE_CHANGE_POSTER)}},{key:"disablePictureInPicture",get:function(){var t;return!!this._yoda||!(null==(t=this._video)||!t.disablePictureInPicture)},set:function(t){this._logger.i(ti,"call set disablePictureInPicture",t),!this._yoda&&this._video&&(this._video.disablePictureInPicture=t,this.emit(Qt.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE))}},{key:"disableDownload",get:function(){var t;return null==(t=this._data)?void 0:t.disableDownload},set:function(t){this._logger.i(ti,"call set disableDownload",t),this._data&&(this._data.disableDownload=t,this.emit(Qt.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD))}},{key:"playsinline",get:function(){var t;return!(null==(t=this._video)||!t.hasAttribute("playsinline"))},set:function(t){this._logger.i(ti,"call set playsinline",t),this._video&&(this._video.playsInline=t,this._video.webKitPlaysInline=t,t?(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(Qt.ATTRIBUTE_CHANGE_PLAYSINLINE))}},{key:"disableAdaptive",get:function(){var t;return null==(t=this._data)?void 0:t.disableAdaptive},set:function(t){this._logger.i(ti,"call set disableAdaptive",t),this._data&&(this._data.disableAdaptive=t,this.emit(Qt.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE))}},{key:"currentLevel",get:function(){var t;return(null==(t=this._kernel)?void 0:t.currentLevel)||0},set:function(t){var e,i,n,r=this;if(this._logger.i(ti,"call set currentLevel",t,!!this._kernel,this._livePaused),this._kernel){var a=this._video.paused;this._livePaused?(null==(e=this._kernel)||e.refresh(),this._kernel.currentLevel=t):(this._kernel.currentLevel=t,this.emit(Qt.ATTRIBUTE_CHANGE_CURRENT_LEVEL)),!a&&this._video.paused&&(this._logger.i(ti,"set level. play"),null==(n=null==(i=this._video)?void 0:i.play())||n.catch((function(t){return r._logger.i(ti,"set current level, call play() fail.",t)})))}}},{key:"nextLevel",get:function(){var t;return(null==(t=this._kernel)?void 0:t.nextLevel)||0},set:function(t){var e,i,n,r=this;if(this._logger.i(ti,"call set nextLevel",t),this._kernel){var a=this._video.paused;this._livePaused?(null==(e=this._kernel)||e.refresh(),this._kernel.currentLevel=t):(this._kernel.nextLevel=t,this.emit(Qt.ATTRIBUTE_CHANGE_NEXT_LEVEL)),!a&&this._video.paused&&(this._logger.i(ti,"set next level. play"),null==(n=null==(i=this._video)?void 0:i.play())||n.catch((function(t){return r._logger.i(ti,"set next level, call play() fail.",t)})))}}},{key:"currentVideoFrame",get:function(){var t;return(null==(t=this._kernel)?void 0:t.currentVideoFrame)||0},set:function(t){this._kernel&&(this._kernel.currentVideoFrame=t,this.emit(Qt.ATTRIBUTE_CHANGE_CURRENT_FRAME))}},{key:"totalVideoFrames",get:function(){var t;return(null==(t=this._kernel)?void 0:t.totalVideoFrames)||0}},{key:"currentLevelTimeInfo",get:function(){var t;return null==(t=this._kernel)?void 0:t.currentLevelTimeInfo}},{key:"video",get:function(){return this._video}},{key:"canvas",get:function(){return this._canvas}},{key:"yodaDom",get:function(){return this._yodaDom}},{key:"audioTrack",get:function(){return this._kernel?this._kernel.audioTrack:-1},set:function(t){this._logger.i(ti,"call set audioTrack",t),this._kernel&&(this._kernel.audioTrack=t,this.emit(Qt.ATTRIBUTE_CHANGE_AUDIO_TRACK))}},{key:"productName",get:function(){var t;return null==(t=this._data)?void 0:t.productName},set:function(t){this._logger.i(ti,"call set productName",t),this._data&&(this._data.productName=t)}},{key:"prefetch",get:function(){var t;return null==(t=this._data)?void 0:t.prefetch},set:function(t){this._logger.i(ti,"call set prefetch",t),this._data&&(this._data.prefetch=t,this.emit(Qt.ATTRIBUTE_CHANGE_PREFETCH))}},{key:"showProgress",get:function(){var t;return null==(t=this._data)?void 0:t.showProgress},set:function(t){this._logger.i(ti,"call set showProgress",t),this._data&&(this._data.showProgress=t,this.emit(Qt.ATTRIBUTE_CHANGE_SHOW_PROGRESS))}},{key:"showTime",get:function(){var t;return null==(t=this._data)?void 0:t.showTime},set:function(t){this._logger.i(ti,"call set showTime",t),this._data&&(this._data.showTime=t,this.emit(Qt.ATTRIBUTE_CHANGE_SHOW_TIME))}},{key:"disableHotkey",get:function(){var t;return null==(t=this._data)?void 0:t.disableHotkey},set:function(t){this._logger.i(ti,"call set disableHotkey",t),this._data&&(this._data.disableHotkey=t,this.emit(Qt.ATTRIBUTE_CHANGE_DISABLE_HOTKEY))}},{key:"disableDanmaku",get:function(){var t;return null==(t=this._data)?void 0:t.disableDanmaku},set:function(t){this._logger.i(ti,"call set disableDanmaku",t),this._data&&(this._data.disableDanmaku=t,this.emit(Qt.ATTRIBUTE_CHANGE_DISABLE_DANMAKU))}},{key:"danmakuRendering",get:function(){var t;return null==(t=this._data)?void 0:t.danmakuRendering},set:function(t){this._logger.i(ti,"call set danmakuRendering",t),this._data&&(this._data.danmakuRendering=t,this.emit(Qt.ATTRIBUTE_CHANGE_DANMAKU_RENDERING))}},{key:"showInfoPanel",get:function(){var t;return null==(t=this._data)?void 0:t.showInfoPanel},set:function(t){this._logger.i(ti,"call set showInfoPanel",t),this._data&&(this._data.showInfoPanel=t,this.emit(Qt.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL))}},{key:"showNext",get:function(){var t;return null==(t=this._data)?void 0:t.showNext},set:function(t){this._logger.i(ti,"call set showNext",t),this._data&&(this._data.showNext=t,this.emit(Qt.ATTRIBUTE_CHANGE_SHOW_NEXT))}},{key:"showPrev",get:function(){var t;return null==(t=this._data)?void 0:t.showPrev},set:function(t){this._logger.i(ti,"call set showPrev",t),this._data&&(this._data.showPrev=t,this.emit(Qt.ATTRIBUTE_CHANGE_SHOW_PREV))}},{key:"bizData",get:function(){var t;return null==(t=this._data)?void 0:t.bizData},set:function(t){this._logger.i(ti,"set biz data",t),this._data&&(this._data.bizData=t),this._yoda&&this._yoda.updateUserConfig({biz:JSON.parse(JSON.stringify(t))}),this.emit(Qt.ATTRIBUTE_CHANGE_BIZ_DATA)}},{key:"liveTime",get:function(){var t;return null!=(t=this._data)&&t.liveTime?{start:this._data.liveTime.start,end:this._data.liveTime.end}:void 0},set:function(t){this._logger.i(ti,"set live time",t),this._data&&(this._data.liveTime=h()({},t)),this.emit(Qt.ATTRIBUTE_CHANGE_LIVE_TIME)}},{key:"objectFit",get:function(){return this._objectFit}},{key:"kernel",get:function(){return this._kernel}},{key:"mainContainer",get:function(){return this._mainDom}},{key:"videoLayer",get:function(){return this._videoLayer}},{key:"videoInteractiveLayer",get:function(){return this._videoInteractiveLayer}},{key:"audienceStat",get:function(){var t;return null==(t=this._kernel)?void 0:t.getAudienceStat()}}],[{key:"version",get:function(){return"1.1.0"}}])}();zt(ei,"packVersion","1.1.0"),zt(ei,"_yodaClass");var ii=ei,ni="vue2",ri=[Qt.LOADSTART,Qt.PROGRESS,Qt.SUSPEND,Qt.ABORT,Qt.ERROR,Qt.EMPTIED,Qt.STALLED,Qt.LOADEDMETADATA,Qt.LOADEDDATA,Qt.CANPLAY,Qt.CANPLAYTHROUGH,Qt.PLAYING,Qt.WAITING,Qt.SEEKING,Qt.SEEKED,Qt.ENDED,Qt.DURATIONCHANGE,Qt.TIMEUPDATE,Qt.PLAY,Qt.PAUSE,Qt.RATECHANGE,Qt.RESIZE,Qt.VOLUMECHANGE,Qt.MANIFEST_PARSED,Qt.LEVEL_SWITCHING,Qt.LEVEL_SWITCHED,Qt.LEVEL_SWITCH_PLAYING,Qt.LEVEL_SWITCH_FAILED,Qt.AUDIO_TRACKS_SWITCHING,Qt.AUDIO_TRACKS_SWITCHED,Qt.FULLSCREEN_CHANGE,Qt.LEVEL_UPDATED,Qt.CLICK_NEXT,Qt.CLICK_REGISTER,Qt.CLICK_LOGIN,Qt.CLICK_VIP,Qt.INTERACTION,Qt.ATTRIBUTE_CHANGE,Qt.REPORT],ai={name:"KwaiPlayerVue2",props:{id:{type:String,default:""},config:{type:Object,default:function(){return{}}},plugins:{type:Object,default:function(){return{}}},src:{type:[Object,String],default:""},controls:{type:[Boolean,String],default:!0},videoId:{type:[String],default:""},autoplay:{type:[Boolean],default:!1},crossOrigin:{type:[String,null],default:null},defaultMuted:{type:[Boolean],default:!1},defaultPlaybackRate:{type:[Number],default:1},loop:{type:[Boolean],default:!1},muted:{type:[Boolean],default:!1},preload:{type:[String,void 0],default:void 0},poster:{type:[String],default:""},currentTime:{type:[Number]},playbackRate:{type:[Number],default:1},volume:{type:[Number],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:{type:[Number],default:0},nextLevel:{type:[Number],default:0},audioTrack:{type:[Number],default:0},currentVideoFrame:{type:[Number],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:{type:[String],default:""},previewUrl:{type:[String],default:""},maskUrl:{type:[String],default:""},disableDanmaku:{type:[Boolean]},danmakuRendering:{type:[Boolean],default:!0},bizData:{type:[Object]},liveShiftType:{type:[String]}},data:function(){return{player:void 0,cid:0}},watch:{config:function(t){this.player&&(this.player.logger.i(ni,"call set config",t),this.player.config=t)},controls:function(t){this.player&&(this.player.logger.i(ni,"call set controls",t),this.player.controls=t)},videoId:function(t){this.player&&(this.player.logger.i(ni,"call set videoId",t),this.player.videoId=t)},src:function(t){this.player&&(this.player.logger.i(ni,"call set src",t),this.player.src=t)},autoplay:function(t){this.player&&(this.player.logger.i(ni,"call set autoplay",t),this.player.autoplay=t)},crossOrigin:function(t){this.player&&(this.player.logger.i(ni,"call set crossOrigin",t),this.player.crossOrigin=t)},defaultMuted:function(t){this.player&&(this.player.logger.i(ni,"call set defaultMuted",t),this.player.defaultMuted=t)},defaultPlaybackRate:function(t){this.player&&(this.player.logger.i(ni,"call set defaultPlaybackRate",t),this.player.defaultPlaybackRate=t)},loop:function(t){this.player&&(this.player.logger.i(ni,"call set loop",t),this.player.loop=t)},muted:function(t){this.player&&(this.player.logger.i(ni,"call set muted",t),this.player.muted=t)},preload:function(t){this.player&&(this.player.logger.i(ni,"call set preload",t),this.player.preload=t||"none")},poster:function(t){this.player&&(this.player.logger.i(ni,"call set poster",t),this.player.poster=t||"")},currentTime:function(t){this.player&&(this.player.logger.i(ni,"call set currentTime",t),this.player.currentTime=t)},playbackRate:function(t){this.player&&(this.player.logger.i(ni,"call set playbackRate",t),this.player.playbackRate=t)},volume:function(t){this.player&&(this.player.logger.i(ni,"call set volume",t),this.player.volume=t)},disablePictureInPicture:function(t){this.player&&(this.player.logger.i(ni,"call set disablePictureInPicture",t),this.player.disablePictureInPicture=t)},playsinline:function(t){this.player&&(this.player.logger.i(ni,"call set playsinline",t),this.player.playsinline=t)},disableDownload:function(t){this.player&&(this.player.logger.i(ni,"call set disableDownload",t),this.player.disableDownload=t)},disableAdaptive:function(t){this.player&&(this.player.logger.i(ni,"call set disableAdaptive",t),this.player.disableAdaptive=t)},disableHotkey:function(t){this.player&&(this.player.logger.i(ni,"call set disableHotkey",t),this.player.disableHotkey=t)},disableMask:function(t){this.player&&(this.player.logger.i(ni,"call set disableMask",t),this.player.disableMask=t)},currentLevel:function(t){this.player&&(this.player.logger.i(ni,"call set currentLevel",t),this.player.currentLevel=t)},nextLevel:function(t){this.player&&(this.player.logger.i(ni,"call set nextLevel",t),this.player.nextLevel=t)},audioTrack:function(t){this.player&&(this.player.logger.i(ni,"call set audioTrack",t),this.player.audioTrack=t)},currentVideoFrame:function(t){this.player&&(this.player.logger.i(ni,"call set currentVideoFrame",t),this.player.currentVideoFrame=t)},showProgress:function(t){this.player&&(this.player.logger.i(ni,"call set showProgress",t),this.player.showProgress=t)},showTime:function(t){this.player&&(this.player.logger.i(ni,"call set showTime",t),this.player.showTime=t)},prefetch:function(t){this.player&&(this.player.logger.i(ni,"call set prefetch",t),this.player.prefetch=t)},showInfoPanel:function(t){this.player&&(this.player.logger.i(ni,"call set showInfoPanel",t),this.player.showInfoPanel=t)},previewUrl:function(t){this.player&&(this.player.logger.i(ni,"call set previewUrl",t),this.player.previewUrl=t)},maskUrl:function(t){this.player&&(this.player.logger.i(ni,"call set maskUrl",t),this.player.maskUrl=t)},disableDanmaku:function(t){this.player&&(this.player.logger.i(ni,"call set disableDanmaku",t),this.player.disableDanmaku=t)},danmakuRendering:function(t){this.player&&(this.player.logger.i(ni,"call set danmakuRendering",t),this.player.danmakuRendering=t)},bizData:function(t){this.player&&(this.player.bizData=t)},liveShiftType:function(t){this.player&&(this.player.liveShiftType=t)}},methods:{load:function(){var t;null==(t=this.player)||t.load()},play:function(){var t;return null==(t=this.player)?void 0:t.play()},pause:function(){var t;null==(t=this.player)||t.pause()},destroy:function(){var t;null==(t=this.player)||t.destroy()},requestPictureInPicture:function(){var t;return null==(t=this.player)?void 0:t.requestPictureInPicture()},isFullscreen:function(t){var e;return null==(e=this.player)?void 0:e.isFullscreen(t)},requestFullscreen:function(t){var e;null==(e=this.player)||e.requestFullscreen(t)},exitFullscreen:function(t){var e;null==(e=this.player)||e.exitFullscreen(t)},isFullscreenAvailable:function(t){var e;return null==(e=this.player)?void 0:e.isFullscreenAvailable(t)},screenshot:function(){var t;return null==(t=this.player)?void 0:t.screenshot()},getError:function(){var t;return null==(t=this.player)?void 0:t.error},getNetworkState:function(){var t;return(null==(t=this.player)?void 0:t.networkState)||0},getBuffered:function(){var t;return null==(t=this.player)?void 0:t.buffered},getReadyState:function(){var t;return(null==(t=this.player)?void 0:t.readyState)||0},getSeeking:function(){var t;return(null==(t=this.player)?void 0:t.seeking)||!1},getDuration:function(){var t;return(null==(t=this.player)?void 0:t.duration)||0},getPaused:function(){var t;return(null==(t=this.player)?void 0:t.paused)||!1},getSeekable:function(){var t;return null==(t=this.player)?void 0:t.seekable},getEnded:function(){var t;return(null==(t=this.player)?void 0:t.ended)||!1},getVideoWidth:function(){var t;return null==(t=this.player)?void 0:t.videoWidth},getVideoHeight:function(){var t;return null==(t=this.player)?void 0:t.videoHeight},getTotalVideoFrames:function(){var t;return(null==(t=this.player)?void 0:t.totalVideoFrames)||0},setSrc:function(t){this.player&&(this.player.src=t)},getSrc:function(){var t;return null==(t=this.player)?void 0:t.src},setConfig:function(t){this.player&&(this.player.config=t)},getConfig:function(){var t;return null==(t=this.player)?void 0:t.config},setCrossOrigin:function(t){this.player&&(this.player.crossOrigin=t)},getCrossOrigin:function(){var t;return(null==(t=this.player)?void 0:t.crossOrigin)||null},setPreload:function(t){this.player&&(this.preload=t)},getPreload:function(){var t;return(null==(t=this.player)?void 0:t.preload)||""},setCurrentTime:function(t){this.player&&(this.player.currentTime=t)},getCurrentTime:function(){var t;return(null==(t=this.player)?void 0:t.currentTime)||0},setDefaultPlaybackRate:function(t){this.player&&(this.player.defaultPlaybackRate=t)},getDefaultPlaybackRate:function(){var t;return null==(t=this.player)?void 0:t.defaultPlaybackRate},setPlaybackRate:function(t){this.player&&(this.player.playbackRate=t)},getPlaybackRate:function(){var t;return(null==(t=this.player)?void 0:t.playbackRate)||1},setAutoplay:function(t){this.player&&(this.player.autoplay=t)},getAutoplay:function(){var t;return(null==(t=this.player)?void 0:t.autoplay)||!1},setLoop:function(t){this.player&&(this.player.loop=t)},getLoop:function(){var t;return(null==(t=this.player)?void 0:t.loop)||!1},setControls:function(t){this.player&&(this.player.controls=t)},getControls:function(){var t;return(null==(t=this.player)?void 0:t.controls)||!1},setVideoId:function(t){this.player&&(this.player.videoId=t)},getVideoId:function(){var t;return(null==(t=this.player)?void 0:t.videoId)||!1},setVolume:function(t){this.player&&(this.player.volume=t)},getVolume:function(){var t;return(null==(t=this.player)?void 0:t.volume)||0},setMuted:function(t){this.player&&(this.player.muted=t)},getMuted:function(){var t;return(null==(t=this.player)?void 0:t.muted)||!1},setDefaultMuted:function(t){player&&(this.player.defaultMuted=t)},getDefaultMuted:function(){var t;return(null==(t=this.player)?void 0:t.defaultMuted)||!1},setPoster:function(t){this.player&&(this.player.poster=t)},getPoster:function(){var t;return(null==(t=this.player)?void 0:t.poster)||""},setDisablePictureInPicture:function(t){player&&(this.player.disablePictureInPicture=t)},getDisablePictureInPicture:function(){var t;return(null==(t=this.player)?void 0:t.disablePictureInPicture)||!1},setPlaysinline:function(t){this.player&&(this.player.playsinline=t)},getPlaysinline:function(){var t;return(null==(t=this.player)?void 0:t.playsinline)||!1},setDisableDownload:function(t){this.player&&(this.player.disableDownload=t)},getDisableDownload:function(){var t;return null==(t=this.player)?void 0:t.disableDownload},setDisableAdaptive:function(t){this.player&&(this.player.disableAdaptive=t)},getDisableAdaptive:function(){var t;return null==(t=this.player)?void 0:t.disableAdaptive},setDisableHotkey:function(t){this.player&&(this.player.disableHotkey=t)},getDisableHotkey:function(){var t;return null==(t=this.player)?void 0:t.disableHotkey},setDisableMask:function(t){this.player&&(this.player.disableMask=t)},getDisableMask:function(){var t;return null==(t=this.player)?void 0:t.disableMask},setCurrentLevel:function(t){this.player&&(this.player.currentLevel=t)},getCurrentLevel:function(){var t;return(null==(t=this.player)?void 0:t.currentLevel)||0},setNextLevel:function(t){this.player&&(this.player.nextLevel=t)},getNextLevel:function(){var t;return(null==(t=this.player)?void 0:t.nextLevel)||0},setAudioTrack:function(t){this.player&&(this.player.audioTrack=t)},getAudioTrack:function(){var t;return(null==(t=this.player)?void 0:t.audioTrack)||0},setCurrentVideoFrame:function(t){this.player&&(this.player.currentVideoFrame=t)},getCurrentVideoFrame:function(){var t;return(null==(t=this.player)?void 0:t.currentVideoFrame)||0},setShowProgress:function(t){this.player&&(this.player.showProgress=t)},getShowProgress:function(){var t;return null==(t=this.player)?void 0:t.showProgress},setShowTime:function(t){this.player&&(this.player.showTime=t)},getShowTime:function(){var t;return null==(t=this.player)?void 0:t.showTime},setPrefetch:function(t){this.player&&(this.player.prefetch=t)},getPrefetch:function(){var t;return null==(t=this.player)?void 0:t.prefetch},setShowInfoPanel:function(t){this.player&&(this.player.showInfoPanel=t)},getShowInfoPanel:function(){var t;return null==(t=this.player)?void 0:t.showInfoPanel},setProductName:function(t){this.player&&(this.player.productName=t)},getProductName:function(){var t;return null==(t=this.player)?void 0:t.productName},setPreviewUrl:function(t){this.player&&(this.player.previewUrl=t)},getPreviewUrl:function(){var t;return null==(t=this.player)?void 0:t.previewUrl},setMaskUrl:function(t){this.player&&(this.player.maskUrl=t)},getMaskUrl:function(){var t;return null==(t=this.player)?void 0:t.maskUrl},setDisableDanmaku:function(t){this.player&&(this.player.disableDanmaku=t)},getDisableDanmaku:function(){var t;return null==(t=this.player)?void 0:t.disableDanmaku},setDanmakuRendering:function(t){this.player&&(this.player.danmakuRendering=t)},getDanmakuRendering:function(){var t;return null==(t=this.player)?void 0:t.danmakuRendering},getAudienceStat:function(){var t;return null==(t=this.player)?void 0:t.audienceStat},getStreamTime:function(t){var e;return(null==(e=this.player)?void 0:e.getStreamTime(t))||0},getIsLiveShift:function(){var t;return(null==(t=this.player)?void 0:t.isLiveShift)||!1},getLiveShiftType:function(){var t;return(null==(t=this.player)?void 0:t.liveShiftType)||Wt.NONE},setLiveShiftType:function(t){this.player&&(this.player.liveShiftType=t)},getVersion:function(){return ii.version},getPluginInstance:function(t){var e;return null==(e=this.player)?void 0:e.getPluginInstance(t)},getAllPlugins:function(){var t;return null==(t=this.player)?void 0:t.getAllPlugins()}},created:function(){this.cid=this.id||"c-"+(Pt=Pt?Pt+1:Date.now())},mounted:function(){var t=this,e=this.player=new ii("#"+this.cid,{config:this.config,src:this.src,crossOrigin:this.crossOrigin,preload:this.preload,defaultPlaybackRate:this.defaultPlaybackRate,playbackRate:this.playbackRate,autoplay:this.autoplay,loop:this.loop,controls:this.controls,videoId:this.videoId,volume:this.volume,muted:this.muted,defaultMuted:this.defaultMuted,poster:this.poster,disablePictureInPicture:this.disablePictureInPicture,disableDownload:this.disableDownload,disableAdaptive:this.disableAdaptive,disableHotkey:this.disableHotkey,disableMask:this.disableMask,playsinline:this.playsinline,showProgress:this.showProgress,showTime:this.showTime,prefetch:this.prefetch,showInfoPanel:this.showInfoPanel,productName:this.productName,previewUrl:this.previewUrl,maskUrl:this.maskUrl,disableDanmaku:this.disableDanmaku,danmakuRendering:this.danmakuRendering,plugins:this.plugins,bizData:this.bizData,liveShiftType:this.liveShiftType});e.logger.i(ni,"mounted"),ri.forEach((function(i){e.on(i,(function(e){t.$emit(i,e)}))}))},beforeUnmount:function(){this.player.destroy()}};function oi(t,e,i,n,r,a,o,s){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),o?(u=function(t){!(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)&&typeof __VUE_SSR_CONTEXT__<"u"&&(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=u):r&&(u=s?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,u):[u]}return{exports:t,options:c}}var si={},ui=oi(ai,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{attrs:{id:t.cid}},[t._t("watermark")],2)}),[],!1,ci,null,null,null);function ci(t){for(var e in si)this[e]=si[e]}var li=function(){return ui.exports}(),hi=Object.defineProperty,di=function(t,e,i){return function(t,e,i){e in t?hi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},fi=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=8)}([function(t,e,i){var n=i(5);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(7)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,i.apply(this,arguments)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function i(t,e,i,n,r,a,o){try{var s=t[a](o),u=s.value}catch(t){return void i(t)}s.done?e(u):Promise.resolve(u).then(n,r)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function s(t){i(o,r,a,s,u,"next",t)}function u(t){i(o,r,a,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(1).default,r=i(6);t.exports=function(t){var e=r(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(1).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(1).default;function r(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=r=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var e,i={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function d(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,i){return t[e]=i}}function f(t,e,i,n){var r=e&&e.prototype instanceof m?e:m,a=Object.create(r.prototype),o=new N(n||[]);return s(a,"_invoke",{value:L(t,i,o)}),a}function p(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}i.wrap=f;var _="suspendedStart",v="executing",A="completed",g={};function m(){}function b(){}function y(){}var E={};d(E,c,(function(){return this}));var C=Object.getPrototypeOf,T=C&&C(C(k([])));T&&T!==a&&o.call(T,c)&&(E=T);var I=y.prototype=m.prototype=Object.create(E);function R(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var i;s(this,"_invoke",{value:function(r,a){function s(){return new e((function(i,s){!function i(r,a,s,u){var c=p(t[r],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return i("throw",t,s,u)}))}u(c.arg)}(r,a,i,s)}))}return i=i?i.then(s,s):s()}})}function L(t,i,n){var r=_;return function(a,o){if(r===v)throw Error("Generator is already running");if(r===A){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===_)throw r=A,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var c=p(t,i,n);if("normal"===c.type){if(r=n.done?A:"suspendedYield",c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=A,n.method="throw",n.arg=c.arg)}}}function D(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,D(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(r,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,g;var o=a.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,g):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t||""===t){var i=t[c];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function i(){for(;++r<t.length;)if(o.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return b.prototype=y,s(I,"constructor",{value:y,configurable:!0}),s(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,h,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,d(t,h,"GeneratorFunction")),t.prototype=Object.create(I),t},i.awrap=function(t){return{__await:t}},R(w.prototype),d(w.prototype,l,(function(){return this})),i.AsyncIterator=w,i.async=function(t,e,n,r,a){void 0===a&&(a=Promise);var o=new w(f(t,e,n,r),a);return i.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},R(I),d(I,h,"Generator"),d(I,c,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},i.values=k,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var i in this)"t"===i.charAt(0)&&o.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(n,r){return s.type="throw",s.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),O(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;O(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:k(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),g}},i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){i.r(e),i.d(e,"KwaiVideoLocalLog",(function(){return L})),i.d(e,"LogLevel",(function(){return f})),i.d(e,"DefaultLogger",(function(){return A})),i.d(e,"Logger",(function(){return v})),i.d(e,"printVersion",(function(){return u})),i.d(e,"DEFAULT_LOG_LEVEL",(function(){return p}));var n=i(0),r=i.n(n),a=i(3),o=i.n(a),s={idbName:"kwai-video-local-log",idbMaxDataCount:25e3,idbMaxFoldLog:20,maxLogLen:4096};function u(t,e){console.log("%c "+t+" %c "+e+" %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 t(){this.timeout=6048e5}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(t){}},r()(t,null,[{key:"available",get:function(){if(void 0===t._available)try{localStorage.setItem("alg","test"),t._available=!0}catch(e){t._available=!1}return t._available}}])}();c._available=void 0;var l,h,d=c,f=((h={}).NONE="none",h.ERROR="e",h.WARN="w",h.INFO="i",h.DEBUG="d",h.VERBOSE="v",h),p=f.ERROR,_=((l={})[f.NONE]={value:1,str:"N"},l[f.ERROR]={value:100,str:"E"},l[f.WARN]={value:200,str:"W"},l[f.INFO]={value:300,str:"I"},l[f.DEBUG]={value:400,str:"D"},l[f.VERBOSE]={value:500,str:"V"},l),v=function(){function t(t){if(this._name="kwai-v",this._level=p,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&"blob:"===location.protocol){var e,i=location.href.split("/"),n=null==(e=i[i.length-1])?void 0:e.match(/(\w+)-/);n&&(this._workerTag=t?t+"-"+n[1]:n[1])}else t&&(this._workerTag=t)}t.loadLogLevel=function(t,e){if(void 0===e&&(e=!0),location.href){var i=new RegExp(t+"=([a-z]{1})"),n=location.href.match(i);if(n&&n.length>1){var r=n[1];if(this._isValueInLevel(r))return r}}var a=(new d).read(t,e);if(this._isValueInLevel(a))return a},t.saveLogLevel=function(t,e){this._isValueInLevel(e)&&(new d).write(t,e)},t._isValueInLevel=function(t){return-1!==Object.values(f).indexOf(t)};var e=t.prototype;return e.setOutput=function(t){return this._output=t,this},e.setLevel=function(t){return this._level=t,this},e.setId=function(t){return this._id=t,this},e.setName=function(t){return this._name=t,this},e.getLevel=function(){return this._level},e.getOutput=function(){return this._output},e.hasOutput=function(){return!!this._output},e.e=function(t){if(this._isLevelEnabled(this._level,f.ERROR)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.ERROR,t,i);try{var a;null==(a=this._output)||a.e.apply(a,[r].concat(i))}catch(t){}}},e.w=function(t){if(this._isLevelEnabled(this._level,f.WARN)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.WARN,t,i);try{var a;null==(a=this._output)||a.w.apply(a,[r].concat(i))}catch(t){}}},e.i=function(t){if(this._isLevelEnabled(this._level,f.INFO)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.INFO,t,i);try{var a;null==(a=this._output)||a.i.apply(a,[r].concat(i))}catch(t){}}},e.d=function(t){if(this._isLevelEnabled(this._level,f.DEBUG)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.DEBUG,t,i);try{var a;null==(a=this._output)||a.d.apply(a,[r].concat(i))}catch(t){}}},e.v=function(t){if(this._isLevelEnabled(this._level,f.VERBOSE)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(f.VERBOSE,t,i);try{var a;null==(a=this._output)||a.v.apply(a,[r].concat(i))}catch(t){}}},e._isLevelEnabled=function(t,e){return _[t].value>=_[e].value},e._printLog=function(t,e,i){var n,r,a=typeof e;if("object"===a)e=(null==(r=e)?void 0:r.constructor.name)||"unknown";else if("function"===a){var o;e=(null==(o=Object.getOwnPropertyDescriptor(e,"name"))?void 0:o.value)||"unknown"}var s,u,c=((null==(n=_[t])?void 0:n.str)||"")+"|"+this._name+"["+("function"==typeof this._id?this._id():this._id)+"]["+this._workerTag+"]::"+e;return t===f.ERROR?(s=console).error.apply(s,[c].concat(i.slice(0))):(u=console).log.apply(u,[c].concat(i.slice(0))),c},t}(),A=new v,g=r()((function t(e){this._logger=void 0,this._id=0,this._config=s,this._id=t._id,t._id++,this._logger=(new v).setId(this._id).setLevel(f.INFO),this._config=o()({},s,e)}),[{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 (中国标准时间)"}}]);g._id=0;var m=i(4),b=i.n(m),y=i(2),E=i.n(y),C=function(){function t(t,e,i,n,r){var a=this;void 0===r&&(r=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(;a._taskQueue.length;){var t=a._taskQueue.shift();t&&a.run(t.task,t.mode)}},this._logger=t,this._name=e,this._storeName=i,this._dbIndex=n,this._version=r}var e=t.prototype;return e.init=function(){var t=this;if(!this._openReq&&indexedDB){var e=this._openReq=indexedDB.open(this._name,this._version);this._logger.i("idb-wrapper","open",e),e.onerror=function(){t._logger.i("idb-wrapper","open error.")},e.onsuccess=function(){t._logger.i("idb-wrapper","open success."),t._runTaskQueue()},e.onupgradeneeded=function(){t._logger.i("idb-wrapper","open upgradeneeded."),e.result.objectStoreNames.contains(t._storeName)&&e.result.deleteObjectStore(t._storeName);var i=e.result.createObjectStore(t._storeName,{keyPath:"id",autoIncrement:!0});t._dbIndex&&t._dbIndex.forEach((function(t){i.createIndex(t.name,t.keyPath,t.option)}))}}},e.run=function(t,e){if(void 0===e&&(e="readwrite"),this.init(),this._openReq&&"done"===this._openReq.readyState&&!this._openReq.error)return this._doTask(t,e);"error"!==this.state&&(this._taskQueue.push({task:t,mode:e}),this._taskQueue.length>1e3&&this._taskQueue.shift())},e.close=function(){var t=this;this._logger.i("idb-wrapper","close"),this._openReq&&("done"===this._openReq.readyState?(this._openReq.result.close(),this._openReq=void 0):this._openReq.onsuccess=function(){t.close()})},e.destroy=function(){this._logger.i("idb-wrapper","destroy"),this.close(),this._taskQueue=[]},e._doTask=function(t,e){var i=this;if(void 0===e&&(e="readwrite"),this._openReq&&!this._openReq.error)try{this._isTransactionActive=!0;var n=this._openReq.result.transaction(this._storeName,e),r=void 0;n.oncomplete=function(){i._isTransactionActive=!1,t.callback&&t.callback(r),i._runTaskQueue()},n.onabort=n.onerror=function(){i._isTransactionActive=!1,t.callback&&t.callback(r),i._runTaskQueue()},r=t.exec(n.objectStore(this._storeName))}catch(t){}else t.callback&&t.callback()},r()(t,[{key:"isTransactionActive",get:function(){return this._isTransactionActive}},{key:"state",get:function(){return this._openReq&&"done"===this._openReq.readyState?this._openReq.error?"error":"ready":"idle"}}])}(),T=[{name:"id",keyPath:"id",option:{unique:!0}}],I=[function(){function t(t){this._ctx=void 0,this._idb=void 0,this._logCount=0,this._saveCount=0,this._reCountOnSaveCount=100,this._reduceData=!1,this._ctx=t,this._idb=new C(t.logger,t.config.idbName,t.config.idbName,T),this._reCountOnSaveCount=Math.min(200,Math.max(50,Math.round(this._ctx.config.idbMaxDataCount/10))),this._count()}t.isSupported=function(){return typeof indexedDB<"u"};var e,i=t.prototype;return i.saveLog=function(t){var e=this,i={exec:function(e){return e.add({value:t})},callback:function(t){e._saveCount++,e._saveCount%e._reCountOnSaveCount==0&&e._count(),null!=t&&t.error&&e._ctx.logger.i("idb-backend","save log err",t.error)}};this._idb.run(i)},i.exportLog=(e=b()(E.a.mark((function t(){var e=this;return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,i){e._ctx.logger.i("idb-backend","export start");var n={exec:function(t){return t.getAll()},callback:function(i){t(void 0===i?"":e._mergeGetAll(i.result))}};e._idb.run(n,"readonly")})));case 1:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)}),i.destroy=function(){this._idb.destroy()},i.clean=function(){this._idb.run({exec:function(t){return t.clear()}})},i._count=function(){var t=this,e={exec:function(t){return t.count()},callback:function(e){null!=e&&e.error||null==e||!e.result||(t._ctx.logger.i("idb-backend","count: "+e.result+" max: "+t._ctx.config.idbMaxDataCount),t._logCount=e.result,t._logCount>=t._ctx.config.idbMaxDataCount&&!t._reduceData&&t._deleteFromHead(t._logCount-Math.round(t._ctx.config.idbMaxDataCount/2)))}};this._idb.run(e)},i._deleteFromHead=function(t){var e=this;this._ctx.logger.i("idb-backend","delete from head"),this._reduceData=!0;var i={exec:function(t){return t.openCursor()},callback:function(i){if(e._reduceData=!1,null!=i&&i.result){var n=IDBKeyRange.bound(i.result.key,i.result.key+t,!1,!1),r={exec:function(t){return e._ctx.logger.i("idb-backend","del: "+n.lower+"~"+n.upper),t.delete(n)},callback:function(t){e._ctx.logger.i("idb-backend","del result: "+!(null==t||!t.error))}};e._idb.run(r)}}};this._idb.run(i)},i._mergeGetAll=function(t){return t.length?t.reduce((function(t,e){return""+t+e.value+"\n"}),""):""},r()(t,[{key:"isActive",get:function(){return"error"!==this._idb.state}}])}()];function R(t,e,i){var n=new Date;"string"!=typeof t&&(t=t.toString());var r=n.toLocaleString()+"."+n.getMilliseconds().toString().padStart(3,"0")+"|"+t+"|";return e.forEach((function(t){r+="object"==typeof t?JSON.stringify(t)+" ":t+" "})),r.length>i?r.substring(0,i):r}function w(t){return t.join("\n")}var L=function(){function t(t){var e=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(){e._delayTimer=setInterval((function(){e._saveLog(!0)}),1e3)},this._stopDelay=function(){e._delayTimer&&(clearTimeout(e._delayTimer),e._delayTimer=void 0)},u("kwai-video-local-log","1.0.13"),this._ctx=new g(t);var i=function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.addLog.apply(e,[t].concat(n))};this._loggerForAdd={e:i,w:i,i:i,d:i,v:i},this._ctx.logger.setOutput(this._loggerForAdd),this._ctx.logger.i("kwai-video-local-log","constructor",t,this._ctx.config),this._backend=function(t){for(var e=0;e<I.length;e++){var i=I[e];if(null!=i&&i.isSupported())return new i(t)}}(this._ctx),this._backend&&this._startDelay()}t.isSupported=function(){return function(){for(var t=0;t<I.length;t++){var e=I[t];if(null!=e&&e.isSupported())return!0}return!1}()};var e=t.prototype;return e.addLog=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];this._logCache.push(R(t,i,this._ctx.config.maxLogLen)),this._saveLog()},e.cleanLog=function(){var t;this._ctx.logger.i("kwai-video-local-log","clean"),null==(t=this._backend)||t.clean()},e.exportLog=function(){var t=this;return this._ctx.logger.i("kwai-video-local-log","export log"),new Promise((function(e,i){t._backend?t._backend.exportLog().then((function(i){e(w([i].concat(t._logCache)))})):e("")}))},e.downloadLog=function(t){var e=this;this._ctx.logger.i("kwai-video-local-log","download log: "+t),this._destroyDownloadHref(),this.exportLog().then((function(i){var n=new Blob([i],{type:"text/plain"});if(document){var r=document.createElement("a");e._downloadHref=r.href=URL.createObjectURL(n),r.download=t||"Log_web_"+(new Date).toLocaleString()+".log",document.body.appendChild(r),r.click(),r.remove()}else console.log("无document,当前是否在worker中")}))},e.destroy=function(){var t;this._destroyDownloadHref(),null==(t=this._backend)||t.destroy(),this._stopDelay()},e.getLoggerForAdd=function(){return this._loggerForAdd},e._destroyDownloadHref=function(){try{this._downloadHref&&(URL.revokeObjectURL(this._downloadHref),this._downloadHref=void 0)}catch(t){}},e._saveLog=function(t){if(void 0===t&&(t=!1),this._backend&&this._backend.isActive&&(this._logCache.length>=this._ctx.config.idbMaxFoldLog||this._logCache.length>0&&t)){var e=w(this._logCache);this._logCache.splice(0,this._logCache.length),e&&this._backend.saveLog(e)}},r()(t,null,[{key:"version",get:function(){return"1.0.13"}}])}();e.default=L}]);void 0===fi&&console.error("esm-webpack-plugin: nothing exported!");var pi=fi.KwaiVideoLocalLog,_i=fi.LogLevel,vi=fi.DefaultLogger,Ai=fi.Logger;fi.printVersion,fi.DEFAULT_LOG_LEVEL,fi.default;var gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var bi,yi={exports:{}},Ei="object"==typeof Reflect?Reflect:null,Ci=Ei&&"function"==typeof Ei.apply?Ei.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};bi=Ei&&"function"==typeof Ei.ownKeys?Ei.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Ti=Number.isNaN||function(t){return t!=t};function Ii(){Ii.init.call(this)}yi.exports=Ii,yi.exports.once=function(t,e){return new Promise((function(i,n){function r(i){t.removeListener(e,a),n(i)}function a(){"function"==typeof t.removeListener&&t.removeListener("error",r),i([].slice.call(arguments))}Pi(t,e,a,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&Pi(t,"error",e,i)}(t,r,{once:!0})}))},Ii.EventEmitter=Ii,Ii.prototype._events=void 0,Ii.prototype._eventsCount=0,Ii.prototype._maxListeners=void 0;var Ri=10;function wi(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Li(t){return void 0===t._maxListeners?Ii.defaultMaxListeners:t._maxListeners}function Di(t,e,i,n){var r,a,o;if(wi(i),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),a=t._events),o=a[e]),void 0===o)o=a[e]=i,++t._eventsCount;else if("function"==typeof o?o=a[e]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),(r=Li(t))>0&&o.length>r&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,function(t){console&&console.warn&&console.warn(t)}(s)}return t}function Si(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Oi(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=Si.bind(n);return r.listener=i,n.wrapFn=r,r}function Ni(t,e,i){var n=t._events;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):xi(r,r.length)}function ki(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function xi(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function Pi(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(a){n.once&&t.removeEventListener(e,r),i(a)}))}}Object.defineProperty(Ii,"defaultMaxListeners",{enumerable:!0,get:function(){return Ri},set:function(t){if("number"!=typeof t||t<0||Ti(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ri=t}}),Ii.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ii.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||Ti(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Ii.prototype.getMaxListeners=function(){return Li(this)},Ii.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=r[t];if(void 0===s)return!1;if("function"==typeof s)Ci(s,this,e);else{var u=s.length,c=xi(s,u);for(i=0;i<u;++i)Ci(c[i],this,e)}return!0},Ii.prototype.addListener=function(t,e){return Di(this,t,e,!1)},Ii.prototype.on=Ii.prototype.addListener,Ii.prototype.prependListener=function(t,e){return Di(this,t,e,!0)},Ii.prototype.once=function(t,e){return wi(e),this.on(t,Oi(this,t,e)),this},Ii.prototype.prependOnceListener=function(t,e){return wi(e),this.prependListener(t,Oi(this,t,e)),this},Ii.prototype.removeListener=function(t,e){var i,n,r,a,o;if(wi(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,r=a;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,r),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},Ii.prototype.off=Ii.prototype.removeListener,Ii.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var r,a=Object.keys(i);for(n=0;n<a.length;++n)"removeListener"!==(r=a[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},Ii.prototype.listeners=function(t){return Ni(this,t,!0)},Ii.prototype.rawListeners=function(t){return Ni(this,t,!1)},Ii.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):ki.call(t,e)},Ii.prototype.listenerCount=ki,Ii.prototype.eventNames=function(){return this._eventsCount>0?bi(this._events):[]};var Mi=yi.exports,Ui=function(){if(typeof Map<"u")return Map;function t(t,e){var i=-1;return t.some((function(t,n){return t[0]===e&&(i=n,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},e.prototype.set=function(e,i){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,n=t(i,e);~n&&i.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,n=this.__entries__;i<n.length;i++){var r=n[i];t.call(e,r[1],r[0])}},e}()}(),Bi=typeof window<"u"&&typeof document<"u"&&window.document===document,Vi=typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Fi="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Vi):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var ji=["top","right","bottom","left","width","height","size","weight"],Hi=typeof MutationObserver<"u",Gi=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var i=!1,n=!1,r=0;function a(){i&&(i=!1,t()),n&&s()}function o(){Fi(a)}function s(){var t=Date.now();if(i){if(t-r<2)return;n=!0}else i=!0,n=!1,setTimeout(o,e);r=t}return s}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){!Bi||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Hi?(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)},t.prototype.disconnect_=function(){!Bi||!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)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;ji.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),zi=function(t,e){for(var i=0,n=Object.keys(e);i<n.length;i++){var r=n[i];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},Wi=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||Vi},Ki=Ji(0,0,0,0);function Yi(t){return parseFloat(t)||0}function Qi(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(e,i){return e+Yi(t["border-"+i+"-width"])}),0)}function Xi(t){var e=t.clientWidth,i=t.clientHeight;if(!e&&!i)return Ki;var n=Wi(t).getComputedStyle(t),r=function(t){for(var e={},i=0,n=["top","right","bottom","left"];i<n.length;i++){var r=n[i],a=t["padding-"+r];e[r]=Yi(a)}return e}(n),a=r.left+r.right,o=r.top+r.bottom,s=Yi(n.width),u=Yi(n.height);if("border-box"===n.boxSizing&&(Math.round(s+a)!==e&&(s-=Qi(n,"left","right")+a),Math.round(u+o)!==i&&(u-=Qi(n,"top","bottom")+o)),!function(t){return t===Wi(t).document.documentElement}(t)){var c=Math.round(s+a)-e,l=Math.round(u+o)-i;1!==Math.abs(c)&&(s-=c),1!==Math.abs(l)&&(u-=l)}return Ji(r.left,r.top,s,u)}var Zi=typeof SVGGraphicsElement<"u"?function(t){return t instanceof Wi(t).SVGGraphicsElement}:function(t){return t instanceof Wi(t).SVGElement&&"function"==typeof t.getBBox};function qi(t){return Bi?Zi(t)?function(t){var e=t.getBBox();return Ji(0,0,e.width,e.height)}(t):Xi(t):Ki}function Ji(t,e,i,n){return{x:t,y:e,width:i,height:n}}var $i=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ji(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=qi(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),tn=function(t,e){var i=function(t){var e=t.x,i=t.y,n=t.width,r=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(a.prototype);return zi(o,{x:e,y:i,width:n,height:r,top:i,right:e+n,bottom:r+i,left:e}),o}(e);zi(this,{target:t,contentRect:i})},en=function(){function t(t,e,i){if(this.activeObservations_=[],this.observations_=new Ui,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u")&&Element instanceof Object){if(!(t instanceof Wi(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new $i(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u")&&Element instanceof Object){if(!(t instanceof Wi(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new tn(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),nn=typeof WeakMap<"u"?new WeakMap:new Ui,rn=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=Gi.getInstance(),n=new en(e,i,this);nn.set(this,n)};["observe","unobserve","disconnect"].forEach((function(t){rn.prototype[t]=function(){var e;return(e=nn.get(this))[t].apply(e,arguments)}}));var an=typeof Vi.ResizeObserver<"u"?Vi.ResizeObserver:rn,on={},sn=Object.prototype.hasOwnProperty;function un(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function cn(t){try{return encodeURIComponent(t)}catch(t){return null}}on.stringify=function(t,e){e=e||"";var i,n,r=[];for(n in"string"!=typeof e&&(e="?"),t)if(sn.call(t,n)){if(!(i=t[n])&&(null==i||isNaN(i))&&(i=""),n=cn(n),i=cn(i),null===n||null===i)continue;r.push(n+"="+i)}return r.length?e+r.join("&"):""},on.parse=function(t){for(var e,i=/([^=?#&]+)=?([^&]*)/g,n={};e=i.exec(t);){var r=un(e[1]),a=un(e[2]);null===r||null===a||r in n||(n[r]=a)}return n};var ln=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t},hn=on,dn=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,fn=/[\n\r\t]/g,pn=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,_n=/:\d+$/,vn=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,An=/^[a-zA-Z]:/;function gn(t){return(t||"").toString().replace(dn,"")}var mn=[["#","hash"],["?","query"],function(t,e){return En(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],bn={hash:1,query:1};function yn(t){var e,i=(typeof window<"u"?window:typeof gi<"u"?gi:typeof self<"u"?self:{}).location||{},n={},r=typeof(t=t||i);if("blob:"===t.protocol)n=new Tn(unescape(t.pathname),{});else if("string"===r)for(e in n=new Tn(t,{}),bn)delete n[e];else if("object"===r){for(e in t)e in bn||(n[e]=t[e]);void 0===n.slashes&&(n.slashes=pn.test(t.href))}return n}function En(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function Cn(t,e){t=(t=gn(t)).replace(fn,""),e=e||{};var i,n=vn.exec(t),r=n[1]?n[1].toLowerCase():"",a=!!n[2],o=!!n[3],s=0;return a?o?(i=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(i=n[2]+n[4],s=n[2].length):o?(i=n[3]+n[4],s=n[3].length):i=n[4],"file:"===r?s>=2&&(i=i.slice(2)):En(r)?i=n[4]:r?a&&(i=i.slice(2)):s>=2&&En(e.protocol)&&(i=n[4]),{protocol:r,slashes:a||En(r),slashesCount:s,rest:i}}function Tn(t,e,i){if(t=(t=gn(t)).replace(fn,""),!(this instanceof Tn))return new Tn(t,e,i);var n,r,a,o,s,u,c=mn.slice(),l=typeof e,h=this,d=0;for("object"!==l&&"string"!==l&&(i=e,e=null),i&&"function"!=typeof i&&(i=hn.parse),n=!(r=Cn(t||"",e=yn(e))).protocol&&!r.slashes,h.slashes=r.slashes||n&&e.slashes,h.protocol=r.protocol||e.protocol||"",t=r.rest,("file:"===r.protocol&&(2!==r.slashesCount||An.test(t))||!r.slashes&&(r.protocol||r.slashesCount<2||!En(h.protocol)))&&(c[3]=[/(.*)/,"pathname"]);d<c.length;d++)"function"!=typeof(o=c[d])?(a=o[0],u=o[1],a!=a?h[u]=t:"string"==typeof a?~(s="@"===a?t.lastIndexOf(a):t.indexOf(a))&&("number"==typeof o[2]?(h[u]=t.slice(0,s),t=t.slice(s+o[2])):(h[u]=t.slice(s),t=t.slice(0,s))):(s=a.exec(t))&&(h[u]=s[1],t=t.slice(0,s.index)),h[u]=h[u]||n&&o[3]&&e[u]||"",o[4]&&(h[u]=h[u].toLowerCase())):t=o(t,h);i&&(h.query=i(h.query)),n&&e.slashes&&"/"!==h.pathname.charAt(0)&&(""!==h.pathname||""!==e.pathname)&&(h.pathname=function(t,e){if(""===t)return e;for(var i=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=i.length,r=i[n-1],a=!1,o=0;n--;)"."===i[n]?i.splice(n,1):".."===i[n]?(i.splice(n,1),o++):o&&(0===n&&(a=!0),i.splice(n,1),o--);return a&&i.unshift(""),("."===r||".."===r)&&i.push(""),i.join("/")}(h.pathname,e.pathname)),"/"!==h.pathname.charAt(0)&&En(h.protocol)&&(h.pathname="/"+h.pathname),ln(h.port,h.protocol)||(h.host=h.hostname,h.port=""),h.username=h.password="",h.auth&&(~(s=h.auth.indexOf(":"))?(h.username=h.auth.slice(0,s),h.username=encodeURIComponent(decodeURIComponent(h.username)),h.password=h.auth.slice(s+1),h.password=encodeURIComponent(decodeURIComponent(h.password))):h.username=encodeURIComponent(decodeURIComponent(h.auth)),h.auth=h.password?h.username+":"+h.password:h.username),h.origin="file:"!==h.protocol&&En(h.protocol)&&h.host?h.protocol+"//"+h.host:"null",h.href=h.toString()}Tn.prototype={set:function(t,e,i){var n=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(i||hn.parse)(e)),n[t]=e;break;case"port":n[t]=e,ln(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,_n.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!i;break;case"pathname":case"hash":if(e){var r="pathname"===t?"/":"#";n[t]=e.charAt(0)!==r?r+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(n.username=e.slice(0,a),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(a+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var o=0;o<mn.length;o++){var s=mn[o];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin="file:"!==n.protocol&&En(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n},toString:function(t){(!t||"function"!=typeof t)&&(t=hn.stringify);var e,i=this,n=i.host,r=i.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var a=r+(i.protocol&&i.slashes||En(i.protocol)?"//":"");return i.username?(a+=i.username,i.password&&(a+=":"+i.password),a+="@"):i.password?(a+=":"+i.password,a+="@"):"file:"!==i.protocol&&En(i.protocol)&&!n&&"/"!==i.pathname&&(a+="@"),(":"===n[n.length-1]||_n.test(i.hostname)&&!i.port)&&(n+=":"),a+=n+i.pathname,(e="object"==typeof i.query?t(i.query):i.query)&&(a+="?"!==e.charAt(0)?"?"+e:e),i.hash&&(a+=i.hash),a}},Tn.extractProtocol=Cn,Tn.location=yn,Tn.trimLeft=gn,Tn.qs=hn;var In=mi(Tn),Rn=function(t,e){for(var i=0,n=t.length-1,r=null,a=null;i<=n;){var o=e(a=t[r=(i+n)/2|0]);if(o>0)i=r+1;else{if(!(o<0))return a;n=r-1}}},wn=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(2);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}t.exports=function(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(0).default,r=i(3);t.exports=function(t){var e=r(t,"string");return"symbol"==n(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=i(0).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){function n(t,e){console.log("%c "+t+" %c "+e+" %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")}i.r(e),i.d(e,"LogLevel",(function(){return l})),i.d(e,"DefaultLogger",(function(){return p})),i.d(e,"Logger",(function(){return f})),i.d(e,"printVersion",(function(){return n})),i.d(e,"DEFAULT_LOG_LEVEL",(function(){return h}));var r=i(1),a=i.n(r),o=function(){function t(){this.timeout=6048e5}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(t){}},a()(t,null,[{key:"available",get:function(){if(void 0===t._available)try{localStorage.setItem("alg","test"),t._available=!0}catch(e){t._available=!1}return t._available}}])}();o._available=void 0;var s,u,c=o,l=((u={}).NONE="none",u.ERROR="e",u.WARN="w",u.INFO="i",u.DEBUG="d",u.VERBOSE="v",u),h=l.ERROR,d=((s={})[l.NONE]={value:1,str:"N"},s[l.ERROR]={value:100,str:"E"},s[l.WARN]={value:200,str:"W"},s[l.INFO]={value:300,str:"I"},s[l.DEBUG]={value:400,str:"D"},s[l.VERBOSE]={value:500,str:"V"},s),f=function(){function t(t){if(this._name="kwai-v",this._level=h,this._id=-1,this._output=void 0,this._workerTag="main",typeof location<"u"&&"blob:"===location.protocol){var e,i=location.href.split("/"),n=null==(e=i[i.length-1])?void 0:e.match(/(\w+)-/);n&&(this._workerTag=t?t+"-"+n[1]:n[1])}else t&&(this._workerTag=t)}t.loadLogLevel=function(t,e){if(void 0===e&&(e=!0),location.href){var i=new RegExp(t+"=([a-z]{1})"),n=location.href.match(i);if(n&&n.length>1){var r=n[1];if(this._isValueInLevel(r))return r}}var a=(new c).read(t,e);if(this._isValueInLevel(a))return a},t.saveLogLevel=function(t,e){this._isValueInLevel(e)&&(new c).write(t,e)},t._isValueInLevel=function(t){return-1!==Object.values(l).indexOf(t)};var e=t.prototype;return e.setOutput=function(t){return this._output=t,this},e.setLevel=function(t){return this._level=t,this},e.setId=function(t){return this._id=t,this},e.setName=function(t){return this._name=t,this},e.getLevel=function(){return this._level},e.getOutput=function(){return this._output},e.hasOutput=function(){return!!this._output},e.e=function(t){if(this._isLevelEnabled(this._level,l.ERROR)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.ERROR,t,i);try{var a;null==(a=this._output)||a.e.apply(a,[r].concat(i))}catch(t){}}},e.w=function(t){if(this._isLevelEnabled(this._level,l.WARN)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.WARN,t,i);try{var a;null==(a=this._output)||a.w.apply(a,[r].concat(i))}catch(t){}}},e.i=function(t){if(this._isLevelEnabled(this._level,l.INFO)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.INFO,t,i);try{var a;null==(a=this._output)||a.i.apply(a,[r].concat(i))}catch(t){}}},e.d=function(t){if(this._isLevelEnabled(this._level,l.DEBUG)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.DEBUG,t,i);try{var a;null==(a=this._output)||a.d.apply(a,[r].concat(i))}catch(t){}}},e.v=function(t){if(this._isLevelEnabled(this._level,l.VERBOSE)){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];var r=this._printLog(l.VERBOSE,t,i);try{var a;null==(a=this._output)||a.v.apply(a,[r].concat(i))}catch(t){}}},e._isLevelEnabled=function(t,e){return d[t].value>=d[e].value},e._printLog=function(t,e,i){var n,r,a=typeof e;if("object"===a)e=(null==(r=e)?void 0:r.constructor.name)||"unknown";else if("function"===a){var o;e=(null==(o=Object.getOwnPropertyDescriptor(e,"name"))?void 0:o.value)||"unknown"}var s,u,c=((null==(n=d[t])?void 0:n.str)||"")+"|"+this._name+"["+("function"==typeof this._id?this._id():this._id)+"]["+this._workerTag+"]::"+e;return t===l.ERROR?(s=console).error.apply(s,[c].concat(i.slice(0))):(u=console).log.apply(u,[c].concat(i.slice(0))),c},t}(),p=new f}]);void 0===wn&&console.error("esm-webpack-plugin: nothing exported!"),wn.LogLevel;var Ln=wn.DefaultLogger;/*! js-cookie v3.0.5 | MIT */function Dn(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}wn.Logger,wn.printVersion,wn.DEFAULT_LOG_LEVEL;var Sn=function t(e,i){function n(t,n,r){if(!(typeof document>"u")){"number"==typeof(r=Dn({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var o in r)r[o]&&(a+="; "+o,!0!==r[o]&&(a+="="+r[o].split(";")[0]));return document.cookie=t+"="+e.write(n,t)+a}}return Object.create({set:n,get:function(t){if(!(typeof document>"u"||arguments.length&&!t)){for(var i=document.cookie?document.cookie.split("; "):[],n={},r=0;r<i.length;r++){var a=i[r].split("="),o=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(n[s]=e.read(o,s),t===s)break}catch(t){}}return t?n[t]:n}},remove:function(t,e){n(t,"",Dn({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,Dn({},this.attributes,e))},withConverter:function(e){return t(Dn({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),On="did",Nn="kwai_player_device_id";function kn(){try{for(var t=1e9*Math.random()>>>0,e=[],i=0;i<7;i++)e.push("0123456789ABCDEF".charAt(16*Math.random()));var n="web_"+t+e.join("");return Ln.i(On,"generate nanoId",n),n}catch(t){}return"web_did_generation_failed"}var xn=function(){var t="";try{t=(Sn.get("did")||Sn.get("_did")||Sn.get("weblogger_did")||"").trim(),Ln.i(On,"generate deviceId from cookie",t)}catch(t){Ln.i(On,"generate deviceId from cookie err",t)}try{t?null==localStorage||localStorage.setItem(Nn,t):(t=((null==localStorage?void 0:localStorage.getItem(Nn))||"").trim(),Ln.i(On,"generate deviceId from ls",t)),t||(t=kn(),null==localStorage||localStorage.setItem(Nn,t))}catch(t){Ln.i(On,"generate deviceId from ls err",t)}return t||kn()}(),Pn=function(){function t(){di(this,"timeout",6048e5)}var e=t.prototype;return e.write=function(e,i){if(t.available)try{localStorage.setItem(e,JSON.stringify({value:i,time:Date.now()}))}catch(t){}},e.read=function(e,i){if(void 0===i&&(i=!0),t.available)try{var n=localStorage.getItem(e);if(n){var r=JSON.parse(n),a=r.value,o=r.time,s=void 0===o?0:o;if(!i||Date.now()-s<("number"==typeof i?i:this.timeout))return a}}catch(n){}},_()(t,null,[{key:"available",get:function(){if(typeof t._available>"u")try{localStorage.setItem("alg","test"),t._available=!0}catch(e){t._available=!1}return t._available}}])}();di(Pn,"_available");var Mn=Pn,Un={exports:{}};!function(t,e){!function(i,n){var r="function",a="undefined",o="object",s="string",u="model",c="name",l="type",h="vendor",d="version",f="architecture",p="console",_="mobile",v="tablet",A="smarttv",g="wearable",m="embedded",b="Amazon",y="Apple",E="BlackBerry",C="Browser",T="Chrome",I="Firefox",R="Google",w="Microsoft",L="Motorola",D="Opera",S="Samsung",O="Sony",N="Xiaomi",k="Zebra",x="Facebook",P=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},M=function(t,e){return typeof t===s&&-1!==U(e).indexOf(U(t))},U=function(t){return t.toLowerCase()},B=function(t,e){if(typeof t===s)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===a?t:t.substring(0,255)},V=function(t,e){for(var i,a,s,u,c,l,h=0;h<e.length&&!c;){var d=e[h],f=e[h+1];for(i=a=0;i<d.length&&!c;)if(c=d[i++].exec(t))for(s=0;s<f.length;s++)l=c[++a],typeof(u=f[s])===o&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;h+=2}},F=function(t,e){for(var i in e)if(typeof e[i]===o&&e[i].length>0){for(var r=0;r<e[i].length;r++)if(M(e[i][r],t))return"?"===i?n:i}else if(M(e[i],t))return"?"===i?n:i;return t},j={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"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,d],[/opios[\/ ]+([\w\.]+)/i],[d,[c,D+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[c,D]],[/(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],[c,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[c,"UC"+C]],[/\bqbcore\/([\w\.]+)/i],[d,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+C],d],[/\bfocus\/([\w\.]+)/i],[d,[c,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[c,D+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[c,D+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[c,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[d,[c,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+C]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+C],d],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,x],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[c,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,T+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[c,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[c,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[d,F,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[c,I+" 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],[c,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,U]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",U]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,U]]],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],[u,[h,S],[l,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,S],[l,_]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[h,y],[l,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,y],[l,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,"Huawei"],[l,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[u,[h,"Huawei"],[l,_]],[/\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],[[u,/_/g," "],[h,N],[l,_]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,N],[l,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[h,"OPPO"],[l,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[l,_]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[l,_]],[/\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],[u,[h,L],[l,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,L],[l,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,"LG"],[l,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,"LG"],[l,_]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[l,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[l,_]],[/(pixel c)\b/i],[u,[h,R],[l,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,R],[l,_]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[h,O],[l,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,O],[l,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[l,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,b],[l,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,b],[l,_]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[l,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,E],[l,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,"ASUS"],[l,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,"ASUS"],[l,_]],[/(nexus 9)/i],[u,[h,"HTC"],[l,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[l,_]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[l,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[l,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,"Sharp"],[l,_]],[/(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],[h,u,[l,_]],[/(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],[h,u,[l,v]],[/(surface duo)/i],[u,[h,w],[l,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[l,_]],[/(u304aa)/i],[u,[h,"AT&T"],[l,_]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[l,_]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[l,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[l,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[l,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[l,v]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[l,v]],[/\b(k88) b/i],[u,[h,"ZTE"],[l,v]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[l,_]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[l,_]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[l,v]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[l,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[l,v]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[l,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[l,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[l,_]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[l,_]],[/\b(ph-1) /i],[u,[h,"Essential"],[l,_]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[l,v]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[l,v]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[l,v]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[l,v]],[/(sprint) (\w+)/i],[h,u,[l,_]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,w],[l,_]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,k],[l,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,k],[l,_]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[l,p]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[l,p]],[/(playstation [345portablevi]+)/i],[u,[h,O],[l,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,w],[l,p]],[/smart-tv.+(samsung)/i],[h,[l,A]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,S],[l,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,"LG"],[l,A]],[/(apple) ?tv/i],[h,[u,y+" TV"],[l,A]],[/crkey/i],[[u,T+"cast"],[h,R],[l,A]],[/droid.+aft(\w)( bui|\))/i],[u,[h,b],[l,A]],[/\(dtv[\);].+(aquos)/i],[u,[h,"Sharp"],[l,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,B],[u,B],[l,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,A]],[/((pebble))app/i],[h,u,[l,g]],[/droid.+; (glass) \d/i],[u,[h,R],[l,g]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,k],[l,g]],[/(quest( 2)?)/i],[u,[h,x],[l,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[l,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,_]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[c,"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],[c,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[d,F,j]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[d,F,j]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,d],[/\(bb(10);/i],[d,[c,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[c,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[c,T+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],d],[/(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],[c,d],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,d]]},G=function(t,e){if(typeof t===o&&(e=t,t=n),!(this instanceof G))return new G(t,e).getResult();var r=t||(typeof i!==a&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),p=e?function(t,e){var i={};for(var n in t)e[n]&&e[n].length%2==0?i[n]=e[n].concat(t[n]):i[n]=t[n];return i}(H,e):H;return this.getBrowser=function(){var t={};return t[c]=n,t[d]=n,V.call(t,r,p.browser),t.major=function(t){return typeof t===s?t.replace(/[^\d\.]/g,"").split(".")[0]:n}(t.version),t},this.getCPU=function(){var t={};return t[f]=n,V.call(t,r,p.cpu),t},this.getDevice=function(){var t={};return t[h]=n,t[u]=n,t[l]=n,V.call(t,r,p.device),t},this.getEngine=function(){var t={};return t[c]=n,t[d]=n,V.call(t,r,p.engine),t},this.getOS=function(){var t={};return t[c]=n,t[d]=n,V.call(t,r,p.os),t},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 r},this.setUA=function(t){return r=typeof t===s&&t.length>255?B(t,255):t,this},this.setUA(r),this};G.VERSION="1.0.2",G.BROWSER=P([c,d,"major"]),G.CPU=P([f]),G.DEVICE=P([u,h,l,p,_,A,v,g,m]),G.ENGINE=G.OS=P([c,d]),t.exports&&(e=t.exports=G),e.UAParser=G;var z=typeof i!==a&&(i.jQuery||i.Zepto);if(z&&!z.ua){var W=new G;z.ua=W.getResult(),z.ua.get=function(){return W.getUA()},z.ua.set=function(t){W.setUA(t);var e=W.getResult();for(var i in e)z.ua[i]=e[i]}}}("object"==typeof window?window:gi)}(Un,Un.exports);var Bn=mi(Un.exports)(),Vn=Bn.os.name,Fn=Vn&&Vn.toLowerCase().indexOf("android")>=0,jn=Vn&&Vn.toLowerCase().indexOf("ios")>=0,Hn="mobile"===Bn.device.type||Fn||jn;function Gn(t,e){void 0===t&&(t=0);var i=0,n=(t=Math.floor(t)||0)%60;if(!0===e||typeof e>"u"&&t>=3600){var r=Math.floor(t/3600);return(r>=10?r:"0"+r)+":"+((i=Math.floor(t%3600/60))>=10?i:"0"+i)+":"+(n>=10?n:"0"+n)}return((i=Math.floor(t/60))>=10?i:"0"+i)+":"+(n>=10?n:"0"+n)}var zn=_i.ERROR;typeof location<"u"&&(zn=Ai.loadLogLevel("kwai-player-log")||_i.ERROR,vi.setLevel(zn).setName("kwai-p"));var Wn=Mi.EventEmitter;!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Kn=Object.defineProperty,Yn=function(t,e,i){return function(t,e,i){e in t?Kn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Qn="ControlsPlugin",Xn=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);Yn(Xn,"label"),Yn(Xn,"version"),Yn(Xn,"isSupported"),Yn(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Xn),"label",Qn),Yn(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Xn),"label","I18nPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Xn),"label","LoggerPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","HotkeyPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","PlayInfoPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","RotatePlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","PreviewPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","MaskPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","VRPlugin"),Yn(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Xn),"label","DanmakuPlugin");var Zn,qn,Jn,$n,tr,er,ir,nr,rr={},ar=[],or=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function sr(t,e){for(var i in e)t[i]=e[i];return t}function ur(t){var e=t.parentNode;e&&e.removeChild(t)}function cr(t,e,i){var n,r,a,o={};for(a in e)"key"==a?n=e[a]:"ref"==a?r=e[a]:o[a]=e[a];if(arguments.length>2&&(o.children=arguments.length>3?Zn.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===o[a]&&(o[a]=t.defaultProps[a]);return lr(t,o,n,r,null)}function lr(t,e,i,n,r){var a={type:t,props:e,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++Jn:r};return null==r&&null!=qn.vnode&&qn.vnode(a),a}function hr(t){return t.children}function dr(t,e){this.props=t,this.context=e}function fr(t,e){if(null==e)return t.__?fr(t.__,t.__.__k.indexOf(t)+1):null;for(var i;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?fr(t):null}function pr(t){var e,i;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e){t.__e=t.__c.base=i.__e;break}return pr(t)}}function _r(t){(!t.__d&&(t.__d=!0)&&$n.push(t)&&!vr.__r++||tr!==qn.debounceRendering)&&((tr=qn.debounceRendering)||er)(vr)}function vr(){var t,e,i,n,r,a,o,s;for($n.sort(ir);t=$n.shift();)t.__d&&(e=$n.length,n=void 0,r=void 0,o=(a=(i=t).__v).__e,(s=i.__P)&&(n=[],(r=sr({},a)).__v=a.__v+1,Rr(s,a,r,i.__n,void 0!==s.ownerSVGElement,null!=a.__h?[o]:null,n,null==o?fr(a):o,a.__h),wr(n,a),a.__e!=o&&pr(a)),$n.length>e&&$n.sort(ir));vr.__r=0}function Ar(t,e,i,n,r,a,o,s,u,c){var l,h,d,f,p,_,v,A=n&&n.__k||ar,g=A.length;for(i.__k=[],l=0;l<e.length;l++)if(null!=(f=i.__k[l]=null==(f=e[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?lr(null,f,null,null,f):Array.isArray(f)?lr(hr,{children:f},null,null,null):f.__b>0?lr(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=i,f.__b=i.__b+1,null===(d=A[l])||d&&f.key==d.key&&f.type===d.type)A[l]=void 0;else for(h=0;h<g;h++){if((d=A[h])&&f.key==d.key&&f.type===d.type){A[h]=void 0;break}d=null}Rr(t,f,d=d||rr,r,a,o,s,u,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(v||(v=[]),d.ref&&v.push(d.ref,null,f),v.push(h,f.__c||p,f)),null!=p?(null==_&&(_=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=u=gr(f,u,t):u=br(t,f,d,A,p,u),"function"==typeof i.type&&(i.__d=u)):u&&d.__e==u&&u.parentNode!=t&&(u=fr(d))}for(i.__e=_,l=g;l--;)null!=A[l]&&("function"==typeof i.type&&null!=A[l].__e&&A[l].__e==i.__d&&(i.__d=yr(n).nextSibling),Dr(A[l],A[l]));if(v)for(l=0;l<v.length;l++)Lr(v[l],v[++l],v[++l])}function gr(t,e,i){for(var n,r=t.__k,a=0;r&&a<r.length;a++)(n=r[a])&&(n.__=t,e="function"==typeof n.type?gr(n,e,i):br(i,n,n,r,n.__e,e));return e}function mr(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){mr(t,e)})):e.push(t)),e}function br(t,e,i,n,r,a){var o,s,u;if(void 0!==e.__d)o=e.__d,e.__d=void 0;else if(null==i||r!=a||null==r.parentNode)t:if(null==a||a.parentNode!==t)t.appendChild(r),o=null;else{for(s=a,u=0;(s=s.nextSibling)&&u<n.length;u+=1)if(s==r)break t;t.insertBefore(r,a),o=a}return void 0!==o?o:r.nextSibling}function yr(t){var e,i,n;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((i=t.__k[e])&&(n=yr(i)))return n;return null}function Er(t,e,i){"-"===e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||or.test(e)?i:i+"px"}function Cr(t,e,i,n,r){var a;t:if("style"===e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)i&&e in i||Er(t.style,e,"");if(i)for(e in i)n&&i[e]===n[e]||Er(t.style,e,i[e])}else if("o"===e[0]&&"n"===e[1])a=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=i,i?n||t.addEventListener(e,a?Ir:Tr,a):t.removeEventListener(e,a?Ir:Tr,a);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,i))}}function Tr(t){return this.l[t.type+!1](qn.event?qn.event(t):t)}function Ir(t){return this.l[t.type+!0](qn.event?qn.event(t):t)}function Rr(t,e,i,n,r,a,o,s,u){var c,l,h,d,f,p,_,v,A,g,m,b,y,E,C,T=e.type;if(void 0!==e.constructor)return null;null!=i.__h&&(u=i.__h,s=e.__e=i.__e,e.__h=null,a=[s]),(c=qn.__b)&&c(e);try{t:if("function"==typeof T){if(v=e.props,A=(c=T.contextType)&&n[c.__c],g=c?A?A.props.value:c.__:n,i.__c?_=(l=e.__c=i.__c).__=l.__E:("prototype"in T&&T.prototype.render?e.__c=l=new T(v,g):(e.__c=l=new dr(v,g),l.constructor=T,l.render=Sr),A&&A.sub(l),l.props=v,l.state||(l.state={}),l.context=g,l.__n=n,h=l.__d=!0,l.__h=[],l._sb=[]),null==l.__s&&(l.__s=l.state),null!=T.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=sr({},l.__s)),sr(l.__s,T.getDerivedStateFromProps(v,l.__s))),d=l.props,f=l.state,l.__v=e,h)null==T.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==T.getDerivedStateFromProps&&v!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(v,g),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(v,l.__s,g)||e.__v===i.__v){for(e.__v!==i.__v&&(l.props=v,l.state=l.__s,l.__d=!1),l.__e=!1,e.__e=i.__e,e.__k=i.__k,e.__k.forEach((function(t){t&&(t.__=e)})),m=0;m<l._sb.length;m++)l.__h.push(l._sb[m]);l._sb=[],l.__h.length&&o.push(l);break t}null!=l.componentWillUpdate&&l.componentWillUpdate(v,l.__s,g),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(d,f,p)}))}if(l.context=g,l.props=v,l.__P=t,b=qn.__r,y=0,"prototype"in T&&T.prototype.render){for(l.state=l.__s,l.__d=!1,b&&b(e),c=l.render(l.props,l.state,l.context),E=0;E<l._sb.length;E++)l.__h.push(l._sb[E]);l._sb=[]}else do{l.__d=!1,b&&b(e),c=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++y<25);l.state=l.__s,null!=l.getChildContext&&(n=sr(sr({},n),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),C=null!=c&&c.type===hr&&null==c.key?c.props.children:c,Ar(t,Array.isArray(C)?C:[C],e,i,n,r,a,o,s,u),l.base=e.__e,e.__h=null,l.__h.length&&o.push(l),_&&(l.__E=l.__=null),l.__e=!1}else null==a&&e.__v===i.__v?(e.__k=i.__k,e.__e=i.__e):e.__e=function(t,e,i,n,r,a,o,s){var u,c,l,h=i.props,d=e.props,f=e.type,p=0;if("svg"===f&&(r=!0),null!=a)for(;p<a.length;p++)if((u=a[p])&&"setAttribute"in u==!!f&&(f?u.localName===f:3===u.nodeType)){t=u,a[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),a=null,s=!1}if(null===f)h===d||s&&t.data===d||(t.data=d);else{if(a=a&&Zn.call(t.childNodes),c=(h=i.props||rr).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!s){if(null!=a)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(l||c)&&(l&&(c&&l.__html==c.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(function(t,e,i,n,r){var a;for(a in i)"children"===a||"key"===a||a in e||Cr(t,a,null,i[a],n);for(a in e)r&&"function"!=typeof e[a]||"children"===a||"key"===a||"value"===a||"checked"===a||i[a]===e[a]||Cr(t,a,e[a],i[a],n)}(t,d,h,r,s),l)e.__k=[];else if(p=e.props.children,Ar(t,Array.isArray(p)?p:[p],e,i,n,r&&"foreignObject"!==f,a,o,a?a[0]:i.__k&&fr(i,0),s),null!=a)for(p=a.length;p--;)null!=a[p]&&ur(a[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Cr(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&Cr(t,"checked",p,h.checked,!1))}return t}(i.__e,e,i,n,r,a,o,u);(c=qn.diffed)&&c(e)}catch(t){e.__v=null,(u||null!=a)&&(e.__e=s,e.__h=!!u,a[a.indexOf(s)]=null),qn.__e(t,e,i)}}function wr(t,e){qn.__c&&qn.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){qn.__e(t,e.__v)}}))}function Lr(t,e,i){try{"function"==typeof t?t(e):t.current=e}catch(t){qn.__e(t,i)}}function Dr(t,e,i){var n,r;if(qn.unmount&&qn.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Lr(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){qn.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&Dr(n[r],e,i||"function"!=typeof t.type);i||null==t.__e||ur(t.__e),t.__=t.__e=t.__d=void 0}function Sr(t,e,i){return this.constructor(t,i)}function Or(t,e,i){var n,r,a;qn.__&&qn.__(t,e),r=(n="function"==typeof i)?null:i&&i.__k||e.__k,a=[],Rr(e,t=(!n&&i||e).__k=cr(hr,null,[t]),r||rr,rr,void 0!==e.ownerSVGElement,!n&&i?[i]:r?null:e.firstChild?Zn.call(e.childNodes):null,a,!n&&i?i:r?r.__e:e.firstChild,n),wr(a,t)}function Nr(t,e){var i={__c:e="__cC"+nr++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var i,n;return this.getChildContext||(i=[],(n={})[e]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&i.some((function(t){t.__e=!0,_r(t)}))},this.sub=function(t){i.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i.splice(i.indexOf(t),1),e&&e.call(t)}}),t.children}};return i.Provider.__=i.Consumer.contextType=i}Zn=ar.slice,qn={__e:function(t,e,i,n){for(var r,a,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((a=r.constructor)&&null!=a.getDerivedStateFromError&&(r.setState(a.getDerivedStateFromError(t)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,n||{}),o=r.__d),o)return r.__E=r}catch(e){t=e}throw t}},Jn=0,dr.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=sr({},this.state),"function"==typeof t&&(t=t(sr({},i),this.props)),t&&sr(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),_r(this))},dr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),_r(this))},dr.prototype.render=hr,$n=[],er="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ir=function(t,e){return t.__v.__b-e.__v.__b},vr.__r=0,nr=0;var kr=0;function xr(t,e,i,n,r,a){var o,s,u={};for(s in e)"ref"==s?o=e[s]:u[s]=e[s];var c={type:t,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--kr,__source:r,__self:a};if("function"==typeof t&&(o=t.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return qn.vnode&&qn.vnode(c),c}var Pr,Mr,Ur,Br,Vr=0,Fr=[],jr=[],Hr=qn.__b,Gr=qn.__r,zr=qn.diffed,Wr=qn.__c,Kr=qn.unmount;function Yr(t,e){qn.__h&&qn.__h(Mr,t,Vr||e),Vr=0;var i=Mr.__H||(Mr.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:jr}),i.__[t]}function Qr(t){return Vr=1,function(t,e,i){var n=Yr(Pr++,2);if(n.t=t,!n.__c&&(n.__=[i?i(e):sa(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=Mr,!Mr.u)){var r=function(t,e,i){if(!n.__c.__H)return!0;var r=n.__c.__H.__.filter((function(t){return t.__c}));if(r.every((function(t){return!t.__N})))return!a||a.call(this,t,e,i);var o=!1;return r.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),!(!o&&n.__c.props===t)&&(!a||a.call(this,t,e,i))};Mr.u=!0;var a=Mr.shouldComponentUpdate,o=Mr.componentWillUpdate;Mr.componentWillUpdate=function(t,e,i){if(this.__e){var n=a;a=void 0,r(t,e,i),a=n}o&&o.call(this,t,e,i)},Mr.shouldComponentUpdate=r}return n.__N||n.__}(sa,t)}function Xr(t,e){var i=Yr(Pr++,3);!qn.__s&&oa(i.__H,e)&&(i.__=t,i.i=e,Mr.__H.__h.push(i))}function Zr(t,e){var i=Yr(Pr++,4);!qn.__s&&oa(i.__H,e)&&(i.__=t,i.i=e,Mr.__h.push(i))}function qr(t){return Vr=5,Jr((function(){return{current:t}}),[])}function Jr(t,e){var i=Yr(Pr++,7);return oa(i.__H,e)?(i.__V=t(),i.i=e,i.__h=t,i.__V):i.__}function $r(t,e){return Vr=8,Jr((function(){return t}),e)}function ta(t){var e=Mr.context[t.__c],i=Yr(Pr++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Mr)),e.props.value):t.__}function ea(){for(var t;t=Fr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ra),t.__H.__h.forEach(aa),t.__H.__h=[]}catch(e){t.__H.__h=[],qn.__e(e,t.__v)}}qn.__b=function(t){Mr=null,Hr&&Hr(t)},qn.__r=function(t){Gr&&Gr(t),Pr=0;var e=(Mr=t.__c).__H;e&&(Ur===Mr?(e.__h=[],Mr.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=jr,t.__N=t.i=void 0}))):(e.__h.forEach(ra),e.__h.forEach(aa),e.__h=[])),Ur=Mr},qn.diffed=function(t){zr&&zr(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Fr.push(e)&&Br===qn.requestAnimationFrame||((Br=qn.requestAnimationFrame)||na)(ea)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==jr&&(t.__=t.__V),t.i=void 0,t.__V=jr}))),Ur=Mr=null},qn.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ra),t.__h=t.__h.filter((function(t){return!t.__||aa(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],qn.__e(i,t.__v)}})),Wr&&Wr(t,e)},qn.unmount=function(t){Kr&&Kr(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{ra(t)}catch(t){e=t}})),i.__H=void 0,e&&qn.__e(e,i.__v))};var ia="function"==typeof requestAnimationFrame;function na(t){var e,i=function(){clearTimeout(n),ia&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,100);ia&&(e=requestAnimationFrame(i))}function ra(t){var e=Mr,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Mr=e}function aa(t){var e=Mr;t.__c=t.__(),Mr=e}function oa(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function sa(t,e){return"function"==typeof e?e(t):e}function ua(t,e){for(var i in e)t[i]=e[i];return t}function ca(t,e){for(var i in t)if("__source"!==i&&!(i in e))return!0;for(var n in e)if("__source"!==n&&t[n]!==e[n])return!0;return!1}function la(t){this.props=t}(la.prototype=new dr).isPureReactComponent=!0,la.prototype.shouldComponentUpdate=function(t,e){return ca(this.props,t)||ca(this.state,e)};var ha=qn.__b;qn.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),ha&&ha(t)};var da="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function fa(t){function e(e){var i=ua({},e);return delete i.ref,t(i,e.ref||null)}return e.$$typeof=da,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var pa=qn.__e;qn.__e=function(t,e,i,n){if(t.then)for(var r,a=e;a=a.__;)if((r=a.__c)&&r.__c)return null==e.__e&&(e.__e=i.__e,e.__k=i.__k),r.__c(t,e);pa(t,e,i,n)};var _a=qn.unmount;function va(){this.__u=0,this.t=null,this.__b=null}function Aa(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function ga(){this.u=null,this.o=null}qn.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),_a&&_a(t)},(va.prototype=new dr).__c=function(t,e){var i=e.__c,n=this;null==n.t&&(n.t=[]),n.t.push(i);var r=Aa(n.__v),a=!1,o=function(){a||(a=!0,i.__R=null,r?r(s):s())};i.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var t=n.state.__a;n.__v.__k[0]=function t(e,i,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,i,n)})),e.__c&&e.__c.__P===i&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}(t,t.__c.__P,t.__c.__O)}var e;for(n.setState({__a:n.__b=null});e=n.t.pop();)e.forceUpdate()}},u=!0===e.__h;n.__u++||u||n.setState({__a:n.__b=n.__v.__k[0]}),t.then(o,o)},va.prototype.componentWillUnmount=function(){this.t=[]},va.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,i,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=ua({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=i),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,i,n)}))),e}(this.__b,i,n.__O=n.__P)}this.__b=null}var r=e.__a&&cr(hr,null,t.fallback);return r&&(r.__h=null),[cr(hr,null,e.__a?null:t.children),r]};var ma=function(t,e,i){if(++i[1]===i[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(i=t.u;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;t.u=i=i[2]}};(ga.prototype=new dr).__a=function(t){var e=this,i=Aa(e.__v),n=e.o.get(t);return n[0]++,function(r){var a=function(){e.props.revealOrder?(n.push(r),ma(e,t,n)):r()};i?i(a):a()}},ga.prototype.render=function(t){this.u=null,this.o=new Map;var e=mr(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var i=e.length;i--;)this.o.set(e[i],this.u=[1,0,this.u]);return t.children},ga.prototype.componentDidUpdate=ga.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,i){ma(t,i,e)}))};var ba="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ya=/^(?: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]/,Ea=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ca=/[A-Z0-9]/g,Ta="undefined"!=typeof document,Ia=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};dr.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(dr.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Ra=qn.event;function wa(){}function La(){return this.cancelBubble}function Da(){return this.defaultPrevented}qn.event=function(t){return Ra&&(t=Ra(t)),t.persist=wa,t.isPropagationStopped=La,t.isDefaultPrevented=Da,t.nativeEvent=t};var Sa={enumerable:!1,configurable:!0,get:function(){return this.class}},Oa=qn.vnode;qn.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,i=t.type,n={};for(var r in e){var a=e[r];if(!("value"===r&&"defaultValue"in e&&null==a||Ta&&"children"===r&&"noscript"===i||"class"===r||"className"===r)){var o=r.toLowerCase();"defaultValue"===r&&"value"in e&&null==e.value?r="value":"download"===r&&!0===a?a="":"ondoubleclick"===o?r="ondblclick":"onchange"!==o||"input"!==i&&"textarea"!==i||Ia(e.type)?"onfocus"===o?r="onfocusin":"onblur"===o?r="onfocusout":Ea.test(r)?r=o:-1===i.indexOf("-")&&ya.test(r)?r=r.replace(Ca,"-$&").toLowerCase():null===a&&(a=void 0):o=r="oninput","oninput"===o&&n[r=o]&&(r="oninputCapture"),n[r]=a}}"select"==i&&n.multiple&&Array.isArray(n.value)&&(n.value=mr(e.children).forEach((function(t){t.props.selected=-1!=n.value.indexOf(t.props.value)}))),"select"==i&&null!=n.defaultValue&&(n.value=mr(e.children).forEach((function(t){t.props.selected=n.multiple?-1!=n.defaultValue.indexOf(t.props.value):n.defaultValue==t.props.value}))),e.class&&!e.className?(n.class=e.class,Object.defineProperty(n,"className",Sa)):(e.className&&!e.class||e.class&&e.className)&&(n.class=n.className=e.className),t.props=n}(t),t.$$typeof=ba,Oa&&Oa(t)};var Na=qn.__r;qn.__r=function(t){Na&&Na(t),t.__c};var ka=qn.diffed;qn.diffed=function(t){ka&&ka(t);var e=t.props,i=t.__e;null!=i&&"textarea"===t.type&&"value"in e&&e.value!==i.value&&(i.value=null==e.value?"":e.value)},function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.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(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var xa=Object.defineProperty,Pa=function(t,e,i){return function(t,e,i){e in t?xa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Ma=Object.defineProperty,Ua=function(t,e,i){return function(t,e,i){e in t?Ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Ba="I18nPlugin",Va="RotatePlugin",Fa="PreviewPlugin",ja="VRPlugin",Ha="DanmakuPlugin",Ga=function(t){return t.BOTTOM="bottom",t.PLAY_BAR="playBar",t.NONE="none",t}(Ga||{}),za=function(t){return t.PLAY_BAR_LEFT="playBarLeft",t.PLAY_BAR_RIGHT="playBarRight",t.CONTEXT_MENU="contextMenu",t}(za||{}),Wa=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);Ua(Wa,"label"),Ua(Wa,"version"),Ua(Wa,"isSupported");var Ka=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Wa);Ua(Ka,"label","ControlsPlugin");var Ya=Ka;Ua(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Wa),"label",Ba),Ua(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Wa),"label","LoggerPlugin"),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label","HotkeyPlugin"),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label","PlayInfoPlugin"),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label",Va),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label",Fa),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label","MaskPlugin"),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label",ja),Ua(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wa),"label",Ha);var Qa=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(Qa||{}),Xa=function(t){return t.NONE="none",t.KWAI="kwai",t.KWAI2="kwai2",t}(Xa||{}),Za=function(t){return t.SYSTEM="system",t.WINDOW="window",t}(Za||{}),qa=function(t){return t.PLAY="play",t.PAUSE="pause",t.REFRESH="refresh",t.NEXT="next",t.TURN_ON_LOOP="turnOnLoop",t.TURN_OFF_LOOP="turnOffLoop",t.LOOP="loop",t.PLAYBACK_RATE_NORMAL="playbackRateNromal",t.OPTIONS="options",t.DOWNLOAD="download",t.VIDEO_TRACK="videoTrack",t.AUDIO_TRACK="audioTrack",t.PLAYBACK_RATE="playbackRate",t.PLAYBACK_RATE_SHORT="playbackRateShort",t.PICTURE_IN_PICTURE="pictureInPicture",t.EXIT_PICTURE_IN_PICTURE="exitPictureInPicture",t.PLAY_INFO="playInfo",t.MIRROR_IMAGE="mirrorImage",t.ROTATE="rotate",t.FULLSCREEN="fullscreen",t.EXIT_FULLSCREEN="exitFullscreen",t.WINDOW_FULLSCREEN="windowFullscreen",t.EXIT_WINDOW_FULLSCREEN="exitWindowFullscreen",t.AUTO="auto",t.CURRENT_VOLUME="currentVolume",t.CURRENTLY_MUTED="currentlyMuted",t.SWITCH_TO_VIDEO="switchToVideo",t.SWITCHING_TO_VIDEO="switchingToVideo",t.SWITCHED_TO_VIDEO="switchedToVideo",t.SWITCH_TO_AUDIO="switchToAudio",t.SWITCHING_TO_AUDIO="switchingToAudio",t.SWITCHED_TO_AUDIO="switchedToAudio",t.FAIL="fail",t.ERROR_PANEL_TITLE="errorPanelTitle",t.ERROR_PANEL_RETRY_BTN="errorPanelRetryBtn",t.LIVE="live",t.RETURN_TO_LIVE="returnToLive",t}(qa||{}),Ja={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:"返回直播"},$a=function(t){return t.VERSION="version",t.LOOP="loop",t.PLAY_INFO="playInfo",t.MIRROR="mirror",t.ROTATE="rotate",t.PIP="pip",t}($a||{}),to=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.HOVER=1]="HOVER",t[t.DISABLED=2]="DISABLED",t}(to||{});function eo(t,e,i){var n=t.findIndex((function(t){return t.id===i.id}));n>=0&&(t.splice(n,1),e([].concat(t)))}function io(t,e,i,n){var r=t.findIndex((function(t){return t.id===i.id}));r<0?(typeof n>"u"?t.push(i):t.splice(n,0,i),e([].concat(t))):"number"==typeof n&&n!==r&&(t.splice(r,1),t.splice(n,0,i),e([].concat(t)))}var no=Nr(void 0),ro=function(t){var e=t.children,i=t.deps,n=i.player,r=i.text,a=Qr([{id:$a.VERSION,name:n.packVersion,handle:function(){},isChecked:!1}]),o=a[0],s=a[1],u=Qr([]),c=u[0],l=u[1],h=Qr([])[0],d=qr({id:$a.LOOP,name:r(qa.LOOP),handle:function(){d.current.isChecked=n.loop=!n.loop,s([].concat(o)),l([].concat(c))},isChecked:!1}),f=qr({id:$a.PIP,name:r(qa.PICTURE_IN_PICTURE),handle:function(){document.pictureInPictureElement?document.exitPictureInPicture():n.requestPictureInPicture(),l([].concat(c))},isChecked:!1}),p=function(){Hn||!n.isPictureInPictureAvailable()||n.disablePictureInPicture?(eo(c,l,f.current),eo(o,s,f.current)):(io(c,l,f.current,1),io(o,s,f.current,1))},_=function(){h.forEach((function(t){t.btns.forEach((function(t){t.active?(io(o,s,t.btn),io(c,l,t.btn)):(eo(o,s,t.btn),eo(c,l,t.btn))}))}))};return Zr((function(){n.logger.i("adaptive-btns-context","init"),p();var t=function(){eo(o,s,d.current),_()},e=function(){p()},i=function(t){"mediaInfo"===t.type&&!t.value.isLive&&io(o,s,d.current,1)},a=function(){f.current.isChecked=!0,f.current.name=r(qa.EXIT_PICTURE_IN_PICTURE),l([].concat(c))},u=function(){f.current.isChecked=!1,f.current.name=r(qa.PICTURE_IN_PICTURE),l([].concat(c))};return n.on(Qa.ATTRIBUTE_CHANGE_SRC,t),n.on(Qa.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,e),n.on(Qa.REPORT,i),n.on(Qa.ENTER_PICTURE_IN_PICTURE,a),n.on(Qa.LEAVE_PICTURE_IN_PICTURE,u),n.getAllPlugins().forEach((function(t){var e=t.getLabel(),i=h.find((function(t){return t.id===e})),n=t.controlsSoltBtns;if(i)i.btns.forEach((function(t){return t.active=!1})),null==n||n.forEach((function(t,n){if(t.slotPos===za.CONTEXT_MENU&&t.getText){var r=e+"-"+n,a=i.btns.find((function(t){return t.btn.id===r}));a&&(a.active=!0)}}));else{var r=null==n?void 0:n.map((function(t,i){var n;if(t.slotPos===za.CONTEXT_MENU&&t.getText){var r=function(){a.isChecked=!!t.getChecked&&t.getChecked(),s([].concat(o)),l([].concat(c))};null==(n=t.callback)||n.add(r);var a={id:e+"-"+i,name:t.getText(),handle:t.onClick,isChecked:!!t.getChecked&&t.getChecked()};return{btn:a,changeCallback:r,soltBtnInfo:t,active:!0}}})).filter((function(t){return typeof t<"u"}));null!=r&&r.length&&h.push({id:e,btns:r})}})),_(),function(){n.off(Qa.ATTRIBUTE_CHANGE_SRC,t),n.off(Qa.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,e),n.off(Qa.REPORT,i),n.off(Qa.ENTER_PICTURE_IN_PICTURE,a),n.off(Qa.LEAVE_PICTURE_IN_PICTURE,u),h.forEach((function(t){t.btns.forEach((function(t){var e;null==(e=t.soltBtnInfo.callback)||e.remove(t.changeCallback)}))}))}}),[]),xr(no.Provider,{value:{player:n,contextMenuItems:o,overflowItems:c},children:e})},ao=Nr(void 0),oo="controls-context",so=function(t){var e=t.children,i=t.deps,n=i.player,r=i.text,a=n.logger,o=Qr(!1),s=o[0],u=o[1],c=Qr([]),l=c[0],h=c[1],d=Qr([]),f=d[0],p=d[1],_=Qr(),v=_[0],A=_[1],g=Qr(-1),m=g[0],b=g[1],y=Qr(-1),E=y[0],C=y[1],T=Qr(n.playbackRate),I=T[0],R=T[1],w=Qr(!1),L=w[0],D=w[1],S=Qr(n.muted),O=S[0],N=S[1],k=Qr(n.volume),x=k[0],P=k[1],M=Qr(!1),U=M[0],B=M[1],V=Qr(n.paused),F=V[0],j=V[1],H=Qr(n.isFullscreen(Za.SYSTEM)),G=H[0],z=H[1],W=Qr(n.isFullscreen(Za.WINDOW)),K=W[0],Y=W[1],Q=Qr(!0),X=Q[0],Z=Q[1],q=Qr(n.loop),J=q[0],$=q[1],tt=Qr(!1),et=tt[0],it=tt[1],nt=Qr(!!n.controls),rt=nt[0],at=nt[1],ot=Qr(!!n.isLiveShift),st=ot[0],ut=ot[1],ct=Qr(n.liveShiftType),lt=ct[0],ht=ct[1],dt=Qr(n.isFullscreenAvailable())[0],ft=Qr(!1!==i.options.showWindowFullScreen)[0],pt=Qr(!!n.disablePictureInPicture),_t=pt[0],vt=pt[1],At=Qr(!0===i.options.showProgressTime)[0],gt=Qr(!1!==i.options.showContextMenu)[0],mt=Jr((function(){return!(lt!==Xa.KWAI&&lt!==Xa.KWAI2||!s)&&!Hn}),[lt,s]),bt=Jr((function(){return!n.src||!!v}),[n.src,v]),yt=Jr((function(){return!s}),[s]),Et=Jr((function(){return s}),[s]),Ct=Jr((function(){return!Hn&&n.isPictureInPictureAvailable()&&!_t&&!X&&et}),[X,et,_t]),Tt=Jr((function(){return!s&&!Hn&&!1!==i.options.showPlaybackRate}),[s]),It=Jr((function(){return!s&&!1!==i.options.showPlaybackRate}),[s]),Rt=Jr((function(){return typeof n.showProgress>"u"&&typeof i.options.showProgress>"u"?!s||s&&mt:(!s||s&&mt)&&!(!n.showProgress&&!i.options.showProgress)}),[s,mt,n.showProgress]),wt=Jr((function(){return!1!==n.showTime&&!1!==i.options.showTime}),[n.showTime]),Lt=Jr((function(){return!(!n.showNext&&!i.options.showNext)}),[s,n.showNext]),Dt=Jr((function(){return!(!n.showPrev&&!i.options.showPrev)}),[s,n.showPrev]);Zr((function(){var t=function(t){a.i(oo,"manifest parsed");var e=[];if(t.levels.forEach((function(t,i){var n=t.qualityLabel||t.qualityType;n||(n=t.width&&t.height?Math.min(t.width,t.height)+"P":i.toString()),e.push({val:i,label:n,type:t.qualityType||""})})),e.reverse(),b(t.currentLevel),t.auto&&e.length>1&&(e.unshift({val:-1,label:r(qa.AUTO),type:""}),b(-1)),h(e),t.audioTracks){var i=[];t.audioTracks.forEach((function(t,e){i.push({val:e,label:t.qualityLabel||t.qualityType||t.lang||e.toString(),type:t.qualityType})})),f.reverse(),p(i),C(t.audioTrack||0),u(!!t.isLive)}},e=function(t){"mediaInfo"===t.type&&u(!!t.value.isLive)},i=function(t){A(t),B(!1)},o=function(){A(void 0),Z(!!n.canvas)},s=function(){n.video.readyState>2&&B(!1)},c=function(){isFinite(n.duration)&&n.duration>0&&lt===Xa.NONE&&u(!1)},l=function(){return R(n.playbackRate)},d=function(){return D(!0)},_=function(){return D(!1)},v=function(){B(!1),it(!1),u(!1)},g=function(){A(void 0),R(n.playbackRate)},m=function(){B(!0)},y=function(){B(!0)},E=function(){B(!1)},T=function(){O(),j(n.paused),B(!1),it(!0)},I=function(){j(n.paused)},w=function(){j(n.paused),it(!0)},L=function(){j(n.paused)},S=function(){O()},O=function(){N(n.muted||0===n.volume),P(n.muted?0:n.volume)},k=function(t){var e=t.isFull;"window"===t.type?Y(e):(z(e),e||Y(!1))},x=function(){Z(!!n.canvas)},M=function(){$(n.loop)},U=function(){at(!!n.controls)},V=function(){b(n.currentLevel)},F=function(){C(n.audioTrack)},H=function(){ut(!!n.isLiveShift)},G=function(){ht(n.liveShiftType)},W=function(){vt(n.disablePictureInPicture)};return n.on(Qa.ATTRIBUTE_CHANGE_SRC,v),n.on(Qa.EMPTIED,g),n.on(Qa.WAITING,m),n.on(Qa.SEEKING,y),n.on(Qa.SEEKED,E),n.on(Qa.PLAYING,T),n.on(Qa.PAUSE,I),n.on(Qa.CANPLAY,w),n.on(Qa.ENDED,L),n.on(Qa.VOLUMECHANGE,S),n.on(Qa.MANIFEST_PARSED,t),n.on(Qa.REPORT,e),n.on(Qa.ERROR,i),n.on(Qa.LOADEDDATA,o),n.on(Qa.TIMEUPDATE,s),n.on(Qa.DURATIONCHANGE,c),n.on(Qa.RATECHANGE,l),n.on(Qa.ENTER_PICTURE_IN_PICTURE,d),n.on(Qa.LEAVE_PICTURE_IN_PICTURE,_),n.on(Qa.FULLSCREEN_CHANGE,k),n.on(Qa.VIDEO_RENDERER_CHANGE,x),n.on(Qa.LIVE_SHIFT_CHANGE,H),n.on(Qa.LIVE_SHIFT_TYPE_CHANGE,G),n.on(Qa.ATTRIBUTE_CHANGE_LOOP,M),n.on(Qa.ATTRIBUTE_CHANGE_CONTROLS,U),n.on(Qa.ATTRIBUTE_CHANGE_CURRENT_LEVEL,V),n.on(Qa.ATTRIBUTE_CHANGE_NEXT_LEVEL,V),n.on(Qa.ATTRIBUTE_CHANGE_AUDIO_TRACK,F),n.on(Qa.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,W),function(){n.off(Qa.ATTRIBUTE_CHANGE_SRC,v),n.off(Qa.EMPTIED,g),n.off(Qa.WAITING,m),n.off(Qa.SEEKING,y),n.off(Qa.SEEKED,E),n.off(Qa.PLAYING,T),n.off(Qa.PAUSE,I),n.off(Qa.CANPLAY,w),n.off(Qa.ENDED,L),n.off(Qa.VOLUMECHANGE,S),n.off(Qa.MANIFEST_PARSED,t),n.off(Qa.REPORT,e),n.off(Qa.ERROR,i),n.off(Qa.LOADEDDATA,o),n.off(Qa.TIMEUPDATE,s),n.off(Qa.DURATIONCHANGE,c),n.off(Qa.RATECHANGE,l),n.off(Qa.ENTER_PICTURE_IN_PICTURE,d),n.off(Qa.LEAVE_PICTURE_IN_PICTURE,_),n.off(Qa.FULLSCREEN_CHANGE,k),n.off(Qa.VIDEO_RENDERER_CHANGE,x),n.off(Qa.LIVE_SHIFT_CHANGE,H),n.off(Qa.LIVE_SHIFT_TYPE_CHANGE,G),n.off(Qa.ATTRIBUTE_CHANGE_LOOP,M),n.off(Qa.ATTRIBUTE_CHANGE_CONTROLS,U),n.off(Qa.ATTRIBUTE_CHANGE_CURRENT_LEVEL,V),n.off(Qa.ATTRIBUTE_CHANGE_NEXT_LEVEL,V),n.off(Qa.ATTRIBUTE_CHANGE_AUDIO_TRACK,F),n.off(Qa.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE,W)}}),[]);return xr(ao.Provider,{value:{text:r,player:n,isLive:s,currentLevel:m,currentAudioLevel:E,levels:l,audioLevels:f,error:v,playbackRate:I,isInPIP:L,muted:O,volume:x,waiting:U,paused:F,isFullscreen:G,isWindowFullscreen:K,isCanvasRender:X,isLoop:J,firstFrameReady:et,isLiveShift:st,liveShiftType:lt,liveShiftEnabled:mt,changeLevel:function(t){a.i(oo,"change level",t),n.currentLevel=t,b(t)},changeAudioLevel:function(t){a.i(oo,"change audio level",t),n.audioTrack=t,C(t)},changePlaybackRate:function(t){a.i(oo,"change playback rate level",t),n.playbackRate=t},changeVolume:function(t){n.muted=!1,n.volume=t},changePIP:function(){a.i(oo,"change pip"),document.pictureInPictureElement?document.exitPictureInPicture():n.requestPictureInPicture()},toggleMuted:function(){a.i(oo,"toggle muted",!n.muted),n.muted=!n.muted},togglePlay:function(){a.i(oo,"toggle play",n.paused),n.paused?n.play():n.pause()},toggleFullscreen:function(){a.i(oo,"toggle fullscreen"),n.isFullscreen(Za.SYSTEM)?n.exitFullscreen():n.requestFullscreen(Za.SYSTEM)},toggleWindowFullscreen:function(){a.i(oo,"toggle windows fullscreen"),n.isFullscreen(Za.WINDOW)?n.exitFullscreen():n.requestFullscreen(Za.WINDOW)},refresh:function(){a.i(oo,"refresh"),n.refresh()},jumpToLive:function(){a.i(oo,"jump to live"),n.jumpToLive()},disabled:bt,controls:rt,showLoop:yt,showRefresh:Et,showFullScreen:dt,showWindowFullScreen:ft,showPictureInPicture:Ct,showPlaybackRate:Tt,showPlaybackRateOverflow:It,showProgress:Rt,showProgressTime:At,showTime:wt,showNext:Lt,showPrev:Dt,showContextMenu:gt,deps:i},children:e})},uo=function(){function t(){Pa(this,"_observer"),Pa(this,"_target")}var e=t.prototype;return e.start=function(t,e,i){var n=this,r=t.getBoundingClientRect().width;e.forEach((function(t){return n._updateFontSize(t,r)})),this._observer||(this._observer=new an((function(t){i&&i(t),t.forEach((function(t){var i=t.contentRect.width;e.forEach((function(t){return n._updateFontSize(t,i)}))}))})),this._observer.observe(t))},e.stop=function(){this._observer&&this._target&&(this._observer.unobserve(this._target),this._observer.disconnect(),this._observer=void 0)},e._updateFontSize=function(t,e){t.style.fontSize=e>=1280?"24px":e>=640?"18px":e>=200?"12px":"11px"},t}(),co={controls:"_controls_azwg4_1","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:"_disabled_azwg4_97","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:"_timeline_azwg4_176",thumb:"_thumb_azwg4_182","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:"_overlay_azwg4_249",overflow:"_overflow_azwg4_258",closed:"_closed_azwg4_275","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:"_loading_azwg4_336",spinner:"_spinner_azwg4_355","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:"_text_azwg4_780","panel-button-tip-low-pos":"_panel-button-tip-low-pos_azwg4_784",tooltip:"_tooltip_azwg4_787","tooltip-low-pos":"_tooltip-low-pos_azwg4_801",preview:"_preview_azwg4_804","preview-img":"_preview-img_azwg4_814","preview-time":"_preview-time_azwg4_820","preview-time-no-img":"_preview-time-no-img_azwg4_838"},lo=fa((function(t,e){var i=ta(no);if(!i)return xr(hr,{});var n=i.contextMenuItems,r=qr(0),a=function(){r.current&&(clearTimeout(r.current),r.current=0)};return Xr((function(){return function(){a()}}),[]),xr(hr,{children:0!==n.length&&xr("div",{ref:e,className:co["context-menu"],style:{left:t.left,top:t.top,visibility:t.visible?"visible":"hidden"},onMouseLeave:function(){r.current=+setTimeout((function(){t.onChangeShowContextMenu()}),300)},onMouseEnter:function(){a()},children:xr("div",{className:co["context-menu-list"],children:n.map((function(e,i){return xr("div",{onClick:function(){!function(e){t.onChangeShowContextMenu(),e()}(e.handle)},className:co["context-menu-item"],children:[xr("div",{className:co["context-menu-label"],children:xr("span",{children:e.name})}),xr("input",{type:"checkbox",checked:e.isChecked,className:co["context-menu-checkbox"]})]},i)}))})})})}));function ho(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",children:xr("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:t.color||"#fff"})})}function fo(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",children:[xr("rect",{x:"7",y:"6",width:"6",height:"26",rx:"2",fill:t.color||"#fff"}),xr("rect",{x:"25",y:"6",width:"6",height:"26",rx:"2",fill:t.color||"#fff"})]})}function po(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",children:xr("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:t.color||"#fff"})})}function _o(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:xr("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:t.color||"#fff",strokeWidth:"2.813",strokeLinecap:"round"})})}function vo(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:xr("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:t.color||"#fff",strokeWidth:"2.5",strokeLinecap:"round"})})}function Ao(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:xr("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:t.color||"#fff",strokeWidth:"2.813",strokeLinecap:"round"})})}function go(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:xr("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:t.color||"#fff",strokeWidth:"2.5",strokeLinecap:"round"})})}function mo(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",children:xr("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:t.color||"#fff"})})}function bo(t){var e=t.color||"#fff";return xr("svg",{className:t.className,width:"38",height:"39",viewBox:"0 0 38 38",children:[xr("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:e}),xr("path",{d:"M4 5l29.5 26.5",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})]})}function yo(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",children:xr("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:t.color||"#fff"})})}function Eo(t){return xr("svg",{className:t.className,width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",children:xr("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:t.color||"#fff"})})}function Co(t){var e=t.color||"#fff";return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:[xr("rect",{x:"16.15",y:"22.225",width:"19",height:"12.35",rx:"4",fill:e}),xr("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:e,strokeWidth:"2.5",strokeLinecap:"round"})]})}function To(t){var e=t.color||"#fff";return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:[xr("rect",{x:"16.15",y:"21.85",width:"19",height:"12.35",rx:"4",fill:e}),xr("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:e,strokeWidth:"2.5",strokeLinecap:"round"})]})}function Io(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:xr("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:t.color||"#fff"})})}function Ro(t){return xr("svg",{className:t.className,width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",children:xr("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:t.color||"#fff"})})}function wo(t){var e=ta(ao);if(!e)return xr(hr,{});var i=e.deps.text,n=e.refresh,r=Jr((function(){return t.message.length>64?t.message.substring(0,64):t.message}),[t.message]);return xr("div",{className:co["error-alert"],children:[xr("div",{className:co["error-icon"]}),xr("div",{className:co["error-title"],children:i(qa.ERROR_PANEL_TITLE)}),xr("div",{className:co["error-message"],children:[t.code," ",r]}),xr("div",{className:co["error-retry"],onClick:function(){n()},children:[xr(Eo,{color:"#333",className:co["error-retry-icon"]}),xr("span",{children:i(qa.ERROR_PANEL_RETRY_BTN)})]})]})}function Lo(){return xr("div",{className:co.loading,children:xr("div",{className:co["loading-spinner-frame"],children:xr("div",{className:co.spinner,children:xr("div",{className:co["kwai-layer"],children:[xr("div",{className:co["spinner-mask-1"],children:xr("div",{className:co["loading-spinner-mask-1-bg"]})}),xr("div",{className:co["spinner-mask-2"],children:xr("div",{className:co["loading-spinner-mask-2-bg"]})})]})})})})}var Do=[{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"}],So=Nr(void 0),Oo=function(t){var e,i=t.children,n=t.deps.player,r=Qr(n.currentTime),a=r[0],o=r[1],s=Qr(n.duration),u=s[0],c=s[1],l={st:0,ed:0};n.buffered&&n.buffered.length&&(l.st=n.buffered.start(0),l.ed=null==(e=n.buffered)?void 0:e.end(0));var h=Qr(l),d=h[0],f=h[1],p=Jr((function(){var t=Number.isFinite(u)&&u||d.ed;return t?d.ed/t*100:0}),[u,d]),_=Jr((function(){var t=Number.isFinite(u)&&u||d.ed;return t?a/t*100:0}),[a,u,d]),v=$r((function(t){n.duration!==1/0&&(n.currentTime=t,o(n.currentTime))}),[n]),A=$r((function(){c(n.duration)}),[n]),g=$r((function(){var t,e,i;null!=(t=n.buffered)&&t.length&&f({st:null==(e=n.buffered)?void 0:e.start(0),ed:null==(i=n.buffered)?void 0:i.end(0)})}),[n]),m=$r((function(){o(n.currentTime)}),[n]),b=$r((function(){c(n.duration)}),[n]),y=$r((function(){o(0),c(0),f({st:0,ed:0})}),[n]),E=$r((function(){o(n.currentTime)}),[n]);return Zr((function(){return n.on(Qa.ATTRIBUTE_CHANGE_SRC,y),n.on(Qa.LOADEDDATA,A),n.on(Qa.TIMEUPDATE,m),n.on(Qa.PROGRESS,g),n.on(Qa.DURATIONCHANGE,b),n.on(Qa.SEEKING,E),function(){n.off(Qa.ATTRIBUTE_CHANGE_SRC,y),n.off(Qa.LOADEDDATA,A),n.off(Qa.TIMEUPDATE,m),n.off(Qa.PROGRESS,g),n.off(Qa.DURATIONCHANGE,b),n.off(Qa.SEEKING,E)}}),[]),xr(So.Provider,{value:{player:n,currentTime:a,currentTimePercent:_,duration:u,buffered:d,bufferedPercent:p,seek:v},children:i})},No=Nr(void 0),ko=function(t){return xr(No.Provider,{value:{panelHover:t.panelHover,setPanelHover:t.setPanelHover,dragProgress:t.dragProgress,setDragProgress:t.setDragProgress,floatLayerId:t.floatLayerId,setFloatLayerId:t.setFloatLayerId,height:t.height,width:t.width,container:t.container},children:t.children})},xo="#FFF",Po=((n={})[to.DEFAULT]=[xo],n[to.HOVER]=["#1280FF"],n[to.DISABLED]=[xo],n),Mo=function(t){return t&&Po[t]||[xo]},Uo=fa((function(t,e){var i=ta(ao);if(!i)return xr(hr,{});var n=i.text,r=i.isLiveShift,a=t.disabled,o=t.className,s=e&&e?e:qr(null),u=Qr(to.DEFAULT),c=u[0],l=u[1],h=Qr(!1),d=(h[0],h[1]);return Xr((function(){a||l(to.DEFAULT)}),[r]),Xr((function(){a&&l(to.DEFAULT)}),[a]),xr("div",{ref:s,"data-kp-role":t["data-kp-role"],className:[o,a?co.disabled:""].join(" "),children:[!r&&xr("div",{className:co["live-shift-chips"],children:[xr(Io,{color:xo,className:co["panel-button-icon"]}),xr("div",{className:co["panel-button-text"],style:{color:xo},children:n(qa.LIVE)})]}),r&&xr("div",{className:[co["live-shift-button"],a?co.disabled:""].join(" "),onMouseEnter:function(){t.disabled||Hn||(l(to.HOVER),d(!0))},onMouseLeave:function(){l(to.DEFAULT),d(!1)},onClick:function(){i.jumpToLive()},style:c===to.HOVER?{borderColor:Mo(c)[0]}:{},children:[xr(Ro,{color:Mo(c)[0]||xo,className:co["panel-button-icon"]}),xr("div",{className:co["panel-button-text"],style:{color:Mo(c)[0]||xo},children:n(qa.RETURN_TO_LIVE)})]})]})})),Bo=fa((function(t,e){var i=ta(ao),n=ta(no);if(i&&n){var r=n.overflowItems,a=e&&e?e:qr(null),o=Qr(!1),s=o[0],u=o[1],c=xr(Vo,{checkedValue:i.playbackRate,onBack:function(){return u(!1)},levels:Do.map((function(t){return 1===t.val&&(t.label=i.text(qa.PLAYBACK_RATE_NORMAL)),t})),onCheck:function(e){y(e),u(!1),t.onClose()},text:i.text}),l=Qr(!1),h=l[0],d=l[1],f=xr(Vo,{checkedValue:i.currentLevel,onBack:function(){return d(!1)},levels:i.levels,onCheck:function(e){E(e),d(!1),t.onClose()},text:i.text}),p=Qr(!1),_=p[0],v=p[1],A=xr(Vo,{checkedValue:i.currentAudioLevel,onBack:function(){return v(!1)},levels:i.audioLevels,onCheck:function(e){C(e),v(!1),t.onClose()},text:i.text}),g=Qr(!1),m=g[0],b=g[1];Xr((function(){var e=t.showOverflow&&(s||h||_);b(e);var n=a;if(e&&n.current){var r=n.current.getBoundingClientRect().height,o=0;s?o=Do.findIndex((function(t){return t.val===i.playbackRate}))||0:h?o=i.levels.findIndex((function(t){return t.val===i.currentLevel}))||0:_&&(o=i.audioLevels.findIndex((function(t){return t.val===i.currentAudioLevel}))||0),n.current.scrollTop=50*(o+1)-(r-50)/2}!e&&n.current&&(n.current.scrollTop=0)}),[t.showOverflow,s,h,_]),Xr((function(){t.showOverflow||(u(!1),d(!1),v(!1))}),[t.showOverflow]);var y=function(e){i.changePlaybackRate(e),t.onClose()},E=function(e){i.changeLevel(e),t.onClose()},C=function(e){i.changeAudioLevel(e),t.onClose()};return xr("div",{className:[co.overflow,t.className].join(" "),ref:a,style:{maxHeight:t.overflowMaxheight},"data-kp-role":"overflow",children:[s&&c,h&&f,_&&A,i.levels.length>1&&!m&&xr(Fo,{"data-kp-role":"video-btn",onClick:function(t){t.stopPropagation(),d(!0)},children:[i.text(qa.VIDEO_TRACK),xr("span",{style:{paddingLeft:"18px"}})]}),i.audioLevels.length>1&&!m&&xr(Fo,{"data-kp-role":"audio-btn",onClick:function(t){t.stopPropagation(),v(!0)},children:[i.text(qa.AUDIO_TRACK),xr("span",{style:{paddingLeft:"18px"}})]}),i.showPlaybackRateOverflow&&!m&&xr(Fo,{onClick:function(t){t.stopPropagation(),u(!0)},"data-kp-role":"rate-btn",children:[i.text(qa.PLAYBACK_RATE),xr("span",{style:{paddingLeft:"18px"}})]}),r&&!m&&r.map((function(e,i){return xr(Fo,{"data-kp-role":"inline-btn",onClick:function(){t.onClose(),e.handle()},icon:e.icon?e.icon():"",checked:e.isChecked,type:"checkbox",children:e.name},i)}))]})}}));function Vo(t){return xr(hr,{children:[xr(Fo,{onClick:function(e){e.stopPropagation(),t.onBack()},children:t.text(qa.OPTIONS)},0)].concat(t.levels.map((function(e,i){return xr(Fo,{type:"checkbox",checked:t.checkedValue===e.val,onClick:function(){t.onCheck(e.val)},children:e.label},i+1)})))})}function Fo(t){return xr("div",{className:co["overflow-item"],onClick:t.onClick,"data-kp-role":t["data-kp-role"],children:[xr("div",{className:co["overflow-content"],children:xr("span",{children:t.children})}),"checkbox"===t.type&&xr("input",{type:"checkbox",className:co["overflow-checkbox"],checked:t.checked})]})}var jo=fa((function(t,e){var i=t.disabled,n=t.className,r=t.text,a=t.onChildrenVisibilityChange,o=t.tip,s=t.lowTipPos,u=t.resetOnClick,c=t.childrenVisibility,l=e&&e?e:qr(null),h=Qr(to.DEFAULT),d=h[0],f=h[1],p=Qr(!1),_=p[0],v=p[1],A=qr(0),g=Qr(!1),m=g[0],b=g[1];Xr((function(){!1===t.childrenVisibility&&b(!1)}),[t.childrenVisibility]);var y=function(){A.current&&(clearTimeout(A.current),A.current=0)},E=qr(null);return Xr((function(){var e=function(e){if(t.children&&(!("current"in l)||!l.current||l.current!==e.target&&!l.current.contains(e.target))){var i=m;b(!1),t.children&&i&&a&&a(!1,t.id),f(to.DEFAULT)}};return t.children&&document.addEventListener("click",e),function(){return t.children&&document.removeEventListener("click",e)}}),[m]),Xr((function(){(i||!c)&&f(to.DEFAULT)}),[i,c]),Xr((function(){return function(){y()}}),[]),xr("div",{ref:l,"data-kp-role":t["data-kp-role"],onMouseEnter:function(){if(!t.disabled){Hn||(f(to.HOVER),v(!0));var e=!m;b(!0),t.children&&e&&a&&a(!0,t.id),y()}},onMouseLeave:function(){f(to.DEFAULT),v(!1),t.children&&(A.current=+setTimeout((function(){b(!1),a&&a(!1,t.id)}),300))},onMouseMove:function(){if(!t.disabled){Hn||(f(to.HOVER),v(!0));var e=!m;b(!0),t.children&&e&&a&&a(!0,t.id),y()}},onClick:function(e){!i&&t.onClick&&t.onClick(e),(u||E.current&&e.target&&E.current.contains(e.target))&&(v(!1),Hn||f(to.DEFAULT))},className:[co["panel-button-wrapper"],n,i?co.disabled:""].join(" "),children:[m&&t.children,o&&_&&xr("div",{"data-kp-role":t["data-kp-role"]?t["data-kp-role"]+"-tip":"btn-tip",className:[co["panel-button-tip"],s?co["panel-button-tip-low-pos"]:""].join(" "),children:xr("div",{className:co.text,children:o})}),t.icon&&t.icon(d),r&&xr("div",{className:co["panel-button-text"],style:{color:t.color?t.color(d):xo},children:r})]})}));function Ho(t){var e=ta(ao),i=ta(So);if(!e||!i)return xr(hr,{});var n=e.deps,r=n.pluginRotate,a=n.pluginPreview,o=qr(null),s=qr(0),u=Qr(0),c=u[0],l=u[1],h=Qr(!1),d=h[0],f=h[1],p=Qr(0),_=p[0],v=p[1];Xr((function(){if(b.current){var t=b.current.getBoundingClientRect().width;v(t/2)}})),Xr((function(){!1===t.previewVisibility&&(g.current=!1,S())}),[t.previewVisibility]);var A=function(e){if(g.current&&!t.disabled&&o){e.defaultPrevented&&e.preventDefault();var i=e instanceof MouseEvent?e.clientX:e.changedTouches[0].clientX,n=e instanceof MouseEvent?e.clientY:e.changedTouches[0].clientY,a=o.current,u=o.current;if((g||e instanceof PointerEvent||Hn&&e instanceof MouseEvent)&&a&&u){var c=0,h=u.getBoundingClientRect(),d=h.top,f=h.left,p=h.width,_=h.height;90===(null==r?void 0:r.outerRotate)?c=(n-d)/_:180===(null==r?void 0:r.outerRotate)?c=(p-(i-f))/p:270===(null==r?void 0:r.outerRotate)?c=(_-(n-d))/_:null!=r&&r.outerRotate||(c=(i-f)/p),c>1&&(c=1),c<0&&(c=0),N(c),s.current=c,l(100*c),t.onChange&&t.onChange(c)}}};Xr((function(){var e=function(){g.current&&t.onChangeEnd&&t.onChangeEnd(s.current),g.current=!1,m.current||O()},i=function(){m.current=!1,e()},n=function(t){A(t)};return document.addEventListener("mouseup",e),document.addEventListener("mouseleave",i),document.addEventListener("touchend",e),document.addEventListener("mousemove",n,!0),document.addEventListener("touchmove",n,!0),function(){document.removeEventListener("mouseup",e),document.removeEventListener("mouseleave",i),document.removeEventListener("touchend",e),document.removeEventListener("mousemove",n,!0),document.removeEventListener("touchmove",n,!0)}}),[e,i]);var g=qr(!1),m=qr(!1),b=qr(null),y=function(e){t.disabled||(g.current=!0,e.stopImmediatePropagation(),A(e))},E=function(e){if(!t.disabled&&e instanceof MouseEvent){m.current=!0;var i=e.currentTarget.getBoundingClientRect(),n=i.left,r=i.width,a=(e.clientX-n)/r;g.current||N(a),t.onMouseMove&&t.onMouseMove(a,g.current)}},C=function(){m.current=!1,t.onMouseLeave&&t.onMouseLeave(g.current),g.current||O()},T=qr(null),I=qr(null),R=Qr(""),w=R[0],L=R[1],D=qr(0),S=function(){D.current&&(clearTimeout(D.current),D.current=0)},O=function(){S();var e=T.current&&"hidden"!==T.current.style.visibility;T.current&&(T.current.style.visibility="hidden",T.current.style.display="block"),e&&t.onPreviewVisibilityChange&&t.onPreviewVisibilityChange(!1,t.id)},N=function(t){if(!Hn&&(null!=a&&a.hasPreview||e.showProgressTime)){var n=o.current,s=i.duration,u=a,c=T.current;if(n&&Number.isFinite(s)&&c&&I.current&&(null==r||!r.outerRotate)){var l,h=n.getBoundingClientRect().width,d=t*s;if(d<0&&(d=0),d>s&&(d=s),null!=a&&a.hasPreview){if(l=null==u?void 0:u.getImgByTime(d),f(!!l),!l&&!e.showProgressTime)return}else f(!1);var p=h*t;"hidden"!==c.style.visibility?k(c,I.current,l,d,p,h):D.current||(D.current=+setTimeout((function(){D.current=0,I.current&&k(c,I.current,l,d,p,h)}),300))}}},k=function(e,n,r,a,o,s){if(L(Gn(a,i.duration>=3600)),r){var u=144/r.h;e.style.width=r.w*u/24+"em",e.style.height=r.h*u/24+"em",n.style.transform="scale("+e.getBoundingClientRect().width/r.w+")",n.style.backgroundImage="url("+r.url+")",n.style.height=r.h+"px",n.style.width=r.w+"px",n.style.backgroundPosition="-"+r.x+"px -"+r.y+"px"}else e.style.width="",e.style.height="",n.style.transform="",n.style.backgroundImage="",n.style.height="",n.style.width="",n.style.backgroundPosition="";var c=e.getBoundingClientRect().width;(o-=c/2)<0?o=0:o>s-c&&(o=s-c);var l="visible"===e.style.visibility;e.style.transform="translateX("+o+"px)",e.style.visibility="visible",l&&t.onPreviewVisibilityChange&&t.onPreviewVisibilityChange(!0,t.id)};return Xr((function(){return function(){S()}}),[]),xr("div",{"data-kp-role":t["data-kp-role"],className:[co["segmented-track"],t.disabled?co.disabled:"",t.className].join(" "),style:{cursor:Hn?"default":""},ref:o,onMouseLeave:C,onMouseDown:y,onMouseMove:E,onMouseEnter:E,onTouchStart:y,onTouchMove:E,onTouchEnd:C,onClick:E,children:[xr("div",{ref:T,style:{visibility:"hidden"},className:co.preview,children:[xr("div",{ref:I,className:co["preview-img"]}),xr("div",{className:[co["preview-time"],d?"":co["preview-time-no-img"]].join(" "),children:xr("div",{children:w})})]}),xr("div",{className:[co["segment-background"]].join(" "),children:[xr("div",{className:co["segment-highlight-before"],style:{width:i.bufferedPercent+"%"}}),xr("div",{className:co["segment-highlight-after"],style:{width:(g.current?c:i.currentTimePercent)+"%"}})]}),!t.disabled&&xr("div",{className:[co.thumb,g.current?co["thumb-drag"]:""].join(" "),ref:b,style:{left:"calc("+(g.current?c:i.currentTimePercent)+"% - "+_+"px)"}})]})}function Go(t){var e=ta(ao);if(!e)return xr(hr,{});var i=e.deps.pluginRotate,n=qr(null),r=qr(null),a=Jr((function(){return 100-t.leftWidth}),[t.beforeWidth,t.leftWidth]),o=Qr(!1),s=o[0],u=o[1],c=function(t){u(!0),l(t,!0)},l=function(e,r){void 0===r&&(r=!1),e.preventDefault();var a=e instanceof MouseEvent?e.clientX:e.changedTouches[0].clientX,o=e instanceof MouseEvent?e.clientY:e.changedTouches[0].clientY,c=n.current,l=n.current;if((s||r||e instanceof PointerEvent||Hn&&e instanceof MouseEvent)&&c&&l){var h=c.getBoundingClientRect(),d=h.left,f=h.right;if(a<d||a>f)u(!1);else{var p=0,_=l.getBoundingClientRect(),v=_.top,A=_.left,g=_.width,m=_.height;p=90===(null==i?void 0:i.outerRotate)?parseFloat(((g-(a-A))/g).toFixed(2)):180===(null==i?void 0:i.outerRotate)?parseFloat(((m-(o-v))/m).toFixed(2)):270===(null==i?void 0:i.outerRotate)?parseFloat(((a-A)/g).toFixed(2)):parseFloat(((o-v)/m).toFixed(2)),t.onChange&&t.onChange(1-p)}}},h=function(){u(!1)};return xr("div",{"data-kp-role":t["data-kp-role"],className:[co["segmented-vertical-track"],t.className].join(" "),style:{cursor:Hn?"default":"pointer"},ref:n,onMouseUp:function(){u(!1)},onMouseLeave:h,onMouseDown:c,onMouseMove:l,onTouchStart:c,onTouchMove:l,onTouchEnd:h,onClick:l,children:[xr("div",{className:co["segment-vertical-background"],children:[xr("div",{className:co["segment-vertical-highlight-before"],style:{height:t.beforeWidth+"%"}}),xr("div",{className:co["segment-vertical-highlight-after"],style:{height:t.leftWidth+"%"}})]}),xr("div",{className:co["thumb-vertical"],ref:r,style:{top:a+"%"}})]})}function zo(t){return xr("div",{className:[co.tooltip,t.lowTipPos?co["tooltip-low-pos"]:""].join(" "),children:xr("div",{children:t.text})})}var Wo=function(t){var e,i,n,r=ta(ao),a=ta(So),o=ta(No),s=ta(no);if(!(r&&a&&o&&s))return xr(hr,{});var u=r.player,c=r.text,l=r.disabled,h=r.deps.options,d=o.setPanelHover,f=o.floatLayerId,p=o.setFloatLayerId,_=o.container,v=qr(null),A=Jr((function(){return t.showPanel&&!(Hn&&r.error)}),[t.showPanel,r.error]);Xr((function(){r.deps.options.stateChange&&r.deps.options.stateChange({type:"controlsVisibility",value:A})}),[A]),Xr((function(){var t,e,i=function(t){var e;null!=(e=B.current)&&e.contains(t.target)||p(0)},n=function(){Hn||d(!0)},r=function(){d(!1)};return document.addEventListener("click",i),null==(t=v.current)||t.addEventListener("mouseenter",n),null==(e=v.current)||e.addEventListener("mouseleave",r),function(){var t,e;document.removeEventListener("click",i),null==(t=v.current)||t.removeEventListener("mouseenter",n),null==(e=v.current)||e.removeEventListener("mouseleave",r)}}),[]);var g=function(t){a.seek(t)},m=qr(null),b=qr(null),y=qr(null),E=qr(null),C=qr(null),T=qr(null),I=qr(null),R=qr(null),w=qr(null),L=qr(null),D=qr(null),S=qr(null),O=qr(null),N=function(){if(o.width&&b.current&&m.current&&K.current&&W.current){var t=W.current.getBoundingClientRect().width,e=[K,E,C,T,D,S,I,y,R,w,L,O];if(!m.current.getBoundingClientRect().width)return;e.forEach((function(t){t.current&&(t.current.style.display="")}));var i=b.current.getBoundingClientRect().width+m.current.getBoundingClientRect().width+K.current.getBoundingClientRect().width;e.forEach((function(e){if(e.current&&i>t){var n=e.current?5*Math.ceil(k(e.current)/5):0;i-=n,e.current.style.display="none"}}))}},k=function(t){var e=getComputedStyle(t);return t.getBoundingClientRect().width+(parseFloat(e.marginLeft)||0)+(parseFloat(e.marginRight)||0)},x=Jr((function(){return Hn&&(r.audioLevels.length>1||r.levels.length>1||r.showPlaybackRateOverflow||s.overflowItems.length>0)}),[r.audioLevels,r.levels,r.showPlaybackRate,s.overflowItems]);Zr((function(){N()}),[o.width,r.levels,r.audioLevels,r.showFullScreen,r.showPlaybackRate,r.showProgress,r.showTime,r.showPictureInPicture,r.isLive,a.duration]),Xr((function(){t.showPanel?setTimeout(N,0):p(0)}),[t.showPanel]),Xr((function(){p(0)}),[r.error]);var P=Qr(250),M=P[0],U=P[1];Xr((function(){if(D.current){var t=D.current.getBoundingClientRect().top,e=_.getBoundingClientRect().top;U(Math.min(t-e-15,250))}else U(250)}),[o.height,f]);var B=qr(null),V=Qr(""),F=V[0],j=V[1],H=qr(0),G=function(){H.current&&(clearTimeout(H.current),H.current=0)},z=function(t){for(var e,i=null==u?void 0:u.getAllPlugins(),n=[],a=0;a<(i.length||0);a++)i[a].controlsSoltBtns&&(null==(e=i[a].controlsSoltBtns)||e.forEach((function(e){var i=e.svgRaw;e.slotPos===t&&i&&n.push(xr(jo,{icon:function(t){return xr("div",{style:{color:Mo(t)[0]},className:co["panel-button-icon-plugin"],dangerouslySetInnerHTML:{__html:i}})},className:co["panel-button-margins-left"],color:function(t){return Mo(t)[0]},onClick:e.onClick,disabled:l,tip:e.getTips?e.getTips():"",lowTipPos:!r.showProgress,"data-kp-role":e.role}))})));return n};Xr((function(){return F&&(G(),H.current=+setTimeout((function(){j("")}),3e3)),function(){G()}}),[F]),Xr((function(){r.muted?a.duration>0&&j(c(qa.CURRENTLY_MUTED)):j(c(qa.CURRENT_VOLUME)+":"+Math.floor(100*r.volume))}),[r.volume]),Zr((function(){var t=function(){var t,e;r.levels.length<2||null!=(t=r.levels.find((function(t){return t.val===u.currentLevel})))&&t.label&&j(c(qa.SWITCHING_TO_VIDEO)+" "+((null==(e=r.levels.find((function(t){return t.val===r.currentLevel})))?void 0:e.label)||""))},e=function(){var t,e;r.levels.length<2||null!=(t=r.levels.find((function(t){return t.val===u.currentLevel})))&&t.label&&j(c(qa.SWITCH_TO_VIDEO)+" "+((null==(e=r.levels.find((function(t){return t.val===u.currentLevel})))?void 0:e.label)||"")+" "+c(qa.FAIL))},i=function(){var t,e;r.levels.length<2||null!=(t=r.levels.find((function(t){return t.val===u.currentLevel})))&&t.label&&j(c(qa.SWITCHED_TO_VIDEO)+" "+((null==(e=r.levels.find((function(t){return t.val===u.currentLevel})))?void 0:e.label)||""))},n=function(t){var e;r.audioLevels.length<2||j(c(qa.SWITCHING_TO_AUDIO)+" "+((null==(e=r.audioLevels.find((function(e){return e.val===t.level})))?void 0:e.label)||""))},a=function(t){var e;r.audioLevels.length<2||j(c(qa.SWITCHED_TO_AUDIO)+" "+((null==(e=r.audioLevels.find((function(e){return e.val===t.level})))?void 0:e.label)||""))};return u.on(Qa.LEVEL_SWITCHING,t),u.on(Qa.LEVEL_SWITCH_FAILED,e),u.on(Qa.LEVEL_SWITCH_PLAYING,i),u.on(Qa.AUDIO_TRACKS_SWITCHING,n),u.on(Qa.AUDIO_TRACKS_SWITCHED,a),function(){u.off(Qa.LEVEL_SWITCHING,t),u.off(Qa.LEVEL_SWITCH_FAILED,e),u.off(Qa.LEVEL_SWITCH_PLAYING,i),u.off(Qa.AUDIO_TRACKS_SWITCHING,n),u.off(Qa.AUDIO_TRACKS_SWITCHED,a)}}),[r.levels]);var W=qr(null),K=qr(null);Xr((function(){var e=t.danmakuControls();K.current&&e&&(t.dankamuControlsActive?K.current.appendChild(e):K.current.innerHTML="")}),[t.dankamuControlsActive]);var Y=function(t,e){void 0===e&&(e=0),p(t?e:0)};return Xr((function(){return function(){G()}}),[]),xr("div",{ref:v,style:{opacity:A?1:0},className:co["bottom-controls"],children:[xr("div",{className:co["bottom-controls-bg"]}),r.showProgress&&xr(Ho,{"data-kp-role":"timeline",disabled:l,className:co.timeline,onChange:function(t){Number.isFinite(a.duration)&&u.emit(Qa.INTERACTION,{type:"progresschange",data:{time:t*a.duration}}),"onDragChange"===h.seekMode&&g(t*a.duration)},onChangeEnd:function(t){"onDragChange"!==h.seekMode&&g(t*a.duration)},id:1,previewVisibility:1===f,onPreviewVisibilityChange:Y}),h.showBottomButtonBar&&xr("div",{ref:W,className:co["button-panel"],children:[xr("div",{ref:m,className:co["button-panel-left"],children:[xr(jo,{icon:r.paused?function(t){return xr(ho,{color:Mo(t)[0],className:co["panel-button-icon"]})}:function(t){return xr(fo,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},onClick:r.togglePlay,disabled:l,lowTipPos:!r.showProgress,"data-kp-role":"play-btn"}),r.showTime&&xr("div",{ref:y,className:co["current-time-display"],children:xr("div",{children:Gn(a.currentTime,a.duration>=3600)})}),a.duration!==1/0&&!isNaN(a.duration)&&r.showTime&&xr("div",{ref:I,className:co["time-remaining-display"],children:xr("div",{children:["/ ",Gn(a.duration,a.duration>=3600)]})}),r.liveShiftEnabled&&xr(Uo,{className:[co["panel-button-margins-left"],co["live-shift"]].join(" "),"data-kp-role":"live-shift-btn",disabled:l}),z(za.PLAY_BAR_LEFT)]}),xr("div",{ref:K,className:co["button-panel-center"]}),xr("div",{ref:b,className:co["button-panel-right"],children:[r.audioLevels.length>1&&!Hn&&xr(jo,{ref:E,text:(null==(e=r.audioLevels.find((function(t){return t.val===r.currentAudioLevel})))?void 0:e.label)||"",id:4,childrenVisibility:4===f,onChildrenVisibilityChange:Y,className:co["panel-button-margins-left"],color:function(t){return Mo(t)[0]},children:xr("div",{className:co["bottom-popup-layer"],children:xr("div",{className:[co["panel-playback-list"],r.showProgress?"":co["bottom-popup-layer-low-pos"]].join(" "),children:r.audioLevels.map((function(t,e){return xr("div",{className:co["playback-rate"],onClick:function(){r.changeAudioLevel(t.val),p(0)},children:xr("div",{children:t.label})},e)}))})})}),r.levels.length>1&&!Hn&&xr(jo,{ref:C,text:(null==(i=r.levels.find((function(t){return t.val===r.currentLevel})))?void 0:i.label)||"",id:3,childrenVisibility:3===f,onChildrenVisibilityChange:Y,className:co["panel-button-margins-left"],color:function(t){return Mo(t)[0]},children:xr("div",{className:co["bottom-popup-layer"],children:xr("div",{className:[co["panel-playback-list"],r.showProgress?"":co["bottom-popup-layer-low-pos"]].join(" "),children:r.levels.map((function(t,e){return xr("div",{className:co["playback-rate"],onClick:function(){r.changeLevel(t.val),p(0)},children:xr("div",{children:t.label})},e)}))})})}),r.showPlaybackRate&&xr(jo,{ref:T,"data-kp-role":"play-rate",id:2,childrenVisibility:2===f,onChildrenVisibilityChange:Y,text:1===r.playbackRate?c(qa.PLAYBACK_RATE_SHORT):(null==(n=Do.find((function(t){return t.val===r.playbackRate})))?void 0:n.label)||r.playbackRate.toString(),disabled:l,className:co["panel-button-margins-left"],color:function(t){return Mo(t)[0]},children:xr("div",{className:co["bottom-popup-layer"],children:xr("div",{className:[co["panel-playback-list"],r.showProgress?"":co["bottom-popup-layer-low-pos"]].join(" "),children:Do.map((function(t,e){return 1===t.val&&(t.label=c(qa.PLAYBACK_RATE_NORMAL)),xr("div",{className:co["playback-rate"],"data-kp-role":"playrate-item",onClick:function(){u.logger.i("ui-panel","playback rate",t.val),p(0),r.changePlaybackRate(t.val)},children:xr("div",{children:t.label})},e)}))})})}),r.showRefresh&&xr(jo,{ref:R,icon:function(t){return xr(yo,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},onClick:r.refresh,tip:c(qa.REFRESH),lowTipPos:!r.showProgress,className:co["panel-button-margins-left"],disabled:l,"data-kp-role":"refresh-btn"}),z(za.PLAY_BAR_RIGHT),xr(jo,{ref:O,icon:r.muted?function(t){return xr(bo,{color:Mo(t)[0],className:co["panel-button-icon"]})}:function(t){return xr(po,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},"data-kp-role":"mute-btn",id:5,childrenVisibility:5===f,onChildrenVisibilityChange:Y,onClick:function(t){B.current&&(B.current===t.target||B.current.contains(t.target))||r.toggleMuted()},className:co["panel-button-margins-left"],disabled:l,children:!Hn&&xr("div",{className:co["bottom-popup-layer"],children:xr("div",{className:[co["panel-volume-wrapper"],r.showProgress?"":co["bottom-popup-layer-low-pos"]].join(" "),ref:B,"data-kp-role":"volume-panel",children:[xr("div",{className:co["volume-text"],children:(100*r.volume).toFixed(0)}),xr(Go,{"data-kp-role":"volume-track",leftWidth:100*r.volume,beforeWidth:100*r.volume,onChange:r.changeVolume})]})})}),r.showPictureInPicture&&xr(jo,{ref:S,icon:r.isInPIP?function(t){return xr(To,{color:Mo(t)[0],className:co["panel-button-icon"]})}:function(t){return xr(Co,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},onClick:r.changePIP,disabled:l,tip:r.isInPIP?c(qa.EXIT_PICTURE_IN_PICTURE):c(qa.PICTURE_IN_PICTURE),lowTipPos:!r.showProgress,className:co["panel-button-margins-left"],"data-kp-role":"picture-in-picture-btn"}),!r.isFullscreen&&r.showWindowFullScreen&&xr(jo,{ref:L,icon:r.isWindowFullscreen?function(t){return xr(go,{color:Mo(t)[0],className:co["panel-button-icon"]})}:function(t){return xr(Ao,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},onClick:r.toggleWindowFullscreen,disabled:l,tip:r.isWindowFullscreen?c(qa.EXIT_WINDOW_FULLSCREEN):c(qa.WINDOW_FULLSCREEN),lowTipPos:!r.showProgress,className:co["panel-button-margins-left"],"data-kp-role":"window-fullscreen-btn",resetOnClick:!0}),r.showFullScreen&&!Hn&&xr(jo,{ref:w,icon:r.isFullscreen?function(t){return xr(vo,{color:Mo(t)[0],className:co["panel-button-icon"]})}:function(t){return xr(_o,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},onClick:r.toggleFullscreen,disabled:l,tip:r.isFullscreen?c(qa.EXIT_FULLSCREEN):c(qa.FULLSCREEN),lowTipPos:!r.showProgress,className:co["panel-button-margins-left"],"data-kp-role":"fullscreen-btn",resetOnClick:!0}),x&&xr(jo,{ref:D,icon:function(t){return xr(mo,{color:Mo(t)[0],className:co["panel-button-icon"]})},color:function(t){return Mo(t)[0]},"data-kp-role":"overflow-btn",onClick:function(t){t.stopPropagation(),p(6===f?0:6)},className:co["panel-button-margins-left"],disabled:l}),Hn&&xr(Bo,{className:co.overflow+" "+(6===f?"":co.closed),overflowMaxheight:M,showOverflow:6===f,onClose:function(){return p(0)}})]})]}),F&&xr(zo,{text:F,lowTipPos:!r.showProgress})]})};function Ko(t){var e=ta(ao);if(!e)return xr(hr,{});var i=e.player,n=e.text,r=e.deps,a=r.options,o=r.pluginVr,s=r.pluginDanmaku,u=Qr(!1),c=u[0],l=u[1],h=Qr(!1),d=h[0],f=h[1],p=Qr(""),_=p[0],v=p[1],A=Qr(0),g=A[0],m=A[1],b=qr(void 0),y=Qr(t.container.getBoundingClientRect().width),E=y[0],C=y[1],T=Qr(t.container.getBoundingClientRect().height),I=T[0],R=T[1];Zr((function(){setTimeout((function(){b.current=null==s?void 0:s.getControlPanelDom()}),0);var e=function(){nt(!1)};document.addEventListener("click",e);var i=new uo;return i.start(t.container,[t.container],(function(t){return t.forEach((function(t){C(t.contentRect.width),R(t.contentRect.height)}))})),w.current&&t.videoLayer&&t.videoInteractive&&(w.current.insertAdjacentElement("afterbegin",t.videoInteractive),w.current.insertAdjacentElement("afterbegin",t.videoLayer)),function(){document.removeEventListener("click",e),b.current=void 0,i.stop()}}),[]);var w=qr(null),L=Qr(!0),D=L[0],S=L[1];Xr((function(){return w.current&&t.videoLayer&&t.videoInteractive&&(t.videoInteractive.addEventListener("click",V),t.videoInteractive.addEventListener("dblclick",F)),function(){t.videoInteractive&&(t.videoInteractive.removeEventListener("click",V),t.videoInteractive.removeEventListener("dblclick",F))}}),[e,D,g]),Xr((function(){var t=i.mainContainer;t&&(e.isFullscreen?t.style.display="flex":t.style.display="")}),[e.isFullscreen]);var O=qr(0),N=Qr(2),k=N[0],x=N[1],P=function(){x(2),O.current&&(clearTimeout(O.current),O.current=0)},M=function(){P(),x(0),O.current=+setTimeout((function(){x(1)}),3e3)},U=Jr((function(){var t;return!(e.paused||e.error||_||g||d||null!=(t=w.current)&&t.contains(document.activeElement))}),[e.paused,e.error,_,g,d]);Xr((function(){1===k&&(U?(x(2),S(!1)):M())}),[k]),Xr((function(){U&&S(!1)}),[e.error,_,d]),Xr((function(){!c&&U&&S(!1)}),[g]),Xr((function(){U&&2===k&&S(!1)}),[e.paused]);var B=function(){P(),S(!0)};Zr((function(){return M(),i.on(Qa.PAUSE,B),i.on(Qa.ERROR,B),function(){i.off(Qa.PAUSE,B),i.off(Qa.ERROR,B)}}),[]);var V=function(){!i.controls||W.current||(M(),Hn?U&&(D?(S(!1),P()):(S(!0),M())):!e.disabled&&(null==o||!o.active)&&e.togglePlay())},F=function(){var t,n;i.controls&&(e.toggleFullscreen(),window.getSelection?null==(t=window.getSelection())||t.removeAllRanges():null==(n=document.getSelection())||n.empty())},j=Qr(void 0),H=j[0],G=j[1],z=function(e,i){if(null!=o&&o.active&&H){var n=t.container.getBoundingClientRect(),r=n.width,a=n.height;o.yAxis=H.vrY-(e-H.interactiveX)/r*Math.PI/2,o.xAxis=H.vrX+(i-H.interactiveY)/a*Math.PI/2}},W=qr(null),K=Qr(0),Y=K[0],Q=K[1],X=Qr(0),Z=X[0],q=X[1],J=Qr(!1),$=J[0],tt=J[1];Xr((function(){var i=function(e){var i;null!=(i=W.current)&&i.contains(e.target)||(e.preventDefault(),tt(!1),nt(!0),setTimeout((function(){if(W.current&&t.container){var i=t.container.getBoundingClientRect(),n=i.width,r=i.height,a=i.left,o=i.top,s=W.current.getBoundingClientRect(),u=s.width,c=s.height;Q(Math.min(e.clientX-a+5,n-u)),q(Math.min(e.clientY-o+5,r-c)),tt(!0)}}),0))};return e.controls&&e.showContextMenu&&t.container.addEventListener("contextmenu",i),function(){return t.container.removeEventListener("contextmenu",i)}}),[e.controls]);var et=Qr(!1),it=et[0],nt=et[1],rt=function(){var t=!(!s||!0===i.disableDanmaku),n=e.isFullscreen||e.isWindowFullscreen,r=a.danmakuControls,o=a.danmakuControlsFull;st(!Hn&&t&&(n?o===Ga.PLAY_BAR:r===Ga.PLAY_BAR));var u=!Hn&&t&&(n?o===Ga.BOTTOM:r===Ga.BOTTOM);ht(u);var c=b.current;c&&u&&ut.current&&s&&(c.classList.add(co["sending-area-controls"]),ut.current.appendChild(c))},at=Qr(!1),ot=at[0],st=at[1],ut=qr(null),ct=Qr(!1),lt=ct[0],ht=ct[1];return Xr((function(){return i.on(Qa.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS,rt),i.on(Qa.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN,rt),i.on(Qa.ATTRIBUTE_CHANGE_DISABLE_DANMAKU,rt),function(){i.off(Qa.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS,rt),i.off(Qa.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN,rt),i.off(Qa.ATTRIBUTE_CHANGE_DISABLE_DANMAKU,rt)}}),[]),Xr(rt,[e.isFullscreen,e.isWindowFullscreen,Hn,lt]),Xr((function(){return function(){P()}}),[]),xr(hr,{children:[xr("div",{ref:w,className:co["video-area"],onMouseDown:function(t){null!=o&&o.active&&G({vrX:o.xAxis,vrY:o.yAxis,interactiveX:t.clientX,interactiveY:t.clientY})},onMouseUp:function(){G(void 0)},onTouchStart:function(t){null!=o&&o.active&&G({vrX:o.xAxis,vrY:o.yAxis,interactiveX:t.changedTouches[0].clientX,interactiveY:t.changedTouches[0].clientY})},onTouchEnd:function(){G(void 0)},onTouchMove:function(t){B(),M(),null!=o&&o.active&&H&&(z(t.changedTouches[0].clientX,t.changedTouches[0].clientY),t.preventDefault())},onMouseMove:function(t){Hn||(l(!0),B(),M(),null!=o&&o.active&&H&&(t.preventDefault(),z(t.clientX,t.clientY)))},onMouseLeave:function(){l(!1),G(void 0),U&&(P(),S(!1))},children:[e.controls&&e.waiting&&xr(Lo,{}),e.controls&&it&&!Hn&&xr(lo,{ref:W,visible:$,onChangeShowContextMenu:function(){nt(!it)},left:Y,top:Z}),e.controls&&e.error&&xr(wo,{text:n,code:e.error.code,message:e.error.message}),e.controls&&xr(ko,{panelHover:d,setPanelHover:f,dragProgress:_,setDragProgress:v,floatLayerId:g,setFloatLayerId:m,width:E,height:I,container:t.container,children:xr(Oo,{deps:e.deps,children:xr(Wo,{style:{},dankamuControlsActive:ot,danmakuControls:function(){return b.current},showPanel:D})})})]}),lt&&xr("div",{ref:ut,className:co["sending-area"]})]})}var Yo=function(){return _()((function(t,e){var i=this;Pa(this,"_label"),Pa(this,"_player"),Pa(this,"_i18n"),Pa(this,"_rotate"),Pa(this,"_preview"),Pa(this,"_vr"),Pa(this,"_danmaku"),Pa(this,"_options",{}),Pa(this,"text",(function(t){var e;return(null==(e=i._i18n)?void 0:e.text(i._label,t))||Ja[t]||""})),this._label=t,this._player=e,this._i18n=e.getPluginInstance(Ba),this._rotate=e.getPluginInstance(Va),this._preview=e.getPluginInstance(Fa),this._vr=e.getPluginInstance(ja),this._danmaku=e.getPluginInstance(Ha)}),[{key:"player",get:function(){return this._player}},{key:"pluginRotate",get:function(){return this._rotate}},{key:"pluginPreview",get:function(){return this._preview}},{key:"pluginVr",get:function(){return this._vr}},{key:"pluginDanmaku",get:function(){return this._danmaku}},{key:"options",get:function(){return this._options},set:function(t){this._options=t}}])}(),Qo=function(t){function e(){var e;return e=t.call(this)||this,Pa(c()(e),"_player"),Pa(c()(e),"container"),Pa(c()(e),"_videoInteractive"),Pa(c()(e),"_videoLayer"),Pa(c()(e),"_danmaku"),Pa(c()(e),"_deps"),Pa(c()(e),"_onSrcChange",(function(){var t;if(!e.container)throw new Error("container is undefined");var i=null==(t=e._player)?void 0:t.mainContainer;i&&e._videoLayer&&(null==i||i.appendChild(e._videoLayer)),Or(null,e.container),e._player&&e._renderUI()})),e}f()(e,t);var i=e.prototype;return i.beforeInstall=function(t){this._player=t,this._deps=new Yo(this.getLabel(),t),this._danmaku=this._deps.pluginDanmaku,t.on(Qa.ATTRIBUTE_CHANGE_SRC,this._onSrcChange)},i.afterInstall=function(t,e){if(this._player=t,!t)throw new Error("player is undefined");if(this._deps&&(this._deps.options={danmakuControls:!!this._danmaku&&(null==e?void 0:e.danmakuControlsPos)||Ga.NONE,danmakuControlsFull:!!this._danmaku&&(null==e?void 0:e.danmakuControlsPosFullscreen)||Ga.PLAY_BAR,showBottomButtonBar:!1!==(null==e?void 0:e.showBottomButtonBar),showProgress:null==e?void 0:e.showProgress,showTime:!1!==(null==e?void 0:e.showTime),showNext:null==e?void 0:e.showNext,showPrev:null==e?void 0:e.showPrev,showWindowFullScreen:null==e?void 0:e.showWindowFullScreen,seekMode:null==e?void 0:e.seekMode,showProgressTime:null==e?void 0:e.showProgressTime,showPlaybackRate:null==e?void 0:e.showPlaybackRate,showContextMenu:null==e?void 0:e.showContextMenu,stateChange:null==e?void 0:e.stateChange}),this.container=t.createSubContainer(),this._videoInteractive=t.videoInteractiveLayer,this._videoLayer=t.videoLayer,!this.container)throw new Error("container is undefined");this.container.className=co.controls,this._renderUI()},i.beforeUninstall=function(){this.container&&Or(null,this.container)},i.afterUninstall=function(){this._player&&this._player.off(Qa.ATTRIBUTE_CHANGE_SRC,this._onSrcChange)},i._renderUI=function(){this.container&&this._deps&&Or(xr(ro,{deps:this._deps,children:xr(so,{deps:this._deps,children:xr(Ko,{container:this.container,videoLayer:this._videoLayer,videoInteractive:this._videoInteractive})})}),this.container)},e}(Ya);Pa(Qo,"version","1.1.0-alpha.0");var Xo=[{lang:"en",map:(a={},a[Qn]=(r={},r[qa.PLAY]="Play",r[qa.PAUSE]="Pause",r[qa.REFRESH]="Refresh",r[qa.NEXT]="Next",r[qa.TURN_ON_LOOP]="Turn on loop",r[qa.TURN_OFF_LOOP]="Turn off loop",r[qa.LOOP]="Loop",r[qa.PLAYBACK_RATE_NORMAL]="Normal",r[qa.OPTIONS]="Options",r[qa.DOWNLOAD]="Download",r[qa.VIDEO_TRACK]="Video tracks",r[qa.AUDIO_TRACK]="Audio tracks",r[qa.PLAYBACK_RATE]="Playback speed",r[qa.PLAYBACK_RATE_SHORT]="Speed",r[qa.PICTURE_IN_PICTURE]="Picture in picture",r[qa.EXIT_PICTURE_IN_PICTURE]="Exit picture in picture",r[qa.PLAY_INFO]="Play info",r[qa.MIRROR_IMAGE]="Mirror image",r[qa.ROTATE]="Rotate",r[qa.FULLSCREEN]="Fullscreen",r[qa.EXIT_FULLSCREEN]="Exit fullscreen",r[qa.WINDOW_FULLSCREEN]="Window fullscreen",r[qa.EXIT_WINDOW_FULLSCREEN]="Exit window fullscreen",r[qa.AUTO]="Auto",r[qa.CURRENT_VOLUME]="Current volume",r[qa.CURRENTLY_MUTED]="Currently muted",r[qa.SWITCH_TO_VIDEO]="Switch to",r[qa.SWITCHING_TO_VIDEO]="Switching to",r[qa.SWITCHED_TO_VIDEO]="Switched to",r[qa.SWITCH_TO_AUDIO]="Switch to",r[qa.SWITCHING_TO_AUDIO]="Switching to",r[qa.SWITCHED_TO_AUDIO]="Switched to",r[qa.FAIL]="Fail",r[qa.ERROR_PANEL_TITLE]="Video loading failed, please try again later.",r[qa.LIVE]="Live",r[qa.RETURN_TO_LIVE]="Return to Live",r[qa.ERROR_PANEL_RETRY_BTN]="Click Retry",r),a)},{lang:"es",map:(s={},s[Qn]=(o={},o[qa.PLAY]="Reproducir",o[qa.PAUSE]="Pausa",o[qa.REFRESH]="Actualizar",o[qa.NEXT]="Siguiente",o[qa.TURN_ON_LOOP]="Activar bucle",o[qa.TURN_OFF_LOOP]="Desactivar bucle",o[qa.LOOP]="Bucle",o[qa.PLAYBACK_RATE_NORMAL]="Normal",o[qa.OPTIONS]="Opciones",o[qa.DOWNLOAD]="Descargar",o[qa.VIDEO_TRACK]="Pistas de video",o[qa.AUDIO_TRACK]="Pistas de audio",o[qa.PLAYBACK_RATE]="Velocidad de reproducción",o[qa.PLAYBACK_RATE_SHORT]="Velocidad",o[qa.PICTURE_IN_PICTURE]="Imagen en imagen",o[qa.EXIT_PICTURE_IN_PICTURE]="Salir de imagen en imagen",o[qa.PLAY_INFO]="Información de reproducción",o[qa.MIRROR_IMAGE]="Imagen espejo",o[qa.ROTATE]="Rotar",o[qa.FULLSCREEN]="Pantalla completa",o[qa.EXIT_FULLSCREEN]="Salir de pantalla completa",o[qa.WINDOW_FULLSCREEN]="Pantalla completa de ventana",o[qa.EXIT_WINDOW_FULLSCREEN]="Salir de pantalla completa de ventana",o[qa.AUTO]="Automático",o[qa.CURRENT_VOLUME]="Volumen actual",o[qa.CURRENTLY_MUTED]="Actualmente silenciado",o[qa.SWITCH_TO_VIDEO]="Cambiar a video",o[qa.SWITCHING_TO_VIDEO]="Cambiando a video",o[qa.SWITCHED_TO_VIDEO]="Cambiado a video",o[qa.SWITCH_TO_AUDIO]="Cambiar a audio",o[qa.SWITCHING_TO_AUDIO]="Cambiando a audio",o[qa.SWITCHED_TO_AUDIO]="Cambiado a audio",o[qa.FAIL]="Error",o[qa.ERROR_PANEL_TITLE]="Error al cargar el video, por favor inténtelo de nuevo más tarde.",o[qa.LIVE]="En vivo",o[qa.RETURN_TO_LIVE]="Volver a En vivo",o[qa.ERROR_PANEL_RETRY_BTN]='Haz clic en Reintentar"',o),s)}];!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode("._alpha-video_1qqo5_1{display:none!important}")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Zo=Object.defineProperty,qo=function(t,e,i){return function(t,e,i){e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Jo=Object.defineProperty,$o=function(t,e,i){return function(t,e,i){e in t?Jo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},ts=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);$o(ts,"label"),$o(ts,"version"),$o(ts,"isSupported"),$o(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(ts),"label","ControlsPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(ts),"label","I18nPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(ts),"label","LoggerPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","HotkeyPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","PlayInfoPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","RotatePlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","PreviewPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","MaskPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","VRPlugin"),$o(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(ts),"label","DanmakuPlugin");var es=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(es||{}),is=function(t){return t.VIDEO="video",t.VIDEO_INTERACTIVE="videoInteractive",t.DEFAULT="default",t}(is||{}),ns=function(){function t(t,e,i){qo(this,"type","2:1"),qo(this,"videoWidth",0),qo(this,"videoHeight",0),qo(this,"objectFit",""),qo(this,"_logger"),qo(this,"_player"),qo(this,"_view"),this._logger=t,this._player=e,this._view=i}return t.prototype.reset=function(){this.videoWidth=this.videoHeight=0},_()(t,[{key:"realVideoWidth",get:function(){return"2:1"===this.type?this.videoWidth/3*2:this.videoWidth/2}},{key:"targetR",get:function(){return"2:1"===this.type?this.videoWidth/3*2/this.videoHeight:this.videoWidth/2/this.videoHeight}},{key:"view",get:function(){return this._view}},{key:"viewR",get:function(){var t=this.viewRect;return t.width/t.height}},{key:"videoR",get:function(){return this.videoWidth/this.videoHeight}},{key:"viewRect",get:function(){return this._view.getBoundingClientRect()}},{key:"player",get:function(){return this._player}},{key:"logger",get:function(){return this._logger}}])}(),rs=function(){function t(){}return t.setPixelRatioByDevice=function(e){t.pixelRatioByDevice=e,t.pixelRatio=e?window.devicePixelRatio:1},t}();qo(rs,"pixelRatioByDevice",!0),qo(rs,"pixelRatio",1);var as,os,ss=rs,us="renderer-basic",cs=function(){function t(t,e){qo(this,"_logger"),qo(this,"_ctx"),qo(this,"_source"),qo(this,"_viewport",{x:0,y:0,w:1,h:1,scale:1}),this._logger=t,this._ctx=e}var e=t.prototype;return e.draw=function(){return I(this,null,A.a.mark((function t(){var e,i,n;return A.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this._ctx.player){t.next=3;break}return t.abrupt("return",!1);case 3:if(!((i=e.canvas||e.video)instanceof HTMLCanvasElement)){t.next=10;break}return t.next=7,e.screenshot();case 7:n=t.sent,t.next=11;break;case 10:n=i;case 11:return t.abrupt("return",!!n&&Promise.resolve(this._drawImageData(n)));case 12:case"end":return t.stop()}}),t,this)})))},e.setSource=function(t){this._logger.i(us,"set source",t),this._source=t},e.setType=function(t){},e.clean=function(){},e.destroy=function(){this._logger.i(us,"destroy")},e._drawImageData=function(t){return!0},e._updateViewSize=function(){},e._updateViewport=function(){var t=this._ctx.targetR,e=this._ctx.view.width,i=this._ctx.view.height,n=e/i,r=this._ctx,a=r.objectFit;this._viewport.x=0,this._viewport.y=0,this._viewport.w=e,this._viewport.h=i,"fill"===a||("cover"===a?t>=r.viewR?(this._viewport.w=this._viewport.h*t,this._viewport.x=-(this._viewport.w-e)/2,this._viewport.scale=r.videoHeight/i):(this._viewport.h=this._viewport.w/t,this._viewport.y=-(this._viewport.h-i)/2,this._viewport.scale=r.realVideoWidth/e):t>n?(this._viewport.h=e/t,this._viewport.y=(i-this._viewport.h)/2,this._viewport.scale=r.realVideoWidth/e):(this._viewport.w=i*t,this._viewport.x=(e-this._viewport.w)/2,this._viewport.scale=r.videoHeight/i))},t}();function ls(t,e){e=e||1;var i=t.clientWidth*e|0,n=t.clientHeight*e|0;return!(!i||!n||t.width===i&&t.height===n)&&(t.width=i,t.height=n,!0)}function hs(t,e,i,n,r){var a=r||fs,o=t.createProgram();return o?(e.forEach((function(e){t.attachShader(o,e)})),i&&i.forEach((function(e,i){t.bindAttribLocation(o,n?n[i]:i,e)})),t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS)?o:(a("Error in program linking:"+t.getProgramInfoLog(o)),t.deleteProgram(o),null)):null}function ds(t,e,i,n){var r=n||fs,a=t.createShader(i);return a?(t.shaderSource(a,e),t.compileShader(a),t.getShaderParameter(a,t.COMPILE_STATUS)?a:(r("*** Error compiling shader '"+a+"':"+t.getShaderInfoLog(a)),t.deleteShader(a),null)):null}function fs(t){console&&(console.error?console.error(t):console.log&&console.log(t))}var ps="renderer-2d",_s=function(t){function e(){var e;return e=t.apply(this,arguments)||this,qo(c()(e),"_tmpCanvas"),qo(c()(e),"_tmpCtx",null),qo(c()(e),"_viewCtx",null),e}f()(e,t);var i=e.prototype;return i._drawImageData=function(t){var e,i,n=this._ctx.view;this._viewCtx||(this._viewCtx=n.getContext("2d",{willReadFrequently:!0})),null==(e=this._viewCtx)||e.clearRect(0,0,n.width,n.height),ls(n,ss.pixelRatio),this._updateViewport(),this._tmpCanvas||(this._tmpCanvas=document.createElement("canvas"),this._tmpCtx=this._tmpCanvas.getContext("2d",{willReadFrequently:!0}));var r=this._tmpCtx,a=this._ctx;if(!r)return this._logger.i(ps,"create tmp ctx error."),!1;t instanceof ImageData?((i=this._tmpCanvas).width=t.width,i.height=t.height,r.putImageData(t,0,0)):((i=this._tmpCanvas).width=a.videoWidth,i.height=a.videoHeight,r.drawImage(t,0,0));var o=this._viewport,s=this._viewCtx,u=Math.round(a.realVideoWidth),c=Math.round(o.x),l=Math.round(o.y),h=Math.min(Math.round(o.w),n.width),d=Math.min(Math.round(o.h),n.height),f=c>=0?0:-c*o.scale,p=l>=0?0:-l*o.scale,_=f>0?u-2*f:u,v=p>0?a.videoHeight-2*p:a.videoHeight,A="2:1"===a.type?2:1,g=Math.min(Math.round(_/A),a.videoWidth-u),m=Math.round(v/A);if(!i||!s)return!1;s.drawImage(i,f,p,_,v,Math.max(0,c),Math.max(0,l),h,d);for(var b=r.getImageData(u+f/A,p/A,g,m),y=s.getImageData(0,0,n.width,n.height),E=0,C=0,T=Math.max(0,c),I=Math.max(0,l),R=0;R<y.height;R++)for(var w=T;w<T+h;w++)R<I||R>I+d||w<T||w>T+h||(E=y.width*R+w<<2,C=Math.round(Math.min(m-1,Math.round((R-I)*m/d))*g+Math.min(Math.round((w-T)*g/h),g-1))<<2,y.data[E+3]=b.data[C]);return s.putImageData(y,0,0),!0},i.clean=function(){this._logger.i(ps,"clean");var t=this._viewCtx;t&&t.clearRect(0,0,t.canvas.width,t.canvas.height)},i.destroy=function(){this._logger.i(ps,"destroy"),t.prototype.destroy.call(this),this._tmpCtx=null,this._tmpCanvas&&(this._tmpCanvas.width=0,this._tmpCanvas.height=0,this._tmpCanvas=void 0)},e}(cs),vs="\n    attribute vec4 position;\n    attribute vec4 inputTextureCoordinate;\n\n    varying vec2 textureCoordinate;\n\n    void main() {\n        gl_Position = position;\n        textureCoordinate = inputTextureCoordinate.xy;\n    }\n  ",As="\n    precision highp float;\n\n    varying highp vec2 textureCoordinate;\n\n    uniform sampler2D inputImageTexture;\n    uniform int type;\n\n    void main() {\n        if (type == 2) {\n            float alphaX = 2.0 / 3.0;\n            vec3 colorRGB = texture2D(inputImageTexture, vec2(textureCoordinate.x * alphaX, textureCoordinate.y)).rgb;\n            vec2 rightTextureCoordinate = vec2(alphaX + (textureCoordinate.x / 3.0), textureCoordinate.y / 2.0);\n            float colorA = texture2D(inputImageTexture, vec2(alphaX + (textureCoordinate.x / 3.0), textureCoordinate.y / 2.0 + 0.5)).r;\n            gl_FragColor = vec4(colorRGB.rgb, colorA);\n        } else {\n            float alphaX = 0.5;\n            vec3 colorRGB = texture2D(inputImageTexture, vec2(textureCoordinate.x * alphaX, textureCoordinate.y)).rgb;\n            vec2 rightTextureCoordinate = vec2(alphaX + textureCoordinate.x / 2.0, textureCoordinate.y);\n            float colorA = texture2D(inputImageTexture, rightTextureCoordinate).r;\n            gl_FragColor = vec4(colorRGB.rgb, colorA);\n        }\n    }\n  ",gs="renderer-webgl",ms=function(t){function e(e,i){var n;return e.i(gs,"constructor"),n=t.call(this,e,i)||this,qo(c()(n),"_vShader",null),qo(c()(n),"_fShader",null),qo(c()(n),"_gl",null),qo(c()(n),"_program",null),qo(c()(n),"_positionBuffer",null),qo(c()(n),"_texcoordBuffer",null),qo(c()(n),"_texture",null),qo(c()(n),"_typeUniform",null),qo(c()(n),"_inputWidth",0),qo(c()(n),"_inputHeight",0),qo(c()(n),"_inputTextureUniform",null),qo(c()(n),"_positionAttrib",0),qo(c()(n),"_inputTextureCoordinateAttrib",0),n._gl=function(t){return t.getContext("webgl",{preferLowPowerToHighPerformance:!0,powerPreference:"default",preserveDrawingBuffer:!0})}(i.view),n}f()(e,t);var i=e.prototype;return i._init=function(){this._logger.i(gs,"init");var t=this._gl;if(!t)return this._logger.e(gs,"init error gl null."),!1;var e=function(t,e,i,n,r,a){void 0===n&&(n=[]),void 0===r&&(r=[]);var o=[],s=ds(t,e,t.VERTEX_SHADER,a),u=ds(t,i,t.FRAGMENT_SHADER,a);return s&&o.push(s),u&&o.push(u),{program:hs(t,o,n,r,a),vertexShader:s,fragmentShader:u}}(t,vs,As);this._vShader=e.vertexShader,this._fShader=e.fragmentShader;var i=this._program=e.program;return i?(ls(t.canvas,ss.pixelRatio),this._positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._positionBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),this._texcoordBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._texcoordBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),this._typeUniform=t.getUniformLocation(i,"type"),this._logger.i(gs,"init complete."),!0):(this._logger.e(gs,"init error program null."),!1)},i.clean=function(){this._logger.i(gs,"clean");var t=this._gl;t&&(t.viewport(0,0,t.canvas.width,t.canvas.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT))},i.destroy=function(){if(this._logger.i(gs,"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);var e=this._gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this._gl=null}t.prototype.destroy.call(this)},i._drawImageData=function(t){var e=this._gl;if(!e)return!1;if(!this._program){if(!this._init())return!1;this._active(),this._texture=this._createAndSetupTexture(e)}if(ls(e.canvas,ss.pixelRatio),this.setType(this._ctx.type),t instanceof HTMLVideoElement){if((t.videoWidth!==this._inputWidth||t.videoHeight!==this._inputHeight)&&(this._inputWidth=t.videoWidth,this._inputHeight=t.videoHeight),4!==t.readyState)return!1}else(t.width!==this._inputWidth||t.height!==this._inputHeight)&&(this._inputWidth=t.width,this._inputHeight=t.height);return this._updateSize(),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.bindTexture(e.TEXTURE_2D,this._texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.finish(),!0},i._createAndSetupTexture=function(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),e},i._updateSize=function(){var t=this._gl;t&&(this._updateViewport(),t.viewport(this._viewport.x,this._viewport.y,this._viewport.w,this._viewport.h))},i._active=function(){var t=this._gl,e=this._program;t&&e&&(t.useProgram(e),this._positionAttrib=t.getAttribLocation(e,"position"),this._inputTextureCoordinateAttrib=t.getAttribLocation(e,"inputTextureCoordinate"),t.enableVertexAttribArray(this._positionAttrib),t.bindBuffer(t.ARRAY_BUFFER,this._positionBuffer),t.vertexAttribPointer(this._positionAttrib,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(this._inputTextureCoordinateAttrib),t.bindBuffer(t.ARRAY_BUFFER,this._texcoordBuffer),t.vertexAttribPointer(this._inputTextureCoordinateAttrib,2,t.FLOAT,!1,0,0),this._inputTextureUniform=t.getUniformLocation(e,"inputImageTexture"))},i.setType=function(t){this._gl&&this._gl.uniform1i(this._typeUniform,"2:1"===t?2:1)},e}(cs),bs="renderer",ys=function(){function t(t,e,i,n){var r=this;qo(this,"_ctx"),qo(this,"_logger"),qo(this,"_active",!1),qo(this,"_fps",60),qo(this,"_drawTime",0),qo(this,"_animationFrameHandler",0),qo(this,"_readyState","idle"),qo(this,"_resizeObserver"),qo(this,"_r"),qo(this,"_loop",(function(){var t=r._ctx.player;r._active&&(t&&!t.paused&&!t.ended&&r._loopDraw(),r._animationFrameHandler=requestAnimationFrame(r._loop))})),qo(this,"_loopDraw",(function(){performance.now()-r._drawTime>1e3/r._fps&&"idle"===r._readyState&&r.draw()})),t.i(bs,"constructor"),this._logger=t,this._ctx=new ns(t,e,i),function(t){if(void 0===t&&(t=!1),t){if(typeof os<"u")return os}else if(typeof as<"u")return as;var e=!1;try{var i=document.createElement("canvas"),n={preferLowPowerToHighPerformance:!0,failIfMajorPerformanceCaveat:t,preserveDrawingBuffer:!0};if(typeof WebGLRenderingContext<"u"){var r=i.getContext("webgl",n)||i.getContext("experimental-webgl",n);if(r){var a=r.getExtension("WEBGL_lose_context");a&&a.loseContext(),e=!0}else e=!1}else e=!1}catch(i){}return t?os=e:as=e,e}(!1)?(t.i(bs,"backend: webgl."),this._r=new ms(t,this._ctx)):(t.i(bs,"backend: canvas2d."),this._r=new _s(t,this._ctx)),this._r.setType(this._ctx.type),this._resizeObserver=new an((function(){r._active&&(t.i(bs,"resize redraw"),r.draw())})),this._resizeObserver.observe(n)}var e=t.prototype;return e.reset=function(){this._logger.i(bs,"reset",this._r),this._r.clean(),this._fps=60,this._ctx.reset(),this.stop()},e.start=function(){this._logger.i(bs,"start. active: "+this._active),this._active||(this._active=!0,this._animationFrameHandler=requestAnimationFrame(this._loop))},e.stop=function(){this._logger.i(bs,"stop"),this._active=!1,cancelAnimationFrame(this._animationFrameHandler),this._animationFrameHandler=0},e.setInput=function(t){this._logger.i(bs,"set input",t),this._r.setSource(t)},e.updateVideoSize=function(t,e){this._logger.i(bs,"update video size",t,e),this._ctx.videoWidth=t,this._ctx.videoHeight=e},e.updateFps=function(t){this._logger.i(bs,"update fps",t),this._fps=t||60},e.updateType=function(t){this._logger.i(bs,"update type",t),this._ctx.type=t,this._r.setType(t),this._active&&this.draw()},e.updateObjectFit=function(t){this._logger.i(bs,"update objectFit: "+t+" active: "+this._active),this._ctx.objectFit=t,this._active&&this.draw()},e.draw=function(){return I(this,null,A.a.mark((function t(){var e;return A.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this._readyState="running",this._drawTime=performance.now(),t.next=4,this._r.draw();case 4:return e=t.sent,t.abrupt("return",(this._readyState="idle",e));case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",(this._readyState="idle",!1));case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))},e.destroy=function(){this._logger.i(bs,"destroy"),this.stop(),this._r.destroy(),this._resizeObserver&&this._ctx.view&&(this._resizeObserver.unobserve(this._ctx.view),this._resizeObserver.disconnect())},_()(t,[{key:"readyState",get:function(){return this._readyState}},{key:"active",get:function(){return this._active}},{key:"ctx",get:function(){return this._ctx}}])}(),Es="_alpha-video_1qqo5_1",Cs="alpha-video",Ts=function(t){function e(){var e;return e=t.apply(this,arguments)||this,qo(c()(e),"_player"),qo(c()(e),"_logger"),qo(c()(e),"_dom"),qo(c()(e),"_outputCanvas"),qo(c()(e),"_renderer"),qo(c()(e),"_active"),qo(c()(e),"_typeFromMeta"),qo(c()(e),"_supported",!0),qo(c()(e),"_onRendererChange",(function(){var t;e._player&&(null==(t=e._renderer)||t.setInput(e._player.canvas||e._player.video))})),qo(c()(e),"_onObjectFitChange",(function(){var t,i,n,r;null==(i=e._logger)||i.i(Cs,"on objectFit change: "+(null==(t=e._player)?void 0:t.objectFit)),null==(r=e._renderer)||r.updateObjectFit((null==(n=e._player)?void 0:n.objectFit)||"")})),qo(c()(e),"_onManifest",(function(t){var i;(0===t.stereoType||typeof t.stereoType>"u")&&e._player?(e._player.crossOrigin="anonymous",e._supported=!0):e._supported=!1,null==(i=e._logger)||i.i(Cs,"on manifest supported: "+e._supported+" stereoType: "+t.stereoType)})),qo(c()(e),"_onSrcChange",(function(){var t;e._typeFromMeta=void 0,null==(t=e._renderer)||t.reset(),e._stop()})),qo(c()(e),"_onLoadedMetadata",(function(){var t;null==(t=e._logger)||t.i(Cs,"on loaded metadata"),e._start()})),qo(c()(e),"_onReport",(function(t){var i,n,r,a,o;"mediaInfo"===t.type&&t.value.fps?(null==(i=e._renderer)||i.updateFps(t.value.fps),t.value.width&&t.value.height&&(null==(n=e._renderer)||n.updateVideoSize(t.value.width,t.value.height))):"metadata"===t.type&&"string"==typeof t.value.desc&&(null==(r=e._logger)||r.i(Cs,"media metadata desc: "+t.value.desc),t.value.desc.indexOf("alphaVideo_1")>=0?(e._typeFromMeta="1:1",null==(a=e._renderer)||a.updateType(e._typeFromMeta),e._start()):t.value.desc.indexOf("alphaVideo_2")>=0&&(e._typeFromMeta="2:1",null==(o=e._renderer)||o.updateType(e._typeFromMeta),e._start()))})),e}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t){this._player=t,this._logger=t.logger,t.on(es.VIDEO_RENDERER_CHANGE,this._onRendererChange),t.on(es.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),t.on(es.LOADEDMETADATA,this._onLoadedMetadata),t.on(es.REPORT,this._onReport),t.on(es.MANIFEST_PARSED,this._onManifest),t.on(es.OBJECT_FIT_CHANGE,this._onObjectFitChange)},i.afterInstall=function(t,e){var i,n,r;this._dom=t.createSubContainer(is.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),null==(i=this._logger)||i.i(Cs,"after install",e),!this._renderer&&this._logger&&(this._logger.i(Cs,"renderer init"),this._renderer=new ys(this._logger,t,this._outputCanvas,this._dom)),typeof(null==e?void 0:e.type)<"u"&&this._renderer&&(this._renderer.ctx.type=e.type),typeof(null==e?void 0:e.active)<"u"&&(this._active=e.active),null==(r=this._renderer)||r.updateObjectFit((null==(n=this._player)?void 0:n.objectFit)||"")},i.afterUninstall=function(t){var e;this._stop(),null==(e=this._renderer)||e.destroy(),this._renderer=void 0,this._player=void 0,this._logger=void 0,t.off(es.VIDEO_RENDERER_CHANGE,this._onRendererChange),t.off(es.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),t.off(es.LOADEDMETADATA,this._onLoadedMetadata),t.off(es.REPORT,this._onReport),t.off(es.MANIFEST_PARSED,this._onManifest),t.off(es.OBJECT_FIT_CHANGE,this._onObjectFitChange),this.removeAllListeners()},i._start=function(){var t,e;null==(t=this._logger)||t.i(Cs,"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(Es),this._player.canvas&&this._player.canvas.classList.add(Es)),null==(e=this._renderer)||e.start())},i._stop=function(){var t,e;null==(t=this._logger)||t.i(Cs,"stop",this._dom),this._dom&&(this._dom.style.visibility="hidden"),this._player&&(this._player.video.classList.remove(Es),this._player.canvas&&this._player.canvas.classList.remove(Es)),null==(e=this._renderer)||e.stop()},_()(e,[{key:"active",get:function(){var t;return!!(null!=(t=this._renderer)&&t.active&&this._supported&&this._isActive)},set:function(t){var e;null==(e=this._logger)||e.i(Cs,"set active: "+t),this._active=t,this._isActive?this._start():this._stop()}},{key:"type",set:function(t){var e,i,n;null==(e=this._logger)||e.i(Cs,"set type "+t),typeof t>"u"?null==(i=this._renderer)||i.updateType(this._typeFromMeta||"2:1"):null==(n=this._renderer)||n.updateType(t)}},{key:"_isActive",get:function(){return!0===this._active||typeof this._active>"u"&&typeof this._typeFromMeta<"u"}}])}(ts);qo(Ts,"label","AlphaVideoPlugin"),qo(Ts,"version","1.1.0-alpha.0");var Is=Ts,Rs=Object.defineProperty,ws=function(t,e,i){return function(t,e,i){e in t?Rs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Ls=Object.defineProperty,Ds=function(t,e,i){return function(t,e,i){e in t?Ls(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Ss=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);Ds(Ss,"label"),Ds(Ss,"version"),Ds(Ss,"isSupported"),Ds(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Ss),"label","ControlsPlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Ss),"label","I18nPlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Ss),"label","LoggerPlugin");var Os=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss);Ds(Os,"label","HotkeyPlugin");var Ns=Os;Ds(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss),"label","PlayInfoPlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss),"label","RotatePlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss),"label","PreviewPlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss),"label","MaskPlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss),"label","VRPlugin"),Ds(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ss),"label","DanmakuPlugin");var ks=function(t){return t.NONE="none",t.KWAI="kwai",t.KWAI2="kwai2",t}(ks||{}),xs="KEEP_DOWN",Ps="KEEP_DOWN_END",Ms="SINGLE_DOWN",Us="ArrowRight",Bs="ArrowLeft",Vs="ArrowUp",Fs="ArrowDown",js=" ",Hs=function(t){function e(){var e;return e=t.apply(this,arguments)||this,ws(c()(e),"_player"),ws(c()(e),"_currentKey",""),ws(c()(e),"_isKeepDown",!1),ws(c()(e),"_emitKeepDownInterval",100),ws(c()(e),"_emitKeepDownLastTime",0),ws(c()(e),"_disable",!1),ws(c()(e),"_onDown",(function(t){!e._isValidInput(t)||e._disable||(e._currentKey&&(e._isKeepDown=!0,Date.now()-e._emitKeepDownLastTime>e._emitKeepDownInterval&&(e._emitKeepDownLastTime=Date.now(),e.emit(xs,{key:t.key}))),e._currentKey=t.key)})),ws(c()(e),"_onUp",(function(t){!e._isValidInput(t)||e._disable||(e._isKeepDown?e.emit(Ps,{key:t.key}):e.emit(Ms,{key:t.key}),e._currentKey="",e._isKeepDown=!1)})),ws(c()(e),"_onKeepDown",(function(t){var i=t.key;if(e._player)switch(i){case js:e._onSpaceDown();break;case Us:e._onChangeRate(3);break;case Bs:e._onSeek(-e._getSeekTickTime());break;case Vs:e._onChangeVolume(5);break;case Fs:e._onChangeVolume(-5)}})),ws(c()(e),"_onKeepDownEnd",(function(t){var i=t.key;if(e._player)switch(i){case js:e._onSpaceDown();break;case Us:e._onChangeRate(1);break;case Bs:e._onSeek(-e._getSeekTickTime());break;case Vs:e._onChangeVolume(5);break;case Fs:e._onChangeVolume(-5)}})),ws(c()(e),"_onSingleDown",(function(t){var i=t.key;if(e._player)switch(i){case js:e._onSpaceDown();break;case Us:e._onSeek(10);break;case Bs:e._onSeek(-e._getSeekTickTime());break;case Vs:e._onChangeVolume(5);break;case Fs:e._onChangeVolume(-5)}})),e}f()(e,t);var i=e.prototype;return i.afterInstall=function(t){this._player=t,document.addEventListener("keydown",this._onDown),document.addEventListener("keyup",this._onUp),this.on(xs,this._onKeepDown),this.on(Ps,this._onKeepDownEnd),this.on(Ms,this._onSingleDown),this._disable=!0===t.disableHotkey,t.logger.i("hotkey-plugin","hotkey disable: "+this._disable)},i.beforeUninstall=function(){this._player=void 0,document.removeEventListener("keydown",this._onDown),document.removeEventListener("keyup",this._onUp)},i._onSpaceDown=function(){var t=this._player;t&&(t.paused?t.play():t.pause())},i._onSeek=function(t){if(this._player){if(this._isNormalLive())return;this._player.currentTime+=t}},i._onChangeRate=function(t){if(this._player){if(this._isNormalLive())return;this._player.playbackRate=t}},i._isNormalLive=function(){return!(!this._player||!this._player||Number.isFinite(this._player.duration)||this._player.liveShiftType!==ks.NONE)},i._onChangeVolume=function(t){if(this._player){this._player.muted&&(this._player.muted=!1);var e=t/100+this._player.volume;e>1&&(e=1),e<0&&(e=0),this._player.volume=e}},i._getSeekTickTime=function(){if(!this._player)return 0;var t=this._player.duration/200;return t>10&&(t=10),t<5&&(t=5),t},i._isValidInput=function(t){var e;if(t.isComposing||["INPUT","TEXTAREA"].find((function(e){var i;return e===(null==(i=t.target)?void 0:i.tagName)})))return!1;var i=null==(e=this._player)?void 0:e.mainContainer;if(i){var n=i.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,s=n.height;if(innerHeight<a||r>innerWidth||r+o<0||a+s<0)return!1}return!0},_()(e,[{key:"disable",get:function(){return this._disable}}])}(Ns);ws(Hs,"version","1.1.0-alpha.0");var Gs=Object.defineProperty,zs=function(t,e,i){return function(t,e,i){e in t?Gs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Ws=Object.defineProperty,Ks=function(t,e,i){return function(t,e,i){e in t?Ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Ys=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);Ks(Ys,"label"),Ks(Ys,"version"),Ks(Ys,"isSupported"),Ks(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Ys),"label","ControlsPlugin");var Qs=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Ys);Ks(Qs,"label","I18nPlugin");var Xs=Qs;Ks(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Ys),"label","LoggerPlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","HotkeyPlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","PlayInfoPlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","RotatePlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","PreviewPlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","MaskPlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","VRPlugin"),Ks(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ys),"label","DanmakuPlugin");var Zs=function(t){function e(){var e;return e=t.apply(this,arguments)||this,zs(c()(e),"_lang","zh"),zs(c()(e),"_langDict",[]),zs(c()(e),"_current"),e}f()(e,t);var i=e.prototype;return i.beforeInstall=function(){e.defaultDict&&(this._langDict=e.defaultDict)},i.afterInstall=function(t,e){var i,n=this;null!=e&&e.langDict&&(null==e?void 0:e.langDict).forEach((function(t){var e=n._getLocalDict(t.lang,!0);e?h()(e,t.map):n._langDict.unshift(t)})),this._lang=(null==e?void 0:e.lang)||navigator.language||navigator.userLanguage||"zh",this._current=this._getLocalDict(this._lang,!0)||this._getLocalDict(this._lang),null==(i=t.logger)||i.i("i18-plugin","use lang: "+this._lang+" "+!!this._current+".")},i.text=function(t,e){return this._current&&this._current[t]&&this._current[t][e]||""},i.addDict=function(t,e){e=e||"zh";var i=this._getLocalDict(e,!0);i?Object.keys(t).forEach((function(e){i[e]||(i[e]={}),h()(i[e],t[e])})):this._langDict.unshift({lang:e,map:t})},i._getLocalDict=function(t,e){void 0===e&&(e=!1);for(var i=0;i<this._langDict.length;i++)if(e&&this._langDict[i].lang===t||!e&&0===t.indexOf(this._langDict[i].lang))return this._langDict[i].map},e}(Xs);zs(Zs,"version","1.1.0-alpha.0"),zs(Zs,"defaultDict");var qs=Zs,Js=Object.defineProperty,$s=function(t,e,i){return function(t,e,i){e in t?Js(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},tu={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"},eu=function(t){return t.SUMMARY="KP_WEB_SUMMARY",t.REALTIME="KP_WEB_REALTIME",t.DOWNLOAD="KP_WEB_DOWNLOAD",t.EVENT="KP_WEB_EVENT",t}(eu||{}),iu={summary:"KP_WEB_SUMMARY",realtimeBeacon:"KP_WEB_REALTIME",download:"KP_WEB_DOWNLOAD",event:"KP_WEB_EVENT"},nu="production",ru=["summary","realtimeBeacon","download","event"];!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var au=Object.defineProperty,ou=function(t,e,i){return function(t,e,i){e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},su=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);ou(su,"label"),ou(su,"version"),ou(su,"isSupported"),ou(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(su),"label","ControlsPlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(su),"label","I18nPlugin");var uu=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(su);ou(uu,"label","LoggerPlugin");var cu=uu;ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","HotkeyPlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","PlayInfoPlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","RotatePlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","PreviewPlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","MaskPlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","VRPlugin"),ou(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(su),"label","DanmakuPlugin");var lu,hu=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(hu||{}),du=new Uint8Array(16);function fu(){if(!lu&&!(lu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lu(du)}var pu=/^(?:[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 _u(t){return"string"==typeof t&&pu.test(t)}for(var vu=[],Au=0;Au<256;++Au)vu.push((Au+256).toString(16).substr(1));function gu(t,e,i){var n=(t=t||{}).random||(t.rng||fu)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var r=0;r<16;++r)e[i+r]=n[r];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(vu[t[e+0]]+vu[t[e+1]]+vu[t[e+2]]+vu[t[e+3]]+"-"+vu[t[e+4]]+vu[t[e+5]]+"-"+vu[t[e+6]]+vu[t[e+7]]+"-"+vu[t[e+8]]+vu[t[e+9]]+"-"+vu[t[e+10]]+vu[t[e+11]]+vu[t[e+12]]+vu[t[e+13]]+vu[t[e+14]]+vu[t[e+15]]).toLowerCase();if(!_u(i))throw TypeError("Stringified UUID is invalid");return i}(n)}var mu="log-ctx",bu=function(){function t(){$s(this,"_env",nu),$s(this,"_reportTypes",[]),$s(this,"_player"),$s(this,"_logger"),$s(this,"_logBaseInfo",this._getDefaultLogBaseInfo()),$s(this,"_biz",{}),$s(this,"_extraSummaryFields",{}),$s(this,"_forceSendBeacon",!1)}var e=t.prototype;return e.setBaseInfo=function(t,e,i){this._player=t,this._logger=t.logger,this._logBaseInfo.env=this._env=e,this._reportTypes=i},e.setBizData=function(t){var e,i,n=this;if(null==(e=this._logger)||e.i(mu,"set biz",t),t){var r={};Object.keys(t).forEach((function(e){var i,a=n._underscoreToCamelCase(e),o=t[e];if(["sessionId","deviceId","userId","globalId","networkType","packageName","versionName","channel"].indexOf(a)>=0&&("string"==typeof o||"number"==typeof o)){var s=n._val2String(t[e]).trim();s&&(null==(i=n._logger)||i.i(mu,"biz to log:",a,s),r[a]=s)}"secretId"!==e&&"secretKey"!==e&&(n._biz[e]=o)})),h()(this._logBaseInfo,r),r.deviceId&&(null==(i=this._logger)||i.i(mu,"update did by bizData. "+r.deviceId),function(t){xn=t}(this._logBaseInfo.deviceId))}else this._logBaseInfo=this._getDefaultLogBaseInfo()},e.preprocessingLog=function(t,e,i){var n,r;if(e)return e=h()(e,{player_version:(null==(n=this._player)?void 0:n.version)||"",pack_version:(null==(r=this._player)?void 0:r.packVersion)||"",biz:this._biz}),t===eu.SUMMARY&&"object"==typeof e&&(e.extra=i?h()({},this._extraSummaryFields,i):this._extraSummaryFields),e},e.clearExtraSummary=function(){this._extraSummaryFields={}},e.appendSummaryField=function(t,e){this._extraSummaryFields[t]=e},e._getDefaultLogBaseInfo=function(){var t=10;return"iOS"===Bn.os.name?t=9:"Android"===Bn.os.name&&(t=8),{env:this._env,productName:"streamlake",sessionId:gu(),platform:t,deviceId:xn,userId:"",globalId:"",networkType:"",packageName:"",versionName:"",channel:""}},e._underscoreToCamelCase=function(t){return t.replace(/_([a-z])/g,(function(t,e){return e.toUpperCase()}))},e._val2String=function(t){return"number"==typeof t?t.toString():t||""},_()(t,[{key:"reportTypes",get:function(){return this._reportTypes}},{key:"logBaseInfo",get:function(){var t;return null!=(t=this._player)&&t.productName&&(this._logBaseInfo.productName=this._player.productName),this._logBaseInfo.deviceId||(this._logBaseInfo.deviceId=xn),this._logBaseInfo}},{key:"player",get:function(){return this._player}},{key:"forceSendBeacon",get:function(){return this._forceSendBeacon},set:function(t){this._forceSendBeacon=t}}])}(),yu="kwai-player-web-log-temp",Eu="log-reissue",Cu=function(){function t(t,e,i){var n=this;$s(this,"_ctx"),$s(this,"_logger"),$s(this,"_webLogger"),$s(this,"_active",!1),$s(this,"_processingTs",0),$s(this,"_lc",new Mn),$s(this,"_timer",0),$s(this,"_checkMissing",!1),$s(this,"_tick",(function(){if(n._active&&n._ctx.player){n._checkMissing&&(n._checkMissing=!1,n._checkMissingLog());var t=performance.now();if(t-n._processingTs>=5e3){n._processingTs=t;var e=n._ctx.preprocessingLog(eu.SUMMARY,n._ctx.player.audienceStat,{reissue_log:1});e&&(n._logger.v(Eu,"write temp"),n._writeTemp(n._webLogger.generateFormData(n._ctx.logBaseInfo,[{key:eu.SUMMARY,value:e}])))}}})),$s(this,"_startTimer",(function(){n._timer||(n._timer=+setInterval(n._tick,1e3))})),$s(this,"_stopTimer",(function(){clearInterval(n._timer),n._timer=0})),this._ctx=t,this._logger=e,this._webLogger=i,this._lc.timeout=2592e5}var e=t.prototype;return e.start=function(){this._logger.i(Eu,"start"),this._active||(this._active=!0,this._processingTs=performance.now(),this._checkMissing=!0,this._startTimer())},e.stop=function(){this._logger.i(Eu,"stop"),this._active=!1,this._clear(),this._stopTimer()},e._checkMissingLog=function(){var t=this._readTemp();this._clear(),t?(this._logger.i(Eu,"send missing log"),this._webLogger.send(this._ctx.logBaseInfo.env,eu.SUMMARY,t.value)):this._logger.i(Eu,"no missing log")},e._clear=function(){try{null==localStorage||localStorage.removeItem(yu)}catch(t){}},e._writeTemp=function(t){if(t){var e={version:1,value:t,checkSum:this._fletcher16(t)};try{this._lc.write(yu,btoa(JSON.stringify(e)))}catch(t){}}},e._readTemp=function(){var t=this._lc.read(yu,!0);if("string"==typeof t)try{var e=JSON.parse(atob(t));if(1===e.version&&"string"==typeof e.value&&e.checkSum===this._fletcher16(e.value))return this._logger.i(Eu,"read success"),e;this._logger.i(Eu,"read failed",e)}catch(e){}},e._fletcher16=function(t){for(var e=0,i=0,n=0;n<t.length;n++)i=(i+(e=(e+t.charCodeAt(n))%255))%255;return i<<8|e},t}(),Tu={unknown:0,none:1,wifi:2,"4g":3,"3g":4,"2g":5,"5g":7,"slow-2g":5},Iu=(new Date).toString().match(/GMT\+\d+/),Ru="";var wu="web-logger",Lu=function(){function t(t){$s(this,"_waitingQueue",[]),$s(this,"_nextTickTimer"),$s(this,"_logger"),this._logger=t}var e=t.prototype;return e.sendLog=function(t,e,i,n,r){var a=this;void 0===n&&(n=!1),this._logger.i(wu,"sendLog",t,e,i,"forceSendBeacon: "+n+" immediately: "+r),i&&(this._waitingQueue.push({key:e,value:i}),r?(this.send(t.env,t.productName,this.generateFormData(t,this._waitingQueue),n),this._waitingQueue.splice(0)):this._nextTickTimer||(this._nextTickTimer=setTimeout((function(){a._nextTickTimer=void 0,a.send(t.env,t.productName,a.generateFormData(t,a._waitingQueue),n),a._waitingQueue.splice(0)}),0)))},e.send=function(e,i,n,r){if(void 0===r&&(r=!1),this._logger.i(wu,"send",e,i,!!n,"forceSendBeacon: "+r),n){var a=tu[e]||tu.production;t._clientIncrementId++;try{localStorage&&(localStorage.kwai_player_client_increment_id=t._clientIncrementId)}catch(s){}var o=new In(a,!0);if(o.query.v="3.10.24",o.query.kpn=i,a=o.toString(),this._logger.i(wu,"send",e,i,!!n,a),r&&navigator.sendBeacon){var s=navigator.sendBeacon(a,n);this._logger.i(wu,"send data use sendBeacon.",s),s||this._sendByXhr(a,n)}else this._sendByXhr(a,n)}},e._sendByXhr=function(t,e){var i=this;this._logger.i(wu,"send data use xhr.");var n=new XMLHttpRequest;n.open("POST",t),n.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),n.onerror=n.ontimeout=function(){i._logger.i("sendLog error"),n.onerror=n.ontimeout=n.onload=null},n.onload=function(){n.onerror=n.ontimeout=n.onload=null},n.timeout=5e3,n.send(e)},e.generateFormData=function(e,i){this._logger.i(wu,"device_id: "+e.deviceId);var n={common:t._buildCommon(e,{service_name:"KwaiPlayerWeb"}),logs:i.map((function(i){return t._buildEvent(e,i.key,i.value)}))};return n.logs.length?JSON.stringify(n):""},t._buildEvent=function(e,i,n){Ru||(Ru=gu());var r={identity:Ru,page:location.href,hostname:location.hostname,page_type:2,params:new In(location.href,!0).query};return{client_timestamp:Date.now(),client_increment_id:t._clientIncrementId,session_id:e.sessionId,time_zone:t._timeZone,stat_package:{custom_stat_event:{key:i,value:JSON.stringify(h()({},n,{url_package:r}))}}}},t._buildCommon=function(t,e){return function(t,e){for(var i in e||(e={}))E.call(e,i)&&T(t,i,e[i]);if(y)for(var n,r=g(y(e));!(n=r()).done;){i=n.value;C.call(e,i)&&T(t,i,e[i])}return t}({identity_package:{device_id:t.deviceId,global_id:t.globalId,user_id:t.userId},app_package:{language:navigator.language,platform:t.platform,container:10===t.platform?"WEB":"H5",package_name:t.packageName,product_name:t.productName,version_name:t.versionName,channel:t.channel},device_package:{os_version:Bn.os.version,model:Bn.os.name,ua:navigator.userAgent},need_encrypt:!1,sdk_version:"",h5_extra_attr:this._getH5ExtraAttr(t),global_attr:"{}",network_package:{type:this._getNetworkType(t.networkType)}},e)},t._getNetworkType=function(t){var e,i=t||(null==(e=(null==navigator?void 0:navigator.connection)||(null==navigator?void 0:navigator.mozConnection)||(null==navigator?void 0:navigator.webkitConnection))?void 0:e.effectiveType);return i&&Tu[i]||Tu.unknown},t._getH5ExtraAttr=function(t){var e=parseFloat(devicePixelRatio.toFixed(3))||1;return JSON.stringify({sdk_name:"",sdk_version:"",sdk_bundle:"",app_version_name:t.versionName,resolution:Math.floor(screen.width*e)+"x"+Math.floor(screen.height*e),screen_width:Math.floor(screen.width),screen_height:Math.floor(screen.height),device_pixel_ratio:e,domain:location.origin,fromIframe:self!==top})},t}();$s(Lu,"_clientIncrementId",function(){try{return parseInt((null==localStorage?void 0:localStorage.getItem("kwai_player_client_increment_id"))||"")||0}catch(t){}return 0}()),$s(Lu,"_timeZone",Iu&&Iu[0]?Iu[0]:"");var Du=Lu,Su="logger-plugin",Ou=function(t){function e(){var e;return e=t.apply(this,arguments)||this,$s(c()(e),"_summaryAlreadySend",!1),$s(c()(e),"_webLogger"),$s(c()(e),"_logger"),$s(c()(e),"_ctx",new bu),$s(c()(e),"_logReissue"),$s(c()(e),"_parseBizData",(function(){var t,i,n;null==(i=e._logger)||i.i(Su,"parse biz data",null==(t=e._ctx.player)?void 0:t.bizData),e._ctx.setBizData(null==(n=e._ctx.player)?void 0:n.bizData)})),$s(c()(e),"_onReport",(function(t){var i,n;if(-1!==e._ctx.reportTypes.indexOf(t.type)){var r=iu[t.type];r?(null==(i=e._logger)||i.i(Su,"sendLog",e._ctx.logBaseInfo.productName,r),e._send(r,t.value)):null==(n=e._logger)||n.i(Su,"unknown weblogger key.")}})),$s(c()(e),"_onSrcChange",(function(){var t;e._sendSummary(),e._summaryAlreadySend=!1,null==(t=e._logReissue)||t.start()})),$s(c()(e),"_sendSummary",(function(){var t,i;!e._ctx.player||e._summaryAlreadySend||!e._ctx.player.audienceStat||(null==(t=e._logReissue)||t.stop(),e._summaryAlreadySend=!0,null==(i=e._logger)||i.i(Su,"send summary"),e._send(eu.SUMMARY,e._ctx.player.audienceStat,!0))})),$s(c()(e),"_onBeforeunload",(function(){e._sendSummary()})),e}f()(e,t);var i=e.prototype;return i.beforeInstall=function(t,e){var i;e&&e.reportTypes&&Array.isArray(e.reportTypes)&&(i=e.reportTypes.filter((function(t){return ru.indexOf(t)>=0}))),null!=e&&e.productName&&(t.productName=e.productName),typeof(null==e?void 0:e.forceSendBeacon)<"u"&&(this._ctx.forceSendBeacon=e.forceSendBeacon),this._logger=t.logger,this._ctx.setBaseInfo(t,(null==e?void 0:e.env)||nu,i||ru),this._webLogger||(this._webLogger=new Du(t.logger)),this._logReissue=new Cu(this._ctx,t.logger,this._webLogger),t.on(hu.REPORT,this._onReport),t.on(hu.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),t.on(hu.ATTRIBUTE_CHANGE_BIZ_DATA,this._parseBizData),window.addEventListener("beforeunload",this._onBeforeunload),Bn&&"mobile"===Bn.device.type&&window.addEventListener("unload",this._onBeforeunload),this._parseBizData()},i.beforeUninstall=function(){this._sendSummary()},i.afterUninstall=function(){var t,e,i;null==(t=this._ctx.player)||t.off(hu.REPORT,this._onReport),null==(e=this._ctx.player)||e.off(hu.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),null==(i=this._ctx.player)||i.off(hu.ATTRIBUTE_CHANGE_BIZ_DATA,this._parseBizData),window.removeEventListener("beforeunload",this._onBeforeunload),window.removeEventListener("unload",this._onBeforeunload)},i.appendSummaryField=function(t,e){var i;null==(i=this._logger)||i.i(Su,"add summary field",t,e),this._ctx.appendSummaryField(t,e)},i._send=function(t,e,i){var n;e&&(null==(n=this._webLogger)||n.sendLog(this._ctx.logBaseInfo,t,this._ctx.preprocessingLog(t,e),this._ctx.forceSendBeacon,i))},e}(cu);$s(Ou,"version","1.1.0-alpha.0"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.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(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Nu=Object.defineProperty,ku=function(t,e,i){return function(t,e,i){e in t?Nu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var xu=Object.defineProperty,Pu=function(t,e,i){return function(t,e,i){e in t?xu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Mu="I18nPlugin",Uu=function(t){return t.PLAY_BAR_LEFT="playBarLeft",t.PLAY_BAR_RIGHT="playBarRight",t.CONTEXT_MENU="contextMenu",t}(Uu||{}),Bu=function(){function t(){Pu(this,"_callbacks",[])}var e=t.prototype;return e.add=function(t){this._callbacks.push(t)},e.remove=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},e.call=function(t){this._callbacks.forEach((function(e){return e(t)}))},e.destroy=function(){this._callbacks.splice(0,this._callbacks.length)},t}(),Vu=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);Pu(Vu,"label"),Pu(Vu,"version"),Pu(Vu,"isSupported"),Pu(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Vu),"label","ControlsPlugin"),Pu(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Vu),"label",Mu),Pu(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Vu),"label","LoggerPlugin"),Pu(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu),"label","HotkeyPlugin");var Fu=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu);Pu(Fu,"label","PlayInfoPlugin");var ju=Fu;Pu(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu),"label","RotatePlugin"),Pu(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu),"label","PreviewPlugin"),Pu(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu),"label","MaskPlugin"),Pu(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu),"label","VRPlugin"),Pu(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Vu),"label","DanmakuPlugin");var Hu=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(Hu||{}),Gu=Nr(void 0),zu="kwai_player_ll_enabled",Wu=function(t){var e=t.children,i=t.player,n=i.logger,r=new pi,a=pi.isSupported()&&!Hn,o=i.packVersion+"("+i.version+")",s=new Mn,u=Qr(!1),c=u[0],l=u[1],h=function(t,e){if(void 0===e&&(e=!1),(t=t&&a)?(d(),i.outputLogger=r.getLoggerForAdd()):i.outputLogger=void 0,l(t),e)try{s.write(zu,t?"1":"0")}catch(t){}},d=function(){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(t){}};try{var f="1"==s.read(zu)&&a;l(f),f&&h(f)}catch(f){}return Xr((function(){return function(){n.i("play-info-context","destroy"),r.destroy()}}),[]),xr(Gu.Provider,{value:{player:i,playerVersion:o,localLogSwitch:c,localLogEnabled:a,toggleLocalLog:function(){h(!c,!0)},downloadLocalLog:function(){r.downloadLog()}},children:e})},Ku={container:"_container_afsrn_1","container-h5":"_container-h5_afsrn_19","close-btn":"_close-btn_afsrn_36","btn-tip":"_btn-tip_afsrn_49",actions:"_actions_afsrn_60","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 Yu(t){var e=t.title,i=t.value;return xr("div",{className:Ku["info-item"],children:[xr("div",{className:Ku["info-item-name"],children:[e,":"]}),xr("div",{className:Ku["info-item-value"],children:i})]})}function Qu(t){var e=t.dataArray,i=qr(null),n=Qr(""),r=n[0],a=n[1];return Xr((function(){if(null!=i&&i.current){for(var t=i.current.getBoundingClientRect(),n=t.width,r=t.height,o=Math.max.apply(Math,e)||1,s=r-2,u=n/e.length,c="M0 "+(s*(o-e[0])/o+1),l=1;l<e.length;l++)c+=" L"+l*u+" "+(s*(o-e[l])/o+1);a(c)}}),[e]),xr("svg",{ref:i,height:"100%",width:"100%",style:"display:block",children:xr("path",{fill:"none",stroke:"#fff",strokeWidth:"1",d:r})})}function Xu(t){var e=t.title,i=t.suffix,n=t.value,r=Qr(0),a=r[0],o=r[1];return Xr((function(){o(n[n.length-1]||0)}),[n]),xr("div",{className:Ku["info-item"],children:[xr("div",{className:Ku["info-item-name"],children:[e,":"]}),xr("div",{className:Ku["info-item-value"],children:[xr("div",{className:Ku["item-svg"],children:xr(Qu,{dataArray:n})}),xr("div",{className:Ku["item-value"],children:i(a)})]})]})}function Zu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qu=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,i=[],n=0;n<t.rangeCount;n++)i.push(t.getRangeAt(n));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||i.forEach((function(e){t.addRange(e)})),e&&e.focus()}},Ju={"text/plain":"Text","text/html":"Url",default:"Text"};var $u=Zu((function(t,e){var i,n,r,a,o,s,u=!1;e||(e={}),i=e.debug||!1;try{if(r=qu(),a=document.createRange(),o=document.getSelection(),(s=document.createElement("span")).textContent=t,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(n){if(n.stopPropagation(),e.format)if(n.preventDefault(),typeof n.clipboardData>"u"){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=Ju[e.format]||Ju.default;window.clipboardData.setData(r,t)}else n.clipboardData.clearData(),n.clipboardData.setData(e.format,t);e.onCopy&&(n.preventDefault(),e.onCopy(n.clipboardData))})),document.body.appendChild(s),a.selectNodeContents(s),o.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){i&&console.error("unable to copy using execCommand: ",r),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),u=!0}catch(r){i&&console.error("unable to copy using clipboardData: ",r),i&&console.error("falling back to prompt"),n=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(n,t)}}finally{o&&("function"==typeof o.removeRange?o.removeRange(a):o.removeAllRanges()),s&&document.body.removeChild(s),r()}return u}));function tc(t){var e=ta(Gu);if(!e)return xr(hr,{});var i=e.player,n=e.playerVersion,r=e.localLogEnabled,a=e.localLogSwitch,o=e.toggleLocalLog,s=e.downloadLocalLog,u=t.onChangeShowEventLog,c=xn,l=Qr(""),h=l[0],d=l[1],f=Qr(""),p=f[0],_=f[1],v=Qr(""),A=v[0],g=v[1],m=Qr(""),b=m[0],y=m[1],E=Qr(""),C=E[0],T=E[1],I=Qr(""),R=I[0],w=I[1],L=Qr(0),D=L[0],S=L[1],O=Qr(""),N=O[0],k=O[1],x=Qr(""),P=x[0],M=x[1],U=Qr([]),B=U[0],V=U[1],F=Qr([]),j=F[0],H=F[1],G=Qr([]),z=G[0],W=G[1],K=Qr([]),Y=K[0],Q=K[1],X=Qr((new Date).toString()),Z=X[0],q=X[1],J=qr(void 0);Zr((function(){var t=function(){_(""),g(""),y(""),T(""),w(""),S(0),k(""),Y.splice(0,j.length),j.splice(0,j.length),z.splice(0,z.length),B.splice(0,B.length)},e=function(){d(i.kernelType||"")},n=function(t){if(t&&"mediaInfo"===t.type){J.current=t.value,d(i.kernelType||""),_(t.value.streamHost||""),g(t.value.colorSpace||""),k(t.value.sid||""),M(t.value.gpu||"");var e=[];t.value.coreType&&e.push(t.value.coreType),t.value.box&&(t.value.enhancedFlv?e.push("enhanced-flv"):e.push(t.value.box)),t.value.videoCodecType&&e.push(t.value.videoCodecType),t.value.videoDecoder&&e.push(t.value.videoDecoder),t.value.width&&t.value.height&&e.push(t.value.width+"x"+t.value.height),t.value.sar&&e.push("[SAR "+t.value.sar.width+":"+t.value.sar.height+"]"),t.value.fps&&e.push("@"+t.value.fps.toFixed(2)),y(e.join(" "));var n=[];t.value.videoCodec&&n.push(t.value.videoCodec),t.value.audioCodec&&n.push(t.value.audioCodec),T(n.join(","))}t&&"heartbeat"===t.type&&(t.value.decodedFrames&&w((t.value.decodedFPS||0)+"/"+(t.value.droppedFPS||0)+" "+(t.value.decodedFrames||0)+"/"+(t.value.droppedFrames||0)),"number"==typeof t.value.totalReceive&&S(t.value.totalReceive),ot(t.value.videoBuffered||0,j,H),ot(t.value.audioBuffered||0,z,W),!j.length&&!z.length&&ot(t.value.buffered||0,Y,Q),ot(t.value.speed||0,B,V),q((new Date).toString()))};return i.on(Hu.ATTRIBUTE_CHANGE_SRC,t),i.on(Hu.REPORT,n),i.on(Hu.LOADEDMETADATA,e),function(){i.off(Hu.ATTRIBUTE_CHANGE_SRC,t),i.off(Hu.REPORT,n),i.off(Hu.LOADEDMETADATA,e),at.current&&clearTimeout(at.current)}}),[]);var $=Qr(""),tt=$[0],et=$[1],it=Qr(!1),nt=it[0],rt=it[1],at=qr(0),ot=$r((function(t,e,i){"number"==typeof t&&!isNaN(t)&&(e.push(t),e.length>100?e.shift():1===e.length&&(e.unshift.apply(e,new Array(99)),e.forEach((function(t,i){"number"!=typeof t&&(e[i]=0)}))),i([].concat(e)))}),[]),st=$r((function(){i.logger.i("info-panel","click copy");var t={date:Z};c&&(t.did=c),n&&(t.playerVersion=n),N&&(t.sessionId=N),p&&(t.streamHost=p),A&&(t.colorSpace=A),b&&(t.res=b),C&&(t.codec=C),P&&(t.gpu=P),j.length&&(t.vBuffer=j[j.length-1]),z.length&&(t.aBuffer=z[z.length-1]),Y.length&&(t.buffer=Y[Y.length-1]),B.length&&(t.speed=B[B.length-1]),J.current&&(t.mediainfo=J.current),t.userAgent=navigator.userAgent,t.summary=i.audienceStat;var e=$u(JSON.stringify(t));et(e?"已复制":"复制失败"),rt(!0),at.current&&clearTimeout(at.current),at.current=+setTimeout((function(){rt(!1),at.current=0}),1e3)}),[]),ut=$r((function(t){return t>1e9?(t/1e9).toFixed(2)+" GB":t>1e6?(t/1e6).toFixed(2)+" MB":(t/1e3).toFixed(2)+" KB"}),[]),ct=$r((function(t){return t>1e7?(t/1e6).toFixed(2)+" MB/s":(t/1e3).toFixed(2)+" KB/s"}),[]),lt=$r((function(t){return t>1e3?(t/1e3).toFixed(2)+" s":t+" ms"}),[]),ht=$r((function(t){t.stopPropagation()}),[]);return xr("div",{className:Hn?Ku["container-h5"]:Ku.container,onContextMenu:ht,children:[c&&xr(Yu,{title:"DeviceId",value:c}),n&&xr(Yu,{title:"PlayerVersion",value:n}),h&&xr(Yu,{title:"kernel",value:h}),N&&xr(Yu,{title:"SessionId",value:N}),p&&xr(Yu,{title:"StreamHost",value:p}),b&&xr(Yu,{title:"Res",value:b}),A&&xr(Yu,{title:"Color",value:A}),C&&xr(Yu,{title:"Codec",value:C}),R&&xr(Yu,{title:"Frames",value:R}),!!Y.length&&xr(Xu,{title:"Buffered",value:Y,suffix:lt}),!!j.length&&xr(Xu,{title:"VideoBuffered",value:j,suffix:lt}),!!z.length&&xr(Xu,{title:"AudioBuffered",value:z,suffix:lt}),!!B.length&&xr(Xu,{title:"Speed",value:B,suffix:ct}),D>0&&xr(Yu,{title:"TotalReceive",value:ut(D)}),P&&xr(Yu,{title:"GPU",value:P}),xr(Yu,{title:"Date",value:Z}),xr("div",{className:[Hn?Ku["h5-btn"]:"",Ku["close-btn"]].join(" "),onClick:u,children:"[X]"}),xr("div",{className:Ku.actions,children:[a&&xr("div",{className:[Hn?Ku["h5-btn"]:"",Ku["copy-btn"]].join(" "),onClick:s,children:"[Download Log]"}),r&&xr("div",{className:[Hn?Ku["h5-btn"]:"",Ku["copy-btn"]].join(" "),onClick:o,children:["[Log ",a?"on":"off","]"]}),xr("div",{className:[Hn?Ku["h5-btn"]:"",Ku["copy-btn"]].join(" "),onClick:st,children:[nt&&xr("div",{className:Ku["btn-tip"],children:tt}),xr("div",{children:"[Copy]"})]})]})]})}var ec="play-info-plugin",ic=function(t){function e(){var e;return e=t.apply(this,arguments)||this,ku(c()(e),"_player"),ku(c()(e),"_i18n"),ku(c()(e),"_callback",new Bu),ku(c()(e),"_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>'}),ku(c()(e),"_container"),ku(c()(e),"_onChangeShowEventLog",(function(){e._container&&(e.isShow=!e.isShow)})),ku(c()(e),"_onShowInfoPanelChange",(function(){var t;e.isShow=!(null==(t=e._player)||!t.showInfoPanel)})),e}f()(e,t);var i=e.prototype;return i.beforeInstall=function(t,e){e&&(!0===e.showInPlayBar&&(this._option.showInPlayBar=!0),!1===e.showInContextMenu&&(this._option.showInContextMenu=!1),e.svgRaw&&(this._option.svgRaw=e.svgRaw)),this._i18n=t.getPluginInstance(Mu)},i.afterInstall=function(t,e){if(this._player=t,this._player){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",Hn&&(this._container.style.width="100%"));var i=t.logger;if(Or(xr(Wu,{player:t,children:xr(tc,{onChangeShowEventLog:this._onChangeShowEventLog})}),this._container),"boolean"==typeof t.showInfoPanel)this.isShow=t.showInfoPanel,i.i(ec,"set show by player: "+t.showInfoPanel);else{var n="kwai-player-web-play-info";"string"==typeof(null==e?void 0:e.keyInUrl)&&(n=null==e?void 0:e.keyInUrl),location.href.indexOf(n)>=0&&(this.isShow=!0,i.i(ec,"set show by url: true"))}t.on(Hu.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL,this._onShowInfoPanelChange)}},i.beforeUninstall=function(t){this._callback.destroy()},i.afterUninstall=function(t){this._container&&(Or(null,this._container),t.removeSubContainer(this._container)),this._player=void 0,t.off(Hu.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL,this._onShowInfoPanelChange),this.removeAllListeners()},i.getLabel=function(){return e.label},i._text=function(t){var i;return(null==(i=this._i18n)?void 0:i.text(e.label,t))||"视频信息"},_()(e,[{key:"isShow",get:function(){var t;return"block"===(null==(t=this._container)?void 0:t.style.display)},set:function(t){this._container&&(this._container.style.display=t?"block":"none",this.emit(Hu.ATTRIBUTE_CHANGE),this._callback.call(t))}},{key:"dom",get:function(){return this._container}},{key:"controlsSoltBtns",get:function(){var t=this,e=[];if(this._option.showInContextMenu){var i={role:"play-info-context-menu",slotPos:Uu.CONTEXT_MENU,getChecked:function(){return t.isShow},getText:function(){return t._text("playInfo")},svgRaw:this._option.svgRaw,onClick:function(){return t.isShow=!t.isShow},callback:this._callback};e.push(i)}if(this._option.showInPlayBar&&!Hn){var n={role:"play-info-btn",slotPos:Uu.PLAY_BAR_RIGHT,getTips:function(){return t._text("playInfo")},svgRaw:this._option.svgRaw,onClick:function(){return t.isShow=!t.isShow},callback:this._callback};e.push(n)}return e}}])}(ju);ku(ic,"version","1.1.0-alpha.0");var nc=ic,rc=Object.defineProperty,ac=function(t,e,i){return function(t,e,i){e in t?rc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var oc=Object.defineProperty,sc=function(t,e,i){return function(t,e,i){e in t?oc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},uc="LoggerPlugin",cc=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);sc(cc,"label"),sc(cc,"version"),sc(cc,"isSupported"),sc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(cc),"label","ControlsPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(cc),"label","I18nPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(cc),"label",uc),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","HotkeyPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","PlayInfoPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","RotatePlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","PreviewPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","MaskPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","VRPlugin"),sc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(cc),"label","DanmakuPlugin");var lc=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(lc||{}),hc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,ac(c()(e),"_player"),ac(c()(e),"_domainList",[]),ac(c()(e),"_logger"),e}f()(e,t);var i=e.prototype;return i.afterInstall=function(t){var e,i=this;this._player=t,this._logger=t.getPluginInstance(uc),t.on(lc.ATTRIBUTE_CHANGE_SRC,(function(){var t;null!=(t=i._player)&&t.src&&i._check(i._player.src)}));var n=this._player.src;null==(e=this._logger)||e.appendSummaryField("prefetch",this._player.prefetch?1:0),n&&this._check(n)},i.beforeUninstall=function(){this._player=void 0},i.getLabel=function(){return e.label},i._check=function(t){var e,i,n,r,a,o;if(null!=(e=this._player)&&e.autoplay||"none"!==(null==(i=this._player)?void 0:i.preload)||!this._player.prefetch)null==(n=this._logger)||n.appendSummaryField("prefetch_valid",0);else{if(null==(r=this._logger)||r.appendSummaryField("prefetch_valid",1),"string"==typeof t){var s=this._getHostname(t);s&&-1===this._domainList.indexOf(s)&&(this._domainList.push(s),null==(a=this._logger)||a.appendSummaryField("prefetch_start_time",Date.now()),this._send(t))}if("object"==typeof t)for(var u,c={},l=!1,h=g(this._pickUrl(t));!(u=h()).done;){var d=u.value,f=this._getHostname(d);f&&!c[f]&&(c[f]=d,this._send(d),l||(null==(o=this._logger)||o.appendSummaryField("prefetch_start_time",Date.now()),l=!0))}}},i._send=function(t,e){var i=new XMLHttpRequest;i.open("HEAD",t),i.onreadystatechange=function(){3===i.readyState&&(i.abort(),e&&e()),4===i.readyState&&e&&e()},i.timeout=3e3,i.ontimeout=function(){console.warn(t+" timeout"),e&&e()},i.onerror=function(){console.warn(t+" error"),e&&e()},i.send()},i._getHostname=function(t){var e=t.match("^(http|https)://[a-zA-Z0-9._-]+");return e?e[0]:""},i._pickUrl=function(t,e){void 0===e&&(e=[]);for(var i=Object.keys(t),n=0;n<i.length;n++){var r=i[n];"string"==typeof t[r]&&this._getHostname(t[r])&&e.push(t[r]),"object"==typeof t[r]&&this._pickUrl(t[r],e)}return e},e}(cc);ac(hc,"version","1.1.0-alpha.0"),ac(hc,"label","PrefetchPlugin");var dc=hc,fc=Object.defineProperty,pc=function(t,e,i){return function(t,e,i){e in t?fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var _c=Object.defineProperty,vc=function(t,e,i){return function(t,e,i){e in t?_c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Ac=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);vc(Ac,"label"),vc(Ac,"version"),vc(Ac,"isSupported"),vc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Ac),"label","ControlsPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Ac),"label","I18nPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Ac),"label","LoggerPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac),"label","HotkeyPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac),"label","PlayInfoPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac),"label","RotatePlugin");var gc=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac);vc(gc,"label","PreviewPlugin");var mc=gc;vc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac),"label","MaskPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac),"label","VRPlugin"),vc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Ac),"label","DanmakuPlugin");var bc=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(bc||{}),yc={exports:{}};!function(t,e){var i,n,r,a,o;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var r=o.parseURL(t);if(!r)throw new Error("Error trying to parse base URL.");return r.path=o.normalizePath(r.path),o.buildURLFromParts(r)}var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):e;var s=o.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var u=n.exec(s.path);s.netLoc=u[1],s.path=u[2]}s.netLoc&&!s.path&&(s.path="/");var c={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var l=s.path,h=l.substring(0,l.lastIndexOf("/")+1)+a.path;c.path=o.normalizePath(h)}else c.path=s.path,a.params||(c.params=s.params,a.query||(c.query=s.query));return null===c.path&&(c.path=i.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(c)},parseURL:function(t){var e=i.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(r,"");t.length!==(t=t.replace(a,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=o}(yc);var Ec=yc.exports,Cc=/\r\n|\n\r|\n|\r/g,Tc=/^(?:(\d+):)?(\d{1,2}):(\d{1,2})(\.\d+)?/,Ic=/\#xywh=(\d+),(\d+),(\d+),(\d+)/,Rc=function(){function t(){pc(this,"_url",""),pc(this,"_xhr"),pc(this,"_imgList",[])}var e=t.prototype;return e.clear=function(){this._destroyLoader(),this._imgList=[]},e.load=function(t){var e=this;this._url=t,this._imgList=[],this._load((function(t){e._destroyLoader(),e._imgList=e._parse(t)}),(function(){e._destroyLoader(e._xhr)}),t,3e3,"text")},e._load=function(t,e,i,n,r){this._destroyLoader();var a=this._xhr=new XMLHttpRequest;a.open("GET",i,!0),r&&(a.responseType=r),a.timeout=n,a.onreadystatechange=function(){2===a.readyState&&(a.status<200||a.status>299)&&e&&e("xhr error: "+a.status)},a.ontimeout=a.onerror=function(){e&&e("xhr error")},a.onload=function(){t(a.response)},a.send()},e.getImgByTime=function(t){if(this._imgList&&this._imgList)return Rn(this._imgList,(function(e){return t<e.start?-1:t>e.end?1:0}))},e._destroyLoader=function(t){t&&(t.ontimeout=null,t.onload=null,t.onreadystatechange=null,t.onerror=null,t.onabort=null,t.abort())},e._parse=function(t){var e=this;if(!/^WEBVTT/.test(t))throw new Error("Not webVTT");var i,n=t.trim().replace(Cc,"\n").split("\n"),r=[];return n.forEach((function(t){if(-1!==t.indexOf("--\x3e")){var n=e._parseTimeStamp(t);t=t.substring(t.indexOf("--\x3e")+3).trim();var a=e._parseTimeStamp(t);"number"==typeof n&&"number"==typeof a&&(i={start:n,end:a,x:0,y:0,w:0,h:0,url:""})}else if(t){var o=t.match(Ic);if(o&&i){i.x=parseInt(o[1]),i.y=parseInt(o[2]),i.w=parseInt(o[3]),i.h=parseInt(o[4]);var s=new URL(Ec.buildAbsoluteURL(e._url,t,{alwaysNormalize:!0}));s.hash="",i.url=s.toString(),r.push(i)}}})),r},e._parseTimeStamp=function(t){var e=t.match(Tc);if(e)return this._computeSeconds(e[1],e[2],e[3],e[4])},e._computeSeconds=function(t,e,i,n){return 3600*(parseInt(t)||0)+60*(parseInt(e)||0)+(parseInt(i)||0)+(parseFloat(n)||0)},_()(t,[{key:"hasPreview",get:function(){return!!(this._imgList&&this._imgList.length>0)}}])}(),wc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,pc(c()(e),"_player"),pc(c()(e),"_logger"),pc(c()(e),"_kwaiPreview",new Rc),pc(c()(e),"_isSupported",typeof Element.prototype.getBoundingClientRect<"u"),pc(c()(e),"_onSrcChange",(function(){e._clear()})),pc(c()(e),"_onPreviewUrlChange",(function(){var t;null!=(t=e._player)&&t.previewUrl?e._load(e._player.previewUrl):e._clear()})),e}f()(e,t);var i=e.prototype;return i.beforeInstall=function(t){this._player=t,this._logger=t.logger,t.on(bc.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),t.on(bc.ATTRIBUTE_CHANGE_PREVIEW_URL,this._onPreviewUrlChange)},i.afterInstall=function(t){t.previewUrl&&this._load(t.previewUrl)},i.afterUninstall=function(t){this._clear(),t.off(bc.ATTRIBUTE_CHANGE_SRC,this._onSrcChange),t.off(bc.ATTRIBUTE_CHANGE_PREVIEW_URL,this._onPreviewUrlChange)},i.getImgByTime=function(t){return this._kwaiPreview.getImgByTime(t)},i._load=function(t){var e;null==(e=this._logger)||e.i("preview-plugin","load: "+t+". is supported:"+this._isSupported),this._isSupported&&this._kwaiPreview.load(t)},i._clear=function(){this._destroyParser()},i._destroyParser=function(){this._kwaiPreview&&this._kwaiPreview.clear()},_()(e,[{key:"hasPreview",get:function(){return!!this._kwaiPreview.hasPreview}}])}(mc);pc(wc,"version","1.1.0-alpha.0"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Lc=Object.defineProperty,Dc=function(t,e,i){return function(t,e,i){e in t?Lc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Sc=Object.defineProperty,Oc=function(t,e,i){return function(t,e,i){e in t?Sc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Nc="I18nPlugin",kc=function(t){return t.PLAY_BAR_LEFT="playBarLeft",t.PLAY_BAR_RIGHT="playBarRight",t.CONTEXT_MENU="contextMenu",t}(kc||{}),xc=function(){function t(){Oc(this,"_callbacks",[])}var e=t.prototype;return e.add=function(t){this._callbacks.push(t)},e.remove=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},e.call=function(t){this._callbacks.forEach((function(e){return e(t)}))},e.destroy=function(){this._callbacks.splice(0,this._callbacks.length)},t}(),Pc=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);Oc(Pc,"label"),Oc(Pc,"version"),Oc(Pc,"isSupported"),Oc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Pc),"label","ControlsPlugin"),Oc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Pc),"label",Nc),Oc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Pc),"label","LoggerPlugin"),Oc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc),"label","HotkeyPlugin"),Oc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc),"label","PlayInfoPlugin");var Mc=function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc);Oc(Mc,"label","RotatePlugin");var Uc=Mc;Oc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc),"label","PreviewPlugin"),Oc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc),"label","MaskPlugin"),Oc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc),"label","VRPlugin"),Oc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Pc),"label","DanmakuPlugin");var Bc=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(Bc||{}),Vc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,Dc(c()(e),"_player"),Dc(c()(e),"_i18n"),Dc(c()(e),"_callback",new xc),Dc(c()(e),"_mirrorCallback",new xc),Dc(c()(e),"_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>'}}),Dc(c()(e),"_mainContainer"),Dc(c()(e),"_innerRotate",0),Dc(c()(e),"_outerRotate",0),Dc(c()(e),"_isMirror",!1),Dc(c()(e),"_resizeLoop"),Dc(c()(e),"_resizeObserver"),Dc(c()(e),"_stereoType"),Dc(c()(e),"_onPlayerRendererChange",(function(){e.innerRotate=e._innerRotate})),Dc(c()(e),"_onPlayerSrcChanged",(function(){e._stereoType=0})),Dc(c()(e),"_onPlayerManifestParsed",(function(t){e._stereoType=t.stereoType,1===e._stereoType&&(e._isMirror=!1,e.innerRotate=0)})),e}f()(e,t);var i=e.prototype;return i.beforeInstall=function(t,e){null!=e&&e.showInPlayBar&&(this._option.showInPlayBar="string"==typeof e.showInPlayBar?e.showInPlayBar:h()({},e.showInPlayBar)),null!=e&&e.showInContextMenu&&(this._option.showInContextMenu="string"==typeof e.showInContextMenu?e.showInContextMenu:h()({},e.showInContextMenu)),null!=e&&e.svgRaw&&(this._option.svgRaw=h()({},this._option.svgRaw,e.svgRaw)),t&&(this._player=t,this._i18n=t.getPluginInstance(Nc))},i.afterInstall=function(t){var e=this;t&&(this._player=t,this._mainContainer=this._player.mainContainer),this._mainContainer&&(this._resizeObserver=new an((function(){e.innerRotate=e._innerRotate})),this._resizeObserver.observe(this._mainContainer)),t.on(Bc.ATTRIBUTE_CHANGE_SRC,this._onPlayerSrcChanged),t.on(Bc.MANIFEST_PARSED,this._onPlayerManifestParsed),t.on(Bc.VIDEO_RENDERER_CHANGE,this._onPlayerRendererChange)},i.beforeUninstall=function(t){this._callback.destroy(),this._mirrorCallback.destroy()},i.afterUninstall=function(t){this._resizeLoop&&(clearInterval(this._resizeLoop),this._resizeLoop=void 0),this._resizeObserver&&this._mainContainer&&(this._resizeObserver.unobserve(this._mainContainer),this._resizeObserver.disconnect()),t.off(Bc.ATTRIBUTE_CHANGE_SRC,this._onPlayerSrcChanged),t.off(Bc.MANIFEST_PARSED,this._onPlayerManifestParsed),t.off(Bc.VIDEO_RENDERER_CHANGE,this._onPlayerRendererChange),this.removeAllListeners()},i._text=function(t){var i;return(null==(i=this._i18n)?void 0:i.text(e.label,t))||""},i._isShow=function(t,e){var i="string"==typeof t?t:t[e];return"always"===i||(Hn?"mobile"===i:"pc"===i)},i._updateInnerRotate=function(){var t=this._player,e=this._mainContainer,i=this._normalizeAngle(this._innerRotate);if(i%90==0&&e&&t&&t.video){var n={transformOrigin:"left top"},r=e.getBoundingClientRect().height,a=e.getBoundingClientRect().width;90===i?(n.width=n.maxWidth=r/a*100+"%",n.height=n.maxHeight=a/r*100+"%",n.transform="rotate(90deg) translateY(-100%)",this._isMirror&&(n.transform+=" scaleX(-1) translateX(-100%)"),n.margin="0"):180===i?(n.width=n.maxWidth="",n.height=n.maxHeight="",this._isMirror?n.transform="rotate(180deg) translateY(-100%) scaleX(-1)":n.transform="rotate(180deg) translateY(-100%) translateX(-100%)",n.margin="0"):270===i?(n.width=n.maxWidth=r/a*100+"%",n.height=n.maxHeight=a/r*100+"%",this._isMirror?n.transform="rotate(270deg) scaleX(-1)":n.transform="rotate(270deg) translateX(-100%)",n.margin="0"):(n.width=n.maxWidth="",n.height=n.maxHeight="",this._isMirror?n.transform="scaleX(-1) translateX(-100%)":n.transform="",n.margin=""),t.canvas&&h()(t.canvas.style,n),t.video&&h()(t.video.style,n),t.yodaDom&&h()(t.yodaDom.style,n)}},i._setOuterRotate=function(t,e){(e=this._normalizeAngle(e))%90==0&&(90===e?(t.style.width="100vh",t.style.height="100vw",t.style.transformOrigin="left top",t.style.transform="rotate("+e+"deg) translate(0, -100%)"):180===e?(t.style.width="100vw",t.style.height="100vh",t.style.transformOrigin="left top",t.style.transform="rotate("+e+"deg) translate(-100%, -100%)"):270===e?(t.style.width="100vh",t.style.height="100vw",t.style.transformOrigin="left top",t.style.transform="rotate("+e+"deg) translate(-100%, 0)"):0===e&&(t.style.width="100vw",t.style.height="100vh",t.style.transformOrigin="",t.style.transform=""))},i._normalizeAngle=function(t){return(t%360+360)%360},_()(e,[{key:"innerRotate",get:function(){return this._innerRotate},set:function(t){t%90==0&&(this._innerRotate=this._normalizeAngle(t),this._updateInnerRotate()),this.emit(Bc.ATTRIBUTE_CHANGE),this._callback.call(0===t)}},{key:"outerRotate",get:function(){return this._outerRotate},set:function(t){t%90==0&&(this._outerRotate=this._normalizeAngle(t),this._mainContainer&&this._setOuterRotate(this._mainContainer,this._outerRotate)),this.emit(Bc.ATTRIBUTE_CHANGE)}},{key:"isMirror",get:function(){return this._isMirror},set:function(t){this._isMirror=t,this._updateInnerRotate(),this._mirrorCallback.call(t)}},{key:"controlsSoltBtns",get:function(){var t,e,i,n,r,a,o=this,s=[];if(1===this._stereoType)return s;var u=this._option.showInContextMenu;if(u&&this._isShow(u,"counterClockwise")){var c={role:"rotate-counter-clockwise-context-menu",slotPos:kc.CONTEXT_MENU,getChecked:function(){return!1},svgRaw:null==(t=this._option.svgRaw)?void 0:t.counterClockwise,getText:function(){return o._text("rotateCounterClockwise")||"逆时针旋转画面"},getTips:function(){return o._text("rotateCounterClockwise")||"逆时针旋转画面"},onClick:function(){return o.innerRotate-=90},callback:this._callback};s.push(c)}if(u&&this._isShow(u,"clockwise")){var l={role:"rotate-clockwise-context-menu",slotPos:kc.CONTEXT_MENU,getChecked:function(){return!1},svgRaw:null==(e=this._option.svgRaw)?void 0:e.clockwise,getText:function(){return o._text("rotateClockwise")||"顺时针旋转画面"},getTips:function(){return o._text("rotateClockwise")||"顺时针旋转画面"},onClick:function(){return o.innerRotate+=90},callback:this._callback};s.push(l)}if(u&&this._isShow(u,"mirror")){var h={role:"mirror-context-menu",slotPos:kc.CONTEXT_MENU,getChecked:function(){return o.isMirror},getText:function(){return o._text("mirrorImage")||"镜像画面"},svgRaw:null==(i=this._option.svgRaw)?void 0:i.mirror,onClick:function(){return o.isMirror=!o.isMirror},callback:this._mirrorCallback};s.push(h)}var d=this._option.showInPlayBar;if(d&&this._isShow(d,"counterClockwise")){var f={role:"rotate-counter-clockwise-btn",slotPos:kc.PLAY_BAR_RIGHT,getChecked:function(){return!1},svgRaw:null==(n=this._option.svgRaw)?void 0:n.counterClockwise,getTips:function(){return o._text("rotateCounterClockwise")||"逆时针旋转画面"},onClick:function(){return o.innerRotate-=90},callback:this._callback};s.push(f)}if(d&&this._isShow(d,"clockwise")){var p={role:"rotate-clockwise-btn",slotPos:kc.PLAY_BAR_RIGHT,getChecked:function(){return!1},svgRaw:null==(r=this._option.svgRaw)?void 0:r.clockwise,getTips:function(){return o._text("rotateClockwise")||"顺时针旋转画面"},onClick:function(){return o.innerRotate+=90},callback:this._callback};s.push(p)}if(d&&this._isShow(d,"mirror")){var _={role:"mirror-btn",slotPos:kc.PLAY_BAR_RIGHT,getTips:function(){return o._text("mirrorImage")},svgRaw:null==(a=this._option.svgRaw)?void 0:a.mirror,onClick:function(){return o.isMirror=!o.isMirror},callback:this._mirrorCallback};s.push(_)}return s}}])}(Uc);Dc(Vc,"version","1.1.0-alpha.0");var Fc=Vc;!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.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(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var jc=Object.defineProperty,Hc=function(t,e,i){return function(t,e,i){e in t?jc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i};!function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("")),document.head.appendChild(t)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();var Gc=Object.defineProperty,zc=function(t,e,i){return function(t,e,i){e in t?Gc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i}(t,"symbol"!=typeof e?e+"":e,i),i},Wc=function(t){function e(){return t.apply(this,arguments)||this}f()(e,t),e.isInstanceOfPlugin=function(t){return"function"==typeof t.beforeInstall&&"function"==typeof t.afterInstall&&"function"==typeof t.beforeUninstall&&"function"==typeof t.afterUninstall&&"function"==typeof t.getLabel};var i=e.prototype;return i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.beforeUninstall=function(t){},i.afterUninstall=function(t){},_()(e,[{key:"controlsSoltBtns",get:function(){}}])}(Wn);zc(Wc,"label"),zc(Wc,"version"),zc(Wc,"isSupported"),zc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Wc),"label","ControlsPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},e}(Wc),"label","I18nPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}f()(e,t);var i=e.prototype;return i.getLabel=function(){return e.label},i.beforeInstall=function(t,e){},i.afterInstall=function(t,e){},i.addBizLog=function(t,e){},i.appendSummaryField=function(t,e){},e}(Wc),"label","LoggerPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","HotkeyPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","PlayInfoPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","RotatePlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","PreviewPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","MaskPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","VRPlugin"),zc(function(t){function e(){return t.apply(this,arguments)||this}return f()(e,t),e.prototype.getLabel=function(){return e.label},e}(Wc),"label","DanmakuPlugin");var Kc=function(t){return t.ERROR="error",t.MANIFEST_PARSED="manifestparsed",t.LEVEL_SWITCHING="levelswitching",t.LEVEL_SWITCHED="levelswitched",t.LEVEL_SWITCH_PLAYING="levelswitchplaying",t.LEVEL_SWITCH_FAILED="levelswitchfailed",t.LEVEL_UPDATED="levelupdated",t.AUDIO_TRACKS_SWITCHING="audiotrackswitching",t.AUDIO_TRACKS_SWITCHED="audiotrackswitched",t.LOADSTART="loadstart",t.PROGRESS="progress",t.SUSPEND="suspend",t.ABORT="abort",t.EMPTIED="emptied",t.STALLED="stalled",t.LOADEDMETADATA="loadedmetadata",t.LOADEDDATA="loadeddata",t.CANPLAY="canplay",t.CANPLAYTHROUGH="canplaythrough",t.PLAYING="playing",t.WAITING="waiting",t.SEEKING="seeking",t.SEEKED="seeked",t.ENDED="ended",t.DURATIONCHANGE="durationchange",t.TIMEUPDATE="timeupdate",t.PLAY="play",t.PAUSE="pause",t.RATECHANGE="ratechange",t.RESIZE="resize",t.VOLUMECHANGE="volumechange",t.ENTER_PICTURE_IN_PICTURE="enterpictureinpicture",t.LEAVE_PICTURE_IN_PICTURE="leavepictureinpicture",t.REPORT="report",t.VIDEO_RENDERER_CHANGE="videorendererchange",t.FULLSCREEN_CHANGE="fullscreenchange",t.ATTRIBUTE_CHANGE="attribute:change",t.INTERACTION="interaction",t.LIVE_SHIFT_CHANGE="liveshiftchange",t.LIVE_SHIFT_TYPE_CHANGE="liveshifttypechange",t.OBJECT_FIT_CHANGE="objectfitchange",t.ATTRIBUTE_CHANGE_CONFIG="attribute:change:config",t.ATTRIBUTE_CHANGE_SRC="attribute:change:src",t.ATTRIBUTE_CHANGE_VIDEO_ID="attribute:change:videoid",t.ATTRIBUTE_CHANGE_PREVIEW_URL="attribute:change:previewurl",t.ATTRIBUTE_CHANGE_MASK_URL="attribute:change:maskurl",t.ATTRIBUTE_CHANGE_CROSS_ORIGIN="attribute:change:crossorigin",t.ATTRIBUTE_CHANGE_PRELOAD="attribute:change:preload",t.ATTRIBUTE_CHANGE_CURRENT_TIME="attribute:change:currenttime",t.ATTRIBUTE_CHANGE_DEFAULT_PLAYBACK_RATE="attribute:change:defaultplaybackrate",t.ATTRIBUTE_CHANGE_PLAYBACK_RATE="attribute:change:playbackrate",t.ATTRIBUTE_CHANGE_AUTOPLAY="attribute:change:autoplay",t.ATTRIBUTE_CHANGE_LOOP="attribute:change:loop",t.ATTRIBUTE_CHANGE_CONTROLS="attribute:change:controls",t.ATTRIBUTE_CHANGE_VOLUME="attribute:change:volume",t.ATTRIBUTE_CHANGE_MUTED="attribute:change:muted",t.ATTRIBUTE_CHANGE_DEFAULT_MUTED="attribute:change:defaultmuted",t.ATTRIBUTE_CHANGE_POSTER="attribute:change:poster",t.ATTRIBUTE_CHANGE_DISABLE_PICTURE_IN_PICTURE="attribute:change:disablepictureinpicture",t.ATTRIBUTE_CHANGE_PLAYSINLINE="attribute:change:playsinline",t.ATTRIBUTE_CHANGE_DISABLE_ADAPTIVE="attribute:change:disableadaptive",t.ATTRIBUTE_CHANGE_DISABLE_DOWNLOAD="attribute:change:disabledownload",t.ATTRIBUTE_CHANGE_DISABLE_MASK="attribute:change:disablemask",t.ATTRIBUTE_CHANGE_DISABLE_HOTKEY="attribute:change:disablehotkey",t.ATTRIBUTE_CHANGE_DISABLE_DANMAKU="attribute:change:disabledanmaku",t.ATTRIBUTE_CHANGE_DANMAKU_RENDERING="attribute:change:danmakurendering",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS="attribute:change:danmakucontrolspos",t.ATTRIBUTE_CHANGE_DANMAKU_CONTROLS_POS_FULLSCREEN="attribute:change:danmakucontrolsposfullscreen",t.ATTRIBUTE_CHANGE_CURRENT_LEVEL="attribute:change:currentlevel",t.ATTRIBUTE_CHANGE_NEXT_LEVEL="attribute:change:nextlevel",t.ATTRIBUTE_CHANGE_CURRENT_FRAME="attribute:change:currentframe",t.ATTRIBUTE_CHANGE_AUDIO_TRACK="attribute:change:audiotrack",t.ATTRIBUTE_CHANGE_PREFETCH="attribute:change:prefetch",t.ATTRIBUTE_CHANGE_SHOW_PROGRESS="attribute:change:showprogress",t.ATTRIBUTE_CHANGE_SHOW_TIME="attribute:change:showtime",t.ATTRIBUTE_CHANGE_SHOW_NEXT="attribute:change:shownext",t.ATTRIBUTE_CHANGE_SHOW_PREV="attribute:change:showprev",t.ATTRIBUTE_CHANGE_BIZ_DATA="attribute:change:bizdata",t.ATTRIBUTE_CHANGE_LIVE_TIME="attribute:change:livetime",t.ATTRIBUTE_CHANGE_SHOW_INFO_PANEL="attribute:change:showinfopanel",t.CLICK_NEXT="clicknext",t.CLICK_LOGIN="clicklogin",t.CLICK_REGISTER="clickregister",t.CLICK_VIP="clickvip",t}(Kc||{}),Yc=function(t){return t.VIDEO="video",t.VIDEO_INTERACTIVE="videoInteractive",t.DEFAULT="default",t}(Yc||{}),Qc="_watermark-video-fit_1h6i8_1",Xc="_watermark-fill-fit_1h6i8_6",Zc=function(t){return t.VIDEO="video",t.FILL="fill",t}(Zc||{}),qc=function(t){function e(){var e;return e=t.apply(this,arguments)||this,Hc(c()(e),"_player"),Hc(c()(e),"_container"),Hc(c()(e),"_fit","video"),Hc(c()(e),"_observer"),Hc(c()(e),"_updateDomPosition",(function(){var t=e._player;if(e._container&&"video"===e._fit&&t){e._container.style.display=e._getContainerDisplay();var i=t.videoLayer.getBoundingClientRect(),n=i.width,r=i.height,a=t.videoWidth,o=t.videoHeight;if(!a||!o)return;if(a/o>n/r){var s=(r-o/a*n)/2;e._container.style.top=s+"px",e._container.style.bottom=s+"px",e._container.style.left="0",e._container.style.right="0"}else{var u=(n-a/o*r)/2;e._container.style.left=u+"px",e._container.style.right=u+"px",e._container.style.top="0",e._container.style.bottom="0"}}})),e}f()(e,t);var i=e.prototype;return i.afterInstall=function(t){var e,i=this;this._player=t;var n=this._player.mainContainer,r=null==n?void 0:n.querySelector('[kwai-player-watermark=""]');r&&n&&(this._container=this._player.createSubContainer(Yc.VIDEO),this._applyClassName(this._container,this._fit),this._container.style.display=this._getContainerDisplay(),null==(e=this._container)||e.appendChild(r),this._observer=new an((function(){i._updateDomPosition()})),this._observer.observe(n)),t.on(Kc.RESIZE,this._updateDomPosition)},i.beforeUninstall=function(t){this._container&&(null==t||t.removeSubContainer(this._container)),t.off(Kc.REPORT,this._updateDomPosition),this._player=void 0,this._container=void 0,this._observer&&(this._observer.disconnect(),this._observer=void 0)},i.getLabel=function(){return e.label},i._applyClassName=function(t,e){t.className="video"===e?Qc:Xc},i._getContainerDisplay=function(){var t;return null!=(t=this._player)&&t.videoWidth||"video"!==this._fit?"":"none"},_()(e,[{key:"fit",set:function(t){"video"===this._fit&&this._container&&(this._container.style.top="",this._container.style.bottom="",this._container.style.left="",this._container.style.right=""),this._fit=t,this._container&&(this._container.style.display=this._getContainerDisplay(),this._applyClassName(this._container,this._fit)),this._updateDomPosition()}},{key:"get",get:function(){return this._fit}}])}(Wc);Hc(qc,"version","1.1.0-alpha.0"),Hc(qc,"label","WaterMarkPlugin");var Jc=qc;qs.defaultDict=Xo,ii.register(qs),ii.register(Ou),ii.register(Jc),ii.register(Qo),ii.register(nc),ii.register(dc),ii.register(wc),ii.register(Hs),ii.register(Fc),ii.register(Is),ii.packVersion="1.1.19.vue2"},function(t,e){function i(e,n){return t.exports=i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,i(e,n)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){var n=function(t){"use strict";var e=Object.prototype,i=e.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,i){return t[e]=i}}function c(t,e,i,r){var a=e&&e.prototype instanceof d?e:d,o=Object.create(a.prototype),s=new I(r||[]);return n(o,"_invoke",{value:y(t,i,s)}),o}function l(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h={};function d(){}function f(){}function p(){}var _={};u(_,a,(function(){return this}));var v=Object.getPrototypeOf,A=v&&v(v(R([])));A&&A!==e&&i.call(A,a)&&(_=A);var g=p.prototype=d.prototype=Object.create(_);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;n(this,"_invoke",{value:function(n,a){function o(){return new e((function(r,o){!function n(r,a,o,s){var u=l(t[r],t,a);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(h).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(u.arg)}(n,a,r,o)}))}return r=r?r.then(o,o):o()}})}function y(t,e,i){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return w()}for(i.method=r,i.arg=a;;){var o=i.delegate;if(o){var s=E(o,i);if(s){if(s===h)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var u=l(t,e,i);if("normal"===u.type){if(n=i.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(n="completed",i.method="throw",i.arg=u.arg)}}}function E(t,e){var i=e.method,n=t.iterator[i];if(void 0===n)return e.delegate=null,"throw"===i&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),h;var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function R(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:w}}function w(){return{value:void 0,done:!0}}return f.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:f,configurable:!0}),f.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),u(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,i,n,r,a){void 0===a&&(a=Promise);var o=new b(c(e,i,n,r),a);return t.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},m(g),u(g,s,"Generator"),u(g,a,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=R,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(i,n){return o.type="throw",o.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;T(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:R(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),h}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}])}));