/*! @metadata nano: 4.9.29-d7e0f0d2 (2025-03-27T15:41:28+08:00) */ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){var __webpack_modules__={22128:function(e,t,r){ e.exports=r(35985)('/*! @metadata nano: 4.9.29-d7e0f0d2 (2025-03-27T15:41:28+08:00) */!function(){function t(e){var r="function"==typeof Map?new Map:void 0;return t=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return function(t,e,r){if(n())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var i=new(t.bind.apply(t,o));return r&&u(i,r.prototype),i}(t,arguments,o(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),u(e,t)},t(e)}function e(t,e,r){return e=o(e),function(t,e){if(e&&("object"==s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t)}(t,n()?Reflect.construct(e,r||[],o(t).constructor):e.apply(t,r))}function n(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(n=function(){return!!t})()}function r(){return r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=o(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},r.apply(null,arguments)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function s(t){return s="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},s(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;a(this,t),this.targetCount=e,this.callback=n,this.context=r,this.count=0}),[{key:"increment",value:function(t){this.count+=t,this.count>=this.targetCount&&(this.callback.call(this.context),this.count=this.count%this.targetCount)}},{key:"willMeetTarget",value:function(t){return this.count+t>=this.targetCount}},{key:"reset",value:function(){this.count=0}}])}(),p=function(){return l((function t(e){a(this,t),this.length=e,this.array=new Float32Array(e),this.count=0}),[{key:"add",value:function(t){var e=this.length-this.count,n=t.slice(0,e);this.array.set(n,this.count),this.count+=n.length}},{key:"full",get:function(){return this.length===this.count}}])}(),d=function(){return l((function t(e){a(this,t),this.channelCount=e.channelCount,this.length=e.length,this.count=0,this.full=!1}),[{key:"bins",get:function(){var t=this;return this._bins||(this._bins=Array(this.channelCount).fill(null).map((function(){return t.createBin()}))),this._bins}},{key:"add",value:function(t){this.bins.forEach((function(e,n){return e.add(t[n])})),this.full=(this.count+=t[0].length)>this.length}},{key:"dump",value:function(){return this.bins.map((function(t){return t.array}))}},{key:"createBin",value:function(){return new p(this.length)}}])}();function y(t){var e=t.value,n=t.index;return(e+n*(t.mean||0))/(n+1)}var g=[1,1,1,1.41,1.41],m=function(){return l((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a(this,t),this.powers=e.map((function(t){return function(t){for(var e=0,n=t.length-1;n>=0;n--)e+=Math.pow(t[n],2);return e/t.length}(t)}))}),[{key:"weightedPowers",value:function(t){return(t||this.powers).map((function(t,e){return t*g[e]}))}},{key:"loudness",value:function(t){return 10*Math.log10(function(t){for(var e=0,n=t.length-1;n>=0;n--)e+=t[n];return e}(this.weightedPowers(t)))-.691}}])}(),k=function(){return l((function t(e){a(this,t),this.name=e.name,this.delegate=e.delegate,this.sampleRate=e.sampleRate,this.blockDuration=e.blockDuration,this.blockMargin=e.blockMargin,this.updateDuration=e.updateDuration,this.blocks=[],this.fullBlocks=[]}),[{key:"blockLengthInSamples",get:function(){return Math.round(this.blockDuration/1e3*this.sampleRate)}},{key:"blockMarginLengthInSamples",get:function(){return Math.round(this.blockMargin/1e3*this.sampleRate)}},{key:"updateLengthInSamples",get:function(){return Math.round(this.updateDuration/1e3*this.sampleRate)}},{key:"blockMarginCounter",get:function(){return this._blockMarginCounter=this._blockMarginCounter||new f(this.blockMarginLengthInSamples)}},{key:"updateCounter",get:function(){return this._updateCounter=this._updateCounter||new f(this.updateLengthInSamples,this.update,this)}},{key:"input",value:function(t){var e=this;this.channelCount=t.length;var n=t[0].length;this.blocks.length&&!this.blockMarginCounter.willMeetTarget(n)||this.blocks.push(this.createBlock()),this.blocks=this.blocks.filter((function(n){return n.add(t),!n.full||(e.fullBlocks.push(n),!1)})),this.updateCounter.increment(n),this.blockMarginCounter.increment(n)}},{key:"createBlock",value:function(){return new d({channelCount:this.channelCount,length:this.blockLengthInSamples})}},{key:"update",value:function(){var t=this.fullBlocks[0]?this.fullBlocks.shift():this.blocks[0];this.delegate.update(this.name,new m(t.dump()).loudness())}},{key:"reset",value:function(){this.blocks=[],this.fullBlocks=[],this.blockMarginCounter.reset(),this.updateCounter.reset(),this.delegate.update(this.name,new m(this.createBlock().dump()).loudness())}}])}(),b=function(t){function n(t){var r;return a(this,n),(r=e(this,n,[t])).measurements=[],r.meanPowers=[],r}return i(n,t),l(n,[{key:"update",value:function(){for(;this.fullBlocks.length;){var t=this.fullBlocks.shift(),e=new m(t.dump());e.loudness()>-70&&this.addMeasurement(e)}var n=this.relativeThreshold,r=this.measurements.filter((function(t){return t.loudness()>n})),o=function(t){for(var e=[],n=t.length,r=0;r1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,a=[],s=0,u=0;t>2],i=(3&l)<<4,u=1;break;case 1:a[s++]=n[i|l>>4],i=(15&l)<<2,u=2;break;case 2:a[s++]=n[i|l>>6],a[s++]=n[63&l],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=n[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,s=0,u=0;u1)break;if(void 0===(l=i[l]))throw Error(a);switch(s){case 0:n=l,s=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,s=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,s=3;break;case 3:t[r++]=(3&n)<<6|l,s=0}}if(1===s)throw Error(a);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},46503:function(e){"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!=typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),u=new Array(a.length),l=0;l0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=n*Math.pow(2,-u))>>>0,i,o+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function a(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,u=a>>>20&2047,l=4294967296*(1048575&a)+o;return 2047===u?l?NaN:s*(1/0):0===u?5e-324*s*l:s*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},96773:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},33083:function(e,t){"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},99819:function(e){"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(o=e(n),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},24206:function(e,t){"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(e,t,r){for(var n,i,o=r,a=0;a>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},35985:function(e){e.exports=function(e){try{var t;try{(t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),t=t.getBlob("application/javascript; charset=utf-8")}catch(r){t=new Blob([e],{type:"application/javascript; charset=utf-8"})}return URL.createObjectURL(t)}catch(t){return"data:application/javascript,"+encodeURIComponent(e)}}},14523:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),c=0,d=u>0?a-4:a;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,l=n-i;sl?l:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},79977:function(e,t){"use strict";var r;function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t,i){if(!i||n(i.value)!==r.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:r.boolTrue,get:function(){var e=i.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:r.boolTrue,writable:r.boolTrue}),e}}}(function(e){e.typeOfFunction="function",e.boolTrue=!0})(r||(r={})),t.ak=i,t.ZP=i},47850:function(e,t){t.defaults={},t.set=function(e,r,n){var i=n||{},o=t.defaults,a=i.expires||o.expires,s=i.domain||o.domain,u=void 0!==i.path?i.path:void 0!==o.path?o.path:"/",l=void 0!==i.secure?i.secure:o.secure,c=void 0!==i.httponly?i.httponly:o.httponly,d=void 0!==i.samesite?i.samesite:o.samesite,f=a?new Date("number"==typeof a?(new Date).getTime()+864e5*a:a):0;document.cookie=e.replace(/[^+#$&^`|]/g,encodeURIComponent).replace("(","%28").replace(")","%29")+"="+r.replace(/[^+#$&/:<-\[\]-}]/g,encodeURIComponent)+(f&&f.getTime()>=0?";expires="+f.toUTCString():"")+(s?";domain="+s:"")+(u?";path="+u:"")+(l?";secure":"")+(c?";httponly":"")+(d?";samesite="+d:"")},t.get=function(e){for(var t=document.cookie.split(";");t.length;){var r=t.pop(),n=r.indexOf("=");if(n=n<0?r.length:n,decodeURIComponent(r.slice(0,n).replace(/^\s+/,""))===e)return decodeURIComponent(r.slice(n+1))}return null},t.erase=function(e,r){t.set(e,"",{expires:-1,domain:r&&r.domain,path:r&&r.path,secure:0,httponly:0})},t.all=function(){for(var e={},t=document.cookie.split(";");t.length;){var r=t.pop(),n=r.indexOf("=");n=n<0?r.length:n,e[decodeURIComponent(r.slice(0,n).replace(/^\s+/,""))]=decodeURIComponent(r.slice(n+1))}return e}},13510:function(e,t,r){"use strict";var n=r(18020),i=r(64986),o=r(96126),a=r(60233);e.exports=a||n.call(o,i)},75522:function(e,t,r){"use strict";var n=r(18020),i=r(64986),o=r(13510);e.exports=function(){return o(n,i,arguments)}},64986:function(e){"use strict";e.exports=Function.prototype.apply},96126:function(e){"use strict";e.exports=Function.prototype.call},58995:function(e,t,r){"use strict";var n=r(18020),i=r(74818),o=r(96126),a=r(13510);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return a(n,o,e)}},60233:function(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},83849:function(e,t,r){"use strict";var n=r(25121),i=r(75181),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},75181:function(e,t,r){"use strict";var n=r(70920),i=r(43961),o=r(58995),a=r(75522);e.exports=function(e){var t=o(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:a}):e.exports.apply=a},3789:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r1?arguments[1]:void 0)}},74699:function(e,t,r){"use strict";var n=r(88351),i=r(46956),o=r(54708),a=r(4695),s=r(85972),u=r(11827),l=r(95480);e.exports=function(e){var t,r,c,d,f,p,h=i(e),y="function"==typeof this?this:Array,m=arguments.length,g=m>1?arguments[1]:void 0,v=void 0!==g,b=l(h),_=0 ;if(v&&(g=n(g,m>2?arguments[2]:void 0,2)),null==b||y==Array&&a(b))for(r=new y(t=s(h.length));t>_;_++)p=v?g(h[_],_):h[_],u(r,_,p);else for(f=(d=b.call(h)).next,r=new y;!(c=f.call(d)).done;_++)p=v?o(d,g,[c.value,_],!0):c.value,u(r,_,p);return r.length=_,r}},16679:function(e,t,r){var n=r(36857),i=r(85972),o=r(78331),a=function(e){return function(t,r,a){var s,u=n(t),l=i(u.length),c=o(a,l);if(e&&r!=r){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},71930:function(e,t,r){var n=r(88351),i=r(31579),o=r(46956),a=r(85972),s=r(10296),u=[].push,l=function(e){var t=1==e,r=2==e,l=3==e,c=4==e,d=6==e,f=7==e,p=5==e||d;return function(h,y,m,g){for(var v,b,_=o(h),E=i(_),S=n(y,m,3),A=a(E.length),w=0,T=g||s,R=t?T(h,A):r||f?T(h,0):void 0;A>w;w++)if((p||w in E)&&(b=S(v=E[w],w,_),e))if(t)R[w]=b;else if(b)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:u.call(R,v)}else switch(e){case 4:return!1;case 7:u.call(R,v)}return d?-1:l||c?c:R}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterOut:l(7)}},85880:function(e,t,r){"use strict";var n=r(91895);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},30673:function(e,t,r){var n=r(93248),i=r(91895),o=r(7677),a=Object.defineProperty,s={},u=function(e){throw e};e.exports=function(e,t){if(o(s,e))return s[e];t||(t={});var r=[][e],l=!!o(t,"ACCESSORS")&&t.ACCESSORS,c=o(t,0)?t[0]:u,d=o(t,1)?t[1]:void 0;return s[e]=!!r&&!i((function(){if(l&&!n)return!0;var e={length:-1};l?a(e,1,{enumerable:!0,get:u}):e[1]=1,r.call(e,c,d)}))}},10296:function(e,t,r){var n=r(95110),i=r(49949),o=r(60422)("species");e.exports=function(e,t){var r;return i(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!i(r.prototype)?n(r)&&null===(r=r[o])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},54708:function(e,t,r){var n=r(56019),i=r(11372);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){throw i(e),t}}},45098:function(e,t,r){var n=r(60422)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},75690:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},54530:function(e,t,r){var n=r(17957),i=r(75690),o=r(60422)("toStringTag"),a="Arguments"==i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?r:a?i(t):"Object"==(n=i(t))&&"function"==typeof t.callee?"Arguments":n}},55353:function(e,t,r){"use strict";var n=r(31871).f,i=r(15780),o=r(35282),a=r(88351),s=r(53170),u=r(54096),l=r(19772),c=r(80877),d=r(93248),f=r(99751).fastKey,p=r(27519),h=p.set,y=p.getterFor;e.exports={getConstructor:function(e,t,r,l){var c=e((function(e,n){s(e,c,t),h(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),d||(e.size=0),null!=n&&u(n,e[l],{that:e,AS_ENTRIES:r})})),p=y(t),m=function(e,t,r){var n,i,o=p(e),a=g(e,t);return a?a.value=r:(o.last=a={index:i=f(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=a),n&&(n.next=a),d?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},g=function(e,t){var r,n=p(e),i=f(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return o(c.prototype,{clear:function(){for(var e=p(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,d?e.size=0:this.size=0},delete:function(e){var t=this,r=p(t),n=g(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),d?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=p(this),n=a(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!g(this,e)}}),o(c.prototype,r?{get:function(e){var t=g(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),d&&n(c.prototype,"size",{get:function(){return p(this).size}}),c},setStrong:function(e,t,r){var n=t+" Iterator",i=y(t),o=y(n);l(e,t,(function(e,t){h(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),c(t)}}},66850:function(e,t,r){"use strict";var n=r(35282),i=r(99751).getWeakData,o=r(56019),a=r(95110),s=r(53170),u=r(54096),l=r(71930),c=r(7677),d=r(27519),f=d.set,p=d.getterFor,h=l.find,y=l.findIndex,m=0,g=function(e){return e.frozen||(e.frozen=new v)},v=function(){this.entries=[]},b=function(e,t){return h(e.entries,(function(e){return e[0]===t}))};v.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=y(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,l){var d=e((function(e,n){s(e,d,t),f(e,{type:t,id:m++,frozen:void 0}),null!=n&&u(n,e[l],{that:e,AS_ENTRIES:r})})),h=p(t),y=function(e,t,r){var n=h(e),a=i(o(t),!0);return!0===a?g(n).set(t,r):a[n.id]=r,e};return n(d.prototype,{delete:function(e){var t=h(this);if(!a(e))return!1;var r=i(e);return!0===r?g(t).delete(e):r&&c(r,t.id)&&delete r[t.id]},has:function(e){var t=h(this);if(!a(e))return!1;var r=i(e);return!0===r?g(t).has(e):r&&c(r,t.id)}}),n(d.prototype,r?{get:function(e){var t=h(this);if(a(e)){var r=i(e);return!0===r?g(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),d}}},32747:function(e,t,r){"use strict";var n=r(58023),i=r(82776),o=r(77180),a=r(22408),s=r(99751),u=r(54096),l=r(53170),c=r(95110),d=r(91895),f=r(45098),p=r(96801),h=r(32195);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),g=y?"set":"add",v=i[e],b=v&&v.prototype,_=v,E={},S=function(e){var t=b[e];a(b,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!c(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!c(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(o(e,"function"!=typeof v||!(m||b.forEach&&!d((function(){(new v).entries().next()})))))_=r.getConstructor(t,e,y,g),s.REQUIRED=!0;else if(o(e,!0)){var A=new _,w=A[g](m?{}:-0,1)!=A,T=d((function(){A.has(1)})),R=f((function(e){new v(e)})),C=!m&&d((function(){for(var e=new v,t=5;t--;)e[g](t,t);return!e.has(-0)}));R||((_=t((function(t,r){l(t,_,e);var n=h(new v,t,_);return null!=r&&u(r,n[g],{that:n,AS_ENTRIES:y}),n}))).prototype=b,b.constructor=_),(T||C)&&(S("delete"),S("has"),y&&S("get")),(C||w)&&S(g),m&&b.clear&&delete b.clear}return E[e]=_,n({global:!0,forced:_!=v},E),p(_,e),m||r.setStrong(_,e,y),_}},43486:function(e,t,r){var n=r(7677),i=r(8992),o=r(73227),a=r(31871);e.exports=function(e,t){for(var r=i(t),s=a.f,u=o.f,l=0;lp;p++)if((y=w(e[p]))&&y instanceof c)return y;return new c(!1)}d=f.call(e)}for(m=d.next;!(g=m.call(d)).done;){try{y=w(g.value)}catch(e){throw l(d),e}if("object"==n(y)&&y&&y instanceof c)return y}return new c(!1)}},11372:function(e,t,r){var n=r(56019);e.exports=function(e){var t=e.return;if(void 0!==t)return n(t.call(e)).value}},71891:function(e,t,r){"use strict";var n,i,o,a=r(41021),s=r(83041),u=r(7677),l=r(60422),c=r(57331),d=l("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(n=i):f=!0),null==n&&(n={}),c||u(n,d)||s(n,d,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},4927:function(e){e.exports={}},43327:function(e,t,r){var n,i,o,a,s,u,l,c,d=r(82776),f=r(73227).f,p=r(35374).set,h=r(24457),y=r(73806),m=d.MutationObserver||d.WebKitMutationObserver,g=d.document,v=d.process,b=d.Promise,_=f(d,"queueMicrotask"),E=_&&_.value;E||(n=function(){var e,t;for(y&&(e=v.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?a():o=void 0,e}}o=void 0,e&&e.enter()},!h&&!y&&m&&g?(s=!0,u=g.createTextNode(""),new m(n).observe(u,{characterData:!0}),a=function(){u.data=s=!s}):b&&b.resolve?(l=b.resolve(void 0),c=l.then,a=function(){c.call(l,n)}):a=y?function(){v.nextTick(n)}:function(){p.call(d,n)}),e.exports=E||function(e){var t={fn:e,next:void 0};o&&(o.next=t),i||(i=t,a()),o=t}},81933:function(e,t,r){var n=r(91895);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},79551:function(e,t,r){var n=r(82776),i=r(55174),o=n.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o))},21106:function(e,t,r){var n=r(25141);e.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},18555:function(e,t,r){"use strict";var n=r(93248),i=r(91895),o=r(47936),a=r(52315),s=r(91629),u=r(46956),l=r(31579),c=Object.assign,d=Object.defineProperty;e.exports=!c||i((function(){if(n&&1!==c({b:1},c(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(e){t[e]=e})),7!=c({},e)[r]||o(c({},t)).join("")!=i}))?function(e,t){for(var r=u(e),i=arguments.length,c=1,d=a.f,f=s.f;i>c;)for(var p,h=l(arguments[c++]),y=d?o(h).concat(d(h)):o(h),m=y.length,g=0;m>g;)p=y[g++],n&&!f.call(h,p)||(r[p]=h[p]);return r}:c},15780:function(e,t,r){var n,i=r(56019),o=r(8630),a=r(35732),s=r(49605),u=r(53859),l=r(84163),c=r(9002),d="prototype",f="script",p=c("IE_PROTO"),h=function(){},y=function(e){return"<"+f+">"+e+""},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,r;m=n?function(e){e.write(y("")),e.close();var t=e.parentWindow.Object;return e=null,t}(n):(t=l("iframe"),r="java"+f+":",t.style.display="none",u.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(y("document.F=Object")),e.close(),e.F);for(var i=a.length;i--;)delete m[d][a[i]];return m()};s[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(h[d]=i(e),r=new h,h[d]=null,r[p]=e):r=m(),void 0===t?r:o(r,t)}},8630:function(e,t,r){var n=r(93248),i=r(31871),o=r(56019),a=r(47936);e.exports=n?Object.defineProperties:function(e,t){o(e);for(var r,n=a(t),s=n.length,u=0;s>u;)i.f(e,r=n[u++],t[r]);return e}},31871:function(e,t,r){var n=r(93248),i=r(156),o=r(56019),a=r(17787),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(o(e),t=a(t,!0),o(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},73227:function(e,t,r){var n=r(93248),i=r(91629),o=r(32343),a=r(36857),s=r(17787),u=r(7677),l=r(156),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=a(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(u(e,t))return o(!i.f.call(e,t),e[t])}},58920:function(e,t,r){var n=r(73810),i=r(35732).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},52315:function(e,t){t.f=Object.getOwnPropertySymbols},41021:function(e,t,r){var n=r(7677),i=r(46956),o=r(9002),a=r(2784),s=o("IE_PROTO"),u=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},73810:function(e,t,r){var n=r(7677),i=r(36857),o=r(16679).indexOf,a=r(49605);e.exports=function(e,t){var r,s=i(e),u=0,l=[];for(r in s)!n(a,r)&&n(s,r)&&l.push(r);for(;t.length>u;)n(s,r=t[u++])&&(~o(l,r)||l.push(r));return l}},47936:function(e,t,r){var n=r(73810),i=r(35732);e.exports=Object.keys||function(e){return n(e,i)}},91629:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},55799:function(e,t,r){var n=r(56019),i=r(68674);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,o){return n(r),i(o),t?e.call(r,o):r.__proto__=o,r}}():void 0)},96857:function(e,t,r){"use strict";var n=r(17957),i=r(54530);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},8992:function(e,t,r){var n=r(99049),i=r(58920),o=r(52315),a=r(56019);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(a(e)),r=o.f;return r?t.concat(r(e)):t}},47547:function(e,t,r){var n=r(82776);e.exports=n},35282:function(e,t,r){var n=r(22408);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},22408:function(e,t,r){var n=r(82776),i=r(83041),o=r(7677),a=r(67672),s=r(55174),u=r(27519),l=u.get,c=u.enforce,d=String(String).split("String");(e.exports=function(e,t,r,s){var u,l=!!s&&!!s.unsafe,f=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof r&&("string"!=typeof t||o(r,"name")||i(r,"name",t),(u=c(r)).source||(u.source=d.join("string"==typeof t?t:""))),e!==n?(l?!p&&e[t]&&(f=!0):delete e[t],f?e[t]=r:i(e,t,r)):f?e[t]=r:a(t,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||s(this)}))},24803:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},67672:function(e,t,r){var n=r(82776),i=r(83041);e.exports=function(e,t){try{i(n,e,t)}catch(r){n[e]=t}return t}},80877:function(e,t,r){"use strict";var n=r(99049),i=r(31871),o=r(60422),a=r(93248),s=o("species");e.exports=function(e){var t=n(e),r=i.f;a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},96801:function(e,t,r){var n=r(31871).f,i=r(7677),o=r(60422)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},9002:function(e,t,r){var n=r(40429),i=r(81643),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},51674:function(e,t,r){var n=r(82776),i=r(67672),o="__core-js_shared__",a=n[o]||i(o,{});e.exports=a},40429:function(e,t,r){var n=r(57331),i=r(51674);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.1",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},66677:function(e,t,r){var n=r(82169),i=r(24803),o=function(e){return function(t,r){var o,a,s=String(i(t)),u=n(r),l=s.length ;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)}},35374:function(e,t,r){var n,i,o,a=r(82776),s=r(91895),u=r(88351),l=r(53859),c=r(84163),d=r(24457),f=r(73806),p=a.location,h=a.setImmediate,y=a.clearImmediate,m=a.process,g=a.MessageChannel,v=a.Dispatch,b=0,_={},E="onreadystatechange",S=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},A=function(e){return function(){S(e)}},w=function(e){S(e.data)},T=function(e){a.postMessage(e+"",p.protocol+"//"+p.host)};h&&y||(h=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(b),b},y=function(e){delete _[e]},f?n=function(e){m.nextTick(A(e))}:v&&v.now?n=function(e){v.now(A(e))}:g&&!d?(o=(i=new g).port2,i.port1.onmessage=w,n=u(o.postMessage,o,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&p&&"file:"!==p.protocol&&!s(T)?(n=T,a.addEventListener("message",w,!1)):n=E in c("script")?function(e){l.appendChild(c("script"))[E]=function(){l.removeChild(this),S(e)}}:function(e){setTimeout(A(e),0)}),e.exports={set:h,clear:y}},78331:function(e,t,r){var n=r(82169),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},36857:function(e,t,r){var n=r(31579),i=r(24803);e.exports=function(e){return n(i(e))}},82169:function(e){var t=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:t)(e)}},85972:function(e,t,r){var n=r(82169),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},46956:function(e,t,r){var n=r(24803);e.exports=function(e){return Object(n(e))}},17787:function(e,t,r){var n=r(95110);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},17957:function(e,t,r){var n={};n[r(60422)("toStringTag")]="z",e.exports="[object z]"===String(n)},81643:function(e){var t=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+r).toString(36)}},77254:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=r(81933);e.exports=i&&!Symbol.sham&&"symbol"==n(Symbol.iterator)},60422:function(e,t,r){var n=r(82776),i=r(40429),o=r(7677),a=r(81643),s=r(81933),u=r(77254),l=i("wks"),c=n.Symbol,d=u?c:c&&c.withoutSetter||a;e.exports=function(e){return o(l,e)||(s&&o(c,e)?l[e]=c[e]:l[e]=d("Symbol."+e)),l[e]}},44921:function(e,t,r){"use strict";var n=r(58023),i=r(71930).findIndex,o=r(49837),a=r(30673),s="findIndex",u=!0,l=a(s);s in[]&&Array(1)[s]((function(){u=!1})),n({target:"Array",proto:!0,forced:u||!l},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},27302:function(e,t,r){"use strict";var n=r(58023),i=r(71930).find,o=r(49837),a=r(30673),s="find",u=!0,l=a(s);s in[]&&Array(1)[s]((function(){u=!1})),n({target:"Array",proto:!0,forced:u||!l},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},8952:function(e,t,r){var n=r(58023),i=r(74699);n({target:"Array",stat:!0,forced:!r(45098)((function(e){Array.from(e)}))},{from:i})},17779:function(e,t,r){"use strict";var n=r(58023),i=r(16679).includes,o=r(49837);n({target:"Array",proto:!0,forced:!r(30673)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},72742:function(e,t,r){"use strict";var n=r(36857),i=r(49837),o=r(4927),a=r(27519),s=r(19772),u="Array Iterator",l=a.set,c=a.getterFor(u);e.exports=s(Array,"Array",(function(e,t){l(this,{type:u,target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},82380:function(e,t,r){"use strict";var n=r(32747),i=r(55353);e.exports=n("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),i)},18526:function(e,t,r){var n=r(58023),i=r(18555);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},75546:function(e,t,r){var n=r(17957),i=r(22408),o=r(96857);n||i(Object.prototype,"toString",o,{unsafe:!0})},11528:function(e,t,r){"use strict";var n=r(32747),i=r(55353);e.exports=n("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),i)},46789:function(e,t,r){"use strict";var n,i=r(58023),o=r(73227).f,a=r(85972),s=r(21106),u=r(24803),l=r(63677),c=r(57331),d="".endsWith,f=Math.min,p=l("endsWith");i({target:"String",proto:!0,forced:!!(c||p||(n=o(String.prototype,"endsWith"),!n||n.writable))&&!p},{endsWith:function(e){var t=String(u(this));s(e);var r=arguments.length>1?arguments[1]:void 0,n=a(t.length),i=void 0===r?n:f(a(r),n),o=String(e);return d?d.call(t,o,i):t.slice(i-o.length,i)===o}})},38621:function(e,t,r){"use strict";var n=r(58023),i=r(21106),o=r(24803);n({target:"String",proto:!0,forced:!r(63677)("includes")},{includes:function(e){return!!~String(o(this)).indexOf(i(e),arguments.length>1?arguments[1]:void 0)}})},11722:function(e,t,r){"use strict";var n=r(66677).charAt,i=r(27519),o=r(19772),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",(function(e){s(this,{type:a,string:String(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},59015:function(e,t,r){"use strict";var n,i=r(58023),o=r(73227).f,a=r(85972),s=r(21106),u=r(24803),l=r(63677),c=r(57331),d="".startsWith,f=Math.min,p=l("startsWith");i({target:"String",proto:!0,forced:!!(c||p||(n=o(String.prototype,"startsWith"),!n||n.writable))&&!p},{startsWith:function(e){var t=String(u(this));s(e);var r=a(f(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return d?d.call(t,n,r):t.slice(r,r+n.length)===n}})},35239:function(e,t,r){"use strict";var n,i=r(82776),o=r(35282),a=r(99751),s=r(32747),u=r(66850),l=r(95110),c=r(27519).enforce,d=r(79551),f=!i.ActiveXObject&&"ActiveXObject"in i,p=Object.isExtensible,h=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},y=e.exports=s("WeakMap",h,u);if(d&&f){n=u.getConstructor(h,"WeakMap",!0),a.REQUIRED=!0;var m=y.prototype,g=m.delete,v=m.has,b=m.get,_=m.set;o(m,{delete:function(e){if(l(e)&&!p(e)){var t=c(this);return t.frozen||(t.frozen=new n),g.call(this,e)||t.frozen.delete(e)}return g.call(this,e)},has:function(e){if(l(e)&&!p(e)){var t=c(this);return t.frozen||(t.frozen=new n),v.call(this,e)||t.frozen.has(e)}return v.call(this,e)},get:function(e){if(l(e)&&!p(e)){var t=c(this);return t.frozen||(t.frozen=new n),v.call(this,e)?b.call(this,e):t.frozen.get(e)}return b.call(this,e)},set:function(e,t){if(l(e)&&!p(e)){var r=c(this);r.frozen||(r.frozen=new n),v.call(this,e)?_.call(this,e,t):r.frozen.set(e,t)}else _.call(this,e,t);return this}})}},3997:function(e,t,r){"use strict";r(32747)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(66850))},18457:function(e,t,r){var n=r(82776),i=r(24564),o=r(28978),a=r(83041);for(var s in i){var u=n[s],l=u&&u.prototype;if(l&&l.forEach!==o)try{a(l,"forEach",o)}catch(e){l.forEach=o}}},86460:function(e,t,r){var n=r(82776),i=r(24564),o=r(72742),a=r(83041),s=r(60422),u=s("iterator"),l=s("toStringTag"),c=o.values;for(var d in i){var f=n[d],p=f&&f.prototype;if(p){if(p[u]!==c)try{a(p,u,c)}catch(e){p[u]=c}if(p[l]||a(p,l,d),i[d])for(var h in o)if(p[h]!==o[h])try{a(p,h,o[h])}catch(e){p[h]=o[h]}}}},51951:function(e,t,r){var n=r(58023),i=r(82776),o=r(43327),a=r(73806),s=i.process;n({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(e){ var t=a&&s.domain;o(t?t.bind(e):e)}})},21218:function(e,t,r){var n=r(9310);e.exports=n},16701:function(e,t,r){var n=r(85910);e.exports=n},12174:function(e,t,r){var n=r(56757);e.exports=n},34477:function(e,t,r){var n=r(57132);e.exports=n},52793:function(e,t,r){r(18457),r(86460);var n=r(72742),i=r(28978);e.exports={keys:n.keys,values:n.values,entries:n.entries,iterator:n.values,forEach:i}},12935:function(e,t,r){var n=r(50761);e.exports=n},45203:function(e,t,r){var n=r(10171);e.exports=n},51828:function(e,t,r){var n=r(77011);e.exports=n},42082:function(e,t,r){var n=r(61191);e.exports=n},46403:function(e,t,r){var n=r(89787);e.exports=n},3044:function(e,t,r){var n=r(45870);e.exports=n},22639:function(e,t,r){var n=r(4861);e.exports=n},45251:function(e,t,r){var n=r(43904);e.exports=n},94891:function(e,t,r){var n=r(29572);e.exports=n},77011:function(e,t,r){r(51951);var n=r(47547);e.exports=n.queueMicrotask},44193:function(e){var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n>>6-2*i);return r}},e.exports=r},88315:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},38877:function(e){"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},50330:function(e){"use strict";e.exports=function(e){var t=e[1],r=e[3];if(!r)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),o="/*# ".concat(i," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},27483:function(e,t,r){var n,i,o;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}o=function(){"use strict";var e=6e4,t=36e5,r="millisecond",n="second",i="minute",o="hour",s="day",u="week",l="month",c="quarter",d="year",f="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},g=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},v={s:g,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(i,2,"0")},m:function e(t,r){if(t.date()1)return e(a[0])}else{var s=t.name;_[s]=t,i=s}return!n&&i&&(b=i),i||!n&&b},A=function(e,t){if(E(e))return e.clone();var r="object"==a(t)?t:{};return r.date=e,r.args=arguments,new T(r)},w=v;w.l=S,w.i=E,w.w=function(e,t){return A(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function a(e){this.$L=S(e.locale,null,!0),this.parse(e)}var m=a.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return w},m.isValid=function(){return!(this.$d.toString()===p)},m.isSame=function(e,t){var r=A(e);return this.startOf(t)<=r&&r<=this.endOf(t)},m.isAfter=function(e,t){return A(e)3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,d=arguments.length>6&&arguments[6],f=!!s&&s(e,t);if(i)i(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===u&&f?f.enumerable:!u,value:r,writable:null===l&&f?f.writable:!l});else{if(!d&&(u||l||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},68298:function(e,t,r){"use strict";var n=r(58995),i=r(64595),o=[].__proto__===Array.prototype&&i&&i(Object.prototype,"__proto__"),a=Object,s=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?n([o.get]):"function"==typeof s&&function(e){return s(null==e?e:a(e))}},43961:function(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},7475:function(e){"use strict";e.exports=EvalError},64974:function(e){"use strict";e.exports=Error},63802:function(e){"use strict";e.exports=RangeError},19088:function(e){"use strict";e.exports=ReferenceError},52623:function(e){"use strict";e.exports=SyntaxError},74818:function(e){"use strict";e.exports=TypeError},66951:function(e){"use strict";e.exports=URIError},91250:function(e){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var r,n="object"===("undefined"==typeof Reflect?"undefined":t(Reflect))?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+t(e))}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,a,s;if(u(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var l=u.length,c=y(u,l);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},83419:function(e){"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===L(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=N(e,0,1),r=N(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,M,(function(e,t,r,i){n[n.length]=r?k(i,F,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=U("%"+n+"%",t),o=i.name,a=i.value,s=!1,u=i.alias;u&&(n=u[0],x(r,O([0,1],u)));for(var d=1,f=!0;d=r.length){var g=h(a,p);a=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[p]}else f=D(a,p),a=a[p];f&&!s&&(T[o]=a)}}return a}},82641:function(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},64595:function(e,t,r){"use strict";var n=r(82641);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},3757:function(e,t,r){"use strict";var n=r(43961),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},14553:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i="undefined"!=typeof Symbol&&Symbol,o=r(62838);e.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"===n(i("foo"))&&("symbol"===n(Symbol("bar"))&&o())))}},62838:function(e){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===t(Symbol.iterator))return!0;var e={},r=Symbol("test"),n=Object(r);if("string"==typeof r)return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var i in e[r]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==r)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,r);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},40864:function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(18020);e.exports=o.call(n,i)},56616:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},19832:function(e,t,r){var n,i,o,a,s;n=r(44193),i=r(3789).utf8,o=r(56616),a=r(3789).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=n.bytesToWords(e),u=8*e.length,l=1732584193,c=-271733879,d=-1732584194,f=271733878,p=0;p>>24)|4278255360&(r[p]<<24|r[p]>>>8);r[u>>>5]|=128<>>9<<4)]=u;var h=s._ff,y=s._gg,m=s._hh,g=s._ii;for(p=0;p>>0,c=c+b>>>0,d=d+_>>>0,f=f+E>>>0}return n.endian([l,c,d,f])})._ff=function(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+(i>>>0)+a;return(s<>>32-o)+t},s._gg=function(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+(i>>>0)+a;return(s<>>32-o)+t},s._hh=function(e,t,r,n,i,o,a){var s=e+(t^r^n)+(i>>>0)+a;return(s<>>32-o)+t},s._ii=function(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+(i>>>0)+a;return(s<>>32-o)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?a.bytesToString(r):n.bytesToHex(r)}},30086:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{EH:function(){return Ft},Fl:function(){return xe},LO:function(){return Pe},U5:function(){return Gt},ZN:function(){return ur},aD:function(){return kt},gx:function(){return cr},hz:function(){return jt},jQ:function(){return zt},p6:function(){return q},rC:function(){return _r},vP:function(){return Gr},z:function(){return Lt}});function i(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[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.")}var V=Symbol("mobx-stored-annotations");function W(e){return Object.assign((function(t,r){j(t,r,e)}),e)}function j(e,t,r){O(e,V)||A(e,V,L({},e[V])),function(e){return e.annotationType_===Q}(r)||(e[V][t]=r)}var H=Symbol("mobx administration"),Z=function(){function e(e){void 0===e&&(e="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ye.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.reportObserved=function(){return gt(this)},t.reportChanged=function(){yt(),vt(this),mt()},t.toString=function(){return this.name_},e}(),Y=T("Atom",Z);function K(e,t,r){void 0===t&&(t=g),void 0===r&&(r=g);var n=new Z(e);return t!==g&&jt(n,t),r!==g&&Ht(n,r),n}var q={identity:function(e,t){return e===t},structural:function(e,t){return yn(e,t)},default:function(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t},shallow:function(e,t){return yn(e,t,1)}};function z(e,t,r){return or(e)?e:Array.isArray(e)?Pe.array(e,{name:r}):E(e)?Pe.object(e,void 0,{name:r}):R(e)?Pe.map(e,{name:r}):C(e)?Pe.set(e,{name:r}):"function"!=typeof e||Mt(e)||nr(e)?e:S(e)?tr(e):Nt(r,e)}function X(e){return e}var Q="override";function J(e,t){return{annotationType_:e,options_:t,make_:$,extend_:ee}}function $(e,t,r,n){var i;if(null!=(i=this.options_)&&i.bound)return null===this.extend_(e,t,r,!1)?0:1;if(n===e.target_)return null===this.extend_(e,t,r,!1)?0:2;if(Mt(r.value))return 1;var o=te(e,this,t,r,!1);return l(n,t,o),2}function ee(e,t,r,n){var i=te(e,this,t,r);return e.defineProperty_(t,i,n)}function te(e,t,r,n,i){var o,a,s,u,l,c,d,f;void 0===i&&(i=dt.safeDescriptors),f=n,t.annotationType_,f.value;var p,h=n.value;null!=(o=t.options_)&&o.bound&&(h=h.bind(null!=(p=e.proxy_)?p:e.target_));return{ value:Ue(null!=(a=null==(s=t.options_)?void 0:s.name)?a:r.toString(),h,null!=(u=null==(l=t.options_)?void 0:l.autoAction)&&u,null!=(c=t.options_)&&c.bound?null!=(d=e.proxy_)?d:e.target_:void 0),configurable:!i||e.isPlainObject_,enumerable:!1,writable:!i}}function re(e,t){return{annotationType_:e,options_:t,make_:ne,extend_:ie}}function ne(e,t,r,n){var i;if(n===e.target_)return null===this.extend_(e,t,r,!1)?0:2;if(null!=(i=this.options_)&&i.bound&&(!O(e.target_,t)||!nr(e.target_[t]))&&null===this.extend_(e,t,r,!1))return 0;if(nr(r.value))return 1;var o=oe(e,this,t,r,!1,!1);return l(n,t,o),2}function ie(e,t,r,n){var i,o=oe(e,this,t,r,null==(i=this.options_)?void 0:i.bound);return e.defineProperty_(t,o,n)}function oe(e,t,r,n,i,o){var a;void 0===o&&(o=dt.safeDescriptors),a=n,t.annotationType_,a.value;var s,u=n.value;(nr(u)||(u=tr(u)),i)&&((u=u.bind(null!=(s=e.proxy_)?s:e.target_)).isMobXFlow=!0);return{value:u,configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function ae(e,t){return{annotationType_:e,options_:t,make_:se,extend_:ue}}function se(e,t,r){return null===this.extend_(e,t,r,!1)?0:1}function ue(e,t,r,n){return function(e,t,r,n){t.annotationType_,n.get;0}(0,this,0,r),e.defineComputedProperty_(t,L({},this.options_,{get:r.get,set:r.set}),n)}function le(e,t){return{annotationType_:e,options_:t,make_:ce,extend_:de}}function ce(e,t,r){return null===this.extend_(e,t,r,!1)?0:1}function de(e,t,r,n){var i,o;return function(e,t){t.annotationType_;0}(0,this),e.defineObservableProperty_(t,r.value,null!=(i=null==(o=this.options_)?void 0:o.enhancer)?i:z,n)}var fe="true",pe=he();function he(e){return{annotationType_:fe,options_:e,make_:ye,extend_:me}}function ye(e,t,r,n){var i,o,a,s;if(r.get)return xe.make_(e,t,r,n);if(r.set){var u=Ue(t.toString(),r.set);return n===e.target_?null===e.defineProperty_(t,{configurable:!dt.safeDescriptors||e.isPlainObject_,set:u})?0:2:(l(n,t,{configurable:!0,set:u}),2)}if(n!==e.target_&&"function"==typeof r.value)return S(r.value)?(null!=(s=this.options_)&&s.autoBind?tr.bound:tr).make_(e,t,r,n):(null!=(a=this.options_)&&a.autoBind?Nt.bound:Nt).make_(e,t,r,n);var c,d=!1===(null==(i=this.options_)?void 0:i.deep)?Pe.ref:Pe;"function"==typeof r.value&&null!=(o=this.options_)&&o.autoBind&&(r.value=r.value.bind(null!=(c=e.proxy_)?c:e.target_));return d.make_(e,t,r,n)}function me(e,t,r,n){var i,o,a;if(r.get)return xe.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:!dt.safeDescriptors||e.isPlainObject_,set:Ue(t.toString(),r.set)},n);"function"==typeof r.value&&null!=(i=this.options_)&&i.autoBind&&(r.value=r.value.bind(null!=(a=e.proxy_)?a:e.target_));return(!1===(null==(o=this.options_)?void 0:o.deep)?Pe.ref:Pe).extend_(e,t,r,n)}var ge={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function ve(e){return e||ge}Object.freeze(ge);var be=le("observable"),_e=le("observable.ref",{enhancer:X}),Ee=le("observable.shallow",{enhancer:function(e,t,r){return null==e||Qr(e)||Nr(e)||Vr(e)||Hr(e)?e:Array.isArray(e)?Pe.array(e,{name:r,deep:!1}):E(e)?Pe.object(e,void 0,{name:r,deep:!1}):R(e)?Pe.map(e,{name:r,deep:!1}):C(e)?Pe.set(e,{name:r,deep:!1}):void 0}}),Se=le("observable.struct",{enhancer:function(e,t){return yn(e,t)?t:e}}),Ae=W(be);function we(e){return!0===e.deep?z:!1===e.deep?X:(t=e.defaultDecorator)&&null!=(r=null==(n=t.options_)?void 0:n.enhancer)?r:z;var t,r,n}function Te(e,t,r){if(!b(t))return or(e)?e:E(e)?Pe.object(e,t,r):Array.isArray(e)?Pe.array(e,t):R(e)?Pe.map(e,t):C(e)?Pe.set(e,t):"object"===n(e)&&null!==e?e:Pe.box(e,t);j(e,t,be)}s(Te,Ae);var Re,Ce,Pe=s(Te,{box:function(e,t){var r=ve(t);return new He(e,we(r),r.name,!0,r.equals)},array:function(e,t){var r=ve(t);return(!1===dt.useProxies||!1===r.proxy?cn:Tr)(e,we(r),r.name)},map:function(e,t){var r=ve(t);return new Gr(e,we(r),r.name)},set:function(e,t){var r=ve(t);return new jr(e,we(r),r.name)},object:function(e,t,r){return Xt(!1===dt.useProxies||!1===(null==r?void 0:r.proxy)?qr({},r):function(e,t){var r,n;return y(),e=qr(e,t),null!=(n=(r=e[H]).proxy_)?n:r.proxy_=new Proxy(e,pr)}({},r),e,t)},ref:W(_e),shallow:W(Ee),deep:Ae,struct:W(Se)}),Ie="computed",De=ae(Ie),Oe=ae("computed.struct",{equals:q.structural}),xe=function(e,t){if(b(t))return j(e,t,De);if(E(e))return W(ae(Ie,e));var r=E(t)?t:{};return r.get=e,r.name||(r.name=e.name||""),new qe(r)};Object.assign(xe,De),xe.struct=W(Oe);var ke,Ne=0,Le=1,Me=null!=(Re=null==(Ce=u((function(){}),"name"))?void 0:Ce.configurable)&&Re,Fe={value:"action",configurable:!0,writable:!1,enumerable:!1};function Ue(e,t,r,n){function i(){return Be(e,r,t,n||this,arguments)}return void 0===r&&(r=!1),i.isMobxAction=!0,Me&&(Fe.value=e,l(i,"name",Fe)),i}function Be(e,t,r,n,o){var a=function(e,t){var r=!1,n=0;0;var i=dt.trackingDerivation,o=!t||!i;yt();var a=dt.allowStateChanges;o&&(nt(),a=Ve(!0));var s=ot(!0),u={runAsAction_:o,prevDerivation_:i,prevAllowStateChanges_:a,prevAllowStateReads_:s,notifySpy_:r,startTime_:n,actionId_:Le++,parentActionId_:Ne};return Ne=u.actionId_,u}(0,t);try{return r.apply(n,o)}catch(e){throw a.error_=e,e}finally{!function(e){Ne!==e.actionId_&&i(30);Ne=e.parentActionId_,void 0!==e.error_&&(dt.suppressReactionErrors=!0);We(e.prevAllowStateChanges_),at(e.prevAllowStateReads_),mt(),e.runAsAction_&&it(e.prevDerivation_);0;dt.suppressReactionErrors=!1}(a)}}function Ge(e,t){var r=Ve(e);try{return t()}finally{We(r)}}function Ve(e){var t=dt.allowStateChanges;return dt.allowStateChanges=e,t}function We(e){dt.allowStateChanges=e}ke=Symbol.toPrimitive;var je,He=function(e){function t(t,r,n,i,o){var a;return void 0===n&&(n="ObservableValue"),void 0===i&&(i=!0),void 0===o&&(o=q.default),(a=e.call(this,n)||this).enhancer=void 0,a.name_=void 0,a.equals=void 0,a.hasUnreportedChange_=!1,a.interceptors_=void 0,a.changeListeners_=void 0,a.value_=void 0,a.dehancer=void 0,a.enhancer=r,a.name_=n,a.equals=o,a.value_=r(t,void 0,n),a}M(t,e);var r=t.prototype;return r.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},r.set=function(e){this.value_;if((e=this.prepareNewValue_(e))!==dt.UNCHANGED){0,this.setNewValue_(e)}},r.prepareNewValue_=function(e){if($e(this),hr(this)){var t=mr(this,{object:this,type:Sr,newValue:e});if(!t)return dt.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?dt.UNCHANGED:e},r.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),gr(this)&&br(this,{type:Sr,object:this,newValue:e,oldValue:t})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(e){return yr(this,e)},r.observe_=function(e,t){return t&&e({observableKind:"value",debugObjectName:this.name_,object:this,type:Sr,newValue:this.value_,oldValue:void 0}),vr(this,e)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return D(this.get())},r[ke]=function(){return this.valueOf()},t}(Z),Ze=T("ObservableValue",He);je=Symbol.toPrimitive;var Ye,Ke,qe=function(){function e(e){this.dependenciesState_=Ye.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ye.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Xe(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Ke.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||i(31),this.derivation=e.get,this.name_=e.name||"ComputedValue",e.set&&(this.setter_=Ue("ComputedValue-setter",e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?q.structural:q.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){!function(e){if(e.lowestObserverState_!==Ye.UP_TO_DATE_)return;e.lowestObserverState_=Ye.POSSIBLY_STALE_,e.observers_.forEach((function(e){ e.dependenciesState_===Ye.UP_TO_DATE_&&(e.dependenciesState_=Ye.POSSIBLY_STALE_,e.onBecomeStale_())}))}(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.get=function(){if(this.isComputing_&&i(32,this.name_,this.derivation),0!==dt.inBatch||0!==this.observers_.size||this.keepAlive_){if(gt(this),Je(this)){var e=dt.trackingContext;this.keepAlive_&&!e&&(dt.trackingContext=this),this.trackAndCompute()&&function(e){if(e.lowestObserverState_===Ye.STALE_)return;e.lowestObserverState_=Ye.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===Ye.POSSIBLY_STALE_?t.dependenciesState_=Ye.STALE_:t.dependenciesState_===Ye.UP_TO_DATE_&&(e.lowestObserverState_=Ye.UP_TO_DATE_)}))}(this),dt.trackingContext=e}}else Je(this)&&(this.warnAboutUntrackedRead_(),yt(),this.value_=this.computeValue_(!1),mt());var t=this.value_;if(Qe(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter_&&i(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter_=!1}}else i(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===Ye.NOT_TRACKING_,r=this.computeValue_(!0),n=t||Qe(e)||Qe(r)||!this.equals_(e,r);return n&&(this.value_=r),n},t.computeValue_=function(e){this.isComputing_=!0;var t,r=Ve(!1);if(e)t=et(this,this.derivation,this.scope_);else if(!0===dt.disableErrorBoundaries)t=this.derivation.call(this.scope_);else try{t=this.derivation.call(this.scope_)}catch(e){t=new Xe(e)}return We(r),this.isComputing_=!1,t},t.suspend_=function(){this.keepAlive_||(tt(this),this.value_=void 0)},t.observe_=function(e,t){var r=this,n=!0,i=void 0;return Ft((function(){var o=r.get();if(!n||t){var a=nt();e({observableKind:"computed",debugObjectName:r.name_,type:Sr,object:r,newValue:o,oldValue:i}),it(a)}n=!1,i=o}))},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return D(this.get())},t[je]=function(){return this.valueOf()},e}(),ze=T("ComputedValue",qe);!function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"}(Ye||(Ye={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Ke||(Ke={}));var Xe=function(e){this.cause=void 0,this.cause=e};function Qe(e){return e instanceof Xe}function Je(e){switch(e.dependenciesState_){case Ye.UP_TO_DATE_:return!1;case Ye.NOT_TRACKING_:case Ye.STALE_:return!0;case Ye.POSSIBLY_STALE_:for(var t=ot(!0),r=nt(),n=e.observing_,i=n.length,o=0;on&&(n=s.dependenciesState_)}r.length=i,e.newObserving_=null,o=t.length;for(;o--;){var u=t[o];0===u.diffValue_&&pt(u,e),u.diffValue_=0}for(;i--;){var l=r[i];1===l.diffValue_&&(l.diffValue_=0,ft(l,e))}n!==Ye.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}(e),at(n),i}function tt(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)pt(t[r],e);e.dependenciesState_=Ye.NOT_TRACKING_}function rt(e){var t=nt();try{return e()}finally{it(t)}}function nt(){var e=dt.trackingDerivation;return dt.trackingDerivation=null,e}function it(e){dt.trackingDerivation=e}function ot(e){var t=dt.allowStateReads;return dt.allowStateReads=e,t}function at(e){dt.allowStateReads=e}function st(e){if(e.dependenciesState_!==Ye.UP_TO_DATE_){e.dependenciesState_=Ye.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Ye.UP_TO_DATE_}}var ut=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},lt=!0,ct=!1,dt=function(){var e=a();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(lt=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new ut).version&&(lt=!1),lt?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new ut):(setTimeout((function(){ct||i(35)}),1),new ut)}();function ft(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function pt(e,t){e.observers_.delete(t),0===e.observers_.size&&ht(e)}function ht(e){!1===e.isPendingUnobservation_&&(e.isPendingUnobservation_=!0,dt.pendingUnobservations.push(e))}function yt(){dt.inBatch++}function mt(){if(0==--dt.inBatch){St();for(var e=dt.pendingUnobservations,t=0;t0&&ht(e),!1)}function vt(e){e.lowestObserverState_!==Ye.STALE_&&(e.lowestObserverState_=Ye.STALE_,e.observers_.forEach((function(e){e.dependenciesState_===Ye.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Ye.STALE_})))}var bt=function(){function e(e,t,r,n){void 0===e&&(e="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ye.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Ke.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=r,this.requiresObservable_=n}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,dt.pendingReactions.push(this),St())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){yt(),this.isScheduled_=!1;var e=dt.trackingContext;if(dt.trackingContext=this,Je(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}dt.trackingContext=e,mt()}},t.track=function(e){if(!this.isDisposed_){yt();0,this.isRunning_=!0;var t=dt.trackingContext;dt.trackingContext=this;var r=et(this,e,void 0);dt.trackingContext=t,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&tt(this),Qe(r)&&this.reportExceptionInDerivation_(r.cause),mt()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(dt.disableErrorBoundaries)throw e;var r="[mobx] uncaught error in '"+this+"'";dt.suppressReactionErrors||console.error(r,e),dt.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(yt(),tt(this),mt()))},t.getDisposer_=function(){var e=this.dispose.bind(this);return e[H]=this,e},t.toString=function(){return"Reaction["+this.name_+"]" },t.trace=function(e){void 0===e&&(e=!1),function(){i("trace() is not available in production builds");for(var e=!1,t=arguments.length,r=new Array(t),n=0;n0||dt.isRunningReactions||Et(At)}function At(){dt.isRunningReactions=!0;for(var e=dt.pendingReactions,t=0;e.length>0;){++t===_t&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n",i=function(){var e,t=arguments,i=++Qt,o=kt(n+" - runid: "+i+" - init",r).apply(this,t),a=void 0,s=new Promise((function(t,r){var s=0;function u(e){var t;a=void 0;try{t=kt(n+" - runid: "+i+" - yield "+s++,o.next).call(o,e)}catch(e){return r(e)}c(t)}function l(e){var t;a=void 0;try{t=kt(n+" - runid: "+i+" - yield "+s++,o.throw).call(o,e)}catch(e){return r(e)}c(t)}function c(e){if(!v(null==e?void 0:e.then))return e.done?t(e.value):(a=Promise.resolve(e.value)).then(u,l);e.then(c,r)}e=r,u(void 0)}));return s.cancel=kt(n+" - runid: "+i+" - cancel",(function(){try{a&&rr(a);var t=o.return(void 0),r=Promise.resolve(t.value);r.then(g,g),rr(r),e(new Jt)}catch(t){e(t)}})),s};return i.isMobXFlow=!0,i}),$t);function rr(e){v(e.cancel)&&e.cancel()}function nr(e){return!0===(null==e?void 0:e.isMobXFlow)}function ir(e,t){return!!e&&(void 0!==t?!!Qr(e)&&e[H].values_.has(t):Qr(e)||!!e[H]||Y(e)||wt(e)||ze(e))}function or(e){return ir(e)}function ar(e,t,r){return e.set(t,r),r}function sr(e,t){if(null==e||"object"!==n(e)||e instanceof Date||!or(e))return e;if(Ze(e)||ze(e))return sr(e.get(),t);if(t.has(e))return t.get(e);if(Nr(e)){var r=ar(t,e,new Array(e.length));return e.forEach((function(e,n){r[n]=sr(e,t)})),r}if(Hr(e)){var o=ar(t,e,new Set);return e.forEach((function(e){o.add(sr(e,t))})),o}if(Vr(e)){var a=ar(t,e,new Map);return e.forEach((function(e,r){a.set(r,sr(e,t))})),a}var s=ar(t,e,{});return function(e){if(Qr(e))return e[H].ownKeys_();i(38)}(e).forEach((function(r){c.propertyIsEnumerable.call(e,r)&&(s[r]=sr(e[r],t))})),s}function ur(e,t){return sr(e,new Map)}function lr(e,t){void 0===t&&(t=void 0),yt();try{return e.apply(t)}finally{mt()}}function cr(e,t,r){return 1===arguments.length||t&&"object"===n(t)?function(e,t){var r,n,i;0;if(null!=t&&null!=(r=t.signal)&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var o=new Promise((function(r,o){var a,s=dr(e,r,L({},t,{onError:o}));n=function(){s(),o(new Error("WHEN_CANCELLED"))},i=function(){s(),o(new Error("WHEN_ABORTED"))},null==t||null==(a=t.signal)||null==a.addEventListener||a.addEventListener("abort",i)})).finally((function(){var e;return null==t||null==(e=t.signal)||null==e.removeEventListener?void 0:e.removeEventListener("abort",i)}));return o.cancel=n,o}(e,t):dr(e,t,r||{})}function dr(e,t,r){var n;if("number"==typeof r.timeout){var i=new Error("WHEN_TIMEOUT");n=setTimeout((function(){if(!a[H].isDisposed_){if(a(),!r.onError)throw i;r.onError(i)}}),r.timeout)}r.name="When";var o=Ue("When-effect",t),a=Ft((function(t){Ge(!1,e)&&(t.dispose(),n&&clearTimeout(n),o())}),r);return a}function fr(e){return e[H]}tr.bound=W(er);var pr={has:function(e,t){return fr(e).has_(t)},get:function(e,t){return fr(e).get_(t)},set:function(e,t,r){var n;return!!b(t)&&(null==(n=fr(e).set_(t,r,!0))||n)},deleteProperty:function(e,t){var r;return!!b(t)&&(null==(r=fr(e).delete_(t,!0))||r)},defineProperty:function(e,t,r){var n;return null==(n=fr(e).defineProperty_(t,r))||n},ownKeys:function(e){return fr(e).ownKeys_()},preventExtensions:function(e){i(13)}};function hr(e){return void 0!==e.interceptors_&&e.interceptors_.length>0}function yr(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),m((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function mr(e,t){var r=nt();try{for(var n=[].concat(e.interceptors_||[]),o=0,a=n.length;o0}function vr(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),m((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function br(e,t){var r=nt(),n=e.changeListeners_;if(n){for(var i=0,o=(n=n.slice()).length;i0?e.map(this.dehancer):e},t.intercept_=function(e){return yr(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),vr(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||isNaN(e)||e<0)&&i("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n0&&ln(e+t+1)},t.spliceWithArray_=function(e,t,r){var n=this;this.atom_;var i=this.values_.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=d),hr(this)){var o=mr(this,{object:this.proxy_,type:Er,index:e,removedCount:t,added:r});if(!o)return d;t=o.removedCount,r=o.added}if(r=0===r.length?r:r.map((function(e){return n.enhancer_(e,void 0)})),this.legacyMode_){var a=r.length-t;this.updateArrayLength_(i,a)}var s=this.spliceItemsIntoValues_(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice_(e,r,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,r){var n;if(r.length<1e4)return(n=this.values_).splice.apply(n,[e,t].concat(r));var i=this.values_.slice(e,e+t),o=this.values_.slice(e+t);this.values_.length+=r.length-t;for(var a=0;a=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e]);console.warn("[mobx] Out of bounds read: "+e)},t.set_=function(e,t){var r=this.values_;if(this.legacyMode_&&e>r.length&&i(17,e,r.length),e2?r-2:0),i=2;i-1&&(this.splice(r,1),!0)}};function Cr(e,t){"function"==typeof Array.prototype[e]&&(Rr[e]=t(e))}function Pr(e){return function(){var t=this[H];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ir(e){return function(t,r){var n=this,i=this[H];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e]((function(e,i){return t.call(r,e,i,n)}))}}function Dr(e){return function(){var t=this,r=this[H];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(e,r,n){return i(e,r,n,t)},n[e].apply(n,arguments)}}Cr("concat",Pr),Cr("flat",Pr),Cr("includes",Pr),Cr("indexOf",Pr),Cr("join",Pr),Cr("lastIndexOf",Pr),Cr("slice",Pr),Cr("toString",Pr),Cr("toLocaleString",Pr),Cr("every",Ir),Cr("filter",Ir),Cr("find",Ir),Cr("findIndex",Ir),Cr("flatMap",Ir),Cr("forEach",Ir),Cr("map",Ir),Cr("some",Ir),Cr("reduce",Dr),Cr("reduceRight",Dr);var Or,xr,kr=T("ObservableArrayAdministration",wr);function Nr(e){return _(e)&&kr(e[H])}var Lr={},Mr="add",Fr="delete";Or=Symbol.iterator,xr=Symbol.toStringTag;var Ur,Br,Gr=function(){function e(e,t,r){var n=this;void 0===t&&(t=z),void 0===r&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[H]=Lr,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=r,v(Map)||i(18),this.keysAtom_=K("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,Ge(!0,(function(){n.merge(e)}))}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!dt.trackingDerivation)return this.has_(e);var r=this.hasMap_.get(e);if(!r){var n=r=new He(this.has_(e),X,"ObservableMap.key?",!1);this.hasMap_.set(e,n),Ht(n,(function(){return t.hasMap_.delete(e)}))}return r.get()},t.set=function(e,t){var r=this.has_(e);if(hr(this)){var n=mr(this,{type:r?Sr:Mr,object:this,newValue:t,name:e});if(!n)return this;t=n.newValue}return r?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if((this.keysAtom_,hr(this))&&!mr(this,{type:Fr,object:this,name:e}))return!1;if(this.has_(e)){var r=gr(this),n=r?{observableKind:"map",debugObjectName:this.name_,type:Fr,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return lr((function(){var r;t.keysAtom_.reportChanged(),null==(r=t.hasMap_.get(e))||r.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),r&&br(this,n),!0}return!1},t.updateValue_=function(e,t){var r=this.data_.get(e);if((t=r.prepareNewValue_(t))!==dt.UNCHANGED){var n=gr(this),i=n?{observableKind:"map",debugObjectName:this.name_,type:Sr,object:this,oldValue:r.value_,name:e,newValue:t}:null;0,r.setNewValue_(t),n&&br(this,i)}},t.addValue_=function(e,t){var r=this;this.keysAtom_,lr((function(){var n,i=new He(t,r.enhancer_,"ObservableMap.key",!1);r.data_.set(e,i),t=i.value_,null==(n=r.hasMap_.get(e))||n.setNewValue_(!0),r.keysAtom_.reportChanged() }));var n=gr(this),i=n?{observableKind:"map",debugObjectName:this.name_,type:Mr,object:this,name:e,newValue:t}:null;n&&br(this,i)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return vn({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return vn({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:[i,e.get(i)]}}})},t[Or]=function(){return this.entries()},t.forEach=function(e,t){for(var r,n=G(this);!(r=n()).done;){var i=r.value,o=i[0],a=i[1];e.call(t,a,o,this)}},t.merge=function(e){var t=this;return Vr(e)&&(e=new Map(e)),lr((function(){E(e)?function(e){var t=Object.keys(e);if(!P)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter((function(t){return c.propertyIsEnumerable.call(e,t)}))):t}(e).forEach((function(r){return t.set(r,e[r])})):Array.isArray(e)?e.forEach((function(e){var r=e[0],n=e[1];return t.set(r,n)})):R(e)?(e.constructor!==Map&&i(19,e),e.forEach((function(e,r){return t.set(r,e)}))):null!=e&&i(20,e)})),this},t.clear=function(){var e=this;lr((function(){rt((function(){for(var t,r=G(e.keys());!(t=r()).done;){var n=t.value;e.delete(n)}}))}))},t.replace=function(e){var t=this;return lr((function(){for(var r,n=function(e){if(R(e)||Vr(e))return e;if(Array.isArray(e))return new Map(e);if(E(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}return i(21,e)}(e),o=new Map,a=!1,s=G(t.data_.keys());!(r=s()).done;){var u=r.value;if(!n.has(u))if(t.delete(u))a=!0;else{var l=t.data_.get(u);o.set(u,l)}}for(var c,d=G(n.entries());!(c=d()).done;){var f=c.value,p=f[0],h=f[1],y=t.data_.has(p);if(t.set(p,h),t.data_.has(p)){var m=t.data_.get(p);o.set(p,m),y||(a=!0)}}if(!a)if(t.data_.size!==o.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),v=o.keys(),b=g.next(),_=v.next();!b.done;){if(b.value!==_.value){t.keysAtom_.reportChanged();break}b=g.next(),_=v.next()}t.data_=o})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return vr(this,e)},t.intercept_=function(e){return yr(this,e)},N(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:xr,get:function(){return"Map"}}]),e}(),Vr=T("ObservableMap",Gr);var Wr={};Ur=Symbol.iterator,Br=Symbol.toStringTag;var jr=function(){function e(e,t,r){void 0===t&&(t=z),void 0===r&&(r="ObservableSet"),this.name_=void 0,this[H]=Wr,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,v(Set)||i(22),this.atom_=K(this.name_),this.enhancer_=function(e,n){return t(e,n,r)},e&&this.replace(e)}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;lr((function(){rt((function(){for(var t,r=G(e.data_.values());!(t=r()).done;){var n=t.value;e.delete(n)}}))}))},t.forEach=function(e,t){for(var r,n=G(this);!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if((this.atom_,hr(this))&&!mr(this,{type:Mr,object:this,newValue:e}))return this;if(!this.has(e)){lr((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var r=!1,n=gr(this),i=n?{observableKind:"set",debugObjectName:this.name_,type:Mr,object:this,newValue:e}:null;r,n&&br(this,i)}return this},t.delete=function(e){var t=this;if(hr(this)&&!mr(this,{type:Fr,object:this,oldValue:e}))return!1;if(this.has(e)){var r=gr(this),n=r?{observableKind:"set",debugObjectName:this.name_,type:Fr,object:this,oldValue:e}:null;return lr((function(){t.atom_.reportChanged(),t.data_.delete(e)})),r&&br(this,n),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),r=Array.from(this.values());return vn({next:function(){var n=e;return e+=1,nnn){for(var t=nn;t=0&&r++}e=gn(e),t=gn(t);var u="[object Array]"===s;if(!u){if("object"!=n(e)||"object"!=n(t))return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(v(l)&&l instanceof l&&v(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1),o=o||[];for(var d=(i=i||[]).length;d--;)if(i[d]===e)return o[d]===t;if(i.push(e),o.push(t),u){if((d=e.length)!==t.length)return!1;for(;d--;)if(!mn(e[d],t[d],r-1,i,o))return!1}else{var f,p=Object.keys(e);if(d=p.length,Object.keys(t).length!==d)return!1;for(;d--;)if(!O(t,f=p[d])||!mn(e[f],t[f],r-1,i,o))return!1}return i.pop(),o.pop(),!0}function gn(e){return Nr(e)?e.slice():R(e)||Vr(e)||C(e)||Hr(e)?Array.from(e.entries()):e}function vn(e){return e[Symbol.iterator]=bn,e}function bn(){return this}["Symbol","Map","Set"].forEach((function(e){void 0===a()[e]&&i("MobX requires global '"+e+"' to be available or polyfilled")})),"object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":n(__MOBX_DEVTOOLS_GLOBAL_HOOK__))&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:pn},$mobx:H})},784:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=i&&o&&"function"==typeof o.get?o.get:null,s=i&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=u&&l&&"function"==typeof l.get?l.get:null,d=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,_=String.prototype.replace,E=String.prototype.toUpperCase,S=String.prototype.toLowerCase,A=RegExp.prototype.test,w=Array.prototype.concat,T=Array.prototype.join,R=Array.prototype.slice,C=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,D="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"===n(Symbol.iterator),x="function"==typeof Symbol&&Symbol.toStringTag&&(n(Symbol.toStringTag)===O||"symbol")?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function L(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||A.call(/e/,t))return t ;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-C(-e):C(e);if(n!==e){var i=String(n),o=b.call(t,i.length+1);return _.call(i,r,"$&_")+"."+_.call(_.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var M=r(18684),F=M.custom,U=Z(F)?F:null,B={__proto__:null,double:'"',single:"'"},G={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function V(e,t,r){var n=r.quoteStyle||t,i=B[n];return i+e+i}function W(e){return _.call(String(e),/"/g,""")}function j(e){return!("[object Array]"!==q(e)||x&&"object"===n(e)&&x in e)}function H(e){return!("[object RegExp]"!==q(e)||x&&"object"===n(e)&&x in e)}function Z(e){if(O)return e&&"object"===n(e)&&e instanceof Symbol;if("symbol"===n(e))return!0;if(!e||"object"!==n(e)||!D)return!1;try{return D.call(e),!0}catch(e){}return!1}e.exports=function e(t,i,o,u){var l=i||{};if(K(l,"quoteStyle")&&!K(B,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(K(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!K(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(K(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(K(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return X(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var A=String(t);return E?L(t,A):A}if("bigint"==typeof t){var C=String(t)+"n";return E?L(t,C):C}var I=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=I&&I>0&&"object"===n(t))return j(t)?"[Array]":"[Object]";var F=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=T.call(Array(e.indent+1)," ")}return{base:r,prev:T.call(Array(t+1),r)}}(l,o);if(void 0===u)u=[];else if(z(u,t)>=0)return"[Circular]";function G(t,r,n){if(r&&(u=R.call(u)).push(r),n){var i={depth:l.depth};return K(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,u)}return e(t,l,o+1,u)}if("function"==typeof t&&!H(t)){var Y=function(e){if(e.name)return e.name;var t=v.call(g.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),Q=re(t,G);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(Q.length>0?" { "+T.call(Q,", ")+" }":"")}if(Z(t)){var ne=O?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(t);return"object"!==n(t)||O?ne:J(ne)}if(function(e){if(!e||"object"!==n(e))return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var ie="<"+S.call(String(t.nodeName)),oe=t.attributes||[],ae=0;ae"}if(j(t)){if(0===t.length)return"[]";var se=re(t,G);return F&&!function(e){for(var t=0;t=0)return!1;return!0}(se)?"["+te(se,F)+"]":"[ "+T.call(se,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||x&&"object"===n(e)&&x in e)}(t)){var ue=re(t,G);return"cause"in Error.prototype||!("cause"in t)||k.call(t,"cause")?0===ue.length?"["+String(t)+"]":"{ ["+String(t)+"] "+T.call(ue,", ")+" }":"{ ["+String(t)+"] "+T.call(w.call("[cause]: "+G(t.cause),ue),", ")+" }"}if("object"===n(t)&&m){if(U&&"function"==typeof t[U]&&M)return M(t,{depth:I-o});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!==n(e))return!1;try{a.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var le=[];return s&&s.call(t,(function(e,r){le.push(G(r,t,!0)+" => "+G(e,t))})),ee("Map",a.call(t),le,F)}if(function(e){if(!c||!e||"object"!==n(e))return!1;try{c.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return d&&d.call(t,(function(e){ce.push(G(e,t))})),ee("Set",c.call(t),ce,F)}if(function(e){if(!f||!e||"object"!==n(e))return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return $("WeakMap");if(function(e){if(!p||!e||"object"!==n(e))return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return $("WeakSet");if(function(e){if(!h||!e||"object"!==n(e))return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return $("WeakRef");if(function(e){return!("[object Number]"!==q(e)||x&&"object"===n(e)&&x in e)}(t))return J(G(Number(t)));if(function(e){if(!e||"object"!==n(e)||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}(t))return J(G(P.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||x&&"object"===n(e)&&x in e)}(t))return J(y.call(t));if(function(e){return!("[object String]"!==q(e)||x&&"object"===n(e)&&x in e)}(t))return J(G(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==q(e)||x&&"object"===n(e)&&x in e)}(t)&&!H(t)){var de=re(t,G),fe=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",he=!fe&&x&&Object(t)===t&&x in t?b.call(q(t),8,-1):pe?"Object":"",ye=(fe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||pe?"["+T.call(w.call([],he||[],pe||[]),": ")+"] ":"");return 0===de.length?ye+"{}":F?ye+"{"+te(de,F)+"}":ye+"{ "+T.call(de,", ")+" }"}return String(t)};var Y=Object.prototype.hasOwnProperty||function(e){return e in this};function K(e,t){return Y.call(e,t)}function q(e){return m.call(e)}function z(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return X(b.call(e,0,t.maxStringLength),t)+n}var i=G[t.quoteStyle||"single"];return i.lastIndex=0,V(_.call(_.call(e,i,"\\$1"),/[\x00-\x1f]/g,Q),"single",t)}function Q(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+E.call(t.toString(16))}function J(e){return"Object("+e+")"}function $(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):T.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+T.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=j(e),n=[];if(r){n.length=e.length;for(var i=0;i>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,u)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n>>3){");for(var r=0;r>>0,8|i.mapKey[l.keyType],l.keyType),void 0===f?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,d,t),r("}")("}")):l.repeated?(r("if(%s!=null&&%s.length){",t,t),l.packed&&void 0!==i.packed[d]?r("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===f?a(r,l,c,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(l.id<<3|f)>>>0,d,t)),r("}")):(l.optional&&r("if(%s!=null&&m.hasOwnProperty(%j))",t,l.name),void 0===f?a(r,l,c,t):r("w.uint32(%i).%s(%s)",(l.id<<3|f)>>>0,d,t))}return r("return w")};var n=r(91010),i=r(33069),o=r(27992);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},91010:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}e.exports=s;var i=r(65957);((s.prototype=Object.create(i.prototype)).constructor=s).className="Enum";var o=r(20259),a=r(27992);function s(e,t,r,o,a){if(i.call(this,e,r),t&&"object"!==n(t))throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=a||{},this.reserved=void 0,t)for(var s=Object.keys(t),u=0;u=t)return!0;return!1},c.isReservedName=function(e,t){if(e)for(var r=0;r0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof c))throw Error("path conflicts with non-namespace objects")}else r.add(r=new c(n))}return t&&r.addJSON(t),r},c.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return n}else if(n instanceof c&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t");var n=O();if(!E.test(n))throw G(n,"name");N("=");var i=new s(B(n),H(O()),t,r);z(i,(function(e){if("option"!==e)throw G(e);Q(i,e),N(";")}),(function(){ee(i)})),e.add(i)}(r);break;case"required":case"optional":case"repeated":X(r,e);break;case"oneof":!function(e,t){if(!E.test(t=O()))throw G(t,"name");var r=new u(B(t));z(r,(function(e){"option"===e?(Q(r,e),N(";")):(x(e),X(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":j(r.extensions||(r.extensions=[]));break;case"reserved":j(r.reserved||(r.reserved=[]),!0);break;default:if(!F||!S.test(e))throw G(e);x(e),X(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!E.test(t=O()))throw G(t,"name");var r=new l(t);z(r,(function(e){switch(e){case"option":Q(r,e),N(";");break;case"reserved":j(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!E.test(t))throw G(t,"name");N("=");var r=H(O(),!0),n={};z(n,(function(e){if("option"!==e)throw G(e);Q(n,e),N(";")}),(function(){ee(n)})),e.add(t,r,n.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!E.test(t=O()))throw G(t,"service name");var r=new c(t);z(r,(function(e){if(!q(r,e)){if("rpc"!==e)throw G(e);!function(e,t){var r=t;if(!E.test(t=O()))throw G(t,"name");var n,i,o,a,s=t;N("("),N("stream",!0)&&(i=!0);if(!S.test(t=O()))throw G(t);n=t,N(")"),N("returns"),N("("),N("stream",!0)&&(a=!0);if(!S.test(t=O()))throw G(t);o=t,N(")");var u=new d(s,r,n,o,i,a);z(u,(function(e){if("option"!==e)throw G(e);Q(u,e),N(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!S.test(t=O()))throw G(t,"reference");var r=t;z(null,(function(t){switch(t){case"required":case"repeated":case"optional":X(e,t,r);break;default:if(!F||!S.test(t))throw G(t);x(t),X(e,"optional",r)}}))}(e,t),!0}return!1}function z(e,t,r){var n=D.line;if(e&&(e.comment=L(),e.filename=w.filename),N("{",!0)){for(var i;"}"!==(i=O());)t(i);N(";",!0)}else r&&r(),N(";"),e&&"string"!=typeof e.comment&&(e.comment=L(n))}function X(e,t,r){var n=O();if("group"!==n){if(!S.test(n))throw G(n,"type");var i=O();if(!E.test(i))throw G(i,"name");i=B(i),N("=");var s=new a(i,H(O()),n,t,r);z(s,(function(e){if("option"!==e)throw G(e);Q(s,e),N(";")}),(function(){ee(s)})),e.add(s),F||!s.repeated||void 0===f.packed[n]&&void 0!==f.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=O();if(!E.test(r))throw G(r,"name");var n=p.lcFirst(r);r===n&&(r=p.ucFirst(r));N("=");var i=H(O()),s=new o(r);s.group=!0;var u=new a(n,i,r,t);u.filename=w.filename,z(s,(function(e){switch(e){case"option":Q(s,e),N(";");break;case"required":case"optional":case"repeated":X(s,e);break;default:throw G(e)}})),e.add(s).add(u)}(e,t)}function Q(e,t){var r=N("(",!0);if(!S.test(t=O()))throw G(t,"name");var n=t;r&&(N(")"),n="("+n+")",t=k(),A.test(t)&&(n+=t,O())),N("="),J(e,n)}function J(e,t){if(N("{",!0))do{if(!E.test(I=O()))throw G(I,"name");"{"===k()?J(e,t+"."+I):(N(":"),"{"===k()?J(e,t+"."+I):$(e,t+"."+I,W(!0))),N(",",!0)}while(!N("}",!0));else $(e,t,W(!0))}function $(e,t,r){e.setOption&&e.setOption(t,r)}function ee(e){if(N("[",!0)){do{Q(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(I=O());)switch(I){case"package":if(!M)throw G(I);Z();break;case"import":if(!M)throw G(I);Y();break;case"syntax":if(!M)throw G(I);K();break;case"option":if(!M)throw G(I);Q(U,I),N(";");break;default:if(q(U,I)){M=!1;continue}throw G(I)}return w.filename=null,{package:T,imports:R,weakImports:C,syntax:P,root:t}}},8722:function(e,t,r){"use strict";e.exports=u;var n,i=r(58574),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var l,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")};function d(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new o(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}u.create=i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):c(e)})(e)}:c,u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return l}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return f(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|f(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e;var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},14183:function(e,t,r){"use strict";e.exports=o;var n=r(8722);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(58574);function o(e){n.call(this,e)}i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice),o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},8933:function(e,t,r){"use strict";e.exports=d;var n=r(20259);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var i,o,a,s=r(92647),u=r(91010),l=r(5744),c=r(27992);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function f(){}d.fromJSON=function(e,t){return t||(t=new d), e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=c.path.resolve,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return c.asPromise(e,i,t,r);var s=n===f;function u(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function l(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){o.filename=e;var n,a=o(t,i,r),l=0;if(a.imports)for(;l-1){var o=e.substring(r);o in a&&(e=o)}if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)s?l(e,a[e]):(++p,setTimeout((function(){--p,l(e,a[e])})));else if(s){var d;try{d=c.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}l(e,d)}else++p,c.fetch(e,(function(r,o){--p,n&&(r?t?p||u(null,i):u(r):l(e,o))}))}var p=0;c.isString(t)&&(t=[t]);for(var h,y=0;y-1&&this.deferred.splice(t,1)}}else if(e instanceof u)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,i=/^ *[*/]+ */,o=/^\s*\*?\/*/,a=/\n/g,s=/\s/,u=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function c(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}}))}function d(e,u){e=e.toString();var l=0,d=e.length,f=1,p=null,h=null,y=0,m=!1,g=[],v=null;function b(e){return Error("illegal "+e+" (line "+f+")")}function _(t){return e.charAt(t)}function E(t,r){p=e.charAt(t++),y=f,m=!1;var n,s=t-(u?2:3);do{if(--s<0||"\n"===(n=e.charAt(s))){m=!0;break}}while(" "===n||"\t"===n);for(var l=e.substring(t,r).split(a),c=0;c0)return g.shift();if(v)return function(){var t="'"===v?n:r;t.lastIndex=l-1;var i=t.exec(e);if(!i)throw b("string");return l=t.lastIndex,T(v),v=null,c(i[1])}();var i,o,a,p,h;do{if(l===d)return null;for(i=!1;s.test(a=_(l));)if("\n"===a&&++f,++l===d)return null;if("/"===_(l)){if(++l===d)throw b("comment");if("/"===_(l))if(u){if(p=l,h=!1,S(l)){h=!0;do{if((l=A(l))===d)break;l++}while(S(l))}else l=Math.min(d,A(l)+1);h&&E(p,l),f++,i=!0}else{for(h="/"===_(p=l+1);"\n"!==_(++l);)if(l===d)return null;++l,h&&E(p,l-1),++f,i=!0}else{if("*"!==(a=_(l)))return"/";p=l+1,h=u||"*"===_(p);do{if("\n"===a&&++f,++l===d)throw b("comment");o=a,a=_(l)}while("*"!==o||"/"!==a);++l,h&&E(p,l-2),i=!0}}}while(i);var y=l;if(t.lastIndex=0,!t.test(_(y++)))for(;y>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1} ;var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},58574:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=t;function o(e,t,r){for(var n=Object.keys(t),i=0;i0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=o,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=a,i.ProtocolError=a("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=i.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d},d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(h,10,o.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=o.from(e);return this._push(h,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(h,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var m=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(f,1,0);if(i.isString(e)){var r=d.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(m,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(l,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(l,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},d._configure=function(e){n=e}},60424:function(e,t,r){"use strict";e.exports=a;var n=r(88391);(a.prototype=Object.create(n.prototype)).constructor=a;var i=r(58574),o=i.Buffer;function a(){n.call(this)}a.alloc=function(e){return(a.alloc=i._Buffer_allocUnsafe)(e)};var s=o&&o.prototype instanceof Uint8Array&&"set"===o.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(s,t,e),this},a.prototype.string=function(e){var t=o.byteLength(e);return this.uint32(t),t&&this._push(u,t,e),this}},51148:function(e){"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n,RFC3986:i}},82973:function(e,t,r){"use strict";var n=r(14122),i=r(90054),o=r(51148);e.exports={formats:o,parse:i,stringify:n}},90054:function(e,t,r){"use strict";var n=r(18993),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),l=s?o.slice(0,s.index):o,c=[];if(l){if(!r.plainObjects&&i.call(Object.prototype,l)&&!r.allowPrototypes)return;c.push(l)}for(var d=0;r.depth>0&&null!==(s=a.exec(o))&&d=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,c=parseInt(l,10);r.parseArrays||""!==l?!isNaN(c)&&s!==l&&String(c)===l&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(a=[])[c]=i:"__proto__"!==l&&(a[l]=i):a={0:i}}i=a}return i}(c,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function(e,t){var r,l={},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,f=c.split(t.delimiter,d),p=-1,h=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(m=o(m)?[m]:m),i.call(l,y)?l[y]=n.combine(l[y],m):l[y]=m}return l}(e,r):e,d=r.plainObjects?Object.create(null):{},f=Object.keys(c),p=0;p0?R.join(",")||null:void 0}];else if(l(h))L=h;else{var F=Object.keys(R);L=g?F.sort(g):F}for(var U=s&&l(R)&&1===R.length?r+"[]":r,B=0;B0?S+E:""}},18993:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=r(51148),o=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),u=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var n=[],i=0;i=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||a===i.RFC1738&&(40===d||41===d)?l+=u.charAt(c):d<128?l+=s[d]:d<2048?l+=s[192|d>>6]+s[128|63&d]:d<55296||d>=57344?l+=s[224|d>>12]+s[128|d>>6&63]+s[128|63&d]:(c+=1,d=65536+((1023&d)<<10|1023&u.charCodeAt(c)),l+=s[240|d>>18]+s[128|d>>12&63]+s[128|d>>6&63]+s[128|63&d])}return l},isBuffer:function(e){return!(!e||"object"!==n(e))&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var r=[],n=0;n4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in e&&a){var c=a(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},54402:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=r(25121),o=r(83849),a=r(784),s=r(74818),u=i("%WeakMap%",!0),l=i("%Map%",!0),c=o("WeakMap.prototype.get",!0),d=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),h=o("Map.prototype.set",!0),y=o("Map.prototype.has",!0),m=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,i={assert:function(e){ if(!i.has(e))throw new s("Side channel does not contain "+a(e))},get:function(i){if(u&&i&&("object"===n(i)||"function"==typeof i)){if(e)return c(e,i)}else if(l){if(t)return p(t,i)}else if(r)return function(e,t){var r=m(e,t);return r&&r.value}(r,i)},has:function(i){if(u&&i&&("object"===n(i)||"function"==typeof i)){if(e)return f(e,i)}else if(l){if(t)return y(t,i)}else if(r)return function(e,t){return!!m(e,t)}(r,i);return!1},set:function(i,o){u&&i&&("object"===n(i)||"function"==typeof i)?(e||(e=new u),d(e,i,o)):l?(t||(t=new l),h(t,i,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=m(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,i,o))}};return i}},11985:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{CR:function(){return f},Jh:function(){return c},XA:function(){return d},ZT:function(){return o},_T:function(){return s},cy:function(){return h},ev:function(){return p},gn:function(){return u},mG:function(){return l},pi:function(){return a}});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;u--)(o=e[u])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}function l(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function c(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function p(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function c(e,t){for(var r=0;r>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},n.Utils.appendBox=function(e,t,r){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==r)if(null!=r){var n,i=-1;if("number"==typeof r)i=r;else{if("string"==typeof r)n=r;else{if("object"!=f(r)||!r.type)return void e.boxes.push(t);n=r.type}for(var o=0;o>3,t},o.prototype._readUint=function(e){var t,r,n=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:n=this._raw.getUint8(i);break;case 16:n=this._raw.getUint16(i);break;case 24:n=((t=this._raw.getUint16(i))<<8)+(r=this._raw.getUint8(i+2));break;case 32:n=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),r=this._raw.getUint32(i+4),n=t*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,n},o.prototype._readString=function(e){for(var t="",r=0;r0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var r=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,r}return null},o.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},o.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},o.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},o.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=e>>3},o.prototype._writeUint=function(e,t){if(this._rawo){var r,n,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:r=(16776960&t)>>8,n=255&t,this._rawo.setUint16(i,r),this._rawo.setUint8(i+2,n);break;case 32:this._rawo.setUint32(i,t);break;case 64:n=t-(r=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,r),this._rawo.setUint32(i+4,n)}this._cursor.offset+=e>>3}else this.size+=e>>3}, o.prototype._writeString=function(e,t){for(var r=0;r>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},o.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},o.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},o.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},o.prototype._boxProcessors.mp4a=o.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},o.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},o.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},o.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},o.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},o.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},o.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},o.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},o.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32), this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},o.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},o.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},o.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},o.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},o.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},o.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},o.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},o.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},o.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},o.prototype._boxProcessors["url "]=o.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},o.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},o.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},o.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},o.prototype._boxProcessors.vtte=function(){}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISABLE_LOADER_TYPE=t.SPECIAL_AUDIO_TYPE=t.USER_CODEC_PREFER_TYPE=t.FILTER_VIDEO_URL_REASON=t.VIDEO_CODEC_ID=t.VIDEO_QN=t.ERROR_CODE=t.DOLBY_AUDIO_QN=t.DEF_CODEC_STRATEGY=t.DEFAULT_FAWKES_CONFIG=t.FLAC_QN=t.STRING=t.ERROR=t.EVENTS=void 0,t.EVENTS={SCRIPT_LOADED:"scripLoaded",VIDEO_INFO:"videoInfo",WARNING:"warning",AST_IN_FUTURE:"astInFuture",BUFFER_EMPTY:"bufferStalled",BUFFER_LOADED:"bufferLoaded",BUFFER_LEVEL_STATE_CHANGED:"bufferStateChanged",ERROR:"error",FRAGMENT_LOADING_COMPLETED:"fragmentLoadingCompleted",FRAGMENT_LOADING_HEADER_RECEIVED:"fragmentLoadingHeaderReceived",FRAGMENT_LOADING_PROGRESS:"fragmentLoadingProgress",FRAGMENT_LOADING_STARTED:"fragmentLoadingStarted",FRAGMENT_LOADING_ABANDONED:"fragmentLoadingAbandoned",FRAGMENT_LOADED_ERROR:"fragmentLoadedError",FRAGMENT_P2P_LOAD_INFO:"fragmentP2pLoadInfo",CDN_LOAD_INFO:"cdnLoadInfo",PCDN_LOADED_ERROR:"pcdnLoadedError",LOG:"log",MANIFEST_LOADED:"manifestLoaded",METRICS_CHANGED:"metricsChanged",METRIC_CHANGED:"metricChanged",METRIC_ADDED:"metricAdded",METRIC_UPDATED:"metricUpdated",PERIOD_SWITCH_COMPLETED:"periodSwitchCompleted",PERIOD_SWITCH_STARTED:"periodSwitchStarted",QUALITY_CHANGE_REQUESTED:"qualityChangeRequested",QUALITY_CHANGE_RENDERED:"qualityChangeRendered",TRACK_CHANGE_RENDERED:"trackChangeRendered",SOURCE_INITIALIZED:"sourceInitialized",STREAM_INITIALIZED:"streamInitialized",STREAM_TEARDOWN_COMPLETE:"streamTeardownComplete",TEXT_TRACKS_ADDED:"allTextTracksAdded",TEXT_TRACK_ADDED:"textTrackAdded",TTML_PARSED:"ttmlParsed",TTML_TO_PARSE:"ttmlToParse",CAN_PLAY:"canPlay",PLAYBACK_ENDED:"playbackEnded",PLAYBACK_ERROR:"playbackError",PLAYBACK_NOT_ALLOWED:"playbackNotAllowed",PLAYBACK_METADATA_LOADED:"playbackMetaDataLoaded",PLAYBACK_PAUSED:"playbackPaused",PLAYBACK_PLAYING:"playbackPlaying",PLAYBACK_PROGRESS:"playbackProgress",PLAYBACK_RATE_CHANGED:"playbackRateChanged",PLAYBACK_SEEKED:"playbackSeeked",PLAYBACK_SEEKING:"playbackSeeking",PLAYBACK_SEEK_ASKED:"playbackSeekAsked",PLAYBACK_STARTED:"playbackStarted",PLAYBACK_TIME_UPDATED:"playbackTimeUpdated",PLAYBACK_WAITING:"playbackWaiting",MANIFEST_VALIDITY_CHANGED:"manifestValidityChanged",KEY_ADDED:"public_keyAdded",KEY_ERROR:"public_keyError",KEY_MESSAGE:"public_keyMessage",KEY_SESSION_CLOSED:"public_keySessionClosed",KEY_SESSION_CREATED:"public_keySessionCreated",KEY_SESSION_REMOVED:"public_keySessionRemoved",KEY_STATUSES_CHANGED:"public_keyStatusesChanged",KEY_SYSTEM_ACCESS_COMPLETE:"public_keySystemAccessComplete",KEY_SYSTEM_SELECTED:"public_keySystemSelected",LICENSE_REQUEST_COMPLETE:"public_licenseRequestComplete",PROTECTION_CREATED:"public_protectioncreated",PROTECTION_DESTROYED:"public_protectiondestroyed",DELAY_TO_APPEND_TO_BUFFER:"delayToAppendBuffer",QUALITY_CHANGE_DOWNLOADED:"qualityChangeDownloaded",QUOTA_EXCEEDED:"quotaExceeded",GET_NEXT_FRAGMENT:"getNextFragment",APPENDING_NEXT_SOURCE:"appendingNextSource",APPENDED_NEXT_SOURCE:"appendedNextSource",APPENDED_NEXT_SOURCE_DURATION_CHANGED:"appendedNextSourceDurationChanged",START_OFFSET_TIME_WARNING:"startOffsetTimeWarning",BUFFERING_OPTIMIZATION:"buffering_optimization",QUALITY_CHANGE_ABNORMAL:"qualityChangeAbnormal",SWITCH_AUDIO_TRACK_REQUEST:"switchAudioTrackRequest",SWITCH_AUDIO_TRACK_RENDERED:"switchAudioTrackRendered",REQUEST_RETRYED:"requestRetryed",PREDICT_SEEK:"predictSeek",JUMP_MEDIA_GAP:"jumpMediaGap", STREAM_BUFFERING_COMPLETED:"streamBufferingCompleted"},t.ERROR={INTERNAL_ERROR:-1,DURATION_IS_NOT_ALL_EQUAL:-2,DURATION_DEVIATION_IS_TOO_LARGE:-3,START_OFFSET_TIME_WARNING:-4,DOWNLOAD_ERROR:4,DOWNLOAD_MPD_ERROR:4001,DOWNLOAD_XINK_ERROR:4002,DOWNLOAD_INIT_SEGMENT_ERROR:4003,DOWNLOAD_MEDIA_SEGMENT_ERROR:4004,DOWNLOAD_INDEX_SEGMENT_ERROR:4005,DOWNLOAD_SWITCHING_SEGMENT_ERROR:4006,DOWNLOAD_OTHER_ERROR:4007,DOWNLOAD_FRAGMENT_ERROR:4101,DOWNLOAD_FRAGMENT_ERROR_RETRY_SUCCESS:4102,DOWNLOAD_FRAGMENT_ERROR_RETRY_FAILURE:4103,DOWNLOAD_FRAGMENT_ERROR_TIMEOUT:4105,CONNECT_FRAGMENT_ERROR_TIMEOUT:4106,CONNECT_FRAGMENT_ERROR_OFFLINE:4107,MANIFEST_ERROR:5,MANIFEST_TYPE_ERROR:5001,MANIFEST_RESOLVE_ERROR:5002,MEDIA_ERROR:6,MEDIA_ABORTED_ERROR:6001,MEDIA_NETWORK_ERROR:6002,MEDIA_DECODE_ERROR:6003,MEDIA_SUPPORTED_ERROR:6004,MEDIA_ENCRYPTED_ERROR:6005,MEDIA_FMP4_ERROR:6006,MEDIA_UNKNOWN_ERROR:6e3};var n={VIDEO:"video",AUDIO:"audio",LOG:"log",WARNING:"warning",ERROR:"error",ABR_DYNAMIC:"abrDynamic",ABR_BOLA:"abrBola",ABR_THROUGHPUT:"abrThroughput",SWITCH_SOURCE_TRANSITION_ELEMENT_CLASS_NAME:"bilidp-switch-source-transition-canvas",DASH_CONFIG:"dash_config",PDN_ENABLE:"pdn_enable",BILIBILI_DECODE_ERROR_OBJ:"bilibili_decode_error_obj",AV1:"av1",AVC:"avc",HEVC:"hevc"};t.STRING=n,t.FLAC_QN=30251,t.DEFAULT_FAWKES_CONFIG={dash_config:{pdn_disable_qn_list:"[120, 125, 126, 127]",pdn_disable_codecid_list:"[13]",pdn_enable:"1",pdn_mid_black_list:"[]",nc_disable:"0",p2p_disable:"0",rp_disable:"0",wasm_off_list:"[]"},common_policy:{},data_policy:{},gray_policy:{},monitor:{},nc_box_policy:{},nc_new_push_policy:{},nc_policy:{},nc_sdk_policy:{},nc_tracker_policy:{},player_policy:{},reward_pcdn_loader_policy:{},reward_seeder_policy:{},self_test_policy:{},top_list_service_policy:{}};var i,o,a,s,u,l,c,d,f=[n.AV1,n.HEVC,n.AVC];t.DEF_CODEC_STRATEGY=f,function(e){e[e.AUDIO=30255]="AUDIO",e[e.AMTOS=30250]="AMTOS"}(i||(i={})),t.DOLBY_AUDIO_QN=i,function(e){e[e.SET_QUALITY_ERR=2e4]="SET_QUALITY_ERR",e[e.SET_QUALITY_VALUE_ERR=20001]="SET_QUALITY_VALUE_ERR",e[e.SET_QUALITY_TYPE_ERR=20002]="SET_QUALITY_TYPE_ERR",e[e.SET_QUALITY_APENDING_ERR=20003]="SET_QUALITY_APENDING_ERR",e[e.SET_QUALITY_SAME_VALUE=20004]="SET_QUALITY_SAME_VALUE",e[e.SET_QUALITY_TIME_OUT=20005]="SET_QUALITY_TIME_OUT",e[e.SET_QUALITY_RENDER_CHANGED=20006]="SET_QUALITY_RENDER_CHANGED",e[e.SET_QUALITY_MULTI_TRACK=20007]="SET_QUALITY_MULTI_TRACK",e[e.SET_QUALITY_ABR=20008]="SET_QUALITY_ABR",e[e.SWITCH_AUDIO_TRACK_ERR=3e4]="SWITCH_AUDIO_TRACK_ERR",e[e.SWITCH_AUDIO_TRACK_NOT_SUPPORT=30001]="SWITCH_AUDIO_TRACK_NOT_SUPPORT",e[e.SWITCH_AUDIO_TRACK_ID_NOT_CHANGED=30002]="SWITCH_AUDIO_TRACK_ID_NOT_CHANGED",e[e.SWITCH_AUDIO_TRACK_ID_NOT_EXIST=30003]="SWITCH_AUDIO_TRACK_ID_NOT_EXIST",e[e.SWITCH_SOURCE_ERR=4e4]="SWITCH_SOURCE_ERR",e[e.SWITCH_SOURCE_ABORT=40001]="SWITCH_SOURCE_ABORT",e[e.SWITCH_SOURCE_FAILED=40002]="SWITCH_SOURCE_FAILED",e[e.SWITCH_SOURCE_TIMEOUT=40003]="SWITCH_SOURCE_TIMEOUT"}(o||(o={})),t.ERROR_CODE=o,function(e){e[e.QN_8K=127]="QN_8K",e[e.QN_DOLBY_VISION=126]="QN_DOLBY_VISION",e[e.QN_HDR10=125]="QN_HDR10",e[e.QN_4K=120]="QN_4K",e[e.QN_1080P_60=116]="QN_1080P_60",e[e.QN_1080P_PLUS=112]="QN_1080P_PLUS",e[e.QN_1080P=80]="QN_1080P",e[e.QN_720P_60=74]="QN_720P_60",e[e.QN_720P=64]="QN_720P",e[e.QN_480P=32]="QN_480P",e[e.QN_360P=16]="QN_360P"}(a||(a={})),t.VIDEO_QN=a,function(e){e[e.AVC=7]="AVC",e[e.HEVC=12]="HEVC",e[e.AV1=13]="AV1"}(s||(s={})),t.VIDEO_CODEC_ID=s,function(e){e.USE_HEVC_INSTEADOF_AVC="USE_HEVC_INSTEADOF_AVC",e.FILTER_SPECIAL_VIDEO="FILTER_SPECIAL_VIDEO"}(u||(u={})),t.FILTER_VIDEO_URL_REASON=u,function(e){e[e.RECOMMEND=0]="RECOMMEND",e[e.HEVC=1]="HEVC",e[e.DISABLE=2]="DISABLE",e[e.AV1=3]="AV1"}(l||(l={})),t.USER_CODEC_PREFER_TYPE=l,function(e){e.DOLBY="dolby",e.FLAC="flac"}(c||(c={})),t.SPECIAL_AUDIO_TYPE=c,function(e){e[e.NONE=0]="NONE",e[e.DISABLE_NC=1]="DISABLE_NC",e[e.DISABLE_RP=2]="DISABLE_RP"}(d||(d={})),t.DISABLE_LOADER_TYPE=d},function(e,t,r){"use strict";var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.extend=function(e,t){if(e){var r=!!t&&t.override,n=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!r||n&&-1===e[i].indexOf("public_")||(this[i]=e[i])}},e}();t.a=n},function(e,t,r){"use strict";var n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0});var i,o,a=function(){function e(){}return e.getLocalStorage=function(e){var t="";try{t=window.localStorage.getItem(e)}catch(e){}return t},e.setLocalStorage=function(e,t){try{window.localStorage.setItem(e,t)}catch(e){}},e.removeStorage=function(e){try{window.localStorage.removeItem(e)}catch(e){}},e.getSessionStorage=function(e){var t="";try{t=window.sessionStorage.getItem(e)}catch(e){}return t},e.setSessionStorage=function(e,t){try{window.sessionStorage.setItem(e,t)}catch(e){}},e.toFixed=function(e,t){return void 0===t&&(t=2),parseFloat(null==e?void 0:e.toFixed(t))},e.atob=function(e){try{return window.atob(e)}catch(e){return null}},e.switchFawkesConfig=function(e){var t={};for(var r in e)if(RegExp(String.raw(i||(i=n(["^(.+).(.+)$"],["^(.+)\\.(.+)$"])))).test(r)){var a=r.match(RegExp(String.raw(o||(o=n(["^(.+).(.+)$"],["^(.+)\\.(.+)$"]))))),s=a[1],u=a[2];t[s]||(t[s]={}),t[s][u]=this.atob(e[r])}return t},e.getCookie=function(t){try{if(e.cookie)return e.cookie[t]||"";if(!document.cookie||""===document.cookie)return"";e.cookie={};for(var r=document.cookie.split(";"),n=0;n-1&&e.indexOf("chrom")<0,i=e.match(/version\/\d+/);return{isSafari:n,version:n&&(null==i?void 0:i.length)?+i[0].substr(8):-1}},t.getEdgeInfo=function(e){var t,r;e||(e=null===(r=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===r?void 0:r.toLowerCase());var n=e.indexOf("edge/")>-1,i=e.match(/edge\/\d+/);return{isEdge:n,version:n&&(null==i?void 0:i.length)?+i[0].substr(5):-1}},t.getFireFoxInfo=function(e){var t,r;e||(e=null===(r=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===r?void 0:r.toLowerCase());var n=e.indexOf("Firefox/")>-1,i=e.match(/Firefox\/\d+/);return{isFireFox:n,version:n&&(null==i?void 0:i.length)?+i[0].substr(8):-1}},t.getCurrentBrowserInfo=function(){var e,t,r=null===(t=null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||void 0===t?void 0:t.toLowerCase(),n={type:i.Other,version:0};try{var o={ Chrome:r.indexOf("chrome")>-1&&r.indexOf("safari")>-1,Firefox:r.indexOf("firefox")>-1,Safari:r.indexOf("safari")>-1&&-1===r.indexOf("chrome"),LegacyEdge:r.indexOf("edge")>-1,Edge:r.indexOf("edg/")>-1,QQ:r.indexOf("qqbrowser")>-1,Sogou:r.indexOf("se 2.x")>-1};for(var a in o)if(o[a]){var s="",u=null;"QQ"===a?(s=r.match(/chrome\/([\d.]+)/)[1],u=i.QQ):"Chrome"===a?(u=i.Chrome,s=r.match(/chrome\/([\d.]+)/)[1]):"Firefox"===a?(s=r.match(/firefox\/([\d.]+)/)[1],u=i.Firefox):"Safari"===a?(s=r.match(/version\/([\d.]+)/)[1],u=i.Safari):"Edge"===a?(s=r.match(/edg\/([\d.]+)/)[1],u=i.ChromiumEdge):"LegacyEdge"===a?(s=r.match(/edge\/([\d.]+)/)[1],u=i.LegacyEdge):"Sogou"===a&&(u=i.Sogou,s=r.match(/chrome\/([\d.]+)/)[1]),n.type=u,n.version=parseInt(s,10)}}catch(e){n.type=i.Other,n.version=0}return n},t.getGPUInfo=function(){return o.default.getLocalStorage("bilibili_player_gpu_renderer")||""}},function(e,t,r){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return e.prototype.init=function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.UTF8="utf-8",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma"},e}()),i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return e.prototype.init=function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"},e}()),o=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return e.prototype.init=function(){this.DOWNLOAD_ERROR=4,this.DOWNLOAD_MPD_ERROR=4001,this.DOWNLOAD_XINK_ERROR=4002,this.DOWNLOAD_INIT_SEGMENT_ERROR=4003,this.DOWNLOAD_MEDIA_SEGMENT_ERROR=4004,this.DOWNLOAD_INDEX_SEGMENT_ERROR=4005,this.DOWNLOAD_SWITCHING_SEGMENT_ERROR=4006,this.DOWNLOAD_OTHER_ERROR=4007,this.DOWNLOAD_FRAGMENT_ERROR=4101,this.DOWNLOAD_FRAGMENT_ERROR_RETRY_SUCCESS=4102,this.DOWNLOAD_FRAGMENT_ERROR_RETRY_FAILURE=4103,this.DOWNLOAD_FRAGMENT_ERROR_RANGE=4104,this.DOWNLOAD_FRAGMENT_ERROR_TIMEOUT=4105,this.CONNECT_FRAGMENT_ERROR_TIMEOUT=4106,this.CONNECT_FRAGMENT_ERROR_OFFLINE=4107,this.CONNECT_NC_FRAGMENT_ERROR_TIMEOUT=4108,this.DOWNLOAD_PCDN_SCRIPT_ERROR=4201,this.DOWNLOAD_PCDN_SCRIPT_TIMEOUT=4202,this.DOWNLOAD_PCDN_DISABLED=4203,this.MANIFEST_ERROR=5,this.MANIFEST_TYPE_ERROR=5001,this.MANIFEST_RESOLVE_ERROR=5002,this.MEDIA_ERROR=6,this.MEDIA_ABORTED_ERROR=6001,this.MEDIA_NETWORK_ERROR=6002,this.MEDIA_DECODE_ERROR=6003,this.MEDIA_SUPPORTED_ERROR=6004,this.MEDIA_ENCRYPTED_ERROR=6005,this.MEDIA_FMP4_ERROR=6006,this.MEDIA_UNKNOWN_ERROR=6e3,this.MEDIA_DECODE_ERROR_VIDEO="video",this.MEDIA_DECODE_ERROR_AUDIO="audio",this.MEDIA_DECODE_ERROR_UNKNOWN="unknown"},e}()),a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""},s=r(0);function u(){var e={};function t(t,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!t)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);if(!(n(t,r,i)>=0)){e[t]=e[t]||[];var a={callback:r,scope:i,priority:o};e[t].some((function(r,n){if(r&&o>r.priority)return e[t].splice(n,0,a),!0}))||e[t].push(a)}}function r(t,r,i){if(t&&r&&e[t]){var o=n(t,r,i);o<0||(e[t][o]=null)}}function n(t,r,n){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===r&&(!n||n===e.scope))return i=t,!0})),i):i}return{on:t,off:r,once:function(e,n,i){t(e,(function t(o){n.call(i,o),r(e,t,i)}),i)},trigger:function(t,r){if(t&&e[t]){if((r=r||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");r.type=t,e[t]=e[t].filter((function(e){return e})),e[t].forEach((function(e){return e&&e.callback.call(e.scope,r)}))}},reset:function(){e={}}}}u.__dashjs_factory_name="EventBus";var d=s.a.getSingletonFactory(u);d.EVENT_PRIORITY_LOW=0,d.EVENT_PRIORITY_HIGH=5e3,s.a.updateSingletonFactory(u.__dashjs_factory_name,d);var p=d,h=r(3),y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=f(t)&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+f(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=f(t)&&"function"!=typeof t?e:t}(this,e.call(this));return r.BUFFERING_COMPLETED="bufferingCompleted",r.BUFFER_CLEARED="bufferCleared",r.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",r.BYTES_APPENDED="bytesAppended",r.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",r.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",r.CURRENT_TRACK_CHANGED="currentTrackChanged",r.DATA_UPDATE_COMPLETED="dataUpdateCompleted",r.DATA_UPDATE_STARTED="dataUpdateStarted",r.INITIALIZATION_LOADED="initializationLoaded",r.INIT_FRAGMENT_LOADED="initFragmentLoaded",r.INIT_REQUESTED="initRequested",r.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",r.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",r.LOADING_COMPLETED="loadingCompleted",r.LOADING_PROGRESS="loadingProgress",r.LOADING_DATA_PROGRESS="loadingDataProgress",r.LOADING_ABANDONED="loadingAborted",r.MANIFEST_UPDATED="manifestUpdated",r.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",r.QUOTA_EXCEEDED="quotaExceeded",r.REPRESENTATION_UPDATED="representationUpdated",r.SEGMENTS_LOADED="segmentsLoaded",r.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",r.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",r.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",r.STREAMS_COMPOSED="streamsComposed",r.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",r.STREAM_COMPLETED="streamCompleted",r.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",r.TIMED_TEXT_REQUESTED="timedTextRequested",r.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",r.URL_RESOLUTION_FAILED="urlResolutionFailed",r.VIDEO_CHUNK_RECEIVED="videoChunkReceived",r.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",r.XLINK_ELEMENT_LOADED="xlinkElementLoaded",r.XLINK_READY="xlinkReady",r.REQUEST_RETRYED="requestRetryed",r.BUFFER_CREATED="bufferCreated",r.VERIFY_SEGMENT_WARNING="verifySegmentWarning",r.INIT_HID="initHID",r.BIND_MEDIA_SOURCE_LOADER="bindMediaSourceLoader",r.SWITCH_AUDIO_TRACK_REQUEST="switchAudioTrackRequest",r.MULTI_AUDIO_TRACK_APPEND="multiAudioTrackAppend", r.SWITCH_AUDIO_TRACK_RENDERED="switchAudioTrackRendered",r.PREDICT_SEEK="predictSeek",r.JUMP_MEDIA_GAP="jumpMediaGap",r.SEGMENTS_LOADED_BEFORE_HANDLE="segmentsLoadedBeforeHandle",r.EXTRA_FRAMES_LOADING_FAILED="extraFramesLoadingFailed",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+f(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(h.a)),m=new y,g=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null,this.timeout=1e4};g.ACTION_DOWNLOAD="download",g.ACTION_COMPLETE="complete";var v=g;function b(){var e,t=this.context,r=p(t).getInstance(),n=void 0,i=void 0,o=void 0,a=void 0,s=void 0;return e={log:function(){var e="",t=null;i&&(t=(new Date).getTime(),e+="["+(t-s)+"]"),o&&this&&this.getClassName&&(e+="["+this.getClassName()+"]",this.getType&&(e+="["+this.getType()+"]")),e.length>0&&(e+=" "),Array.apply(null,arguments).forEach((function(t){e+=t+" "})),n&&console.log(e),r.trigger(m.LOG,{message:e})},setLogTimestampVisible:function(e){i=e},setCalleeNameVisible:function(e){o=e},setLogToBrowserConsole:function(e){n=e},getLogToBrowserConsole:function(){return n},setABRLogVisible:function(e){a=e},getABRLogVisible:function(){return a||n}},n=!1,a=!1,i=!0,o=!1,s=(new Date).getTime(),e}b.__dashjs_factory_name="Debug";var _=s.a.getSingletonFactory(b),E="loading",S="executed",A="failed";function w(e){e=e||{};var t=this.context,r=_(t).getInstance().log,n=p(t).getInstance(),i=e.metricsModel,o=e.fragmentLoader,a={},s=void 0,u=void 0,l=void 0,c=void 0;function d(e){var t;return!!e&&(t=!1,l.some((function(r){if(n=e,i=r,!isNaN(n.index)&&n.startTime===i.startTime&&n.adaptationIndex===i.adaptationIndex&&n.type===i.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,r)||function(e,t){return e.action===v.ACTION_COMPLETE&&e.action===t.action}(e,r))return t=!0;var n,i})),t)}function f(e){return isNaN(e.duration)?.25:e.duration/8}function h(e){l=l.filter((function(t){var r=f(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-r}))}function y(e,t){t<=e+.5||(l=l.filter((function(r){var n=f(r);return isNaN(r.startTime)||r.startTime>=t-n||isNaN(r.duration)||r.startTime+r.duration<=e+n})))}function g(e,t,r){for(var n=e.length-1;n>=0;n--){var i=e[n],o=i.startTime,a=o+i.duration;if(r=isNaN(r)?f(i):r,!isNaN(o)&&!isNaN(a)&&t+r>=o&&t-r=i),p=t&&a.index-t.index==1||l&&l.length&&l.filter((function(e){return a.index-e.index==1})).length||0===a.index;if(r("push",a.mediaType,JSON.stringify({index:a.index,isLastNaNRequest:s,isCurrentNaNRequest:d,isCurrentTimeInFirstRequest:f,isMediaRequest:p,currentTime:i,range:a.range})),!d&&f&&l.length>1&&!p&&l.splice(1,l.length-1),t&&!d&&!f&&!p)return void u.getScheduleController().start();l.push(e.request)}w(e.request,e.error?A:S),n.trigger(m.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this}),e.request&&e.request.p2pLoadInfo&&"{}"!=JSON.stringify(e.request.p2pLoadInfo)&&n.trigger(m.FRAGMENT_P2P_LOAD_INFO,{p2pLoadInfo:e.request.p2pLoadInfo}),e.request&&e.request.loadInfo&&"{}"!=JSON.stringify(e.request.loadInfo)&&n.trigger(m.CDN_LOAD_INFO,{loadInfo:e.request.loadInfo,NCInfo:e.request.NCInfo,mediaInfo:{mediaType:e.request.mediaType,quality:e.request.quality,id:e.request.representationId}})}}function R(e){e.sender===o&&n.trigger(m.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this})}function C(e){if(e.sender===o&&(n.trigger(m.FRAGMENT_LOADING_ABANDONED,{streamProcessor:this.getStreamProcessor(),request:e.request,mediaType:e.mediaType}),e.request&&e.request.NCInfo&&"{}"!=JSON.stringify(e.request.NCInfo))){var t=e.request;if(Object.keys(a).length&&a.mediaType===t.mediaType&&a.quality===t.quality&&a.range===t.range&&a.delayLoadingTime===t.delayLoadingTime)return;a={mediaType:t.mediaType,quality:t.quality,range:t.range,delayLoadingTime:t.delayLoadingTime},n.trigger(m.CDN_LOAD_INFO,{NCInfo:e.request.NCInfo,mediaInfo:{mediaType:e.request.mediaType,quality:e.request.quality,id:e.request.representationId}})}}function P(){l=[],c=[]}return s={setStreamProcessor:function(e){u=e},getStreamProcessor:function(){return u},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],r=[];return t.forEach((function(t){var n=b(t);r=r.concat(function(e,t){return t.hasOwnProperty("time")?[g(e,t.time,t.threshold)]:e.filter((function(e){for(var r in t)if("state"!==r&&t.hasOwnProperty(r)&&e[r]!=t[r])return!1;return!0}))}(n,e))})),r},isFragmentLoaded:d,isFragmentLoadedOrPending:function(e){var t=!1,r=0,n=void 0;if(!(t=d(e)))for(r=0;r0&&y(r,t)}else h()},clearExecutedRequestBySeeking:function(){l=[]},abortRequests:function(){o.abort(),c=[]},executeRequest:function(e){switch(e.action){case v.ACTION_COMPLETE:l.push(e),w(e,S),r("[FragmentModel] executeRequest trigger STREAM_COMPLETED"),n.trigger(m.STREAM_COMPLETED,{request:e,fragmentModel:this});break;case v.ACTION_DOWNLOAD:w(e,E),c.push(e),function(e){n.trigger(m.FRAGMENT_LOADING_STARTED,{sender:s,request:e});var t=u&&u.getBufferLevel();e.bufferLevel=t,e.startLoadFragmentTime=(new Date).getTime(),o.load(e)}(e);break;default:r("Unknown request action.")}},reset:function(){n.off(m.LOADING_COMPLETED,T,this),n.off(m.LOADING_DATA_PROGRESS,R,this),n.off(m.LOADING_ABANDONED,C,this),o&&o.reset(),P()},addExecutedRequest:function(){},resetInitialSettings:P,getLastQnFragmentCompletedCnts:function(e){var t=0;if(l&&l.length>0)for(var r=l.length-1;r>=0&&e===l[r].quality;r--)t++;return t},resetPreloadData:function(){o&&o.resetPreloadData()},syncExecutedRequestsWithMultipleLevels:function(e,t){if(e&&0!==e.length){for(var r=0,n=0,i=e.length;n0&&y(r,t)}else h()},getRequestsForState:b,getLoadingRequests:function(){return c}},P(),n.on(m.LOADING_COMPLETED,T,s),n.on(m.LOADING_DATA_PROGRESS,R,s),n.on(m.LOADING_ABANDONED,C,s),s}w.__dashjs_factory_name="FragmentModel";var T=s.a.getClassFactory(w);T.FRAGMENT_MODEL_LOADING=E,T.FRAGMENT_MODEL_EXECUTED=S,T.FRAGMENT_MODEL_CANCELED="canceled",T.FRAGMENT_MODEL_FAILED=A,s.a.updateClassFactory(w.__dashjs_factory_name,T);var R=T,C=function e(t,r,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=r||null,this.data=n||null,this.errorCode=i||null,this.httpCode=o||null};function P(e,t,r){ var n=this.context,i=_(n).getInstance().log,o=p(n).getInstance(),a=void 0,s=void 0,u=[],l=r;function c(){return a?a.buffered:[]}function d(){var e=this;if(u.length>0){s=!0;var t=u[0];u.splice(0,1);var r=[],n=function(){var n=c();!function(e,t,r,n){t&&t.length>0&&t.length=n&&t.end<=i)return!0}return!1}(t,n)&&o.trigger(m.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:e,from:r.end(r.length-2),to:r.start(r.length-1),unintended:!0})}(e,r,n,t),u.length>0?d.call(this):(s=!1,l&&l({chunk:t}))};try{0===t.bytes.length?n.call(this):(r=c(),a.appendBuffer?a.appendBuffer(t.bytes):a.append(t.bytes,t),f(a,n.bind(this)))}catch(e){i('SourceBuffer append failed "'+e+'"'),u.length>0?d():s=!1,l&&l({chunk:t,error:new C(e.code,e.message,null)})}}}function f(e,t){var r=void 0,n=function(){e.updating||(clearInterval(r),t())};if(e.updating)if("function"==typeof e.addEventListener)try{e.addEventListener("updateend",(function r(){e.updating||(e.removeEventListener("updateend",r,!1),t())}),!1)}catch(e){r=setInterval(n,50)}else r=setInterval(n,50);else t()}var h={getAllBufferRanges:c,getBuffer:function(){return a},append:function(e){u.push(e),s||f(a,d.bind(this))},remove:function(t,r,n){var i=this;f(a,(function(){try{t>=0&&r>t&&(n||"ended"!==e.readyState)&&a.remove(t,r),f(a,(function(){o.trigger(m.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:i,from:t,to:r,unintended:!1})}))}catch(e){o.trigger(m.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:i,from:t,to:r,unintended:!1,error:new C(e.code,e.message,null)})}}))},abort:function(){try{("open"===e.readyState||a.setTextTrack&&"ended"===e.readyState)&&a.abort()}catch(e){i('SourceBuffer append abort failed: "'+e+'"')}u=[]},reset:function(){if(a){try{e.removeSourceBuffer(a)}catch(e){i("Failed to remove source buffer from media source.")}s=!1,a=null}u=[],l=null},setAppendWindowEnd:function t(r){r<=0||f(a,(function(){if("open"===e.readyState)a.appendWindowEnd=r;else var n=setTimeout((function(){clearTimeout(n),t(r)}),50)}))},updateTimestampOffset:function(e){a.timestampOffset===e||isNaN(e)||f(a,(function(){a.timestampOffset=e}))}};return function(){s=!1;var r=t.codec;try{if(r.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))throw new Error("not really supported");a=e.addSourceBuffer(r)}catch(e){throw e}}(),h}P.__dashjs_factory_name="SourceBufferSink";var I=s.a.getClassFactory(P);function D(e){var t=this.context,r=_(t).getInstance().log,n=[],i=void 0,o=e;function a(e,t){n=n.filter((function(r){return!((isNaN(t)||r.starte))}))}var s={getAllBufferRanges:function(){for(var e=[],t=0;te[e.length-1].end?e.push({start:r.start,end:r.end}):e[e.length-1].end=r.end}var i={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(i,"length",{get:function(){return e.length}}),i},append:function(e){"InitializationSegment"!==e.segmentType?(n.push(e),n.sort((function(e,t){return e.start-t.start})),i=null):i=e,r("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),o&&o({chunk:e})},remove:a,abort:function(){},discharge:function(e,t){var r=function(e,t){return n.filter((function(r){return(isNaN(t)||r.starte)}))}(e,t);return i&&(r.push(i),i=null),a(e,t),r},reset:function(){n=[],i=null,o=null}};return s}D.__dashjs_factory_name="PreBufferSink";var O=s.a.getClassFactory(D),x={DEFAULT:.5,STRONG:1,WEAK:0};function k(e,t,r){var n,i;return n=void 0===e?-1:e,i=function(e){var t=x.DEFAULT;return e!==x.DEFAULT&&e!==x.STRONG&&e!==x.WEAK||(t=e),t}(r),{quality:n,reason:void 0===t?null:t,priority:i}}k.__dashjs_factory_name="SwitchRequest";var N=s.a.getClassFactory(k);N.NO_CHANGE=-1,N.PRIORITY=x,s.a.updateClassFactory(k.__dashjs_factory_name,N);var L=N;function M(e){e=e||{};var t=this.context,r=_(t).getInstance().log,n=e.metricsModel;return{getMaxIndex:function(e){var i=L(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getStreamProcessor")))return i;!function(){if(!n||!n.hasOwnProperty("getReadOnlyMetricsFor"))throw new Error("Missing config parameter(s)")}();var o=e.getMediaInfo(),a=e.getMediaType(),s=n.getReadOnlyMetricsFor(a),u=e.getStreamProcessor(),l=e.getAbrController(),c=e.getStreamInfo(),d=c&&c.manifestInfo?c.manifestInfo.isDynamic:null,f=l.getThroughputHistory(),p=f.getSafeAverageThroughput(a,d),h=f.getAverageLatency(a),y=s.BufferState.length>0?s.BufferState[s.BufferState.length-1]:null,m=e.useBufferOccupancyABR();return!s||isNaN(p)||!y||m||l.getAbandonmentStateFor(a)!==ue.ABANDON_LOAD&&(y||d)&&(i.quality=l.getQualityForBitrate(o,p,h),u.getScheduleController().setTimeToLoadDelay(0),r("ThroughputRule requesting switch to index: ",i.quality,"type: ",a,"Average throughput",Math.round(p),"kbps"),i.reason={throughput:p,latency:h}),i},reset:function(){}}}M.__dashjs_factory_name="ThroughputRule";var F=s.a.getClassFactory(M);function U(e){e=e||{};var t=this.context,r=_(t).getInstance().log,n=e.mediaPlayerModel,i=e.metricsModel,o=e.dashMetrics,a=void 0,s=void 0,u=void 0;function l(){a={},s={},u=[]}var c={shouldAbandon:function(e){var l=L(t).create(L.NO_CHANGE,{name:U.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return l;var c,d,f=e.getMediaInfo(),p=e.getMediaType(),h=e.getCurrentRequest();if(!isNaN(h.index)){c=p,d=h.index,a[c]=a[c]||{},a[c][d]=a[c][d]||{};var y=n.getStableBufferTime(),m=o.getCurrentBufferLevel(i.getReadOnlyMetricsFor(p));if(m>y)return l;var g=a[p][h.index];if(null===g||null===h.firstByteDate||s.hasOwnProperty(g.id))return l;if(void 0===g.firstByteTime&&(u[p]=[],g.firstByteTime=h.firstByteDate.getTime(),g.segmentDuration=h.duration,g.bytesTotal=h.bytesTotal,g.id=h.index),g.bytesLoaded=h.bytesLoaded,g.elapsedTime=(new Date).getTime()-g.firstByteTime,g.bytesLoaded>0&&g.elapsedTime>0&&function(e,t){u[e]=u[e]||[],u[e].push(t)}(p,Math.round(8*g.bytesLoaded/g.elapsedTime)),u[p].length>=5&&g.elapsedTime>500&&g.bytesLoaded0?s.BufferState[s.BufferState.length-1]:null;return t>=.8*r&&o>e?e>0?e-1:e:r<1||u&&u.state===Ue.BUFFER_EMPTY?0:void 0!==a?Math.max(a,o):o}(A,b,m);E>g.bytesTotal*S[w].bitrate/S[A].bitrate&&w!==A&&(l.quality=w,l.reason.throughput=g.measuredBandwidthInKbps,l.reason.fragmentID=g.id,s[g.id]=g,r("AbandonRequestsRule ( ",p,"frag id",g.id,") is asking to abandon and switch to quality to ",w,"from quality "+A," measured bandwidth was",g.measuredBandwidthInKbps),delete a[p][g.id])}}else g.bytesLoaded===g.bytesTotal&&delete a[p][g.id]}return l},reset:l};return l(),c}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}U.__dashjs_factory_name="AbandonRequestsRule",s.a.getClassFactory(U);var G=function e(){B(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null},V=function e(){B(this,e),this.s=null,this.d=null,this.b=[]};function W(e){e=e||{};var t=this.context,r=_(t).getInstance().log,n=e.dashMetrics,o=e.metricsModel,a=e.mediaPlayerModel,s=p(t).getInstance(),u=void 0,l=void 0 ;function c(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function d(){for(var e in l)if(l.hasOwnProperty(e)){var t=l[e];0!==t.state&&c(t)}}function f(){}function h(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var r=n.getCurrentBufferLevel(o.getReadOnlyMetricsFor(t))+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=function(e,t){return e.Vp*(e.utilities[t]+e.gp)}(e,e.lastQuality),a=Math.max(0,i-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=l[e.chunk.mediaInfo.type];if(t&&0!==t.state){var r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,h(t,e.chunk.mediaInfo.type)}}}function g(e){if(e&&e.metric===i.HTTP_REQUEST&&e.value&&e.value.type===G.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=l[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),h(t,e.mediaType))}}function v(e){if(e){var t=l[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function b(e){}function E(e,t,r,n){var i=e.getRealBufferLevel();return+(5*r[t].bandwidth/(1e3*n)).toFixed(2)>i-3}function S(){l={}}return u={getMaxIndex:function(e){var i=e.getMediaInfo(),s=e.getMediaType(),u=o.getReadOnlyMetricsFor(s),d=e.getStreamProcessor(),f=e.getStreamInfo(),p=e.getAbrController(),h=p.getThroughputHistory(),y=(f&&f.id,f&&f.manifestInfo&&f.manifestInfo.isDynamic),m=e.useBufferOccupancyABR(),g=L(t).create();if(g.reason=g.reason||{},!m)return g;d.getScheduleController().setTimeToLoadDelay(0);var v=function(e){var t=e.getMediaType(),r=l[t];return r||(r=function(e){var t={},r=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),n=function(e){return e.map((function(e){return Math.log(e)}))}(r);n=n.map((function(e){return e-n[0]+1}));var i=a.getStableBufferTime(),o=function(e,t,r){var n=r.reduce((function(e,t,n){return t>r[e]?n:e}),0);if(0===n)return null;var i=Math.max(e,10+2*t.length),o=(r[n]-1)/(i/10-1);return{gp:o,Vp:10/o}}(i,r,n);return o?(t.state=1,t.bitrates=r,t.utilities=n,t.stableBufferTime=i,t.Vp=o.Vp,t.gp=3,t.lastQuality=0,c(t)):t.state=0,t}(e),l[t]=r),r}(e);if(0===v.state)return g;var b=n.getCurrentBufferLevel(u),_=h.getAverageThroughput(s,y),S=h.getSafeAverageThroughput(s,y),A=h.getAverageLatency(s),w=void 0;if(g.reason.state=v.state,g.reason.throughput=_,g.reason.latency=A,isNaN(_))return g;switch(v.state){case 1:w=p.getQualityForBitrate(i,.4*S,A);var T=e.getCurrentValue();w>T&&(w=T),g.quality=w,g.reason.throughput=S,v.lastQuality=w,v.lastPredictQn=w,isNaN(v.lastSegmentDurationS),!isNaN(v.lastSegmentDurationS)&&b>=1*v.lastSegmentDurationS&&(v.state=2),r("【bolaV2 "+s+"】use throughput qn is "+i.bitrateList[w].id);break;case 2:var R=p.getPlaybackRate(),C=p.getRealBufferLevel();w=function(e,t,n,i,o){var a=t.bitrates.length,s=Math.min(1,n/e)/o,u=NaN,l=NaN,c=t.utilities,d=t.gp,f=c[c.length-1];r("【bolaV2 getQn "+i+"】, efcBuf: "+e+", curBufLv: "+s+", high: "+f);for(var p=a-1;p>=0;p--){var h=s;p=l)&&(l=m,u=p)}return u}(p.getEffectiveBufferTime(),v,C,s,R),w=function(e,t,n,i){var o=0,s=n.getMediaInfo(),u=n.getMediaType(),l=n.getAbrController(),c=l.getThroughputHistory(),d=c.getAverageLatency(u);if(e>i){var f=c.getMinThroughput(u),p=t;o=f*a.getFactorByBufferLevel(p),r("【bolaV2 cac "+u+"】 min throughput: "+f)}else o=c.getSafeAverageThroughput(u),r("【bolaV2 cac "+u+"】 avg throughput: "+c.getAverageThroughput(u));var h=l.getQualityForBitrate(s,o,d),y=s.bitrateList;if(r("【bolaV2 adjust "+u+"】startQn: "+y[e].id+", curQn: "+y[i].id+", cache: "+t+", adapter: "+o+", latency: "+d+", thQn: "+y[h].id),e>i)e=he?e:h;else{var m=c.getDict(u);h>=i||!m||m.length<2?E(l,i,y,o)&&(e=i):(h>e||h=1*v.lastSegmentDurationS&&(v.state=2),g.quality=w,g.reason.throughput=_,g.reason.latency=A,g.reason.bufferLevel=b,r("【bolaV2 "+s+"】seek use throughput qn is "+i.bitrateList[w].id);break;default:r("BOLA ABR rule invoked in bad state."),g.quality=p.getQualityForBitrate(i,S,A),g.reason.state=v.state,g.reason.throughput=S,g.reason.latency=A,v.state=1,c(v)}return g},reset:function(){S(),s.off(m.PLAYBACK_xING,d,u),s.off(m.PERIOD_SWITCH_STARTED,f,u),s.off(m.MEDIA_FRAGMENT_LOADED,y,u),s.off(m.METRIC_ADDED,g,u),s.off(m.QUALITY_CHANGE_REQUESTED,v,u),s.off(m.FRAGMENT_LOADING_ABANDONED,b,u)}},S(),s.on(m.PLAYBACK_SEEKING,d,u),s.on(m.PERIOD_SWITCH_STARTED,f,u),s.on(m.MEDIA_FRAGMENT_LOADED,y,u),s.on(m.METRIC_ADDED,g,u),s.on(m.QUALITY_CHANGE_REQUESTED,v,u),s.on(m.FRAGMENT_LOADING_ABANDONED,b,u),u}G.GET="GET",G.HEAD="HEAD",G.MPD_TYPE="MPD",G.XLINK_EXPANSION_TYPE="XLinkExpansion",G.INIT_SEGMENT_TYPE="InitializationSegment",G.INDEX_SEGMENT_TYPE="IndexSegment",G.MEDIA_SEGMENT_TYPE="MediaSegment",G.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",G.OTHER_TYPE="other",W.__dashjs_factory_name="BolaRuleV2";var j=s.a.getClassFactory(W),H="qualitySwitchRules",Z="abandonFragmentRules";function Y(e){e=e||{};var t=this.context,r=e.mediaPlayerModel,n=e.metricsModel,i=e.dashMetrics,o=void 0,a=void 0;function s(e){return e.filter((function(e){return e.quality>L.NO_CHANGE}))}function u(e){var r,n={},i=void 0,o=void 0,a=void 0,s=void 0;if(0!==e.length){for(n[L.PRIORITY.STRONG]=L.NO_CHANGE,n[L.PRIORITY.WEAK]=L.NO_CHANGE,n[L.PRIORITY.DEFAULT]=L.NO_CHANGE,i=0,r=e.length;iL.NO_CHANGE?Math.min(n[o.priority],o.quality):o.quality);return n[L.PRIORITY.WEAK]!==L.NO_CHANGE&&(a=n[L.PRIORITY.WEAK]),n[L.PRIORITY.DEFAULT]!==L.NO_CHANGE&&(a=n[L.PRIORITY.DEFAULT]),n[L.PRIORITY.STRONG]!==L.NO_CHANGE&&(a=n[L.PRIORITY.STRONG]),a!==L.NO_CHANGE&&(s=a),L(t).create(s)}}return{initialize:function(){o=[],a=[],r.getUseDefaultABRRules()&&(o.push(j(t).create({metricsModel:n,dashMetrics:i,mediaPlayerModel:r})),o.push(F(t).create({metricsModel:n,dashMetrics:i}))),r.getABRCustomRules().forEach((function(e){e.type===H&&o.push(e.rule(t).create()),e.type===Z&&a.push(e.rule(t).create())}))},reset:function(){[o,a].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),o=[],a=[]},getMaxQuality:function(e){return u(s(o.map((function(t){return t.getMaxIndex(e)}))))||L(t).create()},shouldAbandonFragment:function(e){return u(s(a.map((function(t){return t.shouldAbandon(e)}))))||L(t).create()}}}Y.__dashjs_factory_name="ABRRulesCollection";var K=s.a.getClassFactory(Y);K.QUALITY_SWITCH_RULES=H,K.ABANDON_FRAGMENT_RULES=Z,s.a.updateSingletonFactory(Y.__dashjs_factory_name,K);var q=K,z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN,this.id=""};function X(e){var t=(e=e||{}).abrController,r=e.streamProcessor,n=e.streamProcessor.getCurrentRepresentationInfo(),i=e.switchHistory,o=e.droppedFramesHistory,a=e.currentRequest,s=e.useBufferOccupancyABR,u=e.currentValue;return{getMediaType:function(){return n.mediaInfo.type},getMediaInfo:function(){return n.mediaInfo}, getDroppedFramesHistory:function(){return o},getCurrentRequest:function(){return a},getSwitchHistory:function(){return i},getStreamInfo:function(){return n.mediaInfo.streamInfo},getStreamProcessor:function(){return r},getAbrController:function(){return t},getRepresentationInfo:function(){return n},useBufferOccupancyABR:function(){return s},getCurrentValue:function(){return u}}}X.__dashjs_factory_name="RulesContext";var Q=s.a.getClassFactory(X);function J(){var e=[],t=[];return{push:function(r){r.newValue===L.NO_CHANGE&&(r.newValue=r.oldValue),e[r.oldValue]||(e[r.oldValue]={noDrops:0,drops:0,dropSize:0});var n=r.newValue-r.oldValue,i=n<0?1:0,o=i?-n:0,a=i?0:1;if(e[r.oldValue].drops+=i,e[r.oldValue].dropSize+=o,e[r.oldValue].noDrops+=a,t.push({idx:r.oldValue,noDrop:a,drop:i,dropSize:o}),t.length>8){var s=t.shift();e[s.idx].drops-=s.drop,e[s.idx].dropSize-=s.dropSize,e[s.idx].noDrops-=s.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}J.__dashjs_factory_name="SwitchRequestHistory";var $=s.a.getClassFactory(J);function ee(){var e=[],t=0,r=0;return{push:function(n,i){var o=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,a=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=o-t;t=o;var u=a-r;r=a,isNaN(n)||(e[n]?(e[n].droppedVideoFrames+=s,e[n].totalVideoFrames+=u):e[n]={droppedVideoFrames:s,totalVideoFrames:u})},getFrameHistory:function(){return e},getFrameInfo:function(){return{droppedFrames:t,totalFrames:r}},reset:function(n){e=[],t=n.droppedVideoFrames,r=n.totalVideoFrames}}}ee.__dashjs_factory_name="DroppedFramesHistory";var te=s.a.getClassFactory(ee);function re(e){var t=(e=e||{}).mediaPlayerModel,r=void 0,i=void 0,o=void 0,a=void 0,s=void 0;function u(e,t,r,n){var i=Math.pow(.5,r/n.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var o=Math.pow(.5,r/n.slow);e.slowEstimate=(1-o)*t+o*e.slowEstimate,e.totalWeight+=r}function l(e,u,l){return t.getMovingAverageMethod()!==n.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var r=e?s.throughputHalfLife:s.latencyHalfLife,n=e?o[t]:a[t];if(!n||n.totalWeight<=0)return NaN;var i=n.fastEstimate/(1-Math.pow(.5,n.totalWeight/r.fast)),u=n.slowEstimate/(1-Math.pow(.5,n.totalWeight/r.slow));return e?Math.min(i,u):Math.max(i,u)}(e,u):function(e,t,n){var o=function(e,t,n){var o=void 0,a=void 0;if(e?(o=r[t],a=n?3:4):(o=i[t],a=4),o){if(a>=o.length)a=o.length;else if(e)for(var s=1;s=1.3||u<=1/1.3)&&(a+=1)===o.length)break}}else a=0;return a}(e,t,n),a=(e?r:i)[t];return 0!==o&&a&&0!==a.length?(a=a.slice(-o)).reduce((function(e,t){return e+t}))/a.length:NaN}(e,u,l)}function c(e,t){return l(!0,e,t)}function d(e){r[e]=r[e]||[],i[e]=i[e]||[],o[e]=o[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function f(){r={},i={},o={},a={}}var p={push:function(e,l,c){if(l.trace&&l.trace.length){var f=l.tresponse.getTime()-l.trequest.getTime()||1,p=l._tfinish.getTime()-l.tresponse.getTime()||1,h=l.trace.reduce((function(e,t){return e+t.b[0]}),0),y=f+p,m=Math.round(8*h/y);if(!(h<1e4)){if(d(e),function(e,r,i){return e===n.VIDEO?i+r0&&!r[e].hasCachedEntries)return;r[e].hasCachedEntries=!0}else r[e]&&r[e].hasCachedEntries&&function(e){delete r[e],delete i[e],delete o[e],delete a[e],d(e)}(e);m>9900&&(m=9900),r[e].push(m),r[e].length>5&&r[e].shift(),i[e].push(f),i[e].length>5&&i[e].shift(),u(o[e],m,.001*p,s.throughputHalfLife),u(a[e],f,1,s.latencyHalfLife)}}},getAverageThroughput:c,getSafeAverageThroughput:function(e,r){var n=c(e,r);return isNaN(n)||(n*=t.getBandwidthSafetyFactor()),n},getAverageLatency:function(e){return l(!1,e)},getMinThroughput:function(e){return Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t5&&i[e].shift()),h>9900&&(h=9900),r[e].push(h),r[e].length>5&&r[e].shift(),u(o[e],h,.001*l,s.throughputHalfLife),!0}},reset:f};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},f(),p}re.__dashjs_factory_name="ThroughputHistory";var ne=s.a.getClassFactory(re),ie="abandonload",oe="allowload";function ae(){var e=this.context,t=_(e).getInstance(),r=p(e).getInstance(),o=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,y=void 0,g=void 0,v=void 0,b=void 0,E=void 0,S=void 0,A=void 0,w=void 0,T=void 0,C=void 0,P=void 0,I=void 0,D=void 0,O=void 0,x=void 0,k=void 0,N=void 0,M=void 0,F=void 0,U=void 0,B=void 0,V=void 0,W=void 0,j=void 0,H={video:0,audio:0},Z={video:{},audio:{}};function Y(e){var t=e.request.mediaType;"MediaSegment"===e.request.type&&"video"===t&&M.onProgress(t,e.request,e.response)}function K(e){e||(l={video:!0,audio:!0}),c={},d={},f={},h={},g={},y={},k={},F={},b=!1,V=!0,E=!1,void 0===S&&(S=!1),x=void 0,N=void 0,M=void 0,clearTimeout(v),v=null,W={video:!1,audio:!1}}function X(e){e.mediaType===n.VIDEO&&(x=e.oldQuality,N.push(x,I.getPlaybackQuality()))}function J(e){e.metric!==i.HTTP_REQUEST||!e.value||e.value.type!==G.MEDIA_SEGMENT_TYPE||e.mediaType!==n.AUDIO&&e.mediaType!==n.VIDEO||M.push(e.mediaType,e.value,V),e.metric!==i.BUFFER_LEVEL||e.mediaType!==n.AUDIO&&e.mediaType!==n.VIDEO||function(e,t){var r=D.getABRStrategy();if(r!==n.ABR_STRATEGY_BOLA)if(r!==n.ABR_STRATEGY_THROUGHPUT){var i=D.getStableBufferTime(),o=i,s=.5*i,u=F[e],l=t>(u?s:o);F[e]=l,l!==u&&a(l?"AbrController ("+e+") switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+").":"AbrController ("+e+") switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+").")}else F[e]=!1;else F[e]=!0}(e.mediaType,.001*e.value.level)}function ee(e,t){var r=void 0;return c[t]=c[t]||{},c[t].hasOwnProperty(e)||(c[t][e]=0),r=function(e,t){var r=e;if(!y[t])return r;var n=ue(t);void 0!==n&&(r=Math.max(e,n));var i=se(t);return void 0!==i&&(r=Math.min(r,i)),r}(c[t][e],e),r=function(e,t,r){var n=le(t);return isNaN(n)||n>=1||n<0?e:Math.min(e,Math.round(r*n))}(r,e,c[t][e]),r=function(e,t){if(t!==n.VIDEO||!b||!y[t])return e;S||ve();var r=T.getValue(),i=C.getAdaptationForType(r,0,t).Representation,o=e;if(A>0&&w>0){for(;o>0&&i[o]&&A=o&&i[o].width===i[o+1].width&&(o=Math.min(e,o+1))}return o}(r,e),r}function re(e){return f.hasOwnProperty("max")&&f.max.hasOwnProperty(e)?f.max[e]:NaN}function ae(e){return f.hasOwnProperty("min")&&f.min.hasOwnProperty(e)?f.min[e]:NaN}function se(e){var t=re(e);return t?he(y[e].getMediaInfo(),t):void 0}function ue(e){var t=ae(e);if(t){var r=ye(y[e].getMediaInfo()),n=he(y[e].getMediaInfo(),t);return r[n]&&n=0&&r<=a&&fe(e,o,r,a,n)}function fe(e,n,i,o,s){if(e&&y[e]){var u=y[e].getStreamInfo(),l=u?u.id:null;if(t.getABRLogVisible()){var c=B.getCurrentBufferLevel(U.getReadOnlyMetricsFor(e));a("AbrController ("+e+") switch from "+n+" to "+i+"/"+o+" (buffer: "+c+") "+(s?JSON.stringify(s):"."))}!function(e,t,r){d[t]=d[t]||{},d[t][e]=r}(e,l,i),r.trigger(m.QUALITY_CHANGE_REQUESTED,{mediaType:e,streamInfo:u,oldQuality:n,newQuality:i,reason:s})}}function pe(e,t){g[e].state=t,g[e].time=t===ie?performance.now():NaN}function he(e,t,r){ if(V&&r&&y[e.type].getCurrentRepresentationInfo()&&y[e.type].getCurrentRepresentationInfo().fragmentDuration){r/=1e3;var n=y[e.type].getCurrentRepresentationInfo().fragmentDuration;if(r>n)return 0;t*=1-r/n}var i=ye(e);if(!i||0===i.length)return 0;for(var o=i.length-1;o>=0;o--)if(1e3*t>=i[o].bitrate)return o;return 0}function ye(e){if(!e||!e.bitrateList)return null;for(var t=e.bitrateList,r=e.type,n=[],i=void 0,o=0,a=t.length;oL.NO_CHANGE){var l=n.getFragmentModel();l.getRequests({state:R.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(l.abortRequests(),pe(r,ie),k[r].reset(),k[r].push({oldValue:ge(r,u.getActiveStreamInfo()),newValue:a.quality,confidence:1,reason:a.reason}),de(r,u.getActiveStreamInfo(),a.quality,a.reason),clearTimeout(v),v=setTimeout((function(){pe(r,oe),v=null}),D.getAbandonLoadTimeout()))}}}function _e(e){if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var t=D.getPreloadData();if(t&&t[e+"id"])return y[e].getRepresentationController().getQualityForRepresentationId(t[e+"id"])}return H[e]||0}return o={isPlayingAtTopQuality:function(e){var t=e.id,r=ge(n.AUDIO),i=ge(n.VIDEO);return r===ee(n.AUDIO,t)&&i===ee(n.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,r=e.streamInfo.id,n=e.representationCount-1;return function(e,t,r){c[t]=c[t]||{},c[t][e]=r}(t,r,n),n},getThroughputHistory:function(){return M},getBitrateList:ye,getQualityForBitrate:he,getMaxAllowedBitrateFor:re,getTopBitrateInfoFor:function(e){if(e&&y&&y[e]){var t=y[e].getStreamInfo();if(t.id){var r=ee(e,t.id),n=ye(y[e].getMediaInfo());return n[r]?n[r]:null}}return null},getMinAllowedBitrateFor:ae,setMaxAllowedBitrateFor:function(e,t){f.max=f.max||{},f.max[e]=t},setMinAllowedBitrateFor:function(e,t){f.min=f.min||{},f.min[e]=t},getMaxAllowedIndexFor:se,getMinAllowedIndexFor:ue,getMaxAllowedRepresentationRatioFor:le,setMaxAllowedRepresentationRatioFor:function(e,t){h.max=h.max||{},h.max[e]=t},getInitialBitrateFor:function(e){var t=O.getSavedBitrateSettings(e);if(!f.hasOwnProperty(e))if(h.hasOwnProperty(e)){var r=T.getValue(),i=C.getAdaptationForType(r,0,e).Representation;if(Array.isArray(i)){var o=Math.max(Math.round(i.length*h[e])-1,0);f[e]=i[o].bandwidth}else f[e]=0}else isNaN(t)?f[e]=e===n.VIDEO?1e3:100:f[e]=t;return f[e]},setInitialBitrateFor:function(e,t){f[e]=t},getInitialRepresentationRatioFor:function(e){return h.hasOwnProperty(e)?h[e]:null},setInitialRepresentationRatioFor:function(e,t){h[e]=t},setAutoSwitchBitrateFor:function(e,t){l[e]=t},getAutoSwitchBitrateFor:ce,getUseDeadTimeLatency:function(){return V},setUseDeadTimeLatency:function(e){V=e},setLimitBitrateByPortal:function(e){b=e},getLimitBitrateByPortal:function(){return b},getUsePixelRatioInLimitBitrateByPortal:function(){return E},setUsePixelRatioInLimitBitrateByPortal:function(e){E=e},getQualityFor:ge,getAbandonmentStateFor:function(e){return g[e]?g[e].state:null},setPlaybackQuality:de,checkPlaybackQuality:function(r){if(r&&y&&y[r]){var n=y[r].getStreamInfo(),i=n?n.id:null,u=ge(r),l=Q(e).create({abrController:o,streamProcessor:y[r],currentValue:u,switchHistory:k[r],droppedFramesHistory:N,useBufferOccupancyABR:me(r)});if(N){var c=I.getPlaybackQuality();c&&N.push(x,c)}if(ce(r)){var d=ue(r),f=ee(r,i),p=s.getMaxQuality(l),h=p.quality;if(void 0!==d&&hf&&(h=f),k[r].push({oldValue:u,newValue:h}),h>L.NO_CHANGE&&h!=u){if(g[r].state===oe||h>u)return W[r]=!0,fe(r,u,h,f,p.reason),!0}else if(t.getABRLogVisible()){var m=B.getCurrentBufferLevel(U.getReadOnlyMetricsFor(r));a("AbrController ("+r+") stay on "+u+"/"+f+" (buffer: "+m+")")}}}return!1},getTopQualityIndexFor:ee,setElementSize:ve,setWindowResizeEventCalled:function(e){S=e},createAbrRulesCollection:function(){(s=q(e).create({metricsModel:U,dashMetrics:B,mediaPlayerModel:D,videoModel:I,adapter:P})).initialize()},registerStreamType:function(t,i){k[t]=$(e).create(),y[t]=i,g[t]=g[t]||{},g[t].state=oe,F[t]=!1,r.on(m.LOADING_PROGRESS,be,this),r.on(m.FRAGMENT_LOADING_PROGRESS,Y,this),t==n.VIDEO&&(r.on(m.QUALITY_CHANGE_RENDERED,X,this),N=te(e).create()),r.on(m.METRIC_ADDED,J,this),M=ne(e).create({mediaPlayerModel:D})},unRegisterStreamType:function(e){delete y[e]},setDefaultQualityFor:function(e,t){H[e]=Number(t)||0,a("Set default quality for "+e+" - "+H[e])},getDefaultQualityFor:_e,getDroppedFramesInfo:function(){return N&&N.getFrameInfo&&N.getFrameInfo()||{}},setCurrentSegmentInfoFor:function(e,t){Z[e]=t},getCurrentSegmentInfoFor:function(e){return Z[e]},getInitializeDate:function(){return j},getHasChangedByABRStrategy:function(e){return W[e]},setConfig:function(e){e&&(e.streamController&&(u=e.streamController),e.domStorage&&(O=e.domStorage),e.mediaPlayerModel&&(D=e.mediaPlayerModel),e.metricsModel&&(U=e.metricsModel),e.dashMetrics&&(B=e.dashMetrics),e.dashManifestModel&&(C=e.dashManifestModel),e.adapter&&(P=e.adapter),e.manifestModel&&(T=e.manifestModel),e.videoModel&&(I=e.videoModel),e.initializeDate&&(j=e.initializeDate))},getLastQnFragmentCompletedCnts:function(e,t){var r=y[e];return r?r.getFragmentModel().getLastQnFragmentCompletedCnts(t):0},getEffectiveBufferTime:function(){var e,t=D.getStableBufferTime(),r=I.getTime(),n=I.getDuration()-r,i=(new Date).getTime(),o=D.getLastStartSeekTime(),s=D.getStartPlaybackTime(),u=(i-Math.max(o,s))/1e3;return e=u<10?Math.min(10,t):Math.min(Math.min(n,u),t),a("【bolaV2 getEfc】max: "+t+", curTime: "+r+",playTime: "+u+", lseek: "+o),e},getPlaybackRate:function(){return I.getPlaybackRate()||1},reset:function(){K(!0),r.off(m.LOADING_PROGRESS,be,this),r.off(m.FRAGMENT_LOADING_PROGRESS,Y,this),r.off(m.QUALITY_CHANGE_RENDERED,X,this),r.off(m.METRIC_ADDED,J,this),s&&s.reset()},shouldAbandon:function(e,t){var r=e.retry,n=e.retryTimes,i=e.bytesTotal,o=e.bytesLoaded;return r>0||n>0||+((i-o)/(1e3*M.getSafeAverageThroughput(t,!1))).toFixed(2)>B.getCurrentBufferLevel(U.getReadOnlyMetricsFor(t))-5},getRealBufferLevel:function(){var e=I.getVideoBufferRanges();if(!e||e.length<=0)return 0;var t=I.getTime();return e[e.length-1].end-t||0}},a=t.log.bind(o),K(),o}ae.__dashjs_factory_name="AbrController";var se=s.a.getSingletonFactory(ae);se.ABANDON_LOAD=ie,se.QUALITY_DEFAULT=0,s.a.updateSingletonFactory(ae.__dashjs_factory_name,se);var ue=se,le="neverReplace",ce="alwaysReplace",de="highestBitrate",fe="widestRange",pe=de;function he(){var e,t=this.context,r=_(t).getInstance().log,i=p(t).getInstance(),o=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=[ce,le],d=[de,fe],f={video:0,audio:0};function h(e,t){if(!e||!t)return[];var r=t.id;return o[r]&&o[r][e]?o[r][e].list:[]}function y(e,t){return!e||!t||t&&!o[t.id]?null:o[t.id][e].current}function g(e){if(e){var t=e.type,r=e.streamInfo,n=r.id,a=y(t,r);if(o[n]&&o[n][t]&&(!a||!A(e,a))){o[n][t].current=e,a&&i.trigger(m.CURRENT_TRACK_CHANGED,{oldMediaInfo:a,newMediaInfo:e,switchMode:u[t]});var s=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);s&&o[n][t].storeLastSettings&&(s.roles&&(s.role=s.roles[0],delete s.roles),s.accessibility&&(s.accessibility=s.accessibility[0]),s.audioChannelConfiguration&&(s.audioChannelConfiguration=s.audioChannelConfiguration[0]),l.setSavedMediaSettings(t,s))}}}function v(e,t){e&&t&&(a[e]=t)}function b(e){return e?a[e]:null}function E(){return s||pe}function S(e){ return e===n.AUDIO||e===n.VIDEO||e===n.TEXT||e===n.FRAGMENTED_TEXT||e===n.IMAGE}function A(e,t){var r=e.id===t.id,n=e.viewpoint===t.viewpoint,i=e.lang===t.lang,o=e.roles.toString()===t.roles.toString(),a=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return r&&n&&i&&o&&a&&s}function w(){o={},a={audio:null,video:null},u={audio:ce,video:le}}function T(e,t){var r=!e.lang||e.lang===t.lang,n=!e.viewpoint||e.viewpoint===t.viewpoint,i=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],o=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],a=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&n&&i&&o&&a}function R(e){var t=E(),n=[],i=function(e){var t=0,r=[],n=void 0;return e.forEach((function(e){(n=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>t?(t=n,r=[e]):n===t&&r.push(e)})),r},o=function(e){var t=0,r=[],n=void 0;return e.forEach((function(e){(n=e.representationCount)>t?(t=n,r=[e]):n===t&&r.push(e)})),r};switch(t){case de:(n=i(e)).length>1&&(n=o(n));break;case fe:(n=o(e)).length>1&&(n=i(e));break;default:r("track selection mode is not supported: "+t)}return n[0]}return e={checkInitialMediaSettingsForType:function(e,t){var r=b(e),i=h(e,t),o=[];e!==n.FRAGMENTED_TEXT?(r||v(e,r=l.getSavedMediaSettings(e)),i&&0!==i.length&&(r&&i.forEach((function(e){T(r,e)&&o.push(e)})),0===o.length?g(R(i)):o.length>1?g(R(o)):g(o[0]))):g(i[0])},addTrack:function(e){if(e){var t=e.type;if(S(t)){var r=e.streamInfo.id;o[r]||(o[r]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var n=o[r][t].list,i=0,a=n.length;i0&&(f[e]=t)},getStartOffsetTimeForType:function(e){return f[e]||0},setConfig:function(e){e&&(e.errHandler&&e.errHandler,e.domStorage&&(l=e.domStorage))},reset:w},w(),e}he.__dashjs_factory_name="MediaController";var ye=s.a.getSingletonFactory(he);ye.TRACK_SWITCH_MODE_NEVER_REPLACE=le,ye.TRACK_SWITCH_MODE_ALWAYS_REPLACE=ce,ye.TRACK_SELECTION_MODE_HIGHEST_BITRATE=de,ye.TRACK_SELECTION_MODE_WIDEST_RANGE=fe,ye.DEFAULT_INIT_TRACK_SELECTION_MODE=pe,s.a.updateSingletonFactory(he.__dashjs_factory_name,ye);var me=ye,ge=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var r=0;r0?r[r.length-1]:null}}}ve.__dashjs_factory_name="IsoFile";var be=s.a.getClassFactory(ve),_e=r(1),Ee=r.n(_e),Se=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=r,this.size=n};function Ae(){var e=this.context;function t(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function r(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return{parse:function(t){if(!t)return null;void 0===t.fileStart&&(t.fileStart=0);var r=Ee.a.parseBuffer(t),n=be(e).create();return n.setData(r),n},findLastTopIsoBoxCompleted:function(e,n,i){if(void 0===i&&(i=0),!n||i+8>=n.byteLength)return new Se(0,!1);for(var o=n instanceof ArrayBuffer?new Uint8Array(n):n,a=void 0,s=0;i=0?a=new Se(i,!0,u):s=i+u),i+=u}return a||new Se(s,!1)}}}Ae.__dashjs_factory_name="BoxParser";var we=s.a.getSingletonFactory(Ae);function Te(){var e={};return{save:function(t){var r=t.streamId,n=t.representationId;e[r]=e[r]||{},e[r][n]=t},extract:function(t,r){return e&&e[t]&&e[t][r]?e[t][r]:null},reset:function(){e={}}}}Te.__dashjs_factory_name="InitCache";var Re=s.a.getSingletonFactory(Te),Ce="AudioTrackController",Pe=[1,3,7];function Ie(e){e=e||{};var t,r=this.context,i=e.bufferController,o=e.mediaPlayerModel,a=p(r).getInstance(),s=1,u=void 0,l=void 0;function c(e){e.chunk.mediaInfo.type===n.AUDIO&&h(e.chunk.bytes)}function d(e){u&&e.sender.getType()===n.AUDIO&&(u=!1,a.trigger(m.SWITCH_AUDIO_TRACK_RENDERED,{id:o.getAudioTrackId(),index:e.index,startTime:e.startTime}))}function f(){return o.getAudioTrackId()!==s}function h(e){for(var t=Ee.a.parseBuffer(e).fetchAll("tkhd"),r=[],n=0;n1){var n=o.getAudioTrackId(),i=r.find((function(e){return e.track_ID===s})),a=r.find((function(e){return e.track_ID===n}));i&&a&&(i._raw.setUint32(12,n),a._raw.setUint32(12,s),e.trackSwitchInfo={id:n})}}},setDefaultTrackId:h,revertDefaultTrack:function(e){if(e&&e.trackSwitchInfo){var t=e.bytes,r=e.trackSwitchInfo.id,n=Ee.a.parseBuffer(t).fetchAll("tfhd");if(n&&n.length>1){var i=n.find((function(e){return e.track_ID===s})),o=n.find((function(e){return e.track_ID===r}));i&&o&&(i._raw.setUint32(12,r),o._raw.setUint32(12,s),e.trackSwitchInfo=null)}}},setSwitchingState:function(e){u=e},initialize:function(){a.on(m.BYTES_APPENDED_END_FRAGMENT,d,this),a.on(m.INIT_FRAGMENT_LOADED,c,this)},reset:function(){u=!1,a.off(m.BYTES_APPENDED_END_FRAGMENT,d,this),a.off(m.INIT_FRAGMENT_LOADED,c,this)}},l=_(r).getInstance().log.bind(t),u=!1,t}Ie.__dashjs_factory_name="AudioTrackController";var De=s.a.getClassFactory(Ie),Oe="bufferLoaded",xe="bufferStalled",ke=.5,Ne=.01,Le="BufferController";function Me(e){e=e||{};var t=this.context,r=p(t).getInstance(),i=e.metricsModel,o=e.mediaPlayerModel,a=e.errHandler,s=e.streamController,u=e.mediaController,l=e.adapter,c=e.abrController,d=e.playbackController,f=e.type,h=e.streamProcessor,y=void 0,g=void 0,b=void 0,E=void 0,S=void 0,A=void 0,w=void 0,T=void 0,C=void 0,P=void 0,D=void 0,x=void 0,k=void 0,N=void 0,L=void 0,M=void 0,F=void 0,U=void 0,B=void 0,V=void 0,W=void 0,j=void 0,H=void 0,Z=void 0,Y=void 0,K=void 0,q=void 0,z=void 0,X=void 0,Q=void 0,J=void 0;function $(e){var t=e.time;if(P&&P.getBuffer()&&J.length){var r=P.getBuffer().buffered;if(r&&r.length>=1&&r.end(r.length-1)-t<=.5){var n=J.shift();n&&(z.switchByModifyTrackId(n),oe(n))}}}function ee(){if(z.setSwitchingState(!0),k){var e=d.getTime();k.end-e>2&&(!z.shouldSwitchTrack()&&k.trackSwitchInfo?z.revertDefaultTrack(k):(k.trackSwitchInfo&&z.revertDefaultTrack(k),z.switchByModifyTrackId(k)),oe(k,!0))}}function te(){var e=d.getTime(),t=fe();0===t.length&&ve().length>0&&(t=[{start:ve().start(0)}]),t.length<=0||(t[t.length-1].end=e-1,t.forEach((function(e){e.force=!0})),Te(t))}function re(e){if(!F||!e||!h)return null;if(w)try{"function"==typeof(P=I(t).create(w,e,se.bind(this))).getBuffer().initialize&&P.getBuffer().initialize(f,h),r.trigger(m.BUFFER_CREATED,{mediaType:e.type})}catch(e){g("Caught error on create SourceBuffer: "+e),a.mediaSourceError("Error creating "+f+" source buffer.")}else P=O(t).create(se.bind(this));var n=h.getRepresentationInfoForQuality(b).MSETimeOffset||Y;h.getRepresentationInfoForQuality(b)&&Ie(n)}function ne(e){e.fragmentModel===h.getFragmentModel()&&(g("Init fragment finished loading saving to",f+"'s init cache"),F.save(e.chunk),g("Append Init fragment",f," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality),P?P.setAppendWindowEnd(o.getCachedDurationOffset("duration")):q=function(){var e=o.getCachedDurationOffset("duration");P.setAppendWindowEnd(e)},oe(e.chunk))}function ie(e){if(e.fragmentModel===h.getFragmentModel()){var i=e.chunk,a=i.bytes,s=i.quality,u=h.getRepresentationInfoForQuality(s),c=l.getEventsFor(u.mediaInfo,h),p=l.getEventsFor(u,h),v=o.getEnableMultipleAudioTracks();if(c&&c.length>0||p&&p.length>0){var b=function(e,r,n,i){for(var o=Math.max(!r||isNaN(r.startTime)?0:r.startTime,0),a=[],s=[],u=n.concat(i),c=0,d=u.length;c0&&d.getTimeToStreamEnd()>ke&&(g("Clearing buffer because track changed - "+(_.end(_.length-1)+.5)),Te([{start:0,end:_.end(_.length-1)+.5,force:!0}]))}else f===n.AUDIO&&i.mediaInfo.type===n.AUDIO&&v?function(e){var t;if(t=d.getTime(),0===e.index||e.start<=t&&t<=e.end)g("【Multi Audio】append multi audio chunk: "+e.index+"-"+e.start+"-"+e.end),z.switchByModifyTrackId(e),oe(e);else{var n={sender:y,index:e.index},i=J.findIndex((function(t){return t.index===e.index}));if(-1!==i)return g("【Multi Audio】multi audio identical chunk emerged, replacing it: "+e.index),void(J[i]=e);J.push(e),e.fromMulti=!0,r.trigger(m.MULTI_AUDIO_TRACK_APPEND,n)}}(i):oe(i)}}function oe(e,t){!L||t?(L=!0,k=e,e.startOffsetTime=u.getStartOffsetTimeForType(e.mediaInfo.type),P?P.append(e):Z.push(e),e.mediaInfo.type===n.VIDEO&&r.trigger(m.VIDEO_CHUNK_RECEIVED,{chunk:e})):W.push(e)}function ae(e){if(e.mediaType===f&&(q&&(q(),q=null),Z.length))for(var t=Date.now(),n=e.mediaType,i=c.getInitializeDate(),a=0;a0)){var t=Math.max(.2*A,1),n=A-t;o.setBufferToKeep(parseFloat(t).toFixed(5)),o.setBufferAheadToKeep(parseFloat(n).toFixed(5))}22!==e.error.code&&He()||(g("Clearing playback buffer to overcome quota exceed situation for type: "+f),r.trigger(m.QUOTA_EXCEEDED,{sender:y,criticalBufferLevel:A,mediaType:f}),de(),L=!1)}else{(k=e.chunk)&&!isNaN(k.index)&&(T=Math.max(k.index,T),Ee(),Q=k.isSupplyChunk?k.start+"-"+k.end:"");var i=ve();if(k.segmentType===G.MEDIA_SEGMENT_TYPE)pe();else if(j){var a=d.getTime();g("[BufferController][",f,"] appendToBuffer seek target should be "+a),h.getScheduleController().setSeekTarget(a),l.setIndexHandlerTime(h,a)}var s={sender:y,quality:k.quality,startTime:k.start,index:k.index,fromMulti:k.fromMulti,bufferedRanges:i};k&&!k.endFragment?r.trigger(m.BYTES_APPENDED,s):k&&r.trigger(m.BYTES_APPENDED_END_FRAGMENT,s),0===W.length?L=!1:oe(W.shift(),!0)}}function le(e){b!==e.newQuality&&f===e.mediaType&&h.getStreamInfo().id===e.streamInfo.id&&(Ie(h.getRepresentationInfoForQuality(e.newQuality).MSETimeOffset),b=e.newQuality)}function ce(){if(E&&(B=!0,E=!1,C=Number.POSITIVE_INFINITY),W=[],L=!1,f!==n.FRAGMENTED_TEXT){var e=ve(),t=o.getEnableMultipleAudioTracks(),r=!0;if(e&&e.length>0){var i=d.getTime();if(Q){var a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(Q.split("-"),2),s=a[0];if(a[1],i=e.start(l)&&i<=e.end(l)-1&&(r=!1)}r?(f===n.AUDIO&&t&&function(e){if(J.length>0){var t=J.findIndex((function(t){return t.start<=e&&t.end>e}));if(-1!==t){var r=J[t],n=J.slice(t+1);J=n,r&&(g("【Multi Audio】find multi audio chunk in buffer list after seeking: "+r.index),z.switchByModifyTrackId(r),oe(r))}else J.length=0}}(d.getTime()),h.getFragmentModel().clearExecutedRequestBySeeking(),de()):pe()}else pe();U=void 0}function de(){var e=fe();e&&0!==e.length||pe(),Te(e)}function fe(){var e=[],t=ve();if(!t||0===t.length)return e;var r=d.getTime(),n=t.end(t.length-1)+.5,i=h.getFragmentModel().getRequests({state:R.FRAGMENT_MODEL_EXECUTED,time:r,threshold:Ne})[0];if(i){var o={start:0,end:i.startTime-ke},a=h.getFragmentModel().getRequests({state:R.FRAGMENT_MODEL_EXECUTED,time:i.startTime-i.duration/2,threshold:Ne})[0];a&&a.startTime!=i.startTime&&(o.end=a.startTime),o.startt.start(0)&&e.push(o);var s={start:i.startTime+i.duration+ke,end:n },u=h.getFragmentModel().getRequests({state:R.FRAGMENT_MODEL_EXECUTED,time:i.startTime+i.duration+ke,threshold:Ne})[0];u&&u.startTime!==i.startTime&&(s.start=u.startTime+u.duration+ke),s.start=n&&et&&n.push({start:t,end:r}),t=e.start(i),r=e.end(i));return r>t&&n.push({start:t,end:r}),{length:n.length,start:function(e){return n[e].start},end:function(e){return n[e].end}}}function be(){var e,t;d&&(e=function(){var e=d.getTime();if(U){var t=ve();t&&t.length&&(e=Math.max(t.start(0),U))}return e}()||0,S=null===(t=ge(e,void 0))?0:t.end-e,r.trigger(m.BUFFER_LEVEL_UPDATED,{sender:y,bufferLevel:S}),Se())}function _e(){h&&s&&h.getStreamInfo().id===s.getActiveStreamInfo().id&&(i.addBufferState(f,x,h.getScheduleController().getBufferTarget()),i.addBufferLevel(f,new Date,1e3*S))}function Ee(){T>=C-1&&!E&&void 0===P.discharge&&(E=!0,g("[BufferController]["+f+"] checkIfBufferingCompleted trigger BUFFERING_COMPLETED"),r.trigger(m.BUFFERING_COMPLETED,{sender:y,streamInfo:h.getStreamInfo()}))}function Se(){if("audio"===f||"video"===f){var e=d.getTimeToStreamEnd()-S;if(B&&!E&&d&&e<.5)if(d.getTimeToStreamEnd()>.5){for(var t=l.getIndexHandlerTime(h),n=h.getIndexHandler(),i=h.getCurrentRepresentationInfo(),a=n.getIndex(),s=l.getFragmentRequestForTime(h,i,t,{keepIdx:!1});s&&s.action!==v.ACTION_COMPLETE&&h.getFragmentModel().isFragmentLoaded(s);)s=l.getNextFragmentRequest(h,i);n.setIndex(a),s&&s.action===v.ACTION_COMPLETE?(E=!0,B=!1,g("[BufferController]["+f+"] checkIfSufficientBuffer trigger BUFFERING_COMPLETED"),r.trigger(m.BUFFERING_COMPLETED,{sender:y,streamInfo:h.getStreamInfo()})):E=!1}else g("[BufferController]["+f+"] handle the fragment which duration may be less than 0.5s");S=o.getStableBufferTime())&&Ae(Oe)}}function Ae(e){x===e||e===xe&&0===d.getTime()||(x=e,_e(),r.trigger(m.BUFFER_LEVEL_STATE_CHANGED,{sender:y,state:e,mediaType:f,streamInfo:h.getStreamInfo()}),r.trigger(e===Oe?m.BUFFER_LOADED:m.BUFFER_EMPTY,{mediaType:f}),g(e===Oe?"Got enough buffer to start for "+f:"Waiting for more buffer before starting playback for "+f))}function Te(e){e&&P&&0!==e.length&&(V.push.apply(V,e),M||Ce())}function Ce(){if(0===V.length||!P)return g("Nothing to prune, halt pruning"),V=[],void(M=!1);var e=P.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return g("SourceBuffer is empty (or does not exist), halt pruning"),V=[],void(M=!1);var t=V.shift();g("Removing",f,"buffer from:",t.start,"to",t.end),M=!0;var r=d.getTime();r=n&&(t.force=!0),P.remove(t.start,t.end,t.force)}function Pe(e){P===e.buffer&&(g("[BufferController][",f,"] onRemoved buffer from:",e.from,"to",e.to),0===V.length&&(M=!1),e.unintended&&(g("[BufferController][",f,"] detected unintended removal from:",e.from,"to",e.to,"setting index handler time to",e.from),l.setIndexHandlerTime(h,e.from)),M?Ce():(j?(j=!1,H&&oe(H)):(g("onRemoved : call updateBufferLevel"),be()),r.trigger(m.BUFFER_CLEARED,{sender:y,from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:He()})))}function Ie(e){0!==e&&(P&&P.updateTimestampOffset?P.updateTimestampOffset(e):Y=e)}function Me(e){if(e.sender.getStreamProcessor()===h&&!e.error){var t=0;try{t=e.currentRepresentation.segmentAvailabilityRange.start}catch(e){}Ie(t)}}function Fe(e){e.fragmentModel===h.getFragmentModel()&&(C=e.request.index,Ee())}function Ue(e){var t=P&&ve();t&&e.newMediaInfo.type===f&&e.newMediaInfo.streamInfo.id===h.getStreamInfo().id&&(g("[BufferController]["+f+"] track change asked"),u.getSwitchMode(f)===me.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&t&&t.length>0&&d.getTimeToStreamEnd()>ke&&(E=!1,C=Number.POSITIVE_INFINITY))}function Be(){++N*(o.getWallclockTimeUpdateInterval()/1e3)>=o.getBufferPruningInterval()&&(N=0,P&&f!==n.FRAGMENTED_TEXT&&(E||Te(function(){var e=[],t=ve();if(!t||0===t.length)return e;var r=d.getTime(),n={start:Math.max(0,r-o.getBufferToKeep()),end:r+o.getBufferAheadToKeep()},i=h.getFragmentModel().getRequests({state:R.FRAGMENT_MODEL_EXECUTED,time:r,threshold:Ne})[0];if(i)n.start=Math.min(i.startTime,n.start),n.end=Math.max(i.startTime+i.duration,n.end);else if(0===r&&d.getIsDynamic())return[];if(t.start(0)<=n.start){for(var a={start:0,end:n.start},s=0;s=n.end){var u={start:n.end,end:t.end(t.length-1)+Ne};u.start0){for(var t="Beginning "+f+"PreBuffer discharge, adding buffer for:",r=0;r0){var n=t.length,i=J[J.length-1].end;t.length>0?t[n-1].end=i:t.push({start:J[0].start,end:i})}return t},getBufferRanges:ve},g=_(t).getInstance().log.bind(y),F=Re(t).getInstance(),W=[],Z=[],Y=0,Q="",f===n.AUDIO&&o.getEnableMultipleAudioTracks()&&(g("【Multi Audio】enable multiple audio tracks and init audio track controller"),(z=De(t).create({bufferController:y,mediaPlayerModel:o,playbackController:d})).initialize(),X=setInterval((function(){$({time:d.getTime()})}),50)),Ze(),y}Me.__dashjs_factory_name=Le;var Fe=s.a.getClassFactory(Me);Fe.BUFFER_LOADED=Oe,Fe.BUFFER_EMPTY=xe,s.a.updateClassFactory(Me.__dashjs_factory_name,Fe);var Ue=Fe,Be=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function Ge(){var e=void 0;return{initialize:function(t){if(e=new Be,!t)return null;var r=t.indexOf("#");if(-1!==r)for(var n=t.substr(r+1).split("&"),i=0,o=n.length;i=0&&b&&nf||n<(isNaN(t)?NaN:t-b.manifestInfo.DVRWindowSize))&&(n=null),n=n||f;else if(!isNaN(r)&&r=0)n=r;else{var o=y[b.id];n=void 0!==o?Math.max(void 0!==o.audio?o.audio:0,void 0!==o.video?o.video:0,b.start):b.start}return n}function G(){null===h&&(h=setInterval((function(){var e;i.trigger(m.WALLCLOCK_TIME_UPDATED,{isDynamic:E,time:new Date}),M()&&I()&&(e=Date.now(),(!w||e>w+500)&&(w=e,Q()))}),S.getWallclockTimeUpdateInterval()))}function V(){clearInterval(h),h=null}function W(){if(!I()&&E&&0!==d.getReadyState()){var e=k(),t=function(e){var t=a.getReadOnlyMetricsFor(n.VIDEO)||a.getReadOnlyMetricsFor(n.AUDIO),r=s.getCurrentDVRInfo(t),i=r?r.range:null,o=void 0;if(!i)return NaN;if(e>i.end)o=Math.max(i.end-2*b.manifestInfo.minBufferTime,i.start);else{if(!(e+.25t?y[b.id].video:t,i=v[b.id].audio):(n=y[b.id].audio>t?y[b.id].audio:t,i=v[b.id].video),function(e,t){if(t&&t.length>0)for(var r=0,n=t.length;r=t.start(r)&&el&&(x(n+.2),r("Playback controller seek hack",n+.2)),y[b.id].started=!0}}else y[b.id][a]&&(n=y[b.id][a]>t?y[b.id][a]:t,O()||x(n),y[b.id].started=!0)}}function ie(e){e.streamInfo.id===b.id&&d.setStallState(e.mediaType,e.state===Ue.BUFFER_EMPTY)}function oe(e){r("Native video element event: stalled",e),i.trigger(m.PLAYBACK_STALLED,{e:e})}return e={initialize:function(e){b=e,d.addEventListener("canplay",H),d.addEventListener("play",Z),d.addEventListener("waiting",Y),d.addEventListener("playing",K),d.addEventListener("pause",q),d.addEventListener("error",re),d.addEventListener("seeking",z),d.addEventListener("seeked",X),d.addEventListener("timeupdate",Q),d.addEventListener("progress",J), d.addEventListener("ratechange",$),d.addEventListener("loadedmetadata",ee),d.addEventListener("ended",te),d.addEventListener("stalled",oe),E=b.manifestInfo.isDynamic,f=b.start,i.on(m.DATA_UPDATE_COMPLETED,j,this),i.on(m.BYTES_APPENDED_END_FRAGMENT,ne,this),i.on(m.BUFFER_LEVEL_STATE_CHANGED,ie,this),i.on(m.PERIOD_SWITCH_STARTED,R,this),A&&(A=!1,P())},setConfig:function(e){e&&(e.streamController&&(o=e.streamController),e.metricsModel&&(a=e.metricsModel),e.dashMetrics&&(s=e.dashMetrics),e.manifestModel&&(u=e.manifestModel),e.dashManifestModel&&(l=e.dashManifestModel),e.mediaPlayerModel&&(S=e.mediaPlayerModel),e.adapter&&(c=e.adapter),e.videoModel&&(d=e.videoModel))},getStartTimeFromUriParameters:U,getStreamStartTime:B,getTimeToStreamEnd:C,getTime:k,getPlaybackRate:N,getPlayedRanges:function(){return b&&d?d.getPlayedRanges():null},getEnded:L,getIsDynamic:M,getStreamController:function(){return o},setLiveStartTime:function(e){f=e},getLiveStartTime:function(){return f},computeLiveDelay:function(e,t){var r,i=l.getMpd(u.getValue()),o=void 0;if(r=S.getUseSuggestedPresentationDelay()&&i.hasOwnProperty(n.SUGGESTED_PRESENTATION_DELAY)?i.suggestedPresentationDelay:S.getLowLatencyEnabled()?0:S.getLiveDelay()?S.getLiveDelay():isNaN(e)?2*b.manifestInfo.minBufferTime:e*S.getLiveDelayFragmentCount(),i.availabilityStartTime&&(T=i.availabilityStartTime.getTime()),t>0){var a=Math.max(t-10,t/2);o=Math.min(r,a)}else o=r;return g=o,o},getLiveDelay:function(){return g},getCurrentLiveLatency:function(){if(!E||isNaN(T))return NaN;var e=k();return isNaN(e)||0===e?0:(Math.round((new Date).getTime()-(1e3*e+T))/1e3).toFixed(3)},play:P,isPaused:I,pause:D,isSeeking:O,seek:x,getDuration:function(){return d.getElement().duration},reset:F},F(),e}We.__dashjs_factory_name="PlaybackController";var je=s.a.getSingletonFactory(We);function He(e){var t=(e=e||{}).timelineConverter,r=e.streamProcessor;return{getLiveEdge:function(){!function(){if(!(t&&t.hasOwnProperty("getExpectedLiveEdge")&&r&&r.hasOwnProperty("getCurrentRepresentationInfo")))throw new Error("Missing config parameter(s)")}();var e=r.getCurrentRepresentationInfo(),n=e.DVRWindow.end;return e.useCalculatedLiveEdgeTime&&(n=t.getExpectedLiveEdge(),t.setClientTimeOffset(n-e.DVRWindow.end)),n},reset:function(){t=null,r=null}}}He.__dashjs_factory_name="LiveEdgeFinder";var Ze=s.a.getClassFactory(He);function Ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ke=function e(){Ye(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};Ke.INITIAL_PLAYOUT_START_REASON="initial_playout",Ke.SEEK_START_REASON="seek",Ke.RESUME_FROM_PAUSE_START_REASON="resume",Ke.METRICS_COLLECTION_START_REASON="metrics_collection_start";var qe=function e(){Ye(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};function ze(e){e=e||{};var t=!1,r=this.context,i=p(r).getInstance(),o=e.dashMetrics,a=e.metricsModel,s=e.mediaPlayerModel,u=e.abrController;function l(e,r,i){var l=NaN,c=e.getCurrentRepresentationInfo();if(r===n.FRAGMENTED_TEXT);else if(r===n.AUDIO&&i){var d=o.getCurrentBufferLevel(a.getReadOnlyMetricsFor(n.VIDEO));l=isNaN(c.fragmentDuration)?d:Math.max(d,c.fragmentDuration),t&&(l=Math.min(l,s.getStableBufferTime()))}else{var f=c.mediaInfo.streamInfo;l=u.isPlayingAtTopQuality(f)&&!t?f.manifestInfo.duration>=s.getLongFormContentDurationThreshold()?s.getBufferTimeAtTopQualityLongForm():s.getBufferTimeAtTopQuality():s.getStableBufferTime()}return l}function c(){t=!0}var d={execute:function(e,t,r,n){return(n&&n+o.getCurrentBufferLevel(a.getReadOnlyMetricsFor(t))||o.getCurrentBufferLevel(a.getReadOnlyMetricsFor(t)))=e&&i!==ue.ABANDON_LOAD?(ee(t),b("Reloading outdated fragment at index: ",t.index)):t.quality>S.quality&&(b("The buffer has better quality it in then what we would request so set append point to end of buffer!!"),Ee(f.getTime()+g.getBufferLevel()))}}();var t=B.length>0,r=g.getStreamInfo();V||isNaN(U)||G||t||K(S.mediaInfo.type,r.id)||k.execute(g,y,h.isVideoTrackPresent(),e.getStoreBufferLevel())?(Q(!0),t||G||d.checkPlaybackQuality(y),function(){i.trigger(m.GET_NEXT_FRAGMENT,{mediaType:y,currentTime:g.getPlaybackController().getTime(),bufferLevel:g.getBufferLevel(),bufferResetInProgress:V,lastInitQuality:isNaN(U),switchTrack:G,isReplacement:t,hasTopQualityChanged:K(S.mediaInfo.type,r.id),bufferLevelRule:k.execute(g,y,h.isVideoTrackPresent(),e.getStoreBufferLevel()),final:V||isNaN(U)||G||t||K(S.mediaInfo.type,r.id)||k.execute(g,y,h.isVideoTrackPresent(),e.getStoreBufferLevel())});var n=g.getFragmentController();if(S.quality!==U)b("ScheduleController - "+y+" - quality has changed at "+f.getTime()+", get init request for representationid = "+S.id),U=S.quality,g.switchInitData(S.id);else if(G)b("ScheduleController - "+y+" - switch track has been asked, get init request for "+y+" with representationid = "+S.id), V=v.getSwitchMode(y)===me.TRACK_SWITCH_MODE_ALWAYS_REPLACE,g.switchInitData(S.id,V),U=S.quality,G=!1;else{var o=B.shift();if(n.isInitializationRequest(o))g.switchInitData(o.representationId);else{var a=void 0;g.getBufferController().getIsPruningInProgress()||!(a=N.execute(g,o))&&r.manifestInfo&&r.manifestInfo.isDynamic&&b("getNextFragment - "+y+" - Playing at the bleeding live edge and frag is not available yet"),a?(b("ScheduleController - "+y+" - getNextFragment - request is "+a.url),"video"===y&&d.getAutoSwitchBitrateFor(y)&&Object.keys(H).forEach((function(e){-1!==H[e]&&(a.isSwitchingQn=!0)})),E.executeRequest(a)):(Q(!1),z(300))}}}()):z(300)}}function z(e){clearTimeout(O),O=setTimeout(q,e)}function X(e){e.sender&&e.sender.getStreamProcessor()===g&&J(S.quality)}function Q(e){I!==e?I=e:b("[ScheduleController][",y,"] isFragmentProcessingInProgress is already equal to",e)}function J(e){var t=a.getInitRequest(g,e);t&&(t.mediaType&&d.setCurrentSegmentInfoFor(t.mediaType,{index:t.index,startTime:t.startTime,duration:t.duration,url:t.url}),Q(!0),E.executeRequest(t))}function $(){G=!0}function ee(e){B.push(e)}function te(e){if(y===e.mediaType&&g.getStreamInfo().id===e.streamInfo.id){if(null==(S=g.getRepresentationInfoForQuality(e.newQuality)))throw new Error("Unexpected error! - currentRepresentationInfo is null or undefined");H[y]=e.newQuality,Ae(new Date,qe.REPRESENTATION_SWITCH_STOP_REASON),we(),f.isPaused()&&(j={type:y,oldQuality:e.oldQuality})}}function re(e){if(f&&E){var t=E.getRequests({state:R.FRAGMENT_MODEL_EXECUTED,time:f.getTime(),threshold:0})[0];t&&f.getTime()>=t.startTime&&((!M.mediaInfo||t.mediaInfo.type===M.mediaInfo.type&&t.mediaInfo.id!==M.mediaInfo.id)&&e&&i.trigger(m.TRACK_CHANGE_RENDERED,{mediaType:y,oldMediaInfo:M.mediaInfo,newMediaInfo:t.mediaInfo}),t.quality===M.quality&&t.adaptationIndex===M.adaptationIndex||!e||H[y]===t.quality&&(i.trigger(m.QUALITY_CHANGE_RENDERED,{mediaType:y,oldQuality:M.quality,newQuality:t.quality}),H[y]=-1,j=null),M={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function ne(e){e.error||e.sender.getStreamProcessor()!==g||(S=a.convertDataToRepresentationInfo(e.currentRepresentation),c.getAppendingSourceState()&&$())}function ie(e){e.error||g.getStreamInfo().id!==e.streamInfo.id||(S=g.getCurrentRepresentationInfo(),A&&(f.getIsDynamic()?(l.setTimeSyncCompleted(!0),function(){var e=g.getLiveEdgeFinder();if(e){var t=e.getLiveEdge(),r=S.mediaInfo.streamInfo.manifestInfo.DVRWindowSize/2,i=t-f.computeLiveDelay(S.fragmentDuration,r),u=a.getFragmentRequestForTime(g,S,i,{ignoreIsFinished:!0});if(c.getLowLatencyEnabled()){var d=u.durationS.mediaInfo.streamInfo.start+S.mediaInfo.streamInfo.duration&&f.seek(x);var p=s.getCurrentManifestUpdate(o.getMetricsFor(n.STREAM));o.updateManifestUpdateInfo(p,{currentTime:x,presentationStartTime:t,latency:t-x,clientTimeOffset:l.getClientTimeOffset()})}}()):(x=f.getStreamStartTime(!1),g.getBufferController().setSeekStartTime(x))),w&&Z())}function oe(e){e.fragmentModel===E&&(Y(),Q(!1),b("[ScheduleController] Stream is complete"),c.getAppendingSourceState()&&Z())}function ae(e){e.sender===E&&(b("[ScheduleController][",y,"] - onFragmentLoadingCompleted"),u.getIsTextTrack(y)&&Q(!1),e.error&&e.request.serviceLocation&&!w&&Q(!1),V&&(W=e.request),f.isPaused()&&j&&e.request.quality===H[y]&&(i.trigger(m.QUALITY_CHANGE_RENDERED,{mediaType:y,oldQuality:M.quality||j.oldQuality,newQuality:e.request.quality}),H[y]=-1,j=null))}function se(){re(!0)}function le(e){e.sender.getStreamProcessor()!==g||e.fromMulti||(V&&!isNaN(e.startTime)&&(V=!1,E.addExecutedRequest(W)),Q(!1),z(0))}function ce(e){e.streamProcessor===g&&(b("[ScheduleController][onFragmentLoadingAbandoned] for "+y+", request: "+e.request.url+" has been aborted"),f.isSeeking()||G||(b("[ScheduleController][onFragmentLoadingAbandoned] for "+y+", request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),ee(e.request)),Q(!1),z(0))}function de(e){e.sender.getStreamProcessor()===g&&Y()}function fe(e){e.sender.getStreamProcessor()===g&&(e.unintended?g.getFragmentModel().removeExecutedRequestsAfterTime(e.from,g.getStreamInfo().duration):y===n.AUDIO&&c.getEnableMultipleAudioTracks()?g.getFragmentModel().syncExecutedRequestsWithMultipleLevels(g.getBufferController().getMultiBufferRanges(),g.getStreamInfo().duration):g.getFragmentModel().syncExecutedRequestsWithBufferedRange(g.getBufferController().getBuffer().getAllBufferRanges(),g.getStreamInfo().duration),e.hasEnoughSpaceToAppend&&w&&Z())}function pe(e){e.sender.getStreamProcessor()!==g||e.state!==Ue.BUFFER_EMPTY||f.isSeeking()||(b("[ScheduleController][",y,"] - Buffer is empty! Stalling!"),Ae(new Date,qe.REBUFFERING_REASON))}function he(e){e.sender.getStreamProcessor()===g&&(Y(),Q(!1))}function ye(){E.abortRequests(),Y()}function ge(e){e.sender.getStreamProcessor()===g&&J(e.index)}function ve(){!w&&L||Z()}function be(e){x=e.seekTime,Se(0),w&&Z();var t=s.getCurrentManifestUpdate(o.getMetricsFor(n.STREAM)),r=S.DVRWindow&&f?S.DVRWindow.end-f.getTime():NaN;o.updateManifestUpdateInfo(t,{latency:r}),I?function(){var e=x,t=E.getLoadingRequests(),r=g.getBufferController().getBufferRanges(),n=!1;if(!e||t.length>1||0===t.length)return!0;var i=t[0];if(i&&(isNaN(i.index)||isNaN(i.startTime)&&isNaN(i.duration)))return!0;for(var o=0;o=a-.5&&e<=s+.5){n=!0;break}}if(n){if(i.startTime>e)return b("[ScheduleController][onPlaybackSeeking] seekTime is inside the range and less then the startTime of loadingRequest",e,i),!1}else if(e>=i.startTime&&e=0&&(a.setIndexHandlerTime(g,x),g.switchInitData(S.id)),Q(!1),z(30)):b("[ScheduleController][onPlaybackSeeking] process the next schedule"):z(0)}function _e(e){C&&(C.playbackspeed=e.playbackRate.toString())}function Ee(e){x=e}function Se(e){D=e}function Ae(e,t){if(T&&!1===P){var r=C.start,n=e.getTime()-r.getTime();C.duration=n,C.stopreason=t,T.trace.push(C),P=!0}}function we(){T&&!0===P&&S&&(P=!1,(C=new qe).representationid=S.id,C.start=new Date,C.mstart=1e3*f.getTime(),C.playbackspeed=f.getPlaybackRate().toString())}function Te(){U=NaN}function Re(){I=!1,D=0,x=NaN,T=null,C=null,P=!0,A=!0,U=NaN,M={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},F={},B=[],w=!0,G=!1,V=!1,W=null}return t={initialize:function(){E=g.getFragmentModel(),L=c.getScheduleWhilePaused(),k=Xe(r).create({abrController:d,dashMetrics:s,metricsModel:o,mediaPlayerModel:c}),N=Je(r).create({adapter:a}),u.getIsTextTrack(y)&&i.on(m.TIMED_TEXT_REQUESTED,ge,this),i.on(m.QUALITY_CHANGE_REQUESTED,te,this),i.on(m.DATA_UPDATE_STARTED,de,this),i.on(m.DATA_UPDATE_COMPLETED,ne,this),i.on(m.FRAGMENT_LOADING_COMPLETED,ae,this),i.on(m.STREAM_COMPLETED,oe,this),i.on(m.STREAM_INITIALIZED,ie,this),i.on(m.BUFFER_LEVEL_STATE_CHANGED,pe,this),i.on(m.BUFFER_CLEARED,fe,this),i.on(m.BYTES_APPENDED_END_FRAGMENT,le,this),i.on(m.INIT_REQUESTED,X,this),i.on(m.QUOTA_EXCEEDED,he,this),i.on(m.PLAYBACK_SEEKING,be,this),i.on(m.PLAYBACK_STARTED,ve,this),i.on(m.PLAYBACK_RATE_CHANGED,_e,this),i.on(m.PLAYBACK_TIME_UPDATED,se,this),i.on(m.URL_RESOLUTION_FAILED,ye,this),i.on(m.FRAGMENT_LOADING_ABANDONED,ce,this),i.on(m.MANIFEST_UPDATED,Te,this),y===n.AUDIO&&c.getEnableMultipleAudioTracks()&&i.on(m.MULTI_AUDIO_TRACK_APPEND,le,this)},getType:function(){return y},getSeekTarget:function(){return x},setSeekTarget:Ee,setTimeToLoadDelay:Se,getTimeToLoadDelay:function(){return D},replaceRequest:ee,switchTrackAsked:$,isStarted:function(){return!1===w},start:Z,stop:Y,reset:function(){i.off(m.DATA_UPDATE_STARTED,de,this),i.off(m.DATA_UPDATE_COMPLETED,ne,this),i.off(m.BUFFER_LEVEL_STATE_CHANGED,pe,this),i.off(m.QUALITY_CHANGE_REQUESTED,te,this), i.off(m.FRAGMENT_LOADING_COMPLETED,ae,this),i.off(m.STREAM_COMPLETED,oe,this),i.off(m.STREAM_INITIALIZED,ie,this),i.off(m.QUOTA_EXCEEDED,he,this),i.off(m.BYTES_APPENDED_END_FRAGMENT,le,this),i.off(m.BUFFER_CLEARED,fe,this),i.off(m.INIT_REQUESTED,X,this),i.off(m.PLAYBACK_RATE_CHANGED,_e,this),i.off(m.PLAYBACK_SEEKING,be,this),i.off(m.PLAYBACK_STARTED,ve,this),i.off(m.PLAYBACK_TIME_UPDATED,se,this),i.off(m.URL_RESOLUTION_FAILED,ye,this),i.off(m.FRAGMENT_LOADING_ABANDONED,ce,this),i.off(m.MANIFEST_UPDATED,Te,this),u.getIsTextTrack(y)&&i.off(m.TIMED_TEXT_REQUESTED,ge,this),Y(),re(!1),Re()},setPlayList:function(e){T=e},getBufferTarget:function(){return k.getBufferTarget(g,y,h.isVideoTrackPresent())},finalisePlayList:function(e,t){Ae(e,t),T=null}},b=_(r).getInstance().log.bind(t),Re(),t}$e.__dashjs_factory_name="ScheduleController";var et=s.a.getClassFactory($e),tt=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}return e.prototype.init=function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.INTERACTIVE="interactive",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight"},e}()),rt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}return e.hasInitialization=function(e){return null!==e.initialization||null!==e.range},e.hasSegments=function(e){return e.segmentInfoType!==tt.BASE_URL&&e.segmentInfoType!==tt.SEGMENT_BASE&&!e.indexRange},e}();function nt(){var e=this.context,t=p(e).getInstance(),r=void 0,i=void 0,o=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,h=void 0,y=void 0,g=void 0,v=void 0,b=void 0,_=void 0,E=[];function S(){return a}function A(){return u}function w(){i=null,o=-1,a=!0,s=[],l=null,d=null,f=null,h=null,y=null,g=null,v=null}function T(){var e=new Date,t=A(),r=1e3*d.getTime();f.addRepresentationSwitch(t.adaptation.type,e,r,t.id)}function R(){var e=b.getStreamInfo(),t=e?e.manifestInfo:null,r=t?t.isDynamic:null,n=y.calcSegmentAvailabilityRange(u,r);f.addDVRInfo(b.getType(),d.getTime(),t,n)}function P(e){return s[e]}function I(e){return s.indexOf(e)}function D(e){var n=e;a=!1,t.trigger(m.AST_IN_FUTURE,{delay:n}),setTimeout((function(){if(!S()){a=!0,t.trigger(m.DATA_UPDATE_STARTED,{sender:r}),s.forEach((function(e){e.segmentAvailabilityRange=null}));for(var e=0;e0)return R(),D(g),E=new C(1,"Segments update failed",null),void t.trigger(m.DATA_UPDATE_COMPLETED,{sender:this,data:i,currentRepresentation:u,error:E});if(h){for(var P=0;Pn&&(t=n);for(var o=t;o<1;o++){var a=s[o].segmentInfoType;if(null===s[o].segmentAvailabilityRange||!rt.hasInitialization(s[o])||(a===tt.SEGMENT_BASE||a===tt.BASE_URL)&&!s[o].segments)return!1}return!0})(c)&&(a=!1,l.setPlaybackQuality(b.getType(),b.getStreamInfo(),I(u)),f.updateManifestUpdateInfo(h,{latency:u.segmentAvailabilityRange.end-d.getTime()}),v.getCurrentRepresentationSwitch(p)||T(),t.trigger(m.DATA_UPDATE_COMPLETED,{sender:this,data:i,currentRepresentation:u}))}}function x(e){e.isDynamic&&function(e){for(var t=void 0,r=0,n=s.length;rp&&(y=p),u=P(y),i=e,d!==n.VIDEO&&d!==n.AUDIO&&d!==n.FRAGMENTED_TEXT)return a=!1,void t.trigger(m.DATA_UPDATE_COMPLETED,{sender:this,data:i,currentRepresentation:u});(E=[])[y]=!0,c.updateRepresentation(s[y],!0)},getStreamProcessor:function(){return b},getCurrentRepresentation:A,getRepresentationForQuality:P,getQualityForRepresentationId:function(e){return I(s.find((function(t){return t.id===e})))},reset:function(){t.off(m.QUALITY_CHANGE_REQUESTED,N,r),t.off(m.REPRESENTATION_UPDATED,O,r),t.off(m.WALLCLOCK_TIME_UPDATED,x,r),t.off(m.BUFFER_LEVEL_UPDATED,k,r),t.off(m.MANIFEST_VALIDITY_CHANGED,L,r),w(),E=[]}},w(),t.on(m.QUALITY_CHANGE_REQUESTED,N,r),t.on(m.REPRESENTATION_UPDATED,O,r),t.on(m.WALLCLOCK_TIME_UPDATED,x,r),t.on(m.BUFFER_LEVEL_UPDATED,k,r),t.on(m.MANIFEST_VALIDITY_CHANGED,L,r),r}nt.__dashjs_factory_name="RepresentationController";var it=s.a.getClassFactory(nt);function ot(){var e=void 0,t=/^[a-z][a-z0-9+\-.]*:/i,r=/^https?:\/\//i,n=/^https:\/\//i,i=/^([a-z][a-z0-9+\-.]*:\/\/[^\/]+)\/?/i,o=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},a=function(e,t){var r=s;if(!t)return e;if(!c(e))return e;d(e)&&(r=u),f(e)&&(r=l);var n=r(t),i="/"!==n.charAt(n.length-1)&&"/"!==e.charAt(0)?"/":"";return[n,e].join(i)};function s(e){var t=e.indexOf("/"),r=e.lastIndexOf("/");return-1!==t?r===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,r+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var r=e.match(t);return r?r[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=o}catch(e){}finally{e=e||a}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return r.test(e)},isHTTPS:function(e){return n.test(e)},resolve:function(t,r){return e(t,r)}}}ot.__dashjs_factory_name="URLUtils";var at=s.a.getSingletonFactory(ot),st=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null};function ut(e,t){for(;e.lengthn&&o0?(h=pt(i,r))?e.calcPeriodRelativeTimeFromMpdRelativeTime(r,h.presentationStartTime):i>0?i*a:e.calcPeriodRelativeTimeFromMpdRelativeTime(r,n):i>0?i*a:t?l.end:l.start,{start:y=Math.floor(Math.max(p-d,l.start)/a),end:Math.floor(Math.min(y+f/a,l.end/a))})}function yt(e,t){var r=(e=e||{}).timelineConverter;return{getSegments:function(e,n,i,o){if(function(){if(!(r&&r.hasOwnProperty("calcMediaTimeFromPresentationTime")&&r.hasOwnProperty("calcSegmentAvailabilityRange")&&r.hasOwnProperty("calcMediaTimeFromPresentationTime")))throw new Error("Missing config parameter(s)")}(),!e)throw new Error("no representation");void 0===n&&(n=null);var a,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,u=s.SegmentTimeline,l=s.SegmentURL_asArray,c=e.availableSegmentsNumber>0;a=o||(i>-1||null!==n?10:1/0);var d,f,p,h=0,y=0,m=-1,g=[],v=null,b=void 0,_=void 0,E=void 0,S=void 0,A=void 0,w=void 0,T=void 0,R=void 0,C=function(n,i){var o=s.media,a=n.mediaRange;return l&&(o=l[i].media||"",a=l[i].mediaRange),ft(r,t,e,h,n.d,R,o,a,m,n.tManifest)};for(R=e.timescale,d=u.S_asArray,p=i,null!==n&&(v=r.calcMediaTimeFromPresentationTime(n,e)),_=0,f=d.length;_a){if(T=!0,c)break}else null!==v?y>=v-b.d/R*1.5&&g.push(C(b,m)):m>=p&&g.push(C(b,m)),y=(h+=b.d)/R}return c||(e.availableSegmentsNumber=m+1),g}}}yt.__dashjs_factory_name="TimelineSegmentsGetter";var mt=s.a.getClassFactory(yt);function gt(e,t){var r=e.timelineConverter ;return{getSegments:function(e,n,i,o){var a,s,u,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate,d=e.segmentDuration,f=e.segmentAvailabilityRange,p=[],h=null,y=null,m=void 0;for(u=e.startNumber,a=(l=isNaN(d)&&!t?{start:u,end:u}:ht(r,t,e,n,i,o)).start,s=l.end,m=a;m<=s;m++)(y=dt(r,t,e,m)).replacementTime=(u+m-1)*e.segmentDuration,h=ct(h=c.media,"Number",y.replacementNumber),h=ct(h,"Time",y.replacementTime),y.media=h,p.push(y),y=null;return isNaN(d)?e.availableSegmentsNumber=1:e.availableSegmentsNumber=Math.ceil((f.end-f.start)/d),p}}}gt.__dashjs_factory_name="TemplateSegmentsGetter";var vt=s.a.getClassFactory(gt);function bt(e,t){var r=(e=e||{}).timelineConverter;return{getSegments:function(e,n,i,o){var a,s,u,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,d=c.SegmentURL_asArray.length,f=[],p=void 0,h=void 0,y=void 0;for(l=e.startNumber,a=ht(r,t,e,n,i,o),s=Math.max(a.start,0),u=Math.min(a.end,c.SegmentURL_asArray.length-1),p=s;p<=u;p++)y=c.SegmentURL_asArray[p],(h=dt(r,t,e,p)).replacementTime=(l+p-1)*e.segmentDuration,h.media=y.media?y.media:"",h.mediaRange=y.mediaRange,h.index=y.index,h.indexRange=y.indexRange,f.push(h),h=null;return e.availableSegmentsNumber=d,f}}}bt.__dashjs_factory_name="ListSegmentsGetter";var _t=s.a.getClassFactory(bt);function Et(e,t){var r,n=this.context,i=void 0,o=void 0,a=void 0;return r={getSegments:function(e,t,r,n,s){var u=void 0,l=e.segmentInfoType;l!==tt.SEGMENT_BASE&&l!==tt.BASE_URL&&function(e,t){var r=e.segments,n=!1,i=void 0,o=void 0;return r&&0!==r.length?(o=r[0].availabilityIdx,i=r[r.length-1].availabilityIdx,n=ti):n=!0,n}(e,r)?(l===tt.SEGMENT_TIMELINE?u=i.getSegments(e,t,r,s):l===tt.SEGMENT_TEMPLATE?u=o.getSegments(e,t,r,s):l===tt.SEGMENT_LIST&&(u=a.getSegments(e,t,r,s)),n&&n(e,u)):u=e.segments}},i=mt(n).create(e,t),o=vt(n).create(e,t),a=_t(n).create(e,t),r}Et.__dashjs_factory_name="SegmentsGetter";var St=s.a.getClassFactory(Et);function At(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}At.__dashjs_factory_name="RequestModifier";var wt=s.a.getSingletonFactory(At);function Tt(e){var t=(e=e||{}).requestModifier;return{load:function(e){var r=new Date,n=e.request,i=new XMLHttpRequest;i.open(e.method,e.url,!0),n.responseType&&(i.responseType=n.responseType),n.range&&i.setRequestHeader("Range","bytes="+n.range),n.requestStartDate||(n.requestStartDate=r),t&&(i=t.modifyRequestHeader(i)),i.withCredentials=e.withCredentials,e.request.loadInfo={rType:"XHR",cdn:0,pdn:0,protocol:"TCP"},i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.timeout=e.timeout,i.ontimeout=e.ontimeout,i.onprogress=e.progress,i.onabort=e.onabort,i.onNcFail=e.onNcFail,i.onreadystatechange=function(){if(2===i.readyState)e.onHeadersReceived();else if(4===i.readyState)try{var t=i.getAllResponseHeaders&&i.getAllResponseHeaders();t&&t.indexOf("quic")>-1&&e.request&&e.request.loadInfo&&(e.request.loadInfo.protocol="QUIC")}catch(e){}},i.send(),e.response=i},abort:function(e){e&&e.response&&e.response.abort()},getP2pType:function(){return""}}}Tt.__dashjs_factory_name="XHRLoader";var Rt=s.a.getClassFactory(Tt);function Ct(e){var t=void 0,r={cdn:0,p2p:0},n=void 0,i=(e=e||{}).p2pType,o=!1,a=_(this.context).getInstance().log,s="[P2PLoader]";return{load:function(u){n=u;var l=u.request;t||(t=new e.supplier(u.url,e.video,l.mediaType),a(s,"["+i+"] new sdk loader ["+l.mediaType+"]")),t.onDataArrival=function(e){var n=t&&t.loadInfo();n&&(l.p2pLoadInfo||(l.p2pLoadInfo={cdn:0,p2p:0}),l.p2pLoadInfo.url=n.url),u.progress&&u.progress(null,e,n&&{cdn:n.cdn-r.cdn,p2p:n.p2p-r.p2p,rType:"PCDN"}),r=n||r},t.onError=function(e,t){a(s,"["+i+"] error, status:"+e+", msg:"+t+", type:"+l.mediaType),u.response={status:e,statusText:t},o=!1,u.onerror(),u.onend()},t.onComplete=function(){a(s,"["+i+"] onComplete, type:"+n.request.mediaType),o=!1,u.onload(),u.onend()};var c=void 0;if(l.range){var d=l.range.split("-");c={from:parseInt(d[0]),to:parseInt(d[1]||"-1")}}else c={from:0,to:-1};a(s,"["+i+"] load "+l.mediaType+" url:"+u.url+", range: "+c.from+"-"+c.to),t.load(c,u.withCredentials);var f=t.loadInfo();f&&(l.p2pLoadInfo||(l.p2pLoadInfo={cdn:0,p2p:0}),l.p2pLoadInfo.url=f.url),o=!0},abort:function(){o=!1,t&&(t.abort(),t.onDataArrival=void 0,t.onError=void 0,t.onComplete=void 0),n.onabort(),n.onend(),a(s,"["+i+"] abort sdk ["+n.request.mediaType+"]")},destroySdk:function(){var e=function(){o=!1,t&&(t.destroy(),t=void 0,a(s,"["+i+"] destroy sdk ["+n.request.mediaType+"]")),r={cdn:0,p2p:0}};o?(t.onError=function(t,r){a(s,"["+i+"] error, status:"+t+", msg:"+r+", type:"+n.request.mediaType),n.response={status:t,statusText:r},n.onerror(),n.onend(),e()},t.onComplete=function(){a(s,"["+i+"] detroy sdk onComplete, type:"+n.request.mediaType),n.onload(),n.onend(),e()}):e()},getUrl:function(){return n.url||""},getP2pType:function(){return i}}}Ct.__dashjs_factory_name="P2PLoader";var Pt=s.a.getClassFactory(Ct);function It(e){var t,r,n=void 0,i=void 0;r=(e=e||{}).hid;var o=!1;if(window.localStorage&&localStorage.getItem)try{var a=JSON.parse(localStorage.getItem("bp_nc_config"));a&&1===a.showLog&&(o=!0)}catch(e){}function s(){var e="bpNC";return r&&(e+="_"+r),window[e]}return _(this.context).getInstance().log,t={load:function(e){n=e;var t=e.request,r=s();r&&(i=r.getToken(),r.getData({url:t.url,range:t.range,token:i,bitrate:t.bitrate||0,latency:t.latency||5e3}).then((function(r){if(o){var n=0,i="";r&&r.responseData&&(r.responseData.getDataTime&&(n=Math.round(8*r.responseData.gotDataByte/1e3/(r.responseData.getDataTime/1e3))),r.responseData.path&&(i=r.responseData.path),r.peers=r.responseData.usePeerSids&&r.responseData.usePeerSids.length||0),console.log("--\x3e "+i+" nc success, speed is",n,"Kbps, res:",r)}e.progress&&e.progress(null,r.responseData.data,{nc:r.responseData.data.byteLength,cdn:0,rType:"NC",url:t.url,ncBr:r.responseData.gotDataByteFromBr}),e.onNCInfo&&e.onNCInfo(r),e.onload&&e.onload(),e.onend&&e.onend()}),(function(r){if(o){var n=0,i="";r&&r.responseData&&(r.responseData.getDataTime&&(n=Math.round(8*r.responseData.gotDataByte/1e3/(r.responseData.getDataTime/1e3))),r.responseData.path&&(i=r.responseData.path),r.peers=r.responseData.usePeerSids&&r.responseData.usePeerSids.length||0),console.log("--\x3e "+i+" nc fail, speed is",n,"Kbps, res:",r)}if(e.onNCFail&&r.responseData){var a=r.responseData.data?r.responseData.data.byteLength:0,s=r.responseData.gotDataByte?r.responseData.gotDataByte:0;e.onNCFail({ncFail:a,nc:s,ncGotFail:s,cdn:0,rType:"NC",url:t.url,ncBr:r.responseData.gotDataByteFromBr||0})}e.onNCInfo&&e.onNCInfo(r),e.onerror&&e.onerror()})))},abort:function(e){var t=s();t&&i&&t.abortGetData(i),n&&(n.onNCInfo&&n.onNCInfo({code:4999,qn:parseInt(e.representationId,10)||0,responseData:{}}),n&&n.onabort&&n.onabort(),n&&n.onend&&n.onend())},getP2pType:function(){return""},disableRP:function(){var e=s();e&&"function"==typeof e.disableRP&&e.disableRP()}},t}It.__dashjs_factory_name="NCLoader";var Dt=s.a.getClassFactory(It);function Ot(e){var t=(e=e||{}).requestModifier;function r(e,t){e.reader.read().then(t).catch((function(){}))}return{load:function(e){var n=new Date,i=e.request,o=new Headers;i.range&&o.append("Range","bytes="+i.range),i.requestStartDate||(i.requestStartDate=n),t&&t.modifyRequestHeader({setRequestHeader:function(e,t){o.append(e,t)}});var a=void 0;"function"==typeof window.AbortController&&(a=new AbortController,e.abortController=a);var s={method:e.method,headers:o,credentials:e.withCredentials?"include":void 0,signal:a?a.signal:void 0};fetch(e.url,s).then((function(t){e.response||(e.response={}),e.response.status=t.status,e.response.statusText=t.statusText,e.response.responseURL=t.url,t.ok||e.onerror();var n="",i=!0,o=!1,a=void 0;try{for(var s,u=t.headers.keys()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;n+=l+": "+t.headers.get(l)+"\n"}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}if(e.response.responseHeaders=n, e.onHeadersReceived(),!t.body)return t.arrayBuffer().then((function(t){e.response.response=t;var r={loaded:t.byteLength,total:t.byteLength};e.progress(r),e.onload(),e.onend()}));var c=parseInt(t.headers.get("Content-Length"),10),d=0,f=!1,p=new Uint8Array,h=0;e.reader=t.body.getReader(),r(e,(function t(n){var i=n.value;if(n.done)return p&&(e.progress({loaded:d,total:isNaN(c)?d:c,lengthComputable:!0}),e.response.response=p.buffer),e.onload(),void e.onend();if(i&&i.length>0){p=function(e,t){if(0===e.length)return t;var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(p,i),d+=i.length;var o=we().getInstance().findLastTopIsoBoxCompleted(["moov","mdat"],p,h);if(o.found){var a=o.lastCompletedOffset+o.size,s=void 0;a===p.length?(s=p,p=new Uint8Array):(s=new Uint8Array(p.subarray(0,a)),p=p.subarray(a)),e.progress({data:s.buffer,lengthComputable:!1,noTrace:!0}),h=0}else h=o.lastCompletedOffset,f||(e.progress({lengthComputable:!1,noTrace:!0}),f=!0)}r(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel()}catch(e){}}}}Ot.__dashjs_factory_name="FetchLoader";var xt=s.a.getClassFactory(Ot);function kt(){var e=this.context,t=p(e).getInstance();return{capabilityError:function(e){t.trigger(m.ERROR,{error:"capability",event:e})},downloadError:function(e,r,n,i,o){t.trigger(m.ERROR,{error:"download",event:{id:e,url:r,request:n},code:i,httpCode:o})},manifestError:function(e,r,n,i,o,a){t.trigger(m.ERROR,{error:"manifestError",event:{message:e,id:r,manifest:n,event:i},code:o,httpCode:a})},timedTextError:function(e,r,n){t.trigger(m.ERROR,{error:"cc",event:{message:e,id:r,cc:n}})},mediaSourceError:function(e,r,n){t.trigger(m.ERROR,{error:"mediasource",event:e,code:r,decodeErrorType:n})},mediaKeySessionError:function(e){t.trigger(m.ERROR,{error:"key_session",event:e})},mediaKeyMessageError:function(e){t.trigger(m.ERROR,{error:"key_message",event:e})},mssError:function(e){t.trigger(m.ERROR,{error:"mssError",event:e})}}}kt.__dashjs_factory_name="ErrorHandler";var Nt=s.a.getSingletonFactory(kt);Nt.CAPABILITY_ERROR_MEDIASOURCE="mediasource",Nt.CAPABILITY_ERROR_MEDIAKEYS="mediakeys",Nt.DOWNLOAD_ERROR_ID_MANIFEST="manifest",Nt.DOWNLOAD_ERROR_ID_SIDX="SIDX",Nt.DOWNLOAD_ERROR_ID_CONTENT="content",Nt.DOWNLOAD_ERROR_ID_INITIALIZATION="initialization",Nt.DOWNLOAD_ERROR_ID_XLINK="xlink",Nt.DOWNLOAD_ERROR_ID_PCDN_SDK="pcdnsdk",Nt.MANIFEST_ERROR_ID_CODEC="codec",Nt.MANIFEST_ERROR_ID_PARSE="parse",Nt.MANIFEST_ERROR_ID_NOSTREAMS="nostreams",Nt.TIMED_TEXT_ERROR_ID_PARSE="parse",s.a.updateSingletonFactory(kt.__dashjs_factory_name,Nt);var Lt=Nt;function Mt(){return{arraybuffer2string:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))},base642ab:function(e){e=window.atob(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0,i=e.length;n2&&void 0!==arguments[2]?arguments[2]:0,v=e.request,_="",C=0,j=0,H=0;if(B(v),v.range){var Z=v.range.split("-");if(C=parseInt(Z[0]),j=parseInt(Z[1]),v.mediaType&&v.representationId&&F&&F[v.mediaType+"id"]===v.representationId+""&&F[v.mediaType]){if(g("[HTTPLoader] Use Preload Data"),j=2&&K<=0&&J<2.5&&J>=0){var te=Math.min(1-J/5,.6);v.beforeSeekingRange=v.range;var re=v.range.split("-");C=parseInt(re[0]),j=parseInt(re[1]);var ne=null,ie=0;if(M&&M[v.mediaType]&&(ne=M[v.mediaType].find((function(e,t){return t>v.index})))){var oe=ne.mediaRange.split("-");ie=oe.length&&+oe[1]-+oe[0]||0}var ae=Math.round(ie*te);v.range=C+"-"+(j+ae),g("[HTTPLoader] Seeking Download More "+ae+" Bytes")}}}catch(e){}}var se=s.getElement();v.currentTime=se&&se.currentTime;var ue=v.NCInfo;if(ue&&ue.responseData&&ue.responseData.availableData&&ue.responseData.availableData.length>0){var le=ue.responseData.missingData;if(le&&1===le.length){var ce=le[0].start,de=le[0].end;ce>0&&de>0&&ce>=C&&de<=j&&(v.completeNCMissingRange=!0,v.originRange=v.range,v.range=ce+"-"+de)}}"video"===v.mediaType&&parseInt(v.representationId,10)>=80||(v.completeNCMissingRange=!1,v.originRange&&(v.range=v.originRange)),v.firstByteDate=null;var fe=[],pe=v.representationId,he=!0,ye=!0,me=new Date,ge=me,ve=0,be=void 0,_e=T[pe]||0,Ee=!1,Se=1,Ae=0,we=void 0,Te=-1;if(v.urls&&v.urls.length>1&&_e&&(v.url=v.urls[_e],e.url=v.urls[_e]),!c||!u||!a)throw new Error("config object is not correct or missing");var Re=c.modifyRequestURL(v.url),Ce=!(!e.params||"boolean"!=typeof e.params.canUseNC)&&e.params.canUseNC,Pe=s&&s.getElement()&&s.getElement().playbackRate||1,Ie=(v.bufferLevel||0)/Pe,De=function(e){var t=0;try{var r=e&&e.mediaInfo&&e.mediaInfo.bitrateList,n=e&&e.representationId;if(n&&r&&r.length){var i=r.filter((function(e){return e.id===n}));i&&i.length&&(t=i[0].bandwidth)}}catch(e){}return t}(v);if(De>1048576){var Oe=parseInt(De/1024/1024,10),xe=Math.min(10,2+1.5*Oe);Ie=Math.max(0,Ie-xe)}else Ie=Math.max(0,Ie-2);var ke=function(e){if(!l.getUseNC())return!1;var t=e.canUseNC,r=e.rangeStart,n=e.mediaUrl,i=e.bufferLevel,o=e.bitrate,a=e.originBufferLevel,u=e.isSwitchingQn;if(isNaN(r)||r<0||!n||u)return!1;var c=function(){var e="bpNC";return I&&(e+="_"+I),window[e]}();if(!t||!c||"function"!=typeof c.allowDPGetDataByNC)return!1;var d=(""+n).split("?")[0].split("/"),f=d[d.length-1].split(".")[0].split("-").pop();if(!f)return!1;var p=parseInt(f,10);if(isNaN(p))return!1;var m=NaN,v=!1,b=1;if(s&&s.getElement()){var _=s.getElement(),E=_.currentTime,S=0;_.buffered&&_.buffered.length&&(S=_.buffered.end(0)),m=S-E,v=_&&_.seeking,b=_&&_.playbackRate||1}return!isNaN(m)&&!(!i||a/b<=function(){var e=L.length;return e&&L.reduce((function(e,t){return e+t}))/e/1e3||0 }())&&(N>=h&&i/b-1||(r[t]=(r[t]||0)+(e[t]||0))},r={};t(e.p2pLoadInfo),t(e.loadInfo),r.rType="XHR",r.url=e.loadInfo.url||e.p2pLoadInfo.url||"",e.loadInfo=r}else e.loadInfo=e.p2pLoadInfo||e.loadInfo||{};"XHR"===e.loadInfo.rType&&(e.url&&e.url.indexOf("traceid=")>-1?e.loadInfo.pdn=e.bytesTotal||e.bytesLoaded||0:e.loadInfo.cdn=e.bytesTotal||e.bytesLoaded||0,e.loadInfo.url=e.url)}(v),e){if(ke||!ke&&v&&v.p2pLoadInfo&&v.p2pLoadInfo.nc){ke&&(N=0);var n=v.requestEndDate,i=v.startLoadFragmentTime;i&&n&&(t=n.getTime()-new Date(i).getTime(),L.length>5&&L.shift(),L.push(t))}}else if(ke&&v&&v.mediaType){var o=k,a=v.index;v.p2pLoadInfo&&(isNaN(a)||a-o!=1&&-1!==o||N++),k=a}v.checkExistenceOnly||u.addHttpRequest(v.mediaType,null,v.type,v.url,be.response?be.response.responseURL:null,v.serviceLocation||null,v.range||null,v.requestStartDate,v.firstByteDate,v.requestEndDate,be.response?be.response.status:null,v.duration,be.response&&be.response.getAllResponseHeaders?be.response.getAllResponseHeaders():be.response?be.response.responseHeaders:null,e?fe:null)},Me=function(){if(clearTimeout(Ae),-1!==b.indexOf(be)){b.splice(b.indexOf(be),1),we=!1;var r=be&&be.response&&be.response.status;if(ye)if(Le(!1),e.params&&(e.params.canUseNC=!1),function(e){var t=e.NCInfo;return t&&t.responseData&&t.responseData.missingData&&t.responseData.missingData.length>0}(v)&&e.params&&(e.params.disableSeekDownloadMore=!0),t>0){var s=0,c=0;Date.now()-me<50&&(c=!v.index||v.index<=2||performance&&performance.now&&performance.now()<1e4?1e3*(p+1)/100:1e3*(p+1),H=o.CONNECT_FRAGMENT_ERROR_OFFLINE),(r>=400&&r<500||r>=600)&&(c=0,s=0),ke&&(c=0,s=0),P=setTimeout((function(){var a;l.setRetryTimes(p+1),ke||p++;var c=be.request,d=be.request&&be.request&&be.request.NCInfo;if(c.retryTimes=p,i.trigger(m.REQUEST_RETRYED,(Gt(a={retryTimes:p,representationId:pe,status:be.response&&be.response.status,url:c.url,mediaType:c.mediaType,range:c.range,rType:ke?"NC":"XHR",code:(ke?d&&d.code:be.response&&be.response.status)||H,index:c&&c.index,id:c&&c.representationId},"url",c&&c.url),Gt(a,"timeout",c.timeout),Gt(a,"latencyTime",c.latency),Gt(a,"downloadTime",(c.requestEndDate&&c.requestEndDate.getTime())-(c.requestStartDate&&c.requestStartDate.getTime())),a)),l.getP2pPermission()&&4203===r&&(i.trigger(m.PCDN_LOADED_ERROR,{code:o.DOWNLOAD_PCDN_DISABLED,from:1}),l.setP2pPermission(!1)),e.request.urls&&e.request.urls.length>1){var h=p%c.urls.length;c.urls&&c.urls.length&&c.urls[0].includes("traceid=")&&(Te>0?h=(p+1)%c.urls.length:ke?(function(e){if(f)return-1!==[n.VIDEO,n.AUDIO,n.FRAGMENTED_TEXT].indexOf(e)&&f.getCurrentBufferLevel(u.getReadOnlyMetricsFor(e))||NaN}(c.mediaType)||0)<30&&(h=(p+1)%c.urls.length):h===T[pe]&&(h=(h+1)%c.urls.length)),T[pe]=h,_e=T[pe],e.request.url=c.urls[_e],e.url=c.urls[_e],t--,S.push(setTimeout((function(){g("[HTTPLoader] internalLoad failure retry, useNC: "+ke),V(e,t,p)}),s))}else t--,S.push(setTimeout((function(){g("[HTTPLoader] internalLoad failure retry, useNC: "+ke),V(e,t,p)}),s))}),c)}else a.downloadError(w[v.type].type,v.url,v,w[v.type].code,be.response&&be.response.status),e.error&&e.error(v,"error",be.response&&be.response.statusText,be.response&&be.response.status),e.complete&&e.complete(v,be.response&&be.response.statusText),W(v.mediaType)}},Fe=function(e){var t=s.getPlaybackRate()||1,r=e.request,n=e.useNC,i=e.modifiedUrl,o=e.retryTimes,a=e.connectMaxTime,u=e.bitrate,l=a+1e3*o+50,c=r.timeout+3e3*o;if((n||i&&i.includes("traceid"))&&(l=function(e){var t=5e3,r=1e4,n=5e3;return e<15?n=t:e<20?n=1e3*parseInt(e-10,10):e>20&&(n=r),n=Math.min(n,r),n=Math.max(n,t),g("NCLoader latency, bufferLevel: "+e+", latencyTimeout: "+n),n}(r.bufferLevel),r.bitrate=u,r.latency=l,c=l+200),isNaN(r.bufferLevel)||!t||!r.bufferLevel)return{latencyTimeout:l,timeout:c};var d=r.bufferLevel/t*1e3,f=n?5e3:2e3,p=n?.6:.2,h=Math.max,y=Math.min;return{latencyTimeout:0|h(y(l,d*p),f),timeout:0|h(y(c,.6*d),5e3)}}({request:v,useNC:ke,modifiedUrl:Re,retryTimes:p,connectMaxTime:2e3,bitrate:De}),Ue=Fe.latencyTimeout,Be=Fe.timeout;Ae=setTimeout((function(){l.getP2pPermission()&&"function"==typeof we.getP2pType&&we.getP2pType()&&l.addP2pSDKErrorCount(),Ee=!0,we.abort(be),A.push(4106),e.connectTimeout&&e.connectTimeout(v,Ue,ke),Me()}),Ue);var Ge,Ve,We,je,He=new Uint8Array,Ze=function(e,t){var r=t||e.response.response,n=e.request;if(n&&n.beforeSeekingRange){var i=n.beforeSeekingRange.split("-"),o=parseInt(i[0]),a=parseInt(i[1]),s=new Uint8Array(r.slice(0,a-o+1));return n.range=n.beforeSeekingRange,n.beforeSeekingRange=null,s.buffer}return r},Ye=function(){var e=x||l.getExternalMediaLoader();return g("[getMediaSourceLoader] use media source loader is ",!!e),e}();if(Ye&&"function"==typeof Ye)we=Bt(r).create({requestModifier:c,loader:Ye});else if(ke)we=Dt(r).create({requestModifier:c,hid:I}),l.getUseP2P()||we.disableRP(),i.trigger(m.CDN_LOAD_INFO,{NCInfo:{code:9999,qn:parseInt(v.representationId,10)||0,range:v.range,responseData:{}}});else if(d&&window.fetch&&"arraybuffer"===v.responseType)we=xt(r).create({requestModifier:c});else{var Ke=window.__DASH_P2P_TYPE__,qe={yf:window.YFDashIO,xl:window.xyvp&&window.xyvp.Loader,ks:window.KSLoader,pear:window.PearDownloader,bili:window.DIYSdk},ze=void 0,Xe=void 0,Qe=void 0;if(Ke&&l.getP2pPermission()){var Je=Ke.match(/([a-z]+)-([a-z0-9]+)/);Je&&(ze=qe[Je[1]],Qe="cg2"===Je[2],Xe="eg"===Je[2]),ze||delete window.__DASH_P2P_TYPE__}Xe&&ze&&v.index>=0?Vt[v.mediaType]&&Vt[v.mediaType].getP2pType()&&(Ge=Vt[v.mediaType].getUrl(),Ve=Re,We=Ge.match(/^.+\/([a-zA-Z0-9_\-\.]+)\??[^\/]+$/)&&Ge.match(/^.+\/([a-zA-Z0-9_\-\.]+)\??[^\/]+$/)[1],je=Ve.match(/^.+\/([a-zA-Z0-9_\-\.]+)\??[^\/]+$/)&&Ve.match(/^.+\/([a-zA-Z0-9_\-\.]+)\??[^\/]+$/)[1],We&&je&&We===je)?we=Vt[v.mediaType]:(W(v.mediaType),we=Pt(r).create({video:s.getElement(),p2pType:Ke,supplier:ze}),Vt[v.mediaType]=we):Qe&&ze&&"video"===v.mediaType&&Re!==O&&(O=Re,D&&D.destroy(),D=new ze(Re,s.getElement(),"watch")),we||(W(v.mediaType),we=Rt(r).create({requestModifier:c}))}var $e=v.checkExistenceOnly?G.HEAD:G.GET,et=l.getXHRWithCredentialsForType(v.type);be={url:Re,method:$e,withCredentials:et,timeout:Be,request:v,onload:function(){if(be.response){if(be.response.status>=200&&be.response.status<=299){var t=Ze(be);_&&(t=R.concat(_,t),v.range=C+"-"+j),Le(!0),e.success&&e.success(t,be.response.statusText,be.response.responseURL),e.complete&&e.complete(v,be.response.statusText)}}else{var r=Ze(be,He);_&&(r=R.concat(_,r),v.range=C+"-"+j),Le(!0),e.success&&e.success(r,"",Re),e.complete&&e.complete(v,"")}},onend:Me,onerror:Me,ontimeout:function(){A.push(4105),e.timeout&&e.timeout(v,Se,Be),Me()},progress:function(t,r,n){var i=new Date;if(n){for(var o in v.p2pLoadInfo||(v.p2pLoadInfo={}),n)["p2p","cdn","nc","ncBr","pdn"].indexOf(o)>-1?v.p2pLoadInfo[o]=(v.p2pLoadInfo[o]||0)+n[o]:v.p2pLoadInfo[o]=n[o];v.p2pLoadInfo.requestStartTime=me}if(!t){if(t={lengthComputable:!1,total:0,loaded:0},r&&(He=R.concat(He,r),t.loaded=He.byteLength),v.range){ var a=v.range.split("-"),s=parseInt(a[0]),u=parseInt(a[1]);u&&(t.total=u-s+1)}t.loaded&&t.total&&(t.lengthComputable=!0)}he&&(he=!1,(Se=i-me)<2e3&&clearTimeout(Ae),(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(v.firstByteDate=i)),t.lengthComputable&&(v.bytesLoaded=t.loaded,v.bytesTotal=t.total),t.noTrace||(fe.push({s:ge,d:i.getTime()-ge.getTime(),b:[t.loaded?t.loaded-ve:0]}),ge=i,ve=t.loaded),e.progress&&t.loaded&&e.progress(t.loaded)},onabort:function(){clearTimeout(Ae),clearTimeout(P),e.abort&&!Ee&&e.abort(v)},onHeadersReceived:function(){v.headersReceivedDate=new Date,e.headersReceived&&e.headersReceived(be.response&&be.response.getAllResponseHeaders&&be.response.getAllResponseHeaders())},onNCFail:function(e){if(e){for(var t in v.p2pLoadInfo||(v.p2pLoadInfo={}),e)["p2p","cdn","nc","ncFail","ncGotFail","ncBr","pdn"].indexOf(t)>-1?v.p2pLoadInfo[t]=(v.p2pLoadInfo[t]||0)+e[t]:v.p2pLoadInfo[t]=e[t];v.p2pLoadInfo.requestStartTime=me}},onNCInfo:function(e){e.qn=parseInt(v.representationId,10)||0,v.NCInfo=e},loader:we};var tt=(new Date).getTime();if(isNaN(v.delayLoadingTime)||tt>=v.delayLoadingTime)b.push(be),we.load(be);else{var rt={httpRequest:be};E.push(rt),rt.delayTimeout=setTimeout((function(){if(-1!==E.indexOf(rt)){E.splice(E.indexOf(rt),1);try{me=new Date,ge=me,b.push(rt.httpRequest),we.load(rt.httpRequest)}catch(e){rt.httpRequest.onerror()}}}),v.delayLoadingTime-tt)}}function W(e){Vt[e]&&Vt[e].destroySdk&&(Vt[e].destroySdk(),Vt[e]=null)}function j(e){e&&e.hid&&(I=e.hid)}function H(e){e&&e.loader&&!x&&(x=e.loader,i.off(m.BIND_MEDIA_SOURCE_LOADER,H,v))}return F&&(F.video&&"string"==typeof F.video&&(F.video=R.base642ab(F.video)),F.audio&&"string"==typeof F.audio&&(F.audio=R.base642ab(F.audio))),v={load:function(e){e.request&&(l.setRetryTimes(0),V(e,l.getRetryAttemptsForType(e.request.type),0))},abort:function(){D&&(D.destroy(),D=void 0,O=void 0),x&&(x=null),clearTimeout(P),C.forEach((function(e){return clearTimeout(e)})),S.forEach((function(e){return clearTimeout(e)})),S=[],E.forEach((function(e){return clearTimeout(e.delayTimeout)})),E=[],b.forEach((function(e){e&&e.request&&isNaN(e.request.index)||(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e),e.onabort())})),b=[],i.off(m.INIT_HID,j,v),i.off(m.BIND_MEDIA_SOURCE_LOADER,H,v)},setPreloadData:function(e){(F=e)&&(F.video&&"string"==typeof F.video&&(F.video=R.base642ab(F.video)),F.audio&&"string"==typeof F.audio&&(F.audio=R.base642ab(F.audio)))},setSegmentsInfo:function(e){e&&e.segments&&(M||(M={}),M[e.mediaType]=e.segments)}},i.on(m.INIT_HID,j,v),i.on(m.BIND_MEDIA_SOURCE_LOADER,H,v),b=[],E=[],S=[],Gt(t={},G.MPD_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_MANIFEST,code:o.DOWNLOAD_MPD_ERROR}),Gt(t,G.XLINK_EXPANSION_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_XLINK,code:o.DOWNLOAD_XINK_ERROR}),Gt(t,G.INIT_SEGMENT_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_INITIALIZATION,code:o.DOWNLOAD_INIT_SEGMENT_ERROR}),Gt(t,G.MEDIA_SEGMENT_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_CONTENT,code:o.DOWNLOAD_MEDIA_SEGMENT_ERROR}),Gt(t,G.INDEX_SEGMENT_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_CONTENT,code:o.DOWNLOAD_INDEX_SEGMENT_ERROR}),Gt(t,G.BITSTREAM_SWITCHING_SEGMENT_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_CONTENT,code:o.DOWNLOAD_SWITCHING_SEGMENT_ERROR}),Gt(t,G.OTHER_TYPE,{type:Lt.DOWNLOAD_ERROR_ID_CONTENT,code:o.DOWNLOAD_OTHER_ERROR}),w=t,v}Wt.__dashjs_factory_name="HTTPLoader";var jt=s.a.getClassFactory(Wt);function Ht(){var e,t=this.context,r=_(t).getInstance().log,n=p(t).getInstance(),i=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0;function h(){if(!f||!f.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function y(e){if(e.url){var t=new v;return t.type=e.init?G.INIT_SEGMENT_TYPE:G.MEDIA_SEGMENT_TYPE,t.url=e.url,t.urls=e.urls,t.range=e.range.start+"-"+e.range.end,t.representationId=e.representationId,t.mediaType=e.mediaType,t}}function g(e,t,r){e?n.trigger(m.SEGMENTS_LOADED_BEFORE_HANDLE,{segments:e,representation:t,mediaType:r}):n.trigger(m.SEGMENTS_LOADED_BEFORE_HANDLE,{segments:null,representation:t,mediaType:r,error:new C(null,"error loading segments",null)})}return e={setConfig:function(e){e.baseURLController&&(f=e.baseURLController),e.metricsModel&&(l=e.metricsModel),e.mediaPlayerModel&&(c=e.mediaPlayerModel),e.errHandler&&(i=e.errHandler),e.videoModel&&(a=e.videoModel)},initialize:function(){s=we(t).getInstance(),u=wt(t).getInstance(),d=jt(t).create({errHandler:i,videoModel:a,metricsModel:l,mediaPlayerModel:c,requestModifier:u,preloadData:c.getPreloadData()})},loadInitialization:function e(t,i){h();var o=null,a=null,u=f.resolve(t.path),l=i||{init:!0,url:u?u.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500};r("Start searching for initialization.");var c=y(l);d.load({request:c,success:function(i){l.bytesLoaded=l.range.end,a=s.parse(i),o=function(e){var t=e.getBox("ftyp"),n=e.getBox("moov"),i=null,o=void 0,a=void 0;return r("Searching for initialization."),n&&n.isComplete&&(o=t?t.offset:n.offset,a=n.offset+n.size-1,r("Found the initialization. Range: "+(i=o+"-"+a))),i}(a),o?(t.range=o,n.trigger(m.INITIALIZATION_LOADED,{representation:t})):(l.range.end=l.bytesLoaded+l.bytesToLoad,e(t,l))},error:function(){n.trigger(m.INITIALIZATION_LOADED,{representation:t})}}),r("Perform init search: "+l.url)},loadSegments:function e(t,n,a,u,l){if(h(),a&&(void 0===a.start||void 0===a.end)){var p=a?a.toString().split("-"):null;a=p?{start:parseFloat(p[0]),end:parseFloat(p[1])}:null}a.start=0,l=l||g;var m=null,v=null,b=!!a,_=f.resolve(t.path),E={init:!1,url:_?_.url:void 0,urls:_.urls,range:b?a:{start:0,end:1500},searching:!b,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,representationId:t.id,mediaType:t.adaptation.type},S=y(E),A=function(){l(null,t,n)};d.load({request:S,success:function(a){if(E.bytesLoaded=E.range.end-E.range.start,m=s.parse(a),(v=m.getBox("sidx"))&&v.isComplete){var u=v.references,d=void 0,f=void 0;if(null!=u&&u.length>0&&(d=1===u[0].reference_type),d){r("Initiate multiple SIDX load."),E.range.end=E.range.start+v.size;var p=void 0,h=void 0,y=void 0,g=void 0,b=[],_=0,S=(v.offset||E.range.start)+v.size,w=function(e){e?(b=b.concat(e),++_>=h&&l(b,t,n)):l(null,t,n)};for(p=0,h=u.length;p=a}else h("isMediaFinished - no segment found")}else t=!0;return t}function I(e){A.getSegments(e,g,y,D)}function D(e,t){var r=S?S.getStreamInfo().manifestInfo.isDynamic:null;if(e.segments=t,t&&t.length>0&&(E=isNaN(E)?t[0].presentationStartTime:Math.min(t[0].presentationStartTime,E),r&&isNaN(a.getExpectedLiveEdge()))){var i=t[t.length-1].presentationStartTime,o=u.getMetricsFor(n.STREAM);a.setExpectedLiveEdge(i),u.updateManifestUpdateInfo(s.getCurrentManifestUpdate(o),{presentationStartTime:i})}}function O(e){if(!e)throw new Error("no representation");e.segments=null,I(e)}function x(e,t,r){var n=t.segments,i=n?n.length:null,o=-1,a=void 0,s=void 0,u=void 0,c=void 0,d=void 0;if(n&&i>0){for(r=null==r?l.getSegmentOverlapToleranceTime():r,d=0;d=u&&e-a0&&(o=0)}return o}function k(e){if(null==e)return null;var t=new v,r=e.representation,n=r.adaptation.period.mpd.manifest.Period_asArray[r.adaptation.period.index].AdaptationSet_asArray[r.adaptation.index].Representation_asArray[r.index].bandwidth,i=e.media,o=S?S.getType():null;return i=ct(i,"Number",e.replacementNumber),i=ct(i,"Time",e.replacementTime),i=function(e){return e?e.split("$$").join("$"):e}(i=function(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var r=t.toString();return e.split("$RepresentationID$").join(r)}(i=ct(i,"Bandwidth",n),r.id)),t.mediaType=o,t.type=G.MEDIA_SEGMENT_TYPE,t.range=e.mediaRange,t.startTime=e.presentationStartTime,t.duration=e.duration,t.timescale=r.timescale,t.availabilityStartTime=e.availabilityStartTime,t.availabilityEndTime=e.availabilityEndTime,t.wallStartTime=e.wallStartTime,t.quality=r.index,t.index=e.availabilityIdx,t.mediaInfo=S.getMediaInfo(),t.adaptationIndex=r.adaptation.index,t.representationId=r.id,R(t,i,r)?t:void 0}function N(e,t,r){var n=void 0,i=S?S.getType():null,o=S?S.getStreamInfo().manifestInfo.isDynamic:null,a=y,s=!!r&&r.keepIdx,u=r?r.timeThreshold:null,l=!(!r||!r.ignoreIsFinished);return e?(g!==t&&(g=t,h("Getting the request for "+i+" time : "+t)),I(e),(y=x(t,e,u))<0&&(I(e),y=x(t,e,u)),y>0&&h("Index for "+i+" time "+t+" is "+y),!l&&P(e)?((n=new v).action=v.ACTION_COMPLETE,n.index=y,n.mediaType=i,n.mediaInfo=S.getMediaInfo(),h("Signal complete in getSegmentRequestForTime -",i)):n=k(pt(y,e)),s&&a>=0&&(y=e.segmentInfoType===tt.SEGMENT_TIMELINE&&o?y:a),n):null}function L(e){var t=e.representation;t.segments&&r.trigger(m.REPRESENTATION_UPDATED,{sender:this,representation:t})}function M(e){var t=S?S.getType():null,n=S?S.getStreamInfo().manifestInfo.isDynamic:null;if(!e.error&&t===e.mediaType){var i,o=e.segments,s=e.representation,u=[],c=0,d=void 0,f=void 0,p=void 0,h=0;for(l.getAppendingSourceState()&&(w=l.getCachedDurationOffset("offset"),h=o[0].startTime,y=0),d=0,i=o.length;do)&&(n("Start Event "+l+" at "+o),d.duration>0&&(s[l]=d),d.eventStream.schemeIdUri==t&&1==d.eventStream.value?0===d.duration&&0===d.presentationTimeDelta||(v(),f.refreshManifest()):i.trigger(d.eventStream.schemeIdUri,{event:d}),delete e[l])}}return e={addInlineEvents:function(e){if(v(),o={},e)for(var t=0;t0&&r.length===n.length&&i.length>=r.length,u=!0,l=0,c=!0;if(s){for(var d=0,f=r.length;d is not a method!");return{configurable:cr.boolTrue,get:function(){var e=r.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:cr.boolTrue,writable:cr.boolTrue}),e}}}Object.defineProperty(fr,"__esModule",{value:!0}),function(e){e.typeOfFunction="function",e.boolTrue=!0}(cr||(cr={})),fr.bind=pr;var hr=fr.default=pr,yr=Object.defineProperty,mr=Object.getOwnPropertyDescriptor,gr=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.encodeDetails={},!t.mediaType)throw new Error("mediaType is required");if(!or())throw new Error("Worker is not supported");if(t.mediaType===ir.VIDEO){if(!("VideoEncoder"in window))throw new Error("VideoEncoder is not supported")}else if(!("AudioEncoder"in window))throw new Error("AudioEncoder is not supported");this.init(t)}return function(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"init",value:function(e){this.encodeHandler=new lr({name:"encode-worker"}),this.encodeHandler.addEventListener("message",this.onMessage);var t=JSON.parse(JSON.stringify(e)),r=e.parameter.source;t.parameter.source=r,this.sendMsg(dr.INIT,{options:t},r&&[r])}},{key:"sendMsg",value:function(e,t,r){var n;null==(n=this.encodeHandler)||n.postMessage({type:e,data:t},r)}},{key:"onMessage",value:function(e){var t=e.data,r=t.type,n=t.data;switch(r){case dr.ERROR:"function"==typeof this.options.onMuxerError?this.options.onMuxerError(n):console.error(n);break;case dr.FRAME_ENCODE:this.encodeDetails=n,"function"==typeof this.options.onFrameEncoded&&this.options.onFrameEncoded();break;case dr.DATA:"function"==typeof this.options.onFmp4Generated&&this.options.onFmp4Generated(n.data,n.position,n.isFinished)}}},{key:"start",value:function(t){return nr(this,null,l().mark((function r(){var n;return l().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=this.options=Object.assign({},this.options,t),r.prev=1,r.next=4,e.isConfigSupported(n);case 4:if(r.sent){r.next=6;break}throw new Error("Codec is not supported: "+n.parameter.codec);case 6:this.sendMsg(dr.START,{options:t}),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(1),"function"==typeof n.onMuxerError?n.onMuxerError(r.t0):console.error(r.t0);case 12:case"end":return r.stop()}}),r,this,[[1,9]])})))}},{key:"pause",value:function(){this.sendMsg(dr.PAUSE)}},{key:"resume",value:function(){this.sendMsg(dr.RESUME)}},{key:"stop",value:function(){this.sendMsg(dr.STOP)}},{key:"getInfo",value:function(){return this.encodeDetails}},{key:"destroy",value:function(){this.sendMsg(dr.DESTROY),this.encodeHandler&&(this.encodeHandler.removeEventListener("message",this.onMessage),this.encodeHandler.terminate(),this.encodeHandler=null)}}],[{key:"isConfigSupported",value:function(e){return nr(this,null,l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",!(!e.mediaType||!or())&&(e.mediaType===ir.VIDEO?"VideoEncoder"in window&&VideoEncoder.isConfigSupported(e.parameter).then((function(e){return e.supported})):e.mediaType===ir.AUDIO&&"AudioEncoder"in window&&AudioEncoder.isConfigSupported(e.parameter).then((function(e){return e.supported}))));case 1:case"end":return t.stop()}}),t)})))}}])}();!function(e,t,r){for(var n,i=mr(t,r),o=e.length-1;o>=0;o--)(n=e[o])&&(i=n(t,r,i)||i);i&&yr(t,r,i)}([hr],gr.prototype,"onMessage");var vr=gr,br=Object.assign||function(e){for(var t=1;tu?"audio":"video",d=s[c].segments,f=s[c].representation;if("video"!==c&&function(e){var t=e.codecs,r=e.id;return"video"===e.adaptation.type?["avc","hev"].some((function(e){return t.includes(e)}))&&+r<=120:t.includes("mp4a")&&+r<=30280}(f)&&o.getEnableSupplyFrame()&&function(e,t){var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(t,2),n=r[0],i=r[1];return e>n&&e=n||r===1/0||n===1/0)}(l))return;u.load({request:l,progress:function(e){r.trigger(m.LOADING_PROGRESS,{request:l}),e&&r.trigger(m.LOADING_DATA_PROGRESS,{request:l,response:e||null,error:null,sender:s})},success:function(i){try{if(l.completeNCMissingRange){a("CompleteNCMissingRange, "+l.range+" -> "+l.originRange),l.completeNCMissingRange=!1,l.NCInfo.responseData.missingData=[];var s=l.range.split("-"),u=l.originRange.split("-"),f=parseInt(s[0]),p=parseInt(s[1]),h=parseInt(u[0]),y=parseInt(u[1]),g=l.NCInfo.responseData.availableData;g.push({start:f,end:p,data:i}),g.sort((function(e,t){return e.start-t.start}));try{for(var v=new Uint8Array(y-h+1),b=0;b3e7&&(S.code=o.DOWNLOAD_FRAGMENT_ERROR_RANGE,r.trigger(m.FRAGMENT_LOADED_ERROR,S));var A=function(e,t){try{if(e&&t){if(isNaN(e.index)||"MediaSegment"!==e.type)return{verified:!0};var i=n.verify(t);return i.mediaType=e.mediaType,i.quality=e.quality,i.index=e.index,i.id=e.representationId,i&&!i.verified&&(a("VERIFY_SEGMENT_WARNING: "+JSON.stringify(i)),r.trigger(m.VERIFY_SEGMENT_WARNING,i)),i}}catch(e){}return{verified:!1}}(l,i);if(i&&(i.byteLength===_||!_)&&A&&A.verified)1===l.retry||(S.code=o.DOWNLOAD_FRAGMENT_ERROR_RETRY_SUCCESS,r.trigger(m.FRAGMENT_LOADED_ERROR,S)),d(i);else if(S&&S.hasOwnProperty("type")&&delete S.type,A.verified||(i.byteLength===_?S.verifiedType=1:S.verifiedType=2),l.retry&&l.retry>0)S.code=o.DOWNLOAD_FRAGMENT_ERROR,r.trigger(m.FRAGMENT_LOADED_ERROR,S),l.retry--,t(l,{canUseNC:!1,disableSeekDownloadMore:!0});else{if(!A.verified)return void e.errHandler.mediaSourceError("Verify "+l.mediaType+" FMP4 Error",o.MEDIA_FMP4_ERROR);S.code=o.DOWNLOAD_FRAGMENT_ERROR_RETRY_FAILURE,r.trigger(m.FRAGMENT_LOADED_ERROR,S)}}catch(e){console.error("FragmentLoader Load Error: ",e)}},timeout:function(e,t,n){var i={mediaType:e.mediaType,id:e.representationId,index:e.index,range:e.range,received:e.bytesLoaded,url:e.url,startTime:e.startTime,duration:e.duration,total:e.bytesTotal,latency:t,timeout:n,p2pLoadInfo:e.p2pLoadInfo,rType:c&&c.canUseNC?"NC":"XHR",retryTimes:e.retryTimes};i.code=o.DOWNLOAD_FRAGMENT_ERROR_TIMEOUT,r.trigger(m.FRAGMENT_LOADED_ERROR,i),d(void 0,new C(1,Sr))},error:function(e,t,r){d(void 0,new C(1,r,t))},abort:function(e){e&&r.trigger(m.LOADING_ABANDONED,{request:e,mediaType:e.mediaType,sender:s})},connectTimeout:function(e,t,n){if(e){var i={mediaType:e.mediaType,id:e.representationId,index:e.index,range:e.range,received:e.bytesLoaded||0,url:e.url,startTime:e.startTime,duration:e.duration,total:e.bytesTotal,timeout:t,p2pLoadInfo:e.p2pLoadInfo,rType:n?"NC":"XHR",retryTimes:e.retryTimes};i.code=o.CONNECT_FRAGMENT_ERROR_TIMEOUT,n&&(i.code=o.CONNECT_NC_FRAGMENT_ERROR_TIMEOUT),r.trigger(m.FRAGMENT_LOADED_ERROR,i),d(void 0,new C(1,Sr))}},headersReceived:function(e){r.trigger(m.FRAGMENT_LOADING_HEADER_RECEIVED,{request:l,headers:e})},failedQuicklyReport:function(e,t){if(e){var n={mediaType:e.mediaType,id:e.representationId,index:e.index,range:e.range,received:e.bytesLoaded||0,url:e.url,startTime:e.startTime,duration:e.duration,total:e.bytesTotal,rType:t?"NC":"XHR",retryTimes:e.retryTimes};n.code=o.CONNECT_FRAGMENT_ERROR_OFFLINE,r.trigger(m.FRAGMENT_LOADED_ERROR,n)}},params:c})}else d(void 0,new C(2,"request is null"))},abort:function(){u&&u.abort()},reset:function(){u&&(u.abort(),u=null),r.off(m.SEGMENTS_LOADED,c,s)},resetPreloadData:function(){l=e.mediaPlayerModel.getPreloadData(),u.setPreloadData(l)}},l=e.mediaPlayerModel.getPreloadData(),u=jt(t).create({errHandler:e.errHandler,videoModel:e.videoModel,metricsModel:e.metricsModel,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.mediaPlayerModel.getLowLatencyEnabled(),dashMetrics:e.dashMetrics,preloadData:l}),r.on(m.SEGMENTS_LOADED,c,s),s}Ar.__dashjs_factory_name="FragmentLoader";var wr=s.a.getClassFactory(Ar);wr.FRAGMENT_LOADER_ERROR_LOADING_FAILURE=1,wr.FRAGMENT_LOADER_ERROR_NULL_REQUEST=2,s.a.updateClassFactory(Ar.__dashjs_factory_name,wr);var Tr=wr;function Rr(e){e=e||{};var t,r=this.context,i=_(r).getInstance().log,o=p(r).getInstance(),a=e.errHandler,s=e.mediaPlayerModel,u=e.metricsModel,l=e.abrController,c=e.streamController,d=e.videoModel,f=void 0;function h(e){return e&&e.type&&e.type===G.INIT_SEGMENT_TYPE}function y(){for(var e in f)f[e].reset();f={}}function g(e){if(f[e.request.mediaType]===e.sender){var t=e.request,r=e.response,a=h(t),s=t.mediaInfo.streamInfo,u=t.isSupplyFramesRequest;if(e.error&&(e.request.mediaType!==n.AUDIO&&e.request.mediaType!==n.VIDEO&&e.request.mediaType!==n.FRAGMENTED_TEXT||o.trigger(m.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation})),r&&s){var l=function(e,t,r,n){var i=new $t;return i.streamId=r,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=n,i}(r,t,s.id,e.type!==m.FRAGMENT_LOADING_PROGRESS);l.isSupplyChunk=!!u,o.trigger(a?m.INIT_FRAGMENT_LOADED:m.MEDIA_FRAGMENT_LOADED,{chunk:l,fragmentModel:e.sender})}else i("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getModel:function(t){var n=f[t];return n||(n=R(r).create({metricsModel:u,fragmentLoader:Tr(r).create({metricsModel:u,videoModel:d,mediaPlayerModel:s,errHandler:a,requestModifier:wt(r).getInstance(),dashMetrics:e.dashMetrics,abrController:l,streamController:c})}),f[t]=n),n},isInitializationRequest:h,reset:function(){o.off(m.FRAGMENT_LOADING_COMPLETED,g,this),y()}},y(),o.on(m.FRAGMENT_LOADING_COMPLETED,g,t),t}Rr.__dashjs_factory_name="FragmentController";var Cr=s.a.getClassFactory(Rr);function Pr(e){e=e||{} ;var t=this.context,r=_(t).getInstance().log,i=p(t).getInstance(),o=e.manifestModel,a=e.dashManifestModel,s=e.mediaPlayerModel,u=e.manifestUpdater,l=e.adapter,c=e.capabilities,d=e.errHandler,f=e.timelineConverter,h=e.metricsModel,y=e.abrController,g=e.playbackController,v=e.mediaController,b=e.videoModel,E=e.streamController,S=void 0,A=void 0,w=void 0,T=void 0,R=void 0,C=void 0,P=void 0,I=void 0,D=void 0,O=void 0,x=void 0;function k(){for(var e=A?A.length:0,t=0;t2147483647&&(n=2147483.647),r.trigger(m.MANIFEST_UPDATED,{manifest:e}),t("Manifest has been refreshed at "+a+"["+a.getTime()/1e3+"] "),o||y()}function b(){ o&&!c.getScheduleWhilePaused()||(a?y(c.getManifestUpdateRetryInterval()):g())}function E(e){e.error?d.manifestError(e.error.message,e.error.code,"","",e.error.errorCode,e.error.httpCode):v(e.manifest)}function S(){o=!1,y()}function A(){o=!0,h()}function w(){a=!1}return{initialize:function(){f(),r.on(m.STREAMS_COMPOSED,w,this),r.on(m.PLAYBACK_STARTED,S,this),r.on(m.PLAYBACK_PAUSED,A,this),r.on(m.INTERNAL_MANIFEST_LOADED,E,this)},setManifest:function(e){v(e)},refreshManifest:g,setConfig:function(e){e&&(e.manifestModel&&(u=e.manifestModel),e.dashManifestModel&&(l=e.dashManifestModel),e.mediaPlayerModel&&(c=e.mediaPlayerModel),e.manifestLoader&&(s=e.manifestLoader),e.errHandler&&(d=e.errHandler))},reset:function(){r.off(m.PLAYBACK_STARTED,S,this),r.off(m.PLAYBACK_PAUSED,A,this),r.off(m.STREAMS_COMPOSED,w,this),r.off(m.INTERNAL_MANIFEST_LOADED,E,this),f()}}}Dr.__dashjs_factory_name="ManifestUpdater";var Or=s.a.getClassFactory(Dr);function xr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var kr=1e3;function Nr(){var e,t,r,i=void 0,o=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0,f=void 0,p=void 0,h=void 0,y=void 0,m=void 0,g=void 0,v=void 0,b=void 0,_=void 0,E=void 0,S=void 0,A=void 0,w=void 0,T=void 0,R=void 0,C=void 0,P=void 0,I=void 0,D=void 0,O=void 0,x=void 0,k=void 0,N=void 0,L=void 0,M=void 0,F=void 0,U=void 0,B=void 0,V=void 0,W=void 0,j=void 0,H=void 0,Z=void 0,Y=void 0,K=void 0,q=void 0,z=void 0,X=void 0,Q=void 0,J=void 0,$=void 0,ee=void 0,te=void 0,re=void 0,ne=void 0,ie=void 0;function oe(e){var t=void 0;for(t=0;t12&&ae(!1)},getP2pSDKErrorCount:function(){return W},addBufferingCount:function(){j+=1},getBufferingCount:function(){return j},setExternalMediaLoader:function(e){J=e},getExternalMediaLoader:function(){return J},getFactorByBufferLevel:function(e){return.7},setLastStartSeekTime:function(e){H=e},getLastStartSeekTime:function(){return H},getStartPlaybackTime:function(){return Z},setStartPlaybackTime:function(e){Z=e},resetStartAndSeekTime:function(){H=0,Z=0},reset:function(){},getAudioTrackId:function(){return Y},setAudioTrackId:function(e){Y=e},getEnableMultipleAudioTracks:function(){return K},setEnableMultipleAudioTracks:function(e){K=e},getAudioTrackIds:function(){return q},setAudioTrackIds:function(e){e&&Array.isArray(e)&&(q=e)},setDeviationReset:function(e){z=e},getDeviationReset:function(e){return z},setRetryTimes:function(e){X=e},getRetryTimes:function(){return X},setPlayAt:function(e){Q=e},getPlayAt:function(){return Q},getUseNC:function(){return $},setUseNC:function(e){$=e},getUseP2P:function(){return ie},setUseP2P:function(e){ie=e},setEnableSupplyFrame:function(e){te=e},getEnableSupplyFrame:function(){return te},ableToSupplyFrame:function(){return re&&te&&!ne},setCanSupplyFrame:function(e){re=e},getCanSupplyFrame:function(){return re},setSupplyFrameFailed:function(e){ne=e},getSupplyFrameFailed:function(){return ne}},a=[],o=!1,i=!0,l=!0,T=n.ABR_STRATEGY_DYNAMIC,R=!0,P=!1,p={enabled:!0,ttl:36e4},h={enabled:!0,ttl:36e4},s=4,u=void 0,c=20,d=80,f=10,y=NaN,m=30,g=60,v=600,b=.2,_=.6,E=1e4,w=50,x=!1,k=1.8,M=100,C={default:!1},I=[],D=n.MOVING_AVERAGE_SLIDING_WINDOW,N=!1,F=!1,z=!1,ne=!1,re=!1,U={time:0,duration:0,offset:0},xr(t={},G.MPD_TYPE,3),xr(t,G.XLINK_EXPANSION_TYPE,1),xr(t,G.MEDIA_SEGMENT_TYPE,3),xr(t,G.INIT_SEGMENT_TYPE,3),xr(t,G.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),xr(t,G.INDEX_SEGMENT_TYPE,3),xr(t,G.OTHER_TYPE,3),S=t,xr(r={},G.MPD_TYPE,500),xr(r,G.XLINK_EXPANSION_TYPE,500),xr(r,G.MEDIA_SEGMENT_TYPE,kr),xr(r,G.INIT_SEGMENT_TYPE,kr),xr(r,G.BITSTREAM_SWITCHING_SEGMENT_TYPE,kr),xr(r,G.INDEX_SEGMENT_TYPE,kr),xr(r,G.OTHER_TYPE,kr),A=r,(O={})[n.VIDEO]=25,O[n.AUDIO]=5,B=!0,V=!0,W=0,j=0,H=0,Z=0,J=null,Y=1,K=!1,q=[],X=0,Q=0,$=!0,ie=!0,e} Nr.__dashjs_factory_name="MediaPlayerModel";var Lr=s.a.getSingletonFactory(Nr);Lr.DEFAULT_UTC_TIMING_SOURCE={scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso"},s.a.updateSingletonFactory(Nr.__dashjs_factory_name,Lr);var Mr=Lr,Fr=new(function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=f(t)&&"function"!=typeof t?e:t}(this,e.call(this));return r.AST_IN_FUTURE="astInFuture",r.BUFFER_EMPTY="bufferStalled",r.BUFFER_LOADED="bufferLoaded",r.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",r.ERROR="error",r.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",r.FRAGMENT_LOADING_HEADER_RECEIVED="fragmentLoadingHeaderReceived",r.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",r.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",r.FRAGMENT_P2P_LOAD_INFO="fragmentP2pLoadInfo",r.CDN_LOAD_INFO="cdnLoadInfo",r.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",r.FRAGMENT_LOADED_ERROR="fragmentLoadedError",r.PCDN_LOADED_ERROR="pcdnLoadedError",r.LOG="log",r.MANIFEST_LOADED="manifestLoaded",r.METRICS_CHANGED="metricsChanged",r.METRIC_CHANGED="metricChanged",r.METRIC_ADDED="metricAdded",r.METRIC_UPDATED="metricUpdated",r.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",r.PERIOD_SWITCH_STARTED="periodSwitchStarted",r.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",r.QUALITY_CHANGE_DOWNLOADED="qualityChangeDownloaded",r.QUALITY_CHANGE_RENDERED="qualityChangeRendered",r.TRACK_CHANGE_RENDERED="trackChangeRendered",r.SOURCE_INITIALIZED="sourceInitialized",r.STREAM_INITIALIZED="streamInitialized",r.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",r.TEXT_TRACKS_ADDED="allTextTracksAdded",r.TEXT_TRACK_ADDED="textTrackAdded",r.TTML_PARSED="ttmlParsed",r.TTML_TO_PARSE="ttmlToParse",r.CAN_PLAY="canPlay",r.PLAYBACK_ENDED="playbackEnded",r.PLAYBACK_ERROR="playbackError",r.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",r.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",r.PLAYBACK_PAUSED="playbackPaused",r.PLAYBACK_PLAYING="playbackPlaying",r.PLAYBACK_PROGRESS="playbackProgress",r.PLAYBACK_RATE_CHANGED="playbackRateChanged",r.PLAYBACK_SEEKED="playbackSeeked",r.PLAYBACK_SEEKING="playbackSeeking",r.PLAYBACK_SEEK_ASKED="playbackSeekAsked",r.PLAYBACK_STALLED="playbackStalled",r.PLAYBACK_STARTED="playbackStarted",r.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",r.PLAYBACK_WAITING="playbackWaiting",r.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",r.DELAY_TO_APPEND_TO_BUFFER="delayToAppendBuffer",r.GET_NEXT_FRAGMENT="getNextFragment",r.APPENDING_NEXT_SOURCE="appendingNextSource",r.APPENDED_NEXT_SOURCE="appendedNextSource",r.APPENDED_NEXT_SOURCE_DURATION_CHANGED="appendedNextSourceDurationChanged",r.START_OFFSET_TIME_WARNING="startOffsetTimeWarning",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+f(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(h.a));function Ur(){var e=this.context,t=_(e).getInstance().log,r=p(e).getInstance(),i=at(e).getInstance(),o=void 0,a=void 0,s=void 0,u=void 0,l=void 0,c=void 0,d=void 0;function f(e){a=e}function h(e){o=e}function y(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t=void 0,r=void 0,n=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&(parseInt(n[6],10)||0),n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]&&(r=60*parseInt(n[9],10)+parseInt(n[10],10),t+=("+"===n[8]?-1:1)*r*60*1e3),new Date(t).getTime()}(e)),t}function g(e){return Date.parse(e)}function v(e){return Date.parse(e)}function b(e,t,r){r()}function E(e,t,r){var n=y(e);isNaN(n)?r():t(n)}function S(e,t,r,n,o){var a,s,u=!1,l=new XMLHttpRequest,c=o?G.HEAD:G.GET,f=t.match(/\S+/g);if(t=f.shift(),a=function(){u||(u=!0,f.length?S(e,f.join(" "),r,n,o):n())},s=function(){var t=void 0,n=void 0;200===l.status&&(t=o?l.getResponseHeader("Date"):l.response,n=e(t),isNaN(n)||(r(n),u=!0))},i.isRelative(t)){var p=d.resolve();p&&(t=i.resolve(t,p.url))}l.open(c,t),l.timeout=5e3,l.onload=s,l.onloadend=a,l.send()}function A(e,t,r){S(v,e,t,r,!0)}function w(e,t,n){f(!1),r.trigger(m.TIME_SYNCHRONIZATION_COMPLETED,{time:t,offset:n,error:e?new C(1):null})}function T(e,r){var i=r||0,a=e[i],d=function(e,t){var r,i,a,u=!e||!t;u&&s?(r=l.getReadOnlyMetricsFor(n.STREAM),a=null!==(i=c.getLatestMPDRequestHeaderValueByID(r,"Date"))?new Date(i).getTime():Number.NaN,isNaN(a)?w(!0):(h(a-(new Date).getTime()),w(!1,a/1e3,o))):w(u,e,t)};f(!0),a?u.hasOwnProperty(a.schemeIdUri)?u[a.schemeIdUri](a.value,(function(e){var r=(new Date).getTime(),n=e-r;h(n),t("Local time: "+new Date(r)),t("Server time: "+new Date(e)),t("Difference (ms): "+n),d(e,n)}),(function(){T(e,i+1)})):T(e,i+1):(h(0),d())}return{initialize:function(e,t){s=t,o=0,a=!1,u={"urn:mpeg:dash:utc:http-head:2014":A,"urn:mpeg:dash:utc:http-xsdate:2014":S.bind(null,y),"urn:mpeg:dash:utc:http-iso:2014":S.bind(null,g),"urn:mpeg:dash:utc:direct:2014":E,"urn:mpeg:dash:utc:http-head:2012":A,"urn:mpeg:dash:utc:http-xsdate:2012":S.bind(null,y),"urn:mpeg:dash:utc:http-iso:2012":S.bind(null,g),"urn:mpeg:dash:utc:direct:2012":E,"urn:mpeg:dash:utc:http-ntp:2014":b,"urn:mpeg:dash:utc:ntp:2014":b,"urn:mpeg:dash:utc:sntp:2014":b},a||T(e)},getOffsetToDeviceTimeMs:function(){return o},setConfig:function(e){e&&(e.metricsModel&&(l=e.metricsModel),e.dashMetrics&&(c=e.dashMetrics),e.baseURLController&&(d=e.baseURLController))},reset:function(){f(!1)}}}Ur.__dashjs_factory_name="TimeSyncController";var Br=s.a.getSingletonFactory(Ur);Br.TIME_SYNC_FAILED_ERROR_CODE=1,Br.HTTP_TIMEOUT_MS=5e3,s.a.updateSingletonFactory(Ur.__dashjs_factory_name,Br);var Gr=Br,Vr=r(14),Wr=r.n(Vr);function jr(){return{areEqual:function(e,t){return Wr()(e,t)}}}jr.__dashjs_factory_name="ObjectUtils";var Hr=s.a.getSingletonFactory(jr),Zr=NaN,Yr=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:r||Zr},this.children=[]};function Kr(){var e,t=void 0,r=void 0,n=this.context,i=Hr(n).getInstance();function o(e,t,n){var o=r.getBaseURLsFromElement(n);e[t]?i.areEqual(o,e[t].data.baseUrls)||(e[t].data.baseUrls=o,e[t].data.selectedIdx=Zr):e[t]=new Yr(o)}function a(e,r){var n=r||t;e(n.data),n.children&&n.children.forEach((function(t){return a(e,t)}))}function s(){t=new Yr}return e={reset:s,update:function(e){!function(e){var n=r.getBaseURLsFromElement(e);i.areEqual(n,t.data.baseUrls)||(t.data.baseUrls=n,t.data.selectedIdx=Zr),e.Period_asArray&&e.Period_asArray.forEach((function(e,n){o(t.children,n,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){o(t.children[n].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(r.getRepresentationSortFunction()).forEach((function(e,r){o(t.children[n].children[i].children,r,e)}))}))}))}(e)},getForPath:function(e){var r=t,n=[r.data];return e&&e.forEach((function(e){(r=r.children[e])&&n.push(r.data)})),n.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){a((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=Zr)}))},setConfig:function(e){e.dashManifestModel&&(r=e.dashManifestModel)}},s(),e}Kr.__dashjs_factory_name="BaseURLTreeModel";var qr=s.a.getClassFactory(Kr);function zr(e){var t;return e=e||{},t={select:function(e){return e&&function(e){var t=0,r=[],n=0,i=void 0,o=void 0;if(o=e.sort((function(e,t){var r=e.dvb_priority-t.dvb_priority;return isNaN(r)?0:r})).filter((function(e,t,r){return!t||r[0].dvb_priority&&e.dvb_priority&&r[0].dvb_priority===e.dvb_priority})),o.length)return o.length>1&&(o.forEach((function(e){t+=e.dvb_weight,r.push(t)})),i=Math.floor(Math.random()*(t-1)),r.every((function(e,t){ return n=t,!(i0&&void 0!==arguments[0]?arguments[0]:void 0;if(e&&window.BwpElement&&e instanceof window.BwpElement&&window.BwpMediaSource)return new BwpMediaSource;var t="WebKitMediaSource"in window;return"MediaSource"in window?new MediaSource:t?new WebKitMediaSource:null},attachMediaSource:function(e,t){var r;return r=window.BwpMediaSource&&e instanceof window.BwpMediaSource&&e.createObjectURL?e.createObjectURL():window.URL.createObjectURL(e),t.setSource(r),r},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(t,r){return t.duration!=r&&function(e,t){var r=void 0,n=function(){for(var t=!1,r=0;r=0&&t=i[s].start&&e<=i[s].end){a=s,o=!0;break}if(o){var u=i.slice(a);if(u[0].end-e<.5){if(1===u.length)return;for(var l=1;l=1)return t("Gap has been prdiected,seek from ",e," to ",u[l].start),U.seek(u[l].start),void r.trigger(m.PREDICT_SEEK,{currentTime:e,bufferRanges:i,destination:u[l].start});U.seek(u[u.length-1].start)}}}}()}}function $(){if(!(!B.getJumpGaps()||!I||0===I.getProcessors().length||U.isSeeking()||G||k||N||L)&&++K>=2){var e=U.getTime();X===e?function(e){for(var n=I.getProcessors(),i=B.getSmallGapLimit(),o=void 0,a=0;a0){var d=l-e;d>0&&d<=i&&(void 0===o||l>o)&&(o=l)}}}var f=U.getTimeToStreamEnd();if(void 0===o&&!isNaN(f)&&f0)if(!isNaN(f)&&o>=e+f){t("Jumping media gap (discontinuity) at time ",e,". Jumping to end of the stream");var p=F.getVideoBufferRanges();if(p&&p.length){var h=p[p.length-1].end;!h||q||F.getEnded()||(q=!0,U.seek(h+1),r.trigger(m.JUMP_MEDIA_GAP,{time:e,seekToPosition:h+1,toEnd:!0}),t("Stuck in ending. Jumping to end of the stream."))}}else r.trigger(m.JUMP_MEDIA_GAP,{time:e,seekToPosition:o,toEnd:!1}),t("Jumping media gap (discontinuity) at time ",e,". Jumping to time position",o),U.seek(o)}(e):X=e,K=0}}function ee(e){var t=ae(e.seekTime);Y&&(ne(),Z=!1),t&&t!==I?(ve(qe.END_OF_PERIOD_STOP_REASON),ue(I,t,e.seekTime)):ve(qe.USER_REQUEST_STOP_REASON),be(Ke.SEEK_START_REASON)}function te(){t("[StreamController][onPlaybackStarted]"),V?(V=!1,be(Ke.INITIAL_PLAYOUT_START_REASON)):G&&(G=!1,be(Ke.RESUME_FROM_PAUSE_START_REASON),ie())}function re(e){t("[StreamController][onPlaybackPaused]"),e.ended||(G=!0,ve(qe.USER_REQUEST_STOP_REASON),ie())}function ne(){t("[StreamController][toggleEndPeriodTimer] stop end period timer."),clearTimeout(Y),Y=void 0}function ie(){if(Z)if(Y)ne();else{var e=U.getTimeToStreamEnd(),n=e>0?1e3*e:0;t("[StreamController][toggleEndPeriodTimer] start-up of timer to notify PLAYBACK_ENDED event. It will be triggered in "+n+" milliseconds"),Y=setTimeout((function(){r.trigger(m.PLAYBACK_ENDED)}),n)}}function oe(){var e=Ee().isLast,r=B.getEndOfStreamState();M&&e?(t("[StreamController][onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),r&&g.signalEndOfStream(M)):M&&void 0===Y&&(t("[StreamController][onStreamBufferingCompleted] end of period detected"),Z=!0,!1===G&&ie())}function ae(e){var t=0,r=null,n=P.length;n>0&&(t+=P[0].getStartTime());for(var i=0;i>>0).toString(16).toUpperCase()+")"),t("Video Element Error: "+r),e.error&&t(e.error),R.mediaSourceError(r,n,i),Te()}}function Ee(){return I?I.getStreamInfo():null}function Se(){if(!(l&&l.hasOwnProperty("load")&&C&&C.hasOwnProperty("initialize")&&C.hasOwnProperty("reset")&&C.hasOwnProperty("getClientTimeOffset")))throw new Error("setConfig function has to be called previously")}function Ae(e){isNaN(e.newDuration)||de(e.newDuration)}function we(){P=[],D=null,k=!1,I=null,N=!1,L=!1,j=void 0,H=void 0,V=!0,G=!1,x=!0,W=null,Y=void 0,Z=!1,K=0,q=!1}function Te(){Se(),z&&(clearTimeout(z),z=null),v.reset(),ve(N||L?qe.FAILURE_STOP_REASON:qe.USER_REQUEST_STOP_REASON);for(var e=0,t=P?P.length:0;e/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function n(e,t,r,n){for(var i=0;i0&&n(e.arrayAccessFormPaths,t,r,i)&&(t[r]=[t[r]])}function o(e){var t=e.split(/[-T:+Z]/g),r=new Date(t[0],t[1]-1,t[2]),n=t[5].split(".");if(r.setHours(t[3],t[4],n[0]),n.length>1&&r.setMilliseconds(n[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),r.setMinutes(r.getMinutes()-i-r.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())));return r}function a(t,r,i,o){return!(1==r&&e.xmlElementsFilter.length>0)||n(e.xmlElementsFilter,t,i,o)}function s(r,u){if(9==r.nodeType){for(var l=new Object,c=r.childNodes,d=0;d0){var a=i.split(".#")[0];return n(e.datetimeAccessFormPaths,t,r,a)?o(t):t}return t}(l.__text,h,u+"."+h)),null!=l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"==e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0==l.__cnt&&"text"==e.emptyNodeForm?l="":1==l.__cnt&&null!=l.__text?l=l.__text:1!=l.__cnt||null==l.__cdata||e.keepCData?l.__cnt>1&&null!=l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==l.__text||""==l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null==l.__text&&null==l.__cdata||(l.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),l}if(3==r.nodeType||4==r.nodeType)return r.nodeValue}function u(t,n,i,o){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var s=0;s":">")}function l(e,t){return""}function c(t,r){return"property"==e.arrayAccessForm&&(i="_asArray",-1!==(n=r.toString()).indexOf(i,n.length-8))||0==r.toString().indexOf(e.attributePrefix)||0==r.toString().indexOf("__")||t[r]instanceof Function;var n,i}function d(e){var t=0;if(e instanceof Object)for(var r in e)c(e,r)||t++;return t}function f(t,r,i){return 0==e.jsonPropertiesFilter.length||""==i||n(e.jsonPropertiesFilter,t,r,i)}function p(t){var r=[];if(t instanceof Object)for(var n in t)-1==n.toString().indexOf("__")&&0==n.toString().indexOf(e.attributePrefix)&&r.push(n);return r}function h(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=r(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=r(t):n+=t),n}function y(e,t){return""===e?t:e+"."+t}function m(e,t,r,n){var i="";if(0==e.length)i+=u(e,t,r,!0);else for(var o=0;o0)for(var n in e)if(!c(e,n)&&(""==t||f(e,n,y(t,n)))){var i=e[n],o=p(i);null==i||null==i?r+=u(i,n,o,!0):i instanceof Object?i instanceof Array?r+=m(i,n,o,t):i instanceof Date?(r+=u(i,n,o,!1),r+=i.toISOString(),r+=l(i,n)):d(i)>0||null!=i.__text||null!=i.__cdata?(r+=u(i,n,o,!1),r+=g(i,y(t,n)),r+=l(i,n)):r+=u(i,n,o,!0):(r+=u(i,n,o,!1),r+=h(i),r+=l(i,n))}return r+h(e)}void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text", void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1),this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var r=new window.DOMParser;try{(t=r.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?o(e):e},this.xml2json=function(e){return s(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return g(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},gn="onLoad",vn="Period",bn="AdaptationSet",_n="EventStream";function En(e){e=e||{};var t=this.context,r=p(t).getInstance(),n=at(t).getInstance(),i=void 0,o=void 0,a=void 0,s=void 0,u=void 0,l=void 0;function c(e,t,r){var i={},o=void 0,a=void 0;i.elements=e,i.type=t,i.resolveType=r,0===i.elements.length&&f(i);for(var s=0;s")+2),n=r.resolvedContent.substr(0,i)+""+r.resolvedContent.substr(i)+"",r.resolvedContent=u.xml_str2json(n)}(function(e){var t=void 0;for(t=0;t=0;o--){if(n=(r=e.elements[o]).type+"_asArray",r.resolvedContent){if(r.resolvedContent)for(u=0;u0&&a.run(s)}(e),"onActuate"===e.resolveType&&r.trigger(m.XLINK_READY,{manifest:s}),e.resolveType===gn)switch(e.type){case vn:for(n=0;n=0;a--)(o=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===o["xlink:href"]&&e.splice(a,1);for(a=0;a=0}return!1}),(function(e){return String(e)})))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+f(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}), t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Cn),Dn=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,On=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=f(t)&&"function"!=typeof t?e:t}(this,e.call(this,(function(e){for(var t=[tt.MIN_BUFFER_TIME,tt.MEDIA_PRESENTATION_DURATION,tt.MINIMUM_UPDATE_PERIOD,tt.TIMESHIFT_BUFFER_DEPTH,tt.MAX_SEGMENT_DURATION,tt.MAX_SUBSEGMENT_DURATION,n.SUGGESTED_PRESENTATION_DELAY,tt.START,n.START_TIME,tt.DURATION],r=t.length,i=0;i-1?(f&&(r=f.createMssParser(),f.registerEvents()),r):e.indexOf("MPD")>-1?jn(t).create():r}(s)),null!==c){l.setMatchers(c.getMatchers()),l.setIron(c.getIron());try{g=c.parse(s,d)}catch(t){return void r.trigger(m.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new C(1,"Failed parsing manifest : "+(p?e:"MPD String"),null,o.MANIFEST_RESOLVE_ERROR)})}g?(g.url=h||e,g.originalUrl||(g.originalUrl=g.url),g.hasOwnProperty(n.LOCATION)&&(y=i.parseBaseUrl(g.Location_asArray[0]),a("BaseURI set by Location to: "+y)),g.baseUri=function(e,t){return t?e&&e.replace(/http:\/\//g,"https://"):e}(y,d),g.loadedTime=new Date,l.resolveManifestOnLoad(g)):r.trigger(m.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new C(1,"parsing failed",null,o.MANIFEST_ERROR)})}else r.trigger(m.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new C(1,"Failed detecting manifest type or manifest type unsupported : "+(p?e:"MPD String"),null,o.MANIFEST_TYPE_ERROR)})}}return s={load:function(e,t){if(d=t,!e||"string"!=typeof e||0!==e.indexOf("http")&&0!==e.indexOf("/"))g("",e,0,"");else{var n=new fn(e,G.MPD_TYPE);u.load({request:n,success:function(t,r,n){g(e,t,0,n)},error:function(t,n,i,a){r.trigger(m.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new C(2,"Failed loading manifest: "+e+", "+i,null,o.MANIFEST_DOWNLOAD_ERROR,a)})}})}},reset:function(){r.off(m.XLINK_READY,y,s),l&&(l.reset(),l=null),u&&(u.abort(),u=null),f&&f.reset()}},r.on(m.XLINK_READY,y,s),u=jt(t).create({errHandler:h,videoModel:e.videoModel,metricsModel:e.metricsModel,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier}),l=Sn(t).create({errHandler:h,videoModel:e.videoModel,metricsModel:e.metricsModel,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier}),c=null,s}Kn.__dashjs_factory_name="ManifestLoader";var qn=s.a.getClassFactory(Kn);qn.MANIFEST_LOADER_ERROR_PARSING_FAILURE=1,qn.MANIFEST_LOADER_ERROR_LOADING_FAILURE=2,s.a.updateClassFactory(Kn.__dashjs_factory_name,qn);var zn=qn;function Xn(){var e,t=void 0;return e={supportsMediaSource:function(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t},supportsEncryptedMedia:function(){return t},supportsCodec:function(e){return!(!("MediaSource"in window)||!MediaSource.isTypeSupported(e))||!(!("WebKitMediaSource"in window)||!WebKitMediaSource.isTypeSupported(e))||!!(window.__ENABLE_WASM_PLAYER__&&"BwpMediaSource"in window&&BwpMediaSource.isTypeSupported(e))},setEncryptedMediaSupported:function(e){t=e}},t=!1,e}Xn.__dashjs_factory_name="Capabilities";var Qn=s.a.getSingletonFactory(Xn);function Jn(){var e=this.context,t=p(e).getInstance(),r=void 0;return{getValue:function(){return r},setValue:function(e){r=e,e&&t.trigger(m.MANIFEST_LOADED,{data:e})}}}Jn.__dashjs_factory_name="ManifestModel";var $n=s.a.getSingletonFactory(Jn),ei=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]},ti=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tcpid=null,this.dest=null,this.topen=null,this.tclose=null,this.tconnect=null},ri=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null},ni=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null},ii=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=Ue.BUFFER_EMPTY},oi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null},ai=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null};function si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ui=function e(){si(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},li=function e(){si(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},ci=function e(){si(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null},di=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},fi=function e(){!function(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]};function pi(){var e,t=this.context,r=p(t).getInstance(),o=void 0;function a(){r.trigger(m.METRICS_CHANGED)}function s(e){r.trigger(m.METRIC_CHANGED,{mediaType:e}),a()}function u(e,t,n){r.trigger(m.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),s(e)}function l(e,t,n){r.trigger(m.METRIC_ADDED,{mediaType:e,metric:t,value:n}),s(e)}function c(e){var t=void 0;return o.hasOwnProperty(e)?t=o[e]:(t=new ei,o[e]=t),t}function d(e,t,r){var n=c(e);n[t].push(r),n[t].length>1e3&&n[t].shift()}function f(e,t,r){d(e,t,r),l(e,t,r)}return e={clearCurrentMetricsForType:function(e){delete o[e],s(e)},clearAllCurrentMetrics:function(){o={},a()},getReadOnlyMetricsFor:function(e){return o.hasOwnProperty(e)?o[e]:null},getMetricsFor:c,addTcpConnection:function(e,t,r,n,o,a){var s=new ti;return s.tcpid=t,s.dest=r,s.topen=n,s.tclose=o,s.tconnect=a,f(e,i.TCP_CONNECTION,s),s},addHttpRequest:function e(t,r,n,o,a,s,u,l,c,d,p,h,y,m){var g=new G;return a&&a!==o&&(e(t,null,n,o,null,null,u,l,null,null,null,h,null,null),g.actualurl=a),g.tcpid=r,g.type=n,g.url=o,g.range=u,g.trequest=l,g.tresponse=c,g.responsecode=p,g._tfinish=d,g._stream=t,g._mediaduration=h,g._responseHeaders=y,g._serviceLocation=s,m?m.forEach((function(e){!function(e,t,r,n){var i=new V;i.s=t,i.d=r,i.b=n,e.trace.push(i),e.interval||(e.interval=0),e.interval+=r}(g,e.s,e.d,e.b)})):(delete g.interval,delete g.trace),f(t,i.HTTP_REQUEST,g),g},addRepresentationSwitch:function(e,t,r,n,o){var a=new ri;return a.t=t,a.mt=r,a.to=n,o?a.lto=o:delete a.lto,f(e,i.TRACK_SWITCH,a),a},addBufferLevel:function(e,t,r){var n=new ni;return n.t=t,n.level=r,f(e,i.BUFFER_LEVEL,n),n},addBufferState:function(e,t,r){var n=new ii;return n.target=r,n.state=t,f(e,i.BUFFER_STATE,n),n},addDVRInfo:function(e,t,r,n){var o=new oi;return o.time=t,o.range=n,o.manifestInfo=r,f(e,i.DVR_INFO,o),o},addDroppedFrames:function(e,t){var r=new ai,n=c(e).DroppedFrames;return r.time=t.creationTime,r.droppedFrames=t.droppedVideoFrames,n.length>0&&n[n.length-1]==r?n[n.length-1]:(f(e,i.DROPPED_FRAMES,r),r)},addSchedulingInfo:function(e,t,r,n,o,a,s,u,l){var c=new di;return c.mediaType=e,c.t=t,c.type=r,c.startTime=n,c.availabilityStartTime=o,c.duration=a,c.quality=s,c.range=u,c.state=l,f(e,i.SCHEDULING_INFO,c),c},addRequestsQueue:function(e,t,r){var n=new fi;n.loadingRequests=t,n.executedRequests=r,c(e).RequestsQueue=n,l(e,i.REQUESTS_QUEUE,n)},addManifestUpdate:function(e,t,r,o,a,s,u,c,f,p){var h=new ui;return h.mediaType=e,h.type=t,h.requestTime=r,h.fetchTime=o,h.availabilityStartTime=a,h.presentationStartTime=s,h.clientTimeOffset=u,h.currentTime=c,h.buffered=f,h.latency=p,d(n.STREAM,i.MANIFEST_UPDATE,h),l(e,i.MANIFEST_UPDATE,h),h},updateManifestUpdateInfo:function(e,t){if(e){for(var r in t)e[r]=t[r];u(e.mediaType,i.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,r,n,o){if(e){var a=new li;return a.id=t,a.index=r,a.start=n,a.duration=o,e.streamInfo.push(a),u(e.mediaType,i.MANIFEST_UPDATE_STREAM_INFO,e),a}return null},addManifestUpdateRepresentationInfo:function(e,t,r,n,o,a,s,l){if(e){var c=new ci;return c.id=t,c.index=r,c.streamIndex=n,c.mediaType=o,c.startNumber=s,c.fragmentInfoType=l,c.presentationTimeOffset=a,e.representationInfo.push(c),u(e.mediaType,i.MANIFEST_UPDATE_TRACK_INFO,e),c}return null},addPlayList:function(e){var t=n.STREAM;return e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,f(t,i.PLAY_LIST,e),e},addDVBErrors:function(e){return f(n.STREAM,i.DVB_ERRORS,e),e},setConfig:function(e){e&&e.adapter&&e.adapter}},o={},e}pi.__dashjs_factory_name="MetricsModel";var hi=s.a.getSingletonFactory(pi);function yi(){var e,t=void 0,r=void 0,n=void 0,i=void 0,o=this.context,a=_(o).getInstance().log,s=p(o).getInstance(),u=[];function l(){t&&(t.playbackRate=i||1,t.removeEventListener("canplay",l))}function c(){return u.length>0}function d(){if(t&&c()&&0===t.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),t.dispatchEvent(e)}}function f(){return t?t.buffered:null}return e={initialize:function(){s.on(m.PLAYBACK_PLAYING,d,this)},setCurrentTime:function(e){if(t){if(t.currentTime==e)return;try{t.currentTime=e}catch(r){0===t.readyState&&r.code===r.INVALID_STATE_ERR&&setTimeout((function(){t.currentTime=e}),400)}}},play:function(){if(t){t.autoplay=!0;var e=t.play();return e&&"undefined"!=typeof Promise&&e instanceof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&s.trigger(m.PLAYBACK_NOT_ALLOWED),a("Caught pending play exception - continuing ("+e+")")})),e}},isPaused:function(){return t?t.paused:null},pause:function(){t&&(t.pause(),t.autoplay=!1)},isSeeking:function(){return t?t.seeking:null},getTime:function(){return t?t.currentTime:null},getPlaybackRate:function(){return t?t.playbackRate:null},getPlayedRanges:function(){return t?t.played:null},getEnded:function(){return t?t.ended:null},setStallState:function(e,r){!function(e,r){r?function(e){var r=void 0;null===e||t.seeking||-1!==u.indexOf(e)||(u.push(e),t&&1===u.length&&((r=document.createEvent("Event")).initEvent("waiting",!0,!1),i=t.playbackRate,t.dispatchEvent(r)))}(e):function(e){var r,n=u.indexOf(e),o=void 0;null!==e&&(-1!==n&&u.splice(n,1),t&&!1===c()&&0===t.playbackRate&&(r=i||1,t&&(t.readyState<=2&&r>0?t.addEventListener("canplay",l):t.playbackRate=r),t.paused||((o=document.createEvent("Event")).initEvent("playing",!0,!1),t.dispatchEvent(o))))}(e)}(e,r)},getElement:function(){return t},setElement:function(e){if(null!=e&&(!e||!e.nodeName||"VIDEO"!==e.nodeName&&"AUDIO"!==e.nodeName&&"BWP-VIDEO"!==e.nodeName))throw"element is not video or audio DOM type!";(t=e)&&(t.preload="auto")},setSource:function(e){t&&(e?t.src=e:(t.removeAttribute("src"),t.load()))},getSource:function(){return t?t.src:null},getVideoContainer:function(){return n},setVideoContainer:function(e){n=e},getTTMLRenderingDiv:function(){return r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},getPlaybackQuality:function(){if(!t)return null;var e="webkitDroppedFrameCount"in t&&"webkitDecodedFrameCount"in t,r=null;return"getVideoPlaybackQuality"in t?r=t.getVideoPlaybackQuality():e&&(r={droppedVideoFrames:t.webkitDroppedFrameCount,totalVideoFrames:t.webkitDroppedFrameCount+t.webkitDecodedFrameCount,creationTime:new Date}),r},addEventListener:function(e,r){t&&t.addEventListener(e,r)},removeEventListener:function(e,r){t&&t.removeEventListener(e,r)},getReadyState:function(){return t?t.readyState:NaN},getBufferRange:f,getClientWidth:function(){return t?t.clientWidth:NaN},getClientHeight:function(){return t?t.clientHeight:NaN},getTextTracks:function(){return t?t.textTracks:[]},getTextTrack:function(e,r,n,i,o){if(t)for(var a=0;a=i.getLastMediaSettingsCachingInfo().ttl||!1,s=parseFloat(o.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(u(_i,Ei)&&t){var r=vi.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:s()}))}catch(e){n(e.message)}}},getSavedMediaSettings:function(e){if(l(),!u(_i,Si))return null;var t=null,r=bi.replace(/\?/,e);try{var n=JSON.parse(localStorage.getItem(r))||{},o=(new Date).getTime()-parseInt(n.timestamp,10)>=i.getLastMediaSettingsCachingInfo().ttl||!1;t=n.settings,o&&(localStorage.removeItem(r),t=null)}catch(e){return null}return t},setSavedMediaSettings:function(e,t){if(u(_i,Si)){var r=bi.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:s()}))}catch(e){n(e.message)}}}},a(_i)&&gi.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n(e.message)}}})),t}Ai.__dashjs_factory_name="DOMStorage";var wi=s.a.getSingletonFactory(Ai),Ti=r(5),Ri=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},Ci=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null},Pi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0},Ii=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null},Di=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN},Oi=r(15),xi=r.n(Oi);function ki(){var e,t=void 0,r=void 0,i=void 0;function o(e,t){return t&&e?t.getRepresentationForQuality(e.quality):null}function a(e){return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i[e.streamInfo.id]?i[e.streamInfo.id][e.index]:null}function s(e,t){for(var r=t.length,n=0;n0?e.segments[0].duration:NaN),r.MSETimeOffset=e.MSETimeOffset,r.useCalculatedLiveEdgeTime=e.useCalculatedLiveEdgeTime,r.mediaInfo=l(e.adaptation),r}function l(e){var r,n=new Ci,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];return n.id=e.id,n.index=e.index,n.type=e.type,n.streamInfo=d(e.period),n.representationCount=t.getRepresentationCount(i),n.lang=t.getLanguageForAdaptation(i),r=t.getViewpointForAdaptation(i),n.viewpoint=r?r.value:void 0,n.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,r=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==xi.a&&(r=t?"cea-608:"+t:"cea-608",n.embeddedCaptions=!0),r})),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),n.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),n.codec=t.getCodec(i),n.mimeType=t.getMimeType(i),n.contentProtection=t.getContentProtectionData(i),n.bitrateList=t.getBitrateListForAdaptation(i),n.contentProtection&&n.contentProtection.forEach((function(e){e.KID=t.getKID(e)})),n.isText=t.getIsTextTrack(n.mimeType),n}function c(e,t,r){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=n.EMBEDDED_TEXT,e.codec="cea-608-in-SEI",e.isText=!0,e.isEmbedded=!0,e.lang=r,e.roles=["caption"]}function d(e){var r,n,i=new Pi;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(r=e.mpd,(n=new Ii).DVRWindowSize=r.timeShiftBufferDepth,n.loadedTime=r.manifest.loadedTime,n.availableFrom=r.availabilityStartTime,n.minBufferTime=r.manifest.minBufferTime,n.maxFragmentDuration=r.maxSegmentDuration,n.duration=t.getDuration(r.manifest),n.isDynamic=t.getIsDynamic(r.manifest),n),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function f(){if(!t||!t.hasOwnProperty("getMpd")||!t.hasOwnProperty("getRegularPeriods"))throw new Error("setConfig function has to be called previously")}function p(e){if(!(e&&e.hasOwnProperty("getRepresentationController")&&e.hasOwnProperty("getIndexHandler")&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getType")&&e.hasOwnProperty("getStreamInfo")))throw new Error("streamProcessor parameter is missing or malformed!")}function h(e){if(!e||!e.hasOwnProperty("getRepresentationForQuality")||!e.hasOwnProperty("getCurrentRepresentation"))throw new Error("representationController parameter is missing or malformed!")}function y(e){if(null===e||isNaN(e)||e%1!=0)throw new Error("quality argument is not an integer")}function m(){r=[],i={}}return e={convertDataToRepresentationInfo:u,getDataForMedia:a,getStreamsInfo:function(e,n){var i=[],o=r;if(e){f();var a=t.getMpd(e);o=t.getRegularPeriods(a)}n||(n=o.length);for(var s=0;s0))return h;p=r[0].mpd.manifest}var E=s(e,d),S=E.id,A=t.getAdaptationsForType(p,e.index,o!==n.EMBEDDED_TEXT?o:n.VIDEO);if(!A)return h;for(i[S]=i[S]||t.getAdaptationsForPeriod(E),v=0,u=A.length;v0&&(c=n?t.getAdaptationForId(n,r[0].mpd.manifest,i.index):t.getAdaptationForIndex(o.index,r[0].mpd.manifest,i.index),e.getRepresentationController().updateData(c,u,l))},getInitRequest:function(e,t){var r,n=void 0,i=void 0;return p(e),y(t),n=e.getRepresentationController(),i=e.getIndexHandler(),r=n?n.getRepresentationForQuality(t):null,i?i.getInitRequest(r):null},getNextFragmentRequest:function(e,t){var r,n=void 0;return p(e),r=o(t,e.getRepresentationController()),(n=e.getIndexHandler())?n.getNextSegmentRequest(r):null},getFragmentRequestForTime:function(e,t,r,n){var i,a=void 0;return p(e),i=o(t,e.getRepresentationController()),(a=e.getIndexHandler())?a.getSegmentRequestForTime(i,r,n):null},generateFragmentRequestForTime:function(e,t,r){var n,i=void 0;return p(e),n=o(t,e.getRepresentationController()),(i=e.getIndexHandler())?i.generateSegmentRequestForTime(n,r):null},getIndexHandlerTime:function(e){p(e);var t=e.getIndexHandler();return t?t.getCurrentTime():NaN},setIndexHandlerTime:function(e,t){p(e);var r=e.getIndexHandler();r&&r.setCurrentTime(t)},getEventsFor:function(e,n){var i=[];if(0===r.length)return i;var u=r[0].mpd.manifest;return e instanceof Pi?i=t.getEventsForPeriod(s(e,r)):e instanceof Ci?i=t.getEventStreamForAdaptationSet(u,a(e)):e instanceof Ri&&(i=t.getEventStreamForRepresentation(u,o(e,n.getRepresentationController()))),i},getEvent:function(e,t,r){if(!e||!t)return null;var n=new Di,i=e.scheme_id_uri,o=e.value,a=e.timescale,s=e.presentation_time_delta,u=e.event_duration,l=e.id,c=e.message_data,d=r*a+s;return t[i]?(n.eventStream=t[i],n.eventStream.value=o,n.eventStream.timescale=a,n.duration=u,n.id=l,n.presentationTime=d,n.messageData=c,n.presentationTimeDelta=s,n):null},setConfig:function(e){e&&e.dashManifestModel&&(t=e.dashManifestModel)},updatePeriods:function(e){if(!e)return null;f();var n=t.getMpd(e);r=t.getRegularPeriods(n),i={}},reset:m},m(),e}ki.__dashjs_factory_name="DashAdapter";var Ni=s.a.getSingletonFactory(ki),Li=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null},Mi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null};Mi.DEFAULT_ID="defaultId";var Fi=Mi,Ui=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},Bi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri=""};function Gi(e){e=e||{};var t,r=this.context,i=at(r).getInstance(),o=e.mediaController,s=e.timelineConverter,u=e.adapter,l=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function c(e,t){var r=void 0,i=void 0,o=void 0,a=void 0,s=void 0,u=!1,l=!1;if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.hasOwnProperty("ContentComponent_asArray")&&e.ContentComponent_asArray,a=t!==n.TEXT?new RegExp(t):new RegExp("(vtt|ttml)"),e.Representation_asArray&&e.Representation_asArray.length&&e.Representation_asArray.length>0&&e.Representation_asArray[0].hasOwnProperty(tt.CODECS)&&(0===(s=e.Representation_asArray[0].codecs).search(n.STPP)||0===s.search(n.WVTT)))return t===n.FRAGMENTED_TEXT;if(e.hasOwnProperty(tt.MIME_TYPE)&&(u=a.test(e.mimeType),l=!0),!l)for(r=0,i=e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0;!l&&r=0}function T(e,t){if(!e)throw new Error("Period cannot be null or undefined");var r=Fi.DEFAULT_ID+"_"+t;return e.hasOwnProperty(tt.ID)&&e.id.length>0&&"__proto__"!==e.id&&(r=e.id),r}function R(e,t){var r=[],i=void 0;if(!e)return r;for(i=0;i1&&n){var a=o.getCurrentTrackFor(r,n),s=u.getAllMediaInfoForType(n,r);if(a)for(var l=0,c=i.length;l0){var n=l(t)&&t>=0&&t0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(tt.CENC_DEFAULT_KID)?e[tt.CENC_DEFAULT_KID]:null},getContentProtectionData:function(e){return e&&e.hasOwnProperty(tt.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:E,getIsDVB:function(e){return function(e){var t=!1;return e&&e.profiles&&e.profiles.length>0&&(t=-1!==e.profiles.indexOf("urn:dvb:dash:profile:dvb-dash:2014")),t}(e)},getDuration:function(e){return e&&e.hasOwnProperty(tt.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=NaN;return e&&e.hasOwnProperty(tt.MINIMUM_UPDATE_PERIOD)&&(r=e.minimumUpdatePeriod),isNaN(r)?r:Math.max(r-t,1)},getRepresentationCount:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length?b(e).Representation_asArray.map((function(e){return{id:e.id||"",bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null}})):null},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&l(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t=[],r=A(e),n=void 0,i=void 0;if(e&&e.period&&l(e.period.index)){var o=C(e.period.mpd.manifest);o&&(i=o[0])}if(r&&r.Representation_asArray)for(var a=0,u=r.Representation_asArray.length;a=0;){if(t[n].responsecode){r=t[n];break}n--}return r}function a(e){return e&&e.HttpList?e.HttpList:[]}function s(e,t){if(!e)return null;var r=e[t];if(!r)return null;var n=r.length;return n<=0?null:r[n-1]}function u(e){var t={};if(!e)return t;for(var r=e.trim().split("\r\n"),n=0,i=r.length;n0&&(t[o.substring(0,a)]=o.substring(a+2))}return t}function l(e,t,r){var n=void 0,i=void 0,o=void 0,a=void 0,s=void 0;if(e)for(n=e.AdaptationSet_asArray,a=0;a=0;o--)if((i=r[o]).type===G.MPD_TYPE){n=u(i._responseHeaders);break}return void 0===n[t]?null:n[t]},getRequestsQueue:function(e){return e?e.RequestsQueue:null}}}ji.__dashjs_factory_name="DashMetrics";var Hi=s.a.getSingletonFactory(ji);function Zi(){var e=this.context,t=p(e).getInstance(),r=void 0,n=void 0,i=void 0;function o(e){r=e}function a(e,t,n,i){return i?n&&t.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(t.availabilityStartTime.getTime()+1e3*(e+t.timeShiftBufferDepth)):t.availabilityEndTime:n?new Date(t.availabilityStartTime.getTime()+1e3*(e-r)):t.availabilityStartTime}function s(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function u(e){n||void 0!==e.offset&&(o(e.offset/1e3),n=!0)}function l(){r=0,n=!1,i=NaN}return{initialize:function(){l(),t.on(m.TIME_SYNCHRONIZATION_COMPLETED,u,this)},isTimeSyncCompleted:function(){return n},setTimeSyncCompleted:function(e){n=e},getClientTimeOffset:function(){return r},setClientTimeOffset:o,getExpectedLiveEdge:function(){return i},setExpectedLiveEdge:function(e){i=e},calcAvailabilityStartTimeFromPresentationTime:function(e,t,r){return a.call(this,e,t,r)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,r){return a.call(this,e,t,r,!0)},calcPresentationTimeFromWallTime:s,calcPresentationTimeFromMediaTime:function(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)},calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcSegmentAvailabilityRange:function(e,t){var r=e.adaptation.period,i={start:r.start,end:r.start+r.duration};if(!t)return i;if(!n&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var o=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0),a=s(new Date,r),u=r.start+r.duration;i.start=Math.max(a-r.mpd.timeShiftBufferDepth,r.start);var l=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset=u&&a-lre.min&&Math.abs(F.getDuration()-re.min)>=1&&M)try{var e=+("0."+((re.min+"").split(".")[1]||0)),t=e<.1?0:e>=.1?.1:+(e-.03).toFixed(2);t&&t>0&&!isNaN(t)&&(M.setMediaDuration(re.min-t),M.setAppendWindowEnd(re.min-t),k.setDeviationReset(!0))}catch(e){}}function ae(){return!!v&&!!W.getElement()}function se(){return Object(Ti.a)()}function le(){if(!A)throw t;return F.isPaused()}function ce(e){var t=[n.VIDEO,n.AUDIO,n.FRAGMENTED_TEXT];if(e)return-1!==t.indexOf(e)?be().getCurrentBufferLevel(_e(e))||NaN:(h("Warning - getBufferLength requested for invalid type"),NaN);var r=t.map((function(e){return we(e).length>0?be().getCurrentBufferLevel(_e(e)):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r}function de(e){var t=Ie(),r=F.getLiveDelay();if(!t)return 0;var n=t.range.start+e;return n>t.range.end-r&&(n=t.range.end-r),n}function fe(e,r){if(!A)throw t;var n=Se().currentTime;if(void 0!==e)n=M.getTimeRelativeToStreamId(n,e);else if(F.getIsDynamic()){var i=Ie();n=null===i?0:pe()-(i.range.end-i.time)}var o=k.getCachedDurationOffset("time");return r&&n-o>0&&(n-=o,n=Math.min(n,pe(void 0))),parseFloat(n.toFixed(5))}function pe(e){if(!A)throw t;var r=Se().duration;if(F.getIsDynamic()){var n,i=Ie();if(!i)return 0;r=(n=i.range.end-i.range.start)a&&(r=o=t&&X&&(k.setCachedDurationOffset("time",t),X=!1,W.setDataOffsetAttr(t),d.trigger(m.APPENDED_NEXT_SOURCE_DURATION_CHANGED,{offset:t,totalTime:e.time,totalDuration:pe(),time:fe(void 0,!0),duration:re.min||pe(!0)}))}function Ne(e){try{if(e&&e.mediaType&&e.segments){var t=e.mediaType,r=te[t],n=e.segments,i=e.representation&&e.representation.index,o=!0,a=[],s={},u=0,l=0;if(r.total&&r.total===n.length&&(r.segments.forEach((function(e,t){e.duration&&e.duration!==n[t].duration&&t100&&a.push(t)})),a.length)){o=!1,s={old:r.qualityIndex,new:i};var c=W.getTime(),d=Math.floor(c/5);-1===a.indexOf(d)&&-1===a.indexOf(d+1)&&-1===a.indexOf(d+2)&&(o=!0)}var f=0,p=e.segments&&e.segments[e.segments.length-1];p&&(f=(p.duration+p.startTime)/p.timescale,re[t]=f,(!re.min||re.min>0&&re.min>f)&&(re.min=f));var h=0;if(n&&n.length&&(h=n[0].startTime/n[0].timescale,C.setStartOffsetTimeForType(t,h),u=parseInt(n[0].mediaRange.split("-")[0],10),l=parseInt(n[n.length-1].mediaRange.split("-")[1],10),Q=Math.max(Q,h)),re.video&&re.audio){var y=re.video,m=re.audio,g=re.min;y>g&&m>g&&(re.min=Math.min(y,m))}re.min===f&&k.getCachedDurationOffset("duration")&&h>0&&(re.min-=h),k.setCachedDurationOffset("duration",re.min+Y);var v={total:n&&n.length,segments:n,isDurationAllEqual:o,qualityIndex:i,realDuration:f,startOffsetTime:h,rangeStart:u,rangeEnd:l};o||(v.notEqualIndexList=a,v.notEqualQualityIndex=s),te[e.mediaType]=v,"function"==typeof ne&&ne(t,v)}}catch(e){throw new Error("Parse segment loaded error, "+e)}}function Le(){K=!0;var e=W.getBufferRange(),t=W.getElement().duration,r=e&&e.length&&e.end(e.length-1),n=W.getTime(),i=[t,r,n+ce("video"),n+ce("audio")],o=i.filter((function(e){return!isNaN(e)})),a=o.reduce((function(e,t){return e+t}))/o.length,s=Math.min.apply(null,o);if(h("onStreamBufferingCompleted",Y,i,k.getAppendingSourceState(),q),Math.abs(s-a)<1&&(Y=parseFloat(s.toFixed(5)),q.length)){var u=q.splice(0,1)[0];h("Appending delay next source",u),Ue(u.manifest,u.preloadData)}}function Me(e){if(F.getEnded()&&k.getAppendingSourceState()){var t=e.sender.getType();if(ie[t]=e.bufferLevel,ie.audio>0&&ie.video>0){var r=W.getBufferRange(),n=r&&r.length&&r.end(r.length-1),i=F.getTime();n>i+.01&&(console.log("Playing next appending source after prev playback ended.",ie),F.seek(i+.01),F.play())}}if(k.getAppendingSourceState()&&z){for(var o=k.getCachedDurationOffset("offset"),a=W.getBufferRange(),s=F.getTime(),u=0,l=0;l=s&&(u=a.end(l));o>0&&u>o+1&&(k.setAppendingSourceState(!1), h("Appended Next Source, currentTime: "+s+" , buffered end: "+u),z=!1,d.trigger(m.APPENDED_NEXT_SOURCE,{time:s,ended:u}))}if(!J){var c=W.getBufferRange(),f=F.getTime(),p=c&&c.length&&c.start(0),y=k.getPlayAt();c&&c.length&&p>=Q&&(J=!0,(y||f)3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),o=i.toLocaleDateString(t),a=i.toLocaleTimeString(t,{hour12:r});return n?a+" "+o:a},getVersion:se,getDebug:function(){return f},getBufferLength:ce,getVideoContainer:function(){return W?W.getVideoContainer():null},getTTMLRenderingDiv:function(){return W?W.getTTMLRenderingDiv():null},getVideoElement:Se,getSource:function(){if(!v)throw u;return v},setLiveDelayFragmentCount:function(e){k.setLiveDelayFragmentCount(e)},setLiveDelay:function(e){k.setLiveDelay(e)},getLiveDelay:function(){return k.getLiveDelay()},getCurrentLiveLatency:function(){if(!E)throw l;return A?F.getCurrentLiveLatency():NaN},useSuggestedPresentationDelay:function(e){k.setUseSuggestedPresentationDelay(e)},enableLastBitrateCaching:function(e,t){k.setLastBitrateCachingInfo(e,t)},enableLastMediaSettingsCaching:function(e,t){k.setLastMediaSettingsCachingInfo(e,t)},setMaxAllowedBitrateFor:function(e,t){T.setMaxAllowedBitrateFor(e,t)},getMaxAllowedBitrateFor:function(e){return T.getMaxAllowedBitrateFor(e)},getTopBitrateInfoFor:function(t){if(!S)throw e;return T.getTopBitrateInfoFor(t)},setMinAllowedBitrateFor:function(e,t){T.setMinAllowedBitrateFor(e,t)},getMinAllowedBitrateFor:function(e){return T.getMinAllowedBitrateFor(e)},setMaxAllowedRepresentationRatioFor:function(e,t){T.setMaxAllowedRepresentationRatioFor(e,t)},getMaxAllowedRepresentationRatioFor:function(e){return T.getMaxAllowedRepresentationRatioFor(e)},setAutoPlay:he,getAutoPlay:function(){return w},setScheduleWhilePaused:function(e){k.setScheduleWhilePaused(e)},getScheduleWhilePaused:function(){return k.getScheduleWhilePaused()},getDashMetrics:be,getMetricsFor:_e,getQualityFor:function(t){if(!S)throw e;return T.getQualityFor(t,M.getActiveStreamInfo())},setQualityFor:function(t,r){if(!S)throw e;T.setPlaybackQuality(t,M.getActiveStreamInfo(),r)},updatePortalSize:function(){T.setElementSize(),T.setWindowResizeEventCalled(!0)},getLimitBitrateByPortal:function(){return T.getLimitBitrateByPortal()},setLimitBitrateByPortal:function(e){T.setLimitBitrateByPortal(e)},getUsePixelRatioInLimitBitrateByPortal:function(){return T.getUsePixelRatioInLimitBitrateByPortal()},setUsePixelRatioInLimitBitrateByPortal:function(e){T.setUsePixelRatioInLimitBitrateByPortal(e)},getBitrateInfoListFor:function(t){if(!S)throw e;var r=Oe();return r?r.getBitrateListFor(t):[]},setInitialBitrateFor:function(e,t){T.setInitialBitrateFor(e,t)},getInitialBitrateFor:function(t){if(!S)throw e;return T.getInitialBitrateFor(t)},setInitialRepresentationRatioFor:function(e,t){T.setInitialRepresentationRatioFor(e,t)},getInitialRepresentationRatioFor:function(e){return T.getInitialRepresentationRatioFor(e)},getStreamsFromManifest:function(t){if(!S)throw e;return O.getStreamsInfo(t)},getTracksFor:we,getTracksForTypeFromManifest:function(t,r,n){if(!S)throw e;return(n=n||O.getStreamsInfo(r,1)[0])?O.getAllMediaInfoForType(n,t,r):[]},getCurrentTrackFor:function(t){if(!S)throw e;var r=M.getActiveStreamInfo();return r?C.getCurrentTrackFor(t,r):null},setInitialMediaSettingsFor:function(e,t){if(!E)throw l;C.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!E)throw l;return C.getInitialSettings(e)},setCurrentTrack:function(t){if(!S)throw e;C.setTrack(t)},getTrackSwitchModeFor:function(e){if(!E)throw l;return C.getSwitchMode(e)},setTrackSwitchModeFor:function(e,t){if(!E)throw l;C.setSwitchMode(e,t)},setSelectionModeForInitialTrack:function(e){if(!E)throw l;C.setSelectionModeForInitialTrack(e)},getSelectionModeForInitialTrack:function(){if(!E)throw l;return C.getSelectionModeForInitialTrack()},setFastSwitchEnabled:function(e){k.setFastSwitchEnabled(e)},getFastSwitchEnabled:function(){return k.getFastSwitchEnabled()},setMovingAverageMethod:function(e){e===n.MOVING_AVERAGE_SLIDING_WINDOW||e===n.MOVING_AVERAGE_EWMA?k.setMovingAverageMethod(e):h("Warning: Ignoring setMovingAverageMethod("+e+") - unknown value.")},getMovingAverageMethod:function(){return k.getMovingAverageMethod()},getAutoSwitchQualityFor:function(e){return T.getAutoSwitchBitrateFor(e)},setAutoSwitchQualityFor:function(e,t){T.setAutoSwitchBitrateFor(e,t)},setABRStrategy:function(e){e===n.ABR_STRATEGY_DYNAMIC||e===n.ABR_STRATEGY_BOLA||e===n.ABR_STRATEGY_THROUGHPUT?k.setABRStrategy(e):h("Warning: Ignoring setABRStrategy("+e+") - unknown value.")},getABRStrategy:function(){return k.getABRStrategy()}, useDefaultABRRules:function(e){k.setUseDefaultABRRules(e)},addABRCustomRule:function(e,t,r){k.addABRCustomRule(e,t,r)},removeABRCustomRule:function(e){k.removeABRCustomRule(e)},removeAllABRCustomRule:function(){k.removeAllABRCustomRule()},setBandwidthSafetyFactor:function(e){k.setBandwidthSafetyFactor(e)},getBandwidthSafetyFactor:function(){return k.getBandwidthSafetyFactor()},getAverageThroughput:function(e){var t=T.getThroughputHistory();return t?t.getAverageThroughput(e):0},setAbandonLoadTimeout:function(e){k.setAbandonLoadTimeout(e)},retrieveManifest:function(e,t){var r=Ce(),n=this;d.on(m.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),d.off(m.INTERNAL_MANIFEST_LOADED,e,n),r.reset()}),n),Ve(c).getInstance().initialize(e),r.load(e,H)},addUTCTimingSource:ye,removeUTCTimingSource:ge,clearDefaultUTCTimingSources:function(){k.setUTCTimingSources([])},restoreDefaultUTCTimingSources:ve,setBufferToKeep:function(e){k.setBufferToKeep(e)},setBufferAheadToKeep:function(e){k.setBufferAheadToKeep(e)},setBufferPruningInterval:function(e){k.setBufferPruningInterval(e)},setStableBufferTime:function(e){k.setStableBufferTime(e)},getStableBufferTime:function(){return k.getStableBufferTime()},setBufferTimeAtTopQuality:function(e){k.setBufferTimeAtTopQuality(e)},getBufferTimeAtTopQuality:function(){return k.getBufferTimeAtTopQuality()},setBufferTimeAtTopQualityLongForm:function(e){k.setBufferTimeAtTopQualityLongForm(e)},getBufferTimeAtTopQualityLongForm:function(){return k.getBufferTimeAtTopQualityLongForm()},setFragmentLoaderRetryAttempts:function(e){k.setFragmentRetryAttempts(e)},setFragmentLoaderRetryInterval:function(e){k.setFragmentRetryInterval(e)},setManifestLoaderRetryAttempts:function(e){k.setManifestRetryAttempts(e)},setManifestLoaderRetryInterval:function(e){k.setManifestRetryInterval(e)},setXHRWithCredentialsForType:function(e,t){k.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return k.getXHRWithCredentialsForType(e)},setJumpGaps:function(e){k.setJumpGaps(e)},getJumpGaps:function(){return k.getJumpGaps()},setSmallGapLimit:function(e){k.setSmallGapLimit(e)},getSmallGapLimit:function(){return k.getSmallGapLimit()},getLowLatencyEnabled:function(){return k.getLowLatencyEnabled()},setLowLatencyEnabled:function(e){return k.setLowLatencyEnabled(e)},setPreloadData:function(e){return k.setPreloadData(e)},setManifestUpdateRetryInterval:function(e){k.setManifestUpdateRetryInterval(e)},getManifestUpdateRetryInterval:function(){return k.getManifestUpdateRetryInterval()},setLongFormContentDurationThreshold:function(e){k.setLongFormContentDurationThreshold(e)},setSegmentOverlapToleranceTime:function(e){k.setSegmentOverlapToleranceTime(e)},setCacheLoadThresholdForType:function(e,t){k.setCacheLoadThresholdForType(e,t)},getProtectionController:function(){return Pe()},attachProtectionController:function(e){P=e},setProtectionData:function(e){b=e,M&&M.setProtectionData(b)},enableManifestDateHeaderTimeSource:function(e){k.setUseManifestDateHeaderTimeSource(e)},attachVideoContainer:function(e){if(!W.getElement())throw r;W.setVideoContainer(e)},attachTTMLRenderingDiv:function(e){if(!W.getElement())throw r;W.setTTMLRenderingDiv(e)},getUseDeadTimeLatencyForAbr:function(){return T.getUseDeadTimeLatency()},setUseDeadTimeLatencyForAbr:function(e){T.setUseDeadTimeLatency(e)},getThumbnail:function(e){if(e<0)return null;var t=F.getIsDynamic()?de(e):e,r=M.getStreamForTime(t);if(null===r)return null;var n=r.getThumbnailController(),i=r.getStreamInfo();if(!n||!i)return null;var o=M.getTimeRelativeToStreamId(t,r.getId());return n.get(o)},setDefaultQualityFor:function(e,t){T||(T=ue(c).getInstance()),T.setDefaultQualityFor(e,t)},getDefaultQualityFor:function(e){return T.getDefaultQualityFor(e)},getDroppedFramesInfo:function(){return T.getDroppedFramesInfo()},getCurrentSegmentInfoFor:function(e){return T.getCurrentSegmentInfoFor(e)},onInitSegmentsLoaded:function(e){ne=e},getThroughputDict:function(e){var t=T.getThroughputHistory();return t?t.getDict(e):{}},getInitializeDate:Fe,updateSource:function(e){if(!E)throw l;"string"==typeof e&&Ve(c).getInstance().initialize(e),te.video={},te.audio={},v=e,M.load(v,H)},switchSource:function(e){if(!E)throw l;"string"==typeof e&&Ve(c).getInstance().initialize(e),te.video={},te.audio={},re.min=0,re.video=0,re.audio=0,v=e,Y=0,W.setDataOffsetAttr(0),k.setCachedDurationOffset("offset",0),k.setCachedDurationOffset("time",0),k.setCachedDurationOffset("duration",0),k.setAppendingSourceState(!1),k.resetStartAndSeekTime(),X=!1,q=[],(S||A)&&Re(),ae()&&xe()},appendSource:Ue,setEndOfStreamState:function(e){k&&k.setEndOfStreamState(e)},setP2pPermission:function(e){e||k.addBufferingCount()},setP2pType:function(e,t){var r,n=!1;switch(e){case"yf-eg":case"yf-cg2":window.YFDashIO&&(n=!0);break;case"xl-eg":case"xl-cg2":window.xyvp&&(n=!0);break;case"ks-eg":case"ks-cg2":window.KSLoader&&(n=!0);break;case"bili-eg":case"bili-cg2":window.DIYSdk&&(n=!0);break;case"pear-eg":case"pear-cg2":window.PearDownloader&&(n=!0)}n?window.__DASH_P2P_TYPE__=e:t?(r=t,new Promise((function(e,t){var n=document.createElement("script");n.src=r,n.onload=function(){window.clearTimeout(Z),e()},n.onerror=function(){window.clearTimeout(Z),t(),d.trigger(m.PCDN_LOADED_ERROR,{code:o.DOWNLOAD_PCDN_SCRIPT_ERROR,url:r})},document.body.appendChild(n),Z=window.setTimeout((function(){t(),d.trigger(m.PCDN_LOADED_ERROR,{code:o.DOWNLOAD_PCDN_SCRIPT_TIMEOUT,url:r})}),2e3)}))).then((function(){window.__DASH_P2P_TYPE__=e,h("[MediaPlayer] p2p Sdk Scripts Loaded")})).catch((function(){console.warn("load p2p sdk scripts failed")})):console.warn("lack p2p sdk scripts")},setUseNC:function(e){k&&k.setUseNC(e)},setUseP2P:function(e){k&&k.setUseP2P(e)},switchAudioTrack:function(e){return k.getAudioTrackIds().find((function(t){return t.id===e}))?(k.setAudioTrackId(e),d.trigger(m.SWITCH_AUDIO_TRACK_REQUEST,{id:e}),0):-1},getCurrentAudioTrackId:function(){return k.getAudioTrackId()},getAudioTrackList:function(){return k.getAudioTrackIds()},getRetryTimes:function(){return k.getRetryTimes()},getSpaceUtilLastSeekInSec:function(){return((new Date).getTime()-k.getLastStartSeekTime())/1e3},setPlayAt:function(e){return k.setPlayAt(e)},reset:function(){Te(null),Ae(null),b=null,z=!1,X=!1,Y=0,q=[],P&&(P.reset(),P=null),I&&(I.reset(),I=null),F&&(F.reset(),F=null),$&&($.reset(),$=null),d.off(m.SEGMENTS_LOADED,Ne,g),d.off(m.BUFFER_LEVEL_UPDATED,Me,g),d.off(m.PLAYBACK_ENDED,Le,this),d.off(m.STREAM_BUFFERING_COMPLETED,Le,this),d.off(m.PLAYBACK_TIME_UPDATED,ke,this),d.off(m.PLAYBACK_METADATA_LOADED,oe,this)},setQualityMap:function(e){},setPlayerId:function(e){k.setPlayerId(e)},getMediaTimeInfo:function(){return{videoRealDuration:re.video,audioRealDuration:re.audio,videoStartOffset:C.getStartOffsetTimeForType("video"),audioStartOffset:C.getStartOffsetTimeForType("audio")}},setEnableSupplyFrame:function(e){k&&(h("Set enable supply frame",e),k.setEnableSupplyFrame(e))},getUseSupplyFrame:function(){return{enableExtFrame:k.getEnableSupplyFrame(),canUseExtFrame:k.getCanSupplyFrame(),extFrameFailed:k.getSupplyFrameFailed()}}},function(){E=!1,A=!1,S=!1,w=!0,P=null,b=null,O=null,m.extend(Fr),k=Mr(c).getInstance(),W=mi(c).getInstance(),Y=0,K=!1,q=[],ie={video:0,audio:0},Q=0,d.on(m.SEGMENTS_LOADED,Ne,g),d.on(m.BUFFER_LEVEL_UPDATED,Me,g),d.on(m.PLAYBACK_ENDED,Le,this),d.on(m.STREAM_BUFFERING_COMPLETED,Le,this),d.on(m.PLAYBACK_TIME_UPDATED,ke,this),d.on(m.PLAYBACK_METADATA_LOADED,oe,this)}(),g}zi.__dashjs_factory_name="MediaPlayer";var Xi=s.a.getClassFactory(zi);Xi.events=Fr,s.a.updateClassFactory(zi.__dashjs_factory_name,Xi),t.a=Xi},function(e,t,r){var n,i,o,u,l,c=function(e){for(var t=[],r=0;r>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},d=function(e){for(var t=[],r=0;r>18)),r.push(n.charAt(63&o>>12)),r.push(n.charAt(63&o>>6)),r.push(n.charAt(63&o))}return 2==e.length-t?(o=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&o>>18)),r.push(n.charAt(63&o>>12)),r.push(n.charAt(63&o>>6)),r.push("=")):1==e.length-t&&(o=e[t]<<16,r.push(n.charAt(63&o>>18)),r.push(n.charAt(63&o>>12)),r.push("==")),r.join("")},o=function(){for(var e=[],t=0;t<64;++t)e[n.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),u=function(e){for(var t=0,r=[],n=0|e.length/4;0>16),r.push(255&i>>8),r.push(255&i),t+=4}return r&&("="==e.charAt(t-2)?(r.pop(),r.pop()):"="==e.charAt(t-1)&&r.pop()),r},l={encode:function(e){for(var t=[],r=0;r=0&&this.events[e].splice(r,1)}}else this.events[e]=[]},e.prototype.fire=function(e,t){if(e){var r=this.events[e];r&&r.length&&r.forEach((function(e){"function"==typeof e&&e.call(null,t)}))}},e.prototype.play=function(){try{return this.player.play()}catch(e){this.error({msg:"Call play function error",detail:e})}},e.prototype.pause=function(){try{this.player.pause()}catch(e){this.error({msg:"Call pause function error",detail:e})}},e.prototype.getCurrentTime=function(e){void 0===e&&(e=!0);try{ return this.player.time(void 0,e)}catch(e){this.error({type:p.STRING.WARNING,msg:"Call getCurrentTime function error",detail:e})}return 0},e.prototype.getBufferedTime=function(){this.getCurrentTime();var e=this.video;try{e.buffered}catch(e){this.error({msg:"Call getBufferedTime function error",detail:e})}return 0},e.prototype.getDuration=function(e){void 0===e&&(e=!0);try{return this.player.duration(e)}catch(e){this.error({msg:"Call getDuration function error",detail:e})}},e.prototype.seek=function(e,t){var r=this;return void 0===t&&(t=!1),new Promise((function(n,i){if(isNaN(parseInt(""+e,10))||e<0)i({msg:"Seek time value error, time: "+e});else if(r.state.appendingSourceState)i({msg:"Call seek function error while appending source, time: "+e});else try{var o=r.getCurrentTime(),a=Date.now();r.changePlaybackState(y.BUFFERING.PLAYBACK.SEEKING);var s=r.getStartOffsetTime();eu-.6&&(e=u-.6),r.player.seek(e,t);var f=function(){r.changePlaybackState(y.BUFFERING.PLAYBACK.PLAYING).player.off(p.EVENTS.PLAYBACK_SEEKED,f),n({cost:Math.floor(Date.now()-a),currentTime:o,seekedTime:e,isRelative:t})};r.player.on(p.EVENTS.PLAYBACK_SEEKED,f)}catch(e){r.error({msg:"Call seek function error",detail:e})}}))},e.prototype.getCorePlayer=function(){return this.player},e.prototype.setVolume=function(e){if(isNaN(parseInt(""+e,10))||e<0||e>1)this.error({msg:"SetVolume value error, value: "+e});else try{this.player.setVolume(e)}catch(e){this.error({msg:"Call setVolume function error",detail:e})}},e.prototype.getVolume=function(){try{return this.player.getVolume()}catch(e){this.error({msg:"Call getVolume function error",detail:e})}},e.prototype.setPlaybackRate=function(e){try{this.player.setPlaybackRate(e)}catch(e){this.error({msg:"Call setPlaybackRate function error",detail:e})}},e.prototype.getPlaybackRate=function(){try{return this.player.getPlaybackRate()}catch(e){this.error({msg:"Call getPlaybackRate function error",detail:e})}},e.prototype.getAutoSwitchQualityFor=function(e){try{return this.player.getAutoSwitchQualityFor(e)}catch(e){this.error({msg:"Call getAutoSwitchQualityFor function error",detail:e})}},e.prototype.setAutoSwitchQualityFor=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0);try{this.state.isAutoSwitch&&r&&(this.state.isAutoSwitch[e]=t),t||this.setMaxAllowedBitrateFor(e,0),this.player.setAutoSwitchQualityFor(e,t)}catch(e){this.error({msg:"Call setAutoSwitchQualityFor function error",detail:e})}return this},e.prototype.getAudioQuallityCanBeUsed=function(e){return e===p.DOLBY_AUDIO_QN.AUDIO||e===p.DOLBY_AUDIO_QN.AMTOS?this.checkAudioCodecCanUseByType(p.SPECIAL_AUDIO_TYPE.DOLBY)&&e||30280:e===p.FLAC_QN?this.checkAudioCodecCanUseByType(p.SPECIAL_AUDIO_TYPE.FLAC)&&e||30280:e},e.prototype.getQualityList=function(e){try{return this.player.getBitrateInfoListFor(e)}catch(e){this.error({msg:"Call getQualityList function error",detail:e})}},e.prototype.setDefaultQualityFor=function(e,t){void 0===t&&(t=0);var r=this.getQualityIndexFromQualityNumber(t,e);try{var n=this.state.mpd&&this.state.mpd[e];if(!n)return;var i=n.length;i&&(r=Math.min(r,i-1)),r>=0?(this.state.currentQualityIndex[e]=r,this.player.setDefaultQualityFor(e,r)):this.error({msg:"Call setDefaultQualityFor function error, quality: "+t})}catch(e){this.error({msg:"Call setDefaultQualityFor function error, quality: "+t+", qualityIndex = "+r,detail:e})}},e.prototype.setAutoSwitchTopQualityFor=function(e,t){var r=this;try{if(!this.state.initialized){var n=function(){r.off(p.EVENTS.STREAM_INITIALIZED,n),r.setAutoSwitchTopQualityFor(e,t)};return void this.on(p.EVENTS.STREAM_INITIALIZED,n)}if(!t&&0!==t)return void this.setMaxAllowedBitrateFor(e,0);if(!this.state.isAutoSwitch||!this.state.isAutoSwitch[e])return;var i=this.getQualityIndexFromQualityNumber(t,e),o=this.getQualityList(e),a=o&&o[i],s=Math.floor(a.bitrate/1e3)+1;this.state.autoSwitchTopQualityMap[e]=i,this.setMaxAllowedBitrateFor(e,s)}catch(e){this.error({msg:"Call setAutoSwitchTopQualityFor function error",detail:e})}},e.prototype.setQualityFor=function(e,t,r){var n=this;return void 0===r&&(r=20),new Promise((function(i,o){if(isNaN(parseInt(""+t,10))||t<0)o({msg:"Set quality value error, quality: "+t,code:p.ERROR_CODE.SET_QUALITY_VALUE_ERR});else if(n.detectQualityTypeIsLegal(e))o({msg:"Set quality type error, type: "+e,code:p.ERROR_CODE.SET_QUALITY_TYPE_ERR});else if(n.state.appendingSourceState)o({msg:"Reject setQualityFor by appending next source.",code:p.ERROR_CODE.SET_QUALITY_APENDING_ERR});else if("audio"===e&&n.state.enableMultiAudioTracks)o({msg:"MultiAudioTrack disable change Qn",code:p.ERROR_CODE.SET_QUALITY_MULTI_TRACK});else if("audio"===e&&n.getAutoSwitchQualityFor("video"))o({msg:"abr disable change Qn",code:p.ERROR_CODE.SET_QUALITY_ABR});else try{var a=t;if((t=n.getQualityIndexFromQualityNumber(t,e))===n.state.currentQualityIndex[e])return void o({msg:"Set quality equal current quality, quality: "+t,code:p.ERROR_CODE.SET_QUALITY_SAME_VALUE,isChange:a!==n.getQualityNumberFromQualityIndex(t)&&t!==a});n.player.setQualityFor(e,t);var s=Date.now(),u=function(e){-1!==n.timer.qnChangeTimeOutFlag[e]&&(clearTimeout(n.timer.qnChangeTimeOutFlag[e]),n.timer.qnChangeTimeOutFlag[e]=-1),n.qnSwitchingInfo[e]={}};u(e);var l=1e3*r;n.timer.qnChangeTimeOutFlag[e]=window.setTimeout((function(){n.player.off(p.EVENTS.QUALITY_CHANGE_RENDERED,c),o({msg:"Call setQualityFor timeout",code:p.ERROR_CODE.SET_QUALITY_TIME_OUT}),u(e);var t=n.state.currentQualityIndex[e];n.player.setQualityFor(e,t)}),l);var c=function(r){if(r.mediaType===e){var l=r.newQuality;if(u(r.mediaType),n.player.off(p.EVENTS.QUALITY_CHANGE_RENDERED,c),l===t){var d=n.getQualityNumberFromQualityIndex(l,e);l!==a&&a!==d?(o({msg:"Quality rendered and quality is not "+a+" but "+d,code:p.ERROR_CODE.SET_QUALITY_RENDER_CHANGED,newQuality:l,newQnNumber:d}),n.fire(p.EVENTS.QUALITY_CHANGE_ABNORMAL,{type:p.EVENTS.QUALITY_CHANGE_ABNORMAL,mediaType:e,defaultQuality:a,currentIndex:l,qualityNumber:d})):i(n.getQualityChangedData(r,s))}}};n.qnSwitchingInfo[e]={switching:!0,oQn:a,qn:t,reject:o,resolve:i,listener:c},n.player.on(p.EVENTS.QUALITY_CHANGE_RENDERED,c)}catch(e){o({msg:"Call setQualityFor function error",code:p.ERROR_CODE.SET_QUALITY_ERR,detail:e})}}))},e.prototype.getQualityFor=function(e){try{return this.player.getQualityFor(e)}catch(e){this.error({msg:"Call getQualityFor function error",detail:e})}},e.prototype.setStableBufferTime=function(e){void 0===e&&(e=60);try{this.player.setStableBufferTime(e),this.player.setBufferTimeAtTopQuality(e),this.player.setBufferTimeAtTopQualityLongForm(e),this.player.setBufferAheadToKeep(e+10)}catch(e){this.error({msg:"Call setStableBufferTime function error",detail:e})}},e.prototype.getStableBufferTime=function(){try{return this.player.getStableBufferTime()}catch(e){this.error({msg:"Call getStableBufferTime function error",detail:e})}},e.prototype.getBufferLength=function(e){try{return this.player.getBufferLength(e)}catch(e){this.error({msg:"Call getBufferLength function error",detail:e})}},e.prototype.getCurrentPlayURLFor=function(e){try{return this.player.getCurrentSegmentInfoFor(e).url||""}catch(t){this.error({msg:"Call getCurrentPlayURLFor function error, type: "+e+", qualityIndex: "+this.state.currentQualityIndex[e],detail:t})}},e.prototype.getVideoInfo=function(){return{mediaInfo:this.state.mediaInfo,statisticsInfo:this.state.statisticsInfo}},e.prototype.getCurrentCodecID=function(e){void 0===e&&(e=p.STRING.VIDEO);var t=0;return e===p.STRING.VIDEO&&this.state&&(t=p.VIDEO_CODEC_ID.AVC,this.state.enableAV1&&(t=p.VIDEO_CODEC_ID.AV1),this.state.enableHEVC&&(t=p.VIDEO_CODEC_ID.HEVC)),t},e.prototype.getAverageConnectionSpeed=function(e){void 0===e&&(e=p.STRING.VIDEO);try{return Number(this.player.getAverageThroughput(e))||0}catch(e){this.error({msg:"Call getAverageConnectionSpeed function error",detail:e})}},e.prototype.switchSource=function(e,t,r,n){var i=this;this.onDashJSLog({type:"switchsource",message:"start switchsource"+this.id}), "function"==typeof this.switchSourcePromise.reject&&this.switchSourcePromise.reject({code:p.ERROR_CODE.SWITCH_SOURCE_ABORT,msg:"abort switch source"}),this.player.off(p.EVENTS.STREAM_INITIALIZED,this.onSiwtchSourceInitialized,this);var o=n||{},a=o.playAt,s=o.keepTransition,u=o.autoPlay;return window.clearTimeout(this.timer.removeSwitchSourceTransition),window.clearTimeout(this.timer.switchSourceTimer),s||this.onVideoSwitchSourceEnded(),t&&("string"!=typeof t.videoid||"string"!=typeof t.audioid?this.error({type:p.STRING.WARNING,msg:"Preload data videoid/audioid value must be string type.",detail:t}):this.player&&this.player.setPreloadData(t)),this.player&&this.player.setPlayAt(a||0),this.state&&(this.state.playAt=a),new Promise((function(n,o){try{var a=i.filterManifest({manifest:e,state:i.state});if(e=a.manifest,i.state.mpd=e,t&&t.videoCodecId!==a.codecId&&(t.video=null,t.videoid=void 0),i.player){if(["video","audio"].forEach((function(e){var t=i.qnSwitchingInfo[e];t&&t.switching?(clearTimeout(i.timer.qnChangeTimeOutFlag[e]),i.setDefaultQualityFor(e,t.qn),i.player.off(p.EVENTS.QUALITY_CHANGE_RENDERED,t.listener)):i.setDefaultQualityFor(e,i.state.currentQualityIndex[e])})),i.state.defaultVideoQuality=i.state.currentQualityIndex.video,i.state.defaultAudioQuality=i.state.currentQualityIndex.audio,i.bindSwitchSourceEvents(n,o,1e4,u),r){if(!i.getTransitionCanvas()||!s){var l=document.createElement("canvas"),c=i.video.offsetWidth,d=i.video.offsetHeight,f=i.video.videoWidth,h=i.video.videoHeight,y=f/h,m=c/d;l.width=f,l.height=h,l.style.zIndex="10",l.style.position="absolute",l.style.top="50%",l.style.left="50%",l.style.transform="translate(-50%, -50%)",l.className=p.STRING.SWITCH_SOURCE_TRANSITION_ELEMENT_CLASS_NAME;var g=l.getContext("2d"),v=void 0,b=void 0;m>=y?(b=d,v=d/h*f):(v=c,b=c/f*h),l.style.width=(v/c*100).toFixed(2)+"%",l.style.height=(b/d*100).toFixed(2)+"%",g.fillRect(0,0,l.width,l.height),g.drawImage(i.video,0,0,l.width,l.height),i.video.parentNode.appendChild(l),i.video.style.visibility="hidden",l=null,g=null}i.timer.removeSwitchSourceTransition=window.setTimeout((function(){s||i.onVideoSwitchSourceEnded()}),1e4),i.video.removeEventListener("canplay",i.onVideoSwitchSourceEnded),i.video.addEventListener("canplay",i.onVideoSwitchSourceEnded)}i.player.switchSource(e)}else o({code:p.ERROR_CODE.SWITCH_SOURCE_FAILED,msg:"switch source failed"})}catch(e){o({code:p.ERROR_CODE.SWITCH_SOURCE_ERR,msg:e})}}))},e.prototype.updateSource=function(e){var t=this;return new Promise((function(r,n){try{e=t.filterManifest({manifest:e,state:t.state}).manifest,t.player.updateSource(e),t.timer.updateSourceTimer=window.setTimeout((function(){n({msg:"Update Source Timeout"})}),5e3);var i=function(){t.player.off(p.EVENTS.STREAM_INITIALIZED,i),clearTimeout(t.timer.updateSourceTimer),r(null)};t.player.on(p.EVENTS.STREAM_INITIALIZED,i)}catch(e){n({msg:"Call updateSource function error, "+JSON.stringify(e),detail:e})}}))},e.prototype.appendSource=function(e,t){var r=this,n=this.state.appendingSourceState,i=this.state;return new Promise((function(o,a){n&&a("Dash Player is Appending Next Source!"),r.setAutoSwitchQualityFor("video",!1,!1),r.setAutoSwitchQualityFor("audio",!1,!1);var s=Date.now();t&&("string"!=typeof t.videoid||"string"!=typeof t.audioid?r.error({type:p.STRING.WARNING,msg:"Preload data videoid/audioid value must be string type.",detail:t}):r.player&&r.player.setPreloadData(t)),r.timer.appendSourceTimer=window.setTimeout((function(){r.state.appendingSourceState=!1,a({msg:"Append source time out."})}),5e3),r.state.appendingSourceState=!0;try{if(r.player){for(var u in r.state.currentQualityIndex)r.state.currentQualityIndex[u]>=0&&r.setDefaultQualityFor(u,r.state.currentQualityIndex[u]);e=r.filterManifest({manifest:e,state:r.state}).manifest,r.player.setEndOfStreamState(!1),r.player.appendSource(e);var l=function(e){clearTimeout(r.timer.appendSourceTimer),r.player.off(p.EVENTS.APPENDED_NEXT_SOURCE,l),o({cost:Date.now()-s})};r.player.on(p.EVENTS.APPENDED_NEXT_SOURCE,l);var c=function(e){r.player.off(p.EVENTS.APPENDED_NEXT_SOURCE_DURATION_CHANGED,c),r.state.appendingSourceState=!1,i.autoSwitchTopQualityMap.video>=0&&r.setAutoSwitchTopQualityFor("video",i.autoSwitchTopQualityMap.video),r.setAutoSwitchQualityFor("video",i.isAutoSwitch[p.STRING.VIDEO],!1),r.setAutoSwitchQualityFor("audio",i.isAutoSwitch[p.STRING.AUDIO],!1)};r.player.on(p.EVENTS.APPENDED_NEXT_SOURCE_DURATION_CHANGED,c)}else clearTimeout(r.timer.appendSourceTimer),r.state.appendingSourceState=!1,a({msg:"Missing dash player instance!"})}catch(e){clearTimeout(r.timer.appendSourceTimer),r.state.appendingSourceState=!1,a({msg:"Append Source Error",detail:e})}}))},e.prototype.getNextFragmentHistoryInfo=function(){var e="";try{var t=function(e){return e?1:0};if(this.state.getNextFragmentHistory){var r=function(r){var i=n.state.getNextFragmentHistory[r],o="";i.forEach((function(e){var r,n,i=[t(e.final),e.currentTime,e.bufferLevel.toFixed(3),(r=[e.bufferResetInProgress,e.isReplacement,e.switchTrack,e.hasTopQualityChanged,e.lastInitQuality,e.bufferLevelRule],n="",r.length&&r.forEach((function(e){n+=""+t(e)})),parseInt(n,2))];o+=i.join(",")+";"})),e+=r+":"+o+"!"},n=this;for(var i in this.state.getNextFragmentHistory)r(i)}}catch(e){}return e},e.prototype.isLoadingFragment=function(e){if(e)return!!this.state.fragmentLoadingInfo[e]},e.prototype.getNetworkActivity=function(){return this.components.networkActivity&&this.components.networkActivity.getNetworkActivity()},e.prototype.getNetworkActivityHistory=function(e){return void 0===e&&(e=0),this.components.networkActivity&&this.components.networkActivity.getNetworkActivityHistory(e)},e.prototype.setEndOfStreamState=function(e){void 0===e&&(e=!1);try{return this.player.setEndOfStreamState(e)}catch(e){this.error({msg:"Call setEndOfStreamState function error",detail:e})}},e.prototype.getLogHistory=function(){var e=this.state&&this.state.logHistory||[],t=e.join("\n");return{length:e.length,log:t,size:function(e){for(var t=[],r=[e],n=0;r.length;){var i=r.pop();if("boolean"==typeof i)n+=4;else if("string"==typeof i)n+=2*i.length;else if("number"==typeof i)n+=8;else if("object"==f(i)&&-1===t.indexOf(i))for(var o in t.push(i),i)r.push(i[o])}return n}(t)}},e.prototype.getPerformanceInfo=function(e){void 0===e&&(e=!1);var t=this.getDroppedFramesInfo();return this.components.performanceInfo.getInfo(t,e)},e.prototype.getDisableLoaderType=function(){return this.components.ncDisableStrategy.isUseNC?this.components.ncDisableStrategy.isUseP2P?p.DISABLE_LOADER_TYPE.NONE:p.DISABLE_LOADER_TYPE.DISABLE_RP:p.DISABLE_LOADER_TYPE.DISABLE_NC},e.prototype.getBufferingInfo=function(e){var t,r;void 0===e&&(e=!0);var i={type:-1};try{var o=this.state.currentQualityIndex.video,a=this.state.currentQualityIndex.audio;i=this.components.bufferingInfo&&this.components.bufferingInfo.getInfo({videoBufferLength:this.getBufferLength("video"),audioBufferLength:this.getBufferLength("audio"),videoCurrentIndex:o,audioCurrentIndex:a,videoCurrentQn:this.getQualityNumberFromQualityIndex(o,p.STRING.VIDEO),audioCurrentQn:this.getQualityNumberFromQualityIndex(a,p.STRING.AUDIO),videoSpeed:this.getAverageConnectionSpeed(p.STRING.VIDEO),audioSpeed:this.getAverageConnectionSpeed(p.STRING.AUDIO),networkActivity:this.getNetworkActivityHistory(5),playbackState:this.state.playbackState,latestPlayurlErrorHTTPCode:this.state.latestPlayurlErrorHTTPCode,fragmentLoadingInfo:this.state.fragmentLoadingInfo,networkWarningHistory:null===(t=this.state)||void 0===t?void 0:t.networkWarningHistory,startOffsetTime:this.state.startOffsetTime,retryTimes:this.player.getRetryTimes(),seekSpace:this.player.getSpaceUtilLastSeekInSec()}),i=n(n({},i),this.getPerformanceInfo(!0)),null===(r=this.components)||void 0===r||r.bufferingStrategy.push(i)}catch(e){throw new Error(e.message)}return e&&this.onDashJSLog({type:"videoBuffering",message:"[videoBuffering]:"+JSON.stringify(i)}),i},e.prototype.getCDNInfo=function(e){if(void 0===e&&(e=!1),this.state){var t=n({},this.state.cdnInfo);return e&&(this.state.cdnInfo={cdn:0,p2p:0,nc:0,pdn:0,ncBr:0,business:0,mcdn:0,bcache:0,vcache:0,ncFail:0,ncGotFail:0}),t}return{}}, e.prototype.getCDNInfoDetail=function(e){if(void 0===e&&(e=!1),this.state){var t=n({},this.state.cdnInfoDetail);return e&&(this.state.cdnInfoDetail={}),t}return{}},e.prototype.getRequestedInfoDetail=function(e){if(void 0===e&&(e=!1),this.state){var t=n({},this.state.requestedInfoDetail);return e&&(this.state.requestedInfoDetail={}),t}return{}},e.prototype.getNCInfo=function(e){if(void 0===e&&(e=!1),this.state){var t={};for(var r in this.state.NCInfo)t[r]=n({},this.state.NCInfo[r]);return e&&(this.state.NCInfo={}),t}return{}},e.prototype.switchAudioTrack=function(e){var t=this;return new Promise((function(r,n){try{var i=-1,o="";if(t.state.enableMultiAudioTracks?e===t.getCurrentAudioTrackId()&&(i=p.ERROR_CODE.SWITCH_AUDIO_TRACK_ID_NOT_CHANGED,o="the id which is going to be switched is equal to current"):(i=p.ERROR_CODE.SWITCH_AUDIO_TRACK_NOT_SUPPORT,o="not support multiple audio tracks"),-1!==i)return void n({code:i,msg:o});0!==t.player.switchAudioTrack(e)?n({code:i=p.ERROR_CODE.SWITCH_AUDIO_TRACK_ID_NOT_EXIST,msg:o="the id which is going to be switched is not exist"}):t.once(p.EVENTS.SWITCH_AUDIO_TRACK_RENDERED,(function(e){r(e)}))}catch(e){n({code:p.ERROR_CODE.SWITCH_AUDIO_TRACK_ERR,msg:"switch aduio track failed, "+(e&&e.message)})}}))},e.prototype.getCurrentAudioTrackId=function(){return this.player.getCurrentAudioTrackId()},e.prototype.getAudioTrackList=function(){try{return this.player.getAudioTrackList()}catch(e){return[]}},e.prototype.destroy=function(){try{this.player.off(p.EVENTS.FRAGMENT_LOADING_STARTED,this.onFragmentLoading,this),this.player.off(p.EVENTS.FRAGMENT_LOADING_PROGRESS,this.onFragmentLoading,this),this.player.off(p.EVENTS.FRAGMENT_LOADING_COMPLETED,this.onFragmentLoading,this),this.player.off(p.EVENTS.SWITCH_AUDIO_TRACK_REQUEST,this.onAudioTrackSwitchRequest,this),this.player.off(p.EVENTS.SWITCH_AUDIO_TRACK_RENDERED,this.onAudioTrackSwitchRendered,this),this.player.off(p.EVENTS.LOG,this.onDashJSLog,this),this.player.off(p.EVENTS.PREDICT_SEEK,this.onPredictSeek,this),this.player.off(p.EVENTS.JUMP_MEDIA_GAP,this.onJumpMediaGap,this),this.player.off(p.EVENTS.STREAM_INITIALIZED,this.onSiwtchSourceInitialized,this),this.player&&this.player.reset(),this.onVideoSwitchSourceEnded(),this.switchSourcePromise=null,this.clearAllTimer(),this.events={},this.config=null,this.state=null,this.video=null,this.player=null,this.switchStartTime=null,this.destroyAllComponents(),this.externalMediaLoader=null,this.qnSwitchingInfo=null}catch(e){this.error({msg:"Call destroy function error, "+(e&&e.message),detail:e})}},e.prototype.destroyAllComponents=function(){this.components.networkActivity.destroy(),this.components.networkActivity=null,this.components.bufferingInfo.destroy(),this.components.bufferingInfo=null,this.components.bufferingStrategy.destroy(),this.components.bufferingStrategy=null,this.components.performanceInfo.destroy(),this.components.performanceInfo=null,this.components.ncDisableStrategy.destroy(),this.components.ncDisableStrategy=null,this.components=null},e.prototype.clearAllTimer=function(){var e=this;this.timer&&(Object.keys(this.timer).forEach((function(t){"qnChangeTimeOutFlag"===t?(clearTimeout(e.timer.qnChangeTimeOutFlag.video),clearTimeout(e.timer.qnChangeTimeOutFlag.audio)):clearTimeout(e.timer[t])})),this.timer=null)},e.prototype.mixin=function(e){if(e&&e instanceof Object)for(var t in e)e.hasOwnProperty(t)&&this.state.hasOwnProperty(t)&&(this.state[t]=e[t]);this.state&&this.state.isAutoSwitch||(this.state.isAutoSwitch={video:!1,audio:!1})},e.prototype.loadDashPlayerScript=function(){var e=this,t=this.config.scriptSrc;return new Promise((function(r,n){try{var i=document.createElement("script");i.src=t,i.onload=function(){e.state.onScriptLoading=!1,clearTimeout(e.timer.loadScript),r()},i.onerror=function(r){e.state.onScriptLoading=!1,clearTimeout(e.timer.loadScript),n({msg:"Load dash player script error, src: "+t,detail:r})},document.body.appendChild(i),e.state.onScriptLoading=!0,e.timer.loadScript=window.setTimeout((function(){n({msg:"Call loadDashPlayerScript function timeout"})}),e.config.scriptMaxLoadTime)}catch(e){n({msg:"Call loadDashPlayerScript function error",detail:e})}}))},e.prototype.createPlayer=function(t,r){var n,i=window.dashjs,o=this.state;this.state.defaultVideoQuality=this.getQualityIndexFromQualityNumber(o.defaultVideoQuality,p.STRING.VIDEO),this.state.defaultAudioQuality=this.getQualityIndexFromQualityNumber(o.defaultAudioQuality,p.STRING.AUDIO);try{var a=i.MediaPlayer().create();a.setPlayerId(this.id),a.setEnableSupplyFrame(this.state.enableExtraFrames&&c.isSupportEncoder()),o&&o.protectionDataSet&&"function"==typeof a.setProtectionData&&a.setProtectionData(o.protectionDataSet),this.player=a,this.setDebugLog(),this.bindEvents(t),this.state.logHistory.push("Dash player log history, "+JSON.stringify(e.CONFIG)),o.preloadData&&a.setPreloadData(o.preloadData),o.playAt&&a.setPlayAt(o.playAt),a.initialize(this.video,o.mpd,o.isAutoPlay,o.enforceSSLStream,null===(n=this.config)||void 0===n?void 0:n.hid,this.externalMediaLoader,o.ignoreEmeEncryptedEvent,o.enableMultiAudioTracks),a.setABRStrategy(o.abrStrategy||p.STRING.ABR_THROUGHPUT),a.setAutoSwitchQualityFor(p.STRING.VIDEO,o.isAutoSwitch[p.STRING.VIDEO]),a.setAutoSwitchQualityFor(p.STRING.AUDIO,o.isAutoSwitch[p.STRING.AUDIO]),a.setFastSwitchEnabled(!0),a.enableLastBitrateCaching(!1),a.setBufferPruningInterval(20),a.setUseNC(this.components.ncDisableStrategy.isUseNC),a.setUseP2P(this.components.ncDisableStrategy.isUseP2P),o.mpd&&o.mpd.interactive&&a.setEndOfStreamState(!1),a.setJumpGaps(!0),this.setStableBufferTime(this.state.stableBufferTime)}catch(e){r({msg:"Call createPlayer function error",detail:e})}},e.prototype.bindEvents=function(e){var t=this,r=this.player,n=function(){r.off(p.EVENTS.STREAM_INITIALIZED,n,t),t.state.initialized=!0;var i=t.player.getBitrateInfoListFor("video");e&&e(i),t.fire(p.EVENTS.STREAM_INITIALIZED),t.videoInfoSchedule(),t.detectDefaultQualityChangeAbnormal()};r.on(p.EVENTS.STREAM_INITIALIZED,n,this),r.on(p.EVENTS.MANIFEST_LOADED,this.parseManifestInfo,this),r.on(p.EVENTS.GET_NEXT_FRAGMENT,this.getNextFragmentInfo,this),r.on(p.EVENTS.FRAGMENT_LOADING_STARTED,this.onFragmentLoading,this),r.on(p.EVENTS.FRAGMENT_LOADING_PROGRESS,this.onFragmentLoading,this),r.on(p.EVENTS.FRAGMENT_LOADING_COMPLETED,this.onFragmentLoading,this),r.on(p.EVENTS.SWITCH_AUDIO_TRACK_REQUEST,this.onAudioTrackSwitchRequest,this),r.on(p.EVENTS.SWITCH_AUDIO_TRACK_RENDERED,this.onAudioTrackSwitchRendered,this),r.on(p.EVENTS.FRAGMENT_LOADED_ERROR,this.onFragmentLoadingError,this),r.on(p.EVENTS.REQUEST_RETRYED,this.onFragmentLoadingError,this),r.on(p.EVENTS.LOG,this.onDashJSLog,this),r.on(p.EVENTS.PREDICT_SEEK,this.onPredictSeek,this),r.on(p.EVENTS.JUMP_MEDIA_GAP,this.onJumpMediaGap,this),r.onInitSegmentsLoaded(this.onInitSegmentsLoaded.bind(this)),r.on(p.EVENTS.DELAY_TO_APPEND_TO_BUFFER,(function(e){})),r.on(p.EVENTS.START_OFFSET_TIME_WARNING,(function(e){var r=e&&e.time;r&&r>t.state.startOffsetTime&&(t.error({type:p.STRING.WARNING,code:p.ERROR.START_OFFSET_TIME_WARNING,msg:"Start offset time is less than buffer.start(0), "+t.state.startOffsetTime+" < "+r}),t.state.startOffsetTime=r+.2)}));var i=function(){r.off(p.EVENTS.PLAYBACK_METADATA_LOADED,i),t.timer.delayStartOffsetHackTimer=window.setTimeout((function(){if(t.video){var e=t.video.buffered,n=e.length&&e.start(0),i=t.video.currentTime;i=400){var l=0;if(a){var f=a.match(/expires=\d+/g),h=a.match(/deadline=\d+/g);l=f&&parseInt(f[0].substr(8),10)||h&&parseInt(h[0].substr(9),10)}l&&this.state.latestPlayurlExpireTimeStamp===l&&this.state.latestPlayurlErrorHTTPCode===s&&(u=!1),this.state.latestPlayurlExpireTimeStamp=l,this.state.latestPlayurlErrorHTTPCode=s}u&&this.error({code:r,msg:s+" downloadError - "+a,detail:e});break;case p.ERROR.MANIFEST_ERROR:case p.ERROR.MANIFEST_TYPE_ERROR:case p.ERROR.MANIFEST_RESOLVE_ERROR:this.error({code:r,msg:n+" - "+i,detail:e});break;case p.ERROR.MEDIA_ERROR:case p.ERROR.MEDIA_ABORTED_ERROR:case p.ERROR.MEDIA_NETWORK_ERROR:case p.ERROR.MEDIA_SUPPORTED_ERROR:case p.ERROR.MEDIA_ENCRYPTED_ERROR:case p.ERROR.MEDIA_UNKNOWN_ERROR:case p.ERROR.MEDIA_DECODE_ERROR:case p.ERROR.MEDIA_FMP4_ERROR:!function(){try{if(r===p.ERROR.MEDIA_DECODE_ERROR&&"audio"===o){var e=t.getQualityNumberFromQualityIndex(t.getQualityFor("audio"),"audio");d.default.saveDecodeErrorMediaQualityNumber("audio",e,p.STRING.BILIBILI_DECODE_ERROR_OBJ)}var n=t.state,i=n.enableAV1,a=n.enableHEVC,s=n.decodeErrorLocalConfig,u=i?"AV1":a?"HEVC":"AVC";if("AVC"===u)return;if(!o||"audio"!==o){var l="enable"+u+"Error";d.default.setSessionStorage(l,"1")}if(r===p.ERROR.MEDIA_FMP4_ERROR)return;if(s&&s[u]){var f=s[u],h=f.occurTimes,y=f.disableDuration,m=c.getLocalDecodeErrorInfo(u)||{occurTimes:0},g=m.occurTimes,v=m.reactivateTime;if(++g>=h&&!v){var b=y||6048e5;v=(new Date).getTime()+b}c.setLocalDecodeErrorInfo(u,{occurTimes:g,reactivateTime:v})}}catch(e){}}();var y=e.event,m=o?"[DecodeErrorType]"+o+";":n+" - "+y;this.error({code:r,msg:m,detail:e});break;default:this.error({msg:"Unknown error.",detail:e}),console.error(e)}}catch(e){this.error({msg:"Unknown error.",detail:e})}},e.prototype.detectDashJSExists=function(){return!(!window.dashjs||!window.dashjs.MediaPlayer)},e.prototype.detectQualityTypeIsLegal=function(e){return!(e===p.STRING.VIDEO||e===p.STRING.AUDIO)},e.prototype.parseManifestInfo=function(e){var t=this;try{var r=e.data;if(this.state.manifest=r,r&&r.Period){var n={baseUri:r.baseUri,representation:{video:[],audio:[]}},i={video:{},audio:{}},o=r.Period.AdaptationSet_asArray;o.length&&o.forEach((function(e){var r=e.Representation_asArray;if(r){var o="";r instanceof Array||(r=[r]),r.length&&(r.sort((function(e,t){return e.bandwidth-t.bandwidth})),r.forEach((function(r,a){var s=r.frameRate,u=r.mimeType||e.mimeType;try{if(s&&(""+s).indexOf("/")>-1){var l=s.split("/");s=(s=parseInt(l[0],10)/parseInt(l[1],10)).toFixed(3)}}catch(e){t.error({msg:"Parse fps error, fps: "+s,detail:e})}var c={id:r.id,baseURL:r.BaseURL,width:r.width,height:r.height,bandwidth:r.bandwidth,codecs:r.codecs,fps:s,mimeType:u,sar:r.sar,startWithSAP:r.startWithSAP,audioSamplingRate:r.audioSamplingRate};u.indexOf(p.STRING.VIDEO)>-1?o=p.STRING.VIDEO:u.indexOf(p.STRING.AUDIO)>-1?o=p.STRING.AUDIO:t.error({msg:"Manifest missing mimeType",detail:r}),o&&(function(e){var t,r,n,i=e.width,o=e.height,a=e.id;return t=function(e,t,r,n){return e+';codecs="'+t+'"'+(r&&n?';width="'+r+'";height="'+n+'"':";")}(e.mimeType,e.codecs,i,o),(null===(n=(r=window.MediaSource).isTypeSupported)||void 0===n?void 0:n.call(r,t))&&function(e,t,r){return v.getCurrentBrowserInfo().type!==v.BROWSER_TYPE.Firefox||e!==p.VIDEO_QN.QN_4K||!(!t||!r)&&t<=4096&&r<=2160}(+a,i,o)}(c)||t.isUsingWasmPlayer())?(n.representation[o].push(c),i[o][c.id]=a):t.onDashJSLog({type:"FilterCodecNotSupportedQn",message:"abandon qn: "+c.id})}))),t.state.maxQualityIndex[o]=r.length-1}})),this.state.manifestInfo=n,this.state.qualityNumberMap=i,this.state.setTheDefaultVideoQualityState||(this.state.setTheDefaultVideoQualityState=!0,this.setDefaultQualityFor("video",this.state.defaultVideoQuality),this.setDefaultQualityFor("audio",this.state.defaultAudioQuality))}}catch(t){this.error({msg:"Parse dash player manifest error",detail:e})}},e.prototype.getQualityIndexFromQualityNumber=function(e,t){void 0===t&&(t=p.STRING.VIDEO);var r=0;"audio"===t&&(e=this.qualityNumberDowngrading("audio",e)),t===p.STRING.AUDIO&&[p.DOLBY_AUDIO_QN.AMTOS,p.DOLBY_AUDIO_QN.AUDIO,p.FLAC_QN].includes(e)&&(e=this.getAudioQuallityCanBeUsed(e));try{var n=this.state.qualityNumberMap[t];e=parseInt(""+e,10) ;var i=this.state.maxQualityIndex[t];if(n&&n[e]>=0&&e>=this.config.minQualityNumberMappingNumber){var o=n[e];o>=0&&(r=o)}else if(-1===i||e>=0&&e<=i)r=e;else if(n){for(var a in n)if(n.hasOwnProperty(a)){var s=parseInt(a,10);s "+r.new+", segment index list: "+t.notEqualIndexList+" } "})}var n=this.state.segmentsInfoMap,i=this.state.appendingSourceState;if(n&&n.video&&n.audio&&!i){var o=n.video.realDuration,a=n.audio.realDuration,s=Math.abs(o-a);if(s>3){var u=this.getQualityNumberFromQualityIndex(n.video.qualityIndex,p.STRING.VIDEO),l=this.getQualityNumberFromQualityIndex(n.audio.qualityIndex,p.STRING.AUDIO),c=n.video.segments.length,d=n.audio.segments.length;this.error({type:p.STRING.WARNING,code:p.ERROR.DURATION_DEVIATION_IS_TOO_LARGE,msg:"Video / audio duration deviation is too large, deviation: "+s+"s. Video qn:"+u+", segments:"+c+", duration:"+o+". Audio qn:"+l+", segments:"+d+", duration:"+a})}}if(this.state.startOffsetTimeh&&(this.player.seek(this.state.startOffsetTime+.2),this.error({type:p.STRING.WARNING,code:p.ERROR.START_OFFSET_TIME_WARNING,msg:e+" start offset time is greater than 0, "+this.state.startOffsetTime}))}}catch(e){this.error({msg:"Call onInitSegmentsLoaded function error",detail:e})}},e.prototype.setMaxAllowedBitrateFor=function(e,t){try{this.player.setMaxAllowedBitrateFor(e,t)}catch(e){this.error({msg:"Call setMaxAllowedBitrateFor function error",detail:e})}},e.prototype.videoInfoSchedule=function(){var e=this,t={},r={};try{var n=this.state,i=n.manifestInfo,o=n.currentQualityIndex,a=i.representation[p.STRING.VIDEO][o[p.STRING.VIDEO]]||{},s=i.representation[p.STRING.AUDIO][o[p.STRING.AUDIO]]||{},u=a.mimeType+';codecs="'+a.codecs+'"',l=this.getCurrentSegmentInfoFor(p.STRING.VIDEO),c=s.mimeType+';codecs="'+s.codecs+'"',d=this.getCurrentSegmentInfoFor(p.STRING.AUDIO),f=this.getDroppedFramesInfo(),h=this.getCurrentCodecID(p.STRING.VIDEO),y=this.player.getMediaTimeInfo();t={width:a.width,height:a.height,sar:a.sar,mimeType:u+", "+c,fps:a.fps,videoDataRate:a.bandwidth,videoCodec:a.codecs,videoCodecID:h,audioDataRate:s.bandwidth,audioCodec:s.codecs,audioCodecID:0,audioSampleRate:s.audioSamplingRate||0,audioChannelCount:0,videoStartOffset:y.videoStartOffset,audioStartOffset:y.audioStartOffset,videoRealDuration:y.videoRealDuration,audioRealDuration:y.audioRealDuration},r={playerType:"DashPlayer",speed:Math.round(this.getAverageConnectionSpeed(p.STRING.VIDEO)),videoConnectionSpeed:Math.round(this.getAverageConnectionSpeed(p.STRING.VIDEO)),audioConnectionSpeed:Math.round(this.getAverageConnectionSpeed(p.STRING.AUDIO)),networkActivity:this.components.networkActivity&&this.components.networkActivity.getNetworkActivity(),videoBufferHealth:this.getBufferLength("video")||0,audioBufferHealth:this.getBufferLength("audio")||0,droppedFrames:f.droppedFrames||0,decodedFrames:f.totalFrames||0,audioURL:d.url||"",audioCurrentSegmentIndex:d.index||0,audioCurrentSegmentStartTime:d.startTime||0,audioCurrentSegmentDuration:d.duration||0,audioTotalSegmentCount:n.segmentsInfoMap[p.STRING.AUDIO].total||0,videoURL:l.url||"",videoCurrentSegmentIndex:l.index||0,videoCurrentSegmentStartTime:l.startTime||0,videoCurrentSegmentDuration:l.duration||0,videoTotalSegmentCount:n.segmentsInfoMap[p.STRING.VIDEO].total||0,useExtraFrames:this.player.getUseSupplyFrame()},this.state.mediaInfo=t,this.state.statisticsInfo=r,this.fire(p.EVENTS.VIDEO_INFO,{mediaInfo:t,statisticsInfo:r})}catch(e){}clearTimeout(this.timer&&this.timer.videoInfoSchedule),this.config&&this.config.videoInfoScheduleTime&&this.timer&&(this.timer.videoInfoSchedule=window.setTimeout((function(){e.videoInfoSchedule()}),this.config.videoInfoScheduleTime))},e.prototype.getQualityChangedData=function(e,t){var r={};try{var n=e.mediaType,i=e.type,o=e.newQuality,a=e.oldQuality,s=this.state.isAutoSwitch[n];r={mediaType:n,type:i,newQuality:o,newQualityNumber:this.getQualityNumberFromQualityIndex(o,n),oldQuality:a,oldQualityNumber:this.getQualityNumberFromQualityIndex(a,n),currentTime:this.getCurrentTime(),isAutoSwitch:s,dict:this.player.getThroughputDict("video")},p.EVENTS.QUALITY_CHANGE_RENDERED===i?((t=t||this.state.autoSwitchStartTime||0)&&(r.cost=Math.floor(Date.now()-t)),this.state.autoSwitchStartTime=0):p.EVENTS.QUALITY_CHANGE_REQUESTED===i&&(this.state.autoSwitchStartTime=Date.now())}catch(e){this.error({msg:"Call getQualityChangedData error",detail:e,type:p.STRING.WARNING})}return r},e.prototype.getTransitionCanvas=function(){try{if(this.video&&this.video.parentNode)return this.video.parentNode.querySelector("."+p.STRING.SWITCH_SOURCE_TRANSITION_ELEMENT_CLASS_NAME)}catch(e){return null}},e.prototype.onVideoSwitchSourceEnded=function(e){try{this.switchSourcePromise={},window.clearTimeout(this.timer.removeSwitchSourceTransition),window.clearTimeout(this.timer.switchSourceTimer),this.video&&(this.video.style.visibility="",this.video.removeEventListener("canplay",this.onVideoSwitchSourceEnded));var t=void 0;if(e&&e.target){var r=e.target.parentElement;t=r&&r.querySelectorAll("."+p.STRING.SWITCH_SOURCE_TRANSITION_ELEMENT_CLASS_NAME)}else t=document.querySelectorAll("."+p.STRING.SWITCH_SOURCE_TRANSITION_ELEMENT_CLASS_NAME);t&&t.length&&t.forEach((function(e){e&&e.parentElement.removeChild(e)}))}catch(e){console.error("Remove transition canvas error.",e)}},e.prototype.getStartOffsetTime=function(){var e=0;try{var t=this.state.segmentsInfoMap;t&&(e=Math.max(t.video.startOffsetTime||0,t.audio.startOffsetTime||0))}catch(e){}return e},e.prototype.setDebugLog=function(){try{var e=location.href;e&&e.indexOf("debug=1")>0&&this.player.getDebug().setLogToBrowserConsole(!0)}catch(e){}},e.prototype.getNextFragmentInfo=function(e){if(e&&e.mediaType){var t=e.mediaType;this.state.getNextFragmentHistory||(this.state.getNextFragmentHistory={video:[],audio:[]});var r=!1,n=this.state.getNextFragmentHistory[t].length;if(n){var i=this.state.getNextFragmentHistory[t][this.state.getNextFragmentHistory[t].length-1];for(var o in i)if(i[o]!==e[o]){r=!0;break}}!r&&n||(n>=30&&this.state.getNextFragmentHistory[e.mediaType].splice(0,1),this.state.getNextFragmentHistory[e.mediaType].push(e))}},e.prototype.onFragmentLoading=function(e){var t,r;if(e&&e.type){var n=e.type,i=e.request,o=this.covertFragmentInfoObject(i);if(o.loadingType=n, n===p.EVENTS.FRAGMENT_LOADING_STARTED)this.state.fragmentLoadingInfo[o.mediaType]=o;else if(n===p.EVENTS.FRAGMENT_LOADING_COMPLETED){var a=this.state.fragmentLoadingInfo[o.mediaType];o.isError=!!e.error;var s=e.response&&e.response.byteLength||0,u=Number(i.firstByteDate)-Number(i.requestStartDate);u=u?Math.max(u,1):1;var l=Number(i.requestEndDate)-Number(i.firstByteDate);l=l?Math.max(l,1):1;var c=Number(i.requestEndDate)-Number(i.requestStartDate);c=c?Math.max(c,1):1;var d=Math.round(8*s/c);o.latencyTime=u,o.downloadTime=l,o.totalTime=c,o.downloadBytes=s,o.connectionSpeed=d,o.data=e.response,o.totalSize=this.state.segmentsInfoMap[o.mediaType].rangeEnd+1;var f=!0;for(var h in a)if(a[h]!==o[h]&&"loadingType"!==h&&!isNaN(a[h])){f=!1;break}f&&(this.state.fragmentLoadingInfo[o.mediaType]=null,this.fire(p.EVENTS.FRAGMENT_LOADING_COMPLETED,o)),this.bpNCSaveData(o);var y=i.mediaType;"video"!==y&&"audio"!==y||this.recordRequestedInfoDetail(y,{code:200,qn:null==o?void 0:o.qn,index:null==o?void 0:o.index,rType:null===(t=null==i?void 0:i.loadInfo)||void 0===t?void 0:t.rType,protocol:null===(r=null==i?void 0:i.loadInfo)||void 0===r?void 0:r.protocol,currentTime:this.getCurrentTime(),buffered:this.getBufferLength(y),now:Math.round(null===performance||void 0===performance?void 0:performance.now()),latencyTime:u,downloadTime:l,totalTime:c,connectionSpeed:d,totalSize:s,retryTimes:null==i?void 0:i.retry,url:null==i?void 0:i.url})}else this.state.fragmentLoadingInfo&&this.state.fragmentLoadingInfo[o.mediaType]&&!this.state.fragmentLoadingInfo[o.mediaType].loaderType&&(this.state.fragmentLoadingInfo[o.mediaType].loaderType=o.loaderType),this.components.networkActivity&&this.components.networkActivity.onFragmentLoadingProgess(e)}},e.prototype.onFragmentLoadingError=function(e){if(e){if(e.type===p.EVENTS.REQUEST_RETRYED&&(null==e?void 0:e.code)<4e3)return;var t=null==e?void 0:e.mediaType;"video"!==t&&"audio"!==t||this.recordRequestedInfoDetail(t,{code:null==e?void 0:e.code,qn:(null==e?void 0:e.id)||(null==e?void 0:e.qn),index:null==e?void 0:e.index,rType:e.rType,retryTimes:e.retryTimes,currentTime:this.getCurrentTime(),buffered:this.getBufferLength(t),now:Math.round(null===performance||void 0===performance?void 0:performance.now()),latencyTime:null==e?void 0:e.timeout,downloadTime:(null==e?void 0:e.downloadTime)||(null==e?void 0:e.timeout),totalTime:(null==e?void 0:e.totalTime)||(null==e?void 0:e.timeout),totalSize:null==e?void 0:e.received,url:null==e?void 0:e.url})}},e.prototype.recordRequestedInfoDetail=function(e,t){var r,n,i,o;if(t&&this.state){(null===(r=this.state)||void 0===r?void 0:r.requestedInfoDetail[e])||(this.state.requestedInfoDetail[e]={latestHost:"",list:[]}),this.state.requestedInfoDetail[e].list.length>1e3&&this.state.requestedInfoDetail[e].list.shift();var a="-",s="443";try{var u=((null==t?void 0:t.url)||"").match(/^(?:https?:\/\/)?([^\/\n:]+)(?::(\d+))?/);u[2]&&(s=u[2]);var l=null===(n=u[1])||void 0===n?void 0:n.split(".");a=l.splice(0,l.length-2).join("."),"443"!==s&&(a+=":"+s);var c=this.state.requestedInfoDetail[e].latestHost;c&&c===a||(this.state.requestedInfoDetail[e].latestHost=a)}catch(e){}var f=t.qn||t.representationId;if(f){var p={id:this.state.requestedInfoRecordIndex++,co:t.code,qn:parseInt(f.toString().substr(-3),10),in:t.index,rt:(t.rType||"-").substr(0,1),qr:(t.protocol||"-").substr(0,1),ct:d.default.toFixed(t.currentTime||0,2),bf:d.default.toFixed(t.buffered||0,2),lt:t.latencyTime||0,dt:t.downloadTime||0,cs:t.connectionSpeed||0,ts:t.totalSize||0,ry:t.retryTimes||0,ht:a};null===(o=null===(i=this.state)||void 0===i?void 0:i.requestedInfoDetail[e])||void 0===o||o.list.push([p.id,p.co,p.qn,p.in,{"-":0,X:1,N:2,P:3}[p.rt]||0,{"-":0,T:1,Q:2}[p.qr]||0,p.ct,p.bf,p.lt,p.dt,p.cs,p.ts,p.ry,p.ht])}}},e.prototype.bpNCSaveData=function(e){if(e&&e.url&&e.range&&e.data){var t=this.getBPNC();if(t&&"function"==typeof t.allowDPSaveDataByNC){var r=(""+e.url).split("?")[0].split("/"),n=r[r.length-1].split(".")[0].split("-").pop();if(n){var i=parseInt(n,10);if(!isNaN(i)&&t.allowDPSaveDataByNC({qn:i})){var o={url:e.url,range:e.range,data:e.data,totalSize:e.totalSize,token:t.getToken()};t.saveData(o)}}}}},e.prototype.getBPNC=function(){var e,t="bpNC";return(null===(e=this.config)||void 0===e?void 0:e.hid)&&(t+="_"+this.config.hid),window[t]},e.prototype.covertFragmentInfoObject=function(e){var t={};try{t={type:e.type,mediaType:e.mediaType,startTime:e.startTime,url:e.url,index:e.index,id:e.representationId,qn:this.getQualityNumberFromQualityIndex(e.quality,e.mediaType),range:e.range,duration:e.duration,isError:!1},e.startLoadFragmentTime?t.startDownloadTime=new Date(e.startLoadFragmentTime).getTime():t.startDownloadTime=(new Date).getTime(),e.loadInfo&&(t.loaderType=e.loadInfo.rType)}catch(e){}return t},e.prototype.onDashJSLog=function(e){this.state.logHistory||(this.state.logHistory=[]),this.state.logHistory.length>=2e4&&this.state.logHistory.shift(),e&&this.state.logHistory.push(e.message)},e.prototype.onPredictSeek=function(e){this.fire(p.EVENTS.PREDICT_SEEK,e)},e.prototype.onJumpMediaGap=function(e){this.fire(p.EVENTS.JUMP_MEDIA_GAP,e)},e.prototype.onDashCDNLoadInfo=function(e){var t,r,n,i,o,a,s,u,l;if(null==e?void 0:e.loadInfo){var c=e.loadInfo,d=null==e?void 0:e.mediaInfo.id;for(var f in d&&!this.state.cdnInfoDetail[d]&&(this.state.cdnInfoDetail[d]={cdn:0,p2p:0,nc:0,ncBr:0,pdn:0,business:0,mcdn:0,bcache:0,vcache:0,ncFail:0,ncGotFail:0}),this.state.cdnInfo)c[f]&&(this.state.cdnInfo[f]+=c[f],d&&(this.state.cdnInfoDetail[d][f]+=c[f]));if("XHR"===c.rType&&c.url&&c.cdn){var h=c.url;h.indexOf("upos-")>-1?(this.state.cdnInfo.business+=c.cdn,d&&(this.state.cdnInfoDetail[d].business+=c.cdn)):h.indexOf("os=mcdn")>-1?(this.state.cdnInfo.mcdn+=c.cdn,d&&(this.state.cdnInfoDetail[d].mcdn+=c.cdn)):h.indexOf("os=bcache")>-1?(this.state.cdnInfo.bcache+=c.cdn,d&&(this.state.cdnInfoDetail[d].bcache+=c.cdn)):h.indexOf("os=vcache")>-1&&(this.state.cdnInfo.vcache+=c.cdn,d&&(this.state.cdnInfoDetail[d].vcache+=c.cdn))}this.fire(p.EVENTS.CDN_LOAD_INFO,c)}if((null===(t=null==e?void 0:e.NCInfo)||void 0===t?void 0:t.responseData)&&this.state.NCInfo){var y=null==e?void 0:e.NCInfo,m=(d=y.qn,this.state.NCInfo[d]||{total:0,response:0,expect:0});if(9999===y.code){if(m.total++,y.range){var g=y.range.split("-"),v=parseInt(g[0],10),b=parseInt(g[1],10);b&&(m.expect+=b-v+1||0)}return void(this.state.NCInfo[d]=m)}if(m[y.code]||(m[y.code]={}),4999===y.code)return m[y.code].count=(null===(r=m[y.code])||void 0===r?void 0:r.count)+1||1,(null===(n=this.video)||void 0===n?void 0:n.seeking)&&(m[y.code].seeking=m[y.code].seeking+1||1),void(this.state.NCInfo[d]=m);var _=y.responseData,E=_.gotDataByte,S=_.getDataTime,A=_.usePeerSids,w=_.retryCount,T=_.originRange,R=_.gotDataByteFromBr;A=A||[],E=E||0,S=S||0,R=R||0,w=w||0,T&&T.hasOwnProperty("start")&&T.hasOwnProperty("end")||(T={start:0,end:0});var C=Math.abs(T.end-T.start)+1,P=(null==A?void 0:A.length)||0;if(m.response++,m[y.code].count=(null===(i=m[y.code])||void 0===i?void 0:i.count)+1||1,m[y.code].bytes=(null===(o=m[y.code])||void 0===o?void 0:o.bytes)+E||E,m[y.code].time=(null===(a=m[y.code])||void 0===a?void 0:a.time)+S||S,m[y.code].peers=(null===(s=m[y.code])||void 0===s?void 0:s.peers)+P||P,m[y.code].retry=(null===(u=m[y.code])||void 0===u?void 0:u.retry)+w||w,m[y.code].expect=(null===(l=m[y.code])||void 0===l?void 0:l.expect)+C||C,4003!==y.code&&40003!==y.code||0!==E||(m[y.code].abnormal=m[y.code].abnormal+1||1),2e3===y.code||24e3===y.code){var I="peers_"+P;m[y.code][I]=m[y.code][I]+1||1}this.state.NCInfo[d]=m}},e.prototype.changePlaybackState=function(e){return this.state.playbackState=e,this},e.prototype.saveNetworkWarningInfo=function(e){this.state&&this.state.networkWarningHistory&&(this.state.networkWarningHistory||(this.state.networkWarningHistory=[]),this.state.networkWarningHistory.length>=100&&this.state.networkWarningHistory.shift(),this.state.networkWarningHistory.push(e))},e.prototype.detectDefaultQualityChangeAbnormal=function(){var e=this,t=this.state,r=t.defaultVideoQuality,n=t.defaultAudioQuality,i=t.currentQualityIndex,o=i.video,a=i.audio;return[{type:p.STRING.VIDEO,defaultQuality:r,currentIndex:o},{ type:p.STRING.AUDIO,defaultQuality:n,currentIndex:a}].forEach((function(t){var r=e.getQualityNumberFromQualityIndex(t.currentIndex,t.type),n=t.defaultQuality,i=t.currentIndex;n>=0&&i>=0&&-1===[i,r].indexOf(n)&&e.fire(p.EVENTS.QUALITY_CHANGE_ABNORMAL,{type:p.EVENTS.QUALITY_CHANGE_ABNORMAL,mediaType:t.type,defaultQuality:n,currentIndex:i,qualityNumber:r})})),this},e.prototype.isUsingWasmPlayer=function(){return window.__ENABLE_WASM_PLAYER__&&this.video instanceof window.BwpElement},e.prototype.filterHEVCSpecialVideoUrl=function(e){var t=this;if("string"!=typeof e&&(null==e?void 0:e.video)){var r=this.state.defaultVideoQuality,n=[p.VIDEO_QN.QN_8K,p.VIDEO_QN.QN_DOLBY_VISION,p.VIDEO_QN.QN_HDR10],i=p.VIDEO_CODEC_ID.HEVC;((null==e?void 0:e.video)||[]).filter((function(e){return e.codecid===i})).length<=0||n.includes(r)||(e.video=e.video.filter((function(e){if(!n.includes(e.id))return!0;var r=t.state.filterVideoInfo,i=p.FILTER_VIDEO_URL_REASON.FILTER_SPECIAL_VIDEO;return void 0===r[i]&&(r[i]=[]),r[i].push(JSON.parse(JSON.stringify(e))),t.onDashJSLog({type:"filterSpecialVideo",message:"filter hevc special video urls"}),!1})))}},e.prototype.filterPdnUrl=function(t){if("string"!=typeof t&&t){var r=t.video,n=t.audio,i=function(e){return"string"==typeof e&&(e.includes("traceid")||e.includes(":8082"))},o=this.shouldFilterPdnUrl(),a=JSON.parse(e.getFawkesConfigValue(p.STRING.DASH_CONFIG,"pdn_disable_qn_list")),s=JSON.parse(e.getFawkesConfigValue(p.STRING.DASH_CONFIG,"pdn_disable_codecid_list")),u=!1,l=function(e){e&&e.length&&e.forEach((function(e){(i(e.baseUrl)||i(e.base_url))&&(o||a.includes(e.id)&&d.default.isInSpareTime()||s.includes(e.codecid)&&d.default.isInSpareTime())&&(u=!0,e.baseUrl&&e.backupUrl&&e.backupUrl.length&&(e.baseUrl=e.backupUrl.shift()),e.base_url&&e.backup_url&&e.backup_url.length&&(e.base_url=e.backup_url.shift()))}))};l(r),l(n),u&&this.onDashJSLog({type:"filterPdn",message:"["+Math.round(performance.now())+"] filter pdn, "+o+", qn list: "+a+", codec list: "+s})}},e.prototype.filterManifest=function(e){var t=e.manifest;e.log=this.onDashJSLog.bind(this),void 0===e.enableAV1&&(e.enableAV1=this.state.enableAV1),void 0===e.enableHEVC&&(e.enableHEVC=this.state.enableHEVC),t&&!t.video&&(this.onDashJSLog({type:"audio-only",message:"playing in audio-only"}),"string"!=typeof t&&(t.video=[]));var r=p.VIDEO_CODEC_ID.AVC;t&&t.video&&t.video instanceof Array&&(this.externalMediaLoader||(this.filterHEVCSpecialVideoUrl(e.manifest),r=g.applyCodecStrategy(e),t.video=t.video.filter((function(e){return e.codecid===r}))),t=this.adjustManifestHack(t));try{this.filterPdnUrl(t)}catch(e){}return{codecId:r,manifest:t}},e.prototype.shouldFilterPdnUrl=function(){try{var t=e.getFawkesConfigValue(p.STRING.DASH_CONFIG,"pdn_mid_black_list"),r=t&&JSON.parse(t)||[],n=d.default.getCookie("DedeUserID"),i=""===n?0:Number(n);if(Math.random()>Number(e.getFawkesConfigValue(p.STRING.DASH_CONFIG,p.STRING.PDN_ENABLE)))return!0;if(r.includes(i))return!0}catch(e){return!1}return!1},e.prototype.adjustManifestHack=function(e){var t;if((null===(t=null==e?void 0:e.video)||void 0===t?void 0:t.length)>1){var r=e.video,n=Math.max.apply(Math,r.map((function(e){return e.bandwidth}))),i=Math.min.apply(Math,r.map((function(e){return e.bandwidth})));if(Math.abs(n-i)<1e4){this.state&&this.state.logHistory.push("Adjust manifest hack, max: "+n+", min: "+i+", delta: "+Math.abs(n-i));for(var o=r.length-1;o>0;o--)r[o-1].bandwidth=Math.max(r[o-1].bandwidth,r[o].bandwidth+1e4)}}return e},e.prototype.processSpecialAudioItem=function(e,t){var r;void 0===t&&(t=30280),e.audio;var n=e.flac,i=e.dolby;if(n&&n.audio&&c.isFLACTypeSupported()&&t===p.FLAC_QN)return n.audio.codecs=n.audio.codecs.toLocaleLowerCase(),void(e.audio=[n.audio]);i&&(null===(r=null==i?void 0:i.audio)||void 0===r?void 0:r.length)&&c.isEC3DolbyATMOSTypeSupported()&&[p.DOLBY_AUDIO_QN.AMTOS,p.DOLBY_AUDIO_QN.AUDIO].includes(t)&&(e.audio=s(i.audio))},e.prototype.checkAudioCodecCanUseByType=function(e){var t=this.state.mpd&&this.state.mpd[p.STRING.AUDIO]?this.state.mpd[p.STRING.AUDIO]:this.state.manifest&&this.state.manifest.audio?this.state.manifest.audio:void 0;if(!t||!t.length)return!1;switch(e){case p.SPECIAL_AUDIO_TYPE.DOLBY:if(c.isEC3DolbyATMOSTypeSupported())return-1!==t.findIndex((function(e){return e.id===p.DOLBY_AUDIO_QN.AUDIO||e.id===p.DOLBY_AUDIO_QN.AMTOS}));break;case p.SPECIAL_AUDIO_TYPE.FLAC:if(c.isFLACTypeSupported())return-1!==t.findIndex((function(e){return e.id===p.FLAC_QN}))}return!1},e.prototype.qualityNumberDowngrading=function(e,t){var r=d.default.getDecodeErrorMediaQualityNumberListForType(e,p.STRING.BILIBILI_DECODE_ERROR_OBJ),n=Object.keys(this.state.qualityNumberMap[e]).map(Number).reverse(),i=0;if(r.length>0){for(;r.includes(t)&&i-1&&l.indexOf("chrom")<0,d=0,f=l.match(/version\/\d+/);c&&f&&f.length&&(d=Number(f[0].substr(8)));var p=l.indexOf("edge/")>-1,h=0,y=l.match(/edge\/\d+/);p&&y&&y.length&&(h=Number(y[0].substr(5)));var m=(null==e?void 0:e.codec)||"hev1.2.4.H150.90",g=window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="'+m+'"'),v=null===(i=window.matchMedia("(color-gamut:p3)"))||void 0===i?void 0:i.matches,b=(null===(s=window.screen)||void 0===s||s.colorDepth,parseInt(a.default.getLocalStorage("bilibili_player_force_hdr"),10)),_=o.getCurrentBrowserInfo(),E=_.type,S=_.version,A=((t={})[o.BROWSER_TYPE.Chrome]=S>=104&&v,t[o.BROWSER_TYPE.ChromiumEdge]=S>=120&&v,t) ;return g&&(c&&v&&d>=13||p&&h>=18||A[E]||b)&&(u=!0),u};t.isHEVCHDR10TypeSupported=u;var l=function(e){var t=window.MediaSource;return t&&!!t.isTypeSupported(e)};t.isMIMETypeSupported=l;var c=function(e){var t,r,n,i,s;if("1"===a.default.getSessionStorage("enableHEVCError"))return!1;var u=null===(n=null===(r=window.navigator)||void 0===r?void 0:r.userAgent)||void 0===n?void 0:n.toLowerCase(),c=o.getSafariInfo(u),d=o.getEdgeInfo(u),f=!1;if(e&&e.codec)f=l('video/mp4; codecs="'+e.codec+'"');else{var p=l('video/mp4; codecs="hev1.1.6.L153.90"'),h=l('video/mp4; codecs="dvh1.05.06"');f=p&&h}var y=parseInt(a.default.getLocalStorage("bilibili_player_force_hdr"),10);if(!f)return!1;var m=!1;c.isSafari&&(m=(null===(i=window.matchMedia("(color-gamut:p3)"))||void 0===i?void 0:i.matches)&&c.version>=13||!1),d.isEdge&&(m=d.version>=18);var g=o.getCurrentBrowserInfo(),v=g.type,b=g.version,_=((t={})[o.BROWSER_TYPE.Chrome]=b>=104,t[o.BROWSER_TYPE.ChromiumEdge]=b>=120,t);return v!==o.BROWSER_TYPE.Chrome&&v!==o.BROWSER_TYPE.ChromiumEdge||(m=(null===(s=window.matchMedia("(color-gamut:p3)"))||void 0===s?void 0:s.matches)&&_[v]||!1),!!y||m};t.isHEVCDolbyVisionTypeSupported=c,t.isEC3DolbyATMOSTypeSupported=function(){var e,t,r=l('audio/mp4; codecs="ec-3"'),n=null===(t=null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||void 0===t?void 0:t.toLowerCase(),i=o.getSafariInfo(n),a=o.getEdgeInfo(n);return!!r&&(i.isSafari&&i.version>=13||a.isEdge)};var d=function(e){var t,r=(null==e?void 0:e.width)||7680,n=(null==e?void 0:e.height)||4320,i=(null==e?void 0:e.codec)||"hev1.1.6.L180.90";if(!l('video/mp4;codecs="'+i+'";width='+r+";height="+n))return!1;var s=o.getCurrentBrowserInfo(),u=s.type,c=s.version,d=parseInt(a.default.getLocalStorage("bilibili_player_force_8k"),10),f=((t={})[o.BROWSER_TYPE.Safari]=c>=13,t[o.BROWSER_TYPE.ChromiumEdge]=c>=120,t[o.BROWSER_TYPE.Chrome]=c>=104,t);return!!d||f[u]};t.isHEVC8kTypeSupported=d;var f=function(e){var t=o.getCurrentBrowserInfo(),r=t.type,n=t.version;return e="number"==typeof e?e:4e3,r===o.BROWSER_TYPE.ChromiumEdge&&n>=79||r===o.BROWSER_TYPE.Chrome&&n>=70||r===o.BROWSER_TYPE.Firefox&&n>=67||r===o.BROWSER_TYPE.QQ&&n>=70&&e<=4e3};t.isBrowserSupportAV1=f,t.isAV1TypeSupported=function(e){if(!window||!window.MediaSource||!window.MediaSource.isTypeSupported)return!1;if(!f())return!1;var t="av01.0.08M.08.0.110.01.01.01.0";if(!e)return l('video/mp4;codecs="'+t+'";');var r=e.width,n=e.height;return l('video/mp4;codecs="'+t+'";width='+r+";height="+n)};var p=function(e){var t=(null==e?void 0:e.width)||7680,r=(null==e?void 0:e.height)||4320,n=(null==e?void 0:e.codec)||"av01.0.16M.08.0.110.01.01.01.0";return!!l('video/mp4;codecs="'+n+'";width='+t+";height="+r)&&(!!parseInt(a.default.getLocalStorage("bilibili_player_force_8k"),10)||f())};t.isAV18KTypeSupported=p,t.is8KTypeSupported=function(){return p()||d()},t.getSupportedVideoIdList=function(e,t,r){try{var n=[],o="boolean"!=typeof(null==t?void 0:t.enableHEVC)||t.enableHEVC,a="boolean"!=typeof(null==t?void 0:t.enableAV1)||t.enableAV1,s=function(e){return-1!==e.indexOf("av01")?i.VIDEO_CODEC_ID.AV1:-1!==e.indexOf("hev")||-1!==e.indexOf("dvh")?i.VIDEO_CODEC_ID.HEVC:i.VIDEO_CODEC_ID.AVC},f=function(e){return e&&e instanceof Array&&e.length>0},h=function(e,t,r,n){for(var o=n[0],a=n[1],u=0,l=e;um}));if(g.length<=0)return n;for(var v=0,b=g;v=79||t===o.BROWSER_TYPE.Chrome&&r>=70};t.isBrowserSupportHardwareDecodeAV1=h,t.shouldUseHardwareDecodingAV1=function(){if(!h())return!1;var e=o.getGPUInfo().toLowerCase();return!!Object.values({rtx3xx:/rtx 3[0-9]{3}/,m1max:/m1 max/}).some((function(t){return t.test(e)}))},t.isFLACTypeSupported=function(){var e,t,r=l('audio/mp4; codecs="flac"'),n=null===(t=null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||void 0===t?void 0:t.toLowerCase(),i=o.getSafariInfo(n);return!!r&&(i.isSafari&&i.version>=13||r)},t.getVideoCodecStrategy=function(e){return s.applyCodecStrategy(e)},t.isMultiAudioTracksSupported=function(){var e=o.getCurrentBrowserInfo(),t=e.type,r=e.version;return t===o.BROWSER_TYPE.ChromiumEdge&&r>=79||t===o.BROWSER_TYPE.Chrome&&r>=69||t===o.BROWSER_TYPE.Firefox&&r>=67||t===o.BROWSER_TYPE.QQ&&r>=69||t===o.BROWSER_TYPE.Safari&&r>=13||t===o.BROWSER_TYPE.Sogou},t.getOS=function(){var e=window.navigator.userAgent,t=window.navigator.platform,r=null;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?r="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(t)?r="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?r="Windows":/Android/.test(e)?r="Android":!r&&/Linux/.test(t)&&(r="Linux"),r};var y=function(){return navigator.hardwareConcurrency||0};t.getCPULogicCount=y,t.shouldUseNativeHEVCDecode=function(){var e=o.getCurrentBrowserInfo(),t=(e.type,e.version,l('video/mp4; codecs="hev1.1.6.L120.90"'));return o.BROWSER_TYPE.ChromiumEdge,t},t.getLocalDecodeErrorInfo=function(e){var t="decode"+e+"Error",r=a.default.getLocalStorage(t);return r?JSON.parse(r):null},t.setLocalDecodeErrorInfo=function(e,t){var r="decode"+e+"Error";a.default.setLocalStorage(r,JSON.stringify(t))},t.rmLocalDecodeErrorInfo=function(e){var t="decode"+e+"Error";a.default.removeStorage(t)},t.isSupportEncoder=function(){if(!window)return!1;if(!["VideoEncoder","AudioEncoder","VideoFrame","AudioData","Worker"].every((function(e){return window[e]})))return!1;if(y()<8)return!1;var e=o.getCurrentBrowserInfo(),t=[o.BROWSER_TYPE.Chrome,o.BROWSER_TYPE.ChromiumEdge],r=e.type,n=e.version;return!!(t.includes(r)&&n>=120)}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserCodecPreferType=t.applyCodecStrategy=void 0;var i=r(2),o=r(6),a=n(r(4)),s=r(11),u="bilibili_player_codec_prefer_type",l={HARDWARE:i.VIDEO_QN.QN_4K,SOFTWARE:i.VIDEO_QN.QN_1080P_60},c=[i.VIDEO_QN.QN_8K],d={HARDWARE:i.VIDEO_QN.QN_4K,SOFTWARE:i.VIDEO_QN.QN_1080P_PLUS,WASM:i.VIDEO_QN.QN_1080P_60},f=[i.VIDEO_QN.QN_HDR10,i.VIDEO_QN.QN_DOLBY_VISION,i.VIDEO_QN.QN_8K];function p(){return parseInt(a.default.getLocalStorage(u),10)||i.USER_CODEC_PREFER_TYPE.RECOMMEND}function h(e,t,r,n,u){var d=e;if(d){var f=0;t&&t.defaultVideoQuality?f=t.defaultVideoQuality:"number"==typeof u&&(f=u);var h=l.HARDWARE,y=l.SOFTWARE;f>(s.shouldUseHardwareDecodingAV1()?h:y)&&(d=!1);var m=p();switch(m){case i.USER_CODEC_PREFER_TYPE.AV1:d=!0;break;case i.USER_CODEC_PREFER_TYPE.DISABLE:case i.USER_CODEC_PREFER_TYPE.HEVC:d=!1}var g=s.getLocalDecodeErrorInfo("AV1"),v=(new Date).getTime();if(g&&(g.reactivateTime||0)>v&&(d=!1),c.includes(f))d=!0;else{var b=o.getGPUInfo();/Vulkan/i.test(b)&&(d=!1)}s.isBrowserSupportAV1(r)||(d=!1);var _=!!+a.default.getSessionStorage("enableAV1Error");_&&(d=!1),n&&n({type:"applyAV1Strategy",message:"[1] Apply AV1 strategy, enable: "+d+", preferType: "+m+", hardwareLimit: "+h+", softwareLimit: "+y+", prevEnableAV1Error: "+_})}return d}function y(){return new Promise((function(e,t){var r="bilibili_player_codec_prefer_reset",n="1.5.2";a.default.getLocalStorage(r)!==n?(a.default.setLocalStorage(r,n),e()):t()}))}function m(e,t,r,n){var l=e;if(l){ var c=navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase(),h=c.indexOf("edge/")>-1,m=t&&t.defaultVideoQuality||n,g=d.SOFTWARE,v=d.HARDWARE,b=d.WASM,_=o.getCurrentBrowserInfo(),E=_.type,S=_.version,A=E===o.BROWSER_TYPE.Chrome&&S>108&&s.getCPULogicCount()>=8?v:g,w=m>A&&!h&&c.indexOf("chrome/")>0,T=m>v,R=!!+a.default.getSessionStorage("enableHEVCError"),C=parseInt(a.default.getLocalStorage("bilibili_player_codec_prefer_strategy"),10);window.__ENABLE_WASM_PLAYER__?m>b&&(l=!1):(w||T)&&(l=!1);var P=p();i.USER_CODEC_PREFER_TYPE.HEVC===P?l=!0:i.USER_CODEC_PREFER_TYPE.DISABLE===P||i.USER_CODEC_PREFER_TYPE.AV1===P?(l=!1,y().then((function(){a.default.setLocalStorage(u,""+i.USER_CODEC_PREFER_TYPE.RECOMMEND)})).catch((function(){}))):(y().catch((function(){})),i.USER_CODEC_PREFER_TYPE.DISABLE===C&&(l=!1));var I=s.getLocalDecodeErrorInfo("HEVC"),D=(new Date).getTime();I&&(I.reactivateTime||0)>D&&(l=!1),f.includes(m)&&(l=!0),E===o.BROWSER_TYPE.ChromiumEdge&&S<120&&(l=!1),R&&(l=!1),r&&r({type:"applyHEVCStrategy",message:"[1] Apply HEVC strategy, enable: "+l+", preferType: "+P+", hardwareLimit: "+v+", softwareLimit: "+A+", wasm: "+b+", prevEnableHEVCError: "+R+", strategyType: "+C})}return l}t.applyCodecStrategy=function(e){var t,r,n=e.state,o=e.manifest,a=e.enableAV1,u=e.enableHEVC,l=e.log,c=e.defaultVideoQn,d=i.VIDEO_CODEC_ID.HEVC,f=i.VIDEO_CODEC_ID.AV1,p=i.VIDEO_CODEC_ID.AVC,y=n?n.defaultVideoQuality:c;y=y||0;var g=-1,v=-1,b=!1,_=!1,E=o.video,S=o.duration;E&&E.forEach((function(e){e.codecid===f&&(g=s.isMIMETypeSupported('video/mp4;codecs="'+e.codecs+'";')?1:0,e.id!==y&&0!==y||(b=!0)),e.codecid===d&&(v=s.isMIMETypeSupported('video/mp4;codecs="'+e.codecs+'";')?1:0,e.id!==y&&0!==y||(_=!0))})),l&&l({type:"UA",message:""+(null===(r=null===(t=window.navigator)||void 0===t?void 0:t.userAgent)||void 0===r?void 0:r.toLowerCase())}),l&&l({type:"abilityDetect",message:"[0]Ability: isAV1CodecSupported: "+g+", isAV1HasCurrentQn: "+b+" isHEVCCodecSupported: "+v+", isHEVCHasCurrentQn: "+_});for(var A=0,w=e.state.codecStrategy;A0){var t=this.video.buffered.end(this.video.buffered.length-1),r=this.video.currentTime,n=Math.floor(1e3*(t-r))/1e3;this.swichingInfo.bufferLen=n}},e.prototype.getInfo=function(e){var r={type:-1};if(!e)return r;try{var i=this.video,o=i.currentTime,a=i.duration,s=i.readyState,u=i.buffered,l=u&&u.length,c=i.seeking,d=i.playbackRate,f=t.BUFFERING.TYPE.UNKNOWN,p=e.playbackState||t.BUFFERING.PLAYBACK.PLAYING;if(!c||p!==t.BUFFERING.PLAYBACK.PLAYING&&p!==t.BUFFERING.PLAYBACK.SWITCHING_QUALITY||(p=t.BUFFERING.PLAYBACK.SEEKING),r={type:f,isSeeking:c,cTime:o,duration:a,rState:s,nRanges:l,vLength:e.videoBufferLength,aLength:e.audioBufferLength,activity:e.networkActivity,vSpeed:Math.round(e.videoSpeed),aSpeed:Math.round(e.audioSpeed),playbackRate:d,vQn:e.videoCurrentQn,aQn:e.audioCurrentQn,retryTimes:e.retryTimes,seekSpace:e.seekSpace},p===t.BUFFERING.PLAYBACK.SEEKING)f=0===l?t.BUFFERING.TYPE.SEEKING_OUTSIDE_BUFFERED:t.BUFFERING.TYPE.SEEKING_INSIDE_BUFFERED;else{var h=this.checkGapInfo(),y=h.nativeBufferLength;if(r.nLength=y,r.cRange=h.start+"-"+h.end,h.hasGap)f=h.type,r.gap=h.gapStart+"-"+h.gapEnd,r.gapLength=h.gapLength;else if(y<1){var m=this.checkLackOfBufferInfo(e);f=m.type,r.vCode=m.videoErrorCode,r.aCode=m.audioErrorCode}else f=s>=3?t.BUFFERING.TYPE.PERFORMANCE:t.BUFFERING.TYPE.PERFORMANCE_UNKNOWN}var g=this.checkNativeErrorInfo();g.type&&(f=g.type,r.nCode=g.code);var v=e.fragmentLoadingInfo;if(v&&v.video){var b=v.video;r.vFragment=b.id+"-"+b.index,e.latestPlayurlErrorHTTPCode&&(r.hCode=e.latestPlayurlErrorHTTPCode)}v&&v.audio&&(b=v.audio,r.aFragment=b.id+"-"+b.index,e.latestPlayurlErrorHTTPCode&&(r.hCode=e.latestPlayurlErrorHTTPCode)),r.type=""+p+(f||"00")}catch(e){throw new Error(e.message)}return this.swichingInfo&&(r=n(n({},r),this.swichingInfo)),this.downloadInfo&&(r=n(n({},r),this.downloadInfo)),r},e.prototype.checkGapInfo=function(){var e=this.video,r=e.currentTime,n=e.buffered,i=n&&n.length,o=0,a=!1,s=0,u=0,l={start:0,end:0},c=0,d=t.BUFFERING.TYPE.UNKNOWN;if(i&&i>1)for(var f=0;f=r&&(o=Math.floor(1e3*(h-r))/1e3,l={start:p,end:h},d===t.BUFFERING.TYPE.GAP_BEFORE_CURRENT?u=p:s=h),p>r&&p-r<=1&&d!==t.BUFFERING.TYPE.GAP_BEFORE_CURRENT&&(a=!0,d=t.BUFFERING.TYPE.GAP_AFTER_CURRENT,u=u?Math.min(u,p):p,s=l.end),r-h<3&&r-h>=0&&(a=!0,d=t.BUFFERING.TYPE.GAP_BEFORE_CURRENT,s=h,u=l.start)}else 1===i&&(h=n.end(0),l={start:n.start(0),end:h},o=Math.floor(1e3*(h-r))/1e3);return a&&(c=Math.round(1e3*(u-s))/1e3),{type:d,start:l.start,end:l.end,nativeBufferLength:o,hasGap:a,gapStart:s,gapEnd:u,gapLength:c}},e.prototype.checkLackOfBufferInfo=function(e){var r=t.BUFFERING.TYPE.UNKNOWN,n=this.video,i=n.currentTime,o=n.buffered,a=n.duration,s=n.readyState,u=0,l=0;if(o&&o.length)if(a&&a-i<1)r=t.BUFFERING.TYPE.INTERNAL_ENDING;else{var c=this.checkNetworkInfo(e);r=c.type,u=c.videoErrorCode,l=c.audioErrorCode}else r=i<=e.startOffsetTime&&s<=1?t.BUFFERING.TYPE.INTERNAL_STARTING:(e.networkActivity.length&&e.networkActivity.reduce((function(e,t){return e+t})))<100?t.BUFFERING.TYPE.NETWORK_POOR:e.videoBufferLength?e.audioBufferLength?t.BUFFERING.TYPE.INTERNAL_UNNORMAL_RANGES:t.BUFFERING.TYPE.INTERNAL_AUDIO_RANGES:t.BUFFERING.TYPE.INTERNAL_VIDEO_RANGES;return{type:r,videoErrorCode:u,audioErrorCode:l}},e.prototype.checkNetworkInfo=function(e){var r=this,n=t.BUFFERING.TYPE.UNKNOWN,o=this.video.currentTime,a=e.videoBufferLength||0,s=e.audioBufferLength||0,u=e.networkWarningHistory,l=this.getCurrentNetworkWarningInfo({mediaType:i.STRING.VIDEO,currentQn:e.videoCurrentQn,networkWarningHistory:u,warningTime:o+a,bufferLength:a},1),c=this.getCurrentNetworkWarningInfo({mediaType:i.STRING.AUDIO,currentQn:e.audioCurrentQn,networkWarningHistory:u,warningTime:o+s,bufferLength:s},1),d=l.code,f=c.code,p=this.getBufferingTypeByPoorNetwork(d),h=this.getBufferingTypeByPoorNetwork(f);if(p||h)n=p||"00",h&&(n=""+n+h);else if(this.video.playbackRate>1)n=t.BUFFERING.TYPE.NETWORK_POOR_UNDER_PLAYBACKRATE;else{var y=e.fragmentLoadingInfo,m=function(e){if(!e)return!1;var t=e.startDownloadTime,n=e.loaderType,i=e.qn,o=e.index,a=((new Date).getTime()-t)/1e3;return r.downloadInfo||(r.downloadInfo={}),r.downloadInfo[e.mediaType]={downloadTime:a,loaderType:n,qn:i,index:o},a>5};if(y){var g=y.video,v=y.audio,b=m(g),_=m(v);n=b||_?t.BUFFERING.TYPE.NETWORK_DOWNLOAD_TOO_LONG:t.BUFFERING.TYPE.NETWORK}else n=t.BUFFERING.TYPE.NETWORK}return{type:n,videoErrorCode:d,audioErrorCode:f,videoBufferLength:a, audioBufferLength:s}},e.prototype.checkNativeErrorInfo=function(){var e=this.video.error,r=e&&e.code||0,n=t.BUFFERING.TYPE.UNKNOWN;if(e&&r)switch(r){case 1:n=t.BUFFERING.TYPE.MEDIA_ERR_ABORTED;break;case 2:n=t.BUFFERING.TYPE.MEDIA_ERR_NETWORK;break;case 3:n=t.BUFFERING.TYPE.MEDIA_ERR_DECODE;break;case 4:n=t.BUFFERING.TYPE.MEDIA_ERR_SRC_NOT_SUPPORTED;break;default:n=t.BUFFERING.TYPE.MEDIA}return{type:n,code:r}},e.prototype.getCurrentNetworkWarningInfo=function(e,t){if(void 0===t&&(t=1),!e)return{code:0};var r=e.mediaType,n={code:0,type:"",mediaType:e.mediaType},i=e.networkWarningHistory,o=e.warningTime,a=e.bufferLength,s=e.currentQn;if(i.length&&a=o&&e.id===s.toString()}));u.length&&(n=u[u.length-1])}catch(e){throw new Error("getCurrentNetworkWarningInfo error, "+JSON.stringify(e))}}return n},e.prototype.getBufferingTypeByPoorNetwork=function(e){var r=t.BUFFERING.TYPE.UNKNOWN;if(e)switch(e){case i.ERROR.CONNECT_FRAGMENT_ERROR_TIMEOUT:r=t.BUFFERING.TYPE.NETWORK_CONNECT_TIMEOUT;break;case i.ERROR.DOWNLOAD_FRAGMENT_ERROR_TIMEOUT:r=t.BUFFERING.TYPE.NETWORK_DOWNLOAD_TIMEOUT;break;case i.ERROR.DOWNLOAD_FRAGMENT_ERROR:r=t.BUFFERING.TYPE.NETWORK_DOWNLOAD_ERROR}return r},e}();t.default=o},function(e,t,r){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==f(t)&&"object"==f(r)){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},function(e,t,r){!function(e){"use strict";var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},r=function(e){var r=e;return t.hasOwnProperty(e)&&(r=t[e]),String.fromCharCode(r)},n=15,i=32,o={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},a={17:2,18:4,21:6,22:8,23:10,19:13,20:15},s={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var r=this.verboseFilter[e];this.verboseLevel>=r&&console.log(this.time+" ["+e+"] "+t)}},d=function(e){for(var t=[],r=0;ri&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=r(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new y,this.nonDisplayedMemory=new y,this.lastOutputScreen=new y,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var g=function(e,t,r){this.field=e||1,this.outputs=[t,r],this.channels=[new m(1,t),new m(2,r)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};g.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var r,n,i,o=!1;this.lastTime=e,c.setTime(e);for(var a=0;a=16&&n<=31&&n===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+d([n,i])+") is dropped")):0!==n||0!==i?(c.log("DATA","["+d([t[a],t[a+1]])+"] -> ("+d([n,i])+")"),(r=this.parseCmd(n,i))||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i)),r||(o=this.parseChars(n,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(o):c.log("WARNING","No channel found yet. TEXT-MODE?")),r?this.dataCounters.cmd+=2:o?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+d([n,i])+" orig: "+d([t[a],t[a+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var r;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;r=20===e||21===e||23===e?1:2;var n=this.channels[r-1];return 20===e||21===e||28===e||29===e?32===t?n.cc_RCL():33===t?n.cc_BS():34===t?n.cc_AOF():35===t?n.cc_AON():36===t?n.cc_DER():37===t?n.cc_RU(2):38===t?n.cc_RU(3):39===t?n.cc_RU(4):40===t?n.cc_FON():41===t?n.cc_RDC():42===t?n.cc_TR():43===t?n.cc_RTD():44===t?n.cc_EDM():45===t?n.cc_CR():46===t?n.cc_ENM():47===t&&n.cc_EOC():n.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},parseMidrow:function(e,t){var r=null;if((17===e||25===e)&&32<=t&&t<=47){if((r=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var n=this.channels[r-1];return n.insertChars([32]),n.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+d([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var r,n;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;r=e<=23?1:2,n=64<=t&&t<=95?1===r?o[e]:s[e]:1===r?a[e]:u[e];var i=this.interpretPAC(n,t);return this.channels[r-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},interpretPAC:function(e,t){var r,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=!(1&~r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},parseChars:function(e,t){var n,i=null,o=null,a=null;(e>=25?(i=2,a=e-8):(i=1,a=e),17<=a&&a<=19)?(n=17===a?t+80:18===a?t+112:t+144,c.log("INFO","Special char '"+r(n)+"' in channel "+i),o=[n],this.lastCmdA=e,this.lastCmdB=t):32<=e&&e<=127&&(o=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(o){var s=d(o);c.log("DEBUG","Char codes = "+s.join(","))}return o},parseBackgroundAttributes:function(e,t){var r,n,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(r={},16===e||24===e?(n=Math.floor((t-32)/2),r.background=l[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(r),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e=this.state.maxCacheLength&&this.state.networkActivityLoadedList.splice(0,1),r&&this.state.networkActivityLoadedList.push({time:n,loaded:Math.max(r,0)})},e.prototype.getNetworkActivity=function(){return this.state.networkActivityHistory.length?this.state.networkActivityHistory[this.state.networkActivityHistory.length-1]:0},e.prototype.getNetworkActivityHistory=function(e){return void 0===e&&(e=0),e?this.state.networkActivityHistory.slice(this.state.networkActivityHistory.length-e):this.state.networkActivityHistory},e.prototype.destroy=function(){clearTimeout(this.state&&this.state.networkActivityTimer),this.state.networkActivityLoadedList.length=0,this.state.networkActivityHistory.length=0,this.state=null},e.prototype.initalize=function(){this.runNewWorkActivityTimer()},e.prototype.runNewWorkActivityTimer=function(){var e=this;this.runNetworkActivity(),clearTimeout(this.state.networkActivityTimer),this.state.networkActivityTimer=window.setTimeout((function(){e.runNewWorkActivityTimer()}),this.state.runningInterval)},e.prototype.runNetworkActivity=function(){var e=this.state.runningInterval,t=Math.floor(performance.now()),r=this.state.networkActivityLatestTraceTime,n=this.state.networkActivityLoadedList.filter((function(n){return t-n.timer}));this.state.networkActivityLatestTraceTime=t;var i=0;n&&n.length&&n.forEach((function(e){return i+=e.loaded})),this.state.networkActivityHistory.length>=this.state.maxCacheLength&&this.state.networkActivityHistory.splice(0,1),this.state.networkActivityHistory.push(Math.max(i,0))},e}();t.default=n},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),o=r(13),a=n(r(4)),s=function(){function e(){this.bufferingHistory=[],this.state={enableHEVC:!1}}return e.prototype.destroy=function(){this.state=null,this.bufferingHistory.length=0},e.prototype.setHEVCEnableFlag=function(e){return void 0===e&&(e=!1),this.state.enableHEVC=e,this},e.prototype.push=function(e){this.bufferingHistory.length>=this.MAX_HISTORY_LENGTH&&this.bufferingHistory.shift(),e.timestamp=this.getNow(),this.bufferingHistory.push(e),this.optimize()},e.prototype.setOnOptimizingCallback=function(e){this.state.onOptimizingCallback=e},e.prototype.onOptimzing=function(e,t){"function"==typeof this.state.onOptimizingCallback&&this.state.onOptimizingCallback(e,t)},e.prototype.optimize=function(){var e=this.getNow(),t=this.bufferingHistory.filter((function(t){return e-t.timestamp<=2e4}));if(this.state.enableHEVC){var r=""+o.BUFFERING.PLAYBACK.PLAYING+o.BUFFERING.TYPE.PERFORMANCE,n=t.filter((function(e){return r===e.type}));n&&n.length>=10&&(this.state.enableHEVC=!1,this.disableHEVCFlag())}},e.prototype.disableHEVCFlag=function(){1!==parseInt(a.default.getLocalStorage("bilibili_player_codec_prefer_type"),10)&&(a.default.setLocalStorage("bilibili_player_codec_prefer_strategy","2"),this.onOptimzing(i.EVENTS.BUFFERING_OPTIMIZATION,{type:"hevcPerf"}))},e.prototype.getNow=function(){var e;return(null===(e=window.performance)||void 0===e?void 0:e.now())||Date.now()},e}();t.default=s},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0){var s=1e3/a;e.lows.length>=43200&&e.lows.shift(),e.lows.push(s)}t=n,o>=1e3&&(s=e.frameCount/o*1e3,e.frameCount=1,e.lastFPSTime=i,e.fpsArr.length>=7200&&e.fpsArr.shift(),e.fpsArr.push(Math.floor(s)||1)),e.rafId=requestAnimationFrame(r)};this.rafId=requestAnimationFrame(r)},e.prototype.onChargingStateChange=function(){this.chargingState=+this.battery.charging},e.prototype.runBatteryStateDetect=function(){var e=this;"function"==typeof navigator.getBattery&&(this.onChargingStateChange=this.onChargingStateChange.bind(this),navigator.getBattery().then((function(t){e.battery=t,e.chargingState=+t.charging,t.addEventListener("chargingchange",e.onChargingStateChange)})))},e}();t.default=i},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(10)),o=r(2),a=function(){function e(e){this.player=e,this.ncGrayPercentage=Math.random(),this.p2pGrayPercentage=Math.random(),this.ncDisable=this.getDisableValue("nc_disable"),this.p2pDisable=this.getDisableValue("rp_disable")}return Object.defineProperty(e.prototype,"isUseNC",{get:function(){return this.ncGrayPercentage>=this.ncDisable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUseP2P",{get:function(){return this.p2pGrayPercentage>=this.p2pDisable},enumerable:!1,configurable:!0}),e.prototype.getDisableValue=function(e){var t=0,r=i.default.getFawkesConfigValue(o.STRING.DASH_CONFIG,e);return""!==r&&(t=Number(r)),t},e.prototype.destroy=function(){this.player=null},e}();t.default=a},function(e,t,r){"use strict";r.r(t),r.d(t,"MediaPlayer",(function(){return n.a})),r.d(t,"Protection",(function(){return ae}));var n=r(9),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.findCencContentProtection=function(e){for(var t=null,r=0;r0&&(t+=4+16*r.getUint32(t)),t+=4,e.slice(t)},e.getPSSHForKeySystem=function(t,r){var n=e.parsePSSHList(r);return n.hasOwnProperty(t.uuid.toLowerCase())?n[t.uuid.toLowerCase()]:null},e.parseInitDataFromContentProtection=function(e,t){return"pssh"in e?t.decodeArray(e.pssh.__text).buffer:null},e.parsePSSHList=function(e){if(null===e)return[];for(var t=new DataView(e.buffer||e),r={},n=0;;){var i,o,a=void 0,s=n;if(n>=t.buffer.byteLength)break;if(i=n+t.getUint32(n),n+=4,1886614376===t.getUint32(n))if(n+=4,0===(o=t.getUint8(n))||1===o){n++,n+=3,a="";var u=void 0,l=void 0;for(u=0;u<4;u++)a+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=4,a+="-",u=0;u<2;u++)a+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,a+="-",u=0;u<2;u++)a+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,a+="-",u=0;u<2;u++)a+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;for(n+=2,a+="-",u=0;u<6;u++)a+=1===(l=t.getUint8(n+u).toString(16)).length?"0"+l:l;n+=6,a=a.toLowerCase(),t.getUint32(n),n+=4,r[a]=t.buffer.slice(s,i),n=i}else n=i;else n=i}return r},e}(),o=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=r},a=function e(t,r,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),r&&r.length&&(this.videoCapabilities=r),this.distinctiveIdentifier=n,this.persistentState=i,this.sessionTypes=o},s="function"==typeof Symbol&&"symbol"==f(Symbol.iterator)?function(e){return f(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":f(e)};function u(e){var t,r=(e=e||{}).protectionKeyController,n=e.protectionModel,u=e.eventBus,l=e.events,c=e.log,d=e.BASE64,f=e.constants,p=e.ignoreEmeEncryptedEvent,h=void 0,y=void 0,m=void 0,g=void 0,v=void 0,b=void 0;function _(e,t){var o=i.getPSSHForKeySystem(b,e),a=A(b);if(o){for(var s=n.getAllInitData(),d=0;d0?t.audioRobustness:v,s=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:v,u=T(e);return y.forEach((function(e){e.type===f.AUDIO?r.push(new o(e.codec,i)):e.type===f.VIDEO&&n.push(new o(e.codec,s))})),new a(r,n,"optional","temporary"===u?"optional":"required",[u])}function T(e){var t=A(e);return t&&t.sessionType?t.sessionType:g}function R(e,t){var i=this,o=[];e=e.sort((function(t,r){return(m&&m[t.ks.systemString]&&m[t.ks.systemString].priority>=0?m[t.ks.systemString].priority:e.length)-(m&&m[r.ks.systemString]&&m[r.ks.systemString].priority>=0?m[r.ks.systemString].priority:e.length)}));var a=void 0;if(b){for(a=0;a0&&n.setServerCertificate(d.decodeArray(s.serverCertificate).buffer);for(var c=0;c0&&R(t,!0)},createKeySession:_,loadKeySession:E,removeKeySession:function(e){n.removeKeySession(e)},closeKeySession:function(e){n.closeKeySession(e)},setServerCertificate:function(e){n.setServerCertificate(e)},setMediaElement:S,setSessionType:function(e){g=e},setRobustnessLevel:function(e){v=e},setProtectionData:function(e){m=e,r.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return r.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return r?r.getKeySystems():[]},reset:function(){u.off(l.INTERNAL_KEY_MESSAGE,I,this),u.off(l.INTERNAL_KEY_STATUS_CHANGED,P,this),S(null),b=void 0,n&&(n.reset(),n=null),y=[]}},h=[],y=[],g="temporary",v="",t}u.__dashjs_factory_name="ProtectionController";var l=dashjs.FactoryMaker.getClassFactory(u),c=function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=r},d=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r&&"persistent"!==r&&"temporary"!==r)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=r}return e.prototype.toJWK=function(){var e=void 0,t=this.keyPairs.length,r={keys:[]};for(e=0;e%CUSTOMDATA%'.replace("%CUSTOMDATA%",e),i=[],o=0;o0&&(arguments[0]&&("string"==typeof arguments[0]?e=arguments[0]:t=arguments[0]),arguments[1]&&("string"==typeof arguments[1]?e=arguments[1]:t=arguments[1])),"expired"===e?n.trigger(i.INTERNAL_KEY_STATUS_CHANGED,{error:"License has expired"}):n.trigger(i.INTERNAL_KEY_STATUS_CHANGED,{status:e,keyId:t})}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(i.INTERNAL_KEY_MESSAGE,{data:new q(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getSessionType:function(){return r}};return e.addEventListener("keystatuseschange",s),e.addEventListener("message",s),e.closed.then((function(){y(s),o("DRM: Session closed. SessionID = "+s.getSessionID()),n.trigger(i.KEY_SESSION_CLOSED,{data:s.getSessionID()})})),l.push(s),s}return t={getAllInitData:function(){for(var e=[],t=0;t=1?t():(e=t.bind(this),u.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t0&&(u=d.ksConfiguration.videoCapabilities[0]),null===u&&null!==d.ksConfiguration.audioCapabilities&&d.ksConfiguration.audioCapabilities.length>0&&(u=d.ksConfiguration.audioCapabilities[0]),null===u)throw new Error("Can not create sessions for unknown content types.");var p=u.contentType,h=c.createSession(p,new Uint8Array(e),a?new Uint8Array(a):null),y=function(e,t){return{session:e,initData:t,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case s.error:n.trigger(i.KEY_ERROR,{data:new K(this,"KeyError")});break;case s.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(i.INTERNAL_KEY_MESSAGE,{data:new q(this,t,e.destinationURL)});break;case s.ready:o("DRM: Key added."),n.trigger(i.KEY_ADDED);break;case s.close:o("DRM: Session closed. SessionID = "+this.getSessionID()),n.trigger(i.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}(h,e);h.addEventListener(s.error,y),h.addEventListener(s.message,y),h.addEventListener(s.ready,y),h.addEventListener(s.close,y),f.push(y),o("DRM: Session created. SessionID = "+y.getSessionID()),n.trigger(i.KEY_SESSION_CREATED,{data:y})},updateKeySession:function(e,t){var r=e.session;h.isClearKey(l)?r.update(new Uint8Array(t.toJWK())):r.update(new Uint8Array(t))},closeKeySession:y,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},reset:function(){try{for(var e=0;e0&&(t=f.shift(),p.push(t),t.sessionID=e.sessionId,n.trigger(i.KEY_SESSION_CREATED,{data:t})):f.length>0&&(t=f.shift(),p.push(t),0!==f.length&&u.mediaKeyMessageError("Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!")),t){var l=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=l,n.trigger(i.INTERNAL_KEY_MESSAGE,{data:new q(t,l,e.defaultURL)})}else o("No session token found for key message")}}},t}ee.__dashjs_factory_name="ProtectionModel_01b";var te=dashjs.FactoryMaker.getClassFactory(ee),re=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],ne=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function ie(){var e=this.context;function t(e,t){for(var r=0;r>6),t.push(128|63&n)):n<65536?(t.push(224|n>>12),t.push(128|63&n>>6),t.push(128|63&n)):(t.push(240|n>>18),t.push(128|63&n>>12),t.push(128|63&n>>6),t.push(128|63&n))}return t},r.Utils.appendBox=function(e,t,r){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==r)if(null!=r){var n,i=-1;if("number"==typeof r)i=r;else{if("string"==typeof r)n=r;else{if("object"!=s(r)||!r.type)return void e.boxes.push(t);n=r.type}for(var o=0;o>3,t},i.prototype._readUint=function(e){var t,r,n=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:n=this._raw.getUint8(i);break;case 16:n=this._raw.getUint16(i);break;case 24:n=((t=this._raw.getUint16(i))<<8)+(r=this._raw.getUint8(i+2));break;case 32:n=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),r=this._raw.getUint32(i+4),n=t*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,n},i.prototype._readString=function(e){for(var t="",r=0;r0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var r=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,r}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var r,n,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:r=(16776960&t)>>8,n=255&t,this._rawo.setUint16(i,r),this._rawo.setUint8(i+2,n);break;case 32:this._rawo.setUint32(i,t);break;case 64:n=t-(r=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,r),this._rawo.setUint32(i+4,n)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var r=0;r>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32), this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},601:function(e,t,r){"use strict";var n=r(81),i=r.n(n),o=r(645),a=r.n(o)()(i());a.push([e.id,".-bwp-internal-container {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n position: relative;\n min-width: inherit;\n max-width: inherit;\n min-height: inherit;\n max-height: inherit;\n object-fit: inherit;\n}\n\n.-bwp-internal-render-canvas {\n width: 100%;\n height: 100%;\n display: block;\n position: relative;\n object-fit: inherit;\n}\n\n.-bwp-internal-proxy-video-element {\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: none;\n position: absolute;\n margin: inherit;\n padding: inherit;\n object-fit: inherit;\n}\n",""]),t.Z=a},645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},81:function(e){"use strict";e.exports=function(e){return e[1]}},477:function(e){"use strict";e.exports=function(e,t,r,n){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var a=i.URL||i.webkitURL,s=a.createObjectURL(o),u=new i[t](s,r);return a.revokeObjectURL(s),u}catch(n){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),r)}}catch(e){if(!n)throw Error("Inline worker is not supported");return new i[t](n,r)}}},61:function(e,t,r){var n=r(698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof h?t:h,o=Object.create(i.prototype),a=new R(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=A(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p={};function h(){}function y(){}function m(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(C([])));b&&b!==r&&o.call(b,s)&&(g=b);var _=m.prototype=h.prototype=Object.create(g);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,a,s,u){var l=f(e[i],e,a);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==n(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(l.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function A(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,p;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":s(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,r){var n=r(61)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==("undefined"==typeof globalThis?"undefined":s(globalThis))?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,exports:{}};return e[n](o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){"use strict";r.d(n,{default:function(){return kn}});var e,t,i,o,a,u,l,c="4.3.18";function d(e){return d="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":s(e)},d(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r=S(t,B).length||e<0)throw new F}}),A(this,B,[])}return y(e,[{key:"length",get:function(){return S(this,B).length}},{key:"get",value:function(e){return S(this,V).call(this,e),S(this,B)[e]}},{key:"start",value:function(e){return S(this,V).call(this,e),S(this,B)[e].start}},{key:"end",value:function(e){return S(this,V).call(this,e),S(this,B)[e].end}},{key:"add",value:function(e,t){var r=0;for(r=0;rS(this,B)[r].start);r++);for(S(this,B).splice(r,0,{start:e,end:t}),r=0;r=S(this,B)[r].end)S(this,B).splice(r,1),r--;else{if(e>S(this,B)[r].start&&tS(this,B)[r].start&&eS(this,B)[r].start&&t=r.start&&e<=r.end)return!0}return!1}}]),e}();function j(e,t){return e.start<=t.start&&t.start<=e.end&&e.end<=t.end?{start:t.start,end:e.end}:t.start<=e.start&&e.start<=t.end&&t.end<=e.end?{start:e.start,end:t.end}:t.start<=e.start&&e.start<=t.end&&e.end<=t.end?{start:e.start,end:e.end}:e.start<=t.start&&t.start<=e.end&&t.end<=e.end?{start:t.start,end:t.end}:null}function H(e,t){for(var r=new W,n=0;n=i.start&&a.starti.start){var s=j(i,a);s&&r.addRange(s)}if(a.start>i.end)break}return r}var Z=y((function e(){p(this,e)}));_(Z,"MIN_DECODE_BUFFER_TIME",4),_(Z,"MAX_DECODE_BUFFER_TIME",8);var Y=Z,K=function(e){g(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(){return p(this,r),t.apply(this,arguments)}return y(r)}(function(e){g(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(){var e;return p(this,r),_(m(e=t.call(this)),"tracks",void 0),e.tracks=[],v(e,new Proxy(m(e),{get:function(e,t,r){return Number.isNaN(Number(t))?"function"==typeof e[t]?e[t].bind(e):Reflect.get(e,t,r):e.tracks[t]}}))}return y(r,[{key:"length",get:function(){return this.tracks.length}},{key:"getTrackById",value:function(e){for(var t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=c&&ec&&t<=d){var p=o[u+1];i=p?p.fpts:d}dt||(delete o[u],r+=1)}return this.trackRanges.remove(n,i),this.mediaSegmentBufferCount=Object.keys(o).length,r>0}},{key:"getInitSegment",value:function(e){return this.initSegmentBuffer[e]}},{key:"getMediaSegment",value:function(e){return this.mediaSegmentBuffer[e]}},{key:"getMediaSegmentTimeRange",value:function(e){var t=this.mediaSegmentBuffer[e];return t?{start:t.fpts,end:t.lpts}:{start:NaN,end:NaN}}},{key:"isLastSegment",value:function(e){var t=Object.keys(this.mediaSegmentBuffer);return parseInt(t.pop()||"-1",10)===e}},{key:"getCurrentSegmentIndex",value:function(e){for(var t=Object.keys(this.mediaSegmentBuffer),r=0;r=n.fpts&&e<=n.lpts)return parseInt(t[r],10);if(e>n.lpts){var i=this.mediaSegmentBuffer[t[r+1]];if(i&&e0?t[t.length-1]:null}},{key:"convertToDashIsoBox",value:function(e){if(!e)return null;var t=new ue(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}}]),e}(),ce=y((function e(t,r,n){p(this,e),_(this,"lastCompletedOffset",void 0),_(this,"found",void 0),_(this,"size",void 0),this.lastCompletedOffset=t,this.found=r,this.size=n})),de=function(){function e(){p(this,e)}return y(e,[{key:"parse",value:function(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=se.parseBuffer(e),r=new le;return r.setData(t),r}},{key:"findLastTopIsoBoxCompleted",value:function(e,t,r){if(void 0===r&&(r=0),!t||r+8>=t.byteLength)return new ce(0,!1);for(var n,i=t instanceof ArrayBuffer?new Uint8Array(t):t,o=0;r=0?n=new ce(r,!0,a):o=r+a),r+=a}return n||new ce(o,!1)}},{key:"getFirstBoxType",value:function(e){return e&&e.boxes&&e.boxes.length?e.boxes[0].type:null}},{key:"getSamplesInfo",value:function(e,t,r,n){var i;if(t)i=t;else if(i=this.parse(e),!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};if(!i)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var o,a,s,u,l,c,d=i.getBoxes("moof"),f=i.getBoxes("mfhd"),p=[],h=NaN,y=i.getBoxes("moof").length,m=f[f.length-1].sequence_number;a=0;for(var g=-1,v=-1,b=0;bv&&(g++,v+=N.entries[g].sample_delta),O==v){x.subSizes=[];for(var L=N.entries[g],M=0;M0&&(p[S]?p[S]=p[S].concat(A):p[S]=A)}return{sampleList:p,lastSequenceNumber:m,totalDuration:h,numSequences:y}}},{key:"getMediaTimescaleFromMoov",value:function(e){var t=this.parse(e),r=t?t.getBox("mdhd"):void 0;return r?r.timescale:NaN}},{key:"parseUint32",value:function(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}},{key:"parseIsoBoxType",value:function(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}},{key:"findInitRange",value:function(e){var t,r,n=null,i=this.parse(e);if(!i)return n;var o=i.getBox("ftyp"),a=i.getBox("moov");return a&&a.isComplete&&(t=o?o.offset:a.offset,r=a.offset+a.size-1,n="".concat(t,"-").concat(r)),n}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();_(de,"instance",void 0);var fe=de;function pe(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var he=new WeakMap,ye=new WeakMap,me=new WeakMap,ge=new WeakMap,ve=new WeakMap,be=new WeakMap,_e=new WeakMap,Ee=new WeakMap,Se=new WeakMap,Ae=new WeakMap,we=new WeakMap,Te=new WeakMap,Re=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,Ie=new WeakMap,De=new WeakMap,Oe=new WeakMap,xe=new WeakMap,ke=new WeakMap,Ne=new WeakMap,Le=new WeakMap,Me=new WeakMap,Fe=new WeakMap,Ue=new WeakMap,Be=new WeakMap,Ge=new WeakMap,Ve=new WeakMap,We=new WeakMap,je=new WeakMap,He=new WeakMap,Ze=new WeakMap,Ye=new WeakMap,Ke=new WeakMap,qe=new WeakMap,ze=new WeakMap,Xe=new WeakMap,Qe=new WeakMap,Je=new WeakMap,$e=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap,nt=function(t){g(n,t);var r=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(n);function n(t,i,a,s){var u,c,d;return p(this,n),pe(m(u=r.call(this)),he,{writable:!0,value:void 0}),pe(m(u),ye,{writable:!0,value:"[BwpSourceBuffer]"}),pe(m(u),me,{writable:!0,value:void 0}),_(m(u),"updating",void 0),pe(m(u),ge,{writable:!0,value:void 0}),pe(m(u),ve,{writable:!0,value:void 0}),_(m(u),"textTracks",void 0),pe(m(u),be,{writable:!0,value:void 0}),pe(m(u),_e,{writable:!0,value:void 0}),_(m(u),"onupdatestart",void 0),_(m(u),"onupdate",void 0),_(m(u),"onupdateend",void 0),_(m(u),"onerror",void 0),_(m(u),"onabort",void 0),pe(m(u),Ee,{writable:!0,value:void 0}),pe(m(u),Se,{writable:!0,value:void 0}),pe(m(u),Ae,{writable:!0,value:void 0}),pe(m(u),we,{writable:!0,value:void 0}),pe(m(u),Te,{writable:!0,value:void 0}),_(m(u),"generateTimestampsFlag",void 0),pe(m(u),Re,{writable:!0,value:void 0}),_(m(u),"mediaType",void 0),pe(m(u),Ce,{writable:!0,value:void 0}),pe(m(u),Pe,{writable:!0,value:void 0}),pe(m(u),Ie,{writable:!0,value:void 0}),pe(m(u),De,{writable:!0,value:void 0}),pe(m(u),Oe,{writable:!0,value:void 0}),pe(m(u),xe,{writable:!0,value:void 0}),pe(m(u),ke,{writable:!0,value:void 0}),pe(m(u),Ne,{writable:!0,value:void 0}),pe(m(u),Le,{writable:!0,value:void 0}),pe(m(u),Me,{writable:!0,value:void 0}),pe(m(u),Fe,{writable:!0,value:void 0}),pe(m(u),Ue,{writable:!0,value:.1}),pe(m(u),Be,{writable:!0,value:function(e){for(var t=0;t1?1:0;A(m(u),ke,d[f].samplerate),S(m(u),he).log(S(m(u),ye),"[".concat(u.mediaType,"] get audio sample rate ").concat(S(m(u),ke)))}if(S(m(u),Re)){S(m(u),he).warn(S(m(u),ye),"[".concat(u.mediaType,"] firstinit is true, received new init segment."));var p=S(m(u),et).call(m(u),s.track_id);if(!p)throw new Error("Firstinit is true, but cantnot get already push init segment!");S(m(u),Me)[s.track_id]=p.appendInitSegment({buffer:S(m(u),Ee),width:s.width,height:s.height,volume:s.volume})}var h=!1;if(!S(m(u),Re)){h=!0;var y=new re;y.trackId=s.track_id,S(m(u),Me)[s.track_id]=y.appendInitSegment({buffer:S(m(u),Ee),width:s.width,height:s.height,volume:s.volume}),S(m(u),Ae).push(y),h&&(S(m(u),Ce).activeSourceBuffers.push(m(u)),S(m(u),Ce).activeSourceBuffers.dispatchEvent(new Event("addsourcebuffer"))),A(m(u),Re,!0)}if(S(m(u),Pe).readyState===o.HAVE_NOTHING){S(m(u),he).log(S(m(u),ye),"[".concat(u.mediaType,"] init segment loop: BwpElement is HAVE_NOTHING"));for(var g=!0,v=S(m(u),Ce).sourceBuffers,b=0;b=o.HAVE_CURRENT_DATA&&S(m(u),Pe)[ae.SET_READY_STATE](o.HAVE_METADATA)}}),pe(m(u),Ke,{writable:!0,value:function(){var e,t;if(!S(m(u),Ee))throw new Error("Cannot get input buffer!");var r=S(m(u),De).getSamplesInfo(S(m(u),Ee),S(m(u),Oe),S(m(u),Ne),S(m(u),Le)).sampleList[0];if(!r||0===r.length)throw new Error("[BwpSourceBuffer] parsed sample list is empty!");if(!S(m(u),xe))throw new Error("[BwpSourceBuffer] timescale is undefined!");var n=(null===(e=S(m(u),Oe))||void 0===e?void 0:e.getBox("tfhd")).track_id,i=S(m(u),et).call(m(u),n);if(!i)throw new Error("[BwpSourceBuffer] cannot get trackBuffer!");var a=r[r.length-1],s=r[0].dts/S(m(u),xe),l=r[0].pts/S(m(u),xe),c=a.pts/S(m(u),xe);0===s&&(l=0),c>S(m(u),_e)&&(c=S(m(u),_e));var d=S(m(u),Pe),f=(null===(t=S(m(u),Oe))||void 0===t?void 0:t.getBox("mfhd")).sequence_number;i.ldt=a.dts,i.lfd=a.duration,i.appendMediaSegment({sequenceNumber:f,initSegmentIndex:S(m(u),Me)[n],buffer:S(m(u),Ee),fpts:l,lpts:c});var p=d.currentTime,h=d.buffered;S(m(u),he).log(S(m(u),ye),"[".concat(u.mediaType,"] appendBuffer mediaSegment, fpts: ").concat(l.toFixed(5),", lpts: ").concat(c.toFixed(5))),h.container(p)&&(d.readyState===o.HAVE_METADATA&&d[ae.SET_READY_STATE](o.HAVE_CURRENT_DATA),d.readyState===o.HAVE_CURRENT_DATA&&h.end(0)>p&&d[ae.SET_READY_STATE](o.HAVE_FUTURE_DATA),d.readyState===o.HAVE_FUTURE_DATA&&h.end(0)-h.start(0)>=S(m(u),Ue)&&d[ae.SET_READY_STATE](o.HAVE_ENOUGH_DATA)),d.readyState>=o.HAVE_METADATA&&z(d,ie.PROGRESS)}}),pe(m(u),qe,{writable:!0,value:function(e){}}),pe(m(u),ze,{writable:!0,value:function(){S(m(u),Xe).call(m(u)),u.updating=!1,z(m(u),"error"),z(m(u),"updateend"),S(m(u),Ce).endOfStream("decode")}}),pe(m(u),Xe,{writable:!0,value:function(){S(m(u),he).log(S(m(u),ye),"[".concat(u.mediaType,"] call resetParseState()")),S(m(u),Te),S(m(u),Qe).call(m(u)),A(m(u),Ee,null),A(m(u),Oe,null),A(m(u),Te,"WAITING_FOR_SEGMENT")}}),pe(m(u),Qe,{writable:!0,value:function(){for(var e=0;e=e&&s.currentTimeo.HAVE_METADATA&&s[ae.SET_READY_STATE](o.HAVE_METADATA),a&&s.readyState>=o.HAVE_METADATA&&z(s,ie.PROGRESS))}S(m(u),we)&&A(m(u),we,!1)}}),pe(m(u),et,{writable:!0,value:function(e){for(var t=0;t0){var o=i.end(i.length-1);o>t&&(t=o)}}if(0===t)return S(this,ge).length>0&&S(this,ge).clear(),S(this,ge);var a=new W;a.add(0,t);for(var s=0;s0){var c=u.end(l-1);S(this,Ce).readyState===e.ENDED&&(t=c)}}return A(this,ge,a),S(this,ge)}},{key:"timestampOffset",get:function(){return S(this,ve)},set:function(e){if(S(this,rt).call(this),S(this,Ie).call(this),"PARSING_MEDIA_SEGMENT"===S(this,Te))throw new M;A(this,ve,e)}},{key:"appendWindowStart",get:function(){return S(this,be)},set:function(e){if(S(this,he).log(S(this,ye),"[".concat(this.mediaType,"] set appendWindowStart: ").concat(e)),S(this,rt).call(this),e<0||e>=S(this,_e))throw new TypeError("AppendWindowStart cannot greater than or equal End.");A(this,be,e)}},{key:"appendWindowEnd",get:function(){return S(this,_e)},set:function(e){if(S(this,he).log(S(this,ye),"[".concat(this.mediaType,"] set appendWindowEnd: ").concat(e)),S(this,rt).call(this),Number.isNaN(e))throw new TypeError;if(e<=S(this,be))throw new TypeError("AppendWindowEnd cannot less then or equal Start.");A(this,_e,e)}},{key:"appendBuffer",value:function(e){if(S(this,We).call(this),S(this,Ee)){var t=new Uint8Array(S(this,Ee)),r=new Uint8Array(e),n=new Uint8Array(t.length+r.length);n.set(t),n.set(r,t.length),A(this,Ee,n.buffer)}else A(this,Ee,e);this.updating=!0,this.dispatchEvent(new Event("updatestart")),S(this,je).call(this)}},{key:"abort",value:function(){if(S(this,tt).call(this))throw new Error("This SourceBuffer has been removed from the parent media source.");if(S(this,Ce).readyState!==e.OPEN)throw new M;this.updating&&(S(this,he).log(S(this,ye),"[".concat(this.mediaType,"] Call abort when this.updating is true.")),this.updating=!1,z(this,"abort"),z(this,"updateend")),S(this,Xe).call(this),this.appendWindowStart=0,this.appendWindowEnd=Number.POSITIVE_INFINITY}},{key:"remove",value:function(e,t){S(this,rt).call(this),S(this,he).log(S(this,ye),"[".concat(this.mediaType,"] remove buffer: ").concat(e,", ").concat(t));var r=S(this,Ce).duration;if(Number.isNaN(r))throw new TypeError("MediaSource duration cannot NaN");if(e<0||e>r)throw new TypeError("Start must be valid.");if(t<=e||Number.isNaN(t))throw new TypeError("end must be valid.");S(this,Ie).call(this),S(this,Je).call(this,e,t)}}]),n}(T),it=nt;function ot(){ot=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,n,i){var o=new RegExp(e,n);return t.set(o,i||t.get(e)),f(o,r.prototype)}function n(e,r){var n=t.get(r);return Object.keys(n).reduce((function(t,r){return t[r]=e[n[r]],t}),Object.create(null))}return g(r,RegExp),r.prototype.exec=function(t){var r=e.exec.call(this,t);return r&&(r.groups=n(r,this)),r},r.prototype[Symbol.replace]=function(r,i){if("string"==typeof i){var o=t.get(this);return e[Symbol.replace].call(this,r,i.replace(/\$<([^>]+)>/g,(function(e,t){return"$"+o[t]})))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,r,(function(){var e=arguments;return"object"!=d(e[e.length-1])&&(e=[].slice.call(e)).push(n(e,a)),i.apply(this,e)}))}return e[Symbol.replace].call(this,r,i)},ot.apply(this,arguments)}function at(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var st=new WeakMap,ut=new WeakMap,lt=new WeakMap,ct=new WeakMap,dt=new WeakMap,ft=new WeakMap,pt=new WeakMap,ht=new WeakMap,yt=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap,bt=new WeakMap,_t=new WeakMap,Et=new WeakMap,St=function(t){g(n,t);var r=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(n);function n(){var t;return p(this,n),at(m(t=r.call(this)),st,{writable:!0,value:void 0}),at(m(t),ut,{writable:!0,value:"[BwpMediaSource]"}),_(m(t),"sourceBuffers",void 0),_(m(t),"activeSourceBuffers",void 0),at(m(t),lt,{writable:!0,value:void 0}),at(m(t),ct,{writable:!0,value:void 0}),_(m(t),"onsourceopen",void 0),_(m(t),"onsourceended",void 0),_(m(t),"onsourceclose",void 0),at(m(t),dt,{writable:!0,value:void 0}),at(m(t),ft,{writable:!0,value:void 0}),at(m(t),pt,{writable:!0,value:void 0}),at(m(t),ht,{writable:!0,value:function(e){if(S(m(t),ct)!==e){for(var r=NaN,n=0;n0){var o=i.end(i.length-1);o>-1&&(!r||o>r)&&(r=o)}}if(r&&e0){var a=o.end(o.length-1);a>n&&(n=a)}}S(m(t),ht).call(m(t),n)}}}),_(m(t),"createObjectURL",(function(){window[ae.BWPHEVC]||(window[ae.BWPHEVC]={});var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),r="blob:".concat(window.location.origin,"/").concat(e);return window[ae.BWPHEVC][r]=m(t),r})),at(m(t),mt,{writable:!0,value:function(e){A(m(t),ft,e),window[ae.DOCUMENT_HAS_SHOWED]?(A(m(t),pt,!1),S(m(t),bt).call(m(t))):A(m(t),pt,!0)}}),at(m(t),gt,{writable:!0,value:function(){A(m(t),lt,e.CLOSED),A(m(t),ct,NaN);for(var r=t.activeSourceBuffers.length;r>0;r--)t.activeSourceBuffers.remove(r-1);t.activeSourceBuffers.dispatchEvent(new Event("removesourcebuffer"));for(var n=t.sourceBuffers.length;n>0;n--)t.sourceBuffers.remove(n-1);t.sourceBuffers.dispatchEvent(new Event("removesourcebuffer")),z(m(t),"sourceclose"),S(m(t),st).warn(S(m(t),ut),"source close")}}),at(m(t),vt,{writable:!0,value:function(){S(m(t),lt)===e.ENDED&&(A(m(t),lt,e.OPEN),z(m(t),"sourceopen"),S(m(t),st).log(S(m(t),ut),"source open"))}}),at(m(t),bt,{writable:!0,value:function(){document.removeEventListener("visibilitychange",S(m(t),_t)),A(m(t),lt,e.OPEN),z(m(t),"sourceopen"),S(m(t),st).log(S(m(t),ut),"source open")}}),at(m(t),_t,{writable:!0,value:function(){S(m(t),Et).call(m(t))&&(window[ae.DOCUMENT_HAS_SHOWED]||(window[ae.DOCUMENT_HAS_SHOWED]=!0),S(m(t),pt)&&(A(m(t),pt,!1),S(m(t),st).warn(S(m(t),ut),"visibility change trigger sourceopen"),setTimeout((function(){S(m(t),bt).call(m(t))}),0)))}}),at(m(t),Et,{writable:!0, value:function(){return"visible"===document.visibilityState}}),A(m(t),st,te.getInstance()),t.sourceBuffers=new R,t.activeSourceBuffers=new R,A(m(t),lt,e.CLOSED),A(m(t),ct,NaN),A(m(t),dt,!0),A(m(t),pt,!1),void 0===window[ae.DOCUMENT_HAS_SHOWED]&&(window[ae.DOCUMENT_HAS_SHOWED]=S(m(t),Et).call(m(t))),window[ae.DOCUMENT_HAS_SHOWED]||document.addEventListener("visibilitychange",S(m(t),_t)),t[ae.MEDIASOURCE_ATTACH]=S(m(t),mt),t[ae.MEDIASOURCE_DETACH]=S(m(t),gt),S(m(t),st).log(S(m(t),ut),"MediaSource CREATE, readyState is: ".concat(S(m(t),lt))),t}return y(n,[{key:"readyState",get:function(){return S(this,lt)}},{key:"duration",get:function(){return S(this,lt)===e.CLOSED?NaN:S(this,ct)},set:function(t){if(!t||t<0)throw new TypeError("Failed to set the 'duration' property on 'BwpMediaSource': The duration provided (".concat(t,") is less than the minimum bound (0)."));if(S(this,lt)!==e.OPEN)throw new DOMException("Failed to set the 'duration' property on 'BwpMediaSource': The BwpMediaSource's readyState is not 'open'.");S(this,ht).call(this,t)}},{key:"addSourceBuffer",value:function(t){if(!t||!t.trim())throw new TypeError("Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided is empty");var r=t.match(ot(/(video|audio)\/mp4;.*?codecs="(hev|mp4a|hvc).*?(,(mp4a).*?|)"(;width="(.*?)";height="(.*?)"|)/,{mediaType:1,codec:2,codec2:4,width:6,height:7})),n=null==r?void 0:r.groups;if(!r||!n)throw new DOMException("Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('".concat(t,"') is unsupported."));var i,o=n.mediaType,a=n.codec,s=n.codec2;if(!o||!a)throw new DOMException("Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('".concat(t,"') is unsupported."));if("video"===o&&A(this,dt,"hev"===a||"hvc"===a),S(this,st).log(S(this,ut),"ready to add SourceBuffer: ".concat(t,", isHEVC: ").concat(S(this,dt),", readyState: ").concat(this.readyState)),!S(this,dt))throw new Error("H.264 not implemented");if(S(this,lt)!==e.OPEN)throw new Error("InvalidStateError, BwpMediaSource ready state not open!");i="audio"===o?l.AUDIO:"mp4a"===s?l.MIX:l.VIDEO;var u=new it(i,S(this,ft),this,S(this,vt));return this.sourceBuffers.push(u),u.generateTimestampsFlag=!1,u.mode="segments",this.sourceBuffers.dispatchEvent(new Event("addsourcebuffer")),u}},{key:"removeSourceBuffer",value:function(e){if(S(this,st).log(S(this,ut),"remove SourceBuffer: ".concat(e)),-1===this.sourceBuffers.indexOf(e))throw new Error("SourceBuffer not in SourceBuffers");e.updating&&(e.abort(),z(e,"abort"),z(e,"updateend"));var t=this.activeSourceBuffers.indexOf(e);-1!==t&&(this.activeSourceBuffers.remove(t),z(this.activeSourceBuffers,"removesourcebuffer")),this.sourceBuffers.remove(this.sourceBuffers.indexOf(e))}},{key:"endOfStream",value:function(t){if(S(this,st).log(S(this,ut),"endOfStream, isHEVC: ".concat(S(this,dt),", error: ").concat(t)),S(this,lt)!==e.OPEN)throw new DOMException("Failed to execute 'endOfStream' on 'MediaSource': The MediaSource's readyState is not 'open'.");for(var r=0;r=3840&&a>1080);if("audio"===n&&"mp4a"===i)return!0}return!1}}]),n}(T),At=y((function e(){p(this,e)}));_(At,"WASM_PLAYER_ERROR",7e3),_(At,"CORE_PLAYER_LOAD_ERROR",7001),_(At,"CORE_PLAYER_MODULE_LOAD_TIMEOUT",7002),_(At,"CORE_PLAYER_EXCEPTION",7003),_(At,"WASM_MEMORY_MALLOC_ERROR",7004),_(At,"CORE_PLAYER_ADD_FUNCTION_ERROR",7005),_(At,"CORE_PLAYER_JS_ERROR",7006),_(At,"AUDIO_RENDER_ERROR",7007),_(At,"AUDIO_CHANNELS_NOT_SUPPORT",7008),_(At,"TRIGGER_CANPLAY_ERROR",7009),_(At,"OUT_OF_SYNC",7013);var wt=At,Tt=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]);function Rt(){try{return"undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(Tt)}catch(e){return!1}}var Ct=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]);function Pt(){try{return WebAssembly.validate(Ct)}catch(e){return!1}}function It(){var e,t,r=document.createElement("canvas"),n="",i="";try{(e=r.getContext("webgl")||r.getContext("webgl2")||r.getContext("experimental-webgl"))&&(t=e.getExtension("WEBGL_debug_renderer_info"))&&(n=e.getParameter(t.UNMASKED_VENDOR_WEBGL),i=e.getParameter(t.UNMASKED_RENDERER_WEBGL))}catch(e){return null}return{vendor:n,renderer:i}}var Dt="name",Ot="version";function xt(e,t){for(var r,n,i,o,a,s={},u=0;u0?2===n.length?s[n[0]]=n[1]:console.error("[Browser] [rgxMapper] not support arg count!"):s[n]=o||void 0;return s}}return s}function kt(){return(kt=P(D().mark((function e(t,r,n){var i,o;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n,{credentials:"same-origin"});case 2:if((i=e.sent).ok){e.next=5;break}throw new Error("failed to load wasm file from network");case 5:return e.next=7,i.arrayBuffer();case 7:return o=e.sent,e.next=10,t.put(r,o);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nt=function(){function e(t,r){p(this,e),_(this,"dbName",void 0),_(this,"storeName",void 0),_(this,"dbPromise",void 0),this.dbName=t,this.storeName=r,this.initDB()}var t,r,n,i,o;return y(e,[{key:"initDB",value:function(e){var t=this;if(!J().indexedDB)throw new Error("Not support indexedDB!");var r=indexedDB.open(this.dbName,e);this.dbPromise=new Promise((function(e,n){r.onsuccess=function(){e(r.result)},r.onupgradeneeded=function(){r.result.objectStoreNames.contains(t.storeName)||r.result.createObjectStore(t.storeName)},r.onerror=function(e){n(e)}}))}},{key:"getObjectStore",value:(o=P(D().mark((function e(t){var r,n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dbPromise;case 2:return r=e.sent,n=r.transaction(this.storeName,t),e.abrupt("return",n.objectStore(this.storeName));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"get",value:(i=P(D().mark((function e(t){var r;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readonly");case 2:return r=e.sent,e.abrupt("return",new Promise((function(e,n){var i=r.get(t);i.onsuccess=function(){e(i.result)},i.onerror=n})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"put",value:(n=P(D().mark((function e(t,r){var n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readwrite");case 2:return n=e.sent,e.abrupt("return",new Promise((function(e,i){var o=n.put(r,t);o.onsuccess=function(){e(o.result)},o.onerror=i})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"delete",value:(r=P(D().mark((function e(t){var r;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readwrite");case 2:return r=e.sent,e.abrupt("return",r.delete(t));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"clear",value:(t=P(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readwrite");case 2:return t=e.sent,e.abrupt("return",t.clear());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"isSupported",value:function(){return!!J().indexedDB}}]),e}(),Lt=Nt,Mt={BROWSER_LIST:{Chrome:{min:80,blackList:[]},Edge:{min:80, blackList:[]}},OS_LIST:{Windows:!0,"Mac OS":!0},BASE_CPU_CORE_NUMBER:4},Ft="[Browser]",Ut=te.getInstance(),Bt=navigator.userAgent,Gt="bwphevc_supported",Vt=!1,Wt=null,jt={browser:!1,browserHEVC:!1,cpu:!1,gpu:!1,gpuInfo:null,simd:!1,pthread:!1,hardwareConcurrency:0};function Ht(e){var t=JSON.stringify({version:c,ua:Bt,supported:e,supportInfo:jt,cached:Vt,date:+new Date});localStorage.setItem(Gt,t)}function Zt(e){setTimeout((function(){var t=jt.simd?"https://s1.hdslb.com/bfs/static/bwphevc/libwpengn-simd-4.3.18.wasm":"https://s1.hdslb.com/bfs/static/bwphevc/libwpengn-4.3.18.wasm";(function(e,t,r){return kt.apply(this,arguments)})(new Lt("bwphevc","lib"),"libwpengn.wasm",t).then((function(){Ut.log(Ft,"Cache done!"),Vt=!0,Ht(!0),e(!0)})).catch((function(){e(!1)}))}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}function Yt(){if(null!==Wt)return Wt&&Vt;Wt=!1;try{if("undefined"==typeof localStorage)return!1}catch(e){return!1}var e=JSON.parse(localStorage.getItem(Gt)||"null"),t=(null==e?void 0:e.version)===c,r=!(e&&t&&e.ua===Bt),n=window.navigator.hardwareConcurrency>=6?6e3:9e3;return r?(Vt=Boolean(e&&e.cached&&t),setTimeout((function(){var e,t,r,n,i,o,a,s,u,l=(e=+new Date,t=function(){var e,t,r="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:null,n="other",i="other",o="0";if(null!==r){n=function(e){var t=xt(e,[[/microsoft (windows) (vista|xp)/i],"",[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[/ ]?([\d.\w ]*)/i,/(windows)[/ ]?([ntce\d. ]+\w)(?!.+xbox)/i],[Dt],[/(win(?=3|9|n)|win 9x )([nt\d.]+)/i],"Windows",[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[Dt,"iOS"]],[/(mac os x) ?([\w. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[Dt,"Mac OS"]]]).name;return{Windows:!0,"Mac OS":!0}[t]?t:"other"}(r);var a=function(e){var t=xt(e,[[/edg(?:e|ios|a)?\/([\w.]+)/i],[Ot,[Dt,"Edge"]],[/\bopr\/([\w.]+)/i],[Ot,[Dt,"Opera"]],[/(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],[Dt,Ot],[/(?:\buc? ?browser|(?:juc.+)ucweb)[/ ]?([\w.]+)/i],[Ot,[Dt,"UCBrowser"]],[/\bqbcore\/([\w.]+)/i],[Ot,[Dt,"WeChat(Win) Desktop"]],[/micromessenger\/([\w.]+)/i],[Ot,[Dt,"WeChat"]],[/konqueror\/([\w.]+)/i],[Ot,[Dt,"Konqueror"]],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i],[Ot,[Dt,"IE"]],[/yabrowser\/([\w.]+)/i],[Ot,[Dt,"Yandex"]],[/(avast|avg)\/([\w.]+)/i],[[Dt,"Avast/AVG Secure Browser"],Ot],[/coc_coc\w+\/([\w.]+)/i],[Ot,[Dt,"Coc Coc"]],[/dolfin\/([\w.]+)/i],[Ot,[Dt,"Dolphin"]],[/slbrowser\/([\w.]+)/i],[Ot,[Dt,"Lenovo"]],[/115browser\/([\w.]+)/i],[Ot,[Dt,"115 Browser"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[Dt,"360 Browser"]],[/(comodo_dragon)\/([\w.]+)/i],[[Dt,"Comodo Dragon"],Ot],[/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[/ ]?([\w.]+)/i],[Dt,Ot],[/(metasr)[/ ]?([\w.]+)/i,/(lbbrowser)/i],[Dt],[/headlesschrome(?:\/([\w.]+)| )/i],[Ot,[Dt,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w.]+)/i],[[Dt,"Chrome WebView"],Ot],[/(chrome)\/v?([\w.]+)/i],[[Dt,"Chrome"],Ot]]);return{browser:{Chrome:!0,Edge:!0}[t.name]?t.name:"other",version:t.version||"0"}}(r);i=a.browser,o=a.version}return{ua:r||"",os:n,browser:i,version:o,gpuInfo:It(),hardwareConcurrency:window.navigator.hardwareConcurrency||0,isSIMDSupported:Pt(),isPThreadSupported:Rt(),isSupportHEVC:(null===(e=window.MediaSource)||void 0===e||null===(t=e.isTypeSupported)||void 0===t?void 0:t.call(e,'video/mp4; codecs="hev1.1.6.L120.90"'))||!1}}(),r=Mt.BROWSER_LIST[t.browser],n=!!Mt.OS_LIST[t.os]&&!!r&&parseFloat("".concat(t.version))>=r.min,i=!!t.gpuInfo,o=t.hardwareConcurrency>=Mt.BASE_CPU_CORE_NUMBER,a=t.isPThreadSupported,s=t.isSupportHEVC,u=!(!(a&&o&&i&&n)||s&&"Edge"!==t.browser),Ut.warn(Ft,"supportedChecker end spent: ".concat(+new Date-e,"ms, pass: ").concat(u)),{pass:u,supportInfo:{browser:n,browserHEVC:s,cpu:o,gpu:i,gpuInfo:t.gpuInfo,simd:t.isSIMDSupported,pthread:a,hardwareConcurrency:t.hardwareConcurrency}});jt=l.supportInfo,Ht(Wt=l.pass),Wt&&!Vt&&Zt((function(){}))}),n)):null!=e&&e.supported?(Wt=!0,jt=(null==e?void 0:e.supportInfo)||jt,null!=e&&e.cached?(Ut.log(Ft,"SUPPORT! Already cached!"),Vt=!0):(Ut.log(Ft,"SUPPORT! But not cache done!"),Vt=!1,Zt((function(){}),n))):Ut.log(Ft,"Not SUPPORT!"),Boolean(Wt&&Vt)}var Kt,qt=y((function e(){var t;p(this,e),_(this,"fps",void 0),_(this,"creationTime",void 0),_(this,"totalVideoFrames",void 0),_(this,"droppedVideoFrames",void 0),this.fps=0,this.totalVideoFrames=0,this.droppedVideoFrames=0,this.creationTime=+new Date-((null===(t=window.performance)||void 0===t?void 0:t.timing.navigationStart)||0)}));!function(e){e.CANPLAY="canplay"}(Kt||(Kt={}));var zt=r(477),Xt=r.n(zt);function Qt(){ return Xt()('/*!\n * A web media player that implements W3C MSE and MediaElement v4.3.18\n *\n * Copyright 2020 - 2023 Bilibili Inc\n * Released in 6/1/2023, 16:42:40 GMT+0800\n */!function(){var e={61:function(e,t,r){var n=r(698).default;function a(){"use strict";\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=a=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var a=t&&t.prototype instanceof p?t:p,i=Object.create(a.prototype),o=new x(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return P()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var s=A(o,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,o),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var h={};function p(){}function m(){}function b(){}var _={};c(_,s,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==r&&i.call(v,s)&&(_=v);var g=b.prototype=p.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(a,o,s,u){var l=d(e[a],e,o);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(l.arg)}var a;this._invoke=function(e,n){function i(){return new t((function(t,a){r(e,n,t,a)}))}return a=a?a.then(i,i):i()}}function A(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return h}var n=d(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function S(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--n){var a=this.tryEntries[n],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;R(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,r){var n=r(61)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";function e(e,t){for(var r=0;r0){var a=new Float32Array([1,0,0,0,1,1,0,1]),i=1*e/r;a[0]=i,a[4]=i,n.bindBuffer(n.ARRAY_BUFFER,this.texCoordBuffer),n.bufferData(n.ARRAY_BUFFER,a,n.STATIC_DRAW),n.vertexAttribPointer(this.textureCoordAttribute,2,n.FLOAT,!1,0,0)}n.viewport(0,0,this.canvas.width,this.canvas.height)}},{key:"initEventListener",value:function(){this.canvas.addEventListener("webglcontextlost",this.webglcontextlostHandler),this.canvas.addEventListener("webglcontextrestored",this.webglcontextrestoredHandler)}},{key:"uninitEventListener",value:function(){this.canvas.removeEventListener("webglcontextlost",this.webglcontextlostHandler),this.canvas.removeEventListener("webglcontextrestored",this.webglcontextrestoredHandler)}}]),e}();!function(e){e.CLOSED="closed",e.OPEN="open",e.ENDED="ended"}(v||(v={})),function(e){e.NETWORK="network",e.DECODE="decode"}(g||(g={})),function(e){e[e.NETWORK_EMPTY=0]="NETWORK_EMPTY",e[e.NETWORK_IDLE=1]="NETWORK_IDLE",e[e.NETWORK_LOADING=2]="NETWORK_LOADING",e[e.NETWORK_NO_SOURCE=3]="NETWORK_NO_SOURCE"}(E||(E={})),function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(w||(w={})),function(e){e[e.MEDIA_ERR_ABORTED=1]="MEDIA_ERR_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED"}(A||(A={})),function(e){e.SEGMENTS="segments",e.SEQUENCE="sequence"}(T||(T={})),function(e){e.AUDIO="audio",e.VIDEO="video",e.MIX="mix"}(R||(R={}));var M=function(){var e={};return"undefined"!=typeof window&&(e=window),"undefined"!=typeof self&&(e=self),e},D=function(){function e(t,r){n(this,e),a(this,"dbName",void 0),a(this,"storeName",void 0),a(this,"dbPromise",void 0),this.dbName=t,this.storeName=r,this.initDB()}var r,i,o,s,u;return t(e,[{key:"initDB",value:function(e){var t=this;if(!M().indexedDB)throw new Error("Not support indexedDB!");var r=indexedDB.open(this.dbName,e);this.dbPromise=new Promise((function(e,n){r.onsuccess=function(){e(r.result)},r.onupgradeneeded=function(){r.result.objectStoreNames.contains(t.storeName)||r.result.createObjectStore(t.storeName)},r.onerror=function(e){n(e)}}))}},{key:"getObjectStore",value:(u=f(h().mark((function e(t){var r,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dbPromise;case 2:return r=e.sent,n=r.transaction(this.storeName,t),e.abrupt("return",n.objectStore(this.storeName));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"get",value:(s=f(h().mark((function e(t){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readonly");case 2:return r=e.sent,e.abrupt("return",new Promise((function(e,n){var a=r.get(t);a.onsuccess=function(){e(a.result)},a.onerror=n})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"put",value:(o=f(h().mark((function e(t,r){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readwrite");case 2:return n=e.sent,e.abrupt("return",new Promise((function(e,a){var i=n.put(r,t);i.onsuccess=function(){e(i.result)},i.onerror=a})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"delete",value:(i=f(h().mark((function e(t){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readwrite");case 2:return r=e.sent,e.abrupt("return",r.delete(t));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clear",value:(r=f(h().mark((function e(){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getObjectStore("readwrite");case 2:return t=e.sent,e.abrupt("return",t.clear());case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}],[{key:"isSupported",value:function(){return!!M().indexedDB}}]),e}(),F=D;function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>>=0;var e=b+d;for(d=b;a[d>>>0]&&!(d>=e);)++d;if(16>>0,d>>>0));for(e="";b>>0];if(f&128){var h=a[b++>>>0]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|h);else{var n=a[b++>>>0]&63;f=224==(f&240)?(f&15)<<12|h<<6|n:(f&7)<<18|h<<12|n<<6|a[b++>>>0]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}\\nfunction J(a){return(a>>>=0)?na(m(),a,void 0):""}"undefined"!==typeof TextDecoder&&new la("utf-16le");var g,ba,ca,da,fa;z&&(g=t.buffer);function k(a){g=a;t.HEAP8=ba=new Int8Array(a);t.HEAP16=new Int16Array(a);t.HEAP32=da=new Int32Array(a);t.HEAPU8=ca=new Uint8Array(a);t.HEAPU16=new Uint16Array(a);t.HEAPU32=new Uint32Array(a);t.HEAPF32=new Float32Array(a);t.HEAPF64=fa=new Float64Array(a)}var oa=t.INITIAL_MEMORY||167772160;\\nif(z)c=t.wasmMemory,g=t.buffer;else if(t.wasmMemory)c=t.wasmMemory;else if(c=new WebAssembly.Memory({initial:oa/65536,maximum:65536,shared:!0}),!(c.buffer instanceof SharedArrayBuffer))throw D("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Error("bad memory");c&&(g=c.buffer);oa=g.byteLength;k(g);\\nvar K,pa=[],L=[],qa=[],ra=[],sa=!1,M=0;function N(){return noExitRuntime||0=a||a>aa().length||a&1||0>b)return-28;if(0==b)return 0;2147483647<=b&&(b=Infinity);var d=Atomics.load(p(),Ga>>2),e=0;if(d==a&&Atomics.compareExchange(p(),Ga>>2,d,0)==d&&(--b,e=1,0>=b))return 1;a=Atomics.notify(p(),a>>2,b);if(0<=a)return a+e;throw"Atomics.notify returned an unexpected value "+a;}t._emscripten_futex_wake=Fa;function Ha(a){var b=T.ma[a];b&&(p()[a>>2>>>0]=0,T.ua(b.worker))}function Ia(a){U(a)}t._exit=Ia;function V(a){a instanceof Ja||"unwind"==a||y(1,a)}\\nvar T={na:[],ra:[],za:[],Xa:function(){},Ia:function(){T.receiveObjectTransfer=T.La;T.threadInit=T.Da;T.setExitStatus=T.Na},ma:{},Na:function(a){I=a},xa:function(){for(var a in T.ma){var b=T.ma[a];b&&b.worker&&T.ua(b.worker)}for(a=0;a>>2]=0;try{a()}finally{p()[La>>>2]=1}},La:function(){},Da:function(){for(var a in T.za)T.za[a]()},\\nJa:function(a,b){a.onmessage=function(d){d=d.data;var e=d.cmd;a.oa&&(T.Fa=a.oa.ya);if(d.targetThread&&d.targetThread!=W()){var f=T.ma[d.ab];f?f.worker.postMessage(d,d.transferList):D(\\\'Internal error! Worker sent a message "\\\'+e+\\\'" to target pthread \\\'+d.targetThread+", but that thread no longer exists!")}else if("processQueuedMainThreadWork"===e)Ma();else if("spawnThread"===e)Na(d);else if("cleanupThread"===e)Ha(d.thread);else if("killThread"===e)d=d.thread,p()[d>>2>>>0]=0,e=T.ma[d],delete T.ma[d],\\ne.worker.terminate(),Ka(d),T.ra.splice(T.ra.indexOf(e.worker),1),e.worker.oa=void 0;else if("cancelThread"===e)T.ma[d.thread].worker.postMessage({cmd:"cancel"});else if("loaded"===e)a.loaded=!0,b&&b(a),a.qa&&(a.qa(),delete a.qa);else if("print"===e)ia("Thread "+d.threadId+": "+d.text);else if("printErr"===e)D("Thread "+d.threadId+": "+d.text);else if("alert"===e)alert("Thread "+d.threadId+": "+d.text);else if("detachedExit"===e)T.ua(a);else if("cancelDone"===e)T.ua(a);else if("setimmediate"===d.target)a.postMessage(d);\\nelse if("onAbort"===e){if(t.onAbort)t.onAbort(d.arg)}else D("worker sent an unknown command "+e);T.Fa=void 0};a.onerror=function(d){D("pthread sent an error! "+d.filename+":"+d.lineno+": "+d.message);throw d;};a.postMessage({cmd:"load",urlOrBlob:t.mainScriptUrlOrBlob||_scriptDir,wasmMemory:c,wasmModule:ka})},Ea:function(){var a=ha("libwpengn.worker.js");T.na.push(new Worker(a))},Ha:function(){0==T.na.length&&(T.Ea(),T.Ja(T.na[0]));return T.na.pop()}};\\nt.establishStackSpace=function(){var a=W(),b=p()[a+44>>2>>>0];a=p()[a+48>>2>>>0];Oa(b,b-a);Ea(b)};function Pa(a){if(z)return X(1,0,a);try{U(a)}catch(b){V(b)}}var Y=[];function S(a){var b=Y[a];b||(a>=Y.length&&(Y.length=a+1),Y[a]=b=K.get(a));return b}t.invokeEntryPoint=function(a,b){return S(a)(b)};var Qa;Qa=z?function(){return performance.now()-t.__performance_now_clock_drift}:function(){return performance.now()};\\nfunction Na(a){var b=T.Ha();if(!b)return 6;T.ra.push(b);var d=T.ma[a.wa]={worker:b,ya:a.wa};b.oa=d;var e={cmd:"run",start_routine:a.Oa,arg:a.pa,threadInfoStruct:a.wa};b.qa=function(){e.time=performance.now();b.postMessage(e,a.Pa)};b.loaded&&(b.qa(),delete b.qa);return 0}var Ra=[null,[],[]],Sa={};function Ta(a,b,d){return z?X(2,1,a,b,d):0}function Ua(a,b,d){return z?X(3,1,a,b,d):0}function Va(a,b,d){if(z)return X(4,1,a,b,d)}\\nfunction X(a,b){var d=arguments.length-2,e=arguments;return Ca(function(){for(var f=Wa(8*d),h=f>>3,n=0;n>>0]=l}return Xa(a,d,f,b)})}var Ya=[];\\nfunction Za(a,b,d,e){Ca(function(){var f=Wa(12),h=0;if(b){for(var n=h=0;n=l&&(l=65536+((l&1023)<<10)|b.charCodeAt(++n)&1023);127>=l?++h:h=2047>=l?h+2:65535>=l?h+3:h+4}var r=h+1;h=$a(r);n=m();l=h>>>0;if(0=q){var ob=b.charCodeAt(++A);q=65536+((q&1023)<<10)|ob&1023}if(127>=q){if(l>=r)break;n[l++>>>0]=q}else{if(2047>=q){if(l+1>=r)break;n[l++>>>0]=192|q>>6}else{if(65535>=\\nq){if(l+2>=r)break;n[l++>>>0]=224|q>>12}else{if(l+3>=r)break;n[l++>>>0]=240|q>>18;n[l++>>>0]=128|q>>12&63}n[l++>>>0]=128|q>>6&63}n[l++>>>0]=128|q&63}}n[l>>>0]=0}}p()[f>>2>>>0]=h;p()[f+4>>2>>>0]=d;p()[f+8>>2>>>0]=e;ab(0,a,657457152,0,h,f)})}var bb=[0,"undefined"!==typeof document?document:0,"undefined"!==typeof window?window:0];function cb(a){a=2>2>>>0]=b,p()[e.ta+4>>2>>>0]=d);if(e.Ca||!e.Sa)e.Ca&&(e=e.Ca),a=!1,e.sa&&e.sa.va&&(a=e.sa.va.getParameter(2978),a=0===a[0]&&0===a[1]&&a[2]===e.width&&a[3]===e.height),e.width=b,e.height=d,a&&e.sa.va.viewport(0,0,b,d);else return e.ta?(e=p()[e.ta+8>>2>>>0],a=a?J(a):"",Za(e,a,b,d),1):-4;return 0}function eb(a,b,d){return z?X(5,1,a,b,d):db(a,b,d)}function fb(a){if(!sa&&!H)try{if(a(),z&&!N())try{z?gb(I):U(I)}catch(b){V(b)}}catch(b){V(b)}}\\nfunction hb(a,b){a.Ba||(a.Ba=a.getContext,a.getContext=function(e,f){f=a.Ba(e,f);return"webgl"==e==f instanceof WebGLRenderingContext?f:null});var d=a.getContext("webgl",b);return d?ib(d,b):0}function ib(a,b){var d=$a(8);p()[d+4>>2>>>0]=W();b={Wa:d,attributes:b,version:b.Ka,va:a};a.canvas&&(a.canvas.sa=b);return d}var jb=["default","low-power","high-performance"];function kb(a){return z?X(6,1,a):0}function lb(a,b,d,e){if(z)return X(7,1,a,b,d,e);a=Sa.Va(a);b=Sa.Ta(a,b,d);p()[e>>2>>>0]=b;return 0}\\nfunction mb(a,b,d,e,f){if(z)return X(8,1,a,b,d,e,f)}function nb(a,b,d,e){if(z)return X(9,1,a,b,d,e);for(var f=0,h=0;h>2>>>0],l=p()[b+4>>2>>>0];b+=8;for(var r=0;r>>0],q=Ra[a];0===A||10===A?((1===a?ia:D)(na(q,0)),q.length=0):q.push(A)}f+=l}p()[e>>2>>>0]=f;return 0}\\nvar pb=[null,Pa,Ta,Ua,Va,eb,kb,lb,mb,nb],tb={b:function(a,b,d,e){G("Assertion failed: "+J(a)+", at: "+[b?J(b):"unknown filename",d,e?J(e):"unknown function"])},y:function(a){qb(a,!1,1);T.Da()},u:function(a){z?postMessage({cmd:"cleanupThread",thread:a}):Ha(a)},k:function(a,b,d,e){if("undefined"===typeof SharedArrayBuffer)return D("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var f=[];if(z&&0===f.length)return rb(687865856,a,b,d,e);a={Oa:d,wa:a,pa:e,Pa:f};\\nreturn z?(a.Ra="spawnThread",postMessage(a,f),0):Na(a)},x:function(){postMessage({cmd:"detachedExit"})},h:Ta,s:Ua,t:Va,D:function(){return 2097152},m:function(a,b){if(a==b)postMessage({cmd:"processQueuedMainThreadWork"});else if(z)postMessage({targetThread:a,cmd:"processThreadQueue"});else{a=(a=T.ma[a])&&a.worker;if(!a)return;a.postMessage({cmd:"processThreadQueue"})}return 1},q:function(){G("")},E:function(a,b){if(0===a)a=Date.now();else if(1===a||4===a)a=Qa();else return p()[sb()>>2>>>0]=28,-1;\\np()[b>>2>>>0]=a/1E3|0;p()[b+4>>2>>>0]=a%1E3*1E6|0;return 0},l:function(){},f:function(){},d:function(a,b,d){if(0>=a||a>aa().length||a&1)return-28;a=Atomics.wait(p(),a>>2,b,d);if("timed-out"===a)return-73;if("not-equal"===a)return-6;if("ok"===a)return 0;throw"Atomics.wait returned an unexpected value "+a;},c:Fa,e:Qa,o:function(a,b,d){m().copyWithin(a>>>0,b>>>0,b+d>>>0)},A:function(a,b,d){Ya.length=b;d>>=3;for(var e=0;e>>0];return(0>a?Ba[-a-1]:pb[a]).apply(null,Ya)},p:function(a){var b=\\nm().length;a>>>=0;if(a<=b||4294901760=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a,e);0>>16);k(c.buffer);var f=1;break a}catch(h){}f=void 0}if(f)return!0}return!1},B:function(a,b,d){return cb(a)?db(a,b,d):eb(a,b,d)},g:function(){},z:function(a,b,d){M+=1;return setTimeout(function(){--M;fb(function(){S(a)(d)})},b)},v:function(){throw"unwind";},C:function(a,b){b>>=2;var d=\\np()[b+6>>>0];b={alpha:!!p()[b>>>0],depth:!!p()[b+1>>>0],stencil:!!p()[b+2>>>0],antialias:!!p()[b+3>>>0],premultipliedAlpha:!!p()[b+4>>>0],preserveDrawingBuffer:!!p()[b+5>>>0],powerPreference:jb[d],failIfMajorPerformanceCaveat:!!p()[b+7>>>0],Ka:p()[b+8>>>0],Ya:p()[b+9>>>0],Ua:p()[b+10>>>0],Ga:p()[b+11>>>0],Za:p()[b+12>>>0],$a:p()[b+13>>>0]};a=cb(a);return!a||b.Ga?0:hb(a,b)},w:Ia,j:kb,r:lb,n:mb,i:nb,a:c||t.wasmMemory};\\n(function(){function a(f,h){f=f.exports;var n={},l;for(l in f){var r=f[l];n[l]="function"===typeof r?xa(r):r}t.asm=n;T.za.push(t.asm.$);K=t.asm.W;L.unshift(t.asm.F);ya();ka=h;z||(O--,t.monitorRunDependencies&&t.monitorRunDependencies(O),0==O&&(null!==ua&&(clearInterval(ua),ua=null),P&&(h=P,P=null,h())))}function b(f){a(f.instance,f.module)}function d(f){return Aa().then(function(h){return WebAssembly.instantiate(h,e)}).then(function(h){return h}).then(f,function(h){D("failed to asynchronously prepare wasm: "+\\nh);G(h)})}var e={a:tb};z||(O++,t.monitorRunDependencies&&t.monitorRunDependencies(O));if(t.instantiateWasm)try{return t.instantiateWasm(e,a)}catch(f){return D("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return F||"function"!==typeof WebAssembly.instantiateStreaming||va()||"function"!==typeof fetch?d(b):fetch(Q,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(b,function(h){D("wasm streaming compile failed: "+h);D("falling back to ArrayBuffer instantiation");\\nreturn d(b)})})})().catch(v);return{}})();t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.F).apply(null,arguments)};t._bwpInit=function(){return(t._bwpInit=t.asm.G).apply(null,arguments)};t._bwpUninit=function(){return(t._bwpUninit=t.asm.H).apply(null,arguments)};t._bwpOpen=function(){return(t._bwpOpen=t.asm.I).apply(null,arguments)};t._bwpMainProc=function(){return(t._bwpMainProc=t.asm.J).apply(null,arguments)};\\nt._bwpFillBuff=function(){return(t._bwpFillBuff=t.asm.K).apply(null,arguments)};t._bwpSetAudio=function(){return(t._bwpSetAudio=t.asm.L).apply(null,arguments)};t._bwpSeek=function(){return(t._bwpSeek=t.asm.M).apply(null,arguments)};t._bwpRange=function(){return(t._bwpRange=t.asm.N).apply(null,arguments)};t._bwpPlay=function(){return(t._bwpPlay=t.asm.O).apply(null,arguments)};t._bwpPause=function(){return(t._bwpPause=t.asm.P).apply(null,arguments)};\\nt._bwpSpeed=function(){return(t._bwpSpeed=t.asm.Q).apply(null,arguments)};t._bwpFlush=function(){return(t._bwpFlush=t.asm.R).apply(null,arguments)};t._bwpGetTime=function(){return(t._bwpGetTime=t.asm.S).apply(null,arguments)};t._bwpQuality=function(){return(t._bwpQuality=t.asm.T).apply(null,arguments)};t._bwpEnableVideo=function(){return(t._bwpEnableVideo=t.asm.U).apply(null,arguments)};t._main=function(){return(t._main=t.asm.V).apply(null,arguments)};\\nvar $a=t._malloc=function(){return($a=t._malloc=t.asm.X).apply(null,arguments)};t._free=function(){return(t._free=t.asm.Y).apply(null,arguments)};var W=t._pthread_self=function(){return(W=t._pthread_self=t.asm.Z).apply(null,arguments)},sb=t.___errno_location=function(){return(sb=t.___errno_location=t.asm._).apply(null,arguments)};t._emscripten_tls_init=function(){return(t._emscripten_tls_init=t.asm.$).apply(null,arguments)};\\nt._emscripten_current_thread_process_queued_calls=function(){return(t._emscripten_current_thread_process_queued_calls=t.asm.aa).apply(null,arguments)};\\nvar rb=t._emscripten_sync_run_in_main_thread_4=function(){return(rb=t._emscripten_sync_run_in_main_thread_4=t.asm.ba).apply(null,arguments)},Ma=t._emscripten_main_thread_process_queued_calls=function(){return(Ma=t._emscripten_main_thread_process_queued_calls=t.asm.ca).apply(null,arguments)},Xa=t._emscripten_run_in_main_runtime_thread_js=function(){return(Xa=t._emscripten_run_in_main_runtime_thread_js=t.asm.da).apply(null,arguments)},ab=t.__emscripten_call_on_thread=function(){return(ab=t.__emscripten_call_on_thread=\\nt.asm.ea).apply(null,arguments)},Ka=t.__emscripten_thread_free_data=function(){return(Ka=t.__emscripten_thread_free_data=t.asm.fa).apply(null,arguments)},gb=t.__emscripten_thread_exit=function(){return(gb=t.__emscripten_thread_exit=t.asm.ga).apply(null,arguments)},qb=t.__emscripten_thread_init=function(){return(qb=t.__emscripten_thread_init=t.asm.ha).apply(null,arguments)},Da=t.stackSave=function(){return(Da=t.stackSave=t.asm.ia).apply(null,arguments)},Ea=t.stackRestore=function(){return(Ea=t.stackRestore=\\nt.asm.ja).apply(null,arguments)},Wa=t.stackAlloc=function(){return(Wa=t.stackAlloc=t.asm.ka).apply(null,arguments)},Oa=t._emscripten_stack_set_limits=function(){return(Oa=t._emscripten_stack_set_limits=t.asm.la).apply(null,arguments)},La=t.__emscripten_allow_main_runtime_queued_calls=79072,Ga=t.__emscripten_main_thread_futex=110936;\\nt.addFunction=function(a,b){if(!E){E=new WeakMap;for(var d=K.length,e=0;e<0+d;e++){var f=S(e);f&&E.set(f,e)}}if(E.has(a))return E.get(a);if(ja.length)d=ja.pop();else{try{K.grow(1)}catch(l){if(!(l instanceof RangeError))throw l;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";}d=K.length-1}try{e=d,K.set(e,a),Y[e]=a}catch(l){if(!(l instanceof TypeError))throw l;if("function"===typeof WebAssembly.Function){f={i:"i32",j:"i64",f:"f32",d:"f64"};var h={parameters:[],results:"v"==b[0]?[]:[f[b[0]]]};\\nfor(e=1;e3&&void 0!==arguments[3]&&arguments[3];n(this,e),a(this,"TAG","[BwpCorePlayer]"),a(this,"BASE_DELAY_TIME",80),a(this,"MAX_DELAY_TIME",800),a(this,"MAX_DELAY_FRAME_COUNT",170),a(this,"renderCanvas",void 0),a(this,"logStartTime",void 0),a(this,"width",void 0),a(this,"height",void 0),a(this,"currentTime",void 0),a(this,"buffFlushFlag",void 0),a(this,"videoRenderer",void 0),a(this,"audioChannels",void 0),a(this,"indexedDBUtils",void 0),a(this,"glueJsUrl",void 0),a(this,"pthreadJsUrl",void 0),a(this,"wasmPlayerModule",void 0),a(this,"wasmMemory",void 0),a(this,"inputBuffer",void 0),a(this,"inputBufferSize",void 0),a(this,"fps",void 0),a(this,"totalVideoFrames",void 0),a(this,"droppedVideoFrames",void 0),a(this,"outOfSyncFrameCount",void 0),a(this,"syncTimer",void 0),a(this,"hasFirstFrame",void 0),a(this,"isSeeking",void 0),a(this,"isAfterSeekAudioFragment",void 0),a(this,"isAfterSeekVideoFragment",void 0),a(this,"isPipMode",void 0),a(this,"isDebug",void 0),a(this,"isDestroy",void 0),a(this,"isReadyToRelegation",void 0),a(this,"isCorePlayerOpened",void 0),a(this,"msgHandler",(function(e,t,r,n,a,i){switch(t){case l.BWP_MSG_OPEN_DONE:o.isCorePlayerOpened=!0,o.sendMsg(s.OPENED,{glueJsUrl:o.glueJsUrl,pthreadJsUrl:o.pthreadJsUrl});break;case l.BWP_MSG_PLAY_POS:if(!o.isCorePlayerOpened)return;var u=r,c=o.currentTime;o.currentTime=u,c!==u&&o.sendMsg(s.TIMEUPDATE,{time:u});break;case l.BWP_MSG_SEEK_DONE:o.isSeeking=!1,o.triggerSeekedEvent();break;case l.BWP_MSG_PLAY_COMPLETE:o.log(N.WARN,"[play] [complete] msg"),o.sendMsg(s.PLAY_END);break;case l.BWP_MSG_PLAY_QULITY:o.totalVideoFrames=r,o.droppedVideoFrames=n,o.fps=a/100}})),a(this,"videoRenderHandler",(function(e,t,r,n,a,i,u,l){if(t||r===o.width&&i===o.height||(0!=o.width&&0!=o.height&&o.sendMsg(s.RESIZE),o.width=r,o.height=i,o.renderCanvas.width=u,o.renderCanvas.height=l,o.log(N.WARN,"init video size, width: ".concat(r,", height: ").concat(o.height,",")+" displayWidth: ".concat(u,", displayHeight: ").concat(l))),t){o.isPipMode&&requestAnimationFrame((function(){}));var c=o.height*r,f=o.height*i/2,d=o.wasmMemory.buffer,h=new Uint8Array(d,t,c),p=new Uint8Array(d,n,f),m=new Uint8Array(d,a,f);o.videoRenderer.renderFrame(h,r,p,m,i,o.width,o.height),o.hasFirstFrame||(o.hasFirstFrame=!0,o.sendMsg(s.FIRST_FRAME));var b=o.currentTime-u;if(b>o.BASE_DELAY_TIME&&!o.isReadyToRelegation&&b>o.MAX_DELAY_TIME){if(o.outOfSyncFrameCount+=1,o.outOfSyncFrameCount2)")),0===a){var i=new Uint8Array(o.wasmPlayerModule.HEAPU8.subarray(t,t+r));o.sendMsg(s.RENDER_AUDIO,{data:i.buffer,time:n,channels:o.audioChannels},[i.buffer])}})),a(this,"syncTimerHandler",(function(){o.wasmPlayerModule._bwpMainProc()})),a(this,"log",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.isDebug&&o.sendMsg(s.LOG,{logLevel:e,msg:"[".concat(+new Date-o.logStartTime,"] ").concat(r?"":"".concat(o.TAG," ")).concat(t)})})),a(this,"onAbortHandler",(function(e){o.throwError(x.CORE_PLAYER_EXCEPTION,e)})),a(this,"throwError",(function(e,t){o.isDestroy||(o.sendMsg(s.ERROR,{errorCode:e,describe:t}),o.destroy())})),this.renderCanvas=t,this.logStartTime=i,this.isDebug=u,this.width=0,this.height=0,this.currentTime=0,this.videoRenderer=new O(this.renderCanvas),this.audioChannels=2,this.indexedDBUtils=new F("bwphevc","lib"),this.fps=0,this.totalVideoFrames=0,this.droppedVideoFrames=0,this.outOfSyncFrameCount=0,this.hasFirstFrame=!1,this.isSeeking=!1,this.isAfterSeekAudioFragment=!1,this.isAfterSeekVideoFragment=!1,this.isPipMode=!1,this.isDestroy=!1,this.isReadyToRelegation=!1,this.isCorePlayerOpened=!1,this.init(r)}return t(e,[{key:"play",value:function(){this.log(N.INFO,"[play]"),this.wasmPlayerModule._bwpPlay()}},{key:"pause",value:function(){this.log(N.INFO,"[pause]"),this.wasmPlayerModule._bwpPause()}},{key:"seek",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.SEEK_POS;this.log(N.INFO,"[seek] buffFlushFlag: ".concat(e,", time: ").concat(t)),this.buffFlushFlag=e,this.currentTime=t,this.isSeeking=!0,this.isAfterSeekAudioFragment=!0,this.isAfterSeekVideoFragment=!0,this.wasmPlayerModule._bwpSeek(this.currentTime,r),this.sendMsg(s.BUFFER_FLUSHED,{flag:e})}},{key:"setPlaybackRate",value:function(e){this.log(N.INFO,"[setPlaybackRate] rate: ".concat(e)),this.wasmPlayerModule._bwpSpeed(100*e,100)}},{key:"getVideoPlaybackQuality",value:function(){this.wasmPlayerModule._bwpQuality(),this.sendMsg(s.PLAYBACK_QUALITY,{fps:this.fps,totalVideoFrames:this.totalVideoFrames,droppedVideoFrames:this.droppedVideoFrames})}},{key:"endOfStream",value:function(e){this.log(N.WARN,"[endOfStream] type: ".concat(e));var t=e===R.AUDIO?l.BWP_SRC_TYPE_AUDIO:l.BWP_SRC_TYPE_VIDEO;this.wasmPlayerModule._bwpFillBuff(t,-1,0,0,0,0)}},{key:"setAppendWindow",value:function(e,t){this.log(N.INFO,"[setAppendWindow] start: ".concat(e,", end: ").concat(t)),this.wasmPlayerModule._bwpRange(e,t)}},{key:"setDecodeMode",value:function(e){this.log(N.INFO,"[setDecodeMode] enable: ".concat(e)),this.wasmPlayerModule._bwpEnableVideo(e?1:0)}},{key:"setAudioTime",value:function(e,t,r){var n=+new Date-r;n>t&&(n=t),this.wasmPlayerModule._bwpSetAudio(e+n)}},{key:"setPipMode",value:function(e){this.isPipMode=e}},{key:"reset_outofsync_frame_count",value:function(){this.outOfSyncFrameCount<=0||(this.log(N.INFO,"reset outOfSyncFrameCount: ".concat(this.outOfSyncFrameCount," => 0")),this.outOfSyncFrameCount=0)}},{key:"redrawLastFrame",value:function(){this.videoRenderer.redrawLastFrame()}},{key:"appendBuffer",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=t.byteLength;if(this.reallocInputBuffer(a),this.inputBuffer){var i=new Uint8Array(this.wasmMemory.buffer,this.inputBuffer,a);i.set(new Uint8Array(t));var o=0,s=e===R.AUDIO;r?o=l.BWP_DATA_FLAG_FORMAT:this.isAfterSeekVideoFragment&&!s?(o=l.BWP_DATA_FLAG_NEWPOS,this.isAfterSeekVideoFragment=!1):this.isAfterSeekAudioFragment&&s&&(o=l.BWP_DATA_FLAG_NEWPOS,this.isAfterSeekAudioFragment=!1,this.isAfterSeekVideoFragment||this.isSeeking||this.triggerSeekedEvent());var u=s?l.BWP_SRC_TYPE_AUDIO:l.BWP_SRC_TYPE_VIDEO;this.wasmPlayerModule._bwpFillBuff(u,n,this.inputBuffer,a,0,o),this.log(N.INFO,"[appendBuffer] [".concat(e,"] done, pos: ").concat(n,", byte length: ").concat(a,", isInitSegment: ").concat(r))}else this.throwError(x.WASM_MEMORY_MALLOC_ERROR,"Malloc wasm shared memory error")}},{key:"reload",value:function(e){var t;(this.log(N.INFO,"[reload]"),this.buffFlushFlag=e,this.isCorePlayerOpened)&&(null===(t=this.wasmPlayerModule)||void 0===t||t._bwpFlush(l.BWP_SRC_TYPE_DASH));this.width=0,this.height=0,this.currentTime=0,this.audioChannels=2,this.fps=0,this.totalVideoFrames=0,this.droppedVideoFrames=0,this.outOfSyncFrameCount=0,this.hasFirstFrame=!1,this.isSeeking=!1,this.isAfterSeekVideoFragment=!1,this.isAfterSeekAudioFragment=!1,this.isReadyToRelegation=!1,this.videoRenderer.clear(),this.sendMsg(s.BUFFER_FLUSHED,{flag:e})}},{key:"destroy",value:function(){var e,t,r;this.log(N.INFO,"[destroy]"),this.isDestroy||(this.isDestroy=!0,null===(e=this.syncTimer)||void 0===e||e.stop(),this.videoRenderer.destroy(),URL.revokeObjectURL(this.glueJsUrl||""),URL.revokeObjectURL(this.pthreadJsUrl||""),this.isCorePlayerOpened&&(this.isCorePlayerOpened=!1,this.log(N.WARN,"call bwpUninit()"),null===(t=this.wasmPlayerModule)||void 0===t||t._bwpUninit(),this.inputBuffer&&(this.wasmPlayerModule._free(this.inputBuffer),this.inputBuffer=null),null===(r=this.wasmPlayerModule)||void 0===r||r.terminateAllThreads()))}},{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.glueJsUrl=URL.createObjectURL(new Blob([G],{type:"application/javascript"})),this.pthreadJsUrl=URL.createObjectURL(new Blob([S],{type:"application/javascript"})),importScripts(this.glueJsUrl);var r={mainScriptUrlOrBlob:this.glueJsUrl,locateFile:function(t,r){return t.endsWith("worker.js")?e.pthreadJsUrl:r+t},instantiateWasm:function(r,n){b(e.indexedDBUtils,"libwpengn.wasm",r,t?U:C).then((function(e){n(e.instance,e.module)})).catch((function(){e.throwError(x.CORE_PLAYER_LOAD_ERROR,"Load wasm from indexedDB and url error or caching error")}))},print:function(t){e.isDebug&&e.log(N.INFO,t,!0)}};WasmPlayerModuleFactory(r).then((function(t){e.isDestroy||(e.wasmPlayerModule=t,e.wasmPlayerModule.onAbort=e.onAbortHandler,e.wasmMemory=e.wasmPlayerModule.wasmMemory,e.initCorePlayer())})).catch((function(t){e.throwError(x.CORE_PLAYER_LOAD_ERROR,t&&t.toString&&t.toString())}))}},{key:"initCorePlayer",value:function(){var e=this.wasmPlayerModule.addFunction(this.msgHandler,"iiiiiii"),t=this.wasmPlayerModule.addFunction(this.videoRenderHandler,"iiiiiiiii"),r=this.wasmPlayerModule.addFunction(this.audioRenderHandler,"iiiiii");if(e&&t&&r){var n=this.isDebug?l.BWP_LOG_LEVEL_DEBUG:l.BWP_LOG_LEVEL_ERR;this.wasmPlayerModule._bwpInit(1,e,t,r,n),this.wasmPlayerModule._bwpOpen(l.BWP_SRC_TYPE_DASH,0,0,0),this.syncTimer=this.createTimer(this.syncTimerHandler,4),this.syncTimer.start()}else this.throwError(x.CORE_PLAYER_ADD_FUNCTION_ERROR,"Core player add function failed")}},{key:"reallocInputBuffer",value:function(e){this.inputBuffer&&this.inputBufferSize&&this.inputBufferSize>=e||(this.inputBuffer&&this.wasmPlayerModule._free(this.inputBuffer),this.log(N.INFO,"remalloc input memory, last memory size: ".concat(this.inputBufferSize,", new size: ").concat(e)),this.inputBufferSize=e,this.inputBuffer=this.wasmPlayerModule._malloc(this.inputBufferSize))}},{key:"triggerSeekedEvent",value:function(){this.isAfterSeekAudioFragment||this.isAfterSeekVideoFragment||this.isSeeking||(this.log(N.INFO,"seek done, buffFlushFlag: ".concat(this.buffFlushFlag)),this.sendMsg(s.SEEKED,{flag:this.buffFlushFlag}))}},{key:"sendMsg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];self.postMessage({msg:e,data:t},r)}},{key:"createTimer",value:function(e,t){var r;return{start:function(){var n=this;r=setTimeout((function(){e(),n.start()}),t)},stop:function(){clearTimeout(r)}}}}]),e}(),H=V;self.onmessage=function(e){var t,r,n=null===(t=e.data)||void 0===t?void 0:t.msg,a=null===(r=e.data)||void 0===r?void 0:r.data;if(n!==s.INIT){var i;if(n===s.DESTROY)return null===(i=Y)||void 0===i||i.destroy(),Y=null,void self.close();if(!Y||!Y.isDestroy){if(!Y)throw new Error("BwpCorePlayer not init!");switch(n){case s.PLAY:Y.play();break;case s.PAUSE:Y.pause();break;case s.SEEK:Y.seek(a.flag,a.time);break;case s.PLAYBACK_RATE:Y.setPlaybackRate(a.rate);break;case s.GET_PLAYBACK_QUALITY:Y.getVideoPlaybackQuality();break;case s.END_OF_STREAM:Y.endOfStream(a.mediaType);break;case s.SET_APPEND_WINDOW:Y.setAppendWindow(a.start,a.end);break;case s.SET_DECODE_MODE:Y.setDecodeMode(a.enable);break;case s.SET_AUDIO_TIME:Y.setAudioTime(a.time,a.bufferLen,a.timeStamp);break;case s.SET_PIP_MODE:Y.setPipMode(a.enable);break;case s.RESET_OUTOFSYNC_FRAME_COUNT:Y.reset_outofsync_frame_count();break;case s.REDRAW_LAST_FRAME:Y.redrawLastFrame();break;case s.FILL_BUFFER:Y.appendBuffer(a.mediaType,a.buffer,a.isInitSegment);break;case s.RELOAD:Y.reload(a.flag)}}}else{if(Y)return;Y=new H(a.renderCanvas,a.isEnableSIMD,a.logStartTime,a.isDebug)}}}()}();',"Worker",void 0,void 0) }var Jt=y((function e(){p(this,e)})),$t=Event;"function"!=typeof Event&&($t=Jt);var er=$t,tr=function(e){g(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(e,n,i){var o;return p(this,r),_(m(o=t.call(this,ie.PERFORMANCE,i)),"errorCode",void 0),_(m(o),"describe",void 0),o.errorCode=e,o.describe=n,o}return y(r)}(er),rr=function(e){g(n,e);var t,r=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(n);function n(e,t){var i;return p(this,n),_(m(i=r.call(this)),"logger",void 0),_(m(i),"TAG","[AudioWorkletRender]"),_(m(i),"DEFAULT_VOLUME",1),_(m(i),"audioCtx",void 0),_(m(i),"gainNode",void 0),_(m(i),"audioBuffer",void 0),_(m(i),"audioprocessCallback",void 0),_(m(i),"errorCallback",void 0),_(m(i),"bwpProcessorUrl",void 0),_(m(i),"bwpProcessorNode",void 0),_(m(i),"_muted",void 0),_(m(i),"_volume",void 0),_(m(i),"playState",void 0),_(m(i),"seeking",void 0),_(m(i),"seekFlag",void 0),_(m(i),"onmessage",(function(e){var t=e.data;if(t&&i.audioCtx){var r=t.message,n=t.options;if("TIME_UPDATE"===r){var o=n.currentTime,a=n.bufferTime,s=n.timeStamp;void 0===o||void 0===a||i.seeking||i.audioprocessCallback&&i.audioprocessCallback(o,a,s)}else"SEEKED"===r?(null==n?void 0:n.seekFlag)===i.seekFlag&&(i.seeking=!1):"ERROR"===r&&i.errorCallback&&i.errorCallback(wt.AUDIO_RENDER_ERROR,(null==n?void 0:n.detail)||"BwpProcessor unknow error")}})),_(m(i),"setAutoResume",(function(){for(var e=["keydown","mousedown","touchstart"],t=0;t=r.length&&(this.offset=0,this.audioBuffer.shift()),!0}}registerProcessor("bwp-processor",s)}();'],{type:"application/javascript"})),this.audioCtx||(this.logger.warn(this.TAG,"create new AudioContext with sampleRate: ".concat(t)),this.audioCtx=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t})),i=this.audioCtx,this.gainNode=i.createGain(),e.next=10,null===(n=i.audioWorklet)||void 0===n?void 0:n.addModule(this.bwpProcessorUrl);case 10:if(i&&this.gainNode){e.next=12;break}return e.abrupt("return");case 12:this.bwpProcessorNode=new window.AudioWorkletNode(i,"bwp-processor",{channelCount:2,numberOfInputs:1,numberOfOutputs:1,outputChannelCount:[2]}),this.bwpProcessorNode.port.onmessage=this.onmessage,this.bwpProcessorNode.port.start(),this.bwpProcessorNode.connect(this.gainNode),this.gainNode.connect(i.destination),this.gainNode.gain.value=this._muted?0:this._volume,URL.revokeObjectURL(this.bwpProcessorUrl),this.logger.warn(this.TAG,"init AudioWorkletNode done, ".concat(+new Date-r," ms,"),"volume: ".concat(this._volume,", muted: ").concat(this._muted)),setTimeout((function(){o.triggerCanplay()})),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(3),this.errorCallback&&this.errorCallback(wt.AUDIO_RENDER_ERROR,(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"BwpProcessor init error");case 26:this.setAutoResume();case 27:case"end":return e.stop()}}),e,this,[[3,23]])}))),function(e){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{null!==this.audioCtx&&(this.gainNode&&this.bwpProcessorNode&&(this.flushBuffer(),this.bwpProcessorNode.port.onmessage=null,this.bwpProcessorNode.port.close(),this.bwpProcessorNode.disconnect(this.gainNode),this.gainNode.disconnect(this.audioCtx.destination)),this.audioCtx.close()),this.audioCtx=null,this.gainNode=null,e||(this.audioprocessCallback=null,this.errorCallback=null),this.audioBuffer.length=0,this.playState=!1,this.muted=!1,this._volume=1,this.seeking=!1,this.seekFlag=0}catch(e){}}},{key:"postSimpleMessage",value:function(e){var t;null===(t=this.bwpProcessorNode)||void 0===t||t.port.postMessage({message:e})}},{key:"resume",value:function(){var e=this;this.audioCtx&&"suspended"===this.audioCtx.state&&this.audioCtx.resume().then((function(){e.triggerCanplay(),e.playState&&e.logger.warn(e.TAG,"Audio is resumed")}))}},{key:"triggerCanplay",value:function(){ this.canPlay()&&(this.logger.warn(this.TAG,"audio render [canplay]"),z(this,Kt.CANPLAY))}}]),n}(T),nr=rr,ir=y((function e(){p(this,e)}));_(ir,"INIT","init"),_(ir,"RELOAD","reload"),_(ir,"DESTROY","destroy"),_(ir,"AUDIO_RENDER_INIT_DONE","audio_render_init_done"),_(ir,"PLAY","play"),_(ir,"PAUSE","pause"),_(ir,"SEEK","seek"),_(ir,"PLAYBACK_RATE","playback_rate"),_(ir,"PLAYBACK_QUALITY","playback_quality"),_(ir,"GET_PLAYBACK_QUALITY","get_playback_quality"),_(ir,"RESIZE","resize"),_(ir,"FIRST_FRAME","first_frame"),_(ir,"SEEKED","seeked"),_(ir,"BUFFER_FLUSHED","buffer_flushed"),_(ir,"PLAY_END","play_end"),_(ir,"SET_AUDIO_TIME","set_audio_time"),_(ir,"SET_DECODE_MODE","set_decode_mode"),_(ir,"SET_APPEND_WINDOW","set_append_window"),_(ir,"SET_PIP_MODE","set_pip_mode"),_(ir,"END_OF_STREAM","end_of_stream"),_(ir,"RESET_OUTOFSYNC_FRAME_COUNT","reset_outofsync_frame_count"),_(ir,"REDRAW_LAST_FRAME","redraw_last_frame"),_(ir,"OPENED","opened"),_(ir,"TIMEUPDATE","timeupdate"),_(ir,"FILL_BUFFER","fill_buffer"),_(ir,"RENDER_AUDIO","render_audio"),_(ir,"FALLBACK","fallback"),_(ir,"LOG","log"),_(ir,"ERROR","error"),_(ir,"PERFORMANCE","performance");var or,ar,sr=ir,ur=function(e){g(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(e,n,i){var o;return p(this,r),_(m(o=t.call(this,ie.ERROR,i)),"errorCode",void 0),_(m(o),"describe",void 0),o.errorCode=e,o.describe=n,o}return y(r)}(er);!function(e){e[e.SOURCE=0]="SOURCE",e[e.MSE=1]="MSE",e[e.LIVE=2]="LIVE"}(or||(or={})),function(e){e.CORE_PLAYER_LOADED="coreplayerloaded",e.CORE_PLAYER_OPENED="coreplayeropened",e.ENDED="ended",e.SEEKED="seeked",e.TIMEUPDATE="timeupdate",e.CANPLAY="canplay",e.ERROR="error"}(ar||(ar={}));var lr=function(e){g(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(r);function r(e,n,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:or.MSE;return p(this,r),_(m(o=t.call(this)),"logger",void 0),_(m(o),"TAG","[BwpMediaPlayer]"),_(m(o),"MIN_TIMEUPTE_INTERVAL",110),_(m(o),"renderCanvas",void 0),_(m(o),"bwpElement",void 0),_(m(o),"timeupdateCallback",void 0),_(m(o),"sourceMode",void 0),_(m(o),"bwpMediaSource",void 0),_(m(o),"appendWindowStart",void 0),_(m(o),"appendWindowEnd",void 0),_(m(o),"corePlayerWorker",void 0),_(m(o),"audioRenderer",void 0),_(m(o),"audioSampleRate",void 0),_(m(o),"audioRenderBuffer",void 0),_(m(o),"currentTime",void 0),_(m(o),"_playbackRate",void 0),_(m(o),"glueJsUrl",void 0),_(m(o),"pthreadJsUrl",void 0),_(m(o),"bufferChekTimer",void 0),_(m(o),"buffFlushFlag",void 0),_(m(o),"isBuffFlushing",void 0),_(m(o),"wakeLock",void 0),_(m(o),"isWakeLockInit",void 0),_(m(o),"canplayTimer",void 0),_(m(o),"fps",void 0),_(m(o),"totalVideoFrames",void 0),_(m(o),"droppedVideoFrames",void 0),_(m(o),"moduleLoadedTime",void 0),_(m(o),"lastTimeUpdate",void 0),_(m(o),"hasFirstFrame",void 0),_(m(o),"isAudioInitDone",void 0),_(m(o),"isCorePlayerOpened",void 0),_(m(o),"isCorePlayerCanPlay",void 0),_(m(o),"isSeeking",void 0),_(m(o),"isWaiting",void 0),_(m(o),"isInternalSeek",void 0),_(m(o),"isVideoEnd",void 0),_(m(o),"isAudioEnd",void 0),_(m(o),"_isPictureInPicture",void 0),_(m(o),"setMediaSource",(function(e){o.bwpMediaSource=e})),_(m(o),"setSourceOpen",(function(){o.isCorePlayerCanPlay||(clearTimeout(o.canplayTimer),o.canplayTimer=setTimeout((function(){o.bwpElement&&o.bwpElement.buffered.length>0&&o.throwError(wt.TRIGGER_CANPLAY_ERROR,"trigger canplay timeout > 30s")}),3e4))})),_(m(o),"loadedMetadata",(function(){if(o.bwpMediaSource){for(var e=o.bwpMediaSource.activeSourceBuffers,t=0;t=0&&o.currentTime!==i.time&&(o.currentTime=i.time,o.lastTimeUpdate=+new Date,o.timeupdateCallback(o.currentTime/1e3),Promise.resolve().then((function(){o.readyStateChecker()})));break;case sr.RENDER_AUDIO:if(o.isBuffFlushing||!o.isAudioInitDone)return void o.logger.warn(o.TAG,"discard invalid audio buffer,","currentTime: ".concat(o.currentTime,", audio buffer time: ").concat(i.time));o.isCorePlayerCanPlay||o.triggerCorePlayerCanPlay(),o.audioRenderer.fillBuffer({data:i.data,time:i.time,channels:i.channels});break;case sr.BUFFER_FLUSHED:i.flag===o.buffFlushFlag?(o.isBuffFlushing=!1,o.isSeeking||(o.buffFlushFlag=0)):o.logger.warn(o.TAG,"discard invalid buffer flushed");break;case sr.SEEKED:if(i.flag!==o.buffFlushFlag||!o.isSeeking)return void o.logger.warn(o.TAG,"discard invalid seek, isSeeking: ".concat(o.isSeeking));o.buffFlushFlag=0,o.isSeeking=!1,o.isInternalSeek?(o.logger.warn(o.TAG,"inner seek done"),o.isInternalSeek=!1):(o.logger.warn(o.TAG,"seek done"),o.dispatchEvent(new Event(ar.SEEKED)),Promise.resolve().then((function(){o.readyStateChecker(!1)}))),o.triggerCorePlayerCanPlay();break;case sr.PLAY_END:o.resetKeepScreenAlive(),z(m(o),ar.ENDED);break;case sr.PLAYBACK_QUALITY:o.fps=i.fps,o.totalVideoFrames=i.totalVideoFrames,o.droppedVideoFrames=i.droppedVideoFrames;break;case sr.FALLBACK:setTimeout((function(){var e;null===(e=o.bwpElement)||void 0===e||e.dispatchEvent(new tr(wt.OUT_OF_SYNC,n))}));break;case sr.LOG:if(!$)return;console[i.logLevel](i.msg);break;case sr.ERROR:o.throwError(i.errorCode,i.describe||"");break;default:o.logger.warn("".concat(o.TAG," Unsupport messsage ").concat(n))}})),_(m(o),"corePlayerOnErrorHandler",(function(e){o.logger.error(o.TAG,"core player onerror",null==e?void 0:e.message),o.throwError(wt.CORE_PLAYER_JS_ERROR,null==e?void 0:e.message)})),_(m(o),"checkBuffer",(function(){if(o.isCorePlayerOpened&&o.isAudioInitDone){if(o.sourceMode!==or.MSE)throw new Error("Not support source mode now");o.checkMseModeBuffer()}})),_(m(o),"checkMseModeBuffer",(function(){if(o.bwpMediaSource&&o.isCorePlayerOpened)for(var e=o.bwpMediaSource.activeSourceBuffers,t=0;t0){o.logger.log(o.TAG,"[".concat(n,"] ready to append buffer to core player,"),"currentTime: ".concat(o.currentTime));for(var d=0;d10&&o.logger.warn(o.TAG,"send buffer data spent > 10ms => ".concat(h-p,"ms"))}}u&&o.endOfStream(n)}})),_(m(o),"audioprocessingCallback",(function(e,t,r){var n;if(o.audioRenderBuffer=t,-1!==e&&(o.sendMsgToCorePlayer(sr.SET_AUDIO_TIME,{time:e,bufferLen:t,timeStamp:r}),!(e<0||null!==(n=o.bwpElement)&&void 0!==n&&n.paused||o.isWaiting||o.isSeeking))){var i=+new Date;i-o.lastTimeUpdate>o.MIN_TIMEUPTE_INTERVAL&&(o.lastTimeUpdate=i,o.timeupdateCallback(e/1e3))}})),_(m(o),"applyCorePlayerOfflineState",(function(){0!==o.currentTime&&(o.logger.log(o.TAG,"[applyOfflineState] seek to ".concat(o.currentTime)),o.seek(o.currentTime)),1!==o._playbackRate&&(o.logger.log(o.TAG,"[applyOfflineState] set playbackrate: ".concat(o._playbackRate)),o.playbackRate=o._playbackRate)})),_(m(o),"audioCanplayHandler",(function(){var e,t;o.triggerCorePlayerCanPlay(),null!==(e=o.bwpElement)&&void 0!==e&&e.paused||null!==(t=o.audioRenderer)&&void 0!==t&&t.isPlaying()||!o.isCorePlayerCanPlay||(o.play(),o.logger.warn(o.TAG,"[applyOfflineState], audio render is not play, call play"))})),_(m(o),"triggerCorePlayerCanPlay",(function(){!o.isCorePlayerCanPlay&&o.hasFirstFrame&&!o.isSeeking&&o.isCorePlayerOpened&&o.isAudioInitDone&&(o.logger.warn(o.TAG,"trigger BwpMediaPlayer canplay"),clearTimeout(o.canplayTimer),z(m(o),ar.CANPLAY),o.isCorePlayerCanPlay=!0,Promise.resolve().then((function(){o.readyStateChecker(!1)})))})),_(m(o),"bufferCheckHandler",(function(){o.checkBuffer()})),_(m(o),"visibilityChangeHandler",(function(){o.isCorePlayerOpened&&(o.getIsDocumentVisible()?(o.sendMsgToCorePlayer(sr.SET_DECODE_MODE,{enable:!0}),o.setKeepScreenAlive()):o.isPictureInPicture||(o.sendMsgToCorePlayer(sr.SET_DECODE_MODE,{enable:!1}),o.resetKeepScreenAlive()))})),_(m(o),"setKeepScreenAlive",P(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null!==(t=o.bwpElement)&&void 0!==t&&t.paused||!window.navigator.wakeLock||o.wakeLock||o.isWakeLockInit)){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,o.isWakeLockInit=!0,e.next=6,window.navigator.wakeLock.request("screen");case 6:o.wakeLock=e.sent,e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),o.wakeLock=null,o.isWakeLockInit=!1;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))),_(m(o),"resetKeepScreenAlive",P(D().mark((function e(){return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.wakeLock&&o.isWakeLockInit){e.next=2;break}return e.abrupt("return");case 2:return o.isWakeLockInit=!1,e.next=5,o.wakeLock.release();case 5:o.isWakeLockInit||(o.wakeLock=null);case 6:case"end":return e.stop()}}),e)})))),_(m(o),"globalErrorHandler",(function(e){var t=null==e?void 0:e.filename;t&&(o.pthreadJsUrl!==t&&o.glueJsUrl!==t||o.throwError(wt.CORE_PLAYER_EXCEPTION,e.message))})),_(m(o),"throwError",(function(e,t){if(o.bwpElement){try{localStorage.setItem("bwphevc_error","code: ".concat(e,", message: ").concat(t,", timestamp: ").concat(new Date))}catch(e){}o.dispatchEvent(new ur(e,(null==t?void 0:t.replace(",","."))||"")),o.destroy()}})),o.moduleLoadedTime=+new Date,o.logger=te.getInstance(),o.renderCanvas=e,o.bwpElement=n,o.timeupdateCallback=i,o.sourceMode=a,o.bwpMediaSource=null,o.appendWindowStart=0,o.appendWindowEnd=0,o.audioSampleRate=-1,o.audioRenderBuffer=0,o.currentTime=0,o._playbackRate=1,o.isBuffFlushing=!1,o.isWakeLockInit=!1,o.fps=0,o.totalVideoFrames=0,o.droppedVideoFrames=0,o.lastTimeUpdate=0,o.hasFirstFrame=!1,o.isAudioInitDone=!1,o.isCorePlayerOpened=!1,o.isCorePlayerCanPlay=!1,o.isSeeking=!1,o.isWaiting=!1,o.isInternalSeek=!1,o.isVideoEnd=!1,o.isAudioEnd=!1,o._isPictureInPicture=!1,o.audioRenderer=new nr(o.audioprocessingCallback,o.throwError),o.audioRenderer.addEventListener(Kt.CANPLAY,o.audioCanplayHandler),setTimeout((function(){var e=performance.now();o.corePlayerWorker=new Qt,o.corePlayerWorker.onmessage=o.corePlayerMsgHandler,o.corePlayerWorker.onerror=o.corePlayerOnErrorHandler,o.logger.warn(o.TAG,"[state] load core player worker done, spent: ".concat(performance.now()-e," ms"));var t=o.renderCanvas.transferControlToOffscreen();o.sendMsgToCorePlayer(sr.INIT,{renderCanvas:t,isEnableSIMD:jt.simd,logStartTime:te.startTime,isDebug:$},[t]),o.audioRenderer.preCreateContext(48e3)})),window.addEventListener("error",o.globalErrorHandler),document.addEventListener("visibilitychange",o.visibilityChangeHandler),o}return y(r,[{key:"muted",get:function(){return this.audioRenderer.muted},set:function(e){e!==this.audioRenderer.muted&&(this.audioRenderer.muted=e)}},{key:"volume",get:function(){return this.audioRenderer.volume},set:function(e){e!==this.audioRenderer.volume&&(this.audioRenderer.volume=e)}},{key:"playbackRate",set:function(e){this.logger.warn(this.TAG,"set playbackRate: ".concat(e,", currentTime: ").concat(this.currentTime));var t=parseFloat(e.toFixed(2));this._playbackRate=t,this.sendMsgToCorePlayer(sr.PLAYBACK_RATE,{rate:t})}},{key:"isPictureInPicture",get:function(){return this._isPictureInPicture},set:function(e){this._isPictureInPicture=e,e&&this.isCorePlayerOpened&&!this.getIsDocumentVisible()&&this.sendMsgToCorePlayer(sr.SET_DECODE_MODE,{enable:!0}),this.sendMsgToCorePlayer(sr.SET_PIP_MODE,{enable:e})}},{key:"play",value:function(){var e=this;return new Promise((function(t,r){e.isCorePlayerOpened&&e.isAudioInitDone&&e.canplay()?(e.getIsDocumentVisible()||e.isPictureInPicture||(e.sendMsgToCorePlayer(sr.SET_DECODE_MODE,{enable:!1}),e.logger.log(e.TAG,"play in background tab, set not decoder & not render mode")),e.sendMsgToCorePlayer(sr.PLAY),e.audioRenderer.play(),e.setKeepScreenAlive(),t()):r()}))}},{key:"pause",value:function(){this.isCorePlayerOpened&&(this.sendMsgToCorePlayer(sr.PAUSE),this.audioRenderer.pause(),this.resetKeepScreenAlive())}},{key:"seek",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.buffFlushFlag=+new Date;var r=Number.parseInt("".concat(e),10);if(this.currentTime=r,this.isSeeking=!0,this.isInternalSeek=t,this.isVideoEnd=!1,this.isAudioEnd=!1,this.audioRenderer.seek(),this.audioRenderBuffer=0,this.isCorePlayerOpened?(this.isBuffFlushing=!0,this.sendMsgToCorePlayer(sr.SEEK,{flag:this.buffFlushFlag,time:r})):this.logger.warn(this.TAG,"corePlayer not opened, delay seek"),this.bwpMediaSource)for(var n=this.bwpMediaSource.activeSourceBuffers,i=0;i0&&void 0!==arguments[0]?arguments[0]:"image/png",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.92;return this.renderCanvas.toDataURL(e,t)}},{key:"toBlob",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.92;return new Promise((function(n,i){try{e.renderCanvas.toBlob(n,t,r)}catch(e){i(e)}}))}},{key:"reload",value:function(){var e,t,r,n ;if(this.logger.warn(this.TAG,"reload, ready to flush core player"),clearTimeout(this.canplayTimer),null===(e=this.bufferChekTimer)||void 0===e||e.stop(),this.resetKeepScreenAlive(),null!==(t=this.audioRenderer)&&void 0!==t&&t.isPlaying()&&this.pause(),this.isCorePlayerOpened&&(this.isBuffFlushing=!0,this.buffFlushFlag=+new Date,this.sendMsgToCorePlayer(sr.RELOAD,{flag:this.buffFlushFlag})),this.currentTime=0,this.appendWindowStart=0,this.appendWindowEnd=0,this.audioRenderBuffer=0,this.moduleLoadedTime=+new Date,this.fps=0,this.totalVideoFrames=0,this.droppedVideoFrames=0,this.lastTimeUpdate=0,this.hasFirstFrame=!1,this.isAudioInitDone=!1,this.isCorePlayerCanPlay=!1,this.isSeeking=!1,this.isWaiting=!1,this.isInternalSeek=!1,this.isVideoEnd=!1,this.isAudioEnd=!1,this._isPictureInPicture=!1,null===(r=this.audioRenderer)||void 0===r||r.seek(),this.bwpMediaSource)for(var i=this.bwpMediaSource.activeSourceBuffers,o=0;o1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.corePlayerWorker&&(this.isCorePlayerOpened||e===sr.INIT)&&this.corePlayerWorker.postMessage({msg:e,data:t},r)}},{key:"readyStateChecker",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.bwpElement;if(!(null!=t&&t.paused||this.isAudioEnd&&this.isVideoEnd)&&t&&t.readyState>=o.HAVE_METADATA){var r=t.buffered,n=r.length>0?r.end(0):0,i=this.currentTime/1e3;if(r.container(i)){if(n-i>.1){if(!this.isWaiting)return;!this.audioRenderer.isPlaying()&&this.canplay()&&(this.play(),this.logger.warn(this.TAG,"[waiting] recovery play")),this.isWaiting=!1,this.logger.warn(this.TAG,"[waiting] end"),!this.isSeeking&&e&&z(this.bwpElement,ie.PLAYING)}}else{if(this.isWaiting||this.isSeeking)return;this.audioRenderBuffer<=0&&(z(this.bwpElement,ie.WAITING),this.isWaiting=!0,this.seek(this.currentTime,!0),this.logger.warn(this.TAG,"[waiting] trigger internal seek, currentTime:",this.currentTime,n,t.duration)),this.sendMsgToCorePlayer(sr.RESET_OUTOFSYNC_FRAME_COUNT)}}}},{key:"createTimer",value:function(e,t){var r;return{start:function(){var n=this;r=setTimeout((function(){e(),n.start()}),t)},stop:function(){clearTimeout(r)}}}},{key:"getIsDocumentVisible",value:function(){return"visible"===document.visibilityState}}]),r}(T),cr=lr,dr=y((function e(){p(this,e)})),fr=HTMLElement;"function"!=typeof HTMLElement&&(fr=dr);var pr=fr;function hr(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var yr=new WeakMap,mr=new WeakMap,gr=function(){function e(t,r){p(this,e),hr(this,yr,{writable:!0,value:void 0}),hr(this,mr,{writable:!0,value:void 0}),A(this,yr,t),A(this,mr,r)}return y(e,[{key:"code",get:function(){return S(this,yr)}},{key:"message",get:function(){return S(this,mr)}}]),e}(),vr=r(601),br={};function _r(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var Er=new WeakMap,Sr=new WeakMap,Ar=new WeakMap,wr=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Cr=new WeakMap,Pr=new WeakMap,Ir=new WeakMap,Dr=new WeakMap,Or=new WeakMap,xr=new WeakMap,kr=new WeakMap,Nr=new WeakMap,Lr=new WeakMap,Mr=new WeakMap,Fr=new WeakMap,Ur=new WeakMap,Br=new WeakMap,Gr=new WeakMap,Vr=new WeakMap,Wr=new WeakMap,jr=new WeakMap,Hr=new WeakMap,Zr=new WeakMap,Yr=new WeakMap,Kr=new WeakMap,qr=new WeakMap,zr=new WeakMap,Xr=new WeakMap,Qr=new WeakMap,Jr=new WeakMap,$r=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakMap,nn=new WeakMap,on=new WeakMap,an=new WeakMap,sn=new WeakMap,un=new WeakMap,ln=new WeakMap,cn=new WeakMap,dn=new WeakMap,fn=new WeakMap,pn=new WeakMap,hn=new WeakMap,yn=new WeakMap,mn=new WeakMap,gn=new WeakMap,vn=new WeakMap,bn=new WeakMap,_n=new WeakMap,En=new WeakMap,Sn=new WeakMap,An=new WeakMap,wn=new WeakMap,Tn=new WeakMap,Rn=new WeakMap,Cn=new WeakMap,Pn=new WeakMap,In=new WeakMap,Dn=function(t){g(s,t);var r,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=b(e);if(t){var i=b(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return v(this,r)}}(s);function s(){var t,r,i;p(this,s),_r(m(t=n.call(this)),Er,{writable:!0,value:void 0}),_r(m(t),Sr,{writable:!0,value:"[BwpElement]"}),_r(m(t),Ar,{writable:!0,value:void 0}),_r(m(t),wr,{writable:!0,value:void 0}),_r(m(t),Tr,{writable:!0,value:void 0}),_(m(t),"srcObject",void 0),_r(m(t),Rr,{writable:!0,value:void 0}),_(m(t),"crossOrigin",void 0),_r(m(t),Cr,{writable:!0,value:void 0}),_(m(t),"preload",void 0),_r(m(t),Pr,{writable:!0,value:void 0}),_r(m(t),Ir,{writable:!0,value:void 0}),_r(m(t),Dr,{writable:!0,value:void 0}),_r(m(t),Or,{writable:!0,value:void 0}),_r(m(t),xr,{writable:!0,value:void 0}),_r(m(t),kr,{writable:!0,value:void 0}),_(m(t),"defaultPlaybackRate",void 0),_r(m(t),Nr,{writable:!0,value:void 0}),_r(m(t),Lr,{writable:!0,value:void 0}),_r(m(t),Mr,{writable:!0,value:void 0}),_r(m(t),Fr,{writable:!0,value:void 0}),_(m(t),"autoplay",void 0),_(m(t),"loop",void 0),_r(m(t),Ur,{writable:!0,value:void 0}),_r(m(t),Br,{writable:!0,value:void 0}),_(m(t),"defaultMuted",void 0),_r(m(t),Gr,{writable:!0,value:void 0}),_r(m(t),Vr,{writable:!0,value:void 0}),_r(m(t),Wr,{writable:!0,value:void 0}),_(m(t),"poster",void 0),_(m(t),"playsInline",void 0),_r(m(t),jr,{writable:!0,value:void 0}),_r(m(t),Hr,{writable:!0,value:void 0}),_r(m(t),Zr,{writable:!0,value:void 0}),_r(m(t),Yr,{writable:!0,value:void 0}),_r(m(t),Kr,{writable:!0,value:void 0}),_r(m(t),qr,{writable:!0,value:void 0}),_r(m(t),zr,{writable:!0,value:void 0}),_r(m(t),Xr,{writable:!0,value:void 0}),_r(m(t),Qr,{writable:!0,value:void 0}),_r(m(t),Jr,{writable:!0,value:void 0}),_r(m(t),$r,{writable:!0,value:void 0}),_r(m(t),en,{writable:!0,value:void 0}),_r(m(t),tn,{writable:!0,value:void 0}),_r(m(t),rn,{writable:!0,value:void 0}),_r(m(t),nn,{writable:!0,value:void 0}),_r(m(t),on,{writable:!0,value:function(){var e="bwp-base-style",r=document.querySelector("#".concat(e));r||((r=document.createElement("style")).setAttribute("id",e),r.innerHTML="bwp-video { object-fit: contain; }",document.head.appendChild(r)),A(m(t),Kr,t.attachShadow({mode:"closed"}));var n=document.createElement("style");n.innerHTML=vr.Z.toString(),S(m(t),Kr).appendChild(n),A(m(t),qr,document.createElement("div")),S(m(t),qr).setAttribute("class","-bwp-internal-container"),S(m(t),Kr).appendChild(S(m(t),qr)),S(m(t),zr).setAttribute("class","-bwp-internal-render-canvas"),S(m(t),qr).appendChild(S(m(t),zr)),S(m(t),$r).setAttribute("class","-bwp-internal-proxy-video-element"),S(m(t),qr).appendChild(S(m(t),$r)),t.getAttribute("controls")&&S(m(t),an).call(m(t))}}),_r(m(t),an,{writable:!0,value:function(){S(m(t),Jr)||"function"!=typeof br||(A(m(t),Jr,new br(m(t),S(m(t),qr),S(m(t),zr))),S(m(t),Jr).setupControls())}}),_r(m(t),sn,{writable:!0,value:(r=P(D().mark((function e(){var r;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:S(m(t),Cr)===t.NETWORK_EMPTY&&S(m(t),Er).log(S(m(t),Sr),"[internalPlay] network empty"), S(m(t),Fr)&&S(m(t),Nr)>0&&S(m(t),dn).call(m(t),0),S(m(t),kr)?(A(m(t),kr,!1),z(m(t),ie.PLAY),S(m(t),Ir)<=t.HAVE_CURRENT_DATA?(S(m(t),Er).warn(S(m(t),Sr),"[waiting] not enough data to play"),null===(r=S(m(t),Qr))||void 0===r||r.setWaitingState(),z(m(t),ie.WAITING)):S(m(t),Ir)>=t.HAVE_FUTURE_DATA&&S(m(t),Qr).play().then((function(){z(m(t),ie.PLAYING)})).catch((function(e){A(m(t),kr,!0);var r=new Error("Not ready");throw r.name="NotReady",r}))):(S(m(t),Ir),t.HAVE_ENOUGH_DATA),A(m(t),Yr,!1);case 4:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})}),_r(m(t),un,{writable:!0,value:function(){var e;S(m(t),Cr)!==t.NETWORK_LOADING&&S(m(t),Cr)!==t.NETWORK_IDLE||z(m(t),ie.ABORT),S(m(t),Cr)!==t.NETWORK_EMPTY&&(z(m(t),ie.EMPTIED),S(m(t),Xr)&&(S(m(t),Xr).removeEventListener("sourceopen",S(m(t),hn)),S(m(t),Xr)[ae.MEDIASOURCE_DETACH]()),S(m(t),Pr).clear(),null===(e=S(m(t),Qr))||void 0===e||e.reload(),S(m(t),Ir)!==t.HAVE_NOTHING&&S(m(t),An).call(m(t),t.HAVE_NOTHING),S(m(t),kr)||A(m(t),kr,!0),S(m(t),Dr)&&A(m(t),Dr,!1),A(m(t),Or,0),0!==S(m(t),jr)&&(A(m(t),jr,0),z(m(t),ie.TIME_UPDATE)),A(m(t),xr,NaN),S(m(t),Fr)&&A(m(t),Fr,!1)),t.playbackRate=t.defaultPlaybackRate,A(m(t),Ar,null),A(m(t),Yr,!0),S(m(t),ln).call(m(t))}}),_r(m(t),ln,{writable:!0,value:(i=P(D().mark((function e(){var r,n;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A(m(t),Cr,t.NETWORK_NO_SOURCE),A(m(t),Zr,null===(r=window[ae.BWPHEVC])||void 0===r?void 0:r[S(m(t),Tr)||""]),!(S(m(t),Zr)instanceof MediaStream||S(m(t),Zr)instanceof MediaSource||S(m(t),Zr)instanceof St||S(m(t),Zr)instanceof Blob)){e.next=6;break}n="object",e.next=16;break;case 6:if(!S(m(t),Tr)&&""!==S(m(t),Tr)){e.next=10;break}n="attribute",e.next=16;break;case 10:if(!t.children[0]||"SOURCE"!==t.children[0].tagName){e.next=14;break}n="children",e.next=16;break;case 14:return A(m(t),Cr,t.NETWORK_EMPTY),e.abrupt("return");case 16:if(S(m(t),Er).log(S(m(t),Sr),"src: ".concat(S(m(t),Tr),", mode: ").concat(n)),"object"!==n){e.next=24;break}A(m(t),Cr,t.NETWORK_LOADING),z(m(t),ie.LOAD_START),A(m(t),Rr,""),S(m(t),cn).call(m(t)),e.next=29;break;case 24:if("attribute"!==n){e.next=28;break}throw new Error("[BwpElement] resourceSelectionAlgorithm not implemented mode attribute");case 28:throw new Error("[BwpElement] resourceSelectionAlgorithm not implemented mode other");case 29:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})}),_r(m(t),cn,{writable:!0,value:function(){var r;if(r=S(m(t),Zr)?"local":"remote",A(m(t),Rr,S(m(t),Tr)),"remote"===r)throw new Error("[BwpElement] resourceFetchArlgorithm not implemented mode remote");if(S(m(t),Zr)&&S(m(t),Zr)instanceof File)throw new Error("[BwpElement] resourceFetchArlgorithm not implemented local file");S(m(t),Zr)&&S(m(t),Zr)instanceof St&&S(m(t),Tr)&&(A(m(t),Xr,S(m(t),Zr)),S(m(t),Xr).readyState!==e.CLOSED||S(m(t),pn).call(m(t)))}}),_r(m(t),dn,{writable:!0,value:function(e){if(S(m(t),Ir)!==t.HAVE_NOTHING){S(m(t),Fr)&&A(m(t),Fr,!1),S(m(t),Dr),A(m(t),Dr,!0);var r=e;r>S(m(t),xr)&&(r=S(m(t),xr)),S(m(t),Er).warn(S(m(t),Sr),"currentTime is ".concat(S(m(t),jr),", seek to ").concat(r)),A(m(t),jr,r),0!==t.seekable.length&&(z(m(t),ie.SEEKING),A(m(t),Or,r),S(m(t),Xr)&&t.readyState>t.HAVE_METADATA&&!S(m(t),Pr).container(r)&&S(m(t),An).call(m(t),t.HAVE_METADATA),S(m(t),Qr).seek(1e3*r))}}}),_r(m(t),fn,{writable:!0,value:function(){if(S(m(t),Ir)>=o.HAVE_METADATA){if(S(m(t),jr)>=S(m(t),xr)&&S(m(t),Nr)>=0&&!t.loop)return!0;if(0===S(m(t),jr)&&S(m(t),Nr)<0)return!0}return!1}}),_r(m(t),pn,{writable:!0,value:function(){var e,r;S(m(t),Xr)&&(S(m(t),Er).log(S(m(t),Sr),"attach BwpMediaSource"),S(m(t),Xr).addEventListener("sourceopen",S(m(t),hn)),S(m(t),Xr)[ae.MEDIASOURCE_ATTACH](m(t)),null===(e=window[ae.BWPHEVC])||void 0===e||delete e[S(m(t),Tr)],null===(r=S(m(t),Qr))||void 0===r||r.setMediaSource(S(m(t),Xr)))}}),_r(m(t),hn,{writable:!0,value:function(){var e;S(m(t),Xr)&&(null===(e=S(m(t),Qr))||void 0===e||e.setSourceOpen())}}),_r(m(t),yn,{writable:!0,value:function(e){if(!(S(m(t),Cr)=200&&(A(m(t),tn,r),z(m(t),ie.TIME_UPDATE))}}}),_r(m(t),mn,{writable:!0,value:function(){var e;A(m(t),Dr,!1),0!==S(m(t),Hr)&&A(m(t),Hr,0),z(m(t),ie.TIME_UPDATE),z(m(t),ie.SEEKED),!S(m(t),kr)&&null!==(e=S(m(t),Qr))&&void 0!==e&&e.isAllReady()&&z(m(t),ie.PLAYING)}}),_r(m(t),gn,{writable:!0,value:function(){S(m(t),Er).warn(S(m(t),Sr),"play ended"),A(m(t),jr,S(m(t),xr)),t.pause(),A(m(t),Fr,!0),z(m(t),ie.ENDED)}}),_r(m(t),vn,{writable:!0,value:function(){var e,r,n;null!==(e=S(m(t),Qr))&&void 0!==e&&e.isAllReady()?(S(m(t),rn)&&A(m(t),rn,!1),z(m(t),ie.CANPLAY),S(m(t),Er).log(S(m(t),Sr),"readyState change CANPLAY"),S(m(t),kr)||(A(m(t),Yr,!1),t.seeking||null!==(r=S(m(t),Qr))&&void 0!==r&&r.getWaitingState()||null===(n=S(m(t),Qr))||void 0===n||!n.canplay()||z(m(t),ie.PLAYING))):A(m(t),rn,!0)}}),_r(m(t),bn,{writable:!0,value:function(){var e;null!==(e=S(m(t),Qr))&&void 0!==e&&e.isAllReady()?(S(m(t),nn)&&A(m(t),nn,!1),z(m(t),ie.CANPLAY_THROUGH)):A(m(t),nn,!0)}}),_r(m(t),_n,{writable:!0,value:function(){var e;null!==(e=S(m(t),Qr))&&void 0!==e&&e.isAllReady()&&(S(m(t),Qr).canplay()?S(m(t),Qr).play().then((function(){S(m(t),Er).log(S(m(t),Sr),"[triggerAutoPlay], call play done"),z(m(t),ie.PLAY),z(m(t),ie.PLAYING)})).catch((function(){A(m(t),kr,!0),S(m(t),Er).log(S(m(t),Sr),"[triggerAutoPlay], failed, not ready")})):(A(m(t),kr,!0),S(m(t),Er).warn(S(m(t),Sr),"[triggerAutoPlay], cannot auto play")),A(m(t),Yr,!1))}}),_r(m(t),En,{writable:!0,value:function(){var e;S(m(t),rn)&&S(m(t),vn).call(m(t)),S(m(t),nn)&&S(m(t),bn).call(m(t)),t.autoplay&&S(m(t),Yr)&&!S(m(t),kr)&&t.readyState===t.HAVE_ENOUGH_DATA&&S(m(t),_n).call(m(t)),S(m(t),kr)||null!==(e=S(m(t),Qr))&&void 0!==e&&e.canplay()||(S(m(t),Er).warn(S(m(t),Sr),"[corePlayerCanplay] can not play, set paused true"),A(m(t),kr,!0))}}),_r(m(t),Sn,{writable:!0,value:function(e){var r=e.errorCode,n=e.describe;A(m(t),wr,new gr(r,n)),console.error("WasmPlayer error, code: ".concat(r,", message: ").concat(n)),t.dispatchEvent(new ur(r,n))}}),_r(m(t),An,{writable:!0,value:function(e){if(e!==S(m(t),Ir)&&t.networkState!==t.NETWORK_EMPTY){S(m(t),Er).log(S(m(t),Sr),"set readyState, new state is ".concat(e));var r=S(m(t),Ir);if(A(m(t),Ir,e),r===t.HAVE_NOTHING&&e===t.HAVE_METADATA)S(m(t),Er).log(S(m(t),Sr),"readyState change LOADED_METADATA"),z(m(t),ie.LOADED_METADATA),setTimeout((function(){var e;null===(e=S(m(t),Qr))||void 0===e||e.loadedMetadata(),0!==S(m(t),Hr)&&S(m(t),dn).call(m(t),S(m(t),Hr))}),1);else if(r===t.HAVE_METADATA&&e>=t.HAVE_CURRENT_DATA&&(z(m(t),ie.LOADED_DATA),e=t.HAVE_FUTURE_DATA&&e<=t.HAVE_CURRENT_DATA?S(m(t),fn).call(m(t))||S(m(t),kr)||(z(m(t),ie.TIME_UPDATE),z(m(t),ie.WAITING),S(m(t),Er).log(S(m(t),Sr),"fire waiting")):r<=t.HAVE_CURRENT_DATA&&e===t.HAVE_FUTURE_DATA?S(m(t),vn).call(m(t)):e===t.HAVE_ENOUGH_DATA&&(r<=t.HAVE_CURRENT_DATA&&S(m(t),vn).call(m(t)),S(m(t),bn).call(m(t)),t.autoplay&&S(m(t),Yr)&&S(m(t),kr)&&(S(m(t),Er).log(S(m(t),Sr),"[autoplay] HAVE_ENOUGH_DATA, set paused false"),A(m(t),kr,!1),S(m(t),_n).call(m(t))))}}}),_r(m(t),wn,{writable:!0,value:function(e){e!==S(m(t),xr)&&(A(m(t),xr,e),z(m(t),ie.DURATION_CHANGE))}}),_r(m(t),Tn,{writable:!0,value:function(){if(S(m(t),Xr)&&S(m(t),Xr).readyState===e.ENDED)for(var r=S(m(t),Xr).activeSourceBuffers,n=0;n1)throw new DOMException("IndexSizeError");if(S(this,Er).warn(S(this,Sr),"set volume: ".concat(e)),S(this,Qr)){if(e==S(this,Qr).volume)return;S(this,Qr).volume=e,z(this,ie.VOLUME_CHANGE)}}},{key:"textTracks",get:function(){return S(this,Gr)}},{key:"width",get:function(){return S(this,Vr)},set:function(e){this.setAttribute("width",S(this,In).call(this,e)?e.toString():"0")}},{key:"height",get:function(){return S(this,Wr)},set:function(e){this.setAttribute("height",S(this,In).call(this,e)?e.toString():"0")}},{key:"videoWidth",get:function(){return S(this,zr).width||0}},{key:"videoHeight",get:function(){return S(this,zr).height||0}},{key:"load",value:function(){S(this,un).call(this)}},{key:"canPlayType",value:function(e){return"probably"}},{key:"play",value:(r=P(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S(this,Er).log(S(this,Sr),"call play"),!S(this,Qr)||null!==(t=S(this,Qr))&&void 0!==t&&t.canplay()||S(this,Cr)===this.NETWORK_EMPTY){e.next=4;break}throw S(this,Er).warn(S(this,Sr),"play() failed because the user didn't interact with the document first."),new DOMException("play() failed because the user didn't interact with the document first.","NotAllowedError");case 4:if(!S(this,Ar)||S(this,Ar).code!==a.MEDIA_ERR_SRC_NOT_SUPPORTED){e.next=6;break}throw new L;case 6:return e.abrupt("return",S(this,sn).call(this));case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"pause",value:function(){var e;S(this,Er).warn(S(this,Sr),"call pause"),S(this,Cr)!==this.NETWORK_EMPTY&&(A(this,Yr,!1),S(this,kr)||(A(this,kr,!0),null!=S(this,Qr)&&(S(this,Er).log(S(this,Sr),"send pause event"),z(this,ie.TIME_UPDATE),z(this,ie.PAUSE),null===(e=S(this,Qr))||void 0===e||e.pause())))}},{key:"addTextTrack",value:function(e,t,r){throw new Error("Method not implemented.")}},{key:"getVideoPlaybackQuality",value:function(){return S(this,Qr)?S(this,Qr).getVideoPlaybackQuality():new qt}},{key:"requestPictureInPicture",value:function(){var e=this;if(S(this,Er).log(S(this,Sr),"requestPictureInPicture"),!document.pictureInPictureEnabled)throw new L;if(S(this,Ir)===this.HAVE_NOTHING)throw new M;return document.pictureInPictureElement instanceof s?S(this,$r).requestPictureInPicture():new Promise((function(t,r){if(S(e,Qr)){S(e,Qr).isPictureInPicture=!0,A(e,en,S(e,zr).captureStream(30));var n,i=S(e,$r);i.addEventListener(ie.LOADED_METADATA,(function n(){S(e,Er).log(S(e,Sr),"browser video element loaded metadata"),i.removeEventListener(ie.LOADED_METADATA,n),i.addEventListener(ie.ENTER_PICTURE_IN_PICTURE,S(e,Rn)),i.addEventListener(ie.LEAVE_PICTURE_IN_PICTURE,S(e,Cn)),i.requestPictureInPicture().then((function(r){S(e,$r).style.display="block",S(e,zr).style.visibility="hidden",t(r)})).catch((function(t){S(e,Qr)&&(S(e,Qr).isPictureInPicture=!1),A(e,en,null),console.error(t),r(t)}))})),i.srcObject=S(e,en),i.play(),S(e,kr)&&(null===(n=S(e,Qr))||void 0===n||n.redrawLastFrame())}else r()}))}},{key:"destroy",value:function(){S(this,Er).warn(S(this,Sr),"call destroy"),S(this,Qr)&&(S(this,Qr).removeEventListener(ar.SEEKED,S(this,mn)),S(this,Qr).removeEventListener(ar.ENDED,S(this,gn)),S(this,Qr).removeEventListener(ar.CANPLAY,S(this,En)),S(this,Qr).removeEventListener(ar.ERROR,S(this,Sn)),window.removeEventListener("beforeunload",S(this,Pn)),S(this,Qr).destroy()),S(this,Xr)&&(S(this,Xr).removeEventListener("sourceopen",S(this,hn)),S(this,Xr)[ae.MEDIASOURCE_DETACH]()),A(this,Qr,null),A(this,Xr,null)}},{key:"toDataURL",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.92;return null===(e=S(this,Qr))||void 0===e?void 0:e.toDataURL(t,r)}},{key:"toBlob",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.92;return S(this,Qr)?S(this,Qr).toBlob(e,t):Promise.reject()}},{key:"getRenderCanvas",value:function(){ return S(this,zr)}},{key:"connectedCallback",value:function(){S(this,Er).log(S(this,Sr),"connectedCallback")}},{key:"disconnectedCallback",value:function(){S(this,Er).warn(S(this,Sr),"disconnectedCallback")}},{key:"adoptedCallback",value:function(){S(this,Er).warn(S(this,Sr),"adoptedCallback")}},{key:"attributeChangedCallback",value:function(e,t,r){S(this,Er).log(S(this,Sr),"attribute change, name: ".concat(e,", oldValue: ").concat(t,", newValue: ").concat(r));var n=Number.parseInt(r,10);switch(e){case"controls":var i;null===t?(S(this,an).call(this),A(this,Ur,!0)):(null===(i=S(this,Jr))||void 0===i||i.destroyControls(),A(this,Jr,null),A(this,Ur,!1));break;case"autoplay":this.autoplay=null===t;break;case"src":S(this,Tr)!==r&&A(this,Tr,r);break;case"style":default:break;case"loop":this.loop=null===t;break;case"width":if(null===r||""===r){S(this,qr).style.width="";break}if(S(this,Vr)===n&&S(this,qr).style.width===r)break;if(Number.isNaN(n)||n<0){A(this,Vr,0);break}A(this,Vr,n),-1!==r.indexOf("%")?S(this,qr).style.width="".concat(n,"%"):S(this,qr).style.width="".concat(n,"px");break;case"height":if(null===r||""===r){S(this,qr).style.height="";break}if(S(this,Wr)===n&&S(this,qr).style.height===r)break;if(Number.isNaN(n)||n<0){A(this,Wr,0);break}A(this,Wr,n),-1!==r.indexOf("%")?S(this,qr).style.height="".concat(n,"%"):S(this,qr).style.height="".concat(n,"px")}}}],[{key:"observedAttributes",get:function(){return["controls","autoplay","src","style","loop","width","height"]}}]),s}(pr),On=Dn;$&&console.log("%c[WasmPlayer] version: ".concat(c,", build date: ").concat("6/1/2023, 16:42:40 GMT+0800"),"color: #fb7299;");var xn=document.createElement("meta");xn.setAttribute("id","bwp-meta"),xn.setAttribute("http-equiv","origin-trial"),xn.setAttribute("content","Asgonbsvb0ufqVFRrwnMJgGf3HAtiwl++2S208XERSmTRBxebWHcsJTu9K4wtePhsFzqKF2Zf9F4FuaDogfx3woAAAB2eyJvcmlnaW4iOiJodHRwczovL2JpbGliaWxpLmNvbTo0NDMiLCJmZWF0dXJlIjoiVW5yZXN0cmljdGVkU2hhcmVkQXJyYXlCdWZmZXIiLCJleHBpcnkiOjE3MDk4NTU5OTksImlzU3ViZG9tYWluIjp0cnVlfQ=="),document.head.appendChild(xn),window.customElements&&window.customElements.define&&(window.customElements.define("bwp-video",On),window.BwpElement=On,window.BwpMediaSource=St);var kn={BwpElement:On,BwpMediaSource:St,BwpErrorCodes:wt,isBwpSupported:Yt}}(),n.default}()},"object"==s(t)&&"object"==s(e)?e.exports=a():(i=[],void 0===(o="function"==typeof(n=a)?n.apply(t,i):n)||(e.exports=o))},78290:function(e,t,r){"use strict";var n=r(50330),i=r.n(n),o=r(88315),a=r.n(o),s=r(38877),u=r.n(s),l=new URL(r(71964),r.b),c=a()(i()),d=u()(l) ;c.push([e.id,'@-webkit-keyframes bpx-animation-loading{0%{background-position:0 0}6.25%{background-position:-320px 0}12.50%{background-position:-640px 0}18.75%{background-position:-960px 0}25.00%{background-position:-1280px 0}31.25%{background-position:-1600px 0}37.50%{background-position:-1920px 0}43.75%{background-position:-2240px 0}50.00%{background-position:-2560px 0}56.25%{background-position:-2880px 0}62.50%{background-position:-3200px 0}68.75%{background-position:-3520px 0}75.00%{background-position:-3840px 0}81.25%{background-position:-4160px 0}87.50%{background-position:-4480px 0}93.75%{background-position:0 -184px}100.00%{background-position:-320px -184px}}@keyframes bpx-animation-loading{0%{background-position:0 0}6.25%{background-position:-320px 0}12.50%{background-position:-640px 0}18.75%{background-position:-960px 0}25.00%{background-position:-1280px 0}31.25%{background-position:-1600px 0}37.50%{background-position:-1920px 0}43.75%{background-position:-2240px 0}50.00%{background-position:-2560px 0}56.25%{background-position:-2880px 0}62.50%{background-position:-3200px 0}68.75%{background-position:-3520px 0}75.00%{background-position:-3840px 0}81.25%{background-position:-4160px 0}87.50%{background-position:-4480px 0}93.75%{background-position:0 -184px}100.00%{background-position:-320px -184px}}.bpx-docker ol,.bpx-docker ul{list-style:none;outline:none}.bpx-docker table{border-collapse:collapse;border-spacing:0}.bpx-docker a,.bpx-docker input{outline:none;-webkit-text-decoration:none;text-decoration:none}.bpx-docker svg[data-pointer=none]{pointer-events:none}.bpx-docker{-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:initial;box-sizing:initial;font-size:12px;font-style:normal;line-height:1}.bpx-common-hidden{display:none!important}.bpx-common-opacity-60{opacity:.6}.bpx-common-opacity-0{opacity:0}.bpx-common-svg-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%}.bpx-common-svg-icon svg{height:100%;-webkit-transition:fill .15s ease-in-out;transition:fill .15s ease-in-out;width:100%}.bpx-docker-major{height:100%;position:relative;width:100%}.bpx-docker-major.bpx-state-light-off:before{background-color:#000;bottom:0;content:"";display:block;left:0;opacity:.9;position:fixed;right:0;top:0;z-index:1002}.bpx-docker-major.bpx-state-light-off .bpx-player-container{-webkit-box-shadow:none;box-shadow:none;z-index:1010}.bpx-docker-minor{position:relative;width:100%}.bpx-docker-minor:empty{background-color:#f4f4f4;background-color:var(--bpx-aux-header-bg,#f4f4f4);border-radius:2px}.bpx-docker-minor:not(:empty){background-color:#fff;background-color:var(--bpx-aux-content-bg,#fff)}.bpx-docker-patch{height:0!important;left:0;position:absolute;top:0;width:0!important}.bpx-player-container{-webkit-box-shadow:0 0 8px #e5e9ef;box-shadow:0 0 8px #e5e9ef;-webkit-box-shadow:0 0 8px var(--bpx-box-shadow,#e5e9ef);box-shadow:0 0 8px var(--bpx-box-shadow,#e5e9ef);height:100%;position:relative;width:100%}.bpx-player-container.bpx-state-disable-box-shadow{-webkit-box-shadow:none;box-shadow:none}.bpx-player-container[data-aspect-ratio="16:9"] .bpx-player-video-wrap,.bpx-player-container[data-aspect-ratio="4:3"] .bpx-player-video-wrap{position:relative}.bpx-player-container[data-aspect-ratio="16:9"] .bpx-player-video-wrap canvas,.bpx-player-container[data-aspect-ratio="4:3"] .bpx-player-video-wrap canvas{height:100%!important;width:100%!important}.bpx-player-container.bpx-state-black-gap .bpx-player-video-wrap{border-color:transparent;border-style:solid;border-width:48px 7px}.bpx-player-container.bpx-state-black-gap .bpx-player-control-mask{background:url('+d+') repeat-x bottom;height:180px}.bpx-player-container[data-screen=full],.bpx-player-container[data-screen=mini],.bpx-player-container[data-screen=web]{z-index:100000!important}.bpx-player-container[data-ctrl-hidden=true] .bpx-player-top-wrap{opacity:0;visibility:hidden}.bpx-player-container[data-ctrl-hidden=false] .bpx-player-top-wrap{opacity:1;visibility:visible}.bpx-player-container[data-screen=full][data-ctrl-hidden=true] .bpx-player-visual-wrap{visibility:visible}.bpx-player-container[data-screen=mini]{border-radius:4px;height:225px;overflow:hidden;position:fixed!important;width:400px}.bpx-player-container[data-revision="1"][data-screen=mini],.bpx-player-container[data-revision="2"][data-screen=mini]{height:180px;width:320px}@media screen and (min-width:1681px){.bpx-player-container[data-revision="1"][data-screen=mini],.bpx-player-container[data-revision="2"][data-screen=mini]{height:203px;width:360px}}.bpx-player-container[data-revision="1"] .bpx-player-sending-bar,.bpx-player-container[data-revision="2"] .bpx-player-sending-bar{font-size:13px;padding-left:12px}@media screen and (min-width:1681px){.bpx-player-container[data-revision="1"] .bpx-player-sending-bar,.bpx-player-container[data-revision="2"] .bpx-player-sending-bar{font-size:14px;height:56px}}.bpx-player-container[data-revision="2"][data-screen=web]{-webkit-box-shadow:none;box-shadow:none}.bpx-player-primary-area{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;height:100%;width:100%}.bpx-player-hinter-area{background-color:#000;background-position:50%;background-size:cover;bottom:0;display:block;left:0;position:absolute;right:0;top:0;z-index:500}.bpx-player-hinter-area:after{background:url(//s1.hdslb.com/bfs/static/player/img/play.svg) no-repeat 50%;content:"";display:block;height:84px;left:50%;margin-left:-42px;margin-top:-42px;position:absolute;top:50%;width:84px}.bpx-player-context-area{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:1000}.bpx-player-video-area{-webkit-box-flex:1;background-color:#000;background-color:var(--bpx-video-bgcolor,#000);-ms-flex:1;flex:1;overflow:hidden;position:relative}.bpx-player-video-area.bpx-player-mouse-event{cursor:pointer}.bpx-player-sending-area[hidden]{display:none}.bpx-player-ending-wrap{height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:55}.bpx-player-ending-wrap[hidden]{display:none}.bpx-player-ending-wrap[data-select="1"],.bpx-player-ending-wrap[data-select="2"]{opacity:1;-webkit-transition:none;transition:none;visibility:visible}.bpx-player-ending-wrap[data-select="1"] .bpx-player-ending-backdrop,.bpx-player-ending-wrap[data-select="1"] .bpx-player-ending-panel,.bpx-player-ending-wrap[data-select="2"] .bpx-player-ending-backdrop,.bpx-player-ending-wrap[data-select="2"] .bpx-player-share-panel{opacity:1;-webkit-transition:opacity .2s linear;transition:opacity .2s linear;visibility:visible}.bpx-player-ending-backdrop{background-position:50%;background-size:cover;-webkit-filter:blur(20px);filter:blur(20px);height:120%;left:-10%;position:absolute;top:-10%;width:120%;z-index:-1}.bpx-player-ending-backdrop:before{background-color:rgba(0,0,0,.6);content:""}.bpx-player-ending-backdrop:before,.bpx-player-ending-panel,.bpx-player-share-panel{height:100%;left:0;position:absolute;top:0;width:100%}.bpx-player-ending-panel{z-index:1}.bpx-player-share-panel{z-index:2}.bpx-player-ending-backdrop,.bpx-player-ending-panel,.bpx-player-ending-wrap,.bpx-player-share-panel{opacity:0;-webkit-transition:opacity .2s linear,visibility 0ms .2s;transition:opacity .2s linear,visibility 0ms .2s;visibility:hidden}.bpx-player-state-wrap{pointer-events:none}.bpx-player-control-wrap{bottom:0;left:0;position:absolute;width:100%;z-index:75}.bpx-player-control-wrap[hidden]{display:none}.bpx-player-pc-app *,.bpx-player-pc-app :after,.bpx-player-pc-app :before{-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:initial;box-sizing:initial}.bpx-player-embedded .bpx-player-sending-bar,.bpx-player-pc-app .bpx-player-sending-bar{height:auto}.bpx-player-embedded .bpx-player-sending-bar-left,.bpx-player-embedded .bpx-player-sending-bar-right,.bpx-player-pc-app .bpx-player-sending-bar-left,.bpx-player-pc-app .bpx-player-sending-bar-right{height:0}.bpx-player-sending-bar{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#fff;background:var(--bpx-dmsend-main-bg,#fff);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:46px;padding:0 12px;position:relative}.bpx-player-sending-bar-left{background-color:rgba(0,0,0,.04);height:22px;margin-right:10px;width:176px}.bpx-player-sending-bar-right{-webkit-box-flex:1;-ms-flex-positive:1;background-color:rgba(0,0,0,.04);flex-grow:1;height:22px}.bpx-player-adv-dm-wrap,.bpx-player-bas-dm-wrap,.bpx-player-dm-mask-wrap,.bpx-player-row-dm-wrap{cursor:pointer;height:100%;left:0;-webkit-mask-position:center;mask-position:center;overflow:hidden;pointer-events:none;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:2}.bpx-player-render-dm-wrap{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;z-index:11}.bpx-player-row-dm-wrap.ash-animation{-webkit-animation:ash 2s linear 1s forwards;animation:ash 2s linear 1s forwards}.bpx-player-row-dm-wrap.ash-hide{opacity:0}.bpx-player-row-dm-wrap.ash-animation-paused{animation-play-state:paused;-webkit-animation-play-state:paused}.bpx-player-row-dm-wrap.unvisible{visibility:hidden}.bpx-player-visual-wrap{pointer-events:none;visibility:hidden;width:100%}.bpx-player-visual-wrap .bpx-player-visual-pixel{background:rgba(0,0,0,.1);height:1px;left:0;position:absolute;top:50%;width:1px}.bpx-player-top-wrap{color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;left:0;pointer-events:none;position:absolute;top:0;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;width:100%;z-index:45}.bpx-player-top-wrap[hidden]{display:none}.bpx-player-subtitle-wrap{z-index:16}.bpx-player-music-wrap{position:absolute;right:0;top:0}.bpx-player-music-wrap:not(:empty){height:100%;width:100%;z-index:81}.bpx-player-business-wrap{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;width:100%;z-index:63}.bpx-player-business-wrap.business-hide{display:none}.bpx-player-container[data-screen=mini] .bpx-player-cmd-dm-wrap,.bpx-player-container[data-screen=mini] .bpx-player-ending-panel,.bpx-player-container[data-screen=mini] .bpx-player-interaction-hidden,.bpx-player-container[data-screen=mini] .bpx-player-interaction-rookie-guide,.bpx-player-container[data-screen=mini] .bpx-player-interaction-story,.bpx-player-container[data-screen=mini] .bpx-player-music-wrap,.bpx-player-container[data-screen=mini] .bpx-player-panorama,.bpx-player-container[data-screen=mini] .bpx-player-share-panel{display:none!important}@-webkit-keyframes ash{0%{-webkit-filter:url(#fractal) blur(0);filter:url(#fractal) blur(0);opacity:1}25%{-webkit-filter:url(#fractal) blur(2.5px);filter:url(#fractal) blur(2.5px);opacity:.75}50%{-webkit-filter:url(#fractal) blur(5px);filter:url(#fractal) blur(5px);opacity:.5}75%{-webkit-filter:url(#fractal) blur(7.5px);filter:url(#fractal) blur(7.5px);opacity:.25}to{-webkit-filter:url(#fractal) blur(10px);filter:url(#fractal) blur(10px);opacity:0}}@keyframes ash{0%{-webkit-filter:url(#fractal) blur(0);filter:url(#fractal) blur(0);opacity:1}25%{-webkit-filter:url(#fractal) blur(2.5px);filter:url(#fractal) blur(2.5px);opacity:.75}50%{-webkit-filter:url(#fractal) blur(5px);filter:url(#fractal) blur(5px);opacity:.5}75%{-webkit-filter:url(#fractal) blur(7.5px);filter:url(#fractal) blur(7.5px);opacity:.25}to{-webkit-filter:url(#fractal) blur(10px);filter:url(#fractal) blur(10px);opacity:0}}.bpx-player-loading-panel{background-color:#000;display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:57}.bpx-player-loading-panel.bpx-state-loading{display:block}.bpx-player-loading-panel-blur{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;justify-content:center;pointer-events:none;position:relative;width:100%}.bpx-player-loading-panel-blur[hidden]{display:none}.bpx-player-loading-panel-blur:before{background-color:rgba(0,0,0,.3);bottom:0;content:"";left:0;position:absolute;right:0;top:0}.bpx-player-loading-panel-blur-detail{-webkit-animation:bpx-animation-loading .94s steps(1) infinite;animation:bpx-animation-loading .94s steps(1) infinite;background:url(//s1.hdslb.com/bfs/static/player/img/ploading.png) no-repeat;height:184px;-webkit-transform:scale(.5);transform:scale(.5);width:320px}.bpx-player-loading-panel-text{bottom:56px;color:hsla(0,0%,100%,.6);font-size:12px;left:12px;line-height:1.6;position:absolute;right:12px}.bpx-player-loading-panel-text[hidden]{display:none}.bpx-player-loading-panel-text-row{white-space:nowrap}.bpx-player-video-poster{bottom:0;height:100%;left:0;pointer-events:none;position:absolute;right:0;top:0;width:100%}.bpx-player-video-poster[hidden]{display:none}.bpx-player-video-poster img{height:100%;width:100%}.bpx-player-video-perch{-webkit-box-flex:0;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:none;flex:none;height:100%;justify-content:center;position:relative;width:100%}.bpx-player-video-wrap{-webkit-box-sizing:border-box;box-sizing:border-box;display:block;height:100%;width:100%}.bpx-player-video-wrap .bpx-player-seamless-replacement{bottom:0;left:0;position:absolute;right:0;top:0}.bpx-player-video-wrap .bpx-player-seamless-replacement,.bpx-player-video-wrap bwp-video,.bpx-player-video-wrap video{content-visibility:visible;display:block;height:100%;margin:auto;width:100%}.bpx-player-state-buff-icon,.bpx-player-state-buff-text,.bpx-player-state-play{display:none}.bpx-state-paused .bpx-player-state-wrap{bottom:62px;cursor:pointer;pointer-events:none;position:absolute;right:34px;z-index:48}.bpx-state-paused .bpx-player-state-play{background:url(//s1.hdslb.com/bfs/static/player/img/play.svg) 50% no-repeat;display:block;height:64px;width:64px}.bpx-state-paused[data-screen=full] .bpx-player-state-wrap,.bpx-state-paused[data-screen=web] .bpx-player-state-wrap{bottom:107px}.bpx-state-no-cursor .bpx-player-video-perch{cursor:none}.bpx-state-mirror bwp-video,.bpx-state-mirror video{-webkit-transform:rotateX(.001deg) rotateY(180.001deg);transform:rotateX(.001deg) rotateY(180.001deg)}.bpx-state-mirror canvas{-webkit-transform:scaleX(-1) translate(50%,-50%)!important;transform:scaleX(-1) translate(50%,-50%)!important}.bpx-state-buff .bpx-player-state-wrap{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:48}.bpx-state-buff .bpx-player-state-buff-icon{display:block;height:24px;width:24px}.bpx-state-buff .bpx-player-state-buff-text{color:#fff;display:block;font-size:14px;line-height:1;margin-top:8px;text-shadow:0 1px 2px rgba(0,0,0,.7)}.bpx-legacy-browser-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#000;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:16px;height:100%;justify-content:center;left:0;position:absolute;text-align:center;top:0;width:100%;z-index:100}.bpx-legacy-browser-image{margin-bottom:1em;max-width:300px;width:60%}.bpx-legacy-browser-text{line-height:2;margin:0}',"",{ version:3,sources:["webpack://./src/style/base/keyframes.less","webpack://./src/style/core.less","webpack://./src/style/base/variable.less","webpack://./src/style/base/reset.less","webpack://./src/style/base/common.less","webpack://./src/style/main/layer-0.less","webpack://./src/style/main/layer-1.less","webpack://./src/style/main/layer-2.less","webpack://./src/style/main/layer-3.less","webpack://./src/style/main/layer-4.less","webpack://./src/style/main/loading.less","webpack://./src/style/main/video.less","webpack://./src/style/main/buffer.less","webpack://./src/style/legacy-browser.less"],names:[],mappings:"AAAA,yCACI,GACI,uBCgDN,CD9CE,MACI,4BCgDN,CD9CE,OACI,4BCgDN,CD9CE,OACI,4BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,4BCgDN,CD9CE,QACI,iCCgDN,CACF,CDnGA,iCACI,GACI,uBCgDN,CD9CE,MACI,4BCgDN,CD9CE,OACI,4BCgDN,CD9CE,OACI,4BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,6BCgDN,CD9CE,OACI,4BCgDN,CD9CE,QACI,iCCgDN,CACF,CCnGC,8BCUO,eAAA,CACA,YFkGR,CC7GC,kBCeO,wBAAA,CACA,gBFiGR,CCjHC,gCCsBO,YAAA,CADA,4BAAA,CAAA,oBFiGR,CCtHC,mCC0BO,mBF+FR,CCzHC,YCkCG,8BAAA,CAAA,sBAAA,CAAA,0BAAA,CAAA,kBAAA,CAFA,cAAA,CADA,iBAAA,CAEA,aF8FJ,CC/HC,mBEGG,sBH+HJ,CClIC,uBEOG,UH8HJ,CCrIC,sBEWG,SH6HJ,CCxIC,qBEeG,0BAAA,CAAA,0BAAA,CAAA,mBAAA,CAEA,WAAA,CACA,wBAAA,CAAA,qBAAA,CAAA,oBAAA,CAAA,gBAAA,CAFA,UH8HJ,CC9IC,yBEsBO,WAAA,CACA,wCAAA,CAAA,gCAAA,CAFA,UH8HR,CCnJC,kBGKG,WAAA,CAFA,iBAAA,CACA,UJoJJ,CIhJQ,6CAQI,qBAAA,CADA,QAAA,CANA,UAAA,CACA,aAAA,CAIA,MAAA,CAGA,UAAA,CANA,cAAA,CAEA,OAAA,CADA,KAAA,CAMA,YJkJZ,CCpKC,4DGsBW,uBAAA,CAAA,eAAA,CACA,YJiJZ,CCxKC,kBG6BG,iBAAA,CACA,UJ8IJ,CI5II,wBACI,wBAAA,CAAA,iDAAA,CACA,iBJ8IR,CI5II,8BACI,qBAAA,CAAA,+CJ8IR,CCnLC,kBG8CG,kBAAA,CAFA,MAAA,CAFA,iBAAA,CACA,KAAA,CAEA,iBJ6IJ,CC1LC,sBIMG,kCAAA,CAAA,0BAAA,CAAA,wDAAA,CAAA,gDAAA,CADA,WAAA,CAFA,iBAAA,CACA,UL4LJ,CChMC,mDISO,uBAAA,CAAA,eL0LR,CKvLI,6IAGO,iBLwLX,CK3LI,2JAMW,qBAAA,CADA,oBL2Lf,CC5MC,iEI2BW,wBAAA,CAAA,kBAAA,CAAA,qBLsLZ,CCjNC,mEIgCW,kEAAA,CADA,YLsLZ,CKjLI,uHAGI,wBLmLR,CKhLI,kEAGQ,SAAA,CADA,iBLkLZ,CK7KI,mEAGQ,SAAA,CADA,kBL+KZ,CKzKI,uFAEQ,kBL0KZ,CKtKI,wCAII,iBAAA,CADA,YAAA,CAEA,eAAA,CAJA,wBAAA,CACA,WL2KR,CKlKQ,sHAEI,YAAA,CADA,WLsKZ,CKlKQ,qCACI,sHAEI,YAAA,CADA,WLsKd,CACF,CKhLI,kIAeQ,cAAA,CACA,iBLqKZ,CKnKY,qCAAA,kIAEI,cAAA,CADA,WLwKd,CACF,CKlKQ,0DACI,uBAAA,CAAA,eLoKZ,CCvQC,yBKMG,2BAAA,CAAA,4BAAA,CAHA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CAGA,yBAAA,CAAA,qBAAA,CACA,oBAAA,CAAA,gBAAA,CAFA,WAAA,CADA,UN0QJ,CC9QC,wBKiBG,qBAAA,CAEA,uBAAA,CADA,qBAAA,CAFA,QAAA,CALA,aAAA,CAGA,MAAA,CAFA,iBAAA,CAGA,OAAA,CAFA,KAAA,CAOA,WNsQJ,CMpQI,8BAUI,2EAAA,CATA,UAAA,CACA,aAAA,CAOA,WAAA,CAJA,QAAA,CAEA,iBAAA,CADA,gBAAA,CAHA,iBAAA,CACA,OAAA,CAIA,UNwQR,CCtSC,yBK0CG,WAAA,CAFA,MAAA,CAIA,mBAAA,CANA,iBAAA,CACA,KAAA,CAEA,UAAA,CAEA,YNoQJ,CC/SC,uBMIG,kBAAA,CACA,qBAAA,CAAA,8CAAA,CADA,UAAA,CAAA,MAAA,CAEA,eAAA,CAHA,iBPkTJ,CCrTC,8CMQO,cPgTR,CO3SI,iCACI,YP6SR,CC3TC,wBOQG,WAAA,CAFA,MAAA,CAGA,eAAA,CALA,iBAAA,CACA,KAAA,CAEA,UAAA,CAGA,UR0TJ,CQxTI,gCACI,YR0TR,CQvTI,kFAEI,SAAA,CAEA,uBAAA,CAAA,eAAA,CADA,kBR0TR,CC7UC,6QO2BO,SAAA,CAEA,qCAAA,CAAA,6BAAA,CADA,kBRyTR,CCrVC,4BOgDG,uBAAA,CACA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CAHA,WAAA,CAFA,SAAA,CAFA,iBAAA,CACA,QAAA,CAEA,UAAA,CAKA,UR6SJ,CQ9TI,mCAOI,+BAAA,CANA,URsUR,CCzWC,oFOwCO,WAAA,CAFA,MAAA,CAFA,iBAAA,CACA,KAAA,CAEA,UR0UR,CCjXC,yBOgEG,SRoTJ,CCpXC,wBOoEG,SRmTJ,CCvXC,qGO2EG,SAAA,CAEA,wDAAA,CAAA,gDAAA,CADA,iBRmTJ,CC/XC,uBOiFG,mBRiTJ,CClYC,yBOuFG,QAAA,CADA,MAAA,CADA,iBAAA,CAGA,UAAA,CACA,URgTJ,CQ9SI,iCACI,YRgTR,CC5YC,0EOmGO,8BAAA,CAAA,sBAAA,CAAA,0BAAA,CAAA,kBR8SR,CCjZC,wFO2GO,WR0SR,CQzSQ,sMAEI,QR6SZ,CC3ZC,wBOsHG,mBAAA,CAEA,wBAAA,CAAA,qBAAA,CAAA,kBAAA,CAEA,eAAA,CAAA,yCAAA,CALA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CACA,aAAA,CACA,WAAA,CAEA,cAAA,CALA,iBRgTJ,CQxSI,6BAII,gCAAA,CADA,WAAA,CAFA,iBAAA,CACA,WR4SR,CQvSI,8BAEI,kBAAA,CAAA,mBAAA,CACA,gCAAA,CADA,WAAA,CADA,WR2SR,CC/aC,iGOoJG,cAAA,CAFA,WAAA,CAFA,MAAA,CAOA,4BAAA,CAAA,oBAAA,CAJA,eAAA,CAEA,mBAAA,CAPA,iBAAA,CACA,KAAA,CASA,wBAAA,CAAA,qBAAA,CAAA,oBAAA,CAAA,gBAAA,CAPA,UAAA,CAKA,SRySJ,CC/bC,2BO4JG,uBAAA,CAAA,oBAAA,CACA,wBAAA,CAAA,qBAAA,CAAA,kBAAA,CAFA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CACA,sBAAA,CAEA,URuSJ,CQnSI,sCACI,2CAAA,CAAA,mCRqSR,CQnSI,iCACI,SRqSR,CQnSI,6CACI,2BAAA,CACA,mCRsSR,CQnSI,kCACI,iBRqSR,CCndC,wBOsLG,mBAAA,CAEA,iBAAA,CADA,URoSJ,CC3dC,iDO+LO,yBAAA,CADA,UAAA,CAFA,MAAA,CAFA,iBAAA,CACA,OAAA,CAEA,SRsSR,CCneC,qBOyMG,UAAA,CALA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CAGA,MAAA,CAIA,mBAAA,CANA,iBAAA,CACA,KAAA,CAIA,sCAAA,CAAA,8BAAA,CAFA,UAAA,CAIA,URkSJ,CQhSI,6BACI,YRkSR,CCjfC,0BOoNG,URgSJ,CCpfC,uBOwNG,iBAAA,CAEA,OAAA,CADA,KRgSJ,CQ7RI,mCAEI,WAAA,CADA,UAAA,CAEA,UR+RR,CC9fC,0BOwOG,uBAAA,CAAA,oBAAA,CACA,wBAAA,CAAA,qBAAA,CAAA,kBAAA,CAFA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CAIA,WAAA,CAHA,sBAAA,CAJA,iBAAA,CAEA,OAAA,CADA,KAAA,CAKA,UAAA,CAEA,UR6RJ,CQ5RI,wCACI,YR8RR,CC5gBC,uhBO2PO,sBR2RR,CQvRA,uBACI,GACI,oCAAA,CAAA,4BAAA,CACA,SRyRN,CQtRE,IACI,wCAAA,CAAA,gCAAA,CACA,WRwRN,CQrRE,IACI,sCAAA,CAAA,8BAAA,CACA,URuRN,CQpRE,IACI,wCAAA,CAAA,gCAAA,CACA,WRsRN,CQnRE,GACI,uCAAA,CAAA,+BAAA,CACA,SRqRN,CACF,CQ7SA,eACI,GACI,oCAAA,CAAA,4BAAA,CACA,SRyRN,CQtRE,IACI,wCAAA,CAAA,gCAAA,CACA,WRwRN,CQrRE,IACI,sCAAA,CAAA,8BAAA,CACA,URuRN,CQpRE,IACI,wCAAA,CAAA,gCAAA,CACA,WRsRN,CQnRE,GACI,uCAAA,CAAA,+BAAA,CACA,SRqRN,CACF,CC5iBC,0BQSG,qBAAA,CANA,YAAA,CAKA,WAAA,CAFA,MAAA,CAFA,iBAAA,CACA,KAAA,CAEA,UAAA,CAGA,UT4iBJ,CCtjBC,4CQaO,aT4iBR,CCzjBC,+BQoBG,wBAAA,CAAA,qBAAA,CACA,uBAAA,CAAA,oBAAA,CADA,kBAAA,CAFA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CAKA,WAAA,CAFA,sBAAA,CAGA,mBAAA,CALA,iBAAA,CAGA,UT4iBJ,CSxiBI,uCACI,YT0iBR,CSviBI,sCAOI,+BAAA,CADA,QAAA,CALA,UAAA,CAGA,MAAA,CAFA,iBAAA,CAGA,OAAA,CAFA,KT6iBR,CC9kBC,sCQ8CG,8DAAA,CAAA,sDAAA,CAFA,2EAAA,CADA,YAAA,CAEA,2BAAA,CAAA,mBAAA,CAHA,WT2iBJ,CCrlBC,+BQqDG,WAAA,CACA,wBAAA,CACA,cAAA,CAJA,SAAA,CAKA,eAAA,CANA,iBAAA,CAEA,UT0iBJ,CSpiBI,uCACI,YTsiBR,CSniBI,mCACI,kBTqiBR,CCpmBC,yBSMG,QAAA,CAGA,WAAA,CAJA,MAAA,CAKA,mBAAA,CAPA,iBAAA,CAIA,OAAA,CAHA,KAAA,CAIA,UVsmBJ,CUlmBI,iCACI,YVomBR,CCjnBC,6BSkBO,WAAA,CADA,UVomBR,CCrnBC,wBSwBG,kBAAA,CACA,uBAAA,CAAA,oBAAA,CACA,wBAAA,CAAA,qBAAA,CAAA,kBAAA,CAHA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CACA,aAAA,CAAA,SAAA,CAIA,WAAA,CAHA,sBAAA,CAIA,iBAAA,CAFA,UVmmBJ,CC9nBC,uBSqCG,6BAAA,CAAA,qBAAA,CAHA,aAAA,CAEA,WAAA,CADA,UVimBJ,CCpoBC,wDS6CO,QAAA,CADA,MAAA,CAHA,iBAAA,CAKA,OAAA,CAHA,KVqmBR,CChpBC,sHSiDO,0BAAA,CATA,aAAA,CAQA,WAAA,CANA,WAAA,CAKA,UVymBR,CCxpBC,+ESiEG,YV4lBJ,CC7pBC,yCSyEO,WAAA,CACA,cAAA,CACA,mBAAA,CAJA,iBAAA,CACA,UAAA,CAIA,UVylBR,CCrqBC,yCSmFO,2EAAA,CAHA,aAAA,CAEA,WAAA,CADA,UV0lBR,CUrlBI,qHAGQ,YVslBZ,CC/qBC,6CSgGO,WVklBR,CClrBC,oDSwGO,sDAAA,CAAA,8CV8kBR,CCtrBC,yBS4GO,0DAAA,CAAA,kDV6kBR,CCzrBC,uCUKO,uBAAA,CAAA,oBAAA,CACA,wBAAA,CAAA,qBAAA,CACA,2BAAA,CAAA,4BAAA,CADA,kBAAA,CAFA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CAGA,yBAAA,CAAA,qBAAA,CAKA,WAAA,CAPA,sBAAA,CAIA,MAAA,CADA,iBAAA,CAEA,KAAA,CACA,UAAA,CAEA,UXwrBR,CCrsBC,4CUiBO,aAAA,CAEA,WAAA,CADA,UXwrBR,CC1sBC,4CU0BO,UAAA,CAHA,aAAA,CAEA,cAAA,CADA,aAAA,CAIA,cAAA,CADA,oCXurBR,CY/sBA,8BAOI,2BAAA,CAAA,4BAAA,CACA,uBAAA,CAAA,oBAAA,CACA,wBAAA,CAAA,qBAAA,CAAA,kBAAA,CAIA,qBAAA,CAHA,UAAA,CANA,mBAAA,CAAA,mBAAA,CAAA,YAAA,CAGA,yBAAA,CAAA,qBAAA,CAIA,cAAA,CALA,WAAA,CAEA,sBAAA,CALA,MAAA,CAFA,iBAAA,CAWA,iBAAA,CAVA,KAAA,CAGA,UAAA,CASA,WZotBJ,CYjtBA,0BACI,iBAAA,CAEA,eAAA,CADA,SZotBJ,CYhtBA,yBAEI,aAAA,CADA,QZmtBJ", sourcesContent:["@keyframes bpx-animation-loading {\n 0% {\n background-position: 0px 0px;\n }\n 6.25% {\n background-position: -320px 0px;\n }\n 12.50% {\n background-position: -640px 0px;\n }\n 18.75% {\n background-position: -960px 0px;\n }\n 25.00% {\n background-position: -1280px 0px;\n }\n 31.25% {\n background-position: -1600px 0px;\n }\n 37.50% {\n background-position: -1920px 0px;\n }\n 43.75% {\n background-position: -2240px 0px;\n }\n 50.00% {\n background-position: -2560px 0px;\n }\n 56.25% {\n background-position: -2880px 0px;\n }\n 62.50% {\n background-position: -3200px 0px;\n }\n 68.75% {\n background-position: -3520px 0px;\n }\n 75.00% {\n background-position: -3840px 0px;\n }\n 81.25% {\n background-position: -4160px 0px;\n }\n 87.50% {\n background-position: -4480px 0px;\n }\n 93.75% {\n background-position: 0px -184px;\n }\n 100.00% {\n background-position: -320px -184px;\n }\n}\n","/**\n * Define Theme Variables\n */\n/**\n * 视频背景色\n */\n/**\n * 主要颜色 & 背景色\n */\n/**\n * 主要特征颜色 & 特征hover颜色\n */\n/**\n * Tooltip模块颜色 & 背景色\n */\n/**\n * Toast模块色值\n */\n/**\n * Common Style Variable\n */\n/**\n * Define z-Index\n *\n * 全屏、小窗等模式: 100,000\n * 播发器内部最高层: 10,000\n * 媒体区\n * - 媒体层: auto~9\n * - 弹幕层: 10~15\n * - 字幕层: 16~19\n * - 指令层: 20~29\n * - 次控层: 40~49\n * - 面板层: 50~59\n * - 吐司层: 60~69\n * - 主控层: 70~75\n * - 浮窗层: 76~79\n * - 弹窗层: 80~89\n */\n/**\n * Define bottom of control menu\n */\n/**\n * Define Less Variables\n */\n/**\n * 弹窗层公共样式\n */\n@keyframes bpx-animation-loading {\n 0% {\n background-position: 0px 0px;\n }\n 6.25% {\n background-position: -320px 0px;\n }\n 12.50% {\n background-position: -640px 0px;\n }\n 18.75% {\n background-position: -960px 0px;\n }\n 25.00% {\n background-position: -1280px 0px;\n }\n 31.25% {\n background-position: -1600px 0px;\n }\n 37.50% {\n background-position: -1920px 0px;\n }\n 43.75% {\n background-position: -2240px 0px;\n }\n 50.00% {\n background-position: -2560px 0px;\n }\n 56.25% {\n background-position: -2880px 0px;\n }\n 62.50% {\n background-position: -3200px 0px;\n }\n 68.75% {\n background-position: -3520px 0px;\n }\n 75.00% {\n background-position: -3840px 0px;\n }\n 81.25% {\n background-position: -4160px 0px;\n }\n 87.50% {\n background-position: -4480px 0px;\n }\n 93.75% {\n background-position: 0px -184px;\n }\n 100.00% {\n background-position: -320px -184px;\n }\n}\n/**\n * CSS Reset Style\n *\n * DON'T use global css reset style\n */\n.bpx-docker ol,\n.bpx-docker ul {\n list-style: none;\n outline: none;\n}\n.bpx-docker table {\n border-collapse: collapse;\n border-spacing: 0;\n}\n.bpx-docker input,\n.bpx-docker a {\n text-decoration: none;\n outline: none;\n}\n.bpx-docker svg[data-pointer='none'] {\n pointer-events: none;\n}\n.bpx-docker {\n font-style: normal;\n font-size: 12px;\n line-height: 1;\n box-sizing: initial;\n}\n.bpx-common-hidden {\n display: none !important;\n}\n.bpx-common-opacity-60 {\n opacity: 0.6;\n}\n.bpx-common-opacity-0 {\n opacity: 0;\n}\n.bpx-common-svg-icon {\n display: inline-flex;\n width: 100%;\n height: 100%;\n user-select: none;\n}\n.bpx-common-svg-icon svg {\n width: 100%;\n height: 100%;\n transition: fill 150ms ease-in-out;\n}\n.bpx-docker-major {\n position: relative;\n width: 100%;\n height: 100%;\n}\n.bpx-docker-major.bpx-state-light-off:before {\n content: '';\n display: block;\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background-color: black;\n opacity: 0.9;\n z-index: 1002;\n}\n.bpx-docker-major.bpx-state-light-off .bpx-player-container {\n box-shadow: none;\n z-index: 1010;\n}\n.bpx-docker-minor {\n position: relative;\n width: 100%;\n}\n.bpx-docker-minor:empty {\n background-color: var(--bpx-aux-header-bg, #f4f4f4);\n border-radius: 2px;\n}\n.bpx-docker-minor:not(:empty) {\n background-color: var(--bpx-aux-content-bg, #ffffff);\n}\n.bpx-docker-patch {\n position: absolute;\n top: 0;\n left: 0;\n width: 0 !important;\n height: 0 !important;\n}\n.bpx-player-container {\n position: relative;\n width: 100%;\n height: 100%;\n box-shadow: 0 0 8px var(--bpx-box-shadow, #e5e9ef);\n}\n.bpx-player-container.bpx-state-disable-box-shadow {\n box-shadow: none;\n}\n.bpx-player-container[data-aspect-ratio='4:3'] .bpx-player-video-wrap,\n.bpx-player-container[data-aspect-ratio='16:9'] .bpx-player-video-wrap {\n position: relative;\n}\n.bpx-player-container[data-aspect-ratio='4:3'] .bpx-player-video-wrap canvas,\n.bpx-player-container[data-aspect-ratio='16:9'] .bpx-player-video-wrap canvas {\n width: 100% !important;\n height: 100% !important;\n}\n.bpx-player-container.bpx-state-black-gap .bpx-player-video-wrap {\n border-color: transparent;\n border-style: solid;\n border-width: 48px 7px;\n}\n.bpx-player-container.bpx-state-black-gap .bpx-player-control-mask {\n height: 180px;\n background: url('./asset/images/new-mask.png') repeat-x bottom;\n}\n.bpx-player-container[data-screen='web'],\n.bpx-player-container[data-screen='full'],\n.bpx-player-container[data-screen='mini'] {\n z-index: 100000 !important;\n}\n.bpx-player-container[data-ctrl-hidden='true'] .bpx-player-top-wrap {\n visibility: hidden;\n opacity: 0;\n}\n.bpx-player-container[data-ctrl-hidden='false'] .bpx-player-top-wrap {\n visibility: visible;\n opacity: 1;\n}\n.bpx-player-container[data-screen='full'][data-ctrl-hidden='true'] .bpx-player-visual-wrap {\n visibility: visible;\n}\n.bpx-player-container[data-screen='mini'] {\n position: fixed !important;\n width: 400px;\n height: 225px;\n border-radius: 4px;\n overflow: hidden;\n}\n.bpx-player-container[data-revision='1'][data-screen='mini'],\n.bpx-player-container[data-revision='2'][data-screen='mini'] {\n width: 320px;\n height: 180px;\n}\n@media screen and (min-width: 1681px) {\n .bpx-player-container[data-revision='1'][data-screen='mini'],\n .bpx-player-container[data-revision='2'][data-screen='mini'] {\n width: 360px;\n height: 203px;\n }\n}\n.bpx-player-container[data-revision='1'] .bpx-player-sending-bar,\n.bpx-player-container[data-revision='2'] .bpx-player-sending-bar {\n font-size: 13px;\n padding-left: 12px;\n}\n@media screen and (min-width: 1681px) {\n .bpx-player-container[data-revision='1'] .bpx-player-sending-bar,\n .bpx-player-container[data-revision='2'] .bpx-player-sending-bar {\n height: 56px;\n font-size: 14px;\n }\n}\n.bpx-player-container[data-revision='2'][data-screen='web'] {\n box-shadow: none;\n}\n.bpx-player-primary-area {\n display: flex;\n width: 100%;\n height: 100%;\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.bpx-player-hinter-area {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: black;\n background-size: cover;\n background-position: center;\n z-index: 500;\n}\n.bpx-player-hinter-area:after {\n content: '';\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -42px;\n margin-left: -42px;\n width: 84px;\n height: 84px;\n background: url('//s1.hdslb.com/bfs/static/player/img/play.svg') no-repeat center;\n}\n.bpx-player-context-area {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1000;\n pointer-events: none;\n}\n.bpx-player-video-area {\n position: relative;\n flex: 1;\n background-color: var(--bpx-video-bgcolor, #000);\n overflow: hidden;\n}\n.bpx-player-video-area.bpx-player-mouse-event {\n cursor: pointer;\n}\n.bpx-player-sending-area[hidden] {\n display: none;\n}\n.bpx-player-ending-wrap {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n z-index: 55;\n}\n.bpx-player-ending-wrap[hidden] {\n display: none;\n}\n.bpx-player-ending-wrap[data-select='1'],\n.bpx-player-ending-wrap[data-select='2'] {\n opacity: 1;\n visibility: visible;\n transition: none;\n}\n.bpx-player-ending-wrap[data-select='1'] .bpx-player-ending-backdrop,\n.bpx-player-ending-wrap[data-select='2'] .bpx-player-ending-backdrop,\n.bpx-player-ending-wrap[data-select='1'] .bpx-player-ending-panel,\n.bpx-player-ending-wrap[data-select='2'] .bpx-player-share-panel {\n opacity: 1;\n visibility: visible;\n transition: opacity 200ms linear;\n}\n.bpx-player-ending-backdrop {\n position: absolute;\n top: -10%;\n left: -10%;\n width: 120%;\n height: 120%;\n background-position: center;\n background-size: cover;\n filter: blur(20px);\n z-index: -1;\n}\n.bpx-player-ending-backdrop:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n}\n.bpx-player-ending-panel,\n.bpx-player-share-panel {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.bpx-player-ending-panel {\n z-index: 1;\n}\n.bpx-player-share-panel {\n z-index: 2;\n}\n.bpx-player-ending-wrap,\n.bpx-player-ending-backdrop,\n.bpx-player-ending-panel,\n.bpx-player-share-panel {\n opacity: 0;\n visibility: hidden;\n transition: opacity 200ms linear, visibility 0ms 200ms;\n}\n.bpx-player-state-wrap {\n pointer-events: none;\n}\n.bpx-player-control-wrap {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n z-index: 75;\n}\n.bpx-player-control-wrap[hidden] {\n display: none;\n}\n.bpx-player-pc-app *,\n.bpx-player-pc-app *::before,\n.bpx-player-pc-app *::after {\n box-sizing: initial;\n}\n.bpx-player-embedded .bpx-player-sending-bar,\n.bpx-player-pc-app .bpx-player-sending-bar {\n height: auto;\n}\n.bpx-player-embedded .bpx-player-sending-bar-left,\n.bpx-player-pc-app .bpx-player-sending-bar-left,\n.bpx-player-embedded .bpx-player-sending-bar-right,\n.bpx-player-pc-app .bpx-player-sending-bar-right {\n height: 0;\n}\n.bpx-player-sending-bar {\n position: relative;\n display: flex;\n flex-shrink: 0;\n height: 46px;\n align-items: center;\n padding: 0 12px;\n background: var(--bpx-dmsend-main-bg, #ffffff);\n}\n.bpx-player-sending-bar-left {\n margin-right: 10px;\n width: 176px;\n height: 22px;\n background-color: rgba(0, 0, 0, 0.04);\n}\n.bpx-player-sending-bar-right {\n height: 22px;\n flex-grow: 1;\n background-color: rgba(0, 0, 0, 0.04);\n}\n.bpx-player-adv-dm-wrap,\n.bpx-player-bas-dm-wrap,\n.bpx-player-dm-mask-wrap,\n.bpx-player-row-dm-wrap {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n cursor: pointer;\n pointer-events: none;\n z-index: 2;\n mask-position: center;\n user-select: none;\n}\n.bpx-player-render-dm-wrap {\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 11;\n}\n.bpx-player-row-dm-wrap.ash-animation {\n animation: ash 2s linear 1s forwards;\n}\n.bpx-player-row-dm-wrap.ash-hide {\n opacity: 0;\n}\n.bpx-player-row-dm-wrap.ash-animation-paused {\n animation-play-state: paused;\n -webkit-animation-play-state: paused;\n /* Safari 和 Chrome */\n}\n.bpx-player-row-dm-wrap.unvisible {\n visibility: hidden;\n}\n/* 仅为了解决弹幕在全屏模式下的显示问题 2025-02.28 \n/* 由于全屏模式下,d3d 11 集成显卡下,视频区域无可视像素点时,会将屏幕上的所有元素都隐藏\n/* 为了解决这个问题,在全屏模式下,视频区域内添加一个 1px * 1px 的像素点,保证视频区域有可视像素点 **/\n.bpx-player-visual-wrap {\n pointer-events: none;\n width: 100%;\n visibility: hidden;\n}\n.bpx-player-visual-wrap .bpx-player-visual-pixel {\n position: absolute;\n top: 50%;\n left: 0;\n width: 1px;\n height: 1px;\n background: rgba(0, 0, 0, 0.1);\n}\n.bpx-player-top-wrap {\n display: flex;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n color: #ffffff;\n transition: all 0.2s ease-in-out;\n pointer-events: none;\n z-index: 45;\n}\n.bpx-player-top-wrap[hidden] {\n display: none;\n}\n.bpx-player-subtitle-wrap {\n z-index: 16;\n}\n.bpx-player-music-wrap {\n position: absolute;\n top: 0;\n right: 0;\n}\n.bpx-player-music-wrap:not(:empty) {\n width: 100%;\n height: 100%;\n z-index: 81;\n}\n.bpx-player-business-wrap {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n z-index: 63;\n}\n.bpx-player-business-wrap.business-hide {\n display: none;\n}\n.bpx-player-container[data-screen='mini'] .bpx-player-ending-panel,\n.bpx-player-container[data-screen='mini'] .bpx-player-share-panel,\n.bpx-player-container[data-screen='mini'] .bpx-player-interaction-story,\n.bpx-player-container[data-screen='mini'] .bpx-player-interaction-hidden,\n.bpx-player-container[data-screen='mini'] .bpx-player-cmd-dm-wrap,\n.bpx-player-container[data-screen='mini'] .bpx-player-interaction-rookie-guide,\n.bpx-player-container[data-screen='mini'] .bpx-player-panorama,\n.bpx-player-container[data-screen='mini'] .bpx-player-music-wrap {\n display: none !important;\n}\n@keyframes ash {\n 0% {\n filter: url(#fractal) blur(0px);\n opacity: 1;\n }\n 25% {\n filter: url(#fractal) blur(2.5px);\n opacity: 0.75;\n }\n 50% {\n filter: url(#fractal) blur(5px);\n opacity: 0.5;\n }\n 75% {\n filter: url(#fractal) blur(7.5px);\n opacity: 0.25;\n }\n 100% {\n filter: url(#fractal) blur(10px);\n opacity: 0;\n }\n}\n.bpx-player-loading-panel {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: black;\n z-index: 57;\n}\n.bpx-player-loading-panel.bpx-state-loading {\n display: block;\n}\n.bpx-player-loading-panel-blur {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.bpx-player-loading-panel-blur[hidden] {\n display: none;\n}\n.bpx-player-loading-panel-blur:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.3);\n}\n.bpx-player-loading-panel-blur-detail {\n width: 320px;\n height: 184px;\n background: url('//s1.hdslb.com/bfs/static/player/img/ploading.png') no-repeat;\n transform: scale(0.5);\n animation: bpx-animation-loading 0.94s steps(1) infinite;\n}\n.bpx-player-loading-panel-text {\n position: absolute;\n left: 12px;\n right: 12px;\n bottom: 56px;\n color: rgba(255, 255, 255, 0.6);\n font-size: 12px;\n line-height: 1.6;\n}\n.bpx-player-loading-panel-text[hidden] {\n display: none;\n}\n.bpx-player-loading-panel-text-row {\n white-space: nowrap;\n}\n.bpx-player-video-poster {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.bpx-player-video-poster[hidden] {\n display: none;\n}\n.bpx-player-video-poster img {\n width: 100%;\n height: 100%;\n}\n.bpx-player-video-perch {\n display: flex;\n flex: none;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n}\n.bpx-player-video-wrap {\n display: block;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n}\n.bpx-player-video-wrap .bpx-player-seamless-replacement {\n display: block;\n position: absolute;\n margin: auto;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n content-visibility: visible;\n}\n.bpx-player-video-wrap video,\n.bpx-player-video-wrap bwp-video {\n display: block;\n margin: auto;\n width: 100%;\n height: 100%;\n content-visibility: visible;\n}\n.bpx-player-state-play,\n.bpx-player-state-buff-icon,\n.bpx-player-state-buff-text {\n display: none;\n}\n.bpx-state-paused .bpx-player-state-wrap {\n position: absolute;\n right: 34px;\n bottom: 62px;\n cursor: pointer;\n pointer-events: none;\n z-index: 48;\n}\n.bpx-state-paused .bpx-player-state-play {\n display: block;\n width: 64px;\n height: 64px;\n background: url('//s1.hdslb.com/bfs/static/player/img/play.svg') center no-repeat;\n}\n.bpx-state-paused[data-screen='web'] .bpx-player-state-wrap,\n.bpx-state-paused[data-screen='full'] .bpx-player-state-wrap {\n bottom: 107px;\n}\n.bpx-state-no-cursor .bpx-player-video-perch {\n cursor: none;\n}\n.bpx-state-mirror video,\n.bpx-state-mirror bwp-video {\n transform: rotateX(0.001deg) rotateY(180.001deg);\n}\n.bpx-state-mirror canvas {\n transform: scaleX(-1) translate(50%, -50%) !important;\n}\n.bpx-state-buff .bpx-player-state-wrap {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 48;\n}\n.bpx-state-buff .bpx-player-state-buff-icon {\n display: block;\n width: 24px;\n height: 24px;\n}\n.bpx-state-buff .bpx-player-state-buff-text {\n display: block;\n line-height: 1;\n font-size: 14px;\n color: #fff;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);\n margin-top: 8px;\n}\n/**\n * @file Standalone Module\n */\n.bpx-legacy-browser-container {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n color: white;\n font-size: 16px;\n text-align: center;\n background-color: black;\n z-index: 100;\n}\n.bpx-legacy-browser-image {\n margin-bottom: 1em;\n width: 60%;\n max-width: 300px;\n}\n.bpx-legacy-browser-text {\n margin: 0;\n line-height: 2;\n}\n","/**\n * Define CSS Variables\n *\n * MUST be have `:root` selector only and MUST be CSS-compliant.\n * MUST be name in kebab-case\n */\n:root {\n --bpx-video-bgcolor: #000;\n\n // --bpx-primary-color: #00a1d6;\n --bpx-primary-bgcolor: transparent;\n\n // --bpx-fn-color: #00a1d6;\n // --bpx-fn-hover-color: #00b5e5;\n\n --bpx-tooltip-color: #fff;\n --bpx-tooltip-bgcolor: rgba(0, 0, 0, 1);\n\n --bpx-toast-color: #fff;\n --bpx-toast-bgcolor: rgba(25, 25, 25, 0.88);\n --bpx-toast-fn-color: #f25d8e;\n --bpx-toast-fn-hover-color: #ff85ad;\n --bpx-toast-font-size: 14px;\n\n --bpx-ui-font-size: 12px;\n}\n","@import (reference) 'global';\n\n/**\n * CSS Reset Style\n *\n * DON'T use global css reset style\n */\n.@{dpx} {\n ol,\n ul {\n list-style: none;\n outline: none;\n }\n\n table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n input,\n a {\n text-decoration: none;\n outline: none;\n }\n\n svg[data-pointer='none'] {\n pointer-events: none;\n }\n}\n\n.@{dpx} {\n font-style: normal;\n font-size: 12px;\n line-height: 1;\n box-sizing: initial;\n}\n","@import (reference) 'global';\n\n.@{cpx}-hidden {\n display: none !important;\n}\n\n.@{cpx}-opacity-60 {\n opacity: 0.6;\n}\n\n.@{cpx}-opacity-0 {\n opacity: 0;\n}\n\n.@{cpx}-svg-icon {\n display: inline-flex;\n width: 100%;\n height: 100%;\n user-select: none;\n\n svg {\n width: 100%;\n height: 100%;\n transition: fill 150ms ease-in-out;\n }\n}\n","@import (reference) '../base/global';\n\n.@{dpx}-major {\n position: relative;\n width: 100%;\n height: 100%;\n\n &.@{spx}-light-off {\n &:before {\n content: '';\n display: block;\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background-color: black;\n opacity: 0.9;\n z-index: @zIndex-lightOff-backdrop;\n }\n\n .@{ppx}-container {\n box-shadow: none;\n z-index: @zIndex-lightOff-container;\n }\n }\n}\n\n.@{dpx}-minor {\n position: relative;\n width: 100%;\n // min-height: @minor-placeholder-min-height;\n &:empty {\n background-color: @aux-header-bg;\n border-radius: @normal-border-raduis;\n }\n &:not(:empty) {\n background-color: @aux-content-bg;\n }\n}\n\n.@{dpx}-patch {\n position: absolute;\n top: 0;\n left: 0;\n width: 0 !important;\n height: 0 !important;\n}\n","@import (reference) '../base/global';\n\n.@{ppx}-container {\n position: relative;\n width: 100%;\n height: 100%;\n box-shadow: 0 0 8px @bpx-box-shadow;\n\n &.@{spx}-disable-box-shadow {\n box-shadow: none;\n }\n\n &[data-aspect-ratio='4:3'],\n &[data-aspect-ratio='16:9'] {\n .@{ppx}-video-wrap {\n position: relative;\n canvas {\n width: 100% !important;\n height: 100% !important;\n }\n }\n }\n\n &.@{spx}-black-gap {\n .@{ppx}-video-wrap {\n border-color: transparent;\n border-style: solid;\n border-width: 48px 7px;\n }\n\n .@{ppx}-control-mask {\n height: 180px;\n background: url('../asset/images/new-mask.png') repeat-x bottom;\n }\n }\n\n &[data-screen='web'],\n &[data-screen='full'],\n &[data-screen='mini'] {\n z-index: @zIndex-topmost !important;\n }\n\n &[data-ctrl-hidden='true'] {\n .@{ppx}-top-wrap {\n visibility: hidden;\n opacity: 0;\n }\n }\n\n &[data-ctrl-hidden='false'] {\n .@{ppx}-top-wrap {\n visibility: visible;\n opacity: 1;\n }\n }\n\n // 修复全屏播放器下弹幕消失问题\n &[data-screen='full'][data-ctrl-hidden='true'] {\n .@{ppx}-visual-wrap {\n visibility: visible;\n }\n }\n\n &[data-screen='mini'] {\n position: fixed !important;\n width: 400px;\n height: 225px;\n border-radius: 4px;\n overflow: hidden;\n }\n\n // UGC新版播放页/首映播放页mini模式尺寸适配\n &[data-revision='1'],\n &[data-revision='2'] {\n &[data-screen='mini'] {\n width: 320px;\n height: 180px;\n }\n\n @media screen and (min-width: 1681px) {\n &[data-screen='mini'] {\n width: 360px;\n height: 203px;\n }\n }\n\n .@{ppx}-sending-bar {\n font-size: 13px;\n padding-left: 12px;\n\n @media screen and (min-width: 1681px) {\n height: 56px;\n font-size: 14px;\n }\n }\n }\n\n &[data-revision='2'] {\n &[data-screen='web'] {\n box-shadow: none;\n }\n }\n}\n","@import (reference) '../base/global';\n\n.@{ppx}-primary-area {\n display: flex;\n width: 100%;\n height: 100%;\n flex-direction: column;\n flex-wrap: nowrap;\n}\n\n.@{ppx}-hinter-area {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: black;\n background-size: cover;\n background-position: center;\n z-index: 500;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -42px;\n margin-left: -42px;\n width: 84px;\n height: 84px;\n background: url('//s1.hdslb.com/bfs/static/player/img/play.svg') no-repeat center;\n }\n}\n\n// 右键菜单容器样式(层级待调整\n.@{ppx}-context-area {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1000;\n pointer-events: none;\n}\n","@import (reference) '../base/global';\n\n.@{ppx}-video-area {\n position: relative;\n flex: 1;\n background-color: @video-bgColor;\n overflow: hidden;\n &.@{ppx}-mouse-event {\n cursor: pointer;\n }\n}\n\n.@{ppx}-sending-area {\n &[hidden] {\n display: none;\n }\n}\n","@import (reference) '../base/global';\n@import (reference) '../base/theme';\n\n.@{ppx}-ending-wrap {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n z-index: @zIndex-endingWrap;\n\n &[hidden] {\n display: none;\n }\n\n &[data-select='1'],\n &[data-select='2'] {\n opacity: 1;\n visibility: visible;\n transition: none;\n }\n\n &[data-select='1'] .@{ppx}-ending-backdrop,\n &[data-select='2'] .@{ppx}-ending-backdrop,\n &[data-select='1'] .@{ppx}-ending-panel,\n &[data-select='2'] .@{ppx}-share-panel {\n opacity: 1;\n visibility: visible;\n transition: opacity 200ms linear;\n }\n}\n\n.@{ppx}-ending-backdrop {\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: @black-6;\n }\n position: absolute;\n top: -10%;\n left: -10%;\n width: 120%;\n height: 120%;\n background-position: center;\n background-size: cover;\n filter: blur(20px);\n z-index: -1;\n}\n\n.@{ppx}-ending-panel,\n.@{ppx}-share-panel {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.@{ppx}-ending-panel {\n z-index: 1;\n}\n\n.@{ppx}-share-panel {\n z-index: 2;\n}\n\n.@{ppx}-ending-wrap,\n.@{ppx}-ending-backdrop,\n.@{ppx}-ending-panel,\n.@{ppx}-share-panel {\n opacity: 0;\n visibility: hidden;\n transition: opacity 200ms linear, visibility 0ms 200ms;\n}\n\n.@{ppx}-state-wrap {\n pointer-events: none;\n}\n\n.@{ppx}-control-wrap {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n z-index: @zIndex-majorControls;\n\n &[hidden] {\n display: none;\n }\n}\n\n// pc客户端会将box-sizing设置为border-box,这里重置为initial\n.@{ppx}-pc-app {\n *, *::before, *::after {\n box-sizing: initial;\n }\n}\n\n// 处理外链可能会展示白底发送栏的问题\n// 先隐藏,后续 CSS 会覆盖这些样式\n.@{ppx}-embedded, .@{ppx}-pc-app {\n .@{ppx}-sending-bar {\n height: auto;\n &-left,\n &-right {\n height: 0;\n }\n }\n}\n\n.@{ppx}-sending-bar {\n position: relative;\n display: flex;\n flex-shrink: 0;\n height: 46px;\n align-items: center;\n padding: 0 12px;\n background: @dmsend-main-bg;\n\n &-left {\n margin-right: 10px;\n width: 176px;\n height: 22px;\n background-color: rgba(0, 0, 0, 0.04);\n }\n\n &-right {\n height: 22px;\n flex-grow: 1;\n background-color: rgba(0, 0, 0, 0.04);\n }\n}\n\n.@{ppx}-adv-dm-wrap,\n.@{ppx}-bas-dm-wrap,\n.@{ppx}-dm-mask-wrap,\n.@{ppx}-row-dm-wrap {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n cursor: pointer;\n pointer-events: none;\n z-index: 2;\n mask-position: center;\n user-select: none;\n}\n.@{ppx}-render-dm-wrap {\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: @zIndex-danmaku;\n}\n\n.@{ppx}-row-dm-wrap {\n &.ash-animation {\n animation: ash 2s linear 1s forwards;\n }\n &.ash-hide {\n opacity: 0;\n }\n &.ash-animation-paused {\n animation-play-state: paused;\n -webkit-animation-play-state: paused; /* Safari 和 Chrome */\n }\n\n &.unvisible {\n visibility: hidden;\n }\n}\n\n/* 仅为了解决弹幕在全屏模式下的显示问题 2025-02.28 \n/* 由于全屏模式下,d3d 11 集成显卡下,视频区域无可视像素点时,会将屏幕上的所有元素都隐藏\n/* 为了解决这个问题,在全屏模式下,视频区域内添加一个 1px * 1px 的像素点,保证视频区域有可视像素点 **/\n.@{ppx}-visual-wrap {\n pointer-events: none;\n width: 100%;\n visibility: hidden;\n .@{ppx}-visual-pixel {\n position: absolute;\n top: 50%;\n left: 0;\n width: 1px;\n height: 1px;\n background: @black-1;\n }\n}\n\n.@{ppx}-top-wrap {\n display: flex;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n color: @white-10;\n transition: all 0.2s ease-in-out;\n pointer-events: none;\n z-index: @zIndex-videoTop;\n\n &[hidden] {\n display: none;\n }\n}\n\n.@{ppx}-subtitle-wrap {\n z-index: @zIndex-subtitle;\n}\n\n.@{ppx}-music-wrap {\n position: absolute;\n top: 0;\n right: 0;\n\n &:not(:empty) {\n width: 100%;\n height: 100%;\n z-index: 81;\n }\n}\n\n.@{ppx}-business-wrap {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n z-index: 63;\n &.business-hide {\n display: none;\n }\n}\n\n.@{ppx}-container[data-screen='mini'] {\n .@{ppx}-ending-panel,\n .@{ppx}-share-panel,\n .@{ppx}-interaction-story,\n .@{ppx}-interaction-hidden,\n .@{ppx}-cmd-dm-wrap,\n .@{ppx}-interaction-rookie-guide,\n .@{ppx}-panorama,\n .@{ppx}-music-wrap {\n display: none !important;\n }\n}\n\n@keyframes ash {\n 0% {\n filter: url(#fractal) blur(0px);\n opacity: 1;\n }\n\n 25% {\n filter: url(#fractal) blur(2.5px);\n opacity: 0.75;\n }\n\n 50% {\n filter: url(#fractal) blur(5px);\n opacity: 0.5;\n }\n\n 75% {\n filter: url(#fractal) blur(7.5px);\n opacity: 0.25;\n }\n\n 100% {\n filter: url(#fractal) blur(10px);\n opacity: 0;\n }\n}\n","@import (reference) '../base/global';\n\n.@{ppx}-loading-panel {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: black;\n z-index: @zIndex-loadingPanel;\n\n &.@{spx}-loading {\n display: block;\n }\n}\n\n.@{ppx}-loading-panel-blur {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n pointer-events: none;\n\n &[hidden] {\n display: none;\n }\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.3);\n }\n}\n\n.@{ppx}-loading-panel-blur-detail {\n width: 320px;\n height: 184px;\n background: url('//s1.hdslb.com/bfs/static/player/img/ploading.png') no-repeat;\n transform: scale(0.5);\n animation: bpx-animation-loading 0.94s steps(1) infinite;\n}\n\n.@{ppx}-loading-panel-text {\n position: absolute;\n left: 12px;\n right: 12px;\n bottom: 56px;\n color: rgba(255, 255, 255, 0.6);\n font-size: 12px;\n line-height: 1.6;\n\n &[hidden] {\n display: none;\n }\n\n &-row {\n white-space: nowrap;\n }\n}\n","@import (reference) '../base/global';\n\n.@{ppx}-video-poster {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n\n &[hidden] {\n display: none;\n }\n\n img {\n width: 100%;\n height: 100%;\n }\n}\n\n.@{ppx}-video-perch {\n display: flex;\n flex: none;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n position: relative;\n}\n\n\n.@{ppx}-video-wrap {\n display: block;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n\n .@{ppx}-seamless-replacement {\n display: block;\n position: absolute;\n margin: auto;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n content-visibility: visible;\n }\n\n video,\n bwp-video {\n display: block;\n margin: auto;\n width: 100%;\n height: 100%;\n content-visibility: visible;\n }\n}\n\n.@{ppx}-state-play,\n.@{ppx}-state-buff-icon,\n.@{ppx}-state-buff-text {\n display: none;\n}\n\n// 暂停\n.@{spx}-paused {\n .@{ppx}-state-wrap {\n position: absolute;\n right: 34px;\n bottom: 62px;\n cursor: pointer;\n pointer-events: none;\n z-index: @zIndex-state;\n }\n\n .@{ppx}-state-play {\n display: block;\n width: 64px;\n height: 64px;\n background: url('//s1.hdslb.com/bfs/static/player/img/play.svg') center no-repeat;\n }\n\n &[data-screen='web'],\n &[data-screen='full'] {\n .@{ppx}-state-wrap {\n bottom: 107px;\n }\n }\n}\n// 隐藏鼠标\n.@{spx}-no-cursor {\n .@{ppx}-video-perch {\n cursor: none;\n }\n}\n\n.@{spx}-mirror {\n video,\n bwp-video {\n // Workaround: fix video.rotateY(180deg) bug on some PC\n transform: rotateX(0.001deg) rotateY(180.001deg);\n }\n\n canvas {\n transform: scaleX(-1) translate(50%, -50%) !important;\n }\n\n}\n","@import (reference) '../base/global';\n\n.@{spx}-buff {\n .@{ppx}-state-wrap {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: @zIndex-state;\n }\n\n .@{ppx}-state-buff-icon {\n display: block;\n width: 24px;\n height: 24px;\n }\n\n .@{ppx}-state-buff-text {\n display: block;\n line-height: 1;\n font-size: 14px;\n color: #fff;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);\n margin-top: 8px;\n }\n}\n","/**\n * @file Standalone Module\n */\n.bpx-legacy-browser-container {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n color: white;\n font-size: 16px;\n text-align: center;\n background-color: black;\n z-index: 100;\n}\n\n.bpx-legacy-browser-image {\n margin-bottom: 1em;\n width: 60%;\n max-width: 300px;\n}\n\n.bpx-legacy-browser-text {\n margin: 0;\n line-height: 2;\n}\n"], sourceRoot:""}]),t.Z=c},50282:function(e){"use strict";var t=[];function r(e){for(var r=-1,n=0;n0?" ".concat(i.layer):""," {")),o+=i.css,a&&(o+="}"),i.media&&(o+="}"),i.supports&&(o+="}")}if(e.styleSheet)e.styleSheet.cssText=r(t,o);else{var s=document.createTextNode(o),u=e.childNodes;u[t]&&e.removeChild(u[t]),u.length?e.insertBefore(s,u[t]):e.appendChild(s)}}var i={singleton:null,singletonCounter:0};e.exports=function(e){var t=i.singletonCounter++,r=i.singleton||(i.singleton=e.insertStyleElement(e));return{update:function(e){n(r,t,!1,e)},remove:function(e){n(r,t,!0,e)}}}},28946:function(e,t,r){"use strict";r.d(t,{R2:function(){return l},_j:function(){return i},a_:function(){return a},bw:function(){return u},cx:function(){return s},eG:function(){return n},m:function(){return o}});var n="bpx-docker",i="bpx-common",o="bpx-player",a="bpx-state",s="".concat(o,"-seamless-replacement"),u="nano",l=/\/player\/(main|js)\/core\.(.+\.)?js(\?.*)?$/},55929:function(e,t,r){"use strict";r.d(t,{CQ:function(){return n},CU:function(){return i},Om:function(){return u},or:function(){return o},uU:function(){return s},ul:function(){return a}});var n="CURRENT_QUALITY",i="CURRENT_FNVAL",o="CURRENT_BLACKGAP",a="bpx_player_profile",s="bilibili_player_codec_prefer_type",u="bilibili_player_gpu_renderer"},59580:function(e,t,r){"use strict";r.d(t,{D2:function(){return o},Dy:function(){return l},QP:function(){return a},nG:function(){return u},vJ:function(){return i},xw:function(){return s},yE:function(){return n}});var n=0,i=0,o=1,a=!0,s=!1,u=!0,l=0},71452:function(e,t,r){"use strict";r.d(t,{a:function(){return n}});var n={fade:!1,scale:!0,fontsize:1,opacity:.4,bilingual:!1,color:"16777215",shadow:"0",position:"bottom-center"}},50659:function(e,t,r){"use strict";r.d(t,{Ml:function(){return o},tn:function(){return i},x:function(){return n}});var n="https://s1.hdslb.com/bfs/seed/jinkela/short/mini-login-v2/miniLogin.umd.min.js",i="https://passport.bilibili.com/login",o="//s1.hdslb.com/bfs/static/player/media/error.mp4"},51513:function(e,t,r){"use strict";var n,i,o,a,s,u,l,c;r.d(t,{HR:function(){return o},_1:function(){return c},dY:function(){return n},hH:function(){return s},qW:function(){return u},s:function(){return l},ty:function(){return i},u5:function(){return a}}),function(e){e[e.Normal=0]="Normal",e[e.Wide=1]="Wide",e[e.Web=2]="Web",e[e.Mini=3]="Mini",e[e.Full=4]="Full",e[e.Pip=5]="Pip"}(n||(n={})),function(e){e[e.Auto=0]="Auto",e[e.Delay=1]="Delay",e[e.Abort=2]="Abort"}(i||(i={})),function(e){e[e.Ugc=0]="Ugc",e[e.Pgc=1]="Pgc",e[e.Pugv=2]="Pugv",e[e.Stein=3]="Stein",e[e.Oneself=4]="Oneself",e[e.Manager=5]="Manager"}(o||(o={})),function(e){e[e.Default=0]="Default",e[e.Manager=1]="Manager",e[e.Creator=2]="Creator",e[e.Oneself=3]="Oneself",e[e.Homepage=4]="Homepage",e[e.Homepage_Topic=5]="Homepage_Topic",e[e.Embedded=6]="Embedded",e[e.PC_APP=7]="PC_APP",e[e.Playlist=8]="Playlist",e[e.Embedded_White=9]="Embedded_White",e[e.Embedded_Other=10]="Embedded_Other"}(a||(a={})),function(e){e.ManualAction="ManualAction",e.TimeupdateEvent="TimeupdateEvent",e.SeekingEvent="SeekingEvent"}(s||(s={})),function(e){e[e.I_PlayUrl=0]="I_PlayUrl",e[e.I_UserInfo=1]="I_UserInfo",e[e.I_ViewInfo=2]="I_ViewInfo",e[e.I_VideoShot=3]="I_VideoShot",e[e.P_Title=4]="P_Title",e[e.M_Lottie=5]="M_Lottie"}(u||(u={})),function(e){e[e.Like=0]="Like",e[e.Coin=1]="Coin",e[e.Triple=2]="Triple",e[e.Follow=3]="Follow",e[e.Collect=4]="Collect",e[e.Electric=5]="Electric",e[e.UpInfo=6]="UpInfo",e[e.Manuscript=7]="Manuscript",e[e.Interaction_Guide=8]="Interaction_Guide",e[e.Realname_Certified=9]="Realname_Certified",e[e.Super_Quality_Guide=10]="Super_Quality_Guide",e[e.DM_Cross=11]="DM_Cross",e[e.Report_Observer=12]="Report_Observer",e[e.Music=13]="Music",e[e.Premiere=14]="Premiere",e[e.Creator_Attention_Pos_Update=15]="Creator_Attention_Pos_Update",e[e.ThreeBody=16]="ThreeBody",e[e.Redirect=17]="Redirect",e[e.Eplist_Pgc_Direct=18]="Eplist_Pgc_Direct",e[e.Prev_Next_Pgc_Direct=19]="Prev_Next_Pgc_Direct",e[e.GetVideoData=20]="GetVideoData",e[e.OpenUrl=21]="OpenUrl",e[e.First_Playtime=22]="First_Playtime"}(l||(l={})),function(e){e[e.START=0]="START",e[e.COMPLETED=1]="COMPLETED",e[e.FAILED=2]="FAILED"}(c||(c={}))},99854:function(e,t,r){"use strict";var n;r.d(t,{p:function(){return n}}),function(e){e.PLAYER_FAWKES_CONFIG_LOADED="PLAYER_FAWKES_CONFIG_LOADED",e.PLAYER_GRAPH_FLATTEN="PLAYER_GRAPH_FLATTEN",e.PLAYER_STORAGE_BUILD="PLAYER_STORAGE_BUILD",e.PLAYER_STATE_CREATE="PLAYER_STATE_CREATE",e.PLAYER_STATE_CREATED="PLAYER_STATE_CREATED",e.PLAYER_STORE_MOUNT="PLAYER_STORE_MOUNT",e.PLAYER_STORE_MOUNTED="PLAYER_STORE_MOUNTED",e.PLAYER_LOADED="PLAYER_LOADED",e.PLAYER_UNLOAD="PLAYER_UNLOAD",e.PLAYER_UNLOADED="PLAYER_UNLOADED",e.MEDIA_LOADSTART="MEDIA_LOADSTART",e.MEDIA_LOADEDMETADATA="MEDIA_LOADEDMETADATA",e.MEDIA_LOADEDDATA="MEDIA_LOADEDDATA",e.MEDIA_CANPLAY="MEDIA_CANPLAY",e.MEDIA_PLAY="MEDIA_PLAY",e.MEDIA_PAUSE="MEDIA_PAUSE",e.MEDIA_WAITING="MEDIA_WAITING",e.MEDIA_PLAYING="MEDIA_PLAYING",e.MEDIA_SEEKING="MEDIA_SEEKING",e.MEDIA_SEEKED="MEDIA_SEEKED",e.MEDIA_STALLED="MEDIA_STALLED",e.MEDIA_PROGRESS="MEDIA_PROGRESS",e.MEDIA_SUSPEND="MEDIA_SUSPEND",e.MEDIA_TIMEUPDATE="MEDIA_TIMEUPDATE",e.MEDIA_RATECHANGE="MEDIA_RATECHANGE",e.MEDIA_VOLUMECHANGE="MEDIA_VOLUMECHANGE",e.MEDIA_DURATIONCHANGE="MEDIA_DURATIONCHANGE",e.MEDIA_ABORT="MEDIA_ABORT",e.MEDIA_ENDED="MEDIA_ENDED",e.MEDIA_EMPTIED="MEDIA_EMPTIED",e.MEDIA_ERROR="MEDIA_ERROR",e.PLAYER_BEFORE_MEDIA_REPLACE="PLAYER_BEFORE_MEDIA_REPLACE",e.PLAYER_MEDIA_CHANGED="PLAYER_MEDIA_CHANGED",e.PLAYER_BEFORE_SEEKING="PLAYER_BEFORE_SEEKING",e.PLAYER_LAG_FRAME="PLAYER_LAG_FRAME",e.PLAYER_PLAYBACK_LAG="PLAYER_PLAYBACK_LAG",e.PLAYER_HEARTBEAT="PLAYER_HEARTBEAT",e.PLAYER_TOUCH_GESTURE="PLAYER_TOUCH_GESTURE",e.PLAYER_CLEAR_SUBTITLE="PLAYER_CLEAR_SUBTITLE",e.ERROR_DASH_INITIALIZE="ERROR_DASH_INITIALIZE",e.ERROR_DASH_KERNEL="ERROR_DASH_KERNEL",e.ERROR_FLV_KERNEL="ERROR_FLV_KERNEL",e.ERROR_PLAY_URL="ERROR_PLAY_URL",e.WASM_PLAYER_FALLBACK="WASM_PLAYER_FALLBACK",e.PATCH_ADV_PLAY_ENDED="PATCH_ADV_PLAY_ENDED",e.PLAYER_STREAM_BUFFERING_COMPLETED="PLAYER_STREAM_BUFFERING_COMPLETED"}(n||(n={}))},59735:function(e,t,r){"use strict";var n;r.d(t,{t:function(){return n}}),function(e){e.Player_Navigate="Player_Navigate",e.Player_Committed="Player_Committed", e.Player_Prepared="Player_Prepared",e.Player_Enter_Loading="Player_Enter_Loading",e.Player_Leave_Loading="Player_Leave_Loading",e.Player_Initialized="Player_Initialized",e.Player_Connected="Player_Connected",e.Player_Show_EndPanel="Player_Show_EndPanel",e.Player_Hide_EndPanel="Player_Hide_EndPanel",e.Player_Show_Controls="Player_Show_Controls",e.Player_Hide_Controls="Player_Hide_Controls",e.Player_Dispose="Player_Dispose",e.Player_Disconnect="Player_Disconnect",e.Player_Idle_Frame="Player_Idle_Frame",e.Player_LoadStart="Player_LoadStart",e.Player_LoadedMetadata="Player_LoadedMetadata",e.Player_LoadedData="Player_LoadedData",e.Player_Canplay="Player_Canplay",e.Player_Play="Player_Play",e.Player_Pause="Player_Pause",e.Player_Waiting="Player_Waiting",e.Player_Playing="Player_Playing",e.Player_Seeking="Player_Seeking",e.Player_Seeked="Player_Seeked",e.Player_Stalled="Player_Stalled",e.Player_Progress="Player_Progress",e.Player_Suspend="Player_Suspend",e.Player_TimeUpdate="Player_TimeUpdate",e.Player_RateChange="Player_RateChange",e.Player_VolumeChange="Player_VolumeChange",e.Player_DurationChange="Player_DurationChange",e.Player_Abort="Player_Abort",e.Player_Ended="Player_Ended",e.Player_Error="Player_Error",e.Player_Emptied="Player_Emptied",e.Player_PlayUrl_Done="Player_PlayUrl_Done",e.Player_Ai_Animation_Triggered="Player_Ai_Animation_Triggered",e.Player_LoopChange="Player_LoopChange",e.Player_PatchSwitch="Player_PatchSwitch",e.Player_MirrorChange="Player_MirrorChange",e.Player_AspectRatioChange="Player_AspectRatioChange",e.Player_LightOffChange="Player_LightOffChange",e.Player_BlackGapChange="Player_BlackGapChange",e.Player_AutoplayChange="Player_AutoplayChange",e.Player_HandoffChange="Player_HandoffChange",e.Player_PreferCodecChange="Player_PreferCodecChange",e.Player_OpEdChange="Player_OpEdChange",e.Player_LoudnessChange="Player_LoudnessChange",e.Player_Loop_Signal="Player_Loop_Signal",e.Player_Handoff_Signal="Player_Handoff_Signal",e.Player_Danmaku_Change="Player_Danmaku_Change",e.Player_Hotspot_Change="Player_Hotspot_Change",e.Player_SharePanel_Change="Player_SharePanel_Change",e.Player_ProgressBar_Change="Player_ProgressBar_Change",e.Player_Access_Changed="Player_Access_Changed",e.Player_Quality_Changed="Player_Quality_Changed",e.Player_Quality_Requested="Player_Quality_Requested",e.Player_Quality_Rendered="Player_Quality_Rendered",e.Player_Statue_Changed="Player_Statue_Changed",e.Player_Container_Resize="Player_Container_Resize",e.Player_Aspect_Switch_Change="Player_Aspect_Switch_Change",e.Player_Summary_Change="Player_Summary_Change",e.Media_Element_Resize="Media_Element_Resize",e.Media_Autoplay_Not_Allowed="Media_Autoplay_Not_Allowed",e.Player_Perch_Click="Player_Perch_Click",e.Player_Submit_Feedback="Player_Submit_Feedback",e.Player_Vip_Trial_Toast_Envoked="Player_Vip_Trial_Toast_Envoked",e.Player_Vip_Trial_Prompt_Toast="Player_Vip_Trial_Prompt_Toast",e.Player_Vip_Qulaity_Trial="Player_Vip_Qulaity_Trial",e.Player_Vip_Qulaity_Trial_End="Player_Vip_Qulaity_Trial_End",e.Player_Patch_Adv_Report="Player_Patch_Adv_Report",e.Player_Sand_Animation_Running="Player_Sand_Animation_Running",e.Player_Virtual_Action="Player_Virtual_Action",e.Player_Polar_Report="Player_Polar_Report"}(n||(n={}))},27032:function(e,t,r){"use strict";r.d(t,{Rs:function(){return o},ZZ:function(){return n},M5:function(){return i.LoudnessMeterMode},Zc:function(){return f},Qj:function(){return d},Ac:function(){return v},rs:function(){return s},ae:function(){return A},T1:function(){return E},YE:function(){return S},ql:function(){return w},pu:function(){return T},rS:function(){return _},oh:function(){return a},fB:function(){return b}});var n,i=r(57179),o=function(){function e(){}return e.USER_LOGOUT=0,e.USER_LIMITED=1,e.USER_REGISTERED=2,e.USER_NORMAL=3,e.USER_VIP=4,e.USER_ADVANCED=5,e.P_ROLE_FREE=0,e.P_ROLE_ASSISTANT=1,e.SEND_POOL_NORMAL=[],e.SEND_POOL_ADMIN=[1,1],e.SEND_FONT_SIZE_LOGOUT=[0,0,0,0,0,0,0],e.SEND_FONT_SIZE_LIMITED=[0,0,1,1,0,0,0],e.SEND_FONT_SIZE_REGISTERED=[0,0,1,1,0,0,0],e.SEND_FONT_SIZE_NORMAL=[0,0,1,1,0,0,0],e.SEND_FONT_SIZE_VIP=[0,1,1,1,1,0,0],e.SEND_FONT_SIZE_ADVANCED=[1,1,1,1,1,1,1],e.SEND_FONT_SIZE_ADMIN=[0,0,1,1,1,0,0],e.SEND_MODE_LOGOUT=[0,0,0,0],e.SEND_MODE_LIMITED=[1,-2,-2,0],e.SEND_MODE_REGISTERED=[1,-2,-2,0],e.SEND_MODE_NORMAL=[1,-2,-2,0],e.SEND_MODE_VIP=[1,1,1,1],e.SEND_MODE_ADVANCED=[1,1,1,1],e.SEND_MODE_LEVEL_LOW=[1,-2,-2,0],e.SEND_MODE_LEVEL_TWO=[1,-2,-2,0],e.SEND_MODE_LEVEL_NORMAL=[1,1,1,0],e.SEND_COLOR_LOGOUT=0,e.SEND_COLOR_LEVEL_LOW=1,e.SEND_COLOR_NORMAL=2,e.SEND_STATUS_LOGOUT=0,e.SEND_STATUS_LEVEL_LOW=1,e.SEND_STATUS_LIMITED=4,e.SEND_STATUS_NORMAL=5,e.SEND_STATUS_TYPING=6,e.SEND_STATUS_BEYOND_WORDS=7,e.SEND_STATUS_SENDING=8,e.SEND_STATUS_SENT=9,e.SEND_STATUS_BLOCKING=11,e.SEND_STATUS_BLOCKED=12,e.SEND_STATUS_CLOSED=13,e.SEND_STATUS_UPDATE=14,e.SEND_ANSWER_STATUS_IN=15,e.SEND_STATUS_CANNOT_BUY=16,e.SEND_STATUS_UP_DM=17,e.SEND_STATUS_DYNAMIC_PANEL=18,e.SEND_STATUS_MANUALLY_CLOSED=19,e.SEND_STATUS_ELECTRIC_TRIAL_WATCH=20,e.SEND_INPUT_LOGOUT=[0,1e5],e.SEND_INPUT_LIMITED=[20,1e4],e.SEND_INPUT_REGISTERED=[20,1e4],e.SEND_INPUT_NORMAL=[100,5e3],e.SEND_INPUT_VIP=[100,1e3],e.SEND_INPUT_ADVANCED=[100,1e3],e.BLOCK_DISABLED=0,e.BLOCK_SCROLL=1,e.BLOCK_REVERSE=2,e.BLOCK_BOTTOM=3,e.BLOCK_TOP=4,e.BLOCK_COLOR=5,e.BLOCK_GUEST=6,e.BLOCK_FONTSIZE=7,e.BLOCK_NORMAL=8,e.BLOCK_SUBTITLE=9,e.BLOCK_SPECIAL=10,e.BLOCK_LIST_USER=11,e.BLOCK_LIST_KEYWORD=12,e.BLOCK_LIST_COLOR=13,e.BLOCK_LIST_REGEXP=14,e.BLOCK_CLOUD_VIDEO=15,e.BLOCK_CLOUD_PARTITION=16,e.BLOCK_CLOUD_ALL=17,e.BLOCK_CLOUD_UP=18,e}();function a(e,t,r,i,o){var a="https://www.bilibili.com?",s="https://app.bilibili.com?",u=function(e){var t=e.match(/\/av(\d+)\?/);if(t&&t[1])return t[1]}(t);t||("main"===e&&(t=a),"download"===e&&(t=s));var l=new URL(t),c=l.searchParams;switch(c.append("spm_id_from",1===r?n.Embed:n.Embed_White_Other),"play"===e&&(o&&c.append("t",o.toString()),u&&c.append("aid",u),i&&c.append("bvid",i)),window.__NanoEmbedRefer&&c.append("embed_refer",document.referrer),e){case"play":return void window.open(l.href);case"main":return void window.open(a+"&".concat(c.toString()));case"download":return void window.open(s+"&".concat(c.toString()));default:return}}function s(e){var t={dolbyAudioQuality:0,hasDolbyAudio:!1,hasDolbyAudioSrc:!1,dolbyName:null,flacAudioQuality:0,hasFlacAudio:!1,hasFlacAudioSrc:!1,flacName:null,type:null};try{var r=e.url;if(r.dolby&&r.dolby.type){var n=+r.dolby.type,i=Array.isArray(r.dolby.audio)&&r.dolby.audio[0];if(t.hasDolbyAudio=!0,t.type=n,2===n)t.dolbyName="杜比全景声";else t.dolbyName="杜比音效";i&&i.id&&(t.dolbyAudioQuality=+i.id,t.hasDolbyAudioSrc=!0)}r.flac&&r.flac.display&&(t.hasFlacAudio=!0,t.flacName="Hi-Res无损音质",r.flac.audio&&r.flac.audio.id&&(t.flacAudioQuality=+r.flac.audio.id,t.hasFlacAudioSrc=!0))}catch(e){}return t}!function(e){e.Embed_White_Other="888.80997.embed_other.whitelist",e.Embed="888.82037.embed"}(n||(n={}));var u=r(43654),l=r.n(u),c=r(44425);function d(e){return e.quality}function f(e,t){var r,n,i,o,a=c.nJ.alias,u=e.mediaDataSource.url,d=1===t,f=2===t,p=s(e.mediaDataSource),h=e.quality<=a.SD_32?a.AQ_30216:e.quality=3)break}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},d=function(e,t){if(e){var r=document.createElement("link");r.rel=t,r.href=e,r.crossOrigin="anonymous",r.setAttribute("data-injector","nano"),n.appendChild(r)}};d(a,t),d(s,t),c(u,e.vBackupUrls),c(l,e.aBackupUrls),u.forEach((function(e){return d(e,r)})),l.forEach((function(e){return d(e,r)})),document.head.appendChild(n)}catch(e){}}}(e),t&&r&&function(e){var t=this;try{var r,n,i=new AbortController,o=i.signal,a={info:e,aChunks:[],vChunks:[],abort:function(){return"function"==typeof i.abort&&i.abort()}},s=function(e,r,n){if(o.aborted)throw new Error("AbortError");var i={mode:"cors",cache:"force-cache",redirect:"follow",credentials:"omit",headers:{range:"bytes=".concat(r)},signal:o};return fetch(e,i).then((function(e){return(0,p.mG)(t,void 0,void 0,(function(){var t,r;return(0,p.Jh)(this,(function(i){switch(i.label){case 0:return e.ok?(r=(t=n).push,[4,e.arrayBuffer()]):[3,2];case 1:return r.apply(t,[i.sent()]),[3,3];case 2:throw new Error("HTTP error, status = ".concat(e.status));case 3:return[2]}}))}))}))};["0-8000","8001-100000","100001-200000","200001-300000"].forEach((function(t){r=r?r.then((function(){return s(e.vUrl,t,a.vChunks)})):s(e.vUrl,t,a.vChunks)})),["0-4000","4001-50000","50000-100000","100001-150000"].forEach((function(t){n=n?n.then((function(){return s(e.aUrl,t,a.aChunks)})):s(e.aUrl,t,a.aChunks)})),r&&r.catch(g.Z),n&&n.catch(g.Z),y.x8.fsd=a}catch(e){}}(e)}}var _=function(){return Promise.all([r.e(617),r.e(154)]).then(r.bind(r,11154))},E=function(){return r.e(565).then(r.t.bind(r,36861,23))},S=function(){return r.e(120).then(r.bind(r,86178))},A=function(){return r.e(571).then(r.bind(r,51190))},w=function(){return r.e(435).then(r.t.bind(r,8207,23))},T=function(){return Promise.resolve().then(r.bind(r,57179))}},12066:function(e,t,r){"use strict";r.d(t,{bV:function(){return En},p7:function(){return je},Su:function(){return yi},vq:function(){return mi.v},iG:function(){return Mr},u5:function(){return l.u5},Om:function(){return T.Om},ab:function(){return gi.a},mU:function(){return Yr},tw:function(){return a.t},HR:function(){return l.HR},ty:function(){return l.ty},hH:function(){return l.hH},p2:function(){return s.p},s:function(){return l.s},IS:function(){return ue},Dg:function(){return Zr},lS:function(){return Jn},Rr:function(){return ne},R2:function(){return y.R2},dY:function(){return l.dY},i0:function(){return Br},iX:function(){return ie},w9:function(){return on},wY:function(){return Hr},BI:function(){return Lr},oF:function(){return O.o},rs:function(){return j.rs},Wp:function(){return zr},YY:function(){return re}});var n=r(11985),i=r(79977),o=r(30086),a=r(59735),s=r(99854),u=r(58854),l=r(51513);function c(){try{return"function"==typeof ResizeObserver&&"function"==typeof ResizeObserver.prototype.observe}catch(e){return!1}}var d=r(15144),f=r(86217),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="UiAtom",t.boundingRectTimer=null,t.loadedTimeoutClock=null,t}return(0,n.ZT)(t,e),t.prototype.addEvents=function(){var e=this;this.rootPlayer.on(s.p.PLAYER_MEDIA_CHANGED,(function(){c()&&(e.removeResizeObserver(),e.addResizeObserver())}))},t.prototype.addReactions=function(){var e=this,t=this.rootStore.uiStore;this.dc.mainChanged=(0,o.U5)((function(){return t.state.mainScreen}),(function(r){e.resize(!1,!1),e.rootPlayer.emit(a.t.Player_Statue_Changed,new CustomEvent(a.t.Player_Statue_Changed,{detail:{mainTrigger:!0,sideTrigger:null,mainScreen:r,sideScreen:t.state.sideScreen}}))})),this.dc.sideChanged=(0,o.U5)((function(){return t.state.sideScreen}),(function(r){e.resize(!1,!1),e.rootPlayer.emit(a.t.Player_Statue_Changed,new CustomEvent(a.t.Player_Statue_Changed,{detail:{mainTrigger:null,sideTrigger:!0,mainScreen:t.state.mainScreen,sideScreen:r}}))})),this.dc.isLoaded=(0,o.U5)((function(){return e.rootStore.isLoaded}),(function(t){queueMicrotask((function(){t?e.rootPlayer.emit(a.t.Player_Leave_Loading,new CustomEvent(a.t.Player_Leave_Loading)):e.rootPlayer.emit(a.t.Player_Enter_Loading,new CustomEvent(a.t.Player_Enter_Loading))}))}),{fireImmediately:!0}),this.dc.containerResize=(0,o.U5)((function(){return{w:t.state.containerWidth,h:t.state.containerHeight}}),(function(){e.rootPlayer.emit(a.t.Player_Container_Resize,new CustomEvent(a.t.Player_Container_Resize))})),this.dc.videoNodeResize=(0,o.U5)((function(){return{w:t.state.videoNodeWidth,h:t.state.videoNodeHeight}}),(function(){e.rootPlayer.emit(a.t.Media_Element_Resize,new CustomEvent(a.t.Media_Element_Resize))})),this.dc.isFirstLoadEnded=(0,o.gx)((function(){return e.rootStore.isLoadEnded}),(function(){c()?e.addResizeObserver():e.resizeEventsDisposer=e.addResizeEvents(),e.resize(!0,!0)}))},t.prototype.startLoadChecker=function(e){var t=this;this.stopLoadChecker();this.loadedTimeoutClock=new d.eF((function(r,n){n>=r&&(t.log.w("[LoadChecker]","已超时","强制解除加载状态"),e&&e())}),3e3,500),this.dp.loadChecker&&this.dp.loadChecker(),this.dp.loadChecker=(0,o.EH)((function(){t.rootStore.pageHidden?t.loadedTimeoutClock&&t.loadedTimeoutClock.suspend():t.loadedTimeoutClock&&t.loadedTimeoutClock.resume()}))},t.prototype.stopLoadChecker=function(){this.dp.loadChecker&&this.dp.loadChecker(),this.loadedTimeoutClock&&(this.loadedTimeoutClock.abort(),this.loadedTimeoutClock=null)},t.prototype.boundingRectHandler=function(){var e={},t=this.nodes.container,r=this.nodes.videoArea,n=this.rootStore,i=n.mediaStore,o=n.uiStore;e.videoNodeWidth=Math.round(i.video.offsetWidth),e.videoNodeHeight=Math.round(i.video.offsetHeight),r&&(e.videoAreaWidth=Math.round(r.offsetWidth),e.videoAreaHeight=Math.round(r.offsetHeight)),t&&(e.containerWidth=Math.round(t.offsetWidth),e.containerHeight=Math.round(t.offsetHeight)),o.setState(e)},t.prototype.addResizeEvents=function(){var e=this,t=(0,f.Z)((function(){return e.resize()}),150);return t(),this.rootPlayer.window.addEventListener("resize",t),function(){e.rootPlayer.window.removeEventListener("resize",t),t.cancel()}},t.prototype.removeResizeEvents=function(){"function"==typeof this.resizeEventsDisposer&&this.resizeEventsDisposer()},t.prototype.addResizeObserver=function(){var e=this.nodes.container,t=this.nodes.videoArea,r=this.rootStore,i=r.mediaStore,o=r.uiStore,a=i.video;this.resizeObserver=new ResizeObserver((function(r,i){var s,u,l={};try{for(var c=(0,n.XA)(r),d=c.next();!d.done;d=c.next()){var f=d.value,p=f.contentRect;if(p){var h=Math.round(p.width),y=Math.round(p.height);switch(f.target){case e:l.containerWidth=h,l.containerHeight=y;break;case t:l.videoAreaWidth=h,l.videoAreaHeight=y;break;case a:l.videoNodeWidth=h,l.videoNodeHeight=y}}}}catch(e){ s={error:e}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}o.setState(l)})),this.resizeObserver.observe(e,{box:"border-box"}),this.resizeObserver.observe(t,{box:"border-box"}),this.resizeObserver.observe(a,{box:"border-box"})},t.prototype.removeResizeObserver=function(){this.resizeObserver&&this.resizeObserver.disconnect()},t.prototype.resize=function(e,t){var r=this;e?t?this.boundingRectHandler():(cancelAnimationFrame(this.boundingRectTimer),this.boundingRectTimer=requestAnimationFrame((function(){return r.boundingRectHandler()}))):c()||this.resize(!0,t)},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),cancelAnimationFrame(this.boundingRectTimer),this.stopLoadChecker(),this.removeResizeEvents(),this.removeResizeObserver()},t}(u.f),h=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="UiStore",(0,o.rC)(r),r.uiAtom=new p(t),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{isLoaded:!1,isLoadTimeout:!1,kind:l.HR.Ugc,mainScreen:l.dY.Normal,sideScreen:null,pipWindowWidth:0,pipWindowHeight:0,videoNodeWidth:0,videoNodeHeight:0,videoAreaWidth:0,videoAreaHeight:0,containerWidth:0,containerHeight:0,mouseClientX:0,mouseClientY:0,miniScreenRight:84,miniScreenBottom:48}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isTinyView",{get:function(){return null==this.state.sideScreen&&this.state.mainScreen===l.dY.Mini||(this.configStore.embeddedEnv?0===this.embedView:this.state.containerWidth<=480||this.state.containerHeight<=320)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFullView",{get:function(){return this.state.sideScreen===l.dY.Full||this.state.mainScreen===l.dY.Web},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"embedView",{get:function(){return this.state.containerWidth<420?0:this.state.containerWidth<550?1:this.state.containerWidth<730?2:this.state.containerWidth<1100?3:4},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasBlackGap",{get:function(){return this.portStore.getScreenKind()===l.dY.Normal&&!this.settingStore.state.hideBlackGap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenKind",{get:function(){return this.portStore.getScreenKind()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isShowCtrlButtons",{get:function(){var e=this.embedView,t=this.danmakuStore.state.isHideInput,r=this.state.videoAreaWidth;return!(e<=1)&&!(!t&&r<900&&3===e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kind",{get:function(){return this.state.kind},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){e.prototype.onMount.call(this),this.uiAtom.addEvents(),this.uiAtom.addReactions(),this.addEvents()},t.prototype.onCommitted=function(){var t=this;e.prototype.onCommitted.call(this),this.uiAtom.startLoadChecker((function(){t.setState({isLoadTimeout:!0})}))},t.prototype.complete=function(){this.uiAtom.stopLoadChecker(),this.setState({isLoaded:!0})},t.prototype.resize=function(e,t){this.uiAtom.resize(e,t)},t.prototype.addEvents=function(){this.rootPlayer.window.addEventListener("mousemove",this.onMousemove)},t.prototype.onMousemove=function(e){this.setState({mouseClientX:e.clientX||0,mouseClientY:e.clientY||0})},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{kind:1,mainScreen:1,sideScreen:1,pipWindowWidth:1,pipWindowHeight:1,videoNodeWidth:1,videoNodeHeight:1,videoAreaWidth:1,videoAreaHeight:1,containerWidth:1,containerHeight:1,mouseClientX:1,mouseClientY:1,miniScreenRight:1,miniScreenBottom:1})},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.rootPlayer.window.removeEventListener("mousemove",this.onMousemove)},(0,n.gn)([o.Fl],t.prototype,"isTinyView",null),(0,n.gn)([o.Fl],t.prototype,"isFullView",null),(0,n.gn)([o.Fl],t.prototype,"embedView",null),(0,n.gn)([o.Fl],t.prototype,"hasBlackGap",null),(0,n.gn)([o.Fl],t.prototype,"screenKind",null),(0,n.gn)([o.Fl],t.prototype,"isShowCtrlButtons",null),(0,n.gn)([i.ZP],t.prototype,"onMousemove",null),t}(u.u),y=r(28946);function m(e,t){return void 0===t&&(t=2),isNaN(e)?e:Math.round(Math.pow(10,t)*e)/Math.pow(10,t)}function g(){var e=document.createElement("video");e.crossOrigin="anonymous";try{return e}catch(t){return e}}function v(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,e.play()]}))}))}var b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="MediaAtom",t.autoplayId=1,t.autoplayIdUsed=0,t}return(0,n.ZT)(t,e),t.prototype.copyElementProps=function(e,t){var r=[function(){e.style.cssText&&(t.style.cssText=e.style.cssText)}];["controls","autoPictureInPicture","disablePictureInPicture"].forEach((function(r){return function(r){r in e&&t[r]!==e[r]&&(t[r]=e[r])}(r)})),r.forEach((function(e){return e()}))},t.prototype.getBufferRange=function(e){var t=this.rootStore.mediaStore.video,r=t.buffered,n=t.currentTime;if(r&&r.length){if(e)return[r.start(r.length-1),r.end(r.length-1)];for(var i=0,o=1/0,a=0;a=n)return[r.start(a),r.end(a)];var l=Math.min(Math.abs(n-s),Math.abs(n-u));o>l&&(i=a,o=l)}return[r.start(i),r.end(i)]}return[0,0]},t.prototype.gotoFirstTime=function(){if(!this.isFirstPlayForbidden()){var e=this.rootStore,t=e.mediaStore,r=e.configStore,n=e.mpdStore;if(!t.state.tExhausted){var i=r.t,o=t.video.duration,a=n.lastWatchSecond;i>0&&i-1||(u(),this.laggingDetail.timer=window.setInterval((function(){var e=i.video;if(e){var t=r.laggingDetail.previousTime,n=!(e.ended||e.paused||e.error),o=!a.state.kernelError,u=n&&o&&t===e.currentTime;i.state.lagging!==u&&i.setState({lagging:!!u}),u||(r.laggingDetail.previousTime=e.currentTime),r.rootPlayer.emit(s.p.PLAYER_LAG_FRAME,{isLagging:u,isRunning:!0})}}),this.laggingDetail.interval))))},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.hackLongStuck(!1,!0),this.checkBufferStatus(!1,!0),this.checkLaggingStatus(!1,{resetPreviousTime:!0})},t}(u.f),S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="StuckAtom",t.latestSeekedTime=NaN,t.extBufferingInfo={},t}return(0,n.ZT)(t,e),t.prototype.cleanAfterDispose=function(){this.latestSeekedTime=NaN,this.extBufferingInfo={}},t.prototype.addEvents=function(){var e=this,t=this.rootStore,r=t.mediaStore,n=t.portStore,i=t.kernelStore;this.rootPlayer.on(a.t.Player_Dispose,(function(){return e.cleanAfterDispose()}),1),this.rootPlayer.on(s.p.PLAYER_PLAYBACK_LAG,(function(){r.setState({loadLagTime:Date.now()})})).on(s.p.PLAYER_PLAYBACK_LAG,(function(){var t=NaN,o=NaN,a="",s=r.state.bufferedTime,u=n.getCurrentTime(),l=i.dashKernel;l&&(t=l.getBufferLength("video"),o=l.getBufferLength("audio"),"function"==typeof l.getNextFragmentHistoryInfo&&(a=l.getNextFragmentHistoryInfo())),e.track.o("web_loadlag",{ct:u,bt:s,vbl:t,abl:o,msg:a})})).on(s.p.MEDIA_TIMEUPDATE,(function(){r.state.loadLagTime&&(e.track.o("web_loadlag_end",{val:Date.now()-r.state.loadLagTime}),r.setState({loadLagTime:0}))})),this.rootPlayer.on(s.p.PLAYER_LAG_FRAME,(function(t){var n=r.video,o=n.currentTime;if(t.isLagging){if(r.setState({stalled:!0}),!r.state.bufferStartTime){var a={},s=i.dashKernel,u=s&&s.getBufferingInfo(!1),l=u&&u.type,c=r.state.bufferedTime,d=!(n.error||n.seeking||n.ended||n.paused);if(a.obLen=c,a.ocTime=o,s&&Object.assign(a,{vbl:s.getBufferLength("video"),abl:s.getBufferLength("audio"),spd:s.getNetworkActivity()},s.getBufferingInfo()),e.extBufferingInfo=a,e.track.o("start_load",a),o0&&u<.2&&(r.setState({seekLoad:!0}),e.extBufferingInfo.latestSeekedTime=e.latestSeekedTime,e.extBufferingInfo.videoTime=t,e.extBufferingInfo.delta=u,e.extBufferingInfo.ccType="seeked_hack"),e.track.o(r.state.seekLoad?"seek_end_load":r.state.lagLoad?"lag_end_load":r.state.headLoad?"head_end_load":r.state.nullLoad?"null_end_load":"end_load",e.extBufferingInfo,{exParam:i.serviceModule}),e.extBufferingInfo={}}}r.setState({stalled:!1,lagLoad:!1,seekLoad:!1,headLoad:!1,nullLoad:!1,bufferStartTime:0})}))},t.prototype.trySkipDashGap=function(e){var t=this.rootStore.mediaStore,r=t.video;try{var i=(0,n.CR)(e.gap.split("-").map(Number),2),o=i[0],a=i[1],s=Math.max(r.currentTime,e.cTime),u=Math.max(r.currentTime,a)+.1;a-o>0&&(this.log.w("[DashGap]","".concat(s,";").concat(o,",").concat(a)),this.track.o("video_gap",{ct:s,st:u,end:o,nextStart:a,type:+e.type})),isNaN(u)?this.trySkipMediaGap():u>s&&u!==t.state.prevSeekTime&&(this.log.i("[SkipDashGap]","ct:".concat(s,",st:").concat(u)),t.setState({prevSeekTime:u}),t.internalSeek(u))}catch(e){0,this.trySkipMediaGap()}},t.prototype.trySkipMediaGap=function(){var e=this.rootStore.mediaStore,t=e.video,r=t.currentTime;if(t.buffered&&t.buffered.length>1)for(var n=0;n=r-4&&s>r-4&&s-a<4&&(i=Math.max(s,r),this.log.w("[MediaGap]","".concat(r,";").concat(a,",").concat(s)),this.track.o("video_gap",{ct:r,st:i,end:a,nextStart:s,type:0})),i&&i!==e.state.prevSeekTime&&(this.log.i("[SkipGap]","ct:".concat(r,",st:").concat(i)),e.setState({prevSeekTime:i}),e.internalSeek(i))}},t}(u.f),A=function(e){function t(t){var r=e.call(this,t)||this;r.tag="MediaStore",r.ifReqId=null,r.ifTimer=null,r.modernResize=!1,(0,o.rC)(r),r.mediaAtom=new b(t),r.bufferAtom=new E(t),r.stuckAtom=new S(t);var n=r.element=g(),i=r.nodes.videoWrap;return n.crossOrigin="anonymous",r.rootPlayer.hasFeature("noPip")&&(n.disablePictureInPicture=!0),i&&!n.parentElement&&i.appendChild(n),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{ended:!1,paused:!0,duration:NaN,remoteDuration:NaN,currentTime:0,progressTime:0,bufferedTime:0,aBufferLength:null,vBufferLength:null,videoWidth:0,videoHeight:0,seeking:!1,lagging:!1,buffering:!1,isLoadStart:!1,isMetadataLoaded:!1,isFirstFrame:!1,isFirstCanplay:!1,isLastWatchSeeked:!1,tExhausted:!1,autoplayExhausted:!1,autoplayPlanB:!1,autoplayNotAllowed:!1,firstPlay:0,firstIdleFrame:0,stalled:!1,lagLoad:!1,seekLoad:!1,headLoad:!1,nullLoad:!1,bufferStartTime:0,previousTime:0,prevSeekTime:0,loadLagTime:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this.state.videoWidth&&this.state.videoHeight?this.state.videoWidth/this.state.videoHeight:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoplay",{get:function(){if(this.rootPlayer.hasFeature("noAutoplay"))return!1;switch(this.configStore.state.ips){case 2:return!1;case 1:return!0;default:return!this.episodeStore.isFirst||this.settingStore.state.autoplay}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"video",{get:function(){return this.element},enumerable:!1,configurable:!0}),t.prototype.addEvents=function(){var e=this;this.rootPlayer.on(a.t.Player_DurationChange,(function(){e.patchAdvStore.hasValidAdv&&(e.patchAdvStore.state.videoList[e.patchAdvStore.state.index].timelength=1e3*Math.ceil(e.mediaStore.video.duration)),e.setState({duration:e.portStore.getDuration(),remoteDuration:e.portStore.getDuration(!0)}) })).on(a.t.Player_TimeUpdate,(function(){e.setState({currentTime:e.portStore.getCurrentTime()})})).on(a.t.Player_Progress,(function(){e.setState({bufferedTime:e.mediaAtom.getBufferRange()[1]})})).on(a.t.Player_ProgressBar_Change,(function(t){e.setState({progressTime:t.detail.progressTime})})).on(a.t.Player_Quality_Rendered,(function(t){if(!(e.modernResize||t.detail&&"video"!==t.detail.mediaType)){var r=e.element.videoWidth,n=e.element.videoHeight;r&&n&&e.setState({videoWidth:r,videoHeight:n})}})).on(a.t.Player_PatchSwitch,(function(t){t&&t.detail&&(t.detail.stage===l._1.START&&(e.bufferAtom.checkBufferStatus(!1),e.bufferAtom.checkLaggingStatus(!1)))})),this.rootPlayer.on(a.t.Player_Play,this.leavePlayerEndedHandler).on(a.t.Player_TimeUpdate,this.leavePlayerEndedHandler).on(a.t.Player_Seeking,this.leavePlayerEndedHandler)},t.prototype.leavePlayerEndedHandler=function(){this.portStore.isEnded(!0)||this.setState({ended:!1})},t.prototype.internalSeek=function(e){var t=this.video;this.log.i("[internalSeek]","targetTime:".concat(e,",duration:").concat(t.duration)),this.rootPlayer.emit(s.p.PLAYER_BEFORE_SEEKING,t.currentTime,e),this.kernelStore.baseAgent?this.kernelStore.baseAgent.seek(e):t.currentTime=e},t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this),this.addEvents(),this.addMediaEvents()},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.stuckAtom.addEvents(),this.dc.playingAndWaiting=(0,o.U5)((function(){return{paused:t.state.paused,waiting:t.state.buffering}}),(function(e){queueMicrotask((function(){e.paused||(e.waiting?t.rootPlayer.emit(s.p.MEDIA_WAITING):t.rootPlayer.emit(s.p.MEDIA_PLAYING))}))}),{fireImmediately:!0}),this.dc.buffering=(0,o.U5)((function(){return t.state.buffering}),(function(e){t.checkBufferLength("Buffering",e),t.bufferAtom.hackLongStuck(e)})),this.dc.retrySource=(0,o.U5)((function(){return t.kernelStore.retrySource}),(function(e){return t.bufferAtom.checkLaggingStatus(!e)})),this.dc.pageFirstVisible=(0,o.gx)((function(){return!t.rootStore.pageHidden}),(function(){t.bufferAtom.pageFirstVisible=!0,t.bufferAtom.checkLaggingStatus(!0)}))},t.prototype.replaceElement=function(e){this.element.parentElement?(this.rootPlayer.emit(s.p.PLAYER_BEFORE_MEDIA_REPLACE,e),this.removeMediaEvents(),this.mediaAtom.copyElementProps(this.element,e),e.classList.remove(y.cx),e.defaultPlaybackRate=this.element.defaultPlaybackRate,e.playbackRate=this.element.playbackRate,e.volume=this.element.volume,e.muted=this.element.muted,this.element.muted=!0,this.element.parentElement.removeChild(this.element),this.wmpStore.destroyWasmPlayer(this.element),this.element=e,this.addMediaEvents(),this.log.i("[replaceElement]","HTMLMediaElement has been changed")):this.log.e("[replaceElement]","parentElement is null")},t.prototype.startFirstPlay=function(e,t){return this.mediaAtom.startFirstPlay(e,t)},t.prototype.startIdleFrame=function(){var e=this;if(!this.ifTimer&&!this.state.firstIdleFrame){var t=this.episodeStore.isFirst?500:50,r=Date.now(),n=window.requestIdleCallback,i=function(){var t=Date.now(),n=t-r;e.clearIdleFrame(),e.log.i("[IdleFrame]","delay:".concat(n,"ms")),e.state.firstIdleFrame||e.setState({firstIdleFrame:t}),e.rootPlayer.emit(a.t.Player_Idle_Frame,new CustomEvent(a.t.Player_Idle_Frame))};this.ifTimer="function"==typeof n?window.setTimeout((function(){e.ifReqId=n(i,{timeout:t})}),1):window.setTimeout((function(){return i()}),t)}},t.prototype.clearIdleFrame=function(){var e=window.cancelIdleCallback;this.ifReqId&&"function"==typeof e&&(e(this.ifReqId),this.ifReqId=null),this.ifTimer&&(clearTimeout(this.ifTimer),this.ifTimer=null)},t.prototype.isSameProgressTime=function(){return!this.patchAdvStore.hasValidAdv&&this.video.currentTime===this.state.progressTime},t.prototype.checkBufferLength=function(e,t){var r=this.state.aBufferLength,n=this.state.vBufferLength;if(null!=r&&null!=n){var i=this.video.currentTime;(t||(!r||!n))&&this.log.i("[CBL:".concat(e,"]"),"".concat(i,";").concat(r,",").concat(n))}},t.prototype.addMediaEvents=function(){this.video&&(this.video.addEventListener("loadstart",this.onLoadStart),this.video.addEventListener("loadedmetadata",this.onLoadedmetadata),this.video.addEventListener("loadeddata",this.onLoadedData),this.video.addEventListener("canplay",this.onCanplay),this.video.addEventListener("error",this.onError),this.video.addEventListener("abort",this.onAbort),this.video.addEventListener("emptied",this.onEmptied),this.video.addEventListener("seeking",this.onSeeking),this.video.addEventListener("seeked",this.onSeeked),this.video.addEventListener("ended",this.onEnded),this.video.addEventListener("play",this.onPlay),this.video.addEventListener("pause",this.onPause),this.video.addEventListener("stalled",this.onStalled),this.video.addEventListener("progress",this.onProgress),this.video.addEventListener("suspend",this.onSuspend),this.video.addEventListener("timeupdate",this.onTimeUpdate),this.video.addEventListener("ratechange",this.onRateChange),this.video.addEventListener("volumechange",this.onVolumeChange),this.video.addEventListener("durationchange",this.onDurationChange),this.video.addEventListener("performance",this.onWasmPlayerFallback),this.video.addEventListener("resize",this.onResize),this.video.addEventListener("playing",this.onPlaceholder),this.video.addEventListener("waiting",this.onPlaceholder))},t.prototype.removeMediaEvents=function(){this.video&&(this.video.removeEventListener("loadstart",this.onLoadStart),this.video.removeEventListener("loadedmetadata",this.onLoadedmetadata),this.video.removeEventListener("loadeddata",this.onLoadedData),this.video.removeEventListener("canplay",this.onCanplay),this.video.removeEventListener("error",this.onError),this.video.removeEventListener("abort",this.onAbort),this.video.removeEventListener("emptied",this.onEmptied),this.video.removeEventListener("seeking",this.onSeeking),this.video.removeEventListener("seeked",this.onSeeked),this.video.removeEventListener("ended",this.onEnded),this.video.removeEventListener("play",this.onPlay),this.video.removeEventListener("pause",this.onPause),this.video.removeEventListener("stalled",this.onStalled),this.video.removeEventListener("progress",this.onProgress),this.video.removeEventListener("suspend",this.onSuspend),this.video.removeEventListener("timeupdate",this.onTimeUpdate),this.video.removeEventListener("ratechange",this.onRateChange),this.video.removeEventListener("volumechange",this.onVolumeChange),this.video.removeEventListener("durationchange",this.onDurationChange),this.video.removeEventListener("performance",this.onWasmPlayerFallback),this.video.removeEventListener("resize",this.onResize),this.video.removeEventListener("playing",this.onPlaceholder),this.video.removeEventListener("waiting",this.onPlaceholder))},t.prototype.onLoadStart=function(){this.rootStore.stageAtom.set(6),this.log.i("LoadStart"),this.setState({isLoadStart:!0}),this.bufferAtom.checkBufferStatus(!1),this.bufferAtom.checkLaggingStatus(!1),this.rootPlayer.emit(s.p.MEDIA_LOADSTART)},t.prototype.onLoadedmetadata=function(){this.rootStore.stageAtom.set(7),this.log.i("Loadedmetadata"),this.setState({isMetadataLoaded:!0}),this.mediaAtom.gotoFirstTime(),this.rootPlayer.emit(s.p.MEDIA_LOADEDMETADATA)},t.prototype.onLoadedData=function(){this.rootStore.stageAtom.set(8),this.log.i("LoadedData",this.configStore.session),this.setState({isFirstFrame:!0}),this.rootPlayer.emit(s.p.MEDIA_LOADEDDATA)},t.prototype.onCanplay=function(){if(this.state.isLoadStart||this.state.isMetadataLoaded){if(this.rootStore.stageAtom.set(9),this.setState({isFirstCanplay:!0}),this.uiStore.complete(),this.mediaAtom.startFirstPlay(),this.bufferAtom.checkLaggingStatus(!0),!(this.modernResize||this.state.videoWidth&&this.state.videoHeight)){var e=this.element.videoWidth,t=this.element.videoHeight;e&&t&&this.setState({videoWidth:e,videoHeight:t})}this.rootPlayer.emit(s.p.MEDIA_CANPLAY),this.startIdleFrame()}},t.prototype.onError=function(e){this.bufferAtom.checkLaggingStatus(!1),this.rootPlayer.emit(s.p.MEDIA_ERROR)},t.prototype.onAbort=function(){this.bufferAtom.checkLaggingStatus(!1),this.rootPlayer.emit(s.p.MEDIA_ABORT)}, t.prototype.onEmptied=function(){this.bufferAtom.checkLaggingStatus(!1),this.rootPlayer.emit(s.p.MEDIA_EMPTIED)},t.prototype.onSeeking=function(){this.setState({seeking:!0}),this.bufferAtom.checkLaggingStatus(!1,{fromSeeking:!0}),this.rootPlayer.emit(s.p.MEDIA_SEEKING),!this.isSameProgressTime()&&this.video.currentTime>.1&&this.rootPlayer.emit(a.t.Player_ProgressBar_Change,new CustomEvent(a.t.Player_ProgressBar_Change,{detail:{progressTime:this.patchAdvStore.hasValidAdv?this.portStore.getCurrentTime():this.video.currentTime,initiator:l.hH.SeekingEvent}}))},t.prototype.onSeeked=function(){this.setState({seeking:!1}),this.bufferAtom.checkLaggingStatus(!0),this.rootPlayer.emit(s.p.MEDIA_SEEKED)},t.prototype.onStalled=function(){this.rootPlayer.emit(s.p.MEDIA_STALLED)},t.prototype.onProgress=function(){this.rootPlayer.emit(s.p.MEDIA_PROGRESS)},t.prototype.onSuspend=function(){this.rootPlayer.emit(s.p.MEDIA_SUSPEND)},t.prototype.onTimeUpdate=function(){this.checkBufferLength("Timeupdate"),this.rootPlayer.emit(s.p.MEDIA_TIMEUPDATE),!this.isSameProgressTime()&&this.video.currentTime>.1&&this.rootPlayer.emit(a.t.Player_ProgressBar_Change,new CustomEvent(a.t.Player_ProgressBar_Change,{detail:{progressTime:this.patchAdvStore.hasValidAdv?this.portStore.getCurrentTime():this.video.currentTime,initiator:l.hH.TimeupdateEvent}}))},t.prototype.onRateChange=function(){this.settingStore.setState({playbackRate:this.video.playbackRate}),this.rootPlayer.emit(s.p.MEDIA_RATECHANGE)},t.prototype.onVolumeChange=function(){this.settingStore.setState({muted:this.video.muted,volume:m(this.video.volume)}),this.rootPlayer.emit(s.p.MEDIA_VOLUMECHANGE)},t.prototype.onDurationChange=function(){this.rootPlayer.emit(s.p.MEDIA_DURATIONCHANGE)},t.prototype.onWasmPlayerFallback=function(){this.rootPlayer.emit(s.p.WASM_PLAYER_FALLBACK)},t.prototype.onEnded=function(){this.bufferAtom.checkBufferStatus(!1),this.bufferAtom.checkLaggingStatus(!1),this.patchAdvStore.hasLeftVideoToPlay()?this.rootPlayer.emit(s.p.PATCH_ADV_PLAY_ENDED):this.rootPlayer.emit(s.p.MEDIA_ENDED)},t.prototype.onPlay=function(){this.state.firstPlay||this.setState({firstPlay:Date.now()}),this.bufferAtom.checkBufferStatus(!0),this.bufferAtom.checkLaggingStatus(!0),this.rootPlayer.emit(s.p.MEDIA_PLAY)},t.prototype.onPause=function(){this.bufferAtom.checkBufferStatus(!1),this.bufferAtom.checkLaggingStatus(!1),this.kernelStore.state.srcSwitching||this.patchAdvStore.hasLeftVideoToPlay()&&this.portStore.isEnded(!0)||this.rootPlayer.emit(s.p.MEDIA_PAUSE)},t.prototype.onResize=function(){if(this.modernResize||(this.modernResize=!0),this.element){var e=this.element.videoWidth,t=this.element.videoHeight;e&&t&&this.setState({videoWidth:e,videoHeight:t})}},t.prototype.onPlaceholder=function(){},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.clearIdleFrame()},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.removeMediaEvents(),this.element&&this.element.parentElement&&this.element.parentElement.removeChild(this.element)},(0,n.gn)([o.Fl],t.prototype,"aspectRatio",null),(0,n.gn)([i.ZP],t.prototype,"leavePlayerEndedHandler",null),(0,n.gn)([i.ZP],t.prototype,"onLoadStart",null),(0,n.gn)([i.ZP],t.prototype,"onLoadedmetadata",null),(0,n.gn)([i.ZP],t.prototype,"onLoadedData",null),(0,n.gn)([i.ZP],t.prototype,"onCanplay",null),(0,n.gn)([i.ZP],t.prototype,"onError",null),(0,n.gn)([i.ZP],t.prototype,"onAbort",null),(0,n.gn)([i.ZP],t.prototype,"onEmptied",null),(0,n.gn)([i.ZP],t.prototype,"onSeeking",null),(0,n.gn)([i.ZP],t.prototype,"onSeeked",null),(0,n.gn)([i.ZP],t.prototype,"onStalled",null),(0,n.gn)([i.ZP],t.prototype,"onProgress",null),(0,n.gn)([i.ZP],t.prototype,"onSuspend",null),(0,n.gn)([i.ZP],t.prototype,"onTimeUpdate",null),(0,n.gn)([i.ZP],t.prototype,"onRateChange",null),(0,n.gn)([i.ZP],t.prototype,"onVolumeChange",null),(0,n.gn)([i.ZP],t.prototype,"onDurationChange",null),(0,n.gn)([i.ZP],t.prototype,"onWasmPlayerFallback",null),(0,n.gn)([i.ZP],t.prototype,"onEnded",null),(0,n.gn)([i.ZP],t.prototype,"onPlay",null),(0,n.gn)([i.ZP],t.prototype,"onPause",null),(0,n.gn)([i.ZP],t.prototype,"onResize",null),(0,n.gn)([i.ZP],t.prototype,"onPlaceholder",null),t}(u.u),w=r(59580),T=r(55929),R=r(47850),C=r(73281),P=r(33176),I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{muted:!1,mirror:!1,lightOff:!1,autoplay:w.QP,hideBlackGap:!w.xw,volume:w.D2,playbackRate:1,aspectRatio:"0:0",codecType:0,handoff:l.ty.Auto,showSeek:!1,opEd:w.nG,loudness:0,listLoop:!1,loop:!1}},enumerable:!1,configurable:!0}),t.prototype.getRealVolume=function(){return this.state.muted?0:this.state.volume},t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this),this.rootPlayer.hasFeature("blackGap")?this.setState({hideBlackGap:this.localStore.get().media.hideBlackGap}):this.setState({hideBlackGap:!0}),this.setState({codecType:this.getLocalCodecType()})},t.prototype.onMount=function(){e.prototype.onMount.call(this),this.addReactions()},t.prototype.onMounted=function(){e.prototype.onMounted.call(this);var t=this.localStore.get().media;this.setVolume(t.volume),this.setAutoplay(t.autoplay),this.setHandoff(t.handoff),this.setOpEd(t.opEd),this.setListLoop(t.listLoop),this.setLoop(t.loop);var r=this.rootStore.freeStore.audioAtom.defaultLoudnessOption(),n="number"==typeof t.loudnessSwitch?t.loudnessSwitch:r;this.setLoudness(n)},t.prototype.setBlackGapCookie=function(e){var t=String(+!this.state.hideBlackGap);(e||R.get(T.or)!==t)&&R.set(T.or,t)},t.prototype.addReactions=function(){var e=this;this.dc.loopAndEnded=(0,o.U5)((function(){return e.state.loop}),(function(t){t?(e.mediaStore.setState({ended:!1}),e.state.listLoop&&e.setListLoop(!1)):e.mediaStore.setState({ended:e.portStore.isEnded(!0)}),e.localStore.set({media:{loop:t}}),e.rootPlayer.emit(a.t.Player_LoopChange,new CustomEvent(a.t.Player_LoopChange))})),this.dc.mirror=(0,o.U5)((function(){return e.state.mirror}),(function(t){e.rootPlayer.emit(a.t.Player_MirrorChange,new CustomEvent(a.t.Player_MirrorChange))})),this.dc.aspectRatio=(0,o.U5)((function(){return e.state.aspectRatio}),(function(t){e.uiStore.resize(!1,!1),e.rootPlayer.emit(a.t.Player_AspectRatioChange,new CustomEvent(a.t.Player_AspectRatioChange))})),this.dc.lightOff=(0,o.U5)((function(){return e.state.lightOff}),(function(t){e.rootPlayer.emit(a.t.Player_LightOffChange,new CustomEvent(a.t.Player_LightOffChange))})),this.dc.hideBlackGap=(0,o.U5)((function(){return e.state.hideBlackGap}),(function(t){e.uiStore.resize(!1,!1),e.localStore.set({media:{hideBlackGap:t}}),e.setBlackGapCookie(!0),e.rootPlayer.emit(a.t.Player_BlackGapChange,new CustomEvent(a.t.Player_BlackGapChange,{detail:{blackGap:!t,mainScreen:e.uiStore.state.mainScreen,sideScreen:e.uiStore.state.sideScreen,screenKind:e.portStore.getScreenKind()}}))})),this.dc.autoplay=(0,o.U5)((function(){return e.state.autoplay}),(function(t){e.localStore.set({media:{autoplay:t}}),e.rootPlayer.emit(a.t.Player_AutoplayChange,new CustomEvent(a.t.Player_AutoplayChange))})),this.dc.handoff=(0,o.U5)((function(){return e.state.handoff}),(function(t){e.localStore.set({media:{handoff:t}}),e.rootPlayer.emit(a.t.Player_HandoffChange,new CustomEvent(a.t.Player_HandoffChange))})),this.dc.codecType=(0,o.U5)((function(){return e.state.codecType}),(function(t){e.setLocalCodecType(t),e.rootPlayer.emit(a.t.Player_PreferCodecChange,new CustomEvent(a.t.Player_PreferCodecChange))})),this.dc.opEd=(0,o.U5)((function(){return e.state.opEd}),(function(t){e.localStore.set({media:{opEd:t}}),e.rootPlayer.emit(a.t.Player_OpEdChange,new CustomEvent(a.t.Player_OpEdChange))})),this.dc.loudness=(0,o.U5)((function(){return e.state.loudness}),(function(t){e.localStore.set({media:{loudnessSwitch:+t}}),e.rootPlayer.emit(a.t.Player_LoudnessChange,new CustomEvent(a.t.Player_LoudnessChange))})),this.dc.volume=(0,o.U5)((function(){return e.state.volume}),(function(t){t?e.localStore.set({media:{volume:t,nonzeroVol:t}}):e.localStore.set({media:{volume:t}})})),this.dc.listLoop=(0,o.U5)((function(){return e.state.listLoop}),(function(t){t&&e.state.loop&&e.setState({ loop:!1}),e.localStore.set({media:{listLoop:t}})}))},t.prototype.getLocalCodecType=function(){var e=+(0,C.tv)(T.uU);switch(e){case 0:case 1:case 2:case 3:return e;default:return 0}},t.prototype.setLocalCodecType=function(e){(0,C.co)(T.uU,String(e))},t.prototype.setLoop=function(e,t){this.setState({loop:!!e})},t.prototype.getLoop=function(){return this.state.loop},t.prototype.setMuted=function(e,t,r){if(this.mediaStore.video.muted=!!e,t){var n=this.mediaStore.video;n.volume=e?0:this.localStore.get().media.nonzeroVol}},t.prototype.getMuted=function(){return this.mediaStore.video.muted},t.prototype.setVolume=function(e,t,r){var n=this.mediaStore.video;t&&n.muted&&this.setMuted(!1,!1,r),n.volume=(0,P.Z)(e,0,1),this.setState({muted:n.muted,volume:m(n.volume)})},t.prototype.getVolume=function(){return this.mediaStore.video.volume},t.prototype.setPlaybackRate=function(e,t){var r=(0,P.Z)(e,.25,4);this.mediaStore.video.playbackRate=r,this.mediaStore.video.defaultPlaybackRate=r},t.prototype.getPlaybackRate=function(){return this.mediaStore.video.playbackRate},t.prototype.setMirror=function(e,t){this.setState({mirror:!!e})},t.prototype.getMirror=function(){return this.state.mirror},t.prototype.setAspectRatio=function(e,t){"string"==typeof e&&/^\d+(\.\d+)?:\d+(\.\d+)?$/.test(e)?this.setState({aspectRatio:e}):console.error("Illegal argument")},t.prototype.getAspectRatio=function(){return this.state.aspectRatio},t.prototype.setLightOff=function(e,t){this.rootPlayer.isEmbed||this.setState({lightOff:!!e})},t.prototype.getLightOff=function(){return this.state.lightOff},t.prototype.setBlackGap=function(e,t){this.rootPlayer.hasFeature("blackGap")&&this.setState({hideBlackGap:!e})},t.prototype.getBlackGap=function(){return!this.state.hideBlackGap},t.prototype.setAutoplay=function(e,t){this.setState({autoplay:!!e})},t.prototype.getAutoplay=function(){return this.state.autoplay},t.prototype.setOpEd=function(e,t){this.setState({opEd:!!e})},t.prototype.getOpEd=function(){return this.state.opEd},t.prototype.setLoudness=function(e,t){this.setState({loudness:e})},t.prototype.getLoudness=function(){return this.state.loudness},t.prototype.setListLoop=function(e){this.setState({listLoop:e})},t.prototype.setHandoff=function(e,t){switch(e){case l.ty.Auto:case l.ty.Delay:case l.ty.Abort:this.setState({handoff:e});break;default:console.error("Illegal argument")}},t.prototype.getHandoff=function(){return this.state.handoff},t.prototype.setPreferCodec=function(e){switch(e){case 0:case 1:case 2:case 3:this.setState({codecType:e});break;default:console.error("Illegal argument")}},t.prototype.getPreferCodec=function(){return this.state.codecType},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{muted:1,lightOff:1,autoplay:1,hideBlackGap:1,volume:1,playbackRate:1,codecType:1,handoff:1,opEd:1,loudness:1,listLoop:1,loop:1})},t}(u.u),D=r(8345),O=r(77881),x=r(71388),k=r(72926),N=r(48735),L=r(22488);var M=function e(t,r,n,i,o,a){return(0,L.Z)(t)&&(0,L.Z)(r)&&(a.set(r,t),(0,N.Z)(t,r,void 0,e,a),a.delete(r)),t},F=(0,r(13718).Z)((function(e,t,r,n){(0,N.Z)(e,t,r,n)})),U=(0,k.Z)((function(e){return e.push(void 0,M),(0,x.Z)(F,void 0,e)})),B=r(51953),G=function(){function e(e){var t=this;this.rootStore=e,this.isLoaded=!1,this.hasPendingSet=!1,this.rootPlayer=e.rootPlayer,this.rootPlayer.once(s.p.PLAYER_STORAGE_BUILD,(function(){return t.onStorageBuild()})).once(s.p.PLAYER_LOADED,(function(){return t.onLoaded()}))}return Object.defineProperty(e.prototype,"localData",{get:function(){if(null==this.cachedLocalData){var e=(0,B.m)(this.storage,this.storageKey);this.cachedLocalData=U(e,this.defProfile)}return this.cachedLocalData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"log",{get:function(){if(!this._cachedLog){var e=this.rootPlayer.log;this._cachedLog=this.tag?e.getLogger(this.tag):e}return this._cachedLog},enumerable:!1,configurable:!0}),e.prototype.onStorageBuild=function(){try{this.setStorageArea(),this.storageKey=this.rootStore.configStore.storageKey,this.available=this.checkAvailability()}catch(e){this.log.e(e&&e.message)}},e.prototype.onLoaded=function(){this.isLoaded=!0,this.hasPendingSet&&(this.hasPendingSet=!1,this.setStorageItem())},e.prototype.getSerializedLocalData=function(){return this.localData?JSON.stringify(this.localData):null},e.prototype.setStorageItem=function(){if(!this.isLoaded)return this.hasPendingSet=!0,null;try{return this.storage.setItem(this.storageKey,this.getSerializedLocalData()),!0}catch(e){return this.log.w(e&&e.message,e&&e.stack),!1}},e.prototype.checkAvailability=function(){try{var e="__storage_test__";this.storage.setItem(e,e);var t=this.storage.getItem(e)===e;return this.storage.removeItem(e),!t&&this.log.i("Storage is disabled"),t}catch(e){var r="An error occurred while detecting Storage",n=this.storage&&0!==this.storage.length;return e?this.log.w(r,e.code,e.name,e.message):this.log.w(r),e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&n}},e.prototype.get=function(e){var t={},r=this.localData;if(null==e)Object.assign(t,r);else if("string"==typeof e||Array.isArray(e)){(Array.isArray(e)?e:[e]).forEach((function(e){t[e]=r[e]}))}else Object.keys(e).forEach((function(n){var i=r[n];null!=i?t[n]=i:e.hasOwnProperty(n)&&(t[n]=e[n])}));return t},e.prototype.set=function(e,t){var r=this;return Object.keys(e).forEach((function(n){t?r.localData[n]=e[n]:r.localData[n]&&"object"==typeof r.localData[n]&&e[n]&&"object"==typeof e[n]?r.localData[n]=Object.assign(r.localData[n],e[n]):r.localData[n]=e[n]})),this.setStorageItem()},e.prototype.remove=function(e){var t=this;return(Array.isArray(e)?e:[e]).forEach((function(e){t.localData.hasOwnProperty(e)&&delete t.localData[e]})),this.setStorageItem()},e}(),V=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="LocalStore",t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defProfile",{get:function(){return(0,O.o)()},enumerable:!1,configurable:!0}),t.prototype.setStorageArea=function(){this.storage=window.localStorage},t.prototype.set=function(t,r){var n=e.prototype.set.call(this,t,r),i=t.media,o={setting_config:{},video_status:{}};if(n&&i&&"object"==typeof i&&Object.keys(i).forEach((function(e){var t=i[e];switch(e){case"quality":o.setting_config.defquality=t;break;case"volume":o.video_status.volume=t;break;case"nonzeroVol":o.video_status.lastVol=t;break;case"autoplay":o.video_status.autoplay=t;break;case"handoff":o.video_status.playtype=2===t?2:1;break;case"hideBlackGap":o.video_status.blackside_state=!t,R.set("blackside_state",String(+!t))}})),Object.keys(o.setting_config).length+Object.keys(o.video_status).length){var a="bilibili_player_settings";try{var s=JSON.parse(localStorage.getItem(a));if(!s)return;s.setting_config&&Object.assign(s.setting_config,o.setting_config),s.video_status&&Object.assign(s.video_status,o.video_status),localStorage.setItem(a,JSON.stringify(s))}catch(e){}}return n},t}(G);var W=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="SessionStore",t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defProfile",{get:function(){return{interaction:{}}},enumerable:!1,configurable:!0}),t.prototype.setStorageArea=function(){this.storage=window.sessionStorage},t}(G);var j=r(27032),H=r(50659),Z=r(86044),Y=r(50878),K=r(58466),q=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="UserStore",r.defLoginLevel=3,r.info=null,(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{isUserPrepared:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInteraction",{get:function(){return this.info?!!this.info.interaction:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSuperUser",{get:function(){return!(!this.info||this.info.err)&&!(0===this.info.vipType||1!==this.info.vipStatus)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLogin",{get:function(){return this.info&&!this.info.err?!!this.info.mid:(0,K.s)()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCharingTrialWatch",{ get:function(){var e,t;return(null===(e=this.info)||void 0===e?void 0:e.is_upower_exclusive)&&!(null===(t=this.info)||void 0===t?void 0:t.is_upower_play)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChargingQATrialWatch",{get:function(){var e,t;return(null===(e=this.info)||void 0===e?void 0:e.is_upower_exclusive_with_qa)&&!(null===(t=this.info)||void 0===t?void 0:t.is_upower_play)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChargedWatch",{get:function(){var e,t;return(null===(e=this.info)||void 0===e?void 0:e.is_upower_exclusive)&&(null===(t=this.info)||void 0===t?void 0:t.is_upower_play)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCommonWatch",{get:function(){var e;return!(null===(e=this.info)||void 0===e?void 0:e.is_upower_exclusive)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disableShowUpInfo",{get:function(){var e;return!!(null===(e=this.info)||void 0===e?void 0:e.disableShowUpInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needLoginSubtitle",{get:function(){var e;return!!(null===(e=this.info)||void 0===e?void 0:e.needLoginSubtitle)},enumerable:!1,configurable:!0}),t.prototype.setUserInfo=function(e){e&&(this.setLevel(e),this.setVIPInfo(e),this.setMemberRole(e),this.setDMPermission(e),this.setViewPoints(e)),this.info=e},t.prototype.onPrepared=function(){e.prototype.onPrepared.call(this),this.fetchUserDetails().catch(Y.Z)},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.infoChanged=(0,o.U5)((function(){return t.info}),(function(e){e&&(t.dp.isLoadEnded&&t.dp.isLoadEnded(),t.dp.isLoadEnded=(0,o.gx)((function(){return t.rootStore.isLoadEnded}),(function(){return t.rootPlayer.emit(s.p.PLAYER_LOADED,e)})))}))},t.prototype.reloadAccess=function(){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){switch(e.label){case 0:return this.log.i("[reloadAccess]"),[4,this.fetchUserDetails()];case 1:return e.sent(),[2]}}))}))},t.prototype.tryDelayUserResolved=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t,r=this;return(0,n.Jh)(this,(function(n){return this.configStore.isChannel(l.u5.Homepage)||this.configStore.isChannel(l.u5.Homepage_Topic)?(e=(0,o.gx)((function(){return r.rootStore.isLoadEnded})),this.dp.delayUserResolved&&this.dp.delayUserResolved(),this.dp.delayUserResolved=function(){return e.cancel()},[2,e]):(t=(0,o.gx)((function(){return!!r.mediaStore.state.firstIdleFrame||r.rootStore.isLoadEnded})),this.dp.delayUserResolved2&&this.dp.delayUserResolved2(),this.dp.delayUserResolved2=function(){return t.cancel()},[2,t])}))}))},t.prototype.fetchUserDetails=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t,r=this;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return this.configStore.preliminaryReview?[2,Promise.reject()]:(e=(0,o.gx)((function(){return r.rootStore.isPrepared})),this.dp.isPrepared&&this.dp.isPrepared(),this.dp.isPrepared=function(){return e.cancel()},[4,e]);case 1:return n.sent(),t=this.httpStore.fetchUserInfo(!1),[4,this.tryDelayUserResolved()];case 2:return n.sent(),[2,new Promise((function(e,n){t.then((function(t){var n=t.body,i=t.response;if(0===i.data.code)return r.setUserInfo(n),r.setState({isUserPrepared:!0}),void e(n);r.setUserInfo({err:new Error("Unknown error")}),r.setState({isUserPrepared:!0}),r.errorStore.err(1,1103,"form error,url:".concat(i.config.url))})).catch((function(e){if(!Z.Z.isCancel(e)){var t=e&&e.response&&e.response.status,i=e&&e.config&&e.config.url;r.setUserInfo({err:e||new Error("Unknown error")}),r.setState({isUserPrepared:!0}),r.errorStore.err(1,1101,"status:".concat(t,",url:").concat(i)),n(e)}}))}))]}}))}))},t.prototype.requestQuickLogin=function(e){if(this.configStore.isChannel(l.u5.PC_APP)&&window.appRequestLogin&&"function"==typeof window.appRequestLogin)return window.appRequestLogin();this.requestQuickLoginPromise(e).catch(Y.Z)},t.prototype.requestQuickLoginPromise=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){if(_.X.mobile.alike&&!_.X.iPad.alike)throw this.rootStore.parent.location.href=H.tn,new Error("Redirect to login page");return this.uiStore.isFullView&&this.portStore.reqStatue(null),[2,this.getQuickLoginScript("MiniLogin",H.x).then((function(){return new Promise((function(r,n){var i=new t.rootStore.parent.MiniLogin(e?{customTitle:e}:{}),o=function(){i&&(i.removeEventListener("success",a),i.removeEventListener("cancel",s))},a=function(){o(),queueMicrotask((function(){t.fetchUserDetails().then(r).catch(n)}))},s=function(){o(),n(new Error("User cancelled"))};i.showComponent(),i.addEventListener("success",a),i.addEventListener("cancel",s)}))})).then((function(){t.rootPlayer.emit(a.t.Player_Access_Changed,new CustomEvent(a.t.Player_Access_Changed))})).catch((function(e){return t.log.w(e&&e.message),Promise.reject(e)}))]}))}))},t.prototype.getQuickLoginScript=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(r){return this.rootStore.parent[e]?[2]:[2,(n=t,i=this.rootStore.parent,void 0===i&&(i=window),new Promise((function(e,t){var r=i.document.createElement("script");r.onload=e,r.onerror=t,r.type="text/javascript",r.async=!0,r.crossOrigin="anonymous",r.src=n,i.document.head.appendChild(r)})))];var n,i}))}))},t.prototype.setLevel=function(e){var t;if(e.err)e.level=this.defLoginLevel;else{var r=null===(t=e.levelInfo)||void 0===t?void 0:t.current_level;null==r?e.mid?e.level=this.defLoginLevel:e.level=null:e.level=+r}},t.prototype.setVIPInfo=function(e){this.configStore.isChannel(l.u5.Manager)&&(e.vipType=2,e.vipStatus=1)},t.prototype.setMemberRole=function(e){if(e.err)(0,K.s)()?e.memberRole=j.Rs.USER_NORMAL:e.memberRole=j.Rs.USER_LOGOUT;else if(e.mid)if("string"==typeof e.permission){var t=e.permission.split(",");0===t.length||-1!==t.indexOf("9999")?e.memberRole=j.Rs.USER_LIMITED:-1!==t.indexOf("5000")?e.memberRole=j.Rs.USER_REGISTERED:-1!==t.indexOf("20000")?e.memberRole=j.Rs.USER_ADVANCED:-1!==t.indexOf("32000")||-1!==t.indexOf("31300")?(e.memberRole=j.Rs.USER_ADVANCED,e.isSystemAdmin=!0):-1!==t.indexOf("30000")||-1!==t.indexOf("25000")?e.memberRole=j.Rs.USER_VIP:e.memberRole=j.Rs.USER_NORMAL}else e.memberRole=j.Rs.USER_NORMAL;else e.memberRole=j.Rs.USER_LOGOUT},t.prototype.setDMPermission=function(e){var t,r,n=e.level,i={pool:j.Rs.SEND_POOL_NORMAL,mode:j.Rs.SEND_MODE_LOGOUT,color:j.Rs.SEND_COLOR_LOGOUT,input:j.Rs.SEND_INPUT_LOGOUT,fontsize:j.Rs.SEND_FONT_SIZE_LOGOUT,initStatus:j.Rs.SEND_STATUS_NORMAL};switch((e.isOwner||e.isSystemAdmin)&&(i.pool=j.Rs.SEND_POOL_ADMIN,r=j.Rs.SEND_FONT_SIZE_ADMIN),e.memberRole){case j.Rs.USER_LIMITED:i.fontsize=j.Rs.SEND_FONT_SIZE_LIMITED,i.mode=j.Rs.SEND_MODE_LIMITED,i.initStatus=j.Rs.SEND_STATUS_LIMITED,i.input=j.Rs.SEND_INPUT_LIMITED;break;case j.Rs.USER_REGISTERED:i.fontsize=j.Rs.SEND_FONT_SIZE_REGISTERED,i.mode=j.Rs.SEND_MODE_REGISTERED,i.input=j.Rs.SEND_INPUT_REGISTERED;break;case j.Rs.USER_NORMAL:i.fontsize=j.Rs.SEND_FONT_SIZE_NORMAL,i.mode=j.Rs.SEND_MODE_NORMAL,i.input=j.Rs.SEND_INPUT_NORMAL;break;case j.Rs.USER_VIP:i.pool=j.Rs.SEND_POOL_ADMIN,i.fontsize=j.Rs.SEND_FONT_SIZE_VIP,i.mode=j.Rs.SEND_MODE_VIP,i.input=j.Rs.SEND_INPUT_VIP;break;case j.Rs.USER_ADVANCED:i.pool=j.Rs.SEND_POOL_ADMIN,i.fontsize=j.Rs.SEND_FONT_SIZE_ADVANCED,i.mode=j.Rs.SEND_MODE_ADVANCED,i.input=j.Rs.SEND_INPUT_ADVANCED;case j.Rs.USER_LOGOUT:}switch(!0){case 0===n:t=j.Rs.SEND_MODE_LEVEL_LOW,i.color=j.Rs.SEND_COLOR_LEVEL_LOW,i.initStatus=j.Rs.SEND_STATUS_LEVEL_LOW;break;case 1===n:t=j.Rs.SEND_MODE_LEVEL_LOW,i.color=j.Rs.SEND_COLOR_LEVEL_LOW;break;case 2===n:t=j.Rs.SEND_MODE_LEVEL_TWO,i.color=j.Rs.SEND_COLOR_NORMAL;break;case n>=3:t=j.Rs.SEND_MODE_LEVEL_NORMAL,i.color=j.Rs.SEND_COLOR_NORMAL}e.blockTime>0&&(i.initStatus=j.Rs.SEND_STATUS_BLOCKING),e.blockTime<0&&(i.initStatus=j.Rs.SEND_STATUS_BLOCKED),2===e.pugvSeasonStatus&&1===e.pugvPayStatus&&(i.initStatus=j.Rs.SEND_STATUS_CANNOT_BUY),2!==e.answerStatus||n||(i.initStatus=j.Rs.SEND_ANSWER_STATUS_IN),e.err||e.mid||(i.color=j.Rs.SEND_COLOR_LOGOUT,i.initStatus=j.Rs.SEND_STATUS_LOGOUT),r&&i.fontsize.forEach((function(e,t,n){ n[t]=n[t]||r[t]})),t&&i.mode.forEach((function(e,r,n){n[r]=1===t[r]||1===n[r]?1:n[r]})),e.dmRights=i},t.prototype.setViewPoints=function(e){this.configStore.isCreator()&&(e.viewPoints=null)},t.prototype.requestSuperGuide=function(e){var t=this.configStore.isChannel(l.u5.Default)||this.configStore.isChannel(l.u5.Playlist);this.uiStore.kind===l.HR.Pgc&&t||(this.portStore.pause(),this.uiStore.isFullView&&this.portStore.reqStatue(null)),this.rootPlayer.emit(a.t.Player_Virtual_Action,new CustomEvent(a.t.Player_Virtual_Action,{detail:{data:e,kind:l.s.Super_Quality_Guide}}))},t.prototype.requestSuperColorGuide=function(e){var t=this.configStore.isChannel(l.u5.Default)||this.configStore.isChannel(l.u5.Playlist);this.uiStore.kind===l.HR.Pgc&&t||(this.portStore.pause(),this.uiStore.isFullView&&this.portStore.reqStatue(null)),this.rootPlayer.emit(a.t.Player_Virtual_Action,new CustomEvent(a.t.Player_Virtual_Action,{detail:{data:e,kind:l.s.Super_Quality_Guide}}))},t.prototype.requestSuperVipTrialQuality=function(e){var t=this.configStore.isChannel(l.u5.Default)||this.configStore.isChannel(l.u5.Playlist);this.uiStore.kind===l.HR.Pgc&&t||this.uiStore.isFullView&&this.portStore.reqStatue(null),this.rootPlayer.emit(a.t.Player_Virtual_Action,new CustomEvent(a.t.Player_Virtual_Action,{detail:{data:e,kind:l.s.Super_Quality_Guide}}))},(0,n.gn)([o.LO.shallow],t.prototype,"info",void 0),(0,n.gn)([o.aD],t.prototype,"setUserInfo",null),t}(u.u),z=r(12809),X=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpUpMid",t.url="//api.bilibili.com/x/web-interface/relation",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:e,withCredentials:!0}).then((function(e){var r;return{body:t.convertResult(null===(r=e.data)||void 0===r?void 0:r.data),response:e}}))]}))}))},t.prototype.convertResult=function(e){var t=(null==e?void 0:e.relation)||{};return{attribute:t.attribute,mid:t.mid,mtime:t.mtime,special:t.special,tag:t.tag}},t}(z.eV),Q=r(9883),J=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="UpStore",t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{mid:null,name:null,face:null,follow:!1,fans:null,staffs:null}},enumerable:!1,configurable:!0}),t.prototype.onPrepared=function(){e.prototype.onPrepared.call(this),this.configStore.embeddedEnv&&this.fetchUpInfo()},t.prototype.onMount=function(){e.prototype.onMount.call(this)},t.prototype.getRelation=function(e){return new X(this.rootPlayer).r({mid:e})},t.prototype.upFollow=function(e,t){return new Q.YR(this.rootPlayer).r({act:t?2:1,fid:e,re_src:245})},t.prototype.fetchUpInfo=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t=this;return(0,n.Jh)(this,(function(r){switch(r.label){case 0:return e=(0,o.gx)((function(){return t.rootStore.isPrepared})),this.dp.isPrepared&&this.dp.isPrepared(),this.dp.isPrepared=function(){return e.cancel()},[4,e];case 1:return r.sent(),[2,this.httpStore.fetchVideoDetail(!0).then((function(e){var r=e.body;t.setState((0,n.pi)({},r.up))})).catch((function(e){if(!Z.Z.isCancel(e))return Promise.reject(e)}))]}}))}))},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{name:1,mid:1,face:1,follow:1,fans:1})},t}(u.u);function $(){return window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function ee(e){for(var t=[],r=1;r=i.state.videoList.length-1?[2]:(c=u[s+1],d=(null==c?void 0:c.fragmentInfo)?c.fragmentInfo.cid:l,i.preloadDataMap.has(d)?[2]:[4,o.prefetchAVData(c)])):[2];case 1:return f=m.sent(),[4,null===(e=f.vbHttp)||void 0===e?void 0:e.promise];case 2:return p=m.sent(),[4,null===(t=f.abHttp)||void 0===t?void 0:t.promise];case 3:return h=m.sent(),y={type:"dash"},p&&(y=Object.assign({},y,{videoUrl:f.videoUrl,videoId:String(f.videoQn),video:p})),h&&(y=Object.assign({},y,{audioUrl:f.audioUrl,audioId:String(f.audioQn),audio:h})),y=Object.assign({},y,{videoCodecId:a.dashKernel.getCurrentCodecID("video")}),i.preloadDataMap.set(d,(0,n.pi)({},y)),[2]}}))}))},t.prototype.advPolarReport=function(){var e=0,t=[],r=this.rootStore,n=r.patchAdvStore,i=r.trackStore,o=r.configStore;r.mpdStore;n.hasValidAdv&&(e=n.getPreFilteredVideoList().length>0&&n.getPostFilteredVideoList().length>0?ye.both:n.getPreFilteredVideoList().length>0&&0===n.getPostFilteredVideoList().length?ye.onlyPre:ye.onlyPost,n.getPreFilteredVideoList().forEach((function(e,r){var n={fragment_avid:e.fragmentInfo.aid,fragment_order:r+1,fragment_position:1,fragment_length:Math.floor(e.timelength/1e3),fragment_source:e.fragmentInfo.fragment_type===oe.AD_FRAGMENT?ae.BUSINESS:ae.OGV};t.push(n)})),n.getPostFilteredVideoList().forEach((function(e,r){var n={fragment_avid:e.fragmentInfo.aid,fragment_order:r+1,fragment_position:3,fragment_length:Math.floor(e.timelength/1e3),fragment_source:e.fragmentInfo.fragment_type===oe.AD_FRAGMENT?ae.BUSINESS:ae.OGV};t.push(n)})),i.polarReport("fragment.0",ne.show,{fragment_type:e,fragment_detail:JSON.stringify(t),csource:o.csource,seasonid:o.seasonId,avid:o.aid}))},t.prototype.patchSwitch=function(e){var t=this,r=this.rootStore,n=r.patchAdvStore,i=r.kernelStore,o=r.configStore,s=r.rootPlayer,u=n.Episode,c={mediaDataSource:u.mediaDataSource,quality:0};n.canRecordBuffering=!1,n.reportActualPlay();var d=o.cid,f=n.getCids()[n.state.index],p=n.preloadDataMap.get(f);return p&&(p.videoid=p.videoId,p.audioid=p.audioId),n.switchPlayAt=0|e,s.emit(a.t.Player_PatchSwitch,new CustomEvent(a.t.Player_PatchSwitch,{detail:{stage:l._1.START}})),this.hasSwitched=!1,i.trySwitchSource(c,{initiator:0,enableTransition:!0,preloadAVData:p},{keepTransition:!0,playAt:n.switchPlayAt,autoPlay:!0}).then((function(){var e=u.fragmentInfo||n.mainInfo;o.startAdvPatchParser({ aid:e.aid,cid:e.cid,episodeId:n.mainInfo.episodeId,extraEPInfo:o.extraEPInfo,seasonId:o.seasonId,seasonType:o.seasonType}),t.rootPlayer.emit(a.t.Player_PatchSwitch,new CustomEvent(a.t.Player_PatchSwitch,{detail:{stage:l._1.COMPLETED,aid:e.aid,cid:e.cid,lastCid:d}}))})).catch((function(e){}))},t.prototype.emitBusinessReportData=function(e,t){var r,i,o,s=this.rootStore,u=s.patchAdvStore,l=s.configStore,c=s.mediaStore;if(this.hasAnyBusinessStock())try{var d=void 0,f=void 0,p=void 0,h=void 0,y=void 0,m=void 0;t&&(p=t.isEnded,h=t.duration,y=t.isLast,m=t.playAt);var g=u.state.videoList.find((function(e){var t;if((null===(t=null==e?void 0:e.fragmentInfo)||void 0===t?void 0:t.cid)===l.cid)return e})),v=this.getFirstAvailableOGVFragment(),b=this.hasValidPreBusinessStock();if(e===pe.show){if(g){if(f=g.fragmentInfo,(null==v?void 0:v.fragmentInfo.cid)===g.fragmentInfo.cid&&!b){var _=u.state.reportList.filter((function(e){var t,r;return"PRE"===(null===(t=null==e?void 0:e.fragmentInfo)||void 0===t?void 0:t.fragment_position)&&(null===(r=null==e?void 0:e.fragmentInfo)||void 0===r?void 0:r.fragment_type)===oe.AD_FRAGMENT}));_.length>0&&(f=_[0].fragmentInfo)}}else if(0===u.getPreFilteredVideoList().length){_=u.state.reportList.filter((function(e){var t,r;return"PRE"===(null===(t=null==e?void 0:e.fragmentInfo)||void 0===t?void 0:t.fragment_position)&&(null===(r=null==e?void 0:e.fragmentInfo)||void 0===r?void 0:r.fragment_type)===oe.AD_FRAGMENT}));var E=this.hasValidPreOGVStock();_.length>0&&!E&&(f=_[0].fragmentInfo)}if(y){var S=u.getPostFiltereBusinessVideoList();_=u.state.reportList.filter((function(e){return"POST"==(null==e?void 0:e.fragmentInfo.fragment_position)&&(null==e?void 0:e.fragmentInfo.fragment_type)===oe.AD_FRAGMENT}));if(!(_.length>0&&0===S.length))return;f=_[0].fragmentInfo}}else g&&g.fragmentInfo.ad_extra_data&&(f=g.fragmentInfo);if(f){if(!f.ad_extra_data)return;d=(0,n.pi)({av_id:(null==f?void 0:f.aid)||0,c_id:(null==f?void 0:f.cid)||0,duration:(null==g?void 0:g.timelength)||0,ep_avid:(null===(r=u.mainInfo)||void 0===r?void 0:r.aid)||l.aid,ep_cid:(null===(i=u.mainInfo)||void 0===i?void 0:i.cid)||l.cid,ep_id:(null===(o=u.mainInfo)||void 0===o?void 0:o.episodeId)||l.episodeId,season_id:l.seasonId,pos:"PRE"===f.fragment_position?"prefix":"surfix"},JSON.parse(f.ad_extra_data))}if(!d)return;var A={data:d,type:e};switch(e){case pe.show:break;case pe.video_play:if(0===this.getValidBusinessStock().length)return;p&&(A.percentage=100),m&&0===m?(A.percentage=0,A.progress=0):A.progress=1e3*c.video.currentTime;break;case pe.actual_play:A.duration=h}this.rootPlayer.emit(a.t.Player_Patch_Adv_Report,new CustomEvent(a.t.Player_Patch_Adv_Report,{detail:A}))}catch(e){console.error("business data parse error",e)}},Object.defineProperty(t.prototype,"configTimeIntervalList",{get:function(){var e=this.rootStore.patchAdvStore,t=0;return e.state.videoList.map((function(r){return{start:t,end:t+=r.timelength/1e3,aid:r.fragmentInfo?r.fragmentInfo.aid:e.mainInfo.aid,cid:r.fragmentInfo?r.fragmentInfo.cid:e.mainInfo.cid}}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"repeatparams",{get:function(){var e={fragment_info:this.rootStore.patchAdvStore.state.reportList.map((function(e){return e.fragmentInfo}))},t=JSON.parse(JSON.stringify(e));return t.fragment_info.forEach((function(e){null==e||delete e.ad_extra_data})),t},enumerable:!1,configurable:!0}),t.prototype.addEvents=function(){var e=this,t=this.rootStore,r=t.patchAdvStore,n=t.mediaStore;this.rootPlayer.on(s.p.MEDIA_PLAYING,(function(){r.timeStamp=performance.now()})),this.rootPlayer.on(s.p.PLAYER_STREAM_BUFFERING_COMPLETED,(function(){e.setPreLoadedDataMap()})),this.rootPlayer.on(s.p.MEDIA_CANPLAY,(function(){r.canRecordBuffering=!0,r.switchPlayAt=0,e.emitBusinessReportData(pe.show),n.video.currentTime<.5&&!e.hasSwitched&&(e.hasSwitched=!0,e.emitBusinessReportData(pe.video_play,{playAt:0}))})),this.rootPlayer.on(s.p.MEDIA_PAUSE,(function(){e.emitBusinessReportData(pe.actual_play,{duration:Math.floor(performance.now()-r.timeStamp)})})),this.dc.buffering=(0,o.U5)((function(){return n.state.buffering}),(function(e){if(r.canRecordBuffering){var t=n.video;t.readyState<2||!e||t.seeking||r.reportActualPlay()}}),{fireImmediately:!0}),this.rootPlayer.on(s.p.MEDIA_ENDED,(function(){e.emitBusinessReportData(pe.actual_play,{duration:Math.floor(performance.now()-r.timeStamp)}),e.emitBusinessReportData(pe.video_play,{isEnded:!0}),r.hasValidAdv&&0==r.getPostFilteredVideoList().length&&e.emitBusinessReportData(pe.show,{isLast:!0}),e.hasAnyBusinessStock()&&!r.hasValidAdv&&e.emitBusinessReportData(pe.show,{isLast:!0}),r.timeStamp=performance.now()})),this.rootPlayer.on(a.t.Player_PatchSwitch,(function(t){var n;(null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.lastCid)===r.mainInfo.cid&&e.emitBusinessReportData(pe.show,{isLast:!0})})),this.rootPlayer.on(s.p.PATCH_ADV_PLAY_ENDED,(function(){e.emitBusinessReportData(pe.video_play,{isEnded:!0});var t=r.getPostFiltereBusinessVideoList();r.hasValidAdv&&r.getMainIndex()===r.state.index&&0===t.length&&e.emitBusinessReportData(pe.show,{isLast:!0})}))},t.prototype.processDmViewRePlyOffset=function(e){var t=this.rootStore.patchAdvStore;if(t.hasValidAdv){var r=t.prePatchDuration();Array.isArray(e.commandDms)&&e.commandDms.forEach((function(e){e.stime?e.stime+=r:e.stime=r})),Array.isArray(null==e?void 0:e.postPanelV2)&&e.postPanelV2.forEach((function(e){e.start?e.start+=r:e.start=r,e.end&&-1!==e.end&&(e.end+=r)}))}},t.prototype.getSeekDecision=function(e){var t=this.rootStore.patchAdvStore,r=this.configTimeIntervalList,n=r&&r[r.length-1].end;e<0&&(e=0),e>n&&(e=n-.5);var i=r.findIndex((function(t){return e>=t.start&&e0?e[0].fragmentInfo:null},t.prototype.hasValidPreBusinessStock=function(){var e=this.rootStore.patchAdvStore.getPreFilteredVideoList().filter((function(e){var t=e.fragmentInfo;return"PRE"===(null==t?void 0:t.fragment_position)&&t.fragment_type===oe.AD_FRAGMENT}));return e.length>0?e[0].fragmentInfo:null},t.prototype.hasValidPreOGVStock=function(){var e=this.rootStore.patchAdvStore.getPreFilteredVideoList().filter((function(e){var t=e.fragmentInfo;return"PRE"===(null==t?void 0:t.fragment_position)&&t.fragment_type===oe.OGV_FRAGMENT}));return e.length>0?e[0].fragmentInfo:null},t.prototype.getValidBusinessStock=function(){var e=this.rootStore.patchAdvStore.state.videoList.filter((function(e){var t=e.fragmentInfo;return(null==t?void 0:t.fragment_type)===oe.AD_FRAGMENT}));return e.length>0?e:[]},t.prototype.hasAnyBusinessStock=function(){var e,t,r=null===(t=null===(e=this.rootStore.patchAdvStore.state)||void 0===e?void 0:e.reportList)||void 0===t?void 0:t.filter((function(e){var t=e.fragmentInfo;return(null==t?void 0:t.fragment_type)===oe.AD_FRAGMENT}));return r&&r.length>0},t}(u.f);!function(e){e.video_play="video_play",e.actual_play="actual_play",e.show="show"}(pe||(pe={})),function(e){e[e.All=0]="All",e[e.Pre=1]="Pre",e[e.Post=2]="Post"}(he||(he={})),function(e){e[e.onlyPre=1]="onlyPre",e[e.onlyPost=2]="onlyPost",e[e.both=3]="both"}(ye||(ye={})),function(e){e.MAIN="main",e.PATCH="patch"}(me||(me={})) ;var ve,be,_e,Ee,Se=function(e){function t(t){var r=e.call(this,t)||this;return r.canRecordBuffering=!1,r.switchPlayAt=0,r.preloadDataMap=new Map,r.preloadAjax=[],(0,o.rC)(r),r.patchAdvAtom=new ge(t),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{enable:!1,totalDuration:0,videoList:[],index:0,mainInfo:null,reportList:[]}},enumerable:!1,configurable:!0}),t.prototype.onPrepared=function(){var t=this;e.prototype.onPrepared.call(this),this.dp.vxStart=(0,o.gx)((function(){return t.trackStore.state.vxStart}),(function(){return t.startReport()}))},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.timeStamp=performance.now(),this.patchAdvAtom.addEvents(),this.rootPlayer.on(a.t.Player_Canplay,(function(){t.advPolarReport()}))},t.prototype.getCurrentTime=function(){var e=this.mediaStore.video,t=Math.ceil(e.currentTime||0);return this.getFakeCurrentTimePrefix()+(t||this.switchPlayAt)},t.prototype.getPatchPlayUrlParams=function(){return this.hasValidAdv?{fragment:encodeURIComponent(JSON.stringify(this.patchAdvAtom.repeatparams)),avid:this.mainInfo.aid,cid:this.mainInfo.cid}:null},t.prototype.startReport=function(){var e=this;this.timer=window.setInterval((function(){e.patchAdvAtom.emitBusinessReportData(pe.video_play)}),1e3)},Object.defineProperty(t.prototype,"hasValidAdv",{get:function(){return Array.isArray(this.state.videoList)&&this.state.videoList.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contextExt",{get:function(){return this.patchAdvAtom.contextExt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingKind",{get:function(){return this.isPlayingPatch()?me.PATCH:me.MAIN},enumerable:!1,configurable:!0}),t.prototype.prePatchDurationInSec=function(){return this.prePatchDuration()/1e3},t.prototype.prePatchDurationInSecAndInt=function(){return Math.round(this.prePatchDurationInSec())},t.prototype.prePatchDuration=function(){return this.getPreFilteredVideoList().reduce((function(e,t){return e+t.timelength}),0)||0},t.prototype.postPatchDuration=function(){return this.getPostFilteredVideoList().reduce((function(e,t){return e+t.timelength}),0)||0},t.prototype.postPatchDurationInSec=function(){return this.postPatchDuration()/1e3},t.prototype.getPreFilteredVideoList=function(){return this.state.videoList.filter((function(e){var t;return"PRE"===(null===(t=null==e?void 0:e.fragmentInfo)||void 0===t?void 0:t.fragment_position)&&!0===(null==e?void 0:e.playStatus)}))},t.prototype.getMainVideoRelativeTime=function(){return this.portStore.getCurrentTime()-Math.ceil(this.prePatchDuration()/1e3)},t.prototype.getPostFilteredVideoList=function(){return this.state.videoList.filter((function(e){var t;return"POST"===(null===(t=null==e?void 0:e.fragmentInfo)||void 0===t?void 0:t.fragment_position)&&!0===(null==e?void 0:e.playStatus)}))},t.prototype.getPostFiltereBusinessVideoList=function(){return this.state.videoList.filter((function(e){var t,r;return"POST"===(null===(t=null==e?void 0:e.fragmentInfo)||void 0===t?void 0:t.fragment_position)&&(null===(r=null==e?void 0:e.fragmentInfo)||void 0===r?void 0:r.fragment_type)===oe.AD_FRAGMENT&&!0===(null==e?void 0:e.playStatus)}))},t.prototype.isPatchAdv=function(e){var t=this.state.videoList.findIndex((function(t){var r;return(null===(r=null==t?void 0:t.fragmentInfo)||void 0===r?void 0:r.cid)===e}));return-1!==t},t.prototype.getTotalDuration=function(){return this.state.videoList.reduce((function(e,t){return e+t.timelength}),0)/1e3},t.prototype.getFakeCurrentTimePrefix=function(){for(var e=0,t=0;t=t.start&&e=t.start&&e0)&&this.state.index===this.state.videoList.length-1},enumerable:!1,configurable:!0}),t.prototype.hasLeftVideoToPlay=function(){return this.hasValidAdv&&!this.isLastIndex},t.prototype.patchSwitch=function(e){return this.patchAdvAtom.patchSwitch(e)},t.prototype.advPolarReport=function(){this.patchAdvAtom.advPolarReport()},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.timeStamp=0,clearInterval(this.timer),this.timer=null,this.preloadDataMap.clear()},(0,n.gn)([o.Fl],t.prototype,"hasValidAdv",null),(0,n.gn)([o.Fl],t.prototype,"playingKind",null),(0,n.gn)([o.Fl],t.prototype,"isLastIndex",null),t}(u.u),Ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="PortStore",t.cachedNow=0,t.cachedNowTimeStamp=0,t.seekDeferred=null,t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"metadata",{get:function(){return ue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rid",{get:function(){return this.metadata.version+"-"+this.metadata.revision},enumerable:!1,configurable:!0}),t.prototype.getRemoteNow=function(e){return void 0===e&&(e=600),(0,n.mG)(this,void 0,void 0,(function(){var t,r;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return t=$()-this.cachedNowTimeStamp,this.cachedNow&&this.cachedNowTimeStamp>0&&t<1e3*e?[2,this.cachedNow+Math.floor(t/1e3)]:[3,1];case 1:return n.trys.push([1,3,,4]),[4,new ce(this.rootPlayer,{noStore:!0,memCache:!1,persistent:!0}).r()];case 2:return r=n.sent(),this.cachedNow=r.now,this.cachedNowTimeStamp=$(),[2,this.cachedNow];case 3:return n.sent(),[2,Math.floor(Date.now()/1e3)];case 4:return[2]}}))}))},t.prototype.getScreenKind=function(e){var t=this.uiStore.state.mainScreen,r=this.uiStore.state.sideScreen;return e?null!=r&&r!==l.dY.Pip?r:t:null!=r?r:t},t.prototype.getPlayUrl=function(){return this.kernelStore.baseAgent?this.kernelStore.baseAgent.getPlayUrl():""},t.prototype.hasFocus=function(){return!!this.nodes.container.contains(document.activeElement)||this.ctrlStore.state.containerFocus},t.prototype.hasEditableFocus=function(){var e=[this.rootStore.window.document];if(this.rootStore.isEmbedSOP)try{e.push(this.rootStore.parent.document)}catch(e){}return e.some((function(e){if(e.activeElement){switch(e.activeElement.tagName){case"INPUT":switch(e.activeElement.type){case"button":case"reset":case"submit":case"hidden":case"radio":case"checkbox":case"image":case"file":case"range":return!1;default:return!0}case"TEXTAREA":return!0}if(e.activeElement.isContentEditable)return!0}return!1}))},t.prototype.seekAutoplay=function(e,t){var r=this;this.seek(e,{initiator:t?"".concat(t,":Seek"):t}).then((function(){return r.play({initiator:t?"".concat(t,":Autoplay"):t})})).catch((function(e){ return r.log.w("[seekAutoplay]",ee(ve||(ve=(0,n.cy)(["",""],["",""])),e))}))},t.prototype.reqStatue=function(e,t,r){var n=this;this.configStore.isChannel(l.u5.PC_APP)&&e===l.dY.Full&&window.appRequestFullScreen&&"function"==typeof window.appRequestFullScreen?window.appRequestFullScreen((function(){n.statueStore.requestStatue(e,t,r).catch(Y.Z)})):this.statueStore.requestStatue(e,t,r).catch(Y.Z)},t.prototype.isEnded=function(e){return(e||!(this.settingStore.state.loop&&!this.userStore.isCharingTrialWatch))&&this.mediaStore.video.ended},t.prototype.isPaused=function(){return this.mediaStore.video.paused},t.prototype.isSeeking=function(){return this.mediaStore.video.seeking},t.prototype.isMuted=function(){return this.settingStore.getMuted()||0===this.settingStore.getVolume()},t.prototype.getManifest=function(){return{p:this.configStore.p,aid:this.configStore.aid,cid:this.configStore.cid,pid:this.configStore.pid,bvid:this.configStore.bvid,seasonId:this.configStore.seasonId,episodeId:this.configStore.episodeId,kind:this.uiStore.kind,screenKind:this.getScreenKind(),channelKind:this.configStore.channelKind,quality:this.qualityStore.quality,seasonType:this.configStore.seasonType,hasPrev:this.episodeStore.state.hasPrev,hasNext:this.episodeStore.state.hasNext,hasPipFn:this.statueStore.hasPipFn,hasFullscreenFn:this.statueStore.hasFullscreenFn,referrer:this.episodeStore.state.referrer}},t.prototype.getStates=function(){return{initError:this.errorStore.state.initError,pipEnabled:this.statueStore.pipEnabled,fullscreenEnabled:this.statueStore.fullscreenEnabled,majorCtrlHidden:this.ctrlStore.isCtrlHidden(),mainScreen:this.uiStore.state.mainScreen,sideScreen:this.uiStore.state.sideScreen}},t.prototype.getMediaInfo=function(){var e=this.metricStore.getAbsolutePlayTime();return{playUrl:this.getPlayUrl(),absolutePlayTime:e,relativePlayTime:this.metricStore.getRelativePlayTime(),videoWidth:this.mediaStore.video.videoWidth,videoHeight:this.mediaStore.video.videoHeight,maxTime:this.metricStore.getMaxPlayTime()}},t.prototype.getUserInfo=function(){var e;return{mid:(null===(e=this.userStore.info)||void 0===e?void 0:e.mid)||null}},t.prototype.getUserParams=function(){return(0,le.Z)({},{input:this.rootPlayer.input,theme:this.rootPlayer.theme,prefetch:this.rootPlayer.cd})},t.prototype.getElements=function(){var e=this.rootStore.nodes;return{container:e.container,videoArea:e.videoArea,controlWrap:e.controlWrap,topTitle:e.topTitle,topFollow:e.topFollow,subtitle:e.subtitleWrap,endingPanel:e.endingPanel,qualityBubble:e.bubble,summaryWrap:e.summaryWrap}},t.prototype.getSupportedQualityList=function(e){var t=this.mpdStore.body,r=null==t?void 0:t.mediaDataSource,n=(null==e?void 0:e.formats)||(null==t?void 0:t.supportFormats);return Array.isArray(n)&&n.length>0?r&&("dash"===r.type||(null==t?void 0:t.isPreview))?fe().getSupportedVideoIdList(n,e):n.map((function(e){return e.quality})):null},t.prototype.canPlayType=function(e){var t,r,i;if("string"!=typeof e)return null;if(this.errorStore.state.disableNonDAQ&&/^(FLAC|EC3DolbyATMOS)$/i.test(e))return!1;var o={},a=0;"HEVC_HDR10"===e?a=125:"HEVC_DolbyVision"===e&&(a=126);var s=null===(i=this.mpdStore.body)||void 0===i?void 0:i.supportFormats.filter((function(e){return e.quality===a}));a&&s&&s[0]&&s[0].codecs&&(o.codec=s[0].codecs[0]||"");try{for(var u=(0,n.XA)([{key:"HEVC",prop:"isHEVCTypeSupported"},{key:"HEVC_HDR10",prop:"isHEVCHDR10TypeSupported"},{key:"HEVC_DolbyVision",prop:"isHEVCDolbyVisionTypeSupported"},{key:"EC3DolbyATMOS",prop:"isEC3DolbyATMOSTypeSupported"},{key:"HEVC_8K",prop:"isHEVC8kTypeSupported"},{key:"AV1",prop:"isAV1TypeSupported"},{key:"FLAC",prop:"isFLACTypeSupported"}]),l=u.next();!l.done;l=u.next()){var c=l.value;try{if(new RegExp("^".concat(c.key,"$"),"i").test(e)&&"function"==typeof fe()[c.prop])return fe()[c.prop](o)}catch(e){}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return null},t.prototype.readFrameAsBlob=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t,r;return(0,n.Jh)(this,(function(n){return t=Object.assign({},e),r=te(this.mediaStore.video,t.width,t.height),[2,new Promise((function(e,t){try{r.toBlob(e,"image/jpeg",.8)}catch(e){t(e)}}))]}))}))},t.prototype.readFrameAsDataURL=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t;return(0,n.Jh)(this,(function(r){return t=Object.assign({},e),[2,te(this.mediaStore.video,t.width,t.height).toDataURL("image/jpeg",.8)]}))}))},t.prototype.getCurrentTime=function(){var e=this.mediaStore.video,t=this.mediaStore.state.currentTime;return this.patchAdvStore.hasValidAdv?this.patchAdvStore.getCurrentTime():isNaN(e.duration)||e.readyState<1?t:this.mediaStore.video.currentTime},t.prototype.getDuration=function(e){var t=this.mediaStore.video,r=this.mpdStore.state.suspectDuration,n=this.mediaStore.state.duration;return this.patchAdvStore.hasValidAdv?this.patchAdvStore.getTotalDuration():e?isNaN(t.duration)?n+r:t.duration+r:isNaN(t.duration)?n:t.duration},t.prototype.seek=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){var r,i,s,u,l,c,d,f,p,h,y=this;return(0,n.Jh)(this,(function(m){switch(m.label){case 0:if(r=this.rootPlayer.disabled.seek||this.rootPlayer.hasFeature("noSeek"),this.log.i("[seek]",ee(be||(be=(0,n.cy)(["params:",",alt:",",disabled:",""],["params:",",alt:",",disabled:",""])),e,t,r)),i=(null==t?void 0:t.initiator)||null,u=(s="number"==typeof e?{value:e}:e).isOffset?this.getCurrentTime()+s.value:s.value,l=(0,P.Z)(u,0,this.getDuration()-.1),this.patchAdvStore.hasValidAdv){if(c=(0,P.Z)(e,0,this.getDuration()-.1),d=this.patchAdvStore.getSeekDecision(c),f=d.isSameEp,p=d.t,h=d.index,!f)return this.patchAdvStore.setState({index:h}),[2,this.patchAdvStore.patchSwitch(p)];l=p}if(r)throw new Error("Seek Disabled");if(isNaN(l))throw new Error("The provided double value is non-finite");return this.seekDeferred&&(this.seekDeferred=null),this.freeStore.eventAtom.setActionCaller("iSeek",i),this.seekDeferred=this.rootPlayer.addDispose(new se.B),this.mediaStore.setState({seekLoad:!0}),this.rootPlayer.emit(a.t.Player_ProgressBar_Change,new CustomEvent(a.t.Player_ProgressBar_Change,{detail:{progressTime:l,initiator:i}})),this.mediaStore.internalSeek(l),this.dp.seekAction&&this.dp.seekAction(),this.dp.seekAction=(0,o.gx)((function(){return!y.mediaStore.state.seeking&&!y.mediaStore.video.seeking}),(function(){return y.seekDeferred.resolve()})),[4,this.seekDeferred.promise];case 1:return m.sent(),null!=s.autoplay?[2,s.autoplay?this.play(t):this.pause(t)]:[2]}}))}))},t.prototype.play=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t,r,i=this;return(0,n.Jh)(this,(function(o){if(t=this.rootPlayer.disabled.play,this.log.i("[play]",ee(_e||(_e=(0,n.cy)(["alt:",",disabled:",""],["alt:",",disabled:",""])),e,t)),t)throw new Error("Play Disabled");return this.freeStore.eventAtom.setActionCaller("iPlay",(null==e?void 0:e.initiator)||null),(r=v(this.mediaStore.video)).catch((function(e){i.log.w("[play]",e&&e.message),i.freeStore.eventAtom.setActionCaller("iPlay",null)})),[2,r]}))}))},t.prototype.pause=function(e){var t=this.rootPlayer.disabled.pause;if(this.log.i("[pause]",ee(Ee||(Ee=(0,n.cy)(["alt:",",disabled:",""],["alt:",",disabled:",""])),e,t)),t)throw new Error("Pause Disabled");return this.freeStore.eventAtom.setActionCaller("iPause",(null==e?void 0:e.initiator)||null),this.mediaStore.video.pause()},t.prototype.attachExtState=function(e){var t=this;Object.keys(e).forEach((function(r){var n=+r;switch(n){case l.s.Follow:t.upStore.setState({follow:e[r]});break;case l.s.UpInfo:t.upStore.setState(e[r]);break;case l.s.Manuscript:t.storyStore.setState(e[r]);break;case l.s.Premiere:t.premiereStore.setState(e[r]);break;case l.s.ThreeBody:t.danmakuStore.setState({threeBody:e[r]});break;default:t.log.w("key(".concat(n,") not implemented"))}}))},t.prototype.fetch=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t,r=this;return(0,n.Jh)(this,(function(i){switch(i.label){case 0:return t=function(){return(0,n.mG)(r,void 0,void 0,(function(){var e=this;return(0,n.Jh)(this,(function(t){switch(t.label){case 0:return this.basicIdPromise=this.basicIdPromise||(0,o.gx)((function(){ return e.configStore.state.isCompleteIdEnded})),[4,this.basicIdPromise];case 1:return t.sent(),[2]}}))}))},e===l.qW.M_Lottie?[3,1]:[3,2];case 1:return[3,4];case 2:return[4,t()];case 3:return i.sent(),[3,4];case 4:switch(e){case l.qW.I_PlayUrl:return[3,5];case l.qW.I_UserInfo:return[3,6];case l.qW.I_ViewInfo:return[3,7];case l.qW.I_VideoShot:return[3,8];case l.qW.P_Title:return[3,9];case l.qW.M_Lottie:return[3,11]}return[3,12];case 5:return[2,this.httpStore.fetchPlayUrl(!0).then((function(e){return e.raw}))];case 6:return[2,this.httpStore.fetchUserInfo(!0).then((function(e){return e.response.data}))];case 7:return[2,this.httpStore.fetchViewInfo(!0).then((function(e){return e.response.data}))];case 8:return[2,this.httpStore.fetchVideoShot(!0).then((function(e){return e.response.data}))];case 9:return this.titlePromise=this.titlePromise||(0,o.gx)((function(){return null!=r.ctrlStore.title})),[4,this.titlePromise];case 10:return i.sent(),[2,this.ctrlStore.title];case 11:return[2,(0,j.ql)()];case 12:throw new Error("Not Implemented")}}))}))},t.prototype.getRedirectTime=function(){var e=this.portStore.getCurrentTime();return e>=1&&e<=this.mediaStore.video.duration-1?e:0},t.prototype.getAdvTotalDuration=function(e){return e===he.Pre?Math.ceil(this.patchAdvStore.prePatchDuration()/1e3):e===he.Post?Math.ceil(this.patchAdvStore.postPatchDuration()/1e3):e===he.All?Math.ceil((this.patchAdvStore.prePatchDuration()+this.patchAdvStore.postPatchDuration())/1e3):0},t.prototype.hasValidAdv=function(){return this.patchAdvStore.hasValidAdv},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.basicIdPromise=null,this.titlePromise=null},t}(u.u),we=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="EndingStore",(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{opened:!1,disabled:!1,backdrop:null}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAnyOpened",{get:function(){return!this.state.disabled&&(this.shareStore.state.opened||this.state.opened)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectOption",{get:function(){return this.shareStore.state.opened?2:this.state.opened?1:0},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this);var r=this.nodes.container.querySelector(".".concat(y.m,"-ending-backdrop"));this.dc.disabled=(0,o.U5)((function(){return t.state.disabled}),(function(e){e&&(t.shareStore.close(),t.close())})),this.dc.endingWrap=(0,o.U5)((function(){return t.isAnyOpened}),(function(e){e&&t.setBackdrop()})),this.dc.selectChange=(0,o.U5)((function(){return t.selectOption}),(function(e){t.nodes.endingWrap.setAttribute("data-select",e.toString())})),this.dc.backdropChange=(0,o.U5)((function(){return t.state.backdrop}),(function(e){return(0,n.mG)(t,void 0,void 0,(function(){var t,i,o;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return t=n.sent(),i=t?URL.createObjectURL(t):null,o=i?"url(".concat(i,")"):"none",this.revokeOldBlobURL(),r&&(r.style.backgroundImage=o),i&&(this.oldBlobUrl=i),[2]}}))}))})),this.dc.endPanel=(0,o.U5)((function(){return t.state.opened}),(function(e){queueMicrotask((function(){if(t.rootPlayer.isInitialized){if(t.rootPlayer.hasFeature("noEndingPanel"))return;e?(t.log.i("OpenEndPanel"),t.rootPlayer.emit(a.t.Player_Show_EndPanel,new CustomEvent(a.t.Player_Show_EndPanel))):(t.log.i("CloseEndPanel"),t.rootPlayer.emit(a.t.Player_Hide_EndPanel,new CustomEvent(a.t.Player_Hide_EndPanel)))}}))})),this.rootPlayer.on(a.t.Player_Play,(function(){return t.close()})),this.rootPlayer.on(a.t.Player_Seeking,(function(){return t.close()}))},t.prototype.open=function(){this.state.disabled||this.state.opened||this.setState({opened:!0})},t.prototype.close=function(){this.state.opened&&this.setState({opened:!1})},t.prototype.setBackdrop=function(){this.state.backdrop||this.setState({backdrop:this.portStore.readFrameAsBlob({width:480}).catch(Y.Z)})},t.prototype.revokeOldBlobURL=function(){this.oldBlobUrl&&(URL.revokeObjectURL(this.oldBlobUrl),this.oldBlobUrl=null)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.close()},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.revokeOldBlobURL()},(0,n.gn)([o.Fl],t.prototype,"isAnyOpened",null),(0,n.gn)([o.Fl],t.prototype,"selectOption",null),t}(u.u),Te=r(50272),Re=1/0;var Ce=function(e){return e?(e=(0,Te.Z)(e))===Re||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Pe=function(e){var t=Ce(e),r=t%1;return t==t?r?t-r:t:0};var Ie,De,Oe=function(e){return"number"==typeof e&&e==Pe(e)},xe=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="EpisodeStore",r.reloadReferrer={},r.reloadDeferred=null,r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{hasPrev:null,hasNext:null,isRenewal:!1,isSameEpisode:!1,referrer:""}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFirst",{get:function(){return this.state.isRenewal?1===this.rootStore.ding||2===this.rootStore.ding:1===this.rootStore.ding},enumerable:!1,configurable:!0}),t.prototype.onLoaded=function(t){e.prototype.onLoaded.call(this,t);var r={};null!=this.configStore.hasPrev&&(r.hasPrev=this.configStore.hasPrev),null!=this.configStore.hasNext&&(r.hasNext=this.configStore.hasNext),this.setState(r)},t.prototype.isSameSeason=function(){var e=this.reloadReferrer,t=this.configStore;if(e)if(t.state.isCompleteIdEnded){if(t.seasonId&&e.seasonId)return t.seasonId===e.seasonId;if(t.aid&&e.aid)return t.aid===e.aid;if(t.bvid&&e.bvid)return t.bvid===e.bvid}else this.log.e("Illegal call isSameSeason method");return null},t.prototype.reload=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var i=this;return(0,n.Jh)(this,(function(u){switch(u.label){case 0:return this.log.i("[reload]",ee(Ie||(Ie=(0,n.cy)(["config:",",alt:",""],["config:",",alt:",""])),e,r)),clearTimeout(this.reloadTimer),this.track.e("reload_from",{source:0}),this.reloadDeferred&&(this.reloadDeferred=null),this.configStore.state.isCompleteIdEnded&&(this.reloadReferrer={aid:this.configStore.aid,cid:this.configStore.cid,bvid:this.configStore.bvid,seasonId:this.configStore.seasonId,episodeId:this.configStore.episodeId}),this.rootPlayer.connectDetails.starting&&(this.rootPlayer.emit(s.p.PLAYER_UNLOAD),this.rootPlayer.emit(s.p.PLAYER_UNLOADED),this.rootPlayer.emit(a.t.Player_Dispose,new CustomEvent(a.t.Player_Dispose))),[4,new Promise((function(e){i.reloadTimer=window.setTimeout(e,1)}))];case 1:return u.sent(),this.rootStore.stageAtom.set(0),this.reloadDeferred=this.rootPlayer.addDispose(new se.B),this.setState({isRenewal:!!(null==t?void 0:t.isRenewal),isSameEpisode:!!(null==t?void 0:t.isSameEpisode),referrer:(null==r?void 0:r.initiator)||""}),null!=e&&this.configStore.startReloadParser(e),this.dp.reloadAction&&this.dp.reloadAction(),this.dp.reloadAction=(0,o.gx)((function(){return i.rootStore.isLoaded}),(function(){return i.reloadDeferred.resolve()})),this.rootStore.changeP(),[4,this.reloadDeferred.promise];case 2:return u.sent(),[2,!this.errorStore.state.initError]}}))}))},t.prototype.prev=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(r){switch(r.label){case 0:return[4,this.goto(-1,!1,e,t)];case 1:return r.sent(),[2]}}))}))},t.prototype.next=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return[4,this.goto(1,!1,e,t,r)];case 1:return n.sent(),[2]}}))}))},t.prototype.goto=function(e,t,r,i,o){return(0,n.mG)(this,void 0,void 0,(function(){var s,u;return(0,n.Jh)(this,(function(n){if(s=this.settingStore.state.handoff,u=s===l.ty.Auto,o||(u=!0),!Oe(e))throw new Error("The first argument MUST be an integer");return this.rootPlayer.emit(a.t.Player_Handoff_Signal,new CustomEvent(a.t.Player_Handoff_Signal,{detail:{offset:e,absolute:t,config:r,alt:i,auto:u,cid:this.configStore.cid,epid:this.configStore.episodeId,listLoop:this.settingStore.state.listLoop}})),[2]}))}))},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this), clearTimeout(this.reloadTimer)},t}(u.u),ke=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="AssetStore",r.flvjs=null,(0,o.rC)(r),r}return(0,n.ZT)(t,e),t.prototype.onMount=function(){e.prototype.onMount.call(this),this.fetchDashAsset(),this.addLazyActions()},t.prototype.fetchDashAsset=function(){window.DashPlayer||(window.DashPlayer=fe())},t.prototype.addLazyActions=function(){var e=this,t=(0,o.hz)(this,"flvjs",(function(){t(),(0,j.YE)().then((function(t){window.flvjs||(window.flvjs=t.default),(0,o.z)((function(){e.flvjs=t.default}))})).catch((function(t){e.log.e(t&&t.message)}))}))},(0,n.gn)([o.LO.shallow],t.prototype,"flvjs",void 0),t}(u.u),Ne=r(44425),Le=r(87615);!function(e){e.Flv="Flv",e.Dash="Dash"}(De||(De={}));var Me,Fe,Ue=function(){function e(e,t,r){this.isAgentReady=!1,this.isQualityReady=!1,this.isAgentOffscreen=!1,this.rootStore=e,this.rootPlayer=e.rootPlayer,this.isAgentOffscreen=!!r,this.track=this.rootPlayer.track,this.video=t,this.rootStore.decomposeSubStores(this),this.isAgentReady=!0}return Object.defineProperty(e.prototype,"log",{get:function(){if(!this._cachedLog){var e=this.rootPlayer.log;this._cachedLog=this.tag?e.getLogger(this.tag):e}return this._cachedLog},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this.isAgentReady},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOffscreen",{get:function(){return this.isAgentOffscreen},enumerable:!1,configurable:!0}),e.prototype.getPlayUrl=function(){var e=this.data&&this.data.mediaDataSource;return e&&e.segments&&e.segments[0]&&e.segments[0].url||""},e.prototype.attachSource=function(e){this.log.i("[attachSource]","KernelType:".concat(this.kind)),this.data=e,this.data.seekType||(this.data.seekType="range")},e.prototype.attachEvent=function(){this.log.i("[attachEvent]"),this.isAgentOffscreen=!1,this.addBaseEvents()},e.prototype.resetQualityReadyState=function(){this.log.i("resetQualityReadyState"),this.isQualityReady=!1},e.prototype.w=function(){this.log.w("[Warning]","kernelPlayer is not destroyed")},e.prototype.setInitQuality=function(){if(!this.isQualityReady){var e=0===this.qualityStore.state.newQuality?0:this.realVQ;this.log.i("[setInitQuality]","q:".concat(e)),this.qualityStore.setRenderedQuality(null,e),this.isQualityReady=!0}},e.prototype.restoreStates=function(){var e=this,t=this.kernelStore.cachedStatus;if(t){var r=t.currentTime,n=t.paused,i=this.video.duration;if(this.log.i("[Restore]","paused:".concat(n,",currentTime:").concat(r,",duration:").concat(i)),r){var o=(0,P.Z)(r,0,i);o>0&&(this.seek(o),this.log.i("[Restore]","SeekAction"))}n?this.video.pause():v(this.video).catch((function(t){return e.log.w("[Restore]","PlayFailed",t&&t.message)}))}},e.prototype.addBaseEvents=function(){this.video.readyState>=1?this.onLoadedmetadata():this.video.addEventListener("loadedmetadata",this.onLoadedmetadata)},e.prototype.removeBaseEvents=function(){this.video.removeEventListener("loadedmetadata",this.onLoadedmetadata)},e.prototype.onLoadedmetadata=function(){this.restoreStates(),this.setInitQuality(),this.errorStore.abortRetry()},e.prototype.dispose=function(){this.log.i("dispose"),this.isAgentReady=!1,this.resetQualityReadyState(),this.removeBaseEvents()},(0,n.gn)([i.ZP],e.prototype,"onLoadedmetadata",null),e}(),Be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="QualityAtom",t}return(0,n.ZT)(t,e),t.prototype.getSwitchTimeout=function(){return this.rootStore.patchAdvStore.isPlayingPatch()?40:15},t.prototype.switchProxy=function(){var e=this.rootStore,t=e.kernelStore,r=e.qualityStore,n=t.baseAgent,i=n&&n.kernelPlayer,o=r.state.newQuality;return n&&i?(n.kind===De.Dash?this.switchDash(n,i,o):this.switchFlv(n,i,o),!0):(this.log.w("[switchProxy]","kernel is not initialized"),!1)},t.prototype.triggerRequestedEvent=function(e){e.isAutomatic&&"video"===e.mediaType&&this.setAudioQuality(e.newQ),"video"===e.mediaType&&e.newQ===Ne.nJ.alias.AI_100&&this.rootPlayer.emit(a.t.Player_Ai_Animation_Triggered,new CustomEvent(a.t.Player_Ai_Animation_Triggered)),this.rootPlayer.emit(a.t.Player_Quality_Requested,new CustomEvent(a.t.Player_Quality_Requested,{detail:e}))},t.prototype.triggerRenderedEvent=function(e){this.rootPlayer.emit(a.t.Player_Quality_Rendered,new CustomEvent(a.t.Player_Quality_Rendered,{detail:e}))},t.prototype.switchDash=function(e,t,r){var n=this,i=this.rootStore,o=i.uiStore,a=i.qualityStore,s=i.kernelStore,u=i.mpdStore,c=i.userStore;if(this.canDashSeamless(e.realVQ,r))if(0===r){var d=o.kind===l.HR.Ugc?Ne.nJ.gt.ugcLogin:Ne.nJ.gt.login,f=c.isLogin?a.getAbrQualityLimitByUserLevel:d;a.maxEmbeddedQn&&(f=a.maxEmbeddedQn),t.setAutoSwitchQualityFor("video",!0).setAutoSwitchTopQualityFor("video",f),a.setRenderedQuality(null,r)}else t.setAutoSwitchQualityFor("video",!1).setQualityFor("video",r,this.getSwitchTimeout()).then((function(t){var n=t&&+t.newQualityNumber||e.realVQ||r;a.setRenderedQuality(null,n)})).catch((function(e){var t,r,i=a.state.nowQuality,o=a.state.newQuality,u=s.baseAgent&&s.baseAgent.realVQ,l=e&&e.code;n.log.w("[switchDashQualityForVideo]","code:".concat(l,",nowQ:").concat(i,",newQ:").concat(o,",realQ:").concat(u)),l===fe().ERROR_CODE.SET_QUALITY_RENDER_CHANGED?(t=e,r=u):0===i&&o&&o===u?(t=null,r=o):(t=e,r=i),o&&o===u&&(t=null,r=o),a.setRenderedQuality(t,r)})),this.setAudioQuality(r);else r===Ne.nJ.alias.AI_100?u.fetchPlayUrl({qn:r,extra_qn:1},{initiator:1}):u.fetchPlayUrl({qn:r,try_look:+a.state.isTrialQuality},{initiator:1})},t.prototype.setAudioQuality=function(e){var t,r,n=this,i=this.rootStore,o=i.mpdStore,a=i.kernelStore,s=i.qualityStore,u=null===(r=null===(t=o.body)||void 0===t?void 0:t.mediaDataSource)||void 0===r?void 0:r.url,l=a.dashKernel,c=s.realAQ,d=function(){var t,r,n=Ne.nJ.alias,i=e<=n.SD_32?n.AQ_30216:eNe.nJ.gt.login&&!this.state.isTrialQuality||this.maxEmbeddedQn&&e>this.maxEmbeddedQn)throw i="Permission denied",this.log.w("[requestQuality]",i),new Error(i);this.log.i("[requestQuality]",ee(Me||(Me=(0,n.cy)(["nvq:",",naq:",",alt:",""],["nvq:",",naq:",",alt:",""])),e,+t,r)),o=this.rootPlayer.addDispose(new se.B),this.qualityDeferred&&(this.qualityDeferred=null),this.qualityDeferred=o;try{this.setRequestedQuality(e,null==t?null:+t)}catch(e){o.reject(e)}return[4,o.promise];case 1:return a.sent(),[2]}}))}))},t.prototype.getQuality=function(){return{oldA:this.state.oldAudio,nowA:this.state.nowAudio,newA:this.state.newAudio,oldQ:this.state.oldQuality,nowQ:this.state.nowQuality,newQ:this.state.newQuality,realQ:this.realQ}},Object.defineProperty(t.prototype,"getAbrQualityLimitByUserLevel",{get:function(){var e=Ne.nJ.gt.abrMax;try{if(this.uiStore.kind===l.HR.Ugc&&this.hitAbrLimitAbTest){var t=this.kvStore.state.dashConfig[this.abrLimitByUserLevel]||{};t&&"string"==typeof t&&(t=JSON.parse(t),e=this.userStore.isSuperUser?t[Ne.XK.LOGINWITHVIP]||Ne.nJ.gt.abrMax:t[Ne.XK.LOGINWITHOUTVIP]||Ne.nJ.gt.abrMax)}}catch(e){console.log("error in getAbrQualityLimitByUserLevel",e)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hitAbrLimitAbTest",{get:function(){var e;return"V_PLAYER_ABR_LIMIT"===(null===(e=window.webAbTest)||void 0===e?void 0:e.abr_limit_version)},enumerable:!1,configurable:!0}),t.prototype.setRequestedQuality=function(e,t){var r=this,n=this.qualityAtom.getSwitchTimeout(),i="[setRequestedQuality]",o={audio:!0,video:!0};null==t&&(o.audio=!1);var a=this.state.nowAudio,s=this.state.nowQuality,u=null==e?s:+e,l=u===s,c=o.audio?+t:a;if(c===a&&(o.audio=!1),isNaN(u)&&(o.video=!1,!o.video&&!o.audio))throw new Error("Illegal argument");if(l&&(o.video=!1,!o.video&&!o.audio))throw new Error("Same as current quality:".concat(s,",").concat(a));if(clearTimeout(this.switchingTimer),o.video&&o.audio)this.log.i(i,"Request:A&V"),this.setState({newQuality:u,reqQuality:u,newAudio:c,reqAudio:c}),this.qualityAtom.triggerRequestedEvent({mediaType:"audio",isAutomatic:!1,oldQ:a,newQ:c}),this.qualityAtom.triggerRequestedEvent({mediaType:"video",isAutomatic:!1,oldQ:s,newQ:u});else if(o.video)this.log.i(i,"Request:V"),this.setState({newQuality:u,reqQuality:u}),this.qualityAtom.triggerRequestedEvent({mediaType:"video",isAutomatic:!1,oldQ:s,newQ:u});else{if(!o.audio){var d="Fatal error";throw this.log.e(i,d),new Error(d)}this.log.i(i,"Request:A"),this.setState({newAudio:c,reqAudio:c}),this.qualityAtom.triggerRequestedEvent({mediaType:"audio",isAutomatic:!1,oldQ:a,newQ:c})}this.switchingTimer=window.setTimeout((function(){r.setRenderedQuality(new Error("Timeout:".concat(n,"s")),r.state.nowQuality)}),1e3*n)},t.prototype.setRenderedQuality=function(e,t){var r=this,i="[setRenderedQuality]",o=function(){var e="[setAudioQuality]",t=r.state.nowAudio,i=r.state.newAudio,o=function(){var e,t,i,o,a=r.kernelStore.dashKernel,s=r.mpdStore.body;if(a&&s){var u=a.getQualityFor("audio"),l=+a.getQualityNumberFromQualityIndex(u,"audio"),c=s.mediaDataSource.url,d=null===(i=null==c?void 0:c.dolby)||void 0===i?void 0:i.audio,f=null===(o=null==c?void 0:c.flac)||void 0===o?void 0:o.audio;if(Array.isArray(d))try{for(var p=(0,n.XA)(d),h=p.next();!h.done;h=p.next())if(+h.value.id===l)return 1}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}if(f&&+f.id===l)return 2}return 0}();if(t!==i){if(t===o)return r.log.e(e,"targetA:".concat(o)),r.setState({nowAudio:o,newAudio:o}), "Audio(type:".concat(i,") maybe Unsupported or Unknown err");r.log.i(e,"targetA:".concat(o)),r.setState({oldAudio:t,nowAudio:o,newAudio:o})}else r.log.i(e,"initialA:".concat(o)),r.setState({nowAudio:o,newAudio:o});return null}(),a=function(){return r.qualityDeferred&&r.qualityDeferred.resolve()},s=function(e){return r.qualityDeferred&&r.qualityDeferred.reject(e)},u=+t,l=this.state.nowQuality,c=this.state.newQuality,d=u===l;if(clearTimeout(this.switchingTimer),this.log.i(i,ee(Fe||(Fe=(0,n.cy)(["nVQ:",",tVQ:",",",""],["nVQ:",",tVQ:",",",""])),l,t,e)),isNaN(this.state.newQuality)||isNaN(this.state.newAudio)||isNaN(t)){var f="Lifecycle issue";return this.log.e(i,f),void s(new Error(f))}if(c===l){var p=this.state.oldAudio,h=this.state.nowAudio,y="string"==typeof o;if(this.log.i(i,d?"Only":"Extra","switch audio"),this.qualityAtom.triggerRenderedEvent({mediaType:"audio",isError:y,isAutomatic:!1,oldQ:p,newQ:h}),y?s(new Error(o)):a(),d)return}var m=e?(r.log.e(i,e.message),r.setState({nowQuality:l,newQuality:l}),e||new Error("Unknown")):isNaN(u)?(r.log.e(i,"targetQ:NaN"),r.setState({nowQuality:l,newQuality:l}),e||new TypeError("Rendered quality is not a number")):(d?(r.log.w(i,"targetQ same as nowQ"),r.setState({nowQuality:u,newQuality:u})):(r.log.i(i,"targetQ:".concat(u)),r.setState({oldQuality:l,nowQuality:u,newQuality:u})),null),g=this.state.oldQuality,v=this.state.nowQuality;this.qualityAtom.triggerRenderedEvent({mediaType:"video",isError:!!m,isAutomatic:!1,oldQ:g,newQ:v}),m?s(m):a()},t.prototype.requestVipPermission=function(e,t){return new Le.d(this.rootPlayer).r({modify_type:e,biz_type:t})},t.prototype.onUnload=function(){this.qualityStore.hasVipQnTrialAble&&Ne.nJ.isSuperQuality(this.state.reqQuality)&&this.setState({reqQuality:this.localStore.get().media.quality||Ne.nJ.alias.FHD_80}),this.qualityStore.aiSwitchQualityTrialable&&this.setState({reqQuality:this.localStore.get().media.quality||0}),e.prototype.onUnload.call(this)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{newAudio:1,reqAudio:1,newQuality:1,reqQuality:1}),clearTimeout(this.switchingTimer),this.switchingTimer=null},(0,n.gn)([o.Fl],t.prototype,"isSwitching",null),(0,n.gn)([o.Fl],t.prototype,"maxEmbeddedQn",null),(0,n.gn)([o.aD],t.prototype,"setRequestedQuality",null),(0,n.gn)([o.aD],t.prototype,"setRenderedQuality",null),t}(u.u);function Ve(e,t){try{if("string"==typeof e){var r=e.match(new RegExp("".concat(t,": (.*)"),"i"));return r&&r[1]?r[1]:null}if(e instanceof Headers)return e.get(t)}catch(e){}return null}var We,je,He=r(21845),Ze=r(89552),Ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="DashAgent",t.kind=De.Dash,t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"realVQ",{get:function(){if(this.dashPlayer){var e=(this.dashPlayer.getQualityList("video")||[])[this.dashPlayer.getQualityFor("video")];return e&&e.hasOwnProperty("id")?+e.id:NaN}return NaN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realAQ",{get:function(){if(this.dashPlayer){var e=(this.dashPlayer.getQualityList("audio")||[])[this.dashPlayer.getQualityFor("audio")];return e&&e.hasOwnProperty("id")?+e.id:NaN}return NaN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"averageThroughput",{get:function(){var e=this.dashPlayer.getCorePlayer(),t=+e.getAverageThroughput("video"),r=+e.getAverageThroughput("audio");return t&&r?1e3*(t+r)/1024/8/2:t?1e3*t/1024/8:r?1e3*r/1024/8:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastSecondThroughput",{get:function(){var e=this.dashPlayer&&this.dashPlayer.getVideoInfo();try{return e.statisticsInfo.networkActivity/1024}catch(e){return 0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernelPlayer",{get:function(){return this.dashPlayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"codecStrategy",{get:function(){var e,t,r=this.kvStore.state.dashConfig;try{var i=r.codec_strategy;if(!Array.isArray(i))throw new Error("error");i.sort((function(e,t){return e.priority-t.priority}));try{for(var o=(0,n.XA)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.rules;if("version"===s.id){var l=ue.version;if(u[l]&&Array.isArray(u[l]))return u[l]}else if("archive"===s.id){var c=this.configStore.cid;if(u[c]&&Array.isArray(u[c]))return u[c]}else if("fid"===s.id){var d=this.trackStore.getFid();if(u[d]&&Array.isArray(u[d]))return u[d]}else if("gpu"===s.id){var f=He.g.renderer.toLowerCase();for(var p in u)if(-1!==f.indexOf(p))return u[p]}else if("ua"===s.id){var h=window.navigator.userAgent.toLowerCase();for(var p in u)if(-1!==h.indexOf(p))return u[p]}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){}var y=["av1","hevc","avc"];try{y=JSON.parse(this.kvStore.state.dashConfig.default_codec_strategy)}catch(e){y=["av1","hevc","avc"]}return y},enumerable:!1,configurable:!0}),t.prototype.seek=function(e){var t=this;this.dashPlayer?this.dashPlayer.seek(e).catch((function(e){t.log.w("seek",e&&e.message)})):this.video.currentTime=e},t.prototype.getPlayUrl=function(){try{return this.dashPlayer?this.dashPlayer.getCurrentPlayURLFor("video")+","+this.dashPlayer.getCurrentPlayURLFor("audio"):e.prototype.getPlayUrl.call(this)}catch(t){return e.prototype.getPlayUrl.call(this)}},t.prototype.attachSource=function(t,r){var i,o=this;e.prototype.attachSource.call(this,t),this.dashPlayer&&(this.w(),this.removePlayerEvents(),this.removeProtectionEvents(),this.dashPlayer.destroy());var a,u=this.rootPlayer,c=u.hasFeature("noAudioStream"),d=this.errorStore.state.disableNonDAQ,f=this.qualityStore.state.reqAudio,p=null===(i=this.mpdStore.body)||void 0===i?void 0:i.quality,h=this.qualityStore.state.reqQuality,y=(0,j.Qj)(t),m=(0,j.Zc)(t,d?0:f);this.log.i("daq:".concat(m,",dvq:").concat(y,";rawVQ:").concat(p,",reqVQ:").concat(h)),this.dashPlayer=new(fe())(this.video,{defaultAudioQuality:m,defaultVideoQuality:y,isAutoPlay:!1,enableHEVC:this.configStore.enableHEVC,enableAV1:this.configStore.enableAV1,enableMultiAudioTracks:function(){try{return t.mediaDataSource.url.audio[0].codecs.split(",").length>1}catch(e){}return!1}()&&fe().isMultiAudioTracksSupported(),abrStrategy:fe().STRING.ABR_BOLA,stableBufferTime:this.kernelStore.getDynamicBuffer()[0]||20,preloadData:t.mediaDataSource.preloadAVData,hid:u.iid,codecStrategy:this.codecStrategy,protectionDataSet:null==r?void 0:r.protectionData,ignoreEmeEncryptedEvent:null==r?void 0:r.ignoreEmeEncryptedEvent,mediaSourceLoader:function(){if(o.configStore.fromLocalCache){return function(e){return(0,Ze.$)(o.rootPlayer,(0,n.pi)({type:"video",cid:o.configStore.cid},e))}}return null}(),enableExtraFrames:function(){var e;try{return!!(null===(e=o.kvStore.state)||void 0===e?void 0:e.dashConfig.enable_extra_frames)}catch(e){}return!1}()}),this.dashPlayer.initialize((a=(0,le.Z)({},t.mediaDataSource.url),c&&a&&a.audio&&(a.audio=null),JSON.parse(JSON.stringify(a)))).then((function(){return function(){if(!o.dashPlayer)throw new Error("dashPlayer does not exist");o.qualityStore.isAutoQ&&o.dashPlayer.setAutoSwitchQualityFor("video",!0),o.qualityStore.maxEmbeddedQn?o.dashPlayer.setAutoSwitchQualityFor("video",!0).setAutoSwitchTopQualityFor("video",o.qualityStore.maxEmbeddedQn):o.userStore.isLogin?o.dashPlayer.setAutoSwitchTopQualityFor("video",o.qualityStore.getAbrQualityLimitByUserLevel):o.dashPlayer.setAutoSwitchTopQualityFor("video",o.uiStore.kind===l.HR.Ugc?Ne.nJ.gt.ugcLogin:Ne.nJ.gt.login)}()})).catch((function(e){o.isOffscreen||o.rootPlayer.emit(s.p.ERROR_DASH_INITIALIZE,e)}))},t.prototype.attachEvent=function(){e.prototype.attachEvent.call(this),this.addPlayerEvents(),this.addProtectionEvents()},t.prototype.addPlayerEvents=function(){var e=this.dashPlayer.getCorePlayer();e.on(fe().EVENTS.PLAYBACK_PROGRESS,this.onPlaybackProgress),e.on(fe().EVENTS.FRAGMENT_LOADING_HEADER_RECEIVED,this.onHttpHeaderReceived),e.on(fe().EVENTS.QUOTA_EXCEEDED,this.onQuotaExceeded),e.on("requestRetryed",this.onRequestRetried),e.on(fe().EVENTS.PREDICT_SEEK,this.onPredictSeek),e.on(fe().EVENTS.JUMP_MEDIA_GAP,this.onJumpMediaGap), e.on(fe().EVENTS.STREAM_BUFFERING_COMPLETED,this.onStreamBufferingCompleted),this.dashPlayer.on(fe().EVENTS.ERROR,this.onError),this.dashPlayer.on(fe().EVENTS.VIDEO_INFO,this.onVideoInfo),this.dashPlayer.on(fe().EVENTS.QUALITY_CHANGE_REQUESTED,this.onQualityRequested),this.dashPlayer.on(fe().EVENTS.QUALITY_CHANGE_RENDERED,this.onQualityRendered),this.dashPlayer.on(fe().EVENTS.BUFFERING_OPTIMIZATION,this.onBufferingOptimization),this.dashPlayer.on(fe().EVENTS.WARNING,this.onWarning)},t.prototype.removePlayerEvents=function(){if(this.dashPlayer){this.dashPlayer.off(fe().EVENTS.ERROR,this.onError),this.dashPlayer.off(fe().EVENTS.VIDEO_INFO,this.onVideoInfo),this.dashPlayer.off(fe().EVENTS.QUALITY_CHANGE_REQUESTED,this.onQualityRequested),this.dashPlayer.off(fe().EVENTS.QUALITY_CHANGE_RENDERED,this.onQualityRendered),this.dashPlayer.off(fe().EVENTS.BUFFERING_OPTIMIZATION,this.onBufferingOptimization),this.dashPlayer.off(fe().EVENTS.WARNING,this.onWarning);var e=this.dashPlayer.getCorePlayer();e&&(e.off(fe().EVENTS.PLAYBACK_PROGRESS,this.onPlaybackProgress),e.off(fe().EVENTS.FRAGMENT_LOADING_HEADER_RECEIVED,this.onHttpHeaderReceived),e.off(fe().EVENTS.QUOTA_EXCEEDED,this.onQuotaExceeded),e.off("requestRetryed",this.onRequestRetried),e.off(fe().EVENTS.PREDICT_SEEK,this.onPredictSeek),e.off(fe().EVENTS.JUMP_MEDIA_GAP,this.onJumpMediaGap),e.off(fe().EVENTS.STREAM_BUFFERING_COMPLETED,this.onStreamBufferingCompleted))}},t.prototype.addProtectionEvents=function(){var e=this.dashPlayer.getCorePlayer();e.on(fe().EVENTS.KEY_ERROR,this.onKeyError),e.on(fe().EVENTS.KEY_MESSAGE,this.onKeyMessage),e.on(fe().EVENTS.KEY_SESSION_CLOSED,this.onKeySessionClosed),e.on(fe().EVENTS.KEY_SESSION_CREATED,this.onKeySessionCreated),e.on(fe().EVENTS.KEY_SESSION_REMOVED,this.onKeySessionRemoved),e.on(fe().EVENTS.KEY_STATUSES_CHANGED,this.onKeyStatusesChanged),e.on(fe().EVENTS.KEY_SYSTEM_SELECTED,this.onKeySystemSelected),e.on(fe().EVENTS.KEY_SYSTEM_ACCESS_COMPLETE,this.onKeySystemAccessComplete),e.on(fe().EVENTS.LICENSE_REQUEST_COMPLETE,this.onLicenseReqComplete),e.on(fe().EVENTS.PROTECTION_CREATED,this.onProtectionCreated),e.on(fe().EVENTS.PROTECTION_DESTROYED,this.onProtectionDestroyed)},t.prototype.removeProtectionEvents=function(){if(this.dashPlayer){var e=this.dashPlayer.getCorePlayer();e&&(e.off(fe().EVENTS.KEY_ERROR,this.onKeyError),e.off(fe().EVENTS.KEY_MESSAGE,this.onKeyMessage),e.off(fe().EVENTS.KEY_SESSION_CLOSED,this.onKeySessionClosed),e.off(fe().EVENTS.KEY_SESSION_CREATED,this.onKeySessionCreated),e.off(fe().EVENTS.KEY_SESSION_REMOVED,this.onKeySessionRemoved),e.off(fe().EVENTS.KEY_STATUSES_CHANGED,this.onKeyStatusesChanged),e.off(fe().EVENTS.KEY_SYSTEM_SELECTED,this.onKeySystemSelected),e.off(fe().EVENTS.KEY_SYSTEM_ACCESS_COMPLETE,this.onKeySystemAccessComplete),e.off(fe().EVENTS.LICENSE_REQUEST_COMPLETE,this.onLicenseReqComplete),e.off(fe().EVENTS.PROTECTION_CREATED,this.onProtectionCreated),e.off(fe().EVENTS.PROTECTION_DESTROYED,this.onProtectionDestroyed))}},t.prototype.onError=function(e){this.rootPlayer.emit(s.p.ERROR_DASH_KERNEL,e)},t.prototype.onHttpHeaderReceived=function(e){switch(e.request.mediaType){case"video":this.kernelStore.setState({vTag:Ve(e.headers,"x-service-module")});break;case"audio":this.kernelStore.setState({aTag:Ve(e.headers,"x-service-module")})}},t.prototype.onStreamBufferingCompleted=function(){this.rootPlayer.emit(s.p.PLAYER_STREAM_BUFFERING_COMPLETED)},t.prototype.onJumpMediaGap=function(e){var t={ct:null==e?void 0:e.time,des:null==e?void 0:e.seekToPosition,end:null==e?void 0:e.toEnd};this.track.o("jump_media_gap",t)},t.prototype.onPredictSeek=function(e){var t={ct:null==e?void 0:e.currentTime,des:null==e?void 0:e.destination};this.track.o("predict_seek",t)},t.prototype.onVideoInfo=function(e){var t=e.mediaInfo;t&&Object.keys(t).length&&this.menuStore.setVideoInfo(e,"DashPlayer")},t.prototype.onQualityRequested=function(e){if(e.isAutoSwitch&&"video"===e.mediaType){var t=this.dashPlayer.getQualityList(e.mediaType)[e.newQuality];this.track.o("auto_switch_requested",{oldQ:e.oldQualityNumber,newQ:e.newQualityNumber,bitrate:Math.floor(t.bitrate/1e3),throughput:e.dict&&e.dict.throughput}),this.qualityStore.qualityAtom.triggerRequestedEvent({mediaType:"video",isAutomatic:!0,oldQ:e.oldQualityNumber,newQ:e.newQualityNumber})}},t.prototype.onQualityRendered=function(e){if("video"===e.mediaType&&!isNaN(e.oldQuality))if(e.isAutoSwitch){var t=this.dashPlayer.getQualityList(e.mediaType)[e.newQuality];this.track.o("auto_switch_rendered",{oldQ:e.oldQualityNumber,newQ:e.newQualityNumber,bitrate:Math.floor(t.bitrate/1e3),throughput:e.dict&&e.dict.throughput}),this.qualityStore.qualityAtom.triggerRenderedEvent({mediaType:"video",isAutomatic:!0,oldQ:e.oldQualityNumber,newQ:e.newQualityNumber})}else e.newQualityNumber&&(this.log.i("[onQualityRendered]",e.newQualityNumber),this.qualityStore.setRenderedQuality(null,e.newQualityNumber))},t.prototype.onQuotaExceeded=function(e){var t=this.kernelStore.state.mseQuotaExceeded+1;this.kernelStore.setState({mseQuotaExceeded:t}),this.log.w("[QuotaExceeded]",t),this.dashPlayer&&this.dashPlayer.setStableBufferTime(30),this.track.o("quota_exceeded",{type:e.mediaType,cbl:e.criticalBufferLevel})},t.prototype.onPlaybackProgress=function(){var e=this.dashPlayer.getCorePlayer();if(e){var t=e.getBufferLength("audio"),r=e.getBufferLength("video");this.mediaStore.setState({aBufferLength:t,vBufferLength:r})}},t.prototype.onBufferingOptimization=function(e){this.track.o("buffering_optimization",{val:e&&e.type})},t.prototype.onWarning=function(e){e&&e.code&&e.msg&&-1!==e.code&&this.track.o("load_dash_warning",{code:e.code,msg:e.msg,srcUrl:e.detail&&e.detail.url},{exParam:this.kernelStore.serviceModule})},t.prototype.onRequestRetried=function(){if(this.episodeStore.isFirst&&!this.mediaStore.state.isMetadataLoaded)this.kernelStore.setState({streamRetries:++this.kernelStore.state.streamRetries});else{var e=this.dashPlayer.getCorePlayer();e&&e.off("requestRetryed",this.onRequestRetried)}},t.prototype.onKeyError=function(e){var t,r;this.log.e(e.type,null===(t=e.data)||void 0===t?void 0:t.error),this.mpdStore.fallback(5200,"onKeyError",null===(r=e.data)||void 0===r?void 0:r.error)},t.prototype.onKeyMessage=function(e){var t;this.log.i(e.type,null===(t=e.data)||void 0===t?void 0:t.messageType)},t.prototype.onKeySessionClosed=function(e){e.error?(this.log.e(e.type,e.error),this.mpdStore.fallback(5201,"onKeySessionClosed",e.error)):this.log.i(e.type)},t.prototype.onKeySessionCreated=function(e){e.error?(this.log.e(e.type,e.error),this.mpdStore.fallback(5201,"onKeySessionCreated",e.error)):this.log.i(e.type)},t.prototype.onKeySessionRemoved=function(e){e.error?(this.log.e(e.type,e.error),this.mpdStore.fallback(5201,"onKeySessionRemoved",e.error)):this.log.i(e.type)},t.prototype.onKeySystemSelected=function(e){var t,r;e.error?(this.log.e(e.type,e.error),this.mpdStore.fallback(5202,"onKeySystemSelected",e.error)):this.log.i(e.type,"ks:".concat(null===(r=null===(t=e.data)||void 0===t?void 0:t.mksa)||void 0===r?void 0:r.keySystem))},t.prototype.onKeySystemAccessComplete=function(e){e.error?(this.log.e(e.type,e.error),this.mpdStore.fallback(5203,"onKeySystemAccessComplete",e.error)):this.log.i(e.type)},t.prototype.onLicenseReqComplete=function(e){e.error?(this.log.e(e.type,e.error),this.mpdStore.fallback(5203,"onLicenseReqComplete",e.error)):this.log.i(e.type)},t.prototype.onKeyStatusesChanged=function(e){this.log.i(e.type)},t.prototype.onProtectionCreated=function(e){this.log.i(e.type)},t.prototype.onProtectionDestroyed=function(e){this.log.i(e.type)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.removePlayerEvents(),this.removeProtectionEvents(),this.dashPlayer&&(this.dashPlayer.destroy(),this.dashPlayer=null)},(0,n.gn)([i.ZP],t.prototype,"onError",null),(0,n.gn)([i.ZP],t.prototype,"onHttpHeaderReceived",null),(0,n.gn)([i.ZP],t.prototype,"onStreamBufferingCompleted",null),(0,n.gn)([i.ZP],t.prototype,"onJumpMediaGap",null),(0,n.gn)([i.ZP],t.prototype,"onPredictSeek",null),(0,n.gn)([i.ZP],t.prototype,"onVideoInfo",null),(0,n.gn)([i.ZP],t.prototype,"onQualityRequested",null),(0, n.gn)([i.ZP],t.prototype,"onQualityRendered",null),(0,n.gn)([i.ZP],t.prototype,"onQuotaExceeded",null),(0,n.gn)([i.ZP],t.prototype,"onPlaybackProgress",null),(0,n.gn)([i.ZP],t.prototype,"onBufferingOptimization",null),(0,n.gn)([i.ZP],t.prototype,"onWarning",null),(0,n.gn)([i.ZP],t.prototype,"onRequestRetried",null),(0,n.gn)([i.ZP],t.prototype,"onKeyError",null),(0,n.gn)([i.ZP],t.prototype,"onKeyMessage",null),(0,n.gn)([i.ZP],t.prototype,"onKeySessionClosed",null),(0,n.gn)([i.ZP],t.prototype,"onKeySessionCreated",null),(0,n.gn)([i.ZP],t.prototype,"onKeySessionRemoved",null),(0,n.gn)([i.ZP],t.prototype,"onKeySystemSelected",null),(0,n.gn)([i.ZP],t.prototype,"onKeySystemAccessComplete",null),(0,n.gn)([i.ZP],t.prototype,"onLicenseReqComplete",null),(0,n.gn)([i.ZP],t.prototype,"onKeyStatusesChanged",null),(0,n.gn)([i.ZP],t.prototype,"onProtectionCreated",null),(0,n.gn)([i.ZP],t.prototype,"onProtectionDestroyed",null),t}(Ue),Ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.internalQuality=NaN,t.tag="FlvAgent",t.kind=De.Flv,t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"realVQ",{get:function(){return this.internalQuality},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realAQ",{get:function(){return w.vJ},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"averageThroughput",{get:function(){try{return this.flvPlayer._transmuxer._controller._ioctl._speedSampler.averageKBps}catch(e){return 0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastSecondThroughput",{get:function(){try{return this.flvPlayer._transmuxer._controller._ioctl._speedSampler.lastSecondKBps/8}catch(e){return 0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernelPlayer",{get:function(){return this.flvPlayer},enumerable:!1,configurable:!0}),t.prototype.seek=function(e){this.video.currentTime=e},t.prototype.getPlayUrl=function(){try{return this.flvPlayer&&(this.flvPlayer.statisticsInfo.redirectedURL||this.flvPlayer.statisticsInfo.url)||e.prototype.getPlayUrl.call(this)}catch(t){return e.prototype.getPlayUrl.call(this)}},t.prototype.attachSource=function(t){e.prototype.attachSource.call(this,t);var r={enableWorker:!1,accurateSeek:!0,stashInitialSize:65536,seekType:this.data.seekType,rangeLoadZeroStart:!1,lazyLoadMaxDuration:100,lazyLoadRecoverDuration:50,deferLoadAfterSourceOpen:!1,fixAudioTimestampGap:!1,reuseRedirectedURL:!0};(_.X.safari.alike||_.X.edge.alike||_.X.trident.alike)&&(r.enableWorker=!1,r.lazyLoadMaxDuration=100),this.assetStore.flvjs.LoggingControl.forceGlobalTag=!0,this.assetStore.flvjs.LoggingControl.enableVerbose=!1,this.flvPlayer&&(this.w(),this.removePlayerEvents(),this.flvPlayer.destroy()),this.flvPlayer=this.assetStore.flvjs.createPlayer(this.data.mediaDataSource,r),this.flvPlayer.attachMediaElement(this.video),this.flvPlayer.load(),this.internalQuality=this.data.quality},t.prototype.attachEvent=function(){e.prototype.attachEvent.call(this),this.addPlayerEvents()},t.prototype.addPlayerEvents=function(){var e=this.assetStore.flvjs;e.LoggingControl.addLogListener(this.onEarlyEOF),this.flvPlayer.on(e.Events.ERROR,this.onError),this.flvPlayer.on(e.Events.LOADING_COMPLETE,this.onLoadingComplete),this.flvPlayer.on(e.Events.HTTP_HEADER_RECEIVED,this.onHttpHeaderReceived),this.flvPlayer.on(e.Events.STATISTICS_INFO,this.onVideoInfo),this.flvPlayer.on(e.Events.CTS_WARNING,this.onCtsWarning),this.flvPlayer.on(e.Events.FLV_DATA_ABNORMAL,this.onFlvDataAbnormal),this.flvPlayer.on(e.Events.RECOVERED_EARLY_EOF,this.onRecoveredEarlyEOF)},t.prototype.removePlayerEvents=function(){var e=this.assetStore.flvjs;e.LoggingControl.removeLogListener(this.onEarlyEOF),this.flvPlayer&&e&&(this.flvPlayer.off(e.Events.ERROR,this.onError),this.flvPlayer.off(e.Events.LOADING_COMPLETE,this.onLoadingComplete),this.flvPlayer.off(e.Events.HTTP_HEADER_RECEIVED,this.onHttpHeaderReceived),this.flvPlayer.off(e.Events.STATISTICS_INFO,this.onVideoInfo),this.flvPlayer.off(e.Events.CTS_WARNING,this.onCtsWarning),this.flvPlayer.off(e.Events.FLV_DATA_ABNORMAL,this.onFlvDataAbnormal),this.flvPlayer.off(e.Events.RECOVERED_EARLY_EOF,this.onRecoveredEarlyEOF))},t.prototype.onError=function(e,t,r){this.rootPlayer.emit(s.p.ERROR_FLV_KERNEL,e,t,r)},t.prototype.onLoadingComplete=function(e){try{var t=e.metadata.filesize,r=e.to,n=e.requestUrl;t&&r&&t!==r+1&&this.track.o("abnormal_segment_bytelength",{length:r+1,filesize:t,requestUrl:n})}catch(e){}},t.prototype.onHttpHeaderReceived=function(e,t,r){this.kernelStore.setState({aTag:null,vTag:Ve(r,"x-service-module")})},t.prototype.onVideoInfo=function(e){var t=this.flvPlayer.mediaInfo;t&&Object.keys(t).length&&this.menuStore.setVideoInfo({mediaInfo:t,statisticsInfo:e},this.flvPlayer.type)},t.prototype.onEarlyEOF=function(e,t){"string"==typeof t&&t.indexOf("code = -1, msg = Fetch stream meet Early-EOF")>-1&&(this.metricStore.earlyEOFSymbol||(this.track.o("range_early_eof"),this.metricStore.setEarlyEOFSymbol(!0)))},t.prototype.onCtsWarning=function(e){this.track.o("video_cts_warning",e?{cts:e.cts,dts:e.dts}:null)},t.prototype.onFlvDataAbnormal=function(e){this.track.o("flv_data_abnormal",e?{type:e.type,dts:e.dts}:null)},t.prototype.onRecoveredEarlyEOF=function(){this.errorStore.err(3,3114,"url:".concat(this.portStore.getPlayUrl(),",message:RecoveredEarlyEof"))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.removePlayerEvents(),this.flvPlayer&&(this.flvPlayer.destroy(),this.flvPlayer=null)},(0,n.gn)([i.ZP],t.prototype,"onError",null),(0,n.gn)([i.ZP],t.prototype,"onLoadingComplete",null),(0,n.gn)([i.ZP],t.prototype,"onHttpHeaderReceived",null),(0,n.gn)([i.ZP],t.prototype,"onVideoInfo",null),(0,n.gn)([i.ZP],t.prototype,"onEarlyEOF",null),(0,n.gn)([i.ZP],t.prototype,"onCtsWarning",null),(0,n.gn)([i.ZP],t.prototype,"onFlvDataAbnormal",null),(0,n.gn)([i.ZP],t.prototype,"onRecoveredEarlyEOF",null),t}(Ue),qe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="SeamlessAtom",t.offscreenVideo=!1,t.switchDisposer=null,t}return(0,n.ZT)(t,e),t.prototype.fakeSwitch=function(e,t){var r=this;this.log.i("[fakeSeamlessProxy]"),this.switchDisposer&&(this.switchDisposer(),this.switchDisposer=null);var n=this.rootStore,i=n.mediaStore,a=n.qualityStore,u=n.wmpStore,l=n.kernelStore,c="[fakeSeamless]",d=function(){var e=r.rootStore.qualityStore,t=Ne.nJ.alias.FHD_116,n=Ne.nJ.alias.UHD_4K,i=Ne.nJ.alias.UHD_8K,o=0;switch(e.state.nowQuality){case i:o+=1;break;case n:o+=.5;break;case t:o+=.25}switch(e.state.newQuality){case i:o+=1;break;case n:o+=.5;break;case t:o+=.25}if(2===e.state.newAudio)o+=1;return(0,P.Z)(6+o,5,8)}(),f=i.video,p=u.createNewVideoElement(a.state.newQuality,e.mediaDataSource.url),h=null,m=null,g=null,b=function(){clearTimeout(h),clearTimeout(m)},_=function(e){r.log.i(c,"currentTime:".concat(f.currentTime,",seekOffset:").concat(e));var t=f.currentTime+e;S(t)},E=function(e){v(p).then((function(){r.log.i(c,"[play:".concat(e,"] done"))})).catch((function(t){r.log.e(c,"[play:".concat(e,"] fail: ").concat(t&&t.message))}))},S=function(e){p.currentTime!==e&&(g?g.seek(e):p.currentTime=e)},A=function(e){clearTimeout(h),h=window.setTimeout((function(){r.log.i(c,"from:".concat(e)),C()}),1e3*(p.currentTime-f.currentTime)/f.playbackRate)},w=function(){if(x.forEach((function(e){f.removeEventListener(e.type,e.callback)})),k.forEach((function(e){p[e.prop]=null})),g)switch(g.kind){case De.Dash:(e=g.kernelPlayer)&&e.off(fe().EVENTS.ERROR,D);break;case De.Flv:var e;(e=g.kernelPlayer)&&e.off(r.rootStore.assetStore.flvjs.Events.ERROR,O)}},T=function(){r.log.w(c,"[catchPrimaryError]");var e=r.rootStore.mediaStore,t=e.state.paused,n=e.state.progressTime;S(n),t?p.pause():E("catchPrimaryError"),C()},R=function(){w(),b(),g&&(l.cacheLogTimely(g),g.dispose(),g=null),p.parentElement&&p.parentElement.removeChild(p),r.offscreenVideo=!1,r.switchDisposer=null},C=function(){r.log.i(c,"[done]"),r.switchDisposer=null,b(),w(),function(){if(!isNaN(f.duration)&&!f.error){var e=p.currentTime,t=f.currentTime,n=Math.abs(e-t),i=f.ended,o=f.paused,a=p.ended;(n>1||i||a)&&(p.currentTime=o?t:t+1*f.playbackRate, r.log.w(c,"[tryForceFixTime]","nc:".concat(e,",oc:").concat(t,",diff:").concat(n)),!a||i||o||(r.log.w(c,"[ForceSyncState]"),v(p).then((function(){r.log.i(c,"[ForceSyncState]","done")})).catch((function(e){r.log.e(c,"[ForceSyncState]","fail",e&&e.message)}))))}}(),r.rootStore.mediaStore.replaceElement(p),t(g),g&&(g.attachEvent(),r.log.i(c,"events attached"),g=null),r.offscreenVideo=!1,r.rootPlayer.emit(s.p.PLAYER_MEDIA_CHANGED)},I=function(e,n){r.log.e(c,"[fail]","from:".concat(e,";msg:").concat(n));var i=r.rootStore,o=i.wmpStore,a=i.qualityStore;o.isUseWasmPlayer(p)&&o.onWasmPlayerError(p,null==p?void 0:p.bwpError,!0),R(),a.setRenderedQuality(new Error(n),a.state.nowQuality),t(null)},D=function(e){var t=e?"type:".concat(e.type,";code:").concat(e.code,";msg:").concat(e.msg):null,n="[DASH]";r.log.e(c,n,t),I(n,t)},O=function(e,t,n){var i="type:".concat(e,";details:").concat(t,";code:").concat(null==n?void 0:n.code,";msg:").concat(null==n?void 0:n.msg),o="[FLV]";r.log.e(c,o,i),I(o,i)},x=[{type:"ratechange",callback:function(){p.playbackRate===f.playbackRate&&p.defaultPlaybackRate===f.defaultPlaybackRate||(p.playbackRate=f.playbackRate,p.defaultPlaybackRate=f.defaultPlaybackRate,r.log.i(c,"playbackRate:".concat(f.playbackRate)))},fireImmediately:!0},{type:"ratechange",callback:function(){A("RatechangeEvent")}},{type:"volumechange",callback:function(){p.volume=f.volume,r.log.i(c,"volume:".concat(f.volume))},fireImmediately:!0},{type:"play",callback:function(){E("PlayEvent")}},{type:"pause",callback:function(){p.pause()}},{type:"seeking",callback:function(){_(f.paused?0:1),A("SeekingEvent")}},{type:"error",callback:function(){T()}}],k=[{prop:"onloadedmetadata",callback:function(){f.error?T():(x.forEach((function(e){e.fireImmediately&&e.callback(),f.addEventListener(e.type,e.callback)})),f.paused?p.pause():E("LoadedmetadataEvent"),_(f.paused?0:3)),p.onloadedmetadata=null}},{prop:"oncanplay",callback:function(){f.paused&&p.paused&&(S(f.currentTime),A("CanplayEvent"))}},{prop:"onplaying",callback:function(){A("PlayingEvent")}},{prop:"onpause",callback:function(){f.paused&&p.paused?(S(f.currentTime),A("PauseEvent")):r.log.w(c,"drop-out of step")}},{prop:"onerror",callback:function(){var e=p.error,t=e&&"".concat(e.code,",").concat(e.message);I("[MEDIA]",t)}}];p.muted=!0,p.crossOrigin="anonymous",p.classList.add(y.cx),k.forEach((function(e){p[e.prop]=e.callback})),this.nodes.videoWrap.insertBefore(p,f),this.switchDisposer=R,this.offscreenVideo=!0;var N=function(e){var t;"dash"===e.mediaDataSource.type?((t=g=new Ye(r.rootStore,p,!0)).attachSource(e),t.kernelPlayer.on(fe().EVENTS.ERROR,D)):((t=g=new Ke(r.rootStore,p,!0)).attachSource(e),t.kernelPlayer.on(r.rootStore.assetStore.flvjs.Events.ERROR,O));clearTimeout(m),m=window.setTimeout((function(){r.log.w(c,"from:timeout(".concat(d,"s)")),C()}),1e3*d)};if("dash"===e.mediaDataSource.type)N(e);else"function"==typeof this.dc.isFlvOk&&this.dc.isFlvOk(),this.dc.isFlvOk=(0,o.gx)((function(){return!!r.rootStore.assetStore.flvjs}),(function(){return N(e)}))},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.switchDisposer&&(this.switchDisposer(),this.switchDisposer=null)},t}(u.f),ze=r(4117),Xe=r(50295),Qe=r(27687),Je=r(61224),$e=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="KernelAtom",r.isLoadStartChecked=!1,r.switchingTimer=-1,r.rootPlayer.on(s.p.PATCH_ADV_PLAY_ENDED,(function(){return r.setCachedStatus(null)})).on(s.p.MEDIA_ENDED,(function(){return r.setCachedStatus(null)})).on(s.p.MEDIA_PROGRESS,(function(){return r.setBufferPolicy()})).on(s.p.MEDIA_CANPLAY,(function(){return r.clearSwitchingTimer()})),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"agentKind",{get:function(){return this.baseAgent?this.baseAgent.kind:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flvKernel",{get:function(){return this.baseAgent&&this.baseAgent.kind===De.Flv?this.baseAgent.kernelPlayer:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dashKernel",{get:function(){return this.baseAgent&&this.baseAgent.kind===De.Dash?this.baseAgent.kernelPlayer:null},enumerable:!1,configurable:!0}),t.prototype.setCachedStatus=function(e){this.cachedStatus&&(e||this.log.i("[CacheStatus]","clear"),this.cachedStatus=e)},t.prototype.setBufferPolicy=function(){var e=this.rootStore,t=e.kernelStore,r=e.mediaStore,i=t.dashKernel,o=i&&i.getCorePlayer();if(i&&o){var a=r.video.currentTime,s=i.getStableBufferTime(),u=t.state.mseQuotaExceeded,l=(0,n.CR)(this.getDynamicBuffer(),6),c=(l[0],l[1]),d=l[2],f=l[3],p=l[4],h=l[5];if(u)return i.setStableBufferTime(p),void o.setBufferToKeep(h);sf&&sc&&s0?e.session&&parseInt(e.session[0],16)<8?"eg":"cg":""},t.prototype.getPlayerUserWhite=function(){var e=this.baseAgent&&this.baseAgent.getPlayUrl();if(!e)return"";switch(+(0,ze.eY)("uagrr",e)){case 1:return"eg1";case 2:return"eg2";case 3:return"cg";default:return""}},t.prototype.getDynamicBuffer=function(e){var t=this,r=this.rootStore,n=r.kernelStore,i=r.configStore,o=r.qualityStore,a=n.state.mseQuotaExceeded;if(a)return 1===a?[20,5,25,20,30,10]:[20,5,25,20,20,10];var s=[[20,5,40,20,70,20],[20,5,25,20,30,10],[60,5,60,20,70,20],[60,5,60,20,70,20],[40,5,50,20,70,20],[15,0,15,0,15,5]];return s[1]=this.get4KPlusDynamicBufferGroup(),s["number"==typeof e&&s[e]?e:i.isChannel(l.u5.Homepage)?5:o.realQ>=Ne.nJ.alias.UHD_4K?1:"eg"===t.getPlayerIdle()?2:"eg1"===t.getPlayerUserWhite()?3:"eg2"===t.getPlayerUserWhite()?4:void 0]||s[0]},t.prototype.get4KPlusDynamicBufferGroup=function(){var e,t,r=this.rootStore,n=r.kernelStore,i=r.qualityStore,o=[20,5,25,20,30,10],a=n.state.mseQuotaExceeded,s=n.dashKernel;if(a||!s)return o;try{if(_.X.safari.alike||_.X.chrome.alike){var u=i.realQ,l=null===(e=null==s?void 0:s.getCurrentTrackFor("video"))||void 0===e?void 0:e.bitrateList;if(null==l?void 0:l.length){var c=l.filter((function(e){return parseInt(e.id,10)===u}));if(null==c?void 0:c.length){var d=((null===(t=c[0])||void 0===t?void 0:t.bandwidth)||0)/1e3/1e3,f=5*Math.floor(150/(5*d/8*1.2));f=Math.min(f,70),f=Math.max(f,30),o[2]=30+Math.floor((f-30)/2),o[4]=f}}}}catch(e){}return o},t.prototype.checkMediaLoadStart=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t,r,i,a,s,u,l,c,d=this;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return this.isLoadStartChecked?[2]:this.rootStore.episodeStore.isFirst?_.X.microMessenger.alike?(e=this.rootStore,t=e.portStore,r=e.mediaStore,i=e.httpStore,a=(0,Xe.t)('
')),s=function(){a.onclick=null,(0,Qe.b)(a)},u=function(e){var r=d.nodes.container;if(e){var n=(0,Je.Q)(e,r.clientWidth||720);a.style.backgroundImage='url("'.concat(n,'")')}a.onclick=function(){return t.play().then(s)},r.appendChild(a)},r.state.isLoadStart?[3,2]:[4,i.fetchViewInfo(!0)]):(this.isLoadStartChecked=!0,[2]):[2];case 1:l=n.sent(),c=l&&l.body&&l.body.pic,u(c),n.label=2;case 2:return this.dc.isLoadStart&&this.dc.isLoadStart(),this.dc.isLoadStart=(0,o.gx)((function(){return r.state.isLoadStart}),(function(){return s()})),this.isLoadStartChecked=!0,[2]}}))}))},t.prototype.cacheMediaStatus=function(e){if(this.log.i("[CIS]","keep:".concat(e)),e){ var t=this.rootStore,r=t.mediaStore,n=t.configStore,i=t.patchAdvStore,o=i.hasValidAdv?i.getFakeCurrentTimePrefix():0,a=r.video,s=n.episodeId||n.cid,u=r.state,l=u.progressTime-o<0?0:u.progressTime-o,c=u.currentTime-o<0?0:u.currentTime-o,d=a.currentTime,f=u.paused,p=u.duration,h=l||c||d,y=this.cachedStatus,m=!y&&p-c<1&&0===l;if(!y||y.currentTime<1||s&&s!==y.vid||Math.abs(h-y.currentTime)>.1){var g="ended:".concat(a.ended,",paused:").concat(f,",seeking:").concat(a.seeking,",").concat(h,"/").concat(p,",cpt:").concat(l,",cct:").concat(c,",vct:").concat(d,",e2r:").concat(m);if(h<1&&!this.rootStore.patchAdvStore.hasValidAdv)return void this.log.i("[CIS]","ignored. ".concat(g));this.log.i("[CIS]",g),this.cachedStatus={vid:s,paused:f,currentTime:h}}}},t.prototype.attachSourceProxy=function(e){var t=this;this.log.i("[attachSourceProxy]"),this.clearBaseAgent();var r=this.rootStore,n=r.wmpStore,i=r.freeStore,a=r.mpdStore,s=r.mediaStore,u=function(e,r){(t.clearBaseAgent(),n.checkWasmPlayerSupported(e.quality,e.mediaDataSource.url),"dash"===e.mediaDataSource.type)?(t.baseAgent=new Ye(t.rootStore,s.video)).attachSource(e,r):(t.baseAgent=new Ke(t.rootStore,s.video)).attachSource(e);t.baseAgent.attachEvent(),t.checkMediaLoadStart().catch(Y.Z)};if("dash"===e.mediaDataSource.type)switch(a.drmTechType){case 3:var l=a.streamKid,c=i.guardAtom.getKeyDetail(l);this.abortKeyRequest&&this.abortKeyRequest(),this.abortKeyRequest=function(){return c.abort()},c.promise.then((function(r){t.log.i("[DRM:clearKeys]","done"),u(e,{protectionData:r.protectionData})})).catch((function(e){var r=e&&e.message;c.isAbort(e)?t.log.w("[DRM:clearKeys:abort]",r):(t.log.w("[DRM:clearKeys]",r),a.fallback(5100,"clearKeys",r))}));break;case 2:var d=i.guardAtom.getWidevineDetail();this.abortKeyRequest&&this.abortKeyRequest(),this.abortKeyRequest=function(){return d.abort()},d.promise.then((function(r){t.log.i("[DRM:widevine]","done"),u(e,{protectionData:r.protectionData,ignoreEmeEncryptedEvent:!0})})).catch((function(e){var r=e&&e.message;d.isAbort(e)?t.log.w("[DRM:widevine:abort]",r):(t.log.w("[DRM:widevine]",r),a.fallback(5300,"widevine",r))}));break;default:this.log.i("[attachSourceProxy]","plain stream"),u(e)}else"function"==typeof this.dc.isFlvOk&&this.dc.isFlvOk(),this.dc.isFlvOk=(0,o.gx)((function(){return!!t.rootStore.assetStore.flvjs}),(function(){return u(e)}))},t.prototype.clearBaseAgent=function(){this.baseAgent&&(this.log.i("[clearBaseAgent]"),this.rootStore.kernelStore.cacheLogTimely(this.baseAgent),this.baseAgent.dispose(),this.baseAgent=null)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.abortKeyRequest&&this.abortKeyRequest(),this.setCachedStatus(null),this.clearSwitchingTimer()},t}(u.f),et=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="KernelStore",r.kernelLogs=[],r.maxKernelLogs=10,(0,o.rC)(r),r.kernelAtom=new $e(t),r.seamlessAtom=new qe(t),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{fakeSwitching:!1,srcSwitching:!1,srcUpdating:!1,mseQuotaExceeded:0,aTag:null,vTag:null,streamRetries:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"retrySource",{get:function(){return this.state.srcSwitching||this.state.srcUpdating},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseAgent",{get:function(){return this.kernelAtom.baseAgent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"agentKind",{get:function(){return this.kernelAtom.agentKind},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flvKernel",{get:function(){return this.kernelAtom.flvKernel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dashKernel",{get:function(){return this.kernelAtom.dashKernel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cachedStatus",{get:function(){return this.kernelAtom.cachedStatus},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"serviceModule",{get:function(){var e=this.state.aTag||"",t=this.state.vTag||"";return this.flvKernel&&t?"vtag:".concat(t):this.dashKernel&&(e||t)?"vtag:".concat(t,",atag:").concat(e):null},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){e.prototype.onMount.call(this),this.kernelAtom.addReactions()},t.prototype.cacheLogTimely=function(e){if(e&&e.kind===De.Dash&&e.kernelPlayer){var t=e.kernelPlayer.getLogHistory().log;this.kernelLogs.push({kind:De.Dash,text:t,timeStamp:Date.now()}),this.kernelLogs.length>this.maxKernelLogs&&this.kernelLogs.shift()}},t.prototype.getPlayerIdle=function(){return this.kernelAtom.getPlayerIdle()},t.prototype.getPlayerUserWhite=function(){return this.kernelAtom.getPlayerUserWhite()},t.prototype.getDynamicBuffer=function(e){return this.kernelAtom.getDynamicBuffer(e)},t.prototype.getHistoryLogs=function(e,t){void 0===e&&(e=1);var r=this.kernelLogs,n=r.length,i=Math.min(e,n),o=r.slice(n-i).map((function(e){return e.text}));if(this.dashKernel){var a=this.dashKernel.getLogHistory();if(o.push(null==a?void 0:a.log),t)return{count:(null==a?void 0:a.length)||1,log:o.join("\n-------- Section --------\n")}}return o.join("\n-------- Section --------\n")},t.prototype.requestAudioTrack=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.dashKernel.switchAudioTrack(e)]}))}))},t.prototype.getAudioTrackId=function(){return this.dashKernel?this.dashKernel.getCurrentAudioTrackId():null},t.prototype.getAudioTrackList=function(){return this.dashKernel?this.dashKernel.getAudioTrackList():[]},t.prototype.attachExternal=function(e,t){var r=this,n=t.initiator,i=1===n,o=i||2===n||3===n;!!!this.mpdStore.drmTechType&&i&&this.portStore.getScreenKind()!==l.dY.Pip?(this.state.fakeSwitching&&this.log.w("dupe:fakeSwitching"),this.setState({fakeSwitching:!0}),this.seamlessAtom.fakeSwitch(e,(function(e){e&&(r.kernelAtom.clearBaseAgent(),r.kernelAtom.baseAgent=e),r.setState({fakeSwitching:!1})}))):(this.kernelAtom.cacheMediaStatus(o),this.kernelAtom.attachSourceProxy(e))},t.prototype.tryUpdateSource=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){var r=this;return(0,n.Jh)(this,(function(n){if("dash"!==e.mediaDataSource.type||!this.dashKernel)throw new Error("Illegal operation");return this.log.i("attachExternal:callUpdate"),this.state.srcUpdating&&this.log.w("dupe:srcUpdating"),this.setState({srcUpdating:!0}),[2,this.dashKernel.updateSource(e.mediaDataSource.url).then((function(){r.log.i("attachExternal:callUpdate","done"),r.track.o("video_retry_success",{from:t.from}),r.setState({srcUpdating:!1})})).catch((function(e){var n=e&&(e.msg||e.message);return r.log.w("attachExternal:callUpdate","fail",n),r.track.o("video_retry_fail",{from:t.from,msg:n}),r.setState({srcUpdating:!1}),Promise.reject(e)}))]}))}))},t.prototype.trySwitchSource=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var i,o=this;return(0,n.Jh)(this,(function(n){if("dash"!==e.mediaDataSource.type||!this.dashKernel)throw new Error("Illegal operation");return this.log.i("attachExternal:callSwitch"),this.state.srcSwitching&&this.log.w("dupe:srcSwitching"),this.setState({srcSwitching:!0}),i=JSON.parse(JSON.stringify(e.mediaDataSource.url)),[2,this.dashKernel.switchSource(i,t.preloadAVData,t.enableTransition,r).then((function(){o.portStore.play(),o.log.i("attachExternal:callSwitch","done"),o.setState({srcSwitching:!1})})).catch((function(e){var t=e&&(e.msg||e.message);return o.log.w("attachExternal:callSwitch","fail",t),o.setState({srcSwitching:!1}),Promise.reject(e)}))]}))}))},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.dashKernel,this.kernelAtom.clearBaseAgent(),this.baseAgent&&this.baseAgent.resetQualityReadyState()},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.baseAgent&&this.baseAgent.dispose()},(0,n.gn)([o.Fl],t.prototype,"retrySource",null),t}(u.u),tt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="RecoveryAtom",t.irc=0,t.retryCount=0,t.backupUrlIndex=0,t.resumeStartTime=0,t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"retryInterval",{get:function(){ var e=this.rootStore.pageHidden?15e3:9e3,t=3e3*(this.irc+1);return Math.min(t,e)},enumerable:!1,configurable:!0}),t.prototype.resetResuming=function(){this.resumeStartTime&&(this.resumeStartTime=0)},t.prototype.resetCounter=function(){this.backupUrlIndex=0,this.resumeStartTime=0},t.prototype.resume=function(e){var t=this,r="[Resume]",n=Date.now();if(this.resumeStartTime&&n-this.resumeStartTime<50)return this.log.w(r,"dupe,initiator:".concat(e));if(this.resumeStartTime=n,this.log.i(r,"initiator:".concat(e)),this.tryFlvBackupUrl(1))this.log.i(r,"try flv backup url");else{var i=this.rootStore.mpdStore.prefetchPlayUrl();this.retryHttp&&this.log.w(r,"http dupe"),this.retryHttp=i.http,i.promise.then((function(n){if(!(n&&n.body&&n.body.mediaDataSource))throw new Error("Invalid data");t.log.i(r,"playurl:done"),t.rootStore.kernelStore.tryUpdateSource({mediaDataSource:n.body.mediaDataSource,quality:n.body.quality},{from:5,initiator:e}).catch((function(){return t.infiniteRetry(e,50)})),t.retryHttp=null})).catch((function(n){t.log.w(r,"playurl:fail",n&&n.message),t.infiniteRetry(e,50),t.retryHttp=null}))}},t.prototype.getRetryCount=function(){return this.retryCount},t.prototype.abortRetry=function(){this.retryTimer&&(this.log.i("abortRetry"),clearTimeout(this.retryTimer),this.retryTimer=null,this.irc=0)},t.prototype.startRetry=function(e){this.infiniteRetry(e,50)},t.prototype.infiniteRetry=function(e,t){var r=this,n="[InfiniteRetry]";if(this.retryTimer)return this.log.w(n,"dupe,initiator:".concat(e));var i=0===this.irc&&t||this.retryInterval;this.log.i(n,"initiator:".concat(e,",interval:").concat(i)),clearTimeout(this.retryTimer),this.retryTimer=window.setTimeout((function(){r.retryTimer=null,r.rootStore.mpdStore.fetchPlayUrl(null,{initiator:e}),r.irc+=1,r.retryCount+=1}),i)},t.prototype.isUrlExpired=function(){var e=this.rootStore.portStore.getPlayUrl();if(!e)return!1;var t=Math.ceil(Date.now()/1e3),r=+((0,ze.eY)("expires",e)||(0,ze.eY)("wsTime",e)||(0,ze.eY)("txTime",e)||(0,ze.eY)("um_deadline",e)||(0,ze.eY)("deadline",e));return!!r&&t>r},t.prototype.tryFlvBackupUrl=function(e){var t,r,i=this,o=this.rootStore,a=o.kernelStore,s=o.mpdStore,u=o.qualityStore;if(!a.flvKernel)return!1;if(e>=this.backupUrlIndex)return!1;var l=!1,c={},d=[],f=s.body,p=f&&f.mediaDataSource;if(p&&Array.isArray(p.segments)){try{for(var h=(0,n.XA)(p.segments),y=h.next();!y.done;y=h.next()){var m=y.value,g=m.backupURL[this.backupUrlIndex],v={};if(!g){l=!1;break}(0,le.Z)(v,m),v.url=g,d.push(v),l=!0}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}l&&(0,le.Z)(c,p,{segments:d})}else if(p&&Array.isArray(p.backupURL)){(g=p.backupURL[this.backupUrlIndex])?(l=!0,(0,le.Z)(c,p,{url:g})):l=!1}return l&&(this.log.i("尝试使用备线","backupUrlIndex:".concat(this.backupUrlIndex)),this.backupUrlIndex+=1,a.tryUpdateSource({mediaDataSource:c,quality:u.requestQ},{from:4,initiator:2}).catch((function(){return i.infiniteRetry(2,50)}))),l},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.abortRetry(),this.resetResuming(),this.irc=0,this.retryCount=0,this.backupUrlIndex=0,this.resumeStartTime=0,this.retryHttp&&this.retryHttp.dispose(z.eV.LIFECYCLE_TOKEN)},t}(u.f),rt=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="ErrorAtom",r.recoveryAtom=new tt(t),r.rootPlayer.on(s.p.PLAYER_STORE_MOUNT,(function(){r.addReaction(),r.addStuckEvent(),r.addPlayUrlEvent(),r.addDashEvent(),r.addFlvEvent(),r.addMediaEvent()})),r}return(0,n.ZT)(t,e),t.prototype.addReaction=function(){var e=this;this.dc.retrySource=(0,o.U5)((function(){return e.rootStore.kernelStore.retrySource}),(function(t){return!t&&e.recoveryAtom.resetResuming()}))},t.prototype.addStuckEvent=function(){var e=this;this.rootPlayer.on(s.p.PLAYER_PLAYBACK_LAG,(function(){var t=e.rootStore,r=t.kernelStore,n=t.mediaStore,i=r.dashKernel;if(i){var o=n.video;if(i&&"function"==typeof i.isLoadingFragment){var a=i.getBufferLength("video"),s=i.getBufferLength("audio"),u=o.buffered,l="web_videoload_lag",c=u&&u.length>1?"".concat(l,",").concat(u.end(0),",").concat(u.start(1)):l;((isNaN(a)||a<.01)&&!i.isLoadingFragment("video")||(isNaN(s)||s<.01)&&!i.isLoadingFragment("audio"))&&e.errProxy(4100,c)}}}))},t.prototype.addPlayUrlEvent=function(){var e=this;this.rootPlayer.on(s.p.ERROR_PLAY_URL,(function(t,r,n){var i=e.rootStore,o=i.errorStore,a=i.kernelStore,s=i.configStore,u=i.qualityStore,l=i.mpdStore;switch(r){case 0:o.setState({initError:!0}),e.track.o(n?"bangumi_permission_error":"video_error",{code:3001,from:1,ecode:t&&t.code}),e.log.w("播放错误视频");var c=void 0===t.code?3001:t.code;o.setState({code:c}),a.attachExternal({quality:0,mediaDataSource:{type:"mp4",url:s.errorUrl}},{initiator:r});break;case 2:e.track.o("video_error",{code:3001,from:2,ecode:t&&t.code}),e.track.o("video_retry_fail",{from:2}),e.recoveryAtom.startRetry(2);break;case 1:e.track.o("video_error",{code:3001,from:3,ecode:t&&t.code}),u.setRenderedQuality(t,u.state.nowQuality);break;default:e.log.e("[PlayUrl]: UnhandledError"),e.track.o(n?"bangumi_permission_error":"video_error",{code:3001,from:0,ecode:t&&t.code})}e.log.i("[PlayUrlCode]",l.state.playUrlCode),e.notify(t.message,0)}))},t.prototype.addDashEvent=function(){var e=this;this.rootPlayer.on(s.p.ERROR_DASH_INITIALIZE,(function(t){e.errProxy(4e3,"dashPlayer initializing error."),e.recoveryAtom.startRetry(2),e.notify(t.message,1)})),this.rootPlayer.on(s.p.ERROR_DASH_KERNEL,(function(t){var r=e.rootStore,n=r.errorStore,i=r.qualityStore,o=fe().ERROR,a=0===i.quality;switch(n.setState({kernelError:!0}),t&&t.detail&&t.detail.httpCode&&e.track.o("load_videoerror_code",{code:t.detail.httpCode}),t&&t.code&&e.errProxy(t.code,t.msg),t&&t.code){case o.DURATION_IS_NOT_ALL_EQUAL:e.log.w("isAutoQuality:".concat(a,";").concat(t.msg)),a||e.recoveryAtom.resume(1);break;case o.MANIFEST_ERROR:case o.MANIFEST_TYPE_ERROR:case o.MANIFEST_RESOLVE_ERROR:case o.DOWNLOAD_MPD_ERROR:case o.DOWNLOAD_XINK_ERROR:e.recoveryAtom.resume(2);break;case o.MEDIA_SUPPORTED_ERROR:n.setState({disableNonDAQ:!0}),e.recoveryAtom.startRetry(2);break;case o.MEDIA_DECODE_ERROR:e.recoveryAtom.startRetry(2);break;case o.MEDIA_ERROR:case o.MEDIA_ABORTED_ERROR:case o.MEDIA_ENCRYPTED_ERROR:case o.MEDIA_NETWORK_ERROR:case o.MEDIA_UNKNOWN_ERROR:e.recoveryAtom.resume(2);break;case o.INTERNAL_ERROR:case o.DURATION_DEVIATION_IS_TOO_LARGE:case o.START_OFFSET_TIME_WARNING:case o.DOWNLOAD_FRAGMENT_ERROR_RETRY_SUCCESS:e.log.e("Fatal err or warning, retry is useless");break;case o.DOWNLOAD_ERROR:case o.DOWNLOAD_INIT_SEGMENT_ERROR:case o.DOWNLOAD_MEDIA_SEGMENT_ERROR:case o.DOWNLOAD_INDEX_SEGMENT_ERROR:case o.DOWNLOAD_SWITCHING_SEGMENT_ERROR:case o.DOWNLOAD_OTHER_ERROR:case o.DOWNLOAD_FRAGMENT_ERROR:case o.DOWNLOAD_FRAGMENT_ERROR_RETRY_FAILURE:case o.DOWNLOAD_FRAGMENT_ERROR_TIMEOUT:case o.CONNECT_FRAGMENT_ERROR_TIMEOUT:default:e.recoveryAtom.resume(2)}e.notify("".concat(t.code,";").concat(t.msg),2)}))},t.prototype.addFlvEvent=function(){var e=this;this.rootPlayer.on(s.p.ERROR_FLV_KERNEL,(function(t,r,n){var i=e.rootStore,o=i.errorStore,a=i.assetStore,s=a.flvjs.ErrorTypes,u=a.flvjs.ErrorDetails,l=n&&n.msg,c=n&&n.code,d="[".concat(t,"] ").concat(r,": ").concat(-1!==c?c:l);switch(o.setState({kernelError:!0}),t){case s.MEDIA_ERROR:switch(r){case u.MEDIA_MSE_ERROR:e.errProxy(3121,d);break;case u.MEDIA_FORMAT_ERROR:e.errProxy(3122,d);break;case u.MEDIA_FORMAT_UNSUPPORTED:e.errProxy(3123,d);break;case u.MEDIA_CODEC_UNSUPPORTED:e.errProxy(3124,d)}break;case s.NETWORK_ERROR:switch(r){case u.NETWORK_EXCEPTION:e.errProxy(3111,d);break;case u.NETWORK_STATUS_CODE_INVALID:e.track.o("load_videoerror_code",{code:c}),e.errProxy(3112,d);break;case u.NETWORK_UNRECOVERABLE_EARLY_EOF:e.errProxy(3113,d)}break;case s.OTHER_ERROR:default:if(r===u.ABNORMAL_SEGMENT_BYTELENGTH)e.track.o("abnormal_segment_bytelength_error"),e.errProxy(3125,d)}switch(t){case s.MEDIA_ERROR:case s.NETWORK_ERROR:case s.OTHER_ERROR:}e.isFlvKernel(!1)&&e.recoveryAtom.resume(2),e.notify("".concat(t,";").concat(r,";").concat(n.code,";").concat(n.msg),3)}))},t.prototype.addMediaEvent=function(){var e=this;this.rootPlayer.on(s.p.MEDIA_ERROR,(function(){ var t=e.rootStore,r=t.wmpStore,n=t.mediaStore,i=t.errorStore,o=t.qualityStore,a=r.isUseWasmPlayer(n.video),s=a?n.video.bwpError:n.video.error,u=null==s?void 0:s.code;if(s||console.warn("Illegal argument of [MediaError]"),a&&u>=7e3&&u<=7015&&(r.onWasmPlayerError(n.video,s),o.switchProxy()),4===u)i.setState({disableNonDAQ:!0});switch(u){case 1:case 3:case 4:e.isFlvKernel(!0)&&(e.errProxy(3104,"[MediaError] Exception: ".concat(null==s?void 0:s.message)),e.recoveryAtom.resume(2));break;default:e.isFlvKernel(!0)&&(e.errProxy(3104,"[NetworkError] Exception: 3104 Failed to fetch, ".concat(null==s?void 0:s.message)),e.recoveryAtom.resume(2))}e.notify(null==s?void 0:s.message,4)})),this.rootPlayer.on(s.p.MEDIA_CANPLAY,(function(){var t=e.rootStore.errorStore;t.state.kernelError&&t.setState({kernelError:!1})}))},t.prototype.errProxy=function(e,t){var r,n=this.rootStore,i=n.portStore,o=n.mpdStore,a=n.errorStore,s=i.getPlayUrl(),u=t&&t.replace(/,/g,"."),l=(null===(r=o.body)||void 0===r?void 0:r.streamType)||null,c="type:".concat(l,",url:").concat(s,",message:").concat(u);this.log.w("code:".concat(e,",").concat(c)),a.err(3,e,c)},t.prototype.isFlvKernel=function(e){var t=this.rootStore.kernelStore.flvKernel;return!!t&&(e?"FlvPlayer"!==t.type:"FlvPlayer"===t.type)},t.prototype.notify=function(e,t){var r="抛出一个错误...",n=null==t?r:"".concat(r,"(from:").concat(t,")"),i=this.rootStore.mediaStore,o="".concat(i.state.currentTime,"/").concat(i.state.bufferedTime);this.log.e(n,e,o)},t}(u.f),nt=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="ErrorStore",r.codeRecord={},r.errorAtom=new rt(t),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{initError:!1,kernelError:!1,disableNonDAQ:!1,occurredFatalError:!1,code:0}},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.disableNonDAQ=(0,o.gx)((function(){return t.state.disableNonDAQ}),(function(){return t.log.w("[NonDAQ]","disabled")}))},t.prototype.err=function(e,t,r){if(e){var n=r||!0,i=this.codeRecord[t];this.setState({occurredFatalError:!0}),i&&i===n||(this.codeRecord[t]=n,this.track.o("web_videoload_fail",{kind:e,code:t,msg:r}))}},t.prototype.abortRetry=function(){this.errorAtom.recoveryAtom.abortRetry()},t.prototype.resetCounter=function(){this.errorAtom.recoveryAtom.resetCounter()},t.prototype.getRetryCount=function(){this.errorAtom.recoveryAtom.getRetryCount()},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.codeRecord={}},t.prototype.occurredFatalErr=function(){return this.state&&this.state.occurredFatalError},t}(u.u),it=function(){function e(e){this.cfs=null,this.fss=[{fullscreenEnabled:"fullscreenEnabled",fullscreenElement:"fullscreenElement",onfullscreenchange:"onfullscreenchange",onfullscreenerror:"onfullscreenerror",requestFullscreen:"requestFullscreen",exitFullscreen:"exitFullscreen",fullscreenchange:"fullscreenchange",fullscreenerror:"fullscreenerror"},{fullscreenEnabled:"webkitFullscreenEnabled",fullscreenElement:"webkitFullscreenElement",onfullscreenchange:"onwebkitfullscreenchange",onfullscreenerror:"onwebkitfullscreenerror",requestFullscreen:"webkitRequestFullscreen",exitFullscreen:"webkitExitFullscreen",fullscreenchange:"webkitfullscreenchange",fullscreenerror:"webkitfullscreenerror"},{fullscreenEnabled:"mozFullScreenEnabled",fullscreenElement:"mozFullScreenElement",onfullscreenchange:"onmozfullscreenchange",onfullscreenerror:"onmozfullscreenerror",requestFullscreen:"mozRequestFullScreen",exitFullscreen:"mozCancelFullScreen",fullscreenchange:"mozfullscreenchange",fullscreenerror:"mozfullscreenerror"},{fullscreenEnabled:"msFullscreenEnabled",fullscreenElement:"msFullscreenElement",onfullscreenchange:"onmsfullscreenchange",onfullscreenerror:"onmsfullscreenerror",requestFullscreen:"msRequestFullscreen",exitFullscreen:"msExitFullscreen",fullscreenchange:"MSFullscreenChange",fullscreenerror:"MSFullscreenError"}],this.ele=e,this.doc=this.ele.ownerDocument||document,this.win=this.doc.defaultView||window;for(var t=0;t Fullscreen"),this.uiStore.setState({sideScreen:l.dY.Full})):this.uiStore.setState({mainScreen:this.getPastScreenDetails().kind,sideScreen:null})},t.prototype.onPipWindowResize=function(e){if(e.target){var t=e.target.width,r=e.target.height;"number"==typeof t&&"number"==typeof r&&this.uiStore.setState({pipWindowWidth:t,pipWindowHeight:r})}},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.exitBrowserScreen(l.dY.Pip),this.removeDelayEvents(),this.removeEvents()},(0,n.gn)([i.ZP],t.prototype,"onFullscreenChange",null),(0,n.gn)([i.ZP],t.prototype,"onFullscreenError",null),(0,n.gn)([i.ZP],t.prototype,"onPipChange",null),(0,n.gn)([i.ZP],t.prototype,"onPipEnter",null),(0,n.gn)([i.ZP],t.prototype,"onPipLeave",null),(0,n.gn)([i.ZP],t.prototype,"onPipWindowResize",null),t}(u.u),st=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmSend",t.url="//api.bilibili.com/x/v2/dm/post",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=e.data||{};return{code:e.code,message:e.message,dmid:t.dmid_str,visible:t.visible,action:t.action,animation:t.animation,dm_content:t.dm_content}},t}(z.eV),ut=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpFirstShowSend",t.url="//api.bilibili.com/x/v2/dm/post2",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=e.data||{};return{code:e.code,message:e.message,dmid:t.dmid_str,visible:t.visible,action:t.action,animation:t.animation}},t}(z.eV),lt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmCmdSend",t.url="//api.bilibili.com/x/v2/dm/command/post",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=e.data||{};return{code:e.code,message:e.message,dmid:t.idStr,extra:t.extra}},t}(z.eV),ct=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmCmdDel",t.url="//api.bilibili.com/x/v2/dm/command/del",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){return{code:e.code,message:e.message}},t}(z.eV),dt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpOnlineNum",t.url="//api.bilibili.com/x/player/online/total",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:e,withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t,r,n=null==e?void 0:e.data;return{total:(null==n?void 0:n.total)||"-",count:(null==n?void 0:n.count)||"<10",showSwitch:{total:null===(t=null==n?void 0:n.show_switch)||void 0===t?void 0:t.total,count:null===(r=null==n?void 0:n.show_switch)||void 0===r?void 0:r.count}}},t}(z.eV),ft=function(e){function t(t){var r=e.call(this,t)||this;return(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{status:null,mid:null,level:null,dmRights:null,focus:!1,forceOn:!1,err:null,webNum:"-",allNum:"-",showWeb:!0,showAll:!0,postPanelCard:null,outSendMsg:null}},enumerable:!1,configurable:!0}),t.prototype.onMounted=function(){var t=this;e.prototype.onMounted.call(this),this.configStore.fromDid&&(this.setState({forceOn:!0}),this.forceOn=!0),this.dc.dmVisible=(0,o.U5)((function(){return t.dmVisible}),(function(){t.rootPlayer.emit(a.t.Player_Danmaku_Change,new CustomEvent(a.t.Player_Danmaku_Change))})),this.dc.forceDm=(0,o.EH)((function(){t.forceOn=t.state.forceOn}))},t.prototype.onLoaded=function(t){e.prototype.onLoaded.call(this,t),this.setState({err:t.err,mid:t.mid,level:t.level,dmRights:t.dmRights})},Object.defineProperty(t.prototype,"status",{get:function(){var e,t,r=this.state.status,n=(e=this.danmakuStore.state).isViewLoaded,i=e.state,o=e.checkBox,a=this.userStore.info,s=this.state.status;if(!this.userStore.isLogin)return j.Rs.SEND_STATUS_LOGOUT;if(n)switch(i){case 0:o&&this.localStore.get().dmSend.upDm&&(r=j.Rs.SEND_STATUS_UP_DM);break;case 1:return j.Rs.SEND_STATUS_CLOSED;case 2:return j.Rs.SEND_STATUS_UPDATE}return"number"==typeof(null===(t=null==a?void 0:a.dmRights)||void 0===t?void 0:t.initStatus)&&(r=a.dmRights.initStatus),null!==s&&(r=s),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dmVisible",{get:function(){var e=this.dmSettingStore.state.dmSwitch,t=this.dmSettingStore.state.dmSwitchOut;return!this.danmakuStore.state.state&&(!!this.forceOn||("boolean"==typeof t&&(e=t),e))},enumerable:!1,configurable:!0}),t.prototype.send=function(e){return new st(this.rootPlayer).r((0,n.pi)((0,n.pi)({},e),{polaris_app_id:100,polaris_platform:5,spmid:this.configStore.spmId,from_spmid:this.configStore.spmIdFrom, statistics:this.configStore.statisticsReport}))},t.prototype.firstShowSend=function(e){return new ut(this.rootPlayer).r(e)},t.prototype.cmdSend=function(e){return new lt(this.rootPlayer).r(e)},t.prototype.cmdDel=function(e){return new ct(this.rootPlayer).r({dmid:e,oid:this.configStore.cid})},t.prototype.onlineNum=function(e){return new dt(this.rootPlayer,{noStore:!0}).r(e)},(0,n.gn)([o.Fl],t.prototype,"status",null),(0,n.gn)([o.Fl],t.prototype,"dmVisible",null),t}(u.u),pt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmid",t.url="//api.bilibili.com/x/v2/dm/thumbup/detail",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:e,withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=e.data||{};return{dmid:t.dmid_str,likes:t.likes||1,liked:t.user_like,mode:t.mode,color:t.color,size:t.font_size,pool:t.pool,attr:t.attr,stime:t.progress/1e3||0,text:t.msg||""}},t}(z.eV),ht=r(75678),yt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmReport",t.url="//api.bilibili.com/x/dm/report/add",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),mt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmForbid",t.url="//api.bilibili.com/x/v2/dm/filter/up/black",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),gt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmLike",t.url="//api.bilibili.com/x/v2/dm/thumbup/stats",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return this.ids=e.ids,[2,this.request({url:this.url,params:e,withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=null==e?void 0:e.data;if(t)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&t[r].id_str===this.ids)return{num:t[r].likes,liked:Boolean(t[r].user_like)};return null},t}(z.eV),vt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmLike",t.url="//api.bilibili.com/x/v2/dm/thumbup/add",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),bt=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="DanmakuStore",r.host="//api.bilibili.com/x/v2/dm/web/",r.basSegment={},r.loadAllDm=[],r.userChange=!1,r.pageSize=360,r.allSegment={},r.allHistory={},r.dmTrack=r.defaultTrack,r.dmTrackInfo={},r.cmdDmTrackInfo={},(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{textSide:"",cmdDm:null,addCmd:null,state:null,text:"",isViewLoaded:!1,checkBox:!1,basUrl:null,noStopDm:!0,reportDmid:null,expressions:null,postPanel:null,fragClose:null,updateDm:1,threeBody:null,ashAnimation:0,isFirstLoadSegment:!1,isHideInput:!1,maskWalls:null,sandDuneProps:[],marsResource:null,shooterResource:null,liveToVod:null}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultTrack",{get:function(){return{all:0,allbas:0,view:0,dm:0,bas:0,appendtime:0,dmnum:0,dmdetail:0,dmdetailfail:0,fail:"",dmSetIO:null,dmSize:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldShowMarsNode",{get:function(){var e=this.portStore.getCurrentTime();return this.state.marsResource&&this.state.marsResource.start<=e&&this.state.marsResource.end>=e&&this.sendStore.dmVisible},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldClearDmWhenEnterShooterTime",{get:function(){var e=this.portStore.getCurrentTime(),t=e-1;return this.state.shooterResource&&this.sendStore.dmVisible&&(e>=this.state.shooterResource.start&&t=this.state.shooterResource.end&&t=this.state.shooterResource.start&&tthis.pageSize/3&&(i=1.5),null===(r=e.postPanelV2)||void 0===r?void 0:r.length){var o=e.postPanelV2.map((function(e){return e.start||(e.start=0),e}));this.setState({postPanel:o})}this.loadDmPb(i),Array.isArray(e.specialDms)&&this.loadBasPb(e.specialDms)},t.prototype.loadDmPb=function(e,t){var r=this;if(void 0===e&&(e=1),!this.allSegment[e]){this.dmTrack.all++;var n=performance.now();this.allSegment[e]=this.fetchDmSeg(e).then((function(i){var o,a;r.dmTrack.dmSize+=Number((i.size/1024).toFixed(2));var s=(null===(o=i.details)||void 0===o?void 0:o.elems)||[],u=null===(a=i.details)||void 0===a?void 0:a.colorfulSrc;return s.forEach((function(e){if(e.colorful&&u.length){var t=u.find((function(t){return t.type===e.colorful}));t&&(e.colorfulImg=r.updateColorfulProtocol(t.src))}})),s.forEach((function(e){if(e.animation&&e.animation.includes("20031"))try{var t=JSON.parse(e.animation);20031===(null==t?void 0:t.id)&&(e.color=parseInt(t.font_color.slice(1)||"0",16)),e.animation=JSON.stringify(t)}catch(e){}})),r.dmListStore.state.metaResource.forEach((function(e){20017===e.id&&s.forEach((function(t){if(t.animation&&"string"==typeof t.animation){var r=JSON.parse(t.animation)||{};20017===r.id&&(r.resource="https://".concat(e.color_picture.resource),t.animation=JSON.stringify(r))}})),20025===e.id&&s.forEach((function(t){if(t.animation&&"string"==typeof t.animation){var r=JSON.parse(t.animation)||{};20025===r.id&&(r.resource="https://".concat(e.resource),t.animation=JSON.stringify(r))}}))})),r.log.i("[DmSeg]",JSON.stringify({error:i.error,len:s.length,segment:e})),i.error?(r.dmTrack.fail+="".concat(e,","),void r.dmTrack.dm++):(s.length&&(r.dmTrack.loadtime+=performance.now()-n,t?Array.prototype.push.apply(r.loadAllDm,s):r.appendDm(s)),s)})).then((function(e){return r.state.isFirstLoadSegment||r.danmakuStore.setState({isFirstLoadSegment:!0}),e}))}return this.allSegment[e]},t.prototype.appendDm=function(e){var t=performance.now();this.dmListStore.appendDm(e),this.dmTrack.appendtime+=performance.now()-t,this.dmTrack.dmnum+=(null==e?void 0:e.length)||0},t.prototype.loadBasPb=function(e){for(var t=this,r="",n=0;n0){var t="#LIVE#",r=e.find((function(e){return(null==e?void 0:e.command)===t}));if(r){var n=this.createLiveToVodDanmaku(r.text);return this.setState({liveToVod:n}),e.filter((function(e){return e.command!==t}))}}return e},(0,n.gn)([o.Fl],t.prototype,"shouldShowMarsNode",null),(0,n.gn)([o.Fl],t.prototype,"shouldClearDmWhenEnterShooterTime",null),(0,n.gn)([o.Fl],t.prototype,"isFirstEnterShooterTime",null),(0,n.gn)([o.Fl],t.prototype,"isPaused",null),(0,n.gn)([o.Fl],t.prototype,"canLoadAll",null),(0,n.gn)([i.ZP],t.prototype,"getDataFromLocalCacheFunc",null),t}(u.u),_t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpAdvVerify",t.url="//api.bilibili.com/x/dm/adv/state",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:e,withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=e.data||{};return{hasBuy:t.hasBuy,confirm:t.confirm,accept:t.accept,coins:t.coins}},t}(z.eV),Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpAdvBuy",t.url="//api.bilibili.com/x/dm/adv/buy",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){return e||{}},t}(z.eV);!function(e){e[e.Hide=-3]="Hide",e[e.None=-2]="None",e[e.NeedBuy=-1]="NeedBuy",e[e.Request=0]="Request",e[e.Confirm=1]="Confirm",e[e.Verification=2]="Verification",e[e.Reject=3]="Reject"}(je||(je={}));var St,At,wt,Tt=function(e){function t(t){var r=e.call(this,t)||this;return(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{advDm:null,testAdvDm:null,verifyState:je.None}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isShow",{get:function(){var e,t=(e=this.auxStore.state).currentMenu,r=e.isListSpread;return"ADV"===t&&r},enumerable:!1,configurable:!0}),t.prototype.send=function(e){return this.sendStore.send(e)},t.prototype.verify=function(){return new _t(this.rootPlayer).r({aid:this.configStore.aid,cid:this.configStore.cid,mode:"sp"})},t.prototype.buyVerify=function(){return new Et(this.rootPlayer).r({aid:this.configStore.aid,cid:this.configStore.cid,mode:"sp"})},(0,n.gn)([o.Fl],t.prototype,"isShow",null),t}(u.u),Rt=function(e){function t(t){var r=e.call(this,t)||this;return(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{basTest:null,showCodePanel:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isShowVisual",{get:function(){var e,t=(e=this.auxStore.state).currentMenu,r=e.isListSpread;return"BAS"===t&&r},enumerable:!1,configurable:!0}),t.prototype.test=function(e,t){var r=this;return new Promise((function(i,o){return(0,n.mG)(r,void 0,void 0,(function(){var r,a=this;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return e&&e.text?[3,1]:(o({code:-1,message:"请输入弹幕内容"}),[3,3]);case 1:return[4,(0,j.ae)()];case 2:r=n.sent(),r.default.parse({danmaku:e,success:function(e){a.setState({basTest:{dm:e,test:!t}}),i(e)},error:function(e){o({code:-1,message:"弹幕格式错误: "+e})}}),n.label=3;case 3:return[2]}}))}))}))},t.prototype.send=function(e,t){var r=this;return new Promise((function(i,o){return(0,n.mG)(r,void 0,void 0,(function(){var r,a,s=this;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return e&&e.text?[3,1]:(o({code:-1,message:"请输入弹幕内容"}),[3,3]);case 1:return r={type:1,oid:this.configStore.cid,msg:e.text,aid:this.configStore.aid,progress:Math.ceil(1e3*e.stime),color:1,fontsize:1,pool:2,mode:9,rnd:this.configStore.pid,plat:1},[4,(0,j.ae)()];case 2:a=n.sent(),a.default.parse({danmaku:e,success:function(n){t?s.dmListStore.delete(t).then((function(t){t.body&&0===t.body.code?s.sendStore.send(r).then((function(t){if(0===t.body.code&&t.body.dmid){var n=s.userStore.info;e.dmid=t.body.dmid,e.uhash=null==n?void 0:n.hashId,e.uname=(null==n?void 0:n.name)?n.name.split(" ")[0]:"",e.pool=r.pool,e.mode=r.mode,s.dmListStore.addDm(e),i(e)}else o({code:-2,message:"修改失败:弹幕被删除,请重新发送,".concat(t&&t.message?t.message:"")})})).catch((function(e){o({code:-1,message:"发送失败:接口请求失败"})})):o({code:-1,message:"修改失败:无权限或其他未知原因"})})).catch((function(e){o({code:-1,message:"修改失败:接口请求失败"})})):s.sendStore.send(r).then((function(t){if(0===t.body.code&&t.body.dmid){var n=s.userStore.info;e.dmid=t.body.dmid,e.uhash=null==n?void 0:n.hashId,e.uname=(null==n?void 0:n.name)?n.name.split(" ")[0]:"",e.pool=r.pool,e.mode=r.mode,s.dmListStore.addDm(e),i(e)}else o({code:-1,message:"发送失败:".concat(t.body&&t.body.message?t.body.message:"未知原因")})})).catch((function(e){o({code:-1,message:"发送失败:接口请求失败"})}))}}),n.label=3;case 3:return[2]}}))}))}))},(0,n.gn)([o.Fl],t.prototype,"isShowVisual",null),t}(u.u),Ct=r(76123),Pt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmRecall",t.url="//api.bilibili.com/x/v2/dm/recall",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),It=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmProtect",t.url="//api.bilibili.com/x/dm/protect/apply",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Dt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmMove", t.url="//api.bilibili.com/x/v2/dm/edit/pool",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Ot=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmState",t.url="//api.bilibili.com/x/v2/dm/edit/state",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),xt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmMonth",t.url="//api.bilibili.com/x/v2/dm/history/index",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,params:e,withCredentials:!0}).then((function(e){var t;return{body:null===(t=e.data)||void 0===t?void 0:t.data,response:e}}))]}))}))},t}(z.eV),kt=function(e){function t(t){var r=e.call(this,t)||this;return r.dmidApplied={},r.allDm=[],r.basList=[],r.dmModeMap={},(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{refresh:0,loadding:0,count:0,viewCount:0,addDm:null,addDmList:[],addBas:null,addBasList:[],addAdv:null,addAdvList:[],addCrossList:[],deletingDm:[],delDmid:[],searchId:"",allLoaded:!1,history:"",reverseDmSrc:[],metaResource:[],addReverseList:[],fireworkSrc:[]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multiViewBtn",{get:function(){var e;return null===(e=this.mpdStore.body)||void 0===e?void 0:e.clipInfoList},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realCount",{get:function(){var e,t=(e=this.state).viewCount,r=e.count;return e.allLoaded?r:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isShow",{get:function(){var e,t=(e=this.auxStore.state).currentMenu,r=e.isListSpread;return"LIST"===t&&r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canScrollTo",{get:function(){return Boolean(this.state.searchId&&this.state.allLoaded)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filteredAllDm",{get:function(){var e=this;return this.allDm.filter((function(t){var r;return t.dmid!==(null===(r=e.danmakuStore.state.liveToVod)||void 0===r?void 0:r.dmid)}))},enumerable:!1,configurable:!0}),t.prototype.addDm=function(e,t){void 0===t&&(t=!1);var r=Math.floor((e.stime/1e3||0)/this.danmakuStore.pageSize)+1;if(this.danmakuStore.allSegment[r]){var n=this.realCount;t||(this.allDm.push(e),++n);var i={};switch(this.state.allLoaded?i.count=n:i.viewCount=n,e.mode){case 7:e.weight=10,i.addAdv=e;break;case 9:e.weight=10,i.addBas=e,this.basList.push(e);break;default:e.weight||(e.weight=-Math.round(10*Math.random())),i.addDm=e}this.danmakuStore.dmTrack.dmnum++,this.setState(i)}},t.prototype.recall=function(e,t){var r=this,n=new Pt(this.rootPlayer),i=this.configStore.cid;return this.patchAdvStore.hasValidAdv&&t&&(i=t),n.r({dmid:e,cid:i,type:1}).then((function(t){if(0===t.body.code){for(var n=r.realCount,i={delDmid:[e]},o=0;o=4)&&this.isMineDanmaku(e)},t.prototype.setDMModeMap=function(e){this.dmModeMap[e]||(this.dmModeMap[e]=0),this.dmModeMap[e]++},t.prototype.getDMModeMap=function(){return this.dmModeMap},t.prototype.getMetaResourceById=function(e){var t,r;if(this.state.metaResource.length>0){try{for(var i=(0,n.XA)(this.state.metaResource),o=i.next();!o.done;o=i.next()){var a=o.value;if(a.id===e)return a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return null}return null},t.prototype.removeDuplicatesByDmid=function(e){try{var t=new Map;return(e=e.filter((function(e){return e}))).forEach((function(e){t.has(e.dmid)||t.set(e.dmid,e)})),Array.from(t.values())}catch(t){return e}},t.prototype.appendDm=function(e){var t=this;if(Array.isArray(e)){var r=1e3*this.mpdStore.dmStartOffset,i=this.configStore.cid,o=(0,n.ev)([],(0,n.CR)(this.state.addDmList),!1),a=[],s=[],u=[],l=[];e.forEach((function(e){var c,d;if((null===(d=e.text)||void 0===d?void 0:d.replace(/\r/g,""))&&!(e.stime1){if(![1,4,5,6].includes(e.mode))return}e.stime-=r;var f=(0,Ct.j)(e.animation),p=(c=f||{}).id,h=c.cid;if(20016===p)return h&&h!==i||t.allDm.push(e),1===f.direction?void l.push((0,n.pi)((0,n.pi)({},e),{effect:f,stime:e.stime/1e3||0})):void o.push(e);if(1002!==p){switch(e.mode){case 7:e.color=e.color||16777215,s.push(e);break;case 9:var y=(0,n.pi)((0,n.pi)({},e),{stime:e.stime/1e3||0});a.push(y),t.basList.push(y);break;default:if(t.configStore.fromDid===e.dmid)return;o.push(e)}t.allDm.push(e),t.setDMModeMap(e.mode)}else u.push((0,n.pi)((0,n.pi)({},e),{stime:e.stime/1e3||0}))}})),this.patchAdvStore.hasValidAdv&&(this.allDm=this.removeDuplicatesByDmid(this.allDm)),u.length&&_.X.cssVar&&this.setState({addCrossList:u}),l.length&&_.X.cssVar&&this.setState({addReverseList:l}),a.length&&this.setState({addBasList:a}),o.length&&this.setState({addDmList:o}),s.length&&this.setState({addAdvList:s}),this.state.viewCount||this.setState({count:this.allDm.length})}},t.prototype.reset=function(){this.allDm=[]},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.reset(),this.basList=[],this.loadAnimationZipPromise=null},(0,n.gn)([o.Fl],t.prototype,"multiViewBtn",null),(0,n.gn)([o.Fl],t.prototype,"realCount",null),(0,n.gn)([o.Fl],t.prototype,"isShow",null),(0,n.gn)([o.Fl],t.prototype,"canScrollTo",null),t}(u.u),Nt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpVote",t.url="//api.bilibili.com/x/v2/dm/command/vote/post",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Lt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpImg",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:e,responseType:"arraybuffer"})]}))}))},t}(z.eV),Mt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpCmdReserve",t.url="//api.bilibili.com/x/activity/reserve",t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(r){return[2,this.request({url:t?this.url+"/cancel":this.url, data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Ft=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpCmdScore",t.url="//api.bilibili.com/x/v2/dm/command/grade/post",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Ut=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpCmdShrink",t.url="//api.bilibili.com/x/v2/dm/command/user/conf",t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Bt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpCmdCheckin",t.url="//api.bilibili.com/x/v2/dm/command/checkin/record/add",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Gt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmGoodsLike",t.url="//api.bilibili.com//x/v2/dm/command/goods/add",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Vt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpCmdCmtime",t.url="//api.bilibili.com/x/v2/dm/command/cmtime/post",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Wt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpQoeReport",t.url="//api.bilibili.com/x/v1/govern/qoe/qoe_report",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,method:"POST",data:e,withCredentials:!0})]}))}))},t}(z.eV),jt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmUnBlock",t.url="//api.bilibili.com/x/dm/filter/user/add",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Ht=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmBlockBatch",t.url="//api.bilibili.com/x/dm/filter/user/add2",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=(e.data||[]).map((function(e){return{type:e.type,filter:e.filter,opened:!0,id:e.id}}));return{code:e.code,message:e.message,list:t}},t}(z.eV),Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmUnBlock",t.url="//api.bilibili.com/x/dm/filter/user/del",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:e.data,response:e}}))]}))}))},t}(z.eV),Yt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmBlockList",t.url="//api.bilibili.com/x/dm/filter/user",t}return(0,n.ZT)(t,e),t.prototype.r=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e=this;return(0,n.Jh)(this,(function(t){return[2,this.request({url:this.url,method:"get",withCredentials:!0}).then((function(t){return{body:e.parse(t.data),response:t}}))]}))}))},t.prototype.parse=function(e){var t,r=((null===(t=e.data)||void 0===t?void 0:t.rule)||[]).map((function(e){return{type:e.type,filter:e.filter,opened:!0,id:e.id}}));return{code:e.code,message:e.message,list:r}},t}(z.eV),Kt=r(82826);!function(e){e[e.Roll=1]="Roll",e[e.Bottom=4]="Bottom",e[e.Top=5]="Top",e[e.Reverse=6]="Reverse"}(St||(St={})),function(e){e[e.FireworkBillion=2e3]="FireworkBillion",e[e.FireworkBoom=2001]="FireworkBoom",e[e.Firework2022=2002]="Firework2022",e[e.Firework2023=2003]="Firework2023",e[e.Spring=2004]="Spring",e[e.Cross=2005]="Cross",e[e.PK=2006]="PK",e[e.BlackHole=2007]="BlackHole",e[e.PrefixImage=2008]="PrefixImage",e[e.SuffixImage=2009]="SuffixImage",e[e.UpProfile=2010]="UpProfile",e[e.Guest=2011]="Guest",e[e.Colorful=2012]="Colorful",e[e.Yanwen=2013]="Yanwen",e[e.Picture=2014]="Picture",e[e.Sand=2015]="Sand",e[e.HarryPotter=2016]="HarryPotter",e[e.Mars=2017]="Mars",e[e.Shooter=2018]="Shooter"}(At||(At={})),function(e){e[e.Combo=3e3]="Combo",e[e.Link=3001]="Link",e[e.Score=3002]="Score",e[e.ScoreSum=3003]="ScoreSum",e[e.ClockIn=3004]="ClockIn",e[e.Follow=3005]="Follow",e[e.Vote=3006]="Vote",e[e.Reserve=3007]="Reserve",e[e.Rewardfans=3008]="Rewardfans",e[e.GoodsLike=3009]="GoodsLike",e[e.SuperRating=3010]="SuperRating",e[e.Cmtime=3011]="Cmtime",e[e.QoeFeedback=3012]="QoeFeedback"}(wt||(wt={}));var qt={blockScroll:[St.Roll],blockTopBottom:[St.Top,St.Bottom],blockColor:[At.Colorful,At.Sand,At.BlackHole,At.PrefixImage,At.SuffixImage,At.Yanwen,At.Firework2022,At.Firework2023,At.FireworkBillion,At.FireworkBoom,At.Spring,St.Top,St.Bottom,St.Roll,St.Reverse],blockSpecial:[At.Cross,At.Colorful,At.Sand,At.Firework2022,At.Firework2023,At.FireworkBillion,At.FireworkBoom,At.Spring,At.PK,At.Yanwen,At.PrefixImage,At.SuffixImage,At.Guest,At.BlackHole,At.Picture,At.UpProfile,wt.Combo,At.HarryPotter,At.Mars,At.Shooter],preventShade:[St.Bottom]},zt=function(e){function t(t){var r=e.call(this,t)||this;return r.blockList=[],r.totalFiltleredDm=0,r.lowWeightDm=0,r.DmBlockMap=qt,r.dmMap=new Map,(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{isSyncBlocked:!1,refresh:1}},enumerable:!1,configurable:!0}),t.prototype.addReportFilter=function(e){this.reportFilter?this.reportFilter.push(e):this.reportFilter=[e]},Object.defineProperty(t.prototype,"isShow",{get:function(){var e,t=(e=this.auxStore.state).currentMenu,r=e.isListSpread;return"BLOCK"===t&&r},enumerable:!1,configurable:!0}),t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this);var t=this.rootStore.localStore.get();this.blockList=t.blockList},t.prototype.onLoaded=function(t){(e.prototype.onLoaded.call(this,t),t.mid)&&(this.rootStore.localStore.get().lastUid!==t.mid&&this.blockList.forEach((function(e){e.id=0})))},t.prototype.add=function(e,t,r){var n,i=this,o=null===(n=this.userStore.info)||void 0===n?void 0:n.mid,a=this.isBlocked(e,t);if(!r&&a)return Promise.resolve({code:-1,message:"屏蔽词已存在"});var s={code:-1,message:"屏蔽词已添加"};return o?new jt(this.rootPlayer).r({type:t,filter:e}).then((function(n){var o,u=(null===(o=n.body.data)||void 0===o?void 0:o.id)||0;return r&&a?(a.rule.id=u,i.addLocal()):(i.blockList.push({type:t,filter:e,opened:!0,id:u}),i.addLocal()),s.code=0,s})).catch((function(){return i.blockList.push({type:t,filter:e,opened:!0,id:0}),i.addLocal(),s})):(this.blockList.push({type:t,filter:e,opened:!0,id:0}),this.addLocal(),Promise.resolve(s))},t.prototype.blockUserList=function(e){var t=this;return new Ht(this.rootPlayer).r({type:2,filters:e.join(",")}).then((function(e){var r=e.body;t.blockList=t.noRepeat(r.list),t.addLocal() })).catch((function(){var r=e.map((function(e){return{type:2,filter:e,opened:!0,id:0}}));t.blockList=t.noRepeat(r),t.addLocal()}))},t.prototype.addLocal=function(){this.localStore.set({blockList:this.blockList},!0),this.setState({refresh:this.state.refresh+1}),this.dmListStore.refresh(),this.dmSettingStore.refresh(),this.setLastUid()},t.prototype.isBlocked=function(e,t){for(var r,n,i=0;i=7)?j.Rs.BLOCK_SPECIAL:j.Rs.BLOCK_DISABLED)},t.prototype.isBlockDanmaku=function(e,t){var r;if(void 0===t&&(t=!1),e.border)return!1;if(this.judgeWord(e))return!0;var n=(r=this.dmSettingStore.state).typeScroll,i=r.typeTopBottom,o=r.typeColor,a=r.typeSpecial,s=r.seniorMode,u=r.preventshade,l=!i,c=!o,d=!a,f=!n,p=e.mode;if(!t){if(this.aiJudge(e,this.dmSettingStore.aiLevel))return!0;if(this.reportFilterReg(e))return!0}if(s&&e.weight<=10)return!0;if(e.colorful&&c)return!0;if(f&&this.DmBlockMap.blockScroll.includes(p))return!0;if(l&&this.DmBlockMap.blockTopBottom.includes(p))return!0;if(d&&(this.DmBlockMap.blockSpecial.includes(p)||2===e.pool))return!0;if(c&&qt.blockColor.includes(p))if(p===St.Top||p===St.Bottom||p===St.Roll||p===St.Reverse||p===At.BlackHole||p===At.Yanwen||p===At.PrefixImage||p===At.SuffixImage){if(e.color&&"#FFFFFF"!==(0,Kt.X)(e.color).toUpperCase())return!0}else if(p===At.Colorful&&(1===e.modeInfo.color_type&&e.modeInfo.font_color&&"#FFFFFF"!==e.modeInfo.font_color.toUpperCase()||e.resource.url&&""!==e.resource.url))return!0;return!(!u||!qt.preventShade.includes(p))},t.prototype.filterRegexp=function(e){var t=/^\/(.+)\/([img]{0,3})$/.exec(e);try{return new RegExp(t[1],t[2])}catch(t){return new RegExp(e)}},t.prototype.noRepeat=function(e,t){var r={},n=this.blockList||[];n.length&&n.forEach((function(e){var t=e.type,n=e.filter,i=0===t?t+n.toLowerCase():t+n;r[i]=e})),Array.isArray(e)&&e.length&&e.forEach((function(e){if(e){t&&(e.id=0);var n,i=e.type,o=e.filter;if(o)if(n=0===i?i+o.toLowerCase():i+o,r[n]){if(t)return;r[n].id=e.id}else r[n]=e}}));var i=[];for(var o in r)i.push(r[o]);return i},Object.defineProperty(t.prototype,"dmAiBlockAbTestFlag",{get:function(){var e;return"NEW"===(null===(e=window.webAbTest)||void 0===e?void 0:e.danmuku_block_version)},enumerable:!1,configurable:!0}),t.prototype.setLastUid=function(){var e,t=null===(e=this.userStore.info)||void 0===e?void 0:e.mid;t&&this.localStore.set({lastUid:t})},t.prototype.onUnload=function(){this.track.e("ai_block_stat",{lowWeightDm:this.lowWeightDm,totalFiltleredDm:this.totalFiltleredDm}),this.lowWeightDm=0,this.totalFiltleredDm=0},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,!0),this.reportFilter=null},(0,n.gn)([o.Fl],t.prototype,"isShow",null),t}(u.u),Xt=function(e){function t(t){var r=e.call(this,t)||this;return(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{updateCmdList:null,addCmdList:null,voteId:null,shortcutVoteId:null,shortcutTime:null,scoreGrade:null,upEgg:null,wordCloud:null,wordCloudSelfItem:null,voteOptions:null,insideW:0,insideH:0,businessConfig:null}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cmdVisible",{get:function(){return this.configStore.isCreator()||this.sendStore.dmVisible},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.configStore.isChannel(l.u5.Creator)},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.cmdDm=(0,o.U5)((function(){return t.danmakuStore.state.cmdDm}),(function(e){t.creator||(null==e?void 0:e.length)&&t.appendCmd(e)})),this.dc.resize=(0,o.U5)((function(){return{height:t.uiStore.state.containerHeight,width:t.uiStore.state.containerWidth,isMetadataLoaded:t.mediaStore.state.isMetadataLoaded,videoNodeWidth:t.uiStore.state.videoNodeWidth,videoWidth:t.mediaStore.state.videoWidth}}),(function(e){var r=e.height,n=e.width,i=e.isMetadataLoaded,o=e.videoNodeWidth,a=e.videoWidth;i&&n&&r&&o&&a&&t.resize()}),{fireImmediately:!0})},t.prototype.resize=function(){var e,t=this.rootStore,r=this.mediaStore.video,n=(r.videoHeight,r.videoWidth,(e=this.uiStore.state).videoNodeHeight),i=e.videoNodeWidth;t.nodes.cmdInside.style.cssText="width:".concat(i,"px;height:").concat(n,"px;"),this.setState({insideW:i,insideH:n})},t.prototype.appendCmd=function(e){if(!this.creator){var t,r=[];e.forEach((function(e){try{t=JSON.parse(e.extra)}catch(e){}if(t&&"#ENCOURAGE#"===e.command){var n=e.stime/1e3||0;r.push({from:n,to:n+(t.duration/1e3||5),duration:t.duration/1e3||5,resource:t.resource,positionType:t.position_type,dms:t.dms})}})),r.length&&this.setState({wordCloud:r})}},t.prototype.vote=function(e,t,r,n,i,o){return new Nt(this.rootPlayer).r({aid:this.configStore.aid,cid:this.configStore.cid,progress:Math.round(1e3*n),vote_id:e,vote_type:t,cmd_id_str:o,option_id:r,has_self_def:i,polaris_app_id:100,polaris_platform:5,spmid:this.configStore.spmId,from_spmid:this.configStore.spmIdFrom,statistics:this.configStore.statisticsReport})},t.prototype.getImg=function(e){return new Lt(this.rootPlayer).r(e)},t.prototype.reserve=function(e,t){return new Mt(this.rootPlayer).r(e,t)},t.prototype.score=function(e,t){return new Ft(this.rootPlayer).r(e)},t.prototype.shrink=function(e,t){return new Ut(this.rootPlayer).r(e)},t.prototype.checkin=function(e,t){return new Bt(this.rootPlayer).r(e)},t.prototype.goodsLike=function(e,t){return new Gt(this.rootPlayer).r(e)},t.prototype.cmtime=function(e,t){return new Vt(this.rootPlayer).r(e)},t.prototype.qoeFeedback=function(e){return new Wt(this.rootPlayer).r(e)},t.prototype.editorCenter=function(e){if(this.mediaStore.state.isMetadataLoaded)try{var t=JSON.parse(e);if(!t)return;var r=this.state.updateCmdList||[];for(var i in t){var o=t[i]||[];switch(i){case"dm2":this.editorLink(o,r);break;case"dm5":this.editorFollow(o,r);break;case"dm8":this.editorCombo(o,r);break;case"dm10":this.editorReserve(o,r);break;case"dm11":this.editorScore(o,r);break;case"dm14":this.editorClock(o,r);break;case"dm18":this.editorGoods(o,r);break;case"dm20":this.editorCmtime(o,r)}}this.setState({updateCmdList:(0,n.ev)([],(0,n.CR)(r),!1)})}catch(e){console.warn(e)}},t.prototype.editorFollow=function(e,t){ if(!(null==e?void 0:e.length))return t.push({mode:wt.Follow,delete:!0});e.forEach((function(e){var r,n=(r=e||{}).key,i=r.type,o=r.dmid,a=r.text,s=r.from,u=r.to,l=r.pos_x,c=r.pos_y,d=r.face,f=r.mid,p=r.electricGuide,h=r.question,y=r.options,m=r.electricIcon,g=r.electricStatus,v=u-s;9===i?t.push({mode:wt.Vote,dmid:o,text:h,stime:s,duration:v,modeInfo:{key:n,type:i,face:d,mid:f,options:y,duration:v,posX:l,posY:c}}):t.push({mode:wt.Follow,dmid:o,text:a,stime:s,duration:v,modeInfo:{key:n,type:i,face:d,mid:f,electricGuide:p,posX:l,posY:c,electricIcon:m,electricStatus:g}})}))},t.prototype.editorLink=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.Link,delete:!0});e.forEach((function(e){var r,n=(r=e||{}).key,i=r.dmid,o=r.data,a=r.from,s=r.to,u=r.posX,l=r.posY;t.push({mode:wt.Link,dmid:i,text:o.msg,stime:a,duration:s-a,modeInfo:{key:n,posX:u,posY:l,arcPic:o.arcPic,arcType:o.arcType}})}))},t.prototype.editorCombo=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.Combo,delete:!0});e.forEach((function(e){var r,n=(r=e||{}).key,i=r.dmid,o=r.text,a=r.stime,s=r.duration,u=r.count,l=r.step,c=r.url;t.push({mode:wt.Combo,dmid:i,text:o,stime:a,duration:s,modeInfo:{key:n,count:u,step:l,resource:c}})}))},t.prototype.editorReserve=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.Reserve,delete:!0});e.forEach((function(e){var r=e||{},n=r.key,i=r.dmid,o=r.text,a=r.from,s=r.to-a;t.push({mode:wt.Reserve,dmid:i,text:o,stime:a,duration:s,modeInfo:{key:n,duration:s,posX:r.posX,posY:r.posY,count:r.count,liveTime:r.liveTime,liveState:r.liveState,popularity:r.popularity,popularityStr:r.popularityStr,liveTimeFormat:r.liveTimeFormat,state:r.state,jump:r.jump,live:r.live,reserveType:r.reserveType,arcTime:r.arcTime,arcTimeFormat:r.arcTimeFormat,desc:r.desc}})}))},t.prototype.editorScore=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.Score,delete:!0});e.forEach((function(e){var r,n,i=(r=e||{}).key,o=r.dmid,a=r.from,s=r.to,u=r.pos_x,l=r.pos_y,c=(n=r.data||{}).summary,d=n.summaryList,f=n.msg,p=n.skin,h=n.skinUnselected,y=n.count,m=(n.id,s-a);c?t.push({mode:wt.ScoreSum,dmid:o,text:f,stime:a,duration:m,modeInfo:{key:i,duration:m,posX:u,posY:l,summaryList:d}}):t.push({mode:wt.Score,dmid:o,text:f,stime:a,duration:m,modeInfo:{key:i,count:y,skin:p,duration:m,skinUnselected:h,posX:u,posY:l}})}))},t.prototype.editorClock=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.ClockIn,delete:!0});e.forEach((function(e){var r,n,i=(r=e||{}).key,o=r.dmid,a=r.from,s=r.to,u=r.pos_x,l=r.pos_y,c=(n=r.data||{}).total,d=n.endClock,f=n.msg,p=n.type;t.push({mode:wt.ClockIn,dmid:o,text:f,stime:a,duration:s-a,modeInfo:{key:i,type:p,total:c,endClock:d,posX:u,posY:l}})}))},t.prototype.editorGoods=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.GoodsLike,delete:!0});e.forEach((function(e){var r,n,i=(r=e||{}).key,o=r.dmid,a=r.from,s=r.to,u=r.pos_x,l=r.pos_y,c=(n=r.data||{}).msg,d=n.type,f=n.keyword,p=n.button_selected,h=n.button_unselected,y=n.button_icon,m=n.desc,g=n.item_id_str,v=n.item_image,b=n.user_sub;t.push({mode:wt.GoodsLike,dmid:o,text:c,stime:a,duration:s-a,modeInfo:{key:i,type:d,posX:u,posY:l,keyword:f,itemIdStr:g,itemImage:v,userSub:b,desc:m,buttonSelected:p,buttonUnSelected:h,buttonIcon:y}})}))},t.prototype.editorCmtime=function(e,t){if(!(null==e?void 0:e.length))return t.push({mode:wt.Cmtime,delete:!0});e.forEach((function(e){var r,n=(r=e||{}).key,i=r.dmid,o=r.from,a=r.to,s=r.pos_x,u=r.pos_y,l=r.data,c=r.realTo;t.push({mode:wt.Cmtime,dmid:i,text:"",stime:o,duration:a-o,modeInfo:{key:n,posX:s,posY:u,upSlogan:l.upSlogan,upSloganIcon:l.upSloganIcon,ifSupported:l.ifSupported,realTo:c}})}))},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.upMid=null},(0,n.gn)([o.Fl],t.prototype,"cmdVisible",null),(0,n.gn)([o.Fl],t.prototype,"creator",null),t}(u.u),Qt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmSkip",t.url="//api.bilibili.com/x/player/card/click",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,data:e,method:"post",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){return{code:e.code,message:e.message}},t}(z.eV),Jt=function(e){function t(t){var r=e.call(this,t)||this;return(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skips",{get:function(){var e,t,r=null===(e=this.userStore.info)||void 0===e?void 0:e.operationCard,n=null===(t=this.mpdStore.body)||void 0===t?void 0:t.isPreview,i=this.interactStore.renderInteractionTPL;return n||i?null:r},enumerable:!1,configurable:!0}),t.prototype.jumpCard=function(e){return new Qt(this.rootPlayer).r(e)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this)},(0,n.gn)([o.Fl],t.prototype,"skips",null),t}(u.u),$t=r(96453),er=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmMask",t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){return[2,this.request({url:t.url,responseType:"arraybuffer",headers:{range:t.range}})]}))}))},t}(z.eV),tr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.maskTrack={hasMask:0,browser:null,supportMask:0,invalidGPU:0},t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{maskUrl:"",fps:24,maxfps:24,disable:!1}},enumerable:!1,configurable:!0}),t.prototype.onLoaded=function(t){if(e.prototype.onLoaded.call(this,t),t.dmMask&&(this.maskTrack.hasMask=1,this.maskTrack.browser=_.X.info,this.maskTrack.invalidGPU=+this.configStore.invalidGPU),t.dmMask&&_.X.chrome.alike&&!_.X.edge.alike&&!this.configStore.invalidGPU){this.maskTrack.supportMask=1;var r=t.dmMask,n=r.maskUrl,i=r.fps;n?this.setState({maxfps:i,maskUrl:n}):this.setState({maskUrl:""})}},t.prototype.isPointFillInMask=function(e,t,r){var i,o,a;this.nodes.dmSvgMaskWrap.innerHTML="",this.dmMaskSvg&&(this.nodes.dmSvgMaskWrap.appendChild(this.dmMaskSvg),this.dmMaskSvgInfo=this.generateDmMaskSvgInfo(this.dmMaskSvg));var s=null===(a=this.dmMaskSvgInfo)||void 0===a?void 0:a.detail;if(!s)return!1;try{var u=s.svgOriginalWidth,l=s.svgOriginalHeight,c=s.svgPoint,d=s.inverseCTM,f=s.paths,p=r.width,h=r.height,y=this.mediaStore.video.videoHeight,m=this.mediaStore.video.videoWidth;if(y>m){var g=h*(m/y),v=Math.min(g,p),b=Math.max(0,(p-v)/2);if(eb+v)return!0;var _=(e-b)/v,E=t/h;if(_<0||_>1||E<0||E>1)return!0;c.x=_*u,c.y=E*l}else c.x=e/p*u,c.y=t/h*l;var S=c.matrixTransform(d);c.x=S.x,c.y=S.y;try{for(var A=(0,n.XA)(f),w=A.next();!w.done;w=A.next()){var T=w.value;if(null==T?void 0:T.isPointInFill(c))return!0}}catch(e){i={error:e}}finally{try{w&&!w.done&&(o=A.return)&&o.call(A)}finally{if(i)throw i.error}}return!1}catch(e){return!1}},t.prototype.generateDmMaskSvgInfo=function(e){var t={detail:null,hasActiveMask:Boolean(e)};if(!e)return t;try{var r=e.querySelector("g");if(!(null==r?void 0:r.getCTM))return t;var n=r.getCTM();if(!(null==n?void 0:n.inverse))return t;var i=e.getAttribute("viewBox"),o=i?i.split(" ").map(Number):null,a=o&&!isNaN(o[2])?o[2]:320,s=o&&!isNaN(o[3])?o[3]:180,u=e.createSVGPoint(),l=Array.from(r.querySelectorAll("path"));return{detail:{svgOriginalWidth:a,svgOriginalHeight:s,svgPoint:u,inverseCTM:n.inverse(),paths:l},hasActiveMask:!0}}catch(e){return t}},t.prototype.getBufferRange=function(e,t){if(!this.state.maskUrl)return Promise.reject(new Error("no url"));var r=-1===t?"bytes=".concat(e,"-"):"bytes=".concat(e,"-").concat(t);return new er(this.rootPlayer).r(null,{url:this.state.maskUrl,range:r})},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.dmMaskSvgInfo=null},t}(u.u),rr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDmPanel",t.url="//api.bilibili.com/x/v2/dm/panel",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0, n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:e,method:"get",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){if(0===(null==e?void 0:e.code))return{colorfulPanel:e.data.colorful_panel,colorfulPrivilegeDetails:{vipOrderPromotion:e.data.colorful_privilege_details.vip_order_promotion}}},t}(z.eV),nr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{fontsize:25,pool:0,mode:1,color:16777215,checkBoxValue:!1,colorfulPanel:null,colorfulPrivilegeDetails:null,colorful:null}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"upDm",{get:function(){return this.danmakuStore.state.checkBox?this.state.checkBoxValue?1:0:2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"upCheckbox",{get:function(){return this.danmakuStore.state.checkBox&&this.state.checkBoxValue},enumerable:!1,configurable:!0}),t.prototype.vipSwitch=function(){return new rr(this.rootPlayer).r({oid:this.configStore.cid,pid:this.configStore.pid,type:1})},t}(u.u),ir=r(8109),or=function(e){function t(t){var r=e.call(this,t)||this;return r.records=new o.vP,(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"maxActions",{get:function(){return 5},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFixedActions",{get:function(){return 1},enumerable:!1,configurable:!0}),t.prototype.cannotSetRecord=function(e,t,r){return!(!r||!e.length)&&Math.min.apply(Math,(0,n.ev)([],(0,n.CR)(e.map((function(e){return e.priority}))),!1))>t.priority},t.prototype.abortOldestRecord=function(e,t){if(e.length>=t){var r=new Map,i=[];e.sort((function(e,t){return e.priority-t.priority})).forEach((function(e){r.has(e.priority)?r.get(e.priority).push(e):r.set(e.priority,[e])})),r.forEach((function(e,t){var r=e.sort((function(e,t){return e.timeStamp-t.timeStamp}));i.push.apply(i,(0,n.ev)([],(0,n.CR)(r),!1))}));for(var o=e.length-t+1,a=Math.min(o,i.length),s=0;s=r&&t.remove(e.iid,"delay")}),e.duration,250))},t.prototype.create=function(e,t){var r=(0,ir.M)();if(e.iid=r,e.timeStamp=Date.now(),null==e.priority&&(e.fixed?e.priority=100:e.confirmText?e.priority=10:e.priority=0),e.fixed){var i=[];if(this.records.forEach((function(e){return e.fixed&&i.push(e)})),i.length>=this.maxFixedActions){if(this.cannotSetRecord(i,e,t))return null;this.abortOldestRecord(i,this.maxFixedActions)}}if(this.records.size>=this.maxActions){var o=(0,n.ev)([],(0,n.CR)(this.records.values()),!1);if(this.cannotSetRecord(o,e,t))return null;this.abortOldestRecord(o,this.maxActions)}return e=Object.assign({text:"Hello",duration:3e3},e),this.trySetTimerClock(e),this.records.set(e.iid,e),r},t.prototype.update=function(e,t){var r=this.records.get(e);return!!r&&(r.timeStamp=Date.now(),!!t&&(r.text&&t.text&&(r.text=t.text),r.confirmText&&t.confirmText&&(r.confirmText=t.confirmText),r.hide=t.hide,this.records.set(e,r),!0))},t.prototype.remove=function(e,t){void 0===t&&(t="api");var r=this.records.get(e);return!!r&&(r.timerClock&&(r.timerClock.abort(),r.timerClock=null),this.records.delete(e),"function"==typeof r.onRemoved&&r.onRemoved({reason:t}),!0)},t.prototype.resumeClock=function(e){var t=this.records.get(e);return!(!t||!t.timerClock)&&(t.timerClock.resume(),!0)},t.prototype.suspendClock=function(e){var t=this.records.get(e);return!(!t||!t.timerClock)&&(t.timerClock.suspend(),!0)},t.prototype.getActions=function(){return{maxActions:this.maxActions,maxFixedActions:this.maxFixedActions}},t.prototype.onDispose=function(){var t=this;e.prototype.onDispose.call(this),(0,n.ev)([],(0,n.CR)(this.records.values()),!1).filter((function(e){return!e.persistent})).forEach((function(e){t.remove(e.iid,"lifecycle")}))},t.prototype.onDisconnect=function(){var t=this;e.prototype.onDisconnect.call(this),this.records.forEach((function(e){t.remove(e.iid,"lifecycle")}))},(0,n.gn)([o.LO],t.prototype,"records",void 0),(0,n.gn)([o.aD],t.prototype,"create",null),(0,n.gn)([o.aD],t.prototype,"update",null),(0,n.gn)([o.aD],t.prototype,"remove",null),t}(u.u),ar=function(e){function t(t){var r=e.call(this,t)||this;return r.records=new o.vP,(0,o.rC)(r),r}return(0,n.ZT)(t,e),t.prototype.tryStartTimerClock=function(e){var t=this;e.duration&&!e.timerClock&&(e.timerClock=new d.eF((function(r,n){n>=r&&t.remove(e.name)}),e.duration,250))},t.prototype.create=function(e){this.defRenderTarget=this.defRenderTarget||this.nodes.tooltipArea||this.nodes.container;var t=Object.assign({title:"Hello",delay:300,duration:3e3,position:2,gap:6,offsetX:0,offsetY:0,renderGap:8,renderTarget:this.defRenderTarget,timeStamp:Date.now()},e);if(t.target||(null==t.clientX&&(t.clientX=this.uiStore.state.mouseClientX),null==t.clientY&&(t.clientY=this.uiStore.state.mouseClientY)),t.tip&&(t.duration=0,null==t.target))throw new Error("`target` is required when `tip` is truly");this.tryStartTimerClock(t),this.records.set(t.name,t)},t.prototype.update=function(e,t){var r=this.records.get(e);return!!r&&(r.timeStamp=Date.now(),!!t&&(r.title&&t.title&&(r.title=t.title),this.records.set(e,r),!0))},t.prototype.remove=function(e){var t=this.records.get(e);return!!t&&(t.timerClock&&(t.timerClock.abort(),t.timerClock=null),this.records.delete(e),!0)},t.prototype.onDisconnect=function(){var t=this;e.prototype.onDisconnect.call(this),this.records.forEach((function(e){t.remove(e.name)}))},(0,n.gn)([o.LO],t.prototype,"records",void 0),(0,n.gn)([o.aD],t.prototype,"create",null),(0,n.gn)([o.aD],t.prototype,"update",null),(0,n.gn)([o.aD],t.prototype,"remove",null),t}(u.u),sr=r(90846),ur=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpUser",t.retried=0,t.url="//api.bilibili.com/x/player/wbi/v2",t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){var r=this;return(0,n.Jh)(this,(function(n){return this.retried=0,this.params=e,this.config=Object.assign({retryCount:3,retryInterval:500},t),[2,this.getRemoteResponse().then((function(e){return{body:r.parse(e.data),response:e}}))]}))}))},t.prototype.getRemoteResponse=function(){var e=this;return this.request({url:this.url,params:this.params,withCredentials:!0}).catch((function(t){return!z.eV.isCanceled(t)&&!z.eV.isGaiaFailed(t)&&e.config.retryCount>e.retried?new Promise((function(t,r){e.timer=window.setTimeout((function(){e.retried++,e.getRemoteResponse().then(t,r),e.log.i("Retry: ".concat(e.retried,"/").concat(e.config.retryCount))}),e.config.retryInterval)})):Promise.reject(t)}))},t.prototype.parse=function(e){var t,r,n,i,o,a,s,u,l,c,d,f,p={err:null},h=e.data||{},y=h.dm_mask||{},m={pn:+h.page_no,mid:+h.login_mid,aid:+h.aid,cid:+h.cid,bvid:h.bvid,name:h.name,hashId:h.login_mid_hash,isOwner:!!h.is_owner,isUgcPayPreview:!!h.is_ugc_pay_preview,allowBp:!!h.allow_bp,blockTime:+h.block_time,role:+h.role,hasNext:!!h.has_next,permission:h.permission,lastCid:+h.last_play_cid,lastPlayTime:+h.last_play_time,onlineCount:+h.online_count,previewToast:h.preview_toast,answerStatus:+h.answer_status,viewPoints:h.view_points,pugvWatchStatus:null!==(r=null===(t=h.pugv)||void 0===t?void 0:t.watch_status)&&void 0!==r?r:0,pugvPayStatus:null!==(i=null===(n=h.pugv)||void 0===n?void 0:n.pay_status)&&void 0!==i?i:0,pugvSeasonStatus:null!==(a=null===(o=h.pugv)||void 0===o?void 0:o.season_status)&&void 0!==a?a:0,dmMask:{fps:y.fps,maskUrl:y.mask_url},vip:h.vip||{},levelInfo:h.level_info||{},pCdnLoader:h.pcdn_loader||{},is360:null!==(u=!!(null===(s=null==h?void 0:h.options)||void 0===s?void 0:s.is_360))&&void 0!==u&&u,interaction:h.interaction,withoutVip:!!(null===(l=h.options)||void 0===l?void 0:l.without_vip),subtitle:h.subtitle,fawkes:h.fawkes,progressIcon:h.player_icon,longProgress:!!(null===(c=h.show_switch)||void 0===c?void 0:c.long_progress),bgmInfo:null==h?void 0:h.bgm_info,toastBlock:null==h?void 0:h.toast_block, is_upower_exclusive:null==h?void 0:h.is_upower_exclusive,is_upower_play:null==h?void 0:h.is_upower_play,elec_high_level:null==h?void 0:h.elec_high_level,disableShowUpInfo:null==h?void 0:h.disable_show_up_info,needLoginSubtitle:null==h?void 0:h.need_login_subtitle,is_upower_exclusive_with_qa:null==h?void 0:h.is_upower_exclusive_with_qa},g=h.operation_card;(null==g?void 0:g.length)&&(m.operationCard=this.parseCard(g)),h.subtitle&&(m.subtitle.submitSwitch=+(null!==(f=null===(d=h.online_switch)||void 0===d?void 0:d.subtitle_submit_switch)&&void 0!==f?f:1));var v={isSystemAdmin:!1,vipType:+m.vip.type,vipStatus:+m.vip.status};return Object.assign(p,m,v),p},t.prototype.parseCard=function(e){return e.map((function(e){var t,r,n={id:e.id,from:e.from,to:e.to,status:e.status,cardType:e.card_type,bizType:e.biz_type};return 1===e.card_type?(n.title=e.standard_card.title,n.buttonTitle=e.standard_card.button_title,n.buttonSelectedTitle=e.standard_card.button_selected_title,n.showSelected=e.standard_card.show_selected,n.seasonId=null===(t=e.param_follow)||void 0===t?void 0:t.season_id,n.activityId=null===(r=e.param_reserve)||void 0===r?void 0:r.activity_id):(n.icon=e.skip_card.icon.replace("http://","//")||"",n.label=e.skip_card.label,n.content=e.skip_card.content,n.button=e.skip_card.button,n.link=e.skip_card.link),n}))},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),clearTimeout(this.timer)},t}(z.eV),lr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpView",t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){var r,i=this;return(0,n.Jh)(this,(function(n){return this.params=e,this.config=t,this.httpKind=t.httpKind,r=this.getViewUrl(),[2,this.request({url:r,params:this.getRequestParams(),withCredentials:!0}).then((function(e){return{body:i.parse(e.data),response:e}}))]}))}))},t.prototype.getViewUrl=function(){var e;return((e={})[l.HR.Ugc]="//api.bilibili.com/x/web-interface/wbi/view/detail",e[l.HR.Pgc]="//api.bilibili.com/pgc/view/web/season",e[l.HR.Pugv]="//api.bilibili.com/pugv/view/web/season",e)[this.httpKind]},t.prototype.getRequestParams=function(){var e,t,r,n,i;switch(this.httpKind){case l.HR.Pgc:case l.HR.Pugv:return{ep_id:this.params.episodeId,isGaiaAvoided:(null===(e=this.params)||void 0===e?void 0:e.isGaiaAvoided)||!1};case l.HR.Ugc:return this.params.aid?{aid:this.params.aid,need_view:1,isGaiaAvoided:(null===(t=this.params)||void 0===t?void 0:t.isGaiaAvoided)||!1}:{bvid:this.params.bvid,need_view:1,isGaiaAvoided:(null===(r=this.params)||void 0===r?void 0:r.isGaiaAvoided)||!1};default:return this.params.aid?{aid:this.params.aid,isGaiaAvoided:(null===(n=this.params)||void 0===n?void 0:n.isGaiaAvoided)||!1}:{bvid:this.params.bvid,isGaiaAvoided:(null===(i=this.params)||void 0===i?void 0:i.isGaiaAvoided)||!1}}},t.prototype.parse=function(e){switch(this.httpKind){case l.HR.Pgc:return this.parsePgc(e);case l.HR.Pugv:return this.parsePugv(e);case l.HR.Ugc:default:return this.parseUgc(e,this.params.p)}},t.prototype.parsePgc=function(e){var t=e.result,r={};if(t){var n=t.section,i=t.episodes,o=+t.season_id,a=t.up_info,s=function(e,t){var n=+e.aid,i=+e.cid,o=e.bvid,a=e.cover,s=t+1;n&&(r.aid=n),i&&(r.cid=i),o&&(r.bvid=o),a&&(r.pic=a),s&&(r.p=s)};if(a&&(r.owner={mid:a.mid,name:a.uname,face:a.avatar}),o&&(r.seasonId=o),Array.isArray(i)&&i.length)for(var u=0;u1&&(a.staff=[],o.staff.forEach((function(e){var t;a.staff.push({mid:e.mid,name:e.name,face:null===(t=e.face)||void 0===t?void 0:t.replace("http://","//")})}))),Array.isArray(l)&&l.length){var p=0,h=!1;if(this.params.cid&&(h=l.some((function(e,t){if(e.cid===n.params.cid)return p=t,!0}))),h)a.p=p+1,a.cid=this.params.cid;else{var y=l[(0,P.Z)(t-1,0,l.length-1)||0];if(y){var m=+y.page,g=+y.cid;m&&(a.p=m),g&&(a.cid=g)}}}}return a},t}(z.eV),cr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpVideoShot",t.url="//api.bilibili.com/x/player/videoshot",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:e}).then((function(r){return{body:t.parse(r.data,e.cid),response:r}}))]}))}))},t.prototype.parse=function(e,t){var r=e.data;if(!r)return null;var n=new Map;return r.video_shots&&Object.keys(null==r?void 0:r.video_shots).length>0?(Object.keys(r.video_shots).forEach((function(e){if(r.video_shots[e]){var t=r.video_shots[e];t.pvdata&&t.image&&n.set(parseInt(e),{pvData:t.pvdata,xLen:+t.img_x_len,yLen:+t.img_y_len,xSize:+t.img_x_size,ySize:+t.img_y_size,images:t.image})}})),n):(r.pvdata&&r.image&&n.set(t,{pvData:r.pvdata,xLen:+r.img_x_len,yLen:+r.img_y_len,xSize:+r.img_x_size,ySize:+r.img_y_size,images:r.image}),n)},t}(z.eV),dr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpVideoDetail",t.url="//api.bilibili.com/x/web-interface/wbi/view/detail",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t=this;return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,params:(0,n.pi)((0,n.pi)({},e),{platform:"web"}),method:"get",withCredentials:!0}).then((function(e){return{body:t.parse(e.data),response:e}}))]}))}))},t.prototype.parse=function(e){var t=e.data;return t?{up:{follow:t.Card.following,mid:t.View.owner.mid,name:t.View.owner.name,face:t.View.owner.face,fans:t.Card.follower},video:{title:t.View.title,bvid:t.View.bvid,stat:t.View.stat},relate:t.Related}:{up:null,video:null,relate:null}},t}(z.eV),fr=function(){function e(){}return e.isBrowserSupported=function(){return!!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)},e.probeSupport=function(t){return(0,n.mG)(this,void 0,void 0,(function(){var r,i,o,a,s,u,l,c=this;return(0,n.Jh)(this,(function(d){switch(d.label){case 0:if(!e.isBrowserSupported())throw new Error("Must have basic EME support");return r=t||["org.w3.clearkey","com.widevine.alpha","com.microsoft.playready","com.microsoft.playready.recommendation","com.apple.fps.3_0","com.apple.fps.2_0","com.apple.fps.1_0","com.apple.fps","com.adobe.primetime"],o=[{videoCapabilities:i=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/mp4; codecs="hvc1.2.4.L120.90"'},{contentType:'video/mp4; codecs="hev1.1.6.L150.90"'},{contentType:'video/mp4; codecs="av01.0.00M.10.0.110.01.01.01.0"'},{contentType:'video/mp4; codecs="dvh1.05.07"'}],persistentState:"required",sessionTypes:["persistent-license"]},{initDataTypes:["cenc"],videoCapabilities:i}],a=new Map,s=function(e){return(0,n.mG)(c,void 0,void 0,(function(){var t,r,i,s,u,l;return(0,n.Jh)(this,(function(n){switch(n.label){case 0: if("org.w3.clearkey"===e&&_.X.apple.alike)return[2,a.set(e,null)];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,navigator.requestMediaKeySystemAccess(e,o)];case 2:return t=n.sent(),r=t.getConfiguration(),i=r.sessionTypes,s=null===(l=null==r?void 0:r.videoCapabilities)||void 0===l?void 0:l.map((function(e){var t,r;return null===(r=null===(t=e.contentType)||void 0===t?void 0:t.split("codecs=")[1])||void 0===r?void 0:r.split(".")[0]})),u=!!i&&i.includes("persistent-license"),a.set(e,{persistentState:u,codecTypes:s}),[4,t.createMediaKeys()];case 3:return n.sent(),[3,5];case 4:return n.sent(),a.set(e,null),[3,5];case 5:return[2]}}))}))},u=r.map((function(e){return s(e)})),[4,Promise.all(u)];case 1:return d.sent(),l={},a.forEach((function(e,t){l[t]=e})),[2,l]}}))}))},e}(),pr=[['nP](wOFRvU.+e)?[2,this.validKss]:(this.detectAndSaveDRMCapacity(),[2,this.validKss||[]]))}))}))},t.prototype.getHttpReqFunc=function(e){var t,r=e.tag,n=null===(t=this.configStore.requestConfig)||void 0===t?void 0:t["req".concat(r,"Info")];return function(e){return"function"==typeof e}(n)?n:e.r.bind(e)},t.prototype.fetchLocalCachePlayUrl=function(e,t,r){var i;return(0,n.mG)(this,void 0,void 0,(function(){var o,a,s,u,l;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),o=new sr.xL(this.rootPlayer,{memCache:e}),a=this.getPlayUrlParams(t),s=this.getPlayUrlConfig(r),[4,(0,Ze.$)(this.rootPlayer,{type:"playurl",cid:this.configStore.cid})];case 1:return((null==(u=n.sent())?void 0:u.data)||(null==u?void 0:u.result))&&(s.preloadPlayUrl=u.data||u.result,s.fromLocalCache=!0,this.qualityStore.setState({newQuality:s.preloadPlayUrl.quality})),[4,o.r(a,s)];case 2:return[2,n.sent()];case 3:return l=n.sent(),this.track.o("player_url_error",{code:(null===(i=null==l?void 0:l.raw)||void 0===i?void 0:i.code)||-1,message:(null==l?void 0:l.message)||"unkown error"}),[2,Promise.reject(l)];case 4:return[2]}}))}))},t.prototype.getReqDRMType=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t,r,i,o,a,s,u,l;return(0,n.Jh)(this,(function(c){switch(c.label){case 0:return[4,this.getValidKeySystems().catch(Y.Z)];case 1:if(t=c.sent(),Array.isArray(t)){i=function(t){var n=t.ks,i=t.codecTypes;switch(n){case"com.widevine.alpha.experiment":case"com.widevine.alpha":if([Ne.nJ.alias.UHD_HDR,Ne.nJ.alias.UHD_DVision].includes(e)){var o=new Set(["hev1","hvc1","dvh1"]);if(i&&!i.some((function(e){return o.has(e)})))return"continue"}r=2;break;case"com.apple.fps.1_0":default:break;case"org.w3.clearkey":r=3}};try{for(o=(0,n.XA)(t),a=o.next();!a.done;a=o.next())s=a.value,i(s)}catch(e){u={error:e}}finally{try{a&&!a.done&&(l=o.return)&&l.call(o)}finally{if(u)throw u.error}}}return[2,r]}}))}))},t.prototype.fetchPlayUrl=function(e,t,r){var i;return(0,n.mG)(this,void 0,void 0,(function(){var o,a,s,u,c,d,f,p;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return this.configStore.fromLocalCache?[2,this.fetchLocalCachePlayUrl(e,t,r)]:(o=this.drmFallback||r&&r.drmFallback,a=new sr.xL(this.rootPlayer,{memCache:e}),s=this.getPlayUrlParams(t),u=this.getPlayUrlConfig(r),o?(this.drmFallback=!0,[3,4]):[3,1]);case 1:switch(this.uiStore.kind){case l.HR.Pgc:case l.HR.Pugv:return[3,2]}return[3,4];case 2:return this.rootStore.stageAtom.set(10),[4,this.getReqDRMType(s.qn)];case 3:return(c=n.sent())&&Object.assign(s,{drm_tech_type:c}),this.rootStore.stageAtom.set(11),[3,4];case 4:return n.trys.push([4,6,,7]),[4,this.getHttpReqFunc(a)(s,u)];case 5:return[2,n.sent()];case 6:if(d=n.sent(),this.track.o("player_url_error",{code:(null===(i=null==d?void 0:d.raw)||void 0===i?void 0:i.code)||-1,message:(null==d?void 0:d.message)||"unkown error"}),f=r&&r.initiator,p=Promise.reject(d),this.episodeStore.state.isRenewal)return[2,p];if(0!==f)return[2,p];if(this.uiStore.kind!==l.HR.Ugc)return[2,p];if(!d||!d.raw||null==!d.raw.code)return[2,p];switch(d.raw.code){case 0:case 87005:case-403:case 87008:case 87007:break;default:return[2,Promise.reject({code:d.raw.code,errType:2,message:d.message,srcUrl:d.playUrl,raw:d.raw})]}return[2,p];case 7:return[2]}}))}))},t.prototype.isGaiaAvoided=function(){var e=this.configStore.channelKind;return[l.u5.Embedded,l.u5.Embedded_Other,l.u5.Embedded_White,l.u5.Homepage,l.u5.Homepage_Topic,l.u5.Manager,l.u5.Oneself].includes(e)},t.prototype.fetchUserInfo=function(e){var t,r;return(0,n.mG)(this,void 0,void 0,(function(){var i,o;return(0,n.Jh)(this,(function(a){return i=new ur(this.rootPlayer,{memCache:e}),o={aid:this.configStore.aid,cid:this.configStore.cid,ep_id:this.configStore.episodeId,season_id:this.configStore.seasonId, graph_version:this.episodeStore.state.isSameEpisode?null===(r=null===(t=this.userStore.info)||void 0===t?void 0:t.interaction)||void 0===r?void 0:r.graph_version:null,isGaiaAvoided:this.isGaiaAvoided()},this.uiStore.state.kind===l.HR.Ugc&&(delete o.ep_id,delete o.season_id),this.patchAdvStore.hasValidAdv&&(o.aid=this.patchAdvStore.mainInfo.aid,o.cid=this.patchAdvStore.mainInfo.cid),this.uiStore.state.kind===l.HR.Pugv&&(o.video_type="pugv"),[2,this.getHttpReqFunc(i)(o).then((function(e){var t;if(null===(t=e.body)||void 0===t?void 0:t.subtitle){var r=e.body.subtitle.subtitles;return r&&r.length&&r.forEach((function(e){var t=e.subtitle_url_v2;if(t){var r=t.split("?")[0],i=t.split("?")[1],o=function(e){var t,r,i=function(e){var t=e.match(/\/\/subtitle\.bilibili\.com\/([^?]+)/);return t?t[1]:null}(e);if(!i)return"";try{for(var o=(0,n.XA)(pr),a=o.next();!a.done;a=o.next()){var s=a.value,u=(0,n.CR)(s,2),l=u[0],c=u[1],d=yr(hr(!!l)(i),"".concat(c).concat("bilibili"));if(d.startsWith(l))return d.split(l)[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return""}(r),a=function(e,t){return e&&"".concat("//aisubtitle.hdslb.com").concat(e,"?").concat(t)||""}(o,i);a&&(e.subtitle_url=a)}})),e}return e}))]}))}))},t.prototype.fetchViewInfo=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t;return(0,n.Jh)(this,(function(r){return this.configStore.localUrl?[2]:(t=new lr(this.rootPlayer,{memCache:e}),[2,this.getHttpReqFunc(t)({p:this.configStore.p,aid:this.configStore.aid,cid:this.configStore.cid,bvid:this.configStore.bvid,seasonId:this.configStore.seasonId,episodeId:this.configStore.episodeId,isGaiaAvoided:this.isGaiaAvoided()},{httpKind:this.getViewKind().httpKind})])}))}))},t.prototype.fetchVideoShot=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t;return(0,n.Jh)(this,(function(r){return t=new cr(this.rootPlayer,{memCache:e}),this.patchAdvStore.hasValidAdv?[2,t.r({aid:this.patchAdvStore.mainInfo.aid,cid:this.patchAdvStore.mainInfo.cid,cids:this.patchAdvStore.getCids().join("-"),batch:!0})]:[2,t.r({aid:this.configStore.aid,cid:this.configStore.cid})]}))}))},t.prototype.fetchVideoDetail=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,new dr(this.rootPlayer,{memCache:e}).r({aid:this.configStore.aid,bvid:this.configStore.bvid,p:this.configStore.p,isGaiaAvoided:this.isGaiaAvoided()})]}))}))},t}(u.u),_r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{pxStart:!1,vxStart:!1}},enumerable:!1,configurable:!0}),t.prototype.onPrepared=function(){var t=this;e.prototype.onPrepared.call(this),this.dp.pxTimeout=(0,o.gx)((function(){return t.uiStore.state.isLoadTimeout}),(function(){t.track.o("load_timeout"),queueMicrotask((function(){return t.setState({pxStart:!0})}))})),this.dp.pxStart=(0,o.gx)((function(){return!(!t.rootStore.isLoaded||!t.userStore.info)}),(function(){return queueMicrotask((function(){return t.setState({pxStart:!0})}))})),this.dp.vxStart=(0,o.gx)((function(){return!!(t.rootStore.isLoaded&&t.userStore.info&&t.mediaStore.state.firstPlay)}),(function(){return queueMicrotask((function(){return t.setState({vxStart:!0})}))}))},t.prototype.getReportType=function(){switch(this.uiStore.state.kind){case l.HR.Pugv:return 10;case l.HR.Pgc:return 4;case l.HR.Ugc:default:return 3}},t.prototype.getSourceType=function(){var e=this.mpdStore.body;if(e&&e.abTestId)return+e.abTestId+10;if(!this.kernelStore.baseAgent)return 0;if(this.kernelStore.flvKernel){var t=this.kernelStore.flvKernel;return t?"FlvPlayer"===t.type?1:2:0}if(this.kernelStore.dashKernel){var r=this.kernelStore.dashKernel,n=r&&"function"==typeof r.getCurrentCodecID&&r.getCurrentCodecID("video");if(!n)return 0;switch(n){case 12:return this.wmpStore.isUseWasmPlayer(this.mediaStore.video)?5:4;case 13:return 6;default:return 3}}return 0},t.prototype.polarReport=function(e,t,r){this.rootPlayer.emit(a.t.Player_Polar_Report,new CustomEvent(a.t.Player_Polar_Report,{detail:{data:{name:e,type:t,params:r}}}))},t.prototype.getFid=function(){var e=l.u5[this.configStore.channelKind],t=l.HR[this.uiStore.kind]||"Unknown";return"".concat(e,":").concat(t,":").concat(this.configStore.iid)},t}(u.u),Er=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="AuxStore",(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{isListSpread:!1,disableListSwitch:!1,currentMenu:"LIST",showBlock:0,playerH:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.auxStore.state.height+"px"},enumerable:!1,configurable:!0}),t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this)},t.prototype.onLoaded=function(t){e.prototype.onLoaded.call(this,t)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,!0)},(0,n.gn)([o.Fl],t.prototype,"height",null),t}(u.u),Sr=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="CtrlStore",r.delayShowTimer=null,r.virtualHoverTimer=null,r.clientRect=null,r.clientRectRefresh=0,(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{containerFocus:!0,containerHover:!0,majorVirtualHover:0,majorHovered:!1,majorHidden:!1,majorTitle:null}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ctrlHidden",{get:function(){return this.isCtrlHidden()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mouseHidden",{get:function(){return this.ctrlHidden&&this.danmakuStore.state.noStopDm&&1!==this.interactStore.state.ctrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.state.majorTitle},enumerable:!1,configurable:!0}),t.prototype.isCtrlHidden=function(){if(!this.errorStore.state.initError)switch(this.interactStore.state.ctrl){case 1:return!0;case 2:return!1}switch(this.configStore.state.ctrl){case 1:return!0;case 2:return!1}if(!this.mediaStore.state.firstPlay){if(!this.mediaStore.autoplay)return!1;if(this.mediaStore.state.autoplayNotAllowed)return!1}return!this.state.majorHovered&&!this.state.majorVirtualHover&&((!this.uiStore.isFullView||!this.sendStore.state.focus)&&((!this.mediaStore.state.paused||2!==this.configStore.ctrl)&&this.state.majorHidden))},t.prototype.focus=function(e){this.clearVirtualHoverTimer(),this.setState({majorVirtualHover:e})},t.prototype.blur=function(){this.clearVirtualHoverTimer(),this.setState({majorVirtualHover:0})},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.ctrlHidden=(0,o.U5)((function(){return t.ctrlHidden}),(function(e){e?queueMicrotask((function(){return t.rootPlayer.emit(a.t.Player_Hide_Controls,new CustomEvent(a.t.Player_Hide_Controls))})):queueMicrotask((function(){return t.rootPlayer.emit(a.t.Player_Show_Controls,new CustomEvent(a.t.Player_Show_Controls))}))})),this.configStore.embeddedEnv||(this.dc.firstPlayDelayed=(0,o.U5)((function(){return t.mediaStore.state.firstPlay}),(function(e){!e||t.delayShowTimer||t.isCtrlHidden()||t.setCtrlTimer(1e3)}),{fireImmediately:!0})),this.dc.firstPlay=(0,o.U5)((function(){return t.mediaStore.state.firstPlay}),(function(e){e&&t.setState({containerFocus:!0})}),{fireImmediately:!0}),this.dc.forceHidden=(0,o.U5)((function(){return 1===t.interactStore.state.ctrl}),(function(e){t.nodes.controlWrap.hidden=e})),this.dc.virtualHover=(0,o.U5)((function(){return t.state.majorVirtualHover}),(function(e){e&&(t.clearVirtualHoverTimer(),t.virtualHoverTimer=window.setTimeout((function(){t.setState({majorVirtualHover:0})}),e))})),this.addEvents()},t.prototype.addEvents=function(){this.nodes.container.addEventListener("mouseenter",this.onMouseEnterContainer),this.nodes.container.addEventListener("mouseleave",this.onMouseLeaveContainer),this.configStore.onlyTouchMode||(this.nodes.videoArea.addEventListener("mousemove",this.onMouseMoveMedia),this.nodes.videoArea.addEventListener("mouseleave",this.onMouseLeaveMedia)),this.nodes.controlWrap.addEventListener("mouseenter",this.onHoverEnter), this.nodes.controlWrap.addEventListener("mouseleave",this.onHoverLeave),this.nodes.topWrap.addEventListener("mouseenter",this.onHoverEnter),this.nodes.topWrap.addEventListener("mouseleave",this.onHoverLeave),this.rootStore.window.addEventListener("scroll",this.onContainerChanged),this.rootStore.window.addEventListener("click",this.onFocusChanged),this.rootStore.isEmbedSOP&&this.rootStore.parent.addEventListener("click",this.onFocusChanged),this.rootPlayer.on(a.t.Player_Container_Resize,this.onContainerChanged)},t.prototype.removeEvents=function(){this.nodes.container&&(this.nodes.container.removeEventListener("mouseenter",this.onMouseEnterContainer),this.nodes.container.removeEventListener("mouseleave",this.onMouseLeaveContainer)),this.nodes.videoArea&&(this.nodes.videoArea.removeEventListener("mousemove",this.onMouseMoveMedia),this.nodes.videoArea.removeEventListener("mouseleave",this.onMouseLeaveMedia)),this.nodes.controlWrap&&(this.nodes.controlWrap.removeEventListener("mouseenter",this.onHoverEnter),this.nodes.controlWrap.removeEventListener("mouseleave",this.onHoverLeave)),this.nodes.topWrap&&(this.nodes.topWrap.removeEventListener("mouseenter",this.onHoverEnter),this.nodes.topWrap.removeEventListener("mouseleave",this.onHoverLeave)),this.rootStore.window.removeEventListener("scroll",this.onContainerChanged),this.rootStore.window.removeEventListener("click",this.onFocusChanged),this.rootStore.parent.removeEventListener("click",this.onFocusChanged),this.rootPlayer.off(a.t.Player_Container_Resize,this.onContainerChanged)},t.prototype.onMouseMoveMedia=function(e){var t=e.clientY-this.getValidClientRect().top,r=this.uiStore.state.videoAreaHeight;t<0||t>r||(tr/3*2?this.setCtrlTimer(3e3):this.setCtrlTimer(1e3))},t.prototype.onMouseLeaveMedia=function(e){this.setMajorHidden(!0)},t.prototype.clearCtrlTimer=function(){this.delayShowTimer&&(clearTimeout(this.delayShowTimer),this.delayShowTimer=null)},t.prototype.setCtrlTimer=function(e){var t=this;this.setMajorHidden(!1),this.delayShowTimer=window.setTimeout((function(){t.setMajorHidden(!0)}),e)},t.prototype.setMajorHidden=function(e){this.clearCtrlTimer(),this.setState({majorHidden:e})},t.prototype.onHoverEnter=function(){this.setState({majorHovered:!0})},t.prototype.onHoverLeave=function(){this.setState({majorHovered:!1})},t.prototype.onFocusChanged=function(e){e&&e.target&&this.nodes.container.contains(e.target)?(this.setState({containerFocus:!0}),this.panoramaStore.state.control&&this.panoramaStore.state.control.contains(e.target)?this.panoramaStore.setState({isActive:!0}):this.panoramaStore.setState({isActive:!1})):(this.setState({containerFocus:!1}),this.panoramaStore.setState({isActive:!1}))},t.prototype.onMouseEnterContainer=function(){this.setState({containerHover:!0})},t.prototype.onMouseLeaveContainer=function(){this.setState({containerHover:!1})},t.prototype.onContainerChanged=function(){this.clientRect=null},t.prototype.getValidClientRect=function(){var e=Date.now();return e-this.clientRectRefresh>12e4&&(this.clientRect=null),this.clientRect||(this.clientRect=this.nodes.container.getBoundingClientRect(),this.clientRectRefresh=e),this.clientRect},t.prototype.clearVirtualHoverTimer=function(){this.virtualHoverTimer&&(clearTimeout(this.virtualHoverTimer),this.virtualHoverTimer=null)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{containerFocus:1,containerHover:1,majorVirtualHover:1,majorHovered:1,majorHidden:1})},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.removeEvents(),this.clearCtrlTimer(),this.clearVirtualHoverTimer()},(0,n.gn)([o.Fl],t.prototype,"ctrlHidden",null),(0,n.gn)([o.Fl],t.prototype,"mouseHidden",null),(0,n.gn)([o.Fl],t.prototype,"title",null),(0,n.gn)([i.ZP],t.prototype,"onMouseMoveMedia",null),(0,n.gn)([i.ZP],t.prototype,"onMouseLeaveMedia",null),(0,n.gn)([i.ZP],t.prototype,"onHoverEnter",null),(0,n.gn)([i.ZP],t.prototype,"onHoverLeave",null),(0,n.gn)([i.ZP],t.prototype,"onFocusChanged",null),(0,n.gn)([i.ZP],t.prototype,"onMouseEnterContainer",null),(0,n.gn)([i.ZP],t.prototype,"onMouseLeaveContainer",null),(0,n.gn)([i.ZP],t.prototype,"onContainerChanged",null),t}(u.u),Ar=r(51610),wr=r(57136),Tr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isShowAIPoint=!1,t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){var e;return(e={})[-1]=null,e[1]=null,e[2]=null,e[3]=null,e[4]=null,e},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.studyNote=(0,o.U5)((function(){return t.state[-1]}),(function(e){t.rootPlayer.emit(a.t.Player_Hotspot_Change,new CustomEvent(a.t.Player_Hotspot_Change,{detail:{type:-1,data:e}}))})),this.dc.wonderMoment=(0,o.U5)((function(){return t.state[1]}),(function(e){t.rootPlayer.emit(a.t.Player_Hotspot_Change,new CustomEvent(a.t.Player_Hotspot_Change,{detail:{type:1,data:e}}))})),this.dc.division=(0,o.U5)((function(){return t.state[2]}),(function(e){t.rootPlayer.emit(a.t.Player_Hotspot_Change,new CustomEvent(a.t.Player_Hotspot_Change,{detail:{type:2,data:e}}))})),this.dc.aiPoint=(0,o.U5)((function(){return t.state[4]}),(function(e){t.rootPlayer.emit(a.t.Player_Hotspot_Change,new CustomEvent(a.t.Player_Hotspot_Change,{detail:{type:4,data:e}}))}))},t.prototype.onLoaded=function(t){e.prototype.onLoaded.call(this,t),this.setInferredHotspot(t.viewPoints),this.mpdStore.body&&this.mpdStore.body.clipInfoList&&this.setOpenEndHotSpot(this.mpdStore.body.clipInfoList)},t.prototype.setOpenEndHotSpot=function(e){var t=this,r=[];if(Array.isArray(e)&&(null==e?void 0:e.length)){var n=this.patchAdvStore.prePatchDurationInSecAndInt();e.forEach((function(e){"CLIP_TYPE_OP"===e.clipType&&e.start===n&&r.push({type:3,from:e.end,to:e.end,content:""});var i=t.portStore.getDuration()-Math.ceil(t.patchAdvStore.postPatchDurationInSec());"CLIP_TYPE_ED"===e.clipType&&e.end&&e.start&&e.start=i&&r.push({type:3,from:e.start,to:e.start,content:""})}))}r.length&&this.set({type:3,data:r})},t.prototype.setInferredHotspot=function(e){var t,r,i,o=this;if(Array.isArray(e)){var a=((t={})[-1]=[],t[1]=[],t[2]=[],t[4]=[],t);try{for(var s=(0,n.XA)(e),u=s.next();!u.done;u=s.next()){var l=u.value;if(l)switch(l.type){case-1:case 1:case 2:case 4:l.content=(0,wr.t)(mr||(mr=(0,n.cy)(["",""],["",""])),l.content),l.from+=this.patchAdvStore.prePatchDurationInSec(),l.to+=this.patchAdvStore.prePatchDurationInSec(),a[l.type].push(l)}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}Object.keys(a).forEach((function(e){var t=+e,r=o.setMissingDivision(a[t]);r.length&&o.set({type:t,data:r})}))}},t.prototype.setMissingDivision=function(e){if(Array.isArray(e)&&e.length&&2===e[0].type){var t=e[0],r=e[e.length-1];t&&null==t.from&&(t.from=0),r&&null==r.to&&(r.to=this.portStore.getDuration())}return e},t.prototype.setSegmented=function(e){try{var t=JSON.parse(e);return t=t.map((function(e){return{type:e.type,from:e.from,to:e.to,content:e.content||"",permanent:e.permanent}})),this.set({type:2,data:t})}catch(e){return console.warn(e),!1}},t.prototype.addViewPoints=function(e){try{var t=JSON.parse(e);return t=t.map((function(e){return{type:e.type,from:e.from,to:e.to,content:e.content}})),this.set({type:1,data:t})}catch(e){return console.warn(e),!1}},t.prototype.setAIPoints=function(e){var t;if(!e||0===e.length){if(!this.state[4]||0===(null===(t=this.state[4])||void 0===t?void 0:t.length))return;return this.set({type:4,data:[]})}try{return e=e.map((function(e){var t;return{type:null!==(t=e.type)&&void 0!==t?t:4,from:e.from,to:e.to,content:e.content}})),this.set({type:4,data:e})}catch(e){return console.error(e),!1}},t.prototype.set=function(e){var t;if(!e)return!1;if(null!=e.data&&!Array.isArray(e.data))return!1;switch(e.type){case-1:case 1:case 3:case 2:case 4:return this.setState(((t={})[e.type]=e.data,t)),!0;default:return!1}},t.prototype.get=function(e){switch(e){case-1:case 1:case 3:case 2:case 4:return{type:e,data:this.state[e]};default:return{type:e,data:null}}},t}(u.u),Rr=r(65228),Cr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this ;return t.tag="PanoramaStore",t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{disabled:!0,contextLost:!1,isActive:!1,gesture:!1,opened:!1,control:null,attitude:null,fov:NaN}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attitude",{get:function(){return this.state.attitude},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shortcutPrior",{get:function(){return!this.state.disabled&&this.state.opened&&!this.state.contextLost},enumerable:!1,configurable:!0}),t.prototype.onLoaded=function(e){var t=this;e.is360&&(0,Rr.M)()&&!(_.X.msie.alike||_.X.msie.ie11||_.X.edge.alike||_.X.trident.alike)?this.wmpStore.fallbackWasmPlayer(7014).then((function(){t.setState({disabled:!1})})):this.setState({disabled:!0})},t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this),this.setState({opened:this.localStore.get().panorama})},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.status=(0,o.U5)((function(){return t.state.opened}),(function(){t.localStore.set({panorama:t.state.opened})}))},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{opened:!0})},t}(u.u);!function(e){e[e.Default=0]="Default",e[e.Member=1]="Member",e[e.Manager=2]="Manager"}(vr||(vr={}));var Pr,Ir={image:"https://s1.hdslb.com/bfs/static/player/img/default.png",textColor:"ffffff",shadowColor:"222222",shadowOffsetX:0,shadowOffsetY:0,shadowRadius:0,progressColor:"00a1d6",progressShadowColor:"00a1d6"},Dr=((gr={})[vr.Default]="//api.bilibili.com/x/stein/edgeinfo_v2",gr[vr.Manager]="//manager.bilibili.co/x/stein/edgeinfo_v2/audit",gr[vr.Member]="//api.bilibili.com/x/stein/edgeinfo_v2/preview",gr),Or=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpInteraction",t.retry=3,t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(r){return this.params=e,this.url=Dr[t],[2,this.interactionRequest(this.retry)]}))}))},t.prototype.interactionRequest=function(e){var t=this;return this.request({url:this.url,params:this.params,withCredentials:!0}).then((function(r){window.clearTimeout(t.timer);var n=r.data;return n&&0===n.code||99003===n.code?{body:t.parse(n),response:r}:e?void(t.timer=window.setTimeout((function(){return t.interactionRequest(--e)}),1e3)):Promise.reject({code:n.code,message:n.message,url:t.url})}),(function(r){if(window.clearTimeout(t.timer),!e)return Promise.reject({code:-404,message:r.response&&r.response.status&&r.response.status.toString()||"",url:t.url});t.timer=window.setTimeout((function(){return t.interactionRequest(--e)}),1e3)}))},t.prototype.parse=function(e){if(0===e.code&&e.data){var t=e.data,r=[],n=[],i=void 0,o=Ir;if(t.story_list&&Array.isArray(t.story_list)&&t.story_list.map((function(e){r.push({edgeId:e.edge_id,title:e.title,cid:e.cid,cover:e.cover.replace("http://","//"),startPos:e.start_pos,cursor:e.cursor,isCurrent:e.is_current})})),t.edges){var a=t.edges;if(a.skin){var s=a.skin;o={image:s.choice_image.replace(/^(https:)?\/\//,"https://"),textColor:s.title_text_color,shadowColor:s.title_shadow_color,shadowOffsetX:s.title_shadow_offset_x,shadowOffsetY:s.title_shadow_offset_y,shadowRadius:s.title_shadow_radius,progressColor:s.progressbar_color,progressShadowColor:s.progressbar_shadow_color}}a.questions&&Array.isArray(a.questions)&&a.questions.map((function(e){var t=[];e.choices&&Array.isArray(e.choices)&&e.choices.map((function(e){t.push({id:e.id,condition:e.condition,nativeAction:e.native_action,platformAction:e.platform_action,option:e.option,cid:e.cid,isDefault:e.is_default,x:e.x,y:e.y,width:e.width,height:e.height,textAlign:e.text_align,customUrl:e.custom_image_url,customWidth:e.custom_image_width,customHeight:e.custom_image_height,customRotate:e.custom_image_rotate,hidden:e.is_hidden,selected:e.selected,submited:e.submited})})),n.push({id:e.id,type:e.type,startTime:e.start_time,startTimeR:e.start_time_r,duration:e.duration,canPause:e.pause_video,title:e.title,color:e.title_color,fontsize:e.title_font_size,choices:t,fadeInTime:e.fade_in_time,fadeOutTime:e.fade_out_time})})),i={dimension:a.dimension,skin:o,questions:n}}return{code:e.code,message:e.message,data:{isLeaf:t.is_leaf,storyList:r,edgeId:t.edge_id,title:t.title,edges:i,buvid:t.buvid,hiddenVars:t.hidden_vars,hiddenVarsPreview:t.hidden_vars_preview,noTutorial:t.no_tutorial,noEvaluation:t.no_evaluation,noBacktracking:t.no_backtracking}}}return{code:e.code,message:e.message}},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),window.clearTimeout(this.timer)},t}(z.eV);function xr(e,t){return"_"===e||"$"===e||(!!/^[A-Z]$/i.test(e)||!(t||!/^[0-9]$/.test(e)))}!function(e){e.Name="Name",e.Number="Number",e.End="End",e.Equal="Equal",e.NotEqual="NotEqual",e.GreaterEqual="GreaterEqual",e.LessEqual="LessEqual",e.Print="Print",e.Plus="+",e.Subtract="-",e.Multiply="*",e.Divide="/",e.And="&",e.Greater=">",e.Less="<",e.Or="|",e.Not="!",e.LBracket="(",e.RBracket=")",e.Assign="="}(Pr||(Pr={}));var kr=function(){function e(e){this.express=e,this.index=-1,this.current={kind:Pr.Print}}return Object.defineProperty(e.prototype,"kind",{get:function(){return this.current.kind},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"str",{get:function(){return this.current.str},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"num",{get:function(){return this.current.num},enumerable:!1,configurable:!0}),e.prototype.putforward=function(){return this.char=this.express[++this.index],this.char},e.prototype.putback=function(){return this.char=this.express[--this.index],this.char},e.prototype.getNext=function(){do{if(this.putforward(),!this.char)return this.current={kind:Pr.End}}while("\n"!==this.char&&(e=this.char,t=void 0,(t=e.charCodeAt(0))>8&&t<14||32===t));var e,t;switch(this.char){case";":case"\n":return this.current={kind:Pr.Print};case"*":case"/":case"+":case"-":case"(":case")":return this.current={kind:this.char};case">":return"="===this.putforward()?this.current={kind:Pr.GreaterEqual}:(this.putback(),this.current={kind:Pr.Greater});case"<":return"="===this.putforward()?this.current={kind:Pr.LessEqual}:(this.putback(),this.current={kind:Pr.Less});case"=":return"="===this.putforward()?this.current={kind:Pr.Equal}:(this.putback(),this.current={kind:Pr.Assign});case"&":return"&"===this.putforward()?this.current={kind:Pr.And}:(this.putback(),Error("bad token"),this.current={kind:Pr.Print});case"|":return"|"===this.putforward()?this.current={kind:Pr.Or}:(this.putback(),Error("bad token"),this.current={kind:Pr.Print});case"!":return"="===this.putforward()?this.current={kind:Pr.NotEqual}:(this.putback(),this.current={kind:Pr.Not});case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case".":this.current.kind=Pr.Number;for(var r=this.char;this.putforward()&&/^[0-9.]$/.test(this.char);)r+=this.char;return this.current.num=Number(r),this.putback(),this.current;default:if(xr(this.char,!0)){for(this.current.kind=Pr.Name,this.current.str=this.char;this.putforward()&&xr(this.char,!1);)this.current.str+=this.char;return this.putback(),this.current}return Error("bad token"),this.current={kind:Pr.Print}}},e}(),Nr=function(){function e(e){this.table=null!=e?e:{}}return e.prototype.logicalExpress=function(e){for(var t=this.comparisonExpress(e);;)switch(this.token.kind){case Pr.And:t=0!==this.comparisonExpress(!0)&&0!==t?1:0;break;case Pr.Or:t=0!==this.comparisonExpress(!0)||0!==t?1:0;break;default:return t}},e.prototype.comparisonExpress=function(e){for(var t=this.numberExpress(e);;)switch(this.token.kind){case Pr.Equal:t=t===this.numberExpress(!0)?1:0;break;case Pr.NotEqual:t=t!==this.numberExpress(!0)?1:0;break;case Pr.Greater:t=t>this.numberExpress(!0)?1:0;break;case Pr.GreaterEqual:t=t>=this.numberExpress(!0)?1:0;break;case Pr.Less:t=t0&&(a=!0),t.push((0,n.pi)((0,n.pi)({},o),{start:o.startTime,end:o.startTime+o.duration,countdown:a,autoSkip:!1}))}}return{inEnd:r,inPlay:t}},enumerable:!1,configurable:!0}),t.prototype.onNavigate=function(){e.prototype.onNavigate.call(this),this.episodeStore.state.isSameEpisode||this.reset()},t.prototype.onLoaded=function(t){var r=this;e.prototype.onLoaded.call(this,t);var n=t.interaction;t.mid&&this.clearSessionRecord(),this.state.disabled||((null==n?void 0:n.graph_version)?this.wmpStore.fallbackWasmPlayer(7015).then((function(){!r.state.disabled&&(null==n?void 0:n.graph_version)&&(1==+n.need_reload?r.setState({needReload:!0}):r.setState({graphVersion:n.graph_version}))})):this.setState({graphVersion:null})),this.dp.fetchInteraction=(0,o.gx)((function(){return!!r.state.graphVersion}),(function(){r.state.graphVersion&&r.fetchInteraction()})),this.dp.canPreloadPlayurl=(0,o.U5)((function(){return r.canPrefetchPlayurl}),(function(){r.canPrefetchPlayurl&&r.state.questions.map((function(e){var t;4!==e.type&&(null===(t=e.choices)||void 0===t?void 0:t.length)&&r.prefetchPlayurl(e.choices).catch((function(e){return r.log.i(e&&e.message)}))}))}))},t.prototype.getInteractionUrlKind=function(){var e;switch(this.configStore.channelKind){case l.u5.Creator:e=vr.Member;break;case l.u5.Manager:e=vr.Manager;break;case l.u5.Default:default:e=vr.Default}return e},t.prototype.getInteractionParams=function(){return{platform:"pc",graph_version:this.state.graphVersion,portal:this.interactionConfig.portal,screen:this.uiStore.screenKind,edge_id:this.state.currentEdgeId,choices:this.interactionConfig.choiceSet,aid:this.configStore.aid,buvid:D.J.buvid()}},t.prototype.fetchInteraction=function(){var e=this;new Or(this.rootPlayer).r(this.getInteractionParams(),this.getInteractionUrlKind()).then((function(t){var r,n,i,o,a;0===(null===(r=null==t?void 0:t.body)||void 0===r?void 0:r.code)&&(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.data)?(e.parseBody(t.body.data),e.setState({fetchStatus:!0})):99003===(null===(i=null==t?void 0:t.body)||void 0===i?void 0:i.code)?e.setSeamless(!0):(e.setState({graphVersion:null,fetchStatus:!1}),e.toastStore.create({text:"非常抱歉,选项加载失败,请刷新重试",duration:5e3}),e.track.e("interactive_loadfail",{aid:e.configStore.aid,cid:e.configStore.cid,bvid:e.configStore.bvid,code:null===(o=null==t?void 0:t.body)||void 0===o?void 0:o.code,message:(null===(a=null==t?void 0:t.body)||void 0===a?void 0:a.message)||"选项加载失败"}))})).catch((function(t){e.setState({graphVersion:null,fetchStatus:!1}),e.toastStore.create({text:"非常抱歉,选项加载失败,请刷新重试",duration:5e3}),e.track.e("interactive_loadfail",{aid:e.configStore.aid,cid:e.configStore.cid,bvid:e.configStore.bvid,code:null==t?void 0:t.code,message:(null==t?void 0:t.message)||"选项加载失败"})}))},t.prototype.parseBody=function(e){var t=this;this.userStore.info.mid||(this.recordKey="bpx_interaction_".concat(this.configStore.bvid||this.configStore.aid),this.setSessionRecord(e));var r=e.noEvaluation,n=e.noBacktracking,i=e.noTutorial,o=e.storyList,a=e.edges,s=e.isLeaf,u=e.hiddenVars,l=e.title;r?this.endingStore.setState({disabled:!0}):this.endingStore.setState({disabled:!1}),this.setState({noBacktracking:!!n,noTutorial:!!i}),Array.isArray(o)&&o.length&&(null===this.state.currentEdgeId&&this.setState({currentEdgeId:+o[0].edgeId}),this.setState({storyList:o})),Array.isArray(u)&&u.length&&(this.setState({hiddenVars:u}),u.map((function(e){t.hiddenMap[e.id_v2]=e.value}))),this.ctrlStore.setState({majorTitle:Lr(this.hiddenMap,l)}),Array.isArray(null==a?void 0:a.questions)&&a.questions.length&&(this.setState({skin:a.skin,dimension:a.dimension,questions:a.questions}),127===a.questions[0].type?this.setState({special:!0}):this.setState({special:!1})),this.setInteractionConfig({isLastPart:!!s})},t.prototype.setSessionRecord=function(e){try{var t={cid:this.configStore.cid,edgeId:e.edgeId,title:e.title,cover:"//i0.hdslb.com/bfs/steins-gate/".concat(this.configStore.cid,"_screenshot.jpg"),startPos:0,cursor:0},r=this.interactionConfig.targetId,n={graphVersion:this.state.graphVersion,aid:this.configStore.aid,bvid:this.configStore.bvid,list:[]},i=this.getSessionRecord()||n;this.state.graphVersion===i.graphVersion?i.list[r]||(i.list[r]={ptr:r,story:t}):(this.setInteractionConfig({targetId:0}),r=0,i=Object.assign({},n,{list:[{ptr:r,story:t}]})),this.interactionConfig.hiddenVars?e.hiddenVars=this.interactionConfig.hiddenVars:this.setInteractionConfig({hiddenVars:e.hiddenVars||null}),i.list[r].hiddenVars=this.interactionConfig.hiddenVars,i.list.filter((function(e){if(void 0!==e&&e.story)return e})),e.storyList=i.list.map((function(e){return e.story})),this.saveSessionRecord(i)}catch(e){console.warn(e)}},t.prototype.getSessionRecord=function(){ return this.sessionStore.get().interaction[this.recordKey]},t.prototype.saveSessionRecord=function(e){var t;this.sessionStore.set({interaction:(t={},t[this.recordKey]=e,t)})},t.prototype.clearSessionRecord=function(){this.sessionStore.get().interaction[this.recordKey]&&delete this.sessionStore.get().interaction[this.recordKey]},t.prototype.updateSessionRecord=function(){var e,t,r=this;if(0===this.interactionConfig.portal&&!this.userStore.info.mid){var n=this.getSessionRecord(),i=null===(e=null==n?void 0:n.list)||void 0===e?void 0:e.length;if(i&&i>this.interactionConfig.targetId){var o=!0,a=n.list[this.interactionConfig.targetId+1];if(null===(t=null==a?void 0:a.hiddenVars)||void 0===t?void 0:t.length)for(var s=a.hiddenVars,u=0;u9||this.mediaStore.state.duration-this.mediaStore.state.currentTime<9))return[3,9];this.preloadSymbol=!0,a=0,n.label=1;case 1:return an.startTime&&rn.startTime&&r1?u+"?p=".concat(this.configStore.p):u, c="//player.bilibili.com/player.html?".concat(this.configStore.bvid?"bvid=".concat(this.configStore.bvid):"aid=".concat(this.configStore.aid),"&cid=").concat(this.configStore.cid,"&p=").concat(this.configStore.p,"&share_source=").concat(Br.link);else{var d=l.HR.Pgc;this.uiStore.kind===l.HR.Pgc&&(u="https://www.bilibili.com/bangumi/play/ep".concat(this.configStore.episodeId)),this.uiStore.kind===l.HR.Pugv&&(u="https://www.bilibili.com/cheese/play/ep".concat(this.configStore.episodeId),d=l.HR.Pugv),c="//player.bilibili.com/player.html?episodeId=".concat(this.configStore.episodeId,"&kind=").concat(d)}var f=(null===(r=document.querySelector('meta[name="description"]'))||void 0===r?void 0:r.getAttribute("content"))||this.ctrlStore.title||this.storyStore.state.title;this.setConfig({url:u,iframeSrc:c}),i&&this.setConfig({title:(0,wr.t)(Vr||(Vr=(0,n.cy)(["",""],["",""])),i)}),f&&this.setConfig({description:f})},t.prototype.open=function(e){var t;if(!this.endingStore.state.disabled){if(!this.state.opened){var r=this.rootPlayer.window.document.title||this.ctrlStore.title||this.storyStore.state.title,i=(null===(t=document.querySelector('meta[name="description"]'))||void 0===t?void 0:t.getAttribute("content"))||this.ctrlStore.title||this.storyStore.state.title;this.setConfig({title:(0,wr.t)(Wr||(Wr=(0,n.cy)(["",""],["",""])),r),description:i}),this.setState({opened:!0})}e&&this.setConfig(e)}},t.prototype.close=function(){this.state.opened&&this.setState({opened:!1})},t.prototype.setConfig=function(e){if((0,Fr.Z)(this.config)&&(0,Fr.Z)(e))for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&Object.prototype.hasOwnProperty.call(this.config,t)&&this.config[t]!==e[t]&&(this.config[t]=e[t])},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.close()},(0,n.gn)([o.LO],t.prototype,"config",void 0),(0,n.gn)([o.Fl],t.prototype,"url",null),(0,n.gn)([o.Fl],t.prototype,"embededUrl",null),(0,n.gn)([o.Fl],t.prototype,"title",null),(0,n.gn)([o.Fl],t.prototype,"pic",null),(0,n.gn)([o.Fl],t.prototype,"description",null),(0,n.gn)([o.Fl],t.prototype,"iframeSrc",null),(0,n.gn)([o.Fl],t.prototype,"weiboTag",null),(0,n.gn)([o.aD],t.prototype,"setConfig",null),t}(u.u),qr=function(e){function t(t){var r,n=e.call(this,t)||this;return n.tag="SubtitleStore",n.renderData=((r={})[0]=null,r[1]=null,r),(0,o.rC)(n),n}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{hover:!1,enable:!1,isclosed:!0,lan:"",minorLan:"",fade:!1,color:"",scale:!1,shadow:null,opacity:null,fontsize:null,bilingual:!1,position:null,languageList:null}},enumerable:!1,configurable:!0}),t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this),this.setState(this.localStore.get().subtitle)},t.prototype.onMounted=function(){var t=this;e.prototype.onMounted.call(this),this.dc.fade=(0,o.U5)((function(){return t.state.fade}),(function(e){t.localStore.set({subtitle:{fade:e}})})),this.dc.color=(0,o.U5)((function(){return t.state.color}),(function(e){t.localStore.set({subtitle:{color:e}})})),this.dc.scale=(0,o.U5)((function(){return t.state.scale}),(function(e){t.localStore.set({subtitle:{scale:e}})})),this.dc.shadow=(0,o.U5)((function(){return t.state.shadow}),(function(e){t.localStore.set({subtitle:{shadow:e}})})),this.dc.opacity=(0,o.U5)((function(){return t.state.opacity}),(function(e){t.localStore.set({subtitle:{opacity:e}})})),this.dc.fontsize=(0,o.U5)((function(){return t.state.fontsize}),(function(e){t.localStore.set({subtitle:{fontsize:e}})})),this.dc.position=(0,o.U5)((function(){return t.state.position}),(function(e){t.localStore.set({subtitle:{position:e}})}))},t.prototype.onLoaded=function(e){var t,r,n,i=null==e?void 0:e.subtitle;if(i&&((null===(t=i.subtitles)||void 0===t?void 0:t.length)||i.allow_submit&&this.uiStore.kind!==l.HR.Pgc||e.isOwner||(null==e?void 0:e.needLoginSubtitle))){var o=Object.assign([],i.subtitles);o.sort((function(e,t){return e.lan>t.lan?-1:1}));var a=o.filter((function(e){return 2!==e.ai_status})),s=a.length?a:o,u=this.getDefaultLanguage(s,"lan")||(null===(r=s[0])||void 0===r?void 0:r.lan),c=(a.length>1?a:o).filter((function(e){return e.lan!==u})),d=this.getDefaultLanguage(c,"minorLan")||(null===(n=c[0])||void 0===n?void 0:n.lan);o.length&&this.setState({languageList:o}),a.length<=1&&this.setState({bilingual:!1}),this.setState({isclosed:!a.length,lan:u||"",minorLan:d||""}),this.setState({enable:!0})}},t.prototype.getDefaultLanguage=function(e,t){var r=function(t){var r=-1;return e.some((function(e,n){if(e.lan===t)return r=n,!0})),-1!==r},n=function(t){t=t.split("-")[0];var r=e.find((function(e){return new RegExp("^".concat(t,"-")).test(e.lan)}));return r&&r.lan},i=this.localStore.get().subtitle[t];if("close"===i)return null;if(i&&r(i))return i;if(navigator.language){if(r(navigator.language))return navigator.language;if(a=n(navigator.language))return a}if(navigator.languages){for(var o=0;o=n.from&&t<=n.to)return r}return null}return null},enumerable:!1,configurable:!0}),t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{pbpstate:1})},(0,n.gn)([o.Fl],t.prototype,"isActive",null),(0,n.gn)([o.Fl],t.prototype,"bufferRatio",null),(0,n.gn)([o.Fl],t.prototype,"currentRatio",null),(0,n.gn)([o.Fl],t.prototype,"segmentData",null),(0,n.gn)([o.Fl],t.prototype,"viewpoint",null),(0,n.gn)([o.Fl],t.prototype,"activeDivisionIndex",null),t}(u.u),Qr=r(28897),Jr=r(22241);!function(e){e.None="none",e.Start="start",e.Cancel="cancel"}(Hr||(Hr={})),function(e){e[e.UGCSinglePart=0]="UGCSinglePart",e[e.UGCMultiPart=1]="UGCMultiPart",e[e.UGCSeasonPart=2]="UGCSeasonPart",e[e.PlaylistPart=3]="PlaylistPart",e[e.ActivityPart=4]="ActivityPart"}(Zr||(Zr={})),function(e){e[e.Disable=-1]="Disable",e[e.Electric=1]="Electric",e[e.ElectricPlus=2]="ElectricPlus",e[e.HighElectric=3]="HighElectric"}(Yr||(Yr={}));var $r,en=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="ManuscriptStore",(0,o.rC)(r),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{title:"",cover:"",type:null,list:null,ugcMultipEpisodeList:null,ugcMultiFlattenEpisodeList:null,likeStatus:!1,coinStatus:!1,collectStatus:!1,likeDisable:!1,coinDisable:!1,collectDisable:!1,related:null,relatedAutoplay:!1,likeIcon:"",electricStatus:Yr.Disable,electricBtnIcon:"",electricBtnText:"",stat:null,payed:null}},enumerable:!1,configurable:!0}),t.prototype.onPrepared=function(){e.prototype.onPrepared.call(this),this.configStore.embeddedEnv&&this.fetchStoryInfo(),this.togglePoster(!0),this.fetchViewInfo()},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.rootPlayer.on(s.p.MEDIA_PLAY,(function(){return t.togglePoster(!1)}))},Object.defineProperty(t.prototype,"tripleStatus",{get:function(){var e,t=(e=this.state).likeStatus,r=e.coinStatus,n=e.collectStatus,i=t&&r&&n;return this.hasTriple&&i},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTriple",{get:function(){var e,t=(e=this.state).likeDisable,r=e.coinDisable,n=e.collectDisable;return!(t||r||n||this.configStore.isChannel(l.u5.Embedded))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eplist",{get:function(){var e,t,r=this.state.list;if(r&&r.length){for(var n=[],i=0;i0)return e.filter((function(e){return e.multiEpisodeType===Qr.U.Section}))},enumerable:!1,configurable:!0}),t.prototype.fetchStoryInfo=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t=this;return(0,n.Jh)(this,(function(r){switch(r.label){case 0:return e=(0,o.gx)((function(){return t.rootStore.isPrepared})),this.dp.isPrepared&&this.dp.isPrepared(),this.dp.isPrepared=function(){return e.cancel()},[4,e];case 1:return r.sent(),[2,this.httpStore.fetchVideoDetail(!0).then((function(e){var r=e.body,n=r.video,i=r.relate;n&&t.setState({title:n.title,stat:n.stat}),i&&t.setState({related:i})})).catch((function(e){if(!Z.Z.isCancel(e))return Promise.reject(e)}))]}}))}))},t.prototype.fetchViewInfo=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t=this;return(0,n.Jh)(this,(function(r){switch(r.label){case 0:return this.uiStore.kind!==l.HR.Pugv?[2]:(e=(0,o.gx)((function(){return t.rootStore.isPrepared})),this.dp.isViewPrepared&&this.dp.isViewPrepared(),this.dp.isViewPrepared=function(){return e.cancel()},[4,e]);case 1:return r.sent(),[2,this.httpStore.fetchViewInfo(!0).then((function(e){var r=e.body.payed;t.setState({payed:r})})).catch((function(e){if(!Z.Z.isCancel(e))return Promise.reject(e)}))]}}))}))},t.prototype.togglePoster=function(e){if(this.configStore.poster){var t=this.mediaStore.video.paused,r=this.nodes.videoPoster;e&&!this.mediaStore.autoplay?t&&this.httpStore.fetchViewInfo(!0).then((function(e){r.innerHTML='poster'),t&&(r.hidden=!1)})):r.hidden||(r.hidden=!0)}},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{title:1,cover:1,type:1,list:1,likeStatus:1,coinStatus:1,collectStatus:1,likeDisable:1,coinDisable:1,collectDisable:1,related:1,relatedAutoplay:1}),this.nodes.videoPoster&&(this.nodes.videoPoster.hidden=!0)},(0,n.gn)([o.Fl],t.prototype,"eplist",null),(0,n.gn)([o.Fl],t.prototype,"ugcMultiEpisode",null),(0,n.gn)([o.Fl],t.prototype,"ugcSectionList",null),t}(u.u),tn=r(27483),rn=r.n(tn);!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR"}($r||($r={}));var nn,on,an=function(){function e(){this.maximum=1e5,this.instances=new Map,this.records=new Set}return e.prototype.getLogger=function(t){ var r="@@".concat(t),n=this.instances;if(n.has(r))return n.get(r);var i=this.records,o=new e;return o.moduleId=t,o.records=i,n.set(r,o),o},e.prototype.add=function(e){for(var t=[],r=1;r0&&i.size>n&&i.delete(i.keys().next().value),i.add(a)},e.prototype.getFilteredLog=function(e){var t,r,i,o,a;void 0===e&&(e={});var s=this.records,u=this.moduleId,l=null!==(a=e.level)&&void 0!==a?a:-1,c=e.limit||1/0,d=[],f=[];e.header&&(f.push("--------------- Header(S) ---------------"),f.push(e.header),f.push("--------------- Header(E) ---------------"),f.push(""));try{for(var p=(0,n.XA)(s.values()),h=p.next();!h.done;h=p.next()){var y=h.value;if(!e.filterModuleId||y.moduleId===u){if(d.length>=c)break;y.level>=l&&d.push(y)}}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}f.push("--------------- Content(S) ---------------");var m=function(e){var t=[];t.push("[".concat(rn()(e.timestamp).format("YYYY-MM-DD hh:mm:ss"),"]")),t.push($r[e.level]),e.moduleId&&t.push("[".concat(e.moduleId,"]")),e.messages.forEach((function(e){return t.push(ee(nn||(nn=(0,n.cy)(["",""],["",""])),e))})),f.push(t.join(" "))};try{for(var g=(0,n.XA)(d),v=g.next();!v.done;v=g.next()){m(v.value)}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}return f.push("--------------- Content(E) ---------------"),e.footer&&(f.push(""),f.push("--------------- Footer(S) ---------------"),f.push(e.footer),f.push("--------------- Footer(E) ---------------")),f.join("\n")},e.prototype.d=function(){for(var e=[],t=0;t0)for(var r=e.pendingList,n=Math.min(t,r.length),i=0;io.maximum)for(var a=i.size-o.maximum+o.discard,s=(0,n.ev)([],(0,n.CR)(i.keys()),!1),u=0;ue.expired},e.buf=new Map,e.quota={discard:4,maximum:32},e.expired=18e5,e}(),dn=new(function(){function e(){this.log=new an,this.track=new un,this.mseSupported=(0,sn.a)()}return e.prototype.getParams=function(e,t){var r={qn:0,fnver:0,fnval:sr.xL.getFnVal({mseSupported:this.mseSupported,enableHEVC:t.enableHEVC,enableAV1:t.enableAV1}),fourk:1,voice_balance:1,gaia_source:"pre-load",isGaiaAvoided:!0};return Object.assign(r,e)},e.prototype.getConfig=function(e){var t={kind:l.HR.Ugc,mseSupported:this.mseSupported,retryCount:0,fromPrefetch:!0};switch(e.kind){case l.HR.Pgc:t.kind=l.HR.Pgc;break;case l.HR.Pugv:t.kind=l.HR.Pugv;break;case l.HR.Ugc:default:t.kind=l.HR.Ugc}return t},e.prototype.r=function(e,t){var r=new sr.xL(this,{persistent:!0}),n=this.getParams(e,t),i=this.getConfig(t),o=r.r(n,i).then((function(e){return e&&e.raw&&!e.raw[sr.xL.reqCacheKey]&&(e.raw[sr.xL.reqCacheKey]=(0,le.Z)({},n)),e}));return{http:r,promise:o}},e}());function fn(e,t){var r=cn.key(e.cid,e.ep_id);cn.has(r)||ln.add((function(){if(cn.has(r))return Promise.reject(new Error("Cached"));var n=dn.r(e,t);return cn.set(r,{http:n.http,promise:n.promise,timeStamp:Date.now()}),n.promise}))}function pn(e,t,r){var n=new XMLHttpRequest,i=new Promise((function(i,o){n.responseType="arraybuffer",n.onload=function(){return i(n.response)},n.onerror=o,n.onabort=o,n.open("GET",e,!0),n.setRequestHeader("Range","bytes=".concat(t,"-").concat(r-1)),n.send()}));return{xhr:n,promise:i}}var hn,yn,mn=r(53680),gn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="MpdAtom",t.endedTimer=null,t}return(0,n.ZT)(t,e),t.prototype.fixRenewal=function(){var e=this;queueMicrotask((function(){var t=e.rootStore,r=t.configStore,n=t.episodeStore;e.log.w("[Renewal]"),r.remove("cid"),n.reload(null,{isRenewal:!0},{origin:0})}))},t.prototype.getStreamKid=function(e){if(e){var t=e.mediaDataSource,r=null==t?void 0:t.url,n=null==r?void 0:r.video;if(Array.isArray(n)&&n.length){var i=n[0],o=null==i?void 0:i.bilidrm_uri;if("string"==typeof o)return o.split("//").pop()}}return null},t.prototype.getLastWatchSecond=function(e){var t,r,n=this.rootStore,i=(n.episodeStore,n.configStore),o=n.mediaStore;if(!i.fromDid&&e){var a=o.video,s=i.cid,u=i.episodeId||(null===(r=null===(t=null==e?void 0:e.playViewBusinessInfo)||void 0===t?void 0:t.episodeInfo)||void 0===r?void 0:r.ep_id),l=o.state.duration,c=a.currentTime,d=(e.lastPlayTime||0)/1e3,f=s&&s===e.lastPlayCid,p=u&&((null==e?void 0:e.lastPlayEpid)===u||!!d);if((f||p)&&(c<3&&d>=5&&d30)return d}return 0},t.prototype.getCachedRawMpd=function(){var e,t=this.rootStore,r=t.episodeStore,n=t.interactStore,i=t.configStore,o=r.isFirst,a=this.rootPlayer.cd.playUrl;if(a&&(this.rootPlayer.cd.playUrl=null,o))return a;var s=i.cid,u=function(e,t){return cn.get(cn.key(e,t))}(s,i.episodeId);return u&&u.json?u.json.raw:null===(e=n.preloadDataMap.get(s))||void 0===e?void 0:e.playurlData},t.prototype.getSuspectDuration=function(e){if(e&&e.timelength&&e.mediaDataSource.duration){var t=Math.max(0,(e.timelength-e.mediaDataSource.duration)/1e3);return t>5?t:0}return 0},t.prototype.getLoudnessParams=function(e){ var t=this.rootStore.patchAdvStore;if(t.isPlayingPatch()){var r=t.Episode;return r&&r.loudnessParams?r.loudnessParams:null}return e.loudnessParams},t.prototype.errProxy=function(e){if(e){var t=this.rootStore,r=t.uiStore,n=t.errorStore,i=r.kind,o=e.message||"",a=e.playUrl||"",s=null,u=null;if(o&&/JSON/.test(o))s=i===l.HR.Pgc?2110:2103,u="status:".concat(o,",url:").concat(a);else switch(e.errType){case 1:s=i===l.HR.Pgc?2111:2104,u="status:".concat(o,",url:").concat(a);break;case 0:s=i===l.HR.Pgc?2108:2101,u="type:https,status:".concat(o,",url:").concat(a);break;default:return}n.err(2,s,u)}},t.prototype.triggerLoadedAction=function(e,t){var r,i,o,a,s,u,l,c=this,d=this.rootStore,f=d.mpdStore,p=d.episodeStore,h=d.errorStore,y=d.configStore,m=d.interactStore,g=d.freeStore,v=d.kernelStore,b=d.qualityStore,_=d.patchAdvStore,E=p.isFirst,S=p.state.isSameEpisode,A=(E?(0,j.Ac)():null)||(null===(r=m.preloadDataMap.get(y.cid))||void 0===r?void 0:r.videoData),w=!(!S||!A),T=_.hasValidAdv,R=null===(i=null==e?void 0:e.playViewBusinessInfo)||void 0===i?void 0:i.episodeInfo,C=null===(o=null==e?void 0:e.playViewBusinessInfo)||void 0===o?void 0:o.seasonInfo;if(!T&&R&&y.setEpConfig((0,n.pi)((0,n.pi)({},R),{episodeId:R.ep_id})),C&&y.setEpConfig({seasonId:C.season_id,seasonType:C.season_type}),f.setState({cidSettled:!0}),h.resetCounter(),null===(a=null==e?void 0:e.viewInfo)||void 0===a?void 0:a.qnTrialInfo){var P=(null===(s=null==e?void 0:e.viewInfo)||void 0===s?void 0:s.qnTrialInfo)||{},I=P.remaining_times,D=P.trial_able,O=P.start,x=P.time_length,k=P.end_toast,N=P.auto_panel;if(D&&I){var L=null===(u=e.supportFormats)||void 0===u?void 0:u.map((function(e){return e.quality}));(0,mn.Z)(L)>Ne.nJ.alias.FHD_80&&b.setState({trialInfo:{remainingTimes:I,start:O,trialable:D,timelength:x,endToast:k,autoPanel:N||!1}})}}if(null===(l=null==e?void 0:e.viewInfo)||void 0===l?void 0:l.aiRepairQnTrialInfo){var M=e.viewInfo.aiRepairQnTrialInfo;I=M.remaining_times,D=M.trial_able,k=M.end_toast,O=M.start,x=M.time_length;D&&I>0&&b.setState({aiSwitchQualityTrialable:D,aiTrialQnResourceInfo:{icon:k.icon,start:O,timelength:x}})}f.drmTechType?g.guardAtom.validPerm().then((function(){c.log.i("validPerm","done"),v.attachExternal({mediaDataSource:e.mediaDataSource,quality:c.hackMpdData(e)},{initiator:t,preloadAVData:A,enableTransition:w})})).catch((function(e){g.guardAtom.handlePermDenied(e,t)})):v.attachExternal({mediaDataSource:e.mediaDataSource,quality:this.hackMpdData(e)},{initiator:t,preloadAVData:A,enableTransition:w})},t.prototype.hackMpdData=function(e){var t=this.rootStore,r=t.qualityStore,n=t.userStore,i=t.uiStore,o=e.quality;if(r.state.isTrialQuality)return r.state.reqQuality;if(i.kind!==l.HR.Ugc||n.isLogin){try{var a=r.requestQ;if(o!==a&&"string"!=typeof e.mediaDataSource.url){var s=e.mediaDataSource.url.video;if(!s||!s.length)return o;if(!!s.find((function(e){return e.id===a})))return a}if([Ne.nJ.alias.UHD_DVision,Ne.nJ.alias.UHD_HDR].includes(o)&&"string"!=typeof e.mediaDataSource.url&&Array.isArray(e.supportFormats)&&e.supportFormats.length>0){var u=fe().getSupportedVideoIdList(e.supportFormats,{enableAV1:this.rootStore.configStore.enableAV1,enableHEVC:this.rootStore.configStore.enableHEVC});if(!u.includes(o))return u.reduce((function(e,t){return t!==o?Math.max(e,t):e}),0)||o}}catch(e){}return o}return 16},t.prototype.prefetchAVData=function(e){return(0,n.mG)(this,void 0,void 0,(function(){var t,r,i,o,a,s,u,l,c;return(0,n.Jh)(this,(function(d){return t=this.rootStore.kernelStore.dashKernel,r=function(e,t,r,i){var o,a;if(void 0===i&&(i=7),Array.isArray(r))try{for(var s=(0,n.XA)(r),u=s.next();!u.done;u=s.next()){var l=u.value;if(l.id===e&&l.baseUrl&&(l.codecid===i&&"video"===t||"audio"===t))return l.baseUrl.replace("http://","https://")}}catch(e){o={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}},"dash"===e.mediaDataSource.type&&t&&(c=t.getCurrentCodecID("video"),a=t.getQualityNumberFromQualityIndex(t.getQualityFor("video"),"video"),u=t.getQualityNumberFromQualityIndex(t.getQualityFor("audio"),"audio"),s=r(a,"video",e.mediaDataSource.url.video,c),l=r(u,"audio",e.mediaDataSource.url.audio),s&&(i=pn(s,0,5e5)),l&&(o=pn(l,0,2e4))),[2,{vbHttp:i,abHttp:o,videoQn:a,videoUrl:s,audioQn:u,audioUrl:l}]}))}))},t.prototype.setEndedTimer=function(e){var t=this;0===e&&(this.delEndedTimer(),this.dp.tmpPrepared=(0,o.gx)((function(){return t.rootStore.isPrepared}),(function(){t.endedTimer=window.setTimeout((function(){return t.rootStore.mpdStore.setState({isMpdEnded:!0})}),0)})))},t.prototype.delEndedTimer=function(){this.endedTimer&&(clearTimeout(this.endedTimer),this.endedTimer=null),this.dp.tmpPrepared&&this.dp.tmpPrepared()},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.delEndedTimer()},t}(u.f),vn=function(e){function t(t){var r=e.call(this,t)||this;return r.tag="MpdStore",r.body=null,(0,o.rC)(r),r.mpdAtom=new gn(t),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{isMpdEnded:!1,isMpdRequested:!1,isPreviewStream:null,suspectDuration:0,playUrlCode:null,mpdRetries:-1,cidSettled:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dmStartOffset",{get:function(){return this.body&&this.body.dmOffset||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drmTechType",{get:function(){return this.body?this.body.drmTechType:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamKid",{get:function(){return this.mpdAtom.getStreamKid(this.body)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastWatchSecond",{get:function(){return this.mpdAtom.getLastWatchSecond(this.body)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loudnessParams",{get:function(){return this.mpdAtom.getLoudnessParams(this.body)},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.setPreviewStream=(0,o.U5)((function(){return{body:t.body,info:t.userStore.info}}),(function(e){switch(t.uiStore.state.kind){case l.HR.Pgc:case l.HR.Pugv:e.body&&t.setState({isPreviewStream:!!e.body.isPreview});break;case l.HR.Ugc:default:e.info&&t.setState({isPreviewStream:!!e.info.isUgcPayPreview})}})),this.dc.isPreviewStream=(0,o.U5)((function(){return t.state.isPreviewStream}),(function(e){return t.setState({suspectDuration:e?t.mpdAtom.getSuspectDuration(t.body):0})})),this.dc.suspectDuration=(0,o.U5)((function(){return t.state.suspectDuration}),(function(){return t.rootPlayer.emit(a.t.Player_DurationChange,new CustomEvent(a.t.Player_DurationChange))}))},t.prototype.onCommitted=function(){e.prototype.onCommitted.call(this);var t=this.httpStore.getViewKind();t.isFatalError||t.isMissing||(this.log.i("[PlayUrl]",'Starting on "Committed" hook'),this.startPlayUrlProxy(),this.setState({isMpdRequested:!0}))},t.prototype.onPrepared=function(){e.prototype.onPrepared.call(this),this.state.isMpdRequested||(this.log.i("[PlayUrl]",'Starting on "Prepared" hook'),this.startPlayUrlProxy())},t.prototype.startPlayUrlProxy=function(){this.fetchPlayUrl(null,{initiator:0,preloadPlayUrl:this.mpdAtom.getCachedRawMpd()})},t.prototype.hasHistory=function(e){var t=null==e?void 0:e.lastPlayTime;return t&&t>0},t.prototype.preSetPatchPlayUrlParams=function(e){var t=this.patchAdvStore.getPatchPlayUrlParams();return t&&(e||(e={}),Object.assign(e,t)),e},Object.defineProperty(t.prototype,"cidSettled",{get:function(){return this.state.cidSettled},enumerable:!1,configurable:!0}),t.prototype.fetchPlayUrl=function(e,t){var r=this;this.rootStore.stageAtom.set(3),e=this.preSetPatchPlayUrlParams(e);var n=t&&t.initiator;if(this.configStore.localUrl)return this.rootStore.stageAtom.set(5),void this.kernelStore.attachExternal({quality:0,mediaDataSource:{type:"mp4",url:this.configStore.localUrl}},{initiator:n});this.httpStore.fetchPlayUrl(!1,e,t).then((function(e){return function(e){var t,i;r.rootStore.stageAtom.set(4),r.rootPlayer.emit(a.t.Player_PlayUrl_Done,new CustomEvent(a.t.Player_PlayUrl_Done,{detail:{raw:e.raw}})), r.configStore.embeddedEnv&&e.body.quality>r.qualityStore.maxEmbeddedQn&&r.qualityStore.maxEmbeddedQn&&(e.body.quality=r.qualityStore.maxEmbeddedQn);var o=e.body.parsedFragmentVideoInfoList;if(r.patchAdvStore.setState({reportList:e.body.parsedReportFragmentVideoInfoList}),Array.isArray(o)&&o.length>1){var s=0;r.patchAdvStore.hasValidAdv?s=r.patchAdvStore.state.index:r.patchAdvStore.setState({reportList:e.body.parsedReportFragmentVideoInfoList});var u=void 0,l=void 0,c=void 0;(null===(i=null===(t=e.body)||void 0===t?void 0:t.playViewBusinessInfo)||void 0===i?void 0:i.episodeInfo)&&(u=e.body.playViewBusinessInfo.episodeInfo.aid,l=e.body.playViewBusinessInfo.episodeInfo.cid,c=e.body.playViewBusinessInfo.episodeInfo.ep_id),r.patchAdvStore.setState({videoList:e.body.parsedFragmentVideoInfoList}),r.patchAdvStore.setState({mainInfo:{aid:r.configStore.aid||u,cid:r.configStore.cid||l,episodeId:r.configStore.episodeId||c,timelength:e.body.parsedFragmentVideoInfoList[r.patchAdvStore.getMainIndex()].timelength}}),r.hasHistory(e.body)||r.configStore.t?(s=r.patchAdvStore.getMainIndex(),r.configStore.setEpConfig({aid:u,cid:l})):o[s].fragmentInfo&&r.configStore.startAdvPatchParser({aid:o[s].fragmentInfo.aid,cid:o[s].fragmentInfo.cid,episodeId:r.patchAdvStore.mainInfo.episodeId,extraEPInfo:r.configStore.extraEPInfo,seasonId:r.configStore.seasonId,seasonType:r.configStore.seasonType}),r.patchAdvStore.setState({index:s}),r.setMpdBody(o[s],n)}else r.setMpdBody(e.body,n);r.setState({mpdRetries:e.retries}),r.mpdAtom.setEndedTimer(n)}(e)})).catch((function(e){if(!Z.Z.isCancel(e)){if(r.rootStore.stageAtom.set(5),r.rootPlayer.emit(a.t.Player_PlayUrl_Done,new CustomEvent(a.t.Player_PlayUrl_Done,{detail:{raw:e.raw}})),e){if("TypeError"===e.name)return console.error(e),r.log.e("[Fatal]",e.message,e.stack);null!==e.code&&r.setState({playUrlCode:e.code}),null!=e.retries&&r.setState({mpdRetries:e.retries})}if(0===n&&e&&2===e.errType)return r.mpdAtom.fixRenewal();r.mpdAtom.errProxy(e),r.rootPlayer.emit(s.p.ERROR_PLAY_URL,e,n,null==e?void 0:e.playPermissionDenied),r.mpdAtom.setEndedTimer(n)}}))},t.prototype.patchAdapt=function(e){if(!e||!this.patchAdvStore.hasValidAdv)return e;var t=this.patchAdvStore.prePatchDurationInSecAndInt(),r=e.clipInfoList;return r&&r.length&&r.forEach((function(e){e.start+=t,e.end+=t})),e},t.prototype.setMpdBody=function(e,t){e&&e.session&&(this.configStore.session=e.session),this.body=this.patchAdapt(e),this.mpdAtom.triggerLoadedAction(e,t)},t.prototype.prefetchPlayUrl=function(e,t){var r=new sr.xL(this.rootPlayer,{persistent:!0});return e=this.preSetPatchPlayUrlParams(e),{http:r,promise:this.httpStore.getHttpReqFunc(r)(this.httpStore.getPlayUrlParams(e),this.httpStore.getPlayUrlConfig(t))}},t.prototype.prefetchAVData=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.mpdAtom.prefetchAVData(e)]}))}))},t.prototype.fallback=function(e,t,r){var n=this.metricStore.quitInfo;this.log.w("[DRM:fallback]",t,r),null==n.drmErr&&(n.drmErr=e),this.fetchPlayUrl(null,{initiator:3,drmFallback:!0})},Object.defineProperty(t.prototype,"payInfoDecision",{get:function(){var e,t,r=null===(t=null===(e=this.body)||void 0===e?void 0:e.playViewBusinessInfo)||void 0===t?void 0:t.userStatus.pay_info;if(r){var n=r.pay_check,i=r.pay_pack_paid,o=r.sponsor;return n||i||o}return!1},enumerable:!1,configurable:!0}),(0,n.gn)([o.LO.shallow],t.prototype,"body",void 0),(0,n.gn)([o.aD],t.prototype,"setMpdBody",null),t}(u.u),bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{seekDetail:{start:null,total:0},enterDetail:{start:0,total:0,locked:!1}}},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.rootPlayer.on(a.t.Player_Initialized,(function(){t.state.enterDetail.locked&&t.changeState(t.state.enterDetail,{start:t.portStore.getCurrentTime()})})),this.rootPlayer.on(a.t.Player_Seeking,(function(){t.seekingDetailHandler(),null===t.state.seekDetail.start&&t.changeState(t.state.seekDetail,{start:t.portStore.getCurrentTime()})})),this.rootPlayer.on(a.t.Player_Seeked,(function(){var e;t.seekedDetailHandler();var r=(e=t.state.seekDetail).start,n=e.total;if(null!==r){var i=n+t.portStore.getCurrentTime()-r;t.changeState(t.state.seekDetail,{total:i,start:null})}})),this.rootPlayer.on(a.t.Player_Statue_Changed,(function(){t.uiStore.screenKind===l.dY.Pip?t.pipEnterDetailHandler():t.pipLeaveDetailHandler()})),this.rootPlayer.window.addEventListener("beforeunload",this.onBeforeUnloadHandler)},t.prototype.seekingDetailHandler=function(){this.state.enterDetail.locked&&null===this.state.seekDetail.start&&this.changeState(this.state.seekDetail,{start:this.portStore.getCurrentTime()})},t.prototype.seekedDetailHandler=function(){var e,t=(e=this.state.seekDetail).start,r=e.total;this.state.enterDetail.locked&&null!==t&&this.changeState(this.state.seekDetail,{start:null,total:r+this.portStore.getCurrentTime()-t})},t.prototype.resetSeekDetail=function(){this.state.enterDetail.locked||this.changeState(this.state.seekDetail,{start:null,total:0})},t.prototype.pipEnterDetailHandler=function(){this.resetSeekDetail(),this.state.enterDetail.locked||this.changeState(this.state.enterDetail,{locked:!0,start:this.portStore.getCurrentTime()})},t.prototype.pipLeaveDetailHandler=function(e){var t;void 0===e&&(e=!1);var r=(t=this.state.enterDetail).locked,n=t.start,i=t.total;if(r){var o=this.portStore.getCurrentTime(),a=i+o-n-this.state.seekDetail.total;this.changeState(this.state.enterDetail,{total:a,start:o,locked:e}),this.changeState(this.state.seekDetail,{total:0})}},t.prototype.getPipPlayingDuration=function(){return this.pipLeaveDetailHandler(!0),this.state.enterDetail.total},t.prototype.onBeforeUnloadHandler=function(){this.reportPipDuration()},t.prototype.reportPipDuration=function(e){void 0===e&&(e=!0);var t=Math.round(this.getPipPlayingDuration());t&&this.track.e("pip_playing_duration",t,{sendBeacon:e})},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{enterDetail:1,seekDetail:1}),this.pipLeaveDetailHandler(this.state.enterDetail.locked),this.reportPipDuration(!1),this.changeState(this.state.enterDetail,{total:0})},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.rootPlayer.window.removeEventListener("beforeunload",this.onBeforeUnloadHandler)},(0,n.gn)([i.ak],t.prototype,"onBeforeUnloadHandler",null),t}(u.u),_n=r(17847);!function(e){e[e.RECOMMEND=0]="RECOMMEND",e[e.HEVC=1]="HEVC",e[e.DISABLE=2]="DISABLE",e[e.AV1=3]="AV1"}(hn||(hn={})),function(e){e[e.QN_8K=127]="QN_8K",e[e.QN_DOLBY_VISION=126]="QN_DOLBY_VISION",e[e.QN_HDR10=125]="QN_HDR10",e[e.QN_4K=120]="QN_4K",e[e.QN_1080P_60=116]="QN_1080P_60",e[e.QN_1080P_PLUS=112]="QN_1080P_PLUS",e[e.QN_1080P=80]="QN_1080P",e[e.QN_720P_60=74]="QN_720P_60",e[e.QN_720P=64]="QN_720P",e[e.QN_480P=32]="QN_480P",e[e.QN_360P=16]="QN_360P"}(yn||(yn={}));var En,Sn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="WmpStore",t.WASM_PLAYER_MAX_QUALITY=116,t.WASM_PLAYER_DISABLE="bwphevc_disable",t.QUALITY_CPU_MAP={16:4,32:4,64:4,80:4,0:4,112:8,116:16},t.BLACK_LIST={1:!0,2:!0,9:!0,18:!0,208259:!0,1684013:!0,3479095:!0,9099524:!0,12754559:!0,21673742:!0,35361273:!0,40016273:!0,345039937:!0,386593697:!0,9285500:!0},t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"isDisabledWasmPlayer",{get:function(){try{return!0}catch(e){}return"1"===(0,C.Gg)(this.WASM_PLAYER_DISABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPrefEnableWasmPlayer",{get:function(){return!this.mpdStore.drmTechType&&this.configStore.enableWMP&&fe().isBwpHEVCPrefSupported()},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.rootPlayer.on(s.p.WASM_PLAYER_FALLBACK,(function(){t.track.o("wasm_player",{code:7011}),t.log.i("WasmPlayer onperformance fallback to H.264"),t.disableWasmPlayer(),t.qualityStore.switchProxy()}))},t.prototype.isBwpElement=function(e){return"BWP-VIDEO"===(null==e?void 0:e.tagName)}, t.prototype.isUseWasmPlayer=function(e){return!(!window.__ENABLE_WASM_PLAYER__||!this.isBwpElement(e))},t.prototype.isNeedSwitchBwpVideoTag=function(e,t,r){var n=this.isUseWasmPlayer(e),i=this.isCanUseWasmPlayer(t,r);if(n){if(!i)return!0}else if(i)return!0;return!1},t.prototype.checkWasmPlayerSupported=function(e,t){var r=this.mediaStore.video,n=this.createVideoElement(r,e,t);n&&r.parentElement&&(r.parentElement.insertBefore(n,r),this.mediaStore.replaceElement(n),this.rootPlayer.emit(s.p.PLAYER_MEDIA_CHANGED))},t.prototype.createNewVideoElement=function(e,t){var r=this.isUseWasmPlayer(this.mediaStore.video),n=this.createVideoElement(null,e,t);return!r||this.isUseWasmPlayer(n)||this.isDisabledWasmPlayer||this.track.o("wasm_player",{code:7012}),n},t.prototype.fallbackWasmPlayer=function(e){var t=this;return new Promise((function(r,n){t.isUseWasmPlayer(t.mediaStore.video)?(t.track.o("wasm_player",{code:e}),t.log.i("[fallbackWasmPlayer] fallback WasmPlayer, code: ".concat(e)),t.disableWasmPlayer(),t.qualityStore.switchProxy(),t.rootPlayer.once(s.p.PLAYER_MEDIA_CHANGED,(function(){r({})}))):r({})}))},t.prototype.onWasmPlayerError=function(e,t,r){void 0===r&&(r=!1),this.isUseWasmPlayer(e)&&(this.track.o("wasm_player",{code:(null==t?void 0:t.code)||7e3}),this.log.w("[onWasmPlayerError] WasmPlayer is enable, disable it, code: ".concat(null==t?void 0:t.code,", message: ").concat(null==t?void 0:t.message)),this.disableWasmPlayer(),r&&this.destroyWasmPlayer(e))},t.prototype.destroyWasmPlayer=function(e){e instanceof HTMLVideoElement||this.isBwpElement(e)&&(this.log.i("[destroyWasmPlayer] call WasmPlayer destroy"),e.destroy())},t.prototype.disableWasmPlayer=function(){(0,C.KY)(this.WASM_PLAYER_DISABLE,"1")},t.prototype.createVideoElement=function(e,t,r){var n=this,i=function(){return n.log.i("[createVideoElement] create native HTMLVideoElement"),window.__ENABLE_WASM_PLAYER__=!1,g()};if(this.isCanUseWasmPlayer(t,r)){if(!this.isBwpElement(e))return document.querySelectorAll("bwp-video").length>1?i():(this.log.i("[createVideoElement] create BwpElement"),window.__ENABLE_WASM_PLAYER__=!0,document.createElement("bwp-video"))}else if(!(e&&e instanceof HTMLVideoElement))return i();return null},t.prototype.isWasmPlayerSupported=function(e,t){var r,n;if(!window.AudioWorklet||!window.AudioWorkletNode||!window.SharedArrayBuffer)return!1;if(this.qualityStore.state.isTrialSwitch)return!1;if(!this.isPrefEnableWasmPlayer)return!1;if(null===(r=null==t?void 0:t.flac)||void 0===r?void 0:r.audio)return!1;if(this.BLACK_LIST[R.get("DedeUserID")]||window.frameElement||!(0,_n.isBwpSupported)()||this.isDisabledWasmPlayer)return!1;var i=(null===(n=null===window||void 0===window?void 0:window.navigator)||void 0===n?void 0:n.hardwareConcurrency)||0,o=this.QUALITY_CPU_MAP[e]||0;if(!o||ithis.WASM_PLAYER_MAX_QUALITY)return!1;return!!function(t,r){if(!(null==t?void 0:t.length)||!(null==r?void 0:r.length))return!1;var n=!1,i=!1,o=t.filter((function(e){return 12===e.codecid}));if(o.length<=0)return!1;var a=t.filter((function(e){return 7===e.codecid})),s=function(e){return e.filter((function(e){return e.id<=80})).length};return s(o)>=s(a)&&(i=!0),(o.find((function(t){return t.id===e}))||0===e)&&(n=!0),i&&n}(null==t?void 0:t.video,null==t?void 0:t.audio)},t.prototype.isAV1Supported=function(e,t){if(!fe().isAV1TypeSupported()||!(null==t?void 0:t.video))return!1;var r=t.video.filter((function(e){return 13===e.codecid}));if(!r.length)return!1;if(0!==e&&!r.some((function(t){return t.id===e})))return!1;var n=parseInt((0,C.tv)(T.uU),10)||hn.RECOMMEND,i=fe().shouldUseHardwareDecodingAV1()?yn.QN_4K:yn.QN_1080P_60;if(n===hn.RECOMMEND){if(e>i&&e=4&&t)||e.error)},enumerable:!1,configurable:!0}),t.prototype.setEarlyEOFSymbol=function(e){this.pcr.earlyEOFSymbol=e},t.prototype.getAbsolutePlayTime=function(){return this.getPlayTime(!1)},t.prototype.getRelativePlayTime=function(){return this.getPlayTime(!0)},t.prototype.getMaxPlayTime=function(){return Math.floor(this.maxTimeRecord)},t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.rootPlayer.window.addEventListener("beforeunload",this.onBeforeUnload),this.rootPlayer.on(a.t.Player_Dispose,(function(){return t.cleanAfterDispose()}),1),this.rootPlayer.on(s.p.MEDIA_TIMEUPDATE,(function(){t.startRecorder(),t.maxTimeRecordHandler()})).on(s.p.MEDIA_WAITING,(function(){return t.pauseRecorder()})).on(s.p.MEDIA_SEEKING,(function(){return t.pauseRecorder()})).on(s.p.MEDIA_SEEKED,(function(){t.maxTimeRecordHandler()})).on(s.p.MEDIA_PAUSE,(function(){return t.pauseRecorder()})).on(s.p.MEDIA_ENDED,(function(){t.pauseRecorder(),t.patchAdvStore.hasValidAdv?t.maxTimeRecordHandler(Math.floor(t.portStore.getDuration())):t.maxTimeRecordHandler(t.mediaStore.state.duration)}))},t.prototype.onPrepared=function(){var t=this;e.prototype.onPrepared.call(this),this.clearLongTaskTimer(),this.longTaskTimer=window.setInterval((function(){t.getAbsolutePlayTime()>5&&(t.clearLongTaskTimer(),t.ltMonitor=An.I.startDetectLongTask())}),1e3)},t.prototype.clearLongTaskTimer=function(){window.clearInterval(this.longTaskTimer),this.longTaskTimer=-1},t.prototype.startRecorder=function(){var e=Date.now(),t=this.mediaStore.state.currentTime;if(!this.mediaStore.video.paused){if(null!=this.rts){var r=e-this.rts,n=1e3*(t-this.mct),i=this.mediaStore.video.playbackRate;if(r>0&&i>0){var o=r<1500?r:Math.min(r,n);if(o>0&&o<1500){var a=(this.rtsMap.get(i)||0)+o;this.rtsMap.set(i,a)}}}this.rts=e,this.mct=t}},t.prototype.pauseRecorder=function(){this.rts=null,this.mct=null},t.prototype.maxTimeRecordHandler=function(e){this.patchAdvStore.hasValidAdv?this.maxTimeRecord=Math.max(this.maxTimeRecord,e||this.portStore.getCurrentTime()):this.maxTimeRecord=Math.max(this.maxTimeRecord,e||this.mediaStore.state.currentTime)},t.prototype.getPlayTime=function(e){var t=(0,n.ev)([],(0,n.CR)(this.rtsMap.entries()),!1).reduce((function(t,r){var i=(0,n.CR)(r,2),o=i[0];return t+i[1]*(e?o:1)}),0);return Math.floor(t/1e3)},t.prototype.onBeforeUnload=function(){this.pcr.pageUnload=!0,this.rootStore.isDisposing||(this.rootPlayer.emit(s.p.PLAYER_UNLOAD),this.rootPlayer.emit(s.p.PLAYER_UNLOADED))},t.prototype.disConnectLongTaskObserver=function(){this.ltMonitor&&this.ltMonitor.observer&&(this.ltMonitor.observer.disconnect(),this.ltMonitor=null)},t.prototype.cleanAfterDispose=function(){this.pcr.pageUnload=!1,this.pcr.earlyEOFSymbol=!1,this.pcr.quitInfo={},this.maxTimeRecord=0,this.pauseRecorder(),this.rtsMap.clear(),this.clearLongTaskTimer(),this.disConnectLongTaskObserver()},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.rootPlayer.window.removeEventListener("beforeunload",this.onBeforeUnload)},(0,n.gn)([i.ZP],t.prototype,"onBeforeUnload",null),t}(u.u),Tn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpHeartbeat",t.url="//api.bilibili.com/x/click-interface/web/heartbeat",t}return(0, n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,method:"POST",params:t,data:e,withCredentials:!0},{wbi:!0})]}))}))},t}(z.eV),Rn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hb={timer:null,startTime:null,disabled:!1,nextRestart:!1,prevPlayType:null},t.realPlayedTime=0,t}return(0,n.ZT)(t,e),t.prototype.onMount=function(){e.prototype.onMount.call(this),this.addEvents()},t.prototype.onPrepared=function(){var t=this;e.prototype.onPrepared.call(this),this.dp.vxStart=(0,o.gx)((function(){return t.trackStore.state.vxStart}),(function(){return t.startReport()}))},t.prototype.addEvents=function(){var e=this;this.rootPlayer.on(s.p.MEDIA_PLAYING,(function(){e.mediaStore.state.firstPlay&&(e.hb.nextRestart||e.heartbeat(3),e.hb.disabled=!1)})).on(s.p.MEDIA_PAUSE,(function(){e.mediaStore.state.firstPlay&&(e.isPlaybackCompleted()||e.heartbeat(2),e.hb.disabled=!0)})).on(s.p.MEDIA_SEEKED,(function(){e.hb.nextRestart&&(e.heartbeat(1),e.hb.nextRestart=!1)})).on(s.p.MEDIA_ENDED,(function(){e.heartbeatEndedHandler()})),this.rootPlayer.on(s.p.PLAYER_UNLOAD,(function(){(e.hb.disabled||e.mediaStore.state.paused)&&(e.timestamp=performance.now()),e.heartbeatQuitHandler()}))},t.prototype.startReport=function(){var e=this;this.portStore.getRemoteNow().then((function(t){e.rootPlayer.hasFeature("noVTReport")||e.sendRealtime(t)}))},t.prototype.sendRealtime=function(e){var t=this;this.hb.startTime=e,this.heartbeat(1),this.hb.timer=window.setInterval((function(){t.hb.disabled||t.mediaStore.state.paused||t.heartbeat(0)}),15e3)},t.prototype.heartbeatEndedHandler=function(){this.isPlaybackCompleted()&&this.heartbeat(4)},t.prototype.heartbeatQuitHandler=function(){this.isPlaybackCompleted()||this.heartbeat(4)},t.prototype.shouldDisableHeartbeat=function(e){return 3===e?2!==this.hb.prevPlayType:(1===this.hb.prevPlayType||3===this.hb.prevPlayType)&&1===e},t.prototype.getPlayedTime=function(){return this.isPlaybackCompleted()?-1:this.patchAdvStore.hasValidAdv?Math.floor(this.mediaStore.video.currentTime):Math.floor(this.portStore.getCurrentTime())},t.prototype.isPlaybackCompleted=function(){return!this.mpdStore.state.suspectDuration&&(!!this.mediaStore.video.ended||!!this.mediaStore.video.duration&&this.portStore.getCurrentTime().toFixed(1)===this.portStore.getDuration().toFixed(1))},t.prototype.heartbeat=function(e){var t,r=[l.u5.PC_APP,l.u5.Manager];if(!(t=this.configStore).isChannel.apply(t,(0,n.ev)([],(0,n.CR)(r),!1))&&this.hb.startTime&&!this.shouldDisableHeartbeat(e)){var i=this.getPlayedTime(),o=this.metricStore.getRelativePlayTime();switch(e){case 0:this.realPlayedTime+=15,this.timestamp=performance.now();break;case 1:case 2:case 3:this.timestamp=performance.now();break;case 4:this.realPlayedTime+=Math.floor((performance.now()-this.timestamp)/1e3)}if(0!==o||0!==i||4!==e){var a=this.configStore,u=this.userStore.info,c={player_version:ue.version},d={start_ts:this.hb.startTime,mid:u.mid,aid:a.aid,cid:a.cid,type:this.trackStore.getReportType(),sub_type:a.seasonType,dt:2,play_type:e,realtime:o,played_time:i,real_played_time:this.realPlayedTime,refer_url:a.referrer,bsource:a.bSource,quality:this.qualityStore.quality,video_duration:Math.floor(this.mediaStore.state.duration),last_play_progress_time:Math.floor(this.mediaStore.state.currentTime),max_play_progress_time:Math.floor(this.metricStore.getMaxPlayTime()),outer:this.configStore.channelKind===l.u5.Embedded_Other?1:0,statistics:this.configStore.statisticsReport,mobi_app:"web",device:"web",platform:"web"};d.mid||delete d.mid,d.aid||delete d.aid,a.seasonId&&(d.sid=a.seasonId),a.episodeId&&(d.epid=a.episodeId),null!=a.spmId&&(d.spmid=a.spmId),null!=a.spmIdFrom&&(d.from_spmid=a.spmIdFrom),null!=a.spmIdFromOuter&&(c.from_outer_spmid=a.spmIdFromOuter),a.session&&(d.session=a.session),a.noVTHistory&&(d.no_history=1),this.patchAdvStore.hasValidAdv&&(d.attached_avid=this.patchAdvStore.mainInfo.aid,d.attached_cid=this.patchAdvStore.mainInfo.cid,d.last_play_progress_time=Math.floor(this.portStore.getCurrentTime()),"PRE"===this.patchAdvStore.getPlayingType()?d.played_time=0:"POST"===this.patchAdvStore.getPlayingType()&&(d.played_time=-1),a.aid!==this.patchAdvStore.mainInfo.aid?d.type=3:d.type=this.trackStore.getReportType(),d.attached_type=this.trackStore.getReportType(),d.max_play_progress_time-d.last_play_progress_time<=2&&(d.last_play_progress_time=d.max_play_progress_time)),d.extra=JSON.stringify(c),4===e&&(this.hb.nextRestart=!0),this.rootPlayer.emit(s.p.PLAYER_HEARTBEAT),new Tn(this.rootPlayer,{persistent:!0,noStore:!0}).r(d,{w_start_ts:d.start_ts,w_mid:d.mid,w_aid:d.aid,w_dt:d.dt,w_realtime:d.realtime,w_played_time:d.played_time,w_real_played_time:d.real_played_time,w_video_duration:d.video_duration,w_last_play_progress_time:d.last_play_progress_time}).catch(Y.Z),this.hb.prevPlayType=e}}},t.prototype.resetHeartbeat=function(){this.hb.timer&&(clearInterval(this.hb.timer),this.hb.timer=null),this.hb.startTime=null,this.hb.prevPlayType=null,this.hb.disabled=!1,this.hb.nextRestart=!1},t.prototype.onNavigate=function(){this.realPlayedTime=0,this.timestamp=null},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.resetHeartbeat()},t}(u.u),Cn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpStatsClick",t.url="//api.bilibili.com/x/click-interface/click/web/h5",t}return(0,n.ZT)(t,e),t.prototype.r=function(e,t){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(r){return[2,this.request({url:this.url,method:"POST",params:t,data:e,withCredentials:!0},{wbi:!0})]}))}))},t}(z.eV),Pn=r(18480),In=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.ZT)(t,e),t.prototype.onPrepared=function(){var t=this;e.prototype.onPrepared.call(this),this.dp.vxStart=(0,o.gx)((function(){return t.trackStore.state.vxStart}),(function(){return t.startReport()}))},t.prototype.startReport=function(){var e=this;this.portStore.getRemoteNow().then((function(t){if(e.configStore.isPcApp){var r=e.getClickParams(t);e.rootPlayer.emit(a.t.Player_Virtual_Action,new CustomEvent(a.t.Player_Virtual_Action,{detail:{kind:l.s.First_Playtime,data:r?r[0]:null}}))}e.configStore.isChannel(l.u5.Manager)||e.rootPlayer.hasFeature("noVVReport")||e.sendPoint(t)}))},t.prototype.sendPoint=function(e){var t;(t=new Cn(this.rootPlayer,{persistent:!0,noStore:!0})).r.apply(t,(0,n.ev)([],(0,n.CR)(this.getClickParams(e)),!1)).catch(Y.Z),new Pn.h(this.rootPlayer,{persistent:!0,noStore:!0}).r(this.getLogParams(e)).catch(Y.Z)},t.prototype.getClickParams=function(e){var t,r=this.configStore,n=this.userStore.info,i=null!==(t=n.level)&&void 0!==t?t:0,o=Math.floor(this.mediaStore.state.firstPlay/1e3),a={mid:n.mid,aid:r.aid,cid:r.cid,part:r.p,lv:i,ftime:o,stime:e,type:this.trackStore.getReportType(),sub_type:this.configStore.seasonType,refer_url:r.referrer,bsource:r.bSource,outer:this.configStore.channelKind===l.u5.Embedded_Other?1:0,statistics:this.configStore.statisticsReport,mobi_app:"web",device:"web",platform:"web"};return a.mid||delete a.mid,a.aid||delete a.aid,r.seasonId&&(a.sid=r.seasonId),r.episodeId&&(a.epid=r.episodeId),null!=r.spmId&&(a.spmid=r.spmId),null!=r.spmIdFrom&&(a.from_spmid=r.spmIdFrom),null!=r.spmIdFromOuter&&(a.extra=JSON.stringify({from_outer_spmid:r.spmIdFromOuter})),r.session&&(a.session=r.session),this.patchAdvStore.hasValidAdv&&(a.attached_avid=this.patchAdvStore.mainInfo.aid,this.patchAdvStore.isPlayingPatch()?a.type=3:a.type=4),[a,{w_aid:a.aid,w_part:a.part,w_ftime:a.ftime,w_stime:a.stime,w_type:a.type}]},t.prototype.getLogParams=function(e){var t=1e3*e,r=encodeURIComponent(this.rootPlayer.parent.location.href),n=this.configStore,i=this.settingStore.state.loop?1:0,o=this.qualityStore.quality,a=[];return a.push("000024"+t+r,this.trackStore.getFid(),this.portStore.rid,n.aid,n.cid,n.p,o,i),a.join("|")},t}(u.u),Dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{status:null,stime:null,ctime:null}},enumerable:!1, configurable:!0}),Object.defineProperty(t.prototype,"isEnd",{get:function(){return 3===this.state.status||!(2!==this.state.status||!this.mediaStore.state.ended)},enumerable:!1,configurable:!0}),t.prototype.onMount=function(){var t=this;e.prototype.onMount.call(this),this.dc.state=(0,o.U5)((function(){return{isLoaded:t.rootStore.isLoaded,ctime:t.state.ctime,stime:t.state.stime,status:t.state.status}}),(function(e){var r=e.isLoaded,n=e.ctime,i=e.stime,o=e.status;r&&(2===o?n-i&&t.portStore.seekAutoplay(n-i):3===o&&(!t.mediaStore.state.ended&&t.portStore.seek(t.mediaStore.state.duration),t.endingStore.open()))}),{fireImmediately:!0})},t.prototype.onDispose=function(){},t}(u.u),On=function(e){function t(t){var r=e.call(this,t)||this;return r.delay=2e3,r.delayTimer=null,(0,o.rC)(r),r.init(),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"isLoadingStart",{get:function(){return!this.rootStore.episodeStore.state.isSameEpisode&&this.rootStore.isCommitted},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoadingEnded",{get:function(){return this.rootStore.isLoaded},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=this,t="".concat(y.a_,"-loading"),r=this.nodes.container;this.loadNode=r.querySelector(".".concat(y.m,"-loading-panel")),this.textNode=r.querySelector(".".concat(y.m,"-loading-panel-text")),this.blurNode=r.querySelector(".".concat(y.m,"-loading-panel-blur")),this.dc.isCommitted=(0,o.EH)((function(){e.isLoadingStart&&(e.createDelayTimer(),e.loadNode.classList.add(t))})),this.dc.isLoaded=(0,o.EH)((function(){e.isLoadingEnded&&(e.clearDelayTimer(),e.loadNode.classList.remove(t))}))},t.prototype.createDelayTimer=function(){var e=this;this.clearDelayTimer(),this.delayTimer=window.setTimeout((function(){e.textNode&&(e.textNode.hidden=!1),e.blurNode&&(e.blurNode.hidden=!1)}),this.delay)},t.prototype.clearDelayTimer=function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)},t.prototype.onDispose=function(){e.prototype.onDispose.call(this),this.clearDelayTimer(),this.textNode&&(this.textNode.hidden=!0),this.blurNode&&(this.blurNode.hidden=!0)},(0,n.gn)([o.Fl],t.prototype,"isLoadingStart",null),(0,n.gn)([o.Fl],t.prototype,"isLoadingEnded",null),t}(u.f),xn=function(e){this.rootStore=e;var t=e.rootPlayer,r=t.log.getLogger("EpochAtom");t.on(a.t.Player_Committed,(function(){return r.i("onCommitted")}),-1).on(a.t.Player_Prepared,(function(){return r.i("onPrepared",JSON.stringify(e.portStore.getManifest()))}),-1).on(a.t.Player_Initialized,(function(){return r.i("onInitialized")}),-1).on(s.p.PLAYER_LOADED,(function(e){return r.i("onLoaded","err:".concat(!!e.err,",mid:").concat(e.mid||null))}),-1).on(s.p.PLAYER_UNLOAD,(function(){return r.i("onUnload")}),-1).on(s.p.PLAYER_UNLOADED,(function(){return r.i("onUnloaded")}),-1).on(a.t.Player_Dispose,(function(){return r.i("onDispose")}),-1)},kn=r(82973),Nn=r.n(kn);function Ln(e){var t=Object.assign({width:null,height:null,aspectRatio:"16:9"},e),r=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};if(!r(t.width)&&!r(t.height))throw new TypeError('One of "width" and "height" MUST be an integer');var n=t.aspectRatio.split(":"),i=+n[0],o=+n[1];if(!(i>0&&o>0))throw new Error('Invalid "aspectRatio" format');var a=i/o,s=!!t.width;t.width?t.height=Math.round(t.width/a):t.width=Math.round(t.height/(1/a));var u=t.width,l=t.height,c=t.width/t.height;return c>a&&(s?l+=1:u-=1),cMath.abs(u/l-a)&&(t.width=u,t.height=l),t}var Mn=r(79211);var Fn=r(73824),Un=r(91250),Bn='Interrupted by "Player_Dispose" event',Gn='Interrupted by "Player_Disconnect" event',Vn=r(57106),Wn=r(82012),jn=r(93504),Hn=r(24230),Zn=r(51282);function Yn(){var e=_.X.msie.alike?"".concat(y._j,"-msie"):_.X.edge.alike?"".concat(y._j,"-edge"):_.X.safari.alike?"".concat(y._j,"-safari"):_.X.firefox.alike?"".concat(y._j,"-firefox"):null,t=function(t){var r=document.createElement("div");return r.setAttribute("data-injector","nano"),t.forEach((function(e){return r.classList.add(e)})),e&&r.classList.add(e),r};return{majorNode:t([y.eG,"".concat(y.eG,"-major")]),minorNode:t([y.eG,"".concat(y.eG,"-minor")])}}var Kn=r(56890);var qn=function(){function e(e,t){this.isEmbed=!1,this.isEmbedSOP=!1,this.isInitialized=!1,this.cd={__placeholder__:!0},this.primary={},this.input={},this.theme={},this.disabled={},this.httpRequests=new Set,this.httpCaches=new Map,this.connectDetails={starting:!1,finished:!1},this.connectDeferred=null,this.disposeDeferredSet=new Set,this.disconnectDeferredSet=new Set,(0,o.rC)(this),Object.assign(this.input,e),Object.assign(this.theme,t),this.isInitialized=!1,this.beforeEmitter=new Un.EventEmitter,this.emitter=new Un.EventEmitter,this.afterEmitter=new Un.EventEmitter,this.beforeEmitter.setMaxListeners(0),this.emitter.setMaxListeners(0),this.afterEmitter.setMaxListeners(0),this.log=new an,this.track=new un,this.track.getRealtimeReportInfo=this.makeRealtimeReportMethod(),this.window=window,this.isEmbed=window!==window.parent,this.cd=this.createPrefetchProxy(),this.primary=(0,Kn.i)(this.input),this.searchParam=function(e){var t=Object.create(null);if("string"!=typeof e)return t;var r="debug",n=Nn().parse(e,{ignoreQueryPrefix:!0,plainObjects:!0});return"1"!==n[r]||(Object.keys(n).forEach((function(e){var i=n[e];if(e!==r&&null!=i)switch(e){case"ctrl":case"fnval":case"autoplay":case"no_gpu":case"no_cache":t[e]=+i;break;case"t":case"ns":case"spm_id_from":t[e]=i}})),console.log("[DEBUG] Parsed QueryString:",t)),t}(this.window.location.search),this.checkFrameStatus(),this.preBuildNodes(),this.log.i("[EntryTiming]",JSON.stringify(Fn._g.entryLoadTime)),An.I.markOnce("M03"),An.I.measureOnce("P02:IH2I","M01","M03"),this.instantiate=performance.now()}return e.prototype.emit=function(e){for(var t,r,i,o,a,s,u=[],l=1;l0:this.afterEmitter.on(e,t);break;default:this.emitter.on(e,t)}return this},e.prototype.once=function(e,t,r){switch(!0){case r<0:this.beforeEmitter.once(e,t);break;case r>0:this.afterEmitter.once(e,t);break;default:this.emitter.once(e,t)}return this},e.prototype.off=function(e,t,r){switch(!0){case r<0:this.beforeEmitter.off(e,t);break;case r>0:this.afterEmitter.off(e,t);break;default:this.emitter.off(e,t)}return this},e.prototype.removeAllListeners=function(){return this.beforeEmitter.removeAllListeners(),this.emitter.removeAllListeners(),this.afterEmitter.removeAllListeners(),this},e.prototype.getDimension=function(){var e={width:0,height:0};if(this.rootStore)return e.width=this.uiStore.state.containerWidth,e.height=this.uiStore.state.containerHeight,e;if(this.nodes&&this.nodes.container){var t=this.nodes.container;return e.width=t.offsetWidth,e.height=t.offsetHeight,e}return e},e.prototype.preBuildNodes=function(){var e=this.iid=(0,ir.M)().toString(),t=Yn(),r=t.majorNode,n=t.minorNode;r.setAttribute("data-iid",e),n.setAttribute("data-iid",e),this.majorNode=r,this.minorNode=n},e.prototype.attachTemplate=function(){var e,t=this.nodes,r=this.majorNode,n=t.container,i=null!==(e=this.primary.channelKind)&&void 0!==e?e:l.u5.Default,o=new Map;o.set(null,{topWrap:this.hasFeature("noControlLayer"),controlWrap:this.hasFeature("noControlLayer"),sendingArea:this.hasFeature("noSendingBar")}).set(l.u5.Homepage,{sendingArea:!0,topWrap:!0,controlWrap:!0}).set(l.u5.Homepage_Topic,{sendingArea:!0}).set(l.u5.Creator,{sendingArea:!0}),o.forEach((function(e,r){return function(e,r){e!==i&&null!=e||r&&Object.keys(r).forEach((function(e){var n=t[e],i=r[e];n&&null!=i&&(n.hidden=!!i)}))}(r,e)})), (this.hasFeature("noLayerShadow")||this.primary.hideBoxShadow)&&n.classList.add("".concat(y.a_,"-disable-box-shadow")),r&&!n.parentElement&&r.appendChild(n)},e.prototype.detachTemplate=function(){var e=this.nodes.container;if(e){var t=e.parentElement;t&&t.removeChild(e)}},e.prototype.attachBaseNode=function(){var e=this.primary.element,t=this.primary.auxiliary,r=this.majorNode,n=this.minorNode;e&&!r.parentElement&&(0,Vn.h)(e,r),t&&!n.parentElement&&(0,Vn.h)(t,n)},e.prototype.detachBaseNode=function(){var e=this.majorNode,t=this.minorNode;e&&e.parentElement&&e.parentElement.removeChild(e),t&&t.parentElement&&t.parentElement.removeChild(t)},e.prototype.checkFrameStatus=function(){try{this.parent=window.parent&&window.parent.document?window.parent:window}catch(e){this.parent=window}this.isEmbed&&(this.isEmbedSOP=this.window!==this.parent),this.log.i("[FrameStatus]","isEmbed:".concat(this.isEmbed,",isEmbedSOP:").concat(this.isEmbedSOP))},e.prototype.createPrefetchProxy=function(){var e=this.input.prefetch;return this.input.prefetch=null,e&&"object"==typeof e?e:(this.log.w("[PrefetchProxy]","Invalid"),{__placeholder__:!0})},e.prototype.onError=function(){for(var e=[],t=0;t\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n 正在缓冲...\n \n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n '),i=(0,Xe.t)(n),s='
'),u=(0,Xe.t)(s),{container:i,videoArea:i.querySelector(".".concat(r,"-video-area")),sendingArea:i.querySelector(".".concat(r,"-sending-area")),dialogArea:i.querySelector(".".concat(r,"-dialog-area")),tooltipArea:i.querySelector(".".concat(r,"-tooltip-area")),contextArea:i.querySelector(".".concat(r,"-context-area")),videoPerch:i.querySelector(".".concat(r,"-video-perch")),videoPoster:i.querySelector(".".concat(r,"-video-poster")),videoWrap:i.querySelector(".".concat(r,"-video-wrap")),rowDanmaku:i.querySelector(".".concat(r,"-row-dm-wrap")),advDanmaku:i.querySelector(".".concat(r,"-adv-dm-wrap")),basDanmaku:i.querySelector(".".concat(r,"-bas-dm-wrap")),cmdDanmaku:i.querySelector(".".concat(r,"-cmd-dm-wrap")),cmdInside:i.querySelector(".".concat(r,"-cmd-dm-inside")),endingWrap:i.querySelector(".".concat(r,"-ending-wrap")),endingPanel:i.querySelector(".".concat(r,"-ending-panel")),sharePanel:i.querySelector(".".concat(r,"-share-panel")),subtitleWrap:i.querySelector(".".concat(r,"-subtitle-wrap")),topWrap:i.querySelector(".".concat(r,"-top-wrap")),stateWrap:i.querySelector(".".concat(r,"-state-wrap")),loadingPanel:i.querySelector(".".concat(r,"-loading-panel")),toastWrap:i.querySelector(".".concat(r,"-toast-wrap")),controlWrap:i.querySelector(".".concat(r,"-control-wrap")),dialogWrap:i.querySelector(".".concat(r,"-dialog-wrap")),sendingBar:i.querySelector(".".concat(r,"-sending-bar")),musicWrap:i.querySelector(".".concat(r,"-music-wrap")),businessWrap:i.querySelector(".".concat(r,"-business-wrap")),summaryWrap:i.querySelector(".".concat(r,"-summary-wrap")),controlEntity:i.querySelector(".".concat(r,"-control-entity")),controlTop:i.querySelector(".".concat(r,"-control-top")),controlBottomCenter:i.querySelector(".".concat(r,"-control-bottom-center")),controlBottomLeft:i.querySelector(".".concat(r,"-control-bottom-left")),controlBottomRight:i.querySelector(".".concat(r,"-control-bottom-right")),topTitle:i.querySelector(".".concat(r,"-top-title")),topFollow:i.querySelector(".".concat(r,"-top-follow")),topLeftTitle:i.querySelector(".".concat(r,"-top-left-title")),topLeftFollow:i.querySelector(".".concat(r,"-top-left-follow")),topLeftMusic:i.querySelector(".".concat(r,"-top-left-music")),topLeftPanoram:i.querySelector(".".concat(r,"-top-left-panorama")),buffIcon:i.querySelector(".".concat(r,"-state-buff-icon")),buffSpeed:i.querySelector(".".concat(r,"-state-buff-speed")),toastAuto:i.querySelector(".".concat(r,"-toast-auto")),toastFixed:i.querySelector(".".concat(r,"-toast-fixed")),bubble:u,dmSvgMaskWrap:i.querySelector(".".concat(r,"-dm-svg-mask-wrap")),dmMaskWrap:i.querySelector(".".concat(r,"-dm-mask-wrap"))}),this.primary.pcSpecialMode&&(this.nodes.videoArea.parentNode.append(this.nodes.controlWrap),this.nodes.container.classList.add("".concat(y.m,"-container-pc-special")))),this.attachTemplate(), this.attachBaseNode(),this.rootStore=new hi(this),this.rootStore.decomposeSubStores(this),(0,Hn.M)(window.__NanoGlobalTheme),An.I.markOnce("M05"),An.I.measureOnce("P04:CH2ST","M04","M05"),this.storeTail=performance.now(),[4,this.connectDeferred.promise]);case 1:return t.sent(),this.isInitialized=!0,this.emit(a.t.Player_Connected,new CustomEvent(a.t.Player_Connected)),(0,o.z)((function(){return e.connectDetails.finished=!0})),An.I.markOnce("M12"),An.I.measureOnce("P06:CH2CT","M04","M12"),this.connectTail=performance.now(),[3,5];case 2:return[4,this.connectDeferred.promise];case 3:return t.sent(),[4,(0,o.gx)((function(){return e.connectDetails.finished}))];case 4:t.sent(),t.label=5;case 5:return[2,!this.rootStore.errorStore.state.initError]}var r,n,i,s,u}))}))},e.prototype.disconnect=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e=this;return(0,n.Jh)(this,(function(t){switch(t.label){case 0:return this.connectDetails.starting?((0,o.z)((function(){return e.connectDetails.finished=!1})),this.connectDeferred&&(this.connectDeferred.reject(new Error('Interrupted by "Player.disconnect()" action')),this.connectDeferred=null),this.emit(s.p.PLAYER_UNLOAD),this.emit(s.p.PLAYER_UNLOADED),this.emit(a.t.Player_Dispose,new CustomEvent(a.t.Player_Dispose)),this.rootStore&&this.rootStore.disconnect(),this.emit(a.t.Player_Disconnect,new CustomEvent(a.t.Player_Disconnect)),this.isInitialized=!1,this.detachBaseNode(),this.detachTemplate(),this.removeAllListeners(),this.log.clear(),this.track.clear(),this.nodes=null,(0,o.z)((function(){return e.connectDetails.starting=!1})),Fn.$W.delete(this),[3,3]):[3,1];case 1:return[4,(0,o.gx)((function(){return!e.connectDetails.starting}))];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},(0,n.gn)([o.LO],e.prototype,"connectDetails",void 0),(0,n.gn)([i.ZP],e.prototype,"onError",null),(0,n.gn)([i.ZP],e.prototype,"onDispose",null),(0,n.gn)([i.ZP],e.prototype,"onDisconnect",null),(0,n.gn)([i.ZP],e.prototype,"snapshotError",null),e}();var zn=function(){for(var e=[],t=0;t').concat(a,"

"))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return'\n
\n Legacy Browser\n ').concat(r.join(""),"\n
\n ")},e.prototype.dispose=function(){var e=this.container.querySelector(".".concat(this.prefix,"-container"));e&&e.parentElement&&e.parentElement.removeChild(e)},e}(),Jn=function(){function e(){window[y.bw]&&window[y.bw].injector===this.injector?console.error('The "'.concat(y.bw,'" namespace already exist')):window[y.bw]=this}return Object.defineProperty(e.prototype,"injector",{get:function(){return y.bw},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return Object.assign(Object.create(null),ue)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cookies",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"EventType",{get:function(){return(0,n.pi)({},a.t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"GroupKind",{get:function(){return(0,n.pi)({},l.HR)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ScreenKind",{get:function(){return(0,n.pi)({},l.dY)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"FetcherKind",{get:function(){return(0,n.pi)({},l.qW)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HandoffKind",{get:function(){return(0,n.pi)({},l.ty)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ChannelKind",{get:function(){return(0,n.pi)({},l.u5)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"InternalKind",{get:function(){return(0,n.pi)({},l.s)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"guid",{get:function(){return ir.M},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prefetch",{get:function(){return fn},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return Ln},enumerable:!1,configurable:!0}),e.prototype.createPlayer=function(e,t){if(!(0,Fr.Z)(e))throw new Error("1 argument required and MUST be a plain object");return function(e){void 0===e&&(e='video/mp4; codecs="avc1.42001E, mp4a.40.2"');var t="[canPlayType]:"+e;if(Mn.x.has(t))return Mn.x.get(t);var r=navigator.userAgent.toLowerCase(),n=!(/msie [\w.]+/.exec(r)||/Trident/i.test(r)&&/Windows NT 6/.test(r)||!window.URL);if(n){var i=document.createElement("video");if(i&&i.canPlayType)return!!i.canPlayType(e)}return Mn.x.set(t,n),n}()?(r=new qn(e,t),i=Xn.map((function(e){return e(r)})),o=Object.assign.apply(Object,(0,n.ev)([{}],(0,n.CR)(i),!1)),r.api=o,o):(e.element&&new Qn({container:e.element}),null);var r,i,o},e.prototype.searchParams=function(e){return void 0===e&&(e=window.location.search),Nn().parse(e,{ignoreQueryPrefix:!0,plainObjects:!0})},e.prototype.valueOf=function(){return(0,n.ev)([],(0,n.CR)(Fn.$W),!1)},e}(),$n=function(e){function t(t){var r,n=e.call(this,t)||this;return n.tag="[HelperAtom]",n.helpers=new Map,n.isReOk=!1,n.helperState=((r={})[0]=!1,r[1]=!1,r[2]=!1,r[3]=!1,r[4]=!1,r[5]=!1,r[6]=!1,r[7]=!1,r[8]=!1,r[9]=!1,r),(0,o.rC)(n),n.init(),n}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"canRequest",{get:function(){return this.rootStore.isLoadEnded},enumerable:!1,configurable:!0}),t.prototype.setHelper=function(e,t){this.helperState[e]=t},t.prototype.init=function(){var e=this,t=this.rootStore.configStore;t.isChannel(l.u5.Homepage)||t.isChannel(l.u5.Homepage_Topic)?this.fetchHelpers():this.dc.fetchHelpers=(0,o.gx)((function(){return e.canRequest}),(function(){return e.fetchHelpers()}))},t.prototype.buildHelper=function(e){var t=this;this.dc[e]&&this.log.e("E:Helper(".concat(e,") is repeatedly initialized")),this.dc[e]=(0,o.gx)((function(){return t.isReOk&&t.rootStore.isLoadEnded&&t.helperState[e]}),(function(){var r=t.helpers.get(e);r?new r(t.rootStore).install():t.log.w("Helper(".concat(e,") not found"))}))},t.prototype.buildRootExtra=function(){var e=this;r.e(892).then(r.bind(r,24854)).then((function(t){new t.RootExtra(e.rootStore),(0,o.z)((function(){return e.isReOk=!0}))})).catch((function(t){e.log.e("root_extra",t&&t.message)}))},t.prototype.fetchHelpers=function(){var e,t=this;this.buildRootExtra();var r=(e=this.rootStore).configStore,n=e.uiStore,i=function(e,r){t.helpers.set(e,r),t.setHelper(e,!0)},o=function(e,r){t.log.e(e,r&&r.message)},a=function(){Jn.getCommunityHelper().then((function(e){return i(2,e.CommunityHelper)})).catch((function(e){return o("community_helper",e)}))};if(this.buildHelper(0),Jn.getCommonHelper().then((function(e){return i(0,e.CommonHelper)})).catch((function(e){return o("common_helper",e)})),r.isChannel(l.u5.Homepage)||r.isChannel(l.u5.Homepage_Topic))return this.buildHelper(5),void Jn.getHomepageHelper().then((function(e){return i(5,e.HomepageHelper)})).catch((function(e){return o("homepage_helper",e)}));if(r.isChannel(l.u5.PC_APP))return this.buildHelper(9),void Jn.getPCAppHelper().then((function(e){return i(9,e.PCHelper)})).catch((function(e){return o("pc_app_helper",e)}));if(r.isChannel(l.u5.Manager))return this.buildHelper(8),void Jn.getManagerHelper().then((function(e){return i(8,e.ManagerHelper)})).catch((function(e){return o("manager_helper",e)}));if(r.isCreator())return this.buildHelper(6),void Jn.getCreatorHelper().then((function(e){return i(6,e.CreatorHelper)})).catch((function(e){return o("creator_helper",e)}));if(r.isChannel(l.u5.Embedded)||r.isChannel(l.u5.Embedded_White)||r.isChannel(l.u5.Embedded_Other))return this.buildHelper(7),void Jn.getEmbeddedHelper().then((function(e){return i(7,e.EmbeddedHelper)})).catch((function(e){return o("embedded_helper",e)}));if(r.isChannel(l.u5.Playlist))this.buildHelper(2),a();else switch(n.kind){case l.HR.Pgc: this.buildHelper(1),Jn.getBangumiHelper().then((function(e){return i(1,e.BangumiHelper)})).catch((function(e){return o("bangumi_helper",e)}));break;case l.HR.Pugv:this.buildHelper(3),Jn.getClassroomHelper().then((function(e){return i(3,e.ClassroomHelper)})).catch((function(e){return o("classroom_helper",e)}));break;case l.HR.Ugc:default:this.buildHelper(2),a()}r.auxiliary&&(this.buildHelper(4),Jn.getAuxiliaryHelper().then((function(e){return i(4,e.AuxiliaryHelper)})).catch((function(e){return o("auxiliary_helper",e)})))},(0,n.gn)([o.LO],t.prototype,"isReOk",void 0),(0,n.gn)([o.LO],t.prototype,"helperState",void 0),(0,n.gn)([o.Fl],t.prototype,"canRequest",null),(0,n.gn)([o.aD],t.prototype,"setHelper",null),t}(u.f),ei=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loopTimer=null,t.referer={iSeek:null,iPlay:null,iPause:null},t}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"iSeekOnce",{get:function(){var e=this.referer.iSeek;return this.referer.iSeek=null,e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iPlayOnce",{get:function(){var e=this.referer.iPlay;return this.referer.iPlay=null,e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iPauseOnce",{get:function(){var e=this.referer.iPause;return this.referer.iPause=null,e},enumerable:!1,configurable:!0}),t.prototype.setActionCaller=function(e,t){this.referer[e]=t},t.prototype.addEvents=function(){this.addReactions(),this.addProxyEvent(),this.addCanceledEvent(),this.addTrackEvent()},t.prototype.addProxyEvent=function(){var e=this,t=this.rootStore.mediaStore;this.rootPlayer.on(s.p.MEDIA_ENDED,(function(){return e.mediaEndedHandler()})),this.rootPlayer.on(s.p.PATCH_ADV_PLAY_ENDED,(function(){return e.patchEndedHandler()})),this.rootPlayer.on(s.p.MEDIA_PLAY,(function(){t.setState({paused:t.video.paused}),e.rootPlayer.emit(a.t.Player_Play,new CustomEvent(a.t.Player_Play,{detail:{initiator:e.iPlayOnce}}))})).on(s.p.MEDIA_PAUSE,(function(){t.setState({paused:t.video.paused}),e.rootPlayer.emit(a.t.Player_Pause,new CustomEvent(a.t.Player_Pause,{detail:{initiator:e.iPauseOnce}}))})),this.rootPlayer.on(s.p.MEDIA_PLAYING,(function(){e.rootPlayer.emit(a.t.Player_Playing,new CustomEvent(a.t.Player_Playing))})).on(s.p.MEDIA_WAITING,(function(){e.rootPlayer.emit(a.t.Player_Waiting,new CustomEvent(a.t.Player_Waiting))})),this.rootPlayer.on(s.p.MEDIA_SEEKING,(function(){e.rootPlayer.emit(a.t.Player_Seeking,new CustomEvent(a.t.Player_Seeking,{detail:{initiator:e.referer.iSeek}}))})).on(s.p.MEDIA_SEEKED,(function(){e.rootPlayer.emit(a.t.Player_Seeked,new CustomEvent(a.t.Player_Seeked,{detail:{initiator:e.iSeekOnce}}))})),this.rootPlayer.on(s.p.MEDIA_TIMEUPDATE,(function(){e.rootPlayer.emit(a.t.Player_TimeUpdate,new CustomEvent(a.t.Player_TimeUpdate))})).on(s.p.MEDIA_DURATIONCHANGE,(function(){e.rootPlayer.emit(a.t.Player_DurationChange,new CustomEvent(a.t.Player_DurationChange))})),this.rootPlayer.on(s.p.MEDIA_LOADEDMETADATA,(function(){e.rootPlayer.emit(a.t.Player_LoadedMetadata,new CustomEvent(a.t.Player_LoadedMetadata))})).on(s.p.MEDIA_CANPLAY,(function(){e.rootPlayer.emit(a.t.Player_Canplay,new CustomEvent(a.t.Player_Canplay))})).on(s.p.MEDIA_PROGRESS,(function(){e.rootPlayer.emit(a.t.Player_Progress,new CustomEvent(a.t.Player_Progress))})).on(s.p.MEDIA_RATECHANGE,(function(){e.rootPlayer.emit(a.t.Player_RateChange,new CustomEvent(a.t.Player_RateChange))})).on(s.p.MEDIA_VOLUMECHANGE,(function(){e.rootPlayer.emit(a.t.Player_VolumeChange,new CustomEvent(a.t.Player_VolumeChange))})).on(s.p.MEDIA_ERROR,(function(){e.rootPlayer.emit(a.t.Player_Error,new CustomEvent(a.t.Player_Error))})),this.rootPlayer.on(s.p.MEDIA_LOADSTART,(function(){e.rootPlayer.emit(a.t.Player_LoadStart,new CustomEvent(a.t.Player_LoadStart))})).on(s.p.MEDIA_LOADEDDATA,(function(){e.rootPlayer.emit(a.t.Player_LoadedData,new CustomEvent(a.t.Player_LoadedData))})).on(s.p.MEDIA_STALLED,(function(){e.rootPlayer.emit(a.t.Player_Stalled,new CustomEvent(a.t.Player_Stalled))})).on(s.p.MEDIA_SUSPEND,(function(){e.rootPlayer.emit(a.t.Player_Suspend,new CustomEvent(a.t.Player_Suspend))})).on(s.p.MEDIA_ABORT,(function(){e.rootPlayer.emit(a.t.Player_Abort,new CustomEvent(a.t.Player_Abort))})).on(s.p.MEDIA_EMPTIED,(function(){e.rootPlayer.emit(a.t.Player_Emptied,new CustomEvent(a.t.Player_Emptied))}))},t.prototype.patchEndedHandler=function(){var e=this.rootStore.patchAdvStore;e.setState({index:e.state.index+1}),e.patchSwitch()},t.prototype.mediaEndedHandler=function(){var e=this.rootStore,t=e.mediaStore,r=e.settingStore,n=e.userStore,i=t.state.paused,o=t.state.ended;r.state.loop&&!n.isCharingTrialWatch?(t.setState({ended:!1}),i||this.rootPlayer.emit(a.t.Player_TimeUpdate,new CustomEvent(a.t.Player_TimeUpdate)),this.rootPlayer.emit(a.t.Player_Loop_Signal,new CustomEvent(a.t.Player_Loop_Signal,{cancelable:!0}))):(t.setState({paused:!0,ended:!0}),i||(this.rootPlayer.emit(a.t.Player_TimeUpdate,new CustomEvent(a.t.Player_TimeUpdate)),this.rootPlayer.emit(a.t.Player_Pause,new CustomEvent(a.t.Player_Pause))),o||this.rootPlayer.emit(a.t.Player_Ended,new CustomEvent(a.t.Player_Ended)))},t.prototype.addReactions=function(){var e=this;this.dc.committed=(0,o.U5)((function(){return e.rootStore.isCommitted}),(function(t){t&&e.rootPlayer.emit(a.t.Player_Committed,new CustomEvent(a.t.Player_Committed))}),{fireImmediately:!0}),this.dc.prepared=(0,o.U5)((function(){return e.rootStore.isPrepared}),(function(t){t&&e.rootPlayer.emit(a.t.Player_Prepared,new CustomEvent(a.t.Player_Prepared))}),{fireImmediately:!0}),this.dc.initialized=(0,o.U5)((function(){return e.rootStore.isLoaded}),(function(t){t&&(e.rootPlayer.emit(a.t.Player_Initialized,new CustomEvent(a.t.Player_Initialized)),e.rootPlayer.connectDeferred&&e.rootPlayer.connectDeferred.isPending&&e.rootPlayer.connectDeferred.resolve())}),{fireImmediately:!0})},t.prototype.addCanceledEvent=function(){var e=this;this.rootPlayer.on(a.t.Player_Loop_Signal,(function(t){t.defaultPrevented||(e.loopTimer=window.setTimeout((function(){e.rootStore.portStore.seekAutoplay(0,"Loop")}),1))}),1)},t.prototype.addTrackEvent=function(){var e=this;this.rootPlayer.on(a.t.Player_Initialized,(function(){var t=e.rootStore,r=t.errorStore,n=t.episodeStore,i=t.uiStore,o=t.mpdStore;e.track.o("enter",{drm:o.drmTechType||0,dpr:window.devicePixelRatio||NaN,screenW:screen.width,screenH:screen.height,colorDepth:screen.colorDepth,webdriver:+navigator.webdriver,initErr:+r.state.initError,initial:+n.isFirst,timeout:+i.state.isLoadTimeout,referrer:document.referrer,frameUrl:document.URL},{immediately:!0})})).on(s.p.MEDIA_ENDED,(function(){e.track.o("ended")}))},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),clearTimeout(this.loopTimer)},t}(u.f),ti=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDrmCer",t.url="//bvc-drm.bilivideo.com/cer/bilidrm_pub.key",t}return(0,n.ZT)(t,e),t.prototype.r=function(){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){return[2,this.getRemoteResponse(0).then((function(e){return e.data}))]}))}))},t.prototype.getRemoteResponse=function(e){var t=this;return this.request({url:this.url,responseType:"arraybuffer"}).catch((function(r){return z.eV.isCanceled(r)?Promise.reject(r):e?t.getRemoteResponse(--e):Promise.reject(r)}))},t}(z.eV),ri=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDrmCkc",t.url="//bvc-drm.bilivideo.com/bilidrm",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.getRemoteResponse(0,JSON.stringify(e)).then((function(e){var t=e.data;if(t&&200===t.status&&t.ckc)return t;throw t&&t.message?new Error("status: ".concat(t.status,"; message: ").concat(t.message)):new Error("Unknown error")}))]}))}))},t.prototype.getRemoteResponse=function(e,t){var r=this;return this.request({url:this.url,method:"POST",data:t}).catch((function(n){return z.eV.isCanceled(n)?Promise.reject(n):e?r.getRemoteResponse(--e,t):Promise.reject(n)}))},t}(z.eV),ni=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this ;return t.tag="HttpDrmWidevineCer",t.url="//bvc-drm.bilivideo.com/cer/bilibili_certificate.bin",t}return(0,n.ZT)(t,e),t.prototype.r=function(){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){return[2,this.getRemoteResponse(0).then((function(e){return e.data}))]}))}))},t.prototype.getRemoteResponse=function(e){var t=this;return this.request({url:this.url,responseType:"arraybuffer"}).catch((function(r){return z.eV.isCanceled(r)?Promise.reject(r):e?t.getRemoteResponse(--e):Promise.reject(r)}))},t}(z.eV),ii=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpDrmCheck",t.url="//api.bilibili.com/pgc/player/web/check",t}return(0,n.ZT)(t,e),t.prototype.r=function(e){return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(t){return[2,this.getRemoteResponse(1,e).then((function(e){if(e.data)return e.data;throw new Error("Invalid data")}))]}))}))},t.prototype.getRemoteResponse=function(e,t){var r=this;return this.request({url:this.url,method:"GET",params:t,withCredentials:!0}).catch((function(n){return z.eV.isCanceled(n)?Promise.reject(n):e?r.getRemoteResponse(--e,t):Promise.reject(n)}))},t}(z.eV);var oi=r(14523),ai=function(){function e(){}return e.bufferFromText=function(e){void 0===e&&(e="");for(var t=new Uint8Array(e.length),r=0;rw.nJ.gt.login&&(l=d=T.yE)}l>w.nJ.gt.mseSupported&&!(0,o.a)()&&(l=d=w.nJ.gt.mseSupported);try{var p=u();if(p&&p.media){var h=p.media.audioQuality,m=p.media.dolbyAudio;null!=h?c=+h:m&&(c=1)}}catch(e){}return{aq:c,vq:l,maxVq:d}}(this.storageKey,this.primary.quality,t);return e.isPcApp&&(r.vq=r.maxVq),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iKind",{get:function(){var e;return null!==(e=this.reload.kind)&&void 0!==e?e:f.HR.Ugc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storageKey",{get:function(){return this.primary.storageKey||y.ul},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"csource",{get:function(){return this.primary.csource},enumerable:!1,configurable:!0}),t.prototype.setReloadConfig=function(){var e,t=(e=this.rootStore).uiStore,r=e.configStore;this.reload=(0,E.s)(this.rootPlayer.input),t.setState({kind:this.iKind}),null!=this.iAutoplay&&(this.log.i("[InitialPlaybackState]",this.iAutoplay),r.setState({ips:this.iAutoplay}))},t.prototype.setEpConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.reload[r]=e[r]}))},t.prototype.setPatchAdvReload=function(){this.reload=(0,E.s)(this.rootPlayer.input)},t.prototype.fixCompleteId=function(e){var t,r=this,n=(t=this.rootStore).configStore,i=t.httpStore,o=i.getViewKind(),a=function(){r.rootStore.stageAtom.set(2),n.setState({isCompleteIdEnded:!0})};r.rootStore.stageAtom.set(1),o.isFatalError&&r.log.e("视频参数异常"),o.isMissing?(i.fetchViewInfo(!0).then((function(t){t&&t.body&&e(t.body),a()})).catch((function(e){S.eV.isCanceled(e)||a()})),n.setState({isRequestId:!0})):(this.log.i("视频参数正常"),a())},t.prototype.cleanSessionConfig=function(e){if(this.rootPlayer.input&&"object"==typeof this.rootPlayer.input){var t=(0,E.s)({});Object.keys(t).forEach((function(e){t[e]=null}));var r={kind:this.reload.kind,seasonType:this.reload.seasonType,controlsList:this.reload.controlsList};Object.assign(this.rootPlayer.input,t,r,e)}},t.prototype.resetSessionData=function(){this.tmp.pid=null,this.tmp.session=null},t.prototype.fillStoryId=function(){var e=this;this.fixCompleteId((function(t){t&&Object.keys(t).forEach((function(r){e.validKeys.has(r)&&(e.reload[r]=t[r])}))}))},t.prototype.cleanPrefetchData=function(){if(this.debug.no_cache){for(var e in this.rootPlayer.cd)Object.prototype.hasOwnProperty.call(this.rootPlayer.cd,e)&&delete this.rootPlayer.cd[e];return console.warn("Prefetch has been disabled"),!0}return!1},t.prototype.injectGlobalPlayer=function(e){void 0===e&&(e=100);var t=this.debug.ns,r=0;if(t&&isNaN(+t)){for(;null!=window[t]&&!(++r>e);)t=this.debug.ns+r;null==window[t]?(window[t]=this.rootPlayer,this.tmp.name=t,console.log(this.tag,"GlobalPlayerName:",t)):console.warn(this.tag,"Inject Failed")}},t.prototype.onDisconnect=function(){e.prototype.onDisconnect.call(this),this.tmp.name&&delete window[this.tmp.name]},(0,n.gn)([C.LO.shallow],t.prototype,"debug",void 0),(0,n.gn)([C.LO.shallow],t.prototype,"reload",void 0),(0,n.gn)([C.LO.shallow],t.prototype,"primary",void 0),(0,n.gn)([C.aD],t.prototype,"setReloadConfig",null),(0,n.gn)([C.aD],t.prototype,"setEpConfig",null),(0,n.gn)([C.aD],t.prototype,"setPatchAdvReload",null),t}(i.f),I=r(43654),D=r.n(I),O=function(e){function t(t){var r=e.call(this,t)||this;r.tag="ConfigStore",r.configAtom=new P(t),r.tmp.mseSupported=(0,o.a)(),(a.X.iPad.alike||a.X.tesla.alike)&&r.pointingDevice.set(2),(0,s.M)(r.rootPlayer.theme),r.revision?r.nodes.container.setAttribute("data-revision","".concat(r.revision)):r.nodes.container.removeAttribute("data-revision"),r.isChannel(f.u5.Embedded)||r.isChannel(f.u5.Embedded_White)||r.isChannel(f.u5.Embedded_Other)?r.nodes.container.classList.add("".concat(p.m,"-embedded")):r.nodes.container.classList.remove("".concat(p.m,"-embedded"));var n=r.isChannel(f.u5.PC_APP)?"add":"remove";return r.nodes.container.classList[n]("".concat(p.m,"-pc-app")),r}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{ips:0,ctrl:0,isRequestId:!1,isCompleteIdEnded:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storageKey",{get:function(){return this.configAtom.storageKey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iid",{get:function(){return this.tmp.iid||(this.tmp.iid="0",this.primary.iid&&(this.tmp.iid=this.primary.iid.toString())),this.tmp.iid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"csource",{get:function(){return this.configAtom.csource},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullWrap",{get:function(){return this.primary.fullWrap},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.primary.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"auxiliary",{get:function(){return this.primary.auxiliary||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mntAuxSender",{get:function(){if(this.primary.mntAuxSender){if("string"==typeof this.primary.mntAuxSender){var e=this.rootStore.nodes.container.querySelector(this.primary.mntAuxSender);return e&&(this.primary.mntAuxSender=e),e}return this.primary.mntAuxSender}return this.rootStore.nodes.controlBottomCenter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mntAuxConfig",{get:function(){return this.primary.mntAuxConfig?this.primary.mntAuxConfig:this.primary.mntAuxConfig={}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"channelKind",{get:function(){var e;return null!==(e=this.primary.channelKind)&&void 0!==e?e:f.u5.Default},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hideBoxShadow",{get:function(){return!!this.primary.hideBoxShadow},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorUrl",{get:function(){return"string"==typeof this.primary.errorUrl?this.primary.errorUrl.replace(/^https?:/,""):h.Ml},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHEVC",{get:function(){if(this.invalidGPU)return!1;var e=this.kvStore.state.dashConfig.enable_hevc||"1";return(!e||0!==parseInt(e))&&!!this.primary.enableHEVC},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableAV1",{get:function(){var e=this.kvStore.state.dashConfig.enable_av1||"1";return(!e||0!==parseInt(e))&&!!this.primary.enableAV1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableWMP",{get:function(){return this.enableHEVC&&!!this.primary.enableWMP},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"revision",{get:function(){return+this.primary.revision},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ctrl",{get:function(){switch(+this.primary.ctrl){case 0:case 2:case 1:return+this.primary.ctrl;default:return 0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"embeddedEnv",{get:function(){switch(this.channelKind){case f.u5.Embedded:return 1;case f.u5.Embedded_White:return 2;case f.u5.Embedded_Other:return 3;default:return 0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"businessEmbedMode",{get:function(){return!!this.primary.businessEmbededMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"businessShowDmSwitch",{get:function(){return!!this.primary.businessShowDmSwitch},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"p",{ get:function(){return+this.reload.p||1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"t",{get:function(){return null!=this.ndb.t?(0,u.o)(this.ndb.t):this.fromDid||null==this.reload.t?null:(0,u.o)(this.reload.t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"homepageT",{get:function(){var e=this.configStore.spmIdFrom;if("333.1007"===this.parseSpmidFrom(e)){var t=this.ndb.t||this.reload.t;if(t)return(0,u.o)(t)}return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extraEPInfo",{get:function(){return this.reload.extraEPInfo||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aid",{get:function(){return+this.reload.aid||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cid",{get:function(){return+this.reload.cid||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bvid",{get:function(){return this.reload.bvid||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localUrl",{get:function(){return this.reload.localUrl||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fromLocalCache",{get:function(){return this.isChannel(f.u5.PC_APP)&&!!this.reload.localCache},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seasonId",{get:function(){return+this.reload.seasonId||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"episodeId",{get:function(){return+this.reload.episodeId||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stats",{get:function(){return this.reload.stats?this.reload.stats:this.reload.stats={}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fromDid",{get:function(){return this.reload.replyDid?this.reload.replyDid:this.reload.fromDid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"replyDid",{get:function(){return this.reload.replyDid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"httpQuery",{get:function(){return this.reload.httpQuery?this.reload.httpQuery:this.reload.httpQuery={}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controlsList",{get:function(){var e=this.reload.controlsList;return(0,_.Z)(e)?e:Array.isArray(e)?this.reload.controlsList=new Set(e):this.reload.controlsList=new Set},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seasonType",{get:function(){return+this.reload.seasonType||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPrev",{get:function(){return null==this.reload.hasPrev?null:!!this.reload.hasPrev},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasNext",{get:function(){return null==this.reload.hasNext?null:!!this.reload.hasNext},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"poster",{get:function(){return!!this.reload.poster},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seekUpdateMode",{get:function(){return this.reload.seekUpdateMode||"deferred"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"preliminaryReview",{get:function(){return this.localUrl&&this.isChannel(f.u5.Manager)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tmp",{get:function(){return this.configAtom.tmp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"primary",{get:function(){return this.configAtom.primary},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reload",{get:function(){return this.configAtom.reload},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ndb",{get:function(){return this.configAtom.debug},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pid",{get:function(){return this.tmp.pid||(this.tmp.pid=(0,l.M)()),this.tmp.pid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session",{get:function(){return this.tmp.session||(this.tmp.session=g()(t.getRandomString())),this.tmp.session},set:function(e){e&&(this.tmp.session=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mseSupported",{get:function(){return this.tmp.mseSupported},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"invalidGPU",{get:function(){if(this.ndb.no_gpu)return!0;if(null==this.tmp.invalidGPU){var e=(0,c.tv)(y.Om)||"";this.tmp.invalidGPU=/Vulkan/i.test(e)}return this.tmp.invalidGPU},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointingDevice",{get:function(){return this.tmp.pointingDevice||(this.tmp.pointingDevice=new d.d9(3)),this.tmp.pointingDevice},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spmId",{get:function(){return this.stats.spmId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spmIdFrom",{get:function(){return this.stats.spmIdFrom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bSource",{get:function(){return this.stats.bSource},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"referrer",{get:function(){return"string"==typeof this.stats.referrer?this.stats.referrer:document.referrer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spmIdFromOuter",{get:function(){return this.stats.spmIdFromOuter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noDanmaku",{get:function(){return this.rootPlayer.hasFeature("noDanmaku")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outSideReload",{get:function(){return this.rootPlayer.hasFeature("outSideReload")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasAdvPermission",{get:function(){return this.rootPlayer.hasFeature("hasAdvPermission")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noVTHistory",{get:function(){return this.rootPlayer.hasFeature("noVTHistory")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onlyTouchMode",{get:function(){return this.pointingDevice.isOnlyAllow(2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestConfig",{get:function(){return this.primary.requestConfig?this.primary.requestConfig:{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pcSpecialMode",{get:function(){var e;return null===(e=this.primary)||void 0===e?void 0:e.pcSpecialMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPcApp",{get:function(){return this.isChannel(f.u5.PC_APP)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statisticsReport",{get:function(){var e={appId:100,platform:5,abtest:"",version:""};return this.configStore.isPcApp&&(e.appId=112,a.X.iOS.alike?e.platform=8:a.X.linux.alike?e.platform=9:e.platform=4),JSON.stringify(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadedIssueTime",{get:function(){var e,t;if("number"==typeof this.primary.loadedIssueTime){var r=this.primary.loadedIssueTime,n=performance.now(),i=(n-((null===(t=null===(e=this.rootStore.stageAtom.getTiming())||void 0===e?void 0:e.timing)||void 0===t?void 0:t.approxStart)||n)||0)/1e3;return Math.max(Math.ceil(r-i+1),0)}return 15},enumerable:!1,configurable:!0}),t.buvid=function(){return b.get("buvid3")},t.getRandomString=function(){return(b.get("buvid3")||Math.floor(1e5*Math.random()).toString(16))+Date.now()},t.prototype.onStateCreated=function(){e.prototype.onStateCreated.call(this),this.configAtom.setReloadConfig();var t=this.configAtom.iQuality;this.log.i("[onStateCreated]",JSON.stringify(t)),this.qualityStore.setState({nowAudio:t.aq,newAudio:t.aq,reqAudio:t.aq,nowQuality:t.vq,newQuality:t.vq,reqQuality:t.vq}),this.auxStore.setState({isListSpread:!!this.mntAuxConfig.isTabListOpen,disableListSwitch:!!this.mntAuxConfig.isUserSwitchingDisabled}),this.portStore.reqStatue(this.configAtom.iScreenKind),null!=this.configAtom.iMuted&&this.settingStore.setMuted(this.configAtom.iMuted),null!=this.ndb.ctrl?this.setState({ctrl:this.ndb.ctrl%2?2:1}):1===this.ctrl&&this.setState({ctrl:2})},t.prototype.onMount=function(){e.prototype.onMount.call(this),this.injectFnVal()},t.prototype.onCommitted=function(){e.prototype.onCommitted.call(this), this.configAtom.cleanPrefetchData(),this.configAtom.injectGlobalPlayer(),this.configAtom.fillStoryId()},t.prototype.has=function(e){return null!=this.rootPlayer.input[e]},t.prototype.remove=function(e){if("cid"===e)this.reload[e]=null},t.prototype.isChannel=function(){for(var e=this,t=[],r=0;r=1||Math.random()0?3:this.state.dmdensity===n.most||this.state.dmdensity===n.more?2:this.state.dmdensity===n.normal?3:void 0},enumerable:!1,configurable:!0}),t.prototype.onStateCreated=function(){if(e.prototype.onStateCreated.call(this),this.miniSet)this.setState({typeTopBottom:!1,speedplus:.5});else{var t=this.rootStore.localStore.get();this.setState((0,i.pi)({},t.dmSetting))}},t.prototype.onMounted=function(){var t=this;e.prototype.onMounted.call(this),this.dc.dmLocal=(0,l.EH)((function(){var e,r=t.dmSettingStore.state.dmSwitch,n=t.dmSettingStore.state.dmSwitchOut;"boolean"==typeof n&&(r=n),t.setLocal({dmSwitch:r}),null===(e=t.dmSetting({dmSwitch:r}))||void 0===e||e.catch((function(){t.track.e("danmuku_set_error",{type:0,value:r})}))}))},t.prototype.onlineSetting=function(e){this.miniSet||(this.onlineSet=e,this.setLocal(e))},t.prototype.setLocal=function(e){this.setState(e),this.localStore.set({dmSetting:e}),this.setState({currentSet:e})},t.prototype.dmSetting=function(e){var t=this,r={};if(Object.keys(e).forEach((function(n){void 0!==t.onlineSet[n]&&e[n]!==t.onlineSet[n]&&(t.onlineSet[n]=e[n],r[t.block2IO[n]]=e[n])})),Object.keys(r).length){r.ts=Date.now(),this.setTrack(r);var n=new a(this.rootPlayer),i=this.danmakuStore.dmTrack.dmSetIO||{all:0,err:0};return i.all++,this.danmakuStore.dmTrack.dmSetIO=i,n.r(r).catch((function(){return i.err++,t.danmakuStore.dmTrack.dmSetIO=i,Promise.reject()}))}return null},t.prototype.refresh=function(){this.dmSettingStore.setState({dmFresh:this.state.dmFresh+1})},t.prototype.setTrack=function(e){e.ai_level&&this.track.e("danmaku_ai_level",String(e.ai_level)),e.opacity&&this.track.e("danmaku_final_opacity",String(e.opacity)),e.speedplus&&this.track.e("danmaku_final_speed",String(e.speedplus)),e.fontsize&&this.track.e("danmaku_final_size",String(e.fontsize))},t.prototype.reportLocalDmSetting=function(){var e={},t=this.localStore.get().dmSetting||{};Object.keys(this.block2IO).forEach((function(r){void 0!==t[r]&&(e[r]=t[r])})),this.track.e("local_dm_setting",e)},t.prototype.onUnload=function(){this.reportLocalDmSetting()},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,!0)},t}(o.u)},51610:function(e,t,r){"use strict";r.d(t,{w:function(){return a},x:function(){return n}});var n,i=r(11985),o=r(58854);!function(e){e[e.BUFFERING=300]="BUFFERING",e[e.CANT_INTRACTVIE_WITH_PROGRESS_BAR=301]="CANT_INTRACTVIE_WITH_PROGRESS_BAR",e[e.AV_NOT_SYNC=302]="AV_NOT_SYNC",e[e.DM_NOT_DISPLAY=303]="DM_NOT_DISPLAY",e[e.SHOW_ADV=304]="SHOW_ADV",e[e.INFINITY_LOADING=305]="INFINITY_LOADING",e[e.BLACKSCREEN=306]="BLACKSCREEN",e[e.COLLECTION=307]="COLLECTION",e[e.CS_FEEDBACK=308]="CS_FEEDBACK",e[e.FIRST_FRAME_LOADING_FAILED=309]="FIRST_FRAME_LOADING_FAILED",e[e.CAMPUS_NET_CANNT_ACCESS=354]="CAMPUS_NET_CANNT_ACCESS",e[e.SKIP_HEAD_OR_TAIL_ERROR=553]="SKIP_HEAD_OR_TAIL_ERROR"}(n||(n={}));var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="ScreenEventsStore",t.videoInfo={},t}return(0,i.ZT)(t,e),Object.defineProperty(t.prototype,"defaultState",{get:function(){return{position:null,dmList:[],saturate:100,brightness:100,contrast:100,changeColor:null,videoInfo:null,showIssue:!1,showColor:!1,showEffect:!1,showKeyBoard:!1,showVideoInfo:!1,showSubtitleIssue:!1,showIssueFrom:"default"}},enumerable:!1,configurable:!0}),t.prototype.setVideoInfo=function(e,t){this.videoInfo.info=e,this.videoInfo.type=t,this.state.showVideoInfo&&this.setState({videoInfo:(0,i.pi)({},this.videoInfo)})},t.prototype.getVideoInfoItems=function(){var e=this.videoInfo.type;return this.generateVideoInfoItems(e)},t.prototype.getVideoInfo=function(){var e=this.videoInfo,t=e.info,r=e.type;return this.updateVideoInfoData(r,null==t?void 0:t.mediaInfo,null==t?void 0:t.statisticsInfo)},t.prototype.getDmByPosition=function(e){var t;return(null===(t=this.state.dmList)||void 0===t?void 0:t.length)&&this.setState({dmList:[]}),this.setState({position:e}),this.state.dmList},t.prototype.hideAllPopupPanel=function(){this.setState({showIssue:!1,showColor:!1,showEffect:!1,showKeyBoard:!1,showVideoInfo:!1,showSubtitleIssue:!1,showIssueFrom:"default"})},t.prototype.updateVideoInfoData=function(e,t,r){if(!t||!r)return[];if(0===Object.keys(t).length||0===Object.keys(r).length)return[];var n,i,o,a,s=t.width+" x "+t.height;"DashPlayer"===e?s+="@"+Number(t.fps).toFixed(3):(t.hasOwnProperty("sarNum")&&(s+=" [SAR "+t.sarNum+":"+t.sarDen+"]"),t.hasOwnProperty("sar")&&(s+=" [SAR "+t.sar+"]"));try{r.url&&(n=/https?:\/\/(.+?)\//.exec(r.url)[1],i=/^(https?|wss?)\:\/\/?/.exec(r.url)[1]),r.videoURL&&(o=/https?:\/\/(.+?)\//.exec(r.videoURL)[1]),r.audioURL&&(a=/https?:\/\/(.+?)\//.exec(r.audioURL)[1])}catch(e){n="",i=""}var u=r.droppedFrames+" / "+r.decodedFrames,l=this.wmpStore.isUseWasmPlayer(this.mediaStore.video)?"DashPlayer + WasmPlayer":r.playerType,c=[{name:"mimeType",data:t.mimeType},{name:"playerType",data:l},{name:"resolution",data:s},{name:"streamType",data:i},{name:"streamHost",data:n},{ name:"droppedFrames",data:u}];if("NativePlayer"===e)return c;if("FlvPlayer"===e){var d=r.currentSegmentIndex+1+"/"+r.totalSegmentCount,f=t.profile+", L"+t.level,p=t.audioSampleRate+" Hz";p+=1===(m=t.audioChannelCount)?", Mono":2===m?", Stereo":", "+m+" Channels",t.metadata&&t.metadata.description&&(p+=t.metadata.description&&/fixed_gap:True/.test(t.metadata.description)?", Fixed":"");var h=t.videoDataRate,y=t.audioDataRate;c=c.concat([{name:"fps",data:Number(t.fps).toFixed(3)},{name:"videoProfile",data:f},{name:"audioSampling",data:p},{name:"videoDatarate",data:Math.round(h)+" Kbps"},{name:"audioDatarate",data:Math.floor(y)+" Kbps"},{name:"segments",data:d},{name:"loader",data:r.loaderType},{name:"connectionSpeed",data:Math.round(r.speed)}])}if("DashPlayer"===e){var m;p=t.audioSampleRate+" Hz";p+=1===(m=t.audioChannelCount)?", Mono":2===m?", Stereo":", "+m+" Channels";h=t.videoDataRate,y=t.audioDataRate;c.splice(3,3);d=(r.audioCurrentSegmentIndex||1)+" / "+(r.audioTotalSegmentCount||0);c=c.concat([{name:"videoDatarate",data:Math.round(h/1024)+" Kbps"},{name:"audioDatarate",data:Math.floor(y/1024)+" Kbps"},{name:"segments",data:d},{name:"droppedFrames",data:u},{name:"videoStreamHost",data:o},{name:"audioStreamHost",data:a},{name:"videoConnectionSpeed",data:Math.round(r.videoConnectionSpeed)},{name:"audioConnectionSpeed",data:Math.round(r.audioConnectionSpeed)},{name:"networkActivity",data:Math.round(r.networkActivity/1024)}])}return c},t.prototype.generateVideoInfoItems=function(e){return"NativePlayer"===e?{infos:[{name:"mimeType",type:"text",title:"Mime Type",data:""},{name:"playerType",type:"text",title:"Player Type",data:""},{name:"resolution",type:"text",title:"Resolution",data:""},{name:"streamType",type:"text",title:"Stream Type",data:""},{name:"streamHost",type:"text",title:"Stream Host",data:""},{name:"droppedFrames",type:"text",title:"Dropped Frames",data:""},{name:"Log",type:"log",title:"Log",data:""}]}:"DashPlayer"===e?{infos:[{name:"mimeType",type:"text",title:"Mime Type",data:""},{name:"playerType",type:"text",title:"Player Type",data:""},{name:"resolution",type:"text",title:"Resolution",data:""},{name:"videoDatarate",type:"text",title:"Video DataRate",data:""},{name:"audioDatarate",type:"text",title:"Audio DataRate",data:""},{name:"segments",type:"text",title:"Segments",data:""},{name:"videoStreamHost",type:"text",title:"Video Host",data:""},{name:"audioStreamHost",type:"text",title:"Audio Host",data:""},{name:"videoConnectionSpeed",type:"graph",title:"Video Speed",unit:"Kbps",data:0},{name:"audioConnectionSpeed",type:"graph",title:"Audio Speed",unit:"Kbps",data:0},{name:"networkActivity",type:"graph",title:"Network Activity",unit:"KB",data:0},{name:"droppedFrames",type:"text",title:"Dropped Frames",data:""},{name:"Log",type:"log",title:"Log",data:""}]}:{infos:[{name:"mimeType",type:"text",title:"Mime Type",data:""},{name:"playerType",type:"text",title:"Player Type",data:""},{name:"resolution",type:"text",title:"Resolution",data:""},{name:"fps",type:"text",title:"FPS",data:""},{name:"videoProfile",type:"text",title:"Video Profile",data:""},{name:"audioSampling",type:"text",title:"Audio Sampling",data:""},{name:"videoDatarate",type:"text",title:"Video DataRate",data:""},{name:"audioDatarate",type:"text",title:"Audio DataRate",data:""},{name:"segments",type:"text",title:"Segments",data:""},{name:"loader",type:"text",title:"Loader",data:""},{name:"streamType",type:"text",title:"Stream Type",data:""},{name:"streamHost",type:"text",title:"Stream Host",data:""},{name:"connectionSpeed",type:"graph",title:"Connection Speed",unit:"KB/s",data:0},{name:"droppedFrames",type:"text",title:"Dropped Frames",data:""},{name:"Log",type:"log",title:"Log",data:""}]}},t.prototype.onDispose=function(){e.prototype.onDispose.call(this,{showVideoInfo:1})},t}(o.u)},89552:function(e,t,r){"use strict";r.d(t,{$:function(){return a}});var n=r(11985),i=r(59735),o=r(51513);function a(e,t){return new Promise((function(r,a){e.emit(i.t.Player_Virtual_Action,new CustomEvent(i.t.Player_Virtual_Action,{detail:{kind:o.s.GetVideoData,data:(0,n.pi)((0,n.pi)({},t),{cb:function(e){0===(null==e?void 0:e.code)?r(e):a()}})}}))}))}},58466:function(e,t,r){"use strict";r.d(t,{s:function(){return i}});var n=r(47850);function i(){return!!n.get("DedeUserID")}},57179:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;te.retried?new Promise((function(t,r){e.timer=window.setTimeout((function(){e.retried++,e.getRemoteResponse().then(t,r),e.log.i("Retry: ".concat(e.retried,"/").concat(e.config.retryCount))}),e.config.retryInterval)})):Promise.reject(t)}))},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),clearTimeout(this.timer)},t}(a.eV)},28897:function(e,t,r){"use strict";r.d(t,{U:function(){return n}});var n,i=r(11985),o=r(12809),a=r(22241),s=r(51513);!function(e){e.Section="SECTION",e.Episodes="EPISODES",e.Item="ITEM"}(n||(n={}));!function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag="HttpEpisode",t}(0,i.ZT)(t,e),t.prototype.parseOrgUgc=function(e,t){var r,n,o,s,u,l,c=[];if(!e.data)return c;var d=[],f=e.data.ugc_season,p=e.data.pages;if(f&&0===f.season_type&&Array.isArray(f.sections)){var h=0;try{for(var y=(0,i.XA)(f.sections),m=y.next();!m.done;m=y.next()){var g=m.value;if(Array.isArray(g.episodes))try{for(var v=(o=void 0,(0,i.XA)(g.episodes)),b=v.next();!b.done;b=v.next()){var _=b.value;_=Object.assign({},_,{p:++h}),d.push(_)}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{m&&!m.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}}else Array.isArray(p)&&d.push.apply(d,(0,i.ev)([],(0,i.CR)(p),!1));for(var E=0;E-1;return r?!s||i:s}return!1},t.parseFragmentVideoInfoList=function(e,r){var n=[];return Array.isArray(e)&&e.length>0?(e.forEach((function(e){var i=e.fragment_info,o=e.playable_status,a=e.video_info,u={fragmentInfo:i,playStatus:o};if(a){var l={},c=a.dash,f=a.timelength||a.time_length,p=a.accept_quality||[2],h=a.accept_description;if(l.type=a.dash.type,l.duration=f||0,l.url=c,l.type="dash",r.enableSSLStream&&"https",r.enableSSLStream&&l.url){var y=l.url;y.video=d.replaceUrlProtocol(y.video),y.audio=d.replaceUrlProtocol(y.audio)}var m=t.parseLoudnessParams(a);u=Object.assign({},u,{timelength:f,acceptQuality:p,acceptDescription:h,mediaDataSource:l,loudnessParams:m}),Array.isArray(u.acceptQuality)&&(u.acceptQuality=u.acceptQuality.map((function(e){return s.nJ.normalize(e)})))}n.push(u)})),n):[]},t.parseViewInfo=function(e){var t={};return e.qn_trial_info&&(t.qnTrialInfo=e.qn_trial_info),e.ai_repair_qn_trial_info&&(t.aiRepairQnTrialInfo=e.ai_repair_qn_trial_info),t},t.parsePlayConf=function(e){var t={isNewDescription:!1};return e&&e.is_new_description&&(t.isNewDescription=e.is_new_description),t},t.parsePlayViewBusinessInfo=function(e){var t={episodeInfo:null,userStatus:{vip_info:null,pay_info:null},seasonInfo:null},r=e.episode_info,n=e.user_status,i=e.season_info;if(r&&(t.episodeInfo=r),i&&(t.seasonInfo=i),n){var o=t.userStatus;o.vip_info=n.vip_info,o.pay_info=n.pay_info,n.watch_progress?o.watch_progress={lastEpId:n.watch_progress.last_ep_id,lastEpIndex:n.watch_progress.last_ep_index,lastTime:n.watch_progress.last_time,currentWatchProgress:n.watch_progress.current_watch_progress}:o.watch_progress={lastEpId:0,lastEpIndex:0,lastTime:0,currentWatchProgress:0}}return t},t.parseLoudnessParams=function(e){if(e.volume&&e.volume.measured_i&&e.volume.multi_scene_args){var t=e.volume,r=t.multi_scene_args,n=+t.measured_i,i=+r.undersized_target_i;if(n>=i)return{measuredI:t.measured_i,targetI:t.target_i,measuredTp:t.measured_tp,targetTp:t.target_tp,multiSceneArgs:{highDynamicTargetI:+r.high_dynamic_target_i,normalTargetI:+r.normal_target_i,undersizedTargetI:i}}}return null},t.parse=function(e,r,n){var o,a={raw:e,error:null,body:null},s=function(t,r,i){return a.error={code:f,errType:t,message:r||p,srcUrl:n,playPermissionDenied:i,raw:(0,c.Z)({},e)},a};if(!e)return s(1,"Invalid response");var l=(0,c.Z)({},e),f=l.code,p=l.message,h=l.session;if(l.result&&l.result.play_check&&l.result.play_check.play_detail===i.PLAY_NONE)return s(1,"play permission denied",!0);var y,m={},g=d.getPlayUrlBody(l),v=d.getFragmentVideoList(l),b=t.parseFragmentVideoInfoList(v,r),_=d.getPlayUrlViewInfo(l);_&&(y=t.parseViewInfo(_));var E,S,A,w=d.getPlayViewBusinessInfo(l);if(w&&(null===(o=null==(A=t.parsePlayViewBusinessInfo(w))?void 0:A.userStatus)||void 0===o?void 0:o.watch_progress)){var T=A.userStatus.watch_progress,R=T.lastEpId;E=T.currentWatchProgress,S=R}var C=d.getPlayConfInfo(l),P=t.parsePlayConf(C);switch(f){case 87005:case-403:return s(1,p||"付费稿件未付费不可观看");case 87008:case 87007:return s(1,p||"充电专属稿件未开启充电不可观看")}if(null!=f&&0!==f)return s(1,"".concat(f,":").concat(p));if(!g)return s(1,"Invalid body");var I=g.accept_quality||[2],D=g.accept_description,O=g.format,x=g.timelength,k=g.drm_tech_type,N=g.durl,L=g.dash?"dash":O&&O.indexOf("mp4")>-1?"mp4":"flv";if(!("dash"===L||Array.isArray(N)&&N.length))return s(1,"Invalid durl");var M=g.quality,F="http";switch(m.type=L,m.duration=0,L){case"dash":if(m.duration=x||0,m.url=g.dash,r.enableSSLStream&&(F="https"),r.enableSSLStream&&m.url)if("string"==typeof m.url)m.url=m.url.replace(/http:\/\//g,"https://");else{var U=m.url;if(U.video=d.replaceUrlProtocol(U.video),U.audio=d.replaceUrlProtocol(U.audio),3===k?(U.video=d.setContentProtection(U.video),U.audio=d.setContentProtection(U.audio)):2===k&&(U.video=d.setContentProtectionPSSH(U.video),U.audio=d.setContentProtectionPSSH(U.audio)),120===M&&u.X.gecko.alike)for(var B=0;B=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function R(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function C(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){R(o,n,i,a,s,"next",e)}function s(e){R(o,n,i,a,s,"throw",e)}a(void 0)}))}}function P(e,t){ if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){for(var r=0;r-1){r=!0;break}return r}}])}();O(k,"handler",void 0),O(k,"mergeConfig",(function(e,t){return w(w({},e||{}),{},{payload:w(w({},(null==e?void 0:e.payload)||{}),t||{})})}));var N=function(){var e=C(T().mark((function e(t,r,n){var i,o,a,s,u,l,c;return T().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof window){e.next=4;break}return e.next=3,r();case 3:case 8:return e.abrupt("return",e.sent);case 4:if(i=(null==n?void 0:n.payload)||{},o=i.url,a=i.headers,s=i.com2co,u=i.sign,l=i.internal,t.request){e.next=9;break}return e.next=8,r();case 9:return a&&(delete(c=w({},a)).host,delete c["accept-encoding"],t.request.headers=w(w({Accept:"application/json, text/plain, */*"},c),t.request.headers)),l&&u?(t.request.url=t.request.url.replace(".com/x/",".co/x/internal/"),t.request.params=u(w({},t.request.params||{}))):o?t.request.url=o:!1!==s&&(t.request.url=t.request.url.replace(".com",".co")),e.next=13,r();case 13:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),L=function(e){function t(e){var r;return P(this,t),O(r=v(this,t,[{handler:N,payload:{sign:e}}]),"name","SERVER_SIDE"),r}return E(t,e),D(t)}(k);function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}O(L,"handler",N);var F,U,B={exports:{}},G={exports:{}};F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&U.rotl(e,8)|4278255360&U.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,n=0;r>>6-2*n);return t}},G.exports=U;var V=G.exports,W={utf8:{stringToBytes:function(e){return W.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(W.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r>>24)|4278255360&(s[p]<<24|s[p]>>>8);s[u>>>5]|=128<>>9<<4)]=u;var h=i._ff,y=i._gg,m=i._hh,g=i._ii;for(p=0;p>>0,c=c+b>>>0,d=d+_>>>0,f=f+E>>>0}return e.endian([l,c,d,f])};i._ff=function(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+(i>>>0)+a;return(s<>>32-o)+t},i._gg=function(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+(i>>>0)+a ;return(s<>>32-o)+t},i._hh=function(e,t,r,n,i,o,a){var s=e+(t^r^n)+(i>>>0)+a;return(s<>>32-o)+t},i._ii=function(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+(i>>>0)+a;return(s<>>32-o)+t},i._blocksize=16,i._digestsize=16,B.exports=function(t,r){if(null==t)throw new Error("Illegal argument "+t);var o=e.wordsToBytes(i(t,r));return r&&r.asBytes?o:r&&r.asString?n.bytesToString(o):e.bytesToHex(o)}}();var Y=M(B.exports),K=function(e){for(var t="",r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||_e(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(e,t){if(e){if("string"==typeof e)return Ee(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ee(e,t):void 0}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r-1)return n(!0);var a=document.querySelector("#".concat(e));return a&&a.parentNode.removeChild(a),(o=o.filter((function(t){return t!==e}))).push(e),function(e,t){var r=window[Fe]||{};window[Fe]=r,r[e]=t}(i,o),n(!1)}))}function We(e,t){return new Promise((function(r,n){if(i=e,!Ue.test(i))return n(new Error("src不是一个正确的url地址!"));var i,o="bs_url_".concat(function(e){var t=0,r=-1;if(0===e.length)return t;for(;++r-1},Ke=function(e,t,r){if(e.request)if(e.request.data=JSON.stringify(t),e.request.headers)r||Ne(e.request.headers,"application/json");else{var n={};Ne(n,"application/json"),e.request.headers=n}},qe=function(){var e=ge(de().mark((function e(t,r,n){var i,o,a,s,u,l,c,d;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.request){e.next=2;break}return e.abrupt("return",r());case 2:if(i=t.request,o=i.method,a=i.params,s=i.headers,t.request.url=Ie(t.request.url,a||{}),"POST"!==o){e.next=17;break}if("[object Object]"!==Object.prototype.toString.call(t.request.data)){e.next=17;break}if(l=ke(s),c=t.request.data,null==n||null===(u=n.payload)||void 0===u||!u.stringify){e.next=14;break}return Ke(t,c,l),e.next=13,r();case 13:return e.abrupt("return",e.sent);case 14:Ye("application/x-www-form-urlencoded",l)&&(t.request.data=Ie("",c).slice(1)),Ye("application/json",l||"application/json")&&Ke(t,c,l),Ye("multipart/form-data",l)&&(d=Object.keys(c)).length&&(t.request.data=d.reduce((function(e,t){return e.append(t,c[t]),e}),new FormData));case 17:return e.next=19,r();case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),ze=function(e){function t(){var e;return ie(this,t),he(e=oe(this,t,[qe]),"name",Ae("BODY")),e}return le(t,e),ne(t)}(k);he(ze,"handler",qe);var Xe=function(){var e=ge(de().mark((function e(t,r,n){var i,o,a,s,u,l,c,d,f,p,h;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.request){e.next=2;break}return e.abrupt("return",r());case 2:return i=t.request,o=i.method,a=i.data,s=i.headers,u=(null==n?void 0:n.payload)||{},l="",c=!1,d=function(){if(!l&&!c)try{l=Ge("bili_jct",Re?{template:(null==s?void 0:s.cookie)||(null==s?void 0:s.Cookie)||"_",decode:!1}:{decode:!1}),c=!0}catch(e){Re||console.warn(e)}},f=u.key||"csrf",p=function(e){var r;if(d(),l&&t.request)if("params"!==e){if(a)switch(!0){case r=a,"undefined"!=typeof FormData&&r instanceof FormData:a.append(f,l);break;case Ce(a):a[f]=l}}else t.request.params?t.request.params[f]=l:t.request.params=he({},f,l)},"GET"===o?!0===u.params&&p("params"):"POST"===o&&(h=ke(s)||"",void 0===u.data&&void 0===u.params?h?Ye(Ze.JSON,h)?p("params"):p("data"):void 0===a||Ce(a)?p("params"):p("data"):(u.params&&p("params"),u.data&&(void 0===a&&(Ye(Ze.FormData,h)?t.request.data=new FormData:t.request.data={}),p("data")))),e.next=12,r();case 12:return e.abrupt("return",e.sent);case 13:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Qe=function(e){function t(){var e;return ie(this,t),he(e=oe(this,t,[Xe]),"name",Ae("CSRF")),e}return le(t,e),ne(t)}(k);he(Qe,"handler",Xe);var Je=function(){var e=ge(de().mark((function e(t,r){var n,i,o,a,s,u,l;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Re){e.next=2;break}throw new Error("When you are in a Node environment, please use server-side fetch middleware.");case 2:if(window.fetch){e.next=4;break}throw new Error("When you are in a non-modern browser, please manually polyfill fetch.");case 4:if(t.request){e.next=8;break}return e.next=7,r();case 7:case 11:case 19:return e.abrupt("return",e.sent);case 8:if(!t.response){e.next=12;break}return e.next=11,r();case 12:return i=t.request,o=i.url,a=i.method,s=i.headers,u=i.credentials,l=t.request.data,e.next=16,window.fetch(o,{method:a,body:l,headers:s,credentials:u,signal:null===(n=t.abortController)||void 0===n?void 0:n.signal});case 16:return t.response=e.sent,e.next=19,r();case 20:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),$e=function(e){function t(){var e;ie(this,t);for(var r=arguments.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},r={inject:function(n,i){return e.inject(t,n,i),r},disable:function(n){return e.disable(t,n),r},get:function(){return t}};return r}},{key:"inject",value:function(e,t,r){e[t]=r}},{key:"disable",value:function(e,t){e[t]=pe(pe({},e[t]||{}),{},{disabled:!0})}},{key:"get",value:function(e,t){return e[t]||{}}}])}(_t),St={INIT_CTX:Ae("INIT_CTX"),TIMEOUT:Ae("TIMEOUT"),BODY:Ae("BODY"),CSRF:Ae("CSRF"),FETCH:Ae("FETCH"),RETRY:Ae("RETRY"),SPRAY:Ae("SPRAY"),RES_DATA:Ae("RES_DATA"),RES_EXTRACT:Ae("RES_EXTRACT"),TICKET_WBI:Ae("TICKET_WBI"),LOG:Ae("LOG"),CACHE:Ae("CACHE")},At="$ORDER_",wt=function(){return ne((function e(t){ie(this,e), he(this,"middlewares",[]),he(this,"middlewareConfigCtxProvider",void 0),this.control=t,this.middlewareConfigCtxProvider=this.control.httpSvc.configCtrl.provide()}),[{key:"with",value:function(e,t){return e?("string"==typeof e?(this.middlewares.push({name:"".concat(At).concat(e),handler:nt.handler}),t&&this.inject(e,t)):"function"==typeof e?this.middlewares.push(new nt(e,t)):Te(e)&&(this.middlewares.push(e),t&&this.inject(e.name,t)),this):this}},{key:"inject",value:function(e,t){return this.middlewareConfigCtxProvider.inject(e,{payload:t}),this}},{key:"disable",value:function(e){return this.middlewareConfigCtxProvider.disable(e),this}},{key:"request",value:function(e){var t=this.control.compose(this.middlewares);return this.control.httpSvc.requestCtrl.request(e,this.middlewareConfigCtxProvider.get(),t)}}])}(),Tt=function(e){function t(){var e;ie(this,t);for(var r=arguments.length,n=new Array(r),i=0;i-1?t.middlewares[n]=e:t.middlewares.push(e)}})),r&&this.httpSvc.requestCtrl.reset()}}},{key:"setup",value:function(){return new wt(this)}},{key:"disable",value:function(e){return this.setup().disable(e)}},{key:"with",value:function(e,t){return this.setup().with(e,t)}},{key:"compose",value:function(e){var t=this,r=te(this.middlewares),n=[],i=he(he(he({},St.RETRY,null),St.BODY,null),St.RES_DATA,null),o=Object.keys(i),a={};(e||[]).forEach((function(e){if(Te(e)){var t=e.name;if(o.includes(t))i[t]||(i[t]=e);else if(t.startsWith(At)){if(t=t.substring(7),!a[t]&&!(t in i)){var s=r.findIndex((function(e){return e.name===t}));if(s>-1){var u=r[s];r.splice(s,1),a[t]=u,n.push(u)}}}else St.SPRAY===t?n.push(e):a[t]||(a[t]=e,n.push(e))}}));var s=[];r.forEach((function(e){o.includes(e.name)?i[e.name]||(i[e.name]=e):a[e.name]||s.push(e)})),s.push.apply(s,n);var u=[i[St.RETRY]||new ot,new Me].concat(s,[i[St.RES_DATA]||new tt,i[St.BODY]||new ze,new He,this.httpSvc.fetch]);return function(){var e=ge(de().mark((function e(r){var n,i,o,a,s,l,c;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=function(){return(c=ge(de().mark((function e(t){var n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==u.length){e.next=2;break}return e.abrupt("return");case 2:if(!(t<=i)){e.next=4;break}throw we(r,"The next() called multiple times");case 4:if(n=u[i=t]){e.next=8;break}throw we(r,"Middleware is not exist");case 8:return e.next=10,n.handler(r,l.bind(null,t+1),o.get(r.middleware,n.name));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)},l=function(e){return c.apply(this,arguments)},i=-1,o=t.httpSvc.configCtrl,a=o.get(r.middleware,"DEBUG").payload,e.next=7,l(0);case 7:if(!a){e.next=9;break}return e.abrupt("return",r);case 9:if(o.get(r.middleware,St.RES_EXTRACT).disabled||null===(n=r.response)||void 0===n||!n.ok){e.next=12;break}return e.abrupt("return",(null===(s=r.response)||void 0===s?void 0:s.data)||null);case 12:return e.abrupt("return",r.response);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}])}(_t),Rt=function(e){function t(){var e;ie(this,t);for(var r=arguments.length,n=new Array(r),i=0;i1&&void 0!==i[1]?i[1]:{},(n=i.length>2?i[2]:void 0)||(this.fn||this.generateRequestFunction(),n=this.fn),e.next=5,n(this.createContext(t,r,n));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"generateRequestFunction",value:function(){this.fn=this.httpSvc.assembleCtrl.compose()}},{key:"reset",value:function(){this.fn=null}},{key:"useAsyncRequest",get:function(){var e=this;return function(t,r){var n=e.httpSvc.create(r);t(n.request.bind(n))}}},{key:"createContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=e.url,i=e.method;return{config:pe({baseURL:this.httpSvc.baseURL},e),useAsyncRequest:this.useAsyncRequest,middleware:t,request:{url:n,method:(i||"get").toUpperCase(),function:r}}}}]);var r}(_t),Ct=function(){function e(t){if(ie(this,e),he(this,"fetch",void 0),he(this,"assembleCtrl",new Tt(this)),he(this,"configCtrl",new Et(this)),he(this,"requestCtrl",new Rt(this)),he(this,"baseURL","//api.domain.com"),t)if(Array.isArray(t))this.fetch=new $e,this.register(t);else{var r=t.middlewares,n=t.fetch,i=t.baseURL;this.fetch=n||new $e,this.register(r||[]),i&&(this.baseURL=i)}else this.fetch=new $e,this.register([])}return ne(e,[{key:"register",value:function(e){this.assembleCtrl.register(e)}},{key:"request",value:function(e){return this.requestCtrl.request(e)}},{key:"disable",value:function(e){return this.assembleCtrl.disable(e)}},{key:"with",value:function(e,t){return this.assembleCtrl.with(e,t)}},{key:"setFetch",value:function(e){this.fetch=e,this.requestCtrl.reset()}},{key:"create",value:function(t){return new e(pe({fetch:this.fetch},t||{}))}}])}(),Pt=function(e){function t(e){var r;ie(this,t);var n="//api.bilibili.com",i=[new mt,new Qe];if(e){var o=[],a=Array.isArray(e);(a?e:e.middlewares||[]).forEach((function(e){var t=i.findIndex((function(t){return e.name===t.name}));t>-1&&i.splice(t,1),o.push(e)})),r=oe(this,t,[{fetch:a?void 0:e.fetch,baseURL:!a&&e.baseURL||n,middlewares:[].concat(i,o)}])}else r=oe(this,t,[{baseURL:n,middlewares:[].concat(i)}]);return ae(r)}return le(t,e),ne(t)}(Ct);function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}function Dt(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Wt(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function jt(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Wt(o,n,i,a,s,"next",e)}function s(e){Wt(o,n,i,a,s,"throw",e)}a(void 0)}))}}var Ht=function(e){"undefined"!=typeof window&&window.__BILI_X_ENGINE_SCRIPT_CACHE__&&void 0!==window.__BILI_X_ENGINE_SCRIPT_CACHE__[e]&&delete window.__BILI_X_ENGINE_SCRIPT_CACHE__[e]},Zt=function(e,t){if("undefined"==typeof window)return Promise.reject(new Error("window is not defined"));var r,n=e=e.replace(/^https?:\/\//,"//"),i=(r=n, "undefined"==typeof window?null:window.__BILI_X_ENGINE_SCRIPT_CACHE__&&window.__BILI_X_ENGINE_SCRIPT_CACHE__[r]||null);if(null!=i&&i.promise)return i.promise;var o=new Promise((function(r,n){var i=document.createElement("script");i.src=e,null!=t&&t.behavior&&i.setAttribute(t.behavior,""),i.onload=function(){var i=window;if(t.lib)return i[t.lib]?r(i[t.lib]):n(new Error('Failed to access library "'+t.lib+'" from '+e));r(null)},i.onerror=function(){n(new Error("Failed to load "+e)),document.head.removeChild(i)},document.head.appendChild(i)}));return function(e,t){"undefined"!=typeof window&&(window.__BILI_X_ENGINE_SCRIPT_CACHE__||(window.__BILI_X_ENGINE_SCRIPT_CACHE__={}),window.__BILI_X_ENGINE_SCRIPT_CACHE__[e]=t)}(n,{promise:o,lib:null==t?void 0:t.lib}),o.then((function(){!1===(null==t?void 0:t.cache)&&Ht(n)})).catch((function(){!1===(null==t?void 0:t.cache)&&Ht(n)})),o},Yt=function(e){return Promise.resolve(function(){try{return window.KvSDK?Promise.resolve(window.KvSDK):Promise.resolve(Zt("//s1.hdslb.com/bfs/seed/jinkela/kv-sdk/index.js",{lib:"KvSDK"}))}catch(e){return Promise.reject(e)}}()).then((function(t){return new t(e)}))},Kt=function(e){try{return window.__biliUserFp__?Promise.resolve(window.__biliUserFp__):(window.__USER_FP_CONFIG__=e,Promise.resolve(Zt("//s1.hdslb.com/bfs/seed/jinkela/short/user-fingerprint/bili-user-fingerprint.min.js",{lib:"__biliUserFp__"})))}catch(e){return Promise.reject(e)}},qt=function(){var e=jt(Vt().mark((function e(t){var r,n;return Vt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.__riskUserLogConfig__){e.next=2;break}return e.abrupt("return",window.__riskUserLogConfig__);case 2:return e.prev=2,e.next=5,Yt({appKey:"333.1339",apiURL:"//api.bilibili.com",strict:1,nscode:9});case 5:return r=e.sent,e.next=8,r.getGroup(t);case 8:return n=e.sent,window.__riskUserLogConfig__=n,e.abrupt("return",n);case 13:return e.prev=13,e.t0=e.catch(2),console.error("fetchConfig error:",e.t0),e.abrupt("return",{payload_log:"0"});case 17:case"end":return e.stop()}}),e,null,[[2,13]])})));return function(t){return e.apply(this,arguments)}}(),zt=function(){var e=jt(Vt().mark((function e(){var t;return Vt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qt("user_log");case 2:return t=e.sent,e.abrupt("return","1"===(null==t?void 0:t.payload_log));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xt=function(){var e=jt(Vt().mark((function e(t,r,n){var i,o,a,s,u,l,c,d,f,p,h;return Vt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"undefined"!=typeof window){e.next=5;break}return e.next=4,r();case 4:case 12:case 19:return e.abrupt("return",e.sent);case 5:return e.next=7,zt();case 7:if(e.sent){e.next=13;break}return t.request&&(t.request.params=Ut(Ut({},t.request.params),{},{dm_img_switch:"0"})),e.next=12,r();case 13:return e.next=15,Kt(null!==(i=window.__USER_FP_CONFIG__)&&void 0!==i?i:{});case 15:if(window.__biliUserFp__){e.next=20;break}return console.error("__biliUserFp__ is not found"),e.next=19,r();case 20:return o=(null==n?void 0:n.payload)||{},a=o.query,s=void 0===a?{}:a,u=o.target,l=window.__biliUserFp__.queryUserLog(Ut(Ut({},s),{},{target:u})),c=Lt(l,4),d=c[0],f=c[1],p=c[2],h=c[3],t.request&&(t.request.params=Ut(Ut({},t.request.params),{},{dm_img_list:d,dm_img_str:f,dm_cover_img_str:p,dm_img_inter:h})),e.next=25,r();case 25:e.next=32;break;case 27:return e.prev=27,e.t0=e.catch(0),console.error("http-svc-risk-user-log:",e.t0),e.next=32,r();case 32:case"end":return e.stop()}}),e,null,[[0,27]])})));return function(t,r,n){return e.apply(this,arguments)}}(),Qt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bt(r=Ot(this,t,[{handler:Xt,payload:e}]),"name","RISK_USER_LOG"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nt(e,t)}(t,e),r=t,n&&Dt(r.prototype,n),i&&Dt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(k);function Jt(e,t){for(var r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function lr(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function cr(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){lr(o,n,i,a,s,"next",e)}function s(e){lr(o,n,i,a,s,"throw",e)}a(void 0)}))}}Bt(Qt,"handler",Xt);var dr="undefined"==typeof window,fr=function(e){return new Promise((function(t,r){var n=document.createElement("script");n.src=e,n.onload=function(){t()},n.onerror=function(){r(new Error("Failed to load script: ".concat(e)))},document.body.appendChild(n)}))},pr="RISK_CAPTCHA",hr=function(){var e=cr(ur().mark((function e(){var t;return ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.CaptchaLoader)){e.next=3;break}return e.abrupt("return",t);case 3:return e.next=5,fr("//s1.hdslb.com/bfs/seed/jinkela/risk-captcha-sdk/CaptchaLoader.js");case 5:return e.abrupt("return",t=window.CaptchaLoader);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),yr=function(e,t){var r;return(null===(r=e.middleware[t])||void 0===r?void 0:r.payload)||{}},mr=function(){var e=cr(ur().mark((function e(t){var r,n,i;return ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,hr();case 3:return r=e.sent,e.next=6,r.load();case 6:return n=e.sent,e.next=9,n(t);case 9:if(!(i=e.sent)){e.next=12;break}return e.abrupt("return",i);case 12:return e.abrupt("return",Promise.reject(new Error("verify captcha error: no token")));case 15:return e.prev=15,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}(),gr=function(e,t){return function(){var r=cr(ur().mark((function r(n){var i,o,a,s,u,l,c,d,f,p,h,y;return ur().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!dr){r.next=2;break}return r.abrupt("return",!1);case 2:if(r.prev=2,i={},o=n.data||{},-352!==(a=o.code)){r.next=14;break}if(s={},(u=n.headers.get("x-bili-gaia-vvoucher"))?s.v_voucher=u:Object.assign(s,(null===(l=n.data)||void 0===l?void 0:l.data)||{}),0!==Object.keys(s).length){r.next=11;break}return r.abrupt("return",!1);case 11:i.riskParams=s,r.next=26;break;case 14:if(-401!==a){r.next=20;break}if(null!==(c=n.data)&&void 0!==c&&null!==(d=c.data)&&void 0!==d&&d.ga_data){r.next=17;break}return r.abrupt("return",!1);case 17:i=null===(f=n.data)||void 0===f||null===(p=f.data)||void 0===p?void 0:p.ga_data,r.next=26;break;case 20:if(e){r.next=22;break}return r.abrupt("return",!1);case 22:if(h=e(n.data)){r.next=25;break}return r.abrupt("return",!1);case 25:i=h;case 26:return r.next=28,mr(or(or({},i),{},{fromSpmid:t}));case 28:return y=r.sent,r.abrupt("return",{event:pr,data:y});case 32:r.prev=32,r.t0=r.catch(2),console.warn(r.t0);case 35:return r.abrupt("return",!1);case 36:case"end":return r.stop()}}),r,null,[[2,32]])})));return function(e){return r.apply(this,arguments)}}()},vr=function(){var e=cr(ur().mark((function e(t,r,n){var i,o,a,s,u,l,c,d,f;return ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==n?void 0:n.payload)||{},o=i.getToken,a=i.getCaptchaOptionsFromData,s=i.fromSpmid,u=i.inApp,l=i.times,c=i.condition,d=i.onRetry,f={times:l||0,condition:function(e){return cr(ur().mark((function r(){var n;return ur().wrap((function(r){ for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,t.retry){r.next=8;break}return r.next=4,gr(a,s)(e);case 4:if(!(n=r.sent)){r.next=8;break}return f.times||(f.runtimeShortCircuit=!0),r.abrupt("return",n);case 8:if(!c){r.next=12;break}return r.next=11,c(e);case 11:return r.abrupt("return",r.sent);case 12:return r.abrupt("return",!1);case 15:return r.prev=15,r.t0=r.catch(0),r.abrupt("return",!1);case 18:case"end":return r.stop()}}),r,null,[[0,15]])})))()},onRetry:function(e,r){return cr(ur().mark((function n(){var i,a,s;return ur().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("object"!==nr(r)||(null==r?void 0:r.event)!==pr){n.next=9;break}return delete f.runtimeShortCircuit,i=r.data,n.next=5,null==o?void 0:o(i);case 5:return t&&t.response&&t.response.data&&(-401===(a=t.response.data.code)&&(e.params=or(or({},e.params||{}),{},{token:i,gaia_vtoken:i})),-352===a&&(e.params=or(or({},e.params||{}),{},{gaia_vtoken:i}),(u||null!==(s=yr(t,"APP_RUNTIME"))&&void 0!==s&&s.version)&&(e.headers=or(or({},e.headers||{}),{},ar({},"x-bili-gaia-vtoken",i))))),n.abrupt("return",e);case 9:if(!d){n.next=13;break}return n.next=12,d(e,r);case 12:return n.abrupt("return",n.sent);case 13:return n.abrupt("return",e);case 14:case"end":return n.stop()}}),n)})))()}},e.next=4,ot.handler(t,r,{payload:f});case 4:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),br=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ar(r=$t(this,t,[{handler:vr,payload:e}]),"name",St.RETRY),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}(t,e),r=t,n&&Jt(r.prototype,n),i&&Jt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(k);ar(br,"handler",vr);var _r=-352,Er=function(e,t,r){return(0,n.mG)(void 0,void 0,void 0,(function(){var o,a,s,u,l,c,d,f,p,h,y,m;return(0,n.Jh)(this,(function(g){switch(g.label){case 0:o=e.request,a=o.url,s=o.method,u=o.headers,l=o.params,g.label=1;case 1:return g.trys.push([1,3,,4]),c=(0,n.CR)(a.split("?"),2),d=c[0],c[1],f={},(null===(m=null==r?void 0:r.payload)||void 0===m?void 0:m.config)&&(f=Object.assign(f,r.payload.config)),f=Object.assign(f,{url:d,method:s,headers:u,params:l}),[4,(0,i.Z)(f)];case 2:return p=g.sent(),h=new Headers,Object.keys(p.headers).forEach((function(e){var t=p.headers[e];h.append(e,t)})),e.response={ok:!0,url:a,status:p.status,headers:h,statusText:p.statusText,data:p.data,config:f},"string"!=typeof e.response.data&&(e.response.data.__Raw__=p,e.response.data.__IsUnified__=!0),[3,4];case 3:return y=g.sent(),console.warn("Custom fetch error:",y),[3,4];case 4:return[4,t()];case 5:return[2,g.sent()]}}))}))},Sr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=Er,t.name="AXIOS_REQUEST",t}return(0,n.ZT)(t,e),t.handler=Er,t}(k),Ar=["api.bilibili.com/x/player/wbi/playurl","api.bilibili.com/x/player/wbi/v2","api.bilibili.com/x/web-interface/wbi/view/detail","api.bilibili.com/x/v2/dm/post"],wr=function(){function e(){}return e.set=function(t,r,n){n&&t&&"object"==typeof t&&e.rsCache.set(t,r)},e.get=function(t){if(t&&"object"==typeof t)return e.rsCache.get(t)},e.rsCache=new WeakMap,e}(),Tr=function(){function e(e,t){this.httpCacheSeconds=900,this.httpCacheInvalidParams=["w_rid","wts","gaia_source","gaia_vtoken"],this.baseParam=e,this.httpCaches=e.httpCaches,this.baseConfig=Object.assign({},t),this.cancelSource=i.Z.CancelToken.source(),e.httpCacheSeconds>0&&(this.httpCacheSeconds=Math.ceil(e.httpCacheSeconds)),e.httpRequests&&!this.baseConfig.noStore&&e.httpRequests.add(this)}return Object.defineProperty(e.prototype,"log",{get:function(){if(!this._cachedLog){var e=this.baseParam.log;this._cachedLog=this.tag?e.getLogger(this.tag):e}return this._cachedLog},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistent",{get:function(){return this.baseConfig.persistent},enumerable:!1,configurable:!0}),e.isCanceled=function(e){return i.Z.isCancel(e)},e.isGaiaFailed=function(t){return(null==t?void 0:t.message)===e.GAIA_RISK_HIT},e.prototype.request=function(t,r){var n=this,a=Object.assign({cancelToken:this.cancelSource.token},t),s=this.getUrlWithParams(a),u=!a.method||/^GET$/i.test(a.method);if(u&&this.baseConfig.memCache){var l=this.getHttpCache(s);if(l)return this.log.i("[hit]",s),l}!this.baseConfig.noStore&&this.log.i("request start",s);var c=this.generateRequest(a,r).then((function(t){if((null==t?void 0:t.__IsUnified__)&&t.code===_r)throw new o(e.GAIA_RISK_HIT,_r+"");if(t=(null==t?void 0:t.__Raw__)||t,!n.baseConfig.noStore&&n.log.i("request done",t.status,t.statusText,t.config.url),wr.set(t.data,s,u),n.isIllegal(t.data,!0,s)){var r=new Error("response.data is invalid");throw r.response=t,r.config=t.config,r.request=t.request,r.isAxiosError=!1,r.toJSON=function(){return t},r}return t})).catch((function(t){var o,a,u;if(!n.baseConfig.noStore&&t&&n.log.w("request fail",null===(o=t.response)||void 0===o?void 0:o.status,null===(a=t.response)||void 0===a?void 0:a.statusText,null===(u=t.config)||void 0===u?void 0:u.url,t.code,t.message),(null==r?void 0:r.isManualDeleteCache)||n.delHttpCache(s),t&&!n.baseConfig.throwLifecycle){if(i.Z.isCancel(t))return e.PENDING_PROMISE;if(t.message===e.LIFECYCLE_TOKEN)return e.PENDING_PROMISE}return Promise.reject(t)}));return this.setHttpCache(s,c,u),c},e.prototype.generateRequest=function(e,t){var r=this;if(this.canUseUnifedRequest(null==e?void 0:e.url)){var i=new Pt({fetch:new Sr});e.params?e.params.web_location=1315873:e.params={web_location:1315873};return i.with("AXIOS_REQUEST",{config:e}).with(new Qt).with(new ee,{encWbiKeys:{wbiImgKey:"5a6f002d0bb14fc9848fc64157648ad4",wbiSubKey:"0503a77b29d7409d9548fb44fe9daa1a"}}).with((function(e,t){return(0,n.mG)(r,void 0,void 0,(function(){var r,i;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return n.sent(),e.config.url.includes("api.bilibili.com/x/player/wbi/playurl")&&0===(null==(r=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)?void 0:r.code)&&(null==r?void 0:r.data.v_voucher)&&(r.code=_r),[2]}}))}))})).with(new br).request({url:e.url,params:e.params,method:e.method,headers:e.headers})}return this.getGaiaRisk(e,t)},e.prototype.canUseUnifedRequest=function(e){return!!e&&Ar.find((function(t){return e.includes(t)}))},e.prototype.getGaiaRisk=function(t,r){var a,u=this,l={};if(t.url.includes("/wbi/")||(null==r?void 0:r.wbi)){t.params=t.params||{};var c=(a=function(e){if(e.includes("?")){var t=e.split("?"),r=t[0],n=t[1];return{pureUrl:r,queryParams:s().parse(n,{ignoreQueryPrefix:!0})}}return{pureUrl:e,queryParams:{}}}(t.url)).pureUrl,d=a.queryParams;t.url=c,Object.assign(t.params,d),Object.assign(l,t.params);var f=p(t.params);f&&(t.params=f)}return(0,i.Z)(t).then((function(r){return(0,n.mG)(u,void 0,void 0,(function(){var a,s,u,c,d,f,y,m;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:if(a="",s=r.data,u=r.headers,c=(0===(null==s?void 0:s.code)||(null==s?void 0:s.code)===_r)&&(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.v_voucher),d=this.getArrayBufferCode(r)===_r&&u["x-bili-gaia-vvoucher"],!(a=c?null===(m=null==s?void 0:s.data)||void 0===m?void 0:m.v_voucher:d?u["x-bili-gaia-vvoucher"]:""))return[3,2];if(!this.canPopupVerifyCom())throw this.log.w("screen too small for validation",t.url),new o(e.GAIA_RISK_HIT,_r+"");return[4,h.loadValidateSDK({v_voucher:a})];case 1:if((f=n.sent()).token)return t.params=Object.assign({},l,{gaia_vtoken:f.token}),t.params=p(t.params),[2,(0,i.Z)(t)];throw this.log.w("failed to get token",t.url),new o(e.GAIA_RISK_HIT,_r+"");case 2:return[2,r];case 3:return[2]}}))}))}))},e.prototype.getArrayBufferCode=function(e){try{if("arraybuffer"===e.config.responseType){var t=new TextDecoder("utf-8"),r=new Uint8Array(e.data);return JSON.parse(t.decode(r)).code}}catch(e){this.log.w("[ParseError]",null==e?void 0:e.message)}return 0}, e.prototype.isIllegal=function(e,t,r){if(null==e)return this.log.e("Response: falsely"),this.delHttpCache(r||wr.get(e)),!0;if(t)return!1;if(0===e.code)return!1;try{this.log.w("Response",JSON.stringify(e))}catch(e){this.log.w("Unexpected",e&&e.message)}return this.delHttpCache(r||wr.get(e)),!0},e.prototype.getUrlWithParams=function(e){return(0,y.qx)(i.Z.create().getUri(e),this.httpCacheInvalidParams)},e.prototype.setHttpCache=function(e,t,r){r&&this.httpCaches&&e&&!this.baseConfig.noStore&&(t.__CreationTime__=Date.now(),this.httpCaches.set(e,t))},e.prototype.getHttpCache=function(e){if(this.baseConfig.memCache&&this.httpCaches){var t=this.httpCaches.get(e);if(t){var r=t.__CreationTime__,n=(Date.now()-r)/1e3;if(r&&n465}return!0},e.prototype.dispose=function(e){this.log.i("[Dispose]",e),this.cancelSource.cancel(e)},e.PENDING_PROMISE=new Promise(m.Z),e.LIFECYCLE_TOKEN="__LifecycleCanceled__",e.GAIA_RISK_HIT="__GaiaRiskHit__",e}()},54991:function(e,t,r){"use strict";r.d(t,{X:function(){return o}});var n=r(11985),i=function(){function e(e){var t=this;this.ua=e,this.getBrowserVersionDetail().then((function(e){t.versionDetail=e}))}return Object.defineProperty(e.prototype,"apple",{get:function(){return{alike:!!navigator.vendor&&/Apple/i.test(navigator.vendor)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linux",{get:function(){return{alike:/Linux/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tesla",{get:function(){return{alike:/Tesla/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iOS",{get:function(){return{alike:/Mac OS X[\s_\-\/](\d+[.\-_]\d+[.\-_]?\d*)/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"android",{get:function(){return{alike:/Android/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"windowsMobile",{get:function(){return{alike:/Windows Phone/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"webkit",{get:function(){return{alike:/AppleWebKit/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gecko",{get:function(){return{alike:/Gecko/i.test(this.ua)&&!/KHTML/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trident",{get:function(){return{alike:/Trident/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"msie",{get:function(){return{alike:window.ActiveXObject||"ActiveXObject"in window,ie11:/rv:11/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"edge",{get:function(){return{alike:/Edge/i.test(this.ua),build16299:/(\s|^)edge\/16.16299(\s|$)/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"safari",{get:function(){var e=/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.test(this.ua)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.test(this.ua);return{alike:e,mseSupported:e&&/version\/1\d/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firefox",{get:function(){return{alike:/Firefox/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chrome",{get:function(){return{alike:/Chrome/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mobile",{get:function(){return{alike:/AppleWebKit.*Mobile.*/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iPhone",{get:function(){return{alike:/iPhone/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iPad",{get:function(){return{alike:/iPad/i.test(this.ua)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"microMessenger",{get:function(){return{alike:/MicroMessenger/i.test(this.ua)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"info",{get:function(){var e=/(chrome)[ \/]([\w.]+)/.exec(this.ua)||{},t=e[5]||e[3]||e[1]||null;return{browser:t,version:t?parseInt(e[4]||e[2]||"0",10):0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cssVar",{get:function(){if("boolean"==typeof this.supportCssVar)return this.supportCssVar;var e=this.msie,t=e.alike,r=e.ie11;if(t||r)return this.supportCssVar=!1,!1;var n=this.getBrowserInfo(),i=n.browser,o=n.ver;switch(i){case"chrome":if(o<50)return this.supportCssVar=!1,!1;break;case"safari":if(o<9.5)return this.supportCssVar=!1,!1;break;case"firefox":if(o<32)return this.supportCssVar=!1,!1;break;case"opera":if(o<37)return this.supportCssVar=!1,!1;break;default:return this.supportCssVar=!1,!1}return this.supportCssVar=!0,!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vDetail",{get:function(){return this.versionDetail},enumerable:!1,configurable:!0}),e.prototype.getBrowserInfo=function(){var e,t=this.ua.match(/(msie|firefox|chrome|opera|version).*?([\d.]+)/);return{browser:null===(e=null==t?void 0:t[1])||void 0===e?void 0:e.replace(/version/,"safari"),ver:parseFloat(null==t?void 0:t[2])}},e.prototype.getBrowserVersionDetail=function(){return(0,n.mG)(this,void 0,void 0,(function(){var e,t;return(0,n.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),navigator.userAgentData&&"function"==typeof navigator.userAgentData.getHighEntropyValues?(e=["uaFullVersion","fullVersionList"],[4,navigator.userAgentData.getHighEntropyValues(e)]):[3,2];case 1:return[2,{platform:(t=r.sent()).platform,fullV:t.uaFullVersion}];case 2:return[3,4];case 3:return r.sent(),[2,null];case 4:return[2,null]}}))}))},e.prototype.isWebGL2Compatible=function(){var e=document.createElement("canvas");return!!e&&!!e.getContext("webgl2")},e}(),o=new i(navigator.userAgent.toLowerCase())},79211:function(e,t,r){"use strict";r.d(t,{x:function(){return n}});var n=new Map},15144:function(e,t,r){"use strict";r.d(t,{eF:function(){return o}});var n=r(11985),i=function(){function e(){this.zone=this.atomicBufferZone}return Object.defineProperty(e.prototype,"atomicBufferZone",{get:function(){return{paused:!0,currentTime:0,previousTimeStamp:0,currentTimeStamp:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this.zone.paused},enumerable:!1,configurable:!0}),e.prototype.getCurrentTime=function(){return this.tick(),this.zone.currentTime},e.prototype.getCurrentTimeStamp=function(){return window.performance&&performance.now?performance.now():Date.now()},e.prototype.tick=function(){if(this.zone.paused)return this.zone.currentTimeStamp=this.zone.previousTimeStamp=this.getCurrentTimeStamp(),!1;var e=this.getCurrentTimeStamp();return e-this.zone.currentTimeStamp>0&&(this.zone.previousTimeStamp=this.zone.currentTimeStamp,this.zone.currentTimeStamp=e,this.zone.currentTimeStamp&&this.zone.previousTimeStamp&&(this.zone.currentTime+=this.zone.currentTimeStamp-this.zone.previousTimeStamp)),!0},e.prototype.play=function(){return!!this.zone.paused&&(this.tick(),this.zone.paused=!1,!0)},e.prototype.pause=function(){return!this.zone.paused&&(this.tick(),this.zone.paused=!0,!0)},e.prototype.reset=function(e){return e&&(this.zone.paused||this.pause()),!!this.zone.paused&&(this.zone=this.atomicBufferZone,!0)},e}(),o=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.nid=0,t.previousTime=0,t.record=new Map,t}(0,n.ZT)(t,e),t.prototype.start=function(){return this.play()},t.prototype.stop=function(){return this.pause()},t.prototype.tape=function(e){if(this.paused)return!1;var t=e||"计次 ".concat(++this.nid),r=this.getCurrentTime();return this.record.set(t,r-this.previousTime),this.previousTime=r,!0},t.prototype.reset=function(e){return void 0===e&&(e=!1),e&&(this.paused||(this.tape("FORCE_RESET"),this.stop())), !!this.paused&&(this.record.clear(),!0)}}(i),function(e){function t(t,r,n){void 0===n&&(n=100);var i=e.call(this)||this;if(i.callback=t,i.duration=r,i.interval=n,i.timer=null,"number"!=typeof r||"number"!=typeof n)throw new Error("duration/interval MUST be a number");if(!(r>0&&n>0))throw new Error("duration/interval MUST be a positive number");return i}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"currentTime",{get:function(){return Math.min(Math.max(0,this.getCurrentTime()),this.duration)},set:function(e){this.zone.currentTime=Math.min(Math.max(0,e),this.duration)},enumerable:!1,configurable:!0}),t.prototype.startInterval=function(){var t=this;e.prototype.play.call(this),this.timer=window.setInterval((function(){var e=t.getCurrentTime();t.paused||t.callback(t.duration,e),t.duration<=e&&t.abort()}),this.interval)},t.prototype.stopInterval=function(){e.prototype.reset.call(this,!0),window.clearInterval(this.timer),this.timer=null},t.prototype.suspend=function(){return!!this.timer&&(!this.paused&&(e.prototype.pause.call(this),!0))},t.prototype.resume=function(){return this.timer?!!this.paused&&(e.prototype.play.call(this),!0):(this.startInterval(),!0)},t.prototype.abort=function(){return!!this.timer&&(this.stopInterval(),!0)},t}(i))},76123:function(e,t,r){"use strict";r.d(t,{$:function(){return i},j:function(){return o}});var n=r(11985);function i(e){var t={};return"string"==typeof e&&e.split(";").forEach((function(e){var r=(0,n.CR)(e.split(":"),2),i=r[0],o=r[1];i&&(t[i]=o)})),t}function o(e){var t={};if(!e)return t;try{t=JSON.parse(e)}catch(e){}return t||{}}},60084:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var n=r(11985),i="perf"===(0,r(4117).eY)("debug"),o=Object.create(null),a=function(){function e(){}return e.calcLoadTimes=function(){var e,t,r=[];if(!window.performance)return r;if("function"!=typeof performance.getEntriesByType)return r;var i=performance.getEntriesByType("resource");if(null==i||i.length<=0)return r;try{for(var o=(0,n.XA)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.redirectEnd-s.redirectStart,l=s.domainLookupEnd-s.domainLookupStart,c=s.connectEnd-s.connectStart,d=s.secureConnectionStart>0?s.connectEnd-s.secureConnectionStart:0,f=s.responseEnd-s.responseStart,p=s.fetchStart>0?s.responseEnd-s.fetchStart:0,h=(s.requestStart>0&&(s.responseEnd,s.requestStart),s.startTime>0?s.responseEnd-s.startTime:0);r.push({name:s.name,duration:s.duration||h||p,requestStart:s.startTime||s.fetchStart,entryType:s.entryType,initiatorType:s.initiatorType,nextHopProtocol:s.nextHopProtocol,decodedBodySize:s.decodedBodySize,transferSize:s.transferSize,redirectTime:u,dnsTime:l,tcpTime:c,sslTime:d,responseTime:f})}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return r},e.filterLoadTime=function(t){var r,i,o,a,s=e.calcLoadTimes();if("string"==typeof t)try{for(var u=(0,n.XA)(s),l=u.next();!l.done;l=u.next()){if(t===(f=l.value).name)return f}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}else try{for(var c=(0,n.XA)(s),d=c.next();!d.done;d=c.next()){var f=d.value;if(t.test(f.name))return f}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return null},e.mark=function(e){window.performance&&"function"==typeof performance.mark&&performance.mark(e)},e.clearMarks=function(e){window.performance&&"function"==typeof performance.clearMarks&&performance.clearMarks(e)},e.measure=function(e,t,r){window.performance&&"function"==typeof performance.measure&&performance.measure(e,t,r)},e.clearMeasure=function(e){window.performance&&"function"==typeof performance.clearMeasures&&performance.clearMeasures(e)},e.markOnce=function(t){o[t]||(e.mark(t),o[t]=1)},e.measureOnce=function(t,r,n){o[t]||(i&&e.measure(t,r,n),o[t]=1)},e.getMarkTimeByName=function(e){if(window.performance&&"function"==typeof performance.getEntriesByName){var t=performance.getEntriesByName(e,"mark"),r=t&&t.length&&t[0];if(r&&r.startTime)return r.startTime}return 0},e.startDetectLongTask=function(){try{var e={count:0,duration:0};if("PerformanceObserver"in window){var t=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e.count++,e.duration+=t.duration}))}));return t.observe({type:"longtask",buffered:!1}),{observer:t,clearDt:function(){e.count=0,e.duration=0},finalDt:function(){return e}}}}catch(e){return console.warn(e),null}},e}()},44425:function(e,t,r){"use strict";r.d(t,{XK:function(){return n},g6:function(){return o},nJ:function(){return a}});var n,i=r(11985);!function(e){e.UNLOGIN="unlogin",e.LOGINWITHOUTVIP="loginWithoutVip",e.LOGINWITHVIP="loginWithVip"}(n||(n={}));var o=[{value:0,name:"自动"},{value:15,name:"360P 流畅"},{value:16,name:"360P 流畅"},{value:32,name:"480P 清晰"},{value:48,name:"720P 高清"},{value:64,name:"720P 高清"},{value:74,name:"720P 高清"},{value:80,name:"1080P 高清"},{value:100,name:"智能修复",prime:!0},{value:112,name:"1080P 高码率",prime:!0},{value:116,name:"1080P 60帧",prime:!0},{value:120,name:"4K 超清",prime:!0},{value:125,name:"HDR 真彩",prime:!0},{value:126,name:"杜比视界",prime:!0},{value:127,name:"8K 超高清",prime:!0}].reduce((function(e,t){return e[t.value]=t,e}),Object.create(null)),a=function(){function e(){}return Object.defineProperty(e,"ge",{get:function(){return{privilege:100}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"gt",{get:function(){return{login:32,mseSupported:64,bigWidth:80,whiteEmbedded:32,otherEmbedded:16,ugcLogin:16,abrMax:64}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"alias",{get:function(){return{SD_32:32,FHD_80:80,AI_100:100,FHD_112:112,FHD_116:116,UHD_4K:120,UHD_HDR:125,UHD_DVision:126,UHD_8K:127,AQ_30216:30216,AQ_30232:30232,AQ_30280:30280}},enumerable:!1,configurable:!0}),e.isSuperQuality=function(t){var r=o[t];return r?!!r.prime:t>=e.ge.privilege},e.item=function(t){var r=o[t];return r?(0,i.pi)({},r):{value:t,name:"默认",prime:e.isSuperQuality(t),placeholder:!0}},e.normalize=function(e){return{1:16,2:64,3:80,4:112,48:64}[e]||+e},e.getHighestAvailableUnSuperQuality=function(t){return t.reduce((function(t,r){return!e.isSuperQuality(r)&&r>t?r:t}),-1/0)},e.getHighestAvailableSuperQuality=function(t){return t.find((function(t){return e.isSuperQuality(t)&&126!==t}))},e}()},24230:function(e,t,r){"use strict";r.d(t,{M:function(){return c}});var n=r(11985);function i(e){return e.toLowerCase()}var o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function s(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function u(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?o:r,u=t.stripRegexp,l=void 0===u?a:u,c=t.transform,d=void 0===c?i:c,f=t.delimiter,p=void 0===f?" ":f,h=s(s(e,n,"$1\0$2"),l,"\0"),y=0,m=h.length;"\0"===h.charAt(y);)y++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(y,m).split("\0").map(d).join(p)}(e,(0,n.pi)({delimiter:"."},t))}var l="__NANO_GLOBAL_THEME__";function c(e){if(!e)return!1;if(document[l])return!1;var t=[];if(Object.keys(e).filter((function(r){var i,o;"string"==typeof r&&/^bpx.+/i.test(r)&&"string"==typeof e[r]&&t.push([(i=r,void 0===o&&(o={}),u(i,(0,n.pi)({delimiter:"-"},o))),e[r]])})),!t.length)return!1;var r=t.reduce((function(e,t){return e+"--".concat(t[0],": ").concat(t[1],";")}),""),i=document.createElement("style");return i.setAttribute("data-injector","nano"),i.setAttribute("data-function","theme"),i.textContent="html { ".concat(r," }"),document.head.appendChild(i),document[l]=!0,!0}},61224:function(e,t,r){"use strict";r.d(t,{Y:function(){return i},Q:function(){return o}});var n=r(1818);var i=function(){function e(){}return e.getQueryString=function(e){return e.split("?")[1]},e.removeQueryString=function(e){var t=e.indexOf("?");return t>-1?e.slice(0,t):e},e.appendQueryString=function(e,t){return t?"".concat(e,"?").concat(t):e},e.removeBfsParams=function(e){var t=e.indexOf("@");return t>-1?e.slice(0,t):e},e.appendBfsParam=function(e,t,r){return e+=-1===e.indexOf("@")?"@":"_",e+=r+t},e.hasBfsParams=function(e){return e.indexOf("@")>-1},e.getUrlExt=function(e){return e.split(".").pop().toLowerCase()}, e.setUrlExt=function(t){var r=e.getUrlExt(e.removeBfsParams(t)),i="gif"!==r&&(0,n.x)()?"webp":r;return t+=e.hasBfsParams(t)?".".concat(i):"@.".concat(i)},e.validateBfsUrl=function(t){return-1!==["jpg","jpeg","png","webp","gif"].indexOf(e.getUrlExt(t))&&-1!==t.indexOf("/bfs/")},e.setSize=function(t,r,n){return isFinite(r)&&r>0&&(t=e.appendBfsParam(t,"w",Math.round(r))),isFinite(n)&&n>0&&(t=e.appendBfsParam(t,"h",Math.round(n))),t},e.thumbnail=function(t,r,n){if(!(t=function(e){return"string"==typeof e?e.replace(/^https?:\/\//i,"//"):e}(t))||"string"!=typeof t)return t;var i=t,o=e.getQueryString(t),a=e.removeQueryString(t),s=e.removeBfsParams(a);if(!e.validateBfsUrl(s))return i;var u=e.setSize(s,r,n),l=e.setUrlExt(u);return e.appendQueryString(l,o)},e}(),o=i.thumbnail},94422:function(e,t,r){"use strict";r.d(t,{B:function(){return n}});var n=function(){function e(){var e=this;this.state=0,this.promise=new Promise((function(t,r){e.resolve=function(r){t(r),e.state=1},e.reject=function(t){r(t),e.state=2}}))}return Object.defineProperty(e.prototype,"isPending",{get:function(){return 0===this.state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFulfilled",{get:function(){return 1===this.state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRejected",{get:function(){return 2===this.state},enumerable:!1,configurable:!0}),e}()},50295:function(e,t,r){"use strict";function n(e){var t=(new DOMParser).parseFromString(e.trim(),"text/html");return document.adoptNode(t.body.firstChild)}r.d(t,{t:function(){return n}})},27687:function(e,t,r){"use strict";function n(e){e&&e.parentElement&&e.parentElement.removeChild(e)}r.d(t,{b:function(){return n}})},57106:function(e,t,r){"use strict";r.d(t,{h:function(){return i}});var n=r(11985);function i(e){for(var t,r,i=[],o=1;o=0?"+":"-",n=function(e){return(e<10?"0":"")+e};return e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+"T"+n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())+r+n(Math.floor(Math.abs(t)/60))+":"+n(Math.abs(t)%60)}r.d(t,{p:function(){return n},r:function(){return i}})},59233:function(e,t,r){"use strict";function n(e){if(null==e)return 0;var t=e.toString().split(":").reverse();return t.length?(parseInt(t[0],10)||0)+60*(parseInt(t[1],10)||0)+3600*(parseInt(t[2],10)||0):0}function i(e){var t=/^(\d+h)?(\d+m|^s)?(\d+s)?(\d+ms)?$/.exec(e),r=function(e){return parseInt(e,10)||0};return t&&t[0]?60*r(t[1])*60+60*r(t[2])+r(t[3])+r(t[4])/1e3:parseFloat(e)>=0||-1===parseFloat(e)?parseFloat(e):0}r.d(t,{N:function(){return n},o:function(){return i}})},8109:function(e,t,r){"use strict";r.d(t,{M:function(){return i}});var n="__NANO_UNIQUE_IDENTIFIER__";function i(){return("number"!=typeof document[n]||isNaN(document[n]))&&(document[n]=0),++document[n]}},21845:function(e,t,r){"use strict";r.d(t,{g:function(){return n}});var n=new(function(){function e(){this.isDetected=!1,this.details={vendor:"",renderer:""}}return Object.defineProperty(e.prototype,"vendor",{get:function(){return this.getDetails().vendor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.getDetails().renderer},enumerable:!1,configurable:!0}),e.prototype.getIsD3D11Render=function(){var e=this.getDetails().renderer;if(e){return/.*Direct3D11.*D3D11.*/.test(e)}return!1},e.prototype.getDetails=function(){if(this.isDetected)return this.details;var e,t,r=document.createElement("canvas"),n="",i="";try{(e=r.getContext("webgl2")||r.getContext("webgl")||r.getContext("experimental-webgl"))&&(t=e.getExtension("WEBGL_debug_renderer_info"))&&(n=e.getParameter(t.UNMASKED_VENDOR_WEBGL),i=e.getParameter(t.UNMASKED_RENDERER_WEBGL))}catch(e){console.warn(e)}return this.details.vendor=n,this.details.renderer=i,this.isDetected=!0,{vendor:n,renderer:i}},e}())},63285:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(54991);function i(){return(window.AudioContext||window.webkitAudioContext)&&(window.OfflineAudioContext||window.webkitOfflineAudioContext)&&!n.X.firefox.alike&&!n.X.safari.alike}},27156:function(e,t,r){"use strict";r.d(t,{a:function(){return i}});var n=r(54991);function i(){return!(n.X.safari.alike&&!n.X.safari.mseSupported)&&(window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'))}},65228:function(e,t,r){"use strict";r.d(t,{M:function(){return i}});var n=r(79211);function i(){var e,t="[hasWebgl]";if(n.x.has(t))return n.x.get(t);try{var r=document.createElement("canvas");e=!!(r.getContext("webgl2")||r.getContext("webgl")||r.getContext("experimental-webgl"))}catch(t){e=!1}return n.x.set(t,e),e}},1818:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var n=r(79211);function i(){var e="[hasWebp]";if(n.x.has(e))return n.x.get(e);var t=!1,r=document.createElement("canvas");if(r.getContext&&r.getContext("2d"))try{t=0===r.toDataURL("image/webp").indexOf("data:image/webp")}catch(e){t=!1}return n.x.set(e,t),t}},57136:function(e,t,r){"use strict";function n(e){for(var t=[],r=1;r/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"));return n+=e[e.length-1]}r.d(t,{t:function(){return n}})},22241:function(e,t,r){"use strict";function n(e,t){return!(t<=1)&&(e>=1&&e=0&&ea,r=e.periodCounti;try{e.data=Object.assign(e.data,JSON.parse(t)),e.timeStamp=r}catch(e){}n?(e.periodTime=r,e.periodCount=0):e.periodCount+=1}}else console.warn("[StorageCache]","Trigger perf bottleneck")}function l(e){var t,r;if(e)try{for(var i=(0,n.XA)(s),o=i.next();!o.done;o=i.next()){var a=o.value,l=e.storageArea&&e.storageArea===a.storage,c=e.key&&e.key===a.storageKey;if(l&&c){u(a,e.newValue);break}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}function c(e,t){var r=function(e,t){var r,i;try{for(var o=(0,n.XA)(s),a=o.next();!a.done;a=o.next()){var u=a.value;if(u&&u.storage===e&&u.storageKey===t)return u}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return null}(e,t)||function(e,t){var r={},n={storage:e,storageKey:t,data:r,timeStamp:0,periodTime:0,periodCount:0};try{Object.assign(r,JSON.parse(e.getItem(t)))}catch(e){}return s.push(n),window.addEventListener("storage",l),n}(e,t);return r.data}},73281:function(e,t,r){"use strict";function n(e){try{return localStorage.getItem(e)}catch(e){return null}}function i(e,t){try{localStorage.setItem(e,t)}catch(e){}}function o(e){try{return sessionStorage.getItem(e)}catch(e){return null}}function a(e,t){try{sessionStorage.setItem(e,t)}catch(e){}}r.d(t,{Gg:function(){return o},KY:function(){return a},co:function(){return i},tv:function(){return n}})},93504:function(e,t,r){"use strict";r.d(t,{L:function(){return i},w:function(){return o}});var n=r(11985);function i(e){var t=(0,n.pi)({text:"",mimeType:"text/plain;charset=utf-8",filename:"text.txt",timeout:5e3},e),r=Array.isArray(t.text)?t.text:[t.text],i=new Blob(r,{type:t.mimeType}),o=document.createElement("a");o.href=URL.createObjectURL(i),o.download=t.filename,o.target="_blank",o.click(),window.setTimeout((function(){URL.revokeObjectURL(o.href)}),t.timeout)}function o(e,t){return void 0===t&&(t=".json"),new Promise((function(r,n){var i=document.createElement("input");i.type="file",i.setAttribute("accept",t),i.onchange=function(t){var o=new FileReader;o.readAsText(i.files[0]),o.onload=function(){"function"==typeof e&&e(o),r(o)},o.onerror=n,o.onabort=n},i.click()}))}},4117:function(e,t,r){"use strict";function n(e,t){var r="string"==typeof t?function(e){var t=e.indexOf("?"),r=e.indexOf("#");return-1===t?"":-1===r?e.slice(t,e.length):e.slice(t,r)}(t):window.location.search,n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),i=r.substr(1).match(n);if(null!=i)try{return decodeURIComponent(i[2])}catch(e){return null}return null}function i(e){for(var t=[],r=1;r2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,a=void 0!==o&&o;if(null!=e)if("object"!==i(e)&&(e=[e]),d(e))for(r=0,n=e.length;r0;)if(t===(r=n[i]).toLowerCase())return r;return null}var R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=function(e){return!f(e)&&e!==R};var P,I,D=(P="undefined"!=typeof Uint8Array&&s(Uint8Array),function(e){return P&&e instanceof P}),O=l("HTMLFormElement"),x=(I=Object.prototype.hasOwnProperty,function(e,t){return I.call(e,t)}),k=l("RegExp"),N=function(e,t){var r=Object.getOwnPropertyDescriptors(e),n={};w(r,(function(r,i){!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},L="abcdefghijklmnopqrstuvwxyz",M="0123456789",F={DIGIT:M,ALPHA:L,ALPHA_DIGIT:L+L.toUpperCase()+M};var U={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||a.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer)},isString:h,isNumber:m,isBoolean:function(e){return!0===e||!1===e},isObject:g,isPlainObject:v,isUndefined:f,isDate:b,isFile:_,isBlob:E,isRegExp:k,isFunction:y,isStream:function(e){return g(e)&&y(e.pipe)},isURLSearchParams:A,isTypedArray:D,isFileList:S,forEach:w,merge:function e(){for(var t=(C(this)&&this||{}).caseless,r={},n=function(n,i){var o=t&&T(r,i)||i;v(r[o])&&v(n)?r[o]=e(r[o],n):v(n)?r[o]=e({},n):d(n)?r[o]=n.slice():r[o]=n},i=0,o=arguments.length;i3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r,n){var i,o,a,u={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)a=i[o],n&&!n(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==r&&s(e) }while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:l,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(d(e))return e;var t=e.length;if(!m(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},forEachEntry:function(e,t){for(var r,n=(e&&e[Symbol.iterator]).call(e);(r=n.next())&&!r.done;){var i=r.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:O,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:N,freezeMethods:function(e){N(e,(function(t,r){if(y(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;var n=e[r];y(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:function(e,t){var r={},n=function(e){e.forEach((function(e){r[e]=!0}))};return d(e)?n(e):n(String(e).split(t)),r},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:T,global:R,isContextDefined:C,ALPHABET:F,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.ALPHA_DIGIT,r="",n=t.length;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10),r=function(e,n){if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;var i=d(e)?[]:{};return w(e,(function(e,t){var o=r(e,n+1);!f(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)}};function B(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}U.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var G=B.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){V[e]={value:e}})),Object.defineProperties(B,V),Object.defineProperty(G,"isAxiosError",{value:!0}),B.from=function(e,t,r,n,i,o){var a=Object.create(G);return U.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),B.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};var W=B;function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function H(e){return U.isPlainObject(e)||U.isArray(e)}function Z(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function Y(e,t,r){return e?e.concat(t).map((function(e,t){return e=Z(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var K=U.toFlatObject(U,{},null,(function(e){return/^is[A-Z]/.test(e)}));var q=function(e,t,r){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var n=(r=U.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!U.isUndefined(t[e])}))).metaTokens,i=r.visitor||l,o=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(U.isDate(e))return e.toISOString();if(!s&&U.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(e)||U.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,i){var s=e;if(e&&!i&&"object"===j(e))if(U.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(U.isArray(e)&&function(e){return U.isArray(e)&&!e.some(H)}(e)||(U.isFileList(e)||U.endsWith(r,"[]"))&&(s=U.toArray(e)))return r=Z(r),s.forEach((function(e,n){!U.isUndefined(e)&&null!==e&&t.append(!0===a?Y([r],n,o):null===a?r:r+"[]",u(e))})),!1;return!!H(e)||(t.append(Y(i,r,o),u(e)),!1)}var c=[],d=Object.assign(K,{defaultVisitor:l,convertValue:u,isVisitable:H});if(!U.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!U.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),U.forEach(r,(function(r,o){!0===(!(U.isUndefined(r)||null===r)&&i.call(t,r,U.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])})),c.pop()}}(e),t};function z(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&q(e,this,t)}var Q=X.prototype;Q.append=function(e,t){this._pairs.push([e,t])},Q.toString=function(e){var t=e?function(t){return e.call(this,t,z)}:z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var J=X;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ee(e,t,r){if(!t)return e;var n,i=r&&r.encode||$,o=r&&r.serialize;if(n=o?o(t,r):U.isURLSearchParams(t)?t.toString():new J(t,r).toString(i)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function re(e,t){for(var r=0;r=e.length;return o=!o&&U.isArray(n)?n.length:o,s?(U.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a):(n[o]&&U.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&U.isArray(n[o])&&(n[o]=function(e){ var t,r,n={},i=Object.keys(e),o=i.length;for(t=0;t-1,o=U.isObject(e);if(o&&U.isHTMLForm(e)&&(e=new FormData(e)),U.isFormData(e))return i&&i?JSON.stringify(fe(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return q(e,new de.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return de.isNode&&U.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=U.isFileList(e))||n.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return q(r?{"files[]":e}:e,a&&new a,this.formSerializer)}}return o||i?(t.setContentType("application/json",!1),function(e,t,r){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||he.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&U.isString(e)&&(r&&!this.responseType||n)){var i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};U.forEach(["delete","get","head"],(function(e){he.headers[e]={}})),U.forEach(["post","put","patch"],(function(e){he.headers[e]=U.merge(pe)}));var ye=he,me=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);function ge(e){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ge(e)}function ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return be(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?be(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1?r-1:0),i=1;i0;){var o=n[i],a=t[o];if(a){ var s=e[o],u=void 0===s||a(s,o,e);if(!0!==u)throw new W("option "+o+" must be "+u,W.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new W("Unknown option "+o,W.ERR_BAD_OPTION)}},validators:Ze};function qe(e){return qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(e)}function ze(e,t){for(var r=0;r0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(e,t,i){n.reason||(n.reason=new Oe(e,t,i),r(n.reason))}))}return t=e,n=[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}],(r=[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}])&&tt(t.prototype,r),n&&tt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function it(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ot(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ot(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r-1};var c=function(e,t){var r=this.__data__,n=o(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function d(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},f=d(l);var p=function(e,t){return f(a(e,t,n.Z),e+"")}},93569:function(e,t){"use strict";t.Z=function(e){return function(t){return e(t)}}},13718:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(72926),i=r(330),o=r(77618),a=r(81710),s=r(22488);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}var l=function(e,t,r){if(!(0,s.Z)(r))return!1;var n=u(t);return!!("number"==n?(0,o.Z)(r)&&(0,a.Z)(t,r.length):"string"==n&&t in r)&&(0,i.Z)(r[t],e)};var c=function(e){return(0,n.Z)((function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&l(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n-1&&e%1==0&&e=t?e:t)),e},i=r(50272);var o=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=(0,i.Z)(r))==r?r:0),void 0!==t&&(t=(t=(0,i.Z)(t))==t?t:0),n((0,i.Z)(e),t,r)}},59821:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(22488),i=r(85388),o=function(){return i.Z.Date.now()},a=r(50272),s=Math.max,u=Math.min;var l=function(e,t,r){var i,l,c,d,f,p,h=0,y=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var r=i,n=l;return i=l=void 0,h=t,d=e.apply(n,r)}function b(e){var r=e-p;return void 0===p||r>=t||r<0||m&&e-h>=c}function _(){var e=o();if(b(e))return E(e);f=setTimeout(_,function(e){var r=t-(e-p);return m?u(r,c-(e-h)):r}(e))}function E(e){return f=void 0,g&&i?v(e):(i=l=void 0,d)}function S(){var e=o(),r=b(e);if(i=arguments,l=this,p=e,r){if(void 0===f)return function(e){return h=e,f=setTimeout(_,t),y?v(e):d}(p);if(m)return clearTimeout(f),f=setTimeout(_,t),v(p)}return void 0===f&&(f=setTimeout(_,t)),d}return t=(0,a.Z)(t)||0,(0,n.Z)(r)&&(y=!!r.leading,c=(m="maxWait"in r)?s((0,a.Z)(r.maxWait)||0,t):c,g="trailing"in r?!!r.trailing:g),S.cancel=function(){void 0!==f&&clearTimeout(f),h=0,i=p=l=f=void 0},S.flush=function(){return void 0===f?d:E(o())},S}},330:function(e,t){"use strict";t.Z=function(e,t){return e===t||e!=e&&t!=t}},57955:function(e,t){"use strict";t.Z=function(e){return e}},75783:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(45132),i=r(65001);var o=function(e){return(0,i.Z)(e)&&"[object Arguments]"==(0,n.Z)(e)},a=Object.prototype,s=a.hasOwnProperty,u=a.propertyIsEnumerable,l=o(function(){return arguments}())?o:function(e){return(0,i.Z)(e)&&s.call(e,"callee")&&!u.call(e,"callee")},c=l},98411:function(e,t){"use strict";var r=Array.isArray;t.Z=r},77618:function(e,t,r){"use strict";var n=r(77128),i=r(36900);t.Z=function(e){return null!=e&&(0,i.Z)(e.length)&&!(0,n.Z)(e)}},37715:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(85388);var i=function(){return!1};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a="object"==("undefined"==typeof exports?"undefined":o(exports))&&exports&&!exports.nodeType&&exports,s=a&&"object"==("undefined"==typeof module?"undefined":o(module))&&module&&!module.nodeType&&module,u=s&&s.exports===a?n.Z.Buffer:void 0,l=(u?u.isBuffer:void 0)||i},77128:function(e,t,r){"use strict";var n=r(45132),i=r(22488);t.Z=function(e){if(!(0,i.Z)(e))return!1;var t=(0,n.Z)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},36900:function(e,t){"use strict";t.Z=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},22488:function(e,t){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.Z=function(e){ var t=r(e);return null!=e&&("object"==t||"function"==t)}},65001:function(e,t){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.Z=function(e){return null!=e&&"object"==r(e)}},36277:function(e,t,r){"use strict";var n=r(45132),i=r(88077),o=r(65001),a=Function.prototype,s=Object.prototype,u=a.toString,l=s.hasOwnProperty,c=u.call(Object);t.Z=function(e){if(!(0,o.Z)(e)||"[object Object]"!=(0,n.Z)(e))return!1;var t=(0,i.Z)(e);if(null===t)return!0;var r=l.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==c}},51282:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(39504),i=r(65001);var o=function(e){return(0,i.Z)(e)&&"[object Set]"==(0,n.Z)(e)},a=r(93569),s=r(54249),u=s.Z&&s.Z.isSet,l=u?(0,a.Z)(u):o},60579:function(e,t,r){"use strict";var n=r(45132),i=r(65001);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}t.Z=function(e){return"symbol"==o(e)||(0,i.Z)(e)&&"[object Symbol]"==(0,n.Z)(e)}},9777:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(45132),i=r(36900),o=r(65001),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var s=function(e){return(0,o.Z)(e)&&(0,i.Z)(e.length)&&!!a[(0,n.Z)(e)]},u=r(93569),l=r(54249),c=l.Z&&l.Z.isTypedArray,d=c?(0,u.Z)(c):s},53680:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(60579);var i=function(e,t,r){for(var i=-1,o=e.length;++it},a=r(57955);var s=function(e){return e&&e.length?i(e,a.Z,o):void 0}},6215:function(e,t,r){"use strict";var n=r(48735),i=(0,r(13718).Z)((function(e,t,r){(0,n.Z)(e,t,r)}));t.Z=i},50878:function(e,t){"use strict";t.Z=function(){}},86217:function(e,t,r){"use strict";var n=r(59821),i=r(22488);t.Z=function(e,t,r){var o=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return(0,i.Z)(r)&&(o="leading"in r?!!r.leading:o,a="trailing"in r?!!r.trailing:a),(0,n.Z)(e,t,{leading:o,maxWait:t,trailing:a})}},50272:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var n=/\s/;var i=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t},o=/^\s+/;var a=function(e){return e?e.slice(0,i(e)+1).replace(o,""):e},s=r(22488),u=r(60579),l=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,d=/^0o[0-7]+$/i,f=parseInt;var p=function(e){if("number"==typeof e)return e;if((0,u.Z)(e))return NaN;if((0,s.Z)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,s.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=a(e);var r=c.test(e);return r||d.test(e)?f(e.slice(2),r?2:8):l.test(e)?NaN:+e}}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdD=function(){throw new Error("define cannot be used indirect")},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);__webpack_require__.r(r);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(t){n[t]=function(){return e[t]}}));return n.default=function(){return e},__webpack_require__.d(r,n),r},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(t,r){return __webpack_require__.f[r](e,t),t}),[]))},__webpack_require__.u=function(e){return"widgets/npd."+({120:"flv-module",126:"community-helper",140:"bangumi-helper",154:"nano-panorama",361:"pc-helper",387:"manager-helper",435:"lottie_light",551:"classroom-helper",565:"drm_sdk",571:"bas-danmaku",649:"common-helper",683:"auxiliary-helper",699:"creator-helper",835:"ace",892:"root-extra",905:"embedded-helper",991:"homepage-helper"}[e]||e)+"."+{11:"5318e189",69:"72a6adbc",96:"aae7a38c",120:"797293b5",126:"15f0522c",140:"731fc9ba",142:"0a459fff",154:"f056146e",165:"1b7f1a46",181:"03df99ed",183:"1d62b394",238:"eae50c10",242:"4bd0d9ca",309:"b1ddb0cb",345:"9a257b31",361:"017c5634",387:"f5cc9b68",425:"4f8b9d1d",435:"b9c0aaac",551:"d9b648b4",565:"7d8e1e5f",571:"d2d94e06",617:"c3a747f3",649:"4d616648",683:"1ebbfeaf",699:"8ede42fd",779:"cb2791ba",835:"af94c7ba",890:"4f1ee805",892:"41a66a4f",905:"4a3bc0cf",991:"e8a3cf66"}[e]+".js"},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},inProgress={},dataWebpackPrefix="@jsc/player:",__webpack_require__.l=function(e,t,r,n){if(inProgress[e])inProgress[e].push(t);else{var i,o;if(void 0!==r)for(var a=document.getElementsByTagName("script"),s=0;s